![JAR search and dependency download from the Maven repository](/logo.png)
static.yasgui.yasgui.min.js Maven / Gradle / Ivy
(function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this;t.YASGUI=e()}})(function(){var define,module,exports;return function e(t,n,i){function r(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return r(n?n:e)},c,c.exports,e,t,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function r(e){return 3*e.length/4-i(e)}function o(e){var t,n,r,o,s,a=e.length;o=i(e);s=new f(3*a/4-o);n=o>0?a-4:a;var l=0;for(t=0;t>16&255;s[l++]=r>>8&255;s[l++]=255&r}if(2===o){r=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4;s[l++]=255&r}else if(1===o){r=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2;s[l++]=r>>8&255;s[l++]=255&r}return s}function s(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function a(e,t,n){for(var i,r=[],o=t;oc?c:l+s));if(1===i){t=e[n-1];r+=u[t>>2];r+=u[t<<4&63];r+="=="}else if(2===i){t=(e[n-2]<<8)+e[n-1];r+=u[t>>10];r+=u[t>>4&63];r+=u[t<<2&63];r+="="}o.push(r);return o.join("")}n.byteLength=r;n.toByteArray=o;n.fromByteArray=l;for(var u=[],c=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,d=p.length;h>16)+(t>>16)+(n>>16);return i<<16|65535&n}function i(e,t){return e<>>32-t}function r(e,t,r,o,s,a){return n(i(n(n(t,e),n(o,a)),s),r)}function o(e,t,n,i,o,s,a){return r(t&n|~t&i,e,t,o,s,a)}function s(e,t,n,i,o,s,a){return r(t&i|n&~i,e,t,o,s,a)}function a(e,t,n,i,o,s,a){return r(t^n^i,e,t,o,s,a)}function l(e,t,n,i,o,s,a){return r(n^(t|~i),e,t,o,s,a)}function u(e,t){e[t>>5]|=128<>>9<<4)+14]=t;var i,r,u,c,f,p=1732584193,h=-271733879,d=-1732584194,g=271733878;for(i=0;i>5]>>>t%32&255);return n}function f(e){var t,n=[];n[(e.length>>2)-1]=void 0;for(t=0;t>5]|=(255&e.charCodeAt(t/8))<16&&(r=u(r,8*e.length));for(n=0;n<16;n+=1){o[n]=909522486^r[n];s[n]=1549556828^r[n]}i=u(o.concat(f(t)),512+8*t.length);return c(u(s.concat(i),640))}function d(e){var t,n,i="0123456789abcdef",r="";for(n=0;n>>4&15)+i.charAt(15&t)}return r}function g(e){return unescape(encodeURIComponent(e))}function m(e){return p(g(e))}function v(e){return d(m(e))}function y(e,t){return h(g(e),g(t))}function b(e,t){return d(y(e,t))}function x(e,t,n){return t?n?y(t,e):b(t,e):n?m(e):v(e)}"function"==typeof define&&define.amd?define(function(){return x}):"object"==typeof t&&t.exports?t.exports=x:e.md5=x})(this)},{}],3:[function(e,t,n){},{}],4:[function(e,t,n){arguments[4][3][0].apply(n,arguments)},{dup:3}],5:[function(e,t,n){(function(t){"use strict";function i(){try{var e=new Uint8Array(1);e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return 42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}function r(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(r()=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function m(e){+e!=e&&(e=0);return s.alloc(+e)}function v(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Z(e).length;default:if(i)return V(e).length;t=(""+t).toLowerCase();i=!0}}function y(e,t,n){var i=!1;(void 0===t||t<0)&&(t=0);if(t>this.length)return"";(void 0===n||n>this.length)&&(n=this.length);if(n<=0)return"";n>>>=0;t>>>=0;if(n<=t)return"";e||(e="utf8");for(;;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return N(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=!0}}function b(e,t,n){var i=e[t];e[t]=e[n];e[n]=i}function x(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n){i=n;n=0}else n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648);n=+n;isNaN(n)&&(n=r?0:e.length-1);n<0&&(n=e.length+n);if(n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}"string"==typeof t&&(t=s.from(t,i));if(s.isBuffer(t))return 0===t.length?-1:_(e,t,n,i,r);if("number"==typeof t){t=255&t;return s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):_(e,[t],n,i,r)}throw new TypeError("val must be string, number or Buffer")}function _(e,t,n,i,r){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,a=e.length,l=t.length;if(void 0!==i){i=String(i).toLowerCase();if("ucs2"===i||"ucs-2"===i||"utf16le"===i||"utf-16le"===i){if(e.length<2||t.length<2)return-1;s=2;a/=2;l/=2;n/=2}}var u;if(r){var c=-1;for(u=n;ua&&(n=a-l);for(u=n;u>=0;u--){for(var f=!0,p=0;pr&&(i=r)}else i=r;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s239?4:o>223?3:o>191?2:1;if(r+a<=n){var l,u,c,f;switch(a){case 1:o<128&&(s=o);break;case 2:l=e[r+1];if(128===(192&l)){f=(31&o)<<6|63&l;f>127&&(s=f)}break;case 3:l=e[r+1];u=e[r+2];if(128===(192&l)&&128===(192&u)){f=(15&o)<<12|(63&l)<<6|63&u;f>2047&&(f<55296||f>57343)&&(s=f)}break;case 4:l=e[r+1];u=e[r+2];c=e[r+3];if(128===(192&l)&&128===(192&u)&&128===(192&c)){f=(15&o)<<18|(63&l)<<12|(63&u)<<6|63&c;f>65535&&f<1114112&&(s=f)}}}if(null===s){s=65533;a=1}else if(s>65535){s-=65536;i.push(s>>>10&1023|55296);s=56320|1023&s}i.push(s);r+=a}return A(i)}function A(e){var t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);for(var n="",i=0;ii)&&(n=i);for(var r="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,i,r,o){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||te.length)throw new RangeError("Index out of range")}function j(e,t,n,i){t<0&&(t=65535+t+1);for(var r=0,o=Math.min(e.length-n,2);r>>8*(i?r:1-r)}function B(e,t,n,i){t<0&&(t=4294967295+t+1);for(var r=0,o=Math.min(e.length-n,4);r>>8*(i?r:3-r)&255}function q(e,t,n,i,r,o){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(e,t,n,i,r){r||q(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38);Q.write(e,t,n,i,23,4);return n+4}function F(e,t,n,i,r){r||q(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308);Q.write(e,t,n,i,52,8);return n+8}function G(e){e=z(e).replace(te,"");if(e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function z(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function H(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,t){t=t||1/0;for(var n,i=e.length,r=null,o=[],s=0;s55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(t-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189);r=n;continue}n=(r-55296<<10|n-56320)+65536}else r&&(t-=3)>-1&&o.push(239,191,189);r=null;if(n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function W(e){for(var t=[],n=0;n>8;r=n%256;o.push(r);o.push(i)}return o}function Z(e){return X.toByteArray(G(e))}function $(e,t,n,i){for(var r=0;r=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function K(e){return e!==e}var X=e("base64-js"),Q=e("ieee754"),J=e("isarray");n.Buffer=s;n.SlowBuffer=m;n.INSPECT_MAX_BYTES=50;s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i();n.kMaxLength=r();s.poolSize=8192;s._augment=function(e){e.__proto__=s.prototype;return e};s.from=function(e,t,n){return a(null,e,t,n)};if(s.TYPED_ARRAY_SUPPORT){s.prototype.__proto__=Uint8Array.prototype;s.__proto__=Uint8Array;"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})}s.alloc=function(e,t,n){return u(null,e,t,n)};s.allocUnsafe=function(e){return c(null,e)};s.allocUnsafeSlow=function(e){return c(null,e)};s.isBuffer=function(e){return!(null==e||!e._isBuffer)};s.compare=function(e,t){if(!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,r=0,o=Math.min(n,i);r0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");this.length>t&&(e+=" ... ")}return""};s.prototype.compare=function(e,t,n,i,r){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");void 0===t&&(t=0);void 0===n&&(n=e?e.length:0);void 0===i&&(i=0);void 0===r&&(r=this.length);if(t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;t>>>=0;n>>>=0;i>>>=0;r>>>=0;if(this===e)return 0;for(var o=r-i,a=n-t,l=Math.min(o,a),u=this.slice(i,r),c=e.slice(t,n),f=0;fr)&&(n=r);if(e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return E(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return T(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return C(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();o=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ee=4096;s.prototype.slice=function(e,t){var n=this.length;e=~~e;t=void 0===t?n:~~t;if(e<0){e+=n;e<0&&(e=0)}else e>n&&(e=n);if(t<0){t+=n;t<0&&(t=0)}else t>n&&(t=n);t0&&(r*=256);)i+=this[e+--t]*r;return i};s.prototype.readUInt8=function(e,t){t||M(e,1,this.length);return this[e]};s.prototype.readUInt16LE=function(e,t){t||M(e,2,this.length);return this[e]|this[e+1]<<8};s.prototype.readUInt16BE=function(e,t){t||M(e,2,this.length);return this[e]<<8|this[e+1]};s.prototype.readUInt32LE=function(e,t){t||M(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]};s.prototype.readUInt32BE=function(e,t){t||M(e,4,this.length);return 16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])};s.prototype.readIntLE=function(e,t,n){e=0|e;t=0|t;n||M(e,t,this.length);for(var i=this[e],r=1,o=0;++o=r&&(i-=Math.pow(2,8*t));return i};s.prototype.readIntBE=function(e,t,n){e=0|e;t=0|t;n||M(e,t,this.length);for(var i=t,r=1,o=this[e+--i];i>0&&(r*=256);)o+=this[e+--i]*r;r*=128;o>=r&&(o-=Math.pow(2,8*t));return o};s.prototype.readInt8=function(e,t){t||M(e,1,this.length);return 128&this[e]?(255-this[e]+1)*-1:this[e]};s.prototype.readInt16LE=function(e,t){t||M(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n};s.prototype.readInt16BE=function(e,t){t||M(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n};s.prototype.readInt32LE=function(e,t){t||M(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};s.prototype.readInt32BE=function(e,t){t||M(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};s.prototype.readFloatLE=function(e,t){t||M(e,4,this.length);return Q.read(this,e,!0,23,4)};s.prototype.readFloatBE=function(e,t){t||M(e,4,this.length);return Q.read(this,e,!1,23,4)};s.prototype.readDoubleLE=function(e,t){t||M(e,8,this.length);return Q.read(this,e,!0,52,8)};s.prototype.readDoubleBE=function(e,t){t||M(e,8,this.length);return Q.read(this,e,!1,52,8)};s.prototype.writeUIntLE=function(e,t,n,i){e=+e;t=0|t;n=0|n;if(!i){var r=Math.pow(2,8*n)-1;D(this,e,t,n,r,0)}var o=1,s=0;this[t]=255&e;for(;++s=0&&(s*=256);)this[t+o]=e/s&255;return t+n};s.prototype.writeUInt8=function(e,t,n){e=+e;t=0|t;n||D(this,e,t,1,255,0);s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e));this[t]=255&e;return t+1};s.prototype.writeUInt16LE=function(e,t,n){e=+e;t=0|t;n||D(this,e,t,2,65535,0);if(s.TYPED_ARRAY_SUPPORT){this[t]=255&e;this[t+1]=e>>>8}else j(this,e,t,!0);return t+2};s.prototype.writeUInt16BE=function(e,t,n){e=+e;t=0|t;n||D(this,e,t,2,65535,0);if(s.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=255&e}else j(this,e,t,!1);return t+2};s.prototype.writeUInt32LE=function(e,t,n){e=+e;t=0|t;n||D(this,e,t,4,4294967295,0);if(s.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=255&e}else B(this,e,t,!0);return t+4};s.prototype.writeUInt32BE=function(e,t,n){e=+e;t=0|t;n||D(this,e,t,4,4294967295,0);if(s.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=255&e}else B(this,e,t,!1);return t+4};s.prototype.writeIntLE=function(e,t,n,i){e=+e;t=0|t;if(!i){var r=Math.pow(2,8*n-1);D(this,e,t,n,r-1,-r)}var o=0,s=1,a=0;this[t]=255&e;for(;++o>0)-a&255}return t+n};s.prototype.writeIntBE=function(e,t,n,i){e=+e;t=0|t;if(!i){var r=Math.pow(2,8*n-1);D(this,e,t,n,r-1,-r)}var o=n-1,s=1,a=0;this[t+o]=255&e;for(;--o>=0&&(s*=256);){e<0&&0===a&&0!==this[t+o+1]&&(a=1);this[t+o]=(e/s>>0)-a&255}return t+n};s.prototype.writeInt8=function(e,t,n){e=+e;t=0|t;n||D(this,e,t,1,127,-128);s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e));e<0&&(e=255+e+1);this[t]=255&e;return t+1};s.prototype.writeInt16LE=function(e,t,n){e=+e;t=0|t;n||D(this,e,t,2,32767,-32768);if(s.TYPED_ARRAY_SUPPORT){this[t]=255&e;this[t+1]=e>>>8}else j(this,e,t,!0);return t+2};s.prototype.writeInt16BE=function(e,t,n){e=+e;t=0|t;n||D(this,e,t,2,32767,-32768);if(s.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=255&e}else j(this,e,t,!1);return t+2};s.prototype.writeInt32LE=function(e,t,n){e=+e;t=0|t;n||D(this,e,t,4,2147483647,-2147483648);if(s.TYPED_ARRAY_SUPPORT){this[t]=255&e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else B(this,e,t,!0);return t+4};s.prototype.writeInt32BE=function(e,t,n){e=+e;t=0|t;n||D(this,e,t,4,2147483647,-2147483648);e<0&&(e=4294967295+e+1);if(s.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=255&e}else B(this,e,t,!1);return t+4};s.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)};s.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)};s.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)};s.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)};s.prototype.copy=function(e,t,n,i){n||(n=0);i||0===i||(i=this.length);t>=e.length&&(t=e.length);t||(t=0);i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length);e.length-t=0;--r)e[r+t]=this[r+n];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0;n=void 0===n?this.length:n>>>0;e||(e=0);var o;if("number"==typeof e)for(o=t;o=0&&a[o.text.charAt(l)]||a[o.text.charAt(++l)];if(!u)return null;var c=">"==u.charAt(1)?1:-1;if(i&&c>0!=(l==t.ch))return null;var f=e.getTokenTypeAt(s(t.line,l+1)),p=n(e,s(t.line,l+(c>0?1:0)),c,f||null,r);return null==p?null:{from:s(t.line,l),to:p&&p.pos,match:p&&p.ch==u.charAt(0),forward:c>0}}function n(e,t,n,i,r){for(var o=r&&r.maxScanLineLength||1e4,l=r&&r.maxScanLines||1e3,u=[],c=r&&r.bracketRegex?r.bracketRegex:/[(){}[\]]/,f=n>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),p=t.line;p!=f;p+=n){var h=e.getLine(p);if(h){var d=n>0?0:h.length-1,g=n>0?h.length:-1;if(!(h.length>o)){p==t.line&&(d=t.ch-(n<0?1:0));for(;d!=g;d+=n){var m=h.charAt(d);if(c.test(m)&&(void 0===i||e.getTokenTypeAt(s(p,d+1))==i)){var v=a[m];if(">"==v.charAt(1)==n>0)u.push(m);else{if(!u.length)return{pos:s(p,d),ch:m};u.pop()}}}}}}return p-n!=(n>0?e.lastLine():e.firstLine())&&null}function i(e,n,i){for(var r=e.state.matchBrackets.maxHighlightLineLength||1e3,a=[],l=e.listSelections(),u=0;u",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;e.defineOption("matchBrackets",!1,function(t,n,i){i&&i!=e.Init&&t.off("cursorActivity",r);if(n){t.state.matchBrackets="object"==typeof n?n:{};t.on("cursorActivity",r)}});e.defineExtension("matchBrackets",function(){i(this,!0)});e.defineExtension("findMatchingBracket",function(e,n,i){return t(this,e,n,i)});e.defineExtension("scanForBracket",function(e,t,i,r){return n(this,e,t,i,r)})})},{"../../lib/codemirror":17}],10:[function(e,t,n){(function(i){"object"==typeof n&&"object"==typeof t?i(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],i):i(CodeMirror)})(function(e){"use strict";e.registerHelper("fold","brace",function(t,n){function i(i){for(var a=n.ch,l=0;;){var u=a<=0?-1:s.lastIndexOf(i,a-1);if(u!=-1){if(1==l&&ut.lastLine())return null;var i=t.getTokenAt(e.Pos(n,1));/\S/.test(i.string)||(i=t.getTokenAt(e.Pos(n,i.end+1)));if("keyword"!=i.type||"import"!=i.string)return null;for(var r=n,o=Math.min(t.lastLine(),n+10);r<=o;++r){var s=t.getLine(r),a=s.indexOf(";");if(a!=-1)return{startCh:i.end,end:e.Pos(r,a)}}}var r,o=n.line,s=i(o);if(!s||i(o-1)||(r=i(o-2))&&r.end.line==o-1)return null;for(var a=s.end;;){var l=i(a.line+1);if(null==l)break;a=l.end}return{from:t.clipPos(e.Pos(o,s.startCh+1)),to:a}});e.registerHelper("fold","include",function(t,n){function i(n){if(nt.lastLine())return null;var i=t.getTokenAt(e.Pos(n,1));/\S/.test(i.string)||(i=t.getTokenAt(e.Pos(n,i.end+1)));return"meta"==i.type&&"#include"==i.string.slice(0,8)?i.start+8:void 0}var r=n.line,o=i(r);if(null==o||null!=i(r-1))return null;for(var s=r;;){var a=i(s+1);if(null==a)break;++s}return{from:e.Pos(r,o+1),to:t.clipPos(e.Pos(s))}})})},{"../../lib/codemirror":17}],11:[function(e,t,n){(function(i){"object"==typeof n&&"object"==typeof t?i(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],i):i(CodeMirror)})(function(e){"use strict";function t(t,r,o,s){function a(e){var n=l(t,r);if(!n||n.to.line-n.from.linet.firstLine();){r=e.Pos(r.line-1,0);c=a(!1)}if(c&&!c.cleared&&"unfold"!==s){var f=n(t,o);e.on(f,"mousedown",function(t){p.clear();e.e_preventDefault(t)});var p=t.markText(c.from,c.to,{replacedWith:f,clearOnEnter:i(t,o,"clearOnEnter"),__isFold:!0});p.on("clear",function(n,i){e.signal(t,"unfold",t,n,i)});e.signal(t,"fold",t,c.from,c.to)}}function n(e,t){var n=i(e,t,"widget");if("string"==typeof n){var r=document.createTextNode(n);n=document.createElement("span");n.appendChild(r);n.className="CodeMirror-foldmarker"}return n}function i(e,t,n){if(t&&void 0!==t[n])return t[n];var i=e.options.foldOptions;return i&&void 0!==i[n]?i[n]:r[n]}e.newFoldFunction=function(e,n){return function(i,r){t(i,r,{rangeFinder:e,widget:n})}};e.defineExtension("foldCode",function(e,n,i){t(this,e,n,i)});e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),n=0;n=a&&(n=r(o.indicatorOpen))}e.setGutterMarker(t,o.gutter,n);++s})}function s(e){var t=e.getViewport(),n=e.state.foldGutter;if(n){e.operation(function(){o(e,t.from,t.to)});n.from=t.from;n.to=t.to}}function a(e,t,n){var r=e.state.foldGutter;if(r){var o=r.options;if(n==o.gutter){var s=i(e,t);s?s.clear():e.foldCode(f(t,0),o.rangeFinder)}}}function l(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0;clearTimeout(t.changeUpdate);t.changeUpdate=setTimeout(function(){s(e)},n.foldOnChangeTimeSpan||600)}}function u(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate);t.changeUpdate=setTimeout(function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?s(e):e.operation(function(){if(n.fromt.to){o(e,t.to,n.to);t.to=n.to}})},n.updateViewportTimeSpan||400)}}function c(e,t){var n=e.state.foldGutter;if(n){var i=t.line;i>=n.from&&i=e.max)){e.ch=0;e.text=e.cm.getLine(++e.line);return!0}}function o(e){if(!(e.line<=e.min)){e.text=e.cm.getLine(--e.line);e.ch=e.text.length;return!0}}function s(e){for(;;){var t=e.text.indexOf(">",e.ch);if(t==-1){if(r(e))continue;return}if(i(e,t+1)){var n=e.text.lastIndexOf("/",t),o=n>-1&&!/\S/.test(e.text.slice(n+1,t));e.ch=t+1;return o?"selfClose":"regular"}e.ch=t+1}}function a(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(t==-1){if(o(e))continue;return}if(i(e,t+1)){g.lastIndex=t;e.ch=t;var n=g.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function l(e){for(;;){g.lastIndex=e.ch;var t=g.exec(e.text);if(!t){if(r(e))continue;return}if(i(e,t.index+1)){e.ch=t.index+t[0].length;return t}e.ch=t.index+1}}function u(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(t==-1){if(o(e))continue;return}if(i(e,t+1)){var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));e.ch=t+1;return r?"selfClose":"regular"}e.ch=t}}function c(e,t){for(var n=[];;){var i,r=l(e),o=e.line,a=e.ch-(r?r[0].length:0);if(!r||!(i=s(e)))return;if("selfClose"!=i)if(r[1]){for(var u=n.length-1;u>=0;--u)if(n[u]==r[2]){n.length=u;break}if(u<0&&(!t||t==r[2]))return{tag:r[2],from:p(o,a),to:p(e.line,e.ch)}}else n.push(r[2])}}function f(e,t){for(var n=[];;){var i=u(e);if(!i)return;if("selfClose"!=i){var r=e.line,o=e.ch,s=a(e);if(!s)return;if(s[1])n.push(s[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==s[2]){n.length=l;break}if(l<0&&(!t||t==s[2]))return{tag:s[2],from:p(e.line,e.ch),to:p(r,o)}}}else a(e)}}var p=e.Pos,h="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",d=h+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",g=new RegExp("<(/?)(["+h+"]["+d+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var i=new n(e,t.line,0);;){var r,o=l(i);if(!o||i.line!=t.line||!(r=s(i)))return;if(!o[1]&&"selfClose"!=r){var a=p(i.line,i.ch),u=c(i,o[2]);return u&&{from:a,to:u.from}}}});e.findMatchingTag=function(e,i,r){var o=new n(e,i.line,i.ch,r);if(o.text.indexOf(">")!=-1||o.text.indexOf("<")!=-1){var l=s(o),u=l&&p(o.line,o.ch),h=l&&a(o);if(l&&h&&!(t(o,i)>0)){var d={from:p(o.line,o.ch),to:u,tag:h[2]};if("selfClose"==l)return{open:d,close:null,at:"open"};if(h[1])return{open:f(o,h[2]),close:d,at:"close"};o=new n(e,u.line,u.ch,r);return{open:d,close:c(o,h[2]),at:"open"}}}};e.findEnclosingTag=function(e,t,i){for(var r=new n(e,t.line,t.ch,i);;){var o=f(r);if(!o)break;var s=new n(e,t.line,t.ch,i),a=c(s,o.tag);if(a)return{open:o,close:a}}};e.scanForClosingTag=function(e,t,i,r){var o=new n(e,t.line,t.ch,r?{from:0,to:r}:null);return c(o,i)}})},{"../../lib/codemirror":17}],14:[function(e,t,n){(function(i){"object"==typeof n&&"object"==typeof t?i(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],i):i(CodeMirror)})(function(e){"use strict";function t(e,t){this.cm=e;this.options=t;this.widget=null;this.debounce=0;this.tick=0;this.startPos=this.cm.getCursor("start");this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}function n(t,n){var i=e.cmpPos(n.from,t.from);return i>0&&t.to.ch-t.from.ch!=n.to.ch-n.from.ch}function i(e,t,n){var i=e.options.hintOptions,r={};for(var o in g)r[o]=g[o];if(i)for(var o in i)void 0!==i[o]&&(r[o]=i[o]);if(n)for(var o in n)void 0!==n[o]&&(r[o]=n[o]);r.hint.resolve&&(r.hint=r.hint.resolve(e,t));return r}function r(e){return"string"==typeof e?e:e.text}function o(e,t){function n(e,n){var r;r="string"!=typeof n?function(e){return n(e,t)}:i.hasOwnProperty(n)?i[n]:n;o[e]=r}var i={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(-t.menuSize()+1,!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close},r=e.options.customKeys,o=r?{}:i;if(r)for(var s in r)r.hasOwnProperty(s)&&n(s,r[s]);var a=e.options.extraKeys;if(a)for(var s in a)a.hasOwnProperty(s)&&n(s,a[s]);return o}function s(e,t){for(;t&&t!=e;){if("LI"===t.nodeName.toUpperCase()&&t.parentNode==e)return t;t=t.parentNode}}function a(t,n){this.completion=t;this.data=n;this.picked=!1;var i=this,a=t.cm,l=this.hints=document.createElement("ul");l.className="CodeMirror-hints";this.selectedHint=n.selectedHint||0;for(var u=n.list,c=0;cl.clientHeight+1,S=a.getScrollInfo();if(w>0){var C=E.bottom-E.top,L=m.top-(m.bottom-E.top);if(L-C>0){l.style.top=(y=m.top-C)+"px";b=!1}else if(C>_){l.style.height=_-5+"px";l.style.top=(y=m.bottom-E.top)+"px";var N=a.getCursor();if(n.from.ch!=N.ch){m=a.cursorCoords(N);l.style.left=(v=m.left)+"px";E=l.getBoundingClientRect()}}}var I=E.right-x;if(I>0){if(E.right-E.left>x){l.style.width=x-5+"px";I-=E.right-E.left-x}l.style.left=(v=m.left-I)+"px"}if(T)for(var A=l.firstChild;A;A=A.nextSibling)A.style.paddingRight=a.display.nativeBarWidth+"px";a.addKeyMap(this.keyMap=o(t,{moveFocus:function(e,t){i.changeActive(i.selectedHint+e,t)},setFocus:function(e){i.changeActive(e)},menuSize:function(){return i.screenAmount()},length:u.length,close:function(){t.close()},pick:function(){i.pick()},data:n}));if(t.options.closeOnUnfocus){var R;a.on("blur",this.onBlur=function(){R=setTimeout(function(){t.close()},100)});a.on("focus",this.onFocus=function(){clearTimeout(R)})}a.on("scroll",this.onScroll=function(){var e=a.getScrollInfo(),n=a.getWrapperElement().getBoundingClientRect(),i=y+S.top-e.top,r=i-(window.pageYOffset||(document.documentElement||document.body).scrollTop);b||(r+=l.offsetHeight);if(r<=n.top||r>=n.bottom)return t.close();l.style.top=i+"px";l.style.left=v+S.left-e.left+"px"});e.on(l,"dblclick",function(e){var t=s(l,e.target||e.srcElement);if(t&&null!=t.hintId){i.changeActive(t.hintId);i.pick()}});e.on(l,"click",function(e){var n=s(l,e.target||e.srcElement);if(n&&null!=n.hintId){i.changeActive(n.hintId);t.options.completeOnSingleClick&&i.pick()}});e.on(l,"mousedown",function(){setTimeout(function(){a.focus()},20)});e.signal(n,"select",u[0],l.firstChild);return!0}function l(e,t){if(!e.somethingSelected())return t;for(var n=[],i=0;i0?t(e):i(r+1)})}var o=l(e,r);i(0)};o.async=!0;o.supportsSelection=!0;return o}return(i=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:i})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}var f="CodeMirror-hint",p="CodeMirror-hint-active";e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var i={hint:t};if(n)for(var r in n)i[r]=n[r];return e.showHint(i)};e.defineExtension("showHint",function(n){n=i(this,this.getCursor("start"),n);var r=this.listSelections();if(!(r.length>1)){if(this.somethingSelected()){if(!n.hint.supportsSelection)return;for(var o=0;o=this.data.list.length?t=n?this.data.list.length-1:0:t<0&&(t=n?0:this.data.list.length-1);if(this.selectedHint!=t){var i=this.hints.childNodes[this.selectedHint];i.className=i.className.replace(" "+p,"");i=this.hints.childNodes[this.selectedHint=t];i.className+=" "+p;i.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=i.offsetTop+i.offsetHeight-this.hints.clientHeight+3);e.signal(this.data,"select",this.data.list[this.selectedHint],i)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}};e.registerHelper("hint","auto",{resolve:c});e.registerHelper("hint","fromList",function(t,n){var i=t.getCursor(),r=t.getTokenAt(i),o=e.Pos(i.line,r.end);if(r.string&&/\w/.test(r.string[r.string.length-1]))var s=r.string,a=e.Pos(i.line,r.start);else var s="",a=o;for(var l=[],u=0;u,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)})},{"../../lib/codemirror":17}],15:[function(e,t,n){(function(i){"object"==typeof n&&"object"==typeof t?i(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],i):i(CodeMirror)})(function(e){"use strict";e.runMode=function(t,n,i,r){var o=e.getMode(e.defaults,n),s=/MSIE \d/.test(navigator.userAgent),a=s&&(null==document.documentMode||document.documentMode<9);if(i.appendChild){var l=r&&r.tabSize||e.defaults.tabSize,u=i,c=0;u.innerHTML="";i=function(e,t){if("\n"!=e){for(var n="",i=0;;){var r=e.indexOf("\t",i);if(r==-1){n+=e.slice(i);c+=e.length-i;break}c+=r-i;n+=e.slice(i,r);var o=l-c%l;c+=o;for(var s=0;s-1){c=n(l,u,c);return{from:i(o.line,c),to:i(o.line,c+s.length)}}}else{var l=e.getLine(o.line).slice(o.ch),u=a(l),c=u.indexOf(t);if(c>-1){c=n(l,u,c)+o.ch;return{from:i(o.line,c),to:i(o.line,c+s.length)}}}}:this.matches=function(){};else{var u=s.split("\n");this.matches=function(t,n){var r=l.length-1;if(t){if(n.line-(l.length-1)=1;--c,--s)if(l[c]!=a(e.getLine(s)))return;var f=e.getLine(s),p=f.length-u[0].length;if(a(f.slice(p))!=l[0])return;return{from:i(s,p),to:o}}if(!(n.line+(l.length-1)>e.lastLine())){var f=e.getLine(n.line),p=f.length-u[0].length;if(a(f.slice(p))==l[0]){for(var h=i(n.line,p),s=n.line+1,c=1;cn))return i;--i}}}var i=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=i(e,0);n.pos={from:t,to:t};n.atOccurrence=!1;return!1}for(var n=this,r=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,r)){this.atOccurrence=!0;return this.pos.match||!0}if(e){if(!r.line)return t(0);r=i(r.line-1,this.doc.getLine(r.line-1).length)}else{var o=this.doc.lineCount();if(r.line==o-1)return t(o);r=i(r.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var r=e.splitLines(t);this.doc.replaceRange(r,this.pos.from,this.pos.to,n);this.pos.to=i(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}};e.defineExtension("getSearchCursor",function(e,n,i){return new t(this.doc,e,n,i)});e.defineDocExtension("getSearchCursor",function(e,n,i){return new t(this,e,n,i)});e.defineExtension("selectMatches",function(t,n){for(var i=[],r=this.getSearchCursor(t,this.getCursor("from"),n);r.findNext()&&!(e.cmpPos(r.to(),this.getCursor("to"))>0);)i.push({anchor:r.from(),head:r.to()});i.length&&this.setSelections(i,0)})})},{"../../lib/codemirror":17}],17:[function(e,t,n){(function(e){if("object"==typeof n&&"object"==typeof t)t.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);(this||window).CodeMirror=e()}})(function(){"use strict";function e(n,i){if(!(this instanceof e))return new e(n,i);this.options=i=i?Br(i):{};Br(ts,i,!1);h(i);var r=i.value;"string"==typeof r&&(r=new Ss(r,i.mode,null,i.lineSeparator));this.doc=r;var o=new e.inputStyles[i.inputStyle](this),s=this.display=new t(n,r,o);s.wrapper.CodeMirror=this;u(this);a(this);i.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");i.autofocus&&!Ao&&s.input.focus();v(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 Rr,keySeq:null,specialChars:null};var l=this;xo&&_o<11&&setTimeout(function(){l.display.input.reset(!0)},20);zt(this);Kr();_t(this);this.curOp.forceUpdate=!0;Xi(this,r);i.autofocus&&!Ao||l.hasFocus()?setTimeout(qr(yn,this),20):bn(this);for(var c in ns)ns.hasOwnProperty(c)&&ns[c](this,i[c],is);E(this);i.finishInit&&i.finishInit(this);for(var f=0;ft.maxLineLength){t.maxLineLength=n;t.maxLine=e}})}function h(e){var t=kr(e.gutters,"CodeMirror-linenumbers");if(t==-1&&e.lineNumbers)e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]);else if(t>-1&&!e.lineNumbers){e.gutters=e.gutters.slice(0);e.gutters.splice(t,1)}}function d(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+He(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+We(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function g(e,t,n){this.cm=n;var i=this.vert=zr("div",[zr("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=zr("div",[zr("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i);e(r);Rs(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")});Rs(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")});this.checkedZeroWidth=!1;xo&&_o<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function m(){}function v(t){if(t.display.scrollbars){t.display.scrollbars.clear();t.display.scrollbars.addClass&&Qs(t.display.wrapper,t.display.scrollbars.addClass)}t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller);Rs(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)});e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?sn(t,e):on(t,e)},t);t.display.scrollbars.addClass&&Js(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=d(e));var n=e.display.barWidth,i=e.display.barHeight;b(e,t);for(var r=0;r<4&&n!=e.display.barWidth||i!=e.display.barHeight;r++){n!=e.display.barWidth&&e.options.lineWrapping&&R(e);b(e,d(e));n=e.display.barWidth;i=e.display.barHeight}}function b(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px";n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px";n.heightForcer.style.borderBottom=i.bottom+"px solid transparent";if(i.right&&i.bottom){n.scrollbarFiller.style.display="block";n.scrollbarFiller.style.height=i.bottom+"px";n.scrollbarFiller.style.width=i.right+"px"}else n.scrollbarFiller.style.display="";if(i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter){n.gutterFiller.style.display="block";n.gutterFiller.style.height=i.bottom+"px";n.gutterFiller.style.width=t.gutterWidth+"px"}else n.gutterFiller.style.display=""}function x(e,t,n){var i=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;i=Math.floor(i-ze(e));var r=n&&null!=n.bottom?n.bottom:i+e.wrapper.clientHeight,o=ir(t,i),s=ir(t,r);if(n&&n.ensure){var a=n.ensure.from.line,l=n.ensure.to.line;if(a=s){o=ir(t,rr(Qi(t,l))-e.wrapper.clientHeight);s=l}}return{from:o,to:Math.max(s,o+1)}}function _(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=T(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,o=i+"px",s=0;s=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Gt(e))return!1;if(E(e)){Bt(e);t.dims=P(e)}var r=i.first+i.size,o=Math.max(t.visible.from-e.options.viewportMargin,i.first),s=Math.min(r,t.visible.to+e.options.viewportMargin);n.viewFroms&&n.viewTo-s<20&&(s=Math.min(r,n.viewTo));if(Bo){o=_i(e.doc,o);s=Ei(e.doc,s)}var a=o!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Ft(e,o,s);n.viewOffset=rr(Qi(e.doc,n.viewFrom));e.display.mover.style.top=n.viewOffset+"px";var l=Gt(e);if(!a&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=Wr();l>4&&(n.lineDiv.style.display="none");k(e,n.updateLineNumbers,t.dims);l>4&&(n.lineDiv.style.display="");n.renderedView=n.view;u&&Wr()!=u&&u.offsetHeight&&u.focus();Hr(n.cursorDiv);Hr(n.selectionDiv);n.gutters.style.height=n.sizer.style.minHeight=0;if(a){n.lastWrapHeight=t.wrapperHeight;n.lastWrapWidth=t.wrapperWidth;qe(e,400)}n.updateLineNumbers=null;return!0}function N(e,t){for(var n=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==Ye(e)){n&&null!=n.top&&(n={top:Math.min(e.doc.height+He(e.display)-Ze(e),n.top)});t.visible=x(e.display,e.doc,n);if(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}if(!L(e,t))break;R(e);var r=d(e);ke(e);y(e,r);A(e,r)}t.signal(e,"update",e);if(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo){t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo);e.display.reportedViewFrom=e.display.viewFrom;e.display.reportedViewTo=e.display.viewTo}}function I(e,t){var n=new S(e,t);if(L(e,n)){R(e);N(e,n);var i=d(e);ke(e);y(e,i);A(e,i);n.finish()}}function A(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";e.display.heightForcer.style.top=t.docHeight+"px";e.display.gutters.style.height=t.docHeight+e.display.barHeight+We(e)+"px"}function R(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i.001||l<-.001){tr(o.line,r);O(o.line);if(o.rest)for(var u=0;u-1&&(p=!1);M(e,f,u,n)}if(p){Hr(f.lineNumber);f.lineNumber.appendChild(document.createTextNode(w(e.options,u)))}a=f.node.nextSibling}else{var h=z(e,f,u,n);s.insertBefore(h,a)}u+=f.size}for(;a;)a=i(a)}function M(e,t,n,i){for(var r=0;r1)if(Fo&&Fo.text.join("\n")==t){if(i.ranges.length%Fo.text.length==0){l=[];for(var u=0;u=0;u--){var c=i.ranges[u],f=c.from(),p=c.to();c.empty()&&(n&&n>0?f=qo(f.line,f.ch-n):e.state.overwrite&&!s?p=qo(p.line,Math.min(Qi(o,p.line).text.length,p.ch+Pr(a).length)):Fo&&Fo.lineWise&&Fo.text.join("\n")==t&&(f=p=qo(f.line,0)));var h=e.curOp.updateInput,d={from:f,to:p,text:l?l[u%l.length]:a,origin:r||(s?"paste":e.state.cutIncoming?"cut":"+input")};Ln(e.doc,d);Sr(e,"inputRead",e,d)}t&&!s&&J(e,t);qn(e);e.curOp.updateInput=h;e.curOp.typing=!0;e.state.pasteIncoming=e.state.cutIncoming=!1}function Q(e,t){var n=e.clipboardData&&e.clipboardData.getData("text/plain");if(n){e.preventDefault();t.isReadOnly()||t.options.disableInput||At(t,function(){X(t,n,0,null,"paste")});return!0}}function J(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=e.getModeAt(r.head),s=!1;if(o.electricChars){for(var a=0;a-1){s=Fn(e,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Qi(e.doc,r.head.line).text.slice(0,r.head.ch))&&(s=Fn(e,r.head.line,"smart"));s&&Sr(e,"electricInput",e,r.head.line)}}}function ee(e){for(var t=[],n=[],i=0;i=0){var s=$(o.from(),r.from()),a=Z(o.to(),r.to()),l=o.empty()?r.from()==r.head:o.from()==o.head;i<=t&&--t;e.splice(--i,2,new fe(l?a:s,l?s:a))}}return new ce(e,t)}function he(e,t){return new ce([new fe(e,t||e)],0)}function de(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ge(e,t){if(t.linen?qo(n,Qi(e,n).text.length):me(t,Qi(e,t.line).text.length)}function me(e,t){var n=e.ch;return null==n||n>t?qo(e.line,t):n<0?qo(e.line,0):e}function ve(e,t){return t>=e.first&&t=t.ch:a.to>t.ch))){if(r){ks(l,"beforeCursorEnter");if(l.explicitlyCleared){if(o.markedSpans){--s;continue}break}}if(!l.atomic)continue;if(n){var u,c=l.find(i<0?1:-1);(i<0?l.inclusiveRight:l.inclusiveLeft)&&(c=Pe(e,c,-i,c&&c.line==t.line?o:null));if(c&&c.line==t.line&&(u=Uo(c,n))&&(i<0?u<0:u>0))return Re(e,c,t,i,r)}var f=l.find(i<0?-1:1);(i<0?l.inclusiveLeft:l.inclusiveRight)&&(f=Pe(e,f,i,f.line==t.line?o:null));return f?Re(e,f,t,i,r):null}}return t}function Oe(e,t,n,i,r){var o=i||1,s=Re(e,t,n,o,r)||!r&&Re(e,t,n,o,!0)||Re(e,t,n,-o,r)||!r&&Re(e,t,n,-o,!0);if(!s){e.cantEdit=!0;return qo(e.first,0)}return s}function Pe(e,t,n,i){return n<0&&0==t.ch?t.line>e.first?ge(e,qo(t.line-1)):null:n>0&&t.ch==(i||Qi(e,t.line)).text.length?t.line=e.display.viewTo||a.to().line3){i(h,g.top,null,g.bottom);h=u;g.bottoml.bottom||f.bottom==l.bottom&&f.right>l.right)&&(l=f);h0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function qe(e,t){e.doc.mode.startState&&e.doc.frontier=e.display.viewTo)){var n=+new Date+e.options.workTime,i=us(t.mode,Ge(e,t.frontier)),r=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var s=o.styles,a=o.text.length>e.options.maxHighlightLength,l=Mi(e,o,a?us(t.mode,i):i,!0);o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var f=!s||s.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),p=0;!f&&pn){qe(e,e.options.workDelay);return!0}});r.length&&At(e,function(){for(var t=0;ts;--a){if(a<=o.first)return o.first;var l=Qi(o,a-1);if(l.stateAfter&&(!n||a<=o.frontier))return a;var u=Fs(l.text,null,e.options.tabSize);if(null==r||i>u){r=a-1;i=u}}return r}function Ge(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return!0;var o=Fe(e,t,n),s=o>i.first&&Qi(i,o-1).stateAfter;s=s?us(i.mode,s):cs(i.mode);i.iter(o,t,function(n){ji(e,n.text,s);var a=o==t-1||o%5==0||o>=r.viewFrom&&o2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ke(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;in)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Xe(e,t){t=bi(t);var n=nr(t),i=e.display.externalMeasured=new kt(e.doc,t,n);i.lineN=n;var r=i.built=qi(e,i);i.text=r.pre;Vr(e.display.lineMeasure,r.pre);return i}function Qe(e,t,n,i){return tt(e,et(e,t),n,i)}function Je(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt){o=u-l;r=o-1;t>=u&&(s="right")}if(null!=r){i=e[a+2];l==u&&n==(i.insertLeft?"left":"right")&&(s=n);if("left"==n&&0==r)for(;a&&e[a-2]==e[a-3]&&e[a-1].insertLeft;){i=e[(a-=3)+2];s="left"}if("right"==n&&r==u-l)for(;a=0&&(n=e[i]).left==n.right;i--);return n}function rt(e,t,n,i){var r,o=nt(t.map,n,i),s=o.node,a=o.start,l=o.end,u=o.collapse;if(3==s.nodeType){for(var c=0;c<4;c++){for(;a&&Gr(t.line.text.charAt(o.coverStart+a));)--a;for(;o.coverStart+l0&&(u=i="right");var f;r=e.options.lineWrapping&&(f=s.getClientRects()).length>1?f["right"==i?f.length-1:0]:s.getBoundingClientRect()}if(xo&&_o<9&&!a&&(!r||!r.left&&!r.right)){var p=s.parentNode.getClientRects()[0];r=p?{left:p.left,right:p.left+xt(e.display),top:p.top,bottom:p.bottom}:Vo}for(var h=r.top-t.rect.top,d=r.bottom-t.rect.top,g=(h+d)/2,m=t.view.measure.heights,c=0;cn.from?s(e-1):s(e,i)}i=i||Qi(e.doc,t.line);r||(r=et(e,i));var l=or(i),u=t.ch;if(!l)return s(u);var c=co(l,u),f=a(u,c);null!=aa&&(f.other=a(u,aa));return f}function gt(e,t){var n=0,t=ge(e.doc,t);e.options.lineWrapping||(n=xt(e.display)*t.ch);var i=Qi(e.doc,t.line),r=rr(i)+ze(e.display);return{left:n,right:n,top:r,bottom:r+i.height}}function mt(e,t,n,i){var r=qo(e,t);r.xRel=i;n&&(r.outside=!0);return r}function vt(e,t,n){var i=e.doc;n+=e.display.viewOffset;if(n<0)return mt(i.first,0,!0,-1);var r=ir(i,n),o=i.first+i.size-1;if(r>o)return mt(i.first+i.size-1,Qi(i,o).text.length,!0,1);t<0&&(t=0);for(var s=Qi(i,r);;){var a=yt(e,s,r,t,n),l=vi(s),u=l&&l.find(0,!0);if(!l||!(a.ch>u.from.ch||a.ch==u.from.ch&&a.xRel>0))return a;r=nr(s=u.to.line)}}function yt(e,t,n,i,r){function o(i){var r=dt(e,qo(n,i),"line",t,u);a=!0;if(s>r.bottom)return r.left-l;if(sm)return mt(n,h,v,1);for(;;){if(c?h==p||h==po(t,p,1):h-p<=1){var y=i0&&y1){var _=tt(e,u,y,"right");if(s<=_.bottom&&s>=_.top&&Math.abs(i-_.right)1?1:0);return E}var w=Math.ceil(f/2),T=p+w;if(c){T=p;for(var S=0;Si){h=T;m=C;(v=a)&&(m+=1e3);f=w}else{p=T;d=C;g=a;f-=w}}}function bt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Go){Go=zr("pre");for(var t=0;t<49;++t){Go.appendChild(document.createTextNode("x"));Go.appendChild(zr("br"))}Go.appendChild(document.createTextNode("x"))}Vr(e.measure,Go);var n=Go.offsetHeight/50;n>3&&(e.cachedTextHeight=n);Hr(e.measure);return n||1}function xt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=zr("span","xxxxxxxxxx"),n=zr("pre",[t]);Vr(e.measure,n);var i=t.getBoundingClientRect(),r=(i.right-i.left)/10;r>2&&(e.cachedCharWidth=r);return r||10}function _t(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Yo};Wo?Wo.ops.push(e.curOp):e.curOp.ownsGroup=Wo={ops:[e.curOp],delayedCallbacks:[]}}function Et(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping;e.update=e.mustUpdate&&new S(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ct(e){e.updatedDisplay=e.mustUpdate&&L(e.cm,e.update)}function Lt(e){var t=e.cm,n=t.display;e.updatedDisplay&&R(t);e.barMeasure=d(t);if(n.maxLineChanged&&!t.options.lineWrapping){e.adjustWidthTo=Qe(t,n.maxLine,n.maxLine.text.length).left+3;t.display.sizerWidth=e.adjustWidthTo;e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+We(t)+t.display.barWidth);e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ye(t))}(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection(e.focus))}function Nt(e){var t=e.cm;if(null!=e.adjustWidthTo){t.display.sizer.style.minWidth=e.adjustWidthTo+"px";e.maxScrollLeftt)&&(r.updateLineNumbers=t);e.curOp.viewChanged=!0;if(t>=r.viewTo)Bo&&_i(e.doc,t)r.viewFrom)Bt(e);else{r.viewFrom+=i;r.viewTo+=i}else if(t<=r.viewFrom&&n>=r.viewTo)Bt(e);else if(t<=r.viewFrom){var o=Ut(e,n,n+i,1);if(o){r.view=r.view.slice(o.index);r.viewFrom=o.lineN;r.viewTo+=i}else Bt(e)}else if(n>=r.viewTo){var o=Ut(e,t,t,-1);if(o){r.view=r.view.slice(0,o.index);r.viewTo=o.lineN}else Bt(e)}else{var s=Ut(e,t,t,-1),a=Ut(e,n,n+i,1);if(s&&a){r.view=r.view.slice(0,s.index).concat(Mt(e,s.lineN,a.lineN)).concat(r.view.slice(a.index));r.viewTo+=i}else Bt(e)}var l=r.externalMeasured;l&&(n=r.lineN&&t=i.viewTo)){var o=i.view[qt(e,t)];if(null!=o.node){var s=o.changes||(o.changes=[]);kr(s,n)==-1&&s.push(n)}}}function Bt(e){e.display.viewFrom=e.display.viewTo=e.doc.first;e.display.view=[];e.display.viewOffset=0}function qt(e,t){if(t>=e.display.viewTo)return null;t-=e.display.viewFrom;if(t<0)return null;for(var n=e.display.view,i=0;i0){if(o==s.length-1)return null;r=l+s[o].size-t;o++}else r=l-t;t+=r;n+=r}for(;_i(e.doc,n)!=n;){if(o==(i<0?0:s.length-1))return null;n+=i*s[o-(i<0?1:0)].size;o+=i}return{index:o,lineN:n}}function Ft(e,t,n){var i=e.display,r=i.view;if(0==r.length||t>=i.viewTo||n<=i.viewFrom){i.view=Mt(e,t,n);i.viewFrom=t}else{i.viewFrom>t?i.view=Mt(e,t,i.viewFrom).concat(i.view):i.viewFromn&&(i.view=i.view.slice(0,qt(e,n)))}i.viewTo=n}function Gt(e){for(var t=e.display.view,n=0,i=0;i400}var r=e.display;Rs(r.scroller,"mousedown",Rt(e,Zt));xo&&_o<11?Rs(r.scroller,"dblclick",Rt(e,function(t){if(!Lr(e,t)){var n=Yt(e,t);if(n&&!Jt(e,t)&&!Wt(e.display,t)){Ns(t);var i=e.findWordAt(n);xe(e.doc,i.anchor,i.head)}}})):Rs(r.scroller,"dblclick",function(t){Lr(e,t)||Ns(t)});Do||Rs(r.scroller,"contextmenu",function(t){xn(e,t)});var o,s={end:0};Rs(r.scroller,"touchstart",function(t){if(!Lr(e,t)&&!n(t)){clearTimeout(o);var i=+new Date;r.activeTouch={start:i,moved:!1,prev:i-s.end<=300?s:null};if(1==t.touches.length){r.activeTouch.left=t.touches[0].pageX;r.activeTouch.top=t.touches[0].pageY}}});Rs(r.scroller,"touchmove",function(){r.activeTouch&&(r.activeTouch.moved=!0)});Rs(r.scroller,"touchend",function(n){var o=r.activeTouch;if(o&&!Wt(r,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var s,a=e.coordsChar(r.activeTouch,"page");s=!o.prev||i(o,o.prev)?new fe(a,a):!o.prev.prev||i(o,o.prev.prev)?e.findWordAt(a):new fe(qo(a.line,0),ge(e.doc,qo(a.line+1,0)));e.setSelection(s.anchor,s.head);e.focus();Ns(n)}t()});Rs(r.scroller,"touchcancel",t);Rs(r.scroller,"scroll",function(){if(r.scroller.clientHeight){on(e,r.scroller.scrollTop);sn(e,r.scroller.scrollLeft,!0);ks(e,"scroll",e)}});Rs(r.scroller,"mousewheel",function(t){an(e,t)});Rs(r.scroller,"DOMMouseScroll",function(t){an(e,t)});Rs(r.wrapper,"scroll",function(){r.wrapper.scrollTop=r.wrapper.scrollLeft=0});r.dragFunctions={enter:function(t){Lr(e,t)||As(t)},over:function(t){if(!Lr(e,t)){nn(e,t);As(t)}},start:function(t){tn(e,t)},drop:Rt(e,en),leave:function(t){Lr(e,t)||rn(e)}};var a=r.input.getField();Rs(a,"keyup",function(t){gn.call(e,t)});Rs(a,"keydown",Rt(e,hn));Rs(a,"keypress",Rt(e,mn));Rs(a,"focus",qr(yn,e));Rs(a,"blur",qr(bn,e))}function Ht(t,n,i){var r=i&&i!=e.Init;if(!n!=!r){var o=t.display.dragFunctions,s=n?Rs:Ps;s(t.display.scroller,"dragstart",o.start);s(t.display.scroller,"dragenter",o.enter);s(t.display.scroller,"dragover",o.over);s(t.display.scroller,"dragleave",o.leave);s(t.display.scroller,"drop",o.drop)}}function Vt(e){var t=e.display;if(t.lastWrapHeight!=t.wrapper.clientHeight||t.lastWrapWidth!=t.wrapper.clientWidth){t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null;t.scrollbarsClipped=!1;e.setSize()}}function Wt(e,t){for(var n=Er(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Yt(e,t,n,i){var r=e.display;if(!n&&"true"==Er(t).getAttribute("cm-not-content"))return null;var o,s,a=r.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left;s=t.clientY-a.top}catch(t){return null}var l,u=vt(e,o,s);if(i&&1==u.xRel&&(l=Qi(e.doc,u.line).text).length==u.ch){var c=Fs(l,l.length,e.options.tabSize)-l.length;u=qo(u.line,Math.max(0,Math.round((o-Ve(e.display).left)/xt(e.display))-c))}return u}function Zt(e){var t=this,n=t.display;if(!(Lr(t,e)||n.activeTouch&&n.input.supportsTouch())){n.shift=e.shiftKey;if(Wt(n,e)){if(!Eo){n.scroller.draggable=!1;setTimeout(function(){n.scroller.draggable=!0},100)}}else if(!Jt(t,e)){var i=Yt(t,e);window.focus();switch(wr(e)){case 1:t.state.selectingText?t.state.selectingText(e):i?$t(t,e,i):Er(e)==n.scroller&&Ns(e);break;case 2:Eo&&(t.state.lastMiddleDown=+new Date);i&&xe(t.doc,i);setTimeout(function(){n.input.focus()},20);Ns(e);break;case 3:Do?xn(t,e):vn(t)}}}}function $t(e,t,n){xo?setTimeout(qr(K,e),0):e.curOp.focus=Wr();var i,r=+new Date;if(Ho&&Ho.time>r-400&&0==Uo(Ho.pos,n))i="triple";else if(zo&&zo.time>r-400&&0==Uo(zo.pos,n)){i="double";Ho={time:r,pos:n}}else{i="single";zo={time:r,pos:n}}var o,s=e.doc.sel,a=Ro?t.metaKey:t.ctrlKey;e.options.dragDrop&&ta&&!e.isReadOnly()&&"single"==i&&(o=s.contains(n))>-1&&(Uo((o=s.ranges[o]).from(),n)<0||n.xRel>0)&&(Uo(o.to(),n)>0||n.xRel<0)?Kt(e,t,n,a):Xt(e,t,n,i,a)}function Kt(e,t,n,i){var r=e.display,o=+new Date,s=Rt(e,function(a){Eo&&(r.scroller.draggable=!1);e.state.draggingText=!1;Ps(document,"mouseup",s);Ps(r.scroller,"drop",s);if(Math.abs(t.clientX-a.clientX)+Math.abs(t.clientY-a.clientY)<10){Ns(a);!i&&+new Date-200y&&r.push(new fe(qo(d,y),qo(d,Gs(v,h,o))))}r.length||r.push(new fe(n,n));Ce(u,pe(p.ranges.slice(0,f).concat(r),f),{origin:"*mouse",scroll:!1});e.scrollIntoView(t)}else{var b=c,x=b.anchor,_=t;if("single"!=i){if("double"==i)var E=e.findWordAt(t);else var E=new fe(qo(t.line,0),ge(u,qo(t.line+1,0)));if(Uo(E.anchor,x)>0){_=E.head;x=$(b.from(),E.anchor)}else{_=E.anchor;x=Z(b.to(),E.head)}}var r=p.ranges.slice(0);r[f]=new fe(ge(u,x),_);Ce(u,pe(r,f),qs)}}}function s(t){var n=++y,r=Yt(e,t,!0,"rect"==i);if(r)if(0!=Uo(r,m)){e.curOp.focus=Wr();o(r);var a=x(l,u);(r.line>=a.to||r.linev.bottom?20:0;c&&setTimeout(Rt(e,function(){if(y==n){l.scroller.scrollTop+=c;s(t)}}),50)}}function a(t){e.state.selectingText=!1;y=1/0;Ns(t);l.input.focus();Ps(document,"mousemove",b);Ps(document,"mouseup",_);u.history.lastSelOrigin=null}var l=e.display,u=e.doc;Ns(t);var c,f,p=u.sel,h=p.ranges;if(r&&!t.shiftKey){f=u.sel.contains(n);c=f>-1?h[f]:new fe(n,n)}else{c=u.sel.primary();f=u.sel.primIndex}if(Oo?t.shiftKey&&t.metaKey:t.altKey){i="rect";r||(c=new fe(n,n));n=Yt(e,t,!0,!0);f=-1}else if("double"==i){var d=e.findWordAt(n);c=e.display.shift||u.extend?be(u,c,d.anchor,d.head):d}else if("triple"==i){var g=new fe(qo(n.line,0),ge(u,qo(n.line+1,0)));c=e.display.shift||u.extend?be(u,c,g.anchor,g.head):g}else c=be(u,c,n);if(r)if(f==-1){f=h.length;Ce(u,pe(h.concat([c]),f),{scroll:!1,origin:"*mouse"})}else if(h.length>1&&h[f].empty()&&"single"==i&&!t.shiftKey){Ce(u,pe(h.slice(0,f).concat(h.slice(f+1)),0),{scroll:!1,origin:"*mouse"});p=u.sel}else Ee(u,f,c,qs);else{f=0;Ce(u,new ce([c],0),qs);p=u.sel}var m=n,v=l.wrapper.getBoundingClientRect(),y=0,b=Rt(e,function(e){wr(e)?s(e):a(e)}),_=Rt(e,a);e.state.selectingText=_;Rs(document,"mousemove",b);Rs(document,"mouseup",_)}function Qt(e,t,n,i){try{var r=t.clientX,o=t.clientY}catch(t){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&Ns(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!Ir(e,n))return _r(t);o-=a.top-s.viewOffset;for(var l=0;l=r){var c=ir(e.doc,o),f=e.options.gutters[l];ks(e,n,e,c,f,t);return _r(t)}}}function Jt(e,t){return Qt(e,t,"gutterClick",!0)}function en(e){var t=this;rn(t);if(!Lr(t,e)&&!Wt(t.display,e)){Ns(e);xo&&(Zo=+new Date);var n=Yt(t,e,!0),i=e.dataTransfer.files;if(n&&!t.isReadOnly())if(i&&i.length&&window.FileReader&&window.File)for(var r=i.length,o=Array(r),s=0,a=function(e,i){if(!t.options.allowDropFileTypes||kr(t.options.allowDropFileTypes,e.type)!=-1){var a=new FileReader;a.onload=Rt(t,function(){var e=a.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e="");o[i]=e;if(++s==r){n=ge(t.doc,n);var l={from:n,to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Ln(t.doc,l);Se(t.doc,he(n,es(l)))}});a.readAsText(e)}},l=0;l-1){t.state.draggingText(e);setTimeout(function(){t.display.input.focus()},20);return}try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!t.state.draggingText.copy)var u=t.listSelections();Le(t.doc,he(n,n));if(u)for(var l=0;ls.clientWidth,l=s.scrollHeight>s.clientHeight;if(i&&a||r&&l){if(r&&Ro&&Eo)e:for(var u=t.target,c=o.view;u!=s;u=u.parentNode)for(var f=0;f=0;--r)Nn(e,{from:i[r].from,to:i[r].to,text:r?[""]:t.text});else Nn(e,t)}function Nn(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Uo(t.from,t.to)){var n=wn(e,t);cr(e,t,n,e.cm?e.cm.curOp.id:NaN);Rn(e,t,n,si(e,t));var i=[];Ki(e,function(e,n){if(!n&&kr(i,e.history)==-1){xr(e.history,t);i.push(e.history)}Rn(e,t,null,si(e,t))})}}function In(e,t,n){if(!e.cm||!e.cm.state.suppressEdits||n){for(var i,r=e.history,o=e.sel,s="undo"==t?r.done:r.undone,a="undo"==t?r.undone:r.done,l=0;l=0;--l){var f=i.changes[l];f.origin=t;if(c&&!Cn(e,f,!1)){s.length=0;return}u.push(ar(e,f));var p=l?wn(e,f):Pr(s);Rn(e,f,p,li(e,f));!l&&e.cm&&e.cm.scrollIntoView({from:f.from,to:es(f)});var h=[];Ki(e,function(e,t){if(!t&&kr(h,e.history)==-1){xr(e.history,f);h.push(e.history)}Rn(e,f,null,li(e,f))})}}}}function An(e,t){if(0!=t){e.first+=t;e.sel=new ce(Mr(e.sel.ranges,function(e){return new fe(qo(e.anchor.line+t,e.anchor.ch),qo(e.head.line+t,e.head.ch))}),e.sel.primIndex);if(e.cm){Dt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;ie.lastLine())){if(t.from.lineo&&(t={from:t.from,to:qo(o,Qi(e,o).text.length),text:[t.text[0]],origin:t.origin});t.removed=Ji(e,t.from,t.to);n||(n=wn(e,t));e.cm?On(e.cm,t,i):Yi(e,t,i);Le(e,n,Bs)}}function On(e,t,n){var i=e.doc,r=e.display,s=t.from,a=t.to,l=!1,u=s.line;if(!e.options.lineWrapping){u=nr(bi(Qi(i,s.line)));i.iter(u,a.line+1,function(e){if(e==r.maxLine){l=!0;return!0}})}i.sel.contains(t.from,t.to)>-1&&Nr(e);Yi(i,t,n,o(e));if(!e.options.lineWrapping){i.iter(u,s.line+t.text.length,function(e){var t=f(e);if(t>r.maxLineLength){r.maxLine=e;r.maxLineLength=t;r.maxLineChanged=!0;l=!1}});l&&(e.curOp.updateMaxLine=!0)}i.frontier=Math.min(i.frontier,s.line);qe(e,400);var c=t.text.length-(a.line-s.line)-1;t.full?Dt(e):s.line!=a.line||1!=t.text.length||Wi(e.doc,t)?Dt(e,s.line,a.line+1,c):jt(e,s.line,"text");var p=Ir(e,"changes"),h=Ir(e,"change");if(h||p){var d={from:s,to:a,text:t.text,removed:t.removed,origin:t.origin};h&&Sr(e,"change",e,d);p&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}function Pn(e,t,n,i,r){i||(i=n);if(Uo(i,n)<0){var o=i;i=n;n=o}"string"==typeof t&&(t=e.splitLines(t));Ln(e,{from:n,to:i,text:t,origin:r})}function kn(e,t){if(!Lr(e,"scrollCursorIntoView")){var n=e.display,i=n.sizer.getBoundingClientRect(),r=null;t.top+i.top<0?r=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1);if(null!=r&&!No){var o=zr("div","",null,"position: absolute; top: "+(t.top-n.viewOffset-ze(e.display))+"px; height: "+(t.bottom-t.top+We(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o);o.scrollIntoView(r);e.display.lineSpace.removeChild(o)}}}function Mn(e,t,n,i){null==i&&(i=0);for(var r=0;r<5;r++){var o=!1,s=dt(e,t),a=n&&n!=t?dt(e,n):s,l=jn(e,Math.min(s.left,a.left),Math.min(s.top,a.top)-i,Math.max(s.left,a.left),Math.max(s.bottom,a.bottom)+i),u=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=l.scrollTop){on(e,l.scrollTop);Math.abs(e.doc.scrollTop-u)>1&&(o=!0)}if(null!=l.scrollLeft){sn(e,l.scrollLeft);Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)}if(!o)break}return s}function Dn(e,t,n,i,r){var o=jn(e,t,n,i,r);null!=o.scrollTop&&on(e,o.scrollTop);null!=o.scrollLeft&&sn(e,o.scrollLeft)}function jn(e,t,n,i,r){var o=e.display,s=bt(e.display);n<0&&(n=0);var a=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,l=Ze(e),u={};r-n>l&&(r=n+l);var c=e.doc.height+He(o),f=nc-s;if(na+l){var h=Math.min(n,(p?c:r)-l);h!=a&&(u.scrollTop=h)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=Ye(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),m=i-t>g;m&&(i=t+g);t<10?u.scrollLeft=0:tg+d-3&&(u.scrollLeft=i+(m?0:10)-g);return u}function Bn(e,t,n){null==t&&null==n||Un(e);null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t);null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function qn(e){Un(e);var t=e.getCursor(),n=t,i=t;if(!e.options.lineWrapping){n=t.ch?qo(t.line,t.ch-1):t;i=qo(t.line,t.ch+1)}e.curOp.scrollToPos={from:n,to:i,margin:e.options.cursorScrollMargin,isCursor:!0}}function Un(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=gt(e,t.from),i=gt(e,t.to),r=jn(e,Math.min(n.left,i.left),Math.min(n.top,i.top)-t.margin,Math.max(n.right,i.right),Math.max(n.bottom,i.bottom)+t.margin);e.scrollTo(r.scrollLeft,r.scrollTop)}}function Fn(e,t,n,i){var r,o=e.doc;null==n&&(n="add");"smart"==n&&(o.mode.indent?r=Ge(e,t):n="prev");var s=e.options.tabSize,a=Qi(o,t),l=Fs(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var u,c=a.text.match(/^\s*/)[0];if(i||/\S/.test(a.text)){if("smart"==n){u=o.mode.indent(r,a.text.slice(c.length),a.text);if(u==js||u>150){if(!i)return;n="prev"}}}else{u=0;n="not"}"prev"==n?u=t>o.first?Fs(Qi(o,t-1).text,null,s):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n);u=Math.max(0,u);var f="",p=0;if(e.options.indentWithTabs)for(var h=Math.floor(u/s);h;--h){p+=s;f+="\t"}p=0;t--)Pn(e.doc,"",i[t].from,i[t].to,"+delete");qn(e)})}function Hn(e,t,n,i,r){function o(){var t=a+n;if(t=e.first+e.size)return!1;a=t;return c=Qi(e,t)}function s(e){var t=(r?po:ho)(c,l,n,!0);if(null==t){if(e||!o())return!1;l=r?(n<0?oo:ro)(c):n<0?c.text.length:0}else l=t;return!0}var a=t.line,l=t.ch,u=n,c=Qi(e,a);if("char"==i)s();else if("column"==i)s(!0);else if("word"==i||"group"==i)for(var f=null,p="group"==i,h=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(n<0)||s(!d);d=!1){var g=c.text.charAt(l)||"\n",m=Ur(g,h)?"w":p&&"\n"==g?"n":!p||/\s/.test(g)?null:"p";!p||d||m||(m="s");if(f&&f!=m){if(n<0){n=1;s()}break}m&&(f=m);if(n>0&&!s(!d))break}var v=Oe(e,qo(a,l),t,u,!0);Uo(t,v)||(v.hitSide=!0);return v}function Vn(e,t,n,i){var r,o=e.doc,s=t.left;if("page"==i){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);r=t.top+n*(a-(n<0?1.5:.5)*bt(e.display))}else"line"==i&&(r=n>0?t.bottom+3:t.top-3);for(;;){var l=vt(e,s,r);if(!l.outside)break;if(n<0?r<=0:r>=o.height){l.hitSide=!0;break}r+=5*n}return l}function Wn(t,n,i,r){e.defaults[t]=n;i&&(ns[t]=r?function(e,t,n){n!=is&&i(e,t,n)}:i)}function Yn(e){for(var t,n,i,r,o=e.split(/-(?!$)/),e=o[o.length-1],s=0;s0||0==s&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith){o.collapsed=!0;o.widgetNode=zr("span",[o.replacedWith],"CodeMirror-widget");i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true");i.insertLeft&&(o.widgetNode.insertLeft=!0)}if(o.collapsed){if(yi(e,t.line,t,n,o)||t.line!=n.line&&yi(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Bo=!0}o.addToHistory&&cr(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,l=t.line,u=e.cm;e.iter(l,n.line+1,function(e){u&&o.collapsed&&!u.options.lineWrapping&&bi(e)==u.display.maxLine&&(a=!0);o.collapsed&&l!=t.line&&tr(e,0);ii(e,new ei(o,l==t.line?t.ch:null,l==n.line?n.ch:null));++l});o.collapsed&&e.iter(t.line,n.line+1,function(t){wi(e,t)&&tr(t,0)});o.clearOnEnter&&Rs(o,"beforeCursorEnter",function(){o.clear()});if(o.readOnly){jo=!0;(e.history.done.length||e.history.undone.length)&&e.clearHistory()}if(o.collapsed){o.id=++vs;o.atomic=!0}if(u){a&&(u.curOp.updateMaxLine=!0);if(o.collapsed)Dt(u,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=t.line;c<=n.line;c++)jt(u,c,"text");o.atomic&&Ie(u.doc);Sr(u,"markerAdded",u,o)}return o}function Kn(e,t,n,i,r){i=Br(i);i.shared=!1;var o=[$n(e,t,n,i,r)],s=o[0],a=i.widgetNode;Ki(e,function(e){a&&(i.widgetNode=a.cloneNode(!0));o.push($n(e,ge(e,t),ge(e,n),i,r));for(var l=0;l=t:o.to>t);(i||(i=[])).push(new ei(s,o.from,l?null:o.to))}}return i}function oi(e,t,n){if(e)for(var i,r=0;r=t:o.to>t);if(a||o.from==t&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(s.inclusiveLeft?o.from<=t:o.from0&&a)for(var f=0;f0)){var c=[l,1],f=Uo(u.from,a.from),p=Uo(u.to,a.to);(f<0||!s.inclusiveLeft&&!f)&&c.push({from:u.from,to:a.from});(p>0||!s.inclusiveRight&&!p)&&c.push({from:a.to,to:u.to});r.splice.apply(r,c);l+=c.length-1}}return r}function ci(e){var t=e.markedSpans;if(t){for(var n=0;n=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?Uo(u.to,n)>=0:Uo(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?Uo(u.from,i)<=0:Uo(u.from,i)<0)))return!0}}}function bi(e){for(var t;t=mi(e);)e=t.find(-1,!0).line;return e}function xi(e){for(var t,n;t=vi(e);){e=t.find(1,!0).line;(n||(n=[])).push(e)}return n}function _i(e,t){var n=Qi(e,t),i=bi(n);return n==i?t:nr(i)}function Ei(e,t){if(t>e.lastLine())return t;var n,i=Qi(e,t);if(!wi(e,i))return t;for(;n=vi(i);)i=n.find(1,!0).line;return nr(i)+1}function wi(e,t){var n=Bo&&t.markedSpans;if(n)for(var i,r=0;rn.start)return s}throw new Error("Mode "+t.name+" failed to advance stream.")}function Pi(e,t,n,i){function r(e){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:e?us(s.mode,c):c}}var o,s=e.doc,a=s.mode;t=ge(s,t);var l,u=Qi(s,t.line),c=Ge(e,t.line,n),f=new ms(u.text,e.options.tabSize);i&&(l=[]);for(;(i||f.pose.options.maxHighlightLength){a=!1;s&&ji(e,t,i,f.pos);f.pos=t.length;l=null}else l=Ai(Oi(n,f,i,p),o);if(p){var h=p[0].name;h&&(l="m-"+(l?h+" "+l:h))}if(!a||c!=l){for(;ue&&r.splice(l,1,e,r[l+1],i);l+=2;u=Math.min(e,i)}if(t)if(a.opaque){r.splice(n,l-n,e,"cm-overlay "+t);l=n+2}else for(;ne.options.maxHighlightLength?us(e.doc.mode,i):i);t.stateAfter=i;t.styles=r.styles;r.classes?t.styleClasses=r.classes:t.styleClasses&&(t.styleClasses=null);n===e.doc.frontier&&e.doc.frontier++}return t.styles}function ji(e,t,n,i){var r=e.doc.mode,o=new ms(t,e.options.tabSize);o.start=o.pos=i||0;""==t&&Ri(r,n);for(;!o.eol();){Oi(r,o,n);o.start=o.pos}}function Bi(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?ws:Es;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function qi(e,t){var n=zr("span",null,null,Eo?"padding-right: .1px":null),i={pre:zr("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(xo||Eo)&&e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var o,s=r?t.rest[r-1]:t.line;i.pos=0;i.addToken=Fi;Jr(e.display.measure)&&(o=or(s))&&(i.addToken=zi(i.addToken,o));i.map=[];var a=t!=e.display.externalMeasured&&nr(s);Vi(s,i,Di(e,s,a));if(s.styleClasses){s.styleClasses.bgClass&&(i.bgClass=Zr(s.styleClasses.bgClass,i.bgClass||""));s.styleClasses.textClass&&(i.textClass=Zr(s.styleClasses.textClass,i.textClass||""))}0==i.map.length&&i.map.push(0,0,i.content.appendChild(Qr(e.display.measure)));if(0==r){t.measure.map=i.map;t.measure.cache={}}else{(t.measure.maps||(t.measure.maps=[])).push(i.map);(t.measure.caches||(t.measure.caches=[])).push({})}}if(Eo){var l=i.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}ks(e,"renderLine",e,t.line,i.pre);i.pre.className&&(i.textClass=Zr(i.pre.className,i.textClass||""));return i}function Ui(e){var t=zr("span","•","cm-invalidchar");t.title="\\u"+e.charCodeAt(0).toString(16);t.setAttribute("aria-label",t.title);return t}function Fi(e,t,n,i,r,o,s){if(t){var a=e.splitSpaces?Gi(t,e.trailingSpace):t,l=e.cm.state.specialChars,u=!1;if(l.test(t))for(var c=document.createDocumentFragment(),f=0;;){l.lastIndex=f;var p=l.exec(t),h=p?p.index-f:t.length-f;if(h){var d=document.createTextNode(a.slice(f,f+h));xo&&_o<9?c.appendChild(zr("span",[d])):c.appendChild(d);e.map.push(e.pos,e.pos+h,d);e.col+=h;e.pos+=h}if(!p)break;f+=h+1;if("\t"==p[0]){var g=e.cm.options.tabSize,m=g-e.col%g,d=c.appendChild(zr("span",Or(m),"cm-tab"));d.setAttribute("role","presentation");d.setAttribute("cm-text","\t");e.col+=m}else if("\r"==p[0]||"\n"==p[0]){var d=c.appendChild(zr("span","\r"==p[0]?"␍":"","cm-invalidchar"));d.setAttribute("cm-text",p[0]);e.col+=1}else{var d=e.cm.options.specialCharPlaceholder(p[0]);d.setAttribute("cm-text",p[0]);xo&&_o<9?c.appendChild(zr("span",[d])):c.appendChild(d);e.col+=1}e.map.push(e.pos,e.pos+1,d);e.pos++}else{e.col+=t.length;var c=document.createTextNode(a);e.map.push(e.pos,e.pos+t.length,c);xo&&_o<9&&(u=!0);e.pos+=t.length}e.trailingSpace=32==a.charCodeAt(t.length-1);if(n||i||r||u||s){var v=n||"";i&&(v+=i);r&&(v+=r);var y=zr("span",[c],v,s);o&&(y.title=o);return e.content.appendChild(y)}e.content.appendChild(c)}}function Gi(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,i="",r=0;ru&&p.from<=u)break}if(p.to>=c)return e(n,i,r,o,s,a,l);e(n,i.slice(0,p.to-u),r,o,null,a,l);o=null;i=i.slice(p.to-u);u=p.to}}}function Hi(e,t,n,i){var r=!i&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r);if(!i&&e.cm.display.input.needsContentAttribute){r||(r=e.content.appendChild(document.createElement("span")));r.setAttribute("cm-marker",n.id)}if(r){e.cm.display.input.setUneditable(r);e.content.appendChild(r)}e.pos+=t;e.trailingSpace=!1}function Vi(e,t,n){var i=e.markedSpans,r=e.text,o=0;if(i)for(var s,a,l,u,c,f,p,h=r.length,d=0,g=1,m="",v=0;;){if(v==d){l=u=c=f=a="";p=null;v=1/0;for(var y,b=[],x=0;xd||E.collapsed&&_.to==d&&_.from==d)){if(null!=_.to&&_.to!=d&&v>_.to){v=_.to;u=""}E.className&&(l+=" "+E.className);E.css&&(a=(a?a+";":"")+E.css);E.startStyle&&_.from==d&&(c+=" "+E.startStyle);E.endStyle&&_.to==v&&(y||(y=[])).push(E.endStyle,_.to);E.title&&!f&&(f=E.title);E.collapsed&&(!p||di(p.marker,E)<0)&&(p=_)}else _.from>d&&v>_.from&&(v=_.from)}if(y)for(var x=0;x=h)break;for(var w=Math.min(h,v);;){if(m){var T=d+m.length;if(!p){var S=T>w?m.slice(0,w-d):m;t.addToken(t,S,s?s+l:l,c,d+S.length==v?u:"",f,a)}if(T>=w){m=m.slice(w-d);d=w;break}d=T;c=""}m=r.slice(o,o=n[g++]);s=Bi(n[g++],t.cm.options)}}else for(var g=1;g1&&e.remove(a.line+1,d-1);e.insert(a.line+1,g)}Sr(e,"change",e,t)}function Zi(e){this.lines=e;this.parent=null;for(var t=0,n=0;t=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(t1&&!e.done[e.done.length-2].ranges){e.done.pop();return Pr(e.done)}}function cr(e,t,n,i){var r=e.history;r.undone.length=0;var o,s=+new Date;if((r.lastOp==i||r.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&r.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ur(r,r.lastOp==i))){var a=Pr(o.changes);0==Uo(t.from,t.to)&&0==Uo(t.from,a.to)?a.to=es(t):o.changes.push(ar(e,t))}else{var l=Pr(r.done);l&&l.ranges||hr(e.sel,r.done);o={changes:[ar(e,t)],generation:r.generation};r.done.push(o);for(;r.done.length>r.undoDepth;){r.done.shift();r.done[0].ranges||r.done.shift()}}r.done.push(n);r.generation=++r.maxGeneration;r.lastModTime=r.lastSelTime=s;r.lastOp=r.lastSelOp=i;r.lastOrigin=r.lastSelOrigin=t.origin;a||ks(e,"historyAdded")}function fr(e,t,n,i){var r=t.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function pr(e,t,n,i){var r=e.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||fr(e,o,Pr(r.done),t))?r.done[r.done.length-1]=t:hr(t,r.done);r.lastSelTime=+new Date;r.lastSelOrigin=o;r.lastSelOp=n;i&&i.clearRedo!==!1&&lr(r.undone)}function hr(e,t){var n=Pr(t);n&&n.ranges&&n.equals(e)||t.push(e)}function dr(e,t,n,i){var r=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),function(n){n.markedSpans&&((r||(r=t["spans_"+e.id]={}))[o]=n.markedSpans);++o})}function gr(e){if(!e)return null;for(var t,n=0;n-1){Pr(a)[f]=c[f];delete c[f]}}}}return r}function yr(e,t,n,i){if(n0?i.slice():Os:i||Os}function Sr(e,t){function n(e){return function(){e.apply(null,o)}}var i=Tr(e,t,!1);if(i.length){var r,o=Array.prototype.slice.call(arguments,2);if(Wo)r=Wo.delayedCallbacks;else if(Ms)r=Ms;else{r=Ms=[];setTimeout(Cr,0)}for(var s=0;s0}function Ar(e){e.prototype.on=function(e,t){Rs(this,e,t)};e.prototype.off=function(e,t){Ps(this,e,t)}}function Rr(){this.id=null}function Or(e){for(;zs.length<=e;)zs.push(Pr(zs)+" ");return zs[e]}function Pr(e){return e[e.length-1]}function kr(e,t){for(var n=0;n-1&&Ys(e))||t.test(e):Ys(e)}function Fr(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Gr(e){return e.charCodeAt(0)>=768&&Zs.test(e)}function zr(e,t,n,i){var r=document.createElement(e);n&&(r.className=n);i&&(r.style.cssText=i);if("string"==typeof t)r.appendChild(document.createTextNode(t));else if(t)for(var o=0;o0;--t)e.removeChild(e.firstChild);return e}function Vr(e,t){return Hr(e).appendChild(t)}function Wr(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Yr(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Zr(e,t){for(var n=e.split(" "),i=0;i2&&!(xo&&_o<8))}var n=Ks?zr("span",""):zr("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");n.setAttribute("cm-text","");return n}function Jr(e){if(null!=Xs)return Xs;var t=Vr(e,document.createTextNode("AخA")),n=Vs(t,0,1).getBoundingClientRect(),i=Vs(t,1,2).getBoundingClientRect();Hr(e);return!(!n||n.left==n.right)&&(Xs=i.right-n.right<3)}function eo(e){if(null!=oa)return oa;var t=Vr(e,zr("span","x")),n=t.getBoundingClientRect(),i=Vs(t,0,1).getBoundingClientRect();return oa=Math.abs(n.left-i.left)>1}function to(e,t,n,i){if(!e)return i(t,n,"ltr");for(var r=!1,o=0;ot||t==n&&s.to==t){i(Math.max(s.from,t),Math.min(s.to,n),1==s.level?"rtl":"ltr");r=!0}}r||i(t,n,"ltr")}function no(e){return e.level%2?e.to:e.from}function io(e){return e.level%2?e.from:e.to}function ro(e){var t=or(e);return t?no(t[0]):0}function oo(e){var t=or(e);return t?io(Pr(t)):e.text.length}function so(e,t){var n=Qi(e.doc,t),i=bi(n);i!=n&&(t=nr(i));var r=or(i),o=r?r[0].level%2?oo(i):ro(i):0;return qo(t,o)}function ao(e,t){for(var n,i=Qi(e.doc,t);n=vi(i);){i=n.find(1,!0).line;t=null}var r=or(i),o=r?r[0].level%2?ro(i):oo(i):i.text.length;return qo(null==t?nr(i):t,o)}function lo(e,t){var n=so(e,t.line),i=Qi(e.doc,n.line),r=or(i);if(!r||0==r[0].level){var o=Math.max(0,i.text.search(/\S/)),s=t.line==n.line&&t.ch<=o&&t.ch;return qo(n.line,s?0:o)}return n}function uo(e,t,n){var i=e[0].level;return t==i||n!=i&&tt)return i;if(r.from==t||r.to==t){if(null!=n){if(uo(e,r.level,e[n].level)){r.from!=r.to&&(aa=n);return i}r.from!=r.to&&(aa=i);return n}n=i}}return n}function fo(e,t,n,i){if(!i)return t+n;do t+=n;while(t>0&&Gr(e.text.charAt(t)));return t}function po(e,t,n,i){var r=or(e);if(!r)return ho(e,t,n,i);for(var o=co(r,t),s=r[o],a=fo(e,t,s.level%2?-n:n,i);;){if(a>s.from&&a0==s.level%2?s.to:s.from}s=r[o+=n];if(!s)return null;a=n>0==s.level%2?fo(e,s.to,-1,i):fo(e,s.from,1,i)}}function ho(e,t,n,i){var r=t+n;if(i)for(;r>0&&Gr(e.text.charAt(r));)r+=n;return r<0||r>e.text.length?null:r}var go=navigator.userAgent,mo=navigator.platform,vo=/gecko\/\d/i.test(go),yo=/MSIE \d/.test(go),bo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(go),xo=yo||bo,_o=xo&&(yo?document.documentMode||6:bo[1]),Eo=/WebKit\//.test(go),wo=Eo&&/Qt\/\d+\.\d+/.test(go),To=/Chrome\//.test(go),So=/Opera\//.test(go),Co=/Apple Computer/.test(navigator.vendor),Lo=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(go),No=/PhantomJS/.test(go),Io=/AppleWebKit/.test(go)&&/Mobile\/\w+/.test(go),Ao=Io||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(go),Ro=Io||/Mac/.test(mo),Oo=/\bCrOS\b/.test(go),Po=/win/i.test(mo),ko=So&&go.match(/Version\/(\d*\.\d*)/);ko&&(ko=Number(ko[1]));if(ko&&ko>=15){So=!1;Eo=!0}var Mo=Ro&&(wo||So&&(null==ko||ko<12.11)),Do=vo||xo&&_o>=9,jo=!1,Bo=!1;g.prototype=Br({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(n){this.vert.style.display="block";this.vert.style.bottom=t?i+"px":"0";var r=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else{this.vert.style.display="";this.vert.firstChild.style.height="0"}if(t){this.horiz.style.display="block";this.horiz.style.right=n?i+"px":"0";this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?i:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedZeroWidth&&e.clientHeight>0){0==i&&this.zeroWidthHack();this.checkedZeroWidth=!0}return{right:n?i:0,bottom:t?i:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e);this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e);this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Ro&&!Lo?"12px":"18px";this.horiz.style.height=this.vert.style.width=e;this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none";this.disableHoriz=new Rr;this.disableVert=new Rr},enableZeroWidthBar:function(e,t){function n(){var i=e.getBoundingClientRect(),r=document.elementFromPoint(i.left+1,i.bottom-1);r!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto";t.set(1e3,n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz);e.removeChild(this.vert)}},g.prototype);m.prototype=Br({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},m.prototype);e.scrollbarModel={"native":g,"null":m};S.prototype.signal=function(e,t){Ir(e,t)&&this.events.push(arguments)};S.prototype.finish=function(){for(var e=0;e=9&&n.hasSelection&&(n.hasSelection=null);n.poll()});Rs(o,"paste",function(e){if(!Lr(i,e)&&!Q(e,i)){i.state.pasteIncoming=!0;n.fastPoll()}});Rs(o,"cut",t);Rs(o,"copy",t);Rs(e.scroller,"paste",function(t){if(!Wt(e,t)&&!Lr(i,t)){i.state.pasteIncoming=!0;n.focus()}});Rs(e.lineSpace,"selectstart",function(t){Wt(e,t)||Ns(t)});Rs(o,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear();n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}});Rs(o,"compositionend",function(){if(n.composing){n.poll();n.composing.range.clear();n.composing=null}})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,i=Me(e);if(e.options.moveInputWithCursor){var r=dt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+s.top-o.top));i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+s.left-o.left))}return i},showSelection:function(e){var t=this.cm,n=t.display;Vr(n.cursorDiv,e.cursors);Vr(n.selectionDiv,e.selection);if(null!=e.teTop){this.wrapper.style.top=e.teTop+"px";this.wrapper.style.left=e.teLeft+"px"}},reset:function(e){if(!this.contextMenuPending){var t,n,i=this.cm,r=i.doc;if(i.somethingSelected()){this.prevInput="";var o=r.sel.primary();t=ra&&(o.to().line-o.from().line>100||(n=i.getSelection()).length>1e3);var s=t?"-":n||i.getSelection();this.textarea.value=s;i.state.focused&&Hs(this.textarea);xo&&_o>=9&&(this.hasSelection=s)}else if(!e){this.prevInput=this.textarea.value="";xo&&_o>=9&&(this.hasSelection=null)}this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Ao||Wr()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll();e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var i=n.poll();if(i||t){n.pollingFast=!1;n.slowPoll()}else{t=!0;n.polling.set(60,e)}}var t=!1,n=this;n.pollingFast=!0;n.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||ia(t)&&!n&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var i=t.value;if(i==n&&!e.somethingSelected())return!1;if(xo&&_o>=9&&this.hasSelection===i||Ro&&/[\uf700-\uf7ff]/.test(i)){e.display.input.reset();return!1}if(e.doc.sel==e.display.selForContextMenu){var r=i.charCodeAt(0);8203!=r||n||(n="");if(8666==r){this.reset();return this.cm.execCommand("undo")}}for(var o=0,s=Math.min(n.length,i.length);o1e3||i.indexOf("\n")>-1?t.value=a.prevInput="":a.prevInput=i;if(a.composing){a.composing.range.clear();a.composing.range=e.markText(a.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"})}});return!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){xo&&_o>=9&&(this.hasSelection=null);this.fastPoll()},onContextMenu:function(e){function t(){if(null!=s.selectionStart){var e=r.somethingSelected(),t=""+(e?s.value:"");s.value="⇚";s.value=t;i.prevInput=e?"":"";s.selectionStart=1;s.selectionEnd=t.length;o.selForContextMenu=r.doc.sel}}function n(){i.contextMenuPending=!1;i.wrapper.style.cssText=f;s.style.cssText=c;xo&&_o<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=l);if(null!=s.selectionStart){(!xo||xo&&_o<9)&&t();var e=0,n=function(){o.selForContextMenu==r.doc.sel&&0==s.selectionStart&&s.selectionEnd>0&&""==i.prevInput?Rt(r,fs.selectAll)(r):e++<10?o.detectingSelectAll=setTimeout(n,500):o.input.reset()};o.detectingSelectAll=setTimeout(n,200)}}var i=this,r=i.cm,o=r.display,s=i.textarea,a=Yt(r,e),l=o.scroller.scrollTop;if(a&&!So){var u=r.options.resetSelectionOnContextMenu;u&&r.doc.sel.contains(a)==-1&&Rt(r,Ce)(r.doc,he(a),Bs);var c=s.style.cssText,f=i.wrapper.style.cssText;i.wrapper.style.cssText="position: absolute";var p=i.wrapper.getBoundingClientRect();s.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px; z-index: 1000; background: "+(xo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(Eo)var h=window.scrollY;o.input.focus();Eo&&window.scrollTo(null,h);o.input.reset();r.somethingSelected()||(s.value=i.prevInput=" ");i.contextMenuPending=!0;o.selForContextMenu=r.doc.sel;clearTimeout(o.detectingSelectAll);xo&&_o>=9&&t();if(Do){As(e);var d=function(){Ps(window,"mouseup",d);setTimeout(n,20)};Rs(window,"mouseup",d)}else setTimeout(n,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Dr,needsContentAttribute:!1},ne.prototype);re.prototype=Br({init:function(e){function t(e){if(!Lr(i,e)){if(i.somethingSelected()){Fo={lineWise:!1,text:i.getSelections()};"cut"==e.type&&i.replaceSelection("",null,"cut")}else{if(!i.options.lineWiseCopyCut)return;var t=ee(i);Fo={lineWise:!0,text:t.text};"cut"==e.type&&i.operation(function(){i.setSelections(t.ranges,0,Bs);i.replaceSelection("",null,"cut")})}if(e.clipboardData&&!Io){e.preventDefault();e.clipboardData.clearData();e.clipboardData.setData("text/plain",Fo.text.join("\n"))}else{var n=ie(),r=n.firstChild;i.display.lineSpace.insertBefore(n,i.display.lineSpace.firstChild);r.value=Fo.text.join("\n");var o=document.activeElement;Hs(r);setTimeout(function(){i.display.lineSpace.removeChild(n);o.focus()},50)}}}var n=this,i=n.cm,r=n.div=e.lineDiv;te(r);Rs(r,"paste",function(e){Lr(i,e)||Q(e,i)});Rs(r,"compositionstart",function(e){var t=e.data;n.composing={sel:i.doc.sel,data:t,startData:t};if(t){var r=i.doc.sel.primary(),o=i.getLine(r.head.line),s=o.indexOf(t,Math.max(0,r.head.ch-t.length));s>-1&&s<=r.head.ch&&(n.composing.sel=he(qo(r.head.line,s),qo(r.head.line,s+t.length)))}});Rs(r,"compositionupdate",function(e){n.composing.data=e.data});Rs(r,"compositionend",function(e){var t=n.composing;if(t){e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data);setTimeout(function(){t.handled||n.applyComposition(t);n.composing==t&&(n.composing=null)},50)}});Rs(r,"touchstart",function(){n.forceCompositionEnd()});Rs(r,"input",function(){n.composing||!i.isReadOnly()&&n.pollContent()||At(n.cm,function(){Dt(i)})});Rs(r,"copy",t);Rs(r,"cut",t)},prepareSelection:function(){var e=Me(this.cm,!1);e.focus=this.cm.state.focused;return e},showSelection:function(e,t){if(e&&this.cm.display.view.length){(e.focus||t)&&this.showPrimarySelection();this.showMultipleSelections(e)}},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=ae(this.cm,e.anchorNode,e.anchorOffset),i=ae(this.cm,e.focusNode,e.focusOffset);
if(!n||n.bad||!i||i.bad||0!=Uo($(n,i),t.from())||0!=Uo(Z(n,i),t.to())){var r=oe(this.cm,t.from()),o=oe(this.cm,t.to());if(r||o){var s=this.cm.display.view,a=e.rangeCount&&e.getRangeAt(0);if(r){if(!o){var l=s[s.length-1].measure,u=l.maps?l.maps[l.maps.length-1]:l.map;o={node:u[u.length-1],offset:u[u.length-2]-u[u.length-3]}}}else r={node:s[0].measure.map[2],offset:0};try{var c=Vs(r.node,r.offset,o.offset,o.node)}catch(f){}if(c){if(!vo&&this.cm.state.focused){e.collapse(r.node,r.offset);c.collapsed||e.addRange(c)}else{e.removeAllRanges();e.addRange(c)}a&&null==e.anchorNode?e.addRange(a):vo&&this.startGracePeriod()}this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout(function(){e.gracePeriod=!1;e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Vr(this.cm.display.cursorDiv,e.cursors);Vr(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode;this.lastAnchorOffset=e.anchorOffset;this.lastFocusNode=e.focusNode;this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return $s(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){if(t.cm.state.focused){t.pollSelection();t.polling.set(t.cm.options.pollInterval,e)}}var t=this;this.selectionInEditor()?this.pollSelection():At(this.cm,function(){t.cm.curOp.selectionChanged=!0});this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=ae(t,e.anchorNode,e.anchorOffset),i=ae(t,e.focusNode,e.focusOffset);n&&i&&At(t,function(){Ce(t.doc,he(n,i),Bs);(n.bad||i.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),i=n.from(),r=n.to();if(i.linet.viewTo-1)return!1;var o;if(i.line==t.viewFrom||0==(o=qt(e,i.line)))var s=nr(t.view[0].line),a=t.view[0].node;else var s=nr(t.view[o].line),a=t.view[o-1].node.nextSibling;var l=qt(e,r.line);if(l==t.view.length-1)var u=t.viewTo-1,c=t.lineDiv.lastChild;else var u=nr(t.view[l+1].line)-1,c=t.view[l+1].node.previousSibling;for(var f=e.doc.splitLines(ue(e,a,c,s,u)),p=Ji(e.doc,qo(s,0),qo(u,Qi(e.doc,u).text.length));f.length>1&&p.length>1;)if(Pr(f)==Pr(p)){f.pop();p.pop();u--}else{if(f[0]!=p[0])break;f.shift();p.shift();s++}for(var h=0,d=0,g=f[0],m=p[0],v=Math.min(g.length,m.length);h1||f[0]||Uo(_,E)){Pn(e.doc,f,_,E,"+input");return!0}},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){if(this.composing&&!this.composing.handled){this.applyComposition(this.composing);this.composing.handled=!0;this.div.blur();this.div.focus()}},applyComposition:function(e){this.cm.isReadOnly()?Rt(this.cm,Dt)(this.cm):e.data&&e.data!=e.startData&&Rt(this.cm,X)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault();this.cm.isReadOnly()||Rt(this.cm,X)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Dr,resetPosition:Dr,needsContentAttribute:!0},re.prototype);e.inputStyles={textarea:ne,contenteditable:re};ce.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t=0&&Uo(e,i.to())<=0)return n}return-1}};fe.prototype={from:function(){return $(this.anchor,this.head)},to:function(){return Z(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Go,zo,Ho,Vo={left:0,right:0,top:0,bottom:0},Wo=null,Yo=0,Zo=0,$o=0,Ko=null;xo?Ko=-.53:vo?Ko=15:To?Ko=-.7:Co&&(Ko=-1/3);var Xo=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail);null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta);return{x:t,y:n}};e.wheelEventPixels=function(e){var t=Xo(e);t.x*=Ko;t.y*=Ko;return t};var Qo=new Rr,Jo=null,es=e.changeEnd=function(e){return e.text?qo(e.from.line+e.text.length-1,Pr(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus();this.display.input.focus()},setOption:function(e,t){var n=this.options,i=n[e];if(n[e]!=t||"mode"==e){n[e]=t;ns.hasOwnProperty(e)&&Rt(this,ns[e])(this,t,i)}},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Zn(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn){Fn(this,r.head.line,e,!0);n=r.head.line;i==this.doc.sel.primIndex&&qn(this)}}else{var o=r.from(),s=r.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;l0&&Ee(this.doc,i,new fe(o,u[i].to()),Bs)}}}),getTokenAt:function(e,t){return Pi(this,e,t)},getLineTokens:function(e,t){return Pi(this,qo(e),t,!0)},getTokenTypeAt:function(e){e=ge(this.doc,e);var t,n=Di(this,Qi(this.doc,e.line)),i=0,r=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var s=i+r>>1;if((s?n[2*s-1]:0)>=o)r=s;else{if(!(n[2*s+1]r){e=r;i=!0}n=Qi(this.doc,e)}else n=e;return ft(this,n,{top:0,left:0},t||"page").top+(i?this.doc.height-rr(n):0)},defaultTextHeight:function(){return bt(this.display)},defaultCharWidth:function(){return xt(this.display)},setGutterMarker:Ot(function(e,t,n){return Gn(this.doc,e,"gutter",function(e){var i=e.gutterMarkers||(e.gutterMarkers={});i[t]=n;!n&&Fr(i)&&(e.gutterMarkers=null);return!0})}),clearGutter:Ot(function(e){var t=this,n=t.doc,i=n.first;n.iter(function(n){if(n.gutterMarkers&&n.gutterMarkers[e]){n.gutterMarkers[e]=null;jt(t,i,"gutter");Fr(n.gutterMarkers)&&(n.gutterMarkers=null)}++i})}),lineInfo:function(e){if("number"==typeof e){if(!ve(this.doc,e))return null;var t=e;e=Qi(this.doc,e);if(!e)return null}else{var t=nr(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,i,r){var o=this.display;e=dt(this,ge(this.doc,e));var s=e.bottom,a=e.left;t.style.position="absolute";t.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(t);o.sizer.appendChild(t);if("over"==i)s=e.top;else if("above"==i||"near"==i){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==i||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?s=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(s=e.bottom);a+t.offsetWidth>u&&(a=u-t.offsetWidth)}t.style.top=s+"px";t.style.left=t.style.right="";if("right"==r){a=o.sizer.clientWidth-t.offsetWidth;t.style.right="0px"}else{"left"==r?a=0:"middle"==r&&(a=(o.sizer.clientWidth-t.offsetWidth)/2);t.style.left=a+"px"}n&&Dn(this,a,s,a+t.offsetWidth,s+t.offsetHeight)},triggerOnKeyDown:Ot(hn),triggerOnKeyPress:Ot(mn),triggerOnKeyUp:gn,execCommand:function(e){if(fs.hasOwnProperty(e))return fs[e].call(null,this)},triggerElectric:Ot(function(e){J(this,e)}),findPosH:function(e,t,n,i){var r=1;if(t<0){r=-1;t=-t}for(var o=0,s=ge(this.doc,e);o0&&a(n.charAt(i-1));)--i;for(;r.5)&&s(this);ks(this,"refresh",this)}),swapDoc:Ot(function(e){var t=this.doc;t.cm=null;Xi(this,e);lt(this);this.display.input.reset();this.scrollTo(e.scrollLeft,e.scrollTop);this.curOp.forceScroll=!0;Sr(this,"swapDoc",this,t);return 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}};Ar(e);var ts=e.defaults={},ns=e.optionHandlers={},is=e.Init={toString:function(){return"CodeMirror.Init"}};Wn("value","",function(e,t){e.setValue(t)},!0);Wn("mode",null,function(e,t){e.doc.modeOption=t;n(e)},!0);Wn("indentUnit",2,n,!0);Wn("indentWithTabs",!1);Wn("smartIndent",!0);Wn("tabSize",4,function(e){i(e);lt(e);Dt(e)},!0);Wn("lineSeparator",null,function(e,t){e.doc.lineSep=t;if(t){var n=[],i=e.doc.first;e.doc.iter(function(e){for(var r=0;;){var o=e.text.indexOf(t,r);if(o==-1)break;r=o+t.length;n.push(qo(i,o))}i++});for(var r=n.length-1;r>=0;r--)Pn(e.doc,t,n[r],qo(n[r].line,n[r].ch+t.length))}});Wn("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,n,i){t.state.specialChars=new RegExp(n.source+(n.test("\t")?"":"|\t"),"g");i!=e.Init&&t.refresh()});Wn("specialCharPlaceholder",Ui,function(e){e.refresh()},!0);Wn("electricChars",!0);Wn("inputStyle",Ao?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0);Wn("rtlMoveVisually",!Po);Wn("wholeLineUpdateBefore",!0);Wn("theme","default",function(e){a(e);l(e)},!0);Wn("keyMap","default",function(t,n,i){var r=Zn(n),o=i!=e.Init&&Zn(i);o&&o.detach&&o.detach(t,r);r.attach&&r.attach(t,o||null)});Wn("extraKeys",null);Wn("lineWrapping",!1,r,!0);Wn("gutters",[],function(e){h(e.options);l(e)},!0);Wn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?T(e.display)+"px":"0";e.refresh()},!0);Wn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0);Wn("scrollbarStyle","native",function(e){v(e);y(e);e.display.scrollbars.setScrollTop(e.doc.scrollTop);e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0);Wn("lineNumbers",!1,function(e){h(e.options);l(e)},!0);Wn("firstLineNumber",1,l,!0);Wn("lineNumberFormatter",function(e){return e},l,!0);Wn("showCursorWhenSelecting",!1,ke,!0);Wn("resetSelectionOnContextMenu",!0);Wn("lineWiseCopyCut",!0);Wn("readOnly",!1,function(e,t){if("nocursor"==t){bn(e);e.display.input.blur();e.display.disabled=!0}else e.display.disabled=!1;e.display.input.readOnlyChanged(t)});Wn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0);Wn("dragDrop",!0,Ht);Wn("allowDropFileTypes",null);Wn("cursorBlinkRate",530);Wn("cursorScrollMargin",0);Wn("cursorHeight",1,ke,!0);Wn("singleCursorHeightPerLine",!0,ke,!0);Wn("workTime",100);Wn("workDelay",100);Wn("flattenSpans",!0,i,!0);Wn("addModeClass",!1,i,!0);Wn("pollInterval",100);Wn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t});Wn("historyEventDelay",1250);Wn("viewportMargin",10,function(e){e.refresh()},!0);Wn("maxHighlightLength",1e4,i,!0);Wn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()});Wn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""});Wn("autofocus",null);var rs=e.modes={},os=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t);arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2));rs[t]=n};e.defineMIME=function(e,t){os[e]=t};e.resolveMode=function(t){if("string"==typeof t&&os.hasOwnProperty(t))t=os[t];else if(t&&"string"==typeof t.name&&os.hasOwnProperty(t.name)){var n=os[t.name];"string"==typeof n&&(n={name:n});t=jr(n,t);t.name=n.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}};e.getMode=function(t,n){var n=e.resolveMode(n),i=rs[n.name];if(!i)return e.getMode(t,"text/plain");var r=i(t,n);if(ss.hasOwnProperty(n.name)){var o=ss[n.name];for(var s in o)if(o.hasOwnProperty(s)){r.hasOwnProperty(s)&&(r["_"+s]=r[s]);r[s]=o[s]}}r.name=n.name;n.helperType&&(r.helperType=n.helperType);if(n.modeProps)for(var s in n.modeProps)r[s]=n.modeProps[s];return r};e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}});e.defineMIME("text/plain","null");var ss=e.modeExtensions={};e.extendMode=function(e,t){var n=ss.hasOwnProperty(e)?ss[e]:ss[e]={};Br(t,n)};e.defineExtension=function(t,n){e.prototype[t]=n};e.defineDocExtension=function(e,t){Ss.prototype[e]=t};e.defineOption=Wn;var as=[];e.defineInitHook=function(e){as.push(e)};var ls=e.helpers={};e.registerHelper=function(t,n,i){ls.hasOwnProperty(t)||(ls[t]=e[t]={_global:[]});ls[t][n]=i};e.registerGlobalHelper=function(t,n,i,r){e.registerHelper(t,n,r);ls[t]._global.push({pred:i,val:r})};var us=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var r=t[i];r instanceof Array&&(r=r.concat([]));n[i]=r}return n},cs=e.startState=function(e,t,n){return!e.startState||e.startState(t,n)};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state;e=n.mode}return n||{mode:e,state:t}};var fs=e.commands={selectAll:function(e){e.setSelection(qo(e.firstLine(),0),qo(e.lastLine()),Bs)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Bs)},killLine:function(e){zn(e,function(t){if(t.empty()){var n=Qi(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0){r=new qo(r.line,r.ch+1);e.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),qo(r.line,r.ch-2),r,"+transpose")}else if(r.line>e.doc.first){var s=Qi(e.doc,r.line-1).text;s&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),qo(r.line-1,s.length-1),qo(r.line,1),"+transpose")}}n.push(new fe(r,r))}e.setSelections(n)})},newlineAndIndent:function(e){At(e,function(){for(var t=e.listSelections().length,n=0;n=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1){this.pos=t;return!0}},backUp:function(e){this.pos-=e},column:function(){if(this.lastColumnPos0)return null;i&&t!==!1&&(this.pos+=i[0].length);return i}var r=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(r(o)==r(e)){t!==!1&&(this.pos+=e.length);return!0}},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var vs=0,ys=e.TextMarker=function(e,t){this.lines=[];this.type=t;this.doc=e;this.id=++vs};Ar(ys);ys.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;t&&_t(e);if(Ir(this,"clear")){var n=this.find();n&&Sr(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;oe.display.maxLineLength){e.display.maxLine=l;e.display.maxLineLength=u;e.display.maxLineChanged=!0}}null!=i&&e&&this.collapsed&&Dt(e,i,r+1);this.lines.length=0;this.explicitlyCleared=!0;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=!1;e&&Ie(e.doc)}e&&Sr(e,"markerCleared",e,this);t&&wt(e);this.parent&&this.parent.clear()}};ys.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,i,r=0;r1||!(this.children[0]instanceof Zi))){var a=[];this.collapse(a);this.children=[new Zi(a)];this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var s=r.lines.length%25+25,a=s;a10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var i=0;i=0;o--)Ln(this,i[o]);a?Se(this,a):this.cm&&qn(this.cm)}),undo:Pt(function(){In(this,"undo")}),redo:Pt(function(){In(this,"redo")}),undoSelection:Pt(function(){In(this,"undo",!0)}),redoSelection:Pt(function(){In(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,i=0;i=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,n){e=ge(this,e);t=ge(this,t);var i=[],r=e.line;this.iter(e.line,t.line+1,function(o){var s=o.markedSpans;if(s)for(var a=0;a=l.to||null==l.from&&r!=e.line||null!=l.from&&r==t.line&&l.from>=t.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r});return i},getAllMarks:function(){var e=[];this.iter(function(t){var n=t.markedSpans;if(n)for(var i=0;ie){t=e;return!0}e-=o;++n});return ge(this,qo(n,t))},indexFromPos:function(e){e=ge(this,e);var t=e.ch;if(e.linet&&(t=e.from);null!=e.to&&e.to=t)return s+(t-o);s+=a-o;s+=n-s%n;o=a+1}},Gs=e.findColumn=function(e,t,n){for(var i=0,r=0;;){var o=e.indexOf("\t",i);o==-1&&(o=e.length);var s=o-i;if(o==e.length||r+s>=t)return i+Math.min(s,t-r);r+=o-i;r+=n-r%n;i=o+1;if(r>=t)return i}},zs=[""],Hs=function(e){e.select()};Io?Hs=function(e){e.selectionStart=0;e.selectionEnd=e.value.length}:xo&&(Hs=function(e){try{e.select()}catch(t){}});var Vs,Ws=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ys=e.isWordChar=function(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Ws.test(e))},Zs=/[\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]/;Vs=document.createRange?function(e,t,n,i){var r=document.createRange();r.setEnd(i||e,n);r.setStart(e,t);return r}:function(e,t,n){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(r){return i}i.collapse(!0);i.moveEnd("character",n);i.moveStart("character",t);return i};var $s=e.contains=function(e,t){3==t.nodeType&&(t=t.parentNode);if(e.contains)return e.contains(t);do{11==t.nodeType&&(t=t.host);if(t==e)return!0}while(t=t.parentNode)};xo&&_o<11&&(Wr=function(){try{return document.activeElement}catch(e){return document.body}});var Ks,Xs,Qs=e.rmClass=function(e,t){var n=e.className,i=Yr(t).exec(n);if(i){var r=n.slice(i.index+i[0].length);e.className=n.slice(0,i.index)+(r?i[1]+r:"")}},Js=e.addClass=function(e,t){var n=e.className;Yr(t).test(n)||(e.className+=(n?" ":"")+t)},ea=!1,ta=function(){if(xo&&_o<9)return!1;var e=zr("div");return"draggable"in e||"dragDrop"in e}(),na=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],i=e.length;t<=i;){var r=e.indexOf("\n",t);r==-1&&(r=e.length);var o=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),s=o.indexOf("\r");if(s!=-1){n.push(o.slice(0,s));t+=s+1}else{n.push(o);t=r+1}}return n}:function(e){return e.split(/\r\n?|\n/)},ia=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},ra=function(){var e=zr("div");if("oncopy"in e)return!0;e.setAttribute("oncopy","return;");return"function"==typeof e.oncopy}(),oa=null,sa=e.keyNames={3:"Enter",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:"/",127:"Delete",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"};(function(){for(var e=0;e<10;e++)sa[e+48]=sa[e+96]=String(e);for(var e=65;e<=90;e++)sa[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)sa[e+111]=sa[e+63235]="F"+e})();var aa,la=function(){function e(e){return e<=247?n.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1773?i.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e;this.from=t;this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",i="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,s=/[LRr]/,a=/[Lb1n]/,l=/[1n]/,u="L";return function(n){if(!r.test(n))return!1;for(var i,c=n.length,f=[],p=0;p)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}e.defineMode("javascript",function(n,i){function r(e){for(var t,n=!1,i=!1;null!=(t=e.next());){if(!n){if("/"==t&&!i)return;"["==t?i=!0:i&&"]"==t&&(i=!1)}n=!n&&"\\"==t}}function o(e,t,n){be=e;xe=n;return t}function s(e,n){var i=e.next();if('"'==i||"'"==i){n.tokenize=a(i);return n.tokenize(e,n)}if("."==i&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==i&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(i))return o(i);if("="==i&&e.eat(">"))return o("=>","operator");if("0"==i&&e.eat(/x/i)){e.eatWhile(/[\da-f]/i);return o("number","number")}if("0"==i&&e.eat(/o/i)){e.eatWhile(/[0-7]/i);return o("number","number")}if("0"==i&&e.eat(/b/i)){e.eatWhile(/[01]/i);return o("number","number")}if(/\d/.test(i)){e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return o("number","number")}if("/"==i){if(e.eat("*")){n.tokenize=l;return l(e,n)}if(e.eat("/")){e.skipToEnd();return o("comment","comment")}if(t(e,n,1)){r(e);e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);return o("regexp","string-2")}e.eatWhile(Ne);return o("operator","operator",e.current())}if("`"==i){n.tokenize=u;return u(e,n)}if("#"==i){e.skipToEnd();return o("error","error")}if(Ne.test(i)){e.eatWhile(Ne);return o("operator","operator",e.current())}if(Ce.test(i)){e.eatWhile(Ce);var s=e.current(),c=Le.propertyIsEnumerable(s)&&Le[s];return c&&"."!=n.lastType?o(c.type,c.style,s):o("variable","variable",s)}}function a(e){return function(t,n){var i,r=!1;if(we&&"@"==t.peek()&&t.match(Ie)){n.tokenize=s;return o("jsonld-keyword","meta")}for(;null!=(i=t.next())&&(i!=e||r);)r=!r&&"\\"==i;r||(n.tokenize=s);return o("string","string")}}function l(e,t){for(var n,i=!1;n=e.next();){if("/"==n&&i){t.tokenize=s;break}i="*"==n}return o("comment","comment")}function u(e,t){for(var n,i=!1;null!=(n=e.next());){if(!i&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=s;break}i=!i&&"\\"==n}return o("quasi","string-2",e.current())}function c(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){for(var i=0,r=!1,o=n-1;o>=0;--o){var s=e.string.charAt(o),a=Ae.indexOf(s);if(a>=0&&a<3){if(!i){++o;break}if(0==--i)break}else if(a>=3&&a<6)++i;else if(Ce.test(s))r=!0;else{if(/["'\/]/.test(s))return;if(r&&!i){++o;break}}}r&&!i&&(t.fatArrowAt=o)}}function f(e,t,n,i,r,o){this.indented=e;this.column=t;this.type=n;this.prev=r;this.info=o;null!=i&&(this.align=i)}function p(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var i=e.context;i;i=i.prev)for(var n=i.vars;n;n=n.next)if(n.name==t)return!0}function h(e,t,n,i,r){var o=e.cc;Oe.state=e;Oe.stream=r;Oe.marked=null,Oe.cc=o;Oe.style=t;e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);for(;;){var s=o.length?o.pop():Te?w:E;if(s(n,i)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Oe.marked?Oe.marked:"variable"==n&&p(e,i)?"variable-2":t}}}function d(){for(var e=arguments.length-1;e>=0;e--)Oe.cc.push(arguments[e])}function g(){d.apply(null,arguments);return!0}function m(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var n=Oe.state;Oe.marked="def";if(n.context){if(t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;i.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function v(){Oe.state.context={prev:Oe.state.context,vars:Oe.state.localVars};Oe.state.localVars=Pe}function y(){Oe.state.localVars=Oe.state.context.vars;Oe.state.context=Oe.state.context.prev}function b(e,t){var n=function(){var n=Oe.state,i=n.indented;if("stat"==n.lexical.type)i=n.lexical.indented;else for(var r=n.lexical;r&&")"==r.type&&r.align;r=r.prev)i=r.indented;n.lexical=new f(i,Oe.stream.column(),e,null,n.lexical,t)};n.lex=!0;return n}function x(){var e=Oe.state;if(e.lexical.prev){")"==e.lexical.type&&(e.indented=e.lexical.indented);e.lexical=e.lexical.prev}}function _(e){function t(n){return n==e?g():";"==e?d():g(t)}return t}function E(e,t){if("var"==e)return g(b("vardef",t.length),$,_(";"),x);if("keyword a"==e)return g(b("form"),w,E,x);if("keyword b"==e)return g(b("form"),E,x);if("{"==e)return g(b("}"),H,x);if(";"==e)return g();if("if"==e){"else"==Oe.state.lexical.info&&Oe.state.cc[Oe.state.cc.length-1]==x&&Oe.state.cc.pop()();return g(b("form"),w,E,x,ee)}return"function"==e?g(se):"for"==e?g(b("form"),te,E,x):"variable"==e?g(b("stat"),j):"switch"==e?g(b("form"),w,b("}","switch"),_("{"),H,x,x):"case"==e?g(w,_(":")):"default"==e?g(_(":")):"catch"==e?g(b("form"),v,_("("),ae,_(")"),E,x,y):"class"==e?g(b("form"),le,x):"export"==e?g(b("stat"),pe,x):"import"==e?g(b("stat"),he,x):"module"==e?g(b("form"),K,b("}"),_("{"),H,x,x):"async"==e?g(E):d(b("stat"),w,_(";"),x)}function w(e){return S(e,!1)}function T(e){return S(e,!0)}function S(e,t){if(Oe.state.fatArrowAt==Oe.stream.start){var n=t?P:O;if("("==e)return g(v,b(")"),G(K,")"),x,_("=>"),n,y);if("variable"==e)return d(v,K,_("=>"),n,y)}var i=t?I:N;return Re.hasOwnProperty(e)?g(i):"function"==e?g(se,i):"keyword c"==e||"async"==e?g(t?L:C):"("==e?g(b(")"),C,_(")"),x,i):"operator"==e||"spread"==e?g(t?T:w):"["==e?g(b("]"),ve,x,i):"{"==e?z(q,"}",null,i):"quasi"==e?d(A,i):"new"==e?g(k(t)):g()}function C(e){return e.match(/[;\}\)\],]/)?d():d(w)}function L(e){return e.match(/[;\}\)\],]/)?d():d(T)}function N(e,t){return","==e?g(w):I(e,t,!1)}function I(e,t,n){var i=0==n?N:I,r=0==n?w:T;return"=>"==e?g(v,n?P:O,y):"operator"==e?/\+\+|--/.test(t)?g(i):"?"==t?g(w,_(":"),r):g(r):"quasi"==e?d(A,i):";"!=e?"("==e?z(T,")","call",i):"."==e?g(B,i):"["==e?g(b("]"),C,_("]"),x,i):void 0:void 0}function A(e,t){return"quasi"!=e?d():"${"!=t.slice(t.length-2)?g(A):g(w,R)}function R(e){if("}"==e){Oe.marked="string-2";Oe.state.tokenize=u;return g(A)}}function O(e){c(Oe.stream,Oe.state);return d("{"==e?E:w)}function P(e){c(Oe.stream,Oe.state);return d("{"==e?E:T)}function k(e){return function(t){return"."==t?g(e?D:M):d(e?T:w)}}function M(e,t){if("target"==t){Oe.marked="keyword";return g(N)}}function D(e,t){if("target"==t){Oe.marked="keyword";return g(I)}}function j(e){return":"==e?g(x,E):d(N,_(";"),x)}function B(e){if("variable"==e){Oe.marked="property";return g()}}function q(e,t){if("async"==e)return g(q);if("variable"==e||"keyword"==Oe.style){Oe.marked="property";return g("get"==t||"set"==t?U:F)}if("number"==e||"string"==e){Oe.marked=we?"property":Oe.style+" property";return g(F)}return"jsonld-keyword"==e?g(F):"modifier"==e?g(q):"["==e?g(w,_("]"),F):"spread"==e?g(w):void 0}function U(e){if("variable"!=e)return d(F);Oe.marked="property";return g(se)}function F(e){return":"==e?g(T):"("==e?d(se):void 0}function G(e,t){function n(i,r){if(","==i){var o=Oe.state.lexical;"call"==o.info&&(o.pos=(o.pos||0)+1);return g(function(n,i){return n==t||i==t?d():d(e)},n)}return i==t||r==t?g():g(_(t))}return function(i,r){return i==t||r==t?g():d(e,n)}}function z(e,t,n){for(var i=3;i"),Z):"["==e?g(_("]"),Z):void 0}function $(){return d(K,V,Q,J)}function K(e,t){if("modifier"==e)return g(K);if("variable"==e){m(t);return g()}return"spread"==e?g(K):"["==e?z(K,"]"):"{"==e?z(X,"}"):void 0}function X(e,t){if("variable"==e&&!Oe.stream.match(/^\s*:/,!1)){m(t);return g(Q)}"variable"==e&&(Oe.marked="property");return"spread"==e?g(K):"}"==e?d():g(_(":"),K,Q)}function Q(e,t){if("="==t)return g(T)}function J(e){if(","==e)return g($)}function ee(e,t){if("keyword b"==e&&"else"==t)return g(b("form","else"),E,x)}function te(e){if("("==e)return g(b(")"),ne,_(")"),x)}function ne(e){return"var"==e?g($,_(";"),re):";"==e?g(re):"variable"==e?g(ie):d(w,_(";"),re)}function ie(e,t){if("in"==t||"of"==t){Oe.marked="keyword";return g(w)}return g(N,re)}function re(e,t){if(";"==e)return g(oe);if("in"==t||"of"==t){Oe.marked="keyword";return g(w)}return d(w,_(";"),oe)}function oe(e){")"!=e&&g(w)}function se(e,t){if("*"==t){Oe.marked="keyword";return g(se)}if("variable"==e){m(t);return g(se)}if("("==e)return g(v,b(")"),G(ae,")"),x,V,E,y)}function ae(e){return"spread"==e?g(ae):d(K,V,W)}function le(e,t){if("variable"==e){m(t);return g(ue)}}function ue(e,t){return"extends"==t?g(w,ue):"{"==e?g(b("}"),ce,x):void 0}function ce(e,t){if("variable"==e||"keyword"==Oe.style){if("static"==t){Oe.marked="keyword";return g(ce)}Oe.marked="property";return"get"==t||"set"==t?g(fe,se,ce):g(se,ce)}if("*"==t){Oe.marked="keyword";return g(ce)}return";"==e?g(ce):"}"==e?g():void 0}function fe(e){if("variable"!=e)return d();Oe.marked="property";return g()}function pe(e,t){if("*"==t){Oe.marked="keyword";return g(me,_(";"))}if("default"==t){Oe.marked="keyword";return g(w,_(";"))}return d(E)}function he(e){return"string"==e?g():d(de,me)}function de(e,t){if("{"==e)return z(de,"}");"variable"==e&&m(t);"*"==t&&(Oe.marked="keyword");return g(ge)}function ge(e,t){if("as"==t){Oe.marked="keyword";return g(de)}}function me(e,t){if("from"==t){Oe.marked="keyword";return g(w)}}function ve(e){return"]"==e?g():d(T,G(T,"]"))}function ye(e,t){return"operator"==e.lastType||","==e.lastType||Ne.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var be,xe,_e=n.indentUnit,Ee=i.statementIndent,we=i.jsonld,Te=i.json||we,Se=i.typescript,Ce=i.wordCharacters||/[\w$\xa1-\uffff]/,Le=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),i=e("keyword c"),r=e("operator"),o={type:"atom",style:"atom"},s={"if":e("if"),"while":t,"with":t,"else":n,"do":n,"try":n,"finally":n,"return":i,"break":i,"continue":i,"new":e("new"),"delete":i,"throw":i,"debugger":i,"var":e("var"),"const":e("var"),"let":e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":r,"typeof":r,"instanceof":r,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o,"this":e("this"),"class":e("class"),"super":e("atom"),"yield":i,"export":e("export"),"import":e("import"),"extends":i,await:i,async:e("async")};if(Se){var a={type:"variable",style:"variable-3"},l={"interface":e("class"),"implements":i,namespace:i,module:e("module"),"enum":e("module"),"public":e("modifier"),"private":e("modifier"),"protected":e("modifier"),"abstract":e("modifier"),as:r,string:a,number:a,"boolean":a,any:a};for(var u in l)s[u]=l[u]}return s}(),Ne=/[+\-*&%=<>!?|~^]/,Ie=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Ae="([{}])",Re={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},Oe={state:null,column:null,marked:null,cc:null},Pe={name:"this",next:{name:"arguments"}};x.lex=!0;return{startState:function(e){var t={tokenize:s,lastType:"sof",cc:[],lexical:new f((e||0)-_e,0,"block",(!1)),localVars:i.localVars,context:i.localVars&&{vars:i.localVars},indented:e||0};i.globalVars&&"object"==typeof i.globalVars&&(t.globalVars=i.globalVars);return t},token:function(e,t){if(e.sol()){t.lexical.hasOwnProperty("align")||(t.lexical.align=!1);t.indented=e.indentation();c(e,t)}if(t.tokenize!=l&&e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"==be)return n;t.lastType="operator"!=be||"++"!=xe&&"--"!=xe?be:"incdec";return h(t,n,be,xe,e)},indent:function(t,n){if(t.tokenize==l)return e.Pass;if(t.tokenize!=s)return 0;var r=n&&n.charAt(0),o=t.lexical;if(!/^\s*else\b/.test(n))for(var a=t.cc.length-1;a>=0;--a){var u=t.cc[a];if(u==x)o=o.prev;else if(u!=ee)break}"stat"==o.type&&"}"==r&&(o=o.prev);Ee&&")"==o.type&&"stat"==o.prev.type&&(o=o.prev);var c=o.type,f=r==c;return"vardef"==c?o.indented+("operator"==t.lastType||","==t.lastType?o.info+1:0):"form"==c&&"{"==r?o.indented:"form"==c?o.indented+_e:"stat"==c?o.indented+(ye(t,n)?Ee||_e:0):"switch"!=o.info||f||0==i.doubleIndentSwitch?o.align?o.column+(f?0:1):o.indented+(f?0:_e):o.indented+(/^(?:case|default)\b/.test(n)?_e:2*_e)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Te?null:"/*",
blockCommentEnd:Te?null:"*/",lineComment:Te?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Te?"json":"javascript",jsonldMode:we,jsonMode:Te,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=w&&t!=T||e.cc.pop()}}});e.registerHelper("wordChars","javascript",/[\w$]/);e.defineMIME("text/javascript","javascript");e.defineMIME("text/ecmascript","javascript");e.defineMIME("application/javascript","javascript");e.defineMIME("application/x-javascript","javascript");e.defineMIME("application/ecmascript","javascript");e.defineMIME("application/json",{name:"javascript",json:!0});e.defineMIME("application/x-json",{name:"javascript",json:!0});e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0});e.defineMIME("text/typescript",{name:"javascript",typescript:!0});e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{"../../lib/codemirror":17}],19:[function(e,t,n){(function(i){"object"==typeof n&&"object"==typeof t?i(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],i):i(CodeMirror)})(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(i,r){function o(e,t){function n(n){t.tokenize=n;return n(e,t)}var i=e.next();if("<"==i){if(e.eat("!")){if(e.eat("["))return e.match("CDATA[")?n(l("atom","]]>")):null;if(e.match("--"))return n(l("comment","-->"));if(e.match("DOCTYPE",!0,!0)){e.eatWhile(/[\w\._\-]/);return n(u(1))}return null}if(e.eat("?")){e.eatWhile(/[\w\._\-]/);t.tokenize=l("meta","?>");return"meta"}C=e.eat("/")?"closeTag":"openTag";t.tokenize=s;return"tag bracket"}if("&"==i){var r;r=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";");return r?"atom":"error"}e.eatWhile(/[^&<]/);return null}function s(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">")){t.tokenize=o;C=">"==n?"endTag":"selfcloseTag";return"tag bracket"}if("="==n){C="equals";return null}if("<"==n){t.tokenize=o;t.state=h;t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error"}if(/[\'\"]/.test(n)){t.tokenize=a(n);t.stringStartCol=e.column();return t.tokenize(e,t)}e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return"word"}function a(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=s;break}return"string"};t.isInAttribute=!0;return t}function l(e,t){return function(n,i){for(;!n.eol();){if(n.match(t)){i.tokenize=o;break}n.next()}return e}}function u(e){return function(t,n){for(var i;null!=(i=t.next());){if("<"==i){n.tokenize=u(e+1);return n.tokenize(t,n)}if(">"==i){if(1==e){n.tokenize=o;break}n.tokenize=u(e-1);return n.tokenize(t,n)}}return"meta"}}function c(e,t,n){this.prev=e.context;this.tagName=t;this.indent=e.indented;this.startOfLine=n;(w.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function p(e,t){for(var n;;){if(!e.context)return;n=e.context.tagName;if(!w.contextGrabbers.hasOwnProperty(n)||!w.contextGrabbers[n].hasOwnProperty(t))return;f(e)}}function h(e,t,n){if("openTag"==e){n.tagStart=t.column();return d}return"closeTag"==e?g:h}function d(e,t,n){if("word"==e){n.tagName=t.current();L="tag";return y}L="error";return d}function g(e,t,n){if("word"==e){var i=t.current();n.context&&n.context.tagName!=i&&w.implicitlyClosed.hasOwnProperty(n.context.tagName)&&f(n);if(n.context&&n.context.tagName==i||w.matchClosing===!1){L="tag";return m}L="tag error";return v}L="error";return v}function m(e,t,n){if("endTag"!=e){L="error";return m}f(n);return h}function v(e,t,n){L="error";return m(e,t,n)}function y(e,t,n){if("word"==e){L="attribute";return b}if("endTag"==e||"selfcloseTag"==e){var i=n.tagName,r=n.tagStart;n.tagName=n.tagStart=null;if("selfcloseTag"==e||w.autoSelfClosers.hasOwnProperty(i))p(n,i);else{p(n,i);n.context=new c(n,i,r==n.indented)}return h}L="error";return y}function b(e,t,n){if("equals"==e)return x;w.allowMissing||(L="error");return y(e,t,n)}function x(e,t,n){if("string"==e)return _;if("word"==e&&w.allowUnquoted){L="string";return y}L="error";return y(e,t,n)}function _(e,t,n){return"string"==e?_:y(e,t,n)}var E=i.indentUnit,w={},T=r.htmlMode?t:n;for(var S in T)w[S]=T[S];for(var S in r)w[S]=r[S];var C,L;o.isInText=!0;return{startState:function(e){var t={tokenize:o,state:h,indented:e||0,tagName:null,tagStart:null,context:null};null!=e&&(t.baseIndent=e);return t},token:function(e,t){!t.tagName&&e.sol()&&(t.indented=e.indentation());if(e.eatSpace())return null;C=null;var n=t.tokenize(e,t);if((n||C)&&"comment"!=n){L=null;t.state=t.state(C||n,e,t);L&&(n="error"==L?n+" error":L)}return n},indent:function(t,n,i){var r=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+E;if(r&&r.noIndent)return e.Pass;if(t.tokenize!=s&&t.tokenize!=o)return i?i.match(/^(\s*)/)[0].length:0;if(t.tagName)return w.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+E*(w.multilineTagIndentFactor||1);if(w.alignCDATA&&/$/,blockCommentStart:"",configuration:w.htmlMode?"html":"xml",helperType:w.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=y)}}});e.defineMIME("text/xml","xml");e.defineMIME("application/xml","xml");e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":17}],20:[function(e,t,n){function i(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}var r=e("color-name"),o={};for(var s in r)r.hasOwnProperty(s)&&(o[r[s]]=s);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var l in a)if(a.hasOwnProperty(l)){if(!("channels"in a[l]))throw new Error("missing channels property: "+l);if(!("labels"in a[l]))throw new Error("missing channel labels property: "+l);if(a[l].labels.length!==a[l].channels)throw new Error("channel and label counts mismatch: "+l);var u=a[l].channels,c=a[l].labels;delete a[l].channels;delete a[l].labels;Object.defineProperty(a[l],"channels",{value:u});Object.defineProperty(a[l],"labels",{value:c})}a.rgb.hsl=function(e){var t,n,i,r=e[0]/255,o=e[1]/255,s=e[2]/255,a=Math.min(r,o,s),l=Math.max(r,o,s),u=l-a;l===a?t=0:r===l?t=(o-s)/u:o===l?t=2+(s-r)/u:s===l&&(t=4+(r-o)/u);t=Math.min(60*t,360);t<0&&(t+=360);i=(a+l)/2;n=l===a?0:i<=.5?u/(l+a):u/(2-l-a);return[t,100*n,100*i]};a.rgb.hsv=function(e){var t,n,i,r=e[0],o=e[1],s=e[2],a=Math.min(r,o,s),l=Math.max(r,o,s),u=l-a;n=0===l?0:u/l*1e3/10;l===a?t=0:r===l?t=(o-s)/u:o===l?t=2+(s-r)/u:s===l&&(t=4+(r-o)/u);t=Math.min(60*t,360);t<0&&(t+=360);i=l/255*1e3/10;return[t,n,i]};a.rgb.hwb=function(e){var t=e[0],n=e[1],i=e[2],r=a.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,i));i=1-1/255*Math.max(t,Math.max(n,i));return[r,100*o,100*i]};a.rgb.cmyk=function(e){var t,n,i,r,o=e[0]/255,s=e[1]/255,a=e[2]/255;r=Math.min(1-o,1-s,1-a);t=(1-o-r)/(1-r)||0;n=(1-s-r)/(1-r)||0;i=(1-a-r)/(1-r)||0;return[100*t,100*n,100*i,100*r]};a.rgb.keyword=function(e){var t=o[e];if(t)return t;var n,s=1/0;for(var a in r)if(r.hasOwnProperty(a)){var l=r[a],u=i(e,l);if(u.04045?Math.pow((t+.055)/1.055,2.4):t/12.92;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var r=.4124*t+.3576*n+.1805*i,o=.2126*t+.7152*n+.0722*i,s=.0193*t+.1192*n+.9505*i;return[100*r,100*o,100*s]};a.rgb.lab=function(e){var t,n,i,r=a.rgb.xyz(e),o=r[0],s=r[1],l=r[2];o/=95.047;s/=100;l/=108.883;o=o>.008856?Math.pow(o,1/3):7.787*o+16/116;s=s>.008856?Math.pow(s,1/3):7.787*s+16/116;l=l>.008856?Math.pow(l,1/3):7.787*l+16/116;t=116*s-16;n=500*(o-s);i=200*(s-l);return[t,n,i]};a.hsl.rgb=function(e){var t,n,i,r,o,s=e[0]/360,a=e[1]/100,l=e[2]/100;if(0===a){o=255*l;return[o,o,o]}n=l<.5?l*(1+a):l+a-l*a;t=2*l-n;r=[0,0,0];for(var u=0;u<3;u++){i=s+1/3*-(u-1);i<0&&i++;i>1&&i--;o=6*i<1?t+6*(n-t)*i:2*i<1?n:3*i<2?t+(n-t)*(2/3-i)*6:t;r[u]=255*o}return r};a.hsl.hsv=function(e){var t,n,i=e[0],r=e[1]/100,o=e[2]/100,s=r,a=Math.max(o,.01);o*=2;r*=o<=1?o:2-o;s*=a<=1?a:2-a;n=(o+r)/2;t=0===o?2*s/(a+s):2*r/(o+r);return[i,100*t,100*n]};a.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,i=e[2]/100,r=Math.floor(t)%6,o=t-Math.floor(t),s=255*i*(1-n),a=255*i*(1-n*o),l=255*i*(1-n*(1-o));i*=255;switch(r){case 0:return[i,l,s];case 1:return[a,i,s];case 2:return[s,i,l];case 3:return[s,a,i];case 4:return[l,s,i];case 5:return[i,s,a]}};a.hsv.hsl=function(e){var t,n,i,r=e[0],o=e[1]/100,s=e[2]/100,a=Math.max(s,.01);i=(2-o)*s;t=(2-o)*a;n=o*a;n/=t<=1?t:2-t;n=n||0;i/=2;return[r,100*n,100*i]};a.hwb.rgb=function(e){var t,n,i,r,o=e[0]/360,s=e[1]/100,a=e[2]/100,l=s+a;if(l>1){s/=l;a/=l}t=Math.floor(6*o);n=1-a;i=6*o-t;0!==(1&t)&&(i=1-i);r=s+i*(n-s);var u,c,f;switch(t){default:case 6:case 0:u=n;c=r;f=s;break;case 1:u=r;c=n;f=s;break;case 2:u=s;c=n;f=r;break;case 3:u=s;c=r;f=n;break;case 4:u=r;c=s;f=n;break;case 5:u=n;c=s;f=r}return[255*u,255*c,255*f]};a.cmyk.rgb=function(e){var t,n,i,r=e[0]/100,o=e[1]/100,s=e[2]/100,a=e[3]/100;t=1-Math.min(1,r*(1-a)+a);n=1-Math.min(1,o*(1-a)+a);i=1-Math.min(1,s*(1-a)+a);return[255*t,255*n,255*i]};a.xyz.rgb=function(e){var t,n,i,r=e[0]/100,o=e[1]/100,s=e[2]/100;t=3.2406*r+o*-1.5372+s*-.4986;n=r*-.9689+1.8758*o+.0415*s;i=.0557*r+o*-.204+1.057*s;t=t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t;n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n;i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i;t=Math.min(Math.max(0,t),1);n=Math.min(Math.max(0,n),1);i=Math.min(Math.max(0,i),1);return[255*t,255*n,255*i]};a.xyz.lab=function(e){var t,n,i,r=e[0],o=e[1],s=e[2];r/=95.047;o/=100;s/=108.883;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;o=o>.008856?Math.pow(o,1/3):7.787*o+16/116;s=s>.008856?Math.pow(s,1/3):7.787*s+16/116;t=116*o-16;n=500*(r-o);i=200*(o-s);return[t,n,i]};a.lab.xyz=function(e){var t,n,i,r=e[0],o=e[1],s=e[2];n=(r+16)/116;t=o/500+n;i=n-s/200;var a=Math.pow(n,3),l=Math.pow(t,3),u=Math.pow(i,3);n=a>.008856?a:(n-16/116)/7.787;t=l>.008856?l:(t-16/116)/7.787;i=u>.008856?u:(i-16/116)/7.787;t*=95.047;n*=100;i*=108.883;return[t,n,i]};a.lab.lch=function(e){var t,n,i,r=e[0],o=e[1],s=e[2];t=Math.atan2(s,o);n=360*t/2/Math.PI;n<0&&(n+=360);i=Math.sqrt(o*o+s*s);return[r,i,n]};a.lch.lab=function(e){var t,n,i,r=e[0],o=e[1],s=e[2];i=s/360*2*Math.PI;t=o*Math.cos(i);n=o*Math.sin(i);return[r,t,n]};a.rgb.ansi16=function(e){var t=e[0],n=e[1],i=e[2],r=1 in arguments?arguments[1]:a.rgb.hsv(e)[2];r=Math.round(r/50);if(0===r)return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(t/255));2===r&&(o+=60);return o};a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])};a.rgb.ansi256=function(e){var t=e[0],n=e[1],i=e[2];if(t===n&&n===i)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;var r=16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5);return r};a.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t){e>50&&(t+=3.5);t=t/10.5*255;return[t,t,t]}var n=.5*(~~(e>50)+1),i=(1&t)*n*255,r=(t>>1&1)*n*255,o=(t>>2&1)*n*255;return[i,r,o]};a.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}e-=16;var n,i=Math.floor(e/36)/5*255,r=Math.floor((n=e%36)/6)/5*255,o=n%6/5*255;return[i,r,o]};a.rgb.hex=function(e){var t=((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2])),n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n};a.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map(function(e){return e+e}).join(""));var i=parseInt(n,16),r=i>>16&255,o=i>>8&255,s=255&i;return[r,o,s]};a.rgb.hcg=function(e){var t,n,i=e[0]/255,r=e[1]/255,o=e[2]/255,s=Math.max(Math.max(i,r),o),a=Math.min(Math.min(i,r),o),l=s-a;t=l<1?a/(1-l):0;n=l<=0?0:s===i?(r-o)/l%6:s===r?2+(o-i)/l:4+(i-r)/l+4;n/=6;n%=1;return[360*n,100*l,100*t]};a.hsl.hcg=function(e){var t=e[1]/100,n=e[2]/100,i=1,r=0;i=n<.5?2*t*n:2*t*(1-n);i<1&&(r=(n-.5*i)/(1-i));return[e[0],100*i,100*r]};a.hsv.hcg=function(e){var t=e[1]/100,n=e[2]/100,i=t*n,r=0;i<1&&(r=(n-i)/(1-i));return[e[0],100*i,100*r]};a.hcg.rgb=function(e){var t=e[0]/360,n=e[1]/100,i=e[2]/100;if(0===n)return[255*i,255*i,255*i];var r=[0,0,0],o=t%1*6,s=o%1,a=1-s,l=0;switch(Math.floor(o)){case 0:r[0]=1;r[1]=s;r[2]=0;break;case 1:r[0]=a;r[1]=1;r[2]=0;break;case 2:r[0]=0;r[1]=1;r[2]=s;break;case 3:r[0]=0;r[1]=a;r[2]=1;break;case 4:r[0]=s;r[1]=0;r[2]=1;break;default:r[0]=1;r[1]=0;r[2]=a}l=(1-n)*i;return[255*(n*r[0]+l),255*(n*r[1]+l),255*(n*r[2]+l)]};a.hcg.hsv=function(e){var t=e[1]/100,n=e[2]/100,i=t+n*(1-t),r=0;i>0&&(r=t/i);return[e[0],100*r,100*i]};a.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100,i=n*(1-t)+.5*t,r=0;i>0&&i<.5?r=t/(2*i):i>=.5&&i<1&&(r=t/(2*(1-i)));return[e[0],100*r,100*i]};a.hcg.hwb=function(e){var t=e[1]/100,n=e[2]/100,i=t+n*(1-t);return[e[0],100*(i-t),100*(1-i)]};a.hwb.hcg=function(e){var t=e[1]/100,n=e[2]/100,i=1-n,r=i-t,o=0;r<1&&(o=(i-r)/(1-r));return[e[0],100*r,100*o]};a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};a.gray.hsl=a.gray.hsv=function(e){return[0,0,e[0]]};a.gray.hwb=function(e){return[0,100,e[0]]};a.gray.cmyk=function(e){return[0,0,0,e[0]]};a.gray.lab=function(e){return[e[0],0,0]};a.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=(t<<16)+(t<<8)+t,i=n.toString(16).toUpperCase();return"000000".substring(i.length)+i};a.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]}},{"color-name":23}],21:[function(e,t,n){function i(e){var t=function(t){if(void 0===t||null===t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));return e(t)};"conversion"in e&&(t.conversion=e.conversion);return t}function r(e){var t=function(t){if(void 0===t||null===t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"==typeof n)for(var i=n.length,r=0;r=4&&1!==e[3]&&(t=", "+e[3]);return"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};u.to.keyword=function(e){return a[e.slice(0,3)]}},{"color-name":23,"simple-swizzle":216}],25:[function(e,t,n){"use strict";function i(e,t){if(!(this instanceof i))return new i(e,t);t&&t in h&&(t=null);if(t&&!(t in f))throw new Error("Unknown model: "+t);var n,r;if(e)if(e instanceof i){this.model=e.model;this.color=e.color.slice();this.valpha=e.valpha}else if("string"==typeof e){var o=c.get(e);if(null===o)throw new Error("Unable to parse color from string: "+e);this.model=o.model;r=f[this.model].channels;this.color=o.value.slice(0,r);this.valpha="number"==typeof o.value[r]?o.value[r]:1}else if(e.length){this.model=t||"rgb";r=f[this.model].channels;var s=p.call(e,0,r);this.color=u(s,r);this.valpha="number"==typeof e[r]?e[r]:1}else if("number"==typeof e){e&=16777215;this.model="rgb";this.color=[e>>16&255,e>>8&255,255&e];this.valpha=1}else{this.valpha=1;var a=Object.keys(e);if("alpha"in e){a.splice(a.indexOf("alpha"),1);this.valpha="number"==typeof e.alpha?e.alpha:0}var l=a.sort().join("");if(!(l in d))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=d[l];var m=f[this.model].labels,v=[];for(n=0;nn?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},dark:function(){var e=this.rgb().color,t=(299*e[0]+587*e[1]+114*e[2])/1e3;return t<128},light:function(){return!this.dark()},negate:function(){for(var e=this.rgb(),t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten:function(e){var t=this.hsl();t.color[2]+=t.color[2]*e;return t},darken:function(e){var t=this.hsl();t.color[2]-=t.color[2]*e;return t},saturate:function(e){var t=this.hsl();t.color[1]+=t.color[1]*e;return t},desaturate:function(e){var t=this.hsl();t.color[1]-=t.color[1]*e;return t},whiten:function(e){var t=this.hwb();t.color[1]+=t.color[1]*e;return t},blacken:function(e){var t=this.hwb();t.color[2]+=t.color[2]*e;return t},grayscale:function(){var e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return i.rgb(t,t,t)},fade:function(e){return this.alpha(this.valpha-this.valpha*e)},opaquer:function(e){return this.alpha(this.valpha+this.valpha*e)},rotate:function(e){var t=this.hsl(),n=t.color[0];n=(n+e)%360;n=n<0?360+n:n;t.color[0]=n;return t},mix:function(e,t){var n=this.rgb(),r=e.rgb(),o=void 0===t?.5:t,s=2*o-1,a=n.alpha()-r.alpha(),l=((s*a===-1?s:(s+a)/(1+s*a))+1)/2,u=1-l;return i.rgb(l*n.red()+u*r.red(),l*n.green()+u*r.green(),l*n.blue()+u*r.blue(),n.alpha()*o+r.alpha()*(1-o))}};Object.keys(f).forEach(function(e){if(h.indexOf(e)===-1){var t=f[e].channels;i.prototype[e]=function(){if(this.model===e)return new i(this);if(arguments.length)return new i(arguments,e);var n="number"==typeof arguments[t]?t:this.valpha;return new i(l(f[this.model][e].raw(this.color)).concat(n),e)};i[e]=function(n){"number"==typeof n&&(n=u(p.call(arguments),t));return new i(n,e)}}});t.exports=i},{"color-convert":21,"color-string":24}],26:[function(e,t,n){!function(){var e={YlGn:{3:["#f7fcb9","#addd8e","#31a354"],4:["#ffffcc","#c2e699","#78c679","#238443"],5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]},YlGnBu:{3:["#edf8b1","#7fcdbb","#2c7fb8"],4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]},GnBu:{3:["#e0f3db","#a8ddb5","#43a2ca"],4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"]},BuGn:{3:["#e5f5f9","#99d8c9","#2ca25f"],4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"]},PuBuGn:{3:["#ece2f0","#a6bddb","#1c9099"],4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"]},PuBu:{3:["#ece7f2","#a6bddb","#2b8cbe"],4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],
6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"]},BuPu:{3:["#e0ecf4","#9ebcda","#8856a7"],4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"]},RdPu:{3:["#fde0dd","#fa9fb5","#c51b8a"],4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"]},PuRd:{3:["#e7e1ef","#c994c7","#dd1c77"],4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"]},OrRd:{3:["#fee8c8","#fdbb84","#e34a33"],4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"]},YlOrRd:{3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},YlOrBr:{3:["#fff7bc","#fec44f","#d95f0e"],4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"]},Purples:{3:["#efedf5","#bcbddc","#756bb1"],4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]},Blues:{3:["#deebf7","#9ecae1","#3182bd"],4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]},Greens:{3:["#e5f5e0","#a1d99b","#31a354"],4:["#edf8e9","#bae4b3","#74c476","#238b45"],5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]},Oranges:{3:["#fee6ce","#fdae6b","#e6550d"],4:["#feedde","#fdbe85","#fd8d3c","#d94701"],5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],9:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]},Reds:{3:["#fee0d2","#fc9272","#de2d26"],4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]},Greys:{3:["#f0f0f0","#bdbdbd","#636363"],4:["#f7f7f7","#cccccc","#969696","#525252"],5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]},PuOr:{3:["#f1a340","#f7f7f7","#998ec3"],4:["#e66101","#fdb863","#b2abd2","#5e3c99"],5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"]},BrBG:{3:["#d8b365","#f5f5f5","#5ab4ac"],4:["#a6611a","#dfc27d","#80cdc1","#018571"],5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]},PRGn:{3:["#af8dc3","#f7f7f7","#7fbf7b"],4:["#7b3294","#c2a5cf","#a6dba0","#008837"],5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]},PiYG:{3:["#e9a3c9","#f7f7f7","#a1d76a"],4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]},RdBu:{3:["#ef8a62","#f7f7f7","#67a9cf"],4:["#ca0020","#f4a582","#92c5de","#0571b0"],5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]},RdGy:{3:["#ef8a62","#ffffff","#999999"],4:["#ca0020","#f4a582","#bababa","#404040"],5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"]},RdYlBu:{3:["#fc8d59","#ffffbf","#91bfdb"],4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},Spectral:{3:["#fc8d59","#ffffbf","#99d594"],4:["#d7191c","#fdae61","#abdda4","#2b83ba"],5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],6:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]},RdYlGn:{3:["#fc8d59","#ffffbf","#91cf60"],4:["#d7191c","#fdae61","#a6d96a","#1a9641"],5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]},Accent:{3:["#7fc97f","#beaed4","#fdc086"],4:["#7fc97f","#beaed4","#fdc086","#ffff99"],5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"]},Dark2:{3:["#1b9e77","#d95f02","#7570b3"],4:["#1b9e77","#d95f02","#7570b3","#e7298a"],5:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],6:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],7:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],8:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"]},Paired:{3:["#a6cee3","#1f78b4","#b2df8a"],4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]},Pastel1:{3:["#fbb4ae","#b3cde3","#ccebc5"],4:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],5:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],6:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],7:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],8:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],9:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Pastel2:{3:["#b3e2cd","#fdcdac","#cbd5e8"],4:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],5:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],6:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],7:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],8:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]},Set1:{3:["#e41a1c","#377eb8","#4daf4a"],4:["#e41a1c","#377eb8","#4daf4a","#984ea3"],5:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],6:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],7:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],8:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],9:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},Set2:{3:["#66c2a5","#fc8d62","#8da0cb"],4:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],5:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],6:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],7:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],8:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]},Set3:{3:["#8dd3c7","#ffffb3","#bebada"],4:["#8dd3c7","#ffffb3","#bebada","#fb8072"],5:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],6:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],7:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],8:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],9:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],10:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],11:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],12:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]}};"function"==typeof define&&define.amd?define(e):"object"==typeof t&&t.exports?t.exports=e:this.colorbrewer=e}()},{}],27:[function(e,t,n){t.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],28:[function(e,t,n){"use strict";function i(e){var t,n,i,u,c,f,p,h,d,g,m;e||(e={});h=(e.nshades||72)-1;p=e.format||"hex";f=e.colormap;f||(f="jet");if("string"==typeof f){f=f.toLowerCase();if(!a[f])throw Error(f+" not a supported colorscale");c=a[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);c=f.slice()}if(c.length>h)throw new Error(f+" map requires nshades to be at least size "+c.length);g=Array.isArray(e.alpha)?2!==e.alpha.length?[1,1]:e.alpha.slice():"number"==typeof e.alpha?[e.alpha,e.alpha]:[1,1];t=c.map(function(e){return Math.round(e.index*h)});g[0]=Math.min(Math.max(g[0],0),1);g[1]=Math.min(Math.max(g[1],0),1);var v=c.map(function(e,t){var n=c[t].index,i=c[t].rgb.slice();if(4===i.length&&i[3]>=0&&i[3]<=1)return i;i[3]=g[0]+(g[1]-g[0])*n;return i}),d=[];for(m=0;m=0?(o>=T?10:o>=S?5:o>=C?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=T?10:o>=S?5:o>=C?2:1)}function r(e,t,n){var i=Math.abs(t-e)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/r;o>=T?r*=10:o>=S?r*=5:o>=C&&(r*=2);return tt?1:e>=t?0:NaN},a=function(e){1===e.length&&(e=t(e));return{left:function(t,n,i,r){null==i&&(i=0);null==r&&(r=t.length);for(;i>>1;e(t[o],n)<0?i=o+1:r=o}return i},right:function(t,n,i,r){null==i&&(i=0);null==r&&(r=t.length);for(;i>>1;e(t[o],n)>0?r=o:i=o+1}return i}}},l=a(s),u=l.right,c=l.left,f=function(e,t){null==t&&(t=n);for(var i=0,r=e.length-1,o=e[0],s=new Array(r<0?0:r);ie?1:t>=e?0:NaN},d=function(e){return null===e?NaN:+e},g=function(e,t){var n,i,r=e.length,o=0,s=-1,a=0,l=0;if(null==t){for(;++s1)return l/(o-1)},m=function(e,t){var n=g(e,t);return n?Math.sqrt(n):n},v=function(e,t){var n,i,r,o=e.length,s=-1;if(null==t){for(;++s=n){i=r=n;for(;++sn&&(i=n);r=n){i=r=n;for(;++sn&&(i=n);r0)return[e];(r=t0){e=Math.ceil(e/a);t=Math.floor(t/a);s=new Array(o=Math.ceil(t-e+1));for(;++lp;)h.pop(),--d;var g,m=new Array(d+1);for(o=0;o<=d;++o){g=m[o]=[];g.x0=o>0?h[o-1]:f;g.x1=o=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,o=Math.floor(r),s=+n(e[o],o,e),a=+n(e[o+1],o+1,e);return s+(a-s)*(r-o)}},R=function(e,t,n){e=x.call(e,d).sort(s);return Math.ceil((n-t)/(2*(A(e,.75)-A(e,.25))*Math.pow(e.length,-1/3)))},O=function(e,t,n){return Math.ceil((n-t)/(3.5*m(e)*Math.pow(e.length,-1/3)))},P=function(e,t){var n,i,r=e.length,o=-1;if(null==t){for(;++o=n){i=n;for(;++oi&&(i=n)}}else for(;++o=n){i=n;for(;++oi&&(i=n)}return i;
},k=function(e,t){var n,i=e.length,r=i,o=-1,s=0;if(null==t)for(;++o=0;){i=e[r];t=i.length;for(;--t>=0;)n[--s]=i[t]}return n},j=function(e,t){var n,i,r=e.length,o=-1;if(null==t){for(;++o=n){i=n;for(;++on&&(i=n)}}else for(;++o=n){i=n;for(;++on&&(i=n)}return i},B=function(e,t){for(var n=t.length,i=new Array(n);n--;)i[n]=e[t[n]];return i},q=function(e,t){if(n=e.length){var n,i,r=0,o=0,a=e[o];null==t&&(t=s);for(;++rMath.abs(e[1]-te[1])?U=!0:q=!0);te=e;B=!0;y();i()}function i(){var e;D=te[0]-ee[0];j=te[1]-ee[1];switch(z){case x:case b:H&&(D=Math.max($-p,Math.min(X-S,D)),g=p+D,R=S+D);V&&(j=Math.max(K-m,Math.min(Q-P,j)),v=m+j,M=P+j);break;case _:H<0?(D=Math.max($-p,Math.min(X-p,D)),g=p+D,R=S):H>0&&(D=Math.max($-S,Math.min(X-S,D)),g=p,R=S+D);V<0?(j=Math.max(K-m,Math.min(Q-m,j)),v=m+j,M=P):V>0&&(j=Math.max(K-P,Math.min(Q-P,j)),v=m,M=P+j);break;case E:H&&(g=Math.max($,Math.min(X,p-D*H)),R=Math.max($,Math.min(X,S+D*H)));V&&(v=Math.max(K,Math.min(Q,m-j*V)),M=Math.max(K,Math.min(Q,P+j*V)))}if(R0&&(p=g-D);V<0?P=M-j:V>0&&(m=v-j);z=x;re.attr("cursor",C.selection);i()}break;default:return}y()}function u(){switch(r.event.keyCode){case 16:if(J){q=U=J=!1;i()}break;case 18:if(z===E){H<0?S=R:H>0&&(p=g);V<0?P=M:V>0&&(m=v);z=_;i()}break;case 32:if(z===x){if(r.event.altKey){H&&(S=R-D*H,p=g+D*H);V&&(P=M-j*V,m=v+j*V);z=E}else{H<0?S=R:H>0&&(p=g);V<0?P=M:V>0&&(m=v);z=_}re.attr("cursor",C[G]);i()}break;default:return}y()}if(r.event.touches){if(r.event.changedTouches.length=c.length){null!=a&&t.sort(a);return null!=l?l(t):t}for(var s,u,f,p=-1,h=t.length,d=c[i++],g=n(),m=r();++pc.length)return e;var i,r=f[n-1];null!=l&&n>=c.length?i=e.entries():(i=[],e.each(function(e,r){i.push({key:r,values:t(e,n)})}));return null!=r?i.sort(function(e,t){return r(e.key,t.key)}):i}var a,l,u,c=[],f=[];return u={object:function(t){return e(t,0,i,r)},map:function(t){return e(t,0,o,s)},entries:function(n){return t(e(n,0,o,s),0)},key:function(e){c.push(e);return u},sortKeys:function(e){f[c.length-1]=e;return u},sortValues:function(e){a=e;return u},rollup:function(e){l=e;return u}}},f=n.prototype;a.prototype=l.prototype={constructor:a,has:f.has,add:function(e){e+="";this[u+e]=e;return this},remove:f.remove,clear:f.clear,values:f.keys,size:f.size,empty:f.empty,each:f.each};var p=function(e){var t=[];for(var n in e)t.push(n);return t},h=function(e){var t=[];for(var n in e)t.push(e[n]);return t},d=function(e){var t=[];for(var n in e)t.push({key:n,value:e[n]});return t};e.nest=c;e.set=l;e.map=n;e.keys=p;e.values=h;e.entries=d;Object.defineProperty(e,"__esModule",{value:!0})})},{}],35:[function(e,t,n){(function(e,i){"object"==typeof n&&"undefined"!=typeof t?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(e.d3=e.d3||{})})(this,function(e){"use strict";function t(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function n(){}function i(e){var t;e=(e+"").trim().toLowerCase();return(t=P.exec(e))?(t=parseInt(t[1],16),new l(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1)):(t=k.exec(e))?r(parseInt(t[1],16)):(t=M.exec(e))?new l(t[1],t[2],t[3],1):(t=D.exec(e))?new l(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=j.exec(e))?o(t[1],t[2],t[3],t[4]):(t=B.exec(e))?o(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=q.exec(e))?u(t[1],t[2]/100,t[3]/100,1):(t=U.exec(e))?u(t[1],t[2]/100,t[3]/100,t[4]):F.hasOwnProperty(e)?r(F[e]):"transparent"===e?new l(NaN,NaN,NaN,0):null}function r(e){return new l(e>>16&255,e>>8&255,255&e,1)}function o(e,t,n,i){i<=0&&(e=t=n=NaN);return new l(e,t,n,i)}function s(e){e instanceof n||(e=i(e));if(!e)return new l;e=e.rgb();return new l(e.r,e.g,e.b,e.opacity)}function a(e,t,n,i){return 1===arguments.length?s(e):new l(e,t,n,null==i?1:i)}function l(e,t,n,i){this.r=+e;this.g=+t;this.b=+n;this.opacity=+i}function u(e,t,n,i){i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN);return new p(e,t,n,i)}function c(e){if(e instanceof p)return new p(e.h,e.s,e.l,e.opacity);e instanceof n||(e=i(e));if(!e)return new p;if(e instanceof p)return e;e=e.rgb();var t=e.r/255,r=e.g/255,o=e.b/255,s=Math.min(t,r,o),a=Math.max(t,r,o),l=NaN,u=a-s,c=(a+s)/2;if(u){l=t===a?(r-o)/u+6*(r0&&c<1?0:l;return new p(l,u,c,e.opacity)}function f(e,t,n,i){return 1===arguments.length?c(e):new p(e,t,n,null==i?1:i)}function p(e,t,n,i){this.h=+e;this.s=+t;this.l=+n;this.opacity=+i}function h(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function d(e){if(e instanceof m)return new m(e.l,e.a,e.b,e.opacity);if(e instanceof w){var t=e.h*G;return new m(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}e instanceof l||(e=s(e));var n=x(e.r),i=x(e.g),r=x(e.b),o=v((.4124564*n+.3575761*i+.1804375*r)/V),a=v((.2126729*n+.7151522*i+.072175*r)/W),u=v((.0193339*n+.119192*i+.9503041*r)/Y);return new m(116*a-16,500*(o-a),200*(a-u),e.opacity)}function g(e,t,n,i){return 1===arguments.length?d(e):new m(e,t,n,null==i?1:i)}function m(e,t,n,i){this.l=+e;this.a=+t;this.b=+n;this.opacity=+i}function v(e){return e>X?Math.pow(e,1/3):e/K+Z}function y(e){return e>$?e*e*e:K*(e-Z)}function b(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function x(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function _(e){if(e instanceof w)return new w(e.h,e.c,e.l,e.opacity);e instanceof m||(e=d(e));var t=Math.atan2(e.b,e.a)*z;return new w(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function E(e,t,n,i){return 1===arguments.length?_(e):new w(e,t,n,null==i?1:i)}function w(e,t,n,i){this.h=+e;this.c=+t;this.l=+n;this.opacity=+i}function T(e){if(e instanceof C)return new C(e.h,e.s,e.l,e.opacity);e instanceof l||(e=s(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(oe*i+ie*t-re*n)/(oe+ie-re),o=i-r,a=(ne*(n-r)-ee*o)/te,u=Math.sqrt(a*a+o*o)/(ne*r*(1-r)),c=u?Math.atan2(a,o)*z-120:NaN;return new C(c<0?c+360:c,u,r,e.opacity)}function S(e,t,n,i){return 1===arguments.length?T(e):new C(e,t,n,null==i?1:i)}function C(e,t,n,i){this.h=+e;this.s=+t;this.l=+n;this.opacity=+i}var L=function(e,t,n){e.prototype=t.prototype=n;n.constructor=e},N=.7,I=1/N,A="\\s*([+-]?\\d+)\\s*",R="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",O="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",P=/^#([0-9a-f]{3})$/,k=/^#([0-9a-f]{6})$/,M=new RegExp("^rgb\\("+[A,A,A]+"\\)$"),D=new RegExp("^rgb\\("+[O,O,O]+"\\)$"),j=new RegExp("^rgba\\("+[A,A,A,R]+"\\)$"),B=new RegExp("^rgba\\("+[O,O,O,R]+"\\)$"),q=new RegExp("^hsl\\("+[R,O,O]+"\\)$"),U=new RegExp("^hsla\\("+[R,O,O,R]+"\\)$"),F={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};L(n,i,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}});L(l,a,t(n,{brighter:function(e){e=null==e?I:Math.pow(I,e);return new l(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){e=null==e?N:Math.pow(N,e);return new l(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var e=this.opacity;e=isNaN(e)?1:Math.max(0,Math.min(1,e));return(1===e?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}}));L(p,f,t(n,{brighter:function(e){e=null==e?I:Math.pow(I,e);return new p(this.h,this.s,this.l*e,this.opacity)},darker:function(e){e=null==e?N:Math.pow(N,e);return new p(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new l(h(e>=240?e-240:e+120,r,i),h(e,r,i),h(e<120?e+240:e-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var G=Math.PI/180,z=180/Math.PI,H=18,V=.95047,W=1,Y=1.08883,Z=4/29,$=6/29,K=3*$*$,X=$*$*$;L(m,g,t(n,{brighter:function(e){return new m(this.l+H*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new m(this.l-H*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;e=W*y(e);t=V*y(t);n=Y*y(n);return new l(b(3.2404542*t-1.5371385*e-.4985314*n),b(-.969266*t+1.8760108*e+.041556*n),b(.0556434*t-.2040259*e+1.0572252*n),this.opacity)}}));L(w,E,t(n,{brighter:function(e){return new w(this.h,this.c,this.l+H*(null==e?1:e),this.opacity)},darker:function(e){return new w(this.h,this.c,this.l-H*(null==e?1:e),this.opacity)},rgb:function(){return d(this).rgb()}}));var Q=-.14861,J=1.78277,ee=-.29227,te=-.90649,ne=1.97294,ie=ne*te,re=ne*J,oe=J*ee-te*Q;L(C,S,t(n,{brighter:function(e){e=null==e?I:Math.pow(I,e);return new C(this.h,this.s,this.l*e,this.opacity)},darker:function(e){e=null==e?N:Math.pow(N,e);return new C(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*G,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new l(255*(t+n*(Q*i+J*r)),255*(t+n*(ee*i+te*r)),255*(t+n*(ne*i)),this.opacity)}}));e.color=i;e.rgb=a;e.hsl=f;e.lab=g;e.hcl=E;e.cubehelix=S;Object.defineProperty(e,"__esModule",{value:!0})})},{}],36:[function(e,t,n){(function(e,i){"object"==typeof n&&"undefined"!=typeof t?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(e.d3=e.d3||{})})(this,function(e){"use strict";function t(){for(var e,t=0,i=arguments.length,r={};t=0&&(n=e.slice(i+1),e=e.slice(0,i));if(e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}})}function r(e,t){for(var n,i=0,r=e.length;i0)for(var n,i,r=new Array(n),o=0;oR}N.mouse("drag")}function g(){n.select(n.event.view).on("mousemove.drag mouseup.drag",null);r(n.event.view,E);c();N.mouse("end")}function m(){if(T.apply(this,arguments)){var e,t,r=n.event.changedTouches,o=S.apply(this,arguments),s=r.length;for(e=0;e=c)h=!0;else if((n=e.charCodeAt(f++))===a)d=!0;else if(n===l){d=!0;e.charCodeAt(f)===a&&++f}return e.slice(i+1,t-1).replace(/""/g,'"')}for(;fp+a||id+a||rf.index){var l=p-o.x-o.vx,c=d-o.y-o.vy,v=l*l+c*c;if(ve.r&&(e.r=e[t].r)}function r(){if(a){var t,n,i=a.length;l=new Array(i);for(t=0;t1?(null==t?d.remove(e):d.set(e,a(t)),l):d.get(e)},find:function(t,n,i){var r,o,s,a,l,u=0,c=e.length;null==i?i=1/0:i*=i;for(u=0;u1?(y.on(e,t),l):y.on(e)}}},b=function(){function e(e){var n,l=o.length,f=t.quadtree(o,u,c).visitAfter(i);for(a=e,n=0;n=g)){if(e.data!==s||e.next){0===r&&(r=h(),c+=r*r);0===o&&(o=h(),c+=o*o);c",r=t[3]||"-",o=t[4]||"",s=!!t[5],a=t[6]&&+t[6],l=!!t[7],u=t[8]&&+t[8].slice(1),c=t[9]||"";"n"===c?(l=!0,c="g"):p[c]||(c="");(s||"0"===n&&"="===i)&&(s=!0,n="0",i="=");this.fill=n;this.align=i;this.sign=r;this.symbol=o;this.zero=s;this.width=a;this.comma=l;this.precision=u;this.type=c}function i(t){d=v(t);e.format=d.format;e.formatPrefix=d.formatPrefix;return d}var r,o=function(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]},s=function(e){return e=o(Math.abs(e)),e?e[1]:NaN},a=function(e,t){return function(n,i){for(var r=n.length,o=[],s=0,a=e[0],l=0;r>0&&a>0;){l+a+1>i&&(a=Math.max(1,i-l));o.push(n.substring(r-=a,r+a));if((l+=a+1)>i)break;a=e[s=(s+1)%e.length]}return o.reverse().join(t)}},l=function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}},u=function(e,t){e=e.toPrecision(t);e:for(var n,i=e.length,r=1,o=-1;r0&&(o=0)}return o>0?e.slice(0,o)+e.slice(n+1):e},c=function(e,t){var n=o(e,t);if(!n)return e+"";var i=n[0],s=n[1],a=s-(r=3*Math.max(-8,Math.min(8,Math.floor(s/3))))+1,l=i.length;return a===l?i:a>l?i+new Array(a-l+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+o(e,Math.max(0,t+a-1))[0]},f=function(e,t){var n=o(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array((-r)).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")},p={"":u,"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.round(e).toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return f(100*e,t)},r:f,s:c,X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}},h=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;t.prototype=n.prototype;n.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var d,g=function(e){return e},m=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],v=function(e){function n(e){function n(e){var t,n,l,u=x,p=_;if("c"===b){p=E(e)+p;e=""}else{e=+e;var h=e<0;e=E(Math.abs(e),y);h&&0===+e&&(h=!1);u=(h?"("===a?a:"-":"-"===a||"("===a?"":a)+u;p=("s"===b?m[8+r/3]:"")+p+(h&&"("===a?")":"");if(w){t=-1,n=e.length;for(;++tl||l>57){p=(46===l?c+e.slice(t+1):e.slice(t))+p;e=e.slice(0,t);break}}}v&&!d&&(e=o(e,1/0));var T=u.length+e.length+p.length,S=T>1)+u+e+p+S.slice(T);break;default:e=S+u+e+p}return f(e)}e=t(e);var i=e.fill,s=e.align,a=e.sign,l=e.symbol,d=e.zero,g=e.width,v=e.comma,y=e.precision,b=e.type,x="$"===l?u[0]:"#"===l&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",_="$"===l?u[1]:/[%p]/.test(b)?h:"",E=p[b],w=!b||/[defgprs%]/.test(b);y=null==y?b?6:12:/[gprs]/.test(b)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));n.toString=function(){return e+""};return n}function i(e,i){var r=n((e=t(e),e.type="f",e)),o=3*Math.max(-8,Math.min(8,Math.floor(s(i)/3))),a=Math.pow(10,-o),l=m[8+o/3];return function(e){return r(a*e)+l}}var o=e.grouping&&e.thousands?a(e.grouping,e.thousands):g,u=e.currency,c=e.decimal,f=e.numerals?l(e.numerals):g,h=e.percent||"%";return{format:n,formatPrefix:i}};i({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var y=function(e){return Math.max(0,-s(Math.abs(e)))},b=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(s(t)/3)))-s(Math.abs(e)))},x=function(e,t){e=Math.abs(e),t=Math.abs(t)-e;return Math.max(0,s(t)-s(e))+1};e.formatDefaultLocale=i;e.formatLocale=v;e.formatSpecifier=t;e.precisionFixed=y;e.precisionPrefix=b;e.precisionRound=x;Object.defineProperty(e,"__esModule",{value:!0})})},{}],42:[function(e,t,n){(function(i,r){"object"==typeof n&&"undefined"!=typeof t?r(n,e("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-array"],r):r(i.d3=i.d3||{},i.d3)})(this,function(e,t){"use strict";function n(){this.reset()}function i(e,t,n){var i=e.s=t+n,r=i-t,o=i-r;e.t=t-o+(n-r)}function r(e){return e>1?0:e<-1?Yt:Math.acos(e)}function o(e){return e>1?Zt:e<-1?-Zt:Math.asin(e)}function s(e){return(e=ln(e/2))*e}function a(){}function l(e,t){e&&hn.hasOwnProperty(e.type)&&hn[e.type](e,t)}function u(e,t,n){var i,r=-1,o=e.length-n;t.lineStart();for(;++r=0?1:-1,r=i*n,o=nn(t),s=ln(t),a=vt*s,l=mt*o+a*nn(r),u=a*i*ln(r);gn.add(tn(u,l));gt=e,mt=o,vt=s}function g(e){return[tn(e[1],e[0]),o(e[2])]}function m(e){var t=e[0],n=e[1],i=nn(n);return[i*nn(t),i*ln(t),ln(n)]}function v(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function y(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function b(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function x(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function _(e){var t=cn(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function E(e,t){Ct.push(Lt=[yt=e,xt=e]);t_t&&(_t=t)}function w(e,t){var n=m([e*Qt,t*Qt]);if(St){var i=y(St,n),r=[i[1],-i[0],0],o=y(r,i);_(o);o=g(o);var s,a=e-Et,l=a>0?1:-1,u=o[0]*Xt*l,c=Jt(a)>180;if(c^(l*Et_t&&(_t=s)}else if(u=(u+360)%360-180,c^(l*Et_t&&(_t=t)}if(c)eI(yt,xt)&&(xt=e):I(e,xt)>I(yt,xt)&&(yt=e);else if(xt>=yt){ext&&(xt=e)}else e>Et?I(yt,e)>I(yt,xt)&&(xt=e):I(e,xt)>I(yt,xt)&&(yt=e)}else Ct.push(Lt=[yt=e,xt=e]);t_t&&(_t=t);St=n,Et=e}function T(){xn.point=w}function S(){Lt[0]=yt,Lt[1]=xt;xn.point=E;St=null}function C(e,t){if(St){var n=e-Et;bn.add(Jt(n)>180?n+(n>0?360:-360):n)}else wt=e,Tt=t;vn.point(e,t);w(e,t)}function L(){vn.lineStart()}function N(){C(wt,Tt);vn.lineEnd();Jt(bn)>Vt&&(yt=-(xt=180));Lt[0]=yt,Lt[1]=xt;St=null}function I(e,t){return(t-=e)<0?t+360:t}function A(e,t){return e[0]-t[0]}function R(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tYt?e-Kt:e<-Yt?e+Kt:e,t]}function z(e,t,n){return(e%=Kt)?t||n?Sn(V(e),W(t,n)):V(e):t||n?W(t,n):G}function H(e){return function(t,n){return t+=e,[t>Yt?t-Kt:t<-Yt?t+Kt:t,n]}}function V(e){var t=H(e);t.invert=H(-e);return t}function W(e,t){function n(e,t){var n=nn(t),l=nn(e)*n,u=ln(e)*n,c=ln(t),f=c*i+l*r;return[tn(u*s-f*a,l*i-c*r),o(f*s+u*a)]}var i=nn(e),r=ln(e),s=nn(t),a=ln(t);n.invert=function(e,t){var n=nn(t),l=nn(e)*n,u=ln(e)*n,c=ln(t),f=c*s-u*a;return[tn(u*s+c*a,l*i+f*r),o(f*i-l*r)]};return n}function Y(e,t,n,i,r,o){if(n){var s=nn(t),a=ln(t),l=i*n;if(null==r){r=t+i*Kt;o=t-l/2}else{r=Z(s,r);o=Z(s,o);(i>0?ro)&&(r+=i*Kt)}for(var u,c=r;i>0?c>o:c1}function Q(e,t){return((e=e.x)[0]<0?e[1]-Zt-Vt:Zt-e[1])-((t=t.x)[0]<0?t[1]-Zt-Vt:Zt-t[1])}function J(e){var t,n=NaN,i=NaN,r=NaN;return{lineStart:function(){e.lineStart();t=1},point:function(o,s){var a=o>0?Yt:-Yt,l=Jt(o-n);if(Jt(l-Yt)0?Zt:-Zt);e.point(r,i);e.lineEnd();e.lineStart();e.point(a,i);e.point(o,i);t=0}else if(r!==a&&l>=Yt){Jt(n-r)Vt?en((ln(t)*(o=nn(i))*ln(n)-ln(i)*(r=nn(t))*ln(e))/(r*o*s)):(t+i)/2}function te(e,t,n,i){var r;if(null==e){r=n*Zt;i.point(-Yt,r);i.point(0,r);i.point(Yt,r);i.point(Yt,0);i.point(Yt,-r);i.point(0,-r);i.point(-Yt,-r);i.point(-Yt,0);i.point(-Yt,r)}else if(Jt(e[0]-t[0])>Vt){var o=e[0]0){do l.point(0===c||3===c?e:i,c>1?r:n);while((c=(c+s+4)%4)!==f)}else l.point(o[0],o[1])}function a(t,r){return Jt(t[0]-e)0?0:3:Jt(t[0]-i)0?2:1:Jt(t[1]-n)0?1:0:r>0?3:2}function l(e,t){return u(e.x,t.x)}function u(e,t){var n=a(e,1),i=a(t,1);return n!==i?n-i:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(a){function u(e,t){o(e,t)&&L.point(e,t)}function c(){for(var t=0,n=0,i=v.length;nr&&(f-o)*(r-s)>(p-s)*(e-o)&&++t:p<=r&&(f-o)*(r-s)<(p-s)*(e-o)&&--t}return t}function f(){L=N,m=[],v=[],C=!0}function p(){var e=c(),n=C&&e,i=(m=t.merge(m)).length;if(n||i){a.polygonStart();if(n){a.lineStart();s(null,null,1,a);a.lineEnd()}i&&Fn(m,l,e,s,a);a.polygonEnd()}L=a,m=v=y=null}function h(){I.point=g;v&&v.push(y=[]);S=!0;T=!1;E=w=NaN}function d(){if(m){g(b,x);_&&T&&N.rejoin();m.push(N.result())}I.point=u;T&&L.lineEnd()}function g(t,s){var a=o(t,s);v&&y.push([t,s]);if(S){b=t,x=s,_=a;S=!1;if(a){L.lineStart();L.point(t,s)}}else if(a&&T)L.point(t,s);else{var l=[E=Math.max($n,Math.min(Zn,E)),w=Math.max($n,Math.min(Zn,w))],u=[t=Math.max($n,Math.min(Zn,t)),s=Math.max($n,Math.min(Zn,s))];if(Yn(l,u,e,n,i,r)){if(!T){L.lineStart();L.point(l[0],l[1])}L.point(u[0],u[1]);a||L.lineEnd();C=!1}else if(a){L.lineStart();L.point(t,s);C=!1}}E=t,w=s,T=a}var m,v,y,b,x,_,E,w,T,S,C,L=a,N=qn(),I={point:u,lineStart:h,lineEnd:d,polygonStart:f,polygonEnd:p};return I}}function ie(){Qn.point=oe;Qn.lineEnd=re}function re(){Qn.point=Qn.lineEnd=a}function oe(e,t){e*=Qt,t*=Qt;Cn=e,Ln=ln(t),Nn=nn(t);Qn.point=se}function se(e,t){e*=Qt,t*=Qt;var n=ln(t),i=nn(t),r=Jt(e-Cn),o=nn(r),s=ln(r),a=i*s,l=Nn*n-Ln*i*o,u=Ln*n+Nn*i*o;Xn.add(tn(cn(a*a+l*l),u));Cn=e,Ln=n,Nn=i}function ae(e,t){return!(!e||!ri.hasOwnProperty(e.type))&&ri[e.type](e,t)}function le(e,t){return 0===ni(e,t)}function ue(e,t){var n=ni(e[0],e[1]),i=ni(e[0],t),r=ni(t,e[1]);return i+r<=n+Vt}function ce(e,t){return!!zn(e.map(fe),pe(t))}function fe(e){return e=e.map(pe),e.pop(),e}function pe(e){return[e[0]*Qt,e[1]*Qt]}function he(e,n,i){var r=t.range(e,n-Vt,i).concat(n);return function(e){return r.map(function(t){return[e,t]})}}function de(e,n,i){var r=t.range(e,n-Vt,i).concat(n);return function(e){return r.map(function(t){return[t,e]})}}function ge(){function e(){return{type:"MultiLineString",coordinates:n()}}function n(){return t.range(rn(s/v)*v,o,v).map(h).concat(t.range(rn(c/y)*y,u,y).map(d)).concat(t.range(rn(r/g)*g,i,g).filter(function(e){return Jt(e%v)>Vt}).map(f)).concat(t.range(rn(l/m)*m,a,m).filter(function(e){return Jt(e%y)>Vt}).map(p))}var i,r,o,s,a,l,u,c,f,p,h,d,g=10,m=g,v=90,y=360,b=2.5;e.lines=function(){return n().map(function(e){return{type:"LineString",coordinates:e}})};e.outline=function(){return{type:"Polygon",coordinates:[h(s).concat(d(u).slice(1),h(o).reverse().slice(1),d(c).reverse().slice(1))]}};e.extent=function(t){return arguments.length?e.extentMajor(t).extentMinor(t):e.extentMinor()};e.extentMajor=function(t){if(!arguments.length)return[[s,c],[o,u]];s=+t[0][0],o=+t[1][0];c=+t[0][1],u=+t[1][1];s>o&&(t=s,s=o,o=t);c>u&&(t=c,c=u,u=t);return e.precision(b)};e.extentMinor=function(t){if(!arguments.length)return[[r,l],[i,a]];r=+t[0][0],i=+t[1][0];l=+t[0][1],a=+t[1][1];r>i&&(t=r,r=i,i=t);l>a&&(t=l,l=a,a=t);return e.precision(b)};e.step=function(t){return arguments.length?e.stepMajor(t).stepMinor(t):e.stepMinor()};e.stepMajor=function(t){if(!arguments.length)return[v,y];v=+t[0],y=+t[1];return e};e.stepMinor=function(t){if(!arguments.length)return[g,m];g=+t[0],m=+t[1];return e};e.precision=function(t){if(!arguments.length)return b;b=+t;f=he(l,a,90);p=de(r,i,b);h=he(c,u,90);d=de(s,o,b);return e};return e.extentMajor([[-180,-90+Vt],[180,90-Vt]]).extentMinor([[-180,-80-Vt],[180,80+Vt]])}function me(){return ge()()}function ve(){ci.point=ye}function ye(e,t){ci.point=be;In=Rn=e,An=On=t}function be(e,t){ui.add(On*e-Rn*t);Rn=e,On=t}function xe(){be(In,An)}function _e(e,t){ehi&&(hi=e);tdi&&(di=t)}function Ee(e,t){mi+=e;vi+=t;++yi}function we(){Si.point=Te}function Te(e,t){Si.point=Se;Ee(Mn=e,Dn=t)}function Se(e,t){var n=e-Mn,i=t-Dn,r=cn(n*n+i*i);bi+=r*(Mn+e)/2;xi+=r*(Dn+t)/2;_i+=r;Ee(Mn=e,Dn=t)}function Ce(){Si.point=Ee}function Le(){Si.point=Ie}function Ne(){Ae(Pn,kn)}function Ie(e,t){Si.point=Ae;Ee(Pn=Mn=e,kn=Dn=t)}function Ae(e,t){var n=e-Mn,i=t-Dn,r=cn(n*n+i*i);bi+=r*(Mn+e)/2;xi+=r*(Dn+t)/2;_i+=r;r=Dn*e-Mn*t;Ei+=r*(Mn+e);wi+=r*(Dn+t);Ti+=3*r;Ee(Mn=e,Dn=t)}function Re(e){this._context=e}function Oe(e,t){Oi.point=Pe;Li=Ii=e,Ni=Ai=t}function Pe(e,t){Ii-=e,Ai-=t;Ri.add(cn(Ii*Ii+Ai*Ai));Ii=e,Ai=t}function ke(){this._string=[]}function Me(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function De(e){return function(t){var n=new je;for(var i in e)n[i]=e[i];n.stream=t;return n}}function je(){}function Be(e,t,n){var i=e.clipExtent&&e.clipExtent();e.scale(150).translate([0,0]);null!=i&&e.clipExtent(null);dn(n,e.stream(gi));t(gi.result());null!=i&&e.clipExtent(i);return e}function qe(e,t,n){return Be(e,function(n){var i=t[1][0]-t[0][0],r=t[1][1]-t[0][1],o=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),s=+t[0][0]+(i-o*(n[1][0]+n[0][0]))/2,a=+t[0][1]+(r-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([s,a])},n)}function Ue(e,t,n){return qe(e,[[0,0],t],n)}function Fe(e,t,n){return Be(e,function(n){var i=+t,r=i/(n[1][0]-n[0][0]),o=(i-r*(n[1][0]+n[0][0]))/2,s=-r*n[0][1];e.scale(150*r).translate([o,s])},n)}function Ge(e,t,n){return Be(e,function(n){var i=+t,r=i/(n[1][1]-n[0][1]),o=-r*n[0][0],s=(i-r*(n[1][1]+n[0][1]))/2;e.scale(150*r).translate([o,s])},n)}function ze(e){return De({point:function(t,n){t=e(t,n);this.stream.point(t[0],t[1])}})}function He(e,t){function n(i,r,s,a,l,u,c,f,p,h,d,g,m,v){var y=c-i,b=f-r,x=y*y+b*b;if(x>4*t&&m--){var _=a+h,E=l+d,w=u+g,T=cn(_*_+E*E+w*w),S=o(w/=T),C=Jt(Jt(w)-1)t||Jt((y*A+b*R)/x-.5)>.3||a*h+l*d+u*g2?e[2]%360*Qt:0,r()):[_*Xt,E*Xt,w*Xt]};t.precision=function(e){return arguments.length?(I=ji(i,N=e*e),o()):cn(N)};t.fitExtent=function(e,n){return qe(t,e,n)};t.fitSize=function(e,n){return Ue(t,e,n)};t.fitWidth=function(e,n){return Fe(t,e,n)};t.fitHeight=function(e,n){return Ge(t,e,n)};return function(){s=e.apply(this,arguments);t.invert=s.invert&&n;return r()}}function Ze(e){var t=0,n=Yt/3,i=Ye(e),r=i(t,n);r.parallels=function(e){return arguments.length?i(t=e[0]*Qt,n=e[1]*Qt):[t*Xt,n*Xt]};return r}function $e(e){function t(e,t){return[e*n,ln(t)/n]}var n=nn(e);t.invert=function(e,t){return[e/n,o(t*n)]};return t}function Ke(e,t){function n(e,t){var n=cn(s-2*r*ln(t))/r;return[n*ln(e*=r),a-n*nn(e)]}var i=ln(e),r=(i+ln(t))/2;if(Jt(r)0?t<-Zt+Vt&&(t=-Zt+Vt):t>Zt-Vt&&(t=Zt-Vt);var n=o/an(nt(t),r);return[n*ln(r*e),o-n*nn(r*e)]}var i=nn(e),r=e===t?ln(e):sn(i/nn(t))/sn(nt(t)/nt(e)),o=i*an(nt(e),r)/r;if(!r)return et;n.invert=function(e,t){var n=o-t,i=un(r)*cn(e*e+n*n);return[tn(e,Jt(n))/r*un(n),2*en(an(o/i,1/r))-Zt]};return n}function rt(e,t){return[e,t]}function ot(e,t){function n(e,t){var n=o-t,i=r*e;return[n*ln(i),o-n*nn(i)]}var i=nn(e),r=e===t?ln(e):(i-nn(t))/(t-e),o=i/r+e;if(Jt(r)0?1:e<0?-1:0},cn=Math.sqrt,fn=Math.tan,pn={Feature:function(e,t){l(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++iVt?_t=90:bn<-Vt&&(bt=-90);Lt[0]=yt,Lt[1]=xt}},_n=function(e){var t,n,i,r,o,s,a;_t=xt=-(yt=bt=1/0);Ct=[];dn(e,xn);if(n=Ct.length){Ct.sort(A);for(t=1,i=Ct[0],o=[i];tI(i[0],i[1])&&(i[1]=r[1]);I(r[0],i[1])>I(i[0],i[1])&&(i[0]=r[0])}else o.push(i=r)}for(s=-(1/0),n=o.length-1,t=0,i=o[n];t<=n;i=r,++t){r=o[t];(a=I(i[1],r[0]))>s&&(s=a,yt=r[0],xt=i[1])}}Ct=Lt=null;return yt===1/0||bt===1/0?[[NaN,NaN],[NaN,NaN]]:[[yt,bt],[xt,_t]]},En={sphere:a,point:O,lineStart:k,lineEnd:j,polygonStart:function(){En.lineStart=B;En.lineEnd=q},polygonEnd:function(){En.lineStart=k;En.lineEnd=j}},wn=function(e){Nt=It=At=Rt=Ot=Pt=kt=Mt=Dt=jt=Bt=0;dn(e,En);var t=Dt,n=jt,i=Bt,r=t*t+n*n+i*i;if(r2?e[2]*Qt:0);t.invert=function(t){t=e.invert(t[0]*Qt,t[1]*Qt);return t[0]*=Xt,t[1]*=Xt,t};return t},Bn=function(){function e(e,t){n.push(e=i(e,t));e[0]*=Xt,e[1]*=Xt}function t(){var e=r.apply(this,arguments),t=o.apply(this,arguments)*Qt,l=s.apply(this,arguments)*Qt;n=[];i=z(-e[0]*Qt,-e[1]*Qt,0).invert;Y(a,t,l,1);e={type:"Polygon",coordinates:[n]};n=i=null;return e}var n,i,r=Tn([0,0]),o=Tn(90),s=Tn(6),a={point:e};t.center=function(e){return arguments.length?(r="function"==typeof e?e:Tn([+e[0],+e[1]]),t):r};t.radius=function(e){return arguments.length?(o="function"==typeof e?e:Tn(+e),t):o};t.precision=function(e){return arguments.length?(s="function"==typeof e?e:Tn(+e),t):s};return t},qn=function(){var e,t=[];return{point:function(t,n){e.push([t,n])},lineStart:function(){t.push(e=[])},lineEnd:a,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;t=[];e=null;return n}}},Un=function(e,t){return Jt(e[0]-t[0])=0;--o)r.point((c=u[o])[0],c[1])}else i(p.x,p.p.x,-1,r);p=p.p}p=p.o;u=p.z;h=!h}while(!p.v);r.lineEnd()}}},Gn=pt(),zn=function(e,t){var n=t[0],i=t[1],r=[ln(n),-nn(n),0],s=0,a=0;Gn.reset();for(var l=0,u=e.length;l=0?1:-1,N=L*C,I=N>Yt,A=g*T;Gn.add(tn(A*L*ln(N),v*S+A*nn(N)));s+=I?C+L*Kt:C;if(I^h>=n^E>=n){var R=y(m(p),m(x));_(R);var O=y(r,R);_(O);var P=(I^C>=0?-1:1)*o(O[2]);(i>P||i===P&&(R[0]||R[1]))&&(a+=I^C>=0?1:-1)}}return(s<-Vt||s0){b||(o.polygonStart(),b=!0);o.lineStart();for(e=0;e1&&2&r&&s.push(s.pop().concat(s.shift()));d.push(s.filter(X))}}var h,d,g,m=n(o),v=qn(),y=n(v),b=!1,x={point:s,lineStart:l,lineEnd:u,polygonStart:function(){x.point=c;x.lineStart=f;x.lineEnd=p;d=[];h=[]},polygonEnd:function(){x.point=s;x.lineStart=l;x.lineEnd=u;d=t.merge(d);var e=zn(h,r);if(d.length){b||(o.polygonStart(),b=!0);Fn(d,Q,e,i,o)}else if(e){b||(o.polygonStart(),b=!0);o.lineStart();i(null,null,1,o);o.lineEnd()}b&&(o.polygonEnd(),b=!1);d=h=null},sphere:function(){o.polygonStart();o.lineStart();i(null,null,1,o);o.lineEnd();o.polygonEnd()}};return x}},Vn=Hn(function(){return!0},J,te,[-Yt,-Zt]),Wn=function(e){function t(t,n,i,r){Y(r,e,a,i,t,n)}function n(e,t){return nn(e)*nn(t)>s}function i(e){var t,i,s,a,c;return{lineStart:function(){a=s=!1;c=1},point:function(f,p){var h,d=[f,p],g=n(f,p),m=l?g?0:o(f,p):g?o(f+(f<0?Yt:-Yt),p):0;!t&&(a=s=g)&&e.lineStart();if(g!==s){h=r(t,d);if(!h||Un(t,h)||Un(d,h)){d[0]+=Vt;d[1]+=Vt;g=n(d[0],d[1])}}if(g!==s){c=0;if(g){e.lineStart();h=r(d,t);e.point(h[0],h[1])}else{h=r(t,d);e.point(h[0],h[1]);e.lineEnd()}t=h}else if(u&&t&&l^g){var v;if(!(m&i)&&(v=r(d,t,!0))){c=0;if(l){e.lineStart();e.point(v[0][0],v[0][1]);e.point(v[1][0],v[1][1]);e.lineEnd()}else{e.point(v[1][0],v[1][1]);e.lineEnd();e.lineStart();e.point(v[0][0],v[0][1])}}}!g||t&&Un(t,d)||e.point(d[0],d[1]);t=d,s=g,i=m},lineEnd:function(){s&&e.lineEnd();t=null},clean:function(){return c|(a&&s)<<1}}}function r(e,t,n){var i=m(e),r=m(t),o=[1,0,0],a=y(i,r),l=v(a,a),u=a[0],c=l-u*u;if(!c)return!n&&e;var f=s*l/c,p=-s*u/c,h=y(o,a),d=x(o,f),_=x(a,p);b(d,_);var E=h,w=v(d,E),T=v(E,E),S=w*w-T*(v(d,d)-1);if(!(S<0)){var C=cn(S),L=x(E,(-w-C)/T);b(L,d);L=g(L);if(!n)return L;var N,I=e[0],A=t[0],R=e[1],O=t[1];A0^L[1]<(Jt(L[0]-I)Yt^(I<=L[0]&&L[0]<=A)){var D=x(E,(-w+C)/T);b(D,d);return[L,g(D)]}}}function o(t,n){var i=l?e:Yt-e,r=0;t<-i?r|=1:t>i&&(r|=2);n<-i?r|=4:n>i&&(r|=8);return r}var s=nn(e),a=6*Qt,l=s>0,u=Jt(s)>Vt;return Hn(n,i,t,l?[0,-e]:[-Yt,e-Yt])},Yn=function(e,t,n,i,r,o){var s,a=e[0],l=e[1],u=t[0],c=t[1],f=0,p=1,h=u-a,d=c-l;s=n-a;if(h||!(s>0)){s/=h;if(h<0){if(s0){if(s>p)return;s>f&&(f=s)}s=r-a;if(h||!(s<0)){s/=h;if(h<0){if(s>p)return;s>f&&(f=s)}else if(h>0){if(s0)){s/=d;if(d<0){if(s0){if(s>p)return;s>f&&(f=s)}s=o-l;if(d||!(s<0)){s/=d;if(d<0){if(s>p)return;s>f&&(f=s)}else if(d>0){if(s0&&(e[0]=a+f*h,e[1]=l+f*d);p<1&&(t[0]=a+p*h,t[1]=l+p*d);return!0}}}}},Zn=1e9,$n=-Zn,Kn=function(){var e,t,n,i=0,r=0,o=960,s=500;return n={stream:function(n){return e&&t===n?e:e=ne(i,r,o,s)(t=n)},extent:function(a){return arguments.length?(i=+a[0][0],r=+a[0][1],o=+a[1][0],s=+a[1][1],e=t=null,n):[[i,r],[o,s]]}}},Xn=pt(),Qn={sphere:a,point:a,lineStart:ie,lineEnd:a,polygonStart:a,polygonEnd:a},Jn=function(e){Xn.reset();dn(e,Qn);return+Xn},ei=[null,null],ti={type:"LineString",coordinates:ei},ni=function(e,t){ei[0]=e;ei[1]=t;return Jn(ti)},ii={Feature:function(e,t){return ae(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i=.12&&r<.234&&i>=-.425&&i<-.214?u:r>=.166&&r<.234&&i>=-.214&&i<-.115?c:l).invert(e)};e.stream=function(e){return n&&i===e?n:n=Xe([l.stream(i=e),u.stream(e),c.stream(e)])};e.precision=function(e){if(!arguments.length)return l.precision();l.precision(e),u.precision(e),c.precision(e);return t()};e.scale=function(t){if(!arguments.length)return l.scale();l.scale(t),u.scale(.35*t),c.scale(t);return e.translate(l.translate())};e.translate=function(e){if(!arguments.length)return l.translate();var n=l.scale(),i=+e[0],a=+e[1];r=l.translate(e).clipExtent([[i-.455*n,a-.238*n],[i+.455*n,a+.238*n]]).stream(f);o=u.translate([i-.307*n,a+.201*n]).clipExtent([[i-.425*n+Vt,a+.12*n+Vt],[i-.214*n-Vt,a+.234*n-Vt]]).stream(f);s=c.translate([i-.205*n,a+.212*n]).clipExtent([[i-.214*n+Vt,a+.166*n+Vt],[i-.115*n-Vt,a+.234*n-Vt]]).stream(f);return t()};e.fitExtent=function(t,n){return qe(e,t,n)};e.fitSize=function(t,n){return Ue(e,t,n)};e.fitWidth=function(t,n){return Fe(e,t,n)};e.fitHeight=function(t,n){return Ge(e,t,n)};return e.scale(1070)},Gi=Qe(function(e){return cn(2/(1+e))});Gi.invert=Je(function(e){return 2*o(e/2)});var zi=function(){return We(Gi).scale(124.75).clipAngle(179.999)},Hi=Qe(function(e){return(e=r(e))&&e/ln(e)});Hi.invert=Je(function(e){return e});var Vi=function(){return We(Hi).scale(79.4188).clipAngle(179.999)};et.invert=function(e,t){return[e,2*en(on(t))-Zt]};var Wi=function(){return tt(et).scale(961/Kt)},Yi=function(){return Ze(it).scale(109.5).parallels([30,30])};rt.invert=rt;var Zi=function(){return We(rt).scale(152.63)},$i=function(){return Ze(ot).scale(131.154).center([0,13.9389])};st.invert=Je(en);var Ki=function(){return We(st).scale(144.049).clipAngle(60)},Xi=function(){function e(){r=o=null;return s}var t,n,i,r,o,s,a=1,l=0,u=0,c=1,f=1,p=ai,h=null,d=ai;return s={stream:function(e){return r&&o===e?r:r=p(d(o=e))},postclip:function(r){return arguments.length?(d=r,h=t=n=i=null,e()):d},clipExtent:function(r){return arguments.length?(d=null==r?(h=t=n=i=null,ai):ne(h=+r[0][0],t=+r[0][1],n=+r[1][0],i=+r[1][1]),e()):null==h?null:[[h,t],[n,i]]},scale:function(t){return arguments.length?(p=at((a=+t)*c,a*f,l,u),e()):a},translate:function(t){return arguments.length?(p=at(a*c,a*f,l=+t[0],u=+t[1]),e()):[l,u]},reflectX:function(t){return arguments.length?(p=at(a*(c=t?-1:1),a*f,l,u),e()):c<0},reflectY:function(t){return arguments.length?(p=at(a*c,a*(f=t?-1:1),l,u),e()):f<0},fitExtent:function(e,t){return qe(s,e,t)},fitSize:function(e,t){return Ue(s,e,t)},fitWidth:function(e,t){return Fe(s,e,t)},fitHeight:function(e,t){return Ge(s,e,t)}}};lt.invert=function(e,t){var n,i=t,r=25;do{var o=i*i,s=o*o;i-=n=(i*(1.007226+o*(.015085+s*(-.044475+.028874*o-.005916*s)))-t)/(1.007226+o*(.045255+s*(-.311325+.259866*o-.005916*11*s)))}while(Jt(n)>Vt&&--r>0);return[e/(.8707+(o=i*i)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),i]};var Qi=function(){return We(lt).scale(175.295)};ut.invert=Je(o);var Ji=function(){return We(ut).scale(249.5).clipAngle(90+Vt)};ct.invert=Je(function(e){return 2*en(e)});var er=function(){return We(ct).scale(250).clipAngle(142)};ft.invert=function(e,t){return[-t,2*en(on(e))-Zt]};var tr=function(){var e=tt(ft),t=e.center,n=e.rotate;e.center=function(e){return arguments.length?t([-e[1],e[0]]):(e=t(),[e[1],-e[0]])};e.rotate=function(e){return arguments.length?n([e[0],e[1],e.length>2?e[2]+90:90]):(e=n(),[e[0],e[1],e[2]-90])};return n([0,0,90]).scale(159.155)};e.geoArea=yn;e.geoBounds=_n;e.geoCentroid=wn;e.geoCircle=Bn;e.geoClipAntimeridian=Vn;e.geoClipCircle=Wn;e.geoClipExtent=Kn;e.geoClipRectangle=ne;e.geoContains=oi;e.geoDistance=ni;e.geoGraticule=ge;e.geoGraticule10=me;e.geoInterpolate=si;e.geoLength=Jn;e.geoPath=Pi;e.geoAlbers=Ui;e.geoAlbersUsa=Fi;e.geoAzimuthalEqualArea=zi;e.geoAzimuthalEqualAreaRaw=Gi;e.geoAzimuthalEquidistant=Vi;e.geoAzimuthalEquidistantRaw=Hi;e.geoConicConformal=Yi;e.geoConicConformalRaw=it;e.geoConicEqualArea=qi;e.geoConicEqualAreaRaw=Ke;e.geoConicEquidistant=$i;e.geoConicEquidistantRaw=ot;e.geoEquirectangular=Zi;e.geoEquirectangularRaw=rt;e.geoGnomonic=Ki;e.geoGnomonicRaw=st;e.geoIdentity=Xi;e.geoProjection=We;e.geoProjectionMutator=Ye;e.geoMercator=Wi;e.geoMercatorRaw=et;e.geoNaturalEarth1=Qi;e.geoNaturalEarth1Raw=lt;e.geoOrthographic=Ji;e.geoOrthographicRaw=ut;e.geoStereographic=er;e.geoStereographicRaw=ct;e.geoTransverseMercator=tr;e.geoTransverseMercatorRaw=ft;e.geoRotation=jn;e.geoStream=dn;e.geoTransform=ki;Object.defineProperty(e,"__esModule",{value:!0})})},{"d3-array":30}],43:[function(e,t,n){(function(e,i){"object"==typeof n&&"undefined"!=typeof t?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(e.d3=e.d3||{})})(this,function(e){"use strict";function t(e,t){return e.parent===t.parent?1:2}function n(e){return e.reduce(i,0)/e.length}function i(e,t){return e+t.x}function r(e){return 1+e.reduce(o,0)}function o(e,t){return Math.max(e,t.y)}function s(e){for(var t;t=e.children;)e=t[0];return e}function a(e){for(var t;t=e.children;)e=t[t.length-1];return e}function l(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function u(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;e=n.pop();t=i.pop();for(;e===t;){r=e;e=n.pop();t=i.pop()}return r}function c(e,t){var n,i,r,o,s,a=new g(e),l=+e.value&&(a.value=e.value),u=[a];null==t&&(t=p);for(;n=u.pop();){l&&(n.value=+n.data.value);if((r=t(n.data))&&(s=r.length)){n.children=new Array(s);for(o=s-1;o>=0;--o){u.push(i=n.children[o]=new g(r[o]));i.parent=n;i.depth=n.depth+1}}}return a.eachBefore(d)}function f(){return c(this).eachBefore(h)}function p(e){return e.children}function h(e){e.data=e.data.data}function d(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function g(e){this.data=e;this.depth=this.height=0;this.parent=null}function m(e){for(var t,n,i=e.length;i;){n=Math.random()*i--|0;t=e[i];e[i]=e[n];e[n]=t}return e}function v(e,t){var n,i;if(x(t,e))return[t];for(n=0;n0&&n*n>i*i+r*r}function x(e,t){for(var n=0;nn*n+i*i}function L(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,o=(t.y*n.r+n.y*t.r)/i;return r*r+o*o}function N(e){this._=e;this.next=null;this.previous=null}function I(e){if(!(r=e.length))return 0;var t,n,i,r,o,s,a,l,u,c,f;t=e[0],t.x=0,t.y=0;if(!(r>1))return t.r;n=e[1],t.x=-n.r,n.x=t.r,n.y=0;if(!(r>2))return t.r+n.r;S(n,t,i=e[2]);t=new N(t),n=new N(n),i=new N(i);t.next=i.previous=n;n.next=t.previous=i;i.next=n.previous=t;e:for(a=3;a=0;){t=r[o];t.z+=n;t.m+=n;n+=t.s+(i+=t.c)}}function H(e,t,n){return e.a.parent===t.parent?e.a:n}function V(e,t){this._=e;this.parent=null;this.children=null;this.A=null;this.a=this;this.z=0;this.m=0;this.c=0;this.s=0;this.t=null;this.i=t}function W(e){for(var t,n,i,r,o,s=new V(e,0),a=[s];t=a.pop();)if(i=t._.children){t.children=new Array(o=i.length);for(r=o-1;r>=0;--r){a.push(n=t.children[r]=new V(i[r],r));n.parent=t}}(s.parent=new V(null,0)).children=[s];return s}function Y(e,t,n,i,r,o){for(var s,a,l,u,c,f,p,h,d,g,m,v=[],y=t.children,b=0,x=0,_=y.length,E=t.value;b<_;){l=r-n,u=o-i;do c=y[x++].value;while(!c&&x<_);f=p=c;g=Math.max(u/l,l/u)/(E*e);m=c*c*g;d=Math.max(p/m,m/f);for(;x<_;++x){c+=a=y[x].value;ap&&(p=a);m=c*c*g;h=Math.max(p/m,m/f);if(h>d){c-=a;break}d=h}v.push(s={value:c,dice:l=0;--n)r.push(t[n])}return this},Q=function(e){for(var t,n,i,r=this,o=[r],s=[];r=o.pop();){s.push(r),t=r.children;if(t)for(n=0,i=t.length;n=0;)n+=i[r].value;t.value=n})},ee=function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},te=function(e){for(var t=this,n=u(t,e),i=[t];t!==n;){t=t.parent;i.push(t)}for(var r=i.length;e!==n;){i.splice(r,0,e);e=e.parent}return i},ne=function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},ie=function(){var e=[];this.each(function(t){e.push(t)});return e},re=function(){var e=[];this.eachBefore(function(t){t.children||e.push(t)});return e},oe=function(){var e=this,t=[];e.each(function(n){n!==e&&t.push({source:n.parent,target:n})});return t};g.prototype=c.prototype={constructor:g,count:$,each:K,eachAfter:Q,eachBefore:X,sum:J,sort:ee,path:te,ancestors:ne,descendants:ie,leaves:re,links:oe,copy:f};var se=Array.prototype.slice,ae=function(e){for(var t,n,i=0,r=(e=m(se.call(e))).length,o=[];i0)throw new Error("cycle");return o}var t=j,n=B;e.id=function(n){return arguments.length?(t=R(n),
e):t};e.parentId=function(t){return arguments.length?(n=R(t),e):n};return e};V.prototype=Object.create(g.prototype);var ye=function(){function e(e){var i=W(e);i.eachAfter(t),i.parent.m=-i.z;i.eachBefore(n);if(l)e.eachBefore(r);else{var u=e,c=e,f=e;e.eachBefore(function(e){e.xc.x&&(c=e);e.depth>f.depth&&(f=e)});var p=u===c?1:o(u,c)/2,h=p-u.x,d=s/(c.x+p+h),g=a/(f.depth||1);e.eachBefore(function(e){e.x=(e.x+h)*d;e.y=e.depth*g})}return e}function t(e){var t=e.children,n=e.parent.children,r=e.i?n[e.i-1]:null;if(t){z(e);var s=(t[0].z+t[t.length-1].z)/2;if(r){e.z=r.z+o(e._,r._);e.m=e.z-s}else e.z=s}else r&&(e.z=r.z+o(e._,r._));e.parent.A=i(e,r,e.parent.A||n[0])}function n(e){e._.x=e.z+e.parent.m;e.m+=e.parent.m}function i(e,t,n){if(t){for(var i,r=e,s=e,a=t,l=r.parent.children[0],u=r.m,c=s.m,f=a.m,p=l.m;a=F(a),r=U(r),a&&r;){l=U(l);s=F(s);s.a=e;i=a.z+f-r.z-u+o(a._,r._);if(i>0){G(H(a,e,n),e,i);u+=i;c+=i}f+=a.m;u+=r.m;p+=l.m;c+=s.m}if(a&&!F(s)){s.t=a;s.m+=f-c}if(r&&!U(l)){l.t=r;l.m+=u-p;n=e}}return n}function r(e){e.x*=s;e.y=e.depth*a}var o=q,s=1,a=1,l=null;e.separation=function(t){return arguments.length?(o=t,e):o};e.size=function(t){return arguments.length?(l=!1,s=+t[0],a=+t[1],e):l?null:[s,a]};e.nodeSize=function(t){return arguments.length?(l=!0,s=+t[0],a=+t[1],e):l?[s,a]:null};return e},be=function(e,t,n,i,r){for(var o,s=e.children,a=-1,l=s.length,u=e.value&&(r-n)/e.value;++a1?e:1)};return t}(xe),Ee=function(){function e(e){e.x0=e.y0=0;e.x1=r;e.y1=o;e.eachBefore(t);s=[0];i&&e.eachBefore(fe);return e}function t(e){var t=s[e.depth],i=e.x0+t,r=e.y0+t,o=e.x1-t,p=e.y1-t;o=t-1){var u=l[e];u.x0=i,u.y0=r;u.x1=s,u.y1=a}else{for(var f=c[e],p=n/2+f,h=e+1,d=t-1;h>>1;c[g]a-r){var y=(i*v+s*m)/n;o(e,h,m,i,r,y,a);o(h,t,v,y,r,s,a)}else{var b=(r*v+a*m)/n;o(e,h,m,i,r,s,b);o(h,t,v,i,b,s,a)}}}var s,a,l=e.children,u=l.length,c=new Array(u+1);for(c[0]=a=s=0;s1?e:1)};return t}(xe);e.cluster=Z;e.hierarchy=c;e.pack=ce;e.packSiblings=le;e.packEnclose=ae;e.partition=he;e.stratify=ve;e.tree=ye;e.treemap=Ee;e.treemapBinary=we;e.treemapDice=pe;e.treemapSlice=be;e.treemapSliceDice=Te;e.treemapSquarify=_e;e.treemapResquarify=Se;Object.defineProperty(e,"__esModule",{value:!0})})},{}],44:[function(e,t,n){(function(i,r){"object"==typeof n&&"undefined"!=typeof t?r(n,e("d3-color")):"function"==typeof define&&define.amd?define(["exports","d3-color"],r):r(i.d3=i.d3||{},i.d3)})(this,function(e,t){"use strict";function n(e,t,n,i,r){var o=e*e,s=o*e;return((1-3*e+3*o-s)*t+(4-6*o+3*s)*n+(1+3*e+3*o-3*s)*i+s*r)/6}function i(e,t){return function(n){return e+n*t}}function r(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function o(e,t){var n=t-e;return n?i(e,n>180||n<-180?n-360*Math.round(n/360):n):L(isNaN(e)?t:e)}function s(e){return 1===(e=+e)?a:function(t,n){return n-t?r(t,n,e):L(isNaN(t)?n:t)}}function a(e,t){var n=t-e;return n?i(e,n):L(isNaN(e)?t:e)}function l(e){return function(n){var i,r,o=n.length,s=new Array(o),a=new Array(o),l=new Array(o);for(i=0;i180?t+=360:t-e>180&&(e+=360);o.push({i:n.push(r(n)+"rotate(",null,i)-2,x:P(e,t)})}else t&&n.push(r(n)+"rotate("+t+i)}function a(e,t,n,o){e!==t?o.push({i:n.push(r(n)+"skewX(",null,i)-2,x:P(e,t)}):t&&n.push(r(n)+"skewX("+t+i)}function l(e,t,n,i,o,s){if(e!==n||t!==i){var a=o.push(r(o)+"scale(",null,",",null,")");s.push({i:a-4,x:P(e,n)},{i:a-2,x:P(t,i)})}else 1===n&&1===i||o.push(r(o)+"scale("+n+","+i+")")}return function(t,n){var i=[],r=[];t=e(t),n=e(n);o(t.translateX,t.translateY,n.translateX,n.translateY,i,r);s(t.rotate,n.rotate,i,r);a(t.skewX,n.skewX,i,r);l(t.scaleX,t.scaleY,n.scaleX,n.scaleY,i,r);t=n=null;return function(e){for(var t,n=-1,o=r.length;++n=1?(i=1,t-1):Math.floor(i*t),o=e[r],s=e[r+1],a=r>0?e[r-1]:2*o-s,l=r