summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Cheng-Han2016-01-17 14:28:04 -0600
committerWu Cheng-Han2016-01-17 14:28:04 -0600
commiteaa8ccaccb1091820d0a8d1223996a6dd057347d (patch)
tree6b4aaa3b3d1a2fed68147510142663222533775a
parentce65e58096d57ace02723d11a125673f9d48c293 (diff)
Upgrade CodeMirror to 5.10.1 and now support fullscreen, jump-to-line in editor
-rw-r--r--public/js/index.js7
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/comment/comment.js27
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/comment/continuecomment.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/dialog/dialog.js0
-rw-r--r--public/vendor/codemirror/addon/display/autorefresh.js47
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/display/fullscreen.css2
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/display/fullscreen.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/display/panel.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/display/placeholder.js4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/display/rulers.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/edit/closebrackets.js18
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/edit/closetag.js11
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/edit/continuelist.js8
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/edit/matchbrackets.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/edit/matchtags.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/edit/trailingspace.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/fold/brace-fold.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/fold/comment-fold.js4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/fold/foldcode.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/fold/foldgutter.css0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/fold/foldgutter.js4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/fold/indent-fold.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/fold/markdown-fold.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/fold/xml-fold.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/hint/anyword-hint.js2
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/hint/css-hint.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/hint/html-hint.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/hint/javascript-hint.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/hint/show-hint.css0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/hint/show-hint.js119
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/hint/sql-hint.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/hint/xml-hint.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/lint/coffeescript-lint.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/lint/css-lint.js0
-rw-r--r--public/vendor/codemirror/addon/lint/html-lint.js46
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/lint/javascript-lint.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/lint/json-lint.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/lint/lint.css0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/lint/lint.js34
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/lint/yaml-lint.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/merge/merge.css0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/merge/merge.js13
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/mode/loadmode.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/mode/multiplex.js6
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/mode/multiplex_test.js2
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/mode/overlay.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/mode/simple.js2
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/runmode/colorize.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/runmode/runmode-standalone.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/runmode/runmode.js2
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/runmode/runmode.node.js1
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/scroll/annotatescrollbar.js5
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/scroll/scrollpastend.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/scroll/simplescrollbars.js0
-rw-r--r--public/vendor/codemirror/addon/search/jump-to-line.js49
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/search/match-highlighter.js43
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/search/matchesonscrollbar.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/search/search.js125
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/search/searchcursor.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/selection/active-line.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/selection/mark-selection.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/selection/selection-pointer.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/tern/tern.css1
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/tern/tern.js14
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/tern/worker.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/wrap/hardwrap.js15
-rw-r--r--public/vendor/codemirror/codemirror.min.js29
-rw-r--r--public/vendor/codemirror/compress.sh3
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/keymap/emacs.js2
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/keymap/sublime.js44
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/keymap/vim.js35
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/lib/codemirror.css55
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/lib/codemirror.js559
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/apl/apl.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/apl/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/asciiarmor/asciiarmor.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/asciiarmor/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/asn.1/asn.1.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/asn.1/index.html3
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/asterisk/asterisk.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/asterisk/index.html0
-rw-r--r--public/vendor/codemirror/mode/brainfuck/brainfuck.js85
-rw-r--r--public/vendor/codemirror/mode/brainfuck/index.html85
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/clike/clike.js245
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/clike/index.html111
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/clike/scala.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/clike/test.js18
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/clojure/clojure.js3
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/clojure/index.html3
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/cmake/cmake.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/cmake/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/cobol/cobol.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/cobol/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/coffeescript/coffeescript.js40
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/coffeescript/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/commonlisp/commonlisp.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/commonlisp/index.html0
-rw-r--r--public/vendor/codemirror/mode/crystal/crystal.js391
-rw-r--r--public/vendor/codemirror/mode/crystal/index.html119
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/css/css.js147
-rw-r--r--public/vendor/codemirror/mode/css/gss.html103
-rw-r--r--public/vendor/codemirror/mode/css/gss_test.js17
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/css/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/css/less.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/css/less_test.js4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/css/scss.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/css/scss_test.js2
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/css/test.js22
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/cypher/cypher.js6
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/cypher/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/d/d.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/d/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/dart/dart.js86
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/dart/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/diff/diff.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/diff/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/django/django.js25
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/django/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/dockerfile/dockerfile.js5
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/dockerfile/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/dtd/dtd.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/dtd/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/dylan/dylan.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/dylan/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ebnf/ebnf.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ebnf/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ecl/ecl.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ecl/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/eiffel/eiffel.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/eiffel/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/elm/elm.js2
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/elm/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/erlang/erlang.js4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/erlang/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/factor/factor.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/factor/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/forth/forth.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/forth/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/fortran/fortran.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/fortran/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/gas/gas.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/gas/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/gfm/gfm.js45
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/gfm/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/gfm/test.js21
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/gherkin/gherkin.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/gherkin/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/go/go.js2
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/go/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/groovy/groovy.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/groovy/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/haml/haml.js6
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/haml/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/haml/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/handlebars/handlebars.js19
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/handlebars/index.html15
-rw-r--r--public/vendor/codemirror/mode/haskell-literate/haskell-literate.js43
-rw-r--r--public/vendor/codemirror/mode/haskell-literate/index.html282
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/haskell/haskell.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/haskell/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/haxe/haxe.js165
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/haxe/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/htmlembedded/htmlembedded.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/htmlembedded/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/htmlmixed/htmlmixed.js221
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/htmlmixed/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/http/http.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/http/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/idl/idl.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/idl/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/index.html15
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/jade/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/jade/jade.js6
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/javascript/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/javascript/javascript.js84
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/javascript/json-ld.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/javascript/test.js55
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/javascript/typescript.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/jinja2/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/jinja2/jinja2.js0
-rw-r--r--public/vendor/codemirror/mode/jsx/index.html89
-rw-r--r--public/vendor/codemirror/mode/jsx/jsx.js147
-rw-r--r--public/vendor/codemirror/mode/jsx/test.js69
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/julia/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/julia/julia.js223
-rwxr-xr-xpublic/vendor/codemirror/mode/kotlin/index.html89
-rwxr-xr-xpublic/vendor/codemirror/mode/kotlin/kotlin.js284
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/livescript/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/livescript/livescript.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/lua/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/lua/lua.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/markdown/index.html4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/markdown/markdown.js192
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/markdown/test.js176
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/mathematica/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/mathematica/mathematica.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/meta.js20
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/mirc/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/mirc/mirc.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/mllike/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/mllike/mllike.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/modelica/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/modelica/modelica.js0
-rw-r--r--public/vendor/codemirror/mode/mscgen/index.html151
-rw-r--r--public/vendor/codemirror/mode/mscgen/mscgen.js169
-rw-r--r--public/vendor/codemirror/mode/mscgen/mscgen_test.js75
-rw-r--r--public/vendor/codemirror/mode/mscgen/msgenny_test.js71
-rw-r--r--public/vendor/codemirror/mode/mscgen/xu_test.js75
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/mumps/index.html4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/mumps/mumps.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/nginx/index.html4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/nginx/nginx.js2
-rw-r--r--public/vendor/codemirror/mode/nsis/index.html80
-rw-r--r--public/vendor/codemirror/mode/nsis/nsis.js95
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ntriples/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ntriples/ntriples.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/octave/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/octave/octave.js0
-rw-r--r--public/vendor/codemirror/mode/oz/index.html59
-rw-r--r--public/vendor/codemirror/mode/oz/oz.js252
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/pascal/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/pascal/pascal.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/pegjs/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/pegjs/pegjs.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/perl/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/perl/perl.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/php/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/php/php.js20
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/php/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/pig/index.html4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/pig/pig.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/properties/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/properties/properties.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/puppet/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/puppet/puppet.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/python/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/python/python.js45
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/q/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/q/q.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/r/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/r/r.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/rpm/changes/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/rpm/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/rpm/rpm.js26
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/rst/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/rst/rst.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ruby/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ruby/ruby.js6
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ruby/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/rust/index.html22
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/rust/rust.js484
-rw-r--r--public/vendor/codemirror/mode/rust/test.js39
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/sass/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/sass/sass.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/scheme/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/scheme/scheme.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/shell/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/shell/shell.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/shell/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/sieve/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/sieve/sieve.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/slim/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/slim/slim.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/slim/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/smalltalk/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/smalltalk/smalltalk.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/smarty/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/smarty/smarty.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/solr/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/solr/solr.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/soy/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/soy/soy.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/sparql/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/sparql/sparql.js4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/spreadsheet/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/spreadsheet/spreadsheet.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/sql/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/sql/sql.js2
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/stex/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/stex/stex.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/stex/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/stylus/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/stylus/stylus.js19
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/swift/index.html20
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/swift/swift.js296
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tcl/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tcl/tcl.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/textile/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/textile/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/textile/textile.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tiddlywiki/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.css0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tiki/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tiki/tiki.css2
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tiki/tiki.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/toml/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/toml/toml.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tornado/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tornado/tornado.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/troff/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/troff/troff.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ttcn-cfg/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ttcn/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ttcn/ttcn.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/turtle/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/turtle/turtle.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/twig/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/twig/twig.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/vb/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/vb/vb.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/vbscript/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/vbscript/vbscript.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/velocity/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/velocity/velocity.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/verilog/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/verilog/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/verilog/verilog.js0
-rw-r--r--public/vendor/codemirror/mode/vhdl/index.html95
-rw-r--r--public/vendor/codemirror/mode/vhdl/vhdl.js189
-rw-r--r--public/vendor/codemirror/mode/vue/index.html69
-rw-r--r--public/vendor/codemirror/mode/vue/vue.js69
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/xml/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/xml/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/xml/xml.js148
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/xquery/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/xquery/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/xquery/xquery.js0
-rw-r--r--public/vendor/codemirror/mode/yaml-frontmatter/index.html121
-rw-r--r--public/vendor/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js68
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/yaml/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/yaml/yaml.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/z80/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/z80/z80.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/3024-day.css45
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/3024-night.css44
-rw-r--r--public/vendor/codemirror/theme/abcdef.css32
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/ambiance-mobile.css0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/ambiance.css20
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/base16-dark.css54
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/base16-light.css54
-rw-r--r--public/vendor/codemirror/theme/bespin.css34
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/blackboard.css14
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/cobalt.css12
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/colorforth.css6
-rw-r--r--public/vendor/codemirror/theme/dracula.css41
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/eclipse.css42
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/elegant.css24
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/erlang-dark.css12
-rw-r--r--public/vendor/codemirror/theme/hopscotch.css34
-rw-r--r--public/vendor/codemirror/theme/icecoder.css43
-rw-r--r--public/vendor/codemirror/theme/isotope.css34
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/lesser-dark.css32
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/liquibyte.css38
-rw-r--r--public/vendor/codemirror/theme/material.css53
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/mbo.css50
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/mdn-like.css16
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/midnight.css50
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/monokai.css47
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/neat.css6
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/neo.css14
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/night.css12
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/paraiso-dark.css52
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/paraiso-light.css52
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/pastel-on-dark.css10
-rw-r--r--public/vendor/codemirror/theme/railscasts.css34
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/rubyblue.css10
-rw-r--r--public/vendor/codemirror/theme/seti.css44
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/solarized.css22
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/the-matrix.css46
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/tomorrow-night-bright.css48
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/tomorrow-night-eighties.css52
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/ttcn.css91
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/twilight.css18
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/vibrant-ink.css22
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/xq-dark.css44
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/xq-light.css36
-rw-r--r--public/vendor/codemirror/theme/yeti.css44
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/theme/zenburn.css6
-rw-r--r--public/views/head.ejs3
381 files changed, 6754 insertions, 2664 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 9329d38a..c35c2c38 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -6,6 +6,12 @@ var version = '0.3.3';
var defaultTextHeight = 20;
var viewportMargin = 20;
var defaultExtraKeys = {
+ "F11": function(cm) {
+ cm.setOption("fullScreen", !cm.getOption("fullScreen"));
+ },
+ "Esc": function(cm) {
+ if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
+ },
"Cmd-S": function () {
return CodeMirror.PASS
},
@@ -237,6 +243,7 @@ var editor = CodeMirror.fromTextArea(textit, {
flattenSpans: true,
addModeClass: true,
readOnly: true,
+ autoRefresh: true,
placeholder: "← Start by enter title here\n===\nVisit /features if you don't know what to do.\nHappy hacking :)"
});
var inlineAttach = inlineAttachment.editors.codemirror4.attach(editor);
diff --git a/public/vendor/codemirror/addon/comment/comment.js b/public/vendor/codemirror/addon/comment/comment.js
index 2dd114d3..3aa46808 100755..100644
--- a/public/vendor/codemirror/addon/comment/comment.js
+++ b/public/vendor/codemirror/addon/comment/comment.js
@@ -21,22 +21,28 @@
}
CodeMirror.commands.toggleComment = function(cm) {
- var minLine = Infinity, ranges = cm.listSelections(), mode = null;
+ cm.toggleComment();
+ };
+
+ CodeMirror.defineExtension("toggleComment", function(options) {
+ if (!options) options = noOptions;
+ var cm = this;
+ var minLine = Infinity, ranges = this.listSelections(), mode = null;
for (var i = ranges.length - 1; i >= 0; i--) {
var from = ranges[i].from(), to = ranges[i].to();
if (from.line >= minLine) continue;
if (to.line >= minLine) to = Pos(minLine, 0);
minLine = from.line;
if (mode == null) {
- if (cm.uncomment(from, to)) mode = "un";
- else { cm.lineComment(from, to); mode = "line"; }
+ if (cm.uncomment(from, to, options)) mode = "un";
+ else { cm.lineComment(from, to, options); mode = "line"; }
} else if (mode == "un") {
- cm.uncomment(from, to);
+ cm.uncomment(from, to, options);
} else {
- cm.lineComment(from, to);
+ cm.lineComment(from, to, options);
}
}
- };
+ });
CodeMirror.defineExtension("lineComment", function(from, to, options) {
if (!options) options = noOptions;
@@ -57,7 +63,14 @@
self.operation(function() {
if (options.indent) {
- var baseString = firstLine.slice(0, firstNonWS(firstLine));
+ var baseString = null;
+ for (var i = from.line; i < end; ++i) {
+ var line = self.getLine(i);
+ var whitespace = line.slice(0, firstNonWS(line));
+ if (baseString == null || baseString.length > whitespace.length) {
+ baseString = whitespace;
+ }
+ }
for (var i = from.line; i < end; ++i) {
var line = self.getLine(i), cut = baseString.length;
if (!blankLines && !nonWS.test(line)) continue;
diff --git a/public/vendor/codemirror/addon/comment/continuecomment.js b/public/vendor/codemirror/addon/comment/continuecomment.js
index b11d51e6..b11d51e6 100755..100644
--- a/public/vendor/codemirror/addon/comment/continuecomment.js
+++ b/public/vendor/codemirror/addon/comment/continuecomment.js
diff --git a/public/vendor/codemirror/addon/dialog/dialog.js b/public/vendor/codemirror/addon/dialog/dialog.js
index 323b2007..323b2007 100755..100644
--- a/public/vendor/codemirror/addon/dialog/dialog.js
+++ b/public/vendor/codemirror/addon/dialog/dialog.js
diff --git a/public/vendor/codemirror/addon/display/autorefresh.js b/public/vendor/codemirror/addon/display/autorefresh.js
new file mode 100644
index 00000000..1e0e8504
--- /dev/null
+++ b/public/vendor/codemirror/addon/display/autorefresh.js
@@ -0,0 +1,47 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"))
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror"], mod)
+ else // Plain browser env
+ mod(CodeMirror)
+})(function(CodeMirror) {
+ "use strict"
+
+ CodeMirror.defineOption("autoRefresh", false, function(cm, val) {
+ if (cm.state.autoRefresh) {
+ stopListening(cm, cm.state.autoRefresh)
+ cm.state.autoRefresh = null
+ }
+ if (val && cm.display.wrapper.offsetHeight == 0)
+ startListening(cm, cm.state.autoRefresh = {delay: val.delay || 250})
+ })
+
+ function startListening(cm, state) {
+ function check() {
+ if (cm.display.wrapper.offsetHeight) {
+ stopListening(cm, state)
+ if (cm.display.lastWrapHeight != cm.display.wrapper.clientHeight)
+ cm.refresh()
+ } else {
+ state.timeout = setTimeout(check, state.delay)
+ }
+ }
+ state.timeout = setTimeout(check, state.delay)
+ state.hurry = function() {
+ clearTimeout(state.timeout)
+ state.timeout = setTimeout(check, 50)
+ }
+ CodeMirror.on(window, "mouseup", state.hurry)
+ CodeMirror.on(window, "keyup", state.hurry)
+ }
+
+ function stopListening(_cm, state) {
+ clearTimeout(state.timeout)
+ CodeMirror.off(window, "mouseup", state.hurry)
+ CodeMirror.off(window, "keyup", state.hurry)
+ }
+});
diff --git a/public/vendor/codemirror/addon/display/fullscreen.css b/public/vendor/codemirror/addon/display/fullscreen.css
index 437acd89..e258ad66 100755..100644
--- a/public/vendor/codemirror/addon/display/fullscreen.css
+++ b/public/vendor/codemirror/addon/display/fullscreen.css
@@ -2,5 +2,5 @@
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
height: auto;
- z-index: 9;
+ z-index: 2000;
}
diff --git a/public/vendor/codemirror/addon/display/fullscreen.js b/public/vendor/codemirror/addon/display/fullscreen.js
index cd3673b9..cd3673b9 100755..100644
--- a/public/vendor/codemirror/addon/display/fullscreen.js
+++ b/public/vendor/codemirror/addon/display/fullscreen.js
diff --git a/public/vendor/codemirror/addon/display/panel.js b/public/vendor/codemirror/addon/display/panel.js
index ba29484d..ba29484d 100755..100644
--- a/public/vendor/codemirror/addon/display/panel.js
+++ b/public/vendor/codemirror/addon/display/panel.js
diff --git a/public/vendor/codemirror/addon/display/placeholder.js b/public/vendor/codemirror/addon/display/placeholder.js
index bb0c3931..babddfb1 100755..100644
--- a/public/vendor/codemirror/addon/display/placeholder.js
+++ b/public/vendor/codemirror/addon/display/placeholder.js
@@ -37,7 +37,9 @@
var elt = cm.state.placeholder = document.createElement("pre");
elt.style.cssText = "height: 0; overflow: visible";
elt.className = "CodeMirror-placeholder";
- elt.appendChild(document.createTextNode(cm.getOption("placeholder")));
+ var placeHolder = cm.getOption("placeholder")
+ if (typeof placeHolder == "string") placeHolder = document.createTextNode(placeHolder)
+ elt.appendChild(placeHolder)
cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);
}
diff --git a/public/vendor/codemirror/addon/display/rulers.js b/public/vendor/codemirror/addon/display/rulers.js
index 01f65667..01f65667 100755..100644
--- a/public/vendor/codemirror/addon/display/rulers.js
+++ b/public/vendor/codemirror/addon/display/rulers.js
diff --git a/public/vendor/codemirror/addon/edit/closebrackets.js b/public/vendor/codemirror/addon/edit/closebrackets.js
index 1ceda4e3..3eb9d8ea 100755..100644
--- a/public/vendor/codemirror/addon/edit/closebrackets.js
+++ b/public/vendor/codemirror/addon/edit/closebrackets.js
@@ -79,7 +79,7 @@
if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;
}
cm.operation(function() {
- cm.replaceSelection("\n\n", null, "+input");
+ cm.replaceSelection("\n\n", null);
cm.execCommand("goCharLeft");
ranges = cm.listSelections();
for (var i = 0; i < ranges.length; i++) {
@@ -90,6 +90,12 @@
});
}
+ function contractSelection(sel) {
+ var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;
+ return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),
+ head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))};
+ }
+
function handleChar(cm, ch) {
var conf = getConfig(cm);
if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;
@@ -144,13 +150,17 @@
var sels = cm.getSelections();
for (var i = 0; i < sels.length; i++)
sels[i] = left + sels[i] + right;
- cm.replaceSelections(sels, "around", "+input");
+ cm.replaceSelections(sels, "around");
+ sels = cm.listSelections().slice();
+ for (var i = 0; i < sels.length; i++)
+ sels[i] = contractSelection(sels[i]);
+ cm.setSelections(sels);
} else if (type == "both") {
- cm.replaceSelection(left + right, null, "+input");
+ cm.replaceSelection(left + right, null);
cm.triggerElectric(left + right);
cm.execCommand("goCharLeft");
} else if (type == "addFour") {
- cm.replaceSelection(left + left + left + left, "before", "+input");
+ cm.replaceSelection(left + left + left + left, "before");
cm.execCommand("goCharRight");
}
});
diff --git a/public/vendor/codemirror/addon/edit/closetag.js b/public/vendor/codemirror/addon/edit/closetag.js
index c2d2263e..a518da3e 100755..100644
--- a/public/vendor/codemirror/addon/edit/closetag.js
+++ b/public/vendor/codemirror/addon/edit/closetag.js
@@ -108,21 +108,24 @@
// when completing in JS/CSS snippet in htmlmixed mode. Does not
// work for other XML embedded languages (there is no general
// way to go from a mixed mode to its current XML state).
+ var replacement;
if (inner.mode.name != "xml") {
if (cm.getMode().name == "htmlmixed" && inner.mode.name == "javascript")
- replacements[i] = head + "script>";
+ replacement = head + "script";
else if (cm.getMode().name == "htmlmixed" && inner.mode.name == "css")
- replacements[i] = head + "style>";
+ replacement = head + "style";
else
return CodeMirror.Pass;
} else {
if (!state.context || !state.context.tagName ||
closingTagExists(cm, state.context.tagName, pos, state))
return CodeMirror.Pass;
- replacements[i] = head + state.context.tagName + ">";
+ replacement = head + state.context.tagName;
}
+ if (cm.getLine(pos.line).charAt(tok.end) != ">") replacement += ">";
+ replacements[i] = replacement;
}
- cm.replaceSelections(replacements, null, '+input');
+ cm.replaceSelections(replacements);
ranges = cm.listSelections();
for (var i = 0; i < ranges.length; i++)
if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line)
diff --git a/public/vendor/codemirror/addon/edit/continuelist.js b/public/vendor/codemirror/addon/edit/continuelist.js
index a0941d4f..df5179fe 100755..100644
--- a/public/vendor/codemirror/addon/edit/continuelist.js
+++ b/public/vendor/codemirror/addon/edit/continuelist.js
@@ -11,8 +11,8 @@
})(function(CodeMirror) {
"use strict";
- var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\[\s\]\s|\[x\]\s|\s*)/,
- emptyListRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)[.)])(\[\s\]\s*|\[x\]\s|\s*)$/,
+ var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,
+ emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,
unorderedListRE = /[*+-]\s/;
CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
@@ -34,7 +34,7 @@
line: pos.line, ch: 0
}, {
line: pos.line, ch: pos.ch + 1
- }, "+delete");
+ });
replacements[i] = "\n";
} else {
var indent = match[1], after = match[5];
@@ -46,6 +46,6 @@
}
}
- cm.replaceSelections(replacements, null, "+input");
+ cm.replaceSelections(replacements);
};
});
diff --git a/public/vendor/codemirror/addon/edit/matchbrackets.js b/public/vendor/codemirror/addon/edit/matchbrackets.js
index 70e1ae18..70e1ae18 100755..100644
--- a/public/vendor/codemirror/addon/edit/matchbrackets.js
+++ b/public/vendor/codemirror/addon/edit/matchbrackets.js
diff --git a/public/vendor/codemirror/addon/edit/matchtags.js b/public/vendor/codemirror/addon/edit/matchtags.js
index fb1911a8..fb1911a8 100755..100644
--- a/public/vendor/codemirror/addon/edit/matchtags.js
+++ b/public/vendor/codemirror/addon/edit/matchtags.js
diff --git a/public/vendor/codemirror/addon/edit/trailingspace.js b/public/vendor/codemirror/addon/edit/trailingspace.js
index fa7b56be..fa7b56be 100755..100644
--- a/public/vendor/codemirror/addon/edit/trailingspace.js
+++ b/public/vendor/codemirror/addon/edit/trailingspace.js
diff --git a/public/vendor/codemirror/addon/fold/brace-fold.js b/public/vendor/codemirror/addon/fold/brace-fold.js
index 1605f6c2..1605f6c2 100755..100644
--- a/public/vendor/codemirror/addon/fold/brace-fold.js
+++ b/public/vendor/codemirror/addon/fold/brace-fold.js
diff --git a/public/vendor/codemirror/addon/fold/comment-fold.js b/public/vendor/codemirror/addon/fold/comment-fold.js
index b75db7ea..60fa3e43 100755..100644
--- a/public/vendor/codemirror/addon/fold/comment-fold.js
+++ b/public/vendor/codemirror/addon/fold/comment-fold.js
@@ -28,7 +28,9 @@ CodeMirror.registerGlobalHelper("fold", "comment", function(mode) {
continue;
}
if (pass == 1 && found < start.ch) return;
- if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)))) {
+ if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1))) &&
+ (lineText.slice(found - endToken.length, found) == endToken ||
+ !/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found))))) {
startCh = found + startToken.length;
break;
}
diff --git a/public/vendor/codemirror/addon/fold/foldcode.js b/public/vendor/codemirror/addon/fold/foldcode.js
index 62911f93..62911f93 100755..100644
--- a/public/vendor/codemirror/addon/fold/foldcode.js
+++ b/public/vendor/codemirror/addon/fold/foldcode.js
diff --git a/public/vendor/codemirror/addon/fold/foldgutter.css b/public/vendor/codemirror/addon/fold/foldgutter.css
index ad19ae2d..ad19ae2d 100755..100644
--- a/public/vendor/codemirror/addon/fold/foldgutter.css
+++ b/public/vendor/codemirror/addon/fold/foldgutter.css
diff --git a/public/vendor/codemirror/addon/fold/foldgutter.js b/public/vendor/codemirror/addon/fold/foldgutter.js
index ed7bd87d..f101e267 100755..100644
--- a/public/vendor/codemirror/addon/fold/foldgutter.js
+++ b/public/vendor/codemirror/addon/fold/foldgutter.js
@@ -20,7 +20,7 @@
cm.off("viewportChange", onViewportChange);
cm.off("fold", onFold);
cm.off("unfold", onFold);
- cm.off("swapDoc", updateInViewport);
+ cm.off("swapDoc", onChange);
}
if (val) {
cm.state.foldGutter = new State(parseOptions(val));
@@ -30,7 +30,7 @@
cm.on("viewportChange", onViewportChange);
cm.on("fold", onFold);
cm.on("unfold", onFold);
- cm.on("swapDoc", updateInViewport);
+ cm.on("swapDoc", onChange);
}
});
diff --git a/public/vendor/codemirror/addon/fold/indent-fold.js b/public/vendor/codemirror/addon/fold/indent-fold.js
index e29f15e9..e29f15e9 100755..100644
--- a/public/vendor/codemirror/addon/fold/indent-fold.js
+++ b/public/vendor/codemirror/addon/fold/indent-fold.js
diff --git a/public/vendor/codemirror/addon/fold/markdown-fold.js b/public/vendor/codemirror/addon/fold/markdown-fold.js
index ce84c946..ce84c946 100755..100644
--- a/public/vendor/codemirror/addon/fold/markdown-fold.js
+++ b/public/vendor/codemirror/addon/fold/markdown-fold.js
diff --git a/public/vendor/codemirror/addon/fold/xml-fold.js b/public/vendor/codemirror/addon/fold/xml-fold.js
index 504727f3..504727f3 100755..100644
--- a/public/vendor/codemirror/addon/fold/xml-fold.js
+++ b/public/vendor/codemirror/addon/fold/xml-fold.js
diff --git a/public/vendor/codemirror/addon/hint/anyword-hint.js b/public/vendor/codemirror/addon/hint/anyword-hint.js
index 8e74a920..dae78e2e 100755..100644
--- a/public/vendor/codemirror/addon/hint/anyword-hint.js
+++ b/public/vendor/codemirror/addon/hint/anyword-hint.js
@@ -21,7 +21,7 @@
while (start && word.test(curLine.charAt(start - 1))) --start;
var curWord = start != end && curLine.slice(start, end);
- var list = [], seen = {};
+ var list = options && options.list || [], seen = {};
var re = new RegExp(word.source, "g");
for (var dir = -1; dir <= 1; dir += 2) {
var line = cur.line, endLine = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir;
diff --git a/public/vendor/codemirror/addon/hint/css-hint.js b/public/vendor/codemirror/addon/hint/css-hint.js
index 22642727..22642727 100755..100644
--- a/public/vendor/codemirror/addon/hint/css-hint.js
+++ b/public/vendor/codemirror/addon/hint/css-hint.js
diff --git a/public/vendor/codemirror/addon/hint/html-hint.js b/public/vendor/codemirror/addon/hint/html-hint.js
index c6769bca..c6769bca 100755..100644
--- a/public/vendor/codemirror/addon/hint/html-hint.js
+++ b/public/vendor/codemirror/addon/hint/html-hint.js
diff --git a/public/vendor/codemirror/addon/hint/javascript-hint.js b/public/vendor/codemirror/addon/hint/javascript-hint.js
index 7bcbf4a0..7bcbf4a0 100755..100644
--- a/public/vendor/codemirror/addon/hint/javascript-hint.js
+++ b/public/vendor/codemirror/addon/hint/javascript-hint.js
diff --git a/public/vendor/codemirror/addon/hint/show-hint.css b/public/vendor/codemirror/addon/hint/show-hint.css
index 924e638f..924e638f 100755..100644
--- a/public/vendor/codemirror/addon/hint/show-hint.css
+++ b/public/vendor/codemirror/addon/hint/show-hint.css
diff --git a/public/vendor/codemirror/addon/hint/show-hint.js b/public/vendor/codemirror/addon/hint/show-hint.js
index d228fc88..cbe3b39a 100755..100644
--- a/public/vendor/codemirror/addon/hint/show-hint.js
+++ b/public/vendor/codemirror/addon/hint/show-hint.js
@@ -25,8 +25,18 @@
};
CodeMirror.defineExtension("showHint", function(options) {
- // We want a single cursor position.
- if (this.listSelections().length > 1 || this.somethingSelected()) return;
+ options = parseOptions(this, this.getCursor("start"), options);
+ var selections = this.listSelections()
+ if (selections.length > 1) return;
+ // By default, don't allow completion when something is selected.
+ // A hint function can have a `supportsSelection` property to
+ // indicate that it can handle selections.
+ if (this.somethingSelected()) {
+ if (!options.hint.supportsSelection) return;
+ // Don't try with cross-line selections
+ for (var i = 0; i < selections.length; i++)
+ if (selections[i].head.line != selections[i].anchor.line) return;
+ }
if (this.state.completionActive) this.state.completionActive.close();
var completion = this.state.completionActive = new Completion(this, options);
@@ -38,12 +48,12 @@
function Completion(cm, options) {
this.cm = cm;
- this.options = this.buildOptions(options);
+ this.options = options;
this.widget = null;
this.debounce = 0;
this.tick = 0;
- this.startPos = this.cm.getCursor();
- this.startLen = this.cm.getLine(this.startPos.line).length;
+ this.startPos = this.cm.getCursor("start");
+ this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;
var self = this;
cm.on("cursorActivity", this.activityFunc = function() { self.cursorActivity(); });
@@ -99,7 +109,6 @@
update: function(first) {
if (this.tick == null) return;
- if (this.data) CodeMirror.signal(this.data, "update");
if (!this.options.hint.async) {
this.finishUpdate(this.options.hint(this.cm, this.options), first);
} else {
@@ -111,6 +120,8 @@
},
finishUpdate: function(data, first) {
+ if (this.data) CodeMirror.signal(this.data, "update");
+ if (data && this.data && CodeMirror.cmpPos(data.from, this.data.from)) data = null;
this.data = data;
var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);
@@ -123,20 +134,21 @@
CodeMirror.signal(data, "shown");
}
}
- },
-
- buildOptions: function(options) {
- var editor = this.cm.options.hintOptions;
- var out = {};
- for (var prop in defaultOptions) out[prop] = defaultOptions[prop];
- if (editor) for (var prop in editor)
- if (editor[prop] !== undefined) out[prop] = editor[prop];
- if (options) for (var prop in options)
- if (options[prop] !== undefined) out[prop] = options[prop];
- return out;
}
};
+ function parseOptions(cm, pos, options) {
+ var editor = cm.options.hintOptions;
+ var out = {};
+ for (var prop in defaultOptions) out[prop] = defaultOptions[prop];
+ if (editor) for (var prop in editor)
+ if (editor[prop] !== undefined) out[prop] = editor[prop];
+ if (options) for (var prop in options)
+ if (options[prop] !== undefined) out[prop] = options[prop];
+ if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)
+ return out;
+ }
+
function getText(completion) {
if (typeof completion == "string") return completion;
else return completion.text;
@@ -335,34 +347,79 @@
}
};
- CodeMirror.registerHelper("hint", "auto", function(cm, options) {
- var helpers = cm.getHelpers(cm.getCursor(), "hint"), words;
+ function applicableHelpers(cm, helpers) {
+ if (!cm.somethingSelected()) return helpers
+ var result = []
+ for (var i = 0; i < helpers.length; i++)
+ if (helpers[i].supportsSelection) result.push(helpers[i])
+ return result
+ }
+
+ function resolveAutoHints(cm, pos) {
+ var helpers = cm.getHelpers(pos, "hint"), words
if (helpers.length) {
- for (var i = 0; i < helpers.length; i++) {
- var cur = helpers[i](cm, options);
- if (cur && cur.list.length) return cur;
+ var async = false, resolved
+ for (var i = 0; i < helpers.length; i++) if (helpers[i].async) async = true
+ if (async) {
+ resolved = function(cm, callback, options) {
+ var app = applicableHelpers(cm, helpers)
+ function run(i, result) {
+ if (i == app.length) return callback(null)
+ var helper = app[i]
+ if (helper.async) {
+ helper(cm, function(result) {
+ if (result) callback(result)
+ else run(i + 1)
+ }, options)
+ } else {
+ var result = helper(cm, options)
+ if (result) callback(result)
+ else run(i + 1)
+ }
+ }
+ run(0)
+ }
+ resolved.async = true
+ } else {
+ resolved = function(cm, options) {
+ var app = applicableHelpers(cm, helpers)
+ for (var i = 0; i < app.length; i++) {
+ var cur = app[i](cm, options)
+ if (cur && cur.list.length) return cur
+ }
+ }
}
+ resolved.supportsSelection = true
+ return resolved
} else if (words = cm.getHelper(cm.getCursor(), "hintWords")) {
- if (words) return CodeMirror.hint.fromList(cm, {words: words});
+ return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }
} else if (CodeMirror.hint.anyword) {
- return CodeMirror.hint.anyword(cm, options);
+ return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }
+ } else {
+ return function() {}
}
+ }
+
+ CodeMirror.registerHelper("hint", "auto", {
+ resolve: resolveAutoHints
});
CodeMirror.registerHelper("hint", "fromList", function(cm, options) {
var cur = cm.getCursor(), token = cm.getTokenAt(cur);
+ var to = CodeMirror.Pos(cur.line, token.end);
+ if (token.string && /\w/.test(token.string[token.string.length - 1])) {
+ var term = token.string, from = CodeMirror.Pos(cur.line, token.start);
+ } else {
+ var term = "", from = to;
+ }
var found = [];
for (var i = 0; i < options.words.length; i++) {
var word = options.words[i];
- if (word.slice(0, token.string.length) == token.string)
+ if (word.slice(0, term.length) == term)
found.push(word);
}
- if (found.length) return {
- list: found,
- from: CodeMirror.Pos(cur.line, token.start),
- to: CodeMirror.Pos(cur.line, token.end)
- };
+ if (found.length) return {list: found, from: from, to: to};
});
CodeMirror.commands.autocomplete = CodeMirror.showHint;
@@ -373,7 +430,7 @@
alignWithWord: true,
closeCharacters: /[\s()\[\]{};:>,]/,
closeOnUnfocus: true,
- completeOnSingleClick: false,
+ completeOnSingleClick: true,
container: null,
customKeys: null,
extraKeys: null
diff --git a/public/vendor/codemirror/addon/hint/sql-hint.js b/public/vendor/codemirror/addon/hint/sql-hint.js
index 22124b58..22124b58 100755..100644
--- a/public/vendor/codemirror/addon/hint/sql-hint.js
+++ b/public/vendor/codemirror/addon/hint/sql-hint.js
diff --git a/public/vendor/codemirror/addon/hint/xml-hint.js b/public/vendor/codemirror/addon/hint/xml-hint.js
index 9b9baa0c..9b9baa0c 100755..100644
--- a/public/vendor/codemirror/addon/hint/xml-hint.js
+++ b/public/vendor/codemirror/addon/hint/xml-hint.js
diff --git a/public/vendor/codemirror/addon/lint/coffeescript-lint.js b/public/vendor/codemirror/addon/lint/coffeescript-lint.js
index 7e39428f..7e39428f 100755..100644
--- a/public/vendor/codemirror/addon/lint/coffeescript-lint.js
+++ b/public/vendor/codemirror/addon/lint/coffeescript-lint.js
diff --git a/public/vendor/codemirror/addon/lint/css-lint.js b/public/vendor/codemirror/addon/lint/css-lint.js
index 1f61b479..1f61b479 100755..100644
--- a/public/vendor/codemirror/addon/lint/css-lint.js
+++ b/public/vendor/codemirror/addon/lint/css-lint.js
diff --git a/public/vendor/codemirror/addon/lint/html-lint.js b/public/vendor/codemirror/addon/lint/html-lint.js
new file mode 100644
index 00000000..1e841709
--- /dev/null
+++ b/public/vendor/codemirror/addon/lint/html-lint.js
@@ -0,0 +1,46 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+// Depends on htmlhint.js from http://htmlhint.com/js/htmlhint.js
+
+// declare global: HTMLHint
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"), require("htmlhint"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror", "htmlhint"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+ "use strict";
+
+ var defaultRules = {
+ "tagname-lowercase": true,
+ "attr-lowercase": true,
+ "attr-value-double-quotes": true,
+ "doctype-first": false,
+ "tag-pair": true,
+ "spec-char-escape": true,
+ "id-unique": true,
+ "src-not-empty": true,
+ "attr-no-duplication": true
+ };
+
+ CodeMirror.registerHelper("lint", "html", function(text, options) {
+ var found = [];
+ if (!window.HTMLHint) return found;
+ var messages = HTMLHint.verify(text, options && options.rules || defaultRules);
+ for (var i = 0; i < messages.length; i++) {
+ var message = messages[i];
+ var startLine = message.line - 1, endLine = message.line - 1, startCol = message.col - 1, endCol = message.col;
+ found.push({
+ from: CodeMirror.Pos(startLine, startCol),
+ to: CodeMirror.Pos(endLine, endCol),
+ message: message.message,
+ severity : message.type
+ });
+ }
+ return found;
+ });
+});
diff --git a/public/vendor/codemirror/addon/lint/javascript-lint.js b/public/vendor/codemirror/addon/lint/javascript-lint.js
index d4f2ae9a..d4f2ae9a 100755..100644
--- a/public/vendor/codemirror/addon/lint/javascript-lint.js
+++ b/public/vendor/codemirror/addon/lint/javascript-lint.js
diff --git a/public/vendor/codemirror/addon/lint/json-lint.js b/public/vendor/codemirror/addon/lint/json-lint.js
index 9dbb616b..9dbb616b 100755..100644
--- a/public/vendor/codemirror/addon/lint/json-lint.js
+++ b/public/vendor/codemirror/addon/lint/json-lint.js
diff --git a/public/vendor/codemirror/addon/lint/lint.css b/public/vendor/codemirror/addon/lint/lint.css
index 414a9a0e..414a9a0e 100755..100644
--- a/public/vendor/codemirror/addon/lint/lint.css
+++ b/public/vendor/codemirror/addon/lint/lint.css
diff --git a/public/vendor/codemirror/addon/lint/lint.js b/public/vendor/codemirror/addon/lint/lint.js
index 3eea203c..5afe49d0 100755..100644
--- a/public/vendor/codemirror/addon/lint/lint.js
+++ b/public/vendor/codemirror/addon/lint/lint.js
@@ -61,6 +61,7 @@
this.timeout = null;
this.hasGutter = hasGutter;
this.onMouseOver = function(e) { onMouseOver(cm, e); };
+ this.waitingFor = 0
}
function parseOptions(_cm, options) {
@@ -115,15 +116,32 @@
return tip;
}
+ function lintAsync(cm, getAnnotations, passOptions) {
+ var state = cm.state.lint
+ var id = ++state.waitingFor
+ function abort() {
+ id = -1
+ cm.off("change", abort)
+ }
+ cm.on("change", abort)
+ getAnnotations(cm.getValue(), function(annotations, arg2) {
+ cm.off("change", abort)
+ if (state.waitingFor != id) return
+ if (arg2 && annotations instanceof CodeMirror) annotations = arg2
+ updateLinting(cm, annotations)
+ }, passOptions, cm);
+ }
+
function startLinting(cm) {
var state = cm.state.lint, options = state.options;
var passOptions = options.options || options; // Support deprecated passing of `options` property in options
var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint");
if (!getAnnotations) return;
- if (options.async || getAnnotations.async)
- getAnnotations(cm.getValue(), updateLinting, passOptions, cm);
- else
+ if (options.async || getAnnotations.async) {
+ lintAsync(cm, getAnnotations, passOptions)
+ } else {
updateLinting(cm, getAnnotations(cm.getValue(), passOptions, cm));
+ }
}
function updateLinting(cm, annotationsNotSorted) {
@@ -187,7 +205,8 @@
CodeMirror.defineOption("lint", false, function(cm, val, old) {
if (old && old != CodeMirror.Init) {
clearMarks(cm);
- cm.off("change", onChange);
+ if (cm.state.lint.options.lintOnChange !== false)
+ cm.off("change", onChange);
CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver);
clearTimeout(cm.state.lint.timeout);
delete cm.state.lint;
@@ -197,11 +216,16 @@
var gutters = cm.getOption("gutters"), hasLintGutter = false;
for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true;
var state = cm.state.lint = new LintState(cm, parseOptions(cm, val), hasLintGutter);
- cm.on("change", onChange);
+ if (state.options.lintOnChange !== false)
+ cm.on("change", onChange);
if (state.options.tooltips != false)
CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver);
startLinting(cm);
}
});
+
+ CodeMirror.defineExtension("performLint", function() {
+ if (this.state.lint) startLinting(this);
+ });
});
diff --git a/public/vendor/codemirror/addon/lint/yaml-lint.js b/public/vendor/codemirror/addon/lint/yaml-lint.js
index 3f77e525..3f77e525 100755..100644
--- a/public/vendor/codemirror/addon/lint/yaml-lint.js
+++ b/public/vendor/codemirror/addon/lint/yaml-lint.js
diff --git a/public/vendor/codemirror/addon/merge/merge.css b/public/vendor/codemirror/addon/merge/merge.css
index a6a80e43..a6a80e43 100755..100644
--- a/public/vendor/codemirror/addon/merge/merge.css
+++ b/public/vendor/codemirror/addon/merge/merge.css
diff --git a/public/vendor/codemirror/addon/merge/merge.js b/public/vendor/codemirror/addon/merge/merge.js
index 5b04b032..830a5f02 100755..100644
--- a/public/vendor/codemirror/addon/merge/merge.js
+++ b/public/vendor/codemirror/addon/merge/merge.js
@@ -5,12 +5,12 @@
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"), require("diff_match_patch"));
+ mod(require("../../lib/codemirror")); // Note non-packaged dependency diff_match_patch
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror", "diff_match_patch"], mod);
else // Plain browser env
- mod(CodeMirror, diff_match_patch);
-})(function(CodeMirror, diff_match_patch) {
+ mod(CodeMirror);
+})(function(CodeMirror) {
"use strict";
var Pos = CodeMirror.Pos;
var svgNS = "http://www.w3.org/2000/svg";
@@ -471,13 +471,10 @@
if (left) left.init(leftPane, origLeft, options);
if (right) right.init(rightPane, origRight, options);
- if (options.collapseIdentical) {
- updating = true;
+ if (options.collapseIdentical)
this.editor().operation(function() {
collapseIdenticalStretches(self, options.collapseIdentical);
});
- updating = false;
- }
if (options.connect == "align") {
this.aligners = [];
alignChunks(this.left || this.right, true);
@@ -640,7 +637,7 @@
mark.clear();
cm.removeLineClass(from, "wrap", "CodeMirror-merge-collapsed-line");
}
- widget.addEventListener("click", clear);
+ CodeMirror.on(widget, "click", clear);
return {mark: mark, clear: clear};
}
diff --git a/public/vendor/codemirror/addon/mode/loadmode.js b/public/vendor/codemirror/addon/mode/loadmode.js
index 10117ec2..10117ec2 100755..100644
--- a/public/vendor/codemirror/addon/mode/loadmode.js
+++ b/public/vendor/codemirror/addon/mode/loadmode.js
diff --git a/public/vendor/codemirror/addon/mode/multiplex.js b/public/vendor/codemirror/addon/mode/multiplex.js
index fe48c7fb..3d8b34c4 100755..100644
--- a/public/vendor/codemirror/addon/mode/multiplex.js
+++ b/public/vendor/codemirror/addon/mode/multiplex.js
@@ -51,7 +51,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) {
if (!other.parseDelimiters) stream.match(other.open);
state.innerActive = other;
state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0);
- return other.delimStyle;
+ return other.delimStyle && (other.delimStyle + " " + other.delimStyle + "-open");
} else if (found != -1 && found < cutOff) {
cutOff = found;
}
@@ -70,7 +70,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) {
if (found == stream.pos && !curInner.parseDelimiters) {
stream.match(curInner.close);
state.innerActive = state.inner = null;
- return curInner.delimStyle;
+ return curInner.delimStyle && (curInner.delimStyle + " " + curInner.delimStyle + "-close");
}
if (found > -1) stream.string = oldContent.slice(0, found);
var innerToken = curInner.mode.token(stream, state.inner);
@@ -80,7 +80,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) {
state.innerActive = state.inner = null;
if (curInner.innerStyle) {
- if (innerToken) innerToken = innerToken + ' ' + curInner.innerStyle;
+ if (innerToken) innerToken = innerToken + " " + curInner.innerStyle;
else innerToken = curInner.innerStyle;
}
diff --git a/public/vendor/codemirror/addon/mode/multiplex_test.js b/public/vendor/codemirror/addon/mode/multiplex_test.js
index d3394342..24e5e670 100755..100644
--- a/public/vendor/codemirror/addon/mode/multiplex_test.js
+++ b/public/vendor/codemirror/addon/mode/multiplex_test.js
@@ -29,5 +29,5 @@
MT(
"stexInsideMarkdown",
- "[strong **Equation:**] [delim $][inner&tag \\pi][delim $]");
+ "[strong **Equation:**] [delim&delim-open $][inner&tag \\pi][delim&delim-close $]");
})();
diff --git a/public/vendor/codemirror/addon/mode/overlay.js b/public/vendor/codemirror/addon/mode/overlay.js
index e1b9ed37..e1b9ed37 100755..100644
--- a/public/vendor/codemirror/addon/mode/overlay.js
+++ b/public/vendor/codemirror/addon/mode/overlay.js
diff --git a/public/vendor/codemirror/addon/mode/simple.js b/public/vendor/codemirror/addon/mode/simple.js
index 795328b8..df663365 100755..100644
--- a/public/vendor/codemirror/addon/mode/simple.js
+++ b/public/vendor/codemirror/addon/mode/simple.js
@@ -60,7 +60,7 @@
function ensureState(states, name) {
if (!states.hasOwnProperty(name))
- throw new Error("Undefined state " + name + "in simple mode");
+ throw new Error("Undefined state " + name + " in simple mode");
}
function toRegex(val, caret) {
diff --git a/public/vendor/codemirror/addon/runmode/colorize.js b/public/vendor/codemirror/addon/runmode/colorize.js
index eb7060d0..eb7060d0 100755..100644
--- a/public/vendor/codemirror/addon/runmode/colorize.js
+++ b/public/vendor/codemirror/addon/runmode/colorize.js
diff --git a/public/vendor/codemirror/addon/runmode/runmode-standalone.js b/public/vendor/codemirror/addon/runmode/runmode-standalone.js
index f4f352c8..f4f352c8 100755..100644
--- a/public/vendor/codemirror/addon/runmode/runmode-standalone.js
+++ b/public/vendor/codemirror/addon/runmode/runmode-standalone.js
diff --git a/public/vendor/codemirror/addon/runmode/runmode.js b/public/vendor/codemirror/addon/runmode/runmode.js
index 07d2279f..a51c6d0d 100755..100644
--- a/public/vendor/codemirror/addon/runmode/runmode.js
+++ b/public/vendor/codemirror/addon/runmode/runmode.js
@@ -16,7 +16,7 @@ CodeMirror.runMode = function(string, modespec, callback, options) {
var ie = /MSIE \d/.test(navigator.userAgent);
var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9);
- if (callback.nodeType == 1) {
+ if (callback.appendChild) {
var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;
var node = callback, col = 0;
node.innerHTML = "";
diff --git a/public/vendor/codemirror/addon/runmode/runmode.node.js b/public/vendor/codemirror/addon/runmode/runmode.node.js
index 8f345a32..b22a5187 100755..100644
--- a/public/vendor/codemirror/addon/runmode/runmode.node.js
+++ b/public/vendor/codemirror/addon/runmode/runmode.node.js
@@ -176,3 +176,4 @@ exports.runMode = function(string, modespec, callback, options) {
};
require.cache[require.resolve("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")];
+require.cache[require.resolve("../../addon/runmode/runmode")] = require.cache[require.resolve("./runmode.node")];
diff --git a/public/vendor/codemirror/addon/scroll/annotatescrollbar.js b/public/vendor/codemirror/addon/scroll/annotatescrollbar.js
index bbbfa59c..3f80f483 100755..100644
--- a/public/vendor/codemirror/addon/scroll/annotatescrollbar.js
+++ b/public/vendor/codemirror/addon/scroll/annotatescrollbar.js
@@ -51,7 +51,7 @@
Annotation.prototype.computeScale = function() {
var cm = this.cm;
var hScale = (cm.getWrapperElement().clientHeight - cm.display.barHeight - this.buttonHeight * 2) /
- cm.heightAtLine(cm.lastLine() + 1, "local");
+ cm.getScrollerElement().scrollHeight
if (hScale != this.hScale) {
this.hScale = hScale;
return true;
@@ -100,6 +100,9 @@
elt.style.cssText = "position: absolute; right: 0px; width: " + Math.max(cm.display.barWidth * 1.5, 2) + "px; top: "
+ (top + this.buttonHeight) + "px; height: " + height + "px";
elt.className = this.options.className;
+ if (ann.id) {
+ elt.setAttribute("annotation-id", ann.id);
+ }
}
this.div.textContent = "";
this.div.appendChild(frag);
diff --git a/public/vendor/codemirror/addon/scroll/scrollpastend.js b/public/vendor/codemirror/addon/scroll/scrollpastend.js
index 008ae4c7..008ae4c7 100755..100644
--- a/public/vendor/codemirror/addon/scroll/scrollpastend.js
+++ b/public/vendor/codemirror/addon/scroll/scrollpastend.js
diff --git a/public/vendor/codemirror/addon/scroll/simplescrollbars.js b/public/vendor/codemirror/addon/scroll/simplescrollbars.js
index f78353a1..f78353a1 100755..100644
--- a/public/vendor/codemirror/addon/scroll/simplescrollbars.js
+++ b/public/vendor/codemirror/addon/scroll/simplescrollbars.js
diff --git a/public/vendor/codemirror/addon/search/jump-to-line.js b/public/vendor/codemirror/addon/search/jump-to-line.js
new file mode 100644
index 00000000..8b599cbc
--- /dev/null
+++ b/public/vendor/codemirror/addon/search/jump-to-line.js
@@ -0,0 +1,49 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+// Defines jumpToLine command. Uses dialog.js if present.
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"), require("../dialog/dialog"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror", "../dialog/dialog"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+ "use strict";
+
+ function dialog(cm, text, shortText, deflt, f) {
+ if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
+ else f(prompt(shortText, deflt));
+ }
+
+ var jumpDialog =
+ 'Jump to line: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use line:column or scroll% syntax)</span>';
+
+ function interpretLine(cm, string) {
+ var num = Number(string)
+ if (/^[-+]/.test(string)) return cm.getCursor().line + num
+ else return num - 1
+ }
+
+ CodeMirror.commands.jumpToLine = function(cm) {
+ var cur = cm.getCursor();
+ dialog(cm, jumpDialog, "Jump to line:", (cur.line + 1) + ":" + cur.ch, function(posStr) {
+ if (!posStr) return;
+
+ var match;
+ if (match = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(posStr)) {
+ cm.setCursor(interpretLine(cm, match[1]), Number(match[2]))
+ } else if (match = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(posStr)) {
+ var line = Math.round(cm.lineCount() * Number(match[1]) / 100);
+ if (/^[-+]/.test(match[1])) line = cur.line + line + 1;
+ cm.setCursor(line - 1, cur.ch);
+ } else if (match = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(posStr)) {
+ cm.setCursor(interpretLine(cm, match[1]), cur.ch);
+ }
+ });
+ };
+
+ CodeMirror.keyMap["default"]["Alt-G"] = "jumpToLine";
+});
diff --git a/public/vendor/codemirror/addon/search/match-highlighter.js b/public/vendor/codemirror/addon/search/match-highlighter.js
index e9a22721..8f02f01c 100755..100644
--- a/public/vendor/codemirror/addon/search/match-highlighter.js
+++ b/public/vendor/codemirror/addon/search/match-highlighter.js
@@ -16,13 +16,14 @@
// highlighted only if the selected text is a word. showToken, when enabled,
// will cause the current token to be highlighted when nothing is selected.
// delay is used to specify how much time to wait, in milliseconds, before
-// highlighting the matches.
+// highlighting the matches. If annotateScrollbar is enabled, the occurances
+// will be highlighted on the scrollbar via the matchesonscrollbar addon.
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"));
+ mod(require("../../lib/codemirror"), require("./matchesonscrollbar"));
else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror"], mod);
+ define(["../../lib/codemirror", "./matchesonscrollbar"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
@@ -40,18 +41,19 @@
this.showToken = options.showToken;
this.delay = options.delay;
this.wordsOnly = options.wordsOnly;
+ this.annotateScrollbar = options.annotateScrollbar;
}
if (this.style == null) this.style = DEFAULT_TOKEN_STYLE;
if (this.minChars == null) this.minChars = DEFAULT_MIN_CHARS;
if (this.delay == null) this.delay = DEFAULT_DELAY;
if (this.wordsOnly == null) this.wordsOnly = DEFAULT_WORDS_ONLY;
this.overlay = this.timeout = null;
+ this.matchesonscroll = null;
}
CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) {
if (old && old != CodeMirror.Init) {
- var over = cm.state.matchHighlighter.overlay;
- if (over) cm.removeOverlay(over);
+ removeOverlay(cm);
clearTimeout(cm.state.matchHighlighter.timeout);
cm.state.matchHighlighter = null;
cm.off("cursorActivity", cursorActivity);
@@ -69,20 +71,39 @@
state.timeout = setTimeout(function() {highlightMatches(cm);}, state.delay);
}
+ function addOverlay(cm, query, hasBoundary, style) {
+ var state = cm.state.matchHighlighter;
+ cm.addOverlay(state.overlay = makeOverlay(query, hasBoundary, style));
+ if (state.annotateScrollbar) {
+ var searchFor = hasBoundary ? new RegExp("\\b" + query + "\\b") : query;
+ state.matchesonscroll = cm.showMatchesOnScrollbar(searchFor, true,
+ {className: "CodeMirror-selection-highlight-scrollbar"});
+ }
+ }
+
+ function removeOverlay(cm) {
+ var state = cm.state.matchHighlighter;
+ if (state.overlay) {
+ cm.removeOverlay(state.overlay);
+ state.overlay = null;
+ if (state.annotateScrollbar) {
+ state.matchesonscroll.clear();
+ state.matchesonscroll = null;
+ }
+ }
+ }
+
function highlightMatches(cm) {
cm.operation(function() {
var state = cm.state.matchHighlighter;
- if (state.overlay) {
- cm.removeOverlay(state.overlay);
- state.overlay = null;
- }
+ removeOverlay(cm);
if (!cm.somethingSelected() && state.showToken) {
var re = state.showToken === true ? /[\w$]/ : state.showToken;
var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start;
while (start && re.test(line.charAt(start - 1))) --start;
while (end < line.length && re.test(line.charAt(end))) ++end;
if (start < end)
- cm.addOverlay(state.overlay = makeOverlay(line.slice(start, end), re, state.style));
+ addOverlay(cm, line.slice(start, end), re, state.style);
return;
}
var from = cm.getCursor("from"), to = cm.getCursor("to");
@@ -90,7 +111,7 @@
if (state.wordsOnly && !isWord(cm, from, to)) return;
var selection = cm.getRange(from, to).replace(/^\s+|\s+$/g, "");
if (selection.length >= state.minChars)
- cm.addOverlay(state.overlay = makeOverlay(selection, false, state.style));
+ addOverlay(cm, selection, false, state.style);
});
}
diff --git a/public/vendor/codemirror/addon/search/matchesonscrollbar.js b/public/vendor/codemirror/addon/search/matchesonscrollbar.js
index 8d192289..8d192289 100755..100644
--- a/public/vendor/codemirror/addon/search/matchesonscrollbar.js
+++ b/public/vendor/codemirror/addon/search/matchesonscrollbar.js
diff --git a/public/vendor/codemirror/addon/search/search.js b/public/vendor/codemirror/addon/search/search.js
index afa85ebe..93e90b36 100755..100644
--- a/public/vendor/codemirror/addon/search/search.js
+++ b/public/vendor/codemirror/addon/search/search.js
@@ -18,6 +18,7 @@
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
+
function searchOverlay(query, caseInsensitive) {
if (typeof query == "string")
query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g");
@@ -28,7 +29,7 @@
query.lastIndex = stream.pos;
var match = query.exec(stream.string);
if (match && match.index == stream.pos) {
- stream.pos += match[0].length;
+ stream.pos += match[0].length || 1;
return "searching";
} else if (match) {
stream.pos = match.index;
@@ -42,57 +43,106 @@
this.posFrom = this.posTo = this.lastQuery = this.query = null;
this.overlay = null;
}
+
function getSearchState(cm) {
return cm.state.search || (cm.state.search = new SearchState());
}
+
function queryCaseInsensitive(query) {
return typeof query == "string" && query == query.toLowerCase();
}
+
function getSearchCursor(cm, query, pos) {
// Heuristic: if the query string is all lowercase, do a case insensitive search.
return cm.getSearchCursor(query, pos, queryCaseInsensitive(query));
}
+
+ function persistentDialog(cm, text, deflt, f) {
+ cm.openDialog(text, f, {
+ value: deflt,
+ selectValueOnOpen: true,
+ closeOnEnter: false,
+ onClose: function() { clearSearch(cm); }
+ });
+ }
+
function dialog(cm, text, shortText, deflt, f) {
if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
else f(prompt(shortText, deflt));
}
+
function confirmDialog(cm, text, shortText, fs) {
if (cm.openConfirm) cm.openConfirm(text, fs);
else if (confirm(shortText)) fs[0]();
}
+
+ function parseString(string) {
+ return string.replace(/\\(.)/g, function(_, ch) {
+ if (ch == "n") return "\n"
+ if (ch == "r") return "\r"
+ return ch
+ })
+ }
+
function parseQuery(query) {
var isRE = query.match(/^\/(.*)\/([a-z]*)$/);
if (isRE) {
try { query = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i"); }
catch(e) {} // Not a regular expression after all, do a string search
+ } else {
+ query = parseString(query)
}
if (typeof query == "string" ? query == "" : query.test(""))
query = /x^/;
return query;
}
+
var queryDialog =
'Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
- function doSearch(cm, rev) {
+
+ function startSearch(cm, state, query) {
+ state.queryText = query;
+ state.query = parseQuery(query);
+ cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query));
+ state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query));
+ cm.addOverlay(state.overlay);
+ if (cm.showMatchesOnScrollbar) {
+ if (state.annotate) { state.annotate.clear(); state.annotate = null; }
+ state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query));
+ }
+ }
+
+ function doSearch(cm, rev, persistent) {
var state = getSearchState(cm);
if (state.query) return findNext(cm, rev);
var q = cm.getSelection() || state.lastQuery;
- dialog(cm, queryDialog, "Search for:", q, function(query) {
- cm.operation(function() {
- if (!query || state.query) return;
- state.query = parseQuery(query);
- cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query));
- state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query));
- cm.addOverlay(state.overlay);
- if (cm.showMatchesOnScrollbar) {
- if (state.annotate) { state.annotate.clear(); state.annotate = null; }
- state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query));
- }
- state.posFrom = state.posTo = cm.getCursor();
- findNext(cm, rev);
+ if (persistent && cm.openDialog) {
+ var hiding = null
+ persistentDialog(cm, queryDialog, q, function(query, event) {
+ CodeMirror.e_stop(event);
+ if (!query) return;
+ if (query != state.queryText) startSearch(cm, state, query);
+ if (hiding) hiding.style.opacity = 1
+ findNext(cm, event.shiftKey, function(_, to) {
+ var dialog
+ if (to.line < 3 && document.querySelector &&
+ (dialog = cm.display.wrapper.querySelector(".CodeMirror-dialog")) &&
+ dialog.getBoundingClientRect().bottom - 4 > cm.cursorCoords(to, "window").top)
+ (hiding = dialog).style.opacity = .4
+ })
});
- });
+ } else {
+ dialog(cm, queryDialog, "Search for:", q, function(query) {
+ if (query && !state.query) cm.operation(function() {
+ startSearch(cm, state, query);
+ state.posFrom = state.posTo = cm.getCursor();
+ findNext(cm, rev);
+ });
+ });
+ }
}
- function findNext(cm, rev) {cm.operation(function() {
+
+ function findNext(cm, rev, callback) {cm.operation(function() {
var state = getSearchState(cm);
var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);
if (!cursor.find(rev)) {
@@ -100,38 +150,47 @@
if (!cursor.find(rev)) return;
}
cm.setSelection(cursor.from(), cursor.to());
- cm.scrollIntoView({from: cursor.from(), to: cursor.to()});
+ cm.scrollIntoView({from: cursor.from(), to: cursor.to()}, 20);
state.posFrom = cursor.from(); state.posTo = cursor.to();
+ if (callback) callback(cursor.from(), cursor.to())
});}
+
function clearSearch(cm) {cm.operation(function() {
var state = getSearchState(cm);
state.lastQuery = state.query;
if (!state.query) return;
- state.query = null;
+ state.query = state.queryText = null;
cm.removeOverlay(state.overlay);
if (state.annotate) { state.annotate.clear(); state.annotate = null; }
});}
var replaceQueryDialog =
- 'Replace: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
+ ' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
var replacementQueryDialog = 'With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>';
- var doReplaceConfirm = "Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";
+ var doReplaceConfirm = "Replace? <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>";
+
+ function replaceAll(cm, query, text) {
+ cm.operation(function() {
+ for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {
+ if (typeof query != "string") {
+ var match = cm.getRange(cursor.from(), cursor.to()).match(query);
+ cursor.replace(text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
+ } else cursor.replace(text);
+ }
+ });
+ }
+
function replace(cm, all) {
if (cm.getOption("readOnly")) return;
var query = cm.getSelection() || getSearchState(cm).lastQuery;
- dialog(cm, replaceQueryDialog, "Replace:", query, function(query) {
+ var dialogText = all ? "Replace all:" : "Replace:"
+ dialog(cm, dialogText + replaceQueryDialog, dialogText, query, function(query) {
if (!query) return;
query = parseQuery(query);
dialog(cm, replacementQueryDialog, "Replace with:", "", function(text) {
+ text = parseString(text)
if (all) {
- cm.operation(function() {
- for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {
- if (typeof query != "string") {
- var match = cm.getRange(cursor.from(), cursor.to()).match(query);
- cursor.replace(text.replace(/\$(\d)/g, function(_, i) {return match[i];}), "+input");
- } else cursor.replace(text, "+input");
- }
- });
+ replaceAll(cm, query, text)
} else {
clearSearch(cm);
var cursor = getSearchCursor(cm, query, cm.getCursor());
@@ -145,11 +204,12 @@
cm.setSelection(cursor.from(), cursor.to());
cm.scrollIntoView({from: cursor.from(), to: cursor.to()});
confirmDialog(cm, doReplaceConfirm, "Replace?",
- [function() {doReplace(match);}, advance]);
+ [function() {doReplace(match);}, advance,
+ function() {replaceAll(cm, query, text)}]);
};
var doReplace = function(match) {
cursor.replace(typeof query == "string" ? text :
- text.replace(/\$(\d)/g, function(_, i) {return match[i];}), "+input");
+ text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
advance();
};
advance();
@@ -159,6 +219,7 @@
}
CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};
+ CodeMirror.commands.findPersistent = function(cm) {clearSearch(cm); doSearch(cm, false, true);};
CodeMirror.commands.findNext = doSearch;
CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};
CodeMirror.commands.clearSearch = clearSearch;
diff --git a/public/vendor/codemirror/addon/search/searchcursor.js b/public/vendor/codemirror/addon/search/searchcursor.js
index b70242ee..b70242ee 100755..100644
--- a/public/vendor/codemirror/addon/search/searchcursor.js
+++ b/public/vendor/codemirror/addon/search/searchcursor.js
diff --git a/public/vendor/codemirror/addon/selection/active-line.js b/public/vendor/codemirror/addon/selection/active-line.js
index 22da2e0a..22da2e0a 100755..100644
--- a/public/vendor/codemirror/addon/selection/active-line.js
+++ b/public/vendor/codemirror/addon/selection/active-line.js
diff --git a/public/vendor/codemirror/addon/selection/mark-selection.js b/public/vendor/codemirror/addon/selection/mark-selection.js
index 5c42d21e..5c42d21e 100755..100644
--- a/public/vendor/codemirror/addon/selection/mark-selection.js
+++ b/public/vendor/codemirror/addon/selection/mark-selection.js
diff --git a/public/vendor/codemirror/addon/selection/selection-pointer.js b/public/vendor/codemirror/addon/selection/selection-pointer.js
index ef5e404a..ef5e404a 100755..100644
--- a/public/vendor/codemirror/addon/selection/selection-pointer.js
+++ b/public/vendor/codemirror/addon/selection/selection-pointer.js
diff --git a/public/vendor/codemirror/addon/tern/tern.css b/public/vendor/codemirror/addon/tern/tern.css
index 76fba33d..c4b8a2f7 100755..100644
--- a/public/vendor/codemirror/addon/tern/tern.css
+++ b/public/vendor/codemirror/addon/tern/tern.css
@@ -1,6 +1,7 @@
.CodeMirror-Tern-completion {
padding-left: 22px;
position: relative;
+ line-height: 1.5;
}
.CodeMirror-Tern-completion:before {
position: absolute;
diff --git a/public/vendor/codemirror/addon/tern/tern.js b/public/vendor/codemirror/addon/tern/tern.js
index dfb19b84..c345c497 100755..100644
--- a/public/vendor/codemirror/addon/tern/tern.js
+++ b/public/vendor/codemirror/addon/tern/tern.js
@@ -135,6 +135,7 @@
},
destroy: function () {
+ closeArgHints(this)
if (this.worker) {
this.worker.terminate();
this.worker = null;
@@ -216,7 +217,7 @@
var completion = data.completions[i], className = typeToIcon(completion.type);
if (data.guess) className += " " + cls + "guess";
completions.push({text: completion.name + after,
- displayText: completion.name,
+ displayText: completion.displayName || completion.name,
className: className,
data: completion});
}
@@ -266,7 +267,7 @@
child.target = "_blank";
}
}
- tempTooltip(cm, tip);
+ tempTooltip(cm, tip, ts);
if (c) c();
}, pos);
}
@@ -466,11 +467,12 @@
ts.request(cm, {type: "refs"}, function(error, data) {
if (error) return showError(ts, cm, error);
var ranges = [], cur = 0;
+ var curPos = cm.getCursor();
for (var i = 0; i < data.refs.length; i++) {
var ref = data.refs[i];
if (ref.file == name) {
ranges.push({anchor: ref.start, head: ref.end});
- if (cmpPos(cur, ref.start) >= 0 && cmpPos(cur, ref.end) <= 0)
+ if (cmpPos(curPos, ref.start) >= 0 && cmpPos(curPos, ref.end) <= 0)
cur = ranges.length - 1;
}
}
@@ -592,7 +594,7 @@
// Tooltips
- function tempTooltip(cm, content) {
+ function tempTooltip(cm, content, ts) {
if (cm.state.ternTooltip) remove(cm.state.ternTooltip);
var where = cm.cursorCoords();
var tip = cm.state.ternTooltip = makeTooltip(where.right + 1, where.bottom, content);
@@ -616,7 +618,7 @@
else mouseOnTip = false;
}
});
- setTimeout(maybeClear, 1700);
+ setTimeout(maybeClear, ts.options.hintDelay ? ts.options.hintDelay : 1700);
cm.on("cursorActivity", clear);
cm.on('blur', clear);
cm.on('scroll', clear);
@@ -644,7 +646,7 @@
if (ts.options.showError)
ts.options.showError(cm, msg);
else
- tempTooltip(cm, String(msg));
+ tempTooltip(cm, String(msg), ts);
}
function closeArgHints(ts) {
diff --git a/public/vendor/codemirror/addon/tern/worker.js b/public/vendor/codemirror/addon/tern/worker.js
index 887f906a..887f906a 100755..100644
--- a/public/vendor/codemirror/addon/tern/worker.js
+++ b/public/vendor/codemirror/addon/tern/worker.js
diff --git a/public/vendor/codemirror/addon/wrap/hardwrap.js b/public/vendor/codemirror/addon/wrap/hardwrap.js
index fe9b4dd6..8806fbe2 100755..100644
--- a/public/vendor/codemirror/addon/wrap/hardwrap.js
+++ b/public/vendor/codemirror/addon/wrap/hardwrap.js
@@ -32,11 +32,13 @@
function findBreakPoint(text, column, wrapOn, killTrailingSpace) {
for (var at = column; at > 0; --at)
if (wrapOn.test(text.slice(at - 1, at + 1))) break;
- if (at == 0) at = column;
- var endOfText = at;
- if (killTrailingSpace)
- while (text.charAt(endOfText - 1) == " ") --endOfText;
- return {from: endOfText, to: at};
+ for (var first = true;; first = false) {
+ var endOfText = at;
+ if (killTrailingSpace)
+ while (text.charAt(endOfText - 1) == " ") --endOfText;
+ if (endOfText == 0 && first) at = column;
+ else return {from: endOfText, to: at};
+ }
}
function wrapRange(cm, from, to, options) {
@@ -86,7 +88,8 @@
if (changes.length) cm.operation(function() {
for (var i = 0; i < changes.length; ++i) {
var change = changes[i];
- cm.replaceRange(change.text, change.from, change.to);
+ if (change.text || CodeMirror.cmpPos(change.from, change.to))
+ cm.replaceRange(change.text, change.from, change.to);
}
});
return changes.length ? {from: changes[0].from, to: CodeMirror.changeEnd(changes[changes.length - 1])} : null;
diff --git a/public/vendor/codemirror/codemirror.min.js b/public/vendor/codemirror/codemirror.min.js
index 41c476ac..f2200a12 100644
--- a/public/vendor/codemirror/codemirror.min.js
+++ b/public/vendor/codemirror/codemirror.min.js
@@ -1,19 +1,16 @@
-!function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);this.CodeMirror=e()}}(function(){"use strict";function e(n,r){if(!(this instanceof e))return new e(n,r);this.options=r=r?Ii(r):{},Ii(Xo,r,!1),p(r);var i=r.value;"string"==typeof i&&(i=new ba(i,r.mode)),this.doc=i;var o=new e.inputStyles[r.inputStyle](this),a=this.display=new t(n,i,o);a.wrapper.CodeMirror=this,c(this),l(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),r.autofocus&&!So&&a.input.focus(),v(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new Li,keySeq:null,specialChars:null};var s=this;mo&&11>go&&setTimeout(function(){s.display.input.reset(!0)},20),Ht(this),Gi(),xt(this),this.curOp.forceUpdate=!0,Kr(this,i),r.autofocus&&!So||s.hasFocus()?setTimeout(Pi(mn,this),20):gn(this);for(var u in Zo)Zo.hasOwnProperty(u)&&Zo[u](this,r[u],Yo);k(this),r.finishInit&&r.finishInit(this);for(var f=0;f<ta.length;++f)ta[f](this);kt(this),vo&&r.lineWrapping&&"optimizelegibility"==getComputedStyle(a.lineDiv).textRendering&&(a.lineDiv.style.textRendering="auto")}function t(e,t,n){var r=this;this.input=n,r.scrollbarFiller=Wi("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=Wi("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=Wi("div",null,"CodeMirror-code"),r.selectionDiv=Wi("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=Wi("div",null,"CodeMirror-cursors"),r.measure=Wi("div",null,"CodeMirror-measure"),r.lineMeasure=Wi("div",null,"CodeMirror-measure"),r.lineSpace=Wi("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none"),r.mover=Wi("div",[Wi("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=Wi("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=Wi("div",null,null,"position: absolute; height: "+Aa+"px; width: 1px;"),r.gutters=Wi("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=Wi("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=Wi("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),mo&&8>go&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),vo||fo&&So||(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,n.init(r)}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),r(t)}function r(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,Re(e,100),e.state.modeGen++,e.curOp&&It(e)}function i(e){e.options.lineWrapping?(Ua(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ba(e.display.wrapper,"CodeMirror-wrap"),d(e)),a(e),It(e),lt(e),setTimeout(function(){y(e)},100)}function o(e){var t=yt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/bt(e.display)-3);return function(i){if(xr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function a(e){var t=e.doc,n=o(e);t.iter(function(e){var t=n(e);t!=e.height&&Qr(e,t)})}function l(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),lt(e)}function s(e){c(e),It(e),setTimeout(function(){_(e)},20)}function c(e){var t=e.display.gutters,n=e.options.gutters;Fi(t);for(var r=0;r<n.length;++r){var i=n[r],o=t.appendChild(Wi("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",u(e)}function u(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function f(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=pr(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=hr(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch,r=i.to.line,n+=r.text.length-i.to.ch}return n}function d(e){var t=e.display,n=e.doc;t.maxLine=Xr(n,n.first),t.maxLineLength=f(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=f(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function p(e){var t=Ei(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function h(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Be(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Ve(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function m(e,t,n){this.cm=n;var r=this.vert=Wi("div",[Wi("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Wi("div",[Wi("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),Sa(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Sa(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedOverlay=!1,mo&&8>go&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function g(){}function v(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Ba(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Sa(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?nn(t,e):tn(t,e)},t),t.display.scrollbars.addClass&&Ua(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=h(e));var n=e.display.barWidth,r=e.display.barHeight;b(e,t);for(var i=0;4>i&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&E(e),b(e,h(e)),n=e.display.barWidth,r=e.display.barHeight}function b(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function x(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-$e(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=ei(t,r),a=ei(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;o>l?(o=l,a=ei(t,ti(Xr(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=ei(t,ti(Xr(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function _(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=C(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&n[a].gutter&&(n[a].gutter.style.left=o);var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function k(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=w(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(Wi("div",[Wi("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",u(e),!0}return!1}function w(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function C(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function S(e,t,n){var r=e.display;this.viewport=t,this.visible=x(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Ge(e),this.force=n,this.dims=q(e),this.events=[]}function M(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ve(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ve(e)+"px",t.scrollbarsClipped=!0)}function L(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Dt(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Ft(e))return!1;k(e)&&(Dt(e),t.dims=q(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Oo&&(o=yr(e.doc,o),a=br(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Wt(e,o,a),n.viewOffset=ti(Xr(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=Ft(e);if(!l&&0==s&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=$i();return s>4&&(n.lineDiv.style.display="none"),N(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,c&&$i()!=c&&c.offsetHeight&&c.focus(),Fi(n.cursorDiv),Fi(n.selectionDiv),n.gutters.style.height=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Re(e,400)),n.updateLineNumbers=null,!0}function T(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ge(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Be(e.display)-Ke(e),n.top)}),t.visible=x(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&L(e,t);r=!1){E(e);var i=h(e);Ne(e),z(e,i),y(e,i)}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function A(e,t){var n=new S(e,t);if(L(e,n)){E(e),T(e,n);var r=h(e);Ne(e),z(e,r),y(e,r),n.finish()}}function z(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";var n=t.docHeight+e.display.barHeight;e.display.heightForcer.style.top=n+"px",e.display.gutters.style.height=Math.max(n+Ve(e),t.clientHeight)+"px"}function E(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i,o=t.view[r];if(!o.hidden){if(mo&&8>go){var a=o.node.offsetTop+o.node.offsetHeight;i=a-n,n=a}else{var l=o.node.getBoundingClientRect();i=l.bottom-l.top}var s=o.line.height-i;if(2>i&&(i=yt(t)),(s>.001||-.001>s)&&(Qr(o.line,i),O(o.line),o.rest))for(var c=0;c<o.rest.length;c++)O(o.rest[c])}}}function O(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.offsetHeight}function q(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[a]]=o.clientWidth;return{fixedPos:C(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function N(e,t,n){function r(t){var n=t.nextSibling;return vo&&Mo&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var i=e.display,o=e.options.lineNumbers,a=i.lineDiv,l=a.firstChild,s=i.view,c=i.viewFrom,u=0;u<s.length;u++){var f=s[u];if(f.hidden);else if(f.node&&f.node.parentNode==a){for(;l!=f.node;)l=r(l);var d=o&&null!=t&&c>=t&&f.lineNumber;f.changes&&(Ei(f.changes,"gutter")>-1&&(d=!1),I(e,f,c,n)),d&&(Fi(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(w(e.options,c)))),l=f.node.nextSibling}else{var p=B(e,f,c,n);a.insertBefore(p,l)}c+=f.size}for(;l;)l=r(l)}function I(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?R(e,t):"gutter"==o?F(e,t,n,r):"class"==o?W(t):"widget"==o&&H(e,t,r)}t.changes=null}function P(e){return e.node==e.text&&(e.node=Wi("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),mo&&8>go&&(e.node.style.zIndex=2)),e.node}function D(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=P(e);e.background=n.insertBefore(Wi("div",null,t),n.firstChild)}}function j(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Pr(e,t)}function R(e,t){var n=t.text.className,r=j(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,W(t)):n&&(t.text.className=n)}function W(e){D(e),e.line.wrapClass?P(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function F(e,t,n,r){t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null);var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var o=P(t),a=t.gutter=Wi("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px");if(e.display.input.setUneditable(a),o.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(Wi("div",w(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var l=0;l<e.options.gutters.length;++l){var s=e.options.gutters[l],c=i.hasOwnProperty(s)&&i[s];c&&a.appendChild(Wi("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[s]+"px; width: "+r.gutterWidth[s]+"px"))}}}function H(e,t,n){t.alignable&&(t.alignable=null);for(var r,i=t.node.firstChild;i;i=r){var r=i.nextSibling;"CodeMirror-linewidget"==i.className&&t.node.removeChild(i)}U(e,t,n)}function B(e,t,n,r){var i=j(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),W(t),F(e,t,n,r),U(e,t,r),t.node}function U(e,t,n){if(V(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)V(e,t.rest[r],t,n,!1)}function V(e,t,n,r,i){if(t.widgets)for(var o=P(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=Wi("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),G(s,c,n,r),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),_i(s,"redraw")}}function G(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function K(e){return qo(e.line,e.ch)}function X(e,t){return No(e,t)<0?t:e}function Z(e,t){return No(e,t)<0?e:t}function Y(e){e.state.focused||(e.display.input.focus(),mn(e))}function Q(e){return e.options.readOnly||e.doc.cantEdit}function J(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=e.state.pasteIncoming||"paste"==i,l=Ka(t),s=null;a&&r.ranges.length>1&&(Io&&Io.join("\n")==t?s=r.ranges.length%Io.length==0&&Oi(Io,Ka):l.length==r.ranges.length&&(s=Oi(l,function(e){return[e]})));for(var c=r.ranges.length-1;c>=0;c--){var u=r.ranges[c],f=u.from(),d=u.to();u.empty()&&(n&&n>0?f=qo(f.line,f.ch-n):e.state.overwrite&&!a&&(d=qo(d.line,Math.min(Xr(o,d.line).text.length,d.ch+zi(l).length))));var p=e.curOp.updateInput,h={from:f,to:d,text:s?s[c%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};Cn(e.doc,h),_i(e,"inputRead",e,h)}t&&!a&&te(e,t),Pn(e),e.curOp.updateInput=p,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function ee(e,t){var n=e.clipboardData&&e.clipboardData.getData("text/plain");return n?(e.preventDefault(),At(t,function(){J(t,n,0,null,"paste")}),!0):void 0}function te(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=jn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xr(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=jn(e,i.head.line,"smart"));a&&_i(e,"electricInput",e,i.head.line)}}}function ne(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:qo(i,0),head:qo(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function re(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function ie(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Li,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function oe(){var e=Wi("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),t=Wi("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return vo?e.style.width="1000px":e.setAttribute("wrap","off"),Co&&(e.style.border="1px solid black"),re(e),t}function ae(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Li,this.gracePeriod=!1}function le(e,t){var n=Je(e,t.line);if(!n||n.hidden)return null;var r=Xr(e.doc,t.line),i=Ze(n,r,t.line),o=ni(r),a="left";if(o){var l=lo(o,t.ch);a=l%2?"right":"left"}var s=nt(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function se(e,t){return t&&(e.bad=!0),e}function ce(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return se(e.clipPos(qo(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return ue(o,t,n)}}function ue(e,t,n){function r(t,n,r){for(var i=-1;i<(u?u.length:0);i++)for(var o=0>i?c.map:u[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==n){var s=Jr(0>i?e.line:e.rest[i]),f=o[a]+r;return(0>r||l!=t)&&(f=o[a+(r?1:0)]),qo(s,f)}}}var i=e.text.firstChild,o=!1;if(!t||!Fa(i,t))return se(qo(Jr(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[n],n=0,!t)){var a=e.rest?zi(e.rest):e.line;return se(qo(Jr(a),a.text.length),o)}var l=3==t.nodeType?t:null,s=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));s.parentNode!=i;)s=s.parentNode;var c=e.measure,u=c.maps,f=r(l,s,n);if(f)return se(f,o);for(var d=s.nextSibling,p=l?l.nodeValue.length-n:0;d;d=d.nextSibling){if(f=r(d,d.firstChild,0))return se(qo(f.line,f.ch-p),o);p+=d.textContent.length}for(var h=s.previousSibling,p=n;h;h=h.previousSibling){if(f=r(h,h.firstChild,-1))return se(qo(f.line,f.ch+p),o);p+=d.textContent.length}}function fe(e,t,n,r,i){function o(e){return function(t){return t.id==e}}function a(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return""==n&&(n=t.textContent.replace(/\u200b/g,"")),void(l+=n);var c,u=t.getAttribute("cm-marker");if(u){var f=e.findMarks(qo(r,0),qo(i+1,0),o(+u));return void(f.length&&(c=f[0].find())&&(l+=Zr(e.doc,c.from,c.to).join("\n")))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d<t.childNodes.length;d++)a(t.childNodes[d]);/^(pre|div|p)$/i.test(t.nodeName)&&(s=!0)}else if(3==t.nodeType){var p=t.nodeValue;if(!p)return;s&&(l+="\n",s=!1),l+=p}}for(var l="",s=!1;a(t),t!=n;)t=t.nextSibling;return l}function de(e,t){this.ranges=e,this.primIndex=t}function pe(e,t){this.anchor=e,this.head=t}function he(e,t){var n=e[t];e.sort(function(e,t){return No(e.from(),t.from())}),t=Ei(e,n);for(var r=1;r<e.length;r++){var i=e[r],o=e[r-1];if(No(o.to(),i.from())>=0){var a=Z(o.from(),i.from()),l=X(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;t>=r&&--t,e.splice(--r,2,new pe(s?l:a,s?a:l))}}return new de(e,t)}function me(e,t){return new de([new pe(e,t||e)],0)}function ge(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ve(e,t){if(t.line<e.first)return qo(e.first,0);var n=e.first+e.size-1;return t.line>n?qo(n,Xr(e,n).text.length):ye(t,Xr(e,t.line).text.length)}function ye(e,t){var n=e.ch;return null==n||n>t?qo(e.line,t):0>n?qo(e.line,0):e}function be(e,t){return t>=e.first&&t<e.first+e.size}function xe(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ve(e,t[r]);return n}function _e(e,t,n,r){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(r){var o=No(n,i)<0;o!=No(r,i)<0?(i=n,n=r):o!=No(n,r)<0&&(n=r)}return new pe(i,n)}return new pe(r||n,n)}function ke(e,t,n,r){Te(e,new de([_e(e,e.sel.primary(),t,n)],0),r)}function we(e,t,n){for(var r=[],i=0;i<e.sel.ranges.length;i++)r[i]=_e(e,e.sel.ranges[i],t[i],null);var o=he(r,e.sel.primIndex);Te(e,o,n)}function Ce(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Te(e,he(i,e.sel.primIndex),r)}function Se(e,t,n,r){Te(e,me(t,n),r)}function Me(e,t){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new pe(ve(e,t[n].anchor),ve(e,t[n].head))}};return La(e,"beforeSelectionChange",e,n),e.cm&&La(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?he(n.ranges,n.ranges.length-1):t}function Le(e,t,n){var r=e.history.done,i=zi(r);i&&i.ranges?(r[r.length-1]=t,Ae(e,t,n)):Te(e,t,n)}function Te(e,t,n){Ae(e,t,n),ci(e,e.sel,e.cm?e.cm.curOp.id:0/0,n)}function Ae(e,t,n){(Si(e,"beforeSelectionChange")||e.cm&&Si(e.cm,"beforeSelectionChange"))&&(t=Me(e,t));var r=n&&n.bias||(No(t.primary().head,e.sel.primary().head)<0?-1:1);ze(e,Oe(e,t,r,!0)),n&&n.scroll===!1||!e.cm||Pn(e.cm)}function ze(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Ci(e.cm)),_i(e,"cursorActivity",e))}function Ee(e){ze(e,Oe(e,e.sel,null,!1),Ea)}function Oe(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=qe(e,a.anchor,n,r),s=qe(e,a.head,n,r);(i||l!=a.anchor||s!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new pe(l,s))}return i?he(i,t.primIndex):t}function qe(e,t,n,r){var i=!1,o=t,a=n||1;e.cantEdit=!1;e:for(;;){var l=Xr(e,o.line);if(l.markedSpans)for(var s=0;s<l.markedSpans.length;++s){var c=l.markedSpans[s],u=c.marker;if((null==c.from||(u.inclusiveLeft?c.from<=o.ch:c.from<o.ch))&&(null==c.to||(u.inclusiveRight?c.to>=o.ch:c.to>o.ch))){if(r&&(La(u,"beforeCursorEnter"),u.explicitlyCleared)){if(l.markedSpans){--s;continue}break}if(!u.atomic)continue;var f=u.find(0>a?-1:1);if(0==No(f,o)&&(f.ch+=a,f.ch<0?f=f.line>e.first?ve(e,qo(f.line-1)):null:f.ch>l.text.length&&(f=f.line<e.first+e.size-1?qo(f.line+1,0):null),!f)){if(i)return r?(e.cantEdit=!0,qo(e.first,0)):qe(e,t,n,!0);i=!0,f=t,a=-a}o=f;continue e}}return o}}function Ne(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ie(e,t){for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t!==!1||a!=n.sel.primIndex){var l=n.sel.ranges[a],s=l.empty();(s||e.options.showCursorWhenSelecting)&&Pe(e,l,i),s||De(e,l,o)}return r}function Pe(e,t,n){var r=pt(e,t.head,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(Wi("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(Wi("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}$(".other-cursor").each(function(t,n){var r=parseInt($(n).attr("data-line")),i=parseInt($(n).attr("data-ch")),o=parseFloat($(n).attr("data-offset-left")),a=parseFloat($(n).attr("data-offset-top")),l=e.charCoords({line:r,ch:i},"windows");$(n)[0].style.left=l.left+o+"px",$(n)[0].style.top=l.top+a+"px"})}function De(e,t,n){function r(e,t,n,r){0>t&&(t=0),t=Math.round(t),r=Math.round(r),l.appendChild(Wi("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?u-e:n)+"px; height: "+(r-t)+"px"))}function i(t,n,i){function o(n,r){return dt(e,qo(t,n),"div",f,r)}var l,s,f=Xr(a,t),d=f.text.length;return Qi(ni(f),n||0,null==i?d:i,function(e,t,a){var f,p,h,m=o(e,"left");if(e==t)f=m,p=h=m.left;else{if(f=o(t-1,"right"),"rtl"==a){var g=m;m=f,f=g}p=m.left,h=f.right}null==n&&0==e&&(p=c),f.top-m.top>3&&(r(p,m.top,null,m.bottom),p=c,m.bottom<f.top&&r(p,m.bottom,null,f.top)),null==i&&t==d&&(h=u),(!l||m.top<l.top||m.top==l.top&&m.left<l.left)&&(l=m),(!s||f.bottom>s.bottom||f.bottom==s.bottom&&f.right>s.right)&&(s=f),c+1>p&&(p=c),r(p,f.top,h-p,f.bottom)}),{start:l,end:s}}var o=e.display,a=e.doc,l=document.createDocumentFragment(),s=Ue(e.display),c=s.left,u=Math.max(o.sizerWidth,Ge(e)-o.sizer.offsetLeft)-s.right,f=t.from(),d=t.to();if(f.line==d.line)i(f.line,f.ch,d.ch);else{var p=Xr(a,f.line),h=Xr(a,d.line),m=gr(p)==gr(h),g=i(f.line,f.ch,m?p.text.length+1:null).end,v=i(d.line,m?0:null,d.ch).start;m&&(g.top<v.top-2?(r(g.right,g.top,null,g.bottom),r(c,v.top,v.left,v.bottom)):r(g.right,g.top,v.left-g.right,g.bottom)),g.bottom<v.top&&r(c,g.bottom,null,v.top)}n.appendChild(l)}function je(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Re(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,Pi(We,e))}function We(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ra(t.mode,He(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=Or(e,o,r,!0);o.styles=l.styles;var s=o.styleClasses,c=l.classes;c?o.styleClasses=c:s&&(o.styleClasses=null);for(var u=!a||a.length!=o.styles.length||s!=c&&(!s||!c||s.bgClass!=c.bgClass||s.textClass!=c.textClass),f=0;!u&&f<a.length;++f)u=a[f]!=o.styles[f];u&&i.push(t.frontier),o.stateAfter=ra(t.mode,r)}else Nr(e,o.text,r),o.stateAfter=t.frontier%5==0?ra(t.mode,r):null;return++t.frontier,+new Date>n?(Re(e,e.options.workDelay),!0):void 0}),i.length&&At(e,function(){for(var t=0;t<i.length;t++)Pt(e,i[t],"text")})}}function Fe(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=Xr(o,l-1);if(s.stateAfter&&(!n||l<=o.frontier))return l;var c=Na(s.text,null,e.options.tabSize);(null==i||r>c)&&(i=l-1,r=c)}return i}function He(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=Fe(e,t,n),a=o>r.first&&Xr(r,o-1).stateAfter;return a=a?ra(r.mode,a):ia(r.mode),r.iter(o,t,function(n){Nr(e,n.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;n.stateAfter=l?ra(r.mode,a):null,++o}),n&&(r.frontier=o),a}function $e(e){return e.lineSpace.offsetTop}function Be(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ue(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Hi(e.measure,Wi("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Ve(e){return Aa-e.display.nativeBarWidth}function Ge(e){return e.display.scroller.clientWidth-Ve(e)-e.display.barWidth}function Ke(e){return e.display.scroller.clientHeight-Ve(e)-e.display.barHeight}function Xe(e,t,n){var r=e.options.lineWrapping,i=r&&Ge(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ze(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var r=0;r<e.rest.length;r++)if(Jr(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Ye(e,t){t=gr(t);var n=Jr(t),r=e.display.externalMeasured=new qt(e.doc,t,n);r.lineN=n;var i=r.built=Pr(e,r);return r.text=i.pre,Hi(e.display.lineMeasure,i.pre),r}function Qe(e,t,n,r){return tt(e,et(e,t),n,r)}function Je(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[jt(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function et(e,t){var n=Jr(t),r=Je(e,n);r&&!r.text?r=null:r&&r.changes&&I(e,r,n,q(e)),r||(r=Ye(e,t));var i=Ze(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function tt(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Xe(e,t.view,t.rect),t.hasHeights=!0),o=rt(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function nt(e,t,n){for(var r,i,o,a,l=0;l<e.length;l+=3){var s=e[l],c=e[l+1];if(s>t?(i=0,o=1,a="left"):c>t?(i=t-s,o=i+1):(l==e.length-3||t==c&&e[l+3]>t)&&(o=c-s,i=o-1,t>=c&&(a="right")),null!=i){if(r=e[l+2],s==c&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[(l-=3)+2],a="left";if("right"==n&&i==c-s)for(;l<e.length-3&&e[l+3]==e[l+4]&&!e[l+5].insertLeft;)r=e[(l+=3)+2],a="right";break}}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:c}}function rt(e,t,n,r){var i,o=nt(t.map,n,r),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;4>u;u++){for(;l&&Ri(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&Ri(t.line.text.charAt(o.coverStart+s));)++s;if(mo&&9>go&&0==l&&s==o.coverEnd-o.coverStart)i=a.parentNode.getBoundingClientRect();else if(mo&&e.options.lineWrapping){var f=Da(a,l,s).getClientRects();i=f.length?f["right"==r?f.length-1:0]:Ro}else i=Da(a,l,s).getBoundingClientRect()||Ro;if(i.left||i.right||0==l)break;s=l,l-=1,c="right"}mo&&11>go&&(i=it(e.display.measure,i));
+!function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);(this||window).CodeMirror=e()}}(function(){"use strict";function e(n,r){if(!(this instanceof e))return new e(n,r);this.options=r=r?ji(r):{},ji(ea,r,!1),p(r);var i=r.value;"string"==typeof i&&(i=new Ca(i,r.mode,null,r.lineSeparator)),this.doc=i;var o=new e.inputStyles[r.inputStyle](this),a=this.display=new t(n,i,o);a.wrapper.CodeMirror=this,c(this),l(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),r.autofocus&&!zo&&a.input.focus(),v(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Ei,keySeq:null,specialChars:null};var s=this;xo&&11>ko&&setTimeout(function(){s.display.input.reset(!0)},20),$t(this),Xi(),kt(this),this.curOp.forceUpdate=!0,Yr(this,i),r.autofocus&&!zo||s.hasFocus()?setTimeout(Ri(yn,this),20):bn(this);for(var u in ta)ta.hasOwnProperty(u)&&ta[u](this,r[u],na);_(this),r.finishInit&&r.finishInit(this);for(var d=0;d<aa.length;++d)aa[d](this);wt(this),_o&&r.lineWrapping&&"optimizelegibility"==getComputedStyle(a.lineDiv).textRendering&&(a.lineDiv.style.textRendering="auto")}function t(e,t,n){var r=this;this.input=n,r.scrollbarFiller=$i("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=$i("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=$i("div",null,"CodeMirror-code"),r.selectionDiv=$i("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=$i("div",null,"CodeMirror-cursors"),r.measure=$i("div",null,"CodeMirror-measure"),r.lineMeasure=$i("div",null,"CodeMirror-measure"),r.lineSpace=$i("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none"),r.mover=$i("div",[$i("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=$i("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=$i("div",null,null,"position: absolute; height: "+Pa+"px; width: 1px;"),r.gutters=$i("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=$i("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=$i("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),xo&&8>ko&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),_o||vo&&zo||(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,n.init(r)}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),r(t)}function r(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,We(e,100),e.state.modeGen++,e.curOp&&It(e)}function i(e){e.options.lineWrapping?(Qa(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ya(e.display.wrapper,"CodeMirror-wrap"),f(e)),a(e),It(e),st(e),setTimeout(function(){y(e)},100)}function o(e){var t=bt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/xt(e.display)-3);return function(i){if(wr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function a(e){var t=e.doc,n=o(e);t.iter(function(e){var t=n(e);t!=e.height&&ti(e,t)})}function l(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),st(e)}function s(e){c(e),It(e),setTimeout(function(){k(e)},20)}function c(e){var t=e.display.gutters,n=e.options.gutters;Bi(t);for(var r=0;r<n.length;++r){var i=n[r],o=t.appendChild($i("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",u(e)}function u(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function d(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=gr(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=vr(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch,r=i.to.line,n+=r.text.length-i.to.ch}return n}function f(e){var t=e.display,n=e.doc;t.maxLine=Qr(n,n.first),t.maxLineLength=d(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=d(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function p(e){var t=Ni(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function h(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Ue(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Ge(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function m(e,t,n){this.cm=n;var r=this.vert=$i("div",[$i("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=$i("div",[$i("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),za(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),za(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,xo&&8>ko&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function g(){}function v(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Ya(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),za(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?an(t,e):on(t,e)},t),t.display.scrollbars.addClass&&Qa(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=h(e));var n=e.display.barWidth,r=e.display.barHeight;b(e,t);for(var i=0;4>i&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&E(e),b(e,h(e)),n=e.display.barWidth,r=e.display.barHeight}function b(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function x(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Be(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=ri(t,r),a=ri(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;o>l?(o=l,a=ri(t,ii(Qr(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=ri(t,ii(Qr(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function k(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=C(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&n[a].gutter&&(n[a].gutter.style.left=o);var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function _(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=w(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild($i("div",[$i("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",u(e),!0}return!1}function w(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function C(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function S(e,t,n){var r=e.display;this.viewport=t,this.visible=x(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Ke(e),this.force=n,this.dims=q(e),this.events=[]}function M(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ge(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ge(e)+"px",t.scrollbarsClipped=!0)}function L(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return jt(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Ht(e))return!1;_(e)&&(jt(e),t.dims=q(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Do&&(o=kr(e.doc,o),a=_r(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Ft(e,o,a),n.viewOffset=ii(Qr(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=Ht(e);if(!l&&0==s&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Vi();return s>4&&(n.lineDiv.style.display="none"),N(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,c&&Vi()!=c&&c.offsetHeight&&c.focus(),Bi(n.cursorDiv),Bi(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,We(e,400)),n.updateLineNumbers=null,!0}function T(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ke(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Ue(e.display)-Ze(e),n.top)}),t.visible=x(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&L(e,t);r=!1){E(e);var i=h(e);Pe(e),z(e,i),y(e,i)}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function A(e,t){var n=new S(e,t);if(L(e,n)){E(e),T(e,n);var r=h(e);Pe(e),z(e,r),y(e,r),n.finish()}}function z(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";var n=t.docHeight+e.display.barHeight;e.display.heightForcer.style.top=n+"px",e.display.gutters.style.height=Math.max(n+Ge(e),t.clientHeight)+"px"}function E(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i,o=t.view[r];if(!o.hidden){if(xo&&8>ko){var a=o.node.offsetTop+o.node.offsetHeight;i=a-n,n=a}else{var l=o.node.getBoundingClientRect();i=l.bottom-l.top}var s=o.line.height-i;if(2>i&&(i=bt(t)),(s>.001||-.001>s)&&(ti(o.line,i),O(o.line),o.rest))for(var c=0;c<o.rest.length;c++)O(o.rest[c])}}}function O(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function q(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[a]]=o.clientWidth;return{fixedPos:C(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function N(e,t,n){function r(t){var n=t.nextSibling;return _o&&Eo&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var i=e.display,o=e.options.lineNumbers,a=i.lineDiv,l=a.firstChild,s=i.view,c=i.viewFrom,u=0;u<s.length;u++){var d=s[u];if(d.hidden);else if(d.node&&d.node.parentNode==a){for(;l!=d.node;)l=r(l);var f=o&&null!=t&&c>=t&&d.lineNumber;d.changes&&(Ni(d.changes,"gutter")>-1&&(f=!1),P(e,d,c,n)),f&&(Bi(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(w(e.options,c)))),l=d.node.nextSibling}else{var p=B(e,d,c,n);a.insertBefore(p,l)}c+=d.size}for(;l;)l=r(l)}function P(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?R(e,t):"gutter"==o?F(e,t,n,r):"class"==o?W(t):"widget"==o&&H(e,t,r)}t.changes=null}function I(e){return e.node==e.text&&(e.node=$i("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),xo&&8>ko&&(e.node.style.zIndex=2)),e.node}function D(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=I(e);e.background=n.insertBefore($i("div",null,t),n.firstChild)}}function j(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Rr(e,t)}function R(e,t){var n=t.text.className,r=j(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,W(t)):n&&(t.text.className=n)}function W(e){D(e),e.line.wrapClass?I(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function F(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=I(t);t.gutterBackground=$i("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var i=I(t),a=t.gutter=$i("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(a),i.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild($i("div",w(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.options.gutters.length;++l){var s=e.options.gutters[l],c=o.hasOwnProperty(s)&&o[s];c&&a.appendChild($i("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[s]+"px; width: "+r.gutterWidth[s]+"px"))}}}function H(e,t,n){t.alignable&&(t.alignable=null);for(var r,i=t.node.firstChild;i;i=r){var r=i.nextSibling;"CodeMirror-linewidget"==i.className&&t.node.removeChild(i)}U(e,t,n)}function B(e,t,n,r){var i=j(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),W(t),F(e,t,n,r),U(e,t,r),t.node}function U(e,t,n){if(V(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)V(e,t.rest[r],t,n,!1)}function V(e,t,n,r,i){if(t.widgets)for(var o=I(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=$i("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),G(s,c,n,r),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),Si(s,"redraw")}}function G(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function K(e){return jo(e.line,e.ch)}function Z(e,t){return Ro(e,t)<0?t:e}function X(e,t){return Ro(e,t)<0?e:t}function Y(e){e.state.focused||(e.display.input.focus(),yn(e))}function Q(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=e.state.pasteIncoming||"paste"==i,l=o.splitLines(t),s=null;if(a&&r.ranges.length>1)if(Wo&&Wo.join("\n")==t){if(r.ranges.length%Wo.length==0){s=[];for(var c=0;c<Wo.length;c++)s.push(o.splitLines(Wo[c]))}}else l.length==r.ranges.length&&(s=Pi(l,function(e){return[e]}));for(var c=r.ranges.length-1;c>=0;c--){var u=r.ranges[c],d=u.from(),f=u.to();u.empty()&&(n&&n>0?d=jo(d.line,d.ch-n):e.state.overwrite&&!a&&(f=jo(f.line,Math.min(Qr(o,f.line).text.length,f.ch+qi(l).length))));var p=e.curOp.updateInput,h={from:d,to:f,text:s?s[c%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};Ln(e.doc,h),Si(e,"inputRead",e,h)}t&&!a&&ee(e,t),Rn(e),e.curOp.updateInput=p,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function J(e,t){var n=e.clipboardData&&e.clipboardData.getData("text/plain");return n?(e.preventDefault(),t.isReadOnly()||t.options.disableInput||zt(t,function(){Q(t,n,0,null,"paste")}),!0):void 0}function ee(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Fn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Qr(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Fn(e,i.head.line,"smart"));a&&Si(e,"electricInput",e,i.head.line)}}}function te(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:jo(i,0),head:jo(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function ne(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function re(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ei,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function ie(){var e=$i("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),t=$i("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return _o?e.style.width="1000px":e.setAttribute("wrap","off"),Ao&&(e.style.border="1px solid black"),ne(e),t}function oe(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ei,this.gracePeriod=!1}function ae(e,t){var n=et(e,t.line);if(!n||n.hidden)return null;var r=Qr(e.doc,t.line),i=Ye(n,r,t.line),o=oi(r),a="left";if(o){var l=uo(o,t.ch);a=l%2?"right":"left"}var s=rt(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function le(e,t){return t&&(e.bad=!0),e}function se(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return le(e.clipPos(jo(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return ce(o,t,n)}}function ce(e,t,n){function r(t,n,r){for(var i=-1;i<(u?u.length:0);i++)for(var o=0>i?c.map:u[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==n){var s=ni(0>i?e.line:e.rest[i]),d=o[a]+r;return(0>r||l!=t)&&(d=o[a+(r?1:0)]),jo(s,d)}}}var i=e.text.firstChild,o=!1;if(!t||!Ka(i,t))return le(jo(ni(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[n],n=0,!t)){var a=e.rest?qi(e.rest):e.line;return le(jo(ni(a),a.text.length),o)}var l=3==t.nodeType?t:null,s=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));s.parentNode!=i;)s=s.parentNode;var c=e.measure,u=c.maps,d=r(l,s,n);if(d)return le(d,o);for(var f=s.nextSibling,p=l?l.nodeValue.length-n:0;f;f=f.nextSibling){if(d=r(f,f.firstChild,0))return le(jo(d.line,d.ch-p),o);p+=f.textContent.length}for(var h=s.previousSibling,p=n;h;h=h.previousSibling){if(d=r(h,h.firstChild,-1))return le(jo(d.line,d.ch+p),o);p+=f.textContent.length}}function ue(e,t,n,r,i){function o(e){return function(t){return t.id==e}}function a(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return""==n&&(n=t.textContent.replace(/\u200b/g,"")),void(l+=n);var u,d=t.getAttribute("cm-marker");if(d){var f=e.findMarks(jo(r,0),jo(i+1,0),o(+d));return void(f.length&&(u=f[0].find())&&(l+=Jr(e.doc,u.from,u.to).join(c)))}if("false"==t.getAttribute("contenteditable"))return;for(var p=0;p<t.childNodes.length;p++)a(t.childNodes[p]);/^(pre|div|p)$/i.test(t.nodeName)&&(s=!0)}else if(3==t.nodeType){var h=t.nodeValue;if(!h)return;s&&(l+=c,s=!1),l+=h}}for(var l="",s=!1,c=e.doc.lineSeparator();a(t),t!=n;)t=t.nextSibling;return l}function de(e,t){this.ranges=e,this.primIndex=t}function fe(e,t){this.anchor=e,this.head=t}function pe(e,t){var n=e[t];e.sort(function(e,t){return Ro(e.from(),t.from())}),t=Ni(e,n);for(var r=1;r<e.length;r++){var i=e[r],o=e[r-1];if(Ro(o.to(),i.from())>=0){var a=X(o.from(),i.from()),l=Z(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;t>=r&&--t,e.splice(--r,2,new fe(s?l:a,s?a:l))}}return new de(e,t)}function he(e,t){return new de([new fe(e,t||e)],0)}function me(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ge(e,t){if(t.line<e.first)return jo(e.first,0);var n=e.first+e.size-1;return t.line>n?jo(n,Qr(e,n).text.length):ve(t,Qr(e,t.line).text.length)}function ve(e,t){var n=e.ch;return null==n||n>t?jo(e.line,t):0>n?jo(e.line,0):e}function ye(e,t){return t>=e.first&&t<e.first+e.size}function be(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ge(e,t[r]);return n}function xe(e,t,n,r){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(r){var o=Ro(n,i)<0;o!=Ro(r,i)<0?(i=n,n=r):o!=Ro(n,r)<0&&(n=r)}return new fe(i,n)}return new fe(r||n,n)}function ke(e,t,n,r){Le(e,new de([xe(e,e.sel.primary(),t,n)],0),r)}function _e(e,t,n){for(var r=[],i=0;i<e.sel.ranges.length;i++)r[i]=xe(e,e.sel.ranges[i],t[i],null);var o=pe(r,e.sel.primIndex);Le(e,o,n)}function we(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Le(e,pe(i,e.sel.primIndex),r)}function Ce(e,t,n,r){Le(e,he(t,n),r)}function Se(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new fe(ge(e,t[n].anchor),ge(e,t[n].head))},origin:n&&n.origin};return qa(e,"beforeSelectionChange",e,r),e.cm&&qa(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?pe(r.ranges,r.ranges.length-1):t}function Me(e,t,n){var r=e.history.done,i=qi(r);i&&i.ranges?(r[r.length-1]=t,Te(e,t,n)):Le(e,t,n)}function Le(e,t,n){Te(e,t,n),fi(e,e.sel,e.cm?e.cm.curOp.id:0/0,n)}function Te(e,t,n){(Ai(e,"beforeSelectionChange")||e.cm&&Ai(e.cm,"beforeSelectionChange"))&&(t=Se(e,t,n));var r=n&&n.bias||(Ro(t.primary().head,e.sel.primary().head)<0?-1:1);Ae(e,Ee(e,t,r,!0)),n&&n.scroll===!1||!e.cm||Rn(e.cm)}function Ae(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Ti(e.cm)),Si(e,"cursorActivity",e))}function ze(e){Ae(e,Ee(e,e.sel,null,!1),Da)}function Ee(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=qe(e,a.anchor,l&&l.anchor,n,r),c=qe(e,a.head,l&&l.head,n,r);(i||s!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new fe(s,c))}return i?pe(i,t.primIndex):t}function Oe(e,t,n,r,i){var o=Qr(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker;if((null==l.from||(s.inclusiveLeft?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(s.inclusiveRight?l.to>=t.ch:l.to>t.ch))){if(i&&(qa(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(n){var c,u=s.find(0>r?1:-1);if((0>r?s.inclusiveRight:s.inclusiveLeft)&&(u=Ne(e,u,-r,o)),u&&u.line==t.line&&(c=Ro(u,n))&&(0>r?0>c:c>0))return Oe(e,u,t,r,i)}var d=s.find(0>r?-1:1);return(0>r?s.inclusiveLeft:s.inclusiveRight)&&(d=Ne(e,d,r,o)),d?Oe(e,d,t,r,i):null}}return t}function qe(e,t,n,r,i){var o=r||1,a=Oe(e,t,n,o,i)||!i&&Oe(e,t,n,o,!0)||Oe(e,t,n,-o,i)||!i&&Oe(e,t,n,-o,!0);return a?a:(e.cantEdit=!0,jo(e.first,0))}function Ne(e,t,n,r){return 0>n&&0==t.ch?t.line>e.first?ge(e,jo(t.line-1)):null:n>0&&t.ch==(r||Qr(e,t.line)).text.length?t.line<e.first+e.size-1?jo(t.line+1,0):null:new jo(t.line,t.ch+n)}function Pe(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ie(e,t){for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t!==!1||a!=n.sel.primIndex){var l=n.sel.ranges[a],s=l.empty();(s||e.options.showCursorWhenSelecting)&&De(e,l.head,i),s||je(e,l,o)}return r}function De(e,t,n){var r=ht(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild($i("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild($i("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}$(".other-cursor").each(function(t,n){var r=parseInt($(n).attr("data-line")),i=parseInt($(n).attr("data-ch")),o=parseFloat($(n).attr("data-offset-left")),a=parseFloat($(n).attr("data-offset-top")),l=e.charCoords({line:r,ch:i},"windows");$(n)[0].style.left=l.left+o+"px",$(n)[0].style.top=l.top+a+"px"})}function je(e,t,n){function r(e,t,n,r){0>t&&(t=0),t=Math.round(t),r=Math.round(r),l.appendChild($i("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?u-e:n)+"px; height: "+(r-t)+"px"))}function i(t,n,i){function o(n,r){return pt(e,jo(t,n),"div",d,r)}var l,s,d=Qr(a,t),f=d.text.length;return to(oi(d),n||0,null==i?f:i,function(e,t,a){var d,p,h,m=o(e,"left");if(e==t)d=m,p=h=m.left;else{if(d=o(t-1,"right"),"rtl"==a){var g=m;m=d,d=g}p=m.left,h=d.right}null==n&&0==e&&(p=c),d.top-m.top>3&&(r(p,m.top,null,m.bottom),p=c,m.bottom<d.top&&r(p,m.bottom,null,d.top)),null==i&&t==f&&(h=u),(!l||m.top<l.top||m.top==l.top&&m.left<l.left)&&(l=m),(!s||d.bottom>s.bottom||d.bottom==s.bottom&&d.right>s.right)&&(s=d),c+1>p&&(p=c),r(p,d.top,h-p,d.bottom)}),{start:l,end:s}}var o=e.display,a=e.doc,l=document.createDocumentFragment(),s=Ve(e.display),c=s.left,u=Math.max(o.sizerWidth,Ke(e)-o.sizer.offsetLeft)-s.right,d=t.from(),f=t.to();if(d.line==f.line)i(d.line,d.ch,f.ch);else{var p=Qr(a,d.line),h=Qr(a,f.line),m=br(p)==br(h),g=i(d.line,d.ch,m?p.text.length+1:null).end,v=i(f.line,m?0:null,f.ch).start;m&&(g.top<v.top-2?(r(g.right,g.top,null,g.bottom),r(c,v.top,v.left,v.bottom)):r(g.right,g.top,v.left-g.right,g.bottom)),g.bottom<v.top&&r(c,g.bottom,null,v.top)}n.appendChild(l)}function Re(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function We(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,Ri(Fe,e))}function Fe(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=sa(t.mode,$e(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength,s=Pr(e,o,l?sa(t.mode,r):r,!0);o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!d&&f<a.length;++f)d=a[f]!=o.styles[f];d&&i.push(t.frontier),o.stateAfter=l?r:sa(t.mode,r)}else o.text.length<=e.options.maxHighlightLength&&Dr(e,o.text,r),o.stateAfter=t.frontier%5==0?sa(t.mode,r):null;return++t.frontier,+new Date>n?(We(e,e.options.workDelay),!0):void 0}),i.length&&zt(e,function(){for(var t=0;t<i.length;t++)Dt(e,i[t],"text")})}}function He(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=Qr(o,l-1);if(s.stateAfter&&(!n||l<=o.frontier))return l;var c=Wa(s.text,null,e.options.tabSize);(null==i||r>c)&&(i=l-1,r=c)}return i}function $e(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=He(e,t,n),a=o>r.first&&Qr(r,o-1).stateAfter;return a=a?sa(r.mode,a):ca(r.mode),r.iter(o,t,function(n){Dr(e,n.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;n.stateAfter=l?sa(r.mode,a):null,++o}),n&&(r.frontier=o),a}function Be(e){return e.lineSpace.offsetTop}function Ue(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ve(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Ui(e.measure,$i("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Ge(e){return Pa-e.display.nativeBarWidth}function Ke(e){return e.display.scroller.clientWidth-Ge(e)-e.display.barWidth}function Ze(e){return e.display.scroller.clientHeight-Ge(e)-e.display.barHeight}function Xe(e,t,n){var r=e.options.lineWrapping,i=r&&Ke(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ye(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var r=0;r<e.rest.length;r++)if(ni(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Qe(e,t){t=br(t);var n=ni(t),r=e.display.externalMeasured=new Nt(e.doc,t,n);r.lineN=n;var i=r.built=Rr(e,r);return r.text=i.pre,Ui(e.display.lineMeasure,i.pre),r}function Je(e,t,n,r){return nt(e,tt(e,t),n,r)}function et(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Rt(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function tt(e,t){var n=ni(t),r=et(e,n);r&&!r.text?r=null:r&&r.changes&&(P(e,r,n,q(e)),e.curOp.forceUpdate=!0),r||(r=Qe(e,t));var i=Ye(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function nt(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Xe(e,t.view,t.rect),t.hasHeights=!0),o=it(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function rt(e,t,n){for(var r,i,o,a,l=0;l<e.length;l+=3){
+var s=e[l],c=e[l+1];if(s>t?(i=0,o=1,a="left"):c>t?(i=t-s,o=i+1):(l==e.length-3||t==c&&e[l+3]>t)&&(o=c-s,i=o-1,t>=c&&(a="right")),null!=i){if(r=e[l+2],s==c&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[(l-=3)+2],a="left";if("right"==n&&i==c-s)for(;l<e.length-3&&e[l+3]==e[l+4]&&!e[l+5].insertLeft;)r=e[(l+=3)+2],a="right";break}}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:c}}function it(e,t,n,r){var i,o=rt(t.map,n,r),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;4>u;u++){for(;l&&Hi(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&Hi(t.line.text.charAt(o.coverStart+s));)++s;if(xo&&9>ko&&0==l&&s==o.coverEnd-o.coverStart)i=a.parentNode.getBoundingClientRect();else if(xo&&e.options.lineWrapping){var d=Ba(a,l,s).getClientRects();i=d.length?d["right"==r?d.length-1:0]:Bo}else i=Ba(a,l,s).getBoundingClientRect()||Bo;if(i.left||i.right||0==l)break;s=l,l-=1,c="right"}xo&&11>ko&&(i=ot(e.display.measure,i))}else{l>0&&(c=r="right");var d;i=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==r?d.length-1:0]:a.getBoundingClientRect()}if(xo&&9>ko&&!l&&(!i||!i.left&&!i.right)){var f=a.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+xt(e.display),top:f.top,bottom:f.bottom}:Bo}for(var p=i.top-t.rect.top,h=i.bottom-t.rect.top,m=(p+h)/2,g=t.view.measure.heights,u=0;u<g.length-1&&!(m<g[u]);u++);var v=u?g[u-1]:0,y=g[u],b={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:v,bottom:y};return i.left||i.right||(b.bogus=!0),e.options.singleCursorHeightPerLine||(b.rtop=p,b.rbottom=h),b}function ot(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!eo(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function at(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function lt(e){e.display.externalMeasure=null,Bi(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)at(e.display.view[t])}function st(e){lt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ct(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ut(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function dt(e,t,n,r){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=Mr(t.widgets[i]);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=ii(t);if("local"==r?a+=Be(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==r?0:ut());var s=l.left+("window"==r?0:ct());n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function ft(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=ct(),i-=ut();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function pt(e,t,n,r,i){return r||(r=Qr(e.doc,t.line)),dt(e,r,Je(e,r,t.ch,i),n)}function ht(e,t,n,r,i,o){function a(t,a){var l=nt(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,dt(e,r,l,n)}function l(e,t){var n=s[t],r=n.level%2;return e==no(n)&&t&&n.level<s[t-1].level?(n=s[--t],e=ro(n)-(n.level%2?0:1),r=!0):e==ro(n)&&t<s.length-1&&n.level<s[t+1].level&&(n=s[++t],e=no(n)-n.level%2,r=!1),r&&e==n.to&&e>n.from?a(e-1):a(e,r)}r=r||Qr(e.doc,t.line),i||(i=tt(e,r));var s=oi(r),c=t.ch;if(!s)return a(c);var u=uo(s,c),d=l(c,u);return null!=al&&(d.other=l(c,al)),d}function mt(e,t){var n=0,t=ge(e.doc,t);e.options.lineWrapping||(n=xt(e.display)*t.ch);var r=Qr(e.doc,t.line),i=ii(r)+Be(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function gt(e,t,n,r){var i=jo(e,t);return i.xRel=r,n&&(i.outside=!0),i}function vt(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,0>n)return gt(r.first,0,!0,-1);var i=ri(r,n),o=r.first+r.size-1;if(i>o)return gt(r.first+r.size-1,Qr(r,o).text.length,!0,1);0>t&&(t=0);for(var a=Qr(r,i);;){var l=yt(e,a,i,t,n),s=vr(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=ni(a=c.to.line)}}function yt(e,t,n,r,i){function o(r){var i=ht(e,jo(n,r),"line",t,c);return l=!0,a>i.bottom?i.left-s:a<i.top?i.left+s:(l=!1,i.left)}var a=i-ii(t),l=!1,s=2*e.display.wrapper.clientWidth,c=tt(e,t),u=oi(t),d=t.text.length,f=io(t),p=oo(t),h=o(f),m=l,g=o(p),v=l;if(r>g)return gt(n,p,v,1);for(;;){if(u?p==f||p==po(t,f,1):1>=p-f){for(var y=h>r||g-r>=r-h?f:p,b=r-(y==f?h:g);Hi(t.text.charAt(y));)++y;var x=gt(n,y,y==f?m:v,-1>b?-1:b>1?1:0);return x}var k=Math.ceil(d/2),_=f+k;if(u){_=f;for(var w=0;k>w;++w)_=po(t,_,1)}var C=o(_);C>r?(p=_,g=C,(v=l)&&(g+=1e3),d=k):(f=_,h=C,m=l,d-=k)}}function bt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Fo){Fo=$i("pre");for(var t=0;49>t;++t)Fo.appendChild(document.createTextNode("x")),Fo.appendChild($i("br"));Fo.appendChild(document.createTextNode("x"))}Ui(e.measure,Fo);var n=Fo.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Bi(e.measure),n||1}function xt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=$i("span","xxxxxxxxxx"),n=$i("pre",[t]);Ui(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function kt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Vo},Uo?Uo.ops.push(e.curOp):e.curOp.ownsGroup=Uo={ops:[e.curOp],delayedCallbacks:[]}}function _t(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function wt(e){var t=e.curOp,n=t.ownsGroup;if(n)try{_t(n)}finally{Uo=null;for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;Ct(n)}}function Ct(e){for(var t=e.ops,n=0;n<t.length;n++)St(t[n]);for(var n=0;n<t.length;n++)Mt(t[n]);for(var n=0;n<t.length;n++)Lt(t[n]);for(var n=0;n<t.length;n++)Tt(t[n]);for(var n=0;n<t.length;n++)At(t[n])}function St(e){var t=e.cm,n=t.display;M(t),e.updateMaxLine&&f(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new S(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Mt(e){e.updatedDisplay=e.mustUpdate&&L(e.cm,e.update)}function Lt(e){var t=e.cm,n=t.display;e.updatedDisplay&&E(t),e.barMeasure=h(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Je(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Ge(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ke(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Tt(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&an(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1),e.preparedSelection&&t.display.input.showSelection(e.preparedSelection),e.updatedDisplay&&z(t,e.barMeasure),(e.updatedDisplay||e.startHeight!=t.doc.height)&&y(t,e.barMeasure),e.selectionChanged&&Re(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),!e.focus||e.focus!=Vi()||document.hasFocus&&!document.hasFocus()||Y(e.cm)}function At(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&T(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null==e.scrollTop||n.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(r.scrollTop=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,e.scrollTop)),n.scrollbars.setScrollTop(r.scrollTop),n.scroller.scrollTop=r.scrollTop),null==e.scrollLeft||n.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(r.scrollLeft=Math.max(0,Math.min(n.scroller.scrollWidth-Ke(t),e.scrollLeft)),n.scrollbars.setScrollLeft(r.scrollLeft),n.scroller.scrollLeft=r.scrollLeft,k(t)),e.scrollToPos){var i=Pn(t,ge(r,e.scrollToPos.from),ge(r,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&Nn(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||qa(o[l],"hide");if(a)for(var l=0;l<a.length;++l)a[l].lines.length&&qa(a[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&qa(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function zt(e,t){if(e.curOp)return t();kt(e);try{return t()}finally{wt(e)}}function Et(e,t){return function(){if(e.curOp)return t.apply(e,arguments);kt(e);try{return t.apply(e,arguments)}finally{wt(e)}}}function Ot(e){return function(){if(this.curOp)return e.apply(this,arguments);kt(this);try{return e.apply(this,arguments)}finally{wt(this)}}}function qt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);kt(t);try{return e.apply(this,arguments)}finally{wt(t)}}}function Nt(e,t,n){this.line=t,this.rest=xr(t),this.size=this.rest?ni(qi(this.rest))-n+1:1,this.node=this.text=null,this.hidden=wr(e,t)}function Pt(e,t,n){for(var r,i=[],o=t;n>o;o=r){var a=new Nt(e.doc,Qr(e.doc,o),o);r=o+a.size,i.push(a)}return i}function It(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Do&&kr(e.doc,t)<i.viewTo&&jt(e);else if(n<=i.viewFrom)Do&&_r(e.doc,n+r)>i.viewFrom?jt(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)jt(e);else if(t<=i.viewFrom){var o=Wt(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):jt(e)}else if(n>=i.viewTo){var o=Wt(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):jt(e)}else{var a=Wt(e,t,t,-1),l=Wt(e,n,n+r,1);a&&l?(i.view=i.view.slice(0,a.index).concat(Pt(e,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):jt(e)}var s=i.externalMeasured;s&&(n<s.lineN?s.lineN+=r:t<s.lineN+s.size&&(i.externalMeasured=null))}function Dt(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Rt(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==Ni(a,n)&&a.push(n)}}}function jt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Rt(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,0>t)return r}function Wt(e,t,n,r){var i,o=Rt(e,t),a=e.display.view;if(!Do||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var l=0,s=e.display.viewFrom;o>l;l++)s+=a[l].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;kr(e.doc,n)!=n;){if(o==(0>r?0:a.length-1))return null;n+=r*a[o-(0>r?1:0)].size,o+=r}return{index:o,lineN:n}}function Ft(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Pt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Pt(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Rt(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Pt(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Rt(e,n)))),r.viewTo=n}function Ht(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function $t(e){function t(){i.activeTouch&&(o=setTimeout(function(){i.activeTouch=null},1e3),a=i.activeTouch,a.end=+new Date)}function n(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function r(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}var i=e.display;za(i.scroller,"mousedown",Et(e,Kt)),xo&&11>ko?za(i.scroller,"dblclick",Et(e,function(t){if(!Li(e,t)){var n=Gt(e,t);if(n&&!Jt(e,t)&&!Vt(e.display,t)){La(t);var r=e.findWordAt(n);ke(e.doc,r.anchor,r.head)}}})):za(i.scroller,"dblclick",function(t){Li(e,t)||La(t)}),Po||za(i.scroller,"contextmenu",function(t){xn(e,t)});var o,a={end:0};za(i.scroller,"touchstart",function(t){if(!Li(e,t)&&!n(t)){clearTimeout(o);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),za(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),za(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!Vt(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||r(o,o.prev)?new fe(l,l):!o.prev.prev||r(o,o.prev.prev)?e.findWordAt(l):new fe(jo(l.line,0),ge(e.doc,jo(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),La(n)}t()}),za(i.scroller,"touchcancel",t),za(i.scroller,"scroll",function(){i.scroller.clientHeight&&(on(e,i.scroller.scrollTop),an(e,i.scroller.scrollLeft,!0),qa(e,"scroll",e))}),za(i.scroller,"mousewheel",function(t){ln(e,t)}),za(i.scroller,"DOMMouseScroll",function(t){ln(e,t)}),za(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Li(e,t)||Aa(t)},over:function(t){Li(e,t)||(nn(e,t),Aa(t))},start:function(t){tn(e,t)},drop:Et(e,en),leave:function(){rn(e)}};var l=i.input.getField();za(l,"keyup",function(t){mn.call(e,t)}),za(l,"keydown",Et(e,pn)),za(l,"keypress",Et(e,gn)),za(l,"focus",Ri(yn,e)),za(l,"blur",Ri(bn,e))}function Bt(t,n,r){var i=r&&r!=e.Init;if(!n!=!i){var o=t.display.dragFunctions,a=n?za:Oa;a(t.display.scroller,"dragstart",o.start),a(t.display.scroller,"dragenter",o.enter),a(t.display.scroller,"dragover",o.over),a(t.display.scroller,"dragleave",o.leave),a(t.display.scroller,"drop",o.drop)}}function Ut(e){var t=e.display;(t.lastWrapHeight!=t.wrapper.clientHeight||t.lastWrapWidth!=t.wrapper.clientWidth)&&(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Vt(e,t){for(var n=_i(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Gt(e,t,n,r){var i=e.display;if(!n&&"true"==_i(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,c=vt(e,o,a);if(r&&1==c.xRel&&(s=Qr(e.doc,c.line).text).length==c.ch){var u=Wa(s,s.length,e.options.tabSize)-s.length;c=jo(c.line,Math.max(0,Math.round((o-Ve(e.display).left)/xt(e.display))-u))}return c}function Kt(e){var t=this,n=t.display;if(!(Li(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.shift=e.shiftKey,Vt(n,e))return void(_o||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!Jt(t,e)){var r=Gt(t,e);switch(window.focus(),wi(e)){case 1:t.state.selectingText?t.state.selectingText(e):r?Zt(t,e,r):_i(e)==n.scroller&&La(e);break;case 2:_o&&(t.state.lastMiddleDown=+new Date),r&&ke(t.doc,r),setTimeout(function(){n.input.focus()},20),La(e);break;case 3:Po?xn(t,e):vn(t)}}}}function Zt(e,t,n){xo?setTimeout(Ri(Y,e),0):e.curOp.focus=Vi();var r,i=+new Date;$o&&$o.time>i-400&&0==Ro($o.pos,n)?r="triple":Ho&&Ho.time>i-400&&0==Ro(Ho.pos,n)?(r="double",$o={time:i,pos:n}):(r="single",Ho={time:i,pos:n});var o,a=e.doc.sel,l=Eo?t.metaKey:t.ctrlKey;e.options.dragDrop&&el&&!e.isReadOnly()&&"single"==r&&(o=a.contains(n))>-1&&(Ro((o=a.ranges[o]).from(),n)<0||n.xRel>0)&&(Ro(o.to(),n)>0||n.xRel<0)?Xt(e,t,n,l):Yt(e,t,n,r,l)}function Xt(e,t,n,r){var i=e.display,o=+new Date,a=Et(e,function(l){_o&&(i.scroller.draggable=!1),e.state.draggingText=!1,Oa(document,"mouseup",a),Oa(i.scroller,"drop",a),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(La(l),!r&&+new Date-200<o&&ke(e.doc,n),_o||xo&&9==ko?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});_o&&(i.scroller.draggable=!0),e.state.draggingText=a,i.scroller.dragDrop&&i.scroller.dragDrop(),za(document,"mouseup",a),za(i.scroller,"drop",a)}function Yt(e,t,n,r,i){function o(t){if(0!=Ro(g,t))if(g=t,"rect"==r){for(var i=[],o=e.options.tabSize,a=Wa(Qr(c,n.line).text,n.ch,o),l=Wa(Qr(c,t.line).text,t.ch,o),s=Math.min(a,l),p=Math.max(a,l),h=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));m>=h;h++){var v=Qr(c,h).text,y=Fa(v,s,o);s==p?i.push(new fe(jo(h,y),jo(h,y))):v.length>y&&i.push(new fe(jo(h,y),jo(h,Fa(v,p,o))))}i.length||i.push(new fe(n,n)),Le(c,pe(f.ranges.slice(0,d).concat(i),d),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=u,x=b.anchor,k=t;if("single"!=r){if("double"==r)var _=e.findWordAt(t);else var _=new fe(jo(t.line,0),ge(c,jo(t.line+1,0)));Ro(_.anchor,x)>0?(k=_.head,x=X(b.from(),_.anchor)):(k=_.anchor,x=Z(b.to(),_.head))}var i=f.ranges.slice(0);i[d]=new fe(ge(c,x),k),Le(c,pe(i,d),ja)}}function a(t){var n=++y,i=Gt(e,t,!0,"rect"==r);if(i)if(0!=Ro(i,g)){e.curOp.focus=Vi(),o(i);var l=x(s,c);(i.line>=l.to||i.line<l.from)&&setTimeout(Et(e,function(){y==n&&a(t)}),150)}else{var u=t.clientY<v.top?-20:t.clientY>v.bottom?20:0;u&&setTimeout(Et(e,function(){y==n&&(s.scroller.scrollTop+=u,a(t))}),50)}}function l(t){e.state.selectingText=!1,y=1/0,La(t),s.input.focus(),Oa(document,"mousemove",b),Oa(document,"mouseup",k),c.history.lastSelOrigin=null}var s=e.display,c=e.doc;La(t);var u,d,f=c.sel,p=f.ranges;if(i&&!t.shiftKey?(d=c.sel.contains(n),u=d>-1?p[d]:new fe(n,n)):(u=c.sel.primary(),d=c.sel.primIndex),t.altKey)r="rect",i||(u=new fe(n,n)),n=Gt(e,t,!0,!0),d=-1;else if("double"==r){var h=e.findWordAt(n);u=e.display.shift||c.extend?xe(c,u,h.anchor,h.head):h}else if("triple"==r){var m=new fe(jo(n.line,0),ge(c,jo(n.line+1,0)));u=e.display.shift||c.extend?xe(c,u,m.anchor,m.head):m}else u=xe(c,u,n);i?-1==d?(d=p.length,Le(c,pe(p.concat([u]),d),{scroll:!1,origin:"*mouse"})):p.length>1&&p[d].empty()&&"single"==r&&!t.shiftKey?(Le(c,pe(p.slice(0,d).concat(p.slice(d+1)),0),{scroll:!1,origin:"*mouse"}),f=c.sel):we(c,d,u,ja):(d=0,Le(c,new de([u],0),ja),f=c.sel);var g=n,v=s.wrapper.getBoundingClientRect(),y=0,b=Et(e,function(e){wi(e)?a(e):l(e)}),k=Et(e,l);e.state.selectingText=k,za(document,"mousemove",b),za(document,"mouseup",k)}function Qt(e,t,n,r){try{var i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&La(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!Ai(e,n))return ki(t);o-=l.top-a.viewOffset;for(var s=0;s<e.options.gutters.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i){var u=ri(e.doc,o),d=e.options.gutters[s];return qa(e,n,e,u,d,t),ki(t)}}}function Jt(e,t){return Qt(e,t,"gutterClick",!0)}function en(e){var t=this;if(rn(t),!Li(t,e)&&!Vt(t.display,e)){La(e),xo&&(Go=+new Date);var n=Gt(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(e,r){if(!t.options.allowDropFileTypes||-1!=Ni(t.options.allowDropFileTypes,e.type)){var l=new FileReader;l.onload=Et(t,function(){var e=l.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++a==i){n=ge(t.doc,n);var s={from:n,to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Ln(t.doc,s),Me(t.doc,he(n,Jo(s)))}}),l.readAsText(e)}},s=0;i>s;++s)l(r[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(Eo?e.altKey:e.ctrlKey))var c=t.listSelections();if(Te(t.doc,he(n,n)),c)for(var s=0;s<c.length;++s)qn(t.doc,"",c[s].anchor,c[s].head,"drag");t.replaceSelection(o,"around","paste"),t.display.input.focus()}}catch(e){}}}}function tn(e,t){if(xo&&(!e.state.draggingText||+new Date-Go<100))return void Aa(t);if(!Li(e,t)&&!Vt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.setDragImage&&!Mo)){var n=$i("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",So&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),So&&n.parentNode.removeChild(n)}}function nn(e,t){var n=Gt(e,t);if(n){var r=document.createDocumentFragment();De(e,n,r),e.display.dragCursor||(e.display.dragCursor=$i("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),Ui(e.display.dragCursor,r)}}function rn(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function on(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,vo||A(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),vo&&A(e),We(e,100))}function an(e,t,n){(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,k(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function ln(e,t){var n=Xo(t),r=n.x,i=n.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(r&&l||i&&s){if(i&&Eo&&_o)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var d=0;d<u.length;d++)if(u[d].node==c){e.display.currentWheelTarget=c;break e}if(r&&!vo&&!So&&null!=Zo)return i&&s&&on(e,Math.max(0,Math.min(a.scrollTop+i*Zo,a.scrollHeight-a.clientHeight))),an(e,Math.max(0,Math.min(a.scrollLeft+r*Zo,a.scrollWidth-a.clientWidth))),(!i||i&&s)&&La(t),void(o.wheelStartX=null);if(i&&null!=Zo){var f=i*Zo,p=e.doc.scrollTop,h=p+o.wrapper.clientHeight;0>f?p=Math.max(0,p+f-50):h=Math.min(e.doc.height,h+f+50),A(e,{top:p,bottom:h})}20>Ko&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(Zo=(Zo*Ko+n)/(Ko+1),++Ko)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}function sn(e,t,n){if("string"==typeof t&&(t=ua[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ia}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function cn(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=fa(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&fa(t,e.options.extraKeys,n,e)||fa(t,e.options.keyMap,n,e)}function un(e,t,n,r){var i=e.state.keySeq;if(i){if(pa(t))return"handled";Yo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=cn(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&Si(e,"keyHandled",e,t,n),("handled"==o||"multi"==o)&&(La(n),Re(e)),i&&!o&&/\'$/.test(t)?(La(n),!0):!!o}function dn(e,t){var n=ha(t,!0);return n?t.shiftKey&&!e.state.keySeq?un(e,"Shift-"+n,t,function(t){return sn(e,t,!0)})||un(e,n,t,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?sn(e,t):void 0}):un(e,n,t,function(t){return sn(e,t)}):!1}function fn(e,t,n){return un(e,"'"+n+"'",t,function(t){return sn(e,t,!0)})}function pn(e){var t=this;if(t.curOp.focus=Vi(),!Li(t,e)){xo&&11>ko&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=dn(t,e);So&&(Qo=r?n:null,!r&&88==n&&!rl&&(Eo?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||hn(t)}}function hn(e){function t(e){18!=e.keyCode&&e.altKey||(Ya(n,"CodeMirror-crosshair"),Oa(document,"keyup",t),Oa(document,"mouseover",t))}var n=e.display.lineDiv;Qa(n,"CodeMirror-crosshair"),za(document,"keyup",t),za(document,"mouseover",t)}function mn(e){16==e.keyCode&&(this.doc.sel.shift=!1),Li(this,e)}function gn(e){var t=this;if(!(Vt(t.display,e)||Li(t,e)||e.ctrlKey&&!e.altKey||Eo&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(So&&n==Qo)return Qo=null,void La(e);if(!So||e.which&&!(e.which<10)||!dn(t,e)){var i=String.fromCharCode(null==r?n:r);fn(t,e,i)||t.display.input.onKeyPress(e)}}}function vn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,bn(e))},100)}function yn(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(qa(e,"focus",e),e.state.focused=!0,Qa(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),_o&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Re(e))}function bn(e){e.state.delayingBlurEvent||(e.state.focused&&(qa(e,"blur",e),e.state.focused=!1,Ya(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function xn(e,t){Vt(e.display,t)||kn(e,t)||Li(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function kn(e,t){return Ai(e,"gutterContextMenu")?Qt(e,t,"gutterContextMenu",!1):!1}function _n(e,t){if(Ro(e,t.from)<0)return e;if(Ro(e,t.to)<=0)return Jo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Jo(t).ch-t.to.ch),jo(n,r)}function wn(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new fe(_n(i.anchor,t),_n(i.head,t)))}return pe(n,e.sel.primIndex)}function Cn(e,t,n){return e.line==t.line?jo(n.line,e.ch-t.ch+n.ch):jo(n.line+(e.line-t.line),e.ch)}function Sn(e,t,n){for(var r=[],i=jo(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Cn(l.from,i,o),c=Cn(Jo(l),i,o);if(i=l.to,o=c,"around"==n){var u=e.sel.ranges[a],d=Ro(u.head,u.anchor)<0;r[a]=new fe(d?c:s,d?s:c)}else r[a]=new fe(s,s)}return new de(r,e.sel.primIndex)}function Mn(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return n&&(r.update=function(t,n,r,i){t&&(this.from=ge(e,t)),n&&(this.to=ge(e,n)),r&&(this.text=r),void 0!==i&&(this.origin=i)}),qa(e,"beforeChange",e,r),e.cm&&qa(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Ln(e,t,n){if(e.cm){if(!e.cm.curOp)return Et(e.cm,Ln)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(Ai(e,"beforeChange")||e.cm&&Ai(e.cm,"beforeChange"))||(t=Mn(e,t,!0))){var r=Io&&!n&&cr(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Tn(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else Tn(e,t)}}function Tn(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Ro(t.from,t.to)){var n=wn(e,t);ui(e,t,n,e.cm?e.cm.curOp.id:0/0),En(e,t,n,ar(e,t));var r=[];Xr(e,function(e,n){n||-1!=Ni(r,e.history)||(xi(e.history,t),r.push(e.history)),En(e,t,null,ar(e,t))})}}function An(e,t,n){if(!e.cm||!e.cm.state.suppressEdits){for(var r,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s<a.length&&(r=a[s],n?!r.ranges||r.equals(e.sel):r.ranges);s++);if(s!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;r=a.pop(),r.ranges;){if(pi(r,l),n&&!r.equals(e.sel))return void Le(e,r,{clearRedo:!1});o=r}var c=[];pi(o,l),l.push({changes:c,generation:i.generation}),i.generation=r.generation||++i.maxGeneration;for(var u=Ai(e,"beforeChange")||e.cm&&Ai(e.cm,"beforeChange"),s=r.changes.length-1;s>=0;--s){var d=r.changes[s];if(d.origin=t,u&&!Mn(e,d,!1))return void(a.length=0);c.push(li(e,d));var f=s?wn(e,d):qi(a);En(e,d,f,sr(e,d)),!s&&e.cm&&e.cm.scrollIntoView({from:d.from,to:Jo(d)});var p=[];Xr(e,function(e,t){t||-1!=Ni(p,e.history)||(xi(e.history,d),p.push(e.history)),En(e,d,null,sr(e,d))})}}}}function zn(e,t){if(0!=t&&(e.first+=t,e.sel=new de(Pi(e.sel.ranges,function(e){return new fe(jo(e.anchor.line+t,e.anchor.ch),jo(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){It(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Dt(e.cm,r,"gutter")}}function En(e,t,n,r){if(e.cm&&!e.cm.curOp)return Et(e.cm,En)(e,t,n,r);if(t.to.line<e.first)return void zn(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);zn(e,i),t={from:jo(e.first,0),to:jo(t.to.line+i,t.to.ch),text:[qi(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:jo(o,Qr(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Jr(e,t.from,t.to),n||(n=wn(e,t)),e.cm?On(e.cm,t,r):Gr(e,t,r),Te(e,n,Da)}}function On(e,t,n){var r=e.doc,i=e.display,a=t.from,l=t.to,s=!1,c=a.line;e.options.lineWrapping||(c=ni(br(Qr(r,a.line))),r.iter(c,l.line+1,function(e){return e==i.maxLine?(s=!0,!0):void 0})),r.sel.contains(t.from,t.to)>-1&&Ti(e),Gr(r,t,n,o(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=d(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,a.line),We(e,400);var u=t.text.length-(l.line-a.line)-1;t.full?It(e):a.line!=l.line||1!=t.text.length||Vr(e.doc,t)?It(e,a.line,l.line+1,u):Dt(e,a.line,"text");var f=Ai(e,"changes"),p=Ai(e,"change");if(p||f){var h={from:a,to:l,text:t.text,removed:t.removed,origin:t.origin};p&&Si(e,"change",e,h),f&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function qn(e,t,n,r,i){if(r||(r=n),Ro(r,n)<0){var o=r;r=n,n=o}"string"==typeof t&&(t=e.splitLines(t)),Ln(e,{from:n,to:r,text:t,origin:i})}function Nn(e,t){if(!Li(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!To){var o=$i("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-Be(e.display))+"px; height: "+(t.bottom-t.top+Ge(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function Pn(e,t,n,r){null==r&&(r=0);for(var i=0;5>i;i++){var o=!1,a=ht(e,t),l=n&&n!=t?ht(e,n):a,s=Dn(e,Math.min(a.left,l.left),Math.min(a.top,l.top)-r,Math.max(a.left,l.left),Math.max(a.bottom,l.bottom)+r),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=s.scrollTop&&(on(e,s.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(o=!0)),null!=s.scrollLeft&&(an(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(o=!0)),!o)break}return a}function In(e,t,n,r,i){var o=Dn(e,t,n,r,i);null!=o.scrollTop&&on(e,o.scrollTop),null!=o.scrollLeft&&an(e,o.scrollLeft)}function Dn(e,t,n,r,i){var o=e.display,a=bt(e.display);0>n&&(n=0);var l=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,s=Ze(e),c={};i-n>s&&(i=n+s);var u=e.doc.height+Ue(o),d=a>n,f=i>u-a;if(l>n)c.scrollTop=d?0:n;else if(i>l+s){var p=Math.min(n,(f?u:i)-s);p!=l&&(c.scrollTop=p)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=Ke(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=r-t>m;return g&&(r=t+m),10>t?c.scrollLeft=0:h>t?c.scrollLeft=Math.max(0,t-(g?0:10)):r>m+h-3&&(c.scrollLeft=r+(g?0:10)-m),c}function jn(e,t,n){(null!=t||null!=n)&&Wn(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Rn(e){Wn(e);
-}else{l>0&&(c=r="right");var f;i=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==r?f.length-1:0]:a.getBoundingClientRect()}if(mo&&9>go&&!l&&(!i||!i.left&&!i.right)){var d=a.parentNode.getClientRects()[0];i=d?{left:d.left,right:d.left+bt(e.display),top:d.top,bottom:d.bottom}:Ro}for(var p=i.top-t.rect.top,h=i.bottom-t.rect.top,m=(p+h)/2,g=t.view.measure.heights,u=0;u<g.length-1&&!(m<g[u]);u++);var v=u?g[u-1]:0,y=g[u],b={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:v,bottom:y};return i.left||i.right||(b.bogus=!0),e.options.singleCursorHeightPerLine||(b.rtop=p,b.rbottom=h),b}function it(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Yi(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function ot(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function at(e){e.display.externalMeasure=null,Fi(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ot(e.display.view[t])}function lt(e){at(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function st(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ct(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function ut(e,t,n,r){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=wr(t.widgets[i]);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=ti(t);if("local"==r?a+=$e(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==r?0:ct());var s=l.left+("window"==r?0:st());n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function ft(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=st(),i-=ct();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function dt(e,t,n,r,i){return r||(r=Xr(e.doc,t.line)),ut(e,r,Qe(e,r,t.ch,i),n)}function pt(e,t,n,r,i,o){function a(t,a){var l=tt(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,ut(e,r,l,n)}function l(e,t){var n=s[t],r=n.level%2;return e==Ji(n)&&t&&n.level<s[t-1].level?(n=s[--t],e=eo(n)-(n.level%2?0:1),r=!0):e==eo(n)&&t<s.length-1&&n.level<s[t+1].level&&(n=s[++t],e=Ji(n)-n.level%2,r=!1),r&&e==n.to&&e>n.from?a(e-1):a(e,r)}r=r||Xr(e.doc,t.line),i||(i=et(e,r));var s=ni(r),c=t.ch;if(!s)return a(c);var u=lo(s,c),f=l(c,u);return null!=Ja&&(f.other=l(c,Ja)),f}function ht(e,t){var n=0,t=ve(e.doc,t);e.options.lineWrapping||(n=bt(e.display)*t.ch);var r=Xr(e.doc,t.line),i=ti(r)+$e(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function mt(e,t,n,r){var i=qo(e,t);return i.xRel=r,n&&(i.outside=!0),i}function gt(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,0>n)return mt(r.first,0,!0,-1);var i=ei(r,n),o=r.first+r.size-1;if(i>o)return mt(r.first+r.size-1,Xr(r,o).text.length,!0,1);0>t&&(t=0);for(var a=Xr(r,i);;){var l=vt(e,a,i,t,n),s=hr(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=Jr(a=c.to.line)}}function vt(e,t,n,r,i){function o(r){var i=pt(e,qo(n,r),"line",t,c);return l=!0,a>i.bottom?i.left-s:a<i.top?i.left+s:(l=!1,i.left)}var a=i-ti(t),l=!1,s=2*e.display.wrapper.clientWidth,c=et(e,t),u=ni(t),f=t.text.length,d=to(t),p=no(t),h=o(d),m=l,g=o(p),v=l;if(r>g)return mt(n,p,v,1);for(;;){if(u?p==d||p==co(t,d,1):1>=p-d){for(var y=h>r||g-r>=r-h?d:p,b=r-(y==d?h:g);Ri(t.text.charAt(y));)++y;var x=mt(n,y,y==d?m:v,-1>b?-1:b>1?1:0);return x}var _=Math.ceil(f/2),k=d+_;if(u){k=d;for(var w=0;_>w;++w)k=co(t,k,1)}var C=o(k);C>r?(p=k,g=C,(v=l)&&(g+=1e3),f=_):(d=k,h=C,m=l,f-=_)}}function yt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Po){Po=Wi("pre");for(var t=0;49>t;++t)Po.appendChild(document.createTextNode("x")),Po.appendChild(Wi("br"));Po.appendChild(document.createTextNode("x"))}Hi(e.measure,Po);var n=Po.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Fi(e.measure),n||1}function bt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=Wi("span","xxxxxxxxxx"),n=Wi("pre",[t]);Hi(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function xt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Fo},Wo?Wo.ops.push(e.curOp):e.curOp.ownsGroup=Wo={ops:[e.curOp],delayedCallbacks:[]}}function _t(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n]();for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++](i.cm)}}while(n<t.length)}function kt(e){var t=e.curOp,n=t.ownsGroup;if(n)try{_t(n)}finally{Wo=null;for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;wt(n)}}function wt(e){for(var t=e.ops,n=0;n<t.length;n++)Ct(t[n]);for(var n=0;n<t.length;n++)St(t[n]);for(var n=0;n<t.length;n++)Mt(t[n]);for(var n=0;n<t.length;n++)Lt(t[n]);for(var n=0;n<t.length;n++)Tt(t[n])}function Ct(e){var t=e.cm,n=t.display;M(t),e.updateMaxLine&&d(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new S(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function St(e){e.updatedDisplay=e.mustUpdate&&L(e.cm,e.update)}function Mt(e){var t=e.cm,n=t.display;e.updatedDisplay&&E(t),e.barMeasure=h(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Qe(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Ve(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ge(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Lt(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&nn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1),e.preparedSelection&&t.display.input.showSelection(e.preparedSelection),e.updatedDisplay&&z(t,e.barMeasure),(e.updatedDisplay||e.startHeight!=t.doc.height)&&y(t,e.barMeasure),e.selectionChanged&&je(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),e.focus&&e.focus==$i()&&Y(e.cm)}function Tt(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&T(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null==e.scrollTop||n.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(r.scrollTop=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,e.scrollTop)),n.scrollbars.setScrollTop(r.scrollTop),n.scroller.scrollTop=r.scrollTop),null==e.scrollLeft||n.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(r.scrollLeft=Math.max(0,Math.min(n.scroller.scrollWidth-Ge(t),e.scrollLeft)),n.scrollbars.setScrollLeft(r.scrollLeft),n.scroller.scrollLeft=r.scrollLeft,_(t)),e.scrollToPos){var i=On(t,ve(r,e.scrollToPos.from),ve(r,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&En(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||La(o[l],"hide");if(a)for(var l=0;l<a.length;++l)a[l].lines.length&&La(a[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&La(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function At(e,t){if(e.curOp)return t();xt(e);try{return t()}finally{kt(e)}}function zt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);xt(e);try{return t.apply(e,arguments)}finally{kt(e)}}}function Et(e){return function(){if(this.curOp)return e.apply(this,arguments);xt(this);try{return e.apply(this,arguments)}finally{kt(this)}}}function Ot(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);xt(t);try{return e.apply(this,arguments)}finally{kt(t)}}}function qt(e,t,n){this.line=t,this.rest=vr(t),this.size=this.rest?Jr(zi(this.rest))-n+1:1,this.node=this.text=null,this.hidden=xr(e,t)}function Nt(e,t,n){for(var r,i=[],o=t;n>o;o=r){var a=new qt(e.doc,Xr(e.doc,o),o);r=o+a.size,i.push(a)}return i}function It(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Oo&&yr(e.doc,t)<i.viewTo&&Dt(e);else if(n<=i.viewFrom)Oo&&br(e.doc,n+r)>i.viewFrom?Dt(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Dt(e);else if(t<=i.viewFrom){var o=Rt(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Dt(e)}else if(n>=i.viewTo){var o=Rt(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):Dt(e)}else{var a=Rt(e,t,t,-1),l=Rt(e,n,n+r,1);a&&l?(i.view=i.view.slice(0,a.index).concat(Nt(e,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Dt(e)}var s=i.externalMeasured;s&&(n<s.lineN?s.lineN+=r:t<s.lineN+s.size&&(i.externalMeasured=null))}function Pt(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[jt(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==Ei(a,n)&&a.push(n)}}}function Dt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function jt(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,0>t)return r}function Rt(e,t,n,r){var i,o=jt(e,t),a=e.display.view;if(!Oo||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var l=0,s=e.display.viewFrom;o>l;l++)s+=a[l].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;yr(e.doc,n)!=n;){if(o==(0>r?0:a.length-1))return null;n+=r*a[o-(0>r?1:0)].size,o+=r}return{index:o,lineN:n}}function Wt(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Nt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Nt(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(jt(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Nt(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,jt(e,n)))),r.viewTo=n}function Ft(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function Ht(e){function t(){i.activeTouch&&(o=setTimeout(function(){i.activeTouch=null},1e3),a=i.activeTouch,a.end=+new Date)}function n(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function r(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}var i=e.display;Sa(i.scroller,"mousedown",zt(e,Gt)),mo&&11>go?Sa(i.scroller,"dblclick",zt(e,function(t){if(!wi(e,t)){var n=Vt(e,t);if(n&&!Qt(e,t)&&!Ut(e.display,t)){ka(t);var r=e.findWordAt(n);ke(e.doc,r.anchor,r.head)}}})):Sa(i.scroller,"dblclick",function(t){wi(e,t)||ka(t)}),zo||Sa(i.scroller,"contextmenu",function(t){vn(e,t)});var o,a={end:0};Sa(i.scroller,"touchstart",function(e){if(!n(e)){clearTimeout(o);var t=+new Date;i.activeTouch={start:t,moved:!1,prev:t-a.end<=300?a:null},1==e.touches.length&&(i.activeTouch.left=e.touches[0].pageX,i.activeTouch.top=e.touches[0].pageY)}}),Sa(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Sa(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!Ut(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||r(o,o.prev)?new pe(l,l):!o.prev.prev||r(o,o.prev.prev)?e.findWordAt(l):new pe(qo(l.line,0),ve(e.doc,qo(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),ka(n)}t()}),Sa(i.scroller,"touchcancel",t),Sa(i.scroller,"scroll",function(){i.scroller.clientHeight&&(tn(e,i.scroller.scrollTop),nn(e,i.scroller.scrollLeft,!0),La(e,"scroll",e))}),Sa(i.scroller,"mousewheel",function(t){rn(e,t)}),Sa(i.scroller,"DOMMouseScroll",function(t){rn(e,t)}),Sa(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={simple:function(t){wi(e,t)||Ca(t)},start:function(t){en(e,t)},drop:zt(e,Jt)};var l=i.input.getField();Sa(l,"keyup",function(t){dn.call(e,t)}),Sa(l,"keydown",zt(e,un)),Sa(l,"keypress",zt(e,pn)),Sa(l,"focus",Pi(mn,e)),Sa(l,"blur",Pi(gn,e))}function $t(t,n,r){var i=r&&r!=e.Init;if(!n!=!i){var o=t.display.dragFunctions,a=n?Sa:Ma;a(t.display.scroller,"dragstart",o.start),a(t.display.scroller,"dragenter",o.simple),a(t.display.scroller,"dragover",o.simple),a(t.display.scroller,"drop",o.drop)}}function Bt(e){var t=e.display;(t.lastWrapHeight!=t.wrapper.clientHeight||t.lastWrapWidth!=t.wrapper.clientWidth)&&(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Ut(e,t){for(var n=bi(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Vt(e,t,n,r){var i=e.display;if(!n&&"true"==bi(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,c=gt(e,o,a);if(r&&1==c.xRel&&(s=Xr(e.doc,c.line).text).length==c.ch){var u=Na(s,s.length,e.options.tabSize)-s.length;c=qo(c.line,Math.max(0,Math.round((o-Ue(e.display).left)/bt(e.display))-u))}return c}function Gt(e){var t=this,n=t.display;if(!(n.activeTouch&&n.input.supportsTouch()||wi(t,e))){if(n.shift=e.shiftKey,Ut(n,e))return void(vo||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!Qt(t,e)){var r=Vt(t,e);switch(window.focus(),xi(e)){case 1:r?Kt(t,e,r):bi(e)==n.scroller&&ka(e);break;case 2:vo&&(t.state.lastMiddleDown=+new Date),r&&ke(t.doc,r),setTimeout(function(){n.input.focus()},20),ka(e);break;case 3:zo?vn(t,e):hn(t)}}}}function Kt(e,t,n){mo?setTimeout(Pi(Y,e),0):e.curOp.focus=$i();var r,i=+new Date;jo&&jo.time>i-400&&0==No(jo.pos,n)?r="triple":Do&&Do.time>i-400&&0==No(Do.pos,n)?(r="double",jo={time:i,pos:n}):(r="single",Do={time:i,pos:n});var o,a=e.doc.sel,l=Mo?t.metaKey:t.ctrlKey;e.options.dragDrop&&Ga&&!Q(e)&&"single"==r&&(o=a.contains(n))>-1&&(No((o=a.ranges[o]).from(),n)<0||n.xRel>0)&&(No(o.to(),n)>0||n.xRel<0)?Xt(e,t,n,l):Zt(e,t,n,r,l)}function Xt(e,t,n,r){var i=e.display,o=+new Date,a=zt(e,function(l){vo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ma(document,"mouseup",a),Ma(i.scroller,"drop",a),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(ka(l),!r&&+new Date-200<o&&ke(e.doc,n),vo||mo&&9==go?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});vo&&(i.scroller.draggable=!0),e.state.draggingText=a,i.scroller.dragDrop&&i.scroller.dragDrop(),Sa(document,"mouseup",a),Sa(i.scroller,"drop",a)}function Zt(e,t,n,r,i){function o(t){if(0!=No(g,t))if(g=t,"rect"==r){for(var i=[],o=e.options.tabSize,a=Na(Xr(c,n.line).text,n.ch,o),l=Na(Xr(c,t.line).text,t.ch,o),s=Math.min(a,l),p=Math.max(a,l),h=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));m>=h;h++){var v=Xr(c,h).text,y=Ti(v,s,o);s==p?i.push(new pe(qo(h,y),qo(h,y))):v.length>y&&i.push(new pe(qo(h,y),qo(h,Ti(v,p,o))))}i.length||i.push(new pe(n,n)),Te(c,he(d.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=u,x=b.anchor,_=t;if("single"!=r){if("double"==r)var k=e.findWordAt(t);else var k=new pe(qo(t.line,0),ve(c,qo(t.line+1,0)));No(k.anchor,x)>0?(_=k.head,x=Z(b.from(),k.anchor)):(_=k.anchor,x=X(b.to(),k.head))}var i=d.ranges.slice(0);i[f]=new pe(ve(c,x),_),Te(c,he(i,f),Oa)}}function a(t){var n=++y,i=Vt(e,t,!0,"rect"==r);if(i)if(0!=No(i,g)){e.curOp.focus=$i(),o(i);var l=x(s,c);(i.line>=l.to||i.line<l.from)&&setTimeout(zt(e,function(){y==n&&a(t)}),150)}else{var u=t.clientY<v.top?-20:t.clientY>v.bottom?20:0;u&&setTimeout(zt(e,function(){y==n&&(s.scroller.scrollTop+=u,a(t))}),50)}}function l(e){y=1/0,ka(e),s.input.focus(),Ma(document,"mousemove",b),Ma(document,"mouseup",_),c.history.lastSelOrigin=null}var s=e.display,c=e.doc;ka(t);var u,f,d=c.sel,p=d.ranges;if(i&&!t.shiftKey?(f=c.sel.contains(n),u=f>-1?p[f]:new pe(n,n)):(u=c.sel.primary(),f=c.sel.primIndex),t.altKey)r="rect",i||(u=new pe(n,n)),n=Vt(e,t,!0,!0),f=-1;else if("double"==r){var h=e.findWordAt(n);u=e.display.shift||c.extend?_e(c,u,h.anchor,h.head):h}else if("triple"==r){var m=new pe(qo(n.line,0),ve(c,qo(n.line+1,0)));u=e.display.shift||c.extend?_e(c,u,m.anchor,m.head):m}else u=_e(c,u,n);i?-1==f?(f=p.length,Te(c,he(p.concat([u]),f),{scroll:!1,origin:"*mouse"})):p.length>1&&p[f].empty()&&"single"==r&&!t.shiftKey?(Te(c,he(p.slice(0,f).concat(p.slice(f+1)),0)),d=c.sel):Ce(c,f,u,Oa):(f=0,Te(c,new de([u],0),Oa),d=c.sel);var g=n,v=s.wrapper.getBoundingClientRect(),y=0,b=zt(e,function(e){xi(e)?a(e):l(e)}),_=zt(e,l);Sa(document,"mousemove",b),Sa(document,"mouseup",_)}function Yt(e,t,n,r,i){try{var o=t.clientX,a=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ka(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(a>s.bottom||!Si(e,n))return yi(t);a-=s.top-l.viewOffset;for(var c=0;c<e.options.gutters.length;++c){var u=l.gutters.childNodes[c];if(u&&u.getBoundingClientRect().right>=o){var f=ei(e.doc,a),d=e.options.gutters[c];return i(e,n,e,f,d,t),yi(t)}}}function Qt(e,t){return Yt(e,t,"gutterClick",!0,_i)}function Jt(e){var t=this;if(!wi(t,e)&&!Ut(t.display,e)){ka(e),mo&&(Ho=+new Date);var n=Vt(t,e,!0),r=e.dataTransfer.files;if(n&&!Q(t))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(e,r){var l=new FileReader;l.onload=zt(t,function(){if(o[r]=l.result,++a==i){n=ve(t.doc,n);var e={from:n,to:n,text:Ka(o.join("\n")),origin:"paste"};Cn(t.doc,e),Le(t.doc,me(n,Ko(e)))}}),l.readAsText(e)},s=0;i>s;++s)l(r[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(Mo?e.altKey:e.ctrlKey))var c=t.listSelections();if(Ae(t.doc,me(n,n)),c)for(var s=0;s<c.length;++s)zn(t.doc,"",c[s].anchor,c[s].head,"drag");t.replaceSelection(o,"around","paste"),t.display.input.focus()}}catch(e){}}}}function en(e,t){if(mo&&(!e.state.draggingText||+new Date-Ho<100))return void Ca(t);if(!wi(e,t)&&!Ut(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.setDragImage&&!_o)){var n=Wi("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",xo&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),xo&&n.parentNode.removeChild(n)}}function tn(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,fo||A(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),fo&&A(e),Re(e,100))}function nn(e,t,n){(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,_(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function rn(e,t){var n=Uo(t),r=n.x,i=n.y,o=e.display,a=o.scroller;if(r&&a.scrollWidth>a.clientWidth||i&&a.scrollHeight>a.clientHeight){if(i&&Mo&&vo)e:for(var l=t.target,s=o.view;l!=a;l=l.parentNode)for(var c=0;c<s.length;c++)if(s[c].node==l){e.display.currentWheelTarget=l;break e}if(r&&!fo&&!xo&&null!=Bo)return i&&tn(e,Math.max(0,Math.min(a.scrollTop+i*Bo,a.scrollHeight-a.clientHeight))),nn(e,Math.max(0,Math.min(a.scrollLeft+r*Bo,a.scrollWidth-a.clientWidth))),ka(t),void(o.wheelStartX=null);if(i&&null!=Bo){var u=i*Bo,f=e.doc.scrollTop,d=f+o.wrapper.clientHeight;0>u?f=Math.max(0,f+u-50):d=Math.min(e.doc.height,d+u+50),A(e,{top:f,bottom:d})}20>$o&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(Bo=(Bo*$o+n)/($o+1),++$o)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}function on(e,t,n){if("string"==typeof t&&(t=oa[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{Q(e)&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=za}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function an(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=la(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&la(t,e.options.extraKeys,n,e)||la(t,e.options.keyMap,n,e)}function ln(e,t,n,r){var i=e.state.keySeq;if(i){if(sa(t))return"handled";Vo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=an(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&_i(e,"keyHandled",e,t,n),("handled"==o||"multi"==o)&&(ka(n),je(e)),i&&!o&&/\'$/.test(t)?(ka(n),!0):!!o}function sn(e,t){var n=ca(t,!0);return n?t.shiftKey&&!e.state.keySeq?ln(e,"Shift-"+n,t,function(t){return on(e,t,!0)})||ln(e,n,t,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?on(e,t):void 0}):ln(e,n,t,function(t){return on(e,t)}):!1}function cn(e,t,n){return ln(e,"'"+n+"'",t,function(t){return on(e,t,!0)})}function un(e){var t=this;if(t.curOp.focus=$i(),!wi(t,e)){mo&&11>go&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=sn(t,e);xo&&(Go=r?n:null,!r&&88==n&&!Za&&(Mo?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||fn(t)}}function fn(e){function t(e){18!=e.keyCode&&e.altKey||(Ba(n,"CodeMirror-crosshair"),Ma(document,"keyup",t),Ma(document,"mouseover",t))}var n=e.display.lineDiv;Ua(n,"CodeMirror-crosshair"),Sa(document,"keyup",t),Sa(document,"mouseover",t)}function dn(e){16==e.keyCode&&(this.doc.sel.shift=!1),wi(this,e)}function pn(e){var t=this;if(!(Ut(t.display,e)||wi(t,e)||e.ctrlKey&&!e.altKey||Mo&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(xo&&n==Go)return Go=null,void ka(e);if(!xo||e.which&&!(e.which<10)||!sn(t,e)){var i=String.fromCharCode(null==r?n:r);cn(t,e,i)||t.display.input.onKeyPress(e)}}}function hn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,gn(e))},100)}function mn(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(La(e,"focus",e),e.state.focused=!0,Ua(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),vo&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),je(e))}function gn(e){e.state.delayingBlurEvent||(e.state.focused&&(La(e,"blur",e),e.state.focused=!1,Ba(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function vn(e,t){Ut(e.display,t)||yn(e,t)||e.display.input.onContextMenu(t)}function yn(e,t){return Si(e,"gutterContextMenu")?Yt(e,t,"gutterContextMenu",!1,La):!1}function bn(e,t){if(No(e,t.from)<0)return e;if(No(e,t.to)<=0)return Ko(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Ko(t).ch-t.to.ch),qo(n,r)}function xn(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new pe(bn(i.anchor,t),bn(i.head,t)))}return he(n,e.sel.primIndex)}function _n(e,t,n){return e.line==t.line?qo(n.line,e.ch-t.ch+n.ch):qo(n.line+(e.line-t.line),e.ch)}function kn(e,t,n){for(var r=[],i=qo(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=_n(l.from,i,o),c=_n(Ko(l),i,o);if(i=l.to,o=c,"around"==n){var u=e.sel.ranges[a],f=No(u.head,u.anchor)<0;r[a]=new pe(f?c:s,f?s:c)}else r[a]=new pe(s,s)}return new de(r,e.sel.primIndex)}function wn(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return n&&(r.update=function(t,n,r,i){t&&(this.from=ve(e,t)),n&&(this.to=ve(e,n)),r&&(this.text=r),void 0!==i&&(this.origin=i)}),La(e,"beforeChange",e,r),e.cm&&La(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Cn(e,t,n){if(e.cm){if(!e.cm.curOp)return zt(e.cm,Cn)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(Si(e,"beforeChange")||e.cm&&Si(e.cm,"beforeChange"))||(t=wn(e,t,!0))){var r=Eo&&!n&&ar(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Sn(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else Sn(e,t)}}function Sn(e,t){if(1!=t.text.length||""!=t.text[0]||0!=No(t.from,t.to)){var n=xn(e,t);li(e,t,n,e.cm?e.cm.curOp.id:0/0),Tn(e,t,n,rr(e,t));var r=[];Gr(e,function(e,n){n||-1!=Ei(r,e.history)||(vi(e.history,t),r.push(e.history)),Tn(e,t,null,rr(e,t))})}}function Mn(e,t,n){if(!e.cm||!e.cm.state.suppressEdits){for(var r,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s<a.length&&(r=a[s],n?!r.ranges||r.equals(e.sel):r.ranges);s++);if(s!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;r=a.pop(),r.ranges;){if(ui(r,l),n&&!r.equals(e.sel))return void Te(e,r,{clearRedo:!1});o=r}var c=[];ui(o,l),l.push({changes:c,generation:i.generation}),i.generation=r.generation||++i.maxGeneration;for(var u=Si(e,"beforeChange")||e.cm&&Si(e.cm,"beforeChange"),s=r.changes.length-1;s>=0;--s){var f=r.changes[s];if(f.origin=t,u&&!wn(e,f,!1))return void(a.length=0);c.push(ii(e,f));var d=s?xn(e,f):zi(a);Tn(e,f,d,or(e,f)),!s&&e.cm&&e.cm.scrollIntoView({from:f.from,to:Ko(f)});var p=[];Gr(e,function(e,t){t||-1!=Ei(p,e.history)||(vi(e.history,f),p.push(e.history)),Tn(e,f,null,or(e,f))})}}}}function Ln(e,t){if(0!=t&&(e.first+=t,e.sel=new de(Oi(e.sel.ranges,function(e){return new pe(qo(e.anchor.line+t,e.anchor.ch),qo(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){It(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Pt(e.cm,r,"gutter")}}function Tn(e,t,n,r){if(e.cm&&!e.cm.curOp)return zt(e.cm,Tn)(e,t,n,r);if(t.to.line<e.first)return void Ln(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Ln(e,i),t={from:qo(e.first,0),to:qo(t.to.line+i,t.to.ch),text:[zi(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:qo(o,Xr(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Zr(e,t.from,t.to),n||(n=xn(e,t)),e.cm?An(e.cm,t,r):Br(e,t,r),Ae(e,n,Ea)}}function An(e,t,n){var r=e.doc,i=e.display,a=t.from,l=t.to,s=!1,c=a.line;e.options.lineWrapping||(c=Jr(gr(Xr(r,a.line))),r.iter(c,l.line+1,function(e){return e==i.maxLine?(s=!0,!0):void 0})),r.sel.contains(t.from,t.to)>-1&&Ci(e),Br(r,t,n,o(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=f(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,a.line),Re(e,400);var u=t.text.length-(l.line-a.line)-1;t.full?It(e):a.line!=l.line||1!=t.text.length||$r(e.doc,t)?It(e,a.line,l.line+1,u):Pt(e,a.line,"text");var d=Si(e,"changes"),p=Si(e,"change");if(p||d){var h={from:a,to:l,text:t.text,removed:t.removed,origin:t.origin};p&&_i(e,"change",e,h),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function zn(e,t,n,r,i){if(r||(r=n),No(r,n)<0){var o=r;r=n,n=o}"string"==typeof t&&(t=Ka(t)),Cn(e,{from:n,to:r,text:t,origin:i})}function En(e,t){if(!wi(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!wo){var o=Wi("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-$e(e.display))+"px; height: "+(t.bottom-t.top+Ve(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function On(e,t,n,r){null==r&&(r=0);for(var i=0;5>i;i++){var o=!1,a=pt(e,t),l=n&&n!=t?pt(e,n):a,s=Nn(e,Math.min(a.left,l.left),Math.min(a.top,l.top)-r,Math.max(a.left,l.left),Math.max(a.bottom,l.bottom)+r),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=s.scrollTop&&(tn(e,s.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(o=!0)),null!=s.scrollLeft&&(nn(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(o=!0)),!o)break}return a}function qn(e,t,n,r,i){var o=Nn(e,t,n,r,i);null!=o.scrollTop&&tn(e,o.scrollTop),null!=o.scrollLeft&&nn(e,o.scrollLeft)}function Nn(e,t,n,r,i){var o=e.display,a=yt(e.display);0>n&&(n=0);var l=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,s=Ke(e),c={};i-n>s&&(i=n+s);var u=e.doc.height+Be(o),f=a>n,d=i>u-a;if(l>n)c.scrollTop=f?0:n;else if(i>l+s){var p=Math.min(n,(d?u:i)-s);p!=l&&(c.scrollTop=p)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=Ge(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=r-t>m;return g&&(r=t+m),10>t?c.scrollLeft=0:h>t?c.scrollLeft=Math.max(0,t-(g?0:10)):r>m+h-3&&(c.scrollLeft=r+(g?0:10)-m),c}function In(e,t,n){(null!=t||null!=n)&&Dn(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Pn(e){Dn(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?qo(t.line,t.ch-1):t,r=qo(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function Dn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=ht(e,t.from),r=ht(e,t.to),i=Nn(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function jn(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=He(e,t):n="prev");var a=e.options.tabSize,l=Xr(o,t),s=Na(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&(c=o.mode.indent(i,l.text.slice(u.length),l.text),c==za||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?Na(Xr(o,t-1).text,null,a):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var f="",d=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)d+=a,f+=" ";if(c>d&&(f+=Ai(c-d)),f!=u)return zn(o,f,qo(t,0),qo(t,u.length),"+input"),l.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var h=o.sel.ranges[p];if(h.head.line==t&&h.head.ch<u.length){var d=qo(t,u.length);Ce(o,p,new pe(d,d));break}}}function Rn(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Xr(e,ge(e,t)):i=Jr(t),null==i?null:(r(o,i)&&e.cm&&Pt(e.cm,i,n),o)}function Wn(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&No(o.from,zi(r).to)<=0;){var a=r.pop();if(No(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}At(e,function(){for(var t=r.length-1;t>=0;t--)zn(e.doc,"",r[t].from,r[t].to,"+delete");Pn(e)})}function Fn(e,t,n,r,i){function o(){var t=l+n;return t<e.first||t>=e.first+e.size?f=!1:(l=t,u=Xr(e,t))}function a(e){var t=(i?co:uo)(u,s,n,!0);if(null==t){if(e||!o())return f=!1;s=i?(0>n?no:to)(u):0>n?u.text.length:0}else s=t;return!0}var l=t.line,s=t.ch,c=n,u=Xr(e,l),f=!0;
+var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?jo(t.line,t.ch-1):t,r=jo(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function Wn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=mt(e,t.from),r=mt(e,t.to),i=Dn(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Fn(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=$e(e,t):n="prev");var a=e.options.tabSize,l=Qr(o,t),s=Wa(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&(c=o.mode.indent(i,l.text.slice(u.length),l.text),c==Ia||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?Wa(Qr(o,t-1).text,null,a):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var d="",f=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)f+=a,d+=" ";if(c>f&&(d+=Oi(c-f)),d!=u)return qn(o,d,jo(t,0),jo(t,u.length),"+input"),l.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var h=o.sel.ranges[p];if(h.head.line==t&&h.head.ch<u.length){var f=jo(t,u.length);we(o,p,new fe(f,f));break}}}function Hn(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Qr(e,me(e,t)):i=ni(t),null==i?null:(r(o,i)&&e.cm&&Dt(e.cm,i,n),o)}function $n(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&Ro(o.from,qi(r).to)<=0;){var a=r.pop();if(Ro(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}zt(e,function(){for(var t=r.length-1;t>=0;t--)qn(e.doc,"",r[t].from,r[t].to,"+delete");Rn(e)})}function Bn(e,t,n,r,i){function o(){var t=l+n;return t<e.first||t>=e.first+e.size?!1:(l=t,u=Qr(e,t))}function a(e){var t=(i?po:ho)(u,s,n,!0);if(null==t){if(e||!o())return!1;s=i?(0>n?oo:io)(u):0>n?u.text.length:0}else s=t;return!0}var l=t.line,s=t.ch,c=n,u=Qr(e,l);if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var d=null,f="group"==r,p=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(0>n)||a(!h);h=!1){var m=u.text.charAt(s)||"\n",g=Wi(m,p)?"w":f&&"\n"==m?"n":!f||/\s/.test(m)?null:"p";if(!f||h||g||(g="s"),d&&d!=g){0>n&&(n=1,a());break}if(g&&(d=g),n>0&&!a(!h))break}var v=qe(e,jo(l,s),t,c,!0);return Ro(t,v)||(v.hitSide=!0),v}function Un(e,t,n,r){var i,o=e.doc,a=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+n*(l-(0>n?1.5:.5)*bt(e.display))}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var s=vt(e,a,i);if(!s.outside)break;if(0>n?0>=i:i>=o.height){s.hitSide=!0;break}i+=5*n}return s}function Vn(t,n,r,i){e.defaults[t]=n,r&&(ta[t]=i?function(e,t,n){n!=na&&r(e,t,n)}:r)}function Gn(e){for(var t,n,r,i,o=e.split(/-(?!$)/),e=o[o.length-1],a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{if(!/^s(hift)$/i.test(l))throw new Error("Unrecognized modifier name: "+l);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Kn(e){return"string"==typeof e?da[e]:e}function Zn(e,t,n,r,i){if(r&&r.shared)return Xn(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Et(e.cm,Zn)(e,t,n,r,i);var o=new va(e,i),a=Ro(t,n);if(r&&ji(r,o,!1),a>0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=$i("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(yr(e,t.line,t,n,o)||t.line!=n.line&&yr(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Do=!0}o.addToHistory&&ui(e,{from:t,to:n,origin:"markText"},e.sel,0/0);var l,s=t.line,c=e.cm;if(e.iter(s,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&br(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&ti(e,0),rr(e,new er(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s}),o.collapsed&&e.iter(t.line,n.line+1,function(t){wr(e,t)&&ti(t,0)}),o.clearOnEnter&&za(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Io=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ga,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)It(c,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=n.line;u++)Dt(c,u,"text");o.atomic&&ze(c.doc),Si(c,"markerAdded",c,o)}return o}function Xn(e,t,n,r,i){r=ji(r),r.shared=!1;var o=[Zn(e,t,n,r,i)],a=o[0],l=r.widgetNode;return Xr(e,function(e){l&&(r.widgetNode=l.cloneNode(!0)),o.push(Zn(e,ge(e,t),ge(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=qi(o)}),new ya(o,a)}function Yn(e){return e.findMarks(jo(e.first,0),e.clipPos(jo(e.lastLine())),function(e){return e.parent})}function Qn(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(Ro(o,a)){var l=Zn(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function Jn(e){for(var t=0;t<e.length;t++){var n=e[t],r=[n.primary.doc];Xr(n.primary.doc,function(e){r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==Ni(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}}}function er(e,t,n){this.marker=e,this.from=t,this.to=n}function tr(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function nr(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function rr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function ir(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new er(a,o.from,s?null:o.to))}}return r}function or(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new er(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}function ar(e,t){if(t.full)return null;var n=ye(e,t.from.line)&&Qr(e,t.from.line).markedSpans,r=ye(e,t.to.line)&&Qr(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==Ro(t.from,t.to),l=ir(n,i,a),s=or(r,o,a),c=1==t.text.length,u=qi(t.text).length+(c?i:0);if(l)for(var d=0;d<l.length;++d){var f=l[d];if(null==f.to){var p=tr(s,f.marker);p?c&&(f.to=null==p.to?null:p.to+u):f.to=i}}if(s)for(var d=0;d<s.length;++d){var f=s[d];if(null!=f.to&&(f.to+=u),null==f.from){var p=tr(l,f.marker);p||(f.from=u,c&&(l||(l=[])).push(f))}else f.from+=u,c&&(l||(l=[])).push(f)}l&&(l=lr(l)),s&&s!=l&&(s=lr(s));var h=[l];if(!c){var m,g=t.text.length-2;if(g>0&&l)for(var d=0;d<l.length;++d)null==l[d].to&&(m||(m=[])).push(new er(l[d].marker,null,null));for(var d=0;g>d;++d)h.push(m);h.push(s)}return h}function lr(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function sr(e,t){var n=gi(e,t),r=ar(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function cr(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=Ni(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(Ro(c.to,l.from)<0||Ro(c.from,l.to)>0)){var u=[s,1],d=Ro(c.from,l.from),f=Ro(c.to,l.to);(0>d||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:l.from}),(f>0||!a.inclusiveRight&&!f)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-1}}return i}function ur(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function dr(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function fr(e){return e.inclusiveLeft?-1:0}function pr(e){return e.inclusiveRight?1:0}function hr(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=Ro(r.from,i.from)||fr(e)-fr(t);if(o)return-o;var a=Ro(r.to,i.to)||pr(e)-pr(t);return a?a:t.id-e.id}function mr(e,t){var n,r=Do&&e.markedSpans;if(r)for(var i,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||hr(n,i.marker)<0)&&(n=i.marker);return n}function gr(e){return mr(e,!0)}function vr(e){return mr(e,!1)}function yr(e,t,n,r,i){var o=Qr(e,t),a=Do&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=Ro(c.from,n)||fr(s.marker)-fr(i),d=Ro(c.to,r)||pr(s.marker)-pr(i);if(!(u>=0&&0>=d||0>=u&&d>=0)&&(0>=u&&(Ro(c.to,n)>0||s.marker.inclusiveRight&&i.inclusiveLeft)||u>=0&&(Ro(c.from,r)<0||s.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function br(e){for(var t;t=gr(e);)e=t.find(-1,!0).line;return e}function xr(e){for(var t,n;t=vr(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function kr(e,t){var n=Qr(e,t),r=br(n);return n==r?t:ni(r)}function _r(e,t){if(t>e.lastLine())return t;var n,r=Qr(e,t);if(!wr(e,r))return t;for(;n=vr(r);)r=n.find(1,!0).line;return ni(r)+1}function wr(e,t){var n=Do&&t.markedSpans;if(n)for(var r,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Cr(e,t,r))return!0}}function Cr(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return Cr(e,r.line,tr(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Cr(e,t,i))return!0}function Sr(e,t,n){ii(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&jn(e,null,n)}function Mr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Ka(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),Ui(t.display.measure,$i("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Lr(e,t,n,r){var i=new ba(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Hn(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!wr(e,t)){var r=ii(t)<e.scrollTop;ti(t,t.height+Mr(i)),r&&jn(o,null,i.height),o.curOp.forceUpdate=!0}return!0}),i}function Tr(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),ur(e),dr(e,n);var i=r?r(e):1;i!=e.height&&ti(e,i)}function Ar(e){e.parent=null,ur(e)}function zr(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Er(t,n){if(t.blankLine)return t.blankLine(n);if(t.innerMode){var r=e.innerMode(t,n);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Or(t,n,r,i){for(var o=0;10>o;o++){i&&(i[0]=e.innerMode(t,r).mode);var a=t.token(n,r);if(n.pos>n.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}function qr(e,t,n,r){function i(e){return{start:d.start,end:d.pos,string:d.current(),type:o||null,state:e?sa(a.mode,u):u}}var o,a=e.doc,l=a.mode;t=ge(a,t);var s,c=Qr(a,t.line),u=$e(e,t.line,n),d=new ma(c.text,e.options.tabSize);for(r&&(s=[]);(r||d.pos<t.ch)&&!d.eol();)d.start=d.pos,o=Or(l,d,u),r&&s.push(i(!0));return r?s:i()}function Nr(e,t,n,r,i,o,a){var l=n.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,d=new ma(t,e.options.tabSize),f=e.options.addModeClass&&[null];for(""==t&&zr(Er(n,r),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,a&&Dr(e,t,r,d.pos),d.pos=t.length,s=null):s=zr(Or(n,d,r,f),o),f){var p=f[0].name;p&&(s="m-"+(s?p+" "+s:p))}if(!l||u!=s){for(;c<d.start;)c=Math.min(d.start,c+5e4),i(c,u);u=s}d.start=d.pos}for(;c<d.pos;){var h=Math.min(d.pos,c+5e4);i(h,u),c=h}}function Pr(e,t,n,r){var i=[e.state.modeGen],o={};Nr(e,t.text,e.doc.mode,n,function(e,t){i.push(e,t)},o,r);for(var a=0;a<e.state.overlays.length;++a){var l=e.state.overlays[a],s=1,c=0;Nr(e,t.text,l.mode,!0,function(e,t){for(var n=s;e>c;){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,c=Math.min(e,r)}if(t)if(l.opaque)i.splice(n,s-n,e,"cm-overlay "+t),s=n+2;else for(;s>n;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Ir(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=$e(e,ni(t)),i=Pr(e,t,t.text.length>e.options.maxHighlightLength?sa(e.doc.mode,r):r);t.stateAfter=r,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Dr(e,t,n,r){var i=e.doc.mode,o=new ma(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&Er(i,n);!o.eol();)Or(i,o,n),o.start=o.pos}function jr(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?_a:ka;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Rr(e,t){var n=$i("span",null,null,_o?"padding-right: .1px":null),r={pre:$i("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,splitSpaces:(xo||_o)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,a=i?t.rest[i-1]:t.line;r.pos=0,r.addToken=Fr,Ji(e.display.measure)&&(o=oi(a))&&(r.addToken=$r(r.addToken,o)),r.map=[];var l=t!=e.display.externalMeasured&&ni(a);Ur(a,r,Ir(e,a,l)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=Ki(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=Ki(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Qi(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return _o&&/\bcm-tab\b/.test(r.content.lastChild.className)&&(r.content.className="cm-tab-wrap-hack"),qa(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Ki(r.pre.className,r.textClass||"")),r}function Wr(e){var t=$i("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Fr(e,t,n,r,i,o,a){if(t){var l=e.splitSpaces?t.replace(/ {3,}/g,Hr):t,s=e.cm.state.specialChars,c=!1;if(s.test(t))for(var u=document.createDocumentFragment(),d=0;;){s.lastIndex=d;var f=s.exec(t),p=f?f.index-d:t.length-d;if(p){var h=document.createTextNode(l.slice(d,d+p));u.appendChild(xo&&9>ko?$i("span",[h]):h),e.map.push(e.pos,e.pos+p,h),e.col+=p,e.pos+=p}if(!f)break;if(d+=p+1," "==f[0]){var m=e.cm.options.tabSize,g=m-e.col%m,h=u.appendChild($i("span",Oi(g),"cm-tab"));h.setAttribute("role","presentation"),h.setAttribute("cm-text"," "),e.col+=g}else if("\r"==f[0]||"\n"==f[0]){var h=u.appendChild($i("span","\r"==f[0]?"␍":"␤","cm-invalidchar"));h.setAttribute("cm-text",f[0]),e.col+=1}else{var h=e.cm.options.specialCharPlaceholder(f[0]);h.setAttribute("cm-text",f[0]),u.appendChild(xo&&9>ko?$i("span",[h]):h),e.col+=1}e.map.push(e.pos,e.pos+1,h),e.pos++}else{e.col+=t.length;var u=document.createTextNode(l);e.map.push(e.pos,e.pos+t.length,u),xo&&9>ko&&(c=!0),e.pos+=t.length}if(n||r||i||c||a){var v=n||"";r&&(v+=r),i&&(v+=i);var y=$i("span",[u],v,a);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(u)}}function Hr(e){for(var t=" ",n=0;n<e.length-2;++n)t+=n%2?" ":" ";return t+=" "}function $r(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var d=0;d<t.length;d++){var f=t[d];if(f.to>c&&f.from<=c)break}if(f.to>=u)return e(n,r,i,o,a,l,s);e(n,r.slice(0,f.to-c),i,o,null,l,s),o=null,r=r.slice(f.to-c),c=f.to}}}function Br(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function Ur(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,l,s,c,u,d,f,p=i.length,h=0,m=1,g="",v=0;;){if(v==h){s=c=u=d=l="",f=null,v=1/0;for(var y,b=[],x=0;x<r.length;++x){var k=r[x],_=k.marker;"bookmark"==_.type&&k.from==h&&_.widgetNode?b.push(_):k.from<=h&&(null==k.to||k.to>h||_.collapsed&&k.to==h&&k.from==h)?(null!=k.to&&k.to!=h&&v>k.to&&(v=k.to,c=""),_.className&&(s+=" "+_.className),_.css&&(l=(l?l+";":"")+_.css),_.startStyle&&k.from==h&&(u+=" "+_.startStyle),_.endStyle&&k.to==v&&(y||(y=[])).push(_.endStyle,k.to),_.title&&!d&&(d=_.title),_.collapsed&&(!f||hr(f.marker,_)<0)&&(f=k)):k.from>h&&v>k.from&&(v=k.from)}if(y)for(var x=0;x<y.length;x+=2)y[x+1]==v&&(c+=" "+y[x]);if(!f||f.from==h)for(var x=0;x<b.length;++x)Br(t,0,b[x]);if(f&&(f.from||0)==h){if(Br(t,(null==f.to?p+1:f.to)-h,f.marker,null==f.from),null==f.to)return;f.to==h&&(f=!1)}}if(h>=p)break;for(var w=Math.min(p,v);;){if(g){var C=h+g.length;if(!f){var S=C>w?g.slice(0,w-h):g;t.addToken(t,S,a?a+s:s,u,h+S.length==v?c:"",d,l)}if(C>=w){g=g.slice(w-h),h=w;break}h=C,u=""}g=i.slice(o,o=n[m++]),a=jr(n[m++],t.cm.options)}}else for(var m=1;m<n.length;m+=2)t.addToken(t,i.slice(o,o=n[m]),jr(n[m+1],t.cm.options))}function Vr(e,t){return 0==t.from.ch&&0==t.to.ch&&""==qi(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Gr(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){Tr(e,n,i,r),Si(e,"change",e,t)}function a(e,t){for(var n=e,o=[];t>n;++n)o.push(new xa(c[n],i(n),r));return o}var l=t.from,s=t.to,c=t.text,u=Qr(e,l.line),d=Qr(e,s.line),f=qi(c),p=i(c.length-1),h=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Vr(e,t)){var m=a(0,c.length-1);o(d,d.text,p),h&&e.remove(l.line,h),m.length&&e.insert(l.line,m)}else if(u==d)if(1==c.length)o(u,u.text.slice(0,l.ch)+f+u.text.slice(s.ch),p);else{var m=a(1,c.length-1);m.push(new xa(f+u.text.slice(s.ch),p,r)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,m)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+d.text.slice(s.ch),i(0)),e.remove(l.line+1,h);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(d,f+d.text.slice(s.ch),p);var m=a(1,c.length-1);h>1&&e.remove(l.line+1,h-1),e.insert(l.line+1,m)}Si(e,"change",e,t)}function Kr(e){this.lines=e,this.parent=null;for(var t=0,n=0;t<e.length;++t)e[t].parent=this,n+=e[t].height;this.height=n}function Zr(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}function Xr(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;(!n||s)&&(t(l.doc,s),r(l.doc,e,s))}}}r(e,null,!0)}function Yr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,a(e),n(e),e.options.lineWrapping||f(e),e.options.mode=t.modeOption,It(e)}function Qr(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(o>t){n=i;break}t-=o}return n.lines[t]}function Jr(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function ei(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function ti(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ni(e){if(null==e.parent)return null;for(var t=e.parent,n=Ni(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function ri(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(o>t){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var r=0;r<e.lines.length;++r){var a=e.lines[r],l=a.height;if(l>t)break;t-=l}return n+r}function ii(e){e=br(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var r=0;r<o.children.length;++r){var a=o.children[r];if(a==n)break;t+=a.height}return t}function oi(e){var t=e.order;return null==t&&(t=e.order=ll(e.text)),t}function ai(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function li(e,t){var n={from:K(t.from),to:Jo(t),text:Jr(e,t.from,t.to)};return hi(e,n,t.from.line,t.to.line+1),Xr(e,function(e){hi(e,n,t.from.line,t.to.line+1)},!0),n}function si(e){for(;e.length;){var t=qi(e);if(!t.ranges)break;e.pop()}}function ci(e,t){return t?(si(e.done),qi(e.done)):e.done.length&&!qi(e.done).ranges?qi(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),qi(e.done)):void 0}function ui(e,t,n,r){if("ignoreHistory"!=t.origin){var i=e.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ci(i,i.lastOp==r))){var l=qi(o.changes);0==Ro(t.from,t.to)&&0==Ro(t.from,l.to)?l.to=Jo(t):o.changes.push(li(e,t))}else{var s=qi(i.done);for(s&&s.ranges||pi(e.sel,i.done),o={changes:[li(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||qa(e,"historyAdded")}}function di(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function fi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||di(e,o,qi(i.done),t))?i.done[i.done.length-1]=t:pi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&si(i.undone)}function pi(e,t){var n=qi(t);n&&n.ranges&&n.equals(e)||t.push(e)}function hi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function mi(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function gi(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=0,i=[];r<t.text.length;++r)i.push(mi(n[r]));return i}function vi(e,t,n){for(var r=0,i=[];r<e.length;++r){var o=e[r];if(o.ranges)i.push(n?de.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];i.push({changes:l});for(var s=0;s<a.length;++s){var c,u=a[s];if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var d in u)(c=d.match(/^spans_(\d+)$/))&&Ni(t,Number(c[1]))>-1&&(qi(l)[d]=u[d],delete u[d])}}}return i}function yi(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function bi(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)yi(o.ranges[l].anchor,t,n,r),yi(o.ranges[l].head,t,n,r)}else{for(var l=0;l<o.changes.length;++l){var s=o.changes[l];if(n<s.from.line)s.from=jo(s.from.line+r,s.from.ch),s.to=jo(s.to.line+r,s.to.ch);else if(t<=s.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function xi(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;bi(e.done,n,r,i),bi(e.undone,n,r,i)}function ki(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function _i(e){return e.target||e.srcElement}function wi(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Eo&&e.ctrlKey&&1==t&&(t=3),t}function Ci(e,t,n){var r=e._handlers&&e._handlers[t];return n?r&&r.length>0?r.slice():Ea:r||Ea}function Si(e,t){function n(e){return function(){e.apply(null,o)}}var r=Ci(e,t,!1);if(r.length){var i,o=Array.prototype.slice.call(arguments,2);Uo?i=Uo.delayedCallbacks:Na?i=Na:(i=Na=[],setTimeout(Mi,0));for(var a=0;a<r.length;++a)i.push(n(r[a]))}}function Mi(){var e=Na;Na=null;for(var t=0;t<e.length;++t)e[t]()}function Li(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),qa(e,n||t.type,e,t),ki(t)||t.codemirrorIgnore}function Ti(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==Ni(n,t[r])&&n.push(t[r])}function Ai(e,t){return Ci(e,t).length>0}function zi(e){e.prototype.on=function(e,t){za(this,e,t)},e.prototype.off=function(e,t){Oa(this,e,t)}}function Ei(){this.id=null}function Oi(e){for(;Ha.length<=e;)Ha.push(qi(Ha)+" ");return Ha[e]}function qi(e){return e[e.length-1]}function Ni(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function Pi(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Ii(){}function Di(e,t){var n;return Object.create?n=Object.create(e):(Ii.prototype=e,n=new Ii),t&&ji(t,n),n}function ji(e,t,n){t||(t={});for(var r in e)!e.hasOwnProperty(r)||n===!1&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function Ri(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Wi(e,t){return t?t.source.indexOf("\\w")>-1&&Va(e)?!0:t.test(e):Va(e)}function Fi(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Hi(e){return e.charCodeAt(0)>=768&&Ga.test(e)}function $i(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Bi(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Ui(e,t){return Bi(e).appendChild(t)}function Vi(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Gi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Ki(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!Gi(n[r]).test(t)&&(t+=" "+n[r]);return t}function Zi(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}function Xi(){Ja||(Yi(),Ja=!0)}function Yi(){var e;za(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Zi(Ut)},100))}),za(window,"blur",function(){Zi(bn)})}function Qi(e){if(null==Za){var t=$i("span","​");Ui(e,$i("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Za=t.offsetWidth<=1&&t.offsetHeight>2&&!(xo&&8>ko))}var n=Za?$i("span","​"):$i("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ji(e){if(null!=Xa)return Xa;var t=Ui(e,document.createTextNode("AخA")),n=Ba(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=Ba(t,1,2).getBoundingClientRect();return Xa=r.right-n.right<3}function eo(e){if(null!=il)return il;var t=Ui(e,$i("span","x")),n=t.getBoundingClientRect(),r=Ba(t,0,1).getBoundingClientRect();return il=Math.abs(n.left-r.left)>1}function to(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}function no(e){return e.level%2?e.to:e.from}function ro(e){return e.level%2?e.from:e.to}function io(e){var t=oi(e);return t?no(t[0]):0}function oo(e){var t=oi(e);return t?ro(qi(t)):e.text.length}function ao(e,t){var n=Qr(e.doc,t),r=br(n);r!=n&&(t=ni(r));var i=oi(r),o=i?i[0].level%2?oo(r):io(r):0;return jo(t,o)}function lo(e,t){for(var n,r=Qr(e.doc,t);n=vr(r);)r=n.find(1,!0).line,t=null;var i=oi(r),o=i?i[0].level%2?io(r):oo(r):r.text.length;return jo(null==t?ni(r):t,o)}function so(e,t){var n=ao(e,t.line),r=Qr(e.doc,n.line),i=oi(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return jo(n.line,a?0:o)}return n}function co(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:n>t}function uo(e,t){al=null;for(var n,r=0;r<e.length;++r){var i=e[r];if(i.from<t&&i.to>t)return r;if(i.from==t||i.to==t){if(null!=n)return co(e,i.level,e[n].level)?(i.from!=i.to&&(al=n),r):(i.from!=i.to&&(al=r),n);n=r}}return n}function fo(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&Hi(e.text.charAt(t)));return t}function po(e,t,n,r){var i=oi(e);if(!i)return ho(e,t,n,r);for(var o=uo(i,t),a=i[o],l=fo(e,t,a.level%2?-n:n,r);;){if(l>a.from&&l<a.to)return l;if(l==a.from||l==a.to)return uo(i,l)==o?l:(a=i[o+=n],n>0==a.level%2?a.to:a.from);if(a=i[o+=n],!a)return null;l=n>0==a.level%2?fo(e,a.to,-1,r):fo(e,a.from,1,r)}}function ho(e,t,n,r){var i=t+n;if(r)for(;i>0&&Hi(e.text.charAt(i));)i+=n;return 0>i||i>e.text.length?null:i}var mo=navigator.userAgent,go=navigator.platform,vo=/gecko\/\d/i.test(mo),yo=/MSIE \d/.test(mo),bo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(mo),xo=yo||bo,ko=xo&&(yo?document.documentMode||6:bo[1]),_o=/WebKit\//.test(mo),wo=_o&&/Qt\/\d+\.\d+/.test(mo),Co=/Chrome\//.test(mo),So=/Opera\//.test(mo),Mo=/Apple Computer/.test(navigator.vendor),Lo=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(mo),To=/PhantomJS/.test(mo),Ao=/AppleWebKit/.test(mo)&&/Mobile\/\w+/.test(mo),zo=Ao||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(mo),Eo=Ao||/Mac/.test(go),Oo=/win/i.test(go),qo=So&&mo.match(/Version\/(\d*\.\d*)/);qo&&(qo=Number(qo[1])),qo&&qo>=15&&(So=!1,_o=!0);var No=Eo&&(wo||So&&(null==qo||12.11>qo)),Po=vo||xo&&ko>=9,Io=!1,Do=!1;m.prototype=ji({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Eo&&!Lo?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ei,this.disableVert=new Ei},enableZeroWidthBar:function(e,t){function n(){var r=e.getBoundingClientRect(),i=document.elementFromPoint(r.left+1,r.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),g.prototype=ji({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},g.prototype),e.scrollbarModel={
+"native":m,"null":g},S.prototype.signal=function(e,t){Ai(e,t)&&this.events.push(arguments)},S.prototype.finish=function(){for(var e=0;e<this.events.length;e++)qa.apply(null,this.events[e])};var jo=e.Pos=function(e,t){return this instanceof jo?(this.line=e,void(this.ch=t)):new jo(e,t)},Ro=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},Wo=null;re.prototype=ji({init:function(e){function t(e){if(!Li(r,e)){if(r.somethingSelected())Wo=r.getSelections(),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,o.value=Wo.join("\n"),$a(o));else{if(!r.options.lineWiseCopyCut)return;var t=te(r);Wo=t.text,"cut"==e.type?r.setSelections(t.ranges,null,Da):(n.prevInput="",o.value=t.text.join("\n"),$a(o))}"cut"==e.type&&(r.state.cutIncoming=!0)}}var n=this,r=this.cm,i=this.wrapper=ie(),o=this.textarea=i.firstChild;e.wrapper.insertBefore(i,e.wrapper.firstChild),Ao&&(o.style.width="0px"),za(o,"input",function(){xo&&ko>=9&&n.hasSelection&&(n.hasSelection=null),n.poll()}),za(o,"paste",function(e){Li(r,e)||J(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),za(o,"cut",t),za(o,"copy",t),za(e.scroller,"paste",function(t){Vt(e,t)||Li(r,t)||(r.state.pasteIncoming=!0,n.focus())}),za(e.lineSpace,"selectstart",function(t){Vt(e,t)||La(t)}),za(o,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),za(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=Ie(e);if(e.options.moveInputWithCursor){var i=ht(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},showSelection:function(e){var t=this.cm,n=t.display;Ui(n.cursorDiv,e.cursors),Ui(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=rl&&(o.to().line-o.from().line>100||(n=r.getSelection()).length>1e3);var a=t?"-":n||r.getSelection();this.composing||(this.textarea.value=a),r.state.focused&&$a(this.textarea),xo&&ko>=9&&(this.hasSelection=a)}else e||(this.composing||(this.prevInput=this.textarea.value=""),xo&&ko>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!zo||Vi()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||nl(t)&&!n&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(xo&&ko>=9&&this.hasSelection===r||Eo&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||n||(n="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,a=Math.min(n.length,r.length);a>o&&n.charCodeAt(o)==r.charCodeAt(o);)++o;var l=this;return zt(e,function(){Q(e,r.slice(o),n.length-o,null,l.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?t.value=l.prevInput="":l.prevInput=r,l.composing&&(l.composing.range.clear(),l.composing.range=e.markText(l.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){xo&&ko>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,r.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.position="relative",a.style.cssText=u,xo&&9>ko&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!xo||xo&&9>ko)&&t();var e=0,n=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==r.prevInput?Et(i,ua.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(n,500):o.input.reset()};o.detectingSelectAll=setTimeout(n,200)}}var r=this,i=r.cm,o=i.display,a=r.textarea,l=Gt(i,e),s=o.scroller.scrollTop;if(l&&!So){var c=i.options.resetSelectionOnContextMenu;c&&-1==i.doc.sel.contains(l)&&Et(i,Le)(i.doc,he(l),Da);var u=a.style.cssText;if(r.wrapper.style.position="absolute",a.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(xo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",_o)var d=window.scrollY;if(o.input.focus(),_o&&window.scrollTo(null,d),o.input.reset(),i.somethingSelected()||(a.value=r.prevInput=" "),r.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),xo&&ko>=9&&t(),Po){Aa(e);var f=function(){Oa(window,"mouseup",f),setTimeout(n,20)};za(window,"mouseup",f)}else setTimeout(n,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Ii,needsContentAttribute:!1},re.prototype),oe.prototype=ji({init:function(e){function t(e){if(!Li(r,e)){if(r.somethingSelected())Wo=r.getSelections(),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=te(r);Wo=t.text,"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,Da),r.replaceSelection("",null,"cut")})}if(e.clipboardData&&!Ao)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Wo.join("\n"));else{var n=ie(),i=n.firstChild;r.display.lineSpace.insertBefore(n,r.display.lineSpace.firstChild),i.value=Wo.join("\n");var o=document.activeElement;$a(i),setTimeout(function(){r.display.lineSpace.removeChild(n),o.focus()},50)}}}var n=this,r=n.cm,i=n.div=e.lineDiv;ne(i),za(i,"paste",function(e){Li(r,e)||J(e,r)}),za(i,"compositionstart",function(e){var t=e.data;if(n.composing={sel:r.doc.sel,data:t,startData:t},t){var i=r.doc.sel.primary(),o=r.getLine(i.head.line),a=o.indexOf(t,Math.max(0,i.head.ch-t.length));a>-1&&a<=i.head.ch&&(n.composing.sel=he(jo(i.head.line,a),jo(i.head.line,a+t.length)))}}),za(i,"compositionupdate",function(e){n.composing.data=e.data}),za(i,"compositionend",function(e){var t=n.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||n.applyComposition(t),n.composing==t&&(n.composing=null)},50))}),za(i,"touchstart",function(){n.forceCompositionEnd()}),za(i,"input",function(){n.composing||(r.isReadOnly()||!n.pollContent())&&zt(n.cm,function(){It(r)})}),za(i,"copy",t),za(i,"cut",t)},prepareSelection:function(){var e=Ie(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=se(this.cm,e.anchorNode,e.anchorOffset),r=se(this.cm,e.focusNode,e.focusOffset);if(!n||n.bad||!r||r.bad||0!=Ro(X(n,r),t.from())||0!=Ro(Z(n,r),t.to())){var i=ae(this.cm,t.from()),o=ae(this.cm,t.to());if(i||o){var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var s=a[a.length-1].measure,c=s.maps?s.maps[s.maps.length-1]:s.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};try{var u=Ba(i.node,i.offset,o.offset,o.node)}catch(d){}u&&(!vo&&this.cm.state.focused?(e.collapse(i.node,i.offset),u.collapsed||e.addRange(u)):(e.removeAllRanges(),e.addRange(u)),l&&null==e.anchorNode?e.addRange(l):vo&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Ui(this.cm.display.cursorDiv,e.cursors),Ui(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Ka(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():zt(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=se(t,e.anchorNode,e.anchorOffset),r=se(t,e.focusNode,e.focusOffset);n&&r&&zt(t,function(){Le(t.doc,he(n,r),Da),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o;if(r.line==t.viewFrom||0==(o=Rt(e,r.line)))var a=ni(t.view[0].line),l=t.view[0].node;else var a=ni(t.view[o].line),l=t.view[o-1].node.nextSibling;var s=Rt(e,i.line);if(s==t.view.length-1)var c=t.viewTo-1,u=t.lineDiv.lastChild;else var c=ni(t.view[s+1].line)-1,u=t.view[s+1].node.previousSibling;for(var d=e.doc.splitLines(ue(e,l,u,a,c)),f=Jr(e.doc,jo(a,0),jo(c,Qr(e.doc,c).text.length));d.length>1&&f.length>1;)if(qi(d)==qi(f))d.pop(),f.pop(),c--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),a++}for(var p=0,h=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);v>p&&m.charCodeAt(p)==g.charCodeAt(p);)++p;for(var y=qi(d),b=qi(f),x=Math.min(y.length-(1==d.length?p:0),b.length-(1==f.length?p:0));x>h&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)++h;d[d.length-1]=y.slice(0,y.length-h),d[0]=d[0].slice(p);var k=jo(a,p),_=jo(c,f.length?qi(f).length-h:0);return d.length>1||d[0]||Ro(k,_)?(qn(e.doc,d,k,_,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?Et(this.cm,It)(this.cm):e.data&&e.data!=e.startData&&Et(this.cm,Q)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||Et(this.cm,Q)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Ii,resetPosition:Ii,needsContentAttribute:!0},oe.prototype),e.inputStyles={textarea:re,contenteditable:oe},de.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(0!=Ro(n.anchor,r.anchor)||0!=Ro(n.head,r.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new fe(K(this.ranges[t].anchor),K(this.ranges[t].head));return new de(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(Ro(t,r.from())>=0&&Ro(e,r.to())<=0)return n}return-1}},fe.prototype={from:function(){return X(this.anchor,this.head)},to:function(){return Z(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Fo,Ho,$o,Bo={left:0,right:0,top:0,bottom:0},Uo=null,Vo=0,Go=0,Ko=0,Zo=null;xo?Zo=-.53:vo?Zo=15:Co?Zo=-.7:Mo&&(Zo=-1/3);var Xo=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}};e.wheelEventPixels=function(e){var t=Xo(e);return t.x*=Zo,t.y*=Zo,t};var Yo=new Ei,Qo=null,Jo=e.changeEnd=function(e){return e.text?jo(e.from.line+e.text.length-1,qi(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];(n[e]!=t||"mode"==e)&&(n[e]=t,ta.hasOwnProperty(e)&&Et(this,ta[e])(this,t,r))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Kn(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Ot(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:t,opaque:n&&n.opaque}),this.state.modeGen++,It(this)}),removeOverlay:Ot(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void It(this)}}),indentLine:Ot(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),ye(this.doc,e)&&Fn(this,e,t,n)}),indentSelection:Ot(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Fn(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Rn(this));else{var o=i.from(),a=i.to(),l=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;n>s;++s)Fn(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&we(this.doc,r,new fe(o,c[r].to()),Da)}}}),getTokenAt:function(e,t){return qr(this,e,t)},getLineTokens:function(e,t){return qr(this,jo(e),t,!0)},getTokenTypeAt:function(e){e=ge(this.doc,e);var t,n=Ir(this,Qr(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var l=t?t.indexOf("cm-overlay "):-1;return 0>l?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!la.hasOwnProperty(t))return n;var r=la[t],i=this.getModeAt(e);if("string"==typeof i[t])r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=r[i[t][o]];a&&n.push(a)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(var o=0;o<r._global.length;o++){var l=r._global[o];l.pred(i,this)&&-1==Ni(n,l.val)&&n.push(l.val)}return n},getStateAfter:function(e,t){var n=this.doc;return e=me(n,null==e?n.first+n.size-1:e),$e(this,e+1,t)},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=null==e?r.head:"object"==typeof e?ge(this.doc,e):e?r.from():r.to(),ht(this,n,t||"page")},charCoords:function(e,t){return pt(this,ge(this.doc,e),t||"page")},coordsChar:function(e,t){return e=ft(this,e,t||"page"),vt(this,e.left,e.top)},lineAtHeight:function(e,t){return e=ft(this,{top:e,left:0},t||"page").top,ri(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var n,r=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,r=!0),n=Qr(this.doc,e)}else n=e;return dt(this,n,{top:0,left:0},t||"page").top+(r?this.doc.height-ii(n):0)},defaultTextHeight:function(){return bt(this.display)},defaultCharWidth:function(){return xt(this.display)},setGutterMarker:Ot(function(e,t,n){return Hn(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&Fi(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Ot(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,Dt(t,r,"gutter"),Fi(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),lineInfo:function(e){if("number"==typeof e){if(!ye(this.doc,e))return null;var t=e;if(e=Qr(this.doc,e),!e)return null}else{var t=ni(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=ht(this,ge(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&In(this,l,a,l+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:Ot(pn),triggerOnKeyPress:Ot(gn),triggerOnKeyUp:mn,execCommand:function(e){return ua.hasOwnProperty(e)?ua[e].call(null,this):void 0},triggerElectric:Ot(function(e){ee(this,e)}),findPosH:function(e,t,n,r){var i=1;0>t&&(i=-1,t=-t);for(var o=0,a=ge(this.doc,e);t>o&&(a=Bn(this.doc,a,i,n,r),!a.hitSide);++o);return a},moveH:Ot(function(e,t){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Bn(n.doc,r.head,e,t,n.options.rtlMoveVisually):0>e?r.from():r.to()},Ra)}),deleteH:Ot(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):$n(this,function(n){var i=Bn(r,n.head,e,t,!1);return 0>e?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,o=r;0>t&&(i=-1,t=-t);for(var a=0,l=ge(this.doc,e);t>a;++a){var s=ht(this,l,"div");if(null==o?o=s.left:s.left=o,l=Un(this,s,i,n),l.hitSide)break}return l},moveV:Ot(function(e,t){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(o)return 0>e?a.from():a.to();var l=ht(n,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=Un(n,l,e,t);return"page"==t&&a==r.sel.primary()&&jn(n,null,pt(n,s,"div").top-l.top),s},Ra),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,n=Qr(t,e.line).text,r=e.ch,i=e.ch;if(n){var o=this.getHelper(e,"wordChars");(e.xRel<0||i==n.length)&&r?--r:++i;for(var a=n.charAt(r),l=Wi(a,o)?function(e){return Wi(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Wi(e)};r>0&&l(n.charAt(r-1));)--r;for(;i<n.length&&l(n.charAt(i));)++i}return new fe(jo(e.line,r),jo(e.line,i))},toggleOverwrite:function(e){(null==e||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?Qa(this.display.cursorDiv,"CodeMirror-overwrite"):Ya(this.display.cursorDiv,"CodeMirror-overwrite"),qa(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Vi()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Ot(function(e,t){(null!=e||null!=t)&&Wn(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Ge(this)-this.display.barHeight,width:e.scrollWidth-Ge(this)-this.display.barWidth,clientHeight:Ze(this),clientWidth:Ke(this)}},scrollIntoView:Ot(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:jo(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)Wn(this),this.curOp.scrollToPos=e;else{var n=Dn(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(n.scrollLeft,n.scrollTop)}}),setSize:Ot(function(e,t){function n(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var r=this;null!=e&&(r.display.wrapper.style.width=n(e)),null!=t&&(r.display.wrapper.style.height=n(t)),r.options.lineWrapping&&lt(this);var i=r.display.viewFrom;r.doc.iter(i,r.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Dt(r,i,"widget");break}++i}),r.curOp.forceUpdate=!0,qa(r,"refresh",this)}),operation:function(e){return zt(this,e)},refresh:Ot(function(){var e=this.display.cachedTextHeight;It(this),this.curOp.forceUpdate=!0,st(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),u(this),(null==e||Math.abs(e-bt(this.display))>.5)&&a(this),qa(this,"refresh",this)}),swapDoc:Ot(function(e){var t=this.doc;return t.cm=null,Yr(this,e),st(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Si(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},zi(e);var ea=e.defaults={},ta=e.optionHandlers={},na=e.Init={toString:function(){return"CodeMirror.Init"}};Vn("value","",function(e,t){e.setValue(t)},!0),Vn("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),Vn("indentUnit",2,n,!0),Vn("indentWithTabs",!1),Vn("smartIndent",!0),Vn("tabSize",4,function(e){r(e),st(e),It(e)},!0),Vn("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(jo(r,o))}r++});for(var i=n.length-1;i>=0;i--)qn(e.doc,t,n[i],jo(n[i].line,n[i].ch+t.length))}}),Vn("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,n,r){t.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),r!=e.Init&&t.refresh()}),Vn("specialCharPlaceholder",Wr,function(e){e.refresh()},!0),Vn("electricChars",!0),Vn("inputStyle",zo?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Vn("rtlMoveVisually",!Oo),Vn("wholeLineUpdateBefore",!0),Vn("theme","default",function(e){l(e),s(e)},!0),Vn("keyMap","default",function(t,n,r){var i=Kn(n),o=r!=e.Init&&Kn(r);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Vn("extraKeys",null),Vn("lineWrapping",!1,i,!0),Vn("gutters",[],function(e){p(e.options),s(e)},!0),Vn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?C(e.display)+"px":"0",e.refresh()},!0),Vn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Vn("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Vn("lineNumbers",!1,function(e){p(e.options),s(e)},!0),Vn("firstLineNumber",1,s,!0),Vn("lineNumberFormatter",function(e){return e},s,!0),Vn("showCursorWhenSelecting",!1,Pe,!0),Vn("resetSelectionOnContextMenu",!0),Vn("lineWiseCopyCut",!0),Vn("readOnly",!1,function(e,t){"nocursor"==t?(bn(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Vn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Vn("dragDrop",!0,Bt),Vn("allowDropFileTypes",null),Vn("cursorBlinkRate",530),Vn("cursorScrollMargin",0),Vn("cursorHeight",1,Pe,!0),Vn("singleCursorHeightPerLine",!0,Pe,!0),Vn("workTime",100),Vn("workDelay",100),Vn("flattenSpans",!0,r,!0),Vn("addModeClass",!1,r,!0),Vn("pollInterval",100),Vn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Vn("historyEventDelay",1250),Vn("viewportMargin",10,function(e){e.refresh()},!0),Vn("maxHighlightLength",1e4,r,!0),Vn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Vn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Vn("autofocus",null);var ra=e.modes={},ia=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),ra[t]=n},e.defineMIME=function(e,t){ia[e]=t},e.resolveMode=function(t){if("string"==typeof t&&ia.hasOwnProperty(t))t=ia[t];else if(t&&"string"==typeof t.name&&ia.hasOwnProperty(t.name)){var n=ia[t.name];"string"==typeof n&&(n={name:n}),t=Di(n,t),t.name=n.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=ra[n.name];if(!r)return e.getMode(t,"text/plain");var i=r(t,n);if(oa.hasOwnProperty(n.name)){var o=oa[n.name];for(var a in o)o.hasOwnProperty(a)&&(i.hasOwnProperty(a)&&(i["_"+a]=i[a]),i[a]=o[a])}if(i.name=n.name,n.helperType&&(i.helperType=n.helperType),n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var oa=e.modeExtensions={};e.extendMode=function(e,t){var n=oa.hasOwnProperty(e)?oa[e]:oa[e]={};ji(t,n)},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){Ca.prototype[e]=t},e.defineOption=Vn;var aa=[];e.defineInitHook=function(e){aa.push(e)};var la=e.helpers={};e.registerHelper=function(t,n,r){la.hasOwnProperty(t)||(la[t]=e[t]={_global:[]}),la[t][n]=r},e.registerGlobalHelper=function(t,n,r,i){e.registerHelper(t,n,i),la[t]._global.push({pred:r,val:i})};var sa=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n},ca=e.startState=function(e,t,n){return e.startState?e.startState(t,n):!0};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var ua=e.commands={selectAll:function(e){e.setSelection(jo(e.firstLine(),0),jo(e.lastLine()),Da)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Da)},killLine:function(e){$n(e,function(t){if(t.empty()){var n=Qr(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:jo(t.head.line+1,0)}:{from:t.head,to:jo(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){$n(e,function(t){return{from:jo(t.from().line,0),to:ge(e.doc,jo(t.to().line+1,0))}})},delLineLeft:function(e){$n(e,function(e){return{from:jo(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){$n(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){$n(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(jo(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(jo(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return ao(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return so(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return lo(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Ra)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Ra)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?so(e,t.head):r},Ra)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=Wa(e.getLine(o.line),o.ch,r);t.push(new Array(r-a%r+1).join(" "))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){zt(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var i=t[r].head,o=Qr(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new jo(i.line,i.ch-1)),i.ch>0)i=new jo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),jo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Qr(e.doc,i.line-1).text;a&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),jo(i.line-1,a.length-1),jo(i.line,1),"+transpose")}n.push(new fe(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){zt(e,function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];e.replaceRange(e.doc.lineSeparator(),r.anchor,r.head,"+input"),e.indentLine(r.from().line+1,null,!0)}Rn(e)})},toggleOverwrite:function(e){e.toggleOverwrite()}},da=e.keyMap={};da.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",
+Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},da.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},da.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},da.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},da["default"]=Eo?da.macDefault:da.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=Pi(n.split(" "),Gn),o=0;o<i.length;o++){var a,l;o==i.length-1?(l=i.join(" "),a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[n]}for(var c in t)e[c]=t[c];return e};var fa=e.lookupKey=function(e,t,n,r){t=Kn(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return fa(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=fa(e,t.fallthrough[o],n,r);if(a)return a}}},pa=e.isModifierKey=function(e){var t="string"==typeof e?e:ol[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},ha=e.keyName=function(e,t){if(So&&34==e.keyCode&&e["char"])return!1;var n=ol[e.keyCode],r=n;return null==r||e.altGraphKey?!1:(e.altKey&&"Alt"!=n&&(r="Alt-"+r),(No?e.metaKey:e.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+r),(No?e.ctrlKey:e.metaKey)&&"Cmd"!=n&&(r="Cmd-"+r),!t&&e.shiftKey&&"Shift"!=n&&(r="Shift-"+r),r)};e.fromTextArea=function(t,n){function r(){t.value=c.getValue()}if(n=n?ji(n):{},n.value=t.value,!n.tabindex&&t.tabIndex&&(n.tabindex=t.tabIndex),!n.placeholder&&t.placeholder&&(n.placeholder=t.placeholder),null==n.autofocus){var i=Vi();n.autofocus=i==t||null!=t.getAttribute("autofocus")&&i==document.body}if(t.form&&(za(t.form,"submit",r),!n.leaveSubmitMethodAlone)){var o=t.form,a=o.submit;try{var l=o.submit=function(){r(),o.submit=a,o.submit(),o.submit=l}}catch(s){}}n.finishInit=function(e){e.save=r,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,r(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(Oa(t.form,"submit",r),"function"==typeof t.form.submit&&(t.form.submit=a))}},t.style.display="none";var c=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return c};var ma=e.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};ma.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var n=t==e;else var n=t&&(e.test?e.test(t):e(t));return n?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Wa(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Wa(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Wa(this.string,null,this.tabSize)-(this.lineStart?Wa(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var ga=0,va=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ga};zi(va),va.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&kt(e),Ai(this,"clear")){var n=this.find();n&&Si(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=tr(a.markedSpans,this);e&&!this.collapsed?Dt(e,ni(a),"text"):e&&(null!=l.to&&(i=ni(a)),null!=l.from&&(r=ni(a))),a.markedSpans=nr(a.markedSpans,l),null==l.from&&this.collapsed&&!wr(this.doc,a)&&e&&ti(a,bt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var s=br(this.lines[o]),c=d(s);c>e.display.maxLineLength&&(e.display.maxLine=s,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&It(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ze(e.doc)),e&&Si(e,"markerCleared",e,this),t&&wt(e),this.parent&&this.parent.clear()}},va.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=tr(o.markedSpans,this);if(null!=a.from&&(n=jo(t?o:ni(o),a.from),-1==e))return n;if(null!=a.to&&(r=jo(t?o:ni(o),a.to),1==e))return r}return n&&{from:n,to:r}},va.prototype.changed=function(){var e=this.find(-1,!0),t=this,n=this.doc.cm;e&&n&&zt(n,function(){var r=e.line,i=ni(e.line),o=et(n,i);if(o&&(at(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!wr(t.doc,r)&&null!=t.height){var a=t.height;t.height=null;var l=Mr(t)-a;l&&ti(r,r.height+l)}})},va.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=Ni(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},va.prototype.detachLine=function(e){if(this.lines.splice(Ni(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var ga=0,ya=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};zi(ya),ya.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Si(this,"clear")}},ya.prototype.find=function(e,t){return this.primary.find(e,t)};var ba=e.LineWidget=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};zi(ba),ba.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=ni(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Mr(this);ti(n,Math.max(0,n.height-o)),e&&zt(e,function(){Sr(e,n,-o),Dt(e,r,"widget")})}},ba.prototype.changed=function(){var e=this.height,t=this.doc.cm,n=this.line;this.height=null;var r=Mr(this)-e;r&&(ti(n,n.height+r),t&&zt(t,function(){t.curOp.forceUpdate=!0,Sr(t,n,r)}))};var xa=e.Line=function(e,t,n){this.text=e,dr(this,t),this.height=n?n(this):1};zi(xa),xa.prototype.lineNo=function(){return ni(this)};var ka={},_a={};Kr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;r>n;++n){var i=this.lines[n];this.height-=i.height,Ar(i),Si(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;r>e;++e)if(n(this.lines[e]))return!0}},Zr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(i>e){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Kr))){var l=[];this.collapse(l),this.children=[new Kr(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>=e){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(;i.lines.length>50;){var a=i.lines.splice(i.lines.length-25,25),l=new Kr(a);i.height-=l.height,this.children.splice(r+1,0,l),l.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Zr(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=Ni(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new Zr(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>e){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var wa=0,Ca=e.Doc=function(e,t,n,r){if(!(this instanceof Ca))return new Ca(e,t,n,r);null==n&&(n=0),Zr.call(this,[new Kr([new xa("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var i=jo(n,0);this.sel=he(i),this.history=new ai(null),this.id=++wa,this.modeOption=t,this.lineSep=r,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Gr(this,{from:i,to:i,text:e}),Le(this,he(i),Da)};Ca.prototype=Di(Zr.prototype,{constructor:Ca,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ei(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:qt(function(e){var t=jo(this.first,0),n=this.first+this.size-1;Ln(this,{from:t,to:jo(n,Qr(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),Le(this,he(t))}),replaceRange:function(e,t,n,r){t=ge(this,t),n=n?ge(this,n):t,qn(this,e,t,n,r)},getRange:function(e,t,n){var r=Jr(this,ge(this,e),ge(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return ye(this,e)?Qr(this,e):void 0},getLineNumber:function(e){return ni(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Qr(this,e)),br(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ge(this,e)},getCursor:function(e){var t,n=this.sel.primary();return t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||"to"==e||e===!1?n.to():n.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:qt(function(e,t,n){Ce(this,ge(this,"number"==typeof e?jo(e,t||0):e),null,n)}),setSelection:qt(function(e,t,n){Ce(this,ge(this,e),ge(this,t||e),n)}),extendSelection:qt(function(e,t,n){ke(this,ge(this,e),t&&ge(this,t),n)}),extendSelections:qt(function(e,t){_e(this,be(this,e),t)}),extendSelectionsBy:qt(function(e,t){var n=Pi(this.sel.ranges,e);_e(this,be(this,n),t)}),setSelections:qt(function(e,t,n){if(e.length){for(var r=0,i=[];r<e.length;r++)i[r]=new fe(ge(this,e[r].anchor),ge(this,e[r].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Le(this,pe(i,t),n)}}),addSelection:qt(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new fe(ge(this,e),ge(this,t||e))),Le(this,pe(r,r.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Jr(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return e===!1?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Jr(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:qt(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var l=t&&"end"!=t&&Sn(this,r,t),o=r.length-1;o>=0;o--)Ln(this,r[o]);l?Me(this,l):this.cm&&Rn(this.cm)}),undo:qt(function(){An(this,"undo")}),redo:qt(function(){An(this,"redo")}),undoSelection:qt(function(){An(this,"undo",!0)}),redoSelection:qt(function(){An(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new ai(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:vi(this.history.done),undone:vi(this.history.undone)}},setHistory:function(e){var t=this.history=new ai(this.history.maxGeneration);t.done=vi(e.done.slice(0),null,!0),t.undone=vi(e.undone.slice(0),null,!0)},addLineClass:qt(function(e,t,n){return Hn(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(Gi(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0})}),removeLineClass:qt(function(e,t,n){return Hn(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(Gi(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),addLineWidget:qt(function(e,t,n){return Lr(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Zn(this,ge(this,e),ge(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ge(this,e),Zn(this,e,e,n,"bookmark")},findMarksAt:function(e){e=ge(this,e);var t=[],n=Qr(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ge(this,e),t=ge(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];i==e.line&&e.ch>s.to||null==s.from&&i!=e.line||i==t.line&&s.from>t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first;return this.iter(function(r){var i=r.text.length+1;return i>e?(t=e,!0):(e-=i,void++n)}),ge(this,jo(n,t))},indexFromPos:function(e){e=ge(this,e);var t=e.ch;return e.line<this.first||e.ch<0?0:(this.iter(this.first,e.line,function(e){t+=e.text.length+1}),t)},copy:function(e){var t=new Ca(ei(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Ca(ei(this,t,n),e.mode||this.modeOption,t,this.lineSep);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Qn(r,Yn(this)),r},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var n=0;n<this.linked.length;++n){var r=this.linked[n];if(r.doc==t){this.linked.splice(n,1),t.unlinkDoc(this),Jn(Yn(this));break}}if(t.history==this.history){var i=[t.id];Xr(t,function(e){i.push(e.id)},!0),t.history=new ai(null),t.history.done=vi(this.history.done,i),t.history.undone=vi(this.history.undone,i)}},iterLinkedDocs:function(e){Xr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):tl(e)},lineSeparator:function(){return this.lineSep||"\n"}}),Ca.prototype.eachLine=Ca.prototype.iter;var Sa="iter insert remove copy getEditor constructor".split(" ");for(var Ma in Ca.prototype)Ca.prototype.hasOwnProperty(Ma)&&Ni(Sa,Ma)<0&&(e.prototype[Ma]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ca.prototype[Ma]));zi(Ca);var La=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},Ta=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},Aa=e.e_stop=function(e){La(e),Ta(e)},za=e.on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={}),i=r[t]||(r[t]=[]);i.push(n)}},Ea=[],Oa=e.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else for(var r=Ci(e,t,!1),i=0;i<r.length;++i)if(r[i]==n){r.splice(i,1);break}},qa=e.signal=function(e,t){var n=Ci(e,t,!0);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)},Na=null,Pa=30,Ia=e.Pass={toString:function(){return"CodeMirror.Pass"}},Da={scroll:!1},ja={origin:"*mouse"},Ra={origin:"+move"};Ei.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Wa=e.countColumn=function(e,t,n,r,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=r||0,a=i||0;;){var l=e.indexOf(" ",o);if(0>l||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}},Fa=e.findColumn=function(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}},Ha=[""],$a=function(e){e.select()};Ao?$a=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:xo&&($a=function(e){try{e.select()}catch(t){}});var Ba,Ua=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Va=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Ua.test(e))},Ga=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Ba=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Ka=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};xo&&11>ko&&(Vi=function(){try{return document.activeElement}catch(e){return document.body}});var Za,Xa,Ya=e.rmClass=function(e,t){var n=e.className,r=Gi(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}},Qa=e.addClass=function(e,t){var n=e.className;Gi(t).test(n)||(e.className+=(n?" ":"")+t)},Ja=!1,el=function(){if(xo&&9>ko)return!1;var e=$i("div");return"draggable"in e||"dragDrop"in e}(),tl=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;r>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},nl=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},rl=function(){var e=$i("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),il=null,ol=e.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var e=0;10>e;e++)ol[e+48]=ol[e+96]=String(e);for(var e=65;90>=e;e++)ol[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)ol[e+111]=ol[e+63235]="F"+e}();var al,ll=function(){function e(e){return 247>=e?n.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?r.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/,c="L";return function(n){if(!i.test(n))return!1;for(var r,u=n.length,d=[],f=0;u>f;++f)d.push(r=e(n.charCodeAt(f)));for(var f=0,p=c;u>f;++f){var r=d[f];"m"==r?d[f]=p:p=r}for(var f=0,h=c;u>f;++f){var r=d[f];"1"==r&&"r"==h?d[f]="n":a.test(r)&&(h=r,"r"==r&&(d[f]="R"))}for(var f=1,p=d[0];u-1>f;++f){var r=d[f];"+"==r&&"1"==p&&"1"==d[f+1]?d[f]="1":","!=r||p!=d[f+1]||"1"!=p&&"n"!=p||(d[f]=p),p=r}for(var f=0;u>f;++f){var r=d[f];if(","==r)d[f]="N";else if("%"==r){for(var m=f+1;u>m&&"%"==d[m];++m);for(var g=f&&"!"==d[f-1]||u>m&&"1"==d[m]?"1":"N",v=f;m>v;++v)d[v]=g;f=m-1}}for(var f=0,h=c;u>f;++f){var r=d[f];"L"==h&&"1"==r?d[f]="L":a.test(r)&&(h=r)}for(var f=0;u>f;++f)if(o.test(d[f])){for(var m=f+1;u>m&&o.test(d[m]);++m);for(var y="L"==(f?d[f-1]:c),b="L"==(u>m?d[m]:c),g=y||b?"L":"R",v=f;m>v;++v)d[v]=g;f=m-1}for(var x,k=[],f=0;u>f;)if(l.test(d[f])){var _=f;for(++f;u>f&&l.test(d[f]);++f);k.push(new t(0,_,f))}else{var w=f,C=k.length;for(++f;u>f&&"L"!=d[f];++f);for(var v=w;f>v;)if(s.test(d[v])){v>w&&k.splice(C,0,new t(1,w,v));var S=v;for(++v;f>v&&s.test(d[v]);++v);k.splice(C,0,new t(2,S,v)),w=v}else++v;f>w&&k.splice(C,0,new t(1,w,f))}return 1==k[0].level&&(x=n.match(/^\s+/))&&(k[0].from=x[0].length,k.unshift(new t(0,0,x[0].length))),1==qi(k).level&&(x=n.match(/\s+$/))&&(qi(k).to-=x[0].length,k.push(new t(0,u-x[0].length,u))),2==k[0].level&&k.unshift(new t(1,k[0].to,k[0].to)),k[0].level!=qi(k).level&&k.push(new t(k[0].level,u,u)),k}}();return e.version="5.10.1",e}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.overlayMode=function(t,n,r){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:e.copyState(t,r.base),overlay:e.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)<e.start)&&(i.streamSeen=e,i.basePos=i.overlayPos=e.start),e.start==i.basePos&&(i.baseCur=t.token(e,i.base),i.basePos=e.pos),e.start==i.overlayPos&&(e.pos=e.start,i.overlayCur=n.token(e,i.overlay),i.overlayPos=e.pos),e.pos=Math.min(i.basePos,i.overlayPos),null==i.overlayCur?i.baseCur:null!=i.baseCur&&i.overlay.combineTokens||r&&null==i.overlay.combineTokens?i.baseCur+" "+i.overlayCur:i.overlayCur},indent:t.indent&&function(e,n){return t.indent(e.base,n)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){t.blankLine&&t.blankLine(e.base),n.blankLine&&n.blankLine(e.overlay)}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){if(!e.hasOwnProperty(t))throw new Error("Undefined state "+t+" in simple mode")}function n(e,t){if(!e)return/(?:)/;var n="";return e instanceof RegExp?(e.ignoreCase&&(n="i"),e=e.source):e=String(e),new RegExp((t===!1?"":"^")+"(?:"+e+")",n)}function r(e){if(!e)return null;if("string"==typeof e)return e.replace(/\./g," ");for(var t=[],n=0;n<e.length;n++)t.push(e[n]&&e[n].replace(/\./g," "));return t}function i(e,i){(e.next||e.push)&&t(i,e.next||e.push),this.regex=n(e.regex),this.token=r(e.token),this.data=e}function o(e,t){return function(n,r){if(r.pending){var i=r.pending.shift();return 0==r.pending.length&&(r.pending=null),n.pos+=i.text.length,i.token}if(r.local){if(r.local.end&&n.match(r.local.end)){var o=r.local.endToken||null;return r.local=r.localState=null,o}var a,o=r.local.mode.token(n,r.localState);return r.local.endScan&&(a=r.local.endScan.exec(n.current()))&&(n.pos=n.start+a.index),o}for(var s=e[r.state],c=0;c<s.length;c++){var u=s[c],d=(!u.data.sol||n.sol())&&n.match(u.regex);if(d){if(u.data.next?r.state=u.data.next:u.data.push?((r.stack||(r.stack=[])).push(r.state),r.state=u.data.push):u.data.pop&&r.stack&&r.stack.length&&(r.state=r.stack.pop()),u.data.mode&&l(t,r,u.data.mode,u.token),u.data.indent&&r.indent.push(n.indentation()+t.indentUnit),u.data.dedent&&r.indent.pop(),d.length>2){r.pending=[];for(var f=2;f<d.length;f++)d[f]&&r.pending.push({text:d[f],token:u.token[f-1]});return n.backUp(d[0].length-(d[1]?d[1].length:0)),u.token[0]}return u.token&&u.token.join?u.token[0]:u.token}}return n.next(),null}}function a(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=0;for(var r in e)if(e.hasOwnProperty(r)){if(!t.hasOwnProperty(r)||!a(e[r],t[r]))return!1;n++}for(var r in t)t.hasOwnProperty(r)&&n--;return 0==n}function l(t,r,i,o){var l;if(i.persistent)for(var s=r.persistentStates;s&&!l;s=s.next)(i.spec?a(i.spec,s.spec):i.mode==s.mode)&&(l=s);var c=l?l.mode:i.mode||e.getMode(t,i.spec),u=l?l.state:e.startState(c);i.persistent&&!l&&(r.persistentStates={mode:c,spec:i.spec,state:u,next:r.persistentStates}),r.localState=u,r.local={mode:c,end:i.end&&n(i.end),endScan:i.end&&i.forceEnd!==!1&&n(i.end,!1),endToken:o&&o.join?o[o.length-1]:o}}function s(e,t){for(var n=0;n<t.length;n++)if(t[n]===e)return!0}function c(t,n){return function(r,i,o){if(r.local&&r.local.mode.indent)return r.local.mode.indent(r.localState,i,o);if(null==r.indent||r.local||n.dontIndentStates&&s(r.state,n.dontIndentStates)>-1)return e.Pass;var a=r.indent.length-1,l=t[r.state];e:for(;;){for(var c=0;c<l.length;c++){var u=l[c];if(u.data.dedent&&u.data.dedentIfLineStart!==!1){var d=u.regex.exec(i);if(d&&d[0]){a--,(u.next||u.push)&&(l=t[u.next||u.push]),i=i.slice(d[0].length);continue e}}}break}return 0>a?0:r.indent[a]}}e.defineSimpleMode=function(t,n){e.defineMode(t,function(t){return e.simpleMode(t,n)})},e.simpleMode=function(n,r){t(r,"start");var a={},l=r.meta||{},s=!1;for(var u in r)if(u!=l&&r.hasOwnProperty(u))for(var d=a[u]=[],f=r[u],p=0;p<f.length;p++){var h=f[p];d.push(new i(h,r)),(h.indent||h.dedent)&&(s=!0)}var m={startState:function(){return{state:"start",pending:null,local:null,localState:null,indent:s?[]:null}},copyState:function(t){var n={
+state:t.state,pending:t.pending,local:t.local,localState:null,indent:t.indent&&t.indent.slice(0)};t.localState&&(n.localState=e.copyState(t.local.mode,t.localState)),t.stack&&(n.stack=t.stack.slice(0));for(var r=t.persistentStates;r;r=r.next)n.persistentStates={mode:r.mode,spec:r.spec,state:r.state==t.localState?n.localState:e.copyState(r.mode,r.state),next:n.persistentStates};return n},token:o(a,n),innerMode:function(e){return e.local&&{mode:e.local.mode,state:e.localState}},indent:c(a,l)};if(l)for(var g in l)l.hasOwnProperty(g)&&(m[g]=l[g]);return m}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.multiplexingMode=function(t){function n(e,t,n,r){if("string"==typeof t){var i=e.indexOf(t,n);return r&&i>-1?i+t.length:i}var o=t.exec(n?e.slice(n):e);return o?o.index+n+(r?o[0].length:0):-1}var r=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:e.startState(t),innerActive:null,inner:null}},copyState:function(n){return{outer:e.copyState(t,n.outer),innerActive:n.innerActive,inner:n.innerActive&&e.copyState(n.innerActive.mode,n.inner)}},token:function(i,o){if(o.innerActive){var a=o.innerActive,l=i.string;if(!a.close&&i.sol())return o.innerActive=o.inner=null,this.token(i,o);var s=a.close?n(l,a.close,i.pos,a.parseDelimiters):-1;if(s==i.pos&&!a.parseDelimiters)return i.match(a.close),o.innerActive=o.inner=null,a.delimStyle&&a.delimStyle+" "+a.delimStyle+"-close";s>-1&&(i.string=l.slice(0,s));var c=a.mode.token(i,o.inner);return s>-1&&(i.string=l),s==i.pos&&a.parseDelimiters&&(o.innerActive=o.inner=null),a.innerStyle&&(c=c?c+" "+a.innerStyle:a.innerStyle),c}for(var u=1/0,l=i.string,d=0;d<r.length;++d){var f=r[d],s=n(l,f.open,i.pos);if(s==i.pos)return f.parseDelimiters||i.match(f.open),o.innerActive=f,o.inner=e.startState(f.mode,t.indent?t.indent(o.outer,""):0),f.delimStyle&&f.delimStyle+" "+f.delimStyle+"-open";-1!=s&&u>s&&(u=s)}u!=1/0&&(i.string=l.slice(0,u));var p=t.token(i,o.outer);return u!=1/0&&(i.string=l),p},indent:function(n,r){var i=n.innerActive?n.innerActive.mode:t;return i.indent?i.indent(n.innerActive?n.inner:n.outer,r):e.Pass},blankLine:function(n){var i=n.innerActive?n.innerActive.mode:t;if(i.blankLine&&i.blankLine(n.innerActive?n.inner:n.outer),n.innerActive)"\n"===n.innerActive.close&&(n.innerActive=n.inner=null);else for(var o=0;o<r.length;++o){var a=r[o];"\n"===a.open&&(n.innerActive=a,n.inner=e.startState(a.mode,i.indent?i.indent(n.outer,""):0))}},electricChars:t.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:t}}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",o),e.removeLineClass(e.state.activeLines[t],"background",a)}function n(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function r(e,r){for(var i=[],l=0;l<r.length;l++){var s=r[l];if(s.empty()){var c=e.getLineHandleVisualStart(s.head.line);i[i.length-1]!=c&&i.push(c)}}n(e.state.activeLines,i)||e.operation(function(){t(e);for(var n=0;n<i.length;n++)e.addLineClass(i[n],"wrap",o),e.addLineClass(i[n],"background",a);e.state.activeLines=i})}function i(e,t){r(e,t.ranges)}var o="CodeMirror-activeline",a="CodeMirror-activeline-background";e.defineOption("styleActiveLine",!1,function(n,o,a){var l=a&&a!=e.Init;o&&!l?(n.state.activeLines=[],r(n,n.listSelections()),n.on("beforeSelectionChange",i)):!o&&l&&(n.off("beforeSelectionChange",i),t(n),delete n.state.activeLines)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,i,o){if(this.atOccurrence=!1,this.doc=e,null==o&&"string"==typeof t&&(o=!1),i=i?e.clipPos(i):r(0,0),this.pos={from:i,to:i},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(n,i){if(n){t.lastIndex=0;for(var o,a,l=e.getLine(i.line).slice(0,i.ch),s=0;;){t.lastIndex=s;var c=t.exec(l);if(!c)break;if(o=c,a=o.index,s=o.index+(o[0].length||1),s==l.length)break}var u=o&&o[0].length||0;u||(0==a&&0==l.length?o=void 0:a!=e.getLine(i.line).length&&u++)}else{t.lastIndex=i.ch;var l=e.getLine(i.line),o=t.exec(l),u=o&&o[0].length||0,a=o&&o.index;a+u==l.length||u||(u=1)}return o&&u?{from:r(i.line,a),to:r(i.line,a+u),match:o}:void 0};else{var a=t;o&&(t=t.toLowerCase());var l=o?function(e){return e.toLowerCase()}:function(e){return e},s=t.split("\n");if(1==s.length)this.matches=t.length?function(i,o){if(i){var s=e.getLine(o.line).slice(0,o.ch),c=l(s),u=c.lastIndexOf(t);if(u>-1)return u=n(s,c,u),{from:r(o.line,u),to:r(o.line,u+a.length)}}else{var s=e.getLine(o.line).slice(o.ch),c=l(s),u=c.indexOf(t);if(u>-1)return u=n(s,c,u)+o.ch,{from:r(o.line,u),to:r(o.line,u+a.length)}}}:function(){};else{var c=a.split("\n");this.matches=function(t,n){var i=s.length-1;if(t){if(n.line-(s.length-1)<e.firstLine())return;if(l(e.getLine(n.line).slice(0,c[i].length))!=s[s.length-1])return;for(var o=r(n.line,c[i].length),a=n.line-1,u=i-1;u>=1;--u,--a)if(s[u]!=l(e.getLine(a)))return;var d=e.getLine(a),f=d.length-c[0].length;if(l(d.slice(f))!=s[0])return;return{from:r(a,f),to:o}}if(!(n.line+(s.length-1)>e.lastLine())){var d=e.getLine(n.line),f=d.length-c[0].length;if(l(d.slice(f))==s[0]){for(var p=r(n.line,f),a=n.line+1,u=1;i>u;++u,++a)if(s[u]!=l(e.getLine(a)))return;if(l(e.getLine(a).slice(0,c[i].length))==s[i])return{from:p,to:r(a,c[i].length)}}}}}}}function n(e,t,n){if(e.length==t.length)return n;for(var r=Math.min(n,e.length);;){var i=e.slice(0,r).toLowerCase().length;if(n>i)++r;else{if(!(i>n))return r;--r}}}var r=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=r(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,i=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,i))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!i.line)return t(0);i=r(i.line-1,this.doc.getLine(i.line-1).length)}else{var o=this.doc.lineCount();if(i.line==o-1)return t(o);i=r(i.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(t,n){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,r){return new t(this.doc,e,n,r)}),e.defineDocExtension("getSearchCursor",function(e,n,r){return new t(this,e,n,r)}),e.defineExtension("selectMatches",function(t,n){for(var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);return n&&n.index==t.pos?(t.pos+=n[0].length||1,"searching"):void(n?t.pos=n.index:t.skipToEnd())}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function r(e){return e.state.search||(e.state.search=new n)}function i(e){return"string"==typeof e&&e==e.toLowerCase()}function o(e,t,n){return e.getSearchCursor(t,n,i(t))}function a(e,t,n,r){e.openDialog(t,r,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){h(e)}})}function l(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0}):i(prompt(n,r))}function s(e,t,n,r){e.openConfirm?e.openConfirm(t,r):confirm(n)&&r[0]()}function c(e){return e.replace(/\\(.)/g,function(e,t){return"n"==t?"\n":"r"==t?"\r":t})}function u(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(n){}else e=c(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function d(e,n,r){n.queryText=r,n.query=u(r),e.removeOverlay(n.overlay,i(n.query)),n.overlay=t(n.query,i(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,i(n.query)))}function f(t,n,i){var o=r(t);if(o.query)return p(t,n);var s=t.getSelection()||o.lastQuery;if(i&&t.openDialog){var c=null;a(t,v,s,function(n,r){e.e_stop(r),n&&(n!=o.queryText&&d(t,o,n),c&&(c.style.opacity=1),p(t,r.shiftKey,function(e,n){var r;n.line<3&&document.querySelector&&(r=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((c=r).style.opacity=.4)}))})}else l(t,v,"Search for:",s,function(e){e&&!o.query&&t.operation(function(){d(t,o,e),o.posFrom=o.posTo=t.getCursor(),p(t,n)})})}function p(t,n,i){t.operation(function(){var a=r(t),l=o(t,a.query,n?a.posFrom:a.posTo);(l.find(n)||(l=o(t,a.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),l.find(n)))&&(t.setSelection(l.from(),l.to()),t.scrollIntoView({from:l.from(),to:l.to()},20),a.posFrom=l.from(),a.posTo=l.to(),i&&i(l.from(),l.to()))})}function h(e){e.operation(function(){var t=r(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}function m(e,t,n){e.operation(function(){for(var r=o(e,t);r.findNext();)if("string"!=typeof t){var i=e.getRange(r.from(),r.to()).match(t);r.replace(n.replace(/\$(\d)/g,function(e,t){return i[t]}))}else r.replace(n)})}function g(e,t){if(!e.getOption("readOnly")){var n=e.getSelection()||r(e).lastQuery,i=t?"Replace all:":"Replace:";l(e,i+y,i,n,function(n){n&&(n=u(n),l(e,b,"Replace with:","",function(r){if(r=c(r),t)m(e,n,r);else{h(e);var i=o(e,n,e.getCursor()),a=function(){var t,c=i.from();!(t=i.findNext())&&(i=o(e,n),!(t=i.findNext())||c&&i.from().line==c.line&&i.from().ch==c.ch)||(e.setSelection(i.from(),i.to()),e.scrollIntoView({from:i.from(),to:i.to()}),s(e,x,"Replace?",[function(){l(t)},a,function(){m(e,n,r)}]))},l=function(e){i.replace("string"==typeof n?r:r.replace(/\$(\d)/g,function(t,n){return e[n]})),a()};a()}}))})}}var v='Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',y=' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',b='With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',x="Replace? <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>";e.commands.find=function(e){h(e),f(e)},e.commands.findPersistent=function(e){h(e),f(e,!1,!0)},e.commands.findNext=f,e.commands.findPrev=function(e){f(e,!0)},e.commands.clearSearch=h,e.commands.replace=g,e.commands.replaceAll=function(e){g(e,!0)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0}):i(prompt(n,r))}function n(e,t){var n=Number(t);return/^[-+]/.test(t)?e.getCursor().line+n:n-1}var r='Jump to line: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use line:column or scroll% syntax)</span>';e.commands.jumpToLine=function(e){var i=e.getCursor();t(e,r,"Jump to line:",i.line+1+":"+i.ch,function(t){if(t){var r;if(r=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(n(e,r[1]),Number(r[2]));else if(r=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var o=Math.round(e.lineCount()*Number(r[1])/100);/^[-+]/.test(r[1])&&(o=i.line+o+1),e.setCursor(o-1,i.ch)}else(r=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(n(e,r[1]),i.ch)}})},e.keyMap["default"]["Alt-G"]="jumpToLine"}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,r){this.cm=e,this.options=r;var i={listenForChanges:!1};for(var o in r)i[o]=r[o];i.className||(i.className="CodeMirror-search-match"),this.annotation=e.annotateScrollbar(i),this.query=t,this.caseFold=n,this.gap={from:e.firstLine(),to:e.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var a=this;e.on("change",this.changeHandler=function(e,t){a.onChange(t)})}function n(e,t,n){return t>=e?e:Math.max(t,e+n)}e.defineExtension("showMatchesOnScrollbar",function(e,n,r){return"string"==typeof r&&(r={className:r}),r||(r={}),new t(this,e,n,r)});var r=1e3;t.prototype.findMatches=function(){if(this.gap){for(var t=0;t<this.matches.length;t++){var n=this.matches[t];if(n.from.line>=this.gap.to)break;n.to.line>=this.gap.from&&this.matches.splice(t--,1)}for(var i=this.cm.getSearchCursor(this.query,e.Pos(this.gap.from,0),this.caseFold),o=this.options&&this.options.maxMatches||r;i.findNext();){var n={from:i.from(),to:i.to()};if(n.from.line>=this.gap.to)break;if(this.matches.splice(t++,0,n),this.matches.length>o)break}this.gap=null}},t.prototype.onChange=function(t){var r=t.from.line,i=e.changeEnd(t).line,o=i-t.to.line;if(this.gap?(this.gap.from=Math.min(n(this.gap.from,r,o),t.from.line),this.gap.to=Math.max(n(this.gap.to,r,o),t.from.line)):this.gap={from:t.from.line,to:i+1},o)for(var a=0;a<this.matches.length;a++){var l=this.matches[a],s=n(l.from.line,r,o);s!=l.from.line&&(l.from=e.Pos(s,l.from.ch));var c=n(l.to.line,r,o);c!=l.to.line&&(l.to=e.Pos(c,l.to.ch))}clearTimeout(this.update);var u=this;this.update=setTimeout(function(){u.updateAfterChange()},250)},t.prototype.updateAfterChange=function(){this.findMatches(),this.annotation.update(this.matches)},t.prototype.clear=function(){this.cm.off("change",this.changeHandler),this.annotation.clear()}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./matchesonscrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./matchesonscrollbar"],e):e(CodeMirror)}(function(e){"use strict";function t(e){"object"==typeof e&&(this.minChars=e.minChars,this.style=e.style,this.showToken=e.showToken,this.delay=e.delay,this.wordsOnly=e.wordsOnly,this.annotateScrollbar=e.annotateScrollbar),null==this.style&&(this.style=u),null==this.minChars&&(this.minChars=c),null==this.delay&&(this.delay=d),null==this.wordsOnly&&(this.wordsOnly=f),this.overlay=this.timeout=null,this.matchesonscroll=null}function n(e){var t=e.state.matchHighlighter;clearTimeout(t.timeout),t.timeout=setTimeout(function(){o(e)},t.delay)}function r(e,t,n,r){var i=e.state.matchHighlighter;if(e.addOverlay(i.overlay=s(t,n,r)),i.annotateScrollbar){var o=n?new RegExp("\\b"+t+"\\b"):t;i.matchesonscroll=e.showMatchesOnScrollbar(o,!0,{className:"CodeMirror-selection-highlight-scrollbar"})}}function i(e){var t=e.state.matchHighlighter;t.overlay&&(e.removeOverlay(t.overlay),t.overlay=null,t.annotateScrollbar&&(t.matchesonscroll.clear(),t.matchesonscroll=null))}function o(e){e.operation(function(){var t=e.state.matchHighlighter;if(i(e),!e.somethingSelected()&&t.showToken){for(var n=t.showToken===!0?/[\w$]/:t.showToken,o=e.getCursor(),l=e.getLine(o.line),s=o.ch,c=s;s&&n.test(l.charAt(s-1));)--s;for(;c<l.length&&n.test(l.charAt(c));)++c;return void(c>s&&r(e,l.slice(s,c),n,t.style))}var u=e.getCursor("from"),d=e.getCursor("to");if(u.line==d.line&&(!t.wordsOnly||a(e,u,d))){var f=e.getRange(u,d).replace(/^\s+|\s+$/g,"");f.length>=t.minChars&&r(e,f,!1,t.style)}})}function a(e,t,n){var r=e.getRange(t,n);if(null!==r.match(/^\w+$/)){if(t.ch>0){var i={line:t.line,ch:t.ch-1},o=e.getRange(i,t);if(null===o.match(/\W/))return!1}if(n.ch<e.getLine(t.line).length){var i={line:n.line,ch:n.ch+1},o=e.getRange(n,i);if(null===o.match(/\W/))return!1}return!0}return!1}function l(e,t){return!(e.start&&t.test(e.string.charAt(e.start-1))||e.pos!=e.string.length&&t.test(e.string.charAt(e.pos)))}function s(e,t,n){return{token:function(r){return!r.match(e)||t&&!l(r,t)?(r.next(),void(r.skipTo(e.charAt(0))||r.skipToEnd())):n}}}var c=2,u="matchhighlight",d=100,f=!1;e.defineOption("highlightSelectionMatches",!1,function(r,a,l){l&&l!=e.Init&&(i(r),clearTimeout(r.state.matchHighlighter.timeout),r.state.matchHighlighter=null,r.off("cursorActivity",n)),a&&(r.state.matchHighlighter=new t(a),o(r),r.on("cursorActivity",n))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n,r){function i(t){var n=e.wheelEventPixels(t)["horizontal"==o.orientation?"x":"y"],r=o.pos;o.moveTo(o.pos+n),o.pos!=r&&e.e_preventDefault(t)}this.orientation=n,this.scroll=r,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=t+"-"+n,this.inner=this.node.appendChild(document.createElement("div"));var o=this;e.on(this.inner,"mousedown",function(t){function n(){e.off(document,"mousemove",r),e.off(document,"mouseup",n)}function r(e){return 1!=e.which?n():void o.moveTo(l+(e[i]-a)*(o.total/o.size))}if(1==t.which){e.e_preventDefault(t);var i="horizontal"==o.orientation?"pageX":"pageY",a=t[i],l=o.pos;e.on(document,"mousemove",r),e.on(document,"mouseup",n)}}),e.on(this.node,"click",function(t){e.e_preventDefault(t);var n,r=o.inner.getBoundingClientRect();n="horizontal"==o.orientation?t.clientX<r.left?-1:t.clientX>r.right?1:0:t.clientY<r.top?-1:t.clientY>r.bottom?1:0,o.moveTo(o.pos+n*o.screen)}),e.on(this.node,"mousewheel",i),e.on(this.node,"DOMMouseScroll",i)}function n(e,n,r){this.addClass=e,this.horiz=new t(e,"horizontal",r),n(this.horiz.node),this.vert=new t(e,"vertical",r),n(this.vert.node),this.width=null}t.prototype.moveTo=function(e,t){0>e&&(e=0),e>this.total-this.screen&&(e=this.total-this.screen),e!=this.pos&&(this.pos=e,this.inner.style["horizontal"==this.orientation?"left":"top"]=e*(this.size/this.total)+"px",t!==!1&&this.scroll(e,this.orientation))};var r=10;t.prototype.update=function(e,t,n){this.screen=t,this.total=e,this.size=n;var i=this.screen*(this.size/this.total);r>i&&(this.size-=r-i,i=r),this.inner.style["horizontal"==this.orientation?"width":"height"]=i+"px",this.inner.style["horizontal"==this.orientation?"left":"top"]=this.pos*(this.size/this.total)+"px"},n.prototype.update=function(e){if(null==this.width){var t=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;t&&(this.width=parseInt(t.height))}var n=this.width||0,r=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1;return this.vert.node.style.display=i?"block":"none",this.horiz.node.style.display=r?"block":"none",i&&(this.vert.update(e.scrollHeight,e.clientHeight,e.viewHeight-(r?n:0)),this.vert.node.style.display="block",this.vert.node.style.bottom=r?n+"px":"0"),r&&(this.horiz.update(e.scrollWidth,e.clientWidth,e.viewWidth-(i?n:0)-e.barLeft),this.horiz.node.style.right=i?n+"px":"0",this.horiz.node.style.left=e.barLeft+"px"),{right:i?n:0,bottom:r?n:0}},n.prototype.setScrollTop=function(e){this.vert.moveTo(e,!1)},n.prototype.setScrollLeft=function(e){this.horiz.moveTo(e,!1)},n.prototype.clear=function(){var e=this.horiz.node.parentNode;e.removeChild(this.horiz.node),e.removeChild(this.vert.node)},e.scrollbarModel.simple=function(e,t){return new n("CodeMirror-simplescroll",e,t)},e.scrollbarModel.overlay=function(e,t){return new n("CodeMirror-overlayscroll",e,t)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){function n(e){clearTimeout(r.doRedraw),r.doRedraw=setTimeout(function(){r.redraw()},e)}this.cm=e,this.options=t,this.buttonHeight=t.scrollButtonHeight||e.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=e.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var r=this;e.on("refresh",this.resizeHandler=function(){clearTimeout(r.doUpdate),r.doUpdate=setTimeout(function(){r.computeScale()&&n(20)},100)}),e.on("markerAdded",this.resizeHandler),e.on("markerCleared",this.resizeHandler),t.listenForChanges!==!1&&e.on("change",this.changeHandler=function(){n(250)})}e.defineExtension("annotateScrollbar",function(e){return"string"==typeof e&&(e={className:e}),new t(this,e)}),e.defineOption("scrollButtonHeight",0),t.prototype.computeScale=function(){var e=this.cm,t=(e.getWrapperElement().clientHeight-e.display.barHeight-2*this.buttonHeight)/e.getScrollerElement().scrollHeight;return t!=this.hScale?(this.hScale=t,!0):void 0},t.prototype.update=function(e){this.annotations=e,this.redraw()},t.prototype.redraw=function(e){function t(e,t){if(s!=e.line&&(s=e.line,c=n.getLineHandle(s)),a&&c.height>l)return n.charCoords(e,"local")[t?"top":"bottom"];var r=n.heightAtLine(c,"local");return r+(t?0:c.height)}e!==!1&&this.computeScale();var n=this.cm,r=this.hScale,i=document.createDocumentFragment(),o=this.annotations,a=n.getOption("lineWrapping"),l=a&&1.5*n.defaultTextHeight(),s=null,c=null;if(n.display.barWidth)for(var u,d=0;d<o.length;d++){for(var f=o[d],p=u||t(f.from,!0)*r,h=t(f.to,!1)*r;d<o.length-1&&(u=t(o[d+1].from,!0)*r,!(u>h+.9));)f=o[++d],h=t(f.to,!1)*r;if(h!=p){var m=Math.max(h-p,3),g=i.appendChild(document.createElement("div"));g.style.cssText="position: absolute; right: 0px; width: "+Math.max(1.5*n.display.barWidth,2)+"px; top: "+(p+this.buttonHeight)+"px; height: "+m+"px",g.className=this.options.className,f.id&&g.setAttribute("annotation-id",f.id)}}this.div.textContent="",this.div.appendChild(i)},t.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("change",this.changeHandler),this.div.parentNode.removeChild(this.div)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n,r){this.cm=e,this.node=t,this.options=n,this.height=r,this.cleared=!1}function n(e){var t=e.getWrapperElement(),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r=parseInt(n.height),i=e.state.panels={setHeight:t.style.height,heightLeft:r,panels:0,wrapper:document.createElement("div")};t.parentNode.insertBefore(i.wrapper,t);var o=e.hasFocus();i.wrapper.appendChild(t),o&&e.focus(),e._setSize=e.setSize,null!=r&&(e.setSize=function(t,n){if(null==n)return this._setSize(t,n);if(i.setHeight=n,"number"!=typeof n){var o=/^(\d+\.?\d*)px$/.exec(n);o?n=Number(o[1]):(i.wrapper.style.height=n,n=i.wrapper.offsetHeight,i.wrapper.style.height="")}e._setSize(t,i.heightLeft+=n-r),r=n})}function r(e){var t=e.state.panels;e.state.panels=null;var n=e.getWrapperElement();t.wrapper.parentNode.replaceChild(n,t.wrapper),n.style.height=t.setHeight,e.setSize=e._setSize,e.setSize()}e.defineExtension("addPanel",function(e,r){r=r||{},this.state.panels||n(this);var i=this.state.panels,o=i.wrapper,a=this.getWrapperElement();r.after instanceof t&&!r.after.cleared?o.insertBefore(e,r.before.node.nextSibling):r.before instanceof t&&!r.before.cleared?o.insertBefore(e,r.before.node):r.replace instanceof t&&!r.replace.cleared?(o.insertBefore(e,r.replace.node),r.replace.clear()):"bottom"==r.position?o.appendChild(e):"before-bottom"==r.position?o.insertBefore(e,a.nextSibling):"after-top"==r.position?o.insertBefore(e,a):o.insertBefore(e,o.firstChild);var l=r&&r.height||e.offsetHeight;return this._setSize(null,i.heightLeft-=l),i.panels++,new t(this,e,r,l)}),t.prototype.clear=function(){if(!this.cleared){this.cleared=!0;var e=this.cm.state.panels;this.cm._setSize(null,e.heightLeft+=this.height),e.wrapper.removeChild(this.node),0==--e.panels&&r(this.cm)}},t.prototype.changed=function(e){var t=null==e?this.node.offsetHeight:e,n=this.cm.state.panels;this.cm._setSize(null,n.height+=t-this.height),this.height=t}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.className="CodeMirror-placeholder";var r=e.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),n.appendChild(r),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){o(e)&&n(e)}function i(e){var r=e.getWrapperElement(),i=o(e);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?n(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",function(n,o,a){var l=a&&a!=e.Init;if(o&&!l)n.on("blur",r),n.on("change",i),i(n);else if(!o&&l){n.off("blur",r),n.off("change",i),t(n);var s=n.getWrapperElement();s.className=s.className.replace(" CodeMirror-empty","")}o&&!n.hasFocus()&&r(n)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function n(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(r,i,o){o==e.Init&&(o=!1),!o!=!i&&(i?t(r):n(r))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,r){function i(){t.display.wrapper.offsetHeight?(n(t,r),t.display.lastWrapHeight!=t.display.wrapper.clientHeight&&t.refresh()):r.timeout=setTimeout(i,r.delay)}r.timeout=setTimeout(i,r.delay),r.hurry=function(){clearTimeout(r.timeout),r.timeout=setTimeout(i,50)},e.on(window,"mouseup",r.hurry),e.on(window,"keyup",r.hurry)}function n(t,n){clearTimeout(n.timeout),e.off(window,"mouseup",n.hurry),e.off(window,"keyup",n.hurry)}e.defineOption("autoRefresh",!1,function(e,r){e.state.autoRefresh&&(n(e,e.state.autoRefresh),e.state.autoRefresh=null),r&&0==e.display.wrapper.offsetHeight&&t(e,e.state.autoRefresh={delay:r.delay||250})})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n){var r,i=e.getWrapperElement();return r=i.appendChild(document.createElement("div")),r.className=n?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?r.innerHTML=t:r.appendChild(t),r}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",function(r,i,o){function a(e){if("string"==typeof e)d.value=e;else{if(c)return;c=!0,s.parentNode.removeChild(s),u.focus(),o.onClose&&o.onClose(s)}}o||(o={}),n(this,null);var l,s=t(this,r,o.bottom),c=!1,u=this,d=s.getElementsByTagName("input")[0];return d?(o.value&&(d.value=o.value,o.selectValueOnOpen!==!1&&d.select()),o.onInput&&e.on(d,"input",function(e){o.onInput(e,d.value,a)}),o.onKeyUp&&e.on(d,"keyup",function(e){o.onKeyUp(e,d.value,a)}),e.on(d,"keydown",function(t){o&&o.onKeyDown&&o.onKeyDown(t,d.value,a)||((27==t.keyCode||o.closeOnEnter!==!1&&13==t.keyCode)&&(d.blur(),e.e_stop(t),a()),13==t.keyCode&&i(d.value,t))}),o.closeOnBlur!==!1&&e.on(d,"blur",a),d.focus()):(l=s.getElementsByTagName("button")[0])&&(e.on(l,"click",function(){a(),u.focus()}),o.closeOnBlur!==!1&&e.on(l,"blur",a),l.focus()),a}),e.defineExtension("openConfirm",function(r,i,o){function a(){c||(c=!0,l.parentNode.removeChild(l),u.focus())}n(this,null);var l=t(this,r,o&&o.bottom),s=l.getElementsByTagName("button"),c=!1,u=this,d=1;s[0].focus();for(var f=0;f<s.length;++f){var p=s[f];!function(t){e.on(p,"click",function(n){e.e_preventDefault(n),a(),t&&t(u)})}(i[f]),e.on(p,"blur",function(){--d,setTimeout(function(){0>=d&&a()},200)}),e.on(p,"focus",function(){++d})}}),e.defineExtension("openNotification",function(r,i){function o(){s||(s=!0,clearTimeout(a),l.parentNode.removeChild(l))}n(this,o);var a,l=t(this,r,i&&i.bottom),s=!1,c=i&&"undefined"!=typeof i.duration?i.duration:5e3;return e.on(l,"click",function(t){e.e_preventDefault(t),o()}),c&&(a=setTimeout(o,c)),o})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,r,i){var o=e.getLineHandle(t.line),s=t.ch-1,c=s>=0&&l[o.text.charAt(s)]||l[o.text.charAt(++s)];if(!c)return null;var u=">"==c.charAt(1)?1:-1;if(r&&u>0!=(s==t.ch))return null;var d=e.getTokenTypeAt(a(t.line,s+1)),f=n(e,a(t.line,s+(u>0?1:0)),u,d||null,i);return null==f?null:{from:a(t.line,s),to:f&&f.pos,match:f&&f.ch==c.charAt(0),forward:u>0}}function n(e,t,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,s=i&&i.maxScanLines||1e3,c=[],u=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,d=n>0?Math.min(t.line+s,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-s),f=t.line;f!=d;f+=n){var p=e.getLine(f);if(p){var h=n>0?0:p.length-1,m=n>0?p.length:-1;if(!(p.length>o))for(f==t.line&&(h=t.ch-(0>n?1:0));h!=m;h+=n){var g=p.charAt(h);if(u.test(g)&&(void 0===r||e.getTokenTypeAt(a(f,h+1))==r)){var v=l[g];if(">"==v.charAt(1)==n>0)c.push(g);else{if(!c.length)return{pos:a(f,h),ch:g};c.pop()}}}}}return f-n==(n>0?e.lastLine():e.firstLine())?!1:null}function r(e,n,r){for(var i=e.state.matchBrackets.maxHighlightLineLength||1e3,l=[],s=e.listSelections(),c=0;c<s.length;c++){var u=s[c].empty()&&t(e,s[c].head,!1,r);if(u&&e.getLine(u.from.line).length<=i){var d=u.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";l.push(e.markText(u.from,a(u.from.line,u.from.ch+1),{className:d})),u.to&&e.getLine(u.to.line).length<=i&&l.push(e.markText(u.to,a(u.to.line,u.to.ch+1),{className:d}));
-if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var d=null,p="group"==r,h=e.cm&&e.cm.getHelper(t,"wordChars"),m=!0;!(0>n)||a(!m);m=!1){var g=u.text.charAt(s)||"\n",v=Di(g,h)?"w":p&&"\n"==g?"n":!p||/\s/.test(g)?null:"p";if(!p||m||v||(v="s"),d&&d!=v){0>n&&(n=1,a());break}if(v&&(d=v),n>0&&!a(!m))break}var y=qe(e,qo(l,s),c,!0);return f||(y.hitSide=!0),y}function Hn(e,t,n,r){var i,o=e.doc,a=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+n*(l-(0>n?1.5:.5)*yt(e.display))}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var s=gt(e,a,i);if(!s.outside)break;if(0>n?0>=i:i>=o.height){s.hitSide=!0;break}i+=5*n}return s}function $n(t,n,r,i){e.defaults[t]=n,r&&(Zo[t]=i?function(e,t,n){n!=Yo&&r(e,t,n)}:r)}function Bn(e){for(var t,n,r,i,o=e.split(/-(?!$)/),e=o[o.length-1],a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{if(!/^s(hift)$/i.test(l))throw new Error("Unrecognized modifier name: "+l);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Un(e){return"string"==typeof e?aa[e]:e}function Vn(e,t,n,r,i){if(r&&r.shared)return Gn(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return zt(e.cm,Vn)(e,t,n,r,i);var o=new da(e,i),a=No(t,n);if(r&&Ii(r,o,!1),a>0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Wi("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(mr(e,t.line,t,n,o)||t.line!=n.line&&mr(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Oo=!0}o.addToHistory&&li(e,{from:t,to:n,origin:"markText"},e.sel,0/0);var l,s=t.line,c=e.cm;if(e.iter(s,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&gr(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&Qr(e,0),er(e,new Yn(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s}),o.collapsed&&e.iter(t.line,n.line+1,function(t){xr(e,t)&&Qr(t,0)}),o.clearOnEnter&&Sa(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Eo=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++fa,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)It(c,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=n.line;u++)Pt(c,u,"text");o.atomic&&Ee(c.doc),_i(c,"markerAdded",c,o)}return o}function Gn(e,t,n,r,i){r=Ii(r),r.shared=!1;var o=[Vn(e,t,n,r,i)],a=o[0],l=r.widgetNode;return Gr(e,function(e){l&&(r.widgetNode=l.cloneNode(!0)),o.push(Vn(e,ve(e,t),ve(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=zi(o)}),new pa(o,a)}function Kn(e){return e.findMarks(qo(e.first,0),e.clipPos(qo(e.lastLine())),function(e){return e.parent})}function Xn(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(No(o,a)){var l=Vn(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function Zn(e){for(var t=0;t<e.length;t++){var n=e[t],r=[n.primary.doc];Gr(n.primary.doc,function(e){r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==Ei(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}}}function Yn(e,t,n){this.marker=e,this.from=t,this.to=n}function Qn(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Jn(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function er(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function tr(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Yn(a,o.from,s?null:o.to))}}return r}function nr(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Yn(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}function rr(e,t){if(t.full)return null;var n=be(e,t.from.line)&&Xr(e,t.from.line).markedSpans,r=be(e,t.to.line)&&Xr(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==No(t.from,t.to),l=tr(n,i,a),s=nr(r,o,a),c=1==t.text.length,u=zi(t.text).length+(c?i:0);if(l)for(var f=0;f<l.length;++f){var d=l[f];if(null==d.to){var p=Qn(s,d.marker);p?c&&(d.to=null==p.to?null:p.to+u):d.to=i}}if(s)for(var f=0;f<s.length;++f){var d=s[f];if(null!=d.to&&(d.to+=u),null==d.from){var p=Qn(l,d.marker);p||(d.from=u,c&&(l||(l=[])).push(d))}else d.from+=u,c&&(l||(l=[])).push(d)}l&&(l=ir(l)),s&&s!=l&&(s=ir(s));var h=[l];if(!c){var m,g=t.text.length-2;if(g>0&&l)for(var f=0;f<l.length;++f)null==l[f].to&&(m||(m=[])).push(new Yn(l[f].marker,null,null));for(var f=0;g>f;++f)h.push(m);h.push(s)}return h}function ir(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function or(e,t){var n=pi(e,t),r=rr(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function ar(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=Ei(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(No(c.to,l.from)<0||No(c.from,l.to)>0)){var u=[s,1],f=No(c.from,l.from),d=No(c.to,l.to);(0>f||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:l.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-1}}return i}function lr(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function sr(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function cr(e){return e.inclusiveLeft?-1:0}function ur(e){return e.inclusiveRight?1:0}function fr(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=No(r.from,i.from)||cr(e)-cr(t);if(o)return-o;var a=No(r.to,i.to)||ur(e)-ur(t);return a?a:t.id-e.id}function dr(e,t){var n,r=Oo&&e.markedSpans;if(r)for(var i,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||fr(n,i.marker)<0)&&(n=i.marker);return n}function pr(e){return dr(e,!0)}function hr(e){return dr(e,!1)}function mr(e,t,n,r,i){var o=Xr(e,t),a=Oo&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=No(c.from,n)||cr(s.marker)-cr(i),f=No(c.to,r)||ur(s.marker)-ur(i);if(!(u>=0&&0>=f||0>=u&&f>=0)&&(0>=u&&(No(c.to,n)>0||s.marker.inclusiveRight&&i.inclusiveLeft)||u>=0&&(No(c.from,r)<0||s.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function gr(e){for(var t;t=pr(e);)e=t.find(-1,!0).line;return e}function vr(e){for(var t,n;t=hr(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function yr(e,t){var n=Xr(e,t),r=gr(n);return n==r?t:Jr(r)}function br(e,t){if(t>e.lastLine())return t;var n,r=Xr(e,t);if(!xr(e,r))return t;for(;n=hr(r);)r=n.find(1,!0).line;return Jr(r)+1}function xr(e,t){var n=Oo&&t.markedSpans;if(n)for(var r,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&_r(e,t,r))return!0}}function _r(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return _r(e,r.line,Qn(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&_r(e,t,i))return!0}function kr(e,t,n){ti(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&In(e,null,n)}function wr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Fa(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),Hi(t.display.measure,Wi("div",[e.node],null,n))}return e.height=e.node.offsetHeight}function Cr(e,t,n,r){var i=new ha(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Rn(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!xr(e,t)){var r=ti(t)<e.scrollTop;Qr(t,t.height+wr(i)),r&&In(o,null,i.height),o.curOp.forceUpdate=!0}return!0}),i}function Sr(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),lr(e),sr(e,n);var i=r?r(e):1;i!=e.height&&Qr(e,i)}function Mr(e){e.parent=null,lr(e)}function Lr(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Tr(t,n){if(t.blankLine)return t.blankLine(n);if(t.innerMode){var r=e.innerMode(t,n);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Ar(t,n,r,i){for(var o=0;10>o;o++){i&&(i[0]=e.innerMode(t,r).mode);var a=t.token(n,r);if(n.pos>n.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}function zr(e,t,n,r){function i(e){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:e?ra(a.mode,u):u}}var o,a=e.doc,l=a.mode;t=ve(a,t);var s,c=Xr(a,t.line),u=He(e,t.line,n),f=new ua(c.text,e.options.tabSize);for(r&&(s=[]);(r||f.pos<t.ch)&&!f.eol();)f.start=f.pos,o=Ar(l,f,u),r&&s.push(i(!0));return r?s:i()}function Er(e,t,n,r,i,o,a){var l=n.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,f=new ua(t,e.options.tabSize),d=e.options.addModeClass&&[null];for(""==t&&Lr(Tr(n,r),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(l=!1,a&&Nr(e,t,r,f.pos),f.pos=t.length,s=null):s=Lr(Ar(n,f,r,d),o),d){var p=d[0].name;p&&(s="m-"+(s?p+" "+s:p))}if(!l||u!=s){for(;c<f.start;)c=Math.min(f.start,c+5e4),i(c,u);u=s}f.start=f.pos}for(;c<f.pos;){var h=Math.min(f.pos,c+5e4);i(h,u),c=h}}function Or(e,t,n,r){var i=[e.state.modeGen],o={};Er(e,t.text,e.doc.mode,n,function(e,t){i.push(e,t)},o,r);for(var a=0;a<e.state.overlays.length;++a){var l=e.state.overlays[a],s=1,c=0;Er(e,t.text,l.mode,!0,function(e,t){for(var n=s;e>c;){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,c=Math.min(e,r)}if(t)if(l.opaque)i.splice(n,s-n,e,"cm-overlay "+t),s=n+2;else for(;s>n;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function qr(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Or(e,t,t.stateAfter=He(e,Jr(t)));t.styles=r.styles,r.classes?t.styleClasses=r.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Nr(e,t,n,r){var i=e.doc.mode,o=new ua(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&Tr(i,n);!o.eol()&&o.pos<=e.options.maxHighlightLength;)Ar(i,o,n),o.start=o.pos}function Ir(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?va:ga;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Pr(e,t){var n=Wi("span",null,null,vo?"padding-right: .1px":null),r={pre:Wi("pre",[n]),content:n,col:0,pos:0,cm:e,splitSpaces:(mo||vo)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,a=i?t.rest[i-1]:t.line;r.pos=0,r.addToken=jr,Zi(e.display.measure)&&(o=ni(a))&&(r.addToken=Wr(r.addToken,o)),r.map=[];var l=t!=e.display.externalMeasured&&Jr(a);Hr(a,r,qr(e,a,l)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=Ui(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=Ui(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Xi(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return vo&&/\bcm-tab\b/.test(r.content.lastChild.className)&&(r.content.className="cm-tab-wrap-hack"),La(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Ui(r.pre.className,r.textClass||"")),r}function Dr(e){var t=Wi("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function jr(e,t,n,r,i,o,a){if(t){var l=e.splitSpaces?t.replace(/ {3,}/g,Rr):t,s=e.cm.state.specialChars,c=!1;if(s.test(t))for(var u=document.createDocumentFragment(),f=0;;){s.lastIndex=f;var d=s.exec(t),p=d?d.index-f:t.length-f;if(p){var h=document.createTextNode(l.slice(f,f+p));u.appendChild(mo&&9>go?Wi("span",[h]):h),e.map.push(e.pos,e.pos+p,h),e.col+=p,e.pos+=p}if(!d)break;if(f+=p+1," "==d[0]){var m=e.cm.options.tabSize,g=m-e.col%m,h=u.appendChild(Wi("span",Ai(g),"cm-tab"));h.setAttribute("role","presentation"),h.setAttribute("cm-text"," "),e.col+=g}else{var h=e.cm.options.specialCharPlaceholder(d[0]);h.setAttribute("cm-text",d[0]),u.appendChild(mo&&9>go?Wi("span",[h]):h),e.col+=1}e.map.push(e.pos,e.pos+1,h),e.pos++}else{e.col+=t.length;var u=document.createTextNode(l);e.map.push(e.pos,e.pos+t.length,u),mo&&9>go&&(c=!0),e.pos+=t.length}if(n||r||i||c||a){var v=n||"";r&&(v+=r),i&&(v+=i);var y=Wi("span",[u],v,a);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(u)}}function Rr(e){for(var t=" ",n=0;n<e.length-2;++n)t+=n%2?" ":" ";return t+=" "}function Wr(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var f=0;f<t.length;f++){var d=t[f];if(d.to>c&&d.from<=c)break}if(d.to>=u)return e(n,r,i,o,a,l,s);e(n,r.slice(0,d.to-c),i,o,null,l,s),o=null,r=r.slice(d.to-c),c=d.to}}}function Fr(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function Hr(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,l,s,c,u,f,d,p=i.length,h=0,m=1,g="",v=0;;){if(v==h){s=c=u=f=l="",d=null,v=1/0;for(var y=[],b=0;b<r.length;++b){var x=r[b],_=x.marker;"bookmark"==_.type&&x.from==h&&_.widgetNode?y.push(_):x.from<=h&&(null==x.to||x.to>h||_.collapsed&&x.to==h&&x.from==h)?(null!=x.to&&x.to!=h&&v>x.to&&(v=x.to,c=""),_.className&&(s+=" "+_.className),_.css&&(l=_.css),_.startStyle&&x.from==h&&(u+=" "+_.startStyle),_.endStyle&&x.to==v&&(c+=" "+_.endStyle),_.title&&!f&&(f=_.title),_.collapsed&&(!d||fr(d.marker,_)<0)&&(d=x)):x.from>h&&v>x.from&&(v=x.from)}if(d&&(d.from||0)==h){if(Fr(t,(null==d.to?p+1:d.to)-h,d.marker,null==d.from),null==d.to)return;d.to==h&&(d=!1)}if(!d&&y.length)for(var b=0;b<y.length;++b)Fr(t,0,y[b])}if(h>=p)break;for(var k=Math.min(p,v);;){if(g){var w=h+g.length;if(!d){var C=w>k?g.slice(0,k-h):g;t.addToken(t,C,a?a+s:s,u,h+C.length==v?c:"",f,l)}if(w>=k){g=g.slice(k-h),h=k;break}h=w,u=""}g=i.slice(o,o=n[m++]),a=Ir(n[m++],t.cm.options)}}else for(var m=1;m<n.length;m+=2)t.addToken(t,i.slice(o,o=n[m]),Ir(n[m+1],t.cm.options))}function $r(e,t){return 0==t.from.ch&&0==t.to.ch&&""==zi(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Br(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){Sr(e,n,i,r),_i(e,"change",e,t)}function a(e,t){for(var n=e,o=[];t>n;++n)o.push(new ma(c[n],i(n),r));return o}var l=t.from,s=t.to,c=t.text,u=Xr(e,l.line),f=Xr(e,s.line),d=zi(c),p=i(c.length-1),h=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if($r(e,t)){var m=a(0,c.length-1);o(f,f.text,p),h&&e.remove(l.line,h),m.length&&e.insert(l.line,m)}else if(u==f)if(1==c.length)o(u,u.text.slice(0,l.ch)+d+u.text.slice(s.ch),p);else{var m=a(1,c.length-1);m.push(new ma(d+u.text.slice(s.ch),p,r)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,m)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+f.text.slice(s.ch),i(0)),e.remove(l.line+1,h);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(f,d+f.text.slice(s.ch),p);var m=a(1,c.length-1);h>1&&e.remove(l.line+1,h-1),e.insert(l.line+1,m)}_i(e,"change",e,t)}function Ur(e){this.lines=e,this.parent=null;for(var t=0,n=0;t<e.length;++t)e[t].parent=this,n+=e[t].height;this.height=n}function Vr(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}function Gr(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;(!n||s)&&(t(l.doc,s),r(l.doc,e,s))}}}r(e,null,!0)}function Kr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,a(e),n(e),e.options.lineWrapping||d(e),e.options.mode=t.modeOption,It(e)}function Xr(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(o>t){n=i;break}t-=o}return n.lines[t]}function Zr(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function Yr(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function Qr(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Jr(e){if(null==e.parent)return null;for(var t=e.parent,n=Ei(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function ei(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(o>t){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var r=0;r<e.lines.length;++r){var a=e.lines[r],l=a.height;if(l>t)break;t-=l}return n+r}function ti(e){e=gr(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var r=0;r<o.children.length;++r){var a=o.children[r];if(a==n)break;t+=a.height}return t}function ni(e){var t=e.order;return null==t&&(t=e.order=el(e.text)),t}function ri(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ii(e,t){var n={from:K(t.from),to:Ko(t),text:Zr(e,t.from,t.to)};return fi(e,n,t.from.line,t.to.line+1),Gr(e,function(e){fi(e,n,t.from.line,t.to.line+1)},!0),n}function oi(e){for(;e.length;){var t=zi(e);if(!t.ranges)break;e.pop()}}function ai(e,t){return t?(oi(e.done),zi(e.done)):e.done.length&&!zi(e.done).ranges?zi(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),zi(e.done)):void 0}function li(e,t,n,r){if("ignoreHistory"!=t.origin){var i=e.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ai(i,i.lastOp==r))){var l=zi(o.changes);0==No(t.from,t.to)&&0==No(t.from,l.to)?l.to=Ko(t):o.changes.push(ii(e,t))}else{var s=zi(i.done);for(s&&s.ranges||ui(e.sel,i.done),o={changes:[ii(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||La(e,"historyAdded")}}function si(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ci(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||si(e,o,zi(i.done),t))?i.done[i.done.length-1]=t:ui(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&oi(i.undone)}function ui(e,t){var n=zi(t);n&&n.ranges&&n.equals(e)||t.push(e)}function fi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function di(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function pi(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=0,i=[];r<t.text.length;++r)i.push(di(n[r]));return i}function hi(e,t,n){for(var r=0,i=[];r<e.length;++r){var o=e[r];if(o.ranges)i.push(n?de.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];i.push({changes:l});for(var s=0;s<a.length;++s){var c,u=a[s];if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var f in u)(c=f.match(/^spans_(\d+)$/))&&Ei(t,Number(c[1]))>-1&&(zi(l)[f]=u[f],delete u[f])}}}return i}function mi(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function gi(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)mi(o.ranges[l].anchor,t,n,r),mi(o.ranges[l].head,t,n,r)}else{for(var l=0;l<o.changes.length;++l){var s=o.changes[l];if(n<s.from.line)s.from=qo(s.from.line+r,s.from.ch),s.to=qo(s.to.line+r,s.to.ch);else if(t<=s.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function vi(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;gi(e.done,n,r,i),gi(e.undone,n,r,i)}function yi(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function bi(e){return e.target||e.srcElement}function xi(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Mo&&e.ctrlKey&&1==t&&(t=3),t}function _i(e,t){function n(e){return function(){e.apply(null,o)}}var r=e._handlers&&e._handlers[t];if(r){var i,o=Array.prototype.slice.call(arguments,2);Wo?i=Wo.delayedCallbacks:Ta?i=Ta:(i=Ta=[],setTimeout(ki,0));for(var a=0;a<r.length;++a)i.push(n(r[a]))}}function ki(){var e=Ta;Ta=null;for(var t=0;t<e.length;++t)e[t]()}function wi(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),La(e,n||t.type,e,t),yi(t)||t.codemirrorIgnore}function Ci(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==Ei(n,t[r])&&n.push(t[r])}function Si(e,t){var n=e._handlers&&e._handlers[t];return n&&n.length>0}function Mi(e){e.prototype.on=function(e,t){Sa(this,e,t)},e.prototype.off=function(e,t){Ma(this,e,t)}}function Li(){this.id=null}function Ti(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}function Ai(e){for(;Ia.length<=e;)Ia.push(zi(Ia)+" ");return Ia[e]}function zi(e){return e[e.length-1]}function Ei(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function Oi(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function qi(){}function Ni(e,t){var n;return Object.create?n=Object.create(e):(qi.prototype=e,n=new qi),t&&Ii(t,n),n}function Ii(e,t,n){t||(t={});for(var r in e)!e.hasOwnProperty(r)||n===!1&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function Pi(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Di(e,t){return t?t.source.indexOf("\\w")>-1&&Ra(e)?!0:t.test(e):Ra(e)}function ji(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Ri(e){return e.charCodeAt(0)>=768&&Wa.test(e)}function Wi(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Fi(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Hi(e,t){return Fi(e).appendChild(t)}function $i(){return document.activeElement}function Bi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Ui(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!Bi(n[r]).test(t)&&(t+=" "+n[r]);return t}function Vi(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}function Gi(){Va||(Ki(),Va=!0)}function Ki(){var e;Sa(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Vi(Bt)},100))}),Sa(window,"blur",function(){Vi(gn)})}function Xi(e){if(null==Ha){var t=Wi("span","​");Hi(e,Wi("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ha=t.offsetWidth<=1&&t.offsetHeight>2&&!(mo&&8>go))}var n=Ha?Wi("span","​"):Wi("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Zi(e){if(null!=$a)return $a;var t=Hi(e,document.createTextNode("AخA")),n=Da(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=Da(t,1,2).getBoundingClientRect();return $a=r.right-n.right<3}function Yi(e){if(null!=Ya)return Ya;var t=Hi(e,Wi("span","x")),n=t.getBoundingClientRect(),r=Da(t,0,1).getBoundingClientRect();return Ya=Math.abs(n.left-r.left)>1}function Qi(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}function Ji(e){return e.level%2?e.to:e.from}function eo(e){return e.level%2?e.from:e.to}function to(e){var t=ni(e);return t?Ji(t[0]):0}function no(e){var t=ni(e);return t?eo(zi(t)):e.text.length}function ro(e,t){var n=Xr(e.doc,t),r=gr(n);r!=n&&(t=Jr(r));var i=ni(r),o=i?i[0].level%2?no(r):to(r):0;return qo(t,o)}function io(e,t){for(var n,r=Xr(e.doc,t);n=hr(r);)r=n.find(1,!0).line,t=null;var i=ni(r),o=i?i[0].level%2?to(r):no(r):r.text.length;return qo(null==t?Jr(r):t,o)}function oo(e,t){var n=ro(e,t.line),r=Xr(e.doc,n.line),i=ni(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return qo(n.line,a?0:o)}return n}function ao(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:n>t}function lo(e,t){Ja=null;for(var n,r=0;r<e.length;++r){var i=e[r];if(i.from<t&&i.to>t)return r;if(i.from==t||i.to==t){if(null!=n)return ao(e,i.level,e[n].level)?(i.from!=i.to&&(Ja=n),r):(i.from!=i.to&&(Ja=r),n);n=r}}return n}function so(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&Ri(e.text.charAt(t)));return t}function co(e,t,n,r){var i=ni(e);if(!i)return uo(e,t,n,r);for(var o=lo(i,t),a=i[o],l=so(e,t,a.level%2?-n:n,r);;){if(l>a.from&&l<a.to)return l;if(l==a.from||l==a.to)return lo(i,l)==o?l:(a=i[o+=n],n>0==a.level%2?a.to:a.from);if(a=i[o+=n],!a)return null;l=n>0==a.level%2?so(e,a.to,-1,r):so(e,a.from,1,r)}}function uo(e,t,n,r){var i=t+n;if(r)for(;i>0&&Ri(e.text.charAt(i));)i+=n;return 0>i||i>e.text.length?null:i}var fo=/gecko\/\d/i.test(navigator.userAgent),po=/MSIE \d/.test(navigator.userAgent),ho=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),mo=po||ho,go=mo&&(po?document.documentMode||6:ho[1]),vo=/WebKit\//.test(navigator.userAgent),yo=vo&&/Qt\/\d+\.\d+/.test(navigator.userAgent),bo=/Chrome\//.test(navigator.userAgent),xo=/Opera\//.test(navigator.userAgent),_o=/Apple Computer/.test(navigator.vendor),ko=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),wo=/PhantomJS/.test(navigator.userAgent),Co=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),So=Co||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),Mo=Co||/Mac/.test(navigator.platform),Lo=/win/i.test(navigator.platform),To=xo&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);To&&(To=Number(To[1])),To&&To>=15&&(xo=!1,vo=!0);var Ao=Mo&&(yo||xo&&(null==To||12.11>To)),zo=fo||mo&&go>=9,Eo=!1,Oo=!1;m.prototype=Ii({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedOverlay&&e.clientHeight>0&&(0==r&&this.overlayHack(),this.checkedOverlay=!0),{right:n?r:0,bottom:t?r:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e)},overlayHack:function(){var e=Mo&&!ko?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=e;var t=this,n=function(e){bi(e)!=t.vert&&bi(e)!=t.horiz&&zt(t.cm,Gt)(e)};Sa(this.vert,"mousedown",n),Sa(this.horiz,"mousedown",n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),g.prototype=Ii({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},g.prototype),e.scrollbarModel={"native":m,"null":g},S.prototype.signal=function(e,t){Si(e,t)&&this.events.push(arguments)},S.prototype.finish=function(){for(var e=0;e<this.events.length;e++)La.apply(null,this.events[e])};var qo=e.Pos=function(e,t){return this instanceof qo?(this.line=e,void(this.ch=t)):new qo(e,t)},No=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},Io=null;ie.prototype=Ii({init:function(e){function t(e){if(r.somethingSelected())Io=r.getSelections(),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,o.value=Io.join("\n"),Pa(o));else{if(!r.options.lineWiseCopyCut)return;var t=ne(r);Io=t.text,"cut"==e.type?r.setSelections(t.ranges,null,Ea):(n.prevInput="",o.value=t.text.join("\n"),Pa(o))}"cut"==e.type&&(r.state.cutIncoming=!0)}var n=this,r=this.cm,i=this.wrapper=oe(),o=this.textarea=i.firstChild;e.wrapper.insertBefore(i,e.wrapper.firstChild),Co&&(o.style.width="0px"),Sa(o,"input",function(){mo&&go>=9&&n.hasSelection&&(n.hasSelection=null),n.poll()}),Sa(o,"paste",function(e){return ee(e,r)?!0:(r.state.pasteIncoming=!0,void n.fastPoll())}),Sa(o,"cut",t),Sa(o,"copy",t),Sa(e.scroller,"paste",function(t){Ut(e,t)||(r.state.pasteIncoming=!0,n.focus())}),Sa(e.lineSpace,"selectstart",function(t){Ut(e,t)||ka(t)}),Sa(o,"compositionstart",function(){var e=r.getCursor("from");n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Sa(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=Ie(e);if(e.options.moveInputWithCursor){var i=pt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},showSelection:function(e){var t=this.cm,n=t.display;Hi(n.cursorDiv,e.cursors),Hi(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=Za&&(o.to().line-o.from().line>100||(n=r.getSelection()).length>1e3);var a=t?"-":n||r.getSelection();this.composing||(this.textarea.value=a),r.state.focused&&Pa(this.textarea),
-mo&&go>=9&&(this.hasSelection=a)}else e||(this.composing||(this.prevInput=this.textarea.value=""),mo&&go>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!So||$i()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||Xa(t)&&!n||Q(e)||e.options.disableInput||e.state.keySeq)return!1;var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(mo&&go>=9&&this.hasSelection===r||Mo&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||n||(n="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,a=Math.min(n.length,r.length);a>o&&n.charCodeAt(o)==r.charCodeAt(o);)++o;var l=this;return At(e,function(){J(e,r.slice(o),n.length-o,null,l.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?t.value=l.prevInput="":l.prevInput=r,l.composing&&(l.composing.range.clear(),l.composing.range=e.markText(l.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){mo&&go>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,r.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.position="relative",a.style.cssText=u,mo&&9>go&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!mo||mo&&9>go)&&t();var e=0,n=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==r.prevInput?zt(i,oa.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(n,500):o.input.reset()};o.detectingSelectAll=setTimeout(n,200)}}var r=this,i=r.cm,o=i.display,a=r.textarea,l=Vt(i,e),s=o.scroller.scrollTop;if(l&&!xo){var c=i.options.resetSelectionOnContextMenu;c&&-1==i.doc.sel.contains(l)&&zt(i,Te)(i.doc,me(l),Ea);var u=a.style.cssText;if(r.wrapper.style.position="absolute",a.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(mo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",vo)var f=window.scrollY;if(o.input.focus(),vo&&window.scrollTo(null,f),o.input.reset(),i.somethingSelected()||(a.value=r.prevInput=" "),r.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),mo&&go>=9&&t(),zo){Ca(e);var d=function(){Ma(window,"mouseup",d),setTimeout(n,20)};Sa(window,"mouseup",d)}else setTimeout(n,50)}},setUneditable:qi,needsContentAttribute:!1},ie.prototype),ae.prototype=Ii({init:function(e){function t(e){if(r.somethingSelected())Io=r.getSelections(),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=ne(r);Io=t.text,"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,Ea),r.replaceSelection("",null,"cut")})}if(e.clipboardData&&!Co)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Io.join("\n"));else{var n=oe(),i=n.firstChild;r.display.lineSpace.insertBefore(n,r.display.lineSpace.firstChild),i.value=Io.join("\n");var o=document.activeElement;Pa(i),setTimeout(function(){r.display.lineSpace.removeChild(n),o.focus()},50)}}var n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable="true",re(i),Sa(i,"paste",function(e){ee(e,r)}),Sa(i,"compositionstart",function(e){var t=e.data;if(n.composing={sel:r.doc.sel,data:t,startData:t},t){var i=r.doc.sel.primary(),o=r.getLine(i.head.line),a=o.indexOf(t,Math.max(0,i.head.ch-t.length));a>-1&&a<=i.head.ch&&(n.composing.sel=me(qo(i.head.line,a),qo(i.head.line,a+t.length)))}}),Sa(i,"compositionupdate",function(e){n.composing.data=e.data}),Sa(i,"compositionend",function(e){var t=n.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||n.applyComposition(t),n.composing==t&&(n.composing=null)},50))}),Sa(i,"touchstart",function(){n.forceCompositionEnd()}),Sa(i,"input",function(){n.composing||n.pollContent()||At(n.cm,function(){It(r)})}),Sa(i,"copy",t),Sa(i,"cut",t)},prepareSelection:function(){var e=Ie(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=ce(this.cm,e.anchorNode,e.anchorOffset),r=ce(this.cm,e.focusNode,e.focusOffset);if(!n||n.bad||!r||r.bad||0!=No(Z(n,r),t.from())||0!=No(X(n,r),t.to())){var i=le(this.cm,t.from()),o=le(this.cm,t.to());if(i||o){var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var s=a[a.length-1].measure,c=s.maps?s.maps[s.maps.length-1]:s.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};try{var u=Da(i.node,i.offset,o.offset,o.node)}catch(f){}u&&(e.removeAllRanges(),e.addRange(u),l&&null==e.anchorNode?e.addRange(l):fo&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Hi(this.cm.display.cursorDiv,e.cursors),Hi(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Fa(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():At(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=ce(t,e.anchorNode,e.anchorOffset),r=ce(t,e.focusNode,e.focusOffset);n&&r&&At(t,function(){Te(t.doc,me(n,r),Ea),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o;if(r.line==t.viewFrom||0==(o=jt(e,r.line)))var a=Jr(t.view[0].line),l=t.view[0].node;else var a=Jr(t.view[o].line),l=t.view[o-1].node.nextSibling;var s=jt(e,i.line);if(s==t.view.length-1)var c=t.viewTo-1,u=t.lineDiv.lastChild;else var c=Jr(t.view[s+1].line)-1,u=t.view[s+1].node.previousSibling;for(var f=Ka(fe(e,l,u,a,c)),d=Zr(e.doc,qo(a,0),qo(c,Xr(e.doc,c).text.length));f.length>1&&d.length>1;)if(zi(f)==zi(d))f.pop(),d.pop(),c--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),a++}for(var p=0,h=0,m=f[0],g=d[0],v=Math.min(m.length,g.length);v>p&&m.charCodeAt(p)==g.charCodeAt(p);)++p;for(var y=zi(f),b=zi(d),x=Math.min(y.length-(1==f.length?p:0),b.length-(1==d.length?p:0));x>h&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)++h;f[f.length-1]=y.slice(0,y.length-h),f[0]=f[0].slice(p);var _=qo(a,p),k=qo(c,d.length?zi(d).length-h:0);return f.length>1||f[0]||No(_,k)?(zn(e.doc,f,_,k,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){e.data&&e.data!=e.startData&&zt(this.cm,J)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.setAttribute("contenteditable","false")},onKeyPress:function(e){e.preventDefault(),zt(this.cm,J)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},onContextMenu:qi,resetPosition:qi,needsContentAttribute:!0},ae.prototype),e.inputStyles={textarea:ie,contenteditable:ae},de.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(0!=No(n.anchor,r.anchor)||0!=No(n.head,r.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new pe(K(this.ranges[t].anchor),K(this.ranges[t].head));return new de(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(No(t,r.from())>=0&&No(e,r.to())<=0)return n}return-1}},pe.prototype={from:function(){return Z(this.anchor,this.head)},to:function(){return X(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Po,Do,jo,Ro={left:0,right:0,top:0,bottom:0},Wo=null,Fo=0,Ho=0,$o=0,Bo=null;mo?Bo=-.53:fo?Bo=15:bo?Bo=-.7:_o&&(Bo=-1/3);var Uo=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}};e.wheelEventPixels=function(e){var t=Uo(e);return t.x*=Bo,t.y*=Bo,t};var Vo=new Li,Go=null,Ko=e.changeEnd=function(e){return e.text?qo(e.from.line+e.text.length-1,zi(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];(n[e]!=t||"mode"==e)&&(n[e]=t,Zo.hasOwnProperty(e)&&zt(this,Zo[e])(this,t,r))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Un(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Et(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:t,opaque:n&&n.opaque}),this.state.modeGen++,It(this)}),removeOverlay:Et(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void It(this)}}),indentLine:Et(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),be(this.doc,e)&&jn(this,e,t,n)}),indentSelection:Et(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(jn(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Pn(this));else{var o=i.from(),a=i.to(),l=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;n>s;++s)jn(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&Ce(this.doc,r,new pe(o,c[r].to()),Ea)}}}),getTokenAt:function(e,t){return zr(this,e,t)},getLineTokens:function(e,t){return zr(this,qo(e),t,!0)},getTokenTypeAt:function(e){e=ve(this.doc,e);var t,n=qr(this,Xr(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var l=t?t.indexOf("cm-overlay "):-1;return 0>l?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!na.hasOwnProperty(t))return n;var r=na[t],i=this.getModeAt(e);if("string"==typeof i[t])r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=r[i[t][o]];a&&n.push(a)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(var o=0;o<r._global.length;o++){var l=r._global[o];l.pred(i,this)&&-1==Ei(n,l.val)&&n.push(l.val)}return n},getStateAfter:function(e,t){var n=this.doc;return e=ge(n,null==e?n.first+n.size-1:e),He(this,e+1,t)},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=null==e?r.head:"object"==typeof e?ve(this.doc,e):e?r.from():r.to(),pt(this,n,t||"page")},charCoords:function(e,t){return dt(this,ve(this.doc,e),t||"page")},coordsChar:function(e,t){return e=ft(this,e,t||"page"),gt(this,e.left,e.top)},lineAtHeight:function(e,t){return e=ft(this,{top:e,left:0},t||"page").top,ei(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var n,r=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,r=!0),n=Xr(this.doc,e)}else n=e;return ut(this,n,{top:0,left:0},t||"page").top+(r?this.doc.height-ti(n):0)},defaultTextHeight:function(){return yt(this.display)},defaultCharWidth:function(){return bt(this.display)},setGutterMarker:Et(function(e,t,n){return Rn(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&ji(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Et(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,Pt(t,r,"gutter"),ji(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),lineInfo:function(e){if("number"==typeof e){if(!be(this.doc,e))return null;var t=e;if(e=Xr(this.doc,e),!e)return null}else{var t=Jr(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=pt(this,ve(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&qn(this,l,a,l+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:Et(un),triggerOnKeyPress:Et(pn),triggerOnKeyUp:dn,execCommand:function(e){return oa.hasOwnProperty(e)?oa[e](this):void 0},triggerElectric:Et(function(e){te(this,e)}),findPosH:function(e,t,n,r){var i=1;0>t&&(i=-1,t=-t);for(var o=0,a=ve(this.doc,e);t>o&&(a=Fn(this.doc,a,i,n,r),!a.hitSide);++o);return a},moveH:Et(function(e,t){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Fn(n.doc,r.head,e,t,n.options.rtlMoveVisually):0>e?r.from():r.to()},qa)}),deleteH:Et(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Wn(this,function(n){var i=Fn(r,n.head,e,t,!1);return 0>e?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,o=r;0>t&&(i=-1,t=-t);for(var a=0,l=ve(this.doc,e);t>a;++a){var s=pt(this,l,"div");if(null==o?o=s.left:s.left=o,l=Hn(this,s,i,n),l.hitSide)break}return l},moveV:Et(function(e,t){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(o)return 0>e?a.from():a.to();var l=pt(n,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=Hn(n,l,e,t);return"page"==t&&a==r.sel.primary()&&In(n,null,dt(n,s,"div").top-l.top),s},qa),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,n=Xr(t,e.line).text,r=e.ch,i=e.ch;if(n){var o=this.getHelper(e,"wordChars");(e.xRel<0||i==n.length)&&r?--r:++i;for(var a=n.charAt(r),l=Di(a,o)?function(e){return Di(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Di(e)};r>0&&l(n.charAt(r-1));)--r;for(;i<n.length&&l(n.charAt(i));)++i}return new pe(qo(e.line,r),qo(e.line,i))},toggleOverwrite:function(e){(null==e||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?Ua(this.display.cursorDiv,"CodeMirror-overwrite"):Ba(this.display.cursorDiv,"CodeMirror-overwrite"),La(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==$i()},scrollTo:Et(function(e,t){(null!=e||null!=t)&&Dn(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Ve(this)-this.display.barHeight,width:e.scrollWidth-Ve(this)-this.display.barWidth,clientHeight:Ke(this),clientWidth:Ge(this)}},scrollIntoView:Et(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:qo(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)Dn(this),this.curOp.scrollToPos=e;else{var n=Nn(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(n.scrollLeft,n.scrollTop)}}),setSize:Et(function(e,t){function n(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var r=this;null!=e&&(r.display.wrapper.style.width=n(e)),null!=t&&(r.display.wrapper.style.height=n(t)),r.options.lineWrapping&&at(this);var i=r.display.viewFrom;r.doc.iter(i,r.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Pt(r,i,"widget");break}++i}),r.curOp.forceUpdate=!0,La(r,"refresh",this)}),operation:function(e){return At(this,e)},refresh:Et(function(){var e=this.display.cachedTextHeight;It(this),this.curOp.forceUpdate=!0,lt(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),u(this),(null==e||Math.abs(e-yt(this.display))>.5)&&a(this),La(this,"refresh",this)}),swapDoc:Et(function(e){var t=this.doc;return t.cm=null,Kr(this,e),lt(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,_i(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Mi(e);var Xo=e.defaults={},Zo=e.optionHandlers={},Yo=e.Init={toString:function(){return"CodeMirror.Init"}};$n("value","",function(e,t){e.setValue(t)},!0),$n("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),$n("indentUnit",2,n,!0),$n("indentWithTabs",!1),$n("smartIndent",!0),$n("tabSize",4,function(e){r(e),lt(e),It(e)},!0),$n("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,n,r){t.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),r!=e.Init&&t.refresh()}),$n("specialCharPlaceholder",Dr,function(e){e.refresh()},!0),$n("electricChars",!0),$n("inputStyle",So?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),$n("rtlMoveVisually",!Lo),$n("wholeLineUpdateBefore",!0),$n("theme","default",function(e){l(e),s(e)},!0),$n("keyMap","default",function(t,n,r){var i=Un(n),o=r!=e.Init&&Un(r);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),$n("extraKeys",null),$n("lineWrapping",!1,i,!0),$n("gutters",[],function(e){p(e.options),s(e)},!0),$n("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?C(e.display)+"px":"0",e.refresh()},!0),$n("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),$n("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),$n("lineNumbers",!1,function(e){p(e.options),s(e)},!0),$n("firstLineNumber",1,s,!0),$n("lineNumberFormatter",function(e){return e},s,!0),$n("showCursorWhenSelecting",!1,Ne,!0),$n("resetSelectionOnContextMenu",!0),$n("lineWiseCopyCut",!0),$n("readOnly",!1,function(e,t){"nocursor"==t?(gn(e),e.display.input.blur(),e.display.disabled=!0):(e.display.disabled=!1,t||e.display.input.reset())}),$n("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),$n("dragDrop",!0,$t),$n("cursorBlinkRate",530),$n("cursorScrollMargin",0),$n("cursorHeight",1,Ne,!0),$n("singleCursorHeightPerLine",!0,Ne,!0),$n("workTime",100),$n("workDelay",100),$n("flattenSpans",!0,r,!0),$n("addModeClass",!1,r,!0),$n("pollInterval",100),$n("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),$n("historyEventDelay",1250),$n("viewportMargin",10,function(e){e.refresh()},!0),$n("maxHighlightLength",1e4,r,!0),$n("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),$n("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),$n("autofocus",null);var Qo=e.modes={},Jo=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),Qo[t]=n},e.defineMIME=function(e,t){Jo[e]=t},e.resolveMode=function(t){if("string"==typeof t&&Jo.hasOwnProperty(t))t=Jo[t];else if(t&&"string"==typeof t.name&&Jo.hasOwnProperty(t.name)){var n=Jo[t.name];"string"==typeof n&&(n={name:n}),t=Ni(n,t),t.name=n.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=Qo[n.name];if(!r)return e.getMode(t,"text/plain");var i=r(t,n);if(ea.hasOwnProperty(n.name)){var o=ea[n.name];for(var a in o)o.hasOwnProperty(a)&&(i.hasOwnProperty(a)&&(i["_"+a]=i[a]),i[a]=o[a])}if(i.name=n.name,n.helperType&&(i.helperType=n.helperType),n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var ea=e.modeExtensions={};e.extendMode=function(e,t){var n=ea.hasOwnProperty(e)?ea[e]:ea[e]={};Ii(t,n)},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){ba.prototype[e]=t},e.defineOption=$n;var ta=[];e.defineInitHook=function(e){ta.push(e)};var na=e.helpers={};e.registerHelper=function(t,n,r){na.hasOwnProperty(t)||(na[t]=e[t]={_global:[]}),na[t][n]=r},e.registerGlobalHelper=function(t,n,r,i){e.registerHelper(t,n,i),na[t]._global.push({pred:r,val:i})};var ra=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n},ia=e.startState=function(e,t,n){return e.startState?e.startState(t,n):!0};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var oa=e.commands={selectAll:function(e){e.setSelection(qo(e.firstLine(),0),qo(e.lastLine()),Ea)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ea)},killLine:function(e){Wn(e,function(t){if(t.empty()){var n=Xr(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:qo(t.head.line+1,0)}:{from:t.head,to:qo(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){Wn(e,function(t){return{from:qo(t.from().line,0),to:ve(e.doc,qo(t.to().line+1,0))}})},delLineLeft:function(e){Wn(e,function(e){return{from:qo(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){Wn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){Wn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(qo(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(qo(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return ro(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return oo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return io(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},qa)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},qa)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?oo(e,t.head):r},qa)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=Na(e.getLine(o.line),o.ch,r);t.push(new Array(r-a%r+1).join(" "))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){At(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var i=t[r].head,o=Xr(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new qo(i.line,i.ch-1)),i.ch>0)i=new qo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),qo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Xr(e.doc,i.line-1).text;a&&e.replaceRange(o.charAt(0)+"\n"+a.charAt(a.length-1),qo(i.line-1,a.length-1),qo(i.line,1),"+transpose")}n.push(new pe(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){At(e,function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];e.replaceRange("\n",r.anchor,r.head,"+input"),e.indentLine(r.from().line+1,null,!0),Pn(e)}})},toggleOverwrite:function(e){e.toggleOverwrite()}},aa=e.keyMap={};aa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},aa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},aa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},aa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},aa["default"]=Mo?aa.macDefault:aa.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=Oi(n.split(" "),Bn),o=0;o<i.length;o++){var a,l;o==i.length-1?(l=i.join(" "),a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[n]}for(var c in t)e[c]=t[c];return e};var la=e.lookupKey=function(e,t,n,r){t=Un(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return la(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=la(e,t.fallthrough[o],n,r);if(a)return a}}},sa=e.isModifierKey=function(e){var t="string"==typeof e?e:Qa[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},ca=e.keyName=function(e,t){if(xo&&34==e.keyCode&&e["char"])return!1;var n=Qa[e.keyCode],r=n;return null==r||e.altGraphKey?!1:(e.altKey&&"Alt"!=n&&(r="Alt-"+r),(Ao?e.metaKey:e.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+r),(Ao?e.ctrlKey:e.metaKey)&&"Cmd"!=n&&(r="Cmd-"+r),!t&&e.shiftKey&&"Shift"!=n&&(r="Shift-"+r),r)};e.fromTextArea=function(t,n){
-function r(){t.value=c.getValue()}if(n=n?Ii(n):{},n.value=t.value,!n.tabindex&&t.tabIndex&&(n.tabindex=t.tabIndex),!n.placeholder&&t.placeholder&&(n.placeholder=t.placeholder),null==n.autofocus){var i=$i();n.autofocus=i==t||null!=t.getAttribute("autofocus")&&i==document.body}if(t.form&&(Sa(t.form,"submit",r),!n.leaveSubmitMethodAlone)){var o=t.form,a=o.submit;try{var l=o.submit=function(){r(),o.submit=a,o.submit(),o.submit=l}}catch(s){}}n.finishInit=function(e){e.save=r,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,r(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(Ma(t.form,"submit",r),"function"==typeof t.form.submit&&(t.form.submit=a))}},t.style.display="none";var c=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return c};var ua=e.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};ua.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var n=t==e;else var n=t&&(e.test?e.test(t):e(t));return n?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Na(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Na(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Na(this.string,null,this.tabSize)-(this.lineStart?Na(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var fa=0,da=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++fa};Mi(da),da.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&xt(e),Si(this,"clear")){var n=this.find();n&&_i(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=Qn(a.markedSpans,this);e&&!this.collapsed?Pt(e,Jr(a),"text"):e&&(null!=l.to&&(i=Jr(a)),null!=l.from&&(r=Jr(a))),a.markedSpans=Jn(a.markedSpans,l),null==l.from&&this.collapsed&&!xr(this.doc,a)&&e&&Qr(a,yt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var s=gr(this.lines[o]),c=f(s);c>e.display.maxLineLength&&(e.display.maxLine=s,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&It(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ee(e.doc)),e&&_i(e,"markerCleared",e,this),t&&kt(e),this.parent&&this.parent.clear()}},da.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=Qn(o.markedSpans,this);if(null!=a.from&&(n=qo(t?o:Jr(o),a.from),-1==e))return n;if(null!=a.to&&(r=qo(t?o:Jr(o),a.to),1==e))return r}return n&&{from:n,to:r}},da.prototype.changed=function(){var e=this.find(-1,!0),t=this,n=this.doc.cm;e&&n&&At(n,function(){var r=e.line,i=Jr(e.line),o=Je(n,i);if(o&&(ot(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!xr(t.doc,r)&&null!=t.height){var a=t.height;t.height=null;var l=wr(t)-a;l&&Qr(r,r.height+l)}})},da.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=Ei(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},da.prototype.detachLine=function(e){if(this.lines.splice(Ei(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var fa=0,pa=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Mi(pa),pa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();_i(this,"clear")}},pa.prototype.find=function(e,t){return this.primary.find(e,t)};var ha=e.LineWidget=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Mi(ha),ha.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Jr(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=wr(this);Qr(n,Math.max(0,n.height-o)),e&&At(e,function(){kr(e,n,-o),Pt(e,r,"widget")})}},ha.prototype.changed=function(){var e=this.height,t=this.doc.cm,n=this.line;this.height=null;var r=wr(this)-e;r&&(Qr(n,n.height+r),t&&At(t,function(){t.curOp.forceUpdate=!0,kr(t,n,r)}))};var ma=e.Line=function(e,t,n){this.text=e,sr(this,t),this.height=n?n(this):1};Mi(ma),ma.prototype.lineNo=function(){return Jr(this)};var ga={},va={};Ur.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;r>n;++n){var i=this.lines[n];this.height-=i.height,Mr(i),_i(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;r>e;++e)if(n(this.lines[e]))return!0}},Vr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(i>e){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ur))){var l=[];this.collapse(l),this.children=[new Ur(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>=e){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(;i.lines.length>50;){var a=i.lines.splice(i.lines.length-25,25),l=new Ur(a);i.height-=l.height,this.children.splice(r+1,0,l),l.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Vr(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=Ei(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new Vr(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>e){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var ya=0,ba=e.Doc=function(e,t,n){if(!(this instanceof ba))return new ba(e,t,n);null==n&&(n=0),Vr.call(this,[new Ur([new ma("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var r=qo(n,0);this.sel=me(r),this.history=new ri(null),this.id=++ya,this.modeOption=t,"string"==typeof e&&(e=Ka(e)),Br(this,{from:r,to:r,text:e}),Te(this,me(r),Ea)};ba.prototype=Ni(Vr.prototype,{constructor:ba,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Yr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||"\n")},setValue:Ot(function(e){var t=qo(this.first,0),n=this.first+this.size-1;Cn(this,{from:t,to:qo(n,Xr(this,n).text.length),text:Ka(e),origin:"setValue",full:!0},!0),Te(this,me(t))}),replaceRange:function(e,t,n,r){t=ve(this,t),n=n?ve(this,n):t,zn(this,e,t,n,r)},getRange:function(e,t,n){var r=Zr(this,ve(this,e),ve(this,t));return n===!1?r:r.join(n||"\n")},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return be(this,e)?Xr(this,e):void 0},getLineNumber:function(e){return Jr(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Xr(this,e)),gr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ve(this,e)},getCursor:function(e){var t,n=this.sel.primary();return t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||"to"==e||e===!1?n.to():n.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ot(function(e,t,n){Se(this,ve(this,"number"==typeof e?qo(e,t||0):e),null,n)}),setSelection:Ot(function(e,t,n){Se(this,ve(this,e),ve(this,t||e),n)}),extendSelection:Ot(function(e,t,n){ke(this,ve(this,e),t&&ve(this,t),n)}),extendSelections:Ot(function(e,t){we(this,xe(this,e,t))}),extendSelectionsBy:Ot(function(e,t){we(this,Oi(this.sel.ranges,e),t)}),setSelections:Ot(function(e,t,n){if(e.length){for(var r=0,i=[];r<e.length;r++)i[r]=new pe(ve(this,e[r].anchor),ve(this,e[r].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Te(this,he(i,t),n)}}),addSelection:Ot(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new pe(ve(this,e),ve(this,t||e))),Te(this,he(r,r.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Zr(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return e===!1?t:t.join(e||"\n")},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Zr(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||"\n")),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Ot(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:Ka(e[o]),origin:n}}for(var l=t&&"end"!=t&&kn(this,r,t),o=r.length-1;o>=0;o--)Cn(this,r[o]);l?Le(this,l):this.cm&&Pn(this.cm)}),undo:Ot(function(){Mn(this,"undo")}),redo:Ot(function(){Mn(this,"redo")}),undoSelection:Ot(function(){Mn(this,"undo",!0)}),redoSelection:Ot(function(){Mn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new ri(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:hi(this.history.done),undone:hi(this.history.undone)}},setHistory:function(e){var t=this.history=new ri(this.history.maxGeneration);t.done=hi(e.done.slice(0),null,!0),t.undone=hi(e.undone.slice(0),null,!0)},addLineClass:Ot(function(e,t,n){return Rn(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(Bi(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0})}),removeLineClass:Ot(function(e,t,n){return Rn(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(Bi(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),addLineWidget:Ot(function(e,t,n){return Cr(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Vn(this,ve(this,e),ve(this,t),n,"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ve(this,e),Vn(this,e,e,n,"bookmark")},findMarksAt:function(e){e=ve(this,e);var t=[],n=Xr(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ve(this,e),t=ve(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];i==e.line&&e.ch>s.to||null==s.from&&i!=e.line||i==t.line&&s.from>t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first;return this.iter(function(r){var i=r.text.length+1;return i>e?(t=e,!0):(e-=i,void++n)}),ve(this,qo(n,t))},indexFromPos:function(e){e=ve(this,e);var t=e.ch;return e.line<this.first||e.ch<0?0:(this.iter(this.first,e.line,function(e){t+=e.text.length+1}),t)},copy:function(e){var t=new ba(Yr(this,this.first,this.first+this.size),this.modeOption,this.first);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new ba(Yr(this,t,n),e.mode||this.modeOption,t);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Xn(r,Kn(this)),r},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var n=0;n<this.linked.length;++n){var r=this.linked[n];if(r.doc==t){this.linked.splice(n,1),t.unlinkDoc(this),Zn(Kn(this));break}}if(t.history==this.history){var i=[t.id];Gr(t,function(e){i.push(e.id)},!0),t.history=new ri(null),t.history.done=hi(this.history.done,i),t.history.undone=hi(this.history.undone,i)}},iterLinkedDocs:function(e){Gr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),ba.prototype.eachLine=ba.prototype.iter;var xa="iter insert remove copy getEditor constructor".split(" ");for(var _a in ba.prototype)ba.prototype.hasOwnProperty(_a)&&Ei(xa,_a)<0&&(e.prototype[_a]=function(e){return function(){return e.apply(this.doc,arguments)}}(ba.prototype[_a]));Mi(ba);var ka=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},wa=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},Ca=e.e_stop=function(e){ka(e),wa(e)},Sa=e.on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={}),i=r[t]||(r[t]=[]);i.push(n)}},Ma=e.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers&&e._handlers[t];if(!r)return;for(var i=0;i<r.length;++i)if(r[i]==n){r.splice(i,1);break}}},La=e.signal=function(e,t){var n=e._handlers&&e._handlers[t];if(n)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)},Ta=null,Aa=30,za=e.Pass={toString:function(){return"CodeMirror.Pass"}},Ea={scroll:!1},Oa={origin:"*mouse"},qa={origin:"+move"};Li.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Na=e.countColumn=function(e,t,n,r,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=r||0,a=i||0;;){var l=e.indexOf(" ",o);if(0>l||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}},Ia=[""],Pa=function(e){e.select()};Co?Pa=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:mo&&(Pa=function(e){try{e.select()}catch(t){}});var Da,ja=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ra=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||ja.test(e))},Wa=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Da=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Fa=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};mo&&11>go&&($i=function(){try{return document.activeElement}catch(e){return document.body}});var Ha,$a,Ba=e.rmClass=function(e,t){var n=e.className,r=Bi(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}},Ua=e.addClass=function(e,t){var n=e.className;Bi(t).test(n)||(e.className+=(n?" ":"")+t)},Va=!1,Ga=function(){if(mo&&9>go)return!1;var e=Wi("div");return"draggable"in e||"dragDrop"in e}(),Ka=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;r>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Xa=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},Za=function(){var e=Wi("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Ya=null,Qa={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};e.keyNames=Qa,function(){for(var e=0;10>e;e++)Qa[e+48]=Qa[e+96]=String(e);for(var e=65;90>=e;e++)Qa[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)Qa[e+111]=Qa[e+63235]="F"+e}();var Ja,el=function(){function e(e){return 247>=e?n.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?r.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/,c="L";return function(n){if(!i.test(n))return!1;for(var r,u=n.length,f=[],d=0;u>d;++d)f.push(r=e(n.charCodeAt(d)));for(var d=0,p=c;u>d;++d){var r=f[d];"m"==r?f[d]=p:p=r}for(var d=0,h=c;u>d;++d){var r=f[d];"1"==r&&"r"==h?f[d]="n":a.test(r)&&(h=r,"r"==r&&(f[d]="R"))}for(var d=1,p=f[0];u-1>d;++d){var r=f[d];"+"==r&&"1"==p&&"1"==f[d+1]?f[d]="1":","!=r||p!=f[d+1]||"1"!=p&&"n"!=p||(f[d]=p),p=r}for(var d=0;u>d;++d){var r=f[d];if(","==r)f[d]="N";else if("%"==r){for(var m=d+1;u>m&&"%"==f[m];++m);for(var g=d&&"!"==f[d-1]||u>m&&"1"==f[m]?"1":"N",v=d;m>v;++v)f[v]=g;d=m-1}}for(var d=0,h=c;u>d;++d){var r=f[d];"L"==h&&"1"==r?f[d]="L":a.test(r)&&(h=r)}for(var d=0;u>d;++d)if(o.test(f[d])){for(var m=d+1;u>m&&o.test(f[m]);++m);for(var y="L"==(d?f[d-1]:c),b="L"==(u>m?f[m]:c),g=y||b?"L":"R",v=d;m>v;++v)f[v]=g;d=m-1}for(var x,_=[],d=0;u>d;)if(l.test(f[d])){var k=d;for(++d;u>d&&l.test(f[d]);++d);_.push(new t(0,k,d))}else{var w=d,C=_.length;for(++d;u>d&&"L"!=f[d];++d);for(var v=w;d>v;)if(s.test(f[v])){v>w&&_.splice(C,0,new t(1,w,v));var S=v;for(++v;d>v&&s.test(f[v]);++v);_.splice(C,0,new t(2,S,v)),w=v}else++v;d>w&&_.splice(C,0,new t(1,w,d))}return 1==_[0].level&&(x=n.match(/^\s+/))&&(_[0].from=x[0].length,_.unshift(new t(0,0,x[0].length))),1==zi(_).level&&(x=n.match(/\s+$/))&&(zi(_).to-=x[0].length,_.push(new t(0,u-x[0].length,u))),2==_[0].level&&_.unshift(new t(1,_[0].to,_[0].to)),_[0].level!=zi(_).level&&_.push(new t(_[0].level,u,u)),_}}();return e.version="5.4.0",e}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.overlayMode=function(t,n,r){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:e.copyState(t,r.base),overlay:e.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)<e.start)&&(i.streamSeen=e,i.basePos=i.overlayPos=e.start),e.start==i.basePos&&(i.baseCur=t.token(e,i.base),i.basePos=e.pos),e.start==i.overlayPos&&(e.pos=e.start,i.overlayCur=n.token(e,i.overlay),i.overlayPos=e.pos),e.pos=Math.min(i.basePos,i.overlayPos),null==i.overlayCur?i.baseCur:null!=i.baseCur&&i.overlay.combineTokens||r&&null==i.overlay.combineTokens?i.baseCur+" "+i.overlayCur:i.overlayCur},indent:t.indent&&function(e,n){return t.indent(e.base,n)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){t.blankLine&&t.blankLine(e.base),n.blankLine&&n.blankLine(e.overlay)}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){if(!e.hasOwnProperty(t))throw new Error("Undefined state "+t+"in simple mode")}function n(e,t){if(!e)return/(?:)/;var n="";return e instanceof RegExp?(e.ignoreCase&&(n="i"),e=e.source):e=String(e),new RegExp((t===!1?"":"^")+"(?:"+e+")",n)}function r(e){if(!e)return null;if("string"==typeof e)return e.replace(/\./g," ");for(var t=[],n=0;n<e.length;n++)t.push(e[n]&&e[n].replace(/\./g," "));return t}function i(e,i){(e.next||e.push)&&t(i,e.next||e.push),this.regex=n(e.regex),this.token=r(e.token),this.data=e}function o(e,t){return function(n,r){if(r.pending){var i=r.pending.shift();return 0==r.pending.length&&(r.pending=null),n.pos+=i.text.length,i.token}if(r.local){if(r.local.end&&n.match(r.local.end)){var o=r.local.endToken||null;return r.local=r.localState=null,o}var a,o=r.local.mode.token(n,r.localState);return r.local.endScan&&(a=r.local.endScan.exec(n.current()))&&(n.pos=n.start+a.index),o}for(var s=e[r.state],c=0;c<s.length;c++){var u=s[c],f=(!u.data.sol||n.sol())&&n.match(u.regex);if(f){if(u.data.next?r.state=u.data.next:u.data.push?((r.stack||(r.stack=[])).push(r.state),r.state=u.data.push):u.data.pop&&r.stack&&r.stack.length&&(r.state=r.stack.pop()),u.data.mode&&l(t,r,u.data.mode,u.token),u.data.indent&&r.indent.push(n.indentation()+t.indentUnit),u.data.dedent&&r.indent.pop(),f.length>2){r.pending=[];for(var d=2;d<f.length;d++)f[d]&&r.pending.push({text:f[d],token:u.token[d-1]});return n.backUp(f[0].length-(f[1]?f[1].length:0)),u.token[0]}return u.token&&u.token.join?u.token[0]:u.token}}return n.next(),null}}function a(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=0;for(var r in e)if(e.hasOwnProperty(r)){if(!t.hasOwnProperty(r)||!a(e[r],t[r]))return!1;n++}for(var r in t)t.hasOwnProperty(r)&&n--;return 0==n}function l(t,r,i,o){var l;if(i.persistent)for(var s=r.persistentStates;s&&!l;s=s.next)(i.spec?a(i.spec,s.spec):i.mode==s.mode)&&(l=s);var c=l?l.mode:i.mode||e.getMode(t,i.spec),u=l?l.state:e.startState(c);i.persistent&&!l&&(r.persistentStates={mode:c,spec:i.spec,state:u,next:r.persistentStates}),r.localState=u,r.local={mode:c,end:i.end&&n(i.end),endScan:i.end&&i.forceEnd!==!1&&n(i.end,!1),endToken:o&&o.join?o[o.length-1]:o}}function s(e,t){for(var n=0;n<t.length;n++)if(t[n]===e)return!0}function c(t,n){return function(r,i,o){if(r.local&&r.local.mode.indent)return r.local.mode.indent(r.localState,i,o);if(null==r.indent||r.local||n.dontIndentStates&&s(r.state,n.dontIndentStates)>-1)return e.Pass;var a=r.indent.length-1,l=t[r.state];e:for(;;){for(var c=0;c<l.length;c++){var u=l[c];if(u.data.dedent&&u.data.dedentIfLineStart!==!1){var f=u.regex.exec(i);if(f&&f[0]){a--,(u.next||u.push)&&(l=t[u.next||u.push]),i=i.slice(f[0].length);continue e}}}break}return 0>a?0:r.indent[a]}}e.defineSimpleMode=function(t,n){e.defineMode(t,function(t){return e.simpleMode(t,n)})},e.simpleMode=function(n,r){t(r,"start");var a={},l=r.meta||{},s=!1;for(var u in r)if(u!=l&&r.hasOwnProperty(u))for(var f=a[u]=[],d=r[u],p=0;p<d.length;p++){var h=d[p];f.push(new i(h,r)),(h.indent||h.dedent)&&(s=!0)}var m={startState:function(){return{state:"start",pending:null,local:null,localState:null,indent:s?[]:null}},copyState:function(t){var n={state:t.state,pending:t.pending,local:t.local,localState:null,indent:t.indent&&t.indent.slice(0)};t.localState&&(n.localState=e.copyState(t.local.mode,t.localState)),t.stack&&(n.stack=t.stack.slice(0));for(var r=t.persistentStates;r;r=r.next)n.persistentStates={mode:r.mode,spec:r.spec,state:r.state==t.localState?n.localState:e.copyState(r.mode,r.state),next:n.persistentStates};return n},token:o(a,n),innerMode:function(e){return e.local&&{mode:e.local.mode,state:e.localState}},indent:c(a,l)};if(l)for(var g in l)l.hasOwnProperty(g)&&(m[g]=l[g]);return m}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.multiplexingMode=function(t){function n(e,t,n,r){if("string"==typeof t){var i=e.indexOf(t,n);return r&&i>-1?i+t.length:i}var o=t.exec(n?e.slice(n):e);return o?o.index+n+(r?o[0].length:0):-1}var r=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:e.startState(t),innerActive:null,inner:null}},copyState:function(n){return{outer:e.copyState(t,n.outer),innerActive:n.innerActive,inner:n.innerActive&&e.copyState(n.innerActive.mode,n.inner)}},token:function(i,o){if(o.innerActive){var a=o.innerActive,l=i.string;if(!a.close&&i.sol())return o.innerActive=o.inner=null,this.token(i,o);var s=a.close?n(l,a.close,i.pos,a.parseDelimiters):-1;if(s==i.pos&&!a.parseDelimiters)return i.match(a.close),o.innerActive=o.inner=null,a.delimStyle;s>-1&&(i.string=l.slice(0,s));var c=a.mode.token(i,o.inner);return s>-1&&(i.string=l),s==i.pos&&a.parseDelimiters&&(o.innerActive=o.inner=null),a.innerStyle&&(c=c?c+" "+a.innerStyle:a.innerStyle),c}for(var u=1/0,l=i.string,f=0;f<r.length;++f){var d=r[f],s=n(l,d.open,i.pos);if(s==i.pos)return d.parseDelimiters||i.match(d.open),o.innerActive=d,o.inner=e.startState(d.mode,t.indent?t.indent(o.outer,""):0),d.delimStyle;-1!=s&&u>s&&(u=s)}u!=1/0&&(i.string=l.slice(0,u));var p=t.token(i,o.outer);return u!=1/0&&(i.string=l),p},indent:function(n,r){var i=n.innerActive?n.innerActive.mode:t;return i.indent?i.indent(n.innerActive?n.inner:n.outer,r):e.Pass},blankLine:function(n){var i=n.innerActive?n.innerActive.mode:t;if(i.blankLine&&i.blankLine(n.innerActive?n.inner:n.outer),n.innerActive)"\n"===n.innerActive.close&&(n.innerActive=n.inner=null);else for(var o=0;o<r.length;++o){var a=r[o];"\n"===a.open&&(n.innerActive=a,n.inner=e.startState(a.mode,i.indent?i.indent(n.outer,""):0))}},electricChars:t.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:t}}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",o),e.removeLineClass(e.state.activeLines[t],"background",a)}function n(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function r(e,r){for(var i=[],l=0;l<r.length;l++){var s=r[l];if(s.empty()){var c=e.getLineHandleVisualStart(s.head.line);i[i.length-1]!=c&&i.push(c)}}n(e.state.activeLines,i)||e.operation(function(){t(e);for(var n=0;n<i.length;n++)e.addLineClass(i[n],"wrap",o),e.addLineClass(i[n],"background",a);e.state.activeLines=i})}function i(e,t){r(e,t.ranges)}var o="CodeMirror-activeline",a="CodeMirror-activeline-background";e.defineOption("styleActiveLine",!1,function(n,o,a){var l=a&&a!=e.Init;o&&!l?(n.state.activeLines=[],r(n,n.listSelections()),
-n.on("beforeSelectionChange",i)):!o&&l&&(n.off("beforeSelectionChange",i),t(n),delete n.state.activeLines)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,i,o){if(this.atOccurrence=!1,this.doc=e,null==o&&"string"==typeof t&&(o=!1),i=i?e.clipPos(i):r(0,0),this.pos={from:i,to:i},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(n,i){if(n){t.lastIndex=0;for(var o,a,l=e.getLine(i.line).slice(0,i.ch),s=0;;){t.lastIndex=s;var c=t.exec(l);if(!c)break;if(o=c,a=o.index,s=o.index+(o[0].length||1),s==l.length)break}var u=o&&o[0].length||0;u||(0==a&&0==l.length?o=void 0:a!=e.getLine(i.line).length&&u++)}else{t.lastIndex=i.ch;var l=e.getLine(i.line),o=t.exec(l),u=o&&o[0].length||0,a=o&&o.index;a+u==l.length||u||(u=1)}return o&&u?{from:r(i.line,a),to:r(i.line,a+u),match:o}:void 0};else{var a=t;o&&(t=t.toLowerCase());var l=o?function(e){return e.toLowerCase()}:function(e){return e},s=t.split("\n");if(1==s.length)this.matches=t.length?function(i,o){if(i){var s=e.getLine(o.line).slice(0,o.ch),c=l(s),u=c.lastIndexOf(t);if(u>-1)return u=n(s,c,u),{from:r(o.line,u),to:r(o.line,u+a.length)}}else{var s=e.getLine(o.line).slice(o.ch),c=l(s),u=c.indexOf(t);if(u>-1)return u=n(s,c,u)+o.ch,{from:r(o.line,u),to:r(o.line,u+a.length)}}}:function(){};else{var c=a.split("\n");this.matches=function(t,n){var i=s.length-1;if(t){if(n.line-(s.length-1)<e.firstLine())return;if(l(e.getLine(n.line).slice(0,c[i].length))!=s[s.length-1])return;for(var o=r(n.line,c[i].length),a=n.line-1,u=i-1;u>=1;--u,--a)if(s[u]!=l(e.getLine(a)))return;var f=e.getLine(a),d=f.length-c[0].length;if(l(f.slice(d))!=s[0])return;return{from:r(a,d),to:o}}if(!(n.line+(s.length-1)>e.lastLine())){var f=e.getLine(n.line),d=f.length-c[0].length;if(l(f.slice(d))==s[0]){for(var p=r(n.line,d),a=n.line+1,u=1;i>u;++u,++a)if(s[u]!=l(e.getLine(a)))return;if(l(e.getLine(a).slice(0,c[i].length))==s[i])return{from:p,to:r(a,c[i].length)}}}}}}}function n(e,t,n){if(e.length==t.length)return n;for(var r=Math.min(n,e.length);;){var i=e.slice(0,r).toLowerCase().length;if(n>i)++r;else{if(!(i>n))return r;--r}}}var r=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=r(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,i=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,i))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!i.line)return t(0);i=r(i.line-1,this.doc.getLine(i.line-1).length)}else{var o=this.doc.lineCount();if(i.line==o-1)return t(o);i=r(i.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(t,n){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,r){return new t(this.doc,e,n,r)}),e.defineDocExtension("getSearchCursor",function(e,n,r){return new t(this,e,n,r)}),e.defineExtension("selectMatches",function(t,n){for(var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);return n&&n.index==t.pos?(t.pos+=n[0].length,"searching"):void(n?t.pos=n.index:t.skipToEnd())}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function r(e){return e.state.search||(e.state.search=new n)}function i(e){return"string"==typeof e&&e==e.toLowerCase()}function o(e,t,n){return e.getSearchCursor(t,n,i(t))}function a(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0}):i(prompt(n,r))}function l(e,t,n,r){e.openConfirm?e.openConfirm(t,r):confirm(n)&&r[0]()}function s(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(n){}return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function c(e,n){var o=r(e);if(o.query)return u(e,n);var l=e.getSelection()||o.lastQuery;a(e,p,"Search for:",l,function(r){e.operation(function(){r&&!o.query&&(o.query=s(r),e.removeOverlay(o.overlay,i(o.query)),o.overlay=t(o.query,i(o.query)),e.addOverlay(o.overlay),e.showMatchesOnScrollbar&&(o.annotate&&(o.annotate.clear(),o.annotate=null),o.annotate=e.showMatchesOnScrollbar(o.query,i(o.query))),o.posFrom=o.posTo=e.getCursor(),u(e,n))})})}function u(t,n){t.operation(function(){var i=r(t),a=o(t,i.query,n?i.posFrom:i.posTo);(a.find(n)||(a=o(t,i.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),a.find(n)))&&(t.setSelection(a.from(),a.to()),t.scrollIntoView({from:a.from(),to:a.to()}),i.posFrom=a.from(),i.posTo=a.to())})}function f(e){e.operation(function(){var t=r(e);t.lastQuery=t.query,t.query&&(t.query=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}function d(e,t){if(!e.getOption("readOnly")){var n=e.getSelection()||r(e).lastQuery;a(e,h,"Replace:",n,function(n){n&&(n=s(n),a(e,m,"Replace with:","",function(r){if(t)e.operation(function(){for(var t=o(e,n);t.findNext();)if("string"!=typeof n){var i=e.getRange(t.from(),t.to()).match(n);t.replace(r.replace(/\$(\d)/g,function(e,t){return i[t]}),"+input")}else t.replace(r,"+input")});else{f(e);var i=o(e,n,e.getCursor()),a=function(){var t,r=i.from();!(t=i.findNext())&&(i=o(e,n),!(t=i.findNext())||r&&i.from().line==r.line&&i.from().ch==r.ch)||(e.setSelection(i.from(),i.to()),e.scrollIntoView({from:i.from(),to:i.to()}),l(e,g,"Replace?",[function(){s(t)},a]))},s=function(e){i.replace("string"==typeof n?r:r.replace(/\$(\d)/g,function(t,n){return e[n]}),"+input"),a()};a()}}))})}}var p='Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',h='Replace: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',m='With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',g="Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";e.commands.find=function(e){f(e),c(e)},e.commands.findNext=c,e.commands.findPrev=function(e){c(e,!0)},e.commands.clearSearch=f,e.commands.replace=d,e.commands.replaceAll=function(e){d(e,!0)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,r){this.cm=e,this.options=r;var i={listenForChanges:!1};for(var o in r)i[o]=r[o];i.className||(i.className="CodeMirror-search-match"),this.annotation=e.annotateScrollbar(i),this.query=t,this.caseFold=n,this.gap={from:e.firstLine(),to:e.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var a=this;e.on("change",this.changeHandler=function(e,t){a.onChange(t)})}function n(e,t,n){return t>=e?e:Math.max(t,e+n)}e.defineExtension("showMatchesOnScrollbar",function(e,n,r){return"string"==typeof r&&(r={className:r}),r||(r={}),new t(this,e,n,r)});var r=1e3;t.prototype.findMatches=function(){if(this.gap){for(var t=0;t<this.matches.length;t++){var n=this.matches[t];if(n.from.line>=this.gap.to)break;n.to.line>=this.gap.from&&this.matches.splice(t--,1)}for(var i=this.cm.getSearchCursor(this.query,e.Pos(this.gap.from,0),this.caseFold),o=this.options&&this.options.maxMatches||r;i.findNext();){var n={from:i.from(),to:i.to()};if(n.from.line>=this.gap.to)break;if(this.matches.splice(t++,0,n),this.matches.length>o)break}this.gap=null}},t.prototype.onChange=function(t){var r=t.from.line,i=e.changeEnd(t).line,o=i-t.to.line;if(this.gap?(this.gap.from=Math.min(n(this.gap.from,r,o),t.from.line),this.gap.to=Math.max(n(this.gap.to,r,o),t.from.line)):this.gap={from:t.from.line,to:i+1},o)for(var a=0;a<this.matches.length;a++){var l=this.matches[a],s=n(l.from.line,r,o);s!=l.from.line&&(l.from=e.Pos(s,l.from.ch));var c=n(l.to.line,r,o);c!=l.to.line&&(l.to=e.Pos(c,l.to.ch))}clearTimeout(this.update);var u=this;this.update=setTimeout(function(){u.updateAfterChange()},250)},t.prototype.updateAfterChange=function(){this.findMatches(),this.annotation.update(this.matches)},t.prototype.clear=function(){this.cm.off("change",this.changeHandler),this.annotation.clear()}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){"object"==typeof e&&(this.minChars=e.minChars,this.style=e.style,this.showToken=e.showToken,this.delay=e.delay,this.wordsOnly=e.wordsOnly),null==this.style&&(this.style=s),null==this.minChars&&(this.minChars=l),null==this.delay&&(this.delay=c),null==this.wordsOnly&&(this.wordsOnly=u),this.overlay=this.timeout=null}function n(e){var t=e.state.matchHighlighter;clearTimeout(t.timeout),t.timeout=setTimeout(function(){r(e)},t.delay)}function r(e){e.operation(function(){var t=e.state.matchHighlighter;if(t.overlay&&(e.removeOverlay(t.overlay),t.overlay=null),!e.somethingSelected()&&t.showToken){for(var n=t.showToken===!0?/[\w$]/:t.showToken,r=e.getCursor(),o=e.getLine(r.line),l=r.ch,s=l;l&&n.test(o.charAt(l-1));)--l;for(;s<o.length&&n.test(o.charAt(s));)++s;return void(s>l&&e.addOverlay(t.overlay=a(o.slice(l,s),n,t.style)))}var c=e.getCursor("from"),u=e.getCursor("to");if(c.line==u.line&&(!t.wordsOnly||i(e,c,u))){var f=e.getRange(c,u).replace(/^\s+|\s+$/g,"");f.length>=t.minChars&&e.addOverlay(t.overlay=a(f,!1,t.style))}})}function i(e,t,n){var r=e.getRange(t,n);if(null!==r.match(/^\w+$/)){if(t.ch>0){var i={line:t.line,ch:t.ch-1},o=e.getRange(i,t);if(null===o.match(/\W/))return!1}if(n.ch<e.getLine(t.line).length){var i={line:n.line,ch:n.ch+1},o=e.getRange(n,i);if(null===o.match(/\W/))return!1}return!0}return!1}function o(e,t){return!(e.start&&t.test(e.string.charAt(e.start-1))||e.pos!=e.string.length&&t.test(e.string.charAt(e.pos)))}function a(e,t,n){return{token:function(r){return!r.match(e)||t&&!o(r,t)?(r.next(),void(r.skipTo(e.charAt(0))||r.skipToEnd())):n}}}var l=2,s="matchhighlight",c=100,u=!1;e.defineOption("highlightSelectionMatches",!1,function(i,o,a){if(a&&a!=e.Init){var l=i.state.matchHighlighter.overlay;l&&i.removeOverlay(l),clearTimeout(i.state.matchHighlighter.timeout),i.state.matchHighlighter=null,i.off("cursorActivity",n)}o&&(i.state.matchHighlighter=new t(o),r(i),i.on("cursorActivity",n))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n,r){function i(t){var n=e.wheelEventPixels(t)["horizontal"==o.orientation?"x":"y"],r=o.pos;o.moveTo(o.pos+n),o.pos!=r&&e.e_preventDefault(t)}this.orientation=n,this.scroll=r,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=t+"-"+n,this.inner=this.node.appendChild(document.createElement("div"));var o=this;e.on(this.inner,"mousedown",function(t){function n(){e.off(document,"mousemove",r),e.off(document,"mouseup",n)}function r(e){return 1!=e.which?n():void o.moveTo(l+(e[i]-a)*(o.total/o.size))}if(1==t.which){e.e_preventDefault(t);var i="horizontal"==o.orientation?"pageX":"pageY",a=t[i],l=o.pos;e.on(document,"mousemove",r),e.on(document,"mouseup",n)}}),e.on(this.node,"click",function(t){e.e_preventDefault(t);var n,r=o.inner.getBoundingClientRect();n="horizontal"==o.orientation?t.clientX<r.left?-1:t.clientX>r.right?1:0:t.clientY<r.top?-1:t.clientY>r.bottom?1:0,o.moveTo(o.pos+n*o.screen)}),e.on(this.node,"mousewheel",i),e.on(this.node,"DOMMouseScroll",i)}function n(e,n,r){this.addClass=e,this.horiz=new t(e,"horizontal",r),n(this.horiz.node),this.vert=new t(e,"vertical",r),n(this.vert.node),this.width=null}t.prototype.moveTo=function(e,t){0>e&&(e=0),e>this.total-this.screen&&(e=this.total-this.screen),e!=this.pos&&(this.pos=e,this.inner.style["horizontal"==this.orientation?"left":"top"]=e*(this.size/this.total)+"px",t!==!1&&this.scroll(e,this.orientation))};var r=10;t.prototype.update=function(e,t,n){this.screen=t,this.total=e,this.size=n;var i=this.screen*(this.size/this.total);r>i&&(this.size-=r-i,i=r),this.inner.style["horizontal"==this.orientation?"width":"height"]=i+"px",this.inner.style["horizontal"==this.orientation?"left":"top"]=this.pos*(this.size/this.total)+"px"},n.prototype.update=function(e){if(null==this.width){var t=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;t&&(this.width=parseInt(t.height))}var n=this.width||0,r=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1;return this.vert.node.style.display=i?"block":"none",this.horiz.node.style.display=r?"block":"none",i&&(this.vert.update(e.scrollHeight,e.clientHeight,e.viewHeight-(r?n:0)),this.vert.node.style.display="block",this.vert.node.style.bottom=r?n+"px":"0"),r&&(this.horiz.update(e.scrollWidth,e.clientWidth,e.viewWidth-(i?n:0)-e.barLeft),this.horiz.node.style.right=i?n+"px":"0",this.horiz.node.style.left=e.barLeft+"px"),{right:i?n:0,bottom:r?n:0}},n.prototype.setScrollTop=function(e){this.vert.moveTo(e,!1)},n.prototype.setScrollLeft=function(e){this.horiz.moveTo(e,!1)},n.prototype.clear=function(){var e=this.horiz.node.parentNode;e.removeChild(this.horiz.node),e.removeChild(this.vert.node)},e.scrollbarModel.simple=function(e,t){return new n("CodeMirror-simplescroll",e,t)},e.scrollbarModel.overlay=function(e,t){return new n("CodeMirror-overlayscroll",e,t)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){function n(e){clearTimeout(r.doRedraw),r.doRedraw=setTimeout(function(){r.redraw()},e)}this.cm=e,this.options=t,this.buttonHeight=t.scrollButtonHeight||e.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=e.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var r=this;e.on("refresh",this.resizeHandler=function(){clearTimeout(r.doUpdate),r.doUpdate=setTimeout(function(){r.computeScale()&&n(20)},100)}),e.on("markerAdded",this.resizeHandler),e.on("markerCleared",this.resizeHandler),t.listenForChanges!==!1&&e.on("change",this.changeHandler=function(){n(250)})}e.defineExtension("annotateScrollbar",function(e){return"string"==typeof e&&(e={className:e}),new t(this,e)}),e.defineOption("scrollButtonHeight",0),t.prototype.computeScale=function(){var e=this.cm,t=(e.getWrapperElement().clientHeight-e.display.barHeight-2*this.buttonHeight)/e.heightAtLine(e.lastLine()+1,"local");return t!=this.hScale?(this.hScale=t,!0):void 0},t.prototype.update=function(e){this.annotations=e,this.redraw()},t.prototype.redraw=function(e){function t(e,t){if(s!=e.line&&(s=e.line,c=n.getLineHandle(s)),a&&c.height>l)return n.charCoords(e,"local")[t?"top":"bottom"];var r=n.heightAtLine(c,"local");return r+(t?0:c.height)}e!==!1&&this.computeScale();var n=this.cm,r=this.hScale,i=document.createDocumentFragment(),o=this.annotations,a=n.getOption("lineWrapping"),l=a&&1.5*n.defaultTextHeight(),s=null,c=null;if(n.display.barWidth)for(var u,f=0;f<o.length;f++){for(var d=o[f],p=u||t(d.from,!0)*r,h=t(d.to,!1)*r;f<o.length-1&&(u=t(o[f+1].from,!0)*r,!(u>h+.9));)d=o[++f],h=t(d.to,!1)*r;if(h!=p){var m=Math.max(h-p,3),g=i.appendChild(document.createElement("div"));g.style.cssText="position: absolute; right: 0px; width: "+Math.max(1.5*n.display.barWidth,2)+"px; top: "+(p+this.buttonHeight)+"px; height: "+m+"px",g.className=this.options.className}}this.div.textContent="",this.div.appendChild(i)},t.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("change",this.changeHandler),this.div.parentNode.removeChild(this.div)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n,r){this.cm=e,this.node=t,this.options=n,this.height=r,this.cleared=!1}function n(e){var t=e.getWrapperElement(),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r=parseInt(n.height),i=e.state.panels={setHeight:t.style.height,heightLeft:r,panels:0,wrapper:document.createElement("div")};t.parentNode.insertBefore(i.wrapper,t);var o=e.hasFocus();i.wrapper.appendChild(t),o&&e.focus(),e._setSize=e.setSize,null!=r&&(e.setSize=function(t,n){if(null==n)return this._setSize(t,n);if(i.setHeight=n,"number"!=typeof n){var o=/^(\d+\.?\d*)px$/.exec(n);o?n=Number(o[1]):(i.wrapper.style.height=n,n=i.wrapper.offsetHeight,i.wrapper.style.height="")}e._setSize(t,i.heightLeft+=n-r),r=n})}function r(e){var t=e.state.panels;e.state.panels=null;var n=e.getWrapperElement();t.wrapper.parentNode.replaceChild(n,t.wrapper),n.style.height=t.setHeight,e.setSize=e._setSize,e.setSize()}e.defineExtension("addPanel",function(e,r){r=r||{},this.state.panels||n(this);var i=this.state.panels,o=i.wrapper,a=this.getWrapperElement();r.after instanceof t&&!r.after.cleared?o.insertBefore(e,r.before.node.nextSibling):r.before instanceof t&&!r.before.cleared?o.insertBefore(e,r.before.node):r.replace instanceof t&&!r.replace.cleared?(o.insertBefore(e,r.replace.node),r.replace.clear()):"bottom"==r.position?o.appendChild(e):"before-bottom"==r.position?o.insertBefore(e,a.nextSibling):"after-top"==r.position?o.insertBefore(e,a):o.insertBefore(e,o.firstChild);var l=r&&r.height||e.offsetHeight;return this._setSize(null,i.heightLeft-=l),i.panels++,new t(this,e,r,l)}),t.prototype.clear=function(){if(!this.cleared){this.cleared=!0;var e=this.cm.state.panels;this.cm._setSize(null,e.heightLeft+=this.height),e.wrapper.removeChild(this.node),0==--e.panels&&r(this.cm)}},t.prototype.changed=function(e){var t=null==e?this.node.offsetHeight:e,n=this.cm.state.panels;this.cm._setSize(null,n.height+=t-this.height),this.height=t}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.className="CodeMirror-placeholder",n.appendChild(document.createTextNode(e.getOption("placeholder"))),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){o(e)&&n(e)}function i(e){var r=e.getWrapperElement(),i=o(e);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?n(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",function(n,o,a){var l=a&&a!=e.Init;if(o&&!l)n.on("blur",r),n.on("change",i),i(n);else if(!o&&l){n.off("blur",r),n.off("change",i),t(n);var s=n.getWrapperElement();s.className=s.className.replace(" CodeMirror-empty","")}o&&!n.hasFocus()&&r(n)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n){var r,i=e.getWrapperElement();return r=i.appendChild(document.createElement("div")),r.className=n?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?r.innerHTML=t:r.appendChild(t),r}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",function(r,i,o){function a(e){if("string"==typeof e)f.value=e;else{if(c)return;c=!0,s.parentNode.removeChild(s),u.focus(),o.onClose&&o.onClose(s)}}o||(o={}),n(this,null);var l,s=t(this,r,o.bottom),c=!1,u=this,f=s.getElementsByTagName("input")[0];return f?(o.value&&(f.value=o.value,o.selectValueOnOpen!==!1&&f.select()),o.onInput&&e.on(f,"input",function(e){o.onInput(e,f.value,a)}),o.onKeyUp&&e.on(f,"keyup",function(e){o.onKeyUp(e,f.value,a)}),e.on(f,"keydown",function(t){o&&o.onKeyDown&&o.onKeyDown(t,f.value,a)||((27==t.keyCode||o.closeOnEnter!==!1&&13==t.keyCode)&&(f.blur(),e.e_stop(t),a()),13==t.keyCode&&i(f.value,t))}),o.closeOnBlur!==!1&&e.on(f,"blur",a),f.focus()):(l=s.getElementsByTagName("button")[0])&&(e.on(l,"click",function(){a(),u.focus()}),o.closeOnBlur!==!1&&e.on(l,"blur",a),l.focus()),a}),e.defineExtension("openConfirm",function(r,i,o){function a(){c||(c=!0,l.parentNode.removeChild(l),u.focus())}n(this,null);var l=t(this,r,o&&o.bottom),s=l.getElementsByTagName("button"),c=!1,u=this,f=1;s[0].focus();for(var d=0;d<s.length;++d){var p=s[d];!function(t){e.on(p,"click",function(n){e.e_preventDefault(n),a(),t&&t(u)})}(i[d]),e.on(p,"blur",function(){--f,setTimeout(function(){0>=f&&a()},200)}),e.on(p,"focus",function(){++f})}}),e.defineExtension("openNotification",function(r,i){function o(){s||(s=!0,clearTimeout(a),l.parentNode.removeChild(l))}n(this,o);var a,l=t(this,r,i&&i.bottom),s=!1,c=i&&"undefined"!=typeof i.duration?i.duration:5e3;return e.on(l,"click",function(t){e.e_preventDefault(t),o()}),c&&(a=setTimeout(o,c)),o})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,r,i){var o=e.getLineHandle(t.line),s=t.ch-1,c=s>=0&&l[o.text.charAt(s)]||l[o.text.charAt(++s)];if(!c)return null;var u=">"==c.charAt(1)?1:-1;if(r&&u>0!=(s==t.ch))return null;var f=e.getTokenTypeAt(a(t.line,s+1)),d=n(e,a(t.line,s+(u>0?1:0)),u,f||null,i);return null==d?null:{from:a(t.line,s),to:d&&d.pos,match:d&&d.ch==c.charAt(0),forward:u>0}}function n(e,t,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,s=i&&i.maxScanLines||1e3,c=[],u=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,f=n>0?Math.min(t.line+s,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-s),d=t.line;d!=f;d+=n){var p=e.getLine(d);if(p){var h=n>0?0:p.length-1,m=n>0?p.length:-1;if(!(p.length>o))for(d==t.line&&(h=t.ch-(0>n?1:0));h!=m;h+=n){var g=p.charAt(h);if(u.test(g)&&(void 0===r||e.getTokenTypeAt(a(d,h+1))==r)){var v=l[g];if(">"==v.charAt(1)==n>0)c.push(g);else{if(!c.length)return{pos:a(d,h),ch:g};c.pop()}}}}}return d-n==(n>0?e.lastLine():e.firstLine())?!1:null}function r(e,n,r){for(var i=e.state.matchBrackets.maxHighlightLineLength||1e3,l=[],s=e.listSelections(),c=0;c<s.length;c++){var u=s[c].empty()&&t(e,s[c].head,!1,r);if(u&&e.getLine(u.from.line).length<=i){var f=u.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";l.push(e.markText(u.from,a(u.from.line,u.from.ch+1),{className:f})),u.to&&e.getLine(u.to.line).length<=i&&l.push(e.markText(u.to,a(u.to.line,u.to.ch+1),{className:f}))}}if(l.length){o&&e.state.focused&&e.focus();var d=function(){e.operation(function(){for(var e=0;e<l.length;e++)l[e].clear()})};if(!n)return d;setTimeout(d,800)}}function i(e){e.operation(function(){s&&(s(),s=null),s=r(e,!1,e.state.matchBrackets)})}var o=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),a=e.Pos,l={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},s=null;e.defineOption("matchBrackets",!1,function(t,n,r){r&&r!=e.Init&&t.off("cursorActivity",i),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",i))}),e.defineExtension("matchBrackets",function(){r(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,r){return t(this,e,n,r)}),e.defineExtension("scanForBracket",function(e,t,r,i){return n(this,e,t,r,i)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:u[t]}function n(e){return function(t){return a(t,e)}}function r(e){var t=e.state.closeBrackets;if(!t)return null;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function i(n){var i=r(n);if(!i||n.getOption("disableInput"))return e.Pass;for(var o=t(i,"pairs"),a=n.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return e.Pass;var c=s(n,a[l].head);if(!c||o.indexOf(c)%2!=0)return e.Pass}for(var l=a.length-1;l>=0;l--){var u=a[l].head;n.replaceRange("",f(u.line,u.ch-1),f(u.line,u.ch+1),"+delete")}}function o(n){var i=r(n),o=i&&t(i,"explode");if(!o||n.getOption("disableInput"))return e.Pass;for(var a=n.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return e.Pass;var c=s(n,a[l].head);if(!c||o.indexOf(c)%2!=0)return e.Pass}n.operation(function(){n.replaceSelection("\n\n",null,"+input"),n.execCommand("goCharLeft"),a=n.listSelections();for(var e=0;e<a.length;e++){var t=a[e].head.line;n.indentLine(t,null,!0),n.indentLine(t+1,null,!0)}})}function a(n,i){var o=r(n);if(!o||n.getOption("disableInput"))return e.Pass;var a=t(o,"pairs"),s=a.indexOf(i);if(-1==s)return e.Pass;for(var u,d,p=t(o,"triples"),h=a.charAt(s+1)==i,m=n.listSelections(),g=s%2==0,v=0;v<m.length;v++){var y,b=m[v],x=b.head,d=n.getRange(x,f(x.line,x.ch+1));if(g&&!b.empty())y="surround";else if(!h&&g||d!=i)if(h&&x.ch>1&&p.indexOf(i)>=0&&n.getRange(f(x.line,x.ch-2),x)==i+i&&(x.ch<=2||n.getRange(f(x.line,x.ch-3),f(x.line,x.ch-2))!=i))y="addFour";else if(h){if(e.isWordChar(d)||!c(n,x,i))return e.Pass;y="both"}else{if(!g||n.getLine(x.line).length!=x.ch&&!l(d,a)&&!/\s/.test(d))return e.Pass;y="both"}else y=p.indexOf(i)>=0&&n.getRange(x,f(x.line,x.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=y)return e.Pass}else u=y}var _=s%2?a.charAt(s-1):i,k=s%2?i:a.charAt(s+1);n.operation(function(){if("skip"==u)n.execCommand("goCharRight");else if("skipThree"==u)for(var e=0;3>e;e++)n.execCommand("goCharRight");else if("surround"==u){for(var t=n.getSelections(),e=0;e<t.length;e++)t[e]=_+t[e]+k;n.replaceSelections(t,"around","+input")}else"both"==u?(n.replaceSelection(_+k,null,"+input"),n.triggerElectric(_+k),n.execCommand("goCharLeft")):"addFour"==u&&(n.replaceSelection(_+_+_+_,"before","+input"),n.execCommand("goCharRight"))})}function l(e,t){var n=t.lastIndexOf(e);return n>-1&&n%2==1}function s(e,t){var n=e.getRange(f(t.line,t.ch-1),f(t.line,t.ch+1));return 2==n.length?n:null}function c(t,n,r){var i=t.getLine(n.line),o=t.getTokenAt(n);if(/\bstring2?\b/.test(o.type))return!1;var a=new e.StringStream(i.slice(0,n.ch)+r+i.slice(n.ch),4);for(a.pos=a.start=o.start;;){var l=t.getMode().token(a,o.state);if(a.pos>=n.ch+1)return/\bstring2?\b/.test(l);a.start=a.pos}}var u={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},f=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.removeKeyMap(p),t.state.closeBrackets=null),n&&(t.state.closeBrackets=n,t.addKeyMap(p))});for(var d=u.pairs+"`",p={Backspace:i,Enter:o},h=0;h<d.length;h++)p["'"+d.charAt(h)+"'"]=n(d.charAt(h))}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(n){n.state.failedTagMatch=!1,n.operation(function(){if(t(n),!n.somethingSelected()){var r=n.getCursor(),i=n.getViewport();i.from=Math.min(i.from,r.line),i.to=Math.max(r.line+1,i.to);var o=e.findMatchingTag(n,r,i);if(o){if(n.state.matchBothTags){var a="open"==o.at?o.open:o.close;a&&(n.state.tagHit=n.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}))}var l="close"==o.at?o.open:o.close;l?n.state.tagOther=n.markText(l.from,l.to,{className:"CodeMirror-matchingtag"}):n.state.failedTagMatch=!0}}})}function r(e){e.state.failedTagMatch&&n(e)}e.defineOption("matchTags",!1,function(i,o,a){a&&a!=e.Init&&(i.off("cursorActivity",n),i.off("viewportChange",r),t(i)),o&&(i.state.matchBothTags="object"==typeof o&&o.bothTags,i.on("cursorActivity",n),i.on("viewportChange",r),n(i))}),e.commands.toMatchingTag=function(t){var n=e.findMatchingTag(t,t.getCursor());if(n){var r="close"==n.at?n.open:n.close;r&&t.extendSelection(r.to,r.from)}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var n=t.listSelections(),r=[],s=0;s<n.length;s++){if(!n[s].empty())return e.Pass;var c=n[s].head,u=t.getTokenAt(c),f=e.innerMode(t.getMode(),u.state),d=f.state;if("xml"!=f.mode.name||!d.tagName)return e.Pass;var p=t.getOption("autoCloseTags"),h="html"==f.mode.configuration,m="object"==typeof p&&p.dontCloseTags||h&&a,g="object"==typeof p&&p.indentTags||h&&l,v=d.tagName;u.end>c.ch&&(v=v.slice(0,v.length-u.end+c.ch));var y=v.toLowerCase();if(!v||"string"==u.type&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==d.type||u.string.indexOf("/")==u.string.length-1||m&&i(m,y)>-1||o(t,v,c,d,!0))return e.Pass;var b=g&&i(g,y)>-1;r[s]={indent:b,text:">"+(b?"\n\n":"")+"</"+v+">",newPos:b?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var s=n.length-1;s>=0;s--){var x=r[s];t.replaceRange(x.text,n[s].head,n[s].anchor,"+insert");var _=t.listSelections().slice(0);_[s]={head:x.newPos,anchor:x.newPos},t.setSelections(_),x.indent&&(t.indentLine(x.newPos.line,null,!0),t.indentLine(x.newPos.line+1,null,!0))}}function n(t,n){for(var r=t.listSelections(),i=[],a=n?"/":"</",l=0;l<r.length;l++){if(!r[l].empty())return e.Pass;var s=r[l].head,c=t.getTokenAt(s),u=e.innerMode(t.getMode(),c.state),f=u.state;if(n&&("string"==c.type||"<"!=c.string.charAt(0)||c.start!=s.ch-1))return e.Pass;if("xml"!=u.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==u.mode.name)i[l]=a+"script>";else{if("htmlmixed"!=t.getMode().name||"css"!=u.mode.name)return e.Pass;i[l]=a+"style>"}else{if(!f.context||!f.context.tagName||o(t,f.context.tagName,s,f))return e.Pass;i[l]=a+f.context.tagName+">"}}t.replaceSelections(i,null,"+input"),r=t.listSelections();for(var l=0;l<r.length;l++)(l==r.length-1||r[l].head.line<r[l+1].head.line)&&t.indentLine(r[l].head.line)}function r(t){return t.getOption("disableInput")?e.Pass:n(t,!0)}function i(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;r>n;++n)if(e[n]==t)return n;return-1}function o(t,n,r,i,o){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,r.line+500),l=e.scanForClosingTag(t,r,null,a);if(!l||l.tag!=n)return!1;
+}}if(l.length){o&&e.state.focused&&e.focus();var f=function(){e.operation(function(){for(var e=0;e<l.length;e++)l[e].clear()})};if(!n)return f;setTimeout(f,800)}}function i(e){e.operation(function(){s&&(s(),s=null),s=r(e,!1,e.state.matchBrackets)})}var o=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),a=e.Pos,l={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},s=null;e.defineOption("matchBrackets",!1,function(t,n,r){r&&r!=e.Init&&t.off("cursorActivity",i),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",i))}),e.defineExtension("matchBrackets",function(){r(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,r){return t(this,e,n,r)}),e.defineExtension("scanForBracket",function(e,t,r,i){return n(this,e,t,r,i)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:d[t]}function n(e){return function(t){return l(t,e)}}function r(e){var t=e.state.closeBrackets;if(!t)return null;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function i(n){var i=r(n);if(!i||n.getOption("disableInput"))return e.Pass;for(var o=t(i,"pairs"),a=n.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return e.Pass;var s=c(n,a[l].head);if(!s||o.indexOf(s)%2!=0)return e.Pass}for(var l=a.length-1;l>=0;l--){var u=a[l].head;n.replaceRange("",f(u.line,u.ch-1),f(u.line,u.ch+1),"+delete")}}function o(n){var i=r(n),o=i&&t(i,"explode");if(!o||n.getOption("disableInput"))return e.Pass;for(var a=n.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return e.Pass;var s=c(n,a[l].head);if(!s||o.indexOf(s)%2!=0)return e.Pass}n.operation(function(){n.replaceSelection("\n\n",null),n.execCommand("goCharLeft"),a=n.listSelections();for(var e=0;e<a.length;e++){var t=a[e].head.line;n.indentLine(t,null,!0),n.indentLine(t+1,null,!0)}})}function a(t){var n=e.cmpPos(t.anchor,t.head)>0;return{anchor:new f(t.anchor.line,t.anchor.ch+(n?-1:1)),head:new f(t.head.line,t.head.ch+(n?1:-1))}}function l(n,i){var o=r(n);if(!o||n.getOption("disableInput"))return e.Pass;var l=t(o,"pairs"),c=l.indexOf(i);if(-1==c)return e.Pass;for(var d,p,h=t(o,"triples"),m=l.charAt(c+1)==i,g=n.listSelections(),v=c%2==0,y=0;y<g.length;y++){var b,x=g[y],k=x.head,p=n.getRange(k,f(k.line,k.ch+1));if(v&&!x.empty())b="surround";else if(!m&&v||p!=i)if(m&&k.ch>1&&h.indexOf(i)>=0&&n.getRange(f(k.line,k.ch-2),k)==i+i&&(k.ch<=2||n.getRange(f(k.line,k.ch-3),f(k.line,k.ch-2))!=i))b="addFour";else if(m){if(e.isWordChar(p)||!u(n,k,i))return e.Pass;b="both"}else{if(!v||n.getLine(k.line).length!=k.ch&&!s(p,l)&&!/\s/.test(p))return e.Pass;b="both"}else b=h.indexOf(i)>=0&&n.getRange(k,f(k.line,k.ch+3))==i+i+i?"skipThree":"skip";if(d){if(d!=b)return e.Pass}else d=b}var _=c%2?l.charAt(c-1):i,w=c%2?i:l.charAt(c+1);n.operation(function(){if("skip"==d)n.execCommand("goCharRight");else if("skipThree"==d)for(var e=0;3>e;e++)n.execCommand("goCharRight");else if("surround"==d){for(var t=n.getSelections(),e=0;e<t.length;e++)t[e]=_+t[e]+w;n.replaceSelections(t,"around"),t=n.listSelections().slice();for(var e=0;e<t.length;e++)t[e]=a(t[e]);n.setSelections(t)}else"both"==d?(n.replaceSelection(_+w,null),n.triggerElectric(_+w),n.execCommand("goCharLeft")):"addFour"==d&&(n.replaceSelection(_+_+_+_,"before"),n.execCommand("goCharRight"))})}function s(e,t){var n=t.lastIndexOf(e);return n>-1&&n%2==1}function c(e,t){var n=e.getRange(f(t.line,t.ch-1),f(t.line,t.ch+1));return 2==n.length?n:null}function u(t,n,r){var i=t.getLine(n.line),o=t.getTokenAt(n);if(/\bstring2?\b/.test(o.type))return!1;var a=new e.StringStream(i.slice(0,n.ch)+r+i.slice(n.ch),4);for(a.pos=a.start=o.start;;){var l=t.getMode().token(a,o.state);if(a.pos>=n.ch+1)return/\bstring2?\b/.test(l);a.start=a.pos}}var d={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},f=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.removeKeyMap(h),t.state.closeBrackets=null),n&&(t.state.closeBrackets=n,t.addKeyMap(h))});for(var p=d.pairs+"`",h={Backspace:i,Enter:o},m=0;m<p.length;m++)h["'"+p.charAt(m)+"'"]=n(p.charAt(m))}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(n){n.state.failedTagMatch=!1,n.operation(function(){if(t(n),!n.somethingSelected()){var r=n.getCursor(),i=n.getViewport();i.from=Math.min(i.from,r.line),i.to=Math.max(r.line+1,i.to);var o=e.findMatchingTag(n,r,i);if(o){if(n.state.matchBothTags){var a="open"==o.at?o.open:o.close;a&&(n.state.tagHit=n.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}))}var l="close"==o.at?o.open:o.close;l?n.state.tagOther=n.markText(l.from,l.to,{className:"CodeMirror-matchingtag"}):n.state.failedTagMatch=!0}}})}function r(e){e.state.failedTagMatch&&n(e)}e.defineOption("matchTags",!1,function(i,o,a){a&&a!=e.Init&&(i.off("cursorActivity",n),i.off("viewportChange",r),t(i)),o&&(i.state.matchBothTags="object"==typeof o&&o.bothTags,i.on("cursorActivity",n),i.on("viewportChange",r),n(i))}),e.commands.toMatchingTag=function(t){var n=e.findMatchingTag(t,t.getCursor());if(n){var r="close"==n.at?n.open:n.close;r&&t.extendSelection(r.to,r.from)}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var n=t.listSelections(),r=[],s=0;s<n.length;s++){if(!n[s].empty())return e.Pass;var c=n[s].head,u=t.getTokenAt(c),d=e.innerMode(t.getMode(),u.state),f=d.state;if("xml"!=d.mode.name||!f.tagName)return e.Pass;var p=t.getOption("autoCloseTags"),h="html"==d.mode.configuration,m="object"==typeof p&&p.dontCloseTags||h&&a,g="object"==typeof p&&p.indentTags||h&&l,v=f.tagName;u.end>c.ch&&(v=v.slice(0,v.length-u.end+c.ch));var y=v.toLowerCase();if(!v||"string"==u.type&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==f.type||u.string.indexOf("/")==u.string.length-1||m&&i(m,y)>-1||o(t,v,c,f,!0))return e.Pass;var b=g&&i(g,y)>-1;r[s]={indent:b,text:">"+(b?"\n\n":"")+"</"+v+">",newPos:b?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var s=n.length-1;s>=0;s--){var x=r[s];t.replaceRange(x.text,n[s].head,n[s].anchor,"+insert");var k=t.listSelections().slice(0);k[s]={head:x.newPos,anchor:x.newPos},t.setSelections(k),x.indent&&(t.indentLine(x.newPos.line,null,!0),t.indentLine(x.newPos.line+1,null,!0))}}function n(t,n){for(var r=t.listSelections(),i=[],a=n?"/":"</",l=0;l<r.length;l++){if(!r[l].empty())return e.Pass;var s=r[l].head,c=t.getTokenAt(s),u=e.innerMode(t.getMode(),c.state),d=u.state;if(n&&("string"==c.type||"<"!=c.string.charAt(0)||c.start!=s.ch-1))return e.Pass;var f;if("xml"!=u.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==u.mode.name)f=a+"script";else{if("htmlmixed"!=t.getMode().name||"css"!=u.mode.name)return e.Pass;f=a+"style"}else{if(!d.context||!d.context.tagName||o(t,d.context.tagName,s,d))return e.Pass;f=a+d.context.tagName}">"!=t.getLine(s.line).charAt(c.end)&&(f+=">"),i[l]=f}t.replaceSelections(i),r=t.listSelections();for(var l=0;l<r.length;l++)(l==r.length-1||r[l].head.line<r[l+1].head.line)&&t.indentLine(r[l].head.line)}function r(t){return t.getOption("disableInput")?e.Pass:n(t,!0)}function i(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;r>n;++n)if(e[n]==t)return n;return-1}function o(t,n,r,i,o){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,r.line+500),l=e.scanForClosingTag(t,r,null,a);if(!l||l.tag!=n)return!1;for(var s=i.context,c=o?1:0;s&&s.tagName==n;s=s.prev)++c;r=l.to;for(var u=1;c>u;u++){var d=e.scanForClosingTag(t,r,null,a);if(!d||d.tag!=n)return!1;r=d.to}return!0}e.defineOption("autoCloseTags",!1,function(n,i,o){if(o!=e.Init&&o&&n.removeKeyMap("autoCloseTags"),i){var a={name:"autoCloseTags"};("object"!=typeof i||i.whenClosing)&&(a["'/'"]=function(e){return r(e)}),("object"!=typeof i||i.whenOpening)&&(a["'>'"]=function(e){return t(e)}),n.addKeyMap(a)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],l=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return n(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t=/^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,n=/^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,r=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(i){if(i.getOption("disableInput"))return e.Pass;for(var o=i.listSelections(),a=[],l=0;l<o.length;l++){var s=o[l].head,c=i.getStateAfter(s.line),u=c.list!==!1,d=0!==c.quote,f=i.getLine(s.line),p=t.exec(f);if(!o[l].empty()||!u&&!d||!p)return void i.execCommand("newlineAndIndent");if(n.test(f))i.replaceRange("",{line:s.line,ch:0},{line:s.line,ch:s.ch+1}),a[l]="\n";else{var h=p[1],m=p[5],g=r.test(p[2])||p[2].indexOf(">")>=0?p[2]:parseInt(p[3],10)+1+p[4];a[l]="\n"+h+g+m}}i.replaceSelections(a)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.search(r);return-1==t?0:t}var n={},r=/[^\s\u00a0]/,i=e.Pos;e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e||(e=n);for(var t=this,r=1/0,o=this.listSelections(),a=null,l=o.length-1;l>=0;l--){var s=o[l].from(),c=o[l].to();s.line>=r||(c.line>=r&&(c=i(r,0)),r=s.line,null==a?t.uncomment(s,c,e)?a="un":(t.lineComment(s,c,e),a="line"):"un"==a?t.uncomment(s,c,e):t.lineComment(s,c,e))}}),e.defineExtension("lineComment",function(e,o,a){a||(a=n);var l=this,s=l.getModeAt(e),c=a.lineComment||s.lineComment;if(!c)return void((a.blockCommentStart||s.blockCommentStart)&&(a.fullLines=!0,l.blockComment(e,o,a)));var u=l.getLine(e.line);if(null!=u){var d=Math.min(0!=o.ch||o.line==e.line?o.line+1:o.line,l.lastLine()+1),f=null==a.padding?" ":a.padding,p=a.commentBlankLines||e.line==o.line;l.operation(function(){if(a.indent){for(var n=null,o=e.line;d>o;++o){var s=l.getLine(o),u=s.slice(0,t(s));(null==n||n.length>u.length)&&(n=u)}for(var o=e.line;d>o;++o){var s=l.getLine(o),h=n.length;(p||r.test(s))&&(s.slice(0,h)!=n&&(h=t(s)),l.replaceRange(n+c+f,i(o,0),i(o,h)))}}else for(var o=e.line;d>o;++o)(p||r.test(l.getLine(o)))&&l.replaceRange(c+f,i(o,0))})}}),e.defineExtension("blockComment",function(e,t,o){o||(o=n);var a=this,l=a.getModeAt(e),s=o.blockCommentStart||l.blockCommentStart,c=o.blockCommentEnd||l.blockCommentEnd;if(!s||!c)return void((o.lineComment||l.lineComment)&&0!=o.fullLines&&a.lineComment(e,t,o));var u=Math.min(t.line,a.lastLine());u!=e.line&&0==t.ch&&r.test(a.getLine(u))&&--u;var d=null==o.padding?" ":o.padding;e.line>u||a.operation(function(){if(0!=o.fullLines){var n=r.test(a.getLine(u));a.replaceRange(d+c,i(u)),a.replaceRange(s+d,i(e.line,0));var f=o.blockCommentLead||l.blockCommentLead;if(null!=f)for(var p=e.line+1;u>=p;++p)(p!=u||n)&&a.replaceRange(f+d,i(p,0))}else a.replaceRange(c,t),a.replaceRange(s,e)})}),e.defineExtension("uncomment",function(e,t,o){o||(o=n);var a,l=this,s=l.getModeAt(e),c=Math.min(0!=t.ch||t.line==e.line?t.line:t.line-1,l.lastLine()),u=Math.min(e.line,c),d=o.lineComment||s.lineComment,f=[],p=null==o.padding?" ":o.padding;e:if(d){for(var h=u;c>=h;++h){var m=l.getLine(h),g=m.indexOf(d);if(g>-1&&!/comment/.test(l.getTokenTypeAt(i(h,g+1)))&&(g=-1),-1==g&&(h!=c||h==u)&&r.test(m))break e;if(g>-1&&r.test(m.slice(0,g)))break e;f.push(m)}if(l.operation(function(){for(var e=u;c>=e;++e){var t=f[e-u],n=t.indexOf(d),r=n+d.length;0>n||(t.slice(r,r+p.length)==p&&(r+=p.length),a=!0,l.replaceRange("",i(e,n),i(e,r)))}}),a)return!0}var v=o.blockCommentStart||s.blockCommentStart,y=o.blockCommentEnd||s.blockCommentEnd;if(!v||!y)return!1;var b=o.blockCommentLead||s.blockCommentLead,x=l.getLine(u),k=c==u?x:l.getLine(c),_=x.indexOf(v),w=k.lastIndexOf(y);if(-1==w&&u!=c&&(k=l.getLine(--c),w=k.lastIndexOf(y)),-1==_||-1==w||!/comment/.test(l.getTokenTypeAt(i(u,_+1)))||!/comment/.test(l.getTokenTypeAt(i(c,w+1))))return!1;var C=x.lastIndexOf(v,e.ch),S=-1==C?-1:x.slice(0,e.ch).indexOf(y,C+v.length);if(-1!=C&&-1!=S&&S+y.length!=e.ch)return!1;S=k.indexOf(y,t.ch);var M=k.slice(t.ch).lastIndexOf(v,S-t.ch);return C=-1==S||-1==M?-1:t.ch+M,-1!=S&&-1!=C&&C!=t.ch?!1:(l.operation(function(){l.replaceRange("",i(c,w-(p&&k.slice(w-p.length,w)==p?p.length:0)),i(c,w+y.length));var e=_+v.length;if(p&&x.slice(e,e+p.length)==p&&(e+=p.length),l.replaceRange("",i(u,_),i(u,e)),b)for(var t=u+1;c>=t;++t){var n=l.getLine(t),o=n.indexOf(b);if(-1!=o&&!r.test(n.slice(0,o))){var a=o+b.length;p&&n.slice(a,a+p.length)==p&&(a+=p.length),l.replaceRange("",i(t,o),i(t,a))}}}),!0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var r,i=t.listSelections(),o=[],a=0;a<i.length;a++){var l=i[a].head,s=t.getTokenAt(l);if("comment"!=s.type)return e.Pass;var c=e.innerMode(t.getMode(),s.state).mode;if(r){if(r!=c)return e.Pass}else r=c;var u=null;if(r.blockCommentStart&&r.blockCommentContinue){var d,f=s.string.indexOf(r.blockCommentEnd),p=t.getRange(e.Pos(l.line,0),e.Pos(l.line,s.end));if(-1!=f&&f==s.string.length-r.blockCommentEnd.length&&l.ch>=f);else if(0==s.string.indexOf(r.blockCommentStart)){if(u=p.slice(0,s.start),!/^\s*$/.test(u)){u="";for(var h=0;h<s.start;++h)u+=" "}}else-1!=(d=p.indexOf(r.blockCommentContinue))&&d+r.blockCommentContinue.length>s.start&&/^\s*$/.test(p.slice(0,d))&&(u=p.slice(0,d));null!=u&&(u+=r.blockCommentContinue)}if(null==u&&r.lineComment&&n(t)){var m=t.getLine(l.line),d=m.indexOf(r.lineComment);d>-1&&(u=m.slice(0,d),/\S/.test(u)?u=null:u+=r.lineComment+m.slice(d+r.lineComment.length).match(/^\s*/)[0])}if(null==u)return e.Pass;o[a]="\n"+u}t.operation(function(){for(var e=i.length-1;e>=0;e--)t.replaceRange(o[e],i[e].from(),i[e].to(),"+insert")})}function n(e){var t=e.getOption("continueComments");return t&&"object"==typeof t?t.continueLineComment!==!1:!0}for(var r=["clike","css","javascript"],i=0;i<r.length;++i)e.extendMode(r[i],{blockCommentContinue:" * "});e.defineOption("continueComments",null,function(n,r,i){if(i&&i!=e.Init&&n.removeKeyMap("continueComment"),r){var o="Enter";"string"==typeof r?o=r:"object"==typeof r&&r.key&&(o=r.key);var a={name:"continueComment"};a[o]=t,n.addKeyMap(a)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n){for(var r=n.paragraphStart||e.getHelper(t,"paragraphStart"),i=t.line,o=e.firstLine();i>o;--i){var a=e.getLine(i);if(r&&r.test(a))break;if(!/\S/.test(a)){++i;break}}for(var l=n.paragraphEnd||e.getHelper(t,"paragraphEnd"),s=t.line+1,c=e.lastLine();c>=s;++s){var a=e.getLine(s);if(l&&l.test(a)){++s;break}if(!/\S/.test(a))break}return{from:i,to:s}}function n(e,t,n,r){for(var i=t;i>0&&!n.test(e.slice(i-1,i+1));--i);for(var o=!0;;o=!1){var a=i;if(r)for(;" "==e.charAt(a-1);)--a;if(0!=a||!o)return{from:a,to:i};i=t}}function r(t,r,o,a){r=t.clipPos(r),o=t.clipPos(o);var l=a.column||80,s=a.wrapOn||/\s\S|-[^\.\d]/,c=a.killTrailingSpace!==!1,u=[],d="",f=r.line,p=t.getRange(r,o,!1);if(!p.length)return null;for(var h=p[0].match(/^[ \t]*/)[0],m=0;m<p.length;++m){var g=p[m],v=d.length,y=0;d&&g&&!s.test(d.charAt(d.length-1)+g.charAt(0))&&(d+=" ",y=1);var b="";if(m&&(b=g.match(/^\s*/)[0],g=g.slice(b.length)),d+=g,m){var x=d.length>l&&h==b&&n(d,l,s,c);x&&x.from==v&&x.to==v+y?(d=h+g,++f):u.push({text:[y?" ":""],from:i(f,v),to:i(f+1,b.length)})}for(;d.length>l;){var k=n(d,l,s,c);u.push({text:["",h],from:i(f,k.from),to:i(f,k.to)}),d=h+d.slice(k.to),++f}}return u.length&&t.operation(function(){for(var n=0;n<u.length;++n){var r=u[n];(r.text||e.cmpPos(r.from,r.to))&&t.replaceRange(r.text,r.from,r.to)}}),u.length?{from:u[0].from,to:e.changeEnd(u[u.length-1])}:null}var i=e.Pos;e.defineExtension("wrapParagraph",function(e,n){n=n||{},e||(e=this.getCursor());var o=t(this,e,n);return r(this,i(o.from,0),i(o.to-1),n)}),e.commands.wrapLines=function(e){e.operation(function(){for(var n=e.listSelections(),o=e.lastLine()+1,a=n.length-1;a>=0;a--){var l,s=n[a];if(s.empty()){var c=t(e,s.head,{});l={from:i(c.from,0),to:i(c.to-1)}}else l={from:s.from(),to:s.to()};l.to.line>=o||(o=l.from.line,r(e,l.from,l.to,{}))}})},e.defineExtension("wrapRange",function(e,t,n){return r(this,e,t,n||{})}),e.defineExtension("wrapParagraphsInRange",function(e,n,o){o=o||{};for(var a=this,l=[],s=e.line;s<=n.line;){var c=t(a,i(s,0),o);l.push(c),s=c.to}var u=!1;return l.length&&a.operation(function(){for(var e=l.length-1;e>=0;--e)u=u||r(a,i(l[e].from,0),i(l[e].to-1),o)}),u})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,i,o,a){function l(e){var n=s(t,i);if(!n||n.to.line-n.from.line<c)return null;for(var r=t.findMarksAt(n.from),o=0;o<r.length;++o)if(r[o].__isFold&&"fold"!==a){if(!e)return null;n.cleared=!0,r[o].clear()}return n}if(o&&o.call){var s=o;o=null}else var s=r(t,o,"rangeFinder");"number"==typeof i&&(i=e.Pos(i,0));var c=r(t,o,"minFoldSize"),u=l(!0);if(r(t,o,"scanUp"))for(;!u&&i.line>t.firstLine();)i=e.Pos(i.line-1,0),u=l(!1);if(u&&!u.cleared&&"unfold"!==a){var d=n(t,o);e.on(d,"mousedown",function(t){f.clear(),e.e_preventDefault(t)});var f=t.markText(u.from,u.to,{replacedWith:d,clearOnEnter:!0,__isFold:!0});f.on("clear",function(n,r){e.signal(t,"unfold",t,n,r)}),e.signal(t,"fold",t,u.from,u.to)}}function n(e,t){var n=r(e,t,"widget");if("string"==typeof n){var i=document.createTextNode(n);n=document.createElement("span"),n.appendChild(i),n.className="CodeMirror-foldmarker"}return n}function r(e,t,n){if(t&&void 0!==t[n])return t[n];var r=e.options.foldOptions;return r&&void 0!==r[n]?r[n]:i[n]}e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",function(e,n,r){t(this,e,n,r)}),e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),n=0;n<t.length;++n)if(t[n].__isFold)return!0}),e.commands.toggleFold=function(e){e.foldCode(e.getCursor())},e.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},e.commands.unfold=function(e){e.foldCode(e.getCursor(),null,"unfold")},e.commands.foldAll=function(t){t.operation(function(){for(var n=t.firstLine(),r=t.lastLine();r>=n;n++)t.foldCode(e.Pos(n,0),null,"fold")})},e.commands.unfoldAll=function(t){t.operation(function(){for(var n=t.firstLine(),r=t.lastLine();r>=n;n++)t.foldCode(e.Pos(n,0),null,"unfold")})},e.registerHelper("fold","combine",function(){var e=Array.prototype.slice.call(arguments,0);return function(t,n){for(var r=0;r<e.length;++r){var i=e[r](t,n);if(i)return i}}}),e.registerHelper("fold","auto",function(e,t){for(var n=e.getHelpers(t,"fold"),r=0;r<n.length;r++){var i=n[r](e,t);if(i)return i}});var i={rangeFinder:e.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1};e.defineOption("foldOptions",null),e.defineExtension("foldOption",function(e,t){return r(this,e,t)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","brace",function(t,n){function r(r){for(var i=n.ch,s=0;;){var c=0>=i?-1:l.lastIndexOf(r,i-1);if(-1!=c){if(1==s&&c<n.ch)break;if(o=t.getTokenTypeAt(e.Pos(a,c+1)),!/^(comment|string)/.test(o))return c+1;i=c-1}else{if(1==s)break;s=1,i=l.length}}}var i,o,a=n.line,l=t.getLine(a),s="{",c="}",i=r("{");if(null==i&&(s="[",c="]",i=r("[")),null!=i){var u,d,f=1,p=t.lastLine();e:for(var h=a;p>=h;++h)for(var m=t.getLine(h),g=h==a?i:0;;){var v=m.indexOf(s,g),y=m.indexOf(c,g);if(0>v&&(v=m.length),0>y&&(y=m.length),g=Math.min(v,y),g==m.length)break;if(t.getTokenTypeAt(e.Pos(h,g+1))==o)if(g==v)++f;else if(!--f){u=h,d=g;break e}++g}if(null!=u&&(a!=u||d!=i))return{from:e.Pos(a,i),to:e.Pos(u,d)}}}),e.registerHelper("fold","import",function(t,n){function r(n){if(n<t.firstLine()||n>t.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);o>=i;++i){var a=t.getLine(i),l=a.indexOf(";");if(-1!=l)return{startCh:r.end,end:e.Pos(i,l)}}}var i,n=n.line,o=r(n);if(!o||r(n-1)||(i=r(n-2))&&i.end.line==n-1)return null;for(var a=o.end;;){var l=r(a.line+1);if(null==l)break;a=l.end}return{from:t.clipPos(e.Pos(n,o.startCh+1)),to:a}}),e.registerHelper("fold","include",function(t,n){function r(n){if(n<t.firstLine()||n>t.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var n=n.line,i=r(n);if(null==i||null!=r(n-1))return null;for(var o=n;;){var a=r(o+1);if(null==a)break;++o}return{from:e.Pos(n,i+1),to:t.clipPos(e.Pos(o))}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],e):e(CodeMirror)}(function(e){"use strict";function t(e){this.options=e,this.from=this.to=0}function n(e){return e===!0&&(e={}),null==e.gutter&&(e.gutter="CodeMirror-foldgutter"),null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open"),null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded"),e}function r(e,t){for(var n=e.findMarksAt(d(t)),r=0;r<n.length;++r)if(n[r].__isFold&&n[r].find().from.line==t)return n[r]}function i(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function o(e,t,n){var o=e.state.foldGutter.options,a=t,l=e.foldOption(o,"minFoldSize"),s=e.foldOption(o,"rangeFinder");e.eachLine(t,n,function(t){var n=null;if(r(e,a))n=i(o.indicatorFolded);else{var c=d(a,0),u=s&&s(e,c);u&&u.to.line-u.from.line>=l&&(n=i(o.indicatorOpen))}e.setGutterMarker(t,o.gutter,n),++a})}function a(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation(function(){o(e,t.from,t.to)}),n.from=t.from,n.to=t.to)}function l(e,t,n){var i=e.state.foldGutter;if(i){var o=i.options;if(n==o.gutter){var a=r(e,t);a?a.clear():e.foldCode(d(t,0),o.rangeFinder)}}}function s(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){a(e)},n.foldOnChangeTimeSpan||600)}}function c(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?a(e):e.operation(function(){n.from<t.from&&(o(e,n.from,t.from),t.from=n.from),n.to>t.to&&(o(e,t.to,n.to),t.to=n.to)})},n.updateViewportTimeSpan||400)}}function u(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&r<n.to&&o(e,r,r+1)}}e.defineOption("foldGutter",!1,function(r,i,o){o&&o!=e.Init&&(r.clearGutter(r.state.foldGutter.options.gutter),r.state.foldGutter=null,r.off("gutterClick",l),r.off("change",s),r.off("viewportChange",c),r.off("fold",u),r.off("unfold",u),r.off("swapDoc",s)),i&&(r.state.foldGutter=new t(n(i)),a(r),r.on("gutterClick",l),r.on("change",s),r.on("viewportChange",c),r.on("fold",u),r.on("unfold",u),r.on("swapDoc",s))});var d=e.Pos}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","markdown",function(t,n){function r(n){var r=t.getTokenTypeAt(e.Pos(n,0));return r&&/\bheader\b/.test(r)}function i(e,t,n){var i=t&&t.match(/^#+/);return i&&r(e)?i[0].length:(i=n&&n.match(/^[=\-]+\s*$/),i&&r(e+1)?"="==n[0]?1:2:o)}var o=100,a=t.getLine(n.line),l=t.getLine(n.line+1),s=i(n.line,a,l);if(s===o)return void 0;for(var c=t.lastLine(),u=n.line,d=t.getLine(u+2);c>u&&!(i(u+1,l,d)<=s);)++u,l=d,d=t.getLine(u+2);return{from:e.Pos(n.line,a.length),to:e.Pos(u,t.getLine(u).length)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.line-t.line||e.ch-t.ch}function n(e,t,n,r){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=r?r.from:e.firstLine(),this.max=r?r.to-1:e.lastLine()}function r(e,t){var n=e.cm.getTokenTypeAt(f(e.line,t));return n&&/\btag\b/.test(n)}function i(e){return e.line>=e.max?void 0:(e.ch=0,e.text=e.cm.getLine(++e.line),!0)}function o(e){return e.line<=e.min?void 0:(e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0)}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(i(e))continue;return}{if(r(e,t+1)){var n=e.text.lastIndexOf("/",t),o=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,o?"selfClose":"regular"}e.ch=t+1}}}function l(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(o(e))continue;return}if(r(e,t+1)){m.lastIndex=t,e.ch=t;var n=m.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function s(e){for(;;){m.lastIndex=e.ch;var t=m.exec(e.text);if(!t){if(i(e))continue;return}{if(r(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(o(e))continue;return}{if(r(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}}function u(e,t){for(var n=[];;){var r,i=s(e),o=e.line,l=e.ch-(i?i[0].length:0);if(!i||!(r=a(e)))return;if("selfClose"!=r)if(i[1]){for(var c=n.length-1;c>=0;--c)if(n[c]==i[2]){n.length=c;break}if(0>c&&(!t||t==i[2]))return{tag:i[2],from:f(o,l),to:f(e.line,e.ch)}}else n.push(i[2])}}function d(e,t){for(var n=[];;){var r=c(e);if(!r)return;if("selfClose"!=r){var i=e.line,o=e.ch,a=l(e);if(!a)return;if(a[1])n.push(a[2]);else{for(var s=n.length-1;s>=0;--s)if(n[s]==a[2]){n.length=s;break}if(0>s&&(!t||t==a[2]))return{tag:a[2],from:f(e.line,e.ch),to:f(i,o)}}}else l(e)}}var f=e.Pos,p="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",h=p+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",m=new RegExp("<(/?)(["+p+"]["+h+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var r=new n(e,t.line,0);;){var i,o=s(r);if(!o||r.line!=t.line||!(i=a(r)))return;if(!o[1]&&"selfClose"!=i){var t=f(r.line,r.ch),l=u(r,o[2]);return l&&{from:t,to:l.from}}}}),e.findMatchingTag=function(e,r,i){var o=new n(e,r.line,r.ch,i);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var s=a(o),c=s&&f(o.line,o.ch),p=s&&l(o);if(s&&p&&!(t(o,r)>0)){var h={from:f(o.line,o.ch),to:c,tag:p[2]};return"selfClose"==s?{open:h,close:null,at:"open"}:p[1]?{open:d(o,p[2]),close:h,at:"close"}:(o=new n(e,c.line,c.ch,i),{open:h,close:u(o,p[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,r){for(var i=new n(e,t.line,t.ch,r);;){var o=d(i);if(!o)break;var a=new n(e,t.line,t.ch,r),l=u(a,o.tag);if(l)return{open:o,close:l}}},e.scanForClosingTag=function(e,t,r,i){var o=new n(e,t.line,t.ch,i?{from:0,to:i}:null);return u(o,r)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(r,i){function o(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if("<"==r)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(s("atom","]]>")):null:e.match("--")?n(s("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(M=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==r){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=o,M=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return M="equals",null;if("<"==n){t.tokenize=o,t.state=p,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=l(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=o;break}n.next()}return e}}function c(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=c(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=o;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function u(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(w.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function d(e){e.context&&(e.context=e.context.prev)}function f(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!w.contextGrabbers.hasOwnProperty(n)||!w.contextGrabbers[n].hasOwnProperty(t))return;d(e)}}function p(e,t,n){return"openTag"==e?(n.tagStart=t.column(),h):"closeTag"==e?m:p}function h(e,t,n){return"word"==e?(n.tagName=t.current(),L="tag",y):(L="error",h)}function m(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&w.implicitlyClosed.hasOwnProperty(n.context.tagName)&&d(n),n.context&&n.context.tagName==r?(L="tag",g):(L="tag error",v)}return L="error",v}function g(e,t,n){return"endTag"!=e?(L="error",g):(d(n),p)}function v(e,t,n){return L="error",g(e,t,n)}function y(e,t,n){if("word"==e)return L="attribute",
+b;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||w.autoSelfClosers.hasOwnProperty(r)?f(n,r):(f(n,r),n.context=new u(n,r,i==n.indented)),p}return L="error",y}function b(e,t,n){return"equals"==e?x:(w.allowMissing||(L="error"),y(e,t,n))}function x(e,t,n){return"string"==e?k:"word"==e&&w.allowUnquoted?(L="string",y):(L="error",y(e,t,n))}function k(e,t,n){return"string"==e?k:y(e,t,n)}var _=r.indentUnit,w={},C=i.htmlMode?t:n;for(var S in C)w[S]=C[S];for(var S in i)w[S]=i[S];var M,L;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:p,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;M=null;var n=t.tokenize(e,t);return(n||M)&&"comment"!=n&&(L=null,t.state=t.state(M||n,e,t),L&&(n="error"==L?n+" error":L)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+_;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return w.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+_*(w.multilineTagIndentFactor||1);if(w.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var l=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(l&&l[1])for(;i;){if(i.tagName==l[2]){i=i.prev;break}if(!w.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(l)for(;i;){var s=w.contextGrabbers[i.tagName];if(!s||!s.hasOwnProperty(l[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+_:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:w.htmlMode?"html":"xml",helperType:w.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("markdown",function(t,n){function r(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}function i(e,t,n){return t.f=t.inline=n,n(e,t)}function o(e,t,n){return t.f=t.block=n,n(e,t)}function a(e){return!e||!/\S/.test(e.string)}function l(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,_||e.f!=c||(e.f=h,e.block=s),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine=null,null}function s(e,t){var o=e.sol(),l=t.list!==!1,s=t.indentedCode;t.indentedCode=!1,l&&(t.indentationDiff>=0?(t.indentationDiff<4&&(t.indentation-=t.indentationDiff),t.list=null):t.indentation>0?(t.list=null,t.listDepth=Math.floor(t.indentation/4)):(t.list=!1,t.listDepth=0));var c=null;if(t.indentationDiff>=4)return e.skipToEnd(),s||a(t.prevLine)?(t.indentation-=4,t.indentedCode=!0,S.code):null;if(e.eatSpace())return null;if((c=e.match(E))&&c[1].length<=6)return t.header=c[1].length,n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,f(t);if(!(a(t.prevLine)||t.quote||l||s)&&(c=e.match(O)))return t.header="="==c[0].charAt(0)?1:2,n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,f(t);if(e.eat(">"))return t.quote=o?1:t.quote+1,n.highlightFormatting&&(t.formatting="quote"),e.eatSpace(),f(t);if("["===e.peek())return i(e,t,y);if(e.match(L,!0))return t.hr=!0,S.hr;if((a(t.prevLine)||l)&&(e.match(T,!1)||e.match(A,!1))){var d=null;return e.match(T,!0)?d="ul":(e.match(A,!0),d="ol"),t.indentation=e.column()+e.current().length,t.list=!0,t.listDepth++,n.taskLists&&e.match(z,!1)&&(t.taskList=!0),t.f=t.inline,n.highlightFormatting&&(t.formatting=["list","list-"+d]),f(t)}return n.fencedCodeBlocks&&(c=e.match(N,!0))?(t.fencedChars=c[1],t.localMode=r(c[2]),t.localMode&&(t.localState=t.localMode.startState()),t.f=t.block=u,n.highlightFormatting&&(t.formatting="code-block"),t.code=!0,f(t)):i(e,t,t.inline)}function c(e,t){var n=w.token(e,t.htmlState);return(_&&null===t.htmlState.tagStart&&!t.htmlState.context&&t.htmlState.tokenize.isInText||t.md_inside&&e.current().indexOf(">")>-1)&&(t.f=h,t.block=s,t.htmlState=null),n}function u(e,t){return e.sol()&&t.fencedChars&&e.match(t.fencedChars,!1)?(t.localMode=t.localState=null,t.f=t.block=d,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),S.code)}function d(e,t){e.match(t.fencedChars),t.block=s,t.f=h,t.fencedChars=null,n.highlightFormatting&&(t.formatting="code-block"),t.code=!0;var r=f(t);return t.code=!1,r}function f(e){var t=[];if(e.formatting){t.push(S.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(S.formatting+"-"+e.formatting[r]),"header"===e.formatting[r]&&t.push(S.formatting+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&t.push(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?S.formatting+"-"+e.formatting[r]+"-"+e.quote:"error")}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(S.linkHref,"url"):(e.strong&&t.push(S.strong),e.em&&t.push(S.em),e.strikethrough&&t.push(S.strikethrough),e.linkText&&t.push(S.linkText),e.code&&t.push(S.code)),e.header&&t.push(S.header,S.header+"-"+e.header),e.quote&&(t.push(S.quote),t.push(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?S.quote+"-"+e.quote:S.quote+"-"+n.maxBlockquoteDepth)),e.list!==!1){var i=(e.listDepth-1)%3;t.push(i?1===i?S.list2:S.list3:S.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function p(e,t){return e.match(q,!0)?f(t):void 0}function h(t,r){var i=r.text(t,r);if("undefined"!=typeof i)return i;if(r.list)return r.list=null,f(r);if(r.taskList){var a="x"!==t.match(z,!0)[1];return a?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,f(r)}if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),f(r);var l=t.sol(),s=t.next();if("\\"===s&&(t.next(),n.highlightFormatting)){var u=f(r),d=S.formatting+"-escape";return u?u+" "+d:d}if(r.linkTitle){r.linkTitle=!1;var p=s;"("===s&&(p=")"),p=(p+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var h="^\\s*(?:[^"+p+"\\\\]+|\\\\\\\\|\\\\.)"+p;if(t.match(new RegExp(h),!0))return S.linkHref}if("`"===s){var v=r.formatting;n.highlightFormatting&&(r.formatting="code");var y=f(r),b=t.pos;t.eatWhile("`");var x=1+t.pos-b;return r.code?x===C?(r.code=!1,y):(r.formatting=v,f(r)):(C=x,r.code=!0,f(r))}if(r.code)return f(r);if("!"===s&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),r.inline=r.f=g,S.image;if("["===s&&t.match(/.*\](\(.*\)| ?\[.*\])/,!1))return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),f(r);if("]"===s&&r.linkText&&t.match(/\(.*\)| ?\[.*\]/,!1)){n.highlightFormatting&&(r.formatting="link");var u=f(r);return r.linkText=!1,r.inline=r.f=g,u}if("<"===s&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var u=f(r);return u?u+=" ":u="",u+S.linkInline}if("<"===s&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var u=f(r);return u?u+=" ":u="",u+S.linkEmail}if("<"===s&&t.match(/^(!--|\w)/,!1)){var k=t.string.indexOf(">",t.pos);if(-1!=k){var _=t.string.substring(t.start,k);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(_)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(w),o(t,r,c)}if("<"===s&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";var M=!1;if(!n.underscoresBreakWords&&"_"===s&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var L=t.pos-2;if(L>=0){var T=t.string.charAt(L);"_"!==T&&T.match(/(\w)/,!1)&&(M=!0)}}if("*"===s||"_"===s&&!M)if(l&&" "===t.peek());else{if(r.strong===s&&t.eat(s)){n.highlightFormatting&&(r.formatting="strong");var y=f(r);return r.strong=!1,y}if(!r.strong&&t.eat(s))return r.strong=s,n.highlightFormatting&&(r.formatting="strong"),f(r);if(r.em===s){n.highlightFormatting&&(r.formatting="em");var y=f(r);return r.em=!1,y}if(!r.em)return r.em=s,n.highlightFormatting&&(r.formatting="em"),f(r)}else if(" "===s&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return f(r);t.backUp(1)}if(n.strikethrough)if("~"===s&&t.eatWhile(s)){if(r.strikethrough){n.highlightFormatting&&(r.formatting="strikethrough");var y=f(r);return r.strikethrough=!1,y}if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),f(r)}else if(" "===s&&t.match(/^~~/,!0)){if(" "===t.peek())return f(r);t.backUp(2)}return" "===s&&(t.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),f(r)}function m(e,t){var r=e.next();if(">"===r){t.f=t.inline=h,n.highlightFormatting&&(t.formatting="link");var i=f(t);return i?i+=" ":i="",i+S.linkInline}return e.match(/^[^>]+/,!0),S.linkInline}function g(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(t.f=t.inline=v("("===r?")":"]"),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,f(t)):"error"}function v(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=h,n.highlightFormatting&&(r.formatting="link-string");var o=f(r);return r.linkHref=!1,o}return t.match(k(e),!0)&&t.backUp(1),r.linkHref=!0,f(r)}}function y(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=b,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,f(t)):i(e,t,h)}function b(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=x,n.highlightFormatting&&(t.formatting="link");var r=f(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),S.linkText}function x(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=h,S.linkHref+" url")}function k(e){return P[e]||(e=(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),P[e]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+e+")")),P[e]}var _=e.modes.hasOwnProperty("xml"),w=e.getMode(t,_?{name:"xml",htmlMode:!0}:"text/plain");void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.underscoresBreakWords&&(n.underscoresBreakWords=!0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var C=0,S={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"tag",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(var M in S)S.hasOwnProperty(M)&&n.tokenTypeOverrides[M]&&(S[M]=n.tokenTypeOverrides[M]);var L=/^([*\-_])(?:\s*\1){2,}\s*$/,T=/^[*\-+]\s+/,A=/^[0-9]+([.)])\s+/,z=/^\[(x| )\](?=\s)/,E=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,O=/^ *(?:\={1,}|-{1,})\s*$/,q=/^[^#!\[\]*_\\<>` "'(~]+/,N=new RegExp("^("+(n.fencedCodeBlocks===!0?"~~~+|```+":n.fencedCodeBlocks)+")[ \\t]*([\\w+#]*)"),P=[],I={startState:function(){return{f:s,prevLine:null,thisLine:null,block:s,htmlState:null,indentation:0,inline:h,text:p,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(w,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listDepth:t.listDepth,quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedChars:t.fencedChars}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine){var n=t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||n){if(l(t),!n)return null;t.prevLine=null}t.prevLine=t.thisLine,t.thisLine=e,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length,i=4*Math.floor((r-t.indentation)/4);i>4&&(i=4);var o=t.indentation+i;if(t.indentationDiff=o-t.indentation,t.indentation=o,r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==c?{state:e.htmlState,mode:w}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:I}},blankLine:l,getType:f,fold:"markdown"};return I},"xml"),e.defineMIME("text/x-markdown","markdown")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../markdown/markdown"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){"use strict";var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode("gfm",function(n,r){function i(e){return e.code=!1,null}var o=0,a={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,n){if(n.combineTokens=null,n.codeBlock)return e.match(/^```+/)?(n.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(n.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),n.codeBlock=!0,null;if("`"===e.peek()){e.next();var i=e.pos;e.eatWhile("`");var a=1+e.pos-i;return n.code?a===o&&(n.code=!1):(o=a,n.code=!0),null}if(n.code)return e.next(),null;if(e.eatSpace())return n.ateSpace=!0,null;if((e.sol()||n.ateSpace)&&(n.ateSpace=!1,r.gitHubSpice!==!1)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return n.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return n.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(n.combineTokens=!0,"link"):(e.next(),null)},blankLine:i},l={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:"```",strikethrough:!0};for(var s in r)l[s]=r[s];return l.name="markdown",e.overlayMode(e.getMode(n,l),a)},"markdown"),e.defineMIME("text/x-gfm","gfm")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n){return/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}e.defineMode("javascript",function(n,r){function i(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function o(e,t,n){return xe=e,ke=n,t}function a(e,n){var r=e.next();if('"'==r||"'"==r)return n.tokenize=l(r),n.tokenize(e,n);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==r&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return o(r);if("="==r&&e.eat(">"))return o("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number");if("0"==r&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),o("number","number");if("0"==r&&e.eat(/b/i))return e.eatWhile(/[01]/i),o("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==r)return e.eat("*")?(n.tokenize=s,s(e,n)):e.eat("/")?(e.skipToEnd(),o("comment","comment")):t(e,n,1)?(i(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")):(e.eatWhile(Ae),o("operator","operator",e.current()));if("`"==r)return n.tokenize=c,c(e,n);if("#"==r)return e.skipToEnd(),o("error","error");if(Ae.test(r))return e.eatWhile(Ae),o("operator","operator",e.current());if(Le.test(r)){e.eatWhile(Le);var a=e.current(),u=Te.propertyIsEnumerable(a)&&Te[a];return u&&"."!=n.lastType?o(u.type,u.style,a):o("variable","variable",a)}}function l(e){return function(t,n){var r,i=!1;if(Ce&&"@"==t.peek()&&t.match(ze))return n.tokenize=a,o("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.tokenize=a),o("string","string")}}function s(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=a;break}r="*"==n}return o("comment","comment")}function c(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=a;break}r=!r&&"\\"==n}return o("quasi","string-2",e.current())}function u(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(0>n)){for(var r=0,i=!1,o=n-1;o>=0;--o){var a=e.string.charAt(o),l=Ee.indexOf(a);if(l>=0&&3>l){if(!r){++o;break}if(0==--r)break}else if(l>=3&&6>l)++r;else if(Le.test(a))i=!0;else{if(/["'\/]/.test(a))return;if(i&&!r){++o;break}}}i&&!r&&(t.fatArrowAt=o)}}function d(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function f(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function p(e,t,n,r,i){var o=e.cc;for(qe.state=e,qe.stream=i,qe.marked=null,qe.cc=o,qe.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():Se?w:_;if(a(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return qe.marked?qe.marked:"variable"==n&&f(e,r)?"variable-2":t}}}function h(){for(var e=arguments.length-1;e>=0;e--)qe.cc.push(arguments[e])}function m(){return h.apply(null,arguments),!0}function g(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var n=qe.state;if(qe.marked="def",n.context){if(t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;r.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function v(){qe.state.context={prev:qe.state.context,vars:qe.state.localVars},qe.state.localVars=Ne}function y(){qe.state.localVars=qe.state.context.vars,qe.state.context=qe.state.context.prev}function b(e,t){var n=function(){var n=qe.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new d(r,qe.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function x(){var e=qe.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function k(e){function t(n){return n==e?m():";"==e?h():m(t)}return t}function _(e,t){return"var"==e?m(b("vardef",t.length),K,k(";"),x):"keyword a"==e?m(b("form"),w,_,x):"keyword b"==e?m(b("form"),_,x):"{"==e?m(b("}"),B,x):";"==e?m():"if"==e?("else"==qe.state.lexical.info&&qe.state.cc[qe.state.cc.length-1]==x&&qe.state.cc.pop()(),m(b("form"),w,_,x,J)):"function"==e?m(oe):"for"==e?m(b("form"),ee,_,x):"variable"==e?m(b("stat"),D):"switch"==e?m(b("form"),w,b("}","switch"),k("{"),B,x,x):"case"==e?m(w,k(":")):"default"==e?m(k(":")):"catch"==e?m(b("form"),v,k("("),ae,k(")"),_,x,y):"class"==e?m(b("form"),le,x):"export"==e?m(b("stat"),de,x):"import"==e?m(b("stat"),fe,x):"module"==e?m(b("form"),Z,b("}"),k("{"),B,x,x):h(b("stat"),w,k(";"),x)}function w(e){return S(e,!1)}function C(e){return S(e,!0)}function S(e,t){if(qe.state.fatArrowAt==qe.stream.start){var n=t?q:O;if("("==e)return m(v,b(")"),H(Z,")"),x,k("=>"),n,y);if("variable"==e)return h(v,Z,k("=>"),n,y)}var r=t?A:T;return Oe.hasOwnProperty(e)?m(r):"function"==e?m(oe,r):"keyword c"==e?m(t?L:M):"("==e?m(b(")"),M,ye,k(")"),x,r):"operator"==e||"spread"==e?m(t?C:w):"["==e?m(b("]"),ge,x,r):"{"==e?$(R,"}",null,r):"quasi"==e?h(z,r):"new"==e?m(N(t)):m()}function M(e){return e.match(/[;\}\)\],]/)?h():h(w)}function L(e){return e.match(/[;\}\)\],]/)?h():h(C)}function T(e,t){return","==e?m(w):A(e,t,!1)}function A(e,t,n){var r=0==n?T:A,i=0==n?w:C;return"=>"==e?m(v,n?q:O,y):"operator"==e?/\+\+|--/.test(t)?m(r):"?"==t?m(w,k(":"),i):m(i):"quasi"==e?h(z,r):";"!=e?"("==e?$(C,")","call",r):"."==e?m(j,r):"["==e?m(b("]"),M,k("]"),x,r):void 0:void 0}function z(e,t){return"quasi"!=e?h():"${"!=t.slice(t.length-2)?m(z):m(w,E)}function E(e){return"}"==e?(qe.marked="string-2",qe.state.tokenize=c,m(z)):void 0}function O(e){return u(qe.stream,qe.state),h("{"==e?_:w)}function q(e){return u(qe.stream,qe.state),h("{"==e?_:C)}function N(e){return function(t){return"."==t?m(e?I:P):h(e?C:w)}}function P(e,t){return"target"==t?(qe.marked="keyword",m(T)):void 0}function I(e,t){return"target"==t?(qe.marked="keyword",m(A)):void 0}function D(e){return":"==e?m(x,_):h(T,k(";"),x)}function j(e){return"variable"==e?(qe.marked="property",m()):void 0}function R(e,t){return"variable"==e||"keyword"==qe.style?(qe.marked="property",m("get"==t||"set"==t?W:F)):"number"==e||"string"==e?(qe.marked=Ce?"property":qe.style+" property",m(F)):"jsonld-keyword"==e?m(F):"modifier"==e?m(R):"["==e?m(w,k("]"),F):"spread"==e?m(w):void 0}function W(e){return"variable"!=e?h(F):(qe.marked="property",m(oe))}function F(e){return":"==e?m(C):"("==e?h(oe):void 0}function H(e,t){function n(r){if(","==r){var i=qe.state.lexical;return"call"==i.info&&(i.pos=(i.pos||0)+1),m(e,n)}return r==t?m():m(k(t))}return function(r){return r==t?m():h(e,n)}}function $(e,t,n){for(var r=3;r<arguments.length;r++)qe.cc.push(arguments[r]);return m(b(t,n),H(e,t),x)}function B(e){return"}"==e?m():h(_,B)}function U(e){return Me&&":"==e?m(G):void 0}function V(e,t){return"="==t?m(C):void 0}function G(e){return"variable"==e?(qe.marked="variable-3",m()):void 0}function K(){return h(Z,U,Y,Q)}function Z(e,t){return"modifier"==e?m(Z):"variable"==e?(g(t),m()):"spread"==e?m(Z):"["==e?$(Z,"]"):"{"==e?$(X,"}"):void 0}function X(e,t){return"variable"!=e||qe.stream.match(/^\s*:/,!1)?("variable"==e&&(qe.marked="property"),"spread"==e?m(Z):"}"==e?h():m(k(":"),Z,Y)):(g(t),m(Y))}function Y(e,t){return"="==t?m(C):void 0}function Q(e){return","==e?m(K):void 0}function J(e,t){return"keyword b"==e&&"else"==t?m(b("form","else"),_,x):void 0}function ee(e){return"("==e?m(b(")"),te,k(")"),x):void 0}function te(e){return"var"==e?m(K,k(";"),re):";"==e?m(re):"variable"==e?m(ne):h(w,k(";"),re)}function ne(e,t){return"in"==t||"of"==t?(qe.marked="keyword",m(w)):m(T,re)}function re(e,t){return";"==e?m(ie):"in"==t||"of"==t?(qe.marked="keyword",m(w)):h(w,k(";"),ie)}function ie(e){")"!=e&&m(w)}function oe(e,t){return"*"==t?(qe.marked="keyword",m(oe)):"variable"==e?(g(t),m(oe)):"("==e?m(v,b(")"),H(ae,")"),x,_,y):void 0}function ae(e){return"spread"==e?m(ae):h(Z,U,V)}function le(e,t){return"variable"==e?(g(t),m(se)):void 0}function se(e,t){return"extends"==t?m(w,se):"{"==e?m(b("}"),ce,x):void 0}function ce(e,t){return"variable"==e||"keyword"==qe.style?"static"==t?(qe.marked="keyword",m(ce)):(qe.marked="property","get"==t||"set"==t?m(ue,oe,ce):m(oe,ce)):"*"==t?(qe.marked="keyword",m(ce)):";"==e?m(ce):"}"==e?m():void 0}function ue(e){return"variable"!=e?h():(qe.marked="property",m())}function de(e,t){return"*"==t?(qe.marked="keyword",m(me,k(";"))):"default"==t?(qe.marked="keyword",m(w,k(";"))):h(_)}function fe(e){return"string"==e?m():h(pe,me)}function pe(e,t){return"{"==e?$(pe,"}"):("variable"==e&&g(t),"*"==t&&(qe.marked="keyword"),m(he))}function he(e,t){return"as"==t?(qe.marked="keyword",m(pe)):void 0}function me(e,t){return"from"==t?(qe.marked="keyword",m(w)):void 0}function ge(e){return"]"==e?m():h(C,ve)}function ve(e){return"for"==e?h(ye,k("]")):","==e?m(H(L,"]")):h(H(C,"]"))}function ye(e){return"for"==e?m(ee,ye):"if"==e?m(w,ye):void 0}function be(e,t){return"operator"==e.lastType||","==e.lastType||Ae.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var xe,ke,_e=n.indentUnit,we=r.statementIndent,Ce=r.jsonld,Se=r.json||Ce,Me=r.typescript,Le=r.wordCharacters||/[\w$\xa1-\uffff]/,Te=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={"if":e("if"),"while":t,"with":t,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":e("new"),"delete":r,"throw":r,"debugger":r,"var":e("var"),"const":e("var"),let:e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,"typeof":i,"instanceof":i,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o,"this":e("this"),"class":e("class"),"super":e("atom"),"yield":r,"export":e("export"),"import":e("import"),"extends":r};if(Me){var l={type:"variable",style:"variable-3"},s={"interface":e("class"),"implements":r,namespace:r,module:e("module"),"enum":e("module"),"public":e("modifier"),"private":e("modifier"),"protected":e("modifier"),"abstract":e("modifier"),as:i,string:l,number:l,"boolean":l,any:l};for(var c in s)a[c]=s[c]}return a}(),Ae=/[+\-*&%=<>!?|~^]/,ze=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Ee="([{}])",Oe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},qe={state:null,column:null,marked:null,cc:null},Ne={name:"this",next:{name:"arguments"}};return x.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new d((e||0)-_e,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),u(e,t)),t.tokenize!=s&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==xe?n:(t.lastType="operator"!=xe||"++"!=ke&&"--"!=ke?xe:"incdec",p(t,n,xe,ke,e))},indent:function(t,n){if(t.tokenize==s)return e.Pass;if(t.tokenize!=a)return 0;var i=n&&n.charAt(0),o=t.lexical;if(!/^\s*else\b/.test(n))for(var l=t.cc.length-1;l>=0;--l){var c=t.cc[l];if(c==x)o=o.prev;else if(c!=J)break}"stat"==o.type&&"}"==i&&(o=o.prev),we&&")"==o.type&&"stat"==o.prev.type&&(o=o.prev);var u=o.type,d=i==u;return"vardef"==u?o.indented+("operator"==t.lastType||","==t.lastType?o.info+1:0):"form"==u&&"{"==i?o.indented:"form"==u?o.indented+_e:"stat"==u?o.indented+(be(t,n)?we||_e:0):"switch"!=o.info||d||0==r.doubleIndentSwitch?o.align?o.column+(d?0:1):o.indented+(d?0:_e):o.indented+(/^(?:case|default)\b/.test(n)?_e:2*_e)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Se?null:"/*",blockCommentEnd:Se?null:"*/",lineComment:Se?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Se?"json":"javascript",jsonldMode:Ce,jsonMode:Se,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];(t==w||t==C)&&e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=!0;return t}function n(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}e.defineMode("css",function(t,n){function r(e,t){return h=t,e}function i(e,t){var n=e.next();if(v[n]){var i=v[n](e,t);if(i!==!1)return i}return"@"==n?(e.eatWhile(/[\w\\\-]/),r("def",e.current())):"="==n||("~"==n||"|"==n)&&e.eat("=")?r(null,"compare"):'"'==n||"'"==n?(t.tokenize=o(n),t.tokenize(e,t)):"#"==n?(e.eatWhile(/[\w\\\-]/),r("atom","hash")):"!"==n?(e.match(/^\s*\w*/),r("keyword","important")):/\d/.test(n)||"."==n&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),r("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?r(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?r("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?r(null,n):"u"==n&&e.match(/rl(-prefix)?\(/)||"d"==n&&e.match("omain(")||"r"==n&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,r("property","word")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),r("property","word")):r(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),r("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?r("variable-2","variable-definition"):r("variable-2","variable")):e.match(/^\w+-/)?r("meta","meta"):void 0}function o(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(n.tokenize=null),r("string","string")}}function a(e,t){return e.next(),t.tokenize=e.match(/\s*[\"\')]/,!1)?null:o(")"),r(null,"(")}function l(e,t,n){this.type=e,this.indent=t,this.prev=n}function s(e,t,n,r){return e.context=new l(n,t.indentation()+(r===!1?0:g),e.context),n}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,n){return z[n.context.type](e,t,n)}function d(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return u(e,t,n)}function f(e){var t=e.current().toLowerCase();m=L.hasOwnProperty(t)?"atom":M.hasOwnProperty(t)?"keyword":"variable"}var p=n.inline;n.propertyKeywords||(n=e.resolveMode("text/css"));var h,m,g=t.indentUnit,v=n.tokenHooks,y=n.documentTypes||{},b=n.mediaTypes||{},x=n.mediaFeatures||{},k=n.mediaValueKeywords||{},_=n.propertyKeywords||{},w=n.nonStandardPropertyKeywords||{},C=n.fontProperties||{},S=n.counterDescriptors||{},M=n.colorKeywords||{},L=n.valueKeywords||{},T=n.allowNested,A=n.supportsAtComponent===!0,z={};return z.top=function(e,t,n){if("{"==e)return s(n,t,"block");if("}"==e&&n.context.prev)return c(n);if(A&&/@component/.test(e))return s(n,t,"atComponentBlock");if(/^@(-moz-)?document$/.test(e))return s(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(e))return s(n,t,"atBlock");if(/^@(font-face|counter-style)/.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(n,t,"at");if("hash"==e)m="builtin";else if("word"==e)m="tag";else{if("variable-definition"==e)return"maybeprop";
-for(var s=i.context,c=o?1:0;s&&s.tagName==n;s=s.prev)++c;r=l.to;for(var u=1;c>u;u++){var f=e.scanForClosingTag(t,r,null,a);if(!f||f.tag!=n)return!1;r=f.to}return!0}e.defineOption("autoCloseTags",!1,function(n,i,o){if(o!=e.Init&&o&&n.removeKeyMap("autoCloseTags"),i){var a={name:"autoCloseTags"};("object"!=typeof i||i.whenClosing)&&(a["'/'"]=function(e){return r(e)}),("object"!=typeof i||i.whenOpening)&&(a["'>'"]=function(e){return t(e)}),n.addKeyMap(a)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],l=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return n(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t=/^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\[\s\]\s|\[x\]\s|\s*)/,n=/^(\s*)(>[> ]*|[*+-]\s|(\d+)[.)])(\[\s\]\s*|\[x\]\s|\s*)$/,r=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(i){if(i.getOption("disableInput"))return e.Pass;for(var o=i.listSelections(),a=[],l=0;l<o.length;l++){var s=o[l].head,c=i.getStateAfter(s.line),u=c.list!==!1,f=0!==c.quote,d=i.getLine(s.line),p=t.exec(d);if(!o[l].empty()||!u&&!f||!p)return void i.execCommand("newlineAndIndent");if(n.test(d))i.replaceRange("",{line:s.line,ch:0},{line:s.line,ch:s.ch+1},"+delete"),a[l]="\n";else{var h=p[1],m=p[5],g=r.test(p[2])||p[2].indexOf(">")>=0?p[2]:parseInt(p[3],10)+1+p[4];a[l]="\n"+h+g+m}}i.replaceSelections(a,null,"+input")}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.search(r);return-1==t?0:t}var n={},r=/[^\s\u00a0]/,i=e.Pos;e.commands.toggleComment=function(e){for(var t=1/0,n=e.listSelections(),r=null,o=n.length-1;o>=0;o--){var a=n[o].from(),l=n[o].to();a.line>=t||(l.line>=t&&(l=i(t,0)),t=a.line,null==r?e.uncomment(a,l)?r="un":(e.lineComment(a,l),r="line"):"un"==r?e.uncomment(a,l):e.lineComment(a,l))}},e.defineExtension("lineComment",function(e,o,a){a||(a=n);var l=this,s=l.getModeAt(e),c=a.lineComment||s.lineComment;if(!c)return void((a.blockCommentStart||s.blockCommentStart)&&(a.fullLines=!0,l.blockComment(e,o,a)));var u=l.getLine(e.line);if(null!=u){var f=Math.min(0!=o.ch||o.line==e.line?o.line+1:o.line,l.lastLine()+1),d=null==a.padding?" ":a.padding,p=a.commentBlankLines||e.line==o.line;l.operation(function(){if(a.indent)for(var n=u.slice(0,t(u)),o=e.line;f>o;++o){var s=l.getLine(o),h=n.length;(p||r.test(s))&&(s.slice(0,h)!=n&&(h=t(s)),l.replaceRange(n+c+d,i(o,0),i(o,h)))}else for(var o=e.line;f>o;++o)(p||r.test(l.getLine(o)))&&l.replaceRange(c+d,i(o,0))})}}),e.defineExtension("blockComment",function(e,t,o){o||(o=n);var a=this,l=a.getModeAt(e),s=o.blockCommentStart||l.blockCommentStart,c=o.blockCommentEnd||l.blockCommentEnd;if(!s||!c)return void((o.lineComment||l.lineComment)&&0!=o.fullLines&&a.lineComment(e,t,o));var u=Math.min(t.line,a.lastLine());u!=e.line&&0==t.ch&&r.test(a.getLine(u))&&--u;var f=null==o.padding?" ":o.padding;e.line>u||a.operation(function(){if(0!=o.fullLines){var n=r.test(a.getLine(u));a.replaceRange(f+c,i(u)),a.replaceRange(s+f,i(e.line,0));var d=o.blockCommentLead||l.blockCommentLead;if(null!=d)for(var p=e.line+1;u>=p;++p)(p!=u||n)&&a.replaceRange(d+f,i(p,0))}else a.replaceRange(c,t),a.replaceRange(s,e)})}),e.defineExtension("uncomment",function(e,t,o){o||(o=n);var a,l=this,s=l.getModeAt(e),c=Math.min(0!=t.ch||t.line==e.line?t.line:t.line-1,l.lastLine()),u=Math.min(e.line,c),f=o.lineComment||s.lineComment,d=[],p=null==o.padding?" ":o.padding;e:if(f){for(var h=u;c>=h;++h){var m=l.getLine(h),g=m.indexOf(f);if(g>-1&&!/comment/.test(l.getTokenTypeAt(i(h,g+1)))&&(g=-1),-1==g&&(h!=c||h==u)&&r.test(m))break e;if(g>-1&&r.test(m.slice(0,g)))break e;d.push(m)}if(l.operation(function(){for(var e=u;c>=e;++e){var t=d[e-u],n=t.indexOf(f),r=n+f.length;0>n||(t.slice(r,r+p.length)==p&&(r+=p.length),a=!0,l.replaceRange("",i(e,n),i(e,r)))}}),a)return!0}var v=o.blockCommentStart||s.blockCommentStart,y=o.blockCommentEnd||s.blockCommentEnd;if(!v||!y)return!1;var b=o.blockCommentLead||s.blockCommentLead,x=l.getLine(u),_=c==u?x:l.getLine(c),k=x.indexOf(v),w=_.lastIndexOf(y);if(-1==w&&u!=c&&(_=l.getLine(--c),w=_.lastIndexOf(y)),-1==k||-1==w||!/comment/.test(l.getTokenTypeAt(i(u,k+1)))||!/comment/.test(l.getTokenTypeAt(i(c,w+1))))return!1;var C=x.lastIndexOf(v,e.ch),S=-1==C?-1:x.slice(0,e.ch).indexOf(y,C+v.length);if(-1!=C&&-1!=S&&S+y.length!=e.ch)return!1;S=_.indexOf(y,t.ch);var M=_.slice(t.ch).lastIndexOf(v,S-t.ch);return C=-1==S||-1==M?-1:t.ch+M,-1!=S&&-1!=C&&C!=t.ch?!1:(l.operation(function(){l.replaceRange("",i(c,w-(p&&_.slice(w-p.length,w)==p?p.length:0)),i(c,w+y.length));var e=k+v.length;if(p&&x.slice(e,e+p.length)==p&&(e+=p.length),l.replaceRange("",i(u,k),i(u,e)),b)for(var t=u+1;c>=t;++t){var n=l.getLine(t),o=n.indexOf(b);if(-1!=o&&!r.test(n.slice(0,o))){var a=o+b.length;p&&n.slice(a,a+p.length)==p&&(a+=p.length),l.replaceRange("",i(t,o),i(t,a))}}}),!0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var r,i=t.listSelections(),o=[],a=0;a<i.length;a++){var l=i[a].head,s=t.getTokenAt(l);if("comment"!=s.type)return e.Pass;var c=e.innerMode(t.getMode(),s.state).mode;if(r){if(r!=c)return e.Pass}else r=c;var u=null;if(r.blockCommentStart&&r.blockCommentContinue){var f,d=s.string.indexOf(r.blockCommentEnd),p=t.getRange(e.Pos(l.line,0),e.Pos(l.line,s.end));if(-1!=d&&d==s.string.length-r.blockCommentEnd.length&&l.ch>=d);else if(0==s.string.indexOf(r.blockCommentStart)){if(u=p.slice(0,s.start),!/^\s*$/.test(u)){u="";for(var h=0;h<s.start;++h)u+=" "}}else-1!=(f=p.indexOf(r.blockCommentContinue))&&f+r.blockCommentContinue.length>s.start&&/^\s*$/.test(p.slice(0,f))&&(u=p.slice(0,f));null!=u&&(u+=r.blockCommentContinue)}if(null==u&&r.lineComment&&n(t)){var m=t.getLine(l.line),f=m.indexOf(r.lineComment);f>-1&&(u=m.slice(0,f),/\S/.test(u)?u=null:u+=r.lineComment+m.slice(f+r.lineComment.length).match(/^\s*/)[0])}if(null==u)return e.Pass;o[a]="\n"+u}t.operation(function(){for(var e=i.length-1;e>=0;e--)t.replaceRange(o[e],i[e].from(),i[e].to(),"+insert")})}function n(e){var t=e.getOption("continueComments");return t&&"object"==typeof t?t.continueLineComment!==!1:!0}for(var r=["clike","css","javascript"],i=0;i<r.length;++i)e.extendMode(r[i],{blockCommentContinue:" * "});e.defineOption("continueComments",null,function(n,r,i){if(i&&i!=e.Init&&n.removeKeyMap("continueComment"),r){var o="Enter";"string"==typeof r?o=r:"object"==typeof r&&r.key&&(o=r.key);var a={name:"continueComment"};a[o]=t,n.addKeyMap(a)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n){for(var r=n.paragraphStart||e.getHelper(t,"paragraphStart"),i=t.line,o=e.firstLine();i>o;--i){var a=e.getLine(i);if(r&&r.test(a))break;if(!/\S/.test(a)){++i;break}}for(var l=n.paragraphEnd||e.getHelper(t,"paragraphEnd"),s=t.line+1,c=e.lastLine();c>=s;++s){var a=e.getLine(s);if(l&&l.test(a)){++s;break}if(!/\S/.test(a))break}return{from:i,to:s}}function n(e,t,n,r){for(var i=t;i>0&&!n.test(e.slice(i-1,i+1));--i);0==i&&(i=t);var o=i;if(r)for(;" "==e.charAt(o-1);)--o;return{from:o,to:i}}function r(t,r,o,a){r=t.clipPos(r),o=t.clipPos(o);var l=a.column||80,s=a.wrapOn||/\s\S|-[^\.\d]/,c=a.killTrailingSpace!==!1,u=[],f="",d=r.line,p=t.getRange(r,o,!1);if(!p.length)return null;for(var h=p[0].match(/^[ \t]*/)[0],m=0;m<p.length;++m){var g=p[m],v=f.length,y=0;f&&g&&!s.test(f.charAt(f.length-1)+g.charAt(0))&&(f+=" ",y=1);var b="";if(m&&(b=g.match(/^\s*/)[0],g=g.slice(b.length)),f+=g,m){var x=f.length>l&&h==b&&n(f,l,s,c);x&&x.from==v&&x.to==v+y?(f=h+g,++d):u.push({text:[y?" ":""],from:i(d,v),to:i(d+1,b.length)})}for(;f.length>l;){var _=n(f,l,s,c);u.push({text:["",h],from:i(d,_.from),to:i(d,_.to)}),f=h+f.slice(_.to),++d}}return u.length&&t.operation(function(){for(var e=0;e<u.length;++e){var n=u[e];t.replaceRange(n.text,n.from,n.to)}}),u.length?{from:u[0].from,to:e.changeEnd(u[u.length-1])}:null}var i=e.Pos;e.defineExtension("wrapParagraph",function(e,n){n=n||{},e||(e=this.getCursor());var o=t(this,e,n);return r(this,i(o.from,0),i(o.to-1),n)}),e.commands.wrapLines=function(e){e.operation(function(){for(var n=e.listSelections(),o=e.lastLine()+1,a=n.length-1;a>=0;a--){var l,s=n[a];if(s.empty()){var c=t(e,s.head,{});l={from:i(c.from,0),to:i(c.to-1)}}else l={from:s.from(),to:s.to()};l.to.line>=o||(o=l.from.line,r(e,l.from,l.to,{}))}})},e.defineExtension("wrapRange",function(e,t,n){return r(this,e,t,n||{})}),e.defineExtension("wrapParagraphsInRange",function(e,n,o){o=o||{};for(var a=this,l=[],s=e.line;s<=n.line;){var c=t(a,i(s,0),o);l.push(c),s=c.to}var u=!1;return l.length&&a.operation(function(){for(var e=l.length-1;e>=0;--e)u=u||r(a,i(l[e].from,0),i(l[e].to-1),o)}),u})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,i,o,a){function l(e){var n=s(t,i);if(!n||n.to.line-n.from.line<c)return null;for(var r=t.findMarksAt(n.from),o=0;o<r.length;++o)if(r[o].__isFold&&"fold"!==a){if(!e)return null;n.cleared=!0,r[o].clear()}return n}if(o&&o.call){var s=o;o=null}else var s=r(t,o,"rangeFinder");"number"==typeof i&&(i=e.Pos(i,0));var c=r(t,o,"minFoldSize"),u=l(!0);if(r(t,o,"scanUp"))for(;!u&&i.line>t.firstLine();)i=e.Pos(i.line-1,0),u=l(!1);if(u&&!u.cleared&&"unfold"!==a){var f=n(t,o);e.on(f,"mousedown",function(t){d.clear(),e.e_preventDefault(t)});var d=t.markText(u.from,u.to,{replacedWith:f,clearOnEnter:!0,__isFold:!0});d.on("clear",function(n,r){e.signal(t,"unfold",t,n,r)}),e.signal(t,"fold",t,u.from,u.to)}}function n(e,t){var n=r(e,t,"widget");if("string"==typeof n){var i=document.createTextNode(n);n=document.createElement("span"),n.appendChild(i),n.className="CodeMirror-foldmarker"}return n}function r(e,t,n){if(t&&void 0!==t[n])return t[n];var r=e.options.foldOptions;return r&&void 0!==r[n]?r[n]:i[n]}e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",function(e,n,r){t(this,e,n,r)}),e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),n=0;n<t.length;++n)if(t[n].__isFold)return!0}),e.commands.toggleFold=function(e){e.foldCode(e.getCursor())},e.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},e.commands.unfold=function(e){e.foldCode(e.getCursor(),null,"unfold")},e.commands.foldAll=function(t){t.operation(function(){for(var n=t.firstLine(),r=t.lastLine();r>=n;n++)t.foldCode(e.Pos(n,0),null,"fold")})},e.commands.unfoldAll=function(t){t.operation(function(){for(var n=t.firstLine(),r=t.lastLine();r>=n;n++)t.foldCode(e.Pos(n,0),null,"unfold")})},e.registerHelper("fold","combine",function(){var e=Array.prototype.slice.call(arguments,0);return function(t,n){for(var r=0;r<e.length;++r){var i=e[r](t,n);if(i)return i}}}),e.registerHelper("fold","auto",function(e,t){for(var n=e.getHelpers(t,"fold"),r=0;r<n.length;r++){var i=n[r](e,t);if(i)return i}});var i={rangeFinder:e.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1};e.defineOption("foldOptions",null),e.defineExtension("foldOption",function(e,t){return r(this,e,t)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","brace",function(t,n){function r(r){for(var i=n.ch,s=0;;){var c=0>=i?-1:l.lastIndexOf(r,i-1);if(-1!=c){if(1==s&&c<n.ch)break;if(o=t.getTokenTypeAt(e.Pos(a,c+1)),!/^(comment|string)/.test(o))return c+1;i=c-1}else{if(1==s)break;s=1,i=l.length}}}var i,o,a=n.line,l=t.getLine(a),s="{",c="}",i=r("{");if(null==i&&(s="[",c="]",i=r("[")),null!=i){var u,f,d=1,p=t.lastLine();e:for(var h=a;p>=h;++h)for(var m=t.getLine(h),g=h==a?i:0;;){var v=m.indexOf(s,g),y=m.indexOf(c,g);if(0>v&&(v=m.length),0>y&&(y=m.length),g=Math.min(v,y),g==m.length)break;if(t.getTokenTypeAt(e.Pos(h,g+1))==o)if(g==v)++d;else if(!--d){u=h,f=g;break e}++g}if(null!=u&&(a!=u||f!=i))return{from:e.Pos(a,i),to:e.Pos(u,f)}}}),e.registerHelper("fold","import",function(t,n){function r(n){if(n<t.firstLine()||n>t.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);o>=i;++i){var a=t.getLine(i),l=a.indexOf(";");if(-1!=l)return{startCh:r.end,end:e.Pos(i,l)}}}var i,n=n.line,o=r(n);if(!o||r(n-1)||(i=r(n-2))&&i.end.line==n-1)return null;for(var a=o.end;;){var l=r(a.line+1);if(null==l)break;a=l.end}return{from:t.clipPos(e.Pos(n,o.startCh+1)),to:a}}),e.registerHelper("fold","include",function(t,n){function r(n){if(n<t.firstLine()||n>t.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var n=n.line,i=r(n);if(null==i||null!=r(n-1))return null;for(var o=n;;){var a=r(o+1);if(null==a)break;++o}return{from:e.Pos(n,i+1),to:t.clipPos(e.Pos(o))}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],e):e(CodeMirror)}(function(e){"use strict";function t(e){this.options=e,this.from=this.to=0}function n(e){return e===!0&&(e={}),null==e.gutter&&(e.gutter="CodeMirror-foldgutter"),null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open"),null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded"),e}function r(e,t){for(var n=e.findMarksAt(f(t)),r=0;r<n.length;++r)if(n[r].__isFold&&n[r].find().from.line==t)return n[r]}function i(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function o(e,t,n){var o=e.state.foldGutter.options,a=t,l=e.foldOption(o,"minFoldSize"),s=e.foldOption(o,"rangeFinder");e.eachLine(t,n,function(t){var n=null;if(r(e,a))n=i(o.indicatorFolded);else{var c=f(a,0),u=s&&s(e,c);u&&u.to.line-u.from.line>=l&&(n=i(o.indicatorOpen))}e.setGutterMarker(t,o.gutter,n),++a})}function a(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation(function(){o(e,t.from,t.to)}),n.from=t.from,n.to=t.to)}function l(e,t,n){var i=e.state.foldGutter;if(i){var o=i.options;if(n==o.gutter){var a=r(e,t);a?a.clear():e.foldCode(f(t,0),o.rangeFinder)}}}function s(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){a(e)},n.foldOnChangeTimeSpan||600)}}function c(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?a(e):e.operation(function(){n.from<t.from&&(o(e,n.from,t.from),t.from=n.from),n.to>t.to&&(o(e,t.to,n.to),t.to=n.to)})},n.updateViewportTimeSpan||400)}}function u(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&r<n.to&&o(e,r,r+1)}}e.defineOption("foldGutter",!1,function(r,i,o){o&&o!=e.Init&&(r.clearGutter(r.state.foldGutter.options.gutter),r.state.foldGutter=null,r.off("gutterClick",l),r.off("change",s),r.off("viewportChange",c),r.off("fold",u),r.off("unfold",u),r.off("swapDoc",a)),i&&(r.state.foldGutter=new t(n(i)),a(r),r.on("gutterClick",l),r.on("change",s),r.on("viewportChange",c),r.on("fold",u),r.on("unfold",u),r.on("swapDoc",a))});var f=e.Pos}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","markdown",function(t,n){function r(n){var r=t.getTokenTypeAt(e.Pos(n,0));return r&&/\bheader\b/.test(r)}function i(e,t,n){var i=t&&t.match(/^#+/);return i&&r(e)?i[0].length:(i=n&&n.match(/^[=\-]+\s*$/),i&&r(e+1)?"="==n[0]?1:2:o)}var o=100,a=t.getLine(n.line),l=t.getLine(n.line+1),s=i(n.line,a,l);if(s===o)return void 0;for(var c=t.lastLine(),u=n.line,f=t.getLine(u+2);c>u&&!(i(u+1,l,f)<=s);)++u,l=f,f=t.getLine(u+2);return{from:e.Pos(n.line,a.length),to:e.Pos(u,t.getLine(u).length)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.line-t.line||e.ch-t.ch}function n(e,t,n,r){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=r?r.from:e.firstLine(),this.max=r?r.to-1:e.lastLine()}function r(e,t){var n=e.cm.getTokenTypeAt(d(e.line,t));return n&&/\btag\b/.test(n)}function i(e){return e.line>=e.max?void 0:(e.ch=0,e.text=e.cm.getLine(++e.line),!0)}function o(e){return e.line<=e.min?void 0:(e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0)}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(i(e))continue;return}{if(r(e,t+1)){var n=e.text.lastIndexOf("/",t),o=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,o?"selfClose":"regular"}e.ch=t+1}}}function l(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(o(e))continue;return}if(r(e,t+1)){m.lastIndex=t,e.ch=t;var n=m.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function s(e){for(;;){m.lastIndex=e.ch;var t=m.exec(e.text);if(!t){if(i(e))continue;return}{if(r(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(o(e))continue;return}{if(r(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}}function u(e,t){for(var n=[];;){var r,i=s(e),o=e.line,l=e.ch-(i?i[0].length:0);if(!i||!(r=a(e)))return;if("selfClose"!=r)if(i[1]){for(var c=n.length-1;c>=0;--c)if(n[c]==i[2]){n.length=c;break}if(0>c&&(!t||t==i[2]))return{tag:i[2],from:d(o,l),to:d(e.line,e.ch)}}else n.push(i[2])}}function f(e,t){for(var n=[];;){var r=c(e);if(!r)return;if("selfClose"!=r){var i=e.line,o=e.ch,a=l(e);if(!a)return;if(a[1])n.push(a[2]);else{for(var s=n.length-1;s>=0;--s)if(n[s]==a[2]){n.length=s;break}if(0>s&&(!t||t==a[2]))return{tag:a[2],from:d(e.line,e.ch),to:d(i,o)}}}else l(e)}}var d=e.Pos,p="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",h=p+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",m=new RegExp("<(/?)(["+p+"]["+h+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var r=new n(e,t.line,0);;){var i,o=s(r);if(!o||r.line!=t.line||!(i=a(r)))return;if(!o[1]&&"selfClose"!=i){var t=d(r.line,r.ch),l=u(r,o[2]);return l&&{from:t,to:l.from}}}}),e.findMatchingTag=function(e,r,i){var o=new n(e,r.line,r.ch,i);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var s=a(o),c=s&&d(o.line,o.ch),p=s&&l(o);if(s&&p&&!(t(o,r)>0)){var h={from:d(o.line,o.ch),to:c,tag:p[2]};return"selfClose"==s?{open:h,close:null,at:"open"}:p[1]?{open:f(o,p[2]),close:h,at:"close"}:(o=new n(e,c.line,c.ch,i),{open:h,close:u(o,p[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,r){for(var i=new n(e,t.line,t.ch,r);;){var o=f(i);if(!o)break;var a=new n(e,t.line,t.ch,r),l=u(a,o.tag);if(l)return{open:o,close:l}}},e.scanForClosingTag=function(e,t,r,i){var o=new n(e,t.line,t.ch,i?{from:0,to:i}:null);return u(o,r)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("xml",function(t,n){function r(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if("<"==r)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(a("atom","]]>")):null:e.match("--")?n(a("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(l(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=a("meta","?>"),"meta"):(w=e.eat("/")?"closeTag":"openTag",t.tokenize=i,"tag bracket");if("&"==r){var o;return o=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),o?"atom":"error"}return e.eatWhile(/[^&<]/),null}function i(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=r,w=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return w="equals",null;if("<"==n){t.tokenize=r,t.state=f,t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=o(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function o(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=i;break}return"string"};return t.isInAttribute=!0,t}function a(e,t){return function(n,i){for(;!n.eol();){if(n.match(t)){i.tokenize=r;break}n.next()}return e}}function l(e){return function(t,n){for(var i;null!=(i=t.next());){if("<"==i)return n.tokenize=l(e+1),n.tokenize(t,n);if(">"==i){if(1==e){n.tokenize=r;break}return n.tokenize=l(e-1),n.tokenize(t,n)}}return"meta"}}function s(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(S.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function c(e){e.context&&(e.context=e.context.prev)}function u(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!S.contextGrabbers.hasOwnProperty(n)||!S.contextGrabbers[n].hasOwnProperty(t))return;c(e)}}function f(e,t,n){return"openTag"==e?(n.tagStart=t.column(),d):"closeTag"==e?p:f}function d(e,t,n){return"word"==e?(n.tagName=t.current(),C="tag",g):(C="error",d)}function p(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&S.implicitlyClosed.hasOwnProperty(n.context.tagName)&&c(n),n.context&&n.context.tagName==r?(C="tag",h):(C="tag error",m)}return C="error",m}function h(e,t,n){return"endTag"!=e?(C="error",h):(c(n),f)}function m(e,t,n){return C="error",h(e,t,n)}function g(e,t,n){if("word"==e)return C="attribute",v;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||S.autoSelfClosers.hasOwnProperty(r)?u(n,r):(u(n,r),n.context=new s(n,r,i==n.indented)),f}return C="error",g}function v(e,t,n){return"equals"==e?y:(S.allowMissing||(C="error"),g(e,t,n))}function y(e,t,n){return"string"==e?b:"word"==e&&S.allowUnquoted?(C="string",g):(C="error",g(e,t,n))}function b(e,t,n){return"string"==e?b:g(e,t,n)}var x=t.indentUnit,_=n.multilineTagIndentFactor||1,k=n.multilineTagIndentPastTag;null==k&&(k=!0);var w,C,S=n.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},M=n.alignCDATA;return{startState:function(){return{tokenize:r,state:f,indented:0,tagName:null,tagStart:null,context:null}},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;w=null;var n=t.tokenize(e,t);return(n||w)&&"comment"!=n&&(C=null,t.state=t.state(w||n,e,t),C&&(n="error"==C?n+" error":C)),n},indent:function(t,n,o){var a=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+x;if(a&&a.noIndent)return e.Pass;if(t.tokenize!=i&&t.tokenize!=r)return o?o.match(/^(\s*)/)[0].length:0;if(t.tagName)return k?t.tagStart+t.tagName.length+2:t.tagStart+x*_;if(M&&/<!\[CDATA\[/.test(n))return 0;var l=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(l&&l[1])for(;a;){if(a.tagName==l[2]){a=a.prev;break}if(!S.implicitlyClosed.hasOwnProperty(a.tagName))break;a=a.prev}else if(l)for(;a;){var s=S.contextGrabbers[a.tagName];if(!s||!s.hasOwnProperty(l[2]))break;a=a.prev}for(;a&&!a.startOfLine;)a=a.prev;return a?a.indent+x:0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:n.htmlMode?"html":"xml",helperType:n.htmlMode?"html":"xml"}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("markdown",function(t,n){function r(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}function i(e,t,n){return t.f=t.inline=n,n(e,t)}function o(e,t,n){return t.f=t.block=n,n(e,t)}function a(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,_||e.f!=s||(e.f=p,e.block=l),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.thisLineHasContent=!1,null}function l(e,t){var o=e.sol(),a=t.list!==!1,l=t.indentedCode;t.indentedCode=!1,a&&(t.indentationDiff>=0?(t.indentationDiff<4&&(t.indentation-=t.indentationDiff),t.list=null):t.indentation>0?(t.list=null,t.listDepth=Math.floor(t.indentation/4)):(t.list=!1,t.listDepth=0));var s=null;if(t.indentationDiff>=4)return e.skipToEnd(),l||!t.prevLineHasContent?(t.indentation-=4,t.indentedCode=!0,S):null;if(e.eatSpace())return null;if((s=e.match(B))&&s[1].length<=6)return t.header=s[1].length,n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,f(t);if(t.prevLineHasContent&&!t.quote&&!a&&!l&&(s=e.match(U)))return t.header="="==s[0].charAt(0)?1:2,n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,f(t);if(e.eat(">"))return t.quote=o?1:t.quote+1,n.highlightFormatting&&(t.formatting="quote"),e.eatSpace(),f(t);if("["===e.peek())return i(e,t,v);if(e.match(W,!0))return t.hr=!0,z;if((!t.prevLineHasContent||a)&&(e.match(F,!1)||e.match(H,!1))){var u=null;return e.match(F,!0)?u="ul":(e.match(H,!0),u="ol"),t.indentation+=4,t.list=!0,t.listDepth++,n.taskLists&&e.match($,!1)&&(t.taskList=!0),t.f=t.inline,n.highlightFormatting&&(t.formatting=["list","list-"+u]),f(t)}return n.fencedCodeBlocks&&e.match(/^```[ \t]*([\w+#]*)/,!0)?(t.localMode=r(RegExp.$1),t.localMode&&(t.localState=t.localMode.startState()),t.f=t.block=c,n.highlightFormatting&&(t.formatting="code-block"),t.code=!0,f(t)):i(e,t,t.inline)}function s(e,t){var n=k.token(e,t.htmlState);return(_&&null===t.htmlState.tagStart&&!t.htmlState.context||t.md_inside&&e.current().indexOf(">")>-1)&&(t.f=p,t.block=l,t.htmlState=null),n}function c(e,t){return e.sol()&&e.match("```",!1)?(t.localMode=t.localState=null,t.f=t.block=u,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),S)}function u(e,t){e.match("```"),t.block=l,t.f=p,n.highlightFormatting&&(t.formatting="code-block"),t.code=!0;var r=f(t);return t.code=!1,r}function f(e){var t=[];if(e.formatting){t.push(O),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(O+"-"+e.formatting[r]),"header"===e.formatting[r]&&t.push(O+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&t.push(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?O+"-"+e.formatting[r]+"-"+e.quote:"error")}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(P,"url"):(e.strong&&t.push(j),e.em&&t.push(D),e.strikethrough&&t.push(R),e.linkText&&t.push(I),e.code&&t.push(S)),e.header&&(t.push(C),t.push(C+"-"+e.header)),e.quote&&(t.push(M),t.push(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?M+"-"+e.quote:M+"-"+n.maxBlockquoteDepth)),e.list!==!1){var i=(e.listDepth-1)%3;t.push(i?1===i?T:A:L)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function d(e,t){return e.match(V,!0)?f(t):void 0}function p(t,r){var i=r.text(t,r);if("undefined"!=typeof i)return i;if(r.list)return r.list=null,f(r);if(r.taskList){var a="x"!==t.match($,!0)[1];return a?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,f(r)}if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),f(r);var l=t.sol(),c=t.next();if("\\"===c&&(t.next(),n.highlightFormatting)){var u=f(r);return u?u+" formatting-escape":"formatting-escape"}if(r.linkTitle){r.linkTitle=!1;var d=c;"("===c&&(d=")"),d=(d+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var p="^\\s*(?:[^"+d+"\\\\]+|\\\\\\\\|\\\\.)"+d;if(t.match(new RegExp(p),!0))return P}if("`"===c){var g=r.formatting;n.highlightFormatting&&(r.formatting="code");var v=f(r),y=t.pos;t.eatWhile("`");var b=1+t.pos-y;return r.code?b===w?(r.code=!1,v):(r.formatting=g,f(r)):(w=b,r.code=!0,f(r))}if(r.code)return f(r);if("!"===c&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),r.inline=r.f=m,E;if("["===c&&t.match(/.*\](\(.*\)| ?\[.*\])/,!1))return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),f(r);if("]"===c&&r.linkText&&t.match(/\(.*\)| ?\[.*\]/,!1)){n.highlightFormatting&&(r.formatting="link");var u=f(r);return r.linkText=!1,r.inline=r.f=m,u}if("<"===c&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=h,n.highlightFormatting&&(r.formatting="link");var u=f(r);return u?u+=" ":u="",u+q}if("<"===c&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=h,n.highlightFormatting&&(r.formatting="link");var u=f(r);return u?u+=" ":u="",u+N}if("<"===c&&t.match(/^\w/,!1)){if(-1!=t.string.indexOf(">")){var x=t.string.substring(1,t.string.indexOf(">"));/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(x)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(k),o(t,r,s)}if("<"===c&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";var _=!1;if(!n.underscoresBreakWords&&"_"===c&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var C=t.pos-2;if(C>=0){var S=t.string.charAt(C);"_"!==S&&S.match(/(\w)/,!1)&&(_=!0)}}if("*"===c||"_"===c&&!_)if(l&&" "===t.peek());else{if(r.strong===c&&t.eat(c)){n.highlightFormatting&&(r.formatting="strong");var v=f(r);return r.strong=!1,v}if(!r.strong&&t.eat(c))return r.strong=c,n.highlightFormatting&&(r.formatting="strong"),f(r);if(r.em===c){n.highlightFormatting&&(r.formatting="em");var v=f(r);return r.em=!1,v}if(!r.em)return r.em=c,n.highlightFormatting&&(r.formatting="em"),f(r)}else if(" "===c&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return f(r);t.backUp(1)}if(n.strikethrough)if("~"===c&&t.eatWhile(c)){if(r.strikethrough){n.highlightFormatting&&(r.formatting="strikethrough");
-
-var v=f(r);return r.strikethrough=!1,v}if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),f(r)}else if(" "===c&&t.match(/^~~/,!0)){if(" "===t.peek())return f(r);t.backUp(2)}return" "===c&&(t.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),f(r)}function h(e,t){var r=e.next();if(">"===r){t.f=t.inline=p,n.highlightFormatting&&(t.formatting="link");var i=f(t);return i?i+=" ":i="",i+q}return e.match(/^[^>]+/,!0),q}function m(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(t.f=t.inline=g("("===r?")":"]"),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,f(t)):"error"}function g(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=p,n.highlightFormatting&&(r.formatting="link-string");var o=f(r);return r.linkHref=!1,o}return t.match(x(e),!0)&&t.backUp(1),r.linkHref=!0,f(r)}}function v(e,t){return e.match(/^[^\]]*\]:/,!1)?(t.f=y,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,f(t)):i(e,t,p)}function y(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=b,n.highlightFormatting&&(t.formatting="link");var r=f(t);return t.linkText=!1,r}return e.match(/^[^\]]+/,!0),I}function b(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=p,P+" url")}function x(e){return G[e]||(e=(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),G[e]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+e+")")),G[e]}var _=e.modes.hasOwnProperty("xml"),k=e.getMode(t,_?{name:"xml",htmlMode:!0}:"text/plain");void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.underscoresBreakWords&&(n.underscoresBreakWords=!0),void 0===n.fencedCodeBlocks&&(n.fencedCodeBlocks=!1),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1);var w=0,C="header",S="comment",M="quote",L="variable-2",T="variable-3",A="keyword",z="hr",E="tag",O="formatting",q="link",N="link",I="link",P="string",D="em",j="strong",R="strikethrough",W=/^([*\-_])(?:\s*\1){2,}\s*$/,F=/^[*\-+]\s+/,H=/^[0-9]+([.)])\s+/,$=/^\[(x| )\](?=\s)/,B=/^(#+)(?: |$)/,U=/^ *(?:\={1,}|-{1,})\s*$/,V=/^[^#!\[\]*_\\<>` "'(~]+/,G=[],K={startState:function(){return{f:l,prevLineHasContent:!1,thisLineHasContent:!1,block:l,htmlState:null,indentation:0,inline:p,text:d,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1}},copyState:function(t){return{f:t.f,prevLineHasContent:t.prevLineHasContent,thisLineHasContent:t.thisLineHasContent,block:t.block,htmlState:t.htmlState&&e.copyState(k,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listDepth:t.listDepth,quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside}},token:function(e,t){if(t.formatting=!1,e.sol()){var n=!!t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||n)return t.prevLineHasContent=!1,a(t),n?this.token(e,t):null;t.prevLineHasContent=t.thisLineHasContent,t.thisLineHasContent=!0,t.taskList=!1,t.code=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length,i=4*Math.floor((r-t.indentation)/4);i>4&&(i=4);var o=t.indentation+i;if(t.indentationDiff=o-t.indentation,t.indentation=o,r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==s?{state:e.htmlState,mode:k}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:K}},blankLine:a,getType:f,fold:"markdown"};return K},"xml"),e.defineMIME("text/x-markdown","markdown")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../markdown/markdown"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("gfm",function(t,n){function r(e){return e.code=!1,null}var i=0,o={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,t){if(t.combineTokens=null,t.codeBlock)return e.match(/^```/)?(t.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(t.code=!1),e.sol()&&e.match(/^```/))return e.skipToEnd(),t.codeBlock=!0,null;if("`"===e.peek()){e.next();var n=e.pos;e.eatWhile("`");var r=1+e.pos-n;return t.code?r===i&&(t.code=!1):(i=r,t.code=!0),null}if(t.code)return e.next(),null;if(e.eatSpace())return t.ateSpace=!0,null;if(e.sol()||t.ateSpace){if(t.ateSpace=!1,e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return t.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return t.combineTokens=!0,"link"}return e.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i)&&"]("!=e.string.slice(e.start-2,e.start)?(t.combineTokens=!0,"link"):(e.next(),null)},blankLine:r},a={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:!0,strikethrough:!0};for(var l in n)a[l]=n[l];return a.name="markdown",e.defineMIME("gfmBase",a),e.overlayMode(e.getMode(t,"gfmBase"),o)},"markdown")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("javascript",function(t,n){function r(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function i(e,t,n){return ve=e,ye=n,t}function o(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=a(n),t.tokenize(e,t);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==n&&e.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&e.eat(">"))return i("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),i("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if("/"==n)return e.eat("*")?(t.tokenize=l,l(e,t)):e.eat("/")?(e.skipToEnd(),i("comment","comment")):"operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)?(r(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),i("regexp","string-2")):(e.eatWhile(Me),i("operator","operator",e.current()));if("`"==n)return t.tokenize=s,s(e,t);if("#"==n)return e.skipToEnd(),i("error","error");if(Me.test(n))return e.eatWhile(Me),i("operator","operator",e.current());if(Ce.test(n)){e.eatWhile(Ce);var o=e.current(),c=Se.propertyIsEnumerable(o)&&Se[o];return c&&"."!=t.lastType?i(c.type,c.style,o):i("variable","variable",o)}}function a(e){return function(t,n){var r,a=!1;if(_e&&"@"==t.peek()&&t.match(Le))return n.tokenize=o,i("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||a);)a=!a&&"\\"==r;return a||(n.tokenize=o),i("string","string")}}function l(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=o;break}r="*"==n}return i("comment","comment")}function s(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=o;break}r=!r&&"\\"==n}return i("quasi","string-2",e.current())}function c(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(0>n)){for(var r=0,i=!1,o=n-1;o>=0;--o){var a=e.string.charAt(o),l=Te.indexOf(a);if(l>=0&&3>l){if(!r){++o;break}if(0==--r)break}else if(l>=3&&6>l)++r;else if(Ce.test(a))i=!0;else{if(/["'\/]/.test(a))return;if(i&&!r){++o;break}}}i&&!r&&(t.fatArrowAt=o)}}function u(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function f(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function d(e,t,n,r,i){var o=e.cc;for(ze.state=e,ze.stream=i,ze.marked=null,ze.cc=o,ze.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():ke?k:_;if(a(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return ze.marked?ze.marked:"variable"==n&&f(e,r)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)ze.cc.push(arguments[e])}function h(){return p.apply(null,arguments),!0}function m(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var r=ze.state;if(r.context){if(ze.marked="def",t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function g(){ze.state.context={prev:ze.state.context,vars:ze.state.localVars},ze.state.localVars=Ee}function v(){ze.state.localVars=ze.state.context.vars,ze.state.context=ze.state.context.prev}function y(e,t){var n=function(){var n=ze.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new u(r,ze.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function b(){var e=ze.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(e){function t(n){return n==e?h():";"==e?p():h(t)}return t}function _(e,t){return"var"==e?h(y("vardef",t.length),B,x(";"),b):"keyword a"==e?h(y("form"),k,_,b):"keyword b"==e?h(y("form"),_,b):"{"==e?h(y("}"),W,b):";"==e?h():"if"==e?("else"==ze.state.lexical.info&&ze.state.cc[ze.state.cc.length-1]==b&&ze.state.cc.pop()(),h(y("form"),k,_,b,X)):"function"==e?h(te):"for"==e?h(y("form"),Z,_,b):"variable"==e?h(y("stat"),q):"switch"==e?h(y("form"),k,y("}","switch"),x("{"),W,b,b):"case"==e?h(k,x(":")):"default"==e?h(x(":")):"catch"==e?h(y("form"),g,x("("),ne,x(")"),_,b,v):"module"==e?h(y("form"),g,le,v,b):"class"==e?h(y("form"),re,b):"export"==e?h(y("form"),se,b):"import"==e?h(y("form"),ce,b):p(y("stat"),k,x(";"),b)}function k(e){return C(e,!1)}function w(e){return C(e,!0)}function C(e,t){if(ze.state.fatArrowAt==ze.stream.start){var n=t?O:E;if("("==e)return h(g,y(")"),j(U,")"),b,x("=>"),n,v);if("variable"==e)return p(g,U,x("=>"),n,v)}var r=t?T:L;return Ae.hasOwnProperty(e)?h(r):"function"==e?h(te,r):"keyword c"==e?h(t?M:S):"("==e?h(y(")"),S,me,x(")"),b,r):"operator"==e||"spread"==e?h(t?w:k):"["==e?h(y("]"),pe,b,r):"{"==e?R(I,"}",null,r):"quasi"==e?p(A,r):h()}function S(e){return e.match(/[;\}\)\],]/)?p():p(k)}function M(e){return e.match(/[;\}\)\],]/)?p():p(w)}function L(e,t){return","==e?h(k):T(e,t,!1)}function T(e,t,n){var r=0==n?L:T,i=0==n?k:w;return"=>"==e?h(g,n?O:E,v):"operator"==e?/\+\+|--/.test(t)?h(r):"?"==t?h(k,x(":"),i):h(i):"quasi"==e?p(A,r):";"!=e?"("==e?R(w,")","call",r):"."==e?h(N,r):"["==e?h(y("]"),S,x("]"),b,r):void 0:void 0}function A(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?h(A):h(k,z)}function z(e){return"}"==e?(ze.marked="string-2",ze.state.tokenize=s,h(A)):void 0}function E(e){return c(ze.stream,ze.state),p("{"==e?_:k)}function O(e){return c(ze.stream,ze.state),p("{"==e?_:w)}function q(e){return":"==e?h(b,_):p(L,x(";"),b)}function N(e){return"variable"==e?(ze.marked="property",h()):void 0}function I(e,t){return"variable"==e||"keyword"==ze.style?(ze.marked="property",h("get"==t||"set"==t?P:D)):"number"==e||"string"==e?(ze.marked=_e?"property":ze.style+" property",h(D)):"jsonld-keyword"==e?h(D):"["==e?h(k,x("]"),D):void 0}function P(e){return"variable"!=e?p(D):(ze.marked="property",h(te))}function D(e){return":"==e?h(w):"("==e?p(te):void 0}function j(e,t){function n(r){if(","==r){var i=ze.state.lexical;return"call"==i.info&&(i.pos=(i.pos||0)+1),h(e,n)}return r==t?h():h(x(t))}return function(r){return r==t?h():p(e,n)}}function R(e,t,n){for(var r=3;r<arguments.length;r++)ze.cc.push(arguments[r]);return h(y(t,n),j(e,t),b)}function W(e){return"}"==e?h():p(_,W)}function F(e){return we&&":"==e?h($):void 0}function H(e,t){return"="==t?h(w):void 0}function $(e){return"variable"==e?(ze.marked="variable-3",h()):void 0}function B(){return p(U,F,G,K)}function U(e,t){return"variable"==e?(m(t),h()):"["==e?R(U,"]"):"{"==e?R(V,"}"):void 0}function V(e,t){return"variable"!=e||ze.stream.match(/^\s*:/,!1)?("variable"==e&&(ze.marked="property"),h(x(":"),U,G)):(m(t),h(G))}function G(e,t){return"="==t?h(w):void 0}function K(e){return","==e?h(B):void 0}function X(e,t){return"keyword b"==e&&"else"==t?h(y("form","else"),_,b):void 0}function Z(e){return"("==e?h(y(")"),Y,x(")"),b):void 0}function Y(e){return"var"==e?h(B,x(";"),J):";"==e?h(J):"variable"==e?h(Q):p(k,x(";"),J)}function Q(e,t){return"in"==t||"of"==t?(ze.marked="keyword",h(k)):h(L,J)}function J(e,t){return";"==e?h(ee):"in"==t||"of"==t?(ze.marked="keyword",h(k)):p(k,x(";"),ee)}function ee(e){")"!=e&&h(k)}function te(e,t){return"*"==t?(ze.marked="keyword",h(te)):"variable"==e?(m(t),h(te)):"("==e?h(g,y(")"),j(ne,")"),b,_,v):void 0}function ne(e){return"spread"==e?h(ne):p(U,F,H)}function re(e,t){return"variable"==e?(m(t),h(ie)):void 0}function ie(e,t){return"extends"==t?h(k,ie):"{"==e?h(y("}"),oe,b):void 0}function oe(e,t){return"variable"==e||"keyword"==ze.style?"static"==t?(ze.marked="keyword",h(oe)):(ze.marked="property","get"==t||"set"==t?h(ae,te,oe):h(te,oe)):"*"==t?(ze.marked="keyword",h(oe)):";"==e?h(oe):"}"==e?h():void 0}function ae(e){return"variable"!=e?p():(ze.marked="property",h())}function le(e,t){return"string"==e?h(_):"variable"==e?(m(t),h(de)):void 0}function se(e,t){return"*"==t?(ze.marked="keyword",h(de,x(";"))):"default"==t?(ze.marked="keyword",h(k,x(";"))):p(_)}function ce(e){return"string"==e?h():p(ue,de)}function ue(e,t){return"{"==e?R(ue,"}"):("variable"==e&&m(t),"*"==t&&(ze.marked="keyword"),h(fe))}function fe(e,t){return"as"==t?(ze.marked="keyword",h(ue)):void 0}function de(e,t){return"from"==t?(ze.marked="keyword",h(k)):void 0}function pe(e){return"]"==e?h():p(w,he)}function he(e){return"for"==e?p(me,x("]")):","==e?h(j(M,"]")):p(j(w,"]"))}function me(e){return"for"==e?h(Z,me):"if"==e?h(k,me):void 0}function ge(e,t){return"operator"==e.lastType||","==e.lastType||Me.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var ve,ye,be=t.indentUnit,xe=n.statementIndent,_e=n.jsonld,ke=n.json||_e,we=n.typescript,Ce=n.wordCharacters||/[\w$\xa1-\uffff]/,Se=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={"if":e("if"),"while":t,"with":t,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":r,"delete":r,"throw":r,"debugger":r,"var":e("var"),"const":e("var"),let:e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,"typeof":i,"instanceof":i,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o,"this":e("this"),module:e("module"),"class":e("class"),"super":e("atom"),"yield":r,"export":e("export"),"import":e("import"),"extends":r};if(we){var l={type:"variable",style:"variable-3"},s={"interface":e("interface"),"extends":e("extends"),constructor:e("constructor"),"public":e("public"),"private":e("private"),"protected":e("protected"),"static":e("static"),string:l,number:l,bool:l,any:l};for(var c in s)a[c]=s[c]}return a}(),Me=/[+\-*&%=<>!?|~^]/,Le=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Te="([{}])",Ae={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},ze={state:null,column:null,marked:null,cc:null},Ee={name:"this",next:{name:"arguments"}};return b.lex=!0,{startState:function(e){var t={tokenize:o,lastType:"sof",cc:[],lexical:new u((e||0)-be,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),c(e,t)),t.tokenize!=l&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==ve?n:(t.lastType="operator"!=ve||"++"!=ye&&"--"!=ye?ve:"incdec",d(t,n,ve,ye,e))},indent:function(t,r){if(t.tokenize==l)return e.Pass;if(t.tokenize!=o)return 0;var i=r&&r.charAt(0),a=t.lexical;if(!/^\s*else\b/.test(r))for(var s=t.cc.length-1;s>=0;--s){var c=t.cc[s];if(c==b)a=a.prev;else if(c!=X)break}"stat"==a.type&&"}"==i&&(a=a.prev),xe&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var u=a.type,f=i==u;return"vardef"==u?a.indented+("operator"==t.lastType||","==t.lastType?a.info+1:0):"form"==u&&"{"==i?a.indented:"form"==u?a.indented+be:"stat"==u?a.indented+(ge(t,r)?xe||be:0):"switch"!=a.info||f||0==n.doubleIndentSwitch?a.align?a.column+(f?0:1):a.indented+(f?0:be):a.indented+(/^(?:case|default)\b/.test(r)?be:2*be)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:ke?null:"/*",blockCommentEnd:ke?null:"*/",lineComment:ke?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:ke?"json":"javascript",jsonldMode:_e,jsonMode:ke}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=!0;return t}function n(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}e.defineMode("css",function(t,n){function r(e,t){return p=t,e}function i(e,t){var n=e.next();if(g[n]){var i=g[n](e,t);if(i!==!1)return i}return"@"==n?(e.eatWhile(/[\w\\\-]/),r("def",e.current())):"="==n||("~"==n||"|"==n)&&e.eat("=")?r(null,"compare"):'"'==n||"'"==n?(t.tokenize=o(n),t.tokenize(e,t)):"#"==n?(e.eatWhile(/[\w\\\-]/),r("atom","hash")):"!"==n?(e.match(/^\s*\w*/),r("keyword","important")):/\d/.test(n)||"."==n&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),r("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?r(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?r("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?r(null,n):"u"==n&&e.match(/rl(-prefix)?\(/)||"d"==n&&e.match("omain(")||"r"==n&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,r("property","word")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),r("property","word")):r(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),r("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?r("variable-2","variable-definition"):r("variable-2","variable")):e.match(/^\w+-/)?r("meta","meta"):void 0}function o(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(n.tokenize=null),r("string","string")}}function a(e,t){return e.next(),t.tokenize=e.match(/\s*[\"\')]/,!1)?null:o(")"),r(null,"(")}function l(e,t,n){this.type=e,this.indent=t,this.prev=n}function s(e,t,n){return e.context=new l(n,t.indentation()+m,e.context),n}function c(e){return e.context=e.context.prev,e.context.type}function u(e,t,n){return L[n.context.type](e,t,n)}function f(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return u(e,t,n)}function d(e){var t=e.current().toLowerCase();h=S.hasOwnProperty(t)?"atom":C.hasOwnProperty(t)?"keyword":"variable"}n.propertyKeywords||(n=e.resolveMode("text/css"));var p,h,m=t.indentUnit,g=n.tokenHooks,v=n.documentTypes||{},y=n.mediaTypes||{},b=n.mediaFeatures||{},x=n.propertyKeywords||{},_=n.nonStandardPropertyKeywords||{},k=n.fontProperties||{},w=n.counterDescriptors||{},C=n.colorKeywords||{},S=n.valueKeywords||{},M=n.allowNested,L={};return L.top=function(e,t,n){if("{"==e)return s(n,t,"block");if("}"==e&&n.context.prev)return c(n);if(/@(media|supports|(-moz-)?document)/.test(e))return s(n,t,"atBlock");if(/@(font-face|counter-style)/.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(n,t,"at");if("hash"==e)h="builtin";else if("word"==e)h="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(n,t,"interpolation");if(":"==e)return"pseudo";if(M&&"("==e)return s(n,t,"parens")}return n.context.type},L.block=function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return x.hasOwnProperty(r)?(h="property","maybeprop"):_.hasOwnProperty(r)?(h="string-2","maybeprop"):M?(h=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(h+=" error","maybeprop")}return"meta"==e?"block":M||"hash"!=e&&"qualifier"!=e?L.top(e,t,n):(h="error","block")},L.maybeprop=function(e,t,n){return":"==e?s(n,t,"prop"):u(e,t,n)},L.prop=function(e,t,n){if(";"==e)return c(n);if("{"==e&&M)return s(n,t,"propBlock");if("}"==e||"{"==e)return f(e,t,n);if("("==e)return s(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){if("word"==e)d(t);else if("interpolation"==e)return s(n,t,"interpolation")}else h+=" error";return"prop"},L.propBlock=function(e,t,n){return"}"==e?c(n):"word"==e?(h="property","maybeprop"):n.context.type},L.parens=function(e,t,n){return"{"==e||"}"==e?f(e,t,n):")"==e?c(n):"("==e?s(n,t,"parens"):"interpolation"==e?s(n,t,"interpolation"):("word"==e&&d(t),"parens")},L.pseudo=function(e,t,n){return"word"==e?(h="variable-3",n.context.type):u(e,t,n)},L.atBlock=function(e,t,n){if("("==e)return s(n,t,"atBlock_parens");if("}"==e)return f(e,t,n);if("{"==e)return c(n)&&s(n,t,M?"block":"top");if("word"==e){var r=t.current().toLowerCase();h="only"==r||"not"==r||"and"==r||"or"==r?"keyword":v.hasOwnProperty(r)?"tag":y.hasOwnProperty(r)?"attribute":b.hasOwnProperty(r)?"property":x.hasOwnProperty(r)?"property":_.hasOwnProperty(r)?"string-2":S.hasOwnProperty(r)?"atom":"error"}return n.context.type},L.atBlock_parens=function(e,t,n){return")"==e?c(n):"{"==e||"}"==e?f(e,t,n,2):L.atBlock(e,t,n)},L.restricted_atBlock_before=function(e,t,n){return"{"==e?s(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(h="variable","restricted_atBlock_before"):u(e,t,n)},L.restricted_atBlock=function(e,t,n){return"}"==e?(n.stateArg=null,c(n)):"word"==e?(h="@font-face"==n.stateArg&&!k.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!w.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},L.keyframes=function(e,t,n){return"word"==e?(h="variable","keyframes"):"{"==e?s(n,t,"top"):u(e,t,n)},L.at=function(e,t,n){return";"==e?c(n):"{"==e||"}"==e?f(e,t,n):("word"==e?h="tag":"hash"==e&&(h="builtin"),"at")},L.interpolation=function(e,t,n){return"}"==e?c(n):"{"==e||";"==e?f(e,t,n):("word"==e?h="variable":"variable"!=e&&"("!=e&&")"!=e&&(h="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:"top",stateArg:null,context:new l("top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||i)(e,t);return n&&"object"==typeof n&&(p=n[1],n=n[0]),h=n,t.state=L[t.state](p,e,t),h},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),!n.prev||("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type)&&(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=n.indent-m,n=n.prev),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var r=["domain","regexp","url","url-prefix"],i=t(r),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],s=t(l),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],u=t(c),f=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],d=t(f),p=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],h=t(p),m=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],g=t(m),v=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],y=t(v),b=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small"],x=t(b),_=r.concat(o).concat(l).concat(c).concat(f).concat(v).concat(b);
-
-e.registerHelper("hintWords","css",_),e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:s,propertyKeywords:u,nonStandardPropertyKeywords:d,fontProperties:h,counterDescriptors:g,colorKeywords:y,valueKeywords:x,tokenHooks:{"/":function(e,t){return e.eat("*")?(t.tokenize=n,n(e,t)):!1}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:s,propertyKeywords:u,nonStandardPropertyKeywords:d,colorKeywords:y,valueKeywords:x,fontProperties:h,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},":":function(e){return e.match(/\s*\{/)?[null,"{"]:!1},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return e.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:s,propertyKeywords:u,nonStandardPropertyKeywords:d,colorKeywords:y,valueKeywords:x,fontProperties:h,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)?!1:(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("htmlmixed",function(t,n){function r(e,t){var n=t.htmlState.tagName;n&&(n=n.toLowerCase());var r=l.token(e,t.htmlState);if("script"==n&&/\btag\b/.test(r)&&">"==e.current()){var i=e.string.slice(Math.max(0,e.pos-100),e.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);i=i?i[1]:"",i&&/[\"\']/.test(i.charAt(0))&&(i=i.slice(1,i.length-1));for(var u=0;u<c.length;++u){var f=c[u];if("string"==typeof f.matches?i==f.matches:f.matches.test(i)){f.mode&&(t.token=o,t.localMode=f.mode,t.localState=f.mode.startState&&f.mode.startState(l.indent(t.htmlState,"")));break}}}else"style"==n&&/\btag\b/.test(r)&&">"==e.current()&&(t.token=a,t.localMode=s,t.localState=s.startState(l.indent(t.htmlState,"")));return r}function i(e,t,n){var r=e.current(),i=r.search(t);return i>-1?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}function o(e,t){return e.match(/^<\/\s*script\s*>/i,!1)?(t.token=r,t.localState=t.localMode=null,null):i(e,/<\/\s*script\s*>/,t.localMode.token(e,t.localState))}function a(e,t){return e.match(/^<\/\s*style\s*>/i,!1)?(t.token=r,t.localState=t.localMode=null,null):i(e,/<\/\s*style\s*>/,s.token(e,t.localState))}var l=e.getMode(t,{name:"xml",htmlMode:!0,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag}),s=e.getMode(t,"css"),c=[],u=n&&n.scriptTypes;if(c.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:e.getMode(t,"javascript")}),u)for(var f=0;f<u.length;++f){var d=u[f];c.push({matches:d.matches,mode:d.mode&&e.getMode(t,d.mode)})}return c.push({matches:/./,mode:e.getMode(t,"text/plain")}),{startState:function(){var e=l.startState();return{token:r,localMode:null,localState:null,htmlState:e}},copyState:function(t){if(t.localState)var n=e.copyState(t.localMode,t.localState);return{token:t.token,localMode:t.localMode,localState:n,htmlState:e.copyState(l,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n){return!t.localMode||/^\s*<\//.test(n)?l.indent(t.htmlState,n):t.localMode.indent?t.localMode.indent(t.localState,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||l}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/multiplex")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/multiplex"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("htmlembedded",function(t,n){return e.multiplexingMode(e.getMode(t,"htmlmixed"),{open:n.open||n.scriptStartRegex||"<%",close:n.close||n.scriptEndRegex||"%>",mode:e.getMode(t,n.scriptingModeSpec)})},"htmlmixed"),e.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),e.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),e.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),e.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){if(!t.startOfLine)return!1;for(;;){if(!e.skipTo("\\")){e.skipToEnd(),t.tokenize=null;break}if(e.next(),e.eol()){t.tokenize=n;break}}return"meta"}function r(e,t){return"variable-3"==t.prevToken?"variable-3":!1}function i(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var n=e.match(/"([^\s\\()]{0,16})\(/);return n?(t.cpp11RawStringDelim=n[1],t.tokenize=l,l(e,t)):!1}return e.match(/(u8|u|U|L)/)?e.match(/["']/,!1)?"string":!1:(e.next(),!1)}function o(e){var t=/(\w+)::(\w+)$/.exec(e);return t&&t[1]==t[2]}function a(e,t){for(var n;null!=(n=e.next());)if('"'==n&&!e.eat('"')){t.tokenize=null;break}return"string"}function l(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),r=e.match(new RegExp(".*?\\)"+n+'"'));return r?t.tokenize=null:e.skipToEnd(),"string"}function s(t,n){function r(e){if(e)for(var t in e)e.hasOwnProperty(t)&&i.push(t)}"string"==typeof t&&(t=[t]);var i=[];r(n.keywords),r(n.types),r(n.builtin),r(n.atoms),i.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],i));for(var o=0;o<t.length;++o)e.defineMIME(t[o],n)}function c(e,t){for(var n=!1;!e.eol();){if(!n&&e.match('"""')){t.tokenize=null;break}n="\\"==e.next()&&!n}return"string"}e.defineMode("clike",function(t,n){function r(e,t){var n=e.next();if(w[n]){var r=w[n](e,t);if(r!==!1)return r}if('"'==n||"'"==n)return t.tokenize=i(n),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(n))return d=n,null;if(/\d/.test(n))return e.eatWhile(/[\w\.]/),"number";if("/"==n){if(e.eat("*"))return t.tokenize=o,o(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(T.test(n))return e.eatWhile(T),"operator";if(e.eatWhile(/[\w\$_\xa1-\uffff]/),L)for(;e.match(L);)e.eatWhile(/[\w\$_\xa1-\uffff]/);var a=e.current();return v.propertyIsEnumerable(a)?(x.propertyIsEnumerable(a)&&(d="newstatement"),_.propertyIsEnumerable(a)&&(p=!0),"keyword"):y.propertyIsEnumerable(a)?"variable-3":b.propertyIsEnumerable(a)?(x.propertyIsEnumerable(a)&&(d="newstatement"),"builtin"):k.propertyIsEnumerable(a)?"atom":"variable"}function i(e){return function(t,n){for(var r,i=!1,o=!1;null!=(r=t.next());){if(r==e&&!i){o=!0;break}i=!i&&"\\"==r}return(o||!i&&!C)&&(n.tokenize=null),"string"}}function o(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}function a(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function l(e){return"statement"==e||"switchstatement"==e||"namespace"==e}function s(e,t,n){var r=e.indented;return e.context&&l(e.context.type)&&!l(n)&&(r=e.context.indented),e.context=new a(r,t,n,null,e.context)}function c(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}function u(e,t){return"variable"==t.prevToken||"variable-3"==t.prevToken?!0:/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,e.start))?!0:void 0}function f(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.type)return!1;e=e.prev}}var d,p,h=t.indentUnit,m=n.statementIndentUnit||h,g=n.dontAlignCalls,v=n.keywords||{},y=n.types||{},b=n.builtin||{},x=n.blockKeywords||{},_=n.defKeywords||{},k=n.atoms||{},w=n.hooks||{},C=n.multiLineStrings,S=n.indentStatements!==!1,M=n.indentSwitch!==!1,L=n.namespaceSeparator,T=/[+\-*&%=<>!?|\/]/;return{startState:function(e){return{tokenize:null,context:new a((e||0)-h,0,"top",!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var i=t.context;if(e.sol()&&(null==i.align&&(i.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;d=p=null;var o=(t.tokenize||r)(e,t);if("comment"==o||"meta"==o)return o;if(null==i.align&&(i.align=!0),";"==d||":"==d||","==d)for(;l(t.context.type);)c(t);else if("{"==d)s(t,e.column(),"}");else if("["==d)s(t,e.column(),"]");else if("("==d)s(t,e.column(),")");else if("}"==d){for(;l(i.type);)i=c(t);for("}"==i.type&&(i=c(t));l(i.type);)i=c(t)}else if(d==i.type)c(t);else if(S&&(("}"==i.type||"top"==i.type)&&";"!=d||l(i.type)&&"newstatement"==d)){var a="statement";"newstatement"==d&&M&&"switch"==e.current()?a="switchstatement":"keyword"==o&&"namespace"==e.current()&&(a="namespace"),s(t,e.column(),a)}if("variable"==o&&("def"==t.prevToken||n.typeFirstDefinitions&&u(e,t)&&f(t.context)&&e.match(/^\s*\(/,!1))&&(o="def"),w.token){var h=w.token(e,t,o);void 0!==h&&(o=h)}return"def"==o&&n.styleDefs===!1&&(o="variable"),t.startOfLine=!1,t.prevToken=p?"def":o||d,o},indent:function(t,n){if(t.tokenize!=r&&null!=t.tokenize)return e.Pass;var i=t.context,o=n&&n.charAt(0);l(i.type)&&"}"==o&&(i=i.prev);var a=o==i.type,s=i.prev&&"switchstatement"==i.prev.type;return l(i.type)?i.indented+("{"==o?0:m):!i.align||g&&")"==i.type?")"!=i.type||a?i.indented+(a?0:h)+(a||!s||/^(?:case|default)\b/.test(n)?0:h):i.indented+m:i.column+(a?0:1)},electricInput:M?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var u="auto if break case register continue return default do sizeof static else struct switch extern typedef float union for goto while enum const volatile",f="int long char short double float unsigned signed void size_t ptrdiff_t";s(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:t(u),types:t(f+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:t("case do else for if switch while struct"),defKeywords:t("struct"),typeFirstDefinitions:!0,atoms:t("null true false"),hooks:{"#":n,"*":r},modeProps:{fold:["brace","include"]}}),s(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:t(u+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:t(f+" bool wchar_t"),blockKeywords:t("catch class do else finally for if struct switch try while"),defKeywords:t("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:t("true false null"),hooks:{"#":n,"*":r,u:i,U:i,L:i,R:i,token:function(e,t,n){return"variable"!=n||"("!=e.peek()||";"!=t.prevToken&&null!=t.prevToken&&"}"!=t.prevToken||!o(e.current())?void 0:"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),s("text/x-java",{name:"clike",keywords:t("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while"),types:t("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:t("catch class do else finally for if switch try while"),defKeywords:t("class interface package enum"),typeFirstDefinitions:!0,atoms:t("true false null"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),s("text/x-csharp",{name:"clike",keywords:t("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:t("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:t("catch class do else finally for foreach if struct switch try while"),defKeywords:t("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:t("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=a,a(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),s("text/x-scala",{name:"clike",keywords:t("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble :: #:: "),types:t("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:t("catch class do else finally for forSome if match switch try while"),defKeywords:t("class def object package trait type val var"),atoms:t("true false null"),indentStatements:!1,indentSwitch:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return e.match('""')?(t.tokenize=c,t.tokenize(e,t)):!1},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"}},modeProps:{closeBrackets:{triples:'"'}}}),s(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:t("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:t("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:t("for while do if else struct"),builtin:t("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:t("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":n},modeProps:{fold:["brace","include"]}}),s("text/x-nesc",{name:"clike",keywords:t(u+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:t(f),blockKeywords:t("case do else for if switch while struct"),atoms:t("null true false"),hooks:{"#":n},modeProps:{fold:["brace","include"]}}),s("text/x-objectivec",{name:"clike",keywords:t(u+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:t(f),atoms:t("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":n},modeProps:{fold:"brace"}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("clojure",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t,n){this.indent=e,this.type=t,this.prev=n}function r(e,t,r){e.indentStack=new n(t,r,e.indentStack)}function i(e){e.indentStack=e.indentStack.prev}function o(e,t){return"0"===e&&t.eat(/x/i)?(t.eatWhile(k.hex),!0):("+"!=e&&"-"!=e||!k.digit.test(t.peek())||(t.eat(k.sign),e=t.next()),k.digit.test(e)?(t.eat(e),t.eatWhile(k.digit),"."==t.peek()&&(t.eat("."),t.eatWhile(k.digit)),t.eat(k.exponent)&&(t.eat(k.sign),t.eatWhile(k.digit)),!0):!1)}function a(e){var t=e.next();t&&t.match(/[a-z]/)&&e.match(/[a-z]+/,!0)||"u"===t&&e.match(/[0-9a-z]{4}/i,!0)}var l="builtin",s="comment",c="string",u="string-2",f="atom",d="number",p="bracket",h="keyword",m="variable",g=e.indentUnit||2,v=e.indentUnit||2,y=t("true false nil"),b=t("defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"),x=t("* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"),_=t("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),k={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+!\-\._?:<>\/\xa1-\uffff]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(e,t){if(null==t.indentStack&&e.sol()&&(t.indentation=e.indentation()),e.eatSpace())return null;var n=null;switch(t.mode){case"string":for(var w,C=!1;null!=(w=e.next());){if('"'==w&&!C){t.mode=!1;break}C=!C&&"\\"==w}n=c;break;default:var S=e.next();if('"'==S)t.mode="string",n=c;else if("\\"==S)a(e),n=u;else if("'"!=S||k.digit_or_colon.test(e.peek()))if(";"==S)e.skipToEnd(),n=s;else if(o(S,e))n=d;else if("("==S||"["==S||"{"==S){var M,L="",T=e.column();if("("==S)for(;null!=(M=e.eat(k.keyword_char));)L+=M;L.length>0&&(_.propertyIsEnumerable(L)||/^(?:def|with)/.test(L))?r(t,T+g,S):(e.eatSpace(),e.eol()||";"==e.peek()?r(t,T+v,S):r(t,T+e.current().length,S)),e.backUp(e.current().length-1),n=p}else if(")"==S||"]"==S||"}"==S)n=p,null!=t.indentStack&&t.indentStack.type==(")"==S?"(":"]"==S?"[":"{")&&i(t);else{if(":"==S)return e.eatWhile(k.symbol),f;e.eatWhile(k.symbol),n=b&&b.propertyIsEnumerable(e.current())?h:x&&x.propertyIsEnumerable(e.current())?l:y&&y.propertyIsEnumerable(e.current())?f:m}else n=f}return n},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent},closeBrackets:{pairs:'()[]{}""'},lineComment:";;"}}),e.defineMIME("text/x-clojure","clojure")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ruby",function(e){function t(e){for(var t={},n=0,r=e.length;r>n;++n)t[e[n]]=!0;return t}function n(e,t,n){return n.tokenize.push(e),e(t,n)}function r(e,t){if(c=null,e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push(s),"comment";if(e.eatSpace())return null;var r,i=e.next();if("`"==i||"'"==i||'"'==i)return n(a(i,"string",'"'==i||"`"==i),e,t);if("/"==i){var o=e.current().length;if(e.skipTo("/")){var u=e.current().length;e.backUp(e.current().length-o);for(var f=0;e.current().length<u;){var d=e.next();if("("==d?f+=1:")"==d&&(f-=1),0>f)break}if(e.backUp(e.current().length-o),0==f)return n(a(i,"string-2",!0),e,t)}return"operator"}if("%"==i){var h="string",m=!0;e.eat("s")?h="atom":e.eat(/[WQ]/)?h="string":e.eat(/[r]/)?h="string-2":e.eat(/[wxq]/)&&(h="string",m=!1);var g=e.eat(/[^\w\s=]/);return g?(p.propertyIsEnumerable(g)&&(g=p[g]),n(a(g,h,m,!0),e,t)):"operator"}if("#"==i)return e.skipToEnd(),"comment";if("<"==i&&(r=e.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return n(l(r[1]),e,t);if("0"==i)return e.eatWhile(e.eat("x")?/[\da-fA-F]/:e.eat("b")?/[01]/:/[0-7]/),"number";if(/\d/.test(i))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==i){for(;e.match(/^\\[CM]-/););return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}if(":"==i)return e.eat("'")?n(a("'","atom",!1),e,t):e.eat('"')?n(a('"',"atom",!0),e,t):e.eat(/[\<\>]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==i&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==i)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(i))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=i||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(i))return c=i,null;if("-"==i&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(i)){var v=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=i||v||(c="."),"operator"}return null}return c="|",null}function i(e){return e||(e=1),function(t,n){if("}"==t.peek()){if(1==e)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=i(e-1)}else"{"==t.peek()&&(n.tokenize[n.tokenize.length-1]=i(e+1));return r(t,n)}}function o(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,r(t,n))}}function a(e,t,n,r){return function(a,l){var s,c=!1;for("read-quoted-paused"===l.context.type&&(l.context=l.context.prev,a.eat("}"));null!=(s=a.next());){if(s==e&&(r||!c)){l.tokenize.pop();break}if(n&&"#"==s&&!c){if(a.eat("{")){"}"==e&&(l.context={prev:l.context,type:"read-quoted-paused"}),l.tokenize.push(i());break}if(/[@\$]/.test(a.peek())){l.tokenize.push(o());break}}c=!c&&"\\"==s}return t}}function l(e){return function(t,n){return t.match(e)?n.tokenize.pop():t.skipToEnd(),"string"}}function s(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var c,u=t(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),f=t(["def","class","case","for","while","module","then","catch","loop","proc","begin"]),d=t(["end","until"]),p={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[r],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){e.sol()&&(t.indented=e.indentation());var n,r=t.tokenize[t.tokenize.length-1](e,t),i=c;if("ident"==r){var o=e.current();r="."==t.lastTok?"property":u.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(o)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable","keyword"==r&&(i=o,f.propertyIsEnumerable(o)?n="indent":d.propertyIsEnumerable(o)?n="dedent":"if"!=o&&"unless"!=o||e.column()!=e.indentation()?"do"==o&&t.context.indented<t.indented&&(n="indent"):n="indent");
-
-}return(c||r&&"comment"!=r)&&(t.lastTok=i),"|"==c&&(t.varList=!t.varList),"indent"==n||/[\(\[\{]/.test(c)?t.context={prev:t.context,type:c||r,indented:t.indented}:("dedent"==n||/[\)\]\}]/.test(c))&&t.context.prev&&(t.context=t.context.prev),e.eol()&&(t.continuedLine="\\"==c||"operator"==r),r},indent:function(t,n){if(t.tokenize[t.tokenize.length-1]!=r)return 0;var i=n&&n.charAt(0),o=t.context,a=o.type==p[i]||"keyword"==o.type&&/^(?:end|until|else|elsif|when|rescue)\b/.test(n);return o.indented+(a?0:e.indentUnit)+(t.continuedLine?e.indentUnit:0)},electricChars:"}de",lineComment:"#"}}),e.defineMIME("text/x-ruby","ruby")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e){return e.scopes[e.scopes.length-1]}var r=t(["and","or","not","is"]),i=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],o=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"],a={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]},l={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None","async","await"]};e.registerHelper("hintWords","python",i.concat(o)),e.defineMode("python",function(s,c){function u(e,t){if(e.sol()&&"py"==n(t).type){var r=n(t).offset;if(e.eatSpace()){var i=e.indentation();return i>r?p(e,t,"py"):r>i&&h(e,t)&&(t.errorToken=!0),null}var o=f(e,t);return r>0&&h(e,t)&&(o+=" "+g),o}return f(e,t)}function f(e,t){if(e.eatSpace())return null;var n=e.peek();if("#"==n)return e.skipToEnd(),"comment";if(e.match(/^[0-9\.]/,!1)){var i=!1;if(e.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),e.match(/^\d+\.\d*/)&&(i=!0),e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var o=!1;if(e.match(/^0x[0-9a-f]+/i)&&(o=!0),e.match(/^0b[01]+/i)&&(o=!0),e.match(/^0o[0-7]+/i)&&(o=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(e.eat(/J/i),o=!0),e.match(/^0(?![\dx])/i)&&(o=!0),o)return e.eat(/L/i),"number"}return e.match(M)?(t.tokenize=d(e.current()),t.tokenize(e,t)):e.match(x)||e.match(b)?null:e.match(y)||e.match(_)?"operator":e.match(v)?null:e.match(L)||e.match(r)?"keyword":e.match(T)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(k)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),g)}function d(e){function t(t,i){for(;!t.eol();)if(t.eatWhile(/[^'"\\]/),t.eat("\\")){if(t.next(),n&&t.eol())return r}else{if(t.match(e))return i.tokenize=u,r;t.eat(/['"]/)}if(n){if(c.singleLineStringErrors)return g;i.tokenize=u}return r}for(;"rub".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";return t.isString=!0,t}function p(e,t,r){var i=0,o=null;if("py"==r)for(;"py"!=n(t).type;)t.scopes.pop();i=n(t).offset+("py"==r?s.indentUnit:w),"py"==r||e.match(/^(\s|#.*)*$/,!1)||(o=e.column()+1),t.scopes.push({offset:i,type:r,align:o})}function h(e,t){for(var r=e.indentation();n(t).offset>r;){if("py"!=n(t).type)return!0;t.scopes.pop()}return n(t).offset!=r}function m(e,t){var r=t.tokenize(e,t),i=e.current();if("."==i)return r=e.match(k,!1)?null:g,null==r&&"meta"==t.lastStyle&&(r="meta"),r;if("@"==i)return c.version&&3==parseInt(c.version,10)?e.match(k,!1)?"meta":"operator":e.match(k,!1)?"meta":g;"variable"!=r&&"builtin"!=r||"meta"!=t.lastStyle||(r="meta"),("pass"==i||"return"==i)&&(t.dedent+=1),"lambda"==i&&(t.lambda=!0),":"!=i||t.lambda||"py"!=n(t).type||p(e,t,"py");var o=1==i.length?"[({".indexOf(i):-1;if(-1!=o&&p(e,t,"])}".slice(o,o+1)),o="])}".indexOf(i),-1!=o){if(n(t).type!=i)return g;t.scopes.pop()}return t.dedent>0&&e.eol()&&"py"==n(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),r}var g="error",v=c.singleDelimiters||new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),y=c.doubleOperators||new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),b=c.doubleDelimiters||new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),x=c.tripleDelimiters||new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");if(c.version&&3==parseInt(c.version,10))var _=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]"),k=c.identifiers||new RegExp("^[_A-Za-z¡-￿][_A-Za-z0-9¡-￿]*");else var _=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"),k=c.identifiers||new RegExp("^[_A-Za-z][_A-Za-z0-9]*");var w=c.hangingIndent||s.indentUnit,C=i,S=o;if(void 0!=c.extra_keywords&&(C=C.concat(c.extra_keywords)),void 0!=c.extra_builtins&&(S=S.concat(c.extra_builtins)),c.version&&3==parseInt(c.version,10)){C=C.concat(l.keywords),S=S.concat(l.builtins);var M=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}else{C=C.concat(a.keywords),S=S.concat(a.builtins);var M=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var L=t(C),T=t(S),A={startState:function(e){return{tokenize:u,scopes:[{offset:e||0,type:"py",align:null}],lastStyle:null,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=m(e,t);t.lastStyle=r;var i=e.current();return i&&r&&(t.lastToken=i),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+g:r},indent:function(t,r){if(t.tokenize!=u)return t.tokenize.isString?e.Pass:0;var i=n(t),o=r&&r.charAt(0)==i.type;return null!=i.align?i.align-(o?1:0):o&&t.scopes.length>1?t.scopes[t.scopes.length-2].offset:i.offset},closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"};return A}),e.defineMIME("text/x-python","python");var s=function(e){return e.split(" ")};e.defineMIME("text/x-cython",{name:"python",extra_keywords:s("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("shell",function(){function e(e,t){for(var n=t.split(" "),r=0;r<n.length;r++)i[n[r]]=e}function t(e,t){if(e.eatSpace())return null;var a=e.sol(),l=e.next();if("\\"===l)return e.next(),null;if("'"===l||'"'===l||"`"===l)return t.tokens.unshift(n(l)),r(e,t);if("#"===l)return a&&e.eat("!")?(e.skipToEnd(),"meta"):(e.skipToEnd(),"comment");if("$"===l)return t.tokens.unshift(o),r(e,t);if("+"===l||"="===l)return"operator";if("-"===l)return e.eat("-"),e.eatWhile(/\w/),"attribute";if(/\d/.test(l)&&(e.eatWhile(/\d/),e.eol()||!/\w/.test(e.peek())))return"number";e.eatWhile(/[\w-]/);var s=e.current();return"="===e.peek()&&/\w+/.test(s)?"def":i.hasOwnProperty(s)?i[s]:null}function n(e){return function(t,n){for(var r,i=!1,a=!1;null!=(r=t.next());){if(r===e&&!a){i=!0;break}if("$"===r&&!a&&"'"!==e){a=!0,t.backUp(1),n.tokens.unshift(o);break}a=!a&&"\\"===r}return(i||!a)&&n.tokens.shift(),"`"===e||")"===e?"quote":"string"}}function r(e,n){return(n.tokens[0]||t)(e,n)}var i={};e("atom","true false"),e("keyword","if then do else elif while until for in esac fi fin fil done exit set unset export function"),e("builtin","ab awk bash beep cat cc cd chown chmod chroot clear cp curl cut diff echo find gawk gcc get git grep kill killall ln ls make mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh shopt shred source sort sleep ssh start stop su sudo tee telnet top touch vi vim wall wc wget who write yes zsh");var o=function(e,t){t.tokens.length>1&&e.eat("$");var i=e.next(),o=/\w/;return"{"===i&&(o=/[^}]/),"("===i?(t.tokens[0]=n(")"),r(e,t)):(/\d/.test(i)||(e.eatWhile(o),e.eat("}")),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return r(e,t)},lineComment:"#",fold:"brace"}}),e.defineMIME("text/x-sh","shell")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t,i){return 0==e.length?r(t):function(o,a){for(var l=e[0],s=0;s<l.length;s++)if(o.match(l[s][0]))return a.tokenize=n(e.slice(1),t),l[s][1];return a.tokenize=r(t,i),"string"}}function r(e,t){return function(n,r){return i(n,r,e,t)}}function i(e,t,r,i){if(i!==!1&&e.match("${",!1)||e.match("{$",!1))return t.tokenize=null,"string";if(i!==!1&&e.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return e.match("[",!1)&&(t.tokenize=n([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],r,i)),e.match(/\-\>\w/,!1)&&(t.tokenize=n([[["->",null]],[[/[\w]+/,"variable"]]],r,i)),"variable-2";for(var o=!1;!e.eol()&&(o||i===!1||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!o&&e.match(r)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}o="\\"==e.next()&&!o}return"string"}var o="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",a="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",l="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[o,a,l].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var s={name:"clike",helperType:"php",keywords:t(o),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),defKeywords:t("class function interface namespace trait"),atoms:t(a),builtin:t(l),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){if(e.match(/<</)){var n=e.eat("'");e.eatWhile(/[\w\.]/);var i=e.current().slice(3+(n?1:0));if(n&&e.eat("'"),i)return(t.tokStack||(t.tokStack=[])).push(i,0),t.tokenize=r(i,n?!1:!0),"string"}return!1},"#":function(e){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=r('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=r(t.tokStack[t.tokStack.length-2])),!1}}};e.defineMode("php",function(t,n){function r(e,t){var n=t.curMode==o;if(e.sol()&&t.pending&&'"'!=t.pending&&"'"!=t.pending&&(t.pending=null),n)return n&&null==t.php.tokenize&&e.match("?>")?(t.curMode=i,t.curState=t.html,"meta"):o.token(e,t.curState);if(e.match(/^<\?\w*/))return t.curMode=o,t.curState=t.php,"meta";if('"'==t.pending||"'"==t.pending){for(;!e.eol()&&e.next()!=t.pending;);var r="string"}else if(t.pending&&e.pos<t.pending.end){e.pos=t.pending.end;var r=t.pending.style}else var r=i.token(e,t.curState);t.pending&&(t.pending=null);var a,l=e.current(),s=l.search(/<\?/);return-1!=s&&(t.pending="string"==r&&(a=l.match(/[\'\"]$/))&&!/\?>/.test(l)?a[0]:{end:e.pos,style:r},e.backUp(l.length-s)),r}var i=e.getMode(t,"text/html"),o=e.getMode(t,s);return{startState:function(){var t=e.startState(i),r=e.startState(o);return{html:t,php:r,curMode:n.startOpen?o:i,curState:n.startOpen?r:t,pending:null}},copyState:function(t){var n,r=t.html,a=e.copyState(i,r),l=t.php,s=e.copyState(o,l);return n=t.curMode==i?a:s,{html:a,php:s,curMode:t.curMode,curState:n,pending:t.pending}},token:r,indent:function(e,t){return e.curMode!=o&&/^\s*<\//.test(t)||e.curMode==o&&/^\?>/.test(t)?i.indent(e.html,t):e.curMode.indent(e.curState,t)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",s)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sql",function(t,n){function r(e,t){var n=e.next();if(h[n]){var r=h[n](e,t);if(r!==!1)return r}if(1==p.hexNumber&&("0"==n&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==n||"X"==n)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(1==p.binaryNumber&&(("b"==n||"B"==n)&&e.match(/^'[01]+'/)||"0"==n&&e.match(/^b[01]+/)))return"number";if(n.charCodeAt(0)>47&&n.charCodeAt(0)<58)return e.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/),1==p.decimallessFloat&&e.eat("."),"number";if("?"==n&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==n||'"'==n&&p.doubleQuote)return t.tokenize=i(n),t.tokenize(e,t);if((1==p.nCharCast&&("n"==n||"N"==n)||1==p.charsetCast&&"_"==n&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(/^[\(\),\;\[\]]/.test(n))return null;if(p.commentSlashSlash&&"/"==n&&e.eat("/"))return e.skipToEnd(),"comment";if(p.commentHash&&"#"==n||"-"==n&&e.eat("-")&&(!p.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==n&&e.eat("*"))return t.tokenize=o,t.tokenize(e,t);if("."!=n){if(d.test(n))return e.eatWhile(d),null;if("{"==n&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var a=e.current().toLowerCase();return m.hasOwnProperty(a)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":c.hasOwnProperty(a)?"atom":u.hasOwnProperty(a)?"builtin":f.hasOwnProperty(a)?"keyword":s.hasOwnProperty(a)?"string-2":null}return 1==p.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":1==p.ODBCdotTable&&e.match(/^[a-zA-Z_]+/)?"variable-2":void 0}function i(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){n.tokenize=r;break}o=!o&&"\\"==i}return"string"}}function o(e,t){for(;;){if(!e.skipTo("*")){e.skipToEnd();break}if(e.next(),e.eat("/")){t.tokenize=r;break}}return"comment"}function a(e,t,n){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:n}}function l(e){e.indent=e.context.indent,e.context=e.context.prev}var s=n.client||{},c=n.atoms||{"false":!0,"true":!0,"null":!0},u=n.builtin||{},f=n.keywords||{},d=n.operatorChars||/^[*+\-%<>!=&|~^]/,p=n.support||{},h=n.hooks||{},m=n.dateSQL||{date:!0,time:!0,timestamp:!0};return{startState:function(){return{tokenize:r,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"==n)return n;t.context&&null==t.context.align&&(t.context.align=!0);var r=e.current();return"("==r?a(e,t,")"):"["==r?a(e,t,"]"):t.context&&t.context.type==r&&l(t),n},indent:function(n,r){var i=n.context;if(!i)return e.Pass;var o=r.charAt(0)==i.type;return i.align?i.col+(o?0:1):i.indent+(o?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:p.commentSlashSlash?"//":p.commentHash?"#":null}}),function(){function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function n(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function r(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function i(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}var o="alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where ";e.defineMIME("text/x-sql",{name:"sql",keywords:i(o+"begin"),builtin:i("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare"),builtin:i("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":n}}),e.defineMIME("text/x-mysql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-mariadb",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),
-builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:i("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:i("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:i("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:i("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:i("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:i("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:i("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*+\-%<>!=~]/,dateSQL:i("date time timestamp"),support:i("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:i("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),builtin:i("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")})}()}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("coffeescript",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e,t){if(e.sol()){null===t.scope.align&&(t.scope.align=!1);var n=t.scope.offset;if(e.eatSpace()){var r=e.indentation();return r>n&&"coffee"==t.scope.type?"indent":n>r?"dedent":null}n>0&&l(e,t)}if(e.eatSpace())return null;var a=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return t.tokenize=o,t.tokenize(e,t);if("#"===a)return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var s=!1;if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(s=!0),e.match(/^-?\d+\.\d*/)&&(s=!0),e.match(/^-?\.\d+/)&&(s=!0),s)return"."==e.peek()&&e.backUp(1),"number";var m=!1;if(e.match(/^-?0x[0-9a-f]+/i)&&(m=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(m=!0),e.match(/^-?0(?![\dx])/i)&&(m=!0),m)return"number"}if(e.match(y))return t.tokenize=i(e.current(),!1,"string"),t.tokenize(e,t);if(e.match(b)){if("/"!=e.current()||e.match(/^.*\//,!1))return t.tokenize=i(e.current(),!0,"string-2"),t.tokenize(e,t);e.backUp(1)}return e.match(u)||e.match(h)?"operator":e.match(f)?"punctuation":e.match(_)?"atom":e.match(v)?"keyword":e.match(d)?"variable":e.match(p)?"property":(e.next(),c)}function i(e,n,i){return function(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\/\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return i}else{if(o.match(e))return a.tokenize=r,i;o.eat(/['"\/]/)}return n&&(t.singleLineStringErrors?i=c:a.tokenize=r),i}}function o(e,t){for(;!e.eol();){if(e.eatWhile(/[^#]/),e.match("###")){t.tokenize=r;break}e.eatWhile("#")}return"comment"}function a(t,n,r){r=r||"coffee";for(var i=0,o=!1,a=null,l=n.scope;l;l=l.prev)if("coffee"===l.type||"}"==l.type){i=l.offset+e.indentUnit;break}"coffee"!==r?(o=null,a=t.column()+t.current().length):n.scope.align&&(n.scope.align=!1),n.scope={offset:i,type:r,prev:n.scope,align:o,alignOffset:a}}function l(e,t){if(t.scope.prev){if("coffee"===t.scope.type){for(var n=e.indentation(),r=!1,i=t.scope;i;i=i.prev)if(n===i.offset){r=!0;break}if(!r)return!0;for(;t.scope.prev&&t.scope.offset!==n;)t.scope=t.scope.prev;return!1}return t.scope=t.scope.prev,!1}}function s(e,t){var n=t.tokenize(e,t),r=e.current();if("."===r)return n=t.tokenize(e,t),r=e.current(),/^\.[\w$]+$/.test(r)?"variable":c;"return"===r&&(t.dedent=!0),("->"!==r&&"=>"!==r||t.lambda||e.peek())&&"indent"!==n||a(e,t);var i="[({".indexOf(r);if(-1!==i&&a(e,t,"])}".slice(i,i+1)),m.exec(r)&&a(e,t),"then"==r&&l(e,t),"dedent"===n&&l(e,t))return c;if(i="])}".indexOf(r),-1!==i){for(;"coffee"==t.scope.type&&t.scope.prev;)t.scope=t.scope.prev;t.scope.type==r&&(t.scope=t.scope.prev)}return t.dedent&&e.eol()&&("coffee"==t.scope.type&&t.scope.prev&&(t.scope=t.scope.prev),t.dedent=!1),n}var c="error",u=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,f=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,d=/^[_A-Za-z$][_A-Za-z$0-9]*/,p=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/,h=n(["and","or","not","is","isnt","in","instanceof","typeof"]),m=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],g=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],v=n(m.concat(g));m=n(m);var y=/^('{3}|\"{3}|['\"])/,b=/^(\/{3}|\/)/,x=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],_=n(x),k={startState:function(e){return{tokenize:r,scope:{offset:e||0,type:"coffee",prev:null,align:!1},lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=null===t.scope.align&&t.scope;n&&e.sol()&&(n.align=!1);var r=s(e,t);return n&&r&&"comment"!=r&&(n.align=!0),t.lastToken={style:r,content:e.current()},e.eol()&&e.lambda&&(t.lambda=!1),r},indent:function(e,t){if(e.tokenize!=r)return 0;var n=e.scope,i=t&&"])}".indexOf(t.charAt(0))>-1;if(i)for(;"coffee"==n.type&&n.prev;)n=n.prev;var o=i&&n.type===t.charAt(0);return n.align?n.alignOffset-(o?1:0):(o?n.prev:n).offset},lineComment:"#",fold:"indent"};return k}),e.defineMIME("text/x-coffeescript","coffeescript")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("yaml",function(){var e=["true","false","on","off","yes","no"],t=new RegExp("\\b(("+e.join(")|(")+"))$","i");return{token:function(e,n){var r=e.peek(),i=n.escaped;if(n.escaped=!1,"#"==r&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(n.literal&&e.indentation()>n.keyCol)return e.skipToEnd(),"string";if(n.literal&&(n.literal=!1),e.sol()){if(n.keyCol=0,n.pair=!1,n.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?n.inlinePairs++:"}"==r?n.inlinePairs--:"["==r?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!i&&","==r)return e.next(),"meta";if(n.inlinePairs>0&&!i&&","==r)return n.keyCol=0,n.pair=!1,n.pairStart=!1,e.next(),"meta";if(n.pairStart){if(e.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==n.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(n.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(t))return"keyword"}return!n.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(n.pair=!0,n.keyCol=e.indentation(),"atom"):n.pair&&e.match(/^:\s*/)?(n.pairStart=!0,"meta"):(n.pairStart=!1,n.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),e.defineMIME("text/x-yaml","yaml")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../javascript/javascript"),require("../css/css"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../javascript/javascript","../css/css","../htmlmixed/htmlmixed"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("jade",function(t){function n(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=Y.startState(),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function r(e,t){if(e.sol()&&(t.javaScriptLine=!1,t.javaScriptLineExcludesColon=!1),t.javaScriptLine){if(t.javaScriptLineExcludesColon&&":"===e.peek())return t.javaScriptLine=!1,void(t.javaScriptLineExcludesColon=!1);var n=Y.token(e,t.jsState);return e.eol()&&(t.javaScriptLine=!1),n||!0}}function i(e,t){if(t.javaScriptArguments){if(0===t.javaScriptArgumentsDepth&&"("!==e.peek())return void(t.javaScriptArguments=!1);if("("===e.peek()?t.javaScriptArgumentsDepth++:")"===e.peek()&&t.javaScriptArgumentsDepth--,0===t.javaScriptArgumentsDepth)return void(t.javaScriptArguments=!1);var n=Y.token(e,t.jsState);return n||!0}}function o(e){return e.match(/^yield\b/)?"keyword":void 0}function a(e){return e.match(/^(?:doctype) *([^\n]+)?/)?G:void 0}function l(e,t){return e.match("#{")?(t.isInterpolating=!0,t.interpolationNesting=0,"punctuation"):void 0}function s(e,t){if(t.isInterpolating){if("}"===e.peek()){if(t.interpolationNesting--,t.interpolationNesting<0)return e.next(),t.isInterpolating=!1,"puncutation"}else"{"===e.peek()&&t.interpolationNesting++;return Y.token(e,t.jsState)||!0}}function c(e,t){return e.match(/^case\b/)?(t.javaScriptLine=!0,V):void 0}function u(e,t){return e.match(/^when\b/)?(t.javaScriptLine=!0,t.javaScriptLineExcludesColon=!0,V):void 0}function f(e){return e.match(/^default\b/)?V:void 0}function d(e,t){return e.match(/^extends?\b/)?(t.restOfLine="string",V):void 0}function p(e,t){return e.match(/^append\b/)?(t.restOfLine="variable",V):void 0}function h(e,t){return e.match(/^prepend\b/)?(t.restOfLine="variable",V):void 0}function m(e,t){return e.match(/^block\b *(?:(prepend|append)\b)?/)?(t.restOfLine="variable",V):void 0}function g(e,t){return e.match(/^include\b/)?(t.restOfLine="string",V):void 0}function v(e,t){return e.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&e.match("include")?(t.isIncludeFiltered=!0,V):void 0}function y(e,t){if(t.isIncludeFiltered){var n=L(e,t);return t.isIncludeFiltered=!1,t.restOfLine="string",n}}function b(e,t){return e.match(/^mixin\b/)?(t.javaScriptLine=!0,V):void 0}function x(e,t){return e.match(/^\+([-\w]+)/)?(e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),"variable"):e.match(/^\+#{/,!1)?(e.next(),t.mixinCallAfter=!0,l(e,t)):void 0}function _(e,t){return t.mixinCallAfter?(t.mixinCallAfter=!1,e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),!0):void 0}function k(e,t){return e.match(/^(if|unless|else if|else)\b/)?(t.javaScriptLine=!0,V):void 0}function w(e,t){return e.match(/^(- *)?(each|for)\b/)?(t.isEach=!0,V):void 0}function C(e,t){if(t.isEach){if(e.match(/^ in\b/))return t.javaScriptLine=!0,t.isEach=!1,V;if(e.sol()||e.eol())t.isEach=!1;else if(e.next()){for(;!e.match(/^ in\b/,!1)&&e.next(););return"variable"}}}function S(e,t){return e.match(/^while\b/)?(t.javaScriptLine=!0,V):void 0}function M(e,t){var n;return(n=e.match(/^(\w(?:[-:\w]*\w)?)\/?/))?(t.lastTag=n[1].toLowerCase(),"script"===t.lastTag&&(t.scriptType="application/javascript"),"tag"):void 0}function L(n,r){if(n.match(/^:([\w\-]+)/)){var i;return t&&t.innerModes&&(i=t.innerModes(n.current().substring(1))),i||(i=n.current().substring(1)),"string"==typeof i&&(i=e.getMode(t,i)),W(n,r,i),"atom"}}function T(e,t){return e.match(/^(!?=|-)/)?(t.javaScriptLine=!0,"punctuation"):void 0}function A(e){return e.match(/^#([\w-]+)/)?K:void 0}function z(e){return e.match(/^\.([\w-]+)/)?X:void 0}function E(e,t){return"("==e.peek()?(e.next(),t.isAttrs=!0,t.attrsNest=[],t.inAttributeName=!0,t.attrValue="",t.attributeIsType=!1,"punctuation"):void 0}function O(e,t){if(t.isAttrs){if(Z[e.peek()]&&t.attrsNest.push(Z[e.peek()]),t.attrsNest[t.attrsNest.length-1]===e.peek())t.attrsNest.pop();else if(e.eat(")"))return t.isAttrs=!1,"punctuation";if(t.inAttributeName&&e.match(/^[^=,\)!]+/))return("="===e.peek()||"!"===e.peek())&&(t.inAttributeName=!1,t.jsState=Y.startState(),t.attributeIsType="script"===t.lastTag&&"type"===e.current().trim().toLowerCase()?!0:!1),"attribute";var n=Y.token(e,t.jsState);if(t.attributeIsType&&"string"===n&&(t.scriptType=e.current().toString()),0===t.attrsNest.length&&("string"===n||"variable"===n||"keyword"===n))try{return Function("","var x "+t.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),t.inAttributeName=!0,t.attrValue="",e.backUp(e.current().length),O(e,t)}catch(r){}return t.attrValue+=e.current(),n||!0}}function q(e,t){return e.match(/^&attributes\b/)?(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0,"keyword"):void 0}function N(e){return e.sol()&&e.eatSpace()?"indent":void 0}function I(e,t){return e.match(/^ *\/\/(-)?([^\n]*)/)?(t.indentOf=e.indentation(),t.indentToken="comment","comment"):void 0}function P(e){return e.match(/^: */)?"colon":void 0}function D(e,t){return e.match(/^(?:\| ?| )([^\n]+)/)?"string":e.match(/^(<[^\n]*)/,!1)?(W(e,t,"htmlmixed"),t.innerModeForLine=!0,F(e,t,!0)):void 0}function j(e,t){if(e.eat(".")){var n=null;return"script"===t.lastTag&&-1!=t.scriptType.toLowerCase().indexOf("javascript")?n=t.scriptType.toLowerCase().replace(/"|'/g,""):"style"===t.lastTag&&(n="css"),W(e,t,n),"dot"}}function R(e){return e.next(),null}function W(n,r,i){i=e.mimeModes[i]||i,i=t.innerModes?t.innerModes(i)||i:i,i=e.mimeModes[i]||i,i=e.getMode(t,i),r.indentOf=n.indentation(),i&&"null"!==i.name?r.innerMode=i:r.indentToken="string"}function F(e,t,n){return e.indentation()>t.indentOf||t.innerModeForLine&&!e.sol()||n?t.innerMode?(t.innerState||(t.innerState=t.innerMode.startState?t.innerMode.startState(e.indentation()):{}),e.hideFirstChars(t.indentOf+2,function(){return t.innerMode.token(e,t.innerState)||!0})):(e.skipToEnd(),t.indentToken):void(e.sol()&&(t.indentOf=1/0,t.indentToken=null,t.innerMode=null,t.innerState=null))}function H(e,t){if(e.sol()&&(t.restOfLine=""),t.restOfLine){e.skipToEnd();var n=t.restOfLine;return t.restOfLine="",n}}function $(){return new n}function B(e){return e.copy()}function U(e,t){var n=F(e,t)||H(e,t)||s(e,t)||y(e,t)||C(e,t)||O(e,t)||r(e,t)||i(e,t)||_(e,t)||o(e,t)||a(e,t)||l(e,t)||c(e,t)||u(e,t)||f(e,t)||d(e,t)||p(e,t)||h(e,t)||m(e,t)||g(e,t)||v(e,t)||b(e,t)||x(e,t)||k(e,t)||w(e,t)||S(e,t)||M(e,t)||L(e,t)||T(e,t)||A(e,t)||z(e,t)||E(e,t)||q(e,t)||N(e,t)||D(e,t)||I(e,t)||P(e,t)||j(e,t)||R(e,t);return n===!0?null:n}var V="keyword",G="meta",K="builtin",X="qualifier",Z={"{":"}","(":")","[":"]"},Y=e.getMode(t,"javascript");return n.prototype.copy=function(){var t=new n;return t.javaScriptLine=this.javaScriptLine,t.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,t.javaScriptArguments=this.javaScriptArguments,t.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,t.isInterpolating=this.isInterpolating,t.interpolationNesting=this.intpolationNesting,t.jsState=e.copyState(Y,this.jsState),t.innerMode=this.innerMode,this.innerMode&&this.innerState&&(t.innerState=e.copyState(this.innerMode,this.innerState)),t.restOfLine=this.restOfLine,t.isIncludeFiltered=this.isIncludeFiltered,t.isEach=this.isEach,t.lastTag=this.lastTag,t.scriptType=this.scriptType,t.isAttrs=this.isAttrs,t.attrsNest=this.attrsNest.slice(),t.inAttributeName=this.inAttributeName,t.attributeIsType=this.attributeIsType,t.attrValue=this.attrValue,t.indentOf=this.indentOf,t.indentToken=this.indentToken,t.innerModeForLine=this.innerModeForLine,t},{startState:$,copyState:B,token:U}}),e.defineMIME("text/x-jade","jade")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("lua",function(e,t){function n(e){return new RegExp("^(?:"+e.join("|")+")","i")}function r(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function i(e){for(var t=0;e.eat("=");)++t;return e.eat("["),t}function o(e,t){var n=e.next();return"-"==n&&e.eat("-")?e.eat("[")&&e.eat("[")?(t.cur=a(i(e),"comment"))(e,t):(e.skipToEnd(),"comment"):'"'==n||"'"==n?(t.cur=l(n))(e,t):"["==n&&/[\[=]/.test(e.peek())?(t.cur=a(i(e),"string"))(e,t):/\d/.test(n)?(e.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(n)?(e.eatWhile(/[\w\\\-_.]/),"variable"):null}function a(e,t){return function(n,r){for(var i,a=null;null!=(i=n.next());)if(null==a)"]"==i&&(a=0);else if("="==i)++a;else{if("]"==i&&a==e){r.cur=o;break}a=null}return t}}function l(e){return function(t,n){for(var r,i=!1;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.cur=o),"string"}}var s=e.indentUnit,c=r(t.specials||[]),u=r(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),f=r(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),d=r(["function","if","repeat","do","\\(","{"]),p=r(["end","until","\\)","}"]),h=n(["end","until","\\)","}","else","elseif"]);return{startState:function(e){return{basecol:e||0,indentDepth:0,cur:o}},token:function(e,t){if(e.eatSpace())return null;var n=t.cur(e,t),r=e.current();return"variable"==n&&(f.test(r)?n="keyword":u.test(r)?n="builtin":c.test(r)&&(n="variable-2")),"comment"!=n&&"string"!=n&&(d.test(r)?++t.indentDepth:p.test(r)&&--t.indentDepth),n},indent:function(e,t){var n=h.test(t);return e.basecol+s*(e.indentDepth-(n?1:0))},lineComment:"--",blockCommentStart:"--[[",blockCommentEnd:"]]"}}),e.defineMIME("text/x-lua","lua")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("cmake",function(){function e(e,t){for(var n,r,i=!1;!e.eol()&&(n=e.next())!=t.pending;){if("$"===n&&"\\"!=r&&'"'==t.pending){i=!0;break}r=n}return i&&e.backUp(1),t.continueString=n==t.pending?!1:!0,"string"}function t(t,r){var i=t.next();return"$"===i?t.match(n)?"variable-2":"variable":r.continueString?(t.backUp(1),e(t,r)):t.match(/(\s+)?\w+\(/)||t.match(/(\s+)?\w+\ \(/)?(t.backUp(1),"def"):"#"==i?(t.skipToEnd(),"comment"):"'"==i||'"'==i?(r.pending=i,e(t,r)):"("==i||")"==i?"bracket":i.match(/[0-9]/)?"number":(t.eatWhile(/[\w-]/),null)}var n=/({)?[a-zA-Z0-9_]+(})?/;return{startState:function(){var e={};return e.inDefinition=!1,e.inInclude=!1,e.continueString=!1,e.pending=!1,e},token:function(e,n){return e.eatSpace()?null:t(e,n)}}}),e.defineMIME("text/x-cmake","cmake")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("nginx",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){return l=t,e}function r(e,t){e.eatWhile(/[\w\$_]/);var r=e.current();if(s.propertyIsEnumerable(r))return"keyword";if(c.propertyIsEnumerable(r))return"variable-2";if(u.propertyIsEnumerable(r))return"string-2";var l=e.next();return"@"==l?(e.eatWhile(/[\w\\\-]/),n("meta",e.current())):"/"==l&&e.eat("*")?(t.tokenize=i,i(e,t)):"<"==l&&e.eat("!")?(t.tokenize=o,o(e,t)):"="!=l?"~"!=l&&"|"!=l||!e.eat("=")?'"'==l||"'"==l?(t.tokenize=a(l),t.tokenize(e,t)):"#"==l?(e.skipToEnd(),n("comment","comment")):"!"==l?(e.match(/^\s*\w*/),n("keyword","important")):/\d/.test(l)?(e.eatWhile(/[\w.%]/),n("number","unit")):/[,.+>*\/]/.test(l)?n(null,"select-op"):/[;{}:\[\]]/.test(l)?n(null,l):(e.eatWhile(/[\w\\\-]/),n("variable","variable")):n(null,"compare"):void n(null,"compare")}function i(e,t){for(var i,o=!1;null!=(i=e.next());){if(o&&"/"==i){t.tokenize=r;break}o="*"==i}return n("comment","comment")}function o(e,t){for(var i,o=0;null!=(i=e.next());){if(o>=2&&">"==i){t.tokenize=r;break}o="-"==i?o+1:0}return n("comment","comment")}function a(e){return function(t,i){for(var o,a=!1;null!=(o=t.next())&&(o!=e||a);)a=!a&&"\\"==o;return a||(i.tokenize=r),n("string","string")}}var l,s=t("break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"),c=t("http mail events server types location upstream charset_map limit_except if geo map"),u=t("include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"),f=e.indentUnit;
-
-return{startState:function(e){return{tokenize:r,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;l=null;var n=t.tokenize(e,t),r=t.stack[t.stack.length-1];return"hash"==l&&"rule"==r?n="atom":"variable"==n&&("rule"==r?n="number":r&&"@media{"!=r||(n="tag")),"rule"==r&&/^[\{\};]$/.test(l)&&t.stack.pop(),"{"==l?"@media"==r?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):"}"==l?t.stack.pop():"@media"==l?t.stack.push("@media"):"{"==r&&"comment"!=l&&t.stack.push("rule"),n},indent:function(e,t){var n=e.stack.length;return/^\}/.test(t)&&(n-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+n*f},electricChars:"}"}}),e.defineMIME("text/nginx","text/x-nginx-conf")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.string.charAt(e.pos+(t||0))}function n(e,t){if(t){var n=e.pos-t;return e.string.substr(n>=0?n:0,t)}return e.string.substr(0,e.pos-1)}function r(e,t){var n=e.string.length,r=n-e.pos+1;return e.string.substr(e.pos,t&&n>t?t:r)}function i(e,t){var n,r=e.pos+t;e.pos=0>=r?0:r>=(n=e.string.length-1)?n:r}e.defineMode("perl",function(){function e(e,t,n,r,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){for(var o,l=!1,s=0;o=e.next();){if(o===n[s]&&!l)return void 0!==n[++s]?(t.chain=n[s],t.style=r,t.tail=i):i&&e.eatWhile(i),t.tokenize=a,r;l=!l&&"\\"==o}return r},t.tokenize(e,t)}function o(e,t,n){return t.tokenize=function(e,t){return e.string==n&&(t.tokenize=a),e.skipToEnd(),"string"},t.tokenize(e,t)}function a(a,u){if(a.eatSpace())return null;if(u.chain)return e(a,u,u.chain,u.style,u.tail);if(a.match(/^\-?[\d\.]/,!1)&&a.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(a.match(/^<<(?=\w)/))return a.eatWhile(/\w/),o(a,u,a.current().substr(2));if(a.sol()&&a.match(/^\=item(?!\w)/))return o(a,u,"=cut");var f=a.next();if('"'==f||"'"==f){if(n(a,3)=="<<"+f){var d=a.pos;a.eatWhile(/\w/);var p=a.current().substr(1);if(p&&a.eat(f))return o(a,u,p);a.pos=d}return e(a,u,[f],"string")}if("q"==f){var h=t(a,-2);if(!h||!/\w/.test(h))if(h=t(a,0),"x"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],s,c);if("["==h)return i(a,2),e(a,u,["]"],s,c);if("{"==h)return i(a,2),e(a,u,["}"],s,c);if("<"==h)return i(a,2),e(a,u,[">"],s,c);if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],s,c)}else if("q"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],"string");if("["==h)return i(a,2),e(a,u,["]"],"string");if("{"==h)return i(a,2),e(a,u,["}"],"string");if("<"==h)return i(a,2),e(a,u,[">"],"string");if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],"string")}else if("w"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],"bracket");if("["==h)return i(a,2),e(a,u,["]"],"bracket");if("{"==h)return i(a,2),e(a,u,["}"],"bracket");if("<"==h)return i(a,2),e(a,u,[">"],"bracket");if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],"bracket")}else if("r"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],s,c);if("["==h)return i(a,2),e(a,u,["]"],s,c);if("{"==h)return i(a,2),e(a,u,["}"],s,c);if("<"==h)return i(a,2),e(a,u,[">"],s,c);if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],s,c)}else if(/[\^'"!~\/(\[{<]/.test(h)){if("("==h)return i(a,1),e(a,u,[")"],"string");if("["==h)return i(a,1),e(a,u,["]"],"string");if("{"==h)return i(a,1),e(a,u,["}"],"string");if("<"==h)return i(a,1),e(a,u,[">"],"string");if(/[\^'"!~\/]/.test(h))return e(a,u,[a.eat(h)],"string")}}if("m"==f){var h=t(a,-2);if((!h||!/\w/.test(h))&&(h=a.eat(/[(\[{<\^'"!~\/]/))){if(/[\^'"!~\/]/.test(h))return e(a,u,[h],s,c);if("("==h)return e(a,u,[")"],s,c);if("["==h)return e(a,u,["]"],s,c);if("{"==h)return e(a,u,["}"],s,c);if("<"==h)return e(a,u,[">"],s,c)}}if("s"==f){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat(/[(\[{<\^'"!~\/]/)))return"["==h?e(a,u,["]","]"],s,c):"{"==h?e(a,u,["}","}"],s,c):"<"==h?e(a,u,[">",">"],s,c):"("==h?e(a,u,[")",")"],s,c):e(a,u,[h,h],s,c)}if("y"==f){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat(/[(\[{<\^'"!~\/]/)))return"["==h?e(a,u,["]","]"],s,c):"{"==h?e(a,u,["}","}"],s,c):"<"==h?e(a,u,[">",">"],s,c):"("==h?e(a,u,[")",")"],s,c):e(a,u,[h,h],s,c)}if("t"==f){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat("r"),h&&(h=a.eat(/[(\[{<\^'"!~\/]/))))return"["==h?e(a,u,["]","]"],s,c):"{"==h?e(a,u,["}","}"],s,c):"<"==h?e(a,u,[">",">"],s,c):"("==h?e(a,u,[")",")"],s,c):e(a,u,[h,h],s,c)}if("`"==f)return e(a,u,[f],"variable-2");if("/"==f)return/~\s*$/.test(n(a))?e(a,u,[f],s,c):"operator";if("$"==f){var d=a.pos;if(a.eatWhile(/\d/)||a.eat("{")&&a.eatWhile(/\d/)&&a.eat("}"))return"variable-2";a.pos=d}if(/[$@%]/.test(f)){var d=a.pos;if(a.eat("^")&&a.eat(/[A-Z]/)||!/[@$%&]/.test(t(a,-2))&&a.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var h=a.current();if(l[h])return"variable-2"}a.pos=d}if(/[$@%&]/.test(f)&&(a.eatWhile(/[\w$\[\]]/)||a.eat("{")&&a.eatWhile(/[\w$\[\]]/)&&a.eat("}"))){var h=a.current();return l[h]?"variable-2":"variable"}if("#"==f&&"$"!=t(a,-2))return a.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(f)){var d=a.pos;if(a.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),l[a.current()])return"operator";a.pos=d}if("_"==f&&1==a.pos){if("_END__"==r(a,6))return e(a,u,["\x00"],"comment");if("_DATA__"==r(a,7))return e(a,u,["\x00"],"variable-2");if("_C__"==r(a,7))return e(a,u,["\x00"],"string")}if(/\w/.test(f)){var d=a.pos;if("{"==t(a,-2)&&("}"==t(a,0)||a.eatWhile(/\w/)&&"}"==t(a,0)))return"string";a.pos=d}if(/[A-Z]/.test(f)){var m=t(a,-2),d=a.pos;if(a.eatWhile(/[A-Z_]/),!/[\da-z]/.test(t(a,0))){var h=l[a.current()];return h?(h[1]&&(h=h[0]),":"!=m?1==h?"keyword":2==h?"def":3==h?"atom":4==h?"operator":5==h?"variable-2":"meta":"meta"):"meta"}a.pos=d}if(/[a-zA-Z_]/.test(f)){var m=t(a,-2);a.eatWhile(/\w/);var h=l[a.current()];return h?(h[1]&&(h=h[0]),":"!=m?1==h?"keyword":2==h?"def":3==h?"atom":4==h?"operator":5==h?"variable-2":"meta":"meta"):"meta"}return null}var l={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},s="string-2",c=/[goseximacplud]/;return{startState:function(){return{tokenize:a,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||a)(e,t)},lineComment:"#"}}),e.registerHelper("wordChars","perl",/[\w$]/),e.defineMIME("text/x-perl","perl")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sass",function(e){function t(e){return new RegExp("^"+e.join("|"))}function n(e,t){var n=e.peek();return")"===n?(e.next(),t.tokenizer=s,"operator"):"("===n?(e.next(),e.eatSpace(),"operator"):"'"===n||'"'===n?(t.tokenizer=i(e.next()),"string"):(t.tokenizer=i(")",!1),"string")}function r(e,t){return function(n,r){return n.sol()&&n.indentation()<=e?(r.tokenizer=s,s(n,r)):(t&&n.skipTo("*/")?(n.next(),n.next(),r.tokenizer=s):n.skipToEnd(),"comment")}}function i(e,t){function n(r,i){var a=r.next(),l=r.peek(),c=r.string.charAt(r.pos-2),u="\\"!==a&&l===e||a===e&&"\\"!==c;return u?(a!==e&&t&&r.next(),i.tokenizer=s,"string"):"#"===a&&"{"===l?(i.tokenizer=o(n),r.next(),"operator"):"string"}return null==t&&(t=!0),n}function o(e){return function(t,n){return"}"===t.peek()?(t.next(),n.tokenizer=e,"operator"):s(t,n)}}function a(t){if(0==t.indentCount){t.indentCount++;var n=t.scopes[0].offset,r=n+e.indentUnit;t.scopes.unshift({offset:r})}}function l(e){1!=e.scopes.length&&e.scopes.shift()}function s(e,t){var c=e.peek();if(e.match("/*"))return t.tokenizer=r(e.indentation(),!0),t.tokenizer(e,t);if(e.match("//"))return t.tokenizer=r(e.indentation(),!1),t.tokenizer(e,t);if(e.match("#{"))return t.tokenizer=o(s),"operator";if('"'===c||"'"===c)return e.next(),t.tokenizer=i(c),"string";if(t.cursorHalf){if("#"===c&&(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^-?[0-9\.]+/))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^(px|em|in)\b/))return e.peek()||(t.cursorHalf=0),"unit";if(e.match(f))return e.peek()||(t.cursorHalf=0),"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=n,e.peek()||(t.cursorHalf=0),"atom";if("$"===c)return e.next(),e.eatWhile(/[\w-]/),e.peek()||(t.cursorHalf=0),"variable-3";if("!"===c)return e.next(),e.peek()||(t.cursorHalf=0),e.match(/^[\w]+/)?"keyword":"operator";if(e.match(p))return e.peek()||(t.cursorHalf=0),"operator";if(e.eatWhile(/[\w-]/))return e.peek()||(t.cursorHalf=0),"attribute";if(!e.peek())return t.cursorHalf=0,null}else{if("."===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("#"===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("$"===c)return e.next(),e.eatWhile(/[\w-]/),"variable-2";if(e.match(/^-?[0-9\.]+/))return"number";if(e.match(/^(px|em|in)\b/))return"unit";if(e.match(f))return"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=n,"atom";if("="===c&&e.match(/^=[\w-]+/))return a(t),"meta";if("+"===c&&e.match(/^\+[\w-]+/))return"variable-3";if("@"===c&&e.match(/@extend/)&&(e.match(/\s*[\w]/)||l(t)),e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return a(t),"meta";if("@"===c)return e.next(),e.eatWhile(/[\w-]/),"meta";if(e.eatWhile(/[\w-]/))return e.match(/ *: *[\w-\+\$#!\("']/,!1)?"property":e.match(/ *:/,!1)?(a(t),t.cursorHalf=1,"atom"):e.match(/ *,/,!1)?"atom":(a(t),"atom");if(":"===c)return e.match(h)?"keyword":(e.next(),t.cursorHalf=1,"operator")}return e.match(p)?"operator":(e.next(),null)}function c(t,n){t.sol()&&(n.indentCount=0);var r=n.tokenizer(t,n),i=t.current();if(("@return"===i||"}"===i)&&l(n),null!==r){for(var o=t.pos-i.length,a=o+e.indentUnit*n.indentCount,s=[],c=0;c<n.scopes.length;c++){var u=n.scopes[c];u.offset<=a&&s.push(u)}n.scopes=s}return r}var u=["true","false","null","auto"],f=new RegExp("^"+u.join("|")),d=["\\(","\\)","=",">","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],p=t(d),h=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:s,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,t){var n=c(e,t);return t.lastToken={style:n,content:e.current()},n},indent:function(e){return e.scopes[0].offset}}}),e.defineMIME("text/x-sass","sass")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("r",function(e){function t(e){for(var t=e.split(" "),n={},r=0;r<t.length;++r)n[t[r]]=!0;return n}function n(e,t){a=null;var n=e.next();if("#"==n)return e.skipToEnd(),"comment";if("0"==n&&e.eat("x"))return e.eatWhile(/[\da-f]/i),"number";if("."==n&&e.eat(/\d/))return e.match(/\d*(?:e[+\-]?\d+)?/),"number";if(/\d/.test(n))return e.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/),"number";if("'"==n||'"'==n)return t.tokenize=r(n),"string";if("."==n&&e.match(/.[.\d]+/))return"keyword";if(/[\w\.]/.test(n)&&"_"!=n){e.eatWhile(/[\w\.]/);var i=e.current();return l.propertyIsEnumerable(i)?"atom":c.propertyIsEnumerable(i)?(u.propertyIsEnumerable(i)&&!e.match(/\s*if(\s+|$)/,!1)&&(a="block"),"keyword"):s.propertyIsEnumerable(i)?"builtin":"variable"}return"%"==n?(e.skipTo("%")&&e.next(),"variable-2"):"<"==n&&e.eat("-")?"arrow":"="==n&&t.ctx.argList?"arg-is":f.test(n)?"$"==n?"dollar":(e.eatWhile(f),"operator"):/[\(\){}\[\];]/.test(n)?(a=n,";"==n?"semi":null):null}function r(e){return function(t,r){if(t.eat("\\")){var i=t.next();return"x"==i?t.match(/^[a-f0-9]{2}/i):("u"==i||"U"==i)&&t.eat("{")&&t.skipTo("}")?t.next():"u"==i?t.match(/^[a-f0-9]{4}/i):"U"==i?t.match(/^[a-f0-9]{8}/i):/[0-7]/.test(i)&&t.match(/^[0-7]{1,2}/),"string-2"}for(var o;null!=(o=t.next());){if(o==e){r.tokenize=n;break}if("\\"==o){t.backUp(1);break}}return"string"}}function i(e,t,n){e.ctx={type:t,indent:e.indent,align:null,column:n.column(),prev:e.ctx}}function o(e){e.indent=e.ctx.indent,e.ctx=e.ctx.prev}var a,l=t("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"),s=t("list quote bquote eval return call parse deparse"),c=t("if else repeat while function for in next break"),u=t("if else repeat while function for"),f=/[+\-*\/^<>=!&|~$:]/;return{startState:function(){return{tokenize:n,ctx:{type:"top",indent:-e.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(e,t){if(e.sol()&&(null==t.ctx.align&&(t.ctx.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);"comment"!=n&&null==t.ctx.align&&(t.ctx.align=!0);var r=t.ctx.type;return";"!=a&&"{"!=a&&"}"!=a||"block"!=r||o(t),"{"==a?i(t,"}",e):"("==a?(i(t,")",e),t.afterIdent&&(t.ctx.argList=!0)):"["==a?i(t,"]",e):"block"==a?i(t,"block",e):a==r&&o(t),t.afterIdent="variable"==n||"keyword"==n,n},indent:function(t,r){if(t.tokenize!=n)return 0;var i=r&&r.charAt(0),o=t.ctx,a=i==o.type;return"block"==o.type?o.indent+("{"==i?0:e.indentUnit):o.align?o.column+(a?0:1):o.indent+(a?0:e.indentUnit)},lineComment:"#"}}),e.defineMIME("text/x-rsrc","r")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../addon/mode/simple")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple"],e):e(CodeMirror)}(function(e){"use strict";var t=["from","maintainer","run","cmd","expose","env","add","copy","entrypoint","volume","user","workdir","onbuild"],n="("+t.join("|")+")",r=new RegExp(n+"\\s*$","i"),i=new RegExp(n+"(\\s+)","i");e.defineSimpleMode("dockerfile",{start:[{regex:/#.*$/,token:"comment"},{regex:r,token:"variable-2"},{regex:i,token:["variable-2",null],next:"arguments"},{regex:/./,token:null}],arguments:[{regex:/#.*$/,token:"error",next:"start"},{regex:/[^#]+\\$/,token:null},{regex:/[^#]+/,token:null,next:"start"},{regex:/$/,token:null,next:"start"},{token:null,next:"start"}]}),e.defineMIME("text/x-dockerfile","dockerfile")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n,r){if(0>r&&0==n.ch)return t.clipPos(d(n.line-1));var i=t.getLine(n.line);if(r>0&&n.ch>=i.length)return t.clipPos(d(n.line+1,0));for(var o,a="start",l=n.ch,s=0>r?0:i.length,c=0;l!=s;l+=r,c++){var u=i.charAt(0>r?l-1:l),f="_"!=u&&e.isWordChar(u)?"w":"o";if("w"==f&&u.toUpperCase()==u&&(f="W"),"start"==a)"o"!=f&&(a="in",o=f);else if("in"==a&&o!=f){if("w"==o&&"W"==f&&0>r&&l--,"W"==o&&"w"==f&&r>0){o="w";continue}break}}return d(n.line,l)}function n(e,n){e.extendSelectionsBy(function(r){return e.display.shift||e.doc.extend||r.empty()?t(e.doc,r.head,n):0>n?r.from():r.to()})}function r(e,t){e.operation(function(){for(var n=e.listSelections().length,r=[],i=-1,o=0;n>o;o++){var a=e.listSelections()[o].head;if(!(a.line<=i)){var l=d(a.line+(t?0:1),0);e.replaceRange("\n",l,null,"+insertLine"),e.indentLine(l.line,null,!0),r.push({head:l,anchor:l}),i=a.line+1}}e.setSelections(r)})}function i(t,n){for(var r=n.ch,i=r,o=t.getLine(n.line);r&&e.isWordChar(o.charAt(r-1));)--r;for(;i<o.length&&e.isWordChar(o.charAt(i));)++i;return{from:d(n.line,r),to:d(n.line,i),word:o.slice(r,i)}}function o(e){var t=e.getCursor(),n=e.scanForBracket(t,-1);if(n)for(;;){var r=e.scanForBracket(t,1);if(!r)return;if(r.ch==m.charAt(m.indexOf(n.ch)+1))return e.setSelection(d(n.pos.line,n.pos.ch+1),r.pos,!1),!0;t=d(r.pos.line,r.pos.ch+1)}}function a(e,t){for(var n,r=e.listSelections(),i=[],o=0;o<r.length;o++){var a=r[o];if(!a.empty()){for(var l=a.from().line,s=a.to().line;o<r.length-1&&r[o+1].from().line==s;)s=a[++o].to().line;i.push(l,s)}}i.length?n=!0:i.push(e.firstLine(),e.lastLine()),e.operation(function(){for(var r=[],o=0;o<i.length;o+=2){var a=i[o],l=i[o+1],s=d(a,0),c=d(l),u=e.getRange(s,c,!1);t?u.sort():u.sort(function(e,t){var n=e.toUpperCase(),r=t.toUpperCase();return n!=r&&(e=n,t=r),t>e?-1:e==t?0:1}),e.replaceRange(u,s,c,"+sortLines"),n&&r.push({anchor:s,head:c})}n&&e.setSelections(r,0)})}function l(t,n){t.operation(function(){for(var r=t.listSelections(),o=[],a=[],l=0;l<r.length;l++){var s=r[l];s.empty()?(o.push(l),a.push("")):a.push(n(t.getRange(s.from(),s.to())))}t.replaceSelections(a,"around","case");for(var c,l=o.length-1;l>=0;l--){var s=r[o[l]];if(!(c&&e.cmpPos(s.head,c)>0)){var u=i(t,s.head);c=u.from,t.replaceRange(n(u.word),u.from,u.to,"case")}}})}function s(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var o=i(t,n);if(!o.word)return;n=o.from,r=o.to}return{from:n,to:r,query:t.getRange(n,r),word:o}}function c(e,t){var n=s(e);if(n){var r=n.query,i=e.getSearchCursor(r,t?n.to:n.from);(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):(i=e.getSearchCursor(r,t?d(e.firstLine(),0):e.clipPos(d(e.lastLine()))),(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):n.word&&e.setSelection(n.from,n.to))}}var u=e.keyMap.sublime={fallthrough:"default"},f=e.commands,d=e.Pos,p=e.keyMap["default"]==e.keyMap.macDefault,h=p?"Cmd-":"Ctrl-";f[u["Alt-Left"]="goSubwordLeft"]=function(e){n(e,-1)},f[u["Alt-Right"]="goSubwordRight"]=function(e){n(e,1)},f[u[h+"Up"]="scrollLineUp"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},f[u[h+"Down"]="scrollLineDown"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},f[u["Shift-"+h+"L"]="splitSelectionByLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)for(var i=t[r].from(),o=t[r].to(),a=i.line;a<=o.line;++a)o.line>i.line&&a==o.line&&0==o.ch||n.push({anchor:a==i.line?i:d(a,0),head:a==o.line?o:d(a)});e.setSelections(n,0)},u["Shift-Tab"]="indentLess",f[u.Esc="singleSelectionTop"]=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},f[u[h+"L"]="selectLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var i=t[r];n.push({anchor:d(i.from().line,0),head:d(i.to().line+1,0)})}e.setSelections(n)},u["Shift-"+h+"K"]="deleteLine",f[u[h+"Enter"]="insertLineAfter"]=function(e){r(e,!1)},f[u["Shift-"+h+"Enter"]="insertLineBefore"]=function(e){r(e,!0)},f[u[h+"D"]="selectNextOccurrence"]=function(t){var n=t.getCursor("from"),r=t.getCursor("to"),o=t.state.sublimeFindFullWord==t.doc.sel;if(0==e.cmpPos(n,r)){var a=i(t,n);if(!a.word)return;t.setSelection(a.from,a.to),o=!0}else{var l=t.getRange(n,r),s=o?new RegExp("\\b"+l+"\\b"):l,c=t.getSearchCursor(s,r);c.findNext()?t.addSelection(c.from(),c.to()):(c=t.getSearchCursor(s,d(t.firstLine(),0)),c.findNext()&&t.addSelection(c.from(),c.to()))}o&&(t.state.sublimeFindFullWord=t.doc.sel)};var m="(){}[]";f[u["Shift-"+h+"Space"]="selectScope"]=function(e){o(e)||e.execCommand("selectAll")},f[u["Shift-"+h+"M"]="selectBetweenBrackets"]=function(t){return o(t)?void 0:e.Pass},f[u[h+"M"]="goToBracket"]=function(t){t.extendSelectionsBy(function(n){var r=t.scanForBracket(n.head,1);if(r&&0!=e.cmpPos(r.pos,n.head))return r.pos;var i=t.scanForBracket(n.head,-1);return i&&d(i.pos.line,i.pos.ch+1)||n.head})};var g=p?"Cmd-Ctrl-":"Shift-Ctrl-";f[u[g+"Up"]="swapLineUp"]=function(e){for(var t=e.listSelections(),n=[],r=e.firstLine()-1,i=[],o=0;o<t.length;o++){var a=t[o],l=a.from().line-1,s=a.to().line;i.push({anchor:d(a.anchor.line-1,a.anchor.ch),head:d(a.head.line-1,a.head.ch)}),0!=a.to().ch||a.empty()||--s,l>r?n.push(l,s):n.length&&(n[n.length-1]=s),r=s}e.operation(function(){for(var t=0;t<n.length;t+=2){var r=n[t],o=n[t+1],a=e.getLine(r);e.replaceRange("",d(r,0),d(r+1,0),"+swapLine"),o>e.lastLine()?e.replaceRange("\n"+a,d(e.lastLine()),null,"+swapLine"):e.replaceRange(a+"\n",d(o,0),null,"+swapLine")}e.setSelections(i),e.scrollIntoView()})},f[u[g+"Down"]="swapLineDown"]=function(e){for(var t=e.listSelections(),n=[],r=e.lastLine()+1,i=t.length-1;i>=0;i--){var o=t[i],a=o.to().line+1,l=o.from().line;0!=o.to().ch||o.empty()||a--,r>a?n.push(a,l):n.length&&(n[n.length-1]=l),r=l}e.operation(function(){for(var t=n.length-2;t>=0;t-=2){var r=n[t],i=n[t+1],o=e.getLine(r);r==e.lastLine()?e.replaceRange("",d(r-1),d(r),"+swapLine"):e.replaceRange("",d(r,0),d(r+1,0),"+swapLine"),e.replaceRange(o+"\n",d(i,0),null,"+swapLine")}e.scrollIntoView()})},u[h+"/"]="toggleComment",f[u[h+"J"]="joinLines"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){for(var i=t[r],o=i.from(),a=o.line,l=i.to().line;r<t.length-1&&t[r+1].from().line==l;)l=t[++r].to().line;n.push({start:a,end:l,anchor:!i.empty()&&o})}e.operation(function(){for(var t=0,r=[],i=0;i<n.length;i++){for(var o,a=n[i],l=a.anchor&&d(a.anchor.line-t,a.anchor.ch),s=a.start;s<=a.end;s++){var c=s-t;s==a.end&&(o=d(c,e.getLine(c).length+1)),c<e.lastLine()&&(e.replaceRange(" ",d(c),d(c+1,/^\s*/.exec(e.getLine(c+1))[0].length),"+joinLines"),++t)}r.push({anchor:l||o,head:o})}e.setSelections(r,0)})},f[u["Shift-"+h+"D"]="duplicateLine"]=function(e){e.operation(function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];r.empty()?e.replaceRange(e.getLine(r.head.line)+"\n",d(r.head.line,0),null,"+duplicateLine"):e.replaceRange(e.getRange(r.from(),r.to()),r.from(),null,"+duplicateLine")}e.scrollIntoView()})},u[h+"T"]="transposeChars",f[u.F9="sortLines"]=function(e){a(e,!0)},f[u[h+"F9"]="sortLinesInsensitive"]=function(e){a(e,!1)},f[u.F2="nextBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),r=n.find();if(r)return t.push(n),e.setSelection(r.from,r.to)}},f[u["Shift-F2"]="prevBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(n)return e.setSelection(n.from,n.to);t.pop()}},f[u[h+"F2"]="toggleBookmark"]=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r<t.length;r++){for(var i=t[r].from(),o=t[r].to(),a=e.findMarks(i,o),l=0;l<a.length;l++)if(a[l].sublimeBookmark){a[l].clear();for(var s=0;s<n.length;s++)n[s]==a[l]&&n.splice(s--,1);break}l==a.length&&n.push(e.markText(i,o,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},f[u["Shift-"+h+"F2"]="clearBookmarks"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();t.length=0},f[u["Alt-F2"]="selectBookmarks"]=function(e){var t=e.state.sublimeBookmarks,n=[];if(t)for(var r=0;r<t.length;r++){var i=t[r].find();i?n.push({anchor:i.from,head:i.to}):t.splice(r--,0)}n.length&&e.setSelections(n,0)},u["Alt-Q"]="wrapLines";var v=h+"K ";u[v+h+"Backspace"]="delLineLeft",f[u.Backspace="smartBackspace"]=function(t){if(t.somethingSelected())return e.Pass;var n=t.getCursor(),r=t.getRange({line:n.line,ch:0},n),i=e.countColumn(r,null,t.getOption("tabSize"));return r&&!/\S/.test(r)&&i%t.getOption("indentUnit")==0?t.indentSelection("subtract"):e.Pass},f[u[v+h+"K"]="delLineRight"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange("",t[n].anchor,d(t[n].to().line),"+delete");e.scrollIntoView()})},f[u[v+h+"U"]="upcaseAtCursor"]=function(e){l(e,function(e){return e.toUpperCase()})},f[u[v+h+"L"]="downcaseAtCursor"]=function(e){l(e,function(e){return e.toLowerCase()})},f[u[v+h+"Space"]="setSublimeMark"]=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},f[u[v+h+"A"]="selectToSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},f[u[v+h+"W"]="deleteToSublimeMark"]=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),i=n;if(e.cmpPos(r,i)>0){var o=i;i=r,r=o}t.state.sublimeKilled=t.getRange(r,i),t.replaceRange("",r,i,"+delete")}},f[u[v+h+"X"]="swapWithSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},f[u[v+h+"Y"]="sublimeYank"]=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},u[v+h+"G"]="clearBookmarks",f[u[v+h+"C"]="showInCenter"]=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},f[u["Shift-Alt-Up"]="selectLinesUpward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n<t.length;n++){var r=t[n];r.head.line>e.firstLine()&&e.addSelection(d(r.head.line-1,r.head.ch))}})},f[u["Shift-Alt-Down"]="selectLinesDownward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n<t.length;n++){var r=t[n];r.head.line<e.lastLine()&&e.addSelection(d(r.head.line+1,r.head.ch))}})},f[u[h+"F3"]="findUnder"]=function(e){c(e,!0)},f[u["Shift-"+h+"F3"]="findUnderPrevious"]=function(e){c(e,!1)},f[u["Alt-F3"]="findAllUnder"]=function(e){var t=s(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],i=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&i++;e.setSelections(r,i)}},u["Shift-"+h+"["]="fold",u["Shift-"+h+"]"]="unfold",u[v+h+"0"]=u[v+h+"j"]="unfoldAll",u[h+"I"]="findIncremental",u["Shift-"+h+"I"]="findIncrementalReverse",u[h+"H"]="replace",u.F3="findNext",u["Shift-F3"]="findPrev",e.normalizeKeyMap(u)}); \ No newline at end of file
+if("interpolation"==e)return s(n,t,"interpolation");if(":"==e)return"pseudo";if(T&&"("==e)return s(n,t,"parens")}return n.context.type},z.block=function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return _.hasOwnProperty(r)?(m="property","maybeprop"):w.hasOwnProperty(r)?(m="string-2","maybeprop"):T?(m=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(m+=" error","maybeprop")}return"meta"==e?"block":T||"hash"!=e&&"qualifier"!=e?z.top(e,t,n):(m="error","block")},z.maybeprop=function(e,t,n){return":"==e?s(n,t,"prop"):u(e,t,n)},z.prop=function(e,t,n){if(";"==e)return c(n);if("{"==e&&T)return s(n,t,"propBlock");if("}"==e||"{"==e)return d(e,t,n);if("("==e)return s(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)f(t);else if("interpolation"==e)return s(n,t,"interpolation")}else m+=" error";return"prop"},z.propBlock=function(e,t,n){return"}"==e?c(n):"word"==e?(m="property","maybeprop"):n.context.type},z.parens=function(e,t,n){return"{"==e||"}"==e?d(e,t,n):")"==e?c(n):"("==e?s(n,t,"parens"):"interpolation"==e?s(n,t,"interpolation"):("word"==e&&f(t),"parens")},z.pseudo=function(e,t,n){return"word"==e?(m="variable-3",n.context.type):u(e,t,n)},z.documentTypes=function(e,t,n){return"word"==e&&y.hasOwnProperty(t.current())?(m="tag",n.context.type):z.atBlock(e,t,n)},z.atBlock=function(e,t,n){if("("==e)return s(n,t,"atBlock_parens");if("}"==e||";"==e)return d(e,t,n);if("{"==e)return c(n)&&s(n,t,T?"block":"top");if("interpolation"==e)return s(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();m="only"==r||"not"==r||"and"==r||"or"==r?"keyword":b.hasOwnProperty(r)?"attribute":x.hasOwnProperty(r)?"property":k.hasOwnProperty(r)?"keyword":_.hasOwnProperty(r)?"property":w.hasOwnProperty(r)?"string-2":L.hasOwnProperty(r)?"atom":M.hasOwnProperty(r)?"keyword":"error"}return n.context.type},z.atComponentBlock=function(e,t,n){return"}"==e?d(e,t,n):"{"==e?c(n)&&s(n,t,T?"block":"top",!1):("word"==e&&(m="error"),n.context.type)},z.atBlock_parens=function(e,t,n){return")"==e?c(n):"{"==e||"}"==e?d(e,t,n,2):z.atBlock(e,t,n)},z.restricted_atBlock_before=function(e,t,n){return"{"==e?s(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(m="variable","restricted_atBlock_before"):u(e,t,n)},z.restricted_atBlock=function(e,t,n){return"}"==e?(n.stateArg=null,c(n)):"word"==e?(m="@font-face"==n.stateArg&&!C.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!S.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},z.keyframes=function(e,t,n){return"word"==e?(m="variable","keyframes"):"{"==e?s(n,t,"top"):u(e,t,n)},z.at=function(e,t,n){return";"==e?c(n):"{"==e||"}"==e?d(e,t,n):("word"==e?m="tag":"hash"==e&&(m="builtin"),"at")},z.interpolation=function(e,t,n){return"}"==e?c(n):"{"==e||";"==e?d(e,t,n):("word"==e?m="variable":"variable"!=e&&"("!=e&&")"!=e&&(m="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:p?"block":"top",stateArg:null,context:new l(p?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||i)(e,t);return n&&"object"==typeof n&&(h=n[1],n=n[0]),m=n,t.state=z[t.state](h,e,t),m},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"==r&&("parens"==n.type||"atBlock_parens"==n.type)||"{"==r&&("at"==n.type||"atBlock"==n.type))&&(i=Math.max(0,n.indent-g),n=n.prev):(n=n.prev,i=n.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var r=["domain","regexp","url","url-prefix"],i=t(r),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],s=t(l),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(c),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],f=t(d),p=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],h=t(p),m=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],g=t(m),v=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],y=t(v),b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],x=t(b),k=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],_=t(k),w=r.concat(o).concat(l).concat(c).concat(d).concat(p).concat(b).concat(k);e.registerHelper("hintWords","css",w),e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:h,fontProperties:g,counterDescriptors:y,colorKeywords:x,valueKeywords:_,tokenHooks:{"/":function(e,t){return e.eat("*")?(t.tokenize=n,n(e,t)):!1}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:h,colorKeywords:x,valueKeywords:_,fontProperties:g,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},":":function(e){return e.match(/\s*\{/)?[null,"{"]:!1},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return e.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:h,colorKeywords:x,valueKeywords:_,fontProperties:g,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)?!1:(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:a,mediaFeatures:s,propertyKeywords:f,nonStandardPropertyKeywords:h,fontProperties:g,counterDescriptors:y,colorKeywords:x,valueKeywords:_,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return e.eat("*")?(t.tokenize=n,n(e,t)):!1}},name:"css",helperType:"gss"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n){var r=e.current(),i=r.search(t);return i>-1?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}function n(e){var t=s[e];return t?t:s[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function r(e,t){for(var r,i=e.pos;i>=0&&"<"!==e.string.charAt(i);)i--;return 0>i?i:(r=e.string.slice(i,e.pos).match(n(t)))?r[2]:""}function i(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function o(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),i=e[n],o=i.length-1;o>=0;o--)r.unshift(i[o])}function a(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(!i[0]||i[1].test(r(t,i[0])))return i[2]}}var l={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]},s={};e.defineMode("htmlmixed",function(n,r){function s(r,o){var l,d=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase(),f=d&&u.hasOwnProperty(d)&&u[d],p=c.token(r,o.htmlState);if(f&&/\btag\b/.test(p)&&">"===r.current()&&(l=a(f,r))){var h=e.getMode(n,l),m=i(d,!0),g=i(d,!1);o.token=function(e,n){return e.match(m,!1)?(n.token=s,n.localState=n.localMode=null,null):t(e,g,n.localMode.token(e,n.localState))},o.localMode=h,o.localState=e.startState(h,c.indent(o.htmlState,""))}return p}var c=e.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:r.multilineTagIndentFactor,multilineTagIndentPastTag:r.multilineTagIndentPastTag}),u={},d=r&&r.tags,f=r&&r.scriptTypes;if(o(l,u),d&&o(d,u),f)for(var p=f.length-1;p>=0;p--)u.script.unshift(["type",f[p].matches,f[p].mode]);return{startState:function(){var e=c.startState();return{token:s,localMode:null,localState:null,htmlState:e}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,localMode:t.localMode,localState:n,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n){return!t.localMode||/^\s*<\//.test(n)?c.indent(t.htmlState,n):t.localMode.indent?t.localMode.indent(t.localState,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/multiplex")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/multiplex"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("htmlembedded",function(t,n){return e.multiplexingMode(e.getMode(t,"htmlmixed"),{open:n.open||n.scriptStartRegex||"<%",close:n.close||n.scriptEndRegex||"%>",mode:e.getMode(t,n.scriptingModeSpec)})},"htmlmixed"),e.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),e.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),e.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),e.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){return"function"==typeof e?e(t):e.propertyIsEnumerable(t)}function r(e,t){if(!t.startOfLine)return!1;for(var n,i=null;n=e.peek();){if("\\"==n&&e.match(/^.$/)){i=r;break}if("/"==n&&e.match(/^\/[\/\*]/,!1))break;e.next()}return t.tokenize=i,"meta"}function i(e,t){return"variable-3"==t.prevToken?"variable-3":!1}function o(e){return e.eatWhile(/[\w\.']/),"number"}function a(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var n=e.match(/"([^\s\\()]{0,16})\(/);return n?(t.cpp11RawStringDelim=n[1],t.tokenize=c,c(e,t)):!1}return e.match(/(u8|u|U|L)/)?e.match(/["']/,!1)?"string":!1:(e.next(),!1)}function l(e){var t=/(\w+)::(\w+)$/.exec(e);return t&&t[1]==t[2]}function s(e,t){for(var n;null!=(n=e.next());)if('"'==n&&!e.eat('"')){t.tokenize=null;break}return"string"}function c(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),r=e.match(new RegExp(".*?\\)"+n+'"'));return r?t.tokenize=null:e.skipToEnd(),"string"}function u(t,n){function r(e){if(e)for(var t in e)e.hasOwnProperty(t)&&i.push(t)}"string"==typeof t&&(t=[t]);var i=[];r(n.keywords),r(n.types),r(n.builtin),r(n.atoms),i.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],i));for(var o=0;o<t.length;++o)e.defineMIME(t[o],n)}function d(e,t){for(var n=!1;!e.eol();){if(!n&&e.match('"""')){t.tokenize=null;break}n="\\"==e.next()&&!n}return"string"}function f(e){return function(t,n){for(var r,i=!1,o=!1;!t.eol();){if(!e&&!i&&t.match('"')){o=!0;break}if(e&&t.match('"""')){o=!0;break}r=t.next(),!i&&"$"==r&&t.match("{")&&t.skipTo("}"),i=!i&&"\\"==r&&!e}return(o||!e)&&(n.tokenize=null),"string"}}function p(e){return function(t,n){for(var r,i=!1,o=!1;!t.eol();){if(!i&&t.match('"')&&("single"==e||t.match('""'))){o=!0;break}if(!i&&t.match("``")){g=p(e),o=!0;break}r=t.next(),i="single"==e&&!i&&"\\"==r}return o&&(n.tokenize=null),"string"}}e.defineMode("clike",function(t,r){function i(e,t){var r=e.next();if(C[r]){var i=C[r](e,t);if(i!==!1)return i}if('"'==r||"'"==r)return t.tokenize=o(r),t.tokenize(e,t);if(A.test(r))return p=r,null;if(z.test(r)){if(e.backUp(1),e.match(E))return"number";e.next()}if("/"==r){if(e.eat("*"))return t.tokenize=a,a(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(O.test(r))return e.eatWhile(O),"operator";if(e.eatWhile(/[\w\$_\xa1-\uffff]/),T)for(;e.match(T);)e.eatWhile(/[\w\$_\xa1-\uffff]/);var l=e.current();return n(y,l)?(n(k,l)&&(p="newstatement"),n(_,l)&&(h=!0),"keyword"):n(b,l)?"variable-3":n(x,l)?(n(k,l)&&(p="newstatement"),"builtin"):n(w,l)?"atom":"variable"}function o(e){return function(t,n){for(var r,i=!1,o=!1;null!=(r=t.next());){if(r==e&&!i){o=!0;break}i=!i&&"\\"==r}return(o||!i&&!S)&&(n.tokenize=null),"string"}}function a(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}function l(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function s(e){return"statement"==e||"switchstatement"==e||"namespace"==e}function c(e,t,n){var r=e.indented;return e.context&&s(e.context.type)&&!s(n)&&(r=e.context.indented),e.context=new l(r,t,n,null,e.context)}function u(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}function d(e,t){return"variable"==t.prevToken||"variable-3"==t.prevToken?!0:/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,e.start))?!0:void 0}function f(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.type)return!1;e=e.prev}}var p,h,m=t.indentUnit,g=r.statementIndentUnit||m,v=r.dontAlignCalls,y=r.keywords||{},b=r.types||{},x=r.builtin||{},k=r.blockKeywords||{},_=r.defKeywords||{},w=r.atoms||{},C=r.hooks||{},S=r.multiLineStrings,M=r.indentStatements!==!1,L=r.indentSwitch!==!1,T=r.namespaceSeparator,A=r.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,z=r.numberStart||/[\d\.]/,E=r.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,O=r.isOperatorChar||/[+\-*&%=<>!?|\/]/,q=r.endStatement||/^[;:,]$/;return{startState:function(e){return{tokenize:null,context:new l((e||0)-m,0,"top",!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;p=h=null;var o=(t.tokenize||i)(e,t);if("comment"==o||"meta"==o)return o;if(null==n.align&&(n.align=!0),q.test(p))for(;s(t.context.type);)u(t);else if("{"==p)c(t,e.column(),"}");else if("["==p)c(t,e.column(),"]");else if("("==p)c(t,e.column(),")");else if("}"==p){for(;s(n.type);)n=u(t);for("}"==n.type&&(n=u(t));s(n.type);)n=u(t)}else if(p==n.type)u(t);else if(M&&(("}"==n.type||"top"==n.type)&&";"!=p||s(n.type)&&"newstatement"==p)){var a="statement";"newstatement"==p&&L&&"switch"==e.current()?a="switchstatement":"keyword"==o&&"namespace"==e.current()&&(a="namespace"),c(t,e.column(),a)}if("variable"==o&&("def"==t.prevToken||r.typeFirstDefinitions&&d(e,t)&&f(t.context)&&e.match(/^\s*\(/,!1))&&(o="def"),C.token){var l=C.token(e,t,o);void 0!==l&&(o=l)}return"def"==o&&r.styleDefs===!1&&(o="variable"),t.startOfLine=!1,t.prevToken=h?"def":o||p,o},indent:function(t,n){if(t.tokenize!=i&&null!=t.tokenize)return e.Pass;var o=t.context,a=n&&n.charAt(0);if(s(o.type)&&"}"==a&&(o=o.prev),C.indent){var l=C.indent(t,o,n);if("number"==typeof l)return l}var c=a==o.type,u=o.prev&&"switchstatement"==o.prev.type;if(r.allmanIndentation&&/[{(]/.test(a)){for(;"top"!=o.type&&"}"!=o.type;)o=o.prev;return o.indented}return s(o.type)?o.indented+("{"==a?0:g):!o.align||v&&")"==o.type?")"!=o.type||c?o.indented+(c?0:m)+(c||!u||/^(?:case|default)\b/.test(n)?0:m):o.indented+g:o.column+(c?0:1)},electricInput:L?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var h="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",m="int long char short double float unsigned signed void size_t ptrdiff_t";u(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:t(h),types:t(m+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:t("case do else for if switch while struct"),defKeywords:t("struct"),typeFirstDefinitions:!0,atoms:t("null true false"),hooks:{"#":r,"*":i},modeProps:{fold:["brace","include"]}}),u(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:t(h+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:t(m+" bool wchar_t"),blockKeywords:t("catch class do else finally for if struct switch try while"),defKeywords:t("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:t("true false null"),
+hooks:{"#":r,"*":i,u:a,U:a,L:a,R:a,0:o,1:o,2:o,3:o,4:o,5:o,6:o,7:o,8:o,9:o,token:function(e,t,n){return"variable"!=n||"("!=e.peek()||";"!=t.prevToken&&null!=t.prevToken&&"}"!=t.prevToken||!l(e.current())?void 0:"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),u("text/x-java",{name:"clike",keywords:t("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while"),types:t("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:t("catch class do else finally for if switch try while"),defKeywords:t("class interface package enum"),typeFirstDefinitions:!0,atoms:t("true false null"),endStatement:/^[;:]$/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),u("text/x-csharp",{name:"clike",keywords:t("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:t("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:t("catch class do else finally for foreach if struct switch try while"),defKeywords:t("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:t("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=s,s(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),u("text/x-scala",{name:"clike",keywords:t("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble :: #:: "),types:t("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:t("catch class do else finally for forSome if match switch try while"),defKeywords:t("class def object package trait type val var"),atoms:t("true false null"),indentStatements:!1,indentSwitch:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return e.match('""')?(t.tokenize=d,t.tokenize(e,t)):!1},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"}},modeProps:{closeBrackets:{triples:'"'}}}),u("text/x-kotlin",{name:"clike",keywords:t("package as typealias class interface this super val var fun for is in This throw return break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix"),types:t("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,blockKeywords:t("catch class do else finally for if where try while enum"),defKeywords:t("class val var object package interface fun"),atoms:t("true false null this"),hooks:{'"':function(e,t){return t.tokenize=f(e.match('""')),t.tokenize(e,t)}},modeProps:{closeBrackets:{triples:'"'}}}),u(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:t("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:t("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:t("for while do if else struct"),builtin:t("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:t("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":r},modeProps:{fold:["brace","include"]}}),u("text/x-nesc",{name:"clike",keywords:t(h+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:t(m),blockKeywords:t("case do else for if switch while struct"),atoms:t("null true false"),hooks:{"#":r},modeProps:{fold:["brace","include"]}}),u("text/x-objectivec",{name:"clike",keywords:t(h+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:t(m),atoms:t("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":r,indent:function(e,t,n){return"statement"==t.type&&/^@\w/.test(n)?t.indented:void 0}},modeProps:{fold:"brace"}}),u("text/x-squirrel",{name:"clike",keywords:t("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:t(m),blockKeywords:t("case catch class else for foreach if switch try while"),defKeywords:t("function local class"),typeFirstDefinitions:!0,atoms:t("true false null"),hooks:{"#":r},modeProps:{fold:["brace","include"]}});var g=null;u("text/x-ceylon",{name:"clike",keywords:t("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:t("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:t("class dynamic function interface module object package value"),builtin:t("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:t("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=p(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return g&&e.match("`")?(t.tokenize=g,g=null,t.tokenize(e,t)):!1},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,n){return"variable"!=n&&"variable-3"!=n||"."!=t.prevToken?void 0:"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("clojure",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t,n){this.indent=e,this.type=t,this.prev=n}function r(e,t,r){e.indentStack=new n(t,r,e.indentStack)}function i(e){e.indentStack=e.indentStack.prev}function o(e,t){return"0"===e&&t.eat(/x/i)?(t.eatWhile(_.hex),!0):("+"!=e&&"-"!=e||!_.digit.test(t.peek())||(t.eat(_.sign),e=t.next()),_.digit.test(e)?(t.eat(e),t.eatWhile(_.digit),"."==t.peek()?(t.eat("."),t.eatWhile(_.digit)):"/"==t.peek()&&(t.eat("/"),t.eatWhile(_.digit)),t.eat(_.exponent)&&(t.eat(_.sign),t.eatWhile(_.digit)),!0):!1)}function a(e){var t=e.next();t&&t.match(/[a-z]/)&&e.match(/[a-z]+/,!0)||"u"===t&&e.match(/[0-9a-z]{4}/i,!0)}var l="builtin",s="comment",c="string",u="string-2",d="atom",f="number",p="bracket",h="keyword",m="variable",g=e.indentUnit||2,v=e.indentUnit||2,y=t("true false nil"),b=t("defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"),x=t("* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"),k=t("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),_={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+!\-\._?:<>\/\xa1-\uffff]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(e,t){if(null==t.indentStack&&e.sol()&&(t.indentation=e.indentation()),e.eatSpace())return null;var n=null;switch(t.mode){case"string":for(var w,C=!1;null!=(w=e.next());){if('"'==w&&!C){t.mode=!1;break}C=!C&&"\\"==w}n=c;break;default:var S=e.next();if('"'==S)t.mode="string",n=c;else if("\\"==S)a(e),n=u;else if("'"!=S||_.digit_or_colon.test(e.peek()))if(";"==S)e.skipToEnd(),n=s;else if(o(S,e))n=f;else if("("==S||"["==S||"{"==S){var M,L="",T=e.column();if("("==S)for(;null!=(M=e.eat(_.keyword_char));)L+=M;L.length>0&&(k.propertyIsEnumerable(L)||/^(?:def|with)/.test(L))?r(t,T+g,S):(e.eatSpace(),e.eol()||";"==e.peek()?r(t,T+v,S):r(t,T+e.current().length,S)),e.backUp(e.current().length-1),n=p}else if(")"==S||"]"==S||"}"==S)n=p,null!=t.indentStack&&t.indentStack.type==(")"==S?"(":"]"==S?"[":"{")&&i(t);else{if(":"==S)return e.eatWhile(_.symbol),d;e.eatWhile(_.symbol),n=b&&b.propertyIsEnumerable(e.current())?h:x&&x.propertyIsEnumerable(e.current())?l:y&&y.propertyIsEnumerable(e.current())?d:m}else n=d}return n},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent},closeBrackets:{pairs:'()[]{}""'},lineComment:";;"}}),e.defineMIME("text/x-clojure","clojure")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ruby",function(e){function t(e){for(var t={},n=0,r=e.length;r>n;++n)t[e[n]]=!0;return t}function n(e,t,n){return n.tokenize.push(e),e(t,n)}function r(e,t){if(e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push(s),"comment";if(e.eatSpace())return null;var r,i=e.next();if("`"==i||"'"==i||'"'==i)return n(a(i,"string",'"'==i||"`"==i),e,t);if("/"==i){var o=e.current().length;if(e.skipTo("/")){var u=e.current().length;e.backUp(e.current().length-o);for(var d=0;e.current().length<u;){var f=e.next();if("("==f?d+=1:")"==f&&(d-=1),0>d)break}if(e.backUp(e.current().length-o),0==d)return n(a(i,"string-2",!0),e,t)}return"operator"}if("%"==i){var h="string",m=!0;e.eat("s")?h="atom":e.eat(/[WQ]/)?h="string":e.eat(/[r]/)?h="string-2":e.eat(/[wxq]/)&&(h="string",m=!1);var g=e.eat(/[^\w\s=]/);return g?(p.propertyIsEnumerable(g)&&(g=p[g]),n(a(g,h,m,!0),e,t)):"operator"}if("#"==i)return e.skipToEnd(),"comment";if("<"==i&&(r=e.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return n(l(r[1]),e,t);if("0"==i)return e.eatWhile(e.eat("x")?/[\da-fA-F]/:e.eat("b")?/[01]/:/[0-7]/),"number";if(/\d/.test(i))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==i){for(;e.match(/^\\[CM]-/););return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}if(":"==i)return e.eat("'")?n(a("'","atom",!1),e,t):e.eat('"')?n(a('"',"atom",!0),e,t):e.eat(/[\<\>]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==i&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==i)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(i))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=i||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(i))return c=i,null;if("-"==i&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(i)){var v=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=i||v||(c="."),"operator"}return null}return c="|",null}function i(e){return e||(e=1),function(t,n){if("}"==t.peek()){if(1==e)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=i(e-1)}else"{"==t.peek()&&(n.tokenize[n.tokenize.length-1]=i(e+1));return r(t,n)}}function o(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,r(t,n))}}function a(e,t,n,r){return function(a,l){var s,c=!1;for("read-quoted-paused"===l.context.type&&(l.context=l.context.prev,a.eat("}"));null!=(s=a.next());){if(s==e&&(r||!c)){l.tokenize.pop();break}if(n&&"#"==s&&!c){if(a.eat("{")){"}"==e&&(l.context={prev:l.context,type:"read-quoted-paused"}),l.tokenize.push(i());break}if(/[@\$]/.test(a.peek())){l.tokenize.push(o());break}}c=!c&&"\\"==s}return t}}function l(e){return function(t,n){return t.match(e)?n.tokenize.pop():t.skipToEnd(),"string"}}function s(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var c,u=t(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),d=t(["def","class","case","for","while","until","module","then","catch","loop","proc","begin"]),f=t(["end","until"]),p={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[r],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){c=null,e.sol()&&(t.indented=e.indentation());var n,r=t.tokenize[t.tokenize.length-1](e,t),i=c;if("ident"==r){var o=e.current();r="."==t.lastTok?"property":u.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(o)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable","keyword"==r&&(i=o,d.propertyIsEnumerable(o)?n="indent":f.propertyIsEnumerable(o)?n="dedent":"if"!=o&&"unless"!=o||e.column()!=e.indentation()?"do"==o&&t.context.indented<t.indented&&(n="indent"):n="indent")}return(c||r&&"comment"!=r)&&(t.lastTok=i),"|"==c&&(t.varList=!t.varList),"indent"==n||/[\(\[\{]/.test(c)?t.context={prev:t.context,type:c||r,indented:t.indented}:("dedent"==n||/[\)\]\}]/.test(c))&&t.context.prev&&(t.context=t.context.prev),e.eol()&&(t.continuedLine="\\"==c||"operator"==r),r},indent:function(t,n){if(t.tokenize[t.tokenize.length-1]!=r)return 0;var i=n&&n.charAt(0),o=t.context,a=o.type==p[i]||"keyword"==o.type&&/^(?:end|until|else|elsif|when|rescue)\b/.test(n);return o.indented+(a?0:e.indentUnit)+(t.continuedLine?e.indentUnit:0)},electricInput:/^\s*(?:end|rescue|\})$/,lineComment:"#"}}),e.defineMIME("text/x-ruby","ruby")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e){return e.scopes[e.scopes.length-1]}var r=t(["and","or","not","is"]),i=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],o=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"],a={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]},l={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None","async","await"]};e.registerHelper("hintWords","python",i.concat(o)),e.defineMode("python",function(s,c){function u(e,t){if(e.sol()&&"py"==n(t).type){var r=n(t).offset;if(e.eatSpace()){var i=e.indentation();return i>r?p(e,t,"py"):r>i&&h(e,t)&&(t.errorToken=!0),null}var o=d(e,t);return r>0&&h(e,t)&&(o+=" "+g),o}return d(e,t)}function d(e,t){if(e.eatSpace())return null;var n=e.peek();if("#"==n)return e.skipToEnd(),"comment";if(e.match(/^[0-9\.]/,!1)){var i=!1;if(e.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),e.match(/^\d+\.\d*/)&&(i=!0),e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var o=!1;if(e.match(/^0x[0-9a-f]+/i)&&(o=!0),e.match(/^0b[01]+/i)&&(o=!0),e.match(/^0o[0-7]+/i)&&(o=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(e.eat(/J/i),o=!0),e.match(/^0(?![\dx])/i)&&(o=!0),o)return e.eat(/L/i),"number"}return e.match(M)?(t.tokenize=f(e.current()),t.tokenize(e,t)):e.match(x)||e.match(b)?"punctuation":e.match(y)||e.match(k)?"operator":e.match(v)?"punctuation":"."==t.lastToken&&e.match(_)?"property":e.match(L)||e.match(r)?"keyword":e.match(T)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(_)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),g)}function f(e){function t(t,i){for(;!t.eol();)if(t.eatWhile(/[^'"\\]/),t.eat("\\")){if(t.next(),n&&t.eol())return r}else{if(t.match(e))return i.tokenize=u,r;t.eat(/['"]/)}if(n){if(c.singleLineStringErrors)return g;i.tokenize=u}return r}for(;"rub".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";return t.isString=!0,t}function p(e,t,r){var i=0,o=null;if("py"==r)for(;"py"!=n(t).type;)t.scopes.pop();i=n(t).offset+("py"==r?s.indentUnit:w),"py"==r||e.match(/^(\s|#.*)*$/,!1)||(o=e.column()+1),t.scopes.push({offset:i,type:r,align:o})}function h(e,t){for(var r=e.indentation();n(t).offset>r;){if("py"!=n(t).type)return!0;t.scopes.pop()}return n(t).offset!=r}function m(e,t){var r=t.tokenize(e,t),i=e.current();if("@"==i)return c.version&&3==parseInt(c.version,10)?e.match(_,!1)?"meta":"operator":e.match(_,!1)?"meta":g;"variable"!=r&&"builtin"!=r||"meta"!=t.lastToken||(r="meta"),("pass"==i||"return"==i)&&(t.dedent+=1),"lambda"==i&&(t.lambda=!0),":"!=i||t.lambda||"py"!=n(t).type||p(e,t,"py");var o=1==i.length?"[({".indexOf(i):-1;if(-1!=o&&p(e,t,"])}".slice(o,o+1)),o="])}".indexOf(i),-1!=o){if(n(t).type!=i)return g;t.scopes.pop()}return t.dedent>0&&e.eol()&&"py"==n(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),r}var g="error",v=c.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.]/,y=c.doubleOperators||/^([!<>]==|<>|<<|>>|\/\/|\*\*)/,b=c.doubleDelimiters||/^(\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/,x=c.tripleDelimiters||/^(\/\/=|>>=|<<=|\*\*=)/;if(c.version&&3==parseInt(c.version,10))var k=c.singleOperators||/^[\+\-\*\/%&|\^~<>!@]/,_=c.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;else var k=c.singleOperators||/^[\+\-\*\/%&|\^~<>!]/,_=c.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/;var w=c.hangingIndent||s.indentUnit,C=i,S=o;if(void 0!=c.extra_keywords&&(C=C.concat(c.extra_keywords)),void 0!=c.extra_builtins&&(S=S.concat(c.extra_builtins)),c.version&&3==parseInt(c.version,10)){C=C.concat(l.keywords),S=S.concat(l.builtins);var M=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}else{C=C.concat(a.keywords),S=S.concat(a.builtins);var M=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var L=t(C),T=t(S),A={startState:function(e){return{tokenize:u,scopes:[{offset:e||0,type:"py",align:null}],lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=m(e,t);return r&&"comment"!=r&&(t.lastToken="keyword"==r||"punctuation"==r?e.current():r),"punctuation"==r&&(r=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+g:r},indent:function(t,r){if(t.tokenize!=u)return t.tokenize.isString?e.Pass:0;var i=n(t),o=r&&r.charAt(0)==i.type;return null!=i.align?i.align-(o?1:0):o&&t.scopes.length>1?t.scopes[t.scopes.length-2].offset:i.offset},closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"};return A}),e.defineMIME("text/x-python","python");var s=function(e){return e.split(" ")};e.defineMIME("text/x-cython",{name:"python",extra_keywords:s("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("shell",function(){function e(e,t){for(var n=t.split(" "),r=0;r<n.length;r++)i[n[r]]=e}function t(e,t){if(e.eatSpace())return null;var a=e.sol(),l=e.next();if("\\"===l)return e.next(),null;if("'"===l||'"'===l||"`"===l)return t.tokens.unshift(n(l)),r(e,t);if("#"===l)return a&&e.eat("!")?(e.skipToEnd(),"meta"):(e.skipToEnd(),"comment");if("$"===l)return t.tokens.unshift(o),r(e,t);if("+"===l||"="===l)return"operator";if("-"===l)return e.eat("-"),e.eatWhile(/\w/),"attribute";if(/\d/.test(l)&&(e.eatWhile(/\d/),e.eol()||!/\w/.test(e.peek())))return"number";e.eatWhile(/[\w-]/);var s=e.current();return"="===e.peek()&&/\w+/.test(s)?"def":i.hasOwnProperty(s)?i[s]:null}function n(e){return function(t,n){for(var r,i=!1,a=!1;null!=(r=t.next());){if(r===e&&!a){i=!0;break}if("$"===r&&!a&&"'"!==e){a=!0,t.backUp(1),n.tokens.unshift(o);break}a=!a&&"\\"===r}return(i||!a)&&n.tokens.shift(),"`"===e||")"===e?"quote":"string"}}function r(e,n){return(n.tokens[0]||t)(e,n)}var i={};e("atom","true false"),e("keyword","if then do else elif while until for in esac fi fin fil done exit set unset export function"),e("builtin","ab awk bash beep cat cc cd chown chmod chroot clear cp curl cut diff echo find gawk gcc get git grep kill killall ln ls make mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh shopt shred source sort sleep ssh start stop su sudo tee telnet top touch vi vim wall wc wget who write yes zsh");var o=function(e,t){t.tokens.length>1&&e.eat("$");var i=e.next(),o=/\w/;return"{"===i&&(o=/[^}]/),
+"("===i?(t.tokens[0]=n(")"),r(e,t)):(/\d/.test(i)||(e.eatWhile(o),e.eat("}")),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return r(e,t)},lineComment:"#",fold:"brace"}}),e.defineMIME("text/x-sh","shell")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t,i){return 0==e.length?r(t):function(o,a){for(var l=e[0],s=0;s<l.length;s++)if(o.match(l[s][0]))return a.tokenize=n(e.slice(1),t),l[s][1];return a.tokenize=r(t,i),"string"}}function r(e,t){return function(n,r){return i(n,r,e,t)}}function i(e,t,r,i){if(i!==!1&&e.match("${",!1)||e.match("{$",!1))return t.tokenize=null,"string";if(i!==!1&&e.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return e.match("[",!1)&&(t.tokenize=n([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],r,i)),e.match(/\-\>\w/,!1)&&(t.tokenize=n([[["->",null]],[[/[\w]+/,"variable"]]],r,i)),"variable-2";for(var o=!1;!e.eol()&&(o||i===!1||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!o&&e.match(r)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}o="\\"==e.next()&&!o}return"string"}var o="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",a="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",l="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[o,a,l].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var s={name:"clike",helperType:"php",keywords:t(o),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),defKeywords:t("class function interface namespace trait"),atoms:t(a),builtin:t(l),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){var n;if(n=e.match(/<<\s*/)){var i=e.eat(/['"]/);e.eatWhile(/[\w\.]/);var o=e.current().slice(n[0].length+(i?2:1));if(i&&e.eat(i),o)return(t.tokStack||(t.tokStack=[])).push(o,0),t.tokenize=r(o,"'"!=i),"string"}return!1},"#":function(e){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=r('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=r(t.tokStack[t.tokStack.length-2])),!1}}};e.defineMode("php",function(t,n){function r(t,n){var r=n.curMode==o;if(t.sol()&&n.pending&&'"'!=n.pending&&"'"!=n.pending&&(n.pending=null),r)return r&&null==n.php.tokenize&&t.match("?>")?(n.curMode=i,n.curState=n.html,n.php.context.prev||(n.php=null),"meta"):o.token(t,n.curState);if(t.match(/^<\?\w*/))return n.curMode=o,n.php||(n.php=e.startState(o,i.indent(n.html,""))),n.curState=n.php,"meta";if('"'==n.pending||"'"==n.pending){for(;!t.eol()&&t.next()!=n.pending;);var a="string"}else if(n.pending&&t.pos<n.pending.end){t.pos=n.pending.end;var a=n.pending.style}else var a=i.token(t,n.curState);n.pending&&(n.pending=null);var l,s=t.current(),c=s.search(/<\?/);return-1!=c&&(n.pending="string"==a&&(l=s.match(/[\'\"]$/))&&!/\?>/.test(s)?l[0]:{end:t.pos,style:a},t.backUp(s.length-c)),a}var i=e.getMode(t,"text/html"),o=e.getMode(t,s);return{startState:function(){var t=e.startState(i),r=n.startOpen?e.startState(o):null;return{html:t,php:r,curMode:n.startOpen?o:i,curState:n.startOpen?r:t,pending:null}},copyState:function(t){var n,r=t.html,a=e.copyState(i,r),l=t.php,s=l&&e.copyState(o,l);return n=t.curMode==i?a:s,{html:a,php:s,curMode:t.curMode,curState:n,pending:t.pending}},token:r,indent:function(e,t){return e.curMode!=o&&/^\s*<\//.test(t)||e.curMode==o&&/^\?>/.test(t)?i.indent(e.html,t):e.curMode.indent(e.curState,t)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",s)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sql",function(t,n){function r(e,t){var n=e.next();if(h[n]){var r=h[n](e,t);if(r!==!1)return r}if(1==p.hexNumber&&("0"==n&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==n||"X"==n)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(1==p.binaryNumber&&(("b"==n||"B"==n)&&e.match(/^'[01]+'/)||"0"==n&&e.match(/^b[01]+/)))return"number";if(n.charCodeAt(0)>47&&n.charCodeAt(0)<58)return e.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/),1==p.decimallessFloat&&e.eat("."),"number";if("?"==n&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==n||'"'==n&&p.doubleQuote)return t.tokenize=i(n),t.tokenize(e,t);if((1==p.nCharCast&&("n"==n||"N"==n)||1==p.charsetCast&&"_"==n&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(/^[\(\),\;\[\]]/.test(n))return null;if(p.commentSlashSlash&&"/"==n&&e.eat("/"))return e.skipToEnd(),"comment";if(p.commentHash&&"#"==n||"-"==n&&e.eat("-")&&(!p.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==n&&e.eat("*"))return t.tokenize=o,t.tokenize(e,t);if("."!=n){if(f.test(n))return e.eatWhile(f),null;if("{"==n&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var a=e.current().toLowerCase();return m.hasOwnProperty(a)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":c.hasOwnProperty(a)?"atom":u.hasOwnProperty(a)?"builtin":d.hasOwnProperty(a)?"keyword":s.hasOwnProperty(a)?"string-2":null}return 1==p.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":1==p.ODBCdotTable&&e.match(/^[a-zA-Z_]+/)?"variable-2":void 0}function i(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){n.tokenize=r;break}o=!o&&"\\"==i}return"string"}}function o(e,t){for(;;){if(!e.skipTo("*")){e.skipToEnd();break}if(e.next(),e.eat("/")){t.tokenize=r;break}}return"comment"}function a(e,t,n){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:n}}function l(e){e.indent=e.context.indent,e.context=e.context.prev}var s=n.client||{},c=n.atoms||{"false":!0,"true":!0,"null":!0},u=n.builtin||{},d=n.keywords||{},f=n.operatorChars||/^[*+\-%<>!=&|~^]/,p=n.support||{},h=n.hooks||{},m=n.dateSQL||{date:!0,time:!0,timestamp:!0};return{startState:function(){return{tokenize:r,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"==n)return n;t.context&&null==t.context.align&&(t.context.align=!0);var r=e.current();return"("==r?a(e,t,")"):"["==r?a(e,t,"]"):t.context&&t.context.type==r&&l(t),n},indent:function(n,r){var i=n.context;if(!i)return e.Pass;var o=r.charAt(0)==i.type;return i.align?i.col+(o?0:1):i.indent+(o?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:p.commentSlashSlash?"//":p.commentHash?"#":null}}),function(){function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function n(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function r(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function i(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}var o="alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit";e.defineMIME("text/x-sql",{name:"sql",keywords:i(o+"begin"),builtin:i("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare"),builtin:i("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":n}}),e.defineMIME("text/x-mysql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-mariadb",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:i("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:i("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:i("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:i("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:i("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:i("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:i("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*+\-%<>!=~]/,dateSQL:i("date time timestamp"),support:i("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:i("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),
+builtin:i("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")})}()}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("coffeescript",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e,t){if(e.sol()){null===t.scope.align&&(t.scope.align=!1);var n=t.scope.offset;if(e.eatSpace()){var r=e.indentation();return r>n&&"coffee"==t.scope.type?"indent":n>r?"dedent":null}n>0&&l(e,t)}if(e.eatSpace())return null;var a=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return t.tokenize=o,t.tokenize(e,t);if("#"===a)return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var s=!1;if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(s=!0),e.match(/^-?\d+\.\d*/)&&(s=!0),e.match(/^-?\.\d+/)&&(s=!0),s)return"."==e.peek()&&e.backUp(1),"number";var m=!1;if(e.match(/^-?0x[0-9a-f]+/i)&&(m=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(m=!0),e.match(/^-?0(?![\dx])/i)&&(m=!0),m)return"number"}if(e.match(y))return t.tokenize=i(e.current(),!1,"string"),t.tokenize(e,t);if(e.match(b)){if("/"!=e.current()||e.match(/^.*\//,!1))return t.tokenize=i(e.current(),!0,"string-2"),t.tokenize(e,t);e.backUp(1)}return e.match(u)||e.match(h)?"operator":e.match(d)?"punctuation":e.match(k)?"atom":e.match(p)||t.prop&&e.match(f)?"property":e.match(v)?"keyword":e.match(f)?"variable":(e.next(),c)}function i(e,n,i){return function(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\/\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return i}else{if(o.match(e))return a.tokenize=r,i;o.eat(/['"\/]/)}return n&&(t.singleLineStringErrors?i=c:a.tokenize=r),i}}function o(e,t){for(;!e.eol();){if(e.eatWhile(/[^#]/),e.match("###")){t.tokenize=r;break}e.eatWhile("#")}return"comment"}function a(t,n,r){r=r||"coffee";for(var i=0,o=!1,a=null,l=n.scope;l;l=l.prev)if("coffee"===l.type||"}"==l.type){i=l.offset+e.indentUnit;break}"coffee"!==r?(o=null,a=t.column()+t.current().length):n.scope.align&&(n.scope.align=!1),n.scope={offset:i,type:r,prev:n.scope,align:o,alignOffset:a}}function l(e,t){if(t.scope.prev){if("coffee"===t.scope.type){for(var n=e.indentation(),r=!1,i=t.scope;i;i=i.prev)if(n===i.offset){r=!0;break}if(!r)return!0;for(;t.scope.prev&&t.scope.offset!==n;)t.scope=t.scope.prev;return!1}return t.scope=t.scope.prev,!1}}function s(e,t){var n=t.tokenize(e,t),r=e.current();"return"===r&&(t.dedent=!0),(("->"===r||"=>"===r)&&e.eol()||"indent"===n)&&a(e,t);var i="[({".indexOf(r);if(-1!==i&&a(e,t,"])}".slice(i,i+1)),m.exec(r)&&a(e,t),"then"==r&&l(e,t),"dedent"===n&&l(e,t))return c;if(i="])}".indexOf(r),-1!==i){for(;"coffee"==t.scope.type&&t.scope.prev;)t.scope=t.scope.prev;t.scope.type==r&&(t.scope=t.scope.prev)}return t.dedent&&e.eol()&&("coffee"==t.scope.type&&t.scope.prev&&(t.scope=t.scope.prev),t.dedent=!1),n}var c="error",u=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,d=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,f=/^[_A-Za-z$][_A-Za-z$0-9]*/,p=/^@[_A-Za-z$][_A-Za-z$0-9]*/,h=n(["and","or","not","is","isnt","in","instanceof","typeof"]),m=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],g=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],v=n(m.concat(g));m=n(m);var y=/^('{3}|\"{3}|['\"])/,b=/^(\/{3}|\/)/,x=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],k=n(x),_={startState:function(e){return{tokenize:r,scope:{offset:e||0,type:"coffee",prev:null,align:!1},prop:!1,dedent:0}},token:function(e,t){var n=null===t.scope.align&&t.scope;n&&e.sol()&&(n.align=!1);var r=s(e,t);return r&&"comment"!=r&&(n&&(n.align=!0),t.prop="punctuation"==r&&"."==e.current()),r},indent:function(e,t){if(e.tokenize!=r)return 0;var n=e.scope,i=t&&"])}".indexOf(t.charAt(0))>-1;if(i)for(;"coffee"==n.type&&n.prev;)n=n.prev;var o=i&&n.type===t.charAt(0);return n.align?n.alignOffset-(o?1:0):(o?n.prev:n).offset},lineComment:"#",fold:"indent"};return _}),e.defineMIME("text/x-coffeescript","coffeescript"),e.defineMIME("text/coffeescript","coffeescript")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("yaml",function(){var e=["true","false","on","off","yes","no"],t=new RegExp("\\b(("+e.join(")|(")+"))$","i");return{token:function(e,n){var r=e.peek(),i=n.escaped;if(n.escaped=!1,"#"==r&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(n.literal&&e.indentation()>n.keyCol)return e.skipToEnd(),"string";if(n.literal&&(n.literal=!1),e.sol()){if(n.keyCol=0,n.pair=!1,n.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?n.inlinePairs++:"}"==r?n.inlinePairs--:"["==r?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!i&&","==r)return e.next(),"meta";if(n.inlinePairs>0&&!i&&","==r)return n.keyCol=0,n.pair=!1,n.pairStart=!1,e.next(),"meta";if(n.pairStart){if(e.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==n.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(n.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(t))return"keyword"}return!n.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(n.pair=!0,n.keyCol=e.indentation(),"atom"):n.pair&&e.match(/^:\s*/)?(n.pairStart=!0,"meta"):(n.pairStart=!1,n.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),e.defineMIME("text/x-yaml","yaml")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../javascript/javascript"),require("../css/css"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../javascript/javascript","../css/css","../htmlmixed/htmlmixed"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("jade",function(t){function n(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=Y.startState(),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function r(e,t){if(e.sol()&&(t.javaScriptLine=!1,t.javaScriptLineExcludesColon=!1),t.javaScriptLine){if(t.javaScriptLineExcludesColon&&":"===e.peek())return t.javaScriptLine=!1,void(t.javaScriptLineExcludesColon=!1);var n=Y.token(e,t.jsState);return e.eol()&&(t.javaScriptLine=!1),n||!0}}function i(e,t){if(t.javaScriptArguments){if(0===t.javaScriptArgumentsDepth&&"("!==e.peek())return void(t.javaScriptArguments=!1);if("("===e.peek()?t.javaScriptArgumentsDepth++:")"===e.peek()&&t.javaScriptArgumentsDepth--,0===t.javaScriptArgumentsDepth)return void(t.javaScriptArguments=!1);var n=Y.token(e,t.jsState);return n||!0}}function o(e){return e.match(/^yield\b/)?"keyword":void 0}function a(e){return e.match(/^(?:doctype) *([^\n]+)?/)?G:void 0}function l(e,t){return e.match("#{")?(t.isInterpolating=!0,t.interpolationNesting=0,"punctuation"):void 0}function s(e,t){if(t.isInterpolating){if("}"===e.peek()){if(t.interpolationNesting--,t.interpolationNesting<0)return e.next(),t.isInterpolating=!1,"punctuation"}else"{"===e.peek()&&t.interpolationNesting++;return Y.token(e,t.jsState)||!0}}function c(e,t){return e.match(/^case\b/)?(t.javaScriptLine=!0,V):void 0}function u(e,t){return e.match(/^when\b/)?(t.javaScriptLine=!0,t.javaScriptLineExcludesColon=!0,V):void 0}function d(e){return e.match(/^default\b/)?V:void 0}function f(e,t){return e.match(/^extends?\b/)?(t.restOfLine="string",V):void 0}function p(e,t){return e.match(/^append\b/)?(t.restOfLine="variable",V):void 0}function h(e,t){return e.match(/^prepend\b/)?(t.restOfLine="variable",V):void 0}function m(e,t){return e.match(/^block\b *(?:(prepend|append)\b)?/)?(t.restOfLine="variable",V):void 0}function g(e,t){return e.match(/^include\b/)?(t.restOfLine="string",V):void 0}function v(e,t){return e.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&e.match("include")?(t.isIncludeFiltered=!0,V):void 0}function y(e,t){if(t.isIncludeFiltered){var n=L(e,t);return t.isIncludeFiltered=!1,t.restOfLine="string",n}}function b(e,t){return e.match(/^mixin\b/)?(t.javaScriptLine=!0,V):void 0}function x(e,t){return e.match(/^\+([-\w]+)/)?(e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),"variable"):e.match(/^\+#{/,!1)?(e.next(),t.mixinCallAfter=!0,l(e,t)):void 0}function k(e,t){return t.mixinCallAfter?(t.mixinCallAfter=!1,e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),!0):void 0}function _(e,t){return e.match(/^(if|unless|else if|else)\b/)?(t.javaScriptLine=!0,V):void 0}function w(e,t){return e.match(/^(- *)?(each|for)\b/)?(t.isEach=!0,V):void 0}function C(e,t){if(t.isEach){if(e.match(/^ in\b/))return t.javaScriptLine=!0,t.isEach=!1,V;if(e.sol()||e.eol())t.isEach=!1;else if(e.next()){for(;!e.match(/^ in\b/,!1)&&e.next(););return"variable"}}}function S(e,t){return e.match(/^while\b/)?(t.javaScriptLine=!0,V):void 0}function M(e,t){var n;return(n=e.match(/^(\w(?:[-:\w]*\w)?)\/?/))?(t.lastTag=n[1].toLowerCase(),"script"===t.lastTag&&(t.scriptType="application/javascript"),"tag"):void 0}function L(n,r){if(n.match(/^:([\w\-]+)/)){var i;return t&&t.innerModes&&(i=t.innerModes(n.current().substring(1))),i||(i=n.current().substring(1)),"string"==typeof i&&(i=e.getMode(t,i)),W(n,r,i),"atom"}}function T(e,t){return e.match(/^(!?=|-)/)?(t.javaScriptLine=!0,"punctuation"):void 0}function A(e){return e.match(/^#([\w-]+)/)?K:void 0}function z(e){return e.match(/^\.([\w-]+)/)?Z:void 0}function E(e,t){return"("==e.peek()?(e.next(),t.isAttrs=!0,t.attrsNest=[],t.inAttributeName=!0,t.attrValue="",t.attributeIsType=!1,"punctuation"):void 0}function O(e,t){if(t.isAttrs){if(X[e.peek()]&&t.attrsNest.push(X[e.peek()]),t.attrsNest[t.attrsNest.length-1]===e.peek())t.attrsNest.pop();else if(e.eat(")"))return t.isAttrs=!1,"punctuation";if(t.inAttributeName&&e.match(/^[^=,\)!]+/))return("="===e.peek()||"!"===e.peek())&&(t.inAttributeName=!1,t.jsState=Y.startState(),t.attributeIsType="script"===t.lastTag&&"type"===e.current().trim().toLowerCase()?!0:!1),"attribute";var n=Y.token(e,t.jsState);if(t.attributeIsType&&"string"===n&&(t.scriptType=e.current().toString()),0===t.attrsNest.length&&("string"===n||"variable"===n||"keyword"===n))try{return Function("","var x "+t.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),t.inAttributeName=!0,t.attrValue="",e.backUp(e.current().length),O(e,t)}catch(r){}return t.attrValue+=e.current(),n||!0}}function q(e,t){return e.match(/^&attributes\b/)?(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0,"keyword"):void 0}function N(e){return e.sol()&&e.eatSpace()?"indent":void 0}function P(e,t){return e.match(/^ *\/\/(-)?([^\n]*)/)?(t.indentOf=e.indentation(),t.indentToken="comment","comment"):void 0}function I(e){return e.match(/^: */)?"colon":void 0}function D(e,t){return e.match(/^(?:\| ?| )([^\n]+)/)?"string":e.match(/^(<[^\n]*)/,!1)?(W(e,t,"htmlmixed"),t.innerModeForLine=!0,F(e,t,!0)):void 0}function j(e,t){if(e.eat(".")){var n=null;return"script"===t.lastTag&&-1!=t.scriptType.toLowerCase().indexOf("javascript")?n=t.scriptType.toLowerCase().replace(/"|'/g,""):"style"===t.lastTag&&(n="css"),W(e,t,n),"dot"}}function R(e){return e.next(),null}function W(n,r,i){i=e.mimeModes[i]||i,i=t.innerModes?t.innerModes(i)||i:i,i=e.mimeModes[i]||i,i=e.getMode(t,i),r.indentOf=n.indentation(),i&&"null"!==i.name?r.innerMode=i:r.indentToken="string"}function F(e,t,n){return e.indentation()>t.indentOf||t.innerModeForLine&&!e.sol()||n?t.innerMode?(t.innerState||(t.innerState=t.innerMode.startState?t.innerMode.startState(e.indentation()):{}),e.hideFirstChars(t.indentOf+2,function(){return t.innerMode.token(e,t.innerState)||!0})):(e.skipToEnd(),t.indentToken):void(e.sol()&&(t.indentOf=1/0,t.indentToken=null,t.innerMode=null,t.innerState=null))}function H(e,t){if(e.sol()&&(t.restOfLine=""),t.restOfLine){e.skipToEnd();var n=t.restOfLine;return t.restOfLine="",n}}function $(){return new n}function B(e){return e.copy()}function U(e,t){var n=F(e,t)||H(e,t)||s(e,t)||y(e,t)||C(e,t)||O(e,t)||r(e,t)||i(e,t)||k(e,t)||o(e,t)||a(e,t)||l(e,t)||c(e,t)||u(e,t)||d(e,t)||f(e,t)||p(e,t)||h(e,t)||m(e,t)||g(e,t)||v(e,t)||b(e,t)||x(e,t)||_(e,t)||w(e,t)||S(e,t)||M(e,t)||L(e,t)||T(e,t)||A(e,t)||z(e,t)||E(e,t)||q(e,t)||N(e,t)||D(e,t)||P(e,t)||I(e,t)||j(e,t)||R(e,t);return n===!0?null:n}var V="keyword",G="meta",K="builtin",Z="qualifier",X={"{":"}","(":")","[":"]"},Y=e.getMode(t,"javascript");return n.prototype.copy=function(){var t=new n;return t.javaScriptLine=this.javaScriptLine,t.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,t.javaScriptArguments=this.javaScriptArguments,t.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,t.isInterpolating=this.isInterpolating,t.interpolationNesting=this.interpolationNesting,t.jsState=e.copyState(Y,this.jsState),t.innerMode=this.innerMode,this.innerMode&&this.innerState&&(t.innerState=e.copyState(this.innerMode,this.innerState)),t.restOfLine=this.restOfLine,t.isIncludeFiltered=this.isIncludeFiltered,t.isEach=this.isEach,t.lastTag=this.lastTag,t.scriptType=this.scriptType,t.isAttrs=this.isAttrs,t.attrsNest=this.attrsNest.slice(),t.inAttributeName=this.inAttributeName,t.attributeIsType=this.attributeIsType,t.attrValue=this.attrValue,t.indentOf=this.indentOf,t.indentToken=this.indentToken,t.innerModeForLine=this.innerModeForLine,t},{startState:$,copyState:B,token:U}},"javascript","css","htmlmixed"),e.defineMIME("text/x-jade","jade")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("lua",function(e,t){function n(e){return new RegExp("^(?:"+e.join("|")+")","i")}function r(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function i(e){for(var t=0;e.eat("=");)++t;return e.eat("["),t}function o(e,t){var n=e.next();return"-"==n&&e.eat("-")?e.eat("[")&&e.eat("[")?(t.cur=a(i(e),"comment"))(e,t):(e.skipToEnd(),"comment"):'"'==n||"'"==n?(t.cur=l(n))(e,t):"["==n&&/[\[=]/.test(e.peek())?(t.cur=a(i(e),"string"))(e,t):/\d/.test(n)?(e.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(n)?(e.eatWhile(/[\w\\\-_.]/),"variable"):null}function a(e,t){return function(n,r){for(var i,a=null;null!=(i=n.next());)if(null==a)"]"==i&&(a=0);else if("="==i)++a;else{if("]"==i&&a==e){r.cur=o;break}a=null}return t}}function l(e){return function(t,n){for(var r,i=!1;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.cur=o),"string"}}var s=e.indentUnit,c=r(t.specials||[]),u=r(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),d=r(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),f=r(["function","if","repeat","do","\\(","{"]),p=r(["end","until","\\)","}"]),h=n(["end","until","\\)","}","else","elseif"]);return{startState:function(e){return{basecol:e||0,indentDepth:0,cur:o}},token:function(e,t){if(e.eatSpace())return null;var n=t.cur(e,t),r=e.current();return"variable"==n&&(d.test(r)?n="keyword":u.test(r)?n="builtin":c.test(r)&&(n="variable-2")),"comment"!=n&&"string"!=n&&(f.test(r)?++t.indentDepth:p.test(r)&&--t.indentDepth),n},indent:function(e,t){var n=h.test(t);return e.basecol+s*(e.indentDepth-(n?1:0))},lineComment:"--",blockCommentStart:"--[[",blockCommentEnd:"]]"}}),e.defineMIME("text/x-lua","lua")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("cmake",function(){function e(e,t){for(var n,r,i=!1;!e.eol()&&(n=e.next())!=t.pending;){if("$"===n&&"\\"!=r&&'"'==t.pending){i=!0;break}r=n}return i&&e.backUp(1),t.continueString=n==t.pending?!1:!0,"string"}function t(t,r){var i=t.next();return"$"===i?t.match(n)?"variable-2":"variable":r.continueString?(t.backUp(1),e(t,r)):t.match(/(\s+)?\w+\(/)||t.match(/(\s+)?\w+\ \(/)?(t.backUp(1),"def"):"#"==i?(t.skipToEnd(),"comment"):"'"==i||'"'==i?(r.pending=i,e(t,r)):"("==i||")"==i?"bracket":i.match(/[0-9]/)?"number":(t.eatWhile(/[\w-]/),null)}var n=/({)?[a-zA-Z0-9_]+(})?/;return{startState:function(){var e={};return e.inDefinition=!1,e.inInclude=!1,e.continueString=!1,e.pending=!1,e},token:function(e,n){return e.eatSpace()?null:t(e,n)}}}),e.defineMIME("text/x-cmake","cmake")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("nginx",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){return l=t,e}function r(e,t){e.eatWhile(/[\w\$_]/);var r=e.current();if(s.propertyIsEnumerable(r))return"keyword";if(c.propertyIsEnumerable(r))return"variable-2";if(u.propertyIsEnumerable(r))return"string-2";var l=e.next();return"@"==l?(e.eatWhile(/[\w\\\-]/),n("meta",e.current())):"/"==l&&e.eat("*")?(t.tokenize=i,i(e,t)):"<"==l&&e.eat("!")?(t.tokenize=o,o(e,t)):"="!=l?"~"!=l&&"|"!=l||!e.eat("=")?'"'==l||"'"==l?(t.tokenize=a(l),t.tokenize(e,t)):"#"==l?(e.skipToEnd(),n("comment","comment")):"!"==l?(e.match(/^\s*\w*/),n("keyword","important")):/\d/.test(l)?(e.eatWhile(/[\w.%]/),n("number","unit")):/[,.+>*\/]/.test(l)?n(null,"select-op"):/[;{}:\[\]]/.test(l)?n(null,l):(e.eatWhile(/[\w\\\-]/),n("variable","variable")):n(null,"compare"):void n(null,"compare")}function i(e,t){for(var i,o=!1;null!=(i=e.next());){if(o&&"/"==i){t.tokenize=r;break}o="*"==i}return n("comment","comment")}function o(e,t){for(var i,o=0;null!=(i=e.next());){if(o>=2&&">"==i){t.tokenize=r;break}o="-"==i?o+1:0}return n("comment","comment")}function a(e){return function(t,i){for(var o,a=!1;null!=(o=t.next())&&(o!=e||a);)a=!a&&"\\"==o;return a||(i.tokenize=r),n("string","string")}}var l,s=t("break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"),c=t("http mail events server types location upstream charset_map limit_except if geo map"),u=t("include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"),d=e.indentUnit;return{startState:function(e){return{tokenize:r,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;l=null;var n=t.tokenize(e,t),r=t.stack[t.stack.length-1];return"hash"==l&&"rule"==r?n="atom":"variable"==n&&("rule"==r?n="number":r&&"@media{"!=r||(n="tag")),"rule"==r&&/^[\{\};]$/.test(l)&&t.stack.pop(),"{"==l?"@media"==r?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):"}"==l?t.stack.pop():"@media"==l?t.stack.push("@media"):"{"==r&&"comment"!=l&&t.stack.push("rule"),n},indent:function(e,t){var n=e.stack.length;return/^\}/.test(t)&&(n-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+n*d},electricChars:"}"}}),e.defineMIME("text/x-nginx-conf","nginx")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.string.charAt(e.pos+(t||0))}function n(e,t){if(t){var n=e.pos-t;return e.string.substr(n>=0?n:0,t)}return e.string.substr(0,e.pos-1)}function r(e,t){var n=e.string.length,r=n-e.pos+1;return e.string.substr(e.pos,t&&n>t?t:r)}function i(e,t){var n,r=e.pos+t;e.pos=0>=r?0:r>=(n=e.string.length-1)?n:r}e.defineMode("perl",function(){function e(e,t,n,r,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){for(var o,l=!1,s=0;o=e.next();){if(o===n[s]&&!l)return void 0!==n[++s]?(t.chain=n[s],t.style=r,t.tail=i):i&&e.eatWhile(i),t.tokenize=a,r;l=!l&&"\\"==o}return r},t.tokenize(e,t)}function o(e,t,n){return t.tokenize=function(e,t){return e.string==n&&(t.tokenize=a),e.skipToEnd(),"string"},t.tokenize(e,t)}function a(a,u){if(a.eatSpace())return null;if(u.chain)return e(a,u,u.chain,u.style,u.tail);if(a.match(/^\-?[\d\.]/,!1)&&a.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(a.match(/^<<(?=\w)/))return a.eatWhile(/\w/),o(a,u,a.current().substr(2));if(a.sol()&&a.match(/^\=item(?!\w)/))return o(a,u,"=cut");var d=a.next();if('"'==d||"'"==d){if(n(a,3)=="<<"+d){var f=a.pos;a.eatWhile(/\w/);var p=a.current().substr(1);if(p&&a.eat(d))return o(a,u,p);a.pos=f}return e(a,u,[d],"string")}if("q"==d){var h=t(a,-2);if(!h||!/\w/.test(h))if(h=t(a,0),"x"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],s,c);if("["==h)return i(a,2),e(a,u,["]"],s,c);if("{"==h)return i(a,2),e(a,u,["}"],s,c);if("<"==h)return i(a,2),e(a,u,[">"],s,c);if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],s,c)}else if("q"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],"string");if("["==h)return i(a,2),e(a,u,["]"],"string");if("{"==h)return i(a,2),e(a,u,["}"],"string");if("<"==h)return i(a,2),e(a,u,[">"],"string");if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],"string")}else if("w"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],"bracket");if("["==h)return i(a,2),e(a,u,["]"],"bracket");if("{"==h)return i(a,2),e(a,u,["}"],"bracket");if("<"==h)return i(a,2),e(a,u,[">"],"bracket");if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],"bracket")}else if("r"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],s,c);if("["==h)return i(a,2),e(a,u,["]"],s,c);if("{"==h)return i(a,2),e(a,u,["}"],s,c);if("<"==h)return i(a,2),e(a,u,[">"],s,c);if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],s,c)}else if(/[\^'"!~\/(\[{<]/.test(h)){if("("==h)return i(a,1),e(a,u,[")"],"string");if("["==h)return i(a,1),e(a,u,["]"],"string");if("{"==h)return i(a,1),e(a,u,["}"],"string");if("<"==h)return i(a,1),e(a,u,[">"],"string");if(/[\^'"!~\/]/.test(h))return e(a,u,[a.eat(h)],"string")}}if("m"==d){var h=t(a,-2);if((!h||!/\w/.test(h))&&(h=a.eat(/[(\[{<\^'"!~\/]/))){if(/[\^'"!~\/]/.test(h))return e(a,u,[h],s,c);if("("==h)return e(a,u,[")"],s,c);if("["==h)return e(a,u,["]"],s,c);if("{"==h)return e(a,u,["}"],s,c);if("<"==h)return e(a,u,[">"],s,c)}}if("s"==d){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat(/[(\[{<\^'"!~\/]/)))return"["==h?e(a,u,["]","]"],s,c):"{"==h?e(a,u,["}","}"],s,c):"<"==h?e(a,u,[">",">"],s,c):"("==h?e(a,u,[")",")"],s,c):e(a,u,[h,h],s,c)}if("y"==d){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat(/[(\[{<\^'"!~\/]/)))return"["==h?e(a,u,["]","]"],s,c):"{"==h?e(a,u,["}","}"],s,c):"<"==h?e(a,u,[">",">"],s,c):"("==h?e(a,u,[")",")"],s,c):e(a,u,[h,h],s,c)}if("t"==d){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat("r"),h&&(h=a.eat(/[(\[{<\^'"!~\/]/))))return"["==h?e(a,u,["]","]"],s,c):"{"==h?e(a,u,["}","}"],s,c):"<"==h?e(a,u,[">",">"],s,c):"("==h?e(a,u,[")",")"],s,c):e(a,u,[h,h],s,c)}if("`"==d)return e(a,u,[d],"variable-2");if("/"==d)return/~\s*$/.test(n(a))?e(a,u,[d],s,c):"operator";if("$"==d){var f=a.pos;if(a.eatWhile(/\d/)||a.eat("{")&&a.eatWhile(/\d/)&&a.eat("}"))return"variable-2";a.pos=f}if(/[$@%]/.test(d)){var f=a.pos;if(a.eat("^")&&a.eat(/[A-Z]/)||!/[@$%&]/.test(t(a,-2))&&a.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var h=a.current();if(l[h])return"variable-2"}a.pos=f}if(/[$@%&]/.test(d)&&(a.eatWhile(/[\w$\[\]]/)||a.eat("{")&&a.eatWhile(/[\w$\[\]]/)&&a.eat("}"))){var h=a.current();return l[h]?"variable-2":"variable"}if("#"==d&&"$"!=t(a,-2))return a.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(d)){var f=a.pos;if(a.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),l[a.current()])return"operator";a.pos=f}if("_"==d&&1==a.pos){if("_END__"==r(a,6))return e(a,u,["\x00"],"comment");if("_DATA__"==r(a,7))return e(a,u,["\x00"],"variable-2");if("_C__"==r(a,7))return e(a,u,["\x00"],"string")}if(/\w/.test(d)){var f=a.pos;if("{"==t(a,-2)&&("}"==t(a,0)||a.eatWhile(/\w/)&&"}"==t(a,0)))return"string";a.pos=f}if(/[A-Z]/.test(d)){var m=t(a,-2),f=a.pos;if(a.eatWhile(/[A-Z_]/),!/[\da-z]/.test(t(a,0))){var h=l[a.current()];return h?(h[1]&&(h=h[0]),":"!=m?1==h?"keyword":2==h?"def":3==h?"atom":4==h?"operator":5==h?"variable-2":"meta":"meta"):"meta"}a.pos=f}if(/[a-zA-Z_]/.test(d)){var m=t(a,-2);a.eatWhile(/\w/);var h=l[a.current()];return h?(h[1]&&(h=h[0]),":"!=m?1==h?"keyword":2==h?"def":3==h?"atom":4==h?"operator":5==h?"variable-2":"meta":"meta"):"meta"}return null}var l={"->":4,"++":4,"--":4,
+"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},s="string-2",c=/[goseximacplud]/;return{startState:function(){return{tokenize:a,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||a)(e,t)},lineComment:"#"}}),e.registerHelper("wordChars","perl",/[\w$]/),e.defineMIME("text/x-perl","perl")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sass",function(e){function t(e){return new RegExp("^"+e.join("|"))}function n(e,t){var n=e.peek();return")"===n?(e.next(),t.tokenizer=s,"operator"):"("===n?(e.next(),e.eatSpace(),"operator"):"'"===n||'"'===n?(t.tokenizer=i(e.next()),"string"):(t.tokenizer=i(")",!1),"string")}function r(e,t){return function(n,r){return n.sol()&&n.indentation()<=e?(r.tokenizer=s,s(n,r)):(t&&n.skipTo("*/")?(n.next(),n.next(),r.tokenizer=s):n.skipToEnd(),"comment")}}function i(e,t){function n(r,i){var a=r.next(),l=r.peek(),c=r.string.charAt(r.pos-2),u="\\"!==a&&l===e||a===e&&"\\"!==c;return u?(a!==e&&t&&r.next(),i.tokenizer=s,"string"):"#"===a&&"{"===l?(i.tokenizer=o(n),r.next(),"operator"):"string"}return null==t&&(t=!0),n}function o(e){return function(t,n){return"}"===t.peek()?(t.next(),n.tokenizer=e,"operator"):s(t,n)}}function a(t){if(0==t.indentCount){t.indentCount++;var n=t.scopes[0].offset,r=n+e.indentUnit;t.scopes.unshift({offset:r})}}function l(e){1!=e.scopes.length&&e.scopes.shift()}function s(e,t){var c=e.peek();if(e.match("/*"))return t.tokenizer=r(e.indentation(),!0),t.tokenizer(e,t);if(e.match("//"))return t.tokenizer=r(e.indentation(),!1),t.tokenizer(e,t);if(e.match("#{"))return t.tokenizer=o(s),"operator";if('"'===c||"'"===c)return e.next(),t.tokenizer=i(c),"string";if(t.cursorHalf){if("#"===c&&(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^-?[0-9\.]+/))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^(px|em|in)\b/))return e.peek()||(t.cursorHalf=0),"unit";if(e.match(d))return e.peek()||(t.cursorHalf=0),"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=n,e.peek()||(t.cursorHalf=0),"atom";if("$"===c)return e.next(),e.eatWhile(/[\w-]/),e.peek()||(t.cursorHalf=0),"variable-3";if("!"===c)return e.next(),e.peek()||(t.cursorHalf=0),e.match(/^[\w]+/)?"keyword":"operator";if(e.match(p))return e.peek()||(t.cursorHalf=0),"operator";if(e.eatWhile(/[\w-]/))return e.peek()||(t.cursorHalf=0),"attribute";if(!e.peek())return t.cursorHalf=0,null}else{if("."===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("#"===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("$"===c)return e.next(),e.eatWhile(/[\w-]/),"variable-2";if(e.match(/^-?[0-9\.]+/))return"number";if(e.match(/^(px|em|in)\b/))return"unit";if(e.match(d))return"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=n,"atom";if("="===c&&e.match(/^=[\w-]+/))return a(t),"meta";if("+"===c&&e.match(/^\+[\w-]+/))return"variable-3";if("@"===c&&e.match(/@extend/)&&(e.match(/\s*[\w]/)||l(t)),e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return a(t),"meta";if("@"===c)return e.next(),e.eatWhile(/[\w-]/),"meta";if(e.eatWhile(/[\w-]/))return e.match(/ *: *[\w-\+\$#!\("']/,!1)?"property":e.match(/ *:/,!1)?(a(t),t.cursorHalf=1,"atom"):e.match(/ *,/,!1)?"atom":(a(t),"atom");if(":"===c)return e.match(h)?"keyword":(e.next(),t.cursorHalf=1,"operator")}return e.match(p)?"operator":(e.next(),null)}function c(t,n){t.sol()&&(n.indentCount=0);var r=n.tokenizer(t,n),i=t.current();if(("@return"===i||"}"===i)&&l(n),null!==r){for(var o=t.pos-i.length,a=o+e.indentUnit*n.indentCount,s=[],c=0;c<n.scopes.length;c++){var u=n.scopes[c];u.offset<=a&&s.push(u)}n.scopes=s}return r}var u=["true","false","null","auto"],d=new RegExp("^"+u.join("|")),f=["\\(","\\)","=",">","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],p=t(f),h=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:s,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,t){var n=c(e,t);return t.lastToken={style:n,content:e.current()},n},indent:function(e){return e.scopes[0].offset}}}),e.defineMIME("text/x-sass","sass")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("r",function(e){function t(e){for(var t=e.split(" "),n={},r=0;r<t.length;++r)n[t[r]]=!0;return n}function n(e,t){a=null;var n=e.next();if("#"==n)return e.skipToEnd(),"comment";if("0"==n&&e.eat("x"))return e.eatWhile(/[\da-f]/i),"number";if("."==n&&e.eat(/\d/))return e.match(/\d*(?:e[+\-]?\d+)?/),"number";if(/\d/.test(n))return e.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/),"number";if("'"==n||'"'==n)return t.tokenize=r(n),"string";if("."==n&&e.match(/.[.\d]+/))return"keyword";if(/[\w\.]/.test(n)&&"_"!=n){e.eatWhile(/[\w\.]/);var i=e.current();return l.propertyIsEnumerable(i)?"atom":c.propertyIsEnumerable(i)?(u.propertyIsEnumerable(i)&&!e.match(/\s*if(\s+|$)/,!1)&&(a="block"),"keyword"):s.propertyIsEnumerable(i)?"builtin":"variable"}return"%"==n?(e.skipTo("%")&&e.next(),"variable-2"):"<"==n&&e.eat("-")?"arrow":"="==n&&t.ctx.argList?"arg-is":d.test(n)?"$"==n?"dollar":(e.eatWhile(d),"operator"):/[\(\){}\[\];]/.test(n)?(a=n,";"==n?"semi":null):null}function r(e){return function(t,r){if(t.eat("\\")){var i=t.next();return"x"==i?t.match(/^[a-f0-9]{2}/i):("u"==i||"U"==i)&&t.eat("{")&&t.skipTo("}")?t.next():"u"==i?t.match(/^[a-f0-9]{4}/i):"U"==i?t.match(/^[a-f0-9]{8}/i):/[0-7]/.test(i)&&t.match(/^[0-7]{1,2}/),"string-2"}for(var o;null!=(o=t.next());){if(o==e){r.tokenize=n;break}if("\\"==o){t.backUp(1);break}}return"string"}}function i(e,t,n){e.ctx={type:t,indent:e.indent,align:null,column:n.column(),prev:e.ctx}}function o(e){e.indent=e.ctx.indent,e.ctx=e.ctx.prev}var a,l=t("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"),s=t("list quote bquote eval return call parse deparse"),c=t("if else repeat while function for in next break"),u=t("if else repeat while function for"),d=/[+\-*\/^<>=!&|~$:]/;return{startState:function(){return{tokenize:n,ctx:{type:"top",indent:-e.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(e,t){if(e.sol()&&(null==t.ctx.align&&(t.ctx.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);"comment"!=n&&null==t.ctx.align&&(t.ctx.align=!0);var r=t.ctx.type;return";"!=a&&"{"!=a&&"}"!=a||"block"!=r||o(t),"{"==a?i(t,"}",e):"("==a?(i(t,")",e),t.afterIdent&&(t.ctx.argList=!0)):"["==a?i(t,"]",e):"block"==a?i(t,"block",e):a==r&&o(t),t.afterIdent="variable"==n||"keyword"==n,n},indent:function(t,r){if(t.tokenize!=n)return 0;var i=r&&r.charAt(0),o=t.ctx,a=i==o.type;return"block"==o.type?o.indent+("{"==i?0:e.indentUnit):o.align?o.column+(a?0:1):o.indent+(a?0:e.indentUnit)},lineComment:"#"}}),e.defineMIME("text/x-rsrc","r")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../addon/mode/simple")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple"],e):e(CodeMirror)}(function(e){"use strict";var t=["from","maintainer","run","cmd","expose","env","add","copy","entrypoint","volume","user","workdir","onbuild"],n="("+t.join("|")+")",r=new RegExp(n+"\\s*$","i"),i=new RegExp(n+"(\\s+)","i");e.defineSimpleMode("dockerfile",{start:[{regex:/#.*$/,token:"comment"},{regex:r,token:"variable-2"},{regex:i,token:["variable-2",null],next:"arguments"},{regex:/./,token:null}],arguments:[{regex:/#.*$/,token:"error",next:"start"},{regex:/[^#]+\\$/,token:null},{regex:/[^#]+/,token:null,next:"start"},{regex:/$/,token:null,next:"start"},{token:null,next:"start"}],meta:{lineComment:"#"}}),e.defineMIME("text/x-dockerfile","dockerfile")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n,r){if(0>r&&0==n.ch)return t.clipPos(f(n.line-1));var i=t.getLine(n.line);if(r>0&&n.ch>=i.length)return t.clipPos(f(n.line+1,0));for(var o,a="start",l=n.ch,s=0>r?0:i.length,c=0;l!=s;l+=r,c++){var u=i.charAt(0>r?l-1:l),d="_"!=u&&e.isWordChar(u)?"w":"o";if("w"==d&&u.toUpperCase()==u&&(d="W"),"start"==a)"o"!=d&&(a="in",o=d);else if("in"==a&&o!=d){if("w"==o&&"W"==d&&0>r&&l--,"W"==o&&"w"==d&&r>0){o="w";continue}break}}return f(n.line,l)}function n(e,n){e.extendSelectionsBy(function(r){return e.display.shift||e.doc.extend||r.empty()?t(e.doc,r.head,n):0>n?r.from():r.to()})}function r(t,n){return t.isReadOnly()?e.Pass:void t.operation(function(){for(var e=t.listSelections().length,r=[],i=-1,o=0;e>o;o++){var a=t.listSelections()[o].head;if(!(a.line<=i)){var l=f(a.line+(n?0:1),0);t.replaceRange("\n",l,null,"+insertLine"),t.indentLine(l.line,null,!0),r.push({head:l,anchor:l}),i=a.line+1}}t.setSelections(r)})}function i(t,n){for(var r=n.ch,i=r,o=t.getLine(n.line);r&&e.isWordChar(o.charAt(r-1));)--r;for(;i<o.length&&e.isWordChar(o.charAt(i));)++i;return{from:f(n.line,r),to:f(n.line,i),word:o.slice(r,i)}}function o(e){var t=e.getCursor(),n=e.scanForBracket(t,-1);if(n)for(;;){var r=e.scanForBracket(t,1);if(!r)return;if(r.ch==g.charAt(g.indexOf(n.ch)+1))return e.setSelection(f(n.pos.line,n.pos.ch+1),r.pos,!1),!0;t=f(r.pos.line,r.pos.ch+1)}}function a(t,n){if(t.isReadOnly())return e.Pass;for(var r,i=t.listSelections(),o=[],a=0;a<i.length;a++){var l=i[a];if(!l.empty()){for(var s=l.from().line,c=l.to().line;a<i.length-1&&i[a+1].from().line==c;)c=l[++a].to().line;o.push(s,c)}}o.length?r=!0:o.push(t.firstLine(),t.lastLine()),t.operation(function(){for(var e=[],i=0;i<o.length;i+=2){var a=o[i],l=o[i+1],s=f(a,0),c=f(l),u=t.getRange(s,c,!1);n?u.sort():u.sort(function(e,t){var n=e.toUpperCase(),r=t.toUpperCase();return n!=r&&(e=n,t=r),t>e?-1:e==t?0:1}),t.replaceRange(u,s,c),r&&e.push({anchor:s,head:c})}r&&t.setSelections(e,0)})}function l(t,n){t.operation(function(){for(var r=t.listSelections(),o=[],a=[],l=0;l<r.length;l++){var s=r[l];s.empty()?(o.push(l),a.push("")):a.push(n(t.getRange(s.from(),s.to())))}t.replaceSelections(a,"around","case");for(var c,l=o.length-1;l>=0;l--){var s=r[o[l]];if(!(c&&e.cmpPos(s.head,c)>0)){var u=i(t,s.head);c=u.from,t.replaceRange(n(u.word),u.from,u.to)}}})}function s(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var o=i(t,n);if(!o.word)return;n=o.from,r=o.to}return{from:n,to:r,query:t.getRange(n,r),word:o}}function c(e,t){var n=s(e);if(n){var r=n.query,i=e.getSearchCursor(r,t?n.to:n.from);(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):(i=e.getSearchCursor(r,t?f(e.firstLine(),0):e.clipPos(f(e.lastLine()))),(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):n.word&&e.setSelection(n.from,n.to))}}var u=e.keyMap.sublime={fallthrough:"default"},d=e.commands,f=e.Pos,p=e.keyMap["default"]==e.keyMap.macDefault,h=p?"Cmd-":"Ctrl-";d[u["Alt-Left"]="goSubwordLeft"]=function(e){n(e,-1)},d[u["Alt-Right"]="goSubwordRight"]=function(e){n(e,1)};var m=p?"Ctrl-Alt-":"Ctrl-";d[u[m+"Up"]="scrollLineUp"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},d[u[m+"Down"]="scrollLineDown"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},d[u["Shift-"+h+"L"]="splitSelectionByLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)for(var i=t[r].from(),o=t[r].to(),a=i.line;a<=o.line;++a)o.line>i.line&&a==o.line&&0==o.ch||n.push({anchor:a==i.line?i:f(a,0),head:a==o.line?o:f(a)});e.setSelections(n,0)},u["Shift-Tab"]="indentLess",d[u.Esc="singleSelectionTop"]=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},d[u[h+"L"]="selectLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var i=t[r];n.push({anchor:f(i.from().line,0),head:f(i.to().line+1,0)})}e.setSelections(n)},u["Shift-"+h+"K"]="deleteLine",d[u[h+"Enter"]="insertLineAfter"]=function(e){return r(e,!1)},d[u["Shift-"+h+"Enter"]="insertLineBefore"]=function(e){return r(e,!0)},d[u[h+"D"]="selectNextOccurrence"]=function(t){var n=t.getCursor("from"),r=t.getCursor("to"),o=t.state.sublimeFindFullWord==t.doc.sel;if(0==e.cmpPos(n,r)){var a=i(t,n);if(!a.word)return;t.setSelection(a.from,a.to),o=!0}else{var l=t.getRange(n,r),s=o?new RegExp("\\b"+l+"\\b"):l,c=t.getSearchCursor(s,r);c.findNext()?t.addSelection(c.from(),c.to()):(c=t.getSearchCursor(s,f(t.firstLine(),0)),c.findNext()&&t.addSelection(c.from(),c.to()))}o&&(t.state.sublimeFindFullWord=t.doc.sel)};var g="(){}[]";d[u["Shift-"+h+"Space"]="selectScope"]=function(e){o(e)||e.execCommand("selectAll")},d[u["Shift-"+h+"M"]="selectBetweenBrackets"]=function(t){return o(t)?void 0:e.Pass},d[u[h+"M"]="goToBracket"]=function(t){t.extendSelectionsBy(function(n){var r=t.scanForBracket(n.head,1);if(r&&0!=e.cmpPos(r.pos,n.head))return r.pos;var i=t.scanForBracket(n.head,-1);return i&&f(i.pos.line,i.pos.ch+1)||n.head})};var v=p?"Cmd-Ctrl-":"Shift-Ctrl-";d[u[v+"Up"]="swapLineUp"]=function(t){if(t.isReadOnly())return e.Pass;for(var n=t.listSelections(),r=[],i=t.firstLine()-1,o=[],a=0;a<n.length;a++){var l=n[a],s=l.from().line-1,c=l.to().line;o.push({anchor:f(l.anchor.line-1,l.anchor.ch),head:f(l.head.line-1,l.head.ch)}),0!=l.to().ch||l.empty()||--c,s>i?r.push(s,c):r.length&&(r[r.length-1]=c),i=c}t.operation(function(){for(var e=0;e<r.length;e+=2){var n=r[e],i=r[e+1],a=t.getLine(n);t.replaceRange("",f(n,0),f(n+1,0),"+swapLine"),i>t.lastLine()?t.replaceRange("\n"+a,f(t.lastLine()),null,"+swapLine"):t.replaceRange(a+"\n",f(i,0),null,"+swapLine")}t.setSelections(o),t.scrollIntoView()})},d[u[v+"Down"]="swapLineDown"]=function(t){if(t.isReadOnly())return e.Pass;for(var n=t.listSelections(),r=[],i=t.lastLine()+1,o=n.length-1;o>=0;o--){var a=n[o],l=a.to().line+1,s=a.from().line;0!=a.to().ch||a.empty()||l--,i>l?r.push(l,s):r.length&&(r[r.length-1]=s),i=s}t.operation(function(){for(var e=r.length-2;e>=0;e-=2){var n=r[e],i=r[e+1],o=t.getLine(n);n==t.lastLine()?t.replaceRange("",f(n-1),f(n),"+swapLine"):t.replaceRange("",f(n,0),f(n+1,0),"+swapLine"),t.replaceRange(o+"\n",f(i,0),null,"+swapLine")}t.scrollIntoView()})},d[u[h+"/"]="toggleCommentIndented"]=function(e){e.toggleComment({indent:!0})},d[u[h+"J"]="joinLines"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){for(var i=t[r],o=i.from(),a=o.line,l=i.to().line;r<t.length-1&&t[r+1].from().line==l;)l=t[++r].to().line;n.push({start:a,end:l,anchor:!i.empty()&&o})}e.operation(function(){for(var t=0,r=[],i=0;i<n.length;i++){for(var o,a=n[i],l=a.anchor&&f(a.anchor.line-t,a.anchor.ch),s=a.start;s<=a.end;s++){var c=s-t;s==a.end&&(o=f(c,e.getLine(c).length+1)),c<e.lastLine()&&(e.replaceRange(" ",f(c),f(c+1,/^\s*/.exec(e.getLine(c+1))[0].length)),++t)}r.push({anchor:l||o,head:o})}e.setSelections(r,0)})},d[u["Shift-"+h+"D"]="duplicateLine"]=function(e){e.operation(function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];r.empty()?e.replaceRange(e.getLine(r.head.line)+"\n",f(r.head.line,0)):e.replaceRange(e.getRange(r.from(),r.to()),r.from())}e.scrollIntoView()})},u[h+"T"]="transposeChars",d[u.F9="sortLines"]=function(e){a(e,!0)},d[u[h+"F9"]="sortLinesInsensitive"]=function(e){a(e,!1)},d[u.F2="nextBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),r=n.find();if(r)return t.push(n),e.setSelection(r.from,r.to)}},d[u["Shift-F2"]="prevBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(n)return e.setSelection(n.from,n.to);t.pop()}},d[u[h+"F2"]="toggleBookmark"]=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r<t.length;r++){for(var i=t[r].from(),o=t[r].to(),a=e.findMarks(i,o),l=0;l<a.length;l++)if(a[l].sublimeBookmark){a[l].clear();for(var s=0;s<n.length;s++)n[s]==a[l]&&n.splice(s--,1);break}l==a.length&&n.push(e.markText(i,o,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},d[u["Shift-"+h+"F2"]="clearBookmarks"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();t.length=0},d[u["Alt-F2"]="selectBookmarks"]=function(e){var t=e.state.sublimeBookmarks,n=[];if(t)for(var r=0;r<t.length;r++){var i=t[r].find();i?n.push({anchor:i.from,head:i.to}):t.splice(r--,0)}n.length&&e.setSelections(n,0)},u["Alt-Q"]="wrapLines";var y=h+"K ";u[y+h+"Backspace"]="delLineLeft",d[u.Backspace="smartBackspace"]=function(t){if(t.somethingSelected())return e.Pass;var n=t.getCursor(),r=t.getRange({line:n.line,ch:0},n),i=e.countColumn(r,null,t.getOption("tabSize")),o=t.getOption("indentUnit");if(r&&!/\S/.test(r)&&i%o==0){var a=new f(n.line,e.findColumn(r,i-o,o));return a.ch==n.ch?e.Pass:t.replaceRange("",a,n,"+delete")}return e.Pass},d[u[y+h+"K"]="delLineRight"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange("",t[n].anchor,f(t[n].to().line),"+delete");e.scrollIntoView()})},d[u[y+h+"U"]="upcaseAtCursor"]=function(e){l(e,function(e){return e.toUpperCase()})},d[u[y+h+"L"]="downcaseAtCursor"]=function(e){l(e,function(e){return e.toLowerCase()})},d[u[y+h+"Space"]="setSublimeMark"]=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},d[u[y+h+"A"]="selectToSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},d[u[y+h+"W"]="deleteToSublimeMark"]=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),i=n;if(e.cmpPos(r,i)>0){var o=i;i=r,r=o}t.state.sublimeKilled=t.getRange(r,i),t.replaceRange("",r,i)}},d[u[y+h+"X"]="swapWithSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},d[u[y+h+"Y"]="sublimeYank"]=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},u[y+h+"G"]="clearBookmarks",d[u[y+h+"C"]="showInCenter"]=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},d[u["Shift-Alt-Up"]="selectLinesUpward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n<t.length;n++){var r=t[n];r.head.line>e.firstLine()&&e.addSelection(f(r.head.line-1,r.head.ch))}})},d[u["Shift-Alt-Down"]="selectLinesDownward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n<t.length;n++){var r=t[n];r.head.line<e.lastLine()&&e.addSelection(f(r.head.line+1,r.head.ch))}})},d[u[h+"F3"]="findUnder"]=function(e){c(e,!0)},d[u["Shift-"+h+"F3"]="findUnderPrevious"]=function(e){c(e,!1)},d[u["Alt-F3"]="findAllUnder"]=function(e){var t=s(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],i=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&i++;e.setSelections(r,i)}},u["Shift-"+h+"["]="fold",u["Shift-"+h+"]"]="unfold",u[y+h+"0"]=u[y+h+"j"]="unfoldAll",u[h+"I"]="findIncremental",u["Shift-"+h+"I"]="findIncrementalReverse",u[h+"H"]="replace",u.F3="findNext",u["Shift-F3"]="findPrev",e.normalizeKeyMap(u)}); \ No newline at end of file
diff --git a/public/vendor/codemirror/compress.sh b/public/vendor/codemirror/compress.sh
index e5739c67..dc84ba7f 100644
--- a/public/vendor/codemirror/compress.sh
+++ b/public/vendor/codemirror/compress.sh
@@ -6,12 +6,15 @@ addon/mode/multiplex.js \
addon/selection/active-line.js \
addon/search/searchcursor.js \
addon/search/search.js \
+addon/search/jump-to-line.js \
addon/search/matchesonscrollbar.js \
addon/search/match-highlighter.js \
addon/scroll/simplescrollbars.js \
addon/scroll/annotatescrollbar.js \
addon/display/panel.js \
addon/display/placeholder.js \
+addon/display/fullscreen.js \
+addon/display/autorefresh.js \
addon/dialog/dialog.js \
addon/edit/matchbrackets.js \
addon/edit/closebrackets.js \
diff --git a/public/vendor/codemirror/keymap/emacs.js b/public/vendor/codemirror/keymap/emacs.js
index c4135237..3eec1e57 100755..100644
--- a/public/vendor/codemirror/keymap/emacs.js
+++ b/public/vendor/codemirror/keymap/emacs.js
@@ -377,7 +377,7 @@
getInput(cm, "Goto line", function(str) {
var num;
- if (str && !isNaN(num = Number(str)) && num == num|0 && num > 0)
+ if (str && !isNaN(num = Number(str)) && num == (num|0) && num > 0)
cm.setCursor(num - 1);
});
},
diff --git a/public/vendor/codemirror/keymap/sublime.js b/public/vendor/codemirror/keymap/sublime.js
index 4f7a6f31..e0d0e92b 100755..100644
--- a/public/vendor/codemirror/keymap/sublime.js
+++ b/public/vendor/codemirror/keymap/sublime.js
@@ -55,7 +55,9 @@
cmds[map["Alt-Left"] = "goSubwordLeft"] = function(cm) { moveSubword(cm, -1); };
cmds[map["Alt-Right"] = "goSubwordRight"] = function(cm) { moveSubword(cm, 1); };
- cmds[map[ctrl + "Up"] = "scrollLineUp"] = function(cm) {
+ var scrollLineCombo = mac ? "Ctrl-Alt-" : "Ctrl-";
+
+ cmds[map[scrollLineCombo + "Up"] = "scrollLineUp"] = function(cm) {
var info = cm.getScrollInfo();
if (!cm.somethingSelected()) {
var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, "local");
@@ -64,7 +66,7 @@
}
cm.scrollTo(null, info.top - cm.defaultTextHeight());
};
- cmds[map[ctrl + "Down"] = "scrollLineDown"] = function(cm) {
+ cmds[map[scrollLineCombo + "Down"] = "scrollLineDown"] = function(cm) {
var info = cm.getScrollInfo();
if (!cm.somethingSelected()) {
var visibleTopLine = cm.lineAtHeight(info.top, "local")+1;
@@ -106,6 +108,7 @@
map["Shift-" + ctrl + "K"] = "deleteLine";
function insertLine(cm, above) {
+ if (cm.isReadOnly()) return CodeMirror.Pass
cm.operation(function() {
var len = cm.listSelections().length, newSelection = [], last = -1;
for (var i = 0; i < len; i++) {
@@ -121,9 +124,9 @@
});
}
- cmds[map[ctrl + "Enter"] = "insertLineAfter"] = function(cm) { insertLine(cm, false); };
+ cmds[map[ctrl + "Enter"] = "insertLineAfter"] = function(cm) { return insertLine(cm, false); };
- cmds[map["Shift-" + ctrl + "Enter"] = "insertLineBefore"] = function(cm) { insertLine(cm, true); };
+ cmds[map["Shift-" + ctrl + "Enter"] = "insertLineBefore"] = function(cm) { return insertLine(cm, true); };
function wordAt(cm, pos) {
var start = pos.ch, end = start, line = cm.getLine(pos.line);
@@ -190,6 +193,7 @@
var swapLineCombo = mac ? "Cmd-Ctrl-" : "Shift-Ctrl-";
cmds[map[swapLineCombo + "Up"] = "swapLineUp"] = function(cm) {
+ if (cm.isReadOnly()) return CodeMirror.Pass
var ranges = cm.listSelections(), linesToMove = [], at = cm.firstLine() - 1, newSels = [];
for (var i = 0; i < ranges.length; i++) {
var range = ranges[i], from = range.from().line - 1, to = range.to().line;
@@ -216,6 +220,7 @@
};
cmds[map[swapLineCombo + "Down"] = "swapLineDown"] = function(cm) {
+ if (cm.isReadOnly()) return CodeMirror.Pass
var ranges = cm.listSelections(), linesToMove = [], at = cm.lastLine() + 1;
for (var i = ranges.length - 1; i >= 0; i--) {
var range = ranges[i], from = range.to().line + 1, to = range.from().line;
@@ -238,7 +243,9 @@
});
};
- map[ctrl + "/"] = "toggleComment";
+ cmds[map[ctrl + "/"] = "toggleCommentIndented"] = function(cm) {
+ cm.toggleComment({ indent: true });
+ }
cmds[map[ctrl + "J"] = "joinLines"] = function(cm) {
var ranges = cm.listSelections(), joined = [];
@@ -258,7 +265,7 @@
var actual = line - offset;
if (line == obj.end) head = Pos(actual, cm.getLine(actual).length + 1);
if (actual < cm.lastLine()) {
- cm.replaceRange(" ", Pos(actual), Pos(actual + 1, /^\s*/.exec(cm.getLine(actual + 1))[0].length), "+joinLines");
+ cm.replaceRange(" ", Pos(actual), Pos(actual + 1, /^\s*/.exec(cm.getLine(actual + 1))[0].length));
++offset;
}
}
@@ -274,9 +281,9 @@
for (var i = 0; i < rangeCount; i++) {
var range = cm.listSelections()[i];
if (range.empty())
- cm.replaceRange(cm.getLine(range.head.line) + "\n", Pos(range.head.line, 0), null, "+duplicateLine");
+ cm.replaceRange(cm.getLine(range.head.line) + "\n", Pos(range.head.line, 0));
else
- cm.replaceRange(cm.getRange(range.from(), range.to()), range.from(), null, "+duplicateLine");
+ cm.replaceRange(cm.getRange(range.from(), range.to()), range.from());
}
cm.scrollIntoView();
});
@@ -285,6 +292,7 @@
map[ctrl + "T"] = "transposeChars";
function sortLines(cm, caseSensitive) {
+ if (cm.isReadOnly()) return CodeMirror.Pass
var ranges = cm.listSelections(), toSort = [], selected;
for (var i = 0; i < ranges.length; i++) {
var range = ranges[i];
@@ -311,7 +319,7 @@
if (au != bu) { a = au; b = bu; }
return a < b ? -1 : a == b ? 0 : 1;
});
- cm.replaceRange(lines, start, end, "+sortLines");
+ cm.replaceRange(lines, start, end);
if (selected) ranges.push({anchor: start, head: end});
}
if (selected) cm.setSelections(ranges, 0);
@@ -402,7 +410,7 @@
if (at && CodeMirror.cmpPos(range.head, at) > 0) continue;
var word = wordAt(cm, range.head);
at = word.from;
- cm.replaceRange(mod(word.word), word.from, word.to, "case");
+ cm.replaceRange(mod(word.word), word.from, word.to);
}
});
}
@@ -415,11 +423,19 @@
var cursor = cm.getCursor();
var toStartOfLine = cm.getRange({line: cursor.line, ch: 0}, cursor);
var column = CodeMirror.countColumn(toStartOfLine, null, cm.getOption("tabSize"));
+ var indentUnit = cm.getOption("indentUnit");
+
+ if (toStartOfLine && !/\S/.test(toStartOfLine) && column % indentUnit == 0) {
+ var prevIndent = new Pos(cursor.line,
+ CodeMirror.findColumn(toStartOfLine, column - indentUnit, indentUnit));
- if (toStartOfLine && !/\S/.test(toStartOfLine) && column % cm.getOption("indentUnit") == 0)
- return cm.indentSelection("subtract");
- else
+ // If no smart delete is happening (due to tab sizing) just do a regular delete
+ if (prevIndent.ch == cursor.ch) return CodeMirror.Pass;
+
+ return cm.replaceRange("", prevIndent, cursor, "+delete");
+ } else {
return CodeMirror.Pass;
+ }
};
cmds[map[cK + ctrl + "K"] = "delLineRight"] = function(cm) {
@@ -452,7 +468,7 @@
var from = cm.getCursor(), to = found;
if (CodeMirror.cmpPos(from, to) > 0) { var tmp = to; to = from; from = tmp; }
cm.state.sublimeKilled = cm.getRange(from, to);
- cm.replaceRange("", from, to, "+delete");
+ cm.replaceRange("", from, to);
}
};
cmds[map[cK + ctrl + "X"] = "swapWithSublimeMark"] = function(cm) {
diff --git a/public/vendor/codemirror/keymap/vim.js b/public/vendor/codemirror/keymap/vim.js
index d50cc4af..0548b75b 100755..100644
--- a/public/vendor/codemirror/keymap/vim.js
+++ b/public/vendor/codemirror/keymap/vim.js
@@ -292,12 +292,7 @@
// Keypress character binding of format "'a'"
return key.charAt(1);
}
- var pieces = key.split('-');
- if (/-$/.test(key)) {
- // If the - key was typed, split will result in 2 extra empty strings
- // in the array. Replace them with 1 '-'.
- pieces.splice(-2, 2, '-');
- }
+ var pieces = key.split(/-(?!$)/);
var lastPiece = pieces[pieces.length - 1];
if (pieces.length == 1 && pieces[0].length == 1) {
// No-modifier bindings use literal character bindings above. Skip.
@@ -1959,13 +1954,21 @@
text = text.slice(0, - match[0].length);
}
}
- var wasLastLine = head.line - 1 == cm.lastLine();
- cm.replaceRange('', anchor, head);
- if (args.linewise && !wasLastLine) {
+ var prevLineEnd = new Pos(anchor.line - 1, Number.MAX_VALUE);
+ var wasLastLine = cm.firstLine() == cm.lastLine();
+ if (head.line > cm.lastLine() && args.linewise && !wasLastLine) {
+ cm.replaceRange('', prevLineEnd, head);
+ } else {
+ cm.replaceRange('', anchor, head);
+ }
+ if (args.linewise) {
// Push the next line back down, if there is a next line.
- CodeMirror.commands.newlineAndIndent(cm);
- // null ch so setCursor moves to end of line.
- anchor.ch = null;
+ if (!wasLastLine) {
+ cm.setCursor(prevLineEnd);
+ CodeMirror.commands.newlineAndIndent(cm);
+ }
+ // make sure cursor ends up at the end of the line.
+ anchor.ch = Number.MAX_VALUE;
}
finalHead = anchor;
} else {
@@ -2144,9 +2147,7 @@
switch (actionArgs.position) {
case 'center': y = y - (height / 2) + lineHeight;
break;
- case 'bottom': y = y - height + lineHeight*1.4;
- break;
- case 'top': y = y + lineHeight*0.4;
+ case 'bottom': y = y - height + lineHeight;
break;
}
cm.scrollTo(null, y);
@@ -3208,7 +3209,7 @@
return cur;
}
- /*
+ /**
* Returns the boundaries of the next word. If the cursor in the middle of
* the word, then returns the boundaries of the current word, starting at
* the cursor. If the cursor is at the start/end of a word, and we are going
@@ -4308,7 +4309,7 @@
if (decimal + hex + octal > 1) { return 'Invalid arguments'; }
number = decimal && 'decimal' || hex && 'hex' || octal && 'octal';
}
- if (args.eatSpace() && args.match(/\/.*\//)) { 'patterns not supported'; }
+ if (args.match(/\/.*\//)) { return 'patterns not supported'; }
}
}
var err = parseArgs();
diff --git a/public/vendor/codemirror/lib/codemirror.css b/public/vendor/codemirror/lib/codemirror.css
index b313b61c..1067b3ee 100755..100644
--- a/public/vendor/codemirror/lib/codemirror.css
+++ b/public/vendor/codemirror/lib/codemirror.css
@@ -41,19 +41,21 @@
/* CURSOR */
-.CodeMirror div.CodeMirror-cursor {
+.CodeMirror-cursor {
border-left: 1px solid black;
+ border-right: none;
+ width: 0;
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
border-left: 1px solid silver;
}
-.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
+.cm-fat-cursor .CodeMirror-cursor {
width: auto;
border: 0;
background: #7e7;
}
-.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
+.cm-fat-cursor div.CodeMirror-cursors {
z-index: 1;
}
@@ -63,25 +65,26 @@
-webkit-animation: blink 1.06s steps(1) infinite;
-moz-animation: blink 1.06s steps(1) infinite;
animation: blink 1.06s steps(1) infinite;
+ background-color: #7e7;
}
@-moz-keyframes blink {
- 0% { background: #7e7; }
- 50% { background: none; }
- 100% { background: #7e7; }
+ 0% {}
+ 50% { background-color: transparent; }
+ 100% {}
}
@-webkit-keyframes blink {
- 0% { background: #7e7; }
- 50% { background: none; }
- 100% { background: #7e7; }
+ 0% {}
+ 50% { background-color: transparent; }
+ 100% {}
}
@keyframes blink {
- 0% { background: #7e7; }
- 50% { background: none; }
- 100% { background: #7e7; }
+ 0% {}
+ 50% { background-color: transparent; }
+ 100% {}
}
/* Can style cursor different in overwrite (non-insert) mode */
-div.CodeMirror-overwrite div.CodeMirror-cursor {}
+.CodeMirror-overwrite .CodeMirror-cursor {}
.cm-tab { display: inline-block; text-decoration: inherit; }
@@ -162,7 +165,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
- before actuall scrolling happens, thus preventing shaking and
+ before actual scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
position: absolute;
@@ -202,7 +205,13 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
.CodeMirror-gutter-wrapper {
position: absolute;
z-index: 4;
- height: 100%;
+ background: none !important;
+ border: none !important;
+}
+.CodeMirror-gutter-background {
+ position: absolute;
+ top: 0; bottom: 0;
+ z-index: 4;
}
.CodeMirror-gutter-elt {
position: absolute;
@@ -277,19 +286,19 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
overflow: hidden;
visibility: hidden;
}
-.CodeMirror-measure pre { position: static; }
-.CodeMirror div.CodeMirror-cursor {
- position: absolute;
- border-right: none;
- width: 0;
-}
+.CodeMirror-cursor { position: absolute; }
+.CodeMirror-measure pre { position: static; }
div.CodeMirror-cursors {
visibility: hidden;
position: relative;
z-index: 3;
}
+div.CodeMirror-dragcursors {
+ visibility: visible;
+}
+
.CodeMirror-focused div.CodeMirror-cursors {
visibility: visible;
}
@@ -297,8 +306,8 @@ div.CodeMirror-cursors {
.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
.CodeMirror-crosshair { cursor: crosshair; }
-.CodeMirror ::selection { background: #d7d4f0; }
-.CodeMirror ::-moz-selection { background: #d7d4f0; }
+.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
+.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
.cm-searching {
background: #ffa;
diff --git a/public/vendor/codemirror/lib/codemirror.js b/public/vendor/codemirror/lib/codemirror.js
index 92cacf0f..95a7dc74 100755..100644
--- a/public/vendor/codemirror/lib/codemirror.js
+++ b/public/vendor/codemirror/lib/codemirror.js
@@ -13,7 +13,7 @@
else if (typeof define == "function" && define.amd) // AMD
return define([], mod);
else // Plain browser env
- this.CodeMirror = mod();
+ (this || window).CodeMirror = mod();
})(function() {
"use strict";
@@ -21,27 +21,29 @@
// Kludges for bugs and behavior differences that can't be feature
// detected are enabled based on userAgent etc sniffing.
+ var userAgent = navigator.userAgent;
+ var platform = navigator.platform;
- var gecko = /gecko\/\d/i.test(navigator.userAgent);
- var ie_upto10 = /MSIE \d/.test(navigator.userAgent);
- var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
+ var gecko = /gecko\/\d/i.test(userAgent);
+ var ie_upto10 = /MSIE \d/.test(userAgent);
+ var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent);
var ie = ie_upto10 || ie_11up;
var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1]);
- var webkit = /WebKit\//.test(navigator.userAgent);
- var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent);
- var chrome = /Chrome\//.test(navigator.userAgent);
- var presto = /Opera\//.test(navigator.userAgent);
+ var webkit = /WebKit\//.test(userAgent);
+ var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent);
+ var chrome = /Chrome\//.test(userAgent);
+ var presto = /Opera\//.test(userAgent);
var safari = /Apple Computer/.test(navigator.vendor);
- var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent);
- var phantom = /PhantomJS/.test(navigator.userAgent);
+ var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent);
+ var phantom = /PhantomJS/.test(userAgent);
- var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
+ var ios = /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent);
// This is woefully incomplete. Suggestions for alternative methods welcome.
- var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);
- var mac = ios || /Mac/.test(navigator.platform);
- var windows = /win/i.test(navigator.platform);
+ var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);
+ var mac = ios || /Mac/.test(platform);
+ var windows = /win/i.test(platform);
- var presto_version = presto && navigator.userAgent.match(/Version\/(\d*\.\d*)/);
+ var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/);
if (presto_version) presto_version = Number(presto_version[1]);
if (presto_version && presto_version >= 15) { presto = false; webkit = true; }
// Some browsers use the wrong event properties to signal cmd/ctrl on OS X
@@ -65,7 +67,7 @@
setGuttersForLineNumbers(options);
var doc = options.value;
- if (typeof doc == "string") doc = new Doc(doc, options.mode);
+ if (typeof doc == "string") doc = new Doc(doc, options.mode, null, options.lineSeparator);
this.doc = doc;
var input = new CodeMirror.inputStyles[options.inputStyle](this);
@@ -87,6 +89,7 @@
focused: false,
suppressEdits: false, // used to disable editing during key handlers when in readOnly mode
pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll
+ selectingText: false,
draggingText: false,
highlight: new Delayed(), // stores highlight worker timeout
keySeq: null, // Unfinished key sequence
@@ -407,7 +410,7 @@
if (horiz.clientWidth) scroll(horiz.scrollLeft, "horizontal");
});
- this.checkedOverlay = false;
+ this.checkedZeroWidth = false;
// Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
if (ie && ie_version < 8) this.horiz.style.minHeight = this.vert.style.minWidth = "18px";
}
@@ -442,29 +445,43 @@
this.horiz.firstChild.style.width = "0";
}
- if (!this.checkedOverlay && measure.clientHeight > 0) {
- if (sWidth == 0) this.overlayHack();
- this.checkedOverlay = true;
+ if (!this.checkedZeroWidth && measure.clientHeight > 0) {
+ if (sWidth == 0) this.zeroWidthHack();
+ this.checkedZeroWidth = true;
}
return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0};
},
setScrollLeft: function(pos) {
if (this.horiz.scrollLeft != pos) this.horiz.scrollLeft = pos;
+ if (this.disableHoriz) this.enableZeroWidthBar(this.horiz, this.disableHoriz);
},
setScrollTop: function(pos) {
if (this.vert.scrollTop != pos) this.vert.scrollTop = pos;
+ if (this.disableVert) this.enableZeroWidthBar(this.vert, this.disableVert);
},
- overlayHack: function() {
+ zeroWidthHack: function() {
var w = mac && !mac_geMountainLion ? "12px" : "18px";
- this.horiz.style.minHeight = this.vert.style.minWidth = w;
- var self = this;
- var barMouseDown = function(e) {
- if (e_target(e) != self.vert && e_target(e) != self.horiz)
- operation(self.cm, onMouseDown)(e);
- };
- on(this.vert, "mousedown", barMouseDown);
- on(this.horiz, "mousedown", barMouseDown);
+ this.horiz.style.height = this.vert.style.width = w;
+ this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none";
+ this.disableHoriz = new Delayed;
+ this.disableVert = new Delayed;
+ },
+ enableZeroWidthBar: function(bar, delay) {
+ bar.style.pointerEvents = "auto";
+ function maybeDisable() {
+ // To find out whether the scrollbar is still visible, we
+ // check whether the element under the pixel in the bottom
+ // left corner of the scrollbar box is the scrollbar box
+ // itself (when the bar is still visible) or its filler child
+ // (when the bar is hidden). If it is still visible, we keep
+ // it enabled, if it's hidden, we disable pointer events.
+ var box = bar.getBoundingClientRect();
+ var elt = document.elementFromPoint(box.left + 1, box.bottom - 1);
+ if (elt != bar) bar.style.pointerEvents = "none";
+ else delay.set(1000, maybeDisable);
+ }
+ delay.set(1000, maybeDisable);
},
clear: function() {
var parent = this.horiz.parentNode;
@@ -714,7 +731,7 @@
// width and height.
removeChildren(display.cursorDiv);
removeChildren(display.selectionDiv);
- display.gutters.style.height = 0;
+ display.gutters.style.height = display.sizer.style.minHeight = 0;
if (different) {
display.lastWrapHeight = update.wrapperHeight;
@@ -806,7 +823,7 @@
// given line.
function updateWidgetHeight(line) {
if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)
- line.widgets[i].height = line.widgets[i].node.offsetHeight;
+ line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;
}
// Do a bulk-read of the DOM positions and sizes needed to draw the
@@ -955,12 +972,22 @@
lineView.node.removeChild(lineView.gutter);
lineView.gutter = null;
}
+ if (lineView.gutterBackground) {
+ lineView.node.removeChild(lineView.gutterBackground);
+ lineView.gutterBackground = null;
+ }
+ if (lineView.line.gutterClass) {
+ var wrap = ensureLineWrapped(lineView);
+ lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass,
+ "left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) +
+ "px; width: " + dims.gutterTotalWidth + "px");
+ wrap.insertBefore(lineView.gutterBackground, lineView.text);
+ }
var markers = lineView.line.gutterMarkers;
if (cm.options.lineNumbers || markers) {
var wrap = ensureLineWrapped(lineView);
var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", "left: " +
- (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) +
- "px; width: " + dims.gutterTotalWidth + "px");
+ (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px");
cm.display.input.setUneditable(gutterWrap);
wrap.insertBefore(gutterWrap, lineView.text);
if (lineView.line.gutterClass)
@@ -1067,10 +1094,6 @@
if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }
}
- function isReadOnly(cm) {
- return cm.options.readOnly || cm.doc.cantEdit;
- }
-
// This will be set to an array of strings when copying, so that,
// when pasting, we know what kind of selections the copied text
// was made out of.
@@ -1082,13 +1105,18 @@
if (!sel) sel = doc.sel;
var paste = cm.state.pasteIncoming || origin == "paste";
- var textLines = splitLines(inserted), multiPaste = null;
+ var textLines = doc.splitLines(inserted), multiPaste = null;
// When pasing N lines into N selections, insert one line per selection
if (paste && sel.ranges.length > 1) {
- if (lastCopied && lastCopied.join("\n") == inserted)
- multiPaste = sel.ranges.length % lastCopied.length == 0 && map(lastCopied, splitLines);
- else if (textLines.length == sel.ranges.length)
+ if (lastCopied && lastCopied.join("\n") == inserted) {
+ if (sel.ranges.length % lastCopied.length == 0) {
+ multiPaste = [];
+ for (var i = 0; i < lastCopied.length; i++)
+ multiPaste.push(doc.splitLines(lastCopied[i]));
+ }
+ } else if (textLines.length == sel.ranges.length) {
multiPaste = map(textLines, function(l) { return [l]; });
+ }
}
// Normal behavior is to insert the new text into every selection
@@ -1120,7 +1148,8 @@
var pasted = e.clipboardData && e.clipboardData.getData("text/plain");
if (pasted) {
e.preventDefault();
- runInOp(cm, function() { applyTextInput(cm, pasted, 0, null, "paste"); });
+ if (!cm.isReadOnly() && !cm.options.disableInput)
+ runInOp(cm, function() { applyTextInput(cm, pasted, 0, null, "paste"); });
return true;
}
}
@@ -1222,13 +1251,14 @@
});
on(te, "paste", function(e) {
- if (handlePaste(e, cm)) return true;
+ if (signalDOMEvent(cm, e) || handlePaste(e, cm)) return
cm.state.pasteIncoming = true;
input.fastPoll();
});
function prepareCopyCut(e) {
+ if (signalDOMEvent(cm, e)) return
if (cm.somethingSelected()) {
lastCopied = cm.getSelections();
if (input.inaccurateSelection) {
@@ -1256,7 +1286,7 @@
on(te, "copy", prepareCopyCut);
on(display.scroller, "paste", function(e) {
- if (eventInWidget(display, e)) return;
+ if (eventInWidget(display, e) || signalDOMEvent(cm, e)) return;
cm.state.pasteIncoming = true;
input.focus();
});
@@ -1268,6 +1298,7 @@
on(te, "compositionstart", function() {
var start = cm.getCursor("from");
+ if (input.composing) input.composing.range.clear()
input.composing = {
start: start,
range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"})
@@ -1390,8 +1421,8 @@
// will be the case when there is a lot of text in the textarea,
// in which case reading its value would be expensive.
if (this.contextMenuPending || !cm.state.focused ||
- (hasSelection(input) && !prevInput) ||
- isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq)
+ (hasSelection(input) && !prevInput && !this.composing) ||
+ cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)
return false;
var text = input.value;
@@ -1518,6 +1549,10 @@
}
},
+ readOnlyChanged: function(val) {
+ if (!val) this.reset();
+ },
+
setUneditable: nothing,
needsContentAttribute: false
@@ -1536,10 +1571,11 @@
init: function(display) {
var input = this, cm = input.cm;
var div = input.div = display.lineDiv;
- div.contentEditable = "true";
disableBrowserMagic(div);
- on(div, "paste", function(e) { handlePaste(e, cm); })
+ on(div, "paste", function(e) {
+ if (!signalDOMEvent(cm, e)) handlePaste(e, cm);
+ })
on(div, "compositionstart", function(e) {
var data = e.data;
@@ -1577,11 +1613,12 @@
on(div, "input", function() {
if (input.composing) return;
- if (!input.pollContent())
+ if (cm.isReadOnly() || !input.pollContent())
runInOp(input.cm, function() {regChange(cm);});
});
function onCopyCut(e) {
+ if (signalDOMEvent(cm, e)) return
if (cm.somethingSelected()) {
lastCopied = cm.getSelections();
if (e.type == "cut") cm.replaceSelection("", null, "cut");
@@ -1657,8 +1694,13 @@
try { var rng = range(start.node, start.offset, end.offset, end.node); }
catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible
if (rng) {
- sel.removeAllRanges();
- sel.addRange(rng);
+ if (!gecko && this.cm.state.focused) {
+ sel.collapse(start.node, start.offset);
+ if (!rng.collapsed) sel.addRange(rng);
+ } else {
+ sel.removeAllRanges();
+ sel.addRange(rng);
+ }
if (old && sel.anchorNode == null) sel.addRange(old);
else if (gecko) this.startGracePeriod();
}
@@ -1758,7 +1800,7 @@
var toNode = display.view[toIndex + 1].node.previousSibling;
}
- var newText = splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));
+ var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));
var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));
while (newText.length > 1 && oldText.length > 1) {
if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }
@@ -1802,17 +1844,24 @@
this.div.focus();
},
applyComposition: function(composing) {
- if (composing.data && composing.data != composing.startData)
+ if (this.cm.isReadOnly())
+ operation(this.cm, regChange)(this.cm)
+ else if (composing.data && composing.data != composing.startData)
operation(this.cm, applyTextInput)(this.cm, composing.data, 0, composing.sel);
},
setUneditable: function(node) {
- node.setAttribute("contenteditable", "false");
+ node.contentEditable = "false"
},
onKeyPress: function(e) {
e.preventDefault();
- operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0);
+ if (!this.cm.isReadOnly())
+ operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0);
+ },
+
+ readOnlyChanged: function(val) {
+ this.div.contentEditable = String(val != "nocursor")
},
onContextMenu: nothing,
@@ -1914,7 +1963,7 @@
}
function domTextBetween(cm, from, to, fromLine, toLine) {
- var text = "", closing = false;
+ var text = "", closing = false, lineSep = cm.doc.lineSeparator();
function recognizeMarker(id) { return function(marker) { return marker.id == id; }; }
function walk(node) {
if (node.nodeType == 1) {
@@ -1928,7 +1977,7 @@
if (markerID) {
var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));
if (found.length && (range = found[0].find()))
- text += getBetween(cm.doc, range.from, range.to).join("\n");
+ text += getBetween(cm.doc, range.from, range.to).join(lineSep);
return;
}
if (node.getAttribute("contenteditable") == "false") return;
@@ -1940,7 +1989,7 @@
var val = node.nodeValue;
if (!val) return;
if (closing) {
- text += "\n";
+ text += lineSep;
closing = false;
}
text += val;
@@ -2112,7 +2161,7 @@
// Give beforeSelectionChange handlers a change to influence a
// selection update.
- function filterSelectionChange(doc, sel) {
+ function filterSelectionChange(doc, sel, options) {
var obj = {
ranges: sel.ranges,
update: function(ranges) {
@@ -2120,7 +2169,8 @@
for (var i = 0; i < ranges.length; i++)
this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),
clipPos(doc, ranges[i].head));
- }
+ },
+ origin: options && options.origin
};
signal(doc, "beforeSelectionChange", doc, obj);
if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj);
@@ -2146,7 +2196,7 @@
function setSelectionNoUndo(doc, sel, options) {
if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange"))
- sel = filterSelectionChange(doc, sel);
+ sel = filterSelectionChange(doc, sel, options);
var bias = options && options.bias ||
(cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);
@@ -2180,8 +2230,9 @@
var out;
for (var i = 0; i < sel.ranges.length; i++) {
var range = sel.ranges[i];
- var newAnchor = skipAtomic(doc, range.anchor, bias, mayClear);
- var newHead = skipAtomic(doc, range.head, bias, mayClear);
+ var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];
+ var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);
+ var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);
if (out || newAnchor != range.anchor || newHead != range.head) {
if (!out) out = sel.ranges.slice(0, i);
out[i] = new Range(newAnchor, newHead);
@@ -2190,54 +2241,59 @@
return out ? normalizeSelection(out, sel.primIndex) : sel;
}
- // Ensure a given position is not inside an atomic range.
- function skipAtomic(doc, pos, bias, mayClear) {
- var flipped = false, curPos = pos;
- var dir = bias || 1;
- doc.cantEdit = false;
- search: for (;;) {
- var line = getLine(doc, curPos.line);
- if (line.markedSpans) {
- for (var i = 0; i < line.markedSpans.length; ++i) {
- var sp = line.markedSpans[i], m = sp.marker;
- if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) &&
- (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) {
- if (mayClear) {
- signal(m, "beforeCursorEnter");
- if (m.explicitlyCleared) {
- if (!line.markedSpans) break;
- else {--i; continue;}
- }
- }
- if (!m.atomic) continue;
- var newPos = m.find(dir < 0 ? -1 : 1);
- if (cmp(newPos, curPos) == 0) {
- newPos.ch += dir;
- if (newPos.ch < 0) {
- if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1));
- else newPos = null;
- } else if (newPos.ch > line.text.length) {
- if (newPos.line < doc.first + doc.size - 1) newPos = Pos(newPos.line + 1, 0);
- else newPos = null;
- }
- if (!newPos) {
- if (flipped) {
- // Driven in a corner -- no valid cursor position found at all
- // -- try again *with* clearing, if we didn't already
- if (!mayClear) return skipAtomic(doc, pos, bias, true);
- // Otherwise, turn off editing until further notice, and return the start of the doc
- doc.cantEdit = true;
- return Pos(doc.first, 0);
- }
- flipped = true; newPos = pos; dir = -dir;
- }
- }
- curPos = newPos;
- continue search;
+ function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {
+ var line = getLine(doc, pos.line);
+ if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {
+ var sp = line.markedSpans[i], m = sp.marker;
+ if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&
+ (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {
+ if (mayClear) {
+ signal(m, "beforeCursorEnter");
+ if (m.explicitlyCleared) {
+ if (!line.markedSpans) break;
+ else {--i; continue;}
}
}
+ if (!m.atomic) continue;
+
+ if (oldPos) {
+ var near = m.find(dir < 0 ? 1 : -1), diff;
+ if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft) near = movePos(doc, near, -dir, line);
+ if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))
+ return skipAtomicInner(doc, near, pos, dir, mayClear);
+ }
+
+ var far = m.find(dir < 0 ? -1 : 1);
+ if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight) far = movePos(doc, far, dir, line);
+ return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null;
}
- return curPos;
+ }
+ return pos;
+ }
+
+ // Ensure a given position is not inside an atomic range.
+ function skipAtomic(doc, pos, oldPos, bias, mayClear) {
+ var dir = bias || 1;
+ var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||
+ (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||
+ skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||
+ (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));
+ if (!found) {
+ doc.cantEdit = true;
+ return Pos(doc.first, 0);
+ }
+ return found;
+ }
+
+ function movePos(doc, pos, dir, line) {
+ if (dir < 0 && pos.ch == 0) {
+ if (pos.line > doc.first) return clipPos(doc, Pos(pos.line - 1));
+ else return null;
+ } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {
+ if (pos.line < doc.first + doc.size - 1) return Pos(pos.line + 1, 0);
+ else return null;
+ } else {
+ return new Pos(pos.line, pos.ch + dir);
}
}
@@ -2257,7 +2313,7 @@
var range = doc.sel.ranges[i];
var collapsed = range.empty();
if (collapsed || cm.options.showCursorWhenSelecting)
- drawSelectionCursor(cm, range, curFragment);
+ drawSelectionCursor(cm, range.head, curFragment);
if (!collapsed)
drawSelectionRange(cm, range, selFragment);
}
@@ -2265,8 +2321,8 @@
}
// Draws a cursor for the given range
- function drawSelectionCursor(cm, range, output) {
- var pos = cursorCoords(cm, range.head, "div", null, null, !cm.options.singleCursorHeightPerLine);
+ function drawSelectionCursor(cm, head, output) {
+ var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine);
var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor"));
cursor.style.left = pos.left + "px";
@@ -2400,8 +2456,8 @@
doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function(line) {
if (doc.frontier >= cm.display.viewFrom) { // Visible
- var oldStyles = line.styles;
- var highlighted = highlightLine(cm, line, state, true);
+ var oldStyles = line.styles, tooLong = line.text.length > cm.options.maxHighlightLength;
+ var highlighted = highlightLine(cm, line, tooLong ? copyState(doc.mode, state) : state, true);
line.styles = highlighted.styles;
var oldCls = line.styleClasses, newCls = highlighted.classes;
if (newCls) line.styleClasses = newCls;
@@ -2410,9 +2466,10 @@
oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);
for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i];
if (ischange) changedLines.push(doc.frontier);
- line.stateAfter = copyState(doc.mode, state);
+ line.stateAfter = tooLong ? state : copyState(doc.mode, state);
} else {
- processLine(cm, line.text, state);
+ if (line.text.length <= cm.options.maxHighlightLength)
+ processLine(cm, line.text, state);
line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null;
}
++doc.frontier;
@@ -2557,10 +2614,12 @@
function prepareMeasureForLine(cm, line) {
var lineN = lineNo(line);
var view = findViewForLine(cm, lineN);
- if (view && !view.text)
+ if (view && !view.text) {
view = null;
- else if (view && view.changes)
+ } else if (view && view.changes) {
updateLineForChanges(cm, view, lineN, getDimensions(cm));
+ cm.curOp.forceUpdate = true;
+ }
if (!view)
view = updateExternalMeasurement(cm, line);
@@ -2973,12 +3032,12 @@
var callbacks = group.delayedCallbacks, i = 0;
do {
for (; i < callbacks.length; i++)
- callbacks[i]();
+ callbacks[i].call(null);
for (var j = 0; j < group.ops.length; j++) {
var op = group.ops[j];
if (op.cursorActivityHandlers)
while (op.cursorActivityCalled < op.cursorActivityHandlers.length)
- op.cursorActivityHandlers[op.cursorActivityCalled++](op.cm);
+ op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm);
}
} while (i < callbacks.length);
}
@@ -3072,7 +3131,8 @@
if (cm.state.focused && op.updateInput)
cm.display.input.reset(op.typing);
- if (op.focus && op.focus == activeElt()) ensureFocus(op.cm);
+ if (op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus()))
+ ensureFocus(op.cm);
}
function endOperation_finish(op) {
@@ -3387,7 +3447,7 @@
return dx * dx + dy * dy > 20 * 20;
}
on(d.scroller, "touchstart", function(e) {
- if (!isMouseLikeTouchEvent(e)) {
+ if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {
clearTimeout(touchFinished);
var now = +new Date;
d.activeTouch = {start: now, moved: false,
@@ -3438,9 +3498,11 @@
on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });
d.dragFunctions = {
- simple: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},
+ enter: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},
+ over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},
start: function(e){onDragStart(cm, e);},
- drop: operation(cm, onDrop)
+ drop: operation(cm, onDrop),
+ leave: function() {clearDragCursor(cm);}
};
var inp = d.input.getField();
@@ -3457,8 +3519,9 @@
var funcs = cm.display.dragFunctions;
var toggle = value ? on : off;
toggle(cm.display.scroller, "dragstart", funcs.start);
- toggle(cm.display.scroller, "dragenter", funcs.simple);
- toggle(cm.display.scroller, "dragover", funcs.simple);
+ toggle(cm.display.scroller, "dragenter", funcs.enter);
+ toggle(cm.display.scroller, "dragover", funcs.over);
+ toggle(cm.display.scroller, "dragleave", funcs.leave);
toggle(cm.display.scroller, "drop", funcs.drop);
}
}
@@ -3513,7 +3576,7 @@
// not interfere with, such as a scrollbar or widget.
function onMouseDown(e) {
var cm = this, display = cm.display;
- if (display.activeTouch && display.input.supportsTouch() || signalDOMEvent(cm, e)) return;
+ if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) return;
display.shift = e.shiftKey;
if (eventInWidget(display, e)) {
@@ -3531,7 +3594,10 @@
switch (e_button(e)) {
case 1:
- if (start)
+ // #3261: make sure, that we're not starting a second selection
+ if (cm.state.selectingText)
+ cm.state.selectingText(e);
+ else if (start)
leftButtonDown(cm, e, start);
else if (e_target(e) == display.scroller)
e_preventDefault(e);
@@ -3566,7 +3632,7 @@
}
var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained;
- if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) &&
+ if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&
type == "single" && (contained = sel.contains(start)) > -1 &&
(cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) &&
(cmp(contained.to(), start) > 0 || start.xRel < 0))
@@ -3651,7 +3717,8 @@
setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),
{scroll: false, origin: "*mouse"});
} else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single" && !e.shiftKey) {
- setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0));
+ setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),
+ {scroll: false, origin: "*mouse"});
startSel = doc.sel;
} else {
replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);
@@ -3729,6 +3796,7 @@
}
function done(e) {
+ cm.state.selectingText = false;
counter = Infinity;
e_preventDefault(e);
display.input.focus();
@@ -3742,13 +3810,14 @@
else extend(e);
});
var up = operation(cm, done);
+ cm.state.selectingText = up;
on(document, "mousemove", move);
on(document, "mouseup", up);
}
// Determines whether an event happened in the gutter, and fires the
// handlers for the corresponding event.
- function gutterEvent(cm, e, type, prevent, signalfn) {
+ function gutterEvent(cm, e, type, prevent) {
try { var mX = e.clientX, mY = e.clientY; }
catch(e) { return false; }
if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false;
@@ -3765,14 +3834,14 @@
if (g && g.getBoundingClientRect().right >= mX) {
var line = lineAtHeight(cm.doc, mY);
var gutter = cm.options.gutters[i];
- signalfn(cm, type, cm, line, gutter, e);
+ signal(cm, type, cm, line, gutter, e);
return e_defaultPrevented(e);
}
}
}
function clickInGutter(cm, e) {
- return gutterEvent(cm, e, "gutterClick", true, signalLater);
+ return gutterEvent(cm, e, "gutterClick", true);
}
// Kludge to work around strange IE behavior where it'll sometimes
@@ -3781,23 +3850,32 @@
function onDrop(e) {
var cm = this;
+ clearDragCursor(cm);
if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))
return;
e_preventDefault(e);
if (ie) lastDrop = +new Date;
var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;
- if (!pos || isReadOnly(cm)) return;
+ if (!pos || cm.isReadOnly()) return;
// Might be a file drop, in which case we simply extract the text
// and insert it.
if (files && files.length && window.FileReader && window.File) {
var n = files.length, text = Array(n), read = 0;
var loadFile = function(file, i) {
+ if (cm.options.allowDropFileTypes &&
+ indexOf(cm.options.allowDropFileTypes, file.type) == -1)
+ return;
+
var reader = new FileReader;
reader.onload = operation(cm, function() {
- text[i] = reader.result;
+ var content = reader.result;
+ if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) content = "";
+ text[i] = content;
if (++read == n) {
pos = clipPos(cm.doc, pos);
- var change = {from: pos, to: pos, text: splitLines(text.join("\n")), origin: "paste"};
+ var change = {from: pos, to: pos,
+ text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),
+ origin: "paste"};
makeChange(cm.doc, change);
setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));
}
@@ -3851,6 +3929,25 @@
}
}
+ function onDragOver(cm, e) {
+ var pos = posFromMouse(cm, e);
+ if (!pos) return;
+ var frag = document.createDocumentFragment();
+ drawSelectionCursor(cm, pos, frag);
+ if (!cm.display.dragCursor) {
+ cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors");
+ cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);
+ }
+ removeChildrenAndAdd(cm.display.dragCursor, frag);
+ }
+
+ function clearDragCursor(cm) {
+ if (cm.display.dragCursor) {
+ cm.display.lineSpace.removeChild(cm.display.dragCursor);
+ cm.display.dragCursor = null;
+ }
+ }
+
// SCROLL EVENTS
// Sync the scrollable area and scrollbars, ensure the viewport
@@ -3915,8 +4012,9 @@
var display = cm.display, scroll = display.scroller;
// Quit if there's nothing to scroll here
- if (!(dx && scroll.scrollWidth > scroll.clientWidth ||
- dy && scroll.scrollHeight > scroll.clientHeight)) return;
+ var canScrollX = scroll.scrollWidth > scroll.clientWidth;
+ var canScrollY = scroll.scrollHeight > scroll.clientHeight;
+ if (!(dx && canScrollX || dy && canScrollY)) return;
// Webkit browsers on OS X abort momentum scrolls when the target
// of the scroll event is removed from the scrollable element.
@@ -3940,10 +4038,15 @@
// scrolling entirely here. It'll be slightly off from native, but
// better than glitching out.
if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
- if (dy)
+ if (dy && canScrollY)
setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight)));
setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)));
- e_preventDefault(e);
+ // Only prevent default scrolling if vertical scrolling is
+ // actually possible. Otherwise, it causes vertical scroll
+ // jitter on OSX trackpads when deltaX is small and deltaY
+ // is large (issue #3579)
+ if (!dy || (dy && canScrollY))
+ e_preventDefault(e);
display.wheelStartX = null; // Abort measurement, if in progress
return;
}
@@ -3992,7 +4095,7 @@
cm.display.input.ensurePolled();
var prevShift = cm.display.shift, done = false;
try {
- if (isReadOnly(cm)) cm.state.suppressEdits = true;
+ if (cm.isReadOnly()) cm.state.suppressEdits = true;
if (dropShift) cm.display.shift = false;
done = bound(cm) != Pass;
} finally {
@@ -4171,12 +4274,13 @@
// right-click take effect on it.
function onContextMenu(cm, e) {
if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;
+ if (signalDOMEvent(cm, e, "contextmenu")) return;
cm.display.input.onContextMenu(e);
}
function contextMenuInGutter(cm, e) {
if (!hasHandler(cm, "gutterContextMenu")) return false;
- return gutterEvent(cm, e, "gutterContextMenu", false, signal);
+ return gutterEvent(cm, e, "gutterContextMenu", false);
}
// UPDATING
@@ -4480,7 +4584,7 @@
function replaceRange(doc, code, from, to, origin) {
if (!to) to = from;
if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; }
- if (typeof code == "string") code = splitLines(code);
+ if (typeof code == "string") code = doc.splitLines(code);
makeChange(doc, {from: from, to: to, text: code, origin: origin});
}
@@ -4724,10 +4828,9 @@
function findPosH(doc, pos, dir, unit, visually) {
var line = pos.line, ch = pos.ch, origDir = dir;
var lineObj = getLine(doc, line);
- var possible = true;
function findNextLine() {
var l = line + dir;
- if (l < doc.first || l >= doc.first + doc.size) return (possible = false);
+ if (l < doc.first || l >= doc.first + doc.size) return false
line = l;
return lineObj = getLine(doc, l);
}
@@ -4737,14 +4840,16 @@
if (!boundToLine && findNextLine()) {
if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj);
else ch = dir < 0 ? lineObj.text.length : 0;
- } else return (possible = false);
+ } else return false
} else ch = next;
return true;
}
- if (unit == "char") moveOnce();
- else if (unit == "column") moveOnce(true);
- else if (unit == "word" || unit == "group") {
+ if (unit == "char") {
+ moveOnce()
+ } else if (unit == "column") {
+ moveOnce(true)
+ } else if (unit == "word" || unit == "group") {
var sawType = null, group = unit == "group";
var helper = doc.cm && doc.cm.getHelper(pos, "wordChars");
for (var first = true;; first = false) {
@@ -4764,8 +4869,8 @@
if (dir > 0 && !moveOnce(!first)) break;
}
}
- var result = skipAtomic(doc, Pos(line, ch), origDir, true);
- if (!possible) result.hitSide = true;
+ var result = skipAtomic(doc, Pos(line, ch), pos, origDir, true);
+ if (!cmp(pos, result)) result.hitSide = true;
return result;
}
@@ -5057,7 +5162,7 @@
execCommand: function(cmd) {
if (commands.hasOwnProperty(cmd))
- return commands[cmd](this);
+ return commands[cmd].call(null, this);
},
triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),
@@ -5152,6 +5257,7 @@
signal(this, "overwriteToggle", this, this.state.overwrite);
},
hasFocus: function() { return this.display.input.getField() == activeElt(); },
+ isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit); },
scrollTo: methodOp(function(x, y) {
if (x != null || y != null) resolveScrollToPos(this);
@@ -5275,6 +5381,22 @@
clearCaches(cm);
regChange(cm);
}, true);
+ option("lineSeparator", null, function(cm, val) {
+ cm.doc.lineSep = val;
+ if (!val) return;
+ var newBreaks = [], lineNo = cm.doc.first;
+ cm.doc.iter(function(line) {
+ for (var pos = 0;;) {
+ var found = line.text.indexOf(val, pos);
+ if (found == -1) break;
+ pos = found + val.length;
+ newBreaks.push(Pos(lineNo, found));
+ }
+ lineNo++;
+ });
+ for (var i = newBreaks.length - 1; i >= 0; i--)
+ replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length))
+ });
option("specialChars", /[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val, old) {
cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g");
if (old != CodeMirror.Init) cm.refresh();
@@ -5333,11 +5455,12 @@
cm.display.disabled = true;
} else {
cm.display.disabled = false;
- if (!val) cm.display.input.reset();
}
+ cm.display.input.readOnlyChanged(val)
});
option("disableInput", false, function(cm, val) {if (!val) cm.display.input.reset();}, true);
option("dragDrop", true, dragDropChanged);
+ option("allowDropFileTypes", null);
option("cursorBlinkRate", 530);
option("cursorScrollMargin", 0);
@@ -5625,7 +5748,8 @@
} else if (cur.line > cm.doc.first) {
var prev = getLine(cm.doc, cur.line - 1).text;
if (prev)
- cm.replaceRange(line.charAt(0) + "\n" + prev.charAt(prev.length - 1),
+ cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +
+ prev.charAt(prev.length - 1),
Pos(cur.line - 1, prev.length - 1), Pos(cur.line, 1), "+transpose");
}
}
@@ -5639,10 +5763,10 @@
var len = cm.listSelections().length;
for (var i = 0; i < len; i++) {
var range = cm.listSelections()[i];
- cm.replaceRange("\n", range.anchor, range.head, "+input");
+ cm.replaceRange(cm.doc.lineSeparator(), range.anchor, range.head, "+input");
cm.indentLine(range.from().line + 1, null, true);
- ensureCursorVisible(cm);
}
+ ensureCursorVisible(cm);
});
},
toggleOverwrite: function(cm) {cm.toggleOverwrite();}
@@ -6570,7 +6694,7 @@
parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;";
removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle));
}
- return widget.height = widget.node.offsetHeight;
+ return widget.height = widget.node.parentNode.offsetHeight;
}
function addLineWidget(doc, handle, node, options) {
@@ -6759,7 +6883,9 @@
function getLineStyles(cm, line, updateFrontier) {
if (!line.styles || line.styles[0] != cm.state.modeGen) {
- var result = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line)));
+ var state = getStateBefore(cm, lineNo(line));
+ var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state);
+ line.stateAfter = state;
line.styles = result.styles;
if (result.classes) line.styleClasses = result.classes;
else if (line.styleClasses) line.styleClasses = null;
@@ -6776,7 +6902,7 @@
var stream = new StringStream(text, cm.options.tabSize);
stream.start = stream.pos = startAt || 0;
if (text == "") callBlankLine(mode, state);
- while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {
+ while (!stream.eol()) {
readToken(mode, stream, state);
stream.start = stream.pos;
}
@@ -6803,7 +6929,7 @@
// is needed on Webkit to be able to get line-level bounding
// rectangles for it (in measureChar).
var content = elt("span", null, null, webkit ? "padding-right: .1px" : null);
- var builder = {pre: elt("pre", [content]), content: content,
+ var builder = {pre: elt("pre", [content], "CodeMirror-line"), content: content,
col: 0, pos: 0, cm: cm,
splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")};
lineView.measure = {};
@@ -6893,6 +7019,10 @@
txt.setAttribute("role", "presentation");
txt.setAttribute("cm-text", "\t");
builder.col += tabWidth;
+ } else if (m[0] == "\r" || m[0] == "\n") {
+ var txt = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar"));
+ txt.setAttribute("cm-text", m[0]);
+ builder.col += 1;
} else {
var txt = builder.cm.options.specialCharPlaceholder(m[0]);
txt.setAttribute("cm-text", m[0]);
@@ -6974,7 +7104,7 @@
if (nextChange == pos) { // Update current marker set
spanStyle = spanEndStyle = spanStartStyle = title = css = "";
collapsed = null; nextChange = Infinity;
- var foundBookmarks = [];
+ var foundBookmarks = [], endStyles
for (var j = 0; j < spans.length; ++j) {
var sp = spans[j], m = sp.marker;
if (m.type == "bookmark" && sp.from == pos && m.widgetNode) {
@@ -6985,9 +7115,9 @@
spanEndStyle = "";
}
if (m.className) spanStyle += " " + m.className;
- if (m.css) css = m.css;
+ if (m.css) css = (css ? css + ";" : "") + m.css;
if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle;
- if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle;
+ if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)
if (m.title && !title) title = m.title;
if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
collapsed = sp;
@@ -6995,14 +7125,17 @@
nextChange = sp.from;
}
}
+ if (endStyles) for (var j = 0; j < endStyles.length; j += 2)
+ if (endStyles[j + 1] == nextChange) spanEndStyle += " " + endStyles[j]
+
+ if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)
+ buildCollapsedSpan(builder, 0, foundBookmarks[j]);
if (collapsed && (collapsed.from || 0) == pos) {
buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,
collapsed.marker, collapsed.from == null);
if (collapsed.to == null) return;
if (collapsed.to == pos) collapsed = false;
}
- if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)
- buildCollapsedSpan(builder, 0, foundBookmarks[j]);
}
if (pos >= len) break;
@@ -7238,8 +7371,8 @@
};
var nextDocId = 0;
- var Doc = CodeMirror.Doc = function(text, mode, firstLine) {
- if (!(this instanceof Doc)) return new Doc(text, mode, firstLine);
+ var Doc = CodeMirror.Doc = function(text, mode, firstLine, lineSep) {
+ if (!(this instanceof Doc)) return new Doc(text, mode, firstLine, lineSep);
if (firstLine == null) firstLine = 0;
BranchChunk.call(this, [new LeafChunk([new Line("", null)])]);
@@ -7253,8 +7386,10 @@
this.history = new History(null);
this.id = ++nextDocId;
this.modeOption = mode;
+ this.lineSep = lineSep;
+ this.extend = false;
- if (typeof text == "string") text = splitLines(text);
+ if (typeof text == "string") text = this.splitLines(text);
updateDoc(this, {from: start, to: start, text: text});
setSelection(this, simpleSelection(start), sel_dontScroll);
};
@@ -7284,12 +7419,12 @@
getValue: function(lineSep) {
var lines = getLines(this, this.first, this.first + this.size);
if (lineSep === false) return lines;
- return lines.join(lineSep || "\n");
+ return lines.join(lineSep || this.lineSeparator());
},
setValue: docMethodOp(function(code) {
var top = Pos(this.first, 0), last = this.first + this.size - 1;
makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),
- text: splitLines(code), origin: "setValue", full: true}, true);
+ text: this.splitLines(code), origin: "setValue", full: true}, true);
setSelection(this, simpleSelection(top));
}),
replaceRange: function(code, from, to, origin) {
@@ -7300,7 +7435,7 @@
getRange: function(from, to, lineSep) {
var lines = getBetween(this, clipPos(this, from), clipPos(this, to));
if (lineSep === false) return lines;
- return lines.join(lineSep || "\n");
+ return lines.join(lineSep || this.lineSeparator());
},
getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;},
@@ -7340,10 +7475,11 @@
extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);
}),
extendSelections: docMethodOp(function(heads, options) {
- extendSelections(this, clipPosArray(this, heads, options));
+ extendSelections(this, clipPosArray(this, heads), options);
}),
extendSelectionsBy: docMethodOp(function(f, options) {
- extendSelections(this, map(this.sel.ranges, f), options);
+ var heads = map(this.sel.ranges, f);
+ extendSelections(this, clipPosArray(this, heads), options);
}),
setSelections: docMethodOp(function(ranges, primary, options) {
if (!ranges.length) return;
@@ -7366,13 +7502,13 @@
lines = lines ? lines.concat(sel) : sel;
}
if (lineSep === false) return lines;
- else return lines.join(lineSep || "\n");
+ else return lines.join(lineSep || this.lineSeparator());
},
getSelections: function(lineSep) {
var parts = [], ranges = this.sel.ranges;
for (var i = 0; i < ranges.length; i++) {
var sel = getBetween(this, ranges[i].from(), ranges[i].to());
- if (lineSep !== false) sel = sel.join(lineSep || "\n");
+ if (lineSep !== false) sel = sel.join(lineSep || this.lineSeparator());
parts[i] = sel;
}
return parts;
@@ -7387,7 +7523,7 @@
var changes = [], sel = this.sel;
for (var i = 0; i < sel.ranges.length; i++) {
var range = sel.ranges[i];
- changes[i] = {from: range.from(), to: range.to(), text: splitLines(code[i]), origin: origin};
+ changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin};
}
var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse);
for (var i = changes.length - 1; i >= 0; i--)
@@ -7468,7 +7604,7 @@
removeLineWidget: function(widget) { widget.clear(); },
markText: function(from, to, options) {
- return markText(this, clipPos(this, from), clipPos(this, to), options, "range");
+ return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range");
},
setBookmark: function(pos, options) {
var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),
@@ -7537,7 +7673,8 @@
},
copy: function(copyHistory) {
- var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first);
+ var doc = new Doc(getLines(this, this.first, this.first + this.size),
+ this.modeOption, this.first, this.lineSep);
doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;
doc.sel = this.sel;
doc.extend = false;
@@ -7553,7 +7690,7 @@
var from = this.first, to = this.first + this.size;
if (options.from != null && options.from > from) from = options.from;
if (options.to != null && options.to < to) to = options.to;
- var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from);
+ var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep);
if (options.sharedHist) copy.history = this.history;
(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});
copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];
@@ -7582,7 +7719,13 @@
iterLinkedDocs: function(f) {linkedDocs(this, f);},
getMode: function() {return this.mode;},
- getEditor: function() {return this.cm;}
+ getEditor: function() {return this.cm;},
+
+ splitLines: function(str) {
+ if (this.lineSep) return str.split(this.lineSep);
+ return splitLinesAuto(str);
+ },
+ lineSeparator: function() { return this.lineSep || "\n"; }
});
// Public alias.
@@ -8023,24 +8166,30 @@
}
};
+ var noHandlers = []
+ function getHandlers(emitter, type, copy) {
+ var arr = emitter._handlers && emitter._handlers[type]
+ if (copy) return arr && arr.length > 0 ? arr.slice() : noHandlers
+ else return arr || noHandlers
+ }
+
var off = CodeMirror.off = function(emitter, type, f) {
if (emitter.removeEventListener)
emitter.removeEventListener(type, f, false);
else if (emitter.detachEvent)
emitter.detachEvent("on" + type, f);
else {
- var arr = emitter._handlers && emitter._handlers[type];
- if (!arr) return;
- for (var i = 0; i < arr.length; ++i)
- if (arr[i] == f) { arr.splice(i, 1); break; }
+ var handlers = getHandlers(emitter, type, false)
+ for (var i = 0; i < handlers.length; ++i)
+ if (handlers[i] == f) { handlers.splice(i, 1); break; }
}
};
var signal = CodeMirror.signal = function(emitter, type /*, values...*/) {
- var arr = emitter._handlers && emitter._handlers[type];
- if (!arr) return;
+ var handlers = getHandlers(emitter, type, true)
+ if (!handlers.length) return;
var args = Array.prototype.slice.call(arguments, 2);
- for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args);
+ for (var i = 0; i < handlers.length; ++i) handlers[i].apply(null, args);
};
var orphanDelayedCallbacks = null;
@@ -8053,8 +8202,8 @@
// them to be executed when the last operation ends, or, if no
// operation is active, when a timeout fires.
function signalLater(emitter, type /*, values...*/) {
- var arr = emitter._handlers && emitter._handlers[type];
- if (!arr) return;
+ var arr = getHandlers(emitter, type, false)
+ if (!arr.length) return;
var args = Array.prototype.slice.call(arguments, 2), list;
if (operationGroup) {
list = operationGroup.delayedCallbacks;
@@ -8094,8 +8243,7 @@
}
function hasHandler(emitter, type) {
- var arr = emitter._handlers && emitter._handlers[type];
- return arr && arr.length > 0;
+ return getHandlers(emitter, type).length > 0
}
// Add on and off methods to a constructor's prototype, to make
@@ -8142,7 +8290,7 @@
// The inverse of countColumn -- find the offset that corresponds to
// a particular column.
- function findColumn(string, goal, tabSize) {
+ var findColumn = CodeMirror.findColumn = function(string, goal, tabSize) {
for (var pos = 0, col = 0;;) {
var nextTab = string.indexOf("\t", pos);
if (nextTab == -1) nextTab = string.length;
@@ -8282,7 +8430,12 @@
} while (child = child.parentNode);
};
- function activeElt() { return document.activeElement; }
+ function activeElt() {
+ var activeElement = document.activeElement;
+ while (activeElement && activeElement.root && activeElement.root.activeElement)
+ activeElement = activeElement.root.activeElement;
+ return activeElement;
+ }
// Older versions of IE throws unspecified error when touching
// document.activeElement in some cases (during loading, in iframe)
if (ie && ie_version < 11) activeElt = function() {
@@ -8384,7 +8537,7 @@
// See if "".split is the broken IE version, if so, provide an
// alternative way to split lines.
- var splitLines = CodeMirror.splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) {
+ var splitLinesAuto = CodeMirror.splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) {
var pos = 0, result = [], l = string.length;
while (pos <= l) {
var nl = string.indexOf("\n", pos);
@@ -8430,14 +8583,16 @@
// KEY NAMES
- var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt",
- 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End",
- 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert",
- 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", 107: "=", 109: "-", 127: "Delete",
- 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",
- 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete",
- 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"};
- CodeMirror.keyNames = keyNames;
+ var keyNames = CodeMirror.keyNames = {
+ 3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt",
+ 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End",
+ 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert",
+ 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod",
+ 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete",
+ 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",
+ 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete",
+ 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"
+ };
(function() {
// Number keys
for (var i = 0; i < 10; i++) keyNames[i + 48] = keyNames[i + 96] = String(i);
@@ -8742,7 +8897,7 @@
// THE END
- CodeMirror.version = "5.4.0";
+ CodeMirror.version = "5.10.1";
return CodeMirror;
});
diff --git a/public/vendor/codemirror/mode/apl/apl.js b/public/vendor/codemirror/mode/apl/apl.js
index caafe4e9..caafe4e9 100755..100644
--- a/public/vendor/codemirror/mode/apl/apl.js
+++ b/public/vendor/codemirror/mode/apl/apl.js
diff --git a/public/vendor/codemirror/mode/apl/index.html b/public/vendor/codemirror/mode/apl/index.html
index 53dda6b5..53dda6b5 100755..100644
--- a/public/vendor/codemirror/mode/apl/index.html
+++ b/public/vendor/codemirror/mode/apl/index.html
diff --git a/public/vendor/codemirror/mode/asciiarmor/asciiarmor.js b/public/vendor/codemirror/mode/asciiarmor/asciiarmor.js
index d8309037..d8309037 100755..100644
--- a/public/vendor/codemirror/mode/asciiarmor/asciiarmor.js
+++ b/public/vendor/codemirror/mode/asciiarmor/asciiarmor.js
diff --git a/public/vendor/codemirror/mode/asciiarmor/index.html b/public/vendor/codemirror/mode/asciiarmor/index.html
index 8ba1b5c7..8ba1b5c7 100755..100644
--- a/public/vendor/codemirror/mode/asciiarmor/index.html
+++ b/public/vendor/codemirror/mode/asciiarmor/index.html
diff --git a/public/vendor/codemirror/mode/asn.1/asn.1.js b/public/vendor/codemirror/mode/asn.1/asn.1.js
index 9600247e..9600247e 100755..100644
--- a/public/vendor/codemirror/mode/asn.1/asn.1.js
+++ b/public/vendor/codemirror/mode/asn.1/asn.1.js
diff --git a/public/vendor/codemirror/mode/asn.1/index.html b/public/vendor/codemirror/mode/asn.1/index.html
index 8346f8e5..699fd447 100755..100644
--- a/public/vendor/codemirror/mode/asn.1/index.html
+++ b/public/vendor/codemirror/mode/asn.1/index.html
@@ -1,4 +1,4 @@
-<!doctype html>
+<!doctype html>
<title>CodeMirror: ASN.1 mode</title>
<meta charset="utf-8"/>
@@ -73,6 +73,5 @@
<p>The development of this mode has been sponsored by <a href="http://www.ericsson.com/">Ericsson
</a>.</p>
<p>Coded by Asmelash Tsegay Gebretsadkan </p>
- </article>
</article>
diff --git a/public/vendor/codemirror/mode/asterisk/asterisk.js b/public/vendor/codemirror/mode/asterisk/asterisk.js
index b7ebfc5a..b7ebfc5a 100755..100644
--- a/public/vendor/codemirror/mode/asterisk/asterisk.js
+++ b/public/vendor/codemirror/mode/asterisk/asterisk.js
diff --git a/public/vendor/codemirror/mode/asterisk/index.html b/public/vendor/codemirror/mode/asterisk/index.html
index 257bd398..257bd398 100755..100644
--- a/public/vendor/codemirror/mode/asterisk/index.html
+++ b/public/vendor/codemirror/mode/asterisk/index.html
diff --git a/public/vendor/codemirror/mode/brainfuck/brainfuck.js b/public/vendor/codemirror/mode/brainfuck/brainfuck.js
new file mode 100644
index 00000000..3becf2a5
--- /dev/null
+++ b/public/vendor/codemirror/mode/brainfuck/brainfuck.js
@@ -0,0 +1,85 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+// Brainfuck mode created by Michael Kaminsky https://github.com/mkaminsky11
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object")
+ mod(require("../../lib/codemirror"))
+ else if (typeof define == "function" && define.amd)
+ define(["../../lib/codemirror"], mod)
+ else
+ mod(CodeMirror)
+})(function(CodeMirror) {
+ "use strict"
+ var reserve = "><+-.,[]".split("");
+ /*
+ comments can be either:
+ placed behind lines
+
+ +++ this is a comment
+
+ where reserved characters cannot be used
+ or in a loop
+ [
+ this is ok to use [ ] and stuff
+ ]
+ or preceded by #
+ */
+ CodeMirror.defineMode("brainfuck", function() {
+ return {
+ startState: function() {
+ return {
+ commentLine: false,
+ left: 0,
+ right: 0,
+ commentLoop: false
+ }
+ },
+ token: function(stream, state) {
+ if (stream.eatSpace()) return null
+ if(stream.sol()){
+ state.commentLine = false;
+ }
+ var ch = stream.next().toString();
+ if(reserve.indexOf(ch) !== -1){
+ if(state.commentLine === true){
+ if(stream.eol()){
+ state.commentLine = false;
+ }
+ return "comment";
+ }
+ if(ch === "]" || ch === "["){
+ if(ch === "["){
+ state.left++;
+ }
+ else{
+ state.right++;
+ }
+ return "bracket";
+ }
+ else if(ch === "+" || ch === "-"){
+ return "keyword";
+ }
+ else if(ch === "<" || ch === ">"){
+ return "atom";
+ }
+ else if(ch === "." || ch === ","){
+ return "def";
+ }
+ }
+ else{
+ state.commentLine = true;
+ if(stream.eol()){
+ state.commentLine = false;
+ }
+ return "comment";
+ }
+ if(stream.eol()){
+ state.commentLine = false;
+ }
+ }
+ };
+ });
+CodeMirror.defineMIME("text/x-brainfuck","brainfuck")
+});
diff --git a/public/vendor/codemirror/mode/brainfuck/index.html b/public/vendor/codemirror/mode/brainfuck/index.html
new file mode 100644
index 00000000..6048fc24
--- /dev/null
+++ b/public/vendor/codemirror/mode/brainfuck/index.html
@@ -0,0 +1,85 @@
+<!doctype html>
+
+<title>CodeMirror: Brainfuck mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/edit/matchbrackets.js"></script>
+<script src="./brainfuck.js"></script>
+<style>
+ .CodeMirror { border: 2px inset #dee; }
+ </style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#"></a>
+ </ul>
+</div>
+
+<article>
+<h2>Brainfuck mode</h2>
+<form><textarea id="code" name="code">
+[ This program prints "Hello World!" and a newline to the screen, its
+ length is 106 active command characters [it is not the shortest.]
+
+ This loop is a "comment loop", it's a simple way of adding a comment
+ to a BF program such that you don't have to worry about any command
+ characters. Any ".", ",", "+", "-", "&lt;" and "&gt;" characters are simply
+ ignored, the "[" and "]" characters just have to be balanced.
+]
++++++ +++ Set Cell #0 to 8
+[
+ &gt;++++ Add 4 to Cell #1; this will always set Cell #1 to 4
+ [ as the cell will be cleared by the loop
+ &gt;++ Add 2 to Cell #2
+ &gt;+++ Add 3 to Cell #3
+ &gt;+++ Add 3 to Cell #4
+ &gt;+ Add 1 to Cell #5
+ &lt;&lt;&lt;&lt;- Decrement the loop counter in Cell #1
+ ] Loop till Cell #1 is zero; number of iterations is 4
+ &gt;+ Add 1 to Cell #2
+ &gt;+ Add 1 to Cell #3
+ &gt;- Subtract 1 from Cell #4
+ &gt;&gt;+ Add 1 to Cell #6
+ [&lt;] Move back to the first zero cell you find; this will
+ be Cell #1 which was cleared by the previous loop
+ &lt;- Decrement the loop Counter in Cell #0
+] Loop till Cell #0 is zero; number of iterations is 8
+
+The result of this is:
+Cell No : 0 1 2 3 4 5 6
+Contents: 0 0 72 104 88 32 8
+Pointer : ^
+
+&gt;&gt;. Cell #2 has value 72 which is 'H'
+&gt;---. Subtract 3 from Cell #3 to get 101 which is 'e'
++++++++..+++. Likewise for 'llo' from Cell #3
+&gt;&gt;. Cell #5 is 32 for the space
+&lt;-. Subtract 1 from Cell #4 for 87 to give a 'W'
+&lt;. Cell #3 was set to 'o' from the end of 'Hello'
++++.------.--------. Cell #3 for 'rl' and 'd'
+&gt;&gt;+. Add 1 to Cell #5 gives us an exclamation point
+&gt;++. And finally a newline from Cell #6
+</textarea></form>
+
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ matchBrackets: true,
+ mode: "text/x-brainfuck"
+ });
+ </script>
+
+ <p>A mode for Brainfuck</p>
+
+ <p><strong>MIME types defined:</strong> <code>text/x-brainfuck</code></p>
+ </article>
diff --git a/public/vendor/codemirror/mode/clike/clike.js b/public/vendor/codemirror/mode/clike/clike.js
index f1a7e7a9..4f5c0cf3 100755..100644
--- a/public/vendor/codemirror/mode/clike/clike.js
+++ b/public/vendor/codemirror/mode/clike/clike.js
@@ -25,8 +25,12 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
multiLineStrings = parserConfig.multiLineStrings,
indentStatements = parserConfig.indentStatements !== false,
indentSwitch = parserConfig.indentSwitch !== false,
- namespaceSeparator = parserConfig.namespaceSeparator;
- var isOperatorChar = /[+\-*&%=<>!?|\/]/;
+ namespaceSeparator = parserConfig.namespaceSeparator,
+ isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/,
+ numberStart = parserConfig.numberStart || /[\d\.]/,
+ number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,
+ isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/,
+ endStatement = parserConfig.endStatement || /^[;:,]$/;
var curPunc, isDefKeyword;
@@ -40,13 +44,14 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
state.tokenize = tokenString(ch);
return state.tokenize(stream, state);
}
- if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
+ if (isPunctuationChar.test(ch)) {
curPunc = ch;
return null;
}
- if (/\d/.test(ch)) {
- stream.eatWhile(/[\w\.]/);
- return "number";
+ if (numberStart.test(ch)) {
+ stream.backUp(1)
+ if (stream.match(number)) return "number"
+ stream.next()
}
if (ch == "/") {
if (stream.eat("*")) {
@@ -67,17 +72,17 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
var cur = stream.current();
- if (keywords.propertyIsEnumerable(cur)) {
- if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
- if (defKeywords.propertyIsEnumerable(cur)) isDefKeyword = true;
+ if (contains(keywords, cur)) {
+ if (contains(blockKeywords, cur)) curPunc = "newstatement";
+ if (contains(defKeywords, cur)) isDefKeyword = true;
return "keyword";
}
- if (types.propertyIsEnumerable(cur)) return "variable-3";
- if (builtin.propertyIsEnumerable(cur)) {
- if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
+ if (contains(types, cur)) return "variable-3";
+ if (contains(builtin, cur)) {
+ if (contains(blockKeywords, cur)) curPunc = "newstatement";
return "builtin";
}
- if (atoms.propertyIsEnumerable(cur)) return "atom";
+ if (contains(atoms, cur)) return "atom";
return "variable";
}
@@ -168,8 +173,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
if (style == "comment" || style == "meta") return style;
if (ctx.align == null) ctx.align = true;
- if ((curPunc == ";" || curPunc == ":" || curPunc == ","))
- while (isStatement(state.context.type)) popContext(state);
+ if (endStatement.test(curPunc)) while (isStatement(state.context.type)) popContext(state);
else if (curPunc == "{") pushContext(state, stream.column(), "}");
else if (curPunc == "[") pushContext(state, stream.column(), "]");
else if (curPunc == "(") pushContext(state, stream.column(), ")");
@@ -212,8 +216,16 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
if (isStatement(ctx.type) && firstChar == "}") ctx = ctx.prev;
+ if (hooks.indent) {
+ var hook = hooks.indent(state, ctx, textAfter);
+ if (typeof hook == "number") return hook
+ }
var closing = firstChar == ctx.type;
var switchBlock = ctx.prev && ctx.prev.type == "switchstatement";
+ if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
+ while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev
+ return ctx.indented
+ }
if (isStatement(ctx.type))
return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
@@ -238,27 +250,30 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
return obj;
}
+ function contains(words, word) {
+ if (typeof words === "function") {
+ return words(word);
+ } else {
+ return words.propertyIsEnumerable(word);
+ }
+ }
var cKeywords = "auto if break case register continue return default do sizeof " +
- "static else struct switch extern typedef float union for " +
- "goto while enum const volatile";
+ "static else struct switch extern typedef union for goto while enum const volatile";
var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t";
function cppHook(stream, state) {
- if (!state.startOfLine) return false;
- for (;;) {
- if (stream.skipTo("\\")) {
- stream.next();
- if (stream.eol()) {
- state.tokenize = cppHook;
- break;
- }
- } else {
- stream.skipToEnd();
- state.tokenize = null;
- break;
+ if (!state.startOfLine) return false
+ for (var ch, next = null; ch = stream.peek();) {
+ if (ch == "\\" && stream.match(/^.$/)) {
+ next = cppHook
+ break
+ } else if (ch == "/" && stream.match(/^\/[\/\*]/, false)) {
+ break
}
+ stream.next()
}
- return "meta";
+ state.tokenize = next
+ return "meta"
}
function pointerHook(_stream, state) {
@@ -266,6 +281,11 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
return false;
}
+ function cpp14Literal(stream) {
+ stream.eatWhile(/[\w\.']/);
+ return "number";
+ }
+
function cpp11StringHook(stream, state) {
stream.backUp(1);
// Raw strings.
@@ -373,6 +393,16 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
"U": cpp11StringHook,
"L": cpp11StringHook,
"R": cpp11StringHook,
+ "0": cpp14Literal,
+ "1": cpp14Literal,
+ "2": cpp14Literal,
+ "3": cpp14Literal,
+ "4": cpp14Literal,
+ "5": cpp14Literal,
+ "6": cpp14Literal,
+ "7": cpp14Literal,
+ "8": cpp14Literal,
+ "9": cpp14Literal,
token: function(stream, state, style) {
if (style == "variable" && stream.peek() == "(" &&
(state.prevToken == ";" || state.prevToken == null ||
@@ -398,6 +428,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
defKeywords: words("class interface package enum"),
typeFirstDefinitions: true,
atoms: words("true false null"),
+ endStatement: /^[;:]$/,
hooks: {
"@": function(stream) {
stream.eatWhile(/[\w\$_]/);
@@ -453,7 +484,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
keywords: words(
/* scala */
- "abstract case catch class def do else extends false final finally for forSome if " +
+ "abstract case catch class def do else extends final finally for forSome if " +
"implicit import lazy match new null object override package private protected return " +
"sealed super this throw trait try type val var while with yield _ : = => <- <: " +
"<% >: # @ " +
@@ -501,6 +532,59 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
modeProps: {closeBrackets: {triples: '"'}}
});
+ function tokenKotlinString(tripleString){
+ return function (stream, state) {
+ var escaped = false, next, end = false;
+ while (!stream.eol()) {
+ if (!tripleString && !escaped && stream.match('"') ) {end = true; break;}
+ if (tripleString && stream.match('"""')) {end = true; break;}
+ next = stream.next();
+ if(!escaped && next == "$" && stream.match('{'))
+ stream.skipTo("}");
+ escaped = !escaped && next == "\\" && !tripleString;
+ }
+ if (end || !tripleString)
+ state.tokenize = null;
+ return "string";
+ }
+ }
+
+ def("text/x-kotlin", {
+ name: "clike",
+ keywords: words(
+ /*keywords*/
+ "package as typealias class interface this super val " +
+ "var fun for is in This throw return " +
+ "break continue object if else while do try when !in !is as? " +
+
+ /*soft keywords*/
+ "file import where by get set abstract enum open inner override private public internal " +
+ "protected catch finally out final vararg reified dynamic companion constructor init " +
+ "sealed field property receiver param sparam lateinit data inline noinline tailrec " +
+ "external annotation crossinline const operator infix"
+ ),
+ types: words(
+ /* package java.lang */
+ "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
+ "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
+ "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
+ "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
+ ),
+ intendSwitch: false,
+ indentStatements: false,
+ multiLineStrings: true,
+ blockKeywords: words("catch class do else finally for if where try while enum"),
+ defKeywords: words("class val var object package interface fun"),
+ atoms: words("true false null this"),
+ hooks: {
+ '"': function(stream, state) {
+ state.tokenize = tokenKotlinString(stream.match('""'));
+ return state.tokenize(stream, state);
+ }
+ },
+ modeProps: {closeBrackets: {triples: '"'}}
+ });
+
def(["x-shader/x-vertex", "x-shader/x-fragment"], {
name: "clike",
keywords: words("sampler1D sampler2D sampler3D samplerCube " +
@@ -583,9 +667,106 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
stream.eatWhile(/[\w\$]/);
return "keyword";
},
- "#": cppHook
+ "#": cppHook,
+ indent: function(_state, ctx, textAfter) {
+ if (ctx.type == "statement" && /^@\w/.test(textAfter)) return ctx.indented
+ }
},
modeProps: {fold: "brace"}
});
+ def("text/x-squirrel", {
+ name: "clike",
+ keywords: words("base break clone continue const default delete enum extends function in class" +
+ " foreach local resume return this throw typeof yield constructor instanceof static"),
+ types: words(cTypes),
+ blockKeywords: words("case catch class else for foreach if switch try while"),
+ defKeywords: words("function local class"),
+ typeFirstDefinitions: true,
+ atoms: words("true false null"),
+ hooks: {"#": cppHook},
+ modeProps: {fold: ["brace", "include"]}
+ });
+
+ // Ceylon Strings need to deal with interpolation
+ var stringTokenizer = null;
+ function tokenCeylonString(type) {
+ return function(stream, state) {
+ var escaped = false, next, end = false;
+ while (!stream.eol()) {
+ if (!escaped && stream.match('"') &&
+ (type == "single" || stream.match('""'))) {
+ end = true;
+ break;
+ }
+ if (!escaped && stream.match('``')) {
+ stringTokenizer = tokenCeylonString(type);
+ end = true;
+ break;
+ }
+ next = stream.next();
+ escaped = type == "single" && !escaped && next == "\\";
+ }
+ if (end)
+ state.tokenize = null;
+ return "string";
+ }
+ }
+
+ def("text/x-ceylon", {
+ name: "clike",
+ keywords: words("abstracts alias assembly assert assign break case catch class continue dynamic else" +
+ " exists extends finally for function given if import in interface is let module new" +
+ " nonempty object of out outer package return satisfies super switch then this throw" +
+ " try value void while"),
+ types: function(word) {
+ // In Ceylon all identifiers that start with an uppercase are types
+ var first = word.charAt(0);
+ return (first === first.toUpperCase() && first !== first.toLowerCase());
+ },
+ blockKeywords: words("case catch class dynamic else finally for function if interface module new object switch try while"),
+ defKeywords: words("class dynamic function interface module object package value"),
+ builtin: words("abstract actual aliased annotation by default deprecated doc final formal late license" +
+ " native optional sealed see serializable shared suppressWarnings tagged throws variable"),
+ isPunctuationChar: /[\[\]{}\(\),;\:\.`]/,
+ isOperatorChar: /[+\-*&%=<>!?|^~:\/]/,
+ numberStart: /[\d#$]/,
+ number: /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,
+ multiLineStrings: true,
+ typeFirstDefinitions: true,
+ atoms: words("true false null larger smaller equal empty finished"),
+ indentSwitch: false,
+ styleDefs: false,
+ hooks: {
+ "@": function(stream) {
+ stream.eatWhile(/[\w\$_]/);
+ return "meta";
+ },
+ '"': function(stream, state) {
+ state.tokenize = tokenCeylonString(stream.match('""') ? "triple" : "single");
+ return state.tokenize(stream, state);
+ },
+ '`': function(stream, state) {
+ if (!stringTokenizer || !stream.match('`')) return false;
+ state.tokenize = stringTokenizer;
+ stringTokenizer = null;
+ return state.tokenize(stream, state);
+ },
+ "'": function(stream) {
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
+ return "atom";
+ },
+ token: function(_stream, state, style) {
+ if ((style == "variable" || style == "variable-3") &&
+ state.prevToken == ".") {
+ return "variable-2";
+ }
+ }
+ },
+ modeProps: {
+ fold: ["brace", "import"],
+ closeBrackets: {triples: '"'}
+ }
+ });
+
});
diff --git a/public/vendor/codemirror/mode/clike/index.html b/public/vendor/codemirror/mode/clike/index.html
index 8b386d22..45c670ae 100755..100644
--- a/public/vendor/codemirror/mode/clike/index.html
+++ b/public/vendor/codemirror/mode/clike/index.html
@@ -206,6 +206,103 @@ object FilterTest extends App {
}
</textarea></div>
+<h2>Kotlin mode</h2>
+
+<div><textarea id="kotlin-code">
+package org.wasabi.http
+
+import java.util.concurrent.Executors
+import java.net.InetSocketAddress
+import org.wasabi.app.AppConfiguration
+import io.netty.bootstrap.ServerBootstrap
+import io.netty.channel.nio.NioEventLoopGroup
+import io.netty.channel.socket.nio.NioServerSocketChannel
+import org.wasabi.app.AppServer
+
+public class HttpServer(private val appServer: AppServer) {
+
+ val bootstrap: ServerBootstrap
+ val primaryGroup: NioEventLoopGroup
+ val workerGroup: NioEventLoopGroup
+
+ init {
+ // Define worker groups
+ primaryGroup = NioEventLoopGroup()
+ workerGroup = NioEventLoopGroup()
+
+ // Initialize bootstrap of server
+ bootstrap = ServerBootstrap()
+
+ bootstrap.group(primaryGroup, workerGroup)
+ bootstrap.channel(javaClass<NioServerSocketChannel>())
+ bootstrap.childHandler(NettyPipelineInitializer(appServer))
+ }
+
+ public fun start(wait: Boolean = true) {
+ val channel = bootstrap.bind(appServer.configuration.port)?.sync()?.channel()
+
+ if (wait) {
+ channel?.closeFuture()?.sync()
+ }
+ }
+
+ public fun stop() {
+ // Shutdown all event loops
+ primaryGroup.shutdownGracefully()
+ workerGroup.shutdownGracefully()
+
+ // Wait till all threads are terminated
+ primaryGroup.terminationFuture().sync()
+ workerGroup.terminationFuture().sync()
+ }
+}
+</textarea></div>
+
+<h2>Ceylon mode</h2>
+
+<div><textarea id="ceylon-code">
+"Produces the [[stream|Iterable]] that results from repeated
+ application of the given [[function|next]] to the given
+ [[first]] element of the stream, until the function first
+ returns [[finished]]. If the given function never returns
+ `finished`, the resulting stream is infinite.
+
+ For example:
+
+ loop(0)(2.plus).takeWhile(10.largerThan)
+
+ produces the stream `{ 0, 2, 4, 6, 8 }`."
+tagged("Streams")
+shared {Element+} loop&lt;Element&gt;(
+ "The first element of the resulting stream."
+ Element first)(
+ "The function that produces the next element of the
+ stream, given the current element. The function may
+ return [[finished]] to indicate the end of the
+ stream."
+ Element|Finished next(Element element))
+ =&gt; let (start = first)
+ object satisfies {Element+} {
+ first =&gt; start;
+ empty =&gt; false;
+ function nextElement(Element element)
+ =&gt; next(element);
+ iterator()
+ =&gt; object satisfies Iterator&lt;Element&gt; {
+ variable Element|Finished current = start;
+ shared actual Element|Finished next() {
+ if (!is Finished result = current) {
+ current = nextElement(result);
+ return result;
+ }
+ else {
+ return finished;
+ }
+ }
+ };
+ };
+</textarea></div>
+
<script>
var cEditor = CodeMirror.fromTextArea(document.getElementById("c-code"), {
lineNumbers: true,
@@ -232,6 +329,16 @@ object FilterTest extends App {
matchBrackets: true,
mode: "text/x-scala"
});
+ var kotlinEditor = CodeMirror.fromTextArea(document.getElementById("kotlin-code"), {
+ lineNumbers: true,
+ matchBrackets: true,
+ mode: "text/x-kotlin"
+ });
+ var ceylonEditor = CodeMirror.fromTextArea(document.getElementById("ceylon-code"), {
+ lineNumbers: true,
+ matchBrackets: true,
+ mode: "text/x-ceylon"
+ });
var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
</script>
@@ -247,5 +354,7 @@ object FilterTest extends App {
(Java), <code>text/x-csharp</code> (C#),
<code>text/x-objectivec</code> (Objective-C),
<code>text/x-scala</code> (Scala), <code>text/x-vertex</code>
- and <code>x-shader/x-fragment</code> (shader programs).</p>
+ <code>x-shader/x-fragment</code> (shader programs),
+ <code>text/x-squirrel</code> (Squirrel) and
+ <code>text/x-ceylon</code> (Ceylon)</p>
</article>
diff --git a/public/vendor/codemirror/mode/clike/scala.html b/public/vendor/codemirror/mode/clike/scala.html
index aa04cf0f..aa04cf0f 100755..100644
--- a/public/vendor/codemirror/mode/clike/scala.html
+++ b/public/vendor/codemirror/mode/clike/scala.html
diff --git a/public/vendor/codemirror/mode/clike/test.js b/public/vendor/codemirror/mode/clike/test.js
index 79b006de..c2600326 100755..100644
--- a/public/vendor/codemirror/mode/clike/test.js
+++ b/public/vendor/codemirror/mode/clike/test.js
@@ -30,4 +30,22 @@
" [keyword for] (;;)",
" [variable x][operator ++];",
"[keyword return];");
+
+ MT("preprocessor",
+ "[meta #define FOO 3]",
+ "[variable-3 int] [variable foo];",
+ "[meta #define BAR\\]",
+ "[meta 4]",
+ "[variable-3 unsigned] [variable-3 int] [variable bar] [operator =] [number 8];",
+ "[meta #include <baz> ][comment // comment]")
+
+
+ var mode_cpp = CodeMirror.getMode({indentUnit: 2}, "text/x-c++src");
+ function MTCPP(name) { test.mode(name, mode_cpp, Array.prototype.slice.call(arguments, 1)); }
+
+ MTCPP("cpp14_literal",
+ "[number 10'000];",
+ "[number 0b10'000];",
+ "[number 0x10'000];",
+ "[string '100000'];");
})();
diff --git a/public/vendor/codemirror/mode/clojure/clojure.js b/public/vendor/codemirror/mode/clojure/clojure.js
index d531022a..44948d04 100755..100644
--- a/public/vendor/codemirror/mode/clojure/clojure.js
+++ b/public/vendor/codemirror/mode/clojure/clojure.js
@@ -96,6 +96,9 @@ CodeMirror.defineMode("clojure", function (options) {
if ( '.' == stream.peek() ) {
stream.eat('.');
stream.eatWhile(tests.digit);
+ } else if ('/' == stream.peek() ) {
+ stream.eat('/');
+ stream.eatWhile(tests.digit);
}
if ( stream.eat(tests.exponent) ) {
diff --git a/public/vendor/codemirror/mode/clojure/index.html b/public/vendor/codemirror/mode/clojure/index.html
index 3ecf4c48..81294bc1 100755..100644
--- a/public/vendor/codemirror/mode/clojure/index.html
+++ b/public/vendor/codemirror/mode/clojure/index.html
@@ -78,6 +78,9 @@
\tab \return \backspace
\u1000 \uAaAa \u9F9F)
+;; Let's play with numbers
+(+ 1 -1 1/2 -1/2 -0.5 0.5)
+
</textarea></form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
diff --git a/public/vendor/codemirror/mode/cmake/cmake.js b/public/vendor/codemirror/mode/cmake/cmake.js
index 9f9eda54..9f9eda54 100755..100644
--- a/public/vendor/codemirror/mode/cmake/cmake.js
+++ b/public/vendor/codemirror/mode/cmake/cmake.js
diff --git a/public/vendor/codemirror/mode/cmake/index.html b/public/vendor/codemirror/mode/cmake/index.html
index ed114fec..ed114fec 100755..100644
--- a/public/vendor/codemirror/mode/cmake/index.html
+++ b/public/vendor/codemirror/mode/cmake/index.html
diff --git a/public/vendor/codemirror/mode/cobol/cobol.js b/public/vendor/codemirror/mode/cobol/cobol.js
index 897022b1..897022b1 100755..100644
--- a/public/vendor/codemirror/mode/cobol/cobol.js
+++ b/public/vendor/codemirror/mode/cobol/cobol.js
diff --git a/public/vendor/codemirror/mode/cobol/index.html b/public/vendor/codemirror/mode/cobol/index.html
index 4352419a..4352419a 100755..100644
--- a/public/vendor/codemirror/mode/cobol/index.html
+++ b/public/vendor/codemirror/mode/cobol/index.html
diff --git a/public/vendor/codemirror/mode/coffeescript/coffeescript.js b/public/vendor/codemirror/mode/coffeescript/coffeescript.js
index da0eb2d5..adf2184f 100755..100644
--- a/public/vendor/codemirror/mode/coffeescript/coffeescript.js
+++ b/public/vendor/codemirror/mode/coffeescript/coffeescript.js
@@ -25,7 +25,7 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
var operators = /^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/;
var delimiters = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/;
var identifiers = /^[_A-Za-z$][_A-Za-z$0-9]*/;
- var properties = /^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/;
+ var atProp = /^@[_A-Za-z$][_A-Za-z$0-9]*/;
var wordOperators = wordRegexp(["and", "or", "not",
"is", "isnt", "in",
@@ -145,6 +145,8 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
}
}
+
+
// Handle operators and delimiters
if (stream.match(operators) || stream.match(wordOperators)) {
return "operator";
@@ -157,6 +159,10 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
return "atom";
}
+ if (stream.match(atProp) || state.prop && stream.match(identifiers)) {
+ return "property";
+ }
+
if (stream.match(keywords)) {
return "keyword";
}
@@ -165,10 +171,6 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
return "variable";
}
- if (stream.match(properties)) {
- return "property";
- }
-
// Handle non-detected items
stream.next();
return ERRORCLASS;
@@ -265,24 +267,11 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
var style = state.tokenize(stream, state);
var current = stream.current();
- // Handle "." connected identifiers
- if (current === ".") {
- style = state.tokenize(stream, state);
- current = stream.current();
- if (/^\.[\w$]+$/.test(current)) {
- return "variable";
- } else {
- return ERRORCLASS;
- }
- }
-
// Handle scope changes.
if (current === "return") {
state.dedent = true;
}
- if (((current === "->" || current === "=>") &&
- !state.lambda &&
- !stream.peek())
+ if (((current === "->" || current === "=>") && stream.eol())
|| style === "indent") {
indent(stream, state);
}
@@ -324,8 +313,7 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
return {
tokenize: tokenBase,
scope: {offset:basecolumn || 0, type:"coffee", prev: null, align: false},
- lastToken: null,
- lambda: false,
+ prop: false,
dedent: 0
};
},
@@ -335,12 +323,9 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
if (fillAlign && stream.sol()) fillAlign.align = false;
var style = tokenLexer(stream, state);
- if (fillAlign && style && style != "comment") fillAlign.align = true;
-
- state.lastToken = {style:style, content: stream.current()};
-
- if (stream.eol() && stream.lambda) {
- state.lambda = false;
+ if (style && style != "comment") {
+ if (fillAlign) fillAlign.align = true;
+ state.prop = style == "punctuation" && stream.current() == "."
}
return style;
@@ -365,5 +350,6 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
});
CodeMirror.defineMIME("text/x-coffeescript", "coffeescript");
+CodeMirror.defineMIME("text/coffeescript", "coffeescript");
});
diff --git a/public/vendor/codemirror/mode/coffeescript/index.html b/public/vendor/codemirror/mode/coffeescript/index.html
index 93a5f4f3..93a5f4f3 100755..100644
--- a/public/vendor/codemirror/mode/coffeescript/index.html
+++ b/public/vendor/codemirror/mode/coffeescript/index.html
diff --git a/public/vendor/codemirror/mode/commonlisp/commonlisp.js b/public/vendor/codemirror/mode/commonlisp/commonlisp.js
index fb1f99c6..fb1f99c6 100755..100644
--- a/public/vendor/codemirror/mode/commonlisp/commonlisp.js
+++ b/public/vendor/codemirror/mode/commonlisp/commonlisp.js
diff --git a/public/vendor/codemirror/mode/commonlisp/index.html b/public/vendor/codemirror/mode/commonlisp/index.html
index f2bf4522..f2bf4522 100755..100644
--- a/public/vendor/codemirror/mode/commonlisp/index.html
+++ b/public/vendor/codemirror/mode/commonlisp/index.html
diff --git a/public/vendor/codemirror/mode/crystal/crystal.js b/public/vendor/codemirror/mode/crystal/crystal.js
new file mode 100644
index 00000000..2e74bee4
--- /dev/null
+++ b/public/vendor/codemirror/mode/crystal/crystal.js
@@ -0,0 +1,391 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+ "use strict";
+
+ CodeMirror.defineMode("crystal", function(config) {
+ function wordRegExp(words, end) {
+ return new RegExp((end ? "" : "^") + "(?:" + words.join("|") + ")" + (end ? "$" : "\\b"));
+ }
+
+ function chain(tokenize, stream, state) {
+ state.tokenize.push(tokenize);
+ return tokenize(stream, state);
+ }
+
+ var operators = /^(?:[-+/%|&^]|\*\*?|[<>]{2})/;
+ var conditionalOperators = /^(?:[=!]~|===|<=>|[<>=!]=?|[|&]{2}|~)/;
+ var indexingOperators = /^(?:\[\][?=]?)/;
+ var anotherOperators = /^(?:\.(?:\.{2})?|->|[?:])/;
+ var idents = /^[a-z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/;
+ var types = /^[A-Z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/;
+ var keywords = wordRegExp([
+ "abstract", "alias", "as", "asm", "begin", "break", "case", "class", "def", "do",
+ "else", "elsif", "end", "ensure", "enum", "extend", "for", "fun", "if", "ifdef",
+ "include", "instance_sizeof", "lib", "macro", "module", "next", "of", "out", "pointerof",
+ "private", "protected", "rescue", "return", "require", "sizeof", "struct",
+ "super", "then", "type", "typeof", "union", "unless", "until", "when", "while", "with",
+ "yield", "__DIR__", "__FILE__", "__LINE__"
+ ]);
+ var atomWords = wordRegExp(["true", "false", "nil", "self"]);
+ var indentKeywordsArray = [
+ "def", "fun", "macro",
+ "class", "module", "struct", "lib", "enum", "union",
+ "if", "unless", "case", "while", "until", "begin", "then",
+ "do",
+ "for", "ifdef"
+ ];
+ var indentKeywords = wordRegExp(indentKeywordsArray);
+ var dedentKeywordsArray = [
+ "end",
+ "else", "elsif",
+ "rescue", "ensure"
+ ];
+ var dedentKeywords = wordRegExp(dedentKeywordsArray);
+ var dedentPunctualsArray = ["\\)", "\\}", "\\]"];
+ var dedentPunctuals = new RegExp("^(?:" + dedentPunctualsArray.join("|") + ")$");
+ var nextTokenizer = {
+ "def": tokenFollowIdent, "fun": tokenFollowIdent, "macro": tokenMacroDef,
+ "class": tokenFollowType, "module": tokenFollowType, "struct": tokenFollowType,
+ "lib": tokenFollowType, "enum": tokenFollowType, "union": tokenFollowType
+ };
+ var matching = {"[": "]", "{": "}", "(": ")", "<": ">"};
+
+ function tokenBase(stream, state) {
+ if (stream.eatSpace()) {
+ return null;
+ }
+
+ // Macros
+ if (state.lastToken != "\\" && stream.match("{%", false)) {
+ return chain(tokenMacro("%", "%"), stream, state);
+ }
+
+ if (state.lastToken != "\\" && stream.match("{{", false)) {
+ return chain(tokenMacro("{", "}"), stream, state);
+ }
+
+ // Comments
+ if (stream.peek() == "#") {
+ stream.skipToEnd();
+ return "comment";
+ }
+
+ // Variables and keywords
+ var matched;
+ if (stream.match(idents)) {
+ stream.eat(/[?!]/);
+
+ matched = stream.current();
+ if (stream.eat(":")) {
+ return "atom";
+ } else if (state.lastToken == ".") {
+ return "property";
+ } else if (keywords.test(matched)) {
+ if (state.lastToken != "abstract" && indentKeywords.test(matched)) {
+ if (!(matched == "fun" && state.blocks.indexOf("lib") >= 0)) {
+ state.blocks.push(matched);
+ state.currentIndent += 1;
+ }
+ } else if (dedentKeywords.test(matched)) {
+ state.blocks.pop();
+ state.currentIndent -= 1;
+ }
+
+ if (nextTokenizer.hasOwnProperty(matched)) {
+ state.tokenize.push(nextTokenizer[matched]);
+ }
+
+ return "keyword";
+ } else if (atomWords.test(matched)) {
+ return "atom";
+ }
+
+ return "variable";
+ }
+
+ // Class variables and instance variables
+ // or attributes
+ if (stream.eat("@")) {
+ if (stream.peek() == "[") {
+ return chain(tokenNest("[", "]", "meta"), stream, state);
+ }
+
+ stream.eat("@");
+ stream.match(idents) || stream.match(types);
+ return "variable-2";
+ }
+
+ // Global variables
+ if (stream.eat("$")) {
+ stream.eat(/[0-9]+|\?/) || stream.match(idents) || stream.match(types);
+ return "variable-3";
+ }
+
+ // Constants and types
+ if (stream.match(types)) {
+ return "tag";
+ }
+
+ // Symbols or ':' operator
+ if (stream.eat(":")) {
+ if (stream.eat("\"")) {
+ return chain(tokenQuote("\"", "atom", false), stream, state);
+ } else if (stream.match(idents) || stream.match(types) ||
+ stream.match(operators) || stream.match(conditionalOperators) || stream.match(indexingOperators)) {
+ return "atom";
+ }
+ stream.eat(":");
+ return "operator";
+ }
+
+ // Strings
+ if (stream.eat("\"")) {
+ return chain(tokenQuote("\"", "string", true), stream, state);
+ }
+
+ // Strings or regexps or macro variables or '%' operator
+ if (stream.peek() == "%") {
+ var style = "string";
+ var embed = true;
+ var delim;
+
+ if (stream.match("%r")) {
+ // Regexps
+ style = "string-2";
+ delim = stream.next();
+ } else if (stream.match("%w")) {
+ embed = false;
+ delim = stream.next();
+ } else {
+ if(delim = stream.match(/^%([^\w\s=])/)) {
+ delim = delim[1];
+ } else if (stream.match(/^%[a-zA-Z0-9_\u009F-\uFFFF]*/)) {
+ // Macro variables
+ return "meta";
+ } else {
+ // '%' operator
+ return "operator";
+ }
+ }
+
+ if (matching.hasOwnProperty(delim)) {
+ delim = matching[delim];
+ }
+ return chain(tokenQuote(delim, style, embed), stream, state);
+ }
+
+ // Characters
+ if (stream.eat("'")) {
+ stream.match(/^(?:[^']|\\(?:[befnrtv0'"]|[0-7]{3}|u(?:[0-9a-fA-F]{4}|\{[0-9a-fA-F]{1,6}\})))/);
+ stream.eat("'");
+ return "atom";
+ }
+
+ // Numbers
+ if (stream.eat("0")) {
+ if (stream.eat("x")) {
+ stream.match(/^[0-9a-fA-F]+/);
+ } else if (stream.eat("o")) {
+ stream.match(/^[0-7]+/);
+ } else if (stream.eat("b")) {
+ stream.match(/^[01]+/);
+ }
+ return "number";
+ }
+
+ if (stream.eat(/\d/)) {
+ stream.match(/^\d*(?:\.\d+)?(?:[eE][+-]?\d+)?/);
+ return "number";
+ }
+
+ // Operators
+ if (stream.match(operators)) {
+ stream.eat("="); // Operators can follow assigin symbol.
+ return "operator";
+ }
+
+ if (stream.match(conditionalOperators) || stream.match(anotherOperators)) {
+ return "operator";
+ }
+
+ // Parens and braces
+ if (matched = stream.match(/[({[]/, false)) {
+ matched = matched[0];
+ return chain(tokenNest(matched, matching[matched], null), stream, state);
+ }
+
+ // Escapes
+ if (stream.eat("\\")) {
+ stream.next();
+ return "meta";
+ }
+
+ stream.next();
+ return null;
+ }
+
+ function tokenNest(begin, end, style, started) {
+ return function (stream, state) {
+ if (!started && stream.match(begin)) {
+ state.tokenize[state.tokenize.length - 1] = tokenNest(begin, end, style, true);
+ state.currentIndent += 1;
+ return style;
+ }
+
+ var nextStyle = tokenBase(stream, state);
+ if (stream.current() === end) {
+ state.tokenize.pop();
+ state.currentIndent -= 1;
+ nextStyle = style;
+ }
+
+ return nextStyle;
+ };
+ }
+
+ function tokenMacro(begin, end, started) {
+ return function (stream, state) {
+ if (!started && stream.match("{" + begin)) {
+ state.currentIndent += 1;
+ state.tokenize[state.tokenize.length - 1] = tokenMacro(begin, end, true);
+ return "meta";
+ }
+
+ if (stream.match(end + "}")) {
+ state.currentIndent -= 1;
+ state.tokenize.pop();
+ return "meta";
+ }
+
+ return tokenBase(stream, state);
+ };
+ }
+
+ function tokenMacroDef(stream, state) {
+ if (stream.eatSpace()) {
+ return null;
+ }
+
+ var matched;
+ if (matched = stream.match(idents)) {
+ if (matched == "def") {
+ return "keyword";
+ }
+ stream.eat(/[?!]/);
+ }
+
+ state.tokenize.pop();
+ return "def";
+ }
+
+ function tokenFollowIdent(stream, state) {
+ if (stream.eatSpace()) {
+ return null;
+ }
+
+ if (stream.match(idents)) {
+ stream.eat(/[!?]/);
+ } else {
+ stream.match(operators) || stream.match(conditionalOperators) || stream.match(indexingOperators);
+ }
+ state.tokenize.pop();
+ return "def";
+ }
+
+ function tokenFollowType(stream, state) {
+ if (stream.eatSpace()) {
+ return null;
+ }
+
+ stream.match(types);
+ state.tokenize.pop();
+ return "def";
+ }
+
+ function tokenQuote(end, style, embed) {
+ return function (stream, state) {
+ var escaped = false;
+
+ while (stream.peek()) {
+ if (!escaped) {
+ if (stream.match("{%", false)) {
+ state.tokenize.push(tokenMacro("%", "%"));
+ return style;
+ }
+
+ if (stream.match("{{", false)) {
+ state.tokenize.push(tokenMacro("{", "}"));
+ return style;
+ }
+
+ if (embed && stream.match("#{", false)) {
+ state.tokenize.push(tokenNest("#{", "}", "meta"));
+ return style;
+ }
+
+ var ch = stream.next();
+
+ if (ch == end) {
+ state.tokenize.pop();
+ return style;
+ }
+
+ escaped = ch == "\\";
+ } else {
+ stream.next();
+ escaped = false;
+ }
+ }
+
+ return style;
+ };
+ }
+
+ return {
+ startState: function () {
+ return {
+ tokenize: [tokenBase],
+ currentIndent: 0,
+ lastToken: null,
+ blocks: []
+ };
+ },
+
+ token: function (stream, state) {
+ var style = state.tokenize[state.tokenize.length - 1](stream, state);
+ var token = stream.current();
+
+ if (style && style != "comment") {
+ state.lastToken = token;
+ }
+
+ return style;
+ },
+
+ indent: function (state, textAfter) {
+ textAfter = textAfter.replace(/^\s*(?:\{%)?\s*|\s*(?:%\})?\s*$/g, "");
+
+ if (dedentKeywords.test(textAfter) || dedentPunctuals.test(textAfter)) {
+ return config.indentUnit * (state.currentIndent - 1);
+ }
+
+ return config.indentUnit * state.currentIndent;
+ },
+
+ fold: "indent",
+ electricInput: wordRegExp(dedentPunctualsArray.concat(dedentKeywordsArray), true),
+ lineComment: '#'
+ };
+ });
+
+ CodeMirror.defineMIME("text/x-crystal", "crystal");
+});
diff --git a/public/vendor/codemirror/mode/crystal/index.html b/public/vendor/codemirror/mode/crystal/index.html
new file mode 100644
index 00000000..ec03e250
--- /dev/null
+++ b/public/vendor/codemirror/mode/crystal/index.html
@@ -0,0 +1,119 @@
+<!doctype html>
+
+<title>CodeMirror: Crystal mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/edit/matchbrackets.js"></script>
+<script src="crystal.js"></script>
+<style>
+ .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
+ .cm-s-default span.cm-arrow { color: red; }
+</style>
+
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">Crystal</a>
+ </ul>
+</div>
+
+<article>
+<h2>Crystal mode</h2>
+<form><textarea id="code" name="code">
+# Features of Crystal
+# - Ruby-inspired syntax.
+# - Statically type-checked but without having to specify the type of variables or method arguments.
+# - Be able to call C code by writing bindings to it in Crystal.
+# - Have compile-time evaluation and generation of code, to avoid boilerplate code.
+# - Compile to efficient native code.
+
+# A very basic HTTP server
+require "http/server"
+
+server = HTTP::Server.new(8080) do |request|
+ HTTP::Response.ok "text/plain", "Hello world, got #{request.path}!"
+end
+
+puts "Listening on http://0.0.0.0:8080"
+server.listen
+
+module Foo
+ def initialize(@foo); end
+
+ abstract def abstract_method : String
+
+ @[AlwaysInline]
+ def with_foofoo
+ with Foo.new(self) yield
+ end
+
+ struct Foo
+ def initialize(@foo); end
+
+ def hello_world
+ @foo.abstract_method
+ end
+ end
+end
+
+class Bar
+ include Foo
+
+ @@foobar = 12345
+
+ def initialize(@bar)
+ super(@bar.not_nil! + 100)
+ end
+
+ macro alias_method(name, method)
+ def {{ name }}(*args)
+ {{ method }}(*args)
+ end
+ end
+
+ def a_method
+ "Hello, World"
+ end
+
+ alias_method abstract_method, a_method
+
+ macro def show_instance_vars : Nil
+ {% for var in @type.instance_vars %}
+ puts "@{{ var }} = #{ @{{ var }} }"
+ {% end %}
+ nil
+ end
+end
+
+class Baz &lt; Bar; end
+
+lib LibC
+ fun c_puts = "puts"(str : Char*) : Int
+end
+
+$baz = Baz.new(100)
+$baz.show_instance_vars
+$baz.with_foofoo do
+ LibC.c_puts hello_world
+end
+</textarea></form>
+<script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ mode: "text/x-crystal",
+ matchBrackets: true,
+ indentUnit: 2
+ });
+</script>
+
+<p><strong>MIME types defined:</strong> <code>text/x-crystal</code>.</p>
+</article>
diff --git a/public/vendor/codemirror/mode/css/css.js b/public/vendor/codemirror/mode/css/css.js
index 1e6d2ddb..e9656e3d 100755..100644
--- a/public/vendor/codemirror/mode/css/css.js
+++ b/public/vendor/codemirror/mode/css/css.js
@@ -12,6 +12,7 @@
"use strict";
CodeMirror.defineMode("css", function(config, parserConfig) {
+ var inline = parserConfig.inline
if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css");
var indentUnit = config.indentUnit,
@@ -19,13 +20,15 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
documentTypes = parserConfig.documentTypes || {},
mediaTypes = parserConfig.mediaTypes || {},
mediaFeatures = parserConfig.mediaFeatures || {},
+ mediaValueKeywords = parserConfig.mediaValueKeywords || {},
propertyKeywords = parserConfig.propertyKeywords || {},
nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {},
fontProperties = parserConfig.fontProperties || {},
counterDescriptors = parserConfig.counterDescriptors || {},
colorKeywords = parserConfig.colorKeywords || {},
valueKeywords = parserConfig.valueKeywords || {},
- allowNested = parserConfig.allowNested;
+ allowNested = parserConfig.allowNested,
+ supportsAtComponent = parserConfig.supportsAtComponent === true;
var type, override;
function ret(style, tp) { type = tp; return style; }
@@ -119,13 +122,14 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
this.prev = prev;
}
- function pushContext(state, stream, type) {
- state.context = new Context(type, stream.indentation() + indentUnit, state.context);
+ function pushContext(state, stream, type, indent) {
+ state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context);
return type;
}
function popContext(state) {
- state.context = state.context.prev;
+ if (state.context.prev)
+ state.context = state.context.prev;
return state.context.type;
}
@@ -157,9 +161,13 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
return pushContext(state, stream, "block");
} else if (type == "}" && state.context.prev) {
return popContext(state);
- } else if (/@(media|supports|(-moz-)?document)/.test(type)) {
+ } else if (supportsAtComponent && /@component/.test(type)) {
+ return pushContext(state, stream, "atComponentBlock");
+ } else if (/^@(-moz-)?document$/.test(type)) {
+ return pushContext(state, stream, "documentTypes");
+ } else if (/^@(media|supports|(-moz-)?document|import)$/.test(type)) {
return pushContext(state, stream, "atBlock");
- } else if (/@(font-face|counter-style)/.test(type)) {
+ } else if (/^@(font-face|counter-style)/.test(type)) {
state.stateArg = type;
return "restricted_atBlock_before";
} else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) {
@@ -219,7 +227,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
if (type == "}" || type == "{") return popAndPass(type, stream, state);
if (type == "(") return pushContext(state, stream, "parens");
- if (type == "hash" && !/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) {
+ if (type == "hash" && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) {
override += " error";
} else if (type == "word") {
wordAsValue(stream);
@@ -252,33 +260,56 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
return pass(type, stream, state);
};
+ states.documentTypes = function(type, stream, state) {
+ if (type == "word" && documentTypes.hasOwnProperty(stream.current())) {
+ override = "tag";
+ return state.context.type;
+ } else {
+ return states.atBlock(type, stream, state);
+ }
+ };
+
states.atBlock = function(type, stream, state) {
if (type == "(") return pushContext(state, stream, "atBlock_parens");
- if (type == "}") return popAndPass(type, stream, state);
+ if (type == "}" || type == ";") return popAndPass(type, stream, state);
if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top");
+ if (type == "interpolation") return pushContext(state, stream, "interpolation");
+
if (type == "word") {
var word = stream.current().toLowerCase();
if (word == "only" || word == "not" || word == "and" || word == "or")
override = "keyword";
- else if (documentTypes.hasOwnProperty(word))
- override = "tag";
else if (mediaTypes.hasOwnProperty(word))
override = "attribute";
else if (mediaFeatures.hasOwnProperty(word))
override = "property";
+ else if (mediaValueKeywords.hasOwnProperty(word))
+ override = "keyword";
else if (propertyKeywords.hasOwnProperty(word))
override = "property";
else if (nonStandardPropertyKeywords.hasOwnProperty(word))
override = "string-2";
else if (valueKeywords.hasOwnProperty(word))
override = "atom";
+ else if (colorKeywords.hasOwnProperty(word))
+ override = "keyword";
else
override = "error";
}
return state.context.type;
};
+ states.atComponentBlock = function(type, stream, state) {
+ if (type == "}")
+ return popAndPass(type, stream, state);
+ if (type == "{")
+ return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top", false);
+ if (type == "word")
+ override = "error";
+ return state.context.type;
+ };
+
states.atBlock_parens = function(type, stream, state) {
if (type == ")") return popContext(state);
if (type == "{" || type == "}") return popAndPass(type, stream, state, 2);
@@ -336,9 +367,9 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
return {
startState: function(base) {
return {tokenize: null,
- state: "top",
+ state: inline ? "block" : "top",
stateArg: null,
- context: new Context("top", base || 0, null)};
+ context: new Context(inline ? "block" : "top", base || 0, null)};
},
token: function(stream, state) {
@@ -357,12 +388,18 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
var cx = state.context, ch = textAfter && textAfter.charAt(0);
var indent = cx.indent;
if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev;
- if (cx.prev &&
- (ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "restricted_atBlock") ||
- ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") ||
- ch == "{" && (cx.type == "at" || cx.type == "atBlock"))) {
- indent = cx.indent - indentUnit;
- cx = cx.prev;
+ if (cx.prev) {
+ if (ch == "}" && (cx.type == "block" || cx.type == "top" ||
+ cx.type == "interpolation" || cx.type == "restricted_atBlock")) {
+ // Resume indentation from parent context.
+ cx = cx.prev;
+ indent = cx.indent;
+ } else if (ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") ||
+ ch == "{" && (cx.type == "at" || cx.type == "atBlock")) {
+ // Dedent relative to current context.
+ indent = Math.max(0, cx.indent - indentUnit);
+ cx = cx.prev;
+ }
}
return indent;
},
@@ -399,17 +436,24 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color",
"max-color", "color-index", "min-color-index", "max-color-index",
"monochrome", "min-monochrome", "max-monochrome", "resolution",
- "min-resolution", "max-resolution", "scan", "grid"
+ "min-resolution", "max-resolution", "scan", "grid", "orientation",
+ "device-pixel-ratio", "min-device-pixel-ratio", "max-device-pixel-ratio",
+ "pointer", "any-pointer", "hover", "any-hover"
], mediaFeatures = keySet(mediaFeatures_);
+ var mediaValueKeywords_ = [
+ "landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover",
+ "interlace", "progressive"
+ ], mediaValueKeywords = keySet(mediaValueKeywords_);
+
var propertyKeywords_ = [
"align-content", "align-items", "align-self", "alignment-adjust",
"alignment-baseline", "anchor-point", "animation", "animation-delay",
"animation-direction", "animation-duration", "animation-fill-mode",
"animation-iteration-count", "animation-name", "animation-play-state",
"animation-timing-function", "appearance", "azimuth", "backface-visibility",
- "background", "background-attachment", "background-clip", "background-color",
- "background-image", "background-origin", "background-position",
+ "background", "background-attachment", "background-blend-mode", "background-clip",
+ "background-color", "background-image", "background-origin", "background-position",
"background-repeat", "background-size", "baseline-shift", "binding",
"bleed", "bookmark-label", "bookmark-level", "bookmark-state",
"bookmark-target", "border", "border-bottom", "border-bottom-color",
@@ -553,11 +597,12 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
"cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch",
"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
- "col-resize", "collapse", "column", "compact", "condensed", "contain", "content",
+ "col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse",
+ "compact", "condensed", "contain", "content",
"content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop",
- "cross", "crosshair", "currentcolor", "cursive", "cyclic", "dashed", "decimal",
+ "cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
"decimal-leading-zero", "default", "default-button", "destination-atop",
- "destination-in", "destination-out", "destination-over", "devanagari",
+ "destination-in", "destination-out", "destination-over", "devanagari", "difference",
"disc", "discard", "disclosure-closed", "disclosure-open", "document",
"dot-dash", "dot-dot-dash",
"dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
@@ -568,23 +613,23 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"ethiopic-halehame-gez", "ethiopic-halehame-om-et",
"ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
"ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig",
- "ethiopic-numeric", "ew-resize", "expanded", "extends", "extra-condensed",
- "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "footnotes",
+ "ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed",
+ "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes",
"forwards", "from", "geometricPrecision", "georgian", "graytext", "groove",
- "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew",
+ "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew",
"help", "hidden", "hide", "higher", "highlight", "highlighttext",
- "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore",
+ "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore",
"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
"infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
"inline-block", "inline-flex", "inline-table", "inset", "inside", "intrinsic", "invert",
"italic", "japanese-formal", "japanese-informal", "justify", "kannada",
"katakana", "katakana-iroha", "keep-all", "khmer",
"korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal",
- "landscape", "lao", "large", "larger", "left", "level", "lighter",
+ "landscape", "lao", "large", "larger", "left", "level", "lighter", "lighten",
"line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem",
"local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
"lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
- "lower-roman", "lowercase", "ltr", "malayalam", "match", "matrix", "matrix3d",
+ "lower-roman", "lowercase", "ltr", "luminosity", "malayalam", "match", "matrix", "matrix3d",
"media-controls-background", "media-current-time-display",
"media-fullscreen-button", "media-mute-button", "media-play-button",
"media-return-to-realtime-button", "media-rewind-button",
@@ -593,7 +638,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"media-volume-slider-container", "media-volume-sliderthumb", "medium",
"menu", "menulist", "menulist-button", "menulist-text",
"menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
- "mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize",
+ "mix", "mongolian", "monospace", "move", "multiple", "multiply", "myanmar", "n-resize",
"narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
"no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
"ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote",
@@ -606,8 +651,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"relative", "repeat", "repeating-linear-gradient",
"repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse",
"rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY",
- "rotateZ", "round", "row-resize", "rtl", "run-in", "running",
- "s-resize", "sans-serif", "scale", "scale3d", "scaleX", "scaleY", "scaleZ",
+ "rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running",
+ "s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
"scroll", "scrollbar", "se-resize", "searchfield",
"searchfield-cancel-button", "searchfield-decoration",
"searchfield-results-button", "searchfield-results-decoration",
@@ -615,8 +660,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"simp-chinese-formal", "simp-chinese-informal", "single",
"skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
"slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
- "small", "small-caps", "small-caption", "smaller", "solid", "somali",
- "source-atop", "source-in", "source-out", "source-over", "space", "spell-out", "square",
+ "small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali",
+ "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "spell-out", "square",
"square-button", "start", "static", "status-bar", "stretch", "stroke", "sub",
"subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "table",
"table-caption", "table-cell", "table-column", "table-column-group",
@@ -633,12 +678,13 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
"var", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
"visibleStroke", "visual", "w-resize", "wait", "wave", "wider",
- "window", "windowframe", "windowtext", "words", "x-large", "x-small", "xor",
+ "window", "windowframe", "windowtext", "words", "wrap", "wrap-reverse", "x-large", "x-small", "xor",
"xx-large", "xx-small"
], valueKeywords = keySet(valueKeywords_);
- var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(propertyKeywords_)
- .concat(nonStandardPropertyKeywords_).concat(colorKeywords_).concat(valueKeywords_);
+ var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_)
+ .concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_)
+ .concat(valueKeywords_);
CodeMirror.registerHelper("hintWords", "css", allWords);
function tokenCComment(stream, state) {
@@ -657,6 +703,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
documentTypes: documentTypes,
mediaTypes: mediaTypes,
mediaFeatures: mediaFeatures,
+ mediaValueKeywords: mediaValueKeywords,
propertyKeywords: propertyKeywords,
nonStandardPropertyKeywords: nonStandardPropertyKeywords,
fontProperties: fontProperties,
@@ -676,6 +723,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
CodeMirror.defineMIME("text/x-scss", {
mediaTypes: mediaTypes,
mediaFeatures: mediaFeatures,
+ mediaValueKeywords: mediaValueKeywords,
propertyKeywords: propertyKeywords,
nonStandardPropertyKeywords: nonStandardPropertyKeywords,
colorKeywords: colorKeywords,
@@ -717,6 +765,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
CodeMirror.defineMIME("text/x-less", {
mediaTypes: mediaTypes,
mediaFeatures: mediaFeatures,
+ mediaValueKeywords: mediaValueKeywords,
propertyKeywords: propertyKeywords,
nonStandardPropertyKeywords: nonStandardPropertyKeywords,
colorKeywords: colorKeywords,
@@ -751,4 +800,26 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
helperType: "less"
});
+ CodeMirror.defineMIME("text/x-gss", {
+ documentTypes: documentTypes,
+ mediaTypes: mediaTypes,
+ mediaFeatures: mediaFeatures,
+ propertyKeywords: propertyKeywords,
+ nonStandardPropertyKeywords: nonStandardPropertyKeywords,
+ fontProperties: fontProperties,
+ counterDescriptors: counterDescriptors,
+ colorKeywords: colorKeywords,
+ valueKeywords: valueKeywords,
+ supportsAtComponent: true,
+ tokenHooks: {
+ "/": function(stream, state) {
+ if (!stream.eat("*")) return false;
+ state.tokenize = tokenCComment;
+ return tokenCComment(stream, state);
+ }
+ },
+ name: "css",
+ helperType: "gss"
+ });
+
});
diff --git a/public/vendor/codemirror/mode/css/gss.html b/public/vendor/codemirror/mode/css/gss.html
new file mode 100644
index 00000000..232fe8c1
--- /dev/null
+++ b/public/vendor/codemirror/mode/css/gss.html
@@ -0,0 +1,103 @@
+<!doctype html>
+
+<title>CodeMirror: Closure Stylesheets (GSS) mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<link rel="stylesheet" href="../../addon/hint/show-hint.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="css.js"></script>
+<script src="../../addon/hint/show-hint.js"></script>
+<script src="../../addon/hint/css-hint.js"></script>
+<style>.CodeMirror {background: #f8f8f8;}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">Closure Stylesheets (GSS)</a>
+ </ul>
+</div>
+
+<article>
+<h2>Closure Stylesheets (GSS) mode</h2>
+<form><textarea id="code" name="code">
+/* Some example Closure Stylesheets */
+
+@provide 'some.styles';
+
+@require 'other.styles';
+
+@component {
+
+@def FONT_FAMILY "Times New Roman", Georgia, Serif;
+@def FONT_SIZE_NORMAL 15px;
+@def FONT_NORMAL normal FONT_SIZE_NORMAL FONT_FAMILY;
+
+@def BG_COLOR rgb(235, 239, 249);
+
+@def DIALOG_BORDER_COLOR rgb(107, 144, 218);
+@def DIALOG_BG_COLOR BG_COLOR;
+
+@def LEFT_HAND_NAV_WIDTH 180px;
+@def LEFT_HAND_NAV_PADDING 3px;
+
+@defmixin size(WIDTH, HEIGHT) {
+ width: WIDTH;
+ height: HEIGHT;
+}
+
+body {
+ background-color: BG_COLOR;
+ margin: 0;
+ padding: 3em 6em;
+ font: FONT_NORMAL;
+ color: #000;
+}
+
+#navigation a {
+ font-weight: bold;
+ text-decoration: none !important;
+}
+
+.dialog {
+ background-color: DIALOG_BG_COLOR;
+ border: 1px solid DIALOG_BORDER_COLOR;
+}
+
+.content {
+ position: absolute;
+ margin-left: add(LEFT_HAND_NAV_PADDING, /* padding left */
+ LEFT_HAND_NAV_WIDTH,
+ LEFT_HAND_NAV_PADDING); /* padding right */
+
+}
+
+.logo {
+ @mixin size(150px, 55px);
+ background-image: url('http://www.google.com/images/logo_sm.gif');
+}
+
+}
+</textarea></form>
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ extraKeys: {"Ctrl-Space": "autocomplete"},
+ lineNumbers: true,
+ matchBrackets: "text/x-less",
+ mode: "text/x-gss"
+ });
+ </script>
+
+ <p>A mode for <a href="https://github.com/google/closure-stylesheets">Closure Stylesheets</a> (GSS).</p>
+ <p><strong>MIME type defined:</strong> <code>text/x-gss</code>.</p>
+
+ <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#gss_*">normal</a>, <a href="../../test/index.html#verbose,gss_*">verbose</a>.</p>
+
+ </article>
diff --git a/public/vendor/codemirror/mode/css/gss_test.js b/public/vendor/codemirror/mode/css/gss_test.js
new file mode 100644
index 00000000..d56e5928
--- /dev/null
+++ b/public/vendor/codemirror/mode/css/gss_test.js
@@ -0,0 +1,17 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+ "use strict";
+
+ var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-gss");
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "gss"); }
+
+ MT("atComponent",
+ "[def @component] {",
+ "[tag foo] {",
+ " [property color]: [keyword black];",
+ "}",
+ "}");
+
+})();
diff --git a/public/vendor/codemirror/mode/css/index.html b/public/vendor/codemirror/mode/css/index.html
index 2d2b9b07..2d2b9b07 100755..100644
--- a/public/vendor/codemirror/mode/css/index.html
+++ b/public/vendor/codemirror/mode/css/index.html
diff --git a/public/vendor/codemirror/mode/css/less.html b/public/vendor/codemirror/mode/css/less.html
index adf7427d..adf7427d 100755..100644
--- a/public/vendor/codemirror/mode/css/less.html
+++ b/public/vendor/codemirror/mode/css/less.html
diff --git a/public/vendor/codemirror/mode/css/less_test.js b/public/vendor/codemirror/mode/css/less_test.js
index 7b77f584..dd821558 100755..100644
--- a/public/vendor/codemirror/mode/css/less_test.js
+++ b/public/vendor/codemirror/mode/css/less_test.js
@@ -26,10 +26,10 @@
MT("mixin",
"[qualifier .mixin] ([variable dark]; [variable-2 @color]) {",
- " [property color]: [variable darken]([variable-2 @color], [number 10%]);",
+ " [property color]: [atom darken]([variable-2 @color], [number 10%]);",
"}",
"[qualifier .mixin] ([variable light]; [variable-2 @color]) {",
- " [property color]: [variable lighten]([variable-2 @color], [number 10%]);",
+ " [property color]: [atom lighten]([variable-2 @color], [number 10%]);",
"}",
"[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {",
" [property display]: [atom block];",
diff --git a/public/vendor/codemirror/mode/css/scss.html b/public/vendor/codemirror/mode/css/scss.html
index f8e4d373..f8e4d373 100755..100644
--- a/public/vendor/codemirror/mode/css/scss.html
+++ b/public/vendor/codemirror/mode/css/scss.html
diff --git a/public/vendor/codemirror/mode/css/scss_test.js b/public/vendor/codemirror/mode/css/scss_test.js
index 26c226a1..785921b3 100755..100644
--- a/public/vendor/codemirror/mode/css/scss_test.js
+++ b/public/vendor/codemirror/mode/css/scss_test.js
@@ -95,7 +95,7 @@
MT('indent_parentheses',
"[tag foo] {",
- " [property color]: [variable darken]([variable-2 $blue],",
+ " [property color]: [atom darken]([variable-2 $blue],",
" [number 9%]);",
"}");
diff --git a/public/vendor/codemirror/mode/css/test.js b/public/vendor/codemirror/mode/css/test.js
index 55ae676e..7a496fb0 100755..100644
--- a/public/vendor/codemirror/mode/css/test.js
+++ b/public/vendor/codemirror/mode/css/test.js
@@ -6,7 +6,7 @@
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
// Error, because "foobarhello" is neither a known type or property, but
- // property was expected (after "and"), and it should be in parenthese.
+ // property was expected (after "and"), and it should be in parentheses.
MT("atMediaUnknownType",
"[def @media] [attribute screen] [keyword and] [error foobarhello] { }");
@@ -18,6 +18,12 @@
MT("atMediaMaxWidthNested",
"[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }");
+ MT("atMediaFeatureValueKeyword",
+ "[def @media] ([property orientation]: [keyword landscape]) { }");
+
+ MT("atMediaUnknownFeatureValueKeyword",
+ "[def @media] ([property orientation]: [error upsidedown]) { }");
+
MT("tagSelector",
"[tag foo] { }");
@@ -49,11 +55,17 @@
MT("tagColorHex3",
"[tag foo] { [property background]: [atom #fff]; }");
+ MT("tagColorHex4",
+ "[tag foo] { [property background]: [atom #ffff]; }");
+
MT("tagColorHex6",
"[tag foo] { [property background]: [atom #ffffff]; }");
- MT("tagColorHex4",
- "[tag foo] { [property background]: [atom&error #ffff]; }");
+ MT("tagColorHex8",
+ "[tag foo] { [property background]: [atom #ffffffff]; }");
+
+ MT("tagColorHex5Invalid",
+ "[tag foo] { [property background]: [atom&error #fffff]; }");
MT("tagColorHexInvalid",
"[tag foo] { [property background]: [atom&error #ffg]; }");
@@ -114,7 +126,7 @@
"}");
MT("empty_url",
- "[def @import] [tag url]() [tag screen];");
+ "[def @import] [atom url]() [attribute screen];");
MT("parens",
"[qualifier .foo] {",
@@ -150,7 +162,7 @@
" [tag foo] {",
" [property font-family]: [variable Verdana], [atom sans-serif];",
" }",
- " }");
+ "}");
MT("document_url",
"[def @document] [tag url]([string http://blah]) { [qualifier .class] { } }");
diff --git a/public/vendor/codemirror/mode/cypher/cypher.js b/public/vendor/codemirror/mode/cypher/cypher.js
index e218d473..107e4f6d 100755..100644
--- a/public/vendor/codemirror/mode/cypher/cypher.js
+++ b/public/vendor/codemirror/mode/cypher/cypher.js
@@ -60,9 +60,9 @@
};
var indentUnit = config.indentUnit;
var curPunc;
- var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "right", "round", "rtrim", "shortestPath", "sign", "sin", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "trim", "type", "upper"]);
- var preds = wordRegexp(["all", "and", "any", "has", "in", "none", "not", "or", "single", "xor"]);
- var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "distinct", "drop", "else", "end", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]);
+ var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "reverse", "right", "round", "rtrim", "shortestPath", "sign", "sin", "size", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "toString", "trim", "type", "upper"]);
+ var preds = wordRegexp(["all", "and", "any", "contains", "exists", "has", "in", "none", "not", "or", "single", "xor"]);
+ var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "detach", "distinct", "drop", "else", "end", "ends", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "join", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "starts", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]);
var operatorChars = /[*+\-<>=&|~%^]/;
return {
diff --git a/public/vendor/codemirror/mode/cypher/index.html b/public/vendor/codemirror/mode/cypher/index.html
index b8bd75c8..b8bd75c8 100755..100644
--- a/public/vendor/codemirror/mode/cypher/index.html
+++ b/public/vendor/codemirror/mode/cypher/index.html
diff --git a/public/vendor/codemirror/mode/d/d.js b/public/vendor/codemirror/mode/d/d.js
index c927a7e3..c927a7e3 100755..100644
--- a/public/vendor/codemirror/mode/d/d.js
+++ b/public/vendor/codemirror/mode/d/d.js
diff --git a/public/vendor/codemirror/mode/d/index.html b/public/vendor/codemirror/mode/d/index.html
index 08cabd8a..08cabd8a 100755..100644
--- a/public/vendor/codemirror/mode/d/index.html
+++ b/public/vendor/codemirror/mode/d/index.html
diff --git a/public/vendor/codemirror/mode/dart/dart.js b/public/vendor/codemirror/mode/dart/dart.js
index a49e218c..d92eb519 100755..100644
--- a/public/vendor/codemirror/mode/dart/dart.js
+++ b/public/vendor/codemirror/mode/dart/dart.js
@@ -15,7 +15,7 @@
"implements get native operator set typedef with enum throw rethrow " +
"assert break case continue default in return new deferred async await " +
"try catch finally do else for if switch while import library export " +
- "part of show hide is").split(" ");
+ "part of show hide is as").split(" ");
var blockKeywords = "try catch finally do else for if switch while".split(" ");
var atoms = "true false null".split(" ");
var builtins = "void bool num int double dynamic var String".split(" ");
@@ -26,21 +26,101 @@
return obj;
}
+ function pushInterpolationStack(state) {
+ (state.interpolationStack || (state.interpolationStack = [])).push(state.tokenize);
+ }
+
+ function popInterpolationStack(state) {
+ return (state.interpolationStack || (state.interpolationStack = [])).pop();
+ }
+
+ function sizeInterpolationStack(state) {
+ return state.interpolationStack ? state.interpolationStack.length : 0;
+ }
+
CodeMirror.defineMIME("application/dart", {
name: "clike",
keywords: set(keywords),
- multiLineStrings: true,
blockKeywords: set(blockKeywords),
builtin: set(builtins),
atoms: set(atoms),
hooks: {
"@": function(stream) {
- stream.eatWhile(/[\w\$_]/);
+ stream.eatWhile(/[\w\$_\.]/);
return "meta";
+ },
+
+ // custom string handling to deal with triple-quoted strings and string interpolation
+ "'": function(stream, state) {
+ return tokenString("'", stream, state, false);
+ },
+ "\"": function(stream, state) {
+ return tokenString("\"", stream, state, false);
+ },
+ "r": function(stream, state) {
+ var peek = stream.peek();
+ if (peek == "'" || peek == "\"") {
+ return tokenString(stream.next(), stream, state, true);
+ }
+ return false;
+ },
+
+ "}": function(_stream, state) {
+ // "}" is end of interpolation, if interpolation stack is non-empty
+ if (sizeInterpolationStack(state) > 0) {
+ state.tokenize = popInterpolationStack(state);
+ return null;
+ }
+ return false;
}
}
});
+ function tokenString(quote, stream, state, raw) {
+ var tripleQuoted = false;
+ if (stream.eat(quote)) {
+ if (stream.eat(quote)) tripleQuoted = true;
+ else return "string"; //empty string
+ }
+ function tokenStringHelper(stream, state) {
+ var escaped = false;
+ while (!stream.eol()) {
+ if (!raw && !escaped && stream.peek() == "$") {
+ pushInterpolationStack(state);
+ state.tokenize = tokenInterpolation;
+ return "string";
+ }
+ var next = stream.next();
+ if (next == quote && !escaped && (!tripleQuoted || stream.match(quote + quote))) {
+ state.tokenize = null;
+ break;
+ }
+ escaped = !raw && !escaped && next == "\\";
+ }
+ return "string";
+ }
+ state.tokenize = tokenStringHelper;
+ return tokenStringHelper(stream, state);
+ }
+
+ function tokenInterpolation(stream, state) {
+ stream.eat("$");
+ if (stream.eat("{")) {
+ // let clike handle the content of ${...},
+ // we take over again when "}" appears (see hooks).
+ state.tokenize = null;
+ } else {
+ state.tokenize = tokenInterpolationIdentifier;
+ }
+ return null;
+ }
+
+ function tokenInterpolationIdentifier(stream, state) {
+ stream.eatWhile(/[\w_]/);
+ state.tokenize = popInterpolationStack(state);
+ return "variable";
+ }
+
CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins));
// This is needed to make loading through meta.js work.
diff --git a/public/vendor/codemirror/mode/dart/index.html b/public/vendor/codemirror/mode/dart/index.html
index e79da5a8..e79da5a8 100755..100644
--- a/public/vendor/codemirror/mode/dart/index.html
+++ b/public/vendor/codemirror/mode/dart/index.html
diff --git a/public/vendor/codemirror/mode/diff/diff.js b/public/vendor/codemirror/mode/diff/diff.js
index fe0305e7..fe0305e7 100755..100644
--- a/public/vendor/codemirror/mode/diff/diff.js
+++ b/public/vendor/codemirror/mode/diff/diff.js
diff --git a/public/vendor/codemirror/mode/diff/index.html b/public/vendor/codemirror/mode/diff/index.html
index 0af611fa..0af611fa 100755..100644
--- a/public/vendor/codemirror/mode/diff/index.html
+++ b/public/vendor/codemirror/mode/diff/index.html
diff --git a/public/vendor/codemirror/mode/django/django.js b/public/vendor/codemirror/mode/django/django.js
index 2f08b063..eb8d6591 100755..100644
--- a/public/vendor/codemirror/mode/django/django.js
+++ b/public/vendor/codemirror/mode/django/django.js
@@ -14,14 +14,14 @@
"use strict";
CodeMirror.defineMode("django:inner", function() {
- var keywords = ["block", "endblock", "for", "endfor", "true", "false",
- "loop", "none", "self", "super", "if", "endif", "as",
- "else", "import", "with", "endwith", "without", "context", "ifequal", "endifequal",
- "ifnotequal", "endifnotequal", "extends", "include", "load", "comment",
- "endcomment", "empty", "url", "static", "trans", "blocktrans", "now", "regroup",
- "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle", "csrf_token",
- "autoescape", "endautoescape", "spaceless", "ssi", "templatetag",
- "verbatim", "endverbatim", "widthratio"],
+ var keywords = ["block", "endblock", "for", "endfor", "true", "false", "filter", "endfilter",
+ "loop", "none", "self", "super", "if", "elif", "endif", "as", "else", "import",
+ "with", "endwith", "without", "context", "ifequal", "endifequal", "ifnotequal",
+ "endifnotequal", "extends", "include", "load", "comment", "endcomment",
+ "empty", "url", "static", "trans", "blocktrans", "endblocktrans", "now",
+ "regroup", "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle",
+ "csrf_token", "autoescape", "endautoescape", "spaceless", "endspaceless",
+ "ssi", "templatetag", "verbatim", "endverbatim", "widthratio"],
filters = ["add", "addslashes", "capfirst", "center", "cut", "date",
"default", "default_if_none", "dictsort",
"dictsortreversed", "divisibleby", "escape", "escapejs",
@@ -35,11 +35,13 @@
"truncatechars_html", "truncatewords", "truncatewords_html",
"unordered_list", "upper", "urlencode", "urlize",
"urlizetrunc", "wordcount", "wordwrap", "yesno"],
- operators = ["==", "!=", "<", ">", "<=", ">=", "in", "not", "or", "and"];
+ operators = ["==", "!=", "<", ">", "<=", ">="],
+ wordOperators = ["in", "not", "or", "and"];
keywords = new RegExp("^\\b(" + keywords.join("|") + ")\\b");
filters = new RegExp("^\\b(" + filters.join("|") + ")\\b");
operators = new RegExp("^\\b(" + operators.join("|") + ")\\b");
+ wordOperators = new RegExp("^\\b(" + wordOperators.join("|") + ")\\b");
// We have to return "null" instead of null, in order to avoid string
// styling as the default, when using Django templates inside HTML
@@ -270,6 +272,11 @@
return "operator";
}
+ // Attempt to match a word operator
+ if (stream.match(wordOperators)) {
+ return "keyword";
+ }
+
// Attempt to match a keyword
var keywordMatch = stream.match(keywords);
if (keywordMatch) {
diff --git a/public/vendor/codemirror/mode/django/index.html b/public/vendor/codemirror/mode/django/index.html
index 41ea07c9..41ea07c9 100755..100644
--- a/public/vendor/codemirror/mode/django/index.html
+++ b/public/vendor/codemirror/mode/django/index.html
diff --git a/public/vendor/codemirror/mode/dockerfile/dockerfile.js b/public/vendor/codemirror/mode/dockerfile/dockerfile.js
index 6d517750..4419009a 100755..100644
--- a/public/vendor/codemirror/mode/dockerfile/dockerfile.js
+++ b/public/vendor/codemirror/mode/dockerfile/dockerfile.js
@@ -69,7 +69,10 @@
token: null,
next: "start"
}
- ]
+ ],
+ meta: {
+ lineComment: "#"
+ }
});
CodeMirror.defineMIME("text/x-dockerfile", "dockerfile");
diff --git a/public/vendor/codemirror/mode/dockerfile/index.html b/public/vendor/codemirror/mode/dockerfile/index.html
index a31759bc..a31759bc 100755..100644
--- a/public/vendor/codemirror/mode/dockerfile/index.html
+++ b/public/vendor/codemirror/mode/dockerfile/index.html
diff --git a/public/vendor/codemirror/mode/dtd/dtd.js b/public/vendor/codemirror/mode/dtd/dtd.js
index f37029a7..f37029a7 100755..100644
--- a/public/vendor/codemirror/mode/dtd/dtd.js
+++ b/public/vendor/codemirror/mode/dtd/dtd.js
diff --git a/public/vendor/codemirror/mode/dtd/index.html b/public/vendor/codemirror/mode/dtd/index.html
index e6798a74..e6798a74 100755..100644
--- a/public/vendor/codemirror/mode/dtd/index.html
+++ b/public/vendor/codemirror/mode/dtd/index.html
diff --git a/public/vendor/codemirror/mode/dylan/dylan.js b/public/vendor/codemirror/mode/dylan/dylan.js
index 85f0166c..85f0166c 100755..100644
--- a/public/vendor/codemirror/mode/dylan/dylan.js
+++ b/public/vendor/codemirror/mode/dylan/dylan.js
diff --git a/public/vendor/codemirror/mode/dylan/index.html b/public/vendor/codemirror/mode/dylan/index.html
index ddf5ad06..ddf5ad06 100755..100644
--- a/public/vendor/codemirror/mode/dylan/index.html
+++ b/public/vendor/codemirror/mode/dylan/index.html
diff --git a/public/vendor/codemirror/mode/ebnf/ebnf.js b/public/vendor/codemirror/mode/ebnf/ebnf.js
index 6b51aba0..6b51aba0 100755..100644
--- a/public/vendor/codemirror/mode/ebnf/ebnf.js
+++ b/public/vendor/codemirror/mode/ebnf/ebnf.js
diff --git a/public/vendor/codemirror/mode/ebnf/index.html b/public/vendor/codemirror/mode/ebnf/index.html
index 13845629..13845629 100755..100644
--- a/public/vendor/codemirror/mode/ebnf/index.html
+++ b/public/vendor/codemirror/mode/ebnf/index.html
diff --git a/public/vendor/codemirror/mode/ecl/ecl.js b/public/vendor/codemirror/mode/ecl/ecl.js
index 8df7ebe4..8df7ebe4 100755..100644
--- a/public/vendor/codemirror/mode/ecl/ecl.js
+++ b/public/vendor/codemirror/mode/ecl/ecl.js
diff --git a/public/vendor/codemirror/mode/ecl/index.html b/public/vendor/codemirror/mode/ecl/index.html
index 2306860d..2306860d 100755..100644
--- a/public/vendor/codemirror/mode/ecl/index.html
+++ b/public/vendor/codemirror/mode/ecl/index.html
diff --git a/public/vendor/codemirror/mode/eiffel/eiffel.js b/public/vendor/codemirror/mode/eiffel/eiffel.js
index b8b70e36..b8b70e36 100755..100644
--- a/public/vendor/codemirror/mode/eiffel/eiffel.js
+++ b/public/vendor/codemirror/mode/eiffel/eiffel.js
diff --git a/public/vendor/codemirror/mode/eiffel/index.html b/public/vendor/codemirror/mode/eiffel/index.html
index 108a71be..108a71be 100755..100644
--- a/public/vendor/codemirror/mode/eiffel/index.html
+++ b/public/vendor/codemirror/mode/eiffel/index.html
diff --git a/public/vendor/codemirror/mode/elm/elm.js b/public/vendor/codemirror/mode/elm/elm.js
index 7124c50a..b31e6637 100755..100644
--- a/public/vendor/codemirror/mode/elm/elm.js
+++ b/public/vendor/codemirror/mode/elm/elm.js
@@ -202,4 +202,4 @@
});
CodeMirror.defineMIME("text/x-elm", "elm");
-})();
+});
diff --git a/public/vendor/codemirror/mode/elm/index.html b/public/vendor/codemirror/mode/elm/index.html
index d5cb16ab..d5cb16ab 100755..100644
--- a/public/vendor/codemirror/mode/elm/index.html
+++ b/public/vendor/codemirror/mode/elm/index.html
diff --git a/public/vendor/codemirror/mode/erlang/erlang.js b/public/vendor/codemirror/mode/erlang/erlang.js
index fbca292f..5aed76a5 100755..100644
--- a/public/vendor/codemirror/mode/erlang/erlang.js
+++ b/public/vendor/codemirror/mode/erlang/erlang.js
@@ -220,8 +220,6 @@ CodeMirror.defineMode("erlang", function(cmCfg) {
}else{
return rval(state,stream,"function");
}
- }else if (is_member(w,operatorAtomWords)) {
- return rval(state,stream,"operator");
}else if (lookahead(stream) == ":") {
if (w == "erlang") {
return rval(state,stream,"builtin");
@@ -230,8 +228,6 @@ CodeMirror.defineMode("erlang", function(cmCfg) {
}
}else if (is_member(w,["true","false"])) {
return rval(state,stream,"boolean");
- }else if (is_member(w,["true","false"])) {
- return rval(state,stream,"boolean");
}else{
return rval(state,stream,"atom");
}
diff --git a/public/vendor/codemirror/mode/erlang/index.html b/public/vendor/codemirror/mode/erlang/index.html
index 6d06a890..6d06a890 100755..100644
--- a/public/vendor/codemirror/mode/erlang/index.html
+++ b/public/vendor/codemirror/mode/erlang/index.html
diff --git a/public/vendor/codemirror/mode/factor/factor.js b/public/vendor/codemirror/mode/factor/factor.js
index 86d7adf6..86d7adf6 100755..100644
--- a/public/vendor/codemirror/mode/factor/factor.js
+++ b/public/vendor/codemirror/mode/factor/factor.js
diff --git a/public/vendor/codemirror/mode/factor/index.html b/public/vendor/codemirror/mode/factor/index.html
index 9f154891..9f154891 100755..100644
--- a/public/vendor/codemirror/mode/factor/index.html
+++ b/public/vendor/codemirror/mode/factor/index.html
diff --git a/public/vendor/codemirror/mode/forth/forth.js b/public/vendor/codemirror/mode/forth/forth.js
index 1f519d88..1f519d88 100755..100644
--- a/public/vendor/codemirror/mode/forth/forth.js
+++ b/public/vendor/codemirror/mode/forth/forth.js
diff --git a/public/vendor/codemirror/mode/forth/index.html b/public/vendor/codemirror/mode/forth/index.html
index ae8cd345..ae8cd345 100755..100644
--- a/public/vendor/codemirror/mode/forth/index.html
+++ b/public/vendor/codemirror/mode/forth/index.html
diff --git a/public/vendor/codemirror/mode/fortran/fortran.js b/public/vendor/codemirror/mode/fortran/fortran.js
index 4d88f006..4d88f006 100755..100644
--- a/public/vendor/codemirror/mode/fortran/fortran.js
+++ b/public/vendor/codemirror/mode/fortran/fortran.js
diff --git a/public/vendor/codemirror/mode/fortran/index.html b/public/vendor/codemirror/mode/fortran/index.html
index 102e8f82..102e8f82 100755..100644
--- a/public/vendor/codemirror/mode/fortran/index.html
+++ b/public/vendor/codemirror/mode/fortran/index.html
diff --git a/public/vendor/codemirror/mode/gas/gas.js b/public/vendor/codemirror/mode/gas/gas.js
index 0c74bedc..0c74bedc 100755..100644
--- a/public/vendor/codemirror/mode/gas/gas.js
+++ b/public/vendor/codemirror/mode/gas/gas.js
diff --git a/public/vendor/codemirror/mode/gas/index.html b/public/vendor/codemirror/mode/gas/index.html
index df75ca2d..df75ca2d 100755..100644
--- a/public/vendor/codemirror/mode/gas/index.html
+++ b/public/vendor/codemirror/mode/gas/index.html
diff --git a/public/vendor/codemirror/mode/gfm/gfm.js b/public/vendor/codemirror/mode/gfm/gfm.js
index 80a8e2c8..6e74ad4f 100755..100644
--- a/public/vendor/codemirror/mode/gfm/gfm.js
+++ b/public/vendor/codemirror/mode/gfm/gfm.js
@@ -11,6 +11,8 @@
})(function(CodeMirror) {
"use strict";
+var urlRE = /^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i
+
CodeMirror.defineMode("gfm", function(config, modeConfig) {
var codeDepth = 0;
function blankLine(state) {
@@ -37,7 +39,7 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
// Hack to prevent formatting override inside code blocks (block and inline)
if (state.codeBlock) {
- if (stream.match(/^```/)) {
+ if (stream.match(/^```+/)) {
state.codeBlock = false;
return null;
}
@@ -47,7 +49,7 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
if (stream.sol()) {
state.code = false;
}
- if (stream.sol() && stream.match(/^```/)) {
+ if (stream.sol() && stream.match(/^```+/)) {
stream.skipToEnd();
state.codeBlock = true;
return null;
@@ -78,25 +80,29 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
}
if (stream.sol() || state.ateSpace) {
state.ateSpace = false;
- if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) {
- // User/Project@SHA
- // User@SHA
- // SHA
- state.combineTokens = true;
- return "link";
- } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) {
- // User/Project#Num
- // User#Num
- // #Num
- state.combineTokens = true;
- return "link";
+ if (modeConfig.gitHubSpice !== false) {
+ if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) {
+ // User/Project@SHA
+ // User@SHA
+ // SHA
+ state.combineTokens = true;
+ return "link";
+ } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) {
+ // User/Project#Num
+ // User#Num
+ // #Num
+ state.combineTokens = true;
+ return "link";
+ }
}
}
- if (stream.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i) &&
- stream.string.slice(stream.start - 2, stream.start) != "](") {
+ if (stream.match(urlRE) &&
+ stream.string.slice(stream.start - 2, stream.start) != "](" &&
+ (stream.start == 0 || /\W/.test(stream.string.charAt(stream.start - 1)))) {
// URLs
// Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls
// And then (issue #1160) simplified to make it not crash the Chrome Regexp engine
+ // And then limited url schemes to the CommonMark list, so foo:bar isn't matched as a URL
state.combineTokens = true;
return "link";
}
@@ -109,15 +115,16 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
var markdownConfig = {
underscoresBreakWords: false,
taskLists: true,
- fencedCodeBlocks: true,
+ fencedCodeBlocks: '```',
strikethrough: true
};
for (var attr in modeConfig) {
markdownConfig[attr] = modeConfig[attr];
}
markdownConfig.name = "markdown";
- CodeMirror.defineMIME("gfmBase", markdownConfig);
- return CodeMirror.overlayMode(CodeMirror.getMode(config, "gfmBase"), gfmOverlay);
+ return CodeMirror.overlayMode(CodeMirror.getMode(config, markdownConfig), gfmOverlay);
+
}, "markdown");
+ CodeMirror.defineMIME("text/x-gfm", "gfm");
});
diff --git a/public/vendor/codemirror/mode/gfm/index.html b/public/vendor/codemirror/mode/gfm/index.html
index 7e38c52d..7e38c52d 100755..100644
--- a/public/vendor/codemirror/mode/gfm/index.html
+++ b/public/vendor/codemirror/mode/gfm/index.html
diff --git a/public/vendor/codemirror/mode/gfm/test.js b/public/vendor/codemirror/mode/gfm/test.js
index c2bc38fd..0dcd3619 100755..100644
--- a/public/vendor/codemirror/mode/gfm/test.js
+++ b/public/vendor/codemirror/mode/gfm/test.js
@@ -51,6 +51,11 @@
"[comment ```]",
"bar");
+ MT("fencedCodeBlocksNoTildes",
+ "~~~",
+ "foo",
+ "~~~");
+
MT("taskListAsterisk",
"[variable-2 * []] foo]", // Invalid; must have space or x between []
"[variable-2 * [ ]]bar]", // Invalid; must have space after ]
@@ -133,6 +138,15 @@
MT("vanillaLink",
"foo [link http://www.example.com/] bar");
+ MT("vanillaLinkNoScheme",
+ "foo [link www.example.com] bar");
+
+ MT("vanillaLinkHttps",
+ "foo [link https://www.example.com/] bar");
+
+ MT("vanillaLinkDataSchema",
+ "foo [link data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==] bar");
+
MT("vanillaLinkPunctuation",
"foo [link http://www.example.com/]. bar");
@@ -143,6 +157,9 @@
"foo [em *][em&link http://www.example.com/index.html][em *] bar");
MT("notALink",
+ "foo asfd:asdf bar");
+
+ MT("notALink",
"[comment ```css]",
"[tag foo] {[property color]:[keyword black];}",
"[comment ```][link http://www.example.com/]");
@@ -152,8 +169,8 @@
MT("notALink",
"[comment `foo]",
- "[link http://www.example.com/]",
- "[comment `foo]",
+ "[comment&link http://www.example.com/]",
+ "[comment `] foo",
"",
"[link http://www.example.com/]");
diff --git a/public/vendor/codemirror/mode/gherkin/gherkin.js b/public/vendor/codemirror/mode/gherkin/gherkin.js
index fc2ebee1..fc2ebee1 100755..100644
--- a/public/vendor/codemirror/mode/gherkin/gherkin.js
+++ b/public/vendor/codemirror/mode/gherkin/gherkin.js
diff --git a/public/vendor/codemirror/mode/gherkin/index.html b/public/vendor/codemirror/mode/gherkin/index.html
index af8184c9..af8184c9 100755..100644
--- a/public/vendor/codemirror/mode/gherkin/index.html
+++ b/public/vendor/codemirror/mode/gherkin/index.html
diff --git a/public/vendor/codemirror/mode/go/go.js b/public/vendor/codemirror/mode/go/go.js
index b121f4e6..21fe9a2d 100755..100644
--- a/public/vendor/codemirror/mode/go/go.js
+++ b/public/vendor/codemirror/mode/go/go.js
@@ -86,7 +86,7 @@ CodeMirror.defineMode("go", function(config) {
var escaped = false, next, end = false;
while ((next = stream.next()) != null) {
if (next == quote && !escaped) {end = true; break;}
- escaped = !escaped && next == "\\";
+ escaped = !escaped && quote != "`" && next == "\\";
}
if (end || !(escaped || quote == "`"))
state.tokenize = tokenBase;
diff --git a/public/vendor/codemirror/mode/go/index.html b/public/vendor/codemirror/mode/go/index.html
index 72e3b364..72e3b364 100755..100644
--- a/public/vendor/codemirror/mode/go/index.html
+++ b/public/vendor/codemirror/mode/go/index.html
diff --git a/public/vendor/codemirror/mode/groovy/groovy.js b/public/vendor/codemirror/mode/groovy/groovy.js
index 721933b0..721933b0 100755..100644
--- a/public/vendor/codemirror/mode/groovy/groovy.js
+++ b/public/vendor/codemirror/mode/groovy/groovy.js
diff --git a/public/vendor/codemirror/mode/groovy/index.html b/public/vendor/codemirror/mode/groovy/index.html
index bb0df078..bb0df078 100755..100644
--- a/public/vendor/codemirror/mode/groovy/index.html
+++ b/public/vendor/codemirror/mode/groovy/index.html
diff --git a/public/vendor/codemirror/mode/haml/haml.js b/public/vendor/codemirror/mode/haml/haml.js
index 8fe63b02..03ce8335 100755..100644
--- a/public/vendor/codemirror/mode/haml/haml.js
+++ b/public/vendor/codemirror/mode/haml/haml.js
@@ -85,8 +85,10 @@
state.tokenize = rubyInQuote(")");
return state.tokenize(stream, state);
} else if (ch == "{") {
- state.tokenize = rubyInQuote("}");
- return state.tokenize(stream, state);
+ if (!stream.match(/^\{%.*/)) {
+ state.tokenize = rubyInQuote("}");
+ return state.tokenize(stream, state);
+ }
}
}
diff --git a/public/vendor/codemirror/mode/haml/index.html b/public/vendor/codemirror/mode/haml/index.html
index 2894a938..2894a938 100755..100644
--- a/public/vendor/codemirror/mode/haml/index.html
+++ b/public/vendor/codemirror/mode/haml/index.html
diff --git a/public/vendor/codemirror/mode/haml/test.js b/public/vendor/codemirror/mode/haml/test.js
index 508458a4..508458a4 100755..100644
--- a/public/vendor/codemirror/mode/haml/test.js
+++ b/public/vendor/codemirror/mode/haml/test.js
diff --git a/public/vendor/codemirror/mode/handlebars/handlebars.js b/public/vendor/codemirror/mode/handlebars/handlebars.js
index 40dfea42..2174e538 100755..100644
--- a/public/vendor/codemirror/mode/handlebars/handlebars.js
+++ b/public/vendor/codemirror/mode/handlebars/handlebars.js
@@ -3,15 +3,15 @@
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
+ mod(require("../../lib/codemirror"), require("../../addon/mode/simple"), require("../../addon/mode/multiplex"));
else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
+ define(["../../lib/codemirror", "../../addon/mode/simple", "../../addon/mode/multiplex"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
- CodeMirror.defineSimpleMode("handlebars", {
+ CodeMirror.defineSimpleMode("handlebars-tags", {
start: [
{ regex: /\{\{!--/, push: "dash_comment", token: "comment" },
{ regex: /\{\{!/, push: "comment", token: "comment" },
@@ -21,8 +21,8 @@
{ regex: /\}\}/, pop: true, token: "tag" },
// Double and single quotes
- { regex: /"(?:[^\\]|\\.)*?"/, token: "string" },
- { regex: /'(?:[^\\]|\\.)*?'/, token: "string" },
+ { regex: /"(?:[^\\"]|\\.)*"?/, token: "string" },
+ { regex: /'(?:[^\\']|\\.)*'?/, token: "string" },
// Handlebars keywords
{ regex: />|[#\/]([A-Za-z_]\w*)/, token: "keyword" },
@@ -49,5 +49,14 @@
]
});
+ CodeMirror.defineMode("handlebars", function(config, parserConfig) {
+ var handlebars = CodeMirror.getMode(config, "handlebars-tags");
+ if (!parserConfig || !parserConfig.base) return handlebars;
+ return CodeMirror.multiplexingMode(
+ CodeMirror.getMode(config, parserConfig.base),
+ {open: "{{", close: "}}", mode: handlebars, parseDelimiters: true}
+ );
+ });
+
CodeMirror.defineMIME("text/x-handlebars-template", "handlebars");
});
diff --git a/public/vendor/codemirror/mode/handlebars/index.html b/public/vendor/codemirror/mode/handlebars/index.html
index beaef87a..4f82d602 100755..100644
--- a/public/vendor/codemirror/mode/handlebars/index.html
+++ b/public/vendor/codemirror/mode/handlebars/index.html
@@ -1,4 +1,4 @@
-<!doctype html>
+<!doctype html>
<title>CodeMirror: Handlebars mode</title>
<meta charset="utf-8"/>
@@ -61,22 +61,13 @@
</textarea></form>
<script>
- CodeMirror.defineMode("htmlhandlebars", function(config) {
- return CodeMirror.multiplexingMode(
- CodeMirror.getMode(config, "text/html"),
- {open: "{{", close: "}}",
- mode: CodeMirror.getMode(config, "handlebars"),
- parseDelimiters: true});
- });
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
matchBrackets: true,
- mode: "htmlhandlebars"
+ mode: {name: "handlebars", base: "text/html"}
});
</script>
- </script>
-
+
<p>Handlebars syntax highlighting for CodeMirror.</p>
<p><strong>MIME types defined:</strong> <code>text/x-handlebars-template</code></p>
diff --git a/public/vendor/codemirror/mode/haskell-literate/haskell-literate.js b/public/vendor/codemirror/mode/haskell-literate/haskell-literate.js
new file mode 100644
index 00000000..9358994d
--- /dev/null
+++ b/public/vendor/codemirror/mode/haskell-literate/haskell-literate.js
@@ -0,0 +1,43 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function (mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"), require("../haskell/haskell"))
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror", "../haskell/haskell"], mod)
+ else // Plain browser env
+ mod(CodeMirror)
+})(function (CodeMirror) {
+ "use strict"
+
+ CodeMirror.defineMode("haskell-literate", function (config, parserConfig) {
+ var baseMode = CodeMirror.getMode(config, (parserConfig && parserConfig.base) || "haskell")
+
+ return {
+ startState: function () {
+ return {
+ inCode: false,
+ baseState: CodeMirror.startState(baseMode)
+ }
+ },
+ token: function (stream, state) {
+ if (stream.sol()) {
+ if (state.inCode = stream.eat(">"))
+ return "meta"
+ }
+ if (state.inCode) {
+ return baseMode.token(stream, state.baseState)
+ } else {
+ stream.skipToEnd()
+ return "comment"
+ }
+ },
+ innerMode: function (state) {
+ return state.inCode ? {state: state.baseState, mode: baseMode} : null
+ }
+ }
+ }, "haskell")
+
+ CodeMirror.defineMIME("text/x-literate-haskell", "haskell-literate")
+})
diff --git a/public/vendor/codemirror/mode/haskell-literate/index.html b/public/vendor/codemirror/mode/haskell-literate/index.html
new file mode 100644
index 00000000..8c9bc60d
--- /dev/null
+++ b/public/vendor/codemirror/mode/haskell-literate/index.html
@@ -0,0 +1,282 @@
+<!doctype html>
+
+<title>CodeMirror: Haskell-literate mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="haskell-literate.js"></script>
+<script src="../haskell/haskell.js"></script>
+<style>.CodeMirror {
+ border-top : 1px solid #DDDDDD;
+ border-bottom : 1px solid #DDDDDD;
+}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo
+ src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">Haskell-literate</a>
+ </ul>
+</div>
+
+<article>
+ <h2>Haskell literate mode</h2>
+ <form>
+ <textarea id="code" name="code">
+> {-# LANGUAGE OverloadedStrings #-}
+> {-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
+> import Control.Applicative ((<$>), (<*>))
+> import Data.Maybe (isJust)
+
+> import Data.Text (Text)
+> import Text.Blaze ((!))
+> import qualified Data.Text as T
+> import qualified Happstack.Server as Happstack
+> import qualified Text.Blaze.Html5 as H
+> import qualified Text.Blaze.Html5.Attributes as A
+
+> import Text.Digestive
+> import Text.Digestive.Blaze.Html5
+> import Text.Digestive.Happstack
+> import Text.Digestive.Util
+
+Simple forms and validation
+---------------------------
+
+Let's start by creating a very simple datatype to represent a user:
+
+> data User = User
+> { userName :: Text
+> , userMail :: Text
+> } deriving (Show)
+
+And dive in immediately to create a `Form` for a user. The `Form v m a` type
+has three parameters:
+
+- `v`: the type for messages and errors (usually a `String`-like type, `Text` in
+ this case);
+- `m`: the monad we are operating in, not specified here;
+- `a`: the return type of the `Form`, in this case, this is obviously `User`.
+
+> userForm :: Monad m => Form Text m User
+
+We create forms by using the `Applicative` interface. A few form types are
+provided in the `Text.Digestive.Form` module, such as `text`, `string`,
+`bool`...
+
+In the `digestive-functors` library, the developer is required to label each
+field using the `.:` operator. This might look like a bit of a burden, but it
+allows you to do some really useful stuff, like separating the `Form` from the
+actual HTML layout.
+
+> userForm = User
+> <$> "name" .: text Nothing
+> <*> "mail" .: check "Not a valid email address" checkEmail (text Nothing)
+
+The `check` function enables you to validate the result of a form. For example,
+we can validate the email address with a really naive `checkEmail` function.
+
+> checkEmail :: Text -> Bool
+> checkEmail = isJust . T.find (== '@')
+
+More validation
+---------------
+
+For our example, we also want descriptions of Haskell libraries, and in order to
+do that, we need package versions...
+
+> type Version = [Int]
+
+We want to let the user input a version number such as `0.1.0.0`. This means we
+need to validate if the input `Text` is of this form, and then we need to parse
+it to a `Version` type. Fortunately, we can do this in a single function:
+`validate` allows conversion between values, which can optionally fail.
+
+`readMaybe :: Read a => String -> Maybe a` is a utility function imported from
+`Text.Digestive.Util`.
+
+> validateVersion :: Text -> Result Text Version
+> validateVersion = maybe (Error "Cannot parse version") Success .
+> mapM (readMaybe . T.unpack) . T.split (== '.')
+
+A quick test in GHCi:
+
+ ghci> validateVersion (T.pack "0.3.2.1")
+ Success [0,3,2,1]
+ ghci> validateVersion (T.pack "0.oops")
+ Error "Cannot parse version"
+
+It works! This means we can now easily add a `Package` type and a `Form` for it:
+
+> data Category = Web | Text | Math
+> deriving (Bounded, Enum, Eq, Show)
+
+> data Package = Package Text Version Category
+> deriving (Show)
+
+> packageForm :: Monad m => Form Text m Package
+> packageForm = Package
+> <$> "name" .: text Nothing
+> <*> "version" .: validate validateVersion (text (Just "0.0.0.1"))
+> <*> "category" .: choice categories Nothing
+> where
+> categories = [(x, T.pack (show x)) | x <- [minBound .. maxBound]]
+
+Composing forms
+---------------
+
+A release has an author and a package. Let's use this to illustrate the
+composability of the digestive-functors library: we can reuse the forms we have
+written earlier on.
+
+> data Release = Release User Package
+> deriving (Show)
+
+> releaseForm :: Monad m => Form Text m Release
+> releaseForm = Release
+> <$> "author" .: userForm
+> <*> "package" .: packageForm
+
+Views
+-----
+
+As mentioned before, one of the advantages of using digestive-functors is
+separation of forms and their actual HTML layout. In order to do this, we have
+another type, `View`.
+
+We can get a `View` from a `Form` by supplying input. A `View` contains more
+information than a `Form`, it has:
+
+- the original form;
+- the input given by the user;
+- any errors that have occurred.
+
+It is this view that we convert to HTML. For this tutorial, we use the
+[blaze-html] library, and some helpers from the `digestive-functors-blaze`
+library.
+
+[blaze-html]: http://jaspervdj.be/blaze/
+
+Let's write a view for the `User` form. As you can see, we here refer to the
+different fields in the `userForm`. The `errorList` will generate a list of
+errors for the `"mail"` field.
+
+> userView :: View H.Html -> H.Html
+> userView view = do
+> label "name" view "Name: "
+> inputText "name" view
+> H.br
+>
+> errorList "mail" view
+> label "mail" view "Email address: "
+> inputText "mail" view
+> H.br
+
+Like forms, views are also composable: let's illustrate that by adding a view
+for the `releaseForm`, in which we reuse `userView`. In order to do this, we
+take only the parts relevant to the author from the view by using `subView`. We
+can then pass the resulting view to our own `userView`.
+We have no special view code for `Package`, so we can just add that to
+`releaseView` as well. `childErrorList` will generate a list of errors for each
+child of the specified form. In this case, this means a list of errors from
+`"package.name"` and `"package.version"`. Note how we use `foo.bar` to refer to
+nested forms.
+
+> releaseView :: View H.Html -> H.Html
+> releaseView view = do
+> H.h2 "Author"
+> userView $ subView "author" view
+>
+> H.h2 "Package"
+> childErrorList "package" view
+>
+> label "package.name" view "Name: "
+> inputText "package.name" view
+> H.br
+>
+> label "package.version" view "Version: "
+> inputText "package.version" view
+> H.br
+>
+> label "package.category" view "Category: "
+> inputSelect "package.category" view
+> H.br
+
+The attentive reader might have wondered what the type parameter for `View` is:
+it is the `String`-like type used for e.g. error messages.
+But wait! We have
+ releaseForm :: Monad m => Form Text m Release
+ releaseView :: View H.Html -> H.Html
+... doesn't this mean that we need a `View Text` rather than a `View Html`? The
+answer is yes -- but having `View Html` allows us to write these views more
+easily with the `digestive-functors-blaze` library. Fortunately, we will be able
+to fix this using the `Functor` instance of `View`.
+ fmap :: Monad m => (v -> w) -> View v -> View w
+A backend
+---------
+To finish this tutorial, we need to be able to actually run this code. We need
+an HTTP server for that, and we use [Happstack] for this tutorial. The
+`digestive-functors-happstack` library gives about everything we need for this.
+[Happstack]: http://happstack.com/
+
+> site :: Happstack.ServerPart Happstack.Response
+> site = do
+> Happstack.decodeBody $ Happstack.defaultBodyPolicy "/tmp" 4096 4096 4096
+> r <- runForm "test" releaseForm
+> case r of
+> (view, Nothing) -> do
+> let view' = fmap H.toHtml view
+> Happstack.ok $ Happstack.toResponse $
+> template $
+> form view' "/" $ do
+> releaseView view'
+> H.br
+> inputSubmit "Submit"
+> (_, Just release) -> Happstack.ok $ Happstack.toResponse $
+> template $ do
+> css
+> H.h1 "Release received"
+> H.p $ H.toHtml $ show release
+>
+> main :: IO ()
+> main = Happstack.simpleHTTP Happstack.nullConf site
+
+Utilities
+---------
+
+> template :: H.Html -> H.Html
+> template body = H.docTypeHtml $ do
+> H.head $ do
+> H.title "digestive-functors tutorial"
+> css
+> H.body body
+> css :: H.Html
+> css = H.style ! A.type_ "text/css" $ do
+> "label {width: 130px; float: left; clear: both}"
+> "ul.digestive-functors-error-list {"
+> " color: red;"
+> " list-style-type: none;"
+> " padding-left: 0px;"
+> "}"
+ </textarea>
+ </form>
+
+ <p><strong>MIME types
+ defined:</strong> <code>text/x-literate-haskell</code>.</p>
+
+ <p>Parser configuration parameters recognized: <code>base</code> to
+ set the base mode (defaults to <code>"haskell"</code>).</p>
+
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: "haskell-literate"});
+ </script>
+
+</article>
diff --git a/public/vendor/codemirror/mode/haskell/haskell.js b/public/vendor/codemirror/mode/haskell/haskell.js
index fe0bab67..fe0bab67 100755..100644
--- a/public/vendor/codemirror/mode/haskell/haskell.js
+++ b/public/vendor/codemirror/mode/haskell/haskell.js
diff --git a/public/vendor/codemirror/mode/haskell/index.html b/public/vendor/codemirror/mode/haskell/index.html
index 42240b0f..42240b0f 100755..100644
--- a/public/vendor/codemirror/mode/haskell/index.html
+++ b/public/vendor/codemirror/mode/haskell/index.html
diff --git a/public/vendor/codemirror/mode/haxe/haxe.js b/public/vendor/codemirror/mode/haxe/haxe.js
index d49ad70f..a9573dd7 100755..100644
--- a/public/vendor/codemirror/mode/haxe/haxe.js
+++ b/public/vendor/codemirror/mode/haxe/haxe.js
@@ -16,23 +16,21 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
// Tokenizer
- var keywords = function(){
- function kw(type) {return {type: type, style: "keyword"};}
- var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
- var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"};
+ function kw(type) {return {type: type, style: "keyword"};}
+ var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
+ var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"};
var type = kw("typedef");
- return {
- "if": A, "while": A, "else": B, "do": B, "try": B,
- "return": C, "break": C, "continue": C, "new": C, "throw": C,
- "var": kw("var"), "inline":attribute, "static": attribute, "using":kw("import"),
+ var keywords = {
+ "if": A, "while": A, "else": B, "do": B, "try": B,
+ "return": C, "break": C, "continue": C, "new": C, "throw": C,
+ "var": kw("var"), "inline":attribute, "static": attribute, "using":kw("import"),
"public": attribute, "private": attribute, "cast": kw("cast"), "import": kw("import"), "macro": kw("macro"),
- "function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"),
- "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
- "in": operator, "never": kw("property_access"), "trace":kw("trace"),
+ "function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"),
+ "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
+ "in": operator, "never": kw("property_access"), "trace":kw("trace"),
"class": type, "abstract":type, "enum":type, "interface":type, "typedef":type, "extends":type, "implements":type, "dynamic":type,
- "true": atom, "false": atom, "null": atom
- };
- }();
+ "true": atom, "false": atom, "null": atom
+ };
var isOperatorChar = /[+\-*&%=<>!?|]/;
@@ -41,14 +39,13 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
return f(stream, state);
}
- function nextUntilUnescaped(stream, end) {
+ function toUnescaped(stream, end) {
var escaped = false, next;
while ((next = stream.next()) != null) {
if (next == end && !escaped)
- return false;
+ return true;
escaped = !escaped && next == "\\";
}
- return escaped;
}
// Used as scratch variables to communicate multiple values without
@@ -61,70 +58,58 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
function haxeTokenBase(stream, state) {
var ch = stream.next();
- if (ch == '"' || ch == "'")
+ if (ch == '"' || ch == "'") {
return chain(stream, state, haxeTokenString(ch));
- else if (/[\[\]{}\(\),;\:\.]/.test(ch))
+ } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
return ret(ch);
- else if (ch == "0" && stream.eat(/x/i)) {
+ } else if (ch == "0" && stream.eat(/x/i)) {
stream.eatWhile(/[\da-f]/i);
return ret("number", "number");
- }
- else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) {
- stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
+ } else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) {
+ stream.match(/^\d*(?:\.\d*(?!\.))?(?:[eE][+\-]?\d+)?/);
return ret("number", "number");
- }
- else if (state.reAllowed && (ch == "~" && stream.eat(/\//))) {
- nextUntilUnescaped(stream, "/");
+ } else if (state.reAllowed && (ch == "~" && stream.eat(/\//))) {
+ toUnescaped(stream, "/");
stream.eatWhile(/[gimsu]/);
return ret("regexp", "string-2");
- }
- else if (ch == "/") {
+ } else if (ch == "/") {
if (stream.eat("*")) {
return chain(stream, state, haxeTokenComment);
- }
- else if (stream.eat("/")) {
+ } else if (stream.eat("/")) {
stream.skipToEnd();
return ret("comment", "comment");
- }
- else {
+ } else {
stream.eatWhile(isOperatorChar);
return ret("operator", null, stream.current());
}
- }
- else if (ch == "#") {
+ } else if (ch == "#") {
stream.skipToEnd();
return ret("conditional", "meta");
- }
- else if (ch == "@") {
+ } else if (ch == "@") {
stream.eat(/:/);
stream.eatWhile(/[\w_]/);
return ret ("metadata", "meta");
- }
- else if (isOperatorChar.test(ch)) {
+ } else if (isOperatorChar.test(ch)) {
stream.eatWhile(isOperatorChar);
return ret("operator", null, stream.current());
- }
- else {
- var word;
- if(/[A-Z]/.test(ch))
- {
- stream.eatWhile(/[\w_<>]/);
- word = stream.current();
- return ret("type", "variable-3", word);
- }
- else
- {
+ } else {
+ var word;
+ if(/[A-Z]/.test(ch)) {
+ stream.eatWhile(/[\w_<>]/);
+ word = stream.current();
+ return ret("type", "variable-3", word);
+ } else {
stream.eatWhile(/[\w_]/);
var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
return (known && state.kwAllowed) ? ret(known.type, known.style, word) :
ret("variable", "variable", word);
- }
+ }
}
}
function haxeTokenString(quote) {
return function(stream, state) {
- if (!nextUntilUnescaped(stream, quote))
+ if (toUnescaped(stream, quote))
state.tokenize = haxeTokenBase;
return ret("string", "string");
};
@@ -176,27 +161,25 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
cc.pop()();
if (cx.marked) return cx.marked;
if (type == "variable" && inScope(state, content)) return "variable-2";
- if (type == "variable" && imported(state, content)) return "variable-3";
+ if (type == "variable" && imported(state, content)) return "variable-3";
return style;
}
}
}
- function imported(state, typename)
- {
- if (/[a-z]/.test(typename.charAt(0)))
- return false;
- var len = state.importedtypes.length;
- for (var i = 0; i<len; i++)
- if(state.importedtypes[i]==typename) return true;
+ function imported(state, typename) {
+ if (/[a-z]/.test(typename.charAt(0)))
+ return false;
+ var len = state.importedtypes.length;
+ for (var i = 0; i<len; i++)
+ if(state.importedtypes[i]==typename) return true;
}
-
function registerimport(importname) {
- var state = cx.state;
- for (var t = state.importedtypes; t; t = t.next)
- if(t.name == importname) return;
- state.importedtypes = { name: importname, next: state.importedtypes };
+ var state = cx.state;
+ for (var t = state.importedtypes; t; t = t.next)
+ if(t.name == importname) return;
+ state.importedtypes = { name: importname, next: state.importedtypes };
}
// Combinator utils
@@ -208,13 +191,20 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
pass.apply(null, arguments);
return true;
}
+ function inList(name, list) {
+ for (var v = list; v; v = v.next)
+ if (v.name == name) return true;
+ return false;
+ }
function register(varname) {
var state = cx.state;
if (state.context) {
cx.marked = "def";
- for (var v = state.localVars; v; v = v.next)
- if (v.name == varname) return;
+ if (inList(varname, state.localVars)) return;
state.localVars = {name: varname, next: state.localVars};
+ } else if (state.globalVars) {
+ if (inList(varname, state.globalVars)) return;
+ state.globalVars = {name: varname, next: state.globalVars};
}
}
@@ -229,6 +219,7 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
cx.state.localVars = cx.state.context.vars;
cx.state.context = cx.state.context.prev;
}
+ popcontext.lex = true;
function pushlex(type, info) {
var result = function() {
var state = cx.state;
@@ -252,7 +243,7 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
if (type == wanted) return cont();
else if (wanted == ";") return pass();
else return cont(f);
- };
+ }
return f;
}
@@ -266,25 +257,26 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
if (type == "attribute") return cont(maybeattribute);
if (type == "function") return cont(functiondef);
if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"),
- poplex, statement, poplex);
+ poplex, statement, poplex);
if (type == "variable") return cont(pushlex("stat"), maybelabel);
if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
- block, poplex, poplex);
+ block, poplex, poplex);
if (type == "case") return cont(expression, expect(":"));
if (type == "default") return cont(expect(":"));
if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
- statement, poplex, popcontext);
+ statement, poplex, popcontext);
if (type == "import") return cont(importdef, expect(";"));
if (type == "typedef") return cont(typedef);
return pass(pushlex("stat"), expression, expect(";"), poplex);
}
function expression(type) {
if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator);
+ if (type == "type" ) return cont(maybeoperator);
if (type == "function") return cont(functiondef);
if (type == "keyword c") return cont(maybeexpression);
if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator);
if (type == "operator") return cont(expression);
- if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator);
+ if (type == "[") return cont(pushlex("]"), commasep(maybeexpression, "]"), poplex, maybeoperator);
if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
return cont();
}
@@ -318,14 +310,14 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
}
function importdef (type, value) {
- if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); }
- else if(type == "variable" || type == "property" || type == "." || value == "*") return cont(importdef);
+ if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); }
+ else if(type == "variable" || type == "property" || type == "." || value == "*") return cont(importdef);
}
function typedef (type, value)
{
- if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); }
- else if (type == "type" && /[A-Z]/.test(value.charAt(0))) { return cont(); }
+ if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); }
+ else if (type == "type" && /[A-Z]/.test(value.charAt(0))) { return cont(); }
}
function maybelabel(type) {
@@ -363,16 +355,19 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
if (type == ",") return cont(vardef1);
}
function forspec1(type, value) {
- if (type == "variable") {
- register(value);
- }
- return cont(pushlex(")"), pushcontext, forin, expression, poplex, statement, popcontext);
+ if (type == "variable") {
+ register(value);
+ return cont(forin, expression)
+ } else {
+ return pass()
+ }
}
function forin(_type, value) {
if (value == "in") return cont();
}
function functiondef(type, value) {
- if (type == "variable") {register(value); return cont(functiondef);}
+ //function names starting with upper-case letters are recognised as types, so cludging them together here.
+ if (type == "variable" || type == "type") {register(value); return cont(functiondef);}
if (value == "new") return cont(functiondef);
if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, typeuse, statement, popcontext);
}
@@ -392,21 +387,23 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
}
// Interface
-
return {
startState: function(basecolumn) {
- var defaulttypes = ["Int", "Float", "String", "Void", "Std", "Bool", "Dynamic", "Array"];
- return {
+ var defaulttypes = ["Int", "Float", "String", "Void", "Std", "Bool", "Dynamic", "Array"];
+ var state = {
tokenize: haxeTokenBase,
reAllowed: true,
kwAllowed: true,
cc: [],
lexical: new HaxeLexical((basecolumn || 0) - indentUnit, 0, "block", false),
localVars: parserConfig.localVars,
- importedtypes: defaulttypes,
+ importedtypes: defaulttypes,
context: parserConfig.localVars && {vars: parserConfig.localVars},
indented: 0
};
+ if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
+ state.globalVars = parserConfig.globalVars;
+ return state;
},
token: function(stream, state) {
diff --git a/public/vendor/codemirror/mode/haxe/index.html b/public/vendor/codemirror/mode/haxe/index.html
index d415b5e1..d415b5e1 100755..100644
--- a/public/vendor/codemirror/mode/haxe/index.html
+++ b/public/vendor/codemirror/mode/haxe/index.html
diff --git a/public/vendor/codemirror/mode/htmlembedded/htmlembedded.js b/public/vendor/codemirror/mode/htmlembedded/htmlembedded.js
index 464dc57f..464dc57f 100755..100644
--- a/public/vendor/codemirror/mode/htmlembedded/htmlembedded.js
+++ b/public/vendor/codemirror/mode/htmlembedded/htmlembedded.js
diff --git a/public/vendor/codemirror/mode/htmlembedded/index.html b/public/vendor/codemirror/mode/htmlembedded/index.html
index 365ef8f3..365ef8f3 100755..100644
--- a/public/vendor/codemirror/mode/htmlembedded/index.html
+++ b/public/vendor/codemirror/mode/htmlembedded/index.html
diff --git a/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js b/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js
index 24552e2d..21e74f16 100755..100644
--- a/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js
+++ b/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js
@@ -9,113 +9,142 @@
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
-"use strict";
-
-CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {
- var htmlMode = CodeMirror.getMode(config, {name: "xml",
- htmlMode: true,
- multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,
- multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag});
- var cssMode = CodeMirror.getMode(config, "css");
-
- var scriptTypes = [], scriptTypesConf = parserConfig && parserConfig.scriptTypes;
- scriptTypes.push({matches: /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,
- mode: CodeMirror.getMode(config, "javascript")});
- if (scriptTypesConf) for (var i = 0; i < scriptTypesConf.length; ++i) {
- var conf = scriptTypesConf[i];
- scriptTypes.push({matches: conf.matches, mode: conf.mode && CodeMirror.getMode(config, conf.mode)});
- }
- scriptTypes.push({matches: /./,
- mode: CodeMirror.getMode(config, "text/plain")});
-
- function html(stream, state) {
- var tagName = state.htmlState.tagName;
- if (tagName) tagName = tagName.toLowerCase();
- var style = htmlMode.token(stream, state.htmlState);
- if (tagName == "script" && /\btag\b/.test(style) && stream.current() == ">") {
- // Script block: mode to change to depends on type attribute
- var scriptType = stream.string.slice(Math.max(0, stream.pos - 100), stream.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);
- scriptType = scriptType ? scriptType[1] : "";
- if (scriptType && /[\"\']/.test(scriptType.charAt(0))) scriptType = scriptType.slice(1, scriptType.length - 1);
- for (var i = 0; i < scriptTypes.length; ++i) {
- var tp = scriptTypes[i];
- if (typeof tp.matches == "string" ? scriptType == tp.matches : tp.matches.test(scriptType)) {
- if (tp.mode) {
- state.token = script;
- state.localMode = tp.mode;
- state.localState = tp.mode.startState && tp.mode.startState(htmlMode.indent(state.htmlState, ""));
- }
- break;
- }
- }
- } else if (tagName == "style" && /\btag\b/.test(style) && stream.current() == ">") {
- state.token = css;
- state.localMode = cssMode;
- state.localState = cssMode.startState(htmlMode.indent(state.htmlState, ""));
- }
- return style;
- }
+ "use strict";
+
+ var defaultTags = {
+ script: [
+ ["lang", /(javascript|babel)/i, "javascript"],
+ ["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i, "javascript"],
+ ["type", /./, "text/plain"],
+ [null, null, "javascript"]
+ ],
+ style: [
+ ["lang", /^css$/i, "css"],
+ ["type", /^(text\/)?(x-)?(stylesheet|css)$/i, "css"],
+ ["type", /./, "text/plain"],
+ [null, null, "css"]
+ ]
+ };
+
function maybeBackup(stream, pat, style) {
- var cur = stream.current();
- var close = cur.search(pat);
- if (close > -1) stream.backUp(cur.length - close);
- else if (cur.match(/<\/?$/)) {
+ var cur = stream.current(), close = cur.search(pat);
+ if (close > -1) {
+ stream.backUp(cur.length - close);
+ } else if (cur.match(/<\/?$/)) {
stream.backUp(cur.length);
if (!stream.match(pat, false)) stream.match(cur);
}
return style;
}
- function script(stream, state) {
- if (stream.match(/^<\/\s*script\s*>/i, false)) {
- state.token = html;
- state.localState = state.localMode = null;
- return null;
- }
- return maybeBackup(stream, /<\/\s*script\s*>/,
- state.localMode.token(stream, state.localState));
+
+ var attrRegexpCache = {};
+ function getAttrRegexp(attr) {
+ var regexp = attrRegexpCache[attr];
+ if (regexp) return regexp;
+ return attrRegexpCache[attr] = new RegExp("\\s+" + attr + "\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*");
+ }
+
+ function getAttrValue(stream, attr) {
+ var pos = stream.pos, match;
+ while (pos >= 0 && stream.string.charAt(pos) !== "<") pos--;
+ if (pos < 0) return pos;
+ if (match = stream.string.slice(pos, stream.pos).match(getAttrRegexp(attr)))
+ return match[2];
+ return "";
+ }
+
+ function getTagRegexp(tagName, anchored) {
+ return new RegExp((anchored ? "^" : "") + "<\/\s*" + tagName + "\s*>", "i");
}
- function css(stream, state) {
- if (stream.match(/^<\/\s*style\s*>/i, false)) {
- state.token = html;
- state.localState = state.localMode = null;
- return null;
+
+ function addTags(from, to) {
+ for (var tag in from) {
+ var dest = to[tag] || (to[tag] = []);
+ var source = from[tag];
+ for (var i = source.length - 1; i >= 0; i--)
+ dest.unshift(source[i])
}
- return maybeBackup(stream, /<\/\s*style\s*>/,
- cssMode.token(stream, state.localState));
}
- return {
- startState: function() {
- var state = htmlMode.startState();
- return {token: html, localMode: null, localState: null, htmlState: state};
- },
-
- copyState: function(state) {
- if (state.localState)
- var local = CodeMirror.copyState(state.localMode, state.localState);
- return {token: state.token, localMode: state.localMode, localState: local,
- htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
- },
-
- token: function(stream, state) {
- return state.token(stream, state);
- },
-
- indent: function(state, textAfter) {
- if (!state.localMode || /^\s*<\//.test(textAfter))
- return htmlMode.indent(state.htmlState, textAfter);
- else if (state.localMode.indent)
- return state.localMode.indent(state.localState, textAfter);
- else
- return CodeMirror.Pass;
- },
-
- innerMode: function(state) {
- return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode};
+ function findMatchingMode(tagInfo, stream) {
+ for (var i = 0; i < tagInfo.length; i++) {
+ var spec = tagInfo[i];
+ if (!spec[0] || spec[1].test(getAttrValue(stream, spec[0]))) return spec[2];
}
- };
-}, "xml", "javascript", "css");
+ }
+
+ CodeMirror.defineMode("htmlmixed", function (config, parserConfig) {
+ var htmlMode = CodeMirror.getMode(config, {
+ name: "xml",
+ htmlMode: true,
+ multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,
+ multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag
+ });
+
+ var tags = {};
+ var configTags = parserConfig && parserConfig.tags, configScript = parserConfig && parserConfig.scriptTypes;
+ addTags(defaultTags, tags);
+ if (configTags) addTags(configTags, tags);
+ if (configScript) for (var i = configScript.length - 1; i >= 0; i--)
+ tags.script.unshift(["type", configScript[i].matches, configScript[i].mode])
+
+ function html(stream, state) {
+ var tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase();
+ var tagInfo = tagName && tags.hasOwnProperty(tagName) && tags[tagName];
+
+ var style = htmlMode.token(stream, state.htmlState), modeSpec;
+
+ if (tagInfo && /\btag\b/.test(style) && stream.current() === ">" &&
+ (modeSpec = findMatchingMode(tagInfo, stream))) {
+ var mode = CodeMirror.getMode(config, modeSpec);
+ var endTagA = getTagRegexp(tagName, true), endTag = getTagRegexp(tagName, false);
+ state.token = function (stream, state) {
+ if (stream.match(endTagA, false)) {
+ state.token = html;
+ state.localState = state.localMode = null;
+ return null;
+ }
+ return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState));
+ };
+ state.localMode = mode;
+ state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, ""));
+ }
+ return style;
+ };
+
+ return {
+ startState: function () {
+ var state = htmlMode.startState();
+ return {token: html, localMode: null, localState: null, htmlState: state};
+ },
+
+ copyState: function (state) {
+ var local;
+ if (state.localState) {
+ local = CodeMirror.copyState(state.localMode, state.localState);
+ }
+ return {token: state.token, localMode: state.localMode, localState: local,
+ htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
+ },
+
+ token: function (stream, state) {
+ return state.token(stream, state);
+ },
-CodeMirror.defineMIME("text/html", "htmlmixed");
+ indent: function (state, textAfter) {
+ if (!state.localMode || /^\s*<\//.test(textAfter))
+ return htmlMode.indent(state.htmlState, textAfter);
+ else if (state.localMode.indent)
+ return state.localMode.indent(state.localState, textAfter);
+ else
+ return CodeMirror.Pass;
+ },
+
+ innerMode: function (state) {
+ return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode};
+ }
+ };
+ }, "xml", "javascript", "css");
+ CodeMirror.defineMIME("text/html", "htmlmixed");
});
diff --git a/public/vendor/codemirror/mode/htmlmixed/index.html b/public/vendor/codemirror/mode/htmlmixed/index.html
index f94df9e2..f94df9e2 100755..100644
--- a/public/vendor/codemirror/mode/htmlmixed/index.html
+++ b/public/vendor/codemirror/mode/htmlmixed/index.html
diff --git a/public/vendor/codemirror/mode/http/http.js b/public/vendor/codemirror/mode/http/http.js
index 9a3c5f9f..9a3c5f9f 100755..100644
--- a/public/vendor/codemirror/mode/http/http.js
+++ b/public/vendor/codemirror/mode/http/http.js
diff --git a/public/vendor/codemirror/mode/http/index.html b/public/vendor/codemirror/mode/http/index.html
index 0b8d5315..0b8d5315 100755..100644
--- a/public/vendor/codemirror/mode/http/index.html
+++ b/public/vendor/codemirror/mode/http/index.html
diff --git a/public/vendor/codemirror/mode/idl/idl.js b/public/vendor/codemirror/mode/idl/idl.js
index 07308d71..07308d71 100755..100644
--- a/public/vendor/codemirror/mode/idl/idl.js
+++ b/public/vendor/codemirror/mode/idl/idl.js
diff --git a/public/vendor/codemirror/mode/idl/index.html b/public/vendor/codemirror/mode/idl/index.html
index 4c169e2d..4c169e2d 100755..100644
--- a/public/vendor/codemirror/mode/idl/index.html
+++ b/public/vendor/codemirror/mode/idl/index.html
diff --git a/public/vendor/codemirror/mode/index.html b/public/vendor/codemirror/mode/index.html
index 8c6d0a43..a6c293ec 100755..100644
--- a/public/vendor/codemirror/mode/index.html
+++ b/public/vendor/codemirror/mode/index.html
@@ -33,12 +33,16 @@ option.</p>
<li><a href="apl/index.html">APL</a></li>
<li><a href="asn.1/index.html">ASN.1</a></li>
<li><a href="asterisk/index.html">Asterisk dialplan</a></li>
+ <li><a href="brainfuck/index.html">Brainfuck</a></li>
<li><a href="clike/index.html">C, C++, C#</a></li>
+ <li><a href="clike/index.html">Ceylon</a></li>
<li><a href="clojure/index.html">Clojure</a></li>
+ <li><a href="css/gss.html">Closure Stylesheets (GSS)</a></li>
<li><a href="cmake/index.html">CMake</a></li>
<li><a href="cobol/index.html">COBOL</a></li>
<li><a href="coffeescript/index.html">CoffeeScript</a></li>
<li><a href="commonlisp/index.html">Common Lisp</a></li>
+ <li><a href="crystal/index.html">Crystal</a></li>
<li><a href="css/index.html">CSS</a></li>
<li><a href="cypher/index.html">Cypher</a></li>
<li><a href="python/index.html">Cython</a></li>
@@ -64,7 +68,7 @@ option.</p>
<li><a href="groovy/index.html">Groovy</a></li>
<li><a href="haml/index.html">HAML</a></li>
<li><a href="handlebars/index.html">Handlebars</a></li>
- <li><a href="haskell/index.html">Haskell</a></li>
+ <li><a href="haskell/index.html">Haskell</a> (<a href="haskell-literate/index.html">Literate</a>)</li>
<li><a href="haxe/index.html">Haxe</a></li>
<li><a href="htmlembedded/index.html">HTML embedded</a> (JSP, ASP.NET)</li>
<li><a href="htmlmixed/index.html">HTML mixed-mode</a></li>
@@ -72,7 +76,7 @@ option.</p>
<li><a href="idl/index.html">IDL</a></li>
<li><a href="clike/index.html">Java</a></li>
<li><a href="jade/index.html">Jade</a></li>
- <li><a href="javascript/index.html">JavaScript</a></li>
+ <li><a href="javascript/index.html">JavaScript</a> (<a href="jsx/index.html">JSX</a>)</li>
<li><a href="jinja2/index.html">Jinja2</a></li>
<li><a href="julia/index.html">Julia</a></li>
<li><a href="kotlin/index.html">Kotlin</a></li>
@@ -83,12 +87,15 @@ option.</p>
<li><a href="mathematica/index.html">Mathematica</a></li>
<li><a href="mirc/index.html">mIRC</a></li>
<li><a href="modelica/index.html">Modelica</a></li>
+ <li><a href="mscgen/index.html">MscGen</a></li>
<li><a href="mumps/index.html">MUMPS</a></li>
<li><a href="nginx/index.html">Nginx</a></li>
+ <li><a href="nsis/index.html">NSIS</a></li>
<li><a href="ntriples/index.html">NTriples</a></li>
<li><a href="clike/index.html">Objective C</a></li>
<li><a href="mllike/index.html">OCaml</a></li>
<li><a href="octave/index.html">Octave</a> (MATLAB)</li>
+ <li><a href="oz/index.html">Oz</a></li>
<li><a href="pascal/index.html">Pascal</a></li>
<li><a href="pegjs/index.html">PEG.js</a></li>
<li><a href="perl/index.html">Perl</a></li>
@@ -119,6 +126,7 @@ option.</p>
<li><a href="stylus/index.html">Stylus</a></li>
<li><a href="sql/index.html">SQL</a> (several dialects)</li>
<li><a href="sparql/index.html">SPARQL</a></li>
+ <li><a href="clike/index.html">Squirrel</a></li>
<li><a href="swift/index.html">Swift</a></li>
<li><a href="stex/index.html">sTeX, LaTeX</a></li>
<li><a href="tcl/index.html">Tcl</a></li>
@@ -136,9 +144,12 @@ option.</p>
<li><a href="vbscript/index.html">VBScript</a></li>
<li><a href="velocity/index.html">Velocity</a></li>
<li><a href="verilog/index.html">Verilog/SystemVerilog</a></li>
+ <li><a href="vhdl/index.html">VHDL</a></li>
+ <li><a href="vue/index.html">Vue.js app</a></li>
<li><a href="xml/index.html">XML/HTML</a></li>
<li><a href="xquery/index.html">XQuery</a></li>
<li><a href="yaml/index.html">YAML</a></li>
+ <li><a href="yaml-frontmatter/index.html">YAML frontmatter</a></li>
<li><a href="z80/index.html">Z80</a></li>
</ul>
</div>
diff --git a/public/vendor/codemirror/mode/jade/index.html b/public/vendor/codemirror/mode/jade/index.html
index e534981b..e534981b 100755..100644
--- a/public/vendor/codemirror/mode/jade/index.html
+++ b/public/vendor/codemirror/mode/jade/index.html
diff --git a/public/vendor/codemirror/mode/jade/jade.js b/public/vendor/codemirror/mode/jade/jade.js
index 96fadb19..1db069a9 100755..100644
--- a/public/vendor/codemirror/mode/jade/jade.js
+++ b/public/vendor/codemirror/mode/jade/jade.js
@@ -74,7 +74,7 @@ CodeMirror.defineMode('jade', function (config) {
res.javaScriptArguments = this.javaScriptArguments;
res.javaScriptArgumentsDepth = this.javaScriptArgumentsDepth;
res.isInterpolating = this.isInterpolating;
- res.interpolationNesting = this.intpolationNesting;
+ res.interpolationNesting = this.interpolationNesting;
res.jsState = CodeMirror.copyState(jsMode, this.jsState);
@@ -167,7 +167,7 @@ CodeMirror.defineMode('jade', function (config) {
if (state.interpolationNesting < 0) {
stream.next();
state.isInterpolating = false;
- return 'puncutation';
+ return 'punctuation';
}
} else if (stream.peek() === '{') {
state.interpolationNesting++;
@@ -583,7 +583,7 @@ CodeMirror.defineMode('jade', function (config) {
copyState: copyState,
token: nextToken
};
-});
+}, 'javascript', 'css', 'htmlmixed');
CodeMirror.defineMIME('text/x-jade', 'jade');
diff --git a/public/vendor/codemirror/mode/javascript/index.html b/public/vendor/codemirror/mode/javascript/index.html
index 592a133d..592a133d 100755..100644
--- a/public/vendor/codemirror/mode/javascript/index.html
+++ b/public/vendor/codemirror/mode/javascript/index.html
diff --git a/public/vendor/codemirror/mode/javascript/javascript.js b/public/vendor/codemirror/mode/javascript/javascript.js
index c86f49e1..fa5721d5 100755..100644
--- a/public/vendor/codemirror/mode/javascript/javascript.js
+++ b/public/vendor/codemirror/mode/javascript/javascript.js
@@ -13,6 +13,11 @@
})(function(CodeMirror) {
"use strict";
+function expressionAllowed(stream, state, backUp) {
+ return /^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(state.lastType) ||
+ (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))
+}
+
CodeMirror.defineMode("javascript", function(config, parserConfig) {
var indentUnit = config.indentUnit;
var statementIndent = parserConfig.statementIndent;
@@ -30,13 +35,13 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
var jsKeywords = {
"if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
- "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, "debugger": C,
+ "return": C, "break": C, "continue": C, "new": kw("new"), "delete": C, "throw": C, "debugger": C,
"var": kw("var"), "const": kw("var"), "let": kw("var"),
"function": kw("function"), "catch": kw("catch"),
"for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
"in": operator, "typeof": operator, "instanceof": operator,
"true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
- "this": kw("this"), "module": kw("module"), "class": kw("class"), "super": kw("atom"),
+ "this": kw("this"), "class": kw("class"), "super": kw("atom"),
"yield": C, "export": kw("export"), "import": kw("import"), "extends": C
};
@@ -45,18 +50,23 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
var type = {type: "variable", style: "variable-3"};
var tsKeywords = {
// object-like things
- "interface": kw("interface"),
- "extends": kw("extends"),
- "constructor": kw("constructor"),
+ "interface": kw("class"),
+ "implements": C,
+ "namespace": C,
+ "module": kw("module"),
+ "enum": kw("module"),
// scope modifiers
- "public": kw("public"),
- "private": kw("private"),
- "protected": kw("protected"),
- "static": kw("static"),
+ "public": kw("modifier"),
+ "private": kw("modifier"),
+ "protected": kw("modifier"),
+ "abstract": kw("modifier"),
+
+ // operators
+ "as": operator,
// types
- "string": type, "number": type, "bool": type, "any": type
+ "string": type, "number": type, "boolean": type, "any": type
};
for (var attr in tsKeywords) {
@@ -105,6 +115,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
} else if (ch == "0" && stream.eat(/x/i)) {
stream.eatWhile(/[\da-f]/i);
return ret("number", "number");
+ } else if (ch == "0" && stream.eat(/o/i)) {
+ stream.eatWhile(/[0-7]/i);
+ return ret("number", "number");
+ } else if (ch == "0" && stream.eat(/b/i)) {
+ stream.eatWhile(/[01]/i);
+ return ret("number", "number");
} else if (/\d/.test(ch)) {
stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
return ret("number", "number");
@@ -115,8 +131,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
} else if (stream.eat("/")) {
stream.skipToEnd();
return ret("comment", "comment");
- } else if (state.lastType == "operator" || state.lastType == "keyword c" ||
- state.lastType == "sof" || /^[\[{}\(,;:]$/.test(state.lastType)) {
+ } else if (expressionAllowed(stream, state, 1)) {
readRegexp(stream);
stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);
return ret("regexp", "string-2");
@@ -275,8 +290,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
return false;
}
var state = cx.state;
+ cx.marked = "def";
if (state.context) {
- cx.marked = "def";
if (inList(state.localVars)) return;
state.localVars = {name: varname, next: state.localVars};
} else {
@@ -347,10 +362,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "default") return cont(expect(":"));
if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
statement, poplex, popcontext);
- if (type == "module") return cont(pushlex("form"), pushcontext, afterModule, popcontext, poplex);
if (type == "class") return cont(pushlex("form"), className, poplex);
- if (type == "export") return cont(pushlex("form"), afterExport, poplex);
- if (type == "import") return cont(pushlex("form"), afterImport, poplex);
+ if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
+ if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
+ if (type == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex)
return pass(pushlex("stat"), expression, expect(";"), poplex);
}
function expression(type) {
@@ -374,7 +389,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
if (type == "{") return contCommasep(objprop, "}", null, maybeop);
- if (type == "quasi") { return pass(quasi, maybeop); }
+ if (type == "quasi") return pass(quasi, maybeop);
+ if (type == "new") return cont(maybeTarget(noComma));
return cont();
}
function maybeexpression(type) {
@@ -425,6 +441,18 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
findFatArrow(cx.stream, cx.state);
return pass(type == "{" ? statement : expressionNoComma);
}
+ function maybeTarget(noComma) {
+ return function(type) {
+ if (type == ".") return cont(noComma ? targetNoComma : target);
+ else return pass(noComma ? expressionNoComma : expression);
+ };
+ }
+ function target(_, value) {
+ if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); }
+ }
+ function targetNoComma(_, value) {
+ if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); }
+ }
function maybelabel(type) {
if (type == ":") return cont(poplex, statement);
return pass(maybeoperatorComma, expect(";"), poplex);
@@ -442,8 +470,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
return cont(afterprop);
} else if (type == "jsonld-keyword") {
return cont(afterprop);
+ } else if (type == "modifier") {
+ return cont(objprop)
} else if (type == "[") {
return cont(expression, expect("]"), afterprop);
+ } else if (type == "spread") {
+ return cont(expression);
}
}
function getterSetter(type) {
@@ -492,7 +524,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
return pass(pattern, maybetype, maybeAssign, vardefCont);
}
function pattern(type, value) {
+ if (type == "modifier") return cont(pattern)
if (type == "variable") { register(value); return cont(); }
+ if (type == "spread") return cont(pattern);
if (type == "[") return contCommasep(pattern, "]");
if (type == "{") return contCommasep(proppattern, "}");
}
@@ -502,6 +536,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
return cont(maybeAssign);
}
if (type == "variable") cx.marked = "property";
+ if (type == "spread") return cont(pattern);
+ if (type == "}") return pass();
return cont(expect(":"), pattern, maybeAssign);
}
function maybeAssign(_type, value) {
@@ -572,10 +608,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
cx.marked = "property";
return cont();
}
- function afterModule(type, value) {
- if (type == "string") return cont(statement);
- if (type == "variable") { register(value); return cont(maybeFrom); }
- }
function afterExport(_type, value) {
if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }
if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); }
@@ -628,7 +660,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
localVars: parserConfig.localVars,
context: parserConfig.localVars && {vars: parserConfig.localVars},
- indented: 0
+ indented: basecolumn || 0
};
if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
state.globalVars = parserConfig.globalVars;
@@ -684,7 +716,13 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
helperType: jsonMode ? "json" : "javascript",
jsonldMode: jsonldMode,
- jsonMode: jsonMode
+ jsonMode: jsonMode,
+
+ expressionAllowed: expressionAllowed,
+ skipExpression: function(state) {
+ var top = state.cc[state.cc.length - 1]
+ if (top == expression || top == expressionNoComma) state.cc.pop()
+ }
};
});
diff --git a/public/vendor/codemirror/mode/javascript/json-ld.html b/public/vendor/codemirror/mode/javascript/json-ld.html
index 3a37f0bc..3a37f0bc 100755..100644
--- a/public/vendor/codemirror/mode/javascript/json-ld.html
+++ b/public/vendor/codemirror/mode/javascript/json-ld.html
diff --git a/public/vendor/codemirror/mode/javascript/test.js b/public/vendor/codemirror/mode/javascript/test.js
index 092d25dc..cb43d089 100755..100644
--- a/public/vendor/codemirror/mode/javascript/test.js
+++ b/public/vendor/codemirror/mode/javascript/test.js
@@ -6,7 +6,7 @@
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
MT("locals",
- "[keyword function] [variable foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }");
+ "[keyword function] [def foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }");
MT("comma-and-binop",
"[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }");
@@ -17,8 +17,12 @@
" [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];",
"})();");
+ MT("destructure_trailing_comma",
+ "[keyword let] {[def a], [def b],} [operator =] [variable foo];",
+ "[keyword let] [def c];"); // Parser still in good state?
+
MT("class_body",
- "[keyword class] [variable Foo] {",
+ "[keyword class] [def Foo] {",
" [property constructor]() {}",
" [property sayName]() {",
" [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];",
@@ -26,7 +30,7 @@
"}");
MT("class",
- "[keyword class] [variable Point] [keyword extends] [variable SuperThing] {",
+ "[keyword class] [def Point] [keyword extends] [variable SuperThing] {",
" [property get] [property prop]() { [keyword return] [number 24]; }",
" [property constructor]([def x], [def y]) {",
" [keyword super]([string 'something']);",
@@ -34,52 +38,45 @@
" }",
"}");
- MT("module",
- "[keyword module] [string 'foo'] {",
- " [keyword export] [keyword let] [def x] [operator =] [number 42];",
- " [keyword export] [keyword *] [keyword from] [string 'somewhere'];",
- "}");
-
MT("import",
- "[keyword function] [variable foo]() {",
+ "[keyword function] [def foo]() {",
" [keyword import] [def $] [keyword from] [string 'jquery'];",
- " [keyword module] [def crypto] [keyword from] [string 'crypto'];",
" [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];",
"}");
MT("const",
- "[keyword function] [variable f]() {",
+ "[keyword function] [def f]() {",
" [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];",
"}");
MT("for/of",
- "[keyword for]([keyword let] [variable of] [keyword of] [variable something]) {}");
+ "[keyword for]([keyword let] [def of] [keyword of] [variable something]) {}");
MT("generator",
- "[keyword function*] [variable repeat]([def n]) {",
+ "[keyword function*] [def repeat]([def n]) {",
" [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])",
" [keyword yield] [variable-2 i];",
"}");
MT("quotedStringAddition",
- "[keyword let] [variable f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];");
+ "[keyword let] [def f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];");
MT("quotedFatArrow",
- "[keyword let] [variable f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];");
+ "[keyword let] [def f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];");
MT("fatArrow",
"[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);",
"[variable a];", // No longer in scope
- "[keyword let] [variable f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];",
+ "[keyword let] [def f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];",
"[variable c];");
MT("spread",
- "[keyword function] [variable f]([def a], [meta ...][def b]) {",
+ "[keyword function] [def f]([def a], [meta ...][def b]) {",
" [variable something]([variable-2 a], [meta ...][variable-2 b]);",
"}");
MT("comprehension",
- "[keyword function] [variable f]() {",
+ "[keyword function] [def f]() {",
" [[([variable x] [operator +] [number 1]) [keyword for] ([keyword var] [def x] [keyword in] [variable y]) [keyword if] [variable pred]([variable-2 x]) ]];",
" ([variable u] [keyword for] ([keyword var] [def u] [keyword of] [variable generateValues]()) [keyword if] ([variable-2 u].[property color] [operator ===] [string 'blue']));",
"}");
@@ -91,7 +88,7 @@
"[variable x] [operator =] [string-2 `fofdlakj${][variable x] [operator +] [string-2 `foo`] [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]");
MT("indent_statement",
- "[keyword var] [variable x] [operator =] [number 10]",
+ "[keyword var] [def x] [operator =] [number 10]",
"[variable x] [operator +=] [variable y] [operator +]",
" [atom Infinity]",
"[keyword debugger];");
@@ -112,14 +109,14 @@
"}");
MT("indent_for",
- "[keyword for] ([keyword var] [variable i] [operator =] [number 0];",
+ "[keyword for] ([keyword var] [def i] [operator =] [number 0];",
" [variable i] [operator <] [number 100];",
" [variable i][operator ++])",
" [variable doSomething]([variable i]);",
"[keyword debugger];");
MT("indent_c_style",
- "[keyword function] [variable foo]()",
+ "[keyword function] [def foo]()",
"{",
" [keyword debugger];",
"}");
@@ -147,24 +144,32 @@
"[number 2];");
MT("multilinestring",
- "[keyword var] [variable x] [operator =] [string 'foo\\]",
+ "[keyword var] [def x] [operator =] [string 'foo\\]",
"[string bar'];");
MT("scary_regexp",
"[string-2 /foo[[/]]bar/];");
MT("indent_strange_array",
- "[keyword var] [variable x] [operator =] [[",
+ "[keyword var] [def x] [operator =] [[",
" [number 1],,",
" [number 2],",
"]];",
"[number 10];");
MT("param_default",
- "[keyword function] [variable foo]([def x] [operator =] [string-2 `foo${][number 10][string-2 }bar`]) {",
+ "[keyword function] [def foo]([def x] [operator =] [string-2 `foo${][number 10][string-2 }bar`]) {",
" [keyword return] [variable-2 x];",
"}");
+ MT("new_target",
+ "[keyword function] [def F]([def target]) {",
+ " [keyword if] ([variable-2 target] [operator &&] [keyword new].[keyword target].[property name]) {",
+ " [keyword return] [keyword new]",
+ " .[keyword target];",
+ " }",
+ "}");
+
var jsonld_mode = CodeMirror.getMode(
{indentUnit: 2},
{name: "javascript", jsonld: true}
diff --git a/public/vendor/codemirror/mode/javascript/typescript.html b/public/vendor/codemirror/mode/javascript/typescript.html
index 2cfc5381..2cfc5381 100755..100644
--- a/public/vendor/codemirror/mode/javascript/typescript.html
+++ b/public/vendor/codemirror/mode/javascript/typescript.html
diff --git a/public/vendor/codemirror/mode/jinja2/index.html b/public/vendor/codemirror/mode/jinja2/index.html
index 5a70e915..5a70e915 100755..100644
--- a/public/vendor/codemirror/mode/jinja2/index.html
+++ b/public/vendor/codemirror/mode/jinja2/index.html
diff --git a/public/vendor/codemirror/mode/jinja2/jinja2.js b/public/vendor/codemirror/mode/jinja2/jinja2.js
index ed195581..ed195581 100755..100644
--- a/public/vendor/codemirror/mode/jinja2/jinja2.js
+++ b/public/vendor/codemirror/mode/jinja2/jinja2.js
diff --git a/public/vendor/codemirror/mode/jsx/index.html b/public/vendor/codemirror/mode/jsx/index.html
new file mode 100644
index 00000000..cb51edb3
--- /dev/null
+++ b/public/vendor/codemirror/mode/jsx/index.html
@@ -0,0 +1,89 @@
+<!doctype html>
+
+<title>CodeMirror: JSX mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../javascript/javascript.js"></script>
+<script src="../xml/xml.js"></script>
+<script src="jsx.js"></script>
+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">JSX</a>
+ </ul>
+</div>
+
+<article>
+<h2>JSX mode</h2>
+
+<div><textarea id="code" name="code">// Code snippets from http://facebook.github.io/react/docs/jsx-in-depth.html
+
+// Rendering HTML tags
+var myDivElement = <div className="foo" />;
+ReactDOM.render(myDivElement, document.getElementById('example'));
+
+// Rendering React components
+var MyComponent = React.createClass({/*...*/});
+var myElement = <MyComponent someProperty={true} />;
+ReactDOM.render(myElement, document.getElementById('example'));
+
+// Namespaced components
+var Form = MyFormComponent;
+
+var App = (
+ <Form>
+ <Form.Row>
+ <Form.Label />
+ <Form.Input />
+ </Form.Row>
+ </Form>
+);
+
+// Attribute JavaScript expressions
+var person = <Person name={window.isLoggedIn ? window.name : ''} />;
+
+// Boolean attributes
+<input type="button" disabled />;
+<input type="button" disabled={true} />;
+
+// Child JavaScript expressions
+var content = <Container>{window.isLoggedIn ? <Nav /> : <Login />}</Container>;
+
+// Comments
+var content = (
+ <Nav>
+ {/* child comment, put {} around */}
+ <Person
+ /* multi
+ line
+ comment */
+ name={window.isLoggedIn ? window.name : ''} // end of line comment
+ />
+ </Nav>
+);
+</textarea></div>
+
+<script>
+var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ mode: "jsx"
+})
+</script>
+
+<p>JSX Mode for <a href="http://facebook.github.io/react">React</a>'s
+JavaScript syntax extension.</p>
+
+<p><strong>MIME types defined:</strong> <code>text/jsx</code>.</p>
+
+</article>
diff --git a/public/vendor/codemirror/mode/jsx/jsx.js b/public/vendor/codemirror/mode/jsx/jsx.js
new file mode 100644
index 00000000..bc2ea797
--- /dev/null
+++ b/public/vendor/codemirror/mode/jsx/jsx.js
@@ -0,0 +1,147 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"))
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript"], mod)
+ else // Plain browser env
+ mod(CodeMirror)
+})(function(CodeMirror) {
+ "use strict"
+
+ // Depth means the amount of open braces in JS context, in XML
+ // context 0 means not in tag, 1 means in tag, and 2 means in tag
+ // and js block comment.
+ function Context(state, mode, depth, prev) {
+ this.state = state; this.mode = mode; this.depth = depth; this.prev = prev
+ }
+
+ function copyContext(context) {
+ return new Context(CodeMirror.copyState(context.mode, context.state),
+ context.mode,
+ context.depth,
+ context.prev && copyContext(context.prev))
+ }
+
+ CodeMirror.defineMode("jsx", function(config) {
+ var xmlMode = CodeMirror.getMode(config, {name: "xml", allowMissing: true, multilineTagIndentPastTag: false})
+ var jsMode = CodeMirror.getMode(config, "javascript")
+
+ function flatXMLIndent(state) {
+ var tagName = state.tagName
+ state.tagName = null
+ var result = xmlMode.indent(state, "")
+ state.tagName = tagName
+ return result
+ }
+
+ function token(stream, state) {
+ if (state.context.mode == xmlMode)
+ return xmlToken(stream, state, state.context)
+ else
+ return jsToken(stream, state, state.context)
+ }
+
+ function xmlToken(stream, state, cx) {
+ if (cx.depth == 2) { // Inside a JS /* */ comment
+ if (stream.match(/^.*?\*\//)) cx.depth = 1
+ else stream.skipToEnd()
+ return "comment"
+ }
+
+ if (stream.peek() == "{") {
+ xmlMode.skipAttribute(cx.state)
+
+ var indent = flatXMLIndent(cx.state), xmlContext = cx.state.context
+ // If JS starts on same line as tag
+ if (xmlContext && stream.match(/^[^>]*>\s*$/, false)) {
+ while (xmlContext.prev && !xmlContext.startOfLine)
+ xmlContext = xmlContext.prev
+ // If tag starts the line, use XML indentation level
+ if (xmlContext.startOfLine) indent -= config.indentUnit
+ // Else use JS indentation level
+ else if (cx.prev.state.lexical) indent = cx.prev.state.lexical.indented
+ // Else if inside of tag
+ } else if (cx.depth == 1) {
+ indent += config.indentUnit
+ }
+
+ state.context = new Context(CodeMirror.startState(jsMode, indent),
+ jsMode, 0, state.context)
+ return null
+ }
+
+ if (cx.depth == 1) { // Inside of tag
+ if (stream.peek() == "<") { // Tag inside of tag
+ xmlMode.skipAttribute(cx.state)
+ state.context = new Context(CodeMirror.startState(xmlMode, flatXMLIndent(cx.state)),
+ xmlMode, 0, state.context)
+ return null
+ } else if (stream.match("//")) {
+ stream.skipToEnd()
+ return "comment"
+ } else if (stream.match("/*")) {
+ cx.depth = 2
+ return token(stream, state)
+ }
+ }
+
+ var style = xmlMode.token(stream, cx.state), cur = stream.current(), stop
+ if (/\btag\b/.test(style)) {
+ if (/>$/.test(cur)) {
+ if (cx.state.context) cx.depth = 0
+ else state.context = state.context.prev
+ } else if (/^</.test(cur)) {
+ cx.depth = 1
+ }
+ } else if (!style && (stop = cur.indexOf("{")) > -1) {
+ stream.backUp(cur.length - stop)
+ }
+ return style
+ }
+
+ function jsToken(stream, state, cx) {
+ if (stream.peek() == "<" && jsMode.expressionAllowed(stream, cx.state)) {
+ jsMode.skipExpression(cx.state)
+ state.context = new Context(CodeMirror.startState(xmlMode, jsMode.indent(cx.state, "")),
+ xmlMode, 0, state.context)
+ return null
+ }
+
+ var style = jsMode.token(stream, cx.state)
+ if (!style && cx.depth != null) {
+ var cur = stream.current()
+ if (cur == "{") {
+ cx.depth++
+ } else if (cur == "}") {
+ if (--cx.depth == 0) state.context = state.context.prev
+ }
+ }
+ return style
+ }
+
+ return {
+ startState: function() {
+ return {context: new Context(CodeMirror.startState(jsMode), jsMode)}
+ },
+
+ copyState: function(state) {
+ return {context: copyContext(state.context)}
+ },
+
+ token: token,
+
+ indent: function(state, textAfter, fullLine) {
+ return state.context.mode.indent(state.context.state, textAfter, fullLine)
+ },
+
+ innerMode: function(state) {
+ return state.context
+ }
+ }
+ }, "xml", "javascript")
+
+ CodeMirror.defineMIME("text/jsx", "jsx")
+})
diff --git a/public/vendor/codemirror/mode/jsx/test.js b/public/vendor/codemirror/mode/jsx/test.js
new file mode 100644
index 00000000..c54a8b24
--- /dev/null
+++ b/public/vendor/codemirror/mode/jsx/test.js
@@ -0,0 +1,69 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+ var mode = CodeMirror.getMode({indentUnit: 2}, "jsx")
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)) }
+
+ MT("selfclose",
+ "[keyword var] [def x] [operator =] [bracket&tag <] [tag foo] [bracket&tag />] [operator +] [number 1];")
+
+ MT("openclose",
+ "([bracket&tag <][tag foo][bracket&tag >]hello [atom &amp;][bracket&tag </][tag foo][bracket&tag >][operator ++])")
+
+ MT("attr",
+ "([bracket&tag <][tag foo] [attribute abc]=[string 'value'][bracket&tag >]hello [atom &amp;][bracket&tag </][tag foo][bracket&tag >][operator ++])")
+
+ MT("braced_attr",
+ "([bracket&tag <][tag foo] [attribute abc]={[number 10]}[bracket&tag >]hello [atom &amp;][bracket&tag </][tag foo][bracket&tag >][operator ++])")
+
+ MT("braced_text",
+ "([bracket&tag <][tag foo][bracket&tag >]hello {[number 10]} [atom &amp;][bracket&tag </][tag foo][bracket&tag >][operator ++])")
+
+ MT("nested_tag",
+ "([bracket&tag <][tag foo][bracket&tag ><][tag bar][bracket&tag ></][tag bar][bracket&tag ></][tag foo][bracket&tag >][operator ++])")
+
+ MT("nested_jsx",
+ "[keyword return] (",
+ " [bracket&tag <][tag foo][bracket&tag >]",
+ " say {[number 1] [operator +] [bracket&tag <][tag bar] [attribute attr]={[number 10]}[bracket&tag />]}!",
+ " [bracket&tag </][tag foo][bracket&tag >][operator ++]",
+ ")")
+
+ MT("preserve_js_context",
+ "[variable x] [operator =] [string-2 `quasi${][bracket&tag <][tag foo][bracket&tag />][string-2 }quoted`]")
+
+ MT("line_comment",
+ "([bracket&tag <][tag foo] [comment // hello]",
+ " [bracket&tag ></][tag foo][bracket&tag >][operator ++])")
+
+ MT("line_comment_not_in_tag",
+ "([bracket&tag <][tag foo][bracket&tag >] // hello",
+ " [bracket&tag </][tag foo][bracket&tag >][operator ++])")
+
+ MT("block_comment",
+ "([bracket&tag <][tag foo] [comment /* hello]",
+ "[comment line 2]",
+ "[comment line 3 */] [bracket&tag ></][tag foo][bracket&tag >][operator ++])")
+
+ MT("block_comment_not_in_tag",
+ "([bracket&tag <][tag foo][bracket&tag >]/* hello",
+ " line 2",
+ " line 3 */ [bracket&tag </][tag foo][bracket&tag >][operator ++])")
+
+ MT("missing_attr",
+ "([bracket&tag <][tag foo] [attribute selected][bracket&tag />][operator ++])")
+
+ MT("indent_js",
+ "([bracket&tag <][tag foo][bracket&tag >]",
+ " [bracket&tag <][tag bar] [attribute baz]={[keyword function]() {",
+ " [keyword return] [number 10]",
+ " }}[bracket&tag />]",
+ " [bracket&tag </][tag foo][bracket&tag >])")
+
+ MT("spread",
+ "([bracket&tag <][tag foo] [attribute bar]={[meta ...][variable baz] [operator /][number 2]}[bracket&tag />])")
+
+ MT("tag_attribute",
+ "([bracket&tag <][tag foo] [attribute bar]=[bracket&tag <][tag foo][bracket&tag />/>][operator ++])")
+})()
diff --git a/public/vendor/codemirror/mode/julia/index.html b/public/vendor/codemirror/mode/julia/index.html
index e1492c21..e1492c21 100755..100644
--- a/public/vendor/codemirror/mode/julia/index.html
+++ b/public/vendor/codemirror/mode/julia/index.html
diff --git a/public/vendor/codemirror/mode/julia/julia.js b/public/vendor/codemirror/mode/julia/julia.js
index d0a74cef..4471896b 100755..100644
--- a/public/vendor/codemirror/mode/julia/julia.js
+++ b/public/vendor/codemirror/mode/julia/julia.js
@@ -18,35 +18,34 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
return new RegExp("^((" + words.join(")|(") + "))\\b");
}
- var operators = parserConf.operators || /^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b/;
+ var operators = parserConf.operators || /^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b(?!\()|[\u2208\u2209](?!\()/;
var delimiters = parserConf.delimiters || /^[;,()[\]{}]/;
- var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/;
+ var identifiers = parserConf.identifiers || /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/;
var blockOpeners = ["begin", "function", "type", "immutable", "let", "macro", "for", "while", "quote", "if", "else", "elseif", "try", "finally", "catch", "do"];
var blockClosers = ["end", "else", "elseif", "catch", "finally"];
- var keywordList = ['if', 'else', 'elseif', 'while', 'for', 'begin', 'let', 'end', 'do', 'try', 'catch', 'finally', 'return', 'break', 'continue', 'global', 'local', 'const', 'export', 'import', 'importall', 'using', 'function', 'macro', 'module', 'baremodule', 'type', 'immutable', 'quote', 'typealias', 'abstract', 'bitstype', 'ccall'];
- var builtinList = ['true', 'false', 'enumerate', 'open', 'close', 'nothing', 'NaN', 'Inf', 'print', 'println', 'Int', 'Int8', 'Uint8', 'Int16', 'Uint16', 'Int32', 'Uint32', 'Int64', 'Uint64', 'Int128', 'Uint128', 'Bool', 'Char', 'Float16', 'Float32', 'Float64', 'Array', 'Vector', 'Matrix', 'String', 'UTF8String', 'ASCIIString', 'error', 'warn', 'info', '@printf'];
+ var keywordList = ['if', 'else', 'elseif', 'while', 'for', 'begin', 'let', 'end', 'do', 'try', 'catch', 'finally', 'return', 'break', 'continue', 'global', 'local', 'const', 'export', 'import', 'importall', 'using', 'function', 'macro', 'module', 'baremodule', 'type', 'immutable', 'quote', 'typealias', 'abstract', 'bitstype'];
+ var builtinList = ['true', 'false', 'nothing', 'NaN', 'Inf'];
//var stringPrefixes = new RegExp("^[br]?('|\")")
- var stringPrefixes = /^(`|'|"{3}|([br]?"))/;
+ var stringPrefixes = /^(`|'|"{3}|([brv]?"))/;
var keywords = wordRegexp(keywordList);
var builtins = wordRegexp(builtinList);
var openers = wordRegexp(blockOpeners);
var closers = wordRegexp(blockClosers);
var macro = /^@[_A-Za-z][_A-Za-z0-9]*/;
- var symbol = /^:[_A-Za-z][_A-Za-z0-9]*/;
+ var symbol = /^:[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/;
+ var typeAnnotation = /^::[^.,;"{()=$\s]+({[^}]*}+)*/;
- function in_array(state) {
- var ch = cur_scope(state);
- if(ch=="[" || ch=="{") {
+ function inArray(state) {
+ var ch = currentScope(state);
+ if (ch == '[') {
return true;
}
- else {
- return false;
- }
+ return false;
}
- function cur_scope(state) {
- if(state.scopes.length==0) {
+ function currentScope(state) {
+ if (state.scopes.length == 0) {
return null;
}
return state.scopes[state.scopes.length - 1];
@@ -54,20 +53,34 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
// tokenizers
function tokenBase(stream, state) {
+ //Handle multiline comments
+ if (stream.match(/^#=\s*/)) {
+ state.scopes.push('#=');
+ }
+ if (currentScope(state) == '#=' && stream.match(/^=#/)) {
+ state.scopes.pop();
+ return 'comment';
+ }
+ if (state.scopes.indexOf('#=') >= 0) {
+ if (!stream.match(/.*?(?=(#=|=#))/)) {
+ stream.skipToEnd();
+ }
+ return 'comment';
+ }
+
// Handle scope changes
- var leaving_expr = state.leaving_expr;
- if(stream.sol()) {
- leaving_expr = false;
+ var leavingExpr = state.leavingExpr;
+ if (stream.sol()) {
+ leavingExpr = false;
}
- state.leaving_expr = false;
- if(leaving_expr) {
- if(stream.match(/^'+/)) {
+ state.leavingExpr = false;
+ if (leavingExpr) {
+ if (stream.match(/^'+/)) {
return 'operator';
}
-
}
- if(stream.match(/^\.{2,3}/)) {
+ if (stream.match(/^\.{2,3}/)) {
return 'operator';
}
@@ -76,56 +89,51 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
}
var ch = stream.peek();
- // Handle Comments
+
+ // Handle single line comments
if (ch === '#') {
- stream.skipToEnd();
- return 'comment';
- }
- if(ch==='[') {
- state.scopes.push("[");
+ stream.skipToEnd();
+ return 'comment';
}
- if(ch==='{') {
- state.scopes.push("{");
+ if (ch === '[') {
+ state.scopes.push('[');
}
- var scope=cur_scope(state);
+ var scope = currentScope(state);
- if(scope==='[' && ch===']') {
+ if (scope == '[' && ch === ']') {
state.scopes.pop();
- state.leaving_expr=true;
+ state.leavingExpr = true;
}
- if(scope==='{' && ch==='}') {
+ if (scope == '(' && ch === ')') {
state.scopes.pop();
- state.leaving_expr=true;
- }
-
- if(ch===')') {
- state.leaving_expr = true;
+ state.leavingExpr = true;
}
var match;
- if(!in_array(state) && (match=stream.match(openers, false))) {
+ if (!inArray(state) && (match=stream.match(openers, false))) {
state.scopes.push(match);
}
- if(!in_array(state) && stream.match(closers, false)) {
+ if (!inArray(state) && stream.match(closers, false)) {
state.scopes.pop();
}
- if(in_array(state)) {
- if(stream.match(/^end/)) {
+ if (inArray(state)) {
+ if (state.lastToken == 'end' && stream.match(/^:/)) {
+ return 'operator';
+ }
+ if (stream.match(/^end/)) {
return 'number';
}
-
}
- if(stream.match(/^=>/)) {
+ if (stream.match(/^=>/)) {
return 'operator';
}
-
// Handle Number Literals
if (stream.match(/^[0-9\.]/, false)) {
var imMatcher = RegExp(/^im\b/);
@@ -134,10 +142,11 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
if (stream.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)) { floatLiteral = true; }
if (stream.match(/^\d+\.(?!\.)\d*/)) { floatLiteral = true; }
if (stream.match(/^\.\d+/)) { floatLiteral = true; }
+ if (stream.match(/^0x\.[0-9a-f]+p[\+\-]?\d+/i)) { floatLiteral = true; }
if (floatLiteral) {
// Float literals may be "imaginary"
stream.match(imMatcher);
- state.leaving_expr = true;
+ state.leavingExpr = true;
return 'number';
}
// Integers
@@ -157,18 +166,27 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
if (intLiteral) {
// Integer literals may be "long"
stream.match(imMatcher);
- state.leaving_expr = true;
+ state.leavingExpr = true;
return 'number';
}
}
- if(stream.match(/^(::)|(<:)/)) {
+ if (stream.match(/^<:/)) {
return 'operator';
}
+ if (stream.match(typeAnnotation)) {
+ return 'builtin';
+ }
+
// Handle symbols
- if(!leaving_expr && stream.match(symbol)) {
- return 'string';
+ if (!leavingExpr && stream.match(symbol) || stream.match(/:\./)) {
+ return 'builtin';
+ }
+
+ // Handle parametric types
+ if (stream.match(/^{[^}]*}(?=\()/)) {
+ return 'builtin';
}
// Handle operators and Delimiters
@@ -176,7 +194,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
return 'operator';
}
-
// Handle Strings
if (stream.match(stringPrefixes)) {
state.tokenize = tokenStringFactory(stream.current());
@@ -187,7 +204,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
return 'meta';
}
-
if (stream.match(delimiters)) {
return null;
}
@@ -200,21 +216,74 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
return 'builtin';
}
+ var isDefinition = state.isDefinition ||
+ state.lastToken == 'function' ||
+ state.lastToken == 'macro' ||
+ state.lastToken == 'type' ||
+ state.lastToken == 'immutable';
if (stream.match(identifiers)) {
- state.leaving_expr=true;
+ if (isDefinition) {
+ if (stream.peek() === '.') {
+ state.isDefinition = true;
+ return 'variable';
+ }
+ state.isDefinition = false;
+ return 'def';
+ }
+ if (stream.match(/^({[^}]*})*\(/, false)) {
+ return callOrDef(stream, state);
+ }
+ state.leavingExpr = true;
return 'variable';
}
+
// Handle non-detected items
stream.next();
return ERRORCLASS;
}
+ function callOrDef(stream, state) {
+ var match = stream.match(/^(\(\s*)/);
+ if (match) {
+ if (state.firstParenPos < 0)
+ state.firstParenPos = state.scopes.length;
+ state.scopes.push('(');
+ state.charsAdvanced += match[1].length;
+ }
+ if (currentScope(state) == '(' && stream.match(/^\)/)) {
+ state.scopes.pop();
+ state.charsAdvanced += 1;
+ if (state.scopes.length <= state.firstParenPos) {
+ var isDefinition = stream.match(/^\s*?=(?!=)/, false);
+ stream.backUp(state.charsAdvanced);
+ state.firstParenPos = -1;
+ state.charsAdvanced = 0;
+ if (isDefinition)
+ return 'def';
+ return 'builtin';
+ }
+ }
+ // Unfortunately javascript does not support multiline strings, so we have
+ // to undo anything done upto here if a function call or definition splits
+ // over two or more lines.
+ if (stream.match(/^$/g, false)) {
+ stream.backUp(state.charsAdvanced);
+ while (state.scopes.length > state.firstParenPos + 1)
+ state.scopes.pop();
+ state.firstParenPos = -1;
+ state.charsAdvanced = 0;
+ return 'builtin';
+ }
+ state.charsAdvanced += stream.match(/^([^()]*)/)[1].length;
+ return callOrDef(stream, state);
+ }
+
function tokenStringFactory(delimiter) {
- while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {
+ while ('bruv'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {
delimiter = delimiter.substr(1);
}
- var singleline = delimiter.length == 1;
+ var singleline = delimiter == "'";
var OUTCLASS = 'string';
function tokenString(stream, state) {
@@ -245,45 +314,41 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
return tokenString;
}
- function tokenLexer(stream, state) {
- var style = state.tokenize(stream, state);
- var current = stream.current();
-
- // Handle '.' connected identifiers
- if (current === '.') {
- style = stream.match(identifiers, false) ? null : ERRORCLASS;
- if (style === null && state.lastStyle === 'meta') {
- // Apply 'meta' style to '.' connected identifiers when
- // appropriate.
- style = 'meta';
- }
- return style;
- }
-
- return style;
- }
-
var external = {
startState: function() {
return {
tokenize: tokenBase,
scopes: [],
- leaving_expr: false
+ lastToken: null,
+ leavingExpr: false,
+ isDefinition: false,
+ charsAdvanced: 0,
+ firstParenPos: -1
};
},
token: function(stream, state) {
- var style = tokenLexer(stream, state);
- state.lastStyle = style;
+ var style = state.tokenize(stream, state);
+ var current = stream.current();
+
+ if (current && style) {
+ state.lastToken = current;
+ }
+
+ // Handle '.' connected identifiers
+ if (current === '.') {
+ style = stream.match(identifiers, false) || stream.match(macro, false) ||
+ stream.match(/\(/, false) ? 'operator' : ERRORCLASS;
+ }
return style;
},
indent: function(state, textAfter) {
var delta = 0;
- if(textAfter=="end" || textAfter=="]" || textAfter=="}" || textAfter=="else" || textAfter=="elseif" || textAfter=="catch" || textAfter=="finally") {
+ if (textAfter == "end" || textAfter == "]" || textAfter == "}" || textAfter == "else" || textAfter == "elseif" || textAfter == "catch" || textAfter == "finally") {
delta = -1;
}
- return (state.scopes.length + delta) * 4;
+ return (state.scopes.length + delta) * _conf.indentUnit;
},
lineComment: "#",
diff --git a/public/vendor/codemirror/mode/kotlin/index.html b/public/vendor/codemirror/mode/kotlin/index.html
deleted file mode 100755
index 859e109f..00000000
--- a/public/vendor/codemirror/mode/kotlin/index.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Kotlin mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="kotlin.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
- <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
- <ul>
- <li><a href="../../index.html">Home</a>
- <li><a href="../../doc/manual.html">Manual</a>
- <li><a href="https://github.com/codemirror/codemirror">Code</a>
- </ul>
- <ul>
- <li><a href="../index.html">Language modes</a>
- <li><a class=active href="#">Kotlin</a>
- </ul>
-</div>
-
-<article>
-<h2>Kotlin mode</h2>
-
-
-<div><textarea id="code" name="code">
-package org.wasabi.http
-
-import java.util.concurrent.Executors
-import java.net.InetSocketAddress
-import org.wasabi.app.AppConfiguration
-import io.netty.bootstrap.ServerBootstrap
-import io.netty.channel.nio.NioEventLoopGroup
-import io.netty.channel.socket.nio.NioServerSocketChannel
-import org.wasabi.app.AppServer
-
-public class HttpServer(private val appServer: AppServer) {
-
- val bootstrap: ServerBootstrap
- val primaryGroup: NioEventLoopGroup
- val workerGroup: NioEventLoopGroup
-
- {
- // Define worker groups
- primaryGroup = NioEventLoopGroup()
- workerGroup = NioEventLoopGroup()
-
- // Initialize bootstrap of server
- bootstrap = ServerBootstrap()
-
- bootstrap.group(primaryGroup, workerGroup)
- bootstrap.channel(javaClass<NioServerSocketChannel>())
- bootstrap.childHandler(NettyPipelineInitializer(appServer))
- }
-
- public fun start(wait: Boolean = true) {
- val channel = bootstrap.bind(appServer.configuration.port)?.sync()?.channel()
-
- if (wait) {
- channel?.closeFuture()?.sync()
- }
- }
-
- public fun stop() {
- // Shutdown all event loops
- primaryGroup.shutdownGracefully()
- workerGroup.shutdownGracefully()
-
- // Wait till all threads are terminated
- primaryGroup.terminationFuture().sync()
- workerGroup.terminationFuture().sync()
- }
-}
-</textarea></div>
-
- <script>
- var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
- mode: {name: "kotlin"},
- lineNumbers: true,
- indentUnit: 4
- });
- </script>
- <h3>Mode for Kotlin (http://kotlin.jetbrains.org/)</h3>
- <p>Developed by Hadi Hariri (https://github.com/hhariri).</p>
- <p><strong>MIME type defined:</strong> <code>text/x-kotlin</code>.</p>
-</article>
diff --git a/public/vendor/codemirror/mode/kotlin/kotlin.js b/public/vendor/codemirror/mode/kotlin/kotlin.js
deleted file mode 100755
index e9a6a94e..00000000
--- a/public/vendor/codemirror/mode/kotlin/kotlin.js
+++ /dev/null
@@ -1,284 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
- if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror"], mod);
- else // Plain browser env
- mod(CodeMirror);
-})(function(CodeMirror) {
-"use strict";
-
-CodeMirror.defineMode("kotlin", function (config, parserConfig) {
- function words(str) {
- var obj = {}, words = str.split(" ");
- for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
- return obj;
- }
-
- var multiLineStrings = parserConfig.multiLineStrings;
-
- var keywords = words(
- "package continue return object while break class data trait interface throw super" +
- " when type this else This try val var fun for is in if do as true false null get set");
- var softKeywords = words("import" +
- " where by get set abstract enum open annotation override private public internal" +
- " protected catch out vararg inline finally final ref");
- var blockKeywords = words("catch class do else finally for if where try while enum");
- var atoms = words("null true false this");
-
- var curPunc;
-
- function tokenBase(stream, state) {
- var ch = stream.next();
- if (ch == '"' || ch == "'") {
- return startString(ch, stream, state);
- }
- // Wildcard import w/o trailing semicolon (import smth.*)
- if (ch == "." && stream.eat("*")) {
- return "word";
- }
- if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
- curPunc = ch;
- return null;
- }
- if (/\d/.test(ch)) {
- if (stream.eat(/eE/)) {
- stream.eat(/\+\-/);
- stream.eatWhile(/\d/);
- }
- return "number";
- }
- if (ch == "/") {
- if (stream.eat("*")) {
- state.tokenize.push(tokenComment);
- return tokenComment(stream, state);
- }
- if (stream.eat("/")) {
- stream.skipToEnd();
- return "comment";
- }
- if (expectExpression(state.lastToken)) {
- return startString(ch, stream, state);
- }
- }
- // Commented
- if (ch == "-" && stream.eat(">")) {
- curPunc = "->";
- return null;
- }
- if (/[\-+*&%=<>!?|\/~]/.test(ch)) {
- stream.eatWhile(/[\-+*&%=<>|~]/);
- return "operator";
- }
- stream.eatWhile(/[\w\$_]/);
-
- var cur = stream.current();
- if (atoms.propertyIsEnumerable(cur)) {
- return "atom";
- }
- if (softKeywords.propertyIsEnumerable(cur)) {
- if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
- return "softKeyword";
- }
-
- if (keywords.propertyIsEnumerable(cur)) {
- if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
- return "keyword";
- }
- return "word";
- }
-
- tokenBase.isBase = true;
-
- function startString(quote, stream, state) {
- var tripleQuoted = false;
- if (quote != "/" && stream.eat(quote)) {
- if (stream.eat(quote)) tripleQuoted = true;
- else return "string";
- }
- function t(stream, state) {
- var escaped = false, next, end = !tripleQuoted;
-
- while ((next = stream.next()) != null) {
- if (next == quote && !escaped) {
- if (!tripleQuoted) {
- break;
- }
- if (stream.match(quote + quote)) {
- end = true;
- break;
- }
- }
-
- if (quote == '"' && next == "$" && !escaped && stream.eat("{")) {
- state.tokenize.push(tokenBaseUntilBrace());
- return "string";
- }
-
- if (next == "$" && !escaped && !stream.eat(" ")) {
- state.tokenize.push(tokenBaseUntilSpace());
- return "string";
- }
- escaped = !escaped && next == "\\";
- }
- if (multiLineStrings)
- state.tokenize.push(t);
- if (end) state.tokenize.pop();
- return "string";
- }
-
- state.tokenize.push(t);
- return t(stream, state);
- }
-
- function tokenBaseUntilBrace() {
- var depth = 1;
-
- function t(stream, state) {
- if (stream.peek() == "}") {
- depth--;
- if (depth == 0) {
- state.tokenize.pop();
- return state.tokenize[state.tokenize.length - 1](stream, state);
- }
- } else if (stream.peek() == "{") {
- depth++;
- }
- return tokenBase(stream, state);
- }
-
- t.isBase = true;
- return t;
- }
-
- function tokenBaseUntilSpace() {
- function t(stream, state) {
- if (stream.eat(/[\w]/)) {
- var isWord = stream.eatWhile(/[\w]/);
- if (isWord) {
- state.tokenize.pop();
- return "word";
- }
- }
- state.tokenize.pop();
- return "string";
- }
-
- t.isBase = true;
- return t;
- }
-
- function tokenComment(stream, state) {
- var maybeEnd = false, ch;
- while (ch = stream.next()) {
- if (ch == "/" && maybeEnd) {
- state.tokenize.pop();
- break;
- }
- maybeEnd = (ch == "*");
- }
- return "comment";
- }
-
- function expectExpression(last) {
- return !last || last == "operator" || last == "->" || /[\.\[\{\(,;:]/.test(last) ||
- last == "newstatement" || last == "keyword" || last == "proplabel";
- }
-
- function Context(indented, column, type, align, prev) {
- this.indented = indented;
- this.column = column;
- this.type = type;
- this.align = align;
- this.prev = prev;
- }
-
- function pushContext(state, col, type) {
- return state.context = new Context(state.indented, col, type, null, state.context);
- }
-
- function popContext(state) {
- var t = state.context.type;
- if (t == ")" || t == "]" || t == "}")
- state.indented = state.context.indented;
- return state.context = state.context.prev;
- }
-
- // Interface
-
- return {
- startState: function (basecolumn) {
- return {
- tokenize: [tokenBase],
- context: new Context((basecolumn || 0) - config.indentUnit, 0, "top", false),
- indented: 0,
- startOfLine: true,
- lastToken: null
- };
- },
-
- token: function (stream, state) {
- var ctx = state.context;
- if (stream.sol()) {
- if (ctx.align == null) ctx.align = false;
- state.indented = stream.indentation();
- state.startOfLine = true;
- // Automatic semicolon insertion
- if (ctx.type == "statement" && !expectExpression(state.lastToken)) {
- popContext(state);
- ctx = state.context;
- }
- }
- if (stream.eatSpace()) return null;
- curPunc = null;
- var style = state.tokenize[state.tokenize.length - 1](stream, state);
- if (style == "comment") return style;
- if (ctx.align == null) ctx.align = true;
- if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state);
- // Handle indentation for {x -> \n ... }
- else if (curPunc == "->" && ctx.type == "statement" && ctx.prev.type == "}") {
- popContext(state);
- state.context.align = false;
- }
- else if (curPunc == "{") pushContext(state, stream.column(), "}");
- else if (curPunc == "[") pushContext(state, stream.column(), "]");
- else if (curPunc == "(") pushContext(state, stream.column(), ")");
- else if (curPunc == "}") {
- while (ctx.type == "statement") ctx = popContext(state);
- if (ctx.type == "}") ctx = popContext(state);
- while (ctx.type == "statement") ctx = popContext(state);
- }
- else if (curPunc == ctx.type) popContext(state);
- else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement"))
- pushContext(state, stream.column(), "statement");
- state.startOfLine = false;
- state.lastToken = curPunc || style;
- return style;
- },
-
- indent: function (state, textAfter) {
- if (!state.tokenize[state.tokenize.length - 1].isBase) return 0;
- var firstChar = textAfter && textAfter.charAt(0), ctx = state.context;
- if (ctx.type == "statement" && !expectExpression(state.lastToken)) ctx = ctx.prev;
- var closing = firstChar == ctx.type;
- if (ctx.type == "statement") {
- return ctx.indented + (firstChar == "{" ? 0 : config.indentUnit);
- }
- else if (ctx.align) return ctx.column + (closing ? 0 : 1);
- else return ctx.indented + (closing ? 0 : config.indentUnit);
- },
-
- closeBrackets: {triples: "'\""},
- electricChars: "{}",
- blockCommentStart: "/*",
- blockCommentEnd: "*/",
- lineComment: "//"
- };
-});
-
-CodeMirror.defineMIME("text/x-kotlin", "kotlin");
-
-});
diff --git a/public/vendor/codemirror/mode/livescript/index.html b/public/vendor/codemirror/mode/livescript/index.html
index f4154798..f4154798 100755..100644
--- a/public/vendor/codemirror/mode/livescript/index.html
+++ b/public/vendor/codemirror/mode/livescript/index.html
diff --git a/public/vendor/codemirror/mode/livescript/livescript.js b/public/vendor/codemirror/mode/livescript/livescript.js
index 4b26e046..4b26e046 100755..100644
--- a/public/vendor/codemirror/mode/livescript/livescript.js
+++ b/public/vendor/codemirror/mode/livescript/livescript.js
diff --git a/public/vendor/codemirror/mode/lua/index.html b/public/vendor/codemirror/mode/lua/index.html
index fc98b944..fc98b944 100755..100644
--- a/public/vendor/codemirror/mode/lua/index.html
+++ b/public/vendor/codemirror/mode/lua/index.html
diff --git a/public/vendor/codemirror/mode/lua/lua.js b/public/vendor/codemirror/mode/lua/lua.js
index 0b19abd3..0b19abd3 100755..100644
--- a/public/vendor/codemirror/mode/lua/lua.js
+++ b/public/vendor/codemirror/mode/lua/lua.js
diff --git a/public/vendor/codemirror/mode/markdown/index.html b/public/vendor/codemirror/mode/markdown/index.html
index c3bb8df9..15660c26 100755..100644
--- a/public/vendor/codemirror/mode/markdown/index.html
+++ b/public/vendor/codemirror/mode/markdown/index.html
@@ -350,8 +350,10 @@ Output:
});
</script>
- <p>Optionally depends on the XML mode for properly highlighted inline XML blocks.</p>
+ <p>You might want to use the <a href="../gfm/index.html">Github-Flavored Markdown mode</a> instead, which adds support for fenced code blocks and a few other things.</p>
+ <p>Optionally depends on the XML mode for properly highlighted inline XML blocks.</p>
+
<p><strong>MIME types defined:</strong> <code>text/x-markdown</code>.</p>
<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#markdown_*">normal</a>, <a href="../../test/index.html#verbose,markdown_*">verbose</a>.</p>
diff --git a/public/vendor/codemirror/mode/markdown/markdown.js b/public/vendor/codemirror/mode/markdown/markdown.js
index bef37b8a..70889205 100755..100644
--- a/public/vendor/codemirror/mode/markdown/markdown.js
+++ b/public/vendor/codemirror/mode/markdown/markdown.js
@@ -39,8 +39,10 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
if (modeCfg.underscoresBreakWords === undefined)
modeCfg.underscoresBreakWords = true;
- // Turn on fenced code blocks? ("```" to start/end)
- if (modeCfg.fencedCodeBlocks === undefined) modeCfg.fencedCodeBlocks = false;
+ // Use `fencedCodeBlocks` to configure fenced code blocks. false to
+ // disable, string to specify a precise regexp that the fence should
+ // match, and true to allow three or more backticks or tildes (as
+ // per CommonMark).
// Turn on task lists? ("- [ ] " and "- [x] ")
if (modeCfg.taskLists === undefined) modeCfg.taskLists = false;
@@ -49,32 +51,46 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
if (modeCfg.strikethrough === undefined)
modeCfg.strikethrough = false;
+ // Allow token types to be overridden by user-provided token types.
+ if (modeCfg.tokenTypeOverrides === undefined)
+ modeCfg.tokenTypeOverrides = {};
+
var codeDepth = 0;
- var header = 'header'
- , code = 'comment'
- , quote = 'quote'
- , list1 = 'variable-2'
- , list2 = 'variable-3'
- , list3 = 'keyword'
- , hr = 'hr'
- , image = 'tag'
- , formatting = 'formatting'
- , linkinline = 'link'
- , linkemail = 'link'
- , linktext = 'link'
- , linkhref = 'string'
- , em = 'em'
- , strong = 'strong'
- , strikethrough = 'strikethrough';
+ var tokenTypes = {
+ header: "header",
+ code: "comment",
+ quote: "quote",
+ list1: "variable-2",
+ list2: "variable-3",
+ list3: "keyword",
+ hr: "hr",
+ image: "tag",
+ formatting: "formatting",
+ linkInline: "link",
+ linkEmail: "link",
+ linkText: "link",
+ linkHref: "string",
+ em: "em",
+ strong: "strong",
+ strikethrough: "strikethrough"
+ };
+
+ for (var tokenType in tokenTypes) {
+ if (tokenTypes.hasOwnProperty(tokenType) && modeCfg.tokenTypeOverrides[tokenType]) {
+ tokenTypes[tokenType] = modeCfg.tokenTypeOverrides[tokenType];
+ }
+ }
var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/
, ulRE = /^[*\-+]\s+/
, olRE = /^[0-9]+([.)])\s+/
, taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE
- , atxHeaderRE = /^(#+)(?: |$)/
+ , atxHeaderRE = modeCfg.allowAtxHeaderWithoutSpace ? /^(#+)/ : /^(#+)(?: |$)/
, setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/
- , textRE = /^[^#!\[\]*_\\<>` "'(~]+/;
+ , textRE = /^[^#!\[\]*_\\<>` "'(~]+/
+ , fencedCodeRE = new RegExp("^(" + (modeCfg.fencedCodeBlocks === true ? "~~~+|```+" : modeCfg.fencedCodeBlocks) +
+ ")[ \\t]*([\\w+#]*)");
function switchInline(stream, state, f) {
state.f = state.inline = f;
@@ -86,6 +102,9 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
return f(stream, state);
}
+ function lineIsEmpty(line) {
+ return !line || !/\S/.test(line.string)
+ }
// Blocks
@@ -110,7 +129,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
state.trailingSpace = 0;
state.trailingSpaceNewLine = false;
// Mark this line as blank
- state.thisLineHasContent = false;
+ state.prevLine = state.thisLine
+ state.thisLine = null
return null;
}
@@ -141,10 +161,10 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
var match = null;
if (state.indentationDiff >= 4) {
stream.skipToEnd();
- if (prevLineIsIndentedCode || !state.prevLineHasContent) {
+ if (prevLineIsIndentedCode || lineIsEmpty(state.prevLine)) {
state.indentation -= 4;
state.indentedCode = true;
- return code;
+ return tokenTypes.code;
} else {
return null;
}
@@ -155,7 +175,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
if (modeCfg.highlightFormatting) state.formatting = "header";
state.f = state.inline;
return getType(state);
- } else if (state.prevLineHasContent && !state.quote && !prevLineIsList && !prevLineIsIndentedCode && (match = stream.match(setextHeaderRE))) {
+ } else if (!lineIsEmpty(state.prevLine) && !state.quote && !prevLineIsList &&
+ !prevLineIsIndentedCode && (match = stream.match(setextHeaderRE))) {
state.header = match[0].charAt(0) == '=' ? 1 : 2;
if (modeCfg.highlightFormatting) state.formatting = "header";
state.f = state.inline;
@@ -169,8 +190,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
return switchInline(stream, state, footnoteLink);
} else if (stream.match(hrRE, true)) {
state.hr = true;
- return hr;
- } else if ((!state.prevLineHasContent || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) {
+ return tokenTypes.hr;
+ } else if ((lineIsEmpty(state.prevLine) || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) {
var listType = null;
if (stream.match(ulRE, true)) {
listType = 'ul';
@@ -178,7 +199,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
stream.match(olRE, true);
listType = 'ol';
}
- state.indentation += 4;
+ state.indentation = stream.column() + stream.current().length;
state.list = true;
state.listDepth++;
if (modeCfg.taskLists && stream.match(taskListRE, false)) {
@@ -187,9 +208,10 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
state.f = state.inline;
if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType];
return getType(state);
- } else if (modeCfg.fencedCodeBlocks && stream.match(/^```[ \t]*([\w+#]*)/, true)) {
+ } else if (modeCfg.fencedCodeBlocks && (match = stream.match(fencedCodeRE, true))) {
+ state.fencedChars = match[1]
// try switching mode
- state.localMode = getMode(RegExp.$1);
+ state.localMode = getMode(match[2]);
if (state.localMode) state.localState = state.localMode.startState();
state.f = state.block = local;
if (modeCfg.highlightFormatting) state.formatting = "code-block";
@@ -202,7 +224,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
function htmlBlock(stream, state) {
var style = htmlMode.token(stream, state.htmlState);
- if ((htmlFound && state.htmlState.tagStart === null && !state.htmlState.context) ||
+ if ((htmlFound && state.htmlState.tagStart === null &&
+ (!state.htmlState.context && state.htmlState.tokenize.isInText)) ||
(state.md_inside && stream.current().indexOf(">") > -1)) {
state.f = inlineNormal;
state.block = blockNormal;
@@ -212,7 +235,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
}
function local(stream, state) {
- if (stream.sol() && stream.match("```", false)) {
+ if (stream.sol() && state.fencedChars && stream.match(state.fencedChars, false)) {
state.localMode = state.localState = null;
state.f = state.block = leavingLocal;
return null;
@@ -220,14 +243,15 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
return state.localMode.token(stream, state.localState);
} else {
stream.skipToEnd();
- return code;
+ return tokenTypes.code;
}
}
function leavingLocal(stream, state) {
- stream.match("```");
+ stream.match(state.fencedChars);
state.block = blockNormal;
state.f = inlineNormal;
+ state.fencedChars = null;
if (modeCfg.highlightFormatting) state.formatting = "code-block";
state.code = true;
var returnType = getType(state);
@@ -240,22 +264,22 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
var styles = [];
if (state.formatting) {
- styles.push(formatting);
+ styles.push(tokenTypes.formatting);
if (typeof state.formatting === "string") state.formatting = [state.formatting];
for (var i = 0; i < state.formatting.length; i++) {
- styles.push(formatting + "-" + state.formatting[i]);
+ styles.push(tokenTypes.formatting + "-" + state.formatting[i]);
if (state.formatting[i] === "header") {
- styles.push(formatting + "-" + state.formatting[i] + "-" + state.header);
+ styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.header);
}
// Add `formatting-quote` and `formatting-quote-#` for blockquotes
// Add `error` instead if the maximum blockquote nesting depth is passed
if (state.formatting[i] === "quote") {
if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {
- styles.push(formatting + "-" + state.formatting[i] + "-" + state.quote);
+ styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.quote);
} else {
styles.push("error");
}
@@ -273,38 +297,36 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
}
if (state.linkHref) {
- styles.push(linkhref, "url");
+ styles.push(tokenTypes.linkHref, "url");
} else { // Only apply inline styles to non-url text
- if (state.strong) { styles.push(strong); }
- if (state.em) { styles.push(em); }
- if (state.strikethrough) { styles.push(strikethrough); }
-
- if (state.linkText) { styles.push(linktext); }
-
- if (state.code) { styles.push(code); }
+ if (state.strong) { styles.push(tokenTypes.strong); }
+ if (state.em) { styles.push(tokenTypes.em); }
+ if (state.strikethrough) { styles.push(tokenTypes.strikethrough); }
+ if (state.linkText) { styles.push(tokenTypes.linkText); }
+ if (state.code) { styles.push(tokenTypes.code); }
}
- if (state.header) { styles.push(header); styles.push(header + "-" + state.header); }
+ if (state.header) { styles.push(tokenTypes.header, tokenTypes.header + "-" + state.header); }
if (state.quote) {
- styles.push(quote);
+ styles.push(tokenTypes.quote);
// Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth
if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {
- styles.push(quote + "-" + state.quote);
+ styles.push(tokenTypes.quote + "-" + state.quote);
} else {
- styles.push(quote + "-" + modeCfg.maxBlockquoteDepth);
+ styles.push(tokenTypes.quote + "-" + modeCfg.maxBlockquoteDepth);
}
}
if (state.list !== false) {
var listMod = (state.listDepth - 1) % 3;
if (!listMod) {
- styles.push(list1);
+ styles.push(tokenTypes.list1);
} else if (listMod === 1) {
- styles.push(list2);
+ styles.push(tokenTypes.list2);
} else {
- styles.push(list3);
+ styles.push(tokenTypes.list3);
}
}
@@ -360,7 +382,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
stream.next();
if (modeCfg.highlightFormatting) {
var type = getType(state);
- return type ? type + " formatting-escape" : "formatting-escape";
+ var formattingEscape = tokenTypes.formatting + "-escape";
+ return type ? type + " " + formattingEscape : formattingEscape;
}
}
@@ -374,7 +397,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
matchCh = (matchCh+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh;
if (stream.match(new RegExp(regex), true)) {
- return linkhref;
+ return tokenTypes.linkHref;
}
}
@@ -405,7 +428,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) {
stream.match(/\[[^\]]*\]/);
state.inline = state.f = linkHref;
- return image;
+ return tokenTypes.image;
}
if (ch === '[' && stream.match(/.*\](\(.*\)| ?\[.*\])/, false)) {
@@ -431,7 +454,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
} else {
type = "";
}
- return type + linkinline;
+ return type + tokenTypes.linkInline;
}
if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) {
@@ -443,15 +466,14 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
} else {
type = "";
}
- return type + linkemail;
+ return type + tokenTypes.linkEmail;
}
- if (ch === '<' && stream.match(/^\w/, false)) {
- if (stream.string.indexOf(">") != -1) {
- var atts = stream.string.substring(1,stream.string.indexOf(">"));
- if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) {
- state.md_inside = true;
- }
+ if (ch === '<' && stream.match(/^(!--|\w)/, false)) {
+ var end = stream.string.indexOf(">", stream.pos);
+ if (end != -1) {
+ var atts = stream.string.substring(stream.start, end);
+ if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) state.md_inside = true;
}
stream.backUp(1);
state.htmlState = CodeMirror.startState(htmlMode);
@@ -553,12 +575,12 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
} else {
type = "";
}
- return type + linkinline;
+ return type + tokenTypes.linkInline;
}
stream.match(/^[^>]+/, true);
- return linkinline;
+ return tokenTypes.linkInline;
}
function linkHref(stream, state) {
@@ -598,7 +620,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
}
function footnoteLink(stream, state) {
- if (stream.match(/^[^\]]*\]:/, false)) {
+ if (stream.match(/^([^\]\\]|\\.)*\]:/, false)) {
state.f = footnoteLinkInside;
stream.next(); // Consume [
if (modeCfg.highlightFormatting) state.formatting = "link";
@@ -617,9 +639,9 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
return returnType;
}
- stream.match(/^[^\]]+/, true);
+ stream.match(/^([^\]\\]|\\.)+/, true);
- return linktext;
+ return tokenTypes.linkText;
}
function footnoteUrl(stream, state) {
@@ -636,7 +658,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true);
}
state.f = state.inline = inlineNormal;
- return linkhref + " url";
+ return tokenTypes.linkHref + " url";
}
var savedInlineRE = [];
@@ -656,8 +678,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
return {
f: blockNormal,
- prevLineHasContent: false,
- thisLineHasContent: false,
+ prevLine: null,
+ thisLine: null,
block: blockNormal,
htmlState: null,
@@ -680,7 +702,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
quote: 0,
trailingSpace: 0,
trailingSpaceNewLine: false,
- strikethrough: false
+ strikethrough: false,
+ fencedChars: null
};
},
@@ -688,8 +711,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
return {
f: s.f,
- prevLineHasContent: s.prevLineHasContent,
- thisLineHasContent: s.thisLineHasContent,
+ prevLine: s.prevLine,
+ thisLine: s.thisLine,
block: s.block,
htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState),
@@ -702,6 +725,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
text: s.text,
formatting: false,
linkTitle: s.linkTitle,
+ code: s.code,
em: s.em,
strong: s.strong,
strikethrough: s.strikethrough,
@@ -714,7 +738,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
indentedCode: s.indentedCode,
trailingSpace: s.trailingSpace,
trailingSpaceNewLine: s.trailingSpaceNewLine,
- md_inside: s.md_inside
+ md_inside: s.md_inside,
+ fencedChars: s.fencedChars
};
},
@@ -723,28 +748,25 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
// Reset state.formatting
state.formatting = false;
- if (stream.sol()) {
- var forceBlankLine = !!state.header || state.hr;
+ if (stream != state.thisLine) {
+ var forceBlankLine = state.header || state.hr;
// Reset state.header and state.hr
state.header = 0;
state.hr = false;
if (stream.match(/^\s*$/, true) || forceBlankLine) {
- state.prevLineHasContent = false;
blankLine(state);
- return forceBlankLine ? this.token(stream, state) : null;
- } else {
- state.prevLineHasContent = state.thisLineHasContent;
- state.thisLineHasContent = true;
+ if (!forceBlankLine) return null
+ state.prevLine = null
}
+ state.prevLine = state.thisLine
+ state.thisLine = stream
+
// Reset state.taskList
state.taskList = false;
- // Reset state.code
- state.code = false;
-
// Reset state.trailingSpace
state.trailingSpace = 0;
state.trailingSpaceNewLine = false;
diff --git a/public/vendor/codemirror/mode/markdown/test.js b/public/vendor/codemirror/mode/markdown/test.js
index 7cd0bf4b..6d7829fa 100755..100644
--- a/public/vendor/codemirror/mode/markdown/test.js
+++ b/public/vendor/codemirror/mode/markdown/test.js
@@ -6,6 +6,39 @@
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "markdown", highlightFormatting: true});
function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); }
+ var modeAtxNoSpace = CodeMirror.getMode({tabSize: 4}, {name: "markdown", allowAtxHeaderWithoutSpace: true});
+ function AtxNoSpaceTest(name) { test.mode(name, modeAtxNoSpace, Array.prototype.slice.call(arguments, 1)); }
+ var modeFenced = CodeMirror.getMode({tabSize: 4}, {name: "markdown", fencedCodeBlocks: true});
+ function FencedTest(name) { test.mode(name, modeFenced, Array.prototype.slice.call(arguments, 1)); }
+ var modeOverrideClasses = CodeMirror.getMode({tabsize: 4}, {
+ name: "markdown",
+ strikethrough: true,
+ tokenTypeOverrides: {
+ "header" : "override-header",
+ "code" : "override-code",
+ "quote" : "override-quote",
+ "list1" : "override-list1",
+ "list2" : "override-list2",
+ "list3" : "override-list3",
+ "hr" : "override-hr",
+ "image" : "override-image",
+ "linkInline" : "override-link-inline",
+ "linkEmail" : "override-link-email",
+ "linkText" : "override-link-text",
+ "linkHref" : "override-link-href",
+ "em" : "override-em",
+ "strong" : "override-strong",
+ "strikethrough" : "override-strikethrough"
+ }});
+ function TokenTypeOverrideTest(name) { test.mode(name, modeOverrideClasses, Array.prototype.slice.call(arguments, 1)); }
+ var modeFormattingOverride = CodeMirror.getMode({tabsize: 4}, {
+ name: "markdown",
+ highlightFormatting: true,
+ tokenTypeOverrides: {
+ "formatting" : "override-formatting"
+ }});
+ function FormatTokenTypeOverrideTest(name) { test.mode(name, modeFormattingOverride, Array.prototype.slice.call(arguments, 1)); }
+
FT("formatting_emAsterisk",
"[em&formatting&formatting-em *][em foo][em&formatting&formatting-em *]");
@@ -110,7 +143,7 @@
// Block code using single backtick (shouldn't work)
MT("blockCodeSingleBacktick",
"[comment `]",
- "foo",
+ "[comment foo]",
"[comment `]");
// Unclosed backticks
@@ -173,6 +206,16 @@
MT("noAtxH1WithoutSpace",
"#5 bolt");
+ // CommonMark requires a space after # but most parsers don't
+ AtxNoSpaceTest("atxNoSpaceAllowed_H1NoSpace",
+ "[header&header-1 #foo]");
+
+ AtxNoSpaceTest("atxNoSpaceAllowed_H4NoSpace",
+ "[header&header-4 ####foo]");
+
+ AtxNoSpaceTest("atxNoSpaceAllowed_H1Space",
+ "[header&header-1 # foo]");
+
// Inline styles should be parsed inside headers
MT("atxH1inline",
"[header&header-1 # foo ][header&header-1&em *bar*]");
@@ -498,14 +541,14 @@
"",
" [variable-3 * bar]",
"",
- " [variable-2 hello]"
+ " [variable-3 hello]"
);
MT("listNested",
"[variable-2 * foo]",
"",
" [variable-3 * bar]",
"",
- " [variable-3 * foo]"
+ " [keyword * foo]"
);
// Code followed by text
@@ -653,6 +696,15 @@
"[link [[foo]]:] [string&url http://example.com/]",
"(bar\" hello");
+ MT("labelEscape",
+ "[link [[foo \\]] ]]:] [string&url http://example.com/]");
+
+ MT("labelEscapeColon",
+ "[link [[foo \\]]: bar]]:] [string&url http://example.com/]");
+
+ MT("labelEscapeEnd",
+ "[[foo\\]]: http://example.com/");
+
MT("linkWeb",
"[link <http://example.com/>] foo");
@@ -760,16 +812,128 @@
"\\",
"[em *foo*]");
+ // Class override tests
+ TokenTypeOverrideTest("overrideHeader1",
+ "[override-header&override-header-1 # Foo]");
+
+ TokenTypeOverrideTest("overrideHeader2",
+ "[override-header&override-header-2 ## Foo]");
+
+ TokenTypeOverrideTest("overrideHeader3",
+ "[override-header&override-header-3 ### Foo]");
+
+ TokenTypeOverrideTest("overrideHeader4",
+ "[override-header&override-header-4 #### Foo]");
+
+ TokenTypeOverrideTest("overrideHeader5",
+ "[override-header&override-header-5 ##### Foo]");
+
+ TokenTypeOverrideTest("overrideHeader6",
+ "[override-header&override-header-6 ###### Foo]");
+
+ TokenTypeOverrideTest("overrideCode",
+ "[override-code `foo`]");
+
+ TokenTypeOverrideTest("overrideCodeBlock",
+ "[override-code ```]",
+ "[override-code foo]",
+ "[override-code ```]");
+
+ TokenTypeOverrideTest("overrideQuote",
+ "[override-quote&override-quote-1 > foo]",
+ "[override-quote&override-quote-1 > bar]");
+
+ TokenTypeOverrideTest("overrideQuoteNested",
+ "[override-quote&override-quote-1 > foo]",
+ "[override-quote&override-quote-1 >][override-quote&override-quote-2 > bar]",
+ "[override-quote&override-quote-1 >][override-quote&override-quote-2 >][override-quote&override-quote-3 > baz]");
+
+ TokenTypeOverrideTest("overrideLists",
+ "[override-list1 - foo]",
+ "",
+ " [override-list2 + bar]",
+ "",
+ " [override-list3 * baz]",
+ "",
+ " [override-list1 1. qux]",
+ "",
+ " [override-list2 - quux]");
+
+ TokenTypeOverrideTest("overrideHr",
+ "[override-hr * * *]");
+
+ TokenTypeOverrideTest("overrideImage",
+ "[override-image ![[foo]]][override-link-href&url (http://example.com/)]")
+
+ TokenTypeOverrideTest("overrideLinkText",
+ "[override-link-text [[foo]]][override-link-href&url (http://example.com)]");
+
+ TokenTypeOverrideTest("overrideLinkEmailAndInline",
+ "[override-link-email <][override-link-inline foo@example.com>]");
+
+ TokenTypeOverrideTest("overrideEm",
+ "[override-em *foo*]");
+
+ TokenTypeOverrideTest("overrideStrong",
+ "[override-strong **foo**]");
+
+ TokenTypeOverrideTest("overrideStrikethrough",
+ "[override-strikethrough ~~foo~~]");
+
+ FormatTokenTypeOverrideTest("overrideFormatting",
+ "[override-formatting-escape \\*]");
// Tests to make sure GFM-specific things aren't getting through
MT("taskList",
"[variable-2 * [ ]] bar]");
- MT("fencedCodeBlocks",
- "[comment ```]",
+ MT("noFencedCodeBlocks",
+ "~~~",
"foo",
- "[comment ```]");
+ "~~~");
+
+ FencedTest("fencedCodeBlocks",
+ "[comment ```]",
+ "[comment foo]",
+ "[comment ```]",
+ "bar");
+
+ FencedTest("fencedCodeBlocksMultipleChars",
+ "[comment `````]",
+ "[comment foo]",
+ "[comment ```]",
+ "[comment foo]",
+ "[comment `````]",
+ "bar");
+
+ FencedTest("fencedCodeBlocksTildes",
+ "[comment ~~~]",
+ "[comment foo]",
+ "[comment ~~~]",
+ "bar");
+
+ FencedTest("fencedCodeBlocksTildesMultipleChars",
+ "[comment ~~~~~]",
+ "[comment ~~~]",
+ "[comment foo]",
+ "[comment ~~~~~]",
+ "bar");
+
+ FencedTest("fencedCodeBlocksMultipleChars",
+ "[comment `````]",
+ "[comment foo]",
+ "[comment ```]",
+ "[comment foo]",
+ "[comment `````]",
+ "bar");
+
+ FencedTest("fencedCodeBlocksMixed",
+ "[comment ~~~]",
+ "[comment ```]",
+ "[comment foo]",
+ "[comment ~~~]",
+ "bar");
// Tests that require XML mode
diff --git a/public/vendor/codemirror/mode/mathematica/index.html b/public/vendor/codemirror/mode/mathematica/index.html
index 57c42985..57c42985 100755..100644
--- a/public/vendor/codemirror/mode/mathematica/index.html
+++ b/public/vendor/codemirror/mode/mathematica/index.html
diff --git a/public/vendor/codemirror/mode/mathematica/mathematica.js b/public/vendor/codemirror/mode/mathematica/mathematica.js
index 5ae6f55c..5ae6f55c 100755..100644
--- a/public/vendor/codemirror/mode/mathematica/mathematica.js
+++ b/public/vendor/codemirror/mode/mathematica/mathematica.js
diff --git a/public/vendor/codemirror/mode/meta.js b/public/vendor/codemirror/mode/meta.js
index bb30c80f..49520717 100755..100644
--- a/public/vendor/codemirror/mode/meta.js
+++ b/public/vendor/codemirror/mode/meta.js
@@ -14,18 +14,21 @@
CodeMirror.modeInfo = [
{name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]},
{name: "PGP", mimes: ["application/pgp", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["pgp"]},
- {name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn, asn1"]},
+ {name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn", "asn1"]},
{name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i},
+ {name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"]},
{name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]},
{name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]},
{name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]},
{name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]},
{name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj"]},
+ {name: "Closure Stylesheets (GSS)", mime: "text/x-gss", mode: "css", ext: ["gss"]},
{name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists.txt$/},
{name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]},
{name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]},
{name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]},
{name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]},
+ {name: "Crystal", mime: "text/x-crystal", mode: "crystal", ext: ["cr"]},
{name: "CSS", mime: "text/css", mode: "css", ext: ["css"]},
{name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]},
{name: "D", mime: "text/x-d", mode: "d", ext: ["d"]},
@@ -53,6 +56,7 @@
{name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy"]},
{name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]},
{name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]},
+ {name: "Haskell (Literate)", mime: "text/x-literate-haskell", mode: "haskell-literate", ext: ["lhs"]},
{name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]},
{name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]},
{name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]},
@@ -66,9 +70,10 @@
mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]},
{name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]},
{name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]},
+ {name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]},
{name: "Jinja2", mime: "null", mode: "jinja2"},
{name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]},
- {name: "Kotlin", mime: "text/x-kotlin", mode: "kotlin", ext: ["kt"]},
+ {name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]},
{name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]},
{name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]},
{name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]},
@@ -81,10 +86,12 @@
{name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
{name: "MySQL", mime: "text/x-mysql", mode: "sql"},
{name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i},
+ {name: "NSIS", mime: "text/x-nsis", mode: "nsis", ext: ["nsh", "nsi"]},
{name: "NTriples", mime: "text/n-triples", mode: "ntriples", ext: ["nt"]},
{name: "Objective C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"]},
{name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]},
{name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]},
+ {name: "Oz", mime: "text/x-oz", mode: "oz", ext: ["oz"]},
{name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]},
{name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"]},
{name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]},
@@ -106,7 +113,7 @@
{name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]},
{name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]},
{name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]},
- {name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"]},
+ {name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"], file: /^PKGBUILD$/},
{name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]},
{name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]},
{name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]},
@@ -116,6 +123,7 @@
{name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]},
{name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]},
{name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]},
+ {name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"]},
{name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]},
{name: "MariaDB", mime: "text/x-mariadb", mode: "sql"},
{name: "sTeX", mime: "text/x-stex", mode: "stex"},
@@ -137,10 +145,14 @@
{name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]},
{name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]},
{name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]},
+ {name: "VHDL", mime: "text/x-vhdl", mode: "vhdl", ext: ["vhd", "vhdl"]},
{name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd"], alias: ["rss", "wsdl", "xsd"]},
{name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]},
{name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"]},
- {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]}
+ {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]},
+ {name: "mscgen", mime: "text/x-mscgen", mode: "mscgen", ext: ["mscgen", "mscin", "msc"]},
+ {name: "xu", mime: "text/x-xu", mode: "mscgen", ext: ["xu"]},
+ {name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]}
];
// Ensure all modes have a mime property for backwards compatibility
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
diff --git a/public/vendor/codemirror/mode/mirc/index.html b/public/vendor/codemirror/mode/mirc/index.html
index fd2f34e4..fd2f34e4 100755..100644
--- a/public/vendor/codemirror/mode/mirc/index.html
+++ b/public/vendor/codemirror/mode/mirc/index.html
diff --git a/public/vendor/codemirror/mode/mirc/mirc.js b/public/vendor/codemirror/mode/mirc/mirc.js
index f0d5c6ad..f0d5c6ad 100755..100644
--- a/public/vendor/codemirror/mode/mirc/mirc.js
+++ b/public/vendor/codemirror/mode/mirc/mirc.js
diff --git a/public/vendor/codemirror/mode/mllike/index.html b/public/vendor/codemirror/mode/mllike/index.html
index 5923af8f..5923af8f 100755..100644
--- a/public/vendor/codemirror/mode/mllike/index.html
+++ b/public/vendor/codemirror/mode/mllike/index.html
diff --git a/public/vendor/codemirror/mode/mllike/mllike.js b/public/vendor/codemirror/mode/mllike/mllike.js
index bf0b8a67..bf0b8a67 100755..100644
--- a/public/vendor/codemirror/mode/mllike/mllike.js
+++ b/public/vendor/codemirror/mode/mllike/mllike.js
diff --git a/public/vendor/codemirror/mode/modelica/index.html b/public/vendor/codemirror/mode/modelica/index.html
index 408c3b17..408c3b17 100755..100644
--- a/public/vendor/codemirror/mode/modelica/index.html
+++ b/public/vendor/codemirror/mode/modelica/index.html
diff --git a/public/vendor/codemirror/mode/modelica/modelica.js b/public/vendor/codemirror/mode/modelica/modelica.js
index 77ec7a3c..77ec7a3c 100755..100644
--- a/public/vendor/codemirror/mode/modelica/modelica.js
+++ b/public/vendor/codemirror/mode/modelica/modelica.js
diff --git a/public/vendor/codemirror/mode/mscgen/index.html b/public/vendor/codemirror/mode/mscgen/index.html
new file mode 100644
index 00000000..8c28ee62
--- /dev/null
+++ b/public/vendor/codemirror/mode/mscgen/index.html
@@ -0,0 +1,151 @@
+<!doctype html>
+
+<title>CodeMirror: MscGen mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="mscgen.js"></script>
+<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">MscGen</a>
+ </ul>
+</div>
+
+<article>
+<h2>MscGen mode</h2>
+
+<div><textarea id="mscgen-code">
+# Sample mscgen program
+# See http://www.mcternan.me.uk/mscgen or
+# https://sverweij.github.io/mscgen_js for more samples
+msc {
+ # options
+ hscale="1.2";
+
+ # entities/ lifelines
+ a [label="Entity A"],
+ b [label="Entity B", linecolor="red", arclinecolor="red", textbgcolor="pink"],
+ c [label="Entity C"];
+
+ # arcs/ messages
+ a => c [label="doSomething(args)"];
+ b => c [label="doSomething(args)"];
+ c >> * [label="everyone asked me", arcskip="1"];
+ c =>> c [label="doing something"];
+ c -x * [label="report back", arcskip="1"];
+ |||;
+ --- [label="shows's over, however ..."];
+ b => a [label="did you see c doing something?"];
+ a -> b [label="nope"];
+ b :> a [label="shall we ask again?"];
+ a => b [label="naah"];
+ ...;
+}
+</textarea></div>
+
+<h2>Xù mode</h2>
+
+<div><textarea id="xu-code">
+# Xù - expansions to MscGen to support inline expressions
+# https://github.com/sverweij/mscgen_js/blob/master/wikum/xu.md
+# More samples: https://sverweij.github.io/mscgen_js
+msc {
+ hscale="0.8",
+ width="700";
+
+ a,
+ b [label="change store"],
+ c,
+ d [label="necro queue"],
+ e [label="natalis queue"],
+ f;
+
+ a =>> b [label="get change list()"];
+ a alt f [label="changes found"] { /* alt is a xu specific keyword*/
+ b >> a [label="list of changes"];
+ a =>> c [label="cull old stuff (list of changes)"];
+ b loop e [label="for each change"] { // loop is xu specific as well...
+ /*
+ * Interesting stuff happens.
+ */
+ c =>> b [label="get change()"];
+ b >> c [label="change"];
+ c alt e [label="change too old"] {
+ c =>> d [label="queue(change)"];
+ --- [label="change newer than latest run"];
+ c =>> e [label="queue(change)"];
+ --- [label="all other cases"];
+ ||| [label="leave well alone"];
+ };
+ };
+
+ c >> a [label="done
+ processing"];
+
+ /* shucks! nothing found ...*/
+ --- [label="nothing found"];
+ b >> a [label="nothing"];
+ a note a [label="silent exit"];
+ };
+}
+</textarea></div>
+
+<h2>MsGenny mode</h2>
+<div><textarea id="msgenny-code">
+# MsGenny - simplified version of MscGen / Xù
+# https://github.com/sverweij/mscgen_js/blob/master/wikum/msgenny.md
+# More samples: https://sverweij.github.io/mscgen_js
+a -> b : a -> b (signal);
+a => b : a => b (method);
+b >> a : b >> a (return value);
+a =>> b : a =>> b (callback);
+a -x b : a -x b (lost);
+a :> b : a :> b (emphasis);
+a .. b : a .. b (dotted);
+a -- b : "a -- b straight line";
+a note a : a note a\n(note),
+b box b : b box b\n(action);
+a rbox a : a rbox a\n(reference),
+b abox b : b abox b\n(state/ condition);
+||| : ||| (empty row);
+... : ... (omitted row);
+--- : --- (comment);
+</textarea></div>
+
+ <p>
+ Simple mode for highlighting MscGen and two derived sequence
+ chart languages.
+ </p>
+
+ <script>
+ var mscgenEditor = CodeMirror.fromTextArea(document.getElementById("mscgen-code"), {
+ lineNumbers: true,
+ mode: "text/x-mscgen",
+ });
+ var xuEditor = CodeMirror.fromTextArea(document.getElementById("xu-code"), {
+ lineNumbers: true,
+ mode: "text/x-xu",
+ });
+ var msgennyEditor = CodeMirror.fromTextArea(document.getElementById("msgenny-code"), {
+ lineNumbers: true,
+ mode: "text/x-msgenny",
+ });
+ </script>
+
+ <p><strong>MIME types defined:</strong>
+ <code>text/x-mscgen</code>
+ <code>text/x-xu</code>
+ <code>text/x-msgenny</code>
+ </p>
+
+</article>
diff --git a/public/vendor/codemirror/mode/mscgen/mscgen.js b/public/vendor/codemirror/mode/mscgen/mscgen.js
new file mode 100644
index 00000000..d61b4706
--- /dev/null
+++ b/public/vendor/codemirror/mode/mscgen/mscgen.js
@@ -0,0 +1,169 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+// mode(s) for the sequence chart dsl's mscgen, xù and msgenny
+// For more information on mscgen, see the site of the original author:
+// http://www.mcternan.me.uk/mscgen
+//
+// This mode for mscgen and the two derivative languages were
+// originally made for use in the mscgen_js interpreter
+// (https://sverweij.github.io/mscgen_js)
+
+(function(mod) {
+ if ( typeof exports == "object" && typeof module == "object")// CommonJS
+ mod(require("../../lib/codemirror"));
+ else if ( typeof define == "function" && define.amd)// AMD
+ define(["../../lib/codemirror"], mod);
+ else// Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+ "use strict";
+
+ var languages = {
+ mscgen: {
+ "keywords" : ["msc"],
+ "options" : ["hscale", "width", "arcgradient", "wordwraparcs"],
+ "attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"],
+ "brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists
+ "arcsWords" : ["note", "abox", "rbox", "box"],
+ "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
+ "singlecomment" : ["//", "#"],
+ "operators" : ["="]
+ },
+ xu: {
+ "keywords" : ["msc"],
+ "options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"],
+ "attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"],
+ "brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists
+ "arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"],
+ "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
+ "singlecomment" : ["//", "#"],
+ "operators" : ["="]
+ },
+ msgenny: {
+ "keywords" : null,
+ "options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"],
+ "attributes" : null,
+ "brackets" : ["\\{", "\\}"],
+ "arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"],
+ "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
+ "singlecomment" : ["//", "#"],
+ "operators" : ["="]
+ }
+ }
+
+ CodeMirror.defineMode("mscgen", function(_, modeConfig) {
+ var language = languages[modeConfig && modeConfig.language || "mscgen"]
+ return {
+ startState: startStateFn,
+ copyState: copyStateFn,
+ token: produceTokenFunction(language),
+ lineComment : "#",
+ blockCommentStart : "/*",
+ blockCommentEnd : "*/"
+ };
+ });
+
+ CodeMirror.defineMIME("text/x-mscgen", "mscgen");
+ CodeMirror.defineMIME("text/x-xu", {name: "mscgen", language: "xu"});
+ CodeMirror.defineMIME("text/x-msgenny", {name: "mscgen", language: "msgenny"});
+
+ function wordRegexpBoundary(pWords) {
+ return new RegExp("\\b(" + pWords.join("|") + ")\\b", "i");
+ }
+
+ function wordRegexp(pWords) {
+ return new RegExp("(" + pWords.join("|") + ")", "i");
+ }
+
+ function startStateFn() {
+ return {
+ inComment : false,
+ inString : false,
+ inAttributeList : false,
+ inScript : false
+ };
+ }
+
+ function copyStateFn(pState) {
+ return {
+ inComment : pState.inComment,
+ inString : pState.inString,
+ inAttributeList : pState.inAttributeList,
+ inScript : pState.inScript
+ };
+ }
+
+ function produceTokenFunction(pConfig) {
+
+ return function(pStream, pState) {
+ if (pStream.match(wordRegexp(pConfig.brackets), true, true)) {
+ return "bracket";
+ }
+ /* comments */
+ if (!pState.inComment) {
+ if (pStream.match(/\/\*[^\*\/]*/, true, true)) {
+ pState.inComment = true;
+ return "comment";
+ }
+ if (pStream.match(wordRegexp(pConfig.singlecomment), true, true)) {
+ pStream.skipToEnd();
+ return "comment";
+ }
+ }
+ if (pState.inComment) {
+ if (pStream.match(/[^\*\/]*\*\//, true, true))
+ pState.inComment = false;
+ else
+ pStream.skipToEnd();
+ return "comment";
+ }
+ /* strings */
+ if (!pState.inString && pStream.match(/\"(\\\"|[^\"])*/, true, true)) {
+ pState.inString = true;
+ return "string";
+ }
+ if (pState.inString) {
+ if (pStream.match(/[^\"]*\"/, true, true))
+ pState.inString = false;
+ else
+ pStream.skipToEnd();
+ return "string";
+ }
+ /* keywords & operators */
+ if (!!pConfig.keywords && pStream.match(wordRegexpBoundary(pConfig.keywords), true, true))
+ return "keyword";
+
+ if (pStream.match(wordRegexpBoundary(pConfig.options), true, true))
+ return "keyword";
+
+ if (pStream.match(wordRegexpBoundary(pConfig.arcsWords), true, true))
+ return "keyword";
+
+ if (pStream.match(wordRegexp(pConfig.arcsOthers), true, true))
+ return "keyword";
+
+ if (!!pConfig.operators && pStream.match(wordRegexp(pConfig.operators), true, true))
+ return "operator";
+
+ /* attribute lists */
+ if (!pConfig.inAttributeList && !!pConfig.attributes && pStream.match(/\[/, true, true)) {
+ pConfig.inAttributeList = true;
+ return "bracket";
+ }
+ if (pConfig.inAttributeList) {
+ if (pConfig.attributes !== null && pStream.match(wordRegexpBoundary(pConfig.attributes), true, true)) {
+ return "attribute";
+ }
+ if (pStream.match(/]/, true, true)) {
+ pConfig.inAttributeList = false;
+ return "bracket";
+ }
+ }
+
+ pStream.next();
+ return "base";
+ };
+ }
+
+});
diff --git a/public/vendor/codemirror/mode/mscgen/mscgen_test.js b/public/vendor/codemirror/mode/mscgen/mscgen_test.js
new file mode 100644
index 00000000..e319a399
--- /dev/null
+++ b/public/vendor/codemirror/mode/mscgen/mscgen_test.js
@@ -0,0 +1,75 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+ var mode = CodeMirror.getMode({indentUnit: 2}, "mscgen");
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
+
+ MT("empty chart",
+ "[keyword msc][bracket {]",
+ "[base ]",
+ "[bracket }]"
+ );
+
+ MT("comments",
+ "[comment // a single line comment]",
+ "[comment # another single line comment /* and */ ignored here]",
+ "[comment /* A multi-line comment even though it contains]",
+ "[comment msc keywords and \"quoted text\"*/]");
+
+ MT("strings",
+ "[string \"// a string\"]",
+ "[string \"a string running over]",
+ "[string two lines\"]",
+ "[string \"with \\\"escaped quote\"]"
+ );
+
+ MT("xù/ msgenny keywords classify as 'base'",
+ "[base watermark]",
+ "[base alt loop opt ref else break par seq assert]"
+ );
+
+ MT("mscgen options classify as keyword",
+ "[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]"
+ );
+
+ MT("mscgen arcs classify as keyword",
+ "[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]",
+ "[keyword |||...---]", "[keyword ..--==::]",
+ "[keyword ->]", "[keyword <-]", "[keyword <->]",
+ "[keyword =>]", "[keyword <=]", "[keyword <=>]",
+ "[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]",
+ "[keyword >>]", "[keyword <<]", "[keyword <<>>]",
+ "[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]",
+ "[keyword :>]", "[keyword <:]", "[keyword <:>]"
+ );
+
+ MT("within an attribute list, attributes classify as attribute",
+ "[bracket [[][attribute label]",
+ "[attribute id]","[attribute url]","[attribute idurl]",
+ "[attribute linecolor]","[attribute linecolour]","[attribute textcolor]","[attribute textcolour]","[attribute textbgcolor]","[attribute textbgcolour]",
+ "[attribute arclinecolor]","[attribute arclinecolour]","[attribute arctextcolor]","[attribute arctextcolour]","[attribute arctextbgcolor]","[attribute arctextbgcolour]",
+ "[attribute arcskip][bracket ]]]"
+ );
+
+ MT("outside an attribute list, attributes classify as base",
+ "[base label]",
+ "[base id]","[base url]","[base idurl]",
+ "[base linecolor]","[base linecolour]","[base textcolor]","[base textcolour]","[base textbgcolor]","[base textbgcolour]",
+ "[base arclinecolor]","[base arclinecolour]","[base arctextcolor]","[base arctextcolour]","[base arctextbgcolor]","[base arctextbgcolour]",
+ "[base arcskip]"
+ );
+
+ MT("a typical program",
+ "[comment # typical mscgen program]",
+ "[keyword msc][base ][bracket {]",
+ "[keyword wordwraparcs][operator =][string \"true\"][base , ][keyword hscale][operator =][string \"0.8\"][keyword arcgradient][operator =][base 30;]",
+ "[base a][bracket [[][attribute label][operator =][string \"Entity A\"][bracket ]]][base ,]",
+ "[base b][bracket [[][attribute label][operator =][string \"Entity B\"][bracket ]]][base ,]",
+ "[base c][bracket [[][attribute label][operator =][string \"Entity C\"][bracket ]]][base ;]",
+ "[base a ][keyword =>>][base b][bracket [[][attribute label][operator =][string \"Hello entity B\"][bracket ]]][base ;]",
+ "[base a ][keyword <<][base b][bracket [[][attribute label][operator =][string \"Here's an answer dude!\"][bracket ]]][base ;]",
+ "[base c ][keyword :>][base *][bracket [[][attribute label][operator =][string \"What about me?\"][base , ][attribute textcolor][operator =][base red][bracket ]]][base ;]",
+ "[bracket }]"
+ );
+})();
diff --git a/public/vendor/codemirror/mode/mscgen/msgenny_test.js b/public/vendor/codemirror/mode/mscgen/msgenny_test.js
new file mode 100644
index 00000000..80173de0
--- /dev/null
+++ b/public/vendor/codemirror/mode/mscgen/msgenny_test.js
@@ -0,0 +1,71 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+ var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-msgenny");
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "msgenny"); }
+
+ MT("comments",
+ "[comment // a single line comment]",
+ "[comment # another single line comment /* and */ ignored here]",
+ "[comment /* A multi-line comment even though it contains]",
+ "[comment msc keywords and \"quoted text\"*/]");
+
+ MT("strings",
+ "[string \"// a string\"]",
+ "[string \"a string running over]",
+ "[string two lines\"]",
+ "[string \"with \\\"escaped quote\"]"
+ );
+
+ MT("xù/ msgenny keywords classify as 'keyword'",
+ "[keyword watermark]",
+ "[keyword alt]","[keyword loop]","[keyword opt]","[keyword ref]","[keyword else]","[keyword break]","[keyword par]","[keyword seq]","[keyword assert]"
+ );
+
+ MT("mscgen options classify as keyword",
+ "[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]"
+ );
+
+ MT("mscgen arcs classify as keyword",
+ "[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]",
+ "[keyword |||...---]", "[keyword ..--==::]",
+ "[keyword ->]", "[keyword <-]", "[keyword <->]",
+ "[keyword =>]", "[keyword <=]", "[keyword <=>]",
+ "[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]",
+ "[keyword >>]", "[keyword <<]", "[keyword <<>>]",
+ "[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]",
+ "[keyword :>]", "[keyword <:]", "[keyword <:>]"
+ );
+
+ MT("within an attribute list, mscgen/ xù attributes classify as base",
+ "[base [[label]",
+ "[base idurl id url]",
+ "[base linecolor linecolour textcolor textcolour textbgcolor textbgcolour]",
+ "[base arclinecolor arclinecolour arctextcolor arctextcolour arctextbgcolor arctextbgcolour]",
+ "[base arcskip]]]"
+ );
+
+ MT("outside an attribute list, mscgen/ xù attributes classify as base",
+ "[base label]",
+ "[base idurl id url]",
+ "[base linecolor linecolour textcolor textcolour textbgcolor textbgcolour]",
+ "[base arclinecolor arclinecolour arctextcolor arctextcolour arctextbgcolor arctextbgcolour]",
+ "[base arcskip]"
+ );
+
+ MT("a typical program",
+ "[comment # typical msgenny program]",
+ "[keyword wordwraparcs][operator =][string \"true\"][base , ][keyword hscale][operator =][string \"0.8\"][base , ][keyword arcgradient][operator =][base 30;]",
+ "[base a : ][string \"Entity A\"][base ,]",
+ "[base b : Entity B,]",
+ "[base c : Entity C;]",
+ "[base a ][keyword =>>][base b: ][string \"Hello entity B\"][base ;]",
+ "[base a ][keyword alt][base c][bracket {]",
+ "[base a ][keyword <<][base b: ][string \"Here's an answer dude!\"][base ;]",
+ "[keyword ---][base : ][string \"sorry, won't march - comm glitch\"]",
+ "[base a ][keyword x-][base b: ][string \"Here's an answer dude! (won't arrive...)\"][base ;]",
+ "[bracket }]",
+ "[base c ][keyword :>][base *: What about me?;]"
+ );
+})();
diff --git a/public/vendor/codemirror/mode/mscgen/xu_test.js b/public/vendor/codemirror/mode/mscgen/xu_test.js
new file mode 100644
index 00000000..f9a50f0a
--- /dev/null
+++ b/public/vendor/codemirror/mode/mscgen/xu_test.js
@@ -0,0 +1,75 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+ var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-xu");
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "xu"); }
+
+ MT("empty chart",
+ "[keyword msc][bracket {]",
+ "[base ]",
+ "[bracket }]"
+ );
+
+ MT("comments",
+ "[comment // a single line comment]",
+ "[comment # another single line comment /* and */ ignored here]",
+ "[comment /* A multi-line comment even though it contains]",
+ "[comment msc keywords and \"quoted text\"*/]");
+
+ MT("strings",
+ "[string \"// a string\"]",
+ "[string \"a string running over]",
+ "[string two lines\"]",
+ "[string \"with \\\"escaped quote\"]"
+ );
+
+ MT("xù/ msgenny keywords classify as 'keyword'",
+ "[keyword watermark]",
+ "[keyword alt]","[keyword loop]","[keyword opt]","[keyword ref]","[keyword else]","[keyword break]","[keyword par]","[keyword seq]","[keyword assert]"
+ );
+
+ MT("mscgen options classify as keyword",
+ "[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]"
+ );
+
+ MT("mscgen arcs classify as keyword",
+ "[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]",
+ "[keyword |||...---]", "[keyword ..--==::]",
+ "[keyword ->]", "[keyword <-]", "[keyword <->]",
+ "[keyword =>]", "[keyword <=]", "[keyword <=>]",
+ "[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]",
+ "[keyword >>]", "[keyword <<]", "[keyword <<>>]",
+ "[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]",
+ "[keyword :>]", "[keyword <:]", "[keyword <:>]"
+ );
+
+ MT("within an attribute list, attributes classify as attribute",
+ "[bracket [[][attribute label]",
+ "[attribute id]","[attribute url]","[attribute idurl]",
+ "[attribute linecolor]","[attribute linecolour]","[attribute textcolor]","[attribute textcolour]","[attribute textbgcolor]","[attribute textbgcolour]",
+ "[attribute arclinecolor]","[attribute arclinecolour]","[attribute arctextcolor]","[attribute arctextcolour]","[attribute arctextbgcolor]","[attribute arctextbgcolour]",
+ "[attribute arcskip][bracket ]]]"
+ );
+
+ MT("outside an attribute list, attributes classify as base",
+ "[base label]",
+ "[base id]","[base url]","[base idurl]",
+ "[base linecolor]","[base linecolour]","[base textcolor]","[base textcolour]","[base textbgcolor]","[base textbgcolour]",
+ "[base arclinecolor]","[base arclinecolour]","[base arctextcolor]","[base arctextcolour]","[base arctextbgcolor]","[base arctextbgcolour]",
+ "[base arcskip]"
+ );
+
+ MT("a typical program",
+ "[comment # typical mscgen program]",
+ "[keyword msc][base ][bracket {]",
+ "[keyword wordwraparcs][operator =][string \"true\"][keyword hscale][operator =][string \"0.8\"][keyword arcgradient][operator =][base 30;]",
+ "[base a][bracket [[][attribute label][operator =][string \"Entity A\"][bracket ]]][base ,]",
+ "[base b][bracket [[][attribute label][operator =][string \"Entity B\"][bracket ]]][base ,]",
+ "[base c][bracket [[][attribute label][operator =][string \"Entity C\"][bracket ]]][base ;]",
+ "[base a ][keyword =>>][base b][bracket [[][attribute label][operator =][string \"Hello entity B\"][bracket ]]][base ;]",
+ "[base a ][keyword <<][base b][bracket [[][attribute label][operator =][string \"Here's an answer dude!\"][bracket ]]][base ;]",
+ "[base c ][keyword :>][base *][bracket [[][attribute label][operator =][string \"What about me?\"][base , ][attribute textcolor][operator =][base red][bracket ]]][base ;]",
+ "[bracket }]"
+ );
+})();
diff --git a/public/vendor/codemirror/mode/mumps/index.html b/public/vendor/codemirror/mode/mumps/index.html
index bd1f69ae..b1f92c21 100755..100644
--- a/public/vendor/codemirror/mode/mumps/index.html
+++ b/public/vendor/codemirror/mode/mumps/index.html
@@ -1,4 +1,4 @@
-<!doctype html>
+<!doctype html>
<title>CodeMirror: MUMPS mode</title>
<meta charset="utf-8"/>
@@ -73,7 +73,7 @@ SET2() ;EF. Return error code (also called from XUSRB)
IF '$LENGTH($PIECE(XUSER(1),U,2)) QUIT 21 ;p419, p434
Q 0
;
- </textarea>
+ </textarea></div>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
mode: "mumps",
diff --git a/public/vendor/codemirror/mode/mumps/mumps.js b/public/vendor/codemirror/mode/mumps/mumps.js
index 469f8c3d..469f8c3d 100755..100644
--- a/public/vendor/codemirror/mode/mumps/mumps.js
+++ b/public/vendor/codemirror/mode/mumps/mumps.js
diff --git a/public/vendor/codemirror/mode/nginx/index.html b/public/vendor/codemirror/mode/nginx/index.html
index 5ffdc081..03cf6714 100755..100644
--- a/public/vendor/codemirror/mode/nginx/index.html
+++ b/public/vendor/codemirror/mode/nginx/index.html
@@ -1,5 +1,5 @@
-<!doctype html>
-
+<!doctype html>
+<head>
<title>CodeMirror: NGINX mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
diff --git a/public/vendor/codemirror/mode/nginx/nginx.js b/public/vendor/codemirror/mode/nginx/nginx.js
index 135b9cc7..00a32249 100755..100644
--- a/public/vendor/codemirror/mode/nginx/nginx.js
+++ b/public/vendor/codemirror/mode/nginx/nginx.js
@@ -173,6 +173,6 @@ CodeMirror.defineMode("nginx", function(config) {
};
});
-CodeMirror.defineMIME("text/nginx", "text/x-nginx-conf");
+CodeMirror.defineMIME("text/x-nginx-conf", "nginx");
});
diff --git a/public/vendor/codemirror/mode/nsis/index.html b/public/vendor/codemirror/mode/nsis/index.html
new file mode 100644
index 00000000..2afae87f
--- /dev/null
+++ b/public/vendor/codemirror/mode/nsis/index.html
@@ -0,0 +1,80 @@
+<!doctype html>
+
+<title>CodeMirror: NSIS mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel=stylesheet href=../../lib/codemirror.css>
+<script src=../../lib/codemirror.js></script>
+<script src="../../addon/mode/simple.js"></script>
+<script src="../../addon/edit/matchbrackets.js"></script>
+<script src=nsis.js></script>
+<style type=text/css>
+ .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
+</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">NSIS</a>
+ </ul>
+</div>
+
+<article>
+<h2>NSIS mode</h2>
+
+
+<textarea id=code>
+; This is a comment
+!ifdef ERROR
+ !error "Something went wrong"
+!endif
+
+OutFile "demo.exe"
+RequestExecutionLevel user
+SetDetailsPrint listonly
+
+!include "LogicLib.nsh"
+!include "WinVer.nsh"
+
+Section -mandatory
+
+ Call logWinVer
+
+ ${If} 1 > 0
+ MessageBox MB_OK "Hello world"
+ ${EndIf}
+
+SectionEnd
+
+Function logWinVer
+
+ ${If} ${IsWin10}
+ DetailPrint "Windows 10!"
+ ${ElseIf} ${AtLeastWinVista}
+ DetailPrint "We're post-XP"
+ ${Else}
+ DetailPrint "Legacy system"
+ ${EndIf}
+
+FunctionEnd
+</textarea>
+
+<script>
+ var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
+ mode: 'nsis',
+ indentWithTabs: true,
+ smartIndent: true,
+ lineNumbers: true,
+ matchBrackets: true
+ });
+</script>
+
+<p><strong>MIME types defined:</strong> <code>text/x-nsis</code>.</p>
+</article> \ No newline at end of file
diff --git a/public/vendor/codemirror/mode/nsis/nsis.js b/public/vendor/codemirror/mode/nsis/nsis.js
new file mode 100644
index 00000000..172207c5
--- /dev/null
+++ b/public/vendor/codemirror/mode/nsis/nsis.js
@@ -0,0 +1,95 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+// Author: Jan T. Sott (http://github.com/idleberg)
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+"use strict";
+
+CodeMirror.defineSimpleMode("nsis",{
+ start:[
+ // Numbers
+ {regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"},
+
+ // Strings
+ { regex: /"(?:[^\\"]|\\.)*"?/, token: "string" },
+ { regex: /'(?:[^\\']|\\.)*'?/, token: "string" },
+ { regex: /`(?:[^\\`]|\\.)*`?/, token: "string" },
+
+ // Compile Time Commands
+ {regex: /(?:\!(include|addincludedir|addplugindir|appendfile|cd|delfile|echo|error|execute|packhdr|finalize|getdllversion|system|tempfile|warning|verbose|define|undef|insertmacro|makensis|searchparse|searchreplace))\b/, token: "keyword"},
+
+ // Conditional Compilation
+ {regex: /(?:\!(if(?:n?def)?|ifmacron?def|macro))\b/, token: "keyword", indent: true},
+ {regex: /(?:\!(else|endif|macroend))\b/, token: "keyword", dedent: true},
+
+ // Runtime Commands
+ {regex: /\b(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|IntCmp|IntCmpU|IntFmt|IntOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetPluginUnload|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegStr|WriteUninstaller|XPStyle)\b/, token: "keyword"},
+ {regex: /\b(?:Function|PageEx|Section(?:Group)?)\b/, token: "keyword", indent: true},
+ {regex: /\b(?:(Function|PageEx|Section(?:Group)?)End)\b/, token: "keyword", dedent: true},
+
+ // Command Options
+ {regex: /\b(?:ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b/, token: "atom"},
+ {regex: /\b(?:admin|all|auto|both|bottom|bzip2|components|current|custom|directory|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|right|show|silent|silentlog|textonly|top|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|WinVista|zlib)\b/, token: "builtin"},
+
+ // LogicLib.nsh
+ {regex: /\$\{(?:And(?:If(?:Not)?|Unless)|Break|Case(?:Else)?|Continue|Default|Do(?:Until|While)?|Else(?:If(?:Not)?|Unless)?|End(?:If|Select|Switch)|Exit(?:Do|For|While)|For(?:Each)?|If(?:Cmd|Not(?:Then)?|Then)?|Loop(?:Until|While)?|Or(?:If(?:Not)?|Unless)|Select|Switch|Unless|While)\}/, token: "variable-2", indent: true},
+
+ // FileFunc.nsh
+ {regex: /\$\{(?:BannerTrimPath|DirState|DriveSpace|Get(BaseName|Drives|ExeName|ExePath|FileAttributes|FileExt|FileName|FileVersion|Options|OptionsS|Parameters|Parent|Root|Size|Time)|Locate|RefreshShellIcons)\}/, token: "variable-2", dedent: true},
+
+ // Memento.nsh
+ {regex: /\$\{(?:Memento(?:Section(?:Done|End|Restore|Save)?|UnselectedSection))\}/, token: "variable-2", dedent: true},
+
+ // TextFunc.nsh
+ {regex: /\$\{(?:Config(?:Read|ReadS|Write|WriteS)|File(?:Join|ReadFromEnd|Recode)|Line(?:Find|Read|Sum)|Text(?:Compare|CompareS)|TrimNewLines)\}/, token: "variable-2", dedent: true},
+
+ // WinVer.nsh
+ {regex: /\$\{(?:(?:At(?:Least|Most)|Is)(?:ServicePack|Win(?:7|8|10|95|98|200(?:0|3|8(?:R2)?)|ME|NT4|Vista|XP))|Is(?:NT|Server))\}/, token: "variable", dedent: true},
+
+ // WordFunc.nsh
+ {regex: /\$\{(?:StrFilterS?|Version(?:Compare|Convert)|Word(?:AddS?|Find(?:(?:2|3)X)?S?|InsertS?|ReplaceS?))\}/, token: "variable-2", dedent: true},
+
+ // x64.nsh
+ {regex: /\$\{(?:RunningX64)\}/, token: "variable", dedent: true},
+ {regex: /\$\{(?:Disable|Enable)X64FSRedirection\}/, token: "variable-2", dedent: true},
+
+ // Line Comment
+ {regex: /(#|;).*/, token: "comment"},
+
+ // Block Comment
+ {regex: /\/\*/, token: "comment", next: "comment"},
+
+ // Operator
+ {regex: /[-+\/*=<>!]+/, token: "operator"},
+
+ // Variable
+ {regex: /\$[\w]+/, token: "variable"},
+
+ // Constant
+ {regex: /\${[\w]+}/,token: "variable-2"},
+
+ // Language String
+ {regex: /\$\([\w]+\)/,token: "variable-3"}
+ ],
+ comment: [
+ {regex: /.*?\*\//, token: "comment", next: "start"},
+ {regex: /.*/, token: "comment"}
+ ],
+ meta: {
+ electricInput: /^\s*((Function|PageEx|Section|Section(Group)?)End|(\!(endif|macroend))|\$\{(End(If|Unless|While)|Loop(Until)|Next)\})$/,
+ blockCommentStart: "/*",
+ blockCommentEnd: "*/",
+ lineComment: ["#", ";"]
+ }
+});
+
+CodeMirror.defineMIME("text/x-nsis", "nsis");
+});
diff --git a/public/vendor/codemirror/mode/ntriples/index.html b/public/vendor/codemirror/mode/ntriples/index.html
index 1355e718..1355e718 100755..100644
--- a/public/vendor/codemirror/mode/ntriples/index.html
+++ b/public/vendor/codemirror/mode/ntriples/index.html
diff --git a/public/vendor/codemirror/mode/ntriples/ntriples.js b/public/vendor/codemirror/mode/ntriples/ntriples.js
index 0524b1e8..0524b1e8 100755..100644
--- a/public/vendor/codemirror/mode/ntriples/ntriples.js
+++ b/public/vendor/codemirror/mode/ntriples/ntriples.js
diff --git a/public/vendor/codemirror/mode/octave/index.html b/public/vendor/codemirror/mode/octave/index.html
index 79df5811..79df5811 100755..100644
--- a/public/vendor/codemirror/mode/octave/index.html
+++ b/public/vendor/codemirror/mode/octave/index.html
diff --git a/public/vendor/codemirror/mode/octave/octave.js b/public/vendor/codemirror/mode/octave/octave.js
index a7bec030..a7bec030 100755..100644
--- a/public/vendor/codemirror/mode/octave/octave.js
+++ b/public/vendor/codemirror/mode/octave/octave.js
diff --git a/public/vendor/codemirror/mode/oz/index.html b/public/vendor/codemirror/mode/oz/index.html
new file mode 100644
index 00000000..febd82a5
--- /dev/null
+++ b/public/vendor/codemirror/mode/oz/index.html
@@ -0,0 +1,59 @@
+<!doctype html>
+
+<title>CodeMirror: Oz mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="oz.js"></script>
+<script type="text/javascript" src="../../addon/runmode/runmode.js"></script>
+<style>
+ .CodeMirror {border: 1px solid #aaa;}
+</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">Oz</a>
+ </ul>
+</div>
+
+<article>
+<h2>Oz mode</h2>
+<textarea id="code" name="code">
+declare
+fun {Ints N Max}
+ if N == Max then nil
+ else
+ {Delay 1000}
+ N|{Ints N+1 Max}
+ end
+end
+
+fun {Sum S Stream}
+ case Stream of nil then S
+ [] H|T then S|{Sum H+S T} end
+end
+
+local X Y in
+ thread X = {Ints 0 1000} end
+ thread Y = {Sum 0 X} end
+ {Browse Y}
+end
+</textarea>
+<p>MIME type defined: <code>text/x-oz</code>.</p>
+
+<script type="text/javascript">
+var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ mode: "text/x-oz",
+ readOnly: false
+});
+</script>
+</article>
diff --git a/public/vendor/codemirror/mode/oz/oz.js b/public/vendor/codemirror/mode/oz/oz.js
new file mode 100644
index 00000000..ee8cb0ad
--- /dev/null
+++ b/public/vendor/codemirror/mode/oz/oz.js
@@ -0,0 +1,252 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+"use strict";
+
+CodeMirror.defineMode("oz", function (conf) {
+
+ function wordRegexp(words) {
+ return new RegExp("^((" + words.join(")|(") + "))\\b");
+ }
+
+ var singleOperators = /[\^@!\|<>#~\.\*\-\+\\/,=]/;
+ var doubleOperators = /(<-)|(:=)|(=<)|(>=)|(<=)|(<:)|(>:)|(=:)|(\\=)|(\\=:)|(!!)|(==)|(::)/;
+ var tripleOperators = /(:::)|(\.\.\.)|(=<:)|(>=:)/;
+
+ var middle = ["in", "then", "else", "of", "elseof", "elsecase", "elseif", "catch",
+ "finally", "with", "require", "prepare", "import", "export", "define", "do"];
+ var end = ["end"];
+
+ var atoms = wordRegexp(["true", "false", "nil", "unit"]);
+ var commonKeywords = wordRegexp(["andthen", "at", "attr", "declare", "feat", "from", "lex",
+ "mod", "mode", "orelse", "parser", "prod", "prop", "scanner", "self", "syn", "token"]);
+ var openingKeywords = wordRegexp(["local", "proc", "fun", "case", "class", "if", "cond", "or", "dis",
+ "choice", "not", "thread", "try", "raise", "lock", "for", "suchthat", "meth", "functor"]);
+ var middleKeywords = wordRegexp(middle);
+ var endKeywords = wordRegexp(end);
+
+ // Tokenizers
+ function tokenBase(stream, state) {
+ if (stream.eatSpace()) {
+ return null;
+ }
+
+ // Brackets
+ if(stream.match(/[{}]/)) {
+ return "bracket";
+ }
+
+ // Special [] keyword
+ if (stream.match(/(\[])/)) {
+ return "keyword"
+ }
+
+ // Operators
+ if (stream.match(tripleOperators) || stream.match(doubleOperators)) {
+ return "operator";
+ }
+
+ // Atoms
+ if(stream.match(atoms)) {
+ return 'atom';
+ }
+
+ // Opening keywords
+ var matched = stream.match(openingKeywords);
+ if (matched) {
+ if (!state.doInCurrentLine)
+ state.currentIndent++;
+ else
+ state.doInCurrentLine = false;
+
+ // Special matching for signatures
+ if(matched[0] == "proc" || matched[0] == "fun")
+ state.tokenize = tokenFunProc;
+ else if(matched[0] == "class")
+ state.tokenize = tokenClass;
+ else if(matched[0] == "meth")
+ state.tokenize = tokenMeth;
+
+ return 'keyword';
+ }
+
+ // Middle and other keywords
+ if (stream.match(middleKeywords) || stream.match(commonKeywords)) {
+ return "keyword"
+ }
+
+ // End keywords
+ if (stream.match(endKeywords)) {
+ state.currentIndent--;
+ return 'keyword';
+ }
+
+ // Eat the next char for next comparisons
+ var ch = stream.next();
+
+ // Strings
+ if (ch == '"' || ch == "'") {
+ state.tokenize = tokenString(ch);
+ return state.tokenize(stream, state);
+ }
+
+ // Numbers
+ if (/[~\d]/.test(ch)) {
+ if (ch == "~") {
+ if(! /^[0-9]/.test(stream.peek()))
+ return null;
+ else if (( stream.next() == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))
+ return "number";
+ }
+
+ if ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))
+ return "number";
+
+ return null;
+ }
+
+ // Comments
+ if (ch == "%") {
+ stream.skipToEnd();
+ return 'comment';
+ }
+ else if (ch == "/") {
+ if (stream.eat("*")) {
+ state.tokenize = tokenComment;
+ return tokenComment(stream, state);
+ }
+ }
+
+ // Single operators
+ if(singleOperators.test(ch)) {
+ return "operator";
+ }
+
+ // If nothing match, we skip the entire alphanumerical block
+ stream.eatWhile(/\w/);
+
+ return "variable";
+ }
+
+ function tokenClass(stream, state) {
+ if (stream.eatSpace()) {
+ return null;
+ }
+ stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)/);
+ state.tokenize = tokenBase;
+ return "variable-3"
+ }
+
+ function tokenMeth(stream, state) {
+ if (stream.eatSpace()) {
+ return null;
+ }
+ stream.match(/([a-zA-Z][A-Za-z0-9_]*)|(`.+`)/);
+ state.tokenize = tokenBase;
+ return "def"
+ }
+
+ function tokenFunProc(stream, state) {
+ if (stream.eatSpace()) {
+ return null;
+ }
+
+ if(!state.hasPassedFirstStage && stream.eat("{")) {
+ state.hasPassedFirstStage = true;
+ return "bracket";
+ }
+ else if(state.hasPassedFirstStage) {
+ stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)|\$/);
+ state.hasPassedFirstStage = false;
+ state.tokenize = tokenBase;
+ return "def"
+ }
+ else {
+ state.tokenize = tokenBase;
+ return null;
+ }
+ }
+
+ function tokenComment(stream, state) {
+ var maybeEnd = false, ch;
+ while (ch = stream.next()) {
+ if (ch == "/" && maybeEnd) {
+ state.tokenize = tokenBase;
+ break;
+ }
+ maybeEnd = (ch == "*");
+ }
+ return "comment";
+ }
+
+ function tokenString(quote) {
+ return function (stream, state) {
+ var escaped = false, next, end = false;
+ while ((next = stream.next()) != null) {
+ if (next == quote && !escaped) {
+ end = true;
+ break;
+ }
+ escaped = !escaped && next == "\\";
+ }
+ if (end || !escaped)
+ state.tokenize = tokenBase;
+ return "string";
+ };
+ }
+
+ function buildElectricInputRegEx() {
+ // Reindentation should occur on [] or on a match of any of
+ // the block closing keywords, at the end of a line.
+ var allClosings = middle.concat(end);
+ return new RegExp("[\\[\\]]|(" + allClosings.join("|") + ")$");
+ }
+
+ return {
+
+ startState: function () {
+ return {
+ tokenize: tokenBase,
+ currentIndent: 0,
+ doInCurrentLine: false,
+ hasPassedFirstStage: false
+ };
+ },
+
+ token: function (stream, state) {
+ if (stream.sol())
+ state.doInCurrentLine = 0;
+
+ return state.tokenize(stream, state);
+ },
+
+ indent: function (state, textAfter) {
+ var trueText = textAfter.replace(/^\s+|\s+$/g, '');
+
+ if (trueText.match(endKeywords) || trueText.match(middleKeywords) || trueText.match(/(\[])/))
+ return conf.indentUnit * (state.currentIndent - 1);
+
+ if (state.currentIndent < 0)
+ return 0;
+
+ return state.currentIndent * conf.indentUnit;
+ },
+ fold: "indent",
+ electricInput: buildElectricInputRegEx(),
+ lineComment: "%",
+ blockCommentStart: "/*",
+ blockCommentEnd: "*/"
+ };
+});
+
+CodeMirror.defineMIME("text/x-oz", "oz");
+
+});
diff --git a/public/vendor/codemirror/mode/pascal/index.html b/public/vendor/codemirror/mode/pascal/index.html
index f8a99ad0..f8a99ad0 100755..100644
--- a/public/vendor/codemirror/mode/pascal/index.html
+++ b/public/vendor/codemirror/mode/pascal/index.html
diff --git a/public/vendor/codemirror/mode/pascal/pascal.js b/public/vendor/codemirror/mode/pascal/pascal.js
index 2d0c3d42..2d0c3d42 100755..100644
--- a/public/vendor/codemirror/mode/pascal/pascal.js
+++ b/public/vendor/codemirror/mode/pascal/pascal.js
diff --git a/public/vendor/codemirror/mode/pegjs/index.html b/public/vendor/codemirror/mode/pegjs/index.html
index 0c746048..0c746048 100755..100644
--- a/public/vendor/codemirror/mode/pegjs/index.html
+++ b/public/vendor/codemirror/mode/pegjs/index.html
diff --git a/public/vendor/codemirror/mode/pegjs/pegjs.js b/public/vendor/codemirror/mode/pegjs/pegjs.js
index 306e3768..306e3768 100755..100644
--- a/public/vendor/codemirror/mode/pegjs/pegjs.js
+++ b/public/vendor/codemirror/mode/pegjs/pegjs.js
diff --git a/public/vendor/codemirror/mode/perl/index.html b/public/vendor/codemirror/mode/perl/index.html
index 8c1021c4..8c1021c4 100755..100644
--- a/public/vendor/codemirror/mode/perl/index.html
+++ b/public/vendor/codemirror/mode/perl/index.html
diff --git a/public/vendor/codemirror/mode/perl/perl.js b/public/vendor/codemirror/mode/perl/perl.js
index bef62bc7..bef62bc7 100755..100644
--- a/public/vendor/codemirror/mode/perl/perl.js
+++ b/public/vendor/codemirror/mode/perl/perl.js
diff --git a/public/vendor/codemirror/mode/php/index.html b/public/vendor/codemirror/mode/php/index.html
index adf6b1be..adf6b1be 100755..100644
--- a/public/vendor/codemirror/mode/php/index.html
+++ b/public/vendor/codemirror/mode/php/index.html
diff --git a/public/vendor/codemirror/mode/php/php.js b/public/vendor/codemirror/mode/php/php.js
index 0c3f21e5..22494467 100755..100644
--- a/public/vendor/codemirror/mode/php/php.js
+++ b/public/vendor/codemirror/mode/php/php.js
@@ -86,7 +86,7 @@
"die echo empty exit eval include include_once isset list require require_once return " +
"print unset __halt_compiler self static parent yield insteadof finally";
var phpAtoms = "true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__";
- var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";
+ var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";
CodeMirror.registerHelper("hintWords", "php", [phpKeywords, phpAtoms, phpBuiltin].join(" ").split(" "));
CodeMirror.registerHelper("wordChars", "php", /[\w$]/);
@@ -105,14 +105,15 @@
return "variable-2";
},
"<": function(stream, state) {
- if (stream.match(/<</)) {
- var nowDoc = stream.eat("'");
+ var before;
+ if (before = stream.match(/<<\s*/)) {
+ var quoted = stream.eat(/['"]/);
stream.eatWhile(/[\w\.]/);
- var delim = stream.current().slice(3 + (nowDoc ? 1 : 0));
- if (nowDoc) stream.eat("'");
+ var delim = stream.current().slice(before[0].length + (quoted ? 2 : 1));
+ if (quoted) stream.eat(quoted);
if (delim) {
(state.tokStack || (state.tokStack = [])).push(delim, 0);
- state.tokenize = phpString(delim, nowDoc ? false : true);
+ state.tokenize = phpString(delim, quoted != "'");
return "string";
}
}
@@ -159,6 +160,7 @@
if (!isPHP) {
if (stream.match(/^<\?\w*/)) {
state.curMode = phpMode;
+ if (!state.php) state.php = CodeMirror.startState(phpMode, htmlMode.indent(state.html, ""))
state.curState = state.php;
return "meta";
}
@@ -182,6 +184,7 @@
} else if (isPHP && state.php.tokenize == null && stream.match("?>")) {
state.curMode = htmlMode;
state.curState = state.html;
+ if (!state.php.context.prev) state.php = null;
return "meta";
} else {
return phpMode.token(stream, state.curState);
@@ -190,7 +193,8 @@
return {
startState: function() {
- var html = CodeMirror.startState(htmlMode), php = CodeMirror.startState(phpMode);
+ var html = CodeMirror.startState(htmlMode)
+ var php = parserConfig.startOpen ? CodeMirror.startState(phpMode) : null
return {html: html,
php: php,
curMode: parserConfig.startOpen ? phpMode : htmlMode,
@@ -200,7 +204,7 @@
copyState: function(state) {
var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html),
- php = state.php, phpNew = CodeMirror.copyState(phpMode, php), cur;
+ php = state.php, phpNew = php && CodeMirror.copyState(phpMode, php), cur;
if (state.curMode == htmlMode) cur = htmlNew;
else cur = phpNew;
return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur,
diff --git a/public/vendor/codemirror/mode/php/test.js b/public/vendor/codemirror/mode/php/test.js
index e2ecefc1..e2ecefc1 100755..100644
--- a/public/vendor/codemirror/mode/php/test.js
+++ b/public/vendor/codemirror/mode/php/test.js
diff --git a/public/vendor/codemirror/mode/pig/index.html b/public/vendor/codemirror/mode/pig/index.html
index 984c9a18..ea77f704 100755..100644
--- a/public/vendor/codemirror/mode/pig/index.html
+++ b/public/vendor/codemirror/mode/pig/index.html
@@ -1,5 +1,4 @@
-<!doctype html>
-
+<!doctype html>
<title>CodeMirror: Pig Latin mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
@@ -51,5 +50,4 @@ STORE c INTO "\path\to\output";
<p><strong>MIME type defined:</strong> <code>text/x-pig</code>
(PIG code)
-</html>
</article>
diff --git a/public/vendor/codemirror/mode/pig/pig.js b/public/vendor/codemirror/mode/pig/pig.js
index 5b567272..5b567272 100755..100644
--- a/public/vendor/codemirror/mode/pig/pig.js
+++ b/public/vendor/codemirror/mode/pig/pig.js
diff --git a/public/vendor/codemirror/mode/properties/index.html b/public/vendor/codemirror/mode/properties/index.html
index f885302d..f885302d 100755..100644
--- a/public/vendor/codemirror/mode/properties/index.html
+++ b/public/vendor/codemirror/mode/properties/index.html
diff --git a/public/vendor/codemirror/mode/properties/properties.js b/public/vendor/codemirror/mode/properties/properties.js
index 9da5baf4..9da5baf4 100755..100644
--- a/public/vendor/codemirror/mode/properties/properties.js
+++ b/public/vendor/codemirror/mode/properties/properties.js
diff --git a/public/vendor/codemirror/mode/puppet/index.html b/public/vendor/codemirror/mode/puppet/index.html
index 5614c369..5614c369 100755..100644
--- a/public/vendor/codemirror/mode/puppet/index.html
+++ b/public/vendor/codemirror/mode/puppet/index.html
diff --git a/public/vendor/codemirror/mode/puppet/puppet.js b/public/vendor/codemirror/mode/puppet/puppet.js
index e7f799f7..e7f799f7 100755..100644
--- a/public/vendor/codemirror/mode/puppet/puppet.js
+++ b/public/vendor/codemirror/mode/puppet/puppet.js
diff --git a/public/vendor/codemirror/mode/python/index.html b/public/vendor/codemirror/mode/python/index.html
index 86eb3d52..86eb3d52 100755..100644
--- a/public/vendor/codemirror/mode/python/index.html
+++ b/public/vendor/codemirror/mode/python/index.html
diff --git a/public/vendor/codemirror/mode/python/python.js b/public/vendor/codemirror/mode/python/python.js
index e5a09719..553f2d6f 100755..100644
--- a/public/vendor/codemirror/mode/python/python.js
+++ b/public/vendor/codemirror/mode/python/python.js
@@ -48,18 +48,18 @@
CodeMirror.defineMode("python", function(conf, parserConf) {
var ERRORCLASS = "error";
- var singleDelimiters = parserConf.singleDelimiters || new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]");
- var doubleOperators = parserConf.doubleOperators || new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))");
- var doubleDelimiters = parserConf.doubleDelimiters || new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))");
- var tripleDelimiters = parserConf.tripleDelimiters || new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");
+ var singleDelimiters = parserConf.singleDelimiters || /^[\(\)\[\]\{\}@,:`=;\.]/;
+ var doubleOperators = parserConf.doubleOperators || /^([!<>]==|<>|<<|>>|\/\/|\*\*)/;
+ var doubleDelimiters = parserConf.doubleDelimiters || /^(\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/;
+ var tripleDelimiters = parserConf.tripleDelimiters || /^(\/\/=|>>=|<<=|\*\*=)/;
if (parserConf.version && parseInt(parserConf.version, 10) == 3){
// since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator
- var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]");
- var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*");
+ var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!@]/;
+ var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;
} else {
- var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!]");
- var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z][_A-Za-z0-9]*");
+ var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!]/;
+ var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;
}
var hangingIndent = parserConf.hangingIndent || conf.indentUnit;
@@ -160,13 +160,16 @@
// Handle operators and Delimiters
if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters))
- return null;
+ return "punctuation";
if (stream.match(doubleOperators) || stream.match(singleOperators))
return "operator";
if (stream.match(singleDelimiters))
- return null;
+ return "punctuation";
+
+ if (state.lastToken == "." && stream.match(identifiers))
+ return "property";
if (stream.match(keywords) || stream.match(wordOperators))
return "keyword";
@@ -246,17 +249,6 @@
var style = state.tokenize(stream, state);
var current = stream.current();
- // Handle '.' connected identifiers
- if (current == ".") {
- style = stream.match(identifiers, false) ? null : ERRORCLASS;
- if (style == null && state.lastStyle == "meta") {
- // Apply 'meta' style to '.' connected identifiers when
- // appropriate.
- style = "meta";
- }
- return style;
- }
-
// Handle decorators
if (current == "@"){
if(parserConf.version && parseInt(parserConf.version, 10) == 3){
@@ -267,7 +259,7 @@
}
if ((style == "variable" || style == "builtin")
- && state.lastStyle == "meta")
+ && state.lastToken == "meta")
style = "meta";
// Handle scope changes.
@@ -300,7 +292,6 @@
return {
tokenize: tokenBase,
scopes: [{offset: basecolumn || 0, type: "py", align: null}],
- lastStyle: null,
lastToken: null,
lambda: false,
dedent: 0
@@ -312,11 +303,9 @@
if (addErr) state.errorToken = false;
var style = tokenLexer(stream, state);
- state.lastStyle = style;
-
- var current = stream.current();
- if (current && style)
- state.lastToken = current;
+ if (style && style != "comment")
+ state.lastToken = (style == "keyword" || style == "punctuation") ? stream.current() : style;
+ if (style == "punctuation") style = null;
if (stream.eol() && state.lambda)
state.lambda = false;
diff --git a/public/vendor/codemirror/mode/q/index.html b/public/vendor/codemirror/mode/q/index.html
index 72785ba3..72785ba3 100755..100644
--- a/public/vendor/codemirror/mode/q/index.html
+++ b/public/vendor/codemirror/mode/q/index.html
diff --git a/public/vendor/codemirror/mode/q/q.js b/public/vendor/codemirror/mode/q/q.js
index a4af9383..a4af9383 100755..100644
--- a/public/vendor/codemirror/mode/q/q.js
+++ b/public/vendor/codemirror/mode/q/q.js
diff --git a/public/vendor/codemirror/mode/r/index.html b/public/vendor/codemirror/mode/r/index.html
index 6dd96346..6dd96346 100755..100644
--- a/public/vendor/codemirror/mode/r/index.html
+++ b/public/vendor/codemirror/mode/r/index.html
diff --git a/public/vendor/codemirror/mode/r/r.js b/public/vendor/codemirror/mode/r/r.js
index 1ab4a956..1ab4a956 100755..100644
--- a/public/vendor/codemirror/mode/r/r.js
+++ b/public/vendor/codemirror/mode/r/r.js
diff --git a/public/vendor/codemirror/mode/rpm/changes/index.html b/public/vendor/codemirror/mode/rpm/changes/index.html
index 6e5031bd..6e5031bd 100755..100644
--- a/public/vendor/codemirror/mode/rpm/changes/index.html
+++ b/public/vendor/codemirror/mode/rpm/changes/index.html
diff --git a/public/vendor/codemirror/mode/rpm/index.html b/public/vendor/codemirror/mode/rpm/index.html
index 9a34e6df..9a34e6df 100755..100644
--- a/public/vendor/codemirror/mode/rpm/index.html
+++ b/public/vendor/codemirror/mode/rpm/index.html
diff --git a/public/vendor/codemirror/mode/rpm/rpm.js b/public/vendor/codemirror/mode/rpm/rpm.js
index 3bb7cd2f..87cde591 100755..100644
--- a/public/vendor/codemirror/mode/rpm/rpm.js
+++ b/public/vendor/codemirror/mode/rpm/rpm.js
@@ -34,10 +34,10 @@ CodeMirror.defineMIME("text/x-rpm-changes", "rpm-changes");
// Quick and dirty spec file highlighting
CodeMirror.defineMode("rpm-spec", function() {
- var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/;
+ var arch = /^(i386|i586|i686|x86_64|ppc64le|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/;
- var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/;
- var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/;
+ var preamble = /^[a-zA-Z0-9()]+:/;
+ var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pretrans|posttrans|pre|post|triggerin|triggerun|verifyscript|check|triggerpostun|triggerprein|trigger)/;
var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros
var control_flow_simple = /^%(else|endif)/; // rpm control flow macros
var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros
@@ -55,8 +55,8 @@ CodeMirror.defineMode("rpm-spec", function() {
if (ch == "#") { stream.skipToEnd(); return "comment"; }
if (stream.sol()) {
- if (stream.match(preamble)) { return "preamble"; }
- if (stream.match(section)) { return "section"; }
+ if (stream.match(preamble)) { return "header"; }
+ if (stream.match(section)) { return "atom"; }
}
if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT'
@@ -73,21 +73,29 @@ CodeMirror.defineMode("rpm-spec", function() {
if (stream.eol()) { state.controlFlow = false; }
}
- if (stream.match(arch)) { return "number"; }
+ if (stream.match(arch)) {
+ if (stream.eol()) { state.controlFlow = false; }
+ return "number";
+ }
// Macros like '%make_install' or '%attr(0775,root,root)'
if (stream.match(/^%[\w]+/)) {
if (stream.match(/^\(/)) { state.macroParameters = true; }
- return "macro";
+ return "keyword";
}
if (state.macroParameters) {
if (stream.match(/^\d+/)) { return "number";}
if (stream.match(/^\)/)) {
state.macroParameters = false;
- return "macro";
+ return "keyword";
}
}
- if (stream.match(/^%\{\??[\w \-]+\}/)) { return "macro"; } // Macros like '%{defined fedora}'
+
+ // Macros like '%{defined fedora}'
+ if (stream.match(/^%\{\??[\w \-\:\!]+\}/)) {
+ if (stream.eol()) { state.controlFlow = false; }
+ return "def";
+ }
//TODO: Include bash script sub-parser (CodeMirror supports that)
stream.next();
diff --git a/public/vendor/codemirror/mode/rst/index.html b/public/vendor/codemirror/mode/rst/index.html
index 2902dea2..2902dea2 100755..100644
--- a/public/vendor/codemirror/mode/rst/index.html
+++ b/public/vendor/codemirror/mode/rst/index.html
diff --git a/public/vendor/codemirror/mode/rst/rst.js b/public/vendor/codemirror/mode/rst/rst.js
index bcf110c1..bcf110c1 100755..100644
--- a/public/vendor/codemirror/mode/rst/rst.js
+++ b/public/vendor/codemirror/mode/rst/rst.js
diff --git a/public/vendor/codemirror/mode/ruby/index.html b/public/vendor/codemirror/mode/ruby/index.html
index 97544bab..97544bab 100755..100644
--- a/public/vendor/codemirror/mode/ruby/index.html
+++ b/public/vendor/codemirror/mode/ruby/index.html
diff --git a/public/vendor/codemirror/mode/ruby/ruby.js b/public/vendor/codemirror/mode/ruby/ruby.js
index eab9d9da..10cad8d9 100755..100644
--- a/public/vendor/codemirror/mode/ruby/ruby.js
+++ b/public/vendor/codemirror/mode/ruby/ruby.js
@@ -25,7 +25,7 @@ CodeMirror.defineMode("ruby", function(config) {
"caller", "lambda", "proc", "public", "protected", "private", "require", "load",
"require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__"
]);
- var indentWords = wordObj(["def", "class", "case", "for", "while", "module", "then",
+ var indentWords = wordObj(["def", "class", "case", "for", "while", "until", "module", "then",
"catch", "loop", "proc", "begin"]);
var dedentWords = wordObj(["end", "until"]);
var matching = {"[": "]", "{": "}", "(": ")"};
@@ -37,7 +37,6 @@ CodeMirror.defineMode("ruby", function(config) {
}
function tokenBase(stream, state) {
- curPunc = null;
if (stream.sol() && stream.match("=begin") && stream.eol()) {
state.tokenize.push(readBlockComment);
return "comment";
@@ -232,6 +231,7 @@ CodeMirror.defineMode("ruby", function(config) {
},
token: function(stream, state) {
+ curPunc = null;
if (stream.sol()) state.indented = stream.indentation();
var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype;
var thisTok = curPunc;
@@ -275,7 +275,7 @@ CodeMirror.defineMode("ruby", function(config) {
(state.continuedLine ? config.indentUnit : 0);
},
- electricChars: "}de", // enD and rescuE
+ electricInput: /^\s*(?:end|rescue|\})$/,
lineComment: "#"
};
});
diff --git a/public/vendor/codemirror/mode/ruby/test.js b/public/vendor/codemirror/mode/ruby/test.js
index cade864f..cade864f 100755..100644
--- a/public/vendor/codemirror/mode/ruby/test.js
+++ b/public/vendor/codemirror/mode/ruby/test.js
diff --git a/public/vendor/codemirror/mode/rust/index.html b/public/vendor/codemirror/mode/rust/index.html
index 407e84f2..1fe0ad1e 100755..100644
--- a/public/vendor/codemirror/mode/rust/index.html
+++ b/public/vendor/codemirror/mode/rust/index.html
@@ -6,6 +6,7 @@
<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/mode/simple.js"></script>
<script src="rust.js"></script>
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
<div id=nav>
@@ -37,22 +38,25 @@ enum bar {
fn check_crate(x: int) {
let v = 10;
- alt foo {
- 1 to 3 {
- print_foo();
- if x {
- blah() + 10;
+ match foo {
+ 1 ... 3 {
+ print_foo();
+ if x {
+ blah().to_string();
+ }
}
- }
- (x, y) { "bye" }
- _ { "hi" }
+ (x, y) { "bye" }
+ _ { "hi" }
}
}
</textarea></div>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
- lineNumbers: true
+ lineNumbers: true,
+ lineWrapping: true,
+ indentUnit: 4,
+ mode: "rust"
});
</script>
diff --git a/public/vendor/codemirror/mode/rust/rust.js b/public/vendor/codemirror/mode/rust/rust.js
index 2bffa9a6..8558b53f 100755..100644
--- a/public/vendor/codemirror/mode/rust/rust.js
+++ b/public/vendor/codemirror/mode/rust/rust.js
@@ -3,449 +3,69 @@
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"));
+ mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror"], mod);
+ define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
-CodeMirror.defineMode("rust", function() {
- var indentUnit = 4, altIndentUnit = 2;
- var valKeywords = {
- "if": "if-style", "while": "if-style", "loop": "else-style", "else": "else-style",
- "do": "else-style", "ret": "else-style", "fail": "else-style",
- "break": "atom", "cont": "atom", "const": "let", "resource": "fn",
- "let": "let", "fn": "fn", "for": "for", "alt": "alt", "iface": "iface",
- "impl": "impl", "type": "type", "enum": "enum", "mod": "mod",
- "as": "op", "true": "atom", "false": "atom", "assert": "op", "check": "op",
- "claim": "op", "native": "ignore", "unsafe": "ignore", "import": "else-style",
- "export": "else-style", "copy": "op", "log": "op", "log_err": "op",
- "use": "op", "bind": "op", "self": "atom", "struct": "enum"
- };
- var typeKeywords = function() {
- var keywords = {"fn": "fn", "block": "fn", "obj": "obj"};
- var atoms = "bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" ");
- for (var i = 0, e = atoms.length; i < e; ++i) keywords[atoms[i]] = "atom";
- return keywords;
- }();
- var operatorChar = /[+\-*&%=<>!?|\.@]/;
-
- // Tokenizer
-
- // Used as scratch variable to communicate multiple values without
- // consing up tons of objects.
- var tcat, content;
- function r(tc, style) {
- tcat = tc;
- return style;
- }
-
- function tokenBase(stream, state) {
- var ch = stream.next();
- if (ch == '"') {
- state.tokenize = tokenString;
- return state.tokenize(stream, state);
- }
- if (ch == "'") {
- tcat = "atom";
- if (stream.eat("\\")) {
- if (stream.skipTo("'")) { stream.next(); return "string"; }
- else { return "error"; }
- } else {
- stream.next();
- return stream.eat("'") ? "string" : "error";
- }
- }
- if (ch == "/") {
- if (stream.eat("/")) { stream.skipToEnd(); return "comment"; }
- if (stream.eat("*")) {
- state.tokenize = tokenComment(1);
- return state.tokenize(stream, state);
- }
- }
- if (ch == "#") {
- if (stream.eat("[")) { tcat = "open-attr"; return null; }
- stream.eatWhile(/\w/);
- return r("macro", "meta");
- }
- if (ch == ":" && stream.match(":<")) {
- return r("op", null);
- }
- if (ch.match(/\d/) || (ch == "." && stream.eat(/\d/))) {
- var flp = false;
- if (!stream.match(/^x[\da-f]+/i) && !stream.match(/^b[01]+/)) {
- stream.eatWhile(/\d/);
- if (stream.eat(".")) { flp = true; stream.eatWhile(/\d/); }
- if (stream.match(/^e[+\-]?\d+/i)) { flp = true; }
- }
- if (flp) stream.match(/^f(?:32|64)/);
- else stream.match(/^[ui](?:8|16|32|64)/);
- return r("atom", "number");
- }
- if (ch.match(/[()\[\]{}:;,]/)) return r(ch, null);
- if (ch == "-" && stream.eat(">")) return r("->", null);
- if (ch.match(operatorChar)) {
- stream.eatWhile(operatorChar);
- return r("op", null);
- }
- stream.eatWhile(/\w/);
- content = stream.current();
- if (stream.match(/^::\w/)) {
- stream.backUp(1);
- return r("prefix", "variable-2");
- }
- if (state.keywords.propertyIsEnumerable(content))
- return r(state.keywords[content], content.match(/true|false/) ? "atom" : "keyword");
- return r("name", "variable");
- }
-
- function tokenString(stream, state) {
- var ch, escaped = false;
- while (ch = stream.next()) {
- if (ch == '"' && !escaped) {
- state.tokenize = tokenBase;
- return r("atom", "string");
- }
- escaped = !escaped && ch == "\\";
- }
- // Hack to not confuse the parser when a string is split in
- // pieces.
- return r("op", "string");
- }
-
- function tokenComment(depth) {
- return function(stream, state) {
- var lastCh = null, ch;
- while (ch = stream.next()) {
- if (ch == "/" && lastCh == "*") {
- if (depth == 1) {
- state.tokenize = tokenBase;
- break;
- } else {
- state.tokenize = tokenComment(depth - 1);
- return state.tokenize(stream, state);
- }
- }
- if (ch == "*" && lastCh == "/") {
- state.tokenize = tokenComment(depth + 1);
- return state.tokenize(stream, state);
- }
- lastCh = ch;
- }
- return "comment";
- };
- }
-
- // Parser
-
- var cx = {state: null, stream: null, marked: null, cc: null};
- function pass() {
- for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
- }
- function cont() {
- pass.apply(null, arguments);
- return true;
- }
-
- function pushlex(type, info) {
- var result = function() {
- var state = cx.state;
- state.lexical = {indented: state.indented, column: cx.stream.column(),
- type: type, prev: state.lexical, info: info};
- };
- result.lex = true;
- return result;
- }
- function poplex() {
- var state = cx.state;
- if (state.lexical.prev) {
- if (state.lexical.type == ")")
- state.indented = state.lexical.indented;
- state.lexical = state.lexical.prev;
- }
- }
- function typecx() { cx.state.keywords = typeKeywords; }
- function valcx() { cx.state.keywords = valKeywords; }
- poplex.lex = typecx.lex = valcx.lex = true;
-
- function commasep(comb, end) {
- function more(type) {
- if (type == ",") return cont(comb, more);
- if (type == end) return cont();
- return cont(more);
- }
- return function(type) {
- if (type == end) return cont();
- return pass(comb, more);
- };
- }
-
- function stat_of(comb, tag) {
- return cont(pushlex("stat", tag), comb, poplex, block);
- }
- function block(type) {
- if (type == "}") return cont();
- if (type == "let") return stat_of(letdef1, "let");
- if (type == "fn") return stat_of(fndef);
- if (type == "type") return cont(pushlex("stat"), tydef, endstatement, poplex, block);
- if (type == "enum") return stat_of(enumdef);
- if (type == "mod") return stat_of(mod);
- if (type == "iface") return stat_of(iface);
- if (type == "impl") return stat_of(impl);
- if (type == "open-attr") return cont(pushlex("]"), commasep(expression, "]"), poplex);
- if (type == "ignore" || type.match(/[\]\);,]/)) return cont(block);
- return pass(pushlex("stat"), expression, poplex, endstatement, block);
- }
- function endstatement(type) {
- if (type == ";") return cont();
- return pass();
- }
- function expression(type) {
- if (type == "atom" || type == "name") return cont(maybeop);
- if (type == "{") return cont(pushlex("}"), exprbrace, poplex);
- if (type.match(/[\[\(]/)) return matchBrackets(type, expression);
- if (type.match(/[\]\)\};,]/)) return pass();
- if (type == "if-style") return cont(expression, expression);
- if (type == "else-style" || type == "op") return cont(expression);
- if (type == "for") return cont(pattern, maybetype, inop, expression, expression);
- if (type == "alt") return cont(expression, altbody);
- if (type == "fn") return cont(fndef);
- if (type == "macro") return cont(macro);
- return cont();
- }
- function maybeop(type) {
- if (content == ".") return cont(maybeprop);
- if (content == "::<"){return cont(typarams, maybeop);}
- if (type == "op" || content == ":") return cont(expression);
- if (type == "(" || type == "[") return matchBrackets(type, expression);
- return pass();
- }
- function maybeprop() {
- if (content.match(/^\w+$/)) {cx.marked = "variable"; return cont(maybeop);}
- return pass(expression);
- }
- function exprbrace(type) {
- if (type == "op") {
- if (content == "|") return cont(blockvars, poplex, pushlex("}", "block"), block);
- if (content == "||") return cont(poplex, pushlex("}", "block"), block);
- }
- if (content == "mutable" || (content.match(/^\w+$/) && cx.stream.peek() == ":"
- && !cx.stream.match("::", false)))
- return pass(record_of(expression));
- return pass(block);
- }
- function record_of(comb) {
- function ro(type) {
- if (content == "mutable" || content == "with") {cx.marked = "keyword"; return cont(ro);}
- if (content.match(/^\w*$/)) {cx.marked = "variable"; return cont(ro);}
- if (type == ":") return cont(comb, ro);
- if (type == "}") return cont();
- return cont(ro);
- }
- return ro;
- }
- function blockvars(type) {
- if (type == "name") {cx.marked = "def"; return cont(blockvars);}
- if (type == "op" && content == "|") return cont();
- return cont(blockvars);
- }
-
- function letdef1(type) {
- if (type.match(/[\]\)\};]/)) return cont();
- if (content == "=") return cont(expression, letdef2);
- if (type == ",") return cont(letdef1);
- return pass(pattern, maybetype, letdef1);
- }
- function letdef2(type) {
- if (type.match(/[\]\)\};,]/)) return pass(letdef1);
- else return pass(expression, letdef2);
- }
- function maybetype(type) {
- if (type == ":") return cont(typecx, rtype, valcx);
- return pass();
- }
- function inop(type) {
- if (type == "name" && content == "in") {cx.marked = "keyword"; return cont();}
- return pass();
- }
- function fndef(type) {
- if (content == "@" || content == "~") {cx.marked = "keyword"; return cont(fndef);}
- if (type == "name") {cx.marked = "def"; return cont(fndef);}
- if (content == "<") return cont(typarams, fndef);
- if (type == "{") return pass(expression);
- if (type == "(") return cont(pushlex(")"), commasep(argdef, ")"), poplex, fndef);
- if (type == "->") return cont(typecx, rtype, valcx, fndef);
- if (type == ";") return cont();
- return cont(fndef);
- }
- function tydef(type) {
- if (type == "name") {cx.marked = "def"; return cont(tydef);}
- if (content == "<") return cont(typarams, tydef);
- if (content == "=") return cont(typecx, rtype, valcx);
- return cont(tydef);
- }
- function enumdef(type) {
- if (type == "name") {cx.marked = "def"; return cont(enumdef);}
- if (content == "<") return cont(typarams, enumdef);
- if (content == "=") return cont(typecx, rtype, valcx, endstatement);
- if (type == "{") return cont(pushlex("}"), typecx, enumblock, valcx, poplex);
- return cont(enumdef);
- }
- function enumblock(type) {
- if (type == "}") return cont();
- if (type == "(") return cont(pushlex(")"), commasep(rtype, ")"), poplex, enumblock);
- if (content.match(/^\w+$/)) cx.marked = "def";
- return cont(enumblock);
- }
- function mod(type) {
- if (type == "name") {cx.marked = "def"; return cont(mod);}
- if (type == "{") return cont(pushlex("}"), block, poplex);
- return pass();
- }
- function iface(type) {
- if (type == "name") {cx.marked = "def"; return cont(iface);}
- if (content == "<") return cont(typarams, iface);
- if (type == "{") return cont(pushlex("}"), block, poplex);
- return pass();
- }
- function impl(type) {
- if (content == "<") return cont(typarams, impl);
- if (content == "of" || content == "for") {cx.marked = "keyword"; return cont(rtype, impl);}
- if (type == "name") {cx.marked = "def"; return cont(impl);}
- if (type == "{") return cont(pushlex("}"), block, poplex);
- return pass();
- }
- function typarams() {
- if (content == ">") return cont();
- if (content == ",") return cont(typarams);
- if (content == ":") return cont(rtype, typarams);
- return pass(rtype, typarams);
- }
- function argdef(type) {
- if (type == "name") {cx.marked = "def"; return cont(argdef);}
- if (type == ":") return cont(typecx, rtype, valcx);
- return pass();
- }
- function rtype(type) {
- if (type == "name") {cx.marked = "variable-3"; return cont(rtypemaybeparam); }
- if (content == "mutable") {cx.marked = "keyword"; return cont(rtype);}
- if (type == "atom") return cont(rtypemaybeparam);
- if (type == "op" || type == "obj") return cont(rtype);
- if (type == "fn") return cont(fntype);
- if (type == "{") return cont(pushlex("{"), record_of(rtype), poplex);
- return matchBrackets(type, rtype);
- }
- function rtypemaybeparam() {
- if (content == "<") return cont(typarams);
- return pass();
- }
- function fntype(type) {
- if (type == "(") return cont(pushlex("("), commasep(rtype, ")"), poplex, fntype);
- if (type == "->") return cont(rtype);
- return pass();
- }
- function pattern(type) {
- if (type == "name") {cx.marked = "def"; return cont(patternmaybeop);}
- if (type == "atom") return cont(patternmaybeop);
- if (type == "op") return cont(pattern);
- if (type.match(/[\]\)\};,]/)) return pass();
- return matchBrackets(type, pattern);
- }
- function patternmaybeop(type) {
- if (type == "op" && content == ".") return cont();
- if (content == "to") {cx.marked = "keyword"; return cont(pattern);}
- else return pass();
- }
- function altbody(type) {
- if (type == "{") return cont(pushlex("}", "alt"), altblock1, poplex);
- return pass();
- }
- function altblock1(type) {
- if (type == "}") return cont();
- if (type == "|") return cont(altblock1);
- if (content == "when") {cx.marked = "keyword"; return cont(expression, altblock2);}
- if (type.match(/[\]\);,]/)) return cont(altblock1);
- return pass(pattern, altblock2);
- }
- function altblock2(type) {
- if (type == "{") return cont(pushlex("}", "alt"), block, poplex, altblock1);
- else return pass(altblock1);
- }
-
- function macro(type) {
- if (type.match(/[\[\(\{]/)) return matchBrackets(type, expression);
- return pass();
- }
- function matchBrackets(type, comb) {
- if (type == "[") return cont(pushlex("]"), commasep(comb, "]"), poplex);
- if (type == "(") return cont(pushlex(")"), commasep(comb, ")"), poplex);
- if (type == "{") return cont(pushlex("}"), commasep(comb, "}"), poplex);
- return cont();
- }
-
- function parse(state, stream, style) {
- var cc = state.cc;
- // Communicate our context to the combinators.
- // (Less wasteful than consing up a hundred closures on every call.)
- cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc;
-
- while (true) {
- var combinator = cc.length ? cc.pop() : block;
- if (combinator(tcat)) {
- while(cc.length && cc[cc.length - 1].lex)
- cc.pop()();
- return cx.marked || style;
- }
- }
- }
-
- return {
- startState: function() {
- return {
- tokenize: tokenBase,
- cc: [],
- lexical: {indented: -indentUnit, column: 0, type: "top", align: false},
- keywords: valKeywords,
- indented: 0
- };
- },
-
- token: function(stream, state) {
- if (stream.sol()) {
- if (!state.lexical.hasOwnProperty("align"))
- state.lexical.align = false;
- state.indented = stream.indentation();
- }
- if (stream.eatSpace()) return null;
- tcat = content = null;
- var style = state.tokenize(stream, state);
- if (style == "comment") return style;
- if (!state.lexical.hasOwnProperty("align"))
- state.lexical.align = true;
- if (tcat == "prefix") return style;
- if (!content) content = stream.current();
- return parse(state, stream, style);
- },
-
- indent: function(state, textAfter) {
- if (state.tokenize != tokenBase) return 0;
- var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical,
- type = lexical.type, closing = firstChar == type;
- if (type == "stat") return lexical.indented + indentUnit;
- if (lexical.align) return lexical.column + (closing ? 0 : 1);
- return lexical.indented + (closing ? 0 : (lexical.info == "alt" ? altIndentUnit : indentUnit));
- },
-
- electricChars: "{}",
+CodeMirror.defineSimpleMode("rust",{
+ start: [
+ // string and byte string
+ {regex: /b?"/, token: "string", next: "string"},
+ // raw string and raw byte string
+ {regex: /b?r"/, token: "string", next: "string_raw"},
+ {regex: /b?r#+"/, token: "string", next: "string_raw_hash"},
+ // character
+ {regex: /'(?:[^'\\]|\\(?:[nrt0'"]|x[\da-fA-F]{2}|u\{[\da-fA-F]{6}\}))'/, token: "string-2"},
+ // byte
+ {regex: /b'(?:[^']|\\(?:['\\nrt0]|x[\da-fA-F]{2}))'/, token: "string-2"},
+
+ {regex: /(?:(?:[0-9][0-9_]*)(?:(?:[Ee][+-]?[0-9_]+)|\.[0-9_]+(?:[Ee][+-]?[0-9_]+)?)(?:f32|f64)?)|(?:0(?:b[01_]+|(?:o[0-7_]+)|(?:x[0-9a-fA-F_]+))|(?:[0-9][0-9_]*))(?:u8|u16|u32|u64|i8|i16|i32|i64|isize|usize)?/,
+ token: "number"},
+ {regex: /(let(?:\s+mut)?|fn|enum|mod|struct|type)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)/, token: ["keyword", null, "def"]},
+ {regex: /(?:abstract|alignof|as|box|break|continue|const|crate|do|else|enum|extern|fn|for|final|if|impl|in|loop|macro|match|mod|move|offsetof|override|priv|proc|pub|pure|ref|return|self|sizeof|static|struct|super|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\b/, token: "keyword"},
+ {regex: /\b(?:Self|isize|usize|char|bool|u8|u16|u32|u64|f16|f32|f64|i8|i16|i32|i64|str|Option)\b/, token: "atom"},
+ {regex: /\b(?:true|false|Some|None|Ok|Err)\b/, token: "builtin"},
+ {regex: /\b(fn)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)/,
+ token: ["keyword", null ,"def"]},
+ {regex: /#!?\[.*\]/, token: "meta"},
+ {regex: /\/\/.*/, token: "comment"},
+ {regex: /\/\*/, token: "comment", next: "comment"},
+ {regex: /[-+\/*=<>!]+/, token: "operator"},
+ {regex: /[a-zA-Z_]\w*!/,token: "variable-3"},
+ {regex: /[a-zA-Z_]\w*/, token: "variable"},
+ {regex: /[\{\[\(]/, indent: true},
+ {regex: /[\}\]\)]/, dedent: true}
+ ],
+ string: [
+ {regex: /"/, token: "string", next: "start"},
+ {regex: /(?:[^\\"]|\\(?:.|$))*/, token: "string"}
+ ],
+ string_raw: [
+ {regex: /"/, token: "string", next: "start"},
+ {regex: /[^"]*/, token: "string"}
+ ],
+ string_raw_hash: [
+ {regex: /"#+/, token: "string", next: "start"},
+ {regex: /(?:[^"]|"(?!#))*/, token: "string"}
+ ],
+ comment: [
+ {regex: /.*?\*\//, token: "comment", next: "start"},
+ {regex: /.*/, token: "comment"}
+ ],
+ meta: {
+ dontIndentStates: ["comment"],
+ electricInput: /^\s*\}$/,
blockCommentStart: "/*",
blockCommentEnd: "*/",
lineComment: "//",
fold: "brace"
- };
+ }
});
-CodeMirror.defineMIME("text/x-rustsrc", "rust");
+CodeMirror.defineMIME("text/x-rustsrc", "rust");
});
diff --git a/public/vendor/codemirror/mode/rust/test.js b/public/vendor/codemirror/mode/rust/test.js
new file mode 100644
index 00000000..eb256c47
--- /dev/null
+++ b/public/vendor/codemirror/mode/rust/test.js
@@ -0,0 +1,39 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+ var mode = CodeMirror.getMode({indentUnit: 4}, "rust");
+ function MT(name) {test.mode(name, mode, Array.prototype.slice.call(arguments, 1));}
+
+ MT('integer_test',
+ '[number 123i32]',
+ '[number 123u32]',
+ '[number 123_u32]',
+ '[number 0xff_u8]',
+ '[number 0o70_i16]',
+ '[number 0b1111_1111_1001_0000_i32]',
+ '[number 0usize]');
+
+ MT('float_test',
+ '[number 123.0f64]',
+ '[number 0.1f64]',
+ '[number 0.1f32]',
+ '[number 12E+99_f64]');
+
+ MT('string-literals-test',
+ '[string "foo"]',
+ '[string r"foo"]',
+ '[string "\\"foo\\""]',
+ '[string r#""foo""#]',
+ '[string "foo #\\"# bar"]',
+
+ '[string b"foo"]',
+ '[string br"foo"]',
+ '[string b"\\"foo\\""]',
+ '[string br#""foo""#]',
+ '[string br##"foo #" bar"##]',
+
+ "[string-2 'h']",
+ "[string-2 b'h']");
+
+})();
diff --git a/public/vendor/codemirror/mode/sass/index.html b/public/vendor/codemirror/mode/sass/index.html
index 9f4a7902..9f4a7902 100755..100644
--- a/public/vendor/codemirror/mode/sass/index.html
+++ b/public/vendor/codemirror/mode/sass/index.html
diff --git a/public/vendor/codemirror/mode/sass/sass.js b/public/vendor/codemirror/mode/sass/sass.js
index 6973ece2..6973ece2 100755..100644
--- a/public/vendor/codemirror/mode/sass/sass.js
+++ b/public/vendor/codemirror/mode/sass/sass.js
diff --git a/public/vendor/codemirror/mode/scheme/index.html b/public/vendor/codemirror/mode/scheme/index.html
index 04d5c6a2..04d5c6a2 100755..100644
--- a/public/vendor/codemirror/mode/scheme/index.html
+++ b/public/vendor/codemirror/mode/scheme/index.html
diff --git a/public/vendor/codemirror/mode/scheme/scheme.js b/public/vendor/codemirror/mode/scheme/scheme.js
index 22346459..22346459 100755..100644
--- a/public/vendor/codemirror/mode/scheme/scheme.js
+++ b/public/vendor/codemirror/mode/scheme/scheme.js
diff --git a/public/vendor/codemirror/mode/shell/index.html b/public/vendor/codemirror/mode/shell/index.html
index 0b56300b..0b56300b 100755..100644
--- a/public/vendor/codemirror/mode/shell/index.html
+++ b/public/vendor/codemirror/mode/shell/index.html
diff --git a/public/vendor/codemirror/mode/shell/shell.js b/public/vendor/codemirror/mode/shell/shell.js
index a684e8c2..a684e8c2 100755..100644
--- a/public/vendor/codemirror/mode/shell/shell.js
+++ b/public/vendor/codemirror/mode/shell/shell.js
diff --git a/public/vendor/codemirror/mode/shell/test.js b/public/vendor/codemirror/mode/shell/test.js
index a413b5a4..a413b5a4 100755..100644
--- a/public/vendor/codemirror/mode/shell/test.js
+++ b/public/vendor/codemirror/mode/shell/test.js
diff --git a/public/vendor/codemirror/mode/sieve/index.html b/public/vendor/codemirror/mode/sieve/index.html
index 6f029b62..6f029b62 100755..100644
--- a/public/vendor/codemirror/mode/sieve/index.html
+++ b/public/vendor/codemirror/mode/sieve/index.html
diff --git a/public/vendor/codemirror/mode/sieve/sieve.js b/public/vendor/codemirror/mode/sieve/sieve.js
index f67db2f5..f67db2f5 100755..100644
--- a/public/vendor/codemirror/mode/sieve/sieve.js
+++ b/public/vendor/codemirror/mode/sieve/sieve.js
diff --git a/public/vendor/codemirror/mode/slim/index.html b/public/vendor/codemirror/mode/slim/index.html
index 7fa4e50d..7fa4e50d 100755..100644
--- a/public/vendor/codemirror/mode/slim/index.html
+++ b/public/vendor/codemirror/mode/slim/index.html
diff --git a/public/vendor/codemirror/mode/slim/slim.js b/public/vendor/codemirror/mode/slim/slim.js
index 164464d0..164464d0 100755..100644
--- a/public/vendor/codemirror/mode/slim/slim.js
+++ b/public/vendor/codemirror/mode/slim/slim.js
diff --git a/public/vendor/codemirror/mode/slim/test.js b/public/vendor/codemirror/mode/slim/test.js
index be4ddacb..be4ddacb 100755..100644
--- a/public/vendor/codemirror/mode/slim/test.js
+++ b/public/vendor/codemirror/mode/slim/test.js
diff --git a/public/vendor/codemirror/mode/smalltalk/index.html b/public/vendor/codemirror/mode/smalltalk/index.html
index 2155ebc2..2155ebc2 100755..100644
--- a/public/vendor/codemirror/mode/smalltalk/index.html
+++ b/public/vendor/codemirror/mode/smalltalk/index.html
diff --git a/public/vendor/codemirror/mode/smalltalk/smalltalk.js b/public/vendor/codemirror/mode/smalltalk/smalltalk.js
index bb510ba2..bb510ba2 100755..100644
--- a/public/vendor/codemirror/mode/smalltalk/smalltalk.js
+++ b/public/vendor/codemirror/mode/smalltalk/smalltalk.js
diff --git a/public/vendor/codemirror/mode/smarty/index.html b/public/vendor/codemirror/mode/smarty/index.html
index b19c8f09..b19c8f09 100755..100644
--- a/public/vendor/codemirror/mode/smarty/index.html
+++ b/public/vendor/codemirror/mode/smarty/index.html
diff --git a/public/vendor/codemirror/mode/smarty/smarty.js b/public/vendor/codemirror/mode/smarty/smarty.js
index 6e0fbed4..6e0fbed4 100755..100644
--- a/public/vendor/codemirror/mode/smarty/smarty.js
+++ b/public/vendor/codemirror/mode/smarty/smarty.js
diff --git a/public/vendor/codemirror/mode/solr/index.html b/public/vendor/codemirror/mode/solr/index.html
index 4b18c25b..4b18c25b 100755..100644
--- a/public/vendor/codemirror/mode/solr/index.html
+++ b/public/vendor/codemirror/mode/solr/index.html
diff --git a/public/vendor/codemirror/mode/solr/solr.js b/public/vendor/codemirror/mode/solr/solr.js
index f7f70878..f7f70878 100755..100644
--- a/public/vendor/codemirror/mode/solr/solr.js
+++ b/public/vendor/codemirror/mode/solr/solr.js
diff --git a/public/vendor/codemirror/mode/soy/index.html b/public/vendor/codemirror/mode/soy/index.html
index f0216f09..f0216f09 100755..100644
--- a/public/vendor/codemirror/mode/soy/index.html
+++ b/public/vendor/codemirror/mode/soy/index.html
diff --git a/public/vendor/codemirror/mode/soy/soy.js b/public/vendor/codemirror/mode/soy/soy.js
index 79bfc24d..79bfc24d 100755..100644
--- a/public/vendor/codemirror/mode/soy/soy.js
+++ b/public/vendor/codemirror/mode/soy/soy.js
diff --git a/public/vendor/codemirror/mode/sparql/index.html b/public/vendor/codemirror/mode/sparql/index.html
index 84ef4d36..84ef4d36 100755..100644
--- a/public/vendor/codemirror/mode/sparql/index.html
+++ b/public/vendor/codemirror/mode/sparql/index.html
diff --git a/public/vendor/codemirror/mode/sparql/sparql.js b/public/vendor/codemirror/mode/sparql/sparql.js
index bbf8a76a..0cf40f58 100755..100644
--- a/public/vendor/codemirror/mode/sparql/sparql.js
+++ b/public/vendor/codemirror/mode/sparql/sparql.js
@@ -165,7 +165,9 @@ CodeMirror.defineMode("sparql", function(config) {
return context.col + (closing ? 0 : 1);
else
return context.indent + (closing ? 0 : indentUnit);
- }
+ },
+
+ lineComment: "#"
};
});
diff --git a/public/vendor/codemirror/mode/spreadsheet/index.html b/public/vendor/codemirror/mode/spreadsheet/index.html
index a52f76f0..a52f76f0 100755..100644
--- a/public/vendor/codemirror/mode/spreadsheet/index.html
+++ b/public/vendor/codemirror/mode/spreadsheet/index.html
diff --git a/public/vendor/codemirror/mode/spreadsheet/spreadsheet.js b/public/vendor/codemirror/mode/spreadsheet/spreadsheet.js
index 6fab00fd..6fab00fd 100755..100644
--- a/public/vendor/codemirror/mode/spreadsheet/spreadsheet.js
+++ b/public/vendor/codemirror/mode/spreadsheet/spreadsheet.js
diff --git a/public/vendor/codemirror/mode/sql/index.html b/public/vendor/codemirror/mode/sql/index.html
index a0d8d9e1..a0d8d9e1 100755..100644
--- a/public/vendor/codemirror/mode/sql/index.html
+++ b/public/vendor/codemirror/mode/sql/index.html
diff --git a/public/vendor/codemirror/mode/sql/sql.js b/public/vendor/codemirror/mode/sql/sql.js
index a9082771..86c68f72 100755..100644
--- a/public/vendor/codemirror/mode/sql/sql.js
+++ b/public/vendor/codemirror/mode/sql/sql.js
@@ -257,7 +257,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
}
// these keywords are used by all SQL dialects (however, a mode can still overwrite it)
- var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where ";
+ var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit";
// turn a space-separated list into an array
function set(str) {
diff --git a/public/vendor/codemirror/mode/stex/index.html b/public/vendor/codemirror/mode/stex/index.html
index 14679da4..14679da4 100755..100644
--- a/public/vendor/codemirror/mode/stex/index.html
+++ b/public/vendor/codemirror/mode/stex/index.html
diff --git a/public/vendor/codemirror/mode/stex/stex.js b/public/vendor/codemirror/mode/stex/stex.js
index 835ed46d..835ed46d 100755..100644
--- a/public/vendor/codemirror/mode/stex/stex.js
+++ b/public/vendor/codemirror/mode/stex/stex.js
diff --git a/public/vendor/codemirror/mode/stex/test.js b/public/vendor/codemirror/mode/stex/test.js
index 22f027ec..22f027ec 100755..100644
--- a/public/vendor/codemirror/mode/stex/test.js
+++ b/public/vendor/codemirror/mode/stex/test.js
diff --git a/public/vendor/codemirror/mode/stylus/index.html b/public/vendor/codemirror/mode/stylus/index.html
index 862c18f2..862c18f2 100755..100644
--- a/public/vendor/codemirror/mode/stylus/index.html
+++ b/public/vendor/codemirror/mode/stylus/index.html
diff --git a/public/vendor/codemirror/mode/stylus/stylus.js b/public/vendor/codemirror/mode/stylus/stylus.js
index fc46a016..662cd03c 100755..100644
--- a/public/vendor/codemirror/mode/stylus/stylus.js
+++ b/public/vendor/codemirror/mode/stylus/stylus.js
@@ -126,19 +126,16 @@
if (stream.match(/^&{1}\s*$/)) {
return ["variable-3", "reference"];
}
- // Variable
- if (ch == "$" && stream.match(/^\$[\w-]+/i)) {
- return ["variable-2", "variable-name"];
- }
// Word operator
if (stream.match(wordOperatorKeywordsRegexp)) {
return ["operator", "operator"];
}
// Word
- if (stream.match(/^[-_]*[a-z0-9]+[\w-]*/i)) {
+ if (stream.match(/^\$?[-_]*[a-z0-9]+[\w-]*/i)) {
+ // Variable
if (stream.match(/^(\.|\[)[\w-\'\"\]]+/i, false)) {
if (!wordIsTag(stream.current())) {
- stream.match(/[\w-]+/);
+ stream.match(/\./);
return ["variable-2", "variable-name"];
}
}
@@ -323,7 +320,7 @@
return pushContext(state, stream, "block", 0);
}
if (type == "variable-name") {
- if ((stream.indentation() == 0 && startOfLine(stream)) || wordIsBlock(firstWordOfLine(stream))) {
+ if (stream.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/) || wordIsBlock(firstWordOfLine(stream))) {
return pushContext(state, stream, "variableName");
}
else {
@@ -429,6 +426,11 @@
return pushContext(state, stream, "block");
}
if (word == "return") return pushContext(state, stream, "block", 0);
+
+ // Placeholder selector
+ if (override == "variable-2" && stream.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/)) {
+ return pushContext(state, stream, "block");
+ }
}
return state.context.type;
};
@@ -639,7 +641,6 @@
states.variableName = function(type, stream, state) {
if (type == "string" || type == "[" || type == "]" || stream.current().match(/^(\.|\$)/)) {
if (stream.current().match(/^\.[\w-]+/i)) override = "variable-2";
- if (endOfLine(stream)) return popContext(state);
return "variableName";
}
return popAndPass(type, stream, state);
@@ -735,7 +736,7 @@
var nonStandardPropertyKeywords_ = ["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"];
var fontProperties_ = ["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"];
var colorKeywords_ = ["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"];
- var valueKeywords_ = ["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale"];
+ var valueKeywords_ = ["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale","row","row-reverse","wrap","wrap-reverse","column-reverse","flex-start","flex-end","space-between","space-around"];
var wordOperatorKeywords_ = ["in","and","or","not","is not","is a","is","isnt","defined","if unless"],
blockKeywords_ = ["for","if","else","unless", "from", "to"],
diff --git a/public/vendor/codemirror/mode/swift/index.html b/public/vendor/codemirror/mode/swift/index.html
index 2649dc37..109f3fdb 100755..100644
--- a/public/vendor/codemirror/mode/swift/index.html
+++ b/public/vendor/codemirror/mode/swift/index.html
@@ -35,11 +35,11 @@
// Created by Main Account on 12/18/14.
// Copyright (c) 2014 Razeware LLC. All rights reserved.
//
-
+
import Foundation
-
+
class TipCalculatorModel {
-
+
var total: Double
var taxPct: Double
var subtotal: Double {
@@ -47,30 +47,30 @@ class TipCalculatorModel {
return total / (taxPct + 1)
}
}
-
+
init(total: Double, taxPct: Double) {
self.total = total
self.taxPct = taxPct
}
-
+
func calcTipWithTipPct(tipPct: Double) -> Double {
return subtotal * tipPct
}
-
+
func returnPossibleTips() -> [Int: Double] {
-
+
let possibleTipsInferred = [0.15, 0.18, 0.20]
let possibleTipsExplicit:[Double] = [0.15, 0.18, 0.20]
-
+
var retval = [Int: Double]()
for possibleTip in possibleTipsInferred {
let intPct = Int(possibleTip*100)
retval[intPct] = calcTipWithTipPct(possibleTip)
}
return retval
-
+
}
-
+
}
</textarea></form>
diff --git a/public/vendor/codemirror/mode/swift/swift.js b/public/vendor/codemirror/mode/swift/swift.js
index cf784fef..7a2339fc 100755..100644
--- a/public/vendor/codemirror/mode/swift/swift.js
+++ b/public/vendor/codemirror/mode/swift/swift.js
@@ -13,189 +13,149 @@
})(function(CodeMirror) {
"use strict"
- function trim(str) { return /^\s*(.*?)\s*$/.exec(str)[1] }
+ function wordSet(words) {
+ var set = {}
+ for (var i = 0; i < words.length; i++) set[words[i]] = true
+ return set
+ }
+
+ var keywords = wordSet(["var","let","class","deinit","enum","extension","func","import","init","protocol",
+ "static","struct","subscript","typealias","as","dynamicType","is","new","super",
+ "self","Self","Type","__COLUMN__","__FILE__","__FUNCTION__","__LINE__","break","case",
+ "continue","default","do","else","fallthrough","if","in","for","return","switch",
+ "where","while","associativity","didSet","get","infix","inout","left","mutating",
+ "none","nonmutating","operator","override","postfix","precedence","prefix","right",
+ "set","unowned","weak","willSet"])
+ var definingKeywords = wordSet(["var","let","class","enum","extension","func","import","protocol","struct",
+ "typealias","dynamicType","for"])
+ var atoms = wordSet(["Infinity","NaN","undefined","null","true","false","on","off","yes","no","nil","null",
+ "this","super"])
+ var types = wordSet(["String","bool","int","string","double","Double","Int","Float","float","public",
+ "private","extension"])
+ var operators = "+-/*%=|&<>#"
+ var punc = ";,.(){}[]"
+ var delimiters = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/
+ var number = /^-?(?:(?:[\d_]+\.[_\d]*|\.[_\d]+|0o[0-7_\.]+|0b[01_\.]+)(?:e-?[\d_]+)?|0x[\d_a-f\.]+(?:p-?[\d_]+)?)/i
+ var identifier = /^[_A-Za-z$][_A-Za-z$0-9]*/
+ var property = /^[@\.][_A-Za-z$][_A-Za-z$0-9]*/
+ var regexp = /^\/(?!\s)(?:\/\/)?(?:\\.|[^\/])+\//
- var separators = [" ","\\\+","\\\-","\\\(","\\\)","\\\*","/",":","\\\?","\\\<","\\\>"," ","\\\."]
- var tokens = new RegExp(separators.join("|"),"g")
+ function tokenBase(stream, state, prev) {
+ if (stream.eatSpace()) return null
- function getWord(string, pos) {
- var index = -1, count = 1
- var words = string.split(tokens)
- for (var i = 0; i < words.length; i++) {
- for(var j = 1; j <= words[i].length; j++) {
- if (count==pos) index = i
- count++
+ var ch = stream.peek()
+ if (ch == "/") {
+ if (stream.match("//")) {
+ stream.skipToEnd()
+ return "comment"
}
- count++
+ if (stream.match("/*")) {
+ state.tokenize.push(tokenComment)
+ return tokenComment(stream, state)
+ }
+ if (stream.match(regexp)) return "string-2"
}
- var ret = ["", ""]
- if (pos == 0) {
- ret[1] = words[0]
- ret[0] = null
- } else {
- ret[1] = words[index]
- ret[0] = words[index-1]
+ if (operators.indexOf(ch) > -1) {
+ stream.next()
+ return "operator"
+ }
+ if (punc.indexOf(ch) > -1) {
+ stream.match(delimiters)
+ return "punctuation"
+ }
+ if (ch == '"' || ch == "'") {
+ stream.next()
+ var tokenize = tokenString(ch)
+ state.tokenize.push(tokenize)
+ return tokenize(stream, state)
}
- return ret
- }
- CodeMirror.defineMode("swift", function() {
- var keywords=["var","let","class","deinit","enum","extension","func","import","init","let","protocol","static","struct","subscript","typealias","var","as","dynamicType","is","new","super","self","Self","Type","__COLUMN__","__FILE__","__FUNCTION__","__LINE__","break","case","continue","default","do","else","fallthrough","if","in","for","return","switch","where","while","associativity","didSet","get","infix","inout","left","mutating","none","nonmutating","operator","override","postfix","precedence","prefix","right","set","unowned","unowned(safe)","unowned(unsafe)","weak","willSet"]
- var commonConstants=["Infinity","NaN","undefined","null","true","false","on","off","yes","no","nil","null","this","super"]
- var types=["String","bool","int","string","double","Double","Int","Float","float","public","private","extension"]
- var numbers=["0","1","2","3","4","5","6","7","8","9"]
- var operators=["+","-","/","*","%","=","|","&","<",">"]
- var punc=[";",",",".","(",")","{","}","[","]"]
- var delimiters=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/
- var identifiers=/^[_A-Za-z$][_A-Za-z$0-9]*/
- var properties=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/
- var regexPrefixes=/^(\/{3}|\/)/
+ if (stream.match(number)) return "number"
+ if (stream.match(property)) return "property"
- return {
- startState: function() {
- return {
- prev: false,
- string: false,
- escape: false,
- inner: false,
- comment: false,
- num_left: 0,
- num_right: 0,
- doubleString: false,
- singleString: false
+ if (stream.match(identifier)) {
+ var ident = stream.current()
+ if (keywords.hasOwnProperty(ident)) {
+ if (definingKeywords.hasOwnProperty(ident))
+ state.prev = "define"
+ return "keyword"
+ }
+ if (types.hasOwnProperty(ident)) return "variable-2"
+ if (atoms.hasOwnProperty(ident)) return "atom"
+ if (prev == "define") return "def"
+ return "variable"
+ }
+
+ stream.next()
+ return null
+ }
+
+ function tokenUntilClosingParen() {
+ var depth = 0
+ return function(stream, state, prev) {
+ var inner = tokenBase(stream, state, prev)
+ if (inner == "punctuation") {
+ if (stream.current() == "(") ++depth
+ else if (stream.current() == ")") {
+ if (depth == 0) {
+ stream.backUp(1)
+ state.tokenize.pop()
+ return state.tokenize[state.tokenize.length - 1](stream, state)
+ }
+ else --depth
}
- },
- token: function(stream, state) {
- if (stream.eatSpace()) return null
+ }
+ return inner
+ }
+ }
- var ch = stream.next()
- if (state.string) {
- if (state.escape) {
- state.escape = false
+ function tokenString(quote) {
+ return function(stream, state) {
+ var ch, escaped = false
+ while (ch = stream.next()) {
+ if (escaped) {
+ if (ch == "(") {
+ state.tokenize.push(tokenUntilClosingParen())
return "string"
- } else {
- if ((ch == "\"" && (state.doubleString && !state.singleString) ||
- (ch == "'" && (!state.doubleString && state.singleString))) &&
- !state.escape) {
- state.string = false
- state.doubleString = false
- state.singleString = false
- return "string"
- } else if (ch == "\\" && stream.peek() == "(") {
- state.inner = true
- state.string = false
- return "keyword"
- } else if (ch == "\\" && stream.peek() != "(") {
- state.escape = true
- state.string = true
- return "string"
- } else {
- return "string"
- }
- }
- } else if (state.comment) {
- if (ch == "*" && stream.peek() == "/") {
- state.prev = "*"
- return "comment"
- } else if (ch == "/" && state.prev == "*") {
- state.prev = false
- state.comment = false
- return "comment"
}
- return "comment"
+ escaped = false
+ } else if (ch == quote) {
+ break
} else {
- if (ch == "/") {
- if (stream.peek() == "/") {
- stream.skipToEnd()
- return "comment"
- }
- if (stream.peek() == "*") {
- state.comment = true
- return "comment"
- }
- }
- if (ch == "(" && state.inner) {
- state.num_left++
- return null
- }
- if (ch == ")" && state.inner) {
- state.num_right++
- if (state.num_left == state.num_right) {
- state.inner=false
- state.string=true
- }
- return null
- }
-
- var ret = getWord(stream.string, stream.pos)
- var the_word = ret[1]
- var prev_word = ret[0]
-
- if (operators.indexOf(ch + "") > -1) return "operator"
- if (punc.indexOf(ch) > -1) return "punctuation"
-
- if (typeof the_word != "undefined") {
- the_word = trim(the_word)
- if (typeof prev_word != "undefined") prev_word = trim(prev_word)
- if (the_word.charAt(0) == "#") return null
-
- if (types.indexOf(the_word) > -1) return "def"
- if (commonConstants.indexOf(the_word) > -1) return "atom"
- if (numbers.indexOf(the_word) > -1) return "number"
+ escaped = ch == "\\"
+ }
+ }
+ state.tokenize.pop()
+ return "string"
+ }
+ }
- if ((numbers.indexOf(the_word.charAt(0) + "") > -1 ||
- operators.indexOf(the_word.charAt(0) + "") > -1) &&
- numbers.indexOf(ch) > -1) {
- return "number"
- }
+ function tokenComment(stream, state) {
+ stream.match(/^(?:[^*]|\*(?!\/))*/)
+ if (stream.match("*/")) state.tokenize.pop()
+ return "comment"
+ }
- if (keywords.indexOf(the_word) > -1 ||
- keywords.indexOf(the_word.split(tokens)[0]) > -1)
- return "keyword"
- if (keywords.indexOf(prev_word) > -1) return "def"
- }
- if (ch == '"' && !state.doubleString) {
- state.string = true
- state.doubleString = true
- return "string"
- }
- if (ch == "'" && !state.singleString) {
- state.string = true
- state.singleString = true
- return "string"
- }
- if (ch == "(" && state.inner)
- state.num_left++
- if (ch == ")" && state.inner) {
- state.num_right++
- if (state.num_left == state.num_right) {
- state.inner = false
- state.string = true
- }
- return null
- }
- if (stream.match(/^-?[0-9\.]/, false)) {
- if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i) ||
- stream.match(/^-?\d+\.\d*/) ||
- stream.match(/^-?\.\d+/)) {
- if (stream.peek() == ".") stream.backUp(1)
- return "number"
- }
- if (stream.match(/^-?0x[0-9a-f]+/i) ||
- stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/) ||
- stream.match(/^-?0(?![\dx])/i))
- return "number"
- }
- if (stream.match(regexPrefixes)) {
- if (stream.current()!="/" || stream.match(/^.*\//,false)) return "string"
- else stream.backUp(1)
- }
- if (stream.match(delimiters)) return "punctuation"
- if (stream.match(identifiers)) return "variable"
- if (stream.match(properties)) return "property"
- return "variable"
+ CodeMirror.defineMode("swift", function() {
+ return {
+ startState: function() {
+ return {
+ prev: null,
+ tokenize: []
}
- }
+ },
+ token: function(stream, state) {
+ var prev = state.prev
+ state.prev = null
+ var tokenize = state.tokenize[state.tokenize.length - 1] || tokenBase
+ var style = tokenize(stream, state, prev)
+ if (!style || style == "comment") state.prev = prev
+ else if (!state.prev) state.prev = style
+ return style
+ },
+ lineComment: "//",
+ blockCommentStart: "/*",
+ blockCommentEnd: "*/"
}
})
diff --git a/public/vendor/codemirror/mode/tcl/index.html b/public/vendor/codemirror/mode/tcl/index.html
index ce4ad342..ce4ad342 100755..100644
--- a/public/vendor/codemirror/mode/tcl/index.html
+++ b/public/vendor/codemirror/mode/tcl/index.html
diff --git a/public/vendor/codemirror/mode/tcl/tcl.js b/public/vendor/codemirror/mode/tcl/tcl.js
index 056accb2..056accb2 100755..100644
--- a/public/vendor/codemirror/mode/tcl/tcl.js
+++ b/public/vendor/codemirror/mode/tcl/tcl.js
diff --git a/public/vendor/codemirror/mode/textile/index.html b/public/vendor/codemirror/mode/textile/index.html
index 42b156b1..42b156b1 100755..100644
--- a/public/vendor/codemirror/mode/textile/index.html
+++ b/public/vendor/codemirror/mode/textile/index.html
diff --git a/public/vendor/codemirror/mode/textile/test.js b/public/vendor/codemirror/mode/textile/test.js
index 49cdaf9c..49cdaf9c 100755..100644
--- a/public/vendor/codemirror/mode/textile/test.js
+++ b/public/vendor/codemirror/mode/textile/test.js
diff --git a/public/vendor/codemirror/mode/textile/textile.js b/public/vendor/codemirror/mode/textile/textile.js
index a6f75765..a6f75765 100755..100644
--- a/public/vendor/codemirror/mode/textile/textile.js
+++ b/public/vendor/codemirror/mode/textile/textile.js
diff --git a/public/vendor/codemirror/mode/tiddlywiki/index.html b/public/vendor/codemirror/mode/tiddlywiki/index.html
index 77dd0457..77dd0457 100755..100644
--- a/public/vendor/codemirror/mode/tiddlywiki/index.html
+++ b/public/vendor/codemirror/mode/tiddlywiki/index.html
diff --git a/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.css b/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.css
index 9a69b639..9a69b639 100755..100644
--- a/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.css
+++ b/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.css
diff --git a/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js b/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js
index 1df01647..1df01647 100755..100644
--- a/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js
+++ b/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js
diff --git a/public/vendor/codemirror/mode/tiki/index.html b/public/vendor/codemirror/mode/tiki/index.html
index 091c5fb2..091c5fb2 100755..100644
--- a/public/vendor/codemirror/mode/tiki/index.html
+++ b/public/vendor/codemirror/mode/tiki/index.html
diff --git a/public/vendor/codemirror/mode/tiki/tiki.css b/public/vendor/codemirror/mode/tiki/tiki.css
index 0dbc3ea0..1d8704c7 100755..100644
--- a/public/vendor/codemirror/mode/tiki/tiki.css
+++ b/public/vendor/codemirror/mode/tiki/tiki.css
@@ -15,7 +15,7 @@
}
.cm-tw-box {
- border-top-width: 0px ! important;
+ border-top-width: 0px !important;
border-style: solid;
border-width: 1px;
border-color: inherit;
diff --git a/public/vendor/codemirror/mode/tiki/tiki.js b/public/vendor/codemirror/mode/tiki/tiki.js
index 5e05b1ff..5e05b1ff 100755..100644
--- a/public/vendor/codemirror/mode/tiki/tiki.js
+++ b/public/vendor/codemirror/mode/tiki/tiki.js
diff --git a/public/vendor/codemirror/mode/toml/index.html b/public/vendor/codemirror/mode/toml/index.html
index 90a2a021..90a2a021 100755..100644
--- a/public/vendor/codemirror/mode/toml/index.html
+++ b/public/vendor/codemirror/mode/toml/index.html
diff --git a/public/vendor/codemirror/mode/toml/toml.js b/public/vendor/codemirror/mode/toml/toml.js
index baeca155..baeca155 100755..100644
--- a/public/vendor/codemirror/mode/toml/toml.js
+++ b/public/vendor/codemirror/mode/toml/toml.js
diff --git a/public/vendor/codemirror/mode/tornado/index.html b/public/vendor/codemirror/mode/tornado/index.html
index 8ee7ef56..8ee7ef56 100755..100644
--- a/public/vendor/codemirror/mode/tornado/index.html
+++ b/public/vendor/codemirror/mode/tornado/index.html
diff --git a/public/vendor/codemirror/mode/tornado/tornado.js b/public/vendor/codemirror/mode/tornado/tornado.js
index dbfbc348..dbfbc348 100755..100644
--- a/public/vendor/codemirror/mode/tornado/tornado.js
+++ b/public/vendor/codemirror/mode/tornado/tornado.js
diff --git a/public/vendor/codemirror/mode/troff/index.html b/public/vendor/codemirror/mode/troff/index.html
index 7c5a54e5..7c5a54e5 100755..100644
--- a/public/vendor/codemirror/mode/troff/index.html
+++ b/public/vendor/codemirror/mode/troff/index.html
diff --git a/public/vendor/codemirror/mode/troff/troff.js b/public/vendor/codemirror/mode/troff/troff.js
index beca778e..beca778e 100755..100644
--- a/public/vendor/codemirror/mode/troff/troff.js
+++ b/public/vendor/codemirror/mode/troff/troff.js
diff --git a/public/vendor/codemirror/mode/ttcn-cfg/index.html b/public/vendor/codemirror/mode/ttcn-cfg/index.html
index 4a4cd457..4a4cd457 100755..100644
--- a/public/vendor/codemirror/mode/ttcn-cfg/index.html
+++ b/public/vendor/codemirror/mode/ttcn-cfg/index.html
diff --git a/public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js b/public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js
index e1080511..e1080511 100755..100644
--- a/public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js
+++ b/public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js
diff --git a/public/vendor/codemirror/mode/ttcn/index.html b/public/vendor/codemirror/mode/ttcn/index.html
index f1ef8113..f1ef8113 100755..100644
--- a/public/vendor/codemirror/mode/ttcn/index.html
+++ b/public/vendor/codemirror/mode/ttcn/index.html
diff --git a/public/vendor/codemirror/mode/ttcn/ttcn.js b/public/vendor/codemirror/mode/ttcn/ttcn.js
index 30518517..30518517 100755..100644
--- a/public/vendor/codemirror/mode/ttcn/ttcn.js
+++ b/public/vendor/codemirror/mode/ttcn/ttcn.js
diff --git a/public/vendor/codemirror/mode/turtle/index.html b/public/vendor/codemirror/mode/turtle/index.html
index a4962b61..a4962b61 100755..100644
--- a/public/vendor/codemirror/mode/turtle/index.html
+++ b/public/vendor/codemirror/mode/turtle/index.html
diff --git a/public/vendor/codemirror/mode/turtle/turtle.js b/public/vendor/codemirror/mode/turtle/turtle.js
index 0988f0a4..0988f0a4 100755..100644
--- a/public/vendor/codemirror/mode/turtle/turtle.js
+++ b/public/vendor/codemirror/mode/turtle/turtle.js
diff --git a/public/vendor/codemirror/mode/twig/index.html b/public/vendor/codemirror/mode/twig/index.html
index 02493a5c..02493a5c 100755..100644
--- a/public/vendor/codemirror/mode/twig/index.html
+++ b/public/vendor/codemirror/mode/twig/index.html
diff --git a/public/vendor/codemirror/mode/twig/twig.js b/public/vendor/codemirror/mode/twig/twig.js
index aa676dc4..aa676dc4 100755..100644
--- a/public/vendor/codemirror/mode/twig/twig.js
+++ b/public/vendor/codemirror/mode/twig/twig.js
diff --git a/public/vendor/codemirror/mode/vb/index.html b/public/vendor/codemirror/mode/vb/index.html
index adcc44fd..adcc44fd 100755..100644
--- a/public/vendor/codemirror/mode/vb/index.html
+++ b/public/vendor/codemirror/mode/vb/index.html
diff --git a/public/vendor/codemirror/mode/vb/vb.js b/public/vendor/codemirror/mode/vb/vb.js
index d78f91f7..d78f91f7 100755..100644
--- a/public/vendor/codemirror/mode/vb/vb.js
+++ b/public/vendor/codemirror/mode/vb/vb.js
diff --git a/public/vendor/codemirror/mode/vbscript/index.html b/public/vendor/codemirror/mode/vbscript/index.html
index ad7532d7..ad7532d7 100755..100644
--- a/public/vendor/codemirror/mode/vbscript/index.html
+++ b/public/vendor/codemirror/mode/vbscript/index.html
diff --git a/public/vendor/codemirror/mode/vbscript/vbscript.js b/public/vendor/codemirror/mode/vbscript/vbscript.js
index b66df223..b66df223 100755..100644
--- a/public/vendor/codemirror/mode/vbscript/vbscript.js
+++ b/public/vendor/codemirror/mode/vbscript/vbscript.js
diff --git a/public/vendor/codemirror/mode/velocity/index.html b/public/vendor/codemirror/mode/velocity/index.html
index 27478786..27478786 100755..100644
--- a/public/vendor/codemirror/mode/velocity/index.html
+++ b/public/vendor/codemirror/mode/velocity/index.html
diff --git a/public/vendor/codemirror/mode/velocity/velocity.js b/public/vendor/codemirror/mode/velocity/velocity.js
index 8fc4f95d..8fc4f95d 100755..100644
--- a/public/vendor/codemirror/mode/velocity/velocity.js
+++ b/public/vendor/codemirror/mode/velocity/velocity.js
diff --git a/public/vendor/codemirror/mode/verilog/index.html b/public/vendor/codemirror/mode/verilog/index.html
index 96b3d647..96b3d647 100755..100644
--- a/public/vendor/codemirror/mode/verilog/index.html
+++ b/public/vendor/codemirror/mode/verilog/index.html
diff --git a/public/vendor/codemirror/mode/verilog/test.js b/public/vendor/codemirror/mode/verilog/test.js
index 9c8c0949..9c8c0949 100755..100644
--- a/public/vendor/codemirror/mode/verilog/test.js
+++ b/public/vendor/codemirror/mode/verilog/test.js
diff --git a/public/vendor/codemirror/mode/verilog/verilog.js b/public/vendor/codemirror/mode/verilog/verilog.js
index 9d2a4cd5..9d2a4cd5 100755..100644
--- a/public/vendor/codemirror/mode/verilog/verilog.js
+++ b/public/vendor/codemirror/mode/verilog/verilog.js
diff --git a/public/vendor/codemirror/mode/vhdl/index.html b/public/vendor/codemirror/mode/vhdl/index.html
new file mode 100644
index 00000000..3051bc37
--- /dev/null
+++ b/public/vendor/codemirror/mode/vhdl/index.html
@@ -0,0 +1,95 @@
+<!doctype html>
+
+<title>CodeMirror: VHDL mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/edit/matchbrackets.js"></script>
+<script src="vhdl.js"></script>
+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">VHDL</a>
+ </ul>
+</div>
+
+<article>
+<h2>VHDL mode</h2>
+
+<div><textarea id="code" name="code">
+LIBRARY ieee;
+USE ieee.std_logic_1164.ALL;
+USE ieee.numeric_std.ALL;
+
+ENTITY tb IS
+END tb;
+
+ARCHITECTURE behavior OF tb IS
+ --Inputs
+ signal a : unsigned(2 downto 0) := (others => '0');
+ signal b : unsigned(2 downto 0) := (others => '0');
+ --Outputs
+ signal a_eq_b : std_logic;
+ signal a_le_b : std_logic;
+ signal a_gt_b : std_logic;
+
+ signal i,j : integer;
+
+BEGIN
+
+ -- Instantiate the Unit Under Test (UUT)
+ uut: entity work.comparator PORT MAP (
+ a => a,
+ b => b,
+ a_eq_b => a_eq_b,
+ a_le_b => a_le_b,
+ a_gt_b => a_gt_b
+ );
+
+ -- Stimulus process
+ stim_proc: process
+ begin
+ for i in 0 to 8 loop
+ for j in 0 to 8 loop
+ a <= to_unsigned(i,3); --integer to unsigned type conversion
+ b <= to_unsigned(j,3);
+ wait for 10 ns;
+ end loop;
+ end loop;
+ end process;
+
+END;
+</textarea></div>
+
+<script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ matchBrackets: true,
+ mode: {
+ name: "vhdl",
+ }
+ });
+</script>
+
+<p>
+Syntax highlighting and indentation for the VHDL language.
+<h2>Configuration options:</h2>
+ <ul>
+ <li><strong>atoms</strong> - List of atom words. Default: "null"</li>
+ <li><strong>hooks</strong> - List of meta hooks. Default: ["`", "$"]</li>
+ <li><strong>multiLineStrings</strong> - Whether multi-line strings are accepted. Default: false</li>
+ </ul>
+</p>
+
+<p><strong>MIME types defined:</strong> <code>text/x-vhdl</code>.</p>
+</article>
diff --git a/public/vendor/codemirror/mode/vhdl/vhdl.js b/public/vendor/codemirror/mode/vhdl/vhdl.js
new file mode 100644
index 00000000..d3b555aa
--- /dev/null
+++ b/public/vendor/codemirror/mode/vhdl/vhdl.js
@@ -0,0 +1,189 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+// Originally written by Alf Nielsen, re-written by Michael Zhou
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+"use strict";
+
+function words(str) {
+ var obj = {}, words = str.split(",");
+ for (var i = 0; i < words.length; ++i) {
+ var allCaps = words[i].toUpperCase();
+ var firstCap = words[i].charAt(0).toUpperCase() + words[i].slice(1);
+ obj[words[i]] = true;
+ obj[allCaps] = true;
+ obj[firstCap] = true;
+ }
+ return obj;
+}
+
+function metaHook(stream) {
+ stream.eatWhile(/[\w\$_]/);
+ return "meta";
+}
+
+CodeMirror.defineMode("vhdl", function(config, parserConfig) {
+ var indentUnit = config.indentUnit,
+ atoms = parserConfig.atoms || words("null"),
+ hooks = parserConfig.hooks || {"`": metaHook, "$": metaHook},
+ multiLineStrings = parserConfig.multiLineStrings;
+
+ var keywords = words("abs,access,after,alias,all,and,architecture,array,assert,attribute,begin,block," +
+ "body,buffer,bus,case,component,configuration,constant,disconnent,downto,else,elsif,end,end block,end case," +
+ "end component,end for,end generate,end if,end loop,end process,end record,end units,entity,exit,file,for," +
+ "function,generate,generic,generic map,group,guarded,if,impure,in,inertial,inout,is,label,library,linkage," +
+ "literal,loop,map,mod,nand,new,next,nor,null,of,on,open,or,others,out,package,package body,port,port map," +
+ "postponed,procedure,process,pure,range,record,register,reject,rem,report,return,rol,ror,select,severity,signal," +
+ "sla,sll,sra,srl,subtype,then,to,transport,type,unaffected,units,until,use,variable,wait,when,while,with,xnor,xor");
+
+ var blockKeywords = words("architecture,entity,begin,case,port,else,elsif,end,for,function,if");
+
+ var isOperatorChar = /[&|~><!\)\(*#%@+\/=?\:;}{,\.\^\-\[\]]/;
+ var curPunc;
+
+ function tokenBase(stream, state) {
+ var ch = stream.next();
+ if (hooks[ch]) {
+ var result = hooks[ch](stream, state);
+ if (result !== false) return result;
+ }
+ if (ch == '"') {
+ state.tokenize = tokenString2(ch);
+ return state.tokenize(stream, state);
+ }
+ if (ch == "'") {
+ state.tokenize = tokenString(ch);
+ return state.tokenize(stream, state);
+ }
+ if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
+ curPunc = ch;
+ return null;
+ }
+ if (/[\d']/.test(ch)) {
+ stream.eatWhile(/[\w\.']/);
+ return "number";
+ }
+ if (ch == "-") {
+ if (stream.eat("-")) {
+ stream.skipToEnd();
+ return "comment";
+ }
+ }
+ if (isOperatorChar.test(ch)) {
+ stream.eatWhile(isOperatorChar);
+ return "operator";
+ }
+ stream.eatWhile(/[\w\$_]/);
+ var cur = stream.current();
+ if (keywords.propertyIsEnumerable(cur.toLowerCase())) {
+ if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
+ return "keyword";
+ }
+ if (atoms.propertyIsEnumerable(cur)) return "atom";
+ return "variable";
+ }
+
+ function tokenString(quote) {
+ return function(stream, state) {
+ var escaped = false, next, end = false;
+ while ((next = stream.next()) != null) {
+ if (next == quote && !escaped) {end = true; break;}
+ escaped = !escaped && next == "--";
+ }
+ if (end || !(escaped || multiLineStrings))
+ state.tokenize = tokenBase;
+ return "string";
+ };
+ }
+ function tokenString2(quote) {
+ return function(stream, state) {
+ var escaped = false, next, end = false;
+ while ((next = stream.next()) != null) {
+ if (next == quote && !escaped) {end = true; break;}
+ escaped = !escaped && next == "--";
+ }
+ if (end || !(escaped || multiLineStrings))
+ state.tokenize = tokenBase;
+ return "string-2";
+ };
+ }
+
+ function Context(indented, column, type, align, prev) {
+ this.indented = indented;
+ this.column = column;
+ this.type = type;
+ this.align = align;
+ this.prev = prev;
+ }
+ function pushContext(state, col, type) {
+ return state.context = new Context(state.indented, col, type, null, state.context);
+ }
+ function popContext(state) {
+ var t = state.context.type;
+ if (t == ")" || t == "]" || t == "}")
+ state.indented = state.context.indented;
+ return state.context = state.context.prev;
+ }
+
+ // Interface
+ return {
+ startState: function(basecolumn) {
+ return {
+ tokenize: null,
+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
+ indented: 0,
+ startOfLine: true
+ };
+ },
+
+ token: function(stream, state) {
+ var ctx = state.context;
+ if (stream.sol()) {
+ if (ctx.align == null) ctx.align = false;
+ state.indented = stream.indentation();
+ state.startOfLine = true;
+ }
+ if (stream.eatSpace()) return null;
+ curPunc = null;
+ var style = (state.tokenize || tokenBase)(stream, state);
+ if (style == "comment" || style == "meta") return style;
+ if (ctx.align == null) ctx.align = true;
+
+ if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state);
+ else if (curPunc == "{") pushContext(state, stream.column(), "}");
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
+ else if (curPunc == "}") {
+ while (ctx.type == "statement") ctx = popContext(state);
+ if (ctx.type == "}") ctx = popContext(state);
+ while (ctx.type == "statement") ctx = popContext(state);
+ }
+ else if (curPunc == ctx.type) popContext(state);
+ else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement"))
+ pushContext(state, stream.column(), "statement");
+ state.startOfLine = false;
+ return style;
+ },
+
+ indent: function(state, textAfter) {
+ if (state.tokenize != tokenBase && state.tokenize != null) return 0;
+ var firstChar = textAfter && textAfter.charAt(0), ctx = state.context, closing = firstChar == ctx.type;
+ if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit);
+ else if (ctx.align) return ctx.column + (closing ? 0 : 1);
+ else return ctx.indented + (closing ? 0 : indentUnit);
+ },
+
+ electricChars: "{}"
+ };
+});
+
+CodeMirror.defineMIME("text/x-vhdl", "vhdl");
+
+});
diff --git a/public/vendor/codemirror/mode/vue/index.html b/public/vendor/codemirror/mode/vue/index.html
new file mode 100644
index 00000000..cccb9764
--- /dev/null
+++ b/public/vendor/codemirror/mode/vue/index.html
@@ -0,0 +1,69 @@
+<!doctype html>
+
+<title>CodeMirror: Vue.js mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/mode/overlay.js"></script>
+<script src="../../addon/mode/simple.js"></script>
+<script src="../../addon/selection/selection-pointer.js"></script>
+<script src="../xml/xml.js"></script>
+<script src="../javascript/javascript.js"></script>
+<script src="../css/css.js"></script>
+<script src="../coffeescript/coffeescript.js"></script>
+<script src="../sass/sass.js"></script>
+<script src="../jade/jade.js"></script>
+
+<script src="../handlebars/handlebars.js"></script>
+<script src="../htmlmixed/htmlmixed.js"></script>
+<script src="vue.js"></script>
+<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">Vue.js mode</a>
+ </ul>
+</div>
+
+<article>
+<h2>Vue.js mode</h2>
+<form><textarea id="code" name="code">
+<template>
+ <div class="sass">Im am a {{mustache-like}} template</div>
+</template>
+
+<script lang="coffee">
+ module.exports =
+ props: ['one', 'two', 'three']
+</script>
+
+<style lang="sass">
+.sass
+ font-size: 18px
+</style>
+
+</textarea></form>
+ <script>
+ // Define an extended mixed-mode that understands vbscript and
+ // leaves mustache/handlebars embedded templates in html mode
+ var mixedMode = {
+ name: "vue"
+ };
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ mode: mixedMode,
+ selectionPointer: true
+ });
+ </script>
+
+ <p><strong>MIME types defined:</strong> <code>text/x-vue</code></p>
+
+ </article>
diff --git a/public/vendor/codemirror/mode/vue/vue.js b/public/vendor/codemirror/mode/vue/vue.js
new file mode 100644
index 00000000..d89a5523
--- /dev/null
+++ b/public/vendor/codemirror/mode/vue/vue.js
@@ -0,0 +1,69 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function (mod) {
+ "use strict";
+ if (typeof exports === "object" && typeof module === "object") {// CommonJS
+ mod(require("../../lib/codemirror"),
+ require("../../addon/mode/overlay"),
+ require("../xml/xml"),
+ require("../javascript/javascript"),
+ require("../coffeescript/coffeescript"),
+ require("../css/css"),
+ require("../sass/sass"),
+ require("../stylus/stylus"),
+ require("../jade/jade"),
+ require("../handlebars/handlebars"));
+ } else if (typeof define === "function" && define.amd) { // AMD
+ define(["../../lib/codemirror",
+ "../../addon/mode/overlay",
+ "../xml/xml",
+ "../javascript/javascript",
+ "../coffeescript/coffeescript",
+ "../css/css",
+ "../sass/sass",
+ "../stylus/stylus",
+ "../jade/jade",
+ "../handlebars/handlebars"], mod);
+ } else { // Plain browser env
+ mod(CodeMirror);
+ }
+})(function (CodeMirror) {
+ var tagLanguages = {
+ script: [
+ ["lang", /coffee(script)?/, "coffeescript"],
+ ["type", /^(?:text|application)\/(?:x-)?coffee(?:script)?$/, "coffeescript"]
+ ],
+ style: [
+ ["lang", /^stylus$/i, "stylus"],
+ ["lang", /^sass$/i, "sass"],
+ ["type", /^(text\/)?(x-)?styl(us)?$/i, "stylus"],
+ ["type", /^text\/sass/i, "sass"]
+ ],
+ template: [
+ ["lang", /^vue-template$/i, "vue"],
+ ["lang", /^jade$/i, "jade"],
+ ["lang", /^handlebars$/i, "handlebars"],
+ ["type", /^(text\/)?(x-)?jade$/i, "jade"],
+ ["type", /^text\/x-handlebars-template$/i, "handlebars"],
+ [null, null, "vue-template"]
+ ]
+ };
+
+ CodeMirror.defineMode("vue-template", function (config, parserConfig) {
+ var mustacheOverlay = {
+ token: function (stream) {
+ if (stream.match(/^\{\{.*?\}\}/)) return "meta mustache";
+ while (stream.next() && !stream.match("{{", false)) {}
+ return null;
+ }
+ };
+ return CodeMirror.overlayMode(CodeMirror.getMode(config, parserConfig.backdrop || "text/html"), mustacheOverlay);
+ });
+
+ CodeMirror.defineMode("vue", function (config) {
+ return CodeMirror.getMode(config, {name: "htmlmixed", tags: tagLanguages});
+ }, "htmlmixed", "xml", "javascript", "coffeescript", "css", "sass", "stylus", "jade", "handlebars");
+
+ CodeMirror.defineMIME("script/x-vue", "vue");
+});
diff --git a/public/vendor/codemirror/mode/xml/index.html b/public/vendor/codemirror/mode/xml/index.html
index 7149f06b..7149f06b 100755..100644
--- a/public/vendor/codemirror/mode/xml/index.html
+++ b/public/vendor/codemirror/mode/xml/index.html
diff --git a/public/vendor/codemirror/mode/xml/test.js b/public/vendor/codemirror/mode/xml/test.js
index f48156b5..f48156b5 100755..100644
--- a/public/vendor/codemirror/mode/xml/test.js
+++ b/public/vendor/codemirror/mode/xml/test.js
diff --git a/public/vendor/codemirror/mode/xml/xml.js b/public/vendor/codemirror/mode/xml/xml.js
index 2f3b8f87..014f7d84 100755..100644
--- a/public/vendor/codemirror/mode/xml/xml.js
+++ b/public/vendor/codemirror/mode/xml/xml.js
@@ -11,54 +11,56 @@
})(function(CodeMirror) {
"use strict";
-CodeMirror.defineMode("xml", function(config, parserConfig) {
- var indentUnit = config.indentUnit;
- var multilineTagIndentFactor = parserConfig.multilineTagIndentFactor || 1;
- var multilineTagIndentPastTag = parserConfig.multilineTagIndentPastTag;
- if (multilineTagIndentPastTag == null) multilineTagIndentPastTag = true;
+var htmlConfig = {
+ autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
+ 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
+ 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
+ 'track': true, 'wbr': true, 'menuitem': true},
+ implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
+ 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
+ 'th': true, 'tr': true},
+ contextGrabbers: {
+ 'dd': {'dd': true, 'dt': true},
+ 'dt': {'dd': true, 'dt': true},
+ 'li': {'li': true},
+ 'option': {'option': true, 'optgroup': true},
+ 'optgroup': {'optgroup': true},
+ 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
+ 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
+ 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
+ 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
+ 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
+ 'rp': {'rp': true, 'rt': true},
+ 'rt': {'rp': true, 'rt': true},
+ 'tbody': {'tbody': true, 'tfoot': true},
+ 'td': {'td': true, 'th': true},
+ 'tfoot': {'tbody': true},
+ 'th': {'td': true, 'th': true},
+ 'thead': {'tbody': true, 'tfoot': true},
+ 'tr': {'tr': true}
+ },
+ doNotIndent: {"pre": true},
+ allowUnquoted: true,
+ allowMissing: true,
+ caseFold: true
+}
- var Kludges = parserConfig.htmlMode ? {
- autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
- 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
- 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
- 'track': true, 'wbr': true, 'menuitem': true},
- implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
- 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
- 'th': true, 'tr': true},
- contextGrabbers: {
- 'dd': {'dd': true, 'dt': true},
- 'dt': {'dd': true, 'dt': true},
- 'li': {'li': true},
- 'option': {'option': true, 'optgroup': true},
- 'optgroup': {'optgroup': true},
- 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
- 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
- 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
- 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
- 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
- 'rp': {'rp': true, 'rt': true},
- 'rt': {'rp': true, 'rt': true},
- 'tbody': {'tbody': true, 'tfoot': true},
- 'td': {'td': true, 'th': true},
- 'tfoot': {'tbody': true},
- 'th': {'td': true, 'th': true},
- 'thead': {'tbody': true, 'tfoot': true},
- 'tr': {'tr': true}
- },
- doNotIndent: {"pre": true},
- allowUnquoted: true,
- allowMissing: true,
- caseFold: true
- } : {
- autoSelfClosers: {},
- implicitlyClosed: {},
- contextGrabbers: {},
- doNotIndent: {},
- allowUnquoted: false,
- allowMissing: false,
- caseFold: false
- };
- var alignCDATA = parserConfig.alignCDATA;
+var xmlConfig = {
+ autoSelfClosers: {},
+ implicitlyClosed: {},
+ contextGrabbers: {},
+ doNotIndent: {},
+ allowUnquoted: false,
+ allowMissing: false,
+ caseFold: false
+}
+
+CodeMirror.defineMode("xml", function(editorConf, config_) {
+ var indentUnit = editorConf.indentUnit
+ var config = {}
+ var defaults = config_.htmlMode ? htmlConfig : xmlConfig
+ for (var prop in defaults) config[prop] = defaults[prop]
+ for (var prop in config_) config[prop] = config_[prop]
// Return variables for tokenizers
var type, setStyle;
@@ -109,6 +111,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
return null;
}
}
+ inText.isInText = true;
function inTag(stream, state) {
var ch = stream.next();
@@ -187,7 +190,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
this.tagName = tagName;
this.indent = state.indented;
this.startOfLine = startOfLine;
- if (Kludges.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
+ if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
this.noIndent = true;
}
function popContext(state) {
@@ -200,8 +203,8 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
return;
}
parentTagName = state.context.tagName;
- if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||
- !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
+ if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
+ !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
return;
}
popContext(state);
@@ -232,7 +235,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
if (type == "word") {
var tagName = stream.current();
if (state.context && state.context.tagName != tagName &&
- Kludges.implicitlyClosed.hasOwnProperty(state.context.tagName))
+ config.implicitlyClosed.hasOwnProperty(state.context.tagName))
popContext(state);
if (state.context && state.context.tagName == tagName) {
setStyle = "tag";
@@ -268,7 +271,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
var tagName = state.tagName, tagStart = state.tagStart;
state.tagName = state.tagStart = null;
if (type == "selfcloseTag" ||
- Kludges.autoSelfClosers.hasOwnProperty(tagName)) {
+ config.autoSelfClosers.hasOwnProperty(tagName)) {
maybePopContext(state, tagName);
} else {
maybePopContext(state, tagName);
@@ -281,12 +284,12 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
}
function attrEqState(type, stream, state) {
if (type == "equals") return attrValueState;
- if (!Kludges.allowMissing) setStyle = "error";
+ if (!config.allowMissing) setStyle = "error";
return attrState(type, stream, state);
}
function attrValueState(type, stream, state) {
if (type == "string") return attrContinuedState;
- if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return attrState;}
+ if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;}
setStyle = "error";
return attrState(type, stream, state);
}
@@ -296,12 +299,14 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
}
return {
- startState: function() {
- return {tokenize: inText,
- state: baseState,
- indented: 0,
- tagName: null, tagStart: null,
- context: null};
+ startState: function(baseIndent) {
+ var state = {tokenize: inText,
+ state: baseState,
+ indented: baseIndent || 0,
+ tagName: null, tagStart: null,
+ context: null}
+ if (baseIndent != null) state.baseIndent = baseIndent
+ return state
},
token: function(stream, state) {
@@ -334,19 +339,19 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
// Indent the starts of attribute names.
if (state.tagName) {
- if (multilineTagIndentPastTag)
+ if (config.multilineTagIndentPastTag !== false)
return state.tagStart + state.tagName.length + 2;
else
- return state.tagStart + indentUnit * multilineTagIndentFactor;
+ return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);
}
- if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
+ if (config.alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
if (tagAfter && tagAfter[1]) { // Closing tag spotted
while (context) {
if (context.tagName == tagAfter[2]) {
context = context.prev;
break;
- } else if (Kludges.implicitlyClosed.hasOwnProperty(context.tagName)) {
+ } else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
context = context.prev;
} else {
break;
@@ -354,25 +359,30 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
}
} else if (tagAfter) { // Opening tag spotted
while (context) {
- var grabbers = Kludges.contextGrabbers[context.tagName];
+ var grabbers = config.contextGrabbers[context.tagName];
if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
context = context.prev;
else
break;
}
}
- while (context && !context.startOfLine)
+ while (context && context.prev && !context.startOfLine)
context = context.prev;
if (context) return context.indent + indentUnit;
- else return 0;
+ else return state.baseIndent || 0;
},
electricInput: /<\/[\s\w:]+>$/,
blockCommentStart: "<!--",
blockCommentEnd: "-->",
- configuration: parserConfig.htmlMode ? "html" : "xml",
- helperType: parserConfig.htmlMode ? "html" : "xml"
+ configuration: config.htmlMode ? "html" : "xml",
+ helperType: config.htmlMode ? "html" : "xml",
+
+ skipAttribute: function(state) {
+ if (state.state == attrValueState)
+ state.state = attrState
+ }
};
});
diff --git a/public/vendor/codemirror/mode/xquery/index.html b/public/vendor/codemirror/mode/xquery/index.html
index 7ac5aaef..7ac5aaef 100755..100644
--- a/public/vendor/codemirror/mode/xquery/index.html
+++ b/public/vendor/codemirror/mode/xquery/index.html
diff --git a/public/vendor/codemirror/mode/xquery/test.js b/public/vendor/codemirror/mode/xquery/test.js
index 1f148cdb..1f148cdb 100755..100644
--- a/public/vendor/codemirror/mode/xquery/test.js
+++ b/public/vendor/codemirror/mode/xquery/test.js
diff --git a/public/vendor/codemirror/mode/xquery/xquery.js b/public/vendor/codemirror/mode/xquery/xquery.js
index c642ee58..c642ee58 100755..100644
--- a/public/vendor/codemirror/mode/xquery/xquery.js
+++ b/public/vendor/codemirror/mode/xquery/xquery.js
diff --git a/public/vendor/codemirror/mode/yaml-frontmatter/index.html b/public/vendor/codemirror/mode/yaml-frontmatter/index.html
new file mode 100644
index 00000000..30bed2f8
--- /dev/null
+++ b/public/vendor/codemirror/mode/yaml-frontmatter/index.html
@@ -0,0 +1,121 @@
+<!doctype html>
+
+<title>CodeMirror: YAML front matter mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/mode/overlay.js"></script>
+<script src="../markdown/markdown.js"></script>
+<script src="../gfm/gfm.js"></script>
+<script src="../yaml/yaml.js"></script>
+<script src="yaml-frontmatter.js"></script>
+<style>.CodeMirror { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">YAML-Frontmatter</a>
+ </ul>
+</div>
+
+<article>
+<h2>YAML front matter mode</h2>
+<form><textarea id="code" name="code">
+---
+receipt: Oz-Ware Purchase Invoice
+date: 2007-08-06
+customer:
+ given: Dorothy
+ family: Gale
+
+items:
+ - part_no: A4786
+ descrip: Water Bucket (Filled)
+ price: 1.47
+ quantity: 4
+
+ - part_no: E1628
+ descrip: High Heeled "Ruby" Slippers
+ size: 8
+ price: 100.27
+ quantity: 1
+
+bill-to: &id001
+ street: |
+ 123 Tornado Alley
+ Suite 16
+ city: East Centerville
+ state: KS
+
+ship-to: *id001
+
+specialDelivery: >
+ Follow the Yellow Brick
+ Road to the Emerald City.
+ Pay no attention to the
+ man behind the curtain.
+---
+
+GitHub Flavored Markdown
+========================
+
+Everything from markdown plus GFM features:
+
+## URL autolinking
+
+Underscores_are_allowed_between_words.
+
+## Strikethrough text
+
+GFM adds syntax to strikethrough text, which is missing from standard Markdown.
+
+~~Mistaken text.~~
+~~**works with other fomatting**~~
+
+~~spans across
+lines~~
+
+## Fenced code blocks (and syntax highlighting)
+
+```javascript
+for (var i = 0; i &lt; items.length; i++) {
+ console.log(items[i], i); // log them
+}
+```
+
+## Task Lists
+
+- [ ] Incomplete task list item
+- [x] **Completed** task list item
+
+## A bit of GitHub spice
+
+* SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
+* User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
+* User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
+* \#Num: #1
+* User/#Num: mojombo#1
+* User/Project#Num: mojombo/god#1
+
+See http://github.github.com/github-flavored-markdown/.
+</textarea></form>
+
+<p>Defines a mode that parses
+a <a href="http://jekyllrb.com/docs/frontmatter/">YAML frontmatter</a>
+at the start of a file, switching to a base mode at the end of that.
+Takes a mode configuration option <code>base</code> to configure the
+base mode, which defaults to <code>"gfm"</code>.</p>
+
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: "yaml-frontmatter"});
+ </script>
+
+ </article>
diff --git a/public/vendor/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js b/public/vendor/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js
new file mode 100644
index 00000000..9f081b00
--- /dev/null
+++ b/public/vendor/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js
@@ -0,0 +1,68 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function (mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"), require("../yaml/yaml"))
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror", "../yaml/yaml"], mod)
+ else // Plain browser env
+ mod(CodeMirror)
+})(function (CodeMirror) {
+
+ var START = 0, FRONTMATTER = 1, BODY = 2
+
+ // a mixed mode for Markdown text with an optional YAML front matter
+ CodeMirror.defineMode("yaml-frontmatter", function (config, parserConfig) {
+ var yamlMode = CodeMirror.getMode(config, "yaml")
+ var innerMode = CodeMirror.getMode(config, parserConfig && parserConfig.base || "gfm")
+
+ function curMode(state) {
+ return state.state == BODY ? innerMode : yamlMode
+ }
+
+ return {
+ startState: function () {
+ return {
+ state: START,
+ inner: CodeMirror.startState(yamlMode)
+ }
+ },
+ copyState: function (state) {
+ return {
+ state: state.state,
+ inner: CodeMirror.copyState(curMode(state), state.inner)
+ }
+ },
+ token: function (stream, state) {
+ if (state.state == START) {
+ if (stream.match(/---/, false)) {
+ state.state = FRONTMATTER
+ return yamlMode.token(stream, state.inner)
+ } else {
+ state.state = BODY
+ state.inner = CodeMirror.startState(innerMode)
+ return innerMode.token(stream, state.inner)
+ }
+ } else if (state.state == FRONTMATTER) {
+ var end = stream.sol() && stream.match(/---/, false)
+ var style = yamlMode.token(stream, state.inner)
+ if (end) {
+ state.state = BODY
+ state.inner = CodeMirror.startState(innerMode)
+ }
+ return style
+ } else {
+ return innerMode.token(stream, state.inner)
+ }
+ },
+ innerMode: function (state) {
+ return {mode: curMode(state), state: state.inner}
+ },
+ blankLine: function (state) {
+ var mode = curMode(state)
+ if (mode.blankLine) return mode.blankLine(state.inner)
+ }
+ }
+ })
+})
diff --git a/public/vendor/codemirror/mode/yaml/index.html b/public/vendor/codemirror/mode/yaml/index.html
index be9b6323..be9b6323 100755..100644
--- a/public/vendor/codemirror/mode/yaml/index.html
+++ b/public/vendor/codemirror/mode/yaml/index.html
diff --git a/public/vendor/codemirror/mode/yaml/yaml.js b/public/vendor/codemirror/mode/yaml/yaml.js
index b7015e59..b7015e59 100755..100644
--- a/public/vendor/codemirror/mode/yaml/yaml.js
+++ b/public/vendor/codemirror/mode/yaml/yaml.js
diff --git a/public/vendor/codemirror/mode/z80/index.html b/public/vendor/codemirror/mode/z80/index.html
index a41b7473..a41b7473 100755..100644
--- a/public/vendor/codemirror/mode/z80/index.html
+++ b/public/vendor/codemirror/mode/z80/index.html
diff --git a/public/vendor/codemirror/mode/z80/z80.js b/public/vendor/codemirror/mode/z80/z80.js
index aae70216..aae70216 100755..100644
--- a/public/vendor/codemirror/mode/z80/z80.js
+++ b/public/vendor/codemirror/mode/z80/z80.js
diff --git a/public/vendor/codemirror/theme/3024-day.css b/public/vendor/codemirror/theme/3024-day.css
index 35928162..71326553 100755..100644
--- a/public/vendor/codemirror/theme/3024-day.css
+++ b/public/vendor/codemirror/theme/3024-day.css
@@ -8,33 +8,34 @@
*/
-.cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;}
-.cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;}
-.cm-s-3024-day.CodeMirror ::selection { background: #d6d5d4; }
-.cm-s-3024-day.CodeMirror ::-moz-selection { background: #d9d9d9; }
+.cm-s-3024-day.CodeMirror { background: #f7f7f7; color: #3a3432; }
+.cm-s-3024-day div.CodeMirror-selected { background: #d6d5d4; }
-.cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;}
+.cm-s-3024-day .CodeMirror-line::selection, .cm-s-3024-day .CodeMirror-line > span::selection, .cm-s-3024-day .CodeMirror-line > span > span::selection { background: #d6d5d4; }
+.cm-s-3024-day .CodeMirror-line::-moz-selection, .cm-s-3024-day .CodeMirror-line > span::-moz-selection, .cm-s-3024-day .CodeMirror-line > span > span::selection { background: #d9d9d9; }
+
+.cm-s-3024-day .CodeMirror-gutters { background: #f7f7f7; border-right: 0px; }
.cm-s-3024-day .CodeMirror-guttermarker { color: #db2d20; }
.cm-s-3024-day .CodeMirror-guttermarker-subtle { color: #807d7c; }
-.cm-s-3024-day .CodeMirror-linenumber {color: #807d7c;}
+.cm-s-3024-day .CodeMirror-linenumber { color: #807d7c; }
-.cm-s-3024-day .CodeMirror-cursor {border-left: 1px solid #5c5855 !important;}
+.cm-s-3024-day .CodeMirror-cursor { border-left: 1px solid #5c5855; }
-.cm-s-3024-day span.cm-comment {color: #cdab53;}
-.cm-s-3024-day span.cm-atom {color: #a16a94;}
-.cm-s-3024-day span.cm-number {color: #a16a94;}
+.cm-s-3024-day span.cm-comment { color: #cdab53; }
+.cm-s-3024-day span.cm-atom { color: #a16a94; }
+.cm-s-3024-day span.cm-number { color: #a16a94; }
-.cm-s-3024-day span.cm-property, .cm-s-3024-day span.cm-attribute {color: #01a252;}
-.cm-s-3024-day span.cm-keyword {color: #db2d20;}
-.cm-s-3024-day span.cm-string {color: #fded02;}
+.cm-s-3024-day span.cm-property, .cm-s-3024-day span.cm-attribute { color: #01a252; }
+.cm-s-3024-day span.cm-keyword { color: #db2d20; }
+.cm-s-3024-day span.cm-string { color: #fded02; }
-.cm-s-3024-day span.cm-variable {color: #01a252;}
-.cm-s-3024-day span.cm-variable-2 {color: #01a0e4;}
-.cm-s-3024-day span.cm-def {color: #e8bbd0;}
-.cm-s-3024-day span.cm-bracket {color: #3a3432;}
-.cm-s-3024-day span.cm-tag {color: #db2d20;}
-.cm-s-3024-day span.cm-link {color: #a16a94;}
-.cm-s-3024-day span.cm-error {background: #db2d20; color: #5c5855;}
+.cm-s-3024-day span.cm-variable { color: #01a252; }
+.cm-s-3024-day span.cm-variable-2 { color: #01a0e4; }
+.cm-s-3024-day span.cm-def { color: #e8bbd0; }
+.cm-s-3024-day span.cm-bracket { color: #3a3432; }
+.cm-s-3024-day span.cm-tag { color: #db2d20; }
+.cm-s-3024-day span.cm-link { color: #a16a94; }
+.cm-s-3024-day span.cm-error { background: #db2d20; color: #5c5855; }
-.cm-s-3024-day .CodeMirror-activeline-background {background: #e8f2ff !important;}
-.cm-s-3024-day .CodeMirror-matchingbracket { text-decoration: underline; color: #a16a94 !important;}
+.cm-s-3024-day .CodeMirror-activeline-background { background: #e8f2ff; }
+.cm-s-3024-day .CodeMirror-matchingbracket { text-decoration: underline; color: #a16a94 !important; }
diff --git a/public/vendor/codemirror/theme/3024-night.css b/public/vendor/codemirror/theme/3024-night.css
index ccab9d50..adc5900a 100755..100644
--- a/public/vendor/codemirror/theme/3024-night.css
+++ b/public/vendor/codemirror/theme/3024-night.css
@@ -8,32 +8,32 @@
*/
-.cm-s-3024-night.CodeMirror {background: #090300; color: #d6d5d4;}
-.cm-s-3024-night div.CodeMirror-selected {background: #3a3432 !important;}
-.cm-s-3024-night.CodeMirror ::selection { background: rgba(58, 52, 50, .99); }
-.cm-s-3024-night.CodeMirror ::-moz-selection { background: rgba(58, 52, 50, .99); }
-.cm-s-3024-night .CodeMirror-gutters {background: #090300; border-right: 0px;}
+.cm-s-3024-night.CodeMirror { background: #090300; color: #d6d5d4; }
+.cm-s-3024-night div.CodeMirror-selected { background: #3a3432; }
+.cm-s-3024-night .CodeMirror-line::selection, .cm-s-3024-night .CodeMirror-line > span::selection, .cm-s-3024-night .CodeMirror-line > span > span::selection { background: rgba(58, 52, 50, .99); }
+.cm-s-3024-night .CodeMirror-line::-moz-selection, .cm-s-3024-night .CodeMirror-line > span::-moz-selection, .cm-s-3024-night .CodeMirror-line > span > span::-moz-selection { background: rgba(58, 52, 50, .99); }
+.cm-s-3024-night .CodeMirror-gutters { background: #090300; border-right: 0px; }
.cm-s-3024-night .CodeMirror-guttermarker { color: #db2d20; }
.cm-s-3024-night .CodeMirror-guttermarker-subtle { color: #5c5855; }
-.cm-s-3024-night .CodeMirror-linenumber {color: #5c5855;}
+.cm-s-3024-night .CodeMirror-linenumber { color: #5c5855; }
-.cm-s-3024-night .CodeMirror-cursor {border-left: 1px solid #807d7c !important;}
+.cm-s-3024-night .CodeMirror-cursor { border-left: 1px solid #807d7c; }
-.cm-s-3024-night span.cm-comment {color: #cdab53;}
-.cm-s-3024-night span.cm-atom {color: #a16a94;}
-.cm-s-3024-night span.cm-number {color: #a16a94;}
+.cm-s-3024-night span.cm-comment { color: #cdab53; }
+.cm-s-3024-night span.cm-atom { color: #a16a94; }
+.cm-s-3024-night span.cm-number { color: #a16a94; }
-.cm-s-3024-night span.cm-property, .cm-s-3024-night span.cm-attribute {color: #01a252;}
-.cm-s-3024-night span.cm-keyword {color: #db2d20;}
-.cm-s-3024-night span.cm-string {color: #fded02;}
+.cm-s-3024-night span.cm-property, .cm-s-3024-night span.cm-attribute { color: #01a252; }
+.cm-s-3024-night span.cm-keyword { color: #db2d20; }
+.cm-s-3024-night span.cm-string { color: #fded02; }
-.cm-s-3024-night span.cm-variable {color: #01a252;}
-.cm-s-3024-night span.cm-variable-2 {color: #01a0e4;}
-.cm-s-3024-night span.cm-def {color: #e8bbd0;}
-.cm-s-3024-night span.cm-bracket {color: #d6d5d4;}
-.cm-s-3024-night span.cm-tag {color: #db2d20;}
-.cm-s-3024-night span.cm-link {color: #a16a94;}
-.cm-s-3024-night span.cm-error {background: #db2d20; color: #807d7c;}
+.cm-s-3024-night span.cm-variable { color: #01a252; }
+.cm-s-3024-night span.cm-variable-2 { color: #01a0e4; }
+.cm-s-3024-night span.cm-def { color: #e8bbd0; }
+.cm-s-3024-night span.cm-bracket { color: #d6d5d4; }
+.cm-s-3024-night span.cm-tag { color: #db2d20; }
+.cm-s-3024-night span.cm-link { color: #a16a94; }
+.cm-s-3024-night span.cm-error { background: #db2d20; color: #807d7c; }
-.cm-s-3024-night .CodeMirror-activeline-background {background: #2F2F2F !important;}
-.cm-s-3024-night .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
+.cm-s-3024-night .CodeMirror-activeline-background { background: #2F2F2F; }
+.cm-s-3024-night .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
diff --git a/public/vendor/codemirror/theme/abcdef.css b/public/vendor/codemirror/theme/abcdef.css
new file mode 100644
index 00000000..7f9d7887
--- /dev/null
+++ b/public/vendor/codemirror/theme/abcdef.css
@@ -0,0 +1,32 @@
+.cm-s-abcdef.CodeMirror { background: #0f0f0f; color: #defdef; }
+.cm-s-abcdef div.CodeMirror-selected { background: #515151; }
+.cm-s-abcdef .CodeMirror-line::selection, .cm-s-abcdef .CodeMirror-line > span::selection, .cm-s-abcdef .CodeMirror-line > span > span::selection { background: rgba(56, 56, 56, 0.99); }
+.cm-s-abcdef .CodeMirror-line::-moz-selection, .cm-s-abcdef .CodeMirror-line > span::-moz-selection, .cm-s-abcdef .CodeMirror-line > span > span::-moz-selection { background: rgba(56, 56, 56, 0.99); }
+.cm-s-abcdef .CodeMirror-gutters { background: #555; border-right: 2px solid #314151; }
+.cm-s-abcdef .CodeMirror-guttermarker { color: #222; }
+.cm-s-abcdef .CodeMirror-guttermarker-subtle { color: azure; }
+.cm-s-abcdef .CodeMirror-linenumber { color: #FFFFFF; }
+.cm-s-abcdef .CodeMirror-cursor { border-left: 1px solid #00FF00; }
+
+.cm-s-abcdef span.cm-keyword { color: darkgoldenrod; font-weight: bold; }
+.cm-s-abcdef span.cm-atom { color: #77F; }
+.cm-s-abcdef span.cm-number { color: violet; }
+.cm-s-abcdef span.cm-def { color: #fffabc; }
+.cm-s-abcdef span.cm-variable { color: #abcdef; }
+.cm-s-abcdef span.cm-variable-2 { color: #cacbcc; }
+.cm-s-abcdef span.cm-variable-3 { color: #def; }
+.cm-s-abcdef span.cm-property { color: #fedcba; }
+.cm-s-abcdef span.cm-operator { color: #ff0; }
+.cm-s-abcdef span.cm-comment { color: #7a7b7c; font-style: italic;}
+.cm-s-abcdef span.cm-string { color: #2b4; }
+.cm-s-abcdef span.cm-meta { color: #C9F; }
+.cm-s-abcdef span.cm-qualifier { color: #FFF700; }
+.cm-s-abcdef span.cm-builtin { color: #30aabc; }
+.cm-s-abcdef span.cm-bracket { color: #8a8a8a; }
+.cm-s-abcdef span.cm-tag { color: #FFDD44; }
+.cm-s-abcdef span.cm-attribute { color: #DDFF00; }
+.cm-s-abcdef span.cm-error { color: #FF0000; }
+.cm-s-abcdef span.cm-header { color: aquamarine; font-weight: bold; }
+.cm-s-abcdef span.cm-link { color: blueviolet; }
+
+.cm-s-abcdef .CodeMirror-activeline-background { background: #314151; }
diff --git a/public/vendor/codemirror/theme/ambiance-mobile.css b/public/vendor/codemirror/theme/ambiance-mobile.css
index 88d332e1..88d332e1 100755..100644
--- a/public/vendor/codemirror/theme/ambiance-mobile.css
+++ b/public/vendor/codemirror/theme/ambiance-mobile.css
diff --git a/public/vendor/codemirror/theme/ambiance.css b/public/vendor/codemirror/theme/ambiance.css
index 3ab9b254..bce34464 100755..100644
--- a/public/vendor/codemirror/theme/ambiance.css
+++ b/public/vendor/codemirror/theme/ambiance.css
@@ -2,7 +2,7 @@
/* Color scheme */
-.cm-s-ambiance .cm-header {color: blue;}
+.cm-s-ambiance .cm-header { color: blue; }
.cm-s-ambiance .cm-quote { color: #24C2C7; }
.cm-s-ambiance .cm-keyword { color: #cda869; }
@@ -13,7 +13,7 @@
.cm-s-ambiance .cm-variable-2 { color: #eed1b3; }
.cm-s-ambiance .cm-variable-3 { color: #faded3; }
.cm-s-ambiance .cm-property { color: #eed1b3; }
-.cm-s-ambiance .cm-operator {color: #fa8d6a;}
+.cm-s-ambiance .cm-operator { color: #fa8d6a; }
.cm-s-ambiance .cm-comment { color: #555; font-style:italic; }
.cm-s-ambiance .cm-string { color: #8f9d6a; }
.cm-s-ambiance .cm-string-2 { color: #9d937c; }
@@ -21,8 +21,8 @@
.cm-s-ambiance .cm-qualifier { color: yellow; }
.cm-s-ambiance .cm-builtin { color: #9999cc; }
.cm-s-ambiance .cm-bracket { color: #24C2C7; }
-.cm-s-ambiance .cm-tag { color: #fee4ff }
-.cm-s-ambiance .cm-attribute { color: #9B859D; }
+.cm-s-ambiance .cm-tag { color: #fee4ff; }
+.cm-s-ambiance .cm-attribute { color: #9B859D; }
.cm-s-ambiance .cm-hr { color: pink; }
.cm-s-ambiance .cm-link { color: #F4C20B; }
.cm-s-ambiance .cm-special { color: #FF9D00; }
@@ -31,10 +31,10 @@
.cm-s-ambiance .CodeMirror-matchingbracket { color: #0f0; }
.cm-s-ambiance .CodeMirror-nonmatchingbracket { color: #f22; }
-.cm-s-ambiance .CodeMirror-selected { background: rgba(255, 255, 255, 0.15); }
-.cm-s-ambiance.CodeMirror-focused .CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }
-.cm-s-ambiance.CodeMirror ::selection { background: rgba(255, 255, 255, 0.10); }
-.cm-s-ambiance.CodeMirror ::-moz-selection { background: rgba(255, 255, 255, 0.10); }
+.cm-s-ambiance div.CodeMirror-selected { background: rgba(255, 255, 255, 0.15); }
+.cm-s-ambiance.CodeMirror-focused div.CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }
+.cm-s-ambiance .CodeMirror-line::selection, .cm-s-ambiance .CodeMirror-line > span::selection, .cm-s-ambiance .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); }
+.cm-s-ambiance .CodeMirror-line::-moz-selection, .cm-s-ambiance .CodeMirror-line > span::-moz-selection, .cm-s-ambiance .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); }
/* Editor styling */
@@ -62,9 +62,7 @@
.cm-s-ambiance .CodeMirror-guttermarker { color: #aaa; }
.cm-s-ambiance .CodeMirror-guttermarker-subtle { color: #111; }
-.cm-s-ambiance .CodeMirror-lines .CodeMirror-cursor {
- border-left: 1px solid #7991E8;
-}
+.cm-s-ambiance .CodeMirror-cursor { border-left: 1px solid #7991E8; }
.cm-s-ambiance .CodeMirror-activeline-background {
background: none repeat scroll 0% 0% rgba(255, 255, 255, 0.031);
diff --git a/public/vendor/codemirror/theme/base16-dark.css b/public/vendor/codemirror/theme/base16-dark.css
index b009d2b9..026a8168 100755..100644
--- a/public/vendor/codemirror/theme/base16-dark.css
+++ b/public/vendor/codemirror/theme/base16-dark.css
@@ -3,36 +3,36 @@
Name: Base16 Default Dark
Author: Chris Kempson (http://chriskempson.com)
- CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools)
+ CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)
Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
*/
-.cm-s-base16-dark.CodeMirror {background: #151515; color: #e0e0e0;}
-.cm-s-base16-dark div.CodeMirror-selected {background: #303030 !important;}
-.cm-s-base16-dark.CodeMirror ::selection { background: rgba(48, 48, 48, .99); }
-.cm-s-base16-dark.CodeMirror ::-moz-selection { background: rgba(48, 48, 48, .99); }
-.cm-s-base16-dark .CodeMirror-gutters {background: #151515; border-right: 0px;}
+.cm-s-base16-dark.CodeMirror { background: #151515; color: #e0e0e0; }
+.cm-s-base16-dark div.CodeMirror-selected { background: #303030; }
+.cm-s-base16-dark .CodeMirror-line::selection, .cm-s-base16-dark .CodeMirror-line > span::selection, .cm-s-base16-dark .CodeMirror-line > span > span::selection { background: rgba(48, 48, 48, .99); }
+.cm-s-base16-dark .CodeMirror-line::-moz-selection, .cm-s-base16-dark .CodeMirror-line > span::-moz-selection, .cm-s-base16-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(48, 48, 48, .99); }
+.cm-s-base16-dark .CodeMirror-gutters { background: #151515; border-right: 0px; }
.cm-s-base16-dark .CodeMirror-guttermarker { color: #ac4142; }
.cm-s-base16-dark .CodeMirror-guttermarker-subtle { color: #505050; }
-.cm-s-base16-dark .CodeMirror-linenumber {color: #505050;}
-.cm-s-base16-dark .CodeMirror-cursor {border-left: 1px solid #b0b0b0 !important;}
-
-.cm-s-base16-dark span.cm-comment {color: #8f5536;}
-.cm-s-base16-dark span.cm-atom {color: #aa759f;}
-.cm-s-base16-dark span.cm-number {color: #aa759f;}
-
-.cm-s-base16-dark span.cm-property, .cm-s-base16-dark span.cm-attribute {color: #90a959;}
-.cm-s-base16-dark span.cm-keyword {color: #ac4142;}
-.cm-s-base16-dark span.cm-string {color: #f4bf75;}
-
-.cm-s-base16-dark span.cm-variable {color: #90a959;}
-.cm-s-base16-dark span.cm-variable-2 {color: #6a9fb5;}
-.cm-s-base16-dark span.cm-def {color: #d28445;}
-.cm-s-base16-dark span.cm-bracket {color: #e0e0e0;}
-.cm-s-base16-dark span.cm-tag {color: #ac4142;}
-.cm-s-base16-dark span.cm-link {color: #aa759f;}
-.cm-s-base16-dark span.cm-error {background: #ac4142; color: #b0b0b0;}
-
-.cm-s-base16-dark .CodeMirror-activeline-background {background: #202020 !important;}
-.cm-s-base16-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
+.cm-s-base16-dark .CodeMirror-linenumber { color: #505050; }
+.cm-s-base16-dark .CodeMirror-cursor { border-left: 1px solid #b0b0b0; }
+
+.cm-s-base16-dark span.cm-comment { color: #8f5536; }
+.cm-s-base16-dark span.cm-atom { color: #aa759f; }
+.cm-s-base16-dark span.cm-number { color: #aa759f; }
+
+.cm-s-base16-dark span.cm-property, .cm-s-base16-dark span.cm-attribute { color: #90a959; }
+.cm-s-base16-dark span.cm-keyword { color: #ac4142; }
+.cm-s-base16-dark span.cm-string { color: #f4bf75; }
+
+.cm-s-base16-dark span.cm-variable { color: #90a959; }
+.cm-s-base16-dark span.cm-variable-2 { color: #6a9fb5; }
+.cm-s-base16-dark span.cm-def { color: #d28445; }
+.cm-s-base16-dark span.cm-bracket { color: #e0e0e0; }
+.cm-s-base16-dark span.cm-tag { color: #ac4142; }
+.cm-s-base16-dark span.cm-link { color: #aa759f; }
+.cm-s-base16-dark span.cm-error { background: #ac4142; color: #b0b0b0; }
+
+.cm-s-base16-dark .CodeMirror-activeline-background { background: #202020; }
+.cm-s-base16-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
diff --git a/public/vendor/codemirror/theme/base16-light.css b/public/vendor/codemirror/theme/base16-light.css
index 15df6d38..474e0ca9 100755..100644
--- a/public/vendor/codemirror/theme/base16-light.css
+++ b/public/vendor/codemirror/theme/base16-light.css
@@ -3,36 +3,36 @@
Name: Base16 Default Light
Author: Chris Kempson (http://chriskempson.com)
- CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools)
+ CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)
Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
*/
-.cm-s-base16-light.CodeMirror {background: #f5f5f5; color: #202020;}
-.cm-s-base16-light div.CodeMirror-selected {background: #e0e0e0 !important;}
-.cm-s-base16-light.CodeMirror ::selection { background: #e0e0e0; }
-.cm-s-base16-light.CodeMirror ::-moz-selection { background: #e0e0e0; }
-.cm-s-base16-light .CodeMirror-gutters {background: #f5f5f5; border-right: 0px;}
+.cm-s-base16-light.CodeMirror { background: #f5f5f5; color: #202020; }
+.cm-s-base16-light div.CodeMirror-selected { background: #e0e0e0; }
+.cm-s-base16-light .CodeMirror-line::selection, .cm-s-base16-light .CodeMirror-line > span::selection, .cm-s-base16-light .CodeMirror-line > span > span::selection { background: #e0e0e0; }
+.cm-s-base16-light .CodeMirror-line::-moz-selection, .cm-s-base16-light .CodeMirror-line > span::-moz-selection, .cm-s-base16-light .CodeMirror-line > span > span::-moz-selection { background: #e0e0e0; }
+.cm-s-base16-light .CodeMirror-gutters { background: #f5f5f5; border-right: 0px; }
.cm-s-base16-light .CodeMirror-guttermarker { color: #ac4142; }
.cm-s-base16-light .CodeMirror-guttermarker-subtle { color: #b0b0b0; }
-.cm-s-base16-light .CodeMirror-linenumber {color: #b0b0b0;}
-.cm-s-base16-light .CodeMirror-cursor {border-left: 1px solid #505050 !important;}
-
-.cm-s-base16-light span.cm-comment {color: #8f5536;}
-.cm-s-base16-light span.cm-atom {color: #aa759f;}
-.cm-s-base16-light span.cm-number {color: #aa759f;}
-
-.cm-s-base16-light span.cm-property, .cm-s-base16-light span.cm-attribute {color: #90a959;}
-.cm-s-base16-light span.cm-keyword {color: #ac4142;}
-.cm-s-base16-light span.cm-string {color: #f4bf75;}
-
-.cm-s-base16-light span.cm-variable {color: #90a959;}
-.cm-s-base16-light span.cm-variable-2 {color: #6a9fb5;}
-.cm-s-base16-light span.cm-def {color: #d28445;}
-.cm-s-base16-light span.cm-bracket {color: #202020;}
-.cm-s-base16-light span.cm-tag {color: #ac4142;}
-.cm-s-base16-light span.cm-link {color: #aa759f;}
-.cm-s-base16-light span.cm-error {background: #ac4142; color: #505050;}
-
-.cm-s-base16-light .CodeMirror-activeline-background {background: #DDDCDC !important;}
-.cm-s-base16-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
+.cm-s-base16-light .CodeMirror-linenumber { color: #b0b0b0; }
+.cm-s-base16-light .CodeMirror-cursor { border-left: 1px solid #505050; }
+
+.cm-s-base16-light span.cm-comment { color: #8f5536; }
+.cm-s-base16-light span.cm-atom { color: #aa759f; }
+.cm-s-base16-light span.cm-number { color: #aa759f; }
+
+.cm-s-base16-light span.cm-property, .cm-s-base16-light span.cm-attribute { color: #90a959; }
+.cm-s-base16-light span.cm-keyword { color: #ac4142; }
+.cm-s-base16-light span.cm-string { color: #f4bf75; }
+
+.cm-s-base16-light span.cm-variable { color: #90a959; }
+.cm-s-base16-light span.cm-variable-2 { color: #6a9fb5; }
+.cm-s-base16-light span.cm-def { color: #d28445; }
+.cm-s-base16-light span.cm-bracket { color: #202020; }
+.cm-s-base16-light span.cm-tag { color: #ac4142; }
+.cm-s-base16-light span.cm-link { color: #aa759f; }
+.cm-s-base16-light span.cm-error { background: #ac4142; color: #505050; }
+
+.cm-s-base16-light .CodeMirror-activeline-background { background: #DDDCDC; }
+.cm-s-base16-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
diff --git a/public/vendor/codemirror/theme/bespin.css b/public/vendor/codemirror/theme/bespin.css
new file mode 100644
index 00000000..60913ba9
--- /dev/null
+++ b/public/vendor/codemirror/theme/bespin.css
@@ -0,0 +1,34 @@
+/*
+
+ Name: Bespin
+ Author: Mozilla / Jan T. Sott
+
+ CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)
+ Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
+
+*/
+
+.cm-s-bespin.CodeMirror {background: #28211c; color: #9d9b97;}
+.cm-s-bespin div.CodeMirror-selected {background: #36312e !important;}
+.cm-s-bespin .CodeMirror-gutters {background: #28211c; border-right: 0px;}
+.cm-s-bespin .CodeMirror-linenumber {color: #666666;}
+.cm-s-bespin .CodeMirror-cursor {border-left: 1px solid #797977 !important;}
+
+.cm-s-bespin span.cm-comment {color: #937121;}
+.cm-s-bespin span.cm-atom {color: #9b859d;}
+.cm-s-bespin span.cm-number {color: #9b859d;}
+
+.cm-s-bespin span.cm-property, .cm-s-bespin span.cm-attribute {color: #54be0d;}
+.cm-s-bespin span.cm-keyword {color: #cf6a4c;}
+.cm-s-bespin span.cm-string {color: #f9ee98;}
+
+.cm-s-bespin span.cm-variable {color: #54be0d;}
+.cm-s-bespin span.cm-variable-2 {color: #5ea6ea;}
+.cm-s-bespin span.cm-def {color: #cf7d34;}
+.cm-s-bespin span.cm-error {background: #cf6a4c; color: #797977;}
+.cm-s-bespin span.cm-bracket {color: #9d9b97;}
+.cm-s-bespin span.cm-tag {color: #cf6a4c;}
+.cm-s-bespin span.cm-link {color: #9b859d;}
+
+.cm-s-bespin .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
+.cm-s-bespin .CodeMirror-activeline-background { background: #404040; }
diff --git a/public/vendor/codemirror/theme/blackboard.css b/public/vendor/codemirror/theme/blackboard.css
index 02289b63..b6eaedb1 100755..100644
--- a/public/vendor/codemirror/theme/blackboard.css
+++ b/public/vendor/codemirror/theme/blackboard.css
@@ -1,21 +1,21 @@
/* Port of TextMate's Blackboard theme */
.cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; }
-.cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; }
-.cm-s-blackboard.CodeMirror ::selection { background: rgba(37, 59, 118, .99); }
-.cm-s-blackboard.CodeMirror ::-moz-selection { background: rgba(37, 59, 118, .99); }
+.cm-s-blackboard div.CodeMirror-selected { background: #253B76; }
+.cm-s-blackboard .CodeMirror-line::selection, .cm-s-blackboard .CodeMirror-line > span::selection, .cm-s-blackboard .CodeMirror-line > span > span::selection { background: rgba(37, 59, 118, .99); }
+.cm-s-blackboard .CodeMirror-line::-moz-selection, .cm-s-blackboard .CodeMirror-line > span::-moz-selection, .cm-s-blackboard .CodeMirror-line > span > span::-moz-selection { background: rgba(37, 59, 118, .99); }
.cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; }
.cm-s-blackboard .CodeMirror-guttermarker { color: #FBDE2D; }
.cm-s-blackboard .CodeMirror-guttermarker-subtle { color: #888; }
.cm-s-blackboard .CodeMirror-linenumber { color: #888; }
-.cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; }
+.cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7; }
.cm-s-blackboard .cm-keyword { color: #FBDE2D; }
.cm-s-blackboard .cm-atom { color: #D8FA3C; }
.cm-s-blackboard .cm-number { color: #D8FA3C; }
.cm-s-blackboard .cm-def { color: #8DA6CE; }
.cm-s-blackboard .cm-variable { color: #FF6400; }
-.cm-s-blackboard .cm-operator { color: #FBDE2D;}
+.cm-s-blackboard .cm-operator { color: #FBDE2D; }
.cm-s-blackboard .cm-comment { color: #AEAEAE; }
.cm-s-blackboard .cm-string { color: #61CE3C; }
.cm-s-blackboard .cm-string-2 { color: #61CE3C; }
@@ -28,5 +28,5 @@
.cm-s-blackboard .cm-link { color: #8DA6CE; }
.cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; }
-.cm-s-blackboard .CodeMirror-activeline-background {background: #3C3636 !important;}
-.cm-s-blackboard .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important} \ No newline at end of file
+.cm-s-blackboard .CodeMirror-activeline-background { background: #3C3636; }
+.cm-s-blackboard .CodeMirror-matchingbracket { outline:1px solid grey;color:white !important; }
diff --git a/public/vendor/codemirror/theme/cobalt.css b/public/vendor/codemirror/theme/cobalt.css
index 39155894..d88223ed 100755..100644
--- a/public/vendor/codemirror/theme/cobalt.css
+++ b/public/vendor/codemirror/theme/cobalt.css
@@ -1,12 +1,12 @@
.cm-s-cobalt.CodeMirror { background: #002240; color: white; }
-.cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; }
-.cm-s-cobalt.CodeMirror ::selection { background: rgba(179, 101, 57, .99); }
-.cm-s-cobalt.CodeMirror ::-moz-selection { background: rgba(179, 101, 57, .99); }
+.cm-s-cobalt div.CodeMirror-selected { background: #b36539; }
+.cm-s-cobalt .CodeMirror-line::selection, .cm-s-cobalt .CodeMirror-line > span::selection, .cm-s-cobalt .CodeMirror-line > span > span::selection { background: rgba(179, 101, 57, .99); }
+.cm-s-cobalt .CodeMirror-line::-moz-selection, .cm-s-cobalt .CodeMirror-line > span::-moz-selection, .cm-s-cobalt .CodeMirror-line > span > span::-moz-selection { background: rgba(179, 101, 57, .99); }
.cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
.cm-s-cobalt .CodeMirror-guttermarker { color: #ffee80; }
.cm-s-cobalt .CodeMirror-guttermarker-subtle { color: #d0d0d0; }
.cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; }
-.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; }
+.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white; }
.cm-s-cobalt span.cm-comment { color: #08f; }
.cm-s-cobalt span.cm-atom { color: #845dc4; }
@@ -21,5 +21,5 @@
.cm-s-cobalt span.cm-link { color: #845dc4; }
.cm-s-cobalt span.cm-error { color: #9d1e15; }
-.cm-s-cobalt .CodeMirror-activeline-background {background: #002D57 !important;}
-.cm-s-cobalt .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important}
+.cm-s-cobalt .CodeMirror-activeline-background { background: #002D57; }
+.cm-s-cobalt .CodeMirror-matchingbracket { outline:1px solid grey;color:white !important; }
diff --git a/public/vendor/codemirror/theme/colorforth.css b/public/vendor/codemirror/theme/colorforth.css
index 73fbf808..606899f3 100755..100644
--- a/public/vendor/codemirror/theme/colorforth.css
+++ b/public/vendor/codemirror/theme/colorforth.css
@@ -3,7 +3,7 @@
.cm-s-colorforth .CodeMirror-guttermarker { color: #FFBD40; }
.cm-s-colorforth .CodeMirror-guttermarker-subtle { color: #78846f; }
.cm-s-colorforth .CodeMirror-linenumber { color: #bababa; }
-.cm-s-colorforth .CodeMirror-cursor { border-left: 1px solid white !important; }
+.cm-s-colorforth .CodeMirror-cursor { border-left: 1px solid white; }
.cm-s-colorforth span.cm-comment { color: #ededed; }
.cm-s-colorforth span.cm-def { color: #ff1c1c; font-weight:bold; }
@@ -26,8 +26,8 @@
.cm-s-colorforth span.cm-attribute { color: #FFF700; }
.cm-s-colorforth span.cm-error { color: #f00; }
-.cm-s-colorforth .CodeMirror-selected { background: #333d53 !important; }
+.cm-s-colorforth div.CodeMirror-selected { background: #333d53; }
.cm-s-colorforth span.cm-compilation { background: rgba(255, 255, 255, 0.12); }
-.cm-s-colorforth .CodeMirror-activeline-background {background: #253540 !important;}
+.cm-s-colorforth .CodeMirror-activeline-background { background: #253540; }
diff --git a/public/vendor/codemirror/theme/dracula.css b/public/vendor/codemirror/theme/dracula.css
new file mode 100644
index 00000000..57f979ae
--- /dev/null
+++ b/public/vendor/codemirror/theme/dracula.css
@@ -0,0 +1,41 @@
+/*
+
+ Name: dracula
+ Author: Michael Kaminsky (http://github.com/mkaminsky11)
+
+ Original dracula color scheme by Zeno Rocha (https://github.com/zenorocha/dracula-theme)
+
+*/
+
+
+.cm-s-dracula.CodeMirror, .cm-s-dracula .CodeMirror-gutters {
+ background-color: #282a36 !important;
+ color: #f8f8f2 !important;
+ border: none;
+}
+.cm-s-dracula .CodeMirror-gutters { color: #282a36; }
+.cm-s-dracula .CodeMirror-cursor { border-left: solid thin #f8f8f0; }
+.cm-s-dracula .CodeMirror-linenumber { color: #6D8A88; }
+.cm-s-dracula.CodeMirror-focused div.CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }
+.cm-s-dracula .CodeMirror-line::selection, .cm-s-dracula .CodeMirror-line > span::selection, .cm-s-dracula .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); }
+.cm-s-dracula .CodeMirror-line::-moz-selection, .cm-s-dracula .CodeMirror-line > span::-moz-selection, .cm-s-dracula .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); }
+.cm-s-dracula span.cm-comment { color: #6272a4; }
+.cm-s-dracula span.cm-string, .cm-s-dracula span.cm-string-2 { color: #f1fa8c; }
+.cm-s-dracula span.cm-number { color: #bd93f9; }
+.cm-s-dracula span.cm-variable { color: #50fa7b; }
+.cm-s-dracula span.cm-variable-2 { color: white; }
+.cm-s-dracula span.cm-def { color: #ffb86c; }
+.cm-s-dracula span.cm-keyword { color: #ff79c6; }
+.cm-s-dracula span.cm-operator { color: #ff79c6; }
+.cm-s-dracula span.cm-keyword { color: #ff79c6; }
+.cm-s-dracula span.cm-atom { color: #bd93f9; }
+.cm-s-dracula span.cm-meta { color: #f8f8f2; }
+.cm-s-dracula span.cm-tag { color: #ff79c6; }
+.cm-s-dracula span.cm-attribute { color: #50fa7b; }
+.cm-s-dracula span.cm-qualifier { color: #50fa7b; }
+.cm-s-dracula span.cm-property { color: #66d9ef; }
+.cm-s-dracula span.cm-builtin { color: #50fa7b; }
+.cm-s-dracula span.cm-variable-3 { color: #50fa7b; }
+
+.cm-s-dracula .CodeMirror-activeline-background { background: rgba(255,255,255,0.1); }
+.cm-s-dracula .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
diff --git a/public/vendor/codemirror/theme/eclipse.css b/public/vendor/codemirror/theme/eclipse.css
index 317218e3..1bde460e 100755..100644
--- a/public/vendor/codemirror/theme/eclipse.css
+++ b/public/vendor/codemirror/theme/eclipse.css
@@ -1,23 +1,23 @@
-.cm-s-eclipse span.cm-meta {color: #FF1717;}
+.cm-s-eclipse span.cm-meta { color: #FF1717; }
.cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; }
-.cm-s-eclipse span.cm-atom {color: #219;}
-.cm-s-eclipse span.cm-number {color: #164;}
-.cm-s-eclipse span.cm-def {color: #00f;}
-.cm-s-eclipse span.cm-variable {color: black;}
-.cm-s-eclipse span.cm-variable-2 {color: #0000C0;}
-.cm-s-eclipse span.cm-variable-3 {color: #0000C0;}
-.cm-s-eclipse span.cm-property {color: black;}
-.cm-s-eclipse span.cm-operator {color: black;}
-.cm-s-eclipse span.cm-comment {color: #3F7F5F;}
-.cm-s-eclipse span.cm-string {color: #2A00FF;}
-.cm-s-eclipse span.cm-string-2 {color: #f50;}
-.cm-s-eclipse span.cm-qualifier {color: #555;}
-.cm-s-eclipse span.cm-builtin {color: #30a;}
-.cm-s-eclipse span.cm-bracket {color: #cc7;}
-.cm-s-eclipse span.cm-tag {color: #170;}
-.cm-s-eclipse span.cm-attribute {color: #00c;}
-.cm-s-eclipse span.cm-link {color: #219;}
-.cm-s-eclipse span.cm-error {color: #f00;}
+.cm-s-eclipse span.cm-atom { color: #219; }
+.cm-s-eclipse span.cm-number { color: #164; }
+.cm-s-eclipse span.cm-def { color: #00f; }
+.cm-s-eclipse span.cm-variable { color: black; }
+.cm-s-eclipse span.cm-variable-2 { color: #0000C0; }
+.cm-s-eclipse span.cm-variable-3 { color: #0000C0; }
+.cm-s-eclipse span.cm-property { color: black; }
+.cm-s-eclipse span.cm-operator { color: black; }
+.cm-s-eclipse span.cm-comment { color: #3F7F5F; }
+.cm-s-eclipse span.cm-string { color: #2A00FF; }
+.cm-s-eclipse span.cm-string-2 { color: #f50; }
+.cm-s-eclipse span.cm-qualifier { color: #555; }
+.cm-s-eclipse span.cm-builtin { color: #30a; }
+.cm-s-eclipse span.cm-bracket { color: #cc7; }
+.cm-s-eclipse span.cm-tag { color: #170; }
+.cm-s-eclipse span.cm-attribute { color: #00c; }
+.cm-s-eclipse span.cm-link { color: #219; }
+.cm-s-eclipse span.cm-error { color: #f00; }
-.cm-s-eclipse .CodeMirror-activeline-background {background: #e8f2ff !important;}
-.cm-s-eclipse .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;}
+.cm-s-eclipse .CodeMirror-activeline-background { background: #e8f2ff; }
+.cm-s-eclipse .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; }
diff --git a/public/vendor/codemirror/theme/elegant.css b/public/vendor/codemirror/theme/elegant.css
index dd7df7b7..45b3ea65 100755..100644
--- a/public/vendor/codemirror/theme/elegant.css
+++ b/public/vendor/codemirror/theme/elegant.css
@@ -1,13 +1,13 @@
-.cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;}
-.cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;}
-.cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;}
-.cm-s-elegant span.cm-variable {color: black;}
-.cm-s-elegant span.cm-variable-2 {color: #b11;}
-.cm-s-elegant span.cm-qualifier {color: #555;}
-.cm-s-elegant span.cm-keyword {color: #730;}
-.cm-s-elegant span.cm-builtin {color: #30a;}
-.cm-s-elegant span.cm-link {color: #762;}
-.cm-s-elegant span.cm-error {background-color: #fdd;}
+.cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom { color: #762; }
+.cm-s-elegant span.cm-comment { color: #262; font-style: italic; line-height: 1em; }
+.cm-s-elegant span.cm-meta { color: #555; font-style: italic; line-height: 1em; }
+.cm-s-elegant span.cm-variable { color: black; }
+.cm-s-elegant span.cm-variable-2 { color: #b11; }
+.cm-s-elegant span.cm-qualifier { color: #555; }
+.cm-s-elegant span.cm-keyword { color: #730; }
+.cm-s-elegant span.cm-builtin { color: #30a; }
+.cm-s-elegant span.cm-link { color: #762; }
+.cm-s-elegant span.cm-error { background-color: #fdd; }
-.cm-s-elegant .CodeMirror-activeline-background {background: #e8f2ff !important;}
-.cm-s-elegant .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;}
+.cm-s-elegant .CodeMirror-activeline-background { background: #e8f2ff; }
+.cm-s-elegant .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; }
diff --git a/public/vendor/codemirror/theme/erlang-dark.css b/public/vendor/codemirror/theme/erlang-dark.css
index e20bf125..65fe4814 100755..100644
--- a/public/vendor/codemirror/theme/erlang-dark.css
+++ b/public/vendor/codemirror/theme/erlang-dark.css
@@ -1,12 +1,12 @@
.cm-s-erlang-dark.CodeMirror { background: #002240; color: white; }
-.cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; }
-.cm-s-erlang-dark.CodeMirror ::selection { background: rgba(179, 101, 57, .99); }
-.cm-s-erlang-dark.CodeMirror ::-moz-selection { background: rgba(179, 101, 57, .99); }
+.cm-s-erlang-dark div.CodeMirror-selected { background: #b36539; }
+.cm-s-erlang-dark .CodeMirror-line::selection, .cm-s-erlang-dark .CodeMirror-line > span::selection, .cm-s-erlang-dark .CodeMirror-line > span > span::selection { background: rgba(179, 101, 57, .99); }
+.cm-s-erlang-dark .CodeMirror-line::-moz-selection, .cm-s-erlang-dark .CodeMirror-line > span::-moz-selection, .cm-s-erlang-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(179, 101, 57, .99); }
.cm-s-erlang-dark .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
.cm-s-erlang-dark .CodeMirror-guttermarker { color: white; }
.cm-s-erlang-dark .CodeMirror-guttermarker-subtle { color: #d0d0d0; }
.cm-s-erlang-dark .CodeMirror-linenumber { color: #d0d0d0; }
-.cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
+.cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white; }
.cm-s-erlang-dark span.cm-quote { color: #ccc; }
.cm-s-erlang-dark span.cm-atom { color: #f133f1; }
@@ -30,5 +30,5 @@
.cm-s-erlang-dark span.cm-variable-3 { color: #ccc; }
.cm-s-erlang-dark span.cm-error { color: #9d1e15; }
-.cm-s-erlang-dark .CodeMirror-activeline-background {background: #013461 !important;}
-.cm-s-erlang-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}
+.cm-s-erlang-dark .CodeMirror-activeline-background { background: #013461; }
+.cm-s-erlang-dark .CodeMirror-matchingbracket { outline:1px solid grey; color:white !important; }
diff --git a/public/vendor/codemirror/theme/hopscotch.css b/public/vendor/codemirror/theme/hopscotch.css
new file mode 100644
index 00000000..7d05431b
--- /dev/null
+++ b/public/vendor/codemirror/theme/hopscotch.css
@@ -0,0 +1,34 @@
+/*
+
+ Name: Hopscotch
+ Author: Jan T. Sott
+
+ CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)
+ Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
+
+*/
+
+.cm-s-hopscotch.CodeMirror {background: #322931; color: #d5d3d5;}
+.cm-s-hopscotch div.CodeMirror-selected {background: #433b42 !important;}
+.cm-s-hopscotch .CodeMirror-gutters {background: #322931; border-right: 0px;}
+.cm-s-hopscotch .CodeMirror-linenumber {color: #797379;}
+.cm-s-hopscotch .CodeMirror-cursor {border-left: 1px solid #989498 !important;}
+
+.cm-s-hopscotch span.cm-comment {color: #b33508;}
+.cm-s-hopscotch span.cm-atom {color: #c85e7c;}
+.cm-s-hopscotch span.cm-number {color: #c85e7c;}
+
+.cm-s-hopscotch span.cm-property, .cm-s-hopscotch span.cm-attribute {color: #8fc13e;}
+.cm-s-hopscotch span.cm-keyword {color: #dd464c;}
+.cm-s-hopscotch span.cm-string {color: #fdcc59;}
+
+.cm-s-hopscotch span.cm-variable {color: #8fc13e;}
+.cm-s-hopscotch span.cm-variable-2 {color: #1290bf;}
+.cm-s-hopscotch span.cm-def {color: #fd8b19;}
+.cm-s-hopscotch span.cm-error {background: #dd464c; color: #989498;}
+.cm-s-hopscotch span.cm-bracket {color: #d5d3d5;}
+.cm-s-hopscotch span.cm-tag {color: #dd464c;}
+.cm-s-hopscotch span.cm-link {color: #c85e7c;}
+
+.cm-s-hopscotch .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
+.cm-s-hopscotch .CodeMirror-activeline-background { background: #302020; }
diff --git a/public/vendor/codemirror/theme/icecoder.css b/public/vendor/codemirror/theme/icecoder.css
new file mode 100644
index 00000000..d70d26e8
--- /dev/null
+++ b/public/vendor/codemirror/theme/icecoder.css
@@ -0,0 +1,43 @@
+/*
+ICEcoder default theme by Matt Pass, used in code editor available at https://icecoder.net
+*/
+
+.cm-s-icecoder { color: #666; background: #141612; }
+
+.cm-s-icecoder span.cm-keyword { color: #eee; font-weight:bold; } /* off-white 1 */
+.cm-s-icecoder span.cm-atom { color: #e1c76e; } /* yellow */
+.cm-s-icecoder span.cm-number { color: #6cb5d9; } /* blue */
+.cm-s-icecoder span.cm-def { color: #b9ca4a; } /* green */
+
+.cm-s-icecoder span.cm-variable { color: #6cb5d9; } /* blue */
+.cm-s-icecoder span.cm-variable-2 { color: #cc1e5c; } /* pink */
+.cm-s-icecoder span.cm-variable-3 { color: #f9602c; } /* orange */
+
+.cm-s-icecoder span.cm-property { color: #eee; } /* off-white 1 */
+.cm-s-icecoder span.cm-operator { color: #9179bb; } /* purple */
+.cm-s-icecoder span.cm-comment { color: #97a3aa; } /* grey-blue */
+
+.cm-s-icecoder span.cm-string { color: #b9ca4a; } /* green */
+.cm-s-icecoder span.cm-string-2 { color: #6cb5d9; } /* blue */
+
+.cm-s-icecoder span.cm-meta { color: #555; } /* grey */
+
+.cm-s-icecoder span.cm-qualifier { color: #555; } /* grey */
+.cm-s-icecoder span.cm-builtin { color: #214e7b; } /* bright blue */
+.cm-s-icecoder span.cm-bracket { color: #cc7; } /* grey-yellow */
+
+.cm-s-icecoder span.cm-tag { color: #e8e8e8; } /* off-white 2 */
+.cm-s-icecoder span.cm-attribute { color: #099; } /* teal */
+
+.cm-s-icecoder span.cm-header { color: #6a0d6a; } /* purple-pink */
+.cm-s-icecoder span.cm-quote { color: #186718; } /* dark green */
+.cm-s-icecoder span.cm-hr { color: #888; } /* mid-grey */
+.cm-s-icecoder span.cm-link { color: #e1c76e; } /* yellow */
+.cm-s-icecoder span.cm-error { color: #d00; } /* red */
+
+.cm-s-icecoder .CodeMirror-cursor { border-left: 1px solid white; }
+.cm-s-icecoder div.CodeMirror-selected { color: #fff; background: #037; }
+.cm-s-icecoder .CodeMirror-gutters { background: #141612; min-width: 41px; border-right: 0; }
+.cm-s-icecoder .CodeMirror-linenumber { color: #555; cursor: default; }
+.cm-s-icecoder .CodeMirror-matchingbracket { border: 1px solid grey; color: black !important; }
+.cm-s-icecoder .CodeMirror-activeline-background { background: #000; } \ No newline at end of file
diff --git a/public/vendor/codemirror/theme/isotope.css b/public/vendor/codemirror/theme/isotope.css
new file mode 100644
index 00000000..d0d6263c
--- /dev/null
+++ b/public/vendor/codemirror/theme/isotope.css
@@ -0,0 +1,34 @@
+/*
+
+ Name: Isotope
+ Author: David Desandro / Jan T. Sott
+
+ CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)
+ Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
+
+*/
+
+.cm-s-isotope.CodeMirror {background: #000000; color: #e0e0e0;}
+.cm-s-isotope div.CodeMirror-selected {background: #404040 !important;}
+.cm-s-isotope .CodeMirror-gutters {background: #000000; border-right: 0px;}
+.cm-s-isotope .CodeMirror-linenumber {color: #808080;}
+.cm-s-isotope .CodeMirror-cursor {border-left: 1px solid #c0c0c0 !important;}
+
+.cm-s-isotope span.cm-comment {color: #3300ff;}
+.cm-s-isotope span.cm-atom {color: #cc00ff;}
+.cm-s-isotope span.cm-number {color: #cc00ff;}
+
+.cm-s-isotope span.cm-property, .cm-s-isotope span.cm-attribute {color: #33ff00;}
+.cm-s-isotope span.cm-keyword {color: #ff0000;}
+.cm-s-isotope span.cm-string {color: #ff0099;}
+
+.cm-s-isotope span.cm-variable {color: #33ff00;}
+.cm-s-isotope span.cm-variable-2 {color: #0066ff;}
+.cm-s-isotope span.cm-def {color: #ff9900;}
+.cm-s-isotope span.cm-error {background: #ff0000; color: #c0c0c0;}
+.cm-s-isotope span.cm-bracket {color: #e0e0e0;}
+.cm-s-isotope span.cm-tag {color: #ff0000;}
+.cm-s-isotope span.cm-link {color: #cc00ff;}
+
+.cm-s-isotope .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
+.cm-s-isotope .CodeMirror-activeline-background { background: #202020; }
diff --git a/public/vendor/codemirror/theme/lesser-dark.css b/public/vendor/codemirror/theme/lesser-dark.css
index 88dff921..690c183d 100755..100644
--- a/public/vendor/codemirror/theme/lesser-dark.css
+++ b/public/vendor/codemirror/theme/lesser-dark.css
@@ -6,10 +6,10 @@ Ported to CodeMirror by Peter Kroon
line-height: 1.3em;
}
.cm-s-lesser-dark.CodeMirror { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; }
-.cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/
-.cm-s-lesser-dark.CodeMirror ::selection { background: rgba(69, 68, 59, .99); }
-.cm-s-lesser-dark.CodeMirror ::-moz-selection { background: rgba(69, 68, 59, .99); }
-.cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
+.cm-s-lesser-dark div.CodeMirror-selected { background: #45443B; } /* 33322B*/
+.cm-s-lesser-dark .CodeMirror-line::selection, .cm-s-lesser-dark .CodeMirror-line > span::selection, .cm-s-lesser-dark .CodeMirror-line > span > span::selection { background: rgba(69, 68, 59, .99); }
+.cm-s-lesser-dark .CodeMirror-line::-moz-selection, .cm-s-lesser-dark .CodeMirror-line > span::-moz-selection, .cm-s-lesser-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(69, 68, 59, .99); }
+.cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white; }
.cm-s-lesser-dark pre { padding: 0 8px; }/*editable code holder*/
.cm-s-lesser-dark.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/
@@ -19,29 +19,29 @@ Ported to CodeMirror by Peter Kroon
.cm-s-lesser-dark .CodeMirror-guttermarker-subtle { color: #777; }
.cm-s-lesser-dark .CodeMirror-linenumber { color: #777; }
-.cm-s-lesser-dark span.cm-header {color: #a0a;}
-.cm-s-lesser-dark span.cm-quote {color: #090;}
+.cm-s-lesser-dark span.cm-header { color: #a0a; }
+.cm-s-lesser-dark span.cm-quote { color: #090; }
.cm-s-lesser-dark span.cm-keyword { color: #599eff; }
.cm-s-lesser-dark span.cm-atom { color: #C2B470; }
.cm-s-lesser-dark span.cm-number { color: #B35E4D; }
-.cm-s-lesser-dark span.cm-def {color: white;}
+.cm-s-lesser-dark span.cm-def { color: white; }
.cm-s-lesser-dark span.cm-variable { color:#D9BF8C; }
.cm-s-lesser-dark span.cm-variable-2 { color: #669199; }
.cm-s-lesser-dark span.cm-variable-3 { color: white; }
-.cm-s-lesser-dark span.cm-property {color: #92A75C;}
-.cm-s-lesser-dark span.cm-operator {color: #92A75C;}
+.cm-s-lesser-dark span.cm-property { color: #92A75C; }
+.cm-s-lesser-dark span.cm-operator { color: #92A75C; }
.cm-s-lesser-dark span.cm-comment { color: #666; }
.cm-s-lesser-dark span.cm-string { color: #BCD279; }
-.cm-s-lesser-dark span.cm-string-2 {color: #f50;}
+.cm-s-lesser-dark span.cm-string-2 { color: #f50; }
.cm-s-lesser-dark span.cm-meta { color: #738C73; }
-.cm-s-lesser-dark span.cm-qualifier {color: #555;}
+.cm-s-lesser-dark span.cm-qualifier { color: #555; }
.cm-s-lesser-dark span.cm-builtin { color: #ff9e59; }
.cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; }
.cm-s-lesser-dark span.cm-tag { color: #669199; }
-.cm-s-lesser-dark span.cm-attribute {color: #00c;}
-.cm-s-lesser-dark span.cm-hr {color: #999;}
-.cm-s-lesser-dark span.cm-link {color: #00c;}
+.cm-s-lesser-dark span.cm-attribute { color: #00c; }
+.cm-s-lesser-dark span.cm-hr { color: #999; }
+.cm-s-lesser-dark span.cm-link { color: #00c; }
.cm-s-lesser-dark span.cm-error { color: #9d1e15; }
-.cm-s-lesser-dark .CodeMirror-activeline-background {background: #3C3A3A !important;}
-.cm-s-lesser-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}
+.cm-s-lesser-dark .CodeMirror-activeline-background { background: #3C3A3A; }
+.cm-s-lesser-dark .CodeMirror-matchingbracket { outline:1px solid grey; color:white !important; }
diff --git a/public/vendor/codemirror/theme/liquibyte.css b/public/vendor/codemirror/theme/liquibyte.css
index a6e070c6..9db8bde7 100755..100644
--- a/public/vendor/codemirror/theme/liquibyte.css
+++ b/public/vendor/codemirror/theme/liquibyte.css
@@ -4,27 +4,27 @@
line-height: 1.2em;
font-size: 1em;
}
-.CodeMirror-focused .cm-matchhighlight {
+.cm-s-liquibyte .CodeMirror-focused .cm-matchhighlight {
text-decoration: underline;
text-decoration-color: #0f0;
text-decoration-style: wavy;
}
-.cm-trailingspace {
+.cm-s-liquibyte .cm-trailingspace {
text-decoration: line-through;
text-decoration-color: #f00;
text-decoration-style: dotted;
}
-.cm-tab {
+.cm-s-liquibyte .cm-tab {
text-decoration: line-through;
text-decoration-color: #404040;
text-decoration-style: dotted;
}
.cm-s-liquibyte .CodeMirror-gutters { background-color: #262626; border-right: 1px solid #505050; padding-right: 0.8em; }
-.cm-s-liquibyte .CodeMirror-gutter-elt div{ font-size: 1.2em; }
+.cm-s-liquibyte .CodeMirror-gutter-elt div { font-size: 1.2em; }
.cm-s-liquibyte .CodeMirror-guttermarker { }
.cm-s-liquibyte .CodeMirror-guttermarker-subtle { }
-.cm-s-liquibyte .CodeMirror-linenumber { color: #606060; padding-left: 0;}
-.cm-s-liquibyte .CodeMirror-cursor { border-left: 1px solid #eee !important; }
+.cm-s-liquibyte .CodeMirror-linenumber { color: #606060; padding-left: 0; }
+.cm-s-liquibyte .CodeMirror-cursor { border-left: 1px solid #eee; }
.cm-s-liquibyte span.cm-comment { color: #008000; }
.cm-s-liquibyte span.cm-def { color: #ffaf40; font-weight: bold; }
@@ -47,49 +47,49 @@
.cm-s-liquibyte span.cm-attribute { color: #c080ff; font-weight: bold; }
.cm-s-liquibyte span.cm-error { color: #f00; }
-.cm-s-liquibyte .CodeMirror-selected { background-color: rgba(255, 0, 0, 0.25) !important; }
+.cm-s-liquibyte div.CodeMirror-selected { background-color: rgba(255, 0, 0, 0.25); }
.cm-s-liquibyte span.cm-compilation { background-color: rgba(255, 255, 255, 0.12); }
-.cm-s-liquibyte .CodeMirror-activeline-background {background-color: rgba(0, 255, 0, 0.15) !important;}
+.cm-s-liquibyte .CodeMirror-activeline-background { background-color: rgba(0, 255, 0, 0.15); }
/* Default styles for common addons */
-div.CodeMirror span.CodeMirror-matchingbracket { color: #0f0; font-weight: bold; }
-div.CodeMirror span.CodeMirror-nonmatchingbracket { color: #f00; font-weight: bold; }
+.cm-s-liquibyte .CodeMirror span.CodeMirror-matchingbracket { color: #0f0; font-weight: bold; }
+.cm-s-liquibyte .CodeMirror span.CodeMirror-nonmatchingbracket { color: #f00; font-weight: bold; }
.CodeMirror-matchingtag { background-color: rgba(150, 255, 0, .3); }
/* Scrollbars */
/* Simple */
-div.CodeMirror-simplescroll-horizontal div:hover, div.CodeMirror-simplescroll-vertical div:hover {
+.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div:hover, div.CodeMirror-simplescroll-vertical div:hover {
background-color: rgba(80, 80, 80, .7);
}
-div.CodeMirror-simplescroll-horizontal div, div.CodeMirror-simplescroll-vertical div {
+.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div, div.CodeMirror-simplescroll-vertical div {
background-color: rgba(80, 80, 80, .3);
border: 1px solid #404040;
border-radius: 5px;
}
-div.CodeMirror-simplescroll-vertical div {
+.cm-s-liquibyte div.CodeMirror-simplescroll-vertical div {
border-top: 1px solid #404040;
border-bottom: 1px solid #404040;
}
-div.CodeMirror-simplescroll-horizontal div {
+.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div {
border-left: 1px solid #404040;
border-right: 1px solid #404040;
}
-div.CodeMirror-simplescroll-vertical {
+.cm-s-liquibyte div.CodeMirror-simplescroll-vertical {
background-color: #262626;
}
-div.CodeMirror-simplescroll-horizontal {
+.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal {
background-color: #262626;
border-top: 1px solid #404040;
}
/* Overlay */
-div.CodeMirror-overlayscroll-horizontal div, div.CodeMirror-overlayscroll-vertical div {
+.cm-s-liquibyte div.CodeMirror-overlayscroll-horizontal div, div.CodeMirror-overlayscroll-vertical div {
background-color: #404040;
border-radius: 5px;
}
-div.CodeMirror-overlayscroll-vertical div {
+.cm-s-liquibyte div.CodeMirror-overlayscroll-vertical div {
border: 1px solid #404040;
}
-div.CodeMirror-overlayscroll-horizontal div {
+.cm-s-liquibyte div.CodeMirror-overlayscroll-horizontal div {
border: 1px solid #404040;
}
diff --git a/public/vendor/codemirror/theme/material.css b/public/vendor/codemirror/theme/material.css
new file mode 100644
index 00000000..91ed6cef
--- /dev/null
+++ b/public/vendor/codemirror/theme/material.css
@@ -0,0 +1,53 @@
+/*
+
+ Name: material
+ Author: Michael Kaminsky (http://github.com/mkaminsky11)
+
+ Original material color scheme by Mattia Astorino (https://github.com/equinusocio/material-theme)
+
+*/
+
+.cm-s-material {
+ background-color: #263238;
+ color: rgba(233, 237, 237, 1);
+}
+.cm-s-material .CodeMirror-gutters {
+ background: #263238;
+ color: rgb(83,127,126);
+ border: none;
+}
+.cm-s-material .CodeMirror-guttermarker, .cm-s-material .CodeMirror-guttermarker-subtle, .cm-s-material .CodeMirror-linenumber { color: rgb(83,127,126); }
+.cm-s-material .CodeMirror-cursor { border-left: 1px solid #f8f8f0; }
+.cm-s-material div.CodeMirror-selected { background: rgba(255, 255, 255, 0.15); }
+.cm-s-material.CodeMirror-focused div.CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }
+.cm-s-material .CodeMirror-line::selection, .cm-s-material .CodeMirror-line > span::selection, .cm-s-material .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); }
+.cm-s-material .CodeMirror-line::-moz-selection, .cm-s-material .CodeMirror-line > span::-moz-selection, .cm-s-material .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); }
+
+.cm-s-material .CodeMirror-activeline-background { background: rgba(0, 0, 0, 0); }
+.cm-s-material .cm-keyword { color: rgba(199, 146, 234, 1); }
+.cm-s-material .cm-operator { color: rgba(233, 237, 237, 1); }
+.cm-s-material .cm-variable-2 { color: #80CBC4; }
+.cm-s-material .cm-variable-3 { color: #82B1FF; }
+.cm-s-material .cm-builtin { color: #DECB6B; }
+.cm-s-material .cm-atom { color: #F77669; }
+.cm-s-material .cm-number { color: #F77669; }
+.cm-s-material .cm-def { color: rgba(233, 237, 237, 1); }
+.cm-s-material .cm-string { color: #C3E88D; }
+.cm-s-material .cm-string-2 { color: #80CBC4; }
+.cm-s-material .cm-comment { color: #546E7A; }
+.cm-s-material .cm-variable { color: #82B1FF; }
+.cm-s-material .cm-tag { color: #80CBC4; }
+.cm-s-material .cm-meta { color: #80CBC4; }
+.cm-s-material .cm-attribute { color: #FFCB6B; }
+.cm-s-material .cm-property { color: #80CBAE; }
+.cm-s-material .cm-qualifier { color: #DECB6B; }
+.cm-s-material .cm-variable-3 { color: #DECB6B; }
+.cm-s-material .cm-tag { color: rgba(255, 83, 112, 1); }
+.cm-s-material .cm-error {
+ color: rgba(255, 255, 255, 1.0);
+ background-color: #EC5F67;
+}
+.cm-s-material .CodeMirror-matchingbracket {
+ text-decoration: underline;
+ color: white !important;
+}
diff --git a/public/vendor/codemirror/theme/mbo.css b/public/vendor/codemirror/theme/mbo.css
index e3987952..59ff5da7 100755..100644
--- a/public/vendor/codemirror/theme/mbo.css
+++ b/public/vendor/codemirror/theme/mbo.css
@@ -4,34 +4,34 @@
/* Create your own: http://tmtheme-editor.herokuapp.com */
/****************************************************************/
-.cm-s-mbo.CodeMirror {background: #2c2c2c; color: #ffffec;}
-.cm-s-mbo div.CodeMirror-selected {background: #716C62 !important;}
-.cm-s-mbo.CodeMirror ::selection { background: rgba(113, 108, 98, .99); }
-.cm-s-mbo.CodeMirror ::-moz-selection { background: rgba(113, 108, 98, .99); }
-.cm-s-mbo .CodeMirror-gutters {background: #4e4e4e; border-right: 0px;}
+.cm-s-mbo.CodeMirror { background: #2c2c2c; color: #ffffec; }
+.cm-s-mbo div.CodeMirror-selected { background: #716C62; }
+.cm-s-mbo .CodeMirror-line::selection, .cm-s-mbo .CodeMirror-line > span::selection, .cm-s-mbo .CodeMirror-line > span > span::selection { background: rgba(113, 108, 98, .99); }
+.cm-s-mbo .CodeMirror-line::-moz-selection, .cm-s-mbo .CodeMirror-line > span::-moz-selection, .cm-s-mbo .CodeMirror-line > span > span::-moz-selection { background: rgba(113, 108, 98, .99); }
+.cm-s-mbo .CodeMirror-gutters { background: #4e4e4e; border-right: 0px; }
.cm-s-mbo .CodeMirror-guttermarker { color: white; }
.cm-s-mbo .CodeMirror-guttermarker-subtle { color: grey; }
-.cm-s-mbo .CodeMirror-linenumber {color: #dadada;}
-.cm-s-mbo .CodeMirror-cursor {border-left: 1px solid #ffffec !important;}
+.cm-s-mbo .CodeMirror-linenumber { color: #dadada; }
+.cm-s-mbo .CodeMirror-cursor { border-left: 1px solid #ffffec; }
-.cm-s-mbo span.cm-comment {color: #95958a;}
-.cm-s-mbo span.cm-atom {color: #00a8c6;}
-.cm-s-mbo span.cm-number {color: #00a8c6;}
+.cm-s-mbo span.cm-comment { color: #95958a; }
+.cm-s-mbo span.cm-atom { color: #00a8c6; }
+.cm-s-mbo span.cm-number { color: #00a8c6; }
-.cm-s-mbo span.cm-property, .cm-s-mbo span.cm-attribute {color: #9ddfe9;}
-.cm-s-mbo span.cm-keyword {color: #ffb928;}
-.cm-s-mbo span.cm-string {color: #ffcf6c;}
-.cm-s-mbo span.cm-string.cm-property {color: #ffffec;}
+.cm-s-mbo span.cm-property, .cm-s-mbo span.cm-attribute { color: #9ddfe9; }
+.cm-s-mbo span.cm-keyword { color: #ffb928; }
+.cm-s-mbo span.cm-string { color: #ffcf6c; }
+.cm-s-mbo span.cm-string.cm-property { color: #ffffec; }
-.cm-s-mbo span.cm-variable {color: #ffffec;}
-.cm-s-mbo span.cm-variable-2 {color: #00a8c6;}
-.cm-s-mbo span.cm-def {color: #ffffec;}
-.cm-s-mbo span.cm-bracket {color: #fffffc; font-weight: bold;}
-.cm-s-mbo span.cm-tag {color: #9ddfe9;}
-.cm-s-mbo span.cm-link {color: #f54b07;}
-.cm-s-mbo span.cm-error {border-bottom: #636363; color: #ffffec;}
-.cm-s-mbo span.cm-qualifier {color: #ffffec;}
+.cm-s-mbo span.cm-variable { color: #ffffec; }
+.cm-s-mbo span.cm-variable-2 { color: #00a8c6; }
+.cm-s-mbo span.cm-def { color: #ffffec; }
+.cm-s-mbo span.cm-bracket { color: #fffffc; font-weight: bold; }
+.cm-s-mbo span.cm-tag { color: #9ddfe9; }
+.cm-s-mbo span.cm-link { color: #f54b07; }
+.cm-s-mbo span.cm-error { border-bottom: #636363; color: #ffffec; }
+.cm-s-mbo span.cm-qualifier { color: #ffffec; }
-.cm-s-mbo .CodeMirror-activeline-background {background: #494b41 !important;}
-.cm-s-mbo .CodeMirror-matchingbracket {color: #222 !important;}
-.cm-s-mbo .CodeMirror-matchingtag {background: rgba(255, 255, 255, .37);}
+.cm-s-mbo .CodeMirror-activeline-background { background: #494b41; }
+.cm-s-mbo .CodeMirror-matchingbracket { color: #222 !important; }
+.cm-s-mbo .CodeMirror-matchingtag { background: rgba(255, 255, 255, .37); }
diff --git a/public/vendor/codemirror/theme/mdn-like.css b/public/vendor/codemirror/theme/mdn-like.css
index 9c73dc2f..f325d450 100755..100644
--- a/public/vendor/codemirror/theme/mdn-like.css
+++ b/public/vendor/codemirror/theme/mdn-like.css
@@ -8,15 +8,15 @@
*/
.cm-s-mdn-like.CodeMirror { color: #999; background-color: #fff; }
-.cm-s-mdn-like .CodeMirror-selected { background: #cfc !important; }
-.cm-s-mdn-like.CodeMirror ::selection { background: #cfc; }
-.cm-s-mdn-like.CodeMirror ::-moz-selection { background: #cfc; }
+.cm-s-mdn-like div.CodeMirror-selected { background: #cfc; }
+.cm-s-mdn-like .CodeMirror-line::selection, .cm-s-mdn-like .CodeMirror-line > span::selection, .cm-s-mdn-like .CodeMirror-line > span > span::selection { background: #cfc; }
+.cm-s-mdn-like .CodeMirror-line::-moz-selection, .cm-s-mdn-like .CodeMirror-line > span::-moz-selection, .cm-s-mdn-like .CodeMirror-line > span > span::-moz-selection { background: #cfc; }
.cm-s-mdn-like .CodeMirror-gutters { background: #f8f8f8; border-left: 6px solid rgba(0,83,159,0.65); color: #333; }
.cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; padding-left: 8px; }
-div.cm-s-mdn-like .CodeMirror-cursor { border-left: 2px solid #222; }
+.cm-s-mdn-like .CodeMirror-cursor { border-left: 2px solid #222; }
-.cm-s-mdn-like .cm-keyword { color: #6262FF; }
+.cm-s-mdn-like .cm-keyword { color: #6262FF; }
.cm-s-mdn-like .cm-atom { color: #F90; }
.cm-s-mdn-like .cm-number { color: #ca7841; }
.cm-s-mdn-like .cm-def { color: #8DA6CE; }
@@ -37,10 +37,10 @@ div.cm-s-mdn-like .CodeMirror-cursor { border-left: 2px solid #222; }
.cm-s-mdn-like .cm-attribute { color: #d6bb6d; } /*?*/
.cm-s-mdn-like .cm-header { color: #FF6400; }
.cm-s-mdn-like .cm-hr { color: #AEAEAE; }
-.cm-s-mdn-like .cm-link { color:#ad9361; font-style:italic; text-decoration:none; }
+.cm-s-mdn-like .cm-link { color:#ad9361; font-style:italic; text-decoration:none; }
.cm-s-mdn-like .cm-error { border-bottom: 1px solid red; }
-div.cm-s-mdn-like .CodeMirror-activeline-background {background: #efefff;}
-div.cm-s-mdn-like span.CodeMirror-matchingbracket {outline:1px solid grey; color: inherit;}
+div.cm-s-mdn-like .CodeMirror-activeline-background { background: #efefff; }
+div.cm-s-mdn-like span.CodeMirror-matchingbracket { outline:1px solid grey; color: inherit; }
.cm-s-mdn-like.CodeMirror { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAAAyCAYAAAAp8UeFAAAHvklEQVR42s2b63bcNgyEQZCSHCdt2vd/0tWF7I+Q6XgMXiTtuvU5Pl57ZQKkKHzEAOtF5KeIJBGJ8uvL599FRFREZhFx8DeXv8trn68RuGaC8TRfo3SNp9dlDDHedyLyTUTeRWStXKPZrjtpZxaRw5hPqozRs1N8/enzIiQRWcCgy4MUA0f+XWliDhyL8Lfyvx7ei/Ae3iQFHyw7U/59pQVIMEEPEz0G7XiwdRjzSfC3UTtz9vchIntxvry5iMgfIhJoEflOz2CQr3F5h/HfeFe+GTdLaKcu9L8LTeQb/R/7GgbsfKedyNdoHsN31uRPWrfZ5wsj/NzzRQHuToIdU3ahwnsKPxXCjJITuOsi7XLc7SG/v5GdALs7wf8JjTFiB5+QvTEfRyGOfX3Lrx8wxyQi3sNq46O7QahQiCsRFgqddjBouVEHOKDgXAQHD9gJCr5sMKkEdjwsarG/ww3BMHBU7OBjXnzdyY7SfCxf5/z6ATccrwlKuwC/jhznnPF4CgVzhhVf4xp2EixcBActO75iZ8/fM9zAs2OMzKdslgXWJ9XG8PQoOAMA5fGcsvORgv0doBXyHrCwfLJAOwo71QLNkb8n2Pl6EWiR7OCibtkPaz4Kc/0NNAze2gju3zOwekALDaCFPI5vjPFmgGY5AZqyGEvH1x7QfIb8YtxMnA/b+QQ0aQDAwc6JMFg8CbQZ4qoYEEHbRwNojuK3EHwd7VALSgq+MNDKzfT58T8qdpADrgW0GmgcAS1lhzztJmkAzcPNOQbsWEALBDSlMKUG0Eq4CLAQWvEVQ9WU57gZJwZtgPO3r9oBTQ9WO8TjqXINx8R0EYpiZEUWOF3FxkbJkgU9B2f41YBrIj5ZfsQa0M5kTgiAAqM3ShXLgu8XMqcrQBvJ0CL5pnTsfMB13oB8athpAq2XOQmcGmoACCLydx7nToa23ATaSIY2ichfOdPTGxlasXMLaL0MLZAOwAKIM+y8CmicobGdCcbbK9DzN+yYGVoNNI5iUKTMyYOjPse4A8SM1MmcXgU0toOq1yO/v8FOxlASyc7TgeYaAMBJHcY1CcCwGI/TK4AmDbDyKYBBtFUkRwto8gygiQEaByFgJ00BH2M8JWwQS1nafDXQCidWyOI8AcjDCSjCLk8ngObuAm3JAHAdubAmOaK06V8MNEsKPJOhobSprwQa6gD7DclRQdqcwL4zxqgBrQcabUiBLclRDKAlWp+etPkBaNMA0AKlrHwTdEByZAA4GM+SNluSY6wAzcMNewxmgig5Ks0nkrSpBvSaQHMdKTBAnLojOdYyGpQ254602ZILPdTD1hdlggdIm74jbTp8vDwF5ZYUeLWGJpWsh6XNyXgcYwVoJQTEhhTYkxzZjiU5npU2TaB979TQehlaAVq4kaGpiPwwwLkYUuBbQwocyQTv1tA0+1UFWoJF3iv1oq+qoSk8EQdJmwHkziIF7oOZk14EGitibAdjLYYK78H5vZOhtWpoI0ATGHs0Q8OMb4Ey+2bU2UYztCtA0wFAs7TplGLRVQCcqaFdGSPCeTI1QNIC52iWNzof6Uib7xjEp07mNNoUYmVosVItHrHzRlLgBn9LFyRHaQCtVUMbtTNhoXWiTOO9k/V8BdAc1Oq0ArSQs6/5SU0hckNy9NnXqQY0PGYo5dWJ7nINaN6o958FWin27aBaWRka1r5myvLOAm0j30eBJqCxHLReVclxhxOEN2JfDWjxBtAC7MIH1fVaGdoOp4qJYDgKtKPSFNID2gSnGldrCqkFZ+5UeQXQBIRrSwocbdZYQT/2LwRahBPBXoHrB8nxaGROST62DKUbQOMMzZIC9abkuELfQzQALWTnDNAm8KHWFOJgJ5+SHIvTPcmx1xQyZRhNL5Qci689aXMEaN/uNIWkEwDAvFpOZmgsBaaGnbs1NPa1Jm32gBZAIh1pCtG7TSH4aE0y1uVY4uqoFPisGlpP2rSA5qTecWn5agK6BzSpgAyD+wFaqhnYoSZ1Vwr8CmlTQbrcO3ZaX0NAEyMbYaAlyquFoLKK3SPby9CeVUPThrSJmkCAE0CrKUQadi4DrdSlWhmah0YL9z9vClH59YGbHx1J8VZTyAjQepJjmXwAKTDQI3omc3p1U4gDUf6RfcdYfrUp5ClAi2J3Ba6UOXGo+K+bQrjjssitG2SJzshaLwMtXgRagUNpYYoVkMSBLM+9GGiJZMvduG6DRZ4qc04DMPtQQxOjEtACmhO7K1AbNbQDEggZyJwscFpAGwENhoBeUwh3bWolhe8BTYVKxQEWrSUn/uhcM5KhvUu/+eQu0Lzhi+VrK0PrZZNDQKs9cpYUuFYgMVpD4/NxenJTiMCNqdUEUf1qZWjppLT5qSkkUZbCwkbZMSuVnu80hfSkzRbQeqCZSAh6huR4VtoM2gHAlLf72smuWgE+VV7XpE25Ab2WFDgyhnSuKbs4GuGzCjR+tIoUuMFg3kgcWKLTwRqanJQ2W00hAsenfaApRC42hbCvK1SlE0HtE9BGgneJO+ELamitD1YjjOYnNYVcraGhtKkW0EqVVeDx733I2NH581k1NNxNLG0i0IJ8/NjVaOZ0tYZ2Vtr0Xv7tPV3hkWp9EFkgS/J0vosngTaSoaG06WHi+xObQkaAdlbanP8B2+2l0f90LmUAAAAASUVORK5CYII=); }
diff --git a/public/vendor/codemirror/theme/midnight.css b/public/vendor/codemirror/theme/midnight.css
index 296af4f7..e41f1056 100755..100644
--- a/public/vendor/codemirror/theme/midnight.css
+++ b/public/vendor/codemirror/theme/midnight.css
@@ -5,41 +5,39 @@
.cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67 !important; }
/*<!--activeline-->*/
-.cm-s-midnight .CodeMirror-activeline-background {background: #253540 !important;}
+.cm-s-midnight .CodeMirror-activeline-background { background: #253540; }
.cm-s-midnight.CodeMirror {
background: #0F192A;
color: #D1EDFF;
}
-.cm-s-midnight.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
+.cm-s-midnight.CodeMirror { border-top: 1px solid black; border-bottom: 1px solid black; }
-.cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;}
-.cm-s-midnight.CodeMirror ::selection { background: rgba(49, 77, 103, .99); }
-.cm-s-midnight.CodeMirror ::-moz-selection { background: rgba(49, 77, 103, .99); }
-.cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;}
+.cm-s-midnight div.CodeMirror-selected { background: #314D67; }
+.cm-s-midnight .CodeMirror-line::selection, .cm-s-midnight .CodeMirror-line > span::selection, .cm-s-midnight .CodeMirror-line > span > span::selection { background: rgba(49, 77, 103, .99); }
+.cm-s-midnight .CodeMirror-line::-moz-selection, .cm-s-midnight .CodeMirror-line > span::-moz-selection, .cm-s-midnight .CodeMirror-line > span > span::-moz-selection { background: rgba(49, 77, 103, .99); }
+.cm-s-midnight .CodeMirror-gutters { background: #0F192A; border-right: 1px solid; }
.cm-s-midnight .CodeMirror-guttermarker { color: white; }
.cm-s-midnight .CodeMirror-guttermarker-subtle { color: #d0d0d0; }
-.cm-s-midnight .CodeMirror-linenumber {color: #D0D0D0;}
-.cm-s-midnight .CodeMirror-cursor {
- border-left: 1px solid #F8F8F0 !important;
-}
-
-.cm-s-midnight span.cm-comment {color: #428BDD;}
-.cm-s-midnight span.cm-atom {color: #AE81FF;}
-.cm-s-midnight span.cm-number {color: #D1EDFF;}
-
-.cm-s-midnight span.cm-property, .cm-s-midnight span.cm-attribute {color: #A6E22E;}
-.cm-s-midnight span.cm-keyword {color: #E83737;}
-.cm-s-midnight span.cm-string {color: #1DC116;}
-
-.cm-s-midnight span.cm-variable {color: #FFAA3E;}
-.cm-s-midnight span.cm-variable-2 {color: #FFAA3E;}
-.cm-s-midnight span.cm-def {color: #4DD;}
-.cm-s-midnight span.cm-bracket {color: #D1EDFF;}
-.cm-s-midnight span.cm-tag {color: #449;}
-.cm-s-midnight span.cm-link {color: #AE81FF;}
-.cm-s-midnight span.cm-error {background: #F92672; color: #F8F8F0;}
+.cm-s-midnight .CodeMirror-linenumber { color: #D0D0D0; }
+.cm-s-midnight .CodeMirror-cursor { border-left: 1px solid #F8F8F0; }
+
+.cm-s-midnight span.cm-comment { color: #428BDD; }
+.cm-s-midnight span.cm-atom { color: #AE81FF; }
+.cm-s-midnight span.cm-number { color: #D1EDFF; }
+
+.cm-s-midnight span.cm-property, .cm-s-midnight span.cm-attribute { color: #A6E22E; }
+.cm-s-midnight span.cm-keyword { color: #E83737; }
+.cm-s-midnight span.cm-string { color: #1DC116; }
+
+.cm-s-midnight span.cm-variable { color: #FFAA3E; }
+.cm-s-midnight span.cm-variable-2 { color: #FFAA3E; }
+.cm-s-midnight span.cm-def { color: #4DD; }
+.cm-s-midnight span.cm-bracket { color: #D1EDFF; }
+.cm-s-midnight span.cm-tag { color: #449; }
+.cm-s-midnight span.cm-link { color: #AE81FF; }
+.cm-s-midnight span.cm-error { background: #F92672; color: #F8F8F0; }
.cm-s-midnight .CodeMirror-matchingbracket {
text-decoration: underline;
diff --git a/public/vendor/codemirror/theme/monokai.css b/public/vendor/codemirror/theme/monokai.css
index b9d4c6c3..7c8a4c5d 100755..100644
--- a/public/vendor/codemirror/theme/monokai.css
+++ b/public/vendor/codemirror/theme/monokai.css
@@ -1,34 +1,35 @@
/* Based on Sublime Text's Monokai theme */
-.cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;}
-.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;}
-.cm-s-monokai.CodeMirror ::selection { background: rgba(73, 72, 62, .99); }
-.cm-s-monokai.CodeMirror ::-moz-selection { background: rgba(73, 72, 62, .99); }
-.cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;}
+.cm-s-monokai.CodeMirror { background: #272822; color: #f8f8f2; }
+.cm-s-monokai div.CodeMirror-selected { background: #49483E; }
+.cm-s-monokai .CodeMirror-line::selection, .cm-s-monokai .CodeMirror-line > span::selection, .cm-s-monokai .CodeMirror-line > span > span::selection { background: rgba(73, 72, 62, .99); }
+.cm-s-monokai .CodeMirror-line::-moz-selection, .cm-s-monokai .CodeMirror-line > span::-moz-selection, .cm-s-monokai .CodeMirror-line > span > span::-moz-selection { background: rgba(73, 72, 62, .99); }
+.cm-s-monokai .CodeMirror-gutters { background: #272822; border-right: 0px; }
.cm-s-monokai .CodeMirror-guttermarker { color: white; }
.cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; }
-.cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;}
-.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}
+.cm-s-monokai .CodeMirror-linenumber { color: #d0d0d0; }
+.cm-s-monokai .CodeMirror-cursor { border-left: 1px solid #f8f8f0; }
-.cm-s-monokai span.cm-comment {color: #75715e;}
-.cm-s-monokai span.cm-atom {color: #ae81ff;}
-.cm-s-monokai span.cm-number {color: #ae81ff;}
+.cm-s-monokai span.cm-comment { color: #75715e; }
+.cm-s-monokai span.cm-atom { color: #ae81ff; }
+.cm-s-monokai span.cm-number { color: #ae81ff; }
-.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;}
-.cm-s-monokai span.cm-keyword {color: #f92672;}
-.cm-s-monokai span.cm-string {color: #e6db74;}
+.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute { color: #a6e22e; }
+.cm-s-monokai span.cm-keyword { color: #f92672; }
+.cm-s-monokai span.cm-builtin { color: #66d9ef; }
+.cm-s-monokai span.cm-string { color: #e6db74; }
-.cm-s-monokai span.cm-variable {color: #f8f8f2;}
-.cm-s-monokai span.cm-variable-2 {color: #9effff;}
-.cm-s-monokai span.cm-variable-3 {color: #66d9ef;}
-.cm-s-monokai span.cm-def {color: #fd971f;}
-.cm-s-monokai span.cm-bracket {color: #f8f8f2;}
-.cm-s-monokai span.cm-tag {color: #f92672;}
-.cm-s-monokai span.cm-header {color: #ae81ff;}
-.cm-s-monokai span.cm-link {color: #ae81ff;}
-.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}
+.cm-s-monokai span.cm-variable { color: #f8f8f2; }
+.cm-s-monokai span.cm-variable-2 { color: #9effff; }
+.cm-s-monokai span.cm-variable-3 { color: #66d9ef; }
+.cm-s-monokai span.cm-def { color: #fd971f; }
+.cm-s-monokai span.cm-bracket { color: #f8f8f2; }
+.cm-s-monokai span.cm-tag { color: #f92672; }
+.cm-s-monokai span.cm-header { color: #ae81ff; }
+.cm-s-monokai span.cm-link { color: #ae81ff; }
+.cm-s-monokai span.cm-error { background: #f92672; color: #f8f8f0; }
-.cm-s-monokai .CodeMirror-activeline-background, .cm-s-monokai .CodeMirror-activeline .CodeMirror-gutter-wrapper {background: #373831 !important;}
+.cm-s-monokai .CodeMirror-activeline-background { background: #373831; }
.cm-s-monokai .CodeMirror-matchingbracket {
text-decoration: underline;
color: white !important;
diff --git a/public/vendor/codemirror/theme/neat.css b/public/vendor/codemirror/theme/neat.css
index 115083b8..4267b1a3 100755..100644
--- a/public/vendor/codemirror/theme/neat.css
+++ b/public/vendor/codemirror/theme/neat.css
@@ -5,8 +5,8 @@
.cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; }
.cm-s-neat span.cm-variable { color: black; }
.cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; }
-.cm-s-neat span.cm-meta {color: #555;}
+.cm-s-neat span.cm-meta { color: #555; }
.cm-s-neat span.cm-link { color: #3a3; }
-.cm-s-neat .CodeMirror-activeline-background {background: #e8f2ff !important;}
-.cm-s-neat .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;}
+.cm-s-neat .CodeMirror-activeline-background { background: #e8f2ff; }
+.cm-s-neat .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; }
diff --git a/public/vendor/codemirror/theme/neo.css b/public/vendor/codemirror/theme/neo.css
index cecaaf28..b28d5c65 100755..100644
--- a/public/vendor/codemirror/theme/neo.css
+++ b/public/vendor/codemirror/theme/neo.css
@@ -7,12 +7,12 @@
color:#2e383c;
line-height:1.4375;
}
-.cm-s-neo .cm-comment {color:#75787b}
-.cm-s-neo .cm-keyword, .cm-s-neo .cm-property {color:#1d75b3}
-.cm-s-neo .cm-atom,.cm-s-neo .cm-number {color:#75438a}
-.cm-s-neo .cm-node,.cm-s-neo .cm-tag {color:#9c3328}
-.cm-s-neo .cm-string {color:#b35e14}
-.cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier {color:#047d65}
+.cm-s-neo .cm-comment { color:#75787b; }
+.cm-s-neo .cm-keyword, .cm-s-neo .cm-property { color:#1d75b3; }
+.cm-s-neo .cm-atom,.cm-s-neo .cm-number { color:#75438a; }
+.cm-s-neo .cm-node,.cm-s-neo .cm-tag { color:#9c3328; }
+.cm-s-neo .cm-string { color:#b35e14; }
+.cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier { color:#047d65; }
/* Editor styling */
@@ -35,7 +35,7 @@
.cm-s-neo .CodeMirror-guttermarker { color: #1d75b3; }
.cm-s-neo .CodeMirror-guttermarker-subtle { color: #e0e2e5; }
-.cm-s-neo div.CodeMirror-cursor {
+.cm-s-neo .CodeMirror-cursor {
width: auto;
border: 0;
background: rgba(155,157,162,0.37);
diff --git a/public/vendor/codemirror/theme/night.css b/public/vendor/codemirror/theme/night.css
index 6b2ac6c7..4dbb8662 100755..100644
--- a/public/vendor/codemirror/theme/night.css
+++ b/public/vendor/codemirror/theme/night.css
@@ -1,14 +1,14 @@
/* Loosely based on the Midnight Textmate theme */
.cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; }
-.cm-s-night div.CodeMirror-selected { background: #447 !important; }
-.cm-s-night.CodeMirror ::selection { background: rgba(68, 68, 119, .99); }
-.cm-s-night.CodeMirror ::-moz-selection { background: rgba(68, 68, 119, .99); }
+.cm-s-night div.CodeMirror-selected { background: #447; }
+.cm-s-night .CodeMirror-line::selection, .cm-s-night .CodeMirror-line > span::selection, .cm-s-night .CodeMirror-line > span > span::selection { background: rgba(68, 68, 119, .99); }
+.cm-s-night .CodeMirror-line::-moz-selection, .cm-s-night .CodeMirror-line > span::-moz-selection, .cm-s-night .CodeMirror-line > span > span::-moz-selection { background: rgba(68, 68, 119, .99); }
.cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }
.cm-s-night .CodeMirror-guttermarker { color: white; }
.cm-s-night .CodeMirror-guttermarker-subtle { color: #bbb; }
.cm-s-night .CodeMirror-linenumber { color: #f8f8f8; }
-.cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; }
+.cm-s-night .CodeMirror-cursor { border-left: 1px solid white; }
.cm-s-night span.cm-comment { color: #6900a1; }
.cm-s-night span.cm-atom { color: #845dc4; }
@@ -24,5 +24,5 @@
.cm-s-night span.cm-link { color: #845dc4; }
.cm-s-night span.cm-error { color: #9d1e15; }
-.cm-s-night .CodeMirror-activeline-background {background: #1C005A !important;}
-.cm-s-night .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}
+.cm-s-night .CodeMirror-activeline-background { background: #1C005A; }
+.cm-s-night .CodeMirror-matchingbracket { outline:1px solid grey; color:white !important; }
diff --git a/public/vendor/codemirror/theme/paraiso-dark.css b/public/vendor/codemirror/theme/paraiso-dark.css
index af914b60..aa9d207e 100755..100644
--- a/public/vendor/codemirror/theme/paraiso-dark.css
+++ b/public/vendor/codemirror/theme/paraiso-dark.css
@@ -8,31 +8,31 @@
*/
-.cm-s-paraiso-dark.CodeMirror {background: #2f1e2e; color: #b9b6b0;}
-.cm-s-paraiso-dark div.CodeMirror-selected {background: #41323f !important;}
-.cm-s-paraiso-dark.CodeMirror ::selection { background: rgba(65, 50, 63, .99); }
-.cm-s-paraiso-dark.CodeMirror ::-moz-selection { background: rgba(65, 50, 63, .99); }
-.cm-s-paraiso-dark .CodeMirror-gutters {background: #2f1e2e; border-right: 0px;}
+.cm-s-paraiso-dark.CodeMirror { background: #2f1e2e; color: #b9b6b0; }
+.cm-s-paraiso-dark div.CodeMirror-selected { background: #41323f; }
+.cm-s-paraiso-dark .CodeMirror-line::selection, .cm-s-paraiso-dark .CodeMirror-line > span::selection, .cm-s-paraiso-dark .CodeMirror-line > span > span::selection { background: rgba(65, 50, 63, .99); }
+.cm-s-paraiso-dark .CodeMirror-line::-moz-selection, .cm-s-paraiso-dark .CodeMirror-line > span::-moz-selection, .cm-s-paraiso-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(65, 50, 63, .99); }
+.cm-s-paraiso-dark .CodeMirror-gutters { background: #2f1e2e; border-right: 0px; }
.cm-s-paraiso-dark .CodeMirror-guttermarker { color: #ef6155; }
.cm-s-paraiso-dark .CodeMirror-guttermarker-subtle { color: #776e71; }
-.cm-s-paraiso-dark .CodeMirror-linenumber {color: #776e71;}
-.cm-s-paraiso-dark .CodeMirror-cursor {border-left: 1px solid #8d8687 !important;}
-
-.cm-s-paraiso-dark span.cm-comment {color: #e96ba8;}
-.cm-s-paraiso-dark span.cm-atom {color: #815ba4;}
-.cm-s-paraiso-dark span.cm-number {color: #815ba4;}
-
-.cm-s-paraiso-dark span.cm-property, .cm-s-paraiso-dark span.cm-attribute {color: #48b685;}
-.cm-s-paraiso-dark span.cm-keyword {color: #ef6155;}
-.cm-s-paraiso-dark span.cm-string {color: #fec418;}
-
-.cm-s-paraiso-dark span.cm-variable {color: #48b685;}
-.cm-s-paraiso-dark span.cm-variable-2 {color: #06b6ef;}
-.cm-s-paraiso-dark span.cm-def {color: #f99b15;}
-.cm-s-paraiso-dark span.cm-bracket {color: #b9b6b0;}
-.cm-s-paraiso-dark span.cm-tag {color: #ef6155;}
-.cm-s-paraiso-dark span.cm-link {color: #815ba4;}
-.cm-s-paraiso-dark span.cm-error {background: #ef6155; color: #8d8687;}
-
-.cm-s-paraiso-dark .CodeMirror-activeline-background {background: #4D344A !important;}
-.cm-s-paraiso-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
+.cm-s-paraiso-dark .CodeMirror-linenumber { color: #776e71; }
+.cm-s-paraiso-dark .CodeMirror-cursor { border-left: 1px solid #8d8687; }
+
+.cm-s-paraiso-dark span.cm-comment { color: #e96ba8; }
+.cm-s-paraiso-dark span.cm-atom { color: #815ba4; }
+.cm-s-paraiso-dark span.cm-number { color: #815ba4; }
+
+.cm-s-paraiso-dark span.cm-property, .cm-s-paraiso-dark span.cm-attribute { color: #48b685; }
+.cm-s-paraiso-dark span.cm-keyword { color: #ef6155; }
+.cm-s-paraiso-dark span.cm-string { color: #fec418; }
+
+.cm-s-paraiso-dark span.cm-variable { color: #48b685; }
+.cm-s-paraiso-dark span.cm-variable-2 { color: #06b6ef; }
+.cm-s-paraiso-dark span.cm-def { color: #f99b15; }
+.cm-s-paraiso-dark span.cm-bracket { color: #b9b6b0; }
+.cm-s-paraiso-dark span.cm-tag { color: #ef6155; }
+.cm-s-paraiso-dark span.cm-link { color: #815ba4; }
+.cm-s-paraiso-dark span.cm-error { background: #ef6155; color: #8d8687; }
+
+.cm-s-paraiso-dark .CodeMirror-activeline-background { background: #4D344A; }
+.cm-s-paraiso-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
diff --git a/public/vendor/codemirror/theme/paraiso-light.css b/public/vendor/codemirror/theme/paraiso-light.css
index e198066f..ae0c755f 100755..100644
--- a/public/vendor/codemirror/theme/paraiso-light.css
+++ b/public/vendor/codemirror/theme/paraiso-light.css
@@ -8,31 +8,31 @@
*/
-.cm-s-paraiso-light.CodeMirror {background: #e7e9db; color: #41323f;}
-.cm-s-paraiso-light div.CodeMirror-selected {background: #b9b6b0 !important;}
-.cm-s-paraiso-light.CodeMirror ::selection { background: #b9b6b0; }
-.cm-s-paraiso-light.CodeMirror ::-moz-selection { background: #b9b6b0; }
-.cm-s-paraiso-light .CodeMirror-gutters {background: #e7e9db; border-right: 0px;}
+.cm-s-paraiso-light.CodeMirror { background: #e7e9db; color: #41323f; }
+.cm-s-paraiso-light div.CodeMirror-selected { background: #b9b6b0; }
+.cm-s-paraiso-light .CodeMirror-line::selection, .cm-s-paraiso-light .CodeMirror-line > span::selection, .cm-s-paraiso-light .CodeMirror-line > span > span::selection { background: #b9b6b0; }
+.cm-s-paraiso-light .CodeMirror-line::-moz-selection, .cm-s-paraiso-light .CodeMirror-line > span::-moz-selection, .cm-s-paraiso-light .CodeMirror-line > span > span::-moz-selection { background: #b9b6b0; }
+.cm-s-paraiso-light .CodeMirror-gutters { background: #e7e9db; border-right: 0px; }
.cm-s-paraiso-light .CodeMirror-guttermarker { color: black; }
.cm-s-paraiso-light .CodeMirror-guttermarker-subtle { color: #8d8687; }
-.cm-s-paraiso-light .CodeMirror-linenumber {color: #8d8687;}
-.cm-s-paraiso-light .CodeMirror-cursor {border-left: 1px solid #776e71 !important;}
-
-.cm-s-paraiso-light span.cm-comment {color: #e96ba8;}
-.cm-s-paraiso-light span.cm-atom {color: #815ba4;}
-.cm-s-paraiso-light span.cm-number {color: #815ba4;}
-
-.cm-s-paraiso-light span.cm-property, .cm-s-paraiso-light span.cm-attribute {color: #48b685;}
-.cm-s-paraiso-light span.cm-keyword {color: #ef6155;}
-.cm-s-paraiso-light span.cm-string {color: #fec418;}
-
-.cm-s-paraiso-light span.cm-variable {color: #48b685;}
-.cm-s-paraiso-light span.cm-variable-2 {color: #06b6ef;}
-.cm-s-paraiso-light span.cm-def {color: #f99b15;}
-.cm-s-paraiso-light span.cm-bracket {color: #41323f;}
-.cm-s-paraiso-light span.cm-tag {color: #ef6155;}
-.cm-s-paraiso-light span.cm-link {color: #815ba4;}
-.cm-s-paraiso-light span.cm-error {background: #ef6155; color: #776e71;}
-
-.cm-s-paraiso-light .CodeMirror-activeline-background {background: #CFD1C4 !important;}
-.cm-s-paraiso-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
+.cm-s-paraiso-light .CodeMirror-linenumber { color: #8d8687; }
+.cm-s-paraiso-light .CodeMirror-cursor { border-left: 1px solid #776e71; }
+
+.cm-s-paraiso-light span.cm-comment { color: #e96ba8; }
+.cm-s-paraiso-light span.cm-atom { color: #815ba4; }
+.cm-s-paraiso-light span.cm-number { color: #815ba4; }
+
+.cm-s-paraiso-light span.cm-property, .cm-s-paraiso-light span.cm-attribute { color: #48b685; }
+.cm-s-paraiso-light span.cm-keyword { color: #ef6155; }
+.cm-s-paraiso-light span.cm-string { color: #fec418; }
+
+.cm-s-paraiso-light span.cm-variable { color: #48b685; }
+.cm-s-paraiso-light span.cm-variable-2 { color: #06b6ef; }
+.cm-s-paraiso-light span.cm-def { color: #f99b15; }
+.cm-s-paraiso-light span.cm-bracket { color: #41323f; }
+.cm-s-paraiso-light span.cm-tag { color: #ef6155; }
+.cm-s-paraiso-light span.cm-link { color: #815ba4; }
+.cm-s-paraiso-light span.cm-error { background: #ef6155; color: #776e71; }
+
+.cm-s-paraiso-light .CodeMirror-activeline-background { background: #CFD1C4; }
+.cm-s-paraiso-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
diff --git a/public/vendor/codemirror/theme/pastel-on-dark.css b/public/vendor/codemirror/theme/pastel-on-dark.css
index 0d06f632..71975092 100755..100644
--- a/public/vendor/codemirror/theme/pastel-on-dark.css
+++ b/public/vendor/codemirror/theme/pastel-on-dark.css
@@ -13,9 +13,9 @@
line-height: 1.5;
font-size: 14px;
}
-.cm-s-pastel-on-dark div.CodeMirror-selected { background: rgba(221,240,255,0.2) !important; }
-.cm-s-pastel-on-dark.CodeMirror ::selection { background: rgba(221,240,255,0.2); }
-.cm-s-pastel-on-dark.CodeMirror ::-moz-selection { background: rgba(221,240,255,0.2); }
+.cm-s-pastel-on-dark div.CodeMirror-selected { background: rgba(221,240,255,0.2); }
+.cm-s-pastel-on-dark .CodeMirror-line::selection, .cm-s-pastel-on-dark .CodeMirror-line > span::selection, .cm-s-pastel-on-dark .CodeMirror-line > span > span::selection { background: rgba(221,240,255,0.2); }
+.cm-s-pastel-on-dark .CodeMirror-line::-moz-selection, .cm-s-pastel-on-dark .CodeMirror-line > span::-moz-selection, .cm-s-pastel-on-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(221,240,255,0.2); }
.cm-s-pastel-on-dark .CodeMirror-gutters {
background: #34302f;
@@ -25,7 +25,7 @@
.cm-s-pastel-on-dark .CodeMirror-guttermarker { color: white; }
.cm-s-pastel-on-dark .CodeMirror-guttermarker-subtle { color: #8F938F; }
.cm-s-pastel-on-dark .CodeMirror-linenumber { color: #8F938F; }
-.cm-s-pastel-on-dark .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; }
+.cm-s-pastel-on-dark .CodeMirror-cursor { border-left: 1px solid #A7A7A7; }
.cm-s-pastel-on-dark span.cm-comment { color: #A6C6FF; }
.cm-s-pastel-on-dark span.cm-atom { color: #DE8E30; }
.cm-s-pastel-on-dark span.cm-number { color: #CCCCCC; }
@@ -45,7 +45,7 @@
background: #757aD8;
color: #f8f8f0;
}
-.cm-s-pastel-on-dark .CodeMirror-activeline-background { background: rgba(255, 255, 255, 0.031) !important; }
+.cm-s-pastel-on-dark .CodeMirror-activeline-background { background: rgba(255, 255, 255, 0.031); }
.cm-s-pastel-on-dark .CodeMirror-matchingbracket {
border: 1px solid rgba(255,255,255,0.25);
color: #8F938F !important;
diff --git a/public/vendor/codemirror/theme/railscasts.css b/public/vendor/codemirror/theme/railscasts.css
new file mode 100644
index 00000000..aeff0449
--- /dev/null
+++ b/public/vendor/codemirror/theme/railscasts.css
@@ -0,0 +1,34 @@
+/*
+
+ Name: Railscasts
+ Author: Ryan Bates (http://railscasts.com)
+
+ CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)
+ Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
+
+*/
+
+.cm-s-railscasts.CodeMirror {background: #2b2b2b; color: #f4f1ed;}
+.cm-s-railscasts div.CodeMirror-selected {background: #272935 !important;}
+.cm-s-railscasts .CodeMirror-gutters {background: #2b2b2b; border-right: 0px;}
+.cm-s-railscasts .CodeMirror-linenumber {color: #5a647e;}
+.cm-s-railscasts .CodeMirror-cursor {border-left: 1px solid #d4cfc9 !important;}
+
+.cm-s-railscasts span.cm-comment {color: #bc9458;}
+.cm-s-railscasts span.cm-atom {color: #b6b3eb;}
+.cm-s-railscasts span.cm-number {color: #b6b3eb;}
+
+.cm-s-railscasts span.cm-property, .cm-s-railscasts span.cm-attribute {color: #a5c261;}
+.cm-s-railscasts span.cm-keyword {color: #da4939;}
+.cm-s-railscasts span.cm-string {color: #ffc66d;}
+
+.cm-s-railscasts span.cm-variable {color: #a5c261;}
+.cm-s-railscasts span.cm-variable-2 {color: #6d9cbe;}
+.cm-s-railscasts span.cm-def {color: #cc7833;}
+.cm-s-railscasts span.cm-error {background: #da4939; color: #d4cfc9;}
+.cm-s-railscasts span.cm-bracket {color: #f4f1ed;}
+.cm-s-railscasts span.cm-tag {color: #da4939;}
+.cm-s-railscasts span.cm-link {color: #b6b3eb;}
+
+.cm-s-railscasts .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
+.cm-s-railscasts .CodeMirror-activeline-background { background: #303040; }
diff --git a/public/vendor/codemirror/theme/rubyblue.css b/public/vendor/codemirror/theme/rubyblue.css
index d2fc0ecd..76d33e77 100755..100644
--- a/public/vendor/codemirror/theme/rubyblue.css
+++ b/public/vendor/codemirror/theme/rubyblue.css
@@ -1,12 +1,12 @@
.cm-s-rubyblue.CodeMirror { background: #112435; color: white; }
-.cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; }
-.cm-s-rubyblue.CodeMirror ::selection { background: rgba(56, 86, 111, 0.99); }
-.cm-s-rubyblue.CodeMirror ::-moz-selection { background: rgba(56, 86, 111, 0.99); }
+.cm-s-rubyblue div.CodeMirror-selected { background: #38566F; }
+.cm-s-rubyblue .CodeMirror-line::selection, .cm-s-rubyblue .CodeMirror-line > span::selection, .cm-s-rubyblue .CodeMirror-line > span > span::selection { background: rgba(56, 86, 111, 0.99); }
+.cm-s-rubyblue .CodeMirror-line::-moz-selection, .cm-s-rubyblue .CodeMirror-line > span::-moz-selection, .cm-s-rubyblue .CodeMirror-line > span > span::-moz-selection { background: rgba(56, 86, 111, 0.99); }
.cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; }
.cm-s-rubyblue .CodeMirror-guttermarker { color: white; }
.cm-s-rubyblue .CodeMirror-guttermarker-subtle { color: #3E7087; }
.cm-s-rubyblue .CodeMirror-linenumber { color: white; }
-.cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; }
+.cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white; }
.cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; }
.cm-s-rubyblue span.cm-atom { color: #F4C20B; }
@@ -22,4 +22,4 @@
.cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; }
.cm-s-rubyblue span.cm-error { color: #AF2018; }
-.cm-s-rubyblue .CodeMirror-activeline-background {background: #173047 !important;}
+.cm-s-rubyblue .CodeMirror-activeline-background { background: #173047; }
diff --git a/public/vendor/codemirror/theme/seti.css b/public/vendor/codemirror/theme/seti.css
new file mode 100644
index 00000000..6632d3fc
--- /dev/null
+++ b/public/vendor/codemirror/theme/seti.css
@@ -0,0 +1,44 @@
+/*
+
+ Name: seti
+ Author: Michael Kaminsky (http://github.com/mkaminsky11)
+
+ Original seti color scheme by Jesse Weed (https://github.com/jesseweed/seti-syntax)
+
+*/
+
+
+.cm-s-seti.CodeMirror {
+ background-color: #151718 !important;
+ color: #CFD2D1 !important;
+ border: none;
+}
+.cm-s-seti .CodeMirror-gutters {
+ color: #404b53;
+ background-color: #0E1112;
+ border: none;
+}
+.cm-s-seti .CodeMirror-cursor { border-left: solid thin #f8f8f0; }
+.cm-s-seti .CodeMirror-linenumber { color: #6D8A88; }
+.cm-s-seti.CodeMirror-focused div.CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }
+.cm-s-seti .CodeMirror-line::selection, .cm-s-seti .CodeMirror-line > span::selection, .cm-s-seti .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); }
+.cm-s-seti .CodeMirror-line::-moz-selection, .cm-s-seti .CodeMirror-line > span::-moz-selection, .cm-s-seti .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); }
+.cm-s-seti span.cm-comment { color: #41535b; }
+.cm-s-seti span.cm-string, .cm-s-seti span.cm-string-2 { color: #55b5db; }
+.cm-s-seti span.cm-number { color: #cd3f45; }
+.cm-s-seti span.cm-variable { color: #55b5db; }
+.cm-s-seti span.cm-variable-2 { color: #a074c4; }
+.cm-s-seti span.cm-def { color: #55b5db; }
+.cm-s-seti span.cm-keyword { color: #ff79c6; }
+.cm-s-seti span.cm-operator { color: #9fca56; }
+.cm-s-seti span.cm-keyword { color: #e6cd69; }
+.cm-s-seti span.cm-atom { color: #cd3f45; }
+.cm-s-seti span.cm-meta { color: #55b5db; }
+.cm-s-seti span.cm-tag { color: #55b5db; }
+.cm-s-seti span.cm-attribute { color: #9fca56; }
+.cm-s-seti span.cm-qualifier { color: #9fca56; }
+.cm-s-seti span.cm-property { color: #a074c4; }
+.cm-s-seti span.cm-variable-3 { color: #9fca56; }
+.cm-s-seti span.cm-builtin { color: #9fca56; }
+.cm-s-seti .CodeMirror-activeline-background { background: #101213; }
+.cm-s-seti .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
diff --git a/public/vendor/codemirror/theme/solarized.css b/public/vendor/codemirror/theme/solarized.css
index 1f1dedac..7882c937 100755..100644
--- a/public/vendor/codemirror/theme/solarized.css
+++ b/public/vendor/codemirror/theme/solarized.css
@@ -50,7 +50,7 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
.cm-s-solarized .cm-header { color: #586e75; }
.cm-s-solarized .cm-quote { color: #93a1a1; }
-.cm-s-solarized .cm-keyword { color: #cb4b16 }
+.cm-s-solarized .cm-keyword { color: #cb4b16; }
.cm-s-solarized .cm-atom { color: #d33682; }
.cm-s-solarized .cm-number { color: #d33682; }
.cm-s-solarized .cm-def { color: #2aa198; }
@@ -60,7 +60,7 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
.cm-s-solarized .cm-variable-3 { color: #6c71c4; }
.cm-s-solarized .cm-property { color: #2aa198; }
-.cm-s-solarized .cm-operator {color: #6c71c4;}
+.cm-s-solarized .cm-operator { color: #6c71c4; }
.cm-s-solarized .cm-comment { color: #586e75; font-style:italic; }
@@ -73,8 +73,8 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
.cm-s-solarized .cm-bracket { color: #cb4b16; }
.cm-s-solarized .CodeMirror-matchingbracket { color: #859900; }
.cm-s-solarized .CodeMirror-nonmatchingbracket { color: #dc322f; }
-.cm-s-solarized .cm-tag { color: #93a1a1 }
-.cm-s-solarized .cm-attribute { color: #2aa198; }
+.cm-s-solarized .cm-tag { color: #93a1a1; }
+.cm-s-solarized .cm-attribute { color: #2aa198; }
.cm-s-solarized .cm-hr {
color: transparent;
border-top: 1px solid #586e75;
@@ -94,13 +94,13 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
border-bottom: 1px dotted #dc322f;
}
-.cm-s-solarized.cm-s-dark .CodeMirror-selected { background: #073642; }
+.cm-s-solarized.cm-s-dark div.CodeMirror-selected { background: #073642; }
.cm-s-solarized.cm-s-dark.CodeMirror ::selection { background: rgba(7, 54, 66, 0.99); }
-.cm-s-solarized.cm-s-dark.CodeMirror ::-moz-selection { background: rgba(7, 54, 66, 0.99); }
+.cm-s-solarized.cm-s-dark .CodeMirror-line::-moz-selection, .cm-s-dark .CodeMirror-line > span::-moz-selection, .cm-s-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(7, 54, 66, 0.99); }
-.cm-s-solarized.cm-s-light .CodeMirror-selected { background: #eee8d5; }
-.cm-s-solarized.cm-s-light.CodeMirror ::selection { background: #eee8d5; }
-.cm-s-solarized.cm-s-lightCodeMirror ::-moz-selection { background: #eee8d5; }
+.cm-s-solarized.cm-s-light div.CodeMirror-selected { background: #eee8d5; }
+.cm-s-solarized.cm-s-light .CodeMirror-line::selection, .cm-s-light .CodeMirror-line > span::selection, .cm-s-light .CodeMirror-line > span > span::selection { background: #eee8d5; }
+.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection, .cm-s-ligh .CodeMirror-line > span::-moz-selection, .cm-s-ligh .CodeMirror-line > span > span::-moz-selection { background: #eee8d5; }
/* Editor styling */
@@ -149,9 +149,7 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
color: #586e75;
}
-.cm-s-solarized .CodeMirror-lines .CodeMirror-cursor {
- border-left: 1px solid #819090;
-}
+.cm-s-solarized .CodeMirror-cursor { border-left: 1px solid #819090; }
/*
Active line. Negative margin compensates left padding of the text in the
diff --git a/public/vendor/codemirror/theme/the-matrix.css b/public/vendor/codemirror/theme/the-matrix.css
index f29b22b0..3912a8db 100755..100644
--- a/public/vendor/codemirror/theme/the-matrix.css
+++ b/public/vendor/codemirror/theme/the-matrix.css
@@ -1,30 +1,30 @@
.cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; }
-.cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D !important; }
-.cm-s-the-matrix.CodeMirror ::selection { background: rgba(45, 45, 45, 0.99); }
-.cm-s-the-matrix.CodeMirror ::-moz-selection { background: rgba(45, 45, 45, 0.99); }
+.cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D; }
+.cm-s-the-matrix .CodeMirror-line::selection, .cm-s-the-matrix .CodeMirror-line > span::selection, .cm-s-the-matrix .CodeMirror-line > span > span::selection { background: rgba(45, 45, 45, 0.99); }
+.cm-s-the-matrix .CodeMirror-line::-moz-selection, .cm-s-the-matrix .CodeMirror-line > span::-moz-selection, .cm-s-the-matrix .CodeMirror-line > span > span::-moz-selection { background: rgba(45, 45, 45, 0.99); }
.cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; }
.cm-s-the-matrix .CodeMirror-guttermarker { color: #0f0; }
.cm-s-the-matrix .CodeMirror-guttermarker-subtle { color: white; }
.cm-s-the-matrix .CodeMirror-linenumber { color: #FFFFFF; }
-.cm-s-the-matrix .CodeMirror-cursor { border-left: 1px solid #00FF00 !important; }
+.cm-s-the-matrix .CodeMirror-cursor { border-left: 1px solid #00FF00; }
-.cm-s-the-matrix span.cm-keyword {color: #008803; font-weight: bold;}
-.cm-s-the-matrix span.cm-atom {color: #3FF;}
-.cm-s-the-matrix span.cm-number {color: #FFB94F;}
-.cm-s-the-matrix span.cm-def {color: #99C;}
-.cm-s-the-matrix span.cm-variable {color: #F6C;}
-.cm-s-the-matrix span.cm-variable-2 {color: #C6F;}
-.cm-s-the-matrix span.cm-variable-3 {color: #96F;}
-.cm-s-the-matrix span.cm-property {color: #62FFA0;}
-.cm-s-the-matrix span.cm-operator {color: #999}
-.cm-s-the-matrix span.cm-comment {color: #CCCCCC;}
-.cm-s-the-matrix span.cm-string {color: #39C;}
-.cm-s-the-matrix span.cm-meta {color: #C9F;}
-.cm-s-the-matrix span.cm-qualifier {color: #FFF700;}
-.cm-s-the-matrix span.cm-builtin {color: #30a;}
-.cm-s-the-matrix span.cm-bracket {color: #cc7;}
-.cm-s-the-matrix span.cm-tag {color: #FFBD40;}
-.cm-s-the-matrix span.cm-attribute {color: #FFF700;}
-.cm-s-the-matrix span.cm-error {color: #FF0000;}
+.cm-s-the-matrix span.cm-keyword { color: #008803; font-weight: bold; }
+.cm-s-the-matrix span.cm-atom { color: #3FF; }
+.cm-s-the-matrix span.cm-number { color: #FFB94F; }
+.cm-s-the-matrix span.cm-def { color: #99C; }
+.cm-s-the-matrix span.cm-variable { color: #F6C; }
+.cm-s-the-matrix span.cm-variable-2 { color: #C6F; }
+.cm-s-the-matrix span.cm-variable-3 { color: #96F; }
+.cm-s-the-matrix span.cm-property { color: #62FFA0; }
+.cm-s-the-matrix span.cm-operator { color: #999; }
+.cm-s-the-matrix span.cm-comment { color: #CCCCCC; }
+.cm-s-the-matrix span.cm-string { color: #39C; }
+.cm-s-the-matrix span.cm-meta { color: #C9F; }
+.cm-s-the-matrix span.cm-qualifier { color: #FFF700; }
+.cm-s-the-matrix span.cm-builtin { color: #30a; }
+.cm-s-the-matrix span.cm-bracket { color: #cc7; }
+.cm-s-the-matrix span.cm-tag { color: #FFBD40; }
+.cm-s-the-matrix span.cm-attribute { color: #FFF700; }
+.cm-s-the-matrix span.cm-error { color: #FF0000; }
-.cm-s-the-matrix .CodeMirror-activeline-background {background: #040;}
+.cm-s-the-matrix .CodeMirror-activeline-background { background: #040; }
diff --git a/public/vendor/codemirror/theme/tomorrow-night-bright.css b/public/vendor/codemirror/theme/tomorrow-night-bright.css
index decb82d3..b6dd4a92 100755..100644
--- a/public/vendor/codemirror/theme/tomorrow-night-bright.css
+++ b/public/vendor/codemirror/theme/tomorrow-night-bright.css
@@ -7,29 +7,29 @@
*/
-.cm-s-tomorrow-night-bright.CodeMirror {background: #000000; color: #eaeaea;}
-.cm-s-tomorrow-night-bright div.CodeMirror-selected {background: #424242 !important;}
-.cm-s-tomorrow-night-bright .CodeMirror-gutters {background: #000000; border-right: 0px;}
+.cm-s-tomorrow-night-bright.CodeMirror { background: #000000; color: #eaeaea; }
+.cm-s-tomorrow-night-bright div.CodeMirror-selected { background: #424242; }
+.cm-s-tomorrow-night-bright .CodeMirror-gutters { background: #000000; border-right: 0px; }
.cm-s-tomorrow-night-bright .CodeMirror-guttermarker { color: #e78c45; }
.cm-s-tomorrow-night-bright .CodeMirror-guttermarker-subtle { color: #777; }
-.cm-s-tomorrow-night-bright .CodeMirror-linenumber {color: #424242;}
-.cm-s-tomorrow-night-bright .CodeMirror-cursor {border-left: 1px solid #6A6A6A !important;}
-
-.cm-s-tomorrow-night-bright span.cm-comment {color: #d27b53;}
-.cm-s-tomorrow-night-bright span.cm-atom {color: #a16a94;}
-.cm-s-tomorrow-night-bright span.cm-number {color: #a16a94;}
-
-.cm-s-tomorrow-night-bright span.cm-property, .cm-s-tomorrow-night-bright span.cm-attribute {color: #99cc99;}
-.cm-s-tomorrow-night-bright span.cm-keyword {color: #d54e53;}
-.cm-s-tomorrow-night-bright span.cm-string {color: #e7c547;}
-
-.cm-s-tomorrow-night-bright span.cm-variable {color: #b9ca4a;}
-.cm-s-tomorrow-night-bright span.cm-variable-2 {color: #7aa6da;}
-.cm-s-tomorrow-night-bright span.cm-def {color: #e78c45;}
-.cm-s-tomorrow-night-bright span.cm-bracket {color: #eaeaea;}
-.cm-s-tomorrow-night-bright span.cm-tag {color: #d54e53;}
-.cm-s-tomorrow-night-bright span.cm-link {color: #a16a94;}
-.cm-s-tomorrow-night-bright span.cm-error {background: #d54e53; color: #6A6A6A;}
-
-.cm-s-tomorrow-night-bright .CodeMirror-activeline-background {background: #2a2a2a !important;}
-.cm-s-tomorrow-night-bright .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
+.cm-s-tomorrow-night-bright .CodeMirror-linenumber { color: #424242; }
+.cm-s-tomorrow-night-bright .CodeMirror-cursor { border-left: 1px solid #6A6A6A; }
+
+.cm-s-tomorrow-night-bright span.cm-comment { color: #d27b53; }
+.cm-s-tomorrow-night-bright span.cm-atom { color: #a16a94; }
+.cm-s-tomorrow-night-bright span.cm-number { color: #a16a94; }
+
+.cm-s-tomorrow-night-bright span.cm-property, .cm-s-tomorrow-night-bright span.cm-attribute { color: #99cc99; }
+.cm-s-tomorrow-night-bright span.cm-keyword { color: #d54e53; }
+.cm-s-tomorrow-night-bright span.cm-string { color: #e7c547; }
+
+.cm-s-tomorrow-night-bright span.cm-variable { color: #b9ca4a; }
+.cm-s-tomorrow-night-bright span.cm-variable-2 { color: #7aa6da; }
+.cm-s-tomorrow-night-bright span.cm-def { color: #e78c45; }
+.cm-s-tomorrow-night-bright span.cm-bracket { color: #eaeaea; }
+.cm-s-tomorrow-night-bright span.cm-tag { color: #d54e53; }
+.cm-s-tomorrow-night-bright span.cm-link { color: #a16a94; }
+.cm-s-tomorrow-night-bright span.cm-error { background: #d54e53; color: #6A6A6A; }
+
+.cm-s-tomorrow-night-bright .CodeMirror-activeline-background { background: #2a2a2a; }
+.cm-s-tomorrow-night-bright .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
diff --git a/public/vendor/codemirror/theme/tomorrow-night-eighties.css b/public/vendor/codemirror/theme/tomorrow-night-eighties.css
index 5fca3caf..2a9debc3 100755..100644
--- a/public/vendor/codemirror/theme/tomorrow-night-eighties.css
+++ b/public/vendor/codemirror/theme/tomorrow-night-eighties.css
@@ -8,31 +8,31 @@
*/
-.cm-s-tomorrow-night-eighties.CodeMirror {background: #000000; color: #CCCCCC;}
-.cm-s-tomorrow-night-eighties div.CodeMirror-selected {background: #2D2D2D !important;}
-.cm-s-tomorrow-night-eighties.CodeMirror ::selection { background: rgba(45, 45, 45, 0.99); }
-.cm-s-tomorrow-night-eighties.CodeMirror ::-moz-selection { background: rgba(45, 45, 45, 0.99); }
-.cm-s-tomorrow-night-eighties .CodeMirror-gutters {background: #000000; border-right: 0px;}
+.cm-s-tomorrow-night-eighties.CodeMirror { background: #000000; color: #CCCCCC; }
+.cm-s-tomorrow-night-eighties div.CodeMirror-selected { background: #2D2D2D; }
+.cm-s-tomorrow-night-eighties .CodeMirror-line::selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span::selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span > span::selection { background: rgba(45, 45, 45, 0.99); }
+.cm-s-tomorrow-night-eighties .CodeMirror-line::-moz-selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span::-moz-selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span > span::-moz-selection { background: rgba(45, 45, 45, 0.99); }
+.cm-s-tomorrow-night-eighties .CodeMirror-gutters { background: #000000; border-right: 0px; }
.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker { color: #f2777a; }
.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle { color: #777; }
-.cm-s-tomorrow-night-eighties .CodeMirror-linenumber {color: #515151;}
-.cm-s-tomorrow-night-eighties .CodeMirror-cursor {border-left: 1px solid #6A6A6A !important;}
-
-.cm-s-tomorrow-night-eighties span.cm-comment {color: #d27b53;}
-.cm-s-tomorrow-night-eighties span.cm-atom {color: #a16a94;}
-.cm-s-tomorrow-night-eighties span.cm-number {color: #a16a94;}
-
-.cm-s-tomorrow-night-eighties span.cm-property, .cm-s-tomorrow-night-eighties span.cm-attribute {color: #99cc99;}
-.cm-s-tomorrow-night-eighties span.cm-keyword {color: #f2777a;}
-.cm-s-tomorrow-night-eighties span.cm-string {color: #ffcc66;}
-
-.cm-s-tomorrow-night-eighties span.cm-variable {color: #99cc99;}
-.cm-s-tomorrow-night-eighties span.cm-variable-2 {color: #6699cc;}
-.cm-s-tomorrow-night-eighties span.cm-def {color: #f99157;}
-.cm-s-tomorrow-night-eighties span.cm-bracket {color: #CCCCCC;}
-.cm-s-tomorrow-night-eighties span.cm-tag {color: #f2777a;}
-.cm-s-tomorrow-night-eighties span.cm-link {color: #a16a94;}
-.cm-s-tomorrow-night-eighties span.cm-error {background: #f2777a; color: #6A6A6A;}
-
-.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background {background: #343600 !important;}
-.cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
+.cm-s-tomorrow-night-eighties .CodeMirror-linenumber { color: #515151; }
+.cm-s-tomorrow-night-eighties .CodeMirror-cursor { border-left: 1px solid #6A6A6A; }
+
+.cm-s-tomorrow-night-eighties span.cm-comment { color: #d27b53; }
+.cm-s-tomorrow-night-eighties span.cm-atom { color: #a16a94; }
+.cm-s-tomorrow-night-eighties span.cm-number { color: #a16a94; }
+
+.cm-s-tomorrow-night-eighties span.cm-property, .cm-s-tomorrow-night-eighties span.cm-attribute { color: #99cc99; }
+.cm-s-tomorrow-night-eighties span.cm-keyword { color: #f2777a; }
+.cm-s-tomorrow-night-eighties span.cm-string { color: #ffcc66; }
+
+.cm-s-tomorrow-night-eighties span.cm-variable { color: #99cc99; }
+.cm-s-tomorrow-night-eighties span.cm-variable-2 { color: #6699cc; }
+.cm-s-tomorrow-night-eighties span.cm-def { color: #f99157; }
+.cm-s-tomorrow-night-eighties span.cm-bracket { color: #CCCCCC; }
+.cm-s-tomorrow-night-eighties span.cm-tag { color: #f2777a; }
+.cm-s-tomorrow-night-eighties span.cm-link { color: #a16a94; }
+.cm-s-tomorrow-night-eighties span.cm-error { background: #f2777a; color: #6A6A6A; }
+
+.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background { background: #343600; }
+.cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
diff --git a/public/vendor/codemirror/theme/ttcn.css b/public/vendor/codemirror/theme/ttcn.css
index 9c2e9a61..b3d46564 100755..100644
--- a/public/vendor/codemirror/theme/ttcn.css
+++ b/public/vendor/codemirror/theme/ttcn.css
@@ -1,65 +1,64 @@
-.cm-quote {color: #090;}
-.cm-negative {color: #d44;}
-.cm-positive {color: #292;}
-.cm-header, .cm-strong {font-weight: bold;}
-.cm-em {font-style: italic;}
-.cm-link {text-decoration: underline;}
-.cm-strikethrough {text-decoration: line-through;}
-.cm-header {color: #00f; font-weight: bold;}
+.cm-s-ttcn .cm-quote { color: #090; }
+.cm-s-ttcn .cm-negative { color: #d44; }
+.cm-s-ttcn .cm-positive { color: #292; }
+.cm-s-ttcn .cm-header, .cm-strong { font-weight: bold; }
+.cm-s-ttcn .cm-em { font-style: italic; }
+.cm-s-ttcn .cm-link { text-decoration: underline; }
+.cm-s-ttcn .cm-strikethrough { text-decoration: line-through; }
+.cm-s-ttcn .cm-header { color: #00f; font-weight: bold; }
-.cm-atom {color: #219;}
-.cm-attribute {color: #00c;}
-.cm-bracket {color: #997;}
-.cm-comment {color: #333333;}
-.cm-def {color: #00f;}
-.cm-em {font-style: italic;}
-.cm-error {color: #f00;}
-.cm-hr {color: #999;}
-.cm-invalidchar {color: #f00;}
-.cm-keyword {font-weight:bold}
-.cm-link {color: #00c; text-decoration: underline;}
-.cm-meta {color: #555;}
-.cm-negative {color: #d44;}
-.cm-positive {color: #292;}
-.cm-qualifier {color: #555;}
-.cm-strikethrough {text-decoration: line-through;}
-.cm-string {color: #006400;}
-.cm-string-2 {color: #f50;}
-.cm-strong {font-weight: bold;}
-.cm-tag {color: #170;}
-.cm-variable {color: #8B2252;}
-.cm-variable-2 {color: #05a;}
-.cm-variable-3 {color: #085;}
+.cm-s-ttcn .cm-atom { color: #219; }
+.cm-s-ttcn .cm-attribute { color: #00c; }
+.cm-s-ttcn .cm-bracket { color: #997; }
+.cm-s-ttcn .cm-comment { color: #333333; }
+.cm-s-ttcn .cm-def { color: #00f; }
+.cm-s-ttcn .cm-em { font-style: italic; }
+.cm-s-ttcn .cm-error { color: #f00; }
+.cm-s-ttcn .cm-hr { color: #999; }
+.cm-s-ttcn .cm-invalidchar { color: #f00; }
+.cm-s-ttcn .cm-keyword { font-weight:bold; }
+.cm-s-ttcn .cm-link { color: #00c; text-decoration: underline; }
+.cm-s-ttcn .cm-meta { color: #555; }
+.cm-s-ttcn .cm-negative { color: #d44; }
+.cm-s-ttcn .cm-positive { color: #292; }
+.cm-s-ttcn .cm-qualifier { color: #555; }
+.cm-s-ttcn .cm-strikethrough { text-decoration: line-through; }
+.cm-s-ttcn .cm-string { color: #006400; }
+.cm-s-ttcn .cm-string-2 { color: #f50; }
+.cm-s-ttcn .cm-strong { font-weight: bold; }
+.cm-s-ttcn .cm-tag { color: #170; }
+.cm-s-ttcn .cm-variable { color: #8B2252; }
+.cm-s-ttcn .cm-variable-2 { color: #05a; }
+.cm-s-ttcn .cm-variable-3 { color: #085; }
-.cm-s-default .cm-error {color: #f00;}
-.cm-invalidchar {color: #f00;}
+.cm-s-ttcn .cm-invalidchar { color: #f00; }
/* ASN */
.cm-s-ttcn .cm-accessTypes,
-.cm-s-ttcn .cm-compareTypes {color: #27408B}
-.cm-s-ttcn .cm-cmipVerbs {color: #8B2252}
-.cm-s-ttcn .cm-modifier {color:#D2691E}
-.cm-s-ttcn .cm-status {color:#8B4545}
-.cm-s-ttcn .cm-storage {color:#A020F0}
-.cm-s-ttcn .cm-tags {color:#006400}
+.cm-s-ttcn .cm-compareTypes { color: #27408B; }
+.cm-s-ttcn .cm-cmipVerbs { color: #8B2252; }
+.cm-s-ttcn .cm-modifier { color:#D2691E; }
+.cm-s-ttcn .cm-status { color:#8B4545; }
+.cm-s-ttcn .cm-storage { color:#A020F0; }
+.cm-s-ttcn .cm-tags { color:#006400; }
/* CFG */
-.cm-s-ttcn .cm-externalCommands {color: #8B4545; font-weight:bold}
+.cm-s-ttcn .cm-externalCommands { color: #8B4545; font-weight:bold; }
.cm-s-ttcn .cm-fileNCtrlMaskOptions,
-.cm-s-ttcn .cm-sectionTitle {color: #2E8B57; font-weight:bold}
+.cm-s-ttcn .cm-sectionTitle { color: #2E8B57; font-weight:bold; }
/* TTCN */
.cm-s-ttcn .cm-booleanConsts,
.cm-s-ttcn .cm-otherConsts,
-.cm-s-ttcn .cm-verdictConsts {color: #006400}
+.cm-s-ttcn .cm-verdictConsts { color: #006400; }
.cm-s-ttcn .cm-configOps,
.cm-s-ttcn .cm-functionOps,
.cm-s-ttcn .cm-portOps,
.cm-s-ttcn .cm-sutOps,
.cm-s-ttcn .cm-timerOps,
-.cm-s-ttcn .cm-verdictOps {color: #0000FF}
+.cm-s-ttcn .cm-verdictOps { color: #0000FF; }
.cm-s-ttcn .cm-preprocessor,
.cm-s-ttcn .cm-templateMatch,
-.cm-s-ttcn .cm-ttcn3Macros {color: #27408B}
-.cm-s-ttcn .cm-types {color: #A52A2A; font-weight:bold}
-.cm-s-ttcn .cm-visibilityModifiers {font-weight:bold}
+.cm-s-ttcn .cm-ttcn3Macros { color: #27408B; }
+.cm-s-ttcn .cm-types { color: #A52A2A; font-weight:bold; }
+.cm-s-ttcn .cm-visibilityModifiers { font-weight:bold; }
diff --git a/public/vendor/codemirror/theme/twilight.css b/public/vendor/codemirror/theme/twilight.css
index 889a83d7..d342b899 100755..100644
--- a/public/vendor/codemirror/theme/twilight.css
+++ b/public/vendor/codemirror/theme/twilight.css
@@ -1,15 +1,15 @@
.cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/
-.cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/
-.cm-s-twilight.CodeMirror ::selection { background: rgba(50, 50, 50, 0.99); }
-.cm-s-twilight.CodeMirror ::-moz-selection { background: rgba(50, 50, 50, 0.99); }
+.cm-s-twilight div.CodeMirror-selected { background: #323232; } /**/
+.cm-s-twilight .CodeMirror-line::selection, .cm-s-twilight .CodeMirror-line > span::selection, .cm-s-twilight .CodeMirror-line > span > span::selection { background: rgba(50, 50, 50, 0.99); }
+.cm-s-twilight .CodeMirror-line::-moz-selection, .cm-s-twilight .CodeMirror-line > span::-moz-selection, .cm-s-twilight .CodeMirror-line > span > span::-moz-selection { background: rgba(50, 50, 50, 0.99); }
.cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; }
.cm-s-twilight .CodeMirror-guttermarker { color: white; }
.cm-s-twilight .CodeMirror-guttermarker-subtle { color: #aaa; }
.cm-s-twilight .CodeMirror-linenumber { color: #aaa; }
-.cm-s-twilight .CodeMirror-cursor { border-left: 1px solid white !important; }
+.cm-s-twilight .CodeMirror-cursor { border-left: 1px solid white; }
-.cm-s-twilight .cm-keyword { color: #f9ee98; } /**/
+.cm-s-twilight .cm-keyword { color: #f9ee98; } /**/
.cm-s-twilight .cm-atom { color: #FC0; }
.cm-s-twilight .cm-number { color: #ca7841; } /**/
.cm-s-twilight .cm-def { color: #8DA6CE; }
@@ -18,15 +18,15 @@
.cm-s-twilight .cm-operator { color: #cda869; } /**/
.cm-s-twilight .cm-comment { color:#777; font-style:italic; font-weight:normal; } /**/
.cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/
-.cm-s-twilight .cm-string-2 { color:#bd6b18 } /*?*/
+.cm-s-twilight .cm-string-2 { color:#bd6b18; } /*?*/
.cm-s-twilight .cm-meta { background-color:#141414; color:#f7f7f7; } /*?*/
.cm-s-twilight .cm-builtin { color: #cda869; } /*?*/
.cm-s-twilight .cm-tag { color: #997643; } /**/
.cm-s-twilight .cm-attribute { color: #d6bb6d; } /*?*/
.cm-s-twilight .cm-header { color: #FF6400; }
.cm-s-twilight .cm-hr { color: #AEAEAE; }
-.cm-s-twilight .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } /**/
+.cm-s-twilight .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } /**/
.cm-s-twilight .cm-error { border-bottom: 1px solid red; }
-.cm-s-twilight .CodeMirror-activeline-background {background: #27282E !important;}
-.cm-s-twilight .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}
+.cm-s-twilight .CodeMirror-activeline-background { background: #27282E; }
+.cm-s-twilight .CodeMirror-matchingbracket { outline:1px solid grey; color:white !important; }
diff --git a/public/vendor/codemirror/theme/vibrant-ink.css b/public/vendor/codemirror/theme/vibrant-ink.css
index 8ea53597..ac4ec6d8 100755..100644
--- a/public/vendor/codemirror/theme/vibrant-ink.css
+++ b/public/vendor/codemirror/theme/vibrant-ink.css
@@ -1,26 +1,26 @@
/* Taken from the popular Visual Studio Vibrant Ink Schema */
.cm-s-vibrant-ink.CodeMirror { background: black; color: white; }
-.cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; }
-.cm-s-vibrant-ink.CodeMirror ::selection { background: rgba(53, 73, 60, 0.99); }
-.cm-s-vibrant-ink.CodeMirror ::-moz-selection { background: rgba(53, 73, 60, 0.99); }
+.cm-s-vibrant-ink div.CodeMirror-selected { background: #35493c; }
+.cm-s-vibrant-ink .CodeMirror-line::selection, .cm-s-vibrant-ink .CodeMirror-line > span::selection, .cm-s-vibrant-ink .CodeMirror-line > span > span::selection { background: rgba(53, 73, 60, 0.99); }
+.cm-s-vibrant-ink .CodeMirror-line::-moz-selection, .cm-s-vibrant-ink .CodeMirror-line > span::-moz-selection, .cm-s-vibrant-ink .CodeMirror-line > span > span::-moz-selection { background: rgba(53, 73, 60, 0.99); }
.cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
.cm-s-vibrant-ink .CodeMirror-guttermarker { color: white; }
.cm-s-vibrant-ink .CodeMirror-guttermarker-subtle { color: #d0d0d0; }
.cm-s-vibrant-ink .CodeMirror-linenumber { color: #d0d0d0; }
-.cm-s-vibrant-ink .CodeMirror-cursor { border-left: 1px solid white !important; }
+.cm-s-vibrant-ink .CodeMirror-cursor { border-left: 1px solid white; }
-.cm-s-vibrant-ink .cm-keyword { color: #CC7832; }
+.cm-s-vibrant-ink .cm-keyword { color: #CC7832; }
.cm-s-vibrant-ink .cm-atom { color: #FC0; }
.cm-s-vibrant-ink .cm-number { color: #FFEE98; }
.cm-s-vibrant-ink .cm-def { color: #8DA6CE; }
-.cm-s-vibrant-ink span.cm-variable-2, .cm-s-vibrant span.cm-tag { color: #FFC66D }
-.cm-s-vibrant-ink span.cm-variable-3, .cm-s-vibrant span.cm-def { color: #FFC66D }
+.cm-s-vibrant-ink span.cm-variable-2, .cm-s-vibrant span.cm-tag { color: #FFC66D; }
+.cm-s-vibrant-ink span.cm-variable-3, .cm-s-vibrant span.cm-def { color: #FFC66D; }
.cm-s-vibrant-ink .cm-operator { color: #888; }
.cm-s-vibrant-ink .cm-comment { color: gray; font-weight: bold; }
-.cm-s-vibrant-ink .cm-string { color: #A5C25C }
-.cm-s-vibrant-ink .cm-string-2 { color: red }
+.cm-s-vibrant-ink .cm-string { color: #A5C25C; }
+.cm-s-vibrant-ink .cm-string-2 { color: red; }
.cm-s-vibrant-ink .cm-meta { color: #D8FA3C; }
.cm-s-vibrant-ink .cm-builtin { color: #8DA6CE; }
.cm-s-vibrant-ink .cm-tag { color: #8DA6CE; }
@@ -30,5 +30,5 @@
.cm-s-vibrant-ink .cm-link { color: blue; }
.cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; }
-.cm-s-vibrant-ink .CodeMirror-activeline-background {background: #27282E !important;}
-.cm-s-vibrant-ink .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}
+.cm-s-vibrant-ink .CodeMirror-activeline-background { background: #27282E; }
+.cm-s-vibrant-ink .CodeMirror-matchingbracket { outline:1px solid grey; color:white !important; }
diff --git a/public/vendor/codemirror/theme/xq-dark.css b/public/vendor/codemirror/theme/xq-dark.css
index d537993e..e3bd960b 100755..100644
--- a/public/vendor/codemirror/theme/xq-dark.css
+++ b/public/vendor/codemirror/theme/xq-dark.css
@@ -21,33 +21,33 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
.cm-s-xq-dark.CodeMirror { background: #0a001f; color: #f8f8f8; }
-.cm-s-xq-dark .CodeMirror-selected { background: #27007A !important; }
-.cm-s-xq-dark.CodeMirror ::selection { background: rgba(39, 0, 122, 0.99); }
-.cm-s-xq-dark.CodeMirror ::-moz-selection { background: rgba(39, 0, 122, 0.99); }
+.cm-s-xq-dark div.CodeMirror-selected { background: #27007A; }
+.cm-s-xq-dark .CodeMirror-line::selection, .cm-s-xq-dark .CodeMirror-line > span::selection, .cm-s-xq-dark .CodeMirror-line > span > span::selection { background: rgba(39, 0, 122, 0.99); }
+.cm-s-xq-dark .CodeMirror-line::-moz-selection, .cm-s-xq-dark .CodeMirror-line > span::-moz-selection, .cm-s-xq-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(39, 0, 122, 0.99); }
.cm-s-xq-dark .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }
.cm-s-xq-dark .CodeMirror-guttermarker { color: #FFBD40; }
.cm-s-xq-dark .CodeMirror-guttermarker-subtle { color: #f8f8f8; }
.cm-s-xq-dark .CodeMirror-linenumber { color: #f8f8f8; }
-.cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
+.cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white; }
-.cm-s-xq-dark span.cm-keyword {color: #FFBD40;}
-.cm-s-xq-dark span.cm-atom {color: #6C8CD5;}
-.cm-s-xq-dark span.cm-number {color: #164;}
-.cm-s-xq-dark span.cm-def {color: #FFF; text-decoration:underline;}
-.cm-s-xq-dark span.cm-variable {color: #FFF;}
-.cm-s-xq-dark span.cm-variable-2 {color: #EEE;}
-.cm-s-xq-dark span.cm-variable-3 {color: #DDD;}
+.cm-s-xq-dark span.cm-keyword { color: #FFBD40; }
+.cm-s-xq-dark span.cm-atom { color: #6C8CD5; }
+.cm-s-xq-dark span.cm-number { color: #164; }
+.cm-s-xq-dark span.cm-def { color: #FFF; text-decoration:underline; }
+.cm-s-xq-dark span.cm-variable { color: #FFF; }
+.cm-s-xq-dark span.cm-variable-2 { color: #EEE; }
+.cm-s-xq-dark span.cm-variable-3 { color: #DDD; }
.cm-s-xq-dark span.cm-property {}
.cm-s-xq-dark span.cm-operator {}
-.cm-s-xq-dark span.cm-comment {color: gray;}
-.cm-s-xq-dark span.cm-string {color: #9FEE00;}
-.cm-s-xq-dark span.cm-meta {color: yellow;}
-.cm-s-xq-dark span.cm-qualifier {color: #FFF700;}
-.cm-s-xq-dark span.cm-builtin {color: #30a;}
-.cm-s-xq-dark span.cm-bracket {color: #cc7;}
-.cm-s-xq-dark span.cm-tag {color: #FFBD40;}
-.cm-s-xq-dark span.cm-attribute {color: #FFF700;}
-.cm-s-xq-dark span.cm-error {color: #f00;}
+.cm-s-xq-dark span.cm-comment { color: gray; }
+.cm-s-xq-dark span.cm-string { color: #9FEE00; }
+.cm-s-xq-dark span.cm-meta { color: yellow; }
+.cm-s-xq-dark span.cm-qualifier { color: #FFF700; }
+.cm-s-xq-dark span.cm-builtin { color: #30a; }
+.cm-s-xq-dark span.cm-bracket { color: #cc7; }
+.cm-s-xq-dark span.cm-tag { color: #FFBD40; }
+.cm-s-xq-dark span.cm-attribute { color: #FFF700; }
+.cm-s-xq-dark span.cm-error { color: #f00; }
-.cm-s-xq-dark .CodeMirror-activeline-background {background: #27282E !important;}
-.cm-s-xq-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} \ No newline at end of file
+.cm-s-xq-dark .CodeMirror-activeline-background { background: #27282E; }
+.cm-s-xq-dark .CodeMirror-matchingbracket { outline:1px solid grey; color:white !important; }
diff --git a/public/vendor/codemirror/theme/xq-light.css b/public/vendor/codemirror/theme/xq-light.css
index 20b5c796..8d2fcb66 100755..100644
--- a/public/vendor/codemirror/theme/xq-light.css
+++ b/public/vendor/codemirror/theme/xq-light.css
@@ -20,24 +20,24 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-.cm-s-xq-light span.cm-keyword {line-height: 1em; font-weight: bold; color: #5A5CAD; }
-.cm-s-xq-light span.cm-atom {color: #6C8CD5;}
-.cm-s-xq-light span.cm-number {color: #164;}
-.cm-s-xq-light span.cm-def {text-decoration:underline;}
-.cm-s-xq-light span.cm-variable {color: black; }
-.cm-s-xq-light span.cm-variable-2 {color:black;}
-.cm-s-xq-light span.cm-variable-3 {color: black; }
+.cm-s-xq-light span.cm-keyword { line-height: 1em; font-weight: bold; color: #5A5CAD; }
+.cm-s-xq-light span.cm-atom { color: #6C8CD5; }
+.cm-s-xq-light span.cm-number { color: #164; }
+.cm-s-xq-light span.cm-def { text-decoration:underline; }
+.cm-s-xq-light span.cm-variable { color: black; }
+.cm-s-xq-light span.cm-variable-2 { color:black; }
+.cm-s-xq-light span.cm-variable-3 { color: black; }
.cm-s-xq-light span.cm-property {}
.cm-s-xq-light span.cm-operator {}
-.cm-s-xq-light span.cm-comment {color: #0080FF; font-style: italic;}
-.cm-s-xq-light span.cm-string {color: red;}
-.cm-s-xq-light span.cm-meta {color: yellow;}
-.cm-s-xq-light span.cm-qualifier {color: grey}
-.cm-s-xq-light span.cm-builtin {color: #7EA656;}
-.cm-s-xq-light span.cm-bracket {color: #cc7;}
-.cm-s-xq-light span.cm-tag {color: #3F7F7F;}
-.cm-s-xq-light span.cm-attribute {color: #7F007F;}
-.cm-s-xq-light span.cm-error {color: #f00;}
+.cm-s-xq-light span.cm-comment { color: #0080FF; font-style: italic; }
+.cm-s-xq-light span.cm-string { color: red; }
+.cm-s-xq-light span.cm-meta { color: yellow; }
+.cm-s-xq-light span.cm-qualifier { color: grey; }
+.cm-s-xq-light span.cm-builtin { color: #7EA656; }
+.cm-s-xq-light span.cm-bracket { color: #cc7; }
+.cm-s-xq-light span.cm-tag { color: #3F7F7F; }
+.cm-s-xq-light span.cm-attribute { color: #7F007F; }
+.cm-s-xq-light span.cm-error { color: #f00; }
-.cm-s-xq-light .CodeMirror-activeline-background {background: #e8f2ff !important;}
-.cm-s-xq-light .CodeMirror-matchingbracket {outline:1px solid grey;color:black !important;background:yellow;} \ No newline at end of file
+.cm-s-xq-light .CodeMirror-activeline-background { background: #e8f2ff; }
+.cm-s-xq-light .CodeMirror-matchingbracket { outline:1px solid grey;color:black !important;background:yellow; }
diff --git a/public/vendor/codemirror/theme/yeti.css b/public/vendor/codemirror/theme/yeti.css
new file mode 100644
index 00000000..c70d4d21
--- /dev/null
+++ b/public/vendor/codemirror/theme/yeti.css
@@ -0,0 +1,44 @@
+/*
+
+ Name: yeti
+ Author: Michael Kaminsky (http://github.com/mkaminsky11)
+
+ Original yeti color scheme by Jesse Weed (https://github.com/jesseweed/yeti-syntax)
+
+*/
+
+
+.cm-s-yeti.CodeMirror {
+ background-color: #ECEAE8 !important;
+ color: #d1c9c0 !important;
+ border: none;
+}
+
+.cm-s-yeti .CodeMirror-gutters {
+ color: #adaba6;
+ background-color: #E5E1DB;
+ border: none;
+}
+.cm-s-yeti .CodeMirror-cursor { border-left: solid thin #d1c9c0; }
+.cm-s-yeti .CodeMirror-linenumber { color: #adaba6; }
+.cm-s-yeti.CodeMirror-focused div.CodeMirror-selected { background: #DCD8D2; }
+.cm-s-yeti .CodeMirror-line::selection, .cm-s-yeti .CodeMirror-line > span::selection, .cm-s-yeti .CodeMirror-line > span > span::selection { background: #DCD8D2; }
+.cm-s-yeti .CodeMirror-line::-moz-selection, .cm-s-yeti .CodeMirror-line > span::-moz-selection, .cm-s-yeti .CodeMirror-line > span > span::-moz-selection { background: #DCD8D2; }
+.cm-s-yeti span.cm-comment { color: #d4c8be; }
+.cm-s-yeti span.cm-string, .cm-s-yeti span.cm-string-2 { color: #96c0d8; }
+.cm-s-yeti span.cm-number { color: #a074c4; }
+.cm-s-yeti span.cm-variable { color: #55b5db; }
+.cm-s-yeti span.cm-variable-2 { color: #a074c4; }
+.cm-s-yeti span.cm-def { color: #55b5db; }
+.cm-s-yeti span.cm-operator { color: #9fb96e; }
+.cm-s-yeti span.cm-keyword { color: #9fb96e; }
+.cm-s-yeti span.cm-atom { color: #a074c4; }
+.cm-s-yeti span.cm-meta { color: #96c0d8; }
+.cm-s-yeti span.cm-tag { color: #96c0d8; }
+.cm-s-yeti span.cm-attribute { color: #9fb96e; }
+.cm-s-yeti span.cm-qualifier { color: #96c0d8; }
+.cm-s-yeti span.cm-property { color: #a074c4; }
+.cm-s-yeti span.cm-builtin { color: #a074c4; }
+.cm-s-yeti span.cm-variable-3 { color: #96c0d8; }
+.cm-s-yeti .CodeMirror-activeline-background { background: #E7E4E0; }
+.cm-s-yeti .CodeMirror-matchingbracket { text-decoration: underline; }
diff --git a/public/vendor/codemirror/theme/zenburn.css b/public/vendor/codemirror/theme/zenburn.css
index f817198a..781c40ac 100755..100644
--- a/public/vendor/codemirror/theme/zenburn.css
+++ b/public/vendor/codemirror/theme/zenburn.css
@@ -10,7 +10,7 @@
.cm-s-zenburn .CodeMirror-gutters { background: #3f3f3f !important; }
.cm-s-zenburn .CodeMirror-foldgutter-open, .CodeMirror-foldgutter-folded { color: #999; }
-.cm-s-zenburn .CodeMirror-cursor { border-left: 1px solid white !important; }
+.cm-s-zenburn .CodeMirror-cursor { border-left: 1px solid white; }
.cm-s-zenburn { background-color: #3f3f3f; color: #dcdccc; }
.cm-s-zenburn span.cm-builtin { color: #dcdccc; font-weight: bold; }
.cm-s-zenburn span.cm-comment { color: #7f9f7f; }
@@ -33,5 +33,5 @@
.cm-s-zenburn span.CodeMirror-nonmatchingbracket { border-bottom: 1px solid; background: none; }
.cm-s-zenburn .CodeMirror-activeline { background: #000000; }
.cm-s-zenburn .CodeMirror-activeline-background { background: #000000; }
-.cm-s-zenburn .CodeMirror-selected { background: #545454; }
-.cm-s-zenburn .CodeMirror-focused .CodeMirror-selected { background: #4f4f4f; }
+.cm-s-zenburn div.CodeMirror-selected { background: #545454; }
+.cm-s-zenburn .CodeMirror-focused div.CodeMirror-selected { background: #4f4f4f; }
diff --git a/public/views/head.ejs b/public/views/head.ejs
index 795665b4..5862e87c 100644
--- a/public/views/head.ejs
+++ b/public/views/head.ejs
@@ -14,14 +14,17 @@
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-social/4.9.0/bootstrap-social.min.css">
+<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/css/bootstrap3/bootstrap-switch.min.css">
<% } else { %>
<link rel="stylesheet" href="/vendor/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="/vendor/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="/css/bootstrap-social.css">
+<link rel="stylesheet" href="/vendor/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css">
<% } %>
<link rel="stylesheet" href="/vendor/jquery-ui/jquery-ui.min.css">
<link rel="stylesheet" href="/vendor/codemirror/lib/codemirror.css">
<link rel="stylesheet" href="/vendor/codemirror/addon/fold/foldgutter.css">
+<link rel="stylesheet" href="/vendor/codemirror/addon/display/fullscreen.css">
<link rel="stylesheet" href="/vendor/codemirror/addon/dialog/dialog.css">
<link rel="stylesheet" href="/vendor/codemirror/addon/scroll/simplescrollbars.css">
<link rel="stylesheet" href="/vendor/codemirror/addon/search/matchesonscrollbar.css">