From 1c63e9025700c41d833ff85bd0bc3a9e28d29761 Mon Sep 17 00:00:00 2001 From: Andreas Fernandez <a.fernandez@scripting-base.de> Date: Fri, 25 Sep 2020 17:05:30 +0200 Subject: [PATCH] [TASK] Upgrade codemirror to 5.58.1 Executed command: yarn add codemirror@^5.58.1 Resolves: #92414 Releases: master, 10.4, 9.5 Change-Id: I9829d4ee44b2bfd71f8557a35037c04b849b42fd Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65883 Tested-by: TYPO3com <noreply@typo3.com> Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de> Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de> --- Build/package.json | 2 +- Build/yarn.lock | 8 +- .../Public/JavaScript/Contrib/cm/AUTHORS | 41 +++++ .../Public/JavaScript/Contrib/cm/CHANGELOG.md | 146 ++++++++++++++++++ .../Contrib/cm/addon/comment/comment.js | 2 +- .../Contrib/cm/addon/dialog/dialog.js | 2 +- .../Contrib/cm/addon/display/placeholder.js | 2 +- .../Contrib/cm/addon/edit/closetag.js | 2 +- .../Contrib/cm/addon/edit/matchbrackets.js | 2 +- .../Contrib/cm/addon/hint/javascript-hint.js | 2 +- .../Contrib/cm/addon/hint/show-hint.js | 2 +- .../Contrib/cm/addon/hint/sql-hint.js | 2 +- .../Contrib/cm/addon/hint/xml-hint.js | 2 +- .../JavaScript/Contrib/cm/addon/lint/lint.css | 24 ++- .../JavaScript/Contrib/cm/addon/lint/lint.js | 2 +- .../Contrib/cm/addon/merge/merge.js | 2 +- .../Contrib/cm/addon/mode/loadmode.js | 2 +- .../cm/addon/runmode/runmode-standalone.js | 2 +- .../Contrib/cm/addon/runmode/runmode.js | 2 +- .../Contrib/cm/addon/runmode/runmode.node.js | 2 +- .../cm/addon/scroll/annotatescrollbar.js | 2 +- .../cm/addon/search/match-highlighter.js | 2 +- .../Contrib/cm/addon/wrap/hardwrap.js | 2 +- .../JavaScript/Contrib/cm/keymap/emacs.js | 2 +- .../JavaScript/Contrib/cm/keymap/sublime.js | 2 +- .../JavaScript/Contrib/cm/keymap/vim.js | 2 +- .../JavaScript/Contrib/cm/lib/codemirror.css | 11 +- .../JavaScript/Contrib/cm/lib/codemirror.js | 2 +- .../JavaScript/Contrib/cm/mode/css/css.js | 2 +- .../JavaScript/Contrib/cm/mode/dart/dart.js | 2 +- .../Contrib/cm/mode/javascript/javascript.js | 2 +- .../JavaScript/Contrib/cm/mode/julia/julia.js | 2 +- .../Contrib/cm/mode/markdown/markdown.js | 2 +- .../Public/JavaScript/Contrib/cm/mode/meta.js | 2 +- .../JavaScript/Contrib/cm/mode/nsis/nsis.js | 2 +- .../Contrib/cm/mode/pascal/pascal.js | 2 +- .../Contrib/cm/mode/powershell/powershell.js | 2 +- .../Contrib/cm/mode/protobuf/protobuf.js | 2 +- .../Contrib/cm/mode/python/python.js | 2 +- .../JavaScript/Contrib/cm/mode/ruby/ruby.js | 2 +- .../JavaScript/Contrib/cm/mode/rust/rust.js | 2 +- .../JavaScript/Contrib/cm/mode/sas/sas.js | 2 +- .../JavaScript/Contrib/cm/mode/soy/soy.js | 2 +- .../JavaScript/Contrib/cm/mode/sql/sql.js | 2 +- .../JavaScript/Contrib/cm/mode/tcl/tcl.js | 2 +- .../JavaScript/Contrib/cm/mode/wast/wast.js | 1 + .../Public/JavaScript/Contrib/cm/package.json | 9 +- .../JavaScript/Contrib/cm/theme/zenburn.css | 2 +- 48 files changed, 255 insertions(+), 67 deletions(-) create mode 100644 typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/wast/wast.js diff --git a/Build/package.json b/Build/package.json index 0e07cd519f2c..e7713d05331f 100644 --- a/Build/package.json +++ b/Build/package.json @@ -78,7 +78,7 @@ "chosen-js": "^1.8.7", "ckeditor-wordcount-plugin": "^1.17.2", "ckeditor4": "^4.15.0", - "codemirror": "^5.49.0", + "codemirror": "^5.58.1", "cropperjs": "^1.5.7", "d3": "^4.10.0", "devbridge-autocomplete": "^1.4.1", diff --git a/Build/yarn.lock b/Build/yarn.lock index 84e09e84ad29..3f6551ed1d34 100644 --- a/Build/yarn.lock +++ b/Build/yarn.lock @@ -1449,10 +1449,10 @@ code-point-at@^1.0.0: resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= -codemirror@^5.49.0: - version "5.52.0" - resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.52.0.tgz#4dbd6aef7f0e63db826b9a23922f0c03ac75c0a7" - integrity sha512-K2UB6zjscrfME03HeRe/IuOmCeqNpw7PLKGHThYpLbZEuKf+ZoujJPhxZN4hHJS1O7QyzEsV7JJZGxuQWVaFCg== +codemirror@^5.58.1: + version "5.58.1" + resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.58.1.tgz#ec6bf38ad2a17f74c61bd00cc6dc5a69bd167854" + integrity sha512-UGb/ueu20U4xqWk8hZB3xIfV2/SFqnSLYONiM3wTMDqko0bsYrsAkGGhqUzbRkYm89aBKPyHtuNEbVWF9FTFzw== collection-visit@^1.0.0: version "1.0.0" diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/AUTHORS b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/AUTHORS index 3fdc7869c70f..bb017e9574ae 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/AUTHORS +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/AUTHORS @@ -15,11 +15,13 @@ Adán Lobato Aditya Toshniwal Adrian Aichner Adrian Heine +Adrian Kunz Adrien Bertrand aeroson Ahmad Amireh Ahmad M. Zawawi ahoward +Ajin Abraham Akeksandr Motsjonov Alasdair Smith AlbertHilb @@ -31,6 +33,7 @@ Alexander Schepanovski Alexander Shvets Alexander Solovyov Alexandre Bique +Alex Churchill alexey-k Alex Piggott Aliaksei Chapyzhenka @@ -97,6 +100,9 @@ Bastian Müller belhaj Bem Jones-Bey benbro +Benedikt Meurer +benhormann +Ben Hormann Beni Cherniavsky-Paskin Benjamin DeCoste Benjamin Young @@ -108,6 +114,7 @@ Bert Chang Bharad BigBlueHat Billy Moon +Bin Ni binny Bjorn Hansen B Krishna Chaitanya @@ -117,12 +124,14 @@ Bo boomyjee Bo Peng borawjm +Boris K Brad Metcalf Brandon Frohs Brandon Wamboldt Bret Little Brett Zamir Brian Grinstead +BrianHung Brian Sletten brrd Bruce Mitchener @@ -134,6 +143,7 @@ Calin Barbat callodacity Camilo Roca Casey Klebba +cBiscuit87 César González Ãñiguez Chad Jolly Chandra Sekhar Pydi @@ -160,6 +170,7 @@ Christopher Pfohl Christopher Wallis Chunliang Lyu ciaranj +clone-it clso CodeAnimal CodeBitt @@ -169,6 +180,7 @@ ComFreek Cristian Prieto Curran Kelleher Curtis Gagliardi +d8888 dagsta daines Dale Jung @@ -209,6 +221,7 @@ Dick Choi Diego Fernandez dignifiedquire Dimage Sapelkin +Dinindu D. Wanniarachchi dmaclach Dmitry Kiselyov domagoj412 @@ -224,6 +237,7 @@ Dror BG Duncan Lilley duralog dwelle +Ealton eborden edoroshenko edsharp @@ -254,6 +268,7 @@ Filype Pereira finalfantasia flack Florian Felten +Fons van der Plas Forbes Lindesay ForbesLindesay Ford_Lawnmower @@ -300,6 +315,7 @@ Hakan Tunc Hanno Fellmann Hans Engel Hanzhao Deng +Haoran Yu Harald Schilly Hardest Harshvardhan Gupta @@ -307,6 +323,7 @@ Hasan DelibaÅŸ Hasan Karahan Heanes Hector Oswaldo Caballero +Hein Htat Hélio Hendrik Wallbaum Henrik Haugbølle @@ -315,10 +332,13 @@ hidaiy Hiroyuki Makino hitsthings Hocdoc +Howard +Howard Jing Hugues Malphettes Ian Beck Ian Davies Ian Dickinson +ianhi Ian Rose Ian Wehrman Ian Wetherbee @@ -328,10 +348,13 @@ idleberg Igor Petruk ilvalle Ilya Kharlamov +Ilya Zverev Ingo Richter +Intervue Irakli Gozalishvili Ivan Kurnosov Ivoah +Jack Douglas Jacob Lee Jaimin Jake Peyser @@ -362,6 +385,7 @@ Jason Johnston Jason San Jose Jason Siefken Jayaprabhakar +Jay Contonio Jaydeep Solanki Jean Boussier Jeff Blaisdell @@ -382,6 +406,7 @@ joelpinheiro joewalsh Johan Ask Johannes +John Chen John Connor John-David Dalton John Engler @@ -422,6 +447,7 @@ jwallers@gmail.com kaniga karevn Karol +Kaushik Kulkarni Kayur Patel Kazuhito Hokamura kcwiakala @@ -472,6 +498,7 @@ Lorenzo Simionato Lorenzo Stoakes Louis Mauchet Luca Fabbri +Lucas Buchala Luciano Longo Luciano Santana Lu Fangjian @@ -517,6 +544,7 @@ mats cronqvist Matt Gaide Matthew Bauer Matthew Beale +Matthew Casperson matthewhayes Matthew Rathbone Matthew Suozzo @@ -537,6 +565,7 @@ Max Xiantu mbarkhau McBrainy mce2 +Mélanie Chauvel melpon meshuamam Metatheos @@ -615,6 +644,7 @@ Olivia Ytterbrink Opender Singh opl- Oreoluwa Onatemowo +orionlee oscar.lofwenhamn Oskar Segersvärd ossdev @@ -630,11 +660,13 @@ paris Paris Paris Kasidiaris Patil Arpith +Patrick Kettner Patrick Stoica Patrick Strawderman Paul Garvin Paul Ivanov Paul Masson +Paul Schmidt Pavel Pavel Feldman Pavel Petržela @@ -645,6 +677,7 @@ peter Peter Flynn peterkroon Peter Kroon +Peter László Philipp A Philipp Markovics Philip Stadermann @@ -685,11 +718,13 @@ Robert Crossfield Robert Martin Roberto Abdelkader MartÃnez Pérez robertop23 +Roberto Vidal Robert Plummer Roman Janusz Rrandom Rrrandom Ruslan Osmanov +rvalavicius Ryan Pangrle Ryan Petrello Ryan Prior @@ -733,6 +768,7 @@ Shiv Deepak Shmuel Englard Shubham Jain Siamak Mokhtari +Siddhartha Gunti silverwind Simon Edwards sinkuu @@ -784,13 +820,16 @@ thomasmaclean Thomas Schmid Tim Alby Tim Baumann +Tim Gates Timothy Farrell Timothy Gu Timothy Hatcher +Tim van der Lippe Tobias Bertelsen TobiasBg Todd Berman Todd Kennedy +tokafew420 Tomas-A Tomas Varaneckas Tom Erik Støwer @@ -812,6 +851,7 @@ Tyler Makaro Vadim Dyachenko Vadzim Ramanenka Vaibhav Sagar +vamshi.revu VapidWorx Vestimir Markov vf @@ -844,6 +884,7 @@ Yuvi Panda Yvonnick Esnault Zac Anger Zachary Dremann +ZeeshanNoor Zeno Rocha Zhang Hao Ziv diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/CHANGELOG.md b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/CHANGELOG.md index 33bca5cd27d8..d3e3fe4223da 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/CHANGELOG.md +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/CHANGELOG.md @@ -1,3 +1,149 @@ +## 5.58.1 (2020-09-23) + +### Bug fixes + +[placeholder addon](https://codemirror.net/doc/manual.html#addon_placeholder): Remove arrow function that ended up in the code. + +## 5.58.0 (2020-09-21) + +### Bug fixes + +Make backspace delete by code point, not glyph. + +Suppress flickering focus outline when clicking on scrollbars in Chrome. + +Fix a bug that prevented attributes added via `markText` from showing up unless the span also had some other styling. + +Suppress cut and paste context menu entries in readonly editors in Chrome. + +[placeholder addon](https://codemirror.net/doc/manual.html#addon_placeholder): Update placeholder visibility during composition. + +### New features + +Make it less cumbersome to style new lint message types. + +[vim bindings](https://codemirror.net/demo/vim.html): Support black hole register, `gn` and `gN` + +## 5.57.0 (2020-08-20) + +### Bug fixes + +Fix issue that broke binding the macOS Command key. + +[comment addon](https://codemirror.net/doc/manual.html#addon_comment): Keep selection in front of inserted markers when adding a block comment. + +[css mode](https://codemirror.net/mode/css/): Recognize more properties and value names. + +[annotatescrollbar addon](https://codemirror.net/doc/manual.html#addon_annotatescrollbar): Don't hide matches in collapsed content. + +### New features + +[vim bindings](https://codemirror.net/demo/vim.html): Support tag text objects in xml and html modes. + +## 5.56.0 (2020-07-20) + +### Bug fixes + +Line-wise pasting was fixed on Chrome Windows. + +[wast mode](https://codemirror.net/mode/wast/): Follow standard changes. + +[soy mode](https://codemirror.net/mode/soy/): Support import expressions, template type, and loop indices. + +[sql-hint addon](https://codemirror.net/doc/manual.html#addon_sql-hint): Improve handling of double quotes. + +### New features + +[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): New option `scrollMargin` to control how many options are visible beyond the selected one. + +[hardwrap addon](https://codemirror.net/doc/manual.html#addon_hardwrap): New option `forceBreak` to disable breaking of words that are longer than a line. + +## 5.55.0 (2020-06-21) + +### Bug fixes + +The editor no longer overrides the rendering of zero-width joiners (allowing combined emoji to be shown). + +[vim bindings](https://codemirror.net/demo/vim.html): Fix an issue where the `vim-mode-change` event was fired twice. + +[javascript mode](https://codemirror.net/mode/javascript/): Only allow `-->`-style comments at the start of a line. + +[julia mode](https://codemirror.net/mode/julia/): Improve indentation. + +[pascal mode](https://codemirror.net/mode/pascal/index.html): Recognize curly bracket comments. + +[runmode addon](https://codemirror.net/doc/manual.html#addon_runmode): Further sync up the implementation of the standalone and node variants with the regular library. + +### New features + +[loadmode addon](https://codemirror.net/doc/manual.html#addon_loadmode): Allow overriding the way the addon constructs filenames and loads modules. + +## 5.54.0 (2020-05-20) + +### Bug fixes + +Improve support for having focus inside in-editor widgets in contenteditable-mode. + +Fix issue where the scroll position could jump when clicking on a selection in Chrome. + +[python mode](https://codemirror.net/mode/python/): Better format string support. + +[javascript mode](https://codemirror.net/mode/javascript/): Improve parsing of private properties and class fields. + +[matchbrackets addon](https://codemirror.net/doc/manual.html#addon_matchbrackets): Disable highlighting when the editor doesn't have focus. + +### New features + +[runmode addon](https://codemirror.net/doc/manual.html#addon_runmode): Properly support for cross-line lookahead. + +[vim bindings](https://codemirror.net/demo/vim.html): Allow Ex-Commands with non-word names. + +[gfm mode](https://codemirror.net/mode/gfm/): Add a `fencedCodeBlockDefaultMode` option. + +## 5.53.2 (2020-04-21) + +### Bug fixes + +[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Fix a regression that broke completion picking. + +## 5.53.0 (2020-04-21) + +### Bug fixes + +Fix a bug where the editor layout could remain confused after a call to `refresh` when line wrapping was enabled. + +[dialog addon](https://codemirror.net/doc/manual.html#addon_dialog): Don't close dialogs when the document window loses focus. + +[merge addon](https://codemirror.net/doc/manual.html#addon_merge): Compensate for editor top position when aligning lines. + +[vim bindings](https://codemirror.net/demo/vim.html): Improve EOL handling. + +[emacs bindings](https://codemirror.net/demo/emacs.html): Include default keymap as a fallback. + +[julia mode](https://codemirror.net/mode/julia/): Fix an infinite loop bug. + +[show-hint addon](https://codemirror.net/doc/manual.html#addon_show-hint): Scroll cursor into view when picking a completion. + +### New features + +New option: [`screenReaderLabel`](https://codemirror.net/doc/manual.html#option_screenReaderLabel) to add a label to the editor. + +New mode: [wast](https://codemirror.net/mode/wast/). + +## 5.52.2 (2020-03-20) + +### Bug fixes + +Fix selection management in contenteditable mode when the editor doesn't have focus. + +Fix a bug that would cause the editor to get confused about the visible viewport in some situations in line-wrapping mode. + +[markdown mode](https://codemirror.net/mode/markdown/): Don't treat single dashes as setext header markers. + +[zenburn theme](https://codemirror.net/demo/theme.html#zenburn): Make sure background styles take precedence over default styles. + +[css mode](https://codemirror.net/mode/css/): Recognize a number of new properties. + ## 5.52.0 (2020-02-20) ### Bug fixes diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/comment/comment.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/comment/comment.js index efe40d2cd688..d0bf543ff99e 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/comment/comment.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/comment/comment.js @@ -1 +1 @@ -!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 n={},t=/[^\s\u00a0]/,i=e.Pos;function l(e){var n=e.search(t);return-1==n?0:n}function o(e,n){var t=e.getMode();return!1!==t.useInnerComments&&t.innerMode?e.getModeAt(n):t}e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",(function(e){e||(e=n);for(var t=1/0,l=this.listSelections(),o=null,r=l.length-1;r>=0;r--){var a=l[r].from(),m=l[r].to();a.line>=t||(m.line>=t&&(m=i(t,0)),t=a.line,null==o?this.uncomment(a,m,e)?o="un":(this.lineComment(a,m,e),o="line"):"un"==o?this.uncomment(a,m,e):this.lineComment(a,m,e))}})),e.defineExtension("lineComment",(function(e,r,a){a||(a=n);var m=this,c=o(m,e),f=m.getLine(e.line);if(null!=f&&(g=e,s=f,!/\bstring\b/.test(m.getTokenTypeAt(i(g.line,0)))||/^[\'\"\`]/.test(s))){var g,s,d=a.lineComment||c.lineComment;if(d){var u=Math.min(0!=r.ch||r.line==e.line?r.line+1:r.line,m.lastLine()+1),h=null==a.padding?" ":a.padding,p=a.commentBlankLines||e.line==r.line;m.operation((function(){if(a.indent){for(var n=null,o=e.line;o<u;++o){var r=(c=m.getLine(o)).slice(0,l(c));(null==n||n.length>r.length)&&(n=r)}for(o=e.line;o<u;++o){var c=m.getLine(o),f=n.length;(p||t.test(c))&&(c.slice(0,f)!=n&&(f=l(c)),m.replaceRange(n+d+h,i(o,0),i(o,f)))}}else for(o=e.line;o<u;++o)(p||t.test(m.getLine(o)))&&m.replaceRange(d+h,i(o,0))}))}else(a.blockCommentStart||c.blockCommentStart)&&(a.fullLines=!0,m.blockComment(e,r,a))}})),e.defineExtension("blockComment",(function(e,l,r){r||(r=n);var a=this,m=o(a,e),c=r.blockCommentStart||m.blockCommentStart,f=r.blockCommentEnd||m.blockCommentEnd;if(c&&f){if(!/\bcomment\b/.test(a.getTokenTypeAt(i(e.line,0)))){var g=Math.min(l.line,a.lastLine());g!=e.line&&0==l.ch&&t.test(a.getLine(g))&&--g;var s=null==r.padding?" ":r.padding;e.line>g||a.operation((function(){if(0!=r.fullLines){var n=t.test(a.getLine(g));a.replaceRange(s+f,i(g)),a.replaceRange(c+s,i(e.line,0));var o=r.blockCommentLead||m.blockCommentLead;if(null!=o)for(var d=e.line+1;d<=g;++d)(d!=g||n)&&a.replaceRange(o+s,i(d,0))}else a.replaceRange(f,l),a.replaceRange(c,e)}))}}else(r.lineComment||m.lineComment)&&0!=r.fullLines&&a.lineComment(e,l,r)})),e.defineExtension("uncomment",(function(e,l,r){r||(r=n);var a,m=this,c=o(m,e),f=Math.min(0!=l.ch||l.line==e.line?l.line:l.line-1,m.lastLine()),g=Math.min(e.line,f),s=r.lineComment||c.lineComment,d=[],u=null==r.padding?" ":r.padding;e:if(s){for(var h=g;h<=f;++h){var p=m.getLine(h),v=p.indexOf(s);if(v>-1&&!/comment/.test(m.getTokenTypeAt(i(h,v+1)))&&(v=-1),-1==v&&t.test(p))break e;if(v>-1&&t.test(p.slice(0,v)))break e;d.push(p)}if(m.operation((function(){for(var e=g;e<=f;++e){var n=d[e-g],t=n.indexOf(s),l=t+s.length;t<0||(n.slice(l,l+u.length)==u&&(l+=u.length),a=!0,m.replaceRange("",i(e,t),i(e,l)))}})),a)return!0}var C=r.blockCommentStart||c.blockCommentStart,b=r.blockCommentEnd||c.blockCommentEnd;if(!C||!b)return!1;var k=r.blockCommentLead||c.blockCommentLead,L=m.getLine(g),x=L.indexOf(C);if(-1==x)return!1;var R=f==g?L:m.getLine(f),O=R.indexOf(b,f==g?x+C.length:0),T=i(g,x+1),y=i(f,O+1);if(-1==O||!/comment/.test(m.getTokenTypeAt(T))||!/comment/.test(m.getTokenTypeAt(y))||m.getRange(T,y,"\n").indexOf(b)>-1)return!1;var E=L.lastIndexOf(C,e.ch),M=-1==E?-1:L.slice(0,e.ch).indexOf(b,E+C.length);if(-1!=E&&-1!=M&&M+b.length!=e.ch)return!1;M=R.indexOf(b,l.ch);var S=R.slice(l.ch).lastIndexOf(C,M-l.ch);return E=-1==M||-1==S?-1:l.ch+S,(-1==M||-1==E||E==l.ch)&&(m.operation((function(){m.replaceRange("",i(f,O-(u&&R.slice(O-u.length,O)==u?u.length:0)),i(f,O+b.length));var e=x+C.length;if(u&&L.slice(e,e+u.length)==u&&(e+=u.length),m.replaceRange("",i(g,x),i(g,e)),k)for(var n=g+1;n<=f;++n){var l=m.getLine(n),o=l.indexOf(k);if(-1!=o&&!t.test(l.slice(0,o))){var r=o+k.length;u&&l.slice(r,r+u.length)==u&&(r+=u.length),m.replaceRange("",i(n,o),i(n,r))}}})),!0)}))})); \ No newline at end of file +!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 n={},t=/[^\s\u00a0]/,i=e.Pos,l=e.cmpPos;function o(e){var n=e.search(t);return-1==n?0:n}function r(e,n){var t=e.getMode();return!1!==t.useInnerComments&&t.innerMode?e.getModeAt(n):t}e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",(function(e){e||(e=n);for(var t=1/0,l=this.listSelections(),o=null,r=l.length-1;r>=0;r--){var a=l[r].from(),m=l[r].to();a.line>=t||(m.line>=t&&(m=i(t,0)),t=a.line,null==o?this.uncomment(a,m,e)?o="un":(this.lineComment(a,m,e),o="line"):"un"==o?this.uncomment(a,m,e):this.lineComment(a,m,e))}})),e.defineExtension("lineComment",(function(e,l,a){a||(a=n);var m=this,c=r(m,e),s=m.getLine(e.line);if(null!=s&&(g=e,f=s,!/\bstring\b/.test(m.getTokenTypeAt(i(g.line,0)))||/^[\'\"\`]/.test(f))){var g,f,d=a.lineComment||c.lineComment;if(d){var u=Math.min(0!=l.ch||l.line==e.line?l.line+1:l.line,m.lastLine()+1),h=null==a.padding?" ":a.padding,C=a.commentBlankLines||e.line==l.line;m.operation((function(){if(a.indent){for(var n=null,l=e.line;l<u;++l){var r=(c=m.getLine(l)).slice(0,o(c));(null==n||n.length>r.length)&&(n=r)}for(l=e.line;l<u;++l){var c=m.getLine(l),s=n.length;(C||t.test(c))&&(c.slice(0,s)!=n&&(s=o(c)),m.replaceRange(n+d+h,i(l,0),i(l,s)))}}else for(l=e.line;l<u;++l)(C||t.test(m.getLine(l)))&&m.replaceRange(d+h,i(l,0))}))}else(a.blockCommentStart||c.blockCommentStart)&&(a.fullLines=!0,m.blockComment(e,l,a))}})),e.defineExtension("blockComment",(function(e,o,a){a||(a=n);var m=this,c=r(m,e),s=a.blockCommentStart||c.blockCommentStart,g=a.blockCommentEnd||c.blockCommentEnd;if(s&&g){if(!/\bcomment\b/.test(m.getTokenTypeAt(i(e.line,0)))){var f=Math.min(o.line,m.lastLine());f!=e.line&&0==o.ch&&t.test(m.getLine(f))&&--f;var d=null==a.padding?" ":a.padding;e.line>f||m.operation((function(){if(0!=a.fullLines){var n=t.test(m.getLine(f));m.replaceRange(d+g,i(f)),m.replaceRange(s+d,i(e.line,0));var r=a.blockCommentLead||c.blockCommentLead;if(null!=r)for(var u=e.line+1;u<=f;++u)(u!=f||n)&&m.replaceRange(r+d,i(u,0))}else{var h=0==l(m.getCursor("to"),o),C=!m.somethingSelected();m.replaceRange(g,o),h&&m.setSelection(C?o:m.getCursor("from"),o),m.replaceRange(s,e)}}))}}else(a.lineComment||c.lineComment)&&0!=a.fullLines&&m.lineComment(e,o,a)})),e.defineExtension("uncomment",(function(e,l,o){o||(o=n);var a,m=this,c=r(m,e),s=Math.min(0!=l.ch||l.line==e.line?l.line:l.line-1,m.lastLine()),g=Math.min(e.line,s),f=o.lineComment||c.lineComment,d=[],u=null==o.padding?" ":o.padding;e:if(f){for(var h=g;h<=s;++h){var C=m.getLine(h),p=C.indexOf(f);if(p>-1&&!/comment/.test(m.getTokenTypeAt(i(h,p+1)))&&(p=-1),-1==p&&t.test(C))break e;if(p>-1&&t.test(C.slice(0,p)))break e;d.push(C)}if(m.operation((function(){for(var e=g;e<=s;++e){var n=d[e-g],t=n.indexOf(f),l=t+f.length;t<0||(n.slice(l,l+u.length)==u&&(l+=u.length),a=!0,m.replaceRange("",i(e,t),i(e,l)))}})),a)return!0}var v=o.blockCommentStart||c.blockCommentStart,b=o.blockCommentEnd||c.blockCommentEnd;if(!v||!b)return!1;var k=o.blockCommentLead||c.blockCommentLead,L=m.getLine(g),x=L.indexOf(v);if(-1==x)return!1;var R=s==g?L:m.getLine(s),O=R.indexOf(b,s==g?x+v.length:0),T=i(g,x+1),S=i(s,O+1);if(-1==O||!/comment/.test(m.getTokenTypeAt(T))||!/comment/.test(m.getTokenTypeAt(S))||m.getRange(T,S,"\n").indexOf(b)>-1)return!1;var y=L.lastIndexOf(v,e.ch),E=-1==y?-1:L.slice(0,e.ch).indexOf(b,y+v.length);if(-1!=y&&-1!=E&&E+b.length!=e.ch)return!1;E=R.indexOf(b,l.ch);var M=R.slice(l.ch).lastIndexOf(v,E-l.ch);return y=-1==E||-1==M?-1:l.ch+M,(-1==E||-1==y||y==l.ch)&&(m.operation((function(){m.replaceRange("",i(s,O-(u&&R.slice(O-u.length,O)==u?u.length:0)),i(s,O+b.length));var e=x+v.length;if(u&&L.slice(e,e+u.length)==u&&(e+=u.length),m.replaceRange("",i(g,x),i(g,e)),k)for(var n=g+1;n<=s;++n){var l=m.getLine(n),o=l.indexOf(k);if(-1!=o&&!t.test(l.slice(0,o))){var r=o+k.length;u&&l.slice(r,r+u.length)==u&&(r+=u.length),m.replaceRange("",i(n,o),i(n,r))}}})),!0)}))})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/dialog/dialog.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/dialog/dialog.js index 9858b7177206..626a9265f9ab 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/dialog/dialog.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/dialog/dialog.js @@ -1 +1 @@ -!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 o(o,n,t){var i,r=o.getWrapperElement();return(i=r.appendChild(document.createElement("div"))).className=t?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?i.innerHTML=n:i.appendChild(n),e.addClass(r,"dialog-opened"),i}function n(e,o){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=o}e.defineExtension("openDialog",(function(t,i,r){r||(r={}),n(this,null);var u=o(this,t,r.bottom),l=!1,a=this;function c(o){if("string"==typeof o)s.value=o;else{if(l)return;l=!0,e.rmClass(u.parentNode,"dialog-opened"),u.parentNode.removeChild(u),a.focus(),r.onClose&&r.onClose(u)}}var d,s=u.getElementsByTagName("input")[0];return s?(s.focus(),r.value&&(s.value=r.value,!1!==r.selectValueOnOpen&&s.select()),r.onInput&&e.on(s,"input",(function(e){r.onInput(e,s.value,c)})),r.onKeyUp&&e.on(s,"keyup",(function(e){r.onKeyUp(e,s.value,c)})),e.on(s,"keydown",(function(o){r&&r.onKeyDown&&r.onKeyDown(o,s.value,c)||((27==o.keyCode||!1!==r.closeOnEnter&&13==o.keyCode)&&(s.blur(),e.e_stop(o),c()),13==o.keyCode&&i(s.value,o))})),!1!==r.closeOnBlur&&e.on(s,"blur",c)):(d=u.getElementsByTagName("button")[0])&&(e.on(d,"click",(function(){c(),a.focus()})),!1!==r.closeOnBlur&&e.on(d,"blur",c),d.focus()),c})),e.defineExtension("openConfirm",(function(t,i,r){n(this,null);var u=o(this,t,r&&r.bottom),l=u.getElementsByTagName("button"),a=!1,c=this,d=1;function s(){a||(a=!0,e.rmClass(u.parentNode,"dialog-opened"),u.parentNode.removeChild(u),c.focus())}l[0].focus();for(var f=0;f<l.length;++f){var p=l[f];!function(o){e.on(p,"click",(function(n){e.e_preventDefault(n),s(),o&&o(c)}))}(i[f]),e.on(p,"blur",(function(){--d,setTimeout((function(){d<=0&&s()}),200)})),e.on(p,"focus",(function(){++d}))}})),e.defineExtension("openNotification",(function(t,i){n(this,c);var r,u=o(this,t,i&&i.bottom),l=!1,a=i&&void 0!==i.duration?i.duration:5e3;function c(){l||(l=!0,clearTimeout(r),e.rmClass(u.parentNode,"dialog-opened"),u.parentNode.removeChild(u))}return e.on(u,"click",(function(o){e.e_preventDefault(o),c()})),a&&(r=setTimeout(c,a)),c}))})); \ No newline at end of file +!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 o(o,n,t){var i,r=o.getWrapperElement();return(i=r.appendChild(document.createElement("div"))).className=t?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?i.innerHTML=n:i.appendChild(n),e.addClass(r,"dialog-opened"),i}function n(e,o){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=o}e.defineExtension("openDialog",(function(t,i,r){r||(r={}),n(this,null);var u=o(this,t,r.bottom),l=!1,a=this;function c(o){if("string"==typeof o)s.value=o;else{if(l)return;l=!0,e.rmClass(u.parentNode,"dialog-opened"),u.parentNode.removeChild(u),a.focus(),r.onClose&&r.onClose(u)}}var d,s=u.getElementsByTagName("input")[0];return s?(s.focus(),r.value&&(s.value=r.value,!1!==r.selectValueOnOpen&&s.select()),r.onInput&&e.on(s,"input",(function(e){r.onInput(e,s.value,c)})),r.onKeyUp&&e.on(s,"keyup",(function(e){r.onKeyUp(e,s.value,c)})),e.on(s,"keydown",(function(o){r&&r.onKeyDown&&r.onKeyDown(o,s.value,c)||((27==o.keyCode||!1!==r.closeOnEnter&&13==o.keyCode)&&(s.blur(),e.e_stop(o),c()),13==o.keyCode&&i(s.value,o))})),!1!==r.closeOnBlur&&e.on(u,"focusout",(function(e){null!==e.relatedTarget&&c()}))):(d=u.getElementsByTagName("button")[0])&&(e.on(d,"click",(function(){c(),a.focus()})),!1!==r.closeOnBlur&&e.on(d,"blur",c),d.focus()),c})),e.defineExtension("openConfirm",(function(t,i,r){n(this,null);var u=o(this,t,r&&r.bottom),l=u.getElementsByTagName("button"),a=!1,c=this,d=1;function s(){a||(a=!0,e.rmClass(u.parentNode,"dialog-opened"),u.parentNode.removeChild(u),c.focus())}l[0].focus();for(var f=0;f<l.length;++f){var p=l[f];!function(o){e.on(p,"click",(function(n){e.e_preventDefault(n),s(),o&&o(c)}))}(i[f]),e.on(p,"blur",(function(){--d,setTimeout((function(){d<=0&&s()}),200)})),e.on(p,"focus",(function(){++d}))}})),e.defineExtension("openNotification",(function(t,i){n(this,c);var r,u=o(this,t,i&&i.bottom),l=!1,a=i&&void 0!==i.duration?i.duration:5e3;function c(){l||(l=!0,clearTimeout(r),e.rmClass(u.parentNode,"dialog-opened"),u.parentNode.removeChild(u))}return e.on(u,"click",(function(o){e.e_preventDefault(o),c()})),a&&(r=setTimeout(c,a)),c}))})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/display/placeholder.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/display/placeholder.js index ec5874537ffb..a5205e0573a4 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/display/placeholder.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/display/placeholder.js @@ -1 +1 @@ -!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 o(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function r(e){o(e);var r=e.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=e.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var t=e.getOption("placeholder");"string"==typeof t&&(t=document.createTextNode(t)),r.appendChild(t),e.display.lineSpace.insertBefore(r,e.display.lineSpace.firstChild)}function t(e){n(e)&&r(e)}function i(e){var t=e.getWrapperElement(),i=n(e);t.className=t.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?r(e):o(e)}function n(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",(function(r,n,l){var a=l&&l!=e.Init;if(n&&!a)r.on("blur",t),r.on("change",i),r.on("swapDoc",i),i(r);else if(!n&&a){r.off("blur",t),r.off("change",i),r.off("swapDoc",i),o(r);var c=r.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}n&&!r.hasFocus()&&t(r)}))})); \ No newline at end of file +!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 o(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function t(e){o(e);var t=e.state.placeholder=document.createElement("pre");t.style.cssText="height: 0; overflow: visible",t.style.direction=e.getOption("direction"),t.className="CodeMirror-placeholder CodeMirror-line-like";var r=e.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),t.appendChild(r),e.display.lineSpace.insertBefore(t,e.display.lineSpace.firstChild)}function r(e){i(e)&&t(e)}function n(e){var r=e.getWrapperElement(),n=i(e);r.className=r.className.replace(" CodeMirror-empty","")+(n?" CodeMirror-empty":""),n?t(e):o(e)}function i(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",(function(i,l,a){var c=a&&a!=e.Init;if(l&&!c)i.on("blur",r),i.on("change",n),i.on("swapDoc",n),e.on(i.getInputField(),"compositionupdate",i.state.placeholderCompose=function(){!function(e){setTimeout((function(){var r=!1,n=e.getInputField();"TEXTAREA"==n.nodeName?r=!n.value:1==e.lineCount()&&(r=!/[^\u200b]/.test(n.querySelector(".CodeMirror-line").textContent)),r?t(e):o(e)}),20)}(i)}),n(i);else if(!l&&c){i.off("blur",r),i.off("change",n),i.off("swapDoc",n),e.off(i.getInputField(),"compositionupdate",i.state.placeholderCompose),o(i);var p=i.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}l&&!i.hasFocus()&&r(i)}))})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/edit/closetag.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/edit/closetag.js index fc56385cb4c6..e05fcd2982a2 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/edit/closetag.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/edit/closetag.js @@ -1 +1 @@ -!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){e.defineOption("autoCloseTags",!1,(function(a,l,s){if(s!=e.Init&&s&&a.removeKeyMap("autoCloseTags"),l){var d={name:"autoCloseTags"};("object"!=typeof l||l.whenClosing)&&(d["'/'"]=function(t){return function(t){return t.getOption("disableInput")?e.Pass:o(t,!0)}(t)}),("object"!=typeof l||l.whenOpening)&&(d["'>'"]=function(o){return function(o){if(o.getOption("disableInput"))return e.Pass;for(var a=o.listSelections(),l=[],s=o.getOption("autoCloseTags"),d=0;d<a.length;d++){if(!a[d].empty())return e.Pass;var c=a[d].head,f=o.getTokenAt(c),g=e.innerMode(o.getMode(),f.state),u=g.state,m=g.mode.xmlCurrentTag&&g.mode.xmlCurrentTag(u),h=m&&m.name;if(!h)return e.Pass;var p="html"==g.mode.configuration,C="object"==typeof s&&s.dontCloseTags||p&&t,b="object"==typeof s&&s.indentTags||p&&n;f.end>c.ch&&(h=h.slice(0,h.length-f.end+c.ch));var v=h.toLowerCase();if(!h||"string"==f.type&&(f.end!=c.ch||!/[\"\']/.test(f.string.charAt(f.string.length-1))||1==f.string.length)||"tag"==f.type&&m.close||f.string.indexOf("/")==c.ch-f.start-1||C&&r(C,v)>-1||i(o,g.mode.xmlCurrentContext&&g.mode.xmlCurrentContext(u)||[],h,c,!0))return e.Pass;var y="object"==typeof s&&s.emptyTags;if(y&&r(y,h)>-1)l[d]={text:"/>",newPos:e.Pos(c.line,c.ch+2)};else{var x=b&&r(b,v)>-1;l[d]={indent:x,text:">"+(x?"\n\n":"")+"</"+h+">",newPos:x?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}}var P="object"==typeof s&&s.dontIndentOnAutoClose;for(d=a.length-1;d>=0;d--){var T=l[d];o.replaceRange(T.text,a[d].head,a[d].anchor,"+insert");var j=o.listSelections().slice(0);j[d]={head:T.newPos,anchor:T.newPos},o.setSelections(j),!P&&T.indent&&(o.indentLine(T.newPos.line,null,!0),o.indentLine(T.newPos.line+1,null,!0))}}(o)}),a.addKeyMap(d)}}));var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["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"];function o(t,n){for(var o=t.listSelections(),r=[],a=n?"/":"</",l=t.getOption("autoCloseTags"),s="object"==typeof l&&l.dontIndentOnSlash,d=0;d<o.length;d++){if(!o[d].empty())return e.Pass;var c=o[d].head,f=t.getTokenAt(c),g=e.innerMode(t.getMode(),f.state),u=g.state;if(n&&("string"==f.type||"<"!=f.string.charAt(0)||f.start!=c.ch-1))return e.Pass;var m,h="xml"!=g.mode.name&&"htmlmixed"==t.getMode().name;if(h&&"javascript"==g.mode.name)m=a+"script";else if(h&&"css"==g.mode.name)m=a+"style";else{var p=g.mode.xmlCurrentContext&&g.mode.xmlCurrentContext(u);if(!p||p.length&&i(t,p,p[p.length-1],c))return e.Pass;m=a+p[p.length-1]}">"!=t.getLine(c.line).charAt(f.end)&&(m+=">"),r[d]=m}if(t.replaceSelections(r),o=t.listSelections(),!s)for(d=0;d<o.length;d++)(d==o.length-1||o[d].head.line<o[d+1].head.line)&&t.indentLine(o[d].head.line)}function r(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,o=e.length;n<o;++n)if(e[n]==t)return n;return-1}function i(t,n,o,r,i){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!=o)return!1;for(var s=i?1:0,d=n.length-1;d>=0&&n[d]==o;d--)++s;r=l.to;for(d=1;d<s;d++){var c=e.scanForClosingTag(t,r,null,a);if(!c||c.tag!=o)return!1;r=c.to}return!0}e.commands.closeTag=function(e){return o(e)}})); \ No newline at end of file +!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){e.defineOption("autoCloseTags",!1,(function(a,l,s){if(s!=e.Init&&s&&a.removeKeyMap("autoCloseTags"),l){var d={name:"autoCloseTags"};"object"==typeof l&&!1===l.whenClosing||(d["'/'"]=function(t){return function(t){return t.getOption("disableInput")?e.Pass:o(t,!0)}(t)}),"object"==typeof l&&!1===l.whenOpening||(d["'>'"]=function(o){return function(o){if(o.getOption("disableInput"))return e.Pass;for(var a=o.listSelections(),l=[],s=o.getOption("autoCloseTags"),d=0;d<a.length;d++){if(!a[d].empty())return e.Pass;var c=a[d].head,f=o.getTokenAt(c),g=e.innerMode(o.getMode(),f.state),u=g.state,m=g.mode.xmlCurrentTag&&g.mode.xmlCurrentTag(u),h=m&&m.name;if(!h)return e.Pass;var p="html"==g.mode.configuration,C="object"==typeof s&&s.dontCloseTags||p&&t,b="object"==typeof s&&s.indentTags||p&&n;f.end>c.ch&&(h=h.slice(0,h.length-f.end+c.ch));var v=h.toLowerCase();if(!h||"string"==f.type&&(f.end!=c.ch||!/[\"\']/.test(f.string.charAt(f.string.length-1))||1==f.string.length)||"tag"==f.type&&m.close||f.string.indexOf("/")==c.ch-f.start-1||C&&r(C,v)>-1||i(o,g.mode.xmlCurrentContext&&g.mode.xmlCurrentContext(u)||[],h,c,!0))return e.Pass;var y="object"==typeof s&&s.emptyTags;if(y&&r(y,h)>-1)l[d]={text:"/>",newPos:e.Pos(c.line,c.ch+2)};else{var x=b&&r(b,v)>-1;l[d]={indent:x,text:">"+(x?"\n\n":"")+"</"+h+">",newPos:x?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}}var P="object"==typeof s&&s.dontIndentOnAutoClose;for(d=a.length-1;d>=0;d--){var T=l[d];o.replaceRange(T.text,a[d].head,a[d].anchor,"+insert");var j=o.listSelections().slice(0);j[d]={head:T.newPos,anchor:T.newPos},o.setSelections(j),!P&&T.indent&&(o.indentLine(T.newPos.line,null,!0),o.indentLine(T.newPos.line+1,null,!0))}}(o)}),a.addKeyMap(d)}}));var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["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"];function o(t,n){for(var o=t.listSelections(),r=[],a=n?"/":"</",l=t.getOption("autoCloseTags"),s="object"==typeof l&&l.dontIndentOnSlash,d=0;d<o.length;d++){if(!o[d].empty())return e.Pass;var c=o[d].head,f=t.getTokenAt(c),g=e.innerMode(t.getMode(),f.state),u=g.state;if(n&&("string"==f.type||"<"!=f.string.charAt(0)||f.start!=c.ch-1))return e.Pass;var m,h="xml"!=g.mode.name&&"htmlmixed"==t.getMode().name;if(h&&"javascript"==g.mode.name)m=a+"script";else if(h&&"css"==g.mode.name)m=a+"style";else{var p=g.mode.xmlCurrentContext&&g.mode.xmlCurrentContext(u);if(!p||p.length&&i(t,p,p[p.length-1],c))return e.Pass;m=a+p[p.length-1]}">"!=t.getLine(c.line).charAt(f.end)&&(m+=">"),r[d]=m}if(t.replaceSelections(r),o=t.listSelections(),!s)for(d=0;d<o.length;d++)(d==o.length-1||o[d].head.line<o[d+1].head.line)&&t.indentLine(o[d].head.line)}function r(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,o=e.length;n<o;++n)if(e[n]==t)return n;return-1}function i(t,n,o,r,i){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!=o)return!1;for(var s=i?1:0,d=n.length-1;d>=0&&n[d]==o;d--)++s;r=l.to;for(d=1;d<s;d++){var c=e.scanForClosingTag(t,r,null,a);if(!c||c.tag!=o)return!1;r=c.to}return!0}e.commands.closeTag=function(e){return o(e)}})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/edit/matchbrackets.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/edit/matchbrackets.js index d452dcd54d2c..646460818025 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/edit/matchbrackets.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/edit/matchbrackets.js @@ -1 +1 @@ -!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){var e=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=t.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(t){return t&&t.bracketRegex||/[(){}[\]]/}function a(t,e,a){var o=t.getLineHandle(e.line),l=e.ch-1,h=a&&a.afterCursor;null==h&&(h=/(^| )cm-fat-cursor($| )/.test(t.getWrapperElement().className));var s=i(a),u=!h&&l>=0&&s.test(o.text.charAt(l))&&r[o.text.charAt(l)]||s.test(o.text.charAt(l+1))&&r[o.text.charAt(++l)];if(!u)return null;var f=">"==u.charAt(1)?1:-1;if(a&&a.strict&&f>0!=(l==e.ch))return null;var m=t.getTokenTypeAt(n(e.line,l+1)),g=c(t,n(e.line,l+(f>0?1:0)),f,m||null,a);return null==g?null:{from:n(e.line,l),to:g&&g.pos,match:g&&g.ch==u.charAt(0),forward:f>0}}function c(t,e,a,c,o){for(var l=o&&o.maxScanLineLength||1e4,h=o&&o.maxScanLines||1e3,s=[],u=i(o),f=a>0?Math.min(e.line+h,t.lastLine()+1):Math.max(t.firstLine()-1,e.line-h),m=e.line;m!=f;m+=a){var g=t.getLine(m);if(g){var d=a>0?0:g.length-1,k=a>0?g.length:-1;if(!(g.length>l))for(m==e.line&&(d=e.ch-(a<0?1:0));d!=k;d+=a){var p=g.charAt(d);if(u.test(p)&&(void 0===c||t.getTokenTypeAt(n(m,d+1))==c)){var v=r[p];if(v&&">"==v.charAt(1)==a>0)s.push(p);else{if(!s.length)return{pos:n(m,d),ch:p};s.pop()}}}}}return m-a!=(a>0?t.lastLine():t.firstLine())&&null}function o(t,r,i){for(var c=t.state.matchBrackets.maxHighlightLineLength||1e3,o=[],l=t.listSelections(),h=0;h<l.length;h++){var s=l[h].empty()&&a(t,l[h].head,i);if(s&&t.getLine(s.from.line).length<=c){var u=s.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";o.push(t.markText(s.from,n(s.from.line,s.from.ch+1),{className:u})),s.to&&t.getLine(s.to.line).length<=c&&o.push(t.markText(s.to,n(s.to.line,s.to.ch+1),{className:u}))}}if(o.length){e&&t.state.focused&&t.focus();var f=function(){t.operation((function(){for(var t=0;t<o.length;t++)o[t].clear()}))};if(!r)return f;setTimeout(f,800)}}function l(t){t.operation((function(){t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null),t.state.matchBrackets.currentlyHighlighted=o(t,!1,t.state.matchBrackets)}))}t.defineOption("matchBrackets",!1,(function(e,n,r){r&&r!=t.Init&&(e.off("cursorActivity",l),e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)),n&&(e.state.matchBrackets="object"==typeof n?n:{},e.on("cursorActivity",l))})),t.defineExtension("matchBrackets",(function(){o(this,!0)})),t.defineExtension("findMatchingBracket",(function(t,e,n){return(n||"boolean"==typeof e)&&(n?(n.strict=e,e=n):e=e?{strict:!0}:null),a(this,t,e)})),t.defineExtension("scanForBracket",(function(t,e,n,r){return c(this,t,e,n,r)}))})); \ No newline at end of file +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){var e=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=t.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(t){return t&&t.bracketRegex||/[(){}[\]]/}function c(t,e,c){var o=t.getLineHandle(e.line),l=e.ch-1,s=c&&c.afterCursor;null==s&&(s=/(^| )cm-fat-cursor($| )/.test(t.getWrapperElement().className));var h=i(c),u=!s&&l>=0&&h.test(o.text.charAt(l))&&r[o.text.charAt(l)]||h.test(o.text.charAt(l+1))&&r[o.text.charAt(++l)];if(!u)return null;var f=">"==u.charAt(1)?1:-1;if(c&&c.strict&&f>0!=(l==e.ch))return null;var m=t.getTokenTypeAt(n(e.line,l+1)),g=a(t,n(e.line,l+(f>0?1:0)),f,m||null,c);return null==g?null:{from:n(e.line,l),to:g&&g.pos,match:g&&g.ch==u.charAt(0),forward:f>0}}function a(t,e,c,a,o){for(var l=o&&o.maxScanLineLength||1e4,s=o&&o.maxScanLines||1e3,h=[],u=i(o),f=c>0?Math.min(e.line+s,t.lastLine()+1):Math.max(t.firstLine()-1,e.line-s),m=e.line;m!=f;m+=c){var g=t.getLine(m);if(g){var d=c>0?0:g.length-1,k=c>0?g.length:-1;if(!(g.length>l))for(m==e.line&&(d=e.ch-(c<0?1:0));d!=k;d+=c){var p=g.charAt(d);if(u.test(p)&&(void 0===a||t.getTokenTypeAt(n(m,d+1))==a)){var v=r[p];if(v&&">"==v.charAt(1)==c>0)h.push(p);else{if(!h.length)return{pos:n(m,d),ch:p};h.pop()}}}}}return m-c!=(c>0?t.lastLine():t.firstLine())&&null}function o(t,r,i){for(var a=t.state.matchBrackets.maxHighlightLineLength||1e3,o=[],l=t.listSelections(),s=0;s<l.length;s++){var h=l[s].empty()&&c(t,l[s].head,i);if(h&&t.getLine(h.from.line).length<=a){var u=h.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";o.push(t.markText(h.from,n(h.from.line,h.from.ch+1),{className:u})),h.to&&t.getLine(h.to.line).length<=a&&o.push(t.markText(h.to,n(h.to.line,h.to.ch+1),{className:u}))}}if(o.length){e&&t.state.focused&&t.focus();var f=function(){t.operation((function(){for(var t=0;t<o.length;t++)o[t].clear()}))};if(!r)return f;setTimeout(f,800)}}function l(t){t.operation((function(){t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null),t.state.matchBrackets.currentlyHighlighted=o(t,!1,t.state.matchBrackets)}))}t.defineOption("matchBrackets",!1,(function(e,n,r){function i(t){t.state.matchBrackets&&t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null)}r&&r!=t.Init&&(e.off("cursorActivity",l),e.off("focus",l),e.off("blur",i),i(e)),n&&(e.state.matchBrackets="object"==typeof n?n:{},e.on("cursorActivity",l),e.on("focus",l),e.on("blur",i))})),t.defineExtension("matchBrackets",(function(){o(this,!0)})),t.defineExtension("findMatchingBracket",(function(t,e,n){return(n||"boolean"==typeof e)&&(n?(n.strict=e,e=n):e=e?{strict:!0}:null),c(this,t,e)})),t.defineExtension("scanForBracket",(function(t,e,n,r){return a(this,t,e,n,r)}))})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/javascript-hint.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/javascript-hint.js index f2f737c87bd1..26bbe37af99a 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/javascript-hint.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/javascript-hint.js @@ -1 +1 @@ -!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){var e=t.Pos;function r(t,e){for(var r=0,n=t.length;r<n;++r)e(t[r])}function n(r,n,i,o){var s=r.getCursor(),a=i(r,s);if(!/\b(?:string|comment)\b/.test(a.type)){var f=t.innerMode(r.getMode(),a.state);if("json"!==f.mode.helperType){a.state=f.state,/^[\w$_]*$/.test(a.string)?a.end>s.ch&&(a.end=s.ch,a.string=a.string.slice(0,s.ch-a.start)):a={start:s.ch,end:s.ch,string:"",state:a.state,type:"."==a.string?"property":null};for(var l=a;"property"==l.type;){if("."!=(l=i(r,e(s.line,l.start))).string)return;if(l=i(r,e(s.line,l.start)),!p)var p=[];p.push(l)}return{list:c(a,p,n,o),from:e(s.line,a.start),to:e(s.line,a.end)}}}}function i(t,e){var r=t.getTokenAt(e);return e.ch==r.start+1&&"."==r.string.charAt(0)?(r.end=r.start,r.string=".",r.type="property"):/^\.[\w$_]*$/.test(r.string)&&(r.type="property",r.start++,r.string=r.string.replace(/\./,"")),r}t.registerHelper("hint","javascript",(function(t,e){return n(t,f,(function(t,e){return t.getTokenAt(e)}),e)})),t.registerHelper("hint","coffeescript",(function(t,e){return n(t,l,i,e)}));var o="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),s="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),a="prototype apply call bind".split(" "),f="break case catch class const continue debugger default delete do else export extends false finally for function if in import instanceof new null return super switch this throw true try typeof var void while with yield".split(" "),l="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ");function c(t,e,n,i){var f=[],l=t.string,c=i&&i.globalScope||window;function p(t){0!=t.lastIndexOf(l,0)||function(t,e){if(!Array.prototype.indexOf){for(var r=t.length;r--;)if(t[r]===e)return!0;return!1}return-1!=t.indexOf(e)}(f,t)||f.push(t)}function u(t){"string"==typeof t?r(o,p):t instanceof Array?r(s,p):t instanceof Function&&r(a,p),function(t,e){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var r=t;r;r=Object.getPrototypeOf(r))Object.getOwnPropertyNames(r).forEach(e);else for(var n in t)e(n)}(t,p)}if(e&&e.length){var d,g=e.pop();for(g.type&&0===g.type.indexOf("variable")?(i&&i.additionalContext&&(d=i.additionalContext[g.string]),i&&!1===i.useGlobalScope||(d=d||c[g.string])):"string"==g.type?d="":"atom"==g.type?d=1:"function"==g.type&&(null==c.jQuery||"$"!=g.string&&"jQuery"!=g.string||"function"!=typeof c.jQuery?null!=c._&&"_"==g.string&&"function"==typeof c._&&(d=c._()):d=c.jQuery());null!=d&&e.length;)d=d[e.pop().string];null!=d&&u(d)}else{for(var y=t.state.localVars;y;y=y.next)p(y.name);for(var h=t.state.context;h;h=h.prev)for(y=h.vars;y;y=y.next)p(y.name);for(y=t.state.globalVars;y;y=y.next)p(y.name);i&&!1===i.useGlobalScope||u(c),r(n,p)}return f}})); \ No newline at end of file +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){var e=t.Pos;function r(t,e){for(var r=0,n=t.length;r<n;++r)e(t[r])}function n(r,n,i,o){var s=r.getCursor(),a=i(r,s);if(!/\b(?:string|comment)\b/.test(a.type)){var l=t.innerMode(r.getMode(),a.state);if("json"!==l.mode.helperType){a.state=l.state,/^[\w$_]*$/.test(a.string)?a.end>s.ch&&(a.end=s.ch,a.string=a.string.slice(0,s.ch-a.start)):a={start:s.ch,end:s.ch,string:"",state:a.state,type:"."==a.string?"property":null};for(var f=a;"property"==f.type;){if("."!=(f=i(r,e(s.line,f.start))).string)return;if(f=i(r,e(s.line,f.start)),!p)var p=[];p.push(f)}return{list:c(a,p,n,o),from:e(s.line,a.start),to:e(s.line,a.end)}}}}function i(t,e){var r=t.getTokenAt(e);return e.ch==r.start+1&&"."==r.string.charAt(0)?(r.end=r.start,r.string=".",r.type="property"):/^\.[\w$_]*$/.test(r.string)&&(r.type="property",r.start++,r.string=r.string.replace(/\./,"")),r}t.registerHelper("hint","javascript",(function(t,e){return n(t,l,(function(t,e){return t.getTokenAt(e)}),e)})),t.registerHelper("hint","coffeescript",(function(t,e){return n(t,f,i,e)}));var o="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),s="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),a="prototype apply call bind".split(" "),l="break case catch class const continue debugger default delete do else export extends false finally for function if in import instanceof new null return super switch this throw true try typeof var void while with yield".split(" "),f="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ");function c(t,e,n,i){var l=[],f=t.string,c=i&&i.globalScope||window;function p(t){0!=t.lastIndexOf(f,0)||function(t,e){if(!Array.prototype.indexOf){for(var r=t.length;r--;)if(t[r]===e)return!0;return!1}return-1!=t.indexOf(e)}(l,t)||l.push(t)}function u(t){"string"==typeof t?r(o,p):t instanceof Array?r(s,p):t instanceof Function&&r(a,p),function(t,e){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var r=t;r;r=Object.getPrototypeOf(r))Object.getOwnPropertyNames(r).forEach(e);else for(var n in t)e(n)}(t,p)}if(e&&e.length){var d,g=e.pop();for(g.type&&0===g.type.indexOf("variable")?(i&&i.additionalContext&&(d=i.additionalContext[g.string]),i&&!1===i.useGlobalScope||(d=d||c[g.string])):"string"==g.type?d="":"atom"==g.type?d=1:"function"==g.type&&(null==c.jQuery||"$"!=g.string&&"jQuery"!=g.string||"function"!=typeof c.jQuery?null!=c._&&"_"==g.string&&"function"==typeof c._&&(d=c._()):d=c.jQuery());null!=d&&e.length;)d=d[e.pop().string];null!=d&&u(d)}else{for(var y=t.state.localVars;y;y=y.next)p(y.name);for(var h=t.state.context;h;h=h.prev)for(y=h.vars;y;y=y.next)p(y.name);for(y=t.state.globalVars;y;y=y.next)p(y.name);if(i&&null!=i.additionalContext)for(var v in i.additionalContext)p(v);i&&!1===i.useGlobalScope||u(c),r(n,p)}return l}})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/show-hint.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/show-hint.js index 4ddff6f9abd1..abbfc5857cb5 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/show-hint.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/show-hint.js @@ -1 +1 @@ -!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";function i(t,i){this.cm=t,this.options=i,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var e=this;t.on("cursorActivity",this.activityFunc=function(){e.cursorActivity()})}t.showHint=function(t,i,e){if(!i)return t.showHint(e);e&&e.async&&(i.async=!0);var n={hint:i};if(e)for(var o in e)n[o]=e[o];return t.showHint(n)},t.defineExtension("showHint",(function(e){e=function(t,i,e){var n=t.options.hintOptions,o={};for(var s in l)o[s]=l[s];if(n)for(var s in n)void 0!==n[s]&&(o[s]=n[s]);if(e)for(var s in e)void 0!==e[s]&&(o[s]=e[s]);o.hint.resolve&&(o.hint=o.hint.resolve(t,i));return o}(this,this.getCursor("start"),e);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!e.hint.supportsSelection)return;for(var o=0;o<n.length;o++)if(n[o].head.line!=n[o].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var s=this.state.completionActive=new i(this,e);s.options.hint&&(t.signal(this,"startCompletion",this),s.update(!0))}})),t.defineExtension("closeHint",(function(){this.state.completionActive&&this.state.completionActive.close()}));var e=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},n=window.cancelAnimationFrame||clearTimeout;function o(t){return"string"==typeof t?t:t.text}function s(t,i){for(;i&&i!=t;){if("LI"===i.nodeName.toUpperCase()&&i.parentNode==t)return i;i=i.parentNode}}function c(i,e){this.completion=i,this.data=e,this.picked=!1;var n=this,c=i.cm,r=c.getInputField().ownerDocument,l=r.defaultView||r.parentWindow,h=this.hints=r.createElement("ul"),a=i.cm.options.theme;h.className="CodeMirror-hints "+a,this.selectedHint=e.selectedHint||0;for(var f=e.list,u=0;u<f.length;++u){var p=h.appendChild(r.createElement("li")),d=f[u],m="CodeMirror-hint"+(u!=this.selectedHint?"":" CodeMirror-hint-active");null!=d.className&&(m=d.className+" "+m),p.className=m,d.render?d.render(p,e,d):p.appendChild(r.createTextNode(d.displayText||o(d))),p.hintId=u}var g=i.options.container||r.body,v=c.cursorCoords(i.options.alignWithWord?e.from:null),y=v.left,w=v.bottom,C=!0,H=0,b=0;if(g!==r.body){var k=-1!==["absolute","relative","fixed"].indexOf(l.getComputedStyle(g).position)?g:g.offsetParent,A=k.getBoundingClientRect(),x=r.body.getBoundingClientRect();H=A.left-x.left-k.scrollLeft,b=A.top-x.top-k.scrollTop}h.style.left=y-H+"px",h.style.top=w-b+"px";var T=l.innerWidth||Math.max(r.body.offsetWidth,r.documentElement.offsetWidth),S=l.innerHeight||Math.max(r.body.offsetHeight,r.documentElement.offsetHeight);g.appendChild(h);var M=h.getBoundingClientRect(),F=M.bottom-S,N=h.scrollHeight>h.clientHeight+1,E=c.getScrollInfo();if(F>0){var O=M.bottom-M.top;if(v.top-(v.bottom-M.top)-O>0)h.style.top=(w=v.top-O-b)+"px",C=!1;else if(O>S){h.style.height=S-5+"px",h.style.top=(w=v.bottom-M.top-b)+"px";var P=c.getCursor();e.from.ch!=P.ch&&(v=c.cursorCoords(P),h.style.left=(y=v.left-H)+"px",M=h.getBoundingClientRect())}}var W,I=M.right-T;if(I>0&&(M.right-M.left>T&&(h.style.width=T-5+"px",I-=M.right-M.left-T),h.style.left=(y=v.left-I-H)+"px"),N)for(var B=h.firstChild;B;B=B.nextSibling)B.style.paddingRight=c.display.nativeBarWidth+"px";(c.addKeyMap(this.keyMap=function(t,i){var e={Up:function(){i.moveFocus(-1)},Down:function(){i.moveFocus(1)},PageUp:function(){i.moveFocus(1-i.menuSize(),!0)},PageDown:function(){i.moveFocus(i.menuSize()-1,!0)},Home:function(){i.setFocus(0)},End:function(){i.setFocus(i.length-1)},Enter:i.pick,Tab:i.pick,Esc:i.close};/Mac/.test(navigator.platform)&&(e["Ctrl-P"]=function(){i.moveFocus(-1)},e["Ctrl-N"]=function(){i.moveFocus(1)});var n=t.options.customKeys,o=n?{}:e;function s(t,n){var s;s="string"!=typeof n?function(t){return n(t,i)}:e.hasOwnProperty(n)?e[n]:n,o[t]=s}if(n)for(var c in n)n.hasOwnProperty(c)&&s(c,n[c]);var r=t.options.extraKeys;if(r)for(var c in r)r.hasOwnProperty(c)&&s(c,r[c]);return o}(i,{moveFocus:function(t,i){n.changeActive(n.selectedHint+t,i)},setFocus:function(t){n.changeActive(t)},menuSize:function(){return n.screenAmount()},length:f.length,close:function(){i.close()},pick:function(){n.pick()},data:e})),i.options.closeOnUnfocus)&&(c.on("blur",this.onBlur=function(){W=setTimeout((function(){i.close()}),100)}),c.on("focus",this.onFocus=function(){clearTimeout(W)}));return c.on("scroll",this.onScroll=function(){var t=c.getScrollInfo(),e=c.getWrapperElement().getBoundingClientRect(),n=w+E.top-t.top,o=n-(l.pageYOffset||(r.documentElement||r.body).scrollTop);if(C||(o+=h.offsetHeight),o<=e.top||o>=e.bottom)return i.close();h.style.top=n+"px",h.style.left=y+E.left-t.left+"px"}),t.on(h,"dblclick",(function(t){var i=s(h,t.target||t.srcElement);i&&null!=i.hintId&&(n.changeActive(i.hintId),n.pick())})),t.on(h,"click",(function(t){var e=s(h,t.target||t.srcElement);e&&null!=e.hintId&&(n.changeActive(e.hintId),i.options.completeOnSingleClick&&n.pick())})),t.on(h,"mousedown",(function(){setTimeout((function(){c.focus()}),20)})),this.scrollToActive(),t.signal(e,"select",f[this.selectedHint],h.childNodes[this.selectedHint]),!0}function r(t,i,e,n){if(t.async)t(i,n,e);else{var o=t(i,e);o&&o.then?o.then(n):n(o)}}i.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&t.signal(this.data,"close"),this.widget&&this.widget.close(),t.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(i,e){var n=i.list[e];n.hint?n.hint(this.cm,i,n):this.cm.replaceRange(o(n),n.from||i.from,n.to||i.to,"complete"),t.signal(i,"pick",n),this.close()},cursorActivity:function(){this.debounce&&(n(this.debounce),this.debounce=0);var t=this.cm.getCursor(),i=this.cm.getLine(t.line);if(t.line!=this.startPos.line||i.length-t.ch!=this.startLen-this.startPos.ch||t.ch<this.startPos.ch||this.cm.somethingSelected()||!t.ch||this.options.closeCharacters.test(i.charAt(t.ch-1)))this.close();else{var o=this;this.debounce=e((function(){o.update()})),this.widget&&this.widget.disable()}},update:function(t){if(null!=this.tick){var i=this,e=++this.tick;r(this.options.hint,this.cm,this.options,(function(n){i.tick==e&&i.finishUpdate(n,t)}))}},finishUpdate:function(i,e){this.data&&t.signal(this.data,"update");var n=this.widget&&this.widget.picked||e&&this.options.completeSingle;this.widget&&this.widget.close(),this.data=i,i&&i.list.length&&(n&&1==i.list.length?this.pick(i,0):(this.widget=new c(this,i),t.signal(i,"shown")))}},c.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var t=this.completion.cm;this.completion.options.closeOnUnfocus&&(t.off("blur",this.onBlur),t.off("focus",this.onFocus)),t.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var t=this;this.keyMap={Enter:function(){t.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(i,e){if(i>=this.data.list.length?i=e?this.data.list.length-1:0:i<0&&(i=e?0:this.data.list.length-1),this.selectedHint!=i){var n=this.hints.childNodes[this.selectedHint];n&&(n.className=n.className.replace(" CodeMirror-hint-active","")),(n=this.hints.childNodes[this.selectedHint=i]).className+=" CodeMirror-hint-active",this.scrollToActive(),t.signal(this.data,"select",this.data.list[this.selectedHint],n)}},scrollToActive:function(){var t=this.hints.childNodes[this.selectedHint];t.offsetTop<this.hints.scrollTop?this.hints.scrollTop=t.offsetTop-3:t.offsetTop+t.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=t.offsetTop+t.offsetHeight-this.hints.clientHeight+3)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},t.registerHelper("hint","auto",{resolve:function(i,e){var n,o=i.getHelpers(e,"hint");if(o.length){var s=function(t,i,e){var n=function(t,i){if(!t.somethingSelected())return i;for(var e=[],n=0;n<i.length;n++)i[n].supportsSelection&&e.push(i[n]);return e}(t,o);!function o(s){if(s==n.length)return i(null);r(n[s],t,e,(function(t){t&&t.list.length>0?i(t):o(s+1)}))}(0)};return s.async=!0,s.supportsSelection=!0,s}return(n=i.getHelper(i.getCursor(),"hintWords"))?function(i){return t.hint.fromList(i,{words:n})}:t.hint.anyword?function(i,e){return t.hint.anyword(i,e)}:function(){}}}),t.registerHelper("hint","fromList",(function(i,e){var n,o=i.getCursor(),s=i.getTokenAt(o),c=t.Pos(o.line,s.start),r=o;s.start<o.ch&&/\w/.test(s.string.charAt(o.ch-s.start-1))?n=s.string.substr(0,o.ch-s.start):(n="",c=o);for(var l=[],h=0;h<e.words.length;h++){var a=e.words[h];a.slice(0,n.length)==n&&l.push(a)}if(l.length)return{list:l,from:c,to:r}})),t.commands.autocomplete=t.showHint;var l={hint:t.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};t.defineOption("hintOptions",null)})); \ No newline at end of file +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";function i(t,i){this.cm=t,this.options=i,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var e=this;t.on("cursorActivity",this.activityFunc=function(){e.cursorActivity()})}t.showHint=function(t,i,e){if(!i)return t.showHint(e);e&&e.async&&(i.async=!0);var n={hint:i};if(e)for(var o in e)n[o]=e[o];return t.showHint(n)},t.defineExtension("showHint",(function(e){e=function(t,i,e){var n=t.options.hintOptions,o={};for(var s in l)o[s]=l[s];if(n)for(var s in n)void 0!==n[s]&&(o[s]=n[s]);if(e)for(var s in e)void 0!==e[s]&&(o[s]=e[s]);o.hint.resolve&&(o.hint=o.hint.resolve(t,i));return o}(this,this.getCursor("start"),e);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!e.hint.supportsSelection)return;for(var o=0;o<n.length;o++)if(n[o].head.line!=n[o].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var s=this.state.completionActive=new i(this,e);s.options.hint&&(t.signal(this,"startCompletion",this),s.update(!0))}})),t.defineExtension("closeHint",(function(){this.state.completionActive&&this.state.completionActive.close()}));var e=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},n=window.cancelAnimationFrame||clearTimeout;function o(t){return"string"==typeof t?t:t.text}function s(t,i){for(;i&&i!=t;){if("LI"===i.nodeName.toUpperCase()&&i.parentNode==t)return i;i=i.parentNode}}function c(i,e){this.completion=i,this.data=e,this.picked=!1;var n=this,c=i.cm,r=c.getInputField().ownerDocument,l=r.defaultView||r.parentWindow,h=this.hints=r.createElement("ul"),a=i.cm.options.theme;h.className="CodeMirror-hints "+a,this.selectedHint=e.selectedHint||0;for(var f=e.list,u=0;u<f.length;++u){var d=h.appendChild(r.createElement("li")),p=f[u],m="CodeMirror-hint"+(u!=this.selectedHint?"":" CodeMirror-hint-active");null!=p.className&&(m=p.className+" "+m),d.className=m,p.render?p.render(d,e,p):d.appendChild(r.createTextNode(p.displayText||o(p))),d.hintId=u}var g=i.options.container||r.body,v=c.cursorCoords(i.options.alignWithWord?e.from:null),y=v.left,w=v.bottom,C=!0,H=0,b=0;if(g!==r.body){var k=-1!==["absolute","relative","fixed"].indexOf(l.getComputedStyle(g).position)?g:g.offsetParent,A=k.getBoundingClientRect(),x=r.body.getBoundingClientRect();H=A.left-x.left-k.scrollLeft,b=A.top-x.top-k.scrollTop}h.style.left=y-H+"px",h.style.top=w-b+"px";var T=l.innerWidth||Math.max(r.body.offsetWidth,r.documentElement.offsetWidth),M=l.innerHeight||Math.max(r.body.offsetHeight,r.documentElement.offsetHeight);g.appendChild(h);var S=h.getBoundingClientRect(),N=S.bottom-M,F=h.scrollHeight>h.clientHeight+1,E=c.getScrollInfo();if(N>0){var O=S.bottom-S.top;if(v.top-(v.bottom-S.top)-O>0)h.style.top=(w=v.top-O-b)+"px",C=!1;else if(O>M){h.style.height=M-5+"px",h.style.top=(w=v.bottom-S.top-b)+"px";var P=c.getCursor();e.from.ch!=P.ch&&(v=c.cursorCoords(P),h.style.left=(y=v.left-H)+"px",S=h.getBoundingClientRect())}}var W,I=S.right-T;if(I>0&&(S.right-S.left>T&&(h.style.width=T-5+"px",I-=S.right-S.left-T),h.style.left=(y=v.left-I-H)+"px"),F)for(var B=h.firstChild;B;B=B.nextSibling)B.style.paddingRight=c.display.nativeBarWidth+"px";(c.addKeyMap(this.keyMap=function(t,i){var e={Up:function(){i.moveFocus(-1)},Down:function(){i.moveFocus(1)},PageUp:function(){i.moveFocus(1-i.menuSize(),!0)},PageDown:function(){i.moveFocus(i.menuSize()-1,!0)},Home:function(){i.setFocus(0)},End:function(){i.setFocus(i.length-1)},Enter:i.pick,Tab:i.pick,Esc:i.close};/Mac/.test(navigator.platform)&&(e["Ctrl-P"]=function(){i.moveFocus(-1)},e["Ctrl-N"]=function(){i.moveFocus(1)});var n=t.options.customKeys,o=n?{}:e;function s(t,n){var s;s="string"!=typeof n?function(t){return n(t,i)}:e.hasOwnProperty(n)?e[n]:n,o[t]=s}if(n)for(var c in n)n.hasOwnProperty(c)&&s(c,n[c]);var r=t.options.extraKeys;if(r)for(var c in r)r.hasOwnProperty(c)&&s(c,r[c]);return o}(i,{moveFocus:function(t,i){n.changeActive(n.selectedHint+t,i)},setFocus:function(t){n.changeActive(t)},menuSize:function(){return n.screenAmount()},length:f.length,close:function(){i.close()},pick:function(){n.pick()},data:e})),i.options.closeOnUnfocus)&&(c.on("blur",this.onBlur=function(){W=setTimeout((function(){i.close()}),100)}),c.on("focus",this.onFocus=function(){clearTimeout(W)}));return c.on("scroll",this.onScroll=function(){var t=c.getScrollInfo(),e=c.getWrapperElement().getBoundingClientRect(),n=w+E.top-t.top,o=n-(l.pageYOffset||(r.documentElement||r.body).scrollTop);if(C||(o+=h.offsetHeight),o<=e.top||o>=e.bottom)return i.close();h.style.top=n+"px",h.style.left=y+E.left-t.left+"px"}),t.on(h,"dblclick",(function(t){var i=s(h,t.target||t.srcElement);i&&null!=i.hintId&&(n.changeActive(i.hintId),n.pick())})),t.on(h,"click",(function(t){var e=s(h,t.target||t.srcElement);e&&null!=e.hintId&&(n.changeActive(e.hintId),i.options.completeOnSingleClick&&n.pick())})),t.on(h,"mousedown",(function(){setTimeout((function(){c.focus()}),20)})),this.scrollToActive(),t.signal(e,"select",f[this.selectedHint],h.childNodes[this.selectedHint]),!0}function r(t,i,e,n){if(t.async)t(i,n,e);else{var o=t(i,e);o&&o.then?o.then(n):n(o)}}i.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&t.signal(this.data,"close"),this.widget&&this.widget.close(),t.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(i,e){var n=i.list[e],s=this;this.cm.operation((function(){n.hint?n.hint(s.cm,i,n):s.cm.replaceRange(o(n),n.from||i.from,n.to||i.to,"complete"),t.signal(i,"pick",n),s.cm.scrollIntoView()})),this.close()},cursorActivity:function(){this.debounce&&(n(this.debounce),this.debounce=0);var t=this.startPos;this.data&&(t=this.data.from);var i=this.cm.getCursor(),o=this.cm.getLine(i.line);if(i.line!=this.startPos.line||o.length-i.ch!=this.startLen-this.startPos.ch||i.ch<t.ch||this.cm.somethingSelected()||!i.ch||this.options.closeCharacters.test(o.charAt(i.ch-1)))this.close();else{var s=this;this.debounce=e((function(){s.update()})),this.widget&&this.widget.disable()}},update:function(t){if(null!=this.tick){var i=this,e=++this.tick;r(this.options.hint,this.cm,this.options,(function(n){i.tick==e&&i.finishUpdate(n,t)}))}},finishUpdate:function(i,e){this.data&&t.signal(this.data,"update");var n=this.widget&&this.widget.picked||e&&this.options.completeSingle;this.widget&&this.widget.close(),this.data=i,i&&i.list.length&&(n&&1==i.list.length?this.pick(i,0):(this.widget=new c(this,i),t.signal(i,"shown")))}},c.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var t=this.completion.cm;this.completion.options.closeOnUnfocus&&(t.off("blur",this.onBlur),t.off("focus",this.onFocus)),t.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var t=this;this.keyMap={Enter:function(){t.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(i,e){if(i>=this.data.list.length?i=e?this.data.list.length-1:0:i<0&&(i=e?0:this.data.list.length-1),this.selectedHint!=i){var n=this.hints.childNodes[this.selectedHint];n&&(n.className=n.className.replace(" CodeMirror-hint-active","")),(n=this.hints.childNodes[this.selectedHint=i]).className+=" CodeMirror-hint-active",this.scrollToActive(),t.signal(this.data,"select",this.data.list[this.selectedHint],n)}},scrollToActive:function(){var t=this.completion.options.scrollMargin||0,i=this.hints.childNodes[Math.max(0,this.selectedHint-t)],e=this.hints.childNodes[Math.min(this.data.list.length-1,this.selectedHint+t)],n=this.hints.firstChild;i.offsetTop<this.hints.scrollTop?this.hints.scrollTop=i.offsetTop-n.offsetTop:e.offsetTop+e.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=e.offsetTop+e.offsetHeight-this.hints.clientHeight+n.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},t.registerHelper("hint","auto",{resolve:function(i,e){var n,o=i.getHelpers(e,"hint");if(o.length){var s=function(t,i,e){var n=function(t,i){if(!t.somethingSelected())return i;for(var e=[],n=0;n<i.length;n++)i[n].supportsSelection&&e.push(i[n]);return e}(t,o);!function o(s){if(s==n.length)return i(null);r(n[s],t,e,(function(t){t&&t.list.length>0?i(t):o(s+1)}))}(0)};return s.async=!0,s.supportsSelection=!0,s}return(n=i.getHelper(i.getCursor(),"hintWords"))?function(i){return t.hint.fromList(i,{words:n})}:t.hint.anyword?function(i,e){return t.hint.anyword(i,e)}:function(){}}}),t.registerHelper("hint","fromList",(function(i,e){var n,o=i.getCursor(),s=i.getTokenAt(o),c=t.Pos(o.line,s.start),r=o;s.start<o.ch&&/\w/.test(s.string.charAt(o.ch-s.start-1))?n=s.string.substr(0,o.ch-s.start):(n="",c=o);for(var l=[],h=0;h<e.words.length;h++){var a=e.words[h];a.slice(0,n.length)==n&&l.push(a)}if(l.length)return{list:l,from:c,to:r}})),t.commands.autocomplete=t.showHint;var l={hint:t.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};t.defineOption("hintOptions",null)})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/sql-hint.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/sql-hint.js index 4839ca0b8629..2dd137fdb8d5 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/sql-hint.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/sql-hint.js @@ -1 +1 @@ -!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../../mode/sql/sql")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/sql/sql"],t):t(CodeMirror)}((function(t){"use strict";var e,r,n,o,i=";",s="AS",a=t.Pos,u=t.cmpPos;function l(t){return"[object Array]"==Object.prototype.toString.call(t)}function f(t){return"string"==typeof t?t:t.text}function c(t,e){return l(e)&&(e={columns:e}),e.text||(e.text=t),e}function p(t){return e[t.toUpperCase()]}function d(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function g(t,e){var r=t.length,n=f(e).substr(0,r);return t.toUpperCase()===n.toUpperCase()}function h(t,e,r,n){if(l(r))for(var o=0;o<r.length;o++)g(e,r[o])&&t.push(n(r[o]));else for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];g(e,s=s&&!0!==s?s.displayText?{text:s.text,displayText:s.displayText}:s.text:i)&&t.push(n(s))}}function v(t){"."==t.charAt(0)&&(t=t.substr(1));for(var e=t.split(o+o),r=0;r<e.length;r++)e[r]=e[r].replace(new RegExp(o,"g"),"");return e.join(o)}function x(t){for(var e=f(t).split("."),r=0;r<e.length;r++)e[r]=o+e[r].replace(new RegExp(o,"g"),o+o)+o;var n=e.join(".");return"string"==typeof t?n:((t=d(t)).text=n,t)}function m(t,e){for(var r=t.split(/\s+/),n=0;n<r.length;n++)r[n]&&e(r[n].replace(/[,;]/g,""))}function b(t,e){for(var r=e.doc,n=r.getValue(),o=t.toUpperCase(),l="",f="",c=[],d={start:a(0,0),end:a(e.lastLine(),e.getLineHandle(e.lastLine()).length)},g=n.indexOf(i);-1!=g;)c.push(r.posFromIndex(g)),g=n.indexOf(i,g+1);c.unshift(a(0,0)),c.push(a(e.lastLine(),e.getLineHandle(e.lastLine()).text.length));for(var h=null,v=e.getCursor(),x=0;x<c.length;x++){if((null==h||u(v,h)>0)&&u(v,c[x])<=0){d={start:h,end:c[x]};break}h=c[x]}if(d.start){var b=r.getRange(d.start,d.end,!1);for(x=0;x<b.length;x++){if(m(b[x],(function(t){var e=t.toUpperCase();e===o&&p(l)&&(f=l),e!==s&&(l=t)})),f)break}}return f}t.registerHelper("hint","sql",(function(i,s){e=function(t){var e={};if(l(t))for(var r=t.length-1;r>=0;r--){var n=t[r];e[f(n).toUpperCase()]=c(f(n),n)}else if(t)for(var o in t)e[o.toUpperCase()]=c(o,t[o]);return e}(s&&s.tables);var u=s&&s.defaultTable,g=s&&s.disableKeywords;r=u&&p(u),n=function(e){var r=e.doc.modeOption;return"sql"===r&&(r="text/x-sql"),t.resolveMode(r).keywords}(i),o=function(e){var r=e.doc.modeOption;return"sql"===r&&(r="text/x-sql"),t.resolveMode(r).identifierQuote||"`"}(i),u&&!r&&(r=b(u,i)),(r=r||[]).columns&&(r=r.columns);var m,y,C,q=i.getCursor(),A=[],j=i.getTokenAt(q);if(j.end>q.ch&&(j.end=q.ch,j.string=j.string.slice(0,q.ch-j.start)),j.string.match(/^[.`"\w@]\w*$/)?(C=j.string,m=j.start,y=j.end):(m=y=q.ch,C=""),"."==C.charAt(0)||C.charAt(0)==o)m=function(t,n,i,s){for(var u=!1,l=[],f=n.start,c=!0;c;)c="."==n.string.charAt(0),u=u||n.string.charAt(0)==o,f=n.start,l.unshift(v(n.string)),"."==(n=s.getTokenAt(a(t.line,n.start))).string&&(c=!0,n=s.getTokenAt(a(t.line,n.start)));var g=l.join(".");h(i,g,e,(function(t){return u?x(t):t})),h(i,g,r,(function(t){return u?x(t):t})),g=l.pop();var m=l.join("."),y=!1,C=m;if(!p(m)){var q=m;(m=b(m,s))!==q&&(y=!0)}var A=p(m);return A&&A.columns&&(A=A.columns),A&&h(i,g,A,(function(t){var e=m;return 1==y&&(e=C),"string"==typeof t?t=e+"."+t:(t=d(t)).text=e+"."+t.text,u?x(t):t})),f}(q,j,A,i);else{var w=function(t,e){return"object"==typeof t?t.className=e:t={text:t,className:e},t};h(A,C,r,(function(t){return w(t,"CodeMirror-hint-table CodeMirror-hint-default-table")})),h(A,C,e,(function(t){return w(t,"CodeMirror-hint-table")})),g||h(A,C,n,(function(t){return w(t.toUpperCase(),"CodeMirror-hint-keyword")}))}return{list:A,from:a(q.line,m),to:a(q.line,y)}}))})); \ No newline at end of file +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../../mode/sql/sql")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/sql/sql"],t):t(CodeMirror)}((function(t){"use strict";var e,r,n,o,i=";",s="AS",a=t.Pos,u=t.cmpPos;function l(t){return"[object Array]"==Object.prototype.toString.call(t)}function f(t){return"string"==typeof t?t:t.text}function c(t,e){return l(e)&&(e={columns:e}),e.text||(e.text=t),e}function p(t){return e[t.toUpperCase()]}function d(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function g(t,e){var r=t.length,n=f(e).substr(0,r);return t.toUpperCase()===n.toUpperCase()}function h(t,e,r,n){if(l(r))for(var o=0;o<r.length;o++)g(e,r[o])&&t.push(n(r[o]));else for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];g(e,s=s&&!0!==s?s.displayText?{text:s.text,displayText:s.displayText}:s.text:i)&&t.push(n(s))}}function v(t){"."==t.charAt(0)&&(t=t.substr(1));for(var e=t.split(o+o),r=0;r<e.length;r++)e[r]=e[r].replace(new RegExp(o,"g"),"");return e.join(o)}function x(t){for(var e=f(t).split("."),r=0;r<e.length;r++)e[r]=o+e[r].replace(new RegExp(o,"g"),o+o)+o;var n=e.join(".");return"string"==typeof t?n:((t=d(t)).text=n,t)}function m(t,e){for(var r=t.split(/\s+/),n=0;n<r.length;n++)r[n]&&e(r[n].replace(/[,;]/g,""))}function b(t,e){for(var r=e.doc,n=r.getValue(),o=t.toUpperCase(),l="",f="",c=[],d={start:a(0,0),end:a(e.lastLine(),e.getLineHandle(e.lastLine()).length)},g=n.indexOf(i);-1!=g;)c.push(r.posFromIndex(g)),g=n.indexOf(i,g+1);c.unshift(a(0,0)),c.push(a(e.lastLine(),e.getLineHandle(e.lastLine()).text.length));for(var h=null,v=e.getCursor(),x=0;x<c.length;x++){if((null==h||u(v,h)>0)&&u(v,c[x])<=0){d={start:h,end:c[x]};break}h=c[x]}if(d.start){var b=r.getRange(d.start,d.end,!1);for(x=0;x<b.length;x++){if(m(b[x],(function(t){var e=t.toUpperCase();e===o&&p(l)&&(f=l),e!==s&&(l=t)})),f)break}}return f}t.registerHelper("hint","sql",(function(i,s){e=function(t){var e={};if(l(t))for(var r=t.length-1;r>=0;r--){var n=t[r];e[f(n).toUpperCase()]=c(f(n),n)}else if(t)for(var o in t)e[o.toUpperCase()]=c(o,t[o]);return e}(s&&s.tables);var u=s&&s.defaultTable,g=s&&s.disableKeywords;r=u&&p(u),n=function(e){var r=e.doc.modeOption;return"sql"===r&&(r="text/x-sql"),t.resolveMode(r).keywords}(i),o=function(e){var r=e.doc.modeOption;return"sql"===r&&(r="text/x-sql"),t.resolveMode(r).identifierQuote||"`"}(i),u&&!r&&(r=b(u,i)),(r=r||[]).columns&&(r=r.columns);var m,y,C,q=i.getCursor(),A=[],j=i.getTokenAt(q);if(j.end>q.ch&&(j.end=q.ch,j.string=j.string.slice(0,q.ch-j.start)),j.string.match(/^[.`"'\w@][\w$#]*$/g)?(C=j.string,m=j.start,y=j.end):(m=y=q.ch,C=""),"."==C.charAt(0)||C.charAt(0)==o)m=function(t,n,i,s){for(var u=!1,l=[],f=n.start,c=!0;c;)c="."==n.string.charAt(0),u=u||n.string.charAt(0)==o,f=n.start,l.unshift(v(n.string)),"."==(n=s.getTokenAt(a(t.line,n.start))).string&&(c=!0,n=s.getTokenAt(a(t.line,n.start)));var g=l.join(".");h(i,g,e,(function(t){return u?x(t):t})),h(i,g,r,(function(t){return u?x(t):t})),g=l.pop();var m=l.join("."),y=!1,C=m;if(!p(m)){var q=m;(m=b(m,s))!==q&&(y=!0)}var A=p(m);return A&&A.columns&&(A=A.columns),A&&h(i,g,A,(function(t){var e=m;return 1==y&&(e=C),"string"==typeof t?t=e+"."+t:(t=d(t)).text=e+"."+t.text,u?x(t):t})),f}(q,j,A,i);else{var w=function(t,e){return"object"==typeof t?t.className=e:t={text:t,className:e},t};h(A,C,r,(function(t){return w(t,"CodeMirror-hint-table CodeMirror-hint-default-table")})),h(A,C,e,(function(t){return w(t,"CodeMirror-hint-table")})),g||h(A,C,n,(function(t){return w(t.toUpperCase(),"CodeMirror-hint-keyword")}))}return{list:A,from:a(q.line,m),to:a(q.line,y)}}))})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/xml-hint.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/xml-hint.js index d727e7f20010..4c2212083aac 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/xml-hint.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/hint/xml-hint.js @@ -1 +1 @@ -!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";var e=t.Pos;function r(t,e,r){return r?t.indexOf(e)>=0:0==t.lastIndexOf(e,0)}t.registerHelper("hint","xml",(function(n,s){var i=s&&s.schemaInfo,a=s&&s.quoteChar||'"',o=s&&s.matchInMiddle;if(i){var l=n.getCursor(),g=n.getTokenAt(l);if(g.end>l.ch&&(g.end=l.ch,g.string=g.string.slice(0,l.ch-g.start)),(x=t.innerMode(n.getMode(),g.state)).mode.xmlCurrentTag){var f,c,h=[],u=!1,d=/\btag\b/.test(g.type)&&!/>$/.test(g.string),p=d&&/^\w/.test(g.string);if(p){var m=n.getLine(l.line).slice(Math.max(0,g.start-2),g.start),v=/<\/$/.test(m)?"close":/<$/.test(m)?"open":null;v&&(c=g.start-("close"==v?2:1))}else d&&"<"==g.string?v="open":d&&"</"==g.string&&(v="close");var y=x.mode.xmlCurrentTag(x.state);if(!d&&!y||v){p&&(f=g.string),u=v;var x,C=x.mode.xmlCurrentContext?x.mode.xmlCurrentContext(x.state):[],b=(x=C.length&&C[C.length-1])&&i[x],O=x?b&&b.children:i["!top"];if(O&&"close"!=v)for(var w=0;w<O.length;++w)f&&!r(O[w],f,o)||h.push("<"+O[w]);else if("close"!=v)for(var A in i)!i.hasOwnProperty(A)||"!top"==A||"!attrs"==A||f&&!r(A,f,o)||h.push("<"+A);x&&(!f||"close"==v&&r(x,f,o))&&h.push("</"+x+">")}else{var M=(b=y&&i[y.name])&&b.attrs,P=i["!attrs"];if(!M&&!P)return;if(M){if(P){var $={};for(var I in P)P.hasOwnProperty(I)&&($[I]=P[I]);for(var I in M)M.hasOwnProperty(I)&&($[I]=M[I]);M=$}}else M=P;if("string"==g.type||"="==g.string){var T,j=(m=n.getRange(e(l.line,Math.max(0,l.ch-60)),e(l.line,"string"==g.type?g.start:g.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!j||!M.hasOwnProperty(j[1])||!(T=M[j[1]]))return;if("function"==typeof T&&(T=T.call(this,n)),"string"==g.type){f=g.string;var q=0;/['"]/.test(g.string.charAt(0))&&(a=g.string.charAt(0),f=g.string.slice(1),q++);var L=g.string.length;if(/['"]/.test(g.string.charAt(L-1))&&(a=g.string.charAt(L-1),f=g.string.substr(q,L-2)),q){var k=n.getLine(l.line);k.length>g.end&&k.charAt(g.end)==a&&g.end++}u=!0}for(w=0;w<T.length;++w)f&&!r(T[w],f,o)||h.push(a+T[w]+a)}else for(var H in"attribute"==g.type&&(f=g.string,u=!0),M)!M.hasOwnProperty(H)||f&&!r(H,f,o)||h.push(H)}return{list:h,from:u?e(l.line,null==c?g.start:c):l,to:u?e(l.line,g.end):l}}}}))})); \ No newline at end of file +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";var e=t.Pos;function r(t,e,r){return r?t.indexOf(e)>=0:0==t.lastIndexOf(e,0)}t.registerHelper("hint","xml",(function(n,i){var s=i&&i.schemaInfo,a=i&&i.quoteChar||'"',o=i&&i.matchInMiddle;if(s){var l=n.getCursor(),f=n.getTokenAt(l);if(f.end>l.ch&&(f.end=l.ch,f.string=f.string.slice(0,l.ch-f.start)),(x=t.innerMode(n.getMode(),f.state)).mode.xmlCurrentTag){var g,c,h=[],u=!1,d=/\btag\b/.test(f.type)&&!/>$/.test(f.string),p=d&&/^\w/.test(f.string);if(p){var m=n.getLine(l.line).slice(Math.max(0,f.start-2),f.start),v=/<\/$/.test(m)?"close":/<$/.test(m)?"open":null;v&&(c=f.start-("close"==v?2:1))}else d&&"<"==f.string?v="open":d&&"</"==f.string&&(v="close");var y=x.mode.xmlCurrentTag(x.state);if(!d&&!y||v){p&&(g=f.string),u=v;var x,C=x.mode.xmlCurrentContext?x.mode.xmlCurrentContext(x.state):[],b=(x=C.length&&C[C.length-1])&&s[x],O=x?b&&b.children:s["!top"];if(O&&"close"!=v)for(var w=0;w<O.length;++w)g&&!r(O[w],g,o)||h.push("<"+O[w]);else if("close"!=v)for(var A in s)!s.hasOwnProperty(A)||"!top"==A||"!attrs"==A||g&&!r(A,g,o)||h.push("<"+A);x&&(!g||"close"==v&&r(x,g,o))&&h.push("</"+x+">")}else{var M=(b=y&&s[y.name])&&b.attrs,P=s["!attrs"];if(!M&&!P)return;if(M){if(P){var $={};for(var I in P)P.hasOwnProperty(I)&&($[I]=P[I]);for(var I in M)M.hasOwnProperty(I)&&($[I]=M[I]);M=$}}else M=P;if("string"==f.type||"="==f.string){var T,j=(m=n.getRange(e(l.line,Math.max(0,l.ch-60)),e(l.line,"string"==f.type?f.start:f.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!j||!M.hasOwnProperty(j[1])||!(T=M[j[1]]))return;if("function"==typeof T&&(T=T.call(this,n)),"string"==f.type){g=f.string;var q=0;/['"]/.test(f.string.charAt(0))&&(a=f.string.charAt(0),g=f.string.slice(1),q++);var L=f.string.length;if(/['"]/.test(f.string.charAt(L-1))&&(a=f.string.charAt(L-1),g=f.string.substr(q,L-2)),q){var k=n.getLine(l.line);k.length>f.end&&k.charAt(f.end)==a&&f.end++}u=!0}function H(t){if(t)for(var e=0;e<t.length;++e)g&&!r(t[e],g,o)||h.push(a+t[e]+a);return z()}return T&&T.then?T.then(H):H(T)}for(var R in"attribute"==f.type&&(g=f.string,u=!0),M)!M.hasOwnProperty(R)||g&&!r(R,g,o)||h.push(R)}return z()}}function z(){return{list:h,from:u?e(l.line,null==c?f.start:c):l,to:u?e(l.line,f.end):l}}}))})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/lint/lint.css b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/lint/lint.css index f097cfe345a5..0871865959a1 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/lint/lint.css +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/lint/lint.css @@ -25,22 +25,20 @@ -ms-transition: opacity .4s; } -.CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning { +.CodeMirror-lint-mark { background-position: left bottom; background-repeat: repeat-x; } -.CodeMirror-lint-mark-error { - background-image: - url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==") - ; -} - .CodeMirror-lint-mark-warning { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII="); } -.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning { +.CodeMirror-lint-mark-error { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg=="); +} + +.CodeMirror-lint-marker { background-position: center center; background-repeat: no-repeat; cursor: pointer; @@ -51,20 +49,20 @@ position: relative; } -.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning { +.CodeMirror-lint-message { padding-left: 18px; background-position: top left; background-repeat: no-repeat; } -.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII="); -} - .CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII="); } +.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII="); +} + .CodeMirror-lint-marker-multiple { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC"); background-repeat: no-repeat; diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/lint/lint.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/lint/lint.js index b6c844b46502..7aa9e7d9894a 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/lint/lint.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/lint/lint.js @@ -1 +1 @@ -!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";var e="CodeMirror-lint-markers";function n(t){t.parentNode&&t.parentNode.removeChild(t)}function o(e,o,r,i){var a=function(e,n,o){var r=document.createElement("div");function i(e){if(!r.parentNode)return t.off(document,"mousemove",i);r.style.top=Math.max(0,e.clientY-r.offsetHeight-5)+"px",r.style.left=e.clientX+5+"px"}return r.className="CodeMirror-lint-tooltip cm-s-"+e.options.theme,r.appendChild(o.cloneNode(!0)),e.state.lint.options.selfContain?e.getWrapperElement().appendChild(r):document.body.appendChild(r),t.on(document,"mousemove",i),i(n),null!=r.style.opacity&&(r.style.opacity=1),r}(e,o,r);function s(){var e;t.off(i,"mouseout",s),a&&((e=a).parentNode&&(null==e.style.opacity&&n(e),e.style.opacity=0,setTimeout((function(){n(e)}),600)),a=null)}var l=setInterval((function(){if(a)for(var t=i;;t=t.parentNode){if(t&&11==t.nodeType&&(t=t.host),t==document.body)return;if(!t){s();break}}if(!a)return clearInterval(l)}),400);t.on(i,"mouseout",s)}function r(t,e,n){this.marked=[],this.options=e,this.timeout=null,this.hasGutter=n,this.onMouseOver=function(e){!function(t,e){var n=e.target||e.srcElement;if(!/\bCodeMirror-lint-mark-/.test(n.className))return;for(var r=n.getBoundingClientRect(),i=(r.left+r.right)/2,a=(r.top+r.bottom)/2,l=t.findMarksAt(t.coordsChar({left:i,top:a},"client")),u=[],c=0;c<l.length;++c){var f=l[c].__annotation;f&&u.push(f)}u.length&&function(t,e,n){for(var r=n.target||n.srcElement,i=document.createDocumentFragment(),a=0;a<e.length;a++){var l=e[a];i.appendChild(s(l))}o(t,n,i,r)}(t,u,e)}(t,e)},this.waitingFor=0}function i(t){var n=t.state.lint;n.hasGutter&&t.clearGutter(e);for(var o=0;o<n.marked.length;++o)n.marked[o].clear();n.marked.length=0}function a(e,n,r,i,a){var s=document.createElement("div"),l=s;return s.className="CodeMirror-lint-marker-"+r,i&&((l=s.appendChild(document.createElement("div"))).className="CodeMirror-lint-marker-multiple"),0!=a&&t.on(l,"mouseover",(function(t){o(e,t,n,l)})),s}function s(t){var e=t.severity;e||(e="error");var n=document.createElement("div");return n.className="CodeMirror-lint-message-"+e,void 0!==t.messageHTML?n.innerHTML=t.messageHTML:n.appendChild(document.createTextNode(t.message)),n}function l(e){var n=e.state.lint.options,o=n.options||n,r=n.getAnnotations||e.getHelper(t.Pos(0,0),"lint");if(r)if(n.async||r.async)!function(e,n,o){var r=e.state.lint,i=++r.waitingFor;function a(){i=-1,e.off("change",a)}e.on("change",a),n(e.getValue(),(function(n,o){e.off("change",a),r.waitingFor==i&&(o&&n instanceof t&&(n=o),e.operation((function(){u(e,n)})))}),o,e)}(e,r,o);else{var i=r(e.getValue(),o,e);if(!i)return;i.then?i.then((function(t){e.operation((function(){u(e,t)}))})):e.operation((function(){u(e,i)}))}}function u(t,n){i(t);for(var o,r,l=t.state.lint,u=l.options,c=function(t){for(var e=[],n=0;n<t.length;++n){var o=t[n],r=o.from.line;(e[r]||(e[r]=[])).push(o)}return e}(n),f=0;f<c.length;++f){var m=c[f];if(m){for(var d=null,p=l.hasGutter&&document.createDocumentFragment(),h=0;h<m.length;++h){var v=m[h],g=v.severity;g||(g="error"),r=g,d="error"==(o=d)?o:r,u.formatAnnotation&&(v=u.formatAnnotation(v)),l.hasGutter&&p.appendChild(s(v)),v.to&&l.marked.push(t.markText(v.from,v.to,{className:"CodeMirror-lint-mark-"+g,__annotation:v}))}l.hasGutter&&t.setGutterMarker(f,e,a(t,p,d,m.length>1,l.options.tooltips))}}u.onUpdateLinting&&u.onUpdateLinting(n,c,t)}function c(t){var e=t.state.lint;e&&(clearTimeout(e.timeout),e.timeout=setTimeout((function(){l(t)}),e.options.delay||500))}t.defineOption("lint",!1,(function(n,o,a){if(a&&a!=t.Init&&(i(n),!1!==n.state.lint.options.lintOnChange&&n.off("change",c),t.off(n.getWrapperElement(),"mouseover",n.state.lint.onMouseOver),clearTimeout(n.state.lint.timeout),delete n.state.lint),o){for(var s=n.getOption("gutters"),u=!1,f=0;f<s.length;++f)s[f]==e&&(u=!0);var m=n.state.lint=new r(n,(d=o)instanceof Function?{getAnnotations:d}:(d&&!0!==d||(d={}),d),u);!1!==m.options.lintOnChange&&n.on("change",c),0!=m.options.tooltips&&"gutter"!=m.options.tooltips&&t.on(n.getWrapperElement(),"mouseover",m.onMouseOver),l(n)}var d})),t.defineExtension("performLint",(function(){this.state.lint&&l(this)}))})); \ No newline at end of file +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";var e="CodeMirror-lint-markers";function n(t){t.parentNode&&t.parentNode.removeChild(t)}function o(e,o,r,i){var a=function(e,n,o){var r=document.createElement("div");function i(e){if(!r.parentNode)return t.off(document,"mousemove",i);r.style.top=Math.max(0,e.clientY-r.offsetHeight-5)+"px",r.style.left=e.clientX+5+"px"}return r.className="CodeMirror-lint-tooltip cm-s-"+e.options.theme,r.appendChild(o.cloneNode(!0)),e.state.lint.options.selfContain?e.getWrapperElement().appendChild(r):document.body.appendChild(r),t.on(document,"mousemove",i),i(n),null!=r.style.opacity&&(r.style.opacity=1),r}(e,o,r);function s(){var e;t.off(i,"mouseout",s),a&&((e=a).parentNode&&(null==e.style.opacity&&n(e),e.style.opacity=0,setTimeout((function(){n(e)}),600)),a=null)}var l=setInterval((function(){if(a)for(var t=i;;t=t.parentNode){if(t&&11==t.nodeType&&(t=t.host),t==document.body)return;if(!t){s();break}}if(!a)return clearInterval(l)}),400);t.on(i,"mouseout",s)}function r(t,e,n){this.marked=[],this.options=e,this.timeout=null,this.hasGutter=n,this.onMouseOver=function(e){!function(t,e){var n=e.target||e.srcElement;if(!/\bCodeMirror-lint-mark-/.test(n.className))return;for(var r=n.getBoundingClientRect(),i=(r.left+r.right)/2,a=(r.top+r.bottom)/2,l=t.findMarksAt(t.coordsChar({left:i,top:a},"client")),u=[],c=0;c<l.length;++c){var f=l[c].__annotation;f&&u.push(f)}u.length&&function(t,e,n){for(var r=n.target||n.srcElement,i=document.createDocumentFragment(),a=0;a<e.length;a++){var l=e[a];i.appendChild(s(l))}o(t,n,i,r)}(t,u,e)}(t,e)},this.waitingFor=0}function i(t){var n=t.state.lint;n.hasGutter&&t.clearGutter(e);for(var o=0;o<n.marked.length;++o)n.marked[o].clear();n.marked.length=0}function a(e,n,r,i,a){var s=document.createElement("div"),l=s;return s.className="CodeMirror-lint-marker CodeMirror-lint-marker-"+r,i&&((l=s.appendChild(document.createElement("div"))).className="CodeMirror-lint-marker CodeMirror-lint-marker-multiple"),0!=a&&t.on(l,"mouseover",(function(t){o(e,t,n,l)})),s}function s(t){var e=t.severity;e||(e="error");var n=document.createElement("div");return n.className="CodeMirror-lint-message CodeMirror-lint-message-"+e,void 0!==t.messageHTML?n.innerHTML=t.messageHTML:n.appendChild(document.createTextNode(t.message)),n}function l(e){var n=e.state.lint.options,o=n.options||n,r=n.getAnnotations||e.getHelper(t.Pos(0,0),"lint");if(r)if(n.async||r.async)!function(e,n,o){var r=e.state.lint,i=++r.waitingFor;function a(){i=-1,e.off("change",a)}e.on("change",a),n(e.getValue(),(function(n,o){e.off("change",a),r.waitingFor==i&&(o&&n instanceof t&&(n=o),e.operation((function(){u(e,n)})))}),o,e)}(e,r,o);else{var i=r(e.getValue(),o,e);if(!i)return;i.then?i.then((function(t){e.operation((function(){u(e,t)}))})):e.operation((function(){u(e,i)}))}}function u(t,n){i(t);for(var o,r,l=t.state.lint,u=l.options,c=function(t){for(var e=[],n=0;n<t.length;++n){var o=t[n],r=o.from.line;(e[r]||(e[r]=[])).push(o)}return e}(n),f=0;f<c.length;++f){var m=c[f];if(m){for(var d=null,p=l.hasGutter&&document.createDocumentFragment(),h=0;h<m.length;++h){var v=m[h],g=v.severity;g||(g="error"),r=g,d="error"==(o=d)?o:r,u.formatAnnotation&&(v=u.formatAnnotation(v)),l.hasGutter&&p.appendChild(s(v)),v.to&&l.marked.push(t.markText(v.from,v.to,{className:"CodeMirror-lint-mark CodeMirror-lint-mark-"+g,__annotation:v}))}l.hasGutter&&t.setGutterMarker(f,e,a(t,p,d,m.length>1,l.options.tooltips))}}u.onUpdateLinting&&u.onUpdateLinting(n,c,t)}function c(t){var e=t.state.lint;e&&(clearTimeout(e.timeout),e.timeout=setTimeout((function(){l(t)}),e.options.delay||500))}t.defineOption("lint",!1,(function(n,o,a){if(a&&a!=t.Init&&(i(n),!1!==n.state.lint.options.lintOnChange&&n.off("change",c),t.off(n.getWrapperElement(),"mouseover",n.state.lint.onMouseOver),clearTimeout(n.state.lint.timeout),delete n.state.lint),o){for(var s=n.getOption("gutters"),u=!1,f=0;f<s.length;++f)s[f]==e&&(u=!0);var m=n.state.lint=new r(n,(d=o)instanceof Function?{getAnnotations:d}:(d&&!0!==d||(d={}),d),u);!1!==m.options.lintOnChange&&n.on("change",c),0!=m.options.tooltips&&"gutter"!=m.options.tooltips&&t.on(n.getWrapperElement(),"mouseover",m.onMouseOver),l(n)}var d})),t.defineExtension("performLint",(function(){this.state.lint&&l(this)}))})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/merge/merge.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/merge/merge.js index 45627a3cee0b..a4909dcd3c0c 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/merge/merge.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/merge/merge.js @@ -1 +1 @@ -!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","diff_match_patch"],e):e(CodeMirror)}((function(e){"use strict";var t=e.Pos,i="http://www.w3.org/2000/svg";function r(e,t){this.mv=e,this.type=t,this.classes="left"==t?{chunk:"CodeMirror-merge-l-chunk",start:"CodeMirror-merge-l-chunk-start",end:"CodeMirror-merge-l-chunk-end",insert:"CodeMirror-merge-l-inserted",del:"CodeMirror-merge-l-deleted",connect:"CodeMirror-merge-l-connect"}:{chunk:"CodeMirror-merge-r-chunk",start:"CodeMirror-merge-r-chunk-start",end:"CodeMirror-merge-r-chunk-end",insert:"CodeMirror-merge-r-inserted",del:"CodeMirror-merge-r-deleted",connect:"CodeMirror-merge-r-connect"}}function n(t){t.diffOutOfDate&&(t.diff=L(t.orig.getValue(),t.edit.getValue(),t.mv.options.ignoreWhitespace),t.chunks=D(t.diff),t.diffOutOfDate=!1,e.signal(t.edit,"updateDiff",t.diff))}r.prototype={constructor:r,init:function(t,i,r){this.edit=this.mv.edit,(this.edit.state.diffViews||(this.edit.state.diffViews=[])).push(this),this.orig=e(t,W({value:i,readOnly:!this.mv.options.allowEditingOriginals},W(r))),"align"==this.mv.options.connect&&(this.edit.state.trackAlignable||(this.edit.state.trackAlignable=new _(this.edit)),this.orig.state.trackAlignable=new _(this.orig)),this.lockButton.title=this.edit.phrase("Toggle locked scrolling"),this.orig.state.diffViews=[this];var n=r.chunkClassLocation||"background";"[object Array]"!=Object.prototype.toString.call(n)&&(n=[n]),this.classes.classLocation=n,this.diff=L(M(i),M(r.value),this.mv.options.ignoreWhitespace),this.chunks=D(this.diff),this.diffOutOfDate=this.dealigned=!1,this.needsScrollSync=null,this.showDifferences=!1!==r.showDifferences},registerEvents:function(t){this.forceUpdate=function(t){var i,r={from:0,to:0,marked:[]},a={from:0,to:0,marked:[]},s=!1;function c(e){o=!0,s=!1,"full"==e&&(t.svg&&N(t.svg),t.copyButtons&&N(t.copyButtons),h(t.edit,r.marked,t.classes),h(t.orig,a.marked,t.classes),r.from=r.to=a.from=a.to=0),n(t),t.showDifferences&&(f(t.edit,t.diff,r,DIFF_INSERT,t.classes),f(t.orig,t.diff,a,DIFF_DELETE,t.classes)),"align"==t.mv.options.connect&&k(t),u(t),null!=t.needsScrollSync&&l(t,t.needsScrollSync),o=!1}function g(e){o||(t.dealigned=!0,d(e))}function d(e){o||s||(clearTimeout(i),!0===e&&(s=!0),i=setTimeout(c,!0===e?20:250))}function m(e,i){t.diffOutOfDate||(t.diffOutOfDate=!0,r.from=r.to=a.from=a.to=0),g(i.text.length-1!=i.to.line-i.from.line)}function v(){t.diffOutOfDate=!0,t.dealigned=!0,c("full")}t.edit.on("change",m),t.orig.on("change",m),t.edit.on("swapDoc",v),t.orig.on("swapDoc",v),"align"==t.mv.options.connect&&(e.on(t.edit.state.trackAlignable,"realign",g),e.on(t.orig.state.trackAlignable,"realign",g));return t.edit.on("viewportChange",(function(){d(!1)})),t.orig.on("viewportChange",(function(){d(!1)})),c(),c}(this),s(this,!0,!1),function(e,t){e.edit.on("scroll",(function(){l(e,!0)&&u(e)})),e.orig.on("scroll",(function(){l(e,!1)&&u(e),t&&l(t,!0)&&u(t)}))}(this,t)},setShowDifferences:function(e){(e=!1!==e)!=this.showDifferences&&(this.showDifferences=e,this.forceUpdate("full"))}};var o=!1;function l(e,t){if(e.diffOutOfDate)return e.lockScroll&&null==e.needsScrollSync&&(e.needsScrollSync=t),!1;if(e.needsScrollSync=null,!e.lockScroll)return!0;var i,r,n=+new Date;if(t?(i=e.edit,r=e.orig):(i=e.orig,r=e.edit),i.state.scrollSetBy==e&&(i.state.scrollSetAt||0)+250>n)return!1;var o=i.getScrollInfo();if("align"==e.mv.options.connect)v=o.top;else{var l,s,c=.5*o.clientHeight,h=o.top+c,f=i.lineAtHeight(h,"local"),g=function(e,t,i){for(var r,n,o,l,a=0;a<e.length;a++){var s=e[a],c=i?s.editFrom:s.origFrom,h=i?s.editTo:s.origTo;null==n&&(c>t?(n=s.editFrom,l=s.origFrom):h>t&&(n=s.editTo,l=s.origTo)),h<=t?(r=s.editTo,o=s.origTo):c<=t&&(r=s.editFrom,o=s.origFrom)}return{edit:{before:r,after:n},orig:{before:o,after:l}}}(e.chunks,f,t),d=a(i,t?g.edit:g.orig),u=a(r,t?g.orig:g.edit),m=(h-d.top)/(d.bot-d.top),v=u.top-c+m*(u.bot-u.top);if(v>o.top&&(s=o.top/c)<1)v=v*s+o.top*(1-s);else if((l=o.height-o.clientHeight-o.top)<c){var p=r.getScrollInfo();p.height-p.clientHeight-v>l&&(s=l/c)<1&&(v=v*s+(p.height-p.clientHeight-l)*(1-s))}}return r.scrollTo(o.left,v),r.state.scrollSetAt=n,r.state.scrollSetBy=e,!0}function a(e,t){var i=t.after;return null==i&&(i=e.lastLine()+1),{top:e.heightAtLine(t.before||0,"local"),bot:e.heightAtLine(i,"local")}}function s(t,i,r){t.lockScroll=i,i&&0!=r&&l(t,DIFF_INSERT)&&u(t),(i?e.addClass:e.rmClass)(t.lockButton,"CodeMirror-merge-scrolllock-enabled")}function c(e,t,i){for(var r=i.classLocation,n=0;n<r.length;n++)e.removeLineClass(t,r[n],i.chunk),e.removeLineClass(t,r[n],i.start),e.removeLineClass(t,r[n],i.end)}function h(t,i,r){for(var n=0;n<i.length;++n){var o=i[n];o instanceof e.TextMarker?o.clear():o.parent&&c(t,o,r)}i.length=0}function f(e,t,i,r,n){var o=e.getViewport();e.operation((function(){i.from==i.to||o.from-i.to>20||i.from-o.to>20?(h(e,i.marked,n),d(e,t,r,i.marked,o.from,o.to,n),i.from=o.from,i.to=o.to):(o.from<i.from&&(d(e,t,r,i.marked,o.from,i.from,n),i.from=o.from),o.to>i.to&&(d(e,t,r,i.marked,i.to,o.to,n),i.to=o.to))}))}function g(e,t,i,r,n,o){for(var l=i.classLocation,a=e.getLineHandle(t),s=0;s<l.length;s++)r&&e.addLineClass(a,l[s],i.chunk),n&&e.addLineClass(a,l[s],i.start),o&&e.addLineClass(a,l[s],i.end);return a}function d(e,i,r,n,o,l,a){var s=t(0,0),c=t(o,0),h=e.clipPos(t(l-1)),f=r==DIFF_DELETE?a.del:a.insert;function d(t,i){for(var r=Math.max(o,t),s=Math.min(l,i),c=r;c<s;++c)n.push(g(e,c,a,!0,c==t,c==i-1));t==i&&r==i&&s==i&&(r?n.push(g(e,r-1,a,!1,!1,!0)):n.push(g(e,r,a,!1,!0,!1)))}for(var u=0,m=!1,v=0;v<i.length;++v){var p=i[v],k=p[0],C=p[1];if(k==DIFF_EQUAL){var b=s.line+(E(i,v)?0:1);V(s,C);var w=s.line+(A(i,v)?1:0);w>b&&(m&&(d(u,b),m=!1),u=w)}else if(m=!0,k==r){var T=V(s,C,!0),y=P(c,s),F=H(h,T);j(y,F)||n.push(e.markText(y,F,{className:f})),s=T}}m&&d(u,s.line+1)}function u(e){if(e.showDifferences){if(e.svg){N(e.svg);var t=e.gap.offsetWidth;R(e.svg,"width",t,"height",e.gap.offsetHeight)}e.copyButtons&&N(e.copyButtons);for(var i=e.edit.getViewport(),r=e.orig.getViewport(),n=e.mv.wrap.getBoundingClientRect().top,o=n-e.edit.getScrollerElement().getBoundingClientRect().top+e.edit.getScrollInfo().top,l=n-e.orig.getScrollerElement().getBoundingClientRect().top+e.orig.getScrollInfo().top,a=0;a<e.chunks.length;a++){var s=e.chunks[a];s.editFrom<=i.to&&s.editTo>=i.from&&s.origFrom<=r.to&&s.origTo>=r.from&&w(e,s,l,o,t)}}}function m(e,t){for(var i=0,r=0,n=0;n<t.length;n++){var o=t[n];if(o.editTo>e&&o.editFrom<=e)return null;if(o.editFrom>e)break;i=o.editTo,r=o.origTo}return r+(e-i)}function v(e,t,i){for(var r=e.state.trackAlignable,n=e.firstLine(),o=0,l=[],a=0;;a++){for(var s=t[a],c=s?i?s.origFrom:s.editFrom:1e9;o<r.alignable.length;o+=2){var h=r.alignable[o]+1;if(!(h<=n)){if(!(h<=c))break;l.push(h)}}if(!s)break;l.push(n=i?s.origTo:s.editTo)}return l}function p(e,t,i,r){var n=0,o=0,l=0,a=0;e:for(;;n++){var s=e[n],c=t[o];if(!s&&null==c)break;for(var h=s?s[0]:1e9,f=null==c?1e9:c;l<i.length;){var g=i[l];if(g.origFrom<=f&&g.origTo>f){o++,n--;continue e}if(g.editTo>h){if(g.editFrom<=h)continue e;break}a+=g.origTo-g.origFrom-(g.editTo-g.editFrom),l++}if(h==f-a)s[r]=f,o++;else if(h<f-a)s[r]=h+a;else{var d=[f-a,null,null];d[r]=f,e.splice(n,0,d),o++}}}function k(e,t){if(e.dealigned||t){if(!e.orig.curOp)return e.orig.operation((function(){k(e,t)}));e.dealigned=!1;var i=e.mv.left==e?e.mv.right:e.mv.left;i&&(n(i),i.dealigned=!1);for(var r=function(e,t){var i=v(e.edit,e.chunks,!1),r=[];if(t)for(var n=0,o=0;n<t.chunks.length;n++){for(var l=t.chunks[n].editTo;o<i.length&&i[o]<l;)o++;o!=i.length&&i[o]==l||i.splice(o++,0,l)}for(n=0;n<i.length;n++)r.push([i[n],null,null]);return p(r,v(e.orig,e.chunks,!0),e.chunks,1),t&&p(r,v(t.orig,t.chunks,!0),t.chunks,2),r}(e,i),o=e.mv.aligners,l=0;l<o.length;l++)o[l].clear();o.length=0;var a=[e.edit,e.orig],s=[];i&&a.push(i.orig);for(l=0;l<a.length;l++)s.push(a[l].getScrollInfo().top);for(var c=0;c<r.length;c++)C(a,r[c],o);for(l=0;l<a.length;l++)a[l].scrollTo(null,s[l])}}function C(e,t,i){for(var r=0,n=[],o=0;o<e.length;o++)if(null!=t[o]){var l=e[o].heightAtLine(t[o],"local");n[o]=l,r=Math.max(r,l)}for(o=0;o<e.length;o++)if(null!=t[o]){var a=r-n[o];a>1&&i.push(b(e[o],t[o],a))}}function b(e,t,i){var r=!0;t>e.lastLine()&&(t--,r=!1);var n=document.createElement("div");return n.className="CodeMirror-merge-spacer",n.style.height=i+"px",n.style.minWidth="1px",e.addLineWidget(t,n,{height:i,above:r,mergeSpacer:!0,handleMouseEvents:!0})}function w(e,t,r,n,o){var l="left"==e.type,a=e.orig.heightAtLine(t.origFrom,"local",!0)-r;if(e.svg){var s=a,c=e.edit.heightAtLine(t.editFrom,"local",!0)-n;if(l){var h=s;s=c,c=h}var f=e.orig.heightAtLine(t.origTo,"local",!0)-r,g=e.edit.heightAtLine(t.editTo,"local",!0)-n;if(l){h=f;f=g,g=h}var d=" C "+o/2+" "+c+" "+o/2+" "+s+" "+(o+2)+" "+s,u=" C "+o/2+" "+f+" "+o/2+" "+g+" -1 "+g;R(e.svg.appendChild(document.createElementNS(i,"path")),"d","M -1 "+c+d+" L "+(o+2)+" "+f+u+" z","class",e.classes.connect)}if(e.copyButtons){var m=e.copyButtons.appendChild(I("div","left"==e.type?"â‡":"⇜","CodeMirror-merge-copy")),v=e.mv.options.allowEditingOriginals;if(m.title=e.edit.phrase(v?"Push to left":"Revert chunk"),m.chunk=t,m.style.top=(t.origTo>t.origFrom?a:e.edit.heightAtLine(t.editFrom,"local")-n)+"px",v){var p=e.edit.heightAtLine(t.editFrom,"local")-n,k=e.copyButtons.appendChild(I("div","right"==e.type?"â‡":"⇜","CodeMirror-merge-copy-reverse"));k.title="Push to right",k.chunk={editFrom:t.origFrom,editTo:t.origTo,origFrom:t.editFrom,origTo:t.editTo},k.style.top=p+"px","right"==e.type?k.style.left="2px":k.style.right="2px"}}}function T(e,i,r,n){if(!e.diffOutOfDate){var o=n.origTo>r.lastLine()?t(n.origFrom-1):t(n.origFrom,0),l=t(n.origTo,0),a=n.editTo>i.lastLine()?t(n.editFrom-1):t(n.editFrom,0),s=t(n.editTo,0),c=e.mv.options.revertChunk;c?c(e.mv,r,o,l,i,a,s):i.replaceRange(r.getRange(o,l),a,s)}}var y,F=e.MergeView=function(t,i){if(!(this instanceof F))return new F(t,i);this.options=i;var n=i.origLeft,o=null==i.origRight?i.orig:i.origRight,l=null!=n,a=null!=o,s=1+(l?1:0)+(a?1:0),c=[],h=this.left=null,f=this.right=null,g=this;if(l){h=this.left=new r(this,"left");var d=I("div",null,"CodeMirror-merge-pane CodeMirror-merge-left");c.push(d),c.push(S(h))}var v=I("div",null,"CodeMirror-merge-pane CodeMirror-merge-editor");if(c.push(v),a){f=this.right=new r(this,"right"),c.push(S(f));var p=I("div",null,"CodeMirror-merge-pane CodeMirror-merge-right");c.push(p)}(a?p:v).className+=" CodeMirror-merge-pane-rightmost",c.push(I("div",null,null,"height: 0; clear: both;"));var C=this.wrap=t.appendChild(I("div",c,"CodeMirror-merge CodeMirror-merge-"+s+"pane"));this.edit=e(v,W(i)),h&&h.init(d,n,i),f&&f.init(p,o,i),i.collapseIdentical&&this.editor().operation((function(){!function(e,t){"number"!=typeof t&&(t=2);for(var i=[],r=e.editor(),n=r.firstLine(),o=n,l=r.lastLine();o<=l;o++)i.push(!0);e.left&&B(e.left,t,n,i);e.right&&B(e.right,t,n,i);for(var a=0;a<i.length;a++)if(i[a]){for(var s=a+n,c=1;a<i.length-1&&i[a+1];a++,c++);if(c>t){var h=[{line:s,cm:r}];e.left&&h.push({line:m(s,e.left.chunks),cm:e.left.orig}),e.right&&h.push({line:m(s,e.right.chunks),cm:e.right.orig});var f=x(c,h);e.options.onCollapse&&e.options.onCollapse(e,s,c,f)}}}(g,i.collapseIdentical)})),"align"==i.connect&&(this.aligners=[],k(this.left||this.right,!0)),h&&h.registerEvents(f),f&&f.registerEvents(h);var b=function(){h&&u(h),f&&u(f)};e.on(window,"resize",b);var w=setInterval((function(){for(var t=C.parentNode;t&&t!=document.body;t=t.parentNode);t||(clearInterval(w),e.off(window,"resize",b))}),5e3)};function S(t){var r=t.lockButton=I("div",null,"CodeMirror-merge-scrolllock"),n=I("div",[r],"CodeMirror-merge-scrolllock-wrap");e.on(r,"click",(function(){s(t,!t.lockScroll)}));var o=[n];if(!1!==t.mv.options.revertButtons&&(t.copyButtons=I("div",null,"CodeMirror-merge-copybuttons-"+t.type),e.on(t.copyButtons,"click",(function(e){var i=e.target||e.srcElement;i.chunk&&("CodeMirror-merge-copy-reverse"!=i.className?T(t,t.edit,t.orig,i.chunk):T(t,t.orig,t.edit,i.chunk))})),o.unshift(t.copyButtons)),"align"!=t.mv.options.connect){var l=document.createElementNS&&document.createElementNS(i,"svg");l&&!l.createSVGRect&&(l=null),t.svg=l,l&&o.push(l)}return t.gap=I("div",o,"CodeMirror-merge-gap")}function M(e){return"string"==typeof e?e:e.getValue()}function L(e,t,i){y||(y=new diff_match_patch);for(var r=y.diff_main(e,t),n=0;n<r.length;++n){var o=r[n];(i?/[^ \t]/.test(o[1]):o[1])?n&&r[n-1][0]==o[0]&&(r.splice(n--,1),r[n][1]+=o[1]):r.splice(n--,1)}return r}function D(e){var i=[];if(!e.length)return i;for(var r=0,n=0,o=t(0,0),l=t(0,0),a=0;a<e.length;++a){var s=e[a],c=s[0];if(c==DIFF_EQUAL){var h=!E(e,a)||o.line<r||l.line<n?1:0,f=o.line+h,g=l.line+h;V(o,s[1],null,l);var d=A(e,a)?1:0,u=o.line+d,m=l.line+d;u>f&&(a&&i.push({origFrom:n,origTo:g,editFrom:r,editTo:f}),r=u,n=m)}else V(c==DIFF_INSERT?o:l,s[1])}return(r<=o.line||n<=l.line)&&i.push({origFrom:n,origTo:l.line+1,editFrom:r,editTo:o.line+1}),i}function A(e,t){if(t==e.length-1)return!0;var i=e[t+1][1];return!(1==i.length&&t<e.length-2||10!=i.charCodeAt(0))&&(t==e.length-2||((i=e[t+2][1]).length>1||t==e.length-3)&&10==i.charCodeAt(0))}function E(e,t){if(0==t)return!0;var i=e[t-1][1];return 10==i.charCodeAt(i.length-1)&&(1==t||10==(i=e[t-2][1]).charCodeAt(i.length-1))}function O(i,r,n){i.addLineClass(r,"wrap","CodeMirror-merge-collapsed-line");var o=document.createElement("span");o.className="CodeMirror-merge-collapsed-widget",o.title=i.phrase("Identical text collapsed. Click to expand.");var l=i.markText(t(r,0),t(n-1),{inclusiveLeft:!0,inclusiveRight:!0,replacedWith:o,clearOnEnter:!0});function a(){l.clear(),i.removeLineClass(r,"wrap","CodeMirror-merge-collapsed-line")}return l.explicitlyCleared&&a(),e.on(o,"click",a),l.on("clear",a),e.on(o,"click",a),{mark:l,clear:a}}function x(e,t){var i=[];function r(){for(var e=0;e<i.length;e++)i[e].clear()}for(var n=0;n<t.length;n++){var o=t[n],l=O(o.cm,o.line,o.line+e);i.push(l),l.mark.on("clear",r)}return i[0].mark}function B(e,t,i,r){for(var n=0;n<e.chunks.length;n++)for(var o=e.chunks[n],l=o.editFrom-t;l<o.editTo+t;l++){var a=l+i;a>=0&&a<r.length&&(r[a]=!1)}}function I(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),"string"==typeof t)n.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)n.appendChild(t[o]);return n}function N(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild)}function R(e){for(var t=1;t<arguments.length;t+=2)e.setAttribute(arguments[t],arguments[t+1])}function W(e,t){for(var i in t||(t={}),e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function V(e,i,r,n){for(var o=r?t(e.line,e.ch):e,l=0;;){var a=i.indexOf("\n",l);if(-1==a)break;++o.line,n&&++n.line,l=a+1}return o.ch=(l?0:o.ch)+(i.length-l),n&&(n.ch=(l?0:n.ch)+(i.length-l)),o}F.prototype={constructor:F,editor:function(){return this.edit},rightOriginal:function(){return this.right&&this.right.orig},leftOriginal:function(){return this.left&&this.left.orig},setShowDifferences:function(e){this.right&&this.right.setShowDifferences(e),this.left&&this.left.setShowDifferences(e)},rightChunks:function(){if(this.right)return n(this.right),this.right.chunks},leftChunks:function(){if(this.left)return n(this.left),this.left.chunks}};function _(e){this.cm=e,this.alignable=[],this.height=e.doc.height;var t=this;e.on("markerAdded",(function(e,i){if(i.collapsed){var r=i.find(1);null!=r&&t.set(r.line,4)}})),e.on("markerCleared",(function(e,i,r,n){null!=n&&i.collapsed&&t.check(n,4,t.hasMarker)})),e.on("markerChanged",this.signal.bind(this)),e.on("lineWidgetAdded",(function(e,i,r){i.mergeSpacer||(i.above?t.set(r-1,2):t.set(r,1))})),e.on("lineWidgetCleared",(function(e,i,r){i.mergeSpacer||(i.above?t.check(r-1,2,t.hasWidgetBelow):t.check(r,1,t.hasWidget))})),e.on("lineWidgetChanged",this.signal.bind(this)),e.on("change",(function(e,i){var r=i.from.line,n=i.to.line-i.from.line,o=i.text.length-1,l=r+o;(n||o)&&t.map(r,n,o),t.check(l,4,t.hasMarker),(n||o)&&t.check(i.from.line,4,t.hasMarker)})),e.on("viewportChange",(function(){t.cm.doc.height!=t.height&&t.signal()}))}function H(e,t){return(e.line-t.line||e.ch-t.ch)<0?e:t}function P(e,t){return(e.line-t.line||e.ch-t.ch)>0?e:t}function j(e,t){return e.line==t.line&&e.ch==t.ch}function U(e,t,i){for(var r=e.length-1;r>=0;r--){var n=e[r],o=(i?n.origTo:n.editTo)-1;if(o<t)return o}}function z(e,t,i){for(var r=0;r<e.length;r++){var n=e[r],o=i?n.origFrom:n.editFrom;if(o>t)return o}}function Q(t,i){var r=null,o=t.state.diffViews,l=t.getCursor().line;if(o)for(var a=0;a<o.length;a++){var s=o[a],c=t==s.orig;n(s);var h=i<0?U(s.chunks,l,c):z(s.chunks,l,c);null==h||null!=r&&!(i<0?h>r:h<r)||(r=h)}if(null==r)return e.Pass;t.setCursor(r,0)}_.prototype={signal:function(){e.signal(this,"realign"),this.height=this.cm.doc.height},set:function(e,t){for(var i=-1;i<this.alignable.length;i+=2){var r=this.alignable[i]-e;if(0==r){if((this.alignable[i+1]&t)==t)return;return this.alignable[i+1]|=t,void this.signal()}if(r>0)break}this.signal(),this.alignable.splice(i,0,e,t)},find:function(e){for(var t=0;t<this.alignable.length;t+=2)if(this.alignable[t]==e)return t;return-1},check:function(e,t,i){var r=this.find(e);if(-1!=r&&this.alignable[r+1]&t&&!i.call(this,e)){this.signal();var n=this.alignable[r+1]&~t;n?this.alignable[r+1]=n:this.alignable.splice(r,2)}},hasMarker:function(e){var t=this.cm.getLineHandle(e);if(t.markedSpans)for(var i=0;i<t.markedSpans.length;i++)if(t.markedSpans[i].marker.collapsed&&null!=t.markedSpans[i].to)return!0;return!1},hasWidget:function(e){var t=this.cm.getLineHandle(e);if(t.widgets)for(var i=0;i<t.widgets.length;i++)if(!t.widgets[i].above&&!t.widgets[i].mergeSpacer)return!0;return!1},hasWidgetBelow:function(e){if(e==this.cm.lastLine())return!1;var t=this.cm.getLineHandle(e+1);if(t.widgets)for(var i=0;i<t.widgets.length;i++)if(t.widgets[i].above&&!t.widgets[i].mergeSpacer)return!0;return!1},map:function(e,t,i){for(var r=i-t,n=e+t,o=-1,l=-1,a=0;a<this.alignable.length;a+=2){var s=this.alignable[a];s==e&&2&this.alignable[a+1]&&(o=a),s==n&&2&this.alignable[a+1]&&(l=a),s<=e||(s<n?this.alignable.splice(a--,2):this.alignable[a]+=r)}if(o>-1){var c=this.alignable[o+1];2==c?this.alignable.splice(o,2):this.alignable[o+1]=-3&c}l>-1&&i&&this.set(e+i,2)}},e.commands.goNextDiff=function(e){return Q(e,1)},e.commands.goPrevDiff=function(e){return Q(e,-1)}})); \ No newline at end of file +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","diff_match_patch"],e):e(CodeMirror)}((function(e){"use strict";var t=e.Pos,i="http://www.w3.org/2000/svg";function r(e,t){this.mv=e,this.type=t,this.classes="left"==t?{chunk:"CodeMirror-merge-l-chunk",start:"CodeMirror-merge-l-chunk-start",end:"CodeMirror-merge-l-chunk-end",insert:"CodeMirror-merge-l-inserted",del:"CodeMirror-merge-l-deleted",connect:"CodeMirror-merge-l-connect"}:{chunk:"CodeMirror-merge-r-chunk",start:"CodeMirror-merge-r-chunk-start",end:"CodeMirror-merge-r-chunk-end",insert:"CodeMirror-merge-r-inserted",del:"CodeMirror-merge-r-deleted",connect:"CodeMirror-merge-r-connect"}}function n(t){t.diffOutOfDate&&(t.diff=L(t.orig.getValue(),t.edit.getValue(),t.mv.options.ignoreWhitespace),t.chunks=D(t.diff),t.diffOutOfDate=!1,e.signal(t.edit,"updateDiff",t.diff))}r.prototype={constructor:r,init:function(t,i,r){this.edit=this.mv.edit,(this.edit.state.diffViews||(this.edit.state.diffViews=[])).push(this),this.orig=e(t,W({value:i,readOnly:!this.mv.options.allowEditingOriginals},W(r))),"align"==this.mv.options.connect&&(this.edit.state.trackAlignable||(this.edit.state.trackAlignable=new _(this.edit)),this.orig.state.trackAlignable=new _(this.orig)),this.lockButton.title=this.edit.phrase("Toggle locked scrolling"),this.orig.state.diffViews=[this];var n=r.chunkClassLocation||"background";"[object Array]"!=Object.prototype.toString.call(n)&&(n=[n]),this.classes.classLocation=n,this.diff=L(M(i),M(r.value),this.mv.options.ignoreWhitespace),this.chunks=D(this.diff),this.diffOutOfDate=this.dealigned=!1,this.needsScrollSync=null,this.showDifferences=!1!==r.showDifferences},registerEvents:function(t){this.forceUpdate=function(t){var i,r={from:0,to:0,marked:[]},a={from:0,to:0,marked:[]},s=!1;function c(e){o=!0,s=!1,"full"==e&&(t.svg&&N(t.svg),t.copyButtons&&N(t.copyButtons),h(t.edit,r.marked,t.classes),h(t.orig,a.marked,t.classes),r.from=r.to=a.from=a.to=0),n(t),t.showDifferences&&(f(t.edit,t.diff,r,DIFF_INSERT,t.classes),f(t.orig,t.diff,a,DIFF_DELETE,t.classes)),"align"==t.mv.options.connect&&k(t),u(t),null!=t.needsScrollSync&&l(t,t.needsScrollSync),o=!1}function g(e){o||(t.dealigned=!0,d(e))}function d(e){o||s||(clearTimeout(i),!0===e&&(s=!0),i=setTimeout(c,!0===e?20:250))}function m(e,i){t.diffOutOfDate||(t.diffOutOfDate=!0,r.from=r.to=a.from=a.to=0),g(i.text.length-1!=i.to.line-i.from.line)}function v(){t.diffOutOfDate=!0,t.dealigned=!0,c("full")}t.edit.on("change",m),t.orig.on("change",m),t.edit.on("swapDoc",v),t.orig.on("swapDoc",v),"align"==t.mv.options.connect&&(e.on(t.edit.state.trackAlignable,"realign",g),e.on(t.orig.state.trackAlignable,"realign",g));return t.edit.on("viewportChange",(function(){d(!1)})),t.orig.on("viewportChange",(function(){d(!1)})),c(),c}(this),s(this,!0,!1),function(e,t){e.edit.on("scroll",(function(){l(e,!0)&&u(e)})),e.orig.on("scroll",(function(){l(e,!1)&&u(e),t&&l(t,!0)&&u(t)}))}(this,t)},setShowDifferences:function(e){(e=!1!==e)!=this.showDifferences&&(this.showDifferences=e,this.forceUpdate("full"))}};var o=!1;function l(e,t){if(e.diffOutOfDate)return e.lockScroll&&null==e.needsScrollSync&&(e.needsScrollSync=t),!1;if(e.needsScrollSync=null,!e.lockScroll)return!0;var i,r,n=+new Date;if(t?(i=e.edit,r=e.orig):(i=e.orig,r=e.edit),i.state.scrollSetBy==e&&(i.state.scrollSetAt||0)+250>n)return!1;var o=i.getScrollInfo();if("align"==e.mv.options.connect)v=o.top;else{var l,s,c=.5*o.clientHeight,h=o.top+c,f=i.lineAtHeight(h,"local"),g=function(e,t,i){for(var r,n,o,l,a=0;a<e.length;a++){var s=e[a],c=i?s.editFrom:s.origFrom,h=i?s.editTo:s.origTo;null==n&&(c>t?(n=s.editFrom,l=s.origFrom):h>t&&(n=s.editTo,l=s.origTo)),h<=t?(r=s.editTo,o=s.origTo):c<=t&&(r=s.editFrom,o=s.origFrom)}return{edit:{before:r,after:n},orig:{before:o,after:l}}}(e.chunks,f,t),d=a(i,t?g.edit:g.orig),u=a(r,t?g.orig:g.edit),m=(h-d.top)/(d.bot-d.top),v=u.top-c+m*(u.bot-u.top);if(v>o.top&&(s=o.top/c)<1)v=v*s+o.top*(1-s);else if((l=o.height-o.clientHeight-o.top)<c){var p=r.getScrollInfo();p.height-p.clientHeight-v>l&&(s=l/c)<1&&(v=v*s+(p.height-p.clientHeight-l)*(1-s))}}return r.scrollTo(o.left,v),r.state.scrollSetAt=n,r.state.scrollSetBy=e,!0}function a(e,t){var i=t.after;return null==i&&(i=e.lastLine()+1),{top:e.heightAtLine(t.before||0,"local"),bot:e.heightAtLine(i,"local")}}function s(t,i,r){t.lockScroll=i,i&&0!=r&&l(t,DIFF_INSERT)&&u(t),(i?e.addClass:e.rmClass)(t.lockButton,"CodeMirror-merge-scrolllock-enabled")}function c(e,t,i){for(var r=i.classLocation,n=0;n<r.length;n++)e.removeLineClass(t,r[n],i.chunk),e.removeLineClass(t,r[n],i.start),e.removeLineClass(t,r[n],i.end)}function h(t,i,r){for(var n=0;n<i.length;++n){var o=i[n];o instanceof e.TextMarker?o.clear():o.parent&&c(t,o,r)}i.length=0}function f(e,t,i,r,n){var o=e.getViewport();e.operation((function(){i.from==i.to||o.from-i.to>20||i.from-o.to>20?(h(e,i.marked,n),d(e,t,r,i.marked,o.from,o.to,n),i.from=o.from,i.to=o.to):(o.from<i.from&&(d(e,t,r,i.marked,o.from,i.from,n),i.from=o.from),o.to>i.to&&(d(e,t,r,i.marked,i.to,o.to,n),i.to=o.to))}))}function g(e,t,i,r,n,o){for(var l=i.classLocation,a=e.getLineHandle(t),s=0;s<l.length;s++)r&&e.addLineClass(a,l[s],i.chunk),n&&e.addLineClass(a,l[s],i.start),o&&e.addLineClass(a,l[s],i.end);return a}function d(e,i,r,n,o,l,a){var s=t(0,0),c=t(o,0),h=e.clipPos(t(l-1)),f=r==DIFF_DELETE?a.del:a.insert;function d(t,i){for(var r=Math.max(o,t),s=Math.min(l,i),c=r;c<s;++c)n.push(g(e,c,a,!0,c==t,c==i-1));t==i&&r==i&&s==i&&(r?n.push(g(e,r-1,a,!1,!1,!0)):n.push(g(e,r,a,!1,!0,!1)))}for(var u=0,m=!1,v=0;v<i.length;++v){var p=i[v],k=p[0],C=p[1];if(k==DIFF_EQUAL){var b=s.line+(E(i,v)?0:1);V(s,C);var w=s.line+(A(i,v)?1:0);w>b&&(m&&(d(u,b),m=!1),u=w)}else if(m=!0,k==r){var T=V(s,C,!0),y=P(c,s),F=H(h,T);j(y,F)||n.push(e.markText(y,F,{className:f})),s=T}}m&&d(u,s.line+1)}function u(e){if(e.showDifferences){if(e.svg){N(e.svg);var t=e.gap.offsetWidth;R(e.svg,"width",t,"height",e.gap.offsetHeight)}e.copyButtons&&N(e.copyButtons);for(var i=e.edit.getViewport(),r=e.orig.getViewport(),n=e.mv.wrap.getBoundingClientRect().top,o=n-e.edit.getScrollerElement().getBoundingClientRect().top+e.edit.getScrollInfo().top,l=n-e.orig.getScrollerElement().getBoundingClientRect().top+e.orig.getScrollInfo().top,a=0;a<e.chunks.length;a++){var s=e.chunks[a];s.editFrom<=i.to&&s.editTo>=i.from&&s.origFrom<=r.to&&s.origTo>=r.from&&w(e,s,l,o,t)}}}function m(e,t){for(var i=0,r=0,n=0;n<t.length;n++){var o=t[n];if(o.editTo>e&&o.editFrom<=e)return null;if(o.editFrom>e)break;i=o.editTo,r=o.origTo}return r+(e-i)}function v(e,t,i){for(var r=e.state.trackAlignable,n=e.firstLine(),o=0,l=[],a=0;;a++){for(var s=t[a],c=s?i?s.origFrom:s.editFrom:1e9;o<r.alignable.length;o+=2){var h=r.alignable[o]+1;if(!(h<=n)){if(!(h<=c))break;l.push(h)}}if(!s)break;l.push(n=i?s.origTo:s.editTo)}return l}function p(e,t,i,r){var n=0,o=0,l=0,a=0;e:for(;;n++){var s=e[n],c=t[o];if(!s&&null==c)break;for(var h=s?s[0]:1e9,f=null==c?1e9:c;l<i.length;){var g=i[l];if(g.origFrom<=f&&g.origTo>f){o++,n--;continue e}if(g.editTo>h){if(g.editFrom<=h)continue e;break}a+=g.origTo-g.origFrom-(g.editTo-g.editFrom),l++}if(h==f-a)s[r]=f,o++;else if(h<f-a)s[r]=h+a;else{var d=[f-a,null,null];d[r]=f,e.splice(n,0,d),o++}}}function k(e,t){if(e.dealigned||t){if(!e.orig.curOp)return e.orig.operation((function(){k(e,t)}));e.dealigned=!1;var i=e.mv.left==e?e.mv.right:e.mv.left;i&&(n(i),i.dealigned=!1);for(var r=function(e,t){var i=v(e.edit,e.chunks,!1),r=[];if(t)for(var n=0,o=0;n<t.chunks.length;n++){for(var l=t.chunks[n].editTo;o<i.length&&i[o]<l;)o++;o!=i.length&&i[o]==l||i.splice(o++,0,l)}for(n=0;n<i.length;n++)r.push([i[n],null,null]);return p(r,v(e.orig,e.chunks,!0),e.chunks,1),t&&p(r,v(t.orig,t.chunks,!0),t.chunks,2),r}(e,i),o=e.mv.aligners,l=0;l<o.length;l++)o[l].clear();o.length=0;var a=[e.edit,e.orig],s=[],c=[];i&&a.push(i.orig);for(l=0;l<a.length;l++)s.push(a[l].getScrollInfo().top),c.push(-a[l].getScrollerElement().getBoundingClientRect().top);(c[0]!=c[1]||3==a.length&&c[1]!=c[2])&&C(a,c,[0,0,0],o);for(var h=0;h<r.length;h++)C(a,c,r[h],o);for(l=0;l<a.length;l++)a[l].scrollTo(null,s[l])}}function C(e,t,i,r){for(var n=-1e8,o=[],l=0;l<e.length;l++)if(null!=i[l]){var a=e[l].heightAtLine(i[l],"local")-t[l];o[l]=a,n=Math.max(n,a)}for(l=0;l<e.length;l++)if(null!=i[l]){var s=n-o[l];s>1&&r.push(b(e[l],i[l],s))}}function b(e,t,i){var r=!0;t>e.lastLine()&&(t--,r=!1);var n=document.createElement("div");return n.className="CodeMirror-merge-spacer",n.style.height=i+"px",n.style.minWidth="1px",e.addLineWidget(t,n,{height:i,above:r,mergeSpacer:!0,handleMouseEvents:!0})}function w(e,t,r,n,o){var l="left"==e.type,a=e.orig.heightAtLine(t.origFrom,"local",!0)-r;if(e.svg){var s=a,c=e.edit.heightAtLine(t.editFrom,"local",!0)-n;if(l){var h=s;s=c,c=h}var f=e.orig.heightAtLine(t.origTo,"local",!0)-r,g=e.edit.heightAtLine(t.editTo,"local",!0)-n;if(l){h=f;f=g,g=h}var d=" C "+o/2+" "+c+" "+o/2+" "+s+" "+(o+2)+" "+s,u=" C "+o/2+" "+f+" "+o/2+" "+g+" -1 "+g;R(e.svg.appendChild(document.createElementNS(i,"path")),"d","M -1 "+c+d+" L "+(o+2)+" "+f+u+" z","class",e.classes.connect)}if(e.copyButtons){var m=e.copyButtons.appendChild(I("div","left"==e.type?"â‡":"⇜","CodeMirror-merge-copy")),v=e.mv.options.allowEditingOriginals;if(m.title=e.edit.phrase(v?"Push to left":"Revert chunk"),m.chunk=t,m.style.top=(t.origTo>t.origFrom?a:e.edit.heightAtLine(t.editFrom,"local")-n)+"px",v){var p=e.edit.heightAtLine(t.editFrom,"local")-n,k=e.copyButtons.appendChild(I("div","right"==e.type?"â‡":"⇜","CodeMirror-merge-copy-reverse"));k.title="Push to right",k.chunk={editFrom:t.origFrom,editTo:t.origTo,origFrom:t.editFrom,origTo:t.editTo},k.style.top=p+"px","right"==e.type?k.style.left="2px":k.style.right="2px"}}}function T(e,i,r,n){if(!e.diffOutOfDate){var o=n.origTo>r.lastLine()?t(n.origFrom-1):t(n.origFrom,0),l=t(n.origTo,0),a=n.editTo>i.lastLine()?t(n.editFrom-1):t(n.editFrom,0),s=t(n.editTo,0),c=e.mv.options.revertChunk;c?c(e.mv,r,o,l,i,a,s):i.replaceRange(r.getRange(o,l),a,s)}}var y,F=e.MergeView=function(t,i){if(!(this instanceof F))return new F(t,i);this.options=i;var n=i.origLeft,o=null==i.origRight?i.orig:i.origRight,l=null!=n,a=null!=o,s=1+(l?1:0)+(a?1:0),c=[],h=this.left=null,f=this.right=null,g=this;if(l){h=this.left=new r(this,"left");var d=I("div",null,"CodeMirror-merge-pane CodeMirror-merge-left");c.push(d),c.push(S(h))}var v=I("div",null,"CodeMirror-merge-pane CodeMirror-merge-editor");if(c.push(v),a){f=this.right=new r(this,"right"),c.push(S(f));var p=I("div",null,"CodeMirror-merge-pane CodeMirror-merge-right");c.push(p)}(a?p:v).className+=" CodeMirror-merge-pane-rightmost",c.push(I("div",null,null,"height: 0; clear: both;"));var C=this.wrap=t.appendChild(I("div",c,"CodeMirror-merge CodeMirror-merge-"+s+"pane"));this.edit=e(v,W(i)),h&&h.init(d,n,i),f&&f.init(p,o,i),i.collapseIdentical&&this.editor().operation((function(){!function(e,t){"number"!=typeof t&&(t=2);for(var i=[],r=e.editor(),n=r.firstLine(),o=n,l=r.lastLine();o<=l;o++)i.push(!0);e.left&&x(e.left,t,n,i);e.right&&x(e.right,t,n,i);for(var a=0;a<i.length;a++)if(i[a]){for(var s=a+n,c=1;a<i.length-1&&i[a+1];a++,c++);if(c>t){var h=[{line:s,cm:r}];e.left&&h.push({line:m(s,e.left.chunks),cm:e.left.orig}),e.right&&h.push({line:m(s,e.right.chunks),cm:e.right.orig});var f=B(c,h);e.options.onCollapse&&e.options.onCollapse(e,s,c,f)}}}(g,i.collapseIdentical)})),"align"==i.connect&&(this.aligners=[],k(this.left||this.right,!0)),h&&h.registerEvents(f),f&&f.registerEvents(h);var b=function(){h&&u(h),f&&u(f)};e.on(window,"resize",b);var w=setInterval((function(){for(var t=C.parentNode;t&&t!=document.body;t=t.parentNode);t||(clearInterval(w),e.off(window,"resize",b))}),5e3)};function S(t){var r=t.lockButton=I("div",null,"CodeMirror-merge-scrolllock"),n=I("div",[r],"CodeMirror-merge-scrolllock-wrap");e.on(r,"click",(function(){s(t,!t.lockScroll)}));var o=[n];if(!1!==t.mv.options.revertButtons&&(t.copyButtons=I("div",null,"CodeMirror-merge-copybuttons-"+t.type),e.on(t.copyButtons,"click",(function(e){var i=e.target||e.srcElement;i.chunk&&("CodeMirror-merge-copy-reverse"!=i.className?T(t,t.edit,t.orig,i.chunk):T(t,t.orig,t.edit,i.chunk))})),o.unshift(t.copyButtons)),"align"!=t.mv.options.connect){var l=document.createElementNS&&document.createElementNS(i,"svg");l&&!l.createSVGRect&&(l=null),t.svg=l,l&&o.push(l)}return t.gap=I("div",o,"CodeMirror-merge-gap")}function M(e){return"string"==typeof e?e:e.getValue()}function L(e,t,i){y||(y=new diff_match_patch);for(var r=y.diff_main(e,t),n=0;n<r.length;++n){var o=r[n];(i?/[^ \t]/.test(o[1]):o[1])?n&&r[n-1][0]==o[0]&&(r.splice(n--,1),r[n][1]+=o[1]):r.splice(n--,1)}return r}function D(e){var i=[];if(!e.length)return i;for(var r=0,n=0,o=t(0,0),l=t(0,0),a=0;a<e.length;++a){var s=e[a],c=s[0];if(c==DIFF_EQUAL){var h=!E(e,a)||o.line<r||l.line<n?1:0,f=o.line+h,g=l.line+h;V(o,s[1],null,l);var d=A(e,a)?1:0,u=o.line+d,m=l.line+d;u>f&&(a&&i.push({origFrom:n,origTo:g,editFrom:r,editTo:f}),r=u,n=m)}else V(c==DIFF_INSERT?o:l,s[1])}return(r<=o.line||n<=l.line)&&i.push({origFrom:n,origTo:l.line+1,editFrom:r,editTo:o.line+1}),i}function A(e,t){if(t==e.length-1)return!0;var i=e[t+1][1];return!(1==i.length&&t<e.length-2||10!=i.charCodeAt(0))&&(t==e.length-2||((i=e[t+2][1]).length>1||t==e.length-3)&&10==i.charCodeAt(0))}function E(e,t){if(0==t)return!0;var i=e[t-1][1];return 10==i.charCodeAt(i.length-1)&&(1==t||10==(i=e[t-2][1]).charCodeAt(i.length-1))}function O(i,r,n){i.addLineClass(r,"wrap","CodeMirror-merge-collapsed-line");var o=document.createElement("span");o.className="CodeMirror-merge-collapsed-widget",o.title=i.phrase("Identical text collapsed. Click to expand.");var l=i.markText(t(r,0),t(n-1),{inclusiveLeft:!0,inclusiveRight:!0,replacedWith:o,clearOnEnter:!0});function a(){l.clear(),i.removeLineClass(r,"wrap","CodeMirror-merge-collapsed-line")}return l.explicitlyCleared&&a(),e.on(o,"click",a),l.on("clear",a),e.on(o,"click",a),{mark:l,clear:a}}function B(e,t){var i=[];function r(){for(var e=0;e<i.length;e++)i[e].clear()}for(var n=0;n<t.length;n++){var o=t[n],l=O(o.cm,o.line,o.line+e);i.push(l),l.mark.on("clear",r)}return i[0].mark}function x(e,t,i,r){for(var n=0;n<e.chunks.length;n++)for(var o=e.chunks[n],l=o.editFrom-t;l<o.editTo+t;l++){var a=l+i;a>=0&&a<r.length&&(r[a]=!1)}}function I(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),"string"==typeof t)n.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)n.appendChild(t[o]);return n}function N(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild)}function R(e){for(var t=1;t<arguments.length;t+=2)e.setAttribute(arguments[t],arguments[t+1])}function W(e,t){for(var i in t||(t={}),e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function V(e,i,r,n){for(var o=r?t(e.line,e.ch):e,l=0;;){var a=i.indexOf("\n",l);if(-1==a)break;++o.line,n&&++n.line,l=a+1}return o.ch=(l?0:o.ch)+(i.length-l),n&&(n.ch=(l?0:n.ch)+(i.length-l)),o}F.prototype={constructor:F,editor:function(){return this.edit},rightOriginal:function(){return this.right&&this.right.orig},leftOriginal:function(){return this.left&&this.left.orig},setShowDifferences:function(e){this.right&&this.right.setShowDifferences(e),this.left&&this.left.setShowDifferences(e)},rightChunks:function(){if(this.right)return n(this.right),this.right.chunks},leftChunks:function(){if(this.left)return n(this.left),this.left.chunks}};function _(e){this.cm=e,this.alignable=[],this.height=e.doc.height;var t=this;e.on("markerAdded",(function(e,i){if(i.collapsed){var r=i.find(1);null!=r&&t.set(r.line,4)}})),e.on("markerCleared",(function(e,i,r,n){null!=n&&i.collapsed&&t.check(n,4,t.hasMarker)})),e.on("markerChanged",this.signal.bind(this)),e.on("lineWidgetAdded",(function(e,i,r){i.mergeSpacer||(i.above?t.set(r-1,2):t.set(r,1))})),e.on("lineWidgetCleared",(function(e,i,r){i.mergeSpacer||(i.above?t.check(r-1,2,t.hasWidgetBelow):t.check(r,1,t.hasWidget))})),e.on("lineWidgetChanged",this.signal.bind(this)),e.on("change",(function(e,i){var r=i.from.line,n=i.to.line-i.from.line,o=i.text.length-1,l=r+o;(n||o)&&t.map(r,n,o),t.check(l,4,t.hasMarker),(n||o)&&t.check(i.from.line,4,t.hasMarker)})),e.on("viewportChange",(function(){t.cm.doc.height!=t.height&&t.signal()}))}function H(e,t){return(e.line-t.line||e.ch-t.ch)<0?e:t}function P(e,t){return(e.line-t.line||e.ch-t.ch)>0?e:t}function j(e,t){return e.line==t.line&&e.ch==t.ch}function U(e,t,i){for(var r=e.length-1;r>=0;r--){var n=e[r],o=(i?n.origTo:n.editTo)-1;if(o<t)return o}}function z(e,t,i){for(var r=0;r<e.length;r++){var n=e[r],o=i?n.origFrom:n.editFrom;if(o>t)return o}}function Q(t,i){var r=null,o=t.state.diffViews,l=t.getCursor().line;if(o)for(var a=0;a<o.length;a++){var s=o[a],c=t==s.orig;n(s);var h=i<0?U(s.chunks,l,c):z(s.chunks,l,c);null==h||null!=r&&!(i<0?h>r:h<r)||(r=h)}if(null==r)return e.Pass;t.setCursor(r,0)}_.prototype={signal:function(){e.signal(this,"realign"),this.height=this.cm.doc.height},set:function(e,t){for(var i=-1;i<this.alignable.length;i+=2){var r=this.alignable[i]-e;if(0==r){if((this.alignable[i+1]&t)==t)return;return this.alignable[i+1]|=t,void this.signal()}if(r>0)break}this.signal(),this.alignable.splice(i,0,e,t)},find:function(e){for(var t=0;t<this.alignable.length;t+=2)if(this.alignable[t]==e)return t;return-1},check:function(e,t,i){var r=this.find(e);if(-1!=r&&this.alignable[r+1]&t&&!i.call(this,e)){this.signal();var n=this.alignable[r+1]&~t;n?this.alignable[r+1]=n:this.alignable.splice(r,2)}},hasMarker:function(e){var t=this.cm.getLineHandle(e);if(t.markedSpans)for(var i=0;i<t.markedSpans.length;i++)if(t.markedSpans[i].marker.collapsed&&null!=t.markedSpans[i].to)return!0;return!1},hasWidget:function(e){var t=this.cm.getLineHandle(e);if(t.widgets)for(var i=0;i<t.widgets.length;i++)if(!t.widgets[i].above&&!t.widgets[i].mergeSpacer)return!0;return!1},hasWidgetBelow:function(e){if(e==this.cm.lastLine())return!1;var t=this.cm.getLineHandle(e+1);if(t.widgets)for(var i=0;i<t.widgets.length;i++)if(t.widgets[i].above&&!t.widgets[i].mergeSpacer)return!0;return!1},map:function(e,t,i){for(var r=i-t,n=e+t,o=-1,l=-1,a=0;a<this.alignable.length;a+=2){var s=this.alignable[a];s==e&&2&this.alignable[a+1]&&(o=a),s==n&&2&this.alignable[a+1]&&(l=a),s<=e||(s<n?this.alignable.splice(a--,2):this.alignable[a]+=r)}if(o>-1){var c=this.alignable[o+1];2==c?this.alignable.splice(o,2):this.alignable[o+1]=-3&c}l>-1&&i&&this.set(e+i,2)}},e.commands.goNextDiff=function(e){return Q(e,1)},e.commands.goPrevDiff=function(e){return Q(e,-1)}})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/mode/loadmode.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/mode/loadmode.js index 43e87198fefb..11f58990bd12 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/mode/loadmode.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/mode/loadmode.js @@ -1 +1 @@ -!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),"cjs"):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],(function(r){e(r,"amd")})):e(CodeMirror,"plain")}((function(e,r){e.modeURL||(e.modeURL="../mode/%N/%N.js");var o={};function n(r,o){var n=e.modes[r].dependencies;if(!n)return o();for(var t=[],i=0;i<n.length;++i)e.modes.hasOwnProperty(n[i])||t.push(n[i]);if(!t.length)return o();var d=function(e,r){var o=r;return function(){0==--o&&e()}}(o,t.length);for(i=0;i<t.length;++i)e.requireMode(t[i],d)}e.requireMode=function(t,i){if("string"!=typeof t&&(t=t.name),e.modes.hasOwnProperty(t))return n(t,i);if(o.hasOwnProperty(t))return o[t].push(i);var d=e.modeURL.replace(/%N/g,t);if("plain"==r){var u=document.createElement("script");u.src=d;var f=document.getElementsByTagName("script")[0],a=o[t]=[i];e.on(u,"load",(function(){n(t,(function(){for(var e=0;e<a.length;++e)a[e]()}))})),f.parentNode.insertBefore(u,f)}else"cjs"==r?(require(d),i()):"amd"==r&&requirejs([d],i)},e.autoLoadMode=function(r,o){e.modes.hasOwnProperty(o)||e.requireMode(o,(function(){r.setOption("mode",r.getOption("mode"))}))}})); \ No newline at end of file +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),"cjs"):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],(function(o){e(o,"amd")})):e(CodeMirror,"plain")}((function(e,o){e.modeURL||(e.modeURL="../mode/%N/%N.js");var r={};function n(o,r,n){var t=e.modes[o],i=t&&t.dependencies;if(!i)return r();for(var d=[],a=0;a<i.length;++a)e.modes.hasOwnProperty(i[a])||d.push(i[a]);if(!d.length)return r();var f=function(e,o){var r=o;return function(){0==--r&&e()}}(r,d.length);for(a=0;a<d.length;++a)e.requireMode(d[a],f,n)}e.requireMode=function(t,i,d){if("string"!=typeof t&&(t=t.name),e.modes.hasOwnProperty(t))return n(t,i,d);if(r.hasOwnProperty(t))return r[t].push(i);var a=d&&d.path?d.path(t):e.modeURL.replace(/%N/g,t);if(d&&d.loadMode)d.loadMode(a,(function(){n(t,i,d)}));else if("plain"==o){var f=document.createElement("script");f.src=a;var u=document.getElementsByTagName("script")[0],c=r[t]=[i];e.on(f,"load",(function(){n(t,(function(){for(var e=0;e<c.length;++e)c[e]()}),d)})),u.parentNode.insertBefore(f,u)}else"cjs"==o?(require(a),i()):"amd"==o&&requirejs([a],i)},e.autoLoadMode=function(o,r,n){e.modes.hasOwnProperty(r)||e.requireMode(r,(function(){o.setOption("mode",o.getOption("mode"))}),n)}})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/runmode/runmode-standalone.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/runmode/runmode-standalone.js index da941fa7136c..342856b9eb59 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/runmode/runmode-standalone.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/runmode/runmode-standalone.js @@ -1 +1 @@ -window.CodeMirror={},function(){"use strict";function t(t){this.pos=this.start=0,this.string=t,this.lineStart=0}t.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||null},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(t){var r=this.string.charAt(this.pos);if("string"==typeof t)var e=r==t;else e=r&&(t.test?t.test(r):t(r));if(e)return++this.pos,r},eatWhile:function(t){for(var r=this.pos;this.eat(t););return this.pos>r},eatSpace:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(t){var r=this.string.indexOf(t,this.pos);if(r>-1)return this.pos=r,!0},backUp:function(t){this.pos-=t},column:function(){return this.start-this.lineStart},indentation:function(){return 0},match:function(t,r,e){if("string"!=typeof t){var n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&!1!==r&&(this.pos+=n[0].length),n)}var i=function(t){return e?t.toLowerCase():t};if(i(this.string.substr(this.pos,t.length))==i(t))return!1!==r&&(this.pos+=t.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(t,r){this.lineStart+=t;try{return r()}finally{this.lineStart-=t}},lookAhead:function(){return null}},CodeMirror.StringStream=t,CodeMirror.startState=function(t,r,e){return!t.startState||t.startState(r,e)};var r=CodeMirror.modes={},e=CodeMirror.mimeModes={};CodeMirror.defineMode=function(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),r[t]=e},CodeMirror.defineMIME=function(t,r){e[t]=r},CodeMirror.resolveMode=function(t){return"string"==typeof t&&e.hasOwnProperty(t)?t=e[t]:t&&"string"==typeof t.name&&e.hasOwnProperty(t.name)&&(t=e[t.name]),"string"==typeof t?{name:t}:t||{name:"null"}},CodeMirror.getMode=function(t,e){e=CodeMirror.resolveMode(e);var n=r[e.name];if(!n)throw new Error("Unknown mode: "+e);return n(t,e)},CodeMirror.registerHelper=CodeMirror.registerGlobalHelper=Math.min,CodeMirror.defineMode("null",(function(){return{token:function(t){t.skipToEnd()}}})),CodeMirror.defineMIME("text/plain","null"),CodeMirror.runMode=function(t,r,e,n){var i=CodeMirror.getMode({indentUnit:2},r);if(1==e.nodeType){var o=n&&n.tabSize||4,s=e,a=0;s.innerHTML="",e=function(t,r){if("\n"==t)return s.appendChild(document.createElement("br")),void(a=0);for(var e="",n=0;;){var i=t.indexOf("\t",n);if(-1==i){e+=t.slice(n),a+=t.length-n;break}a+=i-n,e+=t.slice(n,i);var h=o-a%o;a+=h;for(var u=0;u<h;++u)e+=" ";n=i+1}if(r){var c=s.appendChild(document.createElement("span"));c.className="cm-"+r.replace(/ +/g," cm-"),c.appendChild(document.createTextNode(e))}else s.appendChild(document.createTextNode(e))}}for(var h=function(t){return t.split(/\r?\n|\r/)}(t),u=n&&n.state||CodeMirror.startState(i),c=0,d=h.length;c<d;++c){c&&e("\n");var l=new CodeMirror.StringStream(h[c]);for(!l.string&&i.blankLine&&i.blankLine(u);!l.eol();){var f=i.token(l,u);e(l.current(),f,c,l.start,u),l.start=l.pos}}}}(); \ No newline at end of file +!function(){"use strict";function t(t,e,r){for(var n in e||(e={}),t)!t.hasOwnProperty(n)||!1===r&&e.hasOwnProperty(n)||(e[n]=t[n]);return e}function e(t,e,r,n,i){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var o=n||0,s=i||0;;){var a=t.indexOf("\t",o);if(a<0||a>=e)return s+(e-o);s+=a-o,s+=r-s%r,o=a+1}}function r(){}var n=function(t,e,r){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};n.prototype.eol=function(){return this.pos>=this.string.length},n.prototype.sol=function(){return this.pos==this.lineStart},n.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},n.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},n.prototype.eat=function(t){var e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t.test?t.test(e):t(e)))return++this.pos,e},n.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},n.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},n.prototype.skipToEnd=function(){this.pos=this.string.length},n.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},n.prototype.backUp=function(t){this.pos-=t},n.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=e(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?e(this.string,this.lineStart,this.tabSize):0)},n.prototype.indentation=function(){return e(this.string,null,this.tabSize)-(this.lineStart?e(this.string,this.lineStart,this.tabSize):0)},n.prototype.match=function(t,e,r){if("string"!=typeof t){var n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&!1!==e&&(this.pos+=n[0].length),n)}var i=function(t){return r?t.toLowerCase():t};if(i(this.string.substr(this.pos,t.length))==i(t))return!1!==e&&(this.pos+=t.length),!0},n.prototype.current=function(){return this.string.slice(this.start,this.pos)},n.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},n.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},n.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var i={},o={};function s(e){if("string"==typeof e&&o.hasOwnProperty(e))e=o[e];else if(e&&"string"==typeof e.name&&o.hasOwnProperty(e.name)){var n=o[e.name];"string"==typeof n&&(n={name:n}),i=n,a=e,Object.create?p=Object.create(i):(r.prototype=i,p=new r),a&&t(a,p),(e=p).name=n.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return s("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return s("application/json")}var i,a,p;return"string"==typeof e?{name:e}:e||{name:"null"}}var a={};var p,l={__proto__:null,modes:i,mimeModes:o,defineMode:function(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),i[t]=e},defineMIME:function(t,e){o[t]=e},resolveMode:s,getMode:function t(e,r){r=s(r);var n=i[r.name];if(!n)return t(e,"text/plain");var o=n(e,r);if(a.hasOwnProperty(r.name)){var p=a[r.name];for(var l in p)p.hasOwnProperty(l)&&(o.hasOwnProperty(l)&&(o["_"+l]=o[l]),o[l]=p[l])}if(o.name=r.name,r.helperType&&(o.helperType=r.helperType),r.modeProps)for(var u in r.modeProps)o[u]=r.modeProps[u];return o},modeExtensions:a,extendMode:function(e,r){t(r,a.hasOwnProperty(e)?a[e]:a[e]={})},copyState:function(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var r={};for(var n in e){var i=e[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r},innerMode:function(t,e){for(var r;t.innerMode&&(r=t.innerMode(e))&&r.mode!=t;)e=r.state,t=r.mode;return r||{mode:t,state:e}},startState:function(t,e,r){return!t.startState||t.startState(e,r)}},u="undefined"!=typeof globalThis?globalThis:window;for(var h in u.CodeMirror={},CodeMirror.StringStream=n,l)CodeMirror[h]=l[h];CodeMirror.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),CodeMirror.defineMIME("text/plain","null"),CodeMirror.registerHelper=CodeMirror.registerGlobalHelper=Math.min,CodeMirror.splitLines=function(t){return t.split(/\r?\n|\r/)},CodeMirror.defaults={indentUnit:2},p=function(t){t.runMode=function(e,r,n,i){var o=t.getMode(t.defaults,r),s=i&&i.tabSize||t.defaults.tabSize;if(n.appendChild){var a=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9),p=n,l=0;p.innerHTML="",n=function(t,e){if("\n"==t)return p.appendChild(document.createTextNode(a?"\r":t)),void(l=0);for(var r="",n=0;;){var i=t.indexOf("\t",n);if(-1==i){r+=t.slice(n),l+=t.length-n;break}l+=i-n,r+=t.slice(n,i);var o=s-l%s;l+=o;for(var u=0;u<o;++u)r+=" ";n=i+1}if(e){var h=p.appendChild(document.createElement("span"));h.className="cm-"+e.replace(/ +/g," cm-"),h.appendChild(document.createTextNode(r))}else p.appendChild(document.createTextNode(r))}}for(var u=t.splitLines(e),h=i&&i.state||t.startState(o),f=0,c=u.length;f<c;++f){f&&n("\n");var d=new t.StringStream(u[f],null,{lookAhead:function(t){return u[f+t]},baseToken:function(){}});for(!d.string&&o.blankLine&&o.blankLine(h);!d.eol();){var m=o.token(d,h);n(d.current(),m,f,d.start,h),d.start=d.pos}}}},"object"==typeof exports&&"object"==typeof module?p(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],p):p(CodeMirror)}(); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/runmode/runmode.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/runmode/runmode.js index 8c80554ccf8b..957b58c93d70 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/runmode/runmode.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/runmode/runmode.js @@ -1 +1 @@ -!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.runMode=function(t,n,r,o){var a=e.getMode(e.defaults,n),d=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9);if(r.appendChild){var i=o&&o.tabSize||e.defaults.tabSize,c=r,l=0;c.innerHTML="",r=function(e,t){if("\n"==e)return c.appendChild(document.createTextNode(d?"\r":e)),void(l=0);for(var n="",r=0;;){var o=e.indexOf("\t",r);if(-1==o){n+=e.slice(r),l+=e.length-r;break}l+=o-r,n+=e.slice(r,o);var a=i-l%i;l+=a;for(var u=0;u<a;++u)n+=" ";r=o+1}if(t){var f=c.appendChild(document.createElement("span"));f.className="cm-"+t.replace(/ +/g," cm-"),f.appendChild(document.createTextNode(n))}else c.appendChild(document.createTextNode(n))}}for(var u=e.splitLines(t),f=o&&o.state||e.startState(a),s=0,p=u.length;s<p;++s){s&&r("\n");var m=new e.StringStream(u[s]);for(!m.string&&a.blankLine&&a.blankLine(f);!m.eol();){var v=a.token(m,f);r(m.current(),v,s,m.start,f),m.start=m.pos}}}})); \ No newline at end of file +!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.runMode=function(t,n,r,o){var a=e.getMode(e.defaults,n),i=o&&o.tabSize||e.defaults.tabSize;if(r.appendChild){var d=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9),c=r,l=0;c.innerHTML="",r=function(e,t){if("\n"==e)return c.appendChild(document.createTextNode(d?"\r":e)),void(l=0);for(var n="",r=0;;){var o=e.indexOf("\t",r);if(-1==o){n+=e.slice(r),l+=e.length-r;break}l+=o-r,n+=e.slice(r,o);var a=i-l%i;l+=a;for(var u=0;u<a;++u)n+=" ";r=o+1}if(t){var f=c.appendChild(document.createElement("span"));f.className="cm-"+t.replace(/ +/g," cm-"),f.appendChild(document.createTextNode(n))}else c.appendChild(document.createTextNode(n))}}for(var u=e.splitLines(t),f=o&&o.state||e.startState(a),s=0,p=u.length;s<p;++s){s&&r("\n");var m=new e.StringStream(u[s],null,{lookAhead:function(e){return u[s+e]},baseToken:function(){}});for(!m.string&&a.blankLine&&a.blankLine(f);!m.eol();){var v=a.token(m,f);r(m.current(),v,s,m.start,f),m.start=m.pos}}}})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/runmode/runmode.node.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/runmode/runmode.node.js index c62d3338d5f7..a77ee5214dd8 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/runmode/runmode.node.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/runmode/runmode.node.js @@ -1 +1 @@ -function splitLines(t){return t.split(/\r\n?|\n/)}var countColumn=exports.countColumn=function(t,e,n,s,r){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var i=s||0,o=r||0;;){var a=t.indexOf("\t",i);if(a<0||a>=e)return o+(e-i);o+=a-i,o+=n-o%n,i=a+1}};function StringStream(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.context=n}StringStream.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(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(t){var e=this.string.charAt(this.pos);if("string"==typeof t)var n=e==t;else n=e&&(t.test?t.test(e):t(e));if(n)return++this.pos,e},eatWhile:function(t){for(var e=this.pos;this.eat(t););return this.pos>e},eatSpace:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},backUp:function(t){this.pos-=t},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=countColumn(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?countColumn(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return countColumn(this.string,null,this.tabSize)-(this.lineStart?countColumn(this.string,this.lineStart,this.tabSize):0)},match:function(t,e,n){if("string"!=typeof t){var s=this.string.slice(this.pos).match(t);return s&&s.index>0?null:(s&&!1!==e&&(this.pos+=s[0].length),s)}var r=function(t){return n?t.toLowerCase():t};if(r(this.string.substr(this.pos,t.length))==r(t))return!1!==e&&(this.pos+=t.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},lookAhead:function(t){var e=this.context.line+t;return e>=this.context.lines.length?null:this.context.lines[e]}},exports.StringStream=StringStream,exports.startState=function(t,e,n){return!t.startState||t.startState(e,n)};var modes=exports.modes={},mimeModes=exports.mimeModes={};function copyObj(t,e,n){for(var s in e||(e={}),t)!t.hasOwnProperty(s)||!1===n&&e.hasOwnProperty(s)||(e[s]=t[s]);return e}exports.defineMode=function(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),modes[t]=e},exports.defineMIME=function(t,e){mimeModes[t]=e},exports.defineMode("null",(function(){return{token:function(t){t.skipToEnd()}}})),exports.defineMIME("text/plain","null"),exports.resolveMode=function(t){return"string"==typeof t&&mimeModes.hasOwnProperty(t)?t=mimeModes[t]:t&&"string"==typeof t.name&&mimeModes.hasOwnProperty(t.name)&&(t=mimeModes[t.name]),"string"==typeof t?{name:t}:t||{name:"null"}};var modeExtensions=exports.modeExtensions={};exports.extendMode=function(t,e){copyObj(e,modeExtensions.hasOwnProperty(t)?modeExtensions[t]:modeExtensions[t]={})},exports.getMode=function(t,e){e=exports.resolveMode(e);var n=modes[e.name];if(!n)return exports.getMode(t,"text/plain");var s=n(t,e);if(modeExtensions.hasOwnProperty(e.name)){var r=modeExtensions[e.name];for(var i in r)r.hasOwnProperty(i)&&(s.hasOwnProperty(i)&&(s["_"+i]=s[i]),s[i]=r[i])}if(s.name=e.name,e.helperType&&(s.helperType=e.helperType),e.modeProps)for(var i in e.modeProps)s[i]=e.modeProps[i];return s},exports.innerMode=function(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}},exports.registerHelper=exports.registerGlobalHelper=Math.min,exports.runMode=function(t,e,n,s){for(var r=exports.getMode({indentUnit:2},e),i=splitLines(t),o=s&&s.state||exports.startState(r),a={lines:i,line:0},h=0,u=i.length;h<u;++h,++a.line){h&&n("\n");var l=new exports.StringStream(i[h],4,a);for(!l.string&&r.blankLine&&r.blankLine(o);!l.eol();){var p=r.token(l,o);n(l.current(),p,h,l.start,o),l.start=l.pos}}},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")]; \ No newline at end of file +"use strict";function copyObj(t,e,n){for(var r in e||(e={}),t)!t.hasOwnProperty(r)||!1===n&&e.hasOwnProperty(r)||(e[r]=t[r]);return e}function countColumn(t,e,n,r,o){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var i=r||0,s=o||0;;){var a=t.indexOf("\t",i);if(a<0||a>=e)return s+(e-i);s+=a-i,s+=n-s%n,i=a+1}}function nothing(){}function createObj(t,e){var n;return Object.create?n=Object.create(t):(nothing.prototype=t,n=new nothing),e&©Obj(e,n),n}var StringStream=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};StringStream.prototype.eol=function(){return this.pos>=this.string.length},StringStream.prototype.sol=function(){return this.pos==this.lineStart},StringStream.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},StringStream.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},StringStream.prototype.eat=function(t){var e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t.test?t.test(e):t(e)))return++this.pos,e},StringStream.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},StringStream.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},StringStream.prototype.skipToEnd=function(){this.pos=this.string.length},StringStream.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},StringStream.prototype.backUp=function(t){this.pos-=t},StringStream.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=countColumn(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?countColumn(this.string,this.lineStart,this.tabSize):0)},StringStream.prototype.indentation=function(){return countColumn(this.string,null,this.tabSize)-(this.lineStart?countColumn(this.string,this.lineStart,this.tabSize):0)},StringStream.prototype.match=function(t,e,n){if("string"!=typeof t){var r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var o=function(t){return n?t.toLowerCase():t};if(o(this.string.substr(this.pos,t.length))==o(t))return!1!==e&&(this.pos+=t.length),!0},StringStream.prototype.current=function(){return this.string.slice(this.start,this.pos)},StringStream.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},StringStream.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},StringStream.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var modes={},mimeModes={};function defineMode(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),modes[t]=e}function defineMIME(t,e){mimeModes[t]=e}function resolveMode(t){if("string"==typeof t&&mimeModes.hasOwnProperty(t))t=mimeModes[t];else if(t&&"string"==typeof t.name&&mimeModes.hasOwnProperty(t.name)){var e=mimeModes[t.name];"string"==typeof e&&(e={name:e}),(t=createObj(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return resolveMode("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return resolveMode("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function getMode(t,e){e=resolveMode(e);var n=modes[e.name];if(!n)return getMode(t,"text/plain");var r=n(t,e);if(modeExtensions.hasOwnProperty(e.name)){var o=modeExtensions[e.name];for(var i in o)o.hasOwnProperty(i)&&(r.hasOwnProperty(i)&&(r["_"+i]=r[i]),r[i]=o[i])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var s in e.modeProps)r[s]=e.modeProps[s];return r}var modeExtensions={};function extendMode(t,e){copyObj(e,modeExtensions.hasOwnProperty(t)?modeExtensions[t]:modeExtensions[t]={})}function copyState(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var o=e[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function innerMode(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function startState(t,e,n){return!t.startState||t.startState(e,n)}var modeMethods={__proto__:null,modes,mimeModes,defineMode,defineMIME,resolveMode,getMode,modeExtensions,extendMode,copyState,innerMode,startState};for(var exported in exports.StringStream=StringStream,exports.countColumn=countColumn,modeMethods)exports[exported]=modeMethods[exported];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")],exports.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),exports.defineMIME("text/plain","null"),exports.registerHelper=exports.registerGlobalHelper=Math.min,exports.splitLines=function(t){return t.split(/\r?\n|\r/)},exports.defaults={indentUnit:2},function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){t.runMode=function(e,n,r,o){var i=t.getMode(t.defaults,n),s=o&&o.tabSize||t.defaults.tabSize;if(r.appendChild){var a=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9),u=r,p=0;u.innerHTML="",r=function(t,e){if("\n"==t)return u.appendChild(document.createTextNode(a?"\r":t)),void(p=0);for(var n="",r=0;;){var o=t.indexOf("\t",r);if(-1==o){n+=t.slice(r),p+=t.length-r;break}p+=o-r,n+=t.slice(r,o);var i=s-p%s;p+=i;for(var l=0;l<i;++l)n+=" ";r=o+1}if(e){var d=u.appendChild(document.createElement("span"));d.className="cm-"+e.replace(/ +/g," cm-"),d.appendChild(document.createTextNode(n))}else u.appendChild(document.createTextNode(n))}}for(var l=t.splitLines(e),d=o&&o.state||t.startState(i),h=0,c=l.length;h<c;++h){h&&r("\n");var m=new t.StringStream(l[h],null,{lookAhead:function(t){return l[h+t]},baseToken:function(){}});for(!m.string&&i.blankLine&&i.blankLine(d);!m.eol();){var f=i.token(m,d);r(m.current(),f,h,m.start,d),m.start=m.pos}}}})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/scroll/annotatescrollbar.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/scroll/annotatescrollbar.js index df28dd575bef..8f331c56a679 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/scroll/annotatescrollbar.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/scroll/annotatescrollbar.js @@ -1 +1 @@ -!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";function e(t,e){function i(t){clearTimeout(n.doRedraw),n.doRedraw=setTimeout((function(){n.redraw()}),t)}this.cm=t,this.options=e,this.buttonHeight=e.scrollButtonHeight||t.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=t.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var n=this;t.on("refresh",this.resizeHandler=function(){clearTimeout(n.doUpdate),n.doUpdate=setTimeout((function(){n.computeScale()&&i(20)}),100)}),t.on("markerAdded",this.resizeHandler),t.on("markerCleared",this.resizeHandler),!1!==e.listenForChanges&&t.on("changes",this.changeHandler=function(){i(250)})}t.defineExtension("annotateScrollbar",(function(t){return"string"==typeof t&&(t={className:t}),new e(this,t)})),t.defineOption("scrollButtonHeight",0),e.prototype.computeScale=function(){var t=this.cm,e=(t.getWrapperElement().clientHeight-t.display.barHeight-2*this.buttonHeight)/t.getScrollerElement().scrollHeight;if(e!=this.hScale)return this.hScale=e,!0},e.prototype.update=function(t){this.annotations=t,this.redraw()},e.prototype.redraw=function(t){!1!==t&&this.computeScale();var e=this.cm,i=this.hScale,n=document.createDocumentFragment(),o=this.annotations,r=e.getOption("lineWrapping"),a=r&&1.5*e.defaultTextHeight(),s=null,h=null;function l(t,i){return s!=t.line&&(s=t.line,h=e.getLineHandle(s)),h.widgets&&h.widgets.length||r&&h.height>a?e.charCoords(t,"local")[i?"top":"bottom"]:e.heightAtLine(h,"local")+(i?0:h.height)}var d=e.lastLine();if(e.display.barWidth)for(var c,p=0;p<o.length;p++){var u=o[p];if(!(u.to.line>d)){for(var f=c||l(u.from,!0)*i,m=l(u.to,!1)*i;p<o.length-1&&!(o[p+1].to.line>d)&&!((c=l(o[p+1].from,!0)*i)>m+.9);)m=l((u=o[++p]).to,!1)*i;if(m!=f){var g=Math.max(m-f,3),H=n.appendChild(document.createElement("div"));H.style.cssText="position: absolute; right: 0px; width: "+Math.max(e.display.barWidth-1,2)+"px; top: "+(f+this.buttonHeight)+"px; height: "+g+"px",H.className=this.options.className,u.id&&H.setAttribute("annotation-id",u.id)}}}this.div.textContent="",this.div.appendChild(n)},e.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("changes",this.changeHandler),this.div.parentNode.removeChild(this.div)}})); \ No newline at end of file +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";function e(t,e){function i(t){clearTimeout(n.doRedraw),n.doRedraw=setTimeout((function(){n.redraw()}),t)}this.cm=t,this.options=e,this.buttonHeight=e.scrollButtonHeight||t.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=t.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var n=this;t.on("refresh",this.resizeHandler=function(){clearTimeout(n.doUpdate),n.doUpdate=setTimeout((function(){n.computeScale()&&i(20)}),100)}),t.on("markerAdded",this.resizeHandler),t.on("markerCleared",this.resizeHandler),!1!==e.listenForChanges&&t.on("changes",this.changeHandler=function(){i(250)})}t.defineExtension("annotateScrollbar",(function(t){return"string"==typeof t&&(t={className:t}),new e(this,t)})),t.defineOption("scrollButtonHeight",0),e.prototype.computeScale=function(){var t=this.cm,e=(t.getWrapperElement().clientHeight-t.display.barHeight-2*this.buttonHeight)/t.getScrollerElement().scrollHeight;if(e!=this.hScale)return this.hScale=e,!0},e.prototype.update=function(t){this.annotations=t,this.redraw()},e.prototype.redraw=function(t){!1!==t&&this.computeScale();var e=this.cm,i=this.hScale,n=document.createDocumentFragment(),o=this.annotations,r=e.getOption("lineWrapping"),a=r&&1.5*e.defaultTextHeight(),s=null,h=null;function l(t,i){if(s!=t.line){s=t.line,h=e.getLineHandle(t.line);var n=e.getLineHandleVisualStart(h);n!=h&&(s=e.getLineNumber(n),h=n)}return h.widgets&&h.widgets.length||r&&h.height>a?e.charCoords(t,"local")[i?"top":"bottom"]:e.heightAtLine(h,"local")+(i?0:h.height)}var d=e.lastLine();if(e.display.barWidth)for(var c,p=0;p<o.length;p++){var u=o[p];if(!(u.to.line>d)){for(var f=c||l(u.from,!0)*i,m=l(u.to,!1)*i;p<o.length-1&&!(o[p+1].to.line>d)&&!((c=l(o[p+1].from,!0)*i)>m+.9);)m=l((u=o[++p]).to,!1)*i;if(m!=f){var g=Math.max(m-f,3),H=n.appendChild(document.createElement("div"));H.style.cssText="position: absolute; right: 0px; width: "+Math.max(e.display.barWidth-1,2)+"px; top: "+(f+this.buttonHeight)+"px; height: "+g+"px",H.className=this.options.className,u.id&&H.setAttribute("annotation-id",u.id)}}}this.div.textContent="",this.div.appendChild(n)},e.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("changes",this.changeHandler),this.div.parentNode.removeChild(this.div)}})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/search/match-highlighter.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/search/match-highlighter.js index 8d52f43a1666..d8b539c59e6e 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/search/match-highlighter.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/search/match-highlighter.js @@ -1 +1 @@ -!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("./matchesonscrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./matchesonscrollbar"],t):t(CodeMirror)}((function(t){"use strict";var e={style:"matchhighlight",minChars:2,delay:100,wordsOnly:!1,annotateScrollbar:!1,showToken:!1,trim:!0};function o(t){for(var o in this.options={},e)this.options[o]=(t&&t.hasOwnProperty(o)?t:e)[o];this.overlay=this.timeout=null,this.matchesonscroll=null,this.active=!1}function i(t){var e=t.state.matchHighlighter;(e.active||t.hasFocus())&&r(t,e)}function n(t){var e=t.state.matchHighlighter;e.active||(e.active=!0,r(t,e))}function r(t,e){clearTimeout(e.timeout),e.timeout=setTimeout((function(){c(t)}),e.options.delay)}function a(t,e,o,i){var n=t.state.matchHighlighter;if(t.addOverlay(n.overlay=function(t,e,o){return{token:function(i){if(i.match(t)&&(!e||function(t,e){return!(t.start&&e.test(t.string.charAt(t.start-1))||t.pos!=t.string.length&&e.test(t.string.charAt(t.pos)))}(i,e)))return o;i.next(),i.skipTo(t.charAt(0))||i.skipToEnd()}}}(e,o,i)),n.options.annotateScrollbar&&t.showMatchesOnScrollbar){var r=o?new RegExp("\\b"+e.replace(/[\\\[.+*?(){|^$]/g,"\\$&")+"\\b"):e;n.matchesonscroll=t.showMatchesOnScrollbar(r,!1,{className:"CodeMirror-selection-highlight-scrollbar"})}}function s(t){var e=t.state.matchHighlighter;e.overlay&&(t.removeOverlay(e.overlay),e.overlay=null,e.matchesonscroll&&(e.matchesonscroll.clear(),e.matchesonscroll=null))}function c(t){t.operation((function(){var e=t.state.matchHighlighter;if(s(t),t.somethingSelected()||!e.options.showToken){var o=t.getCursor("from"),i=t.getCursor("to");if(o.line==i.line&&(!e.options.wordsOnly||function(t,e,o){if(null!==t.getRange(e,o).match(/^\w+$/)){if(e.ch>0){var i={line:e.line,ch:e.ch-1};if(null===t.getRange(i,e).match(/\W/))return!1}if(o.ch<t.getLine(e.line).length){i={line:o.line,ch:o.ch+1};if(null===t.getRange(o,i).match(/\W/))return!1}return!0}return!1}(t,o,i))){var n=t.getRange(o,i);e.options.trim&&(n=n.replace(/^\s+|\s+$/g,"")),n.length>=e.options.minChars&&a(t,n,!1,e.options.style)}}else{for(var r=!0===e.options.showToken?/[\w$]/:e.options.showToken,c=t.getCursor(),l=t.getLine(c.line),h=c.ch,u=h;h&&r.test(l.charAt(h-1));)--h;for(;u<l.length&&r.test(l.charAt(u));)++u;h<u&&a(t,l.slice(h,u),r,e.options.style)}}))}t.defineOption("highlightSelectionMatches",!1,(function(e,r,a){if(a&&a!=t.Init&&(s(e),clearTimeout(e.state.matchHighlighter.timeout),e.state.matchHighlighter=null,e.off("cursorActivity",i),e.off("focus",n)),r){var l=e.state.matchHighlighter=new o(r);e.hasFocus()?(l.active=!0,c(e)):e.on("focus",n),e.on("cursorActivity",i)}}))})); \ No newline at end of file +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("./matchesonscrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./matchesonscrollbar"],t):t(CodeMirror)}((function(t){"use strict";var e={style:"matchhighlight",minChars:2,delay:100,wordsOnly:!1,annotateScrollbar:!1,showToken:!1,trim:!0};function o(t){for(var o in this.options={},e)this.options[o]=(t&&t.hasOwnProperty(o)?t:e)[o];this.overlay=this.timeout=null,this.matchesonscroll=null,this.active=!1}function i(t){var e=t.state.matchHighlighter;(e.active||t.hasFocus())&&r(t,e)}function n(t){var e=t.state.matchHighlighter;e.active||(e.active=!0,r(t,e))}function r(t,e){clearTimeout(e.timeout),e.timeout=setTimeout((function(){c(t)}),e.options.delay)}function a(t,e,o,i){var n=t.state.matchHighlighter;if(t.addOverlay(n.overlay=function(t,e,o){return{token:function(i){if(i.match(t)&&(!e||function(t,e){return!(t.start&&e.test(t.string.charAt(t.start-1))||t.pos!=t.string.length&&e.test(t.string.charAt(t.pos)))}(i,e)))return o;i.next(),i.skipTo(t.charAt(0))||i.skipToEnd()}}}(e,o,i)),n.options.annotateScrollbar&&t.showMatchesOnScrollbar){var r=o?new RegExp((/\w/.test(e.charAt(0))?"\\b":"")+e.replace(/[\\\[.+*?(){|^$]/g,"\\$&")+(/\w/.test(e.charAt(e.length-1))?"\\b":"")):e;n.matchesonscroll=t.showMatchesOnScrollbar(r,!1,{className:"CodeMirror-selection-highlight-scrollbar"})}}function s(t){var e=t.state.matchHighlighter;e.overlay&&(t.removeOverlay(e.overlay),e.overlay=null,e.matchesonscroll&&(e.matchesonscroll.clear(),e.matchesonscroll=null))}function c(t){t.operation((function(){var e=t.state.matchHighlighter;if(s(t),t.somethingSelected()||!e.options.showToken){var o=t.getCursor("from"),i=t.getCursor("to");if(o.line==i.line&&(!e.options.wordsOnly||function(t,e,o){if(null!==t.getRange(e,o).match(/^\w+$/)){if(e.ch>0){var i={line:e.line,ch:e.ch-1};if(null===t.getRange(i,e).match(/\W/))return!1}if(o.ch<t.getLine(e.line).length){i={line:o.line,ch:o.ch+1};if(null===t.getRange(o,i).match(/\W/))return!1}return!0}return!1}(t,o,i))){var n=t.getRange(o,i);e.options.trim&&(n=n.replace(/^\s+|\s+$/g,"")),n.length>=e.options.minChars&&a(t,n,!1,e.options.style)}}else{for(var r=!0===e.options.showToken?/[\w$]/:e.options.showToken,c=t.getCursor(),l=t.getLine(c.line),h=c.ch,u=h;h&&r.test(l.charAt(h-1));)--h;for(;u<l.length&&r.test(l.charAt(u));)++u;h<u&&a(t,l.slice(h,u),r,e.options.style)}}))}t.defineOption("highlightSelectionMatches",!1,(function(e,r,a){if(a&&a!=t.Init&&(s(e),clearTimeout(e.state.matchHighlighter.timeout),e.state.matchHighlighter=null,e.off("cursorActivity",i),e.off("focus",n)),r){var l=e.state.matchHighlighter=new o(r);e.hasFocus()?(l.active=!0,c(e)):e.on("focus",n),e.on("cursorActivity",i)}}))})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/wrap/hardwrap.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/wrap/hardwrap.js index ba9b2f5f1e9e..83a9a3125697 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/wrap/hardwrap.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/addon/wrap/hardwrap.js @@ -1 +1 @@ -!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";var r=t.Pos;function e(t,r,e){for(var n=e.paragraphStart||t.getHelper(r,"paragraphStart"),o=r.line,a=t.firstLine();o>a;--o){var i=t.getLine(o);if(n&&n.test(i))break;if(!/\S/.test(i)){++o;break}}for(var f=e.paragraphEnd||t.getHelper(r,"paragraphEnd"),l=r.line+1,h=t.lastLine();l<=h;++l){i=t.getLine(l);if(f&&f.test(i)){++l;break}if(!/\S/.test(i))break}return{from:o,to:l}}function n(t,r,e,n){for(var o=r;o<t.length&&" "==t.charAt(o);)o++;for(;o>0&&!e.test(t.slice(o-1,o+1));--o);for(var a=!0;;a=!1){var i=o;if(n)for(;" "==t.charAt(i-1);)--i;if(0!=i||!a)return{from:i,to:o};o=r}}function o(e,o,a,i){o=e.clipPos(o),a=e.clipPos(a);var f=i.column||80,l=i.wrapOn||/\s\S|-[^\.\d]/,h=!1!==i.killTrailingSpace,s=[],c="",g=o.line,p=e.getRange(o,a,!1);if(!p.length)return null;var u=p[0].match(/^[ \t]*/)[0];u.length>=f&&(f=u.length+1);for(var m=0;m<p.length;++m){var v=p[m],d=c.length,b=0;c&&v&&!l.test(c.charAt(c.length-1)+v.charAt(0))&&(c+=" ",b=1);var x="";if(m&&(x=v.match(/^\s*/)[0],v=v.slice(x.length)),c+=v,m){var S=c.length>f&&u==x&&n(c,f,l,h);S&&S.from==d&&S.to==d+b?(c=u+v,++g):s.push({text:[b?" ":""],from:r(g,d),to:r(g+1,x.length)})}for(;c.length>f;){var E=n(c,f,l,h);s.push({text:["",u],from:r(g,E.from),to:r(g,E.to)}),c=u+c.slice(E.to),++g}}return s.length&&e.operation((function(){for(var r=0;r<s.length;++r){var n=s[r];(n.text||t.cmpPos(n.from,n.to))&&e.replaceRange(n.text,n.from,n.to)}})),s.length?{from:s[0].from,to:t.changeEnd(s[s.length-1])}:null}t.defineExtension("wrapParagraph",(function(t,n){n=n||{},t||(t=this.getCursor());var a=e(this,t,n);return o(this,r(a.from,0),r(a.to-1),n)})),t.commands.wrapLines=function(t){t.operation((function(){for(var n=t.listSelections(),a=t.lastLine()+1,i=n.length-1;i>=0;i--){var f,l=n[i];if(l.empty()){var h=e(t,l.head,{});f={from:r(h.from,0),to:r(h.to-1)}}else f={from:l.from(),to:l.to()};f.to.line>=a||(a=f.from.line,o(t,f.from,f.to,{}))}}))},t.defineExtension("wrapRange",(function(t,r,e){return o(this,t,r,e||{})})),t.defineExtension("wrapParagraphsInRange",(function(t,n,a){a=a||{};for(var i=this,f=[],l=t.line;l<=n.line;){var h=e(i,r(l,0),a);f.push(h),l=h.to}var s=!1;return f.length&&i.operation((function(){for(var t=f.length-1;t>=0;--t)s=s||o(i,r(f[t].from,0),r(f[t].to-1),a)})),s}))})); \ No newline at end of file +!function(r){"object"==typeof exports&&"object"==typeof module?r(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)}((function(r){"use strict";var t=r.Pos;function e(r,t,e){for(var n=e.paragraphStart||r.getHelper(t,"paragraphStart"),o=t.line,a=r.firstLine();o>a;--o){var i=r.getLine(o);if(n&&n.test(i))break;if(!/\S/.test(i)){++o;break}}for(var f=e.paragraphEnd||r.getHelper(t,"paragraphEnd"),l=t.line+1,h=r.lastLine();l<=h;++l){i=r.getLine(l);if(f&&f.test(i)){++l;break}if(!/\S/.test(i))break}return{from:o,to:l}}function n(r,t,e,n,o){for(var a=t;a<r.length&&" "==r.charAt(a);)a++;for(;a>0&&!e.test(r.slice(a-1,a+1));--a);if(0==a&&!o)for(a=t+1;a<r.length-1&&!e.test(r.slice(a-1,a+1));++a);for(var i=!0;;i=!1){var f=a;if(n)for(;" "==r.charAt(f-1);)--f;if(0!=f||!i)return{from:f,to:a};a=t}}function o(e,o,a,i){o=e.clipPos(o),a=e.clipPos(a);var f=i.column||80,l=i.wrapOn||/\s\S|-[^\.\d]/,h=!1!==i.forceBreak,s=!1!==i.killTrailingSpace,c=[],g="",p=o.line,m=e.getRange(o,a,!1);if(!m.length)return null;var u=m[0].match(/^[ \t]*/)[0];u.length>=f&&(f=u.length+1);for(var v=0;v<m.length;++v){var d=m[v],b=g.length,x=0;g&&d&&!l.test(g.charAt(g.length-1)+d.charAt(0))&&(g+=" ",x=1);var k="";if(v&&(k=d.match(/^\s*/)[0],d=d.slice(k.length)),g+=d,v){var S=g.length>f&&u==k&&n(g,f,l,s,h);S&&S.from==b&&S.to==b+x?(g=u+d,++p):c.push({text:[x?" ":""],from:t(p,b),to:t(p+1,k.length)})}for(;g.length>f;){var E=n(g,f,l,s,h);if(E.from==E.to&&!h)break;c.push({text:["",u],from:t(p,E.from),to:t(p,E.to)}),g=u+g.slice(E.to),++p}}return c.length&&e.operation((function(){for(var t=0;t<c.length;++t){var n=c[t];(n.text||r.cmpPos(n.from,n.to))&&e.replaceRange(n.text,n.from,n.to)}})),c.length?{from:c[0].from,to:r.changeEnd(c[c.length-1])}:null}r.defineExtension("wrapParagraph",(function(r,n){n=n||{},r||(r=this.getCursor());var a=e(this,r,n);return o(this,t(a.from,0),t(a.to-1),n)})),r.commands.wrapLines=function(r){r.operation((function(){for(var n=r.listSelections(),a=r.lastLine()+1,i=n.length-1;i>=0;i--){var f,l=n[i];if(l.empty()){var h=e(r,l.head,{});f={from:t(h.from,0),to:t(h.to-1)}}else f={from:l.from(),to:l.to()};f.to.line>=a||(a=f.from.line,o(r,f.from,f.to,{}))}}))},r.defineExtension("wrapRange",(function(r,t,e){return o(this,r,t,e||{})})),r.defineExtension("wrapParagraphsInRange",(function(r,n,a){a=a||{};for(var i=this,f=[],l=r.line;l<=n.line;){var h=e(i,t(l,0),a);f.push(h),l=h.to}var s=!1;return f.length&&i.operation((function(){for(var r=f.length-1;r>=0;--r)s=s||o(i,t(f[r].from,0),t(f[r].to-1),a)})),s}))})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/keymap/emacs.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/keymap/emacs.js index 0a589d0eb429..1576cde9734e 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/keymap/emacs.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/keymap/emacs.js @@ -1 +1 @@ -!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../lib/codemirror")):"function"==typeof define&&define.amd?define(["../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";var e=t.Pos;function n(t,e){return t.line==e.line&&t.ch==e.ch}var r=[];function o(t){r.push(t),r.length>50&&r.shift()}function i(t){return r[r.length-(t?Math.min(t,1):1)]||""}var l=null;function a(t,e,i,a,c){null==c&&(c=t.getRange(e,i)),"grow"==a&&l&&l.cm==t&&n(e,l.pos)&&t.isClean(l.gen)?function(t){if(!r.length)return o(t);r[r.length-1]+=t}(c):!1!==a&&o(c),t.replaceRange("",e,i,"+delete"),l="grow"==a?{cm:t,pos:e,gen:t.changeGeneration()}:null}function c(t,e,n){return t.findPosH(e,n,"char",!0)}function u(t,e,n){return t.findPosH(e,n,"word",!0)}function f(t,e,n){return t.findPosV(e,n,"line",t.doc.sel.goalColumn)}function s(t,e,n){return t.findPosV(e,n,"page",t.doc.sel.goalColumn)}function g(t,n,r){for(var o=n.line,i=t.getLine(o),l=/\S/.test(r<0?i.slice(0,n.ch):i.slice(n.ch)),a=t.firstLine(),c=t.lastLine();;){if((o+=r)<a||o>c)return t.clipPos(e(o-r,r<0?0:null));if(i=t.getLine(o),/\S/.test(i))l=!0;else if(l)return e(o,0)}}function C(t,n,r){for(var o=n.line,i=n.ch,l=t.getLine(n.line),a=!1;;){var c=l.charAt(i+(r<0?-1:0));if(c){if(a&&/[!?.]/.test(c))return e(o,i+(r>0?1:0));a||(a=/\w/.test(c)),i+=r}else{if(o==(r<0?t.firstLine():t.lastLine()))return e(o,i);if(l=t.getLine(o+r),!/\S/.test(l))return e(o,i);o+=r,i=r<0?l.length:0}}}function d(t,r,o){var i;if(t.findMatchingBracket&&(i=t.findMatchingBracket(r,{strict:!0}))&&i.match&&(i.forward?1:-1)==o)return o>0?e(i.to.line,i.to.ch+1):i.to;for(var l=!0;;l=!1){var a=t.getTokenAt(r),c=e(r.line,o<0?a.start:a.end);if(!(l&&o>0&&a.end==r.ch)&&/\w/.test(a.string))return c;var u=t.findPosH(c,o,"char");if(n(c,u))return r;r=u}}function p(t,e){var n=t.state.emacsPrefix;return n?(L(t),"-"==n?-1:Number(n)):e?null:1}function h(t){var e="string"==typeof t?function(e){e.execCommand(t)}:t;return function(t){var n=p(t);e(t);for(var r=1;r<n;++r)e(t)}}function A(t,e,r,o){var i=p(t);i<0&&(o=-o,i=-i);for(var l=0;l<i;++l){var a=r(t,e,o);if(n(a,e))break;e=a}return e}function v(t,e){var n=function(n){n.extendSelection(A(n,n.getCursor(),t,e))};return n.motion=!0,n}function m(t,e,n,r){for(var o,i=t.listSelections(),l=i.length;l--;)a(t,o=i[l].head,A(t,o,e,n),r)}function S(t,e){if(t.somethingSelected()){for(var n,r=t.listSelections(),o=r.length;o--;)a(t,(n=r[o]).anchor,n.head,e);return!0}}function P(t,e){t.state.emacsPrefix?"-"!=e&&(t.state.emacsPrefix+=e):(t.state.emacsPrefix=e,t.on("keyHandled",x),t.on("inputRead",R))}var w={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0};function x(t,e){t.state.emacsPrefixMap||w.hasOwnProperty(e)||L(t)}function L(t){t.state.emacsPrefix=null,t.off("keyHandled",x),t.off("inputRead",R)}function R(t,e){var n=p(t);if(n>1&&"+input"==e.origin){for(var r=e.text.join("\n"),o="",i=1;i<n;++i)o+=r;t.replaceSelection(o)}}function y(t,e){("string"!=typeof e||!/^\d$/.test(e)&&"Ctrl-U"!=e)&&(t.removeKeyMap(D),t.state.emacsPrefixMap=!1,t.off("keyHandled",y),t.off("inputRead",y))}function k(t){t.setCursor(t.getCursor()),t.setExtending(!t.getExtending()),t.on("change",(function(){t.setExtending(!1)}))}function b(t){t.setExtending(!1),t.setCursor(t.getCursor())}function U(t,e){var n=t.getCursor(),r=t.findPosH(n,1,"word");t.replaceRange(e(t.getRange(n,r)),n,r),t.setCursor(r)}t.emacs={kill:a,killRegion:S,repeated:h};var X=t.keyMap.emacs=t.normalizeKeyMap({"Ctrl-W":function(t){a(t,t.getCursor("start"),t.getCursor("end"),!0)},"Ctrl-K":h((function(t){var n=t.getCursor(),r=t.clipPos(e(n.line)),o=t.getRange(n,r);/\S/.test(o)||(o+="\n",r=e(n.line+1,0)),a(t,n,r,"grow",o)})),"Alt-W":function(t){o(t.getSelection()),b(t)},"Ctrl-Y":function(t){var e=t.getCursor();t.replaceRange(i(p(t)),e,e,"paste"),t.setSelection(e,t.getCursor())},"Alt-Y":function(t){t.replaceSelection((r.length>1&&r.pop(),i()),"around","paste")},"Ctrl-Space":k,"Ctrl-Shift-2":k,"Ctrl-F":v(c,1),"Ctrl-B":v(c,-1),Right:v(c,1),Left:v(c,-1),"Ctrl-D":function(t){m(t,c,1,!1)},Delete:function(t){S(t,!1)||m(t,c,1,!1)},"Ctrl-H":function(t){m(t,c,-1,!1)},Backspace:function(t){S(t,!1)||m(t,c,-1,!1)},"Alt-F":v(u,1),"Alt-B":v(u,-1),"Alt-Right":v(u,1),"Alt-Left":v(u,-1),"Alt-D":function(t){m(t,u,1,"grow")},"Alt-Backspace":function(t){m(t,u,-1,"grow")},"Ctrl-N":v(f,1),"Ctrl-P":v(f,-1),Down:v(f,1),Up:v(f,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":v(s,-1),"Ctrl-V":v(s,1),PageUp:v(s,-1),PageDown:v(s,1),"Ctrl-Up":v(g,-1),"Ctrl-Down":v(g,1),"Alt-A":v(C,-1),"Alt-E":v(C,1),"Alt-K":function(t){m(t,C,1,"grow")},"Ctrl-Alt-K":function(t){m(t,d,1,"grow")},"Ctrl-Alt-Backspace":function(t){m(t,d,-1,"grow")},"Ctrl-Alt-F":v(d,1),"Ctrl-Alt-B":v(d,-1),"Shift-Ctrl-Alt-2":function(t){var e=t.getCursor();t.setSelection(A(t,e,d,1),e)},"Ctrl-Alt-T":function(t){var e=d(t,t.getCursor(),-1),n=d(t,e,1),r=d(t,n,1),o=d(t,r,-1);t.replaceRange(t.getRange(o,r)+t.getRange(n,o)+t.getRange(e,n),e,r)},"Ctrl-Alt-U":h((function(t){for(var n=t.getCursor(),r=n.line,o=n.ch,i=[];r>=t.firstLine();){for(var l=t.getLine(r),a=null==o?l.length:o;a>0;){if(")"==(o=l.charAt(--a)))i.push("(");else if("]"==o)i.push("[");else if("}"==o)i.push("{");else if(/[\(\{\[]/.test(o)&&(!i.length||i.pop()!=o))return t.extendSelection(e(r,a))}--r,o=null}})),"Alt-Space":function(t){for(var n=t.getCursor(),r=n.ch,o=n.ch,i=t.getLine(n.line);r&&/\s/.test(i.charAt(r-1));)--r;for(;o<i.length&&/\s/.test(i.charAt(o));)++o;t.replaceRange(" ",e(n.line,r),e(n.line,o))},"Ctrl-O":h((function(t){t.replaceSelection("\n","start")})),"Ctrl-T":h((function(t){t.execCommand("transposeChars")})),"Alt-C":h((function(t){U(t,(function(t){var e=t.search(/\w/);return-1==e?t:t.slice(0,e)+t.charAt(e).toUpperCase()+t.slice(e+1).toLowerCase()}))})),"Alt-U":h((function(t){U(t,(function(t){return t.toUpperCase()}))})),"Alt-L":h((function(t){U(t,(function(t){return t.toLowerCase()}))})),"Alt-;":"toggleComment","Ctrl-/":h("undo"),"Shift-Ctrl--":h("undo"),"Ctrl-Z":h("undo"),"Cmd-Z":h("undo"),"Shift-Ctrl-Z":"redo","Shift-Alt-,":"goDocStart","Shift-Alt-.":"goDocEnd","Ctrl-S":"findPersistentNext","Ctrl-R":"findPersistentPrev","Ctrl-G":function(t){t.execCommand("clearSearch"),b(t)},"Shift-Alt-5":"replace","Alt-/":"autocomplete",Enter:"newlineAndIndent","Ctrl-J":h((function(t){t.replaceSelection("\n","end")})),Tab:"indentAuto","Alt-G G":function(t){var e=p(t,!0);if(null!=e&&e>0)return t.setCursor(e-1);!function(t,e,n){t.openDialog?t.openDialog(e+': <input type="text" style="width: 10em"/>',n,{bottom:!0}):n(prompt(e,""))}(t,"Goto line",(function(e){var n;e&&!isNaN(n=Number(e))&&n==(0|n)&&n>0&&t.setCursor(n-1)}))},"Ctrl-X Tab":function(t){t.indentSelection(p(t,!0)||t.getOption("indentUnit"))},"Ctrl-X Ctrl-X":function(t){t.setSelection(t.getCursor("head"),t.getCursor("anchor"))},"Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X U":h("undo"),"Ctrl-X K":"close","Ctrl-X Delete":function(t){a(t,t.getCursor(),C(t,t.getCursor(),1),"grow")},"Ctrl-X H":"selectAll","Ctrl-Q Tab":h("insertTab"),"Ctrl-U":function(t){t.state.emacsPrefixMap=!0,t.addKeyMap(D),t.on("keyHandled",y),t.on("inputRead",y)}}),D={"Ctrl-G":L};function E(t){D[t]=function(e){P(e,t)},X["Ctrl-"+t]=function(e){P(e,t)},w["Ctrl-"+t]=!0}for(var H=0;H<10;++H)E(String(H));E("-")})); \ No newline at end of file +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../lib/codemirror")):"function"==typeof define&&define.amd?define(["../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";var e=t.Pos;function n(t,e){return t.line==e.line&&t.ch==e.ch}var r=[];function o(t){r.push(t),r.length>50&&r.shift()}function i(t){return r[r.length-(t?Math.min(t,1):1)]||""}var l=null;function a(t,e,i,a,c){null==c&&(c=t.getRange(e,i)),"grow"==a&&l&&l.cm==t&&n(e,l.pos)&&t.isClean(l.gen)?function(t){if(!r.length)return o(t);r[r.length-1]+=t}(c):!1!==a&&o(c),t.replaceRange("",e,i,"+delete"),l="grow"==a?{cm:t,pos:e,gen:t.changeGeneration()}:null}function c(t,e,n){return t.findPosH(e,n,"char",!0)}function u(t,e,n){return t.findPosH(e,n,"word",!0)}function f(t,e,n){return t.findPosV(e,n,"line",t.doc.sel.goalColumn)}function s(t,e,n){return t.findPosV(e,n,"page",t.doc.sel.goalColumn)}function g(t,n,r){for(var o=n.line,i=t.getLine(o),l=/\S/.test(r<0?i.slice(0,n.ch):i.slice(n.ch)),a=t.firstLine(),c=t.lastLine();;){if((o+=r)<a||o>c)return t.clipPos(e(o-r,r<0?0:null));if(i=t.getLine(o),/\S/.test(i))l=!0;else if(l)return e(o,0)}}function C(t,n,r){for(var o=n.line,i=n.ch,l=t.getLine(n.line),a=!1;;){var c=l.charAt(i+(r<0?-1:0));if(c){if(a&&/[!?.]/.test(c))return e(o,i+(r>0?1:0));a||(a=/\w/.test(c)),i+=r}else{if(o==(r<0?t.firstLine():t.lastLine()))return e(o,i);if(l=t.getLine(o+r),!/\S/.test(l))return e(o,i);o+=r,i=r<0?l.length:0}}}function d(t,r,o){var i;if(t.findMatchingBracket&&(i=t.findMatchingBracket(r,{strict:!0}))&&i.match&&(i.forward?1:-1)==o)return o>0?e(i.to.line,i.to.ch+1):i.to;for(var l=!0;;l=!1){var a=t.getTokenAt(r),c=e(r.line,o<0?a.start:a.end);if(!(l&&o>0&&a.end==r.ch)&&/\w/.test(a.string))return c;var u=t.findPosH(c,o,"char");if(n(c,u))return r;r=u}}function p(t,e){var n=t.state.emacsPrefix;return n?(L(t),"-"==n?-1:Number(n)):e?null:1}function h(t){var e="string"==typeof t?function(e){e.execCommand(t)}:t;return function(t){var n=p(t);e(t);for(var r=1;r<n;++r)e(t)}}function A(t,e,r,o){var i=p(t);i<0&&(o=-o,i=-i);for(var l=0;l<i;++l){var a=r(t,e,o);if(n(a,e))break;e=a}return e}function v(t,e){var n=function(n){n.extendSelection(A(n,n.getCursor(),t,e))};return n.motion=!0,n}function m(t,e,n,r){for(var o,i=t.listSelections(),l=i.length;l--;)a(t,o=i[l].head,A(t,o,e,n),r)}function S(t,e){if(t.somethingSelected()){for(var n,r=t.listSelections(),o=r.length;o--;)a(t,(n=r[o]).anchor,n.head,e);return!0}}function P(t,e){t.state.emacsPrefix?"-"!=e&&(t.state.emacsPrefix+=e):(t.state.emacsPrefix=e,t.on("keyHandled",x),t.on("inputRead",R))}var w={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0};function x(t,e){t.state.emacsPrefixMap||w.hasOwnProperty(e)||L(t)}function L(t){t.state.emacsPrefix=null,t.off("keyHandled",x),t.off("inputRead",R)}function R(t,e){var n=p(t);if(n>1&&"+input"==e.origin){for(var r=e.text.join("\n"),o="",i=1;i<n;++i)o+=r;t.replaceSelection(o)}}function y(t,e){("string"!=typeof e||!/^\d$/.test(e)&&"Ctrl-U"!=e)&&(t.removeKeyMap(D),t.state.emacsPrefixMap=!1,t.off("keyHandled",y),t.off("inputRead",y))}function k(t){t.setCursor(t.getCursor()),t.setExtending(!t.getExtending()),t.on("change",(function(){t.setExtending(!1)}))}function b(t){t.setExtending(!1),t.setCursor(t.getCursor())}function U(t,e){var n=t.getCursor(),r=t.findPosH(n,1,"word");t.replaceRange(e(t.getRange(n,r)),n,r),t.setCursor(r)}t.emacs={kill:a,killRegion:S,repeated:h};var X=t.keyMap.emacs=t.normalizeKeyMap({"Ctrl-W":function(t){a(t,t.getCursor("start"),t.getCursor("end"),!0)},"Ctrl-K":h((function(t){var n=t.getCursor(),r=t.clipPos(e(n.line)),o=t.getRange(n,r);/\S/.test(o)||(o+="\n",r=e(n.line+1,0)),a(t,n,r,"grow",o)})),"Alt-W":function(t){o(t.getSelection()),b(t)},"Ctrl-Y":function(t){var e=t.getCursor();t.replaceRange(i(p(t)),e,e,"paste"),t.setSelection(e,t.getCursor())},"Alt-Y":function(t){t.replaceSelection((r.length>1&&r.pop(),i()),"around","paste")},"Ctrl-Space":k,"Ctrl-Shift-2":k,"Ctrl-F":v(c,1),"Ctrl-B":v(c,-1),Right:v(c,1),Left:v(c,-1),"Ctrl-D":function(t){m(t,c,1,!1)},Delete:function(t){S(t,!1)||m(t,c,1,!1)},"Ctrl-H":function(t){m(t,c,-1,!1)},Backspace:function(t){S(t,!1)||m(t,c,-1,!1)},"Alt-F":v(u,1),"Alt-B":v(u,-1),"Alt-Right":v(u,1),"Alt-Left":v(u,-1),"Alt-D":function(t){m(t,u,1,"grow")},"Alt-Backspace":function(t){m(t,u,-1,"grow")},"Ctrl-N":v(f,1),"Ctrl-P":v(f,-1),Down:v(f,1),Up:v(f,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":v(s,-1),"Ctrl-V":v(s,1),PageUp:v(s,-1),PageDown:v(s,1),"Ctrl-Up":v(g,-1),"Ctrl-Down":v(g,1),"Alt-A":v(C,-1),"Alt-E":v(C,1),"Alt-K":function(t){m(t,C,1,"grow")},"Ctrl-Alt-K":function(t){m(t,d,1,"grow")},"Ctrl-Alt-Backspace":function(t){m(t,d,-1,"grow")},"Ctrl-Alt-F":v(d,1),"Ctrl-Alt-B":v(d,-1),"Shift-Ctrl-Alt-2":function(t){var e=t.getCursor();t.setSelection(A(t,e,d,1),e)},"Ctrl-Alt-T":function(t){var e=d(t,t.getCursor(),-1),n=d(t,e,1),r=d(t,n,1),o=d(t,r,-1);t.replaceRange(t.getRange(o,r)+t.getRange(n,o)+t.getRange(e,n),e,r)},"Ctrl-Alt-U":h((function(t){for(var n=t.getCursor(),r=n.line,o=n.ch,i=[];r>=t.firstLine();){for(var l=t.getLine(r),a=null==o?l.length:o;a>0;){if(")"==(o=l.charAt(--a)))i.push("(");else if("]"==o)i.push("[");else if("}"==o)i.push("{");else if(/[\(\{\[]/.test(o)&&(!i.length||i.pop()!=o))return t.extendSelection(e(r,a))}--r,o=null}})),"Alt-Space":function(t){for(var n=t.getCursor(),r=n.ch,o=n.ch,i=t.getLine(n.line);r&&/\s/.test(i.charAt(r-1));)--r;for(;o<i.length&&/\s/.test(i.charAt(o));)++o;t.replaceRange(" ",e(n.line,r),e(n.line,o))},"Ctrl-O":h((function(t){t.replaceSelection("\n","start")})),"Ctrl-T":h((function(t){t.execCommand("transposeChars")})),"Alt-C":h((function(t){U(t,(function(t){var e=t.search(/\w/);return-1==e?t:t.slice(0,e)+t.charAt(e).toUpperCase()+t.slice(e+1).toLowerCase()}))})),"Alt-U":h((function(t){U(t,(function(t){return t.toUpperCase()}))})),"Alt-L":h((function(t){U(t,(function(t){return t.toLowerCase()}))})),"Alt-;":"toggleComment","Ctrl-/":h("undo"),"Shift-Ctrl--":h("undo"),"Ctrl-Z":h("undo"),"Cmd-Z":h("undo"),"Shift-Ctrl-Z":"redo","Shift-Alt-,":"goDocStart","Shift-Alt-.":"goDocEnd","Ctrl-S":"findPersistentNext","Ctrl-R":"findPersistentPrev","Ctrl-G":function(t){t.execCommand("clearSearch"),b(t)},"Shift-Alt-5":"replace","Alt-/":"autocomplete",Enter:"newlineAndIndent","Ctrl-J":h((function(t){t.replaceSelection("\n","end")})),Tab:"indentAuto","Alt-G G":function(t){var e=p(t,!0);if(null!=e&&e>0)return t.setCursor(e-1);!function(t,e,n){t.openDialog?t.openDialog(e+': <input type="text" style="width: 10em"/>',n,{bottom:!0}):n(prompt(e,""))}(t,"Goto line",(function(e){var n;e&&!isNaN(n=Number(e))&&n==(0|n)&&n>0&&t.setCursor(n-1)}))},"Ctrl-X Tab":function(t){t.indentSelection(p(t,!0)||t.getOption("indentUnit"))},"Ctrl-X Ctrl-X":function(t){t.setSelection(t.getCursor("head"),t.getCursor("anchor"))},"Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X U":h("undo"),"Ctrl-X K":"close","Ctrl-X Delete":function(t){a(t,t.getCursor(),C(t,t.getCursor(),1),"grow")},"Ctrl-X H":"selectAll","Ctrl-Q Tab":h("insertTab"),"Ctrl-U":function(t){t.state.emacsPrefixMap=!0,t.addKeyMap(D),t.on("keyHandled",y),t.on("inputRead",y)},fallthrough:"default"}),D={"Ctrl-G":L};function E(t){D[t]=function(e){P(e,t)},X["Ctrl-"+t]=function(e){P(e,t)},w["Ctrl-"+t]=!0}for(var H=0;H<10;++H)E(String(H));E("-")})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/keymap/sublime.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/keymap/sublime.js index 98e038938a0f..11bae4ff5dfe 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/keymap/sublime.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/keymap/sublime.js @@ -1 +1 @@ -!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";var t=e.commands,n=e.Pos;function r(t,r){t.extendSelectionsBy((function(o){return t.display.shift||t.doc.extend||o.empty()?function(t,r,o){if(o<0&&0==r.ch)return t.clipPos(n(r.line-1));var i=t.getLine(r.line);if(o>0&&r.ch>=i.length)return t.clipPos(n(r.line+1,0));for(var l,a="start",s=r.ch,c=s,f=o<0?0:i.length,u=0;c!=f;c+=o,u++){var d=i.charAt(o<0?c-1:c),m="_"!=d&&e.isWordChar(d)?"w":"o";if("w"==m&&d.toUpperCase()==d&&(m="W"),"start"==a)"o"!=m?(a="in",l=m):s=c+o;else if("in"==a&&l!=m){if("w"==l&&"W"==m&&o<0&&c--,"W"==l&&"w"==m&&o>0){if(c==s+1){l="w";continue}c--}break}}return n(r.line,c)}(t.doc,o.head,r):r<0?o.from():o.to()}))}function o(t,r){if(t.isReadOnly())return e.Pass;t.operation((function(){for(var e=t.listSelections().length,o=[],i=-1,l=0;l<e;l++){var a=t.listSelections()[l].head;if(!(a.line<=i)){var s=n(a.line+(r?0:1),0);t.replaceRange("\n",s,null,"+insertLine"),t.indentLine(s.line,null,!0),o.push({head:s,anchor:s}),i=a.line+1}}t.setSelections(o)})),t.execCommand("indentAuto")}function i(t,r){for(var o=r.ch,i=o,l=t.getLine(r.line);o&&e.isWordChar(l.charAt(o-1));)--o;for(;i<l.length&&e.isWordChar(l.charAt(i));)++i;return{from:n(r.line,o),to:n(r.line,i),word:l.slice(o,i)}}function l(e,t){for(var n=e.listSelections(),r=[],o=0;o<n.length;o++){var i=n[o],l=e.findPosV(i.anchor,t,"line",i.anchor.goalColumn),a=e.findPosV(i.head,t,"line",i.head.goalColumn);l.goalColumn=null!=i.anchor.goalColumn?i.anchor.goalColumn:e.cursorCoords(i.anchor,"div").left,a.goalColumn=null!=i.head.goalColumn?i.head.goalColumn:e.cursorCoords(i.head,"div").left;var s={anchor:l,head:a};r.push(i),r.push(s)}e.setSelections(r)}t.goSubwordLeft=function(e){r(e,-1)},t.goSubwordRight=function(e){r(e,1)},t.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())},t.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())},t.splitSelectionByLine=function(e){for(var t=e.listSelections(),r=[],o=0;o<t.length;o++)for(var i=t[o].from(),l=t[o].to(),a=i.line;a<=l.line;++a)l.line>i.line&&a==l.line&&0==l.ch||r.push({anchor:a==i.line?i:n(a,0),head:a==l.line?l:n(a)});e.setSelections(r,0)},t.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},t.selectLine=function(e){for(var t=e.listSelections(),r=[],o=0;o<t.length;o++){var i=t[o];r.push({anchor:n(i.from().line,0),head:n(i.to().line+1,0)})}e.setSelections(r)},t.insertLineAfter=function(e){return o(e,!1)},t.insertLineBefore=function(e){return o(e,!0)},t.selectNextOccurrence=function(t){var r=t.getCursor("from"),o=t.getCursor("to"),l=t.state.sublimeFindFullWord==t.doc.sel;if(0==e.cmpPos(r,o)){var a=i(t,r);if(!a.word)return;t.setSelection(a.from,a.to),l=!0}else{var s=t.getRange(r,o),c=l?new RegExp("\\b"+s+"\\b"):s,f=t.getSearchCursor(c,o),u=f.findNext();if(u||(u=(f=t.getSearchCursor(c,n(t.firstLine(),0))).findNext()),!u||function(t,n,r){for(var o=0;o<t.length;o++)if(0==e.cmpPos(t[o].from(),n)&&0==e.cmpPos(t[o].to(),r))return!0;return!1}(t.listSelections(),f.from(),f.to()))return;t.addSelection(f.from(),f.to())}l&&(t.state.sublimeFindFullWord=t.doc.sel)},t.skipAndSelectNextOccurrence=function(n){var r=n.getCursor("anchor"),o=n.getCursor("head");t.selectNextOccurrence(n),0!=e.cmpPos(r,o)&&n.doc.setSelections(n.doc.listSelections().filter((function(e){return e.anchor!=r||e.head!=o})))},t.addCursorToPrevLine=function(e){l(e,-1)},t.addCursorToNextLine=function(e){l(e,1)};function a(t){for(var r=t.listSelections(),o=[],i=0;i<r.length;i++){var l=r[i],a=l.head,s=t.scanForBracket(a,-1);if(!s)return!1;for(;;){var c=t.scanForBracket(a,1);if(!c)return!1;if(c.ch=="(){}[]".charAt("(){}[]".indexOf(s.ch)+1)){var f=n(s.pos.line,s.pos.ch+1);if(0!=e.cmpPos(f,l.from())||0!=e.cmpPos(c.pos,l.to())){o.push({anchor:f,head:c.pos});break}if(!(s=t.scanForBracket(s.pos,-1)))return!1}a=n(c.pos.line,c.pos.ch+1)}}return t.setSelections(o),!0}function s(e){return e?/\bpunctuation\b/.test(e)?e:void 0:null}function c(t,r){if(t.isReadOnly())return e.Pass;for(var o,i=t.listSelections(),l=[],a=0;a<i.length;a++){var s=i[a];if(!s.empty()){for(var c=s.from().line,f=s.to().line;a<i.length-1&&i[a+1].from().line==f;)f=i[++a].to().line;i[a].to().ch||f--,l.push(c,f)}}l.length?o=!0:l.push(t.firstLine(),t.lastLine()),t.operation((function(){for(var e=[],i=0;i<l.length;i+=2){var a=l[i],s=l[i+1],c=n(a,0),f=n(s),u=t.getRange(c,f,!1);r?u.sort():u.sort((function(e,t){var n=e.toUpperCase(),r=t.toUpperCase();return n!=r&&(e=n,t=r),e<t?-1:e==t?0:1})),t.replaceRange(u,c,f),o&&e.push({anchor:c,head:n(s+1,0)})}o&&t.setSelections(e,0)}))}function f(t,n){t.operation((function(){for(var r=t.listSelections(),o=[],l=[],a=0;a<r.length;a++){(c=r[a]).empty()?(o.push(a),l.push("")):l.push(n(t.getRange(c.from(),c.to())))}t.replaceSelections(l,"around","case");var s;for(a=o.length-1;a>=0;a--){var c=r[o[a]];if(!(s&&e.cmpPos(c.head,s)>0)){var f=i(t,c.head);s=f.from,t.replaceRange(n(f.word),f.from,f.to)}}}))}function u(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 d(e,t){var r=u(e);if(r){var o=r.query,i=e.getSearchCursor(o,t?r.to:r.from);(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):(i=e.getSearchCursor(o,t?n(e.firstLine(),0):e.clipPos(n(e.lastLine()))),(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):r.word&&e.setSelection(r.from,r.to))}}t.selectScope=function(e){a(e)||e.execCommand("selectAll")},t.selectBetweenBrackets=function(t){if(!a(t))return e.Pass},t.goToBracket=function(t){t.extendSelectionsBy((function(r){var o=t.scanForBracket(r.head,1,s(t.getTokenTypeAt(r.head)));if(o&&0!=e.cmpPos(o.pos,r.head))return o.pos;var i=t.scanForBracket(r.head,-1,s(t.getTokenTypeAt(n(r.head.line,r.head.ch+1))));return i&&n(i.pos.line,i.pos.ch+1)||r.head}))},t.swapLineUp=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),o=[],i=t.firstLine()-1,l=[],a=0;a<r.length;a++){var s=r[a],c=s.from().line-1,f=s.to().line;l.push({anchor:n(s.anchor.line-1,s.anchor.ch),head:n(s.head.line-1,s.head.ch)}),0!=s.to().ch||s.empty()||--f,c>i?o.push(c,f):o.length&&(o[o.length-1]=f),i=f}t.operation((function(){for(var e=0;e<o.length;e+=2){var r=o[e],i=o[e+1],a=t.getLine(r);t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),i>t.lastLine()?t.replaceRange("\n"+a,n(t.lastLine()),null,"+swapLine"):t.replaceRange(a+"\n",n(i,0),null,"+swapLine")}t.setSelections(l),t.scrollIntoView()}))},t.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),o=[],i=t.lastLine()+1,l=r.length-1;l>=0;l--){var a=r[l],s=a.to().line+1,c=a.from().line;0!=a.to().ch||a.empty()||s--,s<i?o.push(s,c):o.length&&(o[o.length-1]=c),i=c}t.operation((function(){for(var e=o.length-2;e>=0;e-=2){var r=o[e],i=o[e+1],l=t.getLine(r);r==t.lastLine()?t.replaceRange("",n(r-1),n(r),"+swapLine"):t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),t.replaceRange(l+"\n",n(i,0),null,"+swapLine")}t.scrollIntoView()}))},t.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},t.joinLines=function(e){for(var t=e.listSelections(),r=[],o=0;o<t.length;o++){for(var i=t[o],l=i.from(),a=l.line,s=i.to().line;o<t.length-1&&t[o+1].from().line==s;)s=t[++o].to().line;r.push({start:a,end:s,anchor:!i.empty()&&l})}e.operation((function(){for(var t=0,o=[],i=0;i<r.length;i++){for(var l,a=r[i],s=a.anchor&&n(a.anchor.line-t,a.anchor.ch),c=a.start;c<=a.end;c++){var f=c-t;c==a.end&&(l=n(f,e.getLine(f).length+1)),f<e.lastLine()&&(e.replaceRange(" ",n(f),n(f+1,/^\s*/.exec(e.getLine(f+1))[0].length)),++t)}o.push({anchor:s||l,head:l})}e.setSelections(o,0)}))},t.duplicateLine=function(e){e.operation((function(){for(var t=e.listSelections().length,r=0;r<t;r++){var o=e.listSelections()[r];o.empty()?e.replaceRange(e.getLine(o.head.line)+"\n",n(o.head.line,0)):e.replaceRange(e.getRange(o.from(),o.to()),o.from())}e.scrollIntoView()}))},t.sortLines=function(e){c(e,!0)},t.sortLinesInsensitive=function(e){c(e,!1)},t.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)}},t.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()}},t.toggleBookmark=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r<t.length;r++){for(var o=t[r].from(),i=t[r].to(),l=t[r].empty()?e.findMarksAt(o):e.findMarks(o,i),a=0;a<l.length;a++)if(l[a].sublimeBookmark){l[a].clear();for(var s=0;s<n.length;s++)n[s]==l[a]&&n.splice(s--,1);break}a==l.length&&n.push(e.markText(o,i,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},t.clearBookmarks=function(e){var t=e.state.sublimeBookmarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();t.length=0},t.selectBookmarks=function(e){var t=e.state.sublimeBookmarks,n=[];if(t)for(var r=0;r<t.length;r++){var o=t[r].find();o?n.push({anchor:o.from,head:o.to}):t.splice(r--,0)}n.length&&e.setSelections(n,0)},t.smartBackspace=function(t){if(t.somethingSelected())return e.Pass;t.operation((function(){for(var r=t.listSelections(),o=t.getOption("indentUnit"),i=r.length-1;i>=0;i--){var l=r[i].head,a=t.getRange({line:l.line,ch:0},l),s=e.countColumn(a,null,t.getOption("tabSize")),c=t.findPosH(l,-1,"char",!1);if(a&&!/\S/.test(a)&&s%o==0){var f=new n(l.line,e.findColumn(a,s-o,o));f.ch!=l.ch&&(c=f)}t.replaceRange("",c,l,"+delete")}}))},t.delLineRight=function(e){e.operation((function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange("",t[r].anchor,n(t[r].to().line),"+delete");e.scrollIntoView()}))},t.upcaseAtCursor=function(e){f(e,(function(e){return e.toUpperCase()}))},t.downcaseAtCursor=function(e){f(e,(function(e){return e.toLowerCase()}))},t.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},t.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},t.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),o=n;if(e.cmpPos(r,o)>0){var i=o;o=r,r=i}t.state.sublimeKilled=t.getRange(r,o),t.replaceRange("",r,o)}},t.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))},t.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},t.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},t.findUnder=function(e){d(e,!0)},t.findUnderPrevious=function(e){d(e,!1)},t.findAllUnder=function(e){var t=u(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],o=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&o++;e.setSelections(r,o)}};var m=e.keyMap;m.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Cmd-F5":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},e.normalizeKeyMap(m.macSublime),m.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Ctrl-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},e.normalizeKeyMap(m.pcSublime);var h=m.default==m.macDefault;m.sublime=h?m.macSublime:m.pcSublime})); \ No newline at end of file +!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";var t=e.commands,n=e.Pos;function r(t,r){t.extendSelectionsBy((function(o){return t.display.shift||t.doc.extend||o.empty()?function(t,r,o){if(o<0&&0==r.ch)return t.clipPos(n(r.line-1));var i=t.getLine(r.line);if(o>0&&r.ch>=i.length)return t.clipPos(n(r.line+1,0));for(var l,a="start",s=r.ch,c=s,f=o<0?0:i.length,u=0;c!=f;c+=o,u++){var d=i.charAt(o<0?c-1:c),m="_"!=d&&e.isWordChar(d)?"w":"o";if("w"==m&&d.toUpperCase()==d&&(m="W"),"start"==a)"o"!=m?(a="in",l=m):s=c+o;else if("in"==a&&l!=m){if("w"==l&&"W"==m&&o<0&&c--,"W"==l&&"w"==m&&o>0){if(c==s+1){l="w";continue}c--}break}}return n(r.line,c)}(t.doc,o.head,r):r<0?o.from():o.to()}))}function o(t,r){if(t.isReadOnly())return e.Pass;t.operation((function(){for(var e=t.listSelections().length,o=[],i=-1,l=0;l<e;l++){var a=t.listSelections()[l].head;if(!(a.line<=i)){var s=n(a.line+(r?0:1),0);t.replaceRange("\n",s,null,"+insertLine"),t.indentLine(s.line,null,!0),o.push({head:s,anchor:s}),i=a.line+1}}t.setSelections(o)})),t.execCommand("indentAuto")}function i(t,r){for(var o=r.ch,i=o,l=t.getLine(r.line);o&&e.isWordChar(l.charAt(o-1));)--o;for(;i<l.length&&e.isWordChar(l.charAt(i));)++i;return{from:n(r.line,o),to:n(r.line,i),word:l.slice(o,i)}}function l(e,t){for(var n=e.listSelections(),r=[],o=0;o<n.length;o++){var i=n[o],l=e.findPosV(i.anchor,t,"line",i.anchor.goalColumn),a=e.findPosV(i.head,t,"line",i.head.goalColumn);l.goalColumn=null!=i.anchor.goalColumn?i.anchor.goalColumn:e.cursorCoords(i.anchor,"div").left,a.goalColumn=null!=i.head.goalColumn?i.head.goalColumn:e.cursorCoords(i.head,"div").left;var s={anchor:l,head:a};r.push(i),r.push(s)}e.setSelections(r)}t.goSubwordLeft=function(e){r(e,-1)},t.goSubwordRight=function(e){r(e,1)},t.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())},t.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())},t.splitSelectionByLine=function(e){for(var t=e.listSelections(),r=[],o=0;o<t.length;o++)for(var i=t[o].from(),l=t[o].to(),a=i.line;a<=l.line;++a)l.line>i.line&&a==l.line&&0==l.ch||r.push({anchor:a==i.line?i:n(a,0),head:a==l.line?l:n(a)});e.setSelections(r,0)},t.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},t.selectLine=function(e){for(var t=e.listSelections(),r=[],o=0;o<t.length;o++){var i=t[o];r.push({anchor:n(i.from().line,0),head:n(i.to().line+1,0)})}e.setSelections(r)},t.insertLineAfter=function(e){return o(e,!1)},t.insertLineBefore=function(e){return o(e,!0)},t.selectNextOccurrence=function(t){var r=t.getCursor("from"),o=t.getCursor("to"),l=t.state.sublimeFindFullWord==t.doc.sel;if(0==e.cmpPos(r,o)){var a=i(t,r);if(!a.word)return;t.setSelection(a.from,a.to),l=!0}else{var s=t.getRange(r,o),c=l?new RegExp("\\b"+s+"\\b"):s,f=t.getSearchCursor(c,o),u=f.findNext();if(u||(u=(f=t.getSearchCursor(c,n(t.firstLine(),0))).findNext()),!u||function(t,n,r){for(var o=0;o<t.length;o++)if(0==e.cmpPos(t[o].from(),n)&&0==e.cmpPos(t[o].to(),r))return!0;return!1}(t.listSelections(),f.from(),f.to()))return;t.addSelection(f.from(),f.to())}l&&(t.state.sublimeFindFullWord=t.doc.sel)},t.skipAndSelectNextOccurrence=function(n){var r=n.getCursor("anchor"),o=n.getCursor("head");t.selectNextOccurrence(n),0!=e.cmpPos(r,o)&&n.doc.setSelections(n.doc.listSelections().filter((function(e){return e.anchor!=r||e.head!=o})))},t.addCursorToPrevLine=function(e){l(e,-1)},t.addCursorToNextLine=function(e){l(e,1)};function a(t){for(var r=t.listSelections(),o=[],i=0;i<r.length;i++){var l=r[i],a=l.head,s=t.scanForBracket(a,-1);if(!s)return!1;for(;;){var c=t.scanForBracket(a,1);if(!c)return!1;if(c.ch=="(){}[]".charAt("(){}[]".indexOf(s.ch)+1)){var f=n(s.pos.line,s.pos.ch+1);if(0!=e.cmpPos(f,l.from())||0!=e.cmpPos(c.pos,l.to())){o.push({anchor:f,head:c.pos});break}if(!(s=t.scanForBracket(s.pos,-1)))return!1}a=n(c.pos.line,c.pos.ch+1)}}return t.setSelections(o),!0}function s(e){return e?/\bpunctuation\b/.test(e)?e:void 0:null}function c(t,r){if(t.isReadOnly())return e.Pass;for(var o,i=t.listSelections(),l=[],a=0;a<i.length;a++){var s=i[a];if(!s.empty()){for(var c=s.from().line,f=s.to().line;a<i.length-1&&i[a+1].from().line==f;)f=i[++a].to().line;i[a].to().ch||f--,l.push(c,f)}}l.length?o=!0:l.push(t.firstLine(),t.lastLine()),t.operation((function(){for(var e=[],i=0;i<l.length;i+=2){var a=l[i],s=l[i+1],c=n(a,0),f=n(s),u=t.getRange(c,f,!1);r?u.sort():u.sort((function(e,t){var n=e.toUpperCase(),r=t.toUpperCase();return n!=r&&(e=n,t=r),e<t?-1:e==t?0:1})),t.replaceRange(u,c,f),o&&e.push({anchor:c,head:n(s+1,0)})}o&&t.setSelections(e,0)}))}function f(t,n){t.operation((function(){for(var r=t.listSelections(),o=[],l=[],a=0;a<r.length;a++){(c=r[a]).empty()?(o.push(a),l.push("")):l.push(n(t.getRange(c.from(),c.to())))}t.replaceSelections(l,"around","case");var s;for(a=o.length-1;a>=0;a--){var c=r[o[a]];if(!(s&&e.cmpPos(c.head,s)>0)){var f=i(t,c.head);s=f.from,t.replaceRange(n(f.word),f.from,f.to)}}}))}function u(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 d(e,t){var r=u(e);if(r){var o=r.query,i=e.getSearchCursor(o,t?r.to:r.from);(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):(i=e.getSearchCursor(o,t?n(e.firstLine(),0):e.clipPos(n(e.lastLine()))),(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):r.word&&e.setSelection(r.from,r.to))}}t.selectScope=function(e){a(e)||e.execCommand("selectAll")},t.selectBetweenBrackets=function(t){if(!a(t))return e.Pass},t.goToBracket=function(t){t.extendSelectionsBy((function(r){var o=t.scanForBracket(r.head,1,s(t.getTokenTypeAt(r.head)));if(o&&0!=e.cmpPos(o.pos,r.head))return o.pos;var i=t.scanForBracket(r.head,-1,s(t.getTokenTypeAt(n(r.head.line,r.head.ch+1))));return i&&n(i.pos.line,i.pos.ch+1)||r.head}))},t.swapLineUp=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),o=[],i=t.firstLine()-1,l=[],a=0;a<r.length;a++){var s=r[a],c=s.from().line-1,f=s.to().line;l.push({anchor:n(s.anchor.line-1,s.anchor.ch),head:n(s.head.line-1,s.head.ch)}),0!=s.to().ch||s.empty()||--f,c>i?o.push(c,f):o.length&&(o[o.length-1]=f),i=f}t.operation((function(){for(var e=0;e<o.length;e+=2){var r=o[e],i=o[e+1],a=t.getLine(r);t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),i>t.lastLine()?t.replaceRange("\n"+a,n(t.lastLine()),null,"+swapLine"):t.replaceRange(a+"\n",n(i,0),null,"+swapLine")}t.setSelections(l),t.scrollIntoView()}))},t.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),o=[],i=t.lastLine()+1,l=r.length-1;l>=0;l--){var a=r[l],s=a.to().line+1,c=a.from().line;0!=a.to().ch||a.empty()||s--,s<i?o.push(s,c):o.length&&(o[o.length-1]=c),i=c}t.operation((function(){for(var e=o.length-2;e>=0;e-=2){var r=o[e],i=o[e+1],l=t.getLine(r);r==t.lastLine()?t.replaceRange("",n(r-1),n(r),"+swapLine"):t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),t.replaceRange(l+"\n",n(i,0),null,"+swapLine")}t.scrollIntoView()}))},t.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},t.joinLines=function(e){for(var t=e.listSelections(),r=[],o=0;o<t.length;o++){for(var i=t[o],l=i.from(),a=l.line,s=i.to().line;o<t.length-1&&t[o+1].from().line==s;)s=t[++o].to().line;r.push({start:a,end:s,anchor:!i.empty()&&l})}e.operation((function(){for(var t=0,o=[],i=0;i<r.length;i++){for(var l,a=r[i],s=a.anchor&&n(a.anchor.line-t,a.anchor.ch),c=a.start;c<=a.end;c++){var f=c-t;c==a.end&&(l=n(f,e.getLine(f).length+1)),f<e.lastLine()&&(e.replaceRange(" ",n(f),n(f+1,/^\s*/.exec(e.getLine(f+1))[0].length)),++t)}o.push({anchor:s||l,head:l})}e.setSelections(o,0)}))},t.duplicateLine=function(e){e.operation((function(){for(var t=e.listSelections().length,r=0;r<t;r++){var o=e.listSelections()[r];o.empty()?e.replaceRange(e.getLine(o.head.line)+"\n",n(o.head.line,0)):e.replaceRange(e.getRange(o.from(),o.to()),o.from())}e.scrollIntoView()}))},t.sortLines=function(e){c(e,!0)},t.sortLinesInsensitive=function(e){c(e,!1)},t.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)}},t.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()}},t.toggleBookmark=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r<t.length;r++){for(var o=t[r].from(),i=t[r].to(),l=t[r].empty()?e.findMarksAt(o):e.findMarks(o,i),a=0;a<l.length;a++)if(l[a].sublimeBookmark){l[a].clear();for(var s=0;s<n.length;s++)n[s]==l[a]&&n.splice(s--,1);break}a==l.length&&n.push(e.markText(o,i,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},t.clearBookmarks=function(e){var t=e.state.sublimeBookmarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();t.length=0},t.selectBookmarks=function(e){var t=e.state.sublimeBookmarks,n=[];if(t)for(var r=0;r<t.length;r++){var o=t[r].find();o?n.push({anchor:o.from,head:o.to}):t.splice(r--,0)}n.length&&e.setSelections(n,0)},t.smartBackspace=function(t){if(t.somethingSelected())return e.Pass;t.operation((function(){for(var r=t.listSelections(),o=t.getOption("indentUnit"),i=r.length-1;i>=0;i--){var l=r[i].head,a=t.getRange({line:l.line,ch:0},l),s=e.countColumn(a,null,t.getOption("tabSize")),c=t.findPosH(l,-1,"char",!1);if(a&&!/\S/.test(a)&&s%o==0){var f=new n(l.line,e.findColumn(a,s-o,o));f.ch!=l.ch&&(c=f)}t.replaceRange("",c,l,"+delete")}}))},t.delLineRight=function(e){e.operation((function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange("",t[r].anchor,n(t[r].to().line),"+delete");e.scrollIntoView()}))},t.upcaseAtCursor=function(e){f(e,(function(e){return e.toUpperCase()}))},t.downcaseAtCursor=function(e){f(e,(function(e){return e.toLowerCase()}))},t.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},t.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},t.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),o=n;if(e.cmpPos(r,o)>0){var i=o;o=r,r=i}t.state.sublimeKilled=t.getRange(r,o),t.replaceRange("",r,o)}},t.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))},t.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},t.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},t.findUnder=function(e){d(e,!0)},t.findUnderPrevious=function(e){d(e,!1)},t.findAllUnder=function(e){var t=u(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],o=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&o++;e.setSelections(r,o)}};var m=e.keyMap;m.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Cmd-F5":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},e.normalizeKeyMap(m.macSublime),m.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Ctrl-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},e.normalizeKeyMap(m.pcSublime);var h=m.default==m.macDefault;m.sublime=h?m.macSublime:m.pcSublime})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/keymap/vim.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/keymap/vim.js index 2e3ae29bff8a..03afae5c736a 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/keymap/vim.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/keymap/vim.js @@ -1 +1 @@ -!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/dialog/dialog"),require("../addon/edit/matchbrackets.js")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/dialog/dialog","../addon/edit/matchbrackets"],e):e(CodeMirror)}((function(e){"use strict";var t=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"<Del>",type:"keyToKey",toKeys:"x",context:"normal"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<character>",type:"action",action:"replayMacro"},{keys:"q<character>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<character>",type:"action",action:"setMark"},{keys:'"<character>',type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<character>",type:"motion",motion:"textObjectManipulation"},{keys:"i<character>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],r=t.length,n=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],o=e.Pos;e.Vim=function(){function i(t,r){this==e.keyMap.vim&&(e.rmClass(t.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==t.getOption("inputStyle")&&null!=document.body.style.caretColor&&(!function(e){l(e),e.off("cursorActivity",s),e.state.fatCursorMarks=null}(t),t.getInputField().style.caretColor="")),r&&r.attach==a||function(t){t.setOption("disableInput",!1),t.off("cursorActivity",Ye),e.off(t.getInputField(),"paste",p(t)),t.state.vim=null}(t)}function a(t,r){this==e.keyMap.vim&&(e.addClass(t.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==t.getOption("inputStyle")&&null!=document.body.style.caretColor&&(!function(e){e.state.fatCursorMarks=[],s(e),e.on("cursorActivity",s)}(t),t.getInputField().style.caretColor="transparent")),r&&r.attach==a||function(t){t.setOption("disableInput",!0),t.setOption("showCursorWhenSelecting",!1),e.signal(t,"vim-mode-change",{mode:"normal"}),t.on("cursorActivity",Ye),j(t),e.on(t.getInputField(),"paste",p(t))}(t)}function s(e){if(e.state.fatCursorMarks){l(e);for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){var i=t[n];if(i.empty())if(i.anchor.ch<e.getLine(i.anchor.line).length)r.push(e.markText(i.anchor,o(i.anchor.line,i.anchor.ch+1),{className:"cm-fat-cursor-mark"}));else{var a=document.createElement("span");a.textContent=" ",a.className="cm-fat-cursor-mark",r.push(e.setBookmark(i.anchor,{widget:a}))}}e.state.fatCursorMarks=r}}function l(e){var t=e.state.fatCursorMarks;if(t)for(var r=0;r<t.length;r++)t[r].clear()}function c(t,r){if(r){if(this[t])return this[t];var n=function(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split(/-(?!$)/),r=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==r.length)return!1;for(var n=!1,o=0;o<t.length;o++){var i=t[o];i in u?t[o]=u[i]:n=!0,i in h&&(t[o]=h[i])}if(!n)return!1;S(r)&&(t[t.length-1]=r.toLowerCase());return"<"+t.join("-")+">"}(t);if(!n)return!1;var o=e.Vim.findKey(r,n);return"function"==typeof o&&e.signal(r,"vim-keypress",n),o}}e.defineOption("vimMode",!1,(function(t,r,n){r&&"vim"!=t.getOption("keyMap")?t.setOption("keyMap","vim"):!r&&n!=e.Init&&/^vim/.test(t.getOption("keyMap"))&&t.setOption("keyMap","default")}));var u={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A"},h={Enter:"CR",Backspace:"BS",Delete:"Del",Insert:"Ins"};function p(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(G(e.getCursor(),0,1)),z.enterInsertMode(e,{},t))}),t.onPasteFn}var f=/[\d]/,d=[e.isWordChar,function(t){return t&&!e.isWordChar(t)&&!/\s/.test(t)}],m=[function(e){return/\S/.test(e)}];function g(e,t){for(var r=[],n=e;n<e+t;n++)r.push(String.fromCharCode(n));return r}var v=g(65,26),y=g(97,26),k=g(48,10),C=[].concat(v,y,k,["<",">"]),w=[].concat(v,y,k,["-",'"',".",":","/"]);function x(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function M(e){return/^[a-z]$/.test(e)}function S(e){return/^[A-Z]$/.test(e)}function A(e){return/^\s*$/.test(e)}function b(e){return-1!=".?!".indexOf(e)}function L(e,t){for(var r=0;r<t.length;r++)if(t[r]==e)return!0;return!1}var T={};function R(e,t,r,n,o){if(void 0===t&&!o)throw Error("defaultValue is required unless callback is provided");if(r||(r="string"),T[e]={type:r,defaultValue:t,callback:o},n)for(var i=0;i<n.length;i++)T[n[i]]=T[e];t&&E(e,t)}function E(e,t,r,n){var o=T[e],i=(n=n||{}).scope;if(!o)return new Error("Unknown option: "+e);if("boolean"==o.type){if(t&&!0!==t)return new Error("Invalid argument: "+e+"="+t);!1!==t&&(t=!0)}o.callback?("local"!==i&&o.callback(t,void 0),"global"!==i&&r&&o.callback(t,r)):("local"!==i&&(o.value="boolean"==o.type?!!t:t),"global"!==i&&r&&(r.state.vim.options[e]={value:t}))}function O(e,t,r){var n=T[e],o=(r=r||{}).scope;if(!n)return new Error("Unknown option: "+e);if(n.callback){var i=t&&n.callback(void 0,t);return"global"!==o&&void 0!==i?i:"local"!==o?n.callback():void 0}return((i="global"!==o&&t&&t.state.vim.options[e])||"local"!==o&&n||{}).value}R("filetype",void 0,"string",["ft"],(function(e,t){if(void 0!==t){if(void 0===e)return"null"==(r=t.getOption("mode"))?"":r;var r=""==e?"null":e;t.setOption("mode",r)}}));var I,B,K=function(){var e=-1,t=0,r=0,n=new Array(100);function o(o,i){(e+=i)>t?e=t:e<r&&(e=r);var a=n[(100+e)%100];if(a&&!a.find()){var s,l=i>0?1:-1,c=o.getCursor();do{if((a=n[(100+(e+=l))%100])&&(s=a.find())&&!re(c,s))break}while(e<t&&e>r)}return a}return{cachedCursor:void 0,add:function(o,i,a){var s=n[e%100];function l(t){var r=++e%100,i=n[r];i&&i.clear(),n[r]=o.setBookmark(t)}if(s){var c=s.find();c&&!re(c,i)&&l(i)}else l(i);l(a),t=e,(r=e-100+1)<0&&(r=0)},find:function(t,r){var n=e,i=o(t,r);return e=n,i&&i.find()},move:o}},N=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};function P(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=N()}function j(e){return e.state.vim||(e.state.vim={inputState:new F,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},fakeCursor:null,insertMode:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,sel:{},options:{}}),e.state.vim}function _(){for(var e in I={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:K(),macroModeState:new P,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new D({}),searchHistoryController:new U,exCommandHistoryController:new U},T){var t=T[e];t.value=t.defaultValue}}P.prototype={exitMacroRecordMode:function(){var e=I.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var r=I.registerController.getRegister(t);r&&(r.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var H={buildKeyMap:function(){},getRegisterController:function(){return I.registerController},resetVimGlobalState_:_,getVimGlobalState_:function(){return I},maybeInitVimState_:j,suppressErrorLogging:!1,InsertModeKey:tt,map:function(e,t,r){Qe.map(e,t,r)},unmap:function(e,t){Qe.unmap(e,t)},noremap:function(e,n,o){function i(e){return e?[e]:["normal","insert","visual"]}for(var a=i(o),s=t.length,l=s-r;l<s&&a.length;l++){var c=t[l];if(!(c.keys!=n||o&&c.context&&c.context!==o||"ex"===c.type.substr(0,2)||"key"===c.type.substr(0,3))){var u={};for(var h in c)u[h]=c[h];u.keys=e,o&&!u.context&&(u.context=o),this._mapCommand(u);var p=i(c.context);a=a.filter((function(e){return-1===p.indexOf(e)}))}}},mapclear:function(e){var n=t.length,o=r,i=t.slice(0,n-o);if(t=t.slice(n-o),e)for(var a=i.length-1;a>=0;a--){var s=i[a];if(e!==s.context)if(s.context)this._mapCommand(s);else{var l=["normal","insert","visual"];for(var c in l)if(l[c]!==e){var u={};for(var h in s)u[h]=s[h];u.context=l[c],this._mapCommand(u)}}}},setOption:E,getOption:O,defineOption:R,defineEx:function(e,t,r){if(t){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered')}else t=e;qe[e]=r,Qe.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,r){var n=this.findKey(e,t,r);if("function"==typeof n)return n()},findKey:function(r,n,o){var i,a=j(r);function s(){var e=I.macroModeState;if(e.isRecording){if("q"==n)return e.exitMacroRecordMode(),W(r),!0;"mapping"!=o&&function(e,t){if(e.isPlaying)return;var r=e.latestRegister,n=I.registerController.getRegister(r);n&&n.pushText(t)}(e,n)}}function l(){if("<Esc>"==n)return W(r),a.visualMode?me(r):a.insertMode&&ze(r),!0}return!1===(i=a.insertMode?function(){if(l())return!0;for(var e=a.inputState.keyBuffer=a.inputState.keyBuffer+n,o=1==n.length,i=J.matchCommand(e,t,a.inputState,"insert");e.length>1&&"full"!=i.type;){e=a.inputState.keyBuffer=e.slice(1);var s=J.matchCommand(e,t,a.inputState,"insert");"none"!=s.type&&(i=s)}if("none"==i.type)return W(r),!1;if("partial"==i.type)return B&&window.clearTimeout(B),B=window.setTimeout((function(){a.insertMode&&a.inputState.keyBuffer&&W(r)}),O("insertModeEscKeysTimeout")),!o;if(B&&window.clearTimeout(B),o){for(var c=r.listSelections(),u=0;u<c.length;u++){var h=c[u].head;r.replaceRange("",G(h,0,-(e.length-1)),h,"+input")}I.macroModeState.lastInsertModeChanges.changes.pop()}return W(r),i.command}():function(){if(s()||l())return!0;var e=a.inputState.keyBuffer=a.inputState.keyBuffer+n;if(/^[1-9]\d*$/.test(e))return!0;if(!(o=/^(\d*)(.*)$/.exec(e)))return W(r),!1;var o,i=a.visualMode?"visual":"normal",c=J.matchCommand(o[2]||o[1],t,a.inputState,i);return"none"==c.type?(W(r),!1):"partial"==c.type||(a.inputState.keyBuffer="",(o=/^(\d*)(.*)$/.exec(e))[1]&&"0"!=o[1]&&a.inputState.pushRepeatDigit(o[1]),c.command)}())?a.insertMode||1!==n.length?void 0:function(){return!0}:!0===i?function(){return!0}:function(){return r.operation((function(){r.curOp.isVimOp=!0;try{"keyToKey"==i.type?function(t){for(var o;t;)o=/<\w+-.+?>|<\w+>|./.exec(t),n=o[0],t=t.substring(o.index+n.length),e.Vim.handleKey(r,n,"mapping")}(i.toKeys):J.processCommand(r,a,i)}catch(t){throw r.state.vim=void 0,j(r),e.Vim.suppressErrorLogging||console.log(t),t}return!0}))}},handleEx:function(e,t){Qe.processCommand(e,t)},defineMotion:function(e,t){$[e]=t},defineAction:function(e,t){z[e]=t},defineOperator:function(e,t){Q[e]=t},mapCommand:function(e,t,r,n,o){var i={keys:e,type:t};for(var a in i[t]=r,i[t+"Args"]=n,o)i[a]=o[a];Xe(i)},_mapCommand:Xe,defineRegister:function(e,t){var r=I.registerController.registers;if(!e||1!=e.length)throw Error("Register name must be 1 character");if(r[e])throw Error("Register already defined "+e);r[e]=t,w.push(e)},exitVisualMode:me,exitInsertMode:ze};function F(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=null}function W(t,r){t.state.vim.inputState=new F,e.signal(t,"vim-command-done",r)}function V(e,t,r){this.clear(),this.keyBuffer=[e||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!t,this.blockwise=!!r}function D(e){this.registers=e,this.unnamedRegister=e['"']=new V,e["."]=new V,e[":"]=new V,e["/"]=new V}function U(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}F.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},F.prototype.getRepeat=function(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},V.prototype={setText:function(e,t,r){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!r},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(N(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},D.prototype={pushText:function(e,t,r,n,o){n&&"\n"!==r.charAt(r.length-1)&&(r+="\n");var i=this.isValidRegister(e)?this.getRegister(e):null;if(i){S(e)?i.pushText(r,n):i.setText(r,n,o),this.unnamedRegister.setText(i.toString(),n)}else{switch(t){case"yank":this.registers[0]=new V(r,n,o);break;case"delete":case"change":-1==r.indexOf("\n")?this.registers["-"]=new V(r,n):(this.shiftNumericRegisters_(),this.registers[1]=new V(r,n))}this.unnamedRegister.setText(r,n,o)}},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new V),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&L(e,w)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},U.prototype={nextMatch:function(e,t){var r=this.historyBuffer,n=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var o=this.iterator+n;t?o>=0:o<r.length;o+=n)for(var i=r[o],a=0;a<=i.length;a++)if(this.initialPrefix==i.substring(0,a))return this.iterator=o,i;return o>=r.length?(this.iterator=r.length,this.initialPrefix):o<0?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var J={matchCommand:function(e,t,r,n){var o,i=function(e,t,r,n){for(var o,i=[],a=[],s=0;s<t.length;s++){var l=t[s];"insert"==r&&"insert"!=l.context||l.context&&l.context!=r||n.operator&&"action"==l.type||!(o=Y(e,l.keys))||("partial"==o&&i.push(l),"full"==o&&a.push(l))}return{partial:i.length&&i,full:a.length&&a}}(e,t,n,r);if(!i.full&&!i.partial)return{type:"none"};if(!i.full&&i.partial)return{type:"partial"};for(var a=0;a<i.full.length;a++){var s=i.full[a];o||(o=s)}if("<character>"==o.keys.slice(-11)){var l=function(e){var t=/^.*(<[^>]+>)$/.exec(e),r=t?t[1]:e.slice(-1);if(r.length>1)switch(r){case"<CR>":r="\n";break;case"<Space>":r=" ";break;default:r=""}return r}(e);if(!l)return{type:"none"};r.selectedCharacter=l}return{type:"full",command:o}},processCommand:function(e,t,r){switch(t.inputState.repeatOverride=r.repeatOverride,r.type){case"motion":this.processMotion(e,t,r);break;case"operator":this.processOperator(e,t,r);break;case"operatorMotion":this.processOperatorMotion(e,t,r);break;case"action":this.processAction(e,t,r);break;case"search":this.processSearch(e,t,r);break;case"ex":case"keyToEx":this.processEx(e,t,r)}},processMotion:function(e,t,r){t.inputState.motion=r.motion,t.inputState.motionArgs=Z(r.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,r){var n=t.inputState;if(n.operator){if(n.operator==r.operator)return n.motion="expandToLine",n.motionArgs={linewise:!0},void this.evalInput(e,t);W(e)}n.operator=r.operator,n.operatorArgs=Z(r.operatorArgs),r.exitVisualBlock&&(t.visualBlock=!1,fe(e)),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,r){var n=t.visualMode,o=Z(r.operatorMotionArgs);o&&n&&o.visualLine&&(t.visualLine=!0),this.processOperator(e,t,r),n||this.processMotion(e,t,r)},processAction:function(e,t,r){var n=t.inputState,o=n.getRepeat(),i=!!o,a=Z(r.actionArgs)||{};n.selectedCharacter&&(a.selectedCharacter=n.selectedCharacter),r.operator&&this.processOperator(e,t,r),r.motion&&this.processMotion(e,t,r),(r.motion||r.operator)&&this.evalInput(e,t),a.repeat=o||1,a.repeatIsExplicit=i,a.registerName=n.registerName,W(e),t.lastMotion=null,r.isEdit&&this.recordLastEdit(t,n,r),z[r.action](e,a,t)},processSearch:function(t,r,n){if(t.getSearchCursor){var o=n.searchArgs.forward,i=n.searchArgs.wholeWordOnly;Te(t).setReversed(!o);var a=o?"/":"?",s=Te(t).getQuery(),l=t.getScrollInfo();switch(n.searchArgs.querySrc){case"prompt":var c=I.macroModeState;if(c.isPlaying)f(p=c.replaySearchQueries.shift(),!0,!1);else je(t,{onClose:function(e){t.scrollTo(l.left,l.top),f(e,!0,!0);var r=I.macroModeState;r.isRecording&&function(e,t){if(e.isPlaying)return;var r=e.latestRegister,n=I.registerController.getRegister(r);n&&n.pushSearchQuery&&n.pushSearchQuery(t)}(r,e)},prefix:a,desc:Pe,onKeyUp:function(r,n,i){var a,s,c,u=e.keyName(r);"Up"==u||"Down"==u?(a="Up"==u,s=r.target?r.target.selectionEnd:0,i(n=I.searchHistoryController.nextMatch(n,a)||""),s&&r.target&&(r.target.selectionEnd=r.target.selectionStart=Math.min(s,r.target.value.length))):"Left"!=u&&"Right"!=u&&"Ctrl"!=u&&"Alt"!=u&&"Shift"!=u&&I.searchHistoryController.reset();try{c=_e(t,n,!0,!0)}catch(r){}c?t.scrollIntoView(We(t,!o,c),30):(Ve(t),t.scrollTo(l.left,l.top))},onKeyDown:function(r,n,o){var i=e.keyName(r);"Esc"==i||"Ctrl-C"==i||"Ctrl-["==i||"Backspace"==i&&""==n?(I.searchHistoryController.pushInput(n),I.searchHistoryController.reset(),_e(t,s),Ve(t),t.scrollTo(l.left,l.top),e.e_stop(r),W(t),o(),t.focus()):"Up"==i||"Down"==i?e.e_stop(r):"Ctrl-U"==i&&(e.e_stop(r),o(""))}});break;case"wordUnderCursor":var u=ve(t,!1,!0,!1,!0),h=!0;if(u||(u=ve(t,!1,!0,!1,!1),h=!1),!u)return;var p=t.getLine(u.start.line).substring(u.start.ch,u.end.ch);p=h&&i?"\\b"+p+"\\b":p.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1"),I.jumpList.cachedCursor=t.getCursor(),t.setCursor(u.start),f(p,!0,!1)}}function f(e,o,i){I.searchHistoryController.pushInput(e),I.searchHistoryController.reset();try{_e(t,e,o,i)}catch(r){return Ne(t,"Invalid regex: "+e),void W(t)}J.processMotion(t,r,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:n.searchArgs.toJumplist}})}},processEx:function(t,r,n){function o(e){I.exCommandHistoryController.pushInput(e),I.exCommandHistoryController.reset(),Qe.processCommand(t,e)}function i(r,n,o){var i,a,s=e.keyName(r);("Esc"==s||"Ctrl-C"==s||"Ctrl-["==s||"Backspace"==s&&""==n)&&(I.exCommandHistoryController.pushInput(n),I.exCommandHistoryController.reset(),e.e_stop(r),W(t),o(),t.focus()),"Up"==s||"Down"==s?(e.e_stop(r),i="Up"==s,a=r.target?r.target.selectionEnd:0,o(n=I.exCommandHistoryController.nextMatch(n,i)||""),a&&r.target&&(r.target.selectionEnd=r.target.selectionStart=Math.min(a,r.target.value.length))):"Ctrl-U"==s?(e.e_stop(r),o("")):"Left"!=s&&"Right"!=s&&"Ctrl"!=s&&"Alt"!=s&&"Shift"!=s&&I.exCommandHistoryController.reset()}"keyToEx"==n.type?Qe.processCommand(t,n.exArgs.input):r.visualMode?je(t,{onClose:o,prefix:":",value:"'<,'>",onKeyDown:i,selectValueOnOpen:!1}):je(t,{onClose:o,prefix:":",onKeyDown:i})},evalInput:function(e,t){var r,n,i,a=t.inputState,s=a.motion,l=a.motionArgs||{},c=a.operator,u=a.operatorArgs||{},h=a.registerName,p=t.sel,f=te(t.visualMode?X(e,p.head):e.getCursor("head")),d=te(t.visualMode?X(e,p.anchor):e.getCursor("anchor")),m=te(f),g=te(d);if(c&&this.recordLastEdit(t,a),(i=void 0!==a.repeatOverride?a.repeatOverride:a.getRepeat())>0&&l.explicitRepeat?l.repeatIsExplicit=!0:(l.noRepeat||!l.explicitRepeat&&0===i)&&(i=1,l.repeatIsExplicit=!1),a.selectedCharacter&&(l.selectedCharacter=u.selectedCharacter=a.selectedCharacter),l.repeat=i,W(e),s){var v=$[s](e,f,l,t);if(t.lastMotion=$[s],!v)return;if(l.toJumplist){var y=I.jumpList,k=y.cachedCursor;k?(ye(e,k,v),delete y.cachedCursor):ye(e,f,v)}v instanceof Array?(n=v[0],r=v[1]):r=v,r||(r=te(f)),t.visualMode?(t.visualBlock&&r.ch===1/0||(r=X(e,r,t.visualBlock)),n&&(n=X(e,n,!0)),n=n||g,p.anchor=n,p.head=r,fe(e),Se(e,t,"<",ne(n,r)?n:r),Se(e,t,">",ne(n,r)?r:n)):c||(r=X(e,r),e.setCursor(r.line,r.ch))}if(c){if(u.lastSel){n=g;var C=u.lastSel,w=Math.abs(C.head.line-C.anchor.line),x=Math.abs(C.head.ch-C.anchor.ch);r=C.visualLine?o(g.line+w,g.ch):C.visualBlock?o(g.line+w,g.ch+x):C.head.line==C.anchor.line?o(g.line,g.ch+x):o(g.line+w,g.ch),t.visualMode=!0,t.visualLine=C.visualLine,t.visualBlock=C.visualBlock,p=t.sel={anchor:n,head:r},fe(e)}else t.visualMode&&(u.lastSel={anchor:te(p.anchor),head:te(p.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var M,S,b,L,T;if(t.visualMode){if(M=oe(p.head,p.anchor),S=ie(p.head,p.anchor),b=t.visualLine||u.linewise,T=de(e,{anchor:M,head:S},L=t.visualBlock?"block":b?"line":"char"),b){var R=T.ranges;if("block"==L)for(var E=0;E<R.length;E++)R[E].head.ch=se(e,R[E].head.line);else"line"==L&&(R[0].head=o(R[0].head.line+1,0))}}else{if(M=te(n||g),ne(S=te(r||m),M)){var O=M;M=S,S=O}(b=l.linewise||u.linewise)?function(e,t,r){t.ch=0,r.ch=0,r.line++}(0,M,S):l.forward&&function(e,t,r){var n=e.getRange(t,r);if(/\n\s*$/.test(n)){var o=n.split("\n");o.pop();for(var i=o.pop();o.length>0&&i&&A(i);i=o.pop())r.line--,r.ch=0;i?(r.line--,r.ch=se(e,r.line)):r.ch=0}}(e,M,S),T=de(e,{anchor:M,head:S},L="char",!l.inclusive||b)}e.setSelections(T.ranges,T.primary),t.lastMotion=null,u.repeat=i,u.registerName=h,u.linewise=b;var B=Q[c](e,u,T.ranges,g,r);t.visualMode&&me(e,null!=B),B&&e.setCursor(B)}},recordLastEdit:function(e,t,r){var n=I.macroModeState;n.isPlaying||(e.lastEditInputState=t,e.lastEditActionCommand=r,n.lastInsertModeChanges.changes=[],n.lastInsertModeChanges.expectCursorActivityForChange=!1,n.lastInsertModeChanges.visualBlock=e.visualBlock?e.sel.head.line-e.sel.anchor.line:0)}},$={moveToTopLine:function(e,t,r){var n=De(e).top+r.repeat-1;return o(n,ge(e.getLine(n)))},moveToMiddleLine:function(e){var t=De(e),r=Math.floor(.5*(t.top+t.bottom));return o(r,ge(e.getLine(r)))},moveToBottomLine:function(e,t,r){var n=De(e).bottom-r.repeat+1;return o(n,ge(e.getLine(n)))},expandToLine:function(e,t,r){return o(t.line+r.repeat-1,1/0)},findNext:function(e,t,r){var n=Te(e),o=n.getQuery();if(o){var i=!r.forward;return i=n.isReversed()?!i:i,Fe(e,o),We(e,i,o,r.repeat)}},goToMark:function(e,t,r,n){var o=Ue(e,n,r.selectedCharacter);return o?r.linewise?{line:o.line,ch:ge(e.getLine(o.line))}:o:null},moveToOtherHighlightedEnd:function(e,t,r,n){if(n.visualBlock&&r.sameLine){var i=n.sel;return[X(e,o(i.anchor.line,i.head.ch)),X(e,o(i.head.line,i.anchor.ch))]}return[n.sel.head,n.sel.anchor]},jumpToMark:function(e,t,r,n){for(var i=t,a=0;a<r.repeat;a++){var s=i;for(var l in n.marks)if(M(l)){var c=n.marks[l].find();if(!((r.forward?ne(c,s):ne(s,c))||r.linewise&&c.line==s.line)){var u=re(s,i),h=r.forward?ae(s,c,i):ae(i,c,s);(u||h)&&(i=c)}}}return r.linewise&&(i=o(i.line,ge(e.getLine(i.line)))),i},moveByCharacters:function(e,t,r){var n=t,i=r.repeat,a=r.forward?n.ch+i:n.ch-i;return o(n.line,a)},moveByLines:function(e,t,r,n){var i=t,a=i.ch;switch(n.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:a=n.lastHPos;break;default:n.lastHPos=a}var s=r.repeat+(r.repeatOffset||0),l=r.forward?i.line+s:i.line-s,c=e.firstLine(),u=e.lastLine(),h=e.findPosV(i,r.forward?s:-s,"line",n.lastHSPos);return(r.forward?h.line>l:h.line<l)&&(l=h.line,a=h.ch),l<c&&i.line==c?this.moveToStartOfLine(e,t,r,n):l>u&&i.line==u?this.moveToEol(e,t,r,n,!0):(r.toFirstChar&&(a=ge(e.getLine(l)),n.lastHPos=a),n.lastHSPos=e.charCoords(o(l,a),"div").left,o(l,a))},moveByDisplayLines:function(e,t,r,n){var i=t;switch(n.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:n.lastHSPos=e.charCoords(i,"div").left}var a=r.repeat;if((l=e.findPosV(i,r.forward?a:-a,"line",n.lastHSPos)).hitSide)if(r.forward)var s={top:e.charCoords(l,"div").top+8,left:n.lastHSPos},l=e.coordsChar(s,"div");else{var c=e.charCoords(o(e.firstLine(),0),"div");c.left=n.lastHSPos,l=e.coordsChar(c,"div")}return n.lastHPos=l.ch,l},moveByPage:function(e,t,r){var n=t,o=r.repeat;return e.findPosV(n,r.forward?o:-o,"page")},moveByParagraph:function(e,t,r){var n=r.forward?1:-1;return be(e,t,r.repeat,n)},moveBySentence:function(e,t,r){var n=r.forward?1:-1;return function(e,t,r,n){function i(e,t){if(t.pos+t.dir<0||t.pos+t.dir>=t.line.length){if(t.ln+=t.dir,!x(e,t.ln))return t.line=null,t.ln=null,void(t.pos=null);t.line=e.getLine(t.ln),t.pos=t.dir>0?0:t.line.length-1}else t.pos+=t.dir}function a(e,t,r,n){var o=""===(c=e.getLine(t)),a={line:c,ln:t,pos:r,dir:n},s={ln:a.ln,pos:a.pos},l=""===a.line;for(i(e,a);null!==a.line;){if(s.ln=a.ln,s.pos=a.pos,""===a.line&&!l)return{ln:a.ln,pos:a.pos};if(o&&""!==a.line&&!A(a.line[a.pos]))return{ln:a.ln,pos:a.pos};!b(a.line[a.pos])||o||a.pos!==a.line.length-1&&!A(a.line[a.pos+1])||(o=!0),i(e,a)}var c=e.getLine(s.ln);s.pos=0;for(var u=c.length-1;u>=0;--u)if(!A(c[u])){s.pos=u;break}return s}function s(e,t,r,n){var o={line:l=e.getLine(t),ln:t,pos:r,dir:n},a={ln:o.ln,pos:null},s=""===o.line;for(i(e,o);null!==o.line;){if(""===o.line&&!s)return null!==a.pos?a:{ln:o.ln,pos:o.pos};if(b(o.line[o.pos])&&null!==a.pos&&(o.ln!==a.ln||o.pos+1!==a.pos))return a;""===o.line||A(o.line[o.pos])||(s=!1,a={ln:o.ln,pos:o.pos}),i(e,o)}var l=e.getLine(a.ln);a.pos=0;for(var c=0;c<l.length;++c)if(!A(l[c])){a.pos=c;break}return a}var l={ln:t.line,pos:t.ch};for(;r>0;)l=n<0?s(e,l.ln,l.pos,n):a(e,l.ln,l.pos,n),r--;return o(l.ln,l.pos)}(e,t,r.repeat,n)},moveByScroll:function(e,t,r,n){var o=e.getScrollInfo(),i=null,a=r.repeat;a||(a=o.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,"local");if(r.repeat=a,!(i=$.moveByDisplayLines(e,t,r,n)))return null;var l=e.charCoords(i,"local");return e.scrollTo(null,o.top+l.top-s.top),i},moveByWords:function(e,t,r){return function(e,t,r,n,i,a){var s=te(t),l=[];(n&&!i||!n&&i)&&r++;for(var c=!(n&&i),u=0;u<r;u++){var h=xe(e,t,n,a,c);if(!h){var p=se(e,e.lastLine());l.push(n?{line:e.lastLine(),from:p,to:p}:{line:0,from:0,to:0});break}l.push(h),t=o(h.line,n?h.to-1:h.from)}var f=l.length!=r,d=l[0],m=l.pop();return n&&!i?(f||d.from==s.ch&&d.line==s.line||(m=l.pop()),o(m.line,m.from)):n&&i?o(m.line,m.to-1):!n&&i?(f||d.to==s.ch&&d.line==s.line||(m=l.pop()),o(m.line,m.to)):o(m.line,m.from)}(e,t,r.repeat,!!r.forward,!!r.wordEnd,!!r.bigWord)},moveTillCharacter:function(e,t,r){var n=Me(e,r.repeat,r.forward,r.selectedCharacter),o=r.forward?-1:1;return ke(o,r),n?(n.ch+=o,n):null},moveToCharacter:function(e,t,r){var n=r.repeat;return ke(0,r),Me(e,n,r.forward,r.selectedCharacter)||t},moveToSymbol:function(e,t,r){return function(e,t,r,n){var i=te(e.getCursor()),a=r?1:-1,s=r?e.lineCount():-1,l=i.ch,c=i.line,u=e.getLine(c),h={lineText:u,nextCh:u.charAt(l),lastCh:null,index:l,symb:n,reverseSymb:(r?{")":"(","}":"{"}:{"(":")","{":"}"})[n],forward:r,depth:0,curMoveThrough:!1},p=Ce[n];if(!p)return i;var f=we[p].init,d=we[p].isComplete;f&&f(h);for(;c!==s&&t;){if(h.index+=a,h.nextCh=h.lineText.charAt(h.index),!h.nextCh){if(c+=a,h.lineText=e.getLine(c)||"",a>0)h.index=0;else{var m=h.lineText.length;h.index=m>0?m-1:0}h.nextCh=h.lineText.charAt(h.index)}d(h)&&(i.line=c,i.ch=h.index,t--)}if(h.nextCh||h.curMoveThrough)return o(c,h.index);return i}(e,r.repeat,r.forward,r.selectedCharacter)||t},moveToColumn:function(e,t,r,n){var i=r.repeat;return n.lastHPos=i-1,n.lastHSPos=e.charCoords(t,"div").left,function(e,t){var r=e.getCursor().line;return X(e,o(r,t-1))}(e,i)},moveToEol:function(e,t,r,n,i){var a=o(t.line+r.repeat-1,1/0),s=e.clipPos(a);return s.ch--,i||(n.lastHPos=1/0,n.lastHSPos=e.charCoords(s,"div").left),a},moveToFirstNonWhiteSpaceCharacter:function(e,t){var r=t;return o(r.line,ge(e.getLine(r.line)))},moveToMatchedSymbol:function(e,t){for(var r,n=t,i=n.line,a=n.ch,s=e.getLine(i);a<s.length;a++)if((r=s.charAt(a))&&-1!="()[]{}".indexOf(r)){var l=e.getTokenTypeAt(o(i,a+1));if("string"!==l&&"comment"!==l)break}if(a<s.length){var c="<"===a||">"===a?/[(){}[\]<>]/:/[(){}[\]]/;return e.findMatchingBracket(o(i,a),{bracketRegex:c}).to}return n},moveToStartOfLine:function(e,t){return o(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,r){var n=r.forward?e.lastLine():e.firstLine();return r.repeatIsExplicit&&(n=r.repeat-e.getOption("firstLineNumber")),o(n,ge(e.getLine(n)))},textObjectManipulation:function(e,t,r,n){var i=r.selectedCharacter;"b"==i?i="(":"B"==i&&(i="{");var a,s=!r.textObjectInner;if({"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"}[i])a=function(e,t,r,n){var i,a,s=t,l={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[r],c={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[r],u=e.getLine(s.line).charAt(s.ch)===c?1:0;if(i=e.scanForBracket(o(s.line,s.ch+u),-1,void 0,{bracketRegex:l}),a=e.scanForBracket(o(s.line,s.ch+u),1,void 0,{bracketRegex:l}),!i||!a)return{start:s,end:s};if(i=i.pos,a=a.pos,i.line==a.line&&i.ch>a.ch||i.line>a.line){var h=i;i=a,a=h}n?a.ch+=1:i.ch+=1;return{start:i,end:a}}(e,t,i,s);else if({"'":!0,'"':!0,"`":!0}[i])a=function(e,t,r,n){var i,a,s,l,c=te(t),u=e.getLine(c.line).split(""),h=u.indexOf(r);c.ch<h?c.ch=h:h<c.ch&&u[c.ch]==r&&(a=c.ch,--c.ch);if(u[c.ch]!=r||a)for(s=c.ch;s>-1&&!i;s--)u[s]==r&&(i=s+1);else i=c.ch+1;if(i&&!a)for(s=i,l=u.length;s<l&&!a;s++)u[s]==r&&(a=s);if(!i||!a)return{start:c,end:c};n&&(--i,++a);return{start:o(c.line,i),end:o(c.line,a)}}(e,t,i,s);else if("W"===i)a=ve(e,s,!0,!0);else if("w"===i)a=ve(e,s,!0,!1);else{if("p"!==i)return null;if(a=be(e,t,r.repeat,0,s),r.linewise=!0,n.visualMode)n.visualLine||(n.visualLine=!0);else{var l=n.inputState.operatorArgs;l&&(l.linewise=!0),a.end.line--}}return e.state.vim.visualMode?function(e,t,r){var n,i=e.state.vim.sel,a=i.head,s=i.anchor;ne(r,t)&&(n=r,r=t,t=n);ne(a,s)?(a=oe(t,a),s=ie(s,r)):(s=oe(t,s),-1==(a=G(a=ie(a,r),0,-1)).ch&&a.line!=e.firstLine()&&(a=o(a.line-1,se(e,a.line-1))));return[s,a]}(e,a.start,a.end):[a.start,a.end]},repeatLastCharacterSearch:function(e,t,r){var n=I.lastCharacterSearch,o=r.repeat,i=r.forward===n.forward,a=(n.increment?1:0)*(i?-1:1);e.moveH(-a,"char"),r.inclusive=!!i;var s=Me(e,o,i,n.selectedCharacter);return s?(s.ch+=a,s):(e.moveH(a,"char"),t)}};function q(e,t){for(var r=[],n=0;n<t;n++)r.push(e);return r}var Q={change:function(t,r,n){var i,a,s=t.state.vim,l=n[0].anchor,c=n[0].head;if(s.visualMode)if(r.fullLine)c.ch=Number.MAX_VALUE,c.line--,t.setSelection(l,c),a=t.getSelection(),t.replaceSelection(""),i=l;else{a=t.getSelection();var u=q("",n.length);t.replaceSelections(u),i=oe(n[0].head,n[0].anchor)}else{a=t.getRange(l,c);var h=s.lastEditInputState||{};if("moveByWords"==h.motion&&!A(a)){var p=/\s+$/.exec(a);p&&h.motionArgs&&h.motionArgs.forward&&(c=G(c,0,-p[0].length),a=a.slice(0,-p[0].length))}var f=new o(l.line-1,Number.MAX_VALUE),d=t.firstLine()==t.lastLine();c.line>t.lastLine()&&r.linewise&&!d?t.replaceRange("",f,c):t.replaceRange("",l,c),r.linewise&&(d||(t.setCursor(f),e.commands.newlineAndIndent(t)),l.ch=Number.MAX_VALUE),i=l}I.registerController.pushText(r.registerName,"change",a,r.linewise,n.length>1),z.enterInsertMode(t,{head:i},t.state.vim)},delete:function(e,t,r){var n,i,a=e.state.vim;if(a.visualBlock){i=e.getSelection();var s=q("",r.length);e.replaceSelections(s),n=r[0].anchor}else{var l=r[0].anchor,c=r[0].head;t.linewise&&c.line!=e.firstLine()&&l.line==e.lastLine()&&l.line==c.line-1&&(l.line==e.firstLine()?l.ch=0:l=o(l.line-1,se(e,l.line-1))),i=e.getRange(l,c),e.replaceRange("",l,c),n=l,t.linewise&&(n=$.moveToFirstNonWhiteSpaceCharacter(e,l))}return I.registerController.pushText(t.registerName,"delete",i,t.linewise,a.visualBlock),X(e,n,a.insertMode)},indent:function(e,t,r){var n=e.state.vim,o=r[0].anchor.line,i=n.visualBlock?r[r.length-1].anchor.line:r[0].head.line,a=n.visualMode?t.repeat:1;t.linewise&&i--;for(var s=o;s<=i;s++)for(var l=0;l<a;l++)e.indentLine(s,t.indentRight);return $.moveToFirstNonWhiteSpaceCharacter(e,r[0].anchor)},indentAuto:function(e,t,r){return e.execCommand("indentAuto"),$.moveToFirstNonWhiteSpaceCharacter(e,r[0].anchor)},changeCase:function(e,t,r,n,o){for(var i=e.getSelections(),a=[],s=t.toLower,l=0;l<i.length;l++){var c=i[l],u="";if(!0===s)u=c.toLowerCase();else if(!1===s)u=c.toUpperCase();else for(var h=0;h<c.length;h++){var p=c.charAt(h);u+=S(p)?p.toLowerCase():p.toUpperCase()}a.push(u)}return e.replaceSelections(a),t.shouldMoveCursor?o:!e.state.vim.visualMode&&t.linewise&&r[0].anchor.line+1==r[0].head.line?$.moveToFirstNonWhiteSpaceCharacter(e,n):t.linewise?n:oe(r[0].anchor,r[0].head)},yank:function(e,t,r,n){var o=e.state.vim,i=e.getSelection(),a=o.visualMode?oe(o.sel.anchor,o.sel.head,r[0].head,r[0].anchor):n;return I.registerController.pushText(t.registerName,"yank",i,t.linewise,o.visualBlock),a}};var z={jumpListWalk:function(e,t,r){if(!r.visualMode){var n=t.repeat,o=t.forward,i=I.jumpList.move(e,o?n:-n),a=i?i.find():void 0;a=a||e.getCursor(),e.setCursor(a)}},scroll:function(e,t,r){if(!r.visualMode){var n=t.repeat||1,o=e.defaultTextHeight(),i=e.getScrollInfo().top,a=o*n,s=t.forward?i+a:i-a,l=te(e.getCursor()),c=e.charCoords(l,"local");if(t.forward)s>c.top?(l.line+=(s-c.top)/o,l.line=Math.ceil(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.top)):e.scrollTo(null,s);else{var u=s+e.getScrollInfo().clientHeight;u<c.bottom?(l.line-=(c.bottom-u)/o,l.line=Math.floor(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.bottom-e.getScrollInfo().clientHeight)):e.scrollTo(null,s)}}},scrollToCursor:function(e,t){var r=e.getCursor().line,n=e.charCoords(o(r,0),"local"),i=e.getScrollInfo().clientHeight,a=n.top,s=n.bottom-a;switch(t.position){case"center":a=a-i/2+s;break;case"bottom":a=a-i+s}e.scrollTo(null,a)},replayMacro:function(e,t,r){var n=t.selectedCharacter,o=t.repeat,i=I.macroModeState;for("@"==n?n=i.latestRegister:i.latestRegister=n;o--;)Ze(e,r,i,n)},enterMacroRecordMode:function(e,t){var r=I.macroModeState,n=t.selectedCharacter;I.registerController.isValidRegister(n)&&r.enterMacroRecordMode(e,n)},toggleOverwrite:function(t){t.state.overwrite?(t.toggleOverwrite(!1),t.setOption("keyMap","vim-insert"),e.signal(t,"vim-mode-change",{mode:"insert"})):(t.toggleOverwrite(!0),t.setOption("keyMap","vim-replace"),e.signal(t,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(t,r,n){if(!t.getOption("readOnly")){n.insertMode=!0,n.insertModeRepeat=r&&r.repeat||1;var i=r?r.insertAt:null,a=n.sel,s=r.head||t.getCursor("head"),l=t.listSelections().length;if("eol"==i)s=o(s.line,se(t,s.line));else if("bol"==i)s=o(s.line,0);else if("charAfter"==i)s=G(s,0,1);else if("firstNonBlank"==i)s=$.moveToFirstNonWhiteSpaceCharacter(t,s);else if("startOfSelectedArea"==i){if(!n.visualMode)return;n.visualBlock?(s=o(Math.min(a.head.line,a.anchor.line),Math.min(a.head.ch,a.anchor.ch)),l=Math.abs(a.head.line-a.anchor.line)+1):s=a.head.line<a.anchor.line?a.head:o(a.anchor.line,0)}else if("endOfSelectedArea"==i){if(!n.visualMode)return;n.visualBlock?(s=o(Math.min(a.head.line,a.anchor.line),Math.max(a.head.ch+1,a.anchor.ch)),l=Math.abs(a.head.line-a.anchor.line)+1):s=a.head.line>=a.anchor.line?G(a.head,0,1):o(a.anchor.line,0)}else if("inplace"==i){if(n.visualMode)return}else"lastEdit"==i&&(s=Je(t)||s);t.setOption("disableInput",!1),r&&r.replace?(t.toggleOverwrite(!0),t.setOption("keyMap","vim-replace"),e.signal(t,"vim-mode-change",{mode:"replace"})):(t.toggleOverwrite(!1),t.setOption("keyMap","vim-insert"),e.signal(t,"vim-mode-change",{mode:"insert"})),I.macroModeState.isPlaying||(t.on("change",Ge),e.on(t.getInputField(),"keydown",rt)),n.visualMode&&me(t),he(t,s,l)}},toggleVisualMode:function(t,r,n){var i,a=r.repeat,s=t.getCursor();n.visualMode?n.visualLine^r.linewise||n.visualBlock^r.blockwise?(n.visualLine=!!r.linewise,n.visualBlock=!!r.blockwise,e.signal(t,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""}),fe(t)):me(t):(n.visualMode=!0,n.visualLine=!!r.linewise,n.visualBlock=!!r.blockwise,i=X(t,o(s.line,s.ch+a-1),!0),n.sel={anchor:s,head:i},e.signal(t,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""}),fe(t),Se(t,n,"<",oe(s,i)),Se(t,n,">",ie(s,i)))},reselectLastSelection:function(t,r,n){var o=n.lastSelection;if(n.visualMode&&pe(t,n),o){var i=o.anchorMark.find(),a=o.headMark.find();if(!i||!a)return;n.sel={anchor:i,head:a},n.visualMode=!0,n.visualLine=o.visualLine,n.visualBlock=o.visualBlock,fe(t),Se(t,n,"<",oe(i,a)),Se(t,n,">",ie(i,a)),e.signal(t,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""})}},joinLines:function(e,t,r){var n,i;if(r.visualMode){if(n=e.getCursor("anchor"),ne(i=e.getCursor("head"),n)){var a=i;i=n,n=a}i.ch=se(e,i.line)-1}else{var s=Math.max(t.repeat,2);n=e.getCursor(),i=X(e,o(n.line+s-1,1/0))}for(var l=0,c=n.line;c<i.line;c++){l=se(e,n.line);a=o(n.line+1,se(e,n.line+1));var u=e.getRange(n,a);u=t.keepSpaces?u.replace(/\n\r?/g,""):u.replace(/\n\s*/g," "),e.replaceRange(u,n,a)}var h=o(n.line,l);r.visualMode&&me(e,!1),e.setCursor(h)},newLineAndEnterInsertMode:function(t,r,n){n.insertMode=!0;var i=te(t.getCursor());i.line!==t.firstLine()||r.after?(i.line=r.after?i.line:i.line-1,i.ch=se(t,i.line),t.setCursor(i),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(t)):(t.replaceRange("\n",o(t.firstLine(),0)),t.setCursor(t.firstLine(),0));this.enterInsertMode(t,{repeat:r.repeat},n)},paste:function(e,t,r){var n=te(e.getCursor()),i=I.registerController.getRegister(t.registerName);if(f=i.toString()){if(t.matchIndent){var a=e.getOption("tabSize"),s=function(e){var t=e.split("\t").length-1,r=e.split(" ").length-1;return t*a+1*r},l=e.getLine(e.getCursor().line),c=s(l.match(/^\s*/)[0]),u=f.replace(/\n$/,""),h=f!==u,p=s(f.match(/^\s*/)[0]),f=u.replace(/^\s*/gm,(function(t){var r=c+(s(t)-p);if(r<0)return"";if(e.getOption("indentWithTabs")){var n=Math.floor(r/a);return Array(n+1).join("\t")}return Array(r+1).join(" ")}));f+=h?"\n":""}if(t.repeat>1)f=Array(t.repeat+1).join(f);var d,m,g=i.linewise,v=i.blockwise;if(v){f=f.split("\n"),g&&f.pop();for(var y=0;y<f.length;y++)f[y]=""==f[y]?" ":f[y];n.ch+=t.after?1:0,n.ch=Math.min(se(e,n.line),n.ch)}else g?r.visualMode?f=r.visualLine?f.slice(0,-1):"\n"+f.slice(0,f.length-1)+"\n":t.after?(f="\n"+f.slice(0,f.length-1),n.ch=se(e,n.line)):n.ch=0:n.ch+=t.after?1:0;if(r.visualMode){var k;r.lastPastedText=f;var C=function(e,t){var r=t.lastSelection;return t.visualMode?function(){var t=e.listSelections(),r=t[0],n=t[t.length-1];return[ne(r.anchor,r.head)?r.anchor:r.head,ne(n.anchor,n.head)?n.head:n.anchor]}():function(){var t=e.getCursor(),n=e.getCursor(),i=r.visualBlock;if(i){var a=i.width,s=i.height;n=o(t.line+s,t.ch+a);for(var l=[],c=t.line;c<n.line;c++){var u={anchor:o(c,t.ch),head:o(c,n.ch)};l.push(u)}e.setSelections(l)}else{var h=r.anchorMark.find(),p=r.headMark.find(),f=p.line-h.line,d=p.ch-h.ch;n={line:n.line+f,ch:f?n.ch:d+n.ch},r.visualLine&&(t=o(t.line,0),n=o(n.line,se(e,n.line))),e.setSelection(t,n)}return[t,n]}()}(e,r),w=C[0],x=C[1],M=e.getSelection(),S=e.listSelections(),A=new Array(S.length).join("1").split("1");r.lastSelection&&(k=r.lastSelection.headMark.find()),I.registerController.unnamedRegister.setText(M),v?(e.replaceSelections(A),x=o(w.line+f.length-1,w.ch),e.setCursor(w),ue(e,x),e.replaceSelections(f),d=w):r.visualBlock?(e.replaceSelections(A),e.setCursor(w),e.replaceRange(f,w,w),d=w):(e.replaceRange(f,w,x),d=e.posFromIndex(e.indexFromPos(w)+f.length-1)),k&&(r.lastSelection.headMark=e.setBookmark(k)),g&&(d.ch=0)}else if(v){e.setCursor(n);for(y=0;y<f.length;y++){var b=n.line+y;b>e.lastLine()&&e.replaceRange("\n",o(b,0)),se(e,b)<n.ch&&ce(e,b,n.ch)}e.setCursor(n),ue(e,o(n.line+f.length-1,n.ch)),e.replaceSelections(f),d=n}else e.replaceRange(f,n),g&&t.after?d=o(n.line+1,ge(e.getLine(n.line+1))):g&&!t.after?d=o(n.line,ge(e.getLine(n.line))):!g&&t.after?(m=e.indexFromPos(n),d=e.posFromIndex(m+f.length-1)):(m=e.indexFromPos(n),d=e.posFromIndex(m+f.length));r.visualMode&&me(e,!1),e.setCursor(d)}},undo:function(t,r){t.operation((function(){ee(t,e.commands.undo,r.repeat)(),t.setCursor(t.getCursor("anchor"))}))},redo:function(t,r){ee(t,e.commands.redo,r.repeat)()},setRegister:function(e,t,r){r.inputState.registerName=t.selectedCharacter},setMark:function(e,t,r){Se(e,r,t.selectedCharacter,e.getCursor())},replace:function(t,r,n){var i,a,s=r.selectedCharacter,l=t.getCursor(),c=t.listSelections();if(n.visualMode)l=t.getCursor("start"),a=t.getCursor("end");else{var u=t.getLine(l.line);(i=l.ch+r.repeat)>u.length&&(i=u.length),a=o(l.line,i)}if("\n"==s)n.visualMode||t.replaceRange("",l,a),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(t);else{var h=t.getRange(l,a);if(h=h.replace(/[^\n]/g,s),n.visualBlock){var p=new Array(t.getOption("tabSize")+1).join(" ");h=(h=t.getSelection()).replace(/\t/g,p).replace(/[^\n]/g,s).split("\n"),t.replaceSelections(h)}else t.replaceRange(h,l,a);n.visualMode?(l=ne(c[0].anchor,c[0].head)?c[0].anchor:c[0].head,t.setCursor(l),me(t,!1)):t.setCursor(G(a,0,-1))}},incrementNumberToken:function(e,t){for(var r,n,i,a,s=e.getCursor(),l=e.getLine(s.line),c=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;null!==(r=c.exec(l))&&(i=(n=r.index)+r[0].length,!(s.ch<i)););if((t.backtrack||!(i<=s.ch))&&r){var u=r[2]||r[4],h=r[3]||r[5],p=t.increase?1:-1,f={"0b":2,0:8,"":10,"0x":16}[u.toLowerCase()];a=(parseInt(r[1]+h,f)+p*t.repeat).toString(f);var d=u?new Array(h.length-a.length+1+r[1].length).join("0"):"";a="-"===a.charAt(0)?"-"+u+d+a.substr(1):u+d+a;var m=o(s.line,n),g=o(s.line,i);e.replaceRange(a,m,g),e.setCursor(o(s.line,n+a.length-1))}},repeatLastEdit:function(e,t,r){if(r.lastEditInputState){var n=t.repeat;n&&t.repeatIsExplicit?r.lastEditInputState.repeatOverride=n:n=r.lastEditInputState.repeatOverride||n,nt(e,r,n,!1)}},indent:function(e,t){e.indentLine(e.getCursor().line,t.indentRight)},exitInsertMode:ze};function X(e,t,r){var n=Math.min(Math.max(e.firstLine(),t.line),e.lastLine()),i=se(e,n)-1;i=r?i+1:i;var a=Math.min(Math.max(0,t.ch),i);return o(n,a)}function Z(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function G(e,t,r){return"object"==typeof t&&(r=t.ch,t=t.line),o(e.line+t,e.ch+r)}function Y(e,t){if("<character>"==t.slice(-11)){var r=t.length-11,n=e.slice(0,r),o=t.slice(0,r);return n==o&&e.length>r?"full":0==o.indexOf(n)&&"partial"}return e==t?"full":0==t.indexOf(e)&&"partial"}function ee(e,t,r){return function(){for(var n=0;n<r;n++)t(e)}}function te(e){return o(e.line,e.ch)}function re(e,t){return e.ch==t.ch&&e.line==t.line}function ne(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function oe(e,t){return arguments.length>2&&(t=oe.apply(void 0,Array.prototype.slice.call(arguments,1))),ne(e,t)?e:t}function ie(e,t){return arguments.length>2&&(t=ie.apply(void 0,Array.prototype.slice.call(arguments,1))),ne(e,t)?t:e}function ae(e,t,r){var n=ne(e,t),o=ne(t,r);return n&&o}function se(e,t){return e.getLine(t).length}function le(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function ce(e,t,r){var n=se(e,t),i=new Array(r-n+1).join(" ");e.setCursor(o(t,n)),e.replaceRange(i,e.getCursor())}function ue(e,t){var r=[],n=e.listSelections(),i=te(e.clipPos(t)),a=!re(t,i),s=function(e,t,r){for(var n=0;n<e.length;n++){var o="head"!=r&&re(e[n].anchor,t),i="anchor"!=r&&re(e[n].head,t);if(o||i)return n}return-1}(n,e.getCursor("head")),l=re(n[s].head,n[s].anchor),c=n.length-1,u=c-s>s?c:0,h=n[u].anchor,p=Math.min(h.line,i.line),f=Math.max(h.line,i.line),d=h.ch,m=i.ch,g=n[u].head.ch-d,v=m-d;g>0&&v<=0?(d++,a||m--):g<0&&v>=0?(d--,l||m++):g<0&&-1==v&&(d--,m++);for(var y=p;y<=f;y++){var k={anchor:new o(y,d),head:new o(y,m)};r.push(k)}return e.setSelections(r),t.ch=m,h.ch=d,h}function he(e,t,r){for(var n=[],o=0;o<r;o++){var i=G(t,o,0);n.push({anchor:i,head:i})}e.setSelections(n,0)}function pe(e,t){var r=t.sel.anchor,n=t.sel.head;t.lastPastedText&&(n=e.posFromIndex(e.indexFromPos(r)+t.lastPastedText.length),t.lastPastedText=null),t.lastSelection={anchorMark:e.setBookmark(r),headMark:e.setBookmark(n),anchor:te(r),head:te(n),visualMode:t.visualMode,visualLine:t.visualLine,visualBlock:t.visualBlock}}function fe(e,t,r){var n=e.state.vim,o=de(e,t=t||n.sel,r=r||n.visualLine?"line":n.visualBlock?"block":"char");e.setSelections(o.ranges,o.primary),et(e)}function de(e,t,r,n){var i=te(t.head),a=te(t.anchor);if("char"==r){var s=n||ne(t.head,t.anchor)?0:1,l=ne(t.head,t.anchor)?1:0;return i=G(t.head,0,s),{ranges:[{anchor:a=G(t.anchor,0,l),head:i}],primary:0}}if("line"==r){if(ne(t.head,t.anchor))i.ch=0,a.ch=se(e,a.line);else{a.ch=0;var c=e.lastLine();i.line>c&&(i.line=c),i.ch=se(e,i.line)}return{ranges:[{anchor:a,head:i}],primary:0}}if("block"==r){for(var u=Math.min(a.line,i.line),h=Math.min(a.ch,i.ch),p=Math.max(a.line,i.line),f=Math.max(a.ch,i.ch)+1,d=p-u+1,m=i.line==u?0:d-1,g=[],v=0;v<d;v++)g.push({anchor:o(u+v,h),head:o(u+v,f)});return{ranges:g,primary:m}}}function me(t,r){var n=t.state.vim;!1!==r&&t.setCursor(X(t,n.sel.head)),pe(t,n),n.visualMode=!1,n.visualLine=!1,n.visualBlock=!1,e.signal(t,"vim-mode-change",{mode:"normal"}),n.fakeCursor&&n.fakeCursor.clear()}function ge(e){if(!e)return 0;var t=e.search(/\S/);return-1==t?e.length:t}function ve(e,t,r,n,i){for(var a=function(e){var t=e.getCursor("head");return 1==e.getSelection().length&&(t=oe(t,e.getCursor("anchor"))),t}(e),s=e.getLine(a.line),l=a.ch,c=i?d[0]:m[0];!c(s.charAt(l));)if(++l>=s.length)return null;n?c=m[0]:(c=d[0])(s.charAt(l))||(c=d[1]);for(var u=l,h=l;c(s.charAt(u))&&u<s.length;)u++;for(;c(s.charAt(h))&&h>=0;)h--;if(h++,t){for(var p=u;/\s/.test(s.charAt(u))&&u<s.length;)u++;if(p==u){for(var f=h;/\s/.test(s.charAt(h-1))&&h>0;)h--;h||(h=f)}}return{start:o(a.line,h),end:o(a.line,u)}}function ye(e,t,r){re(t,r)||I.jumpList.add(e,t,r)}function ke(e,t){I.lastCharacterSearch.increment=e,I.lastCharacterSearch.forward=t.forward,I.lastCharacterSearch.selectedCharacter=t.selectedCharacter}var Ce={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},we={bracket:{isComplete:function(e){if(e.nextCh===e.symb){if(e.depth++,e.depth>=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};function xe(e,t,r,n,o){var i=t.line,a=t.ch,s=e.getLine(i),l=r?1:-1,c=n?m:d;if(o&&""==s){if(i+=l,s=e.getLine(i),!x(e,i))return null;a=r?0:s.length}for(;;){if(o&&""==s)return{from:0,to:0,line:i};for(var u=l>0?s.length:-1,h=u,p=u;a!=u;){for(var f=!1,g=0;g<c.length&&!f;++g)if(c[g](s.charAt(a))){for(h=a;a!=u&&c[g](s.charAt(a));)a+=l;if(f=h!=(p=a),h==t.ch&&i==t.line&&p==h+l)continue;return{from:Math.min(h,p+1),to:Math.max(h,p),line:i}}f||(a+=l)}if(!x(e,i+=l))return null;s=e.getLine(i),a=l>0?0:s.length}}function Me(e,t,r,n){for(var i,a=e.getCursor(),s=a.ch,l=0;l<t;l++){if(-1==(i=Ae(s,e.getLine(a.line),n,r,!0)))return null;s=i}return o(e.getCursor().line,i)}function Se(e,t,r,n){L(r,C)&&(t.marks[r]&&t.marks[r].clear(),t.marks[r]=e.setBookmark(n))}function Ae(e,t,r,n,o){var i;return n?-1==(i=t.indexOf(r,e+1))||o||(i-=1):-1==(i=t.lastIndexOf(r,e-1))||o||(i+=1),i}function be(e,t,r,n,i){var a,s=t.line,l=e.firstLine(),c=e.lastLine(),u=s;function h(t){return!e.getLine(t)}function p(e,t,r){return r?h(e)!=h(e+t):!h(e)&&h(e+t)}if(n){for(;l<=u&&u<=c&&r>0;)p(u,n)&&r--,u+=n;return new o(u,0)}var f=e.state.vim;if(f.visualLine&&p(s,1,!0)){var d=f.sel.anchor;p(d.line,-1,!0)&&(i&&d.line==s||(s+=1))}var m=h(s);for(u=s;u<=c&&r;u++)p(u,1,!0)&&(i&&h(u)==m||r--);for(a=new o(u,0),u>c&&!m?m=!0:i=!1,u=s;u>l&&(i&&h(u)!=m&&u!=s||!p(u,-1,!0));u--);return{start:new o(u,0),end:a}}function Le(){}function Te(e){var t=e.state.vim;return t.searchState_||(t.searchState_=new Le)}function Re(e,t,r,n,o){e.openDialog?e.openDialog(t,n,{bottom:!0,value:o.value,onKeyDown:o.onKeyDown,onKeyUp:o.onKeyUp,selectValueOnOpen:!1}):n(prompt(r,""))}function Ee(e,t){var r=Oe(e,t)||[];if(!r.length)return[];var n=[];if(0===r[0]){for(var o=0;o<r.length;o++)"number"==typeof r[o]&&n.push(e.substring(r[o]+1,r[o+1]));return n}}function Oe(e,t){t||(t="/");for(var r=!1,n=[],o=0;o<e.length;o++){var i=e.charAt(o);r||i!=t||n.push(o),r=!r&&"\\"==i}return n}R("pcre",!0,"boolean"),Le.prototype={getQuery:function(){return I.query},setQuery:function(e){I.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return I.isReversed},setReversed:function(e){I.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var Ie={"\\n":"\n","\\r":"\r","\\t":"\t"};var Be={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t","\\&":"&"};function Ke(e,t,r){if(I.registerController.getRegister("/").setText(e),e instanceof RegExp)return e;var n,o,i=Oe(e,"/");i.length?(n=e.substring(0,i[0]),o=-1!=e.substring(i[0]).indexOf("i")):n=e;return n?(O("pcre")||(n=function(e){for(var t=!1,r=[],n=-1;n<e.length;n++){var o=e.charAt(n)||"",i=e.charAt(n+1)||"",a=i&&-1!="|(){".indexOf(i);t?("\\"===o&&a||r.push(o),t=!1):"\\"===o?(t=!0,i&&-1!="}".indexOf(i)&&(a=!0),a&&"\\"!==i||r.push(o)):(r.push(o),a&&"\\"!==i&&r.push("\\"))}return r.join("")}(n)),r&&(t=/^[^A-Z]*$/.test(n)),new RegExp(n,t||o?"i":void 0)):null}function Ne(e,t){e.openNotification?e.openNotification('<span style="color: red">'+t+"</span>",{bottom:!0,duration:5e3}):alert(t)}var Pe="(Javascript regexp)";function je(e,t){var r,n,o,i=(t.prefix||"")+" "+(t.desc||"");Re(e,(r=t.prefix,n=t.desc,o='<span style="font-family: monospace; white-space: pre">'+(r||"")+'<input type="text"></span>',n&&(o+=' <span style="color: #888">'+n+"</span>"),o),i,t.onClose,t)}function _e(e,t,r,n){if(t){var o=Te(e),i=Ke(t,!!r,!!n);if(i)return Fe(e,i),function(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var r=["global","multiline","ignoreCase","source"],n=0;n<r.length;n++){var o=r[n];if(e[o]!==t[o])return!1}return!0}return!1}(i,o.getQuery())?i:(o.setQuery(i),i)}}var He=0;function Fe(e,t){clearTimeout(He),He=setTimeout((function(){var r=Te(e),n=r.getOverlay();n&&t==n.query||(n&&e.removeOverlay(n),n=function(e){if("^"==e.source.charAt(0))var t=!0;return{token:function(r){if(!t||r.sol()){var n=r.match(e,!1);if(n)return 0==n[0].length?(r.next(),"searching"):r.sol()||(r.backUp(1),e.exec(r.next()+n[0]))?(r.match(e),"searching"):(r.next(),null);for(;!r.eol()&&(r.next(),!r.match(e,!1)););}else r.skipToEnd()},query:e}}(t),e.addOverlay(n),e.showMatchesOnScrollbar&&(r.getScrollbarAnnotate()&&r.getScrollbarAnnotate().clear(),r.setScrollbarAnnotate(e.showMatchesOnScrollbar(t))),r.setOverlay(n))}),50)}function We(e,t,r,n){return void 0===n&&(n=1),e.operation((function(){for(var i=e.getCursor(),a=e.getSearchCursor(r,i),s=0;s<n;s++){var l=a.find(t);if(0==s&&l&&re(a.from(),i)&&(l=a.find(t)),!l&&!(a=e.getSearchCursor(r,t?o(e.lastLine()):o(e.firstLine(),0))).find(t))return}return a.from()}))}function Ve(e){var t=Te(e);e.removeOverlay(Te(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function De(e){var t=e.getScrollInfo(),r=e.coordsChar({left:0,top:6+t.top},"local"),n=t.clientHeight-10+t.top,o=e.coordsChar({left:0,top:n},"local");return{top:r.line,bottom:o.line}}function Ue(e,t,r){if("'"==r||"`"==r)return I.jumpList.find(e,-1)||o(0,0);if("."==r)return Je(e);var n=t.marks[r];return n&&n.find()}function Je(e){for(var t=e.doc.history.done,r=t.length;r--;)if(t[r].changes)return te(t[r].changes[0].to)}var $e=function(){this.buildCommandMap_()};$e.prototype={processCommand:function(e,t,r){var n=this;e.operation((function(){e.curOp.isVimOp=!0,n._processCommand(e,t,r)}))},_processCommand:function(t,r,n){var o=t.state.vim,i=I.registerController.getRegister(":"),a=i.toString();o.visualMode&&me(t);var s=new e.StringStream(r);i.setText(r);var l,c,u=n||{};u.input=r;try{this.parseInput_(t,s,u)}catch(e){throw Ne(t,e),e}if(u.commandName){if(l=this.matchCommand_(u.commandName)){if(c=l.name,l.excludeFromCommandHistory&&i.setText(a),this.parseCommandArgs_(s,u,l),"exToKey"==l.type){for(var h=0;h<l.toKeys.length;h++)e.Vim.handleKey(t,l.toKeys[h],"mapping");return}if("exToEx"==l.type)return void this.processCommand(t,l.toInput)}}else void 0!==u.line&&(c="move");if(c)try{qe[c](t,u),l&&l.possiblyAsync||!u.callback||u.callback()}catch(e){throw Ne(t,e),e}else Ne(t,'Not an editor command ":'+r+'"')},parseInput_:function(e,t,r){t.eatWhile(":"),t.eat("%")?(r.line=e.firstLine(),r.lineEnd=e.lastLine()):(r.line=this.parseLineSpec_(e,t),void 0!==r.line&&t.eat(",")&&(r.lineEnd=this.parseLineSpec_(e,t)));var n=t.match(/^(\w+)/);return r.commandName=n?n[1]:t.match(/.*/)[0],r},parseLineSpec_:function(e,t){var r=t.match(/^(\d+)/);if(r)return parseInt(r[1],10)-1;switch(t.next()){case".":return this.parseLineSpecOffset_(t,e.getCursor().line);case"$":return this.parseLineSpecOffset_(t,e.lastLine());case"'":var n=t.next(),o=Ue(e,e.state.vim,n);if(!o)throw new Error("Mark not set");return this.parseLineSpecOffset_(t,o.line);case"-":case"+":return t.backUp(1),this.parseLineSpecOffset_(t,e.getCursor().line);default:return void t.backUp(1)}},parseLineSpecOffset_:function(e,t){var r=e.match(/^([+-])?(\d+)/);if(r){var n=parseInt(r[2],10);"-"==r[1]?t-=n:t+=n}return t},parseCommandArgs_:function(e,t,r){if(!e.eol()){t.argString=e.match(/.*/)[0];var n=r.argDelimiter||/\s+/,o=le(t.argString).split(n);o.length&&o[0]&&(t.args=o)}},matchCommand_:function(e){for(var t=e.length;t>0;t--){var r=e.substring(0,t);if(this.commandMap_[r]){var n=this.commandMap_[r];if(0===n.name.indexOf(e))return n}}return null},buildCommandMap_:function(){this.commandMap_={};for(var e=0;e<n.length;e++){var t=n[e],r=t.shortName||t.name;this.commandMap_[r]=t}},map:function(e,r,n){if(":"!=e&&":"==e.charAt(0)){if(n)throw Error("Mode not supported for ex mappings");var o=e.substring(1);":"!=r&&":"==r.charAt(0)?this.commandMap_[o]={name:o,type:"exToEx",toInput:r.substring(1),user:!0}:this.commandMap_[o]={name:o,type:"exToKey",toKeys:r,user:!0}}else if(":"!=r&&":"==r.charAt(0)){var i={keys:e,type:"keyToEx",exArgs:{input:r.substring(1)}};n&&(i.context=n),t.unshift(i)}else{i={keys:e,type:"keyToKey",toKeys:r};n&&(i.context=n),t.unshift(i)}},unmap:function(e,r){if(":"!=e&&":"==e.charAt(0)){if(r)throw Error("Mode not supported for ex mappings");var n=e.substring(1);if(this.commandMap_[n]&&this.commandMap_[n].user)return void delete this.commandMap_[n]}else for(var o=e,i=0;i<t.length;i++)if(o==t[i].keys&&t[i].context===r)return void t.splice(i,1);throw Error("No such mapping.")}};var qe={colorscheme:function(e,t){!t.args||t.args.length<1?Ne(e,e.getOption("theme")):e.setOption("theme",t.args[0])},map:function(e,t,r){var n=t.args;!n||n.length<2?e&&Ne(e,"Invalid mapping: "+t.input):Qe.map(n[0],n[1],r)},imap:function(e,t){this.map(e,t,"insert")},nmap:function(e,t){this.map(e,t,"normal")},vmap:function(e,t){this.map(e,t,"visual")},unmap:function(e,t,r){var n=t.args;!n||n.length<1?e&&Ne(e,"No such mapping: "+t.input):Qe.unmap(n[0],r)},move:function(e,t){J.processCommand(e,e.state.vim,{type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:t.line+1})},set:function(e,t){var r=t.args,n=t.setCfg||{};if(!r||r.length<1)e&&Ne(e,"Invalid mapping: "+t.input);else{var o=r[0].split("="),i=o[0],a=o[1],s=!1;if("?"==i.charAt(i.length-1)){if(a)throw Error("Trailing characters: "+t.argString);i=i.substring(0,i.length-1),s=!0}void 0===a&&"no"==i.substring(0,2)&&(i=i.substring(2),a=!1);var l=T[i]&&"boolean"==T[i].type;if(l&&null==a&&(a=!0),!l&&void 0===a||s){var c=O(i,e,n);c instanceof Error?Ne(e,c.message):Ne(e,!0===c||!1===c?" "+(c?"":"no")+i:" "+i+"="+c)}else{var u=E(i,a,e,n);u instanceof Error&&Ne(e,u.message)}}},setlocal:function(e,t){t.setCfg={scope:"local"},this.set(e,t)},setglobal:function(e,t){t.setCfg={scope:"global"},this.set(e,t)},registers:function(e,t){var r=t.args,n=I.registerController.registers,o="----------Registers----------<br><br>";if(r){r=r.join("");for(var i=0;i<r.length;i++){if(a=r.charAt(i),I.registerController.isValidRegister(a))o+='"'+a+" "+(n[a]||new V).toString()+"<br>"}}else for(var a in n){var s=n[a].toString();s.length&&(o+='"'+a+" "+s+"<br>")}Ne(e,o)},sort:function(t,r){var n,i,a,s,l;var c=function(){if(r.argString){var t=new e.StringStream(r.argString);if(t.eat("!")&&(n=!0),t.eol())return;if(!t.eatSpace())return"Invalid arguments";var o=t.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!o&&!t.eol())return"Invalid arguments";if(o[1]){i=-1!=o[1].indexOf("i"),a=-1!=o[1].indexOf("u");var c=-1!=o[1].indexOf("d")||-1!=o[1].indexOf("n")&&1,u=-1!=o[1].indexOf("x")&&1,h=-1!=o[1].indexOf("o")&&1;if(c+u+h>1)return"Invalid arguments";s=(c?"decimal":u&&"hex")||h&&"octal"}o[2]&&(l=new RegExp(o[2].substr(1,o[2].length-2),i?"i":""))}}();if(c)Ne(t,c+": "+r.argString);else{var u=r.line||t.firstLine(),h=r.lineEnd||r.line||t.lastLine();if(u!=h){var p=o(u,0),f=o(h,se(t,h)),d=t.getRange(p,f).split("\n"),m=l||("decimal"==s?/(-?)([\d]+)/:"hex"==s?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==s?/([0-7]+)/:null),g="decimal"==s?10:"hex"==s?16:"octal"==s?8:null,v=[],y=[];if(s||l)for(var k=0;k<d.length;k++){var C=l?d[k].match(l):null;C&&""!=C[0]?v.push(C):!l&&m.exec(d[k])?v.push(d[k]):y.push(d[k])}else y=d;if(v.sort(l?function(e,t){var r;return n&&(r=e,e=t,t=r),i&&(e[0]=e[0].toLowerCase(),t[0]=t[0].toLowerCase()),e[0]<t[0]?-1:1}:M),l)for(k=0;k<v.length;k++)v[k]=v[k].input;else s||y.sort(M);if(d=n?v.concat(y):y.concat(v),a){var w,x=d;d=[];for(k=0;k<x.length;k++)x[k]!=w&&d.push(x[k]),w=x[k]}t.replaceRange(d.join("\n"),p,f)}}function M(e,t){var r;n&&(r=e,e=t,t=r);i&&(e=e.toLowerCase(),t=t.toLowerCase());var o=s&&m.exec(e),a=s&&m.exec(t);return o?(o=parseInt((o[1]+o[2]).toLowerCase(),g))-(a=parseInt((a[1]+a[2]).toLowerCase(),g)):e<t?-1:1}},global:function(e,t){var r=t.argString;if(r){var n,o=void 0!==t.line?t.line:e.firstLine(),i=t.lineEnd||t.line||e.lastLine(),a=function(e){return Ee(e,"/")}(r),s=r;if(a.length&&(s=a[0],n=a.slice(1,a.length).join("/")),s)try{_e(e,s,!0,!0)}catch(t){return void Ne(e,"Invalid regex: "+s)}for(var l=Te(e).getQuery(),c=[],u="",h=o;h<=i;h++){l.test(e.getLine(h))&&(c.push(h+1),u+=e.getLine(h)+"<br>")}if(n){var p=0,f=function(){if(p<c.length){var t=c[p]+n;Qe.processCommand(e,t,{callback:f})}p++};f()}else Ne(e,u)}else Ne(e,"Regular Expression missing from global")},substitute:function(t,r){if(!t.getSearchCursor)throw new Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var n,i,a,s,l=r.argString,c=l?Ee(l,l[0]):[],u="",h=!1,p=!1;if(c.length)n=c[0],O("pcre")&&""!==n&&(n=new RegExp(n).source),u=c[1],n&&"$"===n[n.length-1]&&(n=n.slice(0,n.length-1)+"\\n",u=u?u+"\n":"\n"),void 0!==u&&(u=O("pcre")?function(t){for(var r=new e.StringStream(t),n=[];!r.eol();){for(;r.peek()&&"\\"!=r.peek();)n.push(r.next());var o=!1;for(var i in Be)if(r.match(i,!0)){o=!0,n.push(Be[i]);break}o||n.push(r.next())}return n.join("")}(u.replace(/([^\\])&/g,"$1$$&")):function(e){for(var t,r=!1,n=[],o=-1;o<e.length;o++){var i=e.charAt(o)||"",a=e.charAt(o+1)||"";Ie[i+a]?(n.push(Ie[i+a]),o++):r?(n.push(i),r=!1):"\\"===i?(r=!0,t=a,f.test(t)||"$"===a?n.push("$"):"/"!==a&&"\\"!==a&&n.push("\\")):("$"===i&&n.push("$"),n.push(i),"/"===a&&n.push("\\"))}return n.join("")}(u),I.lastSubstituteReplacePart=u),i=c[2]?c[2].split(" "):[];else if(l&&l.length)return void Ne(t,"Substitutions should be of the form :s/pattern/replace/");if(i&&(a=i[0],s=parseInt(i[1]),a&&(-1!=a.indexOf("c")&&(h=!0,a.replace("c","")),-1!=a.indexOf("g")&&(p=!0,a.replace("g","")),n=O("pcre")?n+"/"+a:n.replace(/\//g,"\\/")+"/"+a)),n)try{_e(t,n,!0,!0)}catch(e){return void Ne(t,"Invalid regex: "+n)}if(void 0!==(u=u||I.lastSubstituteReplacePart)){var d=Te(t).getQuery(),m=void 0!==r.line?r.line:t.getCursor().line,g=r.lineEnd||m;m==t.firstLine()&&g==t.lastLine()&&(g=1/0),s&&(g=(m=g)+s-1);var v=X(t,o(m,0)),y=t.getSearchCursor(d,v);!function(t,r,n,o,i,a,s,l,c){t.state.vim.exMode=!0;var u=!1,h=a.from();function p(){t.operation((function(){for(;!u;)f(),d();m()}))}function f(){var e=t.getRange(a.from(),a.to()).replace(s,l);a.replace(e)}function d(){for(;a.findNext()&&(e=a.from(),r=o,s=i,"number"!=typeof e&&(e=e.line),r instanceof Array?L(e,r):s?e>=r&&e<=s:e==r);)if(n||!h||a.from().line!=h.line)return t.scrollIntoView(a.from(),30),t.setSelection(a.from(),a.to()),h=a.from(),void(u=!1);var e,r,s;u=!0}function m(e){if(e&&e(),t.focus(),h){t.setCursor(h);var r=t.state.vim;r.exMode=!1,r.lastHPos=r.lastHSPos=h.ch}c&&c()}if(d(),u)return void Ne(t,"No matches for "+s.source);if(!r)return p(),void(c&&c());je(t,{prefix:"replace with <strong>"+l+"</strong> (y/n/a/q/l)",onKeyDown:function(r,n,o){switch(e.e_stop(r),e.keyName(r)){case"Y":f(),d();break;case"N":d();break;case"A":var i=c;c=void 0,t.operation(p),c=i;break;case"L":f();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":m(o)}return u&&m(o),!0}})}(t,h,p,m,g,y,d,u,r.callback)}else Ne(t,"No previous substitute regular expression")},redo:e.commands.redo,undo:e.commands.undo,write:function(t){e.commands.save?e.commands.save(t):t.save&&t.save()},nohlsearch:function(e){Ve(e)},yank:function(e){var t=te(e.getCursor()).line,r=e.getLine(t);I.registerController.pushText("0","yank",r,!0,!0)},delmarks:function(t,r){if(r.argString&&le(r.argString))for(var n=t.state.vim,o=new e.StringStream(le(r.argString));!o.eol();){o.eatSpace();var i=o.pos;if(!o.match(/[a-zA-Z]/,!1))return void Ne(t,"Invalid argument: "+r.argString.substring(i));var a=o.next();if(o.match("-",!0)){if(!o.match(/[a-zA-Z]/,!1))return void Ne(t,"Invalid argument: "+r.argString.substring(i));var s=a,l=o.next();if(!(M(s)&&M(l)||S(s)&&S(l)))return void Ne(t,"Invalid argument: "+s+"-");var c=s.charCodeAt(0),u=l.charCodeAt(0);if(c>=u)return void Ne(t,"Invalid argument: "+r.argString.substring(i));for(var h=0;h<=u-c;h++){var p=String.fromCharCode(c+h);delete n.marks[p]}}else delete n.marks[a]}else Ne(t,"Argument required")}},Qe=new $e;function ze(t){var r=t.state.vim,n=I.macroModeState,o=I.registerController.getRegister("."),i=n.isPlaying,a=n.lastInsertModeChanges;i||(t.off("change",Ge),e.off(t.getInputField(),"keydown",rt)),!i&&r.insertModeRepeat>1&&(nt(t,r,r.insertModeRepeat-1,!0),r.lastEditInputState.repeatOverride=r.insertModeRepeat),delete r.insertModeRepeat,r.insertMode=!1,t.setCursor(t.getCursor().line,t.getCursor().ch-1),t.setOption("keyMap","vim"),t.setOption("disableInput",!0),t.toggleOverwrite(!1),o.setText(a.changes.join("")),e.signal(t,"vim-mode-change",{mode:"normal"}),n.isRecording&&function(e){if(e.isPlaying)return;var t=e.latestRegister,r=I.registerController.getRegister(t);r&&r.pushInsertModeChanges&&r.pushInsertModeChanges(e.lastInsertModeChanges)}(n)}function Xe(e){t.unshift(e)}function Ze(t,r,n,o){var i=I.registerController.getRegister(o);if(":"==o)return i.keyBuffer[0]&&Qe.processCommand(t,i.keyBuffer[0]),void(n.isPlaying=!1);var a=i.keyBuffer,s=0;n.isPlaying=!0,n.replaySearchQueries=i.searchQueries.slice(0);for(var l=0;l<a.length;l++)for(var c,u,h=a[l];h;)if(u=(c=/<\w+-.+?>|<\w+>|./.exec(h))[0],h=h.substring(c.index+u.length),e.Vim.handleKey(t,u,"macro"),r.insertMode){var p=i.insertModeChanges[s++].changes;I.macroModeState.lastInsertModeChanges.changes=p,ot(t,p,1),ze(t)}n.isPlaying=!1}function Ge(e,t){var r=I.macroModeState,n=r.lastInsertModeChanges;if(!r.isPlaying)for(;t;){if(n.expectCursorActivityForChange=!0,n.ignoreCount>1)n.ignoreCount--;else if("+input"==t.origin||"paste"==t.origin||void 0===t.origin){var o=e.listSelections().length;o>1&&(n.ignoreCount=o);var i=t.text.join("\n");n.maybeReset&&(n.changes=[],n.maybeReset=!1),i&&(e.state.overwrite&&!/\n/.test(i)?n.changes.push([i]):n.changes.push(i))}t=t.next}}function Ye(t){var r=t.state.vim;if(r.insertMode){var n=I.macroModeState;if(n.isPlaying)return;var o=n.lastInsertModeChanges;o.expectCursorActivityForChange?o.expectCursorActivityForChange=!1:o.maybeReset=!0}else t.curOp.isVimOp||function(t,r){var n=t.getCursor("anchor"),o=t.getCursor("head");r.visualMode&&!t.somethingSelected()?me(t,!1):r.visualMode||r.insertMode||!t.somethingSelected()||(r.visualMode=!0,r.visualLine=!1,e.signal(t,"vim-mode-change",{mode:"visual"}));if(r.visualMode){var i=ne(o,n)?0:-1,a=ne(o,n)?-1:0;o=G(o,0,i),n=G(n,0,a),r.sel={anchor:n,head:o},Se(t,r,"<",oe(o,n)),Se(t,r,">",ie(o,n))}else r.insertMode||(r.lastHPos=t.getCursor().ch)}(t,r);r.visualMode&&et(t)}function et(e){var t=e.state.vim,r=X(e,te(t.sel.head)),n=G(r,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(r,n,{className:"cm-animate-fat-cursor"})}function tt(e){this.keyName=e}function rt(t){var r=I.macroModeState.lastInsertModeChanges,n=e.keyName(t);n&&(-1==n.indexOf("Delete")&&-1==n.indexOf("Backspace")||e.lookupKey(n,"vim-insert",(function(){return r.maybeReset&&(r.changes=[],r.maybeReset=!1),r.changes.push(new tt(n)),!0})))}function nt(e,t,r,n){var o=I.macroModeState;o.isPlaying=!0;var i=!!t.lastEditActionCommand,a=t.inputState;function s(){i?J.processAction(e,t,t.lastEditActionCommand):J.evalInput(e,t)}function l(r){if(o.lastInsertModeChanges.changes.length>0){r=t.lastEditActionCommand?r:1;var n=o.lastInsertModeChanges;ot(e,n.changes,r)}}if(t.inputState=t.lastEditInputState,i&&t.lastEditActionCommand.interlaceInsertRepeat)for(var c=0;c<r;c++)s(),l(1);else n||s(),l(r);t.inputState=a,t.insertMode&&!n&&ze(e),o.isPlaying=!1}function ot(t,r,n){function o(r){return"string"==typeof r?e.commands[r](t):r(t),!0}var i=t.getCursor("head"),a=I.macroModeState.lastInsertModeChanges.visualBlock;a&&(he(t,i,a+1),n=t.listSelections().length,t.setCursor(i));for(var s=0;s<n;s++){a&&t.setCursor(G(i,s,0));for(var l=0;l<r.length;l++){var c=r[l];if(c instanceof tt)e.lookupKey(c.keyName,"vim-insert",o);else if("string"==typeof c){var u=t.getCursor();t.replaceRange(c,u,u)}else{var h=t.getCursor(),p=G(h,0,c[0].length);t.replaceRange(c[0],h,p)}}}a&&t.setCursor(G(i,0,1))}return e.keyMap.vim={attach:a,detach:i,call:c},R("insertModeEscKeysTimeout",200,"number"),e.keyMap["vim-insert"]={fallthrough:["default"],attach:a,detach:i,call:c},e.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:a,detach:i,call:c},_(),H}()})); \ No newline at end of file +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/dialog/dialog"),require("../addon/edit/matchbrackets.js")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/dialog/dialog","../addon/edit/matchbrackets"],e):e(CodeMirror)}((function(e){"use strict";var t=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"<Del>",type:"keyToKey",toKeys:"x",context:"normal"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<character>",type:"action",action:"replayMacro"},{keys:"q<character>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<character>",type:"action",action:"setMark"},{keys:'"<character>',type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<character>",type:"motion",motion:"textObjectManipulation"},{keys:"i<character>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],r=t.length,n=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],o=e.Pos;e.Vim=function(){function i(t,r){this==e.keyMap.vim&&(e.rmClass(t.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==t.getOption("inputStyle")&&null!=document.body.style.caretColor&&(!function(e){l(e),e.off("cursorActivity",s),e.state.fatCursorMarks=null}(t),t.getInputField().style.caretColor="")),r&&r.attach==a||function(t){t.setOption("disableInput",!1),t.off("cursorActivity",et),e.off(t.getInputField(),"paste",p(t)),t.state.vim=null}(t)}function a(t,r){this==e.keyMap.vim&&(e.addClass(t.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==t.getOption("inputStyle")&&null!=document.body.style.caretColor&&(!function(e){e.state.fatCursorMarks=[],s(e),e.on("cursorActivity",s)}(t),t.getInputField().style.caretColor="transparent")),r&&r.attach==a||function(t){t.setOption("disableInput",!0),t.setOption("showCursorWhenSelecting",!1),e.signal(t,"vim-mode-change",{mode:"normal"}),t.on("cursorActivity",et),_(t),e.on(t.getInputField(),"paste",p(t))}(t)}function s(e){if(e.state.fatCursorMarks){l(e);for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){var i=t[n];if(i.empty()){var a=e.getLine(i.anchor.line).length;i.anchor.ch<a?r.push(e.markText(i.anchor,o(i.anchor.line,i.anchor.ch+1),{className:"cm-fat-cursor-mark"})):r.push(e.markText(o(i.anchor.line,a-1),o(i.anchor.line,a),{className:"cm-fat-cursor-mark"}))}}e.state.fatCursorMarks=r}}function l(e){var t=e.state.fatCursorMarks;if(t)for(var r=0;r<t.length;r++)t[r].clear()}function c(t,r){if(r){if(this[t])return this[t];var n=function(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split(/-(?!$)/),r=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==r.length)return!1;for(var n=!1,o=0;o<t.length;o++){var i=t[o];i in u?t[o]=u[i]:n=!0,i in h&&(t[o]=h[i])}if(!n)return!1;S(r)&&(t[t.length-1]=r.toLowerCase());return"<"+t.join("-")+">"}(t);if(!n)return!1;var o=e.Vim.findKey(r,n);return"function"==typeof o&&e.signal(r,"vim-keypress",n),o}}e.defineOption("vimMode",!1,(function(t,r,n){r&&"vim"!=t.getOption("keyMap")?t.setOption("keyMap","vim"):!r&&n!=e.Init&&/^vim/.test(t.getOption("keyMap"))&&t.setOption("keyMap","default")}));var u={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A"},h={Enter:"CR",Backspace:"BS",Delete:"Del",Insert:"Ins"};function p(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(G(e.getCursor(),0,1)),z.enterInsertMode(e,{},t))}),t.onPasteFn}var f=/[\d]/,d=[e.isWordChar,function(t){return t&&!e.isWordChar(t)&&!/\s/.test(t)}],m=[function(e){return/\S/.test(e)}];function g(e,t){for(var r=[],n=e;n<e+t;n++)r.push(String.fromCharCode(n));return r}var v=g(65,26),y=g(97,26),k=g(48,10),C=[].concat(v,y,k,["<",">"]),w=[].concat(v,y,k,["-",'"',".",":","_","/"]);function x(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function M(e){return/^[a-z]$/.test(e)}function S(e){return/^[A-Z]$/.test(e)}function A(e){return/^\s*$/.test(e)}function b(e){return-1!=".?!".indexOf(e)}function L(e,t){for(var r=0;r<t.length;r++)if(t[r]==e)return!0;return!1}var T={};function R(e,t,r,n,o){if(void 0===t&&!o)throw Error("defaultValue is required unless callback is provided");if(r||(r="string"),T[e]={type:r,defaultValue:t,callback:o},n)for(var i=0;i<n.length;i++)T[n[i]]=T[e];t&&E(e,t)}function E(e,t,r,n){var o=T[e],i=(n=n||{}).scope;if(!o)return new Error("Unknown option: "+e);if("boolean"==o.type){if(t&&!0!==t)return new Error("Invalid argument: "+e+"="+t);!1!==t&&(t=!0)}o.callback?("local"!==i&&o.callback(t,void 0),"global"!==i&&r&&o.callback(t,r)):("local"!==i&&(o.value="boolean"==o.type?!!t:t),"global"!==i&&r&&(r.state.vim.options[e]={value:t}))}function O(e,t,r){var n=T[e],o=(r=r||{}).scope;if(!n)return new Error("Unknown option: "+e);if(n.callback){var i=t&&n.callback(void 0,t);return"global"!==o&&void 0!==i?i:"local"!==o?n.callback():void 0}return((i="global"!==o&&t&&t.state.vim.options[e])||"local"!==o&&n||{}).value}R("filetype",void 0,"string",["ft"],(function(e,t){if(void 0!==t){if(void 0===e)return"null"==(r=t.getOption("mode"))?"":r;var r=""==e?"null":e;t.setOption("mode",r)}}));var B,I,K=function(){var e=-1,t=0,r=0,n=new Array(100);function o(o,i){(e+=i)>t?e=t:e<r&&(e=r);var a=n[(100+e)%100];if(a&&!a.find()){var s,l=i>0?1:-1,c=o.getCursor();do{if((a=n[(100+(e+=l))%100])&&(s=a.find())&&!re(c,s))break}while(e<t&&e>r)}return a}return{cachedCursor:void 0,add:function(o,i,a){var s=n[e%100];function l(t){var r=++e%100,i=n[r];i&&i.clear(),n[r]=o.setBookmark(t)}if(s){var c=s.find();c&&!re(c,i)&&l(i)}else l(i);l(a),t=e,(r=e-100+1)<0&&(r=0)},find:function(t,r){var n=e,i=o(t,r);return e=n,i&&i.find()},move:o}},N=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};function P(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=N()}function _(e){return e.state.vim||(e.state.vim={inputState:new F,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},fakeCursor:null,insertMode:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,sel:{},options:{}}),e.state.vim}function j(){for(var e in B={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:K(),macroModeState:new P,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new D({}),searchHistoryController:new U,exCommandHistoryController:new U},T){var t=T[e];t.value=t.defaultValue}}P.prototype={exitMacroRecordMode:function(){var e=B.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var r=B.registerController.getRegister(t);r&&(r.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var H={buildKeyMap:function(){},getRegisterController:function(){return B.registerController},resetVimGlobalState_:j,getVimGlobalState_:function(){return B},maybeInitVimState_:_,suppressErrorLogging:!1,InsertModeKey:nt,map:function(e,t,r){ze.map(e,t,r)},unmap:function(e,t){ze.unmap(e,t)},noremap:function(e,n,o){function i(e){return e?[e]:["normal","insert","visual"]}for(var a=i(o),s=t.length,l=s-r;l<s&&a.length;l++){var c=t[l];if(!(c.keys!=n||o&&c.context&&c.context!==o||"ex"===c.type.substr(0,2)||"key"===c.type.substr(0,3))){var u={};for(var h in c)u[h]=c[h];u.keys=e,o&&!u.context&&(u.context=o),this._mapCommand(u);var p=i(c.context);a=a.filter((function(e){return-1===p.indexOf(e)}))}}},mapclear:function(e){var n=t.length,o=r,i=t.slice(0,n-o);if(t=t.slice(n-o),e)for(var a=i.length-1;a>=0;a--){var s=i[a];if(e!==s.context)if(s.context)this._mapCommand(s);else{var l=["normal","insert","visual"];for(var c in l)if(l[c]!==e){var u={};for(var h in s)u[h]=s[h];u.context=l[c],this._mapCommand(u)}}}},setOption:E,getOption:O,defineOption:R,defineEx:function(e,t,r){if(t){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered')}else t=e;Qe[e]=r,ze.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,r){var n=this.findKey(e,t,r);if("function"==typeof n)return n()},findKey:function(r,n,o){var i,a=_(r);function s(){var e=B.macroModeState;if(e.isRecording){if("q"==n)return e.exitMacroRecordMode(),W(r),!0;"mapping"!=o&&function(e,t){if(e.isPlaying)return;var r=e.latestRegister,n=B.registerController.getRegister(r);n&&n.pushText(t)}(e,n)}}function l(){if("<Esc>"==n)return W(r),a.visualMode?me(r):a.insertMode&&Xe(r),!0}return!1===(i=a.insertMode?function(){if(l())return!0;for(var e=a.inputState.keyBuffer=a.inputState.keyBuffer+n,o=1==n.length,i=J.matchCommand(e,t,a.inputState,"insert");e.length>1&&"full"!=i.type;){e=a.inputState.keyBuffer=e.slice(1);var s=J.matchCommand(e,t,a.inputState,"insert");"none"!=s.type&&(i=s)}if("none"==i.type)return W(r),!1;if("partial"==i.type)return I&&window.clearTimeout(I),I=window.setTimeout((function(){a.insertMode&&a.inputState.keyBuffer&&W(r)}),O("insertModeEscKeysTimeout")),!o;if(I&&window.clearTimeout(I),o){for(var c=r.listSelections(),u=0;u<c.length;u++){var h=c[u].head;r.replaceRange("",G(h,0,-(e.length-1)),h,"+input")}B.macroModeState.lastInsertModeChanges.changes.pop()}return W(r),i.command}():function(){if(s()||l())return!0;var e=a.inputState.keyBuffer=a.inputState.keyBuffer+n;if(/^[1-9]\d*$/.test(e))return!0;if(!(o=/^(\d*)(.*)$/.exec(e)))return W(r),!1;var o,i=a.visualMode?"visual":"normal",c=J.matchCommand(o[2]||o[1],t,a.inputState,i);return"none"==c.type?(W(r),!1):"partial"==c.type||(a.inputState.keyBuffer="",(o=/^(\d*)(.*)$/.exec(e))[1]&&"0"!=o[1]&&a.inputState.pushRepeatDigit(o[1]),c.command)}())?a.insertMode||1!==n.length?void 0:function(){return!0}:!0===i?function(){return!0}:function(){return r.operation((function(){r.curOp.isVimOp=!0;try{"keyToKey"==i.type?function(t){for(var o;t;)o=/<\w+-.+?>|<\w+>|./.exec(t),n=o[0],t=t.substring(o.index+n.length),e.Vim.handleKey(r,n,"mapping")}(i.toKeys):J.processCommand(r,a,i)}catch(t){throw r.state.vim=void 0,_(r),e.Vim.suppressErrorLogging||console.log(t),t}return!0}))}},handleEx:function(e,t){ze.processCommand(e,t)},defineMotion:function(e,t){$[e]=t},defineAction:function(e,t){z[e]=t},defineOperator:function(e,t){Q[e]=t},mapCommand:function(e,t,r,n,o){var i={keys:e,type:t};for(var a in i[t]=r,i[t+"Args"]=n,o)i[a]=o[a];Ze(i)},_mapCommand:Ze,defineRegister:function(e,t){var r=B.registerController.registers;if(!e||1!=e.length)throw Error("Register name must be 1 character");if(r[e])throw Error("Register already defined "+e);r[e]=t,w.push(e)},exitVisualMode:me,exitInsertMode:Xe};function F(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=null}function W(t,r){t.state.vim.inputState=new F,e.signal(t,"vim-command-done",r)}function V(e,t,r){this.clear(),this.keyBuffer=[e||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!t,this.blockwise=!!r}function D(e){this.registers=e,this.unnamedRegister=e['"']=new V,e["."]=new V,e[":"]=new V,e["/"]=new V}function U(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}F.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},F.prototype.getRepeat=function(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},V.prototype={setText:function(e,t,r){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!r},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(N(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},D.prototype={pushText:function(e,t,r,n,o){if("_"!==e){n&&"\n"!==r.charAt(r.length-1)&&(r+="\n");var i=this.isValidRegister(e)?this.getRegister(e):null;if(i){S(e)?i.pushText(r,n):i.setText(r,n,o),this.unnamedRegister.setText(i.toString(),n)}else{switch(t){case"yank":this.registers[0]=new V(r,n,o);break;case"delete":case"change":-1==r.indexOf("\n")?this.registers["-"]=new V(r,n):(this.shiftNumericRegisters_(),this.registers[1]=new V(r,n))}this.unnamedRegister.setText(r,n,o)}}},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new V),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&L(e,w)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},U.prototype={nextMatch:function(e,t){var r=this.historyBuffer,n=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var o=this.iterator+n;t?o>=0:o<r.length;o+=n)for(var i=r[o],a=0;a<=i.length;a++)if(this.initialPrefix==i.substring(0,a))return this.iterator=o,i;return o>=r.length?(this.iterator=r.length,this.initialPrefix):o<0?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var J={matchCommand:function(e,t,r,n){var o,i=function(e,t,r,n){for(var o,i=[],a=[],s=0;s<t.length;s++){var l=t[s];"insert"==r&&"insert"!=l.context||l.context&&l.context!=r||n.operator&&"action"==l.type||!(o=Y(e,l.keys))||("partial"==o&&i.push(l),"full"==o&&a.push(l))}return{partial:i.length&&i,full:a.length&&a}}(e,t,n,r);if(!i.full&&!i.partial)return{type:"none"};if(!i.full&&i.partial)return{type:"partial"};for(var a=0;a<i.full.length;a++){var s=i.full[a];o||(o=s)}if("<character>"==o.keys.slice(-11)){var l=function(e){var t=/^.*(<[^>]+>)$/.exec(e),r=t?t[1]:e.slice(-1);if(r.length>1)switch(r){case"<CR>":r="\n";break;case"<Space>":r=" ";break;default:r=""}return r}(e);if(!l)return{type:"none"};r.selectedCharacter=l}return{type:"full",command:o}},processCommand:function(e,t,r){switch(t.inputState.repeatOverride=r.repeatOverride,r.type){case"motion":this.processMotion(e,t,r);break;case"operator":this.processOperator(e,t,r);break;case"operatorMotion":this.processOperatorMotion(e,t,r);break;case"action":this.processAction(e,t,r);break;case"search":this.processSearch(e,t,r);break;case"ex":case"keyToEx":this.processEx(e,t,r)}},processMotion:function(e,t,r){t.inputState.motion=r.motion,t.inputState.motionArgs=Z(r.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,r){var n=t.inputState;if(n.operator){if(n.operator==r.operator)return n.motion="expandToLine",n.motionArgs={linewise:!0},void this.evalInput(e,t);W(e)}n.operator=r.operator,n.operatorArgs=Z(r.operatorArgs),r.exitVisualBlock&&(t.visualBlock=!1,fe(e)),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,r){var n=t.visualMode,o=Z(r.operatorMotionArgs);o&&n&&o.visualLine&&(t.visualLine=!0),this.processOperator(e,t,r),n||this.processMotion(e,t,r)},processAction:function(e,t,r){var n=t.inputState,o=n.getRepeat(),i=!!o,a=Z(r.actionArgs)||{};n.selectedCharacter&&(a.selectedCharacter=n.selectedCharacter),r.operator&&this.processOperator(e,t,r),r.motion&&this.processMotion(e,t,r),(r.motion||r.operator)&&this.evalInput(e,t),a.repeat=o||1,a.repeatIsExplicit=i,a.registerName=n.registerName,W(e),t.lastMotion=null,r.isEdit&&this.recordLastEdit(t,n,r),z[r.action](e,a,t)},processSearch:function(t,r,n){if(t.getSearchCursor){var o=n.searchArgs.forward,i=n.searchArgs.wholeWordOnly;Re(t).setReversed(!o);var a=o?"/":"?",s=Re(t).getQuery(),l=t.getScrollInfo();switch(n.searchArgs.querySrc){case"prompt":var c=B.macroModeState;if(c.isPlaying)f(p=c.replaySearchQueries.shift(),!0,!1);else je(t,{onClose:function(e){t.scrollTo(l.left,l.top),f(e,!0,!0);var r=B.macroModeState;r.isRecording&&function(e,t){if(e.isPlaying)return;var r=e.latestRegister,n=B.registerController.getRegister(r);n&&n.pushSearchQuery&&n.pushSearchQuery(t)}(r,e)},prefix:a,desc:_e,onKeyUp:function(r,n,i){var a,s,c,u=e.keyName(r);"Up"==u||"Down"==u?(a="Up"==u,s=r.target?r.target.selectionEnd:0,i(n=B.searchHistoryController.nextMatch(n,a)||""),s&&r.target&&(r.target.selectionEnd=r.target.selectionStart=Math.min(s,r.target.value.length))):"Left"!=u&&"Right"!=u&&"Ctrl"!=u&&"Alt"!=u&&"Shift"!=u&&B.searchHistoryController.reset();try{c=He(t,n,!0,!0)}catch(r){}c?t.scrollIntoView(Ve(t,!o,c),30):(De(t),t.scrollTo(l.left,l.top))},onKeyDown:function(r,n,o){var i=e.keyName(r);"Esc"==i||"Ctrl-C"==i||"Ctrl-["==i||"Backspace"==i&&""==n?(B.searchHistoryController.pushInput(n),B.searchHistoryController.reset(),He(t,s),De(t),t.scrollTo(l.left,l.top),e.e_stop(r),W(t),o(),t.focus()):"Up"==i||"Down"==i?e.e_stop(r):"Ctrl-U"==i&&(e.e_stop(r),o(""))}});break;case"wordUnderCursor":var u=ve(t,!1,!0,!1,!0),h=!0;if(u||(u=ve(t,!1,!0,!1,!1),h=!1),!u)return;var p=t.getLine(u.start.line).substring(u.start.ch,u.end.ch);p=h&&i?"\\b"+p+"\\b":p.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1"),B.jumpList.cachedCursor=t.getCursor(),t.setCursor(u.start),f(p,!0,!1)}}function f(e,o,i){B.searchHistoryController.pushInput(e),B.searchHistoryController.reset();try{He(t,e,o,i)}catch(r){return Pe(t,"Invalid regex: "+e),void W(t)}J.processMotion(t,r,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:n.searchArgs.toJumplist}})}},processEx:function(t,r,n){function o(e){B.exCommandHistoryController.pushInput(e),B.exCommandHistoryController.reset(),ze.processCommand(t,e)}function i(r,n,o){var i,a,s=e.keyName(r);("Esc"==s||"Ctrl-C"==s||"Ctrl-["==s||"Backspace"==s&&""==n)&&(B.exCommandHistoryController.pushInput(n),B.exCommandHistoryController.reset(),e.e_stop(r),W(t),o(),t.focus()),"Up"==s||"Down"==s?(e.e_stop(r),i="Up"==s,a=r.target?r.target.selectionEnd:0,o(n=B.exCommandHistoryController.nextMatch(n,i)||""),a&&r.target&&(r.target.selectionEnd=r.target.selectionStart=Math.min(a,r.target.value.length))):"Ctrl-U"==s?(e.e_stop(r),o("")):"Left"!=s&&"Right"!=s&&"Ctrl"!=s&&"Alt"!=s&&"Shift"!=s&&B.exCommandHistoryController.reset()}"keyToEx"==n.type?ze.processCommand(t,n.exArgs.input):r.visualMode?je(t,{onClose:o,prefix:":",value:"'<,'>",onKeyDown:i,selectValueOnOpen:!1}):je(t,{onClose:o,prefix:":",onKeyDown:i})},evalInput:function(e,t){var r,n,i,a=t.inputState,s=a.motion,l=a.motionArgs||{},c=a.operator,u=a.operatorArgs||{},h=a.registerName,p=t.sel,f=te(t.visualMode?X(e,p.head):e.getCursor("head")),d=te(t.visualMode?X(e,p.anchor):e.getCursor("anchor")),m=te(f),g=te(d);if(c&&this.recordLastEdit(t,a),(i=void 0!==a.repeatOverride?a.repeatOverride:a.getRepeat())>0&&l.explicitRepeat?l.repeatIsExplicit=!0:(l.noRepeat||!l.explicitRepeat&&0===i)&&(i=1,l.repeatIsExplicit=!1),a.selectedCharacter&&(l.selectedCharacter=u.selectedCharacter=a.selectedCharacter),l.repeat=i,W(e),s){var v=$[s](e,f,l,t,a);if(t.lastMotion=$[s],!v)return;if(l.toJumplist){var y=B.jumpList,k=y.cachedCursor;k?(ye(e,k,v),delete y.cachedCursor):ye(e,f,v)}v instanceof Array?(n=v[0],r=v[1]):r=v,r||(r=te(f)),t.visualMode?(t.visualBlock&&r.ch===1/0||(r=X(e,r)),n&&(n=X(e,n)),n=n||g,p.anchor=n,p.head=r,fe(e),Ae(e,t,"<",ne(n,r)?n:r),Ae(e,t,">",ne(n,r)?r:n)):c||(r=X(e,r),e.setCursor(r.line,r.ch))}if(c){if(u.lastSel){n=g;var C=u.lastSel,w=Math.abs(C.head.line-C.anchor.line),x=Math.abs(C.head.ch-C.anchor.ch);r=C.visualLine?o(g.line+w,g.ch):C.visualBlock?o(g.line+w,g.ch+x):C.head.line==C.anchor.line?o(g.line,g.ch+x):o(g.line+w,g.ch),t.visualMode=!0,t.visualLine=C.visualLine,t.visualBlock=C.visualBlock,p=t.sel={anchor:n,head:r},fe(e)}else t.visualMode&&(u.lastSel={anchor:te(p.anchor),head:te(p.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var M,S,b,L,T;if(t.visualMode){if(M=oe(p.head,p.anchor),S=ie(p.head,p.anchor),b=t.visualLine||u.linewise,T=de(e,{anchor:M,head:S},L=t.visualBlock?"block":b?"line":"char"),b){var R=T.ranges;if("block"==L)for(var E=0;E<R.length;E++)R[E].head.ch=se(e,R[E].head.line);else"line"==L&&(R[0].head=o(R[0].head.line+1,0))}}else{if(M=te(n||g),ne(S=te(r||m),M)){var O=M;M=S,S=O}(b=l.linewise||u.linewise)?function(e,t,r){t.ch=0,r.ch=0,r.line++}(0,M,S):l.forward&&function(e,t,r){var n=e.getRange(t,r);if(/\n\s*$/.test(n)){var o=n.split("\n");o.pop();for(var i=o.pop();o.length>0&&i&&A(i);i=o.pop())r.line--,r.ch=0;i?(r.line--,r.ch=se(e,r.line)):r.ch=0}}(e,M,S),T=de(e,{anchor:M,head:S},L="char",!l.inclusive||b)}e.setSelections(T.ranges,T.primary),t.lastMotion=null,u.repeat=i,u.registerName=h,u.linewise=b;var I=Q[c](e,u,T.ranges,g,r);t.visualMode&&me(e,null!=I),I&&e.setCursor(I)}},recordLastEdit:function(e,t,r){var n=B.macroModeState;n.isPlaying||(e.lastEditInputState=t,e.lastEditActionCommand=r,n.lastInsertModeChanges.changes=[],n.lastInsertModeChanges.expectCursorActivityForChange=!1,n.lastInsertModeChanges.visualBlock=e.visualBlock?e.sel.head.line-e.sel.anchor.line:0)}},$={moveToTopLine:function(e,t,r){var n=Ue(e).top+r.repeat-1;return o(n,ge(e.getLine(n)))},moveToMiddleLine:function(e){var t=Ue(e),r=Math.floor(.5*(t.top+t.bottom));return o(r,ge(e.getLine(r)))},moveToBottomLine:function(e,t,r){var n=Ue(e).bottom-r.repeat+1;return o(n,ge(e.getLine(n)))},expandToLine:function(e,t,r){return o(t.line+r.repeat-1,1/0)},findNext:function(e,t,r){var n=Re(e),o=n.getQuery();if(o){var i=!r.forward;return i=n.isReversed()?!i:i,We(e,o),Ve(e,i,o,r.repeat)}},findAndSelectNextInclusive:function(t,r,n,i,a){var s=Re(t),l=s.getQuery();if(l){var c=!n.forward,u=function(e,t,r,n,i){void 0===n&&(n=1);return e.operation((function(){var a=e.getCursor(),s=e.getSearchCursor(r,a),l=s.find(!t);!i.visualMode&&l&&re(s.from(),a)&&s.find(!t);for(var c=0;c<n;c++)if(!(l=s.find(t))&&!(s=e.getSearchCursor(r,t?o(e.lastLine()):o(e.firstLine(),0))).find(t))return;return[s.from(),s.to()]}))}(t,c=s.isReversed()?!c:c,l,n.repeat,i);if(u){if(a.operator)return u;var h=u[0],p=o(u[1].line,u[1].ch-1);if(i.visualMode){(i.visualLine||i.visualBlock)&&(i.visualLine=!1,i.visualBlock=!1,e.signal(t,"vim-mode-change",{mode:"visual",subMode:""}));var f=i.sel.anchor;if(f)return s.isReversed()?n.forward?[f,h]:[f,p]:n.forward?[f,p]:[f,h]}else i.visualMode=!0,i.visualLine=!1,i.visualBlock=!1,e.signal(t,"vim-mode-change",{mode:"visual",subMode:""});return c?[p,h]:[h,p]}}},goToMark:function(e,t,r,n){var o=Je(e,n,r.selectedCharacter);return o?r.linewise?{line:o.line,ch:ge(e.getLine(o.line))}:o:null},moveToOtherHighlightedEnd:function(e,t,r,n){if(n.visualBlock&&r.sameLine){var i=n.sel;return[X(e,o(i.anchor.line,i.head.ch)),X(e,o(i.head.line,i.anchor.ch))]}return[n.sel.head,n.sel.anchor]},jumpToMark:function(e,t,r,n){for(var i=t,a=0;a<r.repeat;a++){var s=i;for(var l in n.marks)if(M(l)){var c=n.marks[l].find();if(!((r.forward?ne(c,s):ne(s,c))||r.linewise&&c.line==s.line)){var u=re(s,i),h=r.forward?ae(s,c,i):ae(i,c,s);(u||h)&&(i=c)}}}return r.linewise&&(i=o(i.line,ge(e.getLine(i.line)))),i},moveByCharacters:function(e,t,r){var n=t,i=r.repeat,a=r.forward?n.ch+i:n.ch-i;return o(n.line,a)},moveByLines:function(e,t,r,n){var i=t,a=i.ch;switch(n.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:a=n.lastHPos;break;default:n.lastHPos=a}var s=r.repeat+(r.repeatOffset||0),l=r.forward?i.line+s:i.line-s,c=e.firstLine(),u=e.lastLine(),h=e.findPosV(i,r.forward?s:-s,"line",n.lastHSPos);return(r.forward?h.line>l:h.line<l)&&(l=h.line,a=h.ch),l<c&&i.line==c?this.moveToStartOfLine(e,t,r,n):l>u&&i.line==u?Me(e,t,r,n,!0):(r.toFirstChar&&(a=ge(e.getLine(l)),n.lastHPos=a),n.lastHSPos=e.charCoords(o(l,a),"div").left,o(l,a))},moveByDisplayLines:function(e,t,r,n){var i=t;switch(n.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:n.lastHSPos=e.charCoords(i,"div").left}var a=r.repeat;if((l=e.findPosV(i,r.forward?a:-a,"line",n.lastHSPos)).hitSide)if(r.forward)var s={top:e.charCoords(l,"div").top+8,left:n.lastHSPos},l=e.coordsChar(s,"div");else{var c=e.charCoords(o(e.firstLine(),0),"div");c.left=n.lastHSPos,l=e.coordsChar(c,"div")}return n.lastHPos=l.ch,l},moveByPage:function(e,t,r){var n=t,o=r.repeat;return e.findPosV(n,r.forward?o:-o,"page")},moveByParagraph:function(e,t,r){var n=r.forward?1:-1;return Le(e,t,r.repeat,n)},moveBySentence:function(e,t,r){var n=r.forward?1:-1;return function(e,t,r,n){function i(e,t){if(t.pos+t.dir<0||t.pos+t.dir>=t.line.length){if(t.ln+=t.dir,!x(e,t.ln))return t.line=null,t.ln=null,void(t.pos=null);t.line=e.getLine(t.ln),t.pos=t.dir>0?0:t.line.length-1}else t.pos+=t.dir}function a(e,t,r,n){var o=""===(c=e.getLine(t)),a={line:c,ln:t,pos:r,dir:n},s={ln:a.ln,pos:a.pos},l=""===a.line;for(i(e,a);null!==a.line;){if(s.ln=a.ln,s.pos=a.pos,""===a.line&&!l)return{ln:a.ln,pos:a.pos};if(o&&""!==a.line&&!A(a.line[a.pos]))return{ln:a.ln,pos:a.pos};!b(a.line[a.pos])||o||a.pos!==a.line.length-1&&!A(a.line[a.pos+1])||(o=!0),i(e,a)}var c=e.getLine(s.ln);s.pos=0;for(var u=c.length-1;u>=0;--u)if(!A(c[u])){s.pos=u;break}return s}function s(e,t,r,n){var o={line:l=e.getLine(t),ln:t,pos:r,dir:n},a={ln:o.ln,pos:null},s=""===o.line;for(i(e,o);null!==o.line;){if(""===o.line&&!s)return null!==a.pos?a:{ln:o.ln,pos:o.pos};if(b(o.line[o.pos])&&null!==a.pos&&(o.ln!==a.ln||o.pos+1!==a.pos))return a;""===o.line||A(o.line[o.pos])||(s=!1,a={ln:o.ln,pos:o.pos}),i(e,o)}var l=e.getLine(a.ln);a.pos=0;for(var c=0;c<l.length;++c)if(!A(l[c])){a.pos=c;break}return a}var l={ln:t.line,pos:t.ch};for(;r>0;)l=n<0?s(e,l.ln,l.pos,n):a(e,l.ln,l.pos,n),r--;return o(l.ln,l.pos)}(e,t,r.repeat,n)},moveByScroll:function(e,t,r,n){var o=e.getScrollInfo(),i=null,a=r.repeat;a||(a=o.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,"local");if(r.repeat=a,!(i=$.moveByDisplayLines(e,t,r,n)))return null;var l=e.charCoords(i,"local");return e.scrollTo(null,o.top+l.top-s.top),i},moveByWords:function(e,t,r){return function(e,t,r,n,i,a){var s=te(t),l=[];(n&&!i||!n&&i)&&r++;for(var c=!(n&&i),u=0;u<r;u++){var h=xe(e,t,n,a,c);if(!h){var p=se(e,e.lastLine());l.push(n?{line:e.lastLine(),from:p,to:p}:{line:0,from:0,to:0});break}l.push(h),t=o(h.line,n?h.to-1:h.from)}var f=l.length!=r,d=l[0],m=l.pop();return n&&!i?(f||d.from==s.ch&&d.line==s.line||(m=l.pop()),o(m.line,m.from)):n&&i?o(m.line,m.to-1):!n&&i?(f||d.to==s.ch&&d.line==s.line||(m=l.pop()),o(m.line,m.to)):o(m.line,m.from)}(e,t,r.repeat,!!r.forward,!!r.wordEnd,!!r.bigWord)},moveTillCharacter:function(e,t,r){var n=Se(e,r.repeat,r.forward,r.selectedCharacter),o=r.forward?-1:1;return ke(o,r),n?(n.ch+=o,n):null},moveToCharacter:function(e,t,r){var n=r.repeat;return ke(0,r),Se(e,n,r.forward,r.selectedCharacter)||t},moveToSymbol:function(e,t,r){return function(e,t,r,n){var i=te(e.getCursor()),a=r?1:-1,s=r?e.lineCount():-1,l=i.ch,c=i.line,u=e.getLine(c),h={lineText:u,nextCh:u.charAt(l),lastCh:null,index:l,symb:n,reverseSymb:(r?{")":"(","}":"{"}:{"(":")","{":"}"})[n],forward:r,depth:0,curMoveThrough:!1},p=Ce[n];if(!p)return i;var f=we[p].init,d=we[p].isComplete;f&&f(h);for(;c!==s&&t;){if(h.index+=a,h.nextCh=h.lineText.charAt(h.index),!h.nextCh){if(c+=a,h.lineText=e.getLine(c)||"",a>0)h.index=0;else{var m=h.lineText.length;h.index=m>0?m-1:0}h.nextCh=h.lineText.charAt(h.index)}d(h)&&(i.line=c,i.ch=h.index,t--)}if(h.nextCh||h.curMoveThrough)return o(c,h.index);return i}(e,r.repeat,r.forward,r.selectedCharacter)||t},moveToColumn:function(e,t,r,n){var i=r.repeat;return n.lastHPos=i-1,n.lastHSPos=e.charCoords(t,"div").left,function(e,t){var r=e.getCursor().line;return X(e,o(r,t-1))}(e,i)},moveToEol:function(e,t,r,n){return Me(e,t,r,n,!1)},moveToFirstNonWhiteSpaceCharacter:function(e,t){var r=t;return o(r.line,ge(e.getLine(r.line)))},moveToMatchedSymbol:function(e,t){for(var r,n=t,i=n.line,a=n.ch,s=e.getLine(i);a<s.length;a++)if((r=s.charAt(a))&&-1!="()[]{}".indexOf(r)){var l=e.getTokenTypeAt(o(i,a+1));if("string"!==l&&"comment"!==l)break}if(a<s.length){var c="<"===a||">"===a?/[(){}[\]<>]/:/[(){}[\]]/;return e.findMatchingBracket(o(i,a),{bracketRegex:c}).to}return n},moveToStartOfLine:function(e,t){return o(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,r){var n=r.forward?e.lastLine():e.firstLine();return r.repeatIsExplicit&&(n=r.repeat-e.getOption("firstLineNumber")),o(n,ge(e.getLine(n)))},textObjectManipulation:function(t,r,n,i){var a=n.selectedCharacter;"b"==a?a="(":"B"==a&&(a="{");var s,l=!n.textObjectInner;if({"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"}[a])s=function(e,t,r,n){var i,a,s=t,l={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[r],c={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[r],u=e.getLine(s.line).charAt(s.ch)===c?1:0;if(i=e.scanForBracket(o(s.line,s.ch+u),-1,void 0,{bracketRegex:l}),a=e.scanForBracket(o(s.line,s.ch+u),1,void 0,{bracketRegex:l}),!i||!a)return{start:s,end:s};if(i=i.pos,a=a.pos,i.line==a.line&&i.ch>a.ch||i.line>a.line){var h=i;i=a,a=h}n?a.ch+=1:i.ch+=1;return{start:i,end:a}}(t,r,a,l);else if({"'":!0,'"':!0,"`":!0}[a])s=function(e,t,r,n){var i,a,s,l,c=te(t),u=e.getLine(c.line).split(""),h=u.indexOf(r);c.ch<h?c.ch=h:h<c.ch&&u[c.ch]==r&&(a=c.ch,--c.ch);if(u[c.ch]!=r||a)for(s=c.ch;s>-1&&!i;s--)u[s]==r&&(i=s+1);else i=c.ch+1;if(i&&!a)for(s=i,l=u.length;s<l&&!a;s++)u[s]==r&&(a=s);if(!i||!a)return{start:c,end:c};n&&(--i,++a);return{start:o(c.line,i),end:o(c.line,a)}}(t,r,a,l);else if("W"===a)s=ve(t,l,!0,!0);else if("w"===a)s=ve(t,l,!0,!1);else if("p"===a)if(s=Le(t,r,n.repeat,0,l),n.linewise=!0,i.visualMode)i.visualLine||(i.visualLine=!0);else{var c=i.inputState.operatorArgs;c&&(c.linewise=!0),s.end.line--}else{if("t"!==a)return null;s=function(t,r,n){var o=r;if(!e.findMatchingTag||!e.findEnclosingTag)return{start:o,end:o};var i=e.findMatchingTag(t,r)||e.findEnclosingTag(t,r);if(!i||!i.open||!i.close)return{start:o,end:o};if(n)return{start:i.open.from,end:i.close.to};return{start:i.open.to,end:i.close.from}}(t,r,l)}return t.state.vim.visualMode?function(e,t,r){var n,i=e.state.vim.sel,a=i.head,s=i.anchor;ne(r,t)&&(n=r,r=t,t=n);ne(a,s)?(a=oe(t,a),s=ie(s,r)):(s=oe(t,s),-1==(a=G(a=ie(a,r),0,-1)).ch&&a.line!=e.firstLine()&&(a=o(a.line-1,se(e,a.line-1))));return[s,a]}(t,s.start,s.end):[s.start,s.end]},repeatLastCharacterSearch:function(e,t,r){var n=B.lastCharacterSearch,o=r.repeat,i=r.forward===n.forward,a=(n.increment?1:0)*(i?-1:1);e.moveH(-a,"char"),r.inclusive=!!i;var s=Se(e,o,i,n.selectedCharacter);return s?(s.ch+=a,s):(e.moveH(a,"char"),t)}};function q(e,t){for(var r=[],n=0;n<t;n++)r.push(e);return r}var Q={change:function(t,r,n){var i,a,s=t.state.vim,l=n[0].anchor,c=n[0].head;if(s.visualMode)if(r.fullLine)c.ch=Number.MAX_VALUE,c.line--,t.setSelection(l,c),a=t.getSelection(),t.replaceSelection(""),i=l;else{a=t.getSelection();var u=q("",n.length);t.replaceSelections(u),i=oe(n[0].head,n[0].anchor)}else{a=t.getRange(l,c);var h=s.lastEditInputState||{};if("moveByWords"==h.motion&&!A(a)){var p=/\s+$/.exec(a);p&&h.motionArgs&&h.motionArgs.forward&&(c=G(c,0,-p[0].length),a=a.slice(0,-p[0].length))}var f=new o(l.line-1,Number.MAX_VALUE),d=t.firstLine()==t.lastLine();c.line>t.lastLine()&&r.linewise&&!d?t.replaceRange("",f,c):t.replaceRange("",l,c),r.linewise&&(d||(t.setCursor(f),e.commands.newlineAndIndent(t)),l.ch=Number.MAX_VALUE),i=l}B.registerController.pushText(r.registerName,"change",a,r.linewise,n.length>1),z.enterInsertMode(t,{head:i},t.state.vim)},delete:function(e,t,r){var n,i,a=e.state.vim;if(a.visualBlock){i=e.getSelection();var s=q("",r.length);e.replaceSelections(s),n=r[0].anchor}else{var l=r[0].anchor,c=r[0].head;t.linewise&&c.line!=e.firstLine()&&l.line==e.lastLine()&&l.line==c.line-1&&(l.line==e.firstLine()?l.ch=0:l=o(l.line-1,se(e,l.line-1))),i=e.getRange(l,c),e.replaceRange("",l,c),n=l,t.linewise&&(n=$.moveToFirstNonWhiteSpaceCharacter(e,l))}return B.registerController.pushText(t.registerName,"delete",i,t.linewise,a.visualBlock),X(e,n)},indent:function(e,t,r){var n=e.state.vim,o=r[0].anchor.line,i=n.visualBlock?r[r.length-1].anchor.line:r[0].head.line,a=n.visualMode?t.repeat:1;t.linewise&&i--;for(var s=o;s<=i;s++)for(var l=0;l<a;l++)e.indentLine(s,t.indentRight);return $.moveToFirstNonWhiteSpaceCharacter(e,r[0].anchor)},indentAuto:function(e,t,r){return e.execCommand("indentAuto"),$.moveToFirstNonWhiteSpaceCharacter(e,r[0].anchor)},changeCase:function(e,t,r,n,o){for(var i=e.getSelections(),a=[],s=t.toLower,l=0;l<i.length;l++){var c=i[l],u="";if(!0===s)u=c.toLowerCase();else if(!1===s)u=c.toUpperCase();else for(var h=0;h<c.length;h++){var p=c.charAt(h);u+=S(p)?p.toLowerCase():p.toUpperCase()}a.push(u)}return e.replaceSelections(a),t.shouldMoveCursor?o:!e.state.vim.visualMode&&t.linewise&&r[0].anchor.line+1==r[0].head.line?$.moveToFirstNonWhiteSpaceCharacter(e,n):t.linewise?n:oe(r[0].anchor,r[0].head)},yank:function(e,t,r,n){var o=e.state.vim,i=e.getSelection(),a=o.visualMode?oe(o.sel.anchor,o.sel.head,r[0].head,r[0].anchor):n;return B.registerController.pushText(t.registerName,"yank",i,t.linewise,o.visualBlock),a}};var z={jumpListWalk:function(e,t,r){if(!r.visualMode){var n=t.repeat,o=t.forward,i=B.jumpList.move(e,o?n:-n),a=i?i.find():void 0;a=a||e.getCursor(),e.setCursor(a)}},scroll:function(e,t,r){if(!r.visualMode){var n=t.repeat||1,o=e.defaultTextHeight(),i=e.getScrollInfo().top,a=o*n,s=t.forward?i+a:i-a,l=te(e.getCursor()),c=e.charCoords(l,"local");if(t.forward)s>c.top?(l.line+=(s-c.top)/o,l.line=Math.ceil(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.top)):e.scrollTo(null,s);else{var u=s+e.getScrollInfo().clientHeight;u<c.bottom?(l.line-=(c.bottom-u)/o,l.line=Math.floor(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.bottom-e.getScrollInfo().clientHeight)):e.scrollTo(null,s)}}},scrollToCursor:function(e,t){var r=e.getCursor().line,n=e.charCoords(o(r,0),"local"),i=e.getScrollInfo().clientHeight,a=n.top,s=n.bottom-a;switch(t.position){case"center":a=a-i/2+s;break;case"bottom":a=a-i+s}e.scrollTo(null,a)},replayMacro:function(e,t,r){var n=t.selectedCharacter,o=t.repeat,i=B.macroModeState;for("@"==n?n=i.latestRegister:i.latestRegister=n;o--;)Ge(e,r,i,n)},enterMacroRecordMode:function(e,t){var r=B.macroModeState,n=t.selectedCharacter;B.registerController.isValidRegister(n)&&r.enterMacroRecordMode(e,n)},toggleOverwrite:function(t){t.state.overwrite?(t.toggleOverwrite(!1),t.setOption("keyMap","vim-insert"),e.signal(t,"vim-mode-change",{mode:"insert"})):(t.toggleOverwrite(!0),t.setOption("keyMap","vim-replace"),e.signal(t,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(t,r,n){if(!t.getOption("readOnly")){n.insertMode=!0,n.insertModeRepeat=r&&r.repeat||1;var i=r?r.insertAt:null,a=n.sel,s=r.head||t.getCursor("head"),l=t.listSelections().length;if("eol"==i)s=o(s.line,se(t,s.line));else if("bol"==i)s=o(s.line,0);else if("charAfter"==i)s=G(s,0,1);else if("firstNonBlank"==i)s=$.moveToFirstNonWhiteSpaceCharacter(t,s);else if("startOfSelectedArea"==i){if(!n.visualMode)return;n.visualBlock?(s=o(Math.min(a.head.line,a.anchor.line),Math.min(a.head.ch,a.anchor.ch)),l=Math.abs(a.head.line-a.anchor.line)+1):s=a.head.line<a.anchor.line?a.head:o(a.anchor.line,0)}else if("endOfSelectedArea"==i){if(!n.visualMode)return;n.visualBlock?(s=o(Math.min(a.head.line,a.anchor.line),Math.max(a.head.ch+1,a.anchor.ch)),l=Math.abs(a.head.line-a.anchor.line)+1):s=a.head.line>=a.anchor.line?G(a.head,0,1):o(a.anchor.line,0)}else if("inplace"==i){if(n.visualMode)return}else"lastEdit"==i&&(s=$e(t)||s);t.setOption("disableInput",!1),r&&r.replace?(t.toggleOverwrite(!0),t.setOption("keyMap","vim-replace"),e.signal(t,"vim-mode-change",{mode:"replace"})):(t.toggleOverwrite(!1),t.setOption("keyMap","vim-insert"),e.signal(t,"vim-mode-change",{mode:"insert"})),B.macroModeState.isPlaying||(t.on("change",Ye),e.on(t.getInputField(),"keydown",ot)),n.visualMode&&me(t),he(t,s,l)}},toggleVisualMode:function(t,r,n){var i,a=r.repeat,s=t.getCursor();n.visualMode?n.visualLine^r.linewise||n.visualBlock^r.blockwise?(n.visualLine=!!r.linewise,n.visualBlock=!!r.blockwise,e.signal(t,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""}),fe(t)):me(t):(n.visualMode=!0,n.visualLine=!!r.linewise,n.visualBlock=!!r.blockwise,i=X(t,o(s.line,s.ch+a-1)),n.sel={anchor:s,head:i},e.signal(t,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""}),fe(t),Ae(t,n,"<",oe(s,i)),Ae(t,n,">",ie(s,i)))},reselectLastSelection:function(t,r,n){var o=n.lastSelection;if(n.visualMode&&pe(t,n),o){var i=o.anchorMark.find(),a=o.headMark.find();if(!i||!a)return;n.sel={anchor:i,head:a},n.visualMode=!0,n.visualLine=o.visualLine,n.visualBlock=o.visualBlock,fe(t),Ae(t,n,"<",oe(i,a)),Ae(t,n,">",ie(i,a)),e.signal(t,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""})}},joinLines:function(e,t,r){var n,i;if(r.visualMode){if(n=e.getCursor("anchor"),ne(i=e.getCursor("head"),n)){var a=i;i=n,n=a}i.ch=se(e,i.line)-1}else{var s=Math.max(t.repeat,2);n=e.getCursor(),i=X(e,o(n.line+s-1,1/0))}for(var l=0,c=n.line;c<i.line;c++){l=se(e,n.line);a=o(n.line+1,se(e,n.line+1));var u=e.getRange(n,a);u=t.keepSpaces?u.replace(/\n\r?/g,""):u.replace(/\n\s*/g," "),e.replaceRange(u,n,a)}var h=o(n.line,l);r.visualMode&&me(e,!1),e.setCursor(h)},newLineAndEnterInsertMode:function(t,r,n){n.insertMode=!0;var i=te(t.getCursor());i.line!==t.firstLine()||r.after?(i.line=r.after?i.line:i.line-1,i.ch=se(t,i.line),t.setCursor(i),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(t)):(t.replaceRange("\n",o(t.firstLine(),0)),t.setCursor(t.firstLine(),0));this.enterInsertMode(t,{repeat:r.repeat},n)},paste:function(e,t,r){var n=te(e.getCursor()),i=B.registerController.getRegister(t.registerName);if(f=i.toString()){if(t.matchIndent){var a=e.getOption("tabSize"),s=function(e){var t=e.split("\t").length-1,r=e.split(" ").length-1;return t*a+1*r},l=e.getLine(e.getCursor().line),c=s(l.match(/^\s*/)[0]),u=f.replace(/\n$/,""),h=f!==u,p=s(f.match(/^\s*/)[0]),f=u.replace(/^\s*/gm,(function(t){var r=c+(s(t)-p);if(r<0)return"";if(e.getOption("indentWithTabs")){var n=Math.floor(r/a);return Array(n+1).join("\t")}return Array(r+1).join(" ")}));f+=h?"\n":""}if(t.repeat>1)f=Array(t.repeat+1).join(f);var d,m,g=i.linewise,v=i.blockwise;if(v){f=f.split("\n"),g&&f.pop();for(var y=0;y<f.length;y++)f[y]=""==f[y]?" ":f[y];n.ch+=t.after?1:0,n.ch=Math.min(se(e,n.line),n.ch)}else g?r.visualMode?f=r.visualLine?f.slice(0,-1):"\n"+f.slice(0,f.length-1)+"\n":t.after?(f="\n"+f.slice(0,f.length-1),n.ch=se(e,n.line)):n.ch=0:n.ch+=t.after?1:0;if(r.visualMode){var k;r.lastPastedText=f;var C=function(e,t){var r=t.lastSelection;return t.visualMode?function(){var t=e.listSelections(),r=t[0],n=t[t.length-1];return[ne(r.anchor,r.head)?r.anchor:r.head,ne(n.anchor,n.head)?n.head:n.anchor]}():function(){var t=e.getCursor(),n=e.getCursor(),i=r.visualBlock;if(i){var a=i.width,s=i.height;n=o(t.line+s,t.ch+a);for(var l=[],c=t.line;c<n.line;c++){var u={anchor:o(c,t.ch),head:o(c,n.ch)};l.push(u)}e.setSelections(l)}else{var h=r.anchorMark.find(),p=r.headMark.find(),f=p.line-h.line,d=p.ch-h.ch;n={line:n.line+f,ch:f?n.ch:d+n.ch},r.visualLine&&(t=o(t.line,0),n=o(n.line,se(e,n.line))),e.setSelection(t,n)}return[t,n]}()}(e,r),w=C[0],x=C[1],M=e.getSelection(),S=e.listSelections(),A=new Array(S.length).join("1").split("1");r.lastSelection&&(k=r.lastSelection.headMark.find()),B.registerController.unnamedRegister.setText(M),v?(e.replaceSelections(A),x=o(w.line+f.length-1,w.ch),e.setCursor(w),ue(e,x),e.replaceSelections(f),d=w):r.visualBlock?(e.replaceSelections(A),e.setCursor(w),e.replaceRange(f,w,w),d=w):(e.replaceRange(f,w,x),d=e.posFromIndex(e.indexFromPos(w)+f.length-1)),k&&(r.lastSelection.headMark=e.setBookmark(k)),g&&(d.ch=0)}else if(v){e.setCursor(n);for(y=0;y<f.length;y++){var b=n.line+y;b>e.lastLine()&&e.replaceRange("\n",o(b,0)),se(e,b)<n.ch&&ce(e,b,n.ch)}e.setCursor(n),ue(e,o(n.line+f.length-1,n.ch)),e.replaceSelections(f),d=n}else e.replaceRange(f,n),g&&t.after?d=o(n.line+1,ge(e.getLine(n.line+1))):g&&!t.after?d=o(n.line,ge(e.getLine(n.line))):!g&&t.after?(m=e.indexFromPos(n),d=e.posFromIndex(m+f.length-1)):(m=e.indexFromPos(n),d=e.posFromIndex(m+f.length));r.visualMode&&me(e,!1),e.setCursor(d)}},undo:function(t,r){t.operation((function(){ee(t,e.commands.undo,r.repeat)(),t.setCursor(t.getCursor("anchor"))}))},redo:function(t,r){ee(t,e.commands.redo,r.repeat)()},setRegister:function(e,t,r){r.inputState.registerName=t.selectedCharacter},setMark:function(e,t,r){Ae(e,r,t.selectedCharacter,e.getCursor())},replace:function(t,r,n){var i,a,s=r.selectedCharacter,l=t.getCursor(),c=t.listSelections();if(n.visualMode)l=t.getCursor("start"),a=t.getCursor("end");else{var u=t.getLine(l.line);(i=l.ch+r.repeat)>u.length&&(i=u.length),a=o(l.line,i)}if("\n"==s)n.visualMode||t.replaceRange("",l,a),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(t);else{var h=t.getRange(l,a);if(h=h.replace(/[^\n]/g,s),n.visualBlock){var p=new Array(t.getOption("tabSize")+1).join(" ");h=(h=t.getSelection()).replace(/\t/g,p).replace(/[^\n]/g,s).split("\n"),t.replaceSelections(h)}else t.replaceRange(h,l,a);n.visualMode?(l=ne(c[0].anchor,c[0].head)?c[0].anchor:c[0].head,t.setCursor(l),me(t,!1)):t.setCursor(G(a,0,-1))}},incrementNumberToken:function(e,t){for(var r,n,i,a,s=e.getCursor(),l=e.getLine(s.line),c=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;null!==(r=c.exec(l))&&(i=(n=r.index)+r[0].length,!(s.ch<i)););if((t.backtrack||!(i<=s.ch))&&r){var u=r[2]||r[4],h=r[3]||r[5],p=t.increase?1:-1,f={"0b":2,0:8,"":10,"0x":16}[u.toLowerCase()];a=(parseInt(r[1]+h,f)+p*t.repeat).toString(f);var d=u?new Array(h.length-a.length+1+r[1].length).join("0"):"";a="-"===a.charAt(0)?"-"+u+d+a.substr(1):u+d+a;var m=o(s.line,n),g=o(s.line,i);e.replaceRange(a,m,g),e.setCursor(o(s.line,n+a.length-1))}},repeatLastEdit:function(e,t,r){if(r.lastEditInputState){var n=t.repeat;n&&t.repeatIsExplicit?r.lastEditInputState.repeatOverride=n:n=r.lastEditInputState.repeatOverride||n,it(e,r,n,!1)}},indent:function(e,t){e.indentLine(e.getCursor().line,t.indentRight)},exitInsertMode:Xe};function X(e,t){var r=e.state.vim,n=r.insertMode||r.visualMode,i=Math.min(Math.max(e.firstLine(),t.line),e.lastLine()),a=se(e,i)-1+!!n,s=Math.min(Math.max(0,t.ch),a);return o(i,s)}function Z(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function G(e,t,r){return"object"==typeof t&&(r=t.ch,t=t.line),o(e.line+t,e.ch+r)}function Y(e,t){if("<character>"==t.slice(-11)){var r=t.length-11,n=e.slice(0,r),o=t.slice(0,r);return n==o&&e.length>r?"full":0==o.indexOf(n)&&"partial"}return e==t?"full":0==t.indexOf(e)&&"partial"}function ee(e,t,r){return function(){for(var n=0;n<r;n++)t(e)}}function te(e){return o(e.line,e.ch)}function re(e,t){return e.ch==t.ch&&e.line==t.line}function ne(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function oe(e,t){return arguments.length>2&&(t=oe.apply(void 0,Array.prototype.slice.call(arguments,1))),ne(e,t)?e:t}function ie(e,t){return arguments.length>2&&(t=ie.apply(void 0,Array.prototype.slice.call(arguments,1))),ne(e,t)?t:e}function ae(e,t,r){var n=ne(e,t),o=ne(t,r);return n&&o}function se(e,t){return e.getLine(t).length}function le(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function ce(e,t,r){var n=se(e,t),i=new Array(r-n+1).join(" ");e.setCursor(o(t,n)),e.replaceRange(i,e.getCursor())}function ue(e,t){var r=[],n=e.listSelections(),i=te(e.clipPos(t)),a=!re(t,i),s=function(e,t,r){for(var n=0;n<e.length;n++){var o="head"!=r&&re(e[n].anchor,t),i="anchor"!=r&&re(e[n].head,t);if(o||i)return n}return-1}(n,e.getCursor("head")),l=re(n[s].head,n[s].anchor),c=n.length-1,u=c-s>s?c:0,h=n[u].anchor,p=Math.min(h.line,i.line),f=Math.max(h.line,i.line),d=h.ch,m=i.ch,g=n[u].head.ch-d,v=m-d;g>0&&v<=0?(d++,a||m--):g<0&&v>=0?(d--,l||m++):g<0&&-1==v&&(d--,m++);for(var y=p;y<=f;y++){var k={anchor:new o(y,d),head:new o(y,m)};r.push(k)}return e.setSelections(r),t.ch=m,h.ch=d,h}function he(e,t,r){for(var n=[],o=0;o<r;o++){var i=G(t,o,0);n.push({anchor:i,head:i})}e.setSelections(n,0)}function pe(e,t){var r=t.sel.anchor,n=t.sel.head;t.lastPastedText&&(n=e.posFromIndex(e.indexFromPos(r)+t.lastPastedText.length),t.lastPastedText=null),t.lastSelection={anchorMark:e.setBookmark(r),headMark:e.setBookmark(n),anchor:te(r),head:te(n),visualMode:t.visualMode,visualLine:t.visualLine,visualBlock:t.visualBlock}}function fe(e,t,r){var n=e.state.vim,o=de(e,t=t||n.sel,r=r||n.visualLine?"line":n.visualBlock?"block":"char");e.setSelections(o.ranges,o.primary),tt(e)}function de(e,t,r,n){var i=te(t.head),a=te(t.anchor);if("char"==r){var s=n||ne(t.head,t.anchor)?0:1,l=ne(t.head,t.anchor)?1:0;return i=G(t.head,0,s),{ranges:[{anchor:a=G(t.anchor,0,l),head:i}],primary:0}}if("line"==r){if(ne(t.head,t.anchor))i.ch=0,a.ch=se(e,a.line);else{a.ch=0;var c=e.lastLine();i.line>c&&(i.line=c),i.ch=se(e,i.line)}return{ranges:[{anchor:a,head:i}],primary:0}}if("block"==r){for(var u=Math.min(a.line,i.line),h=Math.min(a.ch,i.ch),p=Math.max(a.line,i.line),f=Math.max(a.ch,i.ch)+1,d=p-u+1,m=i.line==u?0:d-1,g=[],v=0;v<d;v++)g.push({anchor:o(u+v,h),head:o(u+v,f)});return{ranges:g,primary:m}}}function me(t,r){var n=t.state.vim;!1!==r&&t.setCursor(X(t,n.sel.head)),pe(t,n),n.visualMode=!1,n.visualLine=!1,n.visualBlock=!1,n.insertMode||e.signal(t,"vim-mode-change",{mode:"normal"}),rt(n)}function ge(e){if(!e)return 0;var t=e.search(/\S/);return-1==t?e.length:t}function ve(e,t,r,n,i){for(var a=function(e){var t=e.getCursor("head");return 1==e.getSelection().length&&(t=oe(t,e.getCursor("anchor"))),t}(e),s=e.getLine(a.line),l=a.ch,c=i?d[0]:m[0];!c(s.charAt(l));)if(++l>=s.length)return null;n?c=m[0]:(c=d[0])(s.charAt(l))||(c=d[1]);for(var u=l,h=l;c(s.charAt(u))&&u<s.length;)u++;for(;c(s.charAt(h))&&h>=0;)h--;if(h++,t){for(var p=u;/\s/.test(s.charAt(u))&&u<s.length;)u++;if(p==u){for(var f=h;/\s/.test(s.charAt(h-1))&&h>0;)h--;h||(h=f)}}return{start:o(a.line,h),end:o(a.line,u)}}function ye(e,t,r){re(t,r)||B.jumpList.add(e,t,r)}function ke(e,t){B.lastCharacterSearch.increment=e,B.lastCharacterSearch.forward=t.forward,B.lastCharacterSearch.selectedCharacter=t.selectedCharacter}var Ce={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},we={bracket:{isComplete:function(e){if(e.nextCh===e.symb){if(e.depth++,e.depth>=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};function xe(e,t,r,n,o){var i=t.line,a=t.ch,s=e.getLine(i),l=r?1:-1,c=n?m:d;if(o&&""==s){if(i+=l,s=e.getLine(i),!x(e,i))return null;a=r?0:s.length}for(;;){if(o&&""==s)return{from:0,to:0,line:i};for(var u=l>0?s.length:-1,h=u,p=u;a!=u;){for(var f=!1,g=0;g<c.length&&!f;++g)if(c[g](s.charAt(a))){for(h=a;a!=u&&c[g](s.charAt(a));)a+=l;if(f=h!=(p=a),h==t.ch&&i==t.line&&p==h+l)continue;return{from:Math.min(h,p+1),to:Math.max(h,p),line:i}}f||(a+=l)}if(!x(e,i+=l))return null;s=e.getLine(i),a=l>0?0:s.length}}function Me(e,t,r,n,i){var a=o(t.line+r.repeat-1,1/0),s=e.clipPos(a);return s.ch--,i||(n.lastHPos=1/0,n.lastHSPos=e.charCoords(s,"div").left),a}function Se(e,t,r,n){for(var i,a=e.getCursor(),s=a.ch,l=0;l<t;l++){if(-1==(i=be(s,e.getLine(a.line),n,r,!0)))return null;s=i}return o(e.getCursor().line,i)}function Ae(e,t,r,n){L(r,C)&&(t.marks[r]&&t.marks[r].clear(),t.marks[r]=e.setBookmark(n))}function be(e,t,r,n,o){var i;return n?-1==(i=t.indexOf(r,e+1))||o||(i-=1):-1==(i=t.lastIndexOf(r,e-1))||o||(i+=1),i}function Le(e,t,r,n,i){var a,s=t.line,l=e.firstLine(),c=e.lastLine(),u=s;function h(t){return!e.getLine(t)}function p(e,t,r){return r?h(e)!=h(e+t):!h(e)&&h(e+t)}if(n){for(;l<=u&&u<=c&&r>0;)p(u,n)&&r--,u+=n;return new o(u,0)}var f=e.state.vim;if(f.visualLine&&p(s,1,!0)){var d=f.sel.anchor;p(d.line,-1,!0)&&(i&&d.line==s||(s+=1))}var m=h(s);for(u=s;u<=c&&r;u++)p(u,1,!0)&&(i&&h(u)==m||r--);for(a=new o(u,0),u>c&&!m?m=!0:i=!1,u=s;u>l&&(i&&h(u)!=m&&u!=s||!p(u,-1,!0));u--);return{start:new o(u,0),end:a}}function Te(){}function Re(e){var t=e.state.vim;return t.searchState_||(t.searchState_=new Te)}function Ee(e,t,r,n,o){e.openDialog?e.openDialog(t,n,{bottom:!0,value:o.value,onKeyDown:o.onKeyDown,onKeyUp:o.onKeyUp,selectValueOnOpen:!1}):n(prompt(r,""))}function Oe(e,t){var r=Be(e,t)||[];if(!r.length)return[];var n=[];if(0===r[0]){for(var o=0;o<r.length;o++)"number"==typeof r[o]&&n.push(e.substring(r[o]+1,r[o+1]));return n}}function Be(e,t){t||(t="/");for(var r=!1,n=[],o=0;o<e.length;o++){var i=e.charAt(o);r||i!=t||n.push(o),r=!r&&"\\"==i}return n}R("pcre",!0,"boolean"),Te.prototype={getQuery:function(){return B.query},setQuery:function(e){B.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return B.isReversed},setReversed:function(e){B.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var Ie={"\\n":"\n","\\r":"\r","\\t":"\t"};var Ke={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t","\\&":"&"};function Ne(e,t,r){if(B.registerController.getRegister("/").setText(e),e instanceof RegExp)return e;var n,o,i=Be(e,"/");i.length?(n=e.substring(0,i[0]),o=-1!=e.substring(i[0]).indexOf("i")):n=e;return n?(O("pcre")||(n=function(e){for(var t=!1,r=[],n=-1;n<e.length;n++){var o=e.charAt(n)||"",i=e.charAt(n+1)||"",a=i&&-1!="|(){".indexOf(i);t?("\\"===o&&a||r.push(o),t=!1):"\\"===o?(t=!0,i&&-1!="}".indexOf(i)&&(a=!0),a&&"\\"!==i||r.push(o)):(r.push(o),a&&"\\"!==i&&r.push("\\"))}return r.join("")}(n)),r&&(t=/^[^A-Z]*$/.test(n)),new RegExp(n,t||o?"i":void 0)):null}function Pe(e,t){e.openNotification?e.openNotification('<span style="color: red">'+t+"</span>",{bottom:!0,duration:5e3}):alert(t)}var _e="(Javascript regexp)";function je(e,t){var r,n,o,i=(t.prefix||"")+" "+(t.desc||"");Ee(e,(r=t.prefix,n=t.desc,o='<span style="font-family: monospace; white-space: pre">'+(r||"")+'<input type="text" autocorrect="off" autocapitalize="off" spellcheck="false"></span>',n&&(o+=' <span style="color: #888">'+n+"</span>"),o),i,t.onClose,t)}function He(e,t,r,n){if(t){var o=Re(e),i=Ne(t,!!r,!!n);if(i)return We(e,i),function(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var r=["global","multiline","ignoreCase","source"],n=0;n<r.length;n++){var o=r[n];if(e[o]!==t[o])return!1}return!0}return!1}(i,o.getQuery())?i:(o.setQuery(i),i)}}var Fe=0;function We(e,t){clearTimeout(Fe),Fe=setTimeout((function(){var r=Re(e),n=r.getOverlay();n&&t==n.query||(n&&e.removeOverlay(n),n=function(e){if("^"==e.source.charAt(0))var t=!0;return{token:function(r){if(!t||r.sol()){var n=r.match(e,!1);if(n)return 0==n[0].length?(r.next(),"searching"):r.sol()||(r.backUp(1),e.exec(r.next()+n[0]))?(r.match(e),"searching"):(r.next(),null);for(;!r.eol()&&(r.next(),!r.match(e,!1)););}else r.skipToEnd()},query:e}}(t),e.addOverlay(n),e.showMatchesOnScrollbar&&(r.getScrollbarAnnotate()&&r.getScrollbarAnnotate().clear(),r.setScrollbarAnnotate(e.showMatchesOnScrollbar(t))),r.setOverlay(n))}),50)}function Ve(e,t,r,n){return void 0===n&&(n=1),e.operation((function(){for(var i=e.getCursor(),a=e.getSearchCursor(r,i),s=0;s<n;s++){var l=a.find(t);if(0==s&&l&&re(a.from(),i)&&(l=a.find(t)),!l&&!(a=e.getSearchCursor(r,t?o(e.lastLine()):o(e.firstLine(),0))).find(t))return}return a.from()}))}function De(e){var t=Re(e);e.removeOverlay(Re(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function Ue(e){var t=e.getScrollInfo(),r=e.coordsChar({left:0,top:6+t.top},"local"),n=t.clientHeight-10+t.top,o=e.coordsChar({left:0,top:n},"local");return{top:r.line,bottom:o.line}}function Je(e,t,r){if("'"==r||"`"==r)return B.jumpList.find(e,-1)||o(0,0);if("."==r)return $e(e);var n=t.marks[r];return n&&n.find()}function $e(e){for(var t=e.doc.history.done,r=t.length;r--;)if(t[r].changes)return te(t[r].changes[0].to)}var qe=function(){this.buildCommandMap_()};qe.prototype={processCommand:function(e,t,r){var n=this;e.operation((function(){e.curOp.isVimOp=!0,n._processCommand(e,t,r)}))},_processCommand:function(t,r,n){var o=t.state.vim,i=B.registerController.getRegister(":"),a=i.toString();o.visualMode&&me(t);var s=new e.StringStream(r);i.setText(r);var l,c,u=n||{};u.input=r;try{this.parseInput_(t,s,u)}catch(e){throw Pe(t,e),e}if(u.commandName){if(l=this.matchCommand_(u.commandName)){if(c=l.name,l.excludeFromCommandHistory&&i.setText(a),this.parseCommandArgs_(s,u,l),"exToKey"==l.type){for(var h=0;h<l.toKeys.length;h++)e.Vim.handleKey(t,l.toKeys[h],"mapping");return}if("exToEx"==l.type)return void this.processCommand(t,l.toInput)}}else void 0!==u.line&&(c="move");if(c)try{Qe[c](t,u),l&&l.possiblyAsync||!u.callback||u.callback()}catch(e){throw Pe(t,e),e}else Pe(t,'Not an editor command ":'+r+'"')},parseInput_:function(e,t,r){t.eatWhile(":"),t.eat("%")?(r.line=e.firstLine(),r.lineEnd=e.lastLine()):(r.line=this.parseLineSpec_(e,t),void 0!==r.line&&t.eat(",")&&(r.lineEnd=this.parseLineSpec_(e,t)));var n=t.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return r.commandName=n?n[1]:t.match(/.*/)[0],r},parseLineSpec_:function(e,t){var r=t.match(/^(\d+)/);if(r)return parseInt(r[1],10)-1;switch(t.next()){case".":return this.parseLineSpecOffset_(t,e.getCursor().line);case"$":return this.parseLineSpecOffset_(t,e.lastLine());case"'":var n=t.next(),o=Je(e,e.state.vim,n);if(!o)throw new Error("Mark not set");return this.parseLineSpecOffset_(t,o.line);case"-":case"+":return t.backUp(1),this.parseLineSpecOffset_(t,e.getCursor().line);default:return void t.backUp(1)}},parseLineSpecOffset_:function(e,t){var r=e.match(/^([+-])?(\d+)/);if(r){var n=parseInt(r[2],10);"-"==r[1]?t-=n:t+=n}return t},parseCommandArgs_:function(e,t,r){if(!e.eol()){t.argString=e.match(/.*/)[0];var n=r.argDelimiter||/\s+/,o=le(t.argString).split(n);o.length&&o[0]&&(t.args=o)}},matchCommand_:function(e){for(var t=e.length;t>0;t--){var r=e.substring(0,t);if(this.commandMap_[r]){var n=this.commandMap_[r];if(0===n.name.indexOf(e))return n}}return null},buildCommandMap_:function(){this.commandMap_={};for(var e=0;e<n.length;e++){var t=n[e],r=t.shortName||t.name;this.commandMap_[r]=t}},map:function(e,r,n){if(":"!=e&&":"==e.charAt(0)){if(n)throw Error("Mode not supported for ex mappings");var o=e.substring(1);":"!=r&&":"==r.charAt(0)?this.commandMap_[o]={name:o,type:"exToEx",toInput:r.substring(1),user:!0}:this.commandMap_[o]={name:o,type:"exToKey",toKeys:r,user:!0}}else if(":"!=r&&":"==r.charAt(0)){var i={keys:e,type:"keyToEx",exArgs:{input:r.substring(1)}};n&&(i.context=n),t.unshift(i)}else{i={keys:e,type:"keyToKey",toKeys:r};n&&(i.context=n),t.unshift(i)}},unmap:function(e,r){if(":"!=e&&":"==e.charAt(0)){if(r)throw Error("Mode not supported for ex mappings");var n=e.substring(1);if(this.commandMap_[n]&&this.commandMap_[n].user)return void delete this.commandMap_[n]}else for(var o=e,i=0;i<t.length;i++)if(o==t[i].keys&&t[i].context===r)return void t.splice(i,1);throw Error("No such mapping.")}};var Qe={colorscheme:function(e,t){!t.args||t.args.length<1?Pe(e,e.getOption("theme")):e.setOption("theme",t.args[0])},map:function(e,t,r){var n=t.args;!n||n.length<2?e&&Pe(e,"Invalid mapping: "+t.input):ze.map(n[0],n[1],r)},imap:function(e,t){this.map(e,t,"insert")},nmap:function(e,t){this.map(e,t,"normal")},vmap:function(e,t){this.map(e,t,"visual")},unmap:function(e,t,r){var n=t.args;!n||n.length<1?e&&Pe(e,"No such mapping: "+t.input):ze.unmap(n[0],r)},move:function(e,t){J.processCommand(e,e.state.vim,{type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:t.line+1})},set:function(e,t){var r=t.args,n=t.setCfg||{};if(!r||r.length<1)e&&Pe(e,"Invalid mapping: "+t.input);else{var o=r[0].split("="),i=o[0],a=o[1],s=!1;if("?"==i.charAt(i.length-1)){if(a)throw Error("Trailing characters: "+t.argString);i=i.substring(0,i.length-1),s=!0}void 0===a&&"no"==i.substring(0,2)&&(i=i.substring(2),a=!1);var l=T[i]&&"boolean"==T[i].type;if(l&&null==a&&(a=!0),!l&&void 0===a||s){var c=O(i,e,n);c instanceof Error?Pe(e,c.message):Pe(e,!0===c||!1===c?" "+(c?"":"no")+i:" "+i+"="+c)}else{var u=E(i,a,e,n);u instanceof Error&&Pe(e,u.message)}}},setlocal:function(e,t){t.setCfg={scope:"local"},this.set(e,t)},setglobal:function(e,t){t.setCfg={scope:"global"},this.set(e,t)},registers:function(e,t){var r=t.args,n=B.registerController.registers,o="----------Registers----------<br><br>";if(r){r=r.join("");for(var i=0;i<r.length;i++){if(a=r.charAt(i),B.registerController.isValidRegister(a))o+='"'+a+" "+(n[a]||new V).toString()+"<br>"}}else for(var a in n){var s=n[a].toString();s.length&&(o+='"'+a+" "+s+"<br>")}Pe(e,o)},sort:function(t,r){var n,i,a,s,l;var c=function(){if(r.argString){var t=new e.StringStream(r.argString);if(t.eat("!")&&(n=!0),t.eol())return;if(!t.eatSpace())return"Invalid arguments";var o=t.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!o&&!t.eol())return"Invalid arguments";if(o[1]){i=-1!=o[1].indexOf("i"),a=-1!=o[1].indexOf("u");var c=-1!=o[1].indexOf("d")||-1!=o[1].indexOf("n")&&1,u=-1!=o[1].indexOf("x")&&1,h=-1!=o[1].indexOf("o")&&1;if(c+u+h>1)return"Invalid arguments";s=(c?"decimal":u&&"hex")||h&&"octal"}o[2]&&(l=new RegExp(o[2].substr(1,o[2].length-2),i?"i":""))}}();if(c)Pe(t,c+": "+r.argString);else{var u=r.line||t.firstLine(),h=r.lineEnd||r.line||t.lastLine();if(u!=h){var p=o(u,0),f=o(h,se(t,h)),d=t.getRange(p,f).split("\n"),m=l||("decimal"==s?/(-?)([\d]+)/:"hex"==s?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==s?/([0-7]+)/:null),g="decimal"==s?10:"hex"==s?16:"octal"==s?8:null,v=[],y=[];if(s||l)for(var k=0;k<d.length;k++){var C=l?d[k].match(l):null;C&&""!=C[0]?v.push(C):!l&&m.exec(d[k])?v.push(d[k]):y.push(d[k])}else y=d;if(v.sort(l?function(e,t){var r;return n&&(r=e,e=t,t=r),i&&(e[0]=e[0].toLowerCase(),t[0]=t[0].toLowerCase()),e[0]<t[0]?-1:1}:M),l)for(k=0;k<v.length;k++)v[k]=v[k].input;else s||y.sort(M);if(d=n?v.concat(y):y.concat(v),a){var w,x=d;d=[];for(k=0;k<x.length;k++)x[k]!=w&&d.push(x[k]),w=x[k]}t.replaceRange(d.join("\n"),p,f)}}function M(e,t){var r;n&&(r=e,e=t,t=r);i&&(e=e.toLowerCase(),t=t.toLowerCase());var o=s&&m.exec(e),a=s&&m.exec(t);return o?(o=parseInt((o[1]+o[2]).toLowerCase(),g))-(a=parseInt((a[1]+a[2]).toLowerCase(),g)):e<t?-1:1}},global:function(e,t){var r=t.argString;if(r){var n,o=void 0!==t.line?t.line:e.firstLine(),i=t.lineEnd||t.line||e.lastLine(),a=function(e){return Oe(e,"/")}(r),s=r;if(a.length&&(s=a[0],n=a.slice(1,a.length).join("/")),s)try{He(e,s,!0,!0)}catch(t){return void Pe(e,"Invalid regex: "+s)}for(var l=Re(e).getQuery(),c=[],u="",h=o;h<=i;h++){l.test(e.getLine(h))&&(c.push(h+1),u+=e.getLine(h)+"<br>")}if(n){var p=0,f=function(){if(p<c.length){var t=c[p]+n;ze.processCommand(e,t,{callback:f})}p++};f()}else Pe(e,u)}else Pe(e,"Regular Expression missing from global")},substitute:function(t,r){if(!t.getSearchCursor)throw new Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var n,i,a,s,l=r.argString,c=l?Oe(l,l[0]):[],u="",h=!1,p=!1;if(c.length)n=c[0],O("pcre")&&""!==n&&(n=new RegExp(n).source),u=c[1],n&&"$"===n[n.length-1]&&(n=n.slice(0,n.length-1)+"\\n",u=u?u+"\n":"\n"),void 0!==u&&(u=O("pcre")?function(t){for(var r=new e.StringStream(t),n=[];!r.eol();){for(;r.peek()&&"\\"!=r.peek();)n.push(r.next());var o=!1;for(var i in Ke)if(r.match(i,!0)){o=!0,n.push(Ke[i]);break}o||n.push(r.next())}return n.join("")}(u.replace(/([^\\])&/g,"$1$$&")):function(e){for(var t,r=!1,n=[],o=-1;o<e.length;o++){var i=e.charAt(o)||"",a=e.charAt(o+1)||"";Ie[i+a]?(n.push(Ie[i+a]),o++):r?(n.push(i),r=!1):"\\"===i?(r=!0,t=a,f.test(t)||"$"===a?n.push("$"):"/"!==a&&"\\"!==a&&n.push("\\")):("$"===i&&n.push("$"),n.push(i),"/"===a&&n.push("\\"))}return n.join("")}(u),B.lastSubstituteReplacePart=u),i=c[2]?c[2].split(" "):[];else if(l&&l.length)return void Pe(t,"Substitutions should be of the form :s/pattern/replace/");if(i&&(a=i[0],s=parseInt(i[1]),a&&(-1!=a.indexOf("c")&&(h=!0,a.replace("c","")),-1!=a.indexOf("g")&&(p=!0,a.replace("g","")),n=O("pcre")?n+"/"+a:n.replace(/\//g,"\\/")+"/"+a)),n)try{He(t,n,!0,!0)}catch(e){return void Pe(t,"Invalid regex: "+n)}if(void 0!==(u=u||B.lastSubstituteReplacePart)){var d=Re(t).getQuery(),m=void 0!==r.line?r.line:t.getCursor().line,g=r.lineEnd||m;m==t.firstLine()&&g==t.lastLine()&&(g=1/0),s&&(g=(m=g)+s-1);var v=X(t,o(m,0)),y=t.getSearchCursor(d,v);!function(t,r,n,o,i,a,s,l,c){t.state.vim.exMode=!0;var u=!1,h=a.from();function p(){t.operation((function(){for(;!u;)f(),d();m()}))}function f(){var e=t.getRange(a.from(),a.to()).replace(s,l);a.replace(e)}function d(){for(;a.findNext()&&(e=a.from(),r=o,s=i,"number"!=typeof e&&(e=e.line),r instanceof Array?L(e,r):s?e>=r&&e<=s:e==r);)if(n||!h||a.from().line!=h.line)return t.scrollIntoView(a.from(),30),t.setSelection(a.from(),a.to()),h=a.from(),void(u=!1);var e,r,s;u=!0}function m(e){if(e&&e(),t.focus(),h){t.setCursor(h);var r=t.state.vim;r.exMode=!1,r.lastHPos=r.lastHSPos=h.ch}c&&c()}if(d(),u)return void Pe(t,"No matches for "+s.source);if(!r)return p(),void(c&&c());je(t,{prefix:"replace with <strong>"+l+"</strong> (y/n/a/q/l)",onKeyDown:function(r,n,o){switch(e.e_stop(r),e.keyName(r)){case"Y":f(),d();break;case"N":d();break;case"A":var i=c;c=void 0,t.operation(p),c=i;break;case"L":f();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":m(o)}return u&&m(o),!0}})}(t,h,p,m,g,y,d,u,r.callback)}else Pe(t,"No previous substitute regular expression")},redo:e.commands.redo,undo:e.commands.undo,write:function(t){e.commands.save?e.commands.save(t):t.save&&t.save()},nohlsearch:function(e){De(e)},yank:function(e){var t=te(e.getCursor()).line,r=e.getLine(t);B.registerController.pushText("0","yank",r,!0,!0)},delmarks:function(t,r){if(r.argString&&le(r.argString))for(var n=t.state.vim,o=new e.StringStream(le(r.argString));!o.eol();){o.eatSpace();var i=o.pos;if(!o.match(/[a-zA-Z]/,!1))return void Pe(t,"Invalid argument: "+r.argString.substring(i));var a=o.next();if(o.match("-",!0)){if(!o.match(/[a-zA-Z]/,!1))return void Pe(t,"Invalid argument: "+r.argString.substring(i));var s=a,l=o.next();if(!(M(s)&&M(l)||S(s)&&S(l)))return void Pe(t,"Invalid argument: "+s+"-");var c=s.charCodeAt(0),u=l.charCodeAt(0);if(c>=u)return void Pe(t,"Invalid argument: "+r.argString.substring(i));for(var h=0;h<=u-c;h++){var p=String.fromCharCode(c+h);delete n.marks[p]}}else delete n.marks[a]}else Pe(t,"Argument required")}},ze=new qe;function Xe(t){var r=t.state.vim,n=B.macroModeState,o=B.registerController.getRegister("."),i=n.isPlaying,a=n.lastInsertModeChanges;i||(t.off("change",Ye),e.off(t.getInputField(),"keydown",ot)),!i&&r.insertModeRepeat>1&&(it(t,r,r.insertModeRepeat-1,!0),r.lastEditInputState.repeatOverride=r.insertModeRepeat),delete r.insertModeRepeat,r.insertMode=!1,t.setCursor(t.getCursor().line,t.getCursor().ch-1),t.setOption("keyMap","vim"),t.setOption("disableInput",!0),t.toggleOverwrite(!1),o.setText(a.changes.join("")),e.signal(t,"vim-mode-change",{mode:"normal"}),n.isRecording&&function(e){if(e.isPlaying)return;var t=e.latestRegister,r=B.registerController.getRegister(t);r&&r.pushInsertModeChanges&&r.pushInsertModeChanges(e.lastInsertModeChanges)}(n)}function Ze(e){t.unshift(e)}function Ge(t,r,n,o){var i=B.registerController.getRegister(o);if(":"==o)return i.keyBuffer[0]&&ze.processCommand(t,i.keyBuffer[0]),void(n.isPlaying=!1);var a=i.keyBuffer,s=0;n.isPlaying=!0,n.replaySearchQueries=i.searchQueries.slice(0);for(var l=0;l<a.length;l++)for(var c,u,h=a[l];h;)if(u=(c=/<\w+-.+?>|<\w+>|./.exec(h))[0],h=h.substring(c.index+u.length),e.Vim.handleKey(t,u,"macro"),r.insertMode){var p=i.insertModeChanges[s++].changes;B.macroModeState.lastInsertModeChanges.changes=p,at(t,p,1),Xe(t)}n.isPlaying=!1}function Ye(e,t){var r=B.macroModeState,n=r.lastInsertModeChanges;if(!r.isPlaying)for(;t;){if(n.expectCursorActivityForChange=!0,n.ignoreCount>1)n.ignoreCount--;else if("+input"==t.origin||"paste"==t.origin||void 0===t.origin){var o=e.listSelections().length;o>1&&(n.ignoreCount=o);var i=t.text.join("\n");n.maybeReset&&(n.changes=[],n.maybeReset=!1),i&&(e.state.overwrite&&!/\n/.test(i)?n.changes.push([i]):n.changes.push(i))}t=t.next}}function et(t){var r=t.state.vim;if(r.insertMode){var n=B.macroModeState;if(n.isPlaying)return;var o=n.lastInsertModeChanges;o.expectCursorActivityForChange?o.expectCursorActivityForChange=!1:o.maybeReset=!0}else t.curOp.isVimOp||function(t,r){var n=t.getCursor("anchor"),o=t.getCursor("head");r.visualMode&&!t.somethingSelected()?me(t,!1):r.visualMode||r.insertMode||!t.somethingSelected()||(r.visualMode=!0,r.visualLine=!1,e.signal(t,"vim-mode-change",{mode:"visual"}));if(r.visualMode){var i=ne(o,n)?0:-1,a=ne(o,n)?-1:0;o=G(o,0,i),n=G(n,0,a),r.sel={anchor:n,head:o},Ae(t,r,"<",oe(o,n)),Ae(t,r,">",ie(o,n))}else r.insertMode||(r.lastHPos=t.getCursor().ch)}(t,r);r.visualMode&&tt(t)}function tt(e){var t=e.state.vim,r=X(e,te(t.sel.head)),n=G(r,0,1);if(rt(t),r.ch==e.getLine(r.line).length){var o=document.createElement("span");o.textContent=" ",o.className="cm-animate-fat-cursor",t.fakeCursorBookmark=e.setBookmark(r,{widget:o})}else t.fakeCursor=e.markText(r,n,{className:"cm-animate-fat-cursor"})}function rt(e){e.fakeCursor&&(e.fakeCursor.clear(),e.fakeCursor=null),e.fakeCursorBookmark&&(e.fakeCursorBookmark.clear(),e.fakeCursorBookmark=null)}function nt(e){this.keyName=e}function ot(t){var r=B.macroModeState.lastInsertModeChanges,n=e.keyName(t);n&&(-1==n.indexOf("Delete")&&-1==n.indexOf("Backspace")||e.lookupKey(n,"vim-insert",(function(){return r.maybeReset&&(r.changes=[],r.maybeReset=!1),r.changes.push(new nt(n)),!0})))}function it(e,t,r,n){var o=B.macroModeState;o.isPlaying=!0;var i=!!t.lastEditActionCommand,a=t.inputState;function s(){i?J.processAction(e,t,t.lastEditActionCommand):J.evalInput(e,t)}function l(r){if(o.lastInsertModeChanges.changes.length>0){r=t.lastEditActionCommand?r:1;var n=o.lastInsertModeChanges;at(e,n.changes,r)}}if(t.inputState=t.lastEditInputState,i&&t.lastEditActionCommand.interlaceInsertRepeat)for(var c=0;c<r;c++)s(),l(1);else n||s(),l(r);t.inputState=a,t.insertMode&&!n&&Xe(e),o.isPlaying=!1}function at(t,r,n){function o(r){return"string"==typeof r?e.commands[r](t):r(t),!0}var i=t.getCursor("head"),a=B.macroModeState.lastInsertModeChanges.visualBlock;a&&(he(t,i,a+1),n=t.listSelections().length,t.setCursor(i));for(var s=0;s<n;s++){a&&t.setCursor(G(i,s,0));for(var l=0;l<r.length;l++){var c=r[l];if(c instanceof nt)e.lookupKey(c.keyName,"vim-insert",o);else if("string"==typeof c){var u=t.getCursor();t.replaceRange(c,u,u)}else{var h=t.getCursor(),p=G(h,0,c[0].length);t.replaceRange(c[0],h,p)}}}a&&t.setCursor(G(i,0,1))}return e.keyMap.vim={attach:a,detach:i,call:c},R("insertModeEscKeysTimeout",200,"number"),e.keyMap["vim-insert"]={fallthrough:["default"],attach:a,detach:i,call:c},e.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:a,detach:i,call:c},j(),H}()})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/lib/codemirror.css b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/lib/codemirror.css index bc910fb9b4b5..a64f97c7775e 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/lib/codemirror.css +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/lib/codemirror.css @@ -164,17 +164,17 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} .CodeMirror-scroll { overflow: scroll !important; /* Things will break if this is overridden */ - /* 30px is the magic margin used to hide the element's real scrollbars */ + /* 50px is the magic margin used to hide the element's real scrollbars */ /* See overflow: hidden in .CodeMirror */ - margin-bottom: -30px; margin-right: -30px; - padding-bottom: 30px; + margin-bottom: -50px; margin-right: -50px; + padding-bottom: 50px; height: 100%; outline: none; /* Prevent dragging from highlighting the element */ position: relative; } .CodeMirror-sizer { position: relative; - border-right: 30px solid transparent; + border-right: 50px solid transparent; } /* The fake, visible scrollbars. Used to force redraw during scrolling @@ -184,6 +184,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} position: absolute; z-index: 6; display: none; + outline: none; } .CodeMirror-vscrollbar { right: 0; top: 0; @@ -212,7 +213,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} height: 100%; display: inline-block; vertical-align: top; - margin-bottom: -30px; + margin-bottom: -50px; } .CodeMirror-gutter-wrapper { position: absolute; diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/lib/codemirror.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/lib/codemirror.js index 8c209e20dfa9..cc7e7152f44e 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/lib/codemirror.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/lib/codemirror.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).CodeMirror=t()}(this,(function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),l=n||i||o,s=l&&(n?document.documentMode||6:+(o||i)[1]),a=!o&&/WebKit\//.test(e),u=a&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),h=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),v=/Android/.test(e),m=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),x=h&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(h=!1,a=!0);var C=y&&(u||h&&(null==x||x<12.11)),S=r||l&&s>=9;function L(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var k,T=function(e,t){var r=e.className,n=L(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function M(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function N(e,t){return M(e).appendChild(t)}function O(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"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 A(e,t,r,n){var i=O(e,t,r,n);return i.setAttribute("role","presentation"),i}function D(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)}function W(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function H(e,t){var r=e.className;L(t).test(r)||(e.className+=(r?" ":"")+t)}function F(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!L(r[n]).test(t)&&(t+=" "+r[n]);return t}k=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var P=function(e){e.select()};function E(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function I(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function z(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,l=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}}g?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(P=function(e){try{e.select()}catch(e){}});var R=function(){this.id=null,this.f=null,this.time=0,this.handler=E(this.onTimeout,this)};function B(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}R.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},R.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};var G={toString:function(){return"CodeMirror.Pass"}},U={scroll:!1},V={origin:"*mouse"},K={origin:"+move"};function j(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,n=o+1,(i+=r-i%r)>=t)return n}}var X=[""];function Y(e){for(;X.length<=e;)X.push(_(X)+" ");return X[e]}function _(e){return e[e.length-1]}function $(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function q(){}function Z(e,t){var r;return Object.create?r=Object.create(e):(q.prototype=e,r=new q),t&&I(t,r),r}var Q=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function J(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&J(e))||t.test(e):J(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\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]/;function ne(e){return e.charCodeAt(0)>=768&&re.test(e)}function ie(e,t,r){for(;(r<0?t>0:t<e.length)&&ne(e.charAt(t));)t+=r;return t}function oe(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}var le=null;function se(e,t,r){var n;le=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:le=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:le=i)}return null!=n?n:le}var ae=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,r=/[LRr]/,n=/[Lb1n]/,i=/[1n]/;function o(e,t,r){this.level=e,this.from=t,this.to=r}return function(l,s){var a="ltr"==s?"L":"R";if(0==l.length||"ltr"==s&&!e.test(l))return!1;for(var u,c=l.length,h=[],f=0;f<c;++f)h.push((u=l.charCodeAt(f))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":8204==u?"b":"L");for(var d=0,p=a;d<c;++d){var g=h[d];"m"==g?h[d]=p:p=g}for(var v=0,m=a;v<c;++v){var y=h[v];"1"==y&&"r"==m?h[v]="n":r.test(y)&&(m=y,"r"==y&&(h[v]="R"))}for(var b=1,w=h[0];b<c-1;++b){var x=h[b];"+"==x&&"1"==w&&"1"==h[b+1]?h[b]="1":","!=x||w!=h[b+1]||"1"!=w&&"n"!=w||(h[b]=w),w=x}for(var C=0;C<c;++C){var S=h[C];if(","==S)h[C]="N";else if("%"==S){var L=void 0;for(L=C+1;L<c&&"%"==h[L];++L);for(var k=C&&"!"==h[C-1]||L<c&&"1"==h[L]?"1":"N",T=C;T<L;++T)h[T]=k;C=L-1}}for(var M=0,N=a;M<c;++M){var O=h[M];"L"==N&&"1"==O?h[M]="L":r.test(O)&&(N=O)}for(var A=0;A<c;++A)if(t.test(h[A])){var D=void 0;for(D=A+1;D<c&&t.test(h[D]);++D);for(var W="L"==(A?h[A-1]:a),H=W==("L"==(D<c?h[D]:a))?W?"L":"R":a,F=A;F<D;++F)h[F]=H;A=D-1}for(var P,E=[],I=0;I<c;)if(n.test(h[I])){var z=I;for(++I;I<c&&n.test(h[I]);++I);E.push(new o(0,z,I))}else{var R=I,B=E.length,G="rtl"==s?1:0;for(++I;I<c&&"L"!=h[I];++I);for(var U=R;U<I;)if(i.test(h[U])){R<U&&(E.splice(B,0,new o(1,R,U)),B+=G);var V=U;for(++U;U<I&&i.test(h[U]);++U);E.splice(B,0,new o(2,V,U)),B+=G,R=U}else++U;R<I&&E.splice(B,0,new o(1,R,I))}return"ltr"==s&&(1==E[0].level&&(P=l.match(/^\s+/))&&(E[0].from=P[0].length,E.unshift(new o(0,0,P[0].length))),1==_(E).level&&(P=l.match(/\s+$/))&&(_(E).to-=P[0].length,E.push(new o(0,c-P[0].length,c)))),"rtl"==s?E.reverse():E}}();function ue(e,t){var r=e.order;return null==r&&(r=e.order=ae(e.text,t)),r}var ce=[],he=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||ce).concat(r)}};function fe(e,t){return e._handlers&&e._handlers[t]||ce}function de(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=B(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function pe(e,t){var r=fe(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function ge(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),pe(e,r||t.type,e,t),xe(t)||t.codemirrorIgnore}function ve(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==B(r,t[n])&&r.push(t[n])}function me(e,t){return fe(e,t).length>0}function ye(e){e.prototype.on=function(e,t){he(this,e,t)},e.prototype.off=function(e,t){de(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function we(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function xe(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ce(e){be(e),we(e)}function Se(e){return e.target||e.srcElement}function Le(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var ke,Te,Me=function(){if(l&&s<9)return!1;var e=O("div");return"draggable"in e||"dragDrop"in e}();function Ne(e){if(null==ke){var t=O("span","​");N(e,O("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(ke=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&s<8))}var r=ke?O("span","​"):O("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Oe(e){if(null!=Te)return Te;var t=N(e,document.createTextNode("AØ®A")),r=k(t,0,1).getBoundingClientRect(),n=k(t,1,2).getBoundingClientRect();return M(e),!(!r||r.left==r.right)&&(Te=n.right-r.right<3)}var Ae,De=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},We=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},He="oncopy"in(Ae=O("div"))||(Ae.setAttribute("oncopy","return;"),"function"==typeof Ae.oncopy),Fe=null;var Pe={},Ee={};function Ie(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pe[e]=t}function ze(e){if("string"==typeof e&&Ee.hasOwnProperty(e))e=Ee[e];else if(e&&"string"==typeof e.name&&Ee.hasOwnProperty(e.name)){var t=Ee[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ze("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ze("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Re(e,t){t=ze(t);var r=Pe[t.name];if(!r)return Re(e,"text/plain");var n=r(e,t);if(Be.hasOwnProperty(t.name)){var i=Be[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var Be={};function Ge(e,t){I(t,Be.hasOwnProperty(e)?Be[e]:Be[e]={})}function Ue(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Ve(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Ke(e,t,r){return!e.startState||e.startState(t,r)}var je=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function Xe(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function Ye(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,(function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i})),n}function _e(e,t,r){var n=[];return e.iter(t,r,(function(e){n.push(e.text)})),n}function $e(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function qe(e){if(null==e.parent)return null;for(var t=e.parent,r=B(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function Ze(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var l=0;l<e.lines.length;++l){var s=e.lines[l].height;if(t<s)break;t-=s}return r+l}function Qe(e,t){return t>=e.first&&t<e.first+e.size}function Je(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,r){if(void 0===r&&(r=null),!(this instanceof et))return new et(e,t,r);this.line=e,this.ch=t,this.sticky=r}function tt(e,t){return e.line-t.line||e.ch-t.ch}function rt(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function nt(e){return et(e.line,e.ch)}function it(e,t){return tt(e,t)<0?t:e}function ot(e,t){return tt(e,t)<0?e:t}function lt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function st(e,t){if(t.line<e.first)return et(e.first,0);var r=e.first+e.size-1;return t.line>r?et(r,Xe(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?et(e.line,t):r<0?et(e.line,0):e}(t,Xe(e,t.line).text.length)}function at(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=st(e,t[n]);return r}je.prototype.eol=function(){return this.pos>=this.string.length},je.prototype.sol=function(){return this.pos==this.lineStart},je.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},je.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},je.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},je.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},je.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},je.prototype.skipToEnd=function(){this.pos=this.string.length},je.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},je.prototype.backUp=function(e){this.pos-=e},je.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},je.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},je.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},je.prototype.current=function(){return this.string.slice(this.start,this.pos)},je.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},je.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},je.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ut=function(e,t){this.state=e,this.lookAhead=t},ct=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function ht(e,t,r,n){var i=[e.state.modeGen],o={};wt(e,t.text,e.doc.mode,r,(function(e,t){return i.push(e,t)}),o,n);for(var l=r.state,s=function(n){r.baseTokens=i;var s=e.state.overlays[n],a=1,u=0;r.state=!0,wt(e,t.text,s.mode,r,(function(e,t){for(var r=a;u<e;){var n=i[a];n>e&&i.splice(a,1,e,i[a+1],n),a+=2,u=Math.min(e,n)}if(t)if(s.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"overlay "+t}}),o),r.state=l,r.baseTokens=null,r.baseTokenPos=1},a=0;a<e.state.overlays.length;++a)s(a);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function ft(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=dt(e,qe(t)),i=t.text.length>e.options.maxHighlightLength&&Ue(e.doc.mode,n.state),o=ht(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function dt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new ct(n,!0,t);var o=function(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>l;--s){if(s<=o.first)return o.first;var a=Xe(o,s-1),u=a.stateAfter;if(u&&(!r||s+(u instanceof ut?u.lookAhead:0)<=o.modeFrontier))return s;var c=z(a.text,null,e.options.tabSize);(null==i||n>c)&&(i=s-1,n=c)}return i}(e,t,r),l=o>n.first&&Xe(n,o-1).stateAfter,s=l?ct.fromSaved(n,l,o):new ct(n,Ke(n.mode),o);return n.iter(o,t,(function(r){pt(e,r.text,s);var n=s.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?s.save():null,s.nextLine()})),r&&(n.modeFrontier=s.line),s}function pt(e,t,r,n){var i=e.doc.mode,o=new je(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&>(i,r.state);!o.eol();)vt(i,o,r.state),o.start=o.pos}function gt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Ve(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function vt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Ve(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}ct.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ct.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ct.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ct.fromSaved=function(e,t,r){return t instanceof ut?new ct(e,Ue(e.mode,t.state),r,t.lookAhead):new ct(e,Ue(e.mode,t),r)},ct.prototype.save=function(e){var t=!1!==e?Ue(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ut(t,this.maxLookAhead):t};var mt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function yt(e,t,r,n){var i,o,l=e.doc,s=l.mode,a=Xe(l,(t=st(l,t)).line),u=dt(e,t.line,r),c=new je(a.text,e.options.tabSize,u);for(n&&(o=[]);(n||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=vt(s,c,u.state),n&&o.push(new mt(c,i,Ue(l.mode,u.state)));return n?o:new mt(c,i,u.state)}function bt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function wt(e,t,r,n,i,o,l){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var a,u=0,c=null,h=new je(t,e.options.tabSize,n),f=e.options.addModeClass&&[null];for(""==t&&bt(gt(r,n.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(s=!1,l&&pt(e,t,n,h.pos),h.pos=t.length,a=null):a=bt(vt(r,h,n.state,f),o),f){var d=f[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;u<h.start;)i(u=Math.min(h.start,u+5e3),c);c=a}h.start=h.pos}for(;u<h.pos;){var p=Math.min(h.pos,u+5e3);i(p,c),u=p}}var xt=!1,Ct=!1;function St(e,t,r){this.marker=e,this.from=t,this.to=r}function Lt(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function kt(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Tt(e,t){if(t.full)return null;var r=Qe(e,t.from.line)&&Xe(e,t.from.line).markedSpans,n=Qe(e,t.to.line)&&Xe(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,l=0==tt(t.from,t.to),s=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==l.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new St(l,o.from,s?null:o.to))}}return n}(r,i,l),a=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.to||(l.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new St(l,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,l),u=1==t.text.length,c=_(t.text).length+(u?i:0);if(s)for(var h=0;h<s.length;++h){var f=s[h];if(null==f.to){var d=Lt(a,f.marker);d?u&&(f.to=null==d.to?null:d.to+c):f.to=i}}if(a)for(var p=0;p<a.length;++p){var g=a[p];if(null!=g.to&&(g.to+=c),null==g.from)Lt(s,g.marker)||(g.from=c,u&&(s||(s=[])).push(g));else g.from+=c,u&&(s||(s=[])).push(g)}s&&(s=Mt(s)),a&&a!=s&&(a=Mt(a));var v=[s];if(!u){var m,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(m||(m=[])).push(new St(s[b].marker,null,null));for(var w=0;w<y;++w)v.push(m);v.push(a)}return v}function Mt(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Nt(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function Ot(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function At(e){return e.inclusiveLeft?-1:0}function Dt(e){return e.inclusiveRight?1:0}function Wt(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=tt(n.from,i.from)||At(e)-At(t);if(o)return-o;var l=tt(n.to,i.to)||Dt(e)-Dt(t);return l||t.id-e.id}function Ht(e,t){var r,n=Ct&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||Wt(r,i.marker)<0)&&(r=i.marker);return r}function Ft(e){return Ht(e,!0)}function Pt(e){return Ht(e,!1)}function Et(e,t){var r,n=Ct&&e.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||Wt(r,o.marker)<0)&&(r=o.marker)}return r}function It(e,t,r,n,i){var o=Xe(e,t),l=Ct&&o.markedSpans;if(l)for(var s=0;s<l.length;++s){var a=l[s];if(a.marker.collapsed){var u=a.marker.find(0),c=tt(u.from,r)||At(a.marker)-At(i),h=tt(u.to,n)||Dt(a.marker)-Dt(i);if(!(c>=0&&h<=0||c<=0&&h>=0)&&(c<=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?tt(u.to,r)>=0:tt(u.to,r)>0)||c>=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?tt(u.from,n)<=0:tt(u.from,n)<0)))return!0}}}function zt(e){for(var t;t=Ft(e);)e=t.find(-1,!0).line;return e}function Rt(e,t){var r=Xe(e,t),n=zt(r);return r==n?t:qe(n)}function Bt(e,t){if(t>e.lastLine())return t;var r,n=Xe(e,t);if(!Gt(e,n))return t;for(;r=Pt(n);)n=r.find(1,!0).line;return qe(n)+1}function Gt(e,t){var r=Ct&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&Ut(e,t,n))return!0}}function Ut(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return Ut(e,n.line,Lt(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&Ut(e,t,i))return!0}function Vt(e){for(var t=0,r=(e=zt(e)).parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;o=(r=o).parent)for(var l=0;l<o.children.length;++l){var s=o.children[l];if(s==r)break;t+=s.height}return t}function Kt(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Ft(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=Pt(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function jt(e){var t=e.display,r=e.doc;t.maxLine=Xe(r,r.first),t.maxLineLength=Kt(t.maxLine),t.maxLineChanged=!0,r.iter((function(e){var r=Kt(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var Xt=function(e,t,r){this.text=e,Ot(this,t),this.height=r?r(this):1};function Yt(e){e.parent=null,Nt(e)}Xt.prototype.lineNo=function(){return qe(this)},ye(Xt);var _t={},$t={};function qt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?$t:_t;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var r=A("span",null,null,a?"padding-right: .1px":null),n={pre:A("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;n.pos=0,n.addToken=Jt,Oe(e.display.measure)&&(l=ue(o,e.doc.direction))&&(n.addToken=er(n.addToken,l)),n.map=[],rr(o,n,ft(e,o,t!=e.display.externalMeasured&&qe(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=F(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=F(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Ne(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(a){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return pe(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=F(n.pre.className,n.textClass||"")),n}function Qt(e){var t=O("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Jt(e,t,r,n,i,o,a){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}(t,e.trailingSpace):t,h=e.cm.state.specialChars,f=!1;if(h.test(t)){u=document.createDocumentFragment();for(var d=0;;){h.lastIndex=d;var p=h.exec(t),g=p?p.index-d:t.length-d;if(g){var v=document.createTextNode(c.slice(d,d+g));l&&s<9?u.appendChild(O("span",[v])):u.appendChild(v),e.map.push(e.pos,e.pos+g,v),e.col+=g,e.pos+=g}if(!p)break;d+=g+1;var m=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(m=u.appendChild(O("span",Y(b),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((m=u.appendChild(O("span","\r"==p[0]?"â":"â¤","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((m=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),l&&s<9?u.appendChild(O("span",[m])):u.appendChild(m),e.col+=1);e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),l&&s<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||n||i||f||o){var w=r||"";n&&(w+=n),i&&(w+=i);var x=O("span",[u],w,o);if(a)for(var C in a)a.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,a[C]);return e.content.appendChild(x)}e.content.appendChild(u)}}function er(e,t){return function(r,n,i,o,l,s,a){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,c=u+n.length;;){for(var h=void 0,f=0;f<t.length&&!((h=t[f]).to>u&&h.from<=u);f++);if(h.to>=c)return e(r,n,i,o,l,s,a);e(r,n.slice(0,h.to-u),i,o,null,s,a),o=null,n=n.slice(h.to-u),u=h.to}}}function tr(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function rr(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,h,f,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=s="",f=null,h=null,m=1/0;for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[w],C=x.marker;if("bookmark"==C.type&&x.from==p&&C.widgetNode)y.push(C);else if(x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(a+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((f||(f={})).title=C.title),C.attributes)for(var S in C.attributes)(f||(f={}))[S]=C.attributes[S];C.collapsed&&(!h||Wt(h.marker,C)<0)&&(h=x)}else x.from>p&&m>x.from&&(m=x.from)}if(b)for(var L=0;L<b.length;L+=2)b[L+1]==m&&(u+=" "+b[L]);if(!h||h.from==p)for(var k=0;k<y.length;++k)tr(t,0,y[k]);if(h&&(h.from||0)==p){if(tr(t,(null==h.to?d+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=d)break;for(var T=Math.min(d,m);;){if(v){var M=p+v.length;if(!h){var N=M>T?v.slice(0,T-p):v;t.addToken(t,N,l?l+a:a,c,p+N.length==m?u:"",s,f)}if(M>=T){v=v.slice(T-p),p=T;break}p=M,c=""}v=i.slice(o,o=r[g++]),l=qt(r[g++],t.cm.options)}}else for(var O=1;O<r.length;O+=2)t.addToken(t,i.slice(o,o=r[O]),qt(r[O+1],t.cm.options))}function nr(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=Pt(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?qe(_(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Gt(e,t)}function ir(e,t,r){for(var n,i=[],o=t;o<r;o=n){var l=new nr(e.doc,Xe(e.doc,o),o);n=o+l.size,i.push(l)}return i}var or=null;var lr=null;function sr(e,t){var r=fe(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);or?n=or.delayedCallbacks:lr?n=lr:(n=lr=[],setTimeout(ar,0));for(var o=function(e){n.push((function(){return r[e].apply(null,i)}))},l=0;l<r.length;++l)o(l)}}function ar(){var e=lr;lr=null;for(var t=0;t<e.length;++t)e[t]()}function ur(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?fr(e,t):"gutter"==o?pr(e,t,r,n):"class"==o?dr(e,t):"widget"==o&&gr(e,t,n)}t.changes=null}function cr(e){return e.node==e.text&&(e.node=O("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),l&&s<8&&(e.node.style.zIndex=2)),e.node}function hr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Zt(e,t)}function fr(e,t){var r=t.text.className,n=hr(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,dr(e,t)):r&&(t.text.className=r)}function dr(e,t){!function(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=cr(t);t.background=n.insertBefore(O("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?cr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function pr(e,t,r,n){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=cr(t);t.gutterBackground=O("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var l=cr(t),s=t.gutter=O("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),l.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(O("div",Je(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var a=0;a<e.display.gutterSpecs.length;++a){var u=e.display.gutterSpecs[a].className,c=o.hasOwnProperty(u)&&o[u];c&&s.appendChild(O("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[u]+"px; width: "+n.gutterWidth[u]+"px"))}}}function gr(e,t,r){t.alignable&&(t.alignable=null);for(var n=L("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);mr(e,t,r)}function vr(e,t,r,n){var i=hr(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),dr(e,t),pr(e,t,r,n),mr(e,t,n),t.node}function mr(e,t,r){if(yr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)yr(e,t.rest[n],t,r,!1)}function yr(e,t,r,n,i){if(t.widgets)for(var o=cr(r),l=0,s=t.widgets;l<s.length;++l){var a=s[l],u=O("div",[a.node],"CodeMirror-linewidget"+(a.className?" "+a.className:""));a.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),br(a,u,r,n),e.display.input.setUneditable(u),i&&a.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),sr(a,"redraw")}}function br(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function wr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!D(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),N(t.display.measure,O("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function xr(e,t){for(var r=Se(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Cr(e){return e.lineSpace.offsetTop}function Sr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Lr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=N(e.measure,O("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function kr(e){return 30-e.display.nativeBarWidth}function Tr(e){return e.display.scroller.clientWidth-kr(e)-e.display.barWidth}function Mr(e){return e.display.scroller.clientHeight-kr(e)-e.display.barHeight}function Nr(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(qe(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Or(e,t,r,n){return Wr(e,Dr(e,t),r,n)}function Ar(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[cn(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Dr(e,t){var r=qe(t),n=Ar(e,r);n&&!n.text?n=null:n&&n.changes&&(ur(e,n,r,on(e)),e.curOp.forceUpdate=!0),n||(n=function(e,t){var r=qe(t=zt(t)),n=e.display.externalMeasured=new nr(e.doc,t,r);n.lineN=r;var i=n.built=Zt(e,n);return n.text=i.pre,N(e.display.lineMeasure,i.pre),n}(e,t));var i=Nr(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Wr(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(!function(e,t,r){var n=e.options.lineWrapping,i=n&&Tr(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),s=0;s<l.length-1;s++){var a=l[s],u=l[s+1];Math.abs(a.bottom-u.bottom)>2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,n){var i,o=Pr(t.map,r,n),a=o.node,u=o.start,c=o.end,h=o.collapse;if(3==a.nodeType){for(var f=0;f<4;f++){for(;u&&ne(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c<o.coverEnd&&ne(t.line.text.charAt(o.coverStart+c));)++c;if((i=l&&s<9&&0==u&&c==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Er(k(a,u,c).getClientRects(),n)).left||i.right||0==u)break;c=u,u-=1,h="right"}l&&s<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Fe)return Fe;var t=N(e,O("span","x")),r=t.getBoundingClientRect(),n=k(t,0,1).getBoundingClientRect();return Fe=Math.abs(r.left-n.left)>1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{var d;u>0&&(h=n="right"),i=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(l&&s<9&&!u&&(!i||!i.left&&!i.right)){var p=a.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+nn(e.display),top:p.top,bottom:p.bottom}:Fr}for(var g=i.top-t.rect.top,v=i.bottom-t.rect.top,m=(g+v)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(m<y[b]);b++);var w=b?y[b-1]:0,x=y[b],C={left:("right"==h?i.right:i.left)-t.rect.left,right:("left"==h?i.left:i.right)-t.rect.left,top:w,bottom:x};i.left||i.right||(C.bogus=!0);e.options.singleCursorHeightPerLine||(C.rtop=g,C.rbottom=v);return C}(e,t,r,n)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Hr,Fr={left:0,right:0,top:0,bottom:0};function Pr(e,t,r){for(var n,i,o,l,s,a,u=0;u<e.length;u+=3)if(s=e[u],a=e[u+1],t<s?(i=0,o=1,l="left"):t<a?o=(i=t-s)+1:(u==e.length-3||t==a&&e[u+3]>t)&&(i=(o=a-s)-1,t>=a&&(l="right")),null!=i){if(n=e[u+2],s==a&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],l="left";if("right"==r&&i==a-s)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)n=e[(u+=3)+2],l="right";break}return{node:n,start:i,end:o,collapse:l,coverStart:s,coverEnd:a}}function Er(e,t){var r=Fr;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function Ir(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 zr(e){e.display.externalMeasure=null,M(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ir(e.display.view[t])}function Rr(e){zr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Br(){return c&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Gr(){return c&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ur(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=wr(e.widgets[r]));return t}function Vr(e,t,r,n,i){if(!i){var o=Ur(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var l=Vt(t);if("local"==n?l+=Cr(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==n?0:Gr());var a=s.left+("window"==n?0:Br());r.left+=a,r.right+=a}return r.top+=l,r.bottom+=l,r}function Kr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=Br(),i-=Gr();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:i-l.top}}function jr(e,t,r,n,i){return n||(n=Xe(e.doc,t.line)),Vr(e,n,Or(e,n,t.ch,i),r)}function Xr(e,t,r,n,i,o){function l(t,l){var s=Wr(e,i,t,l?"right":"left",o);return l?s.left=s.right:s.right=s.left,Vr(e,n,s,r)}n=n||Xe(e.doc,t.line),i||(i=Dr(e,n));var s=ue(n,e.doc.direction),a=t.ch,u=t.sticky;if(a>=n.text.length?(a=n.text.length,u="before"):a<=0&&(a=0,u="after"),!s)return l("before"==u?a-1:a,"before"==u);function c(e,t,r){return l(r?e-1:e,1==s[t].level!=r)}var h=se(s,a,u),f=le,d=c(a,h,"before"==u);return null!=f&&(d.other=c(a,f,"before"!=u)),d}function Yr(e,t){var r=0;t=st(e.doc,t),e.options.lineWrapping||(r=nn(e.display)*t.ch);var n=Xe(e.doc,t.line),i=Vt(n)+Cr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function _r(e,t,r,n,i){var o=et(e,t,r);return o.xRel=i,n&&(o.outside=n),o}function $r(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return _r(n.first,0,null,-1,-1);var i=Ze(n,r),o=n.first+n.size-1;if(i>o)return _r(n.first+n.size-1,Xe(n,o).text.length,null,1,1);t<0&&(t=0);for(var l=Xe(n,i);;){var s=Jr(e,l,i,t,r),a=Et(l,s.ch+(s.xRel>0||s.outside>0?1:0));if(!a)return s;var u=a.find(1);if(u.line==i)return u;l=Xe(n,i=u.line)}}function qr(e,t,r,n){n-=Ur(t);var i=t.text.length,o=oe((function(t){return Wr(e,r,t-1).bottom<=n}),i,0);return{begin:o,end:i=oe((function(t){return Wr(e,r,t).top>n}),o,i)}}function Zr(e,t,r,n){return r||(r=Dr(e,t)),qr(e,t,r,Vr(e,t,Wr(e,r,n),"line").top)}function Qr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function Jr(e,t,r,n,i){i-=Vt(t);var o=Dr(e,t),l=Ur(t),s=0,a=t.text.length,u=!0,c=ue(t,e.doc.direction);if(c){var h=(e.options.lineWrapping?tn:en)(e,t,r,o,c,n,i);s=(u=1!=h.level)?h.from:h.to-1,a=u?h.to:h.from-1}var f,d,p=null,g=null,v=oe((function(t){var r=Wr(e,o,t);return r.top+=l,r.bottom+=l,!!Qr(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,g=r),!0)}),s,a),m=!1;if(g){var y=n-g.left<g.right-n,b=y==u;v=p+(b?0:1),d=b?"after":"before",f=y?g.left:g.right}else{u||v!=a&&v!=s||v++,d=0==v?"after":v==t.text.length?"before":Wr(e,o,v-(u?1:0)).bottom+l<=i==u?"after":"before";var w=Xr(e,et(r,v,d),"line",t,o);f=w.left,m=i<w.top?-1:i>=w.bottom?1:0}return _r(r,v=ie(t.text,v,1),d,m,n-f)}function en(e,t,r,n,i,o,l){var s=oe((function(s){var a=i[s],u=1!=a.level;return Qr(Xr(e,et(r,u?a.to:a.from,u?"before":"after"),"line",t,n),o,l,!0)}),0,i.length-1),a=i[s];if(s>0){var u=1!=a.level,c=Xr(e,et(r,u?a.from:a.to,u?"after":"before"),"line",t,n);Qr(c,o,l,!0)&&c.top>l&&(a=i[s-1])}return a}function tn(e,t,r,n,i,o,l){var s=qr(e,t,n,l),a=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,h=null,f=0;f<i.length;f++){var d=i[f];if(!(d.from>=u||d.to<=a)){var p=Wr(e,n,1!=d.level?Math.min(u,d.to)-1:Math.max(a,d.from)).right,g=p<o?o-p+1e9:p-o;(!c||h>g)&&(c=d,h=g)}}return c||(c=i[i.length-1]),c.from<a&&(c={from:a,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function rn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Hr){Hr=O("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Hr.appendChild(document.createTextNode("x")),Hr.appendChild(O("br"));Hr.appendChild(document.createTextNode("x"))}N(e.measure,Hr);var r=Hr.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),M(e.measure),r||1}function nn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=O("span","xxxxxxxxxx"),r=O("pre",[t],"CodeMirror-line-like");N(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function on(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var s=e.display.gutterSpecs[l].className;r[s]=o.offsetLeft+o.clientLeft+i,n[s]=o.clientWidth}return{fixedPos:ln(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function ln(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sn(e){var t=rn(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/nn(e.display)-3);return function(i){if(Gt(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function an(e){var t=e.doc,r=sn(e);t.iter((function(e){var t=r(e);t!=e.height&&$e(e,t)}))}function un(e,t,r,n){var i=e.display;if(!r&&"true"==Se(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(t){return null}var a,u=$r(e,o,l);if(n&&u.xRel>0&&(a=Xe(e.doc,u.line).text).length==u.ch){var c=z(a,a.length,e.options.tabSize)-a.length;u=et(u.line,Math.max(0,Math.round((o-Lr(e.display).left)/nn(e.display))-c))}return u}function cn(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function hn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Ct&&Rt(e.doc,t)<i.viewTo&&dn(e);else if(r<=i.viewFrom)Ct&&Bt(e.doc,r+n)>i.viewFrom?dn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)dn(e);else if(t<=i.viewFrom){var o=pn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):dn(e)}else if(r>=i.viewTo){var l=pn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):dn(e)}else{var s=pn(e,t,t,-1),a=pn(e,r,r+n,1);s&&a?(i.view=i.view.slice(0,s.index).concat(ir(e,s.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=n):dn(e)}var u=i.externalMeasured;u&&(r<u.lineN?u.lineN+=n:t<u.lineN+u.size&&(i.externalMeasured=null))}function fn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[cn(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==B(l,r)&&l.push(r)}}}function dn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function pn(e,t,r,n){var i,o=cn(e,t),l=e.display.view;if(!Ct||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,a=0;a<o;a++)s+=l[a].size;if(s!=t){if(n>0){if(o==l.length-1)return null;i=s+l[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;Rt(e.doc,r)!=r;){if(o==(n<0?0:l.length-1))return null;r+=n*l[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function gn(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function vn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function mn(e,t){void 0===t&&(t=!0);for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),l=0;l<r.sel.ranges.length;l++)if(t||l!=r.sel.primIndex){var s=r.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var a=s.empty();(a||e.options.showCursorWhenSelecting)&&yn(e,s.head,i),a||wn(e,s,o)}}return n}function yn(e,t,r){var n=Xr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(O("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(O("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function bn(e,t){return e.top-t.top||e.left-t.left}function wn(e,t,r){var n=e.display,i=e.doc,o=document.createDocumentFragment(),l=Lr(e.display),s=l.left,a=Math.max(n.sizerWidth,Tr(e)-n.sizer.offsetLeft)-l.right,u="ltr"==i.direction;function c(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),o.appendChild(O("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?a-e:r)+"px;\n height: "+(n-t)+"px"))}function h(t,r,n){var o,l,h=Xe(i,t),f=h.text.length;function d(r,n){return jr(e,et(t,r),"div",h,n)}function p(t,r,n){var i=Zr(e,h,null,t),o="ltr"==r==("after"==n)?"left":"right";return d("after"==n?i.begin:i.end-(/\s/.test(h.text.charAt(i.end-1))?2:1),o)[o]}var g=ue(h,i.direction);return function(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<r&&l.to>t||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}(g,r||0,null==n?f:n,(function(e,t,i,h){var v="ltr"==i,m=d(e,v?"left":"right"),y=d(t-1,v?"right":"left"),b=null==r&&0==e,w=null==n&&t==f,x=0==h,C=!g||h==g.length-1;if(y.top-m.top<=3){var S=(u?w:b)&&C,L=(u?b:w)&&x?s:(v?m:y).left,k=S?a:(v?y:m).right;c(L,m.top,k-L,m.bottom)}else{var T,M,N,O;v?(T=u&&b&&x?s:m.left,M=u?a:p(e,i,"before"),N=u?s:p(t,i,"after"),O=u&&w&&C?a:y.right):(T=u?p(e,i,"before"):s,M=!u&&b&&x?a:m.right,N=!u&&w&&C?s:y.left,O=u?p(t,i,"after"):a),c(T,m.top,M-T,m.bottom),m.bottom<y.top&&c(s,m.bottom,null,y.top),c(N,y.top,O-N,y.bottom)}(!o||bn(m,o)<0)&&(o=m),bn(y,o)<0&&(o=y),(!l||bn(m,l)<0)&&(l=m),bn(y,l)<0&&(l=y)})),{start:o,end:l}}var f=t.from(),d=t.to();if(f.line==d.line)h(f.line,f.ch,d.ch);else{var p=Xe(i,f.line),g=Xe(i,d.line),v=zt(p)==zt(g),m=h(f.line,f.ch,v?p.text.length+1:null).end,y=h(d.line,v?0:null,d.ch).start;v&&(m.top<y.top-2?(c(m.right,m.top,null,m.bottom),c(s,y.top,y.left,y.bottom)):c(m.right,m.top,y.left-m.right,m.bottom)),m.bottom<y.top&&c(s,m.bottom,null,y.top)}r.appendChild(o)}function xn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Cn(e){e.state.focused||(e.display.input.focus(),Ln(e))}function Sn(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,kn(e))}),100)}function Ln(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(pe(e,"focus",e,t),e.state.focused=!0,H(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),a&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),xn(e))}function kn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(pe(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Tn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=e.options.lineWrapping,a=void 0,u=0;if(!i.hidden){if(l&&s<8){var c=i.node.offsetTop+i.node.offsetHeight;a=c-r,r=c}else{var h=i.node.getBoundingClientRect();a=h.bottom-h.top,!o&&i.text.firstChild&&(u=i.text.firstChild.getBoundingClientRect().right-h.left-1)}var f=i.line.height-a;if((f>.005||f<-.005)&&($e(i.line,a),Mn(i.line),i.rest))for(var d=0;d<i.rest.length;d++)Mn(i.rest[d]);if(u>e.display.sizerWidth){var p=Math.ceil(u/nn(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Mn(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function Nn(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Cr(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=Ze(t,n),l=Ze(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;s<o?(o=s,l=Ze(t,Vt(Xe(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=Ze(t,Vt(Xe(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function On(e,t){var r=e.display,n=rn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Mr(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Sr(r),a=t.top<n,u=t.bottom>s-n;if(t.top<i)l.scrollTop=a?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(l.scrollTop=c)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,f=Tr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),d=t.right-t.left>f;return d&&(t.right=t.left+f),t.left<10?l.scrollLeft=0:t.left<h?l.scrollLeft=Math.max(0,t.left-(d?0:10)):t.right>f+h-3&&(l.scrollLeft=t.right+(d?0:10)-f),l}function An(e,t){null!=t&&(Hn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Dn(e){Hn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Wn(e,t,r){null==t&&null==r||Hn(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Hn(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Fn(e,Yr(e,t.from),Yr(e,t.to),t.margin))}function Fn(e,t,r,n){var i=On(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Wn(e,i.scrollLeft,i.scrollTop)}function Pn(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||ai(e,{top:t}),En(e,t,!0),r&&ai(e),ni(e,100))}function En(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function In(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,hi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function zn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Sr(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?r:0,docHeight:n,scrollHeight:n+kr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Rn=function(e,t,r){this.cm=r;var n=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),he(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),he(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,l&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Rn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n: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=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Rn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Rn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Rn.prototype.zeroWidthHack=function(){var e=y&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new R,this.disableVert=new R},Rn.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,(function n(){var i=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)}))},Rn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Bn=function(){};function Gn(e,t){t||(t=zn(e));var r=e.display.barWidth,n=e.display.barHeight;Un(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Tn(e),Un(e,zn(e)),r=e.display.barWidth,n=e.display.barHeight}function Un(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}Bn.prototype.update=function(){return{bottom:0,right:0}},Bn.prototype.setScrollLeft=function(){},Bn.prototype.setScrollTop=function(){},Bn.prototype.clear=function(){};var Vn={native:Rn,null:Bn};function Kn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Vn[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,r){"horizontal"==r?In(e,t):Pn(e,t)}),e),e.display.scrollbars.addClass&&H(e.display.wrapper,e.display.scrollbars.addClass)}var jn=0;function Xn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++jn},t=e.curOp,or?or.ops.push(t):t.ownsGroup=or={ops:[t],delayedCallbacks:[]}}function Yn(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}(r)}finally{or=null,t(r)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)_n(t[r]);for(var n=0;n<t.length;n++)$n(t[n]);for(var i=0;i<t.length;i++)qn(t[i]);for(var o=0;o<t.length;o++)Zn(t[o]);for(var l=0;l<t.length;l++)Qn(t[l])}(e)}))}function _n(e){var t=e.cm,r=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=kr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=kr(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&jt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new oi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function $n(e){e.updatedDisplay=e.mustUpdate&&li(e.cm,e.update)}function qn(e){var t=e.cm,r=t.display;e.updatedDisplay&&Tn(t),e.barMeasure=zn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Or(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+kr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Tr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Zn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&In(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==W();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Gn(t,e.barMeasure),e.updatedDisplay&&ci(t,e.barMeasure),e.selectionChanged&&xn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Cn(e.cm)}function Qn(e){var t=e.cm,r=t.display,n=t.doc;(e.updatedDisplay&&si(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&En(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&In(t,e.scrollLeft,!0,!0),e.scrollToPos)&&function(e,t){if(!ge(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=O("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Cr(e.display))+"px;\n height: "+(t.bottom-t.top+kr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?et(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var l=!1,s=Xr(e,t),a=r&&r!=t?Xr(e,r):s,u=On(e,i={left:Math.min(s.left,a.left),top:Math.min(s.top,a.top)-n,right:Math.max(s.left,a.left),bottom:Math.max(s.bottom,a.bottom)+n}),c=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=u.scrollTop&&(Pn(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(l=!0)),null!=u.scrollLeft&&(In(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(l=!0)),!l)break}return i}(t,st(n,e.scrollToPos.from),st(n,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var l=0;l<i.length;++l)i[l].lines.length||pe(i[l],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&pe(o[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&pe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Jn(e,t){if(e.curOp)return t();Xn(e);try{return t()}finally{Yn(e)}}function ei(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Xn(e);try{return t.apply(e,arguments)}finally{Yn(e)}}}function ti(e){return function(){if(this.curOp)return e.apply(this,arguments);Xn(this);try{return e.apply(this,arguments)}finally{Yn(this)}}}function ri(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Xn(t);try{return e.apply(this,arguments)}finally{Yn(t)}}}function ni(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,E(ii,e))}function ii(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=dt(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(n.line>=e.display.viewFrom){var l=o.styles,s=o.text.length>e.options.maxHighlightLength?Ue(t.mode,n.state):null,a=ht(e,o,n,!0);s&&(n.state=s),o.styles=a.styles;var u=o.styleClasses,c=a.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!h&&f<l.length;++f)h=l[f]!=o.styles[f];h&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=e.options.maxHighlightLength&&pt(e,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return ni(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&Jn(e,(function(){for(var t=0;t<i.length;t++)fn(e,i[t],"text")}))}}var oi=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Nn(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Tr(e),this.force=r,this.dims=on(e),this.events=[]};function li(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return dn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==gn(e))return!1;fi(e)&&(dn(e),t.dims=on(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>l&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),Ct&&(o=Rt(e.doc,o),l=Bt(e.doc,l));var s=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=ir(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=ir(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(cn(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(ir(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,cn(e,r)))),n.viewTo=r}(e,o,l),r.viewOffset=Vt(Xe(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var u=gn(e);if(!s&&0==u&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=W();if(!t||!D(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&D(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return u>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,l=o.firstChild;function s(t){var r=t.nextSibling;return a&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var u=n.view,c=n.viewFrom,h=0;h<u.length;h++){var f=u[h];if(f.hidden);else if(f.node&&f.node.parentNode==o){for(;l!=f.node;)l=s(l);var d=i&&null!=t&&t<=c&&f.lineNumber;f.changes&&(B(f.changes,"gutter")>-1&&(d=!1),ur(e,f,c,r)),d&&(M(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(Je(e.options,c)))),l=f.node.nextSibling}else{var p=vr(e,f,c,r);o.insertBefore(p,l)}c+=f.size}for(;l;)l=s(l)}(e,r.updateLineNumbers,t.dims),u>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=W()&&(e.activeElt.focus(),e.anchorNode&&D(document.body,e.anchorNode)&&D(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(c),M(r.cursorDiv),M(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ni(e,400)),r.updateLineNumbers=null,!0}function si(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Tr(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Sr(e.display)-Mr(e),r.top)}),t.visible=Nn(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&li(e,t);n=!1){Tn(e);var i=zn(e);vn(e),Gn(e,i),ci(e,i),t.force=!1}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 ai(e,t){var r=new oi(e,t);if(li(e,r)){Tn(e),si(e,r);var n=zn(e);vn(e),Gn(e,n),ci(e,n),r.finish()}}function ui(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ci(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+kr(e)+"px"}function hi(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=ln(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l<r.length;l++)if(!r[l].hidden){e.options.fixedGutter&&(r[l].gutter&&(r[l].gutter.style.left=o),r[l].gutterBackground&&(r[l].gutterBackground.style.left=o));var s=r[l].alignable;if(s)for(var a=0;a<s.length;a++)s[a].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function fi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=Je(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(O("div",[O("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",ui(e.display),!0}return!1}function di(e,t){for(var r=[],n=!1,i=0;i<e.length;i++){var o=e[i],l=null;if("string"!=typeof o&&(l=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;n=!0}r.push({className:o,style:l})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function pi(e){var t=e.gutters,r=e.gutterSpecs;M(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var i=r[n],o=i.className,l=i.style,s=t.appendChild(O("div",null,"CodeMirror-gutter "+o));l&&(s.style.cssText=l),"CodeMirror-linenumbers"==o&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",ui(e)}function gi(e){pi(e.display),hn(e),hi(e)}function vi(e,t,n,i){var o=this;this.input=n,o.scrollbarFiller=O("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=O("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=A("div",null,"CodeMirror-code"),o.selectionDiv=O("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=O("div",null,"CodeMirror-cursors"),o.measure=O("div",null,"CodeMirror-measure"),o.lineMeasure=O("div",null,"CodeMirror-measure"),o.lineSpace=A("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var u=A("div",[o.lineSpace],"CodeMirror-lines");o.mover=O("div",[u],null,"position: relative"),o.sizer=O("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=O("div",null,null,"position: absolute; height: 30px; width: 1px;"),o.gutters=O("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=O("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=O("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),l&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),a||r&&m||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=di(i.gutters,i.lineNumbers),pi(o),n.init(o)}oi.prototype.signal=function(e,t){me(e,t)&&this.events.push(arguments)},oi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)pe.apply(null,this.events[e])};var mi=0,yi=null;function bi(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function wi(e){var t=bi(e);return t.x*=yi,t.y*=yi,t}function xi(e,t){var n=bi(t),i=n.x,o=n.y,l=e.display,s=l.scroller,u=s.scrollWidth>s.clientWidth,c=s.scrollHeight>s.clientHeight;if(i&&u||o&&c){if(o&&y&&a)e:for(var f=t.target,d=l.view;f!=s;f=f.parentNode)for(var p=0;p<d.length;p++)if(d[p].node==f){e.display.currentWheelTarget=f;break e}if(i&&!r&&!h&&null!=yi)return o&&c&&Pn(e,Math.max(0,s.scrollTop+o*yi)),In(e,Math.max(0,s.scrollLeft+i*yi)),(!o||o&&c)&&be(t),void(l.wheelStartX=null);if(o&&null!=yi){var g=o*yi,v=e.doc.scrollTop,m=v+l.wrapper.clientHeight;g<0?v=Math.max(0,v+g-50):m=Math.min(e.doc.height,m+g+50),ai(e,{top:v,bottom:m})}mi<20&&(null==l.wheelStartX?(l.wheelStartX=s.scrollLeft,l.wheelStartY=s.scrollTop,l.wheelDX=i,l.wheelDY=o,setTimeout((function(){if(null!=l.wheelStartX){var e=s.scrollLeft-l.wheelStartX,t=s.scrollTop-l.wheelStartY,r=t&&l.wheelDY&&t/l.wheelDY||e&&l.wheelDX&&e/l.wheelDX;l.wheelStartX=l.wheelStartY=null,r&&(yi=(yi*mi+r)/(mi+1),++mi)}}),200)):(l.wheelDX+=i,l.wheelDY+=o))}}l?yi=-.53:r?yi=15:c?yi=-.7:f&&(yi=-1/3);var Ci=function(e,t){this.ranges=e,this.primIndex=t};Ci.prototype.primary=function(){return this.ranges[this.primIndex]},Ci.prototype.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 r=this.ranges[t],n=e.ranges[t];if(!rt(r.anchor,n.anchor)||!rt(r.head,n.head))return!1}return!0},Ci.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Si(nt(this.ranges[t].anchor),nt(this.ranges[t].head));return new Ci(e,this.primIndex)},Ci.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ci.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(tt(t,n.from())>=0&&tt(e,n.to())<=0)return r}return-1};var Si=function(e,t){this.anchor=e,this.head=t};function Li(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort((function(e,t){return tt(e.from(),t.from())})),r=B(t,i);for(var o=1;o<t.length;o++){var l=t[o],s=t[o-1],a=tt(s.to(),l.from());if(n&&!l.empty()?a>0:a>=0){var u=ot(s.from(),l.from()),c=it(s.to(),l.to()),h=s.empty()?l.from()==l.head:s.from()==s.head;o<=r&&--r,t.splice(--o,2,new Si(h?c:u,h?u:c))}}return new Ci(t,r)}function ki(e,t){return new Ci([new Si(e,t||e)],0)}function Ti(e){return e.text?et(e.from.line+e.text.length-1,_(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Mi(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Ti(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Ti(t).ch-t.to.ch),et(r,n)}function Ni(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new Si(Mi(i.anchor,t),Mi(i.head,t)))}return Li(e.cm,r,e.sel.primIndex)}function Oi(e,t,r){return e.line==t.line?et(r.line,e.ch-t.ch+r.ch):et(r.line+(e.line-t.line),e.ch)}function Ai(e){e.doc.mode=Re(e.options,e.doc.modeOption),Di(e)}function Di(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ni(e,100),e.state.modeGen++,e.curOp&&hn(e)}function Wi(e,t){return 0==t.from.ch&&0==t.to.ch&&""==_(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Hi(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){!function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Nt(e),Ot(e,r);var i=n?n(e):1;i!=e.height&&$e(e,i)}(e,r,i,n),sr(e,"change",e,t)}function l(e,t){for(var r=[],o=e;o<t;++o)r.push(new Xt(u[o],i(o),n));return r}var s=t.from,a=t.to,u=t.text,c=Xe(e,s.line),h=Xe(e,a.line),f=_(u),d=i(u.length-1),p=a.line-s.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(Wi(e,t)){var g=l(0,u.length-1);o(h,h.text,d),p&&e.remove(s.line,p),g.length&&e.insert(s.line,g)}else if(c==h)if(1==u.length)o(c,c.text.slice(0,s.ch)+f+c.text.slice(a.ch),d);else{var v=l(1,u.length-1);v.push(new Xt(f+c.text.slice(a.ch),d,n)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,v)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+h.text.slice(a.ch),i(0)),e.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(h,f+h.text.slice(a.ch),d);var m=l(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,m)}sr(e,"change",e,t)}function Fi(e,t,r){!function e(n,i,o){if(n.linked)for(var l=0;l<n.linked.length;++l){var s=n.linked[l];if(s.doc!=i){var a=o&&s.sharedHist;r&&!a||(t(s.doc,a),e(s.doc,n,a))}}}(e,null,!0)}function Pi(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,an(e),Ai(e),Ei(e),e.options.lineWrapping||jt(e),e.options.mode=t.modeOption,hn(e)}function Ei(e){("rtl"==e.doc.direction?H:T)(e.display.lineDiv,"CodeMirror-rtl")}function Ii(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 zi(e,t){var r={from:nt(t.from),to:Ti(t),text:Ye(e,t.from,t.to)};return Vi(e,r,t.from.line,t.to.line+1),Fi(e,(function(e){return Vi(e,r,t.from.line,t.to.line+1)}),!0),r}function Ri(e){for(;e.length;){if(!_(e).ranges)break;e.pop()}}function Bi(e,t,r,n){var i=e.history;i.undone.length=0;var o,l,s=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Ri(e.done),_(e.done)):e.done.length&&!_(e.done).ranges?_(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),_(e.done)):void 0}(i,i.lastOp==n)))l=_(o.changes),0==tt(t.from,t.to)&&0==tt(t.from,l.to)?l.to=Ti(t):o.changes.push(zi(e,t));else{var a=_(i.done);for(a&&a.ranges||Ui(e.sel,i.done),o={changes:[zi(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(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,l||pe(e,"historyAdded")}function Gi(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,_(i.done),t))?i.done[i.done.length-1]=t:Ui(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&Ri(i.undone)}function Ui(e,t){var r=_(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Vi(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),(function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o}))}function Ki(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function ji(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(Ki(r[i]));return n}(e,t),n=Tt(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],l=n[i];if(o&&l)e:for(var s=0;s<l.length;++s){for(var a=l[s],u=0;u<o.length;++u)if(o[u].marker==a.marker)continue e;o.push(a)}else l&&(r[i]=l)}return r}function Xi(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?Ci.prototype.deepCopy.call(o):o);else{var l=o.changes,s=[];n.push({changes:s});for(var a=0;a<l.length;++a){var u=l[a],c=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(c=h.match(/^spans_(\d+)$/))&&B(t,Number(c[1]))>-1&&(_(s)[h]=u[h],delete u[h])}}}return n}function Yi(e,t,r,n){if(n){var i=e.anchor;if(r){var o=tt(t,i)<0;o!=tt(r,i)<0?(i=t,t=r):o!=tt(t,r)<0&&(t=r)}return new Si(i,t)}return new Si(r||t,t)}function _i(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ji(e,new Ci([Yi(e.sel.primary(),t,r,i)],0),n)}function $i(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=Yi(e.sel.ranges[o],t[o],null,i);Ji(e,Li(e.cm,n,e.sel.primIndex),r)}function qi(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,Ji(e,Li(e.cm,i,e.sel.primIndex),n)}function Zi(e,t,r,n){Ji(e,ki(t,r),n)}function Qi(e,t,r){var n=e.history.done,i=_(n);i&&i.ranges?(n[n.length-1]=t,eo(e,t,r)):Ji(e,t,r)}function Ji(e,t,r){eo(e,t,r),Gi(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function eo(e,t,r){(me(e,"beforeSelectionChange")||e.cm&&me(e.cm,"beforeSelectionChange"))&&(t=function(e,t,r){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new Si(st(e,t[r].anchor),st(e,t[r].head))},origin:r&&r.origin};return pe(e,"beforeSelectionChange",e,n),e.cm&&pe(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Li(e.cm,n.ranges,n.ranges.length-1):t}(e,t,r));var n=r&&r.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);to(e,no(e,t,n,!0)),r&&!1===r.scroll||!e.cm||Dn(e.cm)}function to(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ve(e.cm)),sr(e,"cursorActivity",e))}function ro(e){to(e,no(e,e.sel,null,!1))}function no(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],a=oo(e,l.anchor,s&&s.anchor,r,n),u=oo(e,l.head,s&&s.head,r,n);(i||a!=l.anchor||u!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Si(a,u))}return i?Li(e.cm,i,t.primIndex):t}function io(e,t,r,n,i){var o=Xe(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var s=o.markedSpans[l],a=s.marker,u="selectLeft"in a?!a.selectLeft:a.inclusiveLeft,c="selectRight"in a?!a.selectRight:a.inclusiveRight;if((null==s.from||(u?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(c?s.to>=t.ch:s.to>t.ch))){if(i&&(pe(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(r){var h=a.find(n<0?1:-1),f=void 0;if((n<0?c:u)&&(h=lo(e,h,-n,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(f=tt(h,r))&&(n<0?f<0:f>0))return io(e,h,t,n,i)}var d=a.find(n<0?-1:1);return(n<0?u:c)&&(d=lo(e,d,n,d.line==t.line?o:null)),d?io(e,d,t,n,i):null}}return t}function oo(e,t,r,n,i){var o=n||1,l=io(e,t,r,o,i)||!i&&io(e,t,r,o,!0)||io(e,t,r,-o,i)||!i&&io(e,t,r,-o,!0);return l||(e.cantEdit=!0,et(e.first,0))}function lo(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?st(e,et(t.line-1)):null:r>0&&t.ch==(n||Xe(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+r)}function so(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),U)}function ao(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,i,o){t&&(n.from=st(e,t)),r&&(n.to=st(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),pe(e,"beforeChange",e,n),e.cm&&pe(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function uo(e,t,r){if(e.cm){if(!e.cm.curOp)return ei(e.cm,uo)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"))||(t=ao(e,t,!0))){var n=xt&&!r&&function(e,t,r){var n=null;if(e.iter(t.line,r.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=B(n,r)||(n||(n=[])).push(r)}})),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var l=n[o],s=l.find(0),a=0;a<i.length;++a){var u=i[a];if(!(tt(u.to,s.from)<0||tt(u.from,s.to)>0)){var c=[a,1],h=tt(u.from,s.from),f=tt(u.to,s.to);(h<0||!l.inclusiveLeft&&!h)&&c.push({from:u.from,to:s.from}),(f>0||!l.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)co(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else co(e,t)}}function co(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var r=Ni(e,t);Bi(e,t,r,e.cm?e.cm.curOp.id:NaN),po(e,t,r,Tt(e,t));var n=[];Fi(e,(function(e,r){r||-1!=B(n,e.history)||(yo(e.history,t),n.push(e.history)),po(e,t,null,Tt(e,t))}))}}function ho(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var i,o=e.history,l=e.sel,s="undo"==t?o.done:o.undone,a="undo"==t?o.undone:o.done,u=0;u<s.length&&(i=s[u],r?!i.ranges||i.equals(e.sel):i.ranges);u++);if(u!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(n)return void s.push(i);break}if(Ui(i,a),r&&!i.equals(e.sel))return void Ji(e,i,{clearRedo:!1});l=i}var c=[];Ui(l,a),a.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var h=me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"),f=function(r){var n=i.changes[r];if(n.origin=t,h&&!ao(e,n,!1))return s.length=0,{};c.push(zi(e,n));var o=r?Ni(e,n):_(s);po(e,n,o,ji(e,n)),!r&&e.cm&&e.cm.scrollIntoView({from:n.from,to:Ti(n)});var l=[];Fi(e,(function(e,t){t||-1!=B(l,e.history)||(yo(e.history,n),l.push(e.history)),po(e,n,null,ji(e,n))}))},d=i.changes.length-1;d>=0;--d){var p=f(d);if(p)return p.v}}}}function fo(e,t){if(0!=t&&(e.first+=t,e.sel=new Ci($(e.sel.ranges,(function(e){return new Si(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){hn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)fn(e.cm,n,"gutter")}}function po(e,t,r,n){if(e.cm&&!e.cm.curOp)return ei(e.cm,po)(e,t,r,n);if(t.to.line<e.first)fo(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);fo(e,i),t={from:et(e.first,0),to:et(t.to.line+i,t.to.ch),text:[_(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:et(o,Xe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ye(e,t.from,t.to),r||(r=Ni(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,l=t.to,s=!1,a=o.line;e.options.lineWrapping||(a=qe(zt(Xe(n,o.line))),n.iter(a,l.line+1,(function(e){if(e==i.maxLine)return s=!0,!0})));n.sel.contains(t.from,t.to)>-1&&ve(e);Hi(n,t,r,sn(e)),e.options.lineWrapping||(n.iter(a,o.line+t.text.length,(function(e){var t=Kt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var i=Xe(e,n).stateAfter;if(i&&(!(i instanceof ut)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}})(n,o.line),ni(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?hn(e):o.line!=l.line||1!=t.text.length||Wi(e.doc,t)?hn(e,o.line,l.line+1,u):fn(e,o.line,"text");var c=me(e,"changes"),h=me(e,"change");if(h||c){var f={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};h&&sr(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,n):Hi(e,t,n),eo(e,r,U),e.cantEdit&&oo(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function go(e,t,r,n,i){var o;n||(n=r),tt(n,r)<0&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),uo(e,{from:r,to:n,text:t,origin:i})}function vo(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function mo(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)vo(o.ranges[s].anchor,t,r,n),vo(o.ranges[s].head,t,r,n)}else{for(var a=0;a<o.changes.length;++a){var u=o.changes[a];if(r<u.from.line)u.from=et(u.from.line+n,u.from.ch),u.to=et(u.to.line+n,u.to.ch);else if(t<=u.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function yo(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;mo(e.done,r,n,i),mo(e.undone,r,n,i)}function bo(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=Xe(e,lt(e,t)):i=qe(t),null==i?null:(n(o,i)&&e.cm&&fn(e.cm,i,r),o)}function wo(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function xo(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}Si.prototype.from=function(){return ot(this.anchor,this.head)},Si.prototype.to=function(){return it(this.anchor,this.head)},Si.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},wo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r];this.height-=i.height,Yt(i),sr(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},xo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var o=Math.min(t,i-e),l=n.height;if(n.removeInner(e,o),this.height-=l-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof wo))){var s=[];this.collapse(s),this.children=[new wo(s)],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,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(var l=i.lines.length%25+25,s=l;s<i.lines.length;){var a=new wo(i.lines.slice(s,s+=25));i.height-=a.height,this.children.splice(++n,0,a),a.parent=this}i.lines=i.lines.slice(0,l),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new xo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=B(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new xo(e.children);n.parent=e,e.children=[n,t],e=n}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e);if(i.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var Co=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};function So(e,t,r){Vt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&An(e,r)}Co.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=qe(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=wr(this);$e(r,Math.max(0,r.height-o)),e&&(Jn(e,(function(){So(e,r,-o),fn(e,n,"widget")})),sr(e,"lineWidgetCleared",e,this,n))}},Co.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=wr(this)-t;i&&(Gt(this.doc,n)||$e(n,n.height+i),r&&Jn(r,(function(){r.curOp.forceUpdate=!0,So(r,n,i),sr(r,"lineWidgetChanged",r,e,qe(n))})))},ye(Co);var Lo=0,ko=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Lo};function To(e,t,r,n,i){if(n&&n.shared)return function(e,t,r,n,i){(n=I(n)).shared=!1;var o=[To(e,t,r,n,i)],l=o[0],s=n.widgetNode;return Fi(e,(function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(To(e,st(e,t),st(e,r),n,i));for(var a=0;a<e.linked.length;++a)if(e.linked[a].isParent)return;l=_(o)})),new Mo(o,l)}(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return ei(e.cm,To)(e,t,r,n,i);var o=new ko(e,i),l=tt(t,r);if(n&&I(n,o,!1),l>0||0==l&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=A("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(It(e,t.line,t,r,o)||t.line!=r.line&&It(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ct=!0}o.addToHistory&&Bi(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,a=t.line,u=e.cm;if(e.iter(a,r.line+1,(function(e){u&&o.collapsed&&!u.options.lineWrapping&&zt(e)==u.display.maxLine&&(s=!0),o.collapsed&&a!=t.line&&$e(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new St(o,a==t.line?t.ch:null,a==r.line?r.ch:null)),++a})),o.collapsed&&e.iter(t.line,r.line+1,(function(t){Gt(e,t)&&$e(t,0)})),o.clearOnEnter&&he(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(xt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Lo,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)hn(u,t.line,r.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=r.line;c++)fn(u,c,"text");o.atomic&&ro(u.doc),sr(u,"markerAdded",u,o)}return o}ko.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Xn(e),me(this,"clear")){var r=this.find();r&&sr(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],s=Lt(l.markedSpans,this);e&&!this.collapsed?fn(e,qe(l),"text"):e&&(null!=s.to&&(i=qe(l)),null!=s.from&&(n=qe(l))),l.markedSpans=kt(l.markedSpans,s),null==s.from&&this.collapsed&&!Gt(this.doc,l)&&e&&$e(l,rn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var a=0;a<this.lines.length;++a){var u=zt(this.lines[a]),c=Kt(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&hn(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ro(e.doc)),e&&sr(e,"markerCleared",e,this,n,i),t&&Yn(e),this.parent&&this.parent.clear()}},ko.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],l=Lt(o.markedSpans,this);if(null!=l.from&&(r=et(t?o:qe(o),l.from),-1==e))return r;if(null!=l.to&&(n=et(t?o:qe(o),l.to),1==e))return n}return r&&{from:r,to:n}},ko.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&Jn(n,(function(){var i=t.line,o=qe(t.line),l=Ar(n,o);if(l&&(Ir(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Gt(r.doc,i)&&null!=r.height){var s=r.height;r.height=null;var a=wr(r)-s;a&&$e(i,i.height+a)}sr(n,"markerChanged",n,e)}))},ko.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=B(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ko.prototype.detachLine=function(e){if(this.lines.splice(B(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(ko);var Mo=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function No(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function Oo(e){for(var t=function(t){var r=e[t],n=[r.primary.doc];Fi(r.primary.doc,(function(e){return n.push(e)}));for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==B(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}},r=0;r<e.length;r++)t(r)}Mo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();sr(this,"clear")}},Mo.prototype.find=function(e,t){return this.primary.find(e,t)},ye(Mo);var Ao=0,Do=function(e,t,r,n,i){if(!(this instanceof Do))return new Do(e,t,r,n,i);null==r&&(r=0),xo.call(this,[new wo([new Xt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=et(r,0);this.sel=ki(o),this.history=new Ii(null),this.id=++Ao,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Hi(this,{from:o,to:o,text:e}),Ji(this,ki(o),U)};Do.prototype=Z(xo.prototype,{constructor:Do,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=_e(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ri((function(e){var t=et(this.first,0),r=this.first+this.size-1;uo(this,{from:t,to:et(r,Xe(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Wn(this.cm,0,0),Ji(this,ki(t),U)})),replaceRange:function(e,t,r,n){go(this,e,t=st(this,t),r=r?st(this,r):t,n)},getRange:function(e,t,r){var n=Ye(this,st(this,e),st(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Qe(this,e))return Xe(this,e)},getLineNumber:function(e){return qe(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Xe(this,e)),zt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return st(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ri((function(e,t,r){Zi(this,st(this,"number"==typeof e?et(e,t||0):e),null,r)})),setSelection:ri((function(e,t,r){Zi(this,st(this,e),st(this,t||e),r)})),extendSelection:ri((function(e,t,r){_i(this,st(this,e),t&&st(this,t),r)})),extendSelections:ri((function(e,t){$i(this,at(this,e),t)})),extendSelectionsBy:ri((function(e,t){$i(this,at(this,$(this.sel.ranges,e)),t)})),setSelections:ri((function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new Si(st(this,e[i].anchor),st(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Ji(this,Li(this.cm,n,t),r)}})),addSelection:ri((function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Si(st(this,e),st(this,t||e))),Ji(this,Li(this.cm,n,n.length-1),r)})),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=Ye(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=Ye(this,r[n].from(),r[n].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:ri((function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];n[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:r}}for(var s=t&&"end"!=t&&function(e,t,r){for(var n=[],i=et(e.first,0),o=i,l=0;l<t.length;l++){var s=t[l],a=Oi(s.from,i,o),u=Oi(Ti(s),i,o);if(i=s.to,o=u,"around"==r){var c=e.sel.ranges[l],h=tt(c.head,c.anchor)<0;n[l]=new Si(h?u:a,h?a:u)}else n[l]=new Si(a,a)}return new Ci(n,e.sel.primIndex)}(this,n,t),a=n.length-1;a>=0;a--)uo(this,n[a]);s?Qi(this,s):this.cm&&Dn(this.cm)})),undo:ri((function(){ho(this,"undo")})),redo:ri((function(){ho(this,"redo")})),undoSelection:ri((function(){ho(this,"undo",!0)})),redoSelection:ri((function(){ho(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Ii(this.history.maxGeneration),Fi(this,(function(t){return t.history=e.history}),!0)},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:Xi(this.history.done),undone:Xi(this.history.undone)}},setHistory:function(e){var t=this.history=new Ii(this.history.maxGeneration);t.done=Xi(e.done.slice(0),null,!0),t.undone=Xi(e.undone.slice(0),null,!0)},setGutterMarker:ri((function(e,t,r){return bo(this,e,"gutter",(function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&te(n)&&(e.gutterMarkers=null),!0}))})),clearGutter:ri((function(e){var t=this;this.iter((function(r){r.gutterMarkers&&r.gutterMarkers[e]&&bo(t,r,"gutter",(function(){return r.gutterMarkers[e]=null,te(r.gutterMarkers)&&(r.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Qe(this,e))return null;if(t=e,!(e=Xe(this,e)))return null}else if(null==(t=qe(e)))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}},addLineClass:ri((function(e,t,r){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(L(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0}))})),removeLineClass:ri((function(e,t,r){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[n];if(!i)return!1;if(null==r)e[n]=null;else{var o=i.match(L(r));if(!o)return!1;var l=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&l!=i.length?" ":"")+i.slice(l)||null}return!0}))})),addLineWidget:ri((function(e,t,r){return function(e,t,r,n){var i=new Co(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),bo(e,t,"widget",(function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Gt(e,t)){var n=Vt(t)<e.scrollTop;$e(t,t.height+wr(i)),n&&An(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&sr(o,"lineWidgetAdded",o,i,"number"==typeof t?t:qe(t)),i}(this,e,t,r)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return To(this,st(this,e),st(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return To(this,e=st(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=Xe(this,(e=st(this,e)).line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(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,r){e=st(this,e),t=st(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var l=o.markedSpans;if(l)for(var s=0;s<l.length;s++){var a=l[s];null!=a.to&&i==e.line&&e.ch>=a.to||null==a.from&&i!=e.line||null!=a.from&&i==t.line&&a.from>=t.ch||r&&!r(a.marker)||n.push(a.marker.parent||a.marker)}++i})),n},getAllMarks:function(){var e=[];return this.iter((function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)})),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+n;if(o>e)return t=e,!0;e-=o,++r})),st(this,et(r,t))},indexFromPos:function(e){var t=(e=st(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+r})),t},copy:function(e){var t=new Do(_e(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);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,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new Do(_e(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(tt(o,l)){var s=To(e,o,l,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}(n,No(this)),n},unlinkDoc:function(e){if(e instanceof Ml&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Oo(No(this));break}}if(e.history==this.history){var r=[e.id];Fi(e,(function(e){return r.push(e.id)}),!0),e.history=new Ii(null),e.history.done=Xi(this.history.done,r),e.history.undone=Xi(this.history.undone,r)}},iterLinkedDocs:function(e){Fi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):De(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ri((function(e){var t;("rtl"!=e&&(e="ltr"),e!=this.direction)&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Jn(t=this.cm,(function(){Ei(t),hn(t)})))}))}),Do.prototype.eachLine=Do.prototype.iter;var Wo=0;function Ho(e){var t=this;if(Fo(t),!ge(t,e)&&!xr(t.display,e)){be(e),l&&(Wo=+new Date);var r=un(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),s=0,a=function(){++s==i&&ei(t,(function(){var e={from:r=st(t.doc,r),to:r,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};uo(t.doc,e),Qi(t.doc,ki(st(t.doc,r),st(t.doc,Ti(e))))}))()},u=function(e,r){if(t.options.allowDropFileTypes&&-1==B(t.options.allowDropFileTypes,e.type))a();else{var n=new FileReader;n.onerror=function(){return a()},n.onload=function(){var e=n.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)?a():(o[r]=e,a())},n.readAsText(e)}},c=0;c<n.length;c++)u(n[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var h=e.dataTransfer.getData("Text");if(h){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),eo(t.doc,ki(r,r)),f)for(var d=0;d<f.length;++d)go(t.doc,"",f[d].anchor,f[d].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Fo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Po(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var i=t[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation((function(){for(var t=0;t<r.length;t++)e(r[t])}))}}var Eo=!1;function Io(){var e;Eo||(he(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Po(zo)}),100))})),he(window,"blur",(function(){return Po(kn)})),Eo=!0)}function zo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ro={3:"Pause",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:"/",145:"ScrollLock",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"},Bo=0;Bo<10;Bo++)Ro[Bo+48]=Ro[Bo+96]=String(Bo);for(var Go=65;Go<=90;Go++)Ro[Go]=String.fromCharCode(Go);for(var Uo=1;Uo<=12;Uo++)Ro[Uo+111]=Ro[Uo+63235]="F"+Uo;var Vo={};function Ko(e){var t,r,n,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var l=0;l<o.length-1;l++){var s=o[l];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function jo(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=$(r.split(" "),Ko),o=0;o<i.length;o++){var l=void 0,s=void 0;o==i.length-1?(s=i.join(" "),l=n):(s=i.slice(0,o+1).join(" "),l="...");var a=t[s];if(a){if(a!=l)throw new Error("Inconsistent bindings for "+s)}else t[s]=l}delete e[r]}for(var u in t)e[u]=t[u];return e}function Xo(e,t,r,n){var i=(t=qo(t)).call?t.call(e,n):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Xo(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var l=Xo(e,t.fallthrough[o],r,n);if(l)return l}}}function Yo(e){var t="string"==typeof e?e:Ro[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function _o(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function $o(e,t){if(h&&34==e.keyCode&&e.char)return!1;var r=Ro[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),_o(r,e,t))}function qo(e){return"string"==typeof e?Vo[e]:e}function Zo(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&tt(o.from,_(n).to)<=0;){var l=n.pop();if(tt(l.from,o.from)<0){o.from=l.from;break}}n.push(o)}Jn(e,(function(){for(var t=n.length-1;t>=0;t--)go(e.doc,"",n[t].from,n[t].to,"+delete");Dn(e)}))}function Qo(e,t,r){var n=ie(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Jo(e,t,r){var n=Qo(e,t.ch,r);return null==n?null:new et(t.line,n,r<0?"after":"before")}function el(e,t,r,n,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=ue(r,t.doc.direction);if(o){var l,s=i<0?_(o):o[0],a=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=Dr(t,r);l=i<0?r.text.length-1:0;var c=Wr(t,u,l).top;l=oe((function(e){return Wr(t,u,e).top==c}),i<0==(1==s.level)?s.from:s.to-1,l),"before"==a&&(l=Qo(r,l,1))}else l=i<0?s.to:s.from;return new et(n,l,a)}}return new et(n,i<0?r.text.length:0,i<0?"before":"after")}Vo.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"},Vo.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"},Vo.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","Ctrl-O":"openLine"},Vo.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"]},Vo.default=y?Vo.macDefault:Vo.pcDefault;var tl={selectAll:so,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),U)},killLine:function(e){return Zo(e,(function(t){if(t.empty()){var r=Xe(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,r)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Zo(e,(function(t){return{from:et(t.from().line,0),to:st(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Zo(e,(function(e){return{from:et(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Zo(e,(function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Zo(e,(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return rl(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return nl(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var r=Xe(e.doc,t),n=function(e){for(var t;t=Pt(e);)e=t.find(1,!0).line;return e}(r);n!=r&&(t=qe(n));return el(!0,e,r,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")}),K)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")}),K)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?nl(e,t.head):n}),K)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),l=z(e.getLine(o.line),o.ch,n);t.push(Y(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Jn(e,(function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=Xe(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new et(i.line,i.ch-1)),i.ch>0)i=new et(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),et(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=Xe(e.doc,i.line-1).text;l&&(i=new et(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),et(i.line-1,l.length-1),i,"+transpose"))}r.push(new Si(i,i))}e.setSelections(r)}))},newlineAndIndent:function(e){return Jn(e,(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Dn(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function rl(e,t){var r=Xe(e.doc,t),n=zt(r);return n!=r&&(t=qe(n)),el(!0,e,n,t,1)}function nl(e,t){var r=rl(e,t.line),n=Xe(e.doc,r.line),i=ue(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(r.ch,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return et(r.line,l?0:o,r.sticky)}return r}function il(e,t,r){if("string"==typeof t&&!(t=tl[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=G}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}var ol=new R;function ll(e,t,r,n){var i=e.state.keySeq;if(i){if(Yo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ol.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),sl(e,i+" "+t,r,n))return!0}return sl(e,t,r,n)}function sl(e,t,r,n){var i=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Xo(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Xo(t,e.options.extraKeys,r,e)||Xo(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&sr(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(be(r),xn(e)),!!i}function al(e,t){var r=$o(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?ll(e,"Shift-"+r,t,(function(t){return il(e,t,!0)}))||ll(e,r,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return il(e,t)})):ll(e,r,t,(function(t){return il(e,t)})))}var ul=null;function cl(e){var t=this;if(t.curOp.focus=W(),!ge(t,e)){l&&s<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var i=al(t,e);h&&(ul=i?n:null,!i&&88==n&&!He&&(y?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),r&&!y&&!i&&46==n&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(T(t,"CodeMirror-crosshair"),de(document,"keyup",r),de(document,"mouseover",r))}H(t,"CodeMirror-crosshair"),he(document,"keyup",r),he(document,"mouseover",r)}(t)}}function hl(e){16==e.keyCode&&(this.doc.sel.shift=!1),ge(this,e)}function fl(e){var t=this;if(!(xr(t.display,e)||ge(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(h&&r==ul)return ul=null,void be(e);if(!h||e.which&&!(e.which<10)||!al(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(function(e,t,r){return ll(e,"'"+r+"'",t,(function(t){return il(e,t,!0)}))}(t,e,i)||t.display.input.onKeyPress(e))}}}var dl,pl,gl=function(e,t,r){this.time=e,this.pos=t,this.button=r};function vl(e){var t=this,r=t.display;if(!(ge(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,xr(r,e))a||(r.scroller.draggable=!1,setTimeout((function(){return r.scroller.draggable=!0}),100));else if(!bl(t,e)){var n=un(t,e),i=Le(e),o=n?function(e,t){var r=+new Date;return pl&&pl.compare(r,e,t)?(dl=pl=null,"triple"):dl&&dl.compare(r,e,t)?(pl=new gl(r,e,t),dl=null,"double"):(dl=new gl(r,e,t),pl=null,"single")}(n,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),n&&function(e,t,r,n,i){var o="Click";"double"==n?o="Double"+o:"triple"==n&&(o="Triple"+o);return ll(e,_o(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=tl[t]),!t)return!1;var n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n=t(e,r)!=G}finally{e.state.suppressEdits=!1}return n}))}(t,i,n,o,e)||(1==i?n?function(e,t,r,n){l?setTimeout(E(Cn,e),0):e.curOp.focus=W();var i,o=function(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=b?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey);null==i.addNew&&(i.addNew=y?r.metaKey:r.ctrlKey);null==i.moveOnDrag&&(i.moveOnDrag=!(y?r.altKey:r.ctrlKey));return i}(e,r,n),u=e.doc.sel;e.options.dragDrop&&Me&&!e.isReadOnly()&&"single"==r&&(i=u.contains(t))>-1&&(tt((i=u.ranges[i]).from(),t)<0||t.xRel>0)&&(tt(i.to(),t)>0||t.xRel<0)?function(e,t,r,n){var i=e.display,o=!1,u=ei(e,(function(t){a&&(i.scroller.draggable=!1),e.state.draggingText=!1,de(i.wrapper.ownerDocument,"mouseup",u),de(i.wrapper.ownerDocument,"mousemove",c),de(i.scroller,"dragstart",h),de(i.scroller,"drop",u),o||(be(t),n.addNew||_i(e.doc,r,null,null,n.extend),a||l&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},h=function(){return o=!0};a&&(i.scroller.draggable=!0);e.state.draggingText=u,u.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop();he(i.wrapper.ownerDocument,"mouseup",u),he(i.wrapper.ownerDocument,"mousemove",c),he(i.scroller,"dragstart",h),he(i.scroller,"drop",u),Sn(e),setTimeout((function(){return i.input.focus()}),20)}(e,n,t,o):function(e,t,r,n){var i=e.display,o=e.doc;be(t);var l,s,a=o.sel,u=a.ranges;n.addNew&&!n.extend?(s=o.sel.contains(r),l=s>-1?u[s]:new Si(r,r)):(l=o.sel.primary(),s=o.sel.primIndex);if("rectangle"==n.unit)n.addNew||(l=new Si(r,r)),r=un(e,t,!0,!0),s=-1;else{var c=ml(e,r,n.unit);l=n.extend?Yi(l,c.anchor,c.head,n.extend):c}n.addNew?-1==s?(s=u.length,Ji(o,Li(e,u.concat([l]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&"char"==n.unit&&!n.extend?(Ji(o,Li(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),a=o.sel):qi(o,s,l,V):(s=0,Ji(o,new Ci([l],0),V),a=o.sel);var h=r;function f(t){if(0!=tt(h,t))if(h=t,"rectangle"==n.unit){for(var i=[],u=e.options.tabSize,c=z(Xe(o,r.line).text,r.ch,u),f=z(Xe(o,t.line).text,t.ch,u),d=Math.min(c,f),p=Math.max(c,f),g=Math.min(r.line,t.line),v=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=v;g++){var m=Xe(o,g).text,y=j(m,d,u);d==p?i.push(new Si(et(g,y),et(g,y))):m.length>y&&i.push(new Si(et(g,y),et(g,j(m,p,u))))}i.length||i.push(new Si(r,r)),Ji(o,Li(e,a.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=l,x=ml(e,t,n.unit),C=w.anchor;tt(x.anchor,C)>0?(b=x.head,C=ot(w.from(),x.anchor)):(b=x.anchor,C=it(w.to(),x.head));var S=a.ranges.slice(0);S[s]=function(e,t){var r=t.anchor,n=t.head,i=Xe(e.doc,r.line);if(0==tt(r,n)&&r.sticky==n.sticky)return t;var o=ue(i);if(!o)return t;var l=se(o,r.ch,r.sticky),s=o[l];if(s.from!=r.ch&&s.to!=r.ch)return t;var a,u=l+(s.from==r.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return t;if(n.line!=r.line)a=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=se(o,n.ch,n.sticky),h=c-l||(n.ch-r.ch)*(1==s.level?-1:1);a=c==u-1||c==u?h<0:h>0}var f=o[u+(a?-1:0)],d=a==(1==f.level),p=d?f.from:f.to,g=d?"after":"before";return r.ch==p&&r.sticky==g?t:new Si(new et(r.line,p,g),n)}(e,new Si(st(o,C),b)),Ji(o,Li(e,S,s),V)}}var d=i.wrapper.getBoundingClientRect(),p=0;function g(t){e.state.selectingText=!1,p=1/0,t&&(be(t),i.input.focus()),de(i.wrapper.ownerDocument,"mousemove",v),de(i.wrapper.ownerDocument,"mouseup",m),o.history.lastSelOrigin=null}var v=ei(e,(function(t){0!==t.buttons&&Le(t)?function t(r){var l=++p,s=un(e,r,!0,"rectangle"==n.unit);if(s)if(0!=tt(s,h)){e.curOp.focus=W(),f(s);var a=Nn(i,o);(s.line>=a.to||s.line<a.from)&&setTimeout(ei(e,(function(){p==l&&t(r)})),150)}else{var u=r.clientY<d.top?-20:r.clientY>d.bottom?20:0;u&&setTimeout(ei(e,(function(){p==l&&(i.scroller.scrollTop+=u,t(r))})),50)}}(t):g(t)})),m=ei(e,g);e.state.selectingText=m,he(i.wrapper.ownerDocument,"mousemove",v),he(i.wrapper.ownerDocument,"mouseup",m)}(e,n,t,o)}(t,n,o,e):Se(e)==r.scroller&&be(e):2==i?(n&&_i(t.doc,n),setTimeout((function(){return r.input.focus()}),20)):3==i&&(S?t.display.input.onContextMenu(e):Sn(t)))}}function ml(e,t,r){if("char"==r)return new Si(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new Si(et(t.line,0),st(e.doc,et(t.line+1,0)));var n=r(e,t);return new Si(n.from,n.to)}function yl(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&be(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!me(e,r))return xe(t);o-=s.top-l.viewOffset;for(var a=0;a<e.display.gutterSpecs.length;++a){var u=l.gutters.childNodes[a];if(u&&u.getBoundingClientRect().right>=i)return pe(e,r,e,Ze(e.doc,o),e.display.gutterSpecs[a].className,t),xe(t)}}function bl(e,t){return yl(e,t,"gutterClick",!0)}function wl(e,t){xr(e.display,t)||function(e,t){if(!me(e,"gutterContextMenu"))return!1;return yl(e,t,"gutterContextMenu",!1)}(e,t)||ge(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function xl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Rr(e)}gl.prototype.compare=function(e,t,r){return this.time+400>e&&0==tt(t,this.pos)&&r==this.button};var Cl={toString:function(){return"CodeMirror.Init"}},Sl={},Ll={};function kl(e,t,r){if(!t!=!(r&&r!=Cl)){var n=e.display.dragFunctions,i=t?he:de;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function Tl(e){e.options.lineWrapping?(H(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),jt(e)),an(e),hn(e),Rr(e),setTimeout((function(){return Gn(e)}),100)}function Ml(e,t){var r=this;if(!(this instanceof Ml))return new Ml(e,t);this.options=t=t?I(t):{},I(Sl,t,!1);var n=t.value;"string"==typeof n?n=new Do(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Ml.inputStyles[t.inputStyle](this),o=this.display=new vi(e,n,i,t);for(var u in o.wrapper.CodeMirror=this,xl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Kn(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 R,keySeq:null,specialChars:null},t.autofocus&&!m&&o.input.focus(),l&&s<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),function(e){var t=e.display;he(t.scroller,"mousedown",ei(e,vl)),he(t.scroller,"dblclick",l&&s<11?ei(e,(function(t){if(!ge(e,t)){var r=un(e,t);if(r&&!bl(e,t)&&!xr(e.display,t)){be(t);var n=e.findWordAt(r);_i(e.doc,n.anchor,n.head)}}})):function(t){return ge(e,t)||be(t)});he(t.scroller,"contextmenu",(function(t){return wl(e,t)})),he(t.input.getField(),"contextmenu",(function(r){t.scroller.contains(r.target)||wl(e,r)}));var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout((function(){return t.activeTouch=null}),1e3),(n=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}he(t.scroller,"touchstart",(function(i){if(!ge(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!bl(e,i)){t.input.ensurePolled(),clearTimeout(r);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),he(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),he(t.scroller,"touchend",(function(r){var n=t.activeTouch;if(n&&!xr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var l,s=e.coordsChar(t.activeTouch,"page");l=!n.prev||o(n,n.prev)?new Si(s,s):!n.prev.prev||o(n,n.prev.prev)?e.findWordAt(s):new Si(et(s.line,0),st(e.doc,et(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),be(r)}i()})),he(t.scroller,"touchcancel",i),he(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Pn(e,t.scroller.scrollTop),In(e,t.scroller.scrollLeft,!0),pe(e,"scroll",e))})),he(t.scroller,"mousewheel",(function(t){return xi(e,t)})),he(t.scroller,"DOMMouseScroll",(function(t){return xi(e,t)})),he(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ge(e,t)||Ce(t)},over:function(t){ge(e,t)||(!function(e,t){var r=un(e,t);if(r){var n=document.createDocumentFragment();yn(e,r,n),e.display.dragCursor||(e.display.dragCursor=O("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),N(e.display.dragCursor,n)}}(e,t),Ce(t))},start:function(t){return function(e,t){if(l&&(!e.state.draggingText||+new Date-Wo<100))Ce(t);else if(!ge(e,t)&&!xr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var r=O("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),h&&r.parentNode.removeChild(r)}}(e,t)},drop:ei(e,Ho),leave:function(t){ge(e,t)||Fo(e)}};var a=t.input.getField();he(a,"keyup",(function(t){return hl.call(e,t)})),he(a,"keydown",ei(e,cl)),he(a,"keypress",ei(e,fl)),he(a,"focus",(function(t){return Ln(e,t)})),he(a,"blur",(function(t){return kn(e,t)}))}(this),Io(),Xn(this),this.curOp.forceUpdate=!0,Pi(this,n),t.autofocus&&!m||this.hasFocus()?setTimeout(E(Ln,this),20):kn(this),Ll)Ll.hasOwnProperty(u)&&Ll[u](this,t[u],Cl);fi(this),t.finishInit&&t.finishInit(this);for(var c=0;c<Nl.length;++c)Nl[c](this);Yn(this),a&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Ml.defaults=Sl,Ml.optionHandlers=Ll;var Nl=[];function Ol(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=dt(e,t).state:r="prev");var l=e.options.tabSize,s=Xe(o,t),a=z(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==G||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?z(Xe(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var h="",f=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)f+=l,h+="\t";if(f<u&&(h+=Y(u-f)),h!=c)return go(o,h,et(t,0),et(t,c.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var g=o.sel.ranges[p];if(g.head.line==t&&g.head.ch<c.length){var v=et(t,c.length);qi(o,p,new Si(v,v));break}}}Ml.defineInitHook=function(e){return Nl.push(e)};var Al=null;function Dl(e){Al=e}function Wl(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var l=+new Date-200,s="paste"==i||e.state.pasteIncoming>l,a=De(t),u=null;if(s&&n.ranges.length>1)if(Al&&Al.text.join("\n")==t){if(n.ranges.length%Al.text.length==0){u=[];for(var c=0;c<Al.text.length;c++)u.push(o.splitLines(Al.text[c]))}}else a.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(u=$(a,(function(e){return[e]})));for(var h=e.curOp.updateInput,f=n.ranges.length-1;f>=0;f--){var d=n.ranges[f],p=d.from(),g=d.to();d.empty()&&(r&&r>0?p=et(p.line,p.ch-r):e.state.overwrite&&!s?g=et(g.line,Math.min(Xe(o,g.line).text.length,g.ch+_(a).length)):s&&Al&&Al.lineWise&&Al.text.join("\n")==t&&(p=g=et(p.line,0)));var v={from:p,to:g,text:u?u[f%u.length]:a,origin:i||(s?"paste":e.state.cutIncoming>l?"cut":"+input")};uo(e.doc,v),sr(e,"inputRead",e,v)}t&&!s&&Fl(e,t),Dn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Hl(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Jn(t,(function(){return Wl(t,r,0,null,"paste")})),!0}function Fl(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){l=Ol(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xe(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Ol(e,i.head.line,"smart"));l&&sr(e,"electricInput",e,i.head.line)}}}function Pl(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:et(i,0),head:et(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function El(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Il(){var e=O("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=O("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return a?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),El(e),t}function zl(e,t,r,n,i){var o=t,l=r,s=Xe(e,t.line),a=i&&"rtl"==e.direction?-r:r;function u(n){var o,l;if(null==(o=i?function(e,t,r,n){var i=ue(t,e.doc.direction);if(!i)return Jo(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=se(i,r.ch,r.sticky),l=i[o];if("ltr"==e.doc.direction&&l.level%2==0&&(n>0?l.to>r.ch:l.from<r.ch))return Jo(t,r,n);var s,a=function(e,r){return Qo(t,e instanceof et?e.ch:e,r)},u=function(r){return e.options.lineWrapping?(s=s||Dr(e,t),Zr(e,t,s,r)):{begin:0,end:t.text.length}},c=u("before"==r.sticky?a(r,-1):r.ch);if("rtl"==e.doc.direction||1==l.level){var h=1==l.level==n<0,f=a(r,h?1:-1);if(null!=f&&(h?f<=l.to&&f<=c.end:f>=l.from&&f>=c.begin)){var d=h?"before":"after";return new et(r.line,f,d)}}var p=function(e,t,n){for(var o=function(e,t){return t?new et(r.line,a(e,1),"before"):new et(r.line,e,"after")};e>=0&&e<i.length;e+=t){var l=i[e],s=t>0==(1!=l.level),u=s?n.begin:a(n.end,-1);if(l.from<=u&&u<l.to)return o(u,s);if(u=s?l.from:a(l.to,-1),n.begin<=u&&u<n.end)return o(u,s)}},g=p(o+n,n,c);if(g)return g;var v=n>0?c.end:a(c.begin,-1);return null==v||n>0&&v==t.text.length||!(g=p(n>0?0:i.length-1,n,u(v)))?null:g}(e.cm,s,t,r):Jo(s,t,r))){if(n||(l=t.line+a)<e.first||l>=e.first+e.size||(t=new et(l,t.ch,t.sticky),!(s=Xe(e,l))))return!1;t=el(i,e.cm,s,t.line,a)}else t=o;return!0}if("char"==n)u();else if("column"==n)u(!0);else if("word"==n||"group"==n)for(var c=null,h="group"==n,f=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(r<0)||u(!d);d=!1){var p=s.text.charAt(t.ch)||"\n",g=ee(p,f)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||d||g||(g="s"),c&&c!=g){r<0&&(r=1,u(),t.sticky="after");break}if(g&&(c=g),r>0&&!u(!d))break}var v=oo(e,t,o,l,!0);return rt(o,v)&&(v.hitSide=!0),v}function Rl(e,t,r,n){var i,o,l=e.doc,s=t.left;if("page"==n){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(a-.5*rn(e.display),3);i=(r>0?t.bottom:t.top)+r*u}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;(o=$r(e,s,i)).outside;){if(r<0?i<=0:i>=l.height){o.hitSide=!0;break}i+=5*r}return o}var Bl=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new R,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Gl(e,t){var r=Ar(e,t.line);if(!r||r.hidden)return null;var n=Xe(e.doc,t.line),i=Nr(r,n,t.line),o=ue(n,e.doc.direction),l="left";o&&(l=se(o,t.ch)%2?"right":"left");var s=Pr(i.map,t.ch,l);return s.offset="right"==s.collapse?s.end:s.start,s}function Ul(e,t){return t&&(e.bad=!0),e}function Vl(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Ul(e.clipPos(et(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return Kl(o,t,r)}}function Kl(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!D(n,t))return Ul(et(qe(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var o=e.rest?_(e.rest):e.line;return Ul(et(qe(o),o.text.length),i)}var l=3==t.nodeType?t:null,s=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,r&&(r=l.nodeValue.length));s.parentNode!=n;)s=s.parentNode;var a=e.measure,u=a.maps;function c(t,r,n){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?a.map:u[i],l=0;l<o.length;l+=3){var s=o[l+2];if(s==t||s==r){var c=qe(i<0?e.line:e.rest[i]),h=o[l]+n;return(n<0||s!=t)&&(h=o[l+(n?1:0)]),et(c,h)}}}var h=c(l,s,r);if(h)return Ul(h,i);for(var f=s.nextSibling,d=l?l.nodeValue.length-r:0;f;f=f.nextSibling){if(h=c(f,f.firstChild,0))return Ul(et(h.line,h.ch-d),i);d+=f.textContent.length}for(var p=s.previousSibling,g=r;p;p=p.previousSibling){if(h=c(p,p.firstChild,-1))return Ul(et(h.line,h.ch+g),i);g+=p.textContent.length}}Bl.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;function o(e){if(!ge(n,e)){if(n.somethingSelected())Dl({lineWise:!1,text:n.getSelections()}),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=Pl(n);Dl({lineWise:!0,text:t.text}),"cut"==e.type&&n.operation((function(){n.setSelections(t.ranges,0,U),n.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var o=Al.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var l=Il(),s=l.firstChild;n.display.lineSpace.insertBefore(l,n.display.lineSpace.firstChild),s.value=Al.text.join("\n");var a=document.activeElement;P(s),setTimeout((function(){n.display.lineSpace.removeChild(l),a.focus(),a==i&&r.showPrimarySelection()}),50)}}El(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize),he(i,"paste",(function(e){ge(n,e)||Hl(e,n)||s<=11&&setTimeout(ei(n,(function(){return t.updateFromDOM()})),20)})),he(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),he(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),he(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),he(i,"touchstart",(function(){return r.forceCompositionEnd()})),he(i,"input",(function(){t.composing||t.readFromDOMSoon()})),he(i,"copy",o),he(i,"cut",o)},Bl.prototype.prepareSelection=function(){var e=mn(this.cm,!1);return e.focus=this.cm.state.focused,e},Bl.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Bl.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Bl.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),i=n.from(),o=n.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var l=Vl(t,e.anchorNode,e.anchorOffset),s=Vl(t,e.focusNode,e.focusOffset);if(!l||l.bad||!s||s.bad||0!=tt(ot(l,s),i)||0!=tt(it(l,s),o)){var a=t.display.view,u=i.line>=t.display.viewFrom&&Gl(t,i)||{node:a[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&Gl(t,o);if(!c){var h=a[a.length-1].measure,f=h.maps?h.maps[h.maps.length-1]:h.map;c={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(u&&c){var d,p=e.rangeCount&&e.getRangeAt(0);try{d=k(u.node,u.offset,c.offset,c.node)}catch(e){}d&&(!r&&t.state.focused?(e.collapse(u.node,u.offset),d.collapsed||(e.removeAllRanges(),e.addRange(d))):(e.removeAllRanges(),e.addRange(d)),p&&null==e.anchorNode?e.addRange(p):r&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Bl.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Bl.prototype.showMultipleSelections=function(e){N(this.cm.display.cursorDiv,e.cursors),N(this.cm.display.selectionDiv,e.selection)},Bl.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Bl.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return D(this.div,t)},Bl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Bl.prototype.blur=function(){this.div.blur()},Bl.prototype.getField=function(){return this.div},Bl.prototype.supportsTouch=function(){return!0},Bl.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Jn(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},Bl.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Bl.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&c&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=Vl(t,e.anchorNode,e.anchorOffset),n=Vl(t,e.focusNode,e.focusOffset);r&&n&&Jn(t,(function(){Ji(t.doc,ki(r,n),U),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)}))}}},Bl.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n=this.cm,i=n.display,o=n.doc.sel.primary(),l=o.from(),s=o.to();if(0==l.ch&&l.line>n.firstLine()&&(l=et(l.line-1,Xe(n.doc,l.line-1).length)),s.ch==Xe(n.doc,s.line).text.length&&s.line<n.lastLine()&&(s=et(s.line+1,0)),l.line<i.viewFrom||s.line>i.viewTo-1)return!1;l.line==i.viewFrom||0==(e=cn(n,l.line))?(t=qe(i.view[0].line),r=i.view[0].node):(t=qe(i.view[e].line),r=i.view[e-1].node.nextSibling);var a,u,c=cn(n,s.line);if(c==i.view.length-1?(a=i.viewTo-1,u=i.lineDiv.lastChild):(a=qe(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!r)return!1;for(var h=n.doc.splitLines(function(e,t,r,n,i){var o="",l=!1,s=e.doc.lineSeparator(),a=!1;function u(){l&&(o+=s,a&&(o+=s),l=a=!1)}function c(e){e&&(u(),o+=e)}function h(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void c(r);var o,f=t.getAttribute("cm-marker");if(f){var d=e.findMarks(et(n,0),et(i+1,0),(v=+f,function(e){return e.id==v}));return void(d.length&&(o=d[0].find(0))&&c(Ye(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&u();for(var g=0;g<t.childNodes.length;g++)h(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(a=!0),p&&(l=!0)}else 3==t.nodeType&&c(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var v}for(;h(t),t!=r;)t=t.nextSibling,a=!1;return o}(n,r,u,t,a)),f=Ye(n.doc,et(t,0),et(a,Xe(n.doc,a).text.length));h.length>1&&f.length>1;)if(_(h)==_(f))h.pop(),f.pop(),a--;else{if(h[0]!=f[0])break;h.shift(),f.shift(),t++}for(var d=0,p=0,g=h[0],v=f[0],m=Math.min(g.length,v.length);d<m&&g.charCodeAt(d)==v.charCodeAt(d);)++d;for(var y=_(h),b=_(f),w=Math.min(y.length-(1==h.length?d:0),b.length-(1==f.length?d:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==h.length&&1==f.length&&t==l.line)for(;d&&d>l.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)d--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(d).replace(/\u200b+$/,"");var x=et(t,d),C=et(a,f.length?_(f).length-p:0);return h.length>1||h[0]||tt(x,C)?(go(n.doc,h,x,C,"+input"),!0):void 0},Bl.prototype.ensurePolled=function(){this.forceCompositionEnd()},Bl.prototype.reset=function(){this.forceCompositionEnd()},Bl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Bl.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Bl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Jn(this.cm,(function(){return hn(e.cm)}))},Bl.prototype.setUneditable=function(e){e.contentEditable="false"},Bl.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ei(this.cm,Wl)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Bl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Bl.prototype.onContextMenu=function(){},Bl.prototype.resetPosition=function(){},Bl.prototype.needsContentAttribute=!0;var jl=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new R,this.hasSelection=!1,this.composing=null};jl.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ge(n,e)){if(n.somethingSelected())Dl({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Pl(n);Dl({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,U):(r.prevInput="",i.value=t.text.join("\n"),P(i))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),he(i,"input",(function(){l&&s>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()})),he(i,"paste",(function(e){ge(n,e)||Hl(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())})),he(i,"cut",o),he(i,"copy",o),he(e.scroller,"paste",(function(t){if(!xr(e,t)&&!ge(n,t)){if(!i.dispatchEvent)return n.state.pasteIncoming=+new Date,void r.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),he(e.lineSpace,"selectstart",(function(t){xr(e,t)||be(t)})),he(i,"compositionstart",(function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}})),he(i,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},jl.prototype.createField=function(e){this.wrapper=Il(),this.textarea=this.wrapper.firstChild},jl.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=mn(e);if(e.options.moveInputWithCursor){var i=Xr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},jl.prototype.showSelection=function(e){var t=this.cm.display;N(t.cursorDiv,e.cursors),N(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},jl.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&P(this.textarea),l&&s>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",l&&s>=9&&(this.hasSelection=null))}},jl.prototype.getField=function(){return this.textarea},jl.prototype.supportsTouch=function(){return!1},jl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||W()!=this.textarea))try{this.textarea.focus()}catch(e){}},jl.prototype.blur=function(){this.textarea.blur()},jl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},jl.prototype.receivedFocus=function(){this.slowPoll()},jl.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},jl.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}))},jl.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||We(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(l&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,u=Math.min(n.length,i.length);a<u&&n.charCodeAt(a)==i.charCodeAt(a);)++a;return Jn(t,(function(){Wl(t,i.slice(a),n.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},jl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},jl.prototype.onKeyPress=function(){l&&s>=9&&(this.hasSelection=null),this.fastPoll()},jl.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=un(r,e),u=n.scroller.scrollTop;if(o&&!h){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(o)&&ei(r,Ji)(r.doc,ki(o),U);var c,f=i.style.cssText,d=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",a&&(c=window.scrollY),n.input.focus(),a&&window.scrollTo(null,c),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=m,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),l&&s>=9&&v(),S){Ce(e);var g=function(){de(window,"mouseup",g),setTimeout(m,20)};he(window,"mouseup",g)}else setTimeout(m,50)}function v(){if(null!=i.selectionStart){var e=r.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=r.doc.sel}}function m(){if(t.contextMenuPending==m&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=f,l&&s<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=u),null!=i.selectionStart)){(!l||l&&s<9)&&v();var e=0,o=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?ei(r,so)(r):e++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(o,200)}}},jl.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},jl.prototype.setUneditable=function(){},jl.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function r(r,n,i,o){e.defaults[r]=n,i&&(t[r]=o?function(e,t,r){r!=Cl&&i(e,t,r)}:i)}e.defineOption=r,e.Init=Cl,r("value","",(function(e,t){return e.setValue(t)}),!0),r("mode",null,(function(e,t){e.doc.modeOption=t,Ai(e)}),!0),r("indentUnit",2,Ai,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(e){Di(e),Rr(e),hn(e)}),!0),r("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var r=[],n=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,r.push(et(n,o))}n++}));for(var i=r.length-1;i>=0;i--)go(e.doc,t,r[i],et(r[i].line,r[i].ch+t.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Cl&&e.refresh()})),r("specialCharPlaceholder",Qt,(function(e){return e.refresh()}),!0),r("electricChars",!0),r("inputStyle",m?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),r("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),r("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),r("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),r("rtlMoveVisually",!w),r("wholeLineUpdateBefore",!0),r("theme","default",(function(e){xl(e),gi(e)}),!0),r("keyMap","default",(function(e,t,r){var n=qo(t),i=r!=Cl&&qo(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Tl,!0),r("gutters",[],(function(e,t){e.display.gutterSpecs=di(t,e.options.lineNumbers),gi(e)}),!0),r("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?ln(e.display)+"px":"0",e.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(e){return Gn(e)}),!0),r("scrollbarStyle","native",(function(e){Kn(e),Gn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),r("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=di(e.options.gutters,t),gi(e)}),!0),r("firstLineNumber",1,gi,!0),r("lineNumberFormatter",(function(e){return e}),gi,!0),r("showCursorWhenSelecting",!1,vn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(function(e,t){"nocursor"==t&&(kn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),r("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),r("dragDrop",!0,kl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,vn,!0),r("singleCursorHeightPerLine",!0,vn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Di,!0),r("addModeClass",!1,Di,!0),r("pollInterval",100),r("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),r("historyEventDelay",1250),r("viewportMargin",10,(function(e){return e.refresh()}),!0),r("maxHighlightLength",1e4,Di,!0),r("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),r("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),r("autofocus",null),r("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),r("phrases",null)}(Ml),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&ei(this,t[e])(this,r,i),pe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](qo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:ti((function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");!function(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},(function(e){return e.priority})),this.state.modeGen++,hn(this)})),removeOverlay:ti((function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void hn(this)}})),indentLine:ti((function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Qe(this.doc,e)&&Ol(this,e,t,r)})),indentSelection:ti((function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>r&&(Ol(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&Dn(this));else{var o=i.from(),l=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var a=s;a<r;++a)Ol(this,a,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&qi(this.doc,n,new Si(o,u[n].to()),U)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=st(this.doc,e);var t,r=ft(this,Xe(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]<o)){t=r[2*l+2];break}n=l+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!r.hasOwnProperty(t))return n;var i=r[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&n.push(i[o[t]]);else if(o[t])for(var l=0;l<o[t].length;l++){var s=i[o[t][l]];s&&n.push(s)}else o.helperType&&i[o.helperType]?n.push(i[o.helperType]):i[o.name]&&n.push(i[o.name]);for(var a=0;a<i._global.length;a++){var u=i._global[a];u.pred(o,this)&&-1==B(n,u.val)&&n.push(u.val)}return n},getStateAfter:function(e,t){var r=this.doc;return dt(this,(e=lt(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Xr(this,null==e?r.head:"object"==typeof e?st(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return jr(this,st(this.doc,e),t||"page")},coordsChar:function(e,t){return $r(this,(e=Kr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Kr(this,{top:e,left:0},t||"page").top,Ze(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),n=Xe(this.doc,e)}else n=e;return Vr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-Vt(n):0)},defaultTextHeight:function(){return rn(this.display)},defaultCharWidth:function(){return nn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,l,s,a=this.display,u=(e=Xr(this,st(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),a.sizer.appendChild(t),"over"==n)u=e.top;else if("above"==n||"near"==n){var h=Math.max(a.wrapper.clientHeight,this.doc.height),f=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>h)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=h&&(u=e.bottom),c+t.offsetWidth>f&&(c=f-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==i?(c=a.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),r&&(o=this,l={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(s=On(o,l)).scrollTop&&Pn(o,s.scrollTop),null!=s.scrollLeft&&In(o,s.scrollLeft))},triggerOnKeyDown:ti(cl),triggerOnKeyPress:ti(fl),triggerOnKeyUp:hl,triggerOnMouseDown:ti(vl),execCommand:function(e){if(tl.hasOwnProperty(e))return tl[e].call(null,this)},triggerElectric:ti((function(e){Fl(this,e)})),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=st(this.doc,e),l=0;l<t&&!(o=zl(this.doc,o,i,r,n)).hitSide;++l);return o},moveH:ti((function(e,t){var r=this;this.extendSelectionsBy((function(n){return r.display.shift||r.doc.extend||n.empty()?zl(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()}),K)})),deleteH:ti((function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Zo(this,(function(r){var i=zl(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}}))})),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var l=st(this.doc,e),s=0;s<t;++s){var a=Xr(this,l,"div");if(null==o?o=a.left:a.left=o,(l=Rl(this,a,i,r)).hitSide)break}return l},moveV:ti((function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy((function(l){if(o)return e<0?l.from():l.to();var s=Xr(r,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=Rl(r,s,e,t);return"page"==t&&l==n.sel.primary()&&An(r,jr(r,a,"div").top-s.top),a}),K),i.length)for(var l=0;l<n.sel.ranges.length;l++)n.sel.ranges[l].goalColumn=i[l]})),findWordAt:function(e){var t=Xe(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&n!=t.length||!r?++n:--r;for(var o=t.charAt(r),l=ee(o,i)?function(e){return ee(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};r>0&&l(t.charAt(r-1));)--r;for(;n<t.length&&l(t.charAt(n));)++n}return new Si(et(e.line,r),et(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?H(this.display.cursorDiv,"CodeMirror-overwrite"):T(this.display.cursorDiv,"CodeMirror-overwrite"),pe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==W()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ti((function(e,t){Wn(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-kr(this)-this.display.barHeight,width:e.scrollWidth-kr(this)-this.display.barWidth,clientHeight:Mr(this),clientWidth:Tr(this)}},scrollIntoView:ti((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:et(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?function(e,t){Hn(e),e.curOp.scrollToPos=t}(this,e):Fn(this,e.from,e.to,e.margin)})),setSize:ti((function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&zr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){fn(r,i,"widget");break}++i})),this.curOp.forceUpdate=!0,pe(this,"refresh",this)})),operation:function(e){return Jn(this,e)},startOperation:function(){return Xn(this)},endOperation:function(){return Yn(this)},refresh:ti((function(){var e=this.display.cachedTextHeight;hn(this),this.curOp.forceUpdate=!0,Rr(this),Wn(this,this.doc.scrollLeft,this.doc.scrollTop),ui(this.display),(null==e||Math.abs(e-rn(this.display))>.5)&&an(this),pe(this,"refresh",this)})),swapDoc:ti((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Pi(this,e),Rr(this),this.display.input.reset(),Wn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sr(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},ye(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}(Ml);var Xl="iter insert remove copy getEditor constructor".split(" ");for(var Yl in Do.prototype)Do.prototype.hasOwnProperty(Yl)&&B(Xl,Yl)<0&&(Ml.prototype[Yl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Do.prototype[Yl]));return ye(Do),Ml.inputStyles={textarea:jl,contenteditable:Bl},Ml.defineMode=function(e){Ml.defaults.mode||"null"==e||(Ml.defaults.mode=e),Ie.apply(this,arguments)},Ml.defineMIME=function(e,t){Ee[e]=t},Ml.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ml.defineMIME("text/plain","null"),Ml.defineExtension=function(e,t){Ml.prototype[e]=t},Ml.defineDocExtension=function(e,t){Do.prototype[e]=t},Ml.fromTextArea=function(e,t){if((t=t?I(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=W();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=s.getValue()}var i;if(e.form&&(he(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=l}}catch(e){}}t.finishInit=function(r){r.save=n,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,n(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(de(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Ml((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=de,e.on=he,e.wheelEventPixels=wi,e.Doc=Do,e.splitLines=De,e.countColumn=z,e.findColumn=j,e.isWordChar=J,e.Pass=G,e.signal=pe,e.Line=Xt,e.changeEnd=Ti,e.scrollbarModel=Vn,e.Pos=et,e.cmpPos=tt,e.modes=Pe,e.mimeModes=Ee,e.resolveMode=ze,e.getMode=Re,e.modeExtensions=Be,e.extendMode=Ge,e.copyState=Ue,e.startState=Ke,e.innerMode=Ve,e.commands=tl,e.keyMap=Vo,e.keyName=$o,e.isModifierKey=Yo,e.lookupKey=Xo,e.normalizeKeyMap=jo,e.StringStream=je,e.SharedTextMarker=Mo,e.TextMarker=ko,e.LineWidget=Co,e.e_preventDefault=be,e.e_stopPropagation=we,e.e_stop=Ce,e.addClass=H,e.contains=D,e.rmClass=T,e.keyNames=Ro}(Ml),Ml.version="5.52.0",Ml})); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).CodeMirror=t()}(this,(function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),l=n||i||o,s=l&&(n?document.documentMode||6:+(o||i)[1]),a=!o&&/WebKit\//.test(e),u=a&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),h=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),v=/Android/.test(e),m=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),x=h&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(h=!1,a=!0);var C=y&&(u||h&&(null==x||x<12.11)),S=r||l&&s>=9;function L(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var k,T=function(e,t){var r=e.className,n=L(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function M(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function N(e,t){return M(e).appendChild(t)}function A(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"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 O(e,t,r,n){var i=A(e,t,r,n);return i.setAttribute("role","presentation"),i}function D(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)}function W(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function H(e,t){var r=e.className;L(t).test(r)||(e.className+=(r?" ":"")+t)}function F(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!L(r[n]).test(t)&&(t+=" "+r[n]);return t}k=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var P=function(e){e.select()};function E(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function I(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function R(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,l=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}}g?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(P=function(e){try{e.select()}catch(e){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=E(this.onTimeout,this)};function B(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},z.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};var G={toString:function(){return"CodeMirror.Pass"}},U={scroll:!1},V={origin:"*mouse"},K={origin:"+move"};function j(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,n=o+1,(i+=r-i%r)>=t)return n}}var X=[""];function Y(e){for(;X.length<=e;)X.push(_(X)+" ");return X[e]}function _(e){return e[e.length-1]}function $(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function q(){}function Z(e,t){var r;return Object.create?r=Object.create(e):(q.prototype=e,r=new q),t&&I(t,r),r}var Q=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function J(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&J(e))||t.test(e):J(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\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]/;function ne(e){return e.charCodeAt(0)>=768&&re.test(e)}function ie(e,t,r){for(;(r<0?t>0:t<e.length)&&ne(e.charAt(t));)t+=r;return t}function oe(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}var le=null;function se(e,t,r){var n;le=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:le=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:le=i)}return null!=n?n:le}var ae=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,r=/[LRr]/,n=/[Lb1n]/,i=/[1n]/;function o(e,t,r){this.level=e,this.from=t,this.to=r}return function(l,s){var a="ltr"==s?"L":"R";if(0==l.length||"ltr"==s&&!e.test(l))return!1;for(var u,c=l.length,h=[],f=0;f<c;++f)h.push((u=l.charCodeAt(f))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":8204==u?"b":"L");for(var d=0,p=a;d<c;++d){var g=h[d];"m"==g?h[d]=p:p=g}for(var v=0,m=a;v<c;++v){var y=h[v];"1"==y&&"r"==m?h[v]="n":r.test(y)&&(m=y,"r"==y&&(h[v]="R"))}for(var b=1,w=h[0];b<c-1;++b){var x=h[b];"+"==x&&"1"==w&&"1"==h[b+1]?h[b]="1":","!=x||w!=h[b+1]||"1"!=w&&"n"!=w||(h[b]=w),w=x}for(var C=0;C<c;++C){var S=h[C];if(","==S)h[C]="N";else if("%"==S){var L=void 0;for(L=C+1;L<c&&"%"==h[L];++L);for(var k=C&&"!"==h[C-1]||L<c&&"1"==h[L]?"1":"N",T=C;T<L;++T)h[T]=k;C=L-1}}for(var M=0,N=a;M<c;++M){var A=h[M];"L"==N&&"1"==A?h[M]="L":r.test(A)&&(N=A)}for(var O=0;O<c;++O)if(t.test(h[O])){var D=void 0;for(D=O+1;D<c&&t.test(h[D]);++D);for(var W="L"==(O?h[O-1]:a),H=W==("L"==(D<c?h[D]:a))?W?"L":"R":a,F=O;F<D;++F)h[F]=H;O=D-1}for(var P,E=[],I=0;I<c;)if(n.test(h[I])){var R=I;for(++I;I<c&&n.test(h[I]);++I);E.push(new o(0,R,I))}else{var z=I,B=E.length,G="rtl"==s?1:0;for(++I;I<c&&"L"!=h[I];++I);for(var U=z;U<I;)if(i.test(h[U])){z<U&&(E.splice(B,0,new o(1,z,U)),B+=G);var V=U;for(++U;U<I&&i.test(h[U]);++U);E.splice(B,0,new o(2,V,U)),B+=G,z=U}else++U;z<I&&E.splice(B,0,new o(1,z,I))}return"ltr"==s&&(1==E[0].level&&(P=l.match(/^\s+/))&&(E[0].from=P[0].length,E.unshift(new o(0,0,P[0].length))),1==_(E).level&&(P=l.match(/\s+$/))&&(_(E).to-=P[0].length,E.push(new o(0,c-P[0].length,c)))),"rtl"==s?E.reverse():E}}();function ue(e,t){var r=e.order;return null==r&&(r=e.order=ae(e.text,t)),r}var ce=[],he=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||ce).concat(r)}};function fe(e,t){return e._handlers&&e._handlers[t]||ce}function de(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=B(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function pe(e,t){var r=fe(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function ge(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),pe(e,r||t.type,e,t),xe(t)||t.codemirrorIgnore}function ve(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==B(r,t[n])&&r.push(t[n])}function me(e,t){return fe(e,t).length>0}function ye(e){e.prototype.on=function(e,t){he(this,e,t)},e.prototype.off=function(e,t){de(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function we(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function xe(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ce(e){be(e),we(e)}function Se(e){return e.target||e.srcElement}function Le(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var ke,Te,Me=function(){if(l&&s<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function Ne(e){if(null==ke){var t=A("span","​");N(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(ke=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&s<8))}var r=ke?A("span","​"):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Ae(e){if(null!=Te)return Te;var t=N(e,document.createTextNode("AØ®A")),r=k(t,0,1).getBoundingClientRect(),n=k(t,1,2).getBoundingClientRect();return M(e),!(!r||r.left==r.right)&&(Te=n.right-r.right<3)}var Oe,De=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},We=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},He="oncopy"in(Oe=A("div"))||(Oe.setAttribute("oncopy","return;"),"function"==typeof Oe.oncopy),Fe=null;var Pe={},Ee={};function Ie(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pe[e]=t}function Re(e){if("string"==typeof e&&Ee.hasOwnProperty(e))e=Ee[e];else if(e&&"string"==typeof e.name&&Ee.hasOwnProperty(e.name)){var t=Ee[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Re("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Re("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function ze(e,t){t=Re(t);var r=Pe[t.name];if(!r)return ze(e,"text/plain");var n=r(e,t);if(Be.hasOwnProperty(t.name)){var i=Be[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var Be={};function Ge(e,t){I(t,Be.hasOwnProperty(e)?Be[e]:Be[e]={})}function Ue(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Ve(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Ke(e,t,r){return!e.startState||e.startState(t,r)}var je=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function Xe(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function Ye(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,(function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i})),n}function _e(e,t,r){var n=[];return e.iter(t,r,(function(e){n.push(e.text)})),n}function $e(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function qe(e){if(null==e.parent)return null;for(var t=e.parent,r=B(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function Ze(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var l=0;l<e.lines.length;++l){var s=e.lines[l].height;if(t<s)break;t-=s}return r+l}function Qe(e,t){return t>=e.first&&t<e.first+e.size}function Je(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,r){if(void 0===r&&(r=null),!(this instanceof et))return new et(e,t,r);this.line=e,this.ch=t,this.sticky=r}function tt(e,t){return e.line-t.line||e.ch-t.ch}function rt(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function nt(e){return et(e.line,e.ch)}function it(e,t){return tt(e,t)<0?t:e}function ot(e,t){return tt(e,t)<0?e:t}function lt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function st(e,t){if(t.line<e.first)return et(e.first,0);var r=e.first+e.size-1;return t.line>r?et(r,Xe(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?et(e.line,t):r<0?et(e.line,0):e}(t,Xe(e,t.line).text.length)}function at(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=st(e,t[n]);return r}je.prototype.eol=function(){return this.pos>=this.string.length},je.prototype.sol=function(){return this.pos==this.lineStart},je.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},je.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},je.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},je.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},je.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},je.prototype.skipToEnd=function(){this.pos=this.string.length},je.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},je.prototype.backUp=function(e){this.pos-=e},je.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=R(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},je.prototype.indentation=function(){return R(this.string,null,this.tabSize)-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},je.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},je.prototype.current=function(){return this.string.slice(this.start,this.pos)},je.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},je.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},je.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ut=function(e,t){this.state=e,this.lookAhead=t},ct=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function ht(e,t,r,n){var i=[e.state.modeGen],o={};wt(e,t.text,e.doc.mode,r,(function(e,t){return i.push(e,t)}),o,n);for(var l=r.state,s=function(n){r.baseTokens=i;var s=e.state.overlays[n],a=1,u=0;r.state=!0,wt(e,t.text,s.mode,r,(function(e,t){for(var r=a;u<e;){var n=i[a];n>e&&i.splice(a,1,e,i[a+1],n),a+=2,u=Math.min(e,n)}if(t)if(s.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"overlay "+t}}),o),r.state=l,r.baseTokens=null,r.baseTokenPos=1},a=0;a<e.state.overlays.length;++a)s(a);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function ft(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=dt(e,qe(t)),i=t.text.length>e.options.maxHighlightLength&&Ue(e.doc.mode,n.state),o=ht(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function dt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new ct(n,!0,t);var o=function(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>l;--s){if(s<=o.first)return o.first;var a=Xe(o,s-1),u=a.stateAfter;if(u&&(!r||s+(u instanceof ut?u.lookAhead:0)<=o.modeFrontier))return s;var c=R(a.text,null,e.options.tabSize);(null==i||n>c)&&(i=s-1,n=c)}return i}(e,t,r),l=o>n.first&&Xe(n,o-1).stateAfter,s=l?ct.fromSaved(n,l,o):new ct(n,Ke(n.mode),o);return n.iter(o,t,(function(r){pt(e,r.text,s);var n=s.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?s.save():null,s.nextLine()})),r&&(n.modeFrontier=s.line),s}function pt(e,t,r,n){var i=e.doc.mode,o=new je(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&>(i,r.state);!o.eol();)vt(i,o,r.state),o.start=o.pos}function gt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Ve(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function vt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Ve(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}ct.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ct.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ct.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ct.fromSaved=function(e,t,r){return t instanceof ut?new ct(e,Ue(e.mode,t.state),r,t.lookAhead):new ct(e,Ue(e.mode,t),r)},ct.prototype.save=function(e){var t=!1!==e?Ue(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ut(t,this.maxLookAhead):t};var mt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function yt(e,t,r,n){var i,o,l=e.doc,s=l.mode,a=Xe(l,(t=st(l,t)).line),u=dt(e,t.line,r),c=new je(a.text,e.options.tabSize,u);for(n&&(o=[]);(n||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=vt(s,c,u.state),n&&o.push(new mt(c,i,Ue(l.mode,u.state)));return n?o:new mt(c,i,u.state)}function bt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function wt(e,t,r,n,i,o,l){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var a,u=0,c=null,h=new je(t,e.options.tabSize,n),f=e.options.addModeClass&&[null];for(""==t&&bt(gt(r,n.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(s=!1,l&&pt(e,t,n,h.pos),h.pos=t.length,a=null):a=bt(vt(r,h,n.state,f),o),f){var d=f[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;u<h.start;)i(u=Math.min(h.start,u+5e3),c);c=a}h.start=h.pos}for(;u<h.pos;){var p=Math.min(h.pos,u+5e3);i(p,c),u=p}}var xt=!1,Ct=!1;function St(e,t,r){this.marker=e,this.from=t,this.to=r}function Lt(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function kt(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Tt(e,t){if(t.full)return null;var r=Qe(e,t.from.line)&&Xe(e,t.from.line).markedSpans,n=Qe(e,t.to.line)&&Xe(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,l=0==tt(t.from,t.to),s=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==l.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new St(l,o.from,s?null:o.to))}}return n}(r,i,l),a=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.to||(l.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new St(l,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,l),u=1==t.text.length,c=_(t.text).length+(u?i:0);if(s)for(var h=0;h<s.length;++h){var f=s[h];if(null==f.to){var d=Lt(a,f.marker);d?u&&(f.to=null==d.to?null:d.to+c):f.to=i}}if(a)for(var p=0;p<a.length;++p){var g=a[p];if(null!=g.to&&(g.to+=c),null==g.from)Lt(s,g.marker)||(g.from=c,u&&(s||(s=[])).push(g));else g.from+=c,u&&(s||(s=[])).push(g)}s&&(s=Mt(s)),a&&a!=s&&(a=Mt(a));var v=[s];if(!u){var m,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(m||(m=[])).push(new St(s[b].marker,null,null));for(var w=0;w<y;++w)v.push(m);v.push(a)}return v}function Mt(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Nt(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function At(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Ot(e){return e.inclusiveLeft?-1:0}function Dt(e){return e.inclusiveRight?1:0}function Wt(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=tt(n.from,i.from)||Ot(e)-Ot(t);if(o)return-o;var l=tt(n.to,i.to)||Dt(e)-Dt(t);return l||t.id-e.id}function Ht(e,t){var r,n=Ct&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||Wt(r,i.marker)<0)&&(r=i.marker);return r}function Ft(e){return Ht(e,!0)}function Pt(e){return Ht(e,!1)}function Et(e,t){var r,n=Ct&&e.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||Wt(r,o.marker)<0)&&(r=o.marker)}return r}function It(e,t,r,n,i){var o=Xe(e,t),l=Ct&&o.markedSpans;if(l)for(var s=0;s<l.length;++s){var a=l[s];if(a.marker.collapsed){var u=a.marker.find(0),c=tt(u.from,r)||Ot(a.marker)-Ot(i),h=tt(u.to,n)||Dt(a.marker)-Dt(i);if(!(c>=0&&h<=0||c<=0&&h>=0)&&(c<=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?tt(u.to,r)>=0:tt(u.to,r)>0)||c>=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?tt(u.from,n)<=0:tt(u.from,n)<0)))return!0}}}function Rt(e){for(var t;t=Ft(e);)e=t.find(-1,!0).line;return e}function zt(e,t){var r=Xe(e,t),n=Rt(r);return r==n?t:qe(n)}function Bt(e,t){if(t>e.lastLine())return t;var r,n=Xe(e,t);if(!Gt(e,n))return t;for(;r=Pt(n);)n=r.find(1,!0).line;return qe(n)+1}function Gt(e,t){var r=Ct&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&Ut(e,t,n))return!0}}function Ut(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return Ut(e,n.line,Lt(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&Ut(e,t,i))return!0}function Vt(e){for(var t=0,r=(e=Rt(e)).parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;o=(r=o).parent)for(var l=0;l<o.children.length;++l){var s=o.children[l];if(s==r)break;t+=s.height}return t}function Kt(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Ft(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=Pt(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function jt(e){var t=e.display,r=e.doc;t.maxLine=Xe(r,r.first),t.maxLineLength=Kt(t.maxLine),t.maxLineChanged=!0,r.iter((function(e){var r=Kt(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var Xt=function(e,t,r){this.text=e,At(this,t),this.height=r?r(this):1};function Yt(e){e.parent=null,Nt(e)}Xt.prototype.lineNo=function(){return qe(this)},ye(Xt);var _t={},$t={};function qt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?$t:_t;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var r=O("span",null,null,a?"padding-right: .1px":null),n={pre:O("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;n.pos=0,n.addToken=Jt,Ae(e.display.measure)&&(l=ue(o,e.doc.direction))&&(n.addToken=er(n.addToken,l)),n.map=[],rr(o,n,ft(e,o,t!=e.display.externalMeasured&&qe(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=F(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=F(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Ne(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(a){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return pe(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=F(n.pre.className,n.textClass||"")),n}function Qt(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Jt(e,t,r,n,i,o,a){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}(t,e.trailingSpace):t,h=e.cm.state.specialChars,f=!1;if(h.test(t)){u=document.createDocumentFragment();for(var d=0;;){h.lastIndex=d;var p=h.exec(t),g=p?p.index-d:t.length-d;if(g){var v=document.createTextNode(c.slice(d,d+g));l&&s<9?u.appendChild(A("span",[v])):u.appendChild(v),e.map.push(e.pos,e.pos+g,v),e.col+=g,e.pos+=g}if(!p)break;d+=g+1;var m=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(m=u.appendChild(A("span",Y(b),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((m=u.appendChild(A("span","\r"==p[0]?"â":"â¤","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((m=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),l&&s<9?u.appendChild(A("span",[m])):u.appendChild(m),e.col+=1);e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),l&&s<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||n||i||f||o||a){var w=r||"";n&&(w+=n),i&&(w+=i);var x=A("span",[u],w,o);if(a)for(var C in a)a.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,a[C]);return e.content.appendChild(x)}e.content.appendChild(u)}}function er(e,t){return function(r,n,i,o,l,s,a){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,c=u+n.length;;){for(var h=void 0,f=0;f<t.length&&!((h=t[f]).to>u&&h.from<=u);f++);if(h.to>=c)return e(r,n,i,o,l,s,a);e(r,n.slice(0,h.to-u),i,o,null,s,a),o=null,n=n.slice(h.to-u),u=h.to}}}function tr(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function rr(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,h,f,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=s="",f=null,h=null,m=1/0;for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[w],C=x.marker;if("bookmark"==C.type&&x.from==p&&C.widgetNode)y.push(C);else if(x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(a+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((f||(f={})).title=C.title),C.attributes)for(var S in C.attributes)(f||(f={}))[S]=C.attributes[S];C.collapsed&&(!h||Wt(h.marker,C)<0)&&(h=x)}else x.from>p&&m>x.from&&(m=x.from)}if(b)for(var L=0;L<b.length;L+=2)b[L+1]==m&&(u+=" "+b[L]);if(!h||h.from==p)for(var k=0;k<y.length;++k)tr(t,0,y[k]);if(h&&(h.from||0)==p){if(tr(t,(null==h.to?d+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=d)break;for(var T=Math.min(d,m);;){if(v){var M=p+v.length;if(!h){var N=M>T?v.slice(0,T-p):v;t.addToken(t,N,l?l+a:a,c,p+N.length==m?u:"",s,f)}if(M>=T){v=v.slice(T-p),p=T;break}p=M,c=""}v=i.slice(o,o=r[g++]),l=qt(r[g++],t.cm.options)}}else for(var A=1;A<r.length;A+=2)t.addToken(t,i.slice(o,o=r[A]),qt(r[A+1],t.cm.options))}function nr(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=Pt(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?qe(_(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Gt(e,t)}function ir(e,t,r){for(var n,i=[],o=t;o<r;o=n){var l=new nr(e.doc,Xe(e.doc,o),o);n=o+l.size,i.push(l)}return i}var or=null;var lr=null;function sr(e,t){var r=fe(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);or?n=or.delayedCallbacks:lr?n=lr:(n=lr=[],setTimeout(ar,0));for(var o=function(e){n.push((function(){return r[e].apply(null,i)}))},l=0;l<r.length;++l)o(l)}}function ar(){var e=lr;lr=null;for(var t=0;t<e.length;++t)e[t]()}function ur(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?fr(e,t):"gutter"==o?pr(e,t,r,n):"class"==o?dr(e,t):"widget"==o&&gr(e,t,n)}t.changes=null}function cr(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),l&&s<8&&(e.node.style.zIndex=2)),e.node}function hr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Zt(e,t)}function fr(e,t){var r=t.text.className,n=hr(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,dr(e,t)):r&&(t.text.className=r)}function dr(e,t){!function(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=cr(t);t.background=n.insertBefore(A("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?cr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function pr(e,t,r,n){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=cr(t);t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var l=cr(t),s=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),l.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(A("div",Je(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var a=0;a<e.display.gutterSpecs.length;++a){var u=e.display.gutterSpecs[a].className,c=o.hasOwnProperty(u)&&o[u];c&&s.appendChild(A("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[u]+"px; width: "+n.gutterWidth[u]+"px"))}}}function gr(e,t,r){t.alignable&&(t.alignable=null);for(var n=L("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);mr(e,t,r)}function vr(e,t,r,n){var i=hr(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),dr(e,t),pr(e,t,r,n),mr(e,t,n),t.node}function mr(e,t,r){if(yr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)yr(e,t.rest[n],t,r,!1)}function yr(e,t,r,n,i){if(t.widgets)for(var o=cr(r),l=0,s=t.widgets;l<s.length;++l){var a=s[l],u=A("div",[a.node],"CodeMirror-linewidget"+(a.className?" "+a.className:""));a.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),br(a,u,r,n),e.display.input.setUneditable(u),i&&a.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),sr(a,"redraw")}}function br(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function wr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!D(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),N(t.display.measure,A("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function xr(e,t){for(var r=Se(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Cr(e){return e.lineSpace.offsetTop}function Sr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Lr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=N(e.measure,A("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function kr(e){return 50-e.display.nativeBarWidth}function Tr(e){return e.display.scroller.clientWidth-kr(e)-e.display.barWidth}function Mr(e){return e.display.scroller.clientHeight-kr(e)-e.display.barHeight}function Nr(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(qe(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Ar(e,t,r,n){return Wr(e,Dr(e,t),r,n)}function Or(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[cn(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Dr(e,t){var r=qe(t),n=Or(e,r);n&&!n.text?n=null:n&&n.changes&&(ur(e,n,r,on(e)),e.curOp.forceUpdate=!0),n||(n=function(e,t){var r=qe(t=Rt(t)),n=e.display.externalMeasured=new nr(e.doc,t,r);n.lineN=r;var i=n.built=Zt(e,n);return n.text=i.pre,N(e.display.lineMeasure,i.pre),n}(e,t));var i=Nr(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Wr(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(!function(e,t,r){var n=e.options.lineWrapping,i=n&&Tr(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),s=0;s<l.length-1;s++){var a=l[s],u=l[s+1];Math.abs(a.bottom-u.bottom)>2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,n){var i,o=Pr(t.map,r,n),a=o.node,u=o.start,c=o.end,h=o.collapse;if(3==a.nodeType){for(var f=0;f<4;f++){for(;u&&ne(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c<o.coverEnd&&ne(t.line.text.charAt(o.coverStart+c));)++c;if((i=l&&s<9&&0==u&&c==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Er(k(a,u,c).getClientRects(),n)).left||i.right||0==u)break;c=u,u-=1,h="right"}l&&s<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Fe)return Fe;var t=N(e,A("span","x")),r=t.getBoundingClientRect(),n=k(t,0,1).getBoundingClientRect();return Fe=Math.abs(r.left-n.left)>1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{var d;u>0&&(h=n="right"),i=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(l&&s<9&&!u&&(!i||!i.left&&!i.right)){var p=a.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+nn(e.display),top:p.top,bottom:p.bottom}:Fr}for(var g=i.top-t.rect.top,v=i.bottom-t.rect.top,m=(g+v)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(m<y[b]);b++);var w=b?y[b-1]:0,x=y[b],C={left:("right"==h?i.right:i.left)-t.rect.left,right:("left"==h?i.left:i.right)-t.rect.left,top:w,bottom:x};i.left||i.right||(C.bogus=!0);e.options.singleCursorHeightPerLine||(C.rtop=g,C.rbottom=v);return C}(e,t,r,n)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Hr,Fr={left:0,right:0,top:0,bottom:0};function Pr(e,t,r){for(var n,i,o,l,s,a,u=0;u<e.length;u+=3)if(s=e[u],a=e[u+1],t<s?(i=0,o=1,l="left"):t<a?o=(i=t-s)+1:(u==e.length-3||t==a&&e[u+3]>t)&&(i=(o=a-s)-1,t>=a&&(l="right")),null!=i){if(n=e[u+2],s==a&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],l="left";if("right"==r&&i==a-s)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)n=e[(u+=3)+2],l="right";break}return{node:n,start:i,end:o,collapse:l,coverStart:s,coverEnd:a}}function Er(e,t){var r=Fr;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function Ir(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 Rr(e){e.display.externalMeasure=null,M(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ir(e.display.view[t])}function zr(e){Rr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Br(){return c&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Gr(){return c&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ur(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=wr(e.widgets[r]));return t}function Vr(e,t,r,n,i){if(!i){var o=Ur(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var l=Vt(t);if("local"==n?l+=Cr(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==n?0:Gr());var a=s.left+("window"==n?0:Br());r.left+=a,r.right+=a}return r.top+=l,r.bottom+=l,r}function Kr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=Br(),i-=Gr();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:i-l.top}}function jr(e,t,r,n,i){return n||(n=Xe(e.doc,t.line)),Vr(e,n,Ar(e,n,t.ch,i),r)}function Xr(e,t,r,n,i,o){function l(t,l){var s=Wr(e,i,t,l?"right":"left",o);return l?s.left=s.right:s.right=s.left,Vr(e,n,s,r)}n=n||Xe(e.doc,t.line),i||(i=Dr(e,n));var s=ue(n,e.doc.direction),a=t.ch,u=t.sticky;if(a>=n.text.length?(a=n.text.length,u="before"):a<=0&&(a=0,u="after"),!s)return l("before"==u?a-1:a,"before"==u);function c(e,t,r){return l(r?e-1:e,1==s[t].level!=r)}var h=se(s,a,u),f=le,d=c(a,h,"before"==u);return null!=f&&(d.other=c(a,f,"before"!=u)),d}function Yr(e,t){var r=0;t=st(e.doc,t),e.options.lineWrapping||(r=nn(e.display)*t.ch);var n=Xe(e.doc,t.line),i=Vt(n)+Cr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function _r(e,t,r,n,i){var o=et(e,t,r);return o.xRel=i,n&&(o.outside=n),o}function $r(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return _r(n.first,0,null,-1,-1);var i=Ze(n,r),o=n.first+n.size-1;if(i>o)return _r(n.first+n.size-1,Xe(n,o).text.length,null,1,1);t<0&&(t=0);for(var l=Xe(n,i);;){var s=Jr(e,l,i,t,r),a=Et(l,s.ch+(s.xRel>0||s.outside>0?1:0));if(!a)return s;var u=a.find(1);if(u.line==i)return u;l=Xe(n,i=u.line)}}function qr(e,t,r,n){n-=Ur(t);var i=t.text.length,o=oe((function(t){return Wr(e,r,t-1).bottom<=n}),i,0);return{begin:o,end:i=oe((function(t){return Wr(e,r,t).top>n}),o,i)}}function Zr(e,t,r,n){return r||(r=Dr(e,t)),qr(e,t,r,Vr(e,t,Wr(e,r,n),"line").top)}function Qr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function Jr(e,t,r,n,i){i-=Vt(t);var o=Dr(e,t),l=Ur(t),s=0,a=t.text.length,u=!0,c=ue(t,e.doc.direction);if(c){var h=(e.options.lineWrapping?tn:en)(e,t,r,o,c,n,i);s=(u=1!=h.level)?h.from:h.to-1,a=u?h.to:h.from-1}var f,d,p=null,g=null,v=oe((function(t){var r=Wr(e,o,t);return r.top+=l,r.bottom+=l,!!Qr(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,g=r),!0)}),s,a),m=!1;if(g){var y=n-g.left<g.right-n,b=y==u;v=p+(b?0:1),d=b?"after":"before",f=y?g.left:g.right}else{u||v!=a&&v!=s||v++,d=0==v?"after":v==t.text.length?"before":Wr(e,o,v-(u?1:0)).bottom+l<=i==u?"after":"before";var w=Xr(e,et(r,v,d),"line",t,o);f=w.left,m=i<w.top?-1:i>=w.bottom?1:0}return _r(r,v=ie(t.text,v,1),d,m,n-f)}function en(e,t,r,n,i,o,l){var s=oe((function(s){var a=i[s],u=1!=a.level;return Qr(Xr(e,et(r,u?a.to:a.from,u?"before":"after"),"line",t,n),o,l,!0)}),0,i.length-1),a=i[s];if(s>0){var u=1!=a.level,c=Xr(e,et(r,u?a.from:a.to,u?"after":"before"),"line",t,n);Qr(c,o,l,!0)&&c.top>l&&(a=i[s-1])}return a}function tn(e,t,r,n,i,o,l){var s=qr(e,t,n,l),a=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,h=null,f=0;f<i.length;f++){var d=i[f];if(!(d.from>=u||d.to<=a)){var p=Wr(e,n,1!=d.level?Math.min(u,d.to)-1:Math.max(a,d.from)).right,g=p<o?o-p+1e9:p-o;(!c||h>g)&&(c=d,h=g)}}return c||(c=i[i.length-1]),c.from<a&&(c={from:a,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function rn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Hr){Hr=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Hr.appendChild(document.createTextNode("x")),Hr.appendChild(A("br"));Hr.appendChild(document.createTextNode("x"))}N(e.measure,Hr);var r=Hr.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),M(e.measure),r||1}function nn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),r=A("pre",[t],"CodeMirror-line-like");N(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function on(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var s=e.display.gutterSpecs[l].className;r[s]=o.offsetLeft+o.clientLeft+i,n[s]=o.clientWidth}return{fixedPos:ln(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function ln(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sn(e){var t=rn(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/nn(e.display)-3);return function(i){if(Gt(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function an(e){var t=e.doc,r=sn(e);t.iter((function(e){var t=r(e);t!=e.height&&$e(e,t)}))}function un(e,t,r,n){var i=e.display;if(!r&&"true"==Se(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(e){return null}var a,u=$r(e,o,l);if(n&&u.xRel>0&&(a=Xe(e.doc,u.line).text).length==u.ch){var c=R(a,a.length,e.options.tabSize)-a.length;u=et(u.line,Math.max(0,Math.round((o-Lr(e.display).left)/nn(e.display))-c))}return u}function cn(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function hn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Ct&&zt(e.doc,t)<i.viewTo&&dn(e);else if(r<=i.viewFrom)Ct&&Bt(e.doc,r+n)>i.viewFrom?dn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)dn(e);else if(t<=i.viewFrom){var o=pn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):dn(e)}else if(r>=i.viewTo){var l=pn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):dn(e)}else{var s=pn(e,t,t,-1),a=pn(e,r,r+n,1);s&&a?(i.view=i.view.slice(0,s.index).concat(ir(e,s.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=n):dn(e)}var u=i.externalMeasured;u&&(r<u.lineN?u.lineN+=n:t<u.lineN+u.size&&(i.externalMeasured=null))}function fn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[cn(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==B(l,r)&&l.push(r)}}}function dn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function pn(e,t,r,n){var i,o=cn(e,t),l=e.display.view;if(!Ct||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,a=0;a<o;a++)s+=l[a].size;if(s!=t){if(n>0){if(o==l.length-1)return null;i=s+l[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;zt(e.doc,r)!=r;){if(o==(n<0?0:l.length-1))return null;r+=n*l[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function gn(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function vn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function mn(e,t){void 0===t&&(t=!0);for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),l=0;l<r.sel.ranges.length;l++)if(t||l!=r.sel.primIndex){var s=r.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var a=s.empty();(a||e.options.showCursorWhenSelecting)&&yn(e,s.head,i),a||wn(e,s,o)}}return n}function yn(e,t,r){var n=Xr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(A("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function bn(e,t){return e.top-t.top||e.left-t.left}function wn(e,t,r){var n=e.display,i=e.doc,o=document.createDocumentFragment(),l=Lr(e.display),s=l.left,a=Math.max(n.sizerWidth,Tr(e)-n.sizer.offsetLeft)-l.right,u="ltr"==i.direction;function c(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?a-e:r)+"px;\n height: "+(n-t)+"px"))}function h(t,r,n){var o,l,h=Xe(i,t),f=h.text.length;function d(r,n){return jr(e,et(t,r),"div",h,n)}function p(t,r,n){var i=Zr(e,h,null,t),o="ltr"==r==("after"==n)?"left":"right";return d("after"==n?i.begin:i.end-(/\s/.test(h.text.charAt(i.end-1))?2:1),o)[o]}var g=ue(h,i.direction);return function(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<r&&l.to>t||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}(g,r||0,null==n?f:n,(function(e,t,i,h){var v="ltr"==i,m=d(e,v?"left":"right"),y=d(t-1,v?"right":"left"),b=null==r&&0==e,w=null==n&&t==f,x=0==h,C=!g||h==g.length-1;if(y.top-m.top<=3){var S=(u?w:b)&&C,L=(u?b:w)&&x?s:(v?m:y).left,k=S?a:(v?y:m).right;c(L,m.top,k-L,m.bottom)}else{var T,M,N,A;v?(T=u&&b&&x?s:m.left,M=u?a:p(e,i,"before"),N=u?s:p(t,i,"after"),A=u&&w&&C?a:y.right):(T=u?p(e,i,"before"):s,M=!u&&b&&x?a:m.right,N=!u&&w&&C?s:y.left,A=u?p(t,i,"after"):a),c(T,m.top,M-T,m.bottom),m.bottom<y.top&&c(s,m.bottom,null,y.top),c(N,y.top,A-N,y.bottom)}(!o||bn(m,o)<0)&&(o=m),bn(y,o)<0&&(o=y),(!l||bn(m,l)<0)&&(l=m),bn(y,l)<0&&(l=y)})),{start:o,end:l}}var f=t.from(),d=t.to();if(f.line==d.line)h(f.line,f.ch,d.ch);else{var p=Xe(i,f.line),g=Xe(i,d.line),v=Rt(p)==Rt(g),m=h(f.line,f.ch,v?p.text.length+1:null).end,y=h(d.line,v?0:null,d.ch).start;v&&(m.top<y.top-2?(c(m.right,m.top,null,m.bottom),c(s,y.top,y.left,y.bottom)):c(m.right,m.top,y.left-m.right,m.bottom)),m.bottom<y.top&&c(s,m.bottom,null,y.top)}r.appendChild(o)}function xn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||kn(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Cn(e){e.state.focused||(e.display.input.focus(),Ln(e))}function Sn(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,kn(e))}),100)}function Ln(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(pe(e,"focus",e,t),e.state.focused=!0,H(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),a&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),xn(e))}function kn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(pe(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Tn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=e.options.lineWrapping,a=void 0,u=0;if(!i.hidden){if(l&&s<8){var c=i.node.offsetTop+i.node.offsetHeight;a=c-r,r=c}else{var h=i.node.getBoundingClientRect();a=h.bottom-h.top,!o&&i.text.firstChild&&(u=i.text.firstChild.getBoundingClientRect().right-h.left-1)}var f=i.line.height-a;if((f>.005||f<-.005)&&($e(i.line,a),Mn(i.line),i.rest))for(var d=0;d<i.rest.length;d++)Mn(i.rest[d]);if(u>e.display.sizerWidth){var p=Math.ceil(u/nn(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Mn(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function Nn(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Cr(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=Ze(t,n),l=Ze(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;s<o?(o=s,l=Ze(t,Vt(Xe(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=Ze(t,Vt(Xe(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function An(e,t){var r=e.display,n=rn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Mr(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Sr(r),a=t.top<n,u=t.bottom>s-n;if(t.top<i)l.scrollTop=a?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(l.scrollTop=c)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,f=Tr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),d=t.right-t.left>f;return d&&(t.right=t.left+f),t.left<10?l.scrollLeft=0:t.left<h?l.scrollLeft=Math.max(0,t.left-(d?0:10)):t.right>f+h-3&&(l.scrollLeft=t.right+(d?0:10)-f),l}function On(e,t){null!=t&&(Hn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Dn(e){Hn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Wn(e,t,r){null==t&&null==r||Hn(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Hn(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Fn(e,Yr(e,t.from),Yr(e,t.to),t.margin))}function Fn(e,t,r,n){var i=An(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Wn(e,i.scrollLeft,i.scrollTop)}function Pn(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||ai(e,{top:t}),En(e,t,!0),r&&ai(e),ni(e,100))}function En(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function In(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,hi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Rn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Sr(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?r:0,docHeight:n,scrollHeight:n+kr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var zn=function(e,t,r){this.cm=r;var n=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),he(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),he(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,l&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};zn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n: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=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},zn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zn.prototype.zeroWidthHack=function(){var e=y&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},zn.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,(function n(){var i=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)}))},zn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Bn=function(){};function Gn(e,t){t||(t=Rn(e));var r=e.display.barWidth,n=e.display.barHeight;Un(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Tn(e),Un(e,Rn(e)),r=e.display.barWidth,n=e.display.barHeight}function Un(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}Bn.prototype.update=function(){return{bottom:0,right:0}},Bn.prototype.setScrollLeft=function(){},Bn.prototype.setScrollTop=function(){},Bn.prototype.clear=function(){};var Vn={native:zn,null:Bn};function Kn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Vn[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,r){"horizontal"==r?In(e,t):Pn(e,t)}),e),e.display.scrollbars.addClass&&H(e.display.wrapper,e.display.scrollbars.addClass)}var jn=0;function Xn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++jn},t=e.curOp,or?or.ops.push(t):t.ownsGroup=or={ops:[t],delayedCallbacks:[]}}function Yn(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}(r)}finally{or=null,t(r)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)_n(t[r]);for(var n=0;n<t.length;n++)$n(t[n]);for(var i=0;i<t.length;i++)qn(t[i]);for(var o=0;o<t.length;o++)Zn(t[o]);for(var l=0;l<t.length;l++)Qn(t[l])}(e)}))}function _n(e){var t=e.cm,r=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=kr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=kr(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&jt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new oi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function $n(e){e.updatedDisplay=e.mustUpdate&&li(e.cm,e.update)}function qn(e){var t=e.cm,r=t.display;e.updatedDisplay&&Tn(t),e.barMeasure=Rn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ar(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+kr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Tr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Zn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&In(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==W();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Gn(t,e.barMeasure),e.updatedDisplay&&ci(t,e.barMeasure),e.selectionChanged&&xn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Cn(e.cm)}function Qn(e){var t=e.cm,r=t.display,n=t.doc;(e.updatedDisplay&&si(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&En(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&In(t,e.scrollLeft,!0,!0),e.scrollToPos)&&function(e,t){if(!ge(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=A("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Cr(e.display))+"px;\n height: "+(t.bottom-t.top+kr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?et(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var l=!1,s=Xr(e,t),a=r&&r!=t?Xr(e,r):s,u=An(e,i={left:Math.min(s.left,a.left),top:Math.min(s.top,a.top)-n,right:Math.max(s.left,a.left),bottom:Math.max(s.bottom,a.bottom)+n}),c=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=u.scrollTop&&(Pn(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(l=!0)),null!=u.scrollLeft&&(In(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(l=!0)),!l)break}return i}(t,st(n,e.scrollToPos.from),st(n,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var l=0;l<i.length;++l)i[l].lines.length||pe(i[l],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&pe(o[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&pe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Jn(e,t){if(e.curOp)return t();Xn(e);try{return t()}finally{Yn(e)}}function ei(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Xn(e);try{return t.apply(e,arguments)}finally{Yn(e)}}}function ti(e){return function(){if(this.curOp)return e.apply(this,arguments);Xn(this);try{return e.apply(this,arguments)}finally{Yn(this)}}}function ri(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Xn(t);try{return e.apply(this,arguments)}finally{Yn(t)}}}function ni(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,E(ii,e))}function ii(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=dt(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(n.line>=e.display.viewFrom){var l=o.styles,s=o.text.length>e.options.maxHighlightLength?Ue(t.mode,n.state):null,a=ht(e,o,n,!0);s&&(n.state=s),o.styles=a.styles;var u=o.styleClasses,c=a.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!h&&f<l.length;++f)h=l[f]!=o.styles[f];h&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=e.options.maxHighlightLength&&pt(e,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return ni(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&Jn(e,(function(){for(var t=0;t<i.length;t++)fn(e,i[t],"text")}))}}var oi=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Nn(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Tr(e),this.force=r,this.dims=on(e),this.events=[]};function li(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return dn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==gn(e))return!1;fi(e)&&(dn(e),t.dims=on(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>l&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),Ct&&(o=zt(e.doc,o),l=Bt(e.doc,l));var s=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=ir(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=ir(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(cn(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(ir(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,cn(e,r)))),n.viewTo=r}(e,o,l),r.viewOffset=Vt(Xe(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var u=gn(e);if(!s&&0==u&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=W();if(!t||!D(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&D(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return u>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,l=o.firstChild;function s(t){var r=t.nextSibling;return a&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var u=n.view,c=n.viewFrom,h=0;h<u.length;h++){var f=u[h];if(f.hidden);else if(f.node&&f.node.parentNode==o){for(;l!=f.node;)l=s(l);var d=i&&null!=t&&t<=c&&f.lineNumber;f.changes&&(B(f.changes,"gutter")>-1&&(d=!1),ur(e,f,c,r)),d&&(M(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(Je(e.options,c)))),l=f.node.nextSibling}else{var p=vr(e,f,c,r);o.insertBefore(p,l)}c+=f.size}for(;l;)l=s(l)}(e,r.updateLineNumbers,t.dims),u>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=W()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&D(document.body,e.anchorNode)&&D(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(c),M(r.cursorDiv),M(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ni(e,400)),r.updateLineNumbers=null,!0}function si(e,t){for(var r=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Tr(e))n&&(t.visible=Nn(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Sr(e.display)-Mr(e),r.top)}),t.visible=Nn(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!li(e,t))break;Tn(e);var i=Rn(e);vn(e),Gn(e,i),ci(e,i),t.force=!1}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 ai(e,t){var r=new oi(e,t);if(li(e,r)){Tn(e),si(e,r);var n=Rn(e);vn(e),Gn(e,n),ci(e,n),r.finish()}}function ui(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ci(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+kr(e)+"px"}function hi(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=ln(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l<r.length;l++)if(!r[l].hidden){e.options.fixedGutter&&(r[l].gutter&&(r[l].gutter.style.left=o),r[l].gutterBackground&&(r[l].gutterBackground.style.left=o));var s=r[l].alignable;if(s)for(var a=0;a<s.length;a++)s[a].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function fi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=Je(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(A("div",[A("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",ui(e.display),!0}return!1}function di(e,t){for(var r=[],n=!1,i=0;i<e.length;i++){var o=e[i],l=null;if("string"!=typeof o&&(l=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;n=!0}r.push({className:o,style:l})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function pi(e){var t=e.gutters,r=e.gutterSpecs;M(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var i=r[n],o=i.className,l=i.style,s=t.appendChild(A("div",null,"CodeMirror-gutter "+o));l&&(s.style.cssText=l),"CodeMirror-linenumbers"==o&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",ui(e)}function gi(e){pi(e.display),hn(e),hi(e)}function vi(e,t,n,i){var o=this;this.input=n,o.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=O("div",null,"CodeMirror-code"),o.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=A("div",null,"CodeMirror-cursors"),o.measure=A("div",null,"CodeMirror-measure"),o.lineMeasure=A("div",null,"CodeMirror-measure"),o.lineSpace=O("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var u=O("div",[o.lineSpace],"CodeMirror-lines");o.mover=A("div",[u],null,"position: relative"),o.sizer=A("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=A("div",null,null,"position: absolute; height: 50px; width: 1px;"),o.gutters=A("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=A("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=A("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),l&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),a||r&&m||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=di(i.gutters,i.lineNumbers),pi(o),n.init(o)}oi.prototype.signal=function(e,t){me(e,t)&&this.events.push(arguments)},oi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)pe.apply(null,this.events[e])};var mi=0,yi=null;function bi(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function wi(e){var t=bi(e);return t.x*=yi,t.y*=yi,t}function xi(e,t){var n=bi(t),i=n.x,o=n.y,l=e.display,s=l.scroller,u=s.scrollWidth>s.clientWidth,c=s.scrollHeight>s.clientHeight;if(i&&u||o&&c){if(o&&y&&a)e:for(var f=t.target,d=l.view;f!=s;f=f.parentNode)for(var p=0;p<d.length;p++)if(d[p].node==f){e.display.currentWheelTarget=f;break e}if(i&&!r&&!h&&null!=yi)return o&&c&&Pn(e,Math.max(0,s.scrollTop+o*yi)),In(e,Math.max(0,s.scrollLeft+i*yi)),(!o||o&&c)&&be(t),void(l.wheelStartX=null);if(o&&null!=yi){var g=o*yi,v=e.doc.scrollTop,m=v+l.wrapper.clientHeight;g<0?v=Math.max(0,v+g-50):m=Math.min(e.doc.height,m+g+50),ai(e,{top:v,bottom:m})}mi<20&&(null==l.wheelStartX?(l.wheelStartX=s.scrollLeft,l.wheelStartY=s.scrollTop,l.wheelDX=i,l.wheelDY=o,setTimeout((function(){if(null!=l.wheelStartX){var e=s.scrollLeft-l.wheelStartX,t=s.scrollTop-l.wheelStartY,r=t&&l.wheelDY&&t/l.wheelDY||e&&l.wheelDX&&e/l.wheelDX;l.wheelStartX=l.wheelStartY=null,r&&(yi=(yi*mi+r)/(mi+1),++mi)}}),200)):(l.wheelDX+=i,l.wheelDY+=o))}}l?yi=-.53:r?yi=15:c?yi=-.7:f&&(yi=-1/3);var Ci=function(e,t){this.ranges=e,this.primIndex=t};Ci.prototype.primary=function(){return this.ranges[this.primIndex]},Ci.prototype.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 r=this.ranges[t],n=e.ranges[t];if(!rt(r.anchor,n.anchor)||!rt(r.head,n.head))return!1}return!0},Ci.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Si(nt(this.ranges[t].anchor),nt(this.ranges[t].head));return new Ci(e,this.primIndex)},Ci.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ci.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(tt(t,n.from())>=0&&tt(e,n.to())<=0)return r}return-1};var Si=function(e,t){this.anchor=e,this.head=t};function Li(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort((function(e,t){return tt(e.from(),t.from())})),r=B(t,i);for(var o=1;o<t.length;o++){var l=t[o],s=t[o-1],a=tt(s.to(),l.from());if(n&&!l.empty()?a>0:a>=0){var u=ot(s.from(),l.from()),c=it(s.to(),l.to()),h=s.empty()?l.from()==l.head:s.from()==s.head;o<=r&&--r,t.splice(--o,2,new Si(h?c:u,h?u:c))}}return new Ci(t,r)}function ki(e,t){return new Ci([new Si(e,t||e)],0)}function Ti(e){return e.text?et(e.from.line+e.text.length-1,_(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Mi(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Ti(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Ti(t).ch-t.to.ch),et(r,n)}function Ni(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new Si(Mi(i.anchor,t),Mi(i.head,t)))}return Li(e.cm,r,e.sel.primIndex)}function Ai(e,t,r){return e.line==t.line?et(r.line,e.ch-t.ch+r.ch):et(r.line+(e.line-t.line),e.ch)}function Oi(e){e.doc.mode=ze(e.options,e.doc.modeOption),Di(e)}function Di(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ni(e,100),e.state.modeGen++,e.curOp&&hn(e)}function Wi(e,t){return 0==t.from.ch&&0==t.to.ch&&""==_(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Hi(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){!function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Nt(e),At(e,r);var i=n?n(e):1;i!=e.height&&$e(e,i)}(e,r,i,n),sr(e,"change",e,t)}function l(e,t){for(var r=[],o=e;o<t;++o)r.push(new Xt(u[o],i(o),n));return r}var s=t.from,a=t.to,u=t.text,c=Xe(e,s.line),h=Xe(e,a.line),f=_(u),d=i(u.length-1),p=a.line-s.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(Wi(e,t)){var g=l(0,u.length-1);o(h,h.text,d),p&&e.remove(s.line,p),g.length&&e.insert(s.line,g)}else if(c==h)if(1==u.length)o(c,c.text.slice(0,s.ch)+f+c.text.slice(a.ch),d);else{var v=l(1,u.length-1);v.push(new Xt(f+c.text.slice(a.ch),d,n)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,v)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+h.text.slice(a.ch),i(0)),e.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(h,f+h.text.slice(a.ch),d);var m=l(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,m)}sr(e,"change",e,t)}function Fi(e,t,r){!function e(n,i,o){if(n.linked)for(var l=0;l<n.linked.length;++l){var s=n.linked[l];if(s.doc!=i){var a=o&&s.sharedHist;r&&!a||(t(s.doc,a),e(s.doc,n,a))}}}(e,null,!0)}function Pi(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,an(e),Oi(e),Ei(e),e.options.lineWrapping||jt(e),e.options.mode=t.modeOption,hn(e)}function Ei(e){("rtl"==e.doc.direction?H:T)(e.display.lineDiv,"CodeMirror-rtl")}function Ii(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 Ri(e,t){var r={from:nt(t.from),to:Ti(t),text:Ye(e,t.from,t.to)};return Vi(e,r,t.from.line,t.to.line+1),Fi(e,(function(e){return Vi(e,r,t.from.line,t.to.line+1)}),!0),r}function zi(e){for(;e.length;){if(!_(e).ranges)break;e.pop()}}function Bi(e,t,r,n){var i=e.history;i.undone.length=0;var o,l,s=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(zi(e.done),_(e.done)):e.done.length&&!_(e.done).ranges?_(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),_(e.done)):void 0}(i,i.lastOp==n)))l=_(o.changes),0==tt(t.from,t.to)&&0==tt(t.from,l.to)?l.to=Ti(t):o.changes.push(Ri(e,t));else{var a=_(i.done);for(a&&a.ranges||Ui(e.sel,i.done),o={changes:[Ri(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(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,l||pe(e,"historyAdded")}function Gi(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,_(i.done),t))?i.done[i.done.length-1]=t:Ui(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&zi(i.undone)}function Ui(e,t){var r=_(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Vi(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),(function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o}))}function Ki(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function ji(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(Ki(r[i]));return n}(e,t),n=Tt(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],l=n[i];if(o&&l)e:for(var s=0;s<l.length;++s){for(var a=l[s],u=0;u<o.length;++u)if(o[u].marker==a.marker)continue e;o.push(a)}else l&&(r[i]=l)}return r}function Xi(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?Ci.prototype.deepCopy.call(o):o);else{var l=o.changes,s=[];n.push({changes:s});for(var a=0;a<l.length;++a){var u=l[a],c=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(c=h.match(/^spans_(\d+)$/))&&B(t,Number(c[1]))>-1&&(_(s)[h]=u[h],delete u[h])}}}return n}function Yi(e,t,r,n){if(n){var i=e.anchor;if(r){var o=tt(t,i)<0;o!=tt(r,i)<0?(i=t,t=r):o!=tt(t,r)<0&&(t=r)}return new Si(i,t)}return new Si(r||t,t)}function _i(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ji(e,new Ci([Yi(e.sel.primary(),t,r,i)],0),n)}function $i(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=Yi(e.sel.ranges[o],t[o],null,i);Ji(e,Li(e.cm,n,e.sel.primIndex),r)}function qi(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,Ji(e,Li(e.cm,i,e.sel.primIndex),n)}function Zi(e,t,r,n){Ji(e,ki(t,r),n)}function Qi(e,t,r){var n=e.history.done,i=_(n);i&&i.ranges?(n[n.length-1]=t,eo(e,t,r)):Ji(e,t,r)}function Ji(e,t,r){eo(e,t,r),Gi(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function eo(e,t,r){(me(e,"beforeSelectionChange")||e.cm&&me(e.cm,"beforeSelectionChange"))&&(t=function(e,t,r){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new Si(st(e,t[r].anchor),st(e,t[r].head))},origin:r&&r.origin};return pe(e,"beforeSelectionChange",e,n),e.cm&&pe(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Li(e.cm,n.ranges,n.ranges.length-1):t}(e,t,r));var n=r&&r.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);to(e,no(e,t,n,!0)),r&&!1===r.scroll||!e.cm||Dn(e.cm)}function to(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ve(e.cm)),sr(e,"cursorActivity",e))}function ro(e){to(e,no(e,e.sel,null,!1))}function no(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],a=oo(e,l.anchor,s&&s.anchor,r,n),u=oo(e,l.head,s&&s.head,r,n);(i||a!=l.anchor||u!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Si(a,u))}return i?Li(e.cm,i,t.primIndex):t}function io(e,t,r,n,i){var o=Xe(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var s=o.markedSpans[l],a=s.marker,u="selectLeft"in a?!a.selectLeft:a.inclusiveLeft,c="selectRight"in a?!a.selectRight:a.inclusiveRight;if((null==s.from||(u?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(c?s.to>=t.ch:s.to>t.ch))){if(i&&(pe(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(r){var h=a.find(n<0?1:-1),f=void 0;if((n<0?c:u)&&(h=lo(e,h,-n,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(f=tt(h,r))&&(n<0?f<0:f>0))return io(e,h,t,n,i)}var d=a.find(n<0?-1:1);return(n<0?u:c)&&(d=lo(e,d,n,d.line==t.line?o:null)),d?io(e,d,t,n,i):null}}return t}function oo(e,t,r,n,i){var o=n||1,l=io(e,t,r,o,i)||!i&&io(e,t,r,o,!0)||io(e,t,r,-o,i)||!i&&io(e,t,r,-o,!0);return l||(e.cantEdit=!0,et(e.first,0))}function lo(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?st(e,et(t.line-1)):null:r>0&&t.ch==(n||Xe(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+r)}function so(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),U)}function ao(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,i,o){t&&(n.from=st(e,t)),r&&(n.to=st(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),pe(e,"beforeChange",e,n),e.cm&&pe(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function uo(e,t,r){if(e.cm){if(!e.cm.curOp)return ei(e.cm,uo)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"))||(t=ao(e,t,!0))){var n=xt&&!r&&function(e,t,r){var n=null;if(e.iter(t.line,r.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=B(n,r)||(n||(n=[])).push(r)}})),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var l=n[o],s=l.find(0),a=0;a<i.length;++a){var u=i[a];if(!(tt(u.to,s.from)<0||tt(u.from,s.to)>0)){var c=[a,1],h=tt(u.from,s.from),f=tt(u.to,s.to);(h<0||!l.inclusiveLeft&&!h)&&c.push({from:u.from,to:s.from}),(f>0||!l.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)co(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else co(e,t)}}function co(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var r=Ni(e,t);Bi(e,t,r,e.cm?e.cm.curOp.id:NaN),po(e,t,r,Tt(e,t));var n=[];Fi(e,(function(e,r){r||-1!=B(n,e.history)||(yo(e.history,t),n.push(e.history)),po(e,t,null,Tt(e,t))}))}}function ho(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var i,o=e.history,l=e.sel,s="undo"==t?o.done:o.undone,a="undo"==t?o.undone:o.done,u=0;u<s.length&&(i=s[u],r?!i.ranges||i.equals(e.sel):i.ranges);u++);if(u!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(n)return void s.push(i);break}if(Ui(i,a),r&&!i.equals(e.sel))return void Ji(e,i,{clearRedo:!1});l=i}var c=[];Ui(l,a),a.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var h=me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"),f=function(r){var n=i.changes[r];if(n.origin=t,h&&!ao(e,n,!1))return s.length=0,{};c.push(Ri(e,n));var o=r?Ni(e,n):_(s);po(e,n,o,ji(e,n)),!r&&e.cm&&e.cm.scrollIntoView({from:n.from,to:Ti(n)});var l=[];Fi(e,(function(e,t){t||-1!=B(l,e.history)||(yo(e.history,n),l.push(e.history)),po(e,n,null,ji(e,n))}))},d=i.changes.length-1;d>=0;--d){var p=f(d);if(p)return p.v}}}}function fo(e,t){if(0!=t&&(e.first+=t,e.sel=new Ci($(e.sel.ranges,(function(e){return new Si(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){hn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)fn(e.cm,n,"gutter")}}function po(e,t,r,n){if(e.cm&&!e.cm.curOp)return ei(e.cm,po)(e,t,r,n);if(t.to.line<e.first)fo(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);fo(e,i),t={from:et(e.first,0),to:et(t.to.line+i,t.to.ch),text:[_(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:et(o,Xe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ye(e,t.from,t.to),r||(r=Ni(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,l=t.to,s=!1,a=o.line;e.options.lineWrapping||(a=qe(Rt(Xe(n,o.line))),n.iter(a,l.line+1,(function(e){if(e==i.maxLine)return s=!0,!0})));n.sel.contains(t.from,t.to)>-1&&ve(e);Hi(n,t,r,sn(e)),e.options.lineWrapping||(n.iter(a,o.line+t.text.length,(function(e){var t=Kt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var i=Xe(e,n).stateAfter;if(i&&(!(i instanceof ut)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}})(n,o.line),ni(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?hn(e):o.line!=l.line||1!=t.text.length||Wi(e.doc,t)?hn(e,o.line,l.line+1,u):fn(e,o.line,"text");var c=me(e,"changes"),h=me(e,"change");if(h||c){var f={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};h&&sr(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,n):Hi(e,t,n),eo(e,r,U),e.cantEdit&&oo(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function go(e,t,r,n,i){var o;n||(n=r),tt(n,r)<0&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),uo(e,{from:r,to:n,text:t,origin:i})}function vo(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function mo(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)vo(o.ranges[s].anchor,t,r,n),vo(o.ranges[s].head,t,r,n)}else{for(var a=0;a<o.changes.length;++a){var u=o.changes[a];if(r<u.from.line)u.from=et(u.from.line+n,u.from.ch),u.to=et(u.to.line+n,u.to.ch);else if(t<=u.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function yo(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;mo(e.done,r,n,i),mo(e.undone,r,n,i)}function bo(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=Xe(e,lt(e,t)):i=qe(t),null==i?null:(n(o,i)&&e.cm&&fn(e.cm,i,r),o)}function wo(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function xo(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}Si.prototype.from=function(){return ot(this.anchor,this.head)},Si.prototype.to=function(){return it(this.anchor,this.head)},Si.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},wo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r];this.height-=i.height,Yt(i),sr(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},xo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var o=Math.min(t,i-e),l=n.height;if(n.removeInner(e,o),this.height-=l-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof wo))){var s=[];this.collapse(s),this.children=[new wo(s)],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,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(var l=i.lines.length%25+25,s=l;s<i.lines.length;){var a=new wo(i.lines.slice(s,s+=25));i.height-=a.height,this.children.splice(++n,0,a),a.parent=this}i.lines=i.lines.slice(0,l),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new xo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=B(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new xo(e.children);n.parent=e,e.children=[n,t],e=n}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e);if(i.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var Co=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};function So(e,t,r){Vt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&On(e,r)}Co.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=qe(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=wr(this);$e(r,Math.max(0,r.height-o)),e&&(Jn(e,(function(){So(e,r,-o),fn(e,n,"widget")})),sr(e,"lineWidgetCleared",e,this,n))}},Co.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=wr(this)-t;i&&(Gt(this.doc,n)||$e(n,n.height+i),r&&Jn(r,(function(){r.curOp.forceUpdate=!0,So(r,n,i),sr(r,"lineWidgetChanged",r,e,qe(n))})))},ye(Co);var Lo=0,ko=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Lo};function To(e,t,r,n,i){if(n&&n.shared)return function(e,t,r,n,i){(n=I(n)).shared=!1;var o=[To(e,t,r,n,i)],l=o[0],s=n.widgetNode;return Fi(e,(function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(To(e,st(e,t),st(e,r),n,i));for(var a=0;a<e.linked.length;++a)if(e.linked[a].isParent)return;l=_(o)})),new Mo(o,l)}(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return ei(e.cm,To)(e,t,r,n,i);var o=new ko(e,i),l=tt(t,r);if(n&&I(n,o,!1),l>0||0==l&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=O("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(It(e,t.line,t,r,o)||t.line!=r.line&&It(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ct=!0}o.addToHistory&&Bi(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,a=t.line,u=e.cm;if(e.iter(a,r.line+1,(function(e){u&&o.collapsed&&!u.options.lineWrapping&&Rt(e)==u.display.maxLine&&(s=!0),o.collapsed&&a!=t.line&&$e(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new St(o,a==t.line?t.ch:null,a==r.line?r.ch:null)),++a})),o.collapsed&&e.iter(t.line,r.line+1,(function(t){Gt(e,t)&&$e(t,0)})),o.clearOnEnter&&he(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(xt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Lo,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)hn(u,t.line,r.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=r.line;c++)fn(u,c,"text");o.atomic&&ro(u.doc),sr(u,"markerAdded",u,o)}return o}ko.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Xn(e),me(this,"clear")){var r=this.find();r&&sr(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],s=Lt(l.markedSpans,this);e&&!this.collapsed?fn(e,qe(l),"text"):e&&(null!=s.to&&(i=qe(l)),null!=s.from&&(n=qe(l))),l.markedSpans=kt(l.markedSpans,s),null==s.from&&this.collapsed&&!Gt(this.doc,l)&&e&&$e(l,rn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var a=0;a<this.lines.length;++a){var u=Rt(this.lines[a]),c=Kt(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&hn(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ro(e.doc)),e&&sr(e,"markerCleared",e,this,n,i),t&&Yn(e),this.parent&&this.parent.clear()}},ko.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],l=Lt(o.markedSpans,this);if(null!=l.from&&(r=et(t?o:qe(o),l.from),-1==e))return r;if(null!=l.to&&(n=et(t?o:qe(o),l.to),1==e))return n}return r&&{from:r,to:n}},ko.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&Jn(n,(function(){var i=t.line,o=qe(t.line),l=Or(n,o);if(l&&(Ir(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Gt(r.doc,i)&&null!=r.height){var s=r.height;r.height=null;var a=wr(r)-s;a&&$e(i,i.height+a)}sr(n,"markerChanged",n,e)}))},ko.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=B(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ko.prototype.detachLine=function(e){if(this.lines.splice(B(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(ko);var Mo=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function No(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function Ao(e){for(var t=function(t){var r=e[t],n=[r.primary.doc];Fi(r.primary.doc,(function(e){return n.push(e)}));for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==B(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}},r=0;r<e.length;r++)t(r)}Mo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();sr(this,"clear")}},Mo.prototype.find=function(e,t){return this.primary.find(e,t)},ye(Mo);var Oo=0,Do=function(e,t,r,n,i){if(!(this instanceof Do))return new Do(e,t,r,n,i);null==r&&(r=0),xo.call(this,[new wo([new Xt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=et(r,0);this.sel=ki(o),this.history=new Ii(null),this.id=++Oo,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Hi(this,{from:o,to:o,text:e}),Ji(this,ki(o),U)};Do.prototype=Z(xo.prototype,{constructor:Do,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=_e(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ri((function(e){var t=et(this.first,0),r=this.first+this.size-1;uo(this,{from:t,to:et(r,Xe(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Wn(this.cm,0,0),Ji(this,ki(t),U)})),replaceRange:function(e,t,r,n){go(this,e,t=st(this,t),r=r?st(this,r):t,n)},getRange:function(e,t,r){var n=Ye(this,st(this,e),st(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Qe(this,e))return Xe(this,e)},getLineNumber:function(e){return qe(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Xe(this,e)),Rt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return st(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ri((function(e,t,r){Zi(this,st(this,"number"==typeof e?et(e,t||0):e),null,r)})),setSelection:ri((function(e,t,r){Zi(this,st(this,e),st(this,t||e),r)})),extendSelection:ri((function(e,t,r){_i(this,st(this,e),t&&st(this,t),r)})),extendSelections:ri((function(e,t){$i(this,at(this,e),t)})),extendSelectionsBy:ri((function(e,t){$i(this,at(this,$(this.sel.ranges,e)),t)})),setSelections:ri((function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new Si(st(this,e[i].anchor),st(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Ji(this,Li(this.cm,n,t),r)}})),addSelection:ri((function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Si(st(this,e),st(this,t||e))),Ji(this,Li(this.cm,n,n.length-1),r)})),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=Ye(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=Ye(this,r[n].from(),r[n].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:ri((function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];n[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:r}}for(var s=t&&"end"!=t&&function(e,t,r){for(var n=[],i=et(e.first,0),o=i,l=0;l<t.length;l++){var s=t[l],a=Ai(s.from,i,o),u=Ai(Ti(s),i,o);if(i=s.to,o=u,"around"==r){var c=e.sel.ranges[l],h=tt(c.head,c.anchor)<0;n[l]=new Si(h?u:a,h?a:u)}else n[l]=new Si(a,a)}return new Ci(n,e.sel.primIndex)}(this,n,t),a=n.length-1;a>=0;a--)uo(this,n[a]);s?Qi(this,s):this.cm&&Dn(this.cm)})),undo:ri((function(){ho(this,"undo")})),redo:ri((function(){ho(this,"redo")})),undoSelection:ri((function(){ho(this,"undo",!0)})),redoSelection:ri((function(){ho(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Ii(this.history.maxGeneration),Fi(this,(function(t){return t.history=e.history}),!0)},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:Xi(this.history.done),undone:Xi(this.history.undone)}},setHistory:function(e){var t=this.history=new Ii(this.history.maxGeneration);t.done=Xi(e.done.slice(0),null,!0),t.undone=Xi(e.undone.slice(0),null,!0)},setGutterMarker:ri((function(e,t,r){return bo(this,e,"gutter",(function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&te(n)&&(e.gutterMarkers=null),!0}))})),clearGutter:ri((function(e){var t=this;this.iter((function(r){r.gutterMarkers&&r.gutterMarkers[e]&&bo(t,r,"gutter",(function(){return r.gutterMarkers[e]=null,te(r.gutterMarkers)&&(r.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Qe(this,e))return null;if(t=e,!(e=Xe(this,e)))return null}else if(null==(t=qe(e)))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}},addLineClass:ri((function(e,t,r){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(L(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0}))})),removeLineClass:ri((function(e,t,r){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[n];if(!i)return!1;if(null==r)e[n]=null;else{var o=i.match(L(r));if(!o)return!1;var l=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&l!=i.length?" ":"")+i.slice(l)||null}return!0}))})),addLineWidget:ri((function(e,t,r){return function(e,t,r,n){var i=new Co(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),bo(e,t,"widget",(function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Gt(e,t)){var n=Vt(t)<e.scrollTop;$e(t,t.height+wr(i)),n&&On(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&sr(o,"lineWidgetAdded",o,i,"number"==typeof t?t:qe(t)),i}(this,e,t,r)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return To(this,st(this,e),st(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return To(this,e=st(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=Xe(this,(e=st(this,e)).line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(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,r){e=st(this,e),t=st(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var l=o.markedSpans;if(l)for(var s=0;s<l.length;s++){var a=l[s];null!=a.to&&i==e.line&&e.ch>=a.to||null==a.from&&i!=e.line||null!=a.from&&i==t.line&&a.from>=t.ch||r&&!r(a.marker)||n.push(a.marker.parent||a.marker)}++i})),n},getAllMarks:function(){var e=[];return this.iter((function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)})),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+n;if(o>e)return t=e,!0;e-=o,++r})),st(this,et(r,t))},indexFromPos:function(e){var t=(e=st(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+r})),t},copy:function(e){var t=new Do(_e(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);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,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new Do(_e(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(tt(o,l)){var s=To(e,o,l,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}(n,No(this)),n},unlinkDoc:function(e){if(e instanceof Ml&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ao(No(this));break}}if(e.history==this.history){var r=[e.id];Fi(e,(function(e){return r.push(e.id)}),!0),e.history=new Ii(null),e.history.done=Xi(this.history.done,r),e.history.undone=Xi(this.history.undone,r)}},iterLinkedDocs:function(e){Fi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):De(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ri((function(e){var t;("rtl"!=e&&(e="ltr"),e!=this.direction)&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Jn(t=this.cm,(function(){Ei(t),hn(t)})))}))}),Do.prototype.eachLine=Do.prototype.iter;var Wo=0;function Ho(e){var t=this;if(Fo(t),!ge(t,e)&&!xr(t.display,e)){be(e),l&&(Wo=+new Date);var r=un(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),s=0,a=function(){++s==i&&ei(t,(function(){var e={from:r=st(t.doc,r),to:r,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};uo(t.doc,e),Qi(t.doc,ki(st(t.doc,r),st(t.doc,Ti(e))))}))()},u=function(e,r){if(t.options.allowDropFileTypes&&-1==B(t.options.allowDropFileTypes,e.type))a();else{var n=new FileReader;n.onerror=function(){return a()},n.onload=function(){var e=n.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)?a():(o[r]=e,a())},n.readAsText(e)}},c=0;c<n.length;c++)u(n[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var h=e.dataTransfer.getData("Text");if(h){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),eo(t.doc,ki(r,r)),f)for(var d=0;d<f.length;++d)go(t.doc,"",f[d].anchor,f[d].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Fo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Po(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var i=t[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation((function(){for(var t=0;t<r.length;t++)e(r[t])}))}}var Eo=!1;function Io(){var e;Eo||(he(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Po(Ro)}),100))})),he(window,"blur",(function(){return Po(kn)})),Eo=!0)}function Ro(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var zo={3:"Pause",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:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Bo=0;Bo<10;Bo++)zo[Bo+48]=zo[Bo+96]=String(Bo);for(var Go=65;Go<=90;Go++)zo[Go]=String.fromCharCode(Go);for(var Uo=1;Uo<=12;Uo++)zo[Uo+111]=zo[Uo+63235]="F"+Uo;var Vo={};function Ko(e){var t,r,n,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var l=0;l<o.length-1;l++){var s=o[l];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function jo(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=$(r.split(" "),Ko),o=0;o<i.length;o++){var l=void 0,s=void 0;o==i.length-1?(s=i.join(" "),l=n):(s=i.slice(0,o+1).join(" "),l="...");var a=t[s];if(a){if(a!=l)throw new Error("Inconsistent bindings for "+s)}else t[s]=l}delete e[r]}for(var u in t)e[u]=t[u];return e}function Xo(e,t,r,n){var i=(t=qo(t)).call?t.call(e,n):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Xo(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var l=Xo(e,t.fallthrough[o],r,n);if(l)return l}}}function Yo(e){var t="string"==typeof e?e:zo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function _o(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&"Mod"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function $o(e,t){if(h&&34==e.keyCode&&e.char)return!1;var r=zo[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),_o(r,e,t))}function qo(e){return"string"==typeof e?Vo[e]:e}function Zo(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&tt(o.from,_(n).to)<=0;){var l=n.pop();if(tt(l.from,o.from)<0){o.from=l.from;break}}n.push(o)}Jn(e,(function(){for(var t=n.length-1;t>=0;t--)go(e.doc,"",n[t].from,n[t].to,"+delete");Dn(e)}))}function Qo(e,t,r){var n=ie(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Jo(e,t,r){var n=Qo(e,t.ch,r);return null==n?null:new et(t.line,n,r<0?"after":"before")}function el(e,t,r,n,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=ue(r,t.doc.direction);if(o){var l,s=i<0?_(o):o[0],a=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=Dr(t,r);l=i<0?r.text.length-1:0;var c=Wr(t,u,l).top;l=oe((function(e){return Wr(t,u,e).top==c}),i<0==(1==s.level)?s.from:s.to-1,l),"before"==a&&(l=Qo(r,l,1))}else l=i<0?s.to:s.from;return new et(n,l,a)}}return new et(n,i<0?r.text.length:0,i<0?"before":"after")}Vo.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"},Vo.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"},Vo.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","Ctrl-O":"openLine"},Vo.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"]},Vo.default=y?Vo.macDefault:Vo.pcDefault;var tl={selectAll:so,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),U)},killLine:function(e){return Zo(e,(function(t){if(t.empty()){var r=Xe(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,r)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Zo(e,(function(t){return{from:et(t.from().line,0),to:st(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Zo(e,(function(e){return{from:et(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Zo(e,(function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Zo(e,(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return rl(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return nl(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var r=Xe(e.doc,t),n=function(e){for(var t;t=Pt(e);)e=t.find(1,!0).line;return e}(r);n!=r&&(t=qe(n));return el(!0,e,r,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")}),K)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")}),K)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?nl(e,t.head):n}),K)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),l=R(e.getLine(o.line),o.ch,n);t.push(Y(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Jn(e,(function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=Xe(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new et(i.line,i.ch-1)),i.ch>0)i=new et(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),et(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=Xe(e.doc,i.line-1).text;l&&(i=new et(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),et(i.line-1,l.length-1),i,"+transpose"))}r.push(new Si(i,i))}e.setSelections(r)}))},newlineAndIndent:function(e){return Jn(e,(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Dn(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function rl(e,t){var r=Xe(e.doc,t),n=Rt(r);return n!=r&&(t=qe(n)),el(!0,e,n,t,1)}function nl(e,t){var r=rl(e,t.line),n=Xe(e.doc,r.line),i=ue(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(r.ch,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return et(r.line,l?0:o,r.sticky)}return r}function il(e,t,r){if("string"==typeof t&&!(t=tl[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=G}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}var ol=new z;function ll(e,t,r,n){var i=e.state.keySeq;if(i){if(Yo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ol.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),sl(e,i+" "+t,r,n))return!0}return sl(e,t,r,n)}function sl(e,t,r,n){var i=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Xo(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Xo(t,e.options.extraKeys,r,e)||Xo(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&sr(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(be(r),xn(e)),!!i}function al(e,t){var r=$o(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?ll(e,"Shift-"+r,t,(function(t){return il(e,t,!0)}))||ll(e,r,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return il(e,t)})):ll(e,r,t,(function(t){return il(e,t)})))}var ul=null;function cl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=W(),ge(t,e)))){l&&s<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var i=al(t,e);h&&(ul=i?n:null,!i&&88==n&&!He&&(y?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),r&&!y&&!i&&46==n&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(T(t,"CodeMirror-crosshair"),de(document,"keyup",r),de(document,"mouseover",r))}H(t,"CodeMirror-crosshair"),he(document,"keyup",r),he(document,"mouseover",r)}(t)}}function hl(e){16==e.keyCode&&(this.doc.sel.shift=!1),ge(this,e)}function fl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||xr(t.display,e)||ge(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(h&&r==ul)return ul=null,void be(e);if(!h||e.which&&!(e.which<10)||!al(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(function(e,t,r){return ll(e,"'"+r+"'",t,(function(t){return il(e,t,!0)}))}(t,e,i)||t.display.input.onKeyPress(e))}}}var dl,pl,gl=function(e,t,r){this.time=e,this.pos=t,this.button=r};function vl(e){var t=this,r=t.display;if(!(ge(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,xr(r,e))a||(r.scroller.draggable=!1,setTimeout((function(){return r.scroller.draggable=!0}),100));else if(!bl(t,e)){var n=un(t,e),i=Le(e),o=n?function(e,t){var r=+new Date;return pl&&pl.compare(r,e,t)?(dl=pl=null,"triple"):dl&&dl.compare(r,e,t)?(pl=new gl(r,e,t),dl=null,"double"):(dl=new gl(r,e,t),pl=null,"single")}(n,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),n&&function(e,t,r,n,i){var o="Click";"double"==n?o="Double"+o:"triple"==n&&(o="Triple"+o);return ll(e,_o(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=tl[t]),!t)return!1;var n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n=t(e,r)!=G}finally{e.state.suppressEdits=!1}return n}))}(t,i,n,o,e)||(1==i?n?function(e,t,r,n){l?setTimeout(E(Cn,e),0):e.curOp.focus=W();var i,o=function(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=b?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey);null==i.addNew&&(i.addNew=y?r.metaKey:r.ctrlKey);null==i.moveOnDrag&&(i.moveOnDrag=!(y?r.altKey:r.ctrlKey));return i}(e,r,n),u=e.doc.sel;e.options.dragDrop&&Me&&!e.isReadOnly()&&"single"==r&&(i=u.contains(t))>-1&&(tt((i=u.ranges[i]).from(),t)<0||t.xRel>0)&&(tt(i.to(),t)>0||t.xRel<0)?function(e,t,r,n){var i=e.display,o=!1,u=ei(e,(function(t){a&&(i.scroller.draggable=!1),e.state.draggingText=!1,de(i.wrapper.ownerDocument,"mouseup",u),de(i.wrapper.ownerDocument,"mousemove",c),de(i.scroller,"dragstart",h),de(i.scroller,"drop",u),o||(be(t),n.addNew||_i(e.doc,r,null,null,n.extend),a&&!f||l&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},h=function(){return o=!0};a&&(i.scroller.draggable=!0);e.state.draggingText=u,u.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop();he(i.wrapper.ownerDocument,"mouseup",u),he(i.wrapper.ownerDocument,"mousemove",c),he(i.scroller,"dragstart",h),he(i.scroller,"drop",u),Sn(e),setTimeout((function(){return i.input.focus()}),20)}(e,n,t,o):function(e,t,r,n){var i=e.display,o=e.doc;be(t);var l,s,a=o.sel,u=a.ranges;n.addNew&&!n.extend?(s=o.sel.contains(r),l=s>-1?u[s]:new Si(r,r)):(l=o.sel.primary(),s=o.sel.primIndex);if("rectangle"==n.unit)n.addNew||(l=new Si(r,r)),r=un(e,t,!0,!0),s=-1;else{var c=ml(e,r,n.unit);l=n.extend?Yi(l,c.anchor,c.head,n.extend):c}n.addNew?-1==s?(s=u.length,Ji(o,Li(e,u.concat([l]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&"char"==n.unit&&!n.extend?(Ji(o,Li(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),a=o.sel):qi(o,s,l,V):(s=0,Ji(o,new Ci([l],0),V),a=o.sel);var h=r;function f(t){if(0!=tt(h,t))if(h=t,"rectangle"==n.unit){for(var i=[],u=e.options.tabSize,c=R(Xe(o,r.line).text,r.ch,u),f=R(Xe(o,t.line).text,t.ch,u),d=Math.min(c,f),p=Math.max(c,f),g=Math.min(r.line,t.line),v=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=v;g++){var m=Xe(o,g).text,y=j(m,d,u);d==p?i.push(new Si(et(g,y),et(g,y))):m.length>y&&i.push(new Si(et(g,y),et(g,j(m,p,u))))}i.length||i.push(new Si(r,r)),Ji(o,Li(e,a.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=l,x=ml(e,t,n.unit),C=w.anchor;tt(x.anchor,C)>0?(b=x.head,C=ot(w.from(),x.anchor)):(b=x.anchor,C=it(w.to(),x.head));var S=a.ranges.slice(0);S[s]=function(e,t){var r=t.anchor,n=t.head,i=Xe(e.doc,r.line);if(0==tt(r,n)&&r.sticky==n.sticky)return t;var o=ue(i);if(!o)return t;var l=se(o,r.ch,r.sticky),s=o[l];if(s.from!=r.ch&&s.to!=r.ch)return t;var a,u=l+(s.from==r.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return t;if(n.line!=r.line)a=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=se(o,n.ch,n.sticky),h=c-l||(n.ch-r.ch)*(1==s.level?-1:1);a=c==u-1||c==u?h<0:h>0}var f=o[u+(a?-1:0)],d=a==(1==f.level),p=d?f.from:f.to,g=d?"after":"before";return r.ch==p&&r.sticky==g?t:new Si(new et(r.line,p,g),n)}(e,new Si(st(o,C),b)),Ji(o,Li(e,S,s),V)}}var d=i.wrapper.getBoundingClientRect(),p=0;function g(t){e.state.selectingText=!1,p=1/0,t&&(be(t),i.input.focus()),de(i.wrapper.ownerDocument,"mousemove",v),de(i.wrapper.ownerDocument,"mouseup",m),o.history.lastSelOrigin=null}var v=ei(e,(function(t){0!==t.buttons&&Le(t)?function t(r){var l=++p,s=un(e,r,!0,"rectangle"==n.unit);if(s)if(0!=tt(s,h)){e.curOp.focus=W(),f(s);var a=Nn(i,o);(s.line>=a.to||s.line<a.from)&&setTimeout(ei(e,(function(){p==l&&t(r)})),150)}else{var u=r.clientY<d.top?-20:r.clientY>d.bottom?20:0;u&&setTimeout(ei(e,(function(){p==l&&(i.scroller.scrollTop+=u,t(r))})),50)}}(t):g(t)})),m=ei(e,g);e.state.selectingText=m,he(i.wrapper.ownerDocument,"mousemove",v),he(i.wrapper.ownerDocument,"mouseup",m)}(e,n,t,o)}(t,n,o,e):Se(e)==r.scroller&&be(e):2==i?(n&&_i(t.doc,n),setTimeout((function(){return r.input.focus()}),20)):3==i&&(S?t.display.input.onContextMenu(e):Sn(t)))}}function ml(e,t,r){if("char"==r)return new Si(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new Si(et(t.line,0),st(e.doc,et(t.line+1,0)));var n=r(e,t);return new Si(n.from,n.to)}function yl(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&be(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!me(e,r))return xe(t);o-=s.top-l.viewOffset;for(var a=0;a<e.display.gutterSpecs.length;++a){var u=l.gutters.childNodes[a];if(u&&u.getBoundingClientRect().right>=i)return pe(e,r,e,Ze(e.doc,o),e.display.gutterSpecs[a].className,t),xe(t)}}function bl(e,t){return yl(e,t,"gutterClick",!0)}function wl(e,t){xr(e.display,t)||function(e,t){if(!me(e,"gutterContextMenu"))return!1;return yl(e,t,"gutterContextMenu",!1)}(e,t)||ge(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function xl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),zr(e)}gl.prototype.compare=function(e,t,r){return this.time+400>e&&0==tt(t,this.pos)&&r==this.button};var Cl={toString:function(){return"CodeMirror.Init"}},Sl={},Ll={};function kl(e,t,r){if(!t!=!(r&&r!=Cl)){var n=e.display.dragFunctions,i=t?he:de;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function Tl(e){e.options.lineWrapping?(H(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),jt(e)),an(e),hn(e),zr(e),setTimeout((function(){return Gn(e)}),100)}function Ml(e,t){var r=this;if(!(this instanceof Ml))return new Ml(e,t);this.options=t=t?I(t):{},I(Sl,t,!1);var n=t.value;"string"==typeof n?n=new Do(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Ml.inputStyles[t.inputStyle](this),o=this.display=new vi(e,n,i,t);for(var u in o.wrapper.CodeMirror=this,xl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Kn(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 z,keySeq:null,specialChars:null},t.autofocus&&!m&&o.input.focus(),l&&s<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),function(e){var t=e.display;he(t.scroller,"mousedown",ei(e,vl)),he(t.scroller,"dblclick",l&&s<11?ei(e,(function(t){if(!ge(e,t)){var r=un(e,t);if(r&&!bl(e,t)&&!xr(e.display,t)){be(t);var n=e.findWordAt(r);_i(e.doc,n.anchor,n.head)}}})):function(t){return ge(e,t)||be(t)});he(t.scroller,"contextmenu",(function(t){return wl(e,t)})),he(t.input.getField(),"contextmenu",(function(r){t.scroller.contains(r.target)||wl(e,r)}));var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout((function(){return t.activeTouch=null}),1e3),(n=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}he(t.scroller,"touchstart",(function(i){if(!ge(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!bl(e,i)){t.input.ensurePolled(),clearTimeout(r);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),he(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),he(t.scroller,"touchend",(function(r){var n=t.activeTouch;if(n&&!xr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var l,s=e.coordsChar(t.activeTouch,"page");l=!n.prev||o(n,n.prev)?new Si(s,s):!n.prev.prev||o(n,n.prev.prev)?e.findWordAt(s):new Si(et(s.line,0),st(e.doc,et(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),be(r)}i()})),he(t.scroller,"touchcancel",i),he(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Pn(e,t.scroller.scrollTop),In(e,t.scroller.scrollLeft,!0),pe(e,"scroll",e))})),he(t.scroller,"mousewheel",(function(t){return xi(e,t)})),he(t.scroller,"DOMMouseScroll",(function(t){return xi(e,t)})),he(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ge(e,t)||Ce(t)},over:function(t){ge(e,t)||(!function(e,t){var r=un(e,t);if(r){var n=document.createDocumentFragment();yn(e,r,n),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),N(e.display.dragCursor,n)}}(e,t),Ce(t))},start:function(t){return function(e,t){if(l&&(!e.state.draggingText||+new Date-Wo<100))Ce(t);else if(!ge(e,t)&&!xr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var r=A("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),h&&r.parentNode.removeChild(r)}}(e,t)},drop:ei(e,Ho),leave:function(t){ge(e,t)||Fo(e)}};var a=t.input.getField();he(a,"keyup",(function(t){return hl.call(e,t)})),he(a,"keydown",ei(e,cl)),he(a,"keypress",ei(e,fl)),he(a,"focus",(function(t){return Ln(e,t)})),he(a,"blur",(function(t){return kn(e,t)}))}(this),Io(),Xn(this),this.curOp.forceUpdate=!0,Pi(this,n),t.autofocus&&!m||this.hasFocus()?setTimeout((function(){r.hasFocus()&&!r.state.focused&&Ln(r)}),20):kn(this),Ll)Ll.hasOwnProperty(u)&&Ll[u](this,t[u],Cl);fi(this),t.finishInit&&t.finishInit(this);for(var c=0;c<Nl.length;++c)Nl[c](this);Yn(this),a&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Ml.defaults=Sl,Ml.optionHandlers=Ll;var Nl=[];function Al(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=dt(e,t).state:r="prev");var l=e.options.tabSize,s=Xe(o,t),a=R(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==G||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?R(Xe(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var h="",f=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)f+=l,h+="\t";if(f<u&&(h+=Y(u-f)),h!=c)return go(o,h,et(t,0),et(t,c.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var g=o.sel.ranges[p];if(g.head.line==t&&g.head.ch<c.length){var v=et(t,c.length);qi(o,p,new Si(v,v));break}}}Ml.defineInitHook=function(e){return Nl.push(e)};var Ol=null;function Dl(e){Ol=e}function Wl(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var l=+new Date-200,s="paste"==i||e.state.pasteIncoming>l,a=De(t),u=null;if(s&&n.ranges.length>1)if(Ol&&Ol.text.join("\n")==t){if(n.ranges.length%Ol.text.length==0){u=[];for(var c=0;c<Ol.text.length;c++)u.push(o.splitLines(Ol.text[c]))}}else a.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(u=$(a,(function(e){return[e]})));for(var h=e.curOp.updateInput,f=n.ranges.length-1;f>=0;f--){var d=n.ranges[f],p=d.from(),g=d.to();d.empty()&&(r&&r>0?p=et(p.line,p.ch-r):e.state.overwrite&&!s?g=et(g.line,Math.min(Xe(o,g.line).text.length,g.ch+_(a).length)):s&&Ol&&Ol.lineWise&&Ol.text.join("\n")==a.join("\n")&&(p=g=et(p.line,0)));var v={from:p,to:g,text:u?u[f%u.length]:a,origin:i||(s?"paste":e.state.cutIncoming>l?"cut":"+input")};uo(e.doc,v),sr(e,"inputRead",e,v)}t&&!s&&Fl(e,t),Dn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Hl(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Jn(t,(function(){return Wl(t,r,0,null,"paste")})),!0}function Fl(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){l=Al(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xe(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Al(e,i.head.line,"smart"));l&&sr(e,"electricInput",e,i.head.line)}}}function Pl(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:et(i,0),head:et(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function El(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Il(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return a?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),El(e),t}function Rl(e,t,r,n,i){var o=t,l=r,s=Xe(e,t.line),a=i&&"rtl"==e.direction?-r:r;function u(o){var l,u;if("codepoint"==n){var c=s.text.charCodeAt(t.ch+(n>0?0:-1));l=isNaN(c)?null:new et(t.line,Math.max(0,Math.min(s.text.length,t.ch+r*(c>=55296&&c<56320?2:1))),-r)}else l=i?function(e,t,r,n){var i=ue(t,e.doc.direction);if(!i)return Jo(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=se(i,r.ch,r.sticky),l=i[o];if("ltr"==e.doc.direction&&l.level%2==0&&(n>0?l.to>r.ch:l.from<r.ch))return Jo(t,r,n);var s,a=function(e,r){return Qo(t,e instanceof et?e.ch:e,r)},u=function(r){return e.options.lineWrapping?(s=s||Dr(e,t),Zr(e,t,s,r)):{begin:0,end:t.text.length}},c=u("before"==r.sticky?a(r,-1):r.ch);if("rtl"==e.doc.direction||1==l.level){var h=1==l.level==n<0,f=a(r,h?1:-1);if(null!=f&&(h?f<=l.to&&f<=c.end:f>=l.from&&f>=c.begin)){var d=h?"before":"after";return new et(r.line,f,d)}}var p=function(e,t,n){for(var o=function(e,t){return t?new et(r.line,a(e,1),"before"):new et(r.line,e,"after")};e>=0&&e<i.length;e+=t){var l=i[e],s=t>0==(1!=l.level),u=s?n.begin:a(n.end,-1);if(l.from<=u&&u<l.to)return o(u,s);if(u=s?l.from:a(l.to,-1),n.begin<=u&&u<n.end)return o(u,s)}},g=p(o+n,n,c);if(g)return g;var v=n>0?c.end:a(c.begin,-1);return null==v||n>0&&v==t.text.length||!(g=p(n>0?0:i.length-1,n,u(v)))?null:g}(e.cm,s,t,r):Jo(s,t,r);if(null==l){if(o||(u=t.line+a)<e.first||u>=e.first+e.size||(t=new et(u,t.ch,t.sticky),!(s=Xe(e,u))))return!1;t=el(i,e.cm,s,t.line,a)}else t=l;return!0}if("char"==n||"codepoint"==n)u();else if("column"==n)u(!0);else if("word"==n||"group"==n)for(var c=null,h="group"==n,f=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(r<0)||u(!d);d=!1){var p=s.text.charAt(t.ch)||"\n",g=ee(p,f)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||d||g||(g="s"),c&&c!=g){r<0&&(r=1,u(),t.sticky="after");break}if(g&&(c=g),r>0&&!u(!d))break}var v=oo(e,t,o,l,!0);return rt(o,v)&&(v.hitSide=!0),v}function zl(e,t,r,n){var i,o,l=e.doc,s=t.left;if("page"==n){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(a-.5*rn(e.display),3);i=(r>0?t.bottom:t.top)+r*u}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;(o=$r(e,s,i)).outside;){if(r<0?i<=0:i>=l.height){o.hitSide=!0;break}i+=5*r}return o}var Bl=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Gl(e,t){var r=Or(e,t.line);if(!r||r.hidden)return null;var n=Xe(e.doc,t.line),i=Nr(r,n,t.line),o=ue(n,e.doc.direction),l="left";o&&(l=se(o,t.ch)%2?"right":"left");var s=Pr(i.map,t.ch,l);return s.offset="right"==s.collapse?s.end:s.start,s}function Ul(e,t){return t&&(e.bad=!0),e}function Vl(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Ul(e.clipPos(et(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return Kl(o,t,r)}}function Kl(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!D(n,t))return Ul(et(qe(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var o=e.rest?_(e.rest):e.line;return Ul(et(qe(o),o.text.length),i)}var l=3==t.nodeType?t:null,s=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,r&&(r=l.nodeValue.length));s.parentNode!=n;)s=s.parentNode;var a=e.measure,u=a.maps;function c(t,r,n){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?a.map:u[i],l=0;l<o.length;l+=3){var s=o[l+2];if(s==t||s==r){var c=qe(i<0?e.line:e.rest[i]),h=o[l]+n;return(n<0||s!=t)&&(h=o[l+(n?1:0)]),et(c,h)}}}var h=c(l,s,r);if(h)return Ul(h,i);for(var f=s.nextSibling,d=l?l.nodeValue.length-r:0;f;f=f.nextSibling){if(h=c(f,f.firstChild,0))return Ul(et(h.line,h.ch-d),i);d+=f.textContent.length}for(var p=s.previousSibling,g=r;p;p=p.previousSibling){if(h=c(p,p.firstChild,-1))return Ul(et(h.line,h.ch+g),i);g+=p.textContent.length}}Bl.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function l(e){if(o(e)&&!ge(n,e)){if(n.somethingSelected())Dl({lineWise:!1,text:n.getSelections()}),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=Pl(n);Dl({lineWise:!0,text:t.text}),"cut"==e.type&&n.operation((function(){n.setSelections(t.ranges,0,U),n.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var l=Ol.text.join("\n");if(e.clipboardData.setData("Text",l),e.clipboardData.getData("Text")==l)return void e.preventDefault()}var s=Il(),a=s.firstChild;n.display.lineSpace.insertBefore(s,n.display.lineSpace.firstChild),a.value=Ol.text.join("\n");var u=document.activeElement;P(a),setTimeout((function(){n.display.lineSpace.removeChild(s),u.focus(),u==i&&r.showPrimarySelection()}),50)}}El(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize),he(i,"paste",(function(e){!o(e)||ge(n,e)||Hl(e,n)||s<=11&&setTimeout(ei(n,(function(){return t.updateFromDOM()})),20)})),he(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),he(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),he(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),he(i,"touchstart",(function(){return r.forceCompositionEnd()})),he(i,"input",(function(){t.composing||t.readFromDOMSoon()})),he(i,"copy",l),he(i,"cut",l)},Bl.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Bl.prototype.prepareSelection=function(){var e=mn(this.cm,!1);return e.focus=document.activeElement==this.div,e},Bl.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Bl.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Bl.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),i=n.from(),o=n.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var l=Vl(t,e.anchorNode,e.anchorOffset),s=Vl(t,e.focusNode,e.focusOffset);if(!l||l.bad||!s||s.bad||0!=tt(ot(l,s),i)||0!=tt(it(l,s),o)){var a=t.display.view,u=i.line>=t.display.viewFrom&&Gl(t,i)||{node:a[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&Gl(t,o);if(!c){var h=a[a.length-1].measure,f=h.maps?h.maps[h.maps.length-1]:h.map;c={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(u&&c){var d,p=e.rangeCount&&e.getRangeAt(0);try{d=k(u.node,u.offset,c.offset,c.node)}catch(e){}d&&(!r&&t.state.focused?(e.collapse(u.node,u.offset),d.collapsed||(e.removeAllRanges(),e.addRange(d))):(e.removeAllRanges(),e.addRange(d)),p&&null==e.anchorNode?e.addRange(p):r&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Bl.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Bl.prototype.showMultipleSelections=function(e){N(this.cm.display.cursorDiv,e.cursors),N(this.cm.display.selectionDiv,e.selection)},Bl.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Bl.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return D(this.div,t)},Bl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Bl.prototype.blur=function(){this.div.blur()},Bl.prototype.getField=function(){return this.div},Bl.prototype.supportsTouch=function(){return!0},Bl.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Jn(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},Bl.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Bl.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&c&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=Vl(t,e.anchorNode,e.anchorOffset),n=Vl(t,e.focusNode,e.focusOffset);r&&n&&Jn(t,(function(){Ji(t.doc,ki(r,n),U),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)}))}}},Bl.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n=this.cm,i=n.display,o=n.doc.sel.primary(),l=o.from(),s=o.to();if(0==l.ch&&l.line>n.firstLine()&&(l=et(l.line-1,Xe(n.doc,l.line-1).length)),s.ch==Xe(n.doc,s.line).text.length&&s.line<n.lastLine()&&(s=et(s.line+1,0)),l.line<i.viewFrom||s.line>i.viewTo-1)return!1;l.line==i.viewFrom||0==(e=cn(n,l.line))?(t=qe(i.view[0].line),r=i.view[0].node):(t=qe(i.view[e].line),r=i.view[e-1].node.nextSibling);var a,u,c=cn(n,s.line);if(c==i.view.length-1?(a=i.viewTo-1,u=i.lineDiv.lastChild):(a=qe(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!r)return!1;for(var h=n.doc.splitLines(function(e,t,r,n,i){var o="",l=!1,s=e.doc.lineSeparator(),a=!1;function u(){l&&(o+=s,a&&(o+=s),l=a=!1)}function c(e){e&&(u(),o+=e)}function h(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void c(r);var o,f=t.getAttribute("cm-marker");if(f){var d=e.findMarks(et(n,0),et(i+1,0),(v=+f,function(e){return e.id==v}));return void(d.length&&(o=d[0].find(0))&&c(Ye(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&u();for(var g=0;g<t.childNodes.length;g++)h(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(a=!0),p&&(l=!0)}else 3==t.nodeType&&c(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var v}for(;h(t),t!=r;)t=t.nextSibling,a=!1;return o}(n,r,u,t,a)),f=Ye(n.doc,et(t,0),et(a,Xe(n.doc,a).text.length));h.length>1&&f.length>1;)if(_(h)==_(f))h.pop(),f.pop(),a--;else{if(h[0]!=f[0])break;h.shift(),f.shift(),t++}for(var d=0,p=0,g=h[0],v=f[0],m=Math.min(g.length,v.length);d<m&&g.charCodeAt(d)==v.charCodeAt(d);)++d;for(var y=_(h),b=_(f),w=Math.min(y.length-(1==h.length?d:0),b.length-(1==f.length?d:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==h.length&&1==f.length&&t==l.line)for(;d&&d>l.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)d--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(d).replace(/\u200b+$/,"");var x=et(t,d),C=et(a,f.length?_(f).length-p:0);return h.length>1||h[0]||tt(x,C)?(go(n.doc,h,x,C,"+input"),!0):void 0},Bl.prototype.ensurePolled=function(){this.forceCompositionEnd()},Bl.prototype.reset=function(){this.forceCompositionEnd()},Bl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Bl.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Bl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Jn(this.cm,(function(){return hn(e.cm)}))},Bl.prototype.setUneditable=function(e){e.contentEditable="false"},Bl.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ei(this.cm,Wl)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Bl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Bl.prototype.onContextMenu=function(){},Bl.prototype.resetPosition=function(){},Bl.prototype.needsContentAttribute=!0;var jl=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};jl.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ge(n,e)){if(n.somethingSelected())Dl({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Pl(n);Dl({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,U):(r.prevInput="",i.value=t.text.join("\n"),P(i))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),he(i,"input",(function(){l&&s>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()})),he(i,"paste",(function(e){ge(n,e)||Hl(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())})),he(i,"cut",o),he(i,"copy",o),he(e.scroller,"paste",(function(t){if(!xr(e,t)&&!ge(n,t)){if(!i.dispatchEvent)return n.state.pasteIncoming=+new Date,void r.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),he(e.lineSpace,"selectstart",(function(t){xr(e,t)||be(t)})),he(i,"compositionstart",(function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}})),he(i,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},jl.prototype.createField=function(e){this.wrapper=Il(),this.textarea=this.wrapper.firstChild},jl.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},jl.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=mn(e);if(e.options.moveInputWithCursor){var i=Xr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},jl.prototype.showSelection=function(e){var t=this.cm.display;N(t.cursorDiv,e.cursors),N(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},jl.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&P(this.textarea),l&&s>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",l&&s>=9&&(this.hasSelection=null))}},jl.prototype.getField=function(){return this.textarea},jl.prototype.supportsTouch=function(){return!1},jl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||W()!=this.textarea))try{this.textarea.focus()}catch(e){}},jl.prototype.blur=function(){this.textarea.blur()},jl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},jl.prototype.receivedFocus=function(){this.slowPoll()},jl.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},jl.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}))},jl.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||We(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(l&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,u=Math.min(n.length,i.length);a<u&&n.charCodeAt(a)==i.charCodeAt(a);)++a;return Jn(t,(function(){Wl(t,i.slice(a),n.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},jl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},jl.prototype.onKeyPress=function(){l&&s>=9&&(this.hasSelection=null),this.fastPoll()},jl.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=un(r,e),u=n.scroller.scrollTop;if(o&&!h){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(o)&&ei(r,Ji)(r.doc,ki(o),U);var c,f=i.style.cssText,d=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",a&&(c=window.scrollY),n.input.focus(),a&&window.scrollTo(null,c),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=m,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),l&&s>=9&&v(),S){Ce(e);var g=function(){de(window,"mouseup",g),setTimeout(m,20)};he(window,"mouseup",g)}else setTimeout(m,50)}function v(){if(null!=i.selectionStart){var e=r.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=r.doc.sel}}function m(){if(t.contextMenuPending==m&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=f,l&&s<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=u),null!=i.selectionStart)){(!l||l&&s<9)&&v();var e=0,o=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?ei(r,so)(r):e++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(o,200)}}},jl.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},jl.prototype.setUneditable=function(){},jl.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function r(r,n,i,o){e.defaults[r]=n,i&&(t[r]=o?function(e,t,r){r!=Cl&&i(e,t,r)}:i)}e.defineOption=r,e.Init=Cl,r("value","",(function(e,t){return e.setValue(t)}),!0),r("mode",null,(function(e,t){e.doc.modeOption=t,Oi(e)}),!0),r("indentUnit",2,Oi,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(e){Di(e),zr(e),hn(e)}),!0),r("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var r=[],n=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,r.push(et(n,o))}n++}));for(var i=r.length-1;i>=0;i--)go(e.doc,t,r[i],et(r[i].line,r[i].ch+t.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Cl&&e.refresh()})),r("specialCharPlaceholder",Qt,(function(e){return e.refresh()}),!0),r("electricChars",!0),r("inputStyle",m?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),r("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),r("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),r("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),r("rtlMoveVisually",!w),r("wholeLineUpdateBefore",!0),r("theme","default",(function(e){xl(e),gi(e)}),!0),r("keyMap","default",(function(e,t,r){var n=qo(t),i=r!=Cl&&qo(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Tl,!0),r("gutters",[],(function(e,t){e.display.gutterSpecs=di(t,e.options.lineNumbers),gi(e)}),!0),r("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?ln(e.display)+"px":"0",e.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(e){return Gn(e)}),!0),r("scrollbarStyle","native",(function(e){Kn(e),Gn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),r("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=di(e.options.gutters,t),gi(e)}),!0),r("firstLineNumber",1,gi,!0),r("lineNumberFormatter",(function(e){return e}),gi,!0),r("showCursorWhenSelecting",!1,vn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(function(e,t){"nocursor"==t&&(kn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),r("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),r("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),r("dragDrop",!0,kl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,vn,!0),r("singleCursorHeightPerLine",!0,vn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Di,!0),r("addModeClass",!1,Di,!0),r("pollInterval",100),r("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),r("historyEventDelay",1250),r("viewportMargin",10,(function(e){return e.refresh()}),!0),r("maxHighlightLength",1e4,Di,!0),r("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),r("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),r("autofocus",null),r("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),r("phrases",null)}(Ml),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&ei(this,t[e])(this,r,i),pe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](qo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:ti((function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");!function(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},(function(e){return e.priority})),this.state.modeGen++,hn(this)})),removeOverlay:ti((function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void hn(this)}})),indentLine:ti((function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Qe(this.doc,e)&&Al(this,e,t,r)})),indentSelection:ti((function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>r&&(Al(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&Dn(this));else{var o=i.from(),l=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var a=s;a<r;++a)Al(this,a,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&qi(this.doc,n,new Si(o,u[n].to()),U)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=st(this.doc,e);var t,r=ft(this,Xe(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]<o)){t=r[2*l+2];break}n=l+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!r.hasOwnProperty(t))return n;var i=r[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&n.push(i[o[t]]);else if(o[t])for(var l=0;l<o[t].length;l++){var s=i[o[t][l]];s&&n.push(s)}else o.helperType&&i[o.helperType]?n.push(i[o.helperType]):i[o.name]&&n.push(i[o.name]);for(var a=0;a<i._global.length;a++){var u=i._global[a];u.pred(o,this)&&-1==B(n,u.val)&&n.push(u.val)}return n},getStateAfter:function(e,t){var r=this.doc;return dt(this,(e=lt(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Xr(this,null==e?r.head:"object"==typeof e?st(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return jr(this,st(this.doc,e),t||"page")},coordsChar:function(e,t){return $r(this,(e=Kr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Kr(this,{top:e,left:0},t||"page").top,Ze(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),n=Xe(this.doc,e)}else n=e;return Vr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-Vt(n):0)},defaultTextHeight:function(){return rn(this.display)},defaultCharWidth:function(){return nn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,l,s,a=this.display,u=(e=Xr(this,st(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),a.sizer.appendChild(t),"over"==n)u=e.top;else if("above"==n||"near"==n){var h=Math.max(a.wrapper.clientHeight,this.doc.height),f=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>h)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=h&&(u=e.bottom),c+t.offsetWidth>f&&(c=f-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==i?(c=a.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),r&&(o=this,l={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(s=An(o,l)).scrollTop&&Pn(o,s.scrollTop),null!=s.scrollLeft&&In(o,s.scrollLeft))},triggerOnKeyDown:ti(cl),triggerOnKeyPress:ti(fl),triggerOnKeyUp:hl,triggerOnMouseDown:ti(vl),execCommand:function(e){if(tl.hasOwnProperty(e))return tl[e].call(null,this)},triggerElectric:ti((function(e){Fl(this,e)})),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=st(this.doc,e),l=0;l<t&&!(o=Rl(this.doc,o,i,r,n)).hitSide;++l);return o},moveH:ti((function(e,t){var r=this;this.extendSelectionsBy((function(n){return r.display.shift||r.doc.extend||n.empty()?Rl(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()}),K)})),deleteH:ti((function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Zo(this,(function(r){var i=Rl(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}}))})),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var l=st(this.doc,e),s=0;s<t;++s){var a=Xr(this,l,"div");if(null==o?o=a.left:a.left=o,(l=zl(this,a,i,r)).hitSide)break}return l},moveV:ti((function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy((function(l){if(o)return e<0?l.from():l.to();var s=Xr(r,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=zl(r,s,e,t);return"page"==t&&l==n.sel.primary()&&On(r,jr(r,a,"div").top-s.top),a}),K),i.length)for(var l=0;l<n.sel.ranges.length;l++)n.sel.ranges[l].goalColumn=i[l]})),findWordAt:function(e){var t=Xe(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&n!=t.length||!r?++n:--r;for(var o=t.charAt(r),l=ee(o,i)?function(e){return ee(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};r>0&&l(t.charAt(r-1));)--r;for(;n<t.length&&l(t.charAt(n));)++n}return new Si(et(e.line,r),et(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?H(this.display.cursorDiv,"CodeMirror-overwrite"):T(this.display.cursorDiv,"CodeMirror-overwrite"),pe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==W()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ti((function(e,t){Wn(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-kr(this)-this.display.barHeight,width:e.scrollWidth-kr(this)-this.display.barWidth,clientHeight:Mr(this),clientWidth:Tr(this)}},scrollIntoView:ti((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:et(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?function(e,t){Hn(e),e.curOp.scrollToPos=t}(this,e):Fn(this,e.from,e.to,e.margin)})),setSize:ti((function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&Rr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){fn(r,i,"widget");break}++i})),this.curOp.forceUpdate=!0,pe(this,"refresh",this)})),operation:function(e){return Jn(this,e)},startOperation:function(){return Xn(this)},endOperation:function(){return Yn(this)},refresh:ti((function(){var e=this.display.cachedTextHeight;hn(this),this.curOp.forceUpdate=!0,zr(this),Wn(this,this.doc.scrollLeft,this.doc.scrollTop),ui(this.display),(null==e||Math.abs(e-rn(this.display))>.5||this.options.lineWrapping)&&an(this),pe(this,"refresh",this)})),swapDoc:ti((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Pi(this,e),zr(this),this.display.input.reset(),Wn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sr(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},ye(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}(Ml);var Xl="iter insert remove copy getEditor constructor".split(" ");for(var Yl in Do.prototype)Do.prototype.hasOwnProperty(Yl)&&B(Xl,Yl)<0&&(Ml.prototype[Yl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Do.prototype[Yl]));return ye(Do),Ml.inputStyles={textarea:jl,contenteditable:Bl},Ml.defineMode=function(e){Ml.defaults.mode||"null"==e||(Ml.defaults.mode=e),Ie.apply(this,arguments)},Ml.defineMIME=function(e,t){Ee[e]=t},Ml.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ml.defineMIME("text/plain","null"),Ml.defineExtension=function(e,t){Ml.prototype[e]=t},Ml.defineDocExtension=function(e,t){Do.prototype[e]=t},Ml.fromTextArea=function(e,t){if((t=t?I(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=W();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=s.getValue()}var i;if(e.form&&(he(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=l}}catch(e){}}t.finishInit=function(r){r.save=n,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,n(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(de(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Ml((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=de,e.on=he,e.wheelEventPixels=wi,e.Doc=Do,e.splitLines=De,e.countColumn=R,e.findColumn=j,e.isWordChar=J,e.Pass=G,e.signal=pe,e.Line=Xt,e.changeEnd=Ti,e.scrollbarModel=Vn,e.Pos=et,e.cmpPos=tt,e.modes=Pe,e.mimeModes=Ee,e.resolveMode=Re,e.getMode=ze,e.modeExtensions=Be,e.extendMode=Ge,e.copyState=Ue,e.startState=Ke,e.innerMode=Ve,e.commands=tl,e.keyMap=Vo,e.keyName=$o,e.isModifierKey=Yo,e.lookupKey=Xo,e.normalizeKeyMap=jo,e.StringStream=je,e.SharedTextMarker=Mo,e.TextMarker=ko,e.LineWidget=Co,e.e_preventDefault=be,e.e_stopPropagation=we,e.e_stop=Ce,e.addClass=H,e.contains=D,e.rmClass=T,e.keyNames=zo}(Ml),Ml.version="5.58.1",Ml})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/css/css.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/css/css.js index 6e92ae8d6fa8..39f281535d45 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/css/css.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/css/css.js @@ -1 +1 @@ -!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={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}e.defineMode("css",(function(t,r){var o=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var a,i,n=t.indentUnit,l=r.tokenHooks,s=r.documentTypes||{},c=r.mediaTypes||{},d=r.mediaFeatures||{},p=r.mediaValueKeywords||{},u=r.propertyKeywords||{},m=r.nonStandardPropertyKeywords||{},h=r.fontProperties||{},g=r.counterDescriptors||{},b=r.colorKeywords||{},f=r.valueKeywords||{},y=r.allowNested,w=r.lineComment,k=!0===r.supportsAtComponent;function v(e,t){return a=t,e}function x(e,t){var r=e.next();if(l[r]){var o=l[r](e,t);if(!1!==o)return o}return"@"==r?(e.eatWhile(/[\w\\\-]/),v("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?v(null,"compare"):'"'==r||"'"==r?(t.tokenize=z(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),v("atom","hash")):"!"==r?(e.match(/^\s*\w*/),v("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),v("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?v(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?v("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?v(null,r):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=j),v("variable callee","variable")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),v("property","word")):v(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),v("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?v("variable-2","variable-definition"):v("variable-2","variable")):e.match(/^\w+-/)?v("meta","meta"):void 0}function z(e){return function(t,r){for(var o,a=!1;null!=(o=t.next());){if(o==e&&!a){")"==e&&t.backUp(1);break}a=!a&&"\\"==o}return(o==e||!a&&")"!=e)&&(r.tokenize=null),v("string","string")}}function j(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=z(")"),v(null,"(")}function q(e,t,r){this.type=e,this.indent=t,this.prev=r}function P(e,t,r,o){return e.context=new q(r,t.indentation()+(!1===o?0:n),e.context),r}function K(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function C(e,t,r){return _[r.context.type](e,t,r)}function B(e,t,r,o){for(var a=o||1;a>0;a--)r.context=r.context.prev;return C(e,t,r)}function T(e){var t=e.current().toLowerCase();i=f.hasOwnProperty(t)?"atom":b.hasOwnProperty(t)?"keyword":"variable"}var _={top:function(e,t,r){if("{"==e)return P(r,t,"block");if("}"==e&&r.context.prev)return K(r);if(k&&/@component/i.test(e))return P(r,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return P(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return P(r,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return P(r,t,"at");if("hash"==e)i="builtin";else if("word"==e)i="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return P(r,t,"interpolation");if(":"==e)return"pseudo";if(y&&"("==e)return P(r,t,"parens")}return r.context.type},block:function(e,t,r){if("word"==e){var o=t.current().toLowerCase();return u.hasOwnProperty(o)?(i="property","maybeprop"):m.hasOwnProperty(o)?(i="string-2","maybeprop"):y?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")}return"meta"==e?"block":y||"hash"!=e&&"qualifier"!=e?_.top(e,t,r):(i="error","block")},maybeprop:function(e,t,r){return":"==e?P(r,t,"prop"):C(e,t,r)},prop:function(e,t,r){if(";"==e)return K(r);if("{"==e&&y)return P(r,t,"propBlock");if("}"==e||"{"==e)return B(e,t,r);if("("==e)return P(r,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)T(t);else if("interpolation"==e)return P(r,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,r){return"}"==e?K(r):"word"==e?(i="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?B(e,t,r):")"==e?K(r):"("==e?P(r,t,"parens"):"interpolation"==e?P(r,t,"interpolation"):("word"==e&&T(t),"parens")},pseudo:function(e,t,r){return"meta"==e?"pseudo":"word"==e?(i="variable-3",r.context.type):C(e,t,r)},documentTypes:function(e,t,r){return"word"==e&&s.hasOwnProperty(t.current())?(i="tag",r.context.type):_.atBlock(e,t,r)},atBlock:function(e,t,r){if("("==e)return P(r,t,"atBlock_parens");if("}"==e||";"==e)return B(e,t,r);if("{"==e)return K(r)&&P(r,t,y?"block":"top");if("interpolation"==e)return P(r,t,"interpolation");if("word"==e){var o=t.current().toLowerCase();i="only"==o||"not"==o||"and"==o||"or"==o?"keyword":c.hasOwnProperty(o)?"attribute":d.hasOwnProperty(o)?"property":p.hasOwnProperty(o)?"keyword":u.hasOwnProperty(o)?"property":m.hasOwnProperty(o)?"string-2":f.hasOwnProperty(o)?"atom":b.hasOwnProperty(o)?"keyword":"error"}return r.context.type},atComponentBlock:function(e,t,r){return"}"==e?B(e,t,r):"{"==e?K(r)&&P(r,t,y?"block":"top",!1):("word"==e&&(i="error"),r.context.type)},atBlock_parens:function(e,t,r){return")"==e?K(r):"{"==e||"}"==e?B(e,t,r,2):_.atBlock(e,t,r)},restricted_atBlock_before:function(e,t,r){return"{"==e?P(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(i="variable","restricted_atBlock_before"):C(e,t,r)},restricted_atBlock:function(e,t,r){return"}"==e?(r.stateArg=null,K(r)):"word"==e?(i="@font-face"==r.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!g.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,r){return"word"==e?(i="variable","keyframes"):"{"==e?P(r,t,"top"):C(e,t,r)},at:function(e,t,r){return";"==e?K(r):"{"==e||"}"==e?B(e,t,r):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?K(r):"{"==e||";"==e?B(e,t,r):("word"==e?i="variable":"variable"!=e&&"("!=e&&")"!=e&&(i="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:o?"block":"top",stateArg:null,context:new q(o?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||x)(e,t);return r&&"object"==typeof r&&(a=r[1],r=r[0]),i=r,"comment"!=a&&(t.state=_[t.state](a,e,t)),i},indent:function(e,t){var r=e.context,o=t&&t.charAt(0),a=r.indent;return"prop"!=r.type||"}"!=o&&")"!=o||(r=r.prev),r.prev&&("}"!=o||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=o||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=o||"at"!=r.type&&"atBlock"!=r.type)||(a=Math.max(0,r.indent-n)):a=(r=r.prev).indent),a},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:w,fold:"brace"}}));var r=["domain","regexp","url","url-prefix"],o=t(r),a=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=t(a),n=["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"],l=t(n),s=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],c=t(s),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","caret-color","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-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","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","justify-items","justify-self","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","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","mix-blend-mode","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","place-content","place-items","place-self","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","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","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"],p=t(d),u=["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"],m=t(u),h=t(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),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"],f=t(b),y=["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","auto-flow","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","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","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","grid","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-grid","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","opacity","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","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","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","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","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","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","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"],w=t(y),k=r.concat(a).concat(n).concat(s).concat(d).concat(u).concat(b).concat(y);function v(e,t){for(var r,o=!1;null!=(r=e.next());){if(o&&"/"==r){t.tokenize=null;break}o="*"==r}return["comment","comment"]}e.registerHelper("hintWords","css",k),e.defineMIME("text/css",{documentTypes:o,mediaTypes:i,mediaFeatures:l,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:m,fontProperties:h,counterDescriptors:g,colorKeywords:f,valueKeywords:w,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=v,v(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:l,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:m,colorKeywords:f,valueKeywords:w,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=v,v(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:l,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:m,colorKeywords:f,valueKeywords:w,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=v,v(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/i,!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:o,mediaTypes:i,mediaFeatures:l,propertyKeywords:p,nonStandardPropertyKeywords:m,fontProperties:h,counterDescriptors:g,colorKeywords:f,valueKeywords:w,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=v,v(e,t))}},name:"css",helperType:"gss"})})); \ No newline at end of file +!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={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}e.defineMode("css",(function(t,r){var o=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var i,a,n=t.indentUnit,l=r.tokenHooks,s=r.documentTypes||{},d=r.mediaTypes||{},c=r.mediaFeatures||{},p=r.mediaValueKeywords||{},u=r.propertyKeywords||{},m=r.nonStandardPropertyKeywords||{},b=r.fontProperties||{},g=r.counterDescriptors||{},h=r.colorKeywords||{},f=r.valueKeywords||{},k=r.allowNested,y=r.lineComment,w=!0===r.supportsAtComponent;function v(e,t){return i=t,e}function x(e,t){var r=e.next();if(l[r]){var o=l[r](e,t);if(!1!==o)return o}return"@"==r?(e.eatWhile(/[\w\\\-]/),v("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?v(null,"compare"):'"'==r||"'"==r?(t.tokenize=z(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),v("atom","hash")):"!"==r?(e.match(/^\s*\w*/),v("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),v("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?v(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?v("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?v(null,r):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=j),v("variable callee","variable")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),v("property","word")):v(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),v("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?v("variable-2","variable-definition"):v("variable-2","variable")):e.match(/^\w+-/)?v("meta","meta"):void 0}function z(e){return function(t,r){for(var o,i=!1;null!=(o=t.next());){if(o==e&&!i){")"==e&&t.backUp(1);break}i=!i&&"\\"==o}return(o==e||!i&&")"!=e)&&(r.tokenize=null),v("string","string")}}function j(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=z(")"),v(null,"(")}function q(e,t,r){this.type=e,this.indent=t,this.prev=r}function P(e,t,r,o){return e.context=new q(r,t.indentation()+(!1===o?0:n),e.context),r}function K(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function C(e,t,r){return T[r.context.type](e,t,r)}function B(e,t,r,o){for(var i=o||1;i>0;i--)r.context=r.context.prev;return C(e,t,r)}function _(e){var t=e.current().toLowerCase();a=f.hasOwnProperty(t)?"atom":h.hasOwnProperty(t)?"keyword":"variable"}var T={top:function(e,t,r){if("{"==e)return P(r,t,"block");if("}"==e&&r.context.prev)return K(r);if(w&&/@component/i.test(e))return P(r,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return P(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return P(r,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return P(r,t,"at");if("hash"==e)a="builtin";else if("word"==e)a="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return P(r,t,"interpolation");if(":"==e)return"pseudo";if(k&&"("==e)return P(r,t,"parens")}return r.context.type},block:function(e,t,r){if("word"==e){var o=t.current().toLowerCase();return u.hasOwnProperty(o)?(a="property","maybeprop"):m.hasOwnProperty(o)?(a="string-2","maybeprop"):k?(a=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(a+=" error","maybeprop")}return"meta"==e?"block":k||"hash"!=e&&"qualifier"!=e?T.top(e,t,r):(a="error","block")},maybeprop:function(e,t,r){return":"==e?P(r,t,"prop"):C(e,t,r)},prop:function(e,t,r){if(";"==e)return K(r);if("{"==e&&k)return P(r,t,"propBlock");if("}"==e||"{"==e)return B(e,t,r);if("("==e)return P(r,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)_(t);else if("interpolation"==e)return P(r,t,"interpolation")}else a+=" error";return"prop"},propBlock:function(e,t,r){return"}"==e?K(r):"word"==e?(a="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?B(e,t,r):")"==e?K(r):"("==e?P(r,t,"parens"):"interpolation"==e?P(r,t,"interpolation"):("word"==e&&_(t),"parens")},pseudo:function(e,t,r){return"meta"==e?"pseudo":"word"==e?(a="variable-3",r.context.type):C(e,t,r)},documentTypes:function(e,t,r){return"word"==e&&s.hasOwnProperty(t.current())?(a="tag",r.context.type):T.atBlock(e,t,r)},atBlock:function(e,t,r){if("("==e)return P(r,t,"atBlock_parens");if("}"==e||";"==e)return B(e,t,r);if("{"==e)return K(r)&&P(r,t,k?"block":"top");if("interpolation"==e)return P(r,t,"interpolation");if("word"==e){var o=t.current().toLowerCase();a="only"==o||"not"==o||"and"==o||"or"==o?"keyword":d.hasOwnProperty(o)?"attribute":c.hasOwnProperty(o)?"property":p.hasOwnProperty(o)?"keyword":u.hasOwnProperty(o)?"property":m.hasOwnProperty(o)?"string-2":f.hasOwnProperty(o)?"atom":h.hasOwnProperty(o)?"keyword":"error"}return r.context.type},atComponentBlock:function(e,t,r){return"}"==e?B(e,t,r):"{"==e?K(r)&&P(r,t,k?"block":"top",!1):("word"==e&&(a="error"),r.context.type)},atBlock_parens:function(e,t,r){return")"==e?K(r):"{"==e||"}"==e?B(e,t,r,2):T.atBlock(e,t,r)},restricted_atBlock_before:function(e,t,r){return"{"==e?P(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(a="variable","restricted_atBlock_before"):C(e,t,r)},restricted_atBlock:function(e,t,r){return"}"==e?(r.stateArg=null,K(r)):"word"==e?(a="@font-face"==r.stateArg&&!b.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!g.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,r){return"word"==e?(a="variable","keyframes"):"{"==e?P(r,t,"top"):C(e,t,r)},at:function(e,t,r){return";"==e?K(r):"{"==e||"}"==e?B(e,t,r):("word"==e?a="tag":"hash"==e&&(a="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?K(r):"{"==e||";"==e?B(e,t,r):("word"==e?a="variable":"variable"!=e&&"("!=e&&")"!=e&&(a="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:o?"block":"top",stateArg:null,context:new q(o?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||x)(e,t);return r&&"object"==typeof r&&(i=r[1],r=r[0]),a=r,"comment"!=i&&(t.state=T[t.state](i,e,t)),a},indent:function(e,t){var r=e.context,o=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=o&&")"!=o||(r=r.prev),r.prev&&("}"!=o||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=o||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=o||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-n)):i=(r=r.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}}));var r=["domain","regexp","url","url-prefix"],o=t(r),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(i),n=["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","prefers-color-scheme"],l=t(n),s=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light"],d=t(s),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","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","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","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","caret-color","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","contain","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-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","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-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","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","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","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","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","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","place-content","place-items","place-self","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","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","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-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","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","paint-order","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"],p=t(c),u=["border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],m=t(u),b=t(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),h=["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"],f=t(h),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","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","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","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","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","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","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-grid","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","manipulation","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","multiple_mask_images","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","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","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","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","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","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","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","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","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"],y=t(k),w=r.concat(i).concat(n).concat(s).concat(c).concat(u).concat(h).concat(k);function v(e,t){for(var r,o=!1;null!=(r=e.next());){if(o&&"/"==r){t.tokenize=null;break}o="*"==r}return["comment","comment"]}e.registerHelper("hintWords","css",w),e.defineMIME("text/css",{documentTypes:o,mediaTypes:a,mediaFeatures:l,mediaValueKeywords:d,propertyKeywords:p,nonStandardPropertyKeywords:m,fontProperties:b,counterDescriptors:g,colorKeywords:f,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=v,v(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:l,mediaValueKeywords:d,propertyKeywords:p,nonStandardPropertyKeywords:m,colorKeywords:f,valueKeywords:y,fontProperties:b,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=v,v(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:l,mediaValueKeywords:d,propertyKeywords:p,nonStandardPropertyKeywords:m,colorKeywords:f,valueKeywords:y,fontProperties:b,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=v,v(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/i,!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:o,mediaTypes:a,mediaFeatures:l,propertyKeywords:p,nonStandardPropertyKeywords:m,fontProperties:b,counterDescriptors:g,colorKeywords:f,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=v,v(e,t))}},name:"css",helperType:"gss"})})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/dart/dart.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/dart/dart.js index 629bfbf182f2..930c549fde25 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/dart/dart.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/dart/dart.js @@ -1 +1 @@ -!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../clike/clike"],e):e(CodeMirror)}((function(e){"use strict";var t="this super static final const abstract class extends external factory implements mixin get native set typedef with enum throw rethrow assert break case continue default in return new deferred async await covariant try catch finally do else for if switch while import library export part of show hide is as extension on yield".split(" "),n="try catch finally do else for if switch while".split(" "),i="true false null".split(" "),r="void bool num int double dynamic var String".split(" ");function o(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=!0;return t}function a(e){(e.interpolationStack||(e.interpolationStack=[])).push(e.tokenize)}function c(e){return(e.interpolationStack||(e.interpolationStack=[])).pop()}function l(e,t,n,i){var r=!1;if(t.eat(e)){if(!t.eat(e))return"string";r=!0}function o(t,n){for(var o=!1;!t.eol();){if(!i&&!o&&"$"==t.peek())return a(n),n.tokenize=u,"string";var c=t.next();if(c==e&&!o&&(!r||t.match(e+e))){n.tokenize=null;break}o=!i&&!o&&"\\"==c}return"string"}return n.tokenize=o,o(t,n)}function u(e,t){return e.eat("$"),e.eat("{")?t.tokenize=null:t.tokenize=f,null}function f(e,t){return e.eatWhile(/[\w_]/),t.tokenize=c(t),"variable"}e.defineMIME("application/dart",{name:"clike",keywords:o(t),blockKeywords:o(n),builtin:o(r),atoms:o(i),hooks:{"@":function(e){return e.eatWhile(/[\w\$_\.]/),"meta"},"'":function(e,t){return l("'",e,t,!1)},'"':function(e,t){return l('"',e,t,!1)},r:function(e,t){var n=e.peek();return("'"==n||'"'==n)&&l(e.next(),e,t,!0)},"}":function(e,t){return function(e){return e.interpolationStack?e.interpolationStack.length:0}(t)>0&&(t.tokenize=c(t),null)},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=function e(t){return function(n,i){for(var r;r=n.next();){if("*"==r&&n.eat("/")){if(1==t){i.tokenize=null;break}return i.tokenize=e(t-1),i.tokenize(n,i)}if("/"==r&&n.eat("*"))return i.tokenize=e(t+1),i.tokenize(n,i)}return"comment"}}(1),t.tokenize(e,t))},token:function(e,t,n){if("variable"==n&&RegExp("^[_$]*[A-Z][a-zA-Z0-9_$]*$","g").test(e.current()))return"variable-2"}}}),e.registerHelper("hintWords","application/dart",t.concat(i).concat(r)),e.defineMode("dart",(function(t){return e.getMode(t,"application/dart")}),"clike")})); \ No newline at end of file +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../clike/clike"],e):e(CodeMirror)}((function(e){"use strict";var t="this super static final const abstract class extends external factory implements mixin get native set typedef with enum throw rethrow assert break case continue default in return new deferred async await covariant try catch finally do else for if switch while import library export part of show hide is as extension on yield late required".split(" "),n="try catch finally do else for if switch while".split(" "),i="true false null".split(" "),r="void bool num int double dynamic var String Null Never".split(" ");function o(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=!0;return t}function a(e){(e.interpolationStack||(e.interpolationStack=[])).push(e.tokenize)}function l(e){return(e.interpolationStack||(e.interpolationStack=[])).pop()}function c(e,t,n,i){var r=!1;if(t.eat(e)){if(!t.eat(e))return"string";r=!0}function o(t,n){for(var o=!1;!t.eol();){if(!i&&!o&&"$"==t.peek())return a(n),n.tokenize=u,"string";var l=t.next();if(l==e&&!o&&(!r||t.match(e+e))){n.tokenize=null;break}o=!i&&!o&&"\\"==l}return"string"}return n.tokenize=o,o(t,n)}function u(e,t){return e.eat("$"),e.eat("{")?t.tokenize=null:t.tokenize=f,null}function f(e,t){return e.eatWhile(/[\w_]/),t.tokenize=l(t),"variable"}e.defineMIME("application/dart",{name:"clike",keywords:o(t),blockKeywords:o(n),builtin:o(r),atoms:o(i),hooks:{"@":function(e){return e.eatWhile(/[\w\$_\.]/),"meta"},"'":function(e,t){return c("'",e,t,!1)},'"':function(e,t){return c('"',e,t,!1)},r:function(e,t){var n=e.peek();return("'"==n||'"'==n)&&c(e.next(),e,t,!0)},"}":function(e,t){return function(e){return e.interpolationStack?e.interpolationStack.length:0}(t)>0&&(t.tokenize=l(t),null)},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=function e(t){return function(n,i){for(var r;r=n.next();){if("*"==r&&n.eat("/")){if(1==t){i.tokenize=null;break}return i.tokenize=e(t-1),i.tokenize(n,i)}if("/"==r&&n.eat("*"))return i.tokenize=e(t+1),i.tokenize(n,i)}return"comment"}}(1),t.tokenize(e,t))},token:function(e,t,n){if("variable"==n&&RegExp("^[_$]*[A-Z][a-zA-Z0-9_$]*$","g").test(e.current()))return"variable-2"}}}),e.registerHelper("hintWords","application/dart",t.concat(i).concat(r)),e.defineMode("dart",(function(t){return e.getMode(t,"application/dart")}),"clike")})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/javascript/javascript.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/javascript/javascript.js index 02a8e31753a0..64e05c050c90 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/javascript/javascript.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/javascript/javascript.js @@ -1 +1 @@ -!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,r){var n,a,i=t.indentUnit,o=r.statementIndent,c=r.jsonld,s=r.json||c,u=r.typescript,f=r.wordCharacters||/[\w$\xa1-\uffff]/,l=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),a=e("keyword d"),i=e("operator"),o={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:a,break:a,continue:a,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),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:n,export:e("export"),import:e("import"),extends:n,await:n}}(),d=/[+\-*&%=<>!?|~^@]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function m(e,t,r){return n=e,a=r,t}function v(e,t){var r,n=e.next();if('"'==n||"'"==n)return t.tokenize=(r=n,function(e,t){var n,a=!1;if(c&&"@"==e.peek()&&e.match(p))return t.tokenize=v,m("jsonld-keyword","meta");for(;null!=(n=e.next())&&(n!=r||a);)a=!a&&"\\"==n;return a||(t.tokenize=v),m("string","string")}),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if("."==n&&e.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return m(n);if("="==n&&e.eat(">"))return m("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if("/"==n)return e.eat("*")?(t.tokenize=k,k(e,t)):e.eat("/")?(e.skipToEnd(),m("comment","comment")):Ke(e,t,1)?(function(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(e.eat("="),m("operator","operator",e.current()));if("`"==n)return t.tokenize=y,y(e,t);if("#"==n)return e.skipToEnd(),m("error","error");if("<"==n&&e.match("!--")||"-"==n&&e.match("->"))return e.skipToEnd(),m("comment","comment");if(d.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),m("operator","operator",e.current());if(f.test(n)){e.eatWhile(f);var a=e.current();if("."!=t.lastType){if(l.propertyIsEnumerable(a)){var i=l[a];return m(i.type,i.style,a)}if("async"==a&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",a)}return m("variable","variable",a)}}function k(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=v;break}n="*"==r}return m("comment","comment")}function y(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=v;break}n=!n&&"\\"==r}return m("quasi","string-2",e.current())}function w(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(u){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var a=0,i=!1,o=r-1;o>=0;--o){var c=e.string.charAt(o),s="([{}])".indexOf(c);if(s>=0&&s<3){if(!a){++o;break}if(0==--a){"("==c&&(i=!0);break}}else if(s>=3&&s<6)++a;else if(f.test(c))i=!0;else if(/["'\/`]/.test(c))for(;;--o){if(0==o)return;if(e.string.charAt(o-1)==c&&"\\"!=e.string.charAt(o-2)){o--;break}}else if(i&&!a){++o;break}}i&&!a&&(t.fatArrowAt=o)}}var b={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function x(e,t,r,n,a,i){this.indented=e,this.column=t,this.type=r,this.prev=a,this.info=i,null!=n&&(this.align=n)}function h(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return!0}var g={state:null,column:null,marked:null,cc:null};function j(){for(var e=arguments.length-1;e>=0;e--)g.cc.push(arguments[e])}function M(){return j.apply(null,arguments),!0}function A(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}function V(e){var t=g.state;if(g.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=function e(t,r){if(r){if(r.block){var n=e(t,r.prev);return n?n==r.prev?r:new z(n,r.vars,!0):null}return A(t,r.vars)?r:new z(r.prev,new I(t,r.vars),!1)}return null}(e,t.context);if(null!=n)return void(t.context=n)}else if(!A(e,t.localVars))return void(t.localVars=new I(e,t.localVars));r.globalVars&&!A(e,t.globalVars)&&(t.globalVars=new I(e,t.globalVars))}function E(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function z(e,t,r){this.prev=e,this.vars=t,this.block=r}function I(e,t){this.name=e,this.next=t}var T=new I("this",new I("arguments",null));function $(){g.state.context=new z(g.state.context,g.state.localVars,!1),g.state.localVars=T}function C(){g.state.context=new z(g.state.context,g.state.localVars,!0),g.state.localVars=null}function _(){g.state.localVars=g.state.context.vars,g.state.context=g.state.context.prev}function O(e,t){var r=function(){var r=g.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var a=r.lexical;a&&")"==a.type&&a.align;a=a.prev)n=a.indented;r.lexical=new x(n,g.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function q(){var e=g.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function P(e){return function t(r){return r==e?M():";"==e||"}"==r||")"==r||"]"==r?j():M(t)}}function S(e,t){return"var"==e?M(O("vardef",t),we,P(";"),q):"keyword a"==e?M(O("form"),F,S,q):"keyword b"==e?M(O("form"),S,q):"keyword d"==e?g.stream.match(/^\s*$/,!1)?M():M(O("stat"),W,P(";"),q):"debugger"==e?M(P(";")):"{"==e?M(O("}"),C,ie,q,_):";"==e?M():"if"==e?("else"==g.state.lexical.info&&g.state.cc[g.state.cc.length-1]==q&&g.state.cc.pop()(),M(O("form"),F,S,q,Me)):"function"==e?M(ze):"for"==e?M(O("form"),Ae,S,q):"class"==e||u&&"interface"==t?(g.marked="keyword",M(O("form","class"==e?e:t),_e,q)):"variable"==e?u&&"declare"==t?(g.marked="keyword",M(S)):u&&("module"==t||"enum"==t||"type"==t)&&g.stream.match(/^\s*\w/,!1)?(g.marked="keyword","enum"==t?M(Ge):"type"==t?M(Te,P("operator"),fe,P(";")):M(O("form"),be,P("{"),O("}"),ie,q,q)):u&&"namespace"==t?(g.marked="keyword",M(O("form"),U,S,q)):u&&"abstract"==t?(g.marked="keyword",M(S)):M(O("stat"),Y):"switch"==e?M(O("form"),F,P("{"),O("}","switch"),C,ie,q,q,_):"case"==e?M(U,P(":")):"default"==e?M(P(":")):"catch"==e?M(O("form"),$,N,S,q,_):"export"==e?M(O("stat"),Se,q):"import"==e?M(O("stat"),Ue,q):"async"==e?M(S):"@"==t?M(U,S):j(O("stat"),U,P(";"),q)}function N(e){if("("==e)return M($e,P(")"))}function U(e,t){return H(e,t,!1)}function B(e,t){return H(e,t,!0)}function F(e){return"("!=e?j():M(O(")"),U,P(")"),q)}function H(e,t,r){if(g.state.fatArrowAt==g.stream.start){var n=r?Q:L;if("("==e)return M($,O(")"),ne($e,")"),q,P("=>"),n,_);if("variable"==e)return j($,be,P("=>"),n,_)}var a=r?G:D;return b.hasOwnProperty(e)?M(a):"function"==e?M(ze,a):"class"==e||u&&"interface"==t?(g.marked="keyword",M(O("form"),Ce,q)):"keyword c"==e||"async"==e?M(r?B:U):"("==e?M(O(")"),W,P(")"),q,a):"operator"==e||"spread"==e?M(r?B:U):"["==e?M(O("]"),De,q,a):"{"==e?ae(ee,"}",null,a):"quasi"==e?j(J,a):"new"==e?M(function(e){return function(t){return"."==t?M(e?X:R):"variable"==t&&u?M(ve,e?G:D):j(e?B:U)}}(r)):"import"==e?M(U):M()}function W(e){return e.match(/[;\}\)\],]/)?j():j(U)}function D(e,t){return","==e?M(W):G(e,t,!1)}function G(e,t,r){var n=0==r?D:G,a=0==r?U:B;return"=>"==e?M($,r?Q:L,_):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?M(n):u&&"<"==t&&g.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?M(O(">"),ne(fe,">"),q,n):"?"==t?M(U,P(":"),a):M(a):"quasi"==e?j(J,n):";"!=e?"("==e?ae(B,")","call",n):"."==e?M(Z,n):"["==e?M(O("]"),W,P("]"),q,n):u&&"as"==t?(g.marked="keyword",M(fe,n)):"regexp"==e?(g.state.lastType=g.marked="operator",g.stream.backUp(g.stream.pos-g.stream.start-1),M(a)):void 0:void 0}function J(e,t){return"quasi"!=e?j():"${"!=t.slice(t.length-2)?M(J):M(U,K)}function K(e){if("}"==e)return g.marked="string-2",g.state.tokenize=y,M(J)}function L(e){return w(g.stream,g.state),j("{"==e?S:U)}function Q(e){return w(g.stream,g.state),j("{"==e?S:B)}function R(e,t){if("target"==t)return g.marked="keyword",M(D)}function X(e,t){if("target"==t)return g.marked="keyword",M(G)}function Y(e){return":"==e?M(q,S):j(D,P(";"),q)}function Z(e){if("variable"==e)return g.marked="property",M()}function ee(e,t){return"async"==e?(g.marked="property",M(ee)):"variable"==e||"keyword"==g.style?(g.marked="property","get"==t||"set"==t?M(te):(u&&g.state.fatArrowAt==g.stream.start&&(r=g.stream.match(/^\s*:\s*/,!1))&&(g.state.fatArrowAt=g.stream.pos+r[0].length),M(re))):"number"==e||"string"==e?(g.marked=c?"property":g.style+" property",M(re)):"jsonld-keyword"==e?M(re):u&&E(t)?(g.marked="keyword",M(ee)):"["==e?M(U,oe,P("]"),re):"spread"==e?M(B,re):"*"==t?(g.marked="keyword",M(ee)):":"==e?j(re):void 0;var r}function te(e){return"variable"!=e?j(re):(g.marked="property",M(ze))}function re(e){return":"==e?M(B):"("==e?j(ze):void 0}function ne(e,t,r){function n(a,i){if(r?r.indexOf(a)>-1:","==a){var o=g.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),M((function(r,n){return r==t||n==t?j():j(e)}),n)}return a==t||i==t?M():r&&r.indexOf(";")>-1?j(e):M(P(t))}return function(r,a){return r==t||a==t?M():j(e,n)}}function ae(e,t,r){for(var n=3;n<arguments.length;n++)g.cc.push(arguments[n]);return M(O(t,r),ne(e,t),q)}function ie(e){return"}"==e?M():j(S,ie)}function oe(e,t){if(u){if(":"==e)return M(fe);if("?"==t)return M(oe)}}function ce(e,t){if(u&&(":"==e||"in"==t))return M(fe)}function se(e){if(u&&":"==e)return g.stream.match(/^\s*\w+\s+is\b/,!1)?M(U,ue,fe):M(fe)}function ue(e,t){if("is"==t)return g.marked="keyword",M()}function fe(e,t){return"keyof"==t||"typeof"==t||"infer"==t?(g.marked="keyword",M("typeof"==t?B:fe)):"variable"==e||"void"==t?(g.marked="type",M(me)):"|"==t||"&"==t?M(fe):"string"==e||"number"==e||"atom"==e?M(me):"["==e?M(O("]"),ne(fe,"]",","),q,me):"{"==e?M(O("}"),ne(de,"}",",;"),q,me):"("==e?M(ne(pe,")"),le,me):"<"==e?M(ne(fe,">"),fe):void 0}function le(e){if("=>"==e)return M(fe)}function de(e,t){return"variable"==e||"keyword"==g.style?(g.marked="property",M(de)):"?"==t||"number"==e||"string"==e?M(de):":"==e?M(fe):"["==e?M(P("variable"),ce,P("]"),de):"("==e?j(Ie,de):void 0}function pe(e,t){return"variable"==e&&g.stream.match(/^\s*[?:]/,!1)||"?"==t?M(pe):":"==e?M(fe):"spread"==e?M(pe):j(fe)}function me(e,t){return"<"==t?M(O(">"),ne(fe,">"),q,me):"|"==t||"."==e||"&"==t?M(fe):"["==e?M(fe,P("]"),me):"extends"==t||"implements"==t?(g.marked="keyword",M(fe)):"?"==t?M(fe,P(":"),fe):void 0}function ve(e,t){if("<"==t)return M(O(">"),ne(fe,">"),q,me)}function ke(){return j(fe,ye)}function ye(e,t){if("="==t)return M(fe)}function we(e,t){return"enum"==t?(g.marked="keyword",M(Ge)):j(be,oe,ge,je)}function be(e,t){return u&&E(t)?(g.marked="keyword",M(be)):"variable"==e?(V(t),M()):"spread"==e?M(be):"["==e?ae(he,"]"):"{"==e?ae(xe,"}"):void 0}function xe(e,t){return"variable"!=e||g.stream.match(/^\s*:/,!1)?("variable"==e&&(g.marked="property"),"spread"==e?M(be):"}"==e?j():"["==e?M(U,P("]"),P(":"),xe):M(P(":"),be,ge)):(V(t),M(ge))}function he(){return j(be,ge)}function ge(e,t){if("="==t)return M(B)}function je(e){if(","==e)return M(we)}function Me(e,t){if("keyword b"==e&&"else"==t)return M(O("form","else"),S,q)}function Ae(e,t){return"await"==t?M(Ae):"("==e?M(O(")"),Ve,q):void 0}function Ve(e){return"var"==e?M(we,Ee):"variable"==e?M(Ee):j(Ee)}function Ee(e,t){return")"==e?M():";"==e?M(Ee):"in"==t||"of"==t?(g.marked="keyword",M(U,Ee)):j(U,Ee)}function ze(e,t){return"*"==t?(g.marked="keyword",M(ze)):"variable"==e?(V(t),M(ze)):"("==e?M($,O(")"),ne($e,")"),q,se,S,_):u&&"<"==t?M(O(">"),ne(ke,">"),q,ze):void 0}function Ie(e,t){return"*"==t?(g.marked="keyword",M(Ie)):"variable"==e?(V(t),M(Ie)):"("==e?M($,O(")"),ne($e,")"),q,se,_):u&&"<"==t?M(O(">"),ne(ke,">"),q,Ie):void 0}function Te(e,t){return"keyword"==e||"variable"==e?(g.marked="type",M(Te)):"<"==t?M(O(">"),ne(ke,">"),q):void 0}function $e(e,t){return"@"==t&&M(U,$e),"spread"==e?M($e):u&&E(t)?(g.marked="keyword",M($e)):u&&"this"==e?M(oe,ge):j(be,oe,ge)}function Ce(e,t){return"variable"==e?_e(e,t):Oe(e,t)}function _e(e,t){if("variable"==e)return V(t),M(Oe)}function Oe(e,t){return"<"==t?M(O(">"),ne(ke,">"),q,Oe):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(g.marked="keyword"),M(u?fe:U,Oe)):"{"==e?M(O("}"),qe,q):void 0}function qe(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&E(t))&&g.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(g.marked="keyword",M(qe)):"variable"==e||"keyword"==g.style?(g.marked="property",M(u?Pe:ze,qe)):"number"==e||"string"==e?M(u?Pe:ze,qe):"["==e?M(U,oe,P("]"),u?Pe:ze,qe):"*"==t?(g.marked="keyword",M(qe)):u&&"("==e?j(Ie,qe):";"==e||","==e?M(qe):"}"==e?M():"@"==t?M(U,qe):void 0}function Pe(e,t){if("?"==t)return M(Pe);if(":"==e)return M(fe,ge);if("="==t)return M(B);var r=g.state.lexical.prev;return j(r&&"interface"==r.info?Ie:ze)}function Se(e,t){return"*"==t?(g.marked="keyword",M(We,P(";"))):"default"==t?(g.marked="keyword",M(U,P(";"))):"{"==e?M(ne(Ne,"}"),We,P(";")):j(S)}function Ne(e,t){return"as"==t?(g.marked="keyword",M(P("variable"))):"variable"==e?j(B,Ne):void 0}function Ue(e){return"string"==e?M():"("==e?j(U):j(Be,Fe,We)}function Be(e,t){return"{"==e?ae(Be,"}"):("variable"==e&&V(t),"*"==t&&(g.marked="keyword"),M(He))}function Fe(e){if(","==e)return M(Be,Fe)}function He(e,t){if("as"==t)return g.marked="keyword",M(Be)}function We(e,t){if("from"==t)return g.marked="keyword",M(U)}function De(e){return"]"==e?M():j(ne(B,"]"))}function Ge(){return j(O("form"),be,P("{"),O("}"),ne(Je,"}"),q,q)}function Je(){return j(be,ge)}function Ke(e,t,r){return t.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return _.lex=!0,q.lex=!0,{startState:function(e){var t={tokenize:v,lastType:"sof",cc:[],lexical:new x((e||0)-i,0,"block",!1),localVars:r.localVars,context:r.localVars&&new z(null,null,!1),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(),w(e,t)),t.tokenize!=k&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=a&&"--"!=a?n:"incdec",function(e,t,r,n,a){var i=e.cc;for(g.state=e,g.stream=a,g.marked=null,g.cc=i,g.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){if((i.length?i.pop():s?U:S)(r,n)){for(;i.length&&i[i.length-1].lex;)i.pop()();return g.marked?g.marked:"variable"==r&&h(e,n)?"variable-2":t}}}(t,r,n,a,e))},indent:function(t,n){if(t.tokenize==k)return e.Pass;if(t.tokenize!=v)return 0;var a,c=n&&n.charAt(0),s=t.lexical;if(!/^\s*else\b/.test(n))for(var u=t.cc.length-1;u>=0;--u){var f=t.cc[u];if(f==q)s=s.prev;else if(f!=Me)break}for(;("stat"==s.type||"form"==s.type)&&("}"==c||(a=t.cc[t.cc.length-1])&&(a==D||a==G)&&!/^[,\.=+\-*:?[\(]/.test(n));)s=s.prev;o&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var l=s.type,p=c==l;return"vardef"==l?s.indented+("operator"==t.lastType||","==t.lastType?s.info.length+1:0):"form"==l&&"{"==c?s.indented:"form"==l?s.indented+i:"stat"==l?s.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||d.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,n)?o||i:0):"switch"!=s.info||p||0==r.doubleIndentSwitch?s.align?s.column+(p?0:1):s.indented+(p?0:i):s.indented+(/^(?:case|default)\b/.test(n)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:c,jsonMode:s,expressionAllowed:Ke,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=U&&t!=B||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})})); \ No newline at end of file +!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,r){var n,a,i=t.indentUnit,o=r.statementIndent,c=r.jsonld,s=r.json||c,u=r.typescript,f=r.wordCharacters||/[\w$\xa1-\uffff]/,l=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),a=e("keyword d"),i=e("operator"),o={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:a,break:a,continue:a,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),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:n,export:e("export"),import:e("import"),extends:n,await:n}}(),d=/[+\-*&%=<>!?|~^@]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function m(e,t,r){return n=e,a=r,t}function v(e,t){var r,n=e.next();if('"'==n||"'"==n)return t.tokenize=(r=n,function(e,t){var n,a=!1;if(c&&"@"==e.peek()&&e.match(p))return t.tokenize=v,m("jsonld-keyword","meta");for(;null!=(n=e.next())&&(n!=r||a);)a=!a&&"\\"==n;return a||(t.tokenize=v),m("string","string")}),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if("."==n&&e.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return m(n);if("="==n&&e.eat(">"))return m("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if("/"==n)return e.eat("*")?(t.tokenize=k,k(e,t)):e.eat("/")?(e.skipToEnd(),m("comment","comment")):Ke(e,t,1)?(function(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(e.eat("="),m("operator","operator",e.current()));if("`"==n)return t.tokenize=y,y(e,t);if("#"==n&&"!"==e.peek())return e.skipToEnd(),m("meta","meta");if("#"==n&&e.eatWhile(f))return m("variable","property");if("<"==n&&e.match("!--")||"-"==n&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),m("comment","comment");if(d.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-|&?]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),"?"==n&&e.eat(".")?m("."):m("operator","operator",e.current());if(f.test(n)){e.eatWhile(f);var a=e.current();if("."!=t.lastType){if(l.propertyIsEnumerable(a)){var i=l[a];return m(i.type,i.style,a)}if("async"==a&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",a)}return m("variable","variable",a)}}function k(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=v;break}n="*"==r}return m("comment","comment")}function y(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=v;break}n=!n&&"\\"==r}return m("quasi","string-2",e.current())}function w(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(u){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var a=0,i=!1,o=r-1;o>=0;--o){var c=e.string.charAt(o),s="([{}])".indexOf(c);if(s>=0&&s<3){if(!a){++o;break}if(0==--a){"("==c&&(i=!0);break}}else if(s>=3&&s<6)++a;else if(f.test(c))i=!0;else if(/["'\/`]/.test(c))for(;;--o){if(0==o)return;if(e.string.charAt(o-1)==c&&"\\"!=e.string.charAt(o-2)){o--;break}}else if(i&&!a){++o;break}}i&&!a&&(t.fatArrowAt=o)}}var b={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function x(e,t,r,n,a,i){this.indented=e,this.column=t,this.type=r,this.prev=a,this.info=i,null!=n&&(this.align=n)}function h(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return!0}var g={state:null,column:null,marked:null,cc:null};function j(){for(var e=arguments.length-1;e>=0;e--)g.cc.push(arguments[e])}function M(){return j.apply(null,arguments),!0}function A(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}function V(e){var t=g.state;if(g.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=function e(t,r){if(r){if(r.block){var n=e(t,r.prev);return n?n==r.prev?r:new z(n,r.vars,!0):null}return A(t,r.vars)?r:new z(r.prev,new I(t,r.vars),!1)}return null}(e,t.context);if(null!=n)return void(t.context=n)}else if(!A(e,t.localVars))return void(t.localVars=new I(e,t.localVars));r.globalVars&&!A(e,t.globalVars)&&(t.globalVars=new I(e,t.globalVars))}function E(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function z(e,t,r){this.prev=e,this.vars=t,this.block=r}function I(e,t){this.name=e,this.next=t}var T=new I("this",new I("arguments",null));function $(){g.state.context=new z(g.state.context,g.state.localVars,!1),g.state.localVars=T}function C(){g.state.context=new z(g.state.context,g.state.localVars,!0),g.state.localVars=null}function _(){g.state.localVars=g.state.context.vars,g.state.context=g.state.context.prev}function O(e,t){var r=function(){var r=g.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var a=r.lexical;a&&")"==a.type&&a.align;a=a.prev)n=a.indented;r.lexical=new x(n,g.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function q(){var e=g.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function S(e){return function t(r){return r==e?M():";"==e||"}"==r||")"==r||"]"==r?j():M(t)}}function P(e,t){return"var"==e?M(O("vardef",t),we,S(";"),q):"keyword a"==e?M(O("form"),B,P,q):"keyword b"==e?M(O("form"),P,q):"keyword d"==e?g.stream.match(/^\s*$/,!1)?M():M(O("stat"),H,S(";"),q):"debugger"==e?M(S(";")):"{"==e?M(O("}"),C,ie,q,_):";"==e?M():"if"==e?("else"==g.state.lexical.info&&g.state.cc[g.state.cc.length-1]==q&&g.state.cc.pop()(),M(O("form"),B,P,q,Me)):"function"==e?M(ze):"for"==e?M(O("form"),Ae,P,q):"class"==e||u&&"interface"==t?(g.marked="keyword",M(O("form","class"==e?e:t),_e,q)):"variable"==e?u&&"declare"==t?(g.marked="keyword",M(P)):u&&("module"==t||"enum"==t||"type"==t)&&g.stream.match(/^\s*\w/,!1)?(g.marked="keyword","enum"==t?M(Ge):"type"==t?M(Te,S("operator"),fe,S(";")):M(O("form"),be,S("{"),O("}"),ie,q,q)):u&&"namespace"==t?(g.marked="keyword",M(O("form"),U,P,q)):u&&"abstract"==t?(g.marked="keyword",M(P)):M(O("stat"),Y):"switch"==e?M(O("form"),B,S("{"),O("}","switch"),C,ie,q,q,_):"case"==e?M(U,S(":")):"default"==e?M(S(":")):"catch"==e?M(O("form"),$,N,P,q,_):"export"==e?M(O("stat"),Pe,q):"import"==e?M(O("stat"),Ue,q):"async"==e?M(P):"@"==t?M(U,P):j(O("stat"),U,S(";"),q)}function N(e){if("("==e)return M($e,S(")"))}function U(e,t){return F(e,t,!1)}function W(e,t){return F(e,t,!0)}function B(e){return"("!=e?j():M(O(")"),H,S(")"),q)}function F(e,t,r){if(g.state.fatArrowAt==g.stream.start){var n=r?Q:L;if("("==e)return M($,O(")"),ne($e,")"),q,S("=>"),n,_);if("variable"==e)return j($,be,S("=>"),n,_)}var a=r?G:D;return b.hasOwnProperty(e)?M(a):"function"==e?M(ze,a):"class"==e||u&&"interface"==t?(g.marked="keyword",M(O("form"),Ce,q)):"keyword c"==e||"async"==e?M(r?W:U):"("==e?M(O(")"),H,S(")"),q,a):"operator"==e||"spread"==e?M(r?W:U):"["==e?M(O("]"),De,q,a):"{"==e?ae(ee,"}",null,a):"quasi"==e?j(J,a):"new"==e?M(function(e){return function(t){return"."==t?M(e?X:R):"variable"==t&&u?M(ve,e?G:D):j(e?W:U)}}(r)):"import"==e?M(U):M()}function H(e){return e.match(/[;\}\)\],]/)?j():j(U)}function D(e,t){return","==e?M(H):G(e,t,!1)}function G(e,t,r){var n=0==r?D:G,a=0==r?U:W;return"=>"==e?M($,r?Q:L,_):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?M(n):u&&"<"==t&&g.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?M(O(">"),ne(fe,">"),q,n):"?"==t?M(U,S(":"),a):M(a):"quasi"==e?j(J,n):";"!=e?"("==e?ae(W,")","call",n):"."==e?M(Z,n):"["==e?M(O("]"),H,S("]"),q,n):u&&"as"==t?(g.marked="keyword",M(fe,n)):"regexp"==e?(g.state.lastType=g.marked="operator",g.stream.backUp(g.stream.pos-g.stream.start-1),M(a)):void 0:void 0}function J(e,t){return"quasi"!=e?j():"${"!=t.slice(t.length-2)?M(J):M(U,K)}function K(e){if("}"==e)return g.marked="string-2",g.state.tokenize=y,M(J)}function L(e){return w(g.stream,g.state),j("{"==e?P:U)}function Q(e){return w(g.stream,g.state),j("{"==e?P:W)}function R(e,t){if("target"==t)return g.marked="keyword",M(D)}function X(e,t){if("target"==t)return g.marked="keyword",M(G)}function Y(e){return":"==e?M(q,P):j(D,S(";"),q)}function Z(e){if("variable"==e)return g.marked="property",M()}function ee(e,t){return"async"==e?(g.marked="property",M(ee)):"variable"==e||"keyword"==g.style?(g.marked="property","get"==t||"set"==t?M(te):(u&&g.state.fatArrowAt==g.stream.start&&(r=g.stream.match(/^\s*:\s*/,!1))&&(g.state.fatArrowAt=g.stream.pos+r[0].length),M(re))):"number"==e||"string"==e?(g.marked=c?"property":g.style+" property",M(re)):"jsonld-keyword"==e?M(re):u&&E(t)?(g.marked="keyword",M(ee)):"["==e?M(U,oe,S("]"),re):"spread"==e?M(W,re):"*"==t?(g.marked="keyword",M(ee)):":"==e?j(re):void 0;var r}function te(e){return"variable"!=e?j(re):(g.marked="property",M(ze))}function re(e){return":"==e?M(W):"("==e?j(ze):void 0}function ne(e,t,r){function n(a,i){if(r?r.indexOf(a)>-1:","==a){var o=g.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),M((function(r,n){return r==t||n==t?j():j(e)}),n)}return a==t||i==t?M():r&&r.indexOf(";")>-1?j(e):M(S(t))}return function(r,a){return r==t||a==t?M():j(e,n)}}function ae(e,t,r){for(var n=3;n<arguments.length;n++)g.cc.push(arguments[n]);return M(O(t,r),ne(e,t),q)}function ie(e){return"}"==e?M():j(P,ie)}function oe(e,t){if(u){if(":"==e)return M(fe);if("?"==t)return M(oe)}}function ce(e,t){if(u&&(":"==e||"in"==t))return M(fe)}function se(e){if(u&&":"==e)return g.stream.match(/^\s*\w+\s+is\b/,!1)?M(U,ue,fe):M(fe)}function ue(e,t){if("is"==t)return g.marked="keyword",M()}function fe(e,t){return"keyof"==t||"typeof"==t||"infer"==t?(g.marked="keyword",M("typeof"==t?W:fe)):"variable"==e||"void"==t?(g.marked="type",M(me)):"|"==t||"&"==t?M(fe):"string"==e||"number"==e||"atom"==e?M(me):"["==e?M(O("]"),ne(fe,"]",","),q,me):"{"==e?M(O("}"),ne(de,"}",",;"),q,me):"("==e?M(ne(pe,")"),le,me):"<"==e?M(ne(fe,">"),fe):void 0}function le(e){if("=>"==e)return M(fe)}function de(e,t){return"variable"==e||"keyword"==g.style?(g.marked="property",M(de)):"?"==t||"number"==e||"string"==e?M(de):":"==e?M(fe):"["==e?M(S("variable"),ce,S("]"),de):"("==e?j(Ie,de):void 0}function pe(e,t){return"variable"==e&&g.stream.match(/^\s*[?:]/,!1)||"?"==t?M(pe):":"==e?M(fe):"spread"==e?M(pe):j(fe)}function me(e,t){return"<"==t?M(O(">"),ne(fe,">"),q,me):"|"==t||"."==e||"&"==t?M(fe):"["==e?M(fe,S("]"),me):"extends"==t||"implements"==t?(g.marked="keyword",M(fe)):"?"==t?M(fe,S(":"),fe):void 0}function ve(e,t){if("<"==t)return M(O(">"),ne(fe,">"),q,me)}function ke(){return j(fe,ye)}function ye(e,t){if("="==t)return M(fe)}function we(e,t){return"enum"==t?(g.marked="keyword",M(Ge)):j(be,oe,ge,je)}function be(e,t){return u&&E(t)?(g.marked="keyword",M(be)):"variable"==e?(V(t),M()):"spread"==e?M(be):"["==e?ae(he,"]"):"{"==e?ae(xe,"}"):void 0}function xe(e,t){return"variable"!=e||g.stream.match(/^\s*:/,!1)?("variable"==e&&(g.marked="property"),"spread"==e?M(be):"}"==e?j():"["==e?M(U,S("]"),S(":"),xe):M(S(":"),be,ge)):(V(t),M(ge))}function he(){return j(be,ge)}function ge(e,t){if("="==t)return M(W)}function je(e){if(","==e)return M(we)}function Me(e,t){if("keyword b"==e&&"else"==t)return M(O("form","else"),P,q)}function Ae(e,t){return"await"==t?M(Ae):"("==e?M(O(")"),Ve,q):void 0}function Ve(e){return"var"==e?M(we,Ee):"variable"==e?M(Ee):j(Ee)}function Ee(e,t){return")"==e?M():";"==e?M(Ee):"in"==t||"of"==t?(g.marked="keyword",M(U,Ee)):j(U,Ee)}function ze(e,t){return"*"==t?(g.marked="keyword",M(ze)):"variable"==e?(V(t),M(ze)):"("==e?M($,O(")"),ne($e,")"),q,se,P,_):u&&"<"==t?M(O(">"),ne(ke,">"),q,ze):void 0}function Ie(e,t){return"*"==t?(g.marked="keyword",M(Ie)):"variable"==e?(V(t),M(Ie)):"("==e?M($,O(")"),ne($e,")"),q,se,_):u&&"<"==t?M(O(">"),ne(ke,">"),q,Ie):void 0}function Te(e,t){return"keyword"==e||"variable"==e?(g.marked="type",M(Te)):"<"==t?M(O(">"),ne(ke,">"),q):void 0}function $e(e,t){return"@"==t&&M(U,$e),"spread"==e?M($e):u&&E(t)?(g.marked="keyword",M($e)):u&&"this"==e?M(oe,ge):j(be,oe,ge)}function Ce(e,t){return"variable"==e?_e(e,t):Oe(e,t)}function _e(e,t){if("variable"==e)return V(t),M(Oe)}function Oe(e,t){return"<"==t?M(O(">"),ne(ke,">"),q,Oe):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(g.marked="keyword"),M(u?fe:U,Oe)):"{"==e?M(O("}"),qe,q):void 0}function qe(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&E(t))&&g.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(g.marked="keyword",M(qe)):"variable"==e||"keyword"==g.style?(g.marked="property",M(Se,qe)):"number"==e||"string"==e?M(Se,qe):"["==e?M(U,oe,S("]"),Se,qe):"*"==t?(g.marked="keyword",M(qe)):u&&"("==e?j(Ie,qe):";"==e||","==e?M(qe):"}"==e?M():"@"==t?M(U,qe):void 0}function Se(e,t){if("?"==t)return M(Se);if(":"==e)return M(fe,ge);if("="==t)return M(W);var r=g.state.lexical.prev;return j(r&&"interface"==r.info?Ie:ze)}function Pe(e,t){return"*"==t?(g.marked="keyword",M(He,S(";"))):"default"==t?(g.marked="keyword",M(U,S(";"))):"{"==e?M(ne(Ne,"}"),He,S(";")):j(P)}function Ne(e,t){return"as"==t?(g.marked="keyword",M(S("variable"))):"variable"==e?j(W,Ne):void 0}function Ue(e){return"string"==e?M():"("==e?j(U):j(We,Be,He)}function We(e,t){return"{"==e?ae(We,"}"):("variable"==e&&V(t),"*"==t&&(g.marked="keyword"),M(Fe))}function Be(e){if(","==e)return M(We,Be)}function Fe(e,t){if("as"==t)return g.marked="keyword",M(We)}function He(e,t){if("from"==t)return g.marked="keyword",M(U)}function De(e){return"]"==e?M():j(ne(W,"]"))}function Ge(){return j(O("form"),be,S("{"),O("}"),ne(Je,"}"),q,q)}function Je(){return j(be,ge)}function Ke(e,t,r){return t.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return _.lex=!0,q.lex=!0,{startState:function(e){var t={tokenize:v,lastType:"sof",cc:[],lexical:new x((e||0)-i,0,"block",!1),localVars:r.localVars,context:r.localVars&&new z(null,null,!1),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(),w(e,t)),t.tokenize!=k&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=a&&"--"!=a?n:"incdec",function(e,t,r,n,a){var i=e.cc;for(g.state=e,g.stream=a,g.marked=null,g.cc=i,g.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){if((i.length?i.pop():s?U:P)(r,n)){for(;i.length&&i[i.length-1].lex;)i.pop()();return g.marked?g.marked:"variable"==r&&h(e,n)?"variable-2":t}}}(t,r,n,a,e))},indent:function(t,n){if(t.tokenize==k)return e.Pass;if(t.tokenize!=v)return 0;var a,c=n&&n.charAt(0),s=t.lexical;if(!/^\s*else\b/.test(n))for(var u=t.cc.length-1;u>=0;--u){var f=t.cc[u];if(f==q)s=s.prev;else if(f!=Me)break}for(;("stat"==s.type||"form"==s.type)&&("}"==c||(a=t.cc[t.cc.length-1])&&(a==D||a==G)&&!/^[,\.=+\-*:?[\(]/.test(n));)s=s.prev;o&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var l=s.type,p=c==l;return"vardef"==l?s.indented+("operator"==t.lastType||","==t.lastType?s.info.length+1:0):"form"==l&&"{"==c?s.indented:"form"==l?s.indented+i:"stat"==l?s.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||d.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,n)?o||i:0):"switch"!=s.info||p||0==r.doubleIndentSwitch?s.align?s.column+(p?0:1):s.indented+(p?0:i):s.indented+(/^(?:case|default)\b/.test(n)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:c,jsonMode:s,expressionAllowed:Ke,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=U&&t!=W||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})})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/julia/julia.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/julia/julia.js index 6c89684efbf7..3ba10028ca82 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/julia/julia.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/julia/julia.js @@ -1 +1 @@ -!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("julia",(function(t,n){function r(e,t){return void 0===t&&(t="\\b"),new RegExp("^(("+e.join(")|(")+"))"+t)}var i=n.operators||r(["[<>]:","[<>=]=","<<=?",">>>?=?","=>","->","\\/\\/","[\\\\%*+\\-<>!=\\/^|&\\u00F7\\u22BB]=?","\\?","\\$","~",":","\\u00D7","\\u2208","\\u2209","\\u220B","\\u220C","\\u2218","\\u221A","\\u221B","\\u2229","\\u222A","\\u2260","\\u2264","\\u2265","\\u2286","\\u2288","\\u228A","\\u22C5","\\b(in|isa)\\b(?!.?\\()"],""),a=n.delimiters||/^[;,()[\]{}]/,o=n.identifiers||/^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/,s=r(["\\\\[0-7]{1,3}","\\\\x[A-Fa-f0-9]{1,2}","\\\\[abefnrtv0%?'\"\\\\]","([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])"],"'"),c=["if","else","elseif","while","for","begin","let","end","do","try","catch","finally","return","break","continue","global","local","const","export","import","importall","using","function","where","macro","module","baremodule","struct","type","mutable","immutable","quote","typealias","abstract","primitive","bitstype"],u=["true","false","nothing","NaN","Inf"];e.registerHelper("hintWords","julia",c.concat(u));var f=r(["begin","function","type","struct","immutable","let","macro","for","while","quote","if","else","elseif","try","finally","catch","do"]),l=r(["end","else","elseif","catch","finally"]),m=r(c),d=r(u),p=/^@[_A-Za-z][\w]*/,h=/^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/,k=/^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/;function b(e){return e.nestedArrays>0}function v(e,t){return void 0===t&&(t=0),e.scopes.length<=t?null:e.scopes[e.scopes.length-(t+1)]}function F(e,t){if(e.match(/^#=/,!1))return t.tokenize=z,t.tokenize(e,t);var n=t.leavingExpr;if(e.sol()&&(n=!1),t.leavingExpr=!1,n&&e.match(/^'+/))return"operator";if(e.match(/\.{4,}/))return"error";if(e.match(/\.{1,3}/))return"operator";if(e.eatSpace())return null;var r,s=e.peek();if("#"===s)return e.skipToEnd(),"comment";if("["===s&&(t.scopes.push("["),t.nestedArrays++),"("===s&&(t.scopes.push("("),t.nestedGenerators++),b(t)&&"]"===s){for(;"["!==v(t);)t.scopes.pop();t.scopes.pop(),t.nestedArrays--,t.leavingExpr=!0}if(function(e){return e.nestedGenerators>0}(t)&&")"===s){for(;"("!==v(t);)t.scopes.pop();t.scopes.pop(),t.nestedGenerators--,t.leavingExpr=!0}if(b(t)){if("end"==t.lastToken&&e.match(/^:/))return"operator";if(e.match(/^end/))return"number"}if((r=e.match(f,!1))&&t.scopes.push(r[0]),e.match(l,!1)&&t.scopes.pop(),e.match(/^::(?![:\$])/))return t.tokenize=A,t.tokenize(e,t);if(!n&&e.match(h)||e.match(/:([<>]:|<<=?|>>>?=?|->|\/\/|\.{2,3}|[\.\\%*+\-<>!\/^|&]=?|[~\?\$])/))return"builtin";if(e.match(i))return"operator";if(e.match(/^\.?\d/,!1)){var c=RegExp(/^im\b/),u=!1;if(e.match(/^0x\.[0-9a-f_]+p[\+\-]?[_\d]+/i)&&(u=!0),e.match(/^0x[0-9a-f_]+/i)&&(u=!0),e.match(/^0b[01_]+/i)&&(u=!0),e.match(/^0o[0-7_]+/i)&&(u=!0),e.match(/^(?:(?:\d[_\d]*)?\.(?!\.)(?:\d[_\d]*)?|\d[_\d]*\.(?!\.)(?:\d[_\d]*))?([Eef][\+\-]?[_\d]+)?/i)&&(u=!0),e.match(/^\d[_\d]*(e[\+\-]?\d+)?/i)&&(u=!0),u)return e.match(c),t.leavingExpr=!0,"number"}if(e.match(/^'/))return t.tokenize=x,t.tokenize(e,t);if(e.match(k))return t.tokenize=function(e){'"""'===e.substr(-3)?e='"""':'"'===e.substr(-1)&&(e='"');return function(t,n){if(t.eat("\\"))t.next();else{if(t.match(e))return n.tokenize=F,n.leavingExpr=!0,"string";t.eat(/[`"]/)}return t.eatWhile(/[^\\`"]/),"string"}}(e.current()),t.tokenize(e,t);if(e.match(p))return"meta";if(e.match(a))return null;if(e.match(m))return"keyword";if(e.match(d))return"builtin";var y=t.isDefinition||"function"==t.lastToken||"macro"==t.lastToken||"type"==t.lastToken||"struct"==t.lastToken||"immutable"==t.lastToken;return e.match(o)?y?"."===e.peek()?(t.isDefinition=!0,"variable"):(t.isDefinition=!1,"def"):e.match(/^({[^}]*})*\(/,!1)?(t.tokenize=g,t.tokenize(e,t)):(t.leavingExpr=!0,"variable"):(e.next(),"error")}function g(e,t){var n=e.match(/^(\(\s*)/);if(n&&(t.firstParenPos<0&&(t.firstParenPos=t.scopes.length),t.scopes.push("("),t.charsAdvanced+=n[1].length),"("==v(t)&&e.match(/^\)/)&&(t.scopes.pop(),t.charsAdvanced+=1,t.scopes.length<=t.firstParenPos)){var r=e.match(/^(\s*where\s+[^\s=]+)*\s*?=(?!=)/,!1);return e.backUp(t.charsAdvanced),t.firstParenPos=-1,t.charsAdvanced=0,t.tokenize=F,r?"def":"builtin"}if(e.match(/^$/g,!1)){for(e.backUp(t.charsAdvanced);t.scopes.length>t.firstParenPos;)t.scopes.pop();return t.firstParenPos=-1,t.charsAdvanced=0,t.tokenize=F,"builtin"}return t.charsAdvanced+=e.match(/^([^()]*)/)[1].length,t.tokenize(e,t)}function A(e,t){return e.match(/.*?(?=,|;|{|}|\(|\)|=|$|\s)/),e.match(/^{/)?t.nestedParameters++:e.match(/^}/)&&t.nestedParameters>0&&t.nestedParameters--,t.nestedParameters>0?e.match(/.*?(?={|})/)||e.next():0==t.nestedParameters&&(t.tokenize=F),"builtin"}function z(e,t){return e.match(/^#=/)&&t.nestedComments++,e.match(/.*?(?=(#=|=#))/)||e.skipToEnd(),e.match(/^=#/)&&(t.nestedComments--,0==t.nestedComments&&(t.tokenize=F)),"comment"}function x(e,t){var n,r=!1;if(e.match(s))r=!0;else if(n=e.match(/\\u([a-f0-9]{1,4})(?=')/i)){((i=parseInt(n[1],16))<=55295||i>=57344)&&(r=!0,e.next())}else if(n=e.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)){var i;(i=parseInt(n[1],16))<=1114111&&(r=!0,e.next())}return r?(t.leavingExpr=!0,t.tokenize=F,"string"):(e.match(/^[^']+(?=')/)||e.skipToEnd(),e.match(/^'/)&&(t.tokenize=F),"error")}return{startState:function(){return{tokenize:F,scopes:[],lastToken:null,leavingExpr:!1,isDefinition:!1,nestedArrays:0,nestedComments:0,nestedGenerators:0,nestedParameters:0,charsAdvanced:0,firstParenPos:-1}},token:function(e,t){var n=t.tokenize(e,t),r=e.current();return r&&n&&(t.lastToken=r),n},indent:function(e,n){var r=0;return"]"!==n&&")"!==n&&"end"!==n&&"else"!==n&&"catch"!==n&&"elseif"!==n&&"finally"!==n||(r=-1),(e.scopes.length+r)*t.indentUnit},electricInput:/\b(end|else|catch|finally)\b/,blockCommentStart:"#=",blockCommentEnd:"=#",lineComment:"#",closeBrackets:'()[]{}""',fold:"indent"}})),e.defineMIME("text/x-julia","julia")})); \ No newline at end of file +!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("julia",(function(t,n){function r(e,t){return void 0===t&&(t="\\b"),new RegExp("^(("+e.join(")|(")+"))"+t)}var i=n.operators||r(["[<>]:","[<>=]=","<<=?",">>>?=?","=>","->","\\/\\/","[\\\\%*+\\-<>!=\\/^|&\\u00F7\\u22BB]=?","\\?","\\$","~",":","\\u00D7","\\u2208","\\u2209","\\u220B","\\u220C","\\u2218","\\u221A","\\u221B","\\u2229","\\u222A","\\u2260","\\u2264","\\u2265","\\u2286","\\u2288","\\u228A","\\u22C5","\\b(in|isa)\\b(?!.?\\()"],""),a=n.delimiters||/^[;,()[\]{}]/,s=n.identifiers||/^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/,o=r(["\\\\[0-7]{1,3}","\\\\x[A-Fa-f0-9]{1,2}","\\\\[abefnrtv0%?'\"\\\\]","([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])"],"'"),c=["if","else","elseif","while","for","begin","let","end","do","try","catch","finally","return","break","continue","global","local","const","export","import","importall","using","function","where","macro","module","baremodule","struct","type","mutable","immutable","quote","typealias","abstract","primitive","bitstype"],u=["true","false","nothing","NaN","Inf"];e.registerHelper("hintWords","julia",c.concat(u));var l=r(["begin","function","type","struct","immutable","let","macro","for","while","quote","if","else","elseif","try","finally","catch","do"]),f=r(["end","else","elseif","catch","finally"]),m=r(c),d=r(u),p=/^@[_A-Za-z][\w]*/,h=/^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/,b=/^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/;function k(e){return e.nestedArrays>0}function v(e,t){return void 0===t&&(t=0),e.scopes.length<=t?null:e.scopes[e.scopes.length-(t+1)]}function F(e,t){if(e.match(/^#=/,!1))return t.tokenize=z,t.tokenize(e,t);var n=t.leavingExpr;if(e.sol()&&(n=!1),t.leavingExpr=!1,n&&e.match(/^'+/))return"operator";if(e.match(/\.{4,}/))return"error";if(e.match(/\.{1,3}/))return"operator";if(e.eatSpace())return null;var r,o=e.peek();if("#"===o)return e.skipToEnd(),"comment";if("["===o&&(t.scopes.push("["),t.nestedArrays++),"("===o&&(t.scopes.push("("),t.nestedGenerators++),k(t)&&"]"===o){for(;t.scopes.length&&"["!==v(t);)t.scopes.pop();t.scopes.pop(),t.nestedArrays--,t.leavingExpr=!0}if(function(e){return e.nestedGenerators>0}(t)&&")"===o){for(;t.scopes.length&&"("!==v(t);)t.scopes.pop();t.scopes.pop(),t.nestedGenerators--,t.leavingExpr=!0}if(k(t)){if("end"==t.lastToken&&e.match(/^:/))return"operator";if(e.match(/^end/))return"number"}if((r=e.match(l,!1))&&t.scopes.push(r[0]),e.match(f,!1)&&t.scopes.pop(),e.match(/^::(?![:\$])/))return t.tokenize=A,t.tokenize(e,t);if(!n&&e.match(h)||e.match(/:([<>]:|<<=?|>>>?=?|->|\/\/|\.{2,3}|[\.\\%*+\-<>!\/^|&]=?|[~\?\$])/))return"builtin";if(e.match(i))return"operator";if(e.match(/^\.?\d/,!1)){var c=RegExp(/^im\b/),u=!1;if(e.match(/^0x\.[0-9a-f_]+p[\+\-]?[_\d]+/i)&&(u=!0),e.match(/^0x[0-9a-f_]+/i)&&(u=!0),e.match(/^0b[01_]+/i)&&(u=!0),e.match(/^0o[0-7_]+/i)&&(u=!0),e.match(/^(?:(?:\d[_\d]*)?\.(?!\.)(?:\d[_\d]*)?|\d[_\d]*\.(?!\.)(?:\d[_\d]*))?([Eef][\+\-]?[_\d]+)?/i)&&(u=!0),e.match(/^\d[_\d]*(e[\+\-]?\d+)?/i)&&(u=!0),u)return e.match(c),t.leavingExpr=!0,"number"}if(e.match(/^'/))return t.tokenize=x,t.tokenize(e,t);if(e.match(b))return t.tokenize=function(e){'"""'===e.substr(-3)?e='"""':'"'===e.substr(-1)&&(e='"');return function(t,n){if(t.eat("\\"))t.next();else{if(t.match(e))return n.tokenize=F,n.leavingExpr=!0,"string";t.eat(/[`"]/)}return t.eatWhile(/[^\\`"]/),"string"}}(e.current()),t.tokenize(e,t);if(e.match(p))return"meta";if(e.match(a))return null;if(e.match(m))return"keyword";if(e.match(d))return"builtin";var y=t.isDefinition||"function"==t.lastToken||"macro"==t.lastToken||"type"==t.lastToken||"struct"==t.lastToken||"immutable"==t.lastToken;return e.match(s)?y?"."===e.peek()?(t.isDefinition=!0,"variable"):(t.isDefinition=!1,"def"):e.match(/^({[^}]*})*\(/,!1)?(t.tokenize=g,t.tokenize(e,t)):(t.leavingExpr=!0,"variable"):(e.next(),"error")}function g(e,t){var n=e.match(/^(\(\s*)/);if(n&&(t.firstParenPos<0&&(t.firstParenPos=t.scopes.length),t.scopes.push("("),t.charsAdvanced+=n[1].length),"("==v(t)&&e.match(/^\)/)&&(t.scopes.pop(),t.charsAdvanced+=1,t.scopes.length<=t.firstParenPos)){var r=e.match(/^(\s*where\s+[^\s=]+)*\s*?=(?!=)/,!1);return e.backUp(t.charsAdvanced),t.firstParenPos=-1,t.charsAdvanced=0,t.tokenize=F,r?"def":"builtin"}if(e.match(/^$/g,!1)){for(e.backUp(t.charsAdvanced);t.scopes.length>t.firstParenPos;)t.scopes.pop();return t.firstParenPos=-1,t.charsAdvanced=0,t.tokenize=F,"builtin"}return t.charsAdvanced+=e.match(/^([^()]*)/)[1].length,t.tokenize(e,t)}function A(e,t){return e.match(/.*?(?=,|;|{|}|\(|\)|=|$|\s)/),e.match(/^{/)?t.nestedParameters++:e.match(/^}/)&&t.nestedParameters>0&&t.nestedParameters--,t.nestedParameters>0?e.match(/.*?(?={|})/)||e.next():0==t.nestedParameters&&(t.tokenize=F),"builtin"}function z(e,t){return e.match(/^#=/)&&t.nestedComments++,e.match(/.*?(?=(#=|=#))/)||e.skipToEnd(),e.match(/^=#/)&&(t.nestedComments--,0==t.nestedComments&&(t.tokenize=F)),"comment"}function x(e,t){var n,r=!1;if(e.match(o))r=!0;else if(n=e.match(/\\u([a-f0-9]{1,4})(?=')/i)){((i=parseInt(n[1],16))<=55295||i>=57344)&&(r=!0,e.next())}else if(n=e.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)){var i;(i=parseInt(n[1],16))<=1114111&&(r=!0,e.next())}return r?(t.leavingExpr=!0,t.tokenize=F,"string"):(e.match(/^[^']+(?=')/)||e.skipToEnd(),e.match(/^'/)&&(t.tokenize=F),"error")}return{startState:function(){return{tokenize:F,scopes:[],lastToken:null,leavingExpr:!1,isDefinition:!1,nestedArrays:0,nestedComments:0,nestedGenerators:0,nestedParameters:0,charsAdvanced:0,firstParenPos:-1}},token:function(e,t){var n=t.tokenize(e,t),r=e.current();return r&&n&&(t.lastToken=r),n},indent:function(e,n){var r=0;return("]"===n||")"===n||/^end\b/.test(n)||/^else/.test(n)||/^catch\b/.test(n)||/^elseif\b/.test(n)||/^finally/.test(n))&&(r=-1),(e.scopes.length+r)*t.indentUnit},electricInput:/\b(end|else|catch|finally)\b/,blockCommentStart:"#=",blockCommentEnd:"=#",lineComment:"#",closeBrackets:'()[]{}""',fold:"indent"}})),e.defineMIME("text/x-julia","julia")})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/markdown/markdown.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/markdown/markdown.js index bb47baa3174b..be4c4af1965c 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/markdown/markdown.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/markdown/markdown.js @@ -1 +1 @@ -!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],t):t(CodeMirror)}((function(t){"use strict";t.defineMode("markdown",(function(e,i){var n=t.getMode(e,"text/html"),u="null"==n.name;void 0===i.highlightFormatting&&(i.highlightFormatting=!1),void 0===i.maxBlockquoteDepth&&(i.maxBlockquoteDepth=0),void 0===i.taskLists&&(i.taskLists=!1),void 0===i.strikethrough&&(i.strikethrough=!1),void 0===i.emoji&&(i.emoji=!1),void 0===i.fencedCodeBlockHighlighting&&(i.fencedCodeBlockHighlighting=!0),void 0===i.xml&&(i.xml=!0),void 0===i.tokenTypeOverrides&&(i.tokenTypeOverrides={});var r={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var a in r)r.hasOwnProperty(a)&&i.tokenTypeOverrides[a]&&(r[a]=i.tokenTypeOverrides[a]);var l=/^([*\-_])(?:\s*\1){2,}\s*$/,o=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,h=/^\[(x| )\](?=\s)/i,s=i.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,g=/^ *(?:\={1,}|-{1,})\s*$/,m=/^[^#!\[\]*_\\<>` "'(~:]+/,f=/^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/,c=/^\s*\[[^\]]+?\]:.*$/,d=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/;function k(t,e,i){return e.f=e.inline=i,i(t,e)}function F(t,e,i){return e.f=e.block=i,i(t,e)}function D(e){if(e.linkTitle=!1,e.linkHref=!1,e.linkText=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,e.f==E){var i=u;if(!i){var r=t.innerMode(n,e.htmlState);i="xml"==r.mode.name&&null===r.state.tagStart&&!r.state.context&&r.state.tokenize.isInText}i&&(e.f=C,e.block=p,e.htmlState=null)}return e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine={stream:null},null}function p(n,u){var a,m=n.column()===u.indentation,d=!(a=u.prevLine.stream)||!/\S/.test(a.string),F=u.indentedCode,D=u.prevLine.hr,p=!1!==u.list,E=(u.listStack[u.listStack.length-1]||0)+3;u.indentedCode=!1;var S=u.indentation;if(null===u.indentationDiff&&(u.indentationDiff=u.indentation,p)){for(u.list=null;S<u.listStack[u.listStack.length-1];)u.listStack.pop(),u.listStack.length?u.indentation=u.listStack[u.listStack.length-1]:u.list=!1;!1!==u.list&&(u.indentationDiff=S-u.listStack[u.listStack.length-1])}var C=!(d||D||u.prevLine.header||p&&F||u.prevLine.fencedCodeEnd),v=(!1===u.list||D||d)&&u.indentation<=E&&n.match(l),B=null;if(u.indentationDiff>=4&&(F||u.prevLine.fencedCodeEnd||u.prevLine.header||d))return n.skipToEnd(),u.indentedCode=!0,r.code;if(n.eatSpace())return null;if(m&&u.indentation<=E&&(B=n.match(s))&&B[1].length<=6)return u.quote=0,u.header=B[1].length,u.thisLine.header=!0,i.highlightFormatting&&(u.formatting="header"),u.f=u.inline,A(u);if(u.indentation<=E&&n.eat(">"))return u.quote=m?1:u.quote+1,i.highlightFormatting&&(u.formatting="quote"),n.eatSpace(),A(u);if(!v&&!u.setext&&m&&u.indentation<=E&&(B=n.match(o))){var L=B[1]?"ol":"ul";return u.indentation=S+n.current().length,u.list=!0,u.quote=0,u.listStack.push(u.indentation),u.em=!1,u.strong=!1,u.code=!1,u.strikethrough=!1,i.taskLists&&n.match(h,!1)&&(u.taskList=!0),u.f=u.inline,i.highlightFormatting&&(u.formatting=["list","list-"+L]),A(u)}return m&&u.indentation<=E&&(B=n.match(f,!0))?(u.quote=0,u.fencedEndRE=new RegExp(B[1]+"+ *$"),u.localMode=i.fencedCodeBlockHighlighting&&function(i){if(t.findModeByName){var n=t.findModeByName(i);n&&(i=n.mime||n.mimes[0])}var u=t.getMode(e,i);return"null"==u.name?null:u}(B[2]),u.localMode&&(u.localState=t.startState(u.localMode)),u.f=u.block=x,i.highlightFormatting&&(u.formatting="code-block"),u.code=-1,A(u)):u.setext||!(C&&p||u.quote||!1!==u.list||u.code||v||c.test(n.string))&&(B=n.lookAhead(1))&&(B=B.match(g))?(u.setext?(u.header=u.setext,u.setext=0,n.skipToEnd(),i.highlightFormatting&&(u.formatting="header")):(u.header="="==B[0].charAt(0)?1:2,u.setext=u.header),u.thisLine.header=!0,u.f=u.inline,A(u)):v?(n.skipToEnd(),u.hr=!0,u.thisLine.hr=!0,r.hr):"["===n.peek()?k(n,u,T):k(n,u,u.inline)}function E(e,i){var r=n.token(e,i.htmlState);if(!u){var a=t.innerMode(n,i.htmlState);("xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText||i.md_inside&&e.current().indexOf(">")>-1)&&(i.f=C,i.block=p,i.htmlState=null)}return r}function x(t,e){var n,u=e.listStack[e.listStack.length-1]||0,a=e.indentation<u,l=u+3;return e.fencedEndRE&&e.indentation<=l&&(a||t.match(e.fencedEndRE))?(i.highlightFormatting&&(e.formatting="code-block"),a||(n=A(e)),e.localMode=e.localState=null,e.block=p,e.f=C,e.fencedEndRE=null,e.code=0,e.thisLine.fencedCodeEnd=!0,a?F(t,e,e.block):n):e.localMode?e.localMode.token(t,e.localState):(t.skipToEnd(),r.code)}function A(t){var e=[];if(t.formatting){e.push(r.formatting),"string"==typeof t.formatting&&(t.formatting=[t.formatting]);for(var n=0;n<t.formatting.length;n++)e.push(r.formatting+"-"+t.formatting[n]),"header"===t.formatting[n]&&e.push(r.formatting+"-"+t.formatting[n]+"-"+t.header),"quote"===t.formatting[n]&&(!i.maxBlockquoteDepth||i.maxBlockquoteDepth>=t.quote?e.push(r.formatting+"-"+t.formatting[n]+"-"+t.quote):e.push("error"))}if(t.taskOpen)return e.push("meta"),e.length?e.join(" "):null;if(t.taskClosed)return e.push("property"),e.length?e.join(" "):null;if(t.linkHref?e.push(r.linkHref,"url"):(t.strong&&e.push(r.strong),t.em&&e.push(r.em),t.strikethrough&&e.push(r.strikethrough),t.emoji&&e.push(r.emoji),t.linkText&&e.push(r.linkText),t.code&&e.push(r.code),t.image&&e.push(r.image),t.imageAltText&&e.push(r.imageAltText,"link"),t.imageMarker&&e.push(r.imageMarker)),t.header&&e.push(r.header,r.header+"-"+t.header),t.quote&&(e.push(r.quote),!i.maxBlockquoteDepth||i.maxBlockquoteDepth>=t.quote?e.push(r.quote+"-"+t.quote):e.push(r.quote+"-"+i.maxBlockquoteDepth)),!1!==t.list){var u=(t.listStack.length-1)%3;u?1===u?e.push(r.list2):e.push(r.list3):e.push(r.list1)}return t.trailingSpaceNewLine?e.push("trailing-space-new-line"):t.trailingSpace&&e.push("trailing-space-"+(t.trailingSpace%2?"a":"b")),e.length?e.join(" "):null}function S(t,e){if(t.match(m,!0))return A(e)}function C(e,u){var a=u.text(e,u);if(void 0!==a)return a;if(u.list)return u.list=null,A(u);if(u.taskList)return" "===e.match(h,!0)[1]?u.taskOpen=!0:u.taskClosed=!0,i.highlightFormatting&&(u.formatting="task"),u.taskList=!1,A(u);if(u.taskOpen=!1,u.taskClosed=!1,u.header&&e.match(/^#+$/,!0))return i.highlightFormatting&&(u.formatting="header"),A(u);var l=e.next();if(u.linkTitle){u.linkTitle=!1;var o=l;"("===l&&(o=")");var s="^\\s*(?:[^"+(o=(o+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+o;if(e.match(new RegExp(s),!0))return r.linkHref}if("`"===l){var g=u.formatting;i.highlightFormatting&&(u.formatting="code"),e.eatWhile("`");var m=e.current().length;if(0!=u.code||u.quote&&1!=m){if(m==u.code){var f=A(u);return u.code=0,f}return u.formatting=g,A(u)}return u.code=m,A(u)}if(u.code)return A(u);if("\\"===l&&(e.next(),i.highlightFormatting)){var c=A(u),k=r.formatting+"-escape";return c?c+" "+k:k}if("!"===l&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return u.imageMarker=!0,u.image=!0,i.highlightFormatting&&(u.formatting="image"),A(u);if("["===l&&u.imageMarker&&e.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return u.imageMarker=!1,u.imageAltText=!0,i.highlightFormatting&&(u.formatting="image"),A(u);if("]"===l&&u.imageAltText){i.highlightFormatting&&(u.formatting="image");var c=A(u);return u.imageAltText=!1,u.image=!1,u.inline=u.f=B,c}if("["===l&&!u.image)return u.linkText&&e.match(/^.*?\]/)?A(u):(u.linkText=!0,i.highlightFormatting&&(u.formatting="link"),A(u));if("]"===l&&u.linkText){i.highlightFormatting&&(u.formatting="link");var c=A(u);return u.linkText=!1,u.inline=u.f=e.match(/\(.*?\)| ?\[.*?\]/,!1)?B:C,c}if("<"===l&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return u.f=u.inline=v,i.highlightFormatting&&(u.formatting="link"),(c=A(u))?c+=" ":c="",c+r.linkInline;if("<"===l&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return u.f=u.inline=v,i.highlightFormatting&&(u.formatting="link"),(c=A(u))?c+=" ":c="",c+r.linkEmail;if(i.xml&&"<"===l&&e.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var D=e.string.indexOf(">",e.pos);if(-1!=D){var p=e.string.substring(e.start,D);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(p)&&(u.md_inside=!0)}return e.backUp(1),u.htmlState=t.startState(n),F(e,u,E)}if(i.xml&&"<"===l&&e.match(/^\/\w*?>/))return u.md_inside=!1,"tag";if("*"===l||"_"===l){for(var x=1,S=1==e.pos?" ":e.string.charAt(e.pos-2);x<3&&e.eat(l);)x++;var L=e.peek()||" ",T=!/\s/.test(L)&&(!d.test(L)||/\s/.test(S)||d.test(S)),q=!/\s/.test(S)&&(!d.test(S)||/\s/.test(L)||d.test(L)),M=null,b=null;if(x%2&&(u.em||!T||"*"!==l&&q&&!d.test(S)?u.em!=l||!q||"*"!==l&&T&&!d.test(L)||(M=!1):M=!0),x>1&&(u.strong||!T||"*"!==l&&q&&!d.test(S)?u.strong!=l||!q||"*"!==l&&T&&!d.test(L)||(b=!1):b=!0),null!=b||null!=M){i.highlightFormatting&&(u.formatting=null==M?"strong":null==b?"em":"strong em"),!0===M&&(u.em=l),!0===b&&(u.strong=l);f=A(u);return!1===M&&(u.em=!1),!1===b&&(u.strong=!1),f}}else if(" "===l&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return A(u);e.backUp(1)}if(i.strikethrough)if("~"===l&&e.eatWhile(l)){if(u.strikethrough){i.highlightFormatting&&(u.formatting="strikethrough");f=A(u);return u.strikethrough=!1,f}if(e.match(/^[^\s]/,!1))return u.strikethrough=!0,i.highlightFormatting&&(u.formatting="strikethrough"),A(u)}else if(" "===l&&e.match(/^~~/,!0)){if(" "===e.peek())return A(u);e.backUp(2)}if(i.emoji&&":"===l&&e.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){u.emoji=!0,i.highlightFormatting&&(u.formatting="emoji");var w=A(u);return u.emoji=!1,w}return" "===l&&(e.match(/^ +$/,!1)?u.trailingSpace++:u.trailingSpace&&(u.trailingSpaceNewLine=!0)),A(u)}function v(t,e){if(">"===t.next()){e.f=e.inline=C,i.highlightFormatting&&(e.formatting="link");var n=A(e);return n?n+=" ":n="",n+r.linkInline}return t.match(/^[^>]+/,!0),r.linkInline}function B(t,e){if(t.eatSpace())return null;var n,u=t.next();return"("===u||"["===u?(e.f=e.inline=(n="("===u?")":"]",function(t,e){if(t.next()===n){e.f=e.inline=C,i.highlightFormatting&&(e.formatting="link-string");var u=A(e);return e.linkHref=!1,u}return t.match(L[n]),e.linkHref=!0,A(e)}),i.highlightFormatting&&(e.formatting="link-string"),e.linkHref=!0,A(e)):"error"}var L={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function T(t,e){return t.match(/^([^\]\\]|\\.)*\]:/,!1)?(e.f=q,t.next(),i.highlightFormatting&&(e.formatting="link"),e.linkText=!0,A(e)):k(t,e,C)}function q(t,e){if(t.match(/^\]:/,!0)){e.f=e.inline=M,i.highlightFormatting&&(e.formatting="link");var n=A(e);return e.linkText=!1,n}return t.match(/^([^\]\\]|\\.)+/,!0),r.linkText}function M(t,e){return t.eatSpace()?null:(t.match(/^[^\s]+/,!0),void 0===t.peek()?e.linkTitle=!0:t.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),e.f=e.inline=C,r.linkHref+" url")}var b={startState:function(){return{f:p,prevLine:{stream:null},thisLine:{stream:null},block:p,htmlState:null,indentation:0,inline:C,text:S,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(e){return{f:e.f,prevLine:e.prevLine,thisLine:e.thisLine,block:e.block,htmlState:e.htmlState&&t.copyState(n,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?t.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkText:e.linkText,linkTitle:e.linkTitle,linkHref:e.linkHref,code:e.code,em:e.em,strong:e.strong,strikethrough:e.strikethrough,emoji:e.emoji,header:e.header,setext:e.setext,hr:e.hr,taskList:e.taskList,list:e.list,listStack:e.listStack.slice(0),quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside,fencedEndRE:e.fencedEndRE}},token:function(t,e){if(e.formatting=!1,t!=e.thisLine.stream){if(e.header=0,e.hr=!1,t.match(/^\s*$/,!0))return D(e),null;if(e.prevLine=e.thisLine,e.thisLine={stream:t},e.taskList=!1,e.trailingSpace=0,e.trailingSpaceNewLine=!1,!e.localState&&(e.f=e.block,e.f!=E)){var i=t.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(e.indentation=i,e.indentationDiff=null,i>0)return null}}return e.f(t,e)},innerMode:function(t){return t.block==E?{state:t.htmlState,mode:n}:t.localState?{state:t.localState,mode:t.localMode}:{state:t,mode:b}},indent:function(e,i,u){return e.block==E&&n.indent?n.indent(e.htmlState,i,u):e.localState&&e.localMode.indent?e.localMode.indent(e.localState,i,u):t.Pass},blankLine:D,getType:A,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return b}),"xml"),t.defineMIME("text/markdown","markdown"),t.defineMIME("text/x-markdown","markdown")})); \ No newline at end of file +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],t):t(CodeMirror)}((function(t){"use strict";t.defineMode("markdown",(function(e,i){var n=t.getMode(e,"text/html"),u="null"==n.name;void 0===i.highlightFormatting&&(i.highlightFormatting=!1),void 0===i.maxBlockquoteDepth&&(i.maxBlockquoteDepth=0),void 0===i.taskLists&&(i.taskLists=!1),void 0===i.strikethrough&&(i.strikethrough=!1),void 0===i.emoji&&(i.emoji=!1),void 0===i.fencedCodeBlockHighlighting&&(i.fencedCodeBlockHighlighting=!0),void 0===i.fencedCodeBlockDefaultMode&&(i.fencedCodeBlockDefaultMode="text/plain"),void 0===i.xml&&(i.xml=!0),void 0===i.tokenTypeOverrides&&(i.tokenTypeOverrides={});var r={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var a in r)r.hasOwnProperty(a)&&i.tokenTypeOverrides[a]&&(r[a]=i.tokenTypeOverrides[a]);var l=/^([*\-_])(?:\s*\1){2,}\s*$/,o=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,h=/^\[(x| )\](?=\s)/i,s=i.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,g=/^ {0,3}(?:\={1,}|-{2,})\s*$/,m=/^[^#!\[\]*_\\<>` "'(~:]+/,d=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,c=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/;function k(t,e,i){return e.f=e.inline=i,i(t,e)}function F(t,e,i){return e.f=e.block=i,i(t,e)}function D(e){if(e.linkTitle=!1,e.linkHref=!1,e.linkText=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,e.f==E){var i=u;if(!i){var r=t.innerMode(n,e.htmlState);i="xml"==r.mode.name&&null===r.state.tagStart&&!r.state.context&&r.state.tokenize.isInText}i&&(e.f=S,e.block=p,e.htmlState=null)}return e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine={stream:null},null}function p(n,u){var a,m=n.column()===u.indentation,c=!(a=u.prevLine.stream)||!/\S/.test(a.string),F=u.indentedCode,D=u.prevLine.hr,p=!1!==u.list,E=(u.listStack[u.listStack.length-1]||0)+3;u.indentedCode=!1;var C=u.indentation;if(null===u.indentationDiff&&(u.indentationDiff=u.indentation,p)){for(u.list=null;C<u.listStack[u.listStack.length-1];)u.listStack.pop(),u.listStack.length?u.indentation=u.listStack[u.listStack.length-1]:u.list=!1;!1!==u.list&&(u.indentationDiff=C-u.listStack[u.listStack.length-1])}var S=!(c||D||u.prevLine.header||p&&F||u.prevLine.fencedCodeEnd),v=(!1===u.list||D||c)&&u.indentation<=E&&n.match(l),B=null;if(u.indentationDiff>=4&&(F||u.prevLine.fencedCodeEnd||u.prevLine.header||c))return n.skipToEnd(),u.indentedCode=!0,r.code;if(n.eatSpace())return null;if(m&&u.indentation<=E&&(B=n.match(s))&&B[1].length<=6)return u.quote=0,u.header=B[1].length,u.thisLine.header=!0,i.highlightFormatting&&(u.formatting="header"),u.f=u.inline,A(u);if(u.indentation<=E&&n.eat(">"))return u.quote=m?1:u.quote+1,i.highlightFormatting&&(u.formatting="quote"),n.eatSpace(),A(u);if(!v&&!u.setext&&m&&u.indentation<=E&&(B=n.match(o))){var L=B[1]?"ol":"ul";return u.indentation=C+n.current().length,u.list=!0,u.quote=0,u.listStack.push(u.indentation),u.em=!1,u.strong=!1,u.code=!1,u.strikethrough=!1,i.taskLists&&n.match(h,!1)&&(u.taskList=!0),u.f=u.inline,i.highlightFormatting&&(u.formatting=["list","list-"+L]),A(u)}return m&&u.indentation<=E&&(B=n.match(d,!0))?(u.quote=0,u.fencedEndRE=new RegExp(B[1]+"+ *$"),u.localMode=i.fencedCodeBlockHighlighting&&function(i){if(t.findModeByName){var n=t.findModeByName(i);n&&(i=n.mime||n.mimes[0])}var u=t.getMode(e,i);return"null"==u.name?null:u}(B[2]||i.fencedCodeBlockDefaultMode),u.localMode&&(u.localState=t.startState(u.localMode)),u.f=u.block=x,i.highlightFormatting&&(u.formatting="code-block"),u.code=-1,A(u)):u.setext||!(S&&p||u.quote||!1!==u.list||u.code||v||f.test(n.string))&&(B=n.lookAhead(1))&&(B=B.match(g))?(u.setext?(u.header=u.setext,u.setext=0,n.skipToEnd(),i.highlightFormatting&&(u.formatting="header")):(u.header="="==B[0].charAt(0)?1:2,u.setext=u.header),u.thisLine.header=!0,u.f=u.inline,A(u)):v?(n.skipToEnd(),u.hr=!0,u.thisLine.hr=!0,r.hr):"["===n.peek()?k(n,u,T):k(n,u,u.inline)}function E(e,i){var r=n.token(e,i.htmlState);if(!u){var a=t.innerMode(n,i.htmlState);("xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText||i.md_inside&&e.current().indexOf(">")>-1)&&(i.f=S,i.block=p,i.htmlState=null)}return r}function x(t,e){var n,u=e.listStack[e.listStack.length-1]||0,a=e.indentation<u,l=u+3;return e.fencedEndRE&&e.indentation<=l&&(a||t.match(e.fencedEndRE))?(i.highlightFormatting&&(e.formatting="code-block"),a||(n=A(e)),e.localMode=e.localState=null,e.block=p,e.f=S,e.fencedEndRE=null,e.code=0,e.thisLine.fencedCodeEnd=!0,a?F(t,e,e.block):n):e.localMode?e.localMode.token(t,e.localState):(t.skipToEnd(),r.code)}function A(t){var e=[];if(t.formatting){e.push(r.formatting),"string"==typeof t.formatting&&(t.formatting=[t.formatting]);for(var n=0;n<t.formatting.length;n++)e.push(r.formatting+"-"+t.formatting[n]),"header"===t.formatting[n]&&e.push(r.formatting+"-"+t.formatting[n]+"-"+t.header),"quote"===t.formatting[n]&&(!i.maxBlockquoteDepth||i.maxBlockquoteDepth>=t.quote?e.push(r.formatting+"-"+t.formatting[n]+"-"+t.quote):e.push("error"))}if(t.taskOpen)return e.push("meta"),e.length?e.join(" "):null;if(t.taskClosed)return e.push("property"),e.length?e.join(" "):null;if(t.linkHref?e.push(r.linkHref,"url"):(t.strong&&e.push(r.strong),t.em&&e.push(r.em),t.strikethrough&&e.push(r.strikethrough),t.emoji&&e.push(r.emoji),t.linkText&&e.push(r.linkText),t.code&&e.push(r.code),t.image&&e.push(r.image),t.imageAltText&&e.push(r.imageAltText,"link"),t.imageMarker&&e.push(r.imageMarker)),t.header&&e.push(r.header,r.header+"-"+t.header),t.quote&&(e.push(r.quote),!i.maxBlockquoteDepth||i.maxBlockquoteDepth>=t.quote?e.push(r.quote+"-"+t.quote):e.push(r.quote+"-"+i.maxBlockquoteDepth)),!1!==t.list){var u=(t.listStack.length-1)%3;u?1===u?e.push(r.list2):e.push(r.list3):e.push(r.list1)}return t.trailingSpaceNewLine?e.push("trailing-space-new-line"):t.trailingSpace&&e.push("trailing-space-"+(t.trailingSpace%2?"a":"b")),e.length?e.join(" "):null}function C(t,e){if(t.match(m,!0))return A(e)}function S(e,u){var a=u.text(e,u);if(void 0!==a)return a;if(u.list)return u.list=null,A(u);if(u.taskList)return" "===e.match(h,!0)[1]?u.taskOpen=!0:u.taskClosed=!0,i.highlightFormatting&&(u.formatting="task"),u.taskList=!1,A(u);if(u.taskOpen=!1,u.taskClosed=!1,u.header&&e.match(/^#+$/,!0))return i.highlightFormatting&&(u.formatting="header"),A(u);var l=e.next();if(u.linkTitle){u.linkTitle=!1;var o=l;"("===l&&(o=")");var s="^\\s*(?:[^"+(o=(o+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+o;if(e.match(new RegExp(s),!0))return r.linkHref}if("`"===l){var g=u.formatting;i.highlightFormatting&&(u.formatting="code"),e.eatWhile("`");var m=e.current().length;if(0!=u.code||u.quote&&1!=m){if(m==u.code){var d=A(u);return u.code=0,d}return u.formatting=g,A(u)}return u.code=m,A(u)}if(u.code)return A(u);if("\\"===l&&(e.next(),i.highlightFormatting)){var f=A(u),k=r.formatting+"-escape";return f?f+" "+k:k}if("!"===l&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return u.imageMarker=!0,u.image=!0,i.highlightFormatting&&(u.formatting="image"),A(u);if("["===l&&u.imageMarker&&e.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return u.imageMarker=!1,u.imageAltText=!0,i.highlightFormatting&&(u.formatting="image"),A(u);if("]"===l&&u.imageAltText){i.highlightFormatting&&(u.formatting="image");var f=A(u);return u.imageAltText=!1,u.image=!1,u.inline=u.f=B,f}if("["===l&&!u.image)return u.linkText&&e.match(/^.*?\]/)?A(u):(u.linkText=!0,i.highlightFormatting&&(u.formatting="link"),A(u));if("]"===l&&u.linkText){i.highlightFormatting&&(u.formatting="link");var f=A(u);return u.linkText=!1,u.inline=u.f=e.match(/\(.*?\)| ?\[.*?\]/,!1)?B:S,f}if("<"===l&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return u.f=u.inline=v,i.highlightFormatting&&(u.formatting="link"),(f=A(u))?f+=" ":f="",f+r.linkInline;if("<"===l&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return u.f=u.inline=v,i.highlightFormatting&&(u.formatting="link"),(f=A(u))?f+=" ":f="",f+r.linkEmail;if(i.xml&&"<"===l&&e.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var D=e.string.indexOf(">",e.pos);if(-1!=D){var p=e.string.substring(e.start,D);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(p)&&(u.md_inside=!0)}return e.backUp(1),u.htmlState=t.startState(n),F(e,u,E)}if(i.xml&&"<"===l&&e.match(/^\/\w*?>/))return u.md_inside=!1,"tag";if("*"===l||"_"===l){for(var x=1,C=1==e.pos?" ":e.string.charAt(e.pos-2);x<3&&e.eat(l);)x++;var L=e.peek()||" ",T=!/\s/.test(L)&&(!c.test(L)||/\s/.test(C)||c.test(C)),M=!/\s/.test(C)&&(!c.test(C)||/\s/.test(L)||c.test(L)),q=null,b=null;if(x%2&&(u.em||!T||"*"!==l&&M&&!c.test(C)?u.em!=l||!M||"*"!==l&&T&&!c.test(L)||(q=!1):q=!0),x>1&&(u.strong||!T||"*"!==l&&M&&!c.test(C)?u.strong!=l||!M||"*"!==l&&T&&!c.test(L)||(b=!1):b=!0),null!=b||null!=q){i.highlightFormatting&&(u.formatting=null==q?"strong":null==b?"em":"strong em"),!0===q&&(u.em=l),!0===b&&(u.strong=l);d=A(u);return!1===q&&(u.em=!1),!1===b&&(u.strong=!1),d}}else if(" "===l&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return A(u);e.backUp(1)}if(i.strikethrough)if("~"===l&&e.eatWhile(l)){if(u.strikethrough){i.highlightFormatting&&(u.formatting="strikethrough");d=A(u);return u.strikethrough=!1,d}if(e.match(/^[^\s]/,!1))return u.strikethrough=!0,i.highlightFormatting&&(u.formatting="strikethrough"),A(u)}else if(" "===l&&e.match(/^~~/,!0)){if(" "===e.peek())return A(u);e.backUp(2)}if(i.emoji&&":"===l&&e.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){u.emoji=!0,i.highlightFormatting&&(u.formatting="emoji");var w=A(u);return u.emoji=!1,w}return" "===l&&(e.match(/^ +$/,!1)?u.trailingSpace++:u.trailingSpace&&(u.trailingSpaceNewLine=!0)),A(u)}function v(t,e){if(">"===t.next()){e.f=e.inline=S,i.highlightFormatting&&(e.formatting="link");var n=A(e);return n?n+=" ":n="",n+r.linkInline}return t.match(/^[^>]+/,!0),r.linkInline}function B(t,e){if(t.eatSpace())return null;var n,u=t.next();return"("===u||"["===u?(e.f=e.inline=(n="("===u?")":"]",function(t,e){if(t.next()===n){e.f=e.inline=S,i.highlightFormatting&&(e.formatting="link-string");var u=A(e);return e.linkHref=!1,u}return t.match(L[n]),e.linkHref=!0,A(e)}),i.highlightFormatting&&(e.formatting="link-string"),e.linkHref=!0,A(e)):"error"}var L={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function T(t,e){return t.match(/^([^\]\\]|\\.)*\]:/,!1)?(e.f=M,t.next(),i.highlightFormatting&&(e.formatting="link"),e.linkText=!0,A(e)):k(t,e,S)}function M(t,e){if(t.match(/^\]:/,!0)){e.f=e.inline=q,i.highlightFormatting&&(e.formatting="link");var n=A(e);return e.linkText=!1,n}return t.match(/^([^\]\\]|\\.)+/,!0),r.linkText}function q(t,e){return t.eatSpace()?null:(t.match(/^[^\s]+/,!0),void 0===t.peek()?e.linkTitle=!0:t.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),e.f=e.inline=S,r.linkHref+" url")}var b={startState:function(){return{f:p,prevLine:{stream:null},thisLine:{stream:null},block:p,htmlState:null,indentation:0,inline:S,text:C,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(e){return{f:e.f,prevLine:e.prevLine,thisLine:e.thisLine,block:e.block,htmlState:e.htmlState&&t.copyState(n,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?t.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkText:e.linkText,linkTitle:e.linkTitle,linkHref:e.linkHref,code:e.code,em:e.em,strong:e.strong,strikethrough:e.strikethrough,emoji:e.emoji,header:e.header,setext:e.setext,hr:e.hr,taskList:e.taskList,list:e.list,listStack:e.listStack.slice(0),quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside,fencedEndRE:e.fencedEndRE}},token:function(t,e){if(e.formatting=!1,t!=e.thisLine.stream){if(e.header=0,e.hr=!1,t.match(/^\s*$/,!0))return D(e),null;if(e.prevLine=e.thisLine,e.thisLine={stream:t},e.taskList=!1,e.trailingSpace=0,e.trailingSpaceNewLine=!1,!e.localState&&(e.f=e.block,e.f!=E)){var i=t.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(e.indentation=i,e.indentationDiff=null,i>0)return null}}return e.f(t,e)},innerMode:function(t){return t.block==E?{state:t.htmlState,mode:n}:t.localState?{state:t.localState,mode:t.localMode}:{state:t,mode:b}},indent:function(e,i,u){return e.block==E&&n.indent?n.indent(e.htmlState,i,u):e.localState&&e.localMode.indent?e.localMode.indent(e.localState,i,u):t.Pass},blankLine:D,getType:A,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return b}),"xml"),t.defineMIME("text/markdown","markdown"),t.defineMIME("text/x-markdown","markdown")})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/meta.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/meta.js index 1da5b780d6db..1b77e3a09cea 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/meta.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/meta.js @@ -1 +1 @@ -!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.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{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","ino"]},{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","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{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",mimes:["application/vnd.coffeescript","text/coffeescript","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"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{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"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],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:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{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"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{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",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{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"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{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",mimes:["text/x-sh","application/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"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{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:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{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:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{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"]}];for(var m=0;m<e.modeInfo.length;m++){var t=e.modeInfo[m];t.mimes&&(t.mime=t.mimes[0])}e.findModeByMIME=function(m){m=m.toLowerCase();for(var t=0;t<e.modeInfo.length;t++){var a=e.modeInfo[t];if(a.mime==m)return a;if(a.mimes)for(var i=0;i<a.mimes.length;i++)if(a.mimes[i]==m)return a}return/\+xml$/.test(m)?e.findModeByMIME("application/xml"):/\+json$/.test(m)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(m){m=m.toLowerCase();for(var t=0;t<e.modeInfo.length;t++){var a=e.modeInfo[t];if(a.ext)for(var i=0;i<a.ext.length;i++)if(a.ext[i]==m)return a}},e.findModeByFileName=function(m){for(var t=0;t<e.modeInfo.length;t++){var a=e.modeInfo[t];if(a.file&&a.file.test(m))return a}var i=m.lastIndexOf("."),x=i>-1&&m.substring(i+1,m.length);if(x)return e.findModeByExtension(x)},e.findModeByName=function(m){m=m.toLowerCase();for(var t=0;t<e.modeInfo.length;t++){var a=e.modeInfo[t];if(a.name.toLowerCase()==m)return a;if(a.alias)for(var i=0;i<a.alias.length;i++)if(a.alias[i].toLowerCase()==m)return a}}})); \ No newline at end of file +!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.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{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","ino"]},{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","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{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",mimes:["application/vnd.coffeescript","text/coffeescript","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"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{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"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],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:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{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"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{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",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{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"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{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",mimes:["text/x-sh","application/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"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{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:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{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:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{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"]}];for(var m=0;m<e.modeInfo.length;m++){var t=e.modeInfo[m];t.mimes&&(t.mime=t.mimes[0])}e.findModeByMIME=function(m){m=m.toLowerCase();for(var t=0;t<e.modeInfo.length;t++){var a=e.modeInfo[t];if(a.mime==m)return a;if(a.mimes)for(var i=0;i<a.mimes.length;i++)if(a.mimes[i]==m)return a}return/\+xml$/.test(m)?e.findModeByMIME("application/xml"):/\+json$/.test(m)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(m){m=m.toLowerCase();for(var t=0;t<e.modeInfo.length;t++){var a=e.modeInfo[t];if(a.ext)for(var i=0;i<a.ext.length;i++)if(a.ext[i]==m)return a}},e.findModeByFileName=function(m){for(var t=0;t<e.modeInfo.length;t++){var a=e.modeInfo[t];if(a.file&&a.file.test(m))return a}var i=m.lastIndexOf("."),x=i>-1&&m.substring(i+1,m.length);if(x)return e.findModeByExtension(x)},e.findModeByName=function(m){m=m.toLowerCase();for(var t=0;t<e.modeInfo.length;t++){var a=e.modeInfo[t];if(a.name.toLowerCase()==m)return a;if(a.alias)for(var i=0;i<a.alias.length;i++)if(a.alias[i].toLowerCase()==m)return a}}})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/nsis/nsis.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/nsis/nsis.js index 8fa87b6bce67..2dad4af08727 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/nsis/nsis.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/nsis/nsis.js @@ -1 +1 @@ -!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";e.defineSimpleMode("nsis",{start:[{regex:/(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/,token:"number"},{regex:/"(?:[^\\"]|\\.)*"?/,token:"string"},{regex:/'(?:[^\\']|\\.)*'?/,token:"string"},{regex:/`(?:[^\\`]|\\.)*`?/,token:"string"},{regex:/^\s*(?:\!(include|addincludedir|addplugindir|appendfile|cd|delfile|echo|error|execute|packhdr|pragma|finalize|getdllversion|gettlbversion|system|tempfile|warning|verbose|define|undef|insertmacro|macro|macroend|makensis|searchparse|searchreplace))\b/,token:"keyword"},{regex:/^\s*(?:\!(if(?:n?def)?|ifmacron?def|macro))\b/,token:"keyword",indent:!0},{regex:/^\s*(?:\!(else|endif|macroend))\b/,token:"keyword",dedent:!0},{regex:/^\s*(?: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|ExecShellWait|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|Int64Cmp|Int64CmpU|Int64Fmt|IntCmp|IntCmpU|IntFmt|IntOp|IntPtrCmp|IntPtrCmpU|IntPtrOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadAndSetImage|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestLongPathAware|ManifestMaxVersionTested|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|PEAddResource|PEDllCharacteristics|PERemoveResource|PESubsysVer|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|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|WriteRegMultiStr|WriteRegNone|WriteRegStr|WriteUninstaller|XPStyle)\b/,token:"keyword"},{regex:/^\s*(?:Function|PageEx|Section(?:Group)?)\b/,token:"keyword",indent:!0},{regex:/^\s*(?:(Function|PageEx|Section(?:Group)?)End)\b/,token:"keyword",dedent:!0},{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(32|64)?|HKCU(32|64)?|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM(32|64)?|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|false|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|off|on|right|show|silent|silentlog|textonly|top|true|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|WinVista|zlib)\b/,token:"builtin"},{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:!0},{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:!0},{regex:/\$\{(?:Memento(?:Section(?:Done|End|Restore|Save)?|UnselectedSection))\}/,token:"variable-2",dedent:!0},{regex:/\$\{(?:Config(?:Read|ReadS|Write|WriteS)|File(?:Join|ReadFromEnd|Recode)|Line(?:Find|Read|Sum)|Text(?:Compare|CompareS)|TrimNewLines)\}/,token:"variable-2",dedent:!0},{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:!0},{regex:/\$\{(?:StrFilterS?|Version(?:Compare|Convert)|Word(?:AddS?|Find(?:(?:2|3)X)?S?|InsertS?|ReplaceS?))\}/,token:"variable-2",dedent:!0},{regex:/\$\{(?:RunningX64)\}/,token:"variable",dedent:!0},{regex:/\$\{(?:Disable|Enable)X64FSRedirection\}/,token:"variable-2",dedent:!0},{regex:/(#|;).*/,token:"comment"},{regex:/\/\*/,token:"comment",next:"comment"},{regex:/[-+\/*=<>!]+/,token:"operator"},{regex:/\$\w+/,token:"variable"},{regex:/\${[\w\.:-]+}/,token:"variable-2"},{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:["#",";"]}}),e.defineMIME("text/x-nsis","nsis")})); \ No newline at end of file +!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";e.defineSimpleMode("nsis",{start:[{regex:/(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/,token:"number"},{regex:/"(?:[^\\"]|\\.)*"?/,token:"string"},{regex:/'(?:[^\\']|\\.)*'?/,token:"string"},{regex:/`(?:[^\\`]|\\.)*`?/,token:"string"},{regex:/^\s*(?:\!(include|addincludedir|addplugindir|appendfile|cd|delfile|echo|error|execute|packhdr|pragma|finalize|getdllversion|gettlbversion|system|tempfile|warning|verbose|define|undef|insertmacro|macro|macroend|makensis|searchparse|searchreplace))\b/,token:"keyword"},{regex:/^\s*(?:\!(if(?:n?def)?|ifmacron?def|macro))\b/,token:"keyword",indent:!0},{regex:/^\s*(?:\!(else|endif|macroend))\b/,token:"keyword",dedent:!0},{regex:/^\s*(?: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|ExecShellWait|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|GetKnownFolderPath|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfRtlLanguage|IfShellVarContextAll|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|Int64Cmp|Int64CmpU|Int64Fmt|IntCmp|IntCmpU|IntFmt|IntOp|IntPtrCmp|IntPtrCmpU|IntPtrOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadAndSetImage|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestLongPathAware|ManifestMaxVersionTested|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|PEAddResource|PEDllCharacteristics|PERemoveResource|PESubsysVer|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|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|WriteRegMultiStr|WriteRegNone|WriteRegStr|WriteUninstaller|XPStyle)\b/,token:"keyword"},{regex:/^\s*(?:Function|PageEx|Section(?:Group)?)\b/,token:"keyword",indent:!0},{regex:/^\s*(?:(Function|PageEx|Section(?:Group)?)End)\b/,token:"keyword",dedent:!0},{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(32|64)?|HKCU(32|64)?|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM(32|64)?|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|false|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|off|on|right|show|silent|silentlog|textonly|top|true|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|WinVista|zlib)\b/,token:"builtin"},{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:!0},{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:!0},{regex:/\$\{(?:Memento(?:Section(?:Done|End|Restore|Save)?|UnselectedSection))\}/,token:"variable-2",dedent:!0},{regex:/\$\{(?:Config(?:Read|ReadS|Write|WriteS)|File(?:Join|ReadFromEnd|Recode)|Line(?:Find|Read|Sum)|Text(?:Compare|CompareS)|TrimNewLines)\}/,token:"variable-2",dedent:!0},{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:!0},{regex:/\$\{(?:StrFilterS?|Version(?:Compare|Convert)|Word(?:AddS?|Find(?:(?:2|3)X)?S?|InsertS?|ReplaceS?))\}/,token:"variable-2",dedent:!0},{regex:/\$\{(?:RunningX64)\}/,token:"variable",dedent:!0},{regex:/\$\{(?:Disable|Enable)X64FSRedirection\}/,token:"variable-2",dedent:!0},{regex:/(#|;).*/,token:"comment"},{regex:/\/\*/,token:"comment",next:"comment"},{regex:/[-+\/*=<>!]+/,token:"operator"},{regex:/\$\w+/,token:"variable"},{regex:/\${[\w\.:-]+}/,token:"variable-2"},{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:["#",";"]}}),e.defineMIME("text/x-nsis","nsis")})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/pascal/pascal.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/pascal/pascal.js index e13db8f76c83..3bad8f6f88df 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/pascal/pascal.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/pascal/pascal.js @@ -1 +1 @@ -!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("pascal",(function(){var e=function(e){for(var r={},t=e.split(" "),n=0;n<t.length;++n)r[t[n]]=!0;return r}("absolute and array asm begin case const constructor destructor div do downto else end file for function goto if implementation in inherited inline interface label mod nil not object of operator or packed procedure program record reintroduce repeat self set shl shr string then to type unit until uses var while with xor as class dispinterface except exports finalization finally initialization inline is library on out packed property raise resourcestring threadvar try absolute abstract alias assembler bitpacked break cdecl continue cppdecl cvar default deprecated dynamic enumerator experimental export external far far16 forward generic helper implements index interrupt iocheck local message name near nodefault noreturn nostackframe oldfpccall otherwise overload override pascal platform private protected public published read register reintroduce result safecall saveregisters softfloat specialize static stdcall stored strict unaligned unimplemented varargs virtual write"),r={null:!0},t=/[+\-*&%=<>!?|\/]/;function n(n,a){var o,l=n.next();if("#"==l&&a.startOfLine)return n.skipToEnd(),"meta";if('"'==l||"'"==l)return a.tokenize=(o=l,function(e,r){for(var t,n=!1,i=!1;null!=(t=e.next());){if(t==o&&!n){i=!0;break}n=!n&&"\\"==t}return!i&&n||(r.tokenize=null),"string"}),a.tokenize(n,a);if("("==l&&n.eat("*"))return a.tokenize=i,i(n,a);if(/[\[\]{}\(\),;\:\.]/.test(l))return null;if(/\d/.test(l))return n.eatWhile(/[\w\.]/),"number";if("/"==l&&n.eat("/"))return n.skipToEnd(),"comment";if(t.test(l))return n.eatWhile(t),"operator";n.eatWhile(/[\w\$_]/);var c=n.current();return e.propertyIsEnumerable(c)?"keyword":r.propertyIsEnumerable(c)?"atom":"variable"}function i(e,r){for(var t,n=!1;t=e.next();){if(")"==t&&n){r.tokenize=null;break}n="*"==t}return"comment"}return{startState:function(){return{tokenize:null}},token:function(e,r){if(e.eatSpace())return null;var t=(r.tokenize||n)(e,r);return t},electricChars:"{}"}})),e.defineMIME("text/x-pascal","pascal")})); \ No newline at end of file +!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("pascal",(function(){var e=function(e){for(var r={},t=e.split(" "),n=0;n<t.length;++n)r[t[n]]=!0;return r}("absolute and array asm begin case const constructor destructor div do downto else end file for function goto if implementation in inherited inline interface label mod nil not object of operator or packed procedure program record reintroduce repeat self set shl shr string then to type unit until uses var while with xor as class dispinterface except exports finalization finally initialization inline is library on out packed property raise resourcestring threadvar try absolute abstract alias assembler bitpacked break cdecl continue cppdecl cvar default deprecated dynamic enumerator experimental export external far far16 forward generic helper implements index interrupt iocheck local message name near nodefault noreturn nostackframe oldfpccall otherwise overload override pascal platform private protected public published read register reintroduce result safecall saveregisters softfloat specialize static stdcall stored strict unaligned unimplemented varargs virtual write"),r={null:!0},t=/[+\-*&%=<>!?|\/]/;function n(n,o){var l,c=n.next();if("#"==c&&o.startOfLine)return n.skipToEnd(),"meta";if('"'==c||"'"==c)return o.tokenize=(l=c,function(e,r){for(var t,n=!1,i=!1;null!=(t=e.next());){if(t==l&&!n){i=!0;break}n=!n&&"\\"==t}return!i&&n||(r.tokenize=null),"string"}),o.tokenize(n,o);if("("==c&&n.eat("*"))return o.tokenize=i,i(n,o);if("{"==c)return o.tokenize=a,a(n,o);if(/[\[\]\(\),;\:\.]/.test(c))return null;if(/\d/.test(c))return n.eatWhile(/[\w\.]/),"number";if("/"==c&&n.eat("/"))return n.skipToEnd(),"comment";if(t.test(c))return n.eatWhile(t),"operator";n.eatWhile(/[\w\$_]/);var u=n.current();return e.propertyIsEnumerable(u)?"keyword":r.propertyIsEnumerable(u)?"atom":"variable"}function i(e,r){for(var t,n=!1;t=e.next();){if(")"==t&&n){r.tokenize=null;break}n="*"==t}return"comment"}function a(e,r){for(var t;t=e.next();)if("}"==t){r.tokenize=null;break}return"comment"}return{startState:function(){return{tokenize:null}},token:function(e,r){if(e.eatSpace())return null;var t=(r.tokenize||n)(e,r);return t},electricChars:"{}"}})),e.defineMIME("text/x-pascal","pascal")})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/powershell/powershell.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/powershell/powershell.js index 04f0d8e8b9fb..8aeaa2768977 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/powershell/powershell.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/powershell/powershell.js @@ -1 +1 @@ -!function(e){"use strict";"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(window.CodeMirror)}((function(e){"use strict";e.defineMode("powershell",(function(){function e(e,t){for(var r=void 0!==(t=t||{}).prefix?t.prefix:"^",n=void 0!==t.suffix?t.suffix:"\\b",o=0;o<e.length;o++)e[o]instanceof RegExp?e[o]=e[o].source:e[o]=e[o].replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return new RegExp(r+"("+e.join("|")+")"+n,"i")}var t=/[\w\-:]/,r=e([/begin|break|catch|continue|data|default|do|dynamicparam/,/else|elseif|end|exit|filter|finally|for|foreach|from|function|if|in/,/param|process|return|switch|throw|trap|try|until|where|while/],{suffix:"(?=[^A-Za-z\\d\\-_]|$)"}),n=e(["f",/b?not/,/[ic]?split/,"join",/is(not)?/,"as",/[ic]?(eq|ne|[gl][te])/,/[ic]?(not)?(like|match|contains)/,/[ic]?replace/,/b?(and|or|xor)/],{prefix:"-"}),o=e([n,/[+\-*\/%]=|\+\+|--|\.\.|[+\-*&^%:=!|\/]|<(?!#)|(?!#)>/],{suffix:""}),i=e([/Add-(Computer|Content|History|Member|PSSnapin|Type)/,/Checkpoint-Computer/,/Clear-(Content|EventLog|History|Host|Item(Property)?|Variable)/,/Compare-Object/,/Complete-Transaction/,/Connect-PSSession/,/ConvertFrom-(Csv|Json|SecureString|StringData)/,/Convert-Path/,/ConvertTo-(Csv|Html|Json|SecureString|Xml)/,/Copy-Item(Property)?/,/Debug-Process/,/Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,/Disconnect-PSSession/,/Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,/(Enter|Exit)-PSSession/,/Export-(Alias|Clixml|Console|Counter|Csv|FormatData|ModuleMember|PSSession)/,/ForEach-Object/,/Format-(Custom|List|Table|Wide)/,new RegExp("Get-(Acl|Alias|AuthenticodeSignature|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Counter|Credential|Culture|Date|Event|EventLog|EventSubscriber|ExecutionPolicy|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|PfxCertificate|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|Verb|WinEvent|WmiObject)"),/Group-Object/,/Import-(Alias|Clixml|Counter|Csv|LocalizedData|Module|PSSession)/,/ImportSystemModules/,/Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)/,/Join-Path/,/Limit-EventLog/,/Measure-(Command|Object)/,/Move-Item(Property)?/,new RegExp("New-(Alias|Event|EventLog|Item(Property)?|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy|WinEvent)"),/Out-(Default|File|GridView|Host|Null|Printer|String)/,/Pause/,/(Pop|Push)-Location/,/Read-Host/,/Receive-(Job|PSSession)/,/Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)/,/Remove-(Computer|Event|EventLog|Item(Property)?|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)/,/Rename-(Computer|Item(Property)?)/,/Reset-ComputerMachinePassword/,/Resolve-Path/,/Restart-(Computer|Service)/,/Restore-Computer/,/Resume-(Job|Service)/,/Save-Help/,/Select-(Object|String|Xml)/,/Send-MailMessage/,new RegExp("Set-(Acl|Alias|AuthenticodeSignature|Content|Date|ExecutionPolicy|Item(Property)?|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)"),/Show-(Command|ControlPanelItem|EventLog)/,/Sort-Object/,/Split-Path/,/Start-(Job|Process|Service|Sleep|Transaction|Transcript)/,/Stop-(Computer|Job|Process|Service|Transcript)/,/Suspend-(Job|Service)/,/TabExpansion2/,/Tee-Object/,/Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)/,/Trace-Command/,/Unblock-File/,/Undo-Transaction/,/Unregister-(Event|PSSessionConfiguration)/,/Update-(FormatData|Help|List|TypeData)/,/Use-Transaction/,/Wait-(Event|Job|Process)/,/Where-Object/,/Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning)/,/cd|help|mkdir|more|oss|prompt/,/ac|asnp|cat|cd|chdir|clc|clear|clhy|cli|clp|cls|clv|cnsn|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|dnsn|ebp/,/echo|epal|epcsv|epsn|erase|etsn|exsn|fc|fl|foreach|ft|fw|gal|gbp|gc|gci|gcm|gcs|gdr|ghy|gi|gjb|gl|gm|gmo|gp|gps/,/group|gsn|gsnp|gsv|gu|gv|gwmi|h|history|icm|iex|ihy|ii|ipal|ipcsv|ipmo|ipsn|irm|ise|iwmi|iwr|kill|lp|ls|man|md/,/measure|mi|mount|move|mp|mv|nal|ndr|ni|nmo|npssc|nsn|nv|ogv|oh|popd|ps|pushd|pwd|r|rbp|rcjb|rcsn|rd|rdr|ren|ri/,/rjb|rm|rmdir|rmo|rni|rnp|rp|rsn|rsnp|rujb|rv|rvpa|rwmi|sajb|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls/,/sort|sp|spjb|spps|spsv|start|sujb|sv|swmi|tee|trcm|type|where|wjb|write/],{prefix:"",suffix:""}),a=e([/[$?^_]|Args|ConfirmPreference|ConsoleFileName|DebugPreference|Error|ErrorActionPreference|ErrorView|ExecutionContext/,/FormatEnumerationLimit|Home|Host|Input|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount/,/MaximumHistoryCount|MaximumVariableCount|MyInvocation|NestedPromptLevel|OutputEncoding|Pid|Profile|ProgressPreference/,/PSBoundParameters|PSCommandPath|PSCulture|PSDefaultParameterValues|PSEmailServer|PSHome|PSScriptRoot|PSSessionApplicationName/,/PSSessionConfigurationName|PSSessionOption|PSUICulture|PSVersionTable|Pwd|ShellId|StackTrace|VerbosePreference/,/WarningPreference|WhatIfPreference/,/Event|EventArgs|EventSubscriber|Sender/,/Matches|Ofs|ForEach|LastExitCode|PSCmdlet|PSItem|PSSenderInfo|This/,/true|false|null/],{prefix:"\\$",suffix:""}),s={keyword:r,number:/^((0x[\da-f]+)|((\d+\.\d+|\d\.|\.\d+|\d+)(e[\+\-]?\d+)?))[ld]?([kmgtp]b)?/i,operator:o,builtin:e([/[A-Z]:|%|\?/i,i,a],{suffix:"(?=[^A-Za-z\\d\\-_]|$)"}),punctuation:/[\[\]{},;`\.]|@[({]/,identifier:/^[A-Za-z\_][A-Za-z\-\_\d]*\b/};function u(e,r){var n=r.returnStack[r.returnStack.length-1];if(n&&n.shouldReturnFrom(r))return r.tokenize=n.tokenize,r.returnStack.pop(),r.tokenize(e,r);if(e.eatSpace())return null;if(e.eat("("))return r.bracketNesting+=1,"punctuation";if(e.eat(")"))return r.bracketNesting-=1,"punctuation";for(var o in s)if(e.match(s[o]))return o;var i=e.next();if("'"===i)return function(e,t){var r;for(;null!=(r=e.peek());)if(e.next(),"'"===r&&!e.eat("'"))return t.tokenize=u,"string";return"error"}(e,r);if("$"===i)return d(e,r);if('"'===i)return c(e,r);if("<"===i&&e.eat("#"))return r.tokenize=S,S(e,r);if("#"===i)return e.skipToEnd(),"comment";if("@"===i){var a=e.eat(/["']/);if(a&&e.eol())return r.tokenize=b,r.startQuote=a[0],b(e,r);if(e.eol())return"error";if(e.peek().match(/[({]/))return"punctuation";if(e.peek().match(t))return d(e,r)}return"error"}function c(e,t){for(var r;null!=(r=e.peek());){if("$"===r)return t.tokenize=l,"string";if(e.next(),"`"!==r){if('"'===r&&!e.eat('"'))return t.tokenize=u,"string"}else e.next()}return"error"}function l(e,t){return f(e,t,c)}function p(e,t){return t.tokenize=b,t.startQuote='"',b(e,t)}function m(e,t){return f(e,t,p)}function f(e,t,r){if(e.match("$(")){var n=t.bracketNesting;return t.returnStack.push({shouldReturnFrom:function(e){return e.bracketNesting===n},tokenize:r}),t.tokenize=u,t.bracketNesting+=1,"punctuation"}return e.next(),t.returnStack.push({shouldReturnFrom:function(){return!0},tokenize:r}),t.tokenize=d,t.tokenize(e,t)}function S(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&">"==r){t.tokenize=u;break}n="#"===r}return"comment"}function d(e,r){var n=e.peek();return e.eat("{")?(r.tokenize=P,P(e,r)):null!=n&&n.match(t)?(e.eatWhile(t),r.tokenize=u,"variable-2"):(r.tokenize=u,"error")}function P(e,t){for(var r;null!=(r=e.next());)if("}"===r){t.tokenize=u;break}return"variable-2"}function b(e,t){var r=t.startQuote;if(e.sol()&&e.match(new RegExp(r+"@")))t.tokenize=u;else if('"'===r)for(;!e.eol();){var n=e.peek();if("$"===n)return t.tokenize=m,"string";e.next(),"`"===n&&e.next()}else e.skipToEnd();return"string"}return{startState:function(){return{returnStack:[],bracketNesting:0,tokenize:u}},token:function(e,t){return t.tokenize(e,t)},blockCommentStart:"<#",blockCommentEnd:"#>",lineComment:"#",fold:"brace"}})),e.defineMIME("application/x-powershell","powershell")})); \ No newline at end of file +!function(e){"use strict";"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(window.CodeMirror)}((function(e){"use strict";e.defineMode("powershell",(function(){function e(e,t){for(var r=void 0!==(t=t||{}).prefix?t.prefix:"^",n=void 0!==t.suffix?t.suffix:"\\b",o=0;o<e.length;o++)e[o]instanceof RegExp?e[o]=e[o].source:e[o]=e[o].replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return new RegExp(r+"("+e.join("|")+")"+n,"i")}var t=/[\w\-:]/,r=e([/begin|break|catch|continue|data|default|do|dynamicparam/,/else|elseif|end|exit|filter|finally|for|foreach|from|function|if|in/,/param|process|return|switch|throw|trap|try|until|where|while/],{suffix:"(?=[^A-Za-z\\d\\-_]|$)"}),n=e(["f",/b?not/,/[ic]?split/,"join",/is(not)?/,"as",/[ic]?(eq|ne|[gl][te])/,/[ic]?(not)?(like|match|contains)/,/[ic]?replace/,/b?(and|or|xor)/],{prefix:"-"}),o=e([n,/[+\-*\/%]=|\+\+|--|\.\.|[+\-*&^%:=!|\/]|<(?!#)|(?!#)>/],{suffix:""}),i=e([/Add-(Computer|Content|History|Member|PSSnapin|Type)/,/Checkpoint-Computer/,/Clear-(Content|EventLog|History|Host|Item(Property)?|Variable)/,/Compare-Object/,/Complete-Transaction/,/Connect-PSSession/,/ConvertFrom-(Csv|Json|SecureString|StringData)/,/Convert-Path/,/ConvertTo-(Csv|Html|Json|SecureString|Xml)/,/Copy-Item(Property)?/,/Debug-Process/,/Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,/Disconnect-PSSession/,/Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,/(Enter|Exit)-PSSession/,/Export-(Alias|Clixml|Console|Counter|Csv|FormatData|ModuleMember|PSSession)/,/ForEach-Object/,/Format-(Custom|List|Table|Wide)/,new RegExp("Get-(Acl|Alias|AuthenticodeSignature|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Counter|Credential|Culture|Date|Event|EventLog|EventSubscriber|ExecutionPolicy|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|PfxCertificate|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|Verb|WinEvent|WmiObject)"),/Group-Object/,/Import-(Alias|Clixml|Counter|Csv|LocalizedData|Module|PSSession)/,/ImportSystemModules/,/Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)/,/Join-Path/,/Limit-EventLog/,/Measure-(Command|Object)/,/Move-Item(Property)?/,new RegExp("New-(Alias|Event|EventLog|Item(Property)?|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy|WinEvent)"),/Out-(Default|File|GridView|Host|Null|Printer|String)/,/Pause/,/(Pop|Push)-Location/,/Read-Host/,/Receive-(Job|PSSession)/,/Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)/,/Remove-(Computer|Event|EventLog|Item(Property)?|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)/,/Rename-(Computer|Item(Property)?)/,/Reset-ComputerMachinePassword/,/Resolve-Path/,/Restart-(Computer|Service)/,/Restore-Computer/,/Resume-(Job|Service)/,/Save-Help/,/Select-(Object|String|Xml)/,/Send-MailMessage/,new RegExp("Set-(Acl|Alias|AuthenticodeSignature|Content|Date|ExecutionPolicy|Item(Property)?|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)"),/Show-(Command|ControlPanelItem|EventLog)/,/Sort-Object/,/Split-Path/,/Start-(Job|Process|Service|Sleep|Transaction|Transcript)/,/Stop-(Computer|Job|Process|Service|Transcript)/,/Suspend-(Job|Service)/,/TabExpansion2/,/Tee-Object/,/Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)/,/Trace-Command/,/Unblock-File/,/Undo-Transaction/,/Unregister-(Event|PSSessionConfiguration)/,/Update-(FormatData|Help|List|TypeData)/,/Use-Transaction/,/Wait-(Event|Job|Process)/,/Where-Object/,/Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning)/,/cd|help|mkdir|more|oss|prompt/,/ac|asnp|cat|cd|chdir|clc|clear|clhy|cli|clp|cls|clv|cnsn|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|dnsn|ebp/,/echo|epal|epcsv|epsn|erase|etsn|exsn|fc|fl|foreach|ft|fw|gal|gbp|gc|gci|gcm|gcs|gdr|ghy|gi|gjb|gl|gm|gmo|gp|gps/,/group|gsn|gsnp|gsv|gu|gv|gwmi|h|history|icm|iex|ihy|ii|ipal|ipcsv|ipmo|ipsn|irm|ise|iwmi|iwr|kill|lp|ls|man|md/,/measure|mi|mount|move|mp|mv|nal|ndr|ni|nmo|npssc|nsn|nv|ogv|oh|popd|ps|pushd|pwd|r|rbp|rcjb|rcsn|rd|rdr|ren|ri/,/rjb|rm|rmdir|rmo|rni|rnp|rp|rsn|rsnp|rujb|rv|rvpa|rwmi|sajb|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls/,/sort|sp|spjb|spps|spsv|start|sujb|sv|swmi|tee|trcm|type|where|wjb|write/],{prefix:"",suffix:""}),a=e([/[$?^_]|Args|ConfirmPreference|ConsoleFileName|DebugPreference|Error|ErrorActionPreference|ErrorView|ExecutionContext/,/FormatEnumerationLimit|Home|Host|Input|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount/,/MaximumHistoryCount|MaximumVariableCount|MyInvocation|NestedPromptLevel|OutputEncoding|Pid|Profile|ProgressPreference/,/PSBoundParameters|PSCommandPath|PSCulture|PSDefaultParameterValues|PSEmailServer|PSHome|PSScriptRoot|PSSessionApplicationName/,/PSSessionConfigurationName|PSSessionOption|PSUICulture|PSVersionTable|Pwd|ShellId|StackTrace|VerbosePreference/,/WarningPreference|WhatIfPreference/,/Event|EventArgs|EventSubscriber|Sender/,/Matches|Ofs|ForEach|LastExitCode|PSCmdlet|PSItem|PSSenderInfo|This/,/true|false|null/],{prefix:"\\$",suffix:""}),s={keyword:r,number:/^((0x[\da-f]+)|((\d+\.\d+|\d\.|\.\d+|\d+)(e[\+\-]?\d+)?))[ld]?([kmgtp]b)?/i,operator:o,builtin:e([/[A-Z]:|%|\?/i,i,a],{suffix:"(?=[^A-Za-z\\d\\-_]|$)"}),punctuation:/[\[\]{},;`\\\.]|@[({]/,identifier:/^[A-Za-z\_][A-Za-z\-\_\d]*\b/};function u(e,r){var n=r.returnStack[r.returnStack.length-1];if(n&&n.shouldReturnFrom(r))return r.tokenize=n.tokenize,r.returnStack.pop(),r.tokenize(e,r);if(e.eatSpace())return null;if(e.eat("("))return r.bracketNesting+=1,"punctuation";if(e.eat(")"))return r.bracketNesting-=1,"punctuation";for(var o in s)if(e.match(s[o]))return o;var i=e.next();if("'"===i)return function(e,t){var r;for(;null!=(r=e.peek());)if(e.next(),"'"===r&&!e.eat("'"))return t.tokenize=u,"string";return"error"}(e,r);if("$"===i)return d(e,r);if('"'===i)return c(e,r);if("<"===i&&e.eat("#"))return r.tokenize=S,S(e,r);if("#"===i)return e.skipToEnd(),"comment";if("@"===i){var a=e.eat(/["']/);if(a&&e.eol())return r.tokenize=b,r.startQuote=a[0],b(e,r);if(e.eol())return"error";if(e.peek().match(/[({]/))return"punctuation";if(e.peek().match(t))return d(e,r)}return"error"}function c(e,t){for(var r;null!=(r=e.peek());){if("$"===r)return t.tokenize=l,"string";if(e.next(),"`"!==r){if('"'===r&&!e.eat('"'))return t.tokenize=u,"string"}else e.next()}return"error"}function l(e,t){return f(e,t,c)}function p(e,t){return t.tokenize=b,t.startQuote='"',b(e,t)}function m(e,t){return f(e,t,p)}function f(e,t,r){if(e.match("$(")){var n=t.bracketNesting;return t.returnStack.push({shouldReturnFrom:function(e){return e.bracketNesting===n},tokenize:r}),t.tokenize=u,t.bracketNesting+=1,"punctuation"}return e.next(),t.returnStack.push({shouldReturnFrom:function(){return!0},tokenize:r}),t.tokenize=d,t.tokenize(e,t)}function S(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&">"==r){t.tokenize=u;break}n="#"===r}return"comment"}function d(e,r){var n=e.peek();return e.eat("{")?(r.tokenize=P,P(e,r)):null!=n&&n.match(t)?(e.eatWhile(t),r.tokenize=u,"variable-2"):(r.tokenize=u,"error")}function P(e,t){for(var r;null!=(r=e.next());)if("}"===r){t.tokenize=u;break}return"variable-2"}function b(e,t){var r=t.startQuote;if(e.sol()&&e.match(new RegExp(r+"@")))t.tokenize=u;else if('"'===r)for(;!e.eol();){var n=e.peek();if("$"===n)return t.tokenize=m,"string";e.next(),"`"===n&&e.next()}else e.skipToEnd();return"string"}return{startState:function(){return{returnStack:[],bracketNesting:0,tokenize:u}},token:function(e,t){return t.tokenize(e,t)},blockCommentStart:"<#",blockCommentEnd:"#>",lineComment:"#",fold:"brace"}})),e.defineMIME("application/x-powershell","powershell")})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/protobuf/protobuf.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/protobuf/protobuf.js index 93c4ebfa7398..93df97497828 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/protobuf/protobuf.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/protobuf/protobuf.js @@ -1 +1 @@ -!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=["package","message","import","syntax","required","optional","repeated","reserved","default","extensions","packed","bool","bytes","double","enum","float","string","int32","int64","uint32","uint64","sint32","sint64","fixed32","fixed64","sfixed32","sfixed64","option","service","rpc","returns"],r=new RegExp("^(("+t.join(")|(")+"))\\b","i");e.registerHelper("hintWords","protobuf",t);var n=new RegExp("^[_A-Za-z¡-ï¿¿][_A-Za-z0-9¡-ï¿¿]*");function i(e){if(e.eatSpace())return null;if(e.match("//"))return e.skipToEnd(),"comment";if(e.match(/^[0-9\.+-]/,!1)){if(e.match(/^[+-]?0x[0-9a-fA-F]+/))return"number";if(e.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))return"number";if(e.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))return"number"}return e.match(/^"([^"]|(""))*"/)?"string":e.match(/^'([^']|(''))*'/)?"string":e.match(r)?"keyword":e.match(n)?"variable":(e.next(),null)}e.defineMode("protobuf",(function(){return{token:i}})),e.defineMIME("text/x-protobuf","protobuf")})); \ No newline at end of file +!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=["package","message","import","syntax","required","optional","repeated","reserved","default","extensions","packed","bool","bytes","double","enum","float","string","int32","int64","uint32","uint64","sint32","sint64","fixed32","fixed64","sfixed32","sfixed64","option","service","rpc","returns"],r=new RegExp("^(("+t.join(")|(")+"))\\b","i");e.registerHelper("hintWords","protobuf",t);var n=new RegExp("^[_A-Za-z¡-ï¿¿][_A-Za-z0-9¡-ï¿¿]*");function i(e){if(e.eatSpace())return null;if(e.match("//"))return e.skipToEnd(),"comment";if(e.match(/^[0-9\.+-]/,!1)){if(e.match(/^[+-]?0x[0-9a-fA-F]+/))return"number";if(e.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))return"number";if(e.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))return"number"}return e.match(/^"([^"]|(""))*"/)?"string":e.match(/^'([^']|(''))*'/)?"string":e.match(r)?"keyword":e.match(n)?"variable":(e.next(),null)}e.defineMode("protobuf",(function(){return{token:i,fold:"brace"}})),e.defineMIME("text/x-protobuf","protobuf")})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/python/python.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/python/python.js index d97802a9d809..579737e9e813 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/python/python.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/python/python.js @@ -1 +1 @@ -!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")}var r=t(["and","or","not","is"]),n=["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"],i=["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__"];function o(e){return e.scopes[e.scopes.length-1]}e.registerHelper("hintWords","python",n.concat(i)),e.defineMode("python",(function(a,s){for(var c=s.delimiters||s.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,l=[s.singleOperators,s.doubleOperators,s.doubleDelimiters,s.tripleDelimiters,s.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],u=0;u<l.length;u++)l[u]||l.splice(u--,1);var f=s.hangingIndent||a.indentUnit,p=n,d=i;null!=s.extra_keywords&&(p=p.concat(s.extra_keywords)),null!=s.extra_builtins&&(d=d.concat(s.extra_builtins));var m=!(s.version&&Number(s.version)<3);if(m){var h=s.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;p=p.concat(["nonlocal","False","True","None","async","await"]),d=d.concat(["ascii","bytes","exec","print"]);var g=new RegExp("^(([rbuf]|(br)|(fr))?('{3}|\"{3}|['\"]))","i")}else{h=s.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/;p=p.concat(["exec","print"]),d=d.concat(["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"]);g=new RegExp("^(([rubf]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var b=t(p),y=t(d);function k(e,t){var r=e.sol()&&"\\"!=t.lastToken;if(r&&(t.indent=e.indentation()),r&&"py"==o(t).type){var n=o(t).offset;if(e.eatSpace()){var i=e.indentation();return i>n?x(t):i<n&&_(e,t)&&"#"!=e.peek()&&(t.errorToken=!0),null}var a=v(e,t);return n>0&&_(e,t)&&(a+=" error"),a}return v(e,t)}function v(e,t){if(e.eatSpace())return null;if(e.match(/^#.*/))return"comment";if(e.match(/^[0-9\.]/,!1)){var n=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(n=!0),e.match(/^[\d_]+\.\d*/)&&(n=!0),e.match(/^\.\d+/)&&(n=!0),n)return e.eat(/J/i),"number";var i=!1;if(e.match(/^0x[0-9a-f_]+/i)&&(i=!0),e.match(/^0b[01_]+/i)&&(i=!0),e.match(/^0o[0-7_]+/i)&&(i=!0),e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(e.eat(/J/i),i=!0),e.match(/^0(?![\dx])/i)&&(i=!0),i)return e.eat(/L/i),"number"}if(e.match(g))return-1!==e.current().toLowerCase().indexOf("f")?(t.tokenize=function(e,t){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var r=1==e.length;function n(e){return function(t,r){var o=v(t,r);return"punctuation"==o&&("{"==t.current()?r.tokenize=n(e+1):"}"==t.current()&&(r.tokenize=e>1?n(e-1):i)),o}}function i(i,o){for(;!i.eol();)if(i.eatWhile(/[^'"\{\}\\]/),i.eat("\\")){if(i.next(),r&&i.eol())return"string"}else{if(i.match(e))return o.tokenize=t,"string";if(i.match("{{"))return"string";if(i.match("{",!1))return o.tokenize=n(0),i.current()?"string":o.tokenize(i,o);if(i.match("}}"))return"string";if(i.match("}"))return"error";i.eat(/['"]/)}if(r){if(s.singleLineStringErrors)return"error";o.tokenize=t}return"string"}return i.isString=!0,i}(e.current(),t.tokenize),t.tokenize(e,t)):(t.tokenize=function(e,t){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var r=1==e.length;function n(n,i){for(;!n.eol();)if(n.eatWhile(/[^'"\\]/),n.eat("\\")){if(n.next(),r&&n.eol())return"string"}else{if(n.match(e))return i.tokenize=t,"string";n.eat(/['"]/)}if(r){if(s.singleLineStringErrors)return"error";i.tokenize=t}return"string"}return n.isString=!0,n}(e.current(),t.tokenize),t.tokenize(e,t));for(var o=0;o<l.length;o++)if(e.match(l[o]))return"operator";return e.match(c)?"punctuation":"."==t.lastToken&&e.match(h)?"property":e.match(b)||e.match(r)?"keyword":e.match(y)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(h)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),"error")}function x(e){for(;"py"!=o(e).type;)e.scopes.pop();e.scopes.push({offset:o(e).offset+a.indentUnit,type:"py",align:null})}function _(e,t){for(var r=e.indentation();t.scopes.length>1&&o(t).offset>r;){if("py"!=o(t).type)return!0;t.scopes.pop()}return o(t).offset!=r}function z(e,t){e.sol()&&(t.beginningOfLine=!0);var r=t.tokenize(e,t),n=e.current();if(t.beginningOfLine&&"@"==n)return e.match(h,!1)?"meta":m?"operator":"error";if(/\S/.test(n)&&(t.beginningOfLine=!1),"variable"!=r&&"builtin"!=r||"meta"!=t.lastToken||(r="meta"),"pass"!=n&&"return"!=n||(t.dedent+=1),"lambda"==n&&(t.lambda=!0),":"!=n||t.lambda||"py"!=o(t).type||x(t),1==n.length&&!/string|comment/.test(r)){var i="[({".indexOf(n);if(-1!=i&&function(e,t,r){var n=e.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+f,type:r,align:n})}(e,t,"])}".slice(i,i+1)),-1!=(i="])}".indexOf(n))){if(o(t).type!=n)return"error";t.indent=t.scopes.pop().offset-f}}return t.dedent>0&&e.eol()&&"py"==o(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),r}return{startState:function(e){return{tokenize:k,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var r=t.errorToken;r&&(t.errorToken=!1);var n=z(e,t);return n&&"comment"!=n&&(t.lastToken="keyword"==n||"punctuation"==n?e.current():n),"punctuation"==n&&(n=null),e.eol()&&t.lambda&&(t.lambda=!1),r?n+" error":n},indent:function(t,r){if(t.tokenize!=k)return t.tokenize.isString?e.Pass:0;var n=o(t),i=n.type==r.charAt(0);return null!=n.align?n.align-(i?1:0):n.offset-(i?f:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"}})),e.defineMIME("text/x-python","python");var a;e.defineMIME("text/x-cython",{name:"python",extra_keywords:(a="by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE",a.split(" "))})})); \ No newline at end of file +!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")}var n=t(["and","or","not","is"]),r=["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"],i=["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__"];function o(e){return e.scopes[e.scopes.length-1]}e.registerHelper("hintWords","python",r.concat(i)),e.defineMode("python",(function(a,s){for(var l=s.delimiters||s.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,c=[s.singleOperators,s.doubleOperators,s.doubleDelimiters,s.tripleDelimiters,s.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],u=0;u<c.length;u++)c[u]||c.splice(u--,1);var f=s.hangingIndent||a.indentUnit,p=r,d=i;null!=s.extra_keywords&&(p=p.concat(s.extra_keywords)),null!=s.extra_builtins&&(d=d.concat(s.extra_builtins));var m=!(s.version&&Number(s.version)<3);if(m){var h=s.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;p=p.concat(["nonlocal","False","True","None","async","await"]),d=d.concat(["ascii","bytes","exec","print"]);var g=new RegExp("^(([rbuf]|(br)|(fr))?('{3}|\"{3}|['\"]))","i")}else{h=s.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/;p=p.concat(["exec","print"]),d=d.concat(["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"]);g=new RegExp("^(([rubf]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var b=t(p),y=t(d);function k(e,t){var n=e.sol()&&"\\"!=t.lastToken;if(n&&(t.indent=e.indentation()),n&&"py"==o(t).type){var r=o(t).offset;if(e.eatSpace()){var i=e.indentation();return i>r?x(t):i<r&&_(e,t)&&"#"!=e.peek()&&(t.errorToken=!0),null}var a=v(e,t);return r>0&&_(e,t)&&(a+=" error"),a}return v(e,t)}function v(e,t,r){if(e.eatSpace())return null;if(!r&&e.match(/^#.*/))return"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"}if(e.match(g))return-1!==e.current().toLowerCase().indexOf("f")?(t.tokenize=function(e,t){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length;function r(e){return function(t,n){var o=v(t,n,!0);return"punctuation"==o&&("{"==t.current()?n.tokenize=r(e+1):"}"==t.current()&&(n.tokenize=e>1?r(e-1):i)),o}}function i(i,o){for(;!i.eol();)if(i.eatWhile(/[^'"\{\}\\]/),i.eat("\\")){if(i.next(),n&&i.eol())return"string"}else{if(i.match(e))return o.tokenize=t,"string";if(i.match("{{"))return"string";if(i.match("{",!1))return o.tokenize=r(0),i.current()?"string":o.tokenize(i,o);if(i.match("}}"))return"string";if(i.match("}"))return"error";i.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return"error";o.tokenize=t}return"string"}return i.isString=!0,i}(e.current(),t.tokenize),t.tokenize(e,t)):(t.tokenize=function(e,t){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length;function r(r,i){for(;!r.eol();)if(r.eatWhile(/[^'"\\]/),r.eat("\\")){if(r.next(),n&&r.eol())return"string"}else{if(r.match(e))return i.tokenize=t,"string";r.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return"error";i.tokenize=t}return"string"}return r.isString=!0,r}(e.current(),t.tokenize),t.tokenize(e,t));for(var a=0;a<c.length;a++)if(e.match(c[a]))return"operator";return e.match(l)?"punctuation":"."==t.lastToken&&e.match(h)?"property":e.match(b)||e.match(n)?"keyword":e.match(y)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(h)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),r?null:"error")}function x(e){for(;"py"!=o(e).type;)e.scopes.pop();e.scopes.push({offset:o(e).offset+a.indentUnit,type:"py",align:null})}function _(e,t){for(var n=e.indentation();t.scopes.length>1&&o(t).offset>n;){if("py"!=o(t).type)return!0;t.scopes.pop()}return o(t).offset!=n}function z(e,t){e.sol()&&(t.beginningOfLine=!0);var n=t.tokenize(e,t),r=e.current();if(t.beginningOfLine&&"@"==r)return e.match(h,!1)?"meta":m?"operator":"error";if(/\S/.test(r)&&(t.beginningOfLine=!1),"variable"!=n&&"builtin"!=n||"meta"!=t.lastToken||(n="meta"),"pass"!=r&&"return"!=r||(t.dedent+=1),"lambda"==r&&(t.lambda=!0),":"!=r||t.lambda||"py"!=o(t).type||x(t),1==r.length&&!/string|comment/.test(n)){var i="[({".indexOf(r);if(-1!=i&&function(e,t,n){var r=e.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+f,type:n,align:r})}(e,t,"])}".slice(i,i+1)),-1!=(i="])}".indexOf(r))){if(o(t).type!=r)return"error";t.indent=t.scopes.pop().offset-f}}return t.dedent>0&&e.eol()&&"py"==o(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),n}return{startState:function(e){return{tokenize:k,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=z(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+" error":r},indent:function(t,n){if(t.tokenize!=k)return t.tokenize.isString?e.Pass:0;var r=o(t),i=r.type==n.charAt(0);return null!=r.align?r.align-(i?1:0):r.offset-(i?f:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"}})),e.defineMIME("text/x-python","python");var a;e.defineMIME("text/x-cython",{name:"python",extra_keywords:(a="by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE",a.split(" "))})})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/ruby/ruby.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/ruby/ruby.js index 6497efec0306..9f7fce756ef4 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/ruby/ruby.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/ruby/ruby.js @@ -1 +1 @@ -!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(t){function n(e){for(var t={},n=0,r=e.length;n<r;++n)t[e[n]]=!0;return t}var r,i=n(["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__"]),o=n(["def","class","case","for","while","until","module","then","catch","loop","proc","begin"]),a=n(["end","until"]),u={"[":"]","{":"}","(":")"},f={"]":"[","}":"{",")":"("};function l(e,t,n){return n.tokenize.push(e),e(t,n)}function d(e,t){if(e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push(k),"comment";if(e.eatSpace())return null;var n,i,o,a=e.next();if("`"==a||"'"==a||'"'==a)return l(p(a,"string",'"'==a||"`"==a),e,t);if("/"==a)return function(e){var t,n=e.pos,r=0,i=!1,o=!1;for(;null!=(t=e.next());)if(o)o=!1;else{if("[{(".indexOf(t)>-1)r++;else if("]})".indexOf(t)>-1){if(--r<0)break}else if("/"==t&&0==r){i=!0;break}o="\\"==t}return e.backUp(e.pos-n),i}(e)?l(p(a,"string-2",!0),e,t):"operator";if("%"==a){var f="string",d=!0;e.eat("s")?f="atom":e.eat(/[WQ]/)?f="string":e.eat(/[r]/)?f="string-2":e.eat(/[wxq]/)&&(f="string",d=!1);var s=e.eat(/[^\w\s=]/);return s?(u.propertyIsEnumerable(s)&&(s=u[s]),l(p(s,f,d,!0),e,t)):"operator"}if("#"==a)return e.skipToEnd(),"comment";if("<"==a&&(n=e.match(/^<([-~])[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return l((i=n[2],o=n[1],function(e,t){return o&&e.eatSpace(),e.match(i)?t.tokenize.pop():e.skipToEnd(),"string"}),e,t);if("0"==a)return e.eat("x")?e.eatWhile(/[\da-fA-F]/):e.eat("b")?e.eatWhile(/[01]/):e.eatWhile(/[0-7]/),"number";if(/\d/.test(a))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==a){for(;e.match(/^\\[CM]-/););return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}if(":"==a)return e.eat("'")?l(p("'","atom",!1),e,t):e.eat('"')?l(p('"',"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("@"==a&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==a)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(a))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=a||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(a))return r=a,null;if("-"==a&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(a)){var c=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=a||c||(r="."),"operator"}return null}return r="|",null}function s(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]=s(e-1)}else"{"==t.peek()&&(n.tokenize[n.tokenize.length-1]=s(e+1));return d(t,n)}}function c(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,d(t,n))}}function p(e,t,n,r){return function(i,o){var a,u=!1;for("read-quoted-paused"===o.context.type&&(o.context=o.context.prev,i.eat("}"));null!=(a=i.next());){if(a==e&&(r||!u)){o.tokenize.pop();break}if(n&&"#"==a&&!u){if(i.eat("{")){"}"==e&&(o.context={prev:o.context,type:"read-quoted-paused"}),o.tokenize.push(s());break}if(/[@\$]/.test(i.peek())){o.tokenize.push(c());break}}u=!u&&"\\"==a}return t}}function k(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}return{startState:function(){return{tokenize:[d],indented:0,context:{type:"top",indented:-t.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){r=null,e.sol()&&(t.indented=e.indentation());var n,u=t.tokenize[t.tokenize.length-1](e,t),f=r;if("ident"==u){var l=e.current();"keyword"==(u="."==t.lastTok?"property":i.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(l)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable")&&(f=l,o.propertyIsEnumerable(l)?n="indent":a.propertyIsEnumerable(l)?n="dedent":"if"!=l&&"unless"!=l||e.column()!=e.indentation()?"do"==l&&t.context.indented<t.indented&&(n="indent"):n="indent")}return(r||u&&"comment"!=u)&&(t.lastTok=f),"|"==r&&(t.varList=!t.varList),"indent"==n||/[\(\[\{]/.test(r)?t.context={prev:t.context,type:r||u,indented:t.indented}:("dedent"==n||/[\)\]\}]/.test(r))&&t.context.prev&&(t.context=t.context.prev),e.eol()&&(t.continuedLine="\\"==r||"operator"==u),u},indent:function(n,r){if(n.tokenize[n.tokenize.length-1]!=d)return e.Pass;var i=r&&r.charAt(0),o=n.context,a=o.type==f[i]||"keyword"==o.type&&/^(?:end|until|else|elsif|when|rescue)\b/.test(r);return o.indented+(a?0:t.indentUnit)+(n.continuedLine?t.indentUnit:0)},electricInput:/^\s*(?:end|rescue|elsif|else|\})$/,lineComment:"#",fold:"indent"}})),e.defineMIME("text/x-ruby","ruby")})); \ No newline at end of file +!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,r=e.length;n<r;++n)t[e[n]]=!0;return t}var n=["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__"],r=t(n),i=t(["def","class","case","for","while","until","module","then","catch","loop","proc","begin"]),o=t(["end","until"]),a={"[":"]","{":"}","(":")"},u={"]":"[","}":"{",")":"("};e.defineMode("ruby",(function(t){var n;function f(e,t,n){return n.tokenize.push(e),e(t,n)}function l(e,t){if(e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push(p),"comment";if(e.eatSpace())return null;var r,i,o,u=e.next();if("`"==u||"'"==u||'"'==u)return f(c(u,"string",'"'==u||"`"==u),e,t);if("/"==u)return function(e){var t,n=e.pos,r=0,i=!1,o=!1;for(;null!=(t=e.next());)if(o)o=!1;else{if("[{(".indexOf(t)>-1)r++;else if("]})".indexOf(t)>-1){if(--r<0)break}else if("/"==t&&0==r){i=!0;break}o="\\"==t}return e.backUp(e.pos-n),i}(e)?f(c(u,"string-2",!0),e,t):"operator";if("%"==u){var l="string",d=!0;e.eat("s")?l="atom":e.eat(/[WQ]/)?l="string":e.eat(/[r]/)?l="string-2":e.eat(/[wxq]/)&&(l="string",d=!1);var s=e.eat(/[^\w\s=]/);return s?(a.propertyIsEnumerable(s)&&(s=a[s]),f(c(s,l,d,!0),e,t)):"operator"}if("#"==u)return e.skipToEnd(),"comment";if("<"==u&&(r=e.match(/^<([-~])[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return f((i=r[2],o=r[1],function(e,t){return o&&e.eatSpace(),e.match(i)?t.tokenize.pop():e.skipToEnd(),"string"}),e,t);if("0"==u)return e.eat("x")?e.eatWhile(/[\da-fA-F]/):e.eat("b")?e.eatWhile(/[01]/):e.eatWhile(/[0-7]/),"number";if(/\d/.test(u))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==u){for(;e.match(/^\\[CM]-/););return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}if(":"==u)return e.eat("'")?f(c("'","atom",!1),e,t):e.eat('"')?f(c('"',"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("@"==u&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==u)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(u))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=u||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(u))return n=u,null;if("-"==u&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(u)){var k=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=u||k||(n="."),"operator"}return null}return n="|",null}function d(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]=d(e-1)}else"{"==t.peek()&&(n.tokenize[n.tokenize.length-1]=d(e+1));return l(t,n)}}function s(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,l(t,n))}}function c(e,t,n,r){return function(i,o){var a,u=!1;for("read-quoted-paused"===o.context.type&&(o.context=o.context.prev,i.eat("}"));null!=(a=i.next());){if(a==e&&(r||!u)){o.tokenize.pop();break}if(n&&"#"==a&&!u){if(i.eat("{")){"}"==e&&(o.context={prev:o.context,type:"read-quoted-paused"}),o.tokenize.push(d());break}if(/[@\$]/.test(i.peek())){o.tokenize.push(s());break}}u=!u&&"\\"==a}return t}}function p(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}return{startState:function(){return{tokenize:[l],indented:0,context:{type:"top",indented:-t.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){n=null,e.sol()&&(t.indented=e.indentation());var a,u=t.tokenize[t.tokenize.length-1](e,t),f=n;if("ident"==u){var l=e.current();"keyword"==(u="."==t.lastTok?"property":r.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(l)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable")&&(f=l,i.propertyIsEnumerable(l)?a="indent":o.propertyIsEnumerable(l)?a="dedent":"if"!=l&&"unless"!=l||e.column()!=e.indentation()?"do"==l&&t.context.indented<t.indented&&(a="indent"):a="indent")}return(n||u&&"comment"!=u)&&(t.lastTok=f),"|"==n&&(t.varList=!t.varList),"indent"==a||/[\(\[\{]/.test(n)?t.context={prev:t.context,type:n||u,indented:t.indented}:("dedent"==a||/[\)\]\}]/.test(n))&&t.context.prev&&(t.context=t.context.prev),e.eol()&&(t.continuedLine="\\"==n||"operator"==u),u},indent:function(n,r){if(n.tokenize[n.tokenize.length-1]!=l)return e.Pass;var i=r&&r.charAt(0),o=n.context,a=o.type==u[i]||"keyword"==o.type&&/^(?:end|until|else|elsif|when|rescue)\b/.test(r);return o.indented+(a?0:t.indentUnit)+(n.continuedLine?t.indentUnit:0)},electricInput:/^\s*(?:end|rescue|elsif|else|\})$/,lineComment:"#",fold:"indent"}})),e.defineMIME("text/x-ruby","ruby"),e.registerHelper("hintWords","ruby",n)})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/rust/rust.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/rust/rust.js index 4414fba2a3ca..4ec90b108d10 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/rust/rust.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/rust/rust.js @@ -1 +1 @@ -!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";e.defineSimpleMode("rust",{start:[{regex:/b?"/,token:"string",next:"string"},{regex:/b?r"/,token:"string",next:"string_raw"},{regex:/b?r#+"/,token:"string",next:"string_raw_hash"},{regex:/'(?:[^'\\]|\\(?:[nrt0'"]|x[\da-fA-F]{2}|u\{[\da-fA-F]{6}\}))'/,token:"string-2"},{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:!0},{regex:/[\}\]\)]/,dedent:!0}],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"}}),e.defineMIME("text/x-rustsrc","rust"),e.defineMIME("text/rust","rust")})); \ No newline at end of file +!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";e.defineSimpleMode("rust",{start:[{regex:/b?"/,token:"string",next:"string"},{regex:/b?r"/,token:"string",next:"string_raw"},{regex:/b?r#+"/,token:"string",next:"string_raw_hash"},{regex:/'(?:[^'\\]|\\(?:[nrt0'"]|x[\da-fA-F]{2}|u\{[\da-fA-F]{6}\}))'/,token:"string-2"},{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|union)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)/,token:["keyword",null,"def"]},{regex:/(?:abstract|alignof|as|async|await|box|break|continue|const|crate|do|dyn|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|union|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:!0},{regex:/[\}\]\)]/,dedent:!0}],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"}}),e.defineMIME("text/x-rustsrc","rust"),e.defineMIME("text/rust","rust")})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/sas/sas.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/sas/sas.js index 20a744883c7b..5d2d5cfdd402 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/sas/sas.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/sas/sas.js @@ -1 +1 @@ -!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("sas",(function(){var e={},t={eq:"operator",lt:"operator",le:"operator",gt:"operator",ge:"operator",in:"operator",ne:"operator",or:"operator"},n=/(<=|>=|!=|<>)/,r=/[=\(:\),{}.*<>+\-\/^\[\]]/;function s(t,n,r){if(r)for(var s=n.split(" "),o=0;o<s.length;o++)e[s[o]]={style:t,state:r}}return s("def","stack pgm view source debug nesting nolist",["inDataStep"]),s("def","if while until for do do; end end; then else cancel",["inDataStep"]),s("def","label format _n_ _error_",["inDataStep"]),s("def","ALTER BUFNO BUFSIZE CNTLLEV COMPRESS DLDMGACTION ENCRYPT ENCRYPTKEY EXTENDOBSCOUNTER GENMAX GENNUM INDEX LABEL OBSBUF OUTREP PW PWREQ READ REPEMPTY REPLACE REUSE ROLE SORTEDBY SPILL TOBSNO TYPE WRITE FILECLOSE FIRSTOBS IN OBS POINTOBS WHERE WHEREUP IDXNAME IDXWHERE DROP KEEP RENAME",["inDataStep"]),s("def","filevar finfo finv fipname fipnamel fipstate first firstobs floor",["inDataStep"]),s("def","varfmt varinfmt varlabel varlen varname varnum varray varrayx vartype verify vformat vformatd vformatdx vformatn vformatnx vformatw vformatwx vformatx vinarray vinarrayx vinformat vinformatd vinformatdx vinformatn vinformatnx vinformatw vinformatwx vinformatx vlabel vlabelx vlength vlengthx vname vnamex vnferr vtype vtypex weekday",["inDataStep"]),s("def","zipfips zipname zipnamel zipstate",["inDataStep"]),s("def","put putc putn",["inDataStep"]),s("builtin","data run",["inDataStep"]),s("def","data",["inProc"]),s("def","%if %end %end; %else %else; %do %do; %then",["inMacro"]),s("builtin","proc run; quit; libname filename %macro %mend option options",["ALL"]),s("def","footnote title libname ods",["ALL"]),s("def","%let %put %global %sysfunc %eval ",["ALL"]),s("variable","&sysbuffr &syscc &syscharwidth &syscmd &sysdate &sysdate9 &sysday &sysdevic &sysdmg &sysdsn &sysencoding &sysenv &syserr &syserrortext &sysfilrc &syshostname &sysindex &sysinfo &sysjobid &syslast &syslckrc &syslibrc &syslogapplname &sysmacroname &sysmenv &sysmsg &sysncpu &sysodspath &sysparm &syspbuff &sysprocessid &sysprocessname &sysprocname &sysrc &sysscp &sysscpl &sysscpl &syssite &sysstartid &sysstartname &systcpiphostname &systime &sysuserid &sysver &sysvlong &sysvlong4 &syswarningtext",["ALL"]),s("def","source2 nosource2 page pageno pagesize",["ALL"]),s("def","_all_ _character_ _cmd_ _freq_ _i_ _infile_ _last_ _msg_ _null_ _numeric_ _temporary_ _type_ abort abs addr adjrsq airy alpha alter altlog altprint and arcos array arsin as atan attrc attrib attrn authserver autoexec awscontrol awsdef awsmenu awsmenumerge awstitle backward band base betainv between blocksize blshift bnot bor brshift bufno bufsize bxor by byerr byline byte calculated call cards cards4 catcache cbufno cdf ceil center cexist change chisq cinv class cleanup close cnonct cntllev coalesce codegen col collate collin column comamid comaux1 comaux2 comdef compbl compound compress config continue convert cos cosh cpuid create cross crosstab css curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datalines datalines4 datejul datepart datetime day dbcslang dbcstype dclose ddm delete delimiter depdb depdbsl depsl depsyd deptab dequote descending descript design= device dflang dhms dif digamma dim dinfo display distinct dkricond dkrocond dlm dnum do dopen doptname doptnum dread drop dropnote dsname dsnferr echo else emaildlg emailid emailpw emailserver emailsys encrypt end endsas engine eof eov erf erfc error errorcheck errors exist exp fappend fclose fcol fdelete feedback fetch fetchobs fexist fget file fileclose fileexist filefmt filename fileref fmterr fmtsearch fnonct fnote font fontalias fopen foptname foptnum force formatted formchar formdelim formdlim forward fpoint fpos fput fread frewind frlen from fsep fuzz fwrite gaminv gamma getoption getvarc getvarn go goto group gwindow hbar hbound helpenv helploc hms honorappearance hosthelp hostprint hour hpct html hvar ibessel ibr id if index indexc indexw initcmd initstmt inner input inputc inputn inr insert int intck intnx into intrr invaliddata irr is jbessel join juldate keep kentb kurtosis label lag last lbound leave left length levels lgamma lib library libref line linesize link list log log10 log2 logpdf logpmf logsdf lostcard lowcase lrecl ls macro macrogen maps mautosource max maxdec maxr mdy mean measures median memtype merge merror min minute missing missover mlogic mod mode model modify month mopen mort mprint mrecall msglevel msymtabmax mvarsize myy n nest netpv new news nmiss no nobatch nobs nocaps nocardimage nocenter nocharcode nocmdmac nocol nocum nodate nodbcs nodetails nodmr nodms nodmsbatch nodup nodupkey noduplicates noechoauto noequals noerrorabend noexitwindows nofullstimer noicon noimplmac noint nolist noloadlist nomiss nomlogic nomprint nomrecall nomsgcase nomstored nomultenvappl nonotes nonumber noobs noovp nopad nopercent noprint noprintinit normal norow norsasuser nosetinit nosplash nosymbolgen note notes notitle notitles notsorted noverbose noxsync noxwait npv null number numkeys nummousekeys nway obs on open order ordinal otherwise out outer outp= output over ovp p(1 5 10 25 50 75 90 95 99) pad pad2 paired parm parmcards path pathdll pathname pdf peek peekc pfkey pmf point poisson poke position printer probbeta probbnml probchi probf probgam probhypr probit probnegb probnorm probsig probt procleave prt ps pw pwreq qtr quote r ranbin rancau ranexp rangam range ranks rannor ranpoi rantbl rantri ranuni read recfm register regr remote remove rename repeat replace resolve retain return reuse reverse rewind right round rsquare rtf rtrace rtraceloc s s2 samploc sasautos sascontrol sasfrscr sasmsg sasmstore sasscript sasuser saving scan sdf second select selection separated seq serror set setcomm setot sign simple sin sinh siteinfo skewness skip sle sls sortedby sortpgm sortseq sortsize soundex spedis splashlocation split spool sqrt start std stderr stdin stfips stimer stname stnamel stop stopover subgroup subpopn substr sum sumwgt symbol symbolgen symget symput sysget sysin sysleave sysmsg sysparm sysprint sysprintfont sysprod sysrc system t table tables tan tanh tapeclose tbufsize terminal test then timepart tinv tnonct to today tol tooldef totper transformout translate trantab tranwrd trigamma trim trimn trunc truncover type unformatted uniform union until upcase update user usericon uss validate value var weight when where while wincharset window work workinit workterm write wsum xsync xwait yearcutoff yes yyq min max",["inDataStep","inProc"]),s("operator","and not ",["inDataStep","inProc"]),{startState:function(){return{inDataStep:!1,inProc:!1,inMacro:!1,nextword:!1,continueString:null,continueComment:!1}},token:function(s,o){return s.eatSpace()?null:function(s,o){var a=s.next();if("/"===a&&s.eat("*"))return o.continueComment=!0,"comment";if(!0===o.continueComment)return"*"===a&&"/"===s.peek()?(s.next(),o.continueComment=!1):s.skipTo("*")?(s.skipTo("*"),s.next(),s.eat("/")&&(o.continueComment=!1)):s.skipToEnd(),"comment";if("*"==a&&s.column()==s.indentation())return s.skipToEnd(),"comment";var i,l=a+s.peek();if(!('"'!==a&&"'"!==a||o.continueString))return o.continueString=a,"string";if(o.continueString)return o.continueString==a?o.continueString=null:s.skipTo(o.continueString)?(s.next(),o.continueString=null):s.skipToEnd(),"string";if(null!==o.continueString&&s.eol())return s.skipTo(o.continueString)||s.skipToEnd(),"string";if(/[\d\.]/.test(a))return"."===a?s.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"===a?s.match(/^[xX][0-9a-fA-F]+/)||s.match(/^0[0-7]+/):s.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(n.test(a+s.peek()))return s.next(),"operator";if(t.hasOwnProperty(l)){if(s.next()," "===s.peek())return t[l.toLowerCase()]}else if(r.test(a))return"operator";if(null!=s.match(/[%&;\w]+/,!1)){if(i=a+s.match(/[%&;\w]+/,!0),/&/.test(i))return"variable"}else i=a;if(o.nextword)return s.match(/[\w]+/),"."===s.peek()&&s.skipTo(" "),o.nextword=!1,"variable-2";if(i=i.toLowerCase(),o.inDataStep){if("run;"===i||s.match(/run\s;/))return o.inDataStep=!1,"builtin";if(i&&"."===s.next())return/\w/.test(s.peek())?"variable-2":"variable";if(i&&e.hasOwnProperty(i)&&(-1!==e[i].state.indexOf("inDataStep")||-1!==e[i].state.indexOf("ALL"))){s.start<s.pos&&s.backUp(s.pos-s.start);for(var c=0;c<i.length;++c)s.next();return e[i].style}}if(o.inProc){if("run;"===i||"quit;"===i)return o.inProc=!1,"builtin";if(i&&e.hasOwnProperty(i)&&(-1!==e[i].state.indexOf("inProc")||-1!==e[i].state.indexOf("ALL")))return s.match(/[\w]+/),e[i].style}return o.inMacro?"%mend"===i?(";"===s.peek()&&s.next(),o.inMacro=!1,"builtin"):i&&e.hasOwnProperty(i)&&(-1!==e[i].state.indexOf("inMacro")||-1!==e[i].state.indexOf("ALL"))?(s.match(/[\w]+/),e[i].style):"atom":i&&e.hasOwnProperty(i)?(s.backUp(1),s.match(/[\w]+/),"data"===i&&!1===/=/.test(s.peek())?(o.inDataStep=!0,o.nextword=!0,"builtin"):"proc"===i?(o.inProc=!0,o.nextword=!0,"builtin"):"%macro"===i?(o.inMacro=!0,o.nextword=!0,"builtin"):/title[1-9]/.test(i)?"def":"footnote"===i?(s.eat(/[1-9]/),"def"):!0===o.inDataStep&&-1!==e[i].state.indexOf("inDataStep")?e[i].style:!0===o.inProc&&-1!==e[i].state.indexOf("inProc")?e[i].style:!0===o.inMacro&&-1!==e[i].state.indexOf("inMacro")?e[i].style:-1!==e[i].state.indexOf("ALL")?e[i].style:null):null}(s,o)},blockCommentStart:"/*",blockCommentEnd:"*/"}})),e.defineMIME("text/x-sas","sas")})); \ No newline at end of file +!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("sas",(function(){var e={},t={eq:"operator",lt:"operator",le:"operator",gt:"operator",ge:"operator",in:"operator",ne:"operator",or:"operator"},n=/(<=|>=|!=|<>)/,r=/[=\(:\),{}.*<>+\-\/^\[\]]/;function o(t,n,r){if(r)for(var o=n.split(" "),s=0;s<o.length;s++)e[o[s]]={style:t,state:r}}return o("def","stack pgm view source debug nesting nolist",["inDataStep"]),o("def","if while until for do do; end end; then else cancel",["inDataStep"]),o("def","label format _n_ _error_",["inDataStep"]),o("def","ALTER BUFNO BUFSIZE CNTLLEV COMPRESS DLDMGACTION ENCRYPT ENCRYPTKEY EXTENDOBSCOUNTER GENMAX GENNUM INDEX LABEL OBSBUF OUTREP PW PWREQ READ REPEMPTY REPLACE REUSE ROLE SORTEDBY SPILL TOBSNO TYPE WRITE FILECLOSE FIRSTOBS IN OBS POINTOBS WHERE WHEREUP IDXNAME IDXWHERE DROP KEEP RENAME",["inDataStep"]),o("def","filevar finfo finv fipname fipnamel fipstate first firstobs floor",["inDataStep"]),o("def","varfmt varinfmt varlabel varlen varname varnum varray varrayx vartype verify vformat vformatd vformatdx vformatn vformatnx vformatw vformatwx vformatx vinarray vinarrayx vinformat vinformatd vinformatdx vinformatn vinformatnx vinformatw vinformatwx vinformatx vlabel vlabelx vlength vlengthx vname vnamex vnferr vtype vtypex weekday",["inDataStep"]),o("def","zipfips zipname zipnamel zipstate",["inDataStep"]),o("def","put putc putn",["inDataStep"]),o("builtin","data run",["inDataStep"]),o("def","data",["inProc"]),o("def","%if %end %end; %else %else; %do %do; %then",["inMacro"]),o("builtin","proc run; quit; libname filename %macro %mend option options",["ALL"]),o("def","footnote title libname ods",["ALL"]),o("def","%let %put %global %sysfunc %eval ",["ALL"]),o("variable","&sysbuffr &syscc &syscharwidth &syscmd &sysdate &sysdate9 &sysday &sysdevic &sysdmg &sysdsn &sysencoding &sysenv &syserr &syserrortext &sysfilrc &syshostname &sysindex &sysinfo &sysjobid &syslast &syslckrc &syslibrc &syslogapplname &sysmacroname &sysmenv &sysmsg &sysncpu &sysodspath &sysparm &syspbuff &sysprocessid &sysprocessname &sysprocname &sysrc &sysscp &sysscpl &sysscpl &syssite &sysstartid &sysstartname &systcpiphostname &systime &sysuserid &sysver &sysvlong &sysvlong4 &syswarningtext",["ALL"]),o("def","source2 nosource2 page pageno pagesize",["ALL"]),o("def","_all_ _character_ _cmd_ _freq_ _i_ _infile_ _last_ _msg_ _null_ _numeric_ _temporary_ _type_ abort abs addr adjrsq airy alpha alter altlog altprint and arcos array arsin as atan attrc attrib attrn authserver autoexec awscontrol awsdef awsmenu awsmenumerge awstitle backward band base betainv between blocksize blshift bnot bor brshift bufno bufsize bxor by byerr byline byte calculated call cards cards4 catcache cbufno cdf ceil center cexist change chisq cinv class cleanup close cnonct cntllev coalesce codegen col collate collin column comamid comaux1 comaux2 comdef compbl compound compress config continue convert cos cosh cpuid create cross crosstab css curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datalines datalines4 datejul datepart datetime day dbcslang dbcstype dclose ddfm ddm delete delimiter depdb depdbsl depsl depsyd deptab dequote descending descript design= device dflang dhms dif digamma dim dinfo display distinct dkricond dkrocond dlm dnum do dopen doptname doptnum dread drop dropnote dsname dsnferr echo else emaildlg emailid emailpw emailserver emailsys encrypt end endsas engine eof eov erf erfc error errorcheck errors exist exp fappend fclose fcol fdelete feedback fetch fetchobs fexist fget file fileclose fileexist filefmt filename fileref fmterr fmtsearch fnonct fnote font fontalias fopen foptname foptnum force formatted formchar formdelim formdlim forward fpoint fpos fput fread frewind frlen from fsep fuzz fwrite gaminv gamma getoption getvarc getvarn go goto group gwindow hbar hbound helpenv helploc hms honorappearance hosthelp hostprint hour hpct html hvar ibessel ibr id if index indexc indexw initcmd initstmt inner input inputc inputn inr insert int intck intnx into intrr invaliddata irr is jbessel join juldate keep kentb kurtosis label lag last lbound leave left length levels lgamma lib library libref line linesize link list log log10 log2 logpdf logpmf logsdf lostcard lowcase lrecl ls macro macrogen maps mautosource max maxdec maxr mdy mean measures median memtype merge merror min minute missing missover mlogic mod mode model modify month mopen mort mprint mrecall msglevel msymtabmax mvarsize myy n nest netpv new news nmiss no nobatch nobs nocaps nocardimage nocenter nocharcode nocmdmac nocol nocum nodate nodbcs nodetails nodmr nodms nodmsbatch nodup nodupkey noduplicates noechoauto noequals noerrorabend noexitwindows nofullstimer noicon noimplmac noint nolist noloadlist nomiss nomlogic nomprint nomrecall nomsgcase nomstored nomultenvappl nonotes nonumber noobs noovp nopad nopercent noprint noprintinit normal norow norsasuser nosetinit nosplash nosymbolgen note notes notitle notitles notsorted noverbose noxsync noxwait npv null number numkeys nummousekeys nway obs on open order ordinal otherwise out outer outp= output over ovp p(1 5 10 25 50 75 90 95 99) pad pad2 paired parm parmcards path pathdll pathname pdf peek peekc pfkey pmf point poisson poke position printer probbeta probbnml probchi probf probgam probhypr probit probnegb probnorm probsig probt procleave prt ps pw pwreq qtr quote r ranbin rancau random ranexp rangam range ranks rannor ranpoi rantbl rantri ranuni rcorr read recfm register regr remote remove rename repeat repeated replace resolve retain return reuse reverse rewind right round rsquare rtf rtrace rtraceloc s s2 samploc sasautos sascontrol sasfrscr sasmsg sasmstore sasscript sasuser saving scan sdf second select selection separated seq serror set setcomm setot sign simple sin sinh siteinfo skewness skip sle sls sortedby sortpgm sortseq sortsize soundex spedis splashlocation split spool sqrt start std stderr stdin stfips stimer stname stnamel stop stopover sub subgroup subpopn substr sum sumwgt symbol symbolgen symget symput sysget sysin sysleave sysmsg sysparm sysprint sysprintfont sysprod sysrc system t table tables tan tanh tapeclose tbufsize terminal test then timepart tinv tnonct to today tol tooldef totper transformout translate trantab tranwrd trigamma trim trimn trunc truncover type unformatted uniform union until upcase update user usericon uss validate value var weight when where while wincharset window work workinit workterm write wsum xsync xwait yearcutoff yes yyq min max",["inDataStep","inProc"]),o("operator","and not ",["inDataStep","inProc"]),{startState:function(){return{inDataStep:!1,inProc:!1,inMacro:!1,nextword:!1,continueString:null,continueComment:!1}},token:function(o,s){return o.eatSpace()?null:function(o,s){var a=o.next();if("/"===a&&o.eat("*"))return s.continueComment=!0,"comment";if(!0===s.continueComment)return"*"===a&&"/"===o.peek()?(o.next(),s.continueComment=!1):o.skipTo("*")?(o.skipTo("*"),o.next(),o.eat("/")&&(s.continueComment=!1)):o.skipToEnd(),"comment";if("*"==a&&o.column()==o.indentation())return o.skipToEnd(),"comment";var i,l=a+o.peek();if(!('"'!==a&&"'"!==a||s.continueString))return s.continueString=a,"string";if(s.continueString)return s.continueString==a?s.continueString=null:o.skipTo(s.continueString)?(o.next(),s.continueString=null):o.skipToEnd(),"string";if(null!==s.continueString&&o.eol())return o.skipTo(s.continueString)||o.skipToEnd(),"string";if(/[\d\.]/.test(a))return"."===a?o.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"===a?o.match(/^[xX][0-9a-fA-F]+/)||o.match(/^0[0-7]+/):o.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(n.test(a+o.peek()))return o.next(),"operator";if(t.hasOwnProperty(l)){if(o.next()," "===o.peek())return t[l.toLowerCase()]}else if(r.test(a))return"operator";if(null!=o.match(/[%&;\w]+/,!1)){if(i=a+o.match(/[%&;\w]+/,!0),/&/.test(i))return"variable"}else i=a;if(s.nextword)return o.match(/[\w]+/),"."===o.peek()&&o.skipTo(" "),s.nextword=!1,"variable-2";if(i=i.toLowerCase(),s.inDataStep){if("run;"===i||o.match(/run\s;/))return s.inDataStep=!1,"builtin";if(i&&"."===o.next())return/\w/.test(o.peek())?"variable-2":"variable";if(i&&e.hasOwnProperty(i)&&(-1!==e[i].state.indexOf("inDataStep")||-1!==e[i].state.indexOf("ALL"))){o.start<o.pos&&o.backUp(o.pos-o.start);for(var c=0;c<i.length;++c)o.next();return e[i].style}}if(s.inProc){if("run;"===i||"quit;"===i)return s.inProc=!1,"builtin";if(i&&e.hasOwnProperty(i)&&(-1!==e[i].state.indexOf("inProc")||-1!==e[i].state.indexOf("ALL")))return o.match(/[\w]+/),e[i].style}return s.inMacro?"%mend"===i?(";"===o.peek()&&o.next(),s.inMacro=!1,"builtin"):i&&e.hasOwnProperty(i)&&(-1!==e[i].state.indexOf("inMacro")||-1!==e[i].state.indexOf("ALL"))?(o.match(/[\w]+/),e[i].style):"atom":i&&e.hasOwnProperty(i)?(o.backUp(1),o.match(/[\w]+/),"data"===i&&!1===/=/.test(o.peek())?(s.inDataStep=!0,s.nextword=!0,"builtin"):"proc"===i?(s.inProc=!0,s.nextword=!0,"builtin"):"%macro"===i?(s.inMacro=!0,s.nextword=!0,"builtin"):/title[1-9]/.test(i)?"def":"footnote"===i?(o.eat(/[1-9]/),"def"):!0===s.inDataStep&&-1!==e[i].state.indexOf("inDataStep")?e[i].style:!0===s.inProc&&-1!==e[i].state.indexOf("inProc")?e[i].style:!0===s.inMacro&&-1!==e[i].state.indexOf("inMacro")?e[i].style:-1!==e[i].state.indexOf("ALL")?e[i].style:null):null}(o,s)},blockCommentStart:"/*",blockCommentEnd:"*/"}})),e.defineMIME("text/x-sas","sas")})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/soy/soy.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/soy/soy.js index abcde22b8163..038995eafe1b 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/soy/soy.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/soy/soy.js @@ -1 +1 @@ -!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed"],t):t(CodeMirror)}((function(t){"use strict";var e={noEndTag:!0,soyState:"param-def"},a={alias:{noEndTag:!0},delpackage:{noEndTag:!0},namespace:{noEndTag:!0,soyState:"namespace-def"},"@param":e,"@param?":e,"@inject":e,"@inject?":e,"@state":e,template:{soyState:"templ-def",variableScope:!0},literal:{},msg:{},fallbackmsg:{noEndTag:!0,reduceIndent:!0},select:{},plural:{},let:{soyState:"var-def"},if:{},elseif:{noEndTag:!0,reduceIndent:!0},else:{noEndTag:!0,reduceIndent:!0},switch:{},case:{noEndTag:!0,reduceIndent:!0},default:{noEndTag:!0,reduceIndent:!0},foreach:{variableScope:!0,soyState:"var-def"},ifempty:{noEndTag:!0,reduceIndent:!0},for:{variableScope:!0,soyState:"var-def"},call:{soyState:"templ-ref"},param:{soyState:"param-ref"},print:{noEndTag:!0},deltemplate:{soyState:"templ-def",variableScope:!0},delcall:{soyState:"templ-ref"},log:{},element:{variableScope:!0}},n=Object.keys(a).filter((function(t){return!a[t].noEndTag||a[t].reduceIndent}));t.defineMode("soy",(function(e){var r=t.getMode(e,"text/plain"),o={html:t.getMode(e,{name:"text/html",multilineTagIndentFactor:2,multilineTagIndentPastTag:!1}),attributes:r,text:r,uri:r,trusted_resource_uri:r,css:t.getMode(e,"text/css"),js:t.getMode(e,{name:"text/javascript",statementIndent:2*e.indentUnit})};function l(t){return t[t.length-1]}function s(t,e,a){if(t.sol()){for(var n=0;n<e.indent&&t.eat(/\s/);n++);if(n)return null}var r=t.string,o=a.exec(r.substr(t.pos));o&&(t.string=r.substr(0,t.pos+o.index));var s=t.hideFirstChars(e.indent,(function(){var a=l(e.localStates);return a.mode.token(t,a.state)}));return t.string=r,s}function i(t,e){return{element:e,next:t}}function c(t){t.context&&(t.context.scope&&(t.variables=t.context.scope),t.context=t.context.previousContext)}function u(t,e,a){this.previousContext=t,this.tag=e,this.kind=null,this.scope=a}function p(t,e){let a;return t.match(/[[]/)?(e.soyState.push("list-literal"),e.lookupVariables=!1,null):t.match(/map\b/)?(e.soyState.push("map-literal"),"keyword"):t.match(/record\b/)?(e.soyState.push("record-literal"),"keyword"):t.match(/([\w]+)(?=\()/)?"variable callee":(a=t.match(/^["']/))?(e.soyState.push("string"),e.quoteKind=a[0],"string"):t.match(/^[(]/)?(e.soyState.push("open-parentheses"),null):t.match(/(null|true|false)(?!\w)/)||t.match(/0x([0-9a-fA-F]{2,})/)||t.match(/-?([0-9]*[.])?[0-9]+(e[0-9]*)?/)?"atom":t.match(/(\||[+\-*\/%]|[=!]=|\?:|[<>]=?)/)?"operator":(a=t.match(/^\$([\w]+)/))?(n=e.variables,r=a[1],o=!e.lookupVariables,function(t,e){for(;t;){if(t.element===e)return!0;t=t.next}return!1}(n,r)?"variable-2":o?"variable":"variable-2 error"):(a=t.match(/^\w+/))?/^(?:as|and|or|not|in|if)$/.test(a[0])?"keyword":null:(t.next(),null);var n,r,o}return{startState:function(){return{soyState:[],variables:i(null,"ij"),scopes:null,indent:0,quoteKind:null,context:null,lookupVariables:!0,localStates:[{mode:o.html,state:t.startState(o.html)}]}},copyState:function(e){return{tag:e.tag,soyState:e.soyState.concat([]),variables:e.variables,context:e.context,indent:e.indent,quoteKind:e.quoteKind,lookupVariables:e.lookupVariables,localStates:e.localStates.map((function(e){return{mode:e.mode,state:t.copyState(e.mode,e.state)}}))}},token:function(r,d){switch(l(d.soyState)){case"comment":if(r.match(/^.*?\*\//)?d.soyState.pop():r.skipToEnd(),!d.context||!d.context.scope)for(var m=/@param\??\s+(\S+)/g,y=r.current();h=m.exec(y);)d.variables=i(d.variables,h[1]);return"comment";case"string":var h;return(h=r.match(/^.*?(["']|\\[\s\S])/))?h[1]==d.quoteKind&&(d.quoteKind=null,d.soyState.pop()):r.skipToEnd(),"string"}if(!d.soyState.length||"literal"!=l(d.soyState)){if(r.match(/^\/\*/))return d.soyState.push("comment"),"comment";if(r.match(r.sol()?/^\s*\/\/.*/:/^\s+\/\/.*/))return"comment"}switch(l(d.soyState)){case"templ-def":return(h=r.match(/^\.?([\w]+(?!\.[\w]+)*)/))?(d.soyState.pop(),"def"):(r.next(),null);case"templ-ref":return(h=r.match(/(\.?[a-zA-Z_][a-zA-Z_0-9]+)+/))?(d.soyState.pop(),"."==h[0][0]?"variable-2":"variable"):(r.next(),null);case"namespace-def":return(h=r.match(/^\.?([\w\.]+)/))?(d.soyState.pop(),"variable"):(r.next(),null);case"param-def":return(h=r.match(/^\w+/))?(d.variables=i(d.variables,h[0]),d.soyState.pop(),d.soyState.push("param-type"),"def"):(r.next(),null);case"param-ref":return(h=r.match(/^\w+/))?(d.soyState.pop(),"property"):(r.next(),null);case"open-parentheses":return r.match(/[)]/)?(d.soyState.pop(),null):p(r,d);case"param-type":var f=r.peek();return-1!="}]=>,".indexOf(f)?(d.soyState.pop(),null):"["==f?(d.soyState.push("param-type-record"),null):(h=r.match(/^([\w]+|[?])/))?("map"!=h[0]&&"list"!=h[0]||d.soyState.push("param-type-map-list"),"type"):(r.next(),null);case"param-type-record":return"]"==(f=r.peek())?(d.soyState.pop(),null):r.match(/^\w+/)?(d.soyState.push("param-type"),"property"):(r.next(),null);case"param-type-map-list":f=r.peek();return r.match(/^[>]/)?(d.soyState.pop(),null):r.match(/^[<,]/)?(d.soyState.push("param-type"),null):(r.next(),null);case"var-def":return(h=r.match(/^\$([\w]+)/))?(d.variables=i(d.variables,h[1]),d.soyState.pop(),"def"):(r.next(),null);case"record-literal":return r.match(/^[)]/)?(d.soyState.pop(),null):r.match(/[(,]/)?(d.soyState.push("map-value"),d.soyState.push("record-key"),null):(r.next(),null);case"map-literal":return r.match(/^[)]/)?(d.soyState.pop(),null):r.match(/[(,]/)?(d.soyState.push("map-value"),d.soyState.push("map-value"),null):(r.next(),null);case"list-literal":return r.match(/\]/)?(d.soyState.pop(),d.lookupVariables=!0,null):r.match(/for\b/)?(d.soyState.push("var-def"),"keyword"):r.match(/in\b/)?(d.lookupVariables=!0,"keyword"):p(r,d);case"record-key":return r.match(/[\w]+/)?"property":r.match(/^[:]/)?(d.soyState.pop(),null):(r.next(),null);case"map-value":return")"==r.peek()||","==r.peek()||r.match(/^[:)]/)?(d.soyState.pop(),null):p(r,d);case"tag":var S=(w="/"==d.tag[0])?d.tag.substring(1):d.tag,g=a[S];if(r.match(/^\/?}/)){var b="/}"==r.current();return b&&!w&&c(d),"/template"==d.tag||"/deltemplate"==d.tag?(d.variables=i(null,"ij"),d.indent=0):d.indent-=e.indentUnit*(b||-1==n.indexOf(d.tag)?2:1),d.soyState.pop(),"keyword"}if(r.match(/^([\w?]+)(?==)/)){if(d.context&&d.context.tag==S&&"kind"==r.current()&&(h=r.match(/^="([^"]+)/,!1))){var v=h[1];d.context.kind=v;var x=o[v]||o.html;(I=l(d.localStates)).mode.indent&&(d.indent+=I.mode.indent(I.state,"","")),d.localStates.push({mode:x,state:t.startState(x)})}return"attribute"}return p(r,d);case"literal":return r.match(/^(?=\{\/literal})/)?(d.soyState.pop(),this.token(r,d)):s(r,d,/\{\/literal}/)}if(r.match(/^\{literal}/))return d.indent+=e.indentUnit,d.soyState.push("literal"),d.context=new u(d.context,"literal",d.variables),"keyword";if(h=r.match(/^\{([/@\\]?\w+\??)(?=$|[\s}]|\/[/*])/)){var k=d.tag;d.tag=h[1];var w="/"==d.tag[0],T=!!a[d.tag];S=w?d.tag.substring(1):d.tag,g=a[S];"/switch"!=d.tag&&(d.indent+=((w||g&&g.reduceIndent)&&"switch"!=k?1:2)*e.indentUnit),d.soyState.push("tag");var E=!1;if(g)if(w||g.soyState&&d.soyState.push(g.soyState),g.noEndTag||!T&&w){if(w)if(d.context&&d.context.tag==S){if(d.context){var I;if(d.context.kind)d.localStates.pop(),(I=l(d.localStates)).mode.indent&&(d.indent-=I.mode.indent(I.state,"",""));c(d)}}else E=!0}else d.context=new u(d.context,d.tag,g.variableScope?d.variables:null);else w&&(E=!0);return(E?"error ":"")+"keyword"}return r.eat("{")?(d.tag="print",d.indent+=2*e.indentUnit,d.soyState.push("tag"),"keyword"):s(r,d,/\{|\s+\/\/|\/\*/)},indent:function(a,n,r){var o=a.indent,s=l(a.soyState);if("comment"==s)return t.Pass;if("literal"==s)/^\{\/literal}/.test(n)&&(o-=e.indentUnit);else{if(/^\s*\{\/(template|deltemplate)\b/.test(n))return 0;/^\{(\/|(fallbackmsg|elseif|else|ifempty)\b)/.test(n)&&(o-=e.indentUnit),"switch"!=a.tag&&/^\{(case|default)\b/.test(n)&&(o-=e.indentUnit),/^\{\/switch\b/.test(n)&&(o-=e.indentUnit)}var i=l(a.localStates);return o&&i.mode.indent&&(o+=i.mode.indent(i.state,n,r)),o},innerMode:function(t){return t.soyState.length&&"literal"!=l(t.soyState)?null:l(t.localStates)},electricInput:/^\s*\{(\/|\/template|\/deltemplate|\/switch|fallbackmsg|elseif|else|case|default|ifempty|\/literal\})$/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",useInnerComments:!1,fold:"indent"}}),"htmlmixed"),t.registerHelper("wordChars","soy",/[\w$]/),t.registerHelper("hintWords","soy",Object.keys(a).concat(["css","debugger"])),t.defineMIME("text/x-soy","soy")})); \ No newline at end of file +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed"],t):t(CodeMirror)}((function(t){"use strict";var e={noEndTag:!0,soyState:"param-def"},a={alias:{noEndTag:!0},delpackage:{noEndTag:!0},namespace:{noEndTag:!0,soyState:"namespace-def"},"@param":e,"@param?":e,"@inject":e,"@inject?":e,"@state":e,template:{soyState:"templ-def",variableScope:!0},literal:{},msg:{},fallbackmsg:{noEndTag:!0,reduceIndent:!0},select:{},plural:{},let:{soyState:"var-def"},if:{},elseif:{noEndTag:!0,reduceIndent:!0},else:{noEndTag:!0,reduceIndent:!0},switch:{},case:{noEndTag:!0,reduceIndent:!0},default:{noEndTag:!0,reduceIndent:!0},foreach:{variableScope:!0,soyState:"for-loop"},ifempty:{noEndTag:!0,reduceIndent:!0},for:{variableScope:!0,soyState:"for-loop"},call:{soyState:"templ-ref"},param:{soyState:"param-ref"},print:{noEndTag:!0},deltemplate:{soyState:"templ-def",variableScope:!0},delcall:{soyState:"templ-ref"},log:{},element:{variableScope:!0}},n=Object.keys(a).filter((function(t){return!a[t].noEndTag||a[t].reduceIndent}));t.defineMode("soy",(function(e){var r=t.getMode(e,"text/plain"),o={html:t.getMode(e,{name:"text/html",multilineTagIndentFactor:2,multilineTagIndentPastTag:!1}),attributes:r,text:r,uri:r,trusted_resource_uri:r,css:t.getMode(e,"text/css"),js:t.getMode(e,{name:"text/javascript",statementIndent:2*e.indentUnit})};function l(t){return t[t.length-1]}function s(t,e,a){if(t.sol()){for(var n=0;n<e.indent&&t.eat(/\s/);n++);if(n)return null}var r=t.string,o=a.exec(r.substr(t.pos));o&&(t.string=r.substr(0,t.pos+o.index));var s=t.hideFirstChars(e.indent,(function(){var a=l(e.localStates);return a.mode.token(t,a.state)}));return t.string=r,s}function i(t,e){return{element:e,next:t}}function c(t){t.context&&(t.context.scope&&(t.variables=t.context.scope),t.context=t.context.previousContext)}function p(t,e,a){return function(t,e){for(;t;){if(t.element===e)return!0;t=t.next}return!1}(t,e)?"variable-2":a?"variable":"variable-2 error"}function u(t,e,a){this.previousContext=t,this.tag=e,this.kind=null,this.scope=a}function m(t,e){var a;return t.match(/[[]/)?(e.soyState.push("list-literal"),e.context=new u(e.context,"list-literal",e.variables),e.lookupVariables=!1,null):t.match(/map\b/)?(e.soyState.push("map-literal"),"keyword"):t.match(/record\b/)?(e.soyState.push("record-literal"),"keyword"):t.match(/([\w]+)(?=\()/)?"variable callee":(a=t.match(/^["']/))?(e.soyState.push("string"),e.quoteKind=a[0],"string"):t.match(/^[(]/)?(e.soyState.push("open-parentheses"),null):t.match(/(null|true|false)(?!\w)/)||t.match(/0x([0-9a-fA-F]{2,})/)||t.match(/-?([0-9]*[.])?[0-9]+(e[0-9]*)?/)?"atom":t.match(/(\||[+\-*\/%]|[=!]=|\?:|[<>]=?)/)?"operator":(a=t.match(/^\$([\w]+)/))?p(e.variables,a[1],!e.lookupVariables):(a=t.match(/^\w+/))?/^(?:as|and|or|not|in|if)$/.test(a[0])?"keyword":null:(t.next(),null)}return{startState:function(){return{soyState:[],variables:i(null,"ij"),scopes:null,indent:0,quoteKind:null,context:null,lookupVariables:!0,localStates:[{mode:o.html,state:t.startState(o.html)}]}},copyState:function(e){return{tag:e.tag,soyState:e.soyState.concat([]),variables:e.variables,context:e.context,indent:e.indent,quoteKind:e.quoteKind,lookupVariables:e.lookupVariables,localStates:e.localStates.map((function(e){return{mode:e.mode,state:t.copyState(e.mode,e.state)}}))}},token:function(r,d){switch(l(d.soyState)){case"comment":if(r.match(/^.*?\*\//)?d.soyState.pop():r.skipToEnd(),!d.context||!d.context.scope)for(var y=/@param\??\s+(\S+)/g,h=r.current();f=y.exec(h);)d.variables=i(d.variables,f[1]);return"comment";case"string":var f;return(f=r.match(/^.*?(["']|\\[\s\S])/))?f[1]==d.quoteKind&&(d.quoteKind=null,d.soyState.pop()):r.skipToEnd(),"string"}if(!d.soyState.length||"literal"!=l(d.soyState)){if(r.match(/^\/\*/))return d.soyState.push("comment"),"comment";if(r.match(r.sol()?/^\s*\/\/.*/:/^\s+\/\/.*/))return"comment"}switch(l(d.soyState)){case"templ-def":return(f=r.match(/^\.?([\w]+(?!\.[\w]+)*)/))?(d.soyState.pop(),"def"):(r.next(),null);case"templ-ref":return(f=r.match(/(\.?[a-zA-Z_][a-zA-Z_0-9]+)+/))?(d.soyState.pop(),"."==f[0][0]?"variable-2":"variable"):(f=r.match(/^\$([\w]+)/))?(d.soyState.pop(),p(d.variables,f[1],!d.lookupVariables)):(r.next(),null);case"namespace-def":return(f=r.match(/^\.?([\w\.]+)/))?(d.soyState.pop(),"variable"):(r.next(),null);case"param-def":return(f=r.match(/^\w+/))?(d.variables=i(d.variables,f[0]),d.soyState.pop(),d.soyState.push("param-type"),"def"):(r.next(),null);case"param-ref":return(f=r.match(/^\w+/))?(d.soyState.pop(),"property"):(r.next(),null);case"open-parentheses":return r.match(/[)]/)?(d.soyState.pop(),null):m(r,d);case"param-type":var S=r.peek();return-1!="}]=>,".indexOf(S)?(d.soyState.pop(),null):"["==S?(d.soyState.push("param-type-record"),null):"("==S?(d.soyState.push("param-type-template"),null):"<"==S?(d.soyState.push("param-type-parameter"),null):(f=r.match(/^([\w]+|[?])/))?"type":(r.next(),null);case"param-type-record":return"]"==(S=r.peek())?(d.soyState.pop(),null):r.match(/^\w+/)?(d.soyState.push("param-type"),"property"):(r.next(),null);case"param-type-parameter":return r.match(/^[>]/)?(d.soyState.pop(),null):r.match(/^[<,]/)?(d.soyState.push("param-type"),null):(r.next(),null);case"param-type-template":return r.match(/[>]/)?(d.soyState.pop(),d.soyState.push("param-type"),null):r.match(/^\w+/)?(d.soyState.push("param-type"),"def"):(r.next(),null);case"var-def":return(f=r.match(/^\$([\w]+)/))?(d.variables=i(d.variables,f[1]),d.soyState.pop(),"def"):(r.next(),null);case"for-loop":return r.match(/\bin\b/)?(d.soyState.pop(),"keyword"):"$"==r.peek()?(d.soyState.push("var-def"),null):(r.next(),null);case"record-literal":return r.match(/^[)]/)?(d.soyState.pop(),null):r.match(/[(,]/)?(d.soyState.push("map-value"),d.soyState.push("record-key"),null):(r.next(),null);case"map-literal":return r.match(/^[)]/)?(d.soyState.pop(),null):r.match(/[(,]/)?(d.soyState.push("map-value"),d.soyState.push("map-value"),null):(r.next(),null);case"list-literal":return r.match(/\]/)?(d.soyState.pop(),d.lookupVariables=!0,c(d),null):r.match(/\bfor\b/)?(d.lookupVariables=!0,d.soyState.push("for-loop"),"keyword"):m(r,d);case"record-key":return r.match(/[\w]+/)?"property":r.match(/^[:]/)?(d.soyState.pop(),null):(r.next(),null);case"map-value":return")"==r.peek()||","==r.peek()||r.match(/^[:)]/)?(d.soyState.pop(),null):m(r,d);case"import":return r.eat(";")?(d.soyState.pop(),d.indent-=2*e.indentUnit,null):r.match(/\w+(?=\s+as)/)?"variable":(f=r.match(/\w+/))?/(from|as)/.test(f[0])?"keyword":"def":(f=r.match(/^["']/))?(d.soyState.push("string"),d.quoteKind=f[0],"string"):(r.next(),null);case"tag":var b=(T="/"==d.tag[0])?d.tag.substring(1):d.tag,g=a[b];if(r.match(/^\/?}/)){var x="/}"==r.current();return x&&!T&&c(d),"/template"==d.tag||"/deltemplate"==d.tag?(d.variables=i(null,"ij"),d.indent=0):d.indent-=e.indentUnit*(x||-1==n.indexOf(d.tag)?2:1),d.soyState.pop(),"keyword"}if(r.match(/^([\w?]+)(?==)/)){if(d.context&&d.context.tag==b&&"kind"==r.current()&&(f=r.match(/^="([^"]+)/,!1))){var v=f[1];d.context.kind=v;var k=o[v]||o.html;(C=l(d.localStates)).mode.indent&&(d.indent+=C.mode.indent(C.state,"","")),d.localStates.push({mode:k,state:t.startState(k)})}return"attribute"}return m(r,d);case"literal":return r.match(/^(?=\{\/literal})/)?(d.soyState.pop(),this.token(r,d)):s(r,d,/\{\/literal}/)}if(r.match(/^\{literal}/))return d.indent+=e.indentUnit,d.soyState.push("literal"),d.context=new u(d.context,"literal",d.variables),"keyword";if(f=r.match(/^\{([/@\\]?\w+\??)(?=$|[\s}]|\/[/*])/)){var w=d.tag;d.tag=f[1];var T="/"==d.tag[0],E=!!a[d.tag];b=T?d.tag.substring(1):d.tag,g=a[b];"/switch"!=d.tag&&(d.indent+=((T||g&&g.reduceIndent)&&"switch"!=w?1:2)*e.indentUnit),d.soyState.push("tag");var I=!1;if(g)if(T||g.soyState&&d.soyState.push(g.soyState),g.noEndTag||!E&&T){if(T)if(d.context&&d.context.tag==b){if(d.context){var C;if(d.context.kind)d.localStates.pop(),(C=l(d.localStates)).mode.indent&&(d.indent-=C.mode.indent(C.state,"",""));c(d)}}else I=!0}else d.context=new u(d.context,d.tag,g.variableScope?d.variables:null);else T&&(I=!0);return(I?"error ":"")+"keyword"}return r.eat("{")?(d.tag="print",d.indent+=2*e.indentUnit,d.soyState.push("tag"),"keyword"):!d.context&&r.match(/\bimport\b/)?(d.soyState.push("import"),d.indent+=2*e.indentUnit,"keyword"):s(r,d,/\{|\s+\/\/|\/\*/)},indent:function(a,n,r){var o=a.indent,s=l(a.soyState);if("comment"==s)return t.Pass;if("literal"==s)/^\{\/literal}/.test(n)&&(o-=e.indentUnit);else{if(/^\s*\{\/(template|deltemplate)\b/.test(n))return 0;/^\{(\/|(fallbackmsg|elseif|else|ifempty)\b)/.test(n)&&(o-=e.indentUnit),"switch"!=a.tag&&/^\{(case|default)\b/.test(n)&&(o-=e.indentUnit),/^\{\/switch\b/.test(n)&&(o-=e.indentUnit)}var i=l(a.localStates);return o&&i.mode.indent&&(o+=i.mode.indent(i.state,n,r)),o},innerMode:function(t){return t.soyState.length&&"literal"!=l(t.soyState)?null:l(t.localStates)},electricInput:/^\s*\{(\/|\/template|\/deltemplate|\/switch|fallbackmsg|elseif|else|case|default|ifempty|\/literal\})$/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",useInnerComments:!1,fold:"indent"}}),"htmlmixed"),t.registerHelper("wordChars","soy",/[\w$]/),t.registerHelper("hintWords","soy",Object.keys(a).concat(["css","debugger"])),t.defineMIME("text/x-soy","soy")})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/sql/sql.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/sql/sql.js index 92c3db9a2a94..083ffc2e6f33 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/sql/sql.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/sql/sql.js @@ -1 +1 @@ -!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;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 r(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 a(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}e.defineMode("sql",(function(t,r){var a=r.client||{},s=r.atoms||{false:!0,true:!0,null:!0},l=r.builtin||n(o),c=r.keywords||n(i),u=r.operatorChars||/^[*+\-%<>!=&|~^\/]/,d=r.support||{},m=r.hooks||{},p=r.dateSQL||{date:!0,time:!0,timestamp:!0},g=!1!==r.backslashStringEscapes,b=r.brackets||/^[\{}\(\)\[\]]/,h=r.punctuation||/^[;.,:]/;function f(e,t){var r=e.next();if(m[r]){var i=m[r](e,t);if(!1!==i)return i}if(d.hexNumber&&("0"==r&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==r||"X"==r)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(d.binaryNumber&&(("b"==r||"B"==r)&&e.match(/^'[01]+'/)||"0"==r&&e.match(/^b[01]+/)))return"number";if(r.charCodeAt(0)>47&&r.charCodeAt(0)<58)return e.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/),d.decimallessFloat&&e.match(/^\.(?!\.)/),"number";if("?"==r&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==r||'"'==r&&d.doubleQuote)return t.tokenize=_(r),t.tokenize(e,t);if((d.nCharCast&&("n"==r||"N"==r)||d.charsetCast&&"_"==r&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(d.escapeConstant&&("e"==r||"E"==r)&&("'"==e.peek()||'"'==e.peek()&&d.doubleQuote))return t.tokenize=function(e,t){return(t.tokenize=_(e.next(),!0))(e,t)},"keyword";if(d.commentSlashSlash&&"/"==r&&e.eat("/"))return e.skipToEnd(),"comment";if(d.commentHash&&"#"==r||"-"==r&&e.eat("-")&&(!d.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==r&&e.eat("*"))return t.tokenize=function e(t){return function(r,a){var i=r.match(/^.*?(\/\*|\*\/)/);return i?"/*"==i[1]?a.tokenize=e(t+1):a.tokenize=t>1?e(t-1):f:r.skipToEnd(),"comment"}}(1),t.tokenize(e,t);if("."!=r){if(u.test(r))return e.eatWhile(u),"operator";if(b.test(r))return"bracket";if(h.test(r))return e.eatWhile(h),"punctuation";if("{"==r&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var n=e.current().toLowerCase();return p.hasOwnProperty(n)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":s.hasOwnProperty(n)?"atom":l.hasOwnProperty(n)?"builtin":c.hasOwnProperty(n)?"keyword":a.hasOwnProperty(n)?"string-2":null}return d.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":e.match(/^\.+/)?null:d.ODBCdotTable&&e.match(/^[\w\d_]+/)?"variable-2":void 0}function _(e,t){return function(r,a){for(var i,n=!1;null!=(i=r.next());){if(i==e&&!n){a.tokenize=f;break}n=(g||t)&&!n&&"\\"==i}return"string"}}function y(e,t,r){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:r}}return{startState:function(){return{tokenize:f,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),t.tokenize==f&&e.eatSpace())return null;var r=t.tokenize(e,t);if("comment"==r)return r;t.context&&null==t.context.align&&(t.context.align=!0);var a=e.current();return"("==a?y(e,t,")"):"["==a?y(e,t,"]"):t.context&&t.context.type==a&&function(e){e.indent=e.context.indent,e.context=e.context.prev}(t),r},indent:function(r,a){var i=r.context;if(!i)return e.Pass;var n=a.charAt(0)==i.type;return i.align?i.col+(n?0:1):i.indent+(n?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:d.commentSlashSlash?"//":d.commentHash?"#":"--",closeBrackets:"()[]{}''\"\"``"}}));var i="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 ";function n(e){for(var t={},r=e.split(" "),a=0;a<r.length;++a)t[r[a]]=!0;return t}var o="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";e.defineMIME("text/x-sql",{name:"sql",keywords:n(i+"begin"),builtin:n(o),atoms:n("false true null unknown"),dateSQL:n("date time timestamp"),support:n("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:n("$partition binary_checksum checksum connectionproperty context_info current_request_id error_line error_message error_number error_procedure error_severity error_state formatmessage get_filestream_transaction_context getansinull host_id host_name isnull isnumeric min_active_rowversion newid newsequentialid rowcount_big xact_state object_id"),keywords:n(i+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare exec go if use index holdlock nolock nowait paglock readcommitted readcommittedlock readpast readuncommitted repeatableread rowlock serializable snapshot tablock tablockx updlock with"),builtin:n("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:n("is not null like and or in left right between inner outer join all any some cross unpivot pivot exists"),operatorChars:/^[*+\-%<>!=^\&|\/]/,brackets:/^[\{}\(\)]/,punctuation:/^[;.,:/]/,backslashStringEscapes:!1,dateSQL:n("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":r}}),e.defineMIME("text/x-mysql",{name:"sql",client:n("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:n(i+"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:n("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:n("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":r,"`":t,"\\":a}}),e.defineMIME("text/x-mariadb",{name:"sql",client:n("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:n(i+"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:n("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:n("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":r,"`":t,"\\":a}}),e.defineMIME("text/x-sqlite",{name:"sql",client:n("auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width"),keywords:n(i+"abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without"),builtin:n("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real"),atoms:n("null current_date current_time current_timestamp"),operatorChars:/^[*+\-%<>!=&|/~]/,dateSQL:n("date time timestamp datetime"),support:n("decimallessFloat zerolessFloat"),identifierQuote:'"',hooks:{"@":r,":":r,"?":r,$:r,'"':function(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},"`":t}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:n("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:n("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:n("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:n("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:n("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:n("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:n("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 length lengthb 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:n("date time timestamp"),support:n("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:n("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 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 unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with admin authorization char compact compactions conf cube current current_date current_timestamp day decimal defined dependency directories elem_type exchange file following for grouping hour ignore inner interval jar less logical macro minute month more none noscan over owner partialscan preceding pretty principals protection reload rewrite role roles rollup rows second server sets skewed transactions truncate unbounded unset uri user values window year"),builtin:n("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype key_type utctimestamp value_type varchar"),atoms:n("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:n("date timestamp"),support:n("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-pgsql",{name:"sql",client:n("source"),keywords:n(i+"a abort abs absent absolute access according action ada add admin after aggregate alias all allocate also alter always analyse analyze and any are array array_agg array_max_cardinality as asc asensitive assert assertion assignment asymmetric at atomic attach attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli between bigint binary bit bit_length blob blocked bom boolean both breadth by c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain char char_length character character_length character_set_catalog character_set_name character_set_schema characteristics characters check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column column_name columns command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constant constraint constraint_catalog constraint_name constraint_schema constraints constructor contains content continue control conversion convert copy corr corresponding cost count covar_pop covar_samp create cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datatype date datetime_interval_code datetime_interval_precision day db deallocate debug dec decimal declare default defaults deferrable deferred defined definer degree delete delimiter delimiters dense_rank depends depth deref derived desc describe descriptor detach detail deterministic diagnostics dictionary disable discard disconnect dispatch distinct dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain double drop dump dynamic dynamic_function dynamic_function_code each element else elseif elsif empty enable encoding encrypted end end_frame end_partition endexec enforced enum equals errcode error escape event every except exception exclude excluding exclusive exec execute exists exit exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreach foreign fortran forward found frame_row free freeze from fs full function functions fusion g general generated get global go goto grant granted greatest group grouping groups handler having header hex hierarchy hint hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import in include including increment indent index indexes indicator info inherit inherits initially inline inner inout input insensitive insert instance instantiable instead int integer integrity intersect intersection interval into invoker is isnull isolation join k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like like_regex limit link listen ln load local localtime localtimestamp location locator lock locked log logged loop lower m map mapping match matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized not nothing notice notify notnull nowait nth_value ntile null nullable nullif nulls number numeric object occurrences_regex octet_length octets of off offset oids old on only open operator option options or order ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password path percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding precision prepare prepared preserve primary print_strict_params prior privileges procedural procedure procedures program public publication query quote raise range rank read reads real reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result result_oid return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns reverse revoke right role rollback rollup routine routine_catalog routine_name routine_schema routines row row_count row_number rows rowtype rule savepoint scale schema schema_name schemas scope scope_catalog scope_name scope_schema scroll search second section security select selective self sensitive sequence sequences serializable server server_name session session_user set setof sets share show similar simple size skip slice smallint snapshot some source space specific specific_name specifictype sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable stacked standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time system_user t table table_name tables tablesample tablespace temp template temporary text then ties time timestamp timezone_hour timezone_minute to token top_level_count trailing transaction transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted union unique unknown unlink unlisten unlogged unnamed unnest until untyped update upper uri usage use_column use_variable user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of values var_pop var_samp varbinary varchar variable_conflict variadic varying verbose version versioning view views volatile warning when whenever where while whitespace width_bucket window with within without work wrapper write xml xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes zone"),builtin:n("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:n("false true null unknown"),operatorChars:/^[*\/+\-%<>!=&|^\/#@?~]/,backslashStringEscapes:!1,dateSQL:n("date time timestamp"),support:n("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast escapeConstant")}),e.defineMIME("text/x-gql",{name:"sql",keywords:n("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),atoms:n("false true"),builtin:n("blob datetime first key __key__ string integer double boolean null"),operatorChars:/^[*+\-%<>!=]/}),e.defineMIME("text/x-gpsql",{name:"sql",client:n("source"),keywords:n("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone"),builtin:n("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:n("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),e.defineMIME("text/x-sparksql",{name:"sql",keywords:n("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases datata dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"),builtin:n("tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat"),atoms:n("false true null"),operatorChars:/^[*\/+\-%<>!=~&|^]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable doubleQuote zerolessFloat")}),e.defineMIME("text/x-esper",{name:"sql",client:n("source"),keywords:n("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 after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window"),builtin:{},atoms:n("false true null"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:n("time"),support:n("decimallessFloat zerolessFloat binaryNumber hexNumber")})})); \ No newline at end of file +!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;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 r(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 a(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}e.defineMode("sql",(function(t,r){var a=r.client||{},s=r.atoms||{false:!0,true:!0,null:!0},l=r.builtin||n(o),c=r.keywords||n(i),u=r.operatorChars||/^[*+\-%<>!=&|~^\/]/,d=r.support||{},m=r.hooks||{},p=r.dateSQL||{date:!0,time:!0,timestamp:!0},g=!1!==r.backslashStringEscapes,b=r.brackets||/^[\{}\(\)\[\]]/,h=r.punctuation||/^[;.,:]/;function f(e,t){var r=e.next();if(m[r]){var i=m[r](e,t);if(!1!==i)return i}if(d.hexNumber&&("0"==r&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==r||"X"==r)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(d.binaryNumber&&(("b"==r||"B"==r)&&e.match(/^'[01]+'/)||"0"==r&&e.match(/^b[01]+/)))return"number";if(r.charCodeAt(0)>47&&r.charCodeAt(0)<58)return e.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/),d.decimallessFloat&&e.match(/^\.(?!\.)/),"number";if("?"==r&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==r||'"'==r&&d.doubleQuote)return t.tokenize=_(r),t.tokenize(e,t);if((d.nCharCast&&("n"==r||"N"==r)||d.charsetCast&&"_"==r&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(d.escapeConstant&&("e"==r||"E"==r)&&("'"==e.peek()||'"'==e.peek()&&d.doubleQuote))return t.tokenize=function(e,t){return(t.tokenize=_(e.next(),!0))(e,t)},"keyword";if(d.commentSlashSlash&&"/"==r&&e.eat("/"))return e.skipToEnd(),"comment";if(d.commentHash&&"#"==r||"-"==r&&e.eat("-")&&(!d.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==r&&e.eat("*"))return t.tokenize=function e(t){return function(r,a){var i=r.match(/^.*?(\/\*|\*\/)/);return i?"/*"==i[1]?a.tokenize=e(t+1):a.tokenize=t>1?e(t-1):f:r.skipToEnd(),"comment"}}(1),t.tokenize(e,t);if("."!=r){if(u.test(r))return e.eatWhile(u),"operator";if(b.test(r))return"bracket";if(h.test(r))return e.eatWhile(h),"punctuation";if("{"==r&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var n=e.current().toLowerCase();return p.hasOwnProperty(n)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":s.hasOwnProperty(n)?"atom":l.hasOwnProperty(n)?"builtin":c.hasOwnProperty(n)?"keyword":a.hasOwnProperty(n)?"string-2":null}return d.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":e.match(/^\.+/)?null:d.ODBCdotTable&&e.match(/^[\w\d_$#]+/)?"variable-2":void 0}function _(e,t){return function(r,a){for(var i,n=!1;null!=(i=r.next());){if(i==e&&!n){a.tokenize=f;break}n=(g||t)&&!n&&"\\"==i}return"string"}}function y(e,t,r){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:r}}return{startState:function(){return{tokenize:f,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),t.tokenize==f&&e.eatSpace())return null;var r=t.tokenize(e,t);if("comment"==r)return r;t.context&&null==t.context.align&&(t.context.align=!0);var a=e.current();return"("==a?y(e,t,")"):"["==a?y(e,t,"]"):t.context&&t.context.type==a&&function(e){e.indent=e.context.indent,e.context=e.context.prev}(t),r},indent:function(r,a){var i=r.context;if(!i)return e.Pass;var n=a.charAt(0)==i.type;return i.align?i.col+(n?0:1):i.indent+(n?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:d.commentSlashSlash?"//":d.commentHash?"#":"--",closeBrackets:"()[]{}''\"\"``"}}));var i="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 ";function n(e){for(var t={},r=e.split(" "),a=0;a<r.length;++a)t[r[a]]=!0;return t}var o="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";e.defineMIME("text/x-sql",{name:"sql",keywords:n(i+"begin"),builtin:n(o),atoms:n("false true null unknown"),dateSQL:n("date time timestamp"),support:n("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:n("$partition binary_checksum checksum connectionproperty context_info current_request_id error_line error_message error_number error_procedure error_severity error_state formatmessage get_filestream_transaction_context getansinull host_id host_name isnull isnumeric min_active_rowversion newid newsequentialid rowcount_big xact_state object_id"),keywords:n(i+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare exec go if use index holdlock nolock nowait paglock readcommitted readcommittedlock readpast readuncommitted repeatableread rowlock serializable snapshot tablock tablockx updlock with"),builtin:n("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:n("is not null like and or in left right between inner outer join all any some cross unpivot pivot exists"),operatorChars:/^[*+\-%<>!=^\&|\/]/,brackets:/^[\{}\(\)]/,punctuation:/^[;.,:/]/,backslashStringEscapes:!1,dateSQL:n("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":r}}),e.defineMIME("text/x-mysql",{name:"sql",client:n("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:n(i+"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:n("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:n("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":r,"`":t,"\\":a}}),e.defineMIME("text/x-mariadb",{name:"sql",client:n("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:n(i+"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:n("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:n("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":r,"`":t,"\\":a}}),e.defineMIME("text/x-sqlite",{name:"sql",client:n("auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width"),keywords:n(i+"abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without"),builtin:n("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real"),atoms:n("null current_date current_time current_timestamp"),operatorChars:/^[*+\-%<>!=&|/~]/,dateSQL:n("date time timestamp datetime"),support:n("decimallessFloat zerolessFloat"),identifierQuote:'"',hooks:{"@":r,":":r,"?":r,$:r,'"':function(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},"`":t}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:n("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:n("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:n("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:n("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:n("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:n("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:n("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 length lengthb 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:n("date time timestamp"),support:n("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:n("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 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 unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with admin authorization char compact compactions conf cube current current_date current_timestamp day decimal defined dependency directories elem_type exchange file following for grouping hour ignore inner interval jar less logical macro minute month more none noscan over owner partialscan preceding pretty principals protection reload rewrite role roles rollup rows second server sets skewed transactions truncate unbounded unset uri user values window year"),builtin:n("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype key_type utctimestamp value_type varchar"),atoms:n("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:n("date timestamp"),support:n("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-pgsql",{name:"sql",client:n("source"),keywords:n(i+"a abort abs absent absolute access according action ada add admin after aggregate alias all allocate also alter always analyse analyze and any are array array_agg array_max_cardinality as asc asensitive assert assertion assignment asymmetric at atomic attach attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli between bigint binary bit bit_length blob blocked bom boolean both breadth by c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain char char_length character character_length character_set_catalog character_set_name character_set_schema characteristics characters check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column column_name columns command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constant constraint constraint_catalog constraint_name constraint_schema constraints constructor contains content continue control conversion convert copy corr corresponding cost count covar_pop covar_samp create cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datatype date datetime_interval_code datetime_interval_precision day db deallocate debug dec decimal declare default defaults deferrable deferred defined definer degree delete delimiter delimiters dense_rank depends depth deref derived desc describe descriptor detach detail deterministic diagnostics dictionary disable discard disconnect dispatch distinct dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain double drop dump dynamic dynamic_function dynamic_function_code each element else elseif elsif empty enable encoding encrypted end end_frame end_partition endexec enforced enum equals errcode error escape event every except exception exclude excluding exclusive exec execute exists exit exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreach foreign fortran forward found frame_row free freeze from fs full function functions fusion g general generated get global go goto grant granted greatest group grouping groups handler having header hex hierarchy hint hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import in include including increment indent index indexes indicator info inherit inherits initially inline inner inout input insensitive insert instance instantiable instead int integer integrity intersect intersection interval into invoker is isnull isolation join k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like like_regex limit link listen ln load local localtime localtimestamp location locator lock locked log logged loop lower m map mapping match matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized not nothing notice notify notnull nowait nth_value ntile null nullable nullif nulls number numeric object occurrences_regex octet_length octets of off offset oids old on only open operator option options or order ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password path percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding precision prepare prepared preserve primary print_strict_params prior privileges procedural procedure procedures program public publication query quote raise range rank read reads real reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result result_oid return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns reverse revoke right role rollback rollup routine routine_catalog routine_name routine_schema routines row row_count row_number rows rowtype rule savepoint scale schema schema_name schemas scope scope_catalog scope_name scope_schema scroll search second section security select selective self sensitive sequence sequences serializable server server_name session session_user set setof sets share show similar simple size skip slice smallint snapshot some source space specific specific_name specifictype sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable stacked standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time system_user t table table_name tables tablesample tablespace temp template temporary text then ties time timestamp timezone_hour timezone_minute to token top_level_count trailing transaction transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted union unique unknown unlink unlisten unlogged unnamed unnest until untyped update upper uri usage use_column use_variable user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of values var_pop var_samp varbinary varchar variable_conflict variadic varying verbose version versioning view views volatile warning when whenever where while whitespace width_bucket window with within without work wrapper write xml xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes zone"),builtin:n("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:n("false true null unknown"),operatorChars:/^[*\/+\-%<>!=&|^\/#@?~]/,backslashStringEscapes:!1,dateSQL:n("date time timestamp"),support:n("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast escapeConstant")}),e.defineMIME("text/x-gql",{name:"sql",keywords:n("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),atoms:n("false true"),builtin:n("blob datetime first key __key__ string integer double boolean null"),operatorChars:/^[*+\-%<>!=]/}),e.defineMIME("text/x-gpsql",{name:"sql",client:n("source"),keywords:n("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone"),builtin:n("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:n("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),e.defineMIME("text/x-sparksql",{name:"sql",keywords:n("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases datata dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"),builtin:n("tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat"),atoms:n("false true null"),operatorChars:/^[*\/+\-%<>!=~&|^]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable doubleQuote zerolessFloat")}),e.defineMIME("text/x-esper",{name:"sql",client:n("source"),keywords:n("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 after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window"),builtin:{},atoms:n("false true null"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:n("time"),support:n("decimallessFloat zerolessFloat binaryNumber hexNumber")})})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/tcl/tcl.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/tcl/tcl.js index fb308efc78ca..471473c0f1b3 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/tcl/tcl.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/tcl/tcl.js @@ -1 +1 @@ -!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("tcl",(function(){function e(e){for(var r={},t=e.split(" "),n=0;n<t.length;++n)r[t[n]]=!0;return r}var r=e("Tcl safe after append array auto_execok auto_import auto_load auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror binary break catch cd close concat continue dde eof encoding error eval exec exit expr fblocked fconfigure fcopy file fileevent filename filename flush for foreach format gets glob global history http if incr info interp join lappend lindex linsert list llength load lrange lreplace lsearch lset lsort memory msgcat namespace open package parray pid pkg::create pkg_mkIndex proc puts pwd re_syntax read regex regexp registry regsub rename resource return scan seek set socket source split string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord tcl_wordBreakAfter tcl_startOfPreviousWord tcl_wordBreakBefore tcltest tclvars tell time trace unknown unset update uplevel upvar variable vwait"),t=e("if elseif else and not or eq ne in ni for foreach while switch"),n=/[+\-*&%=<>!?^\/\|]/;function o(e,r,t){return r.tokenize=t,t(e,r)}function a(e,l){var c=l.beforeParams;l.beforeParams=!1;var u,s=e.next();if('"'!=s&&"'"!=s||!l.inParams){if(/[\[\]{}\(\),;\.]/.test(s))return"("==s&&c?l.inParams=!0:")"==s&&(l.inParams=!1),null;if(/\d/.test(s))return e.eatWhile(/[\w\.]/),"number";if("#"==s)return e.eat("*")?o(e,l,i):"#"==s&&e.match(/ *\[ *\[/)?o(e,l,f):(e.skipToEnd(),"comment");if('"'==s)return e.skipTo(/"/),"comment";if("$"==s)return e.eatWhile(/[$_a-z0-9A-Z\.{:]/),e.eatWhile(/}/),l.beforeParams=!0,"builtin";if(n.test(s))return e.eatWhile(n),"comment";e.eatWhile(/[\w\$_{}\xa1-\uffff]/);var d=e.current().toLowerCase();return r&&r.propertyIsEnumerable(d)?"keyword":t&&t.propertyIsEnumerable(d)?(l.beforeParams=!0,"keyword"):null}return o(e,l,(u=s,function(e,r){for(var t,n=!1,o=!1;null!=(t=e.next());){if(t==u&&!n){o=!0;break}n=!n&&"\\"==t}return o&&(r.tokenize=a),"string"}))}function i(e,r){for(var t,n=!1;t=e.next();){if("#"==t&&n){r.tokenize=a;break}n="*"==t}return"comment"}function f(e,r){for(var t,n=0;t=e.next();){if("#"==t&&2==n){r.tokenize=a;break}"]"==t?n++:" "!=t&&(n=0)}return"meta"}return{startState:function(){return{tokenize:a,beforeParams:!1,inParams:!1}},token:function(e,r){return e.eatSpace()?null:r.tokenize(e,r)}}})),e.defineMIME("text/x-tcl","tcl")})); \ No newline at end of file +!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("tcl",(function(){function e(e){for(var r={},t=e.split(" "),n=0;n<t.length;++n)r[t[n]]=!0;return r}var r=e("Tcl safe after append array auto_execok auto_import auto_load auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror binary break catch cd close concat continue dde eof encoding error eval exec exit expr fblocked fconfigure fcopy file fileevent filename filename flush for foreach format gets glob global history http if incr info interp join lappend lindex linsert list llength load lrange lreplace lsearch lset lsort memory msgcat namespace open package parray pid pkg::create pkg_mkIndex proc puts pwd re_syntax read regex regexp registry regsub rename resource return scan seek set socket source split string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord tcl_wordBreakAfter tcl_startOfPreviousWord tcl_wordBreakBefore tcltest tclvars tell time trace unknown unset update uplevel upvar variable vwait"),t=e("if elseif else and not or eq ne in ni for foreach while switch"),n=/[+\-*&%=<>!?^\/\|]/;function o(e,r,t){return r.tokenize=t,t(e,r)}function a(e,l){var c=l.beforeParams;l.beforeParams=!1;var u,s=e.next();if('"'!=s&&"'"!=s||!l.inParams){if(/[\[\]{}\(\),;\.]/.test(s))return"("==s&&c?l.inParams=!0:")"==s&&(l.inParams=!1),null;if(/\d/.test(s))return e.eatWhile(/[\w\.]/),"number";if("#"==s)return e.eat("*")?o(e,l,i):"#"==s&&e.match(/ *\[ *\[/)?o(e,l,f):(e.skipToEnd(),"comment");if('"'==s)return e.skipTo(/"/),"comment";if("$"==s)return e.eatWhile(/[$_a-z0-9A-Z\.{:]/),e.eatWhile(/}/),l.beforeParams=!0,"builtin";if(n.test(s))return e.eatWhile(n),"comment";e.eatWhile(/[\w\$_{}\xa1-\uffff]/);var d=e.current().toLowerCase();return r&&r.propertyIsEnumerable(d)?"keyword":t&&t.propertyIsEnumerable(d)?(l.beforeParams=!0,"keyword"):null}return o(e,l,(u=s,function(e,r){for(var t,n=!1,o=!1;null!=(t=e.next());){if(t==u&&!n){o=!0;break}n=!n&&"\\"==t}return o&&(r.tokenize=a),"string"}))}function i(e,r){for(var t,n=!1;t=e.next();){if("#"==t&&n){r.tokenize=a;break}n="*"==t}return"comment"}function f(e,r){for(var t,n=0;t=e.next();){if("#"==t&&2==n){r.tokenize=a;break}"]"==t?n++:" "!=t&&(n=0)}return"meta"}return{startState:function(){return{tokenize:a,beforeParams:!1,inParams:!1}},token:function(e,r){return e.eatSpace()?null:r.tokenize(e,r)},lineComment:"#"}})),e.defineMIME("text/x-tcl","tcl")})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/wast/wast.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/wast/wast.js new file mode 100644 index 000000000000..616411003854 --- /dev/null +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/mode/wast/wast.js @@ -0,0 +1 @@ +!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";e.defineSimpleMode("wast",{start:[{regex:/[+\-]?(?:nan(?::0x[0-9a-fA-F]+)?|infinity|inf|0x[0-9a-fA-F]+\.?[0-9a-fA-F]*p[+\/-]?\d+|\d+(?:\.\d*)?[eE][+\-]?\d*|\d+\.\d*|0x[0-9a-fA-F]+|\d+)/,token:"number"},{regex:/mut|nop|block|if|then|else|loop|br_if|br_table|br|call(_indirect)?|drop|end|return(_call(_indirect)?)?|local\.(get|set|tee)|global\.(get|set)|i(32|64)\.(store(8|16)|(load(8|16)_[su]))|i64\.(load32_[su]|store32)|[fi](32|64)\.(const|load|store)|f(32|64)\.(abs|add|ceil|copysign|div|eq|floor|[gl][et]|max|min|mul|nearest|neg?|sqrt|sub|trunc)|i(32|64)\.(a[dn]d|c[lt]z|(div|rem)_[su]|eqz?|[gl][te]_[su]|mul|ne|popcnt|rot[lr]|sh(l|r_[su])|sub|x?or)|i64\.extend_[su]_i32|i32\.wrap_i64|i(32|64)\.trunc_f(32|64)_[su]|f(32|64)\.convert_i(32|64)_[su]|f64\.promote_f32|f32\.demote_f64|f32\.reinterpret_i32|i32\.reinterpret_f32|f64\.reinterpret_i64|i64\.reinterpret_f64|select|unreachable|current_memory|memory(\.((atomic\.(notify|wait(32|64)))|grow|size))?|type|func|param|result|local|global|module|table|start|elem|data|align|offset|import|export|i64\.atomic\.(load32_u|store32|rmw32\.(a[dn]d|sub|x?or|(cmp)?xchg)_u)|i(32|64)\.atomic\.(load((8|16)_u)?|store(8|16)?|rmw(\.(a[dn]d|sub|x?or|(cmp)?xchg)|(8|16)\.(a[dn]d|sub|x?or|(cmp)?xchg)_u))|v128\.(load|store|const|not|andnot|and|or|xor|bitselect)|i(8x16|16x8|32x4|64x2)\.(shl|shr_[su])|i(8x16|16x8)\.(extract_lane_[su]|((add|sub)_saturate_[su])|avgr_u)|(i(8x16|16x8|32x4|64x2)|f(32x4|64x2))\.(splat|replace_lane|neg|add|sub)|i(8x16|16x8|32x4)\.(eq|ne|([lg][te]_[su])|abs|any_true|all_true|bitmask|((min|max)_[su]))|f(32x4|64x2)\.(eq|ne|[lg][te]|abs|sqrt|mul|div|min|max)|[fi](32x4|64x2)\.extract_lane|v8x16\.(shuffle|swizzle)|i16x8\.(load8x8_[su]|narrow_i32x4_[su]|widen_(low|high)_i8x16_[su]|mul)|i32x4\.(load16x4_[su]|widen_(low|high)_i16x8_[su]|mul|trunc_sat_f32x4_[su])|i64x2\.(load32x2_[su]|mul)|(v(8x16|16x8|32x4|64x2)\.load_splat)|i8x16\.narrow_i16x8_[su]|f32x4\.convert_i32x4_[su]/,token:"keyword"},{regex:/\b(anyfunc|[fi](32|64))\b/,token:"atom"},{regex:/\$([a-zA-Z0-9_`\+\-\*\/\\\^~=<>!\?@#$%&|:\.]+)/,token:"variable-2"},{regex:/"(?:[^"\\\x00-\x1f\x7f]|\\[nt\\'"]|\\[0-9a-fA-F][0-9a-fA-F])*"/,token:"string"},{regex:/\(;.*?/,token:"comment",next:"comment"},{regex:/;;.*$/,token:"comment"},{regex:/\(/,indent:!0},{regex:/\)/,dedent:!0}],comment:[{regex:/.*?;\)/,token:"comment",next:"start"},{regex:/.*/,token:"comment"}],meta:{dontIndentStates:["comment"]}}),e.defineMIME("text/webassembly","wast")})); \ No newline at end of file diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/package.json b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/package.json index 84ef216a905e..ba8e7fc79d5f 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/package.json +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/package.json @@ -1,6 +1,6 @@ { "name": "codemirror", - "version": "5.52.0", + "version": "5.58.1", "main": "lib/codemirror.js", "style": "lib/codemirror.css", "author": { @@ -21,11 +21,11 @@ "lint": "bin/lint" }, "devDependencies": { + "@rollup/plugin-buble": "^0.21.3", "blint": "^1.1.0", "node-static": "0.7.11", "puppeteer": "^1.20.0", - "rollup": "^1.26.3", - "rollup-plugin-buble": "^0.19.8" + "rollup": "^1.26.3" }, "bugs": "http://github.com/codemirror/CodeMirror/issues", "keywords": [ @@ -42,5 +42,6 @@ "directories": {}, "dependencies": {}, "devDependencies": {} - } + }, + "dependencies": {} } diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/zenburn.css b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/zenburn.css index 781c40acac3f..4eb4247c9285 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/zenburn.css +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/theme/zenburn.css @@ -11,7 +11,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; } -.cm-s-zenburn { background-color: #3f3f3f; color: #dcdccc; } +.cm-s-zenburn.CodeMirror { background-color: #3f3f3f; color: #dcdccc; } .cm-s-zenburn span.cm-builtin { color: #dcdccc; font-weight: bold; } .cm-s-zenburn span.cm-comment { color: #7f9f7f; } .cm-s-zenburn span.cm-keyword { color: #f0dfaf; font-weight: bold; } -- GitLab