diff --git a/packages/api-explorer/dist/index.js b/packages/api-explorer/dist/index.js index 70a9b4f62..a5ebce86a 100644 --- a/packages/api-explorer/dist/index.js +++ b/packages/api-explorer/dist/index.js @@ -1 +1 @@ -module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=302)}([function(e,t,r){"use strict";e.exports=r(305)},function(e,t,r){"use strict";e.exports=r(311)()},function(e,t,r){"use strict";var n,o,a;function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}a=function(){var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),a=/Edge\/(\d+)/.exec(e),s=n||o||a,l=s&&(n?document.documentMode||6:+(a||o)[1]),u=!a&&/WebKit\//.test(e),c=u&&/Qt\/\d+\.\d+/.test(e),f=!a&&/Chrome\//.test(e),p=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),m=/PhantomJS/.test(e),v=!a&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),y=/Android/.test(e),g=v||y||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=v||/Mac/.test(t),E=/\bCrOS\b/.test(e),_=/win/i.test(t),T=p&&e.match(/Version\/(\d*\.\d*)/);T&&(T=Number(T[1])),T&&T>=15&&(p=!1,u=!0);var S=b&&(c||p&&(null==T||T<12.11)),w=r||s&&l>=9;function x(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var k,O=function(e,t){var r=e.className,n=x(t).exec(r);if(n){var o=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(o?n[1]+o:"")}};function A(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function C(e,t){return A(e).appendChild(t)}function P(e,t,r,n){var o=document.createElement(e);if(r&&(o.className=r),n&&(o.style.cssText=n),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var a=0;a=t)return i+(t-a);i+=s-a,i+=r-i%r,a=s+1}}v?I=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(I=function(e){try{e.select()}catch(e){}});var U=function(){this.id=null};function B(e,t){for(var r=0;r=t)return n+Math.min(i,t-o);if(o+=a-n,n=a+1,(o+=r-o%r)>=t)return n}}var V=[""];function Y(e){for(;V.length<=e;)V.push(Q(V)+" ");return V[e]}function Q(e){return e[e.length-1]}function J(e,t){for(var r=[],n=0;n"€"&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function re(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var oe=/[\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 ae(e){return e.charCodeAt(0)>=768&&oe.test(e)}function ie(e,t,r){for(;(r<0?t>0:tr?-1:1;;){if(t==r)return t;var o=(t+r)/2,a=n<0?Math.ceil(o):Math.floor(o);if(a==t)return e(a)?t:r;e(a)?r=a:t=a+n}}function le(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var o=r.children[n],a=o.chunkSize();if(t=e.first&&tr?ve(r,le(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?ve(e.line,t):r<0?ve(e.line,0):e}(t,le(e,t.line).text.length)}function we(e,t){for(var r=[],n=0;n=t:a.to>t);(n||(n=[])).push(new Oe(i,a.from,s?null:a.to))}}return n}(r,o,i),l=function(e,t,r){var n;if(e)for(var o=0;o=t:a.to>t)||a.from==t&&"bookmark"==i.type&&(!r||a.marker.insertLeft)){var s=null==a.from||(i.inclusiveLeft?a.from<=t:a.from0&&s)for(var b=0;b=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?ye(u.to,r)>=0:ye(u.to,r)>0)||c>=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?ye(u.from,n)<=0:ye(u.from,n)<0)))return!0}}}function Be(e){for(var t;t=Fe(e);)e=t.find(-1,!0).line;return e}function He(e,t){var r=le(e,t),n=Be(r);return r==n?t:pe(n)}function ze(e,t){if(t>e.lastLine())return t;var r,n=le(e,t);if(!$e(e,n))return t;for(;r=qe(n);)n=r.find(1,!0).line;return pe(n)+1}function $e(e,t){var r=ke&&t.markedSpans;if(r)for(var n=void 0,o=0;ot.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}var Ye=null;function Qe(e,t,r){var n;Ye=null;for(var o=0;ot)return o;a.to==t&&(a.from!=a.to&&"before"==r?n=o:Ye=o),a.from==t&&(a.from!=a.to&&"before"!=r?n=o:Ye=o)}return null!=n?n:Ye}var Je=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,i=/[1n]/;function s(e,t,r){this.level=e,this.from=t,this.to=r}return function(l,u){var c="ltr"==u?"L":"R";if(0==l.length||"ltr"==u&&!r.test(l))return!1;for(var f,p=l.length,d=[],h=0;h-1&&(n[t]=o.slice(0,a).concat(o.slice(a+1)))}}}function nt(e,t){var r=tt(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),o=0;o0}function st(e){e.prototype.on=function(e,t){et(this,e,t)},e.prototype.off=function(e,t){rt(this,e,t)}}function lt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ut(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ct(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ft(e){lt(e),ut(e)}function pt(e){return e.target||e.srcElement}function dt(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var ht,mt,vt=function(){if(s&&l<9)return!1;var e=P("div");return"draggable"in e||"dragDrop"in e}();function yt(e){if(null==ht){var t=P("span","​");C(e,P("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(ht=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&l<8))}var r=ht?P("span","​"):P("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function gt(e){if(null!=mt)return mt;var t=C(e,document.createTextNode("AخA")),r=k(t,0,1).getBoundingClientRect(),n=k(t,1,2).getBoundingClientRect();return A(e),!(!r||r.left==r.right)&&(mt=n.right-r.right<3)}var bt,Et=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var a=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),i=a.indexOf("\r");-1!=i?(r.push(a.slice(0,i)),t+=i+1):(r.push(a),t=o+1)}return r}:function(e){return e.split(/\r\n?|\n/)},_t=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Tt="oncopy"in(bt=P("div"))||(bt.setAttribute("oncopy","return;"),"function"==typeof bt.oncopy),St=null;var wt={},xt={};function kt(e){if("string"==typeof e&&xt.hasOwnProperty(e))e=xt[e];else if(e&&"string"==typeof e.name&&xt.hasOwnProperty(e.name)){var t=xt[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return kt("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return kt("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ot(e,t){t=kt(t);var r=wt[t.name];if(!r)return Ot(e,"text/plain");var n=r(e,t);if(At.hasOwnProperty(t.name)){var o=At[t.name];for(var a in o)o.hasOwnProperty(a)&&(n.hasOwnProperty(a)&&(n["_"+a]=n[a]),n[a]=o[a])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var i in t.modeProps)n[i]=t.modeProps[i];return n}var At={};function Ct(e,t){F(t,At.hasOwnProperty(e)?At[e]:At[e]={})}function Pt(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var o=t[n];o instanceof Array&&(o=o.concat([])),r[n]=o}return r}function Rt(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Nt(e,t,r){return!e.startState||e.startState(t,r)}var Lt=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};Lt.prototype.eol=function(){return this.pos>=this.string.length},Lt.prototype.sol=function(){return this.pos==this.lineStart},Lt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Lt.prototype.next=function(){if(this.post},Lt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Lt.prototype.skipToEnd=function(){this.pos=this.string.length},Lt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Lt.prototype.backUp=function(e){this.pos-=e},Lt.prototype.column=function(){return this.lastColumnPos0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var o=function(e){return r?e.toLowerCase():e};if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},Lt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Lt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Lt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Lt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var Dt=function(e,t){this.state=e,this.lookAhead=t},jt=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function It(e,t,r,n){var o=[e.state.modeGen],a={};Wt(e,t.text,e.doc.mode,r,function(e,t){return o.push(e,t)},a,n);for(var i=r.state,s=function(n){r.baseTokens=o;var s=e.state.overlays[n],l=1,u=0;r.state=!0,Wt(e,t.text,s.mode,r,function(e,t){for(var r=l;ue&&o.splice(l,1,e,o[l+1],n),l+=2,u=Math.min(e,n)}if(t)if(s.opaque)o.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;re.options.maxHighlightLength&&Pt(e.doc.mode,n.state),a=It(e,t,n);o&&(n.state=o),t.stateAfter=n.save(!o),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ft(e,t,r){var n=e.doc,o=e.display;if(!n.mode.startState)return new jt(n,!0,t);var a=function(e,t,r){for(var n,o,a=e.doc,i=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>i;--s){if(s<=a.first)return a.first;var l=le(a,s-1),u=l.stateAfter;if(u&&(!r||s+(u instanceof Dt?u.lookAhead:0)<=a.modeFrontier))return s;var c=q(l.text,null,e.options.tabSize);(null==o||n>c)&&(o=s-1,n=c)}return o}(e,t,r),i=a>n.first&&le(n,a-1).stateAfter,s=i?jt.fromSaved(n,i,a):new jt(n,Nt(n.mode),a);return n.iter(a,t,function(r){qt(e,r.text,s);var n=s.line;r.stateAfter=n==t-1||n%5==0||n>=o.viewFrom&&nt.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}jt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},jt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},jt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},jt.fromSaved=function(e,t,r){return t instanceof Dt?new jt(e,Pt(e.mode,t.state),r,t.lookAhead):new jt(e,Pt(e.mode,t),r)},jt.prototype.save=function(e){var t=!1!==e?Pt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Dt(t,this.maxLookAhead):t};var Ht=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function zt(e,t,r,n){var o,a,i=e.doc,s=i.mode,l=le(i,(t=Se(i,t)).line),u=Ft(e,t.line,r),c=new Lt(l.text,e.options.tabSize,u);for(n&&(a=[]);(n||c.pose.options.maxHighlightLength?(s=!1,i&&qt(e,t,n,f.pos),f.pos=t.length,l=null):l=$t(Bt(r,f,n.state,p),a),p){var d=p[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!s||c!=l){for(;u1&&!/ /.test(e))return e;for(var r=t,n="",o=0;ou&&f.from<=u);p++);if(f.to>=c)return e(r,n,o,a,i,s,l);e(r,n.slice(0,f.to-u),o,a,null,s,l),a=null,n=n.slice(f.to-u),u=f.to}}}function tr(e,t,r,n){var o=!n&&r.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!n&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",r.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function rr(e,t,r){var n=e.markedSpans,o=e.text,a=0;if(n)for(var i,s,l,u,c,f,p,d=o.length,h=0,m=1,v="",y=0;;){if(y==h){l=u=c=f=s="",p=null,y=1/0;for(var g=[],b=void 0,E=0;Eh||T.collapsed&&_.to==h&&_.from==h)?(null!=_.to&&_.to!=h&&y>_.to&&(y=_.to,u=""),T.className&&(l+=" "+T.className),T.css&&(s=(s?s+";":"")+T.css),T.startStyle&&_.from==h&&(c+=" "+T.startStyle),T.endStyle&&_.to==y&&(b||(b=[])).push(T.endStyle,_.to),T.title&&!f&&(f=T.title),T.collapsed&&(!p||Ie(p.marker,T)<0)&&(p=_)):_.from>h&&y>_.from&&(y=_.from)}if(b)for(var S=0;S=d)break;for(var x=Math.min(d,y);;){if(v){var k=h+v.length;if(!p){var O=k>x?v.slice(0,x-h):v;t.addToken(t,O,i?i+l:l,c,h+O.length==y?u:"",f,s)}if(k>=x){v=v.slice(x-h),h=x;break}h=k,c=""}v=o.slice(a,a=r[m++]),i=Qt(r[m++],t.cm.options)}}else for(var A=1;Ar)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function Cr(e,t,r,n){return Nr(e,Rr(e,t),r,n)}function Pr(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&t2&&a.push((l.bottom+u.top)/2-r.top)}}a.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(a=function(e,t,r,n){var o,a=jr(t.map,r,n),i=a.node,u=a.start,c=a.end,f=a.collapse;if(3==i.nodeType){for(var p=0;p<4;p++){for(;u&&ae(t.line.text.charAt(a.coverStart+u));)--u;for(;a.coverStart+c1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,o))}else{var d;u>0&&(f=n="right"),o=e.options.lineWrapping&&(d=i.getClientRects()).length>1?d["right"==n?d.length-1:0]:i.getBoundingClientRect()}if(s&&l<9&&!u&&(!o||!o.left&&!o.right)){var h=i.parentNode.getClientRects()[0];o=h?{left:h.left,right:h.left+tn(e.display),top:h.top,bottom:h.bottom}:Dr}for(var m=o.top-t.rect.top,v=o.bottom-t.rect.top,y=(m+v)/2,g=t.view.measure.heights,b=0;bt)&&(o=(a=l-s)-1,t>=l&&(i="right")),null!=o){if(n=e[u+2],s==l&&r==(n.insertLeft?"left":"right")&&(i=r),"left"==r&&0==o)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],i="left";if("right"==r&&o==l-s)for(;u=0&&(r=e[o]).left==r.right;o--);return r}function Mr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=n.text.length?(l=n.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return i("before"==u?l-1:l,"before"==u);function c(e,t,r){var n=1==s[t].level;return i(r?e-1:e,n!=r)}var f=Qe(s,l,u),p=Ye,d=c(l,f,"before"==u);return null!=p&&(d.other=c(l,p,"before"!=u)),d}function Gr(e,t){var r=0;t=Se(e.doc,t),e.options.lineWrapping||(r=tn(e.display)*t.ch);var n=le(e.doc,t.line),o=Ke(n)+Tr(e.display);return{left:r,right:r,top:o,bottom:o+n.height}}function Vr(e,t,r,n,o){var a=ve(e,t,r);return a.xRel=o,n&&(a.outside=!0),a}function Yr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Vr(n.first,0,null,!0,-1);var o=de(n,r),a=n.first+n.size-1;if(o>a)return Vr(n.first+n.size-1,le(n,a).text.length,null,!0,1);t<0&&(t=0);for(var i=le(n,o);;){var s=Zr(e,i,o,t,r),l=qe(i),u=l&&l.find(0,!0);if(!l||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;o=pe(i=u.to.line)}}function Qr(e,t,r,n){n-=Hr(t);var o=t.text.length,a=se(function(t){return Nr(e,r,t-1).bottom<=n},o,0);return{begin:a,end:o=se(function(t){return Nr(e,r,t).top>n},a,o)}}function Jr(e,t,r,n){return r||(r=Rr(e,t)),Qr(e,t,r,zr(e,t,Nr(e,r,n),"line").top)}function Xr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function Zr(e,t,r,n,o){o-=Ke(t);var a=Rr(e,t),i=Hr(t),s=0,l=t.text.length,u=!0,c=Xe(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?function(e,t,r,n,o,a,i){var s=Qr(e,t,n,i),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,f=null,p=0;p=u||d.to<=l)){var h=1!=d.level,m=Nr(e,n,h?Math.min(u,d.to)-1:Math.max(l,d.from)).right,v=mv)&&(c=d,f=v)}}c||(c=o[o.length-1]);c.fromu&&(c={from:c.from,to:u,level:c.level});return c}:function(e,t,r,n,o,a,i){var s=se(function(s){var l=o[s],u=1!=l.level;return Xr(Kr(e,ve(r,u?l.to:l.from,u?"before":"after"),"line",t,n),a,i,!0)},0,o.length-1),l=o[s];if(s>0){var u=1!=l.level,c=Kr(e,ve(r,u?l.from:l.to,u?"after":"before"),"line",t,n);Xr(c,a,i,!0)&&c.top>i&&(l=o[s-1])}return l})(e,t,r,a,c,n,o);s=(u=1!=f.level)?f.from:f.to-1,l=u?f.to:f.from-1}var p,d,h=null,m=null,v=se(function(t){var r=Nr(e,a,t);return r.top+=i,r.bottom+=i,!!Xr(r,n,o,!1)&&(r.top<=o&&r.left<=n&&(h=t,m=r),!0)},s,l),y=!1;if(m){var g=n-m.left=E.bottom}return Vr(r,v=ie(t.text,v,1),d,y,n-p)}function en(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Lr){Lr=P("pre");for(var t=0;t<49;++t)Lr.appendChild(document.createTextNode("x")),Lr.appendChild(P("br"));Lr.appendChild(document.createTextNode("x"))}C(e.measure,Lr);var r=Lr.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),A(e.measure),r||1}function tn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=P("span","xxxxxxxxxx"),r=P("pre",[t]);C(e.measure,r);var n=t.getBoundingClientRect(),o=(n.right-n.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function rn(e){for(var t=e.display,r={},n={},o=t.gutters.clientLeft,a=t.gutters.firstChild,i=0;a;a=a.nextSibling,++i)r[e.options.gutters[i]]=a.offsetLeft+a.clientLeft+o,n[e.options.gutters[i]]=a.clientWidth;return{fixedPos:nn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function nn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function on(e){var t=en(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/tn(e.display)-3);return function(o){if($e(e.doc,o))return 0;var a=0;if(o.widgets)for(var i=0;i=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n=e.display.viewTo||s.to().linet||t==r&&i.to==t)&&(n(Math.max(i.from,t),Math.min(i.to,r),1==i.level?"rtl":"ltr",a),o=!0)}o||n(t,r,"ltr")}(m,r||0,null==n?p:n,function(e,t,o,f){var v="ltr"==o,y=d(e,v?"left":"right"),g=d(t-1,v?"right":"left"),b=null==r&&0==e,E=null==n&&t==p,_=0==f,T=!m||f==m.length-1;if(g.top-y.top<=3){var S=(u?E:b)&&T,w=(u?b:E)&&_?s:(v?y:g).left,x=S?l:(v?g:y).right;c(w,y.top,x-w,y.bottom)}else{var k,O,A,C;v?(k=u&&b&&_?s:y.left,O=u?l:h(e,o,"before"),A=u?s:h(t,o,"after"),C=u&&E&&T?l:g.right):(k=u?h(e,o,"before"):s,O=!u&&b&&_?l:y.right,A=!u&&E&&T?s:g.left,C=u?h(t,o,"after"):l),c(k,y.top,O-k,y.bottom),y.bottom0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function mn(e){e.state.focused||(e.display.input.focus(),yn(e))}function vn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,gn(e))},100)}function yn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(nt(e,"focus",e,t),e.state.focused=!0,D(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),u&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),hn(e))}function gn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(nt(e,"blur",e,t),e.state.focused=!1,O(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function bn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n.005||c<-.005)&&(fe(o.line,a),En(o.line),o.rest))for(var f=0;f=i&&(a=de(t,Ke(le(t,l))-e.wrapper.clientHeight),i=l)}return{from:a,to:Math.max(i,a+1)}}function Tn(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=nn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,a=n+"px",i=0;ia&&(t.bottom=t.top+a);var s=e.doc.height+Sr(r),l=t.tops-n;if(t.topo+a){var c=Math.min(t.top,(u?s:t.bottom)-a);c!=o&&(i.scrollTop=c)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,p=kr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),d=t.right-t.left>p;return d&&(t.right=t.left+p),t.left<10?i.scrollLeft=0:t.leftp+f-3&&(i.scrollLeft=t.right+(d?0:10)-p),i}function xn(e,t){null!=t&&(An(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function kn(e){An(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function On(e,t,r){null==t&&null==r||An(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function An(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Cn(e,Gr(e,t.from),Gr(e,t.to),t.margin))}function Cn(e,t,r,n){var o=wn(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});On(e,o.scrollLeft,o.scrollTop)}function Pn(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||so(e,{top:t}),Rn(e,t,!0),r&&so(e),ro(e,100))}function Rn(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Nn(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,Tn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Ln(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Sr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+xr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Dn=function(e,t,r){this.cm=r;var n=this.vert=P("div",[P("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=P("div",[P("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(o),et(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),et(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Dn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var o=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Dn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Dn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Dn.prototype.zeroWidthHack=function(){var e=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new U,this.disableVert=new U},Dn.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,function n(){var o=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)})},Dn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var jn=function(){};function In(e,t){t||(t=Ln(e));var r=e.display.barWidth,n=e.display.barHeight;Mn(e,t);for(var o=0;o<4&&r!=e.display.barWidth||n!=e.display.barHeight;o++)r!=e.display.barWidth&&e.options.lineWrapping&&bn(e),Mn(e,Ln(e)),r=e.display.barWidth,n=e.display.barHeight}function Mn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}jn.prototype.update=function(){return{bottom:0,right:0}},jn.prototype.setScrollLeft=function(){},jn.prototype.setScrollTop=function(){},jn.prototype.clear=function(){};var Fn={native:Dn,null:jn};function qn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&O(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Fn[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),et(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?Nn(e,t):Pn(e,t)},e),e.display.scrollbars.addClass&&D(e.display.wrapper,e.display.scrollbars.addClass)}var Un=0;function Bn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Un},t=e.curOp,ar?ar.ops.push(t):t.ownsGroup=ar={ops:[t],delayedCallbacks:[]}}function Hn(e){!function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new oo(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function $n(e){var t=e.cm,r=t.display;e.updatedDisplay&&bn(t),e.barMeasure=Ln(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Cr(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+xr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-kr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Wn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!m){var a=P("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Tr(e.display))+"px;\n height: "+(t.bottom-t.top+xr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(o),e.display.lineSpace.removeChild(a)}}}(t,function(e,t,r,n){var o;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?ve(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ve(t.line,t.ch+1,"before"):t);for(var a=0;a<5;a++){var i=!1,s=Kr(e,t),l=r&&r!=t?Kr(e,r):s,u=wn(e,o={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-n,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+n}),c=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=u.scrollTop&&(Pn(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(i=!0)),null!=u.scrollLeft&&(Nn(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(i=!0)),!i)break}return o}(t,Se(n,e.scrollToPos.from),Se(n,e.scrollToPos.to),e.scrollToPos.margin));var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var i=0;it)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)ke&&He(e.doc,t)o.viewFrom?Zn(e):(o.viewFrom+=n,o.viewTo+=n);else if(t<=o.viewFrom&&r>=o.viewTo)Zn(e);else if(t<=o.viewFrom){var a=eo(e,r,r+n,1);a?(o.view=o.view.slice(a.index),o.viewFrom=a.lineN,o.viewTo+=n):Zn(e)}else if(r>=o.viewTo){var i=eo(e,t,t,-1);i?(o.view=o.view.slice(0,i.index),o.viewTo=i.lineN):Zn(e)}else{var s=eo(e,t,t,-1),l=eo(e,r,r+n,1);s&&l?(o.view=o.view.slice(0,s.index).concat(or(e,s.lineN,l.lineN)).concat(o.view.slice(l.index)),o.viewTo+=n):Zn(e)}var u=o.externalMeasured;u&&(r=o.lineN&&t=n.viewTo)){var a=n.view[ln(e,t)];if(null!=a.node){var i=a.changes||(a.changes=[]);-1==B(i,r)&&i.push(r)}}}function Zn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function eo(e,t,r,n){var o,a=ln(e,t),i=e.display.view;if(!ke||r==e.doc.first+e.doc.size)return{index:a,lineN:r};for(var s=e.display.viewFrom,l=0;l0){if(a==i.length-1)return null;o=s+i[a].size-t,a++}else o=s-t;t+=o,r+=o}for(;He(e.doc,r)!=r;){if(a==(n<0?0:i.length-1))return null;r+=n*i[a-(n<0?1:0)].size,a+=n}return{index:a,lineN:r}}function to(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo)){var r=+new Date+e.options.workTime,n=Ft(e,t.highlightFrontier),o=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(n.line>=e.display.viewFrom){var i=a.styles,s=a.text.length>e.options.maxHighlightLength?Pt(t.mode,n.state):null,l=It(e,a,n,!0);s&&(n.state=s),a.styles=l.styles;var u=a.styleClasses,c=l.classes;c?a.styleClasses=c:u&&(a.styleClasses=null);for(var f=!i||i.length!=a.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),p=0;!f&&pr)return ro(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),o.length&&Gn(e,function(){for(var t=0;t=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==to(e))return!1;Sn(e)&&(Zn(e),t.dims=rn(e));var o=n.first+n.size,a=Math.max(t.visible.from-e.options.viewportMargin,n.first),i=Math.min(o,t.visible.to+e.options.viewportMargin);r.viewFromi&&r.viewTo-i<20&&(i=Math.min(o,r.viewTo)),ke&&(a=He(e.doc,a),i=ze(e.doc,i));var s=a!=r.viewFrom||i!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=or(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=or(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,ln(e,r)))),n.viewTo=r}(e,a,i),r.viewOffset=Ke(le(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var l=to(e);if(!s&&0==l&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=L();if(!t||!N(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&N(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return l>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,o=e.options.lineNumbers,a=n.lineDiv,i=a.firstChild;function s(t){var r=t.nextSibling;return u&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var l=n.view,c=n.viewFrom,f=0;f-1&&(d=!1),ur(e,p,c,r)),d&&(A(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(me(e.options,c)))),i=p.node.nextSibling}else{var h=vr(e,p,c,r);a.insertBefore(h,i)}c+=p.size}for(;i;)i=s(i)}(e,r.updateLineNumbers,t.dims),l>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=L()&&(e.activeElt.focus(),e.anchorNode&&N(document.body,e.anchorNode)&&N(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(c),A(r.cursorDiv),A(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ro(e,400)),r.updateLineNumbers=null,!0}function io(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=kr(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Sr(e.display)-Or(e),r.top)}),t.visible=_n(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ao(e,t);n=!1){bn(e);var o=Ln(e);un(e),In(e,o),uo(e,o),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function so(e,t){var r=new oo(e,t);if(ao(e,r)){bn(e),io(e,r);var n=Ln(e);un(e),In(e,n),uo(e,n),r.finish()}}function lo(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function uo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+xr(e)+"px"}function co(e){var t=e.display.gutters,r=e.options.gutters;A(t);for(var n=0;n-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}oo.prototype.signal=function(e,t){it(e,t)&&this.events.push(arguments)},oo.prototype.finish=function(){for(var e=0;es.clientWidth,c=s.scrollHeight>s.clientHeight;if(o&&l||a&&c){if(a&&b&&u)e:for(var f=t.target,d=i.view;f!=s;f=f.parentNode)for(var h=0;h=0&&ye(e,n.to())<=0)return r}return-1};var bo=function(e,t){this.anchor=e,this.head=t};function Eo(e,t){var r=e[t];e.sort(function(e,t){return ye(e.from(),t.from())}),t=B(e,r);for(var n=1;n=0){var i=_e(a.from(),o.from()),s=Ee(a.to(),o.to()),l=a.empty()?o.from()==o.head:a.from()==a.head;n<=t&&--t,e.splice(--n,2,new bo(l?s:i,l?i:s))}}return new go(e,t)}function _o(e,t){return new go([new bo(e,t||e)],0)}function To(e){return e.text?ve(e.from.line+e.text.length-1,Q(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function So(e,t){if(ye(e,t.from)<0)return e;if(ye(e,t.to)<=0)return To(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=To(t).ch-t.to.ch),ve(r,n)}function wo(e,t){for(var r=[],n=0;n1&&e.remove(s.line+1,h-1),e.insert(s.line+1,y)}sr(e,"change",e,t)}function Po(e,t,r){!function e(n,o,a){if(n.linked)for(var i=0;is-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(a=function(e,t){return t?(jo(e.done),Q(e.done)):e.done.length&&!Q(e.done).ranges?Q(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Q(e.done)):void 0}(o,o.lastOp==n)))i=Q(a.changes),0==ye(t.from,t.to)&&0==ye(t.from,i.to)?i.to=To(t):a.changes.push(Do(e,t));else{var l=Q(o.done);for(l&&l.ranges||Fo(e.sel,o.done),a={changes:[Do(e,t)],generation:o.generation},o.done.push(a);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(r),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=n,o.lastOrigin=o.lastSelOrigin=t.origin,i||nt(e,"historyAdded")}function Mo(e,t,r,n){var o=e.history,a=n&&n.origin;r==o.lastSelOp||a&&o.lastSelOrigin==a&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==a||function(e,t,r,n){var o=t.charAt(0);return"*"==o||"+"==o&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,a,Q(o.done),t))?o.done[o.done.length-1]=t:Fo(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=a,o.lastSelOp=r,n&&!1!==n.clearRedo&&jo(o.undone)}function Fo(e,t){var r=Q(t);r&&r.ranges&&r.equals(e)||t.push(e)}function qo(e,t,r,n){var o=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((o||(o=t["spans_"+e.id]={}))[a]=r.markedSpans),++a})}function Uo(e){if(!e)return null;for(var t,r=0;r-1&&(Q(s)[f]=u[f],delete u[f])}}}return n}function zo(e,t,r,n){if(n){var o=e.anchor;if(r){var a=ye(t,o)<0;a!=ye(r,o)<0?(o=t,t=r):a!=ye(t,r)<0&&(t=r)}return new bo(o,t)}return new bo(r||t,t)}function $o(e,t,r,n,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),Yo(e,new go([zo(e.sel.primary(),t,r,o)],0),n)}function Wo(e,t,r){for(var n=[],o=e.cm&&(e.cm.display.shift||e.extend),a=0;a=t.ch:s.to>t.ch))){if(o&&(nt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(a.markedSpans){--i;continue}break}if(!l.atomic)continue;if(r){var u=l.find(n<0?1:-1),c=void 0;if((n<0?l.inclusiveRight:l.inclusiveLeft)&&(u=ra(e,u,-n,u&&u.line==t.line?a:null)),u&&u.line==t.line&&(c=ye(u,r))&&(n<0?c<0:c>0))return ea(e,u,t,n,o)}var f=l.find(n<0?-1:1);return(n<0?l.inclusiveLeft:l.inclusiveRight)&&(f=ra(e,f,n,f.line==t.line?a:null)),f?ea(e,f,t,n,o):null}}return t}function ta(e,t,r,n,o){var a=n||1,i=ea(e,t,r,a,o)||!o&&ea(e,t,r,a,!0)||ea(e,t,r,-a,o)||!o&&ea(e,t,r,-a,!0);return i||(e.cantEdit=!0,ve(e.first,0))}function ra(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?Se(e,ve(t.line-1)):null:r>0&&t.ch==(n||le(e,t.line)).text.length?t.line0)){var c=[l,1],f=ye(u.from,s.from),p=ye(u.to,s.to);(f<0||!i.inclusiveLeft&&!f)&&c.push({from:u.from,to:s.from}),(p>0||!i.inclusiveRight&&!p)&&c.push({from:s.to,to:u.to}),o.splice.apply(o,c),l+=c.length-3}}return o}(e,t.from,t.to);if(n)for(var o=n.length-1;o>=0;--o)ia(e,{from:n[o].from,to:n[o].to,text:o?[""]:t.text,origin:t.origin});else ia(e,t)}}function ia(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ye(t.from,t.to)){var r=wo(e,t);Io(e,t,r,e.cm?e.cm.curOp.id:NaN),ua(e,t,r,Pe(e,t));var n=[];Po(e,function(e,r){r||-1!=B(n,e.history)||(da(e.history,t),n.push(e.history)),ua(e,t,null,Pe(e,t))})}}function sa(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,o=e.history,a=e.sel,i="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,l=0;l=0;--p){var d=f(p);if(d)return d.v}}}}function la(e,t){if(0!=t&&(e.first+=t,e.sel=new go(J(e.sel.ranges,function(e){return new bo(ve(e.anchor.line+t,e.anchor.ch),ve(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Jn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.linea&&(t={from:t.from,to:ve(a,le(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ue(e,t.from,t.to),r||(r=wo(e,t)),e.cm?function(e,t,r){var n=e.doc,o=e.display,a=t.from,i=t.to,s=!1,l=a.line;e.options.lineWrapping||(l=pe(Be(le(n,a.line))),n.iter(l,i.line+1,function(e){if(e==o.maxLine)return s=!0,!0}));n.sel.contains(t.from,t.to)>-1&&at(e);Co(n,t,r,on(e)),e.options.lineWrapping||(n.iter(l,a.line+t.text.length,function(e){var t=Ge(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontierr;n--){var o=le(e,n).stateAfter;if(o&&(!(o instanceof Dt)||n+o.lookAhead1||!(this.children[0]instanceof ma))){var s=[];this.collapse(s),this.children=[new ma(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var i=o.lines.length%25+25,s=i;s10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n0||0==i&&!1!==a.clearWhenEmpty)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=R("span",[a.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Ue(e,t.line,t,r,a)||t.line!=r.line&&Ue(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");ke=!0}a.addToHistory&&Io(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,l=t.line,u=e.cm;if(e.iter(l,r.line+1,function(e){u&&a.collapsed&&!u.options.lineWrapping&&Be(e)==u.display.maxLine&&(s=!0),a.collapsed&&l!=t.line&&fe(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Oe(a,l==t.line?t.ch:null,l==r.line?r.ch:null)),++l}),a.collapsed&&e.iter(t.line,r.line+1,function(t){$e(e,t)&&fe(t,0)}),a.clearOnEnter&&et(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(xe=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++ba,a.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),a.collapsed)Jn(u,t.line,r.line+1);else if(a.className||a.title||a.startStyle||a.endStyle||a.css)for(var c=t.line;c<=r.line;c++)Xn(u,c,"text");a.atomic&&Xo(u.doc),sr(u,"markerAdded",u,a)}return a}Ea.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Bn(e),it(this,"clear")){var r=this.find();r&&sr(this,"clear",r.from,r.to)}for(var n=null,o=null,a=0;ae.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&Jn(e,n,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xo(e.doc)),e&&sr(e,"markerCleared",e,this,n,o),t&&Hn(e),this.parent&&this.parent.clear()}},Ea.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o=0;l--)aa(this,n[l]);s?Vo(this,s):this.cm&&kn(this.cm)}),undo:Qn(function(){sa(this,"undo")}),redo:Qn(function(){sa(this,"redo")}),undoSelection:Qn(function(){sa(this,"undo",!0)}),redoSelection:Qn(function(){sa(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,r){e=Se(this,e),t=Se(this,t);var n=[],o=e.line;return this.iter(e.line,t.line+1,function(a){var i=a.markedSpans;if(i)for(var s=0;s=l.to||null==l.from&&o!=e.line||null!=l.from&&o==t.line&&l.from>=t.ch||r&&!r(l.marker)||n.push(l.marker.parent||l.marker)}++o}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne)return t=e,!0;e-=a,++r}),Se(this,ve(r,t))},indexFromPos:function(e){var t=(e=Se(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Qo(t.doc,_o(r,r)),f)for(var p=0;p=0;t--)ca(e.doc,"",n[t].from,n[t].to,"+delete");kn(e)})}function Ga(e,t,r){var n=ie(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Va(e,t,r){var n=Ga(e,t.ch,r);return null==n?null:new ve(t.line,n,r<0?"after":"before")}function Ya(e,t,r,n,o){if(e){var a=Xe(r,t.doc.direction);if(a){var i,s=o<0?Q(a):a[0],l=o<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=Rr(t,r);i=o<0?r.text.length-1:0;var c=Nr(t,u,i).top;i=se(function(e){return Nr(t,u,e).top==c},o<0==(1==s.level)?s.from:s.to-1,i),"before"==l&&(i=Ga(r,i,1))}else i=o<0?s.to:s.from;return new ve(n,i,l)}}return new ve(n,o<0?r.text.length:0,o<0?"before":"after")}Fa.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"},Fa.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"},Fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Fa.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"]},Fa.default=b?Fa.macDefault:Fa.pcDefault;var Qa={selectAll:na,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$)},killLine:function(e){return Ka(e,function(t){if(t.empty()){var r=le(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)o=new ve(o.line,o.ch+1),e.replaceRange(a.charAt(o.ch-1)+a.charAt(o.ch-2),ve(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var i=le(e.doc,o.line-1).text;i&&(o=new ve(o.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+i.charAt(i.length-1),ve(o.line-1,i.length-1),o,"+transpose"))}r.push(new bo(o,o))}e.setSelections(r)})},newlineAndIndent:function(e){return Gn(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n-1&&(ye((o=i.ranges[o]).from(),t)<0||t.xRel>0)&&(ye(o.to(),t)>0||t.xRel<0)?function(e,t,r,n){var o=e.display,a=!1,i=Vn(e,function(t){u&&(o.scroller.draggable=!1),e.state.draggingText=!1,rt(document,"mouseup",i),rt(document,"mousemove",c),rt(o.scroller,"dragstart",f),rt(o.scroller,"drop",i),a||(lt(t),n.addNew||$o(e.doc,r,null,null,n.extend),u||s&&9==l?setTimeout(function(){document.body.focus(),o.input.focus()},20):o.input.focus())}),c=function(e){a=a||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return a=!0};u&&(o.scroller.draggable=!0);e.state.draggingText=i,i.copy=!n.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop();et(document,"mouseup",i),et(document,"mousemove",c),et(o.scroller,"dragstart",f),et(o.scroller,"drop",i),vn(e),setTimeout(function(){return o.input.focus()},20)}(e,n,t,a):function(e,t,r,n){var o=e.display,a=e.doc;lt(t);var i,s,l=a.sel,u=l.ranges;n.addNew&&!n.extend?(s=a.sel.contains(r),i=s>-1?u[s]:new bo(r,r)):(i=a.sel.primary(),s=a.sel.primIndex);if("rectangle"==n.unit)n.addNew||(i=new bo(r,r)),r=sn(e,t,!0,!0),s=-1;else{var c=fi(e,r,n.unit);i=n.extend?zo(i,c.anchor,c.head,n.extend):c}n.addNew?-1==s?(s=u.length,Yo(a,Eo(u.concat([i]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&"char"==n.unit&&!n.extend?(Yo(a,Eo(u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=a.sel):Ko(a,s,i,W):(s=0,Yo(a,new go([i],0),W),l=a.sel);var f=r;function p(t){if(0!=ye(f,t))if(f=t,"rectangle"==n.unit){for(var o=[],u=e.options.tabSize,c=q(le(a,r.line).text,r.ch,u),p=q(le(a,t.line).text,t.ch,u),d=Math.min(c,p),h=Math.max(c,p),m=Math.min(r.line,t.line),v=Math.min(e.lastLine(),Math.max(r.line,t.line));m<=v;m++){var y=le(a,m).text,g=G(y,d,u);d==h?o.push(new bo(ve(m,g),ve(m,g))):y.length>g&&o.push(new bo(ve(m,g),ve(m,G(y,h,u))))}o.length||o.push(new bo(r,r)),Yo(a,Eo(l.ranges.slice(0,s).concat(o),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,E=i,_=fi(e,t,n.unit),T=E.anchor;ye(_.anchor,T)>0?(b=_.head,T=_e(E.from(),_.anchor)):(b=_.anchor,T=Ee(E.to(),_.head));var S=l.ranges.slice(0);S[s]=function(e,t){var r=t.anchor,n=t.head,o=le(e.doc,r.line);if(0==ye(r,n)&&r.sticky==n.sticky)return t;var a=Xe(o);if(!a)return t;var i=Qe(a,r.ch,r.sticky),s=a[i];if(s.from!=r.ch&&s.to!=r.ch)return t;var l,u=i+(s.from==r.ch==(1!=s.level)?0:1);if(0==u||u==a.length)return t;if(n.line!=r.line)l=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=Qe(a,n.ch,n.sticky),f=c-i||(n.ch-r.ch)*(1==s.level?-1:1);l=c==u-1||c==u?f<0:f>0}var p=a[u+(l?-1:0)],d=l==(1==p.level),h=d?p.from:p.to,m=d?"after":"before";return r.ch==h&&r.sticky==m?t:new bo(new ve(r.line,h,m),n)}(e,new bo(Se(a,T),b)),Yo(a,Eo(S,s),W)}}var d=o.wrapper.getBoundingClientRect(),h=0;function m(t){e.state.selectingText=!1,h=1/0,lt(t),o.input.focus(),rt(document,"mousemove",v),rt(document,"mouseup",y),a.history.lastSelOrigin=null}var v=Vn(e,function(t){dt(t)?function t(r){var i=++h;var s=sn(e,r,!0,"rectangle"==n.unit);if(!s)return;if(0!=ye(s,f)){e.curOp.focus=L(),p(s);var l=_n(o,a);(s.line>=l.to||s.lined.bottom?20:0;u&&setTimeout(Vn(e,function(){h==i&&(o.scroller.scrollTop+=u,t(r))}),50)}}(t):m(t)}),y=Vn(e,m);e.state.selectingText=y,et(document,"mousemove",v),et(document,"mouseup",y)}(e,n,t,a)}(t,n,a,e):pt(e)==r.scroller&<(e):2==o?(n&&$o(t.doc,n),setTimeout(function(){return r.input.focus()},20)):3==o&&(w?hi(t,e):vn(t)))}}function fi(e,t,r){if("char"==r)return new bo(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new bo(ve(t.line,0),Se(e.doc,ve(t.line+1,0)));var n=r(e,t);return new bo(n.from,n.to)}function pi(e,t,r,n){var o,a;if(t.touches)o=t.touches[0].clientX,a=t.touches[0].clientY;else try{o=t.clientX,a=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&<(t);var i=e.display,s=i.lineDiv.getBoundingClientRect();if(a>s.bottom||!it(e,r))return ct(t);a-=s.top-i.viewOffset;for(var l=0;l=o)return nt(e,r,e,de(e.doc,a),e.options.gutters[l],t),ct(t)}}function di(e,t){return pi(e,t,"gutterClick",!0)}function hi(e,t){_r(e.display,t)||function(e,t){if(!it(e,"gutterContextMenu"))return!1;return pi(e,t,"gutterContextMenu",!1)}(e,t)||ot(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function mi(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),qr(e)}ui.prototype.compare=function(e,t,r){return this.time+400>e&&0==ye(t,this.pos)&&r==this.button};var vi={toString:function(){return"CodeMirror.Init"}},yi={},gi={};function bi(e){co(e),Jn(e),Tn(e)}function Ei(e,t,r){if(!t!=!(r&&r!=vi)){var n=e.display.dragFunctions,o=t?et:rt;o(e.display.scroller,"dragstart",n.start),o(e.display.scroller,"dragenter",n.enter),o(e.display.scroller,"dragover",n.over),o(e.display.scroller,"dragleave",n.leave),o(e.display.scroller,"drop",n.drop)}}function _i(e){e.options.lineWrapping?(D(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(O(e.display.wrapper,"CodeMirror-wrap"),Ve(e)),an(e),Jn(e),qr(e),setTimeout(function(){return In(e)},100)}function Ti(e,t){var n=this;if(!(this instanceof Ti))return new Ti(e,t);this.options=t=t?F(t):{},F(yi,t,!1),fo(t);var o=t.value;"string"==typeof o&&(o=new ka(o,t.mode,null,t.lineSeparator,t.direction)),this.doc=o;var a=new Ti.inputStyles[t.inputStyle](this),i=this.display=new function(e,t,n){var o=this;this.input=n,o.scrollbarFiller=P("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=P("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=R("div",null,"CodeMirror-code"),o.selectionDiv=P("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=P("div",null,"CodeMirror-cursors"),o.measure=P("div",null,"CodeMirror-measure"),o.lineMeasure=P("div",null,"CodeMirror-measure"),o.lineSpace=R("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var a=R("div",[o.lineSpace],"CodeMirror-lines");o.mover=P("div",[a],null,"position: relative"),o.sizer=P("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=P("div",null,null,"position: absolute; height: "+H+"px; width: 1px;"),o.gutters=P("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=P("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=P("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),s&&l<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),u||r&&g||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,n.init(o)}(e,o,a);for(var c in i.wrapper.CodeMirror=this,co(this),mi(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),qn(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 U,keySeq:null,specialChars:null},t.autofocus&&!g&&i.input.focus(),s&&l<11&&setTimeout(function(){return n.display.input.reset(!0)},20),function(e){var t=e.display;et(t.scroller,"mousedown",Vn(e,ci)),et(t.scroller,"dblclick",s&&l<11?Vn(e,function(t){if(!ot(e,t)){var r=sn(e,t);if(r&&!di(e,t)&&!_r(e.display,t)){lt(t);var n=e.findWordAt(r);$o(e.doc,n.anchor,n.head)}}}):function(t){return ot(e,t)||lt(t)});w||et(t.scroller,"contextmenu",function(t){return hi(e,t)});var r,n={end:0};function o(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),(n=t.activeTouch).end=+new Date)}function a(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}et(t.scroller,"touchstart",function(o){if(!ot(e,o)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(o)&&!di(e,o)){t.input.ensurePolled(),clearTimeout(r);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-n.end<=300?n:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}}),et(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),et(t.scroller,"touchend",function(r){var n=t.activeTouch;if(n&&!_r(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var i,s=e.coordsChar(t.activeTouch,"page");i=!n.prev||a(n,n.prev)?new bo(s,s):!n.prev.prev||a(n,n.prev.prev)?e.findWordAt(s):new bo(ve(s.line,0),Se(e.doc,ve(s.line+1,0))),e.setSelection(i.anchor,i.head),e.focus(),lt(r)}o()}),et(t.scroller,"touchcancel",o),et(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Pn(e,t.scroller.scrollTop),Nn(e,t.scroller.scrollLeft,!0),nt(e,"scroll",e))}),et(t.scroller,"mousewheel",function(t){return yo(e,t)}),et(t.scroller,"DOMMouseScroll",function(t){return yo(e,t)}),et(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){ot(e,t)||ft(t)},over:function(t){ot(e,t)||(!function(e,t){var r=sn(e,t);if(r){var n=document.createDocumentFragment();fn(e,r,n),e.display.dragCursor||(e.display.dragCursor=P("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),C(e.display.dragCursor,n)}}(e,t),ft(t))},start:function(t){return function(e,t){if(s&&(!e.state.draggingText||+new Date-Oa<100))ft(t);else if(!ot(e,t)&&!_r(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var r=P("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),p&&r.parentNode.removeChild(r)}}(e,t)},drop:Vn(e,Aa),leave:function(t){ot(e,t)||Ca(e)}};var i=t.input.getField();et(i,"keyup",function(t){return ai.call(e,t)}),et(i,"keydown",Vn(e,oi)),et(i,"keypress",Vn(e,ii)),et(i,"focus",function(t){return yn(e,t)}),et(i,"blur",function(t){return gn(e,t)})}(this),Na(),Bn(this),this.curOp.forceUpdate=!0,Ro(this,o),t.autofocus&&!g||this.hasFocus()?setTimeout(M(yn,this),20):gn(this),gi)gi.hasOwnProperty(c)&&gi[c](n,t[c],vi);Sn(this),t.finishInit&&t.finishInit(this);for(var f=0;f150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>a.first?q(le(a,t-1).text,null,i):0:"add"==r?u=l+e.options.indentUnit:"subtract"==r?u=l-e.options.indentUnit:"number"==typeof r&&(u=l+r),u=Math.max(0,u);var f="",p=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/i);d;--d)p+=i,f+="\t";if(p1)if(xi&&xi.text.join("\n")==t){if(n.ranges.length%xi.text.length==0){u=[];for(var c=0;c=0;f--){var p=n.ranges[f],d=p.from(),h=p.to();p.empty()&&(r&&r>0?d=ve(d.line,d.ch-r):e.state.overwrite&&!s?h=ve(h.line,Math.min(le(a,h.line).text.length,h.ch+Q(l).length)):xi&&xi.lineWise&&xi.text.join("\n")==t&&(d=h=ve(d.line,0))),i=e.curOp.updateInput;var m={from:d,to:h,text:u?u[f%u.length]:l,origin:o||(s?"paste":e.state.cutIncoming?"cut":"+input")};aa(e.doc,m),sr(e,"inputRead",e,m)}t&&!s&&Ci(e,t),kn(e),e.curOp.updateInput=i,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Ai(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Gn(t,function(){return Oi(t,r,0,null,"paste")}),!0}function Ci(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var o=r.ranges[n];if(!(o.head.ch>100||n&&r.ranges[n-1].head.line==o.head.line)){var a=e.getModeAt(o.head),i=!1;if(a.electricChars){for(var s=0;s-1){i=wi(e,o.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(le(e.doc,o.head.line).text.slice(0,o.head.ch))&&(i=wi(e,o.head.line,"smart"));i&&sr(e,"electricInput",e,o.head.line)}}}function Pi(e){for(var t=[],r=[],n=0;n=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var a=Qe(o,r.ch,r.sticky),i=o[a];if("ltr"==e.doc.direction&&i.level%2==0&&(n>0?i.to>r.ch:i.from=i.from&&p>=c.begin)){var d=f?"before":"after";return new ve(r.line,p,d)}}var h=function(e,t,n){for(var a=function(e,t){return t?new ve(r.line,l(e,1),"before"):new ve(r.line,e,"after")};e>=0&&e0==(1!=i.level),u=s?n.begin:l(n.end,-1);if(i.from<=u&&u0?c.end:l(c.begin,-1);return null==v||n>0&&v==t.text.length||!(m=h(n>0?0:o.length-1,n,u(v)))?null:m}(e.cm,s,t,r):Va(s,t,r))){if(n||(i=t.line+r)=e.first+e.size||(t=new ve(i,t.ch,t.sticky),!(s=le(e,i))))return!1;t=Ya(o,e.cm,s,t.line,r)}else t=a;return!0}if("char"==n)l();else if("column"==n)l(!0);else if("word"==n||"group"==n)for(var u=null,c="group"==n,f=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(r<0)||l(!p);p=!1){var d=s.text.charAt(t.ch)||"\n",h=re(d,f)?"w":c&&"\n"==d?"n":!c||/\s/.test(d)?null:"p";if(!c||p||h||(h="s"),u&&u!=h){r<0&&(r=1,l(),t.sticky="after");break}if(h&&(u=h),r>0&&!l(!p))break}var m=ta(e,t,a,i,!0);return ge(a,m)&&(m.hitSide=!0),m}function Di(e,t,r,n){var o,a,i=e.doc,s=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*en(e.display),3);o=(r>0?t.bottom:t.top)+r*u}else"line"==n&&(o=r>0?t.bottom+3:t.top-3);for(;(a=Yr(e,s,o)).outside;){if(r<0?o<=0:o>=i.height){a.hitSide=!0;break}o+=5*r}return a}var ji=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new U,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ii(e,t){var r=Pr(e,t.line);if(!r||r.hidden)return null;var n=le(e.doc,t.line),o=Ar(r,n,t.line),a=Xe(n,e.doc.direction),i="left";a&&(i=Qe(a,t.ch)%2?"right":"left");var s=jr(o.map,t.ch,i);return s.offset="right"==s.collapse?s.end:s.start,s}function Mi(e,t){return t&&(e.bad=!0),e}function Fi(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Mi(e.clipPos(ve(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var o=0;o=t.display.viewTo||a.line=t.display.viewFrom&&Ii(t,o)||{node:l[0].measure.map[2],offset:0},c=a.linen.firstLine()&&(i=ve(i.line-1,le(n.doc,i.line-1).length)),s.ch==le(n.doc,s.line).text.length&&s.lineo.viewTo-1)return!1;i.line==o.viewFrom||0==(e=ln(n,i.line))?(t=pe(o.view[0].line),r=o.view[0].node):(t=pe(o.view[e].line),r=o.view[e-1].node.nextSibling);var l,u,c=ln(n,s.line);if(c==o.view.length-1?(l=o.viewTo-1,u=o.lineDiv.lastChild):(l=pe(o.view[c+1].line)-1,u=o.view[c+1].node.previousSibling),!r)return!1;for(var f=n.doc.splitLines(function(e,t,r,n,o){var a="",i=!1,s=e.doc.lineSeparator();function l(){i&&(a+=s,i=!1)}function u(e){e&&(l(),a+=e)}function c(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void u(r||t.textContent.replace(/\u200b/g,""));var a,f=t.getAttribute("cm-marker");if(f){var p=e.findMarks(ve(n,0),ve(o+1,0),(m=+f,function(e){return e.id==m}));return void(p.length&&(a=p[0].find(0))&&u(ue(e.doc,a.from,a.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var d=/^(pre|div|p)$/i.test(t.nodeName);d&&l();for(var h=0;h1&&p.length>1;)if(Q(f)==Q(p))f.pop(),p.pop(),l--;else{if(f[0]!=p[0])break;f.shift(),p.shift(),t++}for(var d=0,h=0,m=f[0],v=p[0],y=Math.min(m.length,v.length);di.ch&&g.charCodeAt(g.length-h-1)==b.charCodeAt(b.length-h-1);)d--,h++;f[f.length-1]=g.slice(0,g.length-h).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var _=ve(t,d),T=ve(l,p.length?Q(p).length-h:0);return f.length>1||f[0]||ye(_,T)?(ca(n.doc,f,_,T,"+input"),!0):void 0},ji.prototype.ensurePolled=function(){this.forceCompositionEnd()},ji.prototype.reset=function(){this.forceCompositionEnd()},ji.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ji.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},ji.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Gn(this.cm,function(){return Jn(e.cm)})},ji.prototype.setUneditable=function(e){e.contentEditable="false"},ji.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||Vn(this.cm,Oi)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},ji.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},ji.prototype.onContextMenu=function(){},ji.prototype.resetPosition=function(){},ji.prototype.needsContentAttribute=!0;var Ui=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new U,this.hasSelection=!1,this.composing=null};Ui.prototype.init=function(e){var t=this,r=this,n=this.cm,o=this.wrapper=Ni(),a=this.textarea=o.firstChild;function i(e){if(!ot(n,e)){if(n.somethingSelected())ki({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Pi(n);ki({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,$):(r.prevInput="",a.value=t.text.join("\n"),I(a))}"cut"==e.type&&(n.state.cutIncoming=!0)}}e.wrapper.insertBefore(o,e.wrapper.firstChild),v&&(a.style.width="0px"),et(a,"input",function(){s&&l>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),et(a,"paste",function(e){ot(n,e)||Ai(e,n)||(n.state.pasteIncoming=!0,r.fastPoll())}),et(a,"cut",i),et(a,"copy",i),et(e.scroller,"paste",function(t){_r(e,t)||ot(n,t)||(n.state.pasteIncoming=!0,r.focus())}),et(e.lineSpace,"selectstart",function(t){_r(e,t)||lt(t)}),et(a,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),et(a,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},Ui.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=cn(e);if(e.options.moveInputWithCursor){var o=Kr(e,r.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),i=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+i.top-a.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+i.left-a.left))}return n},Ui.prototype.showSelection=function(e){var t=this.cm.display;C(t.cursorDiv,e.cursors),C(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ui.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&I(this.textarea),s&&l>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",s&&l>=9&&(this.hasSelection=null))}},Ui.prototype.getField=function(){return this.textarea},Ui.prototype.supportsTouch=function(){return!1},Ui.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!g||L()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ui.prototype.blur=function(){this.textarea.blur()},Ui.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ui.prototype.receivedFocus=function(){this.slowPoll()},Ui.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ui.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))})},Ui.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||_t(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=r.value;if(o==n&&!t.somethingSelected())return!1;if(s&&l>=9&&this.hasSelection===o||b&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=o.charCodeAt(0);if(8203!=a||n||(n="​"),8666==a)return this.reset(),this.cm.execCommand("undo")}for(var i=0,u=Math.min(n.length,o.length);i1e3||o.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ui.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ui.prototype.onKeyPress=function(){s&&l>=9&&(this.hasSelection=null),this.fastPoll()},Ui.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,o=t.textarea,a=sn(r,e),i=n.scroller.scrollTop;if(a&&!p){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(a)&&Vn(r,Yo)(r.doc,_o(a),$);var c=o.style.cssText,f=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var d,h=t.wrapper.getBoundingClientRect();if(o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.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);",u&&(d=window.scrollY),n.input.focus(),u&&window.scrollTo(null,d),n.input.reset(),r.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=!0,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),s&&l>=9&&m(),w){ft(e);et(window,"mouseup",function e(){rt(window,"mouseup",e),setTimeout(v,20)})}else setTimeout(v,50)}function m(){if(null!=o.selectionStart){var e=r.somethingSelected(),a="​"+(e?o.value:"");o.value="⇚",o.value=a,t.prevInput=e?"":"​",o.selectionStart=1,o.selectionEnd=a.length,n.selForContextMenu=r.doc.sel}}function v(){if(t.contextMenuPending=!1,t.wrapper.style.cssText=f,o.style.cssText=c,s&&l<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=i),null!=o.selectionStart){(!s||s&&l<9)&&m();var e=0;n.detectingSelectAll=setTimeout(function a(){n.selForContextMenu==r.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"​"==t.prevInput?Vn(r,na)(r):e++<10?n.detectingSelectAll=setTimeout(a,500):(n.selForContextMenu=null,n.input.reset())},200)}}},Ui.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Ui.prototype.setUneditable=function(){},Ui.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function r(r,n,o,a){e.defaults[r]=n,o&&(t[r]=a?function(e,t,r){r!=vi&&o(e,t,r)}:o)}e.defineOption=r,e.Init=vi,r("value","",function(e,t){return e.setValue(t)},!0),r("mode",null,function(e,t){e.doc.modeOption=t,ko(e)},!0),r("indentUnit",2,ko,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(e){Oo(e),qr(e),Jn(e)},!0),r("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var o=0;;){var a=e.text.indexOf(t,o);if(-1==a)break;o=a+t.length,r.push(ve(n,a))}n++});for(var o=r.length-1;o>=0;o--)ca(e.doc,t,r[o],ve(r[o].line,r[o].ch+t.length))}}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=vi&&e.refresh()}),r("specialCharPlaceholder",Xt,function(e){return e.refresh()},!0),r("electricChars",!0),r("inputStyle",g?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),r("rtlMoveVisually",!_),r("wholeLineUpdateBefore",!0),r("theme","default",function(e){mi(e),bi(e)},!0),r("keyMap","default",function(e,t,r){var n=Wa(t),o=r!=vi&&Wa(r);o&&o.detach&&o.detach(e,n),n.attach&&n.attach(e,o||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,_i,!0),r("gutters",[],function(e){fo(e.options),bi(e)},!0),r("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?nn(e.display)+"px":"0",e.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(e){return In(e)},!0),r("scrollbarStyle","native",function(e){qn(e),In(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),r("lineNumbers",!1,function(e){fo(e.options),bi(e)},!0),r("firstLineNumber",1,bi,!0),r("lineNumberFormatter",function(e){return e},bi,!0),r("showCursorWhenSelecting",!1,un,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("readOnly",!1,function(e,t){"nocursor"==t&&(gn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),r("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),r("dragDrop",!0,Ei),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,un,!0),r("singleCursorHeightPerLine",!0,un,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Oo,!0),r("addModeClass",!1,Oo,!0),r("pollInterval",100),r("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),r("historyEventDelay",1250),r("viewportMargin",10,function(e){return e.refresh()},!0),r("maxHighlightLength",1e4,Oo,!0),r("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),r("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),r("autofocus",null),r("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(Ti),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,o=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&Vn(this,t[e])(this,r,o),nt(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Wa(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;rr&&(wi(this,o.head.line,e,!0),r=o.head.line,n==this.doc.sel.primIndex&&kn(this));else{var a=o.from(),i=o.to(),s=Math.max(r,a.line);r=Math.min(this.lastLine(),i.line-(i.ch?0:1))+1;for(var l=s;l0&&Ko(this.doc,n,new bo(a,u[n].to()),$)}}}),getTokenAt:function(e,t){return zt(this,e,t)},getLineTokens:function(e,t){return zt(this,ve(e),t,!0)},getTokenTypeAt:function(e){e=Se(this.doc,e);var t,r=Mt(this,le(this.doc,e.line)),n=0,o=(r.length-1)/2,a=e.ch;if(0==a)t=r[2];else for(;;){var i=n+o>>1;if((i?r[2*i-1]:0)>=a)o=i;else{if(!(r[2*i+1]a&&(e=a,o=!0),n=le(this.doc,e)}else n=e;return zr(this,n,{top:0,left:0},t||"page",r||o).top+(o?this.doc.height-Ke(n):0)},defaultTextHeight:function(){return en(this.display)},defaultCharWidth:function(){return tn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,o){var a,i,s,l=this.display,u=(e=Kr(this,Se(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==n)u=e.top;else if("above"==n||"near"==n){var f=Math.max(l.wrapper.clientHeight,this.doc.height),p=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>f)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=f&&(u=e.bottom),c+t.offsetWidth>p&&(c=p-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==o?(c=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?c=0:"middle"==o&&(c=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),r&&(a=this,i={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(s=wn(a,i)).scrollTop&&Pn(a,s.scrollTop),null!=s.scrollLeft&&Nn(a,s.scrollLeft))},triggerOnKeyDown:Yn(oi),triggerOnKeyPress:Yn(ii),triggerOnKeyUp:ai,triggerOnMouseDown:Yn(ci),execCommand:function(e){if(Qa.hasOwnProperty(e))return Qa[e].call(null,this)},triggerElectric:Yn(function(e){Ci(this,e)}),findPosH:function(e,t,r,n){var o=1;t<0&&(o=-1,t=-t);for(var a=Se(this.doc,e),i=0;i0&&i(t.charAt(r-1));)--r;for(;n.5)&&an(this),nt(this,"refresh",this)}),swapDoc:Yn(function(e){var t=this.doc;return t.cm=null,Ro(this,e),qr(this),this.display.input.reset(),On(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sr(this,"swapDoc",this,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}},st(e),e.registerHelper=function(t,n,o){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=o},e.registerGlobalHelper=function(t,n,o,a){e.registerHelper(t,n,a),r[t]._global.push({pred:o,val:a})}}(Ti);var Bi,Hi="iter insert remove copy getEditor constructor".split(" ");for(var zi in ka.prototype)ka.prototype.hasOwnProperty(zi)&&B(Hi,zi)<0&&(Ti.prototype[zi]=function(e){return function(){return e.apply(this.doc,arguments)}}(ka.prototype[zi]));return st(ka),Ti.inputStyles={textarea:Ui,contenteditable:ji},Ti.defineMode=function(e){Ti.defaults.mode||"null"==e||(Ti.defaults.mode=e),function(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),wt[e]=t}.apply(this,arguments)},Ti.defineMIME=function(e,t){xt[e]=t},Ti.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ti.defineMIME("text/plain","null"),Ti.defineExtension=function(e,t){Ti.prototype[e]=t},Ti.defineDocExtension=function(e,t){ka.prototype[e]=t},Ti.fromTextArea=function(e,t){if((t=t?F(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=L();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=s.getValue()}var o;if(e.form&&(et(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var a=e.form;o=a.submit;try{var i=a.submit=function(){n(),a.submit=o,a.submit(),a.submit=i}}catch(e){}}t.finishInit=function(t){t.save=n,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,n(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(rt(e.form,"submit",n),"function"==typeof e.form.submit&&(e.form.submit=o))}},e.style.display="none";var s=Ti(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s},(Bi=Ti).off=rt,Bi.on=et,Bi.wheelEventPixels=vo,Bi.Doc=ka,Bi.splitLines=Et,Bi.countColumn=q,Bi.findColumn=G,Bi.isWordChar=te,Bi.Pass=z,Bi.signal=nt,Bi.Line=Kt,Bi.changeEnd=To,Bi.scrollbarModel=Fn,Bi.Pos=ve,Bi.cmpPos=ye,Bi.modes=wt,Bi.mimeModes=xt,Bi.resolveMode=kt,Bi.getMode=Ot,Bi.modeExtensions=At,Bi.extendMode=Ct,Bi.copyState=Pt,Bi.startState=Nt,Bi.innerMode=Rt,Bi.commands=Qa,Bi.keyMap=Fa,Bi.keyName=$a,Bi.isModifierKey=Ha,Bi.lookupKey=Ba,Bi.normalizeKeyMap=Ua,Bi.StringStream=Lt,Bi.SharedTextMarker=Ta,Bi.TextMarker=Ea,Bi.LineWidget=ya,Bi.e_preventDefault=lt,Bi.e_stopPropagation=ut,Bi.e_stop=ft,Bi.addClass=D,Bi.contains=N,Bi.rmClass=O,Bi.keyNames=Da,Ti.version="5.31.0",Ti},"object"===i(t)&&void 0!==e?e.exports=a():void 0===(o="function"==typeof(n=a)?n.call(t,r,t,e):n)||(e.exports=o)},function(e,t,r){"use strict";var n=r(20),o=function(e,t){this.code=[],this.indentation=e,this.lineJoin=t||"\n"};o.prototype.buildLine=function(e,t){var r="",o=2;if("[object String]"===Object.prototype.toString.call(e))o=1,t=e,e=0;else if(null===e)return null;for(;e;)r+=this.indentation,e--;var a=Array.prototype.slice.call(arguments,o,arguments.length);return a.unshift(r+t),n.format.apply(this,a)},o.prototype.unshift=function(){return this.code.unshift(this.buildLine.apply(this,arguments)),this},o.prototype.push=function(){return this.code.push(this.buildLine.apply(this,arguments)),this},o.prototype.blank=function(){return this.code.push(null),this},o.prototype.join=function(){return this.code.join(this.lineJoin)},e.exports=o},function(e,t,r){"use strict";var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,r){"use strict";t.__esModule=!0;var n,o=r(75),a=(n=o)&&n.__esModule?n:{default:n};t.default=a.default||function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};try{return T(e,t,r),!0}catch(e){if(e.message&&(e.message.startsWith("No widget")||e.message.startsWith("Unsupported widget")))return!1;throw e}},t.getDefaultFormState=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!S(e))throw new Error("Invalid schema: "+e);var n=function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o=r;if(S(o)&&S(t.default))o=w(o,t.default);else if("default"in t)o=t.default;else{if("$ref"in t){var a=P(t.$ref,n);return e(a,o,n)}C(t)&&(o=t.items.map(function(t){return e(t,void 0,n)}))}void 0===o&&(o=t.default);switch(t.type){case"object":return(0,f.default)(t.properties||{}).reduce(function(r,a){return r[a]=e(t.properties[a],(o||{})[a],n),r},{});case"array":if(t.minItems){if(A(t,n))return[];var i=o?o.length:0;if(t.minItems>i){var s=o||[],l=Array.isArray(t.items)?t.additionalItems:t.items,u=(0,y.default)(new Array(t.minItems-i),e(l,l.defaults,n));return s.concat(u)}}}return o}(j(e,r,t),e.default,r);if(void 0===t)return n;if(S(t))return w(n,t);return t||n},t.getUiOptions=function(e){return(0,f.default)(e).filter(function(e){return 0===e.indexOf("ui:")}).reduce(function(t,r){var n=e[r];return"ui:widget"===r&&S(n)?(console.warn("Setting options via ui:widget object is deprecated, use ui:options instead"),(0,d.default)({},t,n.options||{},{widget:n.component})):"ui:options"===r&&S(n)?(0,d.default)({},t,n):(0,d.default)({},t,(0,c.default)({},r.substring(3),n))},{})},t.isObject=S,t.mergeObjects=w,t.asNumber=function(e){if(""===e)return;if(null===e)return null;if(/\.$/.test(e))return e;if(/\.0$/.test(e))return e;var t=Number(e),r="number"==typeof t&&!(0,l.default)(t);if(/\.\d*0$/.test(e))return e;return r?t:e},t.orderProperties=function(e,t){if(!Array.isArray(t))return e;var r=function(e){return e.reduce(function(e,t){return e[t]=!0,e},{})},n=function(e){return e.length>1?"properties '"+e.join("', '")+"'":"property '"+e[0]+"'"},o=r(e),a=t.filter(function(e){return"*"!==e&&!o[e]});a.length&&console.warn("uiSchema order list contains extraneous "+n(a));var i=t.filter(function(e){return"*"===e||o[e]}),l=r(i),u=e.filter(function(e){return!l[e]}),c=i.indexOf("*");if(-1===c){if(u.length)throw new Error("uiSchema order list does not contain "+n(u));return i}if(c!==i.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");var f=[].concat((0,s.default)(i));return f.splice.apply(f,[c,1].concat((0,s.default)(u))),f},t.isConstant=x,t.toConstant=k,t.isSelect=O,t.isMultiSelect=A,t.isFilesArray=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("files"===t["ui:widget"])return!0;if(e.items){var n=j(e.items,r);return"string"===n.type&&"data-url"===n.format}return!1},t.isFixedItems=C,t.allowAdditionalItems=function(e){!0===e.additionalItems&&console.warn("additionalItems=true is currently not supported");return S(e.additionalItems)},t.optionsList=function(e){if(e.enum)return e.enum.map(function(t,r){var n=e.enumNames&&e.enumNames[r]||String(t);return{label:n,value:t}});var t=e.oneOf||e.anyOf;return t.map(function(e,t){var r=k(e),n=e.title||String(r);return{label:n,value:r}})},t.stubExistingAdditionalProperties=N,t.resolveSchema=L,t.retrieveSchema=j,t.deepEquals=U,t.shouldRender=function(e,t,r){var n=e.props,o=e.state;return!U(n,t)||!U(o,r)},t.toIdSchema=function e(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"root";var i={$id:r||a};if("$ref"in t||"dependencies"in t){var s=j(t,n,o);return e(s,r,n,o,a)}if("items"in t&&!t.items.$ref)return e(t.items,r,n,o,a);if("object"!==t.type)return i;for(var l in t.properties||{}){var u=t.properties[l],c=i.$id+"_"+l;i[l]=e(u,c,n,(o||{})[l],a)}return i},t.parseDateString=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};var r=new Date(e);if((0,l.default)(r.getTime()))throw new Error("Unable to parse date "+e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:t?r.getUTCHours():0,minute:t?r.getUTCMinutes():0,second:t?r.getUTCSeconds():0}},t.toDateString=function(e){var t=e.year,r=e.month,n=e.day,o=e.hour,a=void 0===o?0:o,i=e.minute,s=void 0===i?0:i,l=e.second,u=void 0===l?0:l,c=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],f=Date.UTC(t,r-1,n,a,s,u),p=new Date(f).toJSON();return c?p:p.slice(0,10)},t.pad=function(e,t){var r=String(e);for(;r.length2&&void 0!==arguments[2]?arguments[2]:{},n=_(e);if("function"==typeof t)return function(e){if(!e.MergedWidget){var t=e.defaultProps&&e.defaultProps.options||{};e.MergedWidget=function(r){var n=r.options,o=void 0===n?{}:n,a=(0,h.default)(r,["options"]);return m.default.createElement(e,(0,d.default)({options:(0,d.default)({},t,o)},a))}}return e.MergedWidget}(t);if("string"!=typeof t)throw new Error("Unsupported widget definition: "+(void 0===t?"undefined":(0,p.default)(t)));if(r.hasOwnProperty(t))return T(e,r[t],r);if(!E.hasOwnProperty(n))throw new Error('No widget for type "'+n+'"');if(E[n].hasOwnProperty(t))return T(e,r[E[n][t]],r);throw new Error('No widget "'+t+'" for type "'+n+'"')}function S(e){return!("undefined"!=typeof File&&e instanceof File)&&("object"===(void 0===e?"undefined":(0,p.default)(e))&&null!==e&&!Array.isArray(e))}function w(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=(0,u.default)({},e);return(0,f.default)(t).reduce(function(n,o){var a=e?e[o]:{},i=t[o];return e&&e.hasOwnProperty(o)&&S(i)?n[o]=w(a,i,r):r&&Array.isArray(a)&&Array.isArray(i)?n[o]=a.concat(i):n[o]=i,n},n)}function x(e){return Array.isArray(e.enum)&&1===e.enum.length||e.hasOwnProperty("const")}function k(e){if(Array.isArray(e.enum)&&1===e.enum.length)return e.enum[0];if(e.hasOwnProperty("const"))return e.const;throw new Error("schema cannot be inferred as a constant")}function O(e){var t=j(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),r=t.oneOf||t.anyOf;return!!Array.isArray(t.enum)||!!Array.isArray(r)&&r.every(function(e){return x(e)})}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!(!e.uniqueItems||!e.items)&&O(e.items,t)}function C(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every(function(e){return S(e)})}function P(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=/^#(?:\/definitions)?\/(.*)$/.exec(e);if(r&&r[1]){var n=r[1].split("/"),o=t,a=!0,s=!1,l=void 0;try{for(var u,c=(0,i.default)(n);!(a=(u=c.next()).done);a=!0){var f=u.value;for(f=f.replace(/~1/g,"/").replace(/~0/g,"~");o.hasOwnProperty("$ref");)o=P(o.$ref,t);if(!o.hasOwnProperty(f))throw new Error("Could not find a definition for "+e+".");o=o[f]}}catch(e){s=!0,l=e}finally{try{!a&&c.return&&c.return()}finally{if(s)throw l}}return o}throw new Error("Could not find a definition for "+e+".")}var R=t.guessType=function(e){return Array.isArray(e)?"array":"string"==typeof e?"string":null==e?"null":"boolean"==typeof e?"boolean":isNaN(e)?"object"===(void 0===e?"undefined":(0,p.default)(e))?"object":"string":"number"};function N(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=(0,d.default)({},e,{properties:(0,d.default)({},e.properties)}),(0,f.default)(t).forEach(function(r){if(!e.properties.hasOwnProperty(r)){var n=e.additionalProperties.hasOwnProperty("type")?(0,d.default)({},e.additionalProperties):{type:R(t[r])};e.properties[r]=n,e.properties[r][b]=!0}}),e}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.hasOwnProperty("$ref")?D(e,t,r):e.hasOwnProperty("dependencies")?j(function(e,t,r){var n=e.dependencies,o=void 0===n?{}:n,a=(0,h.default)(e,["dependencies"]);for(var i in o)if(void 0!==r[i]){var s=o[i];Array.isArray(s)?a=I(a,s):S(s)&&(a=M(a,t,r,i,s))}return a}(e,t,r),t,r):e}function D(e,t,r){var n=P(e.$ref,t),o=(e.$ref,(0,h.default)(e,["$ref"]));return j((0,d.default)({},n,o),t,r)}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=L(e,t,r);return n.hasOwnProperty("additionalProperties")&&!1!==n.additionalProperties?N(n,t,r):n}function I(e,t){if(!t)return e;var r=Array.isArray(e.required)?(0,a.default)(new o.default([].concat((0,s.default)(e.required),(0,s.default)(t)))):t;return(0,d.default)({},e,{required:r})}function M(e,t,r,n,o){var a=j(o,t,r),i=a.oneOf;if(e=F(e,(0,h.default)(a,["oneOf"])),void 0===i)return e;if(!Array.isArray(i))throw new Error("invalid: it is some "+(void 0===i?"undefined":(0,p.default)(i))+" instead of an array");var s=i.map(function(e){return e.hasOwnProperty("$ref")?D(e,t,r):e});return function(e,t,r,n,o){var a=o.filter(function(e){if(!e.properties)return!1;var t=e.properties[n];if(t){var o={type:"object",properties:(0,c.default)({},n,t)},a=(0,v.default)(r,o),i=a.errors;return 0===i.length}});if(1!==a.length)return console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),e;var i=a[0],s=i.properties,l=(s[n],(0,h.default)(s,[n])),u=(0,d.default)({},i,{properties:l});return F(e,j(u,t,r))}(e,t,r,n,s)}function F(e,t){return w(e,t,!0)}function q(e){return"[object Arguments]"===Object.prototype.toString.call(e)}function U(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e===t)return!0;if("function"==typeof e||"function"==typeof t)return!0;if("object"!==(void 0===e?"undefined":(0,p.default)(e))||"object"!==(void 0===t?"undefined":(0,p.default)(t)))return!1;if(null===e||null===t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(q(e)||q(t)){if(!q(e)||!q(t))return!1;var o=Array.prototype.slice;return U(o.call(e),o.call(t),r,n)}if(e.constructor!==t.constructor)return!1;var a=(0,f.default)(e),i=(0,f.default)(t);if(0===a.length&&0===i.length)return!0;if(a.length!==i.length)return!1;for(var s=r.length;s--;)if(r[s]===e)return n[s]===t;r.push(e),n.push(t),a.sort(),i.sort();for(var l=a.length-1;l>=0;l--)if(a[l]!==i[l])return!1;for(var u=void 0,c=a.length-1;c>=0;c--)if(!U(e[u=a[c]],t[u],r,n))return!1;return r.pop(),n.pop(),!0}},function(e,t,r){"use strict";e.exports=function(){for(var e={},t=0;t1)for(var r=1;r=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&t._extend(n,r),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,e,n.depth)}function u(e,t){var r=l.styles[t];return r?"["+l.colors[r][0]+"m"+e+"["+l.colors[r][1]+"m":e}function c(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&w(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return g(o)||(o=f(e,o,n)),o}var a=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(y(t))return e.stylize(""+t,"number");if(m(t))return e.stylize(""+t,"boolean");if(v(t))return e.stylize("null","null")}(e,r);if(a)return a;var i=Object.keys(r),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(r)),S(r)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return p(r);if(0===i.length){if(w(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(E(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(T(r))return e.stylize(Date.prototype.toString.call(r),"date");if(S(r))return p(r)}var u,c="",_=!1,x=["{","}"];(h(r)&&(_=!0,x=["[","]"]),w(r))&&(c=" [Function"+(r.name?": "+r.name:"")+"]");return E(r)&&(c=" "+RegExp.prototype.toString.call(r)),T(r)&&(c=" "+Date.prototype.toUTCString.call(r)),S(r)&&(c=" "+p(r)),0!==i.length||_&&0!=r.length?n<0?E(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=_?function(e,t,r,n,o){for(var a=[],i=0,s=t.length;i=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,c,x)):x[0]+c+x[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,o,a){var i,s,l;if((l=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),A(n,o)||(i="["+o+"]"),s||(e.seen.indexOf(l.value)<0?(s=v(r)?f(e,l.value,null):f(e,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),b(i)){if(a&&o.match(/^\d+$/))return s;(i=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.substr(1,i.length-2),i=e.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=e.stylize(i,"string"))}return i+": "+s}function h(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function v(e){return null===e}function y(e){return"number"==typeof e}function g(e){return"string"==typeof e}function b(e){return void 0===e}function E(e){return _(e)&&"[object RegExp]"===x(e)}function _(e){return"object"===o(e)&&null!==e}function T(e){return _(e)&&"[object Date]"===x(e)}function S(e){return _(e)&&("[object Error]"===x(e)||e instanceof Error)}function w(e){return"function"==typeof e}function x(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(b(i)&&(i=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!s[e])if(new RegExp("\\b"+e+"\\b","i").test(i)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=m,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=y,t.isString=g,t.isSymbol=function(e){return"symbol"===o(e)},t.isUndefined=b,t.isRegExp=E,t.isObject=_,t.isDate=T,t.isError=S,t.isFunction=w,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===o(e)||void 0===e},t.isBuffer=r(709);var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(e=new Date,r=[k(e.getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),O[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(710),t._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(t,r(14),r(15))},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var r=0;r=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}},function(e,t,r){"use strict";(t=e.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},t.right=function(e){return e.replace(/\s*$/,"")}},function(e,t,r){"use strict";function n(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return e?o().use(u).use(d.sanitize(a)).use(t.correctnewlines?function(){}:p).use(h.sanitize(a)).use(s,{allowDangerousHTML:!0}).use(l).use(c).use(f,{createElement:n.createElement,components:{"readme-variable":i,"readme-glossary-item":b,table:m(a),h1:v("h1",a),h2:v("h2",a),h3:v("h3",a),h4:v("h4",a),h5:v("h5",a),h6:v("h6",a),a:y(a),code:g(a),div:function(e){return n.createElement(n.Fragment,e)}}}).processSync(e).contents:null}},function(e,t,r){"use strict";var n=r(279),o=r(659);e.exports=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{dark:!1,tokenizeVariables:!1};return n.createElement("span",{className:r.dark?"cm-s-tomorrow-night":"cm-s-neo"},o(e,t,r))},e.exports.uppercase=r(669)},function(e,t,r){"use strict";var n=r(90),o=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var a=r(70);a.inherits=r(54);var i=r(283),s=r(142);a.inherits(f,i);for(var l=o(s.prototype),u=0;u=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function h(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return B(e).length;default:if(n)return U(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,o);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,o){var a,i=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;i=2,s/=2,l/=2,r/=2}function u(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){var c=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var f=!0,p=0;po&&(n=o):n=o;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i>8,o=r%256,a.push(o),a.push(n);return a}(t,e.length-r),e,r,n)}function w(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o239?4:u>223?3:u>191?2:1;if(o+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(a=e[o+1]))&&(l=(31&u)<<6|63&a)>127&&(c=l);break;case 3:a=e[o+1],i=e[o+2],128==(192&a)&&128==(192&i)&&(l=(15&u)<<12|(63&a)<<6|63&i)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=e[o+1],i=e[o+2],s=e[o+3],128==(192&a)&&128==(192&i)&&128==(192&s)&&(l=(15&u)<<18|(63&a)<<12|(63&i)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=f}return function(e){var t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return O(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return w(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},l.prototype.compare=function(e,t,r,n,o){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,o>>>=0,this===e)return 0;for(var a=o-n,i=r-t,s=Math.min(a,i),u=this.slice(n,o),c=e.slice(t,r),f=0;fo)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return b(this,e,t,r);case"ascii":return E(this,e,t,r);case"latin1":case"binary":return _(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function O(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;on)&&(r=n);for(var o="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,o,a){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function L(e,t,r,n){t<0&&(t=65535+t+1);for(var o=0,a=Math.min(e.length-r,2);o>>8*(n?o:1-o)}function D(e,t,r,n){t<0&&(t=4294967295+t+1);for(var o=0,a=Math.min(e.length-r,4);o>>8*(n?o:3-o)&255}function j(e,t,r,n,o,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(e,t,r,n,a){return a||j(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function M(e,t,r,n,a){return a||j(e,0,r,8),o.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){var r,n=this.length;if(e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(o*=256);)n+=this[e+--t]*o;return n},l.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=this[e],o=1,a=0;++a=(o*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=t,o=1,a=this[e+--n];n>0&&(o*=256);)a+=this[e+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||N(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+o]=e/a&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);N(this,e,t,r,o-1,-o)}var a=0,i=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);N(this,e,t,r,o-1,-o)}var a=r-1,i=1,s=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/i>>0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return I(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return I(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--o)e[o+t]=this[o+r];else if(a<1e3||!l.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(t-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function B(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,r,n){for(var o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}}).call(t,r(14))},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){"use strict";var n=r(92);e.exports=function(e){return Object(n(e))}},function(e,t,r){"use strict";var n=r(93),o=r(92);e.exports=function(e){return n(o(e))}},function(e,t,r){"use strict";function n(e,t,r){var n=r?" !== ":" === ",o=r?" || ":" && ",a=r?"!":"",i=r?"":"!";switch(e){case"null":return t+n+"null";case"array":return a+"Array.isArray("+t+")";case"object":return"("+a+t+o+"typeof "+t+n+'"object"'+o+i+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+n+'"number"'+o+i+"("+t+" % 1)"+o+t+n+t+")";default:return"typeof "+t+n+'"'+e+'"'}}e.exports={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:n,checkDataTypes:function(e,t){switch(e.length){case 1:return n(e[0],t,!0);default:var r="",o=a(e);for(var i in o.array&&o.object&&(r=o.null?"(":"(!"+t+" || ",r+="typeof "+t+' !== "object")',delete o.null,delete o.array,delete o.object),o.number&&delete o.integer,o)r+=(r?" && ":"")+n(i,t,!0);return r}},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var r=[],n=0;n=t)throw new Error("Cannot access property/index "+n+" levels up, current level is "+t);return r[t-n]}if(n>t)throw new Error("Cannot access data "+n+" levels up, current level is "+t);if(a="data"+(t-n||""),!o)return a}for(var s=a,u=o.split("/"),c=0;c=t)throw new Error("Cannot access property/index "+n+" levels up, current level is "+t);return r[t-n]}if(n>t)throw new Error("Cannot access data "+n+" levels up, current level is "+t);if(a="data"+(t-n||""),!o)return a}for(var s=a,u=o.split("/"),c=0;c1&&void 0!==arguments[1]?arguments[1]:{},r=/^#\/(.*)$/.exec(e);if(r&&r[0]){var n=t;return r[1].split("/").forEach(function(t){if(!Object.prototype.hasOwnProperty.call(n,t))throw new Error("Could not find a definition for ".concat(e,"."));n=n[t]}),n}throw new Error("Could not find a definition for ".concat(e,"."))}},function(e,t,r){"use strict";var n=r(164),o=r(97);e.exports=Object.keys||function(e){return n(e,o)}},function(e,t,r){"use strict";var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,r){"use strict";e.exports=!0},function(e,t,r){"use strict";e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,r){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){"use strict";var n=r(366)(!0);r(102)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})})},function(e,t,r){"use strict";e.exports={}},function(e,t,r){"use strict";var n=r(18).f,o=r(38),a=r(11)("toStringTag");e.exports=function(e,t,r){e&&!o(e=r?e:e.prototype,a)&&n(e,a,{configurable:!0,value:t})}},function(e,t,r){"use strict";var n=r(24),o=r(176),a=r(177),i=r(22),s=r(73),l=r(110),u={},c={},f=e.exports=function(e,t,r,f,p){var d,h,m,v,y=p?function(){return e}:l(e),g=n(r,f,t?2:1),b=0;if("function"!=typeof y)throw TypeError(e+" is not iterable!");if(a(y)){for(d=s(e.length);d>b;b++)if((v=t?g(i(h=e[b])[0],h[1]):g(e[b]))===u||v===c)return v}else for(m=y.call(e);!(h=m.next()).done;)if((v=o(m,g,h.value,t))===u||v===c)return v};f.BREAK=u,f.RETURN=c},function(e,t,r){"use strict";t.__esModule=!0;var n,o=r(168),a=(n=o)&&n.__esModule?n:{default:n};t.default=function(e,t,r){return t in e?(0,a.default)(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){e.exports={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},function(e,t,r){"use strict";e.exports=r(649)()},function(e,t,r){"use strict";e.exports=o;var n=r(140).EventEmitter;function o(){n.call(this)}r(54)(o,n),o.Readable=r(141),o.Writable=r(695),o.Duplex=r(696),o.Transform=r(697),o.PassThrough=r(698),o.Stream=o,o.prototype.pipe=function(e,t){var r=this;function o(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",o),e.on("drain",a),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",l));var i=!1;function s(){i||(i=!0,e.end())}function l(){i||(i=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",o),e.removeListener("drain",a),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},function(e,t,r){"use strict";(function(e){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"===r(e)},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"===r(e)&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===r(e)||void 0===e},t.isBuffer=e.isBuffer}).call(t,r(43).Buffer)},function(e,t,r){"use strict";e.exports=r(313)},function(e,t,r){"use strict";t.decode=t.parse=r(325),t.encode=t.stringify=r(326)},function(e,t,r){"use strict";var n=r(94),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},function(e,t,r){"use strict";var n=0,o=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+o).toString(36))}},function(e,t,r){"use strict";e.exports={default:r(357),__esModule:!0}},function(e,t,r){"use strict";t.f={}.propertyIsEnumerable},function(e,t,r){"use strict";var n=r(22),o=r(368),a=r(97),i=r(95)("IE_PROTO"),s=function(){},l=function(){var e,t=r(98)("iframe"),n=a.length;for(t.style.display="none",r(170).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("