diff --git a/pr-preview/pr-1705/11.js b/pr-preview/pr-1705/11.js deleted file mode 100644 index 376834ef06..0000000000 --- a/pr-preview/pr-1705/11.js +++ /dev/null @@ -1,98 +0,0 @@ -"use strict";(globalThis.webpackChunkdocs_app=globalThis.webpackChunkdocs_app||[]).push([[11],{18011:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Shared:()=>Shared,default:()=>__WEBPACK_DEFAULT_EXPORT__}) -var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(14041),codemirror__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(11448),codemirror__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(codemirror__WEBPACK_IMPORTED_MODULE_1__) -__webpack_require__(28573),__webpack_require__(62977),__webpack_require__(61421),__webpack_require__(66493),__webpack_require__(47821),__webpack_require__(24353) -class Controlled extends react__WEBPACK_IMPORTED_MODULE_0__.Component{constructor(props){super(props),this.appliedNext=void 0,this.deferred=void 0,this.editor=void 0,this.emulating=void 0,this.hydrated=void 0,this.initCb=void 0,this.mirror=void 0,this.mounted=void 0,this.ref=void 0,this.shared=void 0,this.appliedNext=!1,this.deferred=null,this.emulating=!1,this.hydrated=!1,this.initCb=()=>{this.props.editorDidConfigure&&this.props.editorDidConfigure(this.editor)},this.mounted=!1}hydrate(props){const _options=props&&props.options?props.options:{},userDefinedOptions=Object.assign({},codemirror__WEBPACK_IMPORTED_MODULE_1___default().defaults,this.editor.options,_options) -Object.keys(userDefinedOptions).some((key=>this.editor.getOption(key)!==userDefinedOptions[key]))&&Object.keys(userDefinedOptions).forEach((key=>{_options.hasOwnProperty(key)&&this.editor.getOption(key)!==userDefinedOptions[key]&&(this.editor.setOption(key,userDefinedOptions[key]),this.mirror.setOption(key,userDefinedOptions[key]))})),this.hydrated||(this.deferred?this.resolveChange(props.value):this.initChange(props.value||"")),this.hydrated=!0}initChange(value){this.emulating=!0 -const doc=this.editor.getDoc(),lastLine=doc.lastLine(),lastChar=doc.getLine(doc.lastLine()).length -doc.replaceRange(value||"",{line:0,ch:0},{line:lastLine,ch:lastChar}),this.mirror.setValue(value),doc.clearHistory(),this.mirror.clearHistory(),this.emulating=!1}resolveChange(value){this.emulating=!0 -const doc=this.editor.getDoc() -if("undo"===this.deferred.origin?doc.undo():"redo"===this.deferred.origin?doc.redo():doc.replaceRange(this.deferred.text,this.deferred.from,this.deferred.to,this.deferred.origin),value&&value!==doc.getValue()){const cursor=doc.getCursor() -doc.setValue(value),doc.setCursor(cursor)}this.emulating=!1,this.deferred=null}mirrorChange(deferred){const doc=this.editor.getDoc() -return"undo"===deferred.origin?(doc.setHistory(this.mirror.getHistory()),this.mirror.undo()):"redo"===deferred.origin?(doc.setHistory(this.mirror.getHistory()),this.mirror.redo()):this.mirror.replaceRange(deferred.text,deferred.from,deferred.to,deferred.origin),this.mirror.getValue()}componentDidMount(){this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&codemirror__WEBPACK_IMPORTED_MODULE_1___default().defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=codemirror__WEBPACK_IMPORTED_MODULE_1___default()(this.ref,this.props.options),this.shared=new Shared(this.editor,this.props),this.mirror=codemirror__WEBPACK_IMPORTED_MODULE_1___default()((()=>{}),this.props.options),this.editor.on("electricInput",(()=>{this.mirror.setHistory(this.editor.getDoc().getHistory())})),this.editor.on("cursorActivity",(()=>{this.mirror.setCursor(this.editor.getDoc().getCursor())})),this.editor.on("beforeChange",((_cm,data)=>{if(this.emulating)return -data.cancel(),this.deferred=data -const phantomChange=this.mirrorChange(this.deferred) -this.props.onBeforeChange&&this.props.onBeforeChange(this.editor,this.deferred,phantomChange)})),this.editor.on("change",((_cm,data)=>{this.mounted&&this.props.onChange&&this.props.onChange(this.editor,data,this.editor.getValue())})),this.hydrate(this.props),this.shared.apply(this.props),this.mounted=!0,this.shared.wire(this.props),this.editor.getOption("autofocus")&&this.editor.focus(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb)}componentDidUpdate(prevProps){const preserved={cursor:void 0} -this.props.value!==prevProps.value&&(this.hydrated=!1),this.props.autoCursor||void 0===this.props.autoCursor||(preserved.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.appliedNext||(this.shared.applyNext(prevProps,this.props,preserved),this.appliedNext=!0),this.shared.applyUserDefined(prevProps,preserved)}componentWillUnmount(){this.props.editorWillUnmount&&this.props.editorWillUnmount(codemirror__WEBPACK_IMPORTED_MODULE_1___default())}shouldComponentUpdate(){return!0}render(){const className=this.props.className?`react-codemirror2 ${this.props.className}`:"react-codemirror2" -return react__WEBPACK_IMPORTED_MODULE_0__.createElement("div",{className,ref:self=>this.ref=self})}}Controlled.displayName="Controlled" -class Helper{static equals(x,y){const ok=Object.keys,tx=typeof x -return x&&y&&"object"===tx&&tx===typeof y?ok(x).length===ok(y).length&&ok(x).every((key=>this.equals(x[key],y[key]))):x===y}}class Shared{constructor(editor,props){this.editor=void 0,this.props=void 0,this.editor=editor,this.props=props}delegateCursor(position,scroll,focus){const doc=this.editor.getDoc() -focus&&this.editor.focus(),scroll?doc.setCursor(position):doc.setCursor(position,void 0,{scroll:!1})}delegateScroll(coordinates){this.editor.scrollTo(coordinates.x,coordinates.y)}delegateSelection(ranges,focus){this.editor.getDoc().setSelections(ranges),focus&&this.editor.focus()}apply(props){props&&props.selection&&props.selection.ranges&&this.delegateSelection(props.selection.ranges,props.selection.focus||!1),props&&props.cursor&&this.delegateCursor(props.cursor,props.autoScroll||!1,this.editor.getOption("autofocus")||!1),props&&props.scroll&&this.delegateScroll(props.scroll)}applyNext(props,next,preserved){props&&props.selection&&props.selection.ranges&&next&&next.selection&&next.selection.ranges&&!Helper.equals(props.selection.ranges,next.selection.ranges)&&this.delegateSelection(next.selection.ranges,next.selection.focus||!1),props&&props.cursor&&next&&next.cursor&&!Helper.equals(props.cursor,next.cursor)&&this.delegateCursor(preserved.cursor||next.cursor,next.autoScroll||!1,next.autoCursor||!1),props&&props.scroll&&next&&next.scroll&&!Helper.equals(props.scroll,next.scroll)&&this.delegateScroll(next.scroll)}applyUserDefined(props,preserved){preserved&&preserved.cursor&&this.delegateCursor(preserved.cursor,props.autoScroll||!1,this.editor.getOption("autofocus")||!1)}wire(props){Object.keys(props||{}).filter((p=>/^on/.test(p))).forEach((prop=>{switch(prop){case"onBlur":this.editor.on("blur",((_cm,event)=>{var _this$props$onBlur,_this$props -null===(_this$props$onBlur=(_this$props=this.props).onBlur)||void 0===_this$props$onBlur||_this$props$onBlur.call(_this$props,this.editor,event)})) -break -case"onContextMenu":this.editor.on("contextmenu",((_cm,event)=>{var _this$props$onContext,_this$props2 -null===(_this$props$onContext=(_this$props2=this.props).onContextMenu)||void 0===_this$props$onContext||_this$props$onContext.call(_this$props2,this.editor,event)})) -break -case"onCopy":this.editor.on("copy",((_cm,event)=>{var _this$props$onCopy,_this$props3 -null===(_this$props$onCopy=(_this$props3=this.props).onCopy)||void 0===_this$props$onCopy||_this$props$onCopy.call(_this$props3,this.editor,event)})) -break -case"onCursor":this.editor.on("cursorActivity",(()=>{var _this$props$onCursor,_this$props4 -null===(_this$props$onCursor=(_this$props4=this.props).onCursor)||void 0===_this$props$onCursor||_this$props$onCursor.call(_this$props4,this.editor,this.editor.getDoc().getCursor())})) -break -case"onCursorActivity":this.editor.on("cursorActivity",(()=>{var _this$props$onCursorA,_this$props5 -null===(_this$props$onCursorA=(_this$props5=this.props).onCursorActivity)||void 0===_this$props$onCursorA||_this$props$onCursorA.call(_this$props5,this.editor)})) -break -case"onCut":this.editor.on("cut",((_cm,event)=>{var _this$props$onCut,_this$props6 -null===(_this$props$onCut=(_this$props6=this.props).onCut)||void 0===_this$props$onCut||_this$props$onCut.call(_this$props6,this.editor,event)})) -break -case"onDblClick":this.editor.on("dblclick",((_cm,event)=>{var _this$props$onDblClic,_this$props7 -null===(_this$props$onDblClic=(_this$props7=this.props).onDblClick)||void 0===_this$props$onDblClic||_this$props$onDblClic.call(_this$props7,this.editor,event)})) -break -case"onDragEnter":this.editor.on("dragenter",((_cm,event)=>{var _this$props$onDragEnt,_this$props8 -null===(_this$props$onDragEnt=(_this$props8=this.props).onDragEnter)||void 0===_this$props$onDragEnt||_this$props$onDragEnt.call(_this$props8,this.editor,event)})) -break -case"onDragLeave":this.editor.on("dragleave",((_cm,event)=>{var _this$props$onDragLea,_this$props9 -null===(_this$props$onDragLea=(_this$props9=this.props).onDragLeave)||void 0===_this$props$onDragLea||_this$props$onDragLea.call(_this$props9,this.editor,event)})) -break -case"onDragOver":this.editor.on("dragover",((_cm,event)=>{var _this$props$onDragOve,_this$props10 -null===(_this$props$onDragOve=(_this$props10=this.props).onDragOver)||void 0===_this$props$onDragOve||_this$props$onDragOve.call(_this$props10,this.editor,event)})) -break -case"onDragStart":this.editor.on("dragstart",((_cm,event)=>{var _this$props$onDragSta,_this$props11 -null===(_this$props$onDragSta=(_this$props11=this.props).onDragStart)||void 0===_this$props$onDragSta||_this$props$onDragSta.call(_this$props11,this.editor,event)})) -break -case"onDrop":this.editor.on("drop",((_cm,event)=>{var _this$props$onDrop,_this$props12 -null===(_this$props$onDrop=(_this$props12=this.props).onDrop)||void 0===_this$props$onDrop||_this$props$onDrop.call(_this$props12,this.editor,event)})) -break -case"onFocus":this.editor.on("focus",((_cm,event)=>{var _this$props$onFocus,_this$props13 -null===(_this$props$onFocus=(_this$props13=this.props).onFocus)||void 0===_this$props$onFocus||_this$props$onFocus.call(_this$props13,this.editor,event)})) -break -case"onGutterClick":this.editor.on("gutterClick",((_cm,lineNumber,gutter,event)=>{var _this$props$onGutterC,_this$props14 -null===(_this$props$onGutterC=(_this$props14=this.props).onGutterClick)||void 0===_this$props$onGutterC||_this$props$onGutterC.call(_this$props14,this.editor,lineNumber,gutter,event)})) -break -case"onInputRead":this.editor.on("inputRead",((_cm,EditorChangeEvent)=>{var _this$props$onInputRe,_this$props15 -null===(_this$props$onInputRe=(_this$props15=this.props).onInputRead)||void 0===_this$props$onInputRe||_this$props$onInputRe.call(_this$props15,this.editor,EditorChangeEvent)})) -break -case"onKeyDown":this.editor.on("keydown",((_cm,event)=>{var _this$props$onKeyDown,_this$props16 -null===(_this$props$onKeyDown=(_this$props16=this.props).onKeyDown)||void 0===_this$props$onKeyDown||_this$props$onKeyDown.call(_this$props16,this.editor,event)})) -break -case"onKeyHandled":this.editor.on("keyHandled",((_cm,key,event)=>{var _this$props$onKeyHand,_this$props17 -null===(_this$props$onKeyHand=(_this$props17=this.props).onKeyHandled)||void 0===_this$props$onKeyHand||_this$props$onKeyHand.call(_this$props17,this.editor,key,event)})) -break -case"onKeyPress":this.editor.on("keypress",((_cm,event)=>{var _this$props$onKeyPres,_this$props18 -null===(_this$props$onKeyPres=(_this$props18=this.props).onKeyPress)||void 0===_this$props$onKeyPres||_this$props$onKeyPres.call(_this$props18,this.editor,event)})) -break -case"onKeyUp":this.editor.on("keyup",((_cm,event)=>{var _this$props$onKeyUp,_this$props19 -null===(_this$props$onKeyUp=(_this$props19=this.props).onKeyUp)||void 0===_this$props$onKeyUp||_this$props$onKeyUp.call(_this$props19,this.editor,event)})) -break -case"onMouseDown":this.editor.on("mousedown",((_cm,event)=>{var _this$props$onMouseDo,_this$props20 -null===(_this$props$onMouseDo=(_this$props20=this.props).onMouseDown)||void 0===_this$props$onMouseDo||_this$props$onMouseDo.call(_this$props20,this.editor,event)})) -break -case"onPaste":this.editor.on("paste",((_cm,event)=>{var _this$props$onPaste,_this$props21 -null===(_this$props$onPaste=(_this$props21=this.props).onPaste)||void 0===_this$props$onPaste||_this$props$onPaste.call(_this$props21,this.editor,event)})) -break -case"onRenderLine":this.editor.on("renderLine",((_cm,line,element)=>{var _this$props$onRenderL,_this$props22 -null===(_this$props$onRenderL=(_this$props22=this.props).onRenderLine)||void 0===_this$props$onRenderL||_this$props$onRenderL.call(_this$props22,this.editor,line,element)})) -break -case"onScroll":this.editor.on("scroll",(_cm=>{var _this$props$onScroll,_this$props23 -null===(_this$props$onScroll=(_this$props23=this.props).onScroll)||void 0===_this$props$onScroll||_this$props$onScroll.call(_this$props23,this.editor,this.editor.getScrollInfo())})) -break -case"onSelection":this.editor.on("beforeSelectionChange",((_cm,data)=>{var _this$props$onSelecti,_this$props24 -null===(_this$props$onSelecti=(_this$props24=this.props).onSelection)||void 0===_this$props$onSelecti||_this$props$onSelecti.call(_this$props24,this.editor,data)})) -break -case"onTouchStart":this.editor.on("touchstart",((_cm,event)=>{var _this$props$onTouchSt,_this$props25 -null===(_this$props$onTouchSt=(_this$props25=this.props).onTouchStart)||void 0===_this$props$onTouchSt||_this$props$onTouchSt.call(_this$props25,this.editor,event)})) -break -case"onUpdate":this.editor.on("update",(_cm=>{var _this$props$onUpdate,_this$props26 -null===(_this$props$onUpdate=(_this$props26=this.props).onUpdate)||void 0===_this$props$onUpdate||_this$props$onUpdate.call(_this$props26,this.editor)})) -break -case"onViewportChange":this.editor.on("viewportChange",((_cm,from,to)=>{var _this$props$onViewpor,_this$props27 -null===(_this$props$onViewpor=(_this$props27=this.props).onViewportChange)||void 0===_this$props$onViewpor||_this$props$onViewpor.call(_this$props27,this.editor,from,to)}))}}))}}const __WEBPACK_DEFAULT_EXPORT__=Controlled}}]) diff --git a/pr-preview/pr-1705/229.js b/pr-preview/pr-1705/229.js deleted file mode 100644 index 47b6aa48fd..0000000000 --- a/pr-preview/pr-1705/229.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict";(globalThis.webpackChunkdocs_app=globalThis.webpackChunkdocs_app||[]).push([[229],{43229:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__}) -var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(14041) -class Controlled extends react__WEBPACK_IMPORTED_MODULE_0__.Component{constructor(props){super(props)}hydrate(){}initChange(){}resolveChange(){}mirrorChange(){}componentDidMount(){}componentDidUpdate(){}componentWillUnmount(){}shouldComponentUpdate(){return!1}render(){return null}}Controlled.displayName="Controlled" -const __WEBPACK_DEFAULT_EXPORT__=Controlled}}]) diff --git a/pr-preview/pr-1705/2834db01b1b1cf9057b1.woff b/pr-preview/pr-1705/2834db01b1b1cf9057b1.woff deleted file mode 100644 index 09ac0e1d06..0000000000 Binary files a/pr-preview/pr-1705/2834db01b1b1cf9057b1.woff and /dev/null differ diff --git a/pr-preview/pr-1705/28b1b00c4cc6321cd85d.jpg b/pr-preview/pr-1705/28b1b00c4cc6321cd85d.jpg deleted file mode 100644 index 7becb24969..0000000000 Binary files a/pr-preview/pr-1705/28b1b00c4cc6321cd85d.jpg and /dev/null differ diff --git a/pr-preview/pr-1705/34ce7a4e390686c8468d.eot b/pr-preview/pr-1705/34ce7a4e390686c8468d.eot deleted file mode 100644 index 4d6f43171c..0000000000 Binary files a/pr-preview/pr-1705/34ce7a4e390686c8468d.eot and /dev/null differ diff --git a/pr-preview/pr-1705/53.js b/pr-preview/pr-1705/53.js deleted file mode 100644 index 453bf29946..0000000000 --- a/pr-preview/pr-1705/53.js +++ /dev/null @@ -1,1613 +0,0 @@ -(globalThis.webpackChunkdocs_app=globalThis.webpackChunkdocs_app||[]).push([[53],{11448:function(module){module.exports=function(){"use strict" -var userAgent=navigator.userAgent,platform=navigator.platform,gecko=/gecko\/\d/i.test(userAgent),ie_upto10=/MSIE \d/.test(userAgent),ie_11up=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent),edge=/Edge\/(\d+)/.exec(userAgent),ie=ie_upto10||ie_11up||edge,ie_version=ie&&(ie_upto10?document.documentMode||6:+(edge||ie_11up)[1]),webkit=!edge&&/WebKit\//.test(userAgent),qtwebkit=webkit&&/Qt\/\d+\.\d+/.test(userAgent),chrome=!edge&&/Chrome\/(\d+)/.exec(userAgent),chrome_version=chrome&&+chrome[1],presto=/Opera\//.test(userAgent),safari=/Apple Computer/.test(navigator.vendor),mac_geMountainLion=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent),phantom=/PhantomJS/.test(userAgent),ios=safari&&(/Mobile\/\w+/.test(userAgent)||navigator.maxTouchPoints>2),android=/Android/.test(userAgent),mobile=ios||android||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent),mac=ios||/Mac/.test(platform),chromeOS=/\bCrOS\b/.test(userAgent),windows=/win/i.test(platform),presto_version=presto&&userAgent.match(/Version\/(\d*\.\d*)/) -presto_version&&(presto_version=Number(presto_version[1])),presto_version&&presto_version>=15&&(presto=!1,webkit=!0) -var flipCtrlCmd=mac&&(qtwebkit||presto&&(null==presto_version||presto_version<12.11)),captureRightClick=gecko||ie&&ie_version>=9 -function classTest(cls){return new RegExp("(^|\\s)"+cls+"(?:$|\\s)\\s*")}var range,rmClass=function(node,cls){var current=node.className,match=classTest(cls).exec(current) -if(match){var after=current.slice(match.index+match[0].length) -node.className=current.slice(0,match.index)+(after?match[1]+after:"")}} -function removeChildren(e){for(var count=e.childNodes.length;count>0;--count)e.removeChild(e.firstChild) -return e}function removeChildrenAndAdd(parent,e){return removeChildren(parent).appendChild(e)}function elt(tag,content,className,style){var e=document.createElement(tag) -if(className&&(e.className=className),style&&(e.style.cssText=style),"string"==typeof content)e.appendChild(document.createTextNode(content)) -else if(content)for(var i=0;i=end)return n+(end-i) -n+=nextTab-i,n+=tabSize-n%tabSize,i=nextTab+1}}ios?selectInput=function(node){node.selectionStart=0,node.selectionEnd=node.value.length}:ie&&(selectInput=function(node){try{node.select()}catch(_e){}}) -var Delayed=function(){this.id=null,this.f=null,this.time=0,this.handler=bind(this.onTimeout,this)} -function indexOf(array,elt){for(var i=0;i=goal)return pos+Math.min(skipped,goal-col) -if(col+=nextTab-pos,pos=nextTab+1,(col+=tabSize-col%tabSize)>=goal)return pos}}var spaceStrs=[""] -function spaceStr(n){for(;spaceStrs.length<=n;)spaceStrs.push(lst(spaceStrs)+" ") -return spaceStrs[n]}function lst(arr){return arr[arr.length-1]}function map(array,f){for(var out=[],i=0;i"€"&&(ch.toUpperCase()!=ch.toLowerCase()||nonASCIISingleCaseWordChar.test(ch))}function isWordChar(ch,helper){return helper?!!(helper.source.indexOf("\\w")>-1&&isWordCharBasic(ch))||helper.test(ch):isWordCharBasic(ch)}function isEmpty(obj){for(var n in obj)if(obj.hasOwnProperty(n)&&obj[n])return!1 -return!0}var extendingChars=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/ -function isExtendingChar(ch){return ch.charCodeAt(0)>=768&&extendingChars.test(ch)}function skipExtendingChars(str,pos,dir){for(;(dir<0?pos>0:posto?-1:1;;){if(from==to)return from -var midF=(from+to)/2,mid=dir<0?Math.ceil(midF):Math.floor(midF) -if(mid==from)return pred(mid)?from:to -pred(mid)?to=mid:from=mid+dir}}function iterateBidiSections(order,from,to,f){if(!order)return f(from,to,"ltr",0) -for(var found=!1,i=0;ifrom||from==to&&part.to==from)&&(f(Math.max(part.from,from),Math.min(part.to,to),1==part.level?"rtl":"ltr",i),found=!0)}found||f(from,to,"ltr")}var bidiOther=null -function getBidiPartAt(order,ch,sticky){var found -bidiOther=null -for(var i=0;ich)return i -cur.to==ch&&(cur.from!=cur.to&&"before"==sticky?found=i:bidiOther=i),cur.from==ch&&(cur.from!=cur.to&&"before"!=sticky?found=i:bidiOther=i)}return null!=found?found:bidiOther}var bidiOrdering=function(){var lowTypes="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",arabicTypes="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111" -function charType(code){return code<=247?lowTypes.charAt(code):1424<=code&&code<=1524?"R":1536<=code&&code<=1785?arabicTypes.charAt(code-1536):1774<=code&&code<=2220?"r":8192<=code&&code<=8203?"w":8204==code?"b":"L"}var bidiRE=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,isNeutral=/[stwN]/,isStrong=/[LRr]/,countsAsLeft=/[Lb1n]/,countsAsNum=/[1n]/ -function BidiSpan(level,from,to){this.level=level,this.from=from,this.to=to}return function(str,direction){var outerType="ltr"==direction?"L":"R" -if(0==str.length||"ltr"==direction&&!bidiRE.test(str))return!1 -for(var len=str.length,types=[],i=0;i-1&&(map[type]=arr.slice(0,index).concat(arr.slice(index+1)))}}}function signal(emitter,type){var handlers=getHandlers(emitter,type) -if(handlers.length)for(var args=Array.prototype.slice.call(arguments,2),i=0;i0}function eventMixin(ctor){ctor.prototype.on=function(type,f){on(this,type,f)},ctor.prototype.off=function(type,f){off(this,type,f)}}function e_preventDefault(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function e_stopPropagation(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function e_defaultPrevented(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function e_stop(e){e_preventDefault(e),e_stopPropagation(e)}function e_target(e){return e.target||e.srcElement}function e_button(e){var b=e.which -return null==b&&(1&e.button?b=1:2&e.button?b=3:4&e.button&&(b=2)),mac&&e.ctrlKey&&1==b&&(b=3),b}var zwspSupported,badBidiRects,dragAndDrop=function(){if(ie&&ie_version<9)return!1 -var div=elt("div") -return"draggable"in div||"dragDrop"in div}() -function zeroWidthElement(measure){if(null==zwspSupported){var test=elt("span","​") -removeChildrenAndAdd(measure,elt("span",[test,document.createTextNode("x")])),0!=measure.firstChild.offsetHeight&&(zwspSupported=test.offsetWidth<=1&&test.offsetHeight>2&&!(ie&&ie_version<8))}var node=zwspSupported?elt("span","​"):elt("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px") -return node.setAttribute("cm-text",""),node}function hasBadBidiRects(measure){if(null!=badBidiRects)return badBidiRects -var txt=removeChildrenAndAdd(measure,document.createTextNode("AخA")),r0=range(txt,0,1).getBoundingClientRect(),r1=range(txt,1,2).getBoundingClientRect() -return removeChildren(measure),!(!r0||r0.left==r0.right)&&(badBidiRects=r1.right-r0.right<3)}var e,splitLinesAuto=3!="\n\nb".split(/\n/).length?function(string){for(var pos=0,result=[],l=string.length;pos<=l;){var nl=string.indexOf("\n",pos);-1==nl&&(nl=string.length) -var line=string.slice(pos,"\r"==string.charAt(nl-1)?nl-1:nl),rt=line.indexOf("\r");-1!=rt?(result.push(line.slice(0,rt)),pos+=rt+1):(result.push(line),pos=nl+1)}return result}:function(string){return string.split(/\r\n?|\n/)},hasSelection=window.getSelection?function(te){try{return te.selectionStart!=te.selectionEnd}catch(e){return!1}}:function(te){var range -try{range=te.ownerDocument.selection.createRange()}catch(e){}return!(!range||range.parentElement()!=te)&&0!=range.compareEndPoints("StartToEnd",range)},hasCopyEvent="oncopy"in(e=elt("div"))||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy),badZoomedRects=null -function hasBadZoomedRects(measure){if(null!=badZoomedRects)return badZoomedRects -var node=removeChildrenAndAdd(measure,elt("span","x")),normal=node.getBoundingClientRect(),fromRange=range(node,0,1).getBoundingClientRect() -return badZoomedRects=Math.abs(normal.left-fromRange.left)>1}var modes={},mimeModes={} -function defineMode(name,mode){arguments.length>2&&(mode.dependencies=Array.prototype.slice.call(arguments,2)),modes[name]=mode}function defineMIME(mime,spec){mimeModes[mime]=spec}function resolveMode(spec){if("string"==typeof spec&&mimeModes.hasOwnProperty(spec))spec=mimeModes[spec] -else if(spec&&"string"==typeof spec.name&&mimeModes.hasOwnProperty(spec.name)){var found=mimeModes[spec.name] -"string"==typeof found&&(found={name:found}),(spec=createObj(found,spec)).name=found.name}else{if("string"==typeof spec&&/^[\w\-]+\/[\w\-]+\+xml$/.test(spec))return resolveMode("application/xml") -if("string"==typeof spec&&/^[\w\-]+\/[\w\-]+\+json$/.test(spec))return resolveMode("application/json")}return"string"==typeof spec?{name:spec}:spec||{name:"null"}}function getMode(options,spec){spec=resolveMode(spec) -var mfactory=modes[spec.name] -if(!mfactory)return getMode(options,"text/plain") -var modeObj=mfactory(options,spec) -if(modeExtensions.hasOwnProperty(spec.name)){var exts=modeExtensions[spec.name] -for(var prop in exts)exts.hasOwnProperty(prop)&&(modeObj.hasOwnProperty(prop)&&(modeObj["_"+prop]=modeObj[prop]),modeObj[prop]=exts[prop])}if(modeObj.name=spec.name,spec.helperType&&(modeObj.helperType=spec.helperType),spec.modeProps)for(var prop$1 in spec.modeProps)modeObj[prop$1]=spec.modeProps[prop$1] -return modeObj}var modeExtensions={} -function extendMode(mode,properties){copyObj(properties,modeExtensions.hasOwnProperty(mode)?modeExtensions[mode]:modeExtensions[mode]={})}function copyState(mode,state){if(!0===state)return state -if(mode.copyState)return mode.copyState(state) -var nstate={} -for(var n in state){var val=state[n] -val instanceof Array&&(val=val.concat([])),nstate[n]=val}return nstate}function innerMode(mode,state){for(var info;mode.innerMode&&(info=mode.innerMode(state))&&info.mode!=mode;)state=info.state,mode=info.mode -return info||{mode,state}}function startState(mode,a1,a2){return!mode.startState||mode.startState(a1,a2)}var StringStream=function(string,tabSize,lineOracle){this.pos=this.start=0,this.string=string,this.tabSize=tabSize||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=lineOracle} -function getLine(doc,n){if((n-=doc.first)<0||n>=doc.size)throw new Error("There is no line "+(n+doc.first)+" in the document.") -for(var chunk=doc;!chunk.lines;)for(var i=0;;++i){var child=chunk.children[i],sz=child.chunkSize() -if(n=doc.first&&llast?Pos(last,getLine(doc,last).text.length):clipToLen(pos,getLine(doc,pos.line).text.length)}function clipToLen(pos,linelen){var ch=pos.ch -return null==ch||ch>linelen?Pos(pos.line,linelen):ch<0?Pos(pos.line,0):pos}function clipPosArray(doc,array){for(var out=[],i=0;i=this.string.length},StringStream.prototype.sol=function(){return this.pos==this.lineStart},StringStream.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},StringStream.prototype.next=function(){if(this.posstart},StringStream.prototype.eatSpace=function(){for(var start=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos -return this.pos>start},StringStream.prototype.skipToEnd=function(){this.pos=this.string.length},StringStream.prototype.skipTo=function(ch){var found=this.string.indexOf(ch,this.pos) -if(found>-1)return this.pos=found,!0},StringStream.prototype.backUp=function(n){this.pos-=n},StringStream.prototype.column=function(){return this.lastColumnPos0?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},StringStream.prototype.current=function(){return this.string.slice(this.start,this.pos)},StringStream.prototype.hideFirstChars=function(n,inner){this.lineStart+=n -try{return inner()}finally{this.lineStart-=n}},StringStream.prototype.lookAhead=function(n){var oracle=this.lineOracle -return oracle&&oracle.lookAhead(n)},StringStream.prototype.baseToken=function(){var oracle=this.lineOracle -return oracle&&oracle.baseToken(this.pos)} -var SavedContext=function(state,lookAhead){this.state=state,this.lookAhead=lookAhead},Context=function(doc,state,line,lookAhead){this.state=state,this.doc=doc,this.line=line,this.maxLookAhead=lookAhead||0,this.baseTokens=null,this.baseTokenPos=1} -function highlightLine(cm,line,context,forceToEnd){var st=[cm.state.modeGen],lineClasses={} -runMode(cm,line.text,cm.doc.mode,context,(function(end,style){return st.push(end,style)}),lineClasses,forceToEnd) -for(var state=context.state,loop=function(o){context.baseTokens=st -var overlay=cm.state.overlays[o],i=1,at=0 -context.state=!0,runMode(cm,line.text,overlay.mode,context,(function(end,style){for(var start=i;atend&&st.splice(i,1,end,st[i+1],i_end),i+=2,at=Math.min(end,i_end)}if(style)if(overlay.opaque)st.splice(start,i-start,end,"overlay "+style),i=start+2 -else for(;startcm.options.maxHighlightLength&©State(cm.doc.mode,context.state),result=highlightLine(cm,line,context) -resetState&&(context.state=resetState),line.stateAfter=context.save(!resetState),line.styles=result.styles,result.classes?line.styleClasses=result.classes:line.styleClasses&&(line.styleClasses=null),updateFrontier===cm.doc.highlightFrontier&&(cm.doc.modeFrontier=Math.max(cm.doc.modeFrontier,++cm.doc.highlightFrontier))}return line.styles}function getContextBefore(cm,n,precise){var doc=cm.doc,display=cm.display -if(!doc.mode.startState)return new Context(doc,!0,n) -var start=findStartLine(cm,n,precise),saved=start>doc.first&&getLine(doc,start-1).stateAfter,context=saved?Context.fromSaved(doc,saved,start):new Context(doc,startState(doc.mode),start) -return doc.iter(start,n,(function(line){processLine(cm,line.text,context) -var pos=context.line -line.stateAfter=pos==n-1||pos%5==0||pos>=display.viewFrom&&posstream.start)return style}throw new Error("Mode "+mode.name+" failed to advance stream.")}Context.prototype.lookAhead=function(n){var line=this.doc.getLine(this.line+n) -return null!=line&&n>this.maxLookAhead&&(this.maxLookAhead=n),line},Context.prototype.baseToken=function(n){if(!this.baseTokens)return null -for(;this.baseTokens[this.baseTokenPos]<=n;)this.baseTokenPos+=2 -var type=this.baseTokens[this.baseTokenPos+1] -return{type:type&&type.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-n}},Context.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Context.fromSaved=function(doc,saved,line){return saved instanceof SavedContext?new Context(doc,copyState(doc.mode,saved.state),line,saved.lookAhead):new Context(doc,copyState(doc.mode,saved),line)},Context.prototype.save=function(copy){var state=!1!==copy?copyState(this.doc.mode,this.state):this.state -return this.maxLookAhead>0?new SavedContext(state,this.maxLookAhead):state} -var Token=function(stream,type,state){this.start=stream.start,this.end=stream.pos,this.string=stream.current(),this.type=type||null,this.state=state} -function takeToken(cm,pos,precise,asArray){var style,tokens,doc=cm.doc,mode=doc.mode,line=getLine(doc,(pos=clipPos(doc,pos)).line),context=getContextBefore(cm,pos.line,precise),stream=new StringStream(line.text,cm.options.tabSize,context) -for(asArray&&(tokens=[]);(asArray||stream.poscm.options.maxHighlightLength?(flattenSpans=!1,forceToEnd&&processLine(cm,text,context,stream.pos),stream.pos=text.length,style=null):style=extractLineClasses(readToken(mode,stream,context.state,inner),lineClasses),inner){var mName=inner[0].name -mName&&(style="m-"+(style?mName+" "+style:mName))}if(!flattenSpans||curStyle!=style){for(;curStartlim;--search){if(search<=doc.first)return doc.first -var line=getLine(doc,search-1),after=line.stateAfter -if(after&&(!precise||search+(after instanceof SavedContext?after.lookAhead:0)<=doc.modeFrontier))return search -var indented=countColumn(line.text,null,cm.options.tabSize);(null==minline||minindent>indented)&&(minline=search-1,minindent=indented)}return minline}function retreatFrontier(doc,n){if(doc.modeFrontier=Math.min(doc.modeFrontier,n),!(doc.highlightFrontierstart;line--){var saved=getLine(doc,line).stateAfter -if(saved&&(!(saved instanceof SavedContext)||line+saved.lookAhead=startCh:span.to>startCh);(nw||(nw=[])).push(new MarkedSpan(marker,span.from,endsAfter?null:span.to))}}return nw}function markedSpansAfter(old,endCh,isInsert){var nw -if(old)for(var i=0;i=endCh:span.to>endCh)||span.from==endCh&&"bookmark"==marker.type&&(!isInsert||span.marker.insertLeft)){var startsBefore=null==span.from||(marker.inclusiveLeft?span.from<=endCh:span.from0&&first)for(var i$2=0;i$20)){var newParts=[j,1],dfrom=cmp(p.from,m.from),dto=cmp(p.to,m.to);(dfrom<0||!mk.inclusiveLeft&&!dfrom)&&newParts.push({from:p.from,to:m.from}),(dto>0||!mk.inclusiveRight&&!dto)&&newParts.push({from:m.to,to:p.to}),parts.splice.apply(parts,newParts),j+=newParts.length-3}}return parts}function detachMarkedSpans(line){var spans=line.markedSpans -if(spans){for(var i=0;ich)&&(!found||compareCollapsedMarkers(found,sp.marker)<0)&&(found=sp.marker)}return found}function conflictingCollapsedRange(doc,lineNo,from,to,marker){var line=getLine(doc,lineNo),sps=sawCollapsedSpans&&line.markedSpans -if(sps)for(var i=0;i=0&&toCmp<=0||fromCmp<=0&&toCmp>=0)&&(fromCmp<=0&&(sp.marker.inclusiveRight&&marker.inclusiveLeft?cmp(found.to,from)>=0:cmp(found.to,from)>0)||fromCmp>=0&&(sp.marker.inclusiveRight&&marker.inclusiveLeft?cmp(found.from,to)<=0:cmp(found.from,to)<0)))return!0}}}function visualLine(line){for(var merged;merged=collapsedSpanAtStart(line);)line=merged.find(-1,!0).line -return line}function visualLineEnd(line){for(var merged;merged=collapsedSpanAtEnd(line);)line=merged.find(1,!0).line -return line}function visualLineContinued(line){for(var merged,lines;merged=collapsedSpanAtEnd(line);)line=merged.find(1,!0).line,(lines||(lines=[])).push(line) -return lines}function visualLineNo(doc,lineN){var line=getLine(doc,lineN),vis=visualLine(line) -return line==vis?lineN:lineNo(vis)}function visualLineEndNo(doc,lineN){if(lineN>doc.lastLine())return lineN -var merged,line=getLine(doc,lineN) -if(!lineIsHidden(doc,line))return lineN -for(;merged=collapsedSpanAtEnd(line);)line=merged.find(1,!0).line -return lineNo(line)+1}function lineIsHidden(doc,line){var sps=sawCollapsedSpans&&line.markedSpans -if(sps)for(var sp=void 0,i=0;id.maxLineLength&&(d.maxLineLength=len,d.maxLine=line)}))}var Line=function(text,markedSpans,estimateHeight){this.text=text,attachMarkedSpans(this,markedSpans),this.height=estimateHeight?estimateHeight(this):1} -function updateLine(line,text,markedSpans,estimateHeight){line.text=text,line.stateAfter&&(line.stateAfter=null),line.styles&&(line.styles=null),null!=line.order&&(line.order=null),detachMarkedSpans(line),attachMarkedSpans(line,markedSpans) -var estHeight=estimateHeight?estimateHeight(line):1 -estHeight!=line.height&&updateLineHeight(line,estHeight)}function cleanUpLine(line){line.parent=null,detachMarkedSpans(line)}Line.prototype.lineNo=function(){return lineNo(this)},eventMixin(Line) -var styleToClassCache={},styleToClassCacheWithMode={} -function interpretTokenStyle(style,options){if(!style||/^\s*$/.test(style))return null -var cache=options.addModeClass?styleToClassCacheWithMode:styleToClassCache -return cache[style]||(cache[style]=style.replace(/\S+/g,"cm-$&"))}function buildLineContent(cm,lineView){var content=eltP("span",null,null,webkit?"padding-right: .1px":null),builder={pre:eltP("pre",[content],"CodeMirror-line"),content,col:0,pos:0,cm,trailingSpace:!1,splitSpaces:cm.getOption("lineWrapping")} -lineView.measure={} -for(var i=0;i<=(lineView.rest?lineView.rest.length:0);i++){var line=i?lineView.rest[i-1]:lineView.line,order=void 0 -builder.pos=0,builder.addToken=buildToken,hasBadBidiRects(cm.display.measure)&&(order=getOrder(line,cm.doc.direction))&&(builder.addToken=buildTokenBadBidi(builder.addToken,order)),builder.map=[],insertLineContent(line,builder,getLineStyles(cm,line,lineView!=cm.display.externalMeasured&&lineNo(line))),line.styleClasses&&(line.styleClasses.bgClass&&(builder.bgClass=joinClasses(line.styleClasses.bgClass,builder.bgClass||"")),line.styleClasses.textClass&&(builder.textClass=joinClasses(line.styleClasses.textClass,builder.textClass||""))),0==builder.map.length&&builder.map.push(0,0,builder.content.appendChild(zeroWidthElement(cm.display.measure))),0==i?(lineView.measure.map=builder.map,lineView.measure.cache={}):((lineView.measure.maps||(lineView.measure.maps=[])).push(builder.map),(lineView.measure.caches||(lineView.measure.caches=[])).push({}))}if(webkit){var last=builder.content.lastChild;(/\bcm-tab\b/.test(last.className)||last.querySelector&&last.querySelector(".cm-tab"))&&(builder.content.className="cm-tab-wrap-hack")}return signal(cm,"renderLine",cm,lineView.line,builder.pre),builder.pre.className&&(builder.textClass=joinClasses(builder.pre.className,builder.textClass||"")),builder}function defaultSpecialCharPlaceholder(ch){var token=elt("span","•","cm-invalidchar") -return token.title="\\u"+ch.charCodeAt(0).toString(16),token.setAttribute("aria-label",token.title),token}function buildToken(builder,text,style,startStyle,endStyle,css,attributes){if(text){var content,displayText=builder.splitSpaces?splitSpaces(text,builder.trailingSpace):text,special=builder.cm.state.specialChars,mustWrap=!1 -if(special.test(text)){content=document.createDocumentFragment() -for(var pos=0;;){special.lastIndex=pos -var m=special.exec(text),skipped=m?m.index-pos:text.length-pos -if(skipped){var txt=document.createTextNode(displayText.slice(pos,pos+skipped)) -ie&&ie_version<9?content.appendChild(elt("span",[txt])):content.appendChild(txt),builder.map.push(builder.pos,builder.pos+skipped,txt),builder.col+=skipped,builder.pos+=skipped}if(!m)break -pos+=skipped+1 -var txt$1=void 0 -if("\t"==m[0]){var tabSize=builder.cm.options.tabSize,tabWidth=tabSize-builder.col%tabSize;(txt$1=content.appendChild(elt("span",spaceStr(tabWidth),"cm-tab"))).setAttribute("role","presentation"),txt$1.setAttribute("cm-text","\t"),builder.col+=tabWidth}else"\r"==m[0]||"\n"==m[0]?((txt$1=content.appendChild(elt("span","\r"==m[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",m[0]),builder.col+=1):((txt$1=builder.cm.options.specialCharPlaceholder(m[0])).setAttribute("cm-text",m[0]),ie&&ie_version<9?content.appendChild(elt("span",[txt$1])):content.appendChild(txt$1),builder.col+=1) -builder.map.push(builder.pos,builder.pos+1,txt$1),builder.pos++}}else builder.col+=text.length,content=document.createTextNode(displayText),builder.map.push(builder.pos,builder.pos+text.length,content),ie&&ie_version<9&&(mustWrap=!0),builder.pos+=text.length -if(builder.trailingSpace=32==displayText.charCodeAt(text.length-1),style||startStyle||endStyle||mustWrap||css||attributes){var fullStyle=style||"" -startStyle&&(fullStyle+=startStyle),endStyle&&(fullStyle+=endStyle) -var token=elt("span",[content],fullStyle,css) -if(attributes)for(var attr in attributes)attributes.hasOwnProperty(attr)&&"style"!=attr&&"class"!=attr&&token.setAttribute(attr,attributes[attr]) -return builder.content.appendChild(token)}builder.content.appendChild(content)}}function splitSpaces(text,trailingBefore){if(text.length>1&&!/ /.test(text))return text -for(var spaceBefore=trailingBefore,result="",i=0;istart&&part.from<=start);i++);if(part.to>=end)return inner(builder,text,style,startStyle,endStyle,css,attributes) -inner(builder,text.slice(0,part.to-start),style,startStyle,null,css,attributes),startStyle=null,text=text.slice(part.to-start),start=part.to}}}function buildCollapsedSpan(builder,size,marker,ignoreWidget){var widget=!ignoreWidget&&marker.widgetNode -widget&&builder.map.push(builder.pos,builder.pos+size,widget),!ignoreWidget&&builder.cm.display.input.needsContentAttribute&&(widget||(widget=builder.content.appendChild(document.createElement("span"))),widget.setAttribute("cm-marker",marker.id)),widget&&(builder.cm.display.input.setUneditable(widget),builder.content.appendChild(widget)),builder.pos+=size,builder.trailingSpace=!1}function insertLineContent(line,builder,styles){var spans=line.markedSpans,allText=line.text,at=0 -if(spans)for(var style,css,spanStyle,spanEndStyle,spanStartStyle,collapsed,attributes,len=allText.length,pos=0,i=1,text="",nextChange=0;;){if(nextChange==pos){spanStyle=spanEndStyle=spanStartStyle=css="",attributes=null,collapsed=null,nextChange=1/0 -for(var foundBookmarks=[],endStyles=void 0,j=0;jpos||m.collapsed&&sp.to==pos&&sp.from==pos)){if(null!=sp.to&&sp.to!=pos&&nextChange>sp.to&&(nextChange=sp.to,spanEndStyle=""),m.className&&(spanStyle+=" "+m.className),m.css&&(css=(css?css+";":"")+m.css),m.startStyle&&sp.from==pos&&(spanStartStyle+=" "+m.startStyle),m.endStyle&&sp.to==nextChange&&(endStyles||(endStyles=[])).push(m.endStyle,sp.to),m.title&&((attributes||(attributes={})).title=m.title),m.attributes)for(var attr in m.attributes)(attributes||(attributes={}))[attr]=m.attributes[attr] -m.collapsed&&(!collapsed||compareCollapsedMarkers(collapsed.marker,m)<0)&&(collapsed=sp)}else sp.from>pos&&nextChange>sp.from&&(nextChange=sp.from)}if(endStyles)for(var j$1=0;j$1=len)break -for(var upto=Math.min(len,nextChange);;){if(text){var end=pos+text.length -if(!collapsed){var tokenText=end>upto?text.slice(0,upto-pos):text -builder.addToken(builder,tokenText,style?style+spanStyle:spanStyle,spanStartStyle,pos+tokenText.length==nextChange?spanEndStyle:"",css,attributes)}if(end>=upto){text=text.slice(upto-pos),pos=upto -break}pos=end,spanStartStyle=""}text=allText.slice(at,at=styles[i++]),style=interpretTokenStyle(styles[i++],builder.cm.options)}}else for(var i$1=1;i$12&&heights.push((cur.bottom+next.top)/2-rect.top)}}heights.push(rect.bottom-rect.top)}}function mapFromLineView(lineView,line,lineN){if(lineView.line==line)return{map:lineView.measure.map,cache:lineView.measure.cache} -if(lineView.rest){for(var i=0;ilineN)return{map:lineView.measure.maps[i$1],cache:lineView.measure.caches[i$1],before:!0}}}function updateExternalMeasurement(cm,line){var lineN=lineNo(line=visualLine(line)),view=cm.display.externalMeasured=new LineView(cm.doc,line,lineN) -view.lineN=lineN -var built=view.built=buildLineContent(cm,view) -return view.text=built.pre,removeChildrenAndAdd(cm.display.lineMeasure,built.pre),view}function measureChar(cm,line,ch,bias){return measureCharPrepared(cm,prepareMeasureForLine(cm,line),ch,bias)}function findViewForLine(cm,lineN){if(lineN>=cm.display.viewFrom&&lineN=ext.lineN&&lineNch)&&(start=(end=mEnd-mStart)-1,ch>=mEnd&&(collapse="right")),null!=start){if(node=map[i+2],mStart==mEnd&&bias==(node.insertLeft?"left":"right")&&(collapse=bias),"left"==bias&&0==start)for(;i&&map[i-2]==map[i-3]&&map[i-1].insertLeft;)node=map[2+(i-=3)],collapse="left" -if("right"==bias&&start==mEnd-mStart)for(;i=0&&(rect=rects[i$1]).left==rect.right;i$1--);return rect}function measureCharInner(cm,prepared,ch,bias){var rect,place=nodeAndOffsetInLineMap(prepared.map,ch,bias),node=place.node,start=place.start,end=place.end,collapse=place.collapse -if(3==node.nodeType){for(var i$1=0;i$1<4;i$1++){for(;start&&isExtendingChar(prepared.line.text.charAt(place.coverStart+start));)--start -for(;place.coverStart+end0&&(collapse=bias="right"),rect=cm.options.lineWrapping&&(rects=node.getClientRects()).length>1?rects["right"==bias?rects.length-1:0]:node.getBoundingClientRect()}if(ie&&ie_version<9&&!start&&(!rect||!rect.left&&!rect.right)){var rSpan=node.parentNode.getClientRects()[0] -rect=rSpan?{left:rSpan.left,right:rSpan.left+charWidth(cm.display),top:rSpan.top,bottom:rSpan.bottom}:nullRect}for(var rtop=rect.top-prepared.rect.top,rbot=rect.bottom-prepared.rect.top,mid=(rtop+rbot)/2,heights=prepared.view.measure.heights,i=0;i=lineObj.text.length?(ch=lineObj.text.length,sticky="before"):ch<=0&&(ch=0,sticky="after"),!order)return get("before"==sticky?ch-1:ch,"before"==sticky) -function getBidi(ch,partPos,invert){return get(invert?ch-1:ch,1==order[partPos].level!=invert)}var partPos=getBidiPartAt(order,ch,sticky),other=bidiOther,val=getBidi(ch,partPos,"before"==sticky) -return null!=other&&(val.other=getBidi(ch,other,"before"!=sticky)),val}function estimateCoords(cm,pos){var left=0 -pos=clipPos(cm.doc,pos),cm.options.lineWrapping||(left=charWidth(cm.display)*pos.ch) -var lineObj=getLine(cm.doc,pos.line),top=heightAtLine(lineObj)+paddingTop(cm.display) -return{left,right:left,top,bottom:top+lineObj.height}}function PosWithInfo(line,ch,sticky,outside,xRel){var pos=Pos(line,ch,sticky) -return pos.xRel=xRel,outside&&(pos.outside=outside),pos}function coordsChar(cm,x,y){var doc=cm.doc -if((y+=cm.display.viewOffset)<0)return PosWithInfo(doc.first,0,null,-1,-1) -var lineN=lineAtHeight(doc,y),last=doc.first+doc.size-1 -if(lineN>last)return PosWithInfo(doc.first+doc.size-1,getLine(doc,last).text.length,null,1,1) -x<0&&(x=0) -for(var lineObj=getLine(doc,lineN);;){var found=coordsCharInner(cm,lineObj,lineN,x,y),collapsed=collapsedSpanAround(lineObj,found.ch+(found.xRel>0||found.outside>0?1:0)) -if(!collapsed)return found -var rangeEnd=collapsed.find(1) -if(rangeEnd.line==lineN)return rangeEnd -lineObj=getLine(doc,lineN=rangeEnd.line)}}function wrappedLineExtent(cm,lineObj,preparedMeasure,y){y-=widgetTopHeight(lineObj) -var end=lineObj.text.length,begin=findFirst((function(ch){return measureCharPrepared(cm,preparedMeasure,ch-1).bottom<=y}),end,0) -return{begin,end:end=findFirst((function(ch){return measureCharPrepared(cm,preparedMeasure,ch).top>y}),begin,end)}}function wrappedLineExtentChar(cm,lineObj,preparedMeasure,target){return preparedMeasure||(preparedMeasure=prepareMeasureForLine(cm,lineObj)),wrappedLineExtent(cm,lineObj,preparedMeasure,intoCoordSystem(cm,lineObj,measureCharPrepared(cm,preparedMeasure,target),"line").top)}function boxIsAfter(box,x,y,left){return!(box.bottom<=y)&&(box.top>y||(left?box.left:box.right)>x)}function coordsCharInner(cm,lineObj,lineNo,x,y){y-=heightAtLine(lineObj) -var preparedMeasure=prepareMeasureForLine(cm,lineObj),widgetHeight=widgetTopHeight(lineObj),begin=0,end=lineObj.text.length,ltr=!0,order=getOrder(lineObj,cm.doc.direction) -if(order){var part=(cm.options.lineWrapping?coordsBidiPartWrapped:coordsBidiPart)(cm,lineObj,lineNo,preparedMeasure,order,x,y) -begin=(ltr=1!=part.level)?part.from:part.to-1,end=ltr?part.to:part.from-1}var baseX,sticky,chAround=null,boxAround=null,ch=findFirst((function(ch){var box=measureCharPrepared(cm,preparedMeasure,ch) -return box.top+=widgetHeight,box.bottom+=widgetHeight,!!boxIsAfter(box,x,y,!1)&&(box.top<=y&&box.left<=x&&(chAround=ch,boxAround=box),!0)}),begin,end),outside=!1 -if(boxAround){var atLeft=x-boxAround.left=coords.bottom?1:0}return PosWithInfo(lineNo,ch=skipExtendingChars(lineObj.text,ch,1),sticky,outside,x-baseX)}function coordsBidiPart(cm,lineObj,lineNo,preparedMeasure,order,x,y){var index=findFirst((function(i){var part=order[i],ltr=1!=part.level -return boxIsAfter(cursorCoords(cm,Pos(lineNo,ltr?part.to:part.from,ltr?"before":"after"),"line",lineObj,preparedMeasure),x,y,!0)}),0,order.length-1),part=order[index] -if(index>0){var ltr=1!=part.level,start=cursorCoords(cm,Pos(lineNo,ltr?part.from:part.to,ltr?"after":"before"),"line",lineObj,preparedMeasure) -boxIsAfter(start,x,y,!0)&&start.top>y&&(part=order[index-1])}return part}function coordsBidiPartWrapped(cm,lineObj,_lineNo,preparedMeasure,order,x,y){var ref=wrappedLineExtent(cm,lineObj,preparedMeasure,y),begin=ref.begin,end=ref.end;/\s/.test(lineObj.text.charAt(end-1))&&end-- -for(var part=null,closestDist=null,i=0;i=end||p.to<=begin)){var endX=measureCharPrepared(cm,preparedMeasure,1!=p.level?Math.min(end,p.to)-1:Math.max(begin,p.from)).right,dist=endXdist)&&(part=p,closestDist=dist)}}return part||(part=order[order.length-1]),part.fromend&&(part={from:part.from,to:end,level:part.level}),part}function textHeight(display){if(null!=display.cachedTextHeight)return display.cachedTextHeight -if(null==measureText){measureText=elt("pre",null,"CodeMirror-line-like") -for(var i=0;i<49;++i)measureText.appendChild(document.createTextNode("x")),measureText.appendChild(elt("br")) -measureText.appendChild(document.createTextNode("x"))}removeChildrenAndAdd(display.measure,measureText) -var height=measureText.offsetHeight/50 -return height>3&&(display.cachedTextHeight=height),removeChildren(display.measure),height||1}function charWidth(display){if(null!=display.cachedCharWidth)return display.cachedCharWidth -var anchor=elt("span","xxxxxxxxxx"),pre=elt("pre",[anchor],"CodeMirror-line-like") -removeChildrenAndAdd(display.measure,pre) -var rect=anchor.getBoundingClientRect(),width=(rect.right-rect.left)/10 -return width>2&&(display.cachedCharWidth=width),width||10}function getDimensions(cm){for(var d=cm.display,left={},width={},gutterLeft=d.gutters.clientLeft,n=d.gutters.firstChild,i=0;n;n=n.nextSibling,++i){var id=cm.display.gutterSpecs[i].className -left[id]=n.offsetLeft+n.clientLeft+gutterLeft,width[id]=n.clientWidth}return{fixedPos:compensateForHScroll(d),gutterTotalWidth:d.gutters.offsetWidth,gutterLeft:left,gutterWidth:width,wrapperWidth:d.wrapper.clientWidth}}function compensateForHScroll(display){return display.scroller.getBoundingClientRect().left-display.sizer.getBoundingClientRect().left}function estimateHeight(cm){var th=textHeight(cm.display),wrapping=cm.options.lineWrapping,perLine=wrapping&&Math.max(5,cm.display.scroller.clientWidth/charWidth(cm.display)-3) -return function(line){if(lineIsHidden(cm.doc,line))return 0 -var widgetsHeight=0 -if(line.widgets)for(var i=0;i0&&(line=getLine(cm.doc,coords.line).text).length==coords.ch){var colDiff=countColumn(line,line.length,cm.options.tabSize)-line.length -coords=Pos(coords.line,Math.max(0,Math.round((x-paddingH(cm.display).left)/charWidth(cm.display))-colDiff))}return coords}function findViewIndex(cm,n){if(n>=cm.display.viewTo)return null -if((n-=cm.display.viewFrom)<0)return null -for(var view=cm.display.view,i=0;ifrom)&&(display.updateLineNumbers=from),cm.curOp.viewChanged=!0,from>=display.viewTo)sawCollapsedSpans&&visualLineNo(cm.doc,from)display.viewFrom?resetView(cm):(display.viewFrom+=lendiff,display.viewTo+=lendiff) -else if(from<=display.viewFrom&&to>=display.viewTo)resetView(cm) -else if(from<=display.viewFrom){var cut=viewCuttingPoint(cm,to,to+lendiff,1) -cut?(display.view=display.view.slice(cut.index),display.viewFrom=cut.lineN,display.viewTo+=lendiff):resetView(cm)}else if(to>=display.viewTo){var cut$1=viewCuttingPoint(cm,from,from,-1) -cut$1?(display.view=display.view.slice(0,cut$1.index),display.viewTo=cut$1.lineN):resetView(cm)}else{var cutTop=viewCuttingPoint(cm,from,from,-1),cutBot=viewCuttingPoint(cm,to,to+lendiff,1) -cutTop&&cutBot?(display.view=display.view.slice(0,cutTop.index).concat(buildViewArray(cm,cutTop.lineN,cutBot.lineN)).concat(display.view.slice(cutBot.index)),display.viewTo+=lendiff):resetView(cm)}var ext=display.externalMeasured -ext&&(to=ext.lineN&&line=display.viewTo)){var lineView=display.view[findViewIndex(cm,line)] -if(null!=lineView.node){var arr=lineView.changes||(lineView.changes=[]);-1==indexOf(arr,type)&&arr.push(type)}}}function resetView(cm){cm.display.viewFrom=cm.display.viewTo=cm.doc.first,cm.display.view=[],cm.display.viewOffset=0}function viewCuttingPoint(cm,oldN,newN,dir){var diff,index=findViewIndex(cm,oldN),view=cm.display.view -if(!sawCollapsedSpans||newN==cm.doc.first+cm.doc.size)return{index,lineN:newN} -for(var n=cm.display.viewFrom,i=0;i0){if(index==view.length-1)return null -diff=n+view[index].size-oldN,index++}else diff=n-oldN -oldN+=diff,newN+=diff}for(;visualLineNo(cm.doc,newN)!=newN;){if(index==(dir<0?0:view.length-1))return null -newN+=dir*view[index-(dir<0?1:0)].size,index+=dir}return{index,lineN:newN}}function adjustView(cm,from,to){var display=cm.display -0==display.view.length||from>=display.viewTo||to<=display.viewFrom?(display.view=buildViewArray(cm,from,to),display.viewFrom=from):(display.viewFrom>from?display.view=buildViewArray(cm,from,display.viewFrom).concat(display.view):display.viewFromto&&(display.view=display.view.slice(0,findViewIndex(cm,to)))),display.viewTo=to}function countDirtyView(cm){for(var view=cm.display.view,dirty=0,i=0;i=cm.display.viewTo||range.to().line0?width:cm.defaultCharWidth())+"px"}if(pos.other){var otherCursor=output.appendChild(elt("div"," ","CodeMirror-cursor CodeMirror-secondarycursor")) -otherCursor.style.display="",otherCursor.style.left=pos.other.left+"px",otherCursor.style.top=pos.other.top+"px",otherCursor.style.height=.85*(pos.other.bottom-pos.other.top)+"px"}}function cmpCoords(a,b){return a.top-b.top||a.left-b.left}function drawSelectionRange(cm,range,output){var display=cm.display,doc=cm.doc,fragment=document.createDocumentFragment(),padding=paddingH(cm.display),leftSide=padding.left,rightSide=Math.max(display.sizerWidth,displayWidth(cm)-display.sizer.offsetLeft)-padding.right,docLTR="ltr"==doc.direction -function add(left,top,width,bottom){top<0&&(top=0),top=Math.round(top),bottom=Math.round(bottom),fragment.appendChild(elt("div",null,"CodeMirror-selected","position: absolute; left: "+left+"px;\n top: "+top+"px; width: "+(null==width?rightSide-left:width)+"px;\n height: "+(bottom-top)+"px"))}function drawForLine(line,fromArg,toArg){var start,end,lineObj=getLine(doc,line),lineLen=lineObj.text.length -function coords(ch,bias){return charCoords(cm,Pos(line,ch),"div",lineObj,bias)}function wrapX(pos,dir,side){var extent=wrappedLineExtentChar(cm,lineObj,null,pos),prop="ltr"==dir==("after"==side)?"left":"right" -return coords("after"==side?extent.begin:extent.end-(/\s/.test(lineObj.text.charAt(extent.end-1))?2:1),prop)[prop]}var order=getOrder(lineObj,doc.direction) -return iterateBidiSections(order,fromArg||0,null==toArg?lineLen:toArg,(function(from,to,dir,i){var ltr="ltr"==dir,fromPos=coords(from,ltr?"left":"right"),toPos=coords(to-1,ltr?"right":"left"),openStart=null==fromArg&&0==from,openEnd=null==toArg&&to==lineLen,first=0==i,last=!order||i==order.length-1 -if(toPos.top-fromPos.top<=3){var openRight=(docLTR?openEnd:openStart)&&last,left=(docLTR?openStart:openEnd)&&first?leftSide:(ltr?fromPos:toPos).left,right=openRight?rightSide:(ltr?toPos:fromPos).right -add(left,fromPos.top,right-left,fromPos.bottom)}else{var topLeft,topRight,botLeft,botRight -ltr?(topLeft=docLTR&&openStart&&first?leftSide:fromPos.left,topRight=docLTR?rightSide:wrapX(from,dir,"before"),botLeft=docLTR?leftSide:wrapX(to,dir,"after"),botRight=docLTR&&openEnd&&last?rightSide:toPos.right):(topLeft=docLTR?wrapX(from,dir,"before"):leftSide,topRight=!docLTR&&openStart&&first?rightSide:fromPos.right,botLeft=!docLTR&&openEnd&&last?leftSide:toPos.left,botRight=docLTR?wrapX(to,dir,"after"):rightSide),add(topLeft,fromPos.top,topRight-topLeft,fromPos.bottom),fromPos.bottom0?display.blinker=setInterval((function(){cm.hasFocus()||onBlur(cm),display.cursorDiv.style.visibility=(on=!on)?"":"hidden"}),cm.options.cursorBlinkRate):cm.options.cursorBlinkRate<0&&(display.cursorDiv.style.visibility="hidden")}}function ensureFocus(cm){cm.hasFocus()||(cm.display.input.focus(),cm.state.focused||onFocus(cm))}function delayBlurEvent(cm){cm.state.delayingBlurEvent=!0,setTimeout((function(){cm.state.delayingBlurEvent&&(cm.state.delayingBlurEvent=!1,cm.state.focused&&onBlur(cm))}),100)}function onFocus(cm,e){cm.state.delayingBlurEvent&&!cm.state.draggingText&&(cm.state.delayingBlurEvent=!1),"nocursor"!=cm.options.readOnly&&(cm.state.focused||(signal(cm,"focus",cm,e),cm.state.focused=!0,addClass(cm.display.wrapper,"CodeMirror-focused"),cm.curOp||cm.display.selForContextMenu==cm.doc.sel||(cm.display.input.reset(),webkit&&setTimeout((function(){return cm.display.input.reset(!0)}),20)),cm.display.input.receivedFocus()),restartBlink(cm))}function onBlur(cm,e){cm.state.delayingBlurEvent||(cm.state.focused&&(signal(cm,"blur",cm,e),cm.state.focused=!1,rmClass(cm.display.wrapper,"CodeMirror-focused")),clearInterval(cm.display.blinker),setTimeout((function(){cm.state.focused||(cm.display.shift=!1)}),150))}function updateHeightsInViewport(cm){for(var display=cm.display,prevBottom=display.lineDiv.offsetTop,viewTop=Math.max(0,display.scroller.getBoundingClientRect().top),oldHeight=display.lineDiv.getBoundingClientRect().top,mustScroll=0,i=0;i.005||diff<-.005)&&(oldHeightcm.display.sizerWidth){var chWidth=Math.ceil(width/charWidth(cm.display)) -chWidth>cm.display.maxLineLength&&(cm.display.maxLineLength=chWidth,cm.display.maxLine=cur.line,cm.display.maxLineChanged=!0)}}}Math.abs(mustScroll)>2&&(display.scroller.scrollTop+=mustScroll)}function updateWidgetHeight(line){if(line.widgets)for(var i=0;i=to&&(from=lineAtHeight(doc,heightAtLine(getLine(doc,ensureTo))-display.wrapper.clientHeight),to=ensureTo)}return{from,to:Math.max(to,from+1)}}function maybeScrollWindow(cm,rect){if(!signalDOMEvent(cm,"scrollCursorIntoView")){var display=cm.display,box=display.sizer.getBoundingClientRect(),doScroll=null,doc=display.wrapper.ownerDocument -if(rect.top+box.top<0?doScroll=!0:rect.bottom+box.top>(doc.defaultView.innerHeight||doc.documentElement.clientHeight)&&(doScroll=!1),null!=doScroll&&!phantom){var scrollNode=elt("div","​",null,"position: absolute;\n top: "+(rect.top-display.viewOffset-paddingTop(cm.display))+"px;\n height: "+(rect.bottom-rect.top+scrollGap(cm)+display.barHeight)+"px;\n left: "+rect.left+"px; width: "+Math.max(2,rect.right-rect.left)+"px;") -cm.display.lineSpace.appendChild(scrollNode),scrollNode.scrollIntoView(doScroll),cm.display.lineSpace.removeChild(scrollNode)}}}function scrollPosIntoView(cm,pos,end,margin){var rect -null==margin&&(margin=0),cm.options.lineWrapping||pos!=end||(end="before"==pos.sticky?Pos(pos.line,pos.ch+1,"before"):pos,pos=pos.ch?Pos(pos.line,"before"==pos.sticky?pos.ch-1:pos.ch,"after"):pos) -for(var limit=0;limit<5;limit++){var changed=!1,coords=cursorCoords(cm,pos),endCoords=end&&end!=pos?cursorCoords(cm,end):coords,scrollPos=calculateScrollPos(cm,rect={left:Math.min(coords.left,endCoords.left),top:Math.min(coords.top,endCoords.top)-margin,right:Math.max(coords.left,endCoords.left),bottom:Math.max(coords.bottom,endCoords.bottom)+margin}),startTop=cm.doc.scrollTop,startLeft=cm.doc.scrollLeft -if(null!=scrollPos.scrollTop&&(updateScrollTop(cm,scrollPos.scrollTop),Math.abs(cm.doc.scrollTop-startTop)>1&&(changed=!0)),null!=scrollPos.scrollLeft&&(setScrollLeft(cm,scrollPos.scrollLeft),Math.abs(cm.doc.scrollLeft-startLeft)>1&&(changed=!0)),!changed)break}return rect}function scrollIntoView(cm,rect){var scrollPos=calculateScrollPos(cm,rect) -null!=scrollPos.scrollTop&&updateScrollTop(cm,scrollPos.scrollTop),null!=scrollPos.scrollLeft&&setScrollLeft(cm,scrollPos.scrollLeft)}function calculateScrollPos(cm,rect){var display=cm.display,snapMargin=textHeight(cm.display) -rect.top<0&&(rect.top=0) -var screentop=cm.curOp&&null!=cm.curOp.scrollTop?cm.curOp.scrollTop:display.scroller.scrollTop,screen=displayHeight(cm),result={} -rect.bottom-rect.top>screen&&(rect.bottom=rect.top+screen) -var docBottom=cm.doc.height+paddingVert(display),atTop=rect.topdocBottom-snapMargin -if(rect.topscreentop+screen){var newTop=Math.min(rect.top,(atBottom?docBottom:rect.bottom)-screen) -newTop!=screentop&&(result.scrollTop=newTop)}var gutterSpace=cm.options.fixedGutter?0:display.gutters.offsetWidth,screenleft=cm.curOp&&null!=cm.curOp.scrollLeft?cm.curOp.scrollLeft:display.scroller.scrollLeft-gutterSpace,screenw=displayWidth(cm)-display.gutters.offsetWidth,tooWide=rect.right-rect.left>screenw -return tooWide&&(rect.right=rect.left+screenw),rect.left<10?result.scrollLeft=0:rect.leftscreenw+screenleft-3&&(result.scrollLeft=rect.right+(tooWide?0:10)-screenw),result}function addToScrollTop(cm,top){null!=top&&(resolveScrollToPos(cm),cm.curOp.scrollTop=(null==cm.curOp.scrollTop?cm.doc.scrollTop:cm.curOp.scrollTop)+top)}function ensureCursorVisible(cm){resolveScrollToPos(cm) -var cur=cm.getCursor() -cm.curOp.scrollToPos={from:cur,to:cur,margin:cm.options.cursorScrollMargin}}function scrollToCoords(cm,x,y){null==x&&null==y||resolveScrollToPos(cm),null!=x&&(cm.curOp.scrollLeft=x),null!=y&&(cm.curOp.scrollTop=y)}function scrollToRange(cm,range){resolveScrollToPos(cm),cm.curOp.scrollToPos=range}function resolveScrollToPos(cm){var range=cm.curOp.scrollToPos -range&&(cm.curOp.scrollToPos=null,scrollToCoordsRange(cm,estimateCoords(cm,range.from),estimateCoords(cm,range.to),range.margin))}function scrollToCoordsRange(cm,from,to,margin){var sPos=calculateScrollPos(cm,{left:Math.min(from.left,to.left),top:Math.min(from.top,to.top)-margin,right:Math.max(from.right,to.right),bottom:Math.max(from.bottom,to.bottom)+margin}) -scrollToCoords(cm,sPos.scrollLeft,sPos.scrollTop)}function updateScrollTop(cm,val){Math.abs(cm.doc.scrollTop-val)<2||(gecko||updateDisplaySimple(cm,{top:val}),setScrollTop(cm,val,!0),gecko&&updateDisplaySimple(cm),startWorker(cm,100))}function setScrollTop(cm,val,forceScroll){val=Math.max(0,Math.min(cm.display.scroller.scrollHeight-cm.display.scroller.clientHeight,val)),(cm.display.scroller.scrollTop!=val||forceScroll)&&(cm.doc.scrollTop=val,cm.display.scrollbars.setScrollTop(val),cm.display.scroller.scrollTop!=val&&(cm.display.scroller.scrollTop=val))}function setScrollLeft(cm,val,isScroller,forceScroll){val=Math.max(0,Math.min(val,cm.display.scroller.scrollWidth-cm.display.scroller.clientWidth)),(isScroller?val==cm.doc.scrollLeft:Math.abs(cm.doc.scrollLeft-val)<2)&&!forceScroll||(cm.doc.scrollLeft=val,alignHorizontally(cm),cm.display.scroller.scrollLeft!=val&&(cm.display.scroller.scrollLeft=val),cm.display.scrollbars.setScrollLeft(val))}function measureForScrollbars(cm){var d=cm.display,gutterW=d.gutters.offsetWidth,docH=Math.round(cm.doc.height+paddingVert(cm.display)) -return{clientHeight:d.scroller.clientHeight,viewHeight:d.wrapper.clientHeight,scrollWidth:d.scroller.scrollWidth,clientWidth:d.scroller.clientWidth,viewWidth:d.wrapper.clientWidth,barLeft:cm.options.fixedGutter?gutterW:0,docHeight:docH,scrollHeight:docH+scrollGap(cm)+d.barHeight,nativeBarWidth:d.nativeBarWidth,gutterWidth:gutterW}}var NativeScrollbars=function(place,scroll,cm){this.cm=cm -var vert=this.vert=elt("div",[elt("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),horiz=this.horiz=elt("div",[elt("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar") -vert.tabIndex=horiz.tabIndex=-1,place(vert),place(horiz),on(vert,"scroll",(function(){vert.clientHeight&&scroll(vert.scrollTop,"vertical")})),on(horiz,"scroll",(function(){horiz.clientWidth&&scroll(horiz.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,ie&&ie_version<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")} -NativeScrollbars.prototype.update=function(measure){var needsH=measure.scrollWidth>measure.clientWidth+1,needsV=measure.scrollHeight>measure.clientHeight+1,sWidth=measure.nativeBarWidth -if(needsV){this.vert.style.display="block",this.vert.style.bottom=needsH?sWidth+"px":"0" -var totalHeight=measure.viewHeight-(needsH?sWidth:0) -this.vert.firstChild.style.height=Math.max(0,measure.scrollHeight-measure.clientHeight+totalHeight)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0" -if(needsH){this.horiz.style.display="block",this.horiz.style.right=needsV?sWidth+"px":"0",this.horiz.style.left=measure.barLeft+"px" -var totalWidth=measure.viewWidth-measure.barLeft-(needsV?sWidth:0) -this.horiz.firstChild.style.width=Math.max(0,measure.scrollWidth-measure.clientWidth+totalWidth)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0" -return!this.checkedZeroWidth&&measure.clientHeight>0&&(0==sWidth&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:needsV?sWidth:0,bottom:needsH?sWidth:0}},NativeScrollbars.prototype.setScrollLeft=function(pos){this.horiz.scrollLeft!=pos&&(this.horiz.scrollLeft=pos),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},NativeScrollbars.prototype.setScrollTop=function(pos){this.vert.scrollTop!=pos&&(this.vert.scrollTop=pos),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},NativeScrollbars.prototype.zeroWidthHack=function(){var w=mac&&!mac_geMountainLion?"12px":"18px" -this.horiz.style.height=this.vert.style.width=w,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Delayed,this.disableVert=new Delayed},NativeScrollbars.prototype.enableZeroWidthBar=function(bar,delay,type){function maybeDisable(){var box=bar.getBoundingClientRect();("vert"==type?document.elementFromPoint(box.right-1,(box.top+box.bottom)/2):document.elementFromPoint((box.right+box.left)/2,box.bottom-1))!=bar?bar.style.visibility="hidden":delay.set(1e3,maybeDisable)}bar.style.visibility="",delay.set(1e3,maybeDisable)},NativeScrollbars.prototype.clear=function(){var parent=this.horiz.parentNode -parent.removeChild(this.horiz),parent.removeChild(this.vert)} -var NullScrollbars=function(){} -function updateScrollbars(cm,measure){measure||(measure=measureForScrollbars(cm)) -var startWidth=cm.display.barWidth,startHeight=cm.display.barHeight -updateScrollbarsInner(cm,measure) -for(var i=0;i<4&&startWidth!=cm.display.barWidth||startHeight!=cm.display.barHeight;i++)startWidth!=cm.display.barWidth&&cm.options.lineWrapping&&updateHeightsInViewport(cm),updateScrollbarsInner(cm,measureForScrollbars(cm)),startWidth=cm.display.barWidth,startHeight=cm.display.barHeight}function updateScrollbarsInner(cm,measure){var d=cm.display,sizes=d.scrollbars.update(measure) -d.sizer.style.paddingRight=(d.barWidth=sizes.right)+"px",d.sizer.style.paddingBottom=(d.barHeight=sizes.bottom)+"px",d.heightForcer.style.borderBottom=sizes.bottom+"px solid transparent",sizes.right&&sizes.bottom?(d.scrollbarFiller.style.display="block",d.scrollbarFiller.style.height=sizes.bottom+"px",d.scrollbarFiller.style.width=sizes.right+"px"):d.scrollbarFiller.style.display="",sizes.bottom&&cm.options.coverGutterNextToScrollbar&&cm.options.fixedGutter?(d.gutterFiller.style.display="block",d.gutterFiller.style.height=sizes.bottom+"px",d.gutterFiller.style.width=measure.gutterWidth+"px"):d.gutterFiller.style.display=""}NullScrollbars.prototype.update=function(){return{bottom:0,right:0}},NullScrollbars.prototype.setScrollLeft=function(){},NullScrollbars.prototype.setScrollTop=function(){},NullScrollbars.prototype.clear=function(){} -var scrollbarModel={native:NativeScrollbars,null:NullScrollbars} -function initScrollbars(cm){cm.display.scrollbars&&(cm.display.scrollbars.clear(),cm.display.scrollbars.addClass&&rmClass(cm.display.wrapper,cm.display.scrollbars.addClass)),cm.display.scrollbars=new scrollbarModel[cm.options.scrollbarStyle]((function(node){cm.display.wrapper.insertBefore(node,cm.display.scrollbarFiller),on(node,"mousedown",(function(){cm.state.focused&&setTimeout((function(){return cm.display.input.focus()}),0)})),node.setAttribute("cm-not-content","true")}),(function(pos,axis){"horizontal"==axis?setScrollLeft(cm,pos):updateScrollTop(cm,pos)}),cm),cm.display.scrollbars.addClass&&addClass(cm.display.wrapper,cm.display.scrollbars.addClass)}var nextOpId=0 -function startOperation(cm){cm.curOp={cm,viewChanged:!1,startHeight:cm.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++nextOpId,markArrays:null},pushOperation(cm.curOp)}function endOperation(cm){var op=cm.curOp -op&&finishOperation(op,(function(group){for(var i=0;i=display.viewTo)||display.maxLineChanged&&cm.options.lineWrapping,op.update=op.mustUpdate&&new DisplayUpdate(cm,op.mustUpdate&&{top:op.scrollTop,ensure:op.scrollToPos},op.forceUpdate)}function endOperation_W1(op){op.updatedDisplay=op.mustUpdate&&updateDisplayIfNeeded(op.cm,op.update)}function endOperation_R2(op){var cm=op.cm,display=cm.display -op.updatedDisplay&&updateHeightsInViewport(cm),op.barMeasure=measureForScrollbars(cm),display.maxLineChanged&&!cm.options.lineWrapping&&(op.adjustWidthTo=measureChar(cm,display.maxLine,display.maxLine.text.length).left+3,cm.display.sizerWidth=op.adjustWidthTo,op.barMeasure.scrollWidth=Math.max(display.scroller.clientWidth,display.sizer.offsetLeft+op.adjustWidthTo+scrollGap(cm)+cm.display.barWidth),op.maxScrollLeft=Math.max(0,display.sizer.offsetLeft+op.adjustWidthTo-displayWidth(cm))),(op.updatedDisplay||op.selectionChanged)&&(op.preparedSelection=display.input.prepareSelection())}function endOperation_W2(op){var cm=op.cm -null!=op.adjustWidthTo&&(cm.display.sizer.style.minWidth=op.adjustWidthTo+"px",op.maxScrollLeft