Simon Ilyushchenko 6fd6e4c383 v0.1.31
2014-06-20 13:49:31 -07:00

126 lines
65 KiB
JavaScript

(function() {var h,aa=aa||{},k=this,l=function(a){return void 0!==a},ba=function(){},ca=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=
typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b},m=function(a){return"array"==ca(a)},da=function(a){var b=ca(a);return"array"==b||"object"==b&&"number"==typeof a.length},p=function(a){return"string"==typeof a},ea=function(a){return"number"==typeof a},q=function(a){return"function"==ca(a)},r=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b},fa=function(a,b,
c){return a.call.apply(a.bind,arguments)},ga=function(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}},s=function(a,b,c){s=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?fa:ga;return s.apply(null,arguments)},ha=Date.now||function(){return+new Date},
t=function(a,b){var c=a.split("."),d=k;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&l(b)?d[e]=b:d=d[e]?d[e]:d[e]={}},u=function(a,b){function c(){}c.prototype=b.prototype;a.m=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.Bb=function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}};
Function.prototype.bind=Function.prototype.bind||function(a,b){if(1<arguments.length){var c=Array.prototype.slice.call(arguments,1);c.unshift(this,a);return s.apply(null,c)}return s(this,a)};var ia=function(a,b){for(var c in a)b.call(void 0,a[c],c,a)},ka=function(a){var b=ja,c={},d;for(d in b)a.call(void 0,b[d],d,b)&&(c[d]=b[d]);return c},la=function(a,b,c){var d={},e;for(e in a)d[e]=b.call(c,a[e],e,a);return d},ma=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b},na=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b},oa=function(a,b){b in a&&delete a[b]},v=function(a){var b={},c;for(c in a)b[c]=a[c];return b},pa=function(a){var b=ca(a);if("object"==b||"array"==b){if(a.clone)return a.clone();
var b="array"==b?[]:{},c;for(c in a)b[c]=pa(a[c]);return b}return a},qa="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),ra=function(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<qa.length;f++)c=qa[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};var sa=function(a){a=String(a);if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);},va=function(a){this.Z=a};va.prototype.h=function(a){var b=[];wa(this,a,b);return b.join("")};
var wa=function(a,b,c){switch(typeof b){case "string":xa(b,c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?b:"null");break;case "boolean":c.push(b);break;case "undefined":c.push("null");break;case "object":if(null==b){c.push("null");break}if(m(b)){var d=b.length;c.push("[");for(var e="",f=0;f<d;f++)c.push(e),e=b[f],wa(a,a.Z?a.Z.call(b,String(f),e):e,c),e=",";c.push("]");break}c.push("{");d="";for(f in b)Object.prototype.hasOwnProperty.call(b,f)&&(e=b[f],"function"!=typeof e&&(c.push(d),xa(f,
c),c.push(":"),wa(a,a.Z?a.Z.call(b,f,e):e,c),d=","));c.push("}");break;case "function":break;default:throw Error("Unknown type: "+typeof b);}},ya={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},za=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,xa=function(a,b){b.push('"',a.replace(za,function(a){if(a in ya)return ya[a];var b=a.charCodeAt(0),e="\\u";16>b?e+="000":256>b?e+="00":4096>b&&(e+="0");return ya[a]=
e+b.toString(16)}),'"')};var Aa=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,Aa);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};u(Aa,Error);Aa.prototype.name="CustomError";var Ba=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")},Ja=function(a){if(!Ca.test(a))return a;-1!=a.indexOf("&")&&(a=a.replace(Da,"&amp;"));-1!=a.indexOf("<")&&(a=a.replace(Ea,"&lt;"));-1!=a.indexOf(">")&&(a=a.replace(Fa,"&gt;"));-1!=a.indexOf('"')&&(a=a.replace(Ga,"&quot;"));-1!=a.indexOf("'")&&(a=a.replace(Ha,"&#39;"));-1!=a.indexOf("\x00")&&(a=a.replace(Ia,"&#0;"));return a},Da=/&/g,Ea=/</g,
Fa=/>/g,Ga=/"/g,Ha=/'/g,Ia=/\x00/g,Ca=/[\x00&<>"']/,Ka=function(a,b){return a<b?-1:a>b?1:0};var La=function(a,b){b.unshift(a);Aa.call(this,Ba.apply(null,b));b.shift()};u(La,Aa);La.prototype.name="AssertionError";var Ma=function(a,b,c){if(!a){var d="Assertion failed";if(b)var d=d+(": "+b),e=Array.prototype.slice.call(arguments,2);throw new La(""+d,e||[]);}return a},Na=function(a,b){throw new La("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1));};var w=Array.prototype,Oa=w.indexOf?function(a,b,c){Ma(null!=a.length);return w.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(p(a))return p(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},Pa=w.forEach?function(a,b,c){Ma(null!=a.length);w.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=p(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},Qa=w.map?function(a,b,c){Ma(null!=a.length);return w.map.call(a,b,c)}:
function(a,b,c){for(var d=a.length,e=Array(d),f=p(a)?a.split(""):a,g=0;g<d;g++)g in f&&(e[g]=b.call(c,f[g],g,a));return e},Sa=function(a){var b;t:{b=Ra;for(var c=a.length,d=p(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break t}b=-1}return 0>b?null:p(a)?a.charAt(b):a[b]},Ta=function(a,b){var c=Oa(a,b),d;if(d=0<=c)Ma(null!=a.length),w.splice.call(a,c,1);return d},Ua=function(a){return w.concat.apply(w,arguments)},Va=function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c],
e;if(m(d)||(e=da(d))&&Object.prototype.hasOwnProperty.call(d,"callee"))a.push.apply(a,d);else if(e)for(var f=a.length,g=d.length,n=0;n<g;n++)a[f+n]=d[n];else a.push(d)}},Wa=function(a,b,c){Ma(null!=a.length);return 2>=arguments.length?w.slice.call(a,b):w.slice.call(a,b,c)};var Xa=function(){};Xa.prototype.ra=!1;Xa.prototype.Ia=function(){this.ra||(this.ra=!0,this.C())};Xa.prototype.C=function(){if(this.Ja)for(;this.Ja.length;)this.Ja.shift()()};var Ya=function(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.Y=!1;this.Pa=!0};Ya.prototype.C=function(){};Ya.prototype.Ia=function(){};var Za;t:{var $a=k.navigator;if($a){var ab=$a.userAgent;if(ab){Za=ab;break t}}Za=""}var bb=function(a){return-1!=Za.indexOf(a)};var cb=bb("Opera")||bb("OPR"),x=bb("Trident")||bb("MSIE"),db=bb("Gecko")&&-1==Za.toLowerCase().indexOf("webkit")&&!(bb("Trident")||bb("MSIE")),eb=-1!=Za.toLowerCase().indexOf("webkit"),fb=function(){var a=k.document;return a?a.documentMode:void 0},gb=function(){var a="",b;if(cb&&k.opera)return a=k.opera.version,q(a)?a():a;db?b=/rv\:([^\);]+)(\)|;)/:x?b=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:eb&&(b=/WebKit\/(\S+)/);b&&(a=(a=b.exec(Za))?a[1]:"");return x&&(b=fb(),b>parseFloat(a))?String(b):a}(),hb={},z=
function(a){var b;if(!(b=hb[a])){b=0;for(var c=String(gb).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||"",n=d[f]||"",y=RegExp("(\\d*)(\\D*)","g"),E=RegExp("(\\d*)(\\D*)","g");do{var A=y.exec(g)||["","",""],ta=E.exec(n)||["","",""];if(0==A[0].length&&0==ta[0].length)break;b=Ka(0==A[1].length?0:parseInt(A[1],10),0==ta[1].length?0:parseInt(ta[1],10))||Ka(0==A[2].length,0==ta[2].length)||
Ka(A[2],ta[2])}while(0==b)}b=hb[a]=0<=b}return b},ib=k.document,jb=ib&&x?fb()||("CSS1Compat"==ib.compatMode?parseInt(gb,10):5):void 0;x&&z("9");!eb||z("528");db&&z("1.9b")||x&&z("8")||cb&&z("9.5")||eb&&z("528");db&&!z("8")||x&&z("9");var kb="closure_listenable_"+(1E6*Math.random()|0),lb=0;var mb=function(a,b,c,d,e){this.la=a;this.Ua=null;this.src=b;this.type=c;this.ya=!!d;this.ka=e;this.key=++lb;this.ma=this.na=!1},nb=function(a){a.ma=!0;a.la=null;a.Ua=null;a.src=null;a.ka=null};var ob=function(a){this.src=a;this.n={};this.oa=0};ob.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.n[f];a||(a=this.n[f]=[],this.oa++);var g;t:{for(g=0;g<a.length;++g){var n=a[g];if(!n.ma&&n.la==b&&n.ya==!!d&&n.ka==e)break t}g=-1}-1<g?(b=a[g],c||(b.na=!1)):(b=new mb(b,this.src,f,!!d,e),b.na=c,a.push(b));return b};ob.prototype.Ta=function(){var a=0,b;for(b in this.n){for(var c=this.n[b],d=0;d<c.length;d++)++a,nb(c[d]);delete this.n[b];this.oa--}};var pb=function(){this.A=new ob(this);this.Xa=this;this.qa=null};u(pb,Xa);pb.prototype[kb]=!0;
pb.prototype.dispatchEvent=function(a){qb(this);var b,c=this.qa;if(c){b=[];for(var d=1;c;c=c.qa)b.push(c),Ma(1E3>++d,"infinite loop")}c=this.Xa;d=a.type||a;if(p(a))a=new Ya(a,c);else if(a instanceof Ya)a.target=a.target||c;else{var e=a;a=new Ya(d,c);ra(a,e)}var e=!0,f;if(b)for(var g=b.length-1;!a.Y&&0<=g;g--)f=a.currentTarget=b[g],e=rb(f,d,!0,a)&&e;a.Y||(f=a.currentTarget=c,e=rb(f,d,!0,a)&&e,a.Y||(e=rb(f,d,!1,a)&&e));if(b)for(g=0;!a.Y&&g<b.length;g++)f=a.currentTarget=b[g],e=rb(f,d,!1,a)&&e;return e};
pb.prototype.C=function(){pb.m.C.call(this);this.A&&this.A.Ta();this.qa=null};pb.prototype.Za=function(a){qb(this);this.A.add("complete",a,!1,void 0,void 0)};pb.prototype.$a=function(a){this.A.add("ready",a,!0,void 0,void 0)};
var rb=function(a,b,c,d){b=a.A.n[String(b)];if(!b)return!0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var g=b[f];if(g&&!g.ma&&g.ya==c){var n=g.la,y=g.ka||g.src;if(g.na){var E=a.A,A=g.type;A in E.n&&Ta(E.n[A],g)&&(nb(g),0==E.n[A].length&&(delete E.n[A],E.oa--))}e=!1!==n.call(y,d)&&e}}return e&&!1!=d.Pa},qb=function(a){Ma(a.A,"Event target is not initialized. Did you call the superclass (goog.events.EventTarget) constructor?")};var sb="StopIteration"in k?k.StopIteration:Error("StopIteration"),tb=function(){};tb.prototype.next=function(){throw sb;};tb.prototype.hb=function(){return this};var ub=function(a,b){this.u={};this.i=[];this.pa=this.l=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.Ra(a)};ub.prototype.p=function(){vb(this);for(var a=[],b=0;b<this.i.length;b++)a.push(this.u[this.i[b]]);return a};ub.prototype.t=function(){vb(this);return this.i.concat()};ub.prototype.V=function(a){return Object.prototype.hasOwnProperty.call(this.u,a)};
var vb=function(a){if(a.l!=a.i.length){for(var b=0,c=0;b<a.i.length;){var d=a.i[b];Object.prototype.hasOwnProperty.call(a.u,d)&&(a.i[c++]=d);b++}a.i.length=c}if(a.l!=a.i.length){for(var e={},c=b=0;b<a.i.length;)d=a.i[b],Object.prototype.hasOwnProperty.call(e,d)||(a.i[c++]=d,e[d]=1),b++;a.i.length=c}};h=ub.prototype;h.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.u,a)?this.u[a]:b};
h.set=function(a,b){Object.prototype.hasOwnProperty.call(this.u,a)||(this.l++,this.i.push(a),this.pa++);this.u[a]=b};h.Ra=function(a){var b;a instanceof ub?(b=a.t(),a=a.p()):(b=na(a),a=ma(a));for(var c=0;c<b.length;c++)this.set(b[c],a[c])};h.forEach=function(a,b){for(var c=this.t(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};h.clone=function(){return new ub(this)};
h.hb=function(a){vb(this);var b=0,c=this.i,d=this.u,e=this.pa,f=this,g=new tb;g.next=function(){for(;;){if(e!=f.pa)throw Error("The map has changed since the iterator was created");if(b>=c.length)throw sb;var g=c[b++];return a?g:d[g]}};return g};var wb=function(a){if("function"==typeof a.p)return a.p();if(p(a))return a.split("");if(da(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return ma(a)},xb=function(a,b){if("function"==typeof a.forEach)a.forEach(b,void 0);else if(da(a)||p(a))Pa(a,b,void 0);else{var c;if("function"==typeof a.t)c=a.t();else if("function"!=typeof a.p)if(da(a)||p(a)){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e)}else c=na(a);else c=void 0;for(var d=wb(a),e=d.length,f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],
a)}};var zb=function(a){var b;b||(b=yb(a||arguments.callee.caller,[]));return b},yb=function(a,b){var c=[];if(0<=Oa(b,a))c.push("[...circular reference...]");else if(a&&50>b.length){c.push(Ab(a)+"(");for(var d=a.arguments,e=0;d&&e<d.length;e++){0<e&&c.push(", ");var f;f=d[e];switch(typeof f){case "object":f=f?"object":"null";break;case "string":break;case "number":f=String(f);break;case "boolean":f=f?"true":"false";break;case "function":f=(f=Ab(f))?f:"[fn]";break;default:f=typeof f}40<f.length&&(f=f.substr(0,
40)+"...");c.push(f)}b.push(a);c.push(")\n");try{c.push(yb(a.caller,b))}catch(g){c.push("[exception trying to get caller]\n")}}else a?c.push("[...long stack...]"):c.push("[end]");return c.join("")},Ab=function(a){if(Bb[a])return Bb[a];a=String(a);if(!Bb[a]){var b=/function ([^\(]+)/.exec(a);Bb[a]=b?b[1]:"[Anonymous]"}return Bb[a]},Bb={};var Cb=function(a,b,c,d,e){this.reset(a,b,c,d,e)};Cb.prototype.Ca=null;Cb.prototype.Ba=null;var Db=0;Cb.prototype.reset=function(a,b,c,d,e){"number"==typeof e||Db++;d||ha();this.M=a;this.Wa=b;delete this.Ca;delete this.Ba};Cb.prototype.Fa=function(a){this.M=a};var Eb=function(a){this.Sa=a;this.Aa=this.sa=this.M=this.X=null},Fb=function(a,b){this.name=a;this.value=b};Fb.prototype.toString=function(){return this.name};var Gb=new Fb("SEVERE",1E3),Hb=new Fb("CONFIG",700),Ib=new Fb("FINE",500);Eb.prototype.getParent=function(){return this.X};Eb.prototype.bb=function(){this.sa||(this.sa={});return this.sa};Eb.prototype.Fa=function(a){this.M=a};var Jb=function(a){if(a.M)return a.M;if(a.X)return Jb(a.X);Na("Root logger has no level set.");return null};
Eb.prototype.log=function(a,b,c){if(a.value>=Jb(this).value)for(q(b)&&(b=b()),a=this.Da(a,b,c,Eb.prototype.log),b="log:"+a.Wa,k.console&&(k.console.timeStamp?k.console.timeStamp(b):k.console.markTimeline&&k.console.markTimeline(b)),k.msWriteProfilerMark&&k.msWriteProfilerMark(b),b=this;b;){c=b;var d=a;if(c.Aa)for(var e=0,f=void 0;f=c.Aa[e];e++)f(d);b=b.getParent()}};
Eb.prototype.Da=function(a,b,c,d){a=new Cb(a,String(b),this.Sa);if(c){a.Ca=c;var e;d=d||Eb.prototype.Da;try{var f;var g;e:{b=["window","location","href"];for(var n=k,y;y=b.shift();)if(null!=n[y])n=n[y];else{g=null;break e}g=n}if(p(c))f={message:c,name:"Unknown error",lineNumber:"Not available",fileName:g,stack:"Not available"};else{var E,A;y=!1;try{E=c.lineNumber||c.line||"Not available"}catch(ta){E="Not available",y=!0}try{A=c.fileName||c.filename||c.sourceURL||k.$googDebugFname||g}catch(ua){A="Not available",
y=!0}f=!y&&c.lineNumber&&c.fileName&&c.stack&&c.message&&c.name?c:{message:c.message||"Not available",name:c.name||"UnknownError",lineNumber:E,fileName:A,stack:c.stack||"Not available"}}e="Message: "+Ja(f.message)+'\nUrl: <a href="view-source:'+f.fileName+'" target="_new">'+f.fileName+"</a>\nLine: "+f.lineNumber+"\n\nBrowser stack:\n"+Ja(f.stack+"-> ")+"[end]\n\nJS stack traversal:\n"+Ja(zb(d)+"-> ")}catch(je){e="Exception trying to expose exception! You win, we lose. "+je}a.Ba=e}return a};
var Kb={},Lb=null,Mb=function(a){Lb||(Lb=new Eb(""),Kb[""]=Lb,Lb.Fa(Hb));var b;if(!(b=Kb[a])){b=new Eb(a);var c=a.lastIndexOf("."),d=a.substr(c+1),c=Mb(a.substr(0,c));c.bb()[d]=b;b.X=c;Kb[a]=b}return b};var B=function(a,b){a&&a.log(Ib,b,void 0)};var Nb=function(a,b,c){if(q(a))c&&(a=s(a,c));else if(a&&"function"==typeof a.handleEvent)a=s(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<b?-1:k.setTimeout(a,b||0)};var Ob=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$"),Pb=eb,Qb=function(a,b){if(Pb){Pb=!1;var c=k.location;if(c){var d=c.href;if(d&&(d=(d=Qb(3,d))&&decodeURIComponent(d))&&d!=c.hostname)throw Pb=!0,Error();}}return b.match(Ob)[a]||null};var Rb=function(){};Rb.prototype.Ha=null;Rb.prototype.I=function(){var a;(a=this.Ha)||(a={},Sb(this)&&(a[0]=!0,a[1]=!0),a=this.Ha=a);return a};var Tb=function(a,b){this.gb=a;this.fb=b};u(Tb,Rb);Tb.prototype.ba=function(){return this.gb()};Tb.prototype.I=function(){return this.fb()};var C=function(){return C.Ea.ba()};C.eb=!1;C.I=function(){return C.Ea.I()};C.Gb=function(a,b){C.Ka(new Tb(Ma(a),Ma(b)))};C.Ka=function(a){C.Ea=a};var Ub=function(){};u(Ub,Rb);Ub.prototype.ba=function(){var a=Sb(this);return a?new ActiveXObject(a):new XMLHttpRequest};
var Sb=function(a){if(C.eb)return"";if(!a.Ga&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.Ga=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.Ga};C.Ka(new Ub);var D=function(a){pb.call(this);this.headers=new ub;this.S=a||null;this.s=!1;this.O=this.a=null;this.H=this.ua=this.P="";this.w=this.$=this.N=this.aa=!1;this.B=0;this.Q=null;this.va="";this.R=this.Ma=!1};u(D,pb);var Vb=D.prototype,Wb=Mb("goog.net.XhrIo");Vb.k=Wb;var Xb=/^https?$/i,Yb=["POST","PUT"],Zb=[],ac=function(a,b,c,d){var e=$b,f=new D;Zb.push(f);b&&f.Za(b);f.$a(f.Ya);e&&(f.B=Math.max(0,e));f.send(a,c,d,{"Content-Type":"application/x-www-form-urlencoded"})};
D.prototype.Ya=function(){this.Ia();Ta(Zb,this)};
D.prototype.send=function(a,b,c,d){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.P+"; newUri="+a);b=b?b.toUpperCase():"GET";this.P=a;this.H="";this.ua=b;this.aa=!1;this.s=!0;this.a=this.S?this.S.ba():C();this.O=this.S?this.S.I():C.I();this.a.onreadystatechange=s(this.wa,this);try{B(this.k,bc(this,"Opening Xhr")),this.$=!0,this.a.open(b,String(a),!0),this.$=!1}catch(e){B(this.k,bc(this,"Error opening Xhr: "+e.message));cc(this,e);return}a=c||"";var f=this.headers.clone();
d&&xb(d,function(a,b){f.set(b,a)});d=Sa(f.t());c=k.FormData&&a instanceof k.FormData;!(0<=Oa(Yb,b))||d||c||f.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");f.forEach(function(a,b){this.a.setRequestHeader(b,a)},this);this.va&&(this.a.responseType=this.va);"withCredentials"in this.a&&(this.a.withCredentials=this.Ma);try{dc(this),0<this.B&&(this.R=ec(this.a),B(this.k,bc(this,"Will abort after "+this.B+"ms if incomplete, xhr2 "+this.R)),this.R?(this.a.timeout=this.B,this.a.ontimeout=
s(this.xa,this)):this.Q=Nb(this.xa,this.B,this)),B(this.k,bc(this,"Sending request")),this.N=!0,this.a.send(a),this.N=!1}catch(g){B(this.k,bc(this,"Send error: "+g.message)),cc(this,g)}};var ec=function(a){return x&&z(9)&&ea(a.timeout)&&l(a.ontimeout)},Ra=function(a){return"content-type"==a.toLowerCase()};D.prototype.xa=function(){"undefined"!=typeof aa&&this.a&&(this.H="Timed out after "+this.B+"ms, aborting",B(this.k,bc(this,this.H)),this.dispatchEvent("timeout"),this.abort(8))};
var cc=function(a,b){a.s=!1;a.a&&(a.w=!0,a.a.abort(),a.w=!1);a.H=b;fc(a);gc(a)},fc=function(a){a.aa||(a.aa=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))};D.prototype.abort=function(){this.a&&this.s&&(B(this.k,bc(this,"Aborting")),this.s=!1,this.w=!0,this.a.abort(),this.w=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),gc(this))};D.prototype.C=function(){this.a&&(this.s&&(this.s=!1,this.w=!0,this.a.abort(),this.w=!1),gc(this,!0));D.m.C.call(this)};
D.prototype.wa=function(){this.ra||(this.$||this.N||this.w?hc(this):this.Va())};D.prototype.Va=function(){hc(this)};
var hc=function(a){if(a.s&&"undefined"!=typeof aa)if(a.O[1]&&4==ic(a)&&2==a.getStatus())B(a.k,bc(a,"Local request error detected and ignored"));else if(a.N&&4==ic(a))Nb(a.wa,0,a);else if(a.dispatchEvent("readystatechange"),4==ic(a)){B(a.k,bc(a,"Request complete"));a.s=!1;try{var b=a.getStatus(),c,d;t:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:d=!0;break t;default:d=!1}if(!(c=d)){var e;if(e=0===b){var f=Qb(1,String(a.P));if(!f&&self.location)var g=self.location.protocol,
f=g.substr(0,g.length-1);e=!Xb.test(f?f.toLowerCase():"")}c=e}if(c)a.dispatchEvent("complete"),a.dispatchEvent("success");else{var n;try{n=2<ic(a)?a.a.statusText:""}catch(y){B(a.k,"Can not get status: "+y.message),n=""}a.H=n+" ["+a.getStatus()+"]";fc(a)}}finally{gc(a)}}},gc=function(a,b){if(a.a){dc(a);var c=a.a,d=a.O[0]?ba:null;a.a=null;a.O=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){(c=a.k)&&c.log(Gb,"Problem encountered resetting onreadystatechange: "+e.message,void 0)}}},
dc=function(a){a.a&&a.R&&(a.a.ontimeout=null);ea(a.Q)&&(k.clearTimeout(a.Q),a.Q=null)},ic=function(a){return a.a?a.a.readyState:0};D.prototype.getStatus=function(){try{return 2<ic(this)?this.a.status:-1}catch(a){return-1}};var bc=function(a,b){return b+" ["+a.ua+" "+a.P+" "+a.getStatus()+"]"};var jc=function(a,b,c){this.o=a||null;this.ab=!!c},lc=function(a){if(!a.g&&(a.g=new ub,a.l=0,a.o))for(var b=a.o.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),e=null,f=null;0<=d?(e=b[c].substring(0,d),f=b[c].substring(d+1)):e=b[c];e=decodeURIComponent(e.replace(/\+/g," "));e=kc(a,e);a.add(e,f?decodeURIComponent(f.replace(/\+/g," ")):"")}};h=jc.prototype;h.g=null;h.l=null;h.add=function(a,b){lc(this);this.o=null;a=kc(this,a);var c=this.g.get(a);c||this.g.set(a,c=[]);c.push(b);this.l++;return this};
h.V=function(a){lc(this);a=kc(this,a);return this.g.V(a)};h.t=function(){lc(this);for(var a=this.g.p(),b=this.g.t(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};h.p=function(a){lc(this);var b=[];if(p(a))this.V(a)&&(b=Ua(b,this.g.get(kc(this,a))));else{a=this.g.p();for(var c=0;c<a.length;c++)b=Ua(b,a[c])}return b};h.set=function(a,b){lc(this);this.o=null;a=kc(this,a);this.V(a)&&(this.l-=this.g.get(a).length);this.g.set(a,[b]);this.l++;return this};
h.get=function(a,b){var c=a?this.p(a):[];return 0<c.length?String(c[0]):b};h.toString=function(){if(this.o)return this.o;if(!this.g)return"";for(var a=[],b=this.g.t(),c=0;c<b.length;c++)for(var d=b[c],e=encodeURIComponent(String(d)),d=this.p(d),f=0;f<d.length;f++){var g=e;""!==d[f]&&(g+="="+encodeURIComponent(String(d[f])));a.push(g)}return this.o=a.join("&")};h.clone=function(){var a=new jc;a.o=this.o;this.g&&(a.g=this.g.clone(),a.l=this.l);return a};
var kc=function(a,b){var c=String(b);a.ab&&(c=c.toLowerCase());return c};var mc=null,nc=null,oc=!1,$b=0,pc={Cb:"CANCEL",Fb:"UPDATE"},qc=function(a,b){null!=a?mc=a:oc||(mc="/api");null!=b?nc=b:oc||(nc="https://earthengine.googleapis.com");oc=!0};t("ee.data.setDeadline",function(a){$b=a});t("ee.data.getApiBaseUrl",function(){return mc});t("ee.data.getTileBaseUrl",function(){return nc});t("ee.data.getInfo",function(a,b){k.console&&k.console.error&&k.console.error("ee.data.getInfo is DEPRECATED. Use ee.data.getValue() instead.");return F("/info",(new jc).add("id",a),b)});
t("ee.data.getList",function(a,b){var c=G(a);return F("/list",c,b)});var rc=function(a,b){a=v(a);a.json_format="v2";return F("/mapid",G(a),b)};t("ee.data.getMapId",rc);t("ee.data.getTileUrl",function(a,b,c,d){var e=Math.pow(2,d);b%=e;0>b&&(b+=e);return[nc,"map",a.mapid,d,b,c].join("/")+"?token="+a.token});var sc=function(a,b){a=v(a);a.json_format="v2";return F("/value",G(a),b)};t("ee.data.getValue",sc);
var tc=function(a,b){a=v(a);a.json_format="v2";m(a.size)&&(a.size=a.size.join("x"));var c=G(a).add("getid","1");return F("/thumb",c,b)};t("ee.data.getThumbId",tc);var uc=function(a){return nc+"/api/thumb?thumbid="+a.thumbid+"&token="+a.token};t("ee.data.makeThumbUrl",uc);var vc=function(a,b){a=v(a);a.json_format="v2";return F("/download",G(a),b)};t("ee.data.getDownloadId",vc);var wc=function(a){return nc+"/api/download?docid="+a.docid+"&token="+a.token};t("ee.data.makeDownloadUrl",wc);
var xc=function(a,b){a=v(a);a.json_format="v2";return F("/table",G(a),b)};t("ee.data.getTableDownloadId",xc);var yc=function(a){return nc+"/api/table?docid="+a.docid+"&token="+a.token};t("ee.data.makeTableDownloadUrl",yc);t("ee.data.createAsset",function(a,b,c,d){a={value:a,json_format:"v2"};void 0!==b&&(a.id=b);a.force=c||!1;return F("/create",G(a),d)});t("ee.data.createFolder",function(a,b,c){return F("/createfolder",G({id:a,force:b||!1}),c)});
t("ee.data.newTaskId",function(a,b){var c={};ea(a)&&(c.count=a);return F("/newtaskid",G(c),b)});t("ee.data.getTaskStatus",function(a,b){if(p(a))a=[a];else if(!m(a))throw Error("Invalid task_id: expected a string or an array of strings.");return F("/taskstatus?q="+a.join(),null,b,"GET")});t("ee.data.getTaskList",function(a){return F("/tasklist",null,a,"GET")});t("ee.data.cancelTask",function(a,b){return zc(a,"CANCEL",b)});
var zc=function(a,b,c){if(p(a))a=[a];else if(!m(a))throw Error("Invalid task_id: expected a string or an array of strings.");var d;t:{for(d in pc)if(pc[d]==b){d=!0;break t}d=!1}if(!d)throw Error("Invalid action: "+b);return F("/updatetask",G({id:a,action:b}),c,"POST")};t("ee.data.updateTask",zc);t("ee.data.prepareValue",function(a,b,c){b=v(b);b.tid=a;return F("/prepare",G(b),c)});t("ee.data.startProcessing",function(a,b,c){b=v(b);b.id=a;return F("/processingrequest",G(b),c)});
var F=function(a,b,c,d){function e(a,b){var c=!1;try{var d=sa(a),e=d.data}catch(f){c=!0}var ua=void 0;c||!("data"in d||"error"in d)?ua="Malformed response: "+a:"error"in d&&(ua=d.error.message);if(b)b(e,ua);else{if(!ua)return e;throw Error(ua);}}qc();d=d||"POST";a=mc+a;b=b?b.toString():"";if(c)ac(a,function(a){var b;a=a.target;try{b=a.a?a.a.responseText:""}catch(d){B(a.k,"Can not get responseText: "+d.message),b=""}return e(b,c)},d,b);else{var f=C();f.open(d,a,!1);f.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");f.send(b);return e(f.responseText,null)}},G=function(a){var b=new jc,c;for(c in a)b.set(c,a[c]);return b};var Ac=function(){};var Bc=function(){this.q=-1};var Cc=function(){this.q=-1;this.q=64;this.f=Array(4);this.Qa=Array(this.q);this.W=this.L=0;this.reset()};u(Cc,Bc);Cc.prototype.reset=function(){this.f[0]=1732584193;this.f[1]=4023233417;this.f[2]=2562383102;this.f[3]=271733878;this.W=this.L=0};
var Dc=function(a,b,c){c||(c=0);var d=Array(16);if(p(b))for(var e=0;16>e;++e)d[e]=b.charCodeAt(c++)|b.charCodeAt(c++)<<8|b.charCodeAt(c++)<<16|b.charCodeAt(c++)<<24;else for(e=0;16>e;++e)d[e]=b[c++]|b[c++]<<8|b[c++]<<16|b[c++]<<24;b=a.f[0];c=a.f[1];var e=a.f[2],f=a.f[3],g=0,g=b+(f^c&(e^f))+d[0]+3614090360&4294967295;b=c+(g<<7&4294967295|g>>>25);g=f+(e^b&(c^e))+d[1]+3905402710&4294967295;f=b+(g<<12&4294967295|g>>>20);g=e+(c^f&(b^c))+d[2]+606105819&4294967295;e=f+(g<<17&4294967295|g>>>15);g=c+(b^e&
(f^b))+d[3]+3250441966&4294967295;c=e+(g<<22&4294967295|g>>>10);g=b+(f^c&(e^f))+d[4]+4118548399&4294967295;b=c+(g<<7&4294967295|g>>>25);g=f+(e^b&(c^e))+d[5]+1200080426&4294967295;f=b+(g<<12&4294967295|g>>>20);g=e+(c^f&(b^c))+d[6]+2821735955&4294967295;e=f+(g<<17&4294967295|g>>>15);g=c+(b^e&(f^b))+d[7]+4249261313&4294967295;c=e+(g<<22&4294967295|g>>>10);g=b+(f^c&(e^f))+d[8]+1770035416&4294967295;b=c+(g<<7&4294967295|g>>>25);g=f+(e^b&(c^e))+d[9]+2336552879&4294967295;f=b+(g<<12&4294967295|g>>>20);g=
e+(c^f&(b^c))+d[10]+4294925233&4294967295;e=f+(g<<17&4294967295|g>>>15);g=c+(b^e&(f^b))+d[11]+2304563134&4294967295;c=e+(g<<22&4294967295|g>>>10);g=b+(f^c&(e^f))+d[12]+1804603682&4294967295;b=c+(g<<7&4294967295|g>>>25);g=f+(e^b&(c^e))+d[13]+4254626195&4294967295;f=b+(g<<12&4294967295|g>>>20);g=e+(c^f&(b^c))+d[14]+2792965006&4294967295;e=f+(g<<17&4294967295|g>>>15);g=c+(b^e&(f^b))+d[15]+1236535329&4294967295;c=e+(g<<22&4294967295|g>>>10);g=b+(e^f&(c^e))+d[1]+4129170786&4294967295;b=c+(g<<5&4294967295|
g>>>27);g=f+(c^e&(b^c))+d[6]+3225465664&4294967295;f=b+(g<<9&4294967295|g>>>23);g=e+(b^c&(f^b))+d[11]+643717713&4294967295;e=f+(g<<14&4294967295|g>>>18);g=c+(f^b&(e^f))+d[0]+3921069994&4294967295;c=e+(g<<20&4294967295|g>>>12);g=b+(e^f&(c^e))+d[5]+3593408605&4294967295;b=c+(g<<5&4294967295|g>>>27);g=f+(c^e&(b^c))+d[10]+38016083&4294967295;f=b+(g<<9&4294967295|g>>>23);g=e+(b^c&(f^b))+d[15]+3634488961&4294967295;e=f+(g<<14&4294967295|g>>>18);g=c+(f^b&(e^f))+d[4]+3889429448&4294967295;c=e+(g<<20&4294967295|
g>>>12);g=b+(e^f&(c^e))+d[9]+568446438&4294967295;b=c+(g<<5&4294967295|g>>>27);g=f+(c^e&(b^c))+d[14]+3275163606&4294967295;f=b+(g<<9&4294967295|g>>>23);g=e+(b^c&(f^b))+d[3]+4107603335&4294967295;e=f+(g<<14&4294967295|g>>>18);g=c+(f^b&(e^f))+d[8]+1163531501&4294967295;c=e+(g<<20&4294967295|g>>>12);g=b+(e^f&(c^e))+d[13]+2850285829&4294967295;b=c+(g<<5&4294967295|g>>>27);g=f+(c^e&(b^c))+d[2]+4243563512&4294967295;f=b+(g<<9&4294967295|g>>>23);g=e+(b^c&(f^b))+d[7]+1735328473&4294967295;e=f+(g<<14&4294967295|
g>>>18);g=c+(f^b&(e^f))+d[12]+2368359562&4294967295;c=e+(g<<20&4294967295|g>>>12);g=b+(c^e^f)+d[5]+4294588738&4294967295;b=c+(g<<4&4294967295|g>>>28);g=f+(b^c^e)+d[8]+2272392833&4294967295;f=b+(g<<11&4294967295|g>>>21);g=e+(f^b^c)+d[11]+1839030562&4294967295;e=f+(g<<16&4294967295|g>>>16);g=c+(e^f^b)+d[14]+4259657740&4294967295;c=e+(g<<23&4294967295|g>>>9);g=b+(c^e^f)+d[1]+2763975236&4294967295;b=c+(g<<4&4294967295|g>>>28);g=f+(b^c^e)+d[4]+1272893353&4294967295;f=b+(g<<11&4294967295|g>>>21);g=e+(f^
b^c)+d[7]+4139469664&4294967295;e=f+(g<<16&4294967295|g>>>16);g=c+(e^f^b)+d[10]+3200236656&4294967295;c=e+(g<<23&4294967295|g>>>9);g=b+(c^e^f)+d[13]+681279174&4294967295;b=c+(g<<4&4294967295|g>>>28);g=f+(b^c^e)+d[0]+3936430074&4294967295;f=b+(g<<11&4294967295|g>>>21);g=e+(f^b^c)+d[3]+3572445317&4294967295;e=f+(g<<16&4294967295|g>>>16);g=c+(e^f^b)+d[6]+76029189&4294967295;c=e+(g<<23&4294967295|g>>>9);g=b+(c^e^f)+d[9]+3654602809&4294967295;b=c+(g<<4&4294967295|g>>>28);g=f+(b^c^e)+d[12]+3873151461&4294967295;
f=b+(g<<11&4294967295|g>>>21);g=e+(f^b^c)+d[15]+530742520&4294967295;e=f+(g<<16&4294967295|g>>>16);g=c+(e^f^b)+d[2]+3299628645&4294967295;c=e+(g<<23&4294967295|g>>>9);g=b+(e^(c|~f))+d[0]+4096336452&4294967295;b=c+(g<<6&4294967295|g>>>26);g=f+(c^(b|~e))+d[7]+1126891415&4294967295;f=b+(g<<10&4294967295|g>>>22);g=e+(b^(f|~c))+d[14]+2878612391&4294967295;e=f+(g<<15&4294967295|g>>>17);g=c+(f^(e|~b))+d[5]+4237533241&4294967295;c=e+(g<<21&4294967295|g>>>11);g=b+(e^(c|~f))+d[12]+1700485571&4294967295;b=c+
(g<<6&4294967295|g>>>26);g=f+(c^(b|~e))+d[3]+2399980690&4294967295;f=b+(g<<10&4294967295|g>>>22);g=e+(b^(f|~c))+d[10]+4293915773&4294967295;e=f+(g<<15&4294967295|g>>>17);g=c+(f^(e|~b))+d[1]+2240044497&4294967295;c=e+(g<<21&4294967295|g>>>11);g=b+(e^(c|~f))+d[8]+1873313359&4294967295;b=c+(g<<6&4294967295|g>>>26);g=f+(c^(b|~e))+d[15]+4264355552&4294967295;f=b+(g<<10&4294967295|g>>>22);g=e+(b^(f|~c))+d[6]+2734768916&4294967295;e=f+(g<<15&4294967295|g>>>17);g=c+(f^(e|~b))+d[13]+1309151649&4294967295;
c=e+(g<<21&4294967295|g>>>11);g=b+(e^(c|~f))+d[4]+4149444226&4294967295;b=c+(g<<6&4294967295|g>>>26);g=f+(c^(b|~e))+d[11]+3174756917&4294967295;f=b+(g<<10&4294967295|g>>>22);g=e+(b^(f|~c))+d[2]+718787259&4294967295;e=f+(g<<15&4294967295|g>>>17);g=c+(f^(e|~b))+d[9]+3951481745&4294967295;a.f[0]=a.f[0]+b&4294967295;a.f[1]=a.f[1]+(e+(g<<21&4294967295|g>>>11))&4294967295;a.f[2]=a.f[2]+e&4294967295;a.f[3]=a.f[3]+f&4294967295};
Cc.prototype.update=function(a,b){l(b)||(b=a.length);for(var c=b-this.q,d=this.Qa,e=this.L,f=0;f<b;){if(0==e)for(;f<=c;)Dc(this,a,f),f+=this.q;if(p(a))for(;f<b;){if(d[e++]=a.charCodeAt(f++),e==this.q){Dc(this,d);e=0;break}}else for(;f<b;)if(d[e++]=a[f++],e==this.q){Dc(this,d);e=0;break}}this.L=e;this.W+=b};
var Fc=function(){var a=Ec,b=Array((56>a.L?a.q:2*a.q)-a.L);b[0]=128;for(var c=1;c<b.length-8;++c)b[c]=0;for(var d=8*a.W,c=b.length-8;c<b.length;++c)b[c]=d&255,d/=256;a.update(b);b=Array(16);for(c=d=0;4>c;++c)for(var e=0;32>e;e+=8)b[d++]=a.f[c]>>>e&255;return b};var Gc=function(a){this.T="__ee_hash__";this.ia=!1!==a;this.F=[];this.D={};this.ja=[]};t("ee.Serializer",Gc);var Hc=new va,Ec=new Cc,Jc=function(a){return Ic(new Gc(!0),a)};t("ee.Serializer.encode",Jc);var Kc=function(a){return Hc.h(Jc(a))};t("ee.Serializer.toJSON",Kc);var Lc=function(a){a=Ic(new Gc(!1),a);return"JSON"in k?k.JSON.stringify(a,null," "):Hc.h(a)};t("ee.Serializer.toReadableJSON",Lc);
var Ic=function(a,b){var c=a.U(b);a.ia&&(c=r(c)&&"ValueRef"==c.type&&1==a.F.length?a.F[0][1]:{type:"CompoundValue",scope:a.F,value:c},a.F=[],Pa(a.ja,s(function(a){delete a[this.T]},a)),a.ja=[],a.D={});return c};
Gc.prototype.U=function(a){if(!l(a))throw Error("Can't encode an undefined value.");var b,c=r(a)?a[this.T]:null;if(this.ia&&null!=c&&this.D[c])return{type:"ValueRef",value:this.D[c]};if(null===a||"boolean"==typeof a||ea(a)||p(a))return a;if(r(a)&&"function"==typeof a.getFullYear)return{type:"Invocation",functionName:"Date",arguments:{value:Math.floor(a.getTime())}};if(a instanceof Ac){if(b=a.e(s(this.U,this)),!(m(b)||r(b)&&"ArgumentRef"!=b.type))return b}else if(m(a))b=Qa(a,function(a){return this.U(a)},
this);else if(r(a)&&!q(a))b=la(a,function(a){if(!q(a))return this.U(a)},this),oa(b,this.T),b={type:"Dictionary",value:b};else throw Error("Can't encode object: "+a);if(this.ia){Ec.reset();Ec.update(Hc.h(b));var c=Fc().toString(),d;this.D[c]?d=this.D[c]:(d=String(this.F.length),this.F.push([d,b]),this.D[c]=d);a[this.T]=c;this.ja.push(a);return{type:"ValueRef",value:d}}return b};var H=function(a,b,c){if(!(this instanceof H))return I(H,arguments);if(c&&(a||b))throw Error('When "opt_varName" is specified, "func" and "args" must be null.');if(a&&!b)throw Error('When "func" is specified, "args" must not be null.');this.b=a;this.c=b;this.d=c||null};u(H,Ac);t("ee.ComputedObject",H);H.prototype.j=function(a){return sc({json:this.h()},a)};t("ee.ComputedObject.prototype.getInfo",H.prototype.j);
H.prototype.e=function(a){if(null===this.b&&null===this.c)return{type:"ArgumentRef",value:this.d};var b={},c;for(c in this.c)l(this.c[c])&&(b[c]=a(this.c[c]));b={type:"Invocation",arguments:b};a=a(this.b);b[p(a)?"functionName":"function"]=a;return b};H.prototype.h=function(){return Kc(this)};t("ee.ComputedObject.prototype.serialize",H.prototype.h);H.prototype.toString=function(){return"ee."+this.name()+"("+Lc(this)+")"};t("ee.ComputedObject.prototype.toString",H.prototype.toString);
H.prototype.name=function(){return"ComputedObject"};var Mc=function(a,b){if(b instanceof a.constructor)return b;var c=function(){};c.prototype=a.constructor.prototype;c=new c;c.b=b.b;c.c=b.c;c.d=b.d;return c},I=function(a,b){function c(){return a.apply(this,b)}c.prototype=a.prototype;return new c};var J=function(){if(!(this instanceof J))return new J};u(J,Ac);t("ee.Function",J);var Nc=function(a){return a};J.prototype.call=function(a){return this.apply(Oc(this,Array.prototype.slice.call(arguments,0)))};t("ee.Function.prototype.call",J.prototype.call);J.prototype.apply=function(a){a=new H(this,Pc(this,a));return Nc(a,this.r().returns)};t("ee.Function.prototype.apply",J.prototype.apply);
var Pc=function(a,b){for(var c=a.r().args,d={},e={},f=0;f<c.length;f++){var g=c[f].name;if(g in b&&l(b[g]))d[g]=Nc(b[g],c[f].type);else if(!c[f].optional)throw Error("Required argument ("+g+") missing to function: "+a);e[g]=!0}var c=[],n;for(n in b)e[n]||c.push(n);if(0<c.length)throw Error("Unrecognized arguments ("+c+") to function: "+a);return d},Oc=function(a,b){var c=a.r().args;if(c.length<b.length)throw Error("Too many ("+b.length+") arguments to function: "+a);for(var d={},e=0;e<b.length;e++)d[c[e].name]=
b[e];return d};
J.prototype.toString=function(a,b){var c=this.r(),d=[];d.push(a||c.name);d.push("(");d.push(Qa(c.args.slice(b?1:0),function(a){return a.name}).join(", "));d.push(")\n");d.push("\n");c.description?d.push(c.description):d.push("Undocumented.");d.push("\n");if(c.args.length){d.push("\nArgs:\n");for(var e=0;e<c.args.length;e++){b&&0==e?d.push(" this:"):d.push("\n ");var f=c.args[e];d.push(f.name);d.push(" (");d.push(f.type);f.optional&&d.push(", optional");d.push("): ");f.description?d.push(f.description):
d.push("Undocumented.")}}return d.join("")};J.prototype.h=function(){return Kc(this)};var Qc={},Rc=function(a){return a in Qc?Qc[a]:null};t("ee.Types.nameToClass",Rc);var Sc=function(a){return a.prototype instanceof H?a.prototype.name.call(null):a==Number?"Number":a==String?"String":a==Array?"Array":a==Date?"Date":"Object"};t("ee.Types.classToName",Sc);
var Tc=function(a,b){if(b==a)return!0;switch(a){case "Element":case "EEObject":return"EEObject"==b||"Element"==b||"Image"==b||"Feature"==b||"Collection"==b||"ImageCollection"==b||"FeatureCollection"==b;case "FeatureCollection":case "Collection":return"Collection"==b||"ImageCollection"==b||"FeatureCollection"==b;case "Object":return!0;default:return!1}},Uc=function(a){return ea(a)||a instanceof H&&"Number"==a.name()},Vc=function(a){return p(a)||a instanceof H&&"String"==a.name()},Wc=function(a){return r(a)&&
!q(a)?(a=Object.getPrototypeOf(a),null!==a&&null===Object.getPrototypeOf(a)):!1};var K=function(a,b){if(!l(b))return Xc(a);if(!(this instanceof K))return I(K,arguments);this.G=pa(b);this.G.name=a};u(K,J);t("ee.ApiFunction",K);var L=function(a,b){return J.prototype.call.apply(Xc(a),Array.prototype.slice.call(arguments,1))};t("ee.ApiFunction._call",L);var Yc=function(a,b){return Xc(a).apply(b)};t("ee.ApiFunction._apply",Yc);K.prototype.e=function(){return this.G.name};K.prototype.r=function(){return this.G};
var ja=null,Zc={},ad=function(){$c();return la(ja,function(a){return a.r()})},bd=function(){$c();return ka(function(a,b){return!Zc[b]})},Xc=function(a){var b=cd(a);if(!b)throw Error("Unknown built-in function name: "+a);return b};t("ee.ApiFunction.lookup",Xc);
var cd=function(a){$c();return ja[a]||null},$c=function(a,b){if(ja)a&&a();else{var c=function(c,e){e?b&&b(Error(e)):(ja=la(c,function(a,b){a.returns=a.returns.replace(/<.*>/,"");for(var c=0;c<a.args.length;c++)a.args[c].type=a.args[c].type.replace(/<.*>/,"");return new K(b,a)}),a&&a())};a?F("/algorithms",null,c,"GET"):c(F("/algorithms",null,void 0,"GET"))}},M=function(a,b,c,d){$c();var e=d||"";ia(ja,function(d,g){var n=g.split(".");if(2==n.length&&n[0]==b){var y=e+n[1],E=d.r();Zc[g]=!0;var A=!1;E.args.length&&
(n=E.args[0].type,A="Object"!=n&&Tc(n,c));for(n=A?a.prototype:a;y in n;)y+="_",E.hidden=!0;n[y]=function(a){var b=Array.prototype.slice.call(arguments,0),c=!1;if(1==b.length&&Wc(b[0])){var e=E.args;A&&(e=e.slice(1));e.length&&(c=!((1==e.length||e[1].optional)&&"Dictionary"==e[0].type))}if(c){if(b=v(b[0]),A){c=E.args[0].name;if(c in b)throw Error("Named args for "+y+" can't contain keyword "+c);b[c]=this}}else b=Oc(d,A?[this].concat(b):b);return d.apply(b)};n[y].toString=s(d.toString,d,y,A);n[y].signature=
E}})},N=function(a){var b=function(a){for(var b in a)q(a[b])&&a[b].signature&&delete a[b]};b(a);b(a.prototype)};var O=function(a){if(!(this instanceof O))return I(O,arguments);if(a instanceof O)return a;dd();if(ea(a))H.call(this,null,null),this.ga=a;else if(a instanceof H)H.call(this,a.b,a.c,a.d),this.ga=null;else throw Error("Invalid argument specified for ee.Number(): "+a);};u(O,H);t("ee.Number",O);var ed=!1,dd=function(){ed||(M(O,"Number","Number"),ed=!0)};O.prototype.e=function(a){return ea(this.ga)?this.ga:O.m.e.call(this,a)};O.prototype.name=function(){return"Number"};var P=function(a){if(!(this instanceof P))return I(P,arguments);if(a instanceof P)return a;fd();if(p(a))H.call(this,null,null),this.ha=a;else if(a instanceof H)H.call(this,a.b,a.c,a.d),this.ha=null;else throw Error("Invalid argument specified for ee.String(): "+a);};u(P,H);t("ee.String",P);var gd=!1,fd=function(){gd||(M(P,"String","String"),gd=!0)};P.prototype.e=function(a){return p(this.ha)?this.ha:P.m.e.call(this,a)};P.prototype.name=function(){return"String"};var hd=function(a,b){if(!(this instanceof hd))return I(hd,arguments);for(var c=[],d=a.args,e=0;e<d.length;e++){var f=d[e];c.push(id(Rc(f.type),f.name))}this.G=jd(a,c,b);this.cb=b.apply(null,c)};u(hd,J);t("ee.CustomFunction",hd);hd.prototype.e=function(a){return{type:"Function",argumentNames:Qa(this.G.args,function(a){return a.name}),body:a(this.cb)}};hd.prototype.r=function(){return this.G};
var id=function(a,b){a=a||Object;if(!(a.prototype instanceof H))if(a&&a!=Object)if(a==String)a=P;else if(a==Number)a=O;else if(a==Array)a=k.ee.List;else throw Error("Variables must be of an EE type, e.g. ee.Image or ee.Number.");else a=H;var c=function(){};c.prototype=a.prototype;c=new c;c.b=null;c.c=null;c.d=b;return c},jd=function(a,b,c){for(var d=[],e=0;e<b.length;e++)null===b[e].d&&d.push(e);if(0==d.length)return a;var f=function(a){var b=0;r(a)&&!q(a)&&("Function"==a.type&&b++,ia(a,function(a){b+=
f(a)}));return b},e=Jc(c.apply(null,b));c="_MAPPING_VAR_"+f(e)+"_";for(e=0;e<d.length;e++){var g=d[e],n=c+e;b[g].d=n;a.args[g].name=n}return a};var Q=function(a,b,c){H.call(this,a,b,c);kd()};u(Q,H);t("ee.Element",Q);var ld=!1,kd=function(){ld||(M(Q,"Element","Element"),ld=!0)};Q.prototype.name=function(){return"Element"};
Q.prototype.set=function(a){var b;if(1>=arguments.length){var c=arguments[0];if(b=Wc(c))t:{b=na(c);var d=["properties"];if(da(b)&&da(d)&&b.length==d.length){for(var e=b.length,f=0;f<e;f++)if(b[f]!==d[f]){b=!1;break t}b=!0}else b=!1}b&&r(c.properties)&&(c=c.properties);if(Wc(c)){b=this;for(var g in c)d=c[g],b=L("Element.set",b,g,d)}else if(c instanceof H&&cd("Element.setMulti"))b=L("Element.setMulti",this,c);else throw Error("When Element.set() is passed one argument, it must be a dictionary.");}else{if(0!=
arguments.length%2)throw Error("When Element.set() is passed multiple arguments, there must be an even number of them.");b=this;for(c=0;c<arguments.length;c+=2)g=arguments[c],d=arguments[c+1],b=L("Element.set",b,g,d)}return Mc(this,b)};t("ee.Element.prototype.set",Q.prototype.set);var R=function(a){if(!(this instanceof R))return I(R,arguments);if(a instanceof R)return a;md();if(m(a)){if(0==a.length)throw Error("Empty list specified for ee.Filter().");if(1==a.length)return new R(a[0]);H.call(this,new K("Filter.and"),{filters:a});this.K=a}else if(a instanceof H)H.call(this,a.b,a.c,a.d),this.K=[a];else{if(l(a))throw Error("Invalid argument specified for ee.Filter(): "+a);H.call(this,null,null);this.K=[]}};u(R,H);t("ee.Filter",R);
var nd=!1,md=function(){nd||(M(R,"Filter","Filter"),nd=!0)},od={equals:"equals",less_than:"lessThan",greater_than:"greaterThan",contains:"stringContains",starts_with:"stringStartsWith",ends_with:"stringEndsWith"};R.prototype.length=function(){return this.K.length};R.prototype.length=R.prototype.length;var S=function(a,b){var c=a.K.slice(0);b instanceof R?Va(c,b.K):b instanceof Array?Va(c,b):c.push(b);return new R(c)};R.prototype.v=function(){return L("Filter.not",this)};R.prototype.not=R.prototype.v;
var pd=function(a,b,c){b=b.toLowerCase();var d=!1;0==b.lastIndexOf("not_",0)&&(d=!0,b=b.substring(4));if(!(b in od))throw Error("Unknown filtering operator: "+b);a=L("Filter."+od[b],a,c);return d?a.v():a};R.metadata=pd;var qd=function(a,b){return L("Filter.equals",a,b)};R.eq=qd;var rd=function(a,b){return qd(a,b).v()};R.neq=rd;var sd=function(a,b){return L("Filter.lessThan",a,b)};R.lt=sd;var td=function(a,b){return sd(a,b).v()};R.gte=td;var ud=function(a,b){return L("Filter.greaterThan",a,b)};
R.gt=ud;var vd=function(a,b){return ud(a,b).v()};R.lte=vd;var wd=function(a,b){return L("Filter.stringContains",a,b)};R.contains=wd;var xd=function(a,b){return wd(a,b).v()};R.not_contains=xd;var yd=function(a,b){return L("Filter.stringStartsWith",a,b)};R.starts_with=yd;var zd=function(a,b){return yd(a,b).v()};R.not_starts_with=zd;var Ad=function(a,b){return L("Filter.stringEndsWith",a,b)};R.ends_with=Ad;var Bd=function(a,b){return Ad(a,b).v()};R.not_ends_with=Bd;
var Cd=function(a){return L("Filter.and",Array.prototype.slice.call(arguments))};R.and=Cd;R.or=function(a){return L("Filter.or",Array.prototype.slice.call(arguments))};var Dd=function(a,b){var c=L("DateRange",a,b);return Yc("Filter.dateRangeContains",{leftValue:c,rightField:"system:time_start"})};R.date=Dd;var Ed=function(a,b,c,d){return Yc("Filter.listContains",{leftField:c,rightValue:d,rightField:a,leftValue:b})};R.inList=Ed;
var Fd=function(a,b){return Yc("Filter.intersects",{leftField:".all",rightValue:L("Feature",a),maxError:b})};R.bounds=Fd;R.prototype.lb=function(){return S(this,qd.apply(null,[].slice.call(arguments)))};R.prototype.eq=R.prototype.lb;R.prototype.wb=function(){return S(this,rd.apply(null,[].slice.call(arguments)))};R.prototype.neq=R.prototype.wb;R.prototype.ub=function(){return S(this,sd.apply(null,[].slice.call(arguments)))};R.prototype.lt=R.prototype.ub;
R.prototype.sb=function(){return S(this,td.apply(null,[].slice.call(arguments)))};R.prototype.gte=R.prototype.sb;R.prototype.rb=function(){return S(this,ud.apply(null,[].slice.call(arguments)))};R.prototype.gt=R.prototype.rb;R.prototype.vb=function(){return S(this,vd.apply(null,[].slice.call(arguments)))};R.prototype.lte=R.prototype.vb;R.prototype.contains=function(){return S(this,wd.apply(null,[].slice.call(arguments)))};R.prototype.contains=R.prototype.contains;
R.prototype.xb=function(){return S(this,xd.apply(null,[].slice.call(arguments)))};R.prototype.not_contains=R.prototype.xb;R.prototype.Ab=function(){return S(this,yd.apply(null,[].slice.call(arguments)))};R.prototype.starts_with=R.prototype.Ab;R.prototype.zb=function(){return S(this,zd.apply(null,[].slice.call(arguments)))};R.prototype.not_starts_with=R.prototype.zb;R.prototype.kb=function(){return S(this,Ad.apply(null,[].slice.call(arguments)))};R.prototype.ends_with=R.prototype.kb;
R.prototype.yb=function(){return S(this,Bd.apply(null,[].slice.call(arguments)))};R.prototype.not_ends_with=R.prototype.yb;R.prototype.ib=function(){return S(this,Cd.apply(null,[].slice.call(arguments)))};R.prototype.and=R.prototype.ib;R.prototype.jb=function(){return S(this,Dd.apply(null,[].slice.call(arguments)))};R.prototype.date=R.prototype.jb;R.prototype.tb=function(){return S(this,Ed.apply(null,[].slice.call(arguments)))};R.prototype.inList=R.prototype.tb;
R.prototype.bounds=function(){return S(this,Fd.apply(null,[].slice.call(arguments)))};R.prototype.bounds=R.prototype.bounds;R.prototype.name=function(){return"Filter"};var T=function(a,b,c){Q.call(this,a,b,c);Gd()};u(T,Q);t("ee.Collection",T);var Hd=!1,Gd=function(){Hd||(M(T,"Collection","Collection"),M(T,"AggregateFeatureCollection","Collection","aggregate_"),Hd=!0)};T.prototype.filter=function(a){if(!a)throw Error("Empty filters.");return Mc(this,L("Collection.filter",this,a))};t("ee.Collection.prototype.filter",T.prototype.filter);T.prototype.pb=function(a,b,c){return this.filter(pd(a,b,c))};t("ee.Collection.prototype.filterMetadata",T.prototype.pb);
T.prototype.nb=function(a){return this.filter(Fd(a))};t("ee.Collection.prototype.filterBounds",T.prototype.nb);T.prototype.ob=function(a,b){return this.filter(Dd(a,b))};t("ee.Collection.prototype.filterDate",T.prototype.ob);T.prototype.limit=function(a,b,c){return Mc(this,L("Collection.limit",this,a,b,c))};t("ee.Collection.prototype.limit",T.prototype.limit);T.prototype.sort=function(a,b){return Mc(this,L("Collection.limit",this,void 0,a,b))};t("ee.Collection.prototype.sort",T.prototype.sort);
T.prototype.name=function(){return"Collection"};var Id=function(a,b,c){if(!q(c))throw Error("Can't map non-callable object: "+c);b={name:"",returns:"Object",args:[{name:null,type:Sc(b)}]};return Mc(a,Yc("Collection.map",{collection:a,baseAlgorithm:new hd(b,c)}))};T.prototype.map=function(a){return Id(this,H,a)};t("ee.Collection.prototype.map",T.prototype.map);var Jd=function(a,b){if(!(this instanceof Jd))return I(Jd,arguments);if(a instanceof Jd)return a;Kd();var c=new K("Date"),d={},e=null;if(Vc(a)){if(d.value=a,b)if(Vc(b))d.timeZone=b;else throw Error("Invalid argument specified for ee.Date(..., opt_tz): "+b);}else if(Uc(a))d.value=a;else if(r(a)&&"function"==typeof a.getFullYear)d.value=Math.floor(a.getTime());else if(a instanceof H)a.b!=c?d.value=a:(c=a.b,d=a.c,e=a.d);else throw Error("Invalid argument specified for ee.Date(): "+a);H.call(this,c,d,
e)};u(Jd,H);t("ee.Date",Jd);var Ld=!1,Kd=function(){Ld||(M(Jd,"Date","Date"),Ld=!0)};Jd.prototype.name=function(){return"Date"};var U=function(a,b,c){if(!(this instanceof U))return I(U,arguments);Md();var d=null!=b||null!=c;if(a instanceof H&&!(a instanceof U&&a.J)){if(d)throw Error("Setting the CRS or geodesic on a computed Geometry is not suported. Use Geometry.transform().");H.call(this,a.b,a.c,a.d)}else{a instanceof U&&(a=a.e());if(3<arguments.length)throw Error("The Geometry constructor takes at most 3 arguments ("+arguments.length+" given)");if(!Nd(a))throw Error("Invalid GeoJSON geometry: "+JSON.stringify(a));H.call(this,
null,null);this.J=a.type;this.Na=a.coordinates||null;this.Oa=a.geometries||null;if(null!=b)this.da=b;else if("crs"in a)if(r(a.crs)&&"name"==a.crs.type&&r(a.crs.properties)&&p(a.crs.properties.name))this.da=a.crs.properties.name;else throw Error("Invalid CRS declaration in GeoJSON: "+(new va).h(a.crs));this.ca=c;!l(c)&&"geodesic"in a&&(this.ca=Boolean(a.geodesic))}};u(U,H);t("ee.Geometry",U);
var Od=!1,Md=function(){Od||(M(U,"Geometry","Geometry"),Od=!0)},Pd=function(a,b){if(!(this instanceof Pd))return Qd(Pd,arguments);if(2<arguments.length)throw Error("The Geometry.Point constructor takes at most 2 arguments ("+arguments.length+" given)");if(1==arguments.length&&m(arguments[0])&&2==arguments[0].length){var c=arguments[0];a=c[0];b=c[1]}U.call(this,{type:"Point",coordinates:[a,b]})};u(Pd,U);U.Point=Pd;
var Rd=function(a){if(!(this instanceof Rd))return Qd(Rd,arguments);U.call(this,{type:"MultiPoint",coordinates:Sd(a,2,arguments)})};u(Rd,U);U.MultiPoint=Rd;var Td=function(a,b,c,d){if(!(this instanceof Td))return I(Td,arguments);if(4<arguments.length)throw Error("The Geometry.Rectangle constructor takes at most 4 arguments ("+arguments.length+" given)");if(m(a)){var e=a;a=e[0];b=e[1];c=e[2];d=e[3]}U.call(this,{type:"Polygon",coordinates:[[[a,d],[a,b],[c,b],[c,d]]]})};u(Td,U);U.Rectangle=Td;
var Ud=function(a){if(!(this instanceof Ud))return Qd(Ud,arguments);U.call(this,{type:"LineString",coordinates:Sd(a,2,arguments)})};u(Ud,U);U.LineString=Ud;var Vd=function(a){if(!(this instanceof Vd))return Qd(Vd,arguments);U.call(this,{type:"LinearRing",coordinates:Sd(a,2,arguments)})};u(Vd,U);U.LinearRing=Vd;var Wd=function(a){if(!(this instanceof Wd))return Qd(Wd,arguments);U.call(this,{type:"MultiLineString",coordinates:Sd(a,3,arguments)})};u(Wd,U);U.MultiLineString=Wd;
var Xd=function(a){if(!(this instanceof Xd))return Qd(Xd,arguments);U.call(this,{type:"Polygon",coordinates:Sd(a,3,arguments)})};u(Xd,U);U.Polygon=Xd;var Yd=function(a){if(!(this instanceof Yd))return Qd(Yd,arguments);U.call(this,{type:"MultiPolygon",coordinates:Sd(a,4,arguments)})};u(Yd,U);U.MultiPolygon=Yd;
U.prototype.e=function(a){if(!this.J){if(!a)throw Error("Must specify an encode function when encoding a computed geometry.");return H.prototype.e.call(this,a)}a={type:this.J};"GeometryCollection"==this.J?a.geometries=this.Oa:a.coordinates=this.Na;null!=this.da&&(a.crs={type:"name",properties:{name:this.da}});null!=this.ca&&(a.geodesic=this.ca);return a};U.prototype.za=function(){if(this.b)throw Error("Can't convert a computed Geometry to GeoJSON. Use getInfo() instead.");return this.e()};
U.prototype.toGeoJSON=U.prototype.za;U.prototype.La=function(){if(this.b)throw Error("Can't convert a computed Geometry to GeoJSON. Use getInfo() instead.");return(new va).h(this.za())};U.prototype.toGeoJSONString=U.prototype.La;U.prototype.type=function(){if(this.b)throw Error("Can't get the type of a computed Geometry to GeoJSON. Use getInfo() instead.");return this.J};U.prototype.type=U.prototype.type;U.prototype.h=function(){return Kc(this)};U.prototype.serialize=U.prototype.h;
U.prototype.toString=function(){return"ee.Geometry("+this.La()+")"};
var Nd=function(a){var b=a.type;if("GeometryCollection"==b){b=a.geometries;if(!m(b))return!1;for(a=0;a<b.length;a++)if(!Nd(b[a]))return!1;return!0}a=Zd(a.coordinates);return"Point"==b&&1==a||"MultiPoint"==b&&2==a||"LineString"==b&&2==a||"LinearRing"==b&&2==a||"MultiLineString"==b&&3==a||"Polygon"==b&&3==a||"MultiPolygon"==b&&4==a},Zd=function(a){if(!m(a))return-1;if(m(a[0])){for(var b=Zd(a[0]),c=1;c<a.length;c++)if(Zd(a[c])!=b)return-1;return b+1}for(c=0;c<a.length;c++)if(!ea(a[c]))return-1;return 0==
a.length%2?1:-1},Sd=function(a,b,c){if(2>b||4<b)throw Error("Unexpected nesting level.");if(!m(a)&&c&&(a=Array.prototype.slice.call(c),"number"==typeof a[0])){if(0!=a.length%2)throw Error("Invalid number of coordinates: "+a.length);c=[];for(var d=0;d<a.length;d+=2)c.push([a[d],a[d+1]]);a=c}c=a;for(d=0;m(c);)c=c[0],d++;for(;d<b;)a=[a],d++;if(Zd(a)!=b)throw Error("Invalid geometry");return a},Qd=function(a,b){var c=function(){};c.prototype=a.prototype;var c=new c,d=a.apply(c,b);return void 0!==d?d:
c};U.prototype.name=function(){return"Geometry"};t("ee.Deserializer",function(){});t("ee.Deserializer.fromJSON",function(a){return $d(sa(a))});var $d=function(a){var b={};if(r(a)&&"CompoundValue"==a.type){for(var c=a.scope,d=0;d<c.length;d++){var e=c[d][0],f=c[d][1];if(e in b)throw Error('Duplicate scope key "'+e+'" in scope #'+d+".");b[e]=ae(f,b)}a=a.value}return ae(a,b)};t("ee.Deserializer.decode",$d);
var ae=function(a,b){if(null===a||ea(a)||"boolean"==typeof a||p(a))return a;if(m(a))return Qa(a,function(a){return ae(a,b)});if(!r(a)||q(a))throw Error("Cannot decode object: "+a);var c=a.type;switch(c){case "ValueRef":if(a.value in b)return b[a.value];throw Error("Unknown ValueRef: "+a);case "ArgumentRef":c=a.value;if(!p(c))throw Error("Invalid variable name: "+c);return id(Object,c);case "Date":c=a.value;if(!ea(c))throw Error("Invalid date value: "+c);return new Jd(c/1E3);case "Bytes":return c=
new Ac,c.e=function(){return a},c;case "Invocation":var c="functionName"in a?Xc(a.functionName):ae(a["function"],b),d=la(a.arguments,function(a){return ae(a,b)});if(c instanceof J)return c.apply(d);if(c instanceof H)return new H(c,d);throw Error("Invalid function value: "+a["function"]);case "Dictionary":return la(a.value,function(a){return ae(a,b)});case "Function":var e=ae(a.body,b),c={name:"",args:Qa(a.argumentNames,function(a){return{name:a,type:"Object",optional:!1}}),returns:"Object"};return new hd(c,
function(){return e});case "Point":case "MultiPoint":case "LineString":case "MultiLineString":case "Polygon":case "MultiPolygon":case "LinearRing":case "GeometryCollection":return new U(a);case "CompoundValue":throw Error("Nested CompoundValues are disallowed.");default:throw Error("Unknown encoded object type: "+c);}};var V=function(a){if(!(this instanceof V))return I(V,arguments);if(a instanceof V)return a;be();if(Wc(a))H.call(this,null,null),this.ea=a;else if(a instanceof H)H.call(this,a.b,a.c,a.d),this.ea=null;else throw Error("Invalid argument specified for ee.Dictionary(): "+a);};u(V,H);t("ee.Dictionary",V);var ce=!1,be=function(){ce||(M(V,"Dictionary","Dictionary"),ce=!0)};V.prototype.e=function(a){return null===this.ea?V.m.e.call(this,a):a(this.ea)};V.prototype.name=function(){return"Dictionary"};var W=function(a,b){if(!(this instanceof W))return I(W,arguments);if(a instanceof W){if(b)throw Error("Can't create Feature out of a Feature and properties.");return a}if(2<arguments.length)throw Error("The Feature constructor takes at most 2 arguments ("+arguments.length+" given)");de();if(a instanceof U||null===a)Q.call(this,new K("Feature"),{geometry:a,metadata:b||null});else if(a instanceof H)Q.call(this,a.b,a.c,a.d);else if("Feature"==a.type){var c=a.properties||{};if("id"in a){if("system:index"in
c)throw Error('Can\t specify both "id" and "system:index".');c=v(c);c["system:index"]=a.id}Q.call(this,new K("Feature"),{geometry:new U(a.geometry),metadata:c})}else Q.call(this,new K("Feature"),{geometry:new U(a),metadata:b||null})};u(W,Q);t("ee.Feature",W);var fe=!1,de=function(){fe||(M(W,"Feature","Feature"),fe=!0)};W.prototype.j=function(a){return W.m.j.call(this,a)};W.prototype.getInfo=W.prototype.j;W.prototype.getMap=function(a,b){return L("Collection",[this]).getMap(a,b)};
W.prototype.getMap=W.prototype.getMap;W.Point=function(a,b){return Pd.apply(null,arguments)};W.MultiPoint=function(a){return Rd.apply(null,arguments)};W.Rectangle=function(a,b,c,d){return new Td(a,b,c,d)};W.LineString=function(a){return Ud.apply(null,arguments)};W.LinearRing=function(a){return Vd.apply(null,arguments)};W.MultiLine=function(a){return Wd.apply(null,arguments)};W.Polygon=function(a){return Xd.apply(null,arguments)};W.MultiPolygon=function(a){return Yd.apply(null,arguments)};
W.prototype.name=function(){return"Feature"};var X=function(a){if(!(this instanceof X))return I(X,arguments);if(a instanceof X)return a;ge();if(m(a))H.call(this,null,null),this.fa=a;else if(a instanceof H)H.call(this,a.b,a.c,a.d),this.fa=null;else throw Error("Invalid argument specified for ee.List(): "+a);};u(X,H);t("ee.List",X);var he=!1,ge=function(){he||(M(X,"List","List"),he=!0)};X.prototype.e=function(a){return m(this.fa)?Qa(this.fa,function(b){return a(b)}):X.m.e.call(this,a)};X.prototype.name=function(){return"List"};
X.prototype.map=function(a){if(!q(a))throw Error("Can't map non-callable object: "+a);return Mc(this,Yc("List.map",{list:this,baseAlgorithm:new hd({name:"",returns:"Object",args:[{name:null,type:"Object"}]},a)}))};X.prototype.map=X.prototype.map;var Y=function(a,b){if(!(this instanceof Y))return I(Y,arguments);if(a instanceof Y)return a;if(2<arguments.length)throw Error("The FeatureCollection constructor takes at most 2 arguments ("+arguments.length+" given)");ie();a instanceof U&&(a=new W(a));a instanceof W&&(a=[a]);if(Uc(a)||Vc(a)){var c={tableId:a};b&&(c.geometryColumn=b);T.call(this,new K("Collection.loadTable"),c)}else if(m(a))T.call(this,new K("Collection"),{features:Qa(a,function(a){return new W(a)})});else if(a instanceof X)T.call(this,
new K("Collection"),{features:a});else if(a instanceof H)T.call(this,a.b,a.c,a.d);else throw Error("Unrecognized argument type to convert to a FeatureCollection: "+a);};u(Y,T);t("ee.FeatureCollection",Y);var ke=!1,ie=function(){ke||(M(Y,"FeatureCollection","FeatureCollection"),ke=!0)};Y.prototype.getMap=function(a,b){var c=Yc("Collection.draw",{collection:this,color:(a||{}).color||"000000"});if(b)c.getMap(null,b);else return c.getMap()};Y.prototype.getMap=Y.prototype.getMap;
Y.prototype.j=function(a){return Y.m.j.call(this,a)};Y.prototype.getInfo=Y.prototype.j;Y.prototype.ta=function(a,b,c,d){var e={};e.table=this.h();a&&(e.format=a.toUpperCase());c&&(e.filename=c);b&&(e.selectors=b);if(d)xc(e,function(a,b){a?d(yc(a)):d(null,b)});else return yc(xc(e))};Y.prototype.getDownloadURL=Y.prototype.ta;Y.prototype.map=function(a){return Id(this,W,a)};Y.prototype.name=function(){return"FeatureCollection"};var Z=function(a){if(!(this instanceof Z))return I(Z,arguments);if(a instanceof Z)return a;le();var b=arguments.length;if(0==b||1==b&&!l(a))Q.call(this,new K("Image.mask"),{image:new Z(0),mask:new Z(0)});else if(1==b)if(Uc(a))Q.call(this,new K("Image.constant"),{value:a});else if(Vc(a))Q.call(this,new K("Image.load"),{id:a});else{if(m(a))return me(Qa(a,function(a){return new Z(a)}));if(a instanceof H)"Array"==a.name()?Q.call(this,new K("Image.constant"),{value:a}):Q.call(this,a.b,a.c,a.d);else throw Error("Unrecognized argument type to convert to an Image: "+
a);}else if(2==b){var b=arguments[0],c=arguments[1];if(Vc(b)&&Uc(c))Q.call(this,new K("Image.load"),{id:b,version:c});else throw Error("Unrecognized argument types to convert to an Image: "+arguments);}else throw Error("The Image constructor takes at most 2 arguments ("+b+" given)");};u(Z,Q);t("ee.Image",Z);var ne=!1,le=function(){ne||(M(Z,"Image","Image"),M(Z,"Window","Image","focal_"),ne=!0)};Z.prototype.j=function(a){return Z.m.j.call(this,a)};Z.prototype.getInfo=Z.prototype.j;
Z.prototype.getMap=function(a,b){var c=a?v(a):{};c.image=this.h();if(b)rc(c,s(function(a,c){a&&(a.image=this);b(a,c)},this));else return c=rc(c),c.image=this,c};Z.prototype.getMap=Z.prototype.getMap;Z.prototype.ta=function(a,b){var c=a?v(a):{};c.image=this.h();if(b)vc(c,function(a,c){a?b(wc(a)):b(null,c)});else return wc(vc(c))};Z.prototype.getDownloadURL=Z.prototype.ta;Z.prototype.qb=function(a){a=a?v(a):{};a.image=this.h();return uc(tc(a))};Z.prototype.getThumbURL=Z.prototype.qb;
Z.rgb=function(a,b,c){return me([a,b,c],["vis-red","vis-green","vis-blue"])};Z.cat=function(a){return me(Array.prototype.slice.call(arguments),null)};var me=function(a,b){if(0==a.length)throw Error("Can't combine 0 images.");for(var c=new Z(a[0]),d=1;d<a.length;d++)c=L("Image.addBands",c,a[d]);b&&(c=c.select([".*"],b));return c};
Z.prototype.select=function(a,b){l(a)||(a=[]);var c={input:this,bandSelectors:a};if(Vc(a)||Uc(a)){a=Array.prototype.slice.call(arguments);for(var d=0;d<a.length;d++)if(!(Vc(a[d])||Uc(a[d])||a[d]instanceof H))throw Error("Illegal argument to select(): "+a[d]);c.bandSelectors=a}else b&&(c.newNames=b);return Yc("Image.select",c)};Z.prototype.select=Z.prototype.select;
Z.prototype.mb=function(a,b){var c=L("Image.parseExpression",a,"DEFAULT_EXPRESSION_IMAGE"),d=["DEFAULT_EXPRESSION_IMAGE"],e={DEFAULT_EXPRESSION_IMAGE:this};if(b)for(var f in b)d.push(f),e[f]=new Z(b[f]);f=new J;f.e=function(a){return c.e(a)};f.r=function(){return{name:"",args:Qa(d,function(a){return{name:a,type:"Image",optional:!1}},this),returns:"Image"}};return f.apply(e)};Z.prototype.expression=Z.prototype.mb;Z.prototype.clip=function(a){try{a=new U(a)}catch(b){}return L("Image.clip",this,a)};
Z.prototype.clip=Z.prototype.clip;Z.prototype.name=function(){return"Image"};var $=function(a){if(!(this instanceof $))return I($,arguments);if(a instanceof $)return a;if(1!=arguments.length)throw Error("The ImageCollection constructor takes exactly 1 argument ("+arguments.length+" given)");oe();a instanceof Z&&(a=[a]);if(Vc(a))T.call(this,new K("ImageCollection.load"),{id:a});else if(m(a))T.call(this,new K("ImageCollection.fromImages"),{images:Qa(a,function(a){return new Z(a)})});else if(a instanceof H)T.call(this,a.b,a.c,a.d);else throw Error("Unrecognized argument type to convert to an ImageCollection: "+
a);};u($,T);t("ee.ImageCollection",$);var pe=!1,oe=function(){pe||(M($,"ImageCollection","ImageCollection"),M($,"reduce","ImageCollection"),pe=!0)};$.prototype.getMap=function(a,b){var c=L("ImageCollection.mosaic",this);if(b)c.getMap(a,b);else return c.getMap(a)};$.prototype.getMap=$.prototype.getMap;$.prototype.j=function(a){return $.m.j.call(this,a)};$.prototype.getInfo=$.prototype.j;$.prototype.map=function(a){return Id(this,Z,a)};
$.prototype.select=function(a,b){var c=arguments;return this.map(function(a){return a.select.apply(a,c)})};$.prototype.select=$.prototype.select;$.prototype.name=function(){return"ImageCollection"};t("ee.initialize",function(a,b,c,d){if("ready"!=qe||a||b){var e=null!=c;if(d)if(e)re.push(d);else throw Error("Can't pass an error callback without a success callback.");if("loading"==qe&&e)se.push(c);else if(qe="loading",qc(a,b),e)se.push(c),$c(te,ue);else try{$c(),te()}catch(f){throw ue(f),f;}}else c&&c()});
t("ee.reset",function(){qe="not_ready";nc=mc=null;oc=!1;ja=null;Zc={};N(Jd);Ld=!1;N(V);ce=!1;N(Q);ld=!1;N(Z);ne=!1;N(W);fe=!1;N(T);Hd=!1;N($);pe=!1;N(Y);ke=!1;N(R);nd=!1;N(U);Od=!1;N(X);he=!1;N(O);ed=!1;N(P);gd=!1;for(var a=k.ee,b=0;b<ve.length;b++){var c=ve[b];N(a[c]);delete a[c]}ve=[];Qc=a;var a=we,d;for(d in a)delete a[d]});t("ee.InitState",{Db:"not_ready",LOADING:"loading",Eb:"ready"});t("ee.InitState.NOT_READY","not_ready");t("ee.InitState.LOADING","loading");t("ee.InitState.READY","ready");
var qe="not_ready",se=[],re=[];t("ee.TILE_SIZE",256);var ve=[],we={};t("ee.Algorithms",we);t("ee.call",function(a,b){p(a)&&(a=new K(a));return J.prototype.call.apply(a,Array.prototype.slice.call(arguments,1))});t("ee.apply",function(a,b){p(a)&&(a=new K(a));return a.apply(b)});
var te=function(){if("loading"==qe){try{Kd();be();kd();le();de();Gd();oe();ie();md();Md();ge();dd();fd();var a=ad(),b={},c={},d;for(d in a){b[-1!=d.indexOf(".")?d.slice(0,d.indexOf(".")):d]=!0;var e=a[d].returns.replace(/<.*>/,"");c[e]=!0}var f=k.ee,g;for(g in b)g in c&&!(g in f)&&(f[g]=xe(g),ve.push(g),a[g]?(f[g].signature=a[g],f[g].signature.isConstructor=!0,Zc[g]=!0):f[g].signature={});Qc=f;ye()}catch(n){ue(n);return}qe="ready";for(re=[];0<se.length;)se.shift()()}},ue=function(a){if("loading"==
qe)for(qe="not_ready",se=[];0<re.length;)re.shift()(a)},ye=function(){ia(bd(),function(a,b){var c=a.r();if(!c.hidden){var d=b.split("."),e=we;for(e.signature={};1<d.length;){var f=d[0];f in e||(e[f]={signature:{}});e=e[f];d=Wa(d,1)}f=s(a.call,a);f.signature=c;f.toString=s(a.toString,a);e[d[0]]=f}})},xe=function(a){var b=function(b){var d=k.ee[a],e=Array.prototype.slice.call(arguments),f=1==e.length;if(f&&e[0]instanceof d)return e[0];if(!(this instanceof d))return I(d,e);var d=cd(a),g=!(e[0]instanceof
H),n=!1;d&&(f?g?n=!0:e[0].b!=d&&(n=!0):n=!0);if(n)H.call(this,d,Pc(d,Oc(d,e)));else{if(!f)throw Error("Too many arguments for ee."+a+"(): "+e);if(g)throw Error("Invalid argument for ee."+a+"(): "+e+". Must be a ComputedObject.");e=e[0];H.call(this,e.b,e.c,e.d)}};u(b,H);b.prototype.name=function(){return a};M(b,a,a);return b},Nc=function(a,b){if(null===a)return null;if(l(a)){var c=k.ee;switch(b){case "Image":return new Z(a);case "Feature":return a instanceof T?L("Feature",L("Collection.geometry",a)):
new W(a);case "Element":case "EEObject":if(a instanceof Q)return a;if(a instanceof H)return new Q(a.b,a.c,a.d);throw Error("Cannot convert "+a+" to Element.");case "Geometry":return a instanceof Y?L("Collection.geometry",a):new U(a);case "FeatureCollection":case "Collection":return a instanceof T?a:new Y(a);case "ImageCollection":return new $(a);case "Filter":return new R(a);case "Algorithm":return p(a)?new K(a):a;case "String":return Vc(a)||a instanceof P||a instanceof H?new P(a):a;case "Dictionary":return Wc(a)?
a:new V(a);case "List":return new X(a);case "Number":case "Float":case "Long":case "Integer":case "Short":case "Byte":return new O(a);default:if(b in c){var d=cd(b);if(a instanceof c[b])return a;if(d)return new c[b](a);if(p(a)){if(a in c[b])return c[b][a].call();throw Error("Unknown algorithm: "+b+"."+a);}return new c[b](a)}return a}}};!db&&!x||x&&x&&9<=jb||db&&z("1.9.1");x&&z("9");x&&z("11");})();
//@ sourceMappingURL=ee_api_js.sourcemap