vendors~main.30b401dc6cf9cde03deb.js 355 KB

123456
  1. (window.webpackJsonpivprogCore=window.webpackJsonpivprogCore||[]).push([[1],[,function(t,e,n){t.exports=n(89)},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e){function n(t,e,n,r,i,o,s){try{var a=t[o](s),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(r,i)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var s=t.apply(e,r);function a(t){n(s,i,o,a,l,"next",t)}function l(t){n(s,i,o,a,l,"throw",t)}a(void 0)}))}}},,function(t,e,n){var r=n(49);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},function(t,e,n){var r=n(88),i=n(31);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?i(t):e}},,,,,,function(t,e,n){var r;!function(i){"use strict";var o,s,a,l=9e15,u="0123456789abcdef",c="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",h="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",p={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-l,maxE:l,crypto:!1},f=!0,d="[DecimalError] Invalid argument: ",g=Math.floor,v=Math.pow,m=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,y=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,x=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,S=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,b=1e7,T=c.length-1,C=h.length-1,w={name:"[object Decimal]"};function E(t){var e,n,r,i=t.length-1,o="",s=t[0];if(i>0){for(o+=s,e=1;e<i;e++)(n=7-(r=t[e]+"").length)&&(o+=R(n)),o+=r;(n=7-(r=(s=t[e])+"").length)&&(o+=R(n))}else if(0===s)return"0";for(;s%10==0;)s/=10;return o+s}function A(t,e,n){if(t!==~~t||t<e||t>n)throw Error(d+t)}function L(t,e,n,r){var i,o,s,a;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=7,i=0):(i=Math.ceil((e+1)/7),e%=7),o=v(10,7-e),a=t[i]%o|0,null==r?e<3?(0==e?a=a/100|0:1==e&&(a=a/10|0),s=n<4&&99999==a||n>3&&49999==a||5e4==a||0==a):s=(n<4&&a+1==o||n>3&&a+1==o/2)&&(t[i+1]/o/100|0)==v(10,e-2)-1||(a==o/2||0==a)&&0==(t[i+1]/o/100|0):e<4?(0==e?a=a/1e3|0:1==e?a=a/100|0:2==e&&(a=a/10|0),s=(r||n<4)&&9999==a||!r&&n>3&&4999==a):s=((r||n<4)&&a+1==o||!r&&n>3&&a+1==o/2)&&(t[i+1]/o/1e3|0)==v(10,e-3)-1,s}function N(t,e,n){for(var r,i,o=[0],s=0,a=t.length;s<a;){for(i=o.length;i--;)o[i]*=e;for(o[0]+=u.indexOf(t.charAt(s++)),r=0;r<o.length;r++)o[r]>n-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}w.absoluteValue=w.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),O(t)},w.ceil=function(){return O(new this.constructor(this),this.e+1,2)},w.comparedTo=w.cmp=function(t){var e,n,r,i,o=this,s=o.d,a=(t=new o.constructor(t)).d,l=o.s,u=t.s;if(!s||!a)return l&&u?l!==u?l:s===a?0:!s^l<0?1:-1:NaN;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==t.e)return o.e>t.e^l<0?1:-1;for(e=0,n=(r=s.length)<(i=a.length)?r:i;e<n;++e)if(s[e]!==a[e])return s[e]>a[e]^l<0?1:-1;return r===i?0:r>i^l<0?1:-1},w.cosine=w.cos=function(){var t,e,n=this,r=n.constructor;return n.d?n.d[0]?(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(t,e){var n,r,i=e.d.length;i<32?(n=Math.ceil(i/3),r=(1/G(4,n)).toString()):(n=16,r="2.3283064365386962890625e-10");t.precision+=n,e=q(t,1,e.times(r),new t(1));for(var o=n;o--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=n,e}(r,K(r,n)),r.precision=t,r.rounding=e,O(2==a||3==a?n.neg():n,t,e,!0)):new r(1):new r(NaN)},w.cubeRoot=w.cbrt=function(){var t,e,n,r,i,o,s,a,l,u,c=this,h=c.constructor;if(!c.isFinite()||c.isZero())return new h(c);for(f=!1,(o=c.s*v(c.s*c,1/3))&&Math.abs(o)!=1/0?r=new h(o.toString()):(n=E(c.d),(o=((t=c.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=v(n,1/3),t=g((t+1)/3)-(t%3==(t<0?-1:2)),(r=new h(n=o==1/0?"5e"+t:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+t)).s=c.s),s=(t=h.precision)+3;;)if(u=(l=(a=r).times(a).times(a)).plus(c),r=k(u.plus(c).times(a),u.plus(l),s+2,1),E(a.d).slice(0,s)===(n=E(r.d)).slice(0,s)){if("9999"!=(n=n.slice(s-3,s+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(O(r,t+1,1),e=!r.times(r).times(r).eq(c));break}if(!i&&(O(a,t+1,0),a.times(a).times(a).eq(c))){r=a;break}s+=4,i=1}return f=!0,O(r,t,h.rounding,e)},w.decimalPlaces=w.dp=function(){var t,e=this.d,n=NaN;if(e){if(n=7*((t=e.length-1)-g(this.e/7)),t=e[t])for(;t%10==0;t/=10)n--;n<0&&(n=0)}return n},w.dividedBy=w.div=function(t){return k(this,new this.constructor(t))},w.dividedToIntegerBy=w.divToInt=function(t){var e=this.constructor;return O(k(this,new e(t),0,1,1),e.precision,e.rounding)},w.equals=w.eq=function(t){return 0===this.cmp(t)},w.floor=function(){return O(new this.constructor(this),this.e+1,3)},w.greaterThan=w.gt=function(t){return this.cmp(t)>0},w.greaterThanOrEqualTo=w.gte=function(t){var e=this.cmp(t);return 1==e||0===e},w.hyperbolicCosine=w.cosh=function(){var t,e,n,r,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;n=s.precision,r=s.rounding,s.precision=n+Math.max(o.e,o.sd())+4,s.rounding=1,(i=o.d.length)<32?e=(1/G(4,t=Math.ceil(i/3))).toString():(t=16,e="2.3283064365386962890625e-10"),o=q(s,1,o.times(e),new s(1),!0);for(var l,u=t,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return O(o,s.precision=n,s.rounding=r,!0)},w.hyperbolicSine=w.sinh=function(){var t,e,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,n=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=q(o,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=q(o,2,i=i.times(1/G(5,t)),i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);t--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=e,o.rounding=n,O(i,e,n,!0)},w.hyperbolicTangent=w.tanh=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+7,r.rounding=1,k(n.sinh(),n.cosh(),r.precision=t,r.rounding=e)):new r(n.s)},w.inverseCosine=w.acos=function(){var t,e=this,n=e.constructor,r=e.abs().cmp(1),i=n.precision,o=n.rounding;return-1!==r?0===r?e.isNeg()?P(n,i,o):new n(0):new n(NaN):e.isZero()?P(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,e=e.asin(),t=P(n,i+4,o).times(.5),n.precision=i,n.rounding=o,t.minus(e))},w.inverseHyperbolicCosine=w.acosh=function(){var t,e,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(t=r.precision,e=r.rounding,r.precision=t+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,f=!1,n=n.times(n).minus(1).sqrt().plus(n),f=!0,r.precision=t,r.rounding=e,n.ln()):new r(n)},w.inverseHyperbolicSine=w.asinh=function(){var t,e,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,f=!1,n=n.times(n).plus(1).sqrt().plus(n),f=!0,r.precision=t,r.rounding=e,n.ln())},w.inverseHyperbolicTangent=w.atanh=function(){var t,e,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,e=o.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?O(new o(i),t,e,!0):(o.precision=n=r-i.e,i=k(i.plus(1),new o(1).minus(i),n+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=e,i.times(.5))):new o(NaN)},w.inverseSine=w.asin=function(){var t,e,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==e?0===e?((t=P(o,n+4,r).times(.5)).s=i.s,t):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},w.inverseTangent=w.atan=function(){var t,e,n,r,i,o,s,a,l,u=this,c=u.constructor,h=c.precision,p=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&h+4<=C)return(s=P(c,h+4,p).times(.25)).s=u.s,s}else{if(!u.s)return new c(NaN);if(h+4<=C)return(s=P(c,h+4,p).times(.5)).s=u.s,s}for(c.precision=a=h+10,c.rounding=1,t=n=Math.min(28,a/7+2|0);t;--t)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(f=!1,e=Math.ceil(a/7),r=1,l=u.times(u),s=new c(u),i=u;-1!==t;)if(i=i.times(l),o=s.minus(i.div(r+=2)),i=i.times(l),void 0!==(s=o.plus(i.div(r+=2))).d[e])for(t=e;s.d[t]===o.d[t]&&t--;);return n&&(s=s.times(2<<n-1)),f=!0,O(s,c.precision=h,c.rounding=p,!0)},w.isFinite=function(){return!!this.d},w.isInteger=w.isInt=function(){return!!this.d&&g(this.e/7)>this.d.length-2},w.isNaN=function(){return!this.s},w.isNegative=w.isNeg=function(){return this.s<0},w.isPositive=w.isPos=function(){return this.s>0},w.isZero=function(){return!!this.d&&0===this.d[0]},w.lessThan=w.lt=function(t){return this.cmp(t)<0},w.lessThanOrEqualTo=w.lte=function(t){return this.cmp(t)<1},w.logarithm=w.log=function(t){var e,n,r,i,o,s,a,l,u=this.constructor,c=u.precision,h=u.rounding;if(null==t)t=new u(10),e=!0;else{if(n=(t=new u(t)).d,t.s<0||!n||!n[0]||t.eq(1))return new u(NaN);e=t.eq(10)}if(n=this.d,this.s<0||!n||!n[0]||this.eq(1))return new u(n&&!n[0]?-1/0:1!=this.s?NaN:n?0:1/0);if(e)if(n.length>1)o=!0;else{for(i=n[0];i%10==0;)i/=10;o=1!==i}if(f=!1,s=j(this,a=c+5),r=e?M(u,a+10):j(t,a),L((l=k(s,r,a,1)).d,i=c,h))do{if(s=j(this,a+=10),r=e?M(u,a+10):j(t,a),l=k(s,r,a,1),!o){+E(l.d).slice(i+1,i+15)+1==1e14&&(l=O(l,c+1,0));break}}while(L(l.d,i+=10,h));return f=!0,O(l,c,h)},w.minus=w.sub=function(t){var e,n,r,i,o,s,a,l,u,c,h,p,d=this,v=d.constructor;if(t=new v(t),!d.d||!t.d)return d.s&&t.s?d.d?t.s=-t.s:t=new v(t.d||d.s!==t.s?d:NaN):t=new v(NaN),t;if(d.s!=t.s)return t.s=-t.s,d.plus(t);if(u=d.d,p=t.d,a=v.precision,l=v.rounding,!u[0]||!p[0]){if(p[0])t.s=-t.s;else{if(!u[0])return new v(3===l?-0:0);t=new v(d)}return f?O(t,a,l):t}if(n=g(t.e/7),c=g(d.e/7),u=u.slice(),o=c-n){for((h=o<0)?(e=u,o=-o,s=p.length):(e=p,n=c,s=u.length),o>(r=Math.max(Math.ceil(a/7),s)+2)&&(o=r,e.length=1),e.reverse(),r=o;r--;)e.push(0);e.reverse()}else{for((h=(r=u.length)<(s=p.length))&&(s=r),r=0;r<s;r++)if(u[r]!=p[r]){h=u[r]<p[r];break}o=0}for(h&&(e=u,u=p,p=e,t.s=-t.s),s=u.length,r=p.length-s;r>0;--r)u[s++]=0;for(r=p.length;r>o;){if(u[--r]<p[r]){for(i=r;i&&0===u[--i];)u[i]=b-1;--u[i],u[r]+=b}u[r]-=p[r]}for(;0===u[--s];)u.pop();for(;0===u[0];u.shift())--n;return u[0]?(t.d=u,t.e=I(u,n),f?O(t,a,l):t):new v(3===l?-0:0)},w.modulo=w.mod=function(t){var e,n=this,r=n.constructor;return t=new r(t),!n.d||!t.s||t.d&&!t.d[0]?new r(NaN):!t.d||n.d&&!n.d[0]?O(new r(n),r.precision,r.rounding):(f=!1,9==r.modulo?(e=k(n,t.abs(),0,3,1)).s*=t.s:e=k(n,t,0,r.modulo,1),e=e.times(t),f=!0,n.minus(e))},w.naturalExponential=w.exp=function(){return W(this)},w.naturalLogarithm=w.ln=function(){return j(this)},w.negated=w.neg=function(){var t=new this.constructor(this);return t.s=-t.s,O(t)},w.plus=w.add=function(t){var e,n,r,i,o,s,a,l,u,c,h=this,p=h.constructor;if(t=new p(t),!h.d||!t.d)return h.s&&t.s?h.d||(t=new p(t.d||h.s===t.s?h:NaN)):t=new p(NaN),t;if(h.s!=t.s)return t.s=-t.s,h.minus(t);if(u=h.d,c=t.d,a=p.precision,l=p.rounding,!u[0]||!c[0])return c[0]||(t=new p(h)),f?O(t,a,l):t;if(o=g(h.e/7),r=g(t.e/7),u=u.slice(),i=o-r){for(i<0?(n=u,i=-i,s=c.length):(n=c,r=o,s=u.length),i>(s=(o=Math.ceil(a/7))>s?o+1:s+1)&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((s=u.length)-(i=c.length)<0&&(i=s,n=c,c=u,u=n),e=0;i;)e=(u[--i]=u[i]+c[i]+e)/b|0,u[i]%=b;for(e&&(u.unshift(e),++r),s=u.length;0==u[--s];)u.pop();return t.d=u,t.e=I(u,r),f?O(t,a,l):t},w.precision=w.sd=function(t){var e,n=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(d+t);return n.d?(e=D(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e},w.round=function(){var t=this,e=t.constructor;return O(new e(t),t.e+1,e.rounding)},w.sine=w.sin=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(t,e){var n,r=e.d.length;if(r<3)return q(t,2,e,e);n=(n=1.4*Math.sqrt(r))>16?16:0|n,e=e.times(1/G(5,n)),e=q(t,2,e,e);for(var i,o=new t(5),s=new t(16),a=new t(20);n--;)i=e.times(e),e=e.times(o.plus(i.times(s.times(i).minus(a))));return e}(r,K(r,n)),r.precision=t,r.rounding=e,O(a>2?n.neg():n,t,e,!0)):new r(NaN)},w.squareRoot=w.sqrt=function(){var t,e,n,r,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(1!==u||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(f=!1,0==(u=Math.sqrt(+s))||u==1/0?(((e=E(a)).length+l)%2==0&&(e+="0"),u=Math.sqrt(e),l=g((l+1)/2)-(l<0||l%2),r=new c(e=u==1/0?"1e"+l:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+l)):r=new c(u.toString()),n=(l=c.precision)+3;;)if(r=(o=r).plus(k(s,o,n+2,1)).times(.5),E(o.d).slice(0,n)===(e=E(r.d)).slice(0,n)){if("9999"!=(e=e.slice(n-3,n+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(O(r,l+1,1),t=!r.times(r).eq(s));break}if(!i&&(O(o,l+1,0),o.times(o).eq(s))){r=o;break}n+=4,i=1}return f=!0,O(r,l,c.rounding,t)},w.tangent=w.tan=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+10,r.rounding=1,(n=n.sin()).s=1,n=k(n,new r(1).minus(n.times(n)).sqrt(),t+10,0),r.precision=t,r.rounding=e,O(2==a||4==a?n.neg():n,t,e,!0)):new r(NaN)},w.times=w.mul=function(t){var e,n,r,i,o,s,a,l,u,c=this,h=c.constructor,p=c.d,d=(t=new h(t)).d;if(t.s*=c.s,!(p&&p[0]&&d&&d[0]))return new h(!t.s||p&&!p[0]&&!d||d&&!d[0]&&!p?NaN:p&&d?0*t.s:t.s/0);for(n=g(c.e/7)+g(t.e/7),(l=p.length)<(u=d.length)&&(o=p,p=d,d=o,s=l,l=u,u=s),o=[],r=s=l+u;r--;)o.push(0);for(r=u;--r>=0;){for(e=0,i=l+r;i>r;)a=o[i]+d[r]*p[i-r-1]+e,o[i--]=a%b|0,e=a/b|0;o[i]=(o[i]+e)%b|0}for(;!o[--s];)o.pop();return e?++n:o.shift(),t.d=o,t.e=I(o,n),f?O(t,h.precision,h.rounding):t},w.toBinary=function(t,e){return Y(this,2,t,e)},w.toDecimalPlaces=w.toDP=function(t,e){var n=this,r=n.constructor;return n=new r(n),void 0===t?n:(A(t,0,1e9),void 0===e?e=r.rounding:A(e,0,8),O(n,t+n.e+1,e))},w.toExponential=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=_(r,!0):(A(t,0,1e9),void 0===e?e=i.rounding:A(e,0,8),n=_(r=O(new i(r),t+1,e),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+n:n},w.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return void 0===t?n=_(i):(A(t,0,1e9),void 0===e?e=o.rounding:A(e,0,8),n=_(r=O(new o(i),t+i.e+1,e),!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},w.toFraction=function(t){var e,n,r,i,o,s,a,l,u,c,h,p,g=this,m=g.d,y=g.constructor;if(!m)return new y(g);if(u=n=new y(1),r=l=new y(0),s=(o=(e=new y(r)).e=D(m)-g.e-1)%7,e.d[0]=v(10,s<0?7+s:s),null==t)t=o>0?e:u;else{if(!(a=new y(t)).isInt()||a.lt(u))throw Error(d+a);t=a.gt(e)?o>0?e:u:a}for(f=!1,a=new y(E(m)),c=y.precision,y.precision=o=7*m.length*2;h=k(a,e,0,1,1),1!=(i=n.plus(h.times(r))).cmp(t);)n=r,r=i,i=u,u=l.plus(h.times(i)),l=i,i=e,e=a.minus(h.times(i)),a=i;return i=k(t.minus(n),r,0,1,1),l=l.plus(i.times(u)),n=n.plus(i.times(r)),l.s=u.s=g.s,p=k(u,r,o,1).minus(g).abs().cmp(k(l,n,o,1).minus(g).abs())<1?[u,r]:[l,n],y.precision=c,f=!0,p},w.toHexadecimal=w.toHex=function(t,e){return Y(this,16,t,e)},w.toNearest=function(t,e){var n=this,r=n.constructor;if(n=new r(n),null==t){if(!n.d)return n;t=new r(1),e=r.rounding}else{if(t=new r(t),void 0===e?e=r.rounding:A(e,0,8),!n.d)return t.s?n:t;if(!t.d)return t.s&&(t.s=n.s),t}return t.d[0]?(f=!1,n=k(n,t,0,e,1).times(t),f=!0,O(n)):(t.s=n.s,n=t),n},w.toNumber=function(){return+this},w.toOctal=function(t,e){return Y(this,8,t,e)},w.toPower=w.pow=function(t){var e,n,r,i,o,s,a=this,l=a.constructor,u=+(t=new l(t));if(!(a.d&&t.d&&a.d[0]&&t.d[0]))return new l(v(+a,u));if((a=new l(a)).eq(1))return a;if(r=l.precision,o=l.rounding,t.eq(1))return O(a,r,o);if((e=g(t.e/7))>=t.d.length-1&&(n=u<0?-u:u)<=9007199254740991)return i=F(l,a,n,r),t.s<0?new l(1).div(i):O(i,r,o);if((s=a.s)<0){if(e<t.d.length-1)return new l(NaN);if(0==(1&t.d[e])&&(s=1),0==a.e&&1==a.d[0]&&1==a.d.length)return a.s=s,a}return(e=0!=(n=v(+a,u))&&isFinite(n)?new l(n+"").e:g(u*(Math.log("0."+E(a.d))/Math.LN10+a.e+1)))>l.maxE+1||e<l.minE-1?new l(e>0?s/0:0):(f=!1,l.rounding=a.s=1,n=Math.min(12,(e+"").length),(i=W(t.times(j(a,r+n)),r)).d&&L((i=O(i,r+5,1)).d,r,o)&&(e=r+10,+E((i=O(W(t.times(j(a,e+n)),e),e+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=O(i,r+1,0))),i.s=s,f=!0,l.rounding=o,O(i,r,o))},w.toPrecision=function(t,e){var n,r=this,i=r.constructor;return void 0===t?n=_(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(A(t,1,1e9),void 0===e?e=i.rounding:A(e,0,8),n=_(r=O(new i(r),t,e),t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+n:n},w.toSignificantDigits=w.toSD=function(t,e){var n=this.constructor;return void 0===t?(t=n.precision,e=n.rounding):(A(t,1,1e9),void 0===e?e=n.rounding:A(e,0,8)),O(new n(this),t,e)},w.toString=function(){var t=this,e=t.constructor,n=_(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n},w.truncated=w.trunc=function(){return O(new this.constructor(this),this.e+1,1)},w.valueOf=w.toJSON=function(){var t=this,e=t.constructor,n=_(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n};var k=function(){function t(t,e,n){var r,i=0,o=t.length;for(t=t.slice();o--;)r=t[o]*e+i,t[o]=r%n|0,i=r/n|0;return i&&t.unshift(i),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]<e[n]?1:0,t[n]=i*r+t[n]-e[n];for(;!t[0]&&t.length>1;)t.shift()}return function(r,i,o,a,l,u){var c,h,p,f,d,v,m,y,x,S,T,C,w,E,A,L,N,k,_,I,M=r.constructor,P=r.s==i.s?1:-1,D=r.d,R=i.d;if(!(D&&D[0]&&R&&R[0]))return new M(r.s&&i.s&&(D?!R||D[0]!=R[0]:R)?D&&0==D[0]||!R?0*P:P/0:NaN);for(u?(d=1,h=r.e-i.e):(u=b,d=7,h=g(r.e/d)-g(i.e/d)),_=R.length,N=D.length,S=(x=new M(P)).d=[],p=0;R[p]==(D[p]||0);p++);if(R[p]>(D[p]||0)&&h--,null==o?(E=o=M.precision,a=M.rounding):E=l?o+(r.e-i.e)+1:o,E<0)S.push(1),v=!0;else{if(E=E/d+2|0,p=0,1==_){for(f=0,R=R[0],E++;(p<N||f)&&E--;p++)A=f*u+(D[p]||0),S[p]=A/R|0,f=A%R|0;v=f||p<N}else{for((f=u/(R[0]+1)|0)>1&&(R=t(R,f,u),D=t(D,f,u),_=R.length,N=D.length),L=_,C=(T=D.slice(0,_)).length;C<_;)T[C++]=0;(I=R.slice()).unshift(0),k=R[0],R[1]>=u/2&&++k;do{f=0,(c=e(R,T,_,C))<0?(w=T[0],_!=C&&(w=w*u+(T[1]||0)),(f=w/k|0)>1?(f>=u&&(f=u-1),1==(c=e(m=t(R,f,u),T,y=m.length,C=T.length))&&(f--,n(m,_<y?I:R,y,u))):(0==f&&(c=f=1),m=R.slice()),(y=m.length)<C&&m.unshift(0),n(T,m,C,u),-1==c&&(c=e(R,T,_,C=T.length))<1&&(f++,n(T,_<C?I:R,C,u)),C=T.length):0===c&&(f++,T=[0]),S[p++]=f,c&&T[0]?T[C++]=D[L]||0:(T=[D[L]],C=1)}while((L++<N||void 0!==T[0])&&E--);v=void 0!==T[0]}S[0]||S.shift()}if(1==d)x.e=h,s=v;else{for(p=1,f=S[0];f>=10;f/=10)p++;x.e=p+h*d-1,O(x,l?o+x.e+1:o,a,v)}return x}}();function O(t,e,n,r){var i,o,s,a,l,u,c,h,p,d=t.constructor;t:if(null!=e){if(!(h=t.d))return t;for(i=1,a=h[0];a>=10;a/=10)i++;if((o=e-i)<0)o+=7,s=e,l=(c=h[p=0])/v(10,i-s-1)%10|0;else if((p=Math.ceil((o+1)/7))>=(a=h.length)){if(!r)break t;for(;a++<=p;)h.push(0);c=l=0,i=1,s=(o%=7)-7+1}else{for(c=a=h[p],i=1;a>=10;a/=10)i++;l=(s=(o%=7)-7+i)<0?0:c/v(10,i-s-1)%10|0}if(r=r||e<0||void 0!==h[p+1]||(s<0?c:c%v(10,i-s-1)),u=n<4?(l||r)&&(0==n||n==(t.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(o>0?s>0?c/v(10,i-s):0:h[p-1])%10&1||n==(t.s<0?8:7)),e<1||!h[0])return h.length=0,u?(e-=t.e+1,h[0]=v(10,(7-e%7)%7),t.e=-e||0):h[0]=t.e=0,t;if(0==o?(h.length=p,a=1,p--):(h.length=p+1,a=v(10,7-o),h[p]=s>0?(c/v(10,i-s)%v(10,s)|0)*a:0),u)for(;;){if(0==p){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(t.e++,h[0]==b&&(h[0]=1));break}if(h[p]+=a,h[p]!=b)break;h[p--]=0,a=1}for(o=h.length;0===h[--o];)h.pop()}return f&&(t.e>d.maxE?(t.d=null,t.e=NaN):t.e<d.minE&&(t.e=0,t.d=[0])),t}function _(t,e,n){if(!t.isFinite())return z(t);var r,i=t.e,o=E(t.d),s=o.length;return e?(n&&(r=n-s)>0?o=o.charAt(0)+"."+o.slice(1)+R(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+R(-i-1)+o,n&&(r=n-s)>0&&(o+=R(r))):i>=s?(o+=R(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+R(r))):((r=i+1)<s&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(o+="."),o+=R(r))),o}function I(t,e){var n=t[0];for(e*=7;n>=10;n/=10)e++;return e}function M(t,e,n){if(e>T)throw f=!0,n&&(t.precision=n),Error("[DecimalError] Precision limit exceeded");return O(new t(c),e,1,!0)}function P(t,e,n){if(e>C)throw Error("[DecimalError] Precision limit exceeded");return O(new t(h),e,n,!0)}function D(t){var e=t.length-1,n=7*e+1;if(e=t[e]){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function R(t){for(var e="";t--;)e+="0";return e}function F(t,e,n,r){var i,o=new t(1),s=Math.ceil(r/7+4);for(f=!1;;){if(n%2&&X((o=o.times(e)).d,s)&&(i=!0),0===(n=g(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}X((e=e.times(e)).d,s)}return f=!0,o}function H(t){return 1&t.d[t.d.length-1]}function B(t,e,n){for(var r,i=new t(e[0]),o=0;++o<e.length;){if(!(r=new t(e[o])).s){i=r;break}i[n](r)&&(i=r)}return i}function W(t,e){var n,r,i,o,s,a,l,u=0,c=0,h=0,p=t.constructor,d=p.rounding,g=p.precision;if(!t.d||!t.d[0]||t.e>17)return new p(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(f=!1,l=g):l=e,a=new p(.03125);t.e>-2;)t=t.times(a),h+=5;for(l+=r=Math.log(v(2,h))/Math.LN10*2+5|0,n=o=s=new p(1),p.precision=l;;){if(o=O(o.times(t),l,1),n=n.times(++c),E((a=s.plus(k(o,n,l,1))).d).slice(0,l)===E(s.d).slice(0,l)){for(i=h;i--;)s=O(s.times(s),l,1);if(null!=e)return p.precision=g,s;if(!(u<3&&L(s.d,l-r,d,u)))return O(s,p.precision=g,d,f=!0);p.precision=l+=10,n=o=a=new p(1),c=0,u++}s=a}}function j(t,e){var n,r,i,o,s,a,l,u,c,h,p,d=1,g=t,v=g.d,m=g.constructor,y=m.rounding,x=m.precision;if(g.s<0||!v||!v[0]||!g.e&&1==v[0]&&1==v.length)return new m(v&&!v[0]?-1/0:1!=g.s?NaN:v?0:g);if(null==e?(f=!1,c=x):c=e,m.precision=c+=10,r=(n=E(v)).charAt(0),!(Math.abs(o=g.e)<15e14))return u=M(m,c+2,x).times(o+""),g=j(new m(r+"."+n.slice(1)),c-10).plus(u),m.precision=x,null==e?O(g,x,y,f=!0):g;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=E((g=g.times(t)).d)).charAt(0),d++;for(o=g.e,r>1?(g=new m("0."+n),o++):g=new m(r+"."+n.slice(1)),h=g,l=s=g=k(g.minus(1),g.plus(1),c,1),p=O(g.times(g),c,1),i=3;;){if(s=O(s.times(p),c,1),E((u=l.plus(k(s,new m(i),c,1))).d).slice(0,c)===E(l.d).slice(0,c)){if(l=l.times(2),0!==o&&(l=l.plus(M(m,c+2,x).times(o+""))),l=k(l,new m(d),c,1),null!=e)return m.precision=x,l;if(!L(l.d,c-10,y,a))return O(l,m.precision=x,y,f=!0);m.precision=c+=10,u=s=g=k(h.minus(1),h.plus(1),c,1),p=O(g.times(g),c,1),i=a=1}l=u,i+=2}}function z(t){return String(t.s*t.s/0)}function U(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;48===e.charCodeAt(r);r++);for(i=e.length;48===e.charCodeAt(i-1);--i);if(e=e.slice(r,i)){if(i-=r,t.e=n=n-r-1,t.d=[],r=(n+1)%7,n<0&&(r+=7),r<i){for(r&&t.d.push(+e.slice(0,r)),i-=7;r<i;)t.d.push(+e.slice(r,r+=7));r=7-(e=e.slice(r)).length}else r-=i;for(;r--;)e+="0";t.d.push(+e),f&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function V(t,e){var n,r,i,s,a,l,u,c,h;if("Infinity"===e||"NaN"===e)return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(y.test(e))n=16,e=e.toLowerCase();else if(m.test(e))n=2;else{if(!x.test(e))throw Error(d+e);n=8}for((s=e.search(/p/i))>0?(u=+e.slice(s+1),e=e.substring(2,s)):e=e.slice(2),a=(s=e.indexOf("."))>=0,r=t.constructor,a&&(s=(l=(e=e.replace(".","")).length)-s,i=F(r,new r(n),s,2*s)),s=h=(c=N(e,n,b)).length-1;0===c[s];--s)c.pop();return s<0?new r(0*t.s):(t.e=I(c,h),t.d=c,f=!1,a&&(t=k(t,i,4*l)),u&&(t=t.times(Math.abs(u)<54?v(2,u):o.pow(2,u))),f=!0,t)}function q(t,e,n,r,i){var o,s,a,l,u=t.precision,c=Math.ceil(u/7);for(f=!1,l=n.times(n),a=new t(r);;){if(s=k(a.times(l),new t(e++*e++),u,1),a=i?r.plus(s):r.minus(s),r=k(s.times(l),new t(e++*e++),u,1),void 0!==(s=a.plus(r)).d[c]){for(o=c;s.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=r,r=s,s=o}return f=!0,s.d.length=c+1,s}function G(t,e){for(var n=t;--e;)n*=t;return n}function K(t,e){var n,r=e.s<0,i=P(t,t.precision,1),o=i.times(.5);if((e=e.abs()).lte(o))return a=r?4:1,e;if((n=e.divToInt(i)).isZero())a=r?3:2;else{if((e=e.minus(n.times(i))).lte(o))return a=H(n)?r?2:3:r?4:1,e;a=H(n)?r?1:4:r?3:2}return e.minus(i).abs()}function Y(t,e,n,r){var i,o,a,l,c,h,p,f,d,g=t.constructor,v=void 0!==n;if(v?(A(n,1,1e9),void 0===r?r=g.rounding:A(r,0,8)):(n=g.precision,r=g.rounding),t.isFinite()){for(v?(i=2,16==e?n=4*n-3:8==e&&(n=3*n-2)):i=e,(a=(p=_(t)).indexOf("."))>=0&&(p=p.replace(".",""),(d=new g(1)).e=p.length-a,d.d=N(_(d),10,i),d.e=d.d.length),o=c=(f=N(p,10,i)).length;0==f[--c];)f.pop();if(f[0]){if(a<0?o--:((t=new g(t)).d=f,t.e=o,f=(t=k(t,d,n,r,0,i)).d,o=t.e,h=s),a=f[n],l=i/2,h=h||void 0!==f[n+1],h=r<4?(void 0!==a||h)&&(0===r||r===(t.s<0?3:2)):a>l||a===l&&(4===r||h||6===r&&1&f[n-1]||r===(t.s<0?8:7)),f.length=n,h)for(;++f[--n]>i-1;)f[n]=0,n||(++o,f.unshift(1));for(c=f.length;!f[c-1];--c);for(a=0,p="";a<c;a++)p+=u.charAt(f[a]);if(v){if(c>1)if(16==e||8==e){for(a=16==e?4:3,--c;c%a;c++)p+="0";for(c=(f=N(p,i,e)).length;!f[c-1];--c);for(a=1,p="1.";a<c;a++)p+=u.charAt(f[a])}else p=p.charAt(0)+"."+p.slice(1);p=p+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)p="0"+p;p="0."+p}else if(++o>c)for(o-=c;o--;)p+="0";else o<c&&(p=p.slice(0,o)+"."+p.slice(o))}else p=v?"0p+0":"0";p=(16==e?"0x":2==e?"0b":8==e?"0o":"")+p}else p=z(t);return t.s<0?"-"+p:p}function X(t,e){if(t.length>e)return t.length=e,!0}function $(t){return new this(t).abs()}function Z(t){return new this(t).acos()}function J(t){return new this(t).acosh()}function Q(t,e){return new this(t).plus(e)}function tt(t){return new this(t).asin()}function et(t){return new this(t).asinh()}function nt(t){return new this(t).atan()}function rt(t){return new this(t).atanh()}function it(t,e){t=new this(t),e=new this(e);var n,r=this.precision,i=this.rounding,o=r+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(n=e.s<0?P(this,r,i):new this(0)).s=t.s:!t.d||e.isZero()?(n=P(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,n=this.atan(k(t,e,o,1)),e=P(this,o,1),this.precision=r,this.rounding=i,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(k(t,e,o,1)):(n=P(this,o,1).times(e.s>0?.25:.75)).s=t.s:n=new this(NaN),n}function ot(t){return new this(t).cbrt()}function st(t){return O(t=new this(t),t.e+1,2)}function at(t){if(!t||"object"!=typeof t)throw Error("[DecimalError] Object expected");var e,n,r,i=!0===t.defaults,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-l,0,"toExpPos",0,l,"maxE",0,l,"minE",-l,0,"modulo",0,9];for(e=0;e<o.length;e+=3)if(n=o[e],i&&(this[n]=p[n]),void 0!==(r=t[n])){if(!(g(r)===r&&r>=o[e+1]&&r<=o[e+2]))throw Error(d+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=p[n]),void 0!==(r=t[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(d+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");this[n]=!0}else this[n]=!1}return this}function lt(t){return new this(t).cos()}function ut(t){return new this(t).cosh()}function ct(t,e){return new this(t).div(e)}function ht(t){return new this(t).exp()}function pt(t){return O(t=new this(t),t.e+1,3)}function ft(){var t,e,n=new this(0);for(f=!1,t=0;t<arguments.length;)if((e=new this(arguments[t++])).d)n.d&&(n=n.plus(e.times(e)));else{if(e.s)return f=!0,new this(1/0);n=e}return f=!0,n.sqrt()}function dt(t){return t instanceof o||t&&"[object Decimal]"===t.name||!1}function gt(t){return new this(t).ln()}function vt(t,e){return new this(t).log(e)}function mt(t){return new this(t).log(2)}function yt(t){return new this(t).log(10)}function xt(){return B(this,arguments,"lt")}function St(){return B(this,arguments,"gt")}function bt(t,e){return new this(t).mod(e)}function Tt(t,e){return new this(t).mul(e)}function Ct(t,e){return new this(t).pow(e)}function wt(t){var e,n,r,i,o=0,s=new this(1),a=[];if(void 0===t?t=this.precision:A(t,1,1e9),r=Math.ceil(t/7),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(r));o<r;)(i=e[o])>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");for(e=crypto.randomBytes(r*=4);o<r;)(i=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((127&e[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,o):(a.push(i%1e7),o+=4);o=r/4}else for(;o<r;)a[o++]=1e7*Math.random()|0;for(t%=7,(r=a[--o])&&t&&(i=v(10,7-t),a[o]=(r/i|0)*i);0===a[o];o--)a.pop();if(o<0)n=0,a=[0];else{for(n=-1;0===a[0];n-=7)a.shift();for(r=1,i=a[0];i>=10;i/=10)r++;r<7&&(n-=7-r)}return s.e=n,s.d=a,s}function Et(t){return O(t=new this(t),t.e+1,this.rounding)}function At(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function Lt(t){return new this(t).sin()}function Nt(t){return new this(t).sinh()}function kt(t){return new this(t).sqrt()}function Ot(t,e){return new this(t).sub(e)}function _t(t){return new this(t).tan()}function It(t){return new this(t).tanh()}function Mt(t){return O(t=new this(t),t.e+1,1)}(o=function t(e){var n,r,i;function o(t){var e,n,r,i=this;if(!(i instanceof o))return new o(t);if(i.constructor=o,t instanceof o)return i.s=t.s,void(f?!t.d||t.e>o.maxE?(i.e=NaN,i.d=null):t.e<o.minE?(i.e=0,i.d=[0]):(i.e=t.e,i.d=t.d.slice()):(i.e=t.e,i.d=t.d?t.d.slice():t.d));if("number"===(r=typeof t)){if(0===t)return i.s=1/t<0?-1:1,i.e=0,void(i.d=[0]);if(t<0?(t=-t,i.s=-1):i.s=1,t===~~t&&t<1e7){for(e=0,n=t;n>=10;n/=10)e++;return void(f?e>o.maxE?(i.e=NaN,i.d=null):e<o.minE?(i.e=0,i.d=[0]):(i.e=e,i.d=[t]):(i.e=e,i.d=[t]))}return 0*t!=0?(t||(i.s=NaN),i.e=NaN,void(i.d=null)):U(i,t.toString())}if("string"!==r)throw Error(d+t);return 45===(n=t.charCodeAt(0))?(t=t.slice(1),i.s=-1):(43===n&&(t=t.slice(1)),i.s=1),S.test(t)?U(i,t):V(i,t)}if(o.prototype=w,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=at,o.clone=t,o.isDecimal=dt,o.abs=$,o.acos=Z,o.acosh=J,o.add=Q,o.asin=tt,o.asinh=et,o.atan=nt,o.atanh=rt,o.atan2=it,o.cbrt=ot,o.ceil=st,o.cos=lt,o.cosh=ut,o.div=ct,o.exp=ht,o.floor=pt,o.hypot=ft,o.ln=gt,o.log=vt,o.log10=yt,o.log2=mt,o.max=xt,o.min=St,o.mod=bt,o.mul=Tt,o.pow=Ct,o.random=wt,o.round=Et,o.sign=At,o.sin=Lt,o.sinh=Nt,o.sqrt=kt,o.sub=Ot,o.tan=_t,o.tanh=It,o.trunc=Mt,void 0===e&&(e={}),e&&!0!==e.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],n=0;n<i.length;)e.hasOwnProperty(r=i[n++])||(e[r]=this[r]);return o.config(e),o}(p)).default=o.Decimal=o,c=new o(c),h=new o(h),void 0===(r=function(){return o}.call(e,n,e,t))||(t.exports=r)}()},,function(t,e){function n(t){return"["+t.join(", ")+"]"}function r(t,e){return t.equals(e)}function i(t){return t.hashCode()}function o(t,e){return this.data={},this.hashFunction=t||i,this.equalsFunction=e||r,this}function s(){return this.data=[],this}function a(t,e){return this.data={},this.hashFunction=t||i,this.equalsFunction=e||r,this}function l(){return this.data={},this}function u(t){return this.defaultMapCtor=t||a,this.cacheMap=new this.defaultMapCtor,this}function c(){return this.count=0,this.hash=0,this}String.prototype.seed=String.prototype.seed||Math.round(Math.random()*Math.pow(2,32)),String.prototype.hashCode=function(){var t,e,n,r,i,o,s,a,l=this.toString();for(t=3&l.length,e=l.length-t,n=String.prototype.seed,i=3432918353,o=461845907,a=0;a<e;)s=255&l.charCodeAt(a)|(255&l.charCodeAt(++a))<<8|(255&l.charCodeAt(++a))<<16|(255&l.charCodeAt(++a))<<24,++a,n=27492+(65535&(r=5*(65535&(n=(n^=s=(65535&(s=(s=(65535&s)*i+(((s>>>16)*i&65535)<<16)&4294967295)<<15|s>>>17))*o+(((s>>>16)*o&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(r>>>16)&65535)<<16);switch(s=0,t){case 3:s^=(255&l.charCodeAt(a+2))<<16;case 2:s^=(255&l.charCodeAt(a+1))<<8;case 1:n^=s=(65535&(s=(s=(65535&(s^=255&l.charCodeAt(a)))*i+(((s>>>16)*i&65535)<<16)&4294967295)<<15|s>>>17))*o+(((s>>>16)*o&65535)<<16)&4294967295}return n^=l.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0},Object.defineProperty(o.prototype,"length",{get:function(){var t=0;for(var e in this.data)0===e.indexOf("hash_")&&(t+=this.data[e].length);return t}}),o.prototype.add=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data){for(var n=this.data[e],r=0;r<n.length;r++)if(this.equalsFunction(t,n[r]))return n[r];return n.push(t),t}return this.data[e]=[t],t},o.prototype.contains=function(t){return null!=this.get(t)},o.prototype.get=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data)for(var n=this.data[e],r=0;r<n.length;r++)if(this.equalsFunction(t,n[r]))return n[r];return null},o.prototype.values=function(){var t=[];for(var e in this.data)0===e.indexOf("hash_")&&(t=t.concat(this.data[e]));return t},o.prototype.toString=function(){return n(this.values())},s.prototype.add=function(t){this.data[t]=!0},s.prototype.or=function(t){var e=this;Object.keys(t.data).map((function(t){e.add(t)}))},s.prototype.remove=function(t){delete this.data[t]},s.prototype.contains=function(t){return!0===this.data[t]},s.prototype.values=function(){return Object.keys(this.data)},s.prototype.minValue=function(){return Math.min.apply(null,this.values())},s.prototype.hashCode=function(){var t=new c;return t.update(this.values()),t.finish()},s.prototype.equals=function(t){return t instanceof s&&this.hashCode()===t.hashCode()},Object.defineProperty(s.prototype,"length",{get:function(){return this.values().length}}),s.prototype.toString=function(){return"{"+this.values().join(", ")+"}"},Object.defineProperty(a.prototype,"length",{get:function(){var t=0;for(var e in this.data)0===e.indexOf("hash_")&&(t+=this.data[e].length);return t}}),a.prototype.put=function(t,e){var n="hash_"+this.hashFunction(t);if(n in this.data){for(var r=this.data[n],i=0;i<r.length;i++){var o=r[i];if(this.equalsFunction(t,o.key)){var s=o.value;return o.value=e,s}}return r.push({key:t,value:e}),e}return this.data[n]=[{key:t,value:e}],e},a.prototype.containsKey=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data)for(var n=this.data[e],r=0;r<n.length;r++){var i=n[r];if(this.equalsFunction(t,i.key))return!0}return!1},a.prototype.get=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data)for(var n=this.data[e],r=0;r<n.length;r++){var i=n[r];if(this.equalsFunction(t,i.key))return i.value}return null},a.prototype.entries=function(){var t=[];for(var e in this.data)0===e.indexOf("hash_")&&(t=t.concat(this.data[e]));return t},a.prototype.getKeys=function(){return this.entries().map((function(t){return t.key}))},a.prototype.getValues=function(){return this.entries().map((function(t){return t.value}))},a.prototype.toString=function(){return"["+this.entries().map((function(t){return"{"+t.key+":"+t.value+"}"})).join(", ")+"]"},l.prototype.get=function(t){return(t="k-"+t)in this.data?this.data[t]:null},l.prototype.put=function(t,e){t="k-"+t,this.data[t]=e},l.prototype.values=function(){var t=this.data;return Object.keys(this.data).map((function(e){return t[e]}))},c.prototype.update=function(){for(var t=0;t<arguments.length;t++){var e=arguments[t];if(null!=e)if(Array.isArray(e))this.update.apply(this,e);else{var n=0;switch(typeof e){case"undefined":case"function":continue;case"number":case"boolean":n=e;break;case"string":n=e.hashCode();break;default:e.updateHashCode?e.updateHashCode(this):console.log("No updateHashCode for "+e.toString());continue}n=(n*=3432918353)<<15|n>>>17,n*=461845907,this.count=this.count+1;var r=this.hash^n;r=5*(r=r<<13|r>>>19)+3864292196,this.hash=r}}},c.prototype.finish=function(){var t=this.hash^4*this.count;return t^=t>>>16,t*=2246822507,t^=t>>>13,t*=3266489909,t^=t>>>16},u.prototype.get=function(t,e){var n=this.cacheMap.get(t)||null;return null===n?null:n.get(e)||null},u.prototype.set=function(t,e,n){var r=this.cacheMap.get(t)||null;null===r&&(r=new this.defaultMapCtor,this.cacheMap.put(t,r)),r.put(e,n)},e.Hash=c,e.Set=o,e.Map=a,e.BitSet=s,e.AltDict=l,e.DoubleDict=u,e.hashStuff=function(){var t=new c;return t.update.apply(t,arguments),t.finish()},e.escapeWhitespace=function(t,e){return t=t.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r"),e&&(t=t.replace(/ /g,"·")),t},e.arrayToString=n,e.titleCase=function(t){return t.replace(/\w\S*/g,(function(t){return t.charAt(0).toUpperCase()+t.substr(1)}))},e.equalArrays=function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!=e[n]&&!t[n].equals(e[n]))return!1;return!0}},function(t,e){function n(){return this.source=null,this.type=null,this.channel=null,this.start=null,this.stop=null,this.tokenIndex=null,this.line=null,this.column=null,this._text=null,this}function r(t,e,i,o,s){return n.call(this),this.source=void 0!==t?t:r.EMPTY_SOURCE,this.type=void 0!==e?e:null,this.channel=void 0!==i?i:n.DEFAULT_CHANNEL,this.start=void 0!==o?o:-1,this.stop=void 0!==s?s:-1,this.tokenIndex=-1,null!==this.source[0]?(this.line=t[0].line,this.column=t[0].column):this.column=-1,this}n.INVALID_TYPE=0,n.EPSILON=-2,n.MIN_USER_TOKEN_TYPE=1,n.EOF=-1,n.DEFAULT_CHANNEL=0,n.HIDDEN_CHANNEL=1,Object.defineProperty(n.prototype,"text",{get:function(){return this._text},set:function(t){this._text=t}}),n.prototype.getTokenSource=function(){return this.source[0]},n.prototype.getInputStream=function(){return this.source[1]},r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.EMPTY_SOURCE=[null,null],r.prototype.clone=function(){var t=new r(this.source,this.type,this.channel,this.start,this.stop);return t.tokenIndex=this.tokenIndex,t.line=this.line,t.column=this.column,t.text=this.text,t},Object.defineProperty(r.prototype,"text",{get:function(){if(null!==this._text)return this._text;var t=this.getInputStream();if(null===t)return null;var e=t.size;return this.start<e&&this.stop<e?t.getText(this.start,this.stop):"<EOF>"},set:function(t){this._text=t}}),r.prototype.toString=function(){var t=this.text;return t=null!==t?t.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):"<no text>","[@"+this.tokenIndex+","+this.start+":"+this.stop+"='"+t+"',<"+this.type+">"+(this.channel>0?",channel="+this.channel:"")+","+this.line+":"+this.column+"]"},e.Token=n,e.CommonToken=r},function(t,e,n){var r=n(17).Token;function i(t,e){return this.start=t,this.stop=e,this}function o(){this.intervals=null,this.readOnly=!1}i.prototype.contains=function(t){return t>=this.start&&t<this.stop},i.prototype.toString=function(){return this.start===this.stop-1?this.start.toString():this.start.toString()+".."+(this.stop-1).toString()},Object.defineProperty(i.prototype,"length",{get:function(){return this.stop-this.start}}),o.prototype.first=function(t){return null===this.intervals||0===this.intervals.length?r.INVALID_TYPE:this.intervals[0].start},o.prototype.addOne=function(t){this.addInterval(new i(t,t+1))},o.prototype.addRange=function(t,e){this.addInterval(new i(t,e+1))},o.prototype.addInterval=function(t){if(null===this.intervals)this.intervals=[],this.intervals.push(t);else{for(var e=0;e<this.intervals.length;e++){var n=this.intervals[e];if(t.stop<n.start)return void this.intervals.splice(e,0,t);if(t.stop===n.start)return void(this.intervals[e].start=t.start);if(t.start<=n.stop)return this.intervals[e]=new i(Math.min(n.start,t.start),Math.max(n.stop,t.stop)),void this.reduce(e)}this.intervals.push(t)}},o.prototype.addSet=function(t){if(null!==t.intervals)for(var e=0;e<t.intervals.length;e++){var n=t.intervals[e];this.addInterval(new i(n.start,n.stop))}return this},o.prototype.reduce=function(t){if(t<this.intervalslength-1){var e=this.intervals[t],n=this.intervals[t+1];e.stop>=n.stop?(this.intervals.pop(t+1),this.reduce(t)):e.stop>=n.start&&(this.intervals[t]=new i(e.start,n.stop),this.intervals.pop(t+1))}},o.prototype.complement=function(t,e){var n=new o;n.addInterval(new i(t,e+1));for(var r=0;r<this.intervals.length;r++)n.removeRange(this.intervals[r]);return n},o.prototype.contains=function(t){if(null===this.intervals)return!1;for(var e=0;e<this.intervals.length;e++)if(this.intervals[e].contains(t))return!0;return!1},Object.defineProperty(o.prototype,"length",{get:function(){var t=0;return this.intervals.map((function(e){t+=e.length})),t}}),o.prototype.removeRange=function(t){if(t.start===t.stop-1)this.removeOne(t.start);else if(null!==this.intervals)for(var e=0,n=0;n<this.intervals.length;n++){var r=this.intervals[e];if(t.stop<=r.start)return;if(t.start>r.start&&t.stop<r.stop){this.intervals[e]=new i(r.start,t.start);var o=new i(t.stop,r.stop);return void this.intervals.splice(e,0,o)}t.start<=r.start&&t.stop>=r.stop?(this.intervals.splice(e,1),e-=1):t.start<r.stop?this.intervals[e]=new i(r.start,t.start):t.stop<r.stop&&(this.intervals[e]=new i(t.stop,r.stop)),e+=1}},o.prototype.removeOne=function(t){if(null!==this.intervals)for(var e=0;e<this.intervals.length;e++){var n=this.intervals[e];if(t<n.start)return;if(t===n.start&&t===n.stop-1)return void this.intervals.splice(e,1);if(t===n.start)return void(this.intervals[e]=new i(n.start+1,n.stop));if(t===n.stop-1)return void(this.intervals[e]=new i(n.start,n.stop-1));if(t<n.stop-1){var r=new i(n.start,t);return n.start=t+1,void this.intervals.splice(e,0,r)}}},o.prototype.toString=function(t,e,n){return t=t||null,e=e||null,n=n||!1,null===this.intervals?"{}":null!==t||null!==e?this.toTokenString(t,e):n?this.toCharString():this.toIndexString()},o.prototype.toCharString=function(){for(var t=[],e=0;e<this.intervals.length;e++){var n=this.intervals[e];n.stop===n.start+1?n.start===r.EOF?t.push("<EOF>"):t.push("'"+String.fromCharCode(n.start)+"'"):t.push("'"+String.fromCharCode(n.start)+"'..'"+String.fromCharCode(n.stop-1)+"'")}return t.length>1?"{"+t.join(", ")+"}":t[0]},o.prototype.toIndexString=function(){for(var t=[],e=0;e<this.intervals.length;e++){var n=this.intervals[e];n.stop===n.start+1?n.start===r.EOF?t.push("<EOF>"):t.push(n.start.toString()):t.push(n.start.toString()+".."+(n.stop-1).toString())}return t.length>1?"{"+t.join(", ")+"}":t[0]},o.prototype.toTokenString=function(t,e){for(var n=[],r=0;r<this.intervals.length;r++)for(var i=this.intervals[r],o=i.start;o<i.stop;o++)n.push(this.elementName(t,e,o));return n.length>1?"{"+n.join(", ")+"}":n[0]},o.prototype.elementName=function(t,e,n){return n===r.EOF?"<EOF>":n===r.EPSILON?"<EPSILON>":t[n]||e[n]},e.Interval=i,e.IntervalSet=o},function(t,e,n){"use strict";t.exports=function(){var t={noMore:!1,useDirtyCheck:!1,preserveExistingSetters:!1},e=[],n=[],r=[],i=!1;try{i=Object.defineProperty&&Object.defineProperty({},"x",{})}catch(t){}var o=function(t){return t&&"[object Function]"=={}.toString.call(t)},s=function(t){return"[object Array]"===Object.prototype.toString.call(t)},a=function(t){return"[object Object]"==={}.toString.apply(t)},l=function(t,e){var n=[],r=[];if("string"!=typeof t&&"string"!=typeof e){if(s(t)&&e)for(var i=0;i<t.length;i++)void 0===e[i]&&n.push(i);else for(var i in t)t.hasOwnProperty(i)&&e&&!e.hasOwnProperty(i)&&n.push(i);if(s(e)&&t)for(var o=0;o<e.length;o++)void 0===t[o]&&r.push(o);else for(var o in e)e.hasOwnProperty(o)&&t&&!t.hasOwnProperty(o)&&r.push(o)}return{added:n,removed:r}},u=function(t){if(null==t||"object"!=typeof t)return t;var e=t.constructor();for(var n in t)e[n]=t[n];return e},c=function(e,n,r,i){try{var o=function(e,n){if(t.preserveExistingSetters)return Object.getOwnPropertyDescriptor(e,n).set}(e,n);Object.defineProperty(e,n,{get:r,set:function(t){i.call(this,t,!0),o&&o(t)},enumerable:!0,configurable:!0})}catch(t){try{Object.prototype.__defineGetter__.call(e,n,r),Object.prototype.__defineSetter__.call(e,n,(function(t){i.call(this,t,!0)}))}catch(t){p(e,n,i)}}},h=function(t,e,n){try{Object.defineProperty(t,e,{enumerable:!1,configurable:!0,writable:!1,value:n})}catch(r){t[e]=n}},p=function(t,e,r){n[n.length]={prop:e,object:t,orig:u(t[e]),callback:r}},f=function(t,e,n,r){if("string"!=typeof t&&(t instanceof Object||s(t))){if(s(t)){if(E(t,"__watchall__",e,n),void 0===n||n>0)for(var o=0;o<t.length;o++)f(t[o],e,n,r)}else{var a=[];for(o in t)"$val"==o||!i&&"watchers"===o||Object.prototype.hasOwnProperty.call(t,o)&&a.push(o);d(t,a,e,n,r)}r&&F(t,"$$watchlengthsubjectroot",e,n)}},d=function(t,e,n,r,i){if("string"!=typeof t&&(t instanceof Object||s(t)))for(var o=0;o<e.length;o++){var a=e[o];g(t,a,n,r,i)}},g=function(t,e,n,r,i){"string"!=typeof t&&(t instanceof Object||s(t))&&(o(t[e])||(null!=t[e]&&(void 0===r||r>0)&&f(t[e],n,void 0!==r?r-1:r),E(t,e,n,r),i&&(void 0===r||r>0)&&F(t,e,n,r)))},v=function(t,e){if(!(t instanceof String)&&(t instanceof Object||s(t)))if(s(t)){for(var n=["__watchall__"],r=0;r<t.length;r++)n.push(r);m(t,n,e)}else{var i=function(t){var n=[];for(var r in t)t.hasOwnProperty(r)&&(t[r]instanceof Object?i(t[r]):n.push(r));m(t,n,e)};i(t)}},m=function(t,e,n){for(var r in e)e.hasOwnProperty(r)&&O(t,e[r],n)},y=[],x=null;function S(){x=null;for(var t=0;t<y.length;t++)y[t]();y.length=0}var b=function(){return x||(x=setTimeout(S)),x},T=function(t){null==x&&b(),y[y.length]=t},C=function(t,e,n,r){var i=null,o=-1,a=s(t);f(t,(function(n,r,s,l){var u=b();if(o!==u&&(o=u,(i={type:"update"}).value=t,i.splices=null,T((function(){e.call(this,i),i=null}))),a&&t===this&&null!==i){if("pop"===r||"shift"===r)s=[],l=[l];else if("push"===r||"unshift"===r)s=[s],l=[];else if("splice"!==r)return;i.splices||(i.splices=[]),i.splices[i.splices.length]={index:n,deleteCount:l?l.length:0,addedCount:s?s.length:0,added:s,deleted:l}}}),1==n?void 0:0,r)},w=function(t,e,n,r,i){t&&e&&(g(t,e,(function(t,e,o,l){var u={type:"update"};u.value=o,u.oldvalue=l,(r&&a(o)||s(o))&&C(o,n,r,i),n.call(this,u)}),0),(r&&a(t[e])||s(t[e]))&&C(t[e],n,r,i))},E=function(e,n,r,i){var o=!1,l=s(e);e.watchers||(h(e,"watchers",{}),l&&k(e,(function(t,r,o,l){if(P(e,t,r,o,l),0!==i&&o&&(a(o)||s(o))){var u,c,h,p,d=e.watchers[n];for((p=e.watchers.__watchall__)&&(d=d?d.concat(p):p),h=d?d.length:0,u=0;u<h;u++)if("splice"!==r)f(o,d[u],void 0===i?i:i-1);else for(c=0;c<o.length;c++)f(o[c],d[u],void 0===i?i:i-1)}}))),e.watchers[n]||(e.watchers[n]=[],l||(o=!0));for(var u=0;u<e.watchers[n].length;u++)if(e.watchers[n][u]===r)return;if(e.watchers[n].push(r),o){var d=e[n],g=function(r,o){var l=d;if(d=r,0!==i&&e[n]&&(a(e[n])||s(e[n]))&&!e[n].watchers){var u,c=e.watchers[n].length;for(u=0;u<c;u++)f(e[n],e.watchers[n][u],void 0===i?i:i-1)}_(e,n)?I(e,n):t.noMore||(e[n]instanceof Date&&l&&r&&(l=l.valueOf(),r=r.valueOf()),l!==r&&(o?P(e,n,"set",r,l):A(e,n,"set",r,l),t.noMore=!1))};t.useDirtyCheck?p(e,n,g):c(e,n,(function(){return d}),g)}},A=function(t,e,n,r,i){if(void 0!==e){var o,s,a=t.watchers[e];(s=t.watchers.__watchall__)&&(a=a?a.concat(s):s),o=a?a.length:0;for(var l=0;l<o;l++)a[l].call(t,e,n,r,i)}else for(var e in t)t.hasOwnProperty(e)&&A(t,e,n,r,i)},L=["pop","push","reverse","shift","sort","slice","unshift","splice"],N=function(t,e,n,r){h(t,n,(function(){var i,o,s,a,l=0;if("splice"===n){var u=arguments[0],c=u+arguments[1];for(s=t.slice(u,c),o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];l=u}else o=arguments.length>0?arguments[0]:void 0;return a=e.apply(t,arguments),"slice"!==n&&("pop"===n?(s=a,l=t.length):"push"===n?l=t.length-1:"shift"===n?s=a:"unshift"!==n&&void 0===o&&(o=a),r.call(t,l,n,o,s)),a}))},k=function(t,e){if(o(e)&&t&&!(t instanceof String)&&s(t))for(var n,r=L.length;r--;)N(t,t[n=L[r]],n,e)},O=function(t,e,n){if(e){if(t.watchers&&t.watchers[e])if(void 0===n)delete t.watchers[e];else for(var r=0;r<t.watchers[e].length;r++)t.watchers[e][r]==n&&t.watchers[e].splice(r,1)}else delete t.watchers;H(t,e,n),B(t,e)},_=function(t,e){return t.watchers&&(t.watchers.__wjs_suspend__||t.watchers["__wjs_suspend__"+e])},I=function(t,e){T((function(){delete t.watchers.__wjs_suspend__,delete t.watchers["__wjs_suspend__"+e]}))},M=null,P=function(t,e,n,i,o){r[r.length]={obj:t,prop:e,mode:n,newval:i,oldval:o},null===M&&(M=setTimeout(D))},D=function(){var t=null;M=null;for(var e=0;e<r.length;e++)t=r[e],A(t.obj,t.prop,t.mode,t.newval,t.oldval);t&&(r=[],t=null)},R=function(t,e){var n,r=!0;if(t!==e)if(a(t)){for(n in t)if((i||"watchers"!==n)&&t[n]!==e[n]){r=!1;break}}else r=!1;return r},F=function(t,n,r,i){var o;o=u("$$watchlengthsubjectroot"===n?t:t[n]),e.push({obj:t,prop:n,actual:o,watcher:r,level:i})},H=function(t,n,r){for(var i=0;i<e.length;i++){var o=e[i];o.obj==t&&(n&&o.prop!=n||r&&o.watcher!=r||e.splice(i--,1))}},B=function(t,e){for(var r=0;r<n.length;r++){var i=n[r],o=i.object.watchers;i.object==t&&(!e||i.prop==e)&&o&&(!e||!o[e]||0==o[e].length)&&n.splice(r--,1)}};return setInterval((function(){for(var t=0;t<e.length;t++){var r=e[t];if("$$watchlengthsubjectroot"===r.prop)((i=l(r.obj,r.actual)).added.length||i.removed.length)&&(i.added.length&&d(r.obj,i.added,r.watcher,r.level-1,!0),r.watcher.call(r.obj,"root","differentattr",i,r.actual)),r.actual=u(r.obj);else{var i;if((i=l(r.obj[r.prop],r.actual)).added.length||i.removed.length){if(i.added.length)for(var o=0;o<r.obj.watchers[r.prop].length;o++)d(r.obj[r.prop],i.added,r.obj.watchers[r.prop][o],r.level-1,!0);A(r.obj,r.prop,"differentattr",i,r.actual)}r.actual=u(r.obj[r.prop])}}var s,a;if(n.length>0)for(t=0;t<n.length;t++)a=(s=n[t]).object[s.prop],R(s.orig,a)||(s.orig=u(a),s.callback(a))}),50),t.watch=function(){o(arguments[1])?f.apply(this,arguments):s(arguments[1])?d.apply(this,arguments):g.apply(this,arguments)},t.unwatch=function(){o(arguments[1])?v.apply(this,arguments):s(arguments[1])?m.apply(this,arguments):O.apply(this,arguments)},t.callWatchers=A,t.suspend=function(t,e){if(t.watchers){var n="__wjs_suspend__"+(void 0!==e?e:"");t.watchers[n]=!0}},t.onChange=function(){var t=o(arguments[2])?w:C;t.apply(this,arguments)},t}()},function(t,e){function n(){return this.atn=null,this.stateNumber=n.INVALID_STATE_NUMBER,this.stateType=null,this.ruleIndex=0,this.epsilonOnlyTransitions=!1,this.transitions=[],this.nextTokenWithinRule=null,this}function r(){return n.call(this),this.stateType=n.BASIC,this}function i(){return n.call(this),this.decision=-1,this.nonGreedy=!1,this}function o(){return i.call(this),this.endState=null,this}function s(){return o.call(this),this.stateType=n.BLOCK_START,this}function a(){return n.call(this),this.stateType=n.BLOCK_END,this.startState=null,this}function l(){return n.call(this),this.stateType=n.RULE_STOP,this}function u(){return n.call(this),this.stateType=n.RULE_START,this.stopState=null,this.isPrecedenceRule=!1,this}function c(){return i.call(this),this.stateType=n.PLUS_LOOP_BACK,this}function h(){return o.call(this),this.stateType=n.PLUS_BLOCK_START,this.loopBackState=null,this}function p(){return o.call(this),this.stateType=n.STAR_BLOCK_START,this}function f(){return n.call(this),this.stateType=n.STAR_LOOP_BACK,this}function d(){return i.call(this),this.stateType=n.STAR_LOOP_ENTRY,this.loopBackState=null,this.isPrecedenceDecision=null,this}function g(){return n.call(this),this.stateType=n.LOOP_END,this.loopBackState=null,this}function v(){return i.call(this),this.stateType=n.TOKEN_START,this}n.INVALID_TYPE=0,n.BASIC=1,n.RULE_START=2,n.BLOCK_START=3,n.PLUS_BLOCK_START=4,n.STAR_BLOCK_START=5,n.TOKEN_START=6,n.RULE_STOP=7,n.BLOCK_END=8,n.STAR_LOOP_BACK=9,n.STAR_LOOP_ENTRY=10,n.PLUS_LOOP_BACK=11,n.LOOP_END=12,n.serializationNames=["INVALID","BASIC","RULE_START","BLOCK_START","PLUS_BLOCK_START","STAR_BLOCK_START","TOKEN_START","RULE_STOP","BLOCK_END","STAR_LOOP_BACK","STAR_LOOP_ENTRY","PLUS_LOOP_BACK","LOOP_END"],n.INVALID_STATE_NUMBER=-1,n.prototype.toString=function(){return this.stateNumber},n.prototype.equals=function(t){return t instanceof n&&this.stateNumber===t.stateNumber},n.prototype.isNonGreedyExitState=function(){return!1},n.prototype.addTransition=function(t,e){void 0===e&&(e=-1),0===this.transitions.length?this.epsilonOnlyTransitions=t.isEpsilon:this.epsilonOnlyTransitions!==t.isEpsilon&&(this.epsilonOnlyTransitions=!1),-1===e?this.transitions.push(t):this.transitions.splice(e,1,t)},r.prototype=Object.create(n.prototype),r.prototype.constructor=r,i.prototype=Object.create(n.prototype),i.prototype.constructor=i,o.prototype=Object.create(i.prototype),o.prototype.constructor=o,s.prototype=Object.create(o.prototype),s.prototype.constructor=s,a.prototype=Object.create(n.prototype),a.prototype.constructor=a,l.prototype=Object.create(n.prototype),l.prototype.constructor=l,u.prototype=Object.create(n.prototype),u.prototype.constructor=u,c.prototype=Object.create(i.prototype),c.prototype.constructor=c,h.prototype=Object.create(o.prototype),h.prototype.constructor=h,p.prototype=Object.create(o.prototype),p.prototype.constructor=p,f.prototype=Object.create(n.prototype),f.prototype.constructor=f,d.prototype=Object.create(i.prototype),d.prototype.constructor=d,g.prototype=Object.create(n.prototype),g.prototype.constructor=g,v.prototype=Object.create(i.prototype),v.prototype.constructor=v,e.ATNState=n,e.BasicState=r,e.DecisionState=i,e.BlockStartState=o,e.BlockEndState=a,e.LoopEndState=g,e.RuleStartState=u,e.RuleStopState=l,e.TokensStartState=v,e.PlusLoopbackState=c,e.StarLoopbackState=f,e.StarLoopEntryState=d,e.PlusBlockStartState=h,e.StarBlockStartState=p,e.BasicBlockStartState=s},function(t,e,n){var r=n(17).Token,i=n(18).Interval,o=new i(-1,-2);n(16);function s(){return this}function a(){return s.call(this),this}function l(){return a.call(this),this}function u(){return l.call(this),this}function c(){return l.call(this),this}function h(){return c.call(this),this}function p(){return this}function f(){return this}function d(t){return c.call(this),this.parentCtx=null,this.symbol=t,this}function g(t){return d.call(this,t),this}function v(){return this}a.prototype=Object.create(s.prototype),a.prototype.constructor=a,l.prototype=Object.create(a.prototype),l.prototype.constructor=l,u.prototype=Object.create(l.prototype),u.prototype.constructor=u,c.prototype=Object.create(l.prototype),c.prototype.constructor=c,h.prototype=Object.create(c.prototype),h.prototype.constructor=h,p.prototype.visit=function(t){return Array.isArray(t)?t.map((function(t){return t.accept(this)}),this):t.accept(this)},p.prototype.visitChildren=function(t){return t.children?this.visit(t.children):null},p.prototype.visitTerminal=function(t){},p.prototype.visitErrorNode=function(t){},f.prototype.visitTerminal=function(t){},f.prototype.visitErrorNode=function(t){},f.prototype.enterEveryRule=function(t){},f.prototype.exitEveryRule=function(t){},d.prototype=Object.create(c.prototype),d.prototype.constructor=d,d.prototype.getChild=function(t){return null},d.prototype.getSymbol=function(){return this.symbol},d.prototype.getParent=function(){return this.parentCtx},d.prototype.getPayload=function(){return this.symbol},d.prototype.getSourceInterval=function(){if(null===this.symbol)return o;var t=this.symbol.tokenIndex;return new i(t,t)},d.prototype.getChildCount=function(){return 0},d.prototype.accept=function(t){return t.visitTerminal(this)},d.prototype.getText=function(){return this.symbol.text},d.prototype.toString=function(){return this.symbol.type===r.EOF?"<EOF>":this.symbol.text},g.prototype=Object.create(d.prototype),g.prototype.constructor=g,g.prototype.isErrorNode=function(){return!0},g.prototype.accept=function(t){return t.visitErrorNode(this)},v.prototype.walk=function(t,e){if(e instanceof h||void 0!==e.isErrorNode&&e.isErrorNode())t.visitErrorNode(e);else if(e instanceof c)t.visitTerminal(e);else{this.enterRule(t,e);for(var n=0;n<e.getChildCount();n++){var r=e.getChild(n);this.walk(t,r)}this.exitRule(t,e)}},v.prototype.enterRule=function(t,e){var n=e.getRuleContext();t.enterEveryRule(n),n.enterRule(t)},v.prototype.exitRule=function(t,e){var n=e.getRuleContext();n.exitRule(t),t.exitEveryRule(n)},v.DEFAULT=new v,e.RuleNode=u,e.ErrorNode=h,e.TerminalNode=c,e.ErrorNodeImpl=g,e.TerminalNodeImpl=d,e.ParseTreeListener=f,e.ParseTreeVisitor=p,e.ParseTreeWalker=v,e.INVALID_INTERVAL=o},function(t,e,n){var r=n(28).PredicateTransition;function i(t){if(Error.call(this),Error.captureStackTrace)Error.captureStackTrace(this,i);else(new Error).stack;return this.message=t.message,this.recognizer=t.recognizer,this.input=t.input,this.ctx=t.ctx,this.offendingToken=null,this.offendingState=-1,null!==this.recognizer&&(this.offendingState=this.recognizer.state),this}function o(t,e,n,r){return i.call(this,{message:"",recognizer:t,input:e,ctx:null}),this.startIndex=n,this.deadEndConfigs=r,this}function s(t,e,n,r,o,s){s=s||t._ctx,r=r||t.getCurrentToken(),n=n||t.getCurrentToken(),e=e||t.getInputStream(),i.call(this,{message:"",recognizer:t,input:e,ctx:s}),this.deadEndConfigs=o,this.startToken=n,this.offendingToken=r}function a(t){i.call(this,{message:"",recognizer:t,input:t.getInputStream(),ctx:t._ctx}),this.offendingToken=t.getCurrentToken()}function l(t,e,n){i.call(this,{message:this.formatMessage(e,n||null),recognizer:t,input:t.getInputStream(),ctx:t._ctx});var o=t._interp.atn.states[t.state].transitions[0];return o instanceof r?(this.ruleIndex=o.ruleIndex,this.predicateIndex=o.predIndex):(this.ruleIndex=0,this.predicateIndex=0),this.predicate=e,this.offendingToken=t.getCurrentToken(),this}function u(){return Error.call(this),Error.captureStackTrace(this,u),this}i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.getExpectedTokens=function(){return null!==this.recognizer?this.recognizer.atn.getExpectedTokens(this.offendingState,this.ctx):null},i.prototype.toString=function(){return this.message},o.prototype=Object.create(i.prototype),o.prototype.constructor=o,o.prototype.toString=function(){var t="";return this.startIndex>=0&&this.startIndex<this.input.size&&(t=this.input.getText((this.startIndex,this.startIndex))),"LexerNoViableAltException"+t},s.prototype=Object.create(i.prototype),s.prototype.constructor=s,a.prototype=Object.create(i.prototype),a.prototype.constructor=a,l.prototype=Object.create(i.prototype),l.prototype.constructor=l,l.prototype.formatMessage=function(t,e){return null!==e?e:"failed predicate: {"+t+"}?"},u.prototype=Object.create(Error.prototype),u.prototype.constructor=u,e.RecognitionException=i,e.NoViableAltException=s,e.LexerNoViableAltException=o,e.InputMismatchException=a,e.FailedPredicateException=l,e.ParseCancellationException=u},,function(t,e,n){var r=n(41).RuleContext,i=n(16).Hash,o=n(16).Map;function s(t){this.cachedHashCode=t}function a(){return this.cache=new o,this}function l(t,e){var n,r=new i;null!==t?r.update(t,e):r.update(1),n=r.finish(),s.call(this,n),this.parentCtx=t,this.returnState=e}function u(){return l.call(this,null,s.EMPTY_RETURN_STATE),this}function c(t,e){var n=new i;n.update(t,e);var r=n.finish();return s.call(this,r),this.parents=t,this.returnStates=e,this}function h(t,e,n,r){if(t===e)return t;if(t instanceof l&&e instanceof l)return function(t,e,n,r){if(null!==r){var i=r.get(t,e);if(null!==i)return i;if(null!==(i=r.get(e,t)))return i}var o=function(t,e,n){if(n){if(t===s.EMPTY)return s.EMPTY;if(e===s.EMPTY)return s.EMPTY}else{if(t===s.EMPTY&&e===s.EMPTY)return s.EMPTY;if(t===s.EMPTY){var r=[e.returnState,s.EMPTY_RETURN_STATE];return new c([e.parentCtx,null],r)}if(e===s.EMPTY){r=[t.returnState,s.EMPTY_RETURN_STATE];return new c([t.parentCtx,null],r)}}return null}(t,e,n);if(null!==o)return null!==r&&r.set(t,e,o),o;if(t.returnState===e.returnState){var a=h(t.parentCtx,e.parentCtx,n,r);if(a===t.parentCtx)return t;if(a===e.parentCtx)return e;var u=l.create(a,t.returnState);return null!==r&&r.set(t,e,u),u}var p=null;if((t===e||null!==t.parentCtx&&t.parentCtx===e.parentCtx)&&(p=t.parentCtx),null!==p){var f=[t.returnState,e.returnState];t.returnState>e.returnState&&(f[0]=e.returnState,f[1]=t.returnState);var d=new c(g=[p,p],f);return null!==r&&r.set(t,e,d),d}f=[t.returnState,e.returnState];var g=[t.parentCtx,e.parentCtx];t.returnState>e.returnState&&(f[0]=e.returnState,f[1]=t.returnState,g=[e.parentCtx,t.parentCtx]);var v=new c(g,f);return null!==r&&r.set(t,e,v),v}(t,e,n,r);if(n){if(t instanceof u)return t;if(e instanceof u)return e}return t instanceof l&&(t=new c([t.getParent()],[t.returnState])),e instanceof l&&(e=new c([e.getParent()],[e.returnState])),function(t,e,n,r){if(null!==r){var i=r.get(t,e);if(null!==i)return i;if(null!==(i=r.get(e,t)))return i}var a=0,u=0,p=0,f=[],d=[];for(;a<t.returnStates.length&&u<e.returnStates.length;){var g=t.parents[a],v=e.parents[u];if(t.returnStates[a]===e.returnStates[u]){var m=t.returnStates[a],y=m===s.EMPTY_RETURN_STATE&&null===g&&null===v,x=null!==g&&null!==v&&g===v;if(y||x)d[p]=g,f[p]=m;else{var S=h(g,v,n,r);d[p]=S,f[p]=m}a+=1,u+=1}else t.returnStates[a]<e.returnStates[u]?(d[p]=g,f[p]=t.returnStates[a],a+=1):(d[p]=v,f[p]=e.returnStates[u],u+=1);p+=1}if(a<t.returnStates.length)for(var b=a;b<t.returnStates.length;b++)d[p]=t.parents[b],f[p]=t.returnStates[b],p+=1;else for(b=u;b<e.returnStates.length;b++)d[p]=e.parents[b],f[p]=e.returnStates[b],p+=1;if(p<d.length){if(1===p){var T=l.create(d[0],f[0]);return null!==r&&r.set(t,e,T),T}d=d.slice(0,p),f=f.slice(0,p)}var C=new c(d,f);if(C===t)return null!==r&&r.set(t,e,t),t;if(C===e)return null!==r&&r.set(t,e,e),e;(function(t){for(var e=new o,n=0;n<t.length;n++){var r=t[n];e.containsKey(r)||e.put(r,r)}for(var i=0;i<t.length;i++)t[i]=e.get(t[i])})(d),null!==r&&r.set(t,e,C);return C}(t,e,n,r)}s.EMPTY=null,s.EMPTY_RETURN_STATE=2147483647,s.globalNodeCount=1,s.id=s.globalNodeCount,s.prototype.isEmpty=function(){return this===s.EMPTY},s.prototype.hasEmptyPath=function(){return this.getReturnState(this.length-1)===s.EMPTY_RETURN_STATE},s.prototype.hashCode=function(){return this.cachedHashCode},s.prototype.updateHashCode=function(t){t.update(this.cachedHashCode)},a.prototype.add=function(t){if(t===s.EMPTY)return s.EMPTY;var e=this.cache.get(t)||null;return null!==e?e:(this.cache.put(t,t),t)},a.prototype.get=function(t){return this.cache.get(t)||null},Object.defineProperty(a.prototype,"length",{get:function(){return this.cache.length}}),l.prototype=Object.create(s.prototype),l.prototype.contructor=l,l.create=function(t,e){return e===s.EMPTY_RETURN_STATE&&null===t?s.EMPTY:new l(t,e)},Object.defineProperty(l.prototype,"length",{get:function(){return 1}}),l.prototype.getParent=function(t){return this.parentCtx},l.prototype.getReturnState=function(t){return this.returnState},l.prototype.equals=function(t){return this===t||t instanceof l&&(this.hashCode()===t.hashCode()&&(this.returnState===t.returnState&&(null==this.parentCtx?null==t.parentCtx:this.parentCtx.equals(t.parentCtx))))},l.prototype.toString=function(){var t=null===this.parentCtx?"":this.parentCtx.toString();return 0===t.length?this.returnState===s.EMPTY_RETURN_STATE?"$":""+this.returnState:this.returnState+" "+t},u.prototype=Object.create(l.prototype),u.prototype.constructor=u,u.prototype.isEmpty=function(){return!0},u.prototype.getParent=function(t){return null},u.prototype.getReturnState=function(t){return this.returnState},u.prototype.equals=function(t){return this===t},u.prototype.toString=function(){return"$"},s.EMPTY=new u,c.prototype=Object.create(s.prototype),c.prototype.constructor=c,c.prototype.isEmpty=function(){return this.returnStates[0]===s.EMPTY_RETURN_STATE},Object.defineProperty(c.prototype,"length",{get:function(){return this.returnStates.length}}),c.prototype.getParent=function(t){return this.parents[t]},c.prototype.getReturnState=function(t){return this.returnStates[t]},c.prototype.equals=function(t){return this===t||t instanceof c&&(this.hashCode()===t.hashCode()&&(this.returnStates===t.returnStates&&this.parents===t.parents))},c.prototype.toString=function(){if(this.isEmpty())return"[]";for(var t="[",e=0;e<this.returnStates.length;e++)e>0&&(t+=", "),this.returnStates[e]!==s.EMPTY_RETURN_STATE?(t+=this.returnStates[e],null!==this.parents[e]?t=t+" "+this.parents[e]:t+="null"):t+="$";return t+"]"},e.merge=h,e.PredictionContext=s,e.PredictionContextCache=a,e.SingletonPredictionContext=l,e.predictionContextFromRuleContext=function t(e,n){if(null==n&&(n=r.EMPTY),null===n.parentCtx||n===r.EMPTY)return s.EMPTY;var i=t(e,n.parentCtx),o=e.states[n.invokingState].transitions[0];return l.create(i,o.followState.stateNumber)},e.getCachedPredictionContext=function t(e,n,r){if(e.isEmpty())return e;var i=r.get(e)||null;if(null!==i)return i;if(null!==(i=n.get(e)))return r.put(e,i),i;for(var o=!1,a=[],u=0;u<a.length;u++){var h=t(e.getParent(u),n,r);if(o||h!==e.getParent(u)){if(!o){a=[];for(var p=0;p<e.length;p++)a[p]=e.getParent(p);o=!0}a[u]=h}}if(!o)return n.add(e),r.put(e,e),e;var f=null;return f=0===a.length?s.EMPTY:1===a.length?l.create(a[0],e.getReturnState(0)):new c(a,e.returnStates),n.add(f),r.put(f,f),r.put(e,f),f}},,,function(t,e,n){var r=n(72).LL1Analyzer,i=n(18).IntervalSet;function o(t,e){return this.grammarType=t,this.maxTokenType=e,this.states=[],this.decisionToState=[],this.ruleToStartState=[],this.ruleToStopState=null,this.modeNameToStartState={},this.ruleToTokenType=null,this.lexerActions=null,this.modeToStartState=[],this}o.prototype.nextTokensInContext=function(t,e){return new r(this).LOOK(t,null,e)},o.prototype.nextTokensNoContext=function(t){return null!==t.nextTokenWithinRule||(t.nextTokenWithinRule=this.nextTokensInContext(t,null),t.nextTokenWithinRule.readOnly=!0),t.nextTokenWithinRule},o.prototype.nextTokens=function(t,e){return void 0===e?this.nextTokensNoContext(t):this.nextTokensInContext(t,e)},o.prototype.addState=function(t){null!==t&&(t.atn=this,t.stateNumber=this.states.length),this.states.push(t)},o.prototype.removeState=function(t){this.states[t.stateNumber]=null},o.prototype.defineDecisionState=function(t){return this.decisionToState.push(t),t.decision=this.decisionToState.length-1,t.decision},o.prototype.getDecisionState=function(t){return 0===this.decisionToState.length?null:this.decisionToState[t]};var s=n(17).Token;o.prototype.getExpectedTokens=function(t,e){if(t<0||t>=this.states.length)throw"Invalid state number.";var n=this.states[t],r=this.nextTokens(n);if(!r.contains(s.EPSILON))return r;var o=new i;for(o.addSet(r),o.removeOne(s.EPSILON);null!==e&&e.invokingState>=0&&r.contains(s.EPSILON);){var a=this.states[e.invokingState].transitions[0];r=this.nextTokens(a.followState),o.addSet(r),o.removeOne(s.EPSILON),e=e.parentCtx}return r.contains(s.EPSILON)&&o.addOne(s.EOF),o},o.INVALID_ALT_NUMBER=0,e.ATN=o},function(t,e,n){var r=n(17).Token,i=(n(18).Interval,n(18).IntervalSet),o=n(32).Predicate,s=n(32).PrecedencePredicate;function a(t){if(null==t)throw"target cannot be null.";return this.target=t,this.isEpsilon=!1,this.label=null,this}function l(t,e){return a.call(this,t),this.label_=e,this.label=this.makeLabel(),this.serializationType=a.ATOM,this}function u(t,e,n,r){return a.call(this,t),this.ruleIndex=e,this.precedence=n,this.followState=r,this.serializationType=a.RULE,this.isEpsilon=!0,this}function c(t,e){return a.call(this,t),this.serializationType=a.EPSILON,this.isEpsilon=!0,this.outermostPrecedenceReturn=e,this}function h(t,e,n){return a.call(this,t),this.serializationType=a.RANGE,this.start=e,this.stop=n,this.label=this.makeLabel(),this}function p(t){return a.call(this,t),this}function f(t,e,n,r){return p.call(this,t),this.serializationType=a.PREDICATE,this.ruleIndex=e,this.predIndex=n,this.isCtxDependent=r,this.isEpsilon=!0,this}function d(t,e,n,r){return a.call(this,t),this.serializationType=a.ACTION,this.ruleIndex=e,this.actionIndex=void 0===n?-1:n,this.isCtxDependent=void 0!==r&&r,this.isEpsilon=!0,this}function g(t,e){return a.call(this,t),this.serializationType=a.SET,null!=e?this.label=e:(this.label=new i,this.label.addOne(r.INVALID_TYPE)),this}function v(t,e){return g.call(this,t,e),this.serializationType=a.NOT_SET,this}function m(t){return a.call(this,t),this.serializationType=a.WILDCARD,this}function y(t,e){return p.call(this,t),this.serializationType=a.PRECEDENCE,this.precedence=e,this.isEpsilon=!0,this}a.EPSILON=1,a.RANGE=2,a.RULE=3,a.PREDICATE=4,a.ATOM=5,a.ACTION=6,a.SET=7,a.NOT_SET=8,a.WILDCARD=9,a.PRECEDENCE=10,a.serializationNames=["INVALID","EPSILON","RANGE","RULE","PREDICATE","ATOM","ACTION","SET","NOT_SET","WILDCARD","PRECEDENCE"],a.serializationTypes={EpsilonTransition:a.EPSILON,RangeTransition:a.RANGE,RuleTransition:a.RULE,PredicateTransition:a.PREDICATE,AtomTransition:a.ATOM,ActionTransition:a.ACTION,SetTransition:a.SET,NotSetTransition:a.NOT_SET,WildcardTransition:a.WILDCARD,PrecedencePredicateTransition:a.PRECEDENCE},l.prototype=Object.create(a.prototype),l.prototype.constructor=l,l.prototype.makeLabel=function(){var t=new i;return t.addOne(this.label_),t},l.prototype.matches=function(t,e,n){return this.label_===t},l.prototype.toString=function(){return this.label_},u.prototype=Object.create(a.prototype),u.prototype.constructor=u,u.prototype.matches=function(t,e,n){return!1},c.prototype=Object.create(a.prototype),c.prototype.constructor=c,c.prototype.matches=function(t,e,n){return!1},c.prototype.toString=function(){return"epsilon"},h.prototype=Object.create(a.prototype),h.prototype.constructor=h,h.prototype.makeLabel=function(){var t=new i;return t.addRange(this.start,this.stop),t},h.prototype.matches=function(t,e,n){return t>=this.start&&t<=this.stop},h.prototype.toString=function(){return"'"+String.fromCharCode(this.start)+"'..'"+String.fromCharCode(this.stop)+"'"},p.prototype=Object.create(a.prototype),p.prototype.constructor=p,f.prototype=Object.create(p.prototype),f.prototype.constructor=f,f.prototype.matches=function(t,e,n){return!1},f.prototype.getPredicate=function(){return new o(this.ruleIndex,this.predIndex,this.isCtxDependent)},f.prototype.toString=function(){return"pred_"+this.ruleIndex+":"+this.predIndex},d.prototype=Object.create(a.prototype),d.prototype.constructor=d,d.prototype.matches=function(t,e,n){return!1},d.prototype.toString=function(){return"action_"+this.ruleIndex+":"+this.actionIndex},g.prototype=Object.create(a.prototype),g.prototype.constructor=g,g.prototype.matches=function(t,e,n){return this.label.contains(t)},g.prototype.toString=function(){return this.label.toString()},v.prototype=Object.create(g.prototype),v.prototype.constructor=v,v.prototype.matches=function(t,e,n){return t>=e&&t<=n&&!g.prototype.matches.call(this,t,e,n)},v.prototype.toString=function(){return"~"+g.prototype.toString.call(this)},m.prototype=Object.create(a.prototype),m.prototype.constructor=m,m.prototype.matches=function(t,e,n){return t>=e&&t<=n},m.prototype.toString=function(){return"."},y.prototype=Object.create(p.prototype),y.prototype.constructor=y,y.prototype.matches=function(t,e,n){return!1},y.prototype.getPredicate=function(){return new s(this.precedence)},y.prototype.toString=function(){return this.precedence+" >= _p"},e.Transition=a,e.AtomTransition=l,e.SetTransition=g,e.NotSetTransition=v,e.RuleTransition=u,e.ActionTransition=d,e.EpsilonTransition=c,e.RangeTransition=h,e.WildcardTransition=m,e.PredicateTransition=f,e.PrecedencePredicateTransition=y,e.AbstractPredicateTransition=p},function(t,e,n){"use strict";var r,i=function(){function t(t,e){void 0===e&&(e="pt"),this.lsKey=t,this.defaultLang=e,this.listeners=[],this.document=document,this.setupListener()}return t.prototype.setupListener=function(){var t=this;null!==this.document&&this.document.addEventListener("storage",(function(e){e.key===t.lsKey&&t.listeners.forEach((function(t){return t()}))}))},t.prototype.getLang=function(){var t=localStorage.getItem(this.lsKey);return null==t?(console.warn("Internal Error: User language information has not been set. Returning default..."),this.getDefaultLang()):t},t.prototype.getDefaultLang=function(){return this.defaultLang},t.prototype.registerLanguageChangeListener=function(t){this.listeners.push(t)},t}();!function(t){t.ERROR="error",t.MESSAGE="message",t.UI="ui"}(r||(r={}));var o=function(){function t(t,e,n){var r=this;void 0===n&&(n=!1),this.service=t,this.i18nData=e,this.listenToChange=n,this.document=document,this.listenToChange&&t.registerLanguageChangeListener((function(){r.updateTagText()}))}return t.prototype.getString=function(t,e){var n=this.i18nData[this.service.getLang()];return n?n[e]&&n[e][t]?n[e][t]:this.getDefaultString(t,e):(console.warn("Internal Error. The language set at ivprog.lang is not valid: "+this.service.getLang()),this.getDefaultString(t,e))},t.prototype.getDefaultString=function(t,e){var n=this.i18nData[this.service.getDefaultLang()];return n[e]?n[e][t]?n[e][t]:"{MISSING_I18N_IDENTIFIER: "+t+"}":"{MISSING_I18N_TYPE_IDENTIFIER: "+e+"}"},t.prototype.getOR=function(){return this.getUI("string_join_or")},t.prototype.getError=function(t,e){void 0===e&&(e=[]);var n=this.getString(t,r.ERROR);return this.processString(n,e)},t.prototype.getMessage=function(t,e){void 0===e&&(e=[]);var n=this.getString(t,r.MESSAGE);return this.processString(n,e)},t.prototype.getUI=function(t,e){void 0===e&&(e=[]);var n=this.getString(t,r.UI);return this.processString(n,e)},t.prototype.processString=function(t,e){for(var n=0;n<e.length;n++){var r=e[n];t=t.replace("$"+n,r)}return t},t.prototype.updateTagText=function(t){var e=this;(void 0===t&&(t=null),null!==this.document)&&this.document.querySelectorAll("data.i18n").forEach((function(n){n.innerHTML=null===t?e.processTagTex(n.getAttribute("value")):t(n.getAttribute("value"))}))},t.prototype.processTagTex=function(t){if(null===t)return"<Invalid i18n identifier>";var e=t.split(":"),n=e[0].toLowerCase(),i=e[1];return r.ERROR===n?this.getError(i):r.MESSAGE===n?this.getMessage(i):r.UI===n?this.getUI(i):(console.warn(" A string has been passed to the i18n helper function that was not in the form type:id -> "+t),this.getString(i,n))},t}(),s=function(){function t(t){this.lang=t,this.listeners=[]}return t.prototype.setupListener=function(){},t.prototype.notifyChange=function(){this.listeners.forEach((function(t){return t()}))},t.prototype.setLang=function(t){this.lang=t,this.notifyChange()},t.prototype.getLang=function(){return this.lang},t.prototype.getDefaultLang=function(){return this.lang},t.prototype.registerLanguageChangeListener=function(t){this.listeners.push(t)},t}();e.a={LanguageService:i,LanguageServiceNoLS:s,LocalizedStrings:o,StringTypes:r}},function(t,e,n){var r=n(27).ATN,i=n(16),o=i.Hash,s=i.Set,a=n(32).SemanticContext,l=n(24).merge;function u(t){return t.hashCodeForConfigSet()}function c(t,e){return t===e||null!==t&&null!==e&&t.equalsForConfigSet(e)}function h(t){return this.configLookup=new s(u,c),this.fullCtx=void 0===t||t,this.readOnly=!1,this.configs=[],this.uniqueAlt=0,this.conflictingAlts=null,this.hasSemanticContext=!1,this.dipsIntoOuterContext=!1,this.cachedHashCode=-1,this}function p(){return h.call(this),this.configLookup=new s,this}h.prototype.add=function(t,e){if(void 0===e&&(e=null),this.readOnly)throw"This set is readonly";t.semanticContext!==a.NONE&&(this.hasSemanticContext=!0),t.reachesIntoOuterContext>0&&(this.dipsIntoOuterContext=!0);var n=this.configLookup.add(t);if(n===t)return this.cachedHashCode=-1,this.configs.push(t),!0;var r=!this.fullCtx,i=l(n.context,t.context,r,e);return n.reachesIntoOuterContext=Math.max(n.reachesIntoOuterContext,t.reachesIntoOuterContext),t.precedenceFilterSuppressed&&(n.precedenceFilterSuppressed=!0),n.context=i,!0},h.prototype.getStates=function(){for(var t=new s,e=0;e<this.configs.length;e++)t.add(this.configs[e].state);return t},h.prototype.getPredicates=function(){for(var t=[],e=0;e<this.configs.length;e++){var n=this.configs[e].semanticContext;n!==a.NONE&&t.push(n.semanticContext)}return t},Object.defineProperty(h.prototype,"items",{get:function(){return this.configs}}),h.prototype.optimizeConfigs=function(t){if(this.readOnly)throw"This set is readonly";if(0!==this.configLookup.length)for(var e=0;e<this.configs.length;e++){var n=this.configs[e];n.context=t.getCachedContext(n.context)}},h.prototype.addAll=function(t){for(var e=0;e<t.length;e++)this.add(t[e]);return!1},h.prototype.equals=function(t){return this===t||t instanceof h&&i.equalArrays(this.configs,t.configs)&&this.fullCtx===t.fullCtx&&this.uniqueAlt===t.uniqueAlt&&this.conflictingAlts===t.conflictingAlts&&this.hasSemanticContext===t.hasSemanticContext&&this.dipsIntoOuterContext===t.dipsIntoOuterContext},h.prototype.hashCode=function(){var t=new o;return t.update(this.configs),t.finish()},h.prototype.updateHashCode=function(t){this.readOnly?(-1===this.cachedHashCode&&(this.cachedHashCode=this.hashCode()),t.update(this.cachedHashCode)):t.update(this.hashCode())},Object.defineProperty(h.prototype,"length",{get:function(){return this.configs.length}}),h.prototype.isEmpty=function(){return 0===this.configs.length},h.prototype.contains=function(t){if(null===this.configLookup)throw"This method is not implemented for readonly sets.";return this.configLookup.contains(t)},h.prototype.containsFast=function(t){if(null===this.configLookup)throw"This method is not implemented for readonly sets.";return this.configLookup.containsFast(t)},h.prototype.clear=function(){if(this.readOnly)throw"This set is readonly";this.configs=[],this.cachedHashCode=-1,this.configLookup=new s},h.prototype.setReadonly=function(t){this.readOnly=t,t&&(this.configLookup=null)},h.prototype.toString=function(){return i.arrayToString(this.configs)+(this.hasSemanticContext?",hasSemanticContext="+this.hasSemanticContext:"")+(this.uniqueAlt!==r.INVALID_ALT_NUMBER?",uniqueAlt="+this.uniqueAlt:"")+(null!==this.conflictingAlts?",conflictingAlts="+this.conflictingAlts:"")+(this.dipsIntoOuterContext?",dipsIntoOuterContext":"")},p.prototype=Object.create(h.prototype),p.prototype.constructor=p,e.ATNConfigSet=h,e.OrderedATNConfigSet=p},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,n){var r=n(16).Set,i=n(16).Hash;function o(){return this}function s(t,e,n){return o.call(this),this.ruleIndex=void 0===t?-1:t,this.predIndex=void 0===e?-1:e,this.isCtxDependent=void 0!==n&&n,this}function a(t){o.call(this),this.precedence=void 0===t?0:t}function l(t,e){o.call(this);var n=new r;t instanceof l?t.opnds.map((function(t){n.add(t)})):n.add(t),e instanceof l?e.opnds.map((function(t){n.add(t)})):n.add(e);var i=a.filterPrecedencePredicates(n);if(i.length>0){var s=null;i.map((function(t){(null===s||t.precedence<s.precedence)&&(s=t)})),n.add(s)}return this.opnds=n.values(),this}function u(t,e){o.call(this);var n=new r;t instanceof u?t.opnds.map((function(t){n.add(t)})):n.add(t),e instanceof u?e.opnds.map((function(t){n.add(t)})):n.add(e);var i=a.filterPrecedencePredicates(n);if(i.length>0){var s=i.sort((function(t,e){return t.compareTo(e)})),l=s[s.length-1];n.add(l)}return this.opnds=n.values(),this}o.prototype.hashCode=function(){var t=new i;return this.updateHashCode(t),t.finish()},o.prototype.evaluate=function(t,e){},o.prototype.evalPrecedence=function(t,e){return this},o.andContext=function(t,e){if(null===t||t===o.NONE)return e;if(null===e||e===o.NONE)return t;var n=new l(t,e);return 1===n.opnds.length?n.opnds[0]:n},o.orContext=function(t,e){if(null===t)return e;if(null===e)return t;if(t===o.NONE||e===o.NONE)return o.NONE;var n=new u(t,e);return 1===n.opnds.length?n.opnds[0]:n},s.prototype=Object.create(o.prototype),s.prototype.constructor=s,o.NONE=new s,s.prototype.evaluate=function(t,e){var n=this.isCtxDependent?e:null;return t.sempred(n,this.ruleIndex,this.predIndex)},s.prototype.updateHashCode=function(t){t.update(this.ruleIndex,this.predIndex,this.isCtxDependent)},s.prototype.equals=function(t){return this===t||t instanceof s&&(this.ruleIndex===t.ruleIndex&&this.predIndex===t.predIndex&&this.isCtxDependent===t.isCtxDependent)},s.prototype.toString=function(){return"{"+this.ruleIndex+":"+this.predIndex+"}?"},a.prototype=Object.create(o.prototype),a.prototype.constructor=a,a.prototype.evaluate=function(t,e){return t.precpred(e,this.precedence)},a.prototype.evalPrecedence=function(t,e){return t.precpred(e,this.precedence)?o.NONE:null},a.prototype.compareTo=function(t){return this.precedence-t.precedence},a.prototype.updateHashCode=function(t){t.update(31)},a.prototype.equals=function(t){return this===t||t instanceof a&&this.precedence===t.precedence},a.prototype.toString=function(){return"{"+this.precedence+">=prec}?"},a.filterPrecedencePredicates=function(t){var e=[];return t.values().map((function(t){t instanceof a&&e.push(t)})),e},l.prototype=Object.create(o.prototype),l.prototype.constructor=l,l.prototype.equals=function(t){return this===t||t instanceof l&&this.opnds===t.opnds},l.prototype.updateHashCode=function(t){t.update(this.opnds,"AND")},l.prototype.evaluate=function(t,e){for(var n=0;n<this.opnds.length;n++)if(!this.opnds[n].evaluate(t,e))return!1;return!0},l.prototype.evalPrecedence=function(t,e){for(var n=!1,r=[],i=0;i<this.opnds.length;i++){var s=this.opnds[i],a=s.evalPrecedence(t,e);if(n|=a!==s,null===a)return null;a!==o.NONE&&r.push(a)}if(!n)return this;if(0===r.length)return o.NONE;var l=null;return r.map((function(t){l=null===l?t:o.andContext(l,t)})),l},l.prototype.toString=function(){var t="";return this.opnds.map((function(e){t+="&& "+e.toString()})),t.length>3?t.slice(3):t},u.prototype=Object.create(o.prototype),u.prototype.constructor=u,u.prototype.constructor=function(t){return this===t||t instanceof u&&this.opnds===t.opnds},u.prototype.updateHashCode=function(t){t.update(this.opnds,"OR")},u.prototype.evaluate=function(t,e){for(var n=0;n<this.opnds.length;n++)if(this.opnds[n].evaluate(t,e))return!0;return!1},u.prototype.evalPrecedence=function(t,e){for(var n=!1,r=[],i=0;i<this.opnds.length;i++){var s=this.opnds[i],a=s.evalPrecedence(t,e);if(n|=a!==s,a===o.NONE)return o.NONE;null!==a&&r.push(a)}if(!n)return this;if(0===r.length)return null;return r.map((function(t){return t})),null},u.prototype.toString=function(){var t="";return this.opnds.map((function(e){t+="|| "+e.toString()})),t.length>3?t.slice(3):t},e.SemanticContext=o,e.PrecedencePredicate=a,e.Predicate=s},function(t,e,n){var r=n(30).ATNConfigSet,i=n(16),o=i.Hash,s=i.Set;function a(t,e){return this.alt=e,this.pred=t,this}function l(t,e){return null===t&&(t=-1),null===e&&(e=new r),this.stateNumber=t,this.configs=e,this.edges=null,this.isAcceptState=!1,this.prediction=0,this.lexerActionExecutor=null,this.requiresFullContext=!1,this.predicates=null,this}a.prototype.toString=function(){return"("+this.pred+", "+this.alt+")"},l.prototype.getAltSet=function(){var t=new s;if(null!==this.configs)for(var e=0;e<this.configs.length;e++){var n=this.configs[e];t.add(n.alt)}return 0===t.length?null:t},l.prototype.equals=function(t){return this===t||t instanceof l&&this.configs.equals(t.configs)},l.prototype.toString=function(){var t=this.stateNumber+":"+this.configs;return this.isAcceptState&&(t+="=>",null!==this.predicates?t+=this.predicates:t+=this.prediction),t},l.prototype.hashCode=function(){var t=new o;return t.update(this.configs),t.finish()},e.DFAState=l,e.PredPrediction=a},function(t,e,n){t.exports=function(){"use strict";var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),r=/MSIE \d/.test(t),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),s=r||i||o,a=s&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(t),u=l&&/Qt\/\d+\.\d+/.test(t),c=!o&&/Chrome\//.test(t),h=/Opera\//.test(t),p=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),d=/PhantomJS/.test(t),g=!o&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t),v=/Android/.test(t),m=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=g||/Mac/.test(e),x=/\bCrOS\b/.test(t),S=/win/i.test(e),b=h&&t.match(/Version\/(\d*\.\d*)/);b&&(b=Number(b[1])),b&&b>=15&&(h=!1,l=!0);var T=y&&(u||h&&(null==b||b<12.11)),C=n||s&&a>=9;function w(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var E,A=function(t,e){var n=t.className,r=w(e).exec(n);if(r){var i=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function L(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function N(t,e){return L(t).appendChild(e)}function k(t,e,n,r){var i=document.createElement(t);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o<e.length;++o)i.appendChild(e[o]);return i}function O(t,e,n,r){var i=k(t,e,n,r);return i.setAttribute("role","presentation"),i}function _(t,e){if(3==e.nodeType&&(e=e.parentNode),t.contains)return t.contains(e);do{if(11==e.nodeType&&(e=e.host),e==t)return!0}while(e=e.parentNode)}function I(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function M(t,e){var n=t.className;w(e).test(n)||(t.className+=(n?" ":"")+e)}function P(t,e){for(var n=t.split(" "),r=0;r<n.length;r++)n[r]&&!w(n[r]).test(e)&&(e+=" "+n[r]);return e}E=document.createRange?function(t,e,n,r){var i=document.createRange();return i.setEnd(r||t,n),i.setStart(t,e),i}:function(t,e,n){var r=document.body.createTextRange();try{r.moveToElementText(t.parentNode)}catch(t){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",e),r};var D=function(t){t.select()};function R(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function F(t,e,n){for(var r in e||(e={}),t)!t.hasOwnProperty(r)||!1===n&&e.hasOwnProperty(r)||(e[r]=t[r]);return e}function H(t,e,n,r,i){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var o=r||0,s=i||0;;){var a=t.indexOf("\t",o);if(a<0||a>=e)return s+(e-o);s+=a-o,s+=n-s%n,o=a+1}}g?D=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:s&&(D=function(t){try{t.select()}catch(t){}});var B=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function W(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}B.prototype.onTimeout=function(t){t.id=0,t.time<=+new Date?t.f():setTimeout(t.handler,t.time-+new Date)},B.prototype.set=function(t,e){this.f=e;var n=+new Date+t;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,t),this.time=n)};var j={toString:function(){return"CodeMirror.Pass"}},z={scroll:!1},U={origin:"*mouse"},V={origin:"+move"};function q(t,e,n){for(var r=0,i=0;;){var o=t.indexOf("\t",r);-1==o&&(o=t.length);var s=o-r;if(o==t.length||i+s>=e)return r+Math.min(s,e-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=e)return r}}var G=[""];function K(t){for(;G.length<=t;)G.push(Y(G)+" ");return G[t]}function Y(t){return t[t.length-1]}function X(t,e){for(var n=[],r=0;r<t.length;r++)n[r]=e(t[r],r);return n}function $(){}function Z(t,e){var n;return Object.create?n=Object.create(t):($.prototype=t,n=new $),e&&F(e,n),n}var J=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Q(t){return/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||J.test(t))}function tt(t,e){return e?!!(e.source.indexOf("\\w")>-1&&Q(t))||e.test(t):Q(t)}function et(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var nt=/[\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 rt(t){return t.charCodeAt(0)>=768&&nt.test(t)}function it(t,e,n){for(;(n<0?e>0:e<t.length)&&rt(t.charAt(e));)e+=n;return e}function ot(t,e,n){for(var r=e>n?-1:1;;){if(e==n)return e;var i=(e+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+r}}var st=null;function at(t,e,n){var r;st=null;for(var i=0;i<t.length;++i){var o=t[i];if(o.from<e&&o.to>e)return i;o.to==e&&(o.from!=o.to&&"before"==n?r=i:st=i),o.from==e&&(o.from!=o.to&&"before"!=n?r=i:st=i)}return null!=r?r:st}var lt=function(){var t=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(t,e,n){this.level=t,this.from=e,this.to=n}return function(s,a){var l="ltr"==a?"L":"R";if(0==s.length||"ltr"==a&&!t.test(s))return!1;for(var u,c=s.length,h=[],p=0;p<c;++p)h.push((u=s.charCodeAt(p))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":8204==u?"b":"L");for(var f=0,d=l;f<c;++f){var g=h[f];"m"==g?h[f]=d:d=g}for(var v=0,m=l;v<c;++v){var y=h[v];"1"==y&&"r"==m?h[v]="n":n.test(y)&&(m=y,"r"==y&&(h[v]="R"))}for(var x=1,S=h[0];x<c-1;++x){var b=h[x];"+"==b&&"1"==S&&"1"==h[x+1]?h[x]="1":","!=b||S!=h[x+1]||"1"!=S&&"n"!=S||(h[x]=S),S=b}for(var T=0;T<c;++T){var C=h[T];if(","==C)h[T]="N";else if("%"==C){var w=void 0;for(w=T+1;w<c&&"%"==h[w];++w);for(var E=T&&"!"==h[T-1]||w<c&&"1"==h[w]?"1":"N",A=T;A<w;++A)h[A]=E;T=w-1}}for(var L=0,N=l;L<c;++L){var k=h[L];"L"==N&&"1"==k?h[L]="L":n.test(k)&&(N=k)}for(var O=0;O<c;++O)if(e.test(h[O])){var _=void 0;for(_=O+1;_<c&&e.test(h[_]);++_);for(var I="L"==(O?h[O-1]:l),M=I==("L"==(_<c?h[_]:l))?I?"L":"R":l,P=O;P<_;++P)h[P]=M;O=_-1}for(var D,R=[],F=0;F<c;)if(r.test(h[F])){var H=F;for(++F;F<c&&r.test(h[F]);++F);R.push(new o(0,H,F))}else{var B=F,W=R.length,j="rtl"==a?1:0;for(++F;F<c&&"L"!=h[F];++F);for(var z=B;z<F;)if(i.test(h[z])){B<z&&(R.splice(W,0,new o(1,B,z)),W+=j);var U=z;for(++z;z<F&&i.test(h[z]);++z);R.splice(W,0,new o(2,U,z)),W+=j,B=z}else++z;B<F&&R.splice(W,0,new o(1,B,F))}return"ltr"==a&&(1==R[0].level&&(D=s.match(/^\s+/))&&(R[0].from=D[0].length,R.unshift(new o(0,0,D[0].length))),1==Y(R).level&&(D=s.match(/\s+$/))&&(Y(R).to-=D[0].length,R.push(new o(0,c-D[0].length,c)))),"rtl"==a?R.reverse():R}}();function ut(t,e){var n=t.order;return null==n&&(n=t.order=lt(t.text,e)),n}var ct=[],ht=function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var r=t._handlers||(t._handlers={});r[e]=(r[e]||ct).concat(n)}};function pt(t,e){return t._handlers&&t._handlers[e]||ct}function ft(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var r=t._handlers,i=r&&r[e];if(i){var o=W(i,n);o>-1&&(r[e]=i.slice(0,o).concat(i.slice(o+1)))}}}function dt(t,e){var n=pt(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function gt(t,e,n){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),dt(t,n||e.type,t,e),bt(e)||e.codemirrorIgnore}function vt(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),r=0;r<e.length;++r)-1==W(n,e[r])&&n.push(e[r])}function mt(t,e){return pt(t,e).length>0}function yt(t){t.prototype.on=function(t,e){ht(this,t,e)},t.prototype.off=function(t,e){ft(this,t,e)}}function xt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function St(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function bt(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Tt(t){xt(t),St(t)}function Ct(t){return t.target||t.srcElement}function wt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var Et,At,Lt=function(){if(s&&a<9)return!1;var t=k("div");return"draggable"in t||"dragDrop"in t}();function Nt(t){if(null==Et){var e=k("span","​");N(t,k("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Et=e.offsetWidth<=1&&e.offsetHeight>2&&!(s&&a<8))}var n=Et?k("span","​"):k("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function kt(t){if(null!=At)return At;var e=N(t,document.createTextNode("AخA")),n=E(e,0,1).getBoundingClientRect(),r=E(e,1,2).getBoundingClientRect();return L(t),!(!n||n.left==n.right)&&(At=r.right-n.right<3)}var Ot,_t=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;e<=r;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),s=o.indexOf("\r");-1!=s?(n.push(o.slice(0,s)),e+=s+1):(n.push(o),e=i+1)}return n}:function(t){return t.split(/\r\n?|\n/)},It=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Mt="oncopy"in(Ot=k("div"))||(Ot.setAttribute("oncopy","return;"),"function"==typeof Ot.oncopy),Pt=null,Dt={},Rt={};function Ft(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Dt[t]=e}function Ht(t){if("string"==typeof t&&Rt.hasOwnProperty(t))t=Rt[t];else if(t&&"string"==typeof t.name&&Rt.hasOwnProperty(t.name)){var e=Rt[t.name];"string"==typeof e&&(e={name:e}),(t=Z(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Ht("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Ht("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Bt(t,e){e=Ht(e);var n=Dt[e.name];if(!n)return Bt(t,"text/plain");var r=n(t,e);if(Wt.hasOwnProperty(e.name)){var i=Wt[e.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var s in e.modeProps)r[s]=e.modeProps[s];return r}var Wt={};function jt(t,e){F(e,Wt.hasOwnProperty(t)?Wt[t]:Wt[t]={})}function zt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ut(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Vt(t,e,n){return!t.startState||t.startState(e,n)}var qt=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Gt(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(e<o){n=i;break}e-=o}return n.lines[e]}function Kt(t,e,n){var r=[],i=e.line;return t.iter(e.line,n.line+1,(function(t){var o=t.text;i==n.line&&(o=o.slice(0,n.ch)),i==e.line&&(o=o.slice(e.ch)),r.push(o),++i})),r}function Yt(t,e,n){var r=[];return t.iter(e,n,(function(t){r.push(t.text)})),r}function Xt(t,e){var n=e-t.height;if(n)for(var r=t;r;r=r.parent)r.height+=n}function $t(t){if(null==t.parent)return null;for(var e=t.parent,n=W(e.lines,t),r=e.parent;r;e=r,r=r.parent)for(var i=0;r.children[i]!=e;++i)n+=r.children[i].chunkSize();return n+e.first}function Zt(t,e){var n=t.first;t:do{for(var r=0;r<t.children.length;++r){var i=t.children[r],o=i.height;if(e<o){t=i;continue t}e-=o,n+=i.chunkSize()}return n}while(!t.lines);for(var s=0;s<t.lines.length;++s){var a=t.lines[s].height;if(e<a)break;e-=a}return n+s}function Jt(t,e){return e>=t.first&&e<t.first+t.size}function Qt(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function te(t,e,n){if(void 0===n&&(n=null),!(this instanceof te))return new te(t,e,n);this.line=t,this.ch=e,this.sticky=n}function ee(t,e){return t.line-e.line||t.ch-e.ch}function ne(t,e){return t.sticky==e.sticky&&0==ee(t,e)}function re(t){return te(t.line,t.ch)}function ie(t,e){return ee(t,e)<0?e:t}function oe(t,e){return ee(t,e)<0?t:e}function se(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function ae(t,e){if(e.line<t.first)return te(t.first,0);var n=t.first+t.size-1;return e.line>n?te(n,Gt(t,n).text.length):function(t,e){var n=t.ch;return null==n||n>e?te(t.line,e):n<0?te(t.line,0):t}(e,Gt(t,e.line).text.length)}function le(t,e){for(var n=[],r=0;r<e.length;r++)n[r]=ae(t,e[r]);return n}qt.prototype.eol=function(){return this.pos>=this.string.length},qt.prototype.sol=function(){return this.pos==this.lineStart},qt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},qt.prototype.eat=function(t){var e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t.test?t.test(e):t(e)))return++this.pos,e},qt.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},qt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},qt.prototype.skipToEnd=function(){this.pos=this.string.length},qt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},qt.prototype.backUp=function(t){this.pos-=t},qt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},qt.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},qt.prototype.match=function(t,e,n){if("string"!=typeof t){var r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var i=function(t){return n?t.toLowerCase():t};if(i(this.string.substr(this.pos,t.length))==i(t))return!1!==e&&(this.pos+=t.length),!0},qt.prototype.current=function(){return this.string.slice(this.start,this.pos)},qt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},qt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},qt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ue=function(t,e){this.state=t,this.lookAhead=e},ce=function(t,e,n,r){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function he(t,e,n,r){var i=[t.state.modeGen],o={};Se(t,e.text,t.doc.mode,n,(function(t,e){return i.push(t,e)}),o,r);for(var s=n.state,a=function(r){n.baseTokens=i;var a=t.state.overlays[r],l=1,u=0;n.state=!0,Se(t,e.text,a.mode,n,(function(t,e){for(var n=l;u<t;){var r=i[l];r>t&&i.splice(l,1,t,i[l+1],r),l+=2,u=Math.min(t,r)}if(e)if(a.opaque)i.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;n<l;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+e}}),o),n.state=s,n.baseTokens=null,n.baseTokenPos=1},l=0;l<t.state.overlays.length;++l)a(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function pe(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var r=fe(t,$t(e)),i=e.text.length>t.options.maxHighlightLength&&zt(t.doc.mode,r.state),o=he(t,e,r);i&&(r.state=i),e.stateAfter=r.save(!i),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function fe(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return new ce(r,!0,e);var o=function(t,e,n){for(var r,i,o=t.doc,s=n?-1:e-(t.doc.mode.innerMode?1e3:100),a=e;a>s;--a){if(a<=o.first)return o.first;var l=Gt(o,a-1),u=l.stateAfter;if(u&&(!n||a+(u instanceof ue?u.lookAhead:0)<=o.modeFrontier))return a;var c=H(l.text,null,t.options.tabSize);(null==i||r>c)&&(i=a-1,r=c)}return i}(t,e,n),s=o>r.first&&Gt(r,o-1).stateAfter,a=s?ce.fromSaved(r,s,o):new ce(r,Vt(r.mode),o);return r.iter(o,e,(function(n){de(t,n.text,a);var r=a.line;n.stateAfter=r==e-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?a.save():null,a.nextLine()})),n&&(r.modeFrontier=a.line),a}function de(t,e,n,r){var i=t.doc.mode,o=new qt(e,t.options.tabSize,n);for(o.start=o.pos=r||0,""==e&&ge(i,n.state);!o.eol();)ve(i,o,n.state),o.start=o.pos}function ge(t,e){if(t.blankLine)return t.blankLine(e);if(t.innerMode){var n=Ut(t,e);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function ve(t,e,n,r){for(var i=0;i<10;i++){r&&(r[0]=Ut(t,n).mode);var o=t.token(e,n);if(e.pos>e.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}ce.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},ce.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},ce.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ce.fromSaved=function(t,e,n){return e instanceof ue?new ce(t,zt(t.mode,e.state),n,e.lookAhead):new ce(t,zt(t.mode,e),n)},ce.prototype.save=function(t){var e=!1!==t?zt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ue(e,this.maxLookAhead):e};var me=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function ye(t,e,n,r){var i,o,s=t.doc,a=s.mode,l=Gt(s,(e=ae(s,e)).line),u=fe(t,e.line,n),c=new qt(l.text,t.options.tabSize,u);for(r&&(o=[]);(r||c.pos<e.ch)&&!c.eol();)c.start=c.pos,i=ve(a,c,u.state),r&&o.push(new me(c,i,zt(s.mode,u.state)));return r?o:new me(c,i,u.state)}function xe(t,e){if(t)for(;;){var n=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;t=t.slice(0,n.index)+t.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==e[r]?e[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(e[r])||(e[r]+=" "+n[2])}return t}function Se(t,e,n,r,i,o,s){var a=n.flattenSpans;null==a&&(a=t.options.flattenSpans);var l,u=0,c=null,h=new qt(e,t.options.tabSize,r),p=t.options.addModeClass&&[null];for(""==e&&xe(ge(n,r.state),o);!h.eol();){if(h.pos>t.options.maxHighlightLength?(a=!1,s&&de(t,e,r,h.pos),h.pos=e.length,l=null):l=xe(ve(n,h,r.state,p),o),p){var f=p[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||c!=l){for(;u<h.start;)i(u=Math.min(h.start,u+5e3),c);c=l}h.start=h.pos}for(;u<h.pos;){var d=Math.min(h.pos,u+5e3);i(d,c),u=d}}var be=!1,Te=!1;function Ce(t,e,n){this.marker=t,this.from=e,this.to=n}function we(t,e){if(t)for(var n=0;n<t.length;++n){var r=t[n];if(r.marker==e)return r}}function Ee(t,e){for(var n,r=0;r<t.length;++r)t[r]!=e&&(n||(n=[])).push(t[r]);return n}function Ae(t,e){if(e.full)return null;var n=Jt(t,e.from.line)&&Gt(t,e.from.line).markedSpans,r=Jt(t,e.to.line)&&Gt(t,e.to.line).markedSpans;if(!n&&!r)return null;var i=e.from.ch,o=e.to.ch,s=0==ee(e.from,e.to),a=function(t,e,n){var r;if(t)for(var i=0;i<t.length;++i){var o=t[i],s=o.marker;if(null==o.from||(s.inclusiveLeft?o.from<=e:o.from<e)||o.from==e&&"bookmark"==s.type&&(!n||!o.marker.insertLeft)){var a=null==o.to||(s.inclusiveRight?o.to>=e:o.to>e);(r||(r=[])).push(new Ce(s,o.from,a?null:o.to))}}return r}(n,i,s),l=function(t,e,n){var r;if(t)for(var i=0;i<t.length;++i){var o=t[i],s=o.marker;if(null==o.to||(s.inclusiveRight?o.to>=e:o.to>e)||o.from==e&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var a=null==o.from||(s.inclusiveLeft?o.from<=e:o.from<e);(r||(r=[])).push(new Ce(s,a?null:o.from-e,null==o.to?null:o.to-e))}}return r}(r,o,s),u=1==e.text.length,c=Y(e.text).length+(u?i:0);if(a)for(var h=0;h<a.length;++h){var p=a[h];if(null==p.to){var f=we(l,p.marker);f?u&&(p.to=null==f.to?null:f.to+c):p.to=i}}if(l)for(var d=0;d<l.length;++d){var g=l[d];null!=g.to&&(g.to+=c),null==g.from?we(a,g.marker)||(g.from=c,u&&(a||(a=[])).push(g)):(g.from+=c,u&&(a||(a=[])).push(g))}a&&(a=Le(a)),l&&l!=a&&(l=Le(l));var v=[a];if(!u){var m,y=e.text.length-2;if(y>0&&a)for(var x=0;x<a.length;++x)null==a[x].to&&(m||(m=[])).push(new Ce(a[x].marker,null,null));for(var S=0;S<y;++S)v.push(m);v.push(l)}return v}function Le(t){for(var e=0;e<t.length;++e){var n=t[e];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&t.splice(e--,1)}return t.length?t:null}function Ne(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function ke(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function Oe(t){return t.inclusiveLeft?-1:0}function _e(t){return t.inclusiveRight?1:0}function Ie(t,e){var n=t.lines.length-e.lines.length;if(0!=n)return n;var r=t.find(),i=e.find(),o=ee(r.from,i.from)||Oe(t)-Oe(e);if(o)return-o;var s=ee(r.to,i.to)||_e(t)-_e(e);return s||e.id-t.id}function Me(t,e){var n,r=Te&&t.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(e?i.from:i.to)&&(!n||Ie(n,i.marker)<0)&&(n=i.marker);return n}function Pe(t){return Me(t,!0)}function De(t){return Me(t,!1)}function Re(t,e){var n,r=Te&&t.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<e)&&(null==o.to||o.to>e)&&(!n||Ie(n,o.marker)<0)&&(n=o.marker)}return n}function Fe(t,e,n,r,i){var o=Gt(t,e),s=Te&&o.markedSpans;if(s)for(var a=0;a<s.length;++a){var l=s[a];if(l.marker.collapsed){var u=l.marker.find(0),c=ee(u.from,n)||Oe(l.marker)-Oe(i),h=ee(u.to,r)||_e(l.marker)-_e(i);if(!(c>=0&&h<=0||c<=0&&h>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ee(u.to,n)>=0:ee(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ee(u.from,r)<=0:ee(u.from,r)<0)))return!0}}}function He(t){for(var e;e=Pe(t);)t=e.find(-1,!0).line;return t}function Be(t,e){var n=Gt(t,e),r=He(n);return n==r?e:$t(r)}function We(t,e){if(e>t.lastLine())return e;var n,r=Gt(t,e);if(!je(t,r))return e;for(;n=De(r);)r=n.find(1,!0).line;return $t(r)+1}function je(t,e){var n=Te&&e.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&ze(t,e,r))return!0}}function ze(t,e,n){if(null==n.to){var r=n.marker.find(1,!0);return ze(t,r.line,we(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==e.text.length)return!0;for(var i=void 0,o=0;o<e.markedSpans.length;++o)if((i=e.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&ze(t,e,i))return!0}function Ue(t){for(var e=0,n=(t=He(t)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==t)break;e+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var s=0;s<o.children.length;++s){var a=o.children[s];if(a==n)break;e+=a.height}return e}function Ve(t){if(0==t.height)return 0;for(var e,n=t.text.length,r=t;e=Pe(r);){var i=e.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=t;e=De(r);){var o=e.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function qe(t){var e=t.display,n=t.doc;e.maxLine=Gt(n,n.first),e.maxLineLength=Ve(e.maxLine),e.maxLineChanged=!0,n.iter((function(t){var n=Ve(t);n>e.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var Ge=function(t,e,n){this.text=t,ke(this,e),this.height=n?n(this):1};function Ke(t){t.parent=null,Ne(t)}Ge.prototype.lineNo=function(){return $t(this)},yt(Ge);var Ye={},Xe={};function $e(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?Xe:Ye;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function Ze(t,e){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:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var i=0;i<=(e.rest?e.rest.length:0);i++){var o=i?e.rest[i-1]:e.line,s=void 0;r.pos=0,r.addToken=Qe,kt(t.display.measure)&&(s=ut(o,t.doc.direction))&&(r.addToken=tn(r.addToken,s)),r.map=[],nn(o,r,pe(t,o,e!=t.display.externalMeasured&&$t(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=P(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=P(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Nt(t.display.measure))),0==i?(e.measure.map=r.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(r.map),(e.measure.caches||(e.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 dt(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=P(r.pre.className,r.textClass||"")),r}function Je(t){var e=k("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function Qe(t,e,n,r,i,o,l){if(e){var u,c=t.splitSpaces?function(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,r="",i=0;i<t.length;i++){var o=t.charAt(i);" "!=o||!n||i!=t.length-1&&32!=t.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}(e,t.trailingSpace):e,h=t.cm.state.specialChars,p=!1;if(h.test(e)){u=document.createDocumentFragment();for(var f=0;;){h.lastIndex=f;var d=h.exec(e),g=d?d.index-f:e.length-f;if(g){var v=document.createTextNode(c.slice(f,f+g));s&&a<9?u.appendChild(k("span",[v])):u.appendChild(v),t.map.push(t.pos,t.pos+g,v),t.col+=g,t.pos+=g}if(!d)break;f+=g+1;var m=void 0;if("\t"==d[0]){var y=t.cm.options.tabSize,x=y-t.col%y;(m=u.appendChild(k("span",K(x),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),t.col+=x}else"\r"==d[0]||"\n"==d[0]?((m=u.appendChild(k("span","\r"==d[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",d[0]),t.col+=1):((m=t.cm.options.specialCharPlaceholder(d[0])).setAttribute("cm-text",d[0]),s&&a<9?u.appendChild(k("span",[m])):u.appendChild(m),t.col+=1);t.map.push(t.pos,t.pos+1,m),t.pos++}}else t.col+=e.length,u=document.createTextNode(c),t.map.push(t.pos,t.pos+e.length,u),s&&a<9&&(p=!0),t.pos+=e.length;if(t.trailingSpace=32==c.charCodeAt(e.length-1),n||r||i||p||o){var S=n||"";r&&(S+=r),i&&(S+=i);var b=k("span",[u],S,o);if(l)for(var T in l)l.hasOwnProperty(T)&&"style"!=T&&"class"!=T&&b.setAttribute(T,l[T]);return t.content.appendChild(b)}t.content.appendChild(u)}}function tn(t,e){return function(n,r,i,o,s,a,l){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,c=u+r.length;;){for(var h=void 0,p=0;p<e.length&&!((h=e[p]).to>u&&h.from<=u);p++);if(h.to>=c)return t(n,r,i,o,s,a,l);t(n,r.slice(0,h.to-u),i,o,null,a,l),o=null,r=r.slice(h.to-u),u=h.to}}}function en(t,e,n,r){var i=!r&&n.widgetNode;i&&t.map.push(t.pos,t.pos+e,i),!r&&t.cm.display.input.needsContentAttribute&&(i||(i=t.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(t.cm.display.input.setUneditable(i),t.content.appendChild(i)),t.pos+=e,t.trailingSpace=!1}function nn(t,e,n){var r=t.markedSpans,i=t.text,o=0;if(r)for(var s,a,l,u,c,h,p,f=i.length,d=0,g=1,v="",m=0;;){if(m==d){l=u=c=a="",p=null,h=null,m=1/0;for(var y=[],x=void 0,S=0;S<r.length;++S){var b=r[S],T=b.marker;if("bookmark"==T.type&&b.from==d&&T.widgetNode)y.push(T);else if(b.from<=d&&(null==b.to||b.to>d||T.collapsed&&b.to==d&&b.from==d)){if(null!=b.to&&b.to!=d&&m>b.to&&(m=b.to,u=""),T.className&&(l+=" "+T.className),T.css&&(a=(a?a+";":"")+T.css),T.startStyle&&b.from==d&&(c+=" "+T.startStyle),T.endStyle&&b.to==m&&(x||(x=[])).push(T.endStyle,b.to),T.title&&((p||(p={})).title=T.title),T.attributes)for(var C in T.attributes)(p||(p={}))[C]=T.attributes[C];T.collapsed&&(!h||Ie(h.marker,T)<0)&&(h=b)}else b.from>d&&m>b.from&&(m=b.from)}if(x)for(var w=0;w<x.length;w+=2)x[w+1]==m&&(u+=" "+x[w]);if(!h||h.from==d)for(var E=0;E<y.length;++E)en(e,0,y[E]);if(h&&(h.from||0)==d){if(en(e,(null==h.to?f+1:h.to)-d,h.marker,null==h.from),null==h.to)return;h.to==d&&(h=!1)}}if(d>=f)break;for(var A=Math.min(f,m);;){if(v){var L=d+v.length;if(!h){var N=L>A?v.slice(0,A-d):v;e.addToken(e,N,s?s+l:l,c,d+N.length==m?u:"",a,p)}if(L>=A){v=v.slice(A-d),d=A;break}d=L,c=""}v=i.slice(o,o=n[g++]),s=$e(n[g++],e.cm.options)}}else for(var k=1;k<n.length;k+=2)e.addToken(e,i.slice(o,o=n[k]),$e(n[k+1],e.cm.options))}function rn(t,e,n){this.line=e,this.rest=function(t){for(var e,n;e=De(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}(e),this.size=this.rest?$t(Y(this.rest))-n+1:1,this.node=this.text=null,this.hidden=je(t,e)}function on(t,e,n){for(var r,i=[],o=e;o<n;o=r){var s=new rn(t.doc,Gt(t.doc,o),o);r=o+s.size,i.push(s)}return i}var sn=null,an=null;function ln(t,e){var n=pt(t,e);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);sn?r=sn.delayedCallbacks:an?r=an:(r=an=[],setTimeout(un,0));for(var o=function(t){r.push((function(){return n[t].apply(null,i)}))},s=0;s<n.length;++s)o(s)}}function un(){var t=an;an=null;for(var e=0;e<t.length;++e)t[e]()}function cn(t,e,n,r){for(var i=0;i<e.changes.length;i++){var o=e.changes[i];"text"==o?fn(t,e):"gutter"==o?gn(t,e,n,r):"class"==o?dn(t,e):"widget"==o&&vn(t,e,r)}e.changes=null}function hn(t){return t.node==t.text&&(t.node=k("div",null,null,"position: relative"),t.text.parentNode&&t.text.parentNode.replaceChild(t.node,t.text),t.node.appendChild(t.text),s&&a<8&&(t.node.style.zIndex=2)),t.node}function pn(t,e){var n=t.display.externalMeasured;return n&&n.line==e.line?(t.display.externalMeasured=null,e.measure=n.measure,n.built):Ze(t,e)}function fn(t,e){var n=e.text.className,r=pn(t,e);e.text==e.node&&(e.node=r.pre),e.text.parentNode.replaceChild(r.pre,e.text),e.text=r.pre,r.bgClass!=e.bgClass||r.textClass!=e.textClass?(e.bgClass=r.bgClass,e.textClass=r.textClass,dn(t,e)):n&&(e.text.className=n)}function dn(t,e){!function(t,e){var n=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),e.background)n?e.background.className=n:(e.background.parentNode.removeChild(e.background),e.background=null);else if(n){var r=hn(e);e.background=r.insertBefore(k("div",null,n),r.firstChild),t.display.input.setUneditable(e.background)}}(t,e),e.line.wrapClass?hn(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var n=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=n||""}function gn(t,e,n,r){if(e.gutter&&(e.node.removeChild(e.gutter),e.gutter=null),e.gutterBackground&&(e.node.removeChild(e.gutterBackground),e.gutterBackground=null),e.line.gutterClass){var i=hn(e);e.gutterBackground=k("div",null,"CodeMirror-gutter-background "+e.line.gutterClass,"left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),t.display.input.setUneditable(e.gutterBackground),i.insertBefore(e.gutterBackground,e.text)}var o=e.line.gutterMarkers;if(t.options.lineNumbers||o){var s=hn(e),a=e.gutter=k("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(t.display.input.setUneditable(a),s.insertBefore(a,e.text),e.line.gutterClass&&(a.className+=" "+e.line.gutterClass),!t.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(e.lineNumber=a.appendChild(k("div",Qt(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<t.display.gutterSpecs.length;++l){var u=t.display.gutterSpecs[l].className,c=o.hasOwnProperty(u)&&o[u];c&&a.appendChild(k("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function vn(t,e,n){e.alignable&&(e.alignable=null);for(var r=w("CodeMirror-linewidget"),i=e.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&e.node.removeChild(i);yn(t,e,n)}function mn(t,e,n,r){var i=pn(t,e);return e.text=e.node=i.pre,i.bgClass&&(e.bgClass=i.bgClass),i.textClass&&(e.textClass=i.textClass),dn(t,e),gn(t,e,n,r),yn(t,e,r),e.node}function yn(t,e,n){if(xn(t,e.line,e,n,!0),e.rest)for(var r=0;r<e.rest.length;r++)xn(t,e.rest[r],e,n,!1)}function xn(t,e,n,r,i){if(e.widgets)for(var o=hn(n),s=0,a=e.widgets;s<a.length;++s){var l=a[s],u=k("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Sn(l,u,n,r),t.display.input.setUneditable(u),i&&l.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),ln(l,"redraw")}}function Sn(t,e,n,r){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(e);var i=r.wrapperWidth;e.style.left=r.fixedPos+"px",t.coverGutter||(i-=r.gutterTotalWidth,e.style.paddingLeft=r.gutterTotalWidth+"px"),e.style.width=i+"px"}t.coverGutter&&(e.style.zIndex=5,e.style.position="relative",t.noHScroll||(e.style.marginLeft=-r.gutterTotalWidth+"px"))}function bn(t){if(null!=t.height)return t.height;var e=t.doc.cm;if(!e)return 0;if(!_(document.body,t.node)){var n="position: relative;";t.coverGutter&&(n+="margin-left: -"+e.display.gutters.offsetWidth+"px;"),t.noHScroll&&(n+="width: "+e.display.wrapper.clientWidth+"px;"),N(e.display.measure,k("div",[t.node],null,n))}return t.height=t.node.parentNode.offsetHeight}function Tn(t,e){for(var n=Ct(e);n!=t.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==t.sizer&&n!=t.mover)return!0}function Cn(t){return t.lineSpace.offsetTop}function wn(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function En(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=N(t.measure,k("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(t.cachedPaddingH=r),r}function An(t){return 50-t.display.nativeBarWidth}function Ln(t){return t.display.scroller.clientWidth-An(t)-t.display.barWidth}function Nn(t){return t.display.scroller.clientHeight-An(t)-t.display.barHeight}function kn(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var r=0;r<t.rest.length;r++)if(t.rest[r]==e)return{map:t.measure.maps[r],cache:t.measure.caches[r]};for(var i=0;i<t.rest.length;i++)if($t(t.rest[i])>n)return{map:t.measure.maps[i],cache:t.measure.caches[i],before:!0}}function On(t,e,n,r){return Mn(t,In(t,e),n,r)}function _n(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[cr(t,e)];var n=t.display.externalMeasured;return n&&e>=n.lineN&&e<n.lineN+n.size?n:void 0}function In(t,e){var n=$t(e),r=_n(t,n);r&&!r.text?r=null:r&&r.changes&&(cn(t,r,n,or(t)),t.curOp.forceUpdate=!0),r||(r=function(t,e){var n=$t(e=He(e)),r=t.display.externalMeasured=new rn(t.doc,e,n);r.lineN=n;var i=r.built=Ze(t,r);return r.text=i.pre,N(t.display.lineMeasure,i.pre),r}(t,e));var i=kn(r,e,n);return{line:e,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Mn(t,e,n,r,i){e.before&&(n=-1);var o,l=n+(r||"");return e.cache.hasOwnProperty(l)?o=e.cache[l]:(e.rect||(e.rect=e.view.text.getBoundingClientRect()),e.hasHeights||(function(t,e,n){var r=t.options.lineWrapping,i=r&&Ln(t);if(!e.measure.heights||r&&e.measure.width!=i){var o=e.measure.heights=[];if(r){e.measure.width=i;for(var s=e.text.firstChild.getClientRects(),a=0;a<s.length-1;a++){var l=s[a],u=s[a+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}(t,e.view,e.rect),e.hasHeights=!0),(o=function(t,e,n,r){var i,o=Rn(e.map,n,r),l=o.node,u=o.start,c=o.end,h=o.collapse;if(3==l.nodeType){for(var p=0;p<4;p++){for(;u&&rt(e.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c<o.coverEnd&&rt(e.line.text.charAt(o.coverStart+c));)++c;if((i=s&&a<9&&0==u&&c==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():Fn(E(l,u,c).getClientRects(),r)).left||i.right||0==u)break;c=u,u-=1,h="right"}s&&a<11&&(i=function(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(t){if(null!=Pt)return Pt;var e=N(t,k("span","x")),n=e.getBoundingClientRect(),r=E(e,0,1).getBoundingClientRect();return Pt=Math.abs(n.left-r.left)>1}(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*r,bottom:e.bottom*r}}(t.display.measure,i))}else{var f;u>0&&(h=r="right"),i=t.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 d=l.parentNode.getClientRects()[0];i=d?{left:d.left,right:d.left+ir(t.display),top:d.top,bottom:d.bottom}:Dn}for(var g=i.top-e.rect.top,v=i.bottom-e.rect.top,m=(g+v)/2,y=e.view.measure.heights,x=0;x<y.length-1&&!(m<y[x]);x++);var S=x?y[x-1]:0,b=y[x],T={left:("right"==h?i.right:i.left)-e.rect.left,right:("left"==h?i.left:i.right)-e.rect.left,top:S,bottom:b};return i.left||i.right||(T.bogus=!0),t.options.singleCursorHeightPerLine||(T.rtop=g,T.rbottom=v),T}(t,e,n,r)).bogus||(e.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Pn,Dn={left:0,right:0,top:0,bottom:0};function Rn(t,e,n){for(var r,i,o,s,a,l,u=0;u<t.length;u+=3)if(a=t[u],l=t[u+1],e<a?(i=0,o=1,s="left"):e<l?o=1+(i=e-a):(u==t.length-3||e==l&&t[u+3]>e)&&(i=(o=l-a)-1,e>=l&&(s="right")),null!=i){if(r=t[u+2],a==l&&n==(r.insertLeft?"left":"right")&&(s=n),"left"==n&&0==i)for(;u&&t[u-2]==t[u-3]&&t[u-1].insertLeft;)r=t[2+(u-=3)],s="left";if("right"==n&&i==l-a)for(;u<t.length-3&&t[u+3]==t[u+4]&&!t[u+5].insertLeft;)r=t[(u+=3)+2],s="right";break}return{node:r,start:i,end:o,collapse:s,coverStart:a,coverEnd:l}}function Fn(t,e){var n=Dn;if("left"==e)for(var r=0;r<t.length&&(n=t[r]).left==n.right;r++);else for(var i=t.length-1;i>=0&&(n=t[i]).left==n.right;i--);return n}function Hn(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e<t.rest.length;e++)t.measure.caches[e]={}}function Bn(t){t.display.externalMeasure=null,L(t.display.lineMeasure);for(var e=0;e<t.display.view.length;e++)Hn(t.display.view[e])}function Wn(t){Bn(t),t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null,t.options.lineWrapping||(t.display.maxLineChanged=!0),t.display.lineNumChars=null}function jn(){return c&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function zn(){return c&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Un(t){var e=0;if(t.widgets)for(var n=0;n<t.widgets.length;++n)t.widgets[n].above&&(e+=bn(t.widgets[n]));return e}function Vn(t,e,n,r,i){if(!i){var o=Un(e);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var s=Ue(e);if("local"==r?s+=Cn(t.display):s-=t.display.viewOffset,"page"==r||"window"==r){var a=t.display.lineSpace.getBoundingClientRect();s+=a.top+("window"==r?0:zn());var l=a.left+("window"==r?0:jn());n.left+=l,n.right+=l}return n.top+=s,n.bottom+=s,n}function qn(t,e,n){if("div"==n)return e;var r=e.left,i=e.top;if("page"==n)r-=jn(),i-=zn();else if("local"==n||!n){var o=t.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var s=t.display.lineSpace.getBoundingClientRect();return{left:r-s.left,top:i-s.top}}function Gn(t,e,n,r,i){return r||(r=Gt(t.doc,e.line)),Vn(t,r,On(t,r,e.ch,i),n)}function Kn(t,e,n,r,i,o){function s(e,s){var a=Mn(t,i,e,s?"right":"left",o);return s?a.left=a.right:a.right=a.left,Vn(t,r,a,n)}r=r||Gt(t.doc,e.line),i||(i=In(t,r));var a=ut(r,t.doc.direction),l=e.ch,u=e.sticky;if(l>=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(t,e,n){return s(n?t-1:t,1==a[e].level!=n)}var h=at(a,l,u),p=st,f=c(l,h,"before"==u);return null!=p&&(f.other=c(l,p,"before"!=u)),f}function Yn(t,e){var n=0;e=ae(t.doc,e),t.options.lineWrapping||(n=ir(t.display)*e.ch);var r=Gt(t.doc,e.line),i=Ue(r)+Cn(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Xn(t,e,n,r,i){var o=te(t,e,n);return o.xRel=i,r&&(o.outside=r),o}function $n(t,e,n){var r=t.doc;if((n+=t.display.viewOffset)<0)return Xn(r.first,0,null,-1,-1);var i=Zt(r,n),o=r.first+r.size-1;if(i>o)return Xn(r.first+r.size-1,Gt(r,o).text.length,null,1,1);e<0&&(e=0);for(var s=Gt(r,i);;){var a=tr(t,s,i,e,n),l=Re(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=Gt(r,i=u.line)}}function Zn(t,e,n,r){r-=Un(e);var i=e.text.length,o=ot((function(e){return Mn(t,n,e-1).bottom<=r}),i,0);return{begin:o,end:i=ot((function(e){return Mn(t,n,e).top>r}),o,i)}}function Jn(t,e,n,r){return n||(n=In(t,e)),Zn(t,e,n,Vn(t,e,Mn(t,n,r),"line").top)}function Qn(t,e,n,r){return!(t.bottom<=n)&&(t.top>n||(r?t.left:t.right)>e)}function tr(t,e,n,r,i){i-=Ue(e);var o=In(t,e),s=Un(e),a=0,l=e.text.length,u=!0,c=ut(e,t.doc.direction);if(c){var h=(t.options.lineWrapping?nr:er)(t,e,n,o,c,r,i);a=(u=1!=h.level)?h.from:h.to-1,l=u?h.to:h.from-1}var p,f,d=null,g=null,v=ot((function(e){var n=Mn(t,o,e);return n.top+=s,n.bottom+=s,!!Qn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(d=e,g=n),!0)}),a,l),m=!1;if(g){var y=r-g.left<g.right-r,x=y==u;v=d+(x?0:1),f=x?"after":"before",p=y?g.left:g.right}else{u||v!=l&&v!=a||v++,f=0==v?"after":v==e.text.length?"before":Mn(t,o,v-(u?1:0)).bottom+s<=i==u?"after":"before";var S=Kn(t,te(n,v,f),"line",e,o);p=S.left,m=i<S.top?-1:i>=S.bottom?1:0}return Xn(n,v=it(e.text,v,1),f,m,r-p)}function er(t,e,n,r,i,o,s){var a=ot((function(a){var l=i[a],u=1!=l.level;return Qn(Kn(t,te(n,u?l.to:l.from,u?"before":"after"),"line",e,r),o,s,!0)}),0,i.length-1),l=i[a];if(a>0){var u=1!=l.level,c=Kn(t,te(n,u?l.from:l.to,u?"after":"before"),"line",e,r);Qn(c,o,s,!0)&&c.top>s&&(l=i[a-1])}return l}function nr(t,e,n,r,i,o,s){var a=Zn(t,e,r,s),l=a.begin,u=a.end;/\s/.test(e.text.charAt(u-1))&&u--;for(var c=null,h=null,p=0;p<i.length;p++){var f=i[p];if(!(f.from>=u||f.to<=l)){var d=Mn(t,r,1!=f.level?Math.min(u,f.to)-1:Math.max(l,f.from)).right,g=d<o?o-d+1e9:d-o;(!c||h>g)&&(c=f,h=g)}}return c||(c=i[i.length-1]),c.from<l&&(c={from:l,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function rr(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==Pn){Pn=k("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)Pn.appendChild(document.createTextNode("x")),Pn.appendChild(k("br"));Pn.appendChild(document.createTextNode("x"))}N(t.measure,Pn);var n=Pn.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),L(t.measure),n||1}function ir(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=k("span","xxxxxxxxxx"),n=k("pre",[e],"CodeMirror-line-like");N(t.measure,n);var r=e.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(t.cachedCharWidth=i),i||10}function or(t){for(var e=t.display,n={},r={},i=e.gutters.clientLeft,o=e.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var a=t.display.gutterSpecs[s].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:sr(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function sr(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function ar(t){var e=rr(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/ir(t.display)-3);return function(i){if(je(t.doc,i))return 0;var o=0;if(i.widgets)for(var s=0;s<i.widgets.length;s++)i.widgets[s].height&&(o+=i.widgets[s].height);return n?o+(Math.ceil(i.text.length/r)||1)*e:o+e}}function lr(t){var e=t.doc,n=ar(t);e.iter((function(t){var e=n(t);e!=t.height&&Xt(t,e)}))}function ur(t,e,n,r){var i=t.display;if(!n&&"true"==Ct(e).getAttribute("cm-not-content"))return null;var o,s,a=i.lineSpace.getBoundingClientRect();try{o=e.clientX-a.left,s=e.clientY-a.top}catch(e){return null}var l,u=$n(t,o,s);if(r&&u.xRel>0&&(l=Gt(t.doc,u.line).text).length==u.ch){var c=H(l,l.length,t.options.tabSize)-l.length;u=te(u.line,Math.max(0,Math.round((o-En(t.display).left)/ir(t.display))-c))}return u}function cr(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,r=0;r<n.length;r++)if((e-=n[r].size)<0)return r}function hr(t,e,n,r){null==e&&(e=t.doc.first),null==n&&(n=t.doc.first+t.doc.size),r||(r=0);var i=t.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>e)&&(i.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=i.viewTo)Te&&Be(t.doc,e)<i.viewTo&&fr(t);else if(n<=i.viewFrom)Te&&We(t.doc,n+r)>i.viewFrom?fr(t):(i.viewFrom+=r,i.viewTo+=r);else if(e<=i.viewFrom&&n>=i.viewTo)fr(t);else if(e<=i.viewFrom){var o=dr(t,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):fr(t)}else if(n>=i.viewTo){var s=dr(t,e,e,-1);s?(i.view=i.view.slice(0,s.index),i.viewTo=s.lineN):fr(t)}else{var a=dr(t,e,e,-1),l=dr(t,n,n+r,1);a&&l?(i.view=i.view.slice(0,a.index).concat(on(t,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):fr(t)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:e<u.lineN+u.size&&(i.externalMeasured=null))}function pr(t,e,n){t.curOp.viewChanged=!0;var r=t.display,i=t.display.externalMeasured;if(i&&e>=i.lineN&&e<i.lineN+i.size&&(r.externalMeasured=null),!(e<r.viewFrom||e>=r.viewTo)){var o=r.view[cr(t,e)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==W(s,n)&&s.push(n)}}}function fr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function dr(t,e,n,r){var i,o=cr(t,e),s=t.display.view;if(!Te||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var a=t.display.viewFrom,l=0;l<o;l++)a+=s[l].size;if(a!=e){if(r>0){if(o==s.length-1)return null;i=a+s[o].size-e,o++}else i=a-e;e+=i,n+=i}for(;Be(t.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 gr(t){for(var e=t.display.view,n=0,r=0;r<e.length;r++){var i=e[r];i.hidden||i.node&&!i.changes||++n}return n}function vr(t){t.display.input.showSelection(t.display.input.prepareSelection())}function mr(t,e){void 0===e&&(e=!0);for(var n=t.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),s=0;s<n.sel.ranges.length;s++)if(e||s!=n.sel.primIndex){var a=n.sel.ranges[s];if(!(a.from().line>=t.display.viewTo||a.to().line<t.display.viewFrom)){var l=a.empty();(l||t.options.showCursorWhenSelecting)&&yr(t,a.head,i),l||Sr(t,a,o)}}return r}function yr(t,e,n){var r=Kn(t,e,"div",null,null,!t.options.singleCursorHeightPerLine),i=n.appendChild(k("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*t.options.cursorHeight+"px",r.other){var o=n.appendChild(k("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function xr(t,e){return t.top-e.top||t.left-e.left}function Sr(t,e,n){var r=t.display,i=t.doc,o=document.createDocumentFragment(),s=En(t.display),a=s.left,l=Math.max(r.sizerWidth,Ln(t)-r.sizer.offsetLeft)-s.right,u="ltr"==i.direction;function c(t,e,n,r){e<0&&(e=0),e=Math.round(e),r=Math.round(r),o.appendChild(k("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?l-t:n)+"px;\n height: "+(r-e)+"px"))}function h(e,n,r){var o,s,h=Gt(i,e),p=h.text.length;function f(n,r){return Gn(t,te(e,n),"div",h,r)}function d(e,n,r){var i=Jn(t,h,null,e),o="ltr"==n==("after"==r)?"left":"right";return f("after"==r?i.begin:i.end-(/\s/.test(h.text.charAt(i.end-1))?2:1),o)[o]}var g=ut(h,i.direction);return function(t,e,n,r){if(!t)return r(e,n,"ltr",0);for(var i=!1,o=0;o<t.length;++o){var s=t[o];(s.from<n&&s.to>e||e==n&&s.to==e)&&(r(Math.max(s.from,e),Math.min(s.to,n),1==s.level?"rtl":"ltr",o),i=!0)}i||r(e,n,"ltr")}(g,n||0,null==r?p:r,(function(t,e,i,h){var v="ltr"==i,m=f(t,v?"left":"right"),y=f(e-1,v?"right":"left"),x=null==n&&0==t,S=null==r&&e==p,b=0==h,T=!g||h==g.length-1;if(y.top-m.top<=3){var C=(u?S:x)&&T,w=(u?x:S)&&b?a:(v?m:y).left,E=C?l:(v?y:m).right;c(w,m.top,E-w,m.bottom)}else{var A,L,N,k;v?(A=u&&x&&b?a:m.left,L=u?l:d(t,i,"before"),N=u?a:d(e,i,"after"),k=u&&S&&T?l:y.right):(A=u?d(t,i,"before"):a,L=!u&&x&&b?l:m.right,N=!u&&S&&T?a:y.left,k=u?d(e,i,"after"):l),c(A,m.top,L-A,m.bottom),m.bottom<y.top&&c(a,m.bottom,null,y.top),c(N,y.top,k-N,y.bottom)}(!o||xr(m,o)<0)&&(o=m),xr(y,o)<0&&(o=y),(!s||xr(m,s)<0)&&(s=m),xr(y,s)<0&&(s=y)})),{start:o,end:s}}var p=e.from(),f=e.to();if(p.line==f.line)h(p.line,p.ch,f.ch);else{var d=Gt(i,p.line),g=Gt(i,f.line),v=He(d)==He(g),m=h(p.line,p.ch,v?d.text.length+1:null).end,y=h(f.line,v?0:null,f.ch).start;v&&(m.top<y.top-2?(c(m.right,m.top,null,m.bottom),c(a,y.top,y.left,y.bottom)):c(m.right,m.top,y.left-m.right,m.bottom)),m.bottom<y.top&&c(a,m.bottom,null,y.top)}n.appendChild(o)}function br(t){if(t.state.focused){var e=t.display;clearInterval(e.blinker);var n=!0;e.cursorDiv.style.visibility="",t.options.cursorBlinkRate>0?e.blinker=setInterval((function(){return e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Tr(t){t.state.focused||(t.display.input.focus(),wr(t))}function Cr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,Er(t))}),100)}function wr(t,e){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(dt(t,"focus",t,e),t.state.focused=!0,M(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),br(t))}function Er(t,e){t.state.delayingBlurEvent||(t.state.focused&&(dt(t,"blur",t,e),t.state.focused=!1,A(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function Ar(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=0;r<e.view.length;r++){var i=e.view[r],o=t.options.lineWrapping,l=void 0,u=0;if(!i.hidden){if(s&&a<8){var c=i.node.offsetTop+i.node.offsetHeight;l=c-n,n=c}else{var h=i.node.getBoundingClientRect();l=h.bottom-h.top,!o&&i.text.firstChild&&(u=i.text.firstChild.getBoundingClientRect().right-h.left-1)}var p=i.line.height-l;if((p>.005||p<-.005)&&(Xt(i.line,l),Lr(i.line),i.rest))for(var f=0;f<i.rest.length;f++)Lr(i.rest[f]);if(u>t.display.sizerWidth){var d=Math.ceil(u/ir(t.display));d>t.display.maxLineLength&&(t.display.maxLineLength=d,t.display.maxLine=i.line,t.display.maxLineChanged=!0)}}}}function Lr(t){if(t.widgets)for(var e=0;e<t.widgets.length;++e){var n=t.widgets[e],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Nr(t,e,n){var r=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;r=Math.floor(r-Cn(t));var i=n&&null!=n.bottom?n.bottom:r+t.wrapper.clientHeight,o=Zt(e,r),s=Zt(e,i);if(n&&n.ensure){var a=n.ensure.from.line,l=n.ensure.to.line;a<o?(o=a,s=Zt(e,Ue(Gt(e,a))+t.wrapper.clientHeight)):Math.min(l,e.lastLine())>=s&&(o=Zt(e,Ue(Gt(e,l))-t.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function kr(t,e){var n=t.display,r=rr(t.display);e.top<0&&(e.top=0);var i=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=Nn(t),s={};e.bottom-e.top>o&&(e.bottom=e.top+o);var a=t.doc.height+wn(n),l=e.top<r,u=e.bottom>a-r;if(e.top<i)s.scrollTop=l?0:e.top;else if(e.bottom>i+o){var c=Math.min(e.top,(u?a:e.bottom)-o);c!=i&&(s.scrollTop=c)}var h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft,p=Ln(t)-(t.options.fixedGutter?n.gutters.offsetWidth:0),f=e.right-e.left>p;return f&&(e.right=e.left+p),e.left<10?s.scrollLeft=0:e.left<h?s.scrollLeft=Math.max(0,e.left-(f?0:10)):e.right>p+h-3&&(s.scrollLeft=e.right+(f?0:10)-p),s}function Or(t,e){null!=e&&(Mr(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function _r(t){Mr(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Ir(t,e,n){null==e&&null==n||Mr(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function Mr(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,Pr(t,Yn(t,e.from),Yn(t,e.to),e.margin))}function Pr(t,e,n,r){var i=kr(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-r,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+r});Ir(t,i.scrollLeft,i.scrollTop)}function Dr(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||li(t,{top:e}),Rr(t,e,!0),n&&li(t),ri(t,100))}function Rr(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function Fr(t,e,n,r){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!r||(t.doc.scrollLeft=e,hi(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function Hr(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+wn(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+An(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var Br=function(t,e,n){this.cm=n;var r=this.vert=k("div",[k("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=k("div",[k("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,t(r),t(i),ht(r,"scroll",(function(){r.clientHeight&&e(r.scrollTop,"vertical")})),ht(i,"scroll",(function(){i.clientWidth&&e(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Br.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?r+"px":"0";var i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:e?r:0}},Br.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Br.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Br.prototype.zeroWidthHack=function(){var t=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new B,this.disableVert=new B},Br.prototype.enableZeroWidthBar=function(t,e,n){t.style.pointerEvents="auto",e.set(1e3,(function r(){var i=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=t?t.style.pointerEvents="none":e.set(1e3,r)}))},Br.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var Wr=function(){};function jr(t,e){e||(e=Hr(t));var n=t.display.barWidth,r=t.display.barHeight;zr(t,e);for(var i=0;i<4&&n!=t.display.barWidth||r!=t.display.barHeight;i++)n!=t.display.barWidth&&t.options.lineWrapping&&Ar(t),zr(t,Hr(t)),n=t.display.barWidth,r=t.display.barHeight}function zr(t,e){var n=t.display,r=n.scrollbars.update(e);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&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}Wr.prototype.update=function(){return{bottom:0,right:0}},Wr.prototype.setScrollLeft=function(){},Wr.prototype.setScrollTop=function(){},Wr.prototype.clear=function(){};var Ur={native:Br,null:Wr};function Vr(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&A(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new Ur[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ht(e,"mousedown",(function(){t.state.focused&&setTimeout((function(){return t.display.input.focus()}),0)})),e.setAttribute("cm-not-content","true")}),(function(e,n){"horizontal"==n?Fr(t,e):Dr(t,e)}),t),t.display.scrollbars.addClass&&M(t.display.wrapper,t.display.scrollbars.addClass)}var qr=0;function Gr(t){var e;t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qr},e=t.curOp,sn?sn.ops.push(e):e.ownsGroup=sn={ops:[e],delayedCallbacks:[]}}function Kr(t){var e=t.curOp;e&&function(t,e){var n=t.ownsGroup;if(n)try{!function(t){var e=t.delayedCallbacks,n=0;do{for(;n<e.length;n++)e[n].call(null);for(var r=0;r<t.ops.length;r++){var i=t.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<e.length)}(n)}finally{sn=null,e(n)}}(e,(function(t){for(var e=0;e<t.ops.length;e++)t.ops[e].cm.curOp=null;!function(t){for(var e=t.ops,n=0;n<e.length;n++)Yr(e[n]);for(var r=0;r<e.length;r++)Xr(e[r]);for(var i=0;i<e.length;i++)$r(e[i]);for(var o=0;o<e.length;o++)Zr(e[o]);for(var s=0;s<e.length;s++)Jr(e[s])}(t)}))}function Yr(t){var e=t.cm,n=e.display;!function(t){var e=t.display;!e.scrollbarsClipped&&e.scroller.offsetWidth&&(e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth,e.heightForcer.style.height=An(t)+"px",e.sizer.style.marginBottom=-e.nativeBarWidth+"px",e.sizer.style.borderRightWidth=An(t)+"px",e.scrollbarsClipped=!0)}(e),t.updateMaxLine&&qe(e),t.mustUpdate=t.viewChanged||t.forceUpdate||null!=t.scrollTop||t.scrollToPos&&(t.scrollToPos.from.line<n.viewFrom||t.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new oi(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Xr(t){t.updatedDisplay=t.mustUpdate&&si(t.cm,t.update)}function $r(t){var e=t.cm,n=e.display;t.updatedDisplay&&Ar(e),t.barMeasure=Hr(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=On(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+An(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Ln(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Zr(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft<e.doc.scrollLeft&&Fr(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0),e.display.maxLineChanged=!1);var n=t.focus&&t.focus==I();t.preparedSelection&&e.display.input.showSelection(t.preparedSelection,n),(t.updatedDisplay||t.startHeight!=e.doc.height)&&jr(e,t.barMeasure),t.updatedDisplay&&ci(e,t.barMeasure),t.selectionChanged&&br(e),e.state.focused&&t.updateInput&&e.display.input.reset(t.typing),n&&Tr(t.cm)}function Jr(t){var e=t.cm,n=e.display,r=e.doc;t.updatedDisplay&&ai(e,t.update),null==n.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=t.scrollTop&&Rr(e,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&Fr(e,t.scrollLeft,!0,!0),t.scrollToPos&&function(t,e){if(!gt(t,"scrollCursorIntoView")){var n=t.display,r=n.sizer.getBoundingClientRect(),i=null;if(e.top+r.top<0?i=!0:e.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!d){var o=k("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Cn(t.display))+"px;\n height: "+(e.bottom-e.top+An(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(i),t.display.lineSpace.removeChild(o)}}}(e,function(t,e,n,r){var i;null==r&&(r=0),t.options.lineWrapping||e!=n||(n="before"==(e=e.ch?te(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e).sticky?te(e.line,e.ch+1,"before"):e);for(var o=0;o<5;o++){var s=!1,a=Kn(t,e),l=n&&n!=e?Kn(t,n):a,u=kr(t,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=t.doc.scrollTop,h=t.doc.scrollLeft;if(null!=u.scrollTop&&(Dr(t,u.scrollTop),Math.abs(t.doc.scrollTop-c)>1&&(s=!0)),null!=u.scrollLeft&&(Fr(t,u.scrollLeft),Math.abs(t.doc.scrollLeft-h)>1&&(s=!0)),!s)break}return i}(e,ae(r,t.scrollToPos.from),ae(r,t.scrollToPos.to),t.scrollToPos.margin));var i=t.maybeHiddenMarkers,o=t.maybeUnhiddenMarkers;if(i)for(var s=0;s<i.length;++s)i[s].lines.length||dt(i[s],"hide");if(o)for(var a=0;a<o.length;++a)o[a].lines.length&&dt(o[a],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=e.display.scroller.scrollTop),t.changeObjs&&dt(e,"changes",e,t.changeObjs),t.update&&t.update.finish()}function Qr(t,e){if(t.curOp)return e();Gr(t);try{return e()}finally{Kr(t)}}function ti(t,e){return function(){if(t.curOp)return e.apply(t,arguments);Gr(t);try{return e.apply(t,arguments)}finally{Kr(t)}}}function ei(t){return function(){if(this.curOp)return t.apply(this,arguments);Gr(this);try{return t.apply(this,arguments)}finally{Kr(this)}}}function ni(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);Gr(e);try{return t.apply(this,arguments)}finally{Kr(e)}}}function ri(t,e){t.doc.highlightFrontier<t.display.viewTo&&t.state.highlight.set(e,R(ii,t))}function ii(t){var e=t.doc;if(!(e.highlightFrontier>=t.display.viewTo)){var n=+new Date+t.options.workTime,r=fe(t,e.highlightFrontier),i=[];e.iter(r.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(o){if(r.line>=t.display.viewFrom){var s=o.styles,a=o.text.length>t.options.maxHighlightLength?zt(e.mode,r.state):null,l=he(t,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),p=0;!h&&p<s.length;++p)h=s[p]!=o.styles[p];h&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=t.options.maxHighlightLength&&de(t,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ri(t,t.options.workDelay),!0})),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),i.length&&Qr(t,(function(){for(var e=0;e<i.length;e++)pr(t,i[e],"text")}))}}var oi=function(t,e,n){var r=t.display;this.viewport=e,this.visible=Nr(r,t.doc,e),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Ln(t),this.force=n,this.dims=or(t),this.events=[]};function si(t,e){var n=t.display,r=t.doc;if(e.editorIsHidden)return fr(t),!1;if(!e.force&&e.visible.from>=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==gr(t))return!1;pi(t)&&(fr(t),e.dims=or(t));var i=r.first+r.size,o=Math.max(e.visible.from-t.options.viewportMargin,r.first),s=Math.min(i,e.visible.to+t.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>s&&n.viewTo-s<20&&(s=Math.min(i,n.viewTo)),Te&&(o=Be(t.doc,o),s=We(t.doc,s));var a=o!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;!function(t,e,n){var r=t.display;0==r.view.length||e>=r.viewTo||n<=r.viewFrom?(r.view=on(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=on(t,e,r.viewFrom).concat(r.view):r.viewFrom<e&&(r.view=r.view.slice(cr(t,e))),r.viewFrom=e,r.viewTo<n?r.view=r.view.concat(on(t,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,cr(t,n)))),r.viewTo=n}(t,o,s),n.viewOffset=Ue(Gt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var u=gr(t);if(!a&&0==u&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=function(t){if(t.hasFocus())return null;var e=I();if(!e||!_(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&_(t.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(t);return u>4&&(n.lineDiv.style.display="none"),function(t,e,n){var r=t.display,i=t.options.lineNumbers,o=r.lineDiv,s=o.firstChild;function a(e){var n=e.nextSibling;return l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var u=r.view,c=r.viewFrom,h=0;h<u.length;h++){var p=u[h];if(p.hidden);else if(p.node&&p.node.parentNode==o){for(;s!=p.node;)s=a(s);var f=i&&null!=e&&e<=c&&p.lineNumber;p.changes&&(W(p.changes,"gutter")>-1&&(f=!1),cn(t,p,c,n)),f&&(L(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(Qt(t.options,c)))),s=p.node.nextSibling}else{var d=mn(t,p,c,n);o.insertBefore(d,s)}c+=p.size}for(;s;)s=a(s)}(t,n.updateLineNumbers,e.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(t){if(t&&t.activeElt&&t.activeElt!=I()&&(t.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&_(document.body,t.anchorNode)&&_(document.body,t.focusNode))){var e=window.getSelection(),n=document.createRange();n.setEnd(t.anchorNode,t.anchorOffset),n.collapse(!1),e.removeAllRanges(),e.addRange(n),e.extend(t.focusNode,t.focusOffset)}}(c),L(n.cursorDiv),L(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,ri(t,400)),n.updateLineNumbers=null,!0}function ai(t,e){for(var n=e.viewport,r=!0;;r=!1){if(r&&t.options.lineWrapping&&e.oldDisplayWidth!=Ln(t))r&&(e.visible=Nr(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+wn(t.display)-Nn(t),n.top)}),e.visible=Nr(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!si(t,e))break;Ar(t);var i=Hr(t);vr(t),jr(t,i),ci(t,i),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function li(t,e){var n=new oi(t,e);if(si(t,n)){Ar(t),ai(t,n);var r=Hr(t);vr(t),jr(t,r),ci(t,r),n.finish()}}function ui(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px"}function ci(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+An(t)+"px"}function hi(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=sr(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,o=r+"px",s=0;s<n.length;s++)if(!n[s].hidden){t.options.fixedGutter&&(n[s].gutter&&(n[s].gutter.style.left=o),n[s].gutterBackground&&(n[s].gutterBackground.style.left=o));var a=n[s].alignable;if(a)for(var l=0;l<a.length;l++)a[l].style.left=o}t.options.fixedGutter&&(e.gutters.style.left=r+i+"px")}}function pi(t){if(!t.options.lineNumbers)return!1;var e=t.doc,n=Qt(t.options,e.first+e.size-1),r=t.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(k("div",[k("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,s=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-s)+1,r.lineNumWidth=r.lineNumInnerWidth+s,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",ui(t.display),!0}return!1}function fi(t,e){for(var n=[],r=!1,i=0;i<t.length;i++){var o=t[i],s=null;if("string"!=typeof o&&(s=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!e)continue;r=!0}n.push({className:o,style:s})}return e&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function di(t){var e=t.gutters,n=t.gutterSpecs;L(e),t.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,s=i.style,a=e.appendChild(k("div",null,"CodeMirror-gutter "+o));s&&(a.style.cssText=s),"CodeMirror-linenumbers"==o&&(t.lineGutter=a,a.style.width=(t.lineNumWidth||1)+"px")}e.style.display=n.length?"":"none",ui(t)}function gi(t){di(t.display),hr(t),hi(t)}function vi(t,e,r,i){var o=this;this.input=r,o.scrollbarFiller=k("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=k("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=O("div",null,"CodeMirror-code"),o.selectionDiv=k("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=k("div",null,"CodeMirror-cursors"),o.measure=k("div",null,"CodeMirror-measure"),o.lineMeasure=k("div",null,"CodeMirror-measure"),o.lineSpace=O("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var u=O("div",[o.lineSpace],"CodeMirror-lines");o.mover=k("div",[u],null,"position: relative"),o.sizer=k("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=k("div",null,null,"position: absolute; height: 50px; width: 1px;"),o.gutters=k("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=k("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=k("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),s&&a<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||n&&m||(o.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(o.wrapper):t(o.wrapper)),o.viewFrom=o.viewTo=e.first,o.reportedViewFrom=o.reportedViewTo=e.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=fi(i.gutters,i.lineNumbers),di(o),r.init(o)}oi.prototype.signal=function(t,e){mt(t,e)&&this.events.push(arguments)},oi.prototype.finish=function(){for(var t=0;t<this.events.length;t++)dt.apply(null,this.events[t])};var mi=0,yi=null;function xi(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}}function Si(t){var e=xi(t);return e.x*=yi,e.y*=yi,e}function bi(t,e){var r=xi(e),i=r.x,o=r.y,s=t.display,a=s.scroller,u=a.scrollWidth>a.clientWidth,c=a.scrollHeight>a.clientHeight;if(i&&u||o&&c){if(o&&y&&l)t:for(var p=e.target,f=s.view;p!=a;p=p.parentNode)for(var d=0;d<f.length;d++)if(f[d].node==p){t.display.currentWheelTarget=p;break t}if(i&&!n&&!h&&null!=yi)return o&&c&&Dr(t,Math.max(0,a.scrollTop+o*yi)),Fr(t,Math.max(0,a.scrollLeft+i*yi)),(!o||o&&c)&&xt(e),void(s.wheelStartX=null);if(o&&null!=yi){var g=o*yi,v=t.doc.scrollTop,m=v+s.wrapper.clientHeight;g<0?v=Math.max(0,v+g-50):m=Math.min(t.doc.height,m+g+50),li(t,{top:v,bottom:m})}mi<20&&(null==s.wheelStartX?(s.wheelStartX=a.scrollLeft,s.wheelStartY=a.scrollTop,s.wheelDX=i,s.wheelDY=o,setTimeout((function(){if(null!=s.wheelStartX){var t=a.scrollLeft-s.wheelStartX,e=a.scrollTop-s.wheelStartY,n=e&&s.wheelDY&&e/s.wheelDY||t&&s.wheelDX&&t/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(yi=(yi*mi+n)/(mi+1),++mi)}}),200)):(s.wheelDX+=i,s.wheelDY+=o))}}s?yi=-.53:n?yi=15:c?yi=-.7:p&&(yi=-1/3);var Ti=function(t,e){this.ranges=t,this.primIndex=e};Ti.prototype.primary=function(){return this.ranges[this.primIndex]},Ti.prototype.equals=function(t){if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var e=0;e<this.ranges.length;e++){var n=this.ranges[e],r=t.ranges[e];if(!ne(n.anchor,r.anchor)||!ne(n.head,r.head))return!1}return!0},Ti.prototype.deepCopy=function(){for(var t=[],e=0;e<this.ranges.length;e++)t[e]=new Ci(re(this.ranges[e].anchor),re(this.ranges[e].head));return new Ti(t,this.primIndex)},Ti.prototype.somethingSelected=function(){for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].empty())return!0;return!1},Ti.prototype.contains=function(t,e){e||(e=t);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ee(e,r.from())>=0&&ee(t,r.to())<=0)return n}return-1};var Ci=function(t,e){this.anchor=t,this.head=e};function wi(t,e,n){var r=t&&t.options.selectionsMayTouch,i=e[n];e.sort((function(t,e){return ee(t.from(),e.from())})),n=W(e,i);for(var o=1;o<e.length;o++){var s=e[o],a=e[o-1],l=ee(a.to(),s.from());if(r&&!s.empty()?l>0:l>=0){var u=oe(a.from(),s.from()),c=ie(a.to(),s.to()),h=a.empty()?s.from()==s.head:a.from()==a.head;o<=n&&--n,e.splice(--o,2,new Ci(h?c:u,h?u:c))}}return new Ti(e,n)}function Ei(t,e){return new Ti([new Ci(t,e||t)],0)}function Ai(t){return t.text?te(t.from.line+t.text.length-1,Y(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function Li(t,e){if(ee(t,e.from)<0)return t;if(ee(t,e.to)<=0)return Ai(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;return t.line==e.to.line&&(r+=Ai(e).ch-e.to.ch),te(n,r)}function Ni(t,e){for(var n=[],r=0;r<t.sel.ranges.length;r++){var i=t.sel.ranges[r];n.push(new Ci(Li(i.anchor,e),Li(i.head,e)))}return wi(t.cm,n,t.sel.primIndex)}function ki(t,e,n){return t.line==e.line?te(n.line,t.ch-e.ch+n.ch):te(n.line+(t.line-e.line),t.ch)}function Oi(t){t.doc.mode=Bt(t.options,t.doc.modeOption),_i(t)}function _i(t){t.doc.iter((function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)})),t.doc.modeFrontier=t.doc.highlightFrontier=t.doc.first,ri(t,100),t.state.modeGen++,t.curOp&&hr(t)}function Ii(t,e){return 0==e.from.ch&&0==e.to.ch&&""==Y(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function Mi(t,e,n,r){function i(t){return n?n[t]:null}function o(t,n,i){!function(t,e,n,r){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),Ne(t),ke(t,n);var i=r?r(t):1;i!=t.height&&Xt(t,i)}(t,n,i,r),ln(t,"change",t,e)}function s(t,e){for(var n=[],o=t;o<e;++o)n.push(new Ge(u[o],i(o),r));return n}var a=e.from,l=e.to,u=e.text,c=Gt(t,a.line),h=Gt(t,l.line),p=Y(u),f=i(u.length-1),d=l.line-a.line;if(e.full)t.insert(0,s(0,u.length)),t.remove(u.length,t.size-u.length);else if(Ii(t,e)){var g=s(0,u.length-1);o(h,h.text,f),d&&t.remove(a.line,d),g.length&&t.insert(a.line,g)}else if(c==h)if(1==u.length)o(c,c.text.slice(0,a.ch)+p+c.text.slice(l.ch),f);else{var v=s(1,u.length-1);v.push(new Ge(p+c.text.slice(l.ch),f,r)),o(c,c.text.slice(0,a.ch)+u[0],i(0)),t.insert(a.line+1,v)}else if(1==u.length)o(c,c.text.slice(0,a.ch)+u[0]+h.text.slice(l.ch),i(0)),t.remove(a.line+1,d);else{o(c,c.text.slice(0,a.ch)+u[0],i(0)),o(h,p+h.text.slice(l.ch),f);var m=s(1,u.length-1);d>1&&t.remove(a.line+1,d-1),t.insert(a.line+1,m)}ln(t,"change",t,e)}function Pi(t,e,n){!function t(r,i,o){if(r.linked)for(var s=0;s<r.linked.length;++s){var a=r.linked[s];if(a.doc!=i){var l=o&&a.sharedHist;n&&!l||(e(a.doc,l),t(a.doc,r,l))}}}(t,null,!0)}function Di(t,e){if(e.cm)throw new Error("This document is already in use.");t.doc=e,e.cm=t,lr(t),Oi(t),Ri(t),t.options.lineWrapping||qe(t),t.options.mode=e.modeOption,hr(t)}function Ri(t){("rtl"==t.doc.direction?M:A)(t.display.lineDiv,"CodeMirror-rtl")}function Fi(t){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=t||1}function Hi(t,e){var n={from:re(e.from),to:Ai(e),text:Kt(t,e.from,e.to)};return Ui(t,n,e.from.line,e.to.line+1),Pi(t,(function(t){return Ui(t,n,e.from.line,e.to.line+1)}),!0),n}function Bi(t){for(;t.length&&Y(t).ranges;)t.pop()}function Wi(t,e,n,r){var i=t.history;i.undone.length=0;var o,s,a=+new Date;if((i.lastOp==r||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&i.lastModTime>a-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=function(t,e){return e?(Bi(t.done),Y(t.done)):t.done.length&&!Y(t.done).ranges?Y(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),Y(t.done)):void 0}(i,i.lastOp==r)))s=Y(o.changes),0==ee(e.from,e.to)&&0==ee(e.from,s.to)?s.to=Ai(e):o.changes.push(Hi(t,e));else{var l=Y(i.done);for(l&&l.ranges||zi(t.sel,i.done),o={changes:[Hi(t,e)],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=e.origin,s||dt(t,"historyAdded")}function ji(t,e,n,r){var i=t.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}(t,o,Y(i.done),e))?i.done[i.done.length-1]=e:zi(e,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Bi(i.undone)}function zi(t,e){var n=Y(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Ui(t,e,n,r){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),(function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=n.markedSpans),++o}))}function Vi(t){if(!t)return null;for(var e,n=0;n<t.length;++n)t[n].marker.explicitlyCleared?e||(e=t.slice(0,n)):e&&e.push(t[n]);return e?e.length?e:null:t}function qi(t,e){var n=function(t,e){var n=e["spans_"+t.id];if(!n)return null;for(var r=[],i=0;i<e.text.length;++i)r.push(Vi(n[i]));return r}(t,e),r=Ae(t,e);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],s=r[i];if(o&&s)t:for(var a=0;a<s.length;++a){for(var l=s[a],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue t;o.push(l)}else s&&(n[i]=s)}return n}function Gi(t,e,n){for(var r=[],i=0;i<t.length;++i){var o=t[i];if(o.ranges)r.push(n?Ti.prototype.deepCopy.call(o):o);else{var s=o.changes,a=[];r.push({changes:a});for(var l=0;l<s.length;++l){var u=s[l],c=void 0;if(a.push({from:u.from,to:u.to,text:u.text}),e)for(var h in u)(c=h.match(/^spans_(\d+)$/))&&W(e,Number(c[1]))>-1&&(Y(a)[h]=u[h],delete u[h])}}}return r}function Ki(t,e,n,r){if(r){var i=t.anchor;if(n){var o=ee(e,i)<0;o!=ee(n,i)<0?(i=e,e=n):o!=ee(e,n)<0&&(e=n)}return new Ci(i,e)}return new Ci(n||e,e)}function Yi(t,e,n,r,i){null==i&&(i=t.cm&&(t.cm.display.shift||t.extend)),Qi(t,new Ti([Ki(t.sel.primary(),e,n,i)],0),r)}function Xi(t,e,n){for(var r=[],i=t.cm&&(t.cm.display.shift||t.extend),o=0;o<t.sel.ranges.length;o++)r[o]=Ki(t.sel.ranges[o],e[o],null,i);Qi(t,wi(t.cm,r,t.sel.primIndex),n)}function $i(t,e,n,r){var i=t.sel.ranges.slice(0);i[e]=n,Qi(t,wi(t.cm,i,t.sel.primIndex),r)}function Zi(t,e,n,r){Qi(t,Ei(e,n),r)}function Ji(t,e,n){var r=t.history.done,i=Y(r);i&&i.ranges?(r[r.length-1]=e,to(t,e,n)):Qi(t,e,n)}function Qi(t,e,n){to(t,e,n),ji(t,t.sel,t.cm?t.cm.curOp.id:NaN,n)}function to(t,e,n){(mt(t,"beforeSelectionChange")||t.cm&&mt(t.cm,"beforeSelectionChange"))&&(e=function(t,e,n){var r={ranges:e.ranges,update:function(e){this.ranges=[];for(var n=0;n<e.length;n++)this.ranges[n]=new Ci(ae(t,e[n].anchor),ae(t,e[n].head))},origin:n&&n.origin};return dt(t,"beforeSelectionChange",t,r),t.cm&&dt(t.cm,"beforeSelectionChange",t.cm,r),r.ranges!=e.ranges?wi(t.cm,r.ranges,r.ranges.length-1):e}(t,e,n));var r=n&&n.bias||(ee(e.primary().head,t.sel.primary().head)<0?-1:1);eo(t,ro(t,e,r,!0)),n&&!1===n.scroll||!t.cm||_r(t.cm)}function eo(t,e){e.equals(t.sel)||(t.sel=e,t.cm&&(t.cm.curOp.updateInput=1,t.cm.curOp.selectionChanged=!0,vt(t.cm)),ln(t,"cursorActivity",t))}function no(t){eo(t,ro(t,t.sel,null,!1))}function ro(t,e,n,r){for(var i,o=0;o<e.ranges.length;o++){var s=e.ranges[o],a=e.ranges.length==t.sel.ranges.length&&t.sel.ranges[o],l=oo(t,s.anchor,a&&a.anchor,n,r),u=oo(t,s.head,a&&a.head,n,r);(i||l!=s.anchor||u!=s.head)&&(i||(i=e.ranges.slice(0,o)),i[o]=new Ci(l,u))}return i?wi(t.cm,i,e.primIndex):e}function io(t,e,n,r,i){var o=Gt(t,e.line);if(o.markedSpans)for(var s=0;s<o.markedSpans.length;++s){var a=o.markedSpans[s],l=a.marker,u="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,c="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==a.from||(u?a.from<=e.ch:a.from<e.ch))&&(null==a.to||(c?a.to>=e.ch:a.to>e.ch))){if(i&&(dt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var h=l.find(r<0?1:-1),p=void 0;if((r<0?c:u)&&(h=so(t,h,-r,h&&h.line==e.line?o:null)),h&&h.line==e.line&&(p=ee(h,n))&&(r<0?p<0:p>0))return io(t,h,e,r,i)}var f=l.find(r<0?-1:1);return(r<0?u:c)&&(f=so(t,f,r,f.line==e.line?o:null)),f?io(t,f,e,r,i):null}}return e}function oo(t,e,n,r,i){var o=r||1,s=io(t,e,n,o,i)||!i&&io(t,e,n,o,!0)||io(t,e,n,-o,i)||!i&&io(t,e,n,-o,!0);return s||(t.cantEdit=!0,te(t.first,0))}function so(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?ae(t,te(e.line-1)):null:n>0&&e.ch==(r||Gt(t,e.line)).text.length?e.line<t.first+t.size-1?te(e.line+1,0):null:new te(e.line,e.ch+n)}function ao(t){t.setSelection(te(t.firstLine(),0),te(t.lastLine()),z)}function lo(t,e,n){var r={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(e,n,i,o){e&&(r.from=ae(t,e)),n&&(r.to=ae(t,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),dt(t,"beforeChange",t,r),t.cm&&dt(t.cm,"beforeChange",t.cm,r),r.canceled?(t.cm&&(t.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function uo(t,e,n){if(t.cm){if(!t.cm.curOp)return ti(t.cm,uo)(t,e,n);if(t.cm.state.suppressEdits)return}if(!(mt(t,"beforeChange")||t.cm&&mt(t.cm,"beforeChange"))||(e=lo(t,e,!0))){var r=be&&!n&&function(t,e,n){var r=null;if(t.iter(e.line,n.line+1,(function(t){if(t.markedSpans)for(var e=0;e<t.markedSpans.length;++e){var n=t.markedSpans[e].marker;!n.readOnly||r&&-1!=W(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:e,to:n}],o=0;o<r.length;++o)for(var s=r[o],a=s.find(0),l=0;l<i.length;++l){var u=i[l];if(!(ee(u.to,a.from)<0||ee(u.from,a.to)>0)){var c=[l,1],h=ee(u.from,a.from),p=ee(u.to,a.to);(h<0||!s.inclusiveLeft&&!h)&&c.push({from:u.from,to:a.from}),(p>0||!s.inclusiveRight&&!p)&&c.push({from:a.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}(t,e.from,e.to);if(r)for(var i=r.length-1;i>=0;--i)co(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text,origin:e.origin});else co(t,e)}}function co(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ee(e.from,e.to)){var n=Ni(t,e);Wi(t,e,n,t.cm?t.cm.curOp.id:NaN),fo(t,e,n,Ae(t,e));var r=[];Pi(t,(function(t,n){n||-1!=W(r,t.history)||(yo(t.history,e),r.push(t.history)),fo(t,e,null,Ae(t,e))}))}}function ho(t,e,n){var r=t.cm&&t.cm.state.suppressEdits;if(!r||n){for(var i,o=t.history,s=t.sel,a="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,u=0;u<a.length&&(i=a[u],n?!i.ranges||i.equals(t.sel):i.ranges);u++);if(u!=a.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=a.pop()).ranges){if(r)return void a.push(i);break}if(zi(i,l),n&&!i.equals(t.sel))return void Qi(t,i,{clearRedo:!1});s=i}var c=[];zi(s,l),l.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var h=mt(t,"beforeChange")||t.cm&&mt(t.cm,"beforeChange"),p=function(n){var r=i.changes[n];if(r.origin=e,h&&!lo(t,r,!1))return a.length=0,{};c.push(Hi(t,r));var o=n?Ni(t,r):Y(a);fo(t,r,o,qi(t,r)),!n&&t.cm&&t.cm.scrollIntoView({from:r.from,to:Ai(r)});var s=[];Pi(t,(function(t,e){e||-1!=W(s,t.history)||(yo(t.history,r),s.push(t.history)),fo(t,r,null,qi(t,r))}))},f=i.changes.length-1;f>=0;--f){var d=p(f);if(d)return d.v}}}}function po(t,e){if(0!=e&&(t.first+=e,t.sel=new Ti(X(t.sel.ranges,(function(t){return new Ci(te(t.anchor.line+e,t.anchor.ch),te(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){hr(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;r<n.viewTo;r++)pr(t.cm,r,"gutter")}}function fo(t,e,n,r){if(t.cm&&!t.cm.curOp)return ti(t.cm,fo)(t,e,n,r);if(e.to.line<t.first)po(t,e.text.length-1-(e.to.line-e.from.line));else if(!(e.from.line>t.lastLine())){if(e.from.line<t.first){var i=e.text.length-1-(t.first-e.from.line);po(t,i),e={from:te(t.first,0),to:te(e.to.line+i,e.to.ch),text:[Y(e.text)],origin:e.origin}}var o=t.lastLine();e.to.line>o&&(e={from:e.from,to:te(o,Gt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Kt(t,e.from,e.to),n||(n=Ni(t,e)),t.cm?function(t,e,n){var r=t.doc,i=t.display,o=e.from,s=e.to,a=!1,l=o.line;t.options.lineWrapping||(l=$t(He(Gt(r,o.line))),r.iter(l,s.line+1,(function(t){if(t==i.maxLine)return a=!0,!0}))),r.sel.contains(e.from,e.to)>-1&&vt(t),Mi(r,e,n,ar(t)),t.options.lineWrapping||(r.iter(l,o.line+e.text.length,(function(t){var e=Ve(t);e>i.maxLineLength&&(i.maxLine=t,i.maxLineLength=e,i.maxLineChanged=!0,a=!1)})),a&&(t.curOp.updateMaxLine=!0)),function(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontier<e-10)){for(var n=t.first,r=e-1;r>n;r--){var i=Gt(t,r).stateAfter;if(i&&(!(i instanceof ue)||r+i.lookAhead<e)){n=r+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,n)}}(r,o.line),ri(t,400);var u=e.text.length-(s.line-o.line)-1;e.full?hr(t):o.line!=s.line||1!=e.text.length||Ii(t.doc,e)?hr(t,o.line,s.line+1,u):pr(t,o.line,"text");var c=mt(t,"changes"),h=mt(t,"change");if(h||c){var p={from:o,to:s,text:e.text,removed:e.removed,origin:e.origin};h&&ln(t,"change",t,p),c&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(p)}t.display.selForContextMenu=null}(t.cm,e,r):Mi(t,e,r),to(t,n,z),t.cantEdit&&oo(t,te(t.firstLine(),0))&&(t.cantEdit=!1)}}function go(t,e,n,r,i){var o;r||(r=n),ee(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof e&&(e=t.splitLines(e)),uo(t,{from:n,to:r,text:e,origin:i})}function vo(t,e,n,r){n<t.line?t.line+=r:e<t.line&&(t.line=e,t.ch=0)}function mo(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i],s=!0;if(o.ranges){o.copied||((o=t[i]=o.deepCopy()).copied=!0);for(var a=0;a<o.ranges.length;a++)vo(o.ranges[a].anchor,e,n,r),vo(o.ranges[a].head,e,n,r)}else{for(var l=0;l<o.changes.length;++l){var u=o.changes[l];if(n<u.from.line)u.from=te(u.from.line+r,u.from.ch),u.to=te(u.to.line+r,u.to.ch);else if(e<=u.to.line){s=!1;break}}s||(t.splice(0,i+1),i=0)}}}function yo(t,e){var n=e.from.line,r=e.to.line,i=e.text.length-(r-n)-1;mo(t.done,n,r,i),mo(t.undone,n,r,i)}function xo(t,e,n,r){var i=e,o=e;return"number"==typeof e?o=Gt(t,se(t,e)):i=$t(e),null==i?null:(r(o,i)&&t.cm&&pr(t.cm,i,n),o)}function So(t){this.lines=t,this.parent=null;for(var e=0,n=0;n<t.length;++n)t[n].parent=this,e+=t[n].height;this.height=e}function bo(t){this.children=t;for(var e=0,n=0,r=0;r<t.length;++r){var i=t[r];e+=i.chunkSize(),n+=i.height,i.parent=this}this.size=e,this.height=n,this.parent=null}Ci.prototype.from=function(){return oe(this.anchor,this.head)},Ci.prototype.to=function(){return ie(this.anchor,this.head)},Ci.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},So.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=t,r=t+e;n<r;++n){var i=this.lines[n];this.height-=i.height,Ke(i),ln(i,"delete")}this.lines.splice(t,e)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,e,n){this.height+=n,this.lines=this.lines.slice(0,t).concat(e).concat(this.lines.slice(t));for(var r=0;r<e.length;++r)e[r].parent=this},iterN:function(t,e,n){for(var r=t+e;t<r;++t)if(n(this.lines[t]))return!0}},bo.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){this.size-=e;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(t<i){var o=Math.min(e,i-t),s=r.height;if(r.removeInner(t,o),this.height-=s-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(e-=o))break;t=0}else t-=i}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof So))){var a=[];this.collapse(a),this.children=[new So(a)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e<this.children.length;++e)this.children[e].collapse(t)},insertInner:function(t,e,n){this.size+=e.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(t<=o){if(i.insertInner(t,e,n),i.lines&&i.lines.length>50){for(var s=i.lines.length%25+25,a=s;a<i.lines.length;){var l=new So(i.lines.slice(a,a+=25));i.height-=l.height,this.children.splice(++r,0,l),l.parent=this}i.lines=i.lines.slice(0,s),this.maybeSpill()}break}t-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=new bo(t.children.splice(t.children.length-5,5));if(t.parent){t.size-=e.size,t.height-=e.height;var n=W(t.parent.children,t);t.parent.children.splice(n+1,0,e)}else{var r=new bo(t.children);r.parent=t,t.children=[r,e],t=r}e.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(t<o){var s=Math.min(e,o-t);if(i.iterN(t,s,n))return!0;if(0==(e-=s))break;t=0}else t-=o}}};var To=function(t,e,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=t,this.node=e};function Co(t,e,n){Ue(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&Or(t,n)}To.prototype.clear=function(){var t=this.doc.cm,e=this.line.widgets,n=this.line,r=$t(n);if(null!=r&&e){for(var i=0;i<e.length;++i)e[i]==this&&e.splice(i--,1);e.length||(n.widgets=null);var o=bn(this);Xt(n,Math.max(0,n.height-o)),t&&(Qr(t,(function(){Co(t,n,-o),pr(t,r,"widget")})),ln(t,"lineWidgetCleared",t,this,r))}},To.prototype.changed=function(){var t=this,e=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=bn(this)-e;i&&(je(this.doc,r)||Xt(r,r.height+i),n&&Qr(n,(function(){n.curOp.forceUpdate=!0,Co(n,r,i),ln(n,"lineWidgetChanged",n,t,$t(r))})))},yt(To);var wo=0,Eo=function(t,e){this.lines=[],this.type=e,this.doc=t,this.id=++wo};function Ao(t,e,n,r,i){if(r&&r.shared)return function(t,e,n,r,i){(r=F(r)).shared=!1;var o=[Ao(t,e,n,r,i)],s=o[0],a=r.widgetNode;return Pi(t,(function(t){a&&(r.widgetNode=a.cloneNode(!0)),o.push(Ao(t,ae(t,e),ae(t,n),r,i));for(var l=0;l<t.linked.length;++l)if(t.linked[l].isParent)return;s=Y(o)})),new Lo(o,s)}(t,e,n,r,i);if(t.cm&&!t.cm.curOp)return ti(t.cm,Ao)(t,e,n,r,i);var o=new Eo(t,i),s=ee(e,n);if(r&&F(r,o,!1),s>0||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(Fe(t,e.line,e,n,o)||e.line!=n.line&&Fe(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Te=!0}o.addToHistory&&Wi(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var a,l=e.line,u=t.cm;if(t.iter(l,n.line+1,(function(t){u&&o.collapsed&&!u.options.lineWrapping&&He(t)==u.display.maxLine&&(a=!0),o.collapsed&&l!=e.line&&Xt(t,0),function(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],e.marker.attachLine(t)}(t,new Ce(o,l==e.line?e.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&t.iter(e.line,n.line+1,(function(e){je(t,e)&&Xt(e,0)})),o.clearOnEnter&&ht(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(be=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++wo,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)hr(u,e.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=e.line;c<=n.line;c++)pr(u,c,"text");o.atomic&&no(u.doc),ln(u,"markerAdded",u,o)}return o}Eo.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Gr(t),mt(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var s=this.lines[o],a=we(s.markedSpans,this);t&&!this.collapsed?pr(t,$t(s),"text"):t&&(null!=a.to&&(i=$t(s)),null!=a.from&&(r=$t(s))),s.markedSpans=Ee(s.markedSpans,a),null==a.from&&this.collapsed&&!je(this.doc,s)&&t&&Xt(s,rr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var u=He(this.lines[l]),c=Ve(u);c>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=c,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&hr(t,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&no(t.doc)),t&&ln(t,"markerCleared",t,this,r,i),e&&Kr(t),this.parent&&this.parent.clear()}},Eo.prototype.find=function(t,e){var n,r;null==t&&"bookmark"==this.type&&(t=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],s=we(o.markedSpans,this);if(null!=s.from&&(n=te(e?o:$t(o),s.from),-1==t))return n;if(null!=s.to&&(r=te(e?o:$t(o),s.to),1==t))return r}return n&&{from:n,to:r}},Eo.prototype.changed=function(){var t=this,e=this.find(-1,!0),n=this,r=this.doc.cm;e&&r&&Qr(r,(function(){var i=e.line,o=$t(e.line),s=_n(r,o);if(s&&(Hn(s),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!je(n.doc,i)&&null!=n.height){var a=n.height;n.height=null;var l=bn(n)-a;l&&Xt(i,i.height+l)}ln(r,"markerChanged",r,t)}))},Eo.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=W(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)},Eo.prototype.detachLine=function(t){if(this.lines.splice(W(this.lines,t),1),!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}},yt(Eo);var Lo=function(t,e){this.markers=t,this.primary=e;for(var n=0;n<t.length;++n)t[n].parent=this};function No(t){return t.findMarks(te(t.first,0),t.clipPos(te(t.lastLine())),(function(t){return t.parent}))}function ko(t){for(var e=function(e){var n=t[e],r=[n.primary.doc];Pi(n.primary.doc,(function(t){return r.push(t)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==W(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<t.length;n++)e(n)}Lo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();ln(this,"clear")}},Lo.prototype.find=function(t,e){return this.primary.find(t,e)},yt(Lo);var Oo=0,_o=function(t,e,n,r,i){if(!(this instanceof _o))return new _o(t,e,n,r,i);null==n&&(n=0),bo.call(this,[new So([new Ge("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=te(n,0);this.sel=Ei(o),this.history=new Fi(null),this.id=++Oo,this.modeOption=e,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),Mi(this,{from:o,to:o,text:t}),Qi(this,Ei(o),z)};_o.prototype=Z(bo.prototype,{constructor:_o,iter:function(t,e,n){n?this.iterN(t-this.first,e-t,n):this.iterN(this.first,this.first+this.size,t)},insert:function(t,e){for(var n=0,r=0;r<e.length;++r)n+=e[r].height;this.insertInner(t-this.first,e,n)},remove:function(t,e){this.removeInner(t-this.first,e)},getValue:function(t){var e=Yt(this,this.first,this.first+this.size);return!1===t?e:e.join(t||this.lineSeparator())},setValue:ni((function(t){var e=te(this.first,0),n=this.first+this.size-1;uo(this,{from:e,to:te(n,Gt(this,n).text.length),text:this.splitLines(t),origin:"setValue",full:!0},!0),this.cm&&Ir(this.cm,0,0),Qi(this,Ei(e),z)})),replaceRange:function(t,e,n,r){go(this,t,e=ae(this,e),n=n?ae(this,n):e,r)},getRange:function(t,e,n){var r=Kt(this,ae(this,t),ae(this,e));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){if(Jt(this,t))return Gt(this,t)},getLineNumber:function(t){return $t(t)},getLineHandleVisualStart:function(t){return"number"==typeof t&&(t=Gt(this,t)),He(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return ae(this,t)},getCursor:function(t){var e=this.sel.primary();return null==t||"head"==t?e.head:"anchor"==t?e.anchor:"end"==t||"to"==t||!1===t?e.to():e.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ni((function(t,e,n){Zi(this,ae(this,"number"==typeof t?te(t,e||0):t),null,n)})),setSelection:ni((function(t,e,n){Zi(this,ae(this,t),ae(this,e||t),n)})),extendSelection:ni((function(t,e,n){Yi(this,ae(this,t),e&&ae(this,e),n)})),extendSelections:ni((function(t,e){Xi(this,le(this,t),e)})),extendSelectionsBy:ni((function(t,e){Xi(this,le(this,X(this.sel.ranges,t)),e)})),setSelections:ni((function(t,e,n){if(t.length){for(var r=[],i=0;i<t.length;i++)r[i]=new Ci(ae(this,t[i].anchor),ae(this,t[i].head));null==e&&(e=Math.min(t.length-1,this.sel.primIndex)),Qi(this,wi(this.cm,r,e),n)}})),addSelection:ni((function(t,e,n){var r=this.sel.ranges.slice(0);r.push(new Ci(ae(this,t),ae(this,e||t))),Qi(this,wi(this.cm,r,r.length-1),n)})),getSelection:function(t){for(var e,n=this.sel.ranges,r=0;r<n.length;r++){var i=Kt(this,n[r].from(),n[r].to());e=e?e.concat(i):i}return!1===t?e:e.join(t||this.lineSeparator())},getSelections:function(t){for(var e=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Kt(this,n[r].from(),n[r].to());!1!==t&&(i=i.join(t||this.lineSeparator())),e[r]=i}return e},replaceSelection:function(t,e,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=t;this.replaceSelections(r,e,n||"+input")},replaceSelections:ni((function(t,e,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var s=i.ranges[o];r[o]={from:s.from(),to:s.to(),text:this.splitLines(t[o]),origin:n}}for(var a=e&&"end"!=e&&function(t,e,n){for(var r=[],i=te(t.first,0),o=i,s=0;s<e.length;s++){var a=e[s],l=ki(a.from,i,o),u=ki(Ai(a),i,o);if(i=a.to,o=u,"around"==n){var c=t.sel.ranges[s],h=ee(c.head,c.anchor)<0;r[s]=new Ci(h?u:l,h?l:u)}else r[s]=new Ci(l,l)}return new Ti(r,t.sel.primIndex)}(this,r,e),l=r.length-1;l>=0;l--)uo(this,r[l]);a?Ji(this,a):this.cm&&_r(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(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,r=0;r<t.done.length;r++)t.done[r].ranges||++e;for(var i=0;i<t.undone.length;i++)t.undone[i].ranges||++n;return{undo:e,redo:n}},clearHistory:function(){var t=this;this.history=new Fi(this.history.maxGeneration),Pi(this,(function(e){return e.history=t.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(t){return t&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:Gi(this.history.done),undone:Gi(this.history.undone)}},setHistory:function(t){var e=this.history=new Fi(this.history.maxGeneration);e.done=Gi(t.done.slice(0),null,!0),e.undone=Gi(t.undone.slice(0),null,!0)},setGutterMarker:ni((function(t,e,n){return xo(this,t,"gutter",(function(t){var r=t.gutterMarkers||(t.gutterMarkers={});return r[e]=n,!n&&et(r)&&(t.gutterMarkers=null),!0}))})),clearGutter:ni((function(t){var e=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[t]&&xo(e,n,"gutter",(function(){return n.gutterMarkers[t]=null,et(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(t){var e;if("number"==typeof t){if(!Jt(this,t))return null;if(e=t,!(t=Gt(this,t)))return null}else if(null==(e=$t(t)))return null;return{line:e,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},addLineClass:ni((function(t,e,n){return xo(this,t,"gutter"==e?"gutter":"class",(function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass";if(t[r]){if(w(n).test(t[r]))return!1;t[r]+=" "+n}else t[r]=n;return!0}))})),removeLineClass:ni((function(t,e,n){return xo(this,t,"gutter"==e?"gutter":"class",(function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass",i=t[r];if(!i)return!1;if(null==n)t[r]=null;else{var o=i.match(w(n));if(!o)return!1;var s=o.index+o[0].length;t[r]=i.slice(0,o.index)+(o.index&&s!=i.length?" ":"")+i.slice(s)||null}return!0}))})),addLineWidget:ni((function(t,e,n){return function(t,e,n,r){var i=new To(t,n,r),o=t.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),xo(t,e,"widget",(function(e){var n=e.widgets||(e.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=e,o&&!je(t,e)){var r=Ue(e)<t.scrollTop;Xt(e,e.height+bn(i)),r&&Or(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&ln(o,"lineWidgetAdded",o,i,"number"==typeof e?e:$t(e)),i}(this,t,e,n)})),removeLineWidget:function(t){t.clear()},markText:function(t,e,n){return Ao(this,ae(this,t),ae(this,e),n,n&&n.type||"range")},setBookmark:function(t,e){var n={replacedWith:e&&(null==e.nodeType?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:!1,shared:e&&e.shared,handleMouseEvents:e&&e.handleMouseEvents};return Ao(this,t=ae(this,t),t,n,"bookmark")},findMarksAt:function(t){var e=[],n=Gt(this,(t=ae(this,t)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=t.ch)&&(null==i.to||i.to>=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=ae(this,t),e=ae(this,e);var r=[],i=t.line;return this.iter(t.line,e.line+1,(function(o){var s=o.markedSpans;if(s)for(var a=0;a<s.length;a++){var l=s[a];null!=l.to&&i==t.line&&t.ch>=l.to||null==l.from&&i!=t.line||null!=l.from&&i==e.line&&l.from>=e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&t.push(n[r].marker)})),t},posFromIndex:function(t){var e,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>t)return e=t,!0;t-=o,++n})),ae(this,te(n,e))},indexFromPos:function(t){var e=(t=ae(this,t)).ch;if(t.line<this.first||t.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,t.line,(function(t){e+=t.text.length+n})),e},copy:function(t){var e=new _o(Yt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return e.scrollTop=this.scrollTop,e.scrollLeft=this.scrollLeft,e.sel=this.sel,e.extend=!1,t&&(e.history.undoDepth=this.history.undoDepth,e.setHistory(this.getHistory())),e},linkedDoc:function(t){t||(t={});var e=this.first,n=this.first+this.size;null!=t.from&&t.from>e&&(e=t.from),null!=t.to&&t.to<n&&(n=t.to);var r=new _o(Yt(this,e,n),t.mode||this.modeOption,e,this.lineSep,this.direction);return t.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:t.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}],function(t,e){for(var n=0;n<e.length;n++){var r=e[n],i=r.find(),o=t.clipPos(i.from),s=t.clipPos(i.to);if(ee(o,s)){var a=Ao(t,o,s,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}(r,No(this)),r},unlinkDoc:function(t){if(t instanceof Ls&&(t=t.doc),this.linked)for(var e=0;e<this.linked.length;++e)if(this.linked[e].doc==t){this.linked.splice(e,1),t.unlinkDoc(this),ko(No(this));break}if(t.history==this.history){var n=[t.id];Pi(t,(function(t){return n.push(t.id)}),!0),t.history=new Fi(null),t.history.done=Gi(this.history.done,n),t.history.undone=Gi(this.history.undone,n)}},iterLinkedDocs:function(t){Pi(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):_t(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ni((function(t){var e;"rtl"!=t&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter((function(t){return t.order=null})),this.cm&&Qr(e=this.cm,(function(){Ri(e),hr(e)})))}))}),_o.prototype.eachLine=_o.prototype.iter;var Io=0;function Mo(t){var e=this;if(Po(e),!gt(e,t)&&!Tn(e.display,t)){xt(t),s&&(Io=+new Date);var n=ur(e,t,!0),r=t.dataTransfer.files;if(n&&!e.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(){++a==i&&ti(e,(function(){var t={from:n=ae(e.doc,n),to:n,text:e.doc.splitLines(o.filter((function(t){return null!=t})).join(e.doc.lineSeparator())),origin:"paste"};uo(e.doc,t),Ji(e.doc,Ei(ae(e.doc,n),ae(e.doc,Ai(t))))}))()},u=function(t,n){if(e.options.allowDropFileTypes&&-1==W(e.options.allowDropFileTypes,t.type))l();else{var r=new FileReader;r.onerror=function(){return l()},r.onload=function(){var t=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(t)||(o[n]=t),l()},r.readAsText(t)}},c=0;c<r.length;c++)u(r[c],c);else{if(e.state.draggingText&&e.doc.sel.contains(n)>-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var h=t.dataTransfer.getData("Text");if(h){var p;if(e.state.draggingText&&!e.state.draggingText.copy&&(p=e.listSelections()),to(e.doc,Ei(n,n)),p)for(var f=0;f<p.length;++f)go(e.doc,"",p[f].anchor,p[f].head,"drag");e.replaceSelection(h,"around","paste"),e.display.input.focus()}}catch(t){}}}}function Po(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function Do(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<e.length;r++){var i=e[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var e=0;e<n.length;e++)t(n[e])}))}}var Ro=!1;function Fo(){var t;Ro||(ht(window,"resize",(function(){null==t&&(t=setTimeout((function(){t=null,Do(Ho)}),100))})),ht(window,"blur",(function(){return Do(Er)})),Ro=!0)}function Ho(t){var e=t.display;e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null,e.scrollbarsClipped=!1,t.setSize()}for(var Bo={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Wo=0;Wo<10;Wo++)Bo[Wo+48]=Bo[Wo+96]=String(Wo);for(var jo=65;jo<=90;jo++)Bo[jo]=String.fromCharCode(jo);for(var zo=1;zo<=12;zo++)Bo[zo+111]=Bo[zo+63235]="F"+zo;var Uo={};function Vo(t){var e,n,r,i,o=t.split(/-(?!$)/);t=o[o.length-1];for(var s=0;s<o.length-1;s++){var a=o[s];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))e=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);r=!0}}return e&&(t="Alt-"+t),n&&(t="Ctrl-"+t),i&&(t="Cmd-"+t),r&&(t="Shift-"+t),t}function qo(t){var e={};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete t[n];continue}for(var i=X(n.split(" "),Vo),o=0;o<i.length;o++){var s=void 0,a=void 0;o==i.length-1?(a=i.join(" "),s=r):(a=i.slice(0,o+1).join(" "),s="...");var l=e[a];if(l){if(l!=s)throw new Error("Inconsistent bindings for "+a)}else e[a]=s}delete t[n]}for(var u in e)t[u]=e[u];return t}function Go(t,e,n,r){var i=(e=$o(e)).call?e.call(t,r):e[t];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return Go(t,e.fallthrough,n,r);for(var o=0;o<e.fallthrough.length;o++){var s=Go(t,e.fallthrough[o],n,r);if(s)return s}}}function Ko(t){var e="string"==typeof t?t:Bo[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e}function Yo(t,e,n){var r=t;return e.altKey&&"Alt"!=r&&(t="Alt-"+t),(T?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(t="Ctrl-"+t),(T?e.ctrlKey:e.metaKey)&&"Cmd"!=r&&(t="Cmd-"+t),!n&&e.shiftKey&&"Shift"!=r&&(t="Shift-"+t),t}function Xo(t,e){if(h&&34==t.keyCode&&t.char)return!1;var n=Bo[t.keyCode];return null!=n&&!t.altGraphKey&&(3==t.keyCode&&t.code&&(n=t.code),Yo(n,t,e))}function $o(t){return"string"==typeof t?Uo[t]:t}function Zo(t,e){for(var n=t.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=e(n[i]);r.length&&ee(o.from,Y(r).to)<=0;){var s=r.pop();if(ee(s.from,o.from)<0){o.from=s.from;break}}r.push(o)}Qr(t,(function(){for(var e=r.length-1;e>=0;e--)go(t.doc,"",r[e].from,r[e].to,"+delete");_r(t)}))}function Jo(t,e,n){var r=it(t.text,e+n,n);return r<0||r>t.text.length?null:r}function Qo(t,e,n){var r=Jo(t,e.ch,n);return null==r?null:new te(e.line,r,n<0?"after":"before")}function ts(t,e,n,r,i){if(t){"rtl"==e.doc.direction&&(i=-i);var o=ut(n,e.doc.direction);if(o){var s,a=i<0?Y(o):o[0],l=i<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==e.doc.direction){var u=In(e,n);s=i<0?n.text.length-1:0;var c=Mn(e,u,s).top;s=ot((function(t){return Mn(e,u,t).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 te(r,s,l)}}return new te(r,i<0?n.text.length:0,i<0?"before":"after")}Uo.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"},Uo.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"},Uo.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"},Uo.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"]},Uo.default=y?Uo.macDefault:Uo.pcDefault;var es={selectAll:ao,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),z)},killLine:function(t){return Zo(t,(function(e){if(e.empty()){var n=Gt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line<t.lastLine()?{from:e.head,to:te(e.head.line+1,0)}:{from:e.head,to:te(e.head.line,n)}}return{from:e.from(),to:e.to()}}))},deleteLine:function(t){return Zo(t,(function(e){return{from:te(e.from().line,0),to:ae(t.doc,te(e.to().line+1,0))}}))},delLineLeft:function(t){return Zo(t,(function(t){return{from:te(t.from().line,0),to:t.from()}}))},delWrappedLineLeft:function(t){return Zo(t,(function(e){var n=t.charCoords(e.head,"div").top+5;return{from:t.coordsChar({left:0,top:n},"div"),to:e.from()}}))},delWrappedLineRight:function(t){return Zo(t,(function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div");return{from:e.from(),to:r}}))},undo:function(t){return t.undo()},redo:function(t){return t.redo()},undoSelection:function(t){return t.undoSelection()},redoSelection:function(t){return t.redoSelection()},goDocStart:function(t){return t.extendSelection(te(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(te(t.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy((function(e){return ns(t,e.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy((function(e){return rs(t,e.head)}),{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy((function(e){return function(t,e){var n=Gt(t.doc,e),r=function(t){for(var e;e=De(t);)t=e.find(1,!0).line;return t}(n);return r!=n&&(e=$t(r)),ts(!0,t,n,e,-1)}(t,e.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div")}),V)},goLineLeft:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:0,top:n},"div")}),V)},goLineLeftSmart:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5,r=t.coordsChar({left:0,top:n},"div");return r.ch<t.getLine(r.line).search(/\S/)?rs(t,e.head):r}),V)},goLineUp:function(t){return t.moveV(-1,"line")},goLineDown:function(t){return t.moveV(1,"line")},goPageUp:function(t){return t.moveV(-1,"page")},goPageDown:function(t){return t.moveV(1,"page")},goCharLeft:function(t){return t.moveH(-1,"char")},goCharRight:function(t){return t.moveH(1,"char")},goColumnLeft:function(t){return t.moveH(-1,"column")},goColumnRight:function(t){return t.moveH(1,"column")},goWordLeft:function(t){return t.moveH(-1,"word")},goGroupRight:function(t){return t.moveH(1,"group")},goGroupLeft:function(t){return t.moveH(-1,"group")},goWordRight:function(t){return t.moveH(1,"word")},delCharBefore:function(t){return t.deleteH(-1,"char")},delCharAfter:function(t){return t.deleteH(1,"char")},delWordBefore:function(t){return t.deleteH(-1,"word")},delWordAfter:function(t){return t.deleteH(1,"word")},delGroupBefore:function(t){return t.deleteH(-1,"group")},delGroupAfter:function(t){return t.deleteH(1,"group")},indentAuto:function(t){return t.indentSelection("smart")},indentMore:function(t){return t.indentSelection("add")},indentLess:function(t){return t.indentSelection("subtract")},insertTab:function(t){return t.replaceSelection("\t")},insertSoftTab:function(t){for(var e=[],n=t.listSelections(),r=t.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),s=H(t.getLine(o.line),o.ch,r);e.push(K(r-s%r))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){return Qr(t,(function(){for(var e=t.listSelections(),n=[],r=0;r<e.length;r++)if(e[r].empty()){var i=e[r].head,o=Gt(t.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new te(i.line,i.ch-1)),i.ch>0)i=new te(i.line,i.ch+1),t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),te(i.line,i.ch-2),i,"+transpose");else if(i.line>t.doc.first){var s=Gt(t.doc,i.line-1).text;s&&(i=new te(i.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+s.charAt(s.length-1),te(i.line-1,s.length-1),i,"+transpose"))}n.push(new Ci(i,i))}t.setSelections(n)}))},newlineAndIndent:function(t){return Qr(t,(function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var r=0;r<e.length;r++)t.indentLine(e[r].from().line,null,!0);_r(t)}))},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function ns(t,e){var n=Gt(t.doc,e),r=He(n);return r!=n&&(e=$t(r)),ts(!0,t,r,e,1)}function rs(t,e){var n=ns(t,e.line),r=Gt(t.doc,n.line),i=ut(r,t.doc.direction);if(!i||0==i[0].level){var o=Math.max(n.ch,r.text.search(/\S/)),s=e.line==n.line&&e.ch<=o&&e.ch;return te(n.line,s?0:o,n.sticky)}return n}function is(t,e,n){if("string"==typeof e&&!(e=es[e]))return!1;t.display.input.ensurePolled();var r=t.display.shift,i=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),i=e(t)!=j}finally{t.display.shift=r,t.state.suppressEdits=!1}return i}var os=new B;function ss(t,e,n,r){var i=t.state.keySeq;if(i){if(Ko(e))return"handled";if(/\'$/.test(e)?t.state.keySeq=null:os.set(50,(function(){t.state.keySeq==i&&(t.state.keySeq=null,t.display.input.reset())})),as(t,i+" "+e,n,r))return!0}return as(t,e,n,r)}function as(t,e,n,r){var i=function(t,e,n){for(var r=0;r<t.state.keyMaps.length;r++){var i=Go(e,t.state.keyMaps[r],n,t);if(i)return i}return t.options.extraKeys&&Go(e,t.options.extraKeys,n,t)||Go(e,t.options.keyMap,n,t)}(t,e,r);return"multi"==i&&(t.state.keySeq=e),"handled"==i&&ln(t,"keyHandled",t,e,n),"handled"!=i&&"multi"!=i||(xt(n),br(t)),!!i}function ls(t,e){var n=Xo(e,!0);return!!n&&(e.shiftKey&&!t.state.keySeq?ss(t,"Shift-"+n,e,(function(e){return is(t,e,!0)}))||ss(t,n,e,(function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return is(t,e)})):ss(t,n,e,(function(e){return is(t,e)})))}var us=null;function cs(t){var e=this;if(!(t.target&&t.target!=e.display.input.getField()||(e.curOp.focus=I(),gt(e,t)))){s&&a<11&&27==t.keyCode&&(t.returnValue=!1);var r=t.keyCode;e.display.shift=16==r||t.shiftKey;var i=ls(e,t);h&&(us=i?r:null,i||88!=r||Mt||!(y?t.metaKey:t.ctrlKey)||e.replaceSelection("",null,"cut")),n&&!y&&!i&&46==r&&t.shiftKey&&!t.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||function(t){var e=t.display.lineDiv;function n(t){18!=t.keyCode&&t.altKey||(A(e,"CodeMirror-crosshair"),ft(document,"keyup",n),ft(document,"mouseover",n))}M(e,"CodeMirror-crosshair"),ht(document,"keyup",n),ht(document,"mouseover",n)}(e)}}function hs(t){16==t.keyCode&&(this.doc.sel.shift=!1),gt(this,t)}function ps(t){var e=this;if(!(t.target&&t.target!=e.display.input.getField()||Tn(e.display,t)||gt(e,t)||t.ctrlKey&&!t.altKey||y&&t.metaKey)){var n=t.keyCode,r=t.charCode;if(h&&n==us)return us=null,void xt(t);if(!h||t.which&&!(t.which<10)||!ls(e,t)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(function(t,e,n){return ss(t,"'"+n+"'",e,(function(e){return is(t,e,!0)}))}(e,t,i)||e.display.input.onKeyPress(t))}}}var fs,ds,gs=function(t,e,n){this.time=t,this.pos=e,this.button=n};function vs(t){var e=this,n=e.display;if(!(gt(e,t)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=t.shiftKey,Tn(n,t))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!xs(e,t)){var r=ur(e,t),i=wt(t),o=r?function(t,e){var n=+new Date;return ds&&ds.compare(n,t,e)?(fs=ds=null,"triple"):fs&&fs.compare(n,t,e)?(ds=new gs(n,t,e),fs=null,"double"):(fs=new gs(n,t,e),ds=null,"single")}(r,i):"single";window.focus(),1==i&&e.state.selectingText&&e.state.selectingText(t),r&&function(t,e,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),ss(t,Yo(o=(1==e?"Left":2==e?"Middle":"Right")+o,i),i,(function(e){if("string"==typeof e&&(e=es[e]),!e)return!1;var r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),r=e(t,n)!=j}finally{t.state.suppressEdits=!1}return r}))}(e,i,r,o,t)||(1==i?r?function(t,e,n,r){s?setTimeout(R(Tr,t),0):t.curOp.focus=I();var i,o=function(t,e,n){var r=t.getOption("configureMouse"),i=r?r(t,e,n):{};if(null==i.unit){var o=x?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==e?"char":"double"==e?"word":"line"}return(null==i.extend||t.doc.extend)&&(i.extend=t.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=y?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(y?n.altKey:n.ctrlKey)),i}(t,n,r),u=t.doc.sel;t.options.dragDrop&&Lt&&!t.isReadOnly()&&"single"==n&&(i=u.contains(e))>-1&&(ee((i=u.ranges[i]).from(),e)<0||e.xRel>0)&&(ee(i.to(),e)>0||e.xRel<0)?function(t,e,n,r){var i=t.display,o=!1,u=ti(t,(function(e){l&&(i.scroller.draggable=!1),t.state.draggingText=!1,ft(i.wrapper.ownerDocument,"mouseup",u),ft(i.wrapper.ownerDocument,"mousemove",c),ft(i.scroller,"dragstart",h),ft(i.scroller,"drop",u),o||(xt(e),r.addNew||Yi(t.doc,n,null,null,r.extend),l&&!p||s&&9==a?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},h=function(){return o=!0};l&&(i.scroller.draggable=!0),t.state.draggingText=u,u.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),ht(i.wrapper.ownerDocument,"mouseup",u),ht(i.wrapper.ownerDocument,"mousemove",c),ht(i.scroller,"dragstart",h),ht(i.scroller,"drop",u),Cr(t),setTimeout((function(){return i.input.focus()}),20)}(t,r,e,o):function(t,e,n,r){var i=t.display,o=t.doc;xt(e);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(t,e,!0,!0),a=-1;else{var c=ms(t,n,r.unit);s=r.extend?Ki(s,c.anchor,c.head,r.extend):c}r.addNew?-1==a?(a=u.length,Qi(o,wi(t,u.concat([s]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&"char"==r.unit&&!r.extend?(Qi(o,wi(t,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):$i(o,a,s,U):(a=0,Qi(o,new Ti([s],0),U),l=o.sel);var h=n;function p(e){if(0!=ee(h,e))if(h=e,"rectangle"==r.unit){for(var i=[],u=t.options.tabSize,c=H(Gt(o,n.line).text,n.ch,u),p=H(Gt(o,e.line).text,e.ch,u),f=Math.min(c,p),d=Math.max(c,p),g=Math.min(n.line,e.line),v=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=v;g++){var m=Gt(o,g).text,y=q(m,f,u);f==d?i.push(new Ci(te(g,y),te(g,y))):m.length>y&&i.push(new Ci(te(g,y),te(g,q(m,d,u))))}i.length||i.push(new Ci(n,n)),Qi(o,wi(t,l.ranges.slice(0,a).concat(i),a),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var x,S=s,b=ms(t,e,r.unit),T=S.anchor;ee(b.anchor,T)>0?(x=b.head,T=oe(S.from(),b.anchor)):(x=b.anchor,T=ie(S.to(),b.head));var C=l.ranges.slice(0);C[a]=function(t,e){var n=e.anchor,r=e.head,i=Gt(t.doc,n.line);if(0==ee(n,r)&&n.sticky==r.sticky)return e;var o=ut(i);if(!o)return e;var s=at(o,n.ch,n.sticky),a=o[s];if(a.from!=n.ch&&a.to!=n.ch)return e;var l,u=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==u||u==o.length)return e;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var c=at(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 p=o[u+(l?-1:0)],f=l==(1==p.level),d=f?p.from:p.to,g=f?"after":"before";return n.ch==d&&n.sticky==g?e:new Ci(new te(n.line,d,g),r)}(t,new Ci(ae(o,T),x)),Qi(o,wi(t,C,a),U)}}var f=i.wrapper.getBoundingClientRect(),d=0;function g(e){t.state.selectingText=!1,d=1/0,e&&(xt(e),i.input.focus()),ft(i.wrapper.ownerDocument,"mousemove",v),ft(i.wrapper.ownerDocument,"mouseup",m),o.history.lastSelOrigin=null}var v=ti(t,(function(e){0!==e.buttons&&wt(e)?function e(n){var s=++d,a=ur(t,n,!0,"rectangle"==r.unit);if(a)if(0!=ee(a,h)){t.curOp.focus=I(),p(a);var l=Nr(i,o);(a.line>=l.to||a.line<l.from)&&setTimeout(ti(t,(function(){d==s&&e(n)})),150)}else{var u=n.clientY<f.top?-20:n.clientY>f.bottom?20:0;u&&setTimeout(ti(t,(function(){d==s&&(i.scroller.scrollTop+=u,e(n))})),50)}}(e):g(e)})),m=ti(t,g);t.state.selectingText=m,ht(i.wrapper.ownerDocument,"mousemove",v),ht(i.wrapper.ownerDocument,"mouseup",m)}(t,r,e,o)}(e,r,o,t):Ct(t)==n.scroller&&xt(t):2==i?(r&&Yi(e.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(C?e.display.input.onContextMenu(t):Cr(e)))}}function ms(t,e,n){if("char"==n)return new Ci(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new Ci(te(e.line,0),ae(t.doc,te(e.line+1,0)));var r=n(t,e);return new Ci(r.from,r.to)}function ys(t,e,n,r){var i,o;if(e.touches)i=e.touches[0].clientX,o=e.touches[0].clientY;else try{i=e.clientX,o=e.clientY}catch(e){return!1}if(i>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&xt(e);var s=t.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!mt(t,n))return bt(e);o-=a.top-s.viewOffset;for(var l=0;l<t.display.gutterSpecs.length;++l){var u=s.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=i)return dt(t,n,t,Zt(t.doc,o),t.display.gutterSpecs[l].className,e),bt(e)}}function xs(t,e){return ys(t,e,"gutterClick",!0)}function Ss(t,e){Tn(t.display,e)||function(t,e){return!!mt(t,"gutterContextMenu")&&ys(t,e,"gutterContextMenu",!1)}(t,e)||gt(t,e,"contextmenu")||C||t.display.input.onContextMenu(e)}function bs(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Wn(t)}gs.prototype.compare=function(t,e,n){return this.time+400>t&&0==ee(e,this.pos)&&n==this.button};var Ts={toString:function(){return"CodeMirror.Init"}},Cs={},ws={};function Es(t,e,n){if(!e!=!(n&&n!=Ts)){var r=t.display.dragFunctions,i=e?ht:ft;i(t.display.scroller,"dragstart",r.start),i(t.display.scroller,"dragenter",r.enter),i(t.display.scroller,"dragover",r.over),i(t.display.scroller,"dragleave",r.leave),i(t.display.scroller,"drop",r.drop)}}function As(t){t.options.lineWrapping?(M(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(A(t.display.wrapper,"CodeMirror-wrap"),qe(t)),lr(t),hr(t),Wn(t),setTimeout((function(){return jr(t)}),100)}function Ls(t,e){var n=this;if(!(this instanceof Ls))return new Ls(t,e);this.options=e=e?F(e):{},F(Cs,e,!1);var r=e.value;"string"==typeof r?r=new _o(r,e.mode,null,e.lineSeparator,e.direction):e.mode&&(r.modeOption=e.mode),this.doc=r;var i=new Ls.inputStyles[e.inputStyle](this),o=this.display=new vi(t,r,i,e);for(var u in o.wrapper.CodeMirror=this,bs(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Vr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new B,keySeq:null,specialChars:null},e.autofocus&&!m&&o.input.focus(),s&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(t){var e=t.display;ht(e.scroller,"mousedown",ti(t,vs)),ht(e.scroller,"dblclick",s&&a<11?ti(t,(function(e){if(!gt(t,e)){var n=ur(t,e);if(n&&!xs(t,e)&&!Tn(t.display,e)){xt(e);var r=t.findWordAt(n);Yi(t.doc,r.anchor,r.head)}}})):function(e){return gt(t,e)||xt(e)}),ht(e.scroller,"contextmenu",(function(e){return Ss(t,e)})),ht(e.input.getField(),"contextmenu",(function(n){e.scroller.contains(n.target)||Ss(t,n)}));var n,r={end:0};function i(){e.activeTouch&&(n=setTimeout((function(){return e.activeTouch=null}),1e3),(r=e.activeTouch).end=+new Date)}function o(t,e){if(null==e.left)return!0;var n=e.left-t.left,r=e.top-t.top;return n*n+r*r>400}ht(e.scroller,"touchstart",(function(i){if(!gt(t,i)&&!function(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}(i)&&!xs(t,i)){e.input.ensurePolled(),clearTimeout(n);var o=+new Date;e.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(e.activeTouch.left=i.touches[0].pageX,e.activeTouch.top=i.touches[0].pageY)}})),ht(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),ht(e.scroller,"touchend",(function(n){var r=e.activeTouch;if(r&&!Tn(e,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var s,a=t.coordsChar(e.activeTouch,"page");s=!r.prev||o(r,r.prev)?new Ci(a,a):!r.prev.prev||o(r,r.prev.prev)?t.findWordAt(a):new Ci(te(a.line,0),ae(t.doc,te(a.line+1,0))),t.setSelection(s.anchor,s.head),t.focus(),xt(n)}i()})),ht(e.scroller,"touchcancel",i),ht(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(Dr(t,e.scroller.scrollTop),Fr(t,e.scroller.scrollLeft,!0),dt(t,"scroll",t))})),ht(e.scroller,"mousewheel",(function(e){return bi(t,e)})),ht(e.scroller,"DOMMouseScroll",(function(e){return bi(t,e)})),ht(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){gt(t,e)||Tt(e)},over:function(e){gt(t,e)||(function(t,e){var n=ur(t,e);if(n){var r=document.createDocumentFragment();yr(t,n,r),t.display.dragCursor||(t.display.dragCursor=k("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),N(t.display.dragCursor,r)}}(t,e),Tt(e))},start:function(e){return function(t,e){if(s&&(!t.state.draggingText||+new Date-Io<100))Tt(e);else if(!gt(t,e)&&!Tn(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!p)){var n=k("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}(t,e)},drop:ti(t,Mo),leave:function(e){gt(t,e)||Po(t)}};var l=e.input.getField();ht(l,"keyup",(function(e){return hs.call(t,e)})),ht(l,"keydown",ti(t,cs)),ht(l,"keypress",ti(t,ps)),ht(l,"focus",(function(e){return wr(t,e)})),ht(l,"blur",(function(e){return Er(t,e)}))}(this),Fo(),Gr(this),this.curOp.forceUpdate=!0,Di(this,r),e.autofocus&&!m||this.hasFocus()?setTimeout(R(wr,this),20):Er(this),ws)ws.hasOwnProperty(u)&&ws[u](this,e[u],Ts);pi(this),e.finishInit&&e.finishInit(this);for(var c=0;c<Ns.length;++c)Ns[c](this);Kr(this),l&&e.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Ls.defaults=Cs,Ls.optionHandlers=ws;var Ns=[];function ks(t,e,n,r){var i,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=fe(t,e).state:n="prev");var s=t.options.tabSize,a=Gt(o,e),l=H(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var u,c=a.text.match(/^\s*/)[0];if(r||/\S/.test(a.text)){if("smart"==n&&((u=o.mode.indent(i,a.text.slice(c.length),a.text))==j||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=e>o.first?H(Gt(o,e-1).text,null,s):0:"add"==n?u=l+t.options.indentUnit:"subtract"==n?u=l-t.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var h="",p=0;if(t.options.indentWithTabs)for(var f=Math.floor(u/s);f;--f)p+=s,h+="\t";if(p<u&&(h+=K(u-p)),h!=c)return go(o,h,te(e,0),te(e,c.length),"+input"),a.stateAfter=null,!0;for(var d=0;d<o.sel.ranges.length;d++){var g=o.sel.ranges[d];if(g.head.line==e&&g.head.ch<c.length){var v=te(e,c.length);$i(o,d,new Ci(v,v));break}}}Ls.defineInitHook=function(t){return Ns.push(t)};var Os=null;function _s(t){Os=t}function Is(t,e,n,r,i){var o=t.doc;t.display.shift=!1,r||(r=o.sel);var s=+new Date-200,a="paste"==i||t.state.pasteIncoming>s,l=_t(e),u=null;if(a&&r.ranges.length>1)if(Os&&Os.text.join("\n")==e){if(r.ranges.length%Os.text.length==0){u=[];for(var c=0;c<Os.text.length;c++)u.push(o.splitLines(Os.text[c]))}}else l.length==r.ranges.length&&t.options.pasteLinesPerSelection&&(u=X(l,(function(t){return[t]})));for(var h=t.curOp.updateInput,p=r.ranges.length-1;p>=0;p--){var f=r.ranges[p],d=f.from(),g=f.to();f.empty()&&(n&&n>0?d=te(d.line,d.ch-n):t.state.overwrite&&!a?g=te(g.line,Math.min(Gt(o,g.line).text.length,g.ch+Y(l).length)):a&&Os&&Os.lineWise&&Os.text.join("\n")==e&&(d=g=te(d.line,0)));var v={from:d,to:g,text:u?u[p%u.length]:l,origin:i||(a?"paste":t.state.cutIncoming>s?"cut":"+input")};uo(t.doc,v),ln(t,"inputRead",t,v)}e&&!a&&Ps(t,e),_r(t),t.curOp.updateInput<2&&(t.curOp.updateInput=h),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Ms(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||Qr(e,(function(){return Is(e,n,0,null,"paste")})),!0}function Ps(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.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=t.getModeAt(i.head),s=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(e.indexOf(o.electricChars.charAt(a))>-1){s=ks(t,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Gt(t.doc,i.head.line).text.slice(0,i.head.ch))&&(s=ks(t,i.head.line,"smart"));s&&ln(t,"electricInput",t,i.head.line)}}}function Ds(t){for(var e=[],n=[],r=0;r<t.doc.sel.ranges.length;r++){var i=t.doc.sel.ranges[r].head.line,o={anchor:te(i,0),head:te(i+1,0)};n.push(o),e.push(t.getRange(o.anchor,o.head))}return{text:e,ranges:n}}function Rs(t,e,n,r){t.setAttribute("autocorrect",n?"":"off"),t.setAttribute("autocapitalize",r?"":"off"),t.setAttribute("spellcheck",!!e)}function Fs(){var t=k("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),e=k("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?t.style.width="1000px":t.setAttribute("wrap","off"),g&&(t.style.border="1px solid black"),Rs(t),e}function Hs(t,e,n,r,i){var o=e,s=n,a=Gt(t,e.line),l=i&&"rtl"==t.direction?-n:n;function u(r){var o,s;if(null==(o=i?function(t,e,n,r){var i=ut(e,t.doc.direction);if(!i)return Qo(e,n,r);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=at(i,n.ch,n.sticky),s=i[o];if("ltr"==t.doc.direction&&s.level%2==0&&(r>0?s.to>n.ch:s.from<n.ch))return Qo(e,n,r);var a,l=function(t,n){return Jo(e,t instanceof te?t.ch:t,n)},u=function(n){return t.options.lineWrapping?(a=a||In(t,e),Jn(t,e,a,n)):{begin:0,end:e.text.length}},c=u("before"==n.sticky?l(n,-1):n.ch);if("rtl"==t.doc.direction||1==s.level){var h=1==s.level==r<0,p=l(n,h?1:-1);if(null!=p&&(h?p<=s.to&&p<=c.end:p>=s.from&&p>=c.begin)){var f=h?"before":"after";return new te(n.line,p,f)}}var d=function(t,e,r){for(var o=function(t,e){return e?new te(n.line,l(t,1),"before"):new te(n.line,t,"after")};t>=0&&t<i.length;t+=e){var s=i[t],a=e>0==(1!=s.level),u=a?r.begin:l(r.end,-1);if(s.from<=u&&u<s.to)return o(u,a);if(u=a?s.from:l(s.to,-1),r.begin<=u&&u<r.end)return o(u,a)}},g=d(o+r,r,c);if(g)return g;var v=r>0?c.end:l(c.begin,-1);return null==v||r>0&&v==e.text.length||!(g=d(r>0?0:i.length-1,r,u(v)))?null:g}(t.cm,a,e,n):Qo(a,e,n))){if(r||(s=e.line+l)<t.first||s>=t.first+t.size||(e=new te(s,e.ch,e.sticky),!(a=Gt(t,s))))return!1;e=ts(i,t.cm,a,e.line,l)}else e=o;return!0}if("char"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var c=null,h="group"==r,p=t.cm&&t.cm.getHelper(e,"wordChars"),f=!0;!(n<0)||u(!f);f=!1){var d=a.text.charAt(e.ch)||"\n",g=tt(d,p)?"w":h&&"\n"==d?"n":!h||/\s/.test(d)?null:"p";if(!h||f||g||(g="s"),c&&c!=g){n<0&&(n=1,u(),e.sticky="after");break}if(g&&(c=g),n>0&&!u(!f))break}var v=oo(t,e,o,s,!0);return ne(o,v)&&(v.hitSide=!0),v}function Bs(t,e,n,r){var i,o,s=t.doc,a=e.left;if("page"==r){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*rr(t.display),3);i=(n>0?e.bottom:e.top)+n*u}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(;(o=$n(t,a,i)).outside;){if(n<0?i<=0:i>=s.height){o.hitSide=!0;break}i+=5*n}return o}var Ws=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new B,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function js(t,e){var n=_n(t,e.line);if(!n||n.hidden)return null;var r=Gt(t.doc,e.line),i=kn(n,r,e.line),o=ut(r,t.doc.direction),s="left";o&&(s=at(o,e.ch)%2?"right":"left");var a=Rn(i.map,e.ch,s);return a.offset="right"==a.collapse?a.end:a.start,a}function zs(t,e){return e&&(t.bad=!0),t}function Us(t,e,n){var r;if(e==t.display.lineDiv){if(!(r=t.display.lineDiv.childNodes[n]))return zs(t.clipPos(te(t.display.viewTo-1)),!0);e=null,n=0}else for(r=e;;r=r.parentNode){if(!r||r==t.display.lineDiv)return null;if(r.parentNode&&r.parentNode==t.display.lineDiv)break}for(var i=0;i<t.display.view.length;i++){var o=t.display.view[i];if(o.node==r)return Vs(o,e,n)}}function Vs(t,e,n){var r=t.text.firstChild,i=!1;if(!e||!_(r,e))return zs(te($t(t.line),0),!0);if(e==r&&(i=!0,e=r.childNodes[n],n=0,!e)){var o=t.rest?Y(t.rest):t.line;return zs(te($t(o),o.text.length),i)}var s=3==e.nodeType?e:null,a=e;for(s||1!=e.childNodes.length||3!=e.firstChild.nodeType||(s=e.firstChild,n&&(n=s.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var l=t.measure,u=l.maps;function c(e,n,r){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?l.map:u[i],s=0;s<o.length;s+=3){var a=o[s+2];if(a==e||a==n){var c=$t(i<0?t.line:t.rest[i]),h=o[s]+r;return(r<0||a!=e)&&(h=o[s+(r?1:0)]),te(c,h)}}}var h=c(s,a,n);if(h)return zs(h,i);for(var p=a.nextSibling,f=s?s.nodeValue.length-n:0;p;p=p.nextSibling){if(h=c(p,p.firstChild,0))return zs(te(h.line,h.ch-f),i);f+=p.textContent.length}for(var d=a.previousSibling,g=n;d;d=d.previousSibling){if(h=c(d,d.firstChild,-1))return zs(te(h.line,h.ch+g),i);g+=d.textContent.length}}Ws.prototype.init=function(t){var e=this,n=this,r=n.cm,i=n.div=t.lineDiv;function o(t){for(var e=t.target;e;e=e.parentNode){if(e==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(e.className))break}return!1}function s(t){if(o(t)&&!gt(r,t)){if(r.somethingSelected())_s({lineWise:!1,text:r.getSelections()}),"cut"==t.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var e=Ds(r);_s({lineWise:!0,text:e.text}),"cut"==t.type&&r.operation((function(){r.setSelections(e.ranges,0,z),r.replaceSelection("",null,"cut")}))}if(t.clipboardData){t.clipboardData.clearData();var s=Os.text.join("\n");if(t.clipboardData.setData("Text",s),t.clipboardData.getData("Text")==s)return void t.preventDefault()}var a=Fs(),l=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),l.value=Os.text.join("\n");var u=document.activeElement;D(l),setTimeout((function(){r.display.lineSpace.removeChild(a),u.focus(),u==i&&n.showPrimarySelection()}),50)}}Rs(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),ht(i,"paste",(function(t){!o(t)||gt(r,t)||Ms(t,r)||a<=11&&setTimeout(ti(r,(function(){return e.updateFromDOM()})),20)})),ht(i,"compositionstart",(function(t){e.composing={data:t.data,done:!1}})),ht(i,"compositionupdate",(function(t){e.composing||(e.composing={data:t.data,done:!1})})),ht(i,"compositionend",(function(t){e.composing&&(t.data!=e.composing.data&&e.readFromDOMSoon(),e.composing.done=!0)})),ht(i,"touchstart",(function(){return n.forceCompositionEnd()})),ht(i,"input",(function(){e.composing||e.readFromDOMSoon()})),ht(i,"copy",s),ht(i,"cut",s)},Ws.prototype.screenReaderLabelChanged=function(t){t?this.div.setAttribute("aria-label",t):this.div.removeAttribute("aria-label")},Ws.prototype.prepareSelection=function(){var t=mr(this.cm,!1);return t.focus=document.activeElement==this.div,t},Ws.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},Ws.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ws.prototype.showPrimarySelection=function(){var t=this.getSelection(),e=this.cm,r=e.doc.sel.primary(),i=r.from(),o=r.to();if(e.display.viewTo==e.display.viewFrom||i.line>=e.display.viewTo||o.line<e.display.viewFrom)t.removeAllRanges();else{var s=Us(e,t.anchorNode,t.anchorOffset),a=Us(e,t.focusNode,t.focusOffset);if(!s||s.bad||!a||a.bad||0!=ee(oe(s,a),i)||0!=ee(ie(s,a),o)){var l=e.display.view,u=i.line>=e.display.viewFrom&&js(e,i)||{node:l[0].measure.map[2],offset:0},c=o.line<e.display.viewTo&&js(e,o);if(!c){var h=l[l.length-1].measure,p=h.maps?h.maps[h.maps.length-1]:h.map;c={node:p[p.length-1],offset:p[p.length-2]-p[p.length-3]}}if(u&&c){var f,d=t.rangeCount&&t.getRangeAt(0);try{f=E(u.node,u.offset,c.offset,c.node)}catch(t){}f&&(!n&&e.state.focused?(t.collapse(u.node,u.offset),f.collapsed||(t.removeAllRanges(),t.addRange(f))):(t.removeAllRanges(),t.addRange(f)),d&&null==t.anchorNode?t.addRange(d):n&&this.startGracePeriod()),this.rememberSelection()}else t.removeAllRanges()}}},Ws.prototype.startGracePeriod=function(){var t=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){t.gracePeriod=!1,t.selectionChanged()&&t.cm.operation((function(){return t.cm.curOp.selectionChanged=!0}))}),20)},Ws.prototype.showMultipleSelections=function(t){N(this.cm.display.cursorDiv,t.cursors),N(this.cm.display.selectionDiv,t.selection)},Ws.prototype.rememberSelection=function(){var t=this.getSelection();this.lastAnchorNode=t.anchorNode,this.lastAnchorOffset=t.anchorOffset,this.lastFocusNode=t.focusNode,this.lastFocusOffset=t.focusOffset},Ws.prototype.selectionInEditor=function(){var t=this.getSelection();if(!t.rangeCount)return!1;var e=t.getRangeAt(0).commonAncestorContainer;return _(this.div,e)},Ws.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ws.prototype.blur=function(){this.div.blur()},Ws.prototype.getField=function(){return this.div},Ws.prototype.supportsTouch=function(){return!0},Ws.prototype.receivedFocus=function(){var t=this;this.selectionInEditor()?this.pollSelection():Qr(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}))},Ws.prototype.selectionChanged=function(){var t=this.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset},Ws.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var t=this.getSelection(),e=this.cm;if(v&&c&&this.cm.display.gutterSpecs.length&&function(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}(t.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Us(e,t.anchorNode,t.anchorOffset),r=Us(e,t.focusNode,t.focusOffset);n&&r&&Qr(e,(function(){Qi(e.doc,Ei(n,r),z),(n.bad||r.bad)&&(e.curOp.selectionChanged=!0)}))}}},Ws.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var t,e,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),s=o.from(),a=o.to();if(0==s.ch&&s.line>r.firstLine()&&(s=te(s.line-1,Gt(r.doc,s.line-1).length)),a.ch==Gt(r.doc,a.line).text.length&&a.line<r.lastLine()&&(a=te(a.line+1,0)),s.line<i.viewFrom||a.line>i.viewTo-1)return!1;s.line==i.viewFrom||0==(t=cr(r,s.line))?(e=$t(i.view[0].line),n=i.view[0].node):(e=$t(i.view[t].line),n=i.view[t-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=$t(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var h=r.doc.splitLines(function(t,e,n,r,i){var o="",s=!1,a=t.doc.lineSeparator(),l=!1;function u(){s&&(o+=a,l&&(o+=a),s=l=!1)}function c(t){t&&(u(),o+=t)}function h(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void c(n);var o,p=e.getAttribute("cm-marker");if(p){var f=t.findMarks(te(r,0),te(i+1,0),(v=+p,function(t){return t.id==v}));return void(f.length&&(o=f[0].find(0))&&c(Kt(t.doc,o.from,o.to).join(a)))}if("false"==e.getAttribute("contenteditable"))return;var d=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;d&&u();for(var g=0;g<e.childNodes.length;g++)h(e.childNodes[g]);/^(pre|p)$/i.test(e.nodeName)&&(l=!0),d&&(s=!0)}else 3==e.nodeType&&c(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var v}for(;h(e),e!=n;)e=e.nextSibling,l=!1;return o}(r,n,u,e,l)),p=Kt(r.doc,te(e,0),te(l,Gt(r.doc,l).text.length));h.length>1&&p.length>1;)if(Y(h)==Y(p))h.pop(),p.pop(),l--;else{if(h[0]!=p[0])break;h.shift(),p.shift(),e++}for(var f=0,d=0,g=h[0],v=p[0],m=Math.min(g.length,v.length);f<m&&g.charCodeAt(f)==v.charCodeAt(f);)++f;for(var y=Y(h),x=Y(p),S=Math.min(y.length-(1==h.length?f:0),x.length-(1==p.length?f:0));d<S&&y.charCodeAt(y.length-d-1)==x.charCodeAt(x.length-d-1);)++d;if(1==h.length&&1==p.length&&e==s.line)for(;f&&f>s.ch&&y.charCodeAt(y.length-d-1)==x.charCodeAt(x.length-d-1);)f--,d++;h[h.length-1]=y.slice(0,y.length-d).replace(/^\u200b+/,""),h[0]=h[0].slice(f).replace(/\u200b+$/,"");var b=te(e,f),T=te(l,p.length?Y(p).length-d:0);return h.length>1||h[0]||ee(b,T)?(go(r.doc,h,b,T,"+input"),!0):void 0},Ws.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ws.prototype.reset=function(){this.forceCompositionEnd()},Ws.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ws.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()}),80))},Ws.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Qr(this.cm,(function(){return hr(t.cm)}))},Ws.prototype.setUneditable=function(t){t.contentEditable="false"},Ws.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||ti(this.cm,Is)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Ws.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Ws.prototype.onContextMenu=function(){},Ws.prototype.resetPosition=function(){},Ws.prototype.needsContentAttribute=!0;var qs=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new B,this.hasSelection=!1,this.composing=null};qs.prototype.init=function(t){var e=this,n=this,r=this.cm;this.createField(t);var i=this.textarea;function o(t){if(!gt(r,t)){if(r.somethingSelected())_s({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=Ds(r);_s({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,z):(n.prevInput="",i.value=e.text.join("\n"),D(i))}"cut"==t.type&&(r.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),g&&(i.style.width="0px"),ht(i,"input",(function(){s&&a>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),ht(i,"paste",(function(t){gt(r,t)||Ms(t,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),ht(i,"cut",o),ht(i,"copy",o),ht(t.scroller,"paste",(function(e){if(!Tn(t,e)&&!gt(r,e)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=e.clipboardData,i.dispatchEvent(o)}})),ht(t.lineSpace,"selectstart",(function(e){Tn(t,e)||xt(e)})),ht(i,"compositionstart",(function(){var t=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}})),ht(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},qs.prototype.createField=function(t){this.wrapper=Fs(),this.textarea=this.wrapper.firstChild},qs.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},qs.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=mr(t);if(t.options.moveInputWithCursor){var i=Kn(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),s=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,i.top+s.top-o.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,i.left+s.left-o.left))}return r},qs.prototype.showSelection=function(t){var e=this.cm.display;N(e.cursorDiv,t.cursors),N(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},qs.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&D(this.textarea),s&&a>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",s&&a>=9&&(this.hasSelection=null))}},qs.prototype.getField=function(){return this.textarea},qs.prototype.supportsTouch=function(){return!1},qs.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||I()!=this.textarea))try{this.textarea.focus()}catch(t){}},qs.prototype.blur=function(){this.textarea.blur()},qs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qs.prototype.receivedFocus=function(){this.slowPoll()},qs.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},qs.prototype.fastPoll=function(){var t=!1,e=this;e.pollingFast=!0,e.polling.set(20,(function n(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}))},qs.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||It(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var i=n.value;if(i==r&&!e.somethingSelected())return!1;if(s&&a>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return e.display.input.reset(),!1;if(e.doc.sel==e.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);l<u&&r.charCodeAt(l)==i.charCodeAt(l);)++l;return Qr(e,(function(){Is(e,i.slice(l),r.length-l,null,t.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=i,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},qs.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qs.prototype.onKeyPress=function(){s&&a>=9&&(this.hasSelection=null),this.fastPoll()},qs.prototype.onContextMenu=function(t){var e=this,n=e.cm,r=n.display,i=e.textarea;e.contextMenuPending&&e.contextMenuPending();var o=ur(n,t),u=r.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ti(n,Qi)(n.doc,Ei(o),z);var c,p=i.style.cssText,f=e.wrapper.style.cssText,d=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-d.top-5)+"px; left: "+(t.clientX-d.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=e.prevInput=" "),e.contextMenuPending=m,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),s&&a>=9&&v(),C){Tt(t);var g=function(){ft(window,"mouseup",g),setTimeout(m,20)};ht(window,"mouseup",g)}else setTimeout(m,50)}function v(){if(null!=i.selectionStart){var t=n.somethingSelected(),o="​"+(t?i.value:"");i.value="⇚",i.value=o,e.prevInput=t?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function m(){if(e.contextMenuPending==m&&(e.contextMenuPending=!1,e.wrapper.style.cssText=f,i.style.cssText=p,s&&a<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart)){(!s||s&&a<9)&&v();var t=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==e.prevInput?ti(n,ao)(n):t++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},qs.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t},qs.prototype.setUneditable=function(){},qs.prototype.needsContentAttribute=!1,function(t){var e=t.optionHandlers;function n(n,r,i,o){t.defaults[n]=r,i&&(e[n]=o?function(t,e,n){n!=Ts&&i(t,e,n)}:i)}t.defineOption=n,t.Init=Ts,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,Oi(t)}),!0),n("indentUnit",2,Oi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){_i(t),Wn(t),hr(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],r=t.doc.first;t.doc.iter((function(t){for(var i=0;;){var o=t.text.indexOf(e,i);if(-1==o)break;i=o+e.length,n.push(te(r,o))}r++}));for(var i=n.length-1;i>=0;i--)go(t.doc,e,n[i],te(n[i].line,n[i].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Ts&&t.refresh()})),n("specialCharPlaceholder",Je,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",m?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!S),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){bs(t),gi(t)}),!0),n("keyMap","default",(function(t,e,n){var r=$o(e),i=n!=Ts&&$o(n);i&&i.detach&&i.detach(t,r),r.attach&&r.attach(t,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,As,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=fi(e,t.options.lineNumbers),gi(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?sr(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return jr(t)}),!0),n("scrollbarStyle","native",(function(t){Vr(t),jr(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=fi(t.options.gutters,e),gi(t)}),!0),n("firstLineNumber",1,gi,!0),n("lineNumberFormatter",(function(t){return t}),gi,!0),n("showCursorWhenSelecting",!1,vr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(Er(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,Es),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vr,!0),n("singleCursorHeightPerLine",!0,vr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,_i,!0),n("addModeClass",!1,_i,!0),n("pollInterval",100),n("undoDepth",200,(function(t,e){return t.doc.history.undoDepth=e})),n("historyEventDelay",1250),n("viewportMargin",10,(function(t){return t.refresh()}),!0),n("maxHighlightLength",1e4,_i,!0),n("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),n("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),n("autofocus",null),n("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),n("phrases",null)}(Ls),function(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,n){var r=this.options,i=r[t];r[t]==n&&"mode"!=t||(r[t]=n,e.hasOwnProperty(t)&&ti(this,e[t])(this,n,i),dt(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"]($o(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;n<e.length;++n)if(e[n]==t||e[n].name==t)return e.splice(n,1),!0},addOverlay:ei((function(e,n){var r=e.token?e:t.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");!function(t,e,n){for(var r=0,i=n(e);r<t.length&&n(t[r])<=i;)r++;t.splice(r,0,e)}(this.state.overlays,{mode:r,modeSpec:e,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(t){return t.priority})),this.state.modeGen++,hr(this)})),removeOverlay:ei((function(t){for(var e=this.state.overlays,n=0;n<e.length;++n){var r=e[n].modeSpec;if(r==t||"string"==typeof t&&r.name==t)return e.splice(n,1),this.state.modeGen++,void hr(this)}})),indentLine:ei((function(t,e,n){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract"),Jt(this.doc,t)&&ks(this,t,e,n)})),indentSelection:ei((function(t){for(var e=this.doc.sel.ranges,n=-1,r=0;r<e.length;r++){var i=e[r];if(i.empty())i.head.line>n&&(ks(this,i.head.line,t,!0),n=i.head.line,r==this.doc.sel.primIndex&&_r(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;l<n;++l)ks(this,l,t);var u=this.doc.sel.ranges;0==o.ch&&e.length==u.length&&u[r].from().ch>0&&$i(this.doc,r,new Ci(o,u[r].to()),z)}}})),getTokenAt:function(t,e){return ye(this,t,e)},getLineTokens:function(t,e){return ye(this,te(t),e,!0)},getTokenTypeAt:function(t){t=ae(this.doc,t);var e,n=pe(this,Gt(this.doc,t.line)),r=0,i=(n.length-1)/2,o=t.ch;if(0==o)e=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=n[2*s+2];break}r=s+1}}var a=e?e.indexOf("overlay "):-1;return a<0?e:0==a?null:e.slice(0,a-1)},getModeAt:function(e){var n=this.doc.mode;return n.innerMode?t.innerMode(n,this.getTokenAt(e).state).mode:n},getHelper:function(t,e){return this.getHelpers(t,e)[0]},getHelpers:function(t,e){var r=[];if(!n.hasOwnProperty(e))return r;var i=n[e],o=this.getModeAt(t);if("string"==typeof o[e])i[o[e]]&&r.push(i[o[e]]);else if(o[e])for(var s=0;s<o[e].length;s++){var a=i[o[e][s]];a&&r.push(a)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var l=0;l<i._global.length;l++){var u=i._global[l];u.pred(o,this)&&-1==W(r,u.val)&&r.push(u.val)}return r},getStateAfter:function(t,e){var n=this.doc;return fe(this,(t=se(n,null==t?n.first+n.size-1:t))+1,e).state},cursorCoords:function(t,e){var n=this.doc.sel.primary();return Kn(this,null==t?n.head:"object"==typeof t?ae(this.doc,t):t?n.from():n.to(),e||"page")},charCoords:function(t,e){return Gn(this,ae(this.doc,t),e||"page")},coordsChar:function(t,e){return $n(this,(t=qn(this,t,e||"page")).left,t.top)},lineAtHeight:function(t,e){return t=qn(this,{top:t,left:0},e||"page").top,Zt(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e,n){var r,i=!1;if("number"==typeof t){var o=this.doc.first+this.doc.size-1;t<this.doc.first?t=this.doc.first:t>o&&(t=o,i=!0),r=Gt(this.doc,t)}else r=t;return Vn(this,r,{top:0,left:0},e||"page",n||i).top+(i?this.doc.height-Ue(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(t,e,n,r,i){var o,s,a,l=this.display,u=(t=Kn(this,ae(this.doc,t))).bottom,c=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),l.sizer.appendChild(e),"over"==r)u=t.top;else if("above"==r||"near"==r){var h=Math.max(l.wrapper.clientHeight,this.doc.height),p=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>h)&&t.top>e.offsetHeight?u=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=h&&(u=t.bottom),c+e.offsetWidth>p&&(c=p-e.offsetWidth)}e.style.top=u+"px",e.style.left=e.style.right="","right"==i?(c=l.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(l.sizer.clientWidth-e.offsetWidth)/2),e.style.left=c+"px"),n&&(o=this,s={left:c,top:u,right:c+e.offsetWidth,bottom:u+e.offsetHeight},null!=(a=kr(o,s)).scrollTop&&Dr(o,a.scrollTop),null!=a.scrollLeft&&Fr(o,a.scrollLeft))},triggerOnKeyDown:ei(cs),triggerOnKeyPress:ei(ps),triggerOnKeyUp:hs,triggerOnMouseDown:ei(vs),execCommand:function(t){if(es.hasOwnProperty(t))return es[t].call(null,this)},triggerElectric:ei((function(t){Ps(this,t)})),findPosH:function(t,e,n,r){var i=1;e<0&&(i=-1,e=-e);for(var o=ae(this.doc,t),s=0;s<e&&!(o=Hs(this.doc,o,i,n,r)).hitSide;++s);return o},moveH:ei((function(t,e){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Hs(n.doc,r.head,t,e,n.options.rtlMoveVisually):t<0?r.from():r.to()}),V)})),deleteH:ei((function(t,e){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Zo(this,(function(n){var i=Hs(r,n.head,t,e,!1);return t<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(t,e,n,r){var i=1,o=r;e<0&&(i=-1,e=-e);for(var s=ae(this.doc,t),a=0;a<e;++a){var l=Kn(this,s,"div");if(null==o?o=l.left:l.left=o,(s=Bs(this,l,i,n)).hitSide)break}return s},moveV:ei((function(t,e){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(s){if(o)return t<0?s.from():s.to();var a=Kn(n,s.head,"div");null!=s.goalColumn&&(a.left=s.goalColumn),i.push(a.left);var l=Bs(n,a,t,e);return"page"==e&&s==r.sel.primary()&&Or(n,Gn(n,l,"div").top-a.top),l}),V),i.length)for(var s=0;s<r.sel.ranges.length;s++)r.sel.ranges[s].goalColumn=i[s]})),findWordAt:function(t){var e=Gt(this.doc,t.line).text,n=t.ch,r=t.ch;if(e){var i=this.getHelper(t,"wordChars");"before"!=t.sticky&&r!=e.length||!n?++r:--n;for(var o=e.charAt(n),s=tt(o,i)?function(t){return tt(t,i)}:/\s/.test(o)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!tt(t)};n>0&&s(e.charAt(n-1));)--n;for(;r<e.length&&s(e.charAt(r));)++r}return new Ci(te(t.line,n),te(t.line,r))},toggleOverwrite:function(t){null!=t&&t==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?M(this.display.cursorDiv,"CodeMirror-overwrite"):A(this.display.cursorDiv,"CodeMirror-overwrite"),dt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==I()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ei((function(t,e){Ir(this,t,e)})),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-An(this)-this.display.barHeight,width:t.scrollWidth-An(this)-this.display.barWidth,clientHeight:Nn(this),clientWidth:Ln(this)}},scrollIntoView:ei((function(t,e){null==t?(t={from:this.doc.sel.primary().head,to:null},null==e&&(e=this.options.cursorScrollMargin)):"number"==typeof t?t={from:te(t,0),to:null}:null==t.from&&(t={from:t,to:null}),t.to||(t.to=t.from),t.margin=e||0,null!=t.from.line?function(t,e){Mr(t),t.curOp.scrollToPos=e}(this,t):Pr(this,t.from,t.to,t.margin)})),setSize:ei((function(t,e){var n=this,r=function(t){return"number"==typeof t||/^\d+$/.test(String(t))?t+"px":t};null!=t&&(this.display.wrapper.style.width=r(t)),null!=e&&(this.display.wrapper.style.height=r(e)),this.options.lineWrapping&&Bn(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(t){if(t.widgets)for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){pr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,dt(this,"refresh",this)})),operation:function(t){return Qr(this,t)},startOperation:function(){return Gr(this)},endOperation:function(){return Kr(this)},refresh:ei((function(){var t=this.display.cachedTextHeight;hr(this),this.curOp.forceUpdate=!0,Wn(this),Ir(this,this.doc.scrollLeft,this.doc.scrollTop),ui(this.display),(null==t||Math.abs(t-rr(this.display))>.5||this.options.lineWrapping)&&lr(this),dt(this,"refresh",this)})),swapDoc:ei((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),Di(this,t),Wn(this),this.display.input.reset(),Ir(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,e),e})),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},yt(t),t.registerHelper=function(e,r,i){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][r]=i},t.registerGlobalHelper=function(e,r,i,o){t.registerHelper(e,r,o),n[e]._global.push({pred:i,val:o})}}(Ls);var Gs="iter insert remove copy getEditor constructor".split(" ");for(var Ks in _o.prototype)_o.prototype.hasOwnProperty(Ks)&&W(Gs,Ks)<0&&(Ls.prototype[Ks]=function(t){return function(){return t.apply(this.doc,arguments)}}(_o.prototype[Ks]));return yt(_o),Ls.inputStyles={textarea:qs,contenteditable:Ws},Ls.defineMode=function(t){Ls.defaults.mode||"null"==t||(Ls.defaults.mode=t),Ft.apply(this,arguments)},Ls.defineMIME=function(t,e){Rt[t]=e},Ls.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Ls.defineMIME("text/plain","null"),Ls.defineExtension=function(t,e){Ls.prototype[t]=e},Ls.defineDocExtension=function(t,e){_o.prototype[t]=e},Ls.fromTextArea=function(t,e){if((e=e?F(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=I();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function r(){t.value=a.getValue()}var i;if(t.form&&(ht(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var s=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=s}}catch(t){}}e.finishInit=function(n){n.save=r,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,r(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(ft(t.form,"submit",r),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=i))}},t.style.display="none";var a=Ls((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return a},function(t){t.off=ft,t.on=ht,t.wheelEventPixels=Si,t.Doc=_o,t.splitLines=_t,t.countColumn=H,t.findColumn=q,t.isWordChar=Q,t.Pass=j,t.signal=dt,t.Line=Ge,t.changeEnd=Ai,t.scrollbarModel=Ur,t.Pos=te,t.cmpPos=ee,t.modes=Dt,t.mimeModes=Rt,t.resolveMode=Ht,t.getMode=Bt,t.modeExtensions=Wt,t.extendMode=jt,t.copyState=zt,t.startState=Vt,t.innerMode=Ut,t.commands=es,t.keyMap=Uo,t.keyName=Xo,t.isModifierKey=Ko,t.lookupKey=Go,t.normalizeKeyMap=qo,t.StringStream=qt,t.SharedTextMarker=Lo,t.TextMarker=Eo,t.LineWidget=To,t.e_preventDefault=xt,t.e_stopPropagation=St,t.e_stop=Tt,t.addClass=M,t.contains=_,t.rmClass=A,t.keyNames=Bo}(Ls),Ls.version="5.54.0",Ls}()},function(t,e,n){var r=n(3),i=n(49),o=n(91),s=n(92);function a(e){var n="function"==typeof Map?new Map:void 0;return t.exports=a=function(t){if(null===t||!o(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return s(t,arguments,r(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i(e,t)},a(e)}t.exports=a},,,function(t,e,n){e.atn=n(71),e.codepointat=n(60),e.dfa=n(78),e.fromcodepoint=n(61),e.tree=n(80),e.error=n(81),e.Token=n(17).Token,e.CharStreams=n(83).CharStreams,e.CommonToken=n(17).CommonToken,e.InputStream=n(48).InputStream,e.FileStream=n(84).FileStream,e.CommonTokenStream=n(85).CommonTokenStream,e.Lexer=n(42).Lexer,e.Parser=n(87).Parser;var r=n(24);e.PredictionContextCache=r.PredictionContextCache,e.ParserRuleContext=n(47).ParserRuleContext,e.Interval=n(18).Interval,e.Utils=n(16)},function(t,e,n){var r=n(97),i=n(98),o=n(65),s=n(99);t.exports=function(t){return r(t)||i(t)||o(t)||s()}},function(t,e,n){var r=n(20).DecisionState,i=n(32).SemanticContext,o=n(16).Hash;function s(t,e){if(null===t){var n={state:null,alt:null,context:null,semanticContext:null};return e&&(n.reachesIntoOuterContext=0),n}var r={};return r.state=t.state||null,r.alt=void 0===t.alt?null:t.alt,r.context=t.context||null,r.semanticContext=t.semanticContext||null,e&&(r.reachesIntoOuterContext=t.reachesIntoOuterContext||0,r.precedenceFilterSuppressed=t.precedenceFilterSuppressed||!1),r}function a(t,e){return this.checkContext(t,e),t=s(t),e=s(e,!0),this.state=null!==t.state?t.state:e.state,this.alt=null!==t.alt?t.alt:e.alt,this.context=null!==t.context?t.context:e.context,this.semanticContext=null!==t.semanticContext?t.semanticContext:null!==e.semanticContext?e.semanticContext:i.NONE,this.reachesIntoOuterContext=e.reachesIntoOuterContext,this.precedenceFilterSuppressed=e.precedenceFilterSuppressed,this}function l(t,e){a.call(this,t,e);var n=t.lexerActionExecutor||null;return this.lexerActionExecutor=n||(null!==e?e.lexerActionExecutor:null),this.passedThroughNonGreedyDecision=null!==e&&this.checkNonGreedyDecision(e,this.state),this}a.prototype.checkContext=function(t,e){null!==t.context&&void 0!==t.context||null!==e&&null!==e.context&&void 0!==e.context||(this.context=null)},a.prototype.hashCode=function(){var t=new o;return this.updateHashCode(t),t.finish()},a.prototype.updateHashCode=function(t){t.update(this.state.stateNumber,this.alt,this.context,this.semanticContext)},a.prototype.equals=function(t){return this===t||t instanceof a&&(this.state.stateNumber===t.state.stateNumber&&this.alt===t.alt&&(null===this.context?null===t.context:this.context.equals(t.context))&&this.semanticContext.equals(t.semanticContext)&&this.precedenceFilterSuppressed===t.precedenceFilterSuppressed)},a.prototype.hashCodeForConfigSet=function(){var t=new o;return t.update(this.state.stateNumber,this.alt,this.semanticContext),t.finish()},a.prototype.equalsForConfigSet=function(t){return this===t||t instanceof a&&(this.state.stateNumber===t.state.stateNumber&&this.alt===t.alt&&this.semanticContext.equals(t.semanticContext))},a.prototype.toString=function(){return"("+this.state+","+this.alt+(null!==this.context?",["+this.context.toString()+"]":"")+(this.semanticContext!==i.NONE?","+this.semanticContext.toString():"")+(this.reachesIntoOuterContext>0?",up="+this.reachesIntoOuterContext:"")+")"},l.prototype=Object.create(a.prototype),l.prototype.constructor=l,l.prototype.updateHashCode=function(t){t.update(this.state.stateNumber,this.alt,this.context,this.semanticContext,this.passedThroughNonGreedyDecision,this.lexerActionExecutor)},l.prototype.equals=function(t){return this===t||t instanceof l&&this.passedThroughNonGreedyDecision==t.passedThroughNonGreedyDecision&&(this.lexerActionExecutor?this.lexerActionExecutor.equals(t.lexerActionExecutor):!t.lexerActionExecutor)&&a.prototype.equals.call(this,t)},l.prototype.hashCodeForConfigSet=l.prototype.hashCode,l.prototype.equalsForConfigSet=l.prototype.equals,l.prototype.checkNonGreedyDecision=function(t,e){return t.passedThroughNonGreedyDecision||e instanceof r&&e.nonGreedy},e.ATNConfig=a,e.LexerATNConfig=l},function(t,e,n){var r=n(21).RuleNode,i=n(21).INVALID_INTERVAL,o=n(27).INVALID_ALT_NUMBER;function s(t,e){return r.call(this),this.parentCtx=t||null,this.invokingState=e||-1,this}s.prototype=Object.create(r.prototype),s.prototype.constructor=s,s.prototype.depth=function(){for(var t=0,e=this;null!==e;)e=e.parentCtx,t+=1;return t},s.prototype.isEmpty=function(){return-1===this.invokingState},s.prototype.getSourceInterval=function(){return i},s.prototype.getRuleContext=function(){return this},s.prototype.getPayload=function(){return this},s.prototype.getText=function(){return 0===this.getChildCount()?"":this.children.map((function(t){return t.getText()})).join("")},s.prototype.getAltNumber=function(){return o},s.prototype.setAltNumber=function(t){},s.prototype.getChild=function(t){return null},s.prototype.getChildCount=function(){return 0},s.prototype.accept=function(t){return t.visitChildren(this)},e.RuleContext=s;var a=n(53).Trees;s.prototype.toStringTree=function(t,e){return a.toStringTree(this,t,e)},s.prototype.toString=function(t,e){t=t||null,e=e||null;for(var n=this,r="[";null!==n&&n!==e;){if(null===t)n.isEmpty()||(r+=n.invokingState);else{var i=n.ruleIndex;r+=i>=0&&i<t.length?t[i]:""+i}null===n.parentCtx||null===t&&n.parentCtx.isEmpty()||(r+=" "),n=n.parentCtx}return r+="]"}},function(t,e,n){var r=n(17).Token,i=n(57).Recognizer,o=n(75).CommonTokenFactory,s=n(22).RecognitionException,a=n(22).LexerNoViableAltException;function l(t){return i.call(this),this._input=t,this._factory=o.DEFAULT,this._tokenFactorySourcePair=[this,t],this._interp=null,this._token=null,this._tokenStartCharIndex=-1,this._tokenStartLine=-1,this._tokenStartColumn=-1,this._hitEOF=!1,this._channel=r.DEFAULT_CHANNEL,this._type=r.INVALID_TYPE,this._modeStack=[],this._mode=l.DEFAULT_MODE,this._text=null,this}l.prototype=Object.create(i.prototype),l.prototype.constructor=l,l.DEFAULT_MODE=0,l.MORE=-2,l.SKIP=-3,l.DEFAULT_TOKEN_CHANNEL=r.DEFAULT_CHANNEL,l.HIDDEN=r.HIDDEN_CHANNEL,l.MIN_CHAR_VALUE=0,l.MAX_CHAR_VALUE=1114111,l.prototype.reset=function(){null!==this._input&&this._input.seek(0),this._token=null,this._type=r.INVALID_TYPE,this._channel=r.DEFAULT_CHANNEL,this._tokenStartCharIndex=-1,this._tokenStartColumn=-1,this._tokenStartLine=-1,this._text=null,this._hitEOF=!1,this._mode=l.DEFAULT_MODE,this._modeStack=[],this._interp.reset()},l.prototype.nextToken=function(){if(null===this._input)throw"nextToken requires a non-null input stream.";var t=this._input.mark();try{for(;;){if(this._hitEOF)return this.emitEOF(),this._token;this._token=null,this._channel=r.DEFAULT_CHANNEL,this._tokenStartCharIndex=this._input.index,this._tokenStartColumn=this._interp.column,this._tokenStartLine=this._interp.line,this._text=null;for(var e=!1;;){this._type=r.INVALID_TYPE;var n=l.SKIP;try{n=this._interp.match(this._input,this._mode)}catch(t){if(!(t instanceof s))throw console.log(t.stack),t;this.notifyListeners(t),this.recover(t)}if(this._input.LA(1)===r.EOF&&(this._hitEOF=!0),this._type===r.INVALID_TYPE&&(this._type=n),this._type===l.SKIP){e=!0;break}if(this._type!==l.MORE)break}if(!e)return null===this._token&&this.emit(),this._token}}finally{this._input.release(t)}},l.prototype.skip=function(){this._type=l.SKIP},l.prototype.more=function(){this._type=l.MORE},l.prototype.mode=function(t){this._mode=t},l.prototype.pushMode=function(t){this._interp.debug&&console.log("pushMode "+t),this._modeStack.push(this._mode),this.mode(t)},l.prototype.popMode=function(){if(0===this._modeStack.length)throw"Empty Stack";return this._interp.debug&&console.log("popMode back to "+this._modeStack.slice(0,-1)),this.mode(this._modeStack.pop()),this._mode},Object.defineProperty(l.prototype,"inputStream",{get:function(){return this._input},set:function(t){this._input=null,this._tokenFactorySourcePair=[this,this._input],this.reset(),this._input=t,this._tokenFactorySourcePair=[this,this._input]}}),Object.defineProperty(l.prototype,"sourceName",{get:function(){return this._input.sourceName}}),l.prototype.emitToken=function(t){this._token=t},l.prototype.emit=function(){var t=this._factory.create(this._tokenFactorySourcePair,this._type,this._text,this._channel,this._tokenStartCharIndex,this.getCharIndex()-1,this._tokenStartLine,this._tokenStartColumn);return this.emitToken(t),t},l.prototype.emitEOF=function(){var t=this.column,e=this.line,n=this._factory.create(this._tokenFactorySourcePair,r.EOF,null,r.DEFAULT_CHANNEL,this._input.index,this._input.index-1,e,t);return this.emitToken(n),n},Object.defineProperty(l.prototype,"type",{get:function(){return this.type},set:function(t){this._type=t}}),Object.defineProperty(l.prototype,"line",{get:function(){return this._interp.line},set:function(t){this._interp.line=t}}),Object.defineProperty(l.prototype,"column",{get:function(){return this._interp.column},set:function(t){this._interp.column=t}}),l.prototype.getCharIndex=function(){return this._input.index},Object.defineProperty(l.prototype,"text",{get:function(){return null!==this._text?this._text:this._interp.getText(this._input)},set:function(t){this._text=t}}),l.prototype.getAllTokens=function(){for(var t=[],e=this.nextToken();e.type!==r.EOF;)t.push(e),e=this.nextToken();return t},l.prototype.notifyListeners=function(t){var e=this._tokenStartCharIndex,n=this._input.index,r=this._input.getText(e,n),i="token recognition error at: '"+this.getErrorDisplay(r)+"'";this.getErrorListenerDispatch().syntaxError(this,null,this._tokenStartLine,this._tokenStartColumn,i,t)},l.prototype.getErrorDisplay=function(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e.join("")},l.prototype.getErrorDisplayForChar=function(t){return t.charCodeAt(0)===r.EOF?"<EOF>":"\n"===t?"\\n":"\t"===t?"\\t":"\r"===t?"\\r":t},l.prototype.getCharErrorDisplay=function(t){return"'"+this.getErrorDisplayForChar(t)+"'"},l.prototype.recover=function(t){this._input.LA(1)!==r.EOF&&(t instanceof a?this._interp.consume(this._input):this._input.consume())},e.Lexer=l},function(t,e){function n(){return this}function r(){return n.call(this),this}function i(t){if(n.call(this),null===t)throw"delegates";return this.delegates=t,this}n.prototype.syntaxError=function(t,e,n,r,i,o){},n.prototype.reportAmbiguity=function(t,e,n,r,i,o,s){},n.prototype.reportAttemptingFullContext=function(t,e,n,r,i,o){},n.prototype.reportContextSensitivity=function(t,e,n,r,i,o){},r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.INSTANCE=new r,r.prototype.syntaxError=function(t,e,n,r,i,o){console.error("line "+n+":"+r+" "+i)},i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.prototype.syntaxError=function(t,e,n,r,i,o){this.delegates.map((function(s){s.syntaxError(t,e,n,r,i,o)}))},i.prototype.reportAmbiguity=function(t,e,n,r,i,o,s){this.delegates.map((function(a){a.reportAmbiguity(t,e,n,r,i,o,s)}))},i.prototype.reportAttemptingFullContext=function(t,e,n,r,i,o){this.delegates.map((function(s){s.reportAttemptingFullContext(t,e,n,r,i,o)}))},i.prototype.reportContextSensitivity=function(t,e,n,r,i,o){this.delegates.map((function(s){s.reportContextSensitivity(t,e,n,r,i,o)}))},e.ErrorListener=n,e.ConsoleErrorListener=r,e.ProxyErrorListener=i},function(t,e){function n(t,e,n){return this.dfa=t,this.literalNames=e||[],this.symbolicNames=n||[],this}function r(t){return n.call(this,t,null),this}n.prototype.toString=function(){if(null===this.dfa.s0)return null;for(var t="",e=this.dfa.sortedStates(),n=0;n<e.length;n++){var r=e[n];if(null!==r.edges)for(var i=r.edges.length,o=0;o<i;o++){var s=r.edges[o]||null;null!==s&&2147483647!==s.stateNumber&&(t=(t=(t=(t=(t=(t=t.concat(this.getStateString(r))).concat("-")).concat(this.getEdgeLabel(o))).concat("->")).concat(this.getStateString(s))).concat("\n"))}}return 0===t.length?null:t},n.prototype.getEdgeLabel=function(t){return 0===t?"EOF":null!==this.literalNames||null!==this.symbolicNames?this.literalNames[t-1]||this.symbolicNames[t-1]:String.fromCharCode(t-1)},n.prototype.getStateString=function(t){var e=(t.isAcceptState?":":"")+"s"+t.stateNumber+(t.requiresFullContext?"^":"");return t.isAcceptState?null!==t.predicates?e+"=>"+t.predicates.toString():e+"=>"+t.prediction.toString():e},r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.prototype.getEdgeLabel=function(t){return"'"+String.fromCharCode(t)+"'"},e.DFASerializer=n,e.LexerDFASerializer=r},,,function(t,e,n){var r=n(41).RuleContext,i=n(21),o=i.INVALID_INTERVAL,s=i.TerminalNode,a=i.TerminalNodeImpl,l=i.ErrorNodeImpl,u=n(18).Interval;function c(t,e){t=t||null,e=e||null,r.call(this,t,e),this.ruleIndex=-1,this.children=null,this.start=null,this.stop=null,this.exception=null}function h(t,e,n){return c.call(t,e),this.ruleIndex=n,this}c.prototype=Object.create(r.prototype),c.prototype.constructor=c,c.prototype.copyFrom=function(t){this.parentCtx=t.parentCtx,this.invokingState=t.invokingState,this.children=null,this.start=t.start,this.stop=t.stop,t.children&&(this.children=[],t.children.map((function(t){t instanceof l&&(this.children.push(t),t.parentCtx=this)}),this))},c.prototype.enterRule=function(t){},c.prototype.exitRule=function(t){},c.prototype.addChild=function(t){return null===this.children&&(this.children=[]),this.children.push(t),t},c.prototype.removeLastChild=function(){null!==this.children&&this.children.pop()},c.prototype.addTokenNode=function(t){var e=new a(t);return this.addChild(e),e.parentCtx=this,e},c.prototype.addErrorNode=function(t){var e=new l(t);return this.addChild(e),e.parentCtx=this,e},c.prototype.getChild=function(t,e){if(e=e||null,null===this.children||t<0||t>=this.children.length)return null;if(null===e)return this.children[t];for(var n=0;n<this.children.length;n++){var r=this.children[n];if(r instanceof e){if(0===t)return r;t-=1}}return null},c.prototype.getToken=function(t,e){if(null===this.children||e<0||e>=this.children.length)return null;for(var n=0;n<this.children.length;n++){var r=this.children[n];if(r instanceof s&&r.symbol.type===t){if(0===e)return r;e-=1}}return null},c.prototype.getTokens=function(t){if(null===this.children)return[];for(var e=[],n=0;n<this.children.length;n++){var r=this.children[n];r instanceof s&&r.symbol.type===t&&e.push(r)}return e},c.prototype.getTypedRuleContext=function(t,e){return this.getChild(e,t)},c.prototype.getTypedRuleContexts=function(t){if(null===this.children)return[];for(var e=[],n=0;n<this.children.length;n++){var r=this.children[n];r instanceof t&&e.push(r)}return e},c.prototype.getChildCount=function(){return null===this.children?0:this.children.length},c.prototype.getSourceInterval=function(){return null===this.start||null===this.stop?o:new u(this.start.tokenIndex,this.stop.tokenIndex)},r.EMPTY=new c,h.prototype=Object.create(c.prototype),h.prototype.constructor=h,e.ParserRuleContext=c},function(t,e,n){var r=n(17).Token;function i(t,e){return this.name="<empty>",this.strdata=t,this.decodeToUnicodeCodePoints=e||!1,function(t){if(t._index=0,t.data=[],t.decodeToUnicodeCodePoints)for(var e=0;e<t.strdata.length;){var n=t.strdata.codePointAt(e);t.data.push(n),e+=n<=65535?1:2}else for(e=0;e<t.strdata.length;e++){var r=t.strdata.charCodeAt(e);t.data.push(r)}t._size=t.data.length}(this),this}n(60),n(61),Object.defineProperty(i.prototype,"index",{get:function(){return this._index}}),Object.defineProperty(i.prototype,"size",{get:function(){return this._size}}),i.prototype.reset=function(){this._index=0},i.prototype.consume=function(){if(this._index>=this._size)throw"cannot consume EOF";this._index+=1},i.prototype.LA=function(t){if(0===t)return 0;t<0&&(t+=1);var e=this._index+t-1;return e<0||e>=this._size?r.EOF:this.data[e]},i.prototype.LT=function(t){return this.LA(t)},i.prototype.mark=function(){return-1},i.prototype.release=function(t){},i.prototype.seek=function(t){t<=this._index?this._index=t:this._index=Math.min(t,this._size)},i.prototype.getText=function(t,e){if(e>=this._size&&(e=this._size-1),t>=this._size)return"";if(this.decodeToUnicodeCodePoints){for(var n="",r=t;r<=e;r++)n+=String.fromCodePoint(this.data[r]);return n}return this.strdata.slice(t,e+1)},i.prototype.toString=function(){return this.strdata},e.InputStream=i},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},,,,function(t,e,n){var r=n(16),i=n(17).Token,o=(n(21).RuleNode,n(21).ErrorNode),s=n(21).TerminalNode,a=n(47).ParserRuleContext,l=n(41).RuleContext,u=n(27).INVALID_ALT_NUMBER;function c(){}c.toStringTree=function(t,e,n){e=e||null,null!==(n=n||null)&&(e=n.ruleNames);var i=c.getNodeText(t,e);i=r.escapeWhitespace(i,!1);var o=t.getChildCount();if(0===o)return i;var s="("+i+" ";o>0&&(i=c.toStringTree(t.getChild(0),e),s=s.concat(i));for(var a=1;a<o;a++)i=c.toStringTree(t.getChild(a),e),s=s.concat(" "+i);return s=s.concat(")")},c.getNodeText=function(t,e,n){if(e=e||null,null!==(n=n||null)&&(e=n.ruleNames),null!==e){if(t instanceof l){var r=t.getAltNumber();return r!=u?e[t.ruleIndex]+":"+r:e[t.ruleIndex]}if(t instanceof o)return t.toString();if(t instanceof s&&null!==t.symbol)return t.symbol.text}var a=t.getPayload();return a instanceof i?a.text:t.getPayload().toString()},c.getChildren=function(t){for(var e=[],n=0;n<t.getChildCount();n++)e.push(t.getChild(n));return e},c.getAncestors=function(t){var e=[];for(t=t.getParent();null!==t;)e=[t].concat(e),t=t.getParent();return e},c.findAllTokenNodes=function(t,e){return c.findAllNodes(t,e,!0)},c.findAllRuleNodes=function(t,e){return c.findAllNodes(t,e,!1)},c.findAllNodes=function(t,e,n){var r=[];return c._findAllNodes(t,e,n,r),r},c._findAllNodes=function(t,e,n,r){n&&t instanceof s?t.symbol.type===e&&r.push(t):!n&&t instanceof a&&t.ruleIndex===e&&r.push(t);for(var i=0;i<t.getChildCount();i++)c._findAllNodes(t.getChild(i),e,n,r)},c.descendants=function(t){for(var e=[t],n=0;n<t.getChildCount();n++)e=e.concat(c.descendants(t.getChild(n)));return e},e.Trees=c},function(t,e,n){var r=n(17).Token,i=n(27).ATN,o=n(73).ATNType,s=n(20),a=s.ATNState,l=s.BasicState,u=s.DecisionState,c=s.BlockStartState,h=s.BlockEndState,p=s.LoopEndState,f=s.RuleStartState,d=s.RuleStopState,g=s.TokensStartState,v=s.PlusLoopbackState,m=s.StarLoopbackState,y=s.StarLoopEntryState,x=s.PlusBlockStartState,S=s.StarBlockStartState,b=s.BasicBlockStartState,T=n(28),C=T.Transition,w=T.AtomTransition,E=T.SetTransition,A=T.NotSetTransition,L=T.RuleTransition,N=T.RangeTransition,k=T.ActionTransition,O=T.EpsilonTransition,_=T.WildcardTransition,I=T.PredicateTransition,M=T.PrecedencePredicateTransition,P=n(18).IntervalSet,D=(n(18).Interval,n(55).ATNDeserializationOptions),R=n(56),F=R.LexerActionType,H=R.LexerSkipAction,B=R.LexerChannelAction,W=R.LexerCustomAction,j=R.LexerMoreAction,z=R.LexerTypeAction,U=R.LexerPushModeAction,V=R.LexerPopModeAction,q=R.LexerModeAction,G="59627784-3BE5-417A-B9EB-8131A7286089",K=["AADB8D7E-AEEF-4415-AD2B-8204D6CF042E",G];function Y(t,e){var n=[];return n[t-1]=e,n.map((function(t){return e}))}function X(t){return null==t&&(t=D.defaultOptions),this.deserializationOptions=t,this.stateFactories=null,this.actionFactories=null,this}X.prototype.isFeatureSupported=function(t,e){var n=K.indexOf(t);return!(n<0)&&K.indexOf(e)>=n},X.prototype.deserialize=function(t){this.reset(t),this.checkVersion(),this.checkUUID();var e=this.readATN();this.readStates(e),this.readRules(e),this.readModes(e);var n=[];return this.readSets(e,n,this.readInt.bind(this)),this.isFeatureSupported(G,this.uuid)&&this.readSets(e,n,this.readInt32.bind(this)),this.readEdges(e,n),this.readDecisions(e),this.readLexerActions(e),this.markPrecedenceDecisions(e),this.verifyATN(e),this.deserializationOptions.generateRuleBypassTransitions&&e.grammarType===o.PARSER&&(this.generateRuleBypassTransitions(e),this.verifyATN(e)),e},X.prototype.reset=function(t){var e=t.split("").map((function(t){var e=t.charCodeAt(0);return e>1?e-2:e+65534}));e[0]=t.charCodeAt(0),this.data=e,this.pos=0},X.prototype.checkVersion=function(){var t=this.readInt();if(3!==t)throw"Could not deserialize ATN with version "+t+" (expected 3)."},X.prototype.checkUUID=function(){var t=this.readUUID();if(K.indexOf(t)<0)throw"59627784-3BE5-417A-B9EB-8131A7286089";this.uuid=t},X.prototype.readATN=function(){var t=this.readInt(),e=this.readInt();return new i(t,e)},X.prototype.readStates=function(t){for(var e,n,r,i=[],o=[],s=this.readInt(),l=0;l<s;l++){var u=this.readInt();if(u!==a.INVALID_TYPE){var h=this.readInt();65535===h&&(h=-1);var p=this.stateFactory(u,h);if(u===a.LOOP_END){var f=this.readInt();i.push([p,f])}else if(p instanceof c){var d=this.readInt();o.push([p,d])}t.addState(p)}else t.addState(null)}for(e=0;e<i.length;e++)(n=i[e])[0].loopBackState=t.states[n[1]];for(e=0;e<o.length;e++)(n=o[e])[0].endState=t.states[n[1]];var g=this.readInt();for(e=0;e<g;e++)r=this.readInt(),t.states[r].nonGreedy=!0;var v=this.readInt();for(e=0;e<v;e++)r=this.readInt(),t.states[r].isPrecedenceRule=!0},X.prototype.readRules=function(t){var e,n=this.readInt();for(t.grammarType===o.LEXER&&(t.ruleToTokenType=Y(n,0)),t.ruleToStartState=Y(n,0),e=0;e<n;e++){var i=this.readInt(),s=t.states[i];if(t.ruleToStartState[e]=s,t.grammarType===o.LEXER){var a=this.readInt();65535===a&&(a=r.EOF),t.ruleToTokenType[e]=a}}for(t.ruleToStopState=Y(n,0),e=0;e<t.states.length;e++){var l=t.states[e];l instanceof d&&(t.ruleToStopState[l.ruleIndex]=l,t.ruleToStartState[l.ruleIndex].stopState=l)}},X.prototype.readModes=function(t){for(var e=this.readInt(),n=0;n<e;n++){var r=this.readInt();t.modeToStartState.push(t.states[r])}},X.prototype.readSets=function(t,e,n){for(var r=this.readInt(),i=0;i<r;i++){var o=new P;e.push(o);var s=this.readInt();0!==this.readInt()&&o.addOne(-1);for(var a=0;a<s;a++){var l=n(),u=n();o.addRange(l,u)}}},X.prototype.readEdges=function(t,e){var n,r,i,o,s,a=this.readInt();for(n=0;n<a;n++){var l=this.readInt(),u=this.readInt(),h=this.readInt(),p=this.readInt(),f=this.readInt(),d=this.readInt();o=this.edgeFactory(t,h,l,u,p,f,d,e),t.states[l].addTransition(o)}for(n=0;n<t.states.length;n++)for(i=t.states[n],r=0;r<i.transitions.length;r++){var g=i.transitions[r];if(g instanceof L){var S=-1;t.ruleToStartState[g.target.ruleIndex].isPrecedenceRule&&0===g.precedence&&(S=g.target.ruleIndex),o=new O(g.followState,S),t.ruleToStopState[g.target.ruleIndex].addTransition(o)}}for(n=0;n<t.states.length;n++){if((i=t.states[n])instanceof c){if(null===i.endState)throw"IllegalState";if(null!==i.endState.startState)throw"IllegalState";i.endState.startState=i}if(i instanceof v)for(r=0;r<i.transitions.length;r++)(s=i.transitions[r].target)instanceof x&&(s.loopBackState=i);else if(i instanceof m)for(r=0;r<i.transitions.length;r++)(s=i.transitions[r].target)instanceof y&&(s.loopBackState=i)}},X.prototype.readDecisions=function(t){for(var e=this.readInt(),n=0;n<e;n++){var r=this.readInt(),i=t.states[r];t.decisionToState.push(i),i.decision=n}},X.prototype.readLexerActions=function(t){if(t.grammarType===o.LEXER){var e=this.readInt();t.lexerActions=Y(e,null);for(var n=0;n<e;n++){var r=this.readInt(),i=this.readInt();65535===i&&(i=-1);var s=this.readInt();65535===s&&(s=-1);var a=this.lexerActionFactory(r,i,s);t.lexerActions[n]=a}}},X.prototype.generateRuleBypassTransitions=function(t){var e,n=t.ruleToStartState.length;for(e=0;e<n;e++)t.ruleToTokenType[e]=t.maxTokenType+e+1;for(e=0;e<n;e++)this.generateRuleBypassTransition(t,e)},X.prototype.generateRuleBypassTransition=function(t,e){var n,r,i=new b;i.ruleIndex=e,t.addState(i);var o=new h;o.ruleIndex=e,t.addState(o),i.endState=o,t.defineDecisionState(i),o.startState=i;var s=null,a=null;if(t.ruleToStartState[e].isPrecedenceRule){for(a=null,n=0;n<t.states.length;n++)if(r=t.states[n],this.stateIsEndStateFor(r,e)){a=r,s=r.loopBackState.transitions[0];break}if(null===s)throw"Couldn't identify final state of the precedence rule prefix section."}else a=t.ruleToStopState[e];for(n=0;n<t.states.length;n++){r=t.states[n];for(var u=0;u<r.transitions.length;u++){var c=r.transitions[u];c!==s&&(c.target===a&&(c.target=o))}}for(var p=t.ruleToStartState[e],f=p.transitions.length;f>0;)i.addTransition(p.transitions[f-1]),p.transitions=p.transitions.slice(-1);t.ruleToStartState[e].addTransition(new O(i)),o.addTransition(new O(a));var d=new l;t.addState(d),d.addTransition(new w(o,t.ruleToTokenType[e])),i.addTransition(new O(d))},X.prototype.stateIsEndStateFor=function(t,e){if(t.ruleIndex!==e)return null;if(!(t instanceof y))return null;var n=t.transitions[t.transitions.length-1].target;return n instanceof p&&n.epsilonOnlyTransitions&&n.transitions[0].target instanceof d?t:null},X.prototype.markPrecedenceDecisions=function(t){for(var e=0;e<t.states.length;e++){var n=t.states[e];if(n instanceof y&&t.ruleToStartState[n.ruleIndex].isPrecedenceRule){var r=n.transitions[n.transitions.length-1].target;r instanceof p&&r.epsilonOnlyTransitions&&r.transitions[0].target instanceof d&&(n.isPrecedenceDecision=!0)}}},X.prototype.verifyATN=function(t){if(this.deserializationOptions.verifyATN)for(var e=0;e<t.states.length;e++){var n=t.states[e];if(null!==n)if(this.checkCondition(n.epsilonOnlyTransitions||n.transitions.length<=1),n instanceof x)this.checkCondition(null!==n.loopBackState);else if(n instanceof y)if(this.checkCondition(null!==n.loopBackState),this.checkCondition(2===n.transitions.length),n.transitions[0].target instanceof S)this.checkCondition(n.transitions[1].target instanceof p),this.checkCondition(!n.nonGreedy);else{if(!(n.transitions[0].target instanceof p))throw"IllegalState";this.checkCondition(n.transitions[1].target instanceof S),this.checkCondition(n.nonGreedy)}else n instanceof m?(this.checkCondition(1===n.transitions.length),this.checkCondition(n.transitions[0].target instanceof y)):n instanceof p?this.checkCondition(null!==n.loopBackState):n instanceof f?this.checkCondition(null!==n.stopState):n instanceof c?this.checkCondition(null!==n.endState):n instanceof h?this.checkCondition(null!==n.startState):n instanceof u?this.checkCondition(n.transitions.length<=1||n.decision>=0):this.checkCondition(n.transitions.length<=1||n instanceof d)}},X.prototype.checkCondition=function(t,e){if(!t)throw null==e&&(e="IllegalState"),e},X.prototype.readInt=function(){return this.data[this.pos++]},X.prototype.readInt32=function(){return this.readInt()|this.readInt()<<16},X.prototype.readLong=function(){return 4294967295&this.readInt32()|this.readInt32()<<32};var $=function(){for(var t=[],e=0;e<256;e++)t[e]=(e+256).toString(16).substr(1).toUpperCase();return t}();X.prototype.readUUID=function(){for(var t=[],e=7;e>=0;e--){var n=this.readInt();t[2*e+1]=255&n,t[2*e]=n>>8&255}return $[t[0]]+$[t[1]]+$[t[2]]+$[t[3]]+"-"+$[t[4]]+$[t[5]]+"-"+$[t[6]]+$[t[7]]+"-"+$[t[8]]+$[t[9]]+"-"+$[t[10]]+$[t[11]]+$[t[12]]+$[t[13]]+$[t[14]]+$[t[15]]},X.prototype.edgeFactory=function(t,e,n,i,o,s,a,l){var u=t.states[i];switch(e){case C.EPSILON:return new O(u);case C.RANGE:return new N(u,0!==a?r.EOF:o,s);case C.RULE:return new L(t.states[o],s,a,u);case C.PREDICATE:return new I(u,o,s,0!==a);case C.PRECEDENCE:return new M(u,o);case C.ATOM:return new w(u,0!==a?r.EOF:o);case C.ACTION:return new k(u,o,s,0!==a);case C.SET:return new E(u,l[o]);case C.NOT_SET:return new A(u,l[o]);case C.WILDCARD:return new _(u);default:throw"The specified transition type: "+e+" is not valid."}},X.prototype.stateFactory=function(t,e){if(null===this.stateFactories){var n=[];n[a.INVALID_TYPE]=null,n[a.BASIC]=function(){return new l},n[a.RULE_START]=function(){return new f},n[a.BLOCK_START]=function(){return new b},n[a.PLUS_BLOCK_START]=function(){return new x},n[a.STAR_BLOCK_START]=function(){return new S},n[a.TOKEN_START]=function(){return new g},n[a.RULE_STOP]=function(){return new d},n[a.BLOCK_END]=function(){return new h},n[a.STAR_LOOP_BACK]=function(){return new m},n[a.STAR_LOOP_ENTRY]=function(){return new y},n[a.PLUS_LOOP_BACK]=function(){return new v},n[a.LOOP_END]=function(){return new p},this.stateFactories=n}if(t>this.stateFactories.length||null===this.stateFactories[t])throw"The specified state type "+t+" is not valid.";var r=this.stateFactories[t]();if(null!==r)return r.ruleIndex=e,r},X.prototype.lexerActionFactory=function(t,e,n){if(null===this.actionFactories){var r=[];r[F.CHANNEL]=function(t,e){return new B(t)},r[F.CUSTOM]=function(t,e){return new W(t,e)},r[F.MODE]=function(t,e){return new q(t)},r[F.MORE]=function(t,e){return j.INSTANCE},r[F.POP_MODE]=function(t,e){return V.INSTANCE},r[F.PUSH_MODE]=function(t,e){return new U(t)},r[F.SKIP]=function(t,e){return H.INSTANCE},r[F.TYPE]=function(t,e){return new z(t)},this.actionFactories=r}if(t>this.actionFactories.length||null===this.actionFactories[t])throw"The specified lexer action type "+t+" is not valid.";return this.actionFactories[t](e,n)},e.ATNDeserializer=X},function(t,e){function n(t){return void 0===t&&(t=null),this.readOnly=!1,this.verifyATN=null===t||t.verifyATN,this.generateRuleBypassTransitions=null!==t&&t.generateRuleBypassTransitions,this}n.defaultOptions=new n,n.defaultOptions.readOnly=!0,e.ATNDeserializationOptions=n},function(t,e){function n(){}function r(t){return this.actionType=t,this.isPositionDependent=!1,this}function i(){return r.call(this,n.SKIP),this}function o(t){return r.call(this,n.TYPE),this.type=t,this}function s(t){return r.call(this,n.PUSH_MODE),this.mode=t,this}function a(){return r.call(this,n.POP_MODE),this}function l(){return r.call(this,n.MORE),this}function u(t){return r.call(this,n.MODE),this.mode=t,this}function c(t,e){return r.call(this,n.CUSTOM),this.ruleIndex=t,this.actionIndex=e,this.isPositionDependent=!0,this}function h(t){return r.call(this,n.CHANNEL),this.channel=t,this}function p(t,e){return r.call(this,e.actionType),this.offset=t,this.action=e,this.isPositionDependent=!0,this}n.CHANNEL=0,n.CUSTOM=1,n.MODE=2,n.MORE=3,n.POP_MODE=4,n.PUSH_MODE=5,n.SKIP=6,n.TYPE=7,r.prototype.hashCode=function(){var t=new Hash;return this.updateHashCode(t),t.finish()},r.prototype.updateHashCode=function(t){t.update(this.actionType)},r.prototype.equals=function(t){return this===t},i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.INSTANCE=new i,i.prototype.execute=function(t){t.skip()},i.prototype.toString=function(){return"skip"},o.prototype=Object.create(r.prototype),o.prototype.constructor=o,o.prototype.execute=function(t){t.type=this.type},o.prototype.updateHashCode=function(t){t.update(this.actionType,this.type)},o.prototype.equals=function(t){return this===t||t instanceof o&&this.type===t.type},o.prototype.toString=function(){return"type("+this.type+")"},s.prototype=Object.create(r.prototype),s.prototype.constructor=s,s.prototype.execute=function(t){t.pushMode(this.mode)},s.prototype.updateHashCode=function(t){t.update(this.actionType,this.mode)},s.prototype.equals=function(t){return this===t||t instanceof s&&this.mode===t.mode},s.prototype.toString=function(){return"pushMode("+this.mode+")"},a.prototype=Object.create(r.prototype),a.prototype.constructor=a,a.INSTANCE=new a,a.prototype.execute=function(t){t.popMode()},a.prototype.toString=function(){return"popMode"},l.prototype=Object.create(r.prototype),l.prototype.constructor=l,l.INSTANCE=new l,l.prototype.execute=function(t){t.more()},l.prototype.toString=function(){return"more"},u.prototype=Object.create(r.prototype),u.prototype.constructor=u,u.prototype.execute=function(t){t.mode(this.mode)},u.prototype.updateHashCode=function(t){t.update(this.actionType,this.mode)},u.prototype.equals=function(t){return this===t||t instanceof u&&this.mode===t.mode},u.prototype.toString=function(){return"mode("+this.mode+")"},c.prototype=Object.create(r.prototype),c.prototype.constructor=c,c.prototype.execute=function(t){t.action(null,this.ruleIndex,this.actionIndex)},c.prototype.updateHashCode=function(t){t.update(this.actionType,this.ruleIndex,this.actionIndex)},c.prototype.equals=function(t){return this===t||t instanceof c&&(this.ruleIndex===t.ruleIndex&&this.actionIndex===t.actionIndex)},h.prototype=Object.create(r.prototype),h.prototype.constructor=h,h.prototype.execute=function(t){t._channel=this.channel},h.prototype.updateHashCode=function(t){t.update(this.actionType,this.channel)},h.prototype.equals=function(t){return this===t||t instanceof h&&this.channel===t.channel},h.prototype.toString=function(){return"channel("+this.channel+")"},p.prototype=Object.create(r.prototype),p.prototype.constructor=p,p.prototype.execute=function(t){this.action.execute(t)},p.prototype.updateHashCode=function(t){t.update(this.actionType,this.offset,this.action)},p.prototype.equals=function(t){return this===t||t instanceof p&&(this.offset===t.offset&&this.action===t.action)},e.LexerActionType=n,e.LexerSkipAction=i,e.LexerChannelAction=h,e.LexerCustomAction=c,e.LexerIndexedCustomAction=p,e.LexerMoreAction=l,e.LexerTypeAction=o,e.LexerPushModeAction=s,e.LexerPopModeAction=a,e.LexerModeAction=u},function(t,e,n){var r=n(17).Token,i=n(43).ConsoleErrorListener,o=n(43).ProxyErrorListener;function s(){return this._listeners=[i.INSTANCE],this._interp=null,this._stateNumber=-1,this}s.tokenTypeMapCache={},s.ruleIndexMapCache={},s.prototype.checkVersion=function(t){"4.8"!==t&&console.log("ANTLR runtime and generated code versions disagree: 4.8!="+t)},s.prototype.addErrorListener=function(t){this._listeners.push(t)},s.prototype.removeErrorListeners=function(){this._listeners=[]},s.prototype.getTokenTypeMap=function(){var t=this.getTokenNames();if(null===t)throw"The current recognizer does not provide a list of token names.";var e=this.tokenTypeMapCache[t];return void 0===e&&((e=t.reduce((function(t,e,n){t[e]=n}))).EOF=r.EOF,this.tokenTypeMapCache[t]=e),e},s.prototype.getRuleIndexMap=function(){var t=this.ruleNames;if(null===t)throw"The current recognizer does not provide a list of rule names.";var e=this.ruleIndexMapCache[t];return void 0===e&&(e=t.reduce((function(t,e,n){t[e]=n})),this.ruleIndexMapCache[t]=e),e},s.prototype.getTokenType=function(t){var e=this.getTokenTypeMap()[t];return void 0!==e?e:r.INVALID_TYPE},s.prototype.getErrorHeader=function(t){return"line "+t.getOffendingToken().line+":"+t.getOffendingToken().column},s.prototype.getTokenErrorDisplay=function(t){if(null===t)return"<no token>";var e=t.text;return null===e&&(e=t.type===r.EOF?"<EOF>":"<"+t.type+">"),"'"+(e=e.replace("\n","\\n").replace("\r","\\r").replace("\t","\\t"))+"'"},s.prototype.getErrorListenerDispatch=function(){return new o(this._listeners)},s.prototype.sempred=function(t,e,n){return!0},s.prototype.precpred=function(t,e){return!0},Object.defineProperty(s.prototype,"state",{get:function(){return this._stateNumber},set:function(t){this._stateNumber=t}}),e.Recognizer=s},function(t,e,n){var r=n(33).DFAState,i=n(30).ATNConfigSet,o=n(24).getCachedPredictionContext,s=n(16).Map;function a(t,e){return this.atn=t,this.sharedContextCache=e,this}a.ERROR=new r(2147483647,new i),a.prototype.getCachedContext=function(t){if(null===this.sharedContextCache)return t;var e=new s;return o(t,this.sharedContextCache,e)},e.ATNSimulator=a},function(t,e,n){n(16).Set;var r=n(16).Map,i=n(16).BitSet,o=n(16).AltDict,s=n(27).ATN,a=n(20).RuleStopState,l=n(30).ATNConfigSet,u=n(40).ATNConfig,c=n(32).SemanticContext,h=(n(16).Hash,n(16).hashStuff);n(16).equalArrays;function p(){return this}p.SLL=0,p.LL=1,p.LL_EXACT_AMBIG_DETECTION=2,p.hasSLLConflictTerminatingPrediction=function(t,e){if(p.allConfigsInRuleStopStates(e))return!0;if(t===p.SLL&&e.hasSemanticContext){for(var n=new l,r=0;r<e.items.length;r++){var i=e.items[r];i=new u({semanticContext:c.NONE},i),n.add(i)}e=n}var o=p.getConflictingAltSubsets(e);return p.hasConflictingAltSet(o)&&!p.hasStateAssociatedWithOneAlt(e)},p.hasConfigInRuleStopState=function(t){for(var e=0;e<t.items.length;e++){if(t.items[e].state instanceof a)return!0}return!1},p.allConfigsInRuleStopStates=function(t){for(var e=0;e<t.items.length;e++){if(!(t.items[e].state instanceof a))return!1}return!0},p.resolvesToJustOneViableAlt=function(t){return p.getSingleViableAlt(t)},p.allSubsetsConflict=function(t){return!p.hasNonConflictingAltSet(t)},p.hasNonConflictingAltSet=function(t){for(var e=0;e<t.length;e++){if(1===t[e].length)return!0}return!1},p.hasConflictingAltSet=function(t){for(var e=0;e<t.length;e++){if(t[e].length>1)return!0}return!1},p.allSubsetsEqual=function(t){for(var e=null,n=0;n<t.length;n++){var r=t[n];if(null===e)e=r;else if(r!==e)return!1}return!0},p.getUniqueAlt=function(t){var e=p.getAlts(t);return 1===e.length?e.minValue():s.INVALID_ALT_NUMBER},p.getAlts=function(t){var e=new i;return t.map((function(t){e.or(t)})),e},p.getConflictingAltSubsets=function(t){var e=new r;return e.hashFunction=function(t){h(t.state.stateNumber,t.context)},e.equalsFunction=function(t,e){return t.state.stateNumber==e.state.stateNumber&&t.context.equals(e.context)},t.items.map((function(t){var n=e.get(t);null===n&&(n=new i,e.put(t,n)),n.add(t.alt)})),e.getValues()},p.getStateToAltMap=function(t){var e=new o;return t.items.map((function(t){var n=e.get(t.state);null===n&&(n=new i,e.put(t.state,n)),n.add(t.alt)})),e},p.hasStateAssociatedWithOneAlt=function(t){for(var e=p.getStateToAltMap(t).values(),n=0;n<e.length;n++)if(1===e[n].length)return!0;return!1},p.getSingleViableAlt=function(t){for(var e=null,n=0;n<t.length;n++){var r=t[n].minValue();if(null===e)e=r;else if(e!==r)return s.INVALID_ALT_NUMBER}return e},e.PredictionMode=p},function(t,e){
  2. /*! https://mths.be/codepointat v0.2.0 by @mathias */
  3. String.prototype.codePointAt||function(){"use strict";var t=function(){try{var t={},e=Object.defineProperty,n=e(t,t,t)&&e}catch(t){}return n}(),e=function(t){if(null==this)throw TypeError();var e=String(this),n=e.length,r=t?Number(t):0;if(r!=r&&(r=0),!(r<0||r>=n)){var i,o=e.charCodeAt(r);return o>=55296&&o<=56319&&n>r+1&&(i=e.charCodeAt(r+1))>=56320&&i<=57343?1024*(o-55296)+i-56320+65536:o}};t?t(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e}()},function(t,e){var n,r,i,o;
  4. /*! https://mths.be/fromcodepoint v0.2.1 by @mathias */
  5. String.fromCodePoint||(n=function(){try{var t={},e=Object.defineProperty,n=e(t,t,t)&&e}catch(t){}return n}(),r=String.fromCharCode,i=Math.floor,o=function(t){var e,n,o=16384,s=[],a=-1,l=arguments.length;if(!l)return"";for(var u="";++a<l;){var c=Number(arguments[a]);if(!isFinite(c)||c<0||c>1114111||i(c)!=c)throw RangeError("Invalid code point: "+c);c<=65535?s.push(c):(e=55296+((c-=65536)>>10),n=c%1024+56320,s.push(e,n)),(a+1==l||s.length>o)&&(u+=r.apply(null,s),s.length=0)}return u},n?n(String,"fromCodePoint",{value:o,configurable:!0,writable:!0}):String.fromCodePoint=o)},function(t,e,n){var r=n(17).Token,i=n(22),o=i.NoViableAltException,s=i.InputMismatchException,a=i.FailedPredicateException,l=i.ParseCancellationException,u=n(20).ATNState,c=n(18).Interval,h=n(18).IntervalSet;function p(){}function f(){return p.call(this),this.errorRecoveryMode=!1,this.lastErrorIndex=-1,this.lastErrorStates=null,this}function d(){return f.call(this),this}p.prototype.reset=function(t){},p.prototype.recoverInline=function(t){},p.prototype.recover=function(t,e){},p.prototype.sync=function(t){},p.prototype.inErrorRecoveryMode=function(t){},p.prototype.reportError=function(t){},f.prototype=Object.create(p.prototype),f.prototype.constructor=f,f.prototype.reset=function(t){this.endErrorCondition(t)},f.prototype.beginErrorCondition=function(t){this.errorRecoveryMode=!0},f.prototype.inErrorRecoveryMode=function(t){return this.errorRecoveryMode},f.prototype.endErrorCondition=function(t){this.errorRecoveryMode=!1,this.lastErrorStates=null,this.lastErrorIndex=-1},f.prototype.reportMatch=function(t){this.endErrorCondition(t)},f.prototype.reportError=function(t,e){this.inErrorRecoveryMode(t)||(this.beginErrorCondition(t),e instanceof o?this.reportNoViableAlternative(t,e):e instanceof s?this.reportInputMismatch(t,e):e instanceof a?this.reportFailedPredicate(t,e):(console.log("unknown recognition error type: "+e.constructor.name),console.log(e.stack),t.notifyErrorListeners(e.getOffendingToken(),e.getMessage(),e)))},f.prototype.recover=function(t,e){this.lastErrorIndex===t.getInputStream().index&&null!==this.lastErrorStates&&this.lastErrorStates.indexOf(t.state)>=0&&t.consume(),this.lastErrorIndex=t._input.index,null===this.lastErrorStates&&(this.lastErrorStates=[]),this.lastErrorStates.push(t.state);var n=this.getErrorRecoverySet(t);this.consumeUntil(t,n)},f.prototype.sync=function(t){if(!this.inErrorRecoveryMode(t)){var e=t._interp.atn.states[t.state],n=t.getTokenStream().LA(1),i=t.atn.nextTokens(e);if(!i.contains(r.EPSILON)&&!i.contains(n))switch(e.stateType){case u.BLOCK_START:case u.STAR_BLOCK_START:case u.PLUS_BLOCK_START:case u.STAR_LOOP_ENTRY:if(null!==this.singleTokenDeletion(t))return;throw new s(t);case u.PLUS_LOOP_BACK:case u.STAR_LOOP_BACK:this.reportUnwantedToken(t);var o=new h;o.addSet(t.getExpectedTokens());var a=o.addSet(this.getErrorRecoverySet(t));this.consumeUntil(t,a)}}},f.prototype.reportNoViableAlternative=function(t,e){var n,i=t.getTokenStream();n=null!==i?e.startToken.type===r.EOF?"<EOF>":i.getText(new c(e.startToken.tokenIndex,e.offendingToken.tokenIndex)):"<unknown input>";var o="no viable alternative at input "+this.escapeWSAndQuote(n);t.notifyErrorListeners(o,e.offendingToken,e)},f.prototype.reportInputMismatch=function(t,e){var n="mismatched input "+this.getTokenErrorDisplay(e.offendingToken)+" expecting "+e.getExpectedTokens().toString(t.literalNames,t.symbolicNames);t.notifyErrorListeners(n,e.offendingToken,e)},f.prototype.reportFailedPredicate=function(t,e){var n="rule "+t.ruleNames[t._ctx.ruleIndex]+" "+e.message;t.notifyErrorListeners(n,e.offendingToken,e)},f.prototype.reportUnwantedToken=function(t){if(!this.inErrorRecoveryMode(t)){this.beginErrorCondition(t);var e=t.getCurrentToken(),n="extraneous input "+this.getTokenErrorDisplay(e)+" expecting "+this.getExpectedTokens(t).toString(t.literalNames,t.symbolicNames);t.notifyErrorListeners(n,e,null)}},f.prototype.reportMissingToken=function(t){if(!this.inErrorRecoveryMode(t)){this.beginErrorCondition(t);var e=t.getCurrentToken(),n="missing "+this.getExpectedTokens(t).toString(t.literalNames,t.symbolicNames)+" at "+this.getTokenErrorDisplay(e);t.notifyErrorListeners(n,e,null)}},f.prototype.recoverInline=function(t){var e=this.singleTokenDeletion(t);if(null!==e)return t.consume(),e;if(this.singleTokenInsertion(t))return this.getMissingSymbol(t);throw new s(t)},f.prototype.singleTokenInsertion=function(t){var e=t.getTokenStream().LA(1),n=t._interp.atn,r=n.states[t.state].transitions[0].target;return!!n.nextTokens(r,t._ctx).contains(e)&&(this.reportMissingToken(t),!0)},f.prototype.singleTokenDeletion=function(t){var e=t.getTokenStream().LA(2);if(this.getExpectedTokens(t).contains(e)){this.reportUnwantedToken(t),t.consume();var n=t.getCurrentToken();return this.reportMatch(t),n}return null},f.prototype.getMissingSymbol=function(t){var e,n=t.getCurrentToken(),i=this.getExpectedTokens(t).first();e=i===r.EOF?"<missing EOF>":"<missing "+t.literalNames[i]+">";var o=n,s=t.getTokenStream().LT(-1);return o.type===r.EOF&&null!==s&&(o=s),t.getTokenFactory().create(o.source,i,e,r.DEFAULT_CHANNEL,-1,-1,o.line,o.column)},f.prototype.getExpectedTokens=function(t){return t.getExpectedTokens()},f.prototype.getTokenErrorDisplay=function(t){if(null===t)return"<no token>";var e=t.text;return null===e&&(e=t.type===r.EOF?"<EOF>":"<"+t.type+">"),this.escapeWSAndQuote(e)},f.prototype.escapeWSAndQuote=function(t){return"'"+(t=(t=(t=t.replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t"))+"'"},f.prototype.getErrorRecoverySet=function(t){for(var e=t._interp.atn,n=t._ctx,i=new h;null!==n&&n.invokingState>=0;){var o=e.states[n.invokingState].transitions[0],s=e.nextTokens(o.followState);i.addSet(s),n=n.parentCtx}return i.removeOne(r.EPSILON),i},f.prototype.consumeUntil=function(t,e){for(var n=t.getTokenStream().LA(1);n!==r.EOF&&!e.contains(n);)t.consume(),n=t.getTokenStream().LA(1)},d.prototype=Object.create(f.prototype),d.prototype.constructor=d,d.prototype.recover=function(t,e){for(var n=t._ctx;null!==n;)n.exception=e,n=n.parentCtx;throw new l(e)},d.prototype.recoverInline=function(t){this.recover(t,new s(t))},d.prototype.sync=function(t){},e.BailErrorStrategy=d,e.DefaultErrorStrategy=f},function(t,e){},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}},function(t,e,n){var r=n(64);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}},,,,function(t,e,n){var r=n(100),i=n(101),o=n(65),s=n(102);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||s()}},,function(t,e,n){e.ATN=n(27).ATN,e.ATNDeserializer=n(54).ATNDeserializer,e.LexerATNSimulator=n(74).LexerATNSimulator,e.ParserATNSimulator=n(77).ParserATNSimulator,e.PredictionMode=n(59).PredictionMode},function(t,e,n){var r=n(16).Set,i=n(16).BitSet,o=n(17).Token,s=n(40).ATNConfig,a=(n(18).Interval,n(18).IntervalSet),l=n(20).RuleStopState,u=n(28).RuleTransition,c=n(28).NotSetTransition,h=n(28).WildcardTransition,p=n(28).AbstractPredicateTransition,f=n(24),d=f.predictionContextFromRuleContext,g=f.PredictionContext,v=f.SingletonPredictionContext;function m(t){this.atn=t}m.HIT_PRED=o.INVALID_TYPE,m.prototype.getDecisionLookahead=function(t){if(null===t)return null;for(var e=t.transitions.length,n=[],o=0;o<e;o++){n[o]=new a;var s=new r;this._LOOK(t.transition(o).target,null,g.EMPTY,n[o],s,new i,!1,!1),(0===n[o].length||n[o].contains(m.HIT_PRED))&&(n[o]=null)}return n},m.prototype.LOOK=function(t,e,n){var o=new a,s=null!==(n=n||null)?d(t.atn,n):null;return this._LOOK(t,e,s,o,new r,new i,!0,!0),o},m.prototype._LOOK=function(t,e,n,r,i,a,f,d){var y=new s({state:t,alt:0,context:n},null);if(!i.contains(y)){if(i.add(y),t===e){if(null===n)return void r.addOne(o.EPSILON);if(n.isEmpty()&&d)return void r.addOne(o.EOF)}if(t instanceof l){if(null===n)return void r.addOne(o.EPSILON);if(n.isEmpty()&&d)return void r.addOne(o.EOF);if(n!==g.EMPTY){for(var x=0;x<n.length;x++){var S=this.atn.states[n.getReturnState(x)],b=a.contains(S.ruleIndex);try{a.remove(S.ruleIndex),this._LOOK(S,e,n.getParent(x),r,i,a,f,d)}finally{b&&a.add(S.ruleIndex)}}return}}for(var T=0;T<t.transitions.length;T++){var C=t.transitions[T];if(C.constructor===u){if(a.contains(C.target.ruleIndex))continue;var w=v.create(n,C.followState.stateNumber);try{a.add(C.target.ruleIndex),this._LOOK(C.target,e,w,r,i,a,f,d)}finally{a.remove(C.target.ruleIndex)}}else if(C instanceof p)f?this._LOOK(C.target,e,n,r,i,a,f,d):r.addOne(m.HIT_PRED);else if(C.isEpsilon)this._LOOK(C.target,e,n,r,i,a,f,d);else if(C.constructor===h)r.addRange(o.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType);else{var E=C.label;null!==E&&(C instanceof c&&(E=E.complement(o.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType)),r.addSet(E))}}}},e.LL1Analyzer=m},function(t,e){function n(){}n.LEXER=0,n.PARSER=1,e.ATNType=n},function(t,e,n){var r=n(17).Token,i=n(42).Lexer,o=n(27).ATN,s=n(58).ATNSimulator,a=n(33).DFAState,l=(n(30).ATNConfigSet,n(30).OrderedATNConfigSet),u=n(24).PredictionContext,c=n(24).SingletonPredictionContext,h=n(20).RuleStopState,p=n(40).LexerATNConfig,f=n(28).Transition,d=n(76).LexerActionExecutor,g=n(22).LexerNoViableAltException;function v(t){t.index=-1,t.line=0,t.column=-1,t.dfaState=null}function m(){return v(this),this}function y(t,e,n,r){return s.call(this,e,r),this.decisionToDFA=n,this.recog=t,this.startIndex=-1,this.line=1,this.column=0,this.mode=i.DEFAULT_MODE,this.prevAccept=new m,this}m.prototype.reset=function(){v(this)},y.prototype=Object.create(s.prototype),y.prototype.constructor=y,y.debug=!1,y.dfa_debug=!1,y.MIN_DFA_EDGE=0,y.MAX_DFA_EDGE=127,y.match_calls=0,y.prototype.copyState=function(t){this.column=t.column,this.line=t.line,this.mode=t.mode,this.startIndex=t.startIndex},y.prototype.match=function(t,e){this.match_calls+=1,this.mode=e;var n=t.mark();try{this.startIndex=t.index,this.prevAccept.reset();var r=this.decisionToDFA[e];return null===r.s0?this.matchATN(t):this.execATN(t,r.s0)}finally{t.release(n)}},y.prototype.reset=function(){this.prevAccept.reset(),this.startIndex=-1,this.line=1,this.column=0,this.mode=i.DEFAULT_MODE},y.prototype.matchATN=function(t){var e=this.atn.modeToStartState[this.mode];y.debug&&console.log("matchATN mode "+this.mode+" start: "+e);var n=this.mode,r=this.computeStartState(t,e),i=r.hasSemanticContext;r.hasSemanticContext=!1;var o=this.addDFAState(r);i||(this.decisionToDFA[this.mode].s0=o);var s=this.execATN(t,o);return y.debug&&console.log("DFA after matchATN: "+this.decisionToDFA[n].toLexerString()),s},y.prototype.execATN=function(t,e){y.debug&&console.log("start state closure="+e.configs),e.isAcceptState&&this.captureSimState(this.prevAccept,t,e);for(var n=t.LA(1),i=e;;){y.debug&&console.log("execATN loop starting closure: "+i.configs);var o=this.getExistingTargetState(i,n);if(null===o&&(o=this.computeTargetState(t,i,n)),o===s.ERROR)break;if(n!==r.EOF&&this.consume(t),o.isAcceptState&&(this.captureSimState(this.prevAccept,t,o),n===r.EOF))break;n=t.LA(1),i=o}return this.failOrAccept(this.prevAccept,t,i.configs,n)},y.prototype.getExistingTargetState=function(t,e){if(null===t.edges||e<y.MIN_DFA_EDGE||e>y.MAX_DFA_EDGE)return null;var n=t.edges[e-y.MIN_DFA_EDGE];return void 0===n&&(n=null),y.debug&&null!==n&&console.log("reuse state "+t.stateNumber+" edge to "+n.stateNumber),n},y.prototype.computeTargetState=function(t,e,n){var r=new l;return this.getReachableConfigSet(t,e.configs,r,n),0===r.items.length?(r.hasSemanticContext||this.addDFAEdge(e,n,s.ERROR),s.ERROR):this.addDFAEdge(e,n,null,r)},y.prototype.failOrAccept=function(t,e,n,i){if(null!==this.prevAccept.dfaState){var o=t.dfaState.lexerActionExecutor;return this.accept(e,o,this.startIndex,t.index,t.line,t.column),t.dfaState.prediction}if(i===r.EOF&&e.index===this.startIndex)return r.EOF;throw new g(this.recog,e,this.startIndex,n)},y.prototype.getReachableConfigSet=function(t,e,n,i){for(var s=o.INVALID_ALT_NUMBER,a=0;a<e.items.length;a++){var l=e.items[a],u=l.alt===s;if(!u||!l.passedThroughNonGreedyDecision){y.debug&&console.log("testing %s at %s\n",this.getTokenName(i),l.toString(this.recog,!0));for(var c=0;c<l.state.transitions.length;c++){var h=l.state.transitions[c],f=this.getReachableTarget(h,i);if(null!==f){var d=l.lexerActionExecutor;null!==d&&(d=d.fixOffsetBeforeMatch(t.index-this.startIndex));var g=i===r.EOF,v=new p({state:f,lexerActionExecutor:d},l);this.closure(t,v,n,u,!0,g)&&(s=l.alt)}}}}},y.prototype.accept=function(t,e,n,r,i,o){y.debug&&console.log("ACTION %s\n",e),t.seek(r),this.line=i,this.column=o,null!==e&&null!==this.recog&&e.execute(this.recog,t,n)},y.prototype.getReachableTarget=function(t,e){return t.matches(e,0,i.MAX_CHAR_VALUE)?t.target:null},y.prototype.computeStartState=function(t,e){for(var n=u.EMPTY,r=new l,i=0;i<e.transitions.length;i++){var o=e.transitions[i].target,s=new p({state:o,alt:i+1,context:n},null);this.closure(t,s,r,!1,!1,!1)}return r},y.prototype.closure=function(t,e,n,r,i,o){var s=null;if(y.debug&&console.log("closure("+e.toString(this.recog,!0)+")"),e.state instanceof h){if(y.debug&&(null!==this.recog?console.log("closure at %s rule stop %s\n",this.recog.ruleNames[e.state.ruleIndex],e):console.log("closure at rule stop %s\n",e)),null===e.context||e.context.hasEmptyPath()){if(null===e.context||e.context.isEmpty())return n.add(e),!0;n.add(new p({state:e.state,context:u.EMPTY},e)),r=!0}if(null!==e.context&&!e.context.isEmpty())for(var a=0;a<e.context.length;a++)if(e.context.getReturnState(a)!==u.EMPTY_RETURN_STATE){var l=e.context.getParent(a),c=this.atn.states[e.context.getReturnState(a)];s=new p({state:c,context:l},e),r=this.closure(t,s,n,r,i,o)}return r}e.state.epsilonOnlyTransitions||r&&e.passedThroughNonGreedyDecision||n.add(e);for(var f=0;f<e.state.transitions.length;f++){var d=e.state.transitions[f];null!==(s=this.getEpsilonTarget(t,e,d,n,i,o))&&(r=this.closure(t,s,n,r,i,o))}return r},y.prototype.getEpsilonTarget=function(t,e,n,o,s,a){var l=null;if(n.serializationType===f.RULE){var u=c.create(e.context,n.followState.stateNumber);l=new p({state:n.target,context:u},e)}else{if(n.serializationType===f.PRECEDENCE)throw"Precedence predicates are not supported in lexers.";if(n.serializationType===f.PREDICATE)y.debug&&console.log("EVAL rule "+n.ruleIndex+":"+n.predIndex),o.hasSemanticContext=!0,this.evaluatePredicate(t,n.ruleIndex,n.predIndex,s)&&(l=new p({state:n.target},e));else if(n.serializationType===f.ACTION)if(null===e.context||e.context.hasEmptyPath()){var h=d.append(e.lexerActionExecutor,this.atn.lexerActions[n.actionIndex]);l=new p({state:n.target,lexerActionExecutor:h},e)}else l=new p({state:n.target},e);else n.serializationType===f.EPSILON?l=new p({state:n.target},e):n.serializationType!==f.ATOM&&n.serializationType!==f.RANGE&&n.serializationType!==f.SET||a&&n.matches(r.EOF,0,i.MAX_CHAR_VALUE)&&(l=new p({state:n.target},e))}return l},y.prototype.evaluatePredicate=function(t,e,n,r){if(null===this.recog)return!0;if(!r)return this.recog.sempred(null,e,n);var i=this.column,o=this.line,s=t.index,a=t.mark();try{return this.consume(t),this.recog.sempred(null,e,n)}finally{this.column=i,this.line=o,t.seek(s),t.release(a)}},y.prototype.captureSimState=function(t,e,n){t.index=e.index,t.line=this.line,t.column=this.column,t.dfaState=n},y.prototype.addDFAEdge=function(t,e,n,r){if(void 0===n&&(n=null),void 0===r&&(r=null),null===n&&null!==r){var i=r.hasSemanticContext;if(r.hasSemanticContext=!1,n=this.addDFAState(r),i)return n}return e<y.MIN_DFA_EDGE||e>y.MAX_DFA_EDGE||(y.debug&&console.log("EDGE "+t+" -> "+n+" upon "+e),null===t.edges&&(t.edges=[]),t.edges[e-y.MIN_DFA_EDGE]=n),n},y.prototype.addDFAState=function(t){for(var e=new a(null,t),n=null,r=0;r<t.items.length;r++){var i=t.items[r];if(i.state instanceof h){n=i;break}}null!==n&&(e.isAcceptState=!0,e.lexerActionExecutor=n.lexerActionExecutor,e.prediction=this.atn.ruleToTokenType[n.state.ruleIndex]);var o=this.decisionToDFA[this.mode],s=o.states.get(e);if(null!==s)return s;var l=e;return l.stateNumber=o.states.length,t.setReadonly(!0),l.configs=t,o.states.add(l),l},y.prototype.getDFA=function(t){return this.decisionToDFA[t]},y.prototype.getText=function(t){return t.getText(this.startIndex,t.index-1)},y.prototype.consume=function(t){t.LA(1)==="\n".charCodeAt(0)?(this.line+=1,this.column=0):this.column+=1,t.consume()},y.prototype.getTokenName=function(t){return-1===t?"EOF":"'"+String.fromCharCode(t)+"'"},e.LexerATNSimulator=y},function(t,e,n){var r=n(17).CommonToken;function i(){return this}function o(t){return i.call(this),this.copyText=void 0!==t&&t,this}o.prototype=Object.create(i.prototype),o.prototype.constructor=o,o.DEFAULT=new o,o.prototype.create=function(t,e,n,i,o,s,a,l){var u=new r(t,e,i,o,s);return u.line=a,u.column=l,null!==n?u.text=n:this.copyText&&null!==t[1]&&(u.text=t[1].getText(o,s)),u},o.prototype.createThin=function(t,e){var n=new r(null,t);return n.text=e,n},e.CommonTokenFactory=o},function(t,e,n){var r=n(16).hashStuff,i=n(56).LexerIndexedCustomAction;function o(t){return this.lexerActions=null===t?[]:t,this.cachedHashCode=r(t),this}o.append=function(t,e){return new o(null===t?[e]:t.lexerActions.concat([e]))},o.prototype.fixOffsetBeforeMatch=function(t){for(var e=null,n=0;n<this.lexerActions.length;n++)!this.lexerActions[n].isPositionDependent||this.lexerActions[n]instanceof i||(null===e&&(e=this.lexerActions.concat([])),e[n]=new i(t,this.lexerActions[n]));return null===e?this:new o(e)},o.prototype.execute=function(t,e,n){var r=!1,o=e.index;try{for(var s=0;s<this.lexerActions.length;s++){var a=this.lexerActions[s];if(a instanceof i){var l=a.offset;e.seek(n+l),a=a.action,r=n+l!==o}else a.isPositionDependent&&(e.seek(o),r=!1);a.execute(t)}}finally{r&&e.seek(o)}},o.prototype.hashCode=function(){return this.cachedHashCode},o.prototype.updateHashCode=function(t){t.update(this.cachedHashCode)},o.prototype.equals=function(t){if(this===t)return!0;if(t instanceof o){if(this.cachedHashCode!=t.cachedHashCode)return!1;if(this.lexerActions.length!=t.lexerActions.length)return!1;for(var e=this.lexerActions.length,n=0;n<e;++n)if(!this.lexerActions[n].equals(t.lexerActions[n]))return!1;return!0}return!1},e.LexerActionExecutor=o},function(t,e,n){var r=n(16),i=r.Set,o=r.BitSet,s=r.DoubleDict,a=n(27).ATN,l=n(20).ATNState,u=n(40).ATNConfig,c=n(30).ATNConfigSet,h=n(17).Token,p=n(33).DFAState,f=n(33).PredPrediction,d=n(58).ATNSimulator,g=n(59).PredictionMode,v=n(41).RuleContext,m=(n(47).ParserRuleContext,n(32).SemanticContext),y=(n(20).StarLoopEntryState,n(20).RuleStopState),x=n(24).PredictionContext,S=n(18).Interval,b=n(28),T=b.Transition,C=b.SetTransition,w=b.NotSetTransition,E=b.RuleTransition,A=b.ActionTransition,L=n(22).NoViableAltException,N=n(24).SingletonPredictionContext,k=n(24).predictionContextFromRuleContext;function O(t,e,n,r){return d.call(this,e,r),this.parser=t,this.decisionToDFA=n,this.predictionMode=g.LL,this._input=null,this._startIndex=0,this._outerContext=null,this._dfa=null,this.mergeCache=null,this}O.prototype=Object.create(d.prototype),O.prototype.constructor=O,O.prototype.debug=!1,O.prototype.debug_closure=!1,O.prototype.debug_add=!1,O.prototype.debug_list_atn_decisions=!1,O.prototype.dfa_debug=!1,O.prototype.retry_debug=!1,O.prototype.reset=function(){},O.prototype.adaptivePredict=function(t,e,n){(this.debug||this.debug_list_atn_decisions)&&console.log("adaptivePredict decision "+e+" exec LA(1)=="+this.getLookaheadName(t)+" line "+t.LT(1).line+":"+t.LT(1).column),this._input=t,this._startIndex=t.index,this._outerContext=n;var r=this.decisionToDFA[e];this._dfa=r;var i=t.mark(),o=t.index;try{var s;if(null===(s=r.precedenceDfa?r.getPrecedenceStartState(this.parser.getPrecedence()):r.s0)){null===n&&(n=v.EMPTY),(this.debug||this.debug_list_atn_decisions)&&console.log("predictATN decision "+r.decision+" exec LA(1)=="+this.getLookaheadName(t)+", outerContext="+n.toString(this.parser.ruleNames));var a=this.computeStartState(r.atnStartState,v.EMPTY,!1);r.precedenceDfa?(r.s0.configs=a,a=this.applyPrecedenceFilter(a),s=this.addDFAState(r,new p(null,a)),r.setPrecedenceStartState(this.parser.getPrecedence(),s)):(s=this.addDFAState(r,new p(null,a)),r.s0=s)}var l=this.execATN(r,s,t,o,n);return this.debug&&console.log("DFA after predictATN: "+r.toString(this.parser.literalNames)),l}finally{this._dfa=null,this.mergeCache=null,t.seek(o),t.release(i)}},O.prototype.execATN=function(t,e,n,r,i){var o;(this.debug||this.debug_list_atn_decisions)&&console.log("execATN decision "+t.decision+" exec LA(1)=="+this.getLookaheadName(n)+" line "+n.LT(1).line+":"+n.LT(1).column);var s=e;this.debug&&console.log("s0 = "+e);for(var l=n.LA(1);;){var u=this.getExistingTargetState(s,l);if(null===u&&(u=this.computeTargetState(t,s,l)),u===d.ERROR){var c=this.noViableAlt(n,i,s.configs,r);if(n.seek(r),(o=this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(s.configs,i))!==a.INVALID_ALT_NUMBER)return o;throw c}if(u.requiresFullContext&&this.predictionMode!==g.SLL){var p=null;if(null!==u.predicates){this.debug&&console.log("DFA state has preds in DFA sim LL failover");var f=n.index;if(f!==r&&n.seek(r),1===(p=this.evalSemanticContext(u.predicates,i,!0)).length)return this.debug&&console.log("Full LL avoided"),p.minValue();f!==r&&n.seek(f)}this.dfa_debug&&console.log("ctx sensitive state "+i+" in "+u);var v=this.computeStartState(t.atnStartState,i,!0);return this.reportAttemptingFullContext(t,p,u.configs,r,n.index),o=this.execATNWithFullContext(t,u,v,n,r,i)}if(u.isAcceptState){if(null===u.predicates)return u.prediction;var m=n.index;n.seek(r);var y=this.evalSemanticContext(u.predicates,i,!0);if(0===y.length)throw this.noViableAlt(n,i,u.configs,r);return 1===y.length||this.reportAmbiguity(t,u,r,m,!1,y,u.configs),y.minValue()}s=u,l!==h.EOF&&(n.consume(),l=n.LA(1))}},O.prototype.getExistingTargetState=function(t,e){var n=t.edges;return null===n?null:n[e+1]||null},O.prototype.computeTargetState=function(t,e,n){var i=this.computeReachSet(e.configs,n,!1);if(null===i)return this.addDFAEdge(t,e,n,d.ERROR),d.ERROR;var o=new p(null,i),s=this.getUniqueAlt(i);if(this.debug){var l=g.getConflictingAltSubsets(i);console.log("SLL altSubSets="+r.arrayToString(l)+", previous="+e.configs+", configs="+i+", predict="+s+", allSubsetsConflict="+g.allSubsetsConflict(l)+", conflictingAlts="+this.getConflictingAlts(i))}return s!==a.INVALID_ALT_NUMBER?(o.isAcceptState=!0,o.configs.uniqueAlt=s,o.prediction=s):g.hasSLLConflictTerminatingPrediction(this.predictionMode,i)&&(o.configs.conflictingAlts=this.getConflictingAlts(i),o.requiresFullContext=!0,o.isAcceptState=!0,o.prediction=o.configs.conflictingAlts.minValue()),o.isAcceptState&&o.configs.hasSemanticContext&&(this.predicateDFAState(o,this.atn.getDecisionState(t.decision)),null!==o.predicates&&(o.prediction=a.INVALID_ALT_NUMBER)),o=this.addDFAEdge(t,e,n,o)},O.prototype.predicateDFAState=function(t,e){var n=e.transitions.length,r=this.getConflictingAltsOrUniqueAlt(t.configs),i=this.getPredsForAmbigAlts(r,t.configs,n);null!==i?(t.predicates=this.getPredicatePredictions(r,i),t.prediction=a.INVALID_ALT_NUMBER):t.prediction=r.minValue()},O.prototype.execATNWithFullContext=function(t,e,n,r,i,o){(this.debug||this.debug_list_atn_decisions)&&console.log("execATNWithFullContext "+n);var s=!1,l=null,u=n;r.seek(i);for(var c=r.LA(1),p=-1;;){if(null===(l=this.computeReachSet(u,c,!0))){var f=this.noViableAlt(r,o,u,i);r.seek(i);var d=this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(u,o);if(d!==a.INVALID_ALT_NUMBER)return d;throw f}var v=g.getConflictingAltSubsets(l);if(this.debug&&console.log("LL altSubSets="+v+", predict="+g.getUniqueAlt(v)+", resolvesToJustOneViableAlt="+g.resolvesToJustOneViableAlt(v)),l.uniqueAlt=this.getUniqueAlt(l),l.uniqueAlt!==a.INVALID_ALT_NUMBER){p=l.uniqueAlt;break}if(this.predictionMode!==g.LL_EXACT_AMBIG_DETECTION){if((p=g.resolvesToJustOneViableAlt(v))!==a.INVALID_ALT_NUMBER)break}else if(g.allSubsetsConflict(v)&&g.allSubsetsEqual(v)){s=!0,p=g.getSingleViableAlt(v);break}u=l,c!==h.EOF&&(r.consume(),c=r.LA(1))}return l.uniqueAlt!==a.INVALID_ALT_NUMBER?(this.reportContextSensitivity(t,p,l,i,r.index),p):(this.reportAmbiguity(t,e,i,r.index,s,null,l),p)},O.prototype.computeReachSet=function(t,e,n){this.debug&&console.log("in computeReachSet, starting closure: "+t),null===this.mergeCache&&(this.mergeCache=new s);for(var r=new c(n),o=null,l=0;l<t.items.length;l++){var p=t.items[l];if(this.debug_add&&console.log("testing "+this.getTokenName(e)+" at "+p),p.state instanceof y)(n||e===h.EOF)&&(null===o&&(o=[]),o.push(p),this.debug_add&&console.log("added "+p+" to skippedStopStates"));else for(var f=0;f<p.state.transitions.length;f++){var d=p.state.transitions[f],v=this.getReachableTarget(d,e);if(null!==v){var m=new u({state:v},p);r.add(m,this.mergeCache),this.debug_add&&console.log("added "+m+" to intermediate")}}}var x=null;if(null===o&&e!==h.EOF&&(1===r.items.length||this.getUniqueAlt(r)!==a.INVALID_ALT_NUMBER)&&(x=r),null===x){x=new c(n);for(var S=new i,b=e===h.EOF,T=0;T<r.items.length;T++)this.closure(r.items[T],x,S,!1,n,b)}if(e===h.EOF&&(x=this.removeAllConfigsNotInRuleStopState(x,x===r)),!(null===o||n&&g.hasConfigInRuleStopState(x)))for(var C=0;C<o.length;C++)x.add(o[C],this.mergeCache);return 0===x.items.length?null:x},O.prototype.removeAllConfigsNotInRuleStopState=function(t,e){if(g.allConfigsInRuleStopStates(t))return t;for(var n=new c(t.fullCtx),r=0;r<t.items.length;r++){var i=t.items[r];if(i.state instanceof y)n.add(i,this.mergeCache);else if(e&&i.state.epsilonOnlyTransitions)if(this.atn.nextTokens(i.state).contains(h.EPSILON)){var o=this.atn.ruleToStopState[i.state.ruleIndex];n.add(new u({state:o},i),this.mergeCache)}}return n},O.prototype.computeStartState=function(t,e,n){for(var r=k(this.atn,e),o=new c(n),s=0;s<t.transitions.length;s++){var a=t.transitions[s].target,l=new u({state:a,alt:s+1,context:r},null),h=new i;this.closure(l,o,h,!0,n,!1)}return o},O.prototype.applyPrecedenceFilter=function(t){for(var e,n=[],r=new c(t.fullCtx),i=0;i<t.items.length;i++)if(1===(e=t.items[i]).alt){var o=e.semanticContext.evalPrecedence(this.parser,this._outerContext);null!==o&&(n[e.state.stateNumber]=e.context,o!==e.semanticContext?r.add(new u({semanticContext:o},e),this.mergeCache):r.add(e,this.mergeCache))}for(i=0;i<t.items.length;i++)if(1!==(e=t.items[i]).alt){if(!e.precedenceFilterSuppressed){var s=n[e.state.stateNumber]||null;if(null!==s&&s.equals(e.context))continue}r.add(e,this.mergeCache)}return r},O.prototype.getReachableTarget=function(t,e){return t.matches(e,0,this.atn.maxTokenType)?t.target:null},O.prototype.getPredsForAmbigAlts=function(t,e,n){for(var i=[],o=0;o<e.items.length;o++){var s=e.items[o];t.contains(s.alt)&&(i[s.alt]=m.orContext(i[s.alt]||null,s.semanticContext))}var a=0;for(o=1;o<n+1;o++){var l=i[o]||null;null===l?i[o]=m.NONE:l!==m.NONE&&(a+=1)}return 0===a&&(i=null),this.debug&&console.log("getPredsForAmbigAlts result "+r.arrayToString(i)),i},O.prototype.getPredicatePredictions=function(t,e){for(var n=[],r=!1,i=1;i<e.length;i++){var o=e[i];null!==t&&t.contains(i)&&n.push(new f(o,i)),o!==m.NONE&&(r=!0)}return r?n:null},O.prototype.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule=function(t,e){var n=this.splitAccordingToSemanticValidity(t,e),r=n[0],i=n[1],o=this.getAltThatFinishedDecisionEntryRule(r);return o!==a.INVALID_ALT_NUMBER||i.items.length>0&&(o=this.getAltThatFinishedDecisionEntryRule(i))!==a.INVALID_ALT_NUMBER?o:a.INVALID_ALT_NUMBER},O.prototype.getAltThatFinishedDecisionEntryRule=function(t){for(var e=[],n=0;n<t.items.length;n++){var r=t.items[n];(r.reachesIntoOuterContext>0||r.state instanceof y&&r.context.hasEmptyPath())&&e.indexOf(r.alt)<0&&e.push(r.alt)}return 0===e.length?a.INVALID_ALT_NUMBER:Math.min.apply(null,e)},O.prototype.splitAccordingToSemanticValidity=function(t,e){for(var n=new c(t.fullCtx),r=new c(t.fullCtx),i=0;i<t.items.length;i++){var o=t.items[i];if(o.semanticContext!==m.NONE)o.semanticContext.evaluate(this.parser,e)?n.add(o):r.add(o);else n.add(o)}return[n,r]},O.prototype.evalSemanticContext=function(t,e,n){for(var r=new o,i=0;i<t.length;i++){var s=t[i];if(s.pred!==m.NONE){var a=s.pred.evaluate(this.parser,e);if((this.debug||this.dfa_debug)&&console.log("eval pred "+s+"="+a),a&&((this.debug||this.dfa_debug)&&console.log("PREDICT "+s.alt),r.add(s.alt),!n))break}else if(r.add(s.alt),!n)break}return r},O.prototype.closure=function(t,e,n,r,i,o){this.closureCheckingStopState(t,e,n,r,i,0,o)},O.prototype.closureCheckingStopState=function(t,e,n,r,i,o,s){if((this.debug||this.debug_closure)&&(console.log("closure("+t.toString(this.parser,!0)+")"),t.reachesIntoOuterContext>50))throw"problem";if(t.state instanceof y){if(!t.context.isEmpty()){for(var a=0;a<t.context.length;a++)if(t.context.getReturnState(a)!==x.EMPTY_RETURN_STATE){var l=this.atn.states[t.context.getReturnState(a)],c=t.context.getParent(a),h={state:l,alt:t.alt,context:c,semanticContext:t.semanticContext},p=new u(h,null);p.reachesIntoOuterContext=t.reachesIntoOuterContext,this.closureCheckingStopState(p,e,n,r,i,o-1,s)}else{if(i){e.add(new u({state:t.state,context:x.EMPTY},t),this.mergeCache);continue}this.debug&&console.log("FALLING off rule "+this.getRuleName(t.state.ruleIndex)),this.closure_(t,e,n,r,i,o,s)}return}if(i)return void e.add(t,this.mergeCache);this.debug&&console.log("FALLING off rule "+this.getRuleName(t.state.ruleIndex))}this.closure_(t,e,n,r,i,o,s)},O.prototype.closure_=function(t,e,n,r,i,o,s){var a=t.state;a.epsilonOnlyTransitions||e.add(t,this.mergeCache);for(var l=0;l<a.transitions.length;l++)if(0!=l||!this.canDropLoopEntryEdgeInLeftRecursiveRule(t)){var u=a.transitions[l],c=r&&!(u instanceof A),h=this.getEpsilonTarget(t,u,c,0===o,i,s);if(null!==h){var p=o;if(t.state instanceof y){if(null!==this._dfa&&this._dfa.precedenceDfa&&u.outermostPrecedenceReturn===this._dfa.atnStartState.ruleIndex&&(h.precedenceFilterSuppressed=!0),h.reachesIntoOuterContext+=1,n.add(h)!==h)continue;e.dipsIntoOuterContext=!0,p-=1,this.debug&&console.log("dips into outer ctx: "+h)}else{if(!u.isEpsilon&&n.add(h)!==h)continue;u instanceof E&&p>=0&&(p+=1)}this.closureCheckingStopState(h,e,n,c,i,p,s)}}},O.prototype.canDropLoopEntryEdgeInLeftRecursiveRule=function(t){var e=t.state;if(e.stateType!=l.STAR_LOOP_ENTRY)return!1;if(e.stateType!=l.STAR_LOOP_ENTRY||!e.isPrecedenceDecision||t.context.isEmpty()||t.context.hasEmptyPath())return!1;for(var n=t.context.length,r=0;r<n;r++){if((s=this.atn.states[t.context.getReturnState(r)]).ruleIndex!=e.ruleIndex)return!1}var i=e.transitions[0].target.endState.stateNumber,o=this.atn.states[i];for(r=0;r<n;r++){var s,a=t.context.getReturnState(r);if(1!=(s=this.atn.states[a]).transitions.length||!s.transitions[0].isEpsilon)return!1;var u=s.transitions[0].target;if((s.stateType!=l.BLOCK_END||u!=e)&&(s!=o&&u!=o&&(u.stateType!=l.BLOCK_END||1!=u.transitions.length||!u.transitions[0].isEpsilon||u.transitions[0].target!=e)))return!1}return!0},O.prototype.getRuleName=function(t){return null!==this.parser&&t>=0?this.parser.ruleNames[t]:"<rule "+t+">"},O.prototype.getEpsilonTarget=function(t,e,n,r,i,o){switch(e.serializationType){case T.RULE:return this.ruleTransition(t,e);case T.PRECEDENCE:return this.precedenceTransition(t,e,n,r,i);case T.PREDICATE:return this.predTransition(t,e,n,r,i);case T.ACTION:return this.actionTransition(t,e);case T.EPSILON:return new u({state:e.target},t);case T.ATOM:case T.RANGE:case T.SET:return o&&e.matches(h.EOF,0,1)?new u({state:e.target},t):null;default:return null}},O.prototype.actionTransition=function(t,e){if(this.debug){var n=-1==e.actionIndex?65535:e.actionIndex;console.log("ACTION edge "+e.ruleIndex+":"+n)}return new u({state:e.target},t)},O.prototype.precedenceTransition=function(t,e,n,i,o){this.debug&&(console.log("PRED (collectPredicates="+n+") "+e.precedence+">=_p, ctx dependent=true"),null!==this.parser&&console.log("context surrounding pred is "+r.arrayToString(this.parser.getRuleInvocationStack())));var s=null;if(n&&i)if(o){var a=this._input.index;this._input.seek(this._startIndex);var l=e.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(a),l&&(s=new u({state:e.target},t))}else{var c=m.andContext(t.semanticContext,e.getPredicate());s=new u({state:e.target,semanticContext:c},t)}else s=new u({state:e.target},t);return this.debug&&console.log("config from pred transition="+s),s},O.prototype.predTransition=function(t,e,n,i,o){this.debug&&(console.log("PRED (collectPredicates="+n+") "+e.ruleIndex+":"+e.predIndex+", ctx dependent="+e.isCtxDependent),null!==this.parser&&console.log("context surrounding pred is "+r.arrayToString(this.parser.getRuleInvocationStack())));var s=null;if(n&&(e.isCtxDependent&&i||!e.isCtxDependent))if(o){var a=this._input.index;this._input.seek(this._startIndex);var l=e.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(a),l&&(s=new u({state:e.target},t))}else{var c=m.andContext(t.semanticContext,e.getPredicate());s=new u({state:e.target,semanticContext:c},t)}else s=new u({state:e.target},t);return this.debug&&console.log("config from pred transition="+s),s},O.prototype.ruleTransition=function(t,e){this.debug&&console.log("CALL rule "+this.getRuleName(e.target.ruleIndex)+", ctx="+t.context);var n=e.followState,r=N.create(t.context,n.stateNumber);return new u({state:e.target,context:r},t)},O.prototype.getConflictingAlts=function(t){var e=g.getConflictingAltSubsets(t);return g.getAlts(e)},O.prototype.getConflictingAltsOrUniqueAlt=function(t){var e=null;return t.uniqueAlt!==a.INVALID_ALT_NUMBER?(e=new o).add(t.uniqueAlt):e=t.conflictingAlts,e},O.prototype.getTokenName=function(t){if(t===h.EOF)return"EOF";if(null!==this.parser&&null!==this.parser.literalNames){if(!(t>=this.parser.literalNames.length&&t>=this.parser.symbolicNames.length))return(this.parser.literalNames[t]||this.parser.symbolicNames[t])+"<"+t+">";console.log(t+" ttype out of range: "+this.parser.literalNames),console.log(""+this.parser.getInputStream().getTokens())}return""+t},O.prototype.getLookaheadName=function(t){return this.getTokenName(t.LA(1))},O.prototype.dumpDeadEndConfigs=function(t){console.log("dead end configs: ");for(var e=t.getDeadEndConfigs(),n=0;n<e.length;n++){var r=e[n],i="no edges";if(r.state.transitions.length>0){var o=r.state.transitions[0];if(o instanceof AtomTransition)i="Atom "+this.getTokenName(o.label);else if(o instanceof C){i=(o instanceof w?"~":"")+"Set "+o.set}}console.error(r.toString(this.parser,!0)+":"+i)}},O.prototype.noViableAlt=function(t,e,n,r){return new L(this.parser,t,t.get(r),t.LT(1),n,e)},O.prototype.getUniqueAlt=function(t){for(var e=a.INVALID_ALT_NUMBER,n=0;n<t.items.length;n++){var r=t.items[n];if(e===a.INVALID_ALT_NUMBER)e=r.alt;else if(r.alt!==e)return a.INVALID_ALT_NUMBER}return e},O.prototype.addDFAEdge=function(t,e,n,r){if(this.debug&&console.log("EDGE "+e+" -> "+r+" upon "+this.getTokenName(n)),null===r)return null;if(r=this.addDFAState(t,r),null===e||n<-1||n>this.atn.maxTokenType)return r;if(null===e.edges&&(e.edges=[]),e.edges[n+1]=r,this.debug){var i=null===this.parser?null:this.parser.literalNames,o=null===this.parser?null:this.parser.symbolicNames;console.log("DFA=\n"+t.toString(i,o))}return r},O.prototype.addDFAState=function(t,e){if(e==d.ERROR)return e;var n=t.states.get(e);return null!==n?n:(e.stateNumber=t.states.length,e.configs.readOnly||(e.configs.optimizeConfigs(this),e.configs.setReadonly(!0)),t.states.add(e),this.debug&&console.log("adding new DFA state: "+e),e)},O.prototype.reportAttemptingFullContext=function(t,e,n,r,i){if(this.debug||this.retry_debug){var o=new S(r,i+1);console.log("reportAttemptingFullContext decision="+t.decision+":"+n+", input="+this.parser.getTokenStream().getText(o))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAttemptingFullContext(this.parser,t,r,i,e,n)},O.prototype.reportContextSensitivity=function(t,e,n,r,i){if(this.debug||this.retry_debug){var o=new S(r,i+1);console.log("reportContextSensitivity decision="+t.decision+":"+n+", input="+this.parser.getTokenStream().getText(o))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportContextSensitivity(this.parser,t,r,i,e,n)},O.prototype.reportAmbiguity=function(t,e,n,r,i,o,s){if(this.debug||this.retry_debug){var a=new S(n,r+1);console.log("reportAmbiguity "+o+":"+s+", input="+this.parser.getTokenStream().getText(a))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAmbiguity(this.parser,t,n,r,i,o,s)},e.ParserATNSimulator=O},function(t,e,n){e.DFA=n(79).DFA,e.DFASerializer=n(44).DFASerializer,e.LexerDFASerializer=n(44).LexerDFASerializer,e.PredPrediction=n(33).PredPrediction},function(t,e,n){var r=n(16).Set,i=n(33).DFAState,o=n(20).StarLoopEntryState,s=n(30).ATNConfigSet,a=n(44).DFASerializer,l=n(44).LexerDFASerializer;function u(t,e){if(void 0===e&&(e=0),this.atnStartState=t,this.decision=e,this._states=new r,this.s0=null,this.precedenceDfa=!1,t instanceof o&&t.isPrecedenceDecision){this.precedenceDfa=!0;var n=new i(null,new s);n.edges=[],n.isAcceptState=!1,n.requiresFullContext=!1,this.s0=n}return this}u.prototype.getPrecedenceStartState=function(t){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";return t<0||t>=this.s0.edges.length?null:this.s0.edges[t]||null},u.prototype.setPrecedenceStartState=function(t,e){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";t<0||(this.s0.edges[t]=e)},u.prototype.setPrecedenceDfa=function(t){if(this.precedenceDfa!==t){if(this._states=new DFAStatesSet,t){var e=new i(null,new s);e.edges=[],e.isAcceptState=!1,e.requiresFullContext=!1,this.s0=e}else this.s0=null;this.precedenceDfa=t}},Object.defineProperty(u.prototype,"states",{get:function(){return this._states}}),u.prototype.sortedStates=function(){return this._states.values().sort((function(t,e){return t.stateNumber-e.stateNumber}))},u.prototype.toString=function(t,e){return t=t||null,e=e||null,null===this.s0?"":new a(this,t,e).toString()},u.prototype.toLexerString=function(){return null===this.s0?"":new l(this).toString()},e.DFA=u},function(t,e,n){var r=n(21);e.Trees=n(53).Trees,e.RuleNode=r.RuleNode,e.ParseTreeListener=r.ParseTreeListener,e.ParseTreeVisitor=r.ParseTreeVisitor,e.ParseTreeWalker=r.ParseTreeWalker},function(t,e,n){e.RecognitionException=n(22).RecognitionException,e.NoViableAltException=n(22).NoViableAltException,e.LexerNoViableAltException=n(22).LexerNoViableAltException,e.InputMismatchException=n(22).InputMismatchException,e.FailedPredicateException=n(22).FailedPredicateException,e.DiagnosticErrorListener=n(82).DiagnosticErrorListener,e.BailErrorStrategy=n(62).BailErrorStrategy,e.ErrorListener=n(43).ErrorListener},function(t,e,n){var r=n(16).BitSet,i=n(43).ErrorListener,o=n(18).Interval;function s(t){return i.call(this),t=t||!0,this.exactOnly=t,this}s.prototype=Object.create(i.prototype),s.prototype.constructor=s,s.prototype.reportAmbiguity=function(t,e,n,r,i,s,a){if(!this.exactOnly||i){var l="reportAmbiguity d="+this.getDecisionDescription(t,e)+": ambigAlts="+this.getConflictingAlts(s,a)+", input='"+t.getTokenStream().getText(new o(n,r))+"'";t.notifyErrorListeners(l)}},s.prototype.reportAttemptingFullContext=function(t,e,n,r,i,s){var a="reportAttemptingFullContext d="+this.getDecisionDescription(t,e)+", input='"+t.getTokenStream().getText(new o(n,r))+"'";t.notifyErrorListeners(a)},s.prototype.reportContextSensitivity=function(t,e,n,r,i,s){var a="reportContextSensitivity d="+this.getDecisionDescription(t,e)+", input='"+t.getTokenStream().getText(new o(n,r))+"'";t.notifyErrorListeners(a)},s.prototype.getDecisionDescription=function(t,e){var n=e.decision,r=e.atnStartState.ruleIndex,i=t.ruleNames;if(r<0||r>=i.length)return""+n;var o=i[r]||null;return null===o||0===o.length?""+n:n+" ("+o+")"},s.prototype.getConflictingAlts=function(t,e){if(null!==t)return t;for(var n=new r,i=0;i<e.items.length;i++)n.add(e.items[i].alt);return"{"+n.values().join(", ")+"}"},e.DiagnosticErrorListener=s},function(t,e,n){var r=n(48).InputStream,i="undefined"==typeof window&&"undefined"==typeof importScripts?n(63):null,o={fromString:function(t){return new r(t,!0)},fromBlob:function(t,e,n,i){var o=FileReader();o.onload=function(t){var e=new r(t.target.result,!0);n(e)},o.onerror=i,o.readAsText(t,e)},fromBuffer:function(t,e){return new r(t.toString(e),!0)},fromPath:function(t,e,n){i.readFile(t,e,(function(t,e){var i=null;null!==e&&(i=new r(e,!0)),n(t,i)}))},fromPathSync:function(t,e){var n=i.readFileSync(t,e);return new r(n,!0)}};e.CharStreams=o},function(t,e,n){var r=n(48).InputStream,i="undefined"==typeof window&&"undefined"==typeof importScripts?n(63):null;function o(t,e){var n=i.readFileSync(t,"utf8");return r.call(this,n,e),this.fileName=t,this}o.prototype=Object.create(r.prototype),o.prototype.constructor=o,e.FileStream=o},function(t,e,n){var r=n(17).Token,i=n(86).BufferedTokenStream;function o(t,e){return i.call(this,t),this.channel=void 0===e?r.DEFAULT_CHANNEL:e,this}o.prototype=Object.create(i.prototype),o.prototype.constructor=o,o.prototype.adjustSeekIndex=function(t){return this.nextTokenOnChannel(t,this.channel)},o.prototype.LB=function(t){if(0===t||this.index-t<0)return null;for(var e=this.index,n=1;n<=t;)e=this.previousTokenOnChannel(e-1,this.channel),n+=1;return e<0?null:this.tokens[e]},o.prototype.LT=function(t){if(this.lazyInit(),0===t)return null;if(t<0)return this.LB(-t);for(var e=this.index,n=1;n<t;)this.sync(e+1)&&(e=this.nextTokenOnChannel(e+1,this.channel)),n+=1;return this.tokens[e]},o.prototype.getNumberOfOnChannelTokens=function(){var t=0;this.fill();for(var e=0;e<this.tokens.length;e++){var n=this.tokens[e];if(n.channel===this.channel&&(t+=1),n.type===r.EOF)break}return t},e.CommonTokenStream=o},function(t,e,n){var r=n(17).Token,i=n(42).Lexer,o=n(18).Interval;function s(){return this}function a(t){return s.call(this),this.tokenSource=t,this.tokens=[],this.index=-1,this.fetchedEOF=!1,this}a.prototype=Object.create(s.prototype),a.prototype.constructor=a,a.prototype.mark=function(){return 0},a.prototype.release=function(t){},a.prototype.reset=function(){this.seek(0)},a.prototype.seek=function(t){this.lazyInit(),this.index=this.adjustSeekIndex(t)},a.prototype.get=function(t){return this.lazyInit(),this.tokens[t]},a.prototype.consume=function(){if(!(this.index>=0&&(this.fetchedEOF?this.index<this.tokens.length-1:this.index<this.tokens.length))&&this.LA(1)===r.EOF)throw"cannot consume EOF";this.sync(this.index+1)&&(this.index=this.adjustSeekIndex(this.index+1))},a.prototype.sync=function(t){var e=t-this.tokens.length+1;return!(e>0)||this.fetch(e)>=e},a.prototype.fetch=function(t){if(this.fetchedEOF)return 0;for(var e=0;e<t;e++){var n=this.tokenSource.nextToken();if(n.tokenIndex=this.tokens.length,this.tokens.push(n),n.type===r.EOF)return this.fetchedEOF=!0,e+1}return t},a.prototype.getTokens=function(t,e,n){if(void 0===n&&(n=null),t<0||e<0)return null;this.lazyInit();var i=[];e>=this.tokens.length&&(e=this.tokens.length-1);for(var o=t;o<e;o++){var s=this.tokens[o];if(s.type===r.EOF)break;(null===n||n.contains(s.type))&&i.push(s)}return i},a.prototype.LA=function(t){return this.LT(t).type},a.prototype.LB=function(t){return this.index-t<0?null:this.tokens[this.index-t]},a.prototype.LT=function(t){if(this.lazyInit(),0===t)return null;if(t<0)return this.LB(-t);var e=this.index+t-1;return this.sync(e),e>=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[e]},a.prototype.adjustSeekIndex=function(t){return t},a.prototype.lazyInit=function(){-1===this.index&&this.setup()},a.prototype.setup=function(){this.sync(0),this.index=this.adjustSeekIndex(0)},a.prototype.setTokenSource=function(t){this.tokenSource=t,this.tokens=[],this.index=-1,this.fetchedEOF=!1},a.prototype.nextTokenOnChannel=function(t,e){if(this.sync(t),t>=this.tokens.length)return-1;for(var n=this.tokens[t];n.channel!==this.channel;){if(n.type===r.EOF)return-1;t+=1,this.sync(t),n=this.tokens[t]}return t},a.prototype.previousTokenOnChannel=function(t,e){for(;t>=0&&this.tokens[t].channel!==e;)t-=1;return t},a.prototype.getHiddenTokensToRight=function(t,e){if(void 0===e&&(e=-1),this.lazyInit(),t<0||t>=this.tokens.length)throw t+" not in 0.."+this.tokens.length-1;var n=this.nextTokenOnChannel(t+1,i.DEFAULT_TOKEN_CHANNEL),r=t+1,o=-1===n?this.tokens.length-1:n;return this.filterForChannel(r,o,e)},a.prototype.getHiddenTokensToLeft=function(t,e){if(void 0===e&&(e=-1),this.lazyInit(),t<0||t>=this.tokens.length)throw t+" not in 0.."+this.tokens.length-1;var n=this.previousTokenOnChannel(t-1,i.DEFAULT_TOKEN_CHANNEL);if(n===t-1)return null;var r=n+1,o=t-1;return this.filterForChannel(r,o,e)},a.prototype.filterForChannel=function(t,e,n){for(var r=[],o=t;o<e+1;o++){var s=this.tokens[o];-1===n?s.channel!==i.DEFAULT_TOKEN_CHANNEL&&r.push(s):s.channel===n&&r.push(s)}return 0===r.length?null:r},a.prototype.getSourceName=function(){return this.tokenSource.getSourceName()},a.prototype.getText=function(t){this.lazyInit(),this.fill(),null==t&&(t=new o(0,this.tokens.length-1));var e=t.start;e instanceof r&&(e=e.tokenIndex);var n=t.stop;if(n instanceof r&&(n=n.tokenIndex),null===e||null===n||e<0||n<0)return"";n>=this.tokens.length&&(n=this.tokens.length-1);for(var i="",s=e;s<n+1;s++){var a=this.tokens[s];if(a.type===r.EOF)break;i+=a.text}return i},a.prototype.fill=function(){for(this.lazyInit();1e3===this.fetch(1e3););},e.BufferedTokenStream=a},function(t,e,n){var r=n(17).Token,i=n(21).ParseTreeListener,o=n(57).Recognizer,s=n(62).DefaultErrorStrategy,a=n(54).ATNDeserializer,l=n(55).ATNDeserializationOptions,u=n(21).TerminalNode,c=n(21).ErrorNode;function h(t){return i.call(this),this.parser=t,this}function p(t){return o.call(this),this._input=null,this._errHandler=new s,this._precedenceStack=[],this._precedenceStack.push(0),this._ctx=null,this.buildParseTrees=!0,this._tracer=null,this._parseListeners=null,this._syntaxErrors=0,this.setInputStream(t),this}h.prototype=Object.create(i.prototype),h.prototype.constructor=h,h.prototype.enterEveryRule=function(t){console.log("enter "+this.parser.ruleNames[t.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)},h.prototype.visitTerminal=function(t){console.log("consume "+t.symbol+" rule "+this.parser.ruleNames[this.parser._ctx.ruleIndex])},h.prototype.exitEveryRule=function(t){console.log("exit "+this.parser.ruleNames[t.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)},p.prototype=Object.create(o.prototype),p.prototype.contructor=p,p.bypassAltsAtnCache={},p.prototype.reset=function(){null!==this._input&&this._input.seek(0),this._errHandler.reset(this),this._ctx=null,this._syntaxErrors=0,this.setTrace(!1),this._precedenceStack=[],this._precedenceStack.push(0),null!==this._interp&&this._interp.reset()},p.prototype.match=function(t){var e=this.getCurrentToken();return e.type===t?(this._errHandler.reportMatch(this),this.consume()):(e=this._errHandler.recoverInline(this),this.buildParseTrees&&-1===e.tokenIndex&&this._ctx.addErrorNode(e)),e},p.prototype.matchWildcard=function(){var t=this.getCurrentToken();return t.type>0?(this._errHandler.reportMatch(this),this.consume()):(t=this._errHandler.recoverInline(this),this._buildParseTrees&&-1===t.tokenIndex&&this._ctx.addErrorNode(t)),t},p.prototype.getParseListeners=function(){return this._parseListeners||[]},p.prototype.addParseListener=function(t){if(null===t)throw"listener";null===this._parseListeners&&(this._parseListeners=[]),this._parseListeners.push(t)},p.prototype.removeParseListener=function(t){if(null!==this._parseListeners){var e=this._parseListeners.indexOf(t);e>=0&&this._parseListeners.splice(e,1),0===this._parseListeners.length&&(this._parseListeners=null)}},p.prototype.removeParseListeners=function(){this._parseListeners=null},p.prototype.triggerEnterRuleEvent=function(){if(null!==this._parseListeners){var t=this._ctx;this._parseListeners.map((function(e){e.enterEveryRule(t),t.enterRule(e)}))}},p.prototype.triggerExitRuleEvent=function(){if(null!==this._parseListeners){var t=this._ctx;this._parseListeners.slice(0).reverse().map((function(e){t.exitRule(e),e.exitEveryRule(t)}))}},p.prototype.getTokenFactory=function(){return this._input.tokenSource._factory},p.prototype.setTokenFactory=function(t){this._input.tokenSource._factory=t},p.prototype.getATNWithBypassAlts=function(){var t=this.getSerializedATN();if(null===t)throw"The current parser does not support an ATN with bypass alternatives.";var e=this.bypassAltsAtnCache[t];if(null===e){var n=new l;n.generateRuleBypassTransitions=!0,e=new a(n).deserialize(t),this.bypassAltsAtnCache[t]=e}return e};var f=n(42).Lexer;p.prototype.compileParseTreePattern=function(t,e,n){if(null===(n=n||null)&&null!==this.getTokenStream()){var r=this.getTokenStream().tokenSource;r instanceof f&&(n=r)}if(null===n)throw"Parser can't discover a lexer to use";return new ParseTreePatternMatcher(n,this).compile(t,e)},p.prototype.getInputStream=function(){return this.getTokenStream()},p.prototype.setInputStream=function(t){this.setTokenStream(t)},p.prototype.getTokenStream=function(){return this._input},p.prototype.setTokenStream=function(t){this._input=null,this.reset(),this._input=t},p.prototype.getCurrentToken=function(){return this._input.LT(1)},p.prototype.notifyErrorListeners=function(t,e,n){n=n||null,null===(e=e||null)&&(e=this.getCurrentToken()),this._syntaxErrors+=1;var r=e.line,i=e.column;this.getErrorListenerDispatch().syntaxError(this,e,r,i,t,n)},p.prototype.consume=function(){var t=this.getCurrentToken();t.type!==r.EOF&&this.getInputStream().consume();var e,n=null!==this._parseListeners&&this._parseListeners.length>0;(this.buildParseTrees||n)&&((e=this._errHandler.inErrorRecoveryMode(this)?this._ctx.addErrorNode(t):this._ctx.addTokenNode(t)).invokingState=this.state,n&&this._parseListeners.map((function(t){e instanceof c||void 0!==e.isErrorNode&&e.isErrorNode()?t.visitErrorNode(e):e instanceof u&&t.visitTerminal(e)})));return t},p.prototype.addContextToParseTree=function(){null!==this._ctx.parentCtx&&this._ctx.parentCtx.addChild(this._ctx)},p.prototype.enterRule=function(t,e,n){this.state=e,this._ctx=t,this._ctx.start=this._input.LT(1),this.buildParseTrees&&this.addContextToParseTree(),null!==this._parseListeners&&this.triggerEnterRuleEvent()},p.prototype.exitRule=function(){this._ctx.stop=this._input.LT(-1),null!==this._parseListeners&&this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx.parentCtx},p.prototype.enterOuterAlt=function(t,e){t.setAltNumber(e),this.buildParseTrees&&this._ctx!==t&&null!==this._ctx.parentCtx&&(this._ctx.parentCtx.removeLastChild(),this._ctx.parentCtx.addChild(t)),this._ctx=t},p.prototype.getPrecedence=function(){return 0===this._precedenceStack.length?-1:this._precedenceStack[this._precedenceStack.length-1]},p.prototype.enterRecursionRule=function(t,e,n,r){this.state=e,this._precedenceStack.push(r),this._ctx=t,this._ctx.start=this._input.LT(1),null!==this._parseListeners&&this.triggerEnterRuleEvent()},p.prototype.pushNewRecursionContext=function(t,e,n){var r=this._ctx;r.parentCtx=t,r.invokingState=e,r.stop=this._input.LT(-1),this._ctx=t,this._ctx.start=r.start,this.buildParseTrees&&this._ctx.addChild(r),null!==this._parseListeners&&this.triggerEnterRuleEvent()},p.prototype.unrollRecursionContexts=function(t){this._precedenceStack.pop(),this._ctx.stop=this._input.LT(-1);var e=this._ctx;if(null!==this._parseListeners)for(;this._ctx!==t;)this.triggerExitRuleEvent(),this._ctx=this._ctx.parentCtx;else this._ctx=t;e.parentCtx=t,this.buildParseTrees&&null!==t&&t.addChild(e)},p.prototype.getInvokingContext=function(t){for(var e=this._ctx;null!==e;){if(e.ruleIndex===t)return e;e=e.parentCtx}return null},p.prototype.precpred=function(t,e){return e>=this._precedenceStack[this._precedenceStack.length-1]},p.prototype.inContext=function(t){return!1},p.prototype.isExpectedToken=function(t){var e=this._interp.atn,n=this._ctx,i=e.states[this.state],o=e.nextTokens(i);if(o.contains(t))return!0;if(!o.contains(r.EPSILON))return!1;for(;null!==n&&n.invokingState>=0&&o.contains(r.EPSILON);){var s=e.states[n.invokingState].transitions[0];if((o=e.nextTokens(s.followState)).contains(t))return!0;n=n.parentCtx}return!(!o.contains(r.EPSILON)||t!==r.EOF)},p.prototype.getExpectedTokens=function(){return this._interp.atn.getExpectedTokens(this.state,this._ctx)},p.prototype.getExpectedTokensWithinCurrentRule=function(){var t=this._interp.atn,e=t.states[this.state];return t.nextTokens(e)},p.prototype.getRuleIndex=function(t){var e=this.getRuleIndexMap()[t];return null!==e?e:-1},p.prototype.getRuleInvocationStack=function(t){null===(t=t||null)&&(t=this._ctx);for(var e=[];null!==t;){var n=t.ruleIndex;n<0?e.push("n/a"):e.push(this.ruleNames[n]),t=t.parentCtx}return e},p.prototype.getDFAStrings=function(){return this._interp.decisionToDFA.toString()},p.prototype.dumpDFA=function(){for(var t=!1,e=0;e<this._interp.decisionToDFA.length;e++){var n=this._interp.decisionToDFA[e];n.states.length>0&&(t&&console.log(),this.printer.println("Decision "+n.decision+":"),this.printer.print(n.toString(this.literalNames,this.symbolicNames)),t=!0)}},p.prototype.getSourceName=function(){return this._input.sourceName},p.prototype.setTrace=function(t){t?(null!==this._tracer&&this.removeParseListener(this._tracer),this._tracer=new h(this),this.addParseListener(this._tracer)):(this.removeParseListener(this._tracer),this._tracer=null)},e.Parser=p},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},function(t,e,n){var r=function(t){"use strict";var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function a(t,e,n,r){var i=e&&e.prototype instanceof c?e:c,o=Object.create(i.prototype),s=new T(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return w()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=x(s,n);if(a){if(a===u)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,s),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=a;var u={};function c(){}function h(){}function p(){}var f={};f[i]=function(){return this};var d=Object.getPrototypeOf,g=d&&d(d(C([])));g&&g!==e&&n.call(g,i)&&(f=g);var v=p.prototype=c.prototype=Object.create(f);function m(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function y(t,e){var r;this._invoke=function(i,o){function s(){return new e((function(r,s){!function r(i,o,s,a){var u=l(t[i],t,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return r("throw",t,s,a)}))}a(u.arg)}(i,o,r,s)}))}return r=r?r.then(s,s):s()}}function x(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=l(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,u;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:w}}function w(){return{value:void 0,done:!0}}return h.prototype=v.constructor=p,p.constructor=h,p[s]=h.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},m(y.prototype),y.prototype[o]=function(){return this},t.AsyncIterator=y,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var s=new y(a(e,n,r,i),o);return t.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},m(v),v[s]="Generator",v[i]=function(){return this},v.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=C,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return s.type="throw",s.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(a&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,u):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),b(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;b(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:C(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},,function(t,e){t.exports=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}},function(t,e,n){var r=n(49),i=n(93);function o(e,n,s){return i()?t.exports=o=Reflect.construct:t.exports=o=function(t,e,n){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return n&&r(o,n.prototype),o},o.apply(null,arguments)}t.exports=o},function(t,e){t.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}},,,,function(t,e,n){var r=n(64);t.exports=function(t){if(Array.isArray(t))return r(t)}},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}return n}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},,,,function(t,e,n){!function(t){var e={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=t.Pos;function r(t,n){return"pairs"==n&&"string"==typeof t?t:"object"==typeof t&&null!=t[n]?t[n]:e[n]}t.defineOption("autoCloseBrackets",!1,(function(e,n,s){s&&s!=t.Init&&(e.removeKeyMap(i),e.state.closeBrackets=null),n&&(o(r(n,"pairs")),e.state.closeBrackets=n,e.addKeyMap(i))}));var i={Backspace:function(e){var i=a(e);if(!i||e.getOption("disableInput"))return t.Pass;for(var o=r(i,"pairs"),s=e.listSelections(),u=0;u<s.length;u++){if(!s[u].empty())return t.Pass;var c=l(e,s[u].head);if(!c||o.indexOf(c)%2!=0)return t.Pass}for(u=s.length-1;u>=0;u--){var h=s[u].head;e.replaceRange("",n(h.line,h.ch-1),n(h.line,h.ch+1),"+delete")}},Enter:function(e){var n=a(e),i=n&&r(n,"explode");if(!i||e.getOption("disableInput"))return t.Pass;for(var o=e.listSelections(),s=0;s<o.length;s++){if(!o[s].empty())return t.Pass;var u=l(e,o[s].head);if(!u||i.indexOf(u)%2!=0)return t.Pass}e.operation((function(){var t=e.lineSeparator()||"\n";e.replaceSelection(t+t,null),e.execCommand("goCharLeft"),o=e.listSelections();for(var n=0;n<o.length;n++){var r=o[n].head.line;e.indentLine(r,null,!0),e.indentLine(r+1,null,!0)}}))}};function o(t){for(var e=0;e<t.length;e++){var n=t.charAt(e),r="'"+n+"'";i[r]||(i[r]=s(n))}}function s(e){return function(i){return function(e,i){var o=a(e);if(!o||e.getOption("disableInput"))return t.Pass;var s=r(o,"pairs"),l=s.indexOf(i);if(-1==l)return t.Pass;for(var c,h=r(o,"closeBefore"),p=r(o,"triples"),f=s.charAt(l+1)==i,d=e.listSelections(),g=l%2==0,v=0;v<d.length;v++){var m,y=d[v],x=y.head,S=e.getRange(x,n(x.line,x.ch+1));if(g&&!y.empty())m="surround";else if(!f&&g||S!=i)if(f&&x.ch>1&&p.indexOf(i)>=0&&e.getRange(n(x.line,x.ch-2),x)==i+i){if(x.ch>2&&/\bstring/.test(e.getTokenTypeAt(n(x.line,x.ch-2))))return t.Pass;m="addFour"}else if(f){var b=0==x.ch?" ":e.getRange(n(x.line,x.ch-1),x);if(t.isWordChar(S)||b==i||t.isWordChar(b))return t.Pass;m="both"}else{if(!g||!(0===S.length||/\s/.test(S)||h.indexOf(S)>-1))return t.Pass;m="both"}else m=f&&u(e,x)?"both":p.indexOf(i)>=0&&e.getRange(x,n(x.line,x.ch+3))==i+i+i?"skipThree":"skip";if(c){if(c!=m)return t.Pass}else c=m}var T=l%2?s.charAt(l-1):i,C=l%2?i:s.charAt(l+1);e.operation((function(){if("skip"==c)e.execCommand("goCharRight");else if("skipThree"==c)for(var r=0;r<3;r++)e.execCommand("goCharRight");else if("surround"==c){var i=e.getSelections();for(r=0;r<i.length;r++)i[r]=T+i[r]+C;for(e.replaceSelections(i,"around"),i=e.listSelections().slice(),r=0;r<i.length;r++)i[r]=(o=i[r],s=void 0,s=t.cmpPos(o.anchor,o.head)>0,{anchor:new n(o.anchor.line,o.anchor.ch+(s?-1:1)),head:new n(o.head.line,o.head.ch+(s?1:-1))});e.setSelections(i)}else"both"==c?(e.replaceSelection(T+C,null),e.triggerElectric(T+C),e.execCommand("goCharLeft")):"addFour"==c&&(e.replaceSelection(T+T+T+T,"before"),e.execCommand("goCharRight"));var o,s}))}(i,e)}}function a(t){var e=t.state.closeBrackets;return!e||e.override?e:t.getModeAt(t.getCursor()).closeBrackets||e}function l(t,e){var r=t.getRange(n(e.line,e.ch-1),n(e.line,e.ch+1));return 2==r.length?r:null}function u(t,e){var r=t.getTokenAt(n(e.line,e.ch+1));return/\bstring/.test(r.type)&&r.start==e.ch&&(0==e.ch||!/\bstring/.test(t.getTokenTypeAt(e)))}o(e.pairs+"`")}(n(34))},function(t,e,n){!function(t){var e=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=t.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(t){return t&&t.bracketRegex||/[(){}[\]]/}function o(t,e,o){var a=t.getLineHandle(e.line),l=e.ch-1,u=o&&o.afterCursor;null==u&&(u=/(^| )cm-fat-cursor($| )/.test(t.getWrapperElement().className));var c=i(o),h=!u&&l>=0&&c.test(a.text.charAt(l))&&r[a.text.charAt(l)]||c.test(a.text.charAt(l+1))&&r[a.text.charAt(++l)];if(!h)return null;var p=">"==h.charAt(1)?1:-1;if(o&&o.strict&&p>0!=(l==e.ch))return null;var f=t.getTokenTypeAt(n(e.line,l+1)),d=s(t,n(e.line,l+(p>0?1:0)),p,f||null,o);return null==d?null:{from:n(e.line,l),to:d&&d.pos,match:d&&d.ch==h.charAt(0),forward:p>0}}function s(t,e,o,s,a){for(var l=a&&a.maxScanLineLength||1e4,u=a&&a.maxScanLines||1e3,c=[],h=i(a),p=o>0?Math.min(e.line+u,t.lastLine()+1):Math.max(t.firstLine()-1,e.line-u),f=e.line;f!=p;f+=o){var d=t.getLine(f);if(d){var g=o>0?0:d.length-1,v=o>0?d.length:-1;if(!(d.length>l))for(f==e.line&&(g=e.ch-(o<0?1:0));g!=v;g+=o){var m=d.charAt(g);if(h.test(m)&&(void 0===s||t.getTokenTypeAt(n(f,g+1))==s)){var y=r[m];if(y&&">"==y.charAt(1)==o>0)c.push(m);else{if(!c.length)return{pos:n(f,g),ch:m};c.pop()}}}}}return f-o!=(o>0?t.lastLine():t.firstLine())&&null}function a(t,r,i){for(var s=t.state.matchBrackets.maxHighlightLineLength||1e3,a=[],l=t.listSelections(),u=0;u<l.length;u++){var c=l[u].empty()&&o(t,l[u].head,i);if(c&&t.getLine(c.from.line).length<=s){var h=c.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";a.push(t.markText(c.from,n(c.from.line,c.from.ch+1),{className:h})),c.to&&t.getLine(c.to.line).length<=s&&a.push(t.markText(c.to,n(c.to.line,c.to.ch+1),{className:h}))}}if(a.length){e&&t.state.focused&&t.focus();var p=function(){t.operation((function(){for(var t=0;t<a.length;t++)a[t].clear()}))};if(!r)return p;setTimeout(p,800)}}function l(t){t.operation((function(){t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null),t.state.matchBrackets.currentlyHighlighted=a(t,!1,t.state.matchBrackets)}))}t.defineOption("matchBrackets",!1,(function(e,n,r){function i(t){t.state.matchBrackets&&t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null)}r&&r!=t.Init&&(e.off("cursorActivity",l),e.off("focus",l),e.off("blur",i),i(e)),n&&(e.state.matchBrackets="object"==typeof n?n:{},e.on("cursorActivity",l),e.on("focus",l),e.on("blur",i))})),t.defineExtension("matchBrackets",(function(){a(this,!0)})),t.defineExtension("findMatchingBracket",(function(t,e,n){return(n||"boolean"==typeof e)&&(n?(n.strict=e,e=n):e=e?{strict:!0}:null),o(this,t,e)})),t.defineExtension("scanForBracket",(function(t,e,n,r){return s(this,t,e,n,r)}))}(n(34))},function(t,e,n){!function(t){"use strict";var e="CodeMirror-activeline-background";function n(t){for(var n=0;n<t.state.activeLines.length;n++)t.removeLineClass(t.state.activeLines[n],"wrap","CodeMirror-activeline"),t.removeLineClass(t.state.activeLines[n],"background",e),t.removeLineClass(t.state.activeLines[n],"gutter","CodeMirror-activeline-gutter")}function r(t,r){for(var i=[],o=0;o<r.length;o++){var s=r[o],a=t.getOption("styleActiveLine");if("object"==typeof a&&a.nonEmpty?s.anchor.line==s.head.line:s.empty()){var l=t.getLineHandleVisualStart(s.head.line);i[i.length-1]!=l&&i.push(l)}}(function(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0})(t.state.activeLines,i)||t.operation((function(){n(t);for(var r=0;r<i.length;r++)t.addLineClass(i[r],"wrap","CodeMirror-activeline"),t.addLineClass(i[r],"background",e),t.addLineClass(i[r],"gutter","CodeMirror-activeline-gutter");t.state.activeLines=i}))}function i(t,e){r(t,e.ranges)}t.defineOption("styleActiveLine",!1,(function(e,o,s){var a=s!=t.Init&&s;o!=a&&(a&&(e.off("beforeSelectionChange",i),n(e),delete e.state.activeLines),o&&(e.state.activeLines=[],r(e,e.listSelections()),e.on("beforeSelectionChange",i)))}))}(n(34))}]]);
  6. //# sourceMappingURL=vendors~main.30b401dc6cf9cde03deb.js.map