(window.webpackJsonp=window.webpackJsonp||[]).push([[221],{"7ahc": /*!*************************************************************!*\ !*** ./src/components/markdown-editor/code-block/index.tsx ***! \*************************************************************/ /*! exports provided: default, MyCodeMirror */ /*! exports used: MyCodeMirror, default */function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */"0Owb"),o=(n(/*! antd/es/button/style */"+L6B"),n(/*! antd/es/button */"2/Rp")),l=(n(/*! antd/es/form/style */"y8nQ"),n(/*! antd/es/form */"Vl3Y")),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),s=(n(/*! antd/es/select/style */"OaEy"),n(/*! antd/es/select */"2fM7")),u=n(/*! react */"q1tI"),c=n.n(u),f=n(/*! codemirror */"VrN/"),h=n.n(f),d=(n(/*! codemirror/lib/codemirror.css */"p77/"),n(/*! codemirror/theme/blackboard.css */"c5Ni"),s.a.Option),p={labelCol:{span:4},wrapperCol:{span:20}},g={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function v(e){var t=e.value,n=e.onChange,i=e.mode,o=e.options,l=void 0===o?{}:o,s=Object(u.useRef)(),f=Object(u.useState)(),d=Object(a.a)(f,2),p=d[0],g=d[1];return Object(u.useEffect)((function(){if(p){function e(e){var t=e.getValue();n&&n(t)}return p.on("change",e),function(){p.off("change",e)}}}),[p,n]),Object(u.useEffect)((function(){p&&p.setOption("mode",i)}),[p,i]),Object(u.useEffect)((function(){p&&(t===p.getValue()&&""!==t||setTimeout((function(){p.setValue(t||" ")}),300))}),[p,t]),Object(u.useEffect)((function(){if(s.current&&!p){var e=h.a.fromTextArea(s.current,Object(r.a)({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},l));g(e)}}),[s.current,p]),c.a.createElement("div",{className:"my-codemirror-container"},c.a.createElement("textarea",{ref:s}))}t.b=function(e){var t=e.callback,n=e.onCancel,r=Object(u.useState)("python"),f=Object(a.a)(r,2),h=f[0],m=f[1];return c.a.createElement(l.a,Object(i.a)({},p,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)}}),c.a.createElement(l.a.Item,{label:"代码语言",name:"language"},c.a.createElement(s.a,{onChange:function(e){m(g[e][1])}},Object.keys(g).map((function(e){return c.a.createElement(d,{key:e,value:e},g[e][0])})))),c.a.createElement(l.a.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}]},c.a.createElement(v,{mode:h})),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(o.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),c.a.createElement(o.a,{type:"ghost",onClick:n},"取消")))}},"9ZNV": /*!**********************************************!*\ !*** ./src/components/FixedButton/index.tsx ***! \**********************************************/ /*! exports provided: FixedButton */ /*! exports used: FixedButton */function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */"0Owb"),i=(n(/*! antd/es/button/style */"+L6B"),n(/*! antd/es/button */"2/Rp")),o=n(/*! react */"q1tI"),l=n.n(o),a=n(/*! ./index.less?modules */"UUDw"),s=n.n(a),u=n(/*! classnames */"TSYQ"),c=n.n(u),f=function(e){var t=e.cancelText,n=void 0===t?"取消":t,o=e.okText,a=void 0===o?"确定":o,u=e.loading,f=void 0!==u&&u,h=e.hasOkBtn,d=void 0===h||h,p=e.okButtonProps,g=void 0===p?{}:p,v=e.onCancel,m=void 0===v?function(){}:v,y=e.onOk,b=void 0===y?function(){}:y,w=e.className,x=void 0===w?"":w;return l.a.createElement("div",{className:c()(s.a.buttonFixed,x)},l.a.createElement("div",{className:s.a.buttonWrap},l.a.createElement(i.a,{size:"large",className:"".concat(s.a.button," mr20"),onClick:m},n),d&&l.a.createElement(i.a,Object(r.a)({size:"large",type:"primary",className:"".concat(s.a.button," mr20"),loading:f,onClick:b},g),a)))}},Gytx: /*!********************************************!*\ !*** ./node_modules/shallowequal/index.js ***! \********************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),l=Object.keys(t);if(o.length!==l.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),s=0;s1&&void 0!==arguments[1]?arguments[1]:1,n=D.length,r=0;r1&&void 0!==arguments[1]&&arguments[1];return Object(L.a)(e).map((function(e,n){if(!a.isValidElement(e)||!e.type)return null;var r=e.type.isSelectOptGroup,i=e.key,o=e.props,l=o.children,s=Object(u.a)(o,["children"]);return t||!r?T(e):Object(k.a)(Object(k.a)({key:"__RC_SELECT_GRP__".concat(null===i?n:i,"__"),label:i},s),{},{options:O(l)})})).filter((function(e){return e}))}var M=n("2Qr1"),N=n("qNPg"),A=n("U8pU"),E=n("Kwbf"),D=n("WKfj");var W=function(e){var t=e.mode,n=e.options,r=e.children,i=e.backfill,o=e.allowClear,l=e.placeholder,s=e.getInputElement,u=e.showSearch,c=e.onSearch,f=e.defaultOpen,h=e.autoFocus,d=e.labelInValue,p=e.value,g=e.inputValue,v=e.optionLabelProp,m="multiple"===t||"tags"===t,y=void 0!==u?u:m||"combobox"===t,b=n||O(r);if(Object(E.a)("tags"!==t||b.every((function(e){return!e.disabled})),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),"tags"===t||"combobox"===t){var w=b.some((function(e){return e.options?e.options.some((function(e){return"number"==typeof("value"in e?e.value:e.key)})):"number"==typeof("value"in e?e.value:e.key)}));Object(E.a)(!w,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)("combobox"!==t||!v,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)("combobox"===t||!i,"`backfill` only works with `combobox` mode."),Object(E.a)("combobox"===t||!s,"`getInputElement` only work with `combobox` mode."),Object(E.b)("combobox"!==t||!s||!o||!l,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),c&&!y&&"combobox"!==t&&"tags"!==t&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!f||h,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),null!=p){var x=Object(D.d)(p);Object(E.a)(!d||x.every((function(e){return"object"===Object(A.a)(e)&&("key"in e||"value"in e)})),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(E.a)(!m||Array.isArray(p),"`value` should be array when `mode` is `multiple` or `tags`")}if(r){var C=null;Object(L.a)(r).some((function(e){if(!a.isValidElement(e)||!e.type)return!1;var t=e.type;return!t.isSelectOption&&(t.isSelectOptGroup?!Object(L.a)(e.props.children).every((function(t){return!(a.isValidElement(t)&&e.type&&!t.type.isSelectOption)||(C=t.type,!1)})):(C=t,!0))})),C&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(C.displayName||C.name||C,"`.")),Object(E.a)(void 0===g,"`inputValue` is deprecated, please use `searchValue` instead.")}},F=Object(N.a)({prefixCls:"rc-select",components:{optionList:b},convertChildrenToData:O,flattenOptions:M.d,getLabeledValue:M.e,filterOptions:M.b,isValueDisabled:M.g,findValueOption:M.c,warningProps:W,fillOptionsWithMissingValue:M.a}),H=function(e){Object(o.a)(n,e);var t=Object(l.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments)).selectRef=a.createRef(),e.focus=function(){e.selectRef.current.focus()},e.blur=function(){e.selectRef.current.blur()},e}return Object(i.a)(n,[{key:"render",value:function(){return a.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),n}(a.Component);H.Option=x,H.OptGroup=S;var z=H;t.c=z},UUDw: /*!*******************************************************!*\ !*** ./src/components/FixedButton/index.less?modules ***! \*******************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},"VrN/": /*!***************************************************!*\ !*** ./node_modules/codemirror/lib/codemirror.js ***! \***************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),l=r||i||o,a=l&&(r?document.documentMode||6:+(o||i)[1]),s=!o&&/WebKit\//.test(e),u=s&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),f=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),v=/Android/.test(e),m=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),x=f&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(f=!1,s=!0);var C=y&&(u||f&&(null==x||x<12.11)),S=n||l&&a>=9;function k(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var L,T=function(e,t){var n=e.className,r=k(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function O(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function M(e,t){return O(e).appendChild(t)}function N(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}g?H=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(H=function(e){try{e.select()}catch(e){}});var R=function(){this.id=null,this.f=null,this.time=0,this.handler=z(this.onTimeout,this)};function j(e,t){for(var n=0;n=t)return r+Math.min(l,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var K=[""];function X(e){for(;K.length<=e;)K.push(Y(K)+" ");return K[e]}function Y(e){return e[e.length-1]}function q(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&Q(e))||t.test(e):Q(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\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 re(e){return e.charCodeAt(0)>=768&&ne.test(e)}function ie(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}var le=null;function ae(e,t,n){var r;le=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:le=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:le=i)}return null!=r?r:le}var se=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(l,a){var s="ltr"==a?"L":"R";if(0==l.length||"ltr"==a&&!e.test(l))return!1;for(var u,c=l.length,f=[],h=0;h-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function pe(e,t){var n=he(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function ye(e){e.prototype.on=function(e,t){fe(this,e,t)},e.prototype.off=function(e,t){de(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function we(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function xe(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ce(e){be(e),we(e)}function Se(e){return e.target||e.srcElement}function ke(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Le,Te,Oe=function(){if(l&&a<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function Me(e){if(null==Le){var t=N("span","​");M(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Le=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&a<8))}var n=Le?N("span","​"):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ne(e){if(null!=Te)return Te;var t=M(e,document.createTextNode("AخA")),n=L(t,0,1).getBoundingClientRect(),r=L(t,1,2).getBoundingClientRect();return O(e),!(!n||n.left==n.right)&&(Te=r.right-n.right<3)}var Ae,Ee=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},De=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},We="oncopy"in(Ae=N("div"))||(Ae.setAttribute("oncopy","return;"),"function"==typeof Ae.oncopy),Fe=null,He={},ze={};function Ie(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),He[e]=t}function Pe(e){if("string"==typeof e&&ze.hasOwnProperty(e))e=ze[e];else if(e&&"string"==typeof e.name&&ze.hasOwnProperty(e.name)){var t=ze[e.name];"string"==typeof t&&(t={name:t}),(e=$(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Pe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Pe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Re(e,t){t=Pe(t);var n=He[t.name];if(!n)return Re(e,"text/plain");var r=n(e,t);if(je.hasOwnProperty(t.name)){var i=je[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var je={};function Be(e,t){I(t,je.hasOwnProperty(e)?je[e]:je[e]={})}function Ve(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ge(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ue(e,t,n){return!e.startState||e.startState(t,n)}var _e=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ke(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?et(n,Ke(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,Ke(e,t.line).text.length)}function st(e,t){for(var n=[],r=0;r=this.string.length},_e.prototype.sol=function(){return this.pos==this.lineStart},_e.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},_e.prototype.next=function(){if(this.post},_e.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},_e.prototype.skipToEnd=function(){this.pos=this.string.length},_e.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},_e.prototype.backUp=function(e){this.pos-=e},_e.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},_e.prototype.current=function(){return this.string.slice(this.start,this.pos)},_e.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},_e.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},_e.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ut=function(e,t){this.state=e,this.lookAhead=t},ct=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ft(e,t,n,r){var i=[e.state.modeGen],o={};wt(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var l=n.state,a=function(r){n.baseTokens=i;var a=e.state.overlays[r],s=1,u=0;n.state=!0,wt(e,t.text,a.mode,n,(function(e,t){for(var n=s;ue&&i.splice(s,1,e,i[s+1],r),s+=2,u=Math.min(e,r)}if(t)if(a.opaque)i.splice(n,s-n,e,"overlay "+t),s=n+2;else for(;ne.options.maxHighlightLength&&Ve(e.doc.mode,r.state),o=ft(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function dt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new ct(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=o.first)return o.first;var s=Ke(o,a-1),u=s.stateAfter;if(u&&(!n||a+(u instanceof ut?u.lookAhead:0)<=o.modeFrontier))return a;var c=P(s.text,null,e.options.tabSize);(null==i||r>c)&&(i=a-1,r=c)}return i}(e,t,n),l=o>r.first&&Ke(r,o-1).stateAfter,a=l?ct.fromSaved(r,l,o):new ct(r,Ue(r.mode),o);return r.iter(o,t,(function(n){pt(e,n.text,a);var r=a.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}ct.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ct.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ct.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ct.fromSaved=function(e,t,n){return t instanceof ut?new ct(e,Ve(e.mode,t.state),n,t.lookAhead):new ct(e,Ve(e.mode,t),n)},ct.prototype.save=function(e){var t=!1!==e?Ve(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ut(t,this.maxLookAhead):t};var mt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yt(e,t,n,r){var i,o,l=e.doc,a=l.mode,s=Ke(l,(t=at(l,t)).line),u=dt(e,t.line,n),c=new _e(s.text,e.options.tabSize,u);for(r&&(o=[]);(r||c.pose.options.maxHighlightLength?(a=!1,l&&pt(e,t,r,f.pos),f.pos=t.length,s=null):s=bt(vt(n,f,r.state,h),o),h){var d=h[0].name;d&&(s="m-"+(s?d+" "+s:d))}if(!a||c!=s){for(;u=t:o.to>t);(r||(r=[])).push(new St(l,o.from,a?null:o.to))}}return r}(n,i,l),s=function(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==l.type&&(!n||o.marker.insertLeft)){var a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from0&&a)for(var b=0;bt)&&(!n||Dt(n,o.marker)<0)&&(n=o.marker)}return n}function It(e,t,n,r,i){var o=Ke(e,t),l=Ct&&o.markedSpans;if(l)for(var a=0;a=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?tt(u.to,n)>=0:tt(u.to,n)>0)||c>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?tt(u.from,r)<=0:tt(u.from,r)<0)))return!0}}}function Pt(e){for(var t;t=Ft(e);)e=t.find(-1,!0).line;return e}function Rt(e,t){var n=Ke(e,t),r=Pt(n);return n==r?t:Ze(r)}function jt(e,t){if(t>e.lastLine())return t;var n,r=Ke(e,t);if(!Bt(e,r))return t;for(;n=Ht(r);)r=n.find(1,!0).line;return Ze(r)+1}function Bt(e,t){var n=Ct&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Kt=function(e,t,n){this.text=e,Nt(this,t),this.height=n?n(this):1};function Xt(e){e.parent=null,Mt(e)}Kt.prototype.lineNo=function(){return Ze(this)},ye(Kt);var Yt={},qt={};function Zt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?qt:Yt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function $t(e,t){var n=A("span",null,null,s?"padding-right: .1px":null),r={pre:A("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=Qt,Ne(e.display.measure)&&(l=ue(o,e.doc.direction))&&(r.addToken=en(r.addToken,l)),r.map=[],nn(o,r,ht(e,o,t!=e.display.externalMeasured&&Ze(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=F(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=F(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Me(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var a=r.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return pe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=F(r.pre.className,r.textClass||"")),r}function Jt(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Qt(e,t,n,r,i,o,s){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&f.from<=u);h++);if(f.to>=c)return e(n,r,i,o,l,a,s);e(n,r.slice(0,f.to-u),i,o,null,a,s),o=null,r=r.slice(f.to-u),u=f.to}}}function tn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var l,a,s,u,c,f,h,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){s=u=c=a="",h=null,f=null,m=1/0;for(var y=[],b=void 0,w=0;wp||C.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(s+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((h||(h={})).title=C.title),C.attributes)for(var S in C.attributes)(h||(h={}))[S]=C.attributes[S];C.collapsed&&(!f||Dt(f.marker,C)<0)&&(f=x)}else x.from>p&&m>x.from&&(m=x.from)}if(b)for(var k=0;k=d)break;for(var T=Math.min(d,m);;){if(v){var O=p+v.length;if(!f){var M=O>T?v.slice(0,T-p):v;t.addToken(t,M,l?l+s:s,c,p+M.length==m?u:"",a,h)}if(O>=T){v=v.slice(T-p),p=T;break}p=O,c=""}v=i.slice(o,o=n[g++]),l=Zt(n[g++],t.cm.options)}}else for(var N=1;Nn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function An(e,t,n,r){return Wn(e,Dn(e,t),n,r)}function En(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&t2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=zn(t.map,n,r),s=o.node,u=o.start,c=o.end,f=o.collapse;if(3==s.nodeType){for(var h=0;h<4;h++){for(;u&&re(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var d;u>0&&(f=r="right"),i=e.options.lineWrapping&&(d=s.getClientRects()).length>1?d["right"==r?d.length-1:0]:s.getBoundingClientRect()}if(l&&a<9&&!u&&(!i||!i.left&&!i.right)){var p=s.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+ir(e.display),top:p.top,bottom:p.bottom}:Hn}for(var g=i.top-t.rect.top,v=i.bottom-t.rect.top,m=(g+v)/2,y=t.view.measure.heights,b=0;bt)&&(i=(o=s-a)-1,t>=s&&(l="right")),null!=i){if(r=e[u+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],l="left";if("right"==n&&i==s-a)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function Pn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!a)return l("before"==u?s-1:s,"before"==u);function c(e,t,n){return l(n?e-1:e,1==a[t].level!=n)}var f=ae(a,s,u),h=le,d=c(s,f,"before"==u);return null!=h&&(d.other=c(s,h,"before"!=u)),d}function Yn(e,t){var n=0;t=at(e.doc,t),e.options.lineWrapping||(n=ir(e.display)*t.ch);var r=Ke(e.doc,t.line),i=Gt(r)+Sn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function qn(e,t,n,r,i){var o=et(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Zn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return qn(r.first,0,null,-1,-1);var i=$e(r,n),o=r.first+r.size-1;if(i>o)return qn(r.first+r.size-1,Ke(r,o).text.length,null,1,1);t<0&&(t=0);for(var l=Ke(r,i);;){var a=er(e,l,i,t,n),s=zt(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==i)return u;l=Ke(r,i=u.line)}}function $n(e,t,n,r){r-=Gn(t);var i=t.text.length,o=oe((function(t){return Wn(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=oe((function(t){return Wn(e,n,t).top>r}),o,i)}}function Jn(e,t,n,r){return n||(n=Dn(e,t)),$n(e,t,n,Un(e,t,Wn(e,n,r),"line").top)}function Qn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function er(e,t,n,r,i){i-=Gt(t);var o=Dn(e,t),l=Gn(t),a=0,s=t.text.length,u=!0,c=ue(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?nr:tr)(e,t,n,o,c,r,i);a=(u=1!=f.level)?f.from:f.to-1,s=u?f.to:f.from-1}var h,d,p=null,g=null,v=oe((function(t){var n=Wn(e,o,t);return n.top+=l,n.bottom+=l,!!Qn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,g=n),!0)}),a,s),m=!1;if(g){var y=r-g.left=w.bottom?1:0}return qn(n,v=ie(t.text,v,1),d,m,r-h)}function tr(e,t,n,r,i,o,l){var a=oe((function(a){var s=i[a],u=1!=s.level;return Qn(Xn(e,et(n,u?s.to:s.from,u?"before":"after"),"line",t,r),o,l,!0)}),0,i.length-1),s=i[a];if(a>0){var u=1!=s.level,c=Xn(e,et(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Qn(c,o,l,!0)&&c.top>l&&(s=i[a-1])}return s}function nr(e,t,n,r,i,o,l){var a=$n(e,t,r,l),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,f=null,h=0;h=u||d.to<=s)){var p=Wn(e,r,1!=d.level?Math.min(u,d.to)-1:Math.max(s,d.from)).right,g=pg)&&(c=d,f=g)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function rr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Fn){Fn=N("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Fn.appendChild(document.createTextNode("x")),Fn.appendChild(N("br"));Fn.appendChild(document.createTextNode("x"))}M(e.measure,Fn);var n=Fn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),O(e.measure),n||1}function ir(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),n=N("pre",[t],"CodeMirror-line-like");M(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function or(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var a=e.display.gutterSpecs[l].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:lr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function lr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ar(e){var t=rr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/ir(e.display)-3);return function(i){if(Bt(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l0&&(s=Ke(e.doc,u.line).text).length==u.ch){var c=P(s,s.length,e.options.tabSize)-s.length;u=et(u.line,Math.max(0,Math.round((o-Ln(e.display).left)/ir(e.display))-c))}return u}function cr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Ct&&Rt(e.doc,t)i.viewFrom?dr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)dr(e);else if(t<=i.viewFrom){var o=pr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):dr(e)}else if(n>=i.viewTo){var l=pr(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):dr(e)}else{var a=pr(e,t,t,-1),s=pr(e,n,n+r,1);a&&s?(i.view=i.view.slice(0,a.index).concat(on(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):dr(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[cr(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==j(l,n)&&l.push(n)}}}function dr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function pr(e,t,n,r){var i,o=cr(e,t),l=e.display.view;if(!Ct||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var a=e.display.viewFrom,s=0;s0){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,n+=i}for(;Rt(e.doc,n)!=n;){if(o==(r<0?0:l.length-1))return null;n+=r*l[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function gr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||a.to().linet||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(g,n||0,null==r?h:r,(function(e,t,i,f){var v="ltr"==i,m=d(e,v?"left":"right"),y=d(t-1,v?"right":"left"),b=null==n&&0==e,w=null==r&&t==h,x=0==f,C=!g||f==g.length-1;if(y.top-m.top<=3){var S=(u?w:b)&&C,k=(u?b:w)&&x?a:(v?m:y).left,L=S?s:(v?y:m).right;c(k,m.top,L-k,m.bottom)}else{var T,O,M,N;v?(T=u&&b&&x?a:m.left,O=u?s:p(e,i,"before"),M=u?a:p(t,i,"after"),N=u&&w&&C?s:y.right):(T=u?p(e,i,"before"):a,O=!u&&b&&x?s:m.right,M=!u&&w&&C?a:y.left,N=u?p(t,i,"after"):s),c(T,m.top,O-T,m.bottom),m.bottom0?t.blinker=setInterval((function(){e.hasFocus()||Lr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Cr(e){e.state.focused||(e.display.input.focus(),kr(e))}function Sr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Lr(e))}),100)}function kr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(pe(e,"focus",e,t),e.state.focused=!0,W(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),xr(e))}function Lr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(pe(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Tr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||h<-.005)&&(qe(i.line,s),Or(i.line),i.rest))for(var d=0;de.display.sizerWidth){var p=Math.ceil(u/ir(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Or(e){if(e.widgets)for(var t=0;t=l&&(o=$e(t,Gt(Ke(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function Nr(e,t){var n=e.display,r=rr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Mn(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+kn(n),s=t.topa-r;if(t.topi+o){var c=Math.min(t.top,(u?a:t.bottom)-o);c!=i&&(l.scrollTop=c)}var f=e.options.fixedGutter?0:n.gutters.offsetWidth,h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-f,d=On(e)-n.gutters.offsetWidth,p=t.right-t.left>d;return p&&(t.right=t.left+d),t.left<10?l.scrollLeft=0:t.leftd+h-3&&(l.scrollLeft=t.right+(p?0:10)-d),l}function Ar(e,t){null!=t&&(Wr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Er(e){Wr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Dr(e,t,n){null==t&&null==n||Wr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Wr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Fr(e,Yn(e,t.from),Yn(e,t.to),t.margin))}function Fr(e,t,n,r){var i=Nr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Dr(e,i.scrollLeft,i.scrollTop)}function Hr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||si(e,{top:t}),zr(e,t,!0),n&&si(e),ri(e,100))}function zr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Ir(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,fi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Pr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+kn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Tn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Rr=function(e,t,n){this.cm=n;var r=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),fe(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),fe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,l&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Rr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Rr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Rr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Rr.prototype.zeroWidthHack=function(){var e=y&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new R,this.disableVert=new R},Rr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},Rr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var jr=function(){};function Br(e,t){t||(t=Pr(e));var n=e.display.barWidth,r=e.display.barHeight;Vr(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Tr(e),Vr(e,Pr(e)),n=e.display.barWidth,r=e.display.barHeight}function Vr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}jr.prototype.update=function(){return{bottom:0,right:0}},jr.prototype.setScrollLeft=function(){},jr.prototype.setScrollTop=function(){},jr.prototype.clear=function(){};var Gr={native:Rr,null:jr};function Ur(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Gr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Ir(e,t):Hr(e,t)}),e),e.display.scrollbars.addClass&&W(e.display.wrapper,e.display.scrollbars.addClass)}var _r=0;function Kr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++_r},t=e.curOp,ln?ln.ops.push(t):t.ownsGroup=ln={ops:[t],delayedCallbacks:[]}}function Xr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new oi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function qr(e){e.updatedDisplay=e.mustUpdate&&li(e.cm,e.update)}function Zr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Tr(t),e.barMeasure=Pr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=An(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Tn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-On(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function $r(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=N("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Sn(e.display))+"px;\n height: "+(t.bottom-t.top+Tn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?et(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var l=!1,a=Xn(e,t),s=n&&n!=t?Xn(e,n):a,u=Nr(e,i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r}),c=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=u.scrollTop&&(Hr(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(l=!0)),null!=u.scrollLeft&&(Ir(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(l=!0)),!l)break}return i}(t,at(r,e.scrollToPos.from),at(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var l=0;l=e.display.viewTo)){var n=+new Date+e.options.workTime,r=dt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength?Ve(t.mode,r.state):null,s=ft(e,o,r,!0);a&&(r.state=a),o.styles=s.styles;var u=o.styleClasses,c=s.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var f=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),h=0;!f&&hn)return ri(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Qr(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==gr(e))return!1;hi(e)&&(dr(e),t.dims=or(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroml&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),Ct&&(o=Rt(e.doc,o),l=jt(e.doc,l));var a=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=on(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=on(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,cr(e,n)))),r.viewTo=n}(e,o,l),n.viewOffset=Gt(Ke(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=gr(e);if(!a&&0==u&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=D();if(!t||!E(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&E(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return u>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,l=o.firstChild;function a(t){var n=t.nextSibling;return s&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var u=r.view,c=r.viewFrom,f=0;f-1&&(d=!1),cn(e,h,c,n)),d&&(O(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(Qe(e.options,c)))),l=h.node.nextSibling}else{var p=mn(e,h,c,n);o.insertBefore(p,l)}c+=h.size}for(;l;)l=a(l)}(e,n.updateLineNumbers,t.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=D()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&E(document.body,e.anchorNode)&&E(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(c),O(n.cursorDiv),O(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ri(e,400)),n.updateLineNumbers=null,!0}function ai(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=On(e))r&&(t.visible=Mr(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+kn(e.display)-Mn(e),n.top)}),t.visible=Mr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!li(e,t))break;Tr(e);var i=Pr(e);vr(e),Br(e,i),ci(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function si(e,t){var n=new oi(e,t);if(li(e,n)){Tr(e),ai(e,n);var r=Pr(e);vr(e),Br(e,r),ci(e,r),n.finish()}}function ui(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ci(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Tn(e)+"px"}function fi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=lr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;la.clientWidth,c=a.scrollHeight>a.clientHeight;if(i&&u||o&&c){if(o&&y&&s)e:for(var h=t.target,d=l.view;h!=a;h=h.parentNode)for(var p=0;p=0&&tt(e,r.to())<=0)return n}return-1};var Si=function(e,t){this.anchor=e,this.head=t};function ki(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=j(t,i);for(var o=1;o0:s>=0){var u=ot(a.from(),l.from()),c=it(a.to(),l.to()),f=a.empty()?l.from()==l.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new Si(f?c:u,f?u:c))}}return new Ci(t,n)}function Li(e,t){return new Ci([new Si(e,t||e)],0)}function Ti(e){return e.text?et(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Oi(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Ti(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Ti(t).ch-t.to.ch),et(n,r)}function Mi(e,t){for(var n=[],r=0;r1&&e.remove(a.line+1,p-1),e.insert(a.line+1,m)}sn(e,"change",e,t)}function Fi(e,t,n){!function e(r,i,o){if(r.linked)for(var l=0;la-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Ri(e.done),Y(e.done)):e.done.length&&!Y(e.done).ranges?Y(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}(i,i.lastOp==r)))l=Y(o.changes),0==tt(t.from,t.to)&&0==tt(t.from,l.to)?l.to=Ti(t):o.changes.push(Pi(e,t));else{var s=Y(i.done);for(s&&s.ranges||Vi(e.sel,i.done),o={changes:[Pi(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||pe(e,"historyAdded")}function Bi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,Y(i.done),t))?i.done[i.done.length-1]=t:Vi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Ri(i.undone)}function Vi(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Gi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Ui(e){if(!e)return null;for(var t,n=0;n-1&&(Y(a)[f]=u[f],delete u[f])}}}return r}function Xi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=tt(t,i)<0;o!=tt(n,i)<0?(i=t,t=n):o!=tt(t,n)<0&&(t=n)}return new Si(i,t)}return new Si(n||t,t)}function Yi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Qi(e,new Ci([Xi(e.sel.primary(),t,n,i)],0),r)}function qi(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:a.to>t.ch))){if(i&&(pe(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!s.atomic)continue;if(n){var f=s.find(r<0?1:-1),h=void 0;if((r<0?c:u)&&(f=lo(e,f,-r,f&&f.line==t.line?o:null)),f&&f.line==t.line&&(h=tt(f,n))&&(r<0?h<0:h>0))return io(e,f,t,r,i)}var d=s.find(r<0?-1:1);return(r<0?u:c)&&(d=lo(e,d,r,d.line==t.line?o:null)),d?io(e,d,t,r,i):null}}return t}function oo(e,t,n,r,i){var o=r||1,l=io(e,t,n,o,i)||!i&&io(e,t,n,o,!0)||io(e,t,n,-o,i)||!i&&io(e,t,n,-o,!0);return l||(e.cantEdit=!0,et(e.first,0))}function lo(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?at(e,et(t.line-1)):null:n>0&&t.ch==(r||Ke(e,t.line)).text.length?t.line0)){var c=[s,1],f=tt(u.from,a.from),h=tt(u.to,a.to);(f<0||!l.inclusiveLeft&&!f)&&c.push({from:u.from,to:a.from}),(h>0||!l.inclusiveRight&&!h)&&c.push({from:a.to,to:u.to}),i.splice.apply(i,c),s+=c.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)co(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else co(e,t)}}function co(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=Mi(e,t);ji(e,t,n,e.cm?e.cm.curOp.id:NaN),po(e,t,n,Tt(e,t));var r=[];Fi(e,(function(e,n){n||-1!=j(r,e.history)||(yo(e.history,t),r.push(e.history)),po(e,t,null,Tt(e,t))}))}}function fo(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,l=e.sel,a="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,u=0;u=0;--d){var p=h(d);if(p)return p.v}}}}function ho(e,t){if(0!=t&&(e.first+=t,e.sel=new Ci(q(e.sel.ranges,(function(e){return new Si(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){fr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:et(o,Ke(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Xe(e,t.from,t.to),n||(n=Mi(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=Ze(Pt(Ke(r,o.line))),r.iter(s,l.line+1,(function(e){if(e==i.maxLine)return a=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ve(e),Wi(r,t,n,ar(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,(function(e){var t=Ut(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)})),a&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=Ke(e,r).stateAfter;if(i&&(!(i instanceof ut)||r+i.lookAhead1||!(this.children[0]instanceof wo))){var a=[];this.collapse(a),this.children=[new wo(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var l=i.lines.length%25+25,a=l;a10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==l&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=A("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(It(e,t.line,t,n,o)||t.line!=n.line&&It(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ct=!0}o.addToHistory&&ji(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,s=t.line,u=e.cm;if(e.iter(s,n.line+1,(function(e){u&&o.collapsed&&!u.options.lineWrapping&&Pt(e)==u.display.maxLine&&(a=!0),o.collapsed&&s!=t.line&&qe(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new St(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){Bt(e,t)&&qe(t,0)})),o.clearOnEnter&&fe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(xt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ko,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)fr(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)hr(u,c,"text");o.atomic&&no(u.doc),sn(u,"markerAdded",u,o)}return o}Lo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Kr(e),me(this,"clear")){var n=this.find();n&&sn(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&fr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&no(e.doc)),e&&sn(e,"markerCleared",e,this,r,i),t&&Xr(e),this.parent&&this.parent.clear()}},Lo.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;s--)uo(this,r[s]);a?Ji(this,a):this.cm&&Er(this.cm)})),undo:ni((function(){fo(this,"undo")})),redo:ni((function(){fo(this,"redo")})),undoSelection:ni((function(){fo(this,"undo",!0)})),redoSelection:ni((function(){fo(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=at(this,e),t=at(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var l=o.markedSpans;if(l)for(var a=0;a=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),at(this,et(n,t))},indexFromPos:function(e){var t=(e=at(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=e.dataTransfer.getData("Text");if(f){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),eo(t.doc,Li(n,n)),h)for(var d=0;d=0;t--)go(e.doc,"",r[t].from,r[t].to,"+delete");Er(e)}))}function Jo(e,t,n){var r=ie(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Qo(e,t,n){var r=Jo(e,t.ch,n);return null==r?null:new et(t.line,r,n<0?"after":"before")}function el(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=ue(n,t.doc.direction);if(o){var l,a=i<0?Y(o):o[0],s=i<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var u=Dn(t,n);l=i<0?n.text.length-1:0;var c=Wn(t,u,l).top;l=oe((function(e){return Wn(t,u,e).top==c}),i<0==(1==a.level)?a.from:a.to-1,l),"before"==s&&(l=Jo(n,l,1))}else l=i<0?a.to:a.from;return new et(r,l,s)}}return new et(r,i<0?n.text.length:0,i<0?"before":"after")}Go.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Go.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Go.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Go.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Go.default=y?Go.macDefault:Go.pcDefault;var tl={selectAll:ao,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),V)},killLine:function(e){return $o(e,(function(t){if(t.empty()){var n=Ke(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new et(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),et(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=Ke(e.doc,i.line-1).text;l&&(i=new et(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),et(i.line-1,l.length-1),i,"+transpose"))}n.push(new Si(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Qr(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(tt((i=u.ranges[i]).from(),t)<0||t.xRel>0)&&(tt(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,u=ei(e,(function(t){s&&(i.scroller.draggable=!1),e.state.draggingText=!1,de(i.wrapper.ownerDocument,"mouseup",u),de(i.wrapper.ownerDocument,"mousemove",c),de(i.scroller,"dragstart",f),de(i.scroller,"drop",u),o||(be(t),r.addNew||Yi(e.doc,n,null,null,r.extend),s&&!h||l&&9==a?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return o=!0};s&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),fe(i.wrapper.ownerDocument,"mouseup",u),fe(i.wrapper.ownerDocument,"mousemove",c),fe(i.scroller,"dragstart",f),fe(i.scroller,"drop",u),Sr(e),setTimeout((function(){return i.input.focus()}),20)}(e,r,t,o):function(e,t,n,r){var i=e.display,o=e.doc;be(t);var l,a,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(a=o.sel.contains(n),l=a>-1?u[a]:new Si(n,n)):(l=o.sel.primary(),a=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(l=new Si(n,n)),n=ur(e,t,!0,!0),a=-1;else{var c=ml(e,n,r.unit);l=r.extend?Xi(l,c.anchor,c.head,r.extend):c}r.addNew?-1==a?(a=u.length,Qi(o,ki(e,u.concat([l]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&"char"==r.unit&&!r.extend?(Qi(o,ki(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):Zi(o,a,l,G):(a=0,Qi(o,new Ci([l],0),G),s=o.sel);var f=n;function h(t){if(0!=tt(f,t))if(f=t,"rectangle"==r.unit){for(var i=[],u=e.options.tabSize,c=P(Ke(o,n.line).text,n.ch,u),h=P(Ke(o,t.line).text,t.ch,u),d=Math.min(c,h),p=Math.max(c,h),g=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));g<=v;g++){var m=Ke(o,g).text,y=_(m,d,u);d==p?i.push(new Si(et(g,y),et(g,y))):m.length>y&&i.push(new Si(et(g,y),et(g,_(m,p,u))))}i.length||i.push(new Si(n,n)),Qi(o,ki(e,s.ranges.slice(0,a).concat(i),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=l,x=ml(e,t,r.unit),C=w.anchor;tt(x.anchor,C)>0?(b=x.head,C=ot(w.from(),x.anchor)):(b=x.anchor,C=it(w.to(),x.head));var S=s.ranges.slice(0);S[a]=function(e,t){var n=t.anchor,r=t.head,i=Ke(e.doc,n.line);if(0==tt(n,r)&&n.sticky==r.sticky)return t;var o=ue(i);if(!o)return t;var l=ae(o,n.ch,n.sticky),a=o[l];if(a.from!=n.ch&&a.to!=n.ch)return t;var s,u=l+(a.from==n.ch==(1!=a.level)?0:1);if(0==u||u==o.length)return t;if(r.line!=n.line)s=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=ae(o,r.ch,r.sticky),f=c-l||(r.ch-n.ch)*(1==a.level?-1:1);s=c==u-1||c==u?f<0:f>0}var h=o[u+(s?-1:0)],d=s==(1==h.level),p=d?h.from:h.to,g=d?"after":"before";return n.ch==p&&n.sticky==g?t:new Si(new et(n.line,p,g),r)}(e,new Si(at(o,C),b)),Qi(o,ki(e,S,a),G)}}var d=i.wrapper.getBoundingClientRect(),p=0;function g(t){e.state.selectingText=!1,p=1/0,t&&(be(t),i.input.focus()),de(i.wrapper.ownerDocument,"mousemove",v),de(i.wrapper.ownerDocument,"mouseup",m),o.history.lastSelOrigin=null}var v=ei(e,(function(t){0!==t.buttons&&ke(t)?function t(n){var l=++p,a=ur(e,n,!0,"rectangle"==r.unit);if(a)if(0!=tt(a,f)){e.curOp.focus=D(),h(a);var s=Mr(i,o);(a.line>=s.to||a.lined.bottom?20:0;u&&setTimeout(ei(e,(function(){p==l&&(i.scroller.scrollTop+=u,t(n))})),50)}}(t):g(t)})),m=ei(e,g);e.state.selectingText=m,fe(i.wrapper.ownerDocument,"mousemove",v),fe(i.wrapper.ownerDocument,"mouseup",m)}(e,r,t,o)}(t,r,o,e):Se(e)==n.scroller&&be(e):2==i?(r&&Yi(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(S?t.display.input.onContextMenu(e):Sr(t)))}}function ml(e,t,n){if("char"==n)return new Si(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Si(et(t.line,0),at(e.doc,et(t.line+1,0)));var r=n(e,t);return new Si(r.from,r.to)}function yl(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&be(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!me(e,n))return xe(t);o-=a.top-l.viewOffset;for(var s=0;s=i)return pe(e,n,e,$e(e.doc,o),e.display.gutterSpecs[s].className,t),xe(t)}}function bl(e,t){return yl(e,t,"gutterClick",!0)}function wl(e,t){Cn(e.display,t)||function(e,t){return!!me(e,"gutterContextMenu")&&yl(e,t,"gutterContextMenu",!1)}(e,t)||ge(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function xl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),jn(e)}gl.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var Cl={toString:function(){return"CodeMirror.Init"}},Sl={},kl={};function Ll(e,t,n){if(!t!=!(n&&n!=Cl)){var r=e.display.dragFunctions,i=t?fe:de;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Tl(e){e.options.lineWrapping?(W(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),_t(e)),sr(e),fr(e),jn(e),setTimeout((function(){return Br(e)}),100)}function Ol(e,t){var n=this;if(!(this instanceof Ol))return new Ol(e,t);this.options=t=t?I(t):{},I(Sl,t,!1);var r=t.value;"string"==typeof r?r=new Eo(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ol.inputStyles[t.inputStyle](this),o=this.display=new vi(e,r,i,t);for(var u in o.wrapper.CodeMirror=this,xl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ur(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new R,keySeq:null,specialChars:null},t.autofocus&&!m&&o.input.focus(),l&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;fe(t.scroller,"mousedown",ei(e,vl)),fe(t.scroller,"dblclick",l&&a<11?ei(e,(function(t){if(!ge(e,t)){var n=ur(e,t);if(n&&!bl(e,t)&&!Cn(e.display,t)){be(t);var r=e.findWordAt(n);Yi(e.doc,r.anchor,r.head)}}})):function(t){return ge(e,t)||be(t)}),fe(t.scroller,"contextmenu",(function(t){return wl(e,t)})),fe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||wl(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}fe(t.scroller,"touchstart",(function(i){if(!ge(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!bl(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),fe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),fe(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Cn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var l,a=e.coordsChar(t.activeTouch,"page");l=!r.prev||o(r,r.prev)?new Si(a,a):!r.prev.prev||o(r,r.prev.prev)?e.findWordAt(a):new Si(et(a.line,0),at(e.doc,et(a.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),be(n)}i()})),fe(t.scroller,"touchcancel",i),fe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Hr(e,t.scroller.scrollTop),Ir(e,t.scroller.scrollLeft,!0),pe(e,"scroll",e))})),fe(t.scroller,"mousewheel",(function(t){return xi(e,t)})),fe(t.scroller,"DOMMouseScroll",(function(t){return xi(e,t)})),fe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ge(e,t)||Ce(t)},over:function(t){ge(e,t)||(function(e,t){var n=ur(e,t);if(n){var r=document.createDocumentFragment();yr(e,n,r),e.display.dragCursor||(e.display.dragCursor=N("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),M(e.display.dragCursor,r)}}(e,t),Ce(t))},start:function(t){return function(e,t){if(l&&(!e.state.draggingText||+new Date-Do<100))Ce(t);else if(!ge(e,t)&&!Cn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h)){var n=N("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),f&&n.parentNode.removeChild(n)}}(e,t)},drop:ei(e,Wo),leave:function(t){ge(e,t)||Fo(e)}};var s=t.input.getField();fe(s,"keyup",(function(t){return fl.call(e,t)})),fe(s,"keydown",ei(e,cl)),fe(s,"keypress",ei(e,hl)),fe(s,"focus",(function(t){return kr(e,t)})),fe(s,"blur",(function(t){return Lr(e,t)}))}(this),Io(),Kr(this),this.curOp.forceUpdate=!0,Hi(this,r),t.autofocus&&!m||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&kr(n)}),20):Lr(this),kl)kl.hasOwnProperty(u)&&kl[u](this,t[u],Cl);hi(this),t.finishInit&&t.finishInit(this);for(var c=0;c150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?P(Ke(o,t-1).text,null,l):0:"add"==n?u=s+e.options.indentUnit:"subtract"==n?u=s-e.options.indentUnit:"number"==typeof n&&(u=s+n),u=Math.max(0,u);var f="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)h+=l,f+="\t";if(hl,s=Ee(t),u=null;if(a&&r.ranges.length>1)if(Al&&Al.text.join("\n")==t){if(r.ranges.length%Al.text.length==0){u=[];for(var c=0;c=0;h--){var d=r.ranges[h],p=d.from(),g=d.to();d.empty()&&(n&&n>0?p=et(p.line,p.ch-n):e.state.overwrite&&!a?g=et(g.line,Math.min(Ke(o,g.line).text.length,g.ch+Y(s).length)):a&&Al&&Al.lineWise&&Al.text.join("\n")==s.join("\n")&&(p=g=et(p.line,0)));var v={from:p,to:g,text:u?u[h%u.length]:s,origin:i||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};uo(e.doc,v),sn(e,"inputRead",e,v)}t&&!a&&Fl(e,t),Er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Wl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Qr(t,(function(){return Dl(t,n,0,null,"paste")})),!0}function Fl(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a-1){l=Nl(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ke(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Nl(e,i.head.line,"smart"));l&&sn(e,"electricInput",e,i.head.line)}}}function Hl(e){for(var t=[],n=[],r=0;r0?0:-1));l=isNaN(c)?null:new et(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(c>=55296&&c<56320?2:1))),-n)}else l=i?function(e,t,n,r){var i=ue(t,e.doc.direction);if(!i)return Qo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ae(i,n.ch,n.sticky),l=i[o];if("ltr"==e.doc.direction&&l.level%2==0&&(r>0?l.to>n.ch:l.from=l.from&&h>=c.begin)){var d=f?"before":"after";return new et(n.line,h,d)}}var p=function(e,t,r){for(var o=function(e,t){return t?new et(n.line,s(e,1),"before"):new et(n.line,e,"after")};e>=0&&e0==(1!=l.level),u=a?r.begin:s(r.end,-1);if(l.from<=u&&u0?c.end:s(c.begin,-1);return null==v||r>0&&v==t.text.length||!(g=p(r>0?0:i.length-1,r,u(v)))?null:g}(e.cm,a,t,n):Qo(a,t,n);if(null==l){if(o||(u=t.line+s)=e.first+e.size||(t=new et(u,t.ch,t.sticky),!(a=Ke(e,u))))return!1;t=el(i,e.cm,a,t.line,s)}else t=l;return!0}if("char"==r||"codepoint"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var c=null,f="group"==r,h=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(n<0)||u(!d);d=!1){var p=a.text.charAt(t.ch)||"\n",g=ee(p,h)?"w":f&&"\n"==p?"n":!f||/\s/.test(p)?null:"p";if(!f||d||g||(g="s"),c&&c!=g){n<0&&(n=1,u(),t.sticky="after");break}if(g&&(c=g),n>0&&!u(!d))break}var v=oo(e,t,o,l,!0);return nt(o,v)&&(v.hitSide=!0),v}function Rl(e,t,n,r){var i,o,l=e.doc,a=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(s-.5*rr(e.display),3);i=(n>0?t.bottom:t.top)+n*u}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Zn(e,a,i)).outside;){if(n<0?i<=0:i>=l.height){o.hitSide=!0;break}i+=5*n}return o}var jl=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new R,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Bl(e,t){var n=En(e,t.line);if(!n||n.hidden)return null;var r=Ke(e.doc,t.line),i=Nn(n,r,t.line),o=ue(r,e.doc.direction),l="left";o&&(l=ae(o,t.ch)%2?"right":"left");var a=zn(i.map,t.ch,l);return a.offset="right"==a.collapse?a.end:a.start,a}function Vl(e,t){return t&&(e.bad=!0),e}function Gl(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Vl(e.clipPos(et(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i=t.display.viewTo||o.line=t.display.viewFrom&&Bl(t,i)||{node:s[0].measure.map[2],offset:0},c=o.liner.firstLine()&&(l=et(l.line-1,Ke(r.doc,l.line-1).length)),a.ch==Ke(r.doc,a.line).text.length&&a.linei.viewTo-1)return!1;l.line==i.viewFrom||0==(e=cr(r,l.line))?(t=Ze(i.view[0].line),n=i.view[0].node):(t=Ze(i.view[e].line),n=i.view[e-1].node.nextSibling);var s,u,c=cr(r,a.line);if(c==i.view.length-1?(s=i.viewTo-1,u=i.lineDiv.lastChild):(s=Ze(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var f=r.doc.splitLines(function(e,t,n,r,i){var o="",l=!1,a=e.doc.lineSeparator(),s=!1;function u(){l&&(o+=a,s&&(o+=a),l=s=!1)}function c(e){e&&(u(),o+=e)}function f(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void c(n);var o,h=t.getAttribute("cm-marker");if(h){var d=e.findMarks(et(r,0),et(i+1,0),(v=+h,function(e){return e.id==v}));return void(d.length&&(o=d[0].find(0))&&c(Xe(e.doc,o.from,o.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&u();for(var g=0;g1&&h.length>1;)if(Y(f)==Y(h))f.pop(),h.pop(),s--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),t++}for(var d=0,p=0,g=f[0],v=h[0],m=Math.min(g.length,v.length);dl.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)d--,p++;f[f.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var x=et(t,d),C=et(s,h.length?Y(h).length-p:0);return f.length>1||f[0]||tt(x,C)?(go(r.doc,f,x,C,"+input"),!0):void 0},jl.prototype.ensurePolled=function(){this.forceCompositionEnd()},jl.prototype.reset=function(){this.forceCompositionEnd()},jl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},jl.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},jl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Qr(this.cm,(function(){return fr(e.cm)}))},jl.prototype.setUneditable=function(e){e.contentEditable="false"},jl.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ei(this.cm,Dl)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},jl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},jl.prototype.onContextMenu=function(){},jl.prototype.resetPosition=function(){},jl.prototype.needsContentAttribute=!0;var _l=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new R,this.hasSelection=!1,this.composing=null};_l.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ge(r,e)){if(r.somethingSelected())El({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Hl(r);El({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,V):(n.prevInput="",i.value=t.text.join("\n"),H(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),fe(i,"input",(function(){l&&a>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),fe(i,"paste",(function(e){ge(r,e)||Wl(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),fe(i,"cut",o),fe(i,"copy",o),fe(e.scroller,"paste",(function(t){if(!Cn(e,t)&&!ge(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),fe(e.lineSpace,"selectstart",(function(t){Cn(e,t)||be(t)})),fe(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),fe(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},_l.prototype.createField=function(e){this.wrapper=Il(),this.textarea=this.wrapper.firstChild},_l.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},_l.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=mr(e);if(e.options.moveInputWithCursor){var i=Xn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return r},_l.prototype.showSelection=function(e){var t=this.cm.display;M(t.cursorDiv,e.cursors),M(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},_l.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&H(this.textarea),l&&a>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",l&&a>=9&&(this.hasSelection=null))}},_l.prototype.getField=function(){return this.textarea},_l.prototype.supportsTouch=function(){return!1},_l.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||D()!=this.textarea))try{this.textarea.focus()}catch(e){}},_l.prototype.blur=function(){this.textarea.blur()},_l.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},_l.prototype.receivedFocus=function(){this.slowPoll()},_l.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},_l.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},_l.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||De(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(l&&a>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var s=0,u=Math.min(r.length,i.length);s1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},_l.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},_l.prototype.onKeyPress=function(){l&&a>=9&&(this.hasSelection=null),this.fastPoll()},_l.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=ur(n,e),u=r.scroller.scrollTop;if(o&&!f){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ei(n,Qi)(n.doc,Li(o),V);var c,h=i.style.cssText,d=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(c=window.scrollY),r.input.focus(),s&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=m,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),l&&a>=9&&v(),S){Ce(e);var g=function(){de(window,"mouseup",g),setTimeout(m,20)};fe(window,"mouseup",g)}else setTimeout(m,50)}function v(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function m(){if(t.contextMenuPending==m&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=h,l&&a<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart)){(!l||l&&a<9)&&v();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?ei(n,ao)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},_l.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},_l.prototype.setUneditable=function(){},_l.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Cl&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Cl,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Ai(e)}),!0),n("indentUnit",2,Ai,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Ei(e),jn(e),fr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(et(r,o))}r++}));for(var i=n.length-1;i>=0;i--)go(e.doc,t,n[i],et(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Cl&&e.refresh()})),n("specialCharPlaceholder",Jt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",m?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){xl(e),gi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Zo(t),i=n!=Cl&&Zo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Tl,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=di(t,e.options.lineNumbers),gi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?lr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Br(e)}),!0),n("scrollbarStyle","native",(function(e){Ur(e),Br(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=di(e.options.gutters,t),gi(e)}),!0),n("firstLineNumber",1,gi,!0),n("lineNumberFormatter",(function(e){return e}),gi,!0),n("showCursorWhenSelecting",!1,vr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Lr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Ll),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vr,!0),n("singleCursorHeightPerLine",!0,vr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ei,!0),n("addModeClass",!1,Ei,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Ei,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Ol),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&ei(this,t[e])(this,n,i),pe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Zo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(Nl(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Er(this));else{var o=i.from(),l=i.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var s=a;s0&&Zi(this.doc,r,new Si(o,u[r].to()),V)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=at(this.doc,e);var t,n=ht(this,Ke(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var l=r+i>>1;if((l?n[2*l-1]:0)>=o)i=l;else{if(!(n[2*l+1]o&&(e=o,i=!0),r=Ke(this.doc,e)}else r=e;return Un(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Gt(r):0)},defaultTextHeight:function(){return rr(this.display)},defaultCharWidth:function(){return ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,l,a,s=this.display,u=(e=Xn(this,at(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==r)u=e.top;else if("above"==r||"near"==r){var f=Math.max(s.wrapper.clientHeight,this.doc.height),h=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>f)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=f&&(u=e.bottom),c+t.offsetWidth>h&&(c=h-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==i?(c=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(o=this,l={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(a=Nr(o,l)).scrollTop&&Hr(o,a.scrollTop),null!=a.scrollLeft&&Ir(o,a.scrollLeft))},triggerOnKeyDown:ti(cl),triggerOnKeyPress:ti(hl),triggerOnKeyUp:fl,triggerOnMouseDown:ti(vl),execCommand:function(e){if(tl.hasOwnProperty(e))return tl[e].call(null,this)},triggerElectric:ti((function(e){Fl(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=at(this.doc,e),l=0;l0&&l(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&sr(this),pe(this,"refresh",this)})),swapDoc:ti((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Hi(this,e),jn(this),this.display.input.reset(),Dr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sn(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ye(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(Ol);var Kl="iter insert remove copy getEditor constructor".split(" ");for(var Xl in Eo.prototype)Eo.prototype.hasOwnProperty(Xl)&&j(Kl,Xl)<0&&(Ol.prototype[Xl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Eo.prototype[Xl]));return ye(Eo),Ol.inputStyles={textarea:_l,contenteditable:jl},Ol.defineMode=function(e){Ol.defaults.mode||"null"==e||(Ol.defaults.mode=e),Ie.apply(this,arguments)},Ol.defineMIME=function(e,t){ze[e]=t},Ol.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ol.defineMIME("text/plain","null"),Ol.defineExtension=function(e,t){Ol.prototype[e]=t},Ol.defineDocExtension=function(e,t){Eo.prototype[e]=t},Ol.fromTextArea=function(e,t){if((t=t?I(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=D();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=a.getValue()}var i;if(e.form&&(fe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(de(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var a=Ol((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return a},function(e){e.off=de,e.on=fe,e.wheelEventPixels=wi,e.Doc=Eo,e.splitLines=Ee,e.countColumn=P,e.findColumn=_,e.isWordChar=Q,e.Pass=B,e.signal=pe,e.Line=Kt,e.changeEnd=Ti,e.scrollbarModel=Gr,e.Pos=et,e.cmpPos=tt,e.modes=He,e.mimeModes=ze,e.resolveMode=Pe,e.getMode=Re,e.modeExtensions=je,e.extendMode=Be,e.copyState=Ve,e.startState=Ue,e.innerMode=Ge,e.commands=tl,e.keyMap=Go,e.keyName=qo,e.isModifierKey=Xo,e.lookupKey=Ko,e.normalizeKeyMap=_o,e.StringStream=_e,e.SharedTextMarker=Oo,e.TextMarker=Lo,e.LineWidget=Co,e.e_preventDefault=be,e.e_stopPropagation=we,e.e_stop=Ce,e.addClass=W,e.contains=E,e.rmClass=T,e.keyNames=Ro}(Ol),Ol.version="5.58.2",Ol}()},Y1PL: /*!**********************************************************!*\ !*** ./node_modules/rc-textarea/es/index.js + 7 modules ***! \**********************************************************/ /*! exports provided: ResizableTextArea, default */ /*! all exports used */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/findDOMNode.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/omit.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/ref.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";n.r(t),n.d(t,"ResizableTextArea",(function(){return W}));var r=n("wx14"),i=n("1OyB"),o=n("vuIU"),l=n("Ji7U"),a=n("LK+K"),s=n("q1tI"),u=n("VTBJ"),c=n("rePB"),f=n("Zm9Q"),h=(n("Kwbf"),n("c+Xe")),d=n("m+aA"),p=n("bdgK"),g=new Map;var v=new p.default((function(e){e.forEach((function(e){var t,n=e.target;null===(t=g.get(n))||void 0===t||t.forEach((function(e){return e(n)}))}))}));var m=function(e){Object(l.a)(n,e);var t=Object(a.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"render",value:function(){return this.props.children}}]),n}(s.Component),y=s.createContext(null);function b(e){var t=e.children,n=e.disabled,r=s.useRef(null),i=s.useRef(null),o=s.useContext(y),l=s.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),a=s.isValidElement(t)&&Object(h.c)(t),c=a?t.ref:null,f=s.useMemo((function(){return Object(h.a)(c,r)}),[c,r]),p=s.useRef(e);p.current=e;var b=s.useCallback((function(e){var t=p.current,n=t.onResize,r=t.data,i=e.getBoundingClientRect(),a=i.width,s=i.height,c=e.offsetWidth,f=e.offsetHeight,h=Math.floor(a),d=Math.floor(s);if(l.current.width!==h||l.current.height!==d||l.current.offsetWidth!==c||l.current.offsetHeight!==f){var g={width:h,height:d,offsetWidth:c,offsetHeight:f};l.current=g;var v=c===Math.round(a)?a:c,m=f===Math.round(s)?s:f,y=Object(u.a)(Object(u.a)({},g),{},{offsetWidth:v,offsetHeight:m});null==o||o(y,e,r),n&&Promise.resolve().then((function(){n(y,e)}))}}),[]);return s.useEffect((function(){var e,t,o=Object(d.a)(r.current)||Object(d.a)(i.current);return o&&!n&&(e=o,t=b,g.has(e)||(g.set(e,new Set),v.observe(e)),g.get(e).add(t)),function(){return function(e,t){g.has(e)&&(g.get(e).delete(t),g.get(e).size||(v.unobserve(e),g.delete(e)))}(o,b)}}),[r.current,n]),s.createElement(m,{ref:i},a?s.cloneElement(t,{ref:f}):t)}function w(e){var t=e.children;return Object(f.a)(t).map((function(t,n){var i=(null==t?void 0:t.key)||"".concat("rc-observer-key","-").concat(n);return s.createElement(b,Object(r.a)({},e,{key:i}),t)}))}w.Collection=function(e){var t=e.children,n=e.onBatchResize,r=s.useRef(0),i=s.useRef([]),o=s.useContext(y),l=s.useCallback((function(e,t,l){r.current+=1;var a=r.current;i.current.push({size:e,element:t,data:l}),Promise.resolve().then((function(){a===r.current&&(null==n||n(i.current),i.current=[])})),null==o||o(e,t,l)}),[n,o]);return s.createElement(y.Provider,{value:l},t)};var x,C=w,S=n("bT9E"),k=n("TSYQ"),L=n.n(k),T="\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",O=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],M={};function N(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&M[n])return M[n];var r=window.getComputedStyle(e),i=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),o=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),l=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),a=O.map((function(e){return"".concat(e,":").concat(r.getPropertyValue(e))})).join(";"),s={sizingStyle:a,paddingSize:o,borderSize:l,boxSizing:i};return t&&n&&(M[n]=s),s}var A,E=n("Gytx"),D=n.n(E);!function(e){e[e.NONE=0]="NONE",e[e.RESIZING=1]="RESIZING",e[e.RESIZED=2]="RESIZED"}(A||(A={}));var W=function(e){Object(l.a)(n,e);var t=Object(a.a)(n);function n(e){var o;return Object(i.a)(this,n),(o=t.call(this,e)).nextFrameActionId=void 0,o.resizeFrameId=void 0,o.textArea=void 0,o.saveTextArea=function(e){o.textArea=e},o.handleResize=function(e){var t=o.state.resizeStatus,n=o.props,r=n.autoSize,i=n.onResize;t===A.NONE&&("function"==typeof i&&i(e),r&&o.resizeOnNextFrame())},o.resizeOnNextFrame=function(){cancelAnimationFrame(o.nextFrameActionId),o.nextFrameActionId=requestAnimationFrame(o.resizeTextarea)},o.resizeTextarea=function(){var e=o.props.autoSize;if(e&&o.textArea){var t=e.minRows,n=e.maxRows,r=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;x||((x=document.createElement("textarea")).setAttribute("tab-index","-1"),x.setAttribute("aria-hidden","true"),document.body.appendChild(x)),e.getAttribute("wrap")?x.setAttribute("wrap",e.getAttribute("wrap")):x.removeAttribute("wrap");var i=N(e,t),o=i.paddingSize,l=i.borderSize,a=i.boxSizing,s=i.sizingStyle;x.setAttribute("style","".concat(s,";").concat(T)),x.value=e.value||e.placeholder||"";var u,c=Number.MIN_SAFE_INTEGER,f=Number.MAX_SAFE_INTEGER,h=x.scrollHeight;if("border-box"===a?h+=l:"content-box"===a&&(h-=o),null!==n||null!==r){x.value=" ";var d=x.scrollHeight-o;null!==n&&(c=d*n,"border-box"===a&&(c=c+o+l),h=Math.max(c,h)),null!==r&&(f=d*r,"border-box"===a&&(f=f+o+l),u=h>f?"":"hidden",h=Math.min(f,h))}return{height:h,minHeight:c,maxHeight:f,overflowY:u,resize:"none"}}(o.textArea,!1,t,n);o.setState({textareaStyles:r,resizeStatus:A.RESIZING},(function(){cancelAnimationFrame(o.resizeFrameId),o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:A.RESIZED},(function(){o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:A.NONE}),o.fixFirefoxAutoScroll()}))}))}))}))}},o.renderTextArea=function(){var e=o.props,t=e.prefixCls,n=void 0===t?"rc-textarea":t,i=e.autoSize,l=e.onResize,a=e.className,f=e.disabled,h=o.state,d=h.textareaStyles,p=h.resizeStatus,g=Object(S.a)(o.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),v=L()(n,a,Object(c.a)({},"".concat(n,"-disabled"),f));"value"in g&&(g.value=g.value||"");var m=Object(u.a)(Object(u.a)(Object(u.a)({},o.props.style),d),p===A.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return s.createElement(C,{onResize:o.handleResize,disabled:!(i||l)},s.createElement("textarea",Object(r.a)({},g,{className:v,style:m,ref:o.saveTextArea})))},o.state={textareaStyles:{},resizeStatus:A.NONE},o}return Object(o.a)(n,[{key:"componentDidUpdate",value:function(e){e.value===this.props.value&&D()(e.autoSize,this.props.autoSize)||this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var e=this.textArea.selectionStart,t=this.textArea.selectionEnd;this.textArea.setSelectionRange(e,t)}}catch(e){}}},{key:"render",value:function(){return this.renderTextArea()}}]),n}(s.Component),F=function(e){Object(l.a)(n,e);var t=Object(a.a)(n);function n(e){var r;Object(i.a)(this,n),(r=t.call(this,e)).resizableTextArea=void 0,r.focus=function(){r.resizableTextArea.textArea.focus()},r.saveTextArea=function(e){r.resizableTextArea=e},r.handleChange=function(e){var t=r.props.onChange;r.setValue(e.target.value,(function(){r.resizableTextArea.resizeTextarea()})),t&&t(e)},r.handleKeyDown=function(e){var t=r.props,n=t.onPressEnter,i=t.onKeyDown;13===e.keyCode&&n&&n(e),i&&i(e)};var o=void 0===e.value||null===e.value?e.defaultValue:e.value;return r.state={value:o},r}return Object(o.a)(n,[{key:"setValue",value:function(e,t){"value"in this.props||this.setState({value:e},t)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return s.createElement(W,Object(r.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(e){return"value"in e?{value:e.value}:null}}]),n}(s.Component);t.default=F},ZpRC: /*!*************************************************************************!*\ !*** ./node_modules/scroll-into-view-if-needed/es/index.js + 1 modules ***! \*************************************************************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,n){"use strict";function r(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function i(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function o(e,t){if(e.clientHeightt||o>e&&l=t&&a>=n?o-e-r:l>t&&an?l-t+i:0}var a=function(e,t){var n=window,i=t.scrollMode,a=t.block,s=t.inline,u=t.boundary,c=t.skipOverflowHiddenElements,f="function"==typeof u?u:function(e){return e!==u};if(!r(e))throw new TypeError("Invalid target");for(var h=document.scrollingElement||document.documentElement,d=[],p=e;r(p)&&f(p);){if((p=p.parentElement)===h){d.push(p);break}null!=p&&p===document.body&&o(p)&&!o(document.documentElement)||null!=p&&o(p,c)&&d.push(p)}for(var g=n.visualViewport?n.visualViewport.width:innerWidth,v=n.visualViewport?n.visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,b=e.getBoundingClientRect(),w=b.height,x=b.width,C=b.top,S=b.right,k=b.bottom,L=b.left,T="start"===a||"nearest"===a?C:"end"===a?k:C+w/2,O="center"===s?L+x/2:"end"===s?S:L,M=[],N=0;N=0&&L>=0&&k<=v&&S<=g&&C>=F&&k<=z&&L>=I&&S<=H)return M;var P=getComputedStyle(A),R=parseInt(P.borderLeftWidth,10),j=parseInt(P.borderTopWidth,10),B=parseInt(P.borderRightWidth,10),V=parseInt(P.borderBottomWidth,10),G=0,U=0,_="offsetWidth"in A?A.offsetWidth-A.clientWidth-R-B:0,K="offsetHeight"in A?A.offsetHeight-A.clientHeight-j-V:0;if(h===A)G="start"===a?T:"end"===a?T-v:"nearest"===a?l(y,y+v,v,j,V,y+T,y+T+w,w):T-v/2,U="start"===s?O:"center"===s?O-g/2:"end"===s?O-g:l(m,m+g,g,R,B,m+O,m+O+x,x),G=Math.max(0,G+y),U=Math.max(0,U+m);else{G="start"===a?T-F-j:"end"===a?T-z+V+K:"nearest"===a?l(F,z,D,j,V+K,T,T+w,w):T-(F+D/2)+K/2,U="start"===s?O-I-R:"center"===s?O-(I+W/2)+_/2:"end"===s?O-H+B+_:l(I,H,W,R,B+_,O,O+x,x);var X=A.scrollLeft,Y=A.scrollTop;T+=Y-(G=Math.max(0,Math.min(Y+G,A.scrollHeight-D+K))),O+=X-(U=Math.max(0,Math.min(X+U,A.scrollWidth-W+_)))}M.push({el:A,top:G,left:U})}return M};function s(e){return e===Object(e)&&0!==Object.keys(e).length}t.a=function(e,t){var n=!e.ownerDocument.documentElement.contains(e);if(s(t)&&"function"==typeof t.behavior)return t.behavior(n?[]:a(e,t));if(!n){var r=function(e){return!1===e?{block:"end",inline:"nearest"}:s(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach((function(e){var r=e.el,i=e.top,o=e.left;r.scroll&&n?r.scroll({top:i,left:o,behavior:t}):(r.scrollTop=i,r.scrollLeft=o)}))}(a(e,r),r.behavior)}}},bT9E: /*!*****************************************!*\ !*** ./node_modules/rc-util/es/omit.js ***! \*****************************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ");function i(e,t){var n=Object(r.a)({},e);return Array.isArray(t)&&t.forEach((function(e){delete n[e]})),n}},baNF: /*!***************************************************************!*\ !*** ./src/pages/Shixuns/Detail/Repository/AddFile/index.tsx ***! \***************************************************************/ /*! exports provided: default */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/.umi-production/core/routes.ts (referenced with import()) */function(e,t,n){"use strict";n.r(t);n(/*! antd/es/input/style */"5NDa");var r=n(/*! antd/es/input */"5rEg"),i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator */"9og8"),l=(n(/*! antd/es/form/style */"y8nQ"),n(/*! antd/es/form */"Vl3Y")),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),s=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties */"PpiC"),u=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator */"WmNS"),c=n.n(u),f=n(/*! react */"q1tI"),h=n.n(f),d=n(/*! umi */"Ty5D"),p=n(/*! umi */"9kvl"),g=n(/*! @/components/markdown-editor/code-block */"7ahc"),v=n(/*! @/components/FixedButton */"9ZNV"),m=n(/*! ./index.less?modules */"y37m"),y=n.n(m);t.default=Object(p.a)((function(e){var t=e.shixunsDetail,n=e.loading;return{shixunsDetail:t,globalSetting:e.globalSetting,user:e.user,loading:n.models.index}}))((function(e){e.shixunsDetail,e.globalSetting,e.loading,e.user;var t=e.dispatch,n=(Object(s.a)(e,["shixunsDetail","globalSetting","loading","user","dispatch"]),Object(d.h)()),u=Object(f.useState)({}),m=Object(a.a)(u,2),b=(m[0],m[1]),w=Object(f.useRef)(),x=Object(f.useRef)(),C=l.a.useForm(),S=Object(a.a)(C,1)[0],k=Object(f.useState)(""),L=Object(a.a)(k,2),T=L[0],O=L[1];Object(f.useEffect)((function(){return t({type:"globalSetting/footerToggle",payload:!1}),function(){t({type:"globalSetting/footerToggle",payload:!0})}}),[]),Object(f.useEffect)((function(){var e=sessionStorage.getItem("pathArray");if(e){var t=e.split(",").join("/"),n=0===t.indexOf("/")?t.substr(1):t;O(n)}}),[]),Object(f.useEffect)((function(){var e,t,r,i;x.current=null===(e=n.pathname)||void 0===e||null===(t=e.split("/"))||void 0===t?void 0:t[2],w.current="repository"===(null===(r=n.pathname)||void 0===r||null===(i=r.split("/"))||void 0===i?void 0:i[3])}),[]);var M=function(){var e=Object(o.a)(c.a.mark((function e(){var n,r,i=arguments;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>0&&void 0!==i[0]?i[0]:{},e.next=3,t({type:"shixunsDetail/addRepositoryFile",payload:{id:x.current,message:n.commitMessage,content:n.codeMirror,path:"".concat(T?"".concat(T,"/"):"").concat(n.path||""),secret_repository:!w.current||void 0}});case 3:e.sent&&(r=w.current?"/shixuns/".concat(x.current,"/repository").concat(T?"/master/shixun_show/".concat(T):""):"/shixuns/".concat(x.current,"/secret_repository"),p.d.replace(r));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return h.a.createElement("section",{className:y.a.bg},h.a.createElement("div",{className:y.a.wrap},h.a.createElement("div",{className:y.a.title},"新建文件"),h.a.createElement(l.a,{className:"mt10",form:S,scrollToFirstError:!0,layout:"vertical",onFinish:M,onValuesChange:function(){return b(Object(i.a)({},S.getFieldsValue()))}},h.a.createElement(l.a.Item,{label:"文件名称或文件路径:"},h.a.createElement(l.a.Item,{name:"path",rules:[{required:!0,message:"请输入文件名称或文件路径"},{whitespace:!0,message:"请勿输入空格"}],noStyle:!0},h.a.createElement("span",null,h.a.createElement("span",{className:"mr5"},T?"".concat(T,"/"):""),h.a.createElement(r.a,{className:y.a.width240,placeholder:"请输入文件名称或文件路径"}))),h.a.createElement("span",{className:"ml5"},"提示:1.输入文件名可以创建一个新文件;2.输入新文件夹名/新文件名可以创建新文件夹和新文件。(如:step1/HelloWorld.java)")),h.a.createElement(l.a.Item,{label:"提交信息:",name:"commitMessage",rules:[{required:!0,message:"请输入提交信息"},{whitespace:!0,message:"请勿输入空格"}]},h.a.createElement(r.a,{placeholder:"请输入本次提交的主要信息,合理的描述信息有利于代码历史记录的管理"})),h.a.createElement("div",{className:"mt10 mb20"},h.a.createElement(l.a.Item,{name:"codeMirror",rules:[{required:!0,message:"请输入文件内容"}]},h.a.createElement(g.a,{options:{modal:"javascript",lineNumbers:!0,theme:"railscasts",indentUnit:4,matchBrackets:!0,autoRefresh:!0,smartIndent:!0,extraKeys:{"Alt-/":"autocomplete"},autofocus:!0,styleActiveLine:!0,lint:!0,linkurl:"",gutters:["CodeMirror-linenumbers","breakpoints","CodeMirror-lint-markers"]}}))),h.a.createElement(l.a.Item,{noStyle:!0},h.a.createElement(v.a,{okButtonProps:{htmlType:"submit"},onCancel:function(){var e,t;p.d.push("/shixuns/".concat(x.current,"/").concat(null===(e=n.pathname)||void 0===e||null===(t=e.split("/"))||void 0===t?void 0:t[3]).concat(T?"/master/shixun_show/".concat(T):""))}})))))}))},c5Ni: /*!******************************************************!*\ !*** ./node_modules/codemirror/theme/blackboard.css ***! \******************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},"p77/": /*!****************************************************!*\ !*** ./node_modules/codemirror/lib/codemirror.css ***! \****************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},y37m: /*!************************************************************************!*\ !*** ./src/pages/Shixuns/Detail/Repository/AddFile/index.less?modules ***! \************************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={bg:"bg___3LF6r",wrap:"wrap___2G3Cw",title:"title___1RMLx",path:"path___25SE5",colorBlue:"colorBlue___1sALU",width240:"width240___3YXUs"}}}]);