text: /*! For license information please see vendors~node-playground-editor.js.LICENSE.txt */
  (window.webpackJsonp=window.webpackJsonp||[]).push([[8],{2602:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__(3372),__webpack_require__(2381),__webpack_require__(2409),__webpack_require__(2410),__webpack_require__(2405),__webpack_require__(2412),__webpack_require__(2437),__webpack_require__(2413),__webpack_require__(2416);var _editor_api_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(2162);for(var __WEBPACK_IMPORT_KEY__ in _editor_api_js__WEBPACK_IMPORTED_MODULE_9__)"default"!==__WEBPACK_IMPORT_KEY__&&function(key){__webpack_require__.d(__webpack_exports__,key,(function(){return _editor_api_js__WEBPACK_IMPORTED_MODULE_9__[key]}))}(__WEBPACK_IMPORT_KEY__)},2603:function(module,exports,__webpack_require__){module.exports=__webpack_require__(3351)()},2604:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.processSize=function(size){return/^\d+$/.test(size)?"".concat(size,"px"):size},exports.noop=function(){}},3340:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.initVimMode=function(editor){var statusbarNode=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,StatusBarClass=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_statusbar.default,sanitizer=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,vimAdapter=new _keymap_vim.default(editor);if(!statusbarNode)return vimAdapter.attach(),vimAdapter;var statusBar=new StatusBarClass(statusbarNode,editor,sanitizer),keyBuffer="";return vimAdapter.on("vim-mode-change",(function(mode){statusBar.setMode(mode)})),vimAdapter.on("vim-keypress",(function(key){":"===key?keyBuffer="":keyBuffer+=key,statusBar.setKeyBuffer(keyBuffer)})),vimAdapter.on("vim-command-done",(function(){keyBuffer="",statusBar.setKeyBuffer(keyBuffer)})),vimAdapter.on("dispose",(function(){statusBar.toggleVisibility(!1),statusBar.closeInput(),statusBar.clear()})),statusBar.toggleVisibility(!0),vimAdapter.setStatusBar(statusBar),vimAdapter.attach(),vimAdapter},Object.defineProperty(exports,"VimMode",{enumerable:!0,get:function(){return _keymap_vim.default}}),Object.defineProperty(exports,"StatusBar",{enumerable:!0,get:function(){return _statusbar.default}});var _keymap_vim=_interopRequireDefault(__webpack_require__(3341)),_statusbar=_interopRequireDefault(__webpack_require__(3348));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}},3341:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Vim=void 0;var obj,_cm_adapter=(obj=__webpack_require__(3342))&&obj.__esModule?obj:{default:obj};function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}var defaultKeymap=[{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:"<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:"<CR>",type:"keyToKey",toKeys:"j^",context:"visual"},{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:"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-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:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},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:"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}},{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"}],defaultExCommandMap=[{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"}],Pos=_cm_adapter.default.Pos,Vim=function(){function detachVimMap(cm,next){cm.attached=!1,this==_cm_adapter.default.keyMap.vim&&_cm_adapter.default.rmClass(cm.getWrapperElement(),"cm-fat-cursor"),next&&next.attach==attachVimMap||function(cm){cm.setOption("disableInput",!1),cm.off("cursorActivity",onCursorActivity),cm.state.vim=null,cm.leaveVimMode()}(cm)}function attachVimMap(cm,prev){this==_cm_adapter.default.keyMap.vim&&(cm.attached=!0),prev&&prev.attach==attachVimMap||function(cm){cm.setOption("disableInput",!0),cm.setOption("showCursorWhenSelecting",!1),_cm_adapter.default.signal(cm,"vim-mode-change",{mode:"normal"}),cm.on("cursorActivity",onCursorActivity),maybeInitVimState(cm),cm.enterVimMode()}(cm)}function cmKey(key,cm){if(cm){if(this[key])return this[key];var vimKey=function(key){if("'"==key.charAt(0))return key.charAt(1);var pieces=key.split(/-(?!$)/),lastPiece=pieces[pieces.length-1];if(1==pieces.length&&1==pieces[0].length)return!1;if(2==pieces.length&&"Shift"==pieces[0]&&1==lastPiece.length)return!1;for(var hasCharacter=!1,i=0;i<pieces.length;i++){var piece=pieces[i];piece in modifiers?pieces[i]=modifiers[piece]:hasCharacter=!0,piece in specialKeys&&(pieces[i]=specialKeys[piece])}if(!hasCharacter)return!1;isUpperCase(lastPiece)&&(pieces[pieces.length-1]=lastPiece.toLowerCase());return"<"+pieces.join("-")+">"}(key);if(!vimKey)return!1;var cmd=_cm_adapter.default.Vim.findKey(cm,vimKey);return"function"==typeof cmd&&_cm_adapter.default.signal(cm,"vim-keypress",vimKey),cmd}}_cm_adapter.default.defineOption("vimMode",!1,(function(cm,val,prev){val&&"vim"!=cm.getOption("keyMap")?cm.setOption("keyMap","vim"):!val&&prev!=_cm_adapter.default.Init&&/^vim/.test(cm.getOption("keyMap"))&&cm.setOption("keyMap","default")}));var modifiers={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A"},specialKeys={Enter:"CR",Backspace:"BS",Delete:"Del",Insert:"Ins"};var numberRegex=/[\d]/,wordCharTest=[_cm_adapter.default.isWordChar,function(ch){return ch&&!_cm_adapter.default.isWordChar(ch)&&!/\s/.test(ch)}],bigWordCharTest=[function(ch){return/\S/.test(ch)}];function makeKeyRange(start,size){for(var keys=[],i=start;i<start+size;i++)keys.push(String.fromCharCode(i));return keys}var upperCaseAlphabet=makeKeyRange(65,26),lowerCaseAlphabet=makeKeyRange(97,26),numbers=makeKeyRange(48,10),validMarks=[].concat(upperCaseAlphabet,lowerCaseAlphabet,numbers,["<",">"]),validRegisters=[].concat(upperCaseAlphabet,lowerCaseAlphabet,numbers,["-",'"',".",":","/"]);function isLine(cm,line){return line>=cm.firstLine()&&line<=cm.lastLine()}function isLowerCase(k){return/^[a-z]$/.test(k)}function isUpperCase(k){return/^[A-Z]$/.test(k)}function isWhiteSpaceString(k){return/^\s*$/.test(k)}function isEndOfSentenceSymbol(k){return-1!=".?!".indexOf(k)}function inArray(val,arr){for(var i=0;i<arr.length;i++)if(arr[i]==val)return!0;return!1}var options={};function defineOption(name,defaultValue,type,aliases,callback){if(void 0===defaultValue&&!callback)throw Error("defaultValue is required unless callback is provided");if(type||(type="string"),options[name]={type:type,defaultValue:defaultValue,callback:callback},aliases)for(var i=0;i<aliases.length;i++)options[aliases[i]]=options[name];defaultValue&&setOption(name,defaultValue)}function setOption(name,value,cm,cfg){var option=options[name],scope=(cfg=cfg||{}).scope;if(!option)return new Error("Unknown option: "+name);if("boolean"==option.type){if(value&&!0!==value)return new Error("Invalid argument: "+name+"="+value);!1!==value&&(value=!0)}option.callback?("local"!==scope&&option.callback(value,void 0),"global"!==scope&&cm&&option.callback(value,cm)):("local"!==scope&&(option.value="boolean"==option.type?!!value:value),"global"!==scope&&cm&&(cm.state.vim.options[name]={value:value}))}function getOption(name,cm,cfg){var option=options[name],scope=(cfg=cfg||{}).scope;if(!option)return new Error("Unknown option: "+name);if(option.callback){var local=cm&&option.callback(void 0,cm);return"global"!==scope&&void 0!==local?local:"local"!==scope?option.callback():void 0}return((local="global"!==scope&&cm&&cm.state.vim.options[name])||"local"!==scope&&option||{}).value}defineOption("filetype",void 0,"string",["ft"],(function(name,cm){if(void 0!==cm){if(void 0===name)return"null"==(mode=cm.getOption("mode"))?"":mode;var mode=""==name?"null":name;cm.setOption("mode",mode)}}));var vimGlobalState,lastInsertModeKeyTimer,createInsertModeChanges=function(c){return c?{changes:c.changes,expectCursorActivityForChange:c.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};function MacroModeState(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=createInsertModeChanges()}function maybeInitVimState(cm){return cm.state.vim||(cm.state.vim={inputState:new InputState,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:{}}),cm.state.vim}function resetVimGlobalState(){var pointer,head,tail,buffer;for(var optionName in vimGlobalState={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:(pointer=-1,head=0,tail=0,buffer=new Array(100),{cachedCursor:void 0,add:function(cm,oldCur,newCur){var curMark=buffer[pointer%100];function useNextSlot(cursor){var next=++pointer%100,trashMark=buffer[next];trashMark&&trashMark.clear(),buffer[next]=cm.setBookmark(cursor)}if(curMark){var markPos=curMark.find();markPos&&!cursorEqual(markPos,oldCur)&&useNextSlot(oldCur)}else useNextSlot(oldCur);useNextSlot(newCur),head=pointer,(tail=pointer-100+1)<0&&(tail=0)},move:function(cm,offset){(pointer+=offset)>head?pointer=head:pointer<tail&&(pointer=tail);var mark=buffer[(100+pointer)%100];if(mark&&!mark.find()){var newCur,inc=offset>0?1:-1,oldCur=cm.getCursor();do{if((mark=buffer[(100+(pointer+=inc))%100])&&(newCur=mark.find())&&!cursorEqual(oldCur,newCur))break}while(pointer<head&&pointer>tail)}return mark}}),macroModeState:new MacroModeState,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new RegisterController({}),searchHistoryController:new HistoryController,exCommandHistoryController:new HistoryController},options){var option=options[optionName];option.value=option.defaultValue}}MacroModeState.prototype={exitMacroRecordMode:function(){var macroModeState=vimGlobalState.macroModeState;macroModeState.onRecordingDone&&macroModeState.onRecordingDone(),macroModeState.onRecordingDone=void 0,macroModeState.isRecording=!1},enterMacroRecordMode:function(cm,registerName){var register=vimGlobalState.registerController.getRegister(registerName);register&&(register.clear(),this.latestRegister=registerName,cm.openDialog&&(this.onRecordingDone=cm.openDialog("(recording)["+registerName+"]",null,{bottom:!0})),this.isRecording=!0)}};var vimApi={buildKeyMap:function(){},getRegisterController:function(){return vimGlobalState.registerController},resetVimGlobalState_:resetVimGlobalState,getVimGlobalState_:function(){return vimGlobalState},maybeInitVimState_:maybeInitVimState,suppressErrorLogging:!1,InsertModeKey:InsertModeKey,map:function(lhs,rhs,ctx){exCommandDispatcher.map(lhs,rhs,ctx)},unmap:function(lhs,ctx){exCommandDispatcher.unmap(lhs,ctx)},setOption:setOption,getOption:getOption,defineOption:defineOption,defineEx:function(name,prefix,func){if(prefix){if(0!==name.indexOf(prefix))throw new Error('(Vim.defineEx) "'+prefix+'" is not a prefix of "'+name+'", command not registered')}else prefix=name;exCommands[name]=func,exCommandDispatcher.commandMap_[prefix]={name:name,shortName:prefix,type:"api"}},handleKey:function(cm,key,origin){var command=this.findKey(cm,key,origin);if("function"==typeof command)return command()},findKey:function(cm,key,origin){var command,vim=maybeInitVimState(cm);function handleMacroRecording(){var macroModeState=vimGlobalState.macroModeState;if(macroModeState.isRecording){if("q"==key)return macroModeState.exitMacroRecordMode(),clearInputState(cm),!0;"mapping"!=origin&&function(macroModeState,key){if(macroModeState.isPlaying)return;var registerName=macroModeState.latestRegister,register=vimGlobalState.registerController.getRegister(registerName);register&&register.pushText(key)}(macroModeState,key)}}function handleEsc(){if("<Esc>"==key)return clearInputState(cm),vim.visualMode?exitVisualMode(cm):vim.insertMode&&exitInsertMode(cm),!0}return!1===(command=vim.insertMode?function(){if(handleEsc())return!0;for(var keys=vim.inputState.keyBuffer=vim.inputState.keyBuffer+key,keysAreChars=1==key.length,match=commandDispatcher.matchCommand(keys,defaultKeymap,vim.inputState,"insert");keys.length>1&&"full"!=match.type;){keys=vim.inputState.keyBuffer=keys.slice(1);var thisMatch=commandDispatcher.matchCommand(keys,defaultKeymap,vim.inputState,"insert");"none"!=thisMatch.type&&(match=thisMatch)}if("none"==match.type)return clearInputState(cm),!1;if("partial"==match.type)return lastInsertModeKeyTimer&&window.clearTimeout(lastInsertModeKeyTimer),lastInsertModeKeyTimer=window.setTimeout((function(){vim.insertMode&&vim.inputState.keyBuffer&&clearInputState(cm)}),getOption("insertModeEscKeysTimeout")),!keysAreChars;if(lastInsertModeKeyTimer&&window.clearTimeout(lastInsertModeKeyTimer),keysAreChars){for(var selections=cm.listSelections(),i=0;i<selections.length;i++){var here=selections[i].head;cm.replaceRange("",offsetCursor(here,0,-(keys.length-1)),here,"+input")}vimGlobalState.macroModeState.lastInsertModeChanges.changes.pop()}return clearInputState(cm),match.command}():function(){if(handleMacroRecording()||handleEsc())return!0;var keys=vim.inputState.keyBuffer=vim.inputState.keyBuffer+key;if(/^[1-9]\d*$/.test(keys))return!0;if(!(keysMatcher=/^(\d*)(.*)$/.exec(keys)))return clearInputState(cm),!1;var keysMatcher,context=vim.visualMode?"visual":"normal",match=commandDispatcher.matchCommand(keysMatcher[2]||keysMatcher[1],defaultKeymap,vim.inputState,context);return"none"==match.type?(clearInputState(cm),!1):"partial"==match.type||(vim.inputState.keyBuffer="",(keysMatcher=/^(\d*)(.*)$/.exec(keys))[1]&&"0"!=keysMatcher[1]&&vim.inputState.pushRepeatDigit(keysMatcher[1]),match.command)}())?vim.insertMode||1!==key.length?void 0:function(){return!0}:!0===command?function(){return!0}:function(){return cm.operation((function(){cm.curOp.isVimOp=!0;try{"keyToKey"==command.type?function(keys){for(var match;keys;)match=/<\w+-.+?>|<\w+>|./.exec(keys),key=match[0],keys=keys.substring(match.index+key.length),_cm_adapter.default.Vim.handleKey(cm,key,"mapping")}(command.toKeys):commandDispatcher.processCommand(cm,vim,command)}catch(e){throw cm.state.vim=void 0,maybeInitVimState(cm),_cm_adapter.default.Vim.suppressErrorLogging||console.log(e),e}return!0}))}},handleEx:function(cm,input){exCommandDispatcher.processCommand(cm,input)},defineMotion:function(name,fn){motions[name]=fn},defineAction:function(name,fn){actions[name]=fn},defineOperator:function(name,fn){operators[name]=fn},mapCommand:function(keys,type,name,args,extra){var command={keys:keys,type:type};for(var key in command[type]=name,command[type+"Args"]=args,extra)command[key]=extra[key];_mapCommand(command)},_mapCommand:_mapCommand,defineRegister:function(name,register){var registers=vimGlobalState.registerController.registers;if(!name||1!=name.length)throw Error("Register name must be 1 character");if(registers[name])throw Error("Register already defined "+name);registers[name]=register,validRegisters.push(name)},exitVisualMode:exitVisualMode,exitInsertMode:exitInsertMode};function InputState(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=null}function clearInputState(cm,reason){cm.state.vim.inputState=new InputState,_cm_adapter.default.signal(cm,"vim-command-done",reason)}function Register(text,linewise,blockwise){this.clear(),this.keyBuffer=[text||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!linewise,this.blockwise=!!blockwise}function RegisterController(registers){this.registers=registers,this.unnamedRegister=registers['"']=new Register,registers["."]=new Register,registers[":"]=new Register,registers["/"]=new Register}function HistoryController(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}InputState.prototype.pushRepeatDigit=function(n){this.operator?this.motionRepeat=this.motionRepeat.concat(n):this.prefixRepeat=this.prefixRepeat.concat(n)},InputState.prototype.getRepeat=function(){var repeat=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(repeat=1,this.prefixRepeat.length>0&&(repeat*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(repeat*=parseInt(this.motionRepeat.join(""),10))),repeat},Register.prototype={setText:function(text,linewise,blockwise){this.keyBuffer=[text||""],this.linewise=!!linewise,this.blockwise=!!blockwise},pushText:function(text,linewise){linewise&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(text)},pushInsertModeChanges:function(changes){this.insertModeChanges.push(createInsertModeChanges(changes))},pushSearchQuery:function(query){this.searchQueries.push(query)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},RegisterController.prototype={pushText:function(registerName,operator,text,linewise,blockwise){linewise&&"\n"!==text.charAt(text.length-1)&&(text+="\n");var register=this.isValidRegister(registerName)?this.getRegister(registerName):null;if(register){isUpperCase(registerName)?register.pushText(text,linewise):register.setText(text,linewise,blockwise),this.unnamedRegister.setText(register.toString(),linewise)}else{switch(operator){case"yank":this.registers[0]=new Register(text,linewise,blockwise);break;case"delete":case"change":-1==text.indexOf("\n")?this.registers["-"]=new Register(text,linewise):(this.shiftNumericRegisters_(),this.registers[1]=new Register(text,linewise))}this.unnamedRegister.setText(text,linewise,blockwise)}},getRegister:function(name){return this.isValidRegister(name)?(name=name.toLowerCase(),this.registers[name]||(this.registers[name]=new Register),this.registers[name]):this.unnamedRegister},isValidRegister:function(name){return name&&inArray(name,validRegisters)},shiftNumericRegisters_:function(){for(var i=9;i>=2;i--)this.registers[i]=this.getRegister(""+(i-1))}},HistoryController.prototype={nextMatch:function(input,up){var historyBuffer=this.historyBuffer,dir=up?-1:1;null===this.initialPrefix&&(this.initialPrefix=input);for(var i=this.iterator+dir;up?i>=0:i<historyBuffer.length;i+=dir)for(var element=historyBuffer[i],j=0;j<=element.length;j++)if(this.initialPrefix==element.substring(0,j))return this.iterator=i,element;return i>=historyBuffer.length?(this.iterator=historyBuffer.length,this.initialPrefix):i<0?input:void 0},pushInput:function(input){var index=this.historyBuffer.indexOf(input);index>-1&&this.historyBuffer.splice(index,1),input.length&&this.historyBuffer.push(input)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var commandDispatcher={matchCommand:function(keys,keyMap,inputState,context){var bestMatch,matches=function(keys,keyMap,context,inputState){for(var match,partial=[],full=[],i=0;i<keyMap.length;i++){var command=keyMap[i];"insert"==context&&"insert"!=command.context||command.context&&command.context!=context||inputState.operator&&"action"==command.type||!(match=commandMatch(keys,command.keys))||("partial"==match&&partial.push(command),"full"==match&&full.push(command))}return{partial:partial.length&&partial,full:full.length&&full}}(keys,keyMap,context,inputState);if(!matches.full&&!matches.partial)return{type:"none"};if(!matches.full&&matches.partial)return{type:"partial"};for(var i=0;i<matches.full.length;i++){var match=matches.full[i];bestMatch||(bestMatch=match)}if("<character>"==bestMatch.keys.slice(-11)){var character=function(keys){var match=/^.*(<[^>]+>)$/.exec(keys),selectedCharacter=match?match[1]:keys.slice(-1);if(selectedCharacter.length>1)switch(selectedCharacter){case"<CR>":selectedCharacter="\n";break;case"<Space>":selectedCharacter=" ";break;default:selectedCharacter=""}return selectedCharacter}(keys);if(!character)return{type:"none"};inputState.selectedCharacter=character}return{type:"full",command:bestMatch}},processCommand:function(cm,vim,command){switch(vim.inputState.repeatOverride=command.repeatOverride,command.type){case"motion":this.processMotion(cm,vim,command);break;case"operator":this.processOperator(cm,vim,command);break;case"operatorMotion":this.processOperatorMotion(cm,vim,command);break;case"action":this.processAction(cm,vim,command);break;case"search":this.processSearch(cm,vim,command);break;case"ex":case"keyToEx":this.processEx(cm,vim,command)}},processMotion:function(cm,vim,command){vim.inputState.motion=command.motion,vim.inputState.motionArgs=copyArgs(command.motionArgs),this.evalInput(cm,vim)},processOperator:function(cm,vim,command){var inputState=vim.inputState;if(inputState.operator){if(inputState.operator==command.operator)return inputState.motion="expandToLine",inputState.motionArgs={linewise:!0},void this.evalInput(cm,vim);clearInputState(cm)}inputState.operator=command.operator,inputState.operatorArgs=copyArgs(command.operatorArgs),vim.visualMode&&this.evalInput(cm,vim)},processOperatorMotion:function(cm,vim,command){var visualMode=vim.visualMode,operatorMotionArgs=copyArgs(command.operatorMotionArgs);operatorMotionArgs&&visualMode&&operatorMotionArgs.visualLine&&(vim.visualLine=!0),this.processOperator(cm,vim,command),visualMode||this.processMotion(cm,vim,command)},processAction:function(cm,vim,command){var inputState=vim.inputState,repeat=inputState.getRepeat(),repeatIsExplicit=!!repeat,actionArgs=copyArgs(command.actionArgs)||{};inputState.selectedCharacter&&(actionArgs.selectedCharacter=inputState.selectedCharacter),command.operator&&this.processOperator(cm,vim,command),command.motion&&this.processMotion(cm,vim,command),(command.motion||command.operator)&&this.evalInput(cm,vim),actionArgs.repeat=repeat||1,actionArgs.repeatIsExplicit=repeatIsExplicit,actionArgs.registerName=inputState.registerName,clearInputState(cm),vim.lastMotion=null,command.isEdit&&this.recordLastEdit(vim,inputState,command),actions[command.action](cm,actionArgs,vim)},processSearch:function(cm,vim,command){if(cm.getSearchCursor){var forward=command.searchArgs.forward,wholeWordOnly=command.searchArgs.wholeWordOnly;getSearchState(cm).setReversed(!forward);var promptPrefix=forward?"/":"?",originalQuery=getSearchState(cm).getQuery(),originalScrollPos=cm.getScrollInfo();switch(command.searchArgs.querySrc){case"prompt":var macroModeState=vimGlobalState.macroModeState;if(macroModeState.isPlaying)handleQuery(query=macroModeState.replaySearchQueries.shift(),!0,!1);else showPrompt(cm,{onClose:function(query){cm.scrollTo(originalScrollPos.left,originalScrollPos.top),handleQuery(query,!0,!0);var macroModeState=vimGlobalState.macroModeState;macroModeState.isRecording&&function(macroModeState,query){if(macroModeState.isPlaying)return;var registerName=macroModeState.latestRegister,register=vimGlobalState.registerController.getRegister(registerName);register&&register.pushSearchQuery&&register.pushSearchQuery(query)}(macroModeState,query)},prefix:promptPrefix,desc:searchPromptDesc,onKeyUp:function(e,query,close){var up,offset,parsedQuery,keyName=_cm_adapter.default.keyName(e);"Up"==keyName||"Down"==keyName?(up="Up"==keyName,offset=e.target?e.target.selectionEnd:0,close(query=vimGlobalState.searchHistoryController.nextMatch(query,up)||""),offset&&e.target&&(e.target.selectionEnd=e.target.selectionStart=Math.min(offset,e.target.value.length))):"Left"!=keyName&&"Right"!=keyName&&"Ctrl"!=keyName&&"Alt"!=keyName&&"Shift"!=keyName&&vimGlobalState.searchHistoryController.reset();try{parsedQuery=updateSearchQuery(cm,query,!0,!0)}catch(e){}parsedQuery?cm.scrollIntoView(_findNext(cm,!forward,parsedQuery),30):(clearSearchHighlight(cm),cm.scrollTo(originalScrollPos.left,originalScrollPos.top))},onKeyDown:function(e,query,close){var keyName=_cm_adapter.default.keyName(e);"Esc"==keyName||"Ctrl-C"==keyName||"Ctrl-["==keyName||"Backspace"==keyName&&""==query?(vimGlobalState.searchHistoryController.pushInput(query),vimGlobalState.searchHistoryController.reset(),updateSearchQuery(cm,originalQuery),clearSearchHighlight(cm),cm.scrollTo(originalScrollPos.left,originalScrollPos.top),_cm_adapter.default.e_stop(e),clearInputState(cm),close(),cm.focus()):"Up"==keyName||"Down"==keyName?_cm_adapter.default.e_stop(e):"Ctrl-U"==keyName&&(_cm_adapter.default.e_stop(e),close(""))}});break;case"wordUnderCursor":var word=expandWordUnderCursor(cm,!1,!0,!1,!0),isKeyword=!0;if(word||(word=expandWordUnderCursor(cm,!1,!0,!1,!1),isKeyword=!1),!word)return;var query=cm.getLine(word.start.line).substring(word.start.ch,word.end.ch);query=isKeyword&&wholeWordOnly?"\\b"+query+"\\b":query.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1"),vimGlobalState.jumpList.cachedCursor=cm.getCursor(),cm.setCursor(word.start),handleQuery(query,!0,!1)}}function handleQuery(query,ignoreCase,smartCase){vimGlobalState.searchHistoryController.pushInput(query),vimGlobalState.searchHistoryController.reset();try{updateSearchQuery(cm,query,ignoreCase,smartCase)}catch(e){return showConfirm(cm,"Invalid regex: "+query),void clearInputState(cm)}commandDispatcher.processMotion(cm,vim,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:command.searchArgs.toJumplist}})}},processEx:function(cm,vim,command){function onPromptClose(input){vimGlobalState.exCommandHistoryController.pushInput(input),vimGlobalState.exCommandHistoryController.reset(),exCommandDispatcher.processCommand(cm,input)}function onPromptKeyDown(e,input,close){var up,offset,keyName=_cm_adapter.default.keyName(e);("Esc"==keyName||"Ctrl-C"==keyName||"Ctrl-["==keyName||"Backspace"==keyName&&""==input)&&(vimGlobalState.exCommandHistoryController.pushInput(input),vimGlobalState.exCommandHistoryController.reset(),_cm_adapter.default.e_stop(e),clearInputState(cm),close(),cm.focus()),"Up"==keyName||"Down"==keyName?(_cm_adapter.default.e_stop(e),up="Up"==keyName,offset=e.target?e.target.selectionEnd:0,close(input=vimGlobalState.exCommandHistoryController.nextMatch(input,up)||""),offset&&e.target&&(e.target.selectionEnd=e.target.selectionStart=Math.min(offset,e.target.value.length))):"Ctrl-U"==keyName?(_cm_adapter.default.e_stop(e),close("")):"Left"!=keyName&&"Right"!=keyName&&"Ctrl"!=keyName&&"Alt"!=keyName&&"Shift"!=keyName&&vimGlobalState.exCommandHistoryController.reset()}"keyToEx"==command.type?exCommandDispatcher.processCommand(cm,command.exArgs.input):vim.visualMode?showPrompt(cm,{onClose:onPromptClose,prefix:":",value:"'<,'>",onKeyDown:onPromptKeyDown,selectValueOnOpen:!1}):showPrompt(cm,{onClose:onPromptClose,prefix:":",onKeyDown:onPromptKeyDown})},evalInput:function(cm,vim){var newHead,newAnchor,repeat,inputState=vim.inputState,motion=inputState.motion,motionArgs=inputState.motionArgs||{},operator=inputState.operator,operatorArgs=inputState.operatorArgs||{},registerName=inputState.registerName,sel=vim.sel,origHead=copyCursor(vim.visualMode?clipCursorToContent(cm,sel.head):cm.getCursor("head")),origAnchor=copyCursor(vim.visualMode?clipCursorToContent(cm,sel.anchor):cm.getCursor("anchor")),oldHead=copyCursor(origHead),oldAnchor=copyCursor(origAnchor);if(operator&&this.recordLastEdit(vim,inputState),(repeat=void 0!==inputState.repeatOverride?inputState.repeatOverride:inputState.getRepeat())>0&&motionArgs.explicitRepeat?motionArgs.repeatIsExplicit=!0:(motionArgs.noRepeat||!motionArgs.explicitRepeat&&0===repeat)&&(repeat=1,motionArgs.repeatIsExplicit=!1),inputState.selectedCharacter&&(motionArgs.selectedCharacter=operatorArgs.selectedCharacter=inputState.selectedCharacter),motionArgs.repeat=repeat,clearInputState(cm),motion){var motionResult=motions[motion](cm,origHead,motionArgs,vim);if(vim.lastMotion=motions[motion],!motionResult)return;if(motionArgs.toJumplist){var jumpList=vimGlobalState.jumpList,cachedCursor=jumpList.cachedCursor;cachedCursor?(recordJumpPosition(cm,cachedCursor,motionResult),delete jumpList.cachedCursor):recordJumpPosition(cm,origHead,motionResult)}motionResult instanceof Array?(newAnchor=motionResult[0],newHead=motionResult[1]):newHead=motionResult,newHead||(newHead=copyCursor(origHead)),vim.visualMode?(vim.visualBlock&&newHead.ch===1/0||(newHead=clipCursorToContent(cm,newHead,vim.visualBlock)),newAnchor&&(newAnchor=clipCursorToContent(cm,newAnchor,!0)),newAnchor=newAnchor||oldAnchor,sel.anchor=newAnchor,sel.head=newHead,updateCmSelection(cm),updateMark(cm,vim,"<",cursorIsBefore(newAnchor,newHead)?newAnchor:newHead),updateMark(cm,vim,">",cursorIsBefore(newAnchor,newHead)?newHead:newAnchor)):operator||(newHead=clipCursorToContent(cm,newHead),cm.setCursor(newHead.line,newHead.ch))}if(operator){if(operatorArgs.lastSel){newAnchor=oldAnchor;var lastSel=operatorArgs.lastSel,lineOffset=Math.abs(lastSel.head.line-lastSel.anchor.line),chOffset=Math.abs(lastSel.head.ch-lastSel.anchor.ch);newHead=lastSel.visualLine?Pos(oldAnchor.line+lineOffset,oldAnchor.ch):lastSel.visualBlock?Pos(oldAnchor.line+lineOffset,oldAnchor.ch+chOffset):lastSel.head.line==lastSel.anchor.line?Pos(oldAnchor.line,oldAnchor.ch+chOffset):Pos(oldAnchor.line+lineOffset,oldAnchor.ch),vim.visualMode=!0,vim.visualLine=lastSel.visualLine,vim.visualBlock=lastSel.visualBlock,sel=vim.sel={anchor:newAnchor,head:newHead},updateCmSelection(cm)}else vim.visualMode&&(operatorArgs.lastSel={anchor:copyCursor(sel.anchor),head:copyCursor(sel.head),visualBlock:vim.visualBlock,visualLine:vim.visualLine});var curStart,curEnd,linewise,mode,cmSel;if(vim.visualMode){if(curStart=cursorMin(sel.head,sel.anchor),curEnd=cursorMax(sel.head,sel.anchor),linewise=vim.visualLine||operatorArgs.linewise,cmSel=makeCmSelection(cm,{anchor:curStart,head:curEnd},mode=vim.visualBlock?"block":linewise?"line":"char"),linewise){var ranges=cmSel.ranges;if("block"==mode)for(var i=0;i<ranges.length;i++)ranges[i].head.ch=lineLength(cm,ranges[i].head.line);else"line"==mode&&(ranges[0].head=Pos(ranges[0].head.line+1,0))}}else{if(curStart=copyCursor(newAnchor||oldAnchor),cursorIsBefore(curEnd=copyCursor(newHead||oldHead),curStart)){var tmp=curStart;curStart=curEnd,curEnd=tmp}(linewise=motionArgs.linewise||operatorArgs.linewise)?function(_cm,curStart,curEnd){curStart.ch=0,curEnd.ch=0,curEnd.line++}(0,curStart,curEnd):motionArgs.forward&&function(cm,curStart,curEnd){var selection=cm.getRange(curStart,curEnd);if(/\n\s*$/.test(selection)){var lines=selection.split("\n");lines.pop();for(var line=lines.pop();lines.length>0&&line&&isWhiteSpaceString(line);line=lines.pop())curEnd.line--,curEnd.ch=0;line?(curEnd.line--,curEnd.ch=lineLength(cm,curEnd.line)):curEnd.ch=0}}(cm,curStart,curEnd),cmSel=makeCmSelection(cm,{anchor:curStart,head:curEnd},mode="char",!motionArgs.inclusive||linewise)}cm.setSelections(cmSel.ranges,cmSel.primary),vim.lastMotion=null,operatorArgs.repeat=repeat,operatorArgs.registerName=registerName,operatorArgs.linewise=linewise;var operatorMoveTo=operators[operator](cm,operatorArgs,cmSel.ranges,oldAnchor,newHead);vim.visualMode&&exitVisualMode(cm,null!=operatorMoveTo),operatorMoveTo&&cm.setCursor(operatorMoveTo)}},recordLastEdit:function(vim,inputState,actionCommand){var macroModeState=vimGlobalState.macroModeState;macroModeState.isPlaying||(vim.lastEditInputState=inputState,vim.lastEditActionCommand=actionCommand,macroModeState.lastInsertModeChanges.changes=[],macroModeState.lastInsertModeChanges.expectCursorActivityForChange=!1)}},motions={moveToTopLine:function(cm,_head,motionArgs){var line=getUserVisibleLines(cm).top+motionArgs.repeat-1;return Pos(line,cm.findFirstNonWhiteSpaceCharacter(line))},moveToMiddleLine:function(cm){var range=getUserVisibleLines(cm),line=Math.floor(.5*(range.top+range.bottom));return Pos(line,cm.findFirstNonWhiteSpaceCharacter(line))},moveToBottomLine:function(cm,_head,motionArgs){var line=getUserVisibleLines(cm).bottom-motionArgs.repeat+1;return Pos(line,cm.findFirstNonWhiteSpaceCharacter(line))},expandToLine:function(_cm,head,motionArgs){return Pos(head.line+motionArgs.repeat-1,1/0)},findNext:function(cm,_head,motionArgs){var state=getSearchState(cm),query=state.getQuery();if(query){var prev=!motionArgs.forward;return prev=state.isReversed()?!prev:prev,highlightSearchMatches(cm,query),_findNext(cm,prev,query,motionArgs.repeat)}},goToMark:function(cm,_head,motionArgs,vim){var pos=getMarkPos(cm,vim,motionArgs.selectedCharacter);return pos?motionArgs.linewise?{line:pos.line,ch:cm.findFirstNonWhiteSpaceCharacter(pos.line)}:pos:null},moveToOtherHighlightedEnd:function(cm,_head,motionArgs,vim){if(vim.visualBlock&&motionArgs.sameLine){var sel=vim.sel;return[clipCursorToContent(cm,Pos(sel.anchor.line,sel.head.ch)),clipCursorToContent(cm,Pos(sel.head.line,sel.anchor.ch))]}return[vim.sel.head,vim.sel.anchor]},jumpToMark:function(cm,head,motionArgs,vim){for(var best=head,i=0;i<motionArgs.repeat;i++){var cursor=best;for(var key in vim.marks)if(isLowerCase(key)){var mark=vim.marks[key].find();if(!((motionArgs.forward?cursorIsBefore(mark,cursor):cursorIsBefore(cursor,mark))||motionArgs.linewise&&mark.line==cursor.line)){var equal=cursorEqual(cursor,best),between=motionArgs.forward?cursorIsBetween(cursor,mark,best):cursorIsBetween(best,mark,cursor);(equal||between)&&(best=mark)}}}return motionArgs.linewise&&(best=Pos(best.line,cm.findFirstNonWhiteSpaceCharacter(best.line))),best},moveByCharacters:function(_cm,head,motionArgs){var cur=head,repeat=motionArgs.repeat,ch=motionArgs.forward?cur.ch+repeat:cur.ch-repeat;return Pos(cur.line,ch)},moveByLines:function(cm,head,motionArgs,vim){var cur=head,endCh=cur.ch;switch(vim.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:endCh=vim.lastHPos;break;default:vim.lastHPos=endCh}var repeat=motionArgs.repeat+(motionArgs.repeatOffset||0),line=motionArgs.forward?cur.line+repeat:cur.line-repeat,first=cm.firstLine(),last=cm.lastLine();return line<first&&cur.line==first?this.moveToStartOfLine(cm,head,motionArgs,vim):line>last&&cur.line==last?this.moveToEol(cm,head,motionArgs,vim):(motionArgs.toFirstChar&&(endCh=cm.findFirstNonWhiteSpaceCharacter(line),vim.lastHPos=endCh),vim.lastHSPos=cm.charCoords(Pos(line,endCh),"div").left,Pos(line,endCh))},moveByDisplayLines:function(cm,head,motionArgs,vim){var cur=head;switch(vim.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:vim.lastHSPos=cm.charCoords(cur,"div").left}var repeat=motionArgs.repeat;if((res=cm.findPosV(cur,motionArgs.forward?repeat:-repeat,"line",vim.lastHSPos)).hitSide)if(motionArgs.forward)var goalCoords={top:cm.charCoords(res,"div").top+8,left:vim.lastHSPos},res=cm.coordsChar(goalCoords,"div");else{var resCoords=cm.charCoords(Pos(cm.firstLine(),0),"div");resCoords.left=vim.lastHSPos,res=cm.coordsChar(resCoords,"div")}return vim.lastHPos=res.ch,res},moveByPage:function(cm,head,motionArgs){var curStart=head,repeat=motionArgs.repeat;return cm.findPosV(curStart,motionArgs.forward?repeat:-repeat,"page")},moveByParagraph:function(cm,head,motionArgs){var dir=motionArgs.forward?1:-1;return findParagraph(cm,head,motionArgs.repeat,dir)},moveBySentence:function(cm,head,motionArgs){var dir=motionArgs.forward?1:-1;return function(cm,cur,repeat,dir){function nextChar(cm,idx){if(idx.pos+idx.dir<0||idx.pos+idx.dir>=idx.line.length){if(idx.ln+=idx.dir,!isLine(cm,idx.ln))return idx.line=null,idx.ln=null,void(idx.pos=null);idx.line=cm.getLine(idx.ln),idx.pos=idx.dir>0?0:idx.line.length-1}else idx.pos+=idx.dir}function forward(cm,ln,pos,dir){var stop=""===(line=cm.getLine(ln)),curr={line:line,ln:ln,pos:pos,dir:dir},last_valid={ln:curr.ln,pos:curr.pos},skip_empty_lines=""===curr.line;for(nextChar(cm,curr);null!==curr.line;){if(last_valid.ln=curr.ln,last_valid.pos=curr.pos,""===curr.line&&!skip_empty_lines)return{ln:curr.ln,pos:curr.pos};if(stop&&""!==curr.line&&!isWhiteSpaceString(curr.line[curr.pos]))return{ln:curr.ln,pos:curr.pos};!isEndOfSentenceSymbol(curr.line[curr.pos])||stop||curr.pos!==curr.line.length-1&&!isWhiteSpaceString(curr.line[curr.pos+1])||(stop=!0),nextChar(cm,curr)}var line=cm.getLine(last_valid.ln);last_valid.pos=0;for(var i=line.length-1;i>=0;--i)if(!isWhiteSpaceString(line[i])){last_valid.pos=i;break}return last_valid}function reverse(cm,ln,pos,dir){var curr={line:line=cm.getLine(ln),ln:ln,pos:pos,dir:dir},last_valid={ln:curr.ln,pos:null},skip_empty_lines=""===curr.line;for(nextChar(cm,curr);null!==curr.line;){if(""===curr.line&&!skip_empty_lines)return null!==last_valid.pos?last_valid:{ln:curr.ln,pos:curr.pos};if(isEndOfSentenceSymbol(curr.line[curr.pos])&&null!==last_valid.pos&&(curr.ln!==last_valid.ln||curr.pos+1!==last_valid.pos))return last_valid;""===curr.line||isWhiteSpaceString(curr.line[curr.pos])||(skip_empty_lines=!1,last_valid={ln:curr.ln,pos:curr.pos}),nextChar(cm,curr)}var line=cm.getLine(last_valid.ln);last_valid.pos=0;for(var i=0;i<line.length;++i)if(!isWhiteSpaceString(line[i])){last_valid.pos=i;break}return last_valid}var curr_index={ln:cur.line,pos:cur.ch};for(;repeat>0;)curr_index=dir<0?reverse(cm,curr_index.ln,curr_index.pos,dir):forward(cm,curr_index.ln,curr_index.pos,dir),repeat--;return Pos(curr_index.ln,curr_index.pos)}(cm,head,motionArgs.repeat,dir)},moveByScroll:function(cm,head,motionArgs,vim){var scrollbox=cm.getScrollInfo(),curEnd=null,repeat=motionArgs.repeat;repeat||(repeat=Math.floor(scrollbox.clientHeight/(2*cm.defaultTextHeight())));var orig=cm.charCoords(head,"local");if(motionArgs.repeat=repeat,!(curEnd=motions.moveByDisplayLines(cm,head,motionArgs,vim)))return null;var dest=cm.charCoords(curEnd,"local");return cm.scrollTo(null,scrollbox.top+dest.top-orig.top),curEnd},moveByWords:function(cm,head,motionArgs){return function(cm,cur,repeat,forward,wordEnd,bigWord){var curStart=copyCursor(cur),words=[];(forward&&!wordEnd||!forward&&wordEnd)&&repeat++;for(var emptyLineIsWord=!(forward&&wordEnd),i=0;i<repeat;i++){var word=findWord(cm,cur,forward,bigWord,emptyLineIsWord);if(!word){var eodCh=lineLength(cm,cm.lastLine());words.push(forward?{line:cm.lastLine(),from:eodCh,to:eodCh}:{line:0,from:0,to:0});break}words.push(word),cur=Pos(word.line,forward?word.to-1:word.from)}var shortCircuit=words.length!=repeat,firstWord=words[0],lastWord=words.pop();return forward&&!wordEnd?(shortCircuit||firstWord.from==curStart.ch&&firstWord.line==curStart.line||(lastWord=words.pop()),Pos(lastWord.line,lastWord.from)):forward&&wordEnd?Pos(lastWord.line,lastWord.to-1):!forward&&wordEnd?(shortCircuit||firstWord.to==curStart.ch&&firstWord.line==curStart.line||(lastWord=words.pop()),Pos(lastWord.line,lastWord.to)):Pos(lastWord.line,lastWord.from)}(cm,head,motionArgs.repeat,!!motionArgs.forward,!!motionArgs.wordEnd,!!motionArgs.bigWord)},moveTillCharacter:function(cm,_head,motionArgs){var curEnd=_moveToCharacter(cm,motionArgs.repeat,motionArgs.forward,motionArgs.selectedCharacter),increment=motionArgs.forward?-1:1;return recordLastCharacterSearch(increment,motionArgs),curEnd?(curEnd.ch+=increment,curEnd):null},moveToCharacter:function(cm,head,motionArgs){var repeat=motionArgs.repeat;return recordLastCharacterSearch(0,motionArgs),_moveToCharacter(cm,repeat,motionArgs.forward,motionArgs.selectedCharacter)||head},moveToSymbol:function(cm,head,motionArgs){return function(cm,repeat,forward,symb){var cur=copyCursor(cm.getCursor()),increment=forward?1:-1,endLine=forward?cm.lineCount():-1,curCh=cur.ch,line=cur.line,lineText=cm.getLine(line),state={lineText:lineText,nextCh:lineText.charAt(curCh),lastCh:null,index:curCh,symb:symb,reverseSymb:(forward?{")":"(","}":"{"}:{"(":")","{":"}"})[symb],forward:forward,depth:0,curMoveThrough:!1},mode=symbolToMode[symb];if(!mode)return cur;var init=findSymbolModes[mode].init,isComplete=findSymbolModes[mode].isComplete;init&&init(state);for(;line!==endLine&&repeat;){if(state.index+=increment,state.nextCh=state.lineText.charAt(state.index),!state.nextCh){if(line+=increment,state.lineText=cm.getLine(line)||"",increment>0)state.index=0;else{var lineLen=state.lineText.length;state.index=lineLen>0?lineLen-1:0}state.nextCh=state.lineText.charAt(state.index)}isComplete(state)&&(cur.line=line,cur.ch=state.index,repeat--)}if(state.nextCh||state.curMoveThrough)return Pos(line,state.index);return cur}(cm,motionArgs.repeat,motionArgs.forward,motionArgs.selectedCharacter)||head},moveToColumn:function(cm,head,motionArgs,vim){var repeat=motionArgs.repeat;return vim.lastHPos=repeat-1,vim.lastHSPos=cm.charCoords(head,"div").left,function(cm,repeat){var line=cm.getCursor().line;return clipCursorToContent(cm,Pos(line,repeat-1))}(cm,repeat)},moveToEol:function(cm,head,motionArgs,vim){var cur=head;vim.lastHPos=1/0;var retval=Pos(cur.line+motionArgs.repeat-1,1/0),end=cm.clipPos(retval);return end.ch--,vim.lastHSPos=cm.charCoords(end,"div").left,retval},moveToFirstNonWhiteSpaceCharacter:function(cm,head){var cursor=head;return Pos(cursor.line,cm.findFirstNonWhiteSpaceCharacter(cursor.line))},moveToMatchedSymbol:function(cm,head){var cursor=head,line=cursor.line,ch=cursor.ch;return ch<cm.getLine(line).length?cm.findMatchingBracket(Pos(line,ch)).to:cursor},moveToStartOfLine:function(_cm,head){return Pos(head.line,0)},moveToLineOrEdgeOfDocument:function(cm,_head,motionArgs){var lineNum=motionArgs.forward?cm.lastLine():cm.firstLine();return motionArgs.repeatIsExplicit&&(lineNum=motionArgs.repeat-cm.getOption("firstLineNumber")),Pos(lineNum,cm.findFirstNonWhiteSpaceCharacter(lineNum))},textObjectManipulation:function(cm,head,motionArgs,vim){var character=motionArgs.selectedCharacter;"b"==character?character="(":"B"==character&&(character="{");var tmp,inclusive=!motionArgs.textObjectInner;if({"(":")",")":"(","{":"}","}":"{","[":"]","]":"["}[character])tmp=function(cm,head,symb,inclusive){var start,end,cur=head,bracketRegexp={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[symb],openSym={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[symb],offset=cm.getLine(cur.line).charAt(cur.ch)===openSym?1:0;if(start=cm.scanForBracket(Pos(cur.line,cur.ch+offset),-1,void 0,{bracketRegex:bracketRegexp}),end=cm.scanForBracket(Pos(cur.line,cur.ch+offset),1,void 0,{bracketRegex:bracketRegexp}),!start||!end)return{start:cur,end:cur};if(start=start.pos,end=end.pos,start.line==end.line&&start.ch>end.ch||start.line>end.line){var tmp=start;start=end,end=tmp}inclusive?end.ch+=1:start.ch+=1;return{start:start,end:end}}(cm,head,character,inclusive);else if({"'":!0,'"':!0}[character])tmp=function(cm,head,symb,inclusive){var start,end,i,len,cur=copyCursor(head),chars=cm.getLine(cur.line).split(""),firstIndex=chars.indexOf(symb);cur.ch<firstIndex?cur.ch=firstIndex:firstIndex<cur.ch&&chars[cur.ch]==symb&&(end=cur.ch,--cur.ch);if(chars[cur.ch]!=symb||end)for(i=cur.ch;i>-1&&!start;i--)chars[i]==symb&&(start=i+1);else start=cur.ch+1;if(start&&!end)for(i=start,len=chars.length;i<len&&!end;i++)chars[i]==symb&&(end=i);if(!start||!end)return{start:cur,end:cur};inclusive&&(--start,++end);return{start:Pos(cur.line,start),end:Pos(cur.line,end)}}(cm,head,character,inclusive);else if("W"===character)tmp=expandWordUnderCursor(cm,inclusive,!0,!0);else if("w"===character)tmp=expandWordUnderCursor(cm,inclusive,!0,!1);else{if("p"!==character)return null;if(tmp=findParagraph(cm,head,motionArgs.repeat,0,inclusive),motionArgs.linewise=!0,vim.visualMode)vim.visualLine||(vim.visualLine=!0);else{var operatorArgs=vim.inputState.operatorArgs;operatorArgs&&(operatorArgs.linewise=!0),tmp.end.line--}}return cm.state.vim.visualMode?function(cm,start,end){var tmp,sel=cm.state.vim.sel,head=sel.head,anchor=sel.anchor;cursorIsBefore(end,start)&&(tmp=end,end=start,start=tmp);cursorIsBefore(head,anchor)?(head=cursorMin(start,head),anchor=cursorMax(anchor,end)):(anchor=cursorMin(start,anchor),-1==(head=offsetCursor(head=cursorMax(head,end),0,-1)).ch&&head.line!=cm.firstLine()&&(head=Pos(head.line-1,lineLength(cm,head.line-1))));return[anchor,head]}(cm,tmp.start,tmp.end):[tmp.start,tmp.end]},repeatLastCharacterSearch:function(cm,head,motionArgs){var lastSearch=vimGlobalState.lastCharacterSearch,repeat=motionArgs.repeat,forward=motionArgs.forward===lastSearch.forward,increment=(lastSearch.increment?1:0)*(forward?-1:1);cm.moveH(-1*increment,"char"),motionArgs.inclusive=!!forward;var curEnd=_moveToCharacter(cm,repeat,forward,lastSearch.selectedCharacter);return curEnd?(curEnd.ch+=increment,curEnd):(cm.moveH(increment,"char"),head)}};function fillArray(val,times){for(var arr=[],i=0;i<times;i++)arr.push(val);return arr}var operators={change:function(cm,args,ranges){var finalHead,text,vim=cm.state.vim;if(vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock=vim.visualBlock,vim.visualMode){text=cm.getSelection();var replacement=fillArray("",ranges.length);cm.replaceSelections(replacement),finalHead=cursorMin(ranges[0].head,ranges[0].anchor)}else{var anchor=ranges[0].anchor,head=ranges[0].head;text=cm.getRange(anchor,head);var lastState=vim.lastEditInputState||{};if("moveByWords"==lastState.motion&&!isWhiteSpaceString(text)){var match=/\s+$/.exec(text);match&&lastState.motionArgs&&lastState.motionArgs.forward&&(head=offsetCursor(head,0,-match[0].length),text=text.slice(0,-match[0].length))}var prevLineEnd=new Pos(anchor.line-1,Number.MAX_VALUE),wasLastLine=cm.firstLine()==cm.lastLine();head.line>cm.lastLine()&&args.linewise&&!wasLastLine?cm.replaceRange("",prevLineEnd,head):cm.replaceRange("",anchor,head),args.linewise&&(wasLastLine||(cm.setCursor(prevLineEnd),_cm_adapter.default.commands.newlineAndIndent(cm)),anchor.ch=Number.MAX_VALUE),finalHead=anchor}vimGlobalState.registerController.pushText(args.registerName,"change",text,args.linewise,ranges.length>1),actions.enterInsertMode(cm,{head:finalHead},cm.state.vim)},delete:function(cm,args,ranges){var finalHead,text;cm.pushUndoStop();var vim=cm.state.vim;if(vim.visualBlock){text=cm.getSelection();var replacement=fillArray("",ranges.length);cm.replaceSelections(replacement),finalHead=ranges[0].anchor}else{var anchor=ranges[0].anchor,head=ranges[0].head;args.linewise&&head.line!=cm.firstLine()&&anchor.line==cm.lastLine()&&anchor.line==head.line-1&&(anchor.line==cm.firstLine()?anchor.ch=0:anchor=Pos(anchor.line-1,lineLength(cm,anchor.line-1))),text=cm.getRange(anchor,head),cm.replaceRange("",anchor,head),finalHead=anchor,args.linewise&&(finalHead=motions.moveToFirstNonWhiteSpaceCharacter(cm,anchor))}return vimGlobalState.registerController.pushText(args.registerName,"delete",text,args.linewise,vim.visualBlock),clipCursorToContent(cm,finalHead,vim.insertMode)},indent:function(cm,args,ranges){var vim=cm.state.vim,startLine=ranges[0].anchor.line,endLine=vim.visualBlock?ranges[ranges.length-1].anchor.line:ranges[0].head.line,repeat=vim.visualMode?args.repeat:1;args.linewise&&endLine--,cm.pushUndoStop();for(var i=startLine;i<=endLine;i++)for(var j=0;j<repeat;j++)cm.indentLine(i,args.indentRight);return cm.pushUndoStop(),motions.moveToFirstNonWhiteSpaceCharacter(cm,ranges[0].anchor)},changeCase:function(cm,args,ranges,oldAnchor,newHead){for(var selections=cm.getSelections(),swapped=[],toLower=args.toLower,j=0;j<selections.length;j++){var toSwap=selections[j],text="";if(!0===toLower)text=toSwap.toLowerCase();else if(!1===toLower)text=toSwap.toUpperCase();else for(var i=0;i<toSwap.length;i++){var character=toSwap.charAt(i);text+=isUpperCase(character)?character.toLowerCase():character.toUpperCase()}swapped.push(text)}return cm.replaceSelections(swapped),args.shouldMoveCursor?newHead:!cm.state.vim.visualMode&&args.linewise&&ranges[0].anchor.line+1==ranges[0].head.line?motions.moveToFirstNonWhiteSpaceCharacter(cm,oldAnchor):args.linewise?oldAnchor:cursorMin(ranges[0].anchor,ranges[0].head)},yank:function(cm,args,ranges,oldAnchor){var vim=cm.state.vim,text=cm.getSelection(),endPos=vim.visualMode?cursorMin(vim.sel.anchor,vim.sel.head,ranges[0].head,ranges[0].anchor):oldAnchor;return vimGlobalState.registerController.pushText(args.registerName,"yank",text,args.linewise,vim.visualBlock),endPos}};var actions={jumpListWalk:function(cm,actionArgs,vim){if(!vim.visualMode){var repeat=actionArgs.repeat,forward=actionArgs.forward,mark=vimGlobalState.jumpList.move(cm,forward?repeat:-repeat),markPos=mark?mark.find():void 0;markPos=markPos||cm.getCursor(),cm.setCursor(markPos)}},scroll:function(cm,actionArgs,vim){if(!vim.visualMode){var repeat=actionArgs.repeat||1,lineHeight=cm.defaultTextHeight(),top=cm.getScrollInfo().top,delta=lineHeight*repeat,newPos=actionArgs.forward?top+delta:top-delta,cursor=copyCursor(cm.getCursor()),cursorCoords=cm.charCoords(cursor,"local");if(actionArgs.forward)newPos>cursorCoords.top?(cursor.line+=(newPos-cursorCoords.top)/lineHeight,cursor.line=Math.ceil(cursor.line),cm.setCursor(cursor),cursorCoords=cm.charCoords(cursor,"local"),cm.scrollTo(null,cursorCoords.top)):cm.scrollTo(null,newPos);else{var newBottom=newPos+cm.getScrollInfo().clientHeight;newBottom<cursorCoords.bottom?(cursor.line-=(cursorCoords.bottom-newBottom)/lineHeight,cursor.line=Math.floor(cursor.line),cm.setCursor(cursor),cursorCoords=cm.charCoords(cursor,"local"),cm.scrollTo(null,cursorCoords.bottom-cm.getScrollInfo().clientHeight)):cm.scrollTo(null,newPos)}}},scrollToCursor:function(cm,actionArgs){cm.moveCurrentLineTo(actionArgs.position)},replayMacro:function(cm,actionArgs,vim){var registerName=actionArgs.selectedCharacter,repeat=actionArgs.repeat,macroModeState=vimGlobalState.macroModeState;for("@"==registerName&&(registerName=macroModeState.latestRegister);repeat--;)executeMacroRegister(cm,vim,macroModeState,registerName)},enterMacroRecordMode:function(cm,actionArgs){var macroModeState=vimGlobalState.macroModeState,registerName=actionArgs.selectedCharacter;vimGlobalState.registerController.isValidRegister(registerName)&&macroModeState.enterMacroRecordMode(cm,registerName)},toggleOverwrite:function(cm){cm.replaceMode?(cm.toggleOverwrite(!1),cm.setOption("keyMap","vim-insert"),_cm_adapter.default.signal(cm,"vim-mode-change",{mode:"insert"})):(cm.toggleOverwrite(!0),cm.setOption("keyMap","vim-replace"),_cm_adapter.default.signal(cm,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(cm,actionArgs,vim){if(!cm.getOption("readOnly")){vim.insertMode=!0,vim.insertModeRepeat=actionArgs&&actionArgs.repeat||1,cm.leaveVimMode();var insertAt=actionArgs?actionArgs.insertAt:null,sel=vim.sel,head=actionArgs.head||cm.getCursor("head"),height=cm.listSelections().length;if("eol"==insertAt)head=Pos(head.line,lineLength(cm,head.line));else if("charAfter"==insertAt)head=offsetCursor(head,0,1);else if("firstNonBlank"==insertAt)head=motions.moveToFirstNonWhiteSpaceCharacter(cm,head);else if("startOfSelectedArea"==insertAt)vim.visualBlock?(head=Pos(Math.min(sel.head.line,sel.anchor.line),Math.min(sel.head.ch,sel.anchor.ch)),height=Math.abs(sel.head.line-sel.anchor.line)+1):head=sel.head.line<sel.anchor.line?sel.head:Pos(sel.anchor.line,0);else if("endOfSelectedArea"==insertAt)vim.visualBlock?(head=Pos(Math.min(sel.head.line,sel.anchor.line),Math.max(sel.head.ch+1,sel.anchor.ch)),height=Math.abs(sel.head.line-sel.anchor.line)+1):head=sel.head.line>=sel.anchor.line?offsetCursor(sel.head,0,1):Pos(sel.anchor.line,0);else if("inplace"==insertAt&&vim.visualMode)return;cm.setOption("disableInput",!1),vim.visualMode&&exitVisualMode(cm),actionArgs&&actionArgs.replace?(cm.toggleOverwrite(!0),cm.setOption("keyMap","vim-replace"),_cm_adapter.default.signal(cm,"vim-mode-change",{mode:"replace"})):(cm.toggleOverwrite(!1),cm.setOption("keyMap","vim-insert"),_cm_adapter.default.signal(cm,"vim-mode-change",{mode:"insert"})),vimGlobalState.macroModeState.isPlaying||(cm.on("change",onChange),_cm_adapter.default.on(cm.getInputField(),"keydown",onKeyEventTargetKeyDown)),selectForInsert(cm,head,height)}},toggleVisualMode:function(cm,actionArgs,vim){var head,repeat=actionArgs.repeat,anchor=cm.getCursor();vim.visualMode?vim.visualLine^actionArgs.linewise||vim.visualBlock^actionArgs.blockwise?(vim.visualLine=!!actionArgs.linewise,vim.visualBlock=!!actionArgs.blockwise,_cm_adapter.default.signal(cm,"vim-mode-change",{mode:"visual",subMode:vim.visualLine?"linewise":vim.visualBlock?"blockwise":""}),updateCmSelection(cm)):exitVisualMode(cm):(vim.visualMode=!0,vim.visualLine=!!actionArgs.linewise,vim.visualBlock=!!actionArgs.blockwise,head=clipCursorToContent(cm,Pos(anchor.line,anchor.ch+repeat-1),!0),vim.sel={anchor:anchor,head:head},_cm_adapter.default.signal(cm,"vim-mode-change",{mode:"visual",subMode:vim.visualLine?"linewise":vim.visualBlock?"blockwise":""}),updateCmSelection(cm),updateMark(cm,vim,"<",cursorMin(anchor,head)),updateMark(cm,vim,">",cursorMax(anchor,head)))},reselectLastSelection:function(cm,_actionArgs,vim){var lastSelection=vim.lastSelection;if(vim.visualMode&&updateLastSelection(cm,vim),lastSelection){var anchor=lastSelection.anchorMark.find(),head=lastSelection.headMark.find();if(!anchor||!head)return;vim.sel={anchor:anchor,head:head},vim.visualMode=!0,vim.visualLine=lastSelection.visualLine,vim.visualBlock=lastSelection.visualBlock,updateCmSelection(cm),updateMark(cm,vim,"<",cursorMin(anchor,head)),updateMark(cm,vim,">",cursorMax(anchor,head)),_cm_adapter.default.signal(cm,"vim-mode-change",{mode:"visual",subMode:vim.visualLine?"linewise":vim.visualBlock?"blockwise":""})}},joinLines:function(cm,actionArgs,vim){var curStart,curEnd;if(vim.visualMode){if(curStart=cm.getCursor("anchor"),cursorIsBefore(curEnd=cm.getCursor("head"),curStart)){var tmp=curEnd;curEnd=curStart,curStart=tmp}curEnd.ch=lineLength(cm,curEnd.line)-1}else{var repeat=Math.max(actionArgs.repeat,2);curStart=cm.getCursor(),curEnd=clipCursorToContent(cm,Pos(curStart.line+repeat-1,1/0))}for(var finalCh=0,i=curStart.line;i<curEnd.line;i++){finalCh=lineLength(cm,curStart.line);tmp=Pos(curStart.line+1,lineLength(cm,curStart.line+1));var text=cm.getRange(curStart,tmp);text=text.replace(/\n\s*/g," "),cm.replaceRange(text,curStart,tmp)}var curFinalPos=Pos(curStart.line,finalCh);vim.visualMode&&exitVisualMode(cm,!1),cm.setCursor(curFinalPos)},newLineAndEnterInsertMode:function(cm,actionArgs,vim){vim.insertMode=!0;var insertAt=copyCursor(cm.getCursor());insertAt.line!==cm.firstLine()||actionArgs.after?(insertAt.line=actionArgs.after?insertAt.line:insertAt.line-1,insertAt.ch=lineLength(cm,insertAt.line),cm.setCursor(insertAt),(_cm_adapter.default.commands.newlineAndIndentContinueComment||_cm_adapter.default.commands.newlineAndIndent)(cm)):(cm.replaceRange("\n",Pos(cm.firstLine(),0)),cm.setCursor(cm.firstLine(),0));this.enterInsertMode(cm,{repeat:actionArgs.repeat},vim)},paste:function(cm,actionArgs,vim){var cur=copyCursor(cm.getCursor()),register=vimGlobalState.registerController.getRegister(actionArgs.registerName);if(text=register.toString()){if(actionArgs.matchIndent){var tabSize=cm.getOption("tabSize"),whitespaceLength=function(str){var tabs=str.split("\t").length-1,spaces=str.split(" ").length-1;return tabs*tabSize+1*spaces},currentLine=cm.getLine(cm.getCursor().line),indent=whitespaceLength(currentLine.match(/^\s*/)[0]),chompedText=text.replace(/\n$/,""),wasChomped=text!==chompedText,firstIndent=whitespaceLength(text.match(/^\s*/)[0]),text=chompedText.replace(/^\s*/gm,(function(wspace){var newIndent=indent+(whitespaceLength(wspace)-firstIndent);if(newIndent<0)return"";if(cm.getOption("indentWithTabs")){var quotient=Math.floor(newIndent/tabSize);return Array(quotient+1).join("\t")}return Array(newIndent+1).join(" ")}));text+=wasChomped?"\n":""}if(actionArgs.repeat>1)text=Array(actionArgs.repeat+1).join(text);var curPosFinal,idx,linewise=register.linewise,blockwise=register.blockwise;if(linewise)vim.visualMode?text=vim.visualLine?text.slice(0,-1):"\n"+text.slice(0,text.length-1)+"\n":actionArgs.after?(text="\n"+text.slice(0,text.length-1),cur.ch=lineLength(cm,cur.line)):cur.ch=0;else{if(blockwise){text=text.split("\n");for(var i=0;i<text.length;i++)text[i]=""==text[i]?" ":text[i]}cur.ch+=actionArgs.after?1:0}if(vim.visualMode){var lastSelectionCurEnd;vim.lastPastedText=text;var selectedArea=function(cm,vim){var lastSelection=vim.lastSelection;return vim.visualMode?function(){var selections=cm.listSelections(),start=selections[0],end=selections[selections.length-1];return[cursorIsBefore(start.anchor,start.head)?start.anchor:start.head,cursorIsBefore(end.anchor,end.head)?end.head:end.anchor]}():function(){var selectionStart=cm.getCursor(),selectionEnd=cm.getCursor(),block=lastSelection.visualBlock;if(block){var width=block.width,height=block.height;selectionEnd=Pos(selectionStart.line+height,selectionStart.ch+width);for(var selections=[],i=selectionStart.line;i<selectionEnd.line;i++){var range={anchor:Pos(i,selectionStart.ch),head:Pos(i,selectionEnd.ch)};selections.push(range)}cm.setSelections(selections)}else{var start=lastSelection.anchorMark.find(),end=lastSelection.headMark.find(),line=end.line-start.line,ch=end.ch-start.ch;selectionEnd={line:selectionEnd.line+line,ch:line?selectionEnd.ch:ch+selectionEnd.ch},lastSelection.visualLine&&(selectionStart=Pos(selectionStart.line,0),selectionEnd=Pos(selectionEnd.line,lineLength(cm,selectionEnd.line))),cm.setSelection(selectionStart,selectionEnd)}return[selectionStart,selectionEnd]}()}(cm,vim),selectionStart=selectedArea[0],selectionEnd=selectedArea[1],selectedText=cm.getSelection(),selections=cm.listSelections(),emptyStrings=new Array(selections.length).join("1").split("1");vim.lastSelection&&(lastSelectionCurEnd=vim.lastSelection.headMark.find()),vimGlobalState.registerController.unnamedRegister.setText(selectedText),blockwise?(cm.replaceSelections(emptyStrings),selectionEnd=Pos(selectionStart.line+text.length-1,selectionStart.ch),cm.setCursor(selectionStart),selectBlock(cm,selectionEnd),cm.replaceSelections(text),curPosFinal=selectionStart):vim.visualBlock?(cm.replaceSelections(emptyStrings),cm.setCursor(selectionStart),cm.replaceRange(text,selectionStart,selectionStart),curPosFinal=selectionStart):(cm.replaceRange(text,selectionStart,selectionEnd),curPosFinal=cm.posFromIndex(cm.indexFromPos(selectionStart)+text.length-1)),lastSelectionCurEnd&&(vim.lastSelection.headMark=cm.setBookmark(lastSelectionCurEnd)),linewise&&(curPosFinal.ch=0)}else if(blockwise){cm.setCursor(cur);for(i=0;i<text.length;i++){var line=cur.line+i;line>cm.lastLine()&&cm.replaceRange("\n",Pos(line,0)),lineLength(cm,line)<cur.ch&&extendLineToColumn(cm,line,cur.ch)}cm.setCursor(cur),selectBlock(cm,Pos(cur.line+text.length-1,cur.ch)),cm.replaceSelections(text),curPosFinal=cur}else cm.replaceRange(text,cur),linewise&&actionArgs.after?curPosFinal=Pos(cur.line+1,cm.findFirstNonWhiteSpaceCharacter(cur.line+1)):linewise&&!actionArgs.after?curPosFinal=Pos(cur.line,cm.findFirstNonWhiteSpaceCharacter(cur.line)):!linewise&&actionArgs.after?(idx=cm.indexFromPos(cur),curPosFinal=cm.posFromIndex(idx+text.length-1)):(idx=cm.indexFromPos(cur),curPosFinal=cm.posFromIndex(idx+text.length));vim.visualMode&&exitVisualMode(cm,!1),cm.setCursor(curPosFinal)}},undo:function(cm,actionArgs){cm.operation((function(){repeatFn(cm,_cm_adapter.default.commands.undo,actionArgs.repeat)(),cm.setCursor(cm.getCursor("anchor"))}))},redo:function(cm,actionArgs){repeatFn(cm,_cm_adapter.default.commands.redo,actionArgs.repeat)()},setRegister:function(_cm,actionArgs,vim){vim.inputState.registerName=actionArgs.selectedCharacter},setMark:function(cm,actionArgs,vim){updateMark(cm,vim,actionArgs.selectedCharacter,cm.getCursor())},replace:function(cm,actionArgs,vim){var replaceTo,curEnd,replaceWith=actionArgs.selectedCharacter,curStart=cm.getCursor(),selections=cm.listSelections();if(vim.visualMode)curStart=cm.getCursor("start"),curEnd=cm.getCursor("end");else{var line=cm.getLine(curStart.line);(replaceTo=curStart.ch+actionArgs.repeat)>line.length&&(replaceTo=line.length),curEnd=Pos(curStart.line,replaceTo)}if("\n"==replaceWith)vim.visualMode||cm.replaceRange("",curStart,curEnd),(_cm_adapter.default.commands.newlineAndIndentContinueComment||_cm_adapter.default.commands.newlineAndIndent)(cm);else{var replaceWithStr=cm.getRange(curStart,curEnd);if(replaceWithStr=replaceWithStr.replace(/[^\n]/g,replaceWith),vim.visualBlock){var spaces=new Array(cm.getOption("tabSize")+1).join(" ");replaceWithStr=(replaceWithStr=cm.getSelection()).replace(/\t/g,spaces).replace(/[^\n]/g,replaceWith).split("\n"),cm.replaceSelections(replaceWithStr)}else cm.replaceRange(replaceWithStr,curStart,curEnd);vim.visualMode?(curStart=cursorIsBefore(selections[0].anchor,selections[0].head)?selections[0].anchor:selections[0].head,cm.setCursor(curStart),exitVisualMode(cm,!1)):cm.setCursor(offsetCursor(curEnd,0,-1))}},incrementNumberToken:function(cm,actionArgs){for(var match,start,end,numberStr,cur=cm.getCursor(),lineStr=cm.getLine(cur.line),re=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;null!==(match=re.exec(lineStr))&&(end=(start=match.index)+match[0].length,!(cur.ch<end)););if((actionArgs.backtrack||!(end<=cur.ch))&&match){var baseStr=match[2]||match[4],digits=match[3]||match[5],increment=actionArgs.increase?1:-1,base={"0b":2,0:8,"":10,"0x":16}[baseStr.toLowerCase()];numberStr=(parseInt(match[1]+digits,base)+increment*actionArgs.repeat).toString(base);var zeroPadding=baseStr?new Array(digits.length-numberStr.length+1+match[1].length).join("0"):"";numberStr="-"===numberStr.charAt(0)?"-"+baseStr+zeroPadding+numberStr.substr(1):baseStr+zeroPadding+numberStr;var from=Pos(cur.line,start),to=Pos(cur.line,end);cm.replaceRange(numberStr,from,to),cm.setCursor(Pos(cur.line,start+numberStr.length-1))}},repeatLastEdit:function(cm,actionArgs,vim){if(vim.lastEditInputState){var repeat=actionArgs.repeat;repeat&&actionArgs.repeatIsExplicit?vim.lastEditInputState.repeatOverride=repeat:repeat=vim.lastEditInputState.repeatOverride||repeat,_repeatLastEdit(cm,vim,repeat,!1)}},indent:function(cm,actionArgs){cm.indentLine(cm.getCursor().line,actionArgs.indentRight)},exitInsertMode:exitInsertMode};function clipCursorToContent(cm,cur,includeLineBreak){var line=Math.min(Math.max(cm.firstLine(),cur.line),cm.lastLine()),maxCh=lineLength(cm,line)-1;maxCh=includeLineBreak?maxCh+1:maxCh;var ch=Math.min(Math.max(0,cur.ch),maxCh);return Pos(line,ch)}function copyArgs(args){var ret={};for(var prop in args)args.hasOwnProperty(prop)&&(ret[prop]=args[prop]);return ret}function offsetCursor(cur,offsetLine,offsetCh){return"object"===_typeof(offsetLine)&&(offsetCh=offsetLine.ch,offsetLine=offsetLine.line),Pos(cur.line+offsetLine,cur.ch+offsetCh)}function commandMatch(pressed,mapped){if("<character>"==mapped.slice(-11)){var prefixLen=mapped.length-11,pressedPrefix=pressed.slice(0,prefixLen),mappedPrefix=mapped.slice(0,prefixLen);return pressedPrefix==mappedPrefix&&pressed.length>prefixLen?"full":0==mappedPrefix.indexOf(pressedPrefix)&&"partial"}return pressed==mapped?"full":0==mapped.indexOf(pressed)&&"partial"}function repeatFn(cm,fn,repeat){return function(){for(var i=0;i<repeat;i++)fn(cm)}}function copyCursor(cur){return Pos(cur.line,cur.ch)}function cursorEqual(cur1,cur2){return cur1.ch==cur2.ch&&cur1.line==cur2.line}function cursorIsBefore(cur1,cur2){return cur1.line<cur2.line||cur1.line==cur2.line&&cur1.ch<cur2.ch}function cursorMin(cur1,cur2){return arguments.length>2&&(cur2=cursorMin.apply(void 0,Array.prototype.slice.call(arguments,1))),cursorIsBefore(cur1,cur2)?cur1:cur2}function cursorMax(cur1,cur2){return arguments.length>2&&(cur2=cursorMax.apply(void 0,Array.prototype.slice.call(arguments,1))),cursorIsBefore(cur1,cur2)?cur2:cur1}function cursorIsBetween(cur1,cur2,cur3){var cur1before2=cursorIsBefore(cur1,cur2),cur2before3=cursorIsBefore(cur2,cur3);return cur1before2&&cur2before3}function lineLength(cm,lineNum){return cm.getLine(lineNum).length}function trim(s){return s.trim?s.trim():s.replace(/^\s+|\s+$/g,"")}function extendLineToColumn(cm,lineNum,column){var endCh=lineLength(cm,lineNum),spaces=new Array(column-endCh+1).join(" ");cm.setCursor(Pos(lineNum,endCh)),cm.replaceRange(spaces,cm.getCursor())}function selectBlock(cm,selectionEnd){var selections=[],ranges=cm.listSelections(),head=copyCursor(cm.clipPos(selectionEnd)),isClipped=!cursorEqual(selectionEnd,head),primIndex=function(ranges,cursor,end){for(var i=0;i<ranges.length;i++){var atAnchor="head"!=end&&cursorEqual(ranges[i].anchor,cursor),atHead="anchor"!=end&&cursorEqual(ranges[i].head,cursor);if(atAnchor||atHead)return i}return-1}(ranges,cm.getCursor("head")),wasClipped=cursorEqual(ranges[primIndex].head,ranges[primIndex].anchor),max=ranges.length-1,index=max-primIndex>primIndex?max:0,base=ranges[index].anchor,firstLine=Math.min(base.line,head.line),lastLine=Math.max(base.line,head.line),baseCh=base.ch,headCh=head.ch,dir=ranges[index].head.ch-baseCh,newDir=headCh-baseCh;dir>0&&newDir<=0?(baseCh++,isClipped||headCh--):dir<0&&newDir>=0?(baseCh--,wasClipped||headCh++):dir<0&&-1==newDir&&(baseCh--,headCh++);for(var line=firstLine;line<=lastLine;line++){var range={anchor:new Pos(line,baseCh),head:new Pos(line,headCh)};selections.push(range)}return cm.setSelections(selections),selectionEnd.ch=headCh,base.ch=baseCh,base}function selectForInsert(cm,head,height){for(var sel=[],i=0;i<height;i++){var lineHead=offsetCursor(head,i,0);sel.push({anchor:lineHead,head:lineHead})}cm.setSelections(sel,0)}function updateLastSelection(cm,vim){var anchor=vim.sel.anchor,head=vim.sel.head;vim.lastPastedText&&(head=cm.posFromIndex(cm.indexFromPos(anchor)+vim.lastPastedText.length),vim.lastPastedText=null),vim.lastSelection={anchorMark:cm.setBookmark(anchor),headMark:cm.setBookmark(head),anchor:copyCursor(anchor),head:copyCursor(head),visualMode:vim.visualMode,visualLine:vim.visualLine,visualBlock:vim.visualBlock}}function updateCmSelection(cm,sel,mode){var vim=cm.state.vim,cmSel=makeCmSelection(cm,sel=sel||vim.sel,mode=mode||vim.visualLine?"line":vim.visualBlock?"block":"char",vim.visualMode&&"char"===mode);cm.setSelections(cmSel.ranges,cmSel.primary),updateFakeCursor(cm)}function makeCmSelection(cm,sel,mode,exclusive){var head=copyCursor(sel.head),anchor=copyCursor(sel.anchor);if("char"==mode){var headOffset=exclusive||cursorIsBefore(sel.head,sel.anchor)?0:1,anchorOffset=cursorIsBefore(sel.head,sel.anchor)?1:0;return head=offsetCursor(sel.head,0,headOffset),{ranges:[{anchor:anchor=offsetCursor(sel.anchor,0,anchorOffset),head:head}],primary:0}}if("line"==mode){if(cursorIsBefore(sel.head,sel.anchor))head.ch=0,anchor.ch=lineLength(cm,anchor.line);else{anchor.ch=0;var lastLine=cm.lastLine();head.line>lastLine&&(head.line=lastLine),head.ch=lineLength(cm,head.line)}return{ranges:[{anchor:anchor,head:head}],primary:0}}if("block"==mode){for(var top=Math.min(anchor.line,head.line),left=Math.min(anchor.ch,head.ch),bottom=Math.max(anchor.line,head.line),right=Math.max(anchor.ch,head.ch)+1,height=bottom-top+1,primary=head.line==top?0:height-1,ranges=[],i=0;i<height;i++)ranges.push({anchor:Pos(top+i,left),head:Pos(top+i,right)});return{ranges:ranges,primary:primary}}}function exitVisualMode(cm,moveHead){var vim=cm.state.vim;!1!==moveHead&&cm.setCursor(clipCursorToContent(cm,vim.sel.head)),updateLastSelection(cm,vim),vim.visualMode=!1,vim.visualLine=!1,vim.visualBlock=!1,_cm_adapter.default.signal(cm,"vim-mode-change",{mode:"normal"}),vim.fakeCursor&&vim.fakeCursor.clear()}function expandWordUnderCursor(cm,inclusive,_forward,bigWord,noSymbol){for(var cur=function(cm){var cur=cm.getCursor("head");return 1==cm.getSelection().length&&(cur=cursorMin(cur,cm.getCursor("anchor"))),cur}(cm),line=cm.getLine(cur.line),idx=cur.ch,test=noSymbol?wordCharTest[0]:bigWordCharTest[0];!test(line.charAt(idx));)if(++idx>=line.length)return null;bigWord?test=bigWordCharTest[0]:(test=wordCharTest[0])(line.charAt(idx))||(test=wordCharTest[1]);for(var end=idx,start=idx;test(line.charAt(end))&&end<line.length;)end++;for(;test(line.charAt(start))&&start>=0;)start--;if(start++,inclusive){for(var wordEnd=end;/\s/.test(line.charAt(end))&&end<line.length;)end++;if(wordEnd==end){for(var wordStart=start;/\s/.test(line.charAt(start-1))&&start>0;)start--;start||(start=wordStart)}}return{start:Pos(cur.line,start),end:Pos(cur.line,end)}}function recordJumpPosition(cm,oldCur,newCur){cursorEqual(oldCur,newCur)||vimGlobalState.jumpList.add(cm,oldCur,newCur)}function recordLastCharacterSearch(increment,args){vimGlobalState.lastCharacterSearch.increment=increment,vimGlobalState.lastCharacterSearch.forward=args.forward,vimGlobalState.lastCharacterSearch.selectedCharacter=args.selectedCharacter}var symbolToMode={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},findSymbolModes={bracket:{isComplete:function(state){if(state.nextCh===state.symb){if(state.depth++,state.depth>=1)return!0}else state.nextCh===state.reverseSymb&&state.depth--;return!1}},section:{init:function(state){state.curMoveThrough=!0,state.symb=(state.forward?"]":"[")===state.symb?"{":"}"},isComplete:function(state){return 0===state.index&&state.nextCh===state.symb}},comment:{isComplete:function(state){var found="*"===state.lastCh&&"/"===state.nextCh;return state.lastCh=state.nextCh,found}},method:{init:function(state){state.symb="m"===state.symb?"{":"}",state.reverseSymb="{"===state.symb?"}":"{"},isComplete:function(state){return state.nextCh===state.symb}},preprocess:{init:function(state){state.index=0},isComplete:function(state){if("#"===state.nextCh){var token=state.lineText.match(/#(\w+)/)[1];if("endif"===token){if(state.forward&&0===state.depth)return!0;state.depth++}else if("if"===token){if(!state.forward&&0===state.depth)return!0;state.depth--}if("else"===token&&0===state.depth)return!0}return!1}}};function findWord(cm,cur,forward,bigWord,emptyLineIsWord){var lineNum=cur.line,pos=cur.ch,line=cm.getLine(lineNum),dir=forward?1:-1,charTests=bigWord?bigWordCharTest:wordCharTest;if(emptyLineIsWord&&""==line){if(lineNum+=dir,line=cm.getLine(lineNum),!isLine(cm,lineNum))return null;pos=forward?0:line.length}for(;;){if(emptyLineIsWord&&""==line)return{from:0,to:0,line:lineNum};for(var stop=dir>0?line.length:-1,wordStart=stop,wordEnd=stop;pos!=stop;){for(var foundWord=!1,i=0;i<charTests.length&&!foundWord;++i)if(charTests[i](line.charAt(pos))){for(wordStart=pos;pos!=stop&&charTests[i](line.charAt(pos));)pos+=dir;if(foundWord=wordStart!=(wordEnd=pos),wordStart==cur.ch&&lineNum==cur.line&&wordEnd==wordStart+dir)continue;return{from:Math.min(wordStart,wordEnd+1),to:Math.max(wordStart,wordEnd),line:lineNum}}foundWord||(pos+=dir)}if(!isLine(cm,lineNum+=dir))return null;line=cm.getLine(lineNum),pos=dir>0?0:line.length}}function _moveToCharacter(cm,repeat,forward,character){for(var idx,cur=cm.getCursor(),start=cur.ch,i=0;i<repeat;i++){if(-1==(idx=charIdxInLine(start,cm.getLine(cur.line),character,forward,!0)))return null;start=idx}return Pos(cm.getCursor().line,idx)}function updateMark(cm,vim,markName,pos){inArray(markName,validMarks)&&(vim.marks[markName]&&vim.marks[markName].clear(),vim.marks[markName]=cm.setBookmark(pos))}function charIdxInLine(start,line,character,forward,includeChar){var idx;return forward?-1==(idx=line.indexOf(character,start+1))||includeChar||(idx-=1):-1==(idx=line.lastIndexOf(character,start-1))||includeChar||(idx+=1),idx}function findParagraph(cm,head,repeat,dir,inclusive){var end,line=head.line,min=cm.firstLine(),max=cm.lastLine(),i=line;function isEmpty(i){return!cm.getLine(i)}function isBoundary(i,dir,any){return any?isEmpty(i)!=isEmpty(i+dir):!isEmpty(i)&&isEmpty(i+dir)}if(dir){for(;min<=i&&i<=max&&repeat>0;)isBoundary(i,dir)&&repeat--,i+=dir;return new Pos(i,0)}var vim=cm.state.vim;if(vim.visualLine&&isBoundary(line,1,!0)){var anchor=vim.sel.anchor;isBoundary(anchor.line,-1,!0)&&(inclusive&&anchor.line==line||(line+=1))}var startState=isEmpty(line);for(i=line;i<=max&&repeat;i++)isBoundary(i,1,!0)&&(inclusive&&isEmpty(i)==startState||repeat--);for(end=new Pos(i,0),i>max&&!startState?startState=!0:inclusive=!1,i=line;i>min&&(inclusive&&isEmpty(i)!=startState&&i!=line||!isBoundary(i,-1,!0));i--);return{start:new Pos(i,0),end:end}}function SearchState(){}function getSearchState(cm){var vim=cm.state.vim;return vim.searchState_||(vim.searchState_=new SearchState)}function dialog(cm,template,shortText,onClose,options){cm.openDialog?cm.openDialog(template,onClose,{bottom:!0,value:options.value,onKeyDown:options.onKeyDown,onKeyUp:options.onKeyUp,selectValueOnOpen:!1}):onClose(prompt(shortText,""))}function splitBySeparator(argString,separator){var slashes=findUnescapedSeparators(argString,separator)||[];if(!slashes.length)return[];var tokens=[];if(0===slashes[0]){for(var i=0;i<slashes.length;i++)"number"==typeof slashes[i]&&tokens.push(argString.substring(slashes[i]+1,slashes[i+1]));return tokens}}function findUnescapedSeparators(str,separator){separator||(separator="/");for(var escapeNextChar=!1,slashes=[],i=0;i<str.length;i++){var c=str.charAt(i);escapeNextChar||c!=separator||slashes.push(i),escapeNextChar=!escapeNextChar&&"\\"==c}return slashes}defineOption("pcre",!0,"boolean"),SearchState.prototype={getQuery:function(){return vimGlobalState.query},setQuery:function(query){vimGlobalState.query=query},getOverlay:function(){return this.searchOverlay},setOverlay:function(overlay){this.searchOverlay=overlay},isReversed:function(){return vimGlobalState.isReversed},setReversed:function(reversed){vimGlobalState.isReversed=reversed},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(annotate){this.annotate=annotate}};var charUnescapes={"\\n":"\n","\\r":"\r","\\t":"\t"};var unescapes={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t"};function parseQuery(query,ignoreCase,smartCase){if(vimGlobalState.registerController.getRegister("/").setText(query),query instanceof RegExp)return query;var regexPart,forceIgnoreCase,slashes=findUnescapedSeparators(query,"/");slashes.length?(regexPart=query.substring(0,slashes[0]),forceIgnoreCase=-1!=query.substring(slashes[0]).indexOf("i")):regexPart=query;return regexPart?(getOption("pcre")||(regexPart=function(str){for(var escapeNextChar=!1,out=[],i=-1;i<str.length;i++){var c=str.charAt(i)||"",n=str.charAt(i+1)||"",specialComesNext=n&&-1!="|(){".indexOf(n);escapeNextChar?("\\"===c&&specialComesNext||out.push(c),escapeNextChar=!1):"\\"===c?(escapeNextChar=!0,n&&-1!="}".indexOf(n)&&(specialComesNext=!0),specialComesNext&&"\\"!==n||out.push(c)):(out.push(c),specialComesNext&&"\\"!==n&&out.push("\\"))}return out.join("")}(regexPart)),smartCase&&(ignoreCase=/^[^A-Z]*$/.test(regexPart)),new RegExp(regexPart,ignoreCase||forceIgnoreCase?"i":void 0)):null}function showConfirm(cm,text){cm.openNotification?cm.openNotification('<span style="color: red">'+text+"</span>",{bottom:!0,duration:5e3}):alert(text)}var searchPromptDesc="(Javascript regexp)";function showPrompt(cm,options){var prefix,desc,raw,shortText=(options.prefix||"")+" "+(options.desc||"");dialog(cm,(prefix=options.prefix,desc=options.desc,raw='<span style="font-family: monospace; white-space: pre">'+(prefix||"")+'<input type="text"></span>',desc&&(raw+=' <span style="color: #888">'+desc+"</span>"),raw),shortText,options.onClose,options)}function updateSearchQuery(cm,rawQuery,ignoreCase,smartCase){if(rawQuery){var state=getSearchState(cm),query=parseQuery(rawQuery,!!ignoreCase,!!smartCase);if(query)return highlightSearchMatches(cm,query),function(r1,r2){if(r1 instanceof RegExp&&r2 instanceof RegExp){for(var props=["global","multiline","ignoreCase","source"],i=0;i<props.length;i++){var prop=props[i];if(r1[prop]!==r2[prop])return!1}return!0}return!1}(query,state.getQuery())||state.setQuery(query),query}}function highlightSearchMatches(cm,query){var searchState=getSearchState(cm),overlay=searchState.getOverlay();overlay&&query==overlay.query||(overlay&&cm.removeOverlay(overlay),overlay=function(query){if("^"==query.source.charAt(0))var matchSol=!0;return{token:function(stream){if(!matchSol||stream.sol()){var match=stream.match(query,!1);if(match)return 0==match[0].length?(stream.next(),"searching"):stream.sol()||(stream.backUp(1),query.exec(stream.next()+match[0]))?(stream.match(query),"searching"):(stream.next(),null);for(;!stream.eol()&&(stream.next(),!stream.match(query,!1)););}else stream.skipToEnd()},query:query}}(query),cm.addOverlay(overlay),cm.showMatchesOnScrollbar&&(searchState.getScrollbarAnnotate()&&searchState.getScrollbarAnnotate().clear(),searchState.setScrollbarAnnotate(cm.showMatchesOnScrollbar(query))),searchState.setOverlay(overlay))}function _findNext(cm,prev,query,repeat){return void 0===repeat&&(repeat=1),cm.operation((function(){for(var pos=cm.getCursor(),cursor=cm.getSearchCursor(query,pos),i=0;i<repeat;i++){var found=cursor.find(prev);if(0==i&&found&&cursorEqual(cursor.from(),pos)&&(found=cursor.find(prev)),!found&&!(cursor=cm.getSearchCursor(query,prev?Pos(cm.lastLine()):Pos(cm.firstLine(),0))).find(prev))return}return cursor.from()}))}function clearSearchHighlight(cm){var state=getSearchState(cm);cm.removeOverlay(getSearchState(cm).getOverlay()),state.setOverlay(null),state.getScrollbarAnnotate()&&(state.getScrollbarAnnotate().clear(),state.setScrollbarAnnotate(null))}function isInRange(pos,start,end){return"number"!=typeof pos&&(pos=pos.line),start instanceof Array?inArray(pos,start):end?pos>=start&&pos<=end:pos==start}function getUserVisibleLines(cm){return cm.getUserVisibleLines()}function getMarkPos(cm,vim,markName){if("'"==markName){var history=cm.doc.history.done,event=history[history.length-2];return event&&event.ranges&&event.ranges[0].head}if("."==markName){if(0==cm.doc.history.lastModTime)return;var changeHistory=cm.doc.history.done.filter((function(el){if(void 0!==el.changes)return el}));return changeHistory.reverse(),changeHistory[0].changes[0].to}var mark=vim.marks[markName];return mark&&mark.find()}var ExCommandDispatcher=function(){this.buildCommandMap_()};ExCommandDispatcher.prototype={processCommand:function(cm,input,opt_params){var that=this;cm.operation((function(){cm.curOp.isVimOp=!0,that._processCommand(cm,input,opt_params)}))},_processCommand:function(cm,input,opt_params){var vim=cm.state.vim,commandHistoryRegister=vimGlobalState.registerController.getRegister(":"),previousCommand=commandHistoryRegister.toString();vim.visualMode&&exitVisualMode(cm);var inputStream=new _cm_adapter.default.StringStream(input);commandHistoryRegister.setText(input);var command,commandName,params=opt_params||{};params.input=input;try{this.parseInput_(cm,inputStream,params)}catch(e){throw showConfirm(cm,e),e}if(params.commandName){if(command=this.matchCommand_(params.commandName)){if(commandName=command.name,command.excludeFromCommandHistory&&commandHistoryRegister.setText(previousCommand),this.parseCommandArgs_(inputStream,params,command),"exToKey"==command.type){for(var i=0;i<command.toKeys.length;i++)_cm_adapter.default.Vim.handleKey(cm,command.toKeys[i],"mapping");return}if("exToEx"==command.type)return void this.processCommand(cm,command.toInput)}}else void 0!==params.line&&(commandName="move");if(commandName)try{exCommands[commandName](cm,params),command&&command.possiblyAsync||!params.callback||params.callback()}catch(e){throw showConfirm(cm,e),e}else showConfirm(cm,'Not an editor command ":'+input+'"')},parseInput_:function(cm,inputStream,result){inputStream.eatWhile(":"),inputStream.eat("%")?(result.line=cm.firstLine(),result.lineEnd=cm.lastLine()):(result.line=this.parseLineSpec_(cm,inputStream),void 0!==result.line&&inputStream.eat(",")&&(result.lineEnd=this.parseLineSpec_(cm,inputStream)));var commandMatch=inputStream.match(/^(\w+)/);return result.commandName=commandMatch?commandMatch[1]:inputStream.match(/.*/)[0],result},parseLineSpec_:function(cm,inputStream){var numberMatch=inputStream.match(/^(\d+)/);if(numberMatch)return parseInt(numberMatch[1],10)-1;switch(inputStream.next()){case".":return this.parseLineSpecOffset_(inputStream,cm.getCursor().line);case"$":return this.parseLineSpecOffset_(inputStream,cm.lastLine());case"'":var markName=inputStream.next(),markPos=getMarkPos(cm,cm.state.vim,markName);if(!markPos)throw new Error("Mark not set");return this.parseLineSpecOffset_(inputStream,markPos.line);case"-":case"+":return inputStream.backUp(1),this.parseLineSpecOffset_(inputStream,cm.getCursor().line);default:return void inputStream.backUp(1)}},parseLineSpecOffset_:function(inputStream,line){var offsetMatch=inputStream.match(/^([+-])?(\d+)/);if(offsetMatch){var offset=parseInt(offsetMatch[2],10);"-"==offsetMatch[1]?line-=offset:line+=offset}return line},parseCommandArgs_:function(inputStream,params,command){if(!inputStream.eol()){params.argString=inputStream.match(/.*/)[0];var delim=command.argDelimiter||/\s+/,args=trim(params.argString).split(delim);args.length&&args[0]&&(params.args=args)}},matchCommand_:function(commandName){for(var i=commandName.length;i>0;i--){var prefix=commandName.substring(0,i);if(this.commandMap_[prefix]){var command=this.commandMap_[prefix];if(0===command.name.indexOf(commandName))return command}}return null},buildCommandMap_:function(){this.commandMap_={};for(var i=0;i<defaultExCommandMap.length;i++){var command=defaultExCommandMap[i],key=command.shortName||command.name;this.commandMap_[key]=command}},map:function(lhs,rhs,ctx){if(":"!=lhs&&":"==lhs.charAt(0)){if(ctx)throw Error("Mode not supported for ex mappings");var commandName=lhs.substring(1);":"!=rhs&&":"==rhs.charAt(0)?this.commandMap_[commandName]={name:commandName,type:"exToEx",toInput:rhs.substring(1),user:!0}:this.commandMap_[commandName]={name:commandName,type:"exToKey",toKeys:rhs,user:!0}}else if(":"!=rhs&&":"==rhs.charAt(0)){var mapping={keys:lhs,type:"keyToEx",exArgs:{input:rhs.substring(1)}};ctx&&(mapping.context=ctx),defaultKeymap.unshift(mapping)}else{mapping={keys:lhs,type:"keyToKey",toKeys:rhs};ctx&&(mapping.context=ctx),defaultKeymap.unshift(mapping)}},unmap:function(lhs,ctx){if(":"!=lhs&&":"==lhs.charAt(0)){if(ctx)throw Error("Mode not supported for ex mappings");var commandName=lhs.substring(1);if(this.commandMap_[commandName]&&this.commandMap_[commandName].user)return void delete this.commandMap_[commandName]}else for(var keys=lhs,i=0;i<defaultKeymap.length;i++)if(keys==defaultKeymap[i].keys&&defaultKeymap[i].context===ctx)return void defaultKeymap.splice(i,1);throw Error("No such mapping.")}};var exCommands={colorscheme:function(cm,params){!params.args||params.args.length<1?showConfirm(cm,cm.getOption("theme")):cm.setOption("theme",params.args[0])},map:function(cm,params,ctx){var mapArgs=params.args;!mapArgs||mapArgs.length<2?cm&&showConfirm(cm,"Invalid mapping: "+params.input):exCommandDispatcher.map(mapArgs[0],mapArgs[1],ctx)},imap:function(cm,params){this.map(cm,params,"insert")},nmap:function(cm,params){this.map(cm,params,"normal")},vmap:function(cm,params){this.map(cm,params,"visual")},unmap:function(cm,params,ctx){var mapArgs=params.args;!mapArgs||mapArgs.length<1?cm&&showConfirm(cm,"No such mapping: "+params.input):exCommandDispatcher.unmap(mapArgs[0],ctx)},move:function(cm,params){commandDispatcher.processCommand(cm,cm.state.vim,{type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:params.line+1})},set:function(cm,params){var setArgs=params.args,setCfg=params.setCfg||{};if(!setArgs||setArgs.length<1)cm&&showConfirm(cm,"Invalid mapping: "+params.input);else{var expr=setArgs[0].split("="),optionName=expr[0],value=expr[1],forceGet=!1;if("?"==optionName.charAt(optionName.length-1)){if(value)throw Error("Trailing characters: "+params.argString);optionName=optionName.substring(0,optionName.length-1),forceGet=!0}void 0===value&&"no"==optionName.substring(0,2)&&(optionName=optionName.substring(2),value=!1);var optionIsBoolean=options[optionName]&&"boolean"==options[optionName].type;if(optionIsBoolean&&null==value&&(value=!0),!optionIsBoolean&&void 0===value||forceGet){var oldValue=getOption(optionName,cm,setCfg);oldValue instanceof Error?showConfirm(cm,oldValue.message):showConfirm(cm,!0===oldValue||!1===oldValue?" "+(oldValue?"":"no")+optionName:"  "+optionName+"="+oldValue)}else{var setOptionReturn=setOption(optionName,value,cm,setCfg);setOptionReturn instanceof Error&&showConfirm(cm,setOptionReturn.message)}}},setlocal:function(cm,params){params.setCfg={scope:"local"},this.set(cm,params)},setglobal:function(cm,params){params.setCfg={scope:"global"},this.set(cm,params)},registers:function(cm,params){var regArgs=params.args,registers=vimGlobalState.registerController.registers,regInfo="----------Registers----------<br><br>";if(regArgs){regArgs=regArgs.join("");for(var i=0;i<regArgs.length;i++){if(registerName=regArgs.charAt(i),vimGlobalState.registerController.isValidRegister(registerName))regInfo+='"'+registerName+"    "+(registers[registerName]||new Register).toString()+"<br>"}}else for(var registerName in registers){var text=registers[registerName].toString();text.length&&(regInfo+='"'+registerName+"    "+text+"<br>")}showConfirm(cm,regInfo)},sort:function(cm,params){var reverse,ignoreCase,unique,number,pattern;var err=function(){if(params.argString){var args=new _cm_adapter.default.StringStream(params.argString);if(args.eat("!")&&(reverse=!0),args.eol())return;if(!args.eatSpace())return"Invalid arguments";var opts=args.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!opts&&!args.eol())return"Invalid arguments";if(opts[1]){ignoreCase=-1!=opts[1].indexOf("i"),unique=-1!=opts[1].indexOf("u");var decimal=-1!=opts[1].indexOf("d")||-1!=opts[1].indexOf("n")&&1,hex=-1!=opts[1].indexOf("x")&&1,octal=-1!=opts[1].indexOf("o")&&1;if(decimal+hex+octal>1)return"Invalid arguments";number=(decimal?"decimal":hex&&"hex")||octal&&"octal"}opts[2]&&(pattern=new RegExp(opts[2].substr(1,opts[2].length-2),ignoreCase?"i":""))}}();if(err)showConfirm(cm,err+": "+params.argString);else{var lineStart=params.line||cm.firstLine(),lineEnd=params.lineEnd||params.line||cm.lastLine();if(lineStart!=lineEnd){var curStart=Pos(lineStart,0),curEnd=Pos(lineEnd,lineLength(cm,lineEnd)),text=cm.getRange(curStart,curEnd).split("\n"),numberRegex=pattern||("decimal"==number?/(-?)([\d]+)/:"hex"==number?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==number?/([0-7]+)/:null),radix="decimal"==number?10:"hex"==number?16:"octal"==number?8:null,numPart=[],textPart=[];if(number||pattern)for(var i=0;i<text.length;i++){var matchPart=pattern?text[i].match(pattern):null;matchPart&&""!=matchPart[0]?numPart.push(matchPart):!pattern&&numberRegex.exec(text[i])?numPart.push(text[i]):textPart.push(text[i])}else textPart=text;if(numPart.sort(pattern?function(a,b){var tmp;return reverse&&(tmp=a,a=b,b=tmp),ignoreCase&&(a[0]=a[0].toLowerCase(),b[0]=b[0].toLowerCase()),a[0]<b[0]?-1:1}:compareFn),pattern)for(i=0;i<numPart.length;i++)numPart[i]=numPart[i].input;else number||textPart.sort(compareFn);if(text=reverse?numPart.concat(textPart):textPart.concat(numPart),unique){var lastLine,textOld=text;text=[];for(i=0;i<textOld.length;i++)textOld[i]!=lastLine&&text.push(textOld[i]),lastLine=textOld[i]}cm.replaceRange(text.join("\n"),curStart,curEnd)}}function compareFn(a,b){var tmp;reverse&&(tmp=a,a=b,b=tmp);ignoreCase&&(a=a.toLowerCase(),b=b.toLowerCase());var anum=number&&numberRegex.exec(a),bnum=number&&numberRegex.exec(b);return anum?(anum=parseInt((anum[1]+anum[2]).toLowerCase(),radix))-(bnum=parseInt((bnum[1]+bnum[2]).toLowerCase(),radix)):a<b?-1:1}},global:function(cm,params){var argString=params.argString;if(argString){var cmd,lineStart=void 0!==params.line?params.line:cm.firstLine(),lineEnd=params.lineEnd||params.line||cm.lastLine(),tokens=function(argString){return splitBySeparator(argString,"/")}(argString),regexPart=argString;if(tokens.length&&(regexPart=tokens[0],cmd=tokens.slice(1,tokens.length).join("/")),regexPart)try{updateSearchQuery(cm,regexPart,!0,!0)}catch(e){return void showConfirm(cm,"Invalid regex: "+regexPart)}for(var query=getSearchState(cm).getQuery(),matchedLines=[],content="",i=lineStart;i<=lineEnd;i++){query.test(cm.getLine(i))&&(matchedLines.push(i+1),content+=cm.getLine(i)+"<br>")}if(cmd){var index=0;!function nextCommand(){if(index<matchedLines.length){var command=matchedLines[index]+cmd;exCommandDispatcher.processCommand(cm,command,{callback:nextCommand})}index++}()}else showConfirm(cm,content)}else showConfirm(cm,"Regular Expression missing from global")},substitute:function(cm,params){if(!cm.getSearchCursor)throw new Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var regexPart,trailing,flagsPart,count,argString=params.argString,tokens=argString?splitBySeparator(argString,argString[0]):[],replacePart="",confirm=!1,global=!1;if(tokens.length)regexPart=tokens[0],replacePart=tokens[1],regexPart&&"$"===regexPart[regexPart.length-1]&&(regexPart=regexPart.slice(0,regexPart.length-1)+"\\n",replacePart=replacePart?replacePart+"\n":"\n"),void 0!==replacePart&&(replacePart=getOption("pcre")?function(str){for(var stream=new _cm_adapter.default.StringStream(str),output=[];!stream.eol();){for(;stream.peek()&&"\\"!=stream.peek();)output.push(stream.next());var matched=!1;for(var matcher in unescapes)if(stream.match(matcher,!0)){matched=!0,output.push(unescapes[matcher]);break}matched||output.push(stream.next())}return output.join("")}(replacePart):function(str){for(var k,escapeNextChar=!1,out=[],i=-1;i<str.length;i++){var c=str.charAt(i)||"",n=str.charAt(i+1)||"";charUnescapes[c+n]?(out.push(charUnescapes[c+n]),i++):escapeNextChar?(out.push(c),escapeNextChar=!1):"\\"===c?(escapeNextChar=!0,k=n,numberRegex.test(k)||"$"===n?out.push("$"):"/"!==n&&"\\"!==n&&out.push("\\")):("$"===c&&out.push("$"),out.push(c),"/"===n&&out.push("\\"))}return out.join("")}(replacePart),vimGlobalState.lastSubstituteReplacePart=replacePart),trailing=tokens[2]?tokens[2].split(" "):[];else if(argString&&argString.length)return void showConfirm(cm,"Substitutions should be of the form :s/pattern/replace/");if(trailing&&(flagsPart=trailing[0],count=parseInt(trailing[1]),flagsPart&&(-1!=flagsPart.indexOf("c")&&(confirm=!0,flagsPart.replace("c","")),-1!=flagsPart.indexOf("g")&&(global=!0,flagsPart.replace("g","")),regexPart=regexPart.replace(/\//g,"\\/")+"/"+flagsPart)),regexPart)try{updateSearchQuery(cm,regexPart,!0,!0)}catch(e){return void showConfirm(cm,"Invalid regex: "+regexPart)}if(void 0!==(replacePart=replacePart||vimGlobalState.lastSubstituteReplacePart)){var query=getSearchState(cm).getQuery(),lineStart=void 0!==params.line?params.line:cm.getCursor().line,lineEnd=params.lineEnd||lineStart;lineStart==cm.firstLine()&&lineEnd==cm.lastLine()&&(lineEnd=1/0),count&&(lineEnd=(lineStart=lineEnd)+count-1);var startPos=clipCursorToContent(cm,Pos(lineStart,0)),cursor=cm.getSearchCursor(query,startPos);!function(cm,confirm,global,lineStart,lineEnd,searchCursor,query,replaceWith,callback){cm.state.vim.exMode=!0;var done=!1,lastPos=searchCursor.from();function replaceAll(){var matches=searchCursor.getMatches(),matchesLength=matches.length;cm.operation(function(matches,matchesLength){for(var i=matchesLength-1;i>=0;i--)replace(),replaceAllNext(matches,i);done=!0,stop()}.bind(this,matches,matchesLength))}function replace(){var newText=cm.getRange(searchCursor.from(),searchCursor.to()).replace(query,replaceWith);searchCursor.replace(newText)}function replaceAllNext(matches,index){var hasNext=searchCursor.jumpTo(index)&&isInRange(searchCursor.from(),lineStart,lineEnd);matches.pop();hasNext&&!global&&lastPos&&searchCursor.from().line==lastPos.line||(cm.scrollIntoView(searchCursor.from(),30),lastPos=searchCursor.from(),done=!1)}function next(){for(;searchCursor.findNext()&&isInRange(searchCursor.from(),lineStart,lineEnd);)if(global||!lastPos||searchCursor.from().line!=lastPos.line)return cm.scrollIntoView(searchCursor.from(),30),cm.setSelection(searchCursor.from(),searchCursor.to()),lastPos=searchCursor.from(),void(done=!1);done=!0}function stop(close){if(close&&close(),cm.focus(),lastPos){cm.setCursor(lastPos);var vim=cm.state.vim;vim.exMode=!1,vim.lastHPos=vim.lastHSPos=lastPos.ch}callback&&callback()}if(next(),done)return void showConfirm(cm,"No matches for "+query.source);if(!confirm)return replaceAll(),void(callback&&callback());showPrompt(cm,{prefix:"replace with <strong>"+replaceWith+"</strong> (y/n/a/q/l)",onKeyDown:function(e,_value,close){switch(_cm_adapter.default.e_stop(e),_cm_adapter.default.keyName(e)){case"y":case"Y":replace(),next();break;case"n":case"N":next();break;case"a":case"A":var savedCallback=callback;callback=void 0,cm.operation(replaceAll),callback=savedCallback;break;case"l":case"L":replace();case"q":case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":stop(close)}return done&&stop(close),!0}})}(cm,confirm,global,lineStart,lineEnd,cursor,query,replacePart,params.callback)}else showConfirm(cm,"No previous substitute regular expression")},redo:_cm_adapter.default.commands.redo,undo:_cm_adapter.default.commands.undo,write:function(cm){_cm_adapter.default.commands.save?_cm_adapter.default.commands.save(cm):cm.save&&cm.save()},nohlsearch:function(cm){clearSearchHighlight(cm)},yank:function(cm){var line=copyCursor(cm.getCursor()).line,lineText=cm.getLine(line);vimGlobalState.registerController.pushText("0","yank",lineText,!0,!0)},delmarks:function(cm,params){if(params.argString&&trim(params.argString))for(var state=cm.state.vim,stream=new _cm_adapter.default.StringStream(trim(params.argString));!stream.eol();){stream.eatSpace();var count=stream.pos;if(!stream.match(/[a-zA-Z]/,!1))return void showConfirm(cm,"Invalid argument: "+params.argString.substring(count));var sym=stream.next();if(stream.match("-",!0)){if(!stream.match(/[a-zA-Z]/,!1))return void showConfirm(cm,"Invalid argument: "+params.argString.substring(count));var startMark=sym,finishMark=stream.next();if(!(isLowerCase(startMark)&&isLowerCase(finishMark)||isUpperCase(startMark)&&isUpperCase(finishMark)))return void showConfirm(cm,"Invalid argument: "+startMark+"-");var start=startMark.charCodeAt(0),finish=finishMark.charCodeAt(0);if(start>=finish)return void showConfirm(cm,"Invalid argument: "+params.argString.substring(count));for(var j=0;j<=finish-start;j++){var mark=String.fromCharCode(start+j);delete state.marks[mark]}}else delete state.marks[sym]}else showConfirm(cm,"Argument required")}},exCommandDispatcher=new ExCommandDispatcher;function exitInsertMode(cm){var vim=cm.state.vim,macroModeState=vimGlobalState.macroModeState,insertModeChangeRegister=vimGlobalState.registerController.getRegister("."),isPlaying=macroModeState.isPlaying,lastChange=macroModeState.lastInsertModeChanges,text=[];if(!isPlaying){for(var selLength=lastChange.inVisualBlock&&vim.lastSelection?vim.lastSelection.visualBlock.height:1,changes=lastChange.changes,i=(text=[],0);i<changes.length;)text.push(changes[i]),changes[i]instanceof InsertModeKey?i++:i+=selLength;lastChange.changes=text,cm.off("change",onChange),_cm_adapter.default.off(cm.getInputField(),"keydown",onKeyEventTargetKeyDown)}!isPlaying&&vim.insertModeRepeat>1&&(_repeatLastEdit(cm,vim,vim.insertModeRepeat-1,!0),vim.lastEditInputState.repeatOverride=vim.insertModeRepeat),delete vim.insertModeRepeat,vim.insertMode=!1,cm.setCursor(cm.getCursor().line,cm.getCursor().ch-1),cm.setOption("keyMap","vim"),cm.setOption("disableInput",!0),cm.toggleOverwrite(!1),insertModeChangeRegister.setText(lastChange.changes.join("")),_cm_adapter.default.signal(cm,"vim-mode-change",{mode:"normal"}),macroModeState.isRecording&&function(macroModeState){if(macroModeState.isPlaying)return;var registerName=macroModeState.latestRegister,register=vimGlobalState.registerController.getRegister(registerName);register&&register.pushInsertModeChanges&&register.pushInsertModeChanges(macroModeState.lastInsertModeChanges)}(macroModeState),cm.enterVimMode()}function _mapCommand(command){defaultKeymap.unshift(command)}function executeMacroRegister(cm,vim,macroModeState,registerName){var register=vimGlobalState.registerController.getRegister(registerName);if(":"==registerName)return register.keyBuffer[0]&&exCommandDispatcher.processCommand(cm,register.keyBuffer[0]),void(macroModeState.isPlaying=!1);var keyBuffer=register.keyBuffer,imc=0;macroModeState.isPlaying=!0,macroModeState.replaySearchQueries=register.searchQueries.slice(0);for(var i=0;i<keyBuffer.length;i++)for(var match,key,text=keyBuffer[i];text;)if(key=(match=/<\w+-.+?>|<\w+>|./.exec(text))[0],text=text.substring(match.index+key.length),_cm_adapter.default.Vim.handleKey(cm,key,"macro"),vim.insertMode){var changes=register.insertModeChanges[imc++].changes;vimGlobalState.macroModeState.lastInsertModeChanges.changes=changes,repeatInsertModeChanges(cm,changes,1),exitInsertMode(cm)}macroModeState.isPlaying=!1}function onChange(cm,changeObj){var macroModeState=vimGlobalState.macroModeState,lastChange=macroModeState.lastInsertModeChanges;if(!macroModeState.isPlaying)for(;changeObj;){if(lastChange.expectCursorActivityForChange=!0,"+input"==changeObj.origin||"paste"==changeObj.origin||void 0===changeObj.origin){var text=changeObj.text.join("\n");lastChange.maybeReset&&(lastChange.changes=[],lastChange.maybeReset=!1),cm.state.overwrite&&!/\n/.test(text)?lastChange.changes.push([text]):lastChange.changes.push(text)}changeObj=changeObj.next}}function onCursorActivity(cm){var vim=cm.state.vim;if(vim.insertMode){var macroModeState=vimGlobalState.macroModeState;if(macroModeState.isPlaying)return;var lastChange=macroModeState.lastInsertModeChanges;lastChange.expectCursorActivityForChange?lastChange.expectCursorActivityForChange=!1:lastChange.maybeReset=!0}else cm.curOp.isVimOp||function(cm,vim){var anchor=cm.getCursor("anchor"),head=cm.getCursor("head");vim.visualMode&&!cm.somethingSelected()?exitVisualMode(cm,!1):vim.visualMode||vim.insertMode||!cm.somethingSelected()||(vim.visualMode=!0,vim.visualLine=!1,_cm_adapter.default.signal(cm,"vim-mode-change",{mode:"visual"}));if(vim.visualMode){var headOffset=cursorIsBefore(head,anchor)?0:-1,anchorOffset=cursorIsBefore(head,anchor)?-1:0;head=offsetCursor(head,0,headOffset),anchor=offsetCursor(anchor,0,anchorOffset),vim.sel={anchor:anchor,head:head},updateMark(cm,vim,"<",cursorMin(head,anchor)),updateMark(cm,vim,">",cursorMax(head,anchor))}else vim.insertMode||(vim.lastHPos=cm.getCursor().ch)}(cm,vim);vim.visualMode&&updateFakeCursor(cm)}function updateFakeCursor(cm){var vim=cm.state.vim,from=clipCursorToContent(cm,copyCursor(vim.sel.head)),to=offsetCursor(from,0,1);vim.fakeCursor&&vim.fakeCursor.clear(),vim.fakeCursor=cm.markText(from,to,{className:"cm-animate-fat-cursor"})}function InsertModeKey(keyName){this.keyName=keyName}function onKeyEventTargetKeyDown(e){var lastChange=vimGlobalState.macroModeState.lastInsertModeChanges,keyName=_cm_adapter.default.keyName(e);keyName&&(-1==keyName.indexOf("Delete")&&-1==keyName.indexOf("Backspace")||_cm_adapter.default.lookupKey(keyName,"vim-insert",(function(){return lastChange.maybeReset&&(lastChange.changes=[],lastChange.maybeReset=!1),lastChange.changes.push(new InsertModeKey(keyName)),!0})))}function _repeatLastEdit(cm,vim,repeat,repeatForInsert){var macroModeState=vimGlobalState.macroModeState;macroModeState.isPlaying=!0;var isAction=!!vim.lastEditActionCommand,cachedInputState=vim.inputState;function repeatCommand(){isAction?commandDispatcher.processAction(cm,vim,vim.lastEditActionCommand):commandDispatcher.evalInput(cm,vim)}function repeatInsert(repeat){if(macroModeState.lastInsertModeChanges.changes.length>0){repeat=vim.lastEditActionCommand?repeat:1;var changeObject=macroModeState.lastInsertModeChanges;repeatInsertModeChanges(cm,changeObject.changes,repeat)}}if(vim.inputState=vim.lastEditInputState,isAction&&vim.lastEditActionCommand.interlaceInsertRepeat)for(var i=0;i<repeat;i++)repeatCommand(),repeatInsert(1);else repeatForInsert||repeatCommand(),repeatInsert(repeat);vim.inputState=cachedInputState,vim.insertMode&&!repeatForInsert&&exitInsertMode(cm),macroModeState.isPlaying=!1}function repeatInsertModeChanges(cm,changes,repeat){function keyHandler(binding){return"string"==typeof binding?_cm_adapter.default.commands[binding](cm):binding(cm),!0}var head=cm.getCursor("head"),inVisualBlock=vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock;if(inVisualBlock){var lastSel=cm.state.vim.lastSelection,offset=function(anchor,head){return{line:head.line-anchor.line,ch:head.line-anchor.line}}(lastSel.anchor,lastSel.head);selectForInsert(cm,head,offset.line+1),repeat=cm.listSelections().length,cm.setCursor(head)}for(var i=0;i<repeat;i++){inVisualBlock&&cm.setCursor(offsetCursor(head,i,0));for(var j=0;j<changes.length;j++){var change=changes[j];if(change instanceof InsertModeKey)_cm_adapter.default.lookupKey(change.keyName,"vim-insert",keyHandler);else if("string"==typeof change){var cur=cm.getCursor();cm.replaceRange(change,cur,cur)}else{var start=cm.getCursor(),end=offsetCursor(start,0,change[0].length);cm.replaceRange(change[0],start,end)}}}inVisualBlock&&cm.setCursor(offsetCursor(head,0,1))}return _cm_adapter.default.keyMap.vim={attach:attachVimMap,detach:detachVimMap,call:cmKey},defineOption("insertModeEscKeysTimeout",200,"number"),_cm_adapter.default.keyMap["vim-insert"]={fallthrough:["default"],attach:attachVimMap,detach:detachVimMap,call:cmKey},_cm_adapter.default.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:attachVimMap,detach:detachVimMap,call:cmKey},resetVimGlobalState(),vimApi};exports.Vim=Vim,_cm_adapter.default.Vim=Vim();var _default=_cm_adapter.default;exports.default=_default},3342:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _monacoEditor=__webpack_require__(3343),_cursorTypeOperations=__webpack_require__(2319);function _slicedToArray(arr,i){return function(arr){if(Array.isArray(arr))return arr}(arr)||function(arr,i){if(!(Symbol.iterator in Object(arr))&&"[object Arguments]"!==Object.prototype.toString.call(arr))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}var VerticalRevealType_Bottom=4,EditorOptConstants={readOnly:65,cursorWidth:20,fontInfo:32},_window$navigator=window.navigator,userAgent=_window$navigator.userAgent,platform=_window$navigator.platform,nonASCIISingleCaseWordChar=(!/Edge\/(\d+)/.exec(userAgent)&&/AppleWebKit/.test(userAgent)&&/Mobile\/\w+/.test(userAgent)||/Mac/.test(platform),/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/);function Pos(line,column){if(!(this instanceof Pos))return new Pos(line,column);this.line=line,this.ch=column}String.prototype.normalize?function(str){return str.normalize("NFD").toLowerCase()}:function(str){return str.toLowerCase()};var StringStream=function(string,tabSize){this.pos=this.start=0,this.string=string,this.tabSize=tabSize||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};function toCmPos(pos){return new Pos(pos.lineNumber-1,pos.column-1)}function toMonacoPos(pos){return new _monacoEditor.Position(pos.line+1,pos.ch+1)}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(match){var ch=this.string.charAt(this.pos);if("string"==typeof match)var ok=ch==match;else ok=ch&&(match.test?match.test(ch):match(ch));if(ok)return++this.pos,ch},eatWhile:function(match){for(var start=this.pos;this.eat(match););return this.pos>start},eatSpace:function(){for(var start=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>start},skipToEnd:function(){this.pos=this.string.length},skipTo:function(ch){var found=this.string.indexOf(ch,this.pos);if(found>-1)return this.pos=found,!0},backUp:function(n){this.pos-=n},column:function(){throw"not implemented"},indentation:function(){throw"not implemented"},match:function(pattern,consume,caseInsensitive){if("string"!=typeof pattern){var match=this.string.slice(this.pos).match(pattern);return match&&match.index>0?null:(match&&!1!==consume&&(this.pos+=match[0].length),match)}var cased=function(str){return caseInsensitive?str.toLowerCase():str};if(cased(this.string.substr(this.pos,pattern.length))==cased(pattern))return!1!==consume&&(this.pos+=pattern.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(n,inner){this.lineStart+=n;try{return inner()}finally{this.lineStart-=n}}};var Marker=function(){function Marker(cm,id,line,ch){_classCallCheck(this,Marker),this.cm=cm,this.id=id,this.lineNumber=line+1,this.column=ch+1,cm.marks[this.id]=this}return _createClass(Marker,[{key:"clear",value:function(){delete this.cm.marks[this.id]}},{key:"find",value:function(){return toCmPos(this)}}]),Marker}();function monacoToCmKey(e){var skip=arguments.length>1&&void 0!==arguments[1]&&arguments[1],addQuotes=!0,keyName=monaco.KeyCode[e.keyCode];e.key&&(keyName=e.key,addQuotes=!1);var key=keyName,skipOnlyShiftCheck=skip;switch(e.keyCode){case _monacoEditor.KeyCode.Shift:case _monacoEditor.KeyCode.Meta:case _monacoEditor.KeyCode.Alt:case _monacoEditor.KeyCode.Ctrl:return key;case _monacoEditor.KeyCode.Escape:skipOnlyShiftCheck=!0,key="Esc"}return keyName.startsWith("KEY_")?key=keyName[keyName.length-1].toLowerCase():keyName.endsWith("Arrow")?(skipOnlyShiftCheck=!0,key=keyName.substr(0,keyName.length-5)):keyName.startsWith("US_")&&(key=e.browserEvent.key),skipOnlyShiftCheck||e.altKey||e.ctrlKey||e.metaKey?(e.altKey&&(key="Alt-".concat(key)),e.ctrlKey&&(key="Ctrl-".concat(key)),e.metaKey&&(key="Meta-".concat(key)),e.shiftKey&&(key="Shift-".concat(key))):key=e.key||e.browserEvent.key,1===key.length&&addQuotes&&(key="'".concat(key,"'")),key}var CMAdapter=function(){function CMAdapter(editor){_classCallCheck(this,CMAdapter),_initialiseProps.call(this),this.editor=editor,this.state={},this.marks={},this.$uid=0,this.disposables=[],this.listeners={},this.curOp={},this.attached=!1,this.statusBar=null,this.addLocalListeners(),this.ctxInsert=this.editor.createContextKey("insertMode",!0)}return _createClass(CMAdapter,[{key:"attach",value:function(){CMAdapter.keyMap.vim.attach(this)}},{key:"addLocalListeners",value:function(){this.disposables.push(this.editor.onDidChangeCursorPosition(this.handleCursorChange),this.editor.onDidChangeModelContent(this.handleChange),this.editor.onKeyDown(this.handleKeyDown))}},{key:"handleReplaceMode",value:function(key,e){var fromReplace=!1,_char=key,pos=this.editor.getPosition(),range=new _monacoEditor.Range(pos.lineNumber,pos.column,pos.lineNumber,pos.column+1);if(key.startsWith("'"))_char=key[1];else if("Enter"===_char)_char="\n";else{if("Backspace"!==_char)return;var lastItem=this.replaceStack.pop();if(!lastItem)return;fromReplace=!0,_char=lastItem,range=new _monacoEditor.Range(pos.lineNumber,pos.column,pos.lineNumber,pos.column-1)}e.preventDefault(),e.stopPropagation(),this.replaceStack||(this.replaceStack=[]),fromReplace||this.replaceStack.push(this.editor.getModel().getValueInRange(range)),this.editor.executeEdits("vim",[{text:_char,range:range,forceMoveMarkers:!0}]),fromReplace&&this.editor.setPosition(range.getStartPosition())}},{key:"setOption",value:function(key,value){this.state[key]=value,"theme"===key&&_monacoEditor.editor.setTheme(value)}},{key:"getConfiguration",value:function(){var editor=this.editor,opts=EditorOptConstants;return"function"==typeof editor.getConfiguration?editor.getConfiguration():("EditorOption"in _monacoEditor.editor&&(opts=_monacoEditor.editor.EditorOption),{readOnly:editor.getOption(opts.readOnly),viewInfo:{cursorWidth:editor.getOption(opts.cursorWidth)},fontInfo:editor.getOption(opts.fontInfo)})}},{key:"getOption",value:function(key){return"readOnly"===key?this.getConfiguration().readOnly:"firstLineNumber"===key?this.firstLine()+1:"indentWithTabs"===key?!this.editor.getModel().getOptions().insertSpaces:"function"==typeof this.editor.getConfiguration?this.editor.getRawConfiguration()[key]:this.editor.getRawOptions()[key]}},{key:"dispatch",value:function(signal){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];var listeners=this.listeners[signal];listeners&&listeners.forEach((function(handler){return handler.apply(void 0,args)}))}},{key:"on",value:function(event,handler){this.listeners[event]||(this.listeners[event]=[]),this.listeners[event].push(handler)}},{key:"off",value:function(event,handler){var listeners=this.listeners[event];listeners&&(this.listeners[event]=listeners.filter((function(l){return l!==handler})))}},{key:"firstLine",value:function(){return 0}},{key:"lastLine",value:function(){return this.lineCount()-1}},{key:"lineCount",value:function(){return this.editor.getModel().getLineCount()}},{key:"defaultTextHeight",value:function(){return 1}},{key:"getLine",value:function(line){if(line<0)return"";var maxLines=this.editor.getModel().getLineCount();return line+1>maxLines&&(line=maxLines-1),this.editor.getModel().getLineContent(line+1)}},{key:"getAnchorForSelection",value:function(selection){return selection.isEmpty()?selection.getPosition():selection.getDirection()===_monacoEditor.SelectionDirection.LTR?selection.getStartPosition():selection.getEndPosition()}},{key:"getHeadForSelection",value:function(selection){return selection.isEmpty()?selection.getPosition():selection.getDirection()===_monacoEditor.SelectionDirection.LTR?selection.getEndPosition():selection.getStartPosition()}},{key:"getCursor",value:function(){var type=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!type)return toCmPos(this.editor.getPosition());var sel=this.editor.getSelection();return toCmPos(sel.isEmpty()?sel.getPosition():"anchor"===type?this.getAnchorForSelection(sel):this.getHeadForSelection(sel))}},{key:"getRange",value:function(start,end){var p1=toMonacoPos(start),p2=toMonacoPos(end);return this.editor.getModel().getValueInRange(_monacoEditor.Range.fromPositions(p1,p2))}},{key:"getSelection",value:function(){return this.editor.getModel().getValueInRange(this.editor.getSelection())}},{key:"replaceRange",value:function(text,start,end){var p1=toMonacoPos(start),p2=end?toMonacoPos(end):p1;this.editor.executeEdits("vim",[{text:text,range:_monacoEditor.Range.fromPositions(p1,p2)}]),this.pushUndoStop()}},{key:"pushUndoStop",value:function(){this.editor.pushUndoStop()}},{key:"setCursor",value:function(line,ch){var pos=line;"object"!==_typeof(line)&&((pos={}).line=line,pos.ch=ch);var monacoPos=this.editor.getModel().validatePosition(toMonacoPos(pos));this.editor.setPosition(toMonacoPos(pos)),this.editor.revealPosition(monacoPos)}},{key:"somethingSelected",value:function(){return!this.editor.getSelection().isEmpty()}},{key:"operation",value:function(fn,force){return fn()}},{key:"listSelections",value:function(){var _this=this,selections=this.editor.getSelections();return!selections.length||this.inVirtualSelectionMode?[{anchor:this.getCursor("anchor"),head:this.getCursor("head")}]:selections.map((function(sel){sel.getPosition(),sel.getStartPosition(),sel.getEndPosition();return{anchor:_this.clipPos(toCmPos(_this.getAnchorForSelection(sel))),head:_this.clipPos(toCmPos(_this.getHeadForSelection(sel)))}}))}},{key:"focus",value:function(){this.editor.focus()}},{key:"setSelections",value:function(selections,primIndex){var hasSel=!!this.editor.getSelections().length,sels=selections.map((function(sel,index){var anchor=sel.anchor,head=sel.head;return hasSel?_monacoEditor.Selection.fromPositions(toMonacoPos(anchor),toMonacoPos(head)):_monacoEditor.Selection.fromPositions(toMonacoPos(head),toMonacoPos(anchor))}));if(primIndex?sels[primIndex]&&sels.push(sels.splice(primIndex,1)[0]):sels.reverse(),sels.length){var posToReveal,sel=sels[0];posToReveal=sel.getDirection()===_monacoEditor.SelectionDirection.LTR?sel.getEndPosition():sel.getStartPosition(),this.editor.setSelections(sels),this.editor.revealPosition(posToReveal)}}},{key:"setSelection",value:function(frm,to){var range=_monacoEditor.Range.fromPositions(toMonacoPos(frm),toMonacoPos(to));this.editor.setSelection(range)}},{key:"getSelections",value:function(){var editor=this.editor;return editor.getSelections().map((function(sel){return editor.getModel().getValueInRange(sel)}))}},{key:"replaceSelections",value:function(texts){var editor=this.editor;editor.getSelections().forEach((function(sel,index){editor.executeEdits("vim",[{range:sel,text:texts[index],forceMoveMarkers:!1}])}))}},{key:"toggleOverwrite",value:function(toggle){toggle?(this.enterVimMode(),this.replaceMode=!0):(this.leaveVimMode(),this.replaceMode=!1,this.replaceStack=[])}},{key:"charCoords",value:function(pos,mode){return{top:pos.line,left:pos.ch}}},{key:"coordsChar",value:function(pos,mode){}},{key:"clipPos",value:function(p){return toCmPos(this.editor.getModel().validatePosition(toMonacoPos(p)))}},{key:"setBookmark",value:function(cursor,options){var bm=new Marker(this,this.$uid++,cursor.line,cursor.ch);return options&&options.insertLeft||(bm.$insertRight=!0),this.marks[bm.id]=bm,bm}},{key:"getScrollInfo",value:function(){var editor=this.editor,range=_slicedToArray(editor.getVisibleRanges(),1)[0];return{left:0,top:range.startLineNumber-1,height:editor.getModel().getLineCount(),clientHeight:range.endLineNumber-range.startLineNumber+1}}},{key:"triggerEditorAction",value:function(action){this.editor.trigger("vim",action)}},{key:"dispose",value:function(){this.dispatch("dispose"),this.removeOverlay(),CMAdapter.keyMap.vim&&CMAdapter.keyMap.vim.detach(this),this.disposables.forEach((function(d){return d.dispose()}))}},{key:"getInputField",value:function(){}},{key:"getWrapperElement",value:function(){}},{key:"enterVimMode",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.ctxInsert.set(!1);var config=this.getConfiguration();this.initialCursorWidth=config.viewInfo.cursorWidth||0,this.editor.updateOptions({cursorWidth:config.fontInfo.typicalFullwidthCharacterWidth,cursorBlinking:"solid"})}},{key:"leaveVimMode",value:function(){this.ctxInsert.set(!0),this.editor.updateOptions({cursorWidth:this.initialCursorWidth||0,cursorBlinking:"blink"})}},{key:"virtualSelectionMode",value:function(){return this.inVirtualSelectionMode}},{key:"markText",value:function(){return{clear:function(){},find:function(){}}}},{key:"getUserVisibleLines",value:function(){var ranges=this.editor.getVisibleRanges();if(!ranges.length)return{top:0,bottom:0};var res={top:1/0,bottom:0};return ranges.reduce((function(acc,range){return range.startLineNumber<acc.top&&(acc.top=range.startLineNumber),range.endLineNumber>acc.bottom&&(acc.bottom=range.endLineNumber),acc}),res),res.top-=1,res.bottom-=1,res}},{key:"findPosV",value:function(startPos,amount,unit){var editor=this.editor,finalAmount=amount,pos=toMonacoPos(startPos);if("page"===unit){var editorHeight=editor.getLayoutInfo().height,lineHeight=this.getConfiguration().fontInfo.lineHeight;finalAmount*=Math.floor(editorHeight/lineHeight),"line"}return"line"===unit&&(pos.lineNumber+=finalAmount),toCmPos(pos)}},{key:"findMatchingBracket",value:function(pos){var mPos=toMonacoPos(pos),res=this.editor.getModel().matchBracket(mPos);return res&&2===res.length?{to:toCmPos(res[1].getStartPosition())}:{to:null}}},{key:"findFirstNonWhiteSpaceCharacter",value:function(line){return this.editor.getModel().getLineFirstNonWhitespaceColumn(line+1)-1}},{key:"scrollTo",value:function(x,y){(x||y)&&(x||(y<0&&(y=this.editor.getPosition().lineNumber-y),this.editor.setScrollTop(this.editor.getTopForLineNumber(y+1))))}},{key:"moveCurrentLineTo",value:function(viewPosition){var editor=this.editor,pos=editor.getPosition(),range=_monacoEditor.Range.fromPositions(pos,pos);switch(viewPosition){case"top":return void editor.revealRangeAtTop(range);case"center":return void editor.revealRangeInCenter(range);case"bottom":return void editor._revealRange(range,VerticalRevealType_Bottom)}}},{key:"getSearchCursor",value:function(query,pos,caseFold){var matchCase=!1,isRegex=!1;query instanceof RegExp&&!query.global&&(matchCase=!query.ignoreCase,query=query.source,isRegex=!0),null==pos.ch&&(pos.ch=Number.MAX_VALUE);var monacoPos=toMonacoPos(pos),context=this,editor=this.editor,lastSearch=null,model=editor.getModel(),matches=model.findMatches(query,!1,isRegex,matchCase)||[];return{getMatches:function(){return matches},findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},jumpTo:function(index){if(!matches||!matches.length)return!1;var match=matches[index];return lastSearch=match.range,context.highlightRanges([lastSearch],"currentFindMatch"),context.highlightRanges(matches.map((function(m){return m.range})).filter((function(r){return!r.equalsRange(lastSearch)}))),lastSearch},find:function(back){if(!matches||!matches.length)return!1;var match;if(back){var _pos=lastSearch?lastSearch.getStartPosition():monacoPos;if(!(match=model.findPreviousMatch(query,_pos,isRegex,matchCase))||!match.range.getStartPosition().isBeforeOrEqual(_pos))return!1}else{var _pos2=lastSearch?lastSearch.getEndPosition():monacoPos;if(!(match=model.findNextMatch(query,_pos2,isRegex,matchCase))||!_pos2.isBeforeOrEqual(match.range.getStartPosition()))return!1}return lastSearch=match.range,context.highlightRanges([lastSearch],"currentFindMatch"),context.highlightRanges(matches.map((function(m){return m.range})).filter((function(r){return!r.equalsRange(lastSearch)}))),lastSearch},from:function(){return lastSearch&&toCmPos(lastSearch.getStartPosition())},to:function(){return lastSearch&&toCmPos(lastSearch.getEndPosition())},replace:function(text){lastSearch&&(editor.executeEdits("vim",[{range:lastSearch,text:text,forceMoveMarkers:!0}]),lastSearch.setEndPosition(editor.getPosition()),editor.setPosition(lastSearch.getStartPosition()))}}}},{key:"highlightRanges",value:function(ranges){var className=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"findMatch",decorationKey="decoration".concat(className);return this[decorationKey]=this.editor.deltaDecorations(this[decorationKey]||[],ranges.map((function(range){return{range:range,options:{stickiness:_monacoEditor.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,zIndex:13,className:className,showIfCollapsed:!0}}}))),this[decorationKey]}},{key:"addOverlay",value:function(_ref,hasBoundary,style){var query=_ref.query,matchCase=!1,isRegex=!1;query&&query instanceof RegExp&&!query.global&&(isRegex=!0,matchCase=!query.ignoreCase,query=query.source);var match=this.editor.getModel().findNextMatch(query,this.editor.getPosition(),isRegex,matchCase);match&&match.range&&this.highlightRanges([match.range])}},{key:"removeOverlay",value:function(){var _this2=this;["currentFindMatch","findMatch"].forEach((function(key){_this2.editor.deltaDecorations(_this2["decoration".concat(key)]||[],[])}))}},{key:"scrollIntoView",value:function(pos){pos&&this.editor.revealPosition(toMonacoPos(pos))}},{key:"moveH",value:function(units,type){if("char"===type){var pos=this.editor.getPosition();this.editor.setPosition(new _monacoEditor.Position(pos.lineNumber,pos.column+units))}}},{key:"scanForBracket",value:function(pos,dir,dd,config){var mPos=toMonacoPos(pos),model=this.editor.getModel(),range=model.matchBracket(mPos);if(!range||2!==range.length)for(var i=0;i<"{([".length;i++){var bracketRange=model.findMatchingBracketUp("{(["[i],mPos);if(bracketRange){range=model.matchBracket(bracketRange.getEndPosition());break}}return range&&2===range.length?{pos:toCmPos(-1===dir?range[1].getStartPosition():range[0].getStartPosition()),ch:model.getValueInRange(-1===dir?range[0]:range[1])}:null}},{key:"indexFromPos",value:function(pos){return this.editor.getModel().getOffsetAt(toMonacoPos(pos))}},{key:"posFromIndex",value:function(offset){return toCmPos(this.editor.getModel().getPositionAt(offset))}},{key:"indentLine",value:function(line){var indentRight=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],editor=this.editor,cursors=editor._getCursors(),pos=new _monacoEditor.Position(line+1,1),sel=_monacoEditor.Selection.fromPositions(pos,pos);editor.executeCommands("editor.action.".concat(indentRight?"indent":"outdent","Lines"),_cursorTypeOperations.TypeOperations[indentRight?"indent":"outdent"](cursors.context.config,this.editor.getModel(),[sel]))}},{key:"setStatusBar",value:function(statusBar){this.statusBar=statusBar}},{key:"openDialog",value:function(html,callback,options){if(this.statusBar)return this.statusBar.setSec(html,callback,options)}},{key:"openNotification",value:function(html){this.statusBar&&this.statusBar.showNotification(html)}}]),CMAdapter}();CMAdapter.Pos=Pos,CMAdapter.signal=function(cm,signal,args){cm.dispatch(signal,args)},CMAdapter.on=function(){},CMAdapter.off=function(){},CMAdapter.addClass=function(){},CMAdapter.rmClass=function(){},CMAdapter.defineOption=function(){},CMAdapter.keyMap={default:function(key){return function(cm){return!0}}},CMAdapter.isWordChar=function(ch){return/\w/.test(ch)||ch>""&&(ch.toUpperCase()!=ch.toLowerCase()||nonASCIISingleCaseWordChar.test(ch))},CMAdapter.keyName=monacoToCmKey,CMAdapter.StringStream=StringStream,CMAdapter.e_stop=function(e){return e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,CMAdapter.e_preventDefault(e),!1},CMAdapter.e_preventDefault=function(e){return e.preventDefault?(e.preventDefault(),e.browserEvent&&e.browserEvent.preventDefault()):e.returnValue=!1,!1},CMAdapter.commands={redo:function(cm){cm.triggerEditorAction("redo")},undo:function(cm){cm.triggerEditorAction("undo")},newlineAndIndent:function(cm){cm.triggerEditorAction("editor.action.insertLineAfter")}},CMAdapter.lookupKey=function lookupKey(key,map,handle){"string"==typeof map&&(map=CMAdapter.keyMap[map]);var found="function"==typeof map?map(key):map[key];if(!1===found)return"nothing";if("..."===found)return"multi";if(null!=found&&handle(found))return"handled";if(map.fallthrough){if(!Array.isArray(map.fallthrough))return lookupKey(key,map.fallthrough,handle);for(var i=0;i<map.fallthrough.length;i++){var result=lookupKey(key,map.fallthrough[i],handle);if(result)return result}}},CMAdapter.defineExtension=function(name,fn){CMAdapter.prototype[name]=fn};var _initialiseProps=function(){var _this3=this;this.handleKeyDown=function(e){if(!(e.browserEvent.defaultPrevented&e.keyCode!==_monacoEditor.KeyCode.Escape)&&_this3.attached){var key=monacoToCmKey(e);if(_this3.replaceMode&&_this3.handleReplaceMode(key,e),key&&CMAdapter.keyMap.vim&&CMAdapter.keyMap.vim.call){var cmd=CMAdapter.keyMap.vim.call(key,_this3);if(cmd){e.preventDefault(),e.stopPropagation();try{cmd()}catch(err){console.error(err)}}}}},this.handleCursorChange=function(e){var position=e.position,editor=(e.source,_this3.editor),selection=editor.getSelection();if(!_this3.ctxInsert.get()&&"mouse"===e.source&&selection.isEmpty()){var maxCol=editor.getModel().getLineMaxColumn(position.lineNumber);if(e.position.column===maxCol)return void editor.setPosition(new _monacoEditor.Position(e.position.lineNumber,maxCol-1))}_this3.dispatch("cursorActivity",_this3,e)},this.handleChange=function(e){var change={text:e.changes.reduce((function(acc,change){return acc.push(change.text),acc}),[]),origin:"+input"},curOp=_this3.curOp=_this3.curOp||{};curOp.changeHandlers||(curOp.changeHandlers=_this3.listeners.change&&_this3.listeners.change.slice()),_this3.virtualSelectionMode()||(curOp.lastChange?curOp.lastChange.next=curOp.lastChange=change:curOp.lastChange=curOp.change=change,_this3.dispatch("change",_this3,change))}},_default2=CMAdapter;exports.default=_default2},3343:function(module,exports,__webpack_require__){var paths;self.MonacoEnvironment=(paths={editorWorkerService:"editor.worker.js",typescript:"ts.worker.js",javascript:"ts.worker.js"},{getWorkerUrl:function(moduleId,label){var pathPrefix=__webpack_require__.p,result=(pathPrefix?pathPrefix.replace(/\/$/,"")+"/":"")+paths[label];if(/^(http:)|(https:)|(file:)/.test(result)){var currentUrl=String(window.location),currentOrigin=currentUrl.substr(0,currentUrl.length-window.location.hash.length-window.location.search.length-window.location.pathname.length);if(result.substring(0,currentOrigin.length)!==currentOrigin)return"data:text/javascript;charset=utf-8,"+encodeURIComponent("/*"+label+'*/importScripts("'+result+'");')}return result}}),__webpack_require__(2381),__webpack_require__(2386),__webpack_require__(2446),__webpack_require__(2392),__webpack_require__(2393),__webpack_require__(2434),__webpack_require__(2299),__webpack_require__(2438),__webpack_require__(2448),__webpack_require__(2252),__webpack_require__(2398),__webpack_require__(2441),__webpack_require__(2314),__webpack_require__(2429),__webpack_require__(2400),__webpack_require__(2435),__webpack_require__(2316),__webpack_require__(2405),__webpack_require__(2318),__webpack_require__(2308),__webpack_require__(2430),__webpack_require__(2409),__webpack_require__(2445),__webpack_require__(2410),__webpack_require__(2432),__webpack_require__(2444),__webpack_require__(2411),__webpack_require__(2433),__webpack_require__(2412),__webpack_require__(2437),__webpack_require__(2413),__webpack_require__(2450),__webpack_require__(2442),__webpack_require__(2251),__webpack_require__(2426),__webpack_require__(2416),__webpack_require__(2289),__webpack_require__(2417),__webpack_require__(2418),__webpack_require__(2312),__webpack_require__(2419),module.exports=__webpack_require__(3344),__webpack_require__(2421),__webpack_require__(2443),__webpack_require__(2422)},3344:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__(2443),__webpack_require__(3345),__webpack_require__(3346),__webpack_require__(3347),__webpack_require__(3364);var _edcore_main__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(2602);for(var __WEBPACK_IMPORT_KEY__ in _edcore_main__WEBPACK_IMPORTED_MODULE_5__)"default"!==__WEBPACK_IMPORT_KEY__&&function(key){__webpack_require__.d(__webpack_exports__,key,(function(){return _edcore_main__WEBPACK_IMPORTED_MODULE_5__[key]}))}(__WEBPACK_IMPORT_KEY__)},3345:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__(2162);var Emitter=monaco.Emitter,LanguageServiceDefaultsImpl=function(){function LanguageServiceDefaultsImpl(languageId,diagnosticsOptions,modeConfiguration){this._onDidChange=new Emitter,this._languageId=languageId,this.setDiagnosticsOptions(diagnosticsOptions),this.setModeConfiguration(modeConfiguration)}return Object.defineProperty(LanguageServiceDefaultsImpl.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(LanguageServiceDefaultsImpl.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(LanguageServiceDefaultsImpl.prototype,"modeConfiguration",{get:function(){return this._modeConfiguration},enumerable:!0,configurable:!0}),Object.defineProperty(LanguageServiceDefaultsImpl.prototype,"diagnosticsOptions",{get:function(){return this._diagnosticsOptions},enumerable:!0,configurable:!0}),LanguageServiceDefaultsImpl.prototype.setDiagnosticsOptions=function(options){this._diagnosticsOptions=options||Object.create(null),this._onDidChange.fire(this)},LanguageServiceDefaultsImpl.prototype.setModeConfiguration=function(modeConfiguration){this._modeConfiguration=modeConfiguration||Object.create(null),this._onDidChange.fire(this)},LanguageServiceDefaultsImpl}(),diagnosticDefault={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"}},modeConfigurationDefault={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},cssDefaults=new LanguageServiceDefaultsImpl("css",diagnosticDefault,modeConfigurationDefault),scssDefaults=new LanguageServiceDefaultsImpl("scss",diagnosticDefault,modeConfigurationDefault),lessDefaults=new LanguageServiceDefaultsImpl("less",diagnosticDefault,modeConfigurationDefault);function getMode(){return __webpack_require__.e(12).then(__webpack_require__.bind(null,3365))}monaco.languages.css={cssDefaults:cssDefaults,lessDefaults:lessDefaults,scssDefaults:scssDefaults},monaco.languages.onLanguage("less",(function(){getMode().then((function(mode){return mode.setupMode(lessDefaults)}))})),monaco.languages.onLanguage("scss",(function(){getMode().then((function(mode){return mode.setupMode(scssDefaults)}))})),monaco.languages.onLanguage("css",(function(){getMode().then((function(mode){return mode.setupMode(cssDefaults)}))}))},3346:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__(2162);var Emitter=monaco.Emitter,jsonDefaults=new(function(){function LanguageServiceDefaultsImpl(languageId,diagnosticsOptions,modeConfiguration){this._onDidChange=new Emitter,this._languageId=languageId,this.setDiagnosticsOptions(diagnosticsOptions),this.setModeConfiguration(modeConfiguration)}return Object.defineProperty(LanguageServiceDefaultsImpl.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(LanguageServiceDefaultsImpl.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(LanguageServiceDefaultsImpl.prototype,"modeConfiguration",{get:function(){return this._modeConfiguration},enumerable:!0,configurable:!0}),Object.defineProperty(LanguageServiceDefaultsImpl.prototype,"diagnosticsOptions",{get:function(){return this._diagnosticsOptions},enumerable:!0,configurable:!0}),LanguageServiceDefaultsImpl.prototype.setDiagnosticsOptions=function(options){this._diagnosticsOptions=options||Object.create(null),this._onDidChange.fire(this)},LanguageServiceDefaultsImpl.prototype.setModeConfiguration=function(modeConfiguration){this._modeConfiguration=modeConfiguration||Object.create(null),this._onDidChange.fire(this)},LanguageServiceDefaultsImpl}())("json",{validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1},{documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0});monaco.languages.json={jsonDefaults:jsonDefaults},monaco.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]}),monaco.languages.onLanguage("json",(function(){__webpack_require__.e(14).then(__webpack_require__.bind(null,3367)).then((function(mode){return mode.setupMode(jsonDefaults)}))}))},3347:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__(2162);var Emitter=monaco.Emitter,LanguageServiceDefaultsImpl=function(){function LanguageServiceDefaultsImpl(languageId,options,modeConfiguration){this._onDidChange=new Emitter,this._languageId=languageId,this.setOptions(options),this.setModeConfiguration(modeConfiguration)}return Object.defineProperty(LanguageServiceDefaultsImpl.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(LanguageServiceDefaultsImpl.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(LanguageServiceDefaultsImpl.prototype,"options",{get:function(){return this._options},enumerable:!0,configurable:!0}),Object.defineProperty(LanguageServiceDefaultsImpl.prototype,"modeConfiguration",{get:function(){return this._modeConfiguration},enumerable:!0,configurable:!0}),LanguageServiceDefaultsImpl.prototype.setOptions=function(options){this._options=options||Object.create(null),this._onDidChange.fire(this)},LanguageServiceDefaultsImpl.prototype.setModeConfiguration=function(modeConfiguration){this._modeConfiguration=modeConfiguration||Object.create(null),this._onDidChange.fire(this)},LanguageServiceDefaultsImpl}(),formatDefaults={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:null,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},handlebarOptionsDefault={format:formatDefaults,suggest:{html5:!0}},razorOptionsDefault={format:formatDefaults,suggest:{html5:!0,razor:!0}};function getConfigurationDefault(languageId){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:languageId===htmlLanguageId,documentFormattingEdits:languageId===htmlLanguageId,documentRangeFormattingEdits:languageId===htmlLanguageId}}var htmlLanguageId="html",htmlDefaults=new LanguageServiceDefaultsImpl(htmlLanguageId,{format:formatDefaults,suggest:{html5:!0,angular1:!0,ionic:!0}},getConfigurationDefault(htmlLanguageId)),handlebarDefaults=new LanguageServiceDefaultsImpl("handlebars",handlebarOptionsDefault,getConfigurationDefault("handlebars")),razorDefaults=new LanguageServiceDefaultsImpl("razor",razorOptionsDefault,getConfigurationDefault("razor"));function getMode(){return __webpack_require__.e(13).then(__webpack_require__.bind(null,3366))}monaco.languages.html={htmlDefaults:htmlDefaults,razorDefaults:razorDefaults,handlebarDefaults:handlebarDefaults},monaco.languages.onLanguage(htmlLanguageId,(function(){getMode().then((function(mode){return mode.setupMode(htmlDefaults)}))})),monaco.languages.onLanguage("handlebars",(function(){getMode().then((function(mode){return mode.setupMode(handlebarDefaults)}))})),monaco.languages.onLanguage("razor",(function(){getMode().then((function(mode){return mode.setupMode(razorDefaults)}))}))},3348:function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var VimStatusBar=function(){function VimStatusBar(node,editor){var _this=this,sanitizer=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;_classCallCheck(this,VimStatusBar),this.closeInput=function(){_this.removeInputListeners(),_this.input=null,_this.setSec(""),_this.editor&&_this.editor.focus()},this.clear=function(){_this.setInnerHtml_(_this.node,"")},this.inputKeyUp=function(e){var options=_this.input.options;options&&options.onKeyUp&&options.onKeyUp(e,e.target.value,_this.closeInput)},this.inputBlur=function(){_this.input.options.closeOnBlur&&_this.closeInput()},this.inputKeyDown=function(e){var _this$input=_this.input,options=_this$input.options,callback=_this$input.callback;options&&options.onKeyDown&&options.onKeyDown(e,e.target.value,_this.closeInput)||((27===e.keyCode||options&&!1!==options.closeOnEnter&&13==e.keyCode)&&(_this.input.node.blur(),e.stopPropagation(),_this.closeInput()),13===e.keyCode&&callback&&(e.stopPropagation(),e.preventDefault(),callback(e.target.value)))},this.node=node,this.modeInfoNode=document.createElement("span"),this.secInfoNode=document.createElement("span"),this.notifNode=document.createElement("span"),this.notifNode.className="vim-notification",this.keyInfoNode=document.createElement("span"),this.keyInfoNode.setAttribute("style","float: right"),this.node.appendChild(this.modeInfoNode),this.node.appendChild(this.secInfoNode),this.node.appendChild(this.notifNode),this.node.appendChild(this.keyInfoNode),this.toggleVisibility(!1),this.editor=editor,this.sanitizer=sanitizer}var Constructor,protoProps,staticProps;return Constructor=VimStatusBar,(protoProps=[{key:"setMode",value:function(ev){"visual"!==ev.mode||"linewise"!==ev.subMode?this.setText("--".concat(ev.mode.toUpperCase(),"--")):this.setText("--VISUAL LINE--")}},{key:"setKeyBuffer",value:function(key){this.keyInfoNode.textContent=key}},{key:"setSec",value:function(text,callback,options){if(this.notifNode.textContent="",void 0!==text){this.setInnerHtml_(this.secInfoNode,text);var input=this.secInfoNode.querySelector("input");return input&&(input.focus(),this.input={callback:callback,options:options,node:input},options&&(options.selectValueOnOpen&&input.select(),options.value&&(input.value=options.value)),this.addInputListeners()),this.closeInput}}},{key:"setText",value:function(text){this.modeInfoNode.textContent=text}},{key:"toggleVisibility",value:function(toggle){this.node.style.display=toggle?"block":"none",this.input&&this.removeInputListeners(),clearInterval(this.notifTimeout)}},{key:"addInputListeners",value:function(){var node=this.input.node;node.addEventListener("keyup",this.inputKeyUp),node.addEventListener("keydown",this.inputKeyDown),node.addEventListener("input",this.inputKeyInput),node.addEventListener("blur",this.inputBlur)}},{key:"removeInputListeners",value:function(){if(this.input&&this.input.node){var node=this.input.node;node.removeEventListener("keyup",this.inputKeyUp),node.removeEventListener("keydown",this.inputKeyDown),node.removeEventListener("input",this.inputKeyInput),node.removeEventListener("blur",this.inputBlur)}}},{key:"showNotification",value:function(text){var _this2=this,sp=document.createElement("span");this.setInnerHtml_(sp,text),this.notifNode.textContent=sp.textContent,this.notifTimeout=setTimeout((function(){_this2.notifNode.textContent=""}),5e3)}},{key:"setInnerHtml_",value:function(element,htmlContents){if(this.sanitizer){for(;element.children.length;)element.removeChild(element.children[0]);element.appendChild(this.sanitizer(htmlContents))}else element.innerHTML=htmlContents}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),VimStatusBar}();exports.default=VimStatusBar},3349:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return _editor.default}}),Object.defineProperty(exports,"MonacoDiffEditor",{enumerable:!0,get:function(){return _diff.default}});var _editor=_interopRequireDefault(__webpack_require__(3350)),_diff=_interopRequireDefault(__webpack_require__(3353));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}},3350:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var monaco=function(obj){if(obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache();if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if(Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(__webpack_require__(2162)),_propTypes=_interopRequireDefault(__webpack_require__(2603)),_react=_interopRequireDefault(__webpack_require__(0)),_utils=__webpack_require__(2604);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var cache=new WeakMap;return _getRequireWildcardCache=function(){return cache},cache}function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}function _possibleConstructorReturn(self,call){return!call||"object"!==_typeof(call)&&"function"!=typeof call?_assertThisInitialized(self):call}function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var MonacoEditor=function(_React$Component){!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_setPrototypeOf(subClass,superClass)}(MonacoEditor,_React$Component);var Derived,Constructor,protoProps,staticProps,_super=(Derived=MonacoEditor,function(){var result,Super=_getPrototypeOf(Derived);if(_isNativeReflectConstruct()){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return _possibleConstructorReturn(this,result)});function MonacoEditor(props){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,MonacoEditor),_defineProperty(_assertThisInitialized(_this=_super.call(this,props)),"assignRef",(function(component){_this.containerElement=component})),_this.containerElement=void 0,_this}return Constructor=MonacoEditor,(protoProps=[{key:"componentDidMount",value:function(){this.initMonaco()}},{key:"componentDidUpdate",value:function(prevProps){var _this$props=this.props,value=_this$props.value,language=_this$props.language,theme=_this$props.theme,height=_this$props.height,options=_this$props.options,width=_this$props.width,editor=this.editor,model=editor.getModel();null!=this.props.value&&this.props.value!==model.getValue()&&(this.__prevent_trigger_change_event=!0,this.editor.pushUndoStop(),model.pushEditOperations([],[{range:model.getFullModelRange(),text:value}]),this.editor.pushUndoStop(),this.__prevent_trigger_change_event=!1),prevProps.language!==language&&monaco.editor.setModelLanguage(model,language),prevProps.theme!==theme&&monaco.editor.setTheme(theme),!editor||width===prevProps.width&&height===prevProps.height||editor.layout(),prevProps.options!==options&&editor.updateOptions(options)}},{key:"componentWillUnmount",value:function(){this.destroyMonaco()}},{key:"destroyMonaco",value:function(){if(this.editor){this.editor.dispose();var model=this.editor.getModel();model&&model.dispose()}this._subscription&&this._subscription.dispose()}},{key:"initMonaco",value:function(){var value=null!=this.props.value?this.props.value:this.props.defaultValue,_this$props2=this.props,language=_this$props2.language,theme=_this$props2.theme,options=_this$props2.options,overrideServices=_this$props2.overrideServices;this.containerElement&&(Object.assign(options,this.editorWillMount()),this.editor=monaco.editor.create(this.containerElement,function(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach((function(key){_defineProperty(target,key,source[key])})):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach((function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}))}return target}({value:value,language:language},options,{},theme?{theme:theme}:{}),overrideServices),this.editorDidMount(this.editor))}},{key:"editorWillMount",value:function(){var editorWillMount=this.props.editorWillMount;return editorWillMount(monaco)||{}}},{key:"editorDidMount",value:function(editor){var _this2=this;this.props.editorDidMount(editor,monaco),this._subscription=editor.onDidChangeModelContent((function(event){_this2.__prevent_trigger_change_event||_this2.props.onChange(editor.getValue(),event)}))}},{key:"render",value:function(){var _this$props3=this.props,width=_this$props3.width,height=_this$props3.height,style={width:(0,_utils.processSize)(width),height:(0,_utils.processSize)(height)};return _react.default.createElement("div",{ref:this.assignRef,style:style,className:"react-monaco-editor-container"})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),MonacoEditor}(_react.default.Component);MonacoEditor.propTypes={width:_propTypes.default.oneOfType([_propTypes.default.string,_propTypes.default.number]),height:_propTypes.default.oneOfType([_propTypes.default.string,_propTypes.default.number]),value:_propTypes.default.string,defaultValue:_propTypes.default.string,language:_propTypes.default.string,theme:_propTypes.default.string,options:_propTypes.default.object,overrideServices:_propTypes.default.object,editorDidMount:_propTypes.default.func,editorWillMount:_propTypes.default.func,onChange:_propTypes.default.func},MonacoEditor.defaultProps={width:"100%",height:"100%",value:null,defaultValue:"",language:"javascript",theme:null,options:{},overrideServices:{},editorDidMount:_utils.noop,editorWillMount:_utils.noop,onChange:_utils.noop};var _default=MonacoEditor;exports.default=_default},3351:function(module,exports,__webpack_require__){"use strict";var ReactPropTypesSecret=__webpack_require__(3352);function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction,module.exports=function(){function shim(props,propName,componentName,location,propFullName,secret){if(secret!==ReactPropTypesSecret){var err=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw err.name="Invariant Violation",err}}function getShim(){return shim}shim.isRequired=shim;var ReactPropTypes={array:shim,bool:shim,func:shim,number:shim,object:shim,string:shim,symbol:shim,any:shim,arrayOf:getShim,element:shim,elementType:shim,instanceOf:getShim,node:shim,objectOf:getShim,oneOf:getShim,oneOfType:getShim,shape:getShim,exact:getShim,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return ReactPropTypes.PropTypes=ReactPropTypes,ReactPropTypes}},3352:function(module,exports,__webpack_require__){"use strict";module.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},3353:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var monaco=function(obj){if(obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache();if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if(Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(__webpack_require__(2162)),_propTypes=_interopRequireDefault(__webpack_require__(2603)),_react=_interopRequireDefault(__webpack_require__(0)),_utils=__webpack_require__(2604);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var cache=new WeakMap;return _getRequireWildcardCache=function(){return cache},cache}function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}function _possibleConstructorReturn(self,call){return!call||"object"!==_typeof(call)&&"function"!=typeof call?_assertThisInitialized(self):call}function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var MonacoDiffEditor=function(_React$Component){!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_setPrototypeOf(subClass,superClass)}(MonacoDiffEditor,_React$Component);var Derived,Constructor,protoProps,staticProps,_super=(Derived=MonacoDiffEditor,function(){var result,Super=_getPrototypeOf(Derived);if(_isNativeReflectConstruct()){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return _possibleConstructorReturn(this,result)});function MonacoDiffEditor(props){var _this;return function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,MonacoDiffEditor),_defineProperty(_assertThisInitialized(_this=_super.call(this,props)),"assignRef",(function(component){_this.containerElement=component})),_this.containerElement=void 0,_this}return Constructor=MonacoDiffEditor,(protoProps=[{key:"componentDidMount",value:function(){this.initMonaco()}},{key:"componentDidUpdate",value:function(prevProps){var _this$props=this.props,language=_this$props.language,theme=_this$props.theme,height=_this$props.height,options=_this$props.options,width=_this$props.width,_this$editor$getModel=this.editor.getModel(),original=_this$editor$getModel.original,modified=_this$editor$getModel.modified;this.props.original!==original.getValue()&&original.setValue(this.props.original),null!=this.props.value&&this.props.value!==modified.getValue()&&(this.__prevent_trigger_change_event=!0,this.editor.modifiedEditor.pushUndoStop(),modified.pushEditOperations([],[{range:modified.getFullModelRange(),text:this.props.value}]),this.editor.modifiedEditor.pushUndoStop(),this.__prevent_trigger_change_event=!1),prevProps.language!==language&&(monaco.editor.setModelLanguage(original,language),monaco.editor.setModelLanguage(modified,language)),prevProps.theme!==theme&&monaco.editor.setTheme(theme),!this.editor||width===prevProps.width&&height===prevProps.height||this.editor.layout(),prevProps.options!==options&&this.editor.updateOptions(options)}},{key:"componentWillUnmount",value:function(){this.destroyMonaco()}},{key:"editorWillMount",value:function(){var editorWillMount=this.props.editorWillMount;return editorWillMount(monaco)||{}}},{key:"editorDidMount",value:function(editor){var _this2=this;this.props.editorDidMount(editor,monaco);var modified=editor.getModel().modified;this._subscription=modified.onDidChangeContent((function(event){_this2.__prevent_trigger_change_event||_this2.props.onChange(modified.getValue(),event)}))}},{key:"initModels",value:function(value,original){var language=this.props.language,originalModel=monaco.editor.createModel(original,language),modifiedModel=monaco.editor.createModel(value,language);this.editor.setModel({original:originalModel,modified:modifiedModel})}},{key:"initMonaco",value:function(){var value=null!=this.props.value?this.props.value:this.props.defaultValue,_this$props2=this.props,original=_this$props2.original,theme=_this$props2.theme,options=_this$props2.options,overrideServices=_this$props2.overrideServices;this.containerElement&&(this.editorWillMount(),this.editor=monaco.editor.createDiffEditor(this.containerElement,function(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach((function(key){_defineProperty(target,key,source[key])})):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach((function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}))}return target}({},options,{},theme?{theme:theme}:{}),overrideServices),this.initModels(value,original),this.editorDidMount(this.editor))}},{key:"destroyMonaco",value:function(){if(this.editor){this.editor.dispose();var _this$editor$getModel2=this.editor.getModel(),original=_this$editor$getModel2.original,modified=_this$editor$getModel2.modified;original&&original.dispose(),modified&&modified.dispose()}this._subscription&&this._subscription.dispose()}},{key:"render",value:function(){var _this$props3=this.props,width=_this$props3.width,height=_this$props3.height,style={width:(0,_utils.processSize)(width),height:(0,_utils.processSize)(height)};return _react.default.createElement("div",{ref:this.assignRef,style:style,className:"react-monaco-editor-container"})}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),MonacoDiffEditor}(_react.default.Component);MonacoDiffEditor.propTypes={width:_propTypes.default.oneOfType([_propTypes.default.string,_propTypes.default.number]),height:_propTypes.default.oneOfType([_propTypes.default.string,_propTypes.default.number]),original:_propTypes.default.string,value:_propTypes.default.string,defaultValue:_propTypes.default.string,language:_propTypes.default.string,theme:_propTypes.default.string,options:_propTypes.default.object,overrideServices:_propTypes.default.object,editorDidMount:_propTypes.default.func,editorWillMount:_propTypes.default.func,onChange:_propTypes.default.func},MonacoDiffEditor.defaultProps={width:"100%",height:"100%",original:null,value:null,defaultValue:"",language:"javascript",theme:null,options:{},overrideServices:{},editorDidMount:_utils.noop,editorWillMount:_utils.noop,onChange:_utils.noop};var _default=MonacoDiffEditor;exports.default=_default},3364:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__(2162);var _contribution=__webpack_require__(2110);Object(_contribution.a)({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:function(){return __webpack_require__.e(15).then(__webpack_require__.bind(null,3373))}}),Object(_contribution.a)({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:function(){return __webpack_require__.e(16).then(__webpack_require__.bind(null,3374))}}),Object(_contribution.a)({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:function(){return __webpack_require__.e(17).then(__webpack_require__.bind(null,3375))}}),Object(_contribution.a)({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:function(){return __webpack_require__.e(18).then(__webpack_require__.bind(null,3376))}}),Object(_contribution.a)({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:function(){return __webpack_require__.e(19).then(__webpack_require__.bind(null,3377))}}),Object(_contribution.a)({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:function(){return __webpack_require__.e(20).then(__webpack_require__.bind(null,3378))}}),Object(_contribution.a)({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:function(){return __webpack_require__.e(21).then(__webpack_require__.bind(null,3379))}}),Object(_contribution.a)({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:function(){return __webpack_require__.e(1).then(__webpack_require__.bind(null,3380))}}),Object(_contribution.a)({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:function(){return __webpack_require__.e(1).then(__webpack_require__.bind(null,3380))}}),Object(_contribution.a)({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:function(){return __webpack_require__.e(22).then(__webpack_require__.bind(null,3381))}}),Object(_contribution.a)({id:"csp",extensions:[],aliases:["CSP","csp"],loader:function(){return __webpack_require__.e(23).then(__webpack_require__.bind(null,3382))}}),Object(_contribution.a)({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:function(){return __webpack_require__.e(24).then(__webpack_require__.bind(null,3383))}}),Object(_contribution.a)({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:function(){return __webpack_require__.e(25).then(__webpack_require__.bind(null,3384))}}),Object(_contribution.a)({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:function(){return __webpack_require__.e(26).then(__webpack_require__.bind(null,3385))}}),Object(_contribution.a)({id:"go",extensions:[".go"],aliases:["Go"],loader:function(){return __webpack_require__.e(27).then(__webpack_require__.bind(null,3386))}}),Object(_contribution.a)({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:function(){return __webpack_require__.e(28).then(__webpack_require__.bind(null,3387))}}),Object(_contribution.a)({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars"],mimetypes:["text/x-handlebars-template"],loader:function(){return __webpack_require__.e(29).then(__webpack_require__.bind(null,3388))}}),Object(_contribution.a)({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:function(){return __webpack_require__.e(30).then(__webpack_require__.bind(null,3389))}}),Object(_contribution.a)({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:function(){return __webpack_require__.e(31).then(__webpack_require__.bind(null,3390))}}),Object(_contribution.a)({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:function(){return __webpack_require__.e(32).then(__webpack_require__.bind(null,3391))}});__webpack_require__(2422);Object(_contribution.a)({id:"kotlin",extensions:[".kt"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:function(){return __webpack_require__.e(33).then(__webpack_require__.bind(null,3392))}}),Object(_contribution.a)({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:function(){return __webpack_require__.e(34).then(__webpack_require__.bind(null,3393))}}),Object(_contribution.a)({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:function(){return __webpack_require__.e(35).then(__webpack_require__.bind(null,3394))}}),Object(_contribution.a)({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:function(){return __webpack_require__.e(36).then(__webpack_require__.bind(null,3395))}}),Object(_contribution.a)({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:function(){return __webpack_require__.e(37).then(__webpack_require__.bind(null,3396))}}),Object(_contribution.a)({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:function(){return __webpack_require__.e(38).then(__webpack_require__.bind(null,3397))}}),Object(_contribution.a)({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:function(){return __webpack_require__.e(39).then(__webpack_require__.bind(null,3398))}}),Object(_contribution.a)({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:function(){return __webpack_require__.e(40).then(__webpack_require__.bind(null,3399))}}),Object(_contribution.a)({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:function(){return __webpack_require__.e(41).then(__webpack_require__.bind(null,3400))}}),Object(_contribution.a)({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:function(){return __webpack_require__.e(42).then(__webpack_require__.bind(null,3401))}}),Object(_contribution.a)({id:"perl",extensions:[".pl"],aliases:["Perl","pl"],loader:function(){return __webpack_require__.e(43).then(__webpack_require__.bind(null,3402))}}),Object(_contribution.a)({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:function(){return __webpack_require__.e(44).then(__webpack_require__.bind(null,3403))}}),Object(_contribution.a)({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:function(){return __webpack_require__.e(45).then(__webpack_require__.bind(null,3404))}}),Object(_contribution.a)({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:function(){return __webpack_require__.e(46).then(__webpack_require__.bind(null,3405))}}),Object(_contribution.a)({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:function(){return __webpack_require__.e(47).then(__webpack_require__.bind(null,3406))}}),Object(_contribution.a)({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:function(){return __webpack_require__.e(48).then(__webpack_require__.bind(null,3407))}}),Object(_contribution.a)({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:function(){return __webpack_require__.e(49).then(__webpack_require__.bind(null,3408))}}),Object(_contribution.a)({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:function(){return __webpack_require__.e(50).then(__webpack_require__.bind(null,3409))}}),Object(_contribution.a)({id:"r",extensions:[".r",".rhistory",".rprofile",".rt"],aliases:["R","r"],loader:function(){return __webpack_require__.e(51).then(__webpack_require__.bind(null,3410))}}),Object(_contribution.a)({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:function(){return __webpack_require__.e(52).then(__webpack_require__.bind(null,3411))}}),Object(_contribution.a)({id:"redis",extensions:[".redis"],aliases:["redis"],loader:function(){return __webpack_require__.e(53).then(__webpack_require__.bind(null,3412))}}),Object(_contribution.a)({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:function(){return __webpack_require__.e(54).then(__webpack_require__.bind(null,3413))}}),Object(_contribution.a)({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:function(){return __webpack_require__.e(55).then(__webpack_require__.bind(null,3414))}}),Object(_contribution.a)({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile"],aliases:["Ruby","rb"],loader:function(){return __webpack_require__.e(56).then(__webpack_require__.bind(null,3415))}}),Object(_contribution.a)({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:function(){return __webpack_require__.e(57).then(__webpack_require__.bind(null,3416))}}),Object(_contribution.a)({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:function(){return __webpack_require__.e(58).then(__webpack_require__.bind(null,3417))}}),Object(_contribution.a)({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:function(){return __webpack_require__.e(59).then(__webpack_require__.bind(null,3418))}}),Object(_contribution.a)({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:function(){return __webpack_require__.e(60).then(__webpack_require__.bind(null,3419))}}),Object(_contribution.a)({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:function(){return __webpack_require__.e(61).then(__webpack_require__.bind(null,3420))}}),Object(_contribution.a)({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:function(){return __webpack_require__.e(62).then(__webpack_require__.bind(null,3421))}}),Object(_contribution.a)({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:function(){return __webpack_require__.e(63).then(__webpack_require__.bind(null,3422))}}),Object(_contribution.a)({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:function(){return __webpack_require__.e(64).then(__webpack_require__.bind(null,3423))}}),Object(_contribution.a)({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib"],aliases:["StructuredText","scl","stl"],loader:function(){return __webpack_require__.e(65).then(__webpack_require__.bind(null,3424))}}),Object(_contribution.a)({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:function(){return __webpack_require__.e(66).then(__webpack_require__.bind(null,3425))}}),Object(_contribution.a)({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:function(){return __webpack_require__.e(67).then(__webpack_require__.bind(null,3426))}}),Object(_contribution.a)({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:function(){return __webpack_require__.e(68).then(__webpack_require__.bind(null,3427))}});__webpack_require__(2421);Object(_contribution.a)({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:function(){return __webpack_require__.e(70).then(__webpack_require__.bind(null,3428))}}),Object(_contribution.a)({id:"xml",extensions:[".xml",".dtd",".ascx",".csproj",".config",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:function(){return __webpack_require__.e(71).then(__webpack_require__.bind(null,3429))}}),Object(_contribution.a)({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml"],loader:function(){return __webpack_require__.e(72).then(__webpack_require__.bind(null,3430))}})},3372:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__(2252),__webpack_require__(2313),__webpack_require__(2610),__webpack_require__(2600),__webpack_require__(2386),__webpack_require__(2446),__webpack_require__(2417),__webpack_require__(2392),__webpack_require__(2393),__webpack_require__(2434),__webpack_require__(2299),__webpack_require__(2438),__webpack_require__(2448),__webpack_require__(2398),__webpack_require__(2441),__webpack_require__(2314),__webpack_require__(2429),__webpack_require__(2400),__webpack_require__(2435),__webpack_require__(2318),__webpack_require__(2308),__webpack_require__(2316),__webpack_require__(2430),__webpack_require__(2445),__webpack_require__(2432),__webpack_require__(2444),__webpack_require__(2411),__webpack_require__(2433),__webpack_require__(2450),__webpack_require__(2442),__webpack_require__(2251),__webpack_require__(2426);var extendStatics,nls=__webpack_require__(2108),editorExtensions=__webpack_require__(2112),stopwatch=__webpack_require__(2388),__extends=(extendStatics=function(d,b){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])})(d,b)},function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}),tokenization_ForceRetokenizeAction=function(_super){function ForceRetokenizeAction(){return _super.call(this,{id:"editor.action.forceRetokenize",label:nls.a("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})||this}return __extends(ForceRetokenizeAction,_super),ForceRetokenizeAction.prototype.run=function(accessor,editor){if(editor.hasModel()){var model=editor.getModel();model.resetTokenization();var sw=new stopwatch.a(!0);model.forceTokenization(model.getLineCount()),sw.stop(),console.log("tokenization took "+sw.elapsed())}},ForceRetokenizeAction}(editorExtensions.b);Object(editorExtensions.f)(tokenization_ForceRetokenizeAction);__webpack_require__(2289),__webpack_require__(2418),__webpack_require__(2312),__webpack_require__(2419),__webpack_require__(2177)}}]);
  //# sourceMappingURL=vendors~node-playground-editor.js.map