diff --git a/js/codepair.6db91fd8.js b/js/codepair.6db91fd8.js index 42c8593..fba2d37 100644 --- a/js/codepair.6db91fd8.js +++ b/js/codepair.6db91fd8.js @@ -1,4 +1,4 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["codepair"],{"0299":function(t,e,n){"use strict";var i,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),o=64,s={},a=0,l=0;function c(t){var e="";do{e=r[t%o]+e,t=Math.floor(t/o)}while(t>0);return e}function u(t){var e=0;for(l=0;l0&&t.jitter<=1?t.jitter:0,this.attempts=0}t.exports=n,n.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(t){this.ms=t},n.prototype.setMax=function(t){this.max=t},n.prototype.setJitter=function(t){this.jitter=t}},"0b6c":function(t,e,n){(function(t){t(n("56b3"),n("b933"),n("2aed"))})((function(t){"use strict";function e(t,e){return"string"==typeof t?t=new RegExp(t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),e?"gi":"g"):t.global||(t=new RegExp(t.source,t.ignoreCase?"gi":"g")),{token:function(e){t.lastIndex=e.pos;var n=t.exec(e.string);if(n&&n.index==e.pos)return e.pos+=n[0].length||1,"searching";n?e.pos=n.index:e.skipToEnd()}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function i(t){return t.state.search||(t.state.search=new n)}function r(t){return"string"==typeof t&&t==t.toLowerCase()}function o(t,e,n){return t.getSearchCursor(e,n,{caseFold:r(e),multiline:!0})}function s(t,e,n,i,r){t.openDialog(e,i,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){p(t)},onKeyDown:r,bottom:t.options.search.bottom})}function a(t,e,n,i,r){t.openDialog?t.openDialog(e,r,{value:i,selectValueOnOpen:!0,bottom:t.options.search.bottom}):r(prompt(n,i))}function l(t,e,n,i){t.openConfirm?t.openConfirm(e,i):confirm(n)&&i[0]()}function c(t){return t.replace(/\\([nrt\\])/g,(function(t,e){return"n"==e?"\n":"r"==e?"\r":"t"==e?"\t":"\\"==e?"\\":t}))}function u(t){var e=t.match(/^\/(.*)\/([a-z]*)$/);if(e)try{t=new RegExp(e[1],-1==e[2].indexOf("i")?"":"i")}catch(n){}else t=c(t);return("string"==typeof t?""==t:t.test(""))&&(t=/x^/),t}function h(t,n,i){n.queryText=i,n.query=u(i),t.removeOverlay(n.overlay,r(n.query)),n.overlay=e(n.query,r(n.query)),t.addOverlay(n.overlay),t.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=t.showMatchesOnScrollbar(n.query,r(n.query)))}function f(e,n,r,o){var l=i(e);if(l.query)return d(e,n);var c=e.getSelection()||l.lastQuery;if(c instanceof RegExp&&"x^"==c.source&&(c=null),r&&e.openDialog){var u=null,f=function(n,i){t.e_stop(i),n&&(n!=l.queryText&&(h(e,l,n),l.posFrom=l.posTo=e.getCursor()),u&&(u.style.opacity=1),d(e,i.shiftKey,(function(t,n){var i;n.line<3&&document.querySelector&&(i=e.display.wrapper.querySelector(".CodeMirror-dialog"))&&i.getBoundingClientRect().bottom-4>e.cursorCoords(n,"window").top&&((u=i).style.opacity=.4)})))};s(e,m(e),c,f,(function(n,r){var o=t.keyName(n),s=e.getOption("extraKeys"),a=s&&s[o]||t.keyMap[e.getOption("keyMap")][o];"findNext"==a||"findPrev"==a||"findPersistentNext"==a||"findPersistentPrev"==a?(t.e_stop(n),h(e,i(e),r),e.execCommand(a)):"find"!=a&&"findPersistent"!=a||(t.e_stop(n),f(r,n))})),o&&c&&(h(e,l,c),d(e,n))}else a(e,m(e),"Search for:",c,(function(t){t&&!l.query&&e.operation((function(){h(e,l,t),l.posFrom=l.posTo=e.getCursor(),d(e,n)}))}))}function d(e,n,r){e.operation((function(){var s=i(e),a=o(e,s.query,n?s.posFrom:s.posTo);(a.find(n)||(a=o(e,s.query,n?t.Pos(e.lastLine()):t.Pos(e.firstLine(),0)),a.find(n)))&&(e.setSelection(a.from(),a.to()),e.scrollIntoView({from:a.from(),to:a.to()},20),s.posFrom=a.from(),s.posTo=a.to(),r&&r(a.from(),a.to()))}))}function p(t){t.operation((function(){var e=i(t);e.lastQuery=e.query,e.query&&(e.query=e.queryText=null,t.removeOverlay(e.overlay),e.annotate&&(e.annotate.clear(),e.annotate=null))}))}function g(t,e){var n=t?document.createElement(t):document.createDocumentFragment();for(var i in e)n[i]=e[i];for(var r=2;r",triples:"",explode:"[]{}"},n=t.Pos;function i(t,n){return"pairs"==n&&"string"==typeof t?t:"object"==typeof t&&null!=t[n]?t[n]:e[n]}t.defineOption("autoCloseBrackets",!1,(function(e,n,s){s&&s!=t.Init&&(e.removeKeyMap(r),e.state.closeBrackets=null),n&&(o(i(n,"pairs")),e.state.closeBrackets=n,e.addKeyMap(r))}));var r={Backspace:l,Enter:c};function o(t){for(var e=0;e=0;l--){var u=s[l].head;e.replaceRange("",n(u.line,u.ch-1),n(u.line,u.ch+1),"+delete")}}function c(e){var n=a(e),r=n&&i(n,"explode");if(!r||e.getOption("disableInput"))return t.Pass;for(var o=e.listSelections(),s=0;s0?{line:s.head.line,ch:s.head.ch+e}:{line:s.head.line-1};n.push({anchor:a,head:a})}t.setSelections(n,r)}function h(e){var i=t.cmpPos(e.anchor,e.head)>0;return{anchor:new n(e.anchor.line,e.anchor.ch+(i?-1:1)),head:new n(e.head.line,e.head.ch+(i?1:-1))}}function f(e,r){var o=a(e);if(!o||e.getOption("disableInput"))return t.Pass;var s=i(o,"pairs"),l=s.indexOf(r);if(-1==l)return t.Pass;for(var c,f=i(o,"closeBefore"),d=i(o,"triples"),g=s.charAt(l+1)==r,m=e.listSelections(),v=l%2==0,y=0;y1&&d.indexOf(r)>=0&&e.getRange(n(x.line,x.ch-2),x)==r+r){if(x.ch>2&&/\bstring/.test(e.getTokenTypeAt(n(x.line,x.ch-2))))return t.Pass;b="addFour"}else if(g){var k=0==x.ch?" ":e.getRange(n(x.line,x.ch-1),x);if(t.isWordChar(C)||k==r||t.isWordChar(k))return t.Pass;b="both"}else{if(!v||!(0===C.length||/\s/.test(C)||f.indexOf(C)>-1))return t.Pass;b="both"}else b=g&&p(e,x)?"both":d.indexOf(r)>=0&&e.getRange(x,n(x.line,x.ch+3))==r+r+r?"skipThree":"skip";if(c){if(c!=b)return t.Pass}else c=b}var S=l%2?s.charAt(l-1):r,T=l%2?r:s.charAt(l+1);e.operation((function(){if("skip"==c)u(e,1);else if("skipThree"==c)u(e,3);else if("surround"==c){for(var t=e.getSelections(),n=0;n0&&void 0!==arguments[0]?arguments[0]:"";i(this,t),this.code=e,this.shadow=e,this.cursorPos=0,this.localVersion=0,this.remoteVersion=0,this.editStack=[]}return r(t,[{key:"makePatch",value:function(t,e){return s.patch_make(t,e)}},{key:"addLocalChange",value:function(){var t=this.makePatch(this.shadow,this.code);t.length&&(this.editStack.push({patch:t,version:this.localVersion}),this.applyPatchToShadow(t),this.localVersion++)}},{key:"receivePackage",value:function(t){for(var e=this.remoteVersion,n=0;n=this.cursorPos)break;r=t[a].start1;for(var l=0;lthis.code.length&&(this.cursorPos=this.code.length),n}},{key:"applyPatchToShadow",value:function(t){var e=s.patch_apply(t,this.shadow);this.shadow=e[0]}},{key:"pushPackage",value:function(){return this.addLocalChange(),{patches:this.editStack,latestVersion:this.remoteVersion}}},{key:"updateCursor",value:function(t,e){var n=0,i=0;while(i=0;n--)"\n"===this.code[n]&&(e++,-1==t&&(t=n));return{line:e,ch:this.cursorPos-1-t}}}]),t}();t.exports=a},"129f":function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},"1b2c":function(t,e,n){},"1f49":function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return f}));var i=n("34ba"),r=n("4f2a"),o=n.n(r),s=n("0299"),a=n.n(s),l=n("af7f"),c=n("744a"),u=n("33e8");const h="undefined"!==typeof navigator&&"string"===typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class f extends i["a"]{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),e=this.opts.protocols,n=h?{}:Object(l["b"])(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=c["d"]&&!h?e?new c["a"](t,e):new c["a"](t):new c["a"](t,e,n)}catch(i){return this.emit("error",i)}this.ws.binaryType=this.socket.binaryType||c["b"],this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=this.onClose.bind(this),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(e){this.writable=!1;for(let n=0;n{const n={};if(!c["d"]&&(i.options&&(n.compress=i.options.compress),this.opts.perMessageDeflate)){const i="string"===typeof e?t.byteLength(e):e.length;i{this.writable=!0,this.emit("drain")},this.setTimeoutFn)})}}doClose(){"undefined"!==typeof this.ws&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const e=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===e&&443!==Number(this.opts.port)||"ws"===e&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=a()()),this.supportsBinary||(t.b64=1);const i=o.a.encode(t),r=-1!==this.opts.hostname.indexOf(":");return e+"://"+(r?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(i.length?"?"+i:"")}check(){return!!c["a"]&&!("__initialize"in c["a"]&&this.name===f.prototype.name)}}}).call(this,n("b639").Buffer)},"1fb5":function(t,e,n){"use strict";e.byteLength=u,e.toByteArray=f,e.fromByteArray=g;for(var i=[],r=[],o="undefined"!==typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");-1===n&&(n=e);var i=n===e?0:4-n%4;return[n,i]}function u(t){var e=c(t),n=e[0],i=e[1];return 3*(n+i)/4-i}function h(t,e,n){return 3*(e+n)/4-n}function f(t){var e,n,i=c(t),s=i[0],a=i[1],l=new o(h(t,s,a)),u=0,f=a>0?s-4:s;for(n=0;n>16&255,l[u++]=e>>8&255,l[u++]=255&e;return 2===a&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,l[u++]=255&e),1===a&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e),l}function d(t){return i[t>>18&63]+i[t>>12&63]+i[t>>6&63]+i[63&t]}function p(t,e,n){for(var i,r=[],o=e;ol?l:a+s));return 1===r?(e=t[n-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===r&&(e=(t[n-2]<<8)+t[n-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"=")),o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},"20a4":function(t,e,n){"use strict";e["a"]=(()=>"undefined"!==typeof self?self:"undefined"!==typeof window?window:Function("return this")())()},"20f6":function(t,e,n){},"2aed":function(t,e,n){(function(t){t(n("56b3"))})((function(t){function e(e,n,i){var r,o=e.getWrapperElement();return r=o.appendChild(document.createElement("div")),r.className=i?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?r.innerHTML=n:r.appendChild(n),t.addClass(o,"dialog-opened"),r}function n(t,e){t.state.currentNotificationClose&&t.state.currentNotificationClose(),t.state.currentNotificationClose=e}t.defineExtension("openDialog",(function(i,r,o){o||(o={}),n(this,null);var s=e(this,i,o.bottom),a=!1,l=this;function c(e){if("string"==typeof e)h.value=e;else{if(a)return;a=!0,t.rmClass(s.parentNode,"dialog-opened"),s.parentNode.removeChild(s),l.focus(),o.onClose&&o.onClose(s)}}var u,h=s.getElementsByTagName("input")[0];return h?(h.focus(),o.value&&(h.value=o.value,!1!==o.selectValueOnOpen&&h.select()),o.onInput&&t.on(h,"input",(function(t){o.onInput(t,h.value,c)})),o.onKeyUp&&t.on(h,"keyup",(function(t){o.onKeyUp(t,h.value,c)})),t.on(h,"keydown",(function(e){o&&o.onKeyDown&&o.onKeyDown(e,h.value,c)||((27==e.keyCode||!1!==o.closeOnEnter&&13==e.keyCode)&&(h.blur(),t.e_stop(e),c()),13==e.keyCode&&r(h.value,e))})),!1!==o.closeOnBlur&&t.on(s,"focusout",(function(t){null!==t.relatedTarget&&c()}))):(u=s.getElementsByTagName("button")[0])&&(t.on(u,"click",(function(){c(),l.focus()})),!1!==o.closeOnBlur&&t.on(u,"blur",c),u.focus()),c})),t.defineExtension("openConfirm",(function(i,r,o){n(this,null);var s=e(this,i,o&&o.bottom),a=s.getElementsByTagName("button"),l=!1,c=this,u=1;function h(){l||(l=!0,t.rmClass(s.parentNode,"dialog-opened"),s.parentNode.removeChild(s),c.focus())}a[0].focus();for(var f=0;f{r[i[t]]=t});const o={type:"error",data:"parser error"},s="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),a="function"===typeof ArrayBuffer,l=t=>"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,c=({type:t,data:e},n,r)=>s&&e instanceof Blob?n?r(e):u(e,r):a&&(e instanceof ArrayBuffer||l(e))?n?r(e):u(new Blob([e]),r):r(i[t]+(e||"")),u=(t,e)=>{const n=new FileReader;return n.onload=function(){const t=n.result.split(",")[1];e("b"+t)},n.readAsDataURL(t)};for(var h=c,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d="undefined"===typeof Uint8Array?[]:new Uint8Array(256),p=0;p>4,u[l++]=(15&i)<<4|r>>2,u[l++]=(3&r)<<6|63&o;return c};const m="function"===typeof ArrayBuffer,v=(t,e)=>{if("string"!==typeof t)return{type:"message",data:b(t,e)};const n=t.charAt(0);if("b"===n)return{type:"message",data:y(t.substring(1),e)};const i=r[n];return i?t.length>1?{type:r[n],data:t.substring(1)}:{type:r[n]}:o},y=(t,e)=>{if(m){const n=g(t);return b(n,e)}return{base64:!0,data:t}},b=(t,e)=>{switch(e){case"blob":return t instanceof ArrayBuffer?new Blob([t]):t;case"arraybuffer":default:return t}};var w=v;const x=String.fromCharCode(30),C=(t,e)=>{const n=t.length,i=new Array(n);let r=0;t.forEach((t,o)=>{h(t,!1,t=>{i[o]=t,++r===n&&e(i.join(x))})})},k=(t,e)=>{const n=t.split(x),i=[];for(let r=0;r2),m=/Android/.test(t),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=g||/Mac/.test(e),b=/\bCrOS\b/.test(t),w=/win/i.test(e),x=h&&t.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(h=!1,l=!0);var C=y&&(c||h&&(null==x||x<12.11)),k=n||s&&a>=9;function S(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var T,L=function(t,e){var n=t.className,i=S(e).exec(n);if(i){var r=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function M(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function O(t,e){return M(t).appendChild(e)}function A(t,e,n,i){var r=document.createElement(t);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof e)r.appendChild(document.createTextNode(e));else if(e)for(var o=0;o=e)return s+(e-o);s+=a-o,s+=n-s%n,o=a+1}}g?P=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:s&&(P=function(t){try{t.select()}catch(e){}});var W=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};function j(t,e){for(var n=0;n=e)return i+Math.min(s,e-r);if(r+=o-i,r+=n-r%n,i=o+1,r>=e)return i}}var q=[""];function K(t){while(q.length<=t)q.push(G(q)+" ");return q[t]}function G(t){return t[t.length-1]}function X(t,e){for(var n=[],i=0;i"€"&&(t.toUpperCase()!=t.toLowerCase()||tt.test(t))}function nt(t,e){return e?!!(e.source.indexOf("\\w")>-1&&et(t))||e.test(t):et(t)}function it(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var rt=/[\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 ot(t){return t.charCodeAt(0)>=768&&rt.test(t)}function st(t,e,n){while((n<0?e>0:en?-1:1;;){if(e==n)return e;var r=(e+n)/2,o=i<0?Math.ceil(r):Math.floor(r);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+i}}function lt(t,e,n,i){if(!t)return i(e,n,"ltr",0);for(var r=!1,o=0;oe||e==n&&s.to==e)&&(i(Math.max(s.from,e),Math.min(s.to,n),1==s.level?"rtl":"ltr",o),r=!0)}r||i(e,n,"ltr")}var ct=null;function ut(t,e,n){var i;ct=null;for(var r=0;re)return r;o.to==e&&(o.from!=o.to&&"before"==n?i=r:ct=r),o.from==e&&(o.from!=o.to&&"before"!=n?i=r:ct=r)}return null!=i?i:ct}var ht=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?t.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?e.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,o=/[LRr]/,s=/[Lb1n]/,a=/[1n]/;function l(t,e,n){this.level=t,this.from=e,this.to=n}return function(t,e){var c="ltr"==e?"L":"R";if(0==t.length||"ltr"==e&&!i.test(t))return!1;for(var u=t.length,h=[],f=0;f-1&&(i[e]=r.slice(0,o).concat(r.slice(o+1)))}}}function vt(t,e){var n=gt(t,e);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r0}function xt(t){t.prototype.on=function(t,e){pt(this,t,e)},t.prototype.off=function(t,e){mt(this,t,e)}}function Ct(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function kt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function St(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Tt(t){Ct(t),kt(t)}function Lt(t){return t.target||t.srcElement}function Mt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var Ot,At,_t=function(){if(s&&a<9)return!1;var t=A("div");return"draggable"in t||"dragDrop"in t}();function Et(t){if(null==Ot){var e=A("span","​");O(t,A("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Ot=e.offsetWidth<=1&&e.offsetHeight>2&&!(s&&a<8))}var n=Ot?A("span","​"):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Nt(t){if(null!=At)return At;var e=O(t,document.createTextNode("AخA")),n=T(e,0,1).getBoundingClientRect(),i=T(e,1,2).getBoundingClientRect();return M(t),!(!n||n.left==n.right)&&(At=i.right-n.right<3)}var Dt=3!="\n\nb".split(/\n/).length?function(t){var e=0,n=[],i=t.length;while(e<=i){var r=t.indexOf("\n",e);-1==r&&(r=t.length);var o=t.slice(e,"\r"==t.charAt(r-1)?r-1:r),s=o.indexOf("\r");-1!=s?(n.push(o.slice(0,s)),e+=s+1):(n.push(o),e=r+1)}return n}:function(t){return t.split(/\r\n?|\n/)},Rt=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(e){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(n){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Pt=function(){var t=A("div");return"oncopy"in t||(t.setAttribute("oncopy","return;"),"function"==typeof t.oncopy)}(),Bt=null;function It(t){if(null!=Bt)return Bt;var e=O(t,A("span","x")),n=e.getBoundingClientRect(),i=T(e,0,1).getBoundingClientRect();return Bt=Math.abs(n.left-i.left)>1}var Ft={},Wt={};function jt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Ft[t]=e}function zt(t,e){Wt[t]=e}function Ht(t){if("string"==typeof t&&Wt.hasOwnProperty(t))t=Wt[t];else if(t&&"string"==typeof t.name&&Wt.hasOwnProperty(t.name)){var e=Wt[t.name];"string"==typeof e&&(e={name:e}),t=Q(e,t),t.name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Ht("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Ht("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Vt(t,e){e=Ht(e);var n=Ft[e.name];if(!n)return Vt(t,"text/plain");var i=n(t,e);if($t.hasOwnProperty(e.name)){var r=$t[e.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=e.name,e.helperType&&(i.helperType=e.helperType),e.modeProps)for(var s in e.modeProps)i[s]=e.modeProps[s];return i}var $t={};function Ut(t,e){var n=$t.hasOwnProperty(t)?$t[t]:$t[t]={};I(e,n)}function Yt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var i in e){var r=e[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function qt(t,e){var n;while(t.innerMode){if(n=t.innerMode(e),!n||n.mode==t)break;e=n.state,t=n.mode}return n||{mode:t,state:e}}function Kt(t,e,n){return!t.startState||t.startState(e,n)}var Gt=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Xt(t,e){if(e-=t.first,e<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");var n=t;while(!n.lines)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(e=t.first&&en?re(n,Xt(t,n).text.length):fe(e,Xt(t,e.line).text.length)}function fe(t,e){var n=t.ch;return null==n||n>e?re(t.line,e):n<0?re(t.line,0):t}function de(t,e){for(var n=[],i=0;i=this.string.length},Gt.prototype.sol=function(){return this.pos==this.lineStart},Gt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Gt.prototype.next=function(){if(this.pose},Gt.prototype.eatSpace=function(){var t=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>t},Gt.prototype.skipToEnd=function(){this.pos=this.string.length},Gt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Gt.prototype.backUp=function(t){this.pos-=t},Gt.prototype.column=function(){return this.lastColumnPos0?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}var r=function(t){return n?t.toLowerCase():t},o=this.string.substr(this.pos,t.length);if(r(o)==r(t))return!1!==e&&(this.pos+=t.length),!0},Gt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Gt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Gt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Gt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var pe=function(t,e){this.state=t,this.lookAhead=e},ge=function(t,e,n,i){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function me(t,e,n,i){var r=[t.state.modeGen],o={};Te(t,e.text,t.doc.mode,n,(function(t,e){return r.push(t,e)}),o,i);for(var s=n.state,a=function(i){n.baseTokens=r;var a=t.state.overlays[i],l=1,c=0;n.state=!0,Te(t,e.text,a.mode,n,(function(t,e){var n=l;while(ct&&r.splice(l,1,t,r[l+1],i),l+=2,c=Math.min(t,i)}if(e)if(a.opaque)r.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;nt.options.maxHighlightLength&&Yt(t.doc.mode,i.state),o=me(t,e,i);r&&(i.state=r),e.stateAfter=i.save(!r),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function ye(t,e,n){var i=t.doc,r=t.display;if(!i.mode.startState)return new ge(i,!0,e);var o=Le(t,e,n),s=o>i.first&&Xt(i,o-1).stateAfter,a=s?ge.fromSaved(i,s,o):new ge(i,Kt(i.mode),o);return i.iter(o,e,(function(n){be(t,n.text,a);var i=a.line;n.stateAfter=i==e-1||i%5==0||i>=r.viewFrom&&ie.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}ge.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},ge.prototype.baseToken=function(t){if(!this.baseTokens)return null;while(this.baseTokens[this.baseTokenPos]<=t)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},ge.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ge.fromSaved=function(t,e,n){return e instanceof pe?new ge(t,Yt(t.mode,e.state),n,e.lookAhead):new ge(t,Yt(t.mode,e),n)},ge.prototype.save=function(t){var e=!1!==t?Yt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new pe(e,this.maxLookAhead):e};var Ce=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function ke(t,e,n,i){var r,o=t.doc,s=o.mode;e=he(o,e);var a,l=Xt(o,e.line),c=ye(t,e.line,n),u=new Gt(l.text,t.options.tabSize,c);i&&(a=[]);while((i||u.post.options.maxHighlightLength?(a=!1,s&&be(t,e,i,h.pos),h.pos=e.length,l=null):l=Se(xe(n,h,i.state,f),o),f){var d=f[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!a||u!=l){while(cs;--a){if(a<=o.first)return o.first;var l=Xt(o,a-1),c=l.stateAfter;if(c&&(!n||a+(c instanceof pe?c.lookAhead:0)<=o.modeFrontier))return a;var u=F(l.text,null,t.options.tabSize);(null==r||i>u)&&(r=a-1,i=u)}return r}function Me(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;i--){var r=Xt(t,i).stateAfter;if(r&&(!(r instanceof pe)||i+r.lookAhead=e:o.to>e);(i||(i=[])).push(new Ne(s,o.from,l?null:o.to))}}return i}function Ie(t,e,n){var i;if(t)for(var r=0;r=e:o.to>e);if(a||o.from==e&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(s.inclusiveLeft?o.from<=e:o.from0&&a)for(var w=0;w0)){var u=[l,1],h=oe(c.from,a.from),f=oe(c.to,a.to);(h<0||!s.inclusiveLeft&&!h)&&u.push({from:c.from,to:a.from}),(f>0||!s.inclusiveRight&&!f)&&u.push({from:a.to,to:c.to}),r.splice.apply(r,u),l+=u.length-3}}return r}function ze(t){var e=t.markedSpans;if(e){for(var n=0;ne)&&(!n||Ue(n,o.marker)<0)&&(n=o.marker)}return n}function Xe(t,e,n,i,r){var o=Xt(t,e),s=Ae&&o.markedSpans;if(s)for(var a=0;a=0&&h<=0||u<=0&&h>=0)&&(u<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?oe(c.to,n)>=0:oe(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?oe(c.from,i)<=0:oe(c.from,i)<0)))return!0}}}function Ze(t){var e;while(e=qe(t))t=e.find(-1,!0).line;return t}function Je(t){var e;while(e=Ke(t))t=e.find(1,!0).line;return t}function Qe(t){var e,n;while(e=Ke(t))t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function tn(t,e){var n=Xt(t,e),i=Ze(n);return n==i?e:te(i)}function en(t,e){if(e>t.lastLine())return e;var n,i=Xt(t,e);if(!nn(t,i))return e;while(n=Ke(i))i=n.find(1,!0).line;return te(i)+1}function nn(t,e){var n=Ae&&e.markedSpans;if(n)for(var i=void 0,r=0;re.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var ln=function(t,e,n){this.text=t,He(this,e),this.height=n?n(this):1};function cn(t,e,n,i){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),ze(t),He(t,n);var r=i?i(t):1;r!=t.height&&Qt(t,r)}function un(t){t.parent=null,ze(t)}ln.prototype.lineNo=function(){return te(this)},xt(ln);var hn={},fn={};function dn(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?fn:hn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function pn(t,e){var n=_("span",null,null,l?"padding-right: .1px":null),i={pre:_("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var r=0;r<=(e.rest?e.rest.length:0);r++){var o=r?e.rest[r-1]:e.line,s=void 0;i.pos=0,i.addToken=mn,Nt(t.display.measure)&&(s=ft(o,t.doc.direction))&&(i.addToken=yn(i.addToken,s)),i.map=[];var a=e!=t.display.externalMeasured&&te(o);wn(o,i,ve(t,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=R(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=R(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Et(t.display.measure))),0==r?(e.measure.map=i.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(i.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var c=i.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return vt(t,"renderLine",t,e.line,i.pre),i.pre.className&&(i.textClass=R(i.pre.className,i.textClass||"")),i}function gn(t){var e=A("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function mn(t,e,n,i,r,o,l){if(e){var c,u=t.splitSpaces?vn(e,t.trailingSpace):e,h=t.cm.state.specialChars,f=!1;if(h.test(e)){c=document.createDocumentFragment();var d=0;while(1){h.lastIndex=d;var p=h.exec(e),g=p?p.index-d:e.length-d;if(g){var m=document.createTextNode(u.slice(d,d+g));s&&a<9?c.appendChild(A("span",[m])):c.appendChild(m),t.map.push(t.pos,t.pos+g,m),t.col+=g,t.pos+=g}if(!p)break;d+=g+1;var v=void 0;if("\t"==p[0]){var y=t.cm.options.tabSize,b=y-t.col%y;v=c.appendChild(A("span",K(b),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),t.col+=b}else"\r"==p[0]||"\n"==p[0]?(v=c.appendChild(A("span","\r"==p[0]?"␍":"␤","cm-invalidchar")),v.setAttribute("cm-text",p[0]),t.col+=1):(v=t.cm.options.specialCharPlaceholder(p[0]),v.setAttribute("cm-text",p[0]),s&&a<9?c.appendChild(A("span",[v])):c.appendChild(v),t.col+=1);t.map.push(t.pos,t.pos+1,v),t.pos++}}else t.col+=e.length,c=document.createTextNode(u),t.map.push(t.pos,t.pos+e.length,c),s&&a<9&&(f=!0),t.pos+=e.length;if(t.trailingSpace=32==u.charCodeAt(e.length-1),n||i||r||f||o||l){var w=n||"";i&&(w+=i),r&&(w+=r);var x=A("span",[c],w,o);if(l)for(var C in l)l.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,l[C]);return t.content.appendChild(x)}t.content.appendChild(c)}}function vn(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,i="",r=0;rc&&h.from<=c)break;if(h.to>=u)return t(n,i,r,o,s,a,l);t(n,i.slice(0,h.to-c),r,o,null,a,l),o=null,i=i.slice(h.to-c),c=h.to}}}function bn(t,e,n,i){var r=!i&&n.widgetNode;r&&t.map.push(t.pos,t.pos+e,r),!i&&t.cm.display.input.needsContentAttribute&&(r||(r=t.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(t.cm.display.input.setUneditable(r),t.content.appendChild(r)),t.pos+=e,t.trailingSpace=!1}function wn(t,e,n){var i=t.markedSpans,r=t.text,o=0;if(i)for(var s,a,l,c,u,h,f,d=r.length,p=0,g=1,m="",v=0;;){if(v==p){l=c=u=a="",f=null,h=null,v=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&&v>x.to&&(v=x.to,c=""),C.className&&(l+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&x.from==p&&(u+=" "+C.startStyle),C.endStyle&&x.to==v&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((f||(f={})).title=C.title),C.attributes)for(var k in C.attributes)(f||(f={}))[k]=C.attributes[k];C.collapsed&&(!h||Ue(h.marker,C)<0)&&(h=x)}else x.from>p&&v>x.from&&(v=x.from)}if(b)for(var S=0;S=d)break;var L=Math.min(d,v);while(1){if(m){var M=p+m.length;if(!h){var O=M>L?m.slice(0,L-p):m;e.addToken(e,O,s?s+l:l,u,p+O.length==v?c:"",a,f)}if(M>=L){m=m.slice(L-p),p=L;break}p=M,u=""}m=r.slice(o,o=n[g++]),s=dn(n[g++],e.cm.options)}}else for(var A=1;A2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Zn(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};if(t.rest){for(var i=0;in)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}}function Jn(t,e){e=Ze(e);var n=te(e),i=t.display.externalMeasured=new xn(t.doc,e,n);i.lineN=n;var r=i.built=pn(t,i);return i.text=r.pre,O(t.display.lineMeasure,r.pre),i}function Qn(t,e,n,i){return ni(t,ei(t,e),n,i)}function ti(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&ee)&&(o=l-a,r=o-1,e>=l&&(s="right")),null!=r){if(i=t[c+2],a==l&&n==(i.insertLeft?"left":"right")&&(s=n),"left"==n&&0==r)while(c&&t[c-2]==t[c-3]&&t[c-1].insertLeft)i=t[2+(c-=3)],s="left";if("right"==n&&r==l-a)while(c=0;r--)if((n=t[r]).left!=n.right)break;return n}function ai(t,e,n,i){var r,o=oi(e.map,n,i),l=o.node,c=o.start,u=o.end,h=o.collapse;if(3==l.nodeType){for(var f=0;f<4;f++){while(c&&ot(e.line.text.charAt(o.coverStart+c)))--c;while(o.coverStart+u0&&(h=i="right"),r=t.options.lineWrapping&&(d=l.getClientRects()).length>1?d["right"==i?d.length-1:0]:l.getBoundingClientRect()}if(s&&a<9&&!c&&(!r||!r.left&&!r.right)){var p=l.parentNode.getClientRects()[0];r=p?{left:p.left,right:p.left+Ai(t.display),top:p.top,bottom:p.bottom}:ri}for(var g=r.top-e.rect.top,m=r.bottom-e.rect.top,v=(g+m)/2,y=e.view.measure.heights,b=0;b=i.text.length?(l=i.text.length,c="before"):l<=0&&(l=0,c="after"),!a)return s("before"==c?l-1:l,"before"==c);function u(t,e,n){var i=a[e],r=1==i.level;return s(n?t-1:t,r!=n)}var h=ut(a,l,c),f=ct,d=u(l,h,"before"==c);return null!=f&&(d.other=u(l,f,"before"!=c)),d}function bi(t,e){var n=0;e=he(t.doc,e),t.options.lineWrapping||(n=Ai(t.display)*e.ch);var i=Xt(t.doc,e.line),r=on(i)+$n(t.display);return{left:n,right:n,top:r,bottom:r+i.height}}function wi(t,e,n,i,r){var o=re(t,e,n);return o.xRel=r,i&&(o.outside=i),o}function xi(t,e,n){var i=t.doc;if(n+=t.display.viewOffset,n<0)return wi(i.first,0,null,-1,-1);var r=ee(i,n),o=i.first+i.size-1;if(r>o)return wi(i.first+i.size-1,Xt(i,o).text.length,null,1,1);e<0&&(e=0);for(var s=Xt(i,r);;){var a=Ti(t,s,r,e,n),l=Ge(s,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var c=l.find(1);if(c.line==r)return c;s=Xt(i,r=c.line)}}function Ci(t,e,n,i){i-=pi(e);var r=e.text.length,o=at((function(e){return ni(t,n,e-1).bottom<=i}),r,0);return r=at((function(e){return ni(t,n,e).top>i}),o,r),{begin:o,end:r}}function ki(t,e,n,i){n||(n=ei(t,e));var r=gi(t,e,ni(t,n,i),"line").top;return Ci(t,e,n,r)}function Si(t,e,n,i){return!(t.bottom<=n)&&(t.top>n||(i?t.left:t.right)>e)}function Ti(t,e,n,i,r){r-=on(e);var o=ei(t,e),s=pi(e),a=0,l=e.text.length,c=!0,u=ft(e,t.doc.direction);if(u){var h=(t.options.lineWrapping?Mi:Li)(t,e,n,o,u,i,r);c=1!=h.level,a=c?h.from:h.to-1,l=c?h.to:h.from-1}var f,d,p=null,g=null,m=at((function(e){var n=ni(t,o,e);return n.top+=s,n.bottom+=s,!!Si(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(p=e,g=n),!0)}),a,l),v=!1;if(g){var y=i-g.left=w.bottom?1:0}return m=st(e.text,m,1),wi(n,m,d,v,i-f)}function Li(t,e,n,i,r,o,s){var a=at((function(a){var l=r[a],c=1!=l.level;return Si(yi(t,re(n,c?l.to:l.from,c?"before":"after"),"line",e,i),o,s,!0)}),0,r.length-1),l=r[a];if(a>0){var c=1!=l.level,u=yi(t,re(n,c?l.from:l.to,c?"after":"before"),"line",e,i);Si(u,o,s,!0)&&u.top>s&&(l=r[a-1])}return l}function Mi(t,e,n,i,r,o,s){var a=Ci(t,e,i,s),l=a.begin,c=a.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,h=null,f=0;f=c||d.to<=l)){var p=1!=d.level,g=ni(t,i,p?Math.min(c,d.to)-1:Math.max(l,d.from)).right,m=gm)&&(u=d,h=m)}}return u||(u=r[r.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function Oi(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==ii){ii=A("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)ii.appendChild(document.createTextNode("x")),ii.appendChild(A("br"));ii.appendChild(document.createTextNode("x"))}O(t.measure,ii);var n=ii.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),M(t.measure),n||1}function Ai(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=A("span","xxxxxxxxxx"),n=A("pre",[e],"CodeMirror-line-like");O(t.measure,n);var i=e.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(t.cachedCharWidth=r),r||10}function _i(t){for(var e=t.display,n={},i={},r=e.gutters.clientLeft,o=e.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var a=t.display.gutterSpecs[s].className;n[a]=o.offsetLeft+o.clientLeft+r,i[a]=o.clientWidth}return{fixedPos:Ei(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:e.wrapper.clientWidth}}function Ei(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Ni(t){var e=Oi(t.display),n=t.options.lineWrapping,i=n&&Math.max(5,t.display.scroller.clientWidth/Ai(t.display)-3);return function(r){if(nn(t.doc,r))return 0;var o=0;if(r.widgets)for(var s=0;s0&&(l=Xt(t.doc,c.line).text).length==c.ch){var u=F(l,l.length,t.options.tabSize)-l.length;c=re(c.line,Math.max(0,Math.round((o-Yn(t.display).left)/Ai(t.display))-u))}return c}function Pi(t,e){if(e>=t.display.viewTo)return null;if(e-=t.display.viewFrom,e<0)return null;for(var n=t.display.view,i=0;ie)&&(r.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=r.viewTo)Ae&&tn(t.doc,e)r.viewFrom?Fi(t):(r.viewFrom+=i,r.viewTo+=i);else if(e<=r.viewFrom&&n>=r.viewTo)Fi(t);else if(e<=r.viewFrom){var o=Wi(t,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):Fi(t)}else if(n>=r.viewTo){var s=Wi(t,e,e,-1);s?(r.view=r.view.slice(0,s.index),r.viewTo=s.lineN):Fi(t)}else{var a=Wi(t,e,e,-1),l=Wi(t,n,n+i,1);a&&l?(r.view=r.view.slice(0,a.index).concat(Cn(t,a.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):Fi(t)}var c=r.externalMeasured;c&&(n=r.lineN&&e=i.viewTo)){var o=i.view[Pi(t,e)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==j(s,n)&&s.push(n)}}}function Fi(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function Wi(t,e,n,i){var r,o=Pi(t,e),s=t.display.view;if(!Ae||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var a=t.display.viewFrom,l=0;l0){if(o==s.length-1)return null;r=a+s[o].size-e,o++}else r=a-e;e+=r,n+=r}while(tn(t.doc,n)!=n){if(o==(i<0?0:s.length-1))return null;n+=i*s[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function ji(t,e,n){var i=t.display,r=i.view;0==r.length||e>=i.viewTo||n<=i.viewFrom?(i.view=Cn(t,e,n),i.viewFrom=e):(i.viewFrom>e?i.view=Cn(t,e,i.viewFrom).concat(i.view):i.viewFromn&&(i.view=i.view.slice(0,Pi(t,n)))),i.viewTo=n}function zi(t){for(var e=t.display.view,n=0,i=0;i=t.display.viewTo||l.to().line0?s:t.defaultCharWidth())+"px"}if(i.other){var a=n.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=i.other.left+"px",a.style.top=i.other.top+"px",a.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Ui(t,e){return t.top-e.top||t.left-e.left}function Yi(t,e,n){var i=t.display,r=t.doc,o=document.createDocumentFragment(),s=Yn(t.display),a=s.left,l=Math.max(i.sizerWidth,Kn(t)-i.sizer.offsetLeft)-s.right,c="ltr"==r.direction;function u(t,e,n,i){e<0&&(e=0),e=Math.round(e),i=Math.round(i),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?l-t:n)+"px;\n height: "+(i-e)+"px"))}function h(e,n,i){var o,s,h=Xt(r,e),f=h.text.length;function d(n,i){return vi(t,re(e,n),"div",h,i)}function p(e,n,i){var r=ki(t,h,null,e),o="ltr"==n==("after"==i)?"left":"right",s="after"==i?r.begin:r.end-(/\s/.test(h.text.charAt(r.end-1))?2:1);return d(s,o)[o]}var g=ft(h,r.direction);return lt(g,n||0,null==i?f:i,(function(t,e,r,h){var m="ltr"==r,v=d(t,m?"left":"right"),y=d(e-1,m?"right":"left"),b=null==n&&0==t,w=null==i&&e==f,x=0==h,C=!g||h==g.length-1;if(y.top-v.top<=3){var k=(c?b:w)&&x,S=(c?w:b)&&C,T=k?a:(m?v:y).left,L=S?l:(m?y:v).right;u(T,v.top,L-T,v.bottom)}else{var M,O,A,_;m?(M=c&&b&&x?a:v.left,O=c?l:p(t,r,"before"),A=c?a:p(e,r,"after"),_=c&&w&&C?l:y.right):(M=c?p(t,r,"before"):a,O=!c&&b&&x?l:v.right,A=!c&&w&&C?a:y.left,_=c?p(e,r,"after"):l),u(M,v.top,O-M,v.bottom),v.bottom0?e.blinker=setInterval((function(){t.hasFocus()||Zi(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Ki(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||Xi(t))}function Gi(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&Zi(t))}),100)}function Xi(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(vt(t,"focus",t,e),t.state.focused=!0,D(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),qi(t))}function Zi(t,e){t.state.delayingBlurEvent||(t.state.focused&&(vt(t,"blur",t,e),t.state.focused=!1,L(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function Ji(t){for(var e=t.display,n=e.lineDiv.offsetTop,i=Math.max(0,e.scroller.getBoundingClientRect().top),r=e.lineDiv.getBoundingClientRect().top,o=0,l=0;l.005||g<-.005)&&(rt.display.sizerWidth){var v=Math.ceil(f/Ai(t.display));v>t.display.maxLineLength&&(t.display.maxLineLength=v,t.display.maxLine=c.line,t.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(e.scroller.scrollTop+=o)}function Qi(t){if(t.widgets)for(var e=0;e=s&&(o=ee(e,on(Xt(e,l))-t.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function er(t,e){if(!yt(t,"scrollCursorIntoView")){var n=t.display,i=n.sizer.getBoundingClientRect(),r=null;if(e.top+i.top<0?r=!0:e.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!p){var o=A("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-$n(t.display))+"px;\n height: "+(e.bottom-e.top+qn(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(r),t.display.lineSpace.removeChild(o)}}}function nr(t,e,n,i){var r;null==i&&(i=0),t.options.lineWrapping||e!=n||(n="before"==e.sticky?re(e.line,e.ch+1,"before"):e,e=e.ch?re(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e);for(var o=0;o<5;o++){var s=!1,a=yi(t,e),l=n&&n!=e?yi(t,n):a;r={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-i,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+i};var c=rr(t,r),u=t.doc.scrollTop,h=t.doc.scrollLeft;if(null!=c.scrollTop&&(hr(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(s=!0)),null!=c.scrollLeft&&(dr(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-h)>1&&(s=!0)),!s)break}return r}function ir(t,e){var n=rr(t,e);null!=n.scrollTop&&hr(t,n.scrollTop),null!=n.scrollLeft&&dr(t,n.scrollLeft)}function rr(t,e){var n=t.display,i=Oi(t.display);e.top<0&&(e.top=0);var r=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=Gn(t),s={};e.bottom-e.top>o&&(e.bottom=e.top+o);var a=t.doc.height+Un(n),l=e.topa-i;if(e.topr+o){var u=Math.min(e.top,(c?a:e.bottom)-o);u!=r&&(s.scrollTop=u)}var h=t.options.fixedGutter?0:n.gutters.offsetWidth,f=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-h,d=Kn(t)-n.gutters.offsetWidth,p=e.right-e.left>d;return p&&(e.right=e.left+d),e.left<10?s.scrollLeft=0:e.leftd+f-3&&(s.scrollLeft=e.right+(p?0:10)-d),s}function or(t,e){null!=e&&(cr(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function sr(t){cr(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function ar(t,e,n){null==e&&null==n||cr(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function lr(t,e){cr(t),t.curOp.scrollToPos=e}function cr(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;var n=bi(t,e.from),i=bi(t,e.to);ur(t,n,i,e.margin)}}function ur(t,e,n,i){var r=rr(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-i,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+i});ar(t,r.scrollLeft,r.scrollTop)}function hr(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||Hr(t,{top:e}),fr(t,e,!0),n&&Hr(t),Rr(t,100))}function fr(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function dr(t,e,n,i){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!i||(t.doc.scrollLeft=e,Yr(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function pr(t){var e=t.display,n=e.gutters.offsetWidth,i=Math.round(t.doc.height+Un(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+qn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var gr=function(t,e,n){this.cm=n;var i=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,t(i),t(r),pt(i,"scroll",(function(){i.clientHeight&&e(i.scrollTop,"vertical")})),pt(r,"scroll",(function(){r.clientWidth&&e(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};gr.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,i=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?i+"px":"0";var r=t.viewHeight-(e?i:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+r)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:e?i:0}},gr.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},gr.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},gr.prototype.zeroWidthHack=function(){var t=y&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new W,this.disableVert=new W},gr.prototype.enableZeroWidthBar=function(t,e,n){function i(){var r=t.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);o!=t?t.style.pointerEvents="none":e.set(1e3,i)}t.style.pointerEvents="auto",e.set(1e3,i)},gr.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var mr=function(){};function vr(t,e){e||(e=pr(t));var n=t.display.barWidth,i=t.display.barHeight;yr(t,e);for(var r=0;r<4&&n!=t.display.barWidth||i!=t.display.barHeight;r++)n!=t.display.barWidth&&t.options.lineWrapping&&Ji(t),yr(t,pr(t)),n=t.display.barWidth,i=t.display.barHeight}function yr(t,e){var n=t.display,i=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}mr.prototype.update=function(){return{bottom:0,right:0}},mr.prototype.setScrollLeft=function(){},mr.prototype.setScrollTop=function(){},mr.prototype.clear=function(){};var br={native:gr,null:mr};function wr(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&L(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new br[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),pt(e,"mousedown",(function(){t.state.focused&&setTimeout((function(){return t.display.input.focus()}),0)})),e.setAttribute("cm-not-content","true")}),(function(e,n){"horizontal"==n?dr(t,e):hr(t,e)}),t),t.display.scrollbars.addClass&&D(t.display.wrapper,t.display.scrollbars.addClass)}var xr=0;function Cr(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.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:++xr,markArrays:null},Sn(t.curOp)}function kr(t){var e=t.curOp;e&&Ln(e,(function(t){for(var e=0;e=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new Br(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Lr(t){t.updatedDisplay=t.mustUpdate&&jr(t.cm,t.update)}function Mr(t){var e=t.cm,n=e.display;t.updatedDisplay&&Ji(e),t.barMeasure=pr(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=Qn(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+qn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Kn(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Or(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft=t.display.viewTo)){var n=+new Date+t.options.workTime,i=ye(t,e.highlightFrontier),r=[];e.iter(i.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(o){if(i.line>=t.display.viewFrom){var s=o.styles,a=o.text.length>t.options.maxHighlightLength?Yt(e.mode,i.state):null,l=me(t,o,i,!0);a&&(i.state=a),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var h=!s||s.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!h&&fn)return Rr(t,t.options.workDelay),!0})),e.highlightFrontier=i.line,e.modeFrontier=Math.max(e.modeFrontier,i.line),r.length&&_r(t,(function(){for(var e=0;e=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==zi(t))return!1;qr(t)&&(Fi(t),e.dims=_i(t));var r=i.first+i.size,o=Math.max(e.visible.from-t.options.viewportMargin,i.first),s=Math.min(r,e.visible.to+t.options.viewportMargin);n.viewFroms&&n.viewTo-s<20&&(s=Math.min(r,n.viewTo)),Ae&&(o=tn(t.doc,o),s=en(t.doc,s));var a=o!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;ji(t,o,s),n.viewOffset=on(Xt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=zi(t);if(!a&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Fr(t);return l>4&&(n.lineDiv.style.display="none"),Vr(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Wr(c),M(n.cursorDiv),M(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,Rr(t,400)),n.updateLineNumbers=null,!0}function zr(t,e){for(var n=e.viewport,i=!0;;i=!1){if(i&&t.options.lineWrapping&&e.oldDisplayWidth!=Kn(t))i&&(e.visible=tr(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Un(t.display)-Gn(t),n.top)}),e.visible=tr(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!jr(t,e))break;Ji(t);var r=pr(t);Hi(t),vr(t,r),Ur(t,r),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Hr(t,e){var n=new Br(t,e);if(jr(t,n)){Ji(t),zr(t,n);var i=pr(t);Hi(t),vr(t,i),Ur(t,i),n.finish()}}function Vr(t,e,n){var i=t.display,r=t.options.lineNumbers,o=i.lineDiv,s=o.firstChild;function a(e){var n=e.nextSibling;return l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=i.view,u=i.viewFrom,h=0;h-1&&(d=!1),_n(t,f,u,n)),d&&(M(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(ie(t.options,u)))),s=f.node.nextSibling}else{var p=Fn(t,f,u,n);o.insertBefore(p,s)}u+=f.size}while(s)s=a(s)}function $r(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px",On(t,"gutterChanged",t)}function Ur(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+qn(t)+"px"}function Yr(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var i=Ei(e)-e.scroller.scrollLeft+t.doc.scrollLeft,r=e.gutters.offsetWidth,o=i+"px",s=0;sc.clientWidth,f=c.scrollHeight>c.clientHeight;if(r&&u||o&&f){if(o&&y&&l)t:for(var d=e.target,p=a.view;d!=c;d=d.parentNode)for(var g=0;g=0&&oe(t,i.to())<=0)return n}return-1};var ro=function(t,e){this.anchor=t,this.head=e};function oo(t,e,n){var i=t&&t.options.selectionsMayTouch,r=e[n];e.sort((function(t,e){return oe(t.from(),e.from())})),n=j(e,r);for(var o=1;o0:l>=0){var c=ce(a.from(),s.from()),u=le(a.to(),s.to()),h=a.empty()?s.from()==s.head:a.from()==a.head;o<=n&&--n,e.splice(--o,2,new ro(h?u:c,h?c:u))}}return new io(e,n)}function so(t,e){return new io([new ro(t,e||t)],0)}function ao(t){return t.text?re(t.from.line+t.text.length-1,G(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function lo(t,e){if(oe(t,e.from)<0)return t;if(oe(t,e.to)<=0)return ao(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,i=t.ch;return t.line==e.to.line&&(i+=ao(e).ch-e.to.ch),re(n,i)}function co(t,e){for(var n=[],i=0;i1&&t.remove(a.line+1,p-1),t.insert(a.line+1,v)}On(t,"change",t,e)}function vo(t,e,n){function i(t,r,o){if(t.linked)for(var s=0;s1&&!t.done[t.done.length-2].ranges?(t.done.pop(),G(t.done)):void 0}function To(t,e,n,i){var r=t.history;r.undone.length=0;var o,s,a=+new Date;if((r.lastOp==i||r.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&r.lastModTime>a-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=So(r,r.lastOp==i)))s=G(o.changes),0==oe(e.from,e.to)&&0==oe(e.from,s.to)?s.to=ao(e):o.changes.push(Co(t,e));else{var l=G(r.done);l&&l.ranges||Oo(t.sel,r.done),o={changes:[Co(t,e)],generation:r.generation},r.done.push(o);while(r.done.length>r.undoDepth)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=a,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=e.origin,s||vt(t,"historyAdded")}function Lo(t,e,n,i){var r=e.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Mo(t,e,n,i){var r=t.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||Lo(t,o,G(r.done),e))?r.done[r.done.length-1]=e:Oo(e,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&ko(r.undone)}function Oo(t,e){var n=G(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Ao(t,e,n,i){var r=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,i),(function(n){n.markedSpans&&((r||(r=e["spans_"+t.id]={}))[o]=n.markedSpans),++o}))}function _o(t){if(!t)return null;for(var e,n=0;n-1&&(G(a)[h]=c[h],delete c[h])}}}return i}function Ro(t,e,n,i){if(i){var r=t.anchor;if(n){var o=oe(e,r)<0;o!=oe(n,r)<0?(r=e,e=n):o!=oe(e,n)<0&&(e=n)}return new ro(r,e)}return new ro(n||e,e)}function Po(t,e,n,i,r){null==r&&(r=t.cm&&(t.cm.display.shift||t.extend)),zo(t,new io([Ro(t.sel.primary(),e,n,r)],0),i)}function Bo(t,e,n){for(var i=[],r=t.cm&&(t.cm.display.shift||t.extend),o=0;o=e.ch:a.to>e.ch))){if(r&&(vt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var h=l.find(i<0?1:-1),f=void 0;if((i<0?u:c)&&(h=Ko(t,h,-i,h&&h.line==e.line?o:null)),h&&h.line==e.line&&(f=oe(h,n))&&(i<0?f<0:f>0))return Yo(t,h,e,i,r)}var d=l.find(i<0?-1:1);return(i<0?c:u)&&(d=Ko(t,d,i,d.line==e.line?o:null)),d?Yo(t,d,e,i,r):null}}return e}function qo(t,e,n,i,r){var o=i||1,s=Yo(t,e,n,o,r)||!r&&Yo(t,e,n,o,!0)||Yo(t,e,n,-o,r)||!r&&Yo(t,e,n,-o,!0);return s||(t.cantEdit=!0,re(t.first,0))}function Ko(t,e,n,i){return n<0&&0==e.ch?e.line>t.first?he(t,re(e.line-1)):null:n>0&&e.ch==(i||Xt(t,e.line)).text.length?e.line=0;--r)Jo(t,{from:i[r].from,to:i[r].to,text:r?[""]:e.text,origin:e.origin});else Jo(t,e)}}function Jo(t,e){if(1!=e.text.length||""!=e.text[0]||0!=oe(e.from,e.to)){var n=co(t,e);To(t,e,n,t.cm?t.cm.curOp.id:NaN),es(t,e,n,Fe(t,e));var i=[];vo(t,(function(t,n){n||-1!=j(i,t.history)||(ss(t.history,e),i.push(t.history)),es(t,e,null,Fe(t,e))}))}}function Qo(t,e,n){var i=t.cm&&t.cm.state.suppressEdits;if(!i||n){for(var r,o=t.history,s=t.sel,a="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,c=0;c=0;--d){var p=f(d);if(p)return p.v}}}}function ts(t,e){if(0!=e&&(t.first+=e,t.sel=new io(X(t.sel.ranges,(function(t){return new ro(re(t.anchor.line+e,t.anchor.ch),re(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){Bi(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,i=n.viewFrom;it.lastLine())){if(e.from.lineo&&(e={from:e.from,to:re(o,Xt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Zt(t,e.from,e.to),n||(n=co(t,e)),t.cm?ns(t.cm,e,i):mo(t,e,i),Ho(t,n,V),t.cantEdit&&qo(t,re(t.firstLine(),0))&&(t.cantEdit=!1)}}function ns(t,e,n){var i=t.doc,r=t.display,o=e.from,s=e.to,a=!1,l=o.line;t.options.lineWrapping||(l=te(Ze(Xt(i,o.line))),i.iter(l,s.line+1,(function(t){if(t==r.maxLine)return a=!0,!0}))),i.sel.contains(e.from,e.to)>-1&&bt(t),mo(i,e,n,Ni(t)),t.options.lineWrapping||(i.iter(l,o.line+e.text.length,(function(t){var e=sn(t);e>r.maxLineLength&&(r.maxLine=t,r.maxLineLength=e,r.maxLineChanged=!0,a=!1)})),a&&(t.curOp.updateMaxLine=!0)),Me(i,o.line),Rr(t,400);var c=e.text.length-(s.line-o.line)-1;e.full?Bi(t):o.line!=s.line||1!=e.text.length||go(t.doc,e)?Bi(t,o.line,s.line+1,c):Ii(t,o.line,"text");var u=wt(t,"changes"),h=wt(t,"change");if(h||u){var f={from:o,to:s,text:e.text,removed:e.removed,origin:e.origin};h&&On(t,"change",t,f),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(f)}t.display.selForContextMenu=null}function is(t,e,n,i,r){var o;i||(i=n),oe(i,n)<0&&(o=[i,n],n=o[0],i=o[1]),"string"==typeof e&&(e=t.splitLines(e)),Zo(t,{from:n,to:i,text:e,origin:r})}function rs(t,e,n,i){n1||!(this.children[0]instanceof ls))){var a=[];this.collapse(a),this.children=[new ls(a)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e50){for(var s=r.lines.length%25+25,a=s;a10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var i=0;i0||0==s&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=_("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Xe(t,e.line,e,n,o)||e.line!=n.line&&Xe(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ee()}o.addToHistory&&To(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var a,l=e.line,c=t.cm;if(t.iter(l,n.line+1,(function(i){c&&o.collapsed&&!c.options.lineWrapping&&Ze(i)==c.display.maxLine&&(a=!0),o.collapsed&&l!=e.line&&Qt(i,0),Pe(i,new Ne(o,l==e.line?e.ch:null,l==n.line?n.ch:null),t.cm&&t.cm.curOp),++l})),o.collapsed&&t.iter(e.line,n.line+1,(function(e){nn(t,e)&&Qt(e,0)})),o.clearOnEnter&&pt(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(_e(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++ds,o.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),o.collapsed)Bi(c,e.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=e.line;u<=n.line;u++)Ii(c,u,"text");o.atomic&&$o(c.doc),On(c,"markerAdded",c,o)}return o}ps.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Cr(t),wt(this,"clear")){var n=this.find();n&&On(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;ot.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&Bi(t,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&$o(t.doc)),t&&On(t,"markerCleared",t,this,i,r),e&&kr(t),this.parent&&this.parent.clear()}},ps.prototype.find=function(t,e){var n,i;null==t&&"bookmark"==this.type&&(t=1);for(var r=0;r=0;l--)Zo(this,i[l]);a?jo(this,a):this.cm&&sr(this.cm)})),undo:Dr((function(){Qo(this,"undo")})),redo:Dr((function(){Qo(this,"redo")})),undoSelection:Dr((function(){Qo(this,"undo",!0)})),redoSelection:Dr((function(){Qo(this,"redo",!0)})),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,i=0;i=t.ch)&&e.push(r.marker.parent||r.marker)}return e},findMarks:function(t,e,n){t=he(this,t),e=he(this,e);var i=[],r=t.line;return this.iter(t.line,e.line+1,(function(o){var s=o.markedSpans;if(s)for(var a=0;a=l.to||null==l.from&&r!=t.line||null!=l.from&&r==e.line&&l.from>=e.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r})),i},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var i=0;it)return e=t,!0;t-=o,++n})),he(this,re(n,e))},indexFromPos:function(t){t=he(this,t);var e=t.ch;if(t.linee&&(e=t.from),null!=t.to&&t.to-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var h=t.dataTransfer.getData("Text");if(h){var f;if(e.state.draggingText&&!e.state.draggingText.copy&&(f=e.listSelections()),Ho(e.doc,so(n,n)),f)for(var d=0;d=0;e--)is(t.doc,"",i[e].from,i[e].to,"+delete");sr(t)}))}function Ys(t,e,n){var i=st(t.text,e+n,n);return i<0||i>t.text.length?null:i}function qs(t,e,n){var i=Ys(t,e.ch,n);return null==i?null:new re(e.line,i,n<0?"after":"before")}function Ks(t,e,n,i,r){if(t){"rtl"==e.doc.direction&&(r=-r);var o=ft(n,e.doc.direction);if(o){var s,a=r<0?G(o):o[0],l=r<0==(1==a.level),c=l?"after":"before";if(a.level>0||"rtl"==e.doc.direction){var u=ei(e,n);s=r<0?n.text.length-1:0;var h=ni(e,u,s).top;s=at((function(t){return ni(e,u,t).top==h}),r<0==(1==a.level)?a.from:a.to-1,s),"before"==c&&(s=Ys(n,s,1))}else s=r<0?a.to:a.from;return new re(i,s,c)}}return new re(i,r<0?n.text.length:0,r<0?"before":"after")}function Gs(t,e,n,i){var r=ft(e,t.doc.direction);if(!r)return qs(e,n,i);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ut(r,n.ch,n.sticky),s=r[o];if("ltr"==t.doc.direction&&s.level%2==0&&(i>0?s.to>n.ch:s.from=s.from&&f>=u.begin)){var d=h?"before":"after";return new re(n.line,f,d)}}var p=function(t,e,i){for(var o=function(t,e){return e?new re(n.line,l(t,1),"before"):new re(n.line,t,"after")};t>=0&&t0==(1!=s.level),c=a?i.begin:l(i.end,-1);if(s.from<=c&&c0?u.end:l(u.begin,-1);return null==m||i>0&&m==e.text.length||(g=p(i>0?0:r.length-1,i,c(m)),!g)?null:g}Is.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"},Is.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"},Is.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Is.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"]},Is["default"]=y?Is.macDefault:Is.pcDefault;var Xs={selectAll:Go,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),V)},killLine:function(t){return Us(t,(function(e){if(e.empty()){var n=Xt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0)r=new re(r.line,r.ch+1),t.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),re(r.line,r.ch-2),r,"+transpose");else if(r.line>t.doc.first){var s=Xt(t.doc,r.line-1).text;s&&(r=new re(r.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+s.charAt(s.length-1),re(r.line-1,s.length-1),r,"+transpose"))}n.push(new ro(r,r))}t.setSelections(n)}))},newlineAndIndent:function(t){return _r(t,(function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var i=0;i-1&&(oe((r=a.ranges[r]).from(),e)<0||e.xRel>0)&&(oe(r.to(),e)>0||e.xRel<0)?xa(t,i,e,o):ka(t,i,e,o)}function xa(t,e,n,i){var r=t.display,o=!1,c=Er(t,(function(e){l&&(r.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:Gi(t)),mt(r.wrapper.ownerDocument,"mouseup",c),mt(r.wrapper.ownerDocument,"mousemove",u),mt(r.scroller,"dragstart",h),mt(r.scroller,"drop",c),o||(Ct(e),i.addNew||Po(t.doc,n,null,null,i.extend),l&&!f||s&&9==a?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),u=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},h=function(){return o=!0};l&&(r.scroller.draggable=!0),t.state.draggingText=c,c.copy=!i.moveOnDrag,pt(r.wrapper.ownerDocument,"mouseup",c),pt(r.wrapper.ownerDocument,"mousemove",u),pt(r.scroller,"dragstart",h),pt(r.scroller,"drop",c),t.state.delayingBlurEvent=!0,setTimeout((function(){return r.input.focus()}),20),r.scroller.dragDrop&&r.scroller.dragDrop()}function Ca(t,e,n){if("char"==n)return new ro(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new ro(re(e.line,0),he(t.doc,re(e.line+1,0)));var i=n(t,e);return new ro(i.from,i.to)}function ka(t,e,n,i){s&&Gi(t);var r=t.display,o=t.doc;Ct(e);var a,l,c=o.sel,u=c.ranges;if(i.addNew&&!i.extend?(l=o.sel.contains(n),a=l>-1?u[l]:new ro(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),"rectangle"==i.unit)i.addNew||(a=new ro(n,n)),n=Ri(t,e,!0,!0),l=-1;else{var h=Ca(t,n,i.unit);a=i.extend?Ro(a,h.anchor,h.head,i.extend):h}i.addNew?-1==l?(l=u.length,zo(o,oo(t,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==i.unit&&!i.extend?(zo(o,oo(t,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):Io(o,l,a,$):(l=0,zo(o,new io([a],0),$),c=o.sel);var f=n;function d(e){if(0!=oe(f,e))if(f=e,"rectangle"==i.unit){for(var r=[],s=t.options.tabSize,u=F(Xt(o,n.line).text,n.ch,s),h=F(Xt(o,e.line).text,e.ch,s),d=Math.min(u,h),p=Math.max(u,h),g=Math.min(n.line,e.line),m=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=m;g++){var v=Xt(o,g).text,y=Y(v,d,s);d==p?r.push(new ro(re(g,y),re(g,y))):v.length>y&&r.push(new ro(re(g,y),re(g,Y(v,p,s))))}r.length||r.push(new ro(n,n)),zo(o,oo(t,c.ranges.slice(0,l).concat(r),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,w=a,x=Ca(t,e,i.unit),C=w.anchor;oe(x.anchor,C)>0?(b=x.head,C=ce(w.from(),x.anchor)):(b=x.anchor,C=le(w.to(),x.head));var k=c.ranges.slice(0);k[l]=Sa(t,new ro(he(o,C),b)),zo(o,oo(t,k,l),$)}}var p=r.wrapper.getBoundingClientRect(),g=0;function m(e){var n=++g,s=Ri(t,e,!0,"rectangle"==i.unit);if(s)if(0!=oe(s,f)){t.curOp.focus=N(),d(s);var a=tr(r,o);(s.line>=a.to||s.linep.bottom?20:0;l&&setTimeout(Er(t,(function(){g==n&&(r.scroller.scrollTop+=l,m(e))})),50)}}function v(e){t.state.selectingText=!1,g=1/0,e&&(Ct(e),r.input.focus()),mt(r.wrapper.ownerDocument,"mousemove",y),mt(r.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var y=Er(t,(function(t){0!==t.buttons&&Mt(t)?m(t):v(t)})),b=Er(t,v);t.state.selectingText=b,pt(r.wrapper.ownerDocument,"mousemove",y),pt(r.wrapper.ownerDocument,"mouseup",b)}function Sa(t,e){var n=e.anchor,i=e.head,r=Xt(t.doc,n.line);if(0==oe(n,i)&&n.sticky==i.sticky)return e;var o=ft(r);if(!o)return e;var s=ut(o,n.ch,n.sticky),a=o[s];if(a.from!=n.ch&&a.to!=n.ch)return e;var l,c=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==c||c==o.length)return e;if(i.line!=n.line)l=(i.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=ut(o,i.ch,i.sticky),h=u-s||(i.ch-n.ch)*(1==a.level?-1:1);l=u==c-1||u==c?h<0:h>0}var f=o[c+(l?-1:0)],d=l==(1==f.level),p=d?f.from:f.to,g=d?"after":"before";return n.ch==p&&n.sticky==g?e:new ro(new re(n.line,p,g),i)}function Ta(t,e,n,i){var r,o;if(e.touches)r=e.touches[0].clientX,o=e.touches[0].clientY;else try{r=e.clientX,o=e.clientY}catch(f){return!1}if(r>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;i&&Ct(e);var s=t.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!wt(t,n))return St(e);o-=a.top-s.viewOffset;for(var l=0;l=r){var u=ee(t.doc,o),h=t.display.gutterSpecs[l];return vt(t,n,t,u,h.className,e),St(e)}}}function La(t,e){return Ta(t,e,"gutterClick",!0)}function Ma(t,e){Vn(t.display,e)||Oa(t,e)||yt(t,e,"contextmenu")||k||t.display.input.onContextMenu(e)}function Oa(t,e){return!!wt(t,"gutterContextMenu")&&Ta(t,e,"gutterContextMenu",!1)}function Aa(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),hi(t)}ga.prototype.compare=function(t,e,n){return this.time+pa>t&&0==oe(e,this.pos)&&n==this.button};var _a={toString:function(){return"CodeMirror.Init"}},Ea={},Na={};function Da(t){var e=t.optionHandlers;function n(n,i,r,o){t.defaults[n]=i,r&&(e[n]=o?function(t,e,n){n!=_a&&r(t,e,n)}:r)}t.defineOption=n,t.Init=_a,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,fo(t)}),!0),n("indentUnit",2,fo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){po(t),hi(t),Bi(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],i=t.doc.first;t.doc.iter((function(t){for(var r=0;;){var o=t.text.indexOf(e,r);if(-1==o)break;r=o+e.length,n.push(re(i,o))}i++}));for(var r=n.length-1;r>=0;r--)is(t.doc,e,n[r],re(n[r].line,n[r].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=_a&&t.refresh()})),n("specialCharPlaceholder",gn,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){Aa(t),Xr(t)}),!0),n("keyMap","default",(function(t,e,n){var i=$s(e),r=n!=_a&&$s(n);r&&r.detach&&r.detach(t,i),i.attach&&i.attach(t,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Pa,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=Kr(e,t.options.lineNumbers),Xr(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?Ei(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return vr(t)}),!0),n("scrollbarStyle","native",(function(t){wr(t),vr(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=Kr(t.options.gutters,e),Xr(t)}),!0),n("firstLineNumber",1,Xr,!0),n("lineNumberFormatter",(function(t){return t}),Xr,!0),n("showCursorWhenSelecting",!1,Hi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(Zi(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,Ra),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Hi,!0),n("singleCursorHeightPerLine",!0,Hi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,po,!0),n("addModeClass",!1,po,!0),n("pollInterval",100),n("undoDepth",200,(function(t,e){return t.doc.history.undoDepth=e})),n("historyEventDelay",1250),n("viewportMargin",10,(function(t){return t.refresh()}),!0),n("maxHighlightLength",1e4,po,!0),n("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),n("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),n("autofocus",null),n("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),n("phrases",null)}function Ra(t,e,n){var i=n&&n!=_a;if(!e!=!i){var r=t.display.dragFunctions,o=e?pt:mt;o(t.display.scroller,"dragstart",r.start),o(t.display.scroller,"dragenter",r.enter),o(t.display.scroller,"dragover",r.over),o(t.display.scroller,"dragleave",r.leave),o(t.display.scroller,"drop",r.drop)}}function Pa(t){t.options.lineWrapping?(D(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(L(t.display.wrapper,"CodeMirror-wrap"),an(t)),Di(t),Bi(t),hi(t),setTimeout((function(){return vr(t)}),100)}function Ba(t,e){var n=this;if(!(this instanceof Ba))return new Ba(t,e);this.options=e=e?I(e):{},I(Ea,e,!1);var i=e.value;"string"==typeof i?i=new Cs(i,e.mode,null,e.lineSeparator,e.direction):e.mode&&(i.modeOption=e.mode),this.doc=i;var r=new Ba.inputStyles[e.inputStyle](this),o=this.display=new Zr(t,i,r,e);for(var c in o.wrapper.CodeMirror=this,Aa(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wr(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 W,keySeq:null,specialChars:null},e.autofocus&&!v&&o.input.focus(),s&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Ia(this),_s(),Cr(this),this.curOp.forceUpdate=!0,yo(this,i),e.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Xi(n)}),20):Zi(this),Na)Na.hasOwnProperty(c)&&Na[c](this,e[c],_a);qr(this),e.finishInit&&e.finishInit(this);for(var u=0;u400}pt(e.scroller,"touchstart",(function(r){if(!yt(t,r)&&!o(r)&&!La(t,r)){e.input.ensurePolled(),clearTimeout(n);var s=+new Date;e.activeTouch={start:s,moved:!1,prev:s-i.end<=300?i:null},1==r.touches.length&&(e.activeTouch.left=r.touches[0].pageX,e.activeTouch.top=r.touches[0].pageY)}})),pt(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),pt(e.scroller,"touchend",(function(n){var i=e.activeTouch;if(i&&!Vn(e,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var o,s=t.coordsChar(e.activeTouch,"page");o=!i.prev||l(i,i.prev)?new ro(s,s):!i.prev.prev||l(i,i.prev.prev)?t.findWordAt(s):new ro(re(s.line,0),he(t.doc,re(s.line+1,0))),t.setSelection(o.anchor,o.head),t.focus(),Ct(n)}r()})),pt(e.scroller,"touchcancel",r),pt(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(hr(t,e.scroller.scrollTop),dr(t,e.scroller.scrollLeft,!0),vt(t,"scroll",t))})),pt(e.scroller,"mousewheel",(function(e){return no(t,e)})),pt(e.scroller,"DOMMouseScroll",(function(e){return no(t,e)})),pt(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){yt(t,e)||Tt(e)},over:function(e){yt(t,e)||(Ls(t,e),Tt(e))},start:function(e){return Ts(t,e)},drop:Er(t,Ss),leave:function(e){yt(t,e)||Ms(t)}};var c=e.input.getField();pt(c,"keyup",(function(e){return ua.call(t,e)})),pt(c,"keydown",Er(t,la)),pt(c,"keypress",Er(t,ha)),pt(c,"focus",(function(e){return Xi(t,e)})),pt(c,"blur",(function(e){return Zi(t,e)}))}Ba.defaults=Ea,Ba.optionHandlers=Na;var Fa=[];function Wa(t,e,n,i){var r,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?r=ye(t,e).state:n="prev");var s=t.options.tabSize,a=Xt(o,e),l=F(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(i||/\S/.test(a.text)){if("smart"==n&&(c=o.mode.indent(r,a.text.slice(u.length),a.text),c==H||c>150)){if(!i)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>o.first?F(Xt(o,e-1).text,null,s):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var h="",f=0;if(t.options.indentWithTabs)for(var d=Math.floor(c/s);d;--d)f+=s,h+="\t";if(fs,l=Dt(e),c=null;if(a&&i.ranges.length>1)if(ja&&ja.text.join("\n")==e){if(i.ranges.length%ja.text.length==0){c=[];for(var u=0;u=0;f--){var d=i.ranges[f],p=d.from(),g=d.to();d.empty()&&(n&&n>0?p=re(p.line,p.ch-n):t.state.overwrite&&!a?g=re(g.line,Math.min(Xt(o,g.line).text.length,g.ch+G(l).length)):a&&ja&&ja.lineWise&&ja.text.join("\n")==l.join("\n")&&(p=g=re(p.line,0)));var m={from:p,to:g,text:c?c[f%c.length]:l,origin:r||(a?"paste":t.state.cutIncoming>s?"cut":"+input")};Zo(t.doc,m),On(t,"inputRead",t,m)}e&&!a&&$a(t,e),sr(t),t.curOp.updateInput<2&&(t.curOp.updateInput=h),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Va(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||_r(e,(function(){return Ha(e,n,0,null,"paste")})),!0}function $a(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=t.getModeAt(r.head),s=!1;if(o.electricChars){for(var a=0;a-1){s=Wa(t,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xt(t.doc,r.head.line).text.slice(0,r.head.ch))&&(s=Wa(t,r.head.line,"smart"));s&&On(t,"electricInput",t,r.head.line)}}}function Ua(t){for(var e=[],n=[],i=0;in&&(Wa(this,r.head.line,t,!0),n=r.head.line,i==this.doc.sel.primIndex&&sr(this));else{var o=r.from(),s=r.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;l0&&Io(this.doc,i,new ro(o,c[i].to()),V)}}})),getTokenAt:function(t,e){return ke(this,t,e)},getLineTokens:function(t,e){return ke(this,re(t),e,!0)},getTokenTypeAt:function(t){t=he(this.doc,t);var e,n=ve(this,Xt(this.doc,t.line)),i=0,r=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var s=i+r>>1;if((s?n[2*s-1]:0)>=o)r=s;else{if(!(n[2*s+1]o&&(t=o,r=!0),i=Xt(this.doc,t)}else i=t;return gi(this,i,{top:0,left:0},e||"page",n||r).top+(r?this.doc.height-on(i):0)},defaultTextHeight:function(){return Oi(this.display)},defaultCharWidth:function(){return Ai(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,i,r){var o=this.display;t=yi(this,he(this.doc,t));var s=t.bottom,a=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),o.sizer.appendChild(e),"over"==i)s=t.top;else if("above"==i||"near"==i){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==i||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?s=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(s=t.bottom),a+e.offsetWidth>c&&(a=c-e.offsetWidth)}e.style.top=s+"px",e.style.left=e.style.right="","right"==r?(a=o.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==r?a=0:"middle"==r&&(a=(o.sizer.clientWidth-e.offsetWidth)/2),e.style.left=a+"px"),n&&ir(this,{left:a,top:s,right:a+e.offsetWidth,bottom:s+e.offsetHeight})},triggerOnKeyDown:Nr(la),triggerOnKeyPress:Nr(ha),triggerOnKeyUp:ua,triggerOnMouseDown:Nr(va),execCommand:function(t){if(Xs.hasOwnProperty(t))return Xs[t].call(null,this)},triggerElectric:Nr((function(t){$a(this,t)})),findPosH:function(t,e,n,i){var r=1;e<0&&(r=-1,e=-e);for(var o=he(this.doc,t),s=0;s0&&a(n.charAt(i-1)))--i;while(r.5||this.options.lineWrapping)&&Di(this),vt(this,"refresh",this)})),swapDoc:Nr((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),yo(this,t),hi(this),this.display.input.reset(),ar(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,On(this,"swapDoc",this,e),e})),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},xt(t),t.registerHelper=function(e,i,r){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][i]=r},t.registerGlobalHelper=function(e,i,r,o){t.registerHelper(e,i,o),n[e]._global.push({pred:r,val:o})}}function Ga(t,e,n,i,r){var o=e,s=n,a=Xt(t,e.line),l=r&&"rtl"==t.direction?-n:n;function c(){var n=e.line+l;return!(n=t.first+t.size)&&(e=new re(n,e.ch,e.sticky),a=Xt(t,n))}function u(o){var s;if("codepoint"==i){var u=a.text.charCodeAt(e.ch+(n>0?0:-1));if(isNaN(u))s=null;else{var h=n>0?u>=55296&&u<56320:u>=56320&&u<57343;s=new re(e.line,Math.max(0,Math.min(a.text.length,e.ch+n*(h?2:1))),-n)}}else s=r?Gs(t.cm,a,e,n):qs(a,e,n);if(null==s){if(o||!c())return!1;e=Ks(r,t.cm,a,e.line,l)}else e=s;return!0}if("char"==i||"codepoint"==i)u();else if("column"==i)u(!0);else if("word"==i||"group"==i)for(var h=null,f="group"==i,d=t.cm&&t.cm.getHelper(e,"wordChars"),p=!0;;p=!1){if(n<0&&!u(!p))break;var g=a.text.charAt(e.ch)||"\n",m=nt(g,d)?"w":f&&"\n"==g?"n":!f||/\s/.test(g)?null:"p";if(!f||p||m||(m="s"),h&&h!=m){n<0&&(n=1,u(),e.sticky="after");break}if(m&&(h=m),n>0&&!u(!p))break}var v=qo(t,e,o,s,!0);return se(o,v)&&(v.hitSide=!0),v}function Xa(t,e,n,i){var r,o,s=t.doc,a=e.left;if("page"==i){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*Oi(t.display),3);r=(n>0?e.bottom:e.top)+n*c}else"line"==i&&(r=n>0?e.bottom+3:e.top-3);for(;;){if(o=xi(t,a,r),!o.outside)break;if(n<0?r<=0:r>=s.height){o.hitSide=!0;break}r+=5*n}return o}var Za=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new W,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ja(t,e){var n=ti(t,e.line);if(!n||n.hidden)return null;var i=Xt(t.doc,e.line),r=Zn(n,i,e.line),o=ft(i,t.doc.direction),s="left";if(o){var a=ut(o,e.ch);s=a%2?"right":"left"}var l=oi(r.map,e.ch,s);return l.offset="right"==l.collapse?l.end:l.start,l}function Qa(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function tl(t,e){return e&&(t.bad=!0),t}function el(t,e,n,i,r){var o="",s=!1,a=t.doc.lineSeparator(),l=!1;function c(t){return function(e){return e.id==t}}function u(){s&&(o+=a,l&&(o+=a),s=l=!1)}function h(t){t&&(u(),o+=t)}function f(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void h(n);var o,d=e.getAttribute("cm-marker");if(d){var p=t.findMarks(re(i,0),re(r+1,0),c(+d));return void(p.length&&(o=p[0].find(0))&&h(Zt(t.doc,o.from,o.to).join(a)))}if("false"==e.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;g&&u();for(var m=0;m=e.display.viewTo||o.line=e.display.viewFrom&&Ja(e,r)||{node:l[0].measure.map[2],offset:0},u=o.linei.firstLine()&&(s=re(s.line-1,Xt(i.doc,s.line-1).length)),a.ch==Xt(i.doc,a.line).text.length&&a.liner.viewTo-1)return!1;s.line==r.viewFrom||0==(t=Pi(i,s.line))?(e=te(r.view[0].line),n=r.view[0].node):(e=te(r.view[t].line),n=r.view[t-1].node.nextSibling);var l,c,u=Pi(i,a.line);if(u==r.view.length-1?(l=r.viewTo-1,c=r.lineDiv.lastChild):(l=te(r.view[u+1].line)-1,c=r.view[u+1].node.previousSibling),!n)return!1;var h=i.doc.splitLines(el(i,n,c,e,l)),f=Zt(i.doc,re(e,0),re(l,Xt(i.doc,l).text.length));while(h.length>1&&f.length>1)if(G(h)==G(f))h.pop(),f.pop(),l--;else{if(h[0]!=f[0])break;h.shift(),f.shift(),e++}var d=0,p=0,g=h[0],m=f[0],v=Math.min(g.length,m.length);while(ds.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1))d--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(d).replace(/\u200b+$/,"");var x=re(e,d),C=re(l,f.length?G(f).length-p:0);return h.length>1||h[0]||oe(x,C)?(is(i.doc,h,x,C,"+input"),!0):void 0},Za.prototype.ensurePolled=function(){this.forceCompositionEnd()},Za.prototype.reset=function(){this.forceCompositionEnd()},Za.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Za.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()}),80))},Za.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||_r(this.cm,(function(){return Bi(t.cm)}))},Za.prototype.setUneditable=function(t){t.contentEditable="false"},Za.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Er(this.cm,Ha)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Za.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Za.prototype.onContextMenu=function(){},Za.prototype.resetPosition=function(){},Za.prototype.needsContentAttribute=!0;var rl=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new W,this.hasSelection=!1,this.composing=null};function ol(t,e){if(e=e?I(e):{},e.value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=N();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function i(){t.value=a.getValue()}var r;if(t.form&&(pt(t.form,"submit",i),!e.leaveSubmitMethodAlone)){var o=t.form;r=o.submit;try{var s=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=s}}catch(l){}}e.finishInit=function(n){n.save=i,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,i(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(mt(t.form,"submit",i),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=r))}},t.style.display="none";var a=Ba((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return a}function sl(t){t.off=mt,t.on=pt,t.wheelEventPixels=eo,t.Doc=Cs,t.splitLines=Dt,t.countColumn=F,t.findColumn=Y,t.isWordChar=et,t.Pass=H,t.signal=vt,t.Line=ln,t.changeEnd=ao,t.scrollbarModel=br,t.Pos=re,t.cmpPos=oe,t.modes=Ft,t.mimeModes=Wt,t.resolveMode=Ht,t.getMode=Vt,t.modeExtensions=$t,t.extendMode=Ut,t.copyState=Yt,t.startState=Kt,t.innerMode=qt,t.commands=Xs,t.keyMap=Is,t.keyName=Vs,t.isModifierKey=zs,t.lookupKey=js,t.normalizeKeyMap=Ws,t.StringStream=Gt,t.SharedTextMarker=ms,t.TextMarker=ps,t.LineWidget=us,t.e_preventDefault=Ct,t.e_stopPropagation=kt,t.e_stop=Tt,t.addClass=D,t.contains=E,t.rmClass=L,t.keyNames=Ds}rl.prototype.init=function(t){var e=this,n=this,i=this.cm;this.createField(t);var r=this.textarea;function o(t){if(!yt(i,t)){if(i.somethingSelected())za({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var e=Ua(i);za({lineWise:!0,text:e.text}),"cut"==t.type?i.setSelections(e.ranges,null,V):(n.prevInput="",r.value=e.text.join("\n"),P(r))}"cut"==t.type&&(i.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),g&&(r.style.width="0px"),pt(r,"input",(function(){s&&a>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),pt(r,"paste",(function(t){yt(i,t)||Va(t,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),pt(r,"cut",o),pt(r,"copy",o),pt(t.scroller,"paste",(function(e){if(!Vn(t,e)&&!yt(i,e)){if(!r.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=e.clipboardData,r.dispatchEvent(o)}})),pt(t.lineSpace,"selectstart",(function(e){Vn(t,e)||Ct(e)})),pt(r,"compositionstart",(function(){var t=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:i.markText(t,i.getCursor("to"),{className:"CodeMirror-composing"})}})),pt(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},rl.prototype.createField=function(t){this.wrapper=qa(),this.textarea=this.wrapper.firstChild},rl.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},rl.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,i=Vi(t);if(t.options.moveInputWithCursor){var r=yi(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),s=e.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+s.top-o.top)),i.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+s.left-o.left))}return i},rl.prototype.showSelection=function(t){var e=this.cm,n=e.display;O(n.cursorDiv,t.cursors),O(n.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},rl.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&P(this.textarea),s&&a>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",s&&a>=9&&(this.hasSelection=null))}},rl.prototype.getField=function(){return this.textarea},rl.prototype.supportsTouch=function(){return!1},rl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||N()!=this.textarea))try{this.textarea.focus()}catch(t){}},rl.prototype.blur=function(){this.textarea.blur()},rl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},rl.prototype.receivedFocus=function(){this.slowPoll()},rl.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},rl.prototype.fastPoll=function(){var t=!1,e=this;function n(){var i=e.poll();i||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}e.pollingFast=!0,e.polling.set(20,n)},rl.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!e.state.focused||Rt(n)&&!i&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=n.value;if(r==i&&!e.somethingSelected())return!1;if(s&&a>=9&&this.hasSelection===r||y&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}var l=0,c=Math.min(i.length,r.length);while(l1e3||r.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=r,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},rl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},rl.prototype.onKeyPress=function(){s&&a>=9&&(this.hasSelection=null),this.fastPoll()},rl.prototype.onContextMenu=function(t){var e=this,n=e.cm,i=n.display,r=e.textarea;e.contextMenuPending&&e.contextMenuPending();var o=Ri(n,t),c=i.scroller.scrollTop;if(o&&!h){var u=n.options.resetSelectionOnContextMenu;u&&-1==n.doc.sel.contains(o)&&Er(n,zo)(n.doc,so(o),V);var f,d=r.style.cssText,p=e.wrapper.style.cssText,g=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-g.top-5)+"px; left: "+(t.clientX-g.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(f=window.scrollY),i.input.focus(),l&&window.scrollTo(null,f),i.input.reset(),n.somethingSelected()||(r.value=e.prevInput=" "),e.contextMenuPending=y,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),s&&a>=9&&v(),k){Tt(t);var m=function(){mt(window,"mouseup",m),setTimeout(y,20)};pt(window,"mouseup",m)}else setTimeout(y,50)}function v(){if(null!=r.selectionStart){var t=n.somethingSelected(),o="​"+(t?r.value:"");r.value="⇚",r.value=o,e.prevInput=t?"":"​",r.selectionStart=1,r.selectionEnd=o.length,i.selForContextMenu=n.doc.sel}}function y(){if(e.contextMenuPending==y&&(e.contextMenuPending=!1,e.wrapper.style.cssText=p,r.style.cssText=d,s&&a<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=c),null!=r.selectionStart)){(!s||s&&a<9)&&v();var t=0,o=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&"​"==e.prevInput?Er(n,Go)(n):t++<10?i.detectingSelectAll=setTimeout(o,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(o,200)}}},rl.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},rl.prototype.setUneditable=function(){},rl.prototype.needsContentAttribute=!1,Da(Ba),Ka(Ba);var al="iter insert remove copy getEditor constructor".split(" ");for(var ll in Cs.prototype)Cs.prototype.hasOwnProperty(ll)&&j(al,ll)<0&&(Ba.prototype[ll]=function(t){return function(){return t.apply(this.doc,arguments)}}(Cs.prototype[ll]));return xt(Cs),Ba.inputStyles={textarea:rl,contenteditable:Za},Ba.defineMode=function(t){Ba.defaults.mode||"null"==t||(Ba.defaults.mode=t),jt.apply(this,arguments)},Ba.defineMIME=zt,Ba.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Ba.defineMIME("text/plain","null"),Ba.defineExtension=function(t,e){Ba.prototype[t]=e},Ba.defineDocExtension=function(t,e){Cs.prototype[t]=e},Ba.fromTextArea=ol,sl(Ba),Ba.version="5.65.0",Ba}))},"5bc3":function(t,e){function n(t,e){for(var n=0;ne.length?t:e,u=t.length>e.length?e:t,h=c.indexOf(u);if(-1!=h)return l=[new n.Diff(r,c.substring(0,h)),new n.Diff(o,u),new n.Diff(r,c.substring(h+u.length))],t.length>e.length&&(l[0][0]=l[2][0]=i),l;if(1==u.length)return[new n.Diff(i,t),new n.Diff(r,e)];var f=this.diff_halfMatch_(t,e);if(f){var d=f[0],p=f[1],g=f[2],m=f[3],v=f[4],y=this.diff_main(d,g,s,a),b=this.diff_main(p,m,s,a);return y.concat([new n.Diff(o,v)],b)}return s&&t.length>100&&e.length>100?this.diff_lineMode_(t,e,a):this.diff_bisect_(t,e,a)},n.prototype.diff_lineMode_=function(t,e,s){var a=this.diff_linesToChars_(t,e);t=a.chars1,e=a.chars2;var l=a.lineArray,c=this.diff_main(t,e,!1,s);this.diff_charsToLines_(c,l),this.diff_cleanupSemantic(c),c.push(new n.Diff(o,""));var u=0,h=0,f=0,d="",p="";while(u=1&&f>=1){c.splice(u-h-f,h+f),u=u-h-f;for(var g=this.diff_main(d,p,!1,s),m=g.length-1;m>=0;m--)c.splice(u,0,g[m]);u+=g.length}f=0,h=0,d="",p="";break}u++}return c.pop(),c},n.prototype.diff_bisect_=function(t,e,o){for(var s=t.length,a=e.length,l=Math.ceil((s+a)/2),c=l,u=2*l,h=new Array(u),f=new Array(u),d=0;do)break;for(var x=-w+m;x<=w-v;x+=2){var C=c+x;O=x==-w||x!=w&&h[C-1]s)v+=2;else if(k>a)m+=2;else if(g){var S=c+p-x;if(S>=0&&S=T)return this.diff_bisectSplit_(t,e,O,k,o)}}}for(var L=-w+y;L<=w-b;L+=2){S=c+L;T=L==-w||L!=w&&f[S-1]s)b+=2;else if(M>a)y+=2;else if(!g){C=c+p-L;if(C>=0&&C=T)return this.diff_bisectSplit_(t,e,O,k,o)}}}}return[new n.Diff(i,t),new n.Diff(r,e)]},n.prototype.diff_bisectSplit_=function(t,e,n,i,r){var o=t.substring(0,n),s=e.substring(0,i),a=t.substring(n),l=e.substring(i),c=this.diff_main(o,s,!1,r),u=this.diff_main(a,l,!1,r);return c.concat(u)},n.prototype.diff_linesToChars_=function(t,e){var n=[],i={};function r(t){var e="",r=0,s=-1,a=n.length;while(si?t=t.substring(n-i):ne.length?t:e,i=t.length>e.length?e:t;if(n.length<4||2*i.length=t.length?[i,o,s,a,u]:null}var s,a,l,c,u,h=o(n,i,Math.ceil(n.length/4)),f=o(n,i,Math.ceil(n.length/2));if(!h&&!f)return null;s=f?h&&h[4].length>f[4].length?h:f:h,t.length>e.length?(a=s[0],l=s[1],c=s[2],u=s[3]):(c=s[0],u=s[1],a=s[2],l=s[3]);var d=s[4];return[a,l,c,u,d]},n.prototype.diff_cleanupSemantic=function(t){var e=!1,s=[],a=0,l=null,c=0,u=0,h=0,f=0,d=0;while(c0?s[a-1]:-1,u=0,h=0,f=0,d=0,l=null,e=!0)),c++;e&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),c=1;while(c=v?(m>=p.length/2||m>=g.length/2)&&(t.splice(c,0,new n.Diff(o,g.substring(0,m))),t[c-1][1]=p.substring(0,p.length-m),t[c+1][1]=g.substring(m),c++):(v>=p.length/2||v>=g.length/2)&&(t.splice(c,0,new n.Diff(o,p.substring(0,v))),t[c-1][0]=r,t[c-1][1]=g.substring(0,g.length-v),t[c+1][0]=i,t[c+1][1]=p.substring(v),c++),c++}c++}},n.prototype.diff_cleanupSemanticLossless=function(t){function e(t,e){if(!t||!e)return 6;var i=t.charAt(t.length-1),r=e.charAt(0),o=i.match(n.nonAlphaNumericRegex_),s=r.match(n.nonAlphaNumericRegex_),a=o&&i.match(n.whitespaceRegex_),l=s&&r.match(n.whitespaceRegex_),c=a&&i.match(n.linebreakRegex_),u=l&&r.match(n.linebreakRegex_),h=c&&t.match(n.blanklineEndRegex_),f=u&&e.match(n.blanklineStartRegex_);return h||f?5:c||u?4:o&&!a&&l?3:a||l?2:o||s?1:0}var i=1;while(i=d&&(d=p,u=r,h=s,f=a)}t[i-1][1]!=u&&(u?t[i-1][1]=u:(t.splice(i-1,1),i--),t[i][1]=h,f?t[i+1][1]=f:(t.splice(i+1,1),i--))}i++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(t){var e=!1,s=[],a=0,l=null,c=0,u=!1,h=!1,f=!1,d=!1;while(c0?s[a-1]:-1,f=d=!1),e=!0)),c++;e&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push(new n.Diff(o,""));var e,s=0,a=0,l=0,c="",u="";while(s1?(0!==a&&0!==l&&(e=this.diff_commonPrefix(u,c),0!==e&&(s-a-l>0&&t[s-a-l-1][0]==o?t[s-a-l-1][1]+=u.substring(0,e):(t.splice(0,0,new n.Diff(o,u.substring(0,e))),s++),u=u.substring(e),c=c.substring(e)),e=this.diff_commonSuffix(u,c),0!==e&&(t[s][1]=u.substring(u.length-e)+t[s][1],u=u.substring(0,u.length-e),c=c.substring(0,c.length-e))),s-=a+l,t.splice(s,a+l),c.length&&(t.splice(s,0,new n.Diff(i,c)),s++),u.length&&(t.splice(s,0,new n.Diff(r,u)),s++),s++):0!==s&&t[s-1][0]==o?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,l=0,a=0,c="",u="";break}""===t[t.length-1][1]&&t.pop();var h=!1;s=1;while(se)break;a=o,l=s}return t.length!=n&&t[n][0]===i?l:l+(e-a)},n.prototype.diff_prettyHtml=function(t){for(var e=[],n=/&/g,s=//g,l=/\n/g,c=0;c");switch(u){case r:e[c]=''+f+"";break;case i:e[c]=''+f+"";break;case o:e[c]=""+f+"";break}}return e.join("")},n.prototype.diff_text1=function(t){for(var e=[],n=0;nthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(e),r=this;function o(t,i){var o=t/e.length,s=Math.abs(n-i);return r.Match_Distance?o+s/r.Match_Distance:s?1:o}var s=this.Match_Threshold,a=t.indexOf(e,n);-1!=a&&(s=Math.min(o(0,a),s),a=t.lastIndexOf(e,n+e.length),-1!=a&&(s=Math.min(o(0,a),s)));var l,c,u=1<=p;v--){var y=i[t.charAt(v-1)];if(m[v]=0===d?(m[v+1]<<1|1)&y:(m[v+1]<<1|1)&y|(h[v+1]|h[v])<<1|1|h[v+1],m[v]&u){var b=o(d,v-1);if(b<=s){if(s=b,a=v-1,!(a>n))break;p=Math.max(1,2*n-a)}}}if(o(d+1,n)>s)break;h=m}return a},n.prototype.match_alphabet_=function(t){for(var e={},n=0;n2&&(this.diff_cleanupSemantic(l),this.diff_cleanupEfficiency(l));else if(t&&"object"==typeof t&&"undefined"==typeof e&&"undefined"==typeof s)l=t,a=this.diff_text1(l);else if("string"==typeof t&&e&&"object"==typeof e&&"undefined"==typeof s)a=t,l=e;else{if("string"!=typeof t||"string"!=typeof e||!s||"object"!=typeof s)throw new Error("Unknown call format to patch_make.");a=t,l=s}if(0===l.length)return[];for(var c=[],u=new n.patch_obj,h=0,f=0,d=0,p=a,g=a,m=0;m=2*this.Patch_Margin&&h&&(this.patch_addContext_(u,p),c.push(u),u=new n.patch_obj,h=0,p=g,f=d);break}v!==r&&(f+=y.length),v!==i&&(d+=y.length)}return h&&(this.patch_addContext_(u,p),c.push(u)),c},n.prototype.patch_deepCopy=function(t){for(var e=[],i=0;ithis.Match_MaxBits?(c=this.match_main(e,f.substring(0,this.Match_MaxBits),h),-1!=c&&(d=this.match_main(e,f.substring(f.length-this.Match_MaxBits),h+f.length-this.Match_MaxBits),(-1==d||c>=d)&&(c=-1))):c=this.match_main(e,f,h),-1==c)a[l]=!1,s-=t[l].length2-t[l].length1;else if(a[l]=!0,s=c-h,u=-1==d?e.substring(c,c+f.length):e.substring(c,d+this.Match_MaxBits),f==u)e=e.substring(0,c)+this.diff_text2(t[l].diffs)+e.substring(c+f.length);else{var p=this.diff_main(f,u,!1);if(f.length>this.Match_MaxBits&&this.diff_levenshtein(p)/f.length>this.Patch_DeleteThreshold)a[l]=!1;else{this.diff_cleanupSemanticLossless(p);for(var g,m=0,v=0;va[0][1].length){var l=e-a[0][1].length;a[0][1]=i.substring(a[0][1].length)+a[0][1],s.start1-=l,s.start2-=l,s.length1+=l,s.length2+=l}if(s=t[t.length-1],a=s.diffs,0==a.length||a[a.length-1][0]!=o)a.push(new n.Diff(o,i)),s.length1+=e,s.length2+=e;else if(e>a[a.length-1][1].length){l=e-a[a.length-1][1].length;a[a.length-1][1]+=i.substring(0,l),s.length1+=l,s.length2+=l}return i},n.prototype.patch_splitMax=function(t){for(var e=this.Match_MaxBits,s=0;s2*e?(h.length1+=p.length,l+=p.length,f=!1,h.diffs.push(new n.Diff(d,p)),a.diffs.shift()):(p=p.substring(0,e-h.length1-this.Patch_Margin),h.length1+=p.length,l+=p.length,d===o?(h.length2+=p.length,c+=p.length):f=!1,h.diffs.push(new n.Diff(d,p)),p==a.diffs[0][1]?a.diffs.shift():a.diffs[0][1]=a.diffs[0][1].substring(p.length))}u=this.diff_text2(h.diffs),u=u.substring(u.length-this.Patch_Margin);var g=this.diff_text1(a.diffs).substring(0,this.Patch_Margin);""!==g&&(h.length1+=g.length,h.length2+=g.length,0!==h.diffs.length&&h.diffs[h.diffs.length-1][0]===o?h.diffs[h.diffs.length-1][1]+=g:h.diffs.push(new n.Diff(o,g))),f||t.splice(++s,0,h)}}},n.prototype.patch_toText=function(t){for(var e=[],n=0;n1?arguments[1]:void 0);while(e=e?e.next:n.first){i(e.value,e.key,this);while(e&&e.removed)e=e.previous}},has:function(t){return!!y(this,t)}}),o(d,n?{get:function(t){var e=y(this,t);return e&&e.value},set:function(t,e){return v(this,0===t?0:t,e)}}:{add:function(t){return v(this,t=0===t?0:t,t)}}),h&&i(d,"size",{get:function(){return m(this).size}}),u},setStrong:function(t,e,n){var i=e+" Iterator",r=g(e),o=g(i);c(t,e,(function(t,e){p(this,{type:i,target:t,state:r(t),kind:e,last:void 0})}),(function(){var t=o(this),e=t.kind,n=t.last;while(n&&n.removed)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?"keys"==e?{value:n.key,done:!1}:"values"==e?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),u(e)}}},"6d61":function(t,e,n){"use strict";var i=n("23e7"),r=n("da84"),o=n("e330"),s=n("94ca"),a=n("6eeb"),l=n("f183"),c=n("2266"),u=n("19aa"),h=n("1626"),f=n("861d"),d=n("d039"),p=n("1c7e"),g=n("d44e"),m=n("7156");t.exports=function(t,e,n){var v=-1!==t.indexOf("Map"),y=-1!==t.indexOf("Weak"),b=v?"set":"add",w=r[t],x=w&&w.prototype,C=w,k={},S=function(t){var e=o(x[t]);a(x,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(y&&!f(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return y&&!f(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(y&&!f(t))&&e(this,0===t?0:t)}:function(t,n){return e(this,0===t?0:t,n),this})},T=s(t,!h(w)||!(y||x.forEach&&!d((function(){(new w).entries().next()}))));if(T)C=n.getConstructor(e,t,v,b),l.enable();else if(s(t,!0)){var L=new C,M=L[b](y?{}:-0,1)!=L,O=d((function(){L.has(1)})),A=p((function(t){new w(t)})),_=!y&&d((function(){var t=new w,e=5;while(e--)t[b](e,e);return!t.has(-0)}));A||(C=e((function(t,e){u(t,x);var n=m(new w,t,C);return void 0!=e&&c(e,n[b],{that:n,AS_ENTRIES:v}),n})),C.prototype=x,x.constructor=C),(O||_)&&(S("delete"),S("has"),v&&S("get")),(_||M)&&S(b),y&&x.clear&&delete x.clear}return k[t]=C,i({global:!0,forced:C!=w},k),g(C,t),y||n.setStrong(C,t,v),C}},7289:function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";var e={},n=/[^\s\u00a0]/,i=t.Pos,r=t.cmpPos;function o(t){var e=t.search(n);return-1==e?0:e}function s(t,e,n){return/\bstring\b/.test(t.getTokenTypeAt(i(e.line,0)))&&!/^[\'\"\`]/.test(n)}function a(t,e){var n=t.getMode();return!1!==n.useInnerComments&&n.innerMode?t.getModeAt(e):n}t.commands.toggleComment=function(t){t.toggleComment()},t.defineExtension("toggleComment",(function(t){t||(t=e);for(var n=this,r=1/0,o=this.listSelections(),s=null,a=o.length-1;a>=0;a--){var l=o[a].from(),c=o[a].to();l.line>=r||(c.line>=r&&(c=i(r,0)),r=l.line,null==s?n.uncomment(l,c,t)?s="un":(n.lineComment(l,c,t),s="line"):"un"==s?n.uncomment(l,c,t):n.lineComment(l,c,t))}})),t.defineExtension("lineComment",(function(t,r,l){l||(l=e);var c=this,u=a(c,t),h=c.getLine(t.line);if(null!=h&&!s(c,t,h)){var f=l.lineComment||u.lineComment;if(f){var d=Math.min(0!=r.ch||r.line==t.line?r.line+1:r.line,c.lastLine()+1),p=null==l.padding?" ":l.padding,g=l.commentBlankLines||t.line==r.line;c.operation((function(){if(l.indent){for(var e=null,r=t.line;ra.length)&&(e=a)}for(r=t.line;rf||l.operation((function(){if(0!=s.fullLines){var e=n.test(l.getLine(f));l.replaceRange(d+h,i(f)),l.replaceRange(u+d,i(t.line,0));var a=s.blockCommentLead||c.blockCommentLead;if(null!=a)for(var p=t.line+1;p<=f;++p)(p!=f||e)&&l.replaceRange(a+d,i(p,0))}else{var g=0==r(l.getCursor("to"),o),m=!l.somethingSelected();l.replaceRange(h,o),g&&l.setSelection(m?o:l.getCursor("from"),o),l.replaceRange(u,t)}}))}}else(s.lineComment||c.lineComment)&&0!=s.fullLines&&l.lineComment(t,o,s)})),t.defineExtension("uncomment",(function(t,r,o){o||(o=e);var s,l=this,c=a(l,t),u=Math.min(0!=r.ch||r.line==t.line?r.line:r.line-1,l.lastLine()),h=Math.min(t.line,u),f=o.lineComment||c.lineComment,d=[],p=null==o.padding?" ":o.padding;t:if(f){for(var g=h;g<=u;++g){var m=l.getLine(g),v=m.indexOf(f);if(v>-1&&!/comment/.test(l.getTokenTypeAt(i(g,v+1)))&&(v=-1),-1==v&&n.test(m))break t;if(v>-1&&n.test(m.slice(0,v)))break t;d.push(m)}if(l.operation((function(){for(var t=h;t<=u;++t){var e=d[t-h],n=e.indexOf(f),r=n+f.length;n<0||(e.slice(r,r+p.length)==p&&(r+=p.length),s=!0,l.replaceRange("",i(t,n),i(t,r)))}})),s)return!0}var y=o.blockCommentStart||c.blockCommentStart,b=o.blockCommentEnd||c.blockCommentEnd;if(!y||!b)return!1;var w=o.blockCommentLead||c.blockCommentLead,x=l.getLine(h),C=x.indexOf(y);if(-1==C)return!1;var k=u==h?x:l.getLine(u),S=k.indexOf(b,u==h?C+y.length:0),T=i(h,C+1),L=i(u,S+1);if(-1==S||!/comment/.test(l.getTokenTypeAt(T))||!/comment/.test(l.getTokenTypeAt(L))||l.getRange(T,L,"\n").indexOf(b)>-1)return!1;var M=x.lastIndexOf(y,t.ch),O=-1==M?-1:x.slice(0,t.ch).indexOf(b,M+y.length);if(-1!=M&&-1!=O&&O+b.length!=t.ch)return!1;O=k.indexOf(b,r.ch);var A=k.slice(r.ch).lastIndexOf(y,O-r.ch);return M=-1==O||-1==A?-1:r.ch+A,(-1==O||-1==M||M==r.ch)&&(l.operation((function(){l.replaceRange("",i(u,S-(p&&k.slice(S-p.length,S)==p?p.length:0)),i(u,S+b.length));var t=C+y.length;if(p&&x.slice(t,t+p.length)==p&&(t+=p.length),l.replaceRange("",i(h,C),i(h,t)),w)for(var e=h+1;e<=u;++e){var r=l.getLine(e),o=r.indexOf(w);if(-1!=o&&!n.test(r.slice(0,o))){var s=o+w.length;p&&r.slice(s,s+p.length)==p&&(s+=p.length),l.replaceRange("",i(e,o),i(e,s))}}})),!0)}))}))},"744a":function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return s})),n.d(e,"b",(function(){return a}));var i=n("20a4");const r=(()=>{const t="function"===typeof Promise&&"function"===typeof Promise.resolve;return t?t=>Promise.resolve().then(t):(t,e)=>e(t,0)})(),o=i["a"].WebSocket||i["a"].MozWebSocket,s=!0,a="arraybuffer"},"785f":function(t,e,n){"use strict";n.r(e);var i={};n.r(i),n.d(i,"protocol",(function(){return H})),n.d(i,"PacketType",(function(){return V})),n.d(i,"Encoder",(function(){return $})),n.d(i,"Decoder",(function(){return U}));var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-container",{staticClass:"fill-height",attrs:{fluid:""}},[n("v-row",[n("v-col",{attrs:{cols:12}},[t.logged?n("v-container",[n("v-row",{staticClass:"px-2"},[n("v-col",[t.users.length?t._e():n("p",[t._v(" Please wait while the website is trying to access to the server ")]),n("p",[t._v("Current users: "+t._s(t.users.length)+" users")]),t._l(t.users,(function(e){return n("v-card-text",{key:e.id},[n("div",[t._v("Name")]),n("p",{staticClass:"text-h4 text--primary"},[t._v(" "+t._s(e.name)+" "),e.id==t.socket.id?n("span",{staticClass:"text-center"},[t._v(" (You) "),n("v-btn",{attrs:{align:"right"},on:{click:t.exitRoom}},[t._v(" Exit ")])],1):t._e()])])})),n("v-slider",{attrs:{max:"100",min:"0"},model:{value:t.lossChance,callback:function(e){t.lossChance=e},expression:"lossChance"}}),t._v(" Loss percentage: "+t._s(t.lossChance)+"% ")],2)],1),n("v-row",{staticClass:"px-2"},[n("v-col",[n("Editor",{ref:"editor",on:{input:t.socketUpdateText,newCursor:t.socketUpdateCursor},model:{value:t.code,callback:function(e){t.code=e},expression:"code"}})],1)],1)],1):n("v-container",[n("v-row",{attrs:{align:"center",justify:"center"}},[n("v-col",{attrs:{cols:"12",sm:"8",md:"4"}},[n("p",[t._v(' This project is a PoC realtime collaborative editor using the "diff-match-patch" algorithm by Neil Fraser and the modified version of differential synchronization. ')]),n("p",[t._v(' Enter a string as the room name and a string as your name. Then, call for more people to join the same room. After that you can start editing the text. You can also set the "package loss" attribute to test when the package are loss, the server can still maintain the text in the following iterations. ')]),n("v-form",[n("v-text-field",{attrs:{counter:10,label:"Name",required:""},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}}),n("v-text-field",{attrs:{counter:10,label:"Room",required:""},model:{value:t.room,callback:function(e){t.room=e},expression:"room"}}),n("v-btn",{staticClass:"mr-4",attrs:{color:"green"},on:{click:t.createUser}},[t._v(" Go ")])],1)],1)],1)],1),n("v-snackbar",{attrs:{timeout:t.timeout},model:{value:t.snackbar,callback:function(e){t.snackbar=e},expression:"snackbar"}},[t._v(" "+t._s(t.notiContent)+" ")])],1)],1)],1)},o=[],s=(n("b0c0"),n("5317")),a=n.n(s);function l(t,e="",n){let i=t;n=n||"undefined"!==typeof location&&location,null==t&&(t=n.protocol+"//"+n.host),"string"===typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?n.protocol+t:n.host+t),/^(https?|wss?):\/\//.test(t)||(t="undefined"!==typeof n?n.protocol+"//"+t:"https://"+t),i=a()(t)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";const r=-1!==i.host.indexOf(":"),o=r?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+o+":"+i.port+e,i.href=i.protocol+"://"+o+(n&&n.port===i.port?"":":"+i.port),i}var c=n("c9eb"),u=n.n(c),h=n("20a4"),f=function(t){const e=t.xdomain;try{if("undefined"!==typeof XMLHttpRequest&&(!e||u.a))return new XMLHttpRequest}catch(n){}if(!e)try{return new(h["a"][["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(n){}},d=n("af7f"),p=n("b19d"),g=n("34ba"),m=n("0299"),v=n.n(m),y=n("4f2a"),b=n.n(y),w=n("33e8");class x extends g["a"]{constructor(){super(...arguments),this.polling=!1}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const e=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let t=0;this.polling&&(t++,this.once("pollComplete",(function(){--t||e()}))),this.writable||(t++,this.once("drain",(function(){--t||e()})))}else e()}poll(){this.polling=!0,this.doPoll(),this.emit("poll")}onData(t){const e=t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose(),!1;this.onPacket(t)};Object(w["b"])(t,this.socket.binaryType).forEach(e),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){this.writable=!1,Object(w["d"])(t,t=>{this.doWrite(t,()=>{this.writable=!0,this.emit("drain")})})}uri(){let t=this.query||{};const e=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=v()()),this.supportsBinary||t.sid||(t.b64=1),this.opts.port&&("https"===e&&443!==Number(this.opts.port)||"http"===e&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const i=b.a.encode(t),r=-1!==this.opts.hostname.indexOf(":");return e+"://"+(r?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(i.length?"?"+i:"")}}function C(){}const k=function(){const t=new f({xdomain:!1});return null!=t.responseType}();class S extends x{constructor(t){if(super(t),"undefined"!==typeof location){const e="https:"===location.protocol;let n=location.port;n||(n=e?"443":"80"),this.xd="undefined"!==typeof location&&t.hostname!==location.hostname||n!==t.port,this.xs=t.secure!==e}const e=t&&t.forceBase64;this.supportsBinary=k&&!e}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new T(this.uri(),t)}doWrite(t,e){const n=this.request({method:"POST",data:t});n.on("success",e),n.on("error",t=>{this.onError("xhr post error",t)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",t=>{this.onError("xhr poll error",t)}),this.pollXhr=t}}class T extends p["Emitter"]{constructor(t,e){super(),Object(d["a"])(this,e),this.opts=e,this.method=e.method||"GET",this.uri=t,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.create()}create(){const t=Object(d["b"])(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const e=this.xhr=new f(t);try{e.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0);for(let t in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(t)&&e.setRequestHeader(t,this.opts.extraHeaders[t])}}catch(n){}if("POST"===this.method)try{e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(n){}try{e.setRequestHeader("Accept","*/*")}catch(n){}"withCredentials"in e&&(e.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(e.timeout=this.opts.requestTimeout),e.onreadystatechange=()=>{4===e.readyState&&(200===e.status||1223===e.status?this.onLoad():this.setTimeoutFn(()=>{this.onError("number"===typeof e.status?e.status:0)},0))},e.send(this.data)}catch(n){return void this.setTimeoutFn(()=>{this.onError(n)},0)}"undefined"!==typeof document&&(this.index=T.requestsCount++,T.requests[this.index]=this)}onSuccess(){this.emit("success"),this.cleanup()}onData(t){this.emit("data",t),this.onSuccess()}onError(t){this.emit("error",t),this.cleanup(!0)}cleanup(t){if("undefined"!==typeof this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=C,t)try{this.xhr.abort()}catch(e){}"undefined"!==typeof document&&delete T.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;null!==t&&this.onData(t)}abort(){this.cleanup()}}if(T.requestsCount=0,T.requests={},"undefined"!==typeof document)if("function"===typeof attachEvent)attachEvent("onunload",L);else if("function"===typeof addEventListener){const t="onpagehide"in h["a"]?"pagehide":"unload";addEventListener(t,L,!1)}function L(){for(let t in T.requests)T.requests.hasOwnProperty(t)&&T.requests[t].abort()}var M=n("1f49");const O={websocket:M["a"],polling:S};class A extends p["Emitter"]{constructor(t,e={}){super(),t&&"object"===typeof t&&(e=t,t=null),t?(t=a()(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=a()(e.host).host),Object(d["a"])(this,e),this.secure=null!=e.secure?e.secure:"undefined"!==typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!==typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!==typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=e.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},e),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"===typeof this.opts.query&&(this.opts.query=b.a.decode(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"===typeof addEventListener&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!1),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close")},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const e=_(this.opts.query);e.EIO=w["e"],e.transport=t,this.id&&(e.sid=this.id);const n=Object.assign({},this.opts.transportOptions[t],this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new O[t](n)}open(){let t;if(this.opts.rememberUpgrade&&A.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(e){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",()=>{this.onClose("transport close")})}probe(t){let e=this.createTransport(t),n=!1;A.priorWebsocketSuccess=!1;const i=()=>{n||(e.send([{type:"ping",data:"probe"}]),e.once("packet",t=>{if(!n)if("pong"===t.type&&"probe"===t.data){if(this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;A.priorWebsocketSuccess="websocket"===e.name,this.transport.pause(()=>{n||"closed"!==this.readyState&&(c(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())})}else{const t=new Error("probe error");t.transport=e.name,this.emitReserved("upgradeError",t)}}))};function r(){n||(n=!0,c(),e.close(),e=null)}const o=t=>{const n=new Error("probe error: "+t);n.transport=e.name,r(),this.emitReserved("upgradeError",n)};function s(){o("transport closed")}function a(){o("socket closed")}function l(t){e&&t.name!==e.name&&r()}const c=()=>{e.removeListener("open",i),e.removeListener("error",o),e.removeListener("close",s),this.off("close",a),this.off("upgrading",l)};e.once("open",i),e.once("error",o),e.once("close",s),this.once("close",a),this.once("upgrading",l),e.open()}onOpen(){if(this.readyState="open",A.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){let t=0;const e=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emitReserved("flush"))}write(t,e,n){return this.sendPacket("message",t,e,n),this}send(t,e,n){return this.sendPacket("message",t,e,n),this}sendPacket(t,e,n,i){if("function"===typeof e&&(i=e,e=void 0),"function"===typeof n&&(i=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;n=n||{},n.compress=!1!==n.compress;const r={type:t,data:e,options:n};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},n=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():t()}):this.upgrading?n():t()),this}onError(t){A.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"===typeof removeEventListener&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const e=[];let n=0;const i=t.length;for(;n"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,D=Object.prototype.toString,R="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===D.call(Blob),P="function"===typeof File||"undefined"!==typeof File&&"[object FileConstructor]"===D.call(File);function B(t){return E&&(t instanceof ArrayBuffer||N(t))||R&&t instanceof Blob||P&&t instanceof File}function I(t,e){if(!t||"object"!==typeof t)return!1;if(Array.isArray(t)){for(let e=0,n=t.length;e0;case V.ACK:case V.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}function Y(t){try{return JSON.parse(t)}catch(e){return!1}}class q{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const t=j(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function K(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const G=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class X extends p["Emitter"]{constructor(t,e,n){super(),this.connected=!1,this.disconnected=!0,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,n&&n.auth&&(this.auth=n.auth),this.io._autoConnect&&this.open()}subEvents(){if(this.subs)return;const t=this.io;this.subs=[K(t,"open",this.onopen.bind(this)),K(t,"packet",this.onpacket.bind(this)),K(t,"error",this.onerror.bind(this)),K(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io["_reconnecting"]||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){if(G.hasOwnProperty(t))throw new Error('"'+t+'" is a reserved event name');e.unshift(t);const n={type:V.EVENT,data:e,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"===typeof e[e.length-1]){const t=this.ids++,i=e.pop();this._registerAckCallback(t,i),n.id=t}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable,r=this.flags.volatile&&(!i||!this.connected);return r||(this.connected?this.packet(n):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(t,e){const n=this.flags.timeout;if(void 0===n)return void(this.acks[t]=e);const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let e=0;e{this.io.clearTimeoutFn(i),e.apply(this,[null,...t])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){"function"==typeof this.auth?this.auth(t=>{this.packet({type:V.CONNECT,data:t})}):this.packet({type:V.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t){this.connected=!1,this.disconnected=!0,delete this.id,this.emitReserved("disconnect",t)}onpacket(t){const e=t.nsp===this.nsp;if(e)switch(t.type){case V.CONNECT:if(t.data&&t.data.sid){const e=t.data.sid;this.onconnect(e)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case V.EVENT:this.onevent(t);break;case V.BINARY_EVENT:this.onevent(t);break;case V.ACK:this.onack(t);break;case V.BINARY_ACK:this.onack(t);break;case V.DISCONNECT:this.ondisconnect();break;case V.CONNECT_ERROR:this.destroy();const e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e);break}}onevent(t){const e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const n of e)n.apply(this,t)}super.emit.apply(this,t)}ack(t){const e=this;let n=!1;return function(...i){n||(n=!0,e.packet({type:V.ACK,id:t,data:i}))}}onack(t){const e=this.acks[t.id];"function"===typeof e&&(e.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.disconnected=!1,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>this.packet(t)),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io["_destroy"](this)}disconnect(){return this.connected&&this.packet({type:V.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let n=0;n{n.cleanup(),n._readyState="closed",this.emitReserved("error",e),t?t(e):n.maybeReconnectOnOpen()});if(!1!==this._timeout){const t=this._timeout;0===t&&i();const n=this.setTimeoutFn(()=>{i(),e.close(),e.emit("error",new Error("timeout"))},t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(i),this.subs.push(r),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(K(t,"ping",this.onping.bind(this)),K(t,"data",this.ondata.bind(this)),K(t,"error",this.onerror.bind(this)),K(t,"close",this.onclose.bind(this)),K(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){this.decoder.add(t)}ondecoded(t){this.emitReserved("packet",t)}onerror(t){this.emitReserved("error",t)}socket(t,e){let n=this.nsps[t];return n||(n=new X(this,t,e),this.nsps[t]=n),n}_destroy(t){const e=Object.keys(this.nsps);for(const n of e){const t=this.nsps[n];if(t.active)return}this._close()}_packet(t){const e=this.encoder.encode(t);for(let n=0;nt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open(e=>{e?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):t.onreconnect()}))},e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const tt={};function et(t,e){"object"===typeof t&&(e=t,t=void 0),e=e||{};const n=l(t,e.path||"/socket.io"),i=n.source,r=n.id,o=n.path,s=tt[r]&&o in tt[r]["nsps"],a=e.forceNew||e["force new connection"]||!1===e.multiplex||s;let c;return a?c=new Q(i,e):(tt[r]||(tt[r]=new Q(i,e)),c=tt[r]),n.query&&!e.query&&(e.query=n.queryKey),c.socket(n.path,e)}Object.assign(et,{Manager:Q,Socket:X,io:et,connect:et});var nt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-row",[n("v-col",{staticClass:"px-0"},[n("v-card",{attrs:{outlined:""}},[n("v-row",[n("v-col",{staticClass:"py-0 mt-1"},[n("codemirror",{ref:"myCm",class:t.fontSize,attrs:{value:t.value,options:t.cmOptions},on:{ready:t.onCmReady,input:t.onCodeChange}})],1)],1)],1)],1)],1)},it=[],rt=n("8f94"),ot=(n("56b3"),n("7289"),n("9b74"),n("b933"),n("0b6c"),n("d7d5"),n("f6b6"),n("10b2"),n("a7be"),n("8d2f"),{data:function(){return{autoCloseBrackets:!0,tabSize:4,theme:"default",language:"default",keyMap:"default",fontSize:"normal"}},props:{value:{type:String,required:!1}},components:{codemirror:rt["codemirror"]},computed:{codemirror:function(){return this.$refs.myCm.codemirror},cmOptions:function(){return{tabSize:this.tabSize,indentUnit:this.tabSize,indentWithTabs:!0,smartIndent:!0,autoCloseBrackets:this.autoCloseBrackets,lineNumbers:!0,line:!0,styleActiveLine:!0,matchBrackets:!0,lineWrapping:!0,theme:this.theme,foldGutter:!0,keyMap:this.keyMap,extraKeys:{"Ctrl-/":"toggleComment","Cmd-/":"toggleComment"}}}},methods:{onCmReady:function(t){var e=this;console.log("Codemirror is ready !"),t.on("cursorActivity",(function(t){var n=t.getCursor();e.$emit("newCursor",{line:n.line,ch:n.ch})}))},onCodeChange:function(t){this.$emit("input",t)},modifyCursor:function(t){this.codemirror.setCursor(t)},onNewLine:function(t){var e=t.getDoc(),n=e.getCursor(),i=e.getLine(n.line),r={line:n.line,ch:i.length};return e.replaceRange("\n",r),rt["CodeMirror"].pass}}}),st=ot,at=n("2877"),lt=n("6544"),ct=n.n(lt),ut=n("b0af"),ht=n("ade3"),ft=n("5530"),dt=(n("d3b7"),n("a9e3"),n("b64b"),n("ac1f"),n("5319"),n("4ec9"),n("3ca3"),n("ddb0"),n("caad"),n("159b"),n("2ca0"),n("4b85"),n("2b0e")),pt=n("d9f7"),gt=n("80d2"),mt=["sm","md","lg","xl"],vt=function(){return mt.reduce((function(t,e){return t[e]={type:[Boolean,String,Number],default:!1},t}),{})}(),yt=function(){return mt.reduce((function(t,e){return t["offset"+Object(gt["t"])(e)]={type:[String,Number],default:null},t}),{})}(),bt=function(){return mt.reduce((function(t,e){return t["order"+Object(gt["t"])(e)]={type:[String,Number],default:null},t}),{})}(),wt={col:Object.keys(vt),offset:Object.keys(yt),order:Object.keys(bt)};function xt(t,e,n){var i=t;if(null!=n&&!1!==n){if(e){var r=e.replace(t,"");i+="-".concat(r)}return"col"!==t||""!==n&&!0!==n?(i+="-".concat(n),i.toLowerCase()):i.toLowerCase()}}var Ct=new Map,kt=dt["a"].extend({name:"v-col",functional:!0,props:Object(ft["a"])(Object(ft["a"])(Object(ft["a"])(Object(ft["a"])({cols:{type:[Boolean,String,Number],default:!1}},vt),{},{offset:{type:[String,Number],default:null}},yt),{},{order:{type:[String,Number],default:null}},bt),{},{alignSelf:{type:String,default:null,validator:function(t){return["auto","start","end","center","baseline","stretch"].includes(t)}},tag:{type:String,default:"div"}}),render:function(t,e){var n=e.props,i=e.data,r=e.children,o=(e.parent,"");for(var s in n)o+=String(n[s]);var a=Ct.get(o);return a||function(){var t,e;for(e in a=[],wt)wt[e].forEach((function(t){var i=n[t],r=xt(e,t,i);r&&a.push(r)}));var i=a.some((function(t){return t.startsWith("col-")}));a.push((t={col:!i||!n.cols},Object(ht["a"])(t,"col-".concat(n.cols),n.cols),Object(ht["a"])(t,"offset-".concat(n.offset),n.offset),Object(ht["a"])(t,"order-".concat(n.order),n.order),Object(ht["a"])(t,"align-self-".concat(n.alignSelf),n.alignSelf),t)),Ct.set(o,a)}(),t(n.tag,Object(pt["a"])(i,{class:a}),r)}}),St=(n("2532"),n("99af"),["sm","md","lg","xl"]),Tt=["start","end","center"];function Lt(t,e){return St.reduce((function(n,i){return n[t+Object(gt["t"])(i)]=e(),n}),{})}var Mt=function(t){return[].concat(Tt,["baseline","stretch"]).includes(t)},Ot=Lt("align",(function(){return{type:String,default:null,validator:Mt}})),At=function(t){return[].concat(Tt,["space-between","space-around"]).includes(t)},_t=Lt("justify",(function(){return{type:String,default:null,validator:At}})),Et=function(t){return[].concat(Tt,["space-between","space-around","stretch"]).includes(t)},Nt=Lt("alignContent",(function(){return{type:String,default:null,validator:Et}})),Dt={align:Object.keys(Ot),justify:Object.keys(_t),alignContent:Object.keys(Nt)},Rt={align:"align",justify:"justify",alignContent:"align-content"};function Pt(t,e,n){var i=Rt[t];if(null!=n){if(e){var r=e.replace(t,"");i+="-".concat(r)}return i+="-".concat(n),i.toLowerCase()}}var Bt=new Map,It=dt["a"].extend({name:"v-row",functional:!0,props:Object(ft["a"])(Object(ft["a"])(Object(ft["a"])({tag:{type:String,default:"div"},dense:Boolean,noGutters:Boolean,align:{type:String,default:null,validator:Mt}},Ot),{},{justify:{type:String,default:null,validator:At}},_t),{},{alignContent:{type:String,default:null,validator:Et}},Nt),render:function(t,e){var n=e.props,i=e.data,r=e.children,o="";for(var s in n)o+=String(n[s]);var a=Bt.get(o);return a||function(){var t,e;for(e in a=[],Dt)Dt[e].forEach((function(t){var i=n[t],r=Pt(e,t,i);r&&a.push(r)}));a.push((t={"no-gutters":n.noGutters,"row--dense":n.dense},Object(ht["a"])(t,"align-".concat(n.align),n.align),Object(ht["a"])(t,"justify-".concat(n.justify),n.justify),Object(ht["a"])(t,"align-content-".concat(n.alignContent),n.alignContent),t)),Bt.set(o,a)}(),t(n.tag,Object(pt["a"])(i,{staticClass:"row",class:a}),r)}}),Ft=Object(at["a"])(st,nt,it,!1,null,null,null),Wt=Ft.exports;ct()(Ft,{VCard:ut["a"],VCol:kt,VRow:It});var jt=n("11e3"),zt=n("aaf7"),Ht="https://diffsyncalter-server.herokuapp.com/",Vt={data:function(){return{logged:!1,value:{type:String,required:!1},connected:!1,socket:{},intel:1,name:"",room:"",snackbar:!1,timeout:3e3,notiContent:"",users:[],code:"",clp:"",tc:void 0,resetPass:0,numberValue:0,lossChance:0}},components:{Editor:Wt},mounted:function(){},methods:{createUser:function(){if(""!==this.name&&""!==this.room){this.initializeSocket(),this.logged=!0,console.log(this.name,this.room);var t=this.name,e=this.room;this.socket.emit("join",{name:t,room:e})}},exitRoom:function(){this.logged=!1,this.code="",this.socket.close(),this.users=[]},initializeSocket:function(){var t=this;this.socket=et(Ht,{transports:["websocket","polling","flashsocket"],enabledTransports:["ws","wss"]}),this.socket.on("notification",(function(e){t.notiContent=e.text,t.snackbar=!0})),this.socket.on("init",(function(e){t.tc=new jt(e),t.code=t.tc.code})),this.socket.on("roomData",(function(e){t.users=e.users})),this.socket.on("text",(function(e){t.tc.receivePackage(e),t.code!==t.tc.code&&(t.code=t.tc.code,t.resetPass++)})),setInterval((function(){t.tc&&t.logged&&t.users.length&&100*Math.random()>=t.lossChance&&t.socket.emit("sendText",t.tc.pushPackage())}),1e3)},socketUpdateCursor:function(t){0==t.line&&0==t.ch&&this.resetPass>0?(this.resetPass--,this.$refs.editor.modifyCursor(this.tc.setCursor())):this.tc.updateCursor(t.line,t.ch)},socketUpdateText:function(t){this.tc.code!==t&&(this.tc.code=t,100*Math.random()>=this.lossChance&&this.socket.emit("sendText",this.tc.pushPackage()))}},created:function(){var t=new zt;t.open("GET",Ht,!0),t.send()}},$t=Vt,Ut=n("8336"),Yt=n("99d9");n("4de4"),n("20f6"),n("498a"),n("a15b");function qt(t){return dt["a"].extend({name:"v-".concat(t),functional:!0,props:{id:String,tag:{type:String,default:"div"}},render:function(e,n){var i=n.props,r=n.data,o=n.children;r.staticClass="".concat(t," ").concat(r.staticClass||"").trim();var s=r.attrs;if(s){r.attrs={};var a=Object.keys(s).filter((function(t){if("slot"===t)return!1;var e=s[t];return t.startsWith("data-")?(r.attrs[t]=e,!1):e||"string"===typeof e}));a.length&&(r.staticClass+=" ".concat(a.join(" ")))}return i.id&&(r.domProps=r.domProps||{},r.domProps.id=i.id),e(i.tag,r,o)}})}var Kt,Gt=qt("container").extend({name:"v-container",functional:!0,props:{id:String,tag:{type:String,default:"div"},fluid:{type:Boolean,default:!1}},render:function(t,e){var n,i=e.props,r=e.data,o=e.children,s=r.attrs;return s&&(r.attrs={},n=Object.keys(s).filter((function(t){if("slot"===t)return!1;var e=s[t];return t.startsWith("data-")?(r.attrs[t]=e,!1):e||"string"===typeof e}))),i.id&&(r.domProps=r.domProps||{},r.domProps.id=i.id),t(i.tag,Object(pt["a"])(r,{staticClass:"container",class:Array({"container--fluid":i.fluid}).concat(n||[])}),o)}}),Xt=(n("07ac"),n("7db0"),n("58df")),Zt=n("7e2b"),Jt=n("3206"),Qt=Object(Xt["a"])(Zt["a"],Object(Jt["b"])("form")).extend({name:"v-form",provide:function(){return{form:this}},inheritAttrs:!1,props:{disabled:Boolean,lazyValidation:Boolean,readonly:Boolean,value:Boolean},data:function(){return{inputs:[],watchers:[],errorBag:{}}},watch:{errorBag:{handler:function(t){var e=Object.values(t).includes(!0);this.$emit("input",!e)},deep:!0,immediate:!0}},methods:{watchInput:function(t){var e=this,n=function(t){return t.$watch("hasError",(function(n){e.$set(e.errorBag,t._uid,n)}),{immediate:!0})},i={_uid:t._uid,valid:function(){},shouldValidate:function(){}};return this.lazyValidation?i.shouldValidate=t.$watch("shouldValidate",(function(r){r&&(e.errorBag.hasOwnProperty(t._uid)||(i.valid=n(t)))})):i.valid=n(t),i},validate:function(){return 0===this.inputs.filter((function(t){return!t.validate(!0)})).length},reset:function(){this.inputs.forEach((function(t){return t.reset()})),this.resetErrorBag()},resetErrorBag:function(){var t=this;this.lazyValidation&&setTimeout((function(){t.errorBag={}}),0)},resetValidation:function(){this.inputs.forEach((function(t){return t.resetValidation()})),this.resetErrorBag()},register:function(t){this.inputs.push(t),this.watchers.push(this.watchInput(t))},unregister:function(t){var e=this.inputs.find((function(e){return e._uid===t._uid}));if(e){var n=this.watchers.find((function(t){return t._uid===e._uid}));n&&(n.valid(),n.shouldValidate()),this.watchers=this.watchers.filter((function(t){return t._uid!==e._uid})),this.inputs=this.inputs.filter((function(t){return t._uid!==e._uid})),this.$delete(this.errorBag,e._uid)}}},render:function(t){var e=this;return t("form",{staticClass:"v-form",attrs:Object(ft["a"])({novalidate:!0},this.attrs$),on:{submit:function(t){return e.$emit("submit",t)}}},this.$slots.default)}}),te=(n("d81d"),n("25f0"),n("b680"),n("9e29"),n("1276"),n("d191"),n("c96a"),n("00b4"),n("fb6a"),n("4804"),n("a9ad")),ee=n("af2b"),ne=n("7560");function ie(t){return["fas","far","fal","fab","fad","fak"].some((function(e){return t.includes(e)}))}function re(t){return/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4}(function(t){t["xSmall"]="12px",t["small"]="16px",t["default"]="24px",t["medium"]="28px",t["large"]="36px",t["xLarge"]="40px"})(Kt||(Kt={}));var oe=Object(Xt["a"])(Zt["a"],te["a"],ee["a"],ne["a"]).extend({name:"v-icon",props:{dense:Boolean,disabled:Boolean,left:Boolean,right:Boolean,size:[Number,String],tag:{type:String,required:!1,default:"i"}},computed:{medium:function(){return!1},hasClickListener:function(){return Boolean(this.listeners$.click||this.listeners$["!click"])}},methods:{getIcon:function(){var t="";return this.$slots.default&&(t=this.$slots.default[0].text.trim()),Object(gt["s"])(this,t)},getSize:function(){var t={xSmall:this.xSmall,small:this.small,medium:this.medium,large:this.large,xLarge:this.xLarge},e=Object(gt["o"])(t).find((function(e){return t[e]}));return e&&Kt[e]||Object(gt["e"])(this.size)},getDefaultData:function(){return{staticClass:"v-icon notranslate",class:{"v-icon--disabled":this.disabled,"v-icon--left":this.left,"v-icon--link":this.hasClickListener,"v-icon--right":this.right,"v-icon--dense":this.dense},attrs:Object(ft["a"])({"aria-hidden":!this.hasClickListener,disabled:this.hasClickListener&&this.disabled,type:this.hasClickListener?"button":void 0},this.attrs$),on:this.listeners$}},getSvgWrapperData:function(){var t=this.getSize(),e=Object(ft["a"])(Object(ft["a"])({},this.getDefaultData()),{},{style:t?{fontSize:t,height:t,width:t}:void 0});return this.applyColors(e),e},applyColors:function(t){t.class=Object(ft["a"])(Object(ft["a"])({},t.class),this.themeClasses),this.setTextColor(this.color,t)},renderFontIcon:function(t,e){var n=[],i=this.getDefaultData(),r="material-icons",o=t.indexOf("-"),s=o<=-1;s?n.push(t):(r=t.slice(0,o),ie(r)&&(r="")),i.class[r]=!0,i.class[t]=!s;var a=this.getSize();return a&&(i.style={fontSize:a}),this.applyColors(i),e(this.hasClickListener?"button":this.tag,i,n)},renderSvgIcon:function(t,e){var n={class:"v-icon__svg",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":!0}},i=this.getSize();return i&&(n.style={fontSize:i,height:i,width:i}),e(this.hasClickListener?"button":"span",this.getSvgWrapperData(),[e("svg",n,[e("path",{attrs:{d:t}})])])},renderSvgIconComponent:function(t,e){var n={class:{"v-icon__component":!0}},i=this.getSize();i&&(n.style={fontSize:i,height:i,width:i}),this.applyColors(n);var r=t.component;return n.props=t.props,n.nativeOn=n.on,e(this.hasClickListener?"button":"span",this.getSvgWrapperData(),[e(r,n)])}},render:function(t){var e=this.getIcon();return"string"===typeof e?re(e)?this.renderSvgIcon(e,t):this.renderFontIcon(e,t):this.renderSvgIconComponent(e,t)}}),se=dt["a"].extend({name:"v-icon",$_wrapperFor:oe,functional:!0,render:function(t,e){var n=e.data,i=e.children,r="";return n.domProps&&(r=n.domProps.textContent||n.domProps.innerHTML||r,delete n.domProps.textContent,delete n.domProps.innerHTML),t(oe,n,r?[r]:i)}}),ae=se,le=(n("1b2c"),Object(Xt["a"])(ne["a"]).extend({name:"v-label",functional:!0,props:{absolute:Boolean,color:{type:String,default:"primary"},disabled:Boolean,focused:Boolean,for:String,left:{type:[Number,String],default:0},right:{type:[Number,String],default:"auto"},value:Boolean},render:function(t,e){var n=e.children,i=e.listeners,r=e.props,o={staticClass:"v-label",class:Object(ft["a"])({"v-label--active":r.value,"v-label--is-disabled":r.disabled},Object(ne["b"])(e)),attrs:{for:r.for,"aria-hidden":!r.for},on:i,style:{left:Object(gt["e"])(r.left),right:Object(gt["e"])(r.right),position:r.absolute?"absolute":"relative"},ref:"label"};return t("label",te["a"].options.methods.setTextColor(r.focused&&r.color,o),n)}})),ce=le,ue=(n("8ff2"),Object(Xt["a"])(te["a"],ne["a"]).extend({name:"v-messages",props:{value:{type:Array,default:function(){return[]}}},methods:{genChildren:function(){return this.$createElement("transition-group",{staticClass:"v-messages__wrapper",attrs:{name:"message-transition",tag:"div"}},this.value.map(this.genMessage))},genMessage:function(t,e){return this.$createElement("div",{staticClass:"v-messages__message",key:e},Object(gt["l"])(this,"default",{message:t,key:e})||[t])}},render:function(t){return t("div",this.setTextColor(this.color,{staticClass:"v-messages",class:this.themeClasses}),[this.genChildren()])}})),he=ue,fe=n("53ca"),de=n("d9bd"),pe=Object(Xt["a"])(te["a"],Object(Jt["a"])("form"),ne["a"]),ge=pe.extend({name:"validatable",props:{disabled:Boolean,error:Boolean,errorCount:{type:[Number,String],default:1},errorMessages:{type:[String,Array],default:function(){return[]}},messages:{type:[String,Array],default:function(){return[]}},readonly:Boolean,rules:{type:Array,default:function(){return[]}},success:Boolean,successMessages:{type:[String,Array],default:function(){return[]}},validateOnBlur:Boolean,value:{required:!1}},data:function(){return{errorBucket:[],hasColor:!1,hasFocused:!1,hasInput:!1,isFocused:!1,isResetting:!1,lazyValue:this.value,valid:!1}},computed:{computedColor:function(){if(!this.isDisabled)return this.color?this.color:this.isDark&&!this.appIsDark?"white":"primary"},hasError:function(){return this.internalErrorMessages.length>0||this.errorBucket.length>0||this.error},hasSuccess:function(){return this.internalSuccessMessages.length>0||this.success},externalError:function(){return this.internalErrorMessages.length>0||this.error},hasMessages:function(){return this.validationTarget.length>0},hasState:function(){return!this.isDisabled&&(this.hasSuccess||this.shouldValidate&&this.hasError)},internalErrorMessages:function(){return this.genInternalMessages(this.errorMessages)},internalMessages:function(){return this.genInternalMessages(this.messages)},internalSuccessMessages:function(){return this.genInternalMessages(this.successMessages)},internalValue:{get:function(){return this.lazyValue},set:function(t){this.lazyValue=t,this.$emit("input",t)}},isDisabled:function(){return this.disabled||!!this.form&&this.form.disabled},isInteractive:function(){return!this.isDisabled&&!this.isReadonly},isReadonly:function(){return this.readonly||!!this.form&&this.form.readonly},shouldValidate:function(){return!!this.externalError||!this.isResetting&&(this.validateOnBlur?this.hasFocused&&!this.isFocused:this.hasInput||this.hasFocused)},validations:function(){return this.validationTarget.slice(0,Number(this.errorCount))},validationState:function(){if(!this.isDisabled)return this.hasError&&this.shouldValidate?"error":this.hasSuccess?"success":this.hasColor?this.computedColor:void 0},validationTarget:function(){return this.internalErrorMessages.length>0?this.internalErrorMessages:this.successMessages&&this.successMessages.length>0?this.internalSuccessMessages:this.messages&&this.messages.length>0?this.internalMessages:this.shouldValidate?this.errorBucket:[]}},watch:{rules:{handler:function(t,e){Object(gt["h"])(t,e)||this.validate()},deep:!0},internalValue:function(){this.hasInput=!0,this.validateOnBlur||this.$nextTick(this.validate)},isFocused:function(t){t||this.isDisabled||(this.hasFocused=!0,this.validateOnBlur&&this.$nextTick(this.validate))},isResetting:function(){var t=this;setTimeout((function(){t.hasInput=!1,t.hasFocused=!1,t.isResetting=!1,t.validate()}),0)},hasError:function(t){this.shouldValidate&&this.$emit("update:error",t)},value:function(t){this.lazyValue=t}},beforeMount:function(){this.validate()},created:function(){this.form&&this.form.register(this)},beforeDestroy:function(){this.form&&this.form.unregister(this)},methods:{genInternalMessages:function(t){return t?Array.isArray(t)?t:[t]:[]},reset:function(){this.isResetting=!0,this.internalValue=Array.isArray(this.internalValue)?[]:null},resetValidation:function(){this.isResetting=!0},validate:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1?arguments[1]:void 0,n=[];e=e||this.internalValue,t&&(this.hasInput=this.hasFocused=!0);for(var i=0;i0},hasHint:function(){return!this.hasMessages&&!!this.hint&&(this.persistentHint||this.isFocused)},hasLabel:function(){return!(!this.$slots.label&&!this.label)},internalValue:{get:function(){return this.lazyValue},set:function(t){this.lazyValue=t,this.$emit(this.$_modelEvent,t)}},isDirty:function(){return!!this.lazyValue},isLabelActive:function(){return this.isDirty},messagesToDisplay:function(){var t=this;return this.hasHint?[this.hint]:this.hasMessages?this.validations.map((function(e){if("string"===typeof e)return e;var n=e(t.internalValue);return"string"===typeof n?n:""})).filter((function(t){return""!==t})):[]},showDetails:function(){return!1===this.hideDetails||"auto"===this.hideDetails&&this.hasDetails}},watch:{value:function(t){this.lazyValue=t}},beforeCreate:function(){this.$_modelEvent=this.$options.model&&this.$options.model.event||"input"},methods:{genContent:function(){return[this.genPrependSlot(),this.genControl(),this.genAppendSlot()]},genControl:function(){return this.$createElement("div",{staticClass:"v-input__control",attrs:{title:this.attrs$.title}},[this.genInputSlot(),this.genMessages()])},genDefaultSlot:function(){return[this.genLabel(),this.$slots.default]},genIcon:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this["".concat(t,"Icon")],o="click:".concat(Object(gt["m"])(t)),s=!(!this.listeners$[o]&&!e),a=Object(pt["a"])({attrs:{"aria-label":s?Object(gt["m"])(t).split("-")[0]+" icon":void 0,color:this.validationState,dark:this.dark,disabled:this.isDisabled,light:this.light},on:s?{click:function(t){t.preventDefault(),t.stopPropagation(),n.$emit(o,t),e&&e(t)},mouseup:function(t){t.preventDefault(),t.stopPropagation()}}:void 0},i);return this.$createElement("div",{staticClass:"v-input__icon",class:t?"v-input__icon--".concat(Object(gt["m"])(t)):void 0},[this.$createElement(ae,a,r)])},genInputSlot:function(){return this.$createElement("div",this.setBackgroundColor(this.backgroundColor,{staticClass:"v-input__slot",style:{height:Object(gt["e"])(this.height)},on:{click:this.onClick,mousedown:this.onMouseDown,mouseup:this.onMouseUp},ref:"input-slot"}),[this.genDefaultSlot()])},genLabel:function(){return this.hasLabel?this.$createElement(ce,{props:{color:this.validationState,dark:this.dark,disabled:this.isDisabled,focused:this.hasState,for:this.computedId,light:this.light}},this.$slots.label||this.label):null},genMessages:function(){var t=this;return this.showDetails?this.$createElement(he,{props:{color:this.hasHint?"":this.validationState,dark:this.dark,light:this.light,value:this.messagesToDisplay},attrs:{role:this.hasMessages?"alert":null},scopedSlots:{default:function(e){return Object(gt["l"])(t,"message",e)}}}):null},genSlot:function(t,e,n){if(!n.length)return null;var i="".concat(t,"-").concat(e);return this.$createElement("div",{staticClass:"v-input__".concat(i),ref:i},n)},genPrependSlot:function(){var t=[];return this.$slots.prepend?t.push(this.$slots.prepend):this.prependIcon&&t.push(this.genIcon("prepend")),this.genSlot("prepend","outer",t)},genAppendSlot:function(){var t=[];return this.$slots.append?t.push(this.$slots.append):this.appendIcon&&t.push(this.genIcon("append")),this.genSlot("append","outer",t)},onClick:function(t){this.$emit("click",t)},onMouseDown:function(t){this.hasMouseDown=!0,this.$emit("mousedown",t)},onMouseUp:function(t){this.hasMouseDown=!1,this.$emit("mouseup",t)}},render:function(t){return t("div",this.setTextColor(this.validationState,{staticClass:"v-input",class:this.classes}),this.genContent())}}),ye=ve,be=n("0789"),we=n("297c");function xe(t){if("function"!==typeof t.getRootNode){while(t.parentNode)t=t.parentNode;return t!==document?null:document}var e=t.getRootNode();return e!==document&&e.getRootNode({composed:!0})!==document?null:e}function Ce(){return!0}function ke(t,e,n){if(!t||!1===Se(t,n))return!1;var i=xe(e);if("undefined"!==typeof ShadowRoot&&i instanceof ShadowRoot&&i.host===t.target)return!1;var r=("object"===Object(fe["a"])(n.value)&&n.value.include||function(){return[]})();return r.push(e),!r.some((function(e){return e.contains(t.target)}))}function Se(t,e){var n="object"===Object(fe["a"])(e.value)&&e.value.closeConditional||Ce;return n(t)}function Te(t,e,n,i){var r="function"===typeof n.value?n.value:n.value.handler;e._clickOutside.lastMousedownWasOutside&&ke(t,e,n)&&setTimeout((function(){Se(t,n)&&r&&r(t)}),0)}function Le(t,e){var n=xe(t);e(document),"undefined"!==typeof ShadowRoot&&n instanceof ShadowRoot&&e(n)}var Me={inserted:function(t,e,n){var i=function(i){return Te(i,t,e,n)},r=function(n){t._clickOutside.lastMousedownWasOutside=ke(n,t,e)};Le(t,(function(t){t.addEventListener("click",i,!0),t.addEventListener("mousedown",r,!0)})),t._clickOutside||(t._clickOutside={lastMousedownWasOutside:!0}),t._clickOutside[n.context._uid]={onClick:i,onMousedown:r}},unbind:function(t,e,n){t._clickOutside&&(Le(t,(function(e){var i;if(e&&null!=(i=t._clickOutside)&&i[n.context._uid]){var r=t._clickOutside[n.context._uid],o=r.onClick,s=r.onMousedown;e.removeEventListener("click",o,!0),e.removeEventListener("mousedown",s,!0)}})),delete t._clickOutside[n.context._uid])}},Oe=Me,Ae=Object(Xt["a"])(ye,we["a"]).extend({name:"v-slider",directives:{ClickOutside:Oe},mixins:[we["a"]],props:{disabled:Boolean,inverseLabel:Boolean,max:{type:[Number,String],default:100},min:{type:[Number,String],default:0},step:{type:[Number,String],default:1},thumbColor:String,thumbLabel:{type:[Boolean,String],default:void 0,validator:function(t){return"boolean"===typeof t||"always"===t}},thumbSize:{type:[Number,String],default:32},tickLabels:{type:Array,default:function(){return[]}},ticks:{type:[Boolean,String],default:!1,validator:function(t){return"boolean"===typeof t||"always"===t}},tickSize:{type:[Number,String],default:2},trackColor:String,trackFillColor:String,value:[Number,String],vertical:Boolean},data:function(){return{app:null,oldValue:null,thumbPressed:!1,mouseTimeout:-1,isFocused:!1,isActive:!1,noClick:!1,startOffset:0}},computed:{classes:function(){return Object(ft["a"])(Object(ft["a"])({},ye.options.computed.classes.call(this)),{},{"v-input__slider":!0,"v-input__slider--vertical":this.vertical,"v-input__slider--inverse-label":this.inverseLabel})},internalValue:{get:function(){return this.lazyValue},set:function(t){t=isNaN(t)?this.minValue:t;var e=this.roundValue(Math.min(Math.max(t,this.minValue),this.maxValue));e!==this.lazyValue&&(this.lazyValue=e,this.$emit("input",e))}},trackTransition:function(){return this.thumbPressed?this.showTicks||this.stepNumeric?"0.1s cubic-bezier(0.25, 0.8, 0.5, 1)":"none":""},minValue:function(){return parseFloat(this.min)},maxValue:function(){return parseFloat(this.max)},stepNumeric:function(){return this.step>0?parseFloat(this.step):0},inputWidth:function(){var t=(this.roundValue(this.internalValue)-this.minValue)/(this.maxValue-this.minValue)*100;return isNaN(t)?0:t},trackFillStyles:function(){var t,e=this.vertical?"bottom":"left",n=this.vertical?"top":"right",i=this.vertical?"height":"width",r=this.$vuetify.rtl?"auto":"0",o=this.$vuetify.rtl?"0":"auto",s=this.isDisabled?"calc(".concat(this.inputWidth,"% - 10px)"):"".concat(this.inputWidth,"%");return t={transition:this.trackTransition},Object(ht["a"])(t,e,r),Object(ht["a"])(t,n,o),Object(ht["a"])(t,i,s),t},trackStyles:function(){var t,e=this.vertical?this.$vuetify.rtl?"bottom":"top":this.$vuetify.rtl?"left":"right",n=this.vertical?"height":"width",i="0px",r=this.isDisabled?"calc(".concat(100-this.inputWidth,"% - 10px)"):"calc(".concat(100-this.inputWidth,"%)");return t={transition:this.trackTransition},Object(ht["a"])(t,e,i),Object(ht["a"])(t,n,r),t},showTicks:function(){return this.tickLabels.length>0||!(this.isDisabled||!this.stepNumeric||!this.ticks)},numTicks:function(){return Math.ceil((this.maxValue-this.minValue)/this.stepNumeric)},showThumbLabel:function(){return!this.isDisabled&&!(!this.thumbLabel&&!this.$scopedSlots["thumb-label"])},computedTrackColor:function(){if(!this.isDisabled)return this.trackColor?this.trackColor:this.isDark?this.validationState:this.validationState||"primary lighten-3"},computedTrackFillColor:function(){if(!this.isDisabled)return this.trackFillColor?this.trackFillColor:this.validationState||this.computedColor},computedThumbColor:function(){return this.thumbColor?this.thumbColor:this.validationState||this.computedColor}},watch:{min:function(t){var e=parseFloat(t);e>this.internalValue&&this.$emit("input",e)},max:function(t){var e=parseFloat(t);e0}},o)},genThumbContainer:function(t,e,n,i,r,o){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"thumb",a=[this.genThumb()],l=this.genThumbLabelContent(t);return this.showThumbLabel&&a.push(this.genThumbLabel(l)),this.$createElement("div",this.setTextColor(this.computedThumbColor,{ref:s,key:s,staticClass:"v-slider__thumb-container",class:{"v-slider__thumb-container--active":n,"v-slider__thumb-container--focused":i,"v-slider__thumb-container--show-label":this.showThumbLabel},style:this.getThumbContainerStyles(e),attrs:{role:"slider",tabindex:this.isDisabled?-1:this.$attrs.tabindex?this.$attrs.tabindex:0,"aria-label":this.$attrs["aria-label"]||this.label,"aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":this.internalValue,"aria-readonly":String(this.isReadonly),"aria-orientation":this.vertical?"vertical":"horizontal"},on:{focus:r,blur:o,keydown:this.onKeyDown}}),a)},genThumbLabelContent:function(t){return this.$scopedSlots["thumb-label"]?this.$scopedSlots["thumb-label"]({value:t}):[this.$createElement("span",[String(t)])]},genThumbLabel:function(t){var e=Object(gt["e"])(this.thumbSize),n=this.vertical?"translateY(20%) translateY(".concat(Number(this.thumbSize)/3-1,"px) translateX(55%) rotate(135deg)"):"translateY(-20%) translateY(-12px) translateX(-50%) rotate(45deg)";return this.$createElement(be["b"],{props:{origin:"bottom center"}},[this.$createElement("div",{staticClass:"v-slider__thumb-label-container",directives:[{name:"show",value:this.isFocused||this.isActive||"always"===this.thumbLabel}]},[this.$createElement("div",this.setBackgroundColor(this.computedThumbColor,{staticClass:"v-slider__thumb-label",style:{height:e,width:e,transform:n}}),[this.$createElement("div",t)])])])},genThumb:function(){return this.$createElement("div",this.setBackgroundColor(this.computedThumbColor,{staticClass:"v-slider__thumb"}))},getThumbContainerStyles:function(t){var e=this.vertical?"top":"left",n=this.$vuetify.rtl?100-t:t;return n=this.vertical?100-n:n,Object(ht["a"])({transition:this.trackTransition},e,"".concat(n,"%"))},onSliderMouseDown:function(t){var e,n=this;if(t.preventDefault(),this.oldValue=this.internalValue,this.isActive=!0,null!=(e=t.target)&&e.matches(".v-slider__thumb-container, .v-slider__thumb-container *")){this.thumbPressed=!0;var i=t.target.getBoundingClientRect(),r="touches"in t?t.touches[0]:t;this.startOffset=this.vertical?r.clientY-(i.top+i.height/2):r.clientX-(i.left+i.width/2)}else this.startOffset=0,window.clearTimeout(this.mouseTimeout),this.mouseTimeout=window.setTimeout((function(){n.thumbPressed=!0}),300);var o=!gt["r"]||{passive:!0,capture:!0},s=!!gt["r"]&&{passive:!0},a="touches"in t;this.onMouseMove(t),this.app.addEventListener(a?"touchmove":"mousemove",this.onMouseMove,s),Object(gt["a"])(this.app,a?"touchend":"mouseup",this.onSliderMouseUp,o),this.$emit("start",this.internalValue)},onSliderMouseUp:function(t){t.stopPropagation(),window.clearTimeout(this.mouseTimeout),this.thumbPressed=!1;var e=!!gt["r"]&&{passive:!0};this.app.removeEventListener("touchmove",this.onMouseMove,e),this.app.removeEventListener("mousemove",this.onMouseMove,e),this.$emit("mouseup",t),this.$emit("end",this.internalValue),Object(gt["h"])(this.oldValue,this.internalValue)||(this.$emit("change",this.internalValue),this.noClick=!0),this.isActive=!1},onMouseMove:function(t){"mousemove"===t.type&&(this.thumbPressed=!0),this.internalValue=this.parseMouseMove(t)},onKeyDown:function(t){if(this.isInteractive){var e=this.parseKeyDown(t,this.internalValue);null==e||ethis.maxValue||(this.internalValue=e,this.$emit("change",e))}},onSliderClick:function(t){if(this.noClick)this.noClick=!1;else{var e=this.$refs.thumb;e.focus(),this.onMouseMove(t),this.$emit("change",this.internalValue)}},onBlur:function(t){this.isFocused=!1,this.$emit("blur",t)},onFocus:function(t){this.isFocused=!0,this.$emit("focus",t)},parseMouseMove:function(t){var e=this.vertical?"top":"left",n=this.vertical?"height":"width",i=this.vertical?"clientY":"clientX",r=this.$refs.track.getBoundingClientRect(),o=r[e],s=r[n],a="touches"in t?t.touches[0][i]:t[i],l=Math.min(Math.max((a-o-this.startOffset)/s,0),1)||0;return this.vertical&&(l=1-l),this.$vuetify.rtl&&(l=1-l),parseFloat(this.min)+l*(this.maxValue-this.minValue)},parseKeyDown:function(t,e){if(this.isInteractive){var n=gt["n"].pageup,i=gt["n"].pagedown,r=gt["n"].end,o=gt["n"].home,s=gt["n"].left,a=gt["n"].right,l=gt["n"].down,c=gt["n"].up;if([n,i,r,o,s,a,l,c].includes(t.keyCode)){t.preventDefault();var u=this.stepNumeric||1,h=(this.maxValue-this.minValue)/u;if([s,a,l,c].includes(t.keyCode)){var f=this.$vuetify.rtl?[s,c]:[a,c],d=f.includes(t.keyCode)?1:-1,p=t.shiftKey?3:t.ctrlKey?2:1;e+=d*u*p}else if(t.keyCode===o)e=this.minValue;else if(t.keyCode===r)e=this.maxValue;else{var g=t.keyCode===i?1:-1;e-=g*u*(h>100?h/10:10)}return e}}},roundValue:function(t){if(!this.stepNumeric)return t;var e=this.step.toString().trim(),n=e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0,i=this.minValue%this.stepNumeric,r=Math.round((t-i)/this.stepNumeric)*this.stepNumeric+i;return parseFloat(Math.min(r,this.maxValue).toFixed(n))}}}),_e=(n("ca71"),n("8dd9")),Ee=n("f2e7"),Ne=n("fe6c"),De=Object(Xt["a"])(_e["a"],te["a"],Ee["a"],Object(Ne["b"])(["absolute","bottom","left","right","top"])).extend({name:"v-snackbar",props:{app:Boolean,centered:Boolean,contentClass:{type:String,default:""},multiLine:Boolean,text:Boolean,timeout:{type:[Number,String],default:5e3},transition:{type:[Boolean,String],default:"v-snack-transition",validator:function(t){return"string"===typeof t||!1===t}},vertical:Boolean},data:function(){return{activeTimeout:-1}},computed:{classes:function(){return{"v-snack--absolute":this.absolute,"v-snack--active":this.isActive,"v-snack--bottom":this.bottom||!this.top,"v-snack--centered":this.centered,"v-snack--has-background":this.hasBackground,"v-snack--left":this.left,"v-snack--multi-line":this.multiLine&&!this.vertical,"v-snack--right":this.right,"v-snack--text":this.text,"v-snack--top":this.top,"v-snack--vertical":this.vertical}},hasBackground:function(){return!this.text&&!this.outlined},isDark:function(){return this.hasBackground?!this.light:ne["a"].options.computed.isDark.call(this)},styles:function(){if(this.absolute||!this.app)return{};var t=this.$vuetify.application,e=t.bar,n=t.bottom,i=t.footer,r=t.insetFooter,o=t.left,s=t.right,a=t.top;return{paddingBottom:Object(gt["e"])(n+i+r),paddingLeft:Object(gt["e"])(o),paddingRight:Object(gt["e"])(s),paddingTop:Object(gt["e"])(e+a)}}},watch:{isActive:"setTimeout",timeout:"setTimeout"},mounted:function(){this.isActive&&this.setTimeout()},created:function(){this.$attrs.hasOwnProperty("auto-height")&&Object(de["e"])("auto-height",this),0==this.timeout&&Object(de["d"])('timeout="0"',"-1",this)},methods:{genActions:function(){return this.$createElement("div",{staticClass:"v-snack__action "},[Object(gt["l"])(this,"action",{attrs:{class:"v-snack__btn"}})])},genContent:function(){return this.$createElement("div",{staticClass:"v-snack__content",class:Object(ht["a"])({},this.contentClass,!0),attrs:{role:"status","aria-live":"polite"}},[Object(gt["l"])(this)])},genWrapper:function(){var t=this,e=this.hasBackground?this.setBackgroundColor:this.setTextColor,n=e(this.color,{staticClass:"v-snack__wrapper",class:_e["a"].options.computed.classes.call(this),style:_e["a"].options.computed.styles.call(this),directives:[{name:"show",value:this.isActive}],on:{pointerenter:function(){return window.clearTimeout(t.activeTimeout)},pointerleave:this.setTimeout}});return this.$createElement("div",n,[this.genContent(),this.genActions()])},genTransition:function(){return this.$createElement("transition",{props:{name:this.transition}},[this.genWrapper()])},setTimeout:function(){var t=this;window.clearTimeout(this.activeTimeout);var e=Number(this.timeout);this.isActive&&![0,-1].includes(e)&&(this.activeTimeout=window.setTimeout((function(){t.isActive=!1}),e))}},render:function(t){return t("div",{staticClass:"v-snack",class:this.classes,style:this.styles},[!1!==this.transition?this.genTransition():this.genWrapper()])}}),Re=n("15fd"),Pe=n("6b75");function Be(t){if(Array.isArray(t))return Object(Pe["a"])(t)}n("a4d3"),n("e01a"),n("d28b"),n("a630");function Ie(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}var Fe=n("06c5");function We(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function je(t){return Be(t)||Ie(t)||Object(Fe["a"])(t)||We()}n("0481"),n("4069"),n("2b19"),n("4ff9"),n("e9b1");var ze=Object(Xt["a"])(ne["a"]).extend({name:"v-counter",functional:!0,props:{value:{type:[Number,String],default:""},max:[Number,String]},render:function(t,e){var n=e.props,i=parseInt(n.max,10),r=parseInt(n.value,10),o=i?"".concat(r," / ").concat(i):String(n.value),s=i&&r>i;return t("div",{staticClass:"v-counter",class:Object(ft["a"])({"error--text":s},Object(ne["b"])(e))},o)}}),He=ze,Ve=n("90a2");function $e(t){return dt["a"].extend({name:"intersectable",data:function(){return{isIntersecting:!1}},mounted:function(){Ve["a"].inserted(this.$el,{name:"intersect",value:this.onObserve},this.$vnode)},destroyed:function(){Ve["a"].unbind(this.$el,{name:"intersect",value:this.onObserve},this.$vnode)},methods:{onObserve:function(e,n,i){if(this.isIntersecting=i,i)for(var r=0,o=t.onVisible.length;r0||this.badInput},isEnclosed:function(){return this.filled||this.isSolo||this.outlined},isLabelActive:function(){return this.isDirty||Je.includes(this.type)},isSingle:function(){return this.isSolo||this.singleLine||this.fullWidth||this.filled&&!this.hasLabel},isSolo:function(){return this.solo||this.soloInverted},labelPosition:function(){var t=this.prefix&&!this.labelValue?this.prefixWidth:0;return this.labelValue&&this.prependWidth&&(t-=this.prependWidth),this.$vuetify.rtl===this.reverse?{left:t,right:"auto"}:{left:"auto",right:t}},showLabel:function(){return this.hasLabel&&!(this.isSingle&&this.labelValue)},labelValue:function(){return this.isFocused||this.isLabelActive||this.persistentPlaceholder}},watch:{outlined:"setLabelWidth",label:function(){this.$nextTick(this.setLabelWidth)},prefix:function(){this.$nextTick(this.setPrefixWidth)},isFocused:"updateValue",value:function(t){this.lazyValue=t}},created:function(){this.$attrs.hasOwnProperty("box")&&Object(de["a"])("box","filled",this),this.$attrs.hasOwnProperty("browser-autocomplete")&&Object(de["a"])("browser-autocomplete","autocomplete",this),this.shaped&&!(this.filled||this.outlined||this.isSolo)&&Object(de["c"])("shaped should be used with either filled or outlined",this)},mounted:function(){var t=this;this.$watch((function(){return t.labelValue}),this.setLabelWidth),this.autofocus&&this.tryAutofocus(),requestAnimationFrame((function(){t.isBooted=!0,requestAnimationFrame((function(){t.isIntersecting||t.onResize()}))}))},methods:{focus:function(){this.onFocus()},blur:function(t){var e=this;window.requestAnimationFrame((function(){e.$refs.input&&e.$refs.input.blur()}))},clearableCallback:function(){var t=this;this.$refs.input&&this.$refs.input.focus(),this.$nextTick((function(){return t.internalValue=null}))},genAppendSlot:function(){var t=[];return this.$slots["append-outer"]?t.push(this.$slots["append-outer"]):this.appendOuterIcon&&t.push(this.genIcon("appendOuter")),this.genSlot("append","outer",t)},genPrependInnerSlot:function(){var t=[];return this.$slots["prepend-inner"]?t.push(this.$slots["prepend-inner"]):this.prependInnerIcon&&t.push(this.genIcon("prependInner")),this.genSlot("prepend","inner",t)},genIconSlot:function(){var t=[];return this.$slots.append?t.push(this.$slots.append):this.appendIcon&&t.push(this.genIcon("append")),this.genSlot("append","inner",t)},genInputSlot:function(){var t=ye.options.methods.genInputSlot.call(this),e=this.genPrependInnerSlot();return e&&(t.children=t.children||[],t.children.unshift(e)),t},genClearIcon:function(){return this.clearable?this.isDirty?this.genSlot("append","inner",[this.genIcon("clear",this.clearableCallback)]):this.genSlot("append","inner",[this.$createElement("div")]):null},genCounter:function(){var t,e,n;if(!this.hasCounter)return null;var i=!0===this.counter?this.attrs$.maxlength:this.counter,r={dark:this.dark,light:this.light,max:i,value:this.computedCounterValue};return null!=(t=null==(e=(n=this.$scopedSlots).counter)?void 0:e.call(n,{props:r}))?t:this.$createElement(He,{props:r})},genControl:function(){return ye.options.methods.genControl.call(this)},genDefaultSlot:function(){return[this.genFieldset(),this.genTextFieldSlot(),this.genClearIcon(),this.genIconSlot(),this.genProgress()]},genFieldset:function(){return this.outlined?this.$createElement("fieldset",{attrs:{"aria-hidden":!0}},[this.genLegend()]):null},genLabel:function(){if(!this.showLabel)return null;var t={props:{absolute:!0,color:this.validationState,dark:this.dark,disabled:this.isDisabled,focused:!this.isSingle&&(this.isFocused||!!this.validationState),for:this.computedId,left:this.labelPosition.left,light:this.light,right:this.labelPosition.right,value:this.labelValue}};return this.$createElement(ce,t,this.$slots.label||this.label)},genLegend:function(){var t=this.singleLine||!this.labelValue&&!this.isDirty?0:this.labelWidth,e=this.$createElement("span",{domProps:{innerHTML:"​"},staticClass:"notranslate"});return this.$createElement("legend",{style:{width:this.isSingle?void 0:Object(gt["e"])(t)}},[e])},genInput:function(){var t=Object.assign({},this.listeners$);delete t.change;var e=this.attrs$,n=(e.title,Object(Re["a"])(e,Xe));return this.$createElement("input",{style:{},domProps:{value:"number"===this.type&&Object.is(this.lazyValue,-0)?"-0":this.lazyValue},attrs:Object(ft["a"])(Object(ft["a"])({},n),{},{autofocus:this.autofocus,disabled:this.isDisabled,id:this.computedId,placeholder:this.persistentPlaceholder||this.isFocused||!this.hasLabel?this.placeholder:void 0,readonly:this.isReadonly,type:this.type}),on:Object.assign(t,{blur:this.onBlur,input:this.onInput,focus:this.onFocus,keydown:this.onKeyDown}),ref:"input",directives:[{name:"resize",modifiers:{quiet:!0},value:this.onResize}]})},genMessages:function(){if(!this.showDetails)return null;var t=ye.options.methods.genMessages.call(this),e=this.genCounter();return this.$createElement("div",{staticClass:"v-text-field__details"},[t,e])},genTextFieldSlot:function(){return this.$createElement("div",{staticClass:"v-text-field__slot"},[this.genLabel(),this.prefix?this.genAffix("prefix"):null,this.genInput(),this.suffix?this.genAffix("suffix"):null])},genAffix:function(t){return this.$createElement("div",{class:"v-text-field__".concat(t),ref:t},this[t])},onBlur:function(t){var e=this;this.isFocused=!1,t&&this.$nextTick((function(){return e.$emit("blur",t)}))},onClick:function(){this.isFocused||this.isDisabled||!this.$refs.input||this.$refs.input.focus()},onFocus:function(t){if(this.$refs.input){var e=xe(this.$el);if(e)return e.activeElement!==this.$refs.input?this.$refs.input.focus():void(this.isFocused||(this.isFocused=!0,t&&this.$emit("focus",t)))}},onInput:function(t){var e=t.target;this.internalValue=e.value,this.badInput=e.validity&&e.validity.badInput},onKeyDown:function(t){t.keyCode===gt["n"].enter&&this.lazyValue!==this.initialValue&&(this.initialValue=this.lazyValue,this.$emit("change",this.initialValue)),this.$emit("keydown",t)},onMouseDown:function(t){t.target!==this.$refs.input&&(t.preventDefault(),t.stopPropagation()),ye.options.methods.onMouseDown.call(this,t)},onMouseUp:function(t){this.hasMouseDown&&this.focus(),ye.options.methods.onMouseUp.call(this,t)},setLabelWidth:function(){this.outlined&&(this.labelWidth=this.$refs.label?Math.min(.75*this.$refs.label.scrollWidth+6,this.$el.offsetWidth-24):0)},setPrefixWidth:function(){this.$refs.prefix&&(this.prefixWidth=this.$refs.prefix.offsetWidth)},setPrependWidth:function(){this.outlined&&this.$refs["prepend-inner"]&&(this.prependWidth=this.$refs["prepend-inner"].offsetWidth)},tryAutofocus:function(){if(!this.autofocus||"undefined"===typeof document||!this.$refs.input)return!1;var t=xe(this.$el);return!(!t||t.activeElement===this.$refs.input)&&(this.$refs.input.focus(),!0)},updateValue:function(t){this.hasColor=t,t?this.initialValue=this.lazyValue:this.initialValue!==this.lazyValue&&this.$emit("change",this.lazyValue)},onResize:function(){this.setLabelWidth(),this.setPrefixWidth(),this.setPrependWidth()}}}),tn=Object(at["a"])($t,r,o,!1,null,null,null);e["default"]=tn.exports;ct()(tn,{VBtn:Ut["a"],VCardText:Yt["a"],VCol:kt,VContainer:Gt,VForm:Qt,VRow:It,VSlider:Ae,VSnackbar:De,VTextField:Qe})},"8d2f":function(t,e,n){},"8f94":function(t,e,n){!function(e,i){t.exports=i(n("56b3"))}(0,(function(t){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=3)}([function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),r=function(t){return t&&t.__esModule?t:{default:t}}(i),o=window.CodeMirror||r.default;"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),i=1;i0);return e}function u(t){var e=0;for(l=0;l0&&t.jitter<=1?t.jitter:0,this.attempts=0}t.exports=n,n.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(t){this.ms=t},n.prototype.setMax=function(t){this.max=t},n.prototype.setJitter=function(t){this.jitter=t}},"0b6c":function(t,e,n){(function(t){t(n("56b3"),n("b933"),n("2aed"))})((function(t){"use strict";function e(t,e){return"string"==typeof t?t=new RegExp(t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),e?"gi":"g"):t.global||(t=new RegExp(t.source,t.ignoreCase?"gi":"g")),{token:function(e){t.lastIndex=e.pos;var n=t.exec(e.string);if(n&&n.index==e.pos)return e.pos+=n[0].length||1,"searching";n?e.pos=n.index:e.skipToEnd()}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function i(t){return t.state.search||(t.state.search=new n)}function r(t){return"string"==typeof t&&t==t.toLowerCase()}function o(t,e,n){return t.getSearchCursor(e,n,{caseFold:r(e),multiline:!0})}function s(t,e,n,i,r){t.openDialog(e,i,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){p(t)},onKeyDown:r,bottom:t.options.search.bottom})}function a(t,e,n,i,r){t.openDialog?t.openDialog(e,r,{value:i,selectValueOnOpen:!0,bottom:t.options.search.bottom}):r(prompt(n,i))}function l(t,e,n,i){t.openConfirm?t.openConfirm(e,i):confirm(n)&&i[0]()}function c(t){return t.replace(/\\([nrt\\])/g,(function(t,e){return"n"==e?"\n":"r"==e?"\r":"t"==e?"\t":"\\"==e?"\\":t}))}function u(t){var e=t.match(/^\/(.*)\/([a-z]*)$/);if(e)try{t=new RegExp(e[1],-1==e[2].indexOf("i")?"":"i")}catch(n){}else t=c(t);return("string"==typeof t?""==t:t.test(""))&&(t=/x^/),t}function h(t,n,i){n.queryText=i,n.query=u(i),t.removeOverlay(n.overlay,r(n.query)),n.overlay=e(n.query,r(n.query)),t.addOverlay(n.overlay),t.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=t.showMatchesOnScrollbar(n.query,r(n.query)))}function f(e,n,r,o){var l=i(e);if(l.query)return d(e,n);var c=e.getSelection()||l.lastQuery;if(c instanceof RegExp&&"x^"==c.source&&(c=null),r&&e.openDialog){var u=null,f=function(n,i){t.e_stop(i),n&&(n!=l.queryText&&(h(e,l,n),l.posFrom=l.posTo=e.getCursor()),u&&(u.style.opacity=1),d(e,i.shiftKey,(function(t,n){var i;n.line<3&&document.querySelector&&(i=e.display.wrapper.querySelector(".CodeMirror-dialog"))&&i.getBoundingClientRect().bottom-4>e.cursorCoords(n,"window").top&&((u=i).style.opacity=.4)})))};s(e,m(e),c,f,(function(n,r){var o=t.keyName(n),s=e.getOption("extraKeys"),a=s&&s[o]||t.keyMap[e.getOption("keyMap")][o];"findNext"==a||"findPrev"==a||"findPersistentNext"==a||"findPersistentPrev"==a?(t.e_stop(n),h(e,i(e),r),e.execCommand(a)):"find"!=a&&"findPersistent"!=a||(t.e_stop(n),f(r,n))})),o&&c&&(h(e,l,c),d(e,n))}else a(e,m(e),"Search for:",c,(function(t){t&&!l.query&&e.operation((function(){h(e,l,t),l.posFrom=l.posTo=e.getCursor(),d(e,n)}))}))}function d(e,n,r){e.operation((function(){var s=i(e),a=o(e,s.query,n?s.posFrom:s.posTo);(a.find(n)||(a=o(e,s.query,n?t.Pos(e.lastLine()):t.Pos(e.firstLine(),0)),a.find(n)))&&(e.setSelection(a.from(),a.to()),e.scrollIntoView({from:a.from(),to:a.to()},20),s.posFrom=a.from(),s.posTo=a.to(),r&&r(a.from(),a.to()))}))}function p(t){t.operation((function(){var e=i(t);e.lastQuery=e.query,e.query&&(e.query=e.queryText=null,t.removeOverlay(e.overlay),e.annotate&&(e.annotate.clear(),e.annotate=null))}))}function g(t,e){var n=t?document.createElement(t):document.createDocumentFragment();for(var i in e)n[i]=e[i];for(var r=2;r",triples:"",explode:"[]{}"},n=t.Pos;function i(t,n){return"pairs"==n&&"string"==typeof t?t:"object"==typeof t&&null!=t[n]?t[n]:e[n]}t.defineOption("autoCloseBrackets",!1,(function(e,n,s){s&&s!=t.Init&&(e.removeKeyMap(r),e.state.closeBrackets=null),n&&(o(i(n,"pairs")),e.state.closeBrackets=n,e.addKeyMap(r))}));var r={Backspace:l,Enter:c};function o(t){for(var e=0;e=0;l--){var u=s[l].head;e.replaceRange("",n(u.line,u.ch-1),n(u.line,u.ch+1),"+delete")}}function c(e){var n=a(e),r=n&&i(n,"explode");if(!r||e.getOption("disableInput"))return t.Pass;for(var o=e.listSelections(),s=0;s0?{line:s.head.line,ch:s.head.ch+e}:{line:s.head.line-1};n.push({anchor:a,head:a})}t.setSelections(n,r)}function h(e){var i=t.cmpPos(e.anchor,e.head)>0;return{anchor:new n(e.anchor.line,e.anchor.ch+(i?-1:1)),head:new n(e.head.line,e.head.ch+(i?1:-1))}}function f(e,r){var o=a(e);if(!o||e.getOption("disableInput"))return t.Pass;var s=i(o,"pairs"),l=s.indexOf(r);if(-1==l)return t.Pass;for(var c,f=i(o,"closeBefore"),d=i(o,"triples"),g=s.charAt(l+1)==r,m=e.listSelections(),v=l%2==0,y=0;y1&&d.indexOf(r)>=0&&e.getRange(n(x.line,x.ch-2),x)==r+r){if(x.ch>2&&/\bstring/.test(e.getTokenTypeAt(n(x.line,x.ch-2))))return t.Pass;b="addFour"}else if(g){var k=0==x.ch?" ":e.getRange(n(x.line,x.ch-1),x);if(t.isWordChar(C)||k==r||t.isWordChar(k))return t.Pass;b="both"}else{if(!v||!(0===C.length||/\s/.test(C)||f.indexOf(C)>-1))return t.Pass;b="both"}else b=g&&p(e,x)?"both":d.indexOf(r)>=0&&e.getRange(x,n(x.line,x.ch+3))==r+r+r?"skipThree":"skip";if(c){if(c!=b)return t.Pass}else c=b}var S=l%2?s.charAt(l-1):r,T=l%2?r:s.charAt(l+1);e.operation((function(){if("skip"==c)u(e,1);else if("skipThree"==c)u(e,3);else if("surround"==c){for(var t=e.getSelections(),n=0;n0&&void 0!==arguments[0]?arguments[0]:"";i(this,t),this.code=e,this.shadow=e,this.cursorPos=0,this.localVersion=0,this.remoteVersion=0,this.editStack=[]}return r(t,[{key:"makePatch",value:function(t,e){return s.patch_make(t,e)}},{key:"addLocalChange",value:function(){var t=this.makePatch(this.shadow,this.code);t.length&&(this.editStack.push({patch:t,version:this.localVersion}),this.applyPatchToShadow(t),this.localVersion++)}},{key:"receivePackage",value:function(t){for(var e=this.remoteVersion,n=0;n=this.cursorPos)break;r=t[a].start1;for(var l=0;lthis.code.length&&(this.cursorPos=this.code.length),n}},{key:"applyPatchToShadow",value:function(t){var e=s.patch_apply(t,this.shadow);this.shadow=e[0]}},{key:"pushPackage",value:function(){return this.addLocalChange(),{patches:this.editStack,latestVersion:this.remoteVersion}}},{key:"updateCursor",value:function(t,e){var n=0,i=0;while(i=0;n--)"\n"===this.code[n]&&(e++,-1==t&&(t=n));return{line:e,ch:this.cursorPos-1-t}}}]),t}();t.exports=a},"129f":function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},"1b2c":function(t,e,n){},"1f49":function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return f}));var i=n("34ba"),r=n("4f2a"),o=n.n(r),s=n("0299"),a=n.n(s),l=n("af7f"),c=n("744a"),u=n("33e8");const h="undefined"!==typeof navigator&&"string"===typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class f extends i["a"]{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),e=this.opts.protocols,n=h?{}:Object(l["b"])(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=c["d"]&&!h?e?new c["a"](t,e):new c["a"](t):new c["a"](t,e,n)}catch(i){return this.emit("error",i)}this.ws.binaryType=this.socket.binaryType||c["b"],this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=this.onClose.bind(this),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(e){this.writable=!1;for(let n=0;n{const n={};if(!c["d"]&&(i.options&&(n.compress=i.options.compress),this.opts.perMessageDeflate)){const i="string"===typeof e?t.byteLength(e):e.length;i{this.writable=!0,this.emit("drain")},this.setTimeoutFn)})}}doClose(){"undefined"!==typeof this.ws&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const e=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===e&&443!==Number(this.opts.port)||"ws"===e&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=a()()),this.supportsBinary||(t.b64=1);const i=o.a.encode(t),r=-1!==this.opts.hostname.indexOf(":");return e+"://"+(r?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(i.length?"?"+i:"")}check(){return!!c["a"]&&!("__initialize"in c["a"]&&this.name===f.prototype.name)}}}).call(this,n("b639").Buffer)},"1fb5":function(t,e,n){"use strict";e.byteLength=u,e.toByteArray=f,e.fromByteArray=g;for(var i=[],r=[],o="undefined"!==typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");-1===n&&(n=e);var i=n===e?0:4-n%4;return[n,i]}function u(t){var e=c(t),n=e[0],i=e[1];return 3*(n+i)/4-i}function h(t,e,n){return 3*(e+n)/4-n}function f(t){var e,n,i=c(t),s=i[0],a=i[1],l=new o(h(t,s,a)),u=0,f=a>0?s-4:s;for(n=0;n>16&255,l[u++]=e>>8&255,l[u++]=255&e;return 2===a&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,l[u++]=255&e),1===a&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e),l}function d(t){return i[t>>18&63]+i[t>>12&63]+i[t>>6&63]+i[63&t]}function p(t,e,n){for(var i,r=[],o=e;ol?l:a+s));return 1===r?(e=t[n-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===r&&(e=(t[n-2]<<8)+t[n-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"=")),o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},"20a4":function(t,e,n){"use strict";e["a"]=(()=>"undefined"!==typeof self?self:"undefined"!==typeof window?window:Function("return this")())()},"20f6":function(t,e,n){},"2aed":function(t,e,n){(function(t){t(n("56b3"))})((function(t){function e(e,n,i){var r,o=e.getWrapperElement();return r=o.appendChild(document.createElement("div")),r.className=i?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?r.innerHTML=n:r.appendChild(n),t.addClass(o,"dialog-opened"),r}function n(t,e){t.state.currentNotificationClose&&t.state.currentNotificationClose(),t.state.currentNotificationClose=e}t.defineExtension("openDialog",(function(i,r,o){o||(o={}),n(this,null);var s=e(this,i,o.bottom),a=!1,l=this;function c(e){if("string"==typeof e)h.value=e;else{if(a)return;a=!0,t.rmClass(s.parentNode,"dialog-opened"),s.parentNode.removeChild(s),l.focus(),o.onClose&&o.onClose(s)}}var u,h=s.getElementsByTagName("input")[0];return h?(h.focus(),o.value&&(h.value=o.value,!1!==o.selectValueOnOpen&&h.select()),o.onInput&&t.on(h,"input",(function(t){o.onInput(t,h.value,c)})),o.onKeyUp&&t.on(h,"keyup",(function(t){o.onKeyUp(t,h.value,c)})),t.on(h,"keydown",(function(e){o&&o.onKeyDown&&o.onKeyDown(e,h.value,c)||((27==e.keyCode||!1!==o.closeOnEnter&&13==e.keyCode)&&(h.blur(),t.e_stop(e),c()),13==e.keyCode&&r(h.value,e))})),!1!==o.closeOnBlur&&t.on(s,"focusout",(function(t){null!==t.relatedTarget&&c()}))):(u=s.getElementsByTagName("button")[0])&&(t.on(u,"click",(function(){c(),l.focus()})),!1!==o.closeOnBlur&&t.on(u,"blur",c),u.focus()),c})),t.defineExtension("openConfirm",(function(i,r,o){n(this,null);var s=e(this,i,o&&o.bottom),a=s.getElementsByTagName("button"),l=!1,c=this,u=1;function h(){l||(l=!0,t.rmClass(s.parentNode,"dialog-opened"),s.parentNode.removeChild(s),c.focus())}a[0].focus();for(var f=0;f{r[i[t]]=t});const o={type:"error",data:"parser error"},s="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),a="function"===typeof ArrayBuffer,l=t=>"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,c=({type:t,data:e},n,r)=>s&&e instanceof Blob?n?r(e):u(e,r):a&&(e instanceof ArrayBuffer||l(e))?n?r(e):u(new Blob([e]),r):r(i[t]+(e||"")),u=(t,e)=>{const n=new FileReader;return n.onload=function(){const t=n.result.split(",")[1];e("b"+t)},n.readAsDataURL(t)};for(var h=c,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d="undefined"===typeof Uint8Array?[]:new Uint8Array(256),p=0;p>4,u[l++]=(15&i)<<4|r>>2,u[l++]=(3&r)<<6|63&o;return c};const m="function"===typeof ArrayBuffer,v=(t,e)=>{if("string"!==typeof t)return{type:"message",data:b(t,e)};const n=t.charAt(0);if("b"===n)return{type:"message",data:y(t.substring(1),e)};const i=r[n];return i?t.length>1?{type:r[n],data:t.substring(1)}:{type:r[n]}:o},y=(t,e)=>{if(m){const n=g(t);return b(n,e)}return{base64:!0,data:t}},b=(t,e)=>{switch(e){case"blob":return t instanceof ArrayBuffer?new Blob([t]):t;case"arraybuffer":default:return t}};var w=v;const x=String.fromCharCode(30),C=(t,e)=>{const n=t.length,i=new Array(n);let r=0;t.forEach((t,o)=>{h(t,!1,t=>{i[o]=t,++r===n&&e(i.join(x))})})},k=(t,e)=>{const n=t.split(x),i=[];for(let r=0;r2),m=/Android/.test(t),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=g||/Mac/.test(e),b=/\bCrOS\b/.test(t),w=/win/i.test(e),x=h&&t.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(h=!1,l=!0);var C=y&&(c||h&&(null==x||x<12.11)),k=n||s&&a>=9;function S(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var T,L=function(t,e){var n=t.className,i=S(e).exec(n);if(i){var r=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function M(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function O(t,e){return M(t).appendChild(e)}function A(t,e,n,i){var r=document.createElement(t);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof e)r.appendChild(document.createTextNode(e));else if(e)for(var o=0;o=e)return s+(e-o);s+=a-o,s+=n-s%n,o=a+1}}g?P=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:s&&(P=function(t){try{t.select()}catch(e){}});var W=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};function j(t,e){for(var n=0;n=e)return i+Math.min(s,e-r);if(r+=o-i,r+=n-r%n,i=o+1,r>=e)return i}}var q=[""];function K(t){while(q.length<=t)q.push(G(q)+" ");return q[t]}function G(t){return t[t.length-1]}function X(t,e){for(var n=[],i=0;i"€"&&(t.toUpperCase()!=t.toLowerCase()||tt.test(t))}function nt(t,e){return e?!!(e.source.indexOf("\\w")>-1&&et(t))||e.test(t):et(t)}function it(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var rt=/[\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 ot(t){return t.charCodeAt(0)>=768&&rt.test(t)}function st(t,e,n){while((n<0?e>0:en?-1:1;;){if(e==n)return e;var r=(e+n)/2,o=i<0?Math.ceil(r):Math.floor(r);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+i}}function lt(t,e,n,i){if(!t)return i(e,n,"ltr",0);for(var r=!1,o=0;oe||e==n&&s.to==e)&&(i(Math.max(s.from,e),Math.min(s.to,n),1==s.level?"rtl":"ltr",o),r=!0)}r||i(e,n,"ltr")}var ct=null;function ut(t,e,n){var i;ct=null;for(var r=0;re)return r;o.to==e&&(o.from!=o.to&&"before"==n?i=r:ct=r),o.from==e&&(o.from!=o.to&&"before"!=n?i=r:ct=r)}return null!=i?i:ct}var ht=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?t.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?e.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,o=/[LRr]/,s=/[Lb1n]/,a=/[1n]/;function l(t,e,n){this.level=t,this.from=e,this.to=n}return function(t,e){var c="ltr"==e?"L":"R";if(0==t.length||"ltr"==e&&!i.test(t))return!1;for(var u=t.length,h=[],f=0;f-1&&(i[e]=r.slice(0,o).concat(r.slice(o+1)))}}}function vt(t,e){var n=gt(t,e);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r0}function xt(t){t.prototype.on=function(t,e){pt(this,t,e)},t.prototype.off=function(t,e){mt(this,t,e)}}function Ct(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function kt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function St(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Tt(t){Ct(t),kt(t)}function Lt(t){return t.target||t.srcElement}function Mt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var Ot,At,_t=function(){if(s&&a<9)return!1;var t=A("div");return"draggable"in t||"dragDrop"in t}();function Et(t){if(null==Ot){var e=A("span","​");O(t,A("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Ot=e.offsetWidth<=1&&e.offsetHeight>2&&!(s&&a<8))}var n=Ot?A("span","​"):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Nt(t){if(null!=At)return At;var e=O(t,document.createTextNode("AخA")),n=T(e,0,1).getBoundingClientRect(),i=T(e,1,2).getBoundingClientRect();return M(t),!(!n||n.left==n.right)&&(At=i.right-n.right<3)}var Dt=3!="\n\nb".split(/\n/).length?function(t){var e=0,n=[],i=t.length;while(e<=i){var r=t.indexOf("\n",e);-1==r&&(r=t.length);var o=t.slice(e,"\r"==t.charAt(r-1)?r-1:r),s=o.indexOf("\r");-1!=s?(n.push(o.slice(0,s)),e+=s+1):(n.push(o),e=r+1)}return n}:function(t){return t.split(/\r\n?|\n/)},Rt=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(e){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(n){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Pt=function(){var t=A("div");return"oncopy"in t||(t.setAttribute("oncopy","return;"),"function"==typeof t.oncopy)}(),Bt=null;function It(t){if(null!=Bt)return Bt;var e=O(t,A("span","x")),n=e.getBoundingClientRect(),i=T(e,0,1).getBoundingClientRect();return Bt=Math.abs(n.left-i.left)>1}var Ft={},Wt={};function jt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Ft[t]=e}function zt(t,e){Wt[t]=e}function Ht(t){if("string"==typeof t&&Wt.hasOwnProperty(t))t=Wt[t];else if(t&&"string"==typeof t.name&&Wt.hasOwnProperty(t.name)){var e=Wt[t.name];"string"==typeof e&&(e={name:e}),t=Q(e,t),t.name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Ht("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Ht("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Vt(t,e){e=Ht(e);var n=Ft[e.name];if(!n)return Vt(t,"text/plain");var i=n(t,e);if($t.hasOwnProperty(e.name)){var r=$t[e.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=e.name,e.helperType&&(i.helperType=e.helperType),e.modeProps)for(var s in e.modeProps)i[s]=e.modeProps[s];return i}var $t={};function Ut(t,e){var n=$t.hasOwnProperty(t)?$t[t]:$t[t]={};I(e,n)}function Yt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var i in e){var r=e[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function qt(t,e){var n;while(t.innerMode){if(n=t.innerMode(e),!n||n.mode==t)break;e=n.state,t=n.mode}return n||{mode:t,state:e}}function Kt(t,e,n){return!t.startState||t.startState(e,n)}var Gt=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Xt(t,e){if(e-=t.first,e<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");var n=t;while(!n.lines)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(e=t.first&&en?re(n,Xt(t,n).text.length):fe(e,Xt(t,e.line).text.length)}function fe(t,e){var n=t.ch;return null==n||n>e?re(t.line,e):n<0?re(t.line,0):t}function de(t,e){for(var n=[],i=0;i=this.string.length},Gt.prototype.sol=function(){return this.pos==this.lineStart},Gt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Gt.prototype.next=function(){if(this.pose},Gt.prototype.eatSpace=function(){var t=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>t},Gt.prototype.skipToEnd=function(){this.pos=this.string.length},Gt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Gt.prototype.backUp=function(t){this.pos-=t},Gt.prototype.column=function(){return this.lastColumnPos0?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}var r=function(t){return n?t.toLowerCase():t},o=this.string.substr(this.pos,t.length);if(r(o)==r(t))return!1!==e&&(this.pos+=t.length),!0},Gt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Gt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Gt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Gt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var pe=function(t,e){this.state=t,this.lookAhead=e},ge=function(t,e,n,i){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function me(t,e,n,i){var r=[t.state.modeGen],o={};Te(t,e.text,t.doc.mode,n,(function(t,e){return r.push(t,e)}),o,i);for(var s=n.state,a=function(i){n.baseTokens=r;var a=t.state.overlays[i],l=1,c=0;n.state=!0,Te(t,e.text,a.mode,n,(function(t,e){var n=l;while(ct&&r.splice(l,1,t,r[l+1],i),l+=2,c=Math.min(t,i)}if(e)if(a.opaque)r.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;nt.options.maxHighlightLength&&Yt(t.doc.mode,i.state),o=me(t,e,i);r&&(i.state=r),e.stateAfter=i.save(!r),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function ye(t,e,n){var i=t.doc,r=t.display;if(!i.mode.startState)return new ge(i,!0,e);var o=Le(t,e,n),s=o>i.first&&Xt(i,o-1).stateAfter,a=s?ge.fromSaved(i,s,o):new ge(i,Kt(i.mode),o);return i.iter(o,e,(function(n){be(t,n.text,a);var i=a.line;n.stateAfter=i==e-1||i%5==0||i>=r.viewFrom&&ie.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}ge.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},ge.prototype.baseToken=function(t){if(!this.baseTokens)return null;while(this.baseTokens[this.baseTokenPos]<=t)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},ge.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ge.fromSaved=function(t,e,n){return e instanceof pe?new ge(t,Yt(t.mode,e.state),n,e.lookAhead):new ge(t,Yt(t.mode,e),n)},ge.prototype.save=function(t){var e=!1!==t?Yt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new pe(e,this.maxLookAhead):e};var Ce=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function ke(t,e,n,i){var r,o=t.doc,s=o.mode;e=he(o,e);var a,l=Xt(o,e.line),c=ye(t,e.line,n),u=new Gt(l.text,t.options.tabSize,c);i&&(a=[]);while((i||u.post.options.maxHighlightLength?(a=!1,s&&be(t,e,i,h.pos),h.pos=e.length,l=null):l=Se(xe(n,h,i.state,f),o),f){var d=f[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!a||u!=l){while(cs;--a){if(a<=o.first)return o.first;var l=Xt(o,a-1),c=l.stateAfter;if(c&&(!n||a+(c instanceof pe?c.lookAhead:0)<=o.modeFrontier))return a;var u=F(l.text,null,t.options.tabSize);(null==r||i>u)&&(r=a-1,i=u)}return r}function Me(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;i--){var r=Xt(t,i).stateAfter;if(r&&(!(r instanceof pe)||i+r.lookAhead=e:o.to>e);(i||(i=[])).push(new Ne(s,o.from,l?null:o.to))}}return i}function Ie(t,e,n){var i;if(t)for(var r=0;r=e:o.to>e);if(a||o.from==e&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(s.inclusiveLeft?o.from<=e:o.from0&&a)for(var w=0;w0)){var u=[l,1],h=oe(c.from,a.from),f=oe(c.to,a.to);(h<0||!s.inclusiveLeft&&!h)&&u.push({from:c.from,to:a.from}),(f>0||!s.inclusiveRight&&!f)&&u.push({from:a.to,to:c.to}),r.splice.apply(r,u),l+=u.length-3}}return r}function ze(t){var e=t.markedSpans;if(e){for(var n=0;ne)&&(!n||Ue(n,o.marker)<0)&&(n=o.marker)}return n}function Xe(t,e,n,i,r){var o=Xt(t,e),s=Ae&&o.markedSpans;if(s)for(var a=0;a=0&&h<=0||u<=0&&h>=0)&&(u<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?oe(c.to,n)>=0:oe(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?oe(c.from,i)<=0:oe(c.from,i)<0)))return!0}}}function Ze(t){var e;while(e=qe(t))t=e.find(-1,!0).line;return t}function Je(t){var e;while(e=Ke(t))t=e.find(1,!0).line;return t}function Qe(t){var e,n;while(e=Ke(t))t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function tn(t,e){var n=Xt(t,e),i=Ze(n);return n==i?e:te(i)}function en(t,e){if(e>t.lastLine())return e;var n,i=Xt(t,e);if(!nn(t,i))return e;while(n=Ke(i))i=n.find(1,!0).line;return te(i)+1}function nn(t,e){var n=Ae&&e.markedSpans;if(n)for(var i=void 0,r=0;re.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var ln=function(t,e,n){this.text=t,He(this,e),this.height=n?n(this):1};function cn(t,e,n,i){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),ze(t),He(t,n);var r=i?i(t):1;r!=t.height&&Qt(t,r)}function un(t){t.parent=null,ze(t)}ln.prototype.lineNo=function(){return te(this)},xt(ln);var hn={},fn={};function dn(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?fn:hn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function pn(t,e){var n=_("span",null,null,l?"padding-right: .1px":null),i={pre:_("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var r=0;r<=(e.rest?e.rest.length:0);r++){var o=r?e.rest[r-1]:e.line,s=void 0;i.pos=0,i.addToken=mn,Nt(t.display.measure)&&(s=ft(o,t.doc.direction))&&(i.addToken=yn(i.addToken,s)),i.map=[];var a=e!=t.display.externalMeasured&&te(o);wn(o,i,ve(t,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=R(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=R(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Et(t.display.measure))),0==r?(e.measure.map=i.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(i.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var c=i.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return vt(t,"renderLine",t,e.line,i.pre),i.pre.className&&(i.textClass=R(i.pre.className,i.textClass||"")),i}function gn(t){var e=A("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function mn(t,e,n,i,r,o,l){if(e){var c,u=t.splitSpaces?vn(e,t.trailingSpace):e,h=t.cm.state.specialChars,f=!1;if(h.test(e)){c=document.createDocumentFragment();var d=0;while(1){h.lastIndex=d;var p=h.exec(e),g=p?p.index-d:e.length-d;if(g){var m=document.createTextNode(u.slice(d,d+g));s&&a<9?c.appendChild(A("span",[m])):c.appendChild(m),t.map.push(t.pos,t.pos+g,m),t.col+=g,t.pos+=g}if(!p)break;d+=g+1;var v=void 0;if("\t"==p[0]){var y=t.cm.options.tabSize,b=y-t.col%y;v=c.appendChild(A("span",K(b),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),t.col+=b}else"\r"==p[0]||"\n"==p[0]?(v=c.appendChild(A("span","\r"==p[0]?"␍":"␤","cm-invalidchar")),v.setAttribute("cm-text",p[0]),t.col+=1):(v=t.cm.options.specialCharPlaceholder(p[0]),v.setAttribute("cm-text",p[0]),s&&a<9?c.appendChild(A("span",[v])):c.appendChild(v),t.col+=1);t.map.push(t.pos,t.pos+1,v),t.pos++}}else t.col+=e.length,c=document.createTextNode(u),t.map.push(t.pos,t.pos+e.length,c),s&&a<9&&(f=!0),t.pos+=e.length;if(t.trailingSpace=32==u.charCodeAt(e.length-1),n||i||r||f||o||l){var w=n||"";i&&(w+=i),r&&(w+=r);var x=A("span",[c],w,o);if(l)for(var C in l)l.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,l[C]);return t.content.appendChild(x)}t.content.appendChild(c)}}function vn(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,i="",r=0;rc&&h.from<=c)break;if(h.to>=u)return t(n,i,r,o,s,a,l);t(n,i.slice(0,h.to-c),r,o,null,a,l),o=null,i=i.slice(h.to-c),c=h.to}}}function bn(t,e,n,i){var r=!i&&n.widgetNode;r&&t.map.push(t.pos,t.pos+e,r),!i&&t.cm.display.input.needsContentAttribute&&(r||(r=t.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(t.cm.display.input.setUneditable(r),t.content.appendChild(r)),t.pos+=e,t.trailingSpace=!1}function wn(t,e,n){var i=t.markedSpans,r=t.text,o=0;if(i)for(var s,a,l,c,u,h,f,d=r.length,p=0,g=1,m="",v=0;;){if(v==p){l=c=u=a="",f=null,h=null,v=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&&v>x.to&&(v=x.to,c=""),C.className&&(l+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&x.from==p&&(u+=" "+C.startStyle),C.endStyle&&x.to==v&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((f||(f={})).title=C.title),C.attributes)for(var k in C.attributes)(f||(f={}))[k]=C.attributes[k];C.collapsed&&(!h||Ue(h.marker,C)<0)&&(h=x)}else x.from>p&&v>x.from&&(v=x.from)}if(b)for(var S=0;S=d)break;var L=Math.min(d,v);while(1){if(m){var M=p+m.length;if(!h){var O=M>L?m.slice(0,L-p):m;e.addToken(e,O,s?s+l:l,u,p+O.length==v?c:"",a,f)}if(M>=L){m=m.slice(L-p),p=L;break}p=M,u=""}m=r.slice(o,o=n[g++]),s=dn(n[g++],e.cm.options)}}else for(var A=1;A2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Zn(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};if(t.rest){for(var i=0;in)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}}function Jn(t,e){e=Ze(e);var n=te(e),i=t.display.externalMeasured=new xn(t.doc,e,n);i.lineN=n;var r=i.built=pn(t,i);return i.text=r.pre,O(t.display.lineMeasure,r.pre),i}function Qn(t,e,n,i){return ni(t,ei(t,e),n,i)}function ti(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&ee)&&(o=l-a,r=o-1,e>=l&&(s="right")),null!=r){if(i=t[c+2],a==l&&n==(i.insertLeft?"left":"right")&&(s=n),"left"==n&&0==r)while(c&&t[c-2]==t[c-3]&&t[c-1].insertLeft)i=t[2+(c-=3)],s="left";if("right"==n&&r==l-a)while(c=0;r--)if((n=t[r]).left!=n.right)break;return n}function ai(t,e,n,i){var r,o=oi(e.map,n,i),l=o.node,c=o.start,u=o.end,h=o.collapse;if(3==l.nodeType){for(var f=0;f<4;f++){while(c&&ot(e.line.text.charAt(o.coverStart+c)))--c;while(o.coverStart+u0&&(h=i="right"),r=t.options.lineWrapping&&(d=l.getClientRects()).length>1?d["right"==i?d.length-1:0]:l.getBoundingClientRect()}if(s&&a<9&&!c&&(!r||!r.left&&!r.right)){var p=l.parentNode.getClientRects()[0];r=p?{left:p.left,right:p.left+Ai(t.display),top:p.top,bottom:p.bottom}:ri}for(var g=r.top-e.rect.top,m=r.bottom-e.rect.top,v=(g+m)/2,y=e.view.measure.heights,b=0;b=i.text.length?(l=i.text.length,c="before"):l<=0&&(l=0,c="after"),!a)return s("before"==c?l-1:l,"before"==c);function u(t,e,n){var i=a[e],r=1==i.level;return s(n?t-1:t,r!=n)}var h=ut(a,l,c),f=ct,d=u(l,h,"before"==c);return null!=f&&(d.other=u(l,f,"before"!=c)),d}function bi(t,e){var n=0;e=he(t.doc,e),t.options.lineWrapping||(n=Ai(t.display)*e.ch);var i=Xt(t.doc,e.line),r=on(i)+$n(t.display);return{left:n,right:n,top:r,bottom:r+i.height}}function wi(t,e,n,i,r){var o=re(t,e,n);return o.xRel=r,i&&(o.outside=i),o}function xi(t,e,n){var i=t.doc;if(n+=t.display.viewOffset,n<0)return wi(i.first,0,null,-1,-1);var r=ee(i,n),o=i.first+i.size-1;if(r>o)return wi(i.first+i.size-1,Xt(i,o).text.length,null,1,1);e<0&&(e=0);for(var s=Xt(i,r);;){var a=Ti(t,s,r,e,n),l=Ge(s,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var c=l.find(1);if(c.line==r)return c;s=Xt(i,r=c.line)}}function Ci(t,e,n,i){i-=pi(e);var r=e.text.length,o=at((function(e){return ni(t,n,e-1).bottom<=i}),r,0);return r=at((function(e){return ni(t,n,e).top>i}),o,r),{begin:o,end:r}}function ki(t,e,n,i){n||(n=ei(t,e));var r=gi(t,e,ni(t,n,i),"line").top;return Ci(t,e,n,r)}function Si(t,e,n,i){return!(t.bottom<=n)&&(t.top>n||(i?t.left:t.right)>e)}function Ti(t,e,n,i,r){r-=on(e);var o=ei(t,e),s=pi(e),a=0,l=e.text.length,c=!0,u=ft(e,t.doc.direction);if(u){var h=(t.options.lineWrapping?Mi:Li)(t,e,n,o,u,i,r);c=1!=h.level,a=c?h.from:h.to-1,l=c?h.to:h.from-1}var f,d,p=null,g=null,m=at((function(e){var n=ni(t,o,e);return n.top+=s,n.bottom+=s,!!Si(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(p=e,g=n),!0)}),a,l),v=!1;if(g){var y=i-g.left=w.bottom?1:0}return m=st(e.text,m,1),wi(n,m,d,v,i-f)}function Li(t,e,n,i,r,o,s){var a=at((function(a){var l=r[a],c=1!=l.level;return Si(yi(t,re(n,c?l.to:l.from,c?"before":"after"),"line",e,i),o,s,!0)}),0,r.length-1),l=r[a];if(a>0){var c=1!=l.level,u=yi(t,re(n,c?l.from:l.to,c?"after":"before"),"line",e,i);Si(u,o,s,!0)&&u.top>s&&(l=r[a-1])}return l}function Mi(t,e,n,i,r,o,s){var a=Ci(t,e,i,s),l=a.begin,c=a.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,h=null,f=0;f=c||d.to<=l)){var p=1!=d.level,g=ni(t,i,p?Math.min(c,d.to)-1:Math.max(l,d.from)).right,m=gm)&&(u=d,h=m)}}return u||(u=r[r.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function Oi(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==ii){ii=A("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)ii.appendChild(document.createTextNode("x")),ii.appendChild(A("br"));ii.appendChild(document.createTextNode("x"))}O(t.measure,ii);var n=ii.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),M(t.measure),n||1}function Ai(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=A("span","xxxxxxxxxx"),n=A("pre",[e],"CodeMirror-line-like");O(t.measure,n);var i=e.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(t.cachedCharWidth=r),r||10}function _i(t){for(var e=t.display,n={},i={},r=e.gutters.clientLeft,o=e.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var a=t.display.gutterSpecs[s].className;n[a]=o.offsetLeft+o.clientLeft+r,i[a]=o.clientWidth}return{fixedPos:Ei(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:e.wrapper.clientWidth}}function Ei(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Ni(t){var e=Oi(t.display),n=t.options.lineWrapping,i=n&&Math.max(5,t.display.scroller.clientWidth/Ai(t.display)-3);return function(r){if(nn(t.doc,r))return 0;var o=0;if(r.widgets)for(var s=0;s0&&(l=Xt(t.doc,c.line).text).length==c.ch){var u=F(l,l.length,t.options.tabSize)-l.length;c=re(c.line,Math.max(0,Math.round((o-Yn(t.display).left)/Ai(t.display))-u))}return c}function Pi(t,e){if(e>=t.display.viewTo)return null;if(e-=t.display.viewFrom,e<0)return null;for(var n=t.display.view,i=0;ie)&&(r.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=r.viewTo)Ae&&tn(t.doc,e)r.viewFrom?Fi(t):(r.viewFrom+=i,r.viewTo+=i);else if(e<=r.viewFrom&&n>=r.viewTo)Fi(t);else if(e<=r.viewFrom){var o=Wi(t,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):Fi(t)}else if(n>=r.viewTo){var s=Wi(t,e,e,-1);s?(r.view=r.view.slice(0,s.index),r.viewTo=s.lineN):Fi(t)}else{var a=Wi(t,e,e,-1),l=Wi(t,n,n+i,1);a&&l?(r.view=r.view.slice(0,a.index).concat(Cn(t,a.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):Fi(t)}var c=r.externalMeasured;c&&(n=r.lineN&&e=i.viewTo)){var o=i.view[Pi(t,e)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==j(s,n)&&s.push(n)}}}function Fi(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function Wi(t,e,n,i){var r,o=Pi(t,e),s=t.display.view;if(!Ae||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var a=t.display.viewFrom,l=0;l0){if(o==s.length-1)return null;r=a+s[o].size-e,o++}else r=a-e;e+=r,n+=r}while(tn(t.doc,n)!=n){if(o==(i<0?0:s.length-1))return null;n+=i*s[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function ji(t,e,n){var i=t.display,r=i.view;0==r.length||e>=i.viewTo||n<=i.viewFrom?(i.view=Cn(t,e,n),i.viewFrom=e):(i.viewFrom>e?i.view=Cn(t,e,i.viewFrom).concat(i.view):i.viewFromn&&(i.view=i.view.slice(0,Pi(t,n)))),i.viewTo=n}function zi(t){for(var e=t.display.view,n=0,i=0;i=t.display.viewTo||l.to().line0?s:t.defaultCharWidth())+"px"}if(i.other){var a=n.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=i.other.left+"px",a.style.top=i.other.top+"px",a.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Ui(t,e){return t.top-e.top||t.left-e.left}function Yi(t,e,n){var i=t.display,r=t.doc,o=document.createDocumentFragment(),s=Yn(t.display),a=s.left,l=Math.max(i.sizerWidth,Kn(t)-i.sizer.offsetLeft)-s.right,c="ltr"==r.direction;function u(t,e,n,i){e<0&&(e=0),e=Math.round(e),i=Math.round(i),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?l-t:n)+"px;\n height: "+(i-e)+"px"))}function h(e,n,i){var o,s,h=Xt(r,e),f=h.text.length;function d(n,i){return vi(t,re(e,n),"div",h,i)}function p(e,n,i){var r=ki(t,h,null,e),o="ltr"==n==("after"==i)?"left":"right",s="after"==i?r.begin:r.end-(/\s/.test(h.text.charAt(r.end-1))?2:1);return d(s,o)[o]}var g=ft(h,r.direction);return lt(g,n||0,null==i?f:i,(function(t,e,r,h){var m="ltr"==r,v=d(t,m?"left":"right"),y=d(e-1,m?"right":"left"),b=null==n&&0==t,w=null==i&&e==f,x=0==h,C=!g||h==g.length-1;if(y.top-v.top<=3){var k=(c?b:w)&&x,S=(c?w:b)&&C,T=k?a:(m?v:y).left,L=S?l:(m?y:v).right;u(T,v.top,L-T,v.bottom)}else{var M,O,A,_;m?(M=c&&b&&x?a:v.left,O=c?l:p(t,r,"before"),A=c?a:p(e,r,"after"),_=c&&w&&C?l:y.right):(M=c?p(t,r,"before"):a,O=!c&&b&&x?l:v.right,A=!c&&w&&C?a:y.left,_=c?p(e,r,"after"):l),u(M,v.top,O-M,v.bottom),v.bottom0?e.blinker=setInterval((function(){t.hasFocus()||Zi(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Ki(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||Xi(t))}function Gi(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&Zi(t))}),100)}function Xi(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(vt(t,"focus",t,e),t.state.focused=!0,D(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),qi(t))}function Zi(t,e){t.state.delayingBlurEvent||(t.state.focused&&(vt(t,"blur",t,e),t.state.focused=!1,L(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function Ji(t){for(var e=t.display,n=e.lineDiv.offsetTop,i=Math.max(0,e.scroller.getBoundingClientRect().top),r=e.lineDiv.getBoundingClientRect().top,o=0,l=0;l.005||g<-.005)&&(rt.display.sizerWidth){var v=Math.ceil(f/Ai(t.display));v>t.display.maxLineLength&&(t.display.maxLineLength=v,t.display.maxLine=c.line,t.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(e.scroller.scrollTop+=o)}function Qi(t){if(t.widgets)for(var e=0;e=s&&(o=ee(e,on(Xt(e,l))-t.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function er(t,e){if(!yt(t,"scrollCursorIntoView")){var n=t.display,i=n.sizer.getBoundingClientRect(),r=null;if(e.top+i.top<0?r=!0:e.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!p){var o=A("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-$n(t.display))+"px;\n height: "+(e.bottom-e.top+qn(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(r),t.display.lineSpace.removeChild(o)}}}function nr(t,e,n,i){var r;null==i&&(i=0),t.options.lineWrapping||e!=n||(n="before"==e.sticky?re(e.line,e.ch+1,"before"):e,e=e.ch?re(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e);for(var o=0;o<5;o++){var s=!1,a=yi(t,e),l=n&&n!=e?yi(t,n):a;r={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-i,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+i};var c=rr(t,r),u=t.doc.scrollTop,h=t.doc.scrollLeft;if(null!=c.scrollTop&&(hr(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(s=!0)),null!=c.scrollLeft&&(dr(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-h)>1&&(s=!0)),!s)break}return r}function ir(t,e){var n=rr(t,e);null!=n.scrollTop&&hr(t,n.scrollTop),null!=n.scrollLeft&&dr(t,n.scrollLeft)}function rr(t,e){var n=t.display,i=Oi(t.display);e.top<0&&(e.top=0);var r=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=Gn(t),s={};e.bottom-e.top>o&&(e.bottom=e.top+o);var a=t.doc.height+Un(n),l=e.topa-i;if(e.topr+o){var u=Math.min(e.top,(c?a:e.bottom)-o);u!=r&&(s.scrollTop=u)}var h=t.options.fixedGutter?0:n.gutters.offsetWidth,f=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-h,d=Kn(t)-n.gutters.offsetWidth,p=e.right-e.left>d;return p&&(e.right=e.left+d),e.left<10?s.scrollLeft=0:e.leftd+f-3&&(s.scrollLeft=e.right+(p?0:10)-d),s}function or(t,e){null!=e&&(cr(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function sr(t){cr(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function ar(t,e,n){null==e&&null==n||cr(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function lr(t,e){cr(t),t.curOp.scrollToPos=e}function cr(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;var n=bi(t,e.from),i=bi(t,e.to);ur(t,n,i,e.margin)}}function ur(t,e,n,i){var r=rr(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-i,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+i});ar(t,r.scrollLeft,r.scrollTop)}function hr(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||Hr(t,{top:e}),fr(t,e,!0),n&&Hr(t),Rr(t,100))}function fr(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function dr(t,e,n,i){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!i||(t.doc.scrollLeft=e,Yr(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function pr(t){var e=t.display,n=e.gutters.offsetWidth,i=Math.round(t.doc.height+Un(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+qn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var gr=function(t,e,n){this.cm=n;var i=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,t(i),t(r),pt(i,"scroll",(function(){i.clientHeight&&e(i.scrollTop,"vertical")})),pt(r,"scroll",(function(){r.clientWidth&&e(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};gr.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,i=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?i+"px":"0";var r=t.viewHeight-(e?i:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+r)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:e?i:0}},gr.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},gr.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},gr.prototype.zeroWidthHack=function(){var t=y&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new W,this.disableVert=new W},gr.prototype.enableZeroWidthBar=function(t,e,n){function i(){var r=t.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);o!=t?t.style.pointerEvents="none":e.set(1e3,i)}t.style.pointerEvents="auto",e.set(1e3,i)},gr.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var mr=function(){};function vr(t,e){e||(e=pr(t));var n=t.display.barWidth,i=t.display.barHeight;yr(t,e);for(var r=0;r<4&&n!=t.display.barWidth||i!=t.display.barHeight;r++)n!=t.display.barWidth&&t.options.lineWrapping&&Ji(t),yr(t,pr(t)),n=t.display.barWidth,i=t.display.barHeight}function yr(t,e){var n=t.display,i=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}mr.prototype.update=function(){return{bottom:0,right:0}},mr.prototype.setScrollLeft=function(){},mr.prototype.setScrollTop=function(){},mr.prototype.clear=function(){};var br={native:gr,null:mr};function wr(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&L(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new br[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),pt(e,"mousedown",(function(){t.state.focused&&setTimeout((function(){return t.display.input.focus()}),0)})),e.setAttribute("cm-not-content","true")}),(function(e,n){"horizontal"==n?dr(t,e):hr(t,e)}),t),t.display.scrollbars.addClass&&D(t.display.wrapper,t.display.scrollbars.addClass)}var xr=0;function Cr(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.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:++xr,markArrays:null},Sn(t.curOp)}function kr(t){var e=t.curOp;e&&Ln(e,(function(t){for(var e=0;e=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new Br(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Lr(t){t.updatedDisplay=t.mustUpdate&&jr(t.cm,t.update)}function Mr(t){var e=t.cm,n=e.display;t.updatedDisplay&&Ji(e),t.barMeasure=pr(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=Qn(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+qn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Kn(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Or(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft=t.display.viewTo)){var n=+new Date+t.options.workTime,i=ye(t,e.highlightFrontier),r=[];e.iter(i.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(o){if(i.line>=t.display.viewFrom){var s=o.styles,a=o.text.length>t.options.maxHighlightLength?Yt(e.mode,i.state):null,l=me(t,o,i,!0);a&&(i.state=a),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var h=!s||s.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!h&&fn)return Rr(t,t.options.workDelay),!0})),e.highlightFrontier=i.line,e.modeFrontier=Math.max(e.modeFrontier,i.line),r.length&&_r(t,(function(){for(var e=0;e=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==zi(t))return!1;qr(t)&&(Fi(t),e.dims=_i(t));var r=i.first+i.size,o=Math.max(e.visible.from-t.options.viewportMargin,i.first),s=Math.min(r,e.visible.to+t.options.viewportMargin);n.viewFroms&&n.viewTo-s<20&&(s=Math.min(r,n.viewTo)),Ae&&(o=tn(t.doc,o),s=en(t.doc,s));var a=o!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;ji(t,o,s),n.viewOffset=on(Xt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=zi(t);if(!a&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Fr(t);return l>4&&(n.lineDiv.style.display="none"),Vr(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Wr(c),M(n.cursorDiv),M(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,Rr(t,400)),n.updateLineNumbers=null,!0}function zr(t,e){for(var n=e.viewport,i=!0;;i=!1){if(i&&t.options.lineWrapping&&e.oldDisplayWidth!=Kn(t))i&&(e.visible=tr(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Un(t.display)-Gn(t),n.top)}),e.visible=tr(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!jr(t,e))break;Ji(t);var r=pr(t);Hi(t),vr(t,r),Ur(t,r),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Hr(t,e){var n=new Br(t,e);if(jr(t,n)){Ji(t),zr(t,n);var i=pr(t);Hi(t),vr(t,i),Ur(t,i),n.finish()}}function Vr(t,e,n){var i=t.display,r=t.options.lineNumbers,o=i.lineDiv,s=o.firstChild;function a(e){var n=e.nextSibling;return l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=i.view,u=i.viewFrom,h=0;h-1&&(d=!1),_n(t,f,u,n)),d&&(M(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(ie(t.options,u)))),s=f.node.nextSibling}else{var p=Fn(t,f,u,n);o.insertBefore(p,s)}u+=f.size}while(s)s=a(s)}function $r(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px",On(t,"gutterChanged",t)}function Ur(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+qn(t)+"px"}function Yr(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var i=Ei(e)-e.scroller.scrollLeft+t.doc.scrollLeft,r=e.gutters.offsetWidth,o=i+"px",s=0;sc.clientWidth,f=c.scrollHeight>c.clientHeight;if(r&&u||o&&f){if(o&&y&&l)t:for(var d=e.target,p=a.view;d!=c;d=d.parentNode)for(var g=0;g=0&&oe(t,i.to())<=0)return n}return-1};var ro=function(t,e){this.anchor=t,this.head=e};function oo(t,e,n){var i=t&&t.options.selectionsMayTouch,r=e[n];e.sort((function(t,e){return oe(t.from(),e.from())})),n=j(e,r);for(var o=1;o0:l>=0){var c=ce(a.from(),s.from()),u=le(a.to(),s.to()),h=a.empty()?s.from()==s.head:a.from()==a.head;o<=n&&--n,e.splice(--o,2,new ro(h?u:c,h?c:u))}}return new io(e,n)}function so(t,e){return new io([new ro(t,e||t)],0)}function ao(t){return t.text?re(t.from.line+t.text.length-1,G(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function lo(t,e){if(oe(t,e.from)<0)return t;if(oe(t,e.to)<=0)return ao(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,i=t.ch;return t.line==e.to.line&&(i+=ao(e).ch-e.to.ch),re(n,i)}function co(t,e){for(var n=[],i=0;i1&&t.remove(a.line+1,p-1),t.insert(a.line+1,v)}On(t,"change",t,e)}function vo(t,e,n){function i(t,r,o){if(t.linked)for(var s=0;s1&&!t.done[t.done.length-2].ranges?(t.done.pop(),G(t.done)):void 0}function To(t,e,n,i){var r=t.history;r.undone.length=0;var o,s,a=+new Date;if((r.lastOp==i||r.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&r.lastModTime>a-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=So(r,r.lastOp==i)))s=G(o.changes),0==oe(e.from,e.to)&&0==oe(e.from,s.to)?s.to=ao(e):o.changes.push(Co(t,e));else{var l=G(r.done);l&&l.ranges||Oo(t.sel,r.done),o={changes:[Co(t,e)],generation:r.generation},r.done.push(o);while(r.done.length>r.undoDepth)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=a,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=e.origin,s||vt(t,"historyAdded")}function Lo(t,e,n,i){var r=e.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Mo(t,e,n,i){var r=t.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||Lo(t,o,G(r.done),e))?r.done[r.done.length-1]=e:Oo(e,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&ko(r.undone)}function Oo(t,e){var n=G(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Ao(t,e,n,i){var r=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,i),(function(n){n.markedSpans&&((r||(r=e["spans_"+t.id]={}))[o]=n.markedSpans),++o}))}function _o(t){if(!t)return null;for(var e,n=0;n-1&&(G(a)[h]=c[h],delete c[h])}}}return i}function Ro(t,e,n,i){if(i){var r=t.anchor;if(n){var o=oe(e,r)<0;o!=oe(n,r)<0?(r=e,e=n):o!=oe(e,n)<0&&(e=n)}return new ro(r,e)}return new ro(n||e,e)}function Po(t,e,n,i,r){null==r&&(r=t.cm&&(t.cm.display.shift||t.extend)),zo(t,new io([Ro(t.sel.primary(),e,n,r)],0),i)}function Bo(t,e,n){for(var i=[],r=t.cm&&(t.cm.display.shift||t.extend),o=0;o=e.ch:a.to>e.ch))){if(r&&(vt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var h=l.find(i<0?1:-1),f=void 0;if((i<0?u:c)&&(h=Ko(t,h,-i,h&&h.line==e.line?o:null)),h&&h.line==e.line&&(f=oe(h,n))&&(i<0?f<0:f>0))return Yo(t,h,e,i,r)}var d=l.find(i<0?-1:1);return(i<0?c:u)&&(d=Ko(t,d,i,d.line==e.line?o:null)),d?Yo(t,d,e,i,r):null}}return e}function qo(t,e,n,i,r){var o=i||1,s=Yo(t,e,n,o,r)||!r&&Yo(t,e,n,o,!0)||Yo(t,e,n,-o,r)||!r&&Yo(t,e,n,-o,!0);return s||(t.cantEdit=!0,re(t.first,0))}function Ko(t,e,n,i){return n<0&&0==e.ch?e.line>t.first?he(t,re(e.line-1)):null:n>0&&e.ch==(i||Xt(t,e.line)).text.length?e.line=0;--r)Jo(t,{from:i[r].from,to:i[r].to,text:r?[""]:e.text,origin:e.origin});else Jo(t,e)}}function Jo(t,e){if(1!=e.text.length||""!=e.text[0]||0!=oe(e.from,e.to)){var n=co(t,e);To(t,e,n,t.cm?t.cm.curOp.id:NaN),es(t,e,n,Fe(t,e));var i=[];vo(t,(function(t,n){n||-1!=j(i,t.history)||(ss(t.history,e),i.push(t.history)),es(t,e,null,Fe(t,e))}))}}function Qo(t,e,n){var i=t.cm&&t.cm.state.suppressEdits;if(!i||n){for(var r,o=t.history,s=t.sel,a="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,c=0;c=0;--d){var p=f(d);if(p)return p.v}}}}function ts(t,e){if(0!=e&&(t.first+=e,t.sel=new io(X(t.sel.ranges,(function(t){return new ro(re(t.anchor.line+e,t.anchor.ch),re(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){Bi(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,i=n.viewFrom;it.lastLine())){if(e.from.lineo&&(e={from:e.from,to:re(o,Xt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Zt(t,e.from,e.to),n||(n=co(t,e)),t.cm?ns(t.cm,e,i):mo(t,e,i),Ho(t,n,V),t.cantEdit&&qo(t,re(t.firstLine(),0))&&(t.cantEdit=!1)}}function ns(t,e,n){var i=t.doc,r=t.display,o=e.from,s=e.to,a=!1,l=o.line;t.options.lineWrapping||(l=te(Ze(Xt(i,o.line))),i.iter(l,s.line+1,(function(t){if(t==r.maxLine)return a=!0,!0}))),i.sel.contains(e.from,e.to)>-1&&bt(t),mo(i,e,n,Ni(t)),t.options.lineWrapping||(i.iter(l,o.line+e.text.length,(function(t){var e=sn(t);e>r.maxLineLength&&(r.maxLine=t,r.maxLineLength=e,r.maxLineChanged=!0,a=!1)})),a&&(t.curOp.updateMaxLine=!0)),Me(i,o.line),Rr(t,400);var c=e.text.length-(s.line-o.line)-1;e.full?Bi(t):o.line!=s.line||1!=e.text.length||go(t.doc,e)?Bi(t,o.line,s.line+1,c):Ii(t,o.line,"text");var u=wt(t,"changes"),h=wt(t,"change");if(h||u){var f={from:o,to:s,text:e.text,removed:e.removed,origin:e.origin};h&&On(t,"change",t,f),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(f)}t.display.selForContextMenu=null}function is(t,e,n,i,r){var o;i||(i=n),oe(i,n)<0&&(o=[i,n],n=o[0],i=o[1]),"string"==typeof e&&(e=t.splitLines(e)),Zo(t,{from:n,to:i,text:e,origin:r})}function rs(t,e,n,i){n1||!(this.children[0]instanceof ls))){var a=[];this.collapse(a),this.children=[new ls(a)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e50){for(var s=r.lines.length%25+25,a=s;a10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var i=0;i0||0==s&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=_("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Xe(t,e.line,e,n,o)||e.line!=n.line&&Xe(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ee()}o.addToHistory&&To(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var a,l=e.line,c=t.cm;if(t.iter(l,n.line+1,(function(i){c&&o.collapsed&&!c.options.lineWrapping&&Ze(i)==c.display.maxLine&&(a=!0),o.collapsed&&l!=e.line&&Qt(i,0),Pe(i,new Ne(o,l==e.line?e.ch:null,l==n.line?n.ch:null),t.cm&&t.cm.curOp),++l})),o.collapsed&&t.iter(e.line,n.line+1,(function(e){nn(t,e)&&Qt(e,0)})),o.clearOnEnter&&pt(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(_e(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++ds,o.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),o.collapsed)Bi(c,e.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=e.line;u<=n.line;u++)Ii(c,u,"text");o.atomic&&$o(c.doc),On(c,"markerAdded",c,o)}return o}ps.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Cr(t),wt(this,"clear")){var n=this.find();n&&On(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;ot.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&Bi(t,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&$o(t.doc)),t&&On(t,"markerCleared",t,this,i,r),e&&kr(t),this.parent&&this.parent.clear()}},ps.prototype.find=function(t,e){var n,i;null==t&&"bookmark"==this.type&&(t=1);for(var r=0;r=0;l--)Zo(this,i[l]);a?jo(this,a):this.cm&&sr(this.cm)})),undo:Dr((function(){Qo(this,"undo")})),redo:Dr((function(){Qo(this,"redo")})),undoSelection:Dr((function(){Qo(this,"undo",!0)})),redoSelection:Dr((function(){Qo(this,"redo",!0)})),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,i=0;i=t.ch)&&e.push(r.marker.parent||r.marker)}return e},findMarks:function(t,e,n){t=he(this,t),e=he(this,e);var i=[],r=t.line;return this.iter(t.line,e.line+1,(function(o){var s=o.markedSpans;if(s)for(var a=0;a=l.to||null==l.from&&r!=t.line||null!=l.from&&r==e.line&&l.from>=e.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r})),i},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var i=0;it)return e=t,!0;t-=o,++n})),he(this,re(n,e))},indexFromPos:function(t){t=he(this,t);var e=t.ch;if(t.linee&&(e=t.from),null!=t.to&&t.to-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var h=t.dataTransfer.getData("Text");if(h){var f;if(e.state.draggingText&&!e.state.draggingText.copy&&(f=e.listSelections()),Ho(e.doc,so(n,n)),f)for(var d=0;d=0;e--)is(t.doc,"",i[e].from,i[e].to,"+delete");sr(t)}))}function Ys(t,e,n){var i=st(t.text,e+n,n);return i<0||i>t.text.length?null:i}function qs(t,e,n){var i=Ys(t,e.ch,n);return null==i?null:new re(e.line,i,n<0?"after":"before")}function Ks(t,e,n,i,r){if(t){"rtl"==e.doc.direction&&(r=-r);var o=ft(n,e.doc.direction);if(o){var s,a=r<0?G(o):o[0],l=r<0==(1==a.level),c=l?"after":"before";if(a.level>0||"rtl"==e.doc.direction){var u=ei(e,n);s=r<0?n.text.length-1:0;var h=ni(e,u,s).top;s=at((function(t){return ni(e,u,t).top==h}),r<0==(1==a.level)?a.from:a.to-1,s),"before"==c&&(s=Ys(n,s,1))}else s=r<0?a.to:a.from;return new re(i,s,c)}}return new re(i,r<0?n.text.length:0,r<0?"before":"after")}function Gs(t,e,n,i){var r=ft(e,t.doc.direction);if(!r)return qs(e,n,i);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ut(r,n.ch,n.sticky),s=r[o];if("ltr"==t.doc.direction&&s.level%2==0&&(i>0?s.to>n.ch:s.from=s.from&&f>=u.begin)){var d=h?"before":"after";return new re(n.line,f,d)}}var p=function(t,e,i){for(var o=function(t,e){return e?new re(n.line,l(t,1),"before"):new re(n.line,t,"after")};t>=0&&t0==(1!=s.level),c=a?i.begin:l(i.end,-1);if(s.from<=c&&c0?u.end:l(u.begin,-1);return null==m||i>0&&m==e.text.length||(g=p(i>0?0:r.length-1,i,c(m)),!g)?null:g}Is.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"},Is.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"},Is.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Is.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"]},Is["default"]=y?Is.macDefault:Is.pcDefault;var Xs={selectAll:Go,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),V)},killLine:function(t){return Us(t,(function(e){if(e.empty()){var n=Xt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0)r=new re(r.line,r.ch+1),t.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),re(r.line,r.ch-2),r,"+transpose");else if(r.line>t.doc.first){var s=Xt(t.doc,r.line-1).text;s&&(r=new re(r.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+s.charAt(s.length-1),re(r.line-1,s.length-1),r,"+transpose"))}n.push(new ro(r,r))}t.setSelections(n)}))},newlineAndIndent:function(t){return _r(t,(function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var i=0;i-1&&(oe((r=a.ranges[r]).from(),e)<0||e.xRel>0)&&(oe(r.to(),e)>0||e.xRel<0)?xa(t,i,e,o):ka(t,i,e,o)}function xa(t,e,n,i){var r=t.display,o=!1,c=Er(t,(function(e){l&&(r.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:Gi(t)),mt(r.wrapper.ownerDocument,"mouseup",c),mt(r.wrapper.ownerDocument,"mousemove",u),mt(r.scroller,"dragstart",h),mt(r.scroller,"drop",c),o||(Ct(e),i.addNew||Po(t.doc,n,null,null,i.extend),l&&!f||s&&9==a?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),u=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},h=function(){return o=!0};l&&(r.scroller.draggable=!0),t.state.draggingText=c,c.copy=!i.moveOnDrag,pt(r.wrapper.ownerDocument,"mouseup",c),pt(r.wrapper.ownerDocument,"mousemove",u),pt(r.scroller,"dragstart",h),pt(r.scroller,"drop",c),t.state.delayingBlurEvent=!0,setTimeout((function(){return r.input.focus()}),20),r.scroller.dragDrop&&r.scroller.dragDrop()}function Ca(t,e,n){if("char"==n)return new ro(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new ro(re(e.line,0),he(t.doc,re(e.line+1,0)));var i=n(t,e);return new ro(i.from,i.to)}function ka(t,e,n,i){s&&Gi(t);var r=t.display,o=t.doc;Ct(e);var a,l,c=o.sel,u=c.ranges;if(i.addNew&&!i.extend?(l=o.sel.contains(n),a=l>-1?u[l]:new ro(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),"rectangle"==i.unit)i.addNew||(a=new ro(n,n)),n=Ri(t,e,!0,!0),l=-1;else{var h=Ca(t,n,i.unit);a=i.extend?Ro(a,h.anchor,h.head,i.extend):h}i.addNew?-1==l?(l=u.length,zo(o,oo(t,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==i.unit&&!i.extend?(zo(o,oo(t,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):Io(o,l,a,$):(l=0,zo(o,new io([a],0),$),c=o.sel);var f=n;function d(e){if(0!=oe(f,e))if(f=e,"rectangle"==i.unit){for(var r=[],s=t.options.tabSize,u=F(Xt(o,n.line).text,n.ch,s),h=F(Xt(o,e.line).text,e.ch,s),d=Math.min(u,h),p=Math.max(u,h),g=Math.min(n.line,e.line),m=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=m;g++){var v=Xt(o,g).text,y=Y(v,d,s);d==p?r.push(new ro(re(g,y),re(g,y))):v.length>y&&r.push(new ro(re(g,y),re(g,Y(v,p,s))))}r.length||r.push(new ro(n,n)),zo(o,oo(t,c.ranges.slice(0,l).concat(r),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,w=a,x=Ca(t,e,i.unit),C=w.anchor;oe(x.anchor,C)>0?(b=x.head,C=ce(w.from(),x.anchor)):(b=x.anchor,C=le(w.to(),x.head));var k=c.ranges.slice(0);k[l]=Sa(t,new ro(he(o,C),b)),zo(o,oo(t,k,l),$)}}var p=r.wrapper.getBoundingClientRect(),g=0;function m(e){var n=++g,s=Ri(t,e,!0,"rectangle"==i.unit);if(s)if(0!=oe(s,f)){t.curOp.focus=N(),d(s);var a=tr(r,o);(s.line>=a.to||s.linep.bottom?20:0;l&&setTimeout(Er(t,(function(){g==n&&(r.scroller.scrollTop+=l,m(e))})),50)}}function v(e){t.state.selectingText=!1,g=1/0,e&&(Ct(e),r.input.focus()),mt(r.wrapper.ownerDocument,"mousemove",y),mt(r.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var y=Er(t,(function(t){0!==t.buttons&&Mt(t)?m(t):v(t)})),b=Er(t,v);t.state.selectingText=b,pt(r.wrapper.ownerDocument,"mousemove",y),pt(r.wrapper.ownerDocument,"mouseup",b)}function Sa(t,e){var n=e.anchor,i=e.head,r=Xt(t.doc,n.line);if(0==oe(n,i)&&n.sticky==i.sticky)return e;var o=ft(r);if(!o)return e;var s=ut(o,n.ch,n.sticky),a=o[s];if(a.from!=n.ch&&a.to!=n.ch)return e;var l,c=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==c||c==o.length)return e;if(i.line!=n.line)l=(i.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=ut(o,i.ch,i.sticky),h=u-s||(i.ch-n.ch)*(1==a.level?-1:1);l=u==c-1||u==c?h<0:h>0}var f=o[c+(l?-1:0)],d=l==(1==f.level),p=d?f.from:f.to,g=d?"after":"before";return n.ch==p&&n.sticky==g?e:new ro(new re(n.line,p,g),i)}function Ta(t,e,n,i){var r,o;if(e.touches)r=e.touches[0].clientX,o=e.touches[0].clientY;else try{r=e.clientX,o=e.clientY}catch(f){return!1}if(r>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;i&&Ct(e);var s=t.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!wt(t,n))return St(e);o-=a.top-s.viewOffset;for(var l=0;l=r){var u=ee(t.doc,o),h=t.display.gutterSpecs[l];return vt(t,n,t,u,h.className,e),St(e)}}}function La(t,e){return Ta(t,e,"gutterClick",!0)}function Ma(t,e){Vn(t.display,e)||Oa(t,e)||yt(t,e,"contextmenu")||k||t.display.input.onContextMenu(e)}function Oa(t,e){return!!wt(t,"gutterContextMenu")&&Ta(t,e,"gutterContextMenu",!1)}function Aa(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),hi(t)}ga.prototype.compare=function(t,e,n){return this.time+pa>t&&0==oe(e,this.pos)&&n==this.button};var _a={toString:function(){return"CodeMirror.Init"}},Ea={},Na={};function Da(t){var e=t.optionHandlers;function n(n,i,r,o){t.defaults[n]=i,r&&(e[n]=o?function(t,e,n){n!=_a&&r(t,e,n)}:r)}t.defineOption=n,t.Init=_a,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,fo(t)}),!0),n("indentUnit",2,fo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){po(t),hi(t),Bi(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],i=t.doc.first;t.doc.iter((function(t){for(var r=0;;){var o=t.text.indexOf(e,r);if(-1==o)break;r=o+e.length,n.push(re(i,o))}i++}));for(var r=n.length-1;r>=0;r--)is(t.doc,e,n[r],re(n[r].line,n[r].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=_a&&t.refresh()})),n("specialCharPlaceholder",gn,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){Aa(t),Xr(t)}),!0),n("keyMap","default",(function(t,e,n){var i=$s(e),r=n!=_a&&$s(n);r&&r.detach&&r.detach(t,i),i.attach&&i.attach(t,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Pa,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=Kr(e,t.options.lineNumbers),Xr(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?Ei(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return vr(t)}),!0),n("scrollbarStyle","native",(function(t){wr(t),vr(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=Kr(t.options.gutters,e),Xr(t)}),!0),n("firstLineNumber",1,Xr,!0),n("lineNumberFormatter",(function(t){return t}),Xr,!0),n("showCursorWhenSelecting",!1,Hi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(Zi(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,Ra),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Hi,!0),n("singleCursorHeightPerLine",!0,Hi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,po,!0),n("addModeClass",!1,po,!0),n("pollInterval",100),n("undoDepth",200,(function(t,e){return t.doc.history.undoDepth=e})),n("historyEventDelay",1250),n("viewportMargin",10,(function(t){return t.refresh()}),!0),n("maxHighlightLength",1e4,po,!0),n("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),n("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),n("autofocus",null),n("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),n("phrases",null)}function Ra(t,e,n){var i=n&&n!=_a;if(!e!=!i){var r=t.display.dragFunctions,o=e?pt:mt;o(t.display.scroller,"dragstart",r.start),o(t.display.scroller,"dragenter",r.enter),o(t.display.scroller,"dragover",r.over),o(t.display.scroller,"dragleave",r.leave),o(t.display.scroller,"drop",r.drop)}}function Pa(t){t.options.lineWrapping?(D(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(L(t.display.wrapper,"CodeMirror-wrap"),an(t)),Di(t),Bi(t),hi(t),setTimeout((function(){return vr(t)}),100)}function Ba(t,e){var n=this;if(!(this instanceof Ba))return new Ba(t,e);this.options=e=e?I(e):{},I(Ea,e,!1);var i=e.value;"string"==typeof i?i=new Cs(i,e.mode,null,e.lineSeparator,e.direction):e.mode&&(i.modeOption=e.mode),this.doc=i;var r=new Ba.inputStyles[e.inputStyle](this),o=this.display=new Zr(t,i,r,e);for(var c in o.wrapper.CodeMirror=this,Aa(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wr(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 W,keySeq:null,specialChars:null},e.autofocus&&!v&&o.input.focus(),s&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Ia(this),_s(),Cr(this),this.curOp.forceUpdate=!0,yo(this,i),e.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Xi(n)}),20):Zi(this),Na)Na.hasOwnProperty(c)&&Na[c](this,e[c],_a);qr(this),e.finishInit&&e.finishInit(this);for(var u=0;u400}pt(e.scroller,"touchstart",(function(r){if(!yt(t,r)&&!o(r)&&!La(t,r)){e.input.ensurePolled(),clearTimeout(n);var s=+new Date;e.activeTouch={start:s,moved:!1,prev:s-i.end<=300?i:null},1==r.touches.length&&(e.activeTouch.left=r.touches[0].pageX,e.activeTouch.top=r.touches[0].pageY)}})),pt(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),pt(e.scroller,"touchend",(function(n){var i=e.activeTouch;if(i&&!Vn(e,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var o,s=t.coordsChar(e.activeTouch,"page");o=!i.prev||l(i,i.prev)?new ro(s,s):!i.prev.prev||l(i,i.prev.prev)?t.findWordAt(s):new ro(re(s.line,0),he(t.doc,re(s.line+1,0))),t.setSelection(o.anchor,o.head),t.focus(),Ct(n)}r()})),pt(e.scroller,"touchcancel",r),pt(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(hr(t,e.scroller.scrollTop),dr(t,e.scroller.scrollLeft,!0),vt(t,"scroll",t))})),pt(e.scroller,"mousewheel",(function(e){return no(t,e)})),pt(e.scroller,"DOMMouseScroll",(function(e){return no(t,e)})),pt(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){yt(t,e)||Tt(e)},over:function(e){yt(t,e)||(Ls(t,e),Tt(e))},start:function(e){return Ts(t,e)},drop:Er(t,Ss),leave:function(e){yt(t,e)||Ms(t)}};var c=e.input.getField();pt(c,"keyup",(function(e){return ua.call(t,e)})),pt(c,"keydown",Er(t,la)),pt(c,"keypress",Er(t,ha)),pt(c,"focus",(function(e){return Xi(t,e)})),pt(c,"blur",(function(e){return Zi(t,e)}))}Ba.defaults=Ea,Ba.optionHandlers=Na;var Fa=[];function Wa(t,e,n,i){var r,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?r=ye(t,e).state:n="prev");var s=t.options.tabSize,a=Xt(o,e),l=F(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(i||/\S/.test(a.text)){if("smart"==n&&(c=o.mode.indent(r,a.text.slice(u.length),a.text),c==H||c>150)){if(!i)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>o.first?F(Xt(o,e-1).text,null,s):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var h="",f=0;if(t.options.indentWithTabs)for(var d=Math.floor(c/s);d;--d)f+=s,h+="\t";if(fs,l=Dt(e),c=null;if(a&&i.ranges.length>1)if(ja&&ja.text.join("\n")==e){if(i.ranges.length%ja.text.length==0){c=[];for(var u=0;u=0;f--){var d=i.ranges[f],p=d.from(),g=d.to();d.empty()&&(n&&n>0?p=re(p.line,p.ch-n):t.state.overwrite&&!a?g=re(g.line,Math.min(Xt(o,g.line).text.length,g.ch+G(l).length)):a&&ja&&ja.lineWise&&ja.text.join("\n")==l.join("\n")&&(p=g=re(p.line,0)));var m={from:p,to:g,text:c?c[f%c.length]:l,origin:r||(a?"paste":t.state.cutIncoming>s?"cut":"+input")};Zo(t.doc,m),On(t,"inputRead",t,m)}e&&!a&&$a(t,e),sr(t),t.curOp.updateInput<2&&(t.curOp.updateInput=h),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Va(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||_r(e,(function(){return Ha(e,n,0,null,"paste")})),!0}function $a(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=t.getModeAt(r.head),s=!1;if(o.electricChars){for(var a=0;a-1){s=Wa(t,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xt(t.doc,r.head.line).text.slice(0,r.head.ch))&&(s=Wa(t,r.head.line,"smart"));s&&On(t,"electricInput",t,r.head.line)}}}function Ua(t){for(var e=[],n=[],i=0;in&&(Wa(this,r.head.line,t,!0),n=r.head.line,i==this.doc.sel.primIndex&&sr(this));else{var o=r.from(),s=r.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;l0&&Io(this.doc,i,new ro(o,c[i].to()),V)}}})),getTokenAt:function(t,e){return ke(this,t,e)},getLineTokens:function(t,e){return ke(this,re(t),e,!0)},getTokenTypeAt:function(t){t=he(this.doc,t);var e,n=ve(this,Xt(this.doc,t.line)),i=0,r=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var s=i+r>>1;if((s?n[2*s-1]:0)>=o)r=s;else{if(!(n[2*s+1]o&&(t=o,r=!0),i=Xt(this.doc,t)}else i=t;return gi(this,i,{top:0,left:0},e||"page",n||r).top+(r?this.doc.height-on(i):0)},defaultTextHeight:function(){return Oi(this.display)},defaultCharWidth:function(){return Ai(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,i,r){var o=this.display;t=yi(this,he(this.doc,t));var s=t.bottom,a=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),o.sizer.appendChild(e),"over"==i)s=t.top;else if("above"==i||"near"==i){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==i||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?s=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(s=t.bottom),a+e.offsetWidth>c&&(a=c-e.offsetWidth)}e.style.top=s+"px",e.style.left=e.style.right="","right"==r?(a=o.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==r?a=0:"middle"==r&&(a=(o.sizer.clientWidth-e.offsetWidth)/2),e.style.left=a+"px"),n&&ir(this,{left:a,top:s,right:a+e.offsetWidth,bottom:s+e.offsetHeight})},triggerOnKeyDown:Nr(la),triggerOnKeyPress:Nr(ha),triggerOnKeyUp:ua,triggerOnMouseDown:Nr(va),execCommand:function(t){if(Xs.hasOwnProperty(t))return Xs[t].call(null,this)},triggerElectric:Nr((function(t){$a(this,t)})),findPosH:function(t,e,n,i){var r=1;e<0&&(r=-1,e=-e);for(var o=he(this.doc,t),s=0;s0&&a(n.charAt(i-1)))--i;while(r.5||this.options.lineWrapping)&&Di(this),vt(this,"refresh",this)})),swapDoc:Nr((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),yo(this,t),hi(this),this.display.input.reset(),ar(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,On(this,"swapDoc",this,e),e})),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},xt(t),t.registerHelper=function(e,i,r){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][i]=r},t.registerGlobalHelper=function(e,i,r,o){t.registerHelper(e,i,o),n[e]._global.push({pred:r,val:o})}}function Ga(t,e,n,i,r){var o=e,s=n,a=Xt(t,e.line),l=r&&"rtl"==t.direction?-n:n;function c(){var n=e.line+l;return!(n=t.first+t.size)&&(e=new re(n,e.ch,e.sticky),a=Xt(t,n))}function u(o){var s;if("codepoint"==i){var u=a.text.charCodeAt(e.ch+(n>0?0:-1));if(isNaN(u))s=null;else{var h=n>0?u>=55296&&u<56320:u>=56320&&u<57343;s=new re(e.line,Math.max(0,Math.min(a.text.length,e.ch+n*(h?2:1))),-n)}}else s=r?Gs(t.cm,a,e,n):qs(a,e,n);if(null==s){if(o||!c())return!1;e=Ks(r,t.cm,a,e.line,l)}else e=s;return!0}if("char"==i||"codepoint"==i)u();else if("column"==i)u(!0);else if("word"==i||"group"==i)for(var h=null,f="group"==i,d=t.cm&&t.cm.getHelper(e,"wordChars"),p=!0;;p=!1){if(n<0&&!u(!p))break;var g=a.text.charAt(e.ch)||"\n",m=nt(g,d)?"w":f&&"\n"==g?"n":!f||/\s/.test(g)?null:"p";if(!f||p||m||(m="s"),h&&h!=m){n<0&&(n=1,u(),e.sticky="after");break}if(m&&(h=m),n>0&&!u(!p))break}var v=qo(t,e,o,s,!0);return se(o,v)&&(v.hitSide=!0),v}function Xa(t,e,n,i){var r,o,s=t.doc,a=e.left;if("page"==i){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*Oi(t.display),3);r=(n>0?e.bottom:e.top)+n*c}else"line"==i&&(r=n>0?e.bottom+3:e.top-3);for(;;){if(o=xi(t,a,r),!o.outside)break;if(n<0?r<=0:r>=s.height){o.hitSide=!0;break}r+=5*n}return o}var Za=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new W,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ja(t,e){var n=ti(t,e.line);if(!n||n.hidden)return null;var i=Xt(t.doc,e.line),r=Zn(n,i,e.line),o=ft(i,t.doc.direction),s="left";if(o){var a=ut(o,e.ch);s=a%2?"right":"left"}var l=oi(r.map,e.ch,s);return l.offset="right"==l.collapse?l.end:l.start,l}function Qa(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function tl(t,e){return e&&(t.bad=!0),t}function el(t,e,n,i,r){var o="",s=!1,a=t.doc.lineSeparator(),l=!1;function c(t){return function(e){return e.id==t}}function u(){s&&(o+=a,l&&(o+=a),s=l=!1)}function h(t){t&&(u(),o+=t)}function f(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void h(n);var o,d=e.getAttribute("cm-marker");if(d){var p=t.findMarks(re(i,0),re(r+1,0),c(+d));return void(p.length&&(o=p[0].find(0))&&h(Zt(t.doc,o.from,o.to).join(a)))}if("false"==e.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;g&&u();for(var m=0;m=e.display.viewTo||o.line=e.display.viewFrom&&Ja(e,r)||{node:l[0].measure.map[2],offset:0},u=o.linei.firstLine()&&(s=re(s.line-1,Xt(i.doc,s.line-1).length)),a.ch==Xt(i.doc,a.line).text.length&&a.liner.viewTo-1)return!1;s.line==r.viewFrom||0==(t=Pi(i,s.line))?(e=te(r.view[0].line),n=r.view[0].node):(e=te(r.view[t].line),n=r.view[t-1].node.nextSibling);var l,c,u=Pi(i,a.line);if(u==r.view.length-1?(l=r.viewTo-1,c=r.lineDiv.lastChild):(l=te(r.view[u+1].line)-1,c=r.view[u+1].node.previousSibling),!n)return!1;var h=i.doc.splitLines(el(i,n,c,e,l)),f=Zt(i.doc,re(e,0),re(l,Xt(i.doc,l).text.length));while(h.length>1&&f.length>1)if(G(h)==G(f))h.pop(),f.pop(),l--;else{if(h[0]!=f[0])break;h.shift(),f.shift(),e++}var d=0,p=0,g=h[0],m=f[0],v=Math.min(g.length,m.length);while(ds.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1))d--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(d).replace(/\u200b+$/,"");var x=re(e,d),C=re(l,f.length?G(f).length-p:0);return h.length>1||h[0]||oe(x,C)?(is(i.doc,h,x,C,"+input"),!0):void 0},Za.prototype.ensurePolled=function(){this.forceCompositionEnd()},Za.prototype.reset=function(){this.forceCompositionEnd()},Za.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Za.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()}),80))},Za.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||_r(this.cm,(function(){return Bi(t.cm)}))},Za.prototype.setUneditable=function(t){t.contentEditable="false"},Za.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Er(this.cm,Ha)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Za.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Za.prototype.onContextMenu=function(){},Za.prototype.resetPosition=function(){},Za.prototype.needsContentAttribute=!0;var rl=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new W,this.hasSelection=!1,this.composing=null};function ol(t,e){if(e=e?I(e):{},e.value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=N();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function i(){t.value=a.getValue()}var r;if(t.form&&(pt(t.form,"submit",i),!e.leaveSubmitMethodAlone)){var o=t.form;r=o.submit;try{var s=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=s}}catch(l){}}e.finishInit=function(n){n.save=i,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,i(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(mt(t.form,"submit",i),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=r))}},t.style.display="none";var a=Ba((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return a}function sl(t){t.off=mt,t.on=pt,t.wheelEventPixels=eo,t.Doc=Cs,t.splitLines=Dt,t.countColumn=F,t.findColumn=Y,t.isWordChar=et,t.Pass=H,t.signal=vt,t.Line=ln,t.changeEnd=ao,t.scrollbarModel=br,t.Pos=re,t.cmpPos=oe,t.modes=Ft,t.mimeModes=Wt,t.resolveMode=Ht,t.getMode=Vt,t.modeExtensions=$t,t.extendMode=Ut,t.copyState=Yt,t.startState=Kt,t.innerMode=qt,t.commands=Xs,t.keyMap=Is,t.keyName=Vs,t.isModifierKey=zs,t.lookupKey=js,t.normalizeKeyMap=Ws,t.StringStream=Gt,t.SharedTextMarker=ms,t.TextMarker=ps,t.LineWidget=us,t.e_preventDefault=Ct,t.e_stopPropagation=kt,t.e_stop=Tt,t.addClass=D,t.contains=E,t.rmClass=L,t.keyNames=Ds}rl.prototype.init=function(t){var e=this,n=this,i=this.cm;this.createField(t);var r=this.textarea;function o(t){if(!yt(i,t)){if(i.somethingSelected())za({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var e=Ua(i);za({lineWise:!0,text:e.text}),"cut"==t.type?i.setSelections(e.ranges,null,V):(n.prevInput="",r.value=e.text.join("\n"),P(r))}"cut"==t.type&&(i.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),g&&(r.style.width="0px"),pt(r,"input",(function(){s&&a>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),pt(r,"paste",(function(t){yt(i,t)||Va(t,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),pt(r,"cut",o),pt(r,"copy",o),pt(t.scroller,"paste",(function(e){if(!Vn(t,e)&&!yt(i,e)){if(!r.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=e.clipboardData,r.dispatchEvent(o)}})),pt(t.lineSpace,"selectstart",(function(e){Vn(t,e)||Ct(e)})),pt(r,"compositionstart",(function(){var t=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:i.markText(t,i.getCursor("to"),{className:"CodeMirror-composing"})}})),pt(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},rl.prototype.createField=function(t){this.wrapper=qa(),this.textarea=this.wrapper.firstChild},rl.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},rl.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,i=Vi(t);if(t.options.moveInputWithCursor){var r=yi(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),s=e.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+s.top-o.top)),i.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+s.left-o.left))}return i},rl.prototype.showSelection=function(t){var e=this.cm,n=e.display;O(n.cursorDiv,t.cursors),O(n.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},rl.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&P(this.textarea),s&&a>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",s&&a>=9&&(this.hasSelection=null))}},rl.prototype.getField=function(){return this.textarea},rl.prototype.supportsTouch=function(){return!1},rl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||N()!=this.textarea))try{this.textarea.focus()}catch(t){}},rl.prototype.blur=function(){this.textarea.blur()},rl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},rl.prototype.receivedFocus=function(){this.slowPoll()},rl.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},rl.prototype.fastPoll=function(){var t=!1,e=this;function n(){var i=e.poll();i||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}e.pollingFast=!0,e.polling.set(20,n)},rl.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!e.state.focused||Rt(n)&&!i&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=n.value;if(r==i&&!e.somethingSelected())return!1;if(s&&a>=9&&this.hasSelection===r||y&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}var l=0,c=Math.min(i.length,r.length);while(l1e3||r.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=r,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},rl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},rl.prototype.onKeyPress=function(){s&&a>=9&&(this.hasSelection=null),this.fastPoll()},rl.prototype.onContextMenu=function(t){var e=this,n=e.cm,i=n.display,r=e.textarea;e.contextMenuPending&&e.contextMenuPending();var o=Ri(n,t),c=i.scroller.scrollTop;if(o&&!h){var u=n.options.resetSelectionOnContextMenu;u&&-1==n.doc.sel.contains(o)&&Er(n,zo)(n.doc,so(o),V);var f,d=r.style.cssText,p=e.wrapper.style.cssText,g=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-g.top-5)+"px; left: "+(t.clientX-g.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(f=window.scrollY),i.input.focus(),l&&window.scrollTo(null,f),i.input.reset(),n.somethingSelected()||(r.value=e.prevInput=" "),e.contextMenuPending=y,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),s&&a>=9&&v(),k){Tt(t);var m=function(){mt(window,"mouseup",m),setTimeout(y,20)};pt(window,"mouseup",m)}else setTimeout(y,50)}function v(){if(null!=r.selectionStart){var t=n.somethingSelected(),o="​"+(t?r.value:"");r.value="⇚",r.value=o,e.prevInput=t?"":"​",r.selectionStart=1,r.selectionEnd=o.length,i.selForContextMenu=n.doc.sel}}function y(){if(e.contextMenuPending==y&&(e.contextMenuPending=!1,e.wrapper.style.cssText=p,r.style.cssText=d,s&&a<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=c),null!=r.selectionStart)){(!s||s&&a<9)&&v();var t=0,o=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&"​"==e.prevInput?Er(n,Go)(n):t++<10?i.detectingSelectAll=setTimeout(o,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(o,200)}}},rl.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},rl.prototype.setUneditable=function(){},rl.prototype.needsContentAttribute=!1,Da(Ba),Ka(Ba);var al="iter insert remove copy getEditor constructor".split(" ");for(var ll in Cs.prototype)Cs.prototype.hasOwnProperty(ll)&&j(al,ll)<0&&(Ba.prototype[ll]=function(t){return function(){return t.apply(this.doc,arguments)}}(Cs.prototype[ll]));return xt(Cs),Ba.inputStyles={textarea:rl,contenteditable:Za},Ba.defineMode=function(t){Ba.defaults.mode||"null"==t||(Ba.defaults.mode=t),jt.apply(this,arguments)},Ba.defineMIME=zt,Ba.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Ba.defineMIME("text/plain","null"),Ba.defineExtension=function(t,e){Ba.prototype[t]=e},Ba.defineDocExtension=function(t,e){Cs.prototype[t]=e},Ba.fromTextArea=ol,sl(Ba),Ba.version="5.65.0",Ba}))},"5bc3":function(t,e){function n(t,e){for(var n=0;ne.length?t:e,u=t.length>e.length?e:t,h=c.indexOf(u);if(-1!=h)return l=[new n.Diff(r,c.substring(0,h)),new n.Diff(o,u),new n.Diff(r,c.substring(h+u.length))],t.length>e.length&&(l[0][0]=l[2][0]=i),l;if(1==u.length)return[new n.Diff(i,t),new n.Diff(r,e)];var f=this.diff_halfMatch_(t,e);if(f){var d=f[0],p=f[1],g=f[2],m=f[3],v=f[4],y=this.diff_main(d,g,s,a),b=this.diff_main(p,m,s,a);return y.concat([new n.Diff(o,v)],b)}return s&&t.length>100&&e.length>100?this.diff_lineMode_(t,e,a):this.diff_bisect_(t,e,a)},n.prototype.diff_lineMode_=function(t,e,s){var a=this.diff_linesToChars_(t,e);t=a.chars1,e=a.chars2;var l=a.lineArray,c=this.diff_main(t,e,!1,s);this.diff_charsToLines_(c,l),this.diff_cleanupSemantic(c),c.push(new n.Diff(o,""));var u=0,h=0,f=0,d="",p="";while(u=1&&f>=1){c.splice(u-h-f,h+f),u=u-h-f;for(var g=this.diff_main(d,p,!1,s),m=g.length-1;m>=0;m--)c.splice(u,0,g[m]);u+=g.length}f=0,h=0,d="",p="";break}u++}return c.pop(),c},n.prototype.diff_bisect_=function(t,e,o){for(var s=t.length,a=e.length,l=Math.ceil((s+a)/2),c=l,u=2*l,h=new Array(u),f=new Array(u),d=0;do)break;for(var x=-w+m;x<=w-v;x+=2){var C=c+x;O=x==-w||x!=w&&h[C-1]s)v+=2;else if(k>a)m+=2;else if(g){var S=c+p-x;if(S>=0&&S=T)return this.diff_bisectSplit_(t,e,O,k,o)}}}for(var L=-w+y;L<=w-b;L+=2){S=c+L;T=L==-w||L!=w&&f[S-1]s)b+=2;else if(M>a)y+=2;else if(!g){C=c+p-L;if(C>=0&&C=T)return this.diff_bisectSplit_(t,e,O,k,o)}}}}return[new n.Diff(i,t),new n.Diff(r,e)]},n.prototype.diff_bisectSplit_=function(t,e,n,i,r){var o=t.substring(0,n),s=e.substring(0,i),a=t.substring(n),l=e.substring(i),c=this.diff_main(o,s,!1,r),u=this.diff_main(a,l,!1,r);return c.concat(u)},n.prototype.diff_linesToChars_=function(t,e){var n=[],i={};function r(t){var e="",r=0,s=-1,a=n.length;while(si?t=t.substring(n-i):ne.length?t:e,i=t.length>e.length?e:t;if(n.length<4||2*i.length=t.length?[i,o,s,a,u]:null}var s,a,l,c,u,h=o(n,i,Math.ceil(n.length/4)),f=o(n,i,Math.ceil(n.length/2));if(!h&&!f)return null;s=f?h&&h[4].length>f[4].length?h:f:h,t.length>e.length?(a=s[0],l=s[1],c=s[2],u=s[3]):(c=s[0],u=s[1],a=s[2],l=s[3]);var d=s[4];return[a,l,c,u,d]},n.prototype.diff_cleanupSemantic=function(t){var e=!1,s=[],a=0,l=null,c=0,u=0,h=0,f=0,d=0;while(c0?s[a-1]:-1,u=0,h=0,f=0,d=0,l=null,e=!0)),c++;e&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),c=1;while(c=v?(m>=p.length/2||m>=g.length/2)&&(t.splice(c,0,new n.Diff(o,g.substring(0,m))),t[c-1][1]=p.substring(0,p.length-m),t[c+1][1]=g.substring(m),c++):(v>=p.length/2||v>=g.length/2)&&(t.splice(c,0,new n.Diff(o,p.substring(0,v))),t[c-1][0]=r,t[c-1][1]=g.substring(0,g.length-v),t[c+1][0]=i,t[c+1][1]=p.substring(v),c++),c++}c++}},n.prototype.diff_cleanupSemanticLossless=function(t){function e(t,e){if(!t||!e)return 6;var i=t.charAt(t.length-1),r=e.charAt(0),o=i.match(n.nonAlphaNumericRegex_),s=r.match(n.nonAlphaNumericRegex_),a=o&&i.match(n.whitespaceRegex_),l=s&&r.match(n.whitespaceRegex_),c=a&&i.match(n.linebreakRegex_),u=l&&r.match(n.linebreakRegex_),h=c&&t.match(n.blanklineEndRegex_),f=u&&e.match(n.blanklineStartRegex_);return h||f?5:c||u?4:o&&!a&&l?3:a||l?2:o||s?1:0}var i=1;while(i=d&&(d=p,u=r,h=s,f=a)}t[i-1][1]!=u&&(u?t[i-1][1]=u:(t.splice(i-1,1),i--),t[i][1]=h,f?t[i+1][1]=f:(t.splice(i+1,1),i--))}i++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(t){var e=!1,s=[],a=0,l=null,c=0,u=!1,h=!1,f=!1,d=!1;while(c0?s[a-1]:-1,f=d=!1),e=!0)),c++;e&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push(new n.Diff(o,""));var e,s=0,a=0,l=0,c="",u="";while(s1?(0!==a&&0!==l&&(e=this.diff_commonPrefix(u,c),0!==e&&(s-a-l>0&&t[s-a-l-1][0]==o?t[s-a-l-1][1]+=u.substring(0,e):(t.splice(0,0,new n.Diff(o,u.substring(0,e))),s++),u=u.substring(e),c=c.substring(e)),e=this.diff_commonSuffix(u,c),0!==e&&(t[s][1]=u.substring(u.length-e)+t[s][1],u=u.substring(0,u.length-e),c=c.substring(0,c.length-e))),s-=a+l,t.splice(s,a+l),c.length&&(t.splice(s,0,new n.Diff(i,c)),s++),u.length&&(t.splice(s,0,new n.Diff(r,u)),s++),s++):0!==s&&t[s-1][0]==o?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,l=0,a=0,c="",u="";break}""===t[t.length-1][1]&&t.pop();var h=!1;s=1;while(se)break;a=o,l=s}return t.length!=n&&t[n][0]===i?l:l+(e-a)},n.prototype.diff_prettyHtml=function(t){for(var e=[],n=/&/g,s=//g,l=/\n/g,c=0;c");switch(u){case r:e[c]=''+f+"";break;case i:e[c]=''+f+"";break;case o:e[c]=""+f+"";break}}return e.join("")},n.prototype.diff_text1=function(t){for(var e=[],n=0;nthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(e),r=this;function o(t,i){var o=t/e.length,s=Math.abs(n-i);return r.Match_Distance?o+s/r.Match_Distance:s?1:o}var s=this.Match_Threshold,a=t.indexOf(e,n);-1!=a&&(s=Math.min(o(0,a),s),a=t.lastIndexOf(e,n+e.length),-1!=a&&(s=Math.min(o(0,a),s)));var l,c,u=1<=p;v--){var y=i[t.charAt(v-1)];if(m[v]=0===d?(m[v+1]<<1|1)&y:(m[v+1]<<1|1)&y|(h[v+1]|h[v])<<1|1|h[v+1],m[v]&u){var b=o(d,v-1);if(b<=s){if(s=b,a=v-1,!(a>n))break;p=Math.max(1,2*n-a)}}}if(o(d+1,n)>s)break;h=m}return a},n.prototype.match_alphabet_=function(t){for(var e={},n=0;n2&&(this.diff_cleanupSemantic(l),this.diff_cleanupEfficiency(l));else if(t&&"object"==typeof t&&"undefined"==typeof e&&"undefined"==typeof s)l=t,a=this.diff_text1(l);else if("string"==typeof t&&e&&"object"==typeof e&&"undefined"==typeof s)a=t,l=e;else{if("string"!=typeof t||"string"!=typeof e||!s||"object"!=typeof s)throw new Error("Unknown call format to patch_make.");a=t,l=s}if(0===l.length)return[];for(var c=[],u=new n.patch_obj,h=0,f=0,d=0,p=a,g=a,m=0;m=2*this.Patch_Margin&&h&&(this.patch_addContext_(u,p),c.push(u),u=new n.patch_obj,h=0,p=g,f=d);break}v!==r&&(f+=y.length),v!==i&&(d+=y.length)}return h&&(this.patch_addContext_(u,p),c.push(u)),c},n.prototype.patch_deepCopy=function(t){for(var e=[],i=0;ithis.Match_MaxBits?(c=this.match_main(e,f.substring(0,this.Match_MaxBits),h),-1!=c&&(d=this.match_main(e,f.substring(f.length-this.Match_MaxBits),h+f.length-this.Match_MaxBits),(-1==d||c>=d)&&(c=-1))):c=this.match_main(e,f,h),-1==c)a[l]=!1,s-=t[l].length2-t[l].length1;else if(a[l]=!0,s=c-h,u=-1==d?e.substring(c,c+f.length):e.substring(c,d+this.Match_MaxBits),f==u)e=e.substring(0,c)+this.diff_text2(t[l].diffs)+e.substring(c+f.length);else{var p=this.diff_main(f,u,!1);if(f.length>this.Match_MaxBits&&this.diff_levenshtein(p)/f.length>this.Patch_DeleteThreshold)a[l]=!1;else{this.diff_cleanupSemanticLossless(p);for(var g,m=0,v=0;va[0][1].length){var l=e-a[0][1].length;a[0][1]=i.substring(a[0][1].length)+a[0][1],s.start1-=l,s.start2-=l,s.length1+=l,s.length2+=l}if(s=t[t.length-1],a=s.diffs,0==a.length||a[a.length-1][0]!=o)a.push(new n.Diff(o,i)),s.length1+=e,s.length2+=e;else if(e>a[a.length-1][1].length){l=e-a[a.length-1][1].length;a[a.length-1][1]+=i.substring(0,l),s.length1+=l,s.length2+=l}return i},n.prototype.patch_splitMax=function(t){for(var e=this.Match_MaxBits,s=0;s2*e?(h.length1+=p.length,l+=p.length,f=!1,h.diffs.push(new n.Diff(d,p)),a.diffs.shift()):(p=p.substring(0,e-h.length1-this.Patch_Margin),h.length1+=p.length,l+=p.length,d===o?(h.length2+=p.length,c+=p.length):f=!1,h.diffs.push(new n.Diff(d,p)),p==a.diffs[0][1]?a.diffs.shift():a.diffs[0][1]=a.diffs[0][1].substring(p.length))}u=this.diff_text2(h.diffs),u=u.substring(u.length-this.Patch_Margin);var g=this.diff_text1(a.diffs).substring(0,this.Patch_Margin);""!==g&&(h.length1+=g.length,h.length2+=g.length,0!==h.diffs.length&&h.diffs[h.diffs.length-1][0]===o?h.diffs[h.diffs.length-1][1]+=g:h.diffs.push(new n.Diff(o,g))),f||t.splice(++s,0,h)}}},n.prototype.patch_toText=function(t){for(var e=[],n=0;n1?arguments[1]:void 0);while(e=e?e.next:n.first){i(e.value,e.key,this);while(e&&e.removed)e=e.previous}},has:function(t){return!!y(this,t)}}),o(d,n?{get:function(t){var e=y(this,t);return e&&e.value},set:function(t,e){return v(this,0===t?0:t,e)}}:{add:function(t){return v(this,t=0===t?0:t,t)}}),h&&i(d,"size",{get:function(){return m(this).size}}),u},setStrong:function(t,e,n){var i=e+" Iterator",r=g(e),o=g(i);c(t,e,(function(t,e){p(this,{type:i,target:t,state:r(t),kind:e,last:void 0})}),(function(){var t=o(this),e=t.kind,n=t.last;while(n&&n.removed)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?"keys"==e?{value:n.key,done:!1}:"values"==e?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),u(e)}}},"6d61":function(t,e,n){"use strict";var i=n("23e7"),r=n("da84"),o=n("e330"),s=n("94ca"),a=n("6eeb"),l=n("f183"),c=n("2266"),u=n("19aa"),h=n("1626"),f=n("861d"),d=n("d039"),p=n("1c7e"),g=n("d44e"),m=n("7156");t.exports=function(t,e,n){var v=-1!==t.indexOf("Map"),y=-1!==t.indexOf("Weak"),b=v?"set":"add",w=r[t],x=w&&w.prototype,C=w,k={},S=function(t){var e=o(x[t]);a(x,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(y&&!f(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return y&&!f(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(y&&!f(t))&&e(this,0===t?0:t)}:function(t,n){return e(this,0===t?0:t,n),this})},T=s(t,!h(w)||!(y||x.forEach&&!d((function(){(new w).entries().next()}))));if(T)C=n.getConstructor(e,t,v,b),l.enable();else if(s(t,!0)){var L=new C,M=L[b](y?{}:-0,1)!=L,O=d((function(){L.has(1)})),A=p((function(t){new w(t)})),_=!y&&d((function(){var t=new w,e=5;while(e--)t[b](e,e);return!t.has(-0)}));A||(C=e((function(t,e){u(t,x);var n=m(new w,t,C);return void 0!=e&&c(e,n[b],{that:n,AS_ENTRIES:v}),n})),C.prototype=x,x.constructor=C),(O||_)&&(S("delete"),S("has"),v&&S("get")),(_||M)&&S(b),y&&x.clear&&delete x.clear}return k[t]=C,i({global:!0,forced:C!=w},k),g(C,t),y||n.setStrong(C,t,v),C}},7289:function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";var e={},n=/[^\s\u00a0]/,i=t.Pos,r=t.cmpPos;function o(t){var e=t.search(n);return-1==e?0:e}function s(t,e,n){return/\bstring\b/.test(t.getTokenTypeAt(i(e.line,0)))&&!/^[\'\"\`]/.test(n)}function a(t,e){var n=t.getMode();return!1!==n.useInnerComments&&n.innerMode?t.getModeAt(e):n}t.commands.toggleComment=function(t){t.toggleComment()},t.defineExtension("toggleComment",(function(t){t||(t=e);for(var n=this,r=1/0,o=this.listSelections(),s=null,a=o.length-1;a>=0;a--){var l=o[a].from(),c=o[a].to();l.line>=r||(c.line>=r&&(c=i(r,0)),r=l.line,null==s?n.uncomment(l,c,t)?s="un":(n.lineComment(l,c,t),s="line"):"un"==s?n.uncomment(l,c,t):n.lineComment(l,c,t))}})),t.defineExtension("lineComment",(function(t,r,l){l||(l=e);var c=this,u=a(c,t),h=c.getLine(t.line);if(null!=h&&!s(c,t,h)){var f=l.lineComment||u.lineComment;if(f){var d=Math.min(0!=r.ch||r.line==t.line?r.line+1:r.line,c.lastLine()+1),p=null==l.padding?" ":l.padding,g=l.commentBlankLines||t.line==r.line;c.operation((function(){if(l.indent){for(var e=null,r=t.line;ra.length)&&(e=a)}for(r=t.line;rf||l.operation((function(){if(0!=s.fullLines){var e=n.test(l.getLine(f));l.replaceRange(d+h,i(f)),l.replaceRange(u+d,i(t.line,0));var a=s.blockCommentLead||c.blockCommentLead;if(null!=a)for(var p=t.line+1;p<=f;++p)(p!=f||e)&&l.replaceRange(a+d,i(p,0))}else{var g=0==r(l.getCursor("to"),o),m=!l.somethingSelected();l.replaceRange(h,o),g&&l.setSelection(m?o:l.getCursor("from"),o),l.replaceRange(u,t)}}))}}else(s.lineComment||c.lineComment)&&0!=s.fullLines&&l.lineComment(t,o,s)})),t.defineExtension("uncomment",(function(t,r,o){o||(o=e);var s,l=this,c=a(l,t),u=Math.min(0!=r.ch||r.line==t.line?r.line:r.line-1,l.lastLine()),h=Math.min(t.line,u),f=o.lineComment||c.lineComment,d=[],p=null==o.padding?" ":o.padding;t:if(f){for(var g=h;g<=u;++g){var m=l.getLine(g),v=m.indexOf(f);if(v>-1&&!/comment/.test(l.getTokenTypeAt(i(g,v+1)))&&(v=-1),-1==v&&n.test(m))break t;if(v>-1&&n.test(m.slice(0,v)))break t;d.push(m)}if(l.operation((function(){for(var t=h;t<=u;++t){var e=d[t-h],n=e.indexOf(f),r=n+f.length;n<0||(e.slice(r,r+p.length)==p&&(r+=p.length),s=!0,l.replaceRange("",i(t,n),i(t,r)))}})),s)return!0}var y=o.blockCommentStart||c.blockCommentStart,b=o.blockCommentEnd||c.blockCommentEnd;if(!y||!b)return!1;var w=o.blockCommentLead||c.blockCommentLead,x=l.getLine(h),C=x.indexOf(y);if(-1==C)return!1;var k=u==h?x:l.getLine(u),S=k.indexOf(b,u==h?C+y.length:0),T=i(h,C+1),L=i(u,S+1);if(-1==S||!/comment/.test(l.getTokenTypeAt(T))||!/comment/.test(l.getTokenTypeAt(L))||l.getRange(T,L,"\n").indexOf(b)>-1)return!1;var M=x.lastIndexOf(y,t.ch),O=-1==M?-1:x.slice(0,t.ch).indexOf(b,M+y.length);if(-1!=M&&-1!=O&&O+b.length!=t.ch)return!1;O=k.indexOf(b,r.ch);var A=k.slice(r.ch).lastIndexOf(y,O-r.ch);return M=-1==O||-1==A?-1:r.ch+A,(-1==O||-1==M||M==r.ch)&&(l.operation((function(){l.replaceRange("",i(u,S-(p&&k.slice(S-p.length,S)==p?p.length:0)),i(u,S+b.length));var t=C+y.length;if(p&&x.slice(t,t+p.length)==p&&(t+=p.length),l.replaceRange("",i(h,C),i(h,t)),w)for(var e=h+1;e<=u;++e){var r=l.getLine(e),o=r.indexOf(w);if(-1!=o&&!n.test(r.slice(0,o))){var s=o+w.length;p&&r.slice(s,s+p.length)==p&&(s+=p.length),l.replaceRange("",i(e,o),i(e,s))}}})),!0)}))}))},"744a":function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return s})),n.d(e,"b",(function(){return a}));var i=n("20a4");const r=(()=>{const t="function"===typeof Promise&&"function"===typeof Promise.resolve;return t?t=>Promise.resolve().then(t):(t,e)=>e(t,0)})(),o=i["a"].WebSocket||i["a"].MozWebSocket,s=!0,a="arraybuffer"},"785f":function(t,e,n){"use strict";n.r(e);var i={};n.r(i),n.d(i,"protocol",(function(){return H})),n.d(i,"PacketType",(function(){return V})),n.d(i,"Encoder",(function(){return $})),n.d(i,"Decoder",(function(){return U}));var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-container",{staticClass:"fill-height",attrs:{fluid:""}},[n("v-row",[n("v-col",{attrs:{cols:12}},[t.logged?n("v-container",[n("v-row",{staticClass:"px-2"},[n("v-col",[t.users.length?t._e():n("p",[t._v(" Please wait while the website is trying to access to the server ")]),n("p",[t._v("Current users: "+t._s(t.users.length)+" users")]),t._l(t.users,(function(e){return n("v-card-text",{key:e.id},[n("div",[t._v("Name")]),n("p",{staticClass:"text-h4 text--primary"},[t._v(" "+t._s(e.name)+" "),e.id==t.socket.id?n("span",{staticClass:"text-center"},[t._v(" (You) "),n("v-btn",{attrs:{align:"right"},on:{click:t.exitRoom}},[t._v(" Exit ")])],1):t._e()])])})),n("v-slider",{attrs:{max:"100",min:"0"},model:{value:t.lossChance,callback:function(e){t.lossChance=e},expression:"lossChance"}}),t._v(" Loss percentage: "+t._s(t.lossChance)+"% ")],2)],1),n("v-row",{staticClass:"px-2"},[n("v-col",[n("Editor",{ref:"editor",on:{input:t.socketUpdateText,newCursor:t.socketUpdateCursor},model:{value:t.code,callback:function(e){t.code=e},expression:"code"}})],1)],1)],1):n("v-container",[n("v-row",{attrs:{align:"center",justify:"center"}},[n("v-col",{attrs:{cols:"12",sm:"8",md:"4"}},[n("p",[t._v(' This project is a PoC realtime collaborative editor using the "diff-match-patch" algorithm by Neil Fraser and the modified version of differential synchronization. ')]),n("p",[t._v(' Enter a string as the room name and a string as your name. Then, call for more people to join the same room. After that you can start editing the text. You can also set the "package loss" attribute to test when the package are loss, the server can still maintain the text in the following iterations. ')]),n("v-form",[n("v-text-field",{attrs:{counter:10,label:"Name",required:""},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}}),n("v-text-field",{attrs:{counter:10,label:"Room",required:""},model:{value:t.room,callback:function(e){t.room=e},expression:"room"}}),n("v-btn",{staticClass:"mr-4",attrs:{color:"green"},on:{click:t.createUser}},[t._v(" Go ")])],1)],1)],1)],1),n("v-snackbar",{attrs:{timeout:t.timeout},model:{value:t.snackbar,callback:function(e){t.snackbar=e},expression:"snackbar"}},[t._v(" "+t._s(t.notiContent)+" ")])],1)],1)],1)},o=[],s=(n("b0c0"),n("5317")),a=n.n(s);function l(t,e="",n){let i=t;n=n||"undefined"!==typeof location&&location,null==t&&(t=n.protocol+"//"+n.host),"string"===typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?n.protocol+t:n.host+t),/^(https?|wss?):\/\//.test(t)||(t="undefined"!==typeof n?n.protocol+"//"+t:"https://"+t),i=a()(t)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";const r=-1!==i.host.indexOf(":"),o=r?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+o+":"+i.port+e,i.href=i.protocol+"://"+o+(n&&n.port===i.port?"":":"+i.port),i}var c=n("c9eb"),u=n.n(c),h=n("20a4"),f=function(t){const e=t.xdomain;try{if("undefined"!==typeof XMLHttpRequest&&(!e||u.a))return new XMLHttpRequest}catch(n){}if(!e)try{return new(h["a"][["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(n){}},d=n("af7f"),p=n("b19d"),g=n("34ba"),m=n("0299"),v=n.n(m),y=n("4f2a"),b=n.n(y),w=n("33e8");class x extends g["a"]{constructor(){super(...arguments),this.polling=!1}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const e=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let t=0;this.polling&&(t++,this.once("pollComplete",(function(){--t||e()}))),this.writable||(t++,this.once("drain",(function(){--t||e()})))}else e()}poll(){this.polling=!0,this.doPoll(),this.emit("poll")}onData(t){const e=t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose(),!1;this.onPacket(t)};Object(w["b"])(t,this.socket.binaryType).forEach(e),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){this.writable=!1,Object(w["d"])(t,t=>{this.doWrite(t,()=>{this.writable=!0,this.emit("drain")})})}uri(){let t=this.query||{};const e=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=v()()),this.supportsBinary||t.sid||(t.b64=1),this.opts.port&&("https"===e&&443!==Number(this.opts.port)||"http"===e&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const i=b.a.encode(t),r=-1!==this.opts.hostname.indexOf(":");return e+"://"+(r?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(i.length?"?"+i:"")}}function C(){}const k=function(){const t=new f({xdomain:!1});return null!=t.responseType}();class S extends x{constructor(t){if(super(t),"undefined"!==typeof location){const e="https:"===location.protocol;let n=location.port;n||(n=e?"443":"80"),this.xd="undefined"!==typeof location&&t.hostname!==location.hostname||n!==t.port,this.xs=t.secure!==e}const e=t&&t.forceBase64;this.supportsBinary=k&&!e}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new T(this.uri(),t)}doWrite(t,e){const n=this.request({method:"POST",data:t});n.on("success",e),n.on("error",t=>{this.onError("xhr post error",t)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",t=>{this.onError("xhr poll error",t)}),this.pollXhr=t}}class T extends p["Emitter"]{constructor(t,e){super(),Object(d["a"])(this,e),this.opts=e,this.method=e.method||"GET",this.uri=t,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.create()}create(){const t=Object(d["b"])(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const e=this.xhr=new f(t);try{e.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0);for(let t in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(t)&&e.setRequestHeader(t,this.opts.extraHeaders[t])}}catch(n){}if("POST"===this.method)try{e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(n){}try{e.setRequestHeader("Accept","*/*")}catch(n){}"withCredentials"in e&&(e.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(e.timeout=this.opts.requestTimeout),e.onreadystatechange=()=>{4===e.readyState&&(200===e.status||1223===e.status?this.onLoad():this.setTimeoutFn(()=>{this.onError("number"===typeof e.status?e.status:0)},0))},e.send(this.data)}catch(n){return void this.setTimeoutFn(()=>{this.onError(n)},0)}"undefined"!==typeof document&&(this.index=T.requestsCount++,T.requests[this.index]=this)}onSuccess(){this.emit("success"),this.cleanup()}onData(t){this.emit("data",t),this.onSuccess()}onError(t){this.emit("error",t),this.cleanup(!0)}cleanup(t){if("undefined"!==typeof this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=C,t)try{this.xhr.abort()}catch(e){}"undefined"!==typeof document&&delete T.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;null!==t&&this.onData(t)}abort(){this.cleanup()}}if(T.requestsCount=0,T.requests={},"undefined"!==typeof document)if("function"===typeof attachEvent)attachEvent("onunload",L);else if("function"===typeof addEventListener){const t="onpagehide"in h["a"]?"pagehide":"unload";addEventListener(t,L,!1)}function L(){for(let t in T.requests)T.requests.hasOwnProperty(t)&&T.requests[t].abort()}var M=n("1f49");const O={websocket:M["a"],polling:S};class A extends p["Emitter"]{constructor(t,e={}){super(),t&&"object"===typeof t&&(e=t,t=null),t?(t=a()(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=a()(e.host).host),Object(d["a"])(this,e),this.secure=null!=e.secure?e.secure:"undefined"!==typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!==typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!==typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=e.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},e),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"===typeof this.opts.query&&(this.opts.query=b.a.decode(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"===typeof addEventListener&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!1),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close")},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const e=_(this.opts.query);e.EIO=w["e"],e.transport=t,this.id&&(e.sid=this.id);const n=Object.assign({},this.opts.transportOptions[t],this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new O[t](n)}open(){let t;if(this.opts.rememberUpgrade&&A.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(e){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",()=>{this.onClose("transport close")})}probe(t){let e=this.createTransport(t),n=!1;A.priorWebsocketSuccess=!1;const i=()=>{n||(e.send([{type:"ping",data:"probe"}]),e.once("packet",t=>{if(!n)if("pong"===t.type&&"probe"===t.data){if(this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;A.priorWebsocketSuccess="websocket"===e.name,this.transport.pause(()=>{n||"closed"!==this.readyState&&(c(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())})}else{const t=new Error("probe error");t.transport=e.name,this.emitReserved("upgradeError",t)}}))};function r(){n||(n=!0,c(),e.close(),e=null)}const o=t=>{const n=new Error("probe error: "+t);n.transport=e.name,r(),this.emitReserved("upgradeError",n)};function s(){o("transport closed")}function a(){o("socket closed")}function l(t){e&&t.name!==e.name&&r()}const c=()=>{e.removeListener("open",i),e.removeListener("error",o),e.removeListener("close",s),this.off("close",a),this.off("upgrading",l)};e.once("open",i),e.once("error",o),e.once("close",s),this.once("close",a),this.once("upgrading",l),e.open()}onOpen(){if(this.readyState="open",A.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){let t=0;const e=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emitReserved("flush"))}write(t,e,n){return this.sendPacket("message",t,e,n),this}send(t,e,n){return this.sendPacket("message",t,e,n),this}sendPacket(t,e,n,i){if("function"===typeof e&&(i=e,e=void 0),"function"===typeof n&&(i=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;n=n||{},n.compress=!1!==n.compress;const r={type:t,data:e,options:n};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},n=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():t()}):this.upgrading?n():t()),this}onError(t){A.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"===typeof removeEventListener&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const e=[];let n=0;const i=t.length;for(;n"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,D=Object.prototype.toString,R="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===D.call(Blob),P="function"===typeof File||"undefined"!==typeof File&&"[object FileConstructor]"===D.call(File);function B(t){return E&&(t instanceof ArrayBuffer||N(t))||R&&t instanceof Blob||P&&t instanceof File}function I(t,e){if(!t||"object"!==typeof t)return!1;if(Array.isArray(t)){for(let e=0,n=t.length;e0;case V.ACK:case V.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}function Y(t){try{return JSON.parse(t)}catch(e){return!1}}class q{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const t=j(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function K(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const G=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class X extends p["Emitter"]{constructor(t,e,n){super(),this.connected=!1,this.disconnected=!0,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,n&&n.auth&&(this.auth=n.auth),this.io._autoConnect&&this.open()}subEvents(){if(this.subs)return;const t=this.io;this.subs=[K(t,"open",this.onopen.bind(this)),K(t,"packet",this.onpacket.bind(this)),K(t,"error",this.onerror.bind(this)),K(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io["_reconnecting"]||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){if(G.hasOwnProperty(t))throw new Error('"'+t+'" is a reserved event name');e.unshift(t);const n={type:V.EVENT,data:e,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"===typeof e[e.length-1]){const t=this.ids++,i=e.pop();this._registerAckCallback(t,i),n.id=t}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable,r=this.flags.volatile&&(!i||!this.connected);return r||(this.connected?this.packet(n):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(t,e){const n=this.flags.timeout;if(void 0===n)return void(this.acks[t]=e);const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let e=0;e{this.io.clearTimeoutFn(i),e.apply(this,[null,...t])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){"function"==typeof this.auth?this.auth(t=>{this.packet({type:V.CONNECT,data:t})}):this.packet({type:V.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t){this.connected=!1,this.disconnected=!0,delete this.id,this.emitReserved("disconnect",t)}onpacket(t){const e=t.nsp===this.nsp;if(e)switch(t.type){case V.CONNECT:if(t.data&&t.data.sid){const e=t.data.sid;this.onconnect(e)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case V.EVENT:this.onevent(t);break;case V.BINARY_EVENT:this.onevent(t);break;case V.ACK:this.onack(t);break;case V.BINARY_ACK:this.onack(t);break;case V.DISCONNECT:this.ondisconnect();break;case V.CONNECT_ERROR:this.destroy();const e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e);break}}onevent(t){const e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const n of e)n.apply(this,t)}super.emit.apply(this,t)}ack(t){const e=this;let n=!1;return function(...i){n||(n=!0,e.packet({type:V.ACK,id:t,data:i}))}}onack(t){const e=this.acks[t.id];"function"===typeof e&&(e.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.disconnected=!1,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>this.packet(t)),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io["_destroy"](this)}disconnect(){return this.connected&&this.packet({type:V.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let n=0;n{n.cleanup(),n._readyState="closed",this.emitReserved("error",e),t?t(e):n.maybeReconnectOnOpen()});if(!1!==this._timeout){const t=this._timeout;0===t&&i();const n=this.setTimeoutFn(()=>{i(),e.close(),e.emit("error",new Error("timeout"))},t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(i),this.subs.push(r),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(K(t,"ping",this.onping.bind(this)),K(t,"data",this.ondata.bind(this)),K(t,"error",this.onerror.bind(this)),K(t,"close",this.onclose.bind(this)),K(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){this.decoder.add(t)}ondecoded(t){this.emitReserved("packet",t)}onerror(t){this.emitReserved("error",t)}socket(t,e){let n=this.nsps[t];return n||(n=new X(this,t,e),this.nsps[t]=n),n}_destroy(t){const e=Object.keys(this.nsps);for(const n of e){const t=this.nsps[n];if(t.active)return}this._close()}_packet(t){const e=this.encoder.encode(t);for(let n=0;nt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open(e=>{e?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):t.onreconnect()}))},e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const tt={};function et(t,e){"object"===typeof t&&(e=t,t=void 0),e=e||{};const n=l(t,e.path||"/socket.io"),i=n.source,r=n.id,o=n.path,s=tt[r]&&o in tt[r]["nsps"],a=e.forceNew||e["force new connection"]||!1===e.multiplex||s;let c;return a?c=new Q(i,e):(tt[r]||(tt[r]=new Q(i,e)),c=tt[r]),n.query&&!e.query&&(e.query=n.queryKey),c.socket(n.path,e)}Object.assign(et,{Manager:Q,Socket:X,io:et,connect:et});var nt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-row",[n("v-col",{staticClass:"px-0"},[n("v-card",{attrs:{outlined:""}},[n("v-row",[n("v-col",{staticClass:"py-0 mt-1"},[n("codemirror",{ref:"myCm",class:t.fontSize,attrs:{value:t.value,options:t.cmOptions},on:{ready:t.onCmReady,input:t.onCodeChange}})],1)],1)],1)],1)],1)},it=[],rt=n("8f94"),ot=(n("56b3"),n("7289"),n("9b74"),n("b933"),n("0b6c"),n("d7d5"),n("f6b6"),n("10b2"),n("a7be"),n("8d2f"),{data:function(){return{autoCloseBrackets:!0,tabSize:4,theme:"default",language:"default",keyMap:"default",fontSize:"normal"}},props:{value:{type:String,required:!1}},components:{codemirror:rt["codemirror"]},computed:{codemirror:function(){return this.$refs.myCm.codemirror},cmOptions:function(){return{tabSize:this.tabSize,indentUnit:this.tabSize,indentWithTabs:!0,smartIndent:!0,autoCloseBrackets:this.autoCloseBrackets,lineNumbers:!0,line:!0,styleActiveLine:!0,matchBrackets:!0,lineWrapping:!0,theme:this.theme,foldGutter:!0,keyMap:this.keyMap,extraKeys:{"Ctrl-/":"toggleComment","Cmd-/":"toggleComment"}}}},methods:{onCmReady:function(t){var e=this;console.log("Codemirror is ready !"),t.on("cursorActivity",(function(t){var n=t.getCursor();e.$emit("newCursor",{line:n.line,ch:n.ch})}))},onCodeChange:function(t){this.$emit("input",t)},modifyCursor:function(t){this.codemirror.setCursor(t)},onNewLine:function(t){var e=t.getDoc(),n=e.getCursor(),i=e.getLine(n.line),r={line:n.line,ch:i.length};return e.replaceRange("\n",r),rt["CodeMirror"].pass}}}),st=ot,at=n("2877"),lt=n("6544"),ct=n.n(lt),ut=n("b0af"),ht=n("ade3"),ft=n("5530"),dt=(n("d3b7"),n("a9e3"),n("b64b"),n("ac1f"),n("5319"),n("4ec9"),n("3ca3"),n("ddb0"),n("caad"),n("159b"),n("2ca0"),n("4b85"),n("2b0e")),pt=n("d9f7"),gt=n("80d2"),mt=["sm","md","lg","xl"],vt=function(){return mt.reduce((function(t,e){return t[e]={type:[Boolean,String,Number],default:!1},t}),{})}(),yt=function(){return mt.reduce((function(t,e){return t["offset"+Object(gt["t"])(e)]={type:[String,Number],default:null},t}),{})}(),bt=function(){return mt.reduce((function(t,e){return t["order"+Object(gt["t"])(e)]={type:[String,Number],default:null},t}),{})}(),wt={col:Object.keys(vt),offset:Object.keys(yt),order:Object.keys(bt)};function xt(t,e,n){var i=t;if(null!=n&&!1!==n){if(e){var r=e.replace(t,"");i+="-".concat(r)}return"col"!==t||""!==n&&!0!==n?(i+="-".concat(n),i.toLowerCase()):i.toLowerCase()}}var Ct=new Map,kt=dt["a"].extend({name:"v-col",functional:!0,props:Object(ft["a"])(Object(ft["a"])(Object(ft["a"])(Object(ft["a"])({cols:{type:[Boolean,String,Number],default:!1}},vt),{},{offset:{type:[String,Number],default:null}},yt),{},{order:{type:[String,Number],default:null}},bt),{},{alignSelf:{type:String,default:null,validator:function(t){return["auto","start","end","center","baseline","stretch"].includes(t)}},tag:{type:String,default:"div"}}),render:function(t,e){var n=e.props,i=e.data,r=e.children,o=(e.parent,"");for(var s in n)o+=String(n[s]);var a=Ct.get(o);return a||function(){var t,e;for(e in a=[],wt)wt[e].forEach((function(t){var i=n[t],r=xt(e,t,i);r&&a.push(r)}));var i=a.some((function(t){return t.startsWith("col-")}));a.push((t={col:!i||!n.cols},Object(ht["a"])(t,"col-".concat(n.cols),n.cols),Object(ht["a"])(t,"offset-".concat(n.offset),n.offset),Object(ht["a"])(t,"order-".concat(n.order),n.order),Object(ht["a"])(t,"align-self-".concat(n.alignSelf),n.alignSelf),t)),Ct.set(o,a)}(),t(n.tag,Object(pt["a"])(i,{class:a}),r)}}),St=(n("2532"),n("99af"),["sm","md","lg","xl"]),Tt=["start","end","center"];function Lt(t,e){return St.reduce((function(n,i){return n[t+Object(gt["t"])(i)]=e(),n}),{})}var Mt=function(t){return[].concat(Tt,["baseline","stretch"]).includes(t)},Ot=Lt("align",(function(){return{type:String,default:null,validator:Mt}})),At=function(t){return[].concat(Tt,["space-between","space-around"]).includes(t)},_t=Lt("justify",(function(){return{type:String,default:null,validator:At}})),Et=function(t){return[].concat(Tt,["space-between","space-around","stretch"]).includes(t)},Nt=Lt("alignContent",(function(){return{type:String,default:null,validator:Et}})),Dt={align:Object.keys(Ot),justify:Object.keys(_t),alignContent:Object.keys(Nt)},Rt={align:"align",justify:"justify",alignContent:"align-content"};function Pt(t,e,n){var i=Rt[t];if(null!=n){if(e){var r=e.replace(t,"");i+="-".concat(r)}return i+="-".concat(n),i.toLowerCase()}}var Bt=new Map,It=dt["a"].extend({name:"v-row",functional:!0,props:Object(ft["a"])(Object(ft["a"])(Object(ft["a"])({tag:{type:String,default:"div"},dense:Boolean,noGutters:Boolean,align:{type:String,default:null,validator:Mt}},Ot),{},{justify:{type:String,default:null,validator:At}},_t),{},{alignContent:{type:String,default:null,validator:Et}},Nt),render:function(t,e){var n=e.props,i=e.data,r=e.children,o="";for(var s in n)o+=String(n[s]);var a=Bt.get(o);return a||function(){var t,e;for(e in a=[],Dt)Dt[e].forEach((function(t){var i=n[t],r=Pt(e,t,i);r&&a.push(r)}));a.push((t={"no-gutters":n.noGutters,"row--dense":n.dense},Object(ht["a"])(t,"align-".concat(n.align),n.align),Object(ht["a"])(t,"justify-".concat(n.justify),n.justify),Object(ht["a"])(t,"align-content-".concat(n.alignContent),n.alignContent),t)),Bt.set(o,a)}(),t(n.tag,Object(pt["a"])(i,{staticClass:"row",class:a}),r)}}),Ft=Object(at["a"])(st,nt,it,!1,null,null,null),Wt=Ft.exports;ct()(Ft,{VCard:ut["a"],VCol:kt,VRow:It});var jt=n("11e3"),zt=n("aaf7"),Ht="https://diffsyncalter-server.onrender.com/",Vt={data:function(){return{logged:!1,value:{type:String,required:!1},connected:!1,socket:{},intel:1,name:"",room:"",snackbar:!1,timeout:3e3,notiContent:"",users:[],code:"",clp:"",tc:void 0,resetPass:0,numberValue:0,lossChance:0}},components:{Editor:Wt},mounted:function(){},methods:{createUser:function(){if(""!==this.name&&""!==this.room){this.initializeSocket(),this.logged=!0,console.log(this.name,this.room);var t=this.name,e=this.room;this.socket.emit("join",{name:t,room:e})}},exitRoom:function(){this.logged=!1,this.code="",this.socket.close(),this.users=[]},initializeSocket:function(){var t=this;this.socket=et(Ht,{transports:["websocket","polling","flashsocket"],enabledTransports:["ws","wss"]}),this.socket.on("notification",(function(e){t.notiContent=e.text,t.snackbar=!0})),this.socket.on("init",(function(e){t.tc=new jt(e),t.code=t.tc.code})),this.socket.on("roomData",(function(e){t.users=e.users})),this.socket.on("text",(function(e){t.tc.receivePackage(e),t.code!==t.tc.code&&(t.code=t.tc.code,t.resetPass++)})),setInterval((function(){t.tc&&t.logged&&t.users.length&&100*Math.random()>=t.lossChance&&t.socket.emit("sendText",t.tc.pushPackage())}),1e3)},socketUpdateCursor:function(t){0==t.line&&0==t.ch&&this.resetPass>0?(this.resetPass--,this.$refs.editor.modifyCursor(this.tc.setCursor())):this.tc.updateCursor(t.line,t.ch)},socketUpdateText:function(t){this.tc.code!==t&&(this.tc.code=t,100*Math.random()>=this.lossChance&&this.socket.emit("sendText",this.tc.pushPackage()))}},created:function(){var t=new zt;t.open("GET",Ht,!0),t.send()}},$t=Vt,Ut=n("8336"),Yt=n("99d9");n("4de4"),n("20f6"),n("498a"),n("a15b");function qt(t){return dt["a"].extend({name:"v-".concat(t),functional:!0,props:{id:String,tag:{type:String,default:"div"}},render:function(e,n){var i=n.props,r=n.data,o=n.children;r.staticClass="".concat(t," ").concat(r.staticClass||"").trim();var s=r.attrs;if(s){r.attrs={};var a=Object.keys(s).filter((function(t){if("slot"===t)return!1;var e=s[t];return t.startsWith("data-")?(r.attrs[t]=e,!1):e||"string"===typeof e}));a.length&&(r.staticClass+=" ".concat(a.join(" ")))}return i.id&&(r.domProps=r.domProps||{},r.domProps.id=i.id),e(i.tag,r,o)}})}var Kt,Gt=qt("container").extend({name:"v-container",functional:!0,props:{id:String,tag:{type:String,default:"div"},fluid:{type:Boolean,default:!1}},render:function(t,e){var n,i=e.props,r=e.data,o=e.children,s=r.attrs;return s&&(r.attrs={},n=Object.keys(s).filter((function(t){if("slot"===t)return!1;var e=s[t];return t.startsWith("data-")?(r.attrs[t]=e,!1):e||"string"===typeof e}))),i.id&&(r.domProps=r.domProps||{},r.domProps.id=i.id),t(i.tag,Object(pt["a"])(r,{staticClass:"container",class:Array({"container--fluid":i.fluid}).concat(n||[])}),o)}}),Xt=(n("07ac"),n("7db0"),n("58df")),Zt=n("7e2b"),Jt=n("3206"),Qt=Object(Xt["a"])(Zt["a"],Object(Jt["b"])("form")).extend({name:"v-form",provide:function(){return{form:this}},inheritAttrs:!1,props:{disabled:Boolean,lazyValidation:Boolean,readonly:Boolean,value:Boolean},data:function(){return{inputs:[],watchers:[],errorBag:{}}},watch:{errorBag:{handler:function(t){var e=Object.values(t).includes(!0);this.$emit("input",!e)},deep:!0,immediate:!0}},methods:{watchInput:function(t){var e=this,n=function(t){return t.$watch("hasError",(function(n){e.$set(e.errorBag,t._uid,n)}),{immediate:!0})},i={_uid:t._uid,valid:function(){},shouldValidate:function(){}};return this.lazyValidation?i.shouldValidate=t.$watch("shouldValidate",(function(r){r&&(e.errorBag.hasOwnProperty(t._uid)||(i.valid=n(t)))})):i.valid=n(t),i},validate:function(){return 0===this.inputs.filter((function(t){return!t.validate(!0)})).length},reset:function(){this.inputs.forEach((function(t){return t.reset()})),this.resetErrorBag()},resetErrorBag:function(){var t=this;this.lazyValidation&&setTimeout((function(){t.errorBag={}}),0)},resetValidation:function(){this.inputs.forEach((function(t){return t.resetValidation()})),this.resetErrorBag()},register:function(t){this.inputs.push(t),this.watchers.push(this.watchInput(t))},unregister:function(t){var e=this.inputs.find((function(e){return e._uid===t._uid}));if(e){var n=this.watchers.find((function(t){return t._uid===e._uid}));n&&(n.valid(),n.shouldValidate()),this.watchers=this.watchers.filter((function(t){return t._uid!==e._uid})),this.inputs=this.inputs.filter((function(t){return t._uid!==e._uid})),this.$delete(this.errorBag,e._uid)}}},render:function(t){var e=this;return t("form",{staticClass:"v-form",attrs:Object(ft["a"])({novalidate:!0},this.attrs$),on:{submit:function(t){return e.$emit("submit",t)}}},this.$slots.default)}}),te=(n("d81d"),n("25f0"),n("b680"),n("9e29"),n("1276"),n("d191"),n("c96a"),n("00b4"),n("fb6a"),n("4804"),n("a9ad")),ee=n("af2b"),ne=n("7560");function ie(t){return["fas","far","fal","fab","fad","fak"].some((function(e){return t.includes(e)}))}function re(t){return/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4}(function(t){t["xSmall"]="12px",t["small"]="16px",t["default"]="24px",t["medium"]="28px",t["large"]="36px",t["xLarge"]="40px"})(Kt||(Kt={}));var oe=Object(Xt["a"])(Zt["a"],te["a"],ee["a"],ne["a"]).extend({name:"v-icon",props:{dense:Boolean,disabled:Boolean,left:Boolean,right:Boolean,size:[Number,String],tag:{type:String,required:!1,default:"i"}},computed:{medium:function(){return!1},hasClickListener:function(){return Boolean(this.listeners$.click||this.listeners$["!click"])}},methods:{getIcon:function(){var t="";return this.$slots.default&&(t=this.$slots.default[0].text.trim()),Object(gt["s"])(this,t)},getSize:function(){var t={xSmall:this.xSmall,small:this.small,medium:this.medium,large:this.large,xLarge:this.xLarge},e=Object(gt["o"])(t).find((function(e){return t[e]}));return e&&Kt[e]||Object(gt["e"])(this.size)},getDefaultData:function(){return{staticClass:"v-icon notranslate",class:{"v-icon--disabled":this.disabled,"v-icon--left":this.left,"v-icon--link":this.hasClickListener,"v-icon--right":this.right,"v-icon--dense":this.dense},attrs:Object(ft["a"])({"aria-hidden":!this.hasClickListener,disabled:this.hasClickListener&&this.disabled,type:this.hasClickListener?"button":void 0},this.attrs$),on:this.listeners$}},getSvgWrapperData:function(){var t=this.getSize(),e=Object(ft["a"])(Object(ft["a"])({},this.getDefaultData()),{},{style:t?{fontSize:t,height:t,width:t}:void 0});return this.applyColors(e),e},applyColors:function(t){t.class=Object(ft["a"])(Object(ft["a"])({},t.class),this.themeClasses),this.setTextColor(this.color,t)},renderFontIcon:function(t,e){var n=[],i=this.getDefaultData(),r="material-icons",o=t.indexOf("-"),s=o<=-1;s?n.push(t):(r=t.slice(0,o),ie(r)&&(r="")),i.class[r]=!0,i.class[t]=!s;var a=this.getSize();return a&&(i.style={fontSize:a}),this.applyColors(i),e(this.hasClickListener?"button":this.tag,i,n)},renderSvgIcon:function(t,e){var n={class:"v-icon__svg",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":!0}},i=this.getSize();return i&&(n.style={fontSize:i,height:i,width:i}),e(this.hasClickListener?"button":"span",this.getSvgWrapperData(),[e("svg",n,[e("path",{attrs:{d:t}})])])},renderSvgIconComponent:function(t,e){var n={class:{"v-icon__component":!0}},i=this.getSize();i&&(n.style={fontSize:i,height:i,width:i}),this.applyColors(n);var r=t.component;return n.props=t.props,n.nativeOn=n.on,e(this.hasClickListener?"button":"span",this.getSvgWrapperData(),[e(r,n)])}},render:function(t){var e=this.getIcon();return"string"===typeof e?re(e)?this.renderSvgIcon(e,t):this.renderFontIcon(e,t):this.renderSvgIconComponent(e,t)}}),se=dt["a"].extend({name:"v-icon",$_wrapperFor:oe,functional:!0,render:function(t,e){var n=e.data,i=e.children,r="";return n.domProps&&(r=n.domProps.textContent||n.domProps.innerHTML||r,delete n.domProps.textContent,delete n.domProps.innerHTML),t(oe,n,r?[r]:i)}}),ae=se,le=(n("1b2c"),Object(Xt["a"])(ne["a"]).extend({name:"v-label",functional:!0,props:{absolute:Boolean,color:{type:String,default:"primary"},disabled:Boolean,focused:Boolean,for:String,left:{type:[Number,String],default:0},right:{type:[Number,String],default:"auto"},value:Boolean},render:function(t,e){var n=e.children,i=e.listeners,r=e.props,o={staticClass:"v-label",class:Object(ft["a"])({"v-label--active":r.value,"v-label--is-disabled":r.disabled},Object(ne["b"])(e)),attrs:{for:r.for,"aria-hidden":!r.for},on:i,style:{left:Object(gt["e"])(r.left),right:Object(gt["e"])(r.right),position:r.absolute?"absolute":"relative"},ref:"label"};return t("label",te["a"].options.methods.setTextColor(r.focused&&r.color,o),n)}})),ce=le,ue=(n("8ff2"),Object(Xt["a"])(te["a"],ne["a"]).extend({name:"v-messages",props:{value:{type:Array,default:function(){return[]}}},methods:{genChildren:function(){return this.$createElement("transition-group",{staticClass:"v-messages__wrapper",attrs:{name:"message-transition",tag:"div"}},this.value.map(this.genMessage))},genMessage:function(t,e){return this.$createElement("div",{staticClass:"v-messages__message",key:e},Object(gt["l"])(this,"default",{message:t,key:e})||[t])}},render:function(t){return t("div",this.setTextColor(this.color,{staticClass:"v-messages",class:this.themeClasses}),[this.genChildren()])}})),he=ue,fe=n("53ca"),de=n("d9bd"),pe=Object(Xt["a"])(te["a"],Object(Jt["a"])("form"),ne["a"]),ge=pe.extend({name:"validatable",props:{disabled:Boolean,error:Boolean,errorCount:{type:[Number,String],default:1},errorMessages:{type:[String,Array],default:function(){return[]}},messages:{type:[String,Array],default:function(){return[]}},readonly:Boolean,rules:{type:Array,default:function(){return[]}},success:Boolean,successMessages:{type:[String,Array],default:function(){return[]}},validateOnBlur:Boolean,value:{required:!1}},data:function(){return{errorBucket:[],hasColor:!1,hasFocused:!1,hasInput:!1,isFocused:!1,isResetting:!1,lazyValue:this.value,valid:!1}},computed:{computedColor:function(){if(!this.isDisabled)return this.color?this.color:this.isDark&&!this.appIsDark?"white":"primary"},hasError:function(){return this.internalErrorMessages.length>0||this.errorBucket.length>0||this.error},hasSuccess:function(){return this.internalSuccessMessages.length>0||this.success},externalError:function(){return this.internalErrorMessages.length>0||this.error},hasMessages:function(){return this.validationTarget.length>0},hasState:function(){return!this.isDisabled&&(this.hasSuccess||this.shouldValidate&&this.hasError)},internalErrorMessages:function(){return this.genInternalMessages(this.errorMessages)},internalMessages:function(){return this.genInternalMessages(this.messages)},internalSuccessMessages:function(){return this.genInternalMessages(this.successMessages)},internalValue:{get:function(){return this.lazyValue},set:function(t){this.lazyValue=t,this.$emit("input",t)}},isDisabled:function(){return this.disabled||!!this.form&&this.form.disabled},isInteractive:function(){return!this.isDisabled&&!this.isReadonly},isReadonly:function(){return this.readonly||!!this.form&&this.form.readonly},shouldValidate:function(){return!!this.externalError||!this.isResetting&&(this.validateOnBlur?this.hasFocused&&!this.isFocused:this.hasInput||this.hasFocused)},validations:function(){return this.validationTarget.slice(0,Number(this.errorCount))},validationState:function(){if(!this.isDisabled)return this.hasError&&this.shouldValidate?"error":this.hasSuccess?"success":this.hasColor?this.computedColor:void 0},validationTarget:function(){return this.internalErrorMessages.length>0?this.internalErrorMessages:this.successMessages&&this.successMessages.length>0?this.internalSuccessMessages:this.messages&&this.messages.length>0?this.internalMessages:this.shouldValidate?this.errorBucket:[]}},watch:{rules:{handler:function(t,e){Object(gt["h"])(t,e)||this.validate()},deep:!0},internalValue:function(){this.hasInput=!0,this.validateOnBlur||this.$nextTick(this.validate)},isFocused:function(t){t||this.isDisabled||(this.hasFocused=!0,this.validateOnBlur&&this.$nextTick(this.validate))},isResetting:function(){var t=this;setTimeout((function(){t.hasInput=!1,t.hasFocused=!1,t.isResetting=!1,t.validate()}),0)},hasError:function(t){this.shouldValidate&&this.$emit("update:error",t)},value:function(t){this.lazyValue=t}},beforeMount:function(){this.validate()},created:function(){this.form&&this.form.register(this)},beforeDestroy:function(){this.form&&this.form.unregister(this)},methods:{genInternalMessages:function(t){return t?Array.isArray(t)?t:[t]:[]},reset:function(){this.isResetting=!0,this.internalValue=Array.isArray(this.internalValue)?[]:null},resetValidation:function(){this.isResetting=!0},validate:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1?arguments[1]:void 0,n=[];e=e||this.internalValue,t&&(this.hasInput=this.hasFocused=!0);for(var i=0;i0},hasHint:function(){return!this.hasMessages&&!!this.hint&&(this.persistentHint||this.isFocused)},hasLabel:function(){return!(!this.$slots.label&&!this.label)},internalValue:{get:function(){return this.lazyValue},set:function(t){this.lazyValue=t,this.$emit(this.$_modelEvent,t)}},isDirty:function(){return!!this.lazyValue},isLabelActive:function(){return this.isDirty},messagesToDisplay:function(){var t=this;return this.hasHint?[this.hint]:this.hasMessages?this.validations.map((function(e){if("string"===typeof e)return e;var n=e(t.internalValue);return"string"===typeof n?n:""})).filter((function(t){return""!==t})):[]},showDetails:function(){return!1===this.hideDetails||"auto"===this.hideDetails&&this.hasDetails}},watch:{value:function(t){this.lazyValue=t}},beforeCreate:function(){this.$_modelEvent=this.$options.model&&this.$options.model.event||"input"},methods:{genContent:function(){return[this.genPrependSlot(),this.genControl(),this.genAppendSlot()]},genControl:function(){return this.$createElement("div",{staticClass:"v-input__control",attrs:{title:this.attrs$.title}},[this.genInputSlot(),this.genMessages()])},genDefaultSlot:function(){return[this.genLabel(),this.$slots.default]},genIcon:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this["".concat(t,"Icon")],o="click:".concat(Object(gt["m"])(t)),s=!(!this.listeners$[o]&&!e),a=Object(pt["a"])({attrs:{"aria-label":s?Object(gt["m"])(t).split("-")[0]+" icon":void 0,color:this.validationState,dark:this.dark,disabled:this.isDisabled,light:this.light},on:s?{click:function(t){t.preventDefault(),t.stopPropagation(),n.$emit(o,t),e&&e(t)},mouseup:function(t){t.preventDefault(),t.stopPropagation()}}:void 0},i);return this.$createElement("div",{staticClass:"v-input__icon",class:t?"v-input__icon--".concat(Object(gt["m"])(t)):void 0},[this.$createElement(ae,a,r)])},genInputSlot:function(){return this.$createElement("div",this.setBackgroundColor(this.backgroundColor,{staticClass:"v-input__slot",style:{height:Object(gt["e"])(this.height)},on:{click:this.onClick,mousedown:this.onMouseDown,mouseup:this.onMouseUp},ref:"input-slot"}),[this.genDefaultSlot()])},genLabel:function(){return this.hasLabel?this.$createElement(ce,{props:{color:this.validationState,dark:this.dark,disabled:this.isDisabled,focused:this.hasState,for:this.computedId,light:this.light}},this.$slots.label||this.label):null},genMessages:function(){var t=this;return this.showDetails?this.$createElement(he,{props:{color:this.hasHint?"":this.validationState,dark:this.dark,light:this.light,value:this.messagesToDisplay},attrs:{role:this.hasMessages?"alert":null},scopedSlots:{default:function(e){return Object(gt["l"])(t,"message",e)}}}):null},genSlot:function(t,e,n){if(!n.length)return null;var i="".concat(t,"-").concat(e);return this.$createElement("div",{staticClass:"v-input__".concat(i),ref:i},n)},genPrependSlot:function(){var t=[];return this.$slots.prepend?t.push(this.$slots.prepend):this.prependIcon&&t.push(this.genIcon("prepend")),this.genSlot("prepend","outer",t)},genAppendSlot:function(){var t=[];return this.$slots.append?t.push(this.$slots.append):this.appendIcon&&t.push(this.genIcon("append")),this.genSlot("append","outer",t)},onClick:function(t){this.$emit("click",t)},onMouseDown:function(t){this.hasMouseDown=!0,this.$emit("mousedown",t)},onMouseUp:function(t){this.hasMouseDown=!1,this.$emit("mouseup",t)}},render:function(t){return t("div",this.setTextColor(this.validationState,{staticClass:"v-input",class:this.classes}),this.genContent())}}),ye=ve,be=n("0789"),we=n("297c");function xe(t){if("function"!==typeof t.getRootNode){while(t.parentNode)t=t.parentNode;return t!==document?null:document}var e=t.getRootNode();return e!==document&&e.getRootNode({composed:!0})!==document?null:e}function Ce(){return!0}function ke(t,e,n){if(!t||!1===Se(t,n))return!1;var i=xe(e);if("undefined"!==typeof ShadowRoot&&i instanceof ShadowRoot&&i.host===t.target)return!1;var r=("object"===Object(fe["a"])(n.value)&&n.value.include||function(){return[]})();return r.push(e),!r.some((function(e){return e.contains(t.target)}))}function Se(t,e){var n="object"===Object(fe["a"])(e.value)&&e.value.closeConditional||Ce;return n(t)}function Te(t,e,n,i){var r="function"===typeof n.value?n.value:n.value.handler;e._clickOutside.lastMousedownWasOutside&&ke(t,e,n)&&setTimeout((function(){Se(t,n)&&r&&r(t)}),0)}function Le(t,e){var n=xe(t);e(document),"undefined"!==typeof ShadowRoot&&n instanceof ShadowRoot&&e(n)}var Me={inserted:function(t,e,n){var i=function(i){return Te(i,t,e,n)},r=function(n){t._clickOutside.lastMousedownWasOutside=ke(n,t,e)};Le(t,(function(t){t.addEventListener("click",i,!0),t.addEventListener("mousedown",r,!0)})),t._clickOutside||(t._clickOutside={lastMousedownWasOutside:!0}),t._clickOutside[n.context._uid]={onClick:i,onMousedown:r}},unbind:function(t,e,n){t._clickOutside&&(Le(t,(function(e){var i;if(e&&null!=(i=t._clickOutside)&&i[n.context._uid]){var r=t._clickOutside[n.context._uid],o=r.onClick,s=r.onMousedown;e.removeEventListener("click",o,!0),e.removeEventListener("mousedown",s,!0)}})),delete t._clickOutside[n.context._uid])}},Oe=Me,Ae=Object(Xt["a"])(ye,we["a"]).extend({name:"v-slider",directives:{ClickOutside:Oe},mixins:[we["a"]],props:{disabled:Boolean,inverseLabel:Boolean,max:{type:[Number,String],default:100},min:{type:[Number,String],default:0},step:{type:[Number,String],default:1},thumbColor:String,thumbLabel:{type:[Boolean,String],default:void 0,validator:function(t){return"boolean"===typeof t||"always"===t}},thumbSize:{type:[Number,String],default:32},tickLabels:{type:Array,default:function(){return[]}},ticks:{type:[Boolean,String],default:!1,validator:function(t){return"boolean"===typeof t||"always"===t}},tickSize:{type:[Number,String],default:2},trackColor:String,trackFillColor:String,value:[Number,String],vertical:Boolean},data:function(){return{app:null,oldValue:null,thumbPressed:!1,mouseTimeout:-1,isFocused:!1,isActive:!1,noClick:!1,startOffset:0}},computed:{classes:function(){return Object(ft["a"])(Object(ft["a"])({},ye.options.computed.classes.call(this)),{},{"v-input__slider":!0,"v-input__slider--vertical":this.vertical,"v-input__slider--inverse-label":this.inverseLabel})},internalValue:{get:function(){return this.lazyValue},set:function(t){t=isNaN(t)?this.minValue:t;var e=this.roundValue(Math.min(Math.max(t,this.minValue),this.maxValue));e!==this.lazyValue&&(this.lazyValue=e,this.$emit("input",e))}},trackTransition:function(){return this.thumbPressed?this.showTicks||this.stepNumeric?"0.1s cubic-bezier(0.25, 0.8, 0.5, 1)":"none":""},minValue:function(){return parseFloat(this.min)},maxValue:function(){return parseFloat(this.max)},stepNumeric:function(){return this.step>0?parseFloat(this.step):0},inputWidth:function(){var t=(this.roundValue(this.internalValue)-this.minValue)/(this.maxValue-this.minValue)*100;return isNaN(t)?0:t},trackFillStyles:function(){var t,e=this.vertical?"bottom":"left",n=this.vertical?"top":"right",i=this.vertical?"height":"width",r=this.$vuetify.rtl?"auto":"0",o=this.$vuetify.rtl?"0":"auto",s=this.isDisabled?"calc(".concat(this.inputWidth,"% - 10px)"):"".concat(this.inputWidth,"%");return t={transition:this.trackTransition},Object(ht["a"])(t,e,r),Object(ht["a"])(t,n,o),Object(ht["a"])(t,i,s),t},trackStyles:function(){var t,e=this.vertical?this.$vuetify.rtl?"bottom":"top":this.$vuetify.rtl?"left":"right",n=this.vertical?"height":"width",i="0px",r=this.isDisabled?"calc(".concat(100-this.inputWidth,"% - 10px)"):"calc(".concat(100-this.inputWidth,"%)");return t={transition:this.trackTransition},Object(ht["a"])(t,e,i),Object(ht["a"])(t,n,r),t},showTicks:function(){return this.tickLabels.length>0||!(this.isDisabled||!this.stepNumeric||!this.ticks)},numTicks:function(){return Math.ceil((this.maxValue-this.minValue)/this.stepNumeric)},showThumbLabel:function(){return!this.isDisabled&&!(!this.thumbLabel&&!this.$scopedSlots["thumb-label"])},computedTrackColor:function(){if(!this.isDisabled)return this.trackColor?this.trackColor:this.isDark?this.validationState:this.validationState||"primary lighten-3"},computedTrackFillColor:function(){if(!this.isDisabled)return this.trackFillColor?this.trackFillColor:this.validationState||this.computedColor},computedThumbColor:function(){return this.thumbColor?this.thumbColor:this.validationState||this.computedColor}},watch:{min:function(t){var e=parseFloat(t);e>this.internalValue&&this.$emit("input",e)},max:function(t){var e=parseFloat(t);e0}},o)},genThumbContainer:function(t,e,n,i,r,o){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"thumb",a=[this.genThumb()],l=this.genThumbLabelContent(t);return this.showThumbLabel&&a.push(this.genThumbLabel(l)),this.$createElement("div",this.setTextColor(this.computedThumbColor,{ref:s,key:s,staticClass:"v-slider__thumb-container",class:{"v-slider__thumb-container--active":n,"v-slider__thumb-container--focused":i,"v-slider__thumb-container--show-label":this.showThumbLabel},style:this.getThumbContainerStyles(e),attrs:{role:"slider",tabindex:this.isDisabled?-1:this.$attrs.tabindex?this.$attrs.tabindex:0,"aria-label":this.$attrs["aria-label"]||this.label,"aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":this.internalValue,"aria-readonly":String(this.isReadonly),"aria-orientation":this.vertical?"vertical":"horizontal"},on:{focus:r,blur:o,keydown:this.onKeyDown}}),a)},genThumbLabelContent:function(t){return this.$scopedSlots["thumb-label"]?this.$scopedSlots["thumb-label"]({value:t}):[this.$createElement("span",[String(t)])]},genThumbLabel:function(t){var e=Object(gt["e"])(this.thumbSize),n=this.vertical?"translateY(20%) translateY(".concat(Number(this.thumbSize)/3-1,"px) translateX(55%) rotate(135deg)"):"translateY(-20%) translateY(-12px) translateX(-50%) rotate(45deg)";return this.$createElement(be["b"],{props:{origin:"bottom center"}},[this.$createElement("div",{staticClass:"v-slider__thumb-label-container",directives:[{name:"show",value:this.isFocused||this.isActive||"always"===this.thumbLabel}]},[this.$createElement("div",this.setBackgroundColor(this.computedThumbColor,{staticClass:"v-slider__thumb-label",style:{height:e,width:e,transform:n}}),[this.$createElement("div",t)])])])},genThumb:function(){return this.$createElement("div",this.setBackgroundColor(this.computedThumbColor,{staticClass:"v-slider__thumb"}))},getThumbContainerStyles:function(t){var e=this.vertical?"top":"left",n=this.$vuetify.rtl?100-t:t;return n=this.vertical?100-n:n,Object(ht["a"])({transition:this.trackTransition},e,"".concat(n,"%"))},onSliderMouseDown:function(t){var e,n=this;if(t.preventDefault(),this.oldValue=this.internalValue,this.isActive=!0,null!=(e=t.target)&&e.matches(".v-slider__thumb-container, .v-slider__thumb-container *")){this.thumbPressed=!0;var i=t.target.getBoundingClientRect(),r="touches"in t?t.touches[0]:t;this.startOffset=this.vertical?r.clientY-(i.top+i.height/2):r.clientX-(i.left+i.width/2)}else this.startOffset=0,window.clearTimeout(this.mouseTimeout),this.mouseTimeout=window.setTimeout((function(){n.thumbPressed=!0}),300);var o=!gt["r"]||{passive:!0,capture:!0},s=!!gt["r"]&&{passive:!0},a="touches"in t;this.onMouseMove(t),this.app.addEventListener(a?"touchmove":"mousemove",this.onMouseMove,s),Object(gt["a"])(this.app,a?"touchend":"mouseup",this.onSliderMouseUp,o),this.$emit("start",this.internalValue)},onSliderMouseUp:function(t){t.stopPropagation(),window.clearTimeout(this.mouseTimeout),this.thumbPressed=!1;var e=!!gt["r"]&&{passive:!0};this.app.removeEventListener("touchmove",this.onMouseMove,e),this.app.removeEventListener("mousemove",this.onMouseMove,e),this.$emit("mouseup",t),this.$emit("end",this.internalValue),Object(gt["h"])(this.oldValue,this.internalValue)||(this.$emit("change",this.internalValue),this.noClick=!0),this.isActive=!1},onMouseMove:function(t){"mousemove"===t.type&&(this.thumbPressed=!0),this.internalValue=this.parseMouseMove(t)},onKeyDown:function(t){if(this.isInteractive){var e=this.parseKeyDown(t,this.internalValue);null==e||ethis.maxValue||(this.internalValue=e,this.$emit("change",e))}},onSliderClick:function(t){if(this.noClick)this.noClick=!1;else{var e=this.$refs.thumb;e.focus(),this.onMouseMove(t),this.$emit("change",this.internalValue)}},onBlur:function(t){this.isFocused=!1,this.$emit("blur",t)},onFocus:function(t){this.isFocused=!0,this.$emit("focus",t)},parseMouseMove:function(t){var e=this.vertical?"top":"left",n=this.vertical?"height":"width",i=this.vertical?"clientY":"clientX",r=this.$refs.track.getBoundingClientRect(),o=r[e],s=r[n],a="touches"in t?t.touches[0][i]:t[i],l=Math.min(Math.max((a-o-this.startOffset)/s,0),1)||0;return this.vertical&&(l=1-l),this.$vuetify.rtl&&(l=1-l),parseFloat(this.min)+l*(this.maxValue-this.minValue)},parseKeyDown:function(t,e){if(this.isInteractive){var n=gt["n"].pageup,i=gt["n"].pagedown,r=gt["n"].end,o=gt["n"].home,s=gt["n"].left,a=gt["n"].right,l=gt["n"].down,c=gt["n"].up;if([n,i,r,o,s,a,l,c].includes(t.keyCode)){t.preventDefault();var u=this.stepNumeric||1,h=(this.maxValue-this.minValue)/u;if([s,a,l,c].includes(t.keyCode)){var f=this.$vuetify.rtl?[s,c]:[a,c],d=f.includes(t.keyCode)?1:-1,p=t.shiftKey?3:t.ctrlKey?2:1;e+=d*u*p}else if(t.keyCode===o)e=this.minValue;else if(t.keyCode===r)e=this.maxValue;else{var g=t.keyCode===i?1:-1;e-=g*u*(h>100?h/10:10)}return e}}},roundValue:function(t){if(!this.stepNumeric)return t;var e=this.step.toString().trim(),n=e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0,i=this.minValue%this.stepNumeric,r=Math.round((t-i)/this.stepNumeric)*this.stepNumeric+i;return parseFloat(Math.min(r,this.maxValue).toFixed(n))}}}),_e=(n("ca71"),n("8dd9")),Ee=n("f2e7"),Ne=n("fe6c"),De=Object(Xt["a"])(_e["a"],te["a"],Ee["a"],Object(Ne["b"])(["absolute","bottom","left","right","top"])).extend({name:"v-snackbar",props:{app:Boolean,centered:Boolean,contentClass:{type:String,default:""},multiLine:Boolean,text:Boolean,timeout:{type:[Number,String],default:5e3},transition:{type:[Boolean,String],default:"v-snack-transition",validator:function(t){return"string"===typeof t||!1===t}},vertical:Boolean},data:function(){return{activeTimeout:-1}},computed:{classes:function(){return{"v-snack--absolute":this.absolute,"v-snack--active":this.isActive,"v-snack--bottom":this.bottom||!this.top,"v-snack--centered":this.centered,"v-snack--has-background":this.hasBackground,"v-snack--left":this.left,"v-snack--multi-line":this.multiLine&&!this.vertical,"v-snack--right":this.right,"v-snack--text":this.text,"v-snack--top":this.top,"v-snack--vertical":this.vertical}},hasBackground:function(){return!this.text&&!this.outlined},isDark:function(){return this.hasBackground?!this.light:ne["a"].options.computed.isDark.call(this)},styles:function(){if(this.absolute||!this.app)return{};var t=this.$vuetify.application,e=t.bar,n=t.bottom,i=t.footer,r=t.insetFooter,o=t.left,s=t.right,a=t.top;return{paddingBottom:Object(gt["e"])(n+i+r),paddingLeft:Object(gt["e"])(o),paddingRight:Object(gt["e"])(s),paddingTop:Object(gt["e"])(e+a)}}},watch:{isActive:"setTimeout",timeout:"setTimeout"},mounted:function(){this.isActive&&this.setTimeout()},created:function(){this.$attrs.hasOwnProperty("auto-height")&&Object(de["e"])("auto-height",this),0==this.timeout&&Object(de["d"])('timeout="0"',"-1",this)},methods:{genActions:function(){return this.$createElement("div",{staticClass:"v-snack__action "},[Object(gt["l"])(this,"action",{attrs:{class:"v-snack__btn"}})])},genContent:function(){return this.$createElement("div",{staticClass:"v-snack__content",class:Object(ht["a"])({},this.contentClass,!0),attrs:{role:"status","aria-live":"polite"}},[Object(gt["l"])(this)])},genWrapper:function(){var t=this,e=this.hasBackground?this.setBackgroundColor:this.setTextColor,n=e(this.color,{staticClass:"v-snack__wrapper",class:_e["a"].options.computed.classes.call(this),style:_e["a"].options.computed.styles.call(this),directives:[{name:"show",value:this.isActive}],on:{pointerenter:function(){return window.clearTimeout(t.activeTimeout)},pointerleave:this.setTimeout}});return this.$createElement("div",n,[this.genContent(),this.genActions()])},genTransition:function(){return this.$createElement("transition",{props:{name:this.transition}},[this.genWrapper()])},setTimeout:function(){var t=this;window.clearTimeout(this.activeTimeout);var e=Number(this.timeout);this.isActive&&![0,-1].includes(e)&&(this.activeTimeout=window.setTimeout((function(){t.isActive=!1}),e))}},render:function(t){return t("div",{staticClass:"v-snack",class:this.classes,style:this.styles},[!1!==this.transition?this.genTransition():this.genWrapper()])}}),Re=n("15fd"),Pe=n("6b75");function Be(t){if(Array.isArray(t))return Object(Pe["a"])(t)}n("a4d3"),n("e01a"),n("d28b"),n("a630");function Ie(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}var Fe=n("06c5");function We(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function je(t){return Be(t)||Ie(t)||Object(Fe["a"])(t)||We()}n("0481"),n("4069"),n("2b19"),n("4ff9"),n("e9b1");var ze=Object(Xt["a"])(ne["a"]).extend({name:"v-counter",functional:!0,props:{value:{type:[Number,String],default:""},max:[Number,String]},render:function(t,e){var n=e.props,i=parseInt(n.max,10),r=parseInt(n.value,10),o=i?"".concat(r," / ").concat(i):String(n.value),s=i&&r>i;return t("div",{staticClass:"v-counter",class:Object(ft["a"])({"error--text":s},Object(ne["b"])(e))},o)}}),He=ze,Ve=n("90a2");function $e(t){return dt["a"].extend({name:"intersectable",data:function(){return{isIntersecting:!1}},mounted:function(){Ve["a"].inserted(this.$el,{name:"intersect",value:this.onObserve},this.$vnode)},destroyed:function(){Ve["a"].unbind(this.$el,{name:"intersect",value:this.onObserve},this.$vnode)},methods:{onObserve:function(e,n,i){if(this.isIntersecting=i,i)for(var r=0,o=t.onVisible.length;r0||this.badInput},isEnclosed:function(){return this.filled||this.isSolo||this.outlined},isLabelActive:function(){return this.isDirty||Je.includes(this.type)},isSingle:function(){return this.isSolo||this.singleLine||this.fullWidth||this.filled&&!this.hasLabel},isSolo:function(){return this.solo||this.soloInverted},labelPosition:function(){var t=this.prefix&&!this.labelValue?this.prefixWidth:0;return this.labelValue&&this.prependWidth&&(t-=this.prependWidth),this.$vuetify.rtl===this.reverse?{left:t,right:"auto"}:{left:"auto",right:t}},showLabel:function(){return this.hasLabel&&!(this.isSingle&&this.labelValue)},labelValue:function(){return this.isFocused||this.isLabelActive||this.persistentPlaceholder}},watch:{outlined:"setLabelWidth",label:function(){this.$nextTick(this.setLabelWidth)},prefix:function(){this.$nextTick(this.setPrefixWidth)},isFocused:"updateValue",value:function(t){this.lazyValue=t}},created:function(){this.$attrs.hasOwnProperty("box")&&Object(de["a"])("box","filled",this),this.$attrs.hasOwnProperty("browser-autocomplete")&&Object(de["a"])("browser-autocomplete","autocomplete",this),this.shaped&&!(this.filled||this.outlined||this.isSolo)&&Object(de["c"])("shaped should be used with either filled or outlined",this)},mounted:function(){var t=this;this.$watch((function(){return t.labelValue}),this.setLabelWidth),this.autofocus&&this.tryAutofocus(),requestAnimationFrame((function(){t.isBooted=!0,requestAnimationFrame((function(){t.isIntersecting||t.onResize()}))}))},methods:{focus:function(){this.onFocus()},blur:function(t){var e=this;window.requestAnimationFrame((function(){e.$refs.input&&e.$refs.input.blur()}))},clearableCallback:function(){var t=this;this.$refs.input&&this.$refs.input.focus(),this.$nextTick((function(){return t.internalValue=null}))},genAppendSlot:function(){var t=[];return this.$slots["append-outer"]?t.push(this.$slots["append-outer"]):this.appendOuterIcon&&t.push(this.genIcon("appendOuter")),this.genSlot("append","outer",t)},genPrependInnerSlot:function(){var t=[];return this.$slots["prepend-inner"]?t.push(this.$slots["prepend-inner"]):this.prependInnerIcon&&t.push(this.genIcon("prependInner")),this.genSlot("prepend","inner",t)},genIconSlot:function(){var t=[];return this.$slots.append?t.push(this.$slots.append):this.appendIcon&&t.push(this.genIcon("append")),this.genSlot("append","inner",t)},genInputSlot:function(){var t=ye.options.methods.genInputSlot.call(this),e=this.genPrependInnerSlot();return e&&(t.children=t.children||[],t.children.unshift(e)),t},genClearIcon:function(){return this.clearable?this.isDirty?this.genSlot("append","inner",[this.genIcon("clear",this.clearableCallback)]):this.genSlot("append","inner",[this.$createElement("div")]):null},genCounter:function(){var t,e,n;if(!this.hasCounter)return null;var i=!0===this.counter?this.attrs$.maxlength:this.counter,r={dark:this.dark,light:this.light,max:i,value:this.computedCounterValue};return null!=(t=null==(e=(n=this.$scopedSlots).counter)?void 0:e.call(n,{props:r}))?t:this.$createElement(He,{props:r})},genControl:function(){return ye.options.methods.genControl.call(this)},genDefaultSlot:function(){return[this.genFieldset(),this.genTextFieldSlot(),this.genClearIcon(),this.genIconSlot(),this.genProgress()]},genFieldset:function(){return this.outlined?this.$createElement("fieldset",{attrs:{"aria-hidden":!0}},[this.genLegend()]):null},genLabel:function(){if(!this.showLabel)return null;var t={props:{absolute:!0,color:this.validationState,dark:this.dark,disabled:this.isDisabled,focused:!this.isSingle&&(this.isFocused||!!this.validationState),for:this.computedId,left:this.labelPosition.left,light:this.light,right:this.labelPosition.right,value:this.labelValue}};return this.$createElement(ce,t,this.$slots.label||this.label)},genLegend:function(){var t=this.singleLine||!this.labelValue&&!this.isDirty?0:this.labelWidth,e=this.$createElement("span",{domProps:{innerHTML:"​"},staticClass:"notranslate"});return this.$createElement("legend",{style:{width:this.isSingle?void 0:Object(gt["e"])(t)}},[e])},genInput:function(){var t=Object.assign({},this.listeners$);delete t.change;var e=this.attrs$,n=(e.title,Object(Re["a"])(e,Xe));return this.$createElement("input",{style:{},domProps:{value:"number"===this.type&&Object.is(this.lazyValue,-0)?"-0":this.lazyValue},attrs:Object(ft["a"])(Object(ft["a"])({},n),{},{autofocus:this.autofocus,disabled:this.isDisabled,id:this.computedId,placeholder:this.persistentPlaceholder||this.isFocused||!this.hasLabel?this.placeholder:void 0,readonly:this.isReadonly,type:this.type}),on:Object.assign(t,{blur:this.onBlur,input:this.onInput,focus:this.onFocus,keydown:this.onKeyDown}),ref:"input",directives:[{name:"resize",modifiers:{quiet:!0},value:this.onResize}]})},genMessages:function(){if(!this.showDetails)return null;var t=ye.options.methods.genMessages.call(this),e=this.genCounter();return this.$createElement("div",{staticClass:"v-text-field__details"},[t,e])},genTextFieldSlot:function(){return this.$createElement("div",{staticClass:"v-text-field__slot"},[this.genLabel(),this.prefix?this.genAffix("prefix"):null,this.genInput(),this.suffix?this.genAffix("suffix"):null])},genAffix:function(t){return this.$createElement("div",{class:"v-text-field__".concat(t),ref:t},this[t])},onBlur:function(t){var e=this;this.isFocused=!1,t&&this.$nextTick((function(){return e.$emit("blur",t)}))},onClick:function(){this.isFocused||this.isDisabled||!this.$refs.input||this.$refs.input.focus()},onFocus:function(t){if(this.$refs.input){var e=xe(this.$el);if(e)return e.activeElement!==this.$refs.input?this.$refs.input.focus():void(this.isFocused||(this.isFocused=!0,t&&this.$emit("focus",t)))}},onInput:function(t){var e=t.target;this.internalValue=e.value,this.badInput=e.validity&&e.validity.badInput},onKeyDown:function(t){t.keyCode===gt["n"].enter&&this.lazyValue!==this.initialValue&&(this.initialValue=this.lazyValue,this.$emit("change",this.initialValue)),this.$emit("keydown",t)},onMouseDown:function(t){t.target!==this.$refs.input&&(t.preventDefault(),t.stopPropagation()),ye.options.methods.onMouseDown.call(this,t)},onMouseUp:function(t){this.hasMouseDown&&this.focus(),ye.options.methods.onMouseUp.call(this,t)},setLabelWidth:function(){this.outlined&&(this.labelWidth=this.$refs.label?Math.min(.75*this.$refs.label.scrollWidth+6,this.$el.offsetWidth-24):0)},setPrefixWidth:function(){this.$refs.prefix&&(this.prefixWidth=this.$refs.prefix.offsetWidth)},setPrependWidth:function(){this.outlined&&this.$refs["prepend-inner"]&&(this.prependWidth=this.$refs["prepend-inner"].offsetWidth)},tryAutofocus:function(){if(!this.autofocus||"undefined"===typeof document||!this.$refs.input)return!1;var t=xe(this.$el);return!(!t||t.activeElement===this.$refs.input)&&(this.$refs.input.focus(),!0)},updateValue:function(t){this.hasColor=t,t?this.initialValue=this.lazyValue:this.initialValue!==this.lazyValue&&this.$emit("change",this.lazyValue)},onResize:function(){this.setLabelWidth(),this.setPrefixWidth(),this.setPrependWidth()}}}),tn=Object(at["a"])($t,r,o,!1,null,null,null);e["default"]=tn.exports;ct()(tn,{VBtn:Ut["a"],VCardText:Yt["a"],VCol:kt,VContainer:Gt,VForm:Qt,VRow:It,VSlider:Ae,VSnackbar:De,VTextField:Qe})},"8d2f":function(t,e,n){},"8f94":function(t,e,n){!function(e,i){t.exports=i(n("56b3"))}(0,(function(t){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=3)}([function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),r=function(t){return t&&t.__esModule?t:{default:t}}(i),o=window.CodeMirror||r.default;"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),i=1;i */ e.read=function(t,e,n,i,r){var o,s,a=8*r-i-1,l=(1<>1,u=-7,h=n?r-1:0,f=n?-1:1,d=t[e+h];for(h+=f,o=d&(1<<-u)-1,d>>=-u,u+=a;u>0;o=256*o+t[e+h],h+=f,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=256*s+t[e+h],h+=f,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=c}return(d?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,n,i,r,o){var s,a,l,c=8*o-r-1,u=(1<>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),e+=s+h>=1?f/l:f*Math.pow(2,1-h),e*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(e*l-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[n+d]=255&a,d+=p,a/=256,r-=8);for(s=s<0;t[n+d]=255&s,d+=p,s/=256,c-=8);t[n+d-p]|=128*g}},"970b":function(t,e){function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.exports=n,t.exports.__esModule=!0,t.exports["default"]=t.exports},"9b74":function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";var e="CodeMirror-hint",n="CodeMirror-hint-active";function i(t,e){if(this.cm=t,this.options=e,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var n=this;t.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}}t.showHint=function(t,e,n){if(!e)return t.showHint(n);n&&n.async&&(e.async=!0);var i={hint:e};if(n)for(var r in n)i[r]=n[r];return t.showHint(i)},t.defineExtension("showHint",(function(e){e=s(this,this.getCursor("start"),e);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!e.hint.supportsSelection)return;for(var r=0;rf.clientHeight+1;setTimeout((function(){N=s.getScrollInfo()}));var P=D.bottom-E;if(P>0){var B=D.bottom-D.top,I=w.top-(w.bottom-D.top);if(I-B>0)f.style.top=(C=w.top-B-T)+"px",k=!1;else if(B>E){f.style.height=E-5+"px",f.style.top=(C=w.bottom-D.top-T)+"px";var F=s.getCursor();r.from.ch!=F.ch&&(w=s.cursorCoords(F),f.style.left=(x=w.left-S)+"px",D=f.getBoundingClientRect())}}var W,j=D.right-_;if(R&&(j+=s.display.nativeBarWidth),j>0&&(D.right-D.left>_&&(f.style.width=_-5+"px",j-=D.right-D.left-_),f.style.left=(x=w.left-j-S)+"px"),R)for(var z=f.firstChild;z;z=z.nextSibling)z.style.paddingRight=s.display.nativeBarWidth+"px";(s.addKeyMap(this.keyMap=l(i,{moveFocus:function(t,e){o.changeActive(o.selectedHint+t,e)},setFocus:function(t){o.changeActive(t)},menuSize:function(){return o.screenAmount()},length:p.length,close:function(){i.close()},pick:function(){o.pick()},data:r})),i.options.closeOnUnfocus)&&(s.on("blur",this.onBlur=function(){W=setTimeout((function(){i.close()}),100)}),s.on("focus",this.onFocus=function(){clearTimeout(W)}));s.on("scroll",this.onScroll=function(){var t=s.getScrollInfo(),e=s.getWrapperElement().getBoundingClientRect();N||(N=s.getScrollInfo());var n=C+N.top-t.top,r=n-(h.pageYOffset||(u.documentElement||u.body).scrollTop);if(k||(r+=f.offsetHeight),r<=e.top||r>=e.bottom)return i.close();f.style.top=n+"px",f.style.left=x+N.left-t.left+"px"}),t.on(f,"dblclick",(function(t){var e=c(f,t.target||t.srcElement);e&&null!=e.hintId&&(o.changeActive(e.hintId),o.pick())})),t.on(f,"click",(function(t){var e=c(f,t.target||t.srcElement);e&&null!=e.hintId&&(o.changeActive(e.hintId),i.options.completeOnSingleClick&&o.pick())})),t.on(f,"mousedown",(function(){setTimeout((function(){s.focus()}),20)}));var H=this.getSelectedHintRange();return 0===H.from&&0===H.to||this.scrollToActive(),t.signal(r,"select",p[this.selectedHint],f.childNodes[this.selectedHint]),!0}function h(t,e){if(!t.somethingSelected())return e;for(var n=[],i=0;i0?e(t):o(r+1)}))}o(0)};return o.async=!0,o.supportsSelection=!0,o}return(i=e.getHelper(e.getCursor(),"hintWords"))?function(e){return t.hint.fromList(e,{words:i})}:t.hint.anyword?function(e,n){return t.hint.anyword(e,n)}:function(){}}i.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&t.signal(this.data,"close"),this.widget&&this.widget.close(),t.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(e,n){var i=e.list[n],r=this;this.cm.operation((function(){i.hint?i.hint(r.cm,e,i):r.cm.replaceRange(a(i),i.from||e.from,i.to||e.to,"complete"),t.signal(e,"pick",i),r.cm.scrollIntoView()})),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(o(this.debounce),this.debounce=0);var t=this.startPos;this.data&&(t=this.data.from);var e=this.cm.getCursor(),n=this.cm.getLine(e.line);if(e.line!=this.startPos.line||n.length-e.ch!=this.startLen-this.startPos.ch||e.ch=this.data.list.length?e=i?this.data.list.length-1:0:e<0&&(e=i?0:this.data.list.length-1),this.selectedHint!=e){var r=this.hints.childNodes[this.selectedHint];r&&(r.className=r.className.replace(" "+n,""),r.removeAttribute("aria-selected")),r=this.hints.childNodes[this.selectedHint=e],r.className+=" "+n,r.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",r.id),this.scrollToActive(),t.signal(this.data,"select",this.data.list[this.selectedHint],r)}},scrollToActive:function(){var t=this.getSelectedHintRange(),e=this.hints.childNodes[t.from],n=this.hints.childNodes[t.to],i=this.hints.firstChild;e.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+i.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var t=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-t),to:Math.min(this.data.list.length-1,this.selectedHint+t)}}},t.registerHelper("hint","auto",{resolve:d}),t.registerHelper("hint","fromList",(function(e,n){var i,r=e.getCursor(),o=e.getTokenAt(r),s=t.Pos(r.line,o.start),a=r;o.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};t.defineOption("hintOptions",null)}))},"9e29":function(t,e,n){},a7be:function(t,e,n){},aaf7:function(t,e){t.exports=XMLHttpRequest},af7f:function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return a}));var i=n("20a4");function r(t,...e){return e.reduce((e,n)=>(t.hasOwnProperty(n)&&(e[n]=t[n]),e),{})}const o=setTimeout,s=clearTimeout;function a(t,e){e.useNativeTimers?(t.setTimeoutFn=o.bind(i["a"]),t.clearTimeoutFn=s.bind(i["a"])):(t.setTimeoutFn=setTimeout.bind(i["a"]),t.clearTimeoutFn=clearTimeout.bind(i["a"]))}},b19d:function(t,e){function n(t){if(t)return i(t)}function i(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}e.Emitter=n,n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,i=this._callbacks["$"+t];if(!i)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var r=0;r>1,u=-7,h=n?r-1:0,f= * @license MIT */ var i=n("1fb5"),r=n("9152"),o=n("e3db");function s(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"===typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function b(t){return+t!=t&&(t=0),c.alloc(+t)}function w(t,e){if(c.isBuffer(t))return t.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!==typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return X(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Q(t).length;default:if(i)return X(t).length;e=(""+e).toLowerCase(),i=!0}}function x(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";t||(t="utf8");while(1)switch(t){case"hex":return I(this,e,n);case"utf8":case"utf-8":return N(this,e,n);case"ascii":return P(this,e,n);case"latin1":case"binary":return B(this,e,n);case"base64":return E(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function C(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function k(t,e,n,i,r){if(0===t.length)return-1;if("string"===typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"===typeof e&&(e=c.from(e,i)),c.isBuffer(e))return 0===e.length?-1:S(t,e,n,i,r);if("number"===typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):S(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function S(t,e,n,i,r){var o,s=1,a=t.length,l=e.length;if(void 0!==i&&(i=String(i).toLowerCase(),"ucs2"===i||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(r){var u=-1;for(o=n;oa&&(n=a-l),o=n;o>=0;o--){for(var h=!0,f=0;fr&&(i=r)):i=r;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s239?4:c>223?3:c>191?2:1;if(r+h<=n)switch(h){case 1:c<128&&(u=c);break;case 2:o=t[r+1],128===(192&o)&&(l=(31&c)<<6|63&o,l>127&&(u=l));break;case 3:o=t[r+1],s=t[r+2],128===(192&o)&&128===(192&s)&&(l=(15&c)<<12|(63&o)<<6|63&s,l>2047&&(l<55296||l>57343)&&(u=l));break;case 4:o=t[r+1],s=t[r+2],a=t[r+3],128===(192&o)&&128===(192&s)&&128===(192&a)&&(l=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a,l>65535&&l<1114112&&(u=l))}null===u?(u=65533,h=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|1023&u),i.push(u),r+=h}return R(i)}e.Buffer=c,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:s(),e.kMaxLength=a(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,n){return u(null,t,e,n)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,n){return f(null,t,e,n)},c.allocUnsafe=function(t){return d(null,t)},c.allocUnsafeSlow=function(t){return d(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,r=0,o=Math.min(n,i);r0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},c.prototype.compare=function(t,e,n,i,r){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,r>>>=0,this===t)return 0;for(var o=r-i,s=n-e,a=Math.min(o,s),l=this.slice(i,r),u=t.slice(e,n),h=0;hr)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return T(this,t,e,n);case"utf8":case"utf-8":return L(this,t,e,n);case"ascii":return M(this,t,e,n);case"latin1":case"binary":return O(this,t,e,n);case"base64":return A(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function R(t){var e=t.length;if(e<=D)return String.fromCharCode.apply(String,t);var n="",i=0;while(ii)&&(n=i);for(var r="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,n,i,r,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function z(t,e,n,i){e<0&&(e=65535+e+1);for(var r=0,o=Math.min(t.length-n,2);r>>8*(i?r:1-r)}function H(t,e,n,i){e<0&&(e=4294967295+e+1);for(var r=0,o=Math.min(t.length-n,4);r>>8*(i?r:3-r)&255}function V(t,e,n,i,r,o){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function $(t,e,n,i,o){return o||V(t,e,n,4,34028234663852886e22,-34028234663852886e22),r.write(t,e,n,i,23,4),n+4}function U(t,e,n,i,o){return o||V(t,e,n,8,17976931348623157e292,-17976931348623157e292),r.write(t,e,n,i,52,8),n+8}c.prototype.slice=function(t,e){var n,i=this.length;if(t=~~t,e=void 0===e?i:~~e,t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),e0&&(r*=256))i+=this[t+--e]*r;return i},c.prototype.readUInt8=function(t,e){return e||W(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||W(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||W(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||W(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||W(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||W(t,e,this.length);var i=this[t],r=1,o=0;while(++o=r&&(i-=Math.pow(2,8*e)),i},c.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||W(t,e,this.length);var i=e,r=1,o=this[t+--i];while(i>0&&(r*=256))o+=this[t+--i]*r;return r*=128,o>=r&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return e||W(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||W(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(t,e){e||W(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(t,e){return e||W(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||W(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||W(t,4,this.length),r.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||W(t,4,this.length),r.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||W(t,8,this.length),r.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||W(t,8,this.length),r.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e|=0,n|=0,!i){var r=Math.pow(2,8*n)-1;j(this,t,e,n,r,0)}var o=1,s=0;this[e]=255&t;while(++s=0&&(s*=256))this[e+o]=t/s&255;return e+n},c.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):H(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):H(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);j(this,t,e,n,r-1,-r)}var o=0,s=1,a=0;this[e]=255&t;while(++o>0)-a&255;return e+n},c.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);j(this,t,e,n,r-1,-r)}var o=n-1,s=1,a=0;this[e+o]=255&t;while(--o>=0&&(s*=256))t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},c.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):H(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):H(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,n){return $(this,t,e,!0,n)},c.prototype.writeFloatBE=function(t,e,n){return $(this,t,e,!1,n)},c.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},c.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},c.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--r)t[r+e]=this[r+n];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"===typeof t)for(o=e;o55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Z(t){for(var e=[],n=0;n>8,r=n%256,o.push(r),o.push(i)}return o}function Q(t){return i.toByteArray(q(t))}function tt(t,e,n,i){for(var r=0;r=e.length||r>=t.length)break;e[r+n]=t[r]}return r}function et(t){return t!==t}}).call(this,n("c8ba"))},b933:function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";var e,n,i=t.Pos;function r(t){var e=t.flags;return null!=e?e:(t.ignoreCase?"i":"")+(t.global?"g":"")+(t.multiline?"m":"")}function o(t,e){for(var n=r(t),i=n,o=0;ou)break;var f=t.getLine(c++);r=null==r?f:r+"\n"+f}l*=2,e.lastIndex=n.ch;var d=e.exec(r);if(d){var p=r.slice(0,d.index).split("\n"),g=d[0].split("\n"),m=n.line+p.length-1,v=p[p.length-1].length;return{from:i(m,v),to:i(m+g.length-1,1==g.length?v+g[0].length:g[g.length-1].length),match:d}}}}function c(t,e,n){var i,r=0;while(r<=t.length){e.lastIndex=r;var o=e.exec(t);if(!o)break;var s=o.index+o[0].length;if(s>t.length-n)break;(!i||s>i.index+i[0].length)&&(i=o),r=o.index+1}return i}function u(t,e,n){e=o(e,"g");for(var r=n.line,s=n.ch,a=t.firstLine();r>=a;r--,s=-1){var l=t.getLine(r),u=c(l,e,s<0?0:l.length-s);if(u)return{from:i(r,u.index),to:i(r,u.index+u[0].length),match:u}}}function h(t,e,n){if(!s(e))return u(t,e,n);e=o(e,"gm");for(var r,a=1,l=t.getLine(n.line).length-n.ch,h=n.line,f=t.firstLine();h>=f;){for(var d=0;d=f;d++){var p=t.getLine(h--);r=null==r?p:p+"\n"+r}a*=2;var g=c(r,e,l);if(g){var m=r.slice(0,g.index).split("\n"),v=g[0].split("\n"),y=h+m.length,b=m[m.length-1].length;return{from:i(y,b),to:i(y+v.length-1,1==v.length?b+v[0].length:v[v.length-1].length),match:g}}}}function f(t,e,n,i){if(t.length==e.length)return n;for(var r=0,o=n+Math.max(0,t.length-e.length);;){if(r==o)return r;var s=r+o>>1,a=i(t.slice(0,s)).length;if(a==n)return s;a>n?o=s:r=s+1}}function d(t,r,o,s){if(!r.length)return null;var a=s?e:n,l=a(r).split(/\r|\n\r?/);t:for(var c=o.line,u=o.ch,h=t.lastLine()+1-l.length;c<=h;c++,u=0){var d=t.getLine(c).slice(u),p=a(d);if(1==l.length){var g=p.indexOf(l[0]);if(-1==g)continue t;o=f(d,p,g,a)+u;return{from:i(c,f(d,p,g,a)+u),to:i(c,f(d,p,g+l[0].length,a)+u)}}var m=p.length-l[0].length;if(p.slice(m)==l[0]){for(var v=1;v=h;c--,u=-1){var d=t.getLine(c);u>-1&&(d=d.slice(0,u));var p=a(d);if(1==l.length){var g=p.lastIndexOf(l[0]);if(-1==g)continue t;return{from:i(c,f(d,p,g,a)),to:i(c,f(d,p,g+l[0].length,a))}}var m=l[l.length-1];if(p.slice(0,m.length)==m){var v=1;for(o=c-l.length+1;v(this.doc.getLine(n.line)||"").length&&(n.ch=0,n.line++)),0!=t.cmpPos(n,this.doc.clipPos(n))))return this.atOccurrence=!1;var r=this.matches(e,n);if(this.afterEmptyMatch=r&&0==t.cmpPos(r.from,r.to),r)return this.pos=r,this.atOccurrence=!0,this.pos.match||!0;var o=i(e?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(e,n){if(this.atOccurrence){var r=t.splitLines(e);this.doc.replaceRange(r,this.pos.from,this.pos.to,n),this.pos.to=i(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}},t.defineExtension("getSearchCursor",(function(t,e,n){return new g(this.doc,t,e,n)})),t.defineDocExtension("getSearchCursor",(function(t,e,n){return new g(this,t,e,n)})),t.defineExtension("selectMatches",(function(e,n){var i=[],r=this.getSearchCursor(e,this.getCursor("from"),n);while(r.findNext()){if(t.cmpPos(r.to(),this.getCursor("to"))>0)break;i.push({anchor:r.from(),head:r.to()})}i.length&&this.setSelections(i,0)}))}))},c9eb:function(t,e){try{t.exports="undefined"!==typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(n){t.exports=!1}},ca71:function(t,e,n){},d191:function(t,e,n){},d7d5:function(t,e,n){(function(t){t(n("56b3"))})((function(t){function e(t){t.state.placeholder&&(t.state.placeholder.parentNode.removeChild(t.state.placeholder),t.state.placeholder=null)}function n(t){e(t);var n=t.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=t.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var i=t.getOption("placeholder");"string"==typeof i&&(i=document.createTextNode(i)),n.appendChild(i),t.display.lineSpace.insertBefore(n,t.display.lineSpace.firstChild)}function i(t){setTimeout((function(){var i=!1;if(1==t.lineCount()){var r=t.getInputField();i="TEXTAREA"==r.nodeName?!t.getLine(0).length:!/[^\u200b]/.test(r.querySelector(".CodeMirror-line").textContent)}i?n(t):e(t)}),20)}function r(t){s(t)&&n(t)}function o(t){var i=t.getWrapperElement(),r=s(t);i.className=i.className.replace(" CodeMirror-empty","")+(r?" CodeMirror-empty":""),r?n(t):e(t)}function s(t){return 1===t.lineCount()&&""===t.getLine(0)}t.defineOption("placeholder","",(function(n,s,a){var l=a&&a!=t.Init;if(s&&!l)n.on("blur",r),n.on("change",o),n.on("swapDoc",o),t.on(n.getInputField(),"compositionupdate",n.state.placeholderCompose=function(){i(n)}),o(n);else if(!s&&l){n.off("blur",r),n.off("change",o),n.off("swapDoc",o),t.off(n.getInputField(),"compositionupdate",n.state.placeholderCompose),e(n);var c=n.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}s&&!n.hasFocus()&&r(n)}))}))},e3db:function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},e9b1:function(t,e,n){},f6b6:function(t,e,n){}}]); -//# sourceMappingURL=codepair.6db91fd8.js.map \ No newline at end of file +//# sourceMappingURL=codepair.6db91fd8.js.map