require=function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};t[s][0].call(c.exports,(function(e){return i(t[s][1][e]||e)}),c,c.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s=15&&(h=!1,l=!0);var S=y&&(u||h&&(null==x||x<12.11)),C=n||s&&a>=9;function k(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _,M=function(e,t){var n=e.className,r=k(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function L(e,t){return T(e).appendChild(t)}function D(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return s+(t-o);s+=a-o,s+=n-s%n,o=a+1}}m?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(P=function(e){try{e.select()}catch(e){}});var E=function(){this.id=null,this.f=null,this.time=0,this.handler=H(this.onTimeout,this)};function I(e,t){for(var n=0;n=t)return r+Math.min(s,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var j=[""];function K(e){for(;j.length<=e;)j.push(Z(j)+" ");return j[e]}function Z(e){return e[e.length-1]}function X(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&Q(e))||t.test(e):Q(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function re(e){return e.charCodeAt(0)>=768&&ne.test(e)}function ie(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}var se=null;function ae(e,t,n){var r;se=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:se=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:se=i)}return null!=r?r:se}var le=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(s,a){var l="ltr"==a?"L":"R";if(0==s.length||"ltr"==a&&!e.test(s))return!1;for(var u,c=s.length,h=[],d=0;d-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function pe(e,t){var n=de(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function ye(e){e.prototype.on=function(e,t){he(this,e,t)},e.prototype.off=function(e,t){fe(this,e,t)}}function we(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function be(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function xe(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Se(e){we(e),be(e)}function Ce(e){return e.target||e.srcElement}function ke(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var _e,Me,Te=function(){if(s&&a<9)return!1;var e=D("div");return"draggable"in e||"dragDrop"in e}();function Le(e){if(null==_e){var t=D("span","​");L(e,D("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(_e=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&a<8))}var n=_e?D("span","​"):D("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function De(e){if(null!=Me)return Me;var t=L(e,document.createTextNode("AخA")),n=_(t,0,1).getBoundingClientRect(),r=_(t,1,2).getBoundingClientRect();return T(e),!(!n||n.left==n.right)&&(Me=r.right-n.right<3)}var Oe,Ne=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),s=o.indexOf("\r");-1!=s?(n.push(o.slice(0,s)),t+=s+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},We=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)},Ae="oncopy"in(Oe=D("div"))||(Oe.setAttribute("oncopy","return;"),"function"==typeof Oe.oncopy),Ye=null,Pe={},He={};function Fe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pe[e]=t}function Re(e){if("string"==typeof e&&He.hasOwnProperty(e))e=He[e];else if(e&&"string"==typeof e.name&&He.hasOwnProperty(e.name)){var t=He[e.name];"string"==typeof t&&(t={name:t}),(e=q(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Re("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Re("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ee(e,t){t=Re(t);var n=Pe[t.name];if(!n)return Ee(e,"text/plain");var r=n(e,t);if(Ie.hasOwnProperty(t.name)){var i=Ie[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var s in t.modeProps)r[s]=t.modeProps[s];return r}var Ie={};function ze(e,t){F(t,Ie.hasOwnProperty(e)?Ie[e]:Ie[e]={})}function Ue(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ge(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Be(e,t,n){return!e.startState||e.startState(t,n)}var Ve=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function je(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?et(n,je(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,je(e,t.line).text.length)}function lt(e,t){for(var n=[],r=0;r=this.string.length},Ve.prototype.sol=function(){return this.pos==this.lineStart},Ve.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ve.prototype.next=function(){if(this.post},Ve.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ve.prototype.skipToEnd=function(){this.pos=this.string.length},Ve.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ve.prototype.backUp=function(e){this.pos-=e},Ve.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ve.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ve.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ve.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ve.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ut=function(e,t){this.state=e,this.lookAhead=t},ct=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ht(e,t,n,r){var i=[e.state.modeGen],o={};bt(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var s=n.state,a=function(r){n.baseTokens=i;var a=e.state.overlays[r],l=1,u=0;n.state=!0,bt(e,t.text,a.mode,n,(function(e,t){for(var n=l;ue&&i.splice(l,1,e,i[l+1],r),l+=2,u=Math.min(e,r)}if(t)if(a.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&Ue(e.doc.mode,r.state),o=ht(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ft(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new ct(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,s=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>s;--a){if(a<=o.first)return o.first;var l=je(o,a-1),u=l.stateAfter;if(u&&(!n||a+(u instanceof ut?u.lookAhead:0)<=o.modeFrontier))return a;var c=R(l.text,null,e.options.tabSize);(null==i||r>c)&&(i=a-1,r=c)}return i}(e,t,n),s=o>r.first&&je(r,o-1).stateAfter,a=s?ct.fromSaved(r,s,o):new ct(r,Be(r.mode),o);return r.iter(o,t,(function(n){pt(e,n.text,a);var r=a.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}ct.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ct.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ct.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ct.fromSaved=function(e,t,n){return t instanceof ut?new ct(e,Ue(e.mode,t.state),n,t.lookAhead):new ct(e,Ue(e.mode,t),n)},ct.prototype.save=function(e){var t=!1!==e?Ue(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ut(t,this.maxLookAhead):t};var vt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yt(e,t,n,r){var i,o,s=e.doc,a=s.mode,l=je(s,(t=at(s,t)).line),u=ft(e,t.line,n),c=new Ve(l.text,e.options.tabSize,u);for(r&&(o=[]);(r||c.pose.options.maxHighlightLength?(a=!1,s&&pt(e,t,r,h.pos),h.pos=t.length,l=null):l=wt(gt(n,h,r.state,d),o),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||c!=l){for(;u=t:o.to>t);(r||(r=[])).push(new Ct(s,o.from,a?null:o.to))}}return r}(n,i,s),l=function(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var a=null==o.from||(s.inclusiveLeft?o.from<=t:o.from0&&a)for(var w=0;wt)&&(!n||Wt(n,o.marker)<0)&&(n=o.marker)}return n}function Ft(e,t,n,r,i){var o=je(e,t),s=St&&o.markedSpans;if(s)for(var a=0;a=0&&h<=0||c<=0&&h>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?tt(u.to,n)>=0:tt(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?tt(u.from,r)<=0:tt(u.from,r)<0)))return!0}}}function Rt(e){for(var t;t=Yt(e);)e=t.find(-1,!0).line;return e}function Et(e,t){var n=je(e,t),r=Rt(n);return n==r?t:$e(r)}function It(e,t){if(t>e.lastLine())return t;var n,r=je(e,t);if(!zt(e,r))return t;for(;n=Pt(r);)r=n.find(1,!0).line;return $e(r)+1}function zt(e,t){var n=St&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var jt=function(e,t,n){this.text=e,Dt(this,t),this.height=n?n(this):1};function Kt(e){e.parent=null,Lt(e)}jt.prototype.lineNo=function(){return $e(this)},ye(jt);var Zt={},Xt={};function $t(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Xt:Zt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function qt(e,t){var n=O("span",null,null,l?"padding-right: .1px":null),r={pre:O("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,s=void 0;r.pos=0,r.addToken=Qt,De(e.display.measure)&&(s=ue(o,e.doc.direction))&&(r.addToken=en(r.addToken,s)),r.map=[],nn(o,r,dt(e,o,t!=e.display.externalMeasured&&$e(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=Y(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=Y(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Le(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var a=r.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return pe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Y(r.pre.className,r.textClass||"")),r}function Jt(e){var t=D("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Qt(e,t,n,r,i,o,l){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&h.from<=u);d++);if(h.to>=c)return e(n,r,i,o,s,a,l);e(n,r.slice(0,h.to-u),i,o,null,a,l),o=null,r=r.slice(h.to-u),u=h.to}}}function tn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var s,a,l,u,c,h,d,f=i.length,p=0,m=1,g="",v=0;;){if(v==p){l=u=c=a="",d=null,h=null,v=1/0;for(var y=[],w=void 0,b=0;bp||S.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,u=""),S.className&&(l+=" "+S.className),S.css&&(a=(a?a+";":"")+S.css),S.startStyle&&x.from==p&&(c+=" "+S.startStyle),S.endStyle&&x.to==v&&(w||(w=[])).push(S.endStyle,x.to),S.title&&((d||(d={})).title=S.title),S.attributes)for(var C in S.attributes)(d||(d={}))[C]=S.attributes[C];S.collapsed&&(!h||Wt(h.marker,S)<0)&&(h=x)}else x.from>p&&v>x.from&&(v=x.from)}if(w)for(var k=0;k=f)break;for(var M=Math.min(f,v);;){if(g){var T=p+g.length;if(!h){var L=T>M?g.slice(0,M-p):g;t.addToken(t,L,s?s+l:l,c,p+L.length==v?u:"",a,d)}if(T>=M){g=g.slice(M-p),p=M;break}p=T,c=""}g=i.slice(o,o=n[m++]),s=$t(n[m++],t.cm.options)}}else for(var D=1;Dn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function On(e,t,n,r){return An(e,Wn(e,t),n,r)}function Nn(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&t2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=Hn(t.map,n,r),l=o.node,u=o.start,c=o.end,h=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;u&&re(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var f;u>0&&(h=r="right"),i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(s&&a<9&&!u&&(!i||!i.left&&!i.right)){var p=l.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+ir(e.display),top:p.top,bottom:p.bottom}:Pn}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,w=0;wt)&&(i=(o=l-a)-1,t>=l&&(s="right")),null!=i){if(r=e[u+2],a==l&&n==(r.insertLeft?"left":"right")&&(s=n),"left"==n&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],s="left";if("right"==n&&i==l-a)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function Rn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!a)return s("before"==u?l-1:l,"before"==u);function c(e,t,n){return s(n?e-1:e,1==a[t].level!=n)}var h=ae(a,l,u),d=se,f=c(l,h,"before"==u);return null!=d&&(f.other=c(l,d,"before"!=u)),f}function Zn(e,t){var n=0;t=at(e.doc,t),e.options.lineWrapping||(n=ir(e.display)*t.ch);var r=je(e.doc,t.line),i=Gt(r)+Cn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Xn(e,t,n,r,i){var o=et(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function $n(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Xn(r.first,0,null,-1,-1);var i=qe(r,n),o=r.first+r.size-1;if(i>o)return Xn(r.first+r.size-1,je(r,o).text.length,null,1,1);t<0&&(t=0);for(var s=je(r,i);;){var a=er(e,s,i,t,n),l=Ht(s,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var u=l.find(1);if(u.line==i)return u;s=je(r,i=u.line)}}function qn(e,t,n,r){r-=Gn(t);var i=t.text.length,o=oe((function(t){return An(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=oe((function(t){return An(e,n,t).top>r}),o,i)}}function Jn(e,t,n,r){return n||(n=Wn(e,t)),qn(e,t,n,Bn(e,t,An(e,n,r),"line").top)}function Qn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function er(e,t,n,r,i){i-=Gt(t);var o=Wn(e,t),s=Gn(t),a=0,l=t.text.length,u=!0,c=ue(t,e.doc.direction);if(c){var h=(e.options.lineWrapping?nr:tr)(e,t,n,o,c,r,i);a=(u=1!=h.level)?h.from:h.to-1,l=u?h.to:h.from-1}var d,f,p=null,m=null,g=oe((function(t){var n=An(e,o,t);return n.top+=s,n.bottom+=s,!!Qn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,m=n),!0)}),a,l),v=!1;if(m){var y=r-m.left=b.bottom?1:0}return Xn(n,g=ie(t.text,g,1),f,v,r-d)}function tr(e,t,n,r,i,o,s){var a=oe((function(a){var l=i[a],u=1!=l.level;return Qn(Kn(e,et(n,u?l.to:l.from,u?"before":"after"),"line",t,r),o,s,!0)}),0,i.length-1),l=i[a];if(a>0){var u=1!=l.level,c=Kn(e,et(n,u?l.from:l.to,u?"after":"before"),"line",t,r);Qn(c,o,s,!0)&&c.top>s&&(l=i[a-1])}return l}function nr(e,t,n,r,i,o,s){var a=qn(e,t,r,s),l=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,h=null,d=0;d=u||f.to<=l)){var p=An(e,r,1!=f.level?Math.min(u,f.to)-1:Math.max(l,f.from)).right,m=pm)&&(c=f,h=m)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function rr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Yn){Yn=D("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Yn.appendChild(document.createTextNode("x")),Yn.appendChild(D("br"));Yn.appendChild(document.createTextNode("x"))}L(e.measure,Yn);var n=Yn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function ir(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=D("span","xxxxxxxxxx"),n=D("pre",[t],"CodeMirror-line-like");L(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function or(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var a=e.display.gutterSpecs[s].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:sr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function sr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ar(e){var t=rr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/ir(e.display)-3);return function(i){if(zt(e.doc,i))return 0;var o=0;if(i.widgets)for(var s=0;s0&&(l=je(e.doc,u.line).text).length==u.ch){var c=R(l,l.length,e.options.tabSize)-l.length;u=et(u.line,Math.max(0,Math.round((o-_n(e.display).left)/ir(e.display))-c))}return u}function cr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)St&&Et(e.doc,t)i.viewFrom?fr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)fr(e);else if(t<=i.viewFrom){var o=pr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):fr(e)}else if(n>=i.viewTo){var s=pr(e,t,t,-1);s?(i.view=i.view.slice(0,s.index),i.viewTo=s.lineN):fr(e)}else{var a=pr(e,t,t,-1),l=pr(e,n,n+r,1);a&&l?(i.view=i.view.slice(0,a.index).concat(on(e,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):fr(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[cr(e,t)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==I(s,n)&&s.push(n)}}}function fr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function pr(e,t,n,r){var i,o=cr(e,t),s=e.display.view;if(!St||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var a=e.display.viewFrom,l=0;l0){if(o==s.length-1)return null;i=a+s[o].size-t,o++}else i=a-t;t+=i,n+=i}for(;Et(e.doc,n)!=n;){if(o==(r<0?0:s.length-1))return null;n+=r*s[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function mr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||a.to().linet||t==n&&s.to==t)&&(r(Math.max(s.from,t),Math.min(s.to,n),1==s.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?d:r,(function(e,t,i,h){var g="ltr"==i,v=f(e,g?"left":"right"),y=f(t-1,g?"right":"left"),w=null==n&&0==e,b=null==r&&t==d,x=0==h,S=!m||h==m.length-1;if(y.top-v.top<=3){var C=(u?b:w)&&S,k=(u?w:b)&&x?a:(g?v:y).left,_=C?l:(g?y:v).right;c(k,v.top,_-k,v.bottom)}else{var M,T,L,D;g?(M=u&&w&&x?a:v.left,T=u?l:p(e,i,"before"),L=u?a:p(t,i,"after"),D=u&&b&&S?l:y.right):(M=u?p(e,i,"before"):a,T=!u&&w&&x?l:v.right,L=!u&&b&&S?a:y.left,D=u?p(t,i,"after"):l),c(M,v.top,T-M,v.bottom),v.bottom0?t.blinker=setInterval((function(){e.hasFocus()||_r(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Sr(e){e.state.focused||(e.display.input.focus(),kr(e))}function Cr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,_r(e))}),100)}function kr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(pe(e,"focus",e,t),e.state.focused=!0,A(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),xr(e))}function _r(e,t){e.state.delayingBlurEvent||(e.state.focused&&(pe(e,"blur",e,t),e.state.focused=!1,M(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Mr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||d<-.005)&&(Xe(i.line,l),Tr(i.line),i.rest))for(var f=0;fe.display.sizerWidth){var p=Math.ceil(u/ir(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Tr(e){if(e.widgets)for(var t=0;t=s&&(o=qe(t,Gt(je(t,l))-e.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function Dr(e,t){var n=e.display,r=rr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Ln(e),s={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+kn(n),l=t.topa-r;if(t.topi+o){var c=Math.min(t.top,(u?a:t.bottom)-o);c!=i&&(s.scrollTop=c)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,d=Tn(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),f=t.right-t.left>d;return f&&(t.right=t.left+d),t.left<10?s.scrollLeft=0:t.leftd+h-3&&(s.scrollLeft=t.right+(f?0:10)-d),s}function Or(e,t){null!=t&&(Ar(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Nr(e){Ar(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Wr(e,t,n){null==t&&null==n||Ar(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Ar(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Yr(e,Zn(e,t.from),Zn(e,t.to),t.margin))}function Yr(e,t,n,r){var i=Dr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Wr(e,i.scrollLeft,i.scrollTop)}function Pr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||li(e,{top:t}),Hr(e,t,!0),n&&li(e),ri(e,100))}function Hr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Fr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,hi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Rr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+kn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Mn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Er=function(e,t,n){this.cm=n;var r=this.vert=D("div",[D("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=D("div",[D("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),he(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),he(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Er.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Er.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Er.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Er.prototype.zeroWidthHack=function(){var e=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new E,this.disableVert=new E},Er.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},Er.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ir=function(){};function zr(e,t){t||(t=Rr(e));var n=e.display.barWidth,r=e.display.barHeight;Ur(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Mr(e),Ur(e,Rr(e)),n=e.display.barWidth,r=e.display.barHeight}function Ur(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Ir.prototype.update=function(){return{bottom:0,right:0}},Ir.prototype.setScrollLeft=function(){},Ir.prototype.setScrollTop=function(){},Ir.prototype.clear=function(){};var Gr={native:Er,null:Ir};function Br(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&M(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Gr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Fr(e,t):Pr(e,t)}),e),e.display.scrollbars.addClass&&A(e.display.wrapper,e.display.scrollbars.addClass)}var Vr=0;function jr(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:++Vr},t=e.curOp,sn?sn.ops.push(t):t.ownsGroup=sn={ops:[t],delayedCallbacks:[]}}function Kr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new oi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Xr(e){e.updatedDisplay=e.mustUpdate&&si(e.cm,e.update)}function $r(e){var t=e.cm,n=t.display;e.updatedDisplay&&Mr(t),e.barMeasure=Rr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=On(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Mn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Tn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function qr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=D("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Cn(e.display))+"px;\n height: "+(t.bottom-t.top+Mn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?et(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var s=!1,a=Kn(e,t),l=n&&n!=t?Kn(e,n):a,u=Dr(e,i={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-r,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+r}),c=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=u.scrollTop&&(Pr(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(s=!0)),null!=u.scrollLeft&&(Fr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(s=!0)),!s)break}return i}(t,at(r,e.scrollToPos.from),at(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var s=0;s=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ft(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var s=o.styles,a=o.text.length>e.options.maxHighlightLength?Ue(t.mode,r.state):null,l=ht(e,o,r,!0);a&&(r.state=a),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!s||s.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),d=0;!h&&dn)return ri(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Qr(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mr(e))return!1;di(e)&&(fr(e),t.dims=or(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),s=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroms&&n.viewTo-s<20&&(s=Math.min(i,n.viewTo)),St&&(o=Et(e.doc,o),s=It(e.doc,s));var a=o!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=on(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=on(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,cr(e,n)))),r.viewTo=n}(e,o,s),n.viewOffset=Gt(je(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=mr(e);if(!a&&0==u&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=W();if(!t||!N(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&N(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return u>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,s=o.firstChild;function a(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var u=r.view,c=r.viewFrom,h=0;h-1&&(f=!1),cn(e,d,c,n)),f&&(T(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(Qe(e.options,c)))),s=d.node.nextSibling}else{var p=vn(e,d,c,n);o.insertBefore(p,s)}c+=d.size}for(;s;)s=a(s)}(e,n.updateLineNumbers,t.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=W()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&N(document.body,e.anchorNode)&&N(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(c),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ri(e,400)),n.updateLineNumbers=null,!0}function ai(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Tn(e))r&&(t.visible=Lr(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+kn(e.display)-Ln(e),n.top)}),t.visible=Lr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!si(e,t))break;Mr(e);var i=Rr(e);gr(e),zr(e,i),ci(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function li(e,t){var n=new oi(e,t);if(si(e,n)){Mr(e),ai(e,n);var r=Rr(e);gr(e),zr(e,r),ci(e,r),n.finish()}}function ui(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ci(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Mn(e)+"px"}function hi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=sr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",s=0;sa.clientWidth,c=a.scrollHeight>a.clientHeight;if(i&&u||o&&c){if(o&&y&&l)e:for(var d=t.target,f=s.view;d!=a;d=d.parentNode)for(var p=0;p=0&&tt(e,r.to())<=0)return n}return-1};var Ci=function(e,t){this.anchor=e,this.head=t};function ki(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=I(t,i);for(var o=1;o0:l>=0){var u=ot(a.from(),s.from()),c=it(a.to(),s.to()),h=a.empty()?s.from()==s.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new Ci(h?c:u,h?u:c))}}return new Si(t,n)}function _i(e,t){return new Si([new Ci(e,t||e)],0)}function Mi(e){return e.text?et(e.from.line+e.text.length-1,Z(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Ti(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Mi(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Mi(t).ch-t.to.ch),et(n,r)}function Li(e,t){for(var n=[],r=0;r1&&e.remove(a.line+1,p-1),e.insert(a.line+1,v)}ln(e,"change",e,t)}function Yi(e,t,n){!function e(r,i,o){if(r.linked)for(var s=0;sa-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Ei(e.done),Z(e.done)):e.done.length&&!Z(e.done).ranges?Z(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Z(e.done)):void 0}(i,i.lastOp==r)))s=Z(o.changes),0==tt(t.from,t.to)&&0==tt(t.from,s.to)?s.to=Mi(t):o.changes.push(Ri(e,t));else{var l=Z(i.done);for(l&&l.ranges||Ui(e.sel,i.done),o={changes:[Ri(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||pe(e,"historyAdded")}function zi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,Z(i.done),t))?i.done[i.done.length-1]=t:Ui(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Ei(i.undone)}function Ui(e,t){var n=Z(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Gi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Bi(e){if(!e)return null;for(var t,n=0;n-1&&(Z(a)[h]=u[h],delete u[h])}}}return r}function Ki(e,t,n,r){if(r){var i=e.anchor;if(n){var o=tt(t,i)<0;o!=tt(n,i)<0?(i=t,t=n):o!=tt(t,n)<0&&(t=n)}return new Ci(i,t)}return new Ci(n||t,t)}function Zi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Qi(e,new Si([Ki(e.sel.primary(),t,n,i)],0),r)}function Xi(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:a.to>t.ch))){if(i&&(pe(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var h=l.find(r<0?1:-1),d=void 0;if((r<0?c:u)&&(h=so(e,h,-r,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(d=tt(h,n))&&(r<0?d<0:d>0))return io(e,h,t,r,i)}var f=l.find(r<0?-1:1);return(r<0?u:c)&&(f=so(e,f,r,f.line==t.line?o:null)),f?io(e,f,t,r,i):null}}return t}function oo(e,t,n,r,i){var o=r||1,s=io(e,t,n,o,i)||!i&&io(e,t,n,o,!0)||io(e,t,n,-o,i)||!i&&io(e,t,n,-o,!0);return s||(e.cantEdit=!0,et(e.first,0))}function so(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?at(e,et(t.line-1)):null:n>0&&t.ch==(r||je(e,t.line)).text.length?t.line0)){var c=[l,1],h=tt(u.from,a.from),d=tt(u.to,a.to);(h<0||!s.inclusiveLeft&&!h)&&c.push({from:u.from,to:a.from}),(d>0||!s.inclusiveRight&&!d)&&c.push({from:a.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)co(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else co(e,t)}}function co(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=Li(e,t);Ii(e,t,n,e.cm?e.cm.curOp.id:NaN),po(e,t,n,Mt(e,t));var r=[];Yi(e,(function(e,n){n||-1!=I(r,e.history)||(yo(e.history,t),r.push(e.history)),po(e,t,null,Mt(e,t))}))}}function ho(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,s=e.sel,a="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,u=0;u=0;--f){var p=d(f);if(p)return p.v}}}}function fo(e,t){if(0!=t&&(e.first+=t,e.sel=new Si(X(e.sel.ranges,(function(e){return new Ci(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){hr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:et(o,je(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ke(e,t.from,t.to),n||(n=Li(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,s=t.to,a=!1,l=o.line;e.options.lineWrapping||(l=$e(Rt(je(r,o.line))),r.iter(l,s.line+1,(function(e){if(e==i.maxLine)return a=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ge(e),Ai(r,t,n,ar(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=Bt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)})),a&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=je(e,r).stateAfter;if(i&&(!(i instanceof ut)||r+i.lookAhead1||!(this.children[0]instanceof bo))){var a=[];this.collapse(a),this.children=[new bo(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var s=i.lines.length%25+25,a=s;a10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==s&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=O("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Ft(e,t.line,t,n,o)||t.line!=n.line&&Ft(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");St=!0}o.addToHistory&&Ii(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,l=t.line,u=e.cm;if(e.iter(l,n.line+1,(function(e){u&&o.collapsed&&!u.options.lineWrapping&&Rt(e)==u.display.maxLine&&(a=!0),o.collapsed&&l!=t.line&&Xe(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Ct(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){zt(e,t)&&Xe(t,0)})),o.clearOnEnter&&he(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(xt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ko,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)hr(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)dr(u,c,"text");o.atomic&&no(u.doc),ln(u,"markerAdded",u,o)}return o}_o.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&jr(e),ve(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&hr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&no(e.doc)),e&&ln(e,"markerCleared",e,this,r,i),t&&Kr(e),this.parent&&this.parent.clear()}},_o.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;l--)uo(this,r[l]);a?Ji(this,a):this.cm&&Nr(this.cm)})),undo:ni((function(){ho(this,"undo")})),redo:ni((function(){ho(this,"redo")})),undoSelection:ni((function(){ho(this,"undo",!0)})),redoSelection:ni((function(){ho(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=at(this,e),t=at(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var s=o.markedSpans;if(s)for(var a=0;a=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),at(this,et(n,t))},indexFromPos:function(e){var t=(e=at(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var h=e.dataTransfer.getData("Text");if(h){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),eo(t.doc,_i(n,n)),d)for(var f=0;f=0;t--)mo(e.doc,"",r[t].from,r[t].to,"+delete");Nr(e)}))}function Jo(e,t,n){var r=ie(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Qo(e,t,n){var r=Jo(e,t.ch,n);return null==r?null:new et(t.line,r,n<0?"after":"before")}function es(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=ue(n,t.doc.direction);if(o){var s,a=i<0?Z(o):o[0],l=i<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var u=Wn(t,n);s=i<0?n.text.length-1:0;var c=An(t,u,s).top;s=oe((function(e){return An(t,u,e).top==c}),i<0==(1==a.level)?a.from:a.to-1,s),"before"==l&&(s=Jo(n,s,1))}else s=i<0?a.to:a.from;return new et(r,s,l)}}return new et(r,i<0?n.text.length:0,i<0?"before":"after")}Go.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Go.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Go.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Go.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Go.default=y?Go.macDefault:Go.pcDefault;var ts={selectAll:ao,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),U)},killLine:function(e){return qo(e,(function(t){if(t.empty()){var n=je(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new et(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),et(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var s=je(e.doc,i.line-1).text;s&&(i=new et(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),et(i.line-1,s.length-1),i,"+transpose"))}n.push(new Ci(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Qr(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(tt((i=u.ranges[i]).from(),t)<0||t.xRel>0)&&(tt(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,u=ei(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,fe(i.wrapper.ownerDocument,"mouseup",u),fe(i.wrapper.ownerDocument,"mousemove",c),fe(i.scroller,"dragstart",h),fe(i.scroller,"drop",u),o||(we(t),r.addNew||Zi(e.doc,n,null,null,r.extend),l&&!d||s&&9==a?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},h=function(){return o=!0};l&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),he(i.wrapper.ownerDocument,"mouseup",u),he(i.wrapper.ownerDocument,"mousemove",c),he(i.scroller,"dragstart",h),he(i.scroller,"drop",u),Cr(e),setTimeout((function(){return i.input.focus()}),20)}(e,r,t,o):function(e,t,n,r){var i=e.display,o=e.doc;we(t);var s,a,l=o.sel,u=l.ranges;if(r.addNew&&!r.extend?(a=o.sel.contains(n),s=a>-1?u[a]:new Ci(n,n)):(s=o.sel.primary(),a=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new Ci(n,n)),n=ur(e,t,!0,!0),a=-1;else{var c=vs(e,n,r.unit);s=r.extend?Ki(s,c.anchor,c.head,r.extend):c}r.addNew?-1==a?(a=u.length,Qi(o,ki(e,u.concat([s]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&"char"==r.unit&&!r.extend?(Qi(o,ki(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):$i(o,a,s,G):(a=0,Qi(o,new Si([s],0),G),l=o.sel);var h=n;function d(t){if(0!=tt(h,t))if(h=t,"rectangle"==r.unit){for(var i=[],u=e.options.tabSize,c=R(je(o,n.line).text,n.ch,u),d=R(je(o,t.line).text,t.ch,u),f=Math.min(c,d),p=Math.max(c,d),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=je(o,m).text,y=V(v,f,u);f==p?i.push(new Ci(et(m,y),et(m,y))):v.length>y&&i.push(new Ci(et(m,y),et(m,V(v,p,u))))}i.length||i.push(new Ci(n,n)),Qi(o,ki(e,l.ranges.slice(0,a).concat(i),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var w,b=s,x=vs(e,t,r.unit),S=b.anchor;tt(x.anchor,S)>0?(w=x.head,S=ot(b.from(),x.anchor)):(w=x.anchor,S=it(b.to(),x.head));var C=l.ranges.slice(0);C[a]=function(e,t){var n=t.anchor,r=t.head,i=je(e.doc,n.line);if(0==tt(n,r)&&n.sticky==r.sticky)return t;var o=ue(i);if(!o)return t;var s=ae(o,n.ch,n.sticky),a=o[s];if(a.from!=n.ch&&a.to!=n.ch)return t;var l,u=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==u||u==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=ae(o,r.ch,r.sticky),h=c-s||(r.ch-n.ch)*(1==a.level?-1:1);l=c==u-1||c==u?h<0:h>0}var d=o[u+(l?-1:0)],f=l==(1==d.level),p=f?d.from:d.to,m=f?"after":"before";return n.ch==p&&n.sticky==m?t:new Ci(new et(n.line,p,m),r)}(e,new Ci(at(o,S),w)),Qi(o,ki(e,C,a),G)}}var f=i.wrapper.getBoundingClientRect(),p=0;function m(t){e.state.selectingText=!1,p=1/0,t&&(we(t),i.input.focus()),fe(i.wrapper.ownerDocument,"mousemove",g),fe(i.wrapper.ownerDocument,"mouseup",v),o.history.lastSelOrigin=null}var g=ei(e,(function(t){0!==t.buttons&&ke(t)?function t(n){var s=++p,a=ur(e,n,!0,"rectangle"==r.unit);if(a)if(0!=tt(a,h)){e.curOp.focus=W(),d(a);var l=Lr(i,o);(a.line>=l.to||a.linef.bottom?20:0;u&&setTimeout(ei(e,(function(){p==s&&(i.scroller.scrollTop+=u,t(n))})),50)}}(t):m(t)})),v=ei(e,m);e.state.selectingText=v,he(i.wrapper.ownerDocument,"mousemove",g),he(i.wrapper.ownerDocument,"mouseup",v)}(e,r,t,o)}(t,r,o,e):Ce(e)==n.scroller&&we(e):2==i?(r&&Zi(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(C?t.display.input.onContextMenu(e):Cr(t)))}}function vs(e,t,n){if("char"==n)return new Ci(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Ci(et(t.line,0),at(e.doc,et(t.line+1,0)));var r=n(e,t);return new Ci(r.from,r.to)}function ys(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&we(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!ve(e,n))return xe(t);o-=a.top-s.viewOffset;for(var l=0;l=i)return pe(e,n,e,qe(e.doc,o),e.display.gutterSpecs[l].className,t),xe(t)}}function ws(e,t){return ys(e,t,"gutterClick",!0)}function bs(e,t){Sn(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&ys(e,t,"gutterContextMenu",!1)}(e,t)||me(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function xs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),In(e)}ms.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var Ss={toString:function(){return"CodeMirror.Init"}},Cs={},ks={};function _s(e,t,n){if(!t!=!(n&&n!=Ss)){var r=e.display.dragFunctions,i=t?he:fe;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Ms(e){e.options.lineWrapping?(A(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(M(e.display.wrapper,"CodeMirror-wrap"),Vt(e)),lr(e),hr(e),In(e),setTimeout((function(){return zr(e)}),100)}function Ts(e,t){var n=this;if(!(this instanceof Ts))return new Ts(e,t);this.options=t=t?F(t):{},F(Cs,t,!1);var r=t.value;"string"==typeof r?r=new No(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ts.inputStyles[t.inputStyle](this),o=this.display=new gi(e,r,i,t);for(var u in o.wrapper.CodeMirror=this,xs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Br(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 E,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),s&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;he(t.scroller,"mousedown",ei(e,gs)),he(t.scroller,"dblclick",s&&a<11?ei(e,(function(t){if(!me(e,t)){var n=ur(e,t);if(n&&!ws(e,t)&&!Sn(e.display,t)){we(t);var r=e.findWordAt(n);Zi(e.doc,r.anchor,r.head)}}})):function(t){return me(e,t)||we(t)}),he(t.scroller,"contextmenu",(function(t){return bs(e,t)})),he(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||bs(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}he(t.scroller,"touchstart",(function(i){if(!me(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!ws(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),he(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),he(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Sn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var s,a=e.coordsChar(t.activeTouch,"page");s=!r.prev||o(r,r.prev)?new Ci(a,a):!r.prev.prev||o(r,r.prev.prev)?e.findWordAt(a):new Ci(et(a.line,0),at(e.doc,et(a.line+1,0))),e.setSelection(s.anchor,s.head),e.focus(),we(n)}i()})),he(t.scroller,"touchcancel",i),he(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Pr(e,t.scroller.scrollTop),Fr(e,t.scroller.scrollLeft,!0),pe(e,"scroll",e))})),he(t.scroller,"mousewheel",(function(t){return xi(e,t)})),he(t.scroller,"DOMMouseScroll",(function(t){return xi(e,t)})),he(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){me(e,t)||Se(t)},over:function(t){me(e,t)||(function(e,t){var n=ur(e,t);if(n){var r=document.createDocumentFragment();yr(e,n,r),e.display.dragCursor||(e.display.dragCursor=D("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),L(e.display.dragCursor,r)}}(e,t),Se(t))},start:function(t){return function(e,t){if(s&&(!e.state.draggingText||+new Date-Wo<100))Se(t);else if(!me(e,t)&&!Sn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=D("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}(e,t)},drop:ei(e,Ao),leave:function(t){me(e,t)||Yo(e)}};var l=t.input.getField();he(l,"keyup",(function(t){return hs.call(e,t)})),he(l,"keydown",ei(e,cs)),he(l,"keypress",ei(e,ds)),he(l,"focus",(function(t){return kr(e,t)})),he(l,"blur",(function(t){return _r(e,t)}))}(this),Fo(),jr(this),this.curOp.forceUpdate=!0,Pi(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&kr(n)}),20):_r(this),ks)ks.hasOwnProperty(u)&&ks[u](this,t[u],Ss);di(this),t.finishInit&&t.finishInit(this);for(var c=0;c150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?R(je(o,t-1).text,null,s):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var h="",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(u/s);f;--f)d+=s,h+="\t";if(ds,l=Ne(t),u=null;if(a&&r.ranges.length>1)if(Os&&Os.text.join("\n")==t){if(r.ranges.length%Os.text.length==0){u=[];for(var c=0;c=0;d--){var f=r.ranges[d],p=f.from(),m=f.to();f.empty()&&(n&&n>0?p=et(p.line,p.ch-n):e.state.overwrite&&!a?m=et(m.line,Math.min(je(o,m.line).text.length,m.ch+Z(l).length)):a&&Os&&Os.lineWise&&Os.text.join("\n")==l.join("\n")&&(p=m=et(p.line,0)));var g={from:p,to:m,text:u?u[d%u.length]:l,origin:i||(a?"paste":e.state.cutIncoming>s?"cut":"+input")};uo(e.doc,g),ln(e,"inputRead",e,g)}t&&!a&&Ys(e,t),Nr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function As(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Qr(t,(function(){return Ws(t,n,0,null,"paste")})),!0}function Ys(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),s=!1;if(o.electricChars){for(var a=0;a-1){s=Ds(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(je(e.doc,i.head.line).text.slice(0,i.head.ch))&&(s=Ds(e,i.head.line,"smart"));s&&ln(e,"electricInput",e,i.head.line)}}}function Ps(e){for(var t=[],n=[],r=0;r0?0:-1));s=isNaN(c)?null:new et(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(c>=55296&&c<56320?2:1))),-n)}else s=i?function(e,t,n,r){var i=ue(t,e.doc.direction);if(!i)return Qo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ae(i,n.ch,n.sticky),s=i[o];if("ltr"==e.doc.direction&&s.level%2==0&&(r>0?s.to>n.ch:s.from=s.from&&d>=c.begin)){var f=h?"before":"after";return new et(n.line,d,f)}}var p=function(e,t,r){for(var o=function(e,t){return t?new et(n.line,l(e,1),"before"):new et(n.line,e,"after")};e>=0&&e0==(1!=s.level),u=a?r.begin:l(r.end,-1);if(s.from<=u&&u0?c.end:l(c.begin,-1);return null==g||r>0&&g==t.text.length||!(m=p(r>0?0:i.length-1,r,u(g)))?null:m}(e.cm,a,t,n):Qo(a,t,n);if(null==s){if(o||(u=t.line+l)=e.first+e.size||(t=new et(u,t.ch,t.sticky),!(a=je(e,u))))return!1;t=es(i,e.cm,a,t.line,l)}else t=s;return!0}if("char"==r||"codepoint"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var c=null,h="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||u(!f);f=!1){var p=a.text.charAt(t.ch)||"\n",m=ee(p,d)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||f||m||(m="s"),c&&c!=m){n<0&&(n=1,u(),t.sticky="after");break}if(m&&(c=m),n>0&&!u(!f))break}var g=oo(e,t,o,s,!0);return nt(o,g)&&(g.hitSide=!0),g}function Es(e,t,n,r){var i,o,s=e.doc,a=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*rr(e.display),3);i=(n>0?t.bottom:t.top)+n*u}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=$n(e,a,i)).outside;){if(n<0?i<=0:i>=s.height){o.hitSide=!0;break}i+=5*n}return o}var Is=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new E,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function zs(e,t){var n=Nn(e,t.line);if(!n||n.hidden)return null;var r=je(e.doc,t.line),i=Dn(n,r,t.line),o=ue(r,e.doc.direction),s="left";o&&(s=ae(o,t.ch)%2?"right":"left");var a=Hn(i.map,t.ch,s);return a.offset="right"==a.collapse?a.end:a.start,a}function Us(e,t){return t&&(e.bad=!0),e}function Gs(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Us(e.clipPos(et(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i=t.display.viewTo||o.line=t.display.viewFrom&&zs(t,i)||{node:l[0].measure.map[2],offset:0},c=o.liner.firstLine()&&(s=et(s.line-1,je(r.doc,s.line-1).length)),a.ch==je(r.doc,a.line).text.length&&a.linei.viewTo-1)return!1;s.line==i.viewFrom||0==(e=cr(r,s.line))?(t=$e(i.view[0].line),n=i.view[0].node):(t=$e(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,u,c=cr(r,a.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=$e(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var h=r.doc.splitLines(function(e,t,n,r,i){var o="",s=!1,a=e.doc.lineSeparator(),l=!1;function u(){s&&(o+=a,l&&(o+=a),s=l=!1)}function c(e){e&&(u(),o+=e)}function h(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void c(n);var o,d=t.getAttribute("cm-marker");if(d){var f=e.findMarks(et(r,0),et(i+1,0),(g=+d,function(e){return e.id==g}));return void(f.length&&(o=f[0].find(0))&&c(Ke(e.doc,o.from,o.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&u();for(var m=0;m1&&d.length>1;)if(Z(h)==Z(d))h.pop(),d.pop(),l--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),t++}for(var f=0,p=0,m=h[0],g=d[0],v=Math.min(m.length,g.length);fs.ch&&y.charCodeAt(y.length-p-1)==w.charCodeAt(w.length-p-1);)f--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(f).replace(/\u200b+$/,"");var x=et(t,f),S=et(l,d.length?Z(d).length-p:0);return h.length>1||h[0]||tt(x,S)?(mo(r.doc,h,x,S,"+input"),!0):void 0},Is.prototype.ensurePolled=function(){this.forceCompositionEnd()},Is.prototype.reset=function(){this.forceCompositionEnd()},Is.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Is.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))},Is.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Qr(this.cm,(function(){return hr(e.cm)}))},Is.prototype.setUneditable=function(e){e.contentEditable="false"},Is.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ei(this.cm,Ws)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Is.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Is.prototype.onContextMenu=function(){},Is.prototype.resetPosition=function(){},Is.prototype.needsContentAttribute=!0;var Vs=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new E,this.hasSelection=!1,this.composing=null};Vs.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!me(r,e)){if(r.somethingSelected())Ns({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Ps(r);Ns({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,U):(n.prevInput="",i.value=t.text.join("\n"),P(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),he(i,"input",(function(){s&&a>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),he(i,"paste",(function(e){me(r,e)||As(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),he(i,"cut",o),he(i,"copy",o),he(e.scroller,"paste",(function(t){if(!Sn(e,t)&&!me(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),he(e.lineSpace,"selectstart",(function(t){Sn(e,t)||we(t)})),he(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),he(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Vs.prototype.createField=function(e){this.wrapper=Fs(),this.textarea=this.wrapper.firstChild},Vs.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Vs.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=vr(e);if(e.options.moveInputWithCursor){var i=Kn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+s.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+s.left-o.left))}return r},Vs.prototype.showSelection=function(e){var t=this.cm.display;L(t.cursorDiv,e.cursors),L(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Vs.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&P(this.textarea),s&&a>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&a>=9&&(this.hasSelection=null))}},Vs.prototype.getField=function(){return this.textarea},Vs.prototype.supportsTouch=function(){return!1},Vs.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||W()!=this.textarea))try{this.textarea.focus()}catch(e){}},Vs.prototype.blur=function(){this.textarea.blur()},Vs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Vs.prototype.receivedFocus=function(){this.slowPoll()},Vs.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Vs.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Vs.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||We(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(s&&a>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Vs.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Vs.prototype.onKeyPress=function(){s&&a>=9&&(this.hasSelection=null),this.fastPoll()},Vs.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=ur(n,e),u=r.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ei(n,Qi)(n.doc,_i(o),U);var c,d=i.style.cssText,f=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=window.scrollY),r.input.focus(),l&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),s&&a>=9&&g(),C){Se(e);var m=function(){fe(window,"mouseup",m),setTimeout(v,20)};he(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,i.style.cssText=d,s&&a<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart)){(!s||s&&a<9)&&g();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?ei(n,ao)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},Vs.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Vs.prototype.setUneditable=function(){},Vs.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Ss&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Ss,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Oi(e)}),!0),n("indentUnit",2,Oi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Ni(e),In(e),hr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(et(r,o))}r++}));for(var i=n.length-1;i>=0;i--)mo(e.doc,t,n[i],et(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Ss&&e.refresh()})),n("specialCharPlaceholder",Jt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!b),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){xs(e),mi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=$o(t),i=n!=Ss&&$o(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ms,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=fi(t,e.options.lineNumbers),mi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?sr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return zr(e)}),!0),n("scrollbarStyle","native",(function(e){Br(e),zr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=fi(e.options.gutters,t),mi(e)}),!0),n("firstLineNumber",1,mi,!0),n("lineNumberFormatter",(function(e){return e}),mi,!0),n("showCursorWhenSelecting",!1,gr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(_r(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,_s),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gr,!0),n("singleCursorHeightPerLine",!0,gr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ni,!0),n("addModeClass",!1,Ni,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Ni,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Ts),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&ei(this,t[e])(this,n,i),pe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"]($o(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(Ds(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Nr(this));else{var o=i.from(),s=i.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;l0&&$i(this.doc,r,new Ci(o,u[r].to()),U)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=at(this.doc,e);var t,n=dt(this,je(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var s=r+i>>1;if((s?n[2*s-1]:0)>=o)i=s;else{if(!(n[2*s+1]o&&(e=o,i=!0),r=je(this.doc,e)}else r=e;return Bn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Gt(r):0)},defaultTextHeight:function(){return rr(this.display)},defaultCharWidth:function(){return ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,s,a,l=this.display,u=(e=Kn(this,at(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==r)u=e.top;else if("above"==r||"near"==r){var h=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>h)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=h&&(u=e.bottom),c+t.offsetWidth>d&&(c=d-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==i?(c=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(o=this,s={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(a=Dr(o,s)).scrollTop&&Pr(o,a.scrollTop),null!=a.scrollLeft&&Fr(o,a.scrollLeft))},triggerOnKeyDown:ti(cs),triggerOnKeyPress:ti(ds),triggerOnKeyUp:hs,triggerOnMouseDown:ti(gs),execCommand:function(e){if(ts.hasOwnProperty(e))return ts[e].call(null,this)},triggerElectric:ti((function(e){Ys(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=at(this.doc,e),s=0;s0&&s(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&lr(this),pe(this,"refresh",this)})),swapDoc:ti((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Pi(this,e),In(this),this.display.input.reset(),Wr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ye(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(Ts);var js="iter insert remove copy getEditor constructor".split(" ");for(var Ks in No.prototype)No.prototype.hasOwnProperty(Ks)&&I(js,Ks)<0&&(Ts.prototype[Ks]=function(e){return function(){return e.apply(this.doc,arguments)}}(No.prototype[Ks]));return ye(No),Ts.inputStyles={textarea:Vs,contenteditable:Is},Ts.defineMode=function(e){Ts.defaults.mode||"null"==e||(Ts.defaults.mode=e),Fe.apply(this,arguments)},Ts.defineMIME=function(e,t){He[e]=t},Ts.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ts.defineMIME("text/plain","null"),Ts.defineExtension=function(e,t){Ts.prototype[e]=t},Ts.defineDocExtension=function(e,t){No.prototype[e]=t},Ts.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 n=W();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=a.getValue()}var i;if(e.form&&(he(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var s=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=s}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(fe(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var a=Ts((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return a},function(e){e.off=fe,e.on=he,e.wheelEventPixels=bi,e.Doc=No,e.splitLines=Ne,e.countColumn=R,e.findColumn=V,e.isWordChar=Q,e.Pass=z,e.signal=pe,e.Line=jt,e.changeEnd=Mi,e.scrollbarModel=Gr,e.Pos=et,e.cmpPos=tt,e.modes=Pe,e.mimeModes=He,e.resolveMode=Re,e.getMode=Ee,e.modeExtensions=Ie,e.extendMode=ze,e.copyState=Ue,e.startState=Be,e.innerMode=Ge,e.commands=ts,e.keyMap=Go,e.keyName=Xo,e.isModifierKey=Ko,e.lookupKey=jo,e.normalizeKeyMap=Vo,e.StringStream=Ve,e.SharedTextMarker=To,e.TextMarker=_o,e.LineWidget=So,e.e_preventDefault=we,e.e_stopPropagation=be,e.e_stop=Se,e.addClass=A,e.contains=N,e.rmClass=M,e.keyNames=Eo}(Ts),Ts.version="5.58.1",Ts},"object"==typeof n&&void 0!==t?t.exports=i():"function"==typeof define&&define.amd?define(i):(r=r||self).CodeMirror=i()},{}],moment:[function(e,t,n){var r,i;r=this,i=function(){"use strict";var n,r;function i(){return n.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function s(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(a(e,t))return!1;return!0}function u(e){return void 0===e}function c(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function h(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function d(e,t){var n,r=[];for(n=0;n>>0;for(t=0;t0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}i.suppressDeprecationWarnings=!1,i.deprecationHandler=null,_=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)a(e,t)&&n.push(t);return n};var W=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,A=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Y={},P={};function H(e,t,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),e&&(P[e]=i),t&&(P[t[0]]=function(){return N(i.apply(this,arguments),t[1],t[2])}),n&&(P[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function F(e,t){return e.isValid()?(t=R(t,e.localeData()),Y[t]=Y[t]||function(e){var t,n,r,i=e.match(W);for(t=0,n=i.length;t=0&&A.test(e);)e=e.replace(A,r),A.lastIndex=0,n-=1;return e}var E={};function I(e,t){var n=e.toLowerCase();E[n]=E[n+"s"]=E[t]=e}function z(e){return"string"==typeof e?E[e]||E[e.toLowerCase()]:void 0}function U(e){var t,n,r={};for(n in e)a(e,n)&&(t=z(n))&&(r[t]=e[n]);return r}var G={};function B(e,t){G[e]=t}function V(e){return e%4==0&&e%100!=0||e%400==0}function j(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function K(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=j(t)),n}function Z(e,t){return function(n){return null!=n?($(this,e,n),i.updateOffset(this,t),this):X(this,e)}}function X(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function $(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&V(e.year())&&1===e.month()&&29===e.date()?(n=K(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Se(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var q,J=/\d/,Q=/\d\d/,ee=/\d{3}/,te=/\d{4}/,ne=/[+-]?\d{6}/,re=/\d\d?/,ie=/\d\d\d\d?/,oe=/\d\d\d\d\d\d?/,se=/\d{1,3}/,ae=/\d{1,4}/,le=/[+-]?\d{1,6}/,ue=/\d+/,ce=/[+-]?\d+/,he=/Z|[+-]\d\d:?\d\d/gi,de=/Z|[+-]\d\d(?::?\d\d)?/gi,fe=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function pe(e,t,n){q[e]=L(t)?t:function(e,r){return e&&n?n:t}}function me(e,t){return a(q,e)?q[e](t._strict,t._locale):new RegExp(ge(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,r,i){return t||n||r||i}))))}function ge(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}q={};var ve,ye={};function we(e,t){var n,r=t;for("string"==typeof e&&(e=[e]),c(t)&&(r=function(e,n){n[t]=K(e)}),n=0;n68?1900:2e3)};var Ae=Z("FullYear",!0);function Ye(e,t,n,r,i,o,s){var a;return e<100&&e>=0?(a=new Date(e+400,t,n,r,i,o,s),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,n,r,i,o,s),a}function Pe(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function He(e,t,n){var r=7+t-n;return-(7+Pe(e,0,r).getUTCDay()-t)%7+r-1}function Fe(e,t,n,r,i){var o,s,a=1+7*(t-1)+(7+n-r)%7+He(e,r,i);return a<=0?s=We(o=e-1)+a:a>We(e)?(o=e+1,s=a-We(e)):(o=e,s=a),{year:o,dayOfYear:s}}function Re(e,t,n){var r,i,o=He(e.year(),t,n),s=Math.floor((e.dayOfYear()-o-1)/7)+1;return s<1?r=s+Ee(i=e.year()-1,t,n):s>Ee(e.year(),t,n)?(r=s-Ee(e.year(),t,n),i=e.year()+1):(i=e.year(),r=s),{week:r,year:i}}function Ee(e,t,n){var r=He(e,t,n),i=He(e+1,t,n);return(We(e)-r+i)/7}function Ie(e,t){return e.slice(t,7).concat(e.slice(0,t))}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),I("week","w"),I("isoWeek","W"),B("week",5),B("isoWeek",5),pe("w",re),pe("ww",re,Q),pe("W",re),pe("WW",re,Q),be(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=K(e)})),H("d",0,"do","day"),H("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),H("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),H("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),I("day","d"),I("weekday","e"),I("isoWeekday","E"),B("day",11),B("weekday",11),B("isoWeekday",11),pe("d",re),pe("e",re),pe("E",re),pe("dd",(function(e,t){return t.weekdaysMinRegex(e)})),pe("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),pe("dddd",(function(e,t){return t.weekdaysRegex(e)})),be(["dd","ddd","dddd"],(function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);null!=i?t.d=i:m(n).invalidWeekday=e})),be(["d","e","E"],(function(e,t,n,r){t[r]=K(e)}));var ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ue="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ge="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Be=fe,Ve=fe,je=fe;function Ke(e,t,n){var r,i,o,s=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=ve.call(this._weekdaysParse,s))?i:null:"ddd"===t?-1!==(i=ve.call(this._shortWeekdaysParse,s))?i:null:-1!==(i=ve.call(this._minWeekdaysParse,s))?i:null:"dddd"===t?-1!==(i=ve.call(this._weekdaysParse,s))||-1!==(i=ve.call(this._shortWeekdaysParse,s))||-1!==(i=ve.call(this._minWeekdaysParse,s))?i:null:"ddd"===t?-1!==(i=ve.call(this._shortWeekdaysParse,s))||-1!==(i=ve.call(this._weekdaysParse,s))||-1!==(i=ve.call(this._minWeekdaysParse,s))?i:null:-1!==(i=ve.call(this._minWeekdaysParse,s))||-1!==(i=ve.call(this._weekdaysParse,s))||-1!==(i=ve.call(this._shortWeekdaysParse,s))?i:null}function Ze(){function e(e,t){return t.length-e.length}var t,n,r,i,o,s=[],a=[],l=[],u=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),r=ge(this.weekdaysMin(n,"")),i=ge(this.weekdaysShort(n,"")),o=ge(this.weekdays(n,"")),s.push(r),a.push(i),l.push(o),u.push(r),u.push(i),u.push(o);s.sort(e),a.sort(e),l.sort(e),u.sort(e),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Xe(){return this.hours()%12||12}function $e(e,t){H(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function qe(e,t){return t._meridiemParse}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Xe),H("k",["kk",2],0,(function(){return this.hours()||24})),H("hmm",0,0,(function(){return""+Xe.apply(this)+N(this.minutes(),2)})),H("hmmss",0,0,(function(){return""+Xe.apply(this)+N(this.minutes(),2)+N(this.seconds(),2)})),H("Hmm",0,0,(function(){return""+this.hours()+N(this.minutes(),2)})),H("Hmmss",0,0,(function(){return""+this.hours()+N(this.minutes(),2)+N(this.seconds(),2)})),$e("a",!0),$e("A",!1),I("hour","h"),B("hour",13),pe("a",qe),pe("A",qe),pe("H",re),pe("h",re),pe("k",re),pe("HH",re,Q),pe("hh",re,Q),pe("kk",re,Q),pe("hmm",ie),pe("hmmss",oe),pe("Hmm",ie),pe("Hmmss",oe),we(["H","HH"],3),we(["k","kk"],(function(e,t,n){var r=K(e);t[3]=24===r?0:r})),we(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),we(["h","hh"],(function(e,t,n){t[3]=K(e),m(n).bigHour=!0})),we("hmm",(function(e,t,n){var r=e.length-2;t[3]=K(e.substr(0,r)),t[4]=K(e.substr(r)),m(n).bigHour=!0})),we("hmmss",(function(e,t,n){var r=e.length-4,i=e.length-2;t[3]=K(e.substr(0,r)),t[4]=K(e.substr(r,2)),t[5]=K(e.substr(i)),m(n).bigHour=!0})),we("Hmm",(function(e,t,n){var r=e.length-2;t[3]=K(e.substr(0,r)),t[4]=K(e.substr(r))})),we("Hmmss",(function(e,t,n){var r=e.length-4,i=e.length-2;t[3]=K(e.substr(0,r)),t[4]=K(e.substr(r,2)),t[5]=K(e.substr(i))}));var Je,Qe=Z("Hours",!0),et={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Ce,monthsShort:ke,week:{dow:0,doy:6},weekdays:ze,weekdaysMin:Ge,weekdaysShort:Ue,meridiemParse:/[ap]\.?m?\.?/i},tt={},nt={};function rt(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n0;){if(r=ot(i.slice(0,t).join("-")))return r;if(n&&n.length>=t&&rt(i,n)>=t-1)break;t--}o++}return Je}(e)}function ut(e){var t,n=e._a;return n&&-2===m(e).overflow&&(t=n[1]<0||n[1]>11?1:n[2]<1||n[2]>Se(n[0],n[1])?2:n[3]<0||n[3]>24||24===n[3]&&(0!==n[4]||0!==n[5]||0!==n[6])?3:n[4]<0||n[4]>59?4:n[5]<0||n[5]>59?5:n[6]<0||n[6]>999?6:-1,m(e)._overflowDayOfYear&&(t<0||t>2)&&(t=2),m(e)._overflowWeeks&&-1===t&&(t=7),m(e)._overflowWeekday&&-1===t&&(t=8),m(e).overflow=t),e}var ct=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ht=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,dt=/Z|[+-]\d\d(?::?\d\d)?/,ft=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],pt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],mt=/^\/?Date\((-?\d+)/i,gt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,vt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function yt(e){var t,n,r,i,o,s,a=e._i,l=ct.exec(a)||ht.exec(a);if(l){for(m(e).iso=!0,t=0,n=ft.length;t7)&&(l=!0)):(o=e._locale._week.dow,s=e._locale._week.doy,u=Re(Mt(),o,s),n=xt(t.gg,e._a[0],u.year),r=xt(t.w,u.week),null!=t.d?((i=t.d)<0||i>6)&&(l=!0):null!=t.e?(i=t.e+o,(t.e<0||t.e>6)&&(l=!0)):i=o),r<1||r>Ee(n,o,s)?m(e)._overflowWeeks=!0:null!=l?m(e)._overflowWeekday=!0:(a=Fe(n,r,i,o,s),e._a[0]=a.year,e._dayOfYear=a.dayOfYear)}(e),null!=e._dayOfYear&&(s=xt(e._a[0],r[0]),(e._dayOfYear>We(s)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),n=Pe(s,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=r[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?Pe:Ye).apply(null,a),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(m(e).weekdayMismatch=!0)}}function Ct(e){if(e._f!==i.ISO_8601)if(e._f!==i.RFC_2822){e._a=[],m(e).empty=!0;var t,n,r,o,s,a,l=""+e._i,u=l.length,c=0;for(r=R(e._f,e._locale).match(W)||[],t=0;t0&&m(e).unusedInput.push(s),l=l.slice(l.indexOf(n)+n.length),c+=n.length),P[o]?(n?m(e).empty=!1:m(e).unusedTokens.push(o),xe(o,n,e)):e._strict&&!n&&m(e).unusedTokens.push(o);m(e).charsLeftOver=u-c,l.length>0&&m(e).unusedInput.push(l),e._a[3]<=12&&!0===m(e).bigHour&&e._a[3]>0&&(m(e).bigHour=void 0),m(e).parsedDateParts=e._a.slice(0),m(e).meridiem=e._meridiem,e._a[3]=function(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}(e._locale,e._a[3],e._meridiem),null!==(a=m(e).era)&&(e._a[0]=e._locale.erasConvertYear(a,e._a[0])),St(e),ut(e)}else bt(e);else yt(e)}function kt(e){var t=e._i,n=e._f;return e._locale=e._locale||lt(e._l),null===t||void 0===n&&""===t?v({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),S(t)?new x(ut(t)):(h(t)?e._d=t:o(n)?function(e){var t,n,r,i,o,s,a=!1;if(0===e._f.length)return m(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;ithis?this:e:v()}));function Dt(e,t){var n,r;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Mt();for(n=t[0],r=1;r=0?new Date(e+400,t,n)-126227808e5:new Date(e,t,n).valueOf()}function on(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-126227808e5:Date.UTC(e,t,n)}function sn(e,t){return t.erasAbbrRegex(e)}function an(){var e,t,n=[],r=[],i=[],o=[],s=this.eras();for(e=0,t=s.length;e(o=Ee(e,r,i))&&(t=o),cn.call(this,e,t,n,r,i))}function cn(e,t,n,r,i){var o=Fe(e,t,n,r,i),s=Pe(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),pe("N",sn),pe("NN",sn),pe("NNN",sn),pe("NNNN",(function(e,t){return t.erasNameRegex(e)})),pe("NNNNN",(function(e,t){return t.erasNarrowRegex(e)})),we(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?m(n).era=i:m(n).invalidEra=e})),pe("y",ue),pe("yy",ue),pe("yyy",ue),pe("yyyy",ue),pe("yo",(function(e,t){return t._eraYearOrdinalRegex||ue})),we(["y","yy","yyy","yyyy"],0),we(["yo"],(function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[0]=n._locale.eraYearOrdinalParse(e,i):t[0]=parseInt(e,10)})),H(0,["gg",2],0,(function(){return this.weekYear()%100})),H(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),ln("gggg","weekYear"),ln("ggggg","weekYear"),ln("GGGG","isoWeekYear"),ln("GGGGG","isoWeekYear"),I("weekYear","gg"),I("isoWeekYear","GG"),B("weekYear",1),B("isoWeekYear",1),pe("G",ce),pe("g",ce),pe("GG",re,Q),pe("gg",re,Q),pe("GGGG",ae,te),pe("gggg",ae,te),pe("GGGGG",le,ne),pe("ggggg",le,ne),be(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=K(e)})),be(["gg","GG"],(function(e,t,n,r){t[r]=i.parseTwoDigitYear(e)})),H("Q",0,"Qo","quarter"),I("quarter","Q"),B("quarter",7),pe("Q",J),we("Q",(function(e,t){t[1]=3*(K(e)-1)})),H("D",["DD",2],"Do","date"),I("date","D"),B("date",9),pe("D",re),pe("DD",re,Q),pe("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),we(["D","DD"],2),we("Do",(function(e,t){t[2]=K(e.match(re)[0])}));var hn=Z("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),I("dayOfYear","DDD"),B("dayOfYear",4),pe("DDD",se),pe("DDDD",ee),we(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=K(e)})),H("m",["mm",2],0,"minute"),I("minute","m"),B("minute",14),pe("m",re),pe("mm",re,Q),we(["m","mm"],4);var dn=Z("Minutes",!1);H("s",["ss",2],0,"second"),I("second","s"),B("second",15),pe("s",re),pe("ss",re,Q),we(["s","ss"],5);var fn,pn,mn=Z("Seconds",!1);for(H("S",0,0,(function(){return~~(this.millisecond()/100)})),H(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),H(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),H(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),H(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),H(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),H(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),I("millisecond","ms"),B("millisecond",16),pe("S",se,J),pe("SS",se,Q),pe("SSS",se,ee),fn="SSSS";fn.length<=9;fn+="S")pe(fn,ue);function gn(e,t){t[6]=K(1e3*("0."+e))}for(fn="S";fn.length<=9;fn+="S")we(fn,gn);pn=Z("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var vn=x.prototype;function yn(e){return e}vn.add=Kt,vn.calendar=function(e,t){1===arguments.length&&(arguments[0]?$t(arguments[0])?(e=arguments[0],t=void 0):qt(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||Mt(),r=Ft(n,this).startOf("day"),o=i.calendarFormat(this,r)||"sameElse",s=t&&(L(t[o])?t[o].call(this,n):t[o]);return this.format(s||this.localeData().calendar(o,this,Mt(n)))},vn.clone=function(){return new x(this)},vn.diff=function(e,t,n){var r,i,o;if(!this.isValid())return NaN;if(!(r=Ft(e,this)).isValid())return NaN;switch(i=6e4*(r.utcOffset()-this.utcOffset()),t=z(t)){case"year":o=Jt(this,r)/12;break;case"month":o=Jt(this,r);break;case"quarter":o=Jt(this,r)/3;break;case"second":o=(this-r)/1e3;break;case"minute":o=(this-r)/6e4;break;case"hour":o=(this-r)/36e5;break;case"day":o=(this-r-i)/864e5;break;case"week":o=(this-r-i)/6048e5;break;default:o=this-r}return n?o:j(o)},vn.endOf=function(e){var t,n;if(void 0===(e=z(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?on:rn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-nn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-nn(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-nn(t,1e3)-1}return this._d.setTime(t),i.updateOffset(this,!0),this},vn.format=function(e){e||(e=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var t=F(this,e);return this.localeData().postformat(t)},vn.from=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Mt(e).isValid())?Ut({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},vn.fromNow=function(e){return this.from(Mt(),e)},vn.to=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Mt(e).isValid())?Ut({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},vn.toNow=function(e){return this.to(Mt(),e)},vn.get=function(e){return L(this[e=z(e)])?this[e]():this},vn.invalidAt=function(){return m(this).overflow},vn.isAfter=function(e,t){var n=S(e)?e:Mt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=z(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()9999?F(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):L(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",F(n,"Z")):F(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},vn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,r="moment",i="";return this.isLocal()||(r=0===this.utcOffset()?"moment.utc":"moment.parseZone",i="Z"),e="["+r+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n=i+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+n)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(vn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),vn.toJSON=function(){return this.isValid()?this.toISOString():null},vn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},vn.unix=function(){return Math.floor(this.valueOf()/1e3)},vn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},vn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},vn.eraName=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;ethis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},vn.isLocal=function(){return!!this.isValid()&&!this._isUTC},vn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},vn.isUtc=Et,vn.isUTC=Et,vn.zoneAbbr=function(){return this._isUTC?"UTC":""},vn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},vn.dates=k("dates accessor is deprecated. Use date instead.",hn),vn.months=k("months accessor is deprecated. Use month instead",Oe),vn.years=k("years accessor is deprecated. Use year instead",Ae),vn.zone=k("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),vn.isDSTShifted=k("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!u(this._isDSTShifted))return this._isDSTShifted;var e,t={};return b(t,this),(t=kt(t))._a?(e=t._isUTC?p(t._a):Mt(t._a),this._isDSTShifted=this.isValid()&&function(e,t,n){var r,i=Math.min(e.length,t.length),o=Math.abs(e.length-t.length),s=0;for(r=0;r0):this._isDSTShifted=!1,this._isDSTShifted}));var wn=O.prototype;function bn(e,t,n,r){var i=lt(),o=p().set(r,t);return i[n](o,e)}function xn(e,t,n){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return bn(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=bn(e,r,n,"month");return i}function Sn(e,t,n,r){"boolean"==typeof e?(c(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,c(t)&&(n=t,t=void 0),t=t||"");var i,o=lt(),s=e?o._week.dow:0,a=[];if(null!=n)return bn(t,(n+s)%7,r,"day");for(i=0;i<7;i++)a[i]=bn(t,(i+s)%7,r,"day");return a}wn.calendar=function(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return L(r)?r.call(t,n):r},wn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(W).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])},wn.invalidDate=function(){return this._invalidDate},wn.ordinal=function(e){return this._ordinal.replace("%d",e)},wn.preparse=yn,wn.postformat=yn,wn.relativeTime=function(e,t,n,r){var i=this._relativeTime[n];return L(i)?i(e,t,n,r):i.replace(/%d/i,e)},wn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return L(n)?n(t):n.replace(/%s/i,t)},wn.set=function(e){var t,n;for(n in e)a(e,n)&&(L(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},wn.eras=function(e,t){var n,r,o,s=this._eras||lt("en")._eras;for(n=0,r=s.length;n=0)return l[r]},wn.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?i(e.since).year():i(e.since).year()+(t-e.offset)*n},wn.erasAbbrRegex=function(e){return a(this,"_erasAbbrRegex")||an.call(this),e?this._erasAbbrRegex:this._erasRegex},wn.erasNameRegex=function(e){return a(this,"_erasNameRegex")||an.call(this),e?this._erasNameRegex:this._erasRegex},wn.erasNarrowRegex=function(e){return a(this,"_erasNarrowRegex")||an.call(this),e?this._erasNarrowRegex:this._erasRegex},wn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||_e).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},wn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[_e.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},wn.monthsParse=function(e,t,n){var r,i,o;if(this._monthsParseExact)return Le.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}},wn.monthsRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Ne.call(this),e?this._monthsStrictRegex:this._monthsRegex):(a(this,"_monthsRegex")||(this._monthsRegex=Te),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},wn.monthsShortRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Ne.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(a(this,"_monthsShortRegex")||(this._monthsShortRegex=Me),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},wn.week=function(e){return Re(e,this._week.dow,this._week.doy).week},wn.firstDayOfYear=function(){return this._week.doy},wn.firstDayOfWeek=function(){return this._week.dow},wn.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ie(n,this._week.dow):e?n[e.day()]:n},wn.weekdaysMin=function(e){return!0===e?Ie(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},wn.weekdaysShort=function(e){return!0===e?Ie(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},wn.weekdaysParse=function(e,t,n){var r,i,o;if(this._weekdaysParseExact)return Ke.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}},wn.weekdaysRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Ze.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Be),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},wn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Ze.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ve),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},wn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Ze.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=je),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},wn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},wn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},st("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===K(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),i.lang=k("moment.lang is deprecated. Use moment.locale instead.",st),i.langData=k("moment.langData is deprecated. Use moment.localeData instead.",lt);var Cn=Math.abs;function kn(e,t,n,r){var i=Ut(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function _n(e){return e<0?Math.floor(e):Math.ceil(e)}function Mn(e){return 4800*e/146097}function Tn(e){return 146097*e/4800}function Ln(e){return function(){return this.as(e)}}var Dn=Ln("ms"),On=Ln("s"),Nn=Ln("m"),Wn=Ln("h"),An=Ln("d"),Yn=Ln("w"),Pn=Ln("M"),Hn=Ln("Q"),Fn=Ln("y");function Rn(e){return function(){return this.isValid()?this._data[e]:NaN}}var En=Rn("milliseconds"),In=Rn("seconds"),zn=Rn("minutes"),Un=Rn("hours"),Gn=Rn("days"),Bn=Rn("months"),Vn=Rn("years"),jn=Math.round,Kn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Zn(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}var Xn=Math.abs;function $n(e){return(e>0)-(e<0)||+e}function qn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,i,o,s,a,l=Xn(this._milliseconds)/1e3,u=Xn(this._days),c=Xn(this._months),h=this.asSeconds();return h?(e=j(l/60),t=j(e/60),l%=60,e%=60,n=j(c/12),c%=12,r=l?l.toFixed(3).replace(/\.?0+$/,""):"",i=h<0?"-":"",o=$n(this._months)!==$n(h)?"-":"",s=$n(this._days)!==$n(h)?"-":"",a=$n(this._milliseconds)!==$n(h)?"-":"",i+"P"+(n?o+n+"Y":"")+(c?o+c+"M":"")+(u?s+u+"D":"")+(t||e||l?"T":"")+(t?a+t+"H":"")+(e?a+e+"M":"")+(l?a+r+"S":"")):"P0D"}var Jn=Nt.prototype;return Jn.isValid=function(){return this._isValid},Jn.abs=function(){var e=this._data;return this._milliseconds=Cn(this._milliseconds),this._days=Cn(this._days),this._months=Cn(this._months),e.milliseconds=Cn(e.milliseconds),e.seconds=Cn(e.seconds),e.minutes=Cn(e.minutes),e.hours=Cn(e.hours),e.months=Cn(e.months),e.years=Cn(e.years),this},Jn.add=function(e,t){return kn(this,e,t,1)},Jn.subtract=function(e,t){return kn(this,e,t,-1)},Jn.as=function(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=z(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+Mn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Tn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}},Jn.asMilliseconds=Dn,Jn.asSeconds=On,Jn.asMinutes=Nn,Jn.asHours=Wn,Jn.asDays=An,Jn.asWeeks=Yn,Jn.asMonths=Pn,Jn.asQuarters=Hn,Jn.asYears=Fn,Jn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*K(this._months/12):NaN},Jn._bubble=function(){var e,t,n,r,i,o=this._milliseconds,s=this._days,a=this._months,l=this._data;return o>=0&&s>=0&&a>=0||o<=0&&s<=0&&a<=0||(o+=864e5*_n(Tn(a)+s),s=0,a=0),l.milliseconds=o%1e3,e=j(o/1e3),l.seconds=e%60,t=j(e/60),l.minutes=t%60,n=j(t/60),l.hours=n%24,s+=j(n/24),a+=i=j(Mn(s)),s-=_n(Tn(i)),r=j(a/12),a%=12,l.days=s,l.months=a,l.years=r,this},Jn.clone=function(){return Ut(this)},Jn.get=function(e){return e=z(e),this.isValid()?this[e+"s"]():NaN},Jn.milliseconds=En,Jn.seconds=In,Jn.minutes=zn,Jn.hours=Un,Jn.days=Gn,Jn.weeks=function(){return j(this.days()/7)},Jn.months=Bn,Jn.years=Vn,Jn.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,i=!1,o=Kn;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(o=Object.assign({},Kn,t),null!=t.s&&null==t.ss&&(o.ss=t.s-1)),r=function(e,t,n,r){var i=Ut(e).abs(),o=jn(i.as("s")),s=jn(i.as("m")),a=jn(i.as("h")),l=jn(i.as("d")),u=jn(i.as("M")),c=jn(i.as("w")),h=jn(i.as("y")),d=o<=n.ss&&["s",o]||o0,d[4]=r,Zn.apply(null,d)}(this,!i,o,n=this.localeData()),i&&(r=n.pastFuture(+this,r)),n.postformat(r)},Jn.toISOString=qn,Jn.toString=qn,Jn.toJSON=qn,Jn.locale=Qt,Jn.localeData=tn,Jn.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",qn),Jn.lang=en,H("X",0,0,"unix"),H("x",0,0,"valueOf"),pe("x",ce),pe("X",/[+-]?\d+(\.\d{1,3})?/),we("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),we("x",(function(e,t,n){n._d=new Date(K(e))})), //! moment.js i.version="2.29.1",n=Mt,i.fn=vn,i.min=function(){var e=[].slice.call(arguments,0);return Dt("isBefore",e)},i.max=function(){var e=[].slice.call(arguments,0);return Dt("isAfter",e)},i.now=function(){return Date.now?Date.now():+new Date},i.utc=p,i.unix=function(e){return Mt(1e3*e)},i.months=function(e,t){return xn(e,t,"months")},i.isDate=h,i.locale=st,i.invalid=v,i.duration=Ut,i.isMoment=S,i.weekdays=function(e,t,n){return Sn(e,t,n,"weekdays")},i.parseZone=function(){return Mt.apply(null,arguments).parseZone()},i.localeData=lt,i.isDuration=Wt,i.monthsShort=function(e,t){return xn(e,t,"monthsShort")},i.weekdaysMin=function(e,t,n){return Sn(e,t,n,"weekdaysMin")},i.defineLocale=at,i.updateLocale=function(e,t){if(null!=t){var n,r,i=et;null!=tt[e]&&null!=tt[e].parentLocale?tt[e].set(D(tt[e]._config,t)):(null!=(r=ot(e))&&(i=r._config),t=D(i,t),null==r&&(t.abbr=e),(n=new O(t)).parentLocale=tt[e],tt[e]=n),st(e)}else null!=tt[e]&&(null!=tt[e].parentLocale?(tt[e]=tt[e].parentLocale,e===st()&&st(e)):null!=tt[e]&&delete tt[e]);return tt[e]},i.locales=function(){return _(tt)},i.weekdaysShort=function(e,t,n){return Sn(e,t,n,"weekdaysShort")},i.normalizeUnits=z,i.relativeTimeRounding=function(e){return void 0===e?jn:"function"==typeof e&&(jn=e,!0)},i.relativeTimeThreshold=function(e,t){return void 0!==Kn[e]&&(void 0===t?Kn[e]:(Kn[e]=t,"s"===e&&(Kn.ss=t-1),!0))},i.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},i.prototype=vn,i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},i},"object"==typeof n&&void 0!==t?t.exports=i():"function"==typeof define&&define.amd?define(i):r.moment=i()},{}]},{},[]);