From d5543ae99f906d25469187436eb40fe18a23806b Mon Sep 17 00:00:00 2001 From: Jon Ursenbach Date: Mon, 5 Aug 2019 13:26:26 -0700 Subject: [PATCH] Updating dist files. --- packages/api-explorer/dist/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/api-explorer/dist/index.js b/packages/api-explorer/dist/index.js index 416479671..3c1f9d314 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=258)}([function(e,t,r){"use strict";e.exports=r(261)},function(e,t,r){"use strict";e.exports=r(266)()},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?L=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(L=function(e){try{e.select()}catch(e){}});var B=function(){this.id=null};function q(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}}var le=null;function ue(e,t,r){var n;le=null;for(var o=0;ot)return o;a.to==t&&(a.from!=a.to&&"before"==r?n=o:le=o),a.from==t&&(a.from!=a.to&&"before"!=r?n=o:le=o)}return null!=n?n:le}var ce=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 ve(e,t){var r=he(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),o=0;o0}function Ee(e){e.prototype.on=function(e,t){de(this,e,t)},e.prototype.off=function(e,t){me(this,e,t)}}function _e(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Te(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Se(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function we(e){_e(e),Te(e)}function xe(e){return e.target||e.srcElement}function ke(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Oe,Ae,Ce=function(){if(s&&l<9)return!1;var e=P("div");return"draggable"in e||"dragDrop"in e}();function Pe(e){if(null==Oe){var t=P("span","​");C(e,P("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Oe=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&l<8))}var r=Oe?P("span","​"):P("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Ne(e){if(null!=Ae)return Ae;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)&&(Ae=n.right-r.right<3)}var Re,De=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/)},Ie=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)},je="oncopy"in(Re=P("div"))||(Re.setAttribute("oncopy","return;"),"function"==typeof Re.oncopy),Le=null;var Me={},Fe={};function Ue(e){if("string"==typeof e&&Fe.hasOwnProperty(e))e=Fe[e];else if(e&&"string"==typeof e.name&&Fe.hasOwnProperty(e.name)){var t=Fe[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 Ue("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ue("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Be(e,t){t=Ue(t);var r=Me[t.name];if(!r)return Be(e,"text/plain");var n=r(e,t);if(qe.hasOwnProperty(t.name)){var o=qe[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 qe={};function He(e,t){F(t,qe.hasOwnProperty(e)?qe[e]:qe[e]={})}function ze(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 $e(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 Ke(e,t,r){return!e.startState||e.startState(t,r)}var We=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};function Ge(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?tt(r,Ge(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?tt(e.line,t):r<0?tt(e.line,0):e}(t,Ge(e,t.line).text.length)}function ut(e,t){for(var r=[],n=0;n=this.string.length},We.prototype.sol=function(){return this.pos==this.lineStart},We.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},We.prototype.next=function(){if(this.post},We.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},We.prototype.skipToEnd=function(){this.pos=this.string.length},We.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},We.prototype.backUp=function(e){this.pos-=e},We.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},We.prototype.current=function(){return this.string.slice(this.start,this.pos)},We.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},We.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},We.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ct=function(e,t){this.state=e,this.lookAhead=t},ft=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 pt(e,t,r,n){var o=[e.state.modeGen],a={};_t(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,_t(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&&ze(e.doc.mode,n.state),a=pt(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 ht(e,t,r){var n=e.doc,o=e.display;if(!n.mode.startState)return new ft(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=Ge(a,s-1),u=l.stateAfter;if(u&&(!r||s+(u instanceof ct?u.lookAhead:0)<=a.modeFrontier))return s;var c=U(l.text,null,e.options.tabSize);(null==o||n>c)&&(o=s-1,n=c)}return o}(e,t,r),i=a>n.first&&Ge(n,a-1).stateAfter,s=i?ft.fromSaved(n,i,a):new ft(n,Ke(n.mode),a);return n.iter(a,t,function(r){mt(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.")}ft.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ft.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}},ft.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ft.fromSaved=function(e,t,r){return t instanceof ct?new ft(e,ze(e.mode,t.state),r,t.lookAhead):new ft(e,ze(e.mode,t),r)},ft.prototype.save=function(e){var t=!1!==e?ze(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t};var gt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function bt(e,t,r,n){var o,a,i=e.doc,s=i.mode,l=Ge(i,(t=lt(i,t)).line),u=ht(e,t.line,r),c=new We(l.text,e.options.tabSize,u);for(n&&(a=[]);(n||c.pose.options.maxHighlightLength?(s=!1,i&&mt(e,t,n,f.pos),f.pos=t.length,l=null):l=Et(yt(r,f,n.state,p),a),p){var d=p[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!s||c!=l){for(;u=t:a.to>t);(n||(n=[])).push(new wt(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;bt)&&(!r||Dt(r,a.marker)<0)&&(r=a.marker)}return r}function Ft(e,t,r,n,o){var a=Ge(e,t),i=St&&a.markedSpans;if(i)for(var s=0;s=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?rt(u.to,r)>=0:rt(u.to,r)>0)||c>=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?rt(u.from,n)<=0:rt(u.from,n)<0)))return!0}}}function Ut(e){for(var t;t=jt(e);)e=t.find(-1,!0).line;return e}function Bt(e,t){var r=Ge(e,t),n=Ut(r);return r==n?t:Je(n)}function qt(e,t){if(t>e.lastLine())return t;var r,n=Ge(e,t);if(!Ht(e,n))return t;for(;r=Lt(n);)n=r.find(1,!0).line;return Je(n)+1}function Ht(e,t){var r=St&&t.markedSpans;if(r)for(var n=void 0,o=0;ot.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}var Gt=function(e,t,r){this.text=e,Pt(this,t),this.height=r?r(this):1};function Vt(e){e.parent=null,Ct(e)}Gt.prototype.lineNo=function(){return Je(this)},Ee(Gt);var Yt={},Qt={};function Jt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Qt:Yt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Xt(e,t){var r=N("span",null,null,u?"padding-right: .1px":null),n={pre:N("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var a=o?t.rest[o-1]:t.line,i=void 0;n.pos=0,n.addToken=er,Ne(e.display.measure)&&(i=fe(a,e.doc.direction))&&(n.addToken=tr(n.addToken,i)),n.map=[],nr(a,n,dt(e,a,t!=e.display.externalMeasured&&Je(a))),a.styleClasses&&(a.styleClasses.bgClass&&(n.bgClass=j(a.styleClasses.bgClass,n.bgClass||"")),a.styleClasses.textClass&&(n.textClass=j(a.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Pe(e.display.measure))),0==o?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(u){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return ve(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=j(n.pre.className,n.textClass||"")),n}function Zt(e){var t=P("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function er(e,t,r,n,o,a,i){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.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 rr(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 nr(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=s="",p=null,f=null,y=1/0;for(var g=[],b=void 0,E=0;Eh||T.collapsed&&_.to==h&&_.from==h)){if(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&&((p||(p={})).title=T.title),T.attributes)for(var S in T.attributes)(p||(p={}))[S]=T.attributes[S];T.collapsed&&(!f||Dt(f.marker,T)<0)&&(f=_)}else _.from>h&&y>_.from&&(y=_.from)}if(b)for(var w=0;w=d)break;for(var k=Math.min(d,y);;){if(v){var O=h+v.length;if(!f){var A=O>k?v.slice(0,k-h):v;t.addToken(t,A,i?i+l:l,c,h+A.length==y?u:"",s,p)}if(O>=k){v=v.slice(k-h),h=k;break}h=O,c=""}v=o.slice(a,a=r[m++]),i=Jt(r[m++],t.cm.options)}}else for(var C=1;Cr)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function Pr(e,t,r,n){return Dr(e,Rr(e,t),r,n)}function Nr(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=Lr(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+rn(e.display),top:h.top,bottom:h.bottom}:jr}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 Fr(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=ue(s,l,u),p=le,d=c(l,f,"before"==u);return null!=p&&(d.other=c(l,p,"before"!=u)),d}function Vr(e,t){var r=0;t=lt(e.doc,t),e.options.lineWrapping||(r=rn(e.display)*t.ch);var n=Ge(e.doc,t.line),o=$t(n)+Sr(e.display);return{left:r,right:r,top:o,bottom:o+n.height}}function Yr(e,t,r,n,o){var a=tt(e,t,r);return a.xRel=o,n&&(a.outside=!0),a}function Qr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Yr(n.first,0,null,!0,-1);var o=Xe(n,r),a=n.first+n.size-1;if(o>a)return Yr(n.first+n.size-1,Ge(n,a).text.length,null,!0,1);t<0&&(t=0);for(var i=Ge(n,o);;){var s=en(e,i,o,t,r),l=Mt(i,s.ch+(s.xRel>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==o)return u;i=Ge(n,o=u.line)}}function Jr(e,t,r,n){n-=zr(t);var o=t.text.length,a=se(function(t){return Dr(e,r,t-1).bottom<=n},o,0);return{begin:a,end:o=se(function(t){return Dr(e,r,t).top>n},a,o)}}function Xr(e,t,r,n){return r||(r=Rr(e,t)),Jr(e,t,r,$r(e,t,Dr(e,r,n),"line").top)}function Zr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function en(e,t,r,n,o){o-=$t(t);var a=Rr(e,t),i=zr(t),s=0,l=t.text.length,u=!0,c=fe(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?function(e,t,r,n,o,a,i){var s=Jr(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=Dr(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 Zr(Gr(e,tt(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=Gr(e,tt(r,u?l.from:l.to,u?"after":"before"),"line",t,n);Zr(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=Dr(e,a,t);return r.top+=i,r.bottom+=i,!!Zr(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 Yr(r,v=ie(t.text,v,1),d,y,n-p)}function tn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ir){Ir=P("pre");for(var t=0;t<49;++t)Ir.appendChild(document.createTextNode("x")),Ir.appendChild(P("br"));Ir.appendChild(document.createTextNode("x"))}C(e.measure,Ir);var r=Ir.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),A(e.measure),r||1}function rn(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 nn(e){for(var t=e.display,r={},n={},o=t.gutters.clientLeft,a=t.gutters.firstChild,i=0;a;a=a.nextSibling,++i){var s=e.display.gutterSpecs[i].className;r[s]=a.offsetLeft+a.clientLeft+o,n[s]=a.clientWidth}return{fixedPos:on(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function on(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function an(e){var t=tn(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/rn(e.display)-3);return function(o){if(Ht(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;nt)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)St&&Bt(e.doc,t)o.viewFrom?pn(e):(o.viewFrom+=n,o.viewTo+=n);else if(t<=o.viewFrom&&r>=o.viewTo)pn(e);else if(t<=o.viewFrom){var a=dn(e,r,r+n,1);a?(o.view=o.view.slice(a.index),o.viewFrom=a.lineN,o.viewTo+=n):pn(e)}else if(r>=o.viewTo){var i=dn(e,t,t,-1);i?(o.view=o.view.slice(0,i.index),o.viewTo=i.lineN):pn(e)}else{var s=dn(e,t,t,-1),l=dn(e,r,r+n,1);s&&l?(o.view=o.view.slice(0,s.index).concat(ar(e,s.lineN,l.lineN)).concat(o.view.slice(l.index)),o.viewTo+=n):pn(e)}var u=o.externalMeasured;u&&(r=o.lineN&&t=n.viewTo)){var a=n.view[un(e,t)];if(null!=a.node){var i=a.changes||(a.changes=[]);-1==q(i,r)&&i.push(r)}}}function pn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function dn(e,t,r,n){var o,a=un(e,t),i=e.display.view;if(!St||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(;Bt(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 hn(e){for(var t=e.display.view,r=0,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 _n(e){e.state.focused||(e.display.input.focus(),Sn(e))}function Tn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,wn(e))},100)}function Sn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ve(e,"focus",e,t),e.state.focused=!0,I(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()),En(e))}function wn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ve(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 xn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n.005||p<-.005)&&(Qe(o.line,i),kn(o.line),o.rest))for(var d=0;de.display.sizerWidth){var h=Math.ceil(u/rn(e.display));h>e.display.maxLineLength&&(e.display.maxLineLength=h,e.display.maxLine=o.line,e.display.maxLineChanged=!0)}}}}function kn(e){if(e.widgets)for(var t=0;t=i&&(a=Xe(t,$t(Ge(t,l))-e.wrapper.clientHeight),i=l)}return{from:a,to:Math.max(i,a+1)}}function An(e,t){var r=e.display,n=tn(e.display);t.top<0&&(t.top=0);var o=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,a=Ar(e),i={};t.bottom-t.top>a&&(t.bottom=t.top+a);var s=e.doc.height+wr(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=Or(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 Cn(e,t){null!=t&&(Rn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Pn(e){Rn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Nn(e,t,r){null==t&&null==r||Rn(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Rn(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Dn(e,Vr(e,t.from),Vr(e,t.to),t.margin))}function Dn(e,t,r,n){var o=An(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});Nn(e,o.scrollLeft,o.scrollTop)}function In(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||io(e,{top:t}),jn(e,t,!0),r&&io(e),to(e,100))}function jn(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 Ln(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,uo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Mn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+wr(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+kr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Fn=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");n.tabIndex=o.tabIndex=-1,e(n),e(o),de(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),de(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Fn.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}},Fn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Fn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Fn.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 B,this.disableVert=new B},Fn.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)})},Fn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Un=function(){};function Bn(e,t){t||(t=Mn(e));var r=e.display.barWidth,n=e.display.barHeight;qn(e,t);for(var o=0;o<4&&r!=e.display.barWidth||n!=e.display.barHeight;o++)r!=e.display.barWidth&&e.options.lineWrapping&&xn(e),qn(e,Mn(e)),r=e.display.barWidth,n=e.display.barHeight}function qn(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=""}Un.prototype.update=function(){return{bottom:0,right:0}},Un.prototype.setScrollLeft=function(){},Un.prototype.setScrollTop=function(){},Un.prototype.clear=function(){};var Hn={native:Fn,null:Un};function zn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&O(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Hn[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),de(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?Ln(e,t):In(e,t)},e),e.display.scrollbars.addClass&&I(e.display.wrapper,e.display.scrollbars.addClass)}var $n=0;function Kn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++$n},t=e.curOp,ir?ir.ops.push(t):t.ownsGroup=ir={ops:[t],delayedCallbacks:[]}}function Wn(e){var t=e.curOp;t&&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 no(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Vn(e){var t=e.cm,r=t.display;e.updatedDisplay&&xn(t),e.barMeasure=Mn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Pr(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+kr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Or(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Yn(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-Sr(e.display))+"px;\n height: "+(t.bottom-t.top+kr(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?tt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?tt(t.line,t.ch+1,"before"):t);for(var a=0;a<5;a++){var i=!1,s=Gr(e,t),l=r&&r!=t?Gr(e,r):s,u=An(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&&(In(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(i=!0)),null!=u.scrollLeft&&(Ln(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(i=!0)),!i)break}return o}(t,lt(n,e.scrollToPos.from),lt(n,e.scrollToPos.to),e.scrollToPos.margin));var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var i=0;i=e.display.viewTo)){var r=+new Date+e.options.workTime,n=ht(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?ze(t.mode,n.state):null,l=pt(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 to(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),o.length&&Jn(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==hn(e))return!1;co(e)&&(pn(e),t.dims=nn(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)),St&&(a=Bt(e.doc,a),i=qt(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=ar(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=ar(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,un(e,r)))),n.viewTo=r}(e,a,i),r.viewOffset=$t(Ge(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var l=hn(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=D();if(!t||!R(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&R(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),cr(e,p,c,r)),d&&(A(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(et(e.options,c)))),i=p.node.nextSibling}else{var h=yr(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!=D()&&(e.activeElt.focus(),e.anchorNode&&R(document.body,e.anchorNode)&&R(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,to(e,400)),r.updateLineNumbers=null,!0}function ao(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Or(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+wr(e.display)-Ar(e),r.top)}),t.visible=On(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&oo(e,t);n=!1){xn(e);var o=Mn(e);mn(e),Bn(e,o),lo(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 io(e,t){var r=new no(e,t);if(oo(e,r)){xn(e),ao(e,r);var n=Mn(e);mn(e),Bn(e,n),lo(e,n),r.finish()}}function so(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function lo(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+kr(e)+"px"}function uo(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=on(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,a=n+"px",i=0;is.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&&rt(e,n.to())<=0)return r}return-1};var _o=function(e,t){this.anchor=e,this.head=t};function To(e,t,r){var n=e&&e.options.selectionsMayTouch,o=t[r];t.sort(function(e,t){return rt(e.from(),t.from())}),r=q(t,o);for(var a=1;a0:l>=0){var u=it(s.from(),i.from()),c=at(s.to(),i.to()),f=s.empty()?i.from()==i.head:s.from()==s.head;a<=r&&--r,t.splice(--a,2,new _o(f?c:u,f?u:c))}}return new Eo(t,r)}function So(e,t){return new Eo([new _o(e,t||e)],0)}function wo(e){return e.text?tt(e.from.line+e.text.length-1,Q(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function xo(e,t){if(rt(e,t.from)<0)return e;if(rt(e,t.to)<=0)return wo(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+=wo(t).ch-t.to.ch),tt(r,n)}function ko(e,t){for(var r=[],n=0;n1&&e.remove(s.line+1,h-1),e.insert(s.line+1,y)}lr(e,"change",e,t)}function Ro(e,t,r){!function e(n,o,a){if(n.linked)for(var i=0;is-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(a=function(e,t){return t?(Mo(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==rt(t.from,t.to)&&0==rt(t.from,i.to)?i.to=wo(t):a.changes.push(Lo(e,t));else{var l=Q(o.done);for(l&&l.ranges||Bo(e.sel,o.done),a={changes:[Lo(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||ve(e,"historyAdded")}function Uo(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:Bo(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=a,o.lastSelOp=r,n&&!1!==n.clearRedo&&Mo(o.undone)}function Bo(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 Ho(e){if(!e)return null;for(var t,r=0;r-1&&(Q(s)[f]=u[f],delete u[f])}}}return n}function Ko(e,t,r,n){if(n){var o=e.anchor;if(r){var a=rt(t,o)<0;a!=rt(r,o)<0?(o=t,t=r):a!=rt(t,r)<0&&(t=r)}return new _o(o,t)}return new _o(r||t,t)}function Wo(e,t,r,n,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),Jo(e,new Eo([Ko(e.sel.primary(),t,r,o)],0),n)}function Go(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&&(ve(l,"beforeCursorEnter"),l.explicitlyCleared)){if(a.markedSpans){--i;continue}break}if(!l.atomic)continue;if(r){var f=l.find(n<0?1:-1),p=void 0;if((n<0?c:u)&&(f=oa(e,f,-n,f&&f.line==t.line?a:null)),f&&f.line==t.line&&(p=rt(f,r))&&(n<0?p<0:p>0))return ra(e,f,t,n,o)}var d=l.find(n<0?-1:1);return(n<0?u:c)&&(d=oa(e,d,n,d.line==t.line?a:null)),d?ra(e,d,t,n,o):null}}return t}function na(e,t,r,n,o){var a=n||1,i=ra(e,t,r,a,o)||!o&&ra(e,t,r,a,!0)||ra(e,t,r,-a,o)||!o&&ra(e,t,r,-a,!0);return i||(e.cantEdit=!0,tt(e.first,0))}function oa(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?lt(e,tt(t.line-1)):null:r>0&&t.ch==(n||Ge(e,t.line)).text.length?t.line0)){var c=[l,1],f=rt(u.from,s.from),p=rt(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)la(e,{from:n[o].from,to:n[o].to,text:o?[""]:t.text,origin:t.origin});else la(e,t)}}function la(e,t){if(1!=t.text.length||""!=t.text[0]||0!=rt(t.from,t.to)){var r=ko(e,t);Fo(e,t,r,e.cm?e.cm.curOp.id:NaN),fa(e,t,r,Ot(e,t));var n=[];Ro(e,function(e,r){r||-1!=q(n,e.history)||(ma(e.history,t),n.push(e.history)),fa(e,t,null,Ot(e,t))})}}function ua(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var o,a=e.history,i=e.sel,s="undo"==t?a.done:a.undone,l="undo"==t?a.undone:a.done,u=0;u=0;--d){var h=p(d);if(h)return h.v}}}}function ca(e,t){if(0!=t&&(e.first+=t,e.sel=new Eo(J(e.sel.ranges,function(e){return new _o(tt(e.anchor.line+t,e.anchor.ch),tt(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){cn(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:tt(a,Ge(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ve(e,t.from,t.to),r||(r=ko(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=Je(Ut(Ge(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&&ge(e);No(n,t,r,an(e)),e.options.lineWrapping||(n.iter(l,a.line+t.text.length,function(e){var t=Kt(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=Ge(e,n).stateAfter;if(o&&(!(o instanceof ct)||n+o.lookAhead1||!(this.children[0]instanceof ya))){var s=[];this.collapse(s),this.children=[new ya(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=N("span",[a.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Ft(e,t.line,t,r,a)||t.line!=r.line&&Ft(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");St=!0}a.addToHistory&&Fo(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&&Ut(e)==u.display.maxLine&&(s=!0),a.collapsed&&l!=t.line&&Qe(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new wt(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){Ht(e,t)&&Qe(t,0)}),a.clearOnEnter&&de(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(Tt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++_a,a.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),a.collapsed)cn(u,t.line,r.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var c=t.line;c<=r.line;c++)fn(u,c,"text");a.atomic&&ea(u.doc),lr(u,"markerAdded",u,a)}return a}Ta.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Kn(e),be(this,"clear")){var r=this.find();r&&lr(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&&cn(e,n,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ea(e.doc)),e&&lr(e,"markerCleared",e,this,n,o),t&&Wn(e),this.parent&&this.parent.clear()}},Ta.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o=0;l--)sa(this,n[l]);s?Qo(this,s):this.cm&&Pn(this.cm)}),undo:eo(function(){ua(this,"undo")}),redo:eo(function(){ua(this,"redo")}),undoSelection:eo(function(){ua(this,"undo",!0)}),redoSelection:eo(function(){ua(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=lt(this,e),t=lt(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}),lt(this,tt(r,t))},indexFromPos:function(e){var t=(e=lt(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()),Xo(t.doc,So(r,r)),f)for(var p=0;p=0;t--)pa(e.doc,"",n[t].from,n[t].to,"+delete");Pn(e)})}function Ya(e,t,r){var n=ie(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Qa(e,t,r){var n=Ya(e,t.ch,r);return null==n?null:new tt(t.line,n,r<0?"after":"before")}function Ja(e,t,r,n,o){if(e){var a=fe(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=Dr(t,u,i).top;i=se(function(e){return Dr(t,u,e).top==c},o<0==(1==s.level)?s.from:s.to-1,i),"before"==l&&(i=Ya(r,i,1))}else i=o<0?s.to:s.from;return new tt(n,i,l)}}return new tt(n,o<0?r.text.length:0,o<0?"before":"after")}Ba.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"},Ba.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"},Ba.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"},Ba.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"]},Ba.default=b?Ba.macDefault:Ba.pcDefault;var Xa={selectAll:aa,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$)},killLine:function(e){return Va(e,function(t){if(t.empty()){var r=Ge(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)o=new tt(o.line,o.ch+1),e.replaceRange(a.charAt(o.ch-1)+a.charAt(o.ch-2),tt(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var i=Ge(e.doc,o.line-1).text;i&&(o=new tt(o.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+i.charAt(i.length-1),tt(o.line-1,i.length-1),o,"+transpose"))}r.push(new _o(o,o))}e.setSelections(r)})},newlineAndIndent:function(e){return Jn(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&&(rt((o=i.ranges[o]).from(),t)<0||t.xRel>0)&&(rt(o.to(),t)>0||t.xRel<0)?function(e,t,r,n){var o=e.display,a=!1,i=Xn(e,function(t){u&&(o.scroller.draggable=!1),e.state.draggingText=!1,me(o.wrapper.ownerDocument,"mouseup",i),me(o.wrapper.ownerDocument,"mousemove",c),me(o.scroller,"dragstart",f),me(o.scroller,"drop",i),a||(_e(t),n.addNew||Wo(e.doc,r,null,null,n.extend),u||s&&9==l?setTimeout(function(){o.wrapper.ownerDocument.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();de(o.wrapper.ownerDocument,"mouseup",i),de(o.wrapper.ownerDocument,"mousemove",c),de(o.scroller,"dragstart",f),de(o.scroller,"drop",i),Tn(e),setTimeout(function(){return o.input.focus()},20)}(e,n,t,a):function(e,t,r,n){var o=e.display,a=e.doc;_e(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 _o(r,r)):(i=a.sel.primary(),s=a.sel.primIndex);if("rectangle"==n.unit)n.addNew||(i=new _o(r,r)),r=ln(e,t,!0,!0),s=-1;else{var c=hi(e,r,n.unit);i=n.extend?Ko(i,c.anchor,c.head,n.extend):c}n.addNew?-1==s?(s=u.length,Jo(a,To(e,u.concat([i]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&"char"==n.unit&&!n.extend?(Jo(a,To(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=a.sel):Vo(a,s,i,K):(s=0,Jo(a,new Eo([i],0),K),l=a.sel);var f=r;function p(t){if(0!=rt(f,t))if(f=t,"rectangle"==n.unit){for(var o=[],u=e.options.tabSize,c=U(Ge(a,r.line).text,r.ch,u),p=U(Ge(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=Ge(a,m).text,g=G(y,d,u);d==h?o.push(new _o(tt(m,g),tt(m,g))):y.length>g&&o.push(new _o(tt(m,g),tt(m,G(y,h,u))))}o.length||o.push(new _o(r,r)),Jo(a,To(e,l.ranges.slice(0,s).concat(o),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,E=i,_=hi(e,t,n.unit),T=E.anchor;rt(_.anchor,T)>0?(b=_.head,T=it(E.from(),_.anchor)):(b=_.anchor,T=at(E.to(),_.head));var S=l.ranges.slice(0);S[s]=function(e,t){var r=t.anchor,n=t.head,o=Ge(e.doc,r.line);if(0==rt(r,n)&&r.sticky==n.sticky)return t;var a=fe(o);if(!a)return t;var i=ue(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=ue(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 _o(new tt(r.line,h,m),n)}(e,new _o(lt(a,T),b)),Jo(a,To(e,S,s),K)}}var d=o.wrapper.getBoundingClientRect(),h=0;function m(t){e.state.selectingText=!1,h=1/0,t&&(_e(t),o.input.focus()),me(o.wrapper.ownerDocument,"mousemove",v),me(o.wrapper.ownerDocument,"mouseup",y),a.history.lastSelOrigin=null}var v=Xn(e,function(t){0!==t.buttons&&ke(t)?function t(r){var i=++h;var s=ln(e,r,!0,"rectangle"==n.unit);if(!s)return;if(0!=rt(s,f)){e.curOp.focus=D(),p(s);var l=On(o,a);(s.line>=l.to||s.lined.bottom?20:0;u&&setTimeout(Xn(e,function(){h==i&&(o.scroller.scrollTop+=u,t(r))}),50)}}(t):m(t)}),y=Xn(e,m);e.state.selectingText=y,de(o.wrapper.ownerDocument,"mousemove",v),de(o.wrapper.ownerDocument,"mouseup",y)}(e,n,t,a)}(t,n,a,e):xe(e)==r.scroller&&_e(e):2==o?(n&&Wo(t.doc,n),setTimeout(function(){return r.input.focus()},20)):3==o&&(w?t.display.input.onContextMenu(e):Tn(t)))}}function hi(e,t,r){if("char"==r)return new _o(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new _o(tt(t.line,0),lt(e.doc,tt(t.line+1,0)));var n=r(e,t);return new _o(n.from,n.to)}function mi(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&&_e(t);var i=e.display,s=i.lineDiv.getBoundingClientRect();if(a>s.bottom||!be(e,r))return Se(t);a-=s.top-i.viewOffset;for(var l=0;l=o)return ve(e,r,e,Xe(e.doc,a),e.display.gutterSpecs[l].className,t),Se(t)}}function vi(e,t){return mi(e,t,"gutterClick",!0)}function yi(e,t){Tr(e.display,t)||function(e,t){if(!be(e,"gutterContextMenu"))return!1;return mi(e,t,"gutterContextMenu",!1)}(e,t)||ye(e,t,"contextmenu")||w||e.display.input.onContextMenu(t)}function gi(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Br(e)}pi.prototype.compare=function(e,t,r){return this.time+400>e&&0==rt(t,this.pos)&&r==this.button};var bi={toString:function(){return"CodeMirror.Init"}},Ei={},_i={};function Ti(e,t,r){if(!t!=!(r&&r!=bi)){var n=e.display.dragFunctions,o=t?de:me;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 Si(e){e.options.lineWrapping?(I(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(O(e.display.wrapper,"CodeMirror-wrap"),Wt(e)),sn(e),cn(e),Br(e),setTimeout(function(){return Bn(e)},100)}function wi(e,t){var n=this;if(!(this instanceof wi))return new wi(e,t);this.options=t=t?F(t):{},F(Ei,t,!1);var o=t.value;"string"==typeof o?o=new Aa(o,t.mode,null,t.lineSeparator,t.direction):t.mode&&(o.modeOption=t.mode),this.doc=o;var a=new wi.inputStyles[t.inputStyle](this),i=this.display=new function(e,t,n,o){var a=this;this.input=n,a.scrollbarFiller=P("div",null,"CodeMirror-scrollbar-filler"),a.scrollbarFiller.setAttribute("cm-not-content","true"),a.gutterFiller=P("div",null,"CodeMirror-gutter-filler"),a.gutterFiller.setAttribute("cm-not-content","true"),a.lineDiv=N("div",null,"CodeMirror-code"),a.selectionDiv=P("div",null,null,"position: relative; z-index: 1"),a.cursorDiv=P("div",null,"CodeMirror-cursors"),a.measure=P("div",null,"CodeMirror-measure"),a.lineMeasure=P("div",null,"CodeMirror-measure"),a.lineSpace=N("div",[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,"position: relative; outline: none");var i=N("div",[a.lineSpace],"CodeMirror-lines");a.mover=P("div",[i],null,"position: relative"),a.sizer=P("div",[a.mover],"CodeMirror-sizer"),a.sizerWidth=null,a.heightForcer=P("div",null,null,"position: absolute; height: "+H+"px; width: 1px;"),a.gutters=P("div",null,"CodeMirror-gutters"),a.lineGutter=null,a.scroller=P("div",[a.sizer,a.heightForcer,a.gutters],"CodeMirror-scroll"),a.scroller.setAttribute("tabIndex","-1"),a.wrapper=P("div",[a.scrollbarFiller,a.gutterFiller,a.scroller],"CodeMirror"),s&&l<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),u||r&&g||(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=fo(o.gutters,o.lineNumbers),po(a),n.init(a)}(e,o,a,t);for(var c in i.wrapper.CodeMirror=this,gi(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),zn(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 B,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;de(t.scroller,"mousedown",Xn(e,di)),de(t.scroller,"dblclick",s&&l<11?Xn(e,function(t){if(!ye(e,t)){var r=ln(e,t);if(r&&!vi(e,t)&&!Tr(e.display,t)){_e(t);var n=e.findWordAt(r);Wo(e.doc,n.anchor,n.head)}}}):function(t){return ye(e,t)||_e(t)});de(t.scroller,"contextmenu",function(t){return yi(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}de(t.scroller,"touchstart",function(o){if(!ye(e,o)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(o)&&!vi(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)}}),de(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),de(t.scroller,"touchend",function(r){var n=t.activeTouch;if(n&&!Tr(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 _o(s,s):!n.prev.prev||a(n,n.prev.prev)?e.findWordAt(s):new _o(tt(s.line,0),lt(e.doc,tt(s.line+1,0))),e.setSelection(i.anchor,i.head),e.focus(),_e(r)}o()}),de(t.scroller,"touchcancel",o),de(t.scroller,"scroll",function(){t.scroller.clientHeight&&(In(e,t.scroller.scrollTop),Ln(e,t.scroller.scrollLeft,!0),ve(e,"scroll",e))}),de(t.scroller,"mousewheel",function(t){return bo(e,t)}),de(t.scroller,"DOMMouseScroll",function(t){return bo(e,t)}),de(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){ye(e,t)||we(t)},over:function(t){ye(e,t)||(!function(e,t){var r=ln(e,t);if(r){var n=document.createDocumentFragment();yn(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),we(t))},start:function(t){return function(e,t){if(s&&(!e.state.draggingText||+new Date-Ca<100))we(t);else if(!ye(e,t)&&!Tr(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:Xn(e,Pa),leave:function(t){ye(e,t)||Na(e)}};var i=t.input.getField();de(i,"keyup",function(t){return li.call(e,t)}),de(i,"keydown",Xn(e,si)),de(i,"keypress",Xn(e,ui)),de(i,"focus",function(t){return Sn(e,t)}),de(i,"blur",function(t){return wn(e,t)})}(this),Ia(),Kn(this),this.curOp.forceUpdate=!0,Do(this,o),t.autofocus&&!g||this.hasFocus()?setTimeout(M(Sn,this),20):wn(this),_i)_i.hasOwnProperty(c)&&_i[c](n,t[c],bi);co(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?U(Ge(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(pi,l=De(t),u=null;if(s&&n.ranges.length>1)if(Oi&&Oi.text.join("\n")==t){if(n.ranges.length%Oi.text.length==0){u=[];for(var c=0;c=0;p--){var d=n.ranges[p],h=d.from(),m=d.to();d.empty()&&(r&&r>0?h=tt(h.line,h.ch-r):e.state.overwrite&&!s?m=tt(m.line,Math.min(Ge(a,m.line).text.length,m.ch+Q(l).length)):s&&Oi&&Oi.lineWise&&Oi.text.join("\n")==t&&(h=m=tt(h.line,0)));var v={from:h,to:m,text:u?u[p%u.length]:l,origin:o||(s?"paste":e.state.cutIncoming>i?"cut":"+input")};sa(e.doc,v),lr(e,"inputRead",e,v)}t&&!s&&Ni(e,t),Pn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Pi(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Jn(t,function(){return Ci(t,r,0,null,"paste")}),!0}function Ni(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=ki(e,o.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(Ge(e.doc,o.head.line).text.slice(0,o.head.ch))&&(i=ki(e,o.head.line,"smart"));i&&lr(e,"electricInput",e,o.head.line)}}}function Ri(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=ue(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 tt(r.line,p,d)}}var h=function(e,t,n){for(var a=function(e,t){return t?new tt(r.line,l(e,1),"before"):new tt(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):Qa(s,t,r))){if(n||(i=t.line+r)=e.first+e.size||(t=new tt(i,t.ch,t.sticky),!(s=Ge(e,i))))return!1;t=Ja(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=na(e,t,a,i,!0);return nt(a,m)&&(m.hitSide=!0),m}function Li(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*tn(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=Qr(e,s,o)).outside;){if(r<0?o<=0:o>=i.height){a.hitSide=!0;break}o+=5*r}return a}var Mi=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new B,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Fi(e,t){var r=Nr(e,t.line);if(!r||r.hidden)return null;var n=Ge(e.doc,t.line),o=Cr(r,n,t.line),a=fe(n,e.doc.direction),i="left";a&&(i=ue(a,t.ch)%2?"right":"left");var s=Lr(o.map,t.ch,i);return s.offset="right"==s.collapse?s.end:s.start,s}function Ui(e,t){return t&&(e.bad=!0),e}function Bi(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Ui(e.clipPos(tt(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&&Fi(t,o)||{node:l[0].measure.map[2],offset:0},c=a.linen.firstLine()&&(i=tt(i.line-1,Ge(n.doc,i.line-1).length)),s.ch==Ge(n.doc,s.line).text.length&&s.lineo.viewTo-1)return!1;i.line==o.viewFrom||0==(e=un(n,i.line))?(t=Je(o.view[0].line),r=o.view[0].node):(t=Je(o.view[e].line),r=o.view[e-1].node.nextSibling);var l,u,c=un(n,s.line);if(c==o.view.length-1?(l=o.viewTo-1,u=o.lineDiv.lastChild):(l=Je(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(),l=!1;function u(){i&&(a+=s,l&&(a+=s),i=l=!1)}function c(e){e&&(u(),a+=e)}function f(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void c(r);var a,p=t.getAttribute("cm-marker");if(p){var d=e.findMarks(tt(n,0),tt(o+1,0),(v=+p,function(e){return e.id==v}));return void(d.length&&(a=d[0].find(0))&&c(Ve(e.doc,a.from,a.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;h&&u();for(var m=0;m1&&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 _=tt(t,d),T=tt(l,p.length?Q(p).length-h:0);return f.length>1||f[0]||rt(_,T)?(pa(n.doc,f,_,T,"+input"),!0):void 0},Mi.prototype.ensurePolled=function(){this.forceCompositionEnd()},Mi.prototype.reset=function(){this.forceCompositionEnd()},Mi.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Mi.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))},Mi.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Jn(this.cm,function(){return cn(e.cm)})},Mi.prototype.setUneditable=function(e){e.contentEditable="false"},Mi.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Xn(this.cm,Ci)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Mi.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Mi.prototype.onContextMenu=function(){},Mi.prototype.resetPosition=function(){},Mi.prototype.needsContentAttribute=!0;var Hi=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new B,this.hasSelection=!1,this.composing=null};Hi.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var o=this.textarea;function a(e){if(!ye(n,e)){if(n.somethingSelected())Ai({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Ri(n);Ai({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,$):(r.prevInput="",o.value=t.text.join("\n"),L(o))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),v&&(o.style.width="0px"),de(o,"input",function(){s&&l>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),de(o,"paste",function(e){ye(n,e)||Pi(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())}),de(o,"cut",a),de(o,"copy",a),de(e.scroller,"paste",function(t){if(!Tr(e,t)&&!ye(n,t)){if(!o.dispatchEvent)return n.state.pasteIncoming=+new Date,void r.focus();var a=new Event("paste");a.clipboardData=t.clipboardData,o.dispatchEvent(a)}}),de(e.lineSpace,"selectstart",function(t){Tr(e,t)||_e(t)}),de(o,"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"})}}),de(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},Hi.prototype.createField=function(e){this.wrapper=Ii(),this.textarea=this.wrapper.firstChild},Hi.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=vn(e);if(e.options.moveInputWithCursor){var o=Gr(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},Hi.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")},Hi.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&&L(this.textarea),s&&l>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",s&&l>=9&&(this.hasSelection=null))}},Hi.prototype.getField=function(){return this.textarea},Hi.prototype.supportsTouch=function(){return!1},Hi.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!g||D()!=this.textarea))try{this.textarea.focus()}catch(e){}},Hi.prototype.blur=function(){this.textarea.blur()},Hi.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Hi.prototype.receivedFocus=function(){this.slowPoll()},Hi.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Hi.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))})},Hi.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ie(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},Hi.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Hi.prototype.onKeyPress=function(){s&&l>=9&&(this.hasSelection=null),this.fastPoll()},Hi.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=ln(r,e),i=n.scroller.scrollTop;if(a&&!p){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(a)&&Xn(r,Jo)(r.doc,So(a),$);var c,f=o.style.cssText,d=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",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&&(c=window.scrollY),n.input.focus(),u&&window.scrollTo(null,c),n.input.reset(),r.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=v,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),s&&l>=9&&m(),w){we(e);de(window,"mouseup",function e(){me(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==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,o.style.cssText=f,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?Xn(r,aa)(r):e++<10?n.detectingSelectAll=setTimeout(a,500):(n.selForContextMenu=null,n.input.reset())},200)}}},Hi.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Hi.prototype.setUneditable=function(){},Hi.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!=bi&&o(e,t,r)}:o)}e.defineOption=r,e.Init=bi,r("value","",function(e,t){return e.setValue(t)},!0),r("mode",null,function(e,t){e.doc.modeOption=t,Ao(e)},!0),r("indentUnit",2,Ao,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(e){Co(e),Br(e),cn(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(tt(n,a))}n++});for(var o=r.length-1;o>=0;o--)pa(e.doc,t,r[o],tt(r[o].line,r[o].ch+t.length))}}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=bi&&e.refresh()}),r("specialCharPlaceholder",Zt,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("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),r("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),r("rtlMoveVisually",!_),r("wholeLineUpdateBefore",!0),r("theme","default",function(e){gi(e),ho(e)},!0),r("keyMap","default",function(e,t,r){var n=Ga(t),o=r!=bi&&Ga(r);o&&o.detach&&o.detach(e,n),n.attach&&n.attach(e,o||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Si,!0),r("gutters",[],function(e,t){e.display.gutterSpecs=fo(t,e.options.lineNumbers),ho(e)},!0),r("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?on(e.display)+"px":"0",e.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(e){return Bn(e)},!0),r("scrollbarStyle","native",function(e){zn(e),Bn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),r("lineNumbers",!1,function(e,t){e.display.gutterSpecs=fo(e.options.gutters,t),ho(e)},!0),r("firstLineNumber",1,ho,!0),r("lineNumberFormatter",function(e){return e},ho,!0),r("showCursorWhenSelecting",!1,mn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(e,t){"nocursor"==t&&(wn(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,Ti),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,mn,!0),r("singleCursorHeightPerLine",!0,mn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Co,!0),r("addModeClass",!1,Co,!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,Co,!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),r("phrases",null)}(wi),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)&&Xn(this,t[e])(this,r,o),ve(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"](Ga(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;rr&&(ki(this,o.head.line,e,!0),r=o.head.line,n==this.doc.sel.primIndex&&Pn(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&&Vo(this.doc,n,new _o(a,u[n].to()),$)}}}),getTokenAt:function(e,t){return bt(this,e,t)},getLineTokens:function(e,t){return bt(this,tt(e),t,!0)},getTokenTypeAt:function(e){e=lt(this.doc,e);var t,r=dt(this,Ge(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=Ge(this.doc,e)}else n=e;return $r(this,n,{top:0,left:0},t||"page",r||o).top+(o?this.doc.height-$t(n):0)},defaultTextHeight:function(){return tn(this.display)},defaultCharWidth:function(){return rn(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=Gr(this,lt(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=An(a,i)).scrollTop&&In(a,s.scrollTop),null!=s.scrollLeft&&Ln(a,s.scrollLeft))},triggerOnKeyDown:Zn(si),triggerOnKeyPress:Zn(ui),triggerOnKeyUp:li,triggerOnMouseDown:Zn(di),execCommand:function(e){if(Xa.hasOwnProperty(e))return Xa[e].call(null,this)},triggerElectric:Zn(function(e){Ni(this,e)}),findPosH:function(e,t,r,n){var o=1;t<0&&(o=-1,t=-t);for(var a=lt(this.doc,e),i=0;i0&&i(t.charAt(r-1));)--r;for(;n.5)&&sn(this),ve(this,"refresh",this)}),swapDoc:Zn(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Do(this,e),Br(this),this.display.input.reset(),Nn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,lr(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ee(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})}}(wi);var zi="iter insert remove copy getEditor constructor".split(" ");for(var $i in Aa.prototype)Aa.prototype.hasOwnProperty($i)&&q(zi,$i)<0&&(wi.prototype[$i]=function(e){return function(){return e.apply(this.doc,arguments)}}(Aa.prototype[$i]));return Ee(Aa),wi.inputStyles={textarea:Hi,contenteditable:Mi},wi.defineMode=function(e){wi.defaults.mode||"null"==e||(wi.defaults.mode=e),function(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Me[e]=t}.apply(this,arguments)},wi.defineMIME=function(e,t){Fe[e]=t},wi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),wi.defineMIME("text/plain","null"),wi.defineExtension=function(e,t){wi.prototype[e]=t},wi.defineDocExtension=function(e,t){Aa.prototype[e]=t},wi.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=D();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=s.getValue()}var o;if(e.form&&(de(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&&(me(e.form,"submit",n),"function"==typeof e.form.submit&&(e.form.submit=o))}},e.style.display="none";var s=wi(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s},function(e){e.off=me,e.on=de,e.wheelEventPixels=go,e.Doc=Aa,e.splitLines=De,e.countColumn=U,e.findColumn=G,e.isWordChar=te,e.Pass=z,e.signal=ve,e.Line=Gt,e.changeEnd=wo,e.scrollbarModel=Hn,e.Pos=tt,e.cmpPos=rt,e.modes=Me,e.mimeModes=Fe,e.resolveMode=Ue,e.getMode=Be,e.modeExtensions=qe,e.extendMode=He,e.copyState=ze,e.startState=Ke,e.innerMode=$e,e.commands=Xa,e.keyMap=Ba,e.keyName=Wa,e.isModifierKey=$a,e.lookupKey=za,e.normalizeKeyMap=Ha,e.StringStream=We,e.SharedTextMarker=wa,e.TextMarker=Ta,e.LineWidget=ba,e.e_preventDefault=_e,e.e_stopPropagation=Te,e.e_stop=we,e.addClass=I,e.contains=R,e.rmClass=O,e.keyNames=La}(wi),wi.version="5.48.2",wi},"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(21),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.6.9"};"number"==typeof __e&&(__e=n)},function(e,t,r){"use strict";t.__esModule=!0;var n,o=r(68),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=R,t.resolveSchema=D,t.retrieveSchema=j,t.deepEquals=B,t.shouldRender=function(e,t,r){var n=e.props,o=e.state;return!B(n,t)||!B(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 N=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 R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=(0,d.default)({},e,{properties:(0,d.default)({},e.properties)}),(0,f.default)(r).forEach(function(n){if(!e.properties.hasOwnProperty(n)){var o=void 0;o=e.additionalProperties.hasOwnProperty("type")?(0,d.default)({},e.additionalProperties):e.additionalProperties.hasOwnProperty("$ref")?j(e.additionalProperties,t,r):{type:N(r[n])},e.properties[n]=o,e.properties[n][b]=!0}}),e}function D(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")?I(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=L(a,s):S(s)&&(a=M(a,t,r,i,s))}return a}(e,t,r),t,r):e}function I(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=D(e,t,r);return n.hasOwnProperty("additionalProperties")&&!1!==n.additionalProperties?R(n,t,r):n}function L(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")?I(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 U(e){return"[object Arguments]"===Object.prototype.toString.call(e)}function B(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(U(e)||U(t)){if(!U(e)||!U(t))return!1;var o=Array.prototype.slice;return B(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(!B(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(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";var n=r(90)("wks"),o=r(67),a=r(7).Symbol,i="function"==typeof a;(e.exports=function(e){return n[e]||(n[e]=i&&a[e]||(i?a:o)("Symbol."+e))}).store=n},function(e,t,r){"use strict";e.exports=function(e,t){var r,a,i=t.children||[],s=i.length,l=[],u=-1;for(;++u1)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(631);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(632),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(13),r(14))},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";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;function o(e){return(o="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(){var a={}.hasOwnProperty;function i(){for(var e=[],t=0;t2&&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(591)},function(e,t,r){"use strict";var n=r(84),o=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var a=r(64);a.inherits=r(41);var i=r(239),s=r(133);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 B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(n)return B(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 R(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 D(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 I(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 L(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||N(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||N(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||N(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||N(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||N(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||N(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||N(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||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||N(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||N(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||N(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||N(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||N(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||N(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||N(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||N(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)||R(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||R(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||R(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||R(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):I(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||R(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):I(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);R(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);R(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||R(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||R(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||R(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):I(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||R(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):I(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return L(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 q(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(13))},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){"use strict";var n=r(87),o=r(86);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(155),o=r(91);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(312)(!0);r(96)(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(10)("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(167),a=r(168),i=r(23),s=r(66),l=r(104),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(159),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,r){"use strict";e.exports=o;var n=r(131).EventEmitter;function o(){n.call(this)}r(41)(o,n),o.Readable=r(132),o.Writable=r(617),o.Duplex=r(618),o.Transform=r(619),o.PassThrough=r(620),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(44).Buffer)},function(e,t,r){"use strict";t.decode=t.parse=r(271),t.encode=t.stringify=r(272)},function(e,t,r){"use strict";var n=r(88),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(303),__esModule:!0}},function(e,t,r){"use strict";t.f={}.propertyIsEnumerable},function(e,t,r){"use strict";var n=r(23),o=r(314),a=r(91),i=r(89)("IE_PROTO"),s=function(){},l=function(){var e,t=r(92)("iframe"),n=a.length;for(t.style.display="none",r(161).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("