From a898ffcc21ce158e0f52cecf1e1be1b0175c43cd Mon Sep 17 00:00:00 2001 From: Google Earth Engine Authors Date: Tue, 2 Jan 2024 23:49:02 +0000 Subject: [PATCH 001/201] v0.1.385 PiperOrigin-RevId: 595228777 --- .github/workflows/ci-type-verification.yml | 13 +- javascript/build/ee_api_js.js | 430 +++++++++--------- javascript/build/ee_api_js_debug.js | 275 ++++++----- javascript/build/ee_api_js_npm.js | 320 +++++++------ javascript/package.json | 2 +- javascript/src/apiclient.js | 2 +- javascript/src/eeapiclient/api_client.ts | 31 +- .../src/eeapiclient/api_request_hook.ts | 13 +- javascript/src/eeapiclient/domain_object.ts | 267 +++++++---- javascript/src/eeapiclient/generated_types.ts | 13 +- .../src/eeapiclient/multipart_request.ts | 41 +- .../src/eeapiclient/promise_api_client.ts | 73 +-- .../eeapiclient/promise_request_service.ts | 23 +- javascript/src/eeapiclient/request_params.ts | 39 +- .../src/eeapiclient/request_params_test.ts | 153 +++---- python/ee/__init__.py | 28 +- python/ee/_cloud_api_utils.py | 3 + python/ee/batch.py | 11 +- python/ee/blob.py | 7 +- python/ee/cli/utils.py | 18 +- python/ee/data.py | 38 +- python/ee/oauth.py | 26 +- python/ee/pixeltype.py | 98 ++++ python/ee/tests/_cloud_api_utils_test.py | 25 + python/ee/tests/batch_test.py | 13 + python/ee/tests/blob_test.py | 25 + python/ee/tests/ee_test.py | 67 ++- python/ee/tests/pixeltype_test.py | 165 +++++++ python/pyproject.toml | 2 +- 29 files changed, 1390 insertions(+), 831 deletions(-) create mode 100644 python/ee/pixeltype.py create mode 100644 python/ee/tests/pixeltype_test.py diff --git a/.github/workflows/ci-type-verification.yml b/.github/workflows/ci-type-verification.yml index d3c82893d..a45f09a96 100644 --- a/.github/workflows/ci-type-verification.yml +++ b/.github/workflows/ci-type-verification.yml @@ -22,11 +22,18 @@ jobs: python-version: 3.11 - name: Install EE API run: | - pip install -e ./python + pip install ./python pip install pyright - - name: ee type verification + pip install mypy + - name: pyright ee type verification run: | pyright --verifytypes ee - - name: ee.cli type verification + continue-on-error: true + - name: pyright ee.cli type verification run: | pyright --verifytypes ee.cli + continue-on-error: true + - name: mypy ee and ee.cli type verification + run: | + mypy -p ee + continue-on-error: true diff --git a/javascript/build/ee_api_js.js b/javascript/build/ee_api_js.js index d95d6f95c..8a3237d01 100644 --- a/javascript/build/ee_api_js.js +++ b/javascript/build/ee_api_js.js @@ -1,17 +1,17 @@ (function(){var h,aa=function(a){var b=0;return function(){return b>>0)+"_",d=0,e=function(g){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new b(c+(g||"")+"_"+d++,g)};return e}); +da("Symbol",function(a){if(a)return a;var b=function(g,f){this.Zi=g;ba(this,"description",{configurable:!0,writable:!0,value:f})};b.prototype.toString=function(){return this.Zi};var c="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",d=0,e=function(g){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new b(c+(g||"")+"_"+d++,g)};return e}); da("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c>>0),Ba=0,Da=function(a,b,c){return a.call.apply(a.bind, arguments)},Ea=function(a,b,c){if(!a)throw Error();if(2c&&(c=Math.max(0,a.length+c));if("string"===typeof a)return"string"!==typeof b|| 1!=b.length?-1:a.lastIndexOf(b,c);for(;0<=c;c--)if(c in a&&a[c]===b)return c;return-1},Ua=Array.prototype.forEach?function(a,b){B(null!=a.length);Array.prototype.forEach.call(a,b,void 0)}:function(a,b){for(var c=a.length,d="string"===typeof a?a.split(""):a,e=0;ea-0)return[];for(var c=0;c>>0),cc=function(a){B(a,"Listener can not be null.");if("function"===typeof a)return a;B(a.handleEvent,"An object listener must have handleEvent method.");a[kc]||(a[kc]=function(b){return a.handleEvent(b)}); -return a[kc]};var D=function(){y.call(this);this.Ia=new Vb(this);this.Qk=this;this.Wf=null};x(D,y);D.prototype[Ab]=!0;h=D.prototype;h.addEventListener=function(a,b,c,d){bc(this,a,b,c,d)};h.removeEventListener=function(a,b,c,d){ic(this,a,b,c,d)}; -h.dispatchEvent=function(a){lc(this);var b=this.Wf;if(b){var c=[];for(var d=1;b;b=b.Wf)c.push(b),B(1E3>++d,"infinite loop")}b=this.Qk;d=a.type||a;if("string"===typeof a)a=new A(a,b);else if(a instanceof A)a.target=a.target||b;else{var e=a;a=new A(d,b);Ub(a,e)}e=!0;if(c)for(var g=c.length-1;!a.fd&&0<=g;g--){var f=a.currentTarget=c[g];e=mc(f,d,!0,a)&&e}a.fd||(f=a.currentTarget=b,e=mc(f,d,!0,a)&&e,a.fd||(e=mc(f,d,!1,a)&&e));if(c)for(g=0;!a.fd&&g>>0),cc=function(a){B(a,"Listener can not be null.");if("function"===typeof a)return a;B(a.handleEvent,"An object listener must have handleEvent method.");a[kc]||(a[kc]=function(b){return a.handleEvent(b)}); +return a[kc]};var D=function(){y.call(this);this.Ia=new Vb(this);this.Pk=this;this.Wf=null};x(D,y);D.prototype[Ab]=!0;h=D.prototype;h.addEventListener=function(a,b,c,d){bc(this,a,b,c,d)};h.removeEventListener=function(a,b,c,d){ic(this,a,b,c,d)}; +h.dispatchEvent=function(a){lc(this);var b=this.Wf;if(b){var c=[];for(var d=1;b;b=b.Wf)c.push(b),B(1E3>++d,"infinite loop")}b=this.Pk;d=a.type||a;if("string"===typeof a)a=new A(a,b);else if(a instanceof A)a.target=a.target||b;else{var e=a;a=new A(d,b);Ub(a,e)}e=!0;if(c)for(var g=c.length-1;!a.cd&&0<=g;g--){var f=a.currentTarget=c[g];e=mc(f,d,!0,a)&&e}a.cd||(f=a.currentTarget=b,e=mc(f,d,!0,a)&&e,a.cd||(e=mc(f,d,!1,a)&&e));if(c)for(g=0;!a.cd&&g=a.length)return sc;if(b in a)return{value:a[b++],done:!1};b++}};return c}throw Error("Not implemented");},uc=function(a,b){if(xa(a))Ua(a,b);else for(a=tc(a);;){var c=a.next();if(c.done)break;b.call(void 0,c.value,void 0,a)}};var yc=function(a){if(a instanceof vc||a instanceof wc||a instanceof xc)return a;if("function"==typeof a.next)return new vc(function(){return a});if("function"==typeof a[Symbol.iterator])return new vc(function(){return a[Symbol.iterator]()});if("function"==typeof a.Da)return new vc(function(){return a.Da()});throw Error("Not an iterator or iterable.");},vc=function(a){this.wf=a};vc.prototype.Da=function(){return new wc(this.wf())};vc.prototype[Symbol.iterator]=function(){return new xc(this.wf())}; -vc.prototype.Bg=function(){return new xc(this.wf())};var wc=function(a){this.Uc=a};q(wc,rc);wc.prototype.next=function(){return this.Uc.next()};wc.prototype[Symbol.iterator]=function(){return new xc(this.Uc)};wc.prototype.Bg=function(){return new xc(this.Uc)};var xc=function(a){vc.call(this,function(){return a});this.Uc=a};q(xc,vc);xc.prototype.next=function(){return this.Uc.next()};var zc=function(a,b){this.A={};this.K=[];this.rd=this.size=0;var c=arguments.length;if(12*this.size&&Ac(this),!0):!1};var Ac=function(a){if(a.size!=a.K.length){for(var b=0,c=0;b=d.K.length)return sc;var g=d.K[b++];return{value:a?g:d.A[g],done:!1}};return e};h.mb=function(a){this.size=a};var Bc=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var Dc=function(a){if(a.R&&"function"==typeof a.R)a=a.R();else if(xa(a)||"string"===typeof a)a=a.length;else{var b=0,c;for(c in a)b++;a=b}return a},Ec=function(a){if(a.aa&&"function"==typeof a.aa)return a.aa();if("undefined"!==typeof Map&&a instanceof Map||"undefined"!==typeof Set&&a instanceof Set)return Array.from(a.values());if("string"===typeof a)return a.split("");if(xa(a)){for(var b=[],c=a.length,d=0;d2*this.size&&Ac(this),!0):!1};var Ac=function(a){if(a.size!=a.K.length){for(var b=0,c=0;b=d.K.length)return sc;var g=d.K[b++];return{value:a?g:d.A[g],done:!1}};return e};h.mb=function(a){this.size=a};var Bc=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var Dc=function(a){if(a.R&&"function"==typeof a.R)a=a.R();else if(xa(a)||"string"===typeof a)a=a.length;else{var b=0,c;for(c in a)b++;a=b}return a},Ec=function(a){if(a.aa&&"function"==typeof a.aa)return a.aa();if("undefined"!==typeof Map&&a instanceof Map||"undefined"!==typeof Set&&a instanceof Set)return Array.from(a.values());if("string"===typeof a)return a.split("");if(xa(a)){for(var b=[],c=a.length,d=0;dc)return!1;!(b instanceof Ic)&&5e&&(e+=d);return[a.nl,c,e,b.y].join("/")};Nc.prototype.Nc=function(){return this.Ab.length};var Pc=function(a){A.call(this,"tileevent");this.count=a};x(Pc,A);var Qc=function(){},Rc=new Qc;function Sc(a){return Object.assign({},{P:{},Pl:{},keys:[],Ma:{},s:{},H:{},wh:!1},a)}var E=function(){this.h={}},F=function(a,b){return a.h.hasOwnProperty(b)?a.h[b]:null},G=function(a,b){return null!=a.h[b]};function Tc(a,b){return F(b,a)}function Uc(a,b,c){b[a]=c}function Vc(){return{}}function Wc(a,b){var c=new a;return null==b?c:Xc(b,Yc,Zc,$c,a)}function Yc(a,b){return b[a]}function Zc(a,b,c){b.h[a]=c} +Ic.prototype[Symbol.iterator]=function(){return this.values()};Ic.prototype.mb=function(a){this.size=a};var Nc=function(a,b,c){D.call(this);this.ml=b;this.token=c;this.Ab=[];this.zg=new Ic;this.yb=0;this.url=a};x(Nc,D);w("ee.AbstractOverlay",Nc);var Oc=function(a,b,c){var d=1<e&&(e+=d);return[a.ml,c,e,b.y].join("/")};Nc.prototype.Nc=function(){return this.Ab.length};var Pc=function(a){A.call(this,"tileevent");this.count=a};x(Pc,A);var Qc=function(){},Rc=new Qc;function Sc(a){return Object.assign({},{P:{},Pl:{},keys:[],Ma:{},s:{},H:{},wh:!1},a)}var E=function(){this.h={}},F=function(a,b){return a.h.hasOwnProperty(b)?a.h[b]:null},G=function(a,b){return null!=a.h[b]};function Tc(a,b){return F(b,a)}function Uc(a,b,c){b[a]=c}function Vc(){return{}}function Wc(a,b){var c=new a;return null==b?c:Xc(b,Yc,Zc,$c,a)}function Yc(a,b){return b[a]}function Zc(a,b,c){b.h[a]=c} function $c(a){if(null==a)throw Error("Cannot deserialize, target constructor was null.");return new a} -function Xc(a,b,c,d,e){e=d(e);for(var g=ad(a,e),f=g.P||{},l=g.s||{},m=g.Ma||{},p=n(g.keys||[]),v=p.next(),z={};!v.done;z={Yc:z.Yc},v=p.next()){v=v.value;var C=b(v,a);if(null!=C){var Q=void 0;if(f.hasOwnProperty(v)){if(g.wh&&0===C.length)continue;Q=bd(C,b,c,d,!0,!0,f[v])}else if(l.hasOwnProperty(v))Q=bd(C,b,c,d,!1,!0,l[v]);else if(m.hasOwnProperty(v))z.Yc=m[v],Q=z.Yc.pa?C.map(function(oa){return function(S){return cd(S,oa.Yc,b,c,d)}}(z)):cd(C,z.Yc,b,c,d);else if(Array.isArray(C)){if(g.wh&&0===C.length)continue; +function Xc(a,b,c,d,e){e=d(e);for(var g=ad(a,e),f=g.P||{},l=g.s||{},m=g.Ma||{},p=n(g.keys||[]),v=p.next(),z={};!v.done;z={Xd:void 0},v=p.next()){v=v.value;var C=b(v,a);if(null!=C){var Q=void 0;if(f.hasOwnProperty(v)){if(g.wh&&0===C.length)continue;Q=bd(C,b,c,d,!0,!0,f[v])}else if(l.hasOwnProperty(v))Q=bd(C,b,c,d,!1,!0,l[v]);else if(m.hasOwnProperty(v))z.Xd=m[v],Q=z.Xd.pa?C.map(function(oa){return function(S){return cd(S,oa.Xd,b,c,d)}}(z)):cd(C,z.Xd,b,c,d);else if(Array.isArray(C)){if(g.wh&&0===C.length)continue; Q=bd(C,b,c,d,!0,!1)}else Q=C instanceof Qc?null:C;c(v,e,Q)}}return e}function cd(a,b,c,d,e){for(var g={},f=n(Object.keys(a)),l=f.next();!l.done;l=f.next()){l=l.value;var m=a[l];null!=m&&(g[l]=bd(m,c,d,e,b.ra,b.qa,b.ka))}return g} -function bd(a,b,c,d,e,g,f){if(g&&null==f)throw Error("Cannot deserialize a reference object without a constructor.");return null==a?a:e&&g?a.map(function(l){return Xc(l,b,c,d,f)}):e&&!g?a.map(function(l){return l}):!e&&g?Xc(a,b,c,d,f):a instanceof Qc?null:"object"===typeof a?JSON.parse(JSON.stringify(a)):a}function ad(a,b){if(b instanceof E)a=Sc(b.i());else if(a instanceof E)a=Sc(a.i());else throw Error("Cannot find ClassMetadata.");return a};var dd;var fd=function(a,b){if(b!==ed)throw Error("TrustedResourceUrl is not meant to be built directly");this.Yf=a};fd.prototype.toString=function(){return this.Yf+""};fd.prototype.Tc=!0;fd.prototype.Pc=function(){return this.Yf.toString()}; -var gd=function(a){if(a instanceof fd&&a.constructor===fd)return a.Yf;Na("expected object of type TrustedResourceUrl, got '%s' of type %s",a,wa(a));return"type_error:TrustedResourceUrl"},ed={},hd=function(a){if(void 0===dd){var b=null;var c=r.trustedTypes;if(c&&c.createPolicy)try{b=c.createPolicy("goog#html",{createHTML:Ga,createScript:Ga,createScriptURL:Ga})}catch(d){r.console&&r.console.error(d.message)}dd=b}a=(b=dd)?b.createScriptURL(a):a;return new fd(a,ed)};var jd=function(a,b){if(b!==id)throw Error("SafeUrl is not meant to be built directly");this.Xf=a};jd.prototype.toString=function(){return this.Xf.toString()};jd.prototype.Tc=!0;jd.prototype.Pc=function(){return this.Xf.toString()};var kd=function(a){if(a instanceof jd&&a.constructor===jd)return a.Xf;Na("expected object of type SafeUrl, got '"+a+"' of type "+wa(a));return"type_error:SafeUrl"},id={},ld=new jd("about:invalid#zClosurez",id);new jd("about:blank",id);var md={},nd=function(){if(md!==md)throw Error("SafeStyle is not meant to be built directly");this.si="";this.Tc=!0};nd.prototype.Pc=function(){return this.si};nd.prototype.toString=function(){return this.si.toString()};new nd;var od={},pd=function(){if(od!==od)throw Error("SafeStyleSheet is not meant to be built directly");this.ri="";this.Tc=!0};pd.prototype.toString=function(){return this.ri.toString()};pd.prototype.Pc=function(){return this.ri};new pd;var qd={},rd=function(){var a=r.trustedTypes&&r.trustedTypes.emptyHTML||"";if(qd!==qd)throw Error("SafeHtml is not meant to be built directly");this.pi=a;this.Tc=!0};rd.prototype.Pc=function(){return this.pi.toString()};rd.prototype.toString=function(){return this.pi.toString()};new rd;var td=function(a,b){if(!t(a)||!t(a)||!t(a)||1!==a.nodeType||a.namespaceURI&&"http://www.w3.org/1999/xhtml"!==a.namespaceURI||a.tagName.toUpperCase()!=="SCRIPT".toString()){var c="SCRIPT".toString()+"; got: ";if(t(a))try{var d=a.constructor.displayName||a.constructor.name||Object.prototype.toString.call(a)}catch(e){d=""}else d=void 0===a?"undefined":null===a?"null":typeof a;Na("Argument is not an HTML Element with tag name "+(c+d))}a:{c=(a.ownerDocument&&a.ownerDocument.defaultView|| -r).document;if(c.querySelector&&(c=c.querySelector("script[nonce]"))&&(c=c.nonce||c.getAttribute("nonce"))&&sd.test(c))break a;c=""}c&&a.setAttribute("nonce",c);a.src=gd(b)},sd=/^[\w+/_-]+[=]{0,2}$/;var ud=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1"}else d=void 0===a?"undefined":null===a?"null":typeof a;Na("Argument is not an HTML Element with tag name "+(c+d))}a:{c=(a.ownerDocument&&a.ownerDocument.defaultView|| +r).document;if(c.querySelector&&(c=c.querySelector("script[nonce]"))&&(c=c.nonce||c.getAttribute("nonce"))&&sd.test(c))break a;c=""}c&&a.setAttribute("nonce",c);a.src=gd(b)},sd=/^[\w+/_-]+[=]{0,2}$/;var ud=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1b)throw Error("Bad port number "+b);a.vc=b}else a.vc=null};yd.prototype.getPath=function(){return this.Zb};yd.prototype.setPath=function(a,b){Ad(this);this.Zb=b?Dd(a,!0):a;return this};var Cd=function(a,b,c){Ad(a);b instanceof Ed?(a.Ba=b,a.Ba.lg(a.za)):(c||(b=Fd(b,Kd)),a.Ba=new Ed(b,a.za))};yd.prototype.getQuery=function(){return this.Ba.toString()}; -yd.prototype.removeParameter=function(a){Ad(this);this.Ba.remove(a);return this};var Ad=function(a){if(a.il)throw Error("Tried to modify a read-only Uri");};yd.prototype.lg=function(a){this.za=a;this.Ba&&this.Ba.lg(a)}; +yd.prototype.removeParameter=function(a){Ad(this);this.Ba.remove(a);return this};var Ad=function(a){if(a.hl)throw Error("Tried to modify a read-only Uri");};yd.prototype.lg=function(a){this.za=a;this.Ba&&this.Ba.lg(a)}; var Ld=function(a){return a instanceof yd?a.clone():new yd(a)},Dd=function(a,b){return a?b?decodeURI(a.replace(/%25/g,"%2525")):decodeURIComponent(a):""},Fd=function(a,b,c){return"string"===typeof a?(a=encodeURI(a).replace(b,Md),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null},Md=function(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)},Gd=/[#\/\?@]/g,Id=/[#\?:]/g,Hd=/[#\?]/g,Kd=/[#\?@]/g,Jd=/#/g,Ed=function(a,b){this.Y=this.N=null;this.ta=a||null;this.za=!!b},Nd= function(a){a.N||(a.N=new Map,a.Y=0,a.ta&&xd(a.ta,function(b,c){a.add(decodeURIComponent(b.replace(/\+/g," ")),c)}))};h=Ed.prototype;h.R=function(){Nd(this);return this.Y};h.add=function(a,b){Nd(this);this.ta=null;a=Od(this,a);var c=this.N.get(a);c||this.N.set(a,c=[]);c.push(b);this.Y=Oa(this.Y)+1;return this};h.remove=function(a){Nd(this);a=Od(this,a);return this.N.has(a)?(this.ta=null,this.Y=Oa(this.Y)-this.N.get(a).length,this.N.delete(a)):!1};h.clear=function(){this.N=this.ta=null;this.Y=0}; h.isEmpty=function(){Nd(this);return 0==this.Y};h.Pb=function(a){Nd(this);a=Od(this,a);return this.N.has(a)};h.Ic=function(a){var b=this.aa();return $a(b,a)};h.forEach=function(a,b){Nd(this);this.N.forEach(function(c,d){c.forEach(function(e){a.call(b,e,d,this)},this)},this)};h.tb=function(){Nd(this);for(var a=Array.from(this.N.values()),b=Array.from(this.N.keys()),c=[],d=0;d=b.Ve&&b.cancel())}this.hi?this.hi.call(this.sh,this):this.og=!0;this.pc||bi(this,new ci(this))}};ai.prototype.gh=function(a,b){this.Ue=!1;di(this,a,b)}; -var di=function(a,b,c){a.pc=!0;a.ia=c;a.Qc=!b;ei(a)},gi=function(a){if(a.pc){if(!a.og)throw new fi(a);a.og=!1}};ai.prototype.callback=function(a){gi(this);hi(a);di(this,!0,a)};var bi=function(a,b){gi(a);hi(b);di(a,!1,b)},hi=function(a){B(!(a instanceof ai),"An execution sequence may not be initiated with a blocking Deferred.")},ii=function(a,b,c,d){B(!a.Ug,"Blocking Deferreds can not be re-used");a.je.push([b,c,d]);a.pc&&ei(a)}; +var ai=function(a,b){this.je=[];this.hi=a;this.sh=b||null;this.Pc=this.pc=!1;this.ia=void 0;this.og=this.Ug=this.Ue=!1;this.te=0;this.X=null;this.Ve=0};x(ai,$h);ai.prototype.cancel=function(a){if(this.pc)this.ia instanceof ai&&this.ia.cancel();else{if(this.X){var b=this.X;delete this.X;a?b.cancel(a):(b.Ve--,0>=b.Ve&&b.cancel())}this.hi?this.hi.call(this.sh,this):this.og=!0;this.pc||bi(this,new ci(this))}};ai.prototype.gh=function(a,b){this.Ue=!1;di(this,a,b)}; +var di=function(a,b,c){a.pc=!0;a.ia=c;a.Pc=!b;ei(a)},gi=function(a){if(a.pc){if(!a.og)throw new fi(a);a.og=!1}};ai.prototype.callback=function(a){gi(this);hi(a);di(this,!0,a)};var bi=function(a,b){gi(a);hi(b);di(a,!1,b)},hi=function(a){B(!(a instanceof ai),"An execution sequence may not be initiated with a blocking Deferred.")},ii=function(a,b,c,d){B(!a.Ug,"Blocking Deferreds can not be re-used");a.je.push([b,c,d]);a.pc&&ei(a)}; ai.prototype.then=function(a,b,c){var d,e,g=new Jh(function(f,l){e=f;d=l});ii(this,e,function(f){f instanceof ci?g.cancel():d(f);return ji},this);return g.then(a,b,c)};ai.prototype.$goog_Thenable=!0; -var ki=function(a){return Xa(a.je,function(b){return"function"===typeof b[1]})},ji={},ei=function(a){if(a.te&&a.pc&&ki(a)){var b=a.te,c=li[b];c&&(r.clearTimeout(c.fa),delete li[b]);a.te=0}a.X&&(a.X.Ve--,delete a.X);b=a.ia;for(var d=c=!1;a.je.length&&!a.Ue;){var e=a.je.shift(),g=e[0],f=e[1];e=e[2];if(g=a.Qc?f:g)try{var l=g.call(e||a.sh,b);l===ji&&(l=void 0);void 0!==l&&(a.Qc=a.Qc&&(l==b||l instanceof Error),a.ia=b=l);if(Gh(b)||"function"===typeof r.Promise&&b instanceof r.Promise)d=!0,a.Ue=!0}catch(m){b= -m,a.Qc=!0,ki(a)||(c=!0)}}a.ia=b;d&&(l=u(a.gh,a,!0),d=u(a.gh,a,!1),b instanceof ai?(ii(b,l,d),b.Ug=!0):b.then(l,d));c&&(b=new mi(b),li[b.fa]=b,a.te=b.fa)},fi=function(){Ia.call(this)};x(fi,Ia);fi.prototype.message="Deferred has already fired";fi.prototype.name="AlreadyCalledError";var ci=function(){Ia.call(this)};x(ci,Ia);ci.prototype.message="Deferred was canceled";ci.prototype.name="CanceledError";var mi=function(a){this.fa=r.setTimeout(u(this.Fl,this),0);this.Jd=a}; -mi.prototype.Fl=function(){B(li[this.fa],"Cannot throw an error that is not scheduled.");delete li[this.fa];throw this.Jd;};var li={};var ri=function(a){var b={},c=b.document||document,d=gd(a).toString(),e=(new qh(c)).createElement("SCRIPT"),g={Di:e,od:void 0},f=new ai(ni,g),l=null,m=null!=b.timeout?b.timeout:5E3;0=e.value}if(d){b=b||yi;d=Li(Mi(),a.yf());"function"===typeof c&&(c=c());Ei||(Ei=new Di);e=Ei;a=a.yf();if(0=e.value}if(d){b=b||yi;d=Li(Mi(),a.yf());"function"===typeof c&&(c=c());Ei||(Ei=new Di);e=Ei;a=a.yf();if(0\r\n\r\n"+m+"\r\n"}).join("")+"--batch_EARTHENGINE_batch--\r\n",g=function(f){var l={};a.forEach(function(m){var p=n(m);m=p.next().value;p=n(p.next().value);p.next();p=p.next().value;null!=f[m]&&(l[m]= Wc(p,f[m]))});return b?b(l):l};return this.callback?(Hj(d,null,function(f,l){return c.callback(l?f:g(f),l)},"multipart/mixed; boundary=batch_EARTHENGINE_batch",e,void 0,this.Rb),null):g(Hj(d,null,void 0,"multipart/mixed; boundary=batch_EARTHENGINE_batch",e,void 0,this.Rb))};var Ij=function(){};q(Ij,gh); Ij.prototype.send=function(a,b){var c=[a.B+" "+a.path+" HTTP/1.1"];c.push("Content-Type: application/json; charset=utf-8");var d=Kj();null!=d&&c.push("Authorization: "+d);a=a.body?JSON.stringify(a.body):"";return[c.join("\r\n")+"\r\n\r\n"+a,b]}; var Lj=function(a,b,c){a=n(b.split("--"+a.split("; boundary=")[1]));for(b=a.next();!b.done;b=a.next())if(b=b.value.split("\r\n\r\n"),!(3>b.length)){var d=b[0].match(/\r\nContent-ID: ]*)>/)[1],e=Number(b[1].match(/^HTTP\S*\s(\d+)\s/)[1]);c(d,e,b.slice(2).join("\r\n\r\n"))}},Fj=function(){var a=Mj.replace(/\/api$/,"");return"window"in r&&!a.match(/^https?:\/\/content-/)?a.replace(/^(https?:\/\/)(.*\.googleapis\.com)$/,"$1content-$2"):a},Oj=function(a,b,c){var d=[];a&&(d=d.concat(Nj)); b&&d.push("https://www.googleapis.com/auth/devstorage.read_write");a=d=d.concat(c);c=b=0;for(var e={};cg)break;z++}return jk(C.status,function(Q){try{return C.getResponseHeader(Q)}catch(oa){return null}},C.responseText,l,void 0,e,d,f)},hk=function(a,b,c,d,e,g,f){var l=0,m={url:a,method:c,content:d,headers:e},p=bk,v=null!=g?g:10; m.callback=function(z){z=z.target;if(429==z.getStatus()&&lS||300<=S)return"Server returned HTTP code: "+S+" for "+f+" "+g},z,C;b=b("Content-Type")||"application/json";d=b.replace(/;.*/,"");if("application/json"===d||"text/json"===d)c=p(c),c.parsed? C=c.parsed:z=c;else if("multipart/mixed"===d){C={};var Q=[];Lj(b,c,function(S,Aa,Kb){Kb=p(Kb);Kb.parsed&&(C[S]=Kb.parsed);(Aa=(Kb.parsed?"":Kb)||v(Aa))&&Q.push(S+": "+Aa)});Q.length&&(z=Q.join("\n"))}else var oa="Response was unexpectedly not JSON, but "+d;z=z||v(a)||oa;if(e)return e(C,z),null;if(!z)return C;throw Error(z);},Sj=function(a){var b=function(){r.gapi.config.update("client/cors",!0);Pj||(Pj=r.gapi.auth2.authorize);a()};if(t(r.gapi)&&t(r.gapi.auth2)&&"function"===typeof r.gapi.auth2.authorize)b(); -else{for(var c=Date.now().toString(36);c in r;)c+="_";r[c]=function(){delete r[c];b()};ri(yj(zj,c))}},Tj=function(a,b,c){if(c.access_token){b=c.token_type+" "+c.access_token;if(c.expires_in||0===c.expires_in){c=900*c.expires_in;var d=setTimeout(Uj,.9*c);void 0!==d.unref&&d.unref();Vj=Date.now()+c}Xj=b;a&&a()}else b&&b(c.error||"Unknown error.")},Gj=function(a){var b=new Ed;a=n(Object.entries(a));for(var c=a.next();!c.done;c=a.next()){var d=n(c.value);c=d.next().value;d=d.next().value;b.set(c,d)}return b}, -gk=[],ik=new Yh(function(){var a=gk.shift();if(a){var b=a.url,c=a.callback,d=a.method,e=a.content;a=a.headers;var g=kk,f=new Xi;$i.push(f);c&&f.Xa("complete",c);f.Xc("ready",f.Wk);g&&(f.zc=Math.max(0,g));f.send(b,d,e,a)}0==gk.length||ik.sf()},350),Mj=null,Zj=null,ak=null,fk=null,ek=qc,Xj=null,Vj=null,Qj=null,Rj=[],Pj=null,Nj=["https://www.googleapis.com/auth/earthengine","https://www.googleapis.com/auth/cloud-platform"],dk=null,Yj=!1,kk=0,bk=null;w("ee.api.ListAssetsResponse",pg); +else{for(var c=Date.now().toString(36);c in r;)c+="_";r[c]=function(){delete r[c];b()};ri(yj(Aj,c))}},Tj=function(a,b,c){if(c.access_token){b=c.token_type+" "+c.access_token;if(c.expires_in||0===c.expires_in){c=900*c.expires_in;var d=setTimeout(Uj,.9*c);void 0!==d.unref&&d.unref();Vj=Date.now()+c}Xj=b;a&&a()}else b&&b(c.error||"Unknown error.")},Gj=function(a){var b=new Ed;a=n(Object.entries(a));for(var c=a.next();!c.done;c=a.next()){var d=n(c.value);c=d.next().value;d=d.next().value;b.set(c,d)}return b}, +gk=[],ik=new Yh(function(){var a=gk.shift();if(a){var b=a.url,c=a.callback,d=a.method,e=a.content;a=a.headers;var g=kk,f=new Xi;$i.push(f);c&&f.Xa("complete",c);f.Vc("ready",f.Vk);g&&(f.zc=Math.max(0,g));f.send(b,d,e,a)}0==gk.length||ik.sf()},350),Mj=null,Zj=null,ak=null,fk=null,ek=qc,Xj=null,Vj=null,Qj=null,Rj=[],Pj=null,Nj=["https://www.googleapis.com/auth/earthengine","https://www.googleapis.com/auth/cloud-platform"],dk=null,Yj=!1,kk=0,bk=null;w("ee.api.ListAssetsResponse",pg); w("ee.api.EarthEngineAsset",lf);w("ee.api.Operation",sg);w("ee.api.ListFeaturesResponse",qg);w("ee.api.FeatureViewLocation",of);var lk=function(){};lk.prototype.Ih=function(){return null};var mk=function(){};w("ee.Encodable.SourceFrame",mk); var nk=function(a){if(void 0===a||null===a)a=Rc;return new Le({hb:a})},ok=function(a){return new Le({Oa:a})},pk=function(a){return new Le({Fa:new Ke({values:a})})},qk=function(a){return new Le({Ga:new hf({values:a})})},rk=function(a,b){return new Le({ya:new Wf({functionName:a,arguments:b})})},sk=function(a,b){return new Le({ya:new Wf({Va:a,arguments:b})})},tk=function(a,b){return new Le({Ua:new Vf({lc:a,body:b})})},uk=function(a){if(!a)return"AUTO_JPEG_PNG";a=a.toUpperCase();switch(a){case "JPG":return"JPEG"; case "AUTO":return"AUTO_JPEG_PNG";case "TIF":case "TIFF":case "GEOTIF":case "GEOTIFF":return"GEO_TIFF";case "TF_RECORD":case "TFRECORD":return"TF_RECORD_IMAGE";case "NUMPY":return"NPY";case "ZIPPED_TIF":case "ZIPPED_TIFF":case "ZIPPED_GEOTIF":case "ZIPPED_GEOTIFF":return"ZIPPED_GEO_TIFF";case "ZIPPED_TIF_PER_BAND":case "ZIPPED_TIFF_PER_BAND":case "ZIPPED_GEOTIF_PER_BAND":case "ZIPPED_GEOTIFF_PER_BAND":return"ZIPPED_GEO_TIFF_PER_BAND";default:return a}},vk=function(a){if(!a)return"CSV";a=a.toUpperCase(); -switch(a){case "TF_RECORD":case "TFRECORD":return"TF_RECORD_TABLE";case "JSON":case "GEOJSON":return"GEO_JSON";default:return a}},wk=function(a){if(!a)return"VERTICAL";a=a.toUpperCase();if("HORIZONTAL"!==a&&"VERTICAL"!==a)throw Error('Orientation must be "horizontal" or "vertical"');return a},xk=function(a){if(!a)return[];if("string"===typeof a)return a.split(",");if(Array.isArray(a))return a;throw Error("Invalid band list "+a);},Ak=function(a){var b=new tf,c=!1;"palette"in a&&(c=a.palette,b.bd="string"=== -typeof c?c.split(","):c,c=!0);var d=[];if("gain"in a||"bias"in a){if("min"in a||"max"in a)throw Error("Gain and bias can't be specified with min and max");var e=b.bd?b.bd.length-1:255;d=yk(a,"bias","gain").map(function(g){var f=-g.bias/g.gain;return{min:f,max:e/g.gain+f}})}else if("min"in a||"max"in a)d=yk(a,"min","max");0!==d.length&&(b.ag=d.map(function(g){return new jf(g)}),c=!0);a=zk(a.gamma);if(1= "'+(new Date(a.startTime)).toISOString()+'"'),delete a.startTime);"endTime"in a&&(b.push('endTime < "'+(new Date(a.endTime)).toISOString()+ '"'),delete a.endTime);if("region"in a){var c=a.region;if("object"===typeof c)try{c=JSON.stringify(c)}catch(e){throw Error('Filter parameter "region" must be a GeoJSON or WKT string.');}else if("string"!==typeof c)throw Error('Filter parameter "region" must be a GeoJSON or WKT string.');c=c.replace(/"/g,"'");b.push('intersects("'+c+'")');delete a.region}if("properties"in a){if(!Array.isArray(a.properties)&&a.properties.some(function(e){return"string"!==typeof e}))throw Error('Filter parameter "properties" must be an array of strings'); -c=n(a.properties);for(var d=c.next();!d.done;d=c.next())b.push(d.value.trim().replace(/^(properties\.)?/,"properties."));delete a.properties}return b.join(" AND ")},Nk=function(a){a=Object.assign({},a);var b=$k(a);b&&(a.filter=a.filter?a.filter+" AND "+b:b);return a};var al=function(){this.blockSize=-1};var bl=function(){this.blockSize=-1;this.blockSize=64;this.W=Array(4);this.Tk=Array(this.blockSize);this.se=this.Gc=0;this.reset()};x(bl,al);bl.prototype.reset=function(){this.W[0]=1732584193;this.W[1]=4023233417;this.W[2]=2562383102;this.W[3]=271733878;this.se=this.Gc=0}; +c=n(a.properties);for(var d=c.next();!d.done;d=c.next())b.push(d.value.trim().replace(/^(properties\.)?/,"properties."));delete a.properties}return b.join(" AND ")},Nk=function(a){a=Object.assign({},a);var b=$k(a);b&&(a.filter=a.filter?a.filter+" AND "+b:b);return a};var al=function(){this.blockSize=-1};var bl=function(){this.blockSize=-1;this.blockSize=64;this.W=Array(4);this.Sk=Array(this.blockSize);this.se=this.Gc=0;this.reset()};x(bl,al);bl.prototype.reset=function(){this.W[0]=1732584193;this.W[1]=4023233417;this.W[2]=2562383102;this.W[3]=271733878;this.se=this.Gc=0}; var cl=function(a,b,c){c||(c=0);var d=Array(16);if("string"===typeof 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.W[0];c=a.W[1];e=a.W[2];var g=a.W[3];var f=b+(g^c&(e^g))+d[0]+3614090360&4294967295;b=c+(f<<7&4294967295|f>>>25);f=g+(e^b&(c^e))+d[1]+3905402710&4294967295;g=b+(f<<12&4294967295|f>>>20);f=e+(c^g&(b^c))+d[2]+606105819&4294967295;e=g+(f<<17&4294967295|f>>> 15);f=c+(b^e&(g^b))+d[3]+3250441966&4294967295;c=e+(f<<22&4294967295|f>>>10);f=b+(g^c&(e^g))+d[4]+4118548399&4294967295;b=c+(f<<7&4294967295|f>>>25);f=g+(e^b&(c^e))+d[5]+1200080426&4294967295;g=b+(f<<12&4294967295|f>>>20);f=e+(c^g&(b^c))+d[6]+2821735955&4294967295;e=g+(f<<17&4294967295|f>>>15);f=c+(b^e&(g^b))+d[7]+4249261313&4294967295;c=e+(f<<22&4294967295|f>>>10);f=b+(g^c&(e^g))+d[8]+1770035416&4294967295;b=c+(f<<7&4294967295|f>>>25);f=g+(e^b&(c^e))+d[9]+2336552879&4294967295;g=b+(f<<12&4294967295| f>>>20);f=e+(c^g&(b^c))+d[10]+4294925233&4294967295;e=g+(f<<17&4294967295|f>>>15);f=c+(b^e&(g^b))+d[11]+2304563134&4294967295;c=e+(f<<22&4294967295|f>>>10);f=b+(g^c&(e^g))+d[12]+1804603682&4294967295;b=c+(f<<7&4294967295|f>>>25);f=g+(e^b&(c^e))+d[13]+4254626195&4294967295;g=b+(f<<12&4294967295|f>>>20);f=e+(c^g&(b^c))+d[14]+2792965006&4294967295;e=g+(f<<17&4294967295|f>>>15);f=c+(b^e&(g^b))+d[15]+1236535329&4294967295;c=e+(f<<22&4294967295|f>>>10);f=b+(e^g&(c^e))+d[1]+4129170786&4294967295;b=c+(f<< @@ -491,25 +491,25 @@ f>>>21);f=e+(g^b^c)+d[7]+4139469664&4294967295;e=g+(f<<16&4294967295|f>>>16);f=c 3873151461&4294967295;g=b+(f<<11&4294967295|f>>>21);f=e+(g^b^c)+d[15]+530742520&4294967295;e=g+(f<<16&4294967295|f>>>16);f=c+(e^g^b)+d[2]+3299628645&4294967295;c=e+(f<<23&4294967295|f>>>9);f=b+(e^(c|~g))+d[0]+4096336452&4294967295;b=c+(f<<6&4294967295|f>>>26);f=g+(c^(b|~e))+d[7]+1126891415&4294967295;g=b+(f<<10&4294967295|f>>>22);f=e+(b^(g|~c))+d[14]+2878612391&4294967295;e=g+(f<<15&4294967295|f>>>17);f=c+(g^(e|~b))+d[5]+4237533241&4294967295;c=e+(f<<21&4294967295|f>>>11);f=b+(e^(c|~g))+d[12]+1700485571& 4294967295;b=c+(f<<6&4294967295|f>>>26);f=g+(c^(b|~e))+d[3]+2399980690&4294967295;g=b+(f<<10&4294967295|f>>>22);f=e+(b^(g|~c))+d[10]+4293915773&4294967295;e=g+(f<<15&4294967295|f>>>17);f=c+(g^(e|~b))+d[1]+2240044497&4294967295;c=e+(f<<21&4294967295|f>>>11);f=b+(e^(c|~g))+d[8]+1873313359&4294967295;b=c+(f<<6&4294967295|f>>>26);f=g+(c^(b|~e))+d[15]+4264355552&4294967295;g=b+(f<<10&4294967295|f>>>22);f=e+(b^(g|~c))+d[6]+2734768916&4294967295;e=g+(f<<15&4294967295|f>>>17);f=c+(g^(e|~b))+d[13]+1309151649& 4294967295;c=e+(f<<21&4294967295|f>>>11);f=b+(e^(c|~g))+d[4]+4149444226&4294967295;b=c+(f<<6&4294967295|f>>>26);f=g+(c^(b|~e))+d[11]+3174756917&4294967295;g=b+(f<<10&4294967295|f>>>22);f=e+(b^(g|~c))+d[2]+718787259&4294967295;e=g+(f<<15&4294967295|f>>>17);f=c+(g^(e|~b))+d[9]+3951481745&4294967295;a.W[0]=a.W[0]+b&4294967295;a.W[1]=a.W[1]+(e+(f<<21&4294967295|f>>>11))&4294967295;a.W[2]=a.W[2]+e&4294967295;a.W[3]=a.W[3]+g&4294967295}; -bl.prototype.update=function(a,b){void 0===b&&(b=a.length);for(var c=b-this.blockSize,d=this.Tk,e=this.Gc,g=0;gthis.Gc?this.blockSize:2*this.blockSize)-this.Gc);a[0]=128;for(var b=1;bb;++b)for(var d=0;32>d;d+=8)a[c++]=this.W[b]>>>d&255;return a};var dl=function(a){this.td="__ee_hash__";this.Vd=!1!==a;this.Ya=[];this.wa={};this.Hg=[];this.Rd=new WeakMap;this.rg=new WeakMap;this.Wi=void 0};w("ee.Serializer",dl);var el=new si,fl=new bl,hl=function(a,b){return gl(new dl(void 0!==b?b:!0),a)};w("ee.Serializer.encode",hl);var il=function(a){return el.va(hl(a))};w("ee.Serializer.toJSON",il);var kl=function(a){return jl(hl(a,!1))};w("ee.Serializer.toReadableJSON",kl); -var jl=function(a){return"JSON"in r?r.JSON.stringify(a,null," "):el.va(a)},gl=function(a,b){b=a.Id(b);a.Vd&&(b=t(b)&&"ValueRef"==b.type&&1==a.Ya.length?a.Ya[0][1]:{type:"CompoundValue",scope:a.Ya,value:b},a.Ya=[],Ua(a.Hg,u(function(c){delete c[this.td]},a)),a.Hg=[],a.wa={});return b}; -dl.prototype.Id=function(a){if(void 0===a)throw Error("Can't encode an undefined value.");var b=t(a)?a[this.td]:null;if(this.Vd&&null!=b&&this.wa[b])return{type:"ValueRef",value:this.wa[b]};if(null===a||"boolean"===typeof a||"number"===typeof a||"string"===typeof a)return a;if(ya(a))return{type:"Invocation",functionName:"Date",arguments:{value:Math.floor(a.getTime())}};if(a instanceof lk){var c=a.encode(u(this.Id,this));if(!(Array.isArray(c)||t(c)&&"ArgumentRef"!=c.type))return c}else if(Array.isArray(a))c= -Wa(a,function(e){return this.Id(e)},this);else if(t(a)&&"function"!==typeof a)c=Hb(a,function(e){if("function"!==typeof e)return this.Id(e)},this),Qb(c,this.td),c={type:"Dictionary",value:c};else throw Error("Can't encode object: "+a);if(this.Vd){b=ll(c);if(this.wa[b])var d=this.wa[b];else d=String(this.Ya.length),this.Ya.push([d,c]),this.wa[b]=d;a[this.td]=b;this.Hg.push(a);return{type:"ValueRef",value:d}}return c}; +bl.prototype.update=function(a,b){void 0===b&&(b=a.length);for(var c=b-this.blockSize,d=this.Sk,e=this.Gc,g=0;gthis.Gc?this.blockSize:2*this.blockSize)-this.Gc);a[0]=128;for(var b=1;bb;++b)for(var d=0;32>d;d+=8)a[c++]=this.W[b]>>>d&255;return a};var dl=function(a){this.qd="__ee_hash__";this.Ud=!1!==a;this.Ya=[];this.wa={};this.Hg=[];this.Pd=new WeakMap;this.rg=new WeakMap;this.Vi=void 0};w("ee.Serializer",dl);var el=new si,fl=new bl,hl=function(a,b){return gl(new dl(void 0!==b?b:!0),a)};w("ee.Serializer.encode",hl);var il=function(a){return el.va(hl(a))};w("ee.Serializer.toJSON",il);var kl=function(a){return jl(hl(a,!1))};w("ee.Serializer.toReadableJSON",kl); +var jl=function(a){return"JSON"in r?r.JSON.stringify(a,null," "):el.va(a)},gl=function(a,b){b=a.Fd(b);a.Ud&&(b=t(b)&&"ValueRef"==b.type&&1==a.Ya.length?a.Ya[0][1]:{type:"CompoundValue",scope:a.Ya,value:b},a.Ya=[],Ua(a.Hg,u(function(c){delete c[this.qd]},a)),a.Hg=[],a.wa={});return b}; +dl.prototype.Fd=function(a){if(void 0===a)throw Error("Can't encode an undefined value.");var b=t(a)?a[this.qd]:null;if(this.Ud&&null!=b&&this.wa[b])return{type:"ValueRef",value:this.wa[b]};if(null===a||"boolean"===typeof a||"number"===typeof a||"string"===typeof a)return a;if(ya(a))return{type:"Invocation",functionName:"Date",arguments:{value:Math.floor(a.getTime())}};if(a instanceof lk){var c=a.encode(u(this.Fd,this));if(!(Array.isArray(c)||t(c)&&"ArgumentRef"!=c.type))return c}else if(Array.isArray(a))c= +Wa(a,function(e){return this.Fd(e)},this);else if(t(a)&&"function"!==typeof a)c=Hb(a,function(e){if("function"!==typeof e)return this.Fd(e)},this),Qb(c,this.qd),c={type:"Dictionary",value:c};else throw Error("Can't encode object: "+a);if(this.Ud){b=ll(c);if(this.wa[b])var d=this.wa[b];else d=String(this.Ya.length),this.Ya.push([d,c]),this.wa[b]=d;a[this.qd]=b;this.Hg.push(a);return{type:"ValueRef",value:d}}return c}; var ll=function(a){fl.reset();fl.update(el.va(a));return fl.digest().toString()},nl=function(a){return Xc(ml(a),Tc,Uc,Vc)};w("ee.Serializer.encodeCloudApi",nl); -var ml=function(a,b){return ol(new dl(!0),a,b)},ol=function(a,b,c){a.Wi=c;return pl(a,b)},ql=function(a,b){var c={};b=b.values;for(var d in b){var e=a.rg.get(b[d]);c[d]=Object.assign({},e)}return c},rl=function(a){a=pl(new dl(!1),a);var b=a.values,c=function(d){if(!t(d))return d;var e=Array.isArray(d)?[]:{},g=d instanceof Object.getPrototypeOf(Le);d=n(Object.entries(g?d.h:d));for(var f=d.next();!f.done;f=d.next()){var l=n(f.value);f=l.next().value;l=l.next().value;g?null!==l&&(e[f]="functionDefinitionValue"=== +var ml=function(a,b){return ol(new dl(!0),a,b)},ol=function(a,b,c){a.Vi=c;return pl(a,b)},ql=function(a,b){var c={};b=b.values;for(var d in b){var e=a.rg.get(b[d]);c[d]=Object.assign({},e)}return c},rl=function(a){a=pl(new dl(!1),a);var b=a.values,c=function(d){if(!t(d))return d;var e=Array.isArray(d)?[]:{},g=d instanceof Object.getPrototypeOf(Le);d=n(Object.entries(g?d.h:d));for(var f=d.next();!f.done;f=d.next()){var l=n(f.value);f=l.next().value;l=l.next().value;g?null!==l&&(e[f]="functionDefinitionValue"=== f&&null!=l.body?{argumentNames:l.lc,body:c(b[l.body])}:"functionInvocationValue"===f&&null!=l.Va?{arguments:Hb(l.arguments,c),functionReference:c(b[l.Va])}:"constantValue"===f?l===Rc?null:l:c(l)):e[f]=c(l)}return e};return a.result&&c(b[a.result])};w("ee.Serializer.encodeCloudApiPretty",rl);var sl=function(a){return el.va(nl(a))};w("ee.Serializer.toCloudApiJSON",sl);var tl=function(a){return jl(rl(a))};w("ee.Serializer.toReadableCloudApiJSON",tl); -var pl=function(a,b){try{var c=ul(a,b),d=new vl(c,a.Ya,a.Vd,a.rg),e=wl(d,d.Ci);return new af({result:e,values:d.mi})}finally{a.Rd=new WeakMap,a.wa={},a.Ya=[]}},ul=function(a,b){var c=function(f){var l=ll(f);t(b)&&a.Rd.set(b,l);if(a.wa[l])return a.wa[l];var m=String(a.Ya.length);a.Ya.push([m,f]);return a.wa[l]=m};if(t(b)&&a.wa[a.Rd.get(b)])return a.wa[a.Rd.get(b)];if(null===b||"boolean"===typeof b||"string"===typeof b||"number"===typeof b)return c(nk(b));if(ya(b))return c(rk("Date",{value:nk(Math.floor(b.getTime()))})); -if(b instanceof lk){var d=b.na(a),e=b.Ih();null!==e&&a.rg.set(d,e);return c(d)}if(Array.isArray(b))return c(pk(b.map(function(f){return ok(ul(a,f))})));if(t(b)&&"function"!==typeof b){var g={};Object.keys(b).sort().forEach(function(f){g[f]=ok(ul(a,b[f]))});return c(qk(g))}throw Error("Can't encode object: "+b);},vl=function(a,b,c,d){var e=this;this.Ci=a;this.values={};b.forEach(function(g){return e.values[g[0]]=g[1]});this.wi=c?xl(this):null;this.mi={};this.dg={};this.ql=0;this.ld=d},wl=function(a, -b){if(b in a.dg)return a.dg[b];var c=String(a.ql++);a.dg[b]=c;a.mi[c]=yl(a,a.values[b],0);return c},yl=function(a,b,c){var d=function(z){return null!==z.hb},e=function(z){return z===Rc?null:z},g=function(z,C){a.ld&&a.ld.has(z)&&!a.ld.has(C)&&a.ld.set(C,a.ld.get(z));return C};if(d(b)||null!=b.Wa||null!=b.qb||null!=b.Mb)return b;if(null!=b.Oa){d=a.values[b.Oa];if(null===a.wi||50>c&&1===a.wi[b.Oa])return d=yl(a,d,c),g(b,d);if(zl(d))return g(b,d);d=ok(wl(a,b.Oa));return g(b,d)}if(null!=b.Fa){var f=b.Fa.values.map(function(z){return yl(a, +var pl=function(a,b){try{var c=ul(a,b),d=new vl(c,a.Ya,a.Ud,a.rg),e=wl(d,d.Bi);return new af({result:e,values:d.mi})}finally{a.Pd=new WeakMap,a.wa={},a.Ya=[]}},ul=function(a,b){var c=function(f){var l=ll(f);t(b)&&a.Pd.set(b,l);if(a.wa[l])return a.wa[l];var m=String(a.Ya.length);a.Ya.push([m,f]);return a.wa[l]=m};if(t(b)&&a.wa[a.Pd.get(b)])return a.wa[a.Pd.get(b)];if(null===b||"boolean"===typeof b||"string"===typeof b||"number"===typeof b)return c(nk(b));if(ya(b))return c(rk("Date",{value:nk(Math.floor(b.getTime()))})); +if(b instanceof lk){var d=b.na(a),e=b.Ih();null!==e&&a.rg.set(d,e);return c(d)}if(Array.isArray(b))return c(pk(b.map(function(f){return ok(ul(a,f))})));if(t(b)&&"function"!==typeof b){var g={};Object.keys(b).sort().forEach(function(f){g[f]=ok(ul(a,b[f]))});return c(qk(g))}throw Error("Can't encode object: "+b);},vl=function(a,b,c,d){var e=this;this.Bi=a;this.values={};b.forEach(function(g){return e.values[g[0]]=g[1]});this.vi=c?xl(this):null;this.mi={};this.dg={};this.pl=0;this.hd=d},wl=function(a, +b){if(b in a.dg)return a.dg[b];var c=String(a.pl++);a.dg[b]=c;a.mi[c]=yl(a,a.values[b],0);return c},yl=function(a,b,c){var d=function(z){return null!==z.hb},e=function(z){return z===Rc?null:z},g=function(z,C){a.hd&&a.hd.has(z)&&!a.hd.has(C)&&a.hd.set(C,a.hd.get(z));return C};if(d(b)||null!=b.Wa||null!=b.qb||null!=b.Mb)return b;if(null!=b.Oa){d=a.values[b.Oa];if(null===a.vi||50>c&&1===a.vi[b.Oa])return d=yl(a,d,c),g(b,d);if(zl(d))return g(b,d);d=ok(wl(a,b.Oa));return g(b,d)}if(null!=b.Fa){var f=b.Fa.values.map(function(z){return yl(a, z,c+3)});d=f.every(d)?nk(f.map(function(z){return e(z.hb)})):pk(f);return g(b,d)}if(null!=b.Ga){f={};for(var l={},m=n(Object.entries(b.Ga.values||{})),p=m.next();!p.done;p=m.next()){var v=n(p.value);p=v.next().value;v=v.next().value;f[p]=yl(a,v,c+3);null!==l&&d(f[p])?l[p]=e(f[p].hb):l=null}return null!==l?g(b,nk(l)):g(f,qk(f))}if(null!=b.Ua)return d=b.Ua,d=tk(d.lc||[],wl(a,d.body||"")),g(b,d);if(null!=b.ya){d=b.ya;f={};l=n(Object.keys(d.arguments||{}));for(m=l.next();!m.done;m=l.next())m=m.value, f[m]=yl(a,d.arguments[m],c+3);d=d.functionName?rk(d.functionName,f):sk(wl(a,d.Va||""),f);return g(b,d)}throw Error("Can't optimize value: "+b);},zl=function(a){var b=a.hb;return null!==b?b===Rc||"number"===typeof b||"boolean"===typeof b:null!=a.Mb},xl=function(a){var b={},c=function(e){b[e]?b[e]++:(b[e]=1,d(a.values[e]))},d=function(e){null!=e.Fa?e.Fa.values.forEach(d):null!=e.Ga?Object.values(e.Ga.values).forEach(d):null!=e.Ua?c(e.Ua.body):null!=e.ya?(e=e.ya,null!=e.Va&&c(e.Va),Object.values(e.arguments).forEach(d)): -null!=e.Oa&&c(e.Oa)};c(a.Ci);return b};var Fl=function(a){if(null==a.element)throw Error('"element" not found in params '+a);var b=a.selectors||null;null!=b&&"string"===typeof b&&(b=b.split(","));b=new Cf({l:ml(a.element),description:K(a.description),oa:null,sa:null,Ld:null,zd:null,selectors:b,Vb:L(a.maxErrorMeters),requestId:K(a.id),maxVertices:L(a.maxVertices),O:L(a.maxWorkers)});var c=Al(a);switch(c){case "GOOGLE_CLOUD_STORAGE":case "DRIVE":var d=new Ff({ja:null,ma:null,F:vk(a.fileFormat)});"GOOGLE_CLOUD_STORAGE"===c?d.ja=Bl(a):d.ma= -Cl(a);b.oa=d;break;case "ASSET":b.sa=new Df({Ha:Dl(a)});break;case "FEATURE_VIEW":c=new Nf({name:Gk(a.mapName)});d=null==a?null:new Sf({Qf:L(a.maxFeaturesPerTile),xg:a.thinningStrategy});var e=null==a?null:new Rf({Ig:El(a.zOrderRanking),wg:El(a.thinningRanking)});d=new Of({vg:d,cg:e});c=new Ef({pf:c,rc:d});b.Ld=c;break;case "BIGQUERY":b.zd=new Qe({Te:new Pe({table:K(a.table),overwrite:!!a.overwrite,append:!!a.append})});break;default:throw Error('Export destination "'+c+'" unknown');}a.workloadTag&& +null!=e.Oa&&c(e.Oa)};c(a.Bi);return b};var Fl=function(a){if(null==a.element)throw Error('"element" not found in params '+a);var b=a.selectors||null;null!=b&&"string"===typeof b&&(b=b.split(","));b=new Cf({l:ml(a.element),description:K(a.description),oa:null,sa:null,Id:null,wd:null,selectors:b,Vb:L(a.maxErrorMeters),requestId:K(a.id),maxVertices:L(a.maxVertices),O:L(a.maxWorkers)});var c=Al(a);switch(c){case "GOOGLE_CLOUD_STORAGE":case "DRIVE":var d=new Ff({ja:null,ma:null,F:vk(a.fileFormat)});"GOOGLE_CLOUD_STORAGE"===c?d.ja=Bl(a):d.ma= +Cl(a);b.oa=d;break;case "ASSET":b.sa=new Df({Ha:Dl(a)});break;case "FEATURE_VIEW":c=new Nf({name:Gk(a.mapName)});d=null==a?null:new Sf({Qf:L(a.maxFeaturesPerTile),xg:a.thinningStrategy});var e=null==a?null:new Rf({Ig:El(a.zOrderRanking),wg:El(a.thinningRanking)});d=new Of({vg:d,cg:e});c=new Ef({pf:c,rc:d});b.Id=c;break;case "BIGQUERY":b.wd=new Qe({Te:new Pe({table:K(a.table),overwrite:!!a.overwrite,append:!!a.append})});break;default:throw Error('Export destination "'+c+'" unknown');}a.workloadTag&& (b.workloadTag=a.workloadTag);return b};function K(a){return null!=a?String(a):null}function L(a){return null!=a?Number(a):null} var Al=function(a){var b="DRIVE";if(null==a)return b;null!=a.outputBucket||null!=a.outputPrefix?b="GOOGLE_CLOUD_STORAGE":null!=a.assetId?b="ASSET":null!=a.mapName&&(b="FEATURE_VIEW");null!=a.table&&(b="BIGQUERY");return b},Hl=function(a){var b=new fg({bf:!!a.tfrecordCompressed,Wb:K(a.tfrecordMaxFileSize),kg:!!a.tfrecordSequenceData,Ze:!!a.tfrecordCollapseBands,Rf:L(a.tfrecordMaskedThreshold),defaultValue:L(a.tfrecordDefaultValue),cc:Gl(a.tfrecordPatchDimensions),Nf:Gl(a.tfrecordKernelSize),ne:null}); -a=a.tfrecordTensorDepths;if(null!=a)if(t(a)){var c={};Fb(a,function(d,e){if("string"!==typeof e||"number"!==typeof d)throw Error('"tensorDepths" option must be an object of type Object');c[e]=d});b.ne=c}else throw Error('"tensorDepths" option needs to have the form Object.');return b},Il=function(a,b){var c=new yf({ja:null,ma:null,Md:null,oe:null,F:uk(a.fileFormat)});if("GEO_TIFF"===c.F){if(a.fileDimensions&&a.tiffFileDimensions)throw Error('Export cannot set both "fileDimensions" and "tiffFileDimensions".'); -var d=a.tiffShardSize||a.shardSize;var e=!!a.tiffCloudOptimized;var g=!(!a.skipEmptyTiles&&!a.tiffSkipEmptyFiles),f=Gl(a.fileDimensions||a.tiffFileDimensions);d=L(d);var l=a.tiffNoData;l=null!=l?new Yf({tf:Number(l)}):null;e=new Xf({Ye:e,qg:g,cc:f,tileSize:d,Tf:l});c.Md=e}else"TF_RECORD_IMAGE"===c.F&&(c.oe=Hl(a));"GOOGLE_CLOUD_STORAGE"===b?c.ja=Bl(a):c.ma=Cl(a);return c},Jl=function(a,b){var c=new If({ja:null,ma:null,F:"MP4"});"GOOGLE_CLOUD_STORAGE"===b?c.ja=Bl(a):c.ma=Cl(a);return c},Kl=function(a){var b, +a=a.tfrecordTensorDepths;if(null!=a)if(t(a)){var c={};Fb(a,function(d,e){if("string"!==typeof e||"number"!==typeof d)throw Error('"tensorDepths" option must be an object of type Object');c[e]=d});b.ne=c}else throw Error('"tensorDepths" option needs to have the form Object.');return b},Il=function(a,b){var c=new yf({ja:null,ma:null,Jd:null,oe:null,F:uk(a.fileFormat)});if("GEO_TIFF"===c.F){if(a.fileDimensions&&a.tiffFileDimensions)throw Error('Export cannot set both "fileDimensions" and "tiffFileDimensions".'); +var d=a.tiffShardSize||a.shardSize;var e=!!a.tiffCloudOptimized;var g=!(!a.skipEmptyTiles&&!a.tiffSkipEmptyFiles),f=Gl(a.fileDimensions||a.tiffFileDimensions);d=L(d);var l=a.tiffNoData;l=null!=l?new Yf({tf:Number(l)}):null;e=new Xf({Ye:e,qg:g,cc:f,tileSize:d,Tf:l});c.Jd=e}else"TF_RECORD_IMAGE"===c.F&&(c.oe=Hl(a));"GOOGLE_CLOUD_STORAGE"===b?c.ja=Bl(a):c.ma=Cl(a);return c},Jl=function(a,b){var c=new If({ja:null,ma:null,F:"MP4"});"GOOGLE_CLOUD_STORAGE"===b?c.ja=Bl(a):c.ma=Cl(a);return c},Kl=function(a){var b, c,d,e,g=L(null!=(b=a.endZoom)?b:a.maxZoom);b=L(null!=(c=a.startZoom)?c:a.minZoom);c=L(a.scale);var f=!(null!=(d=a.skipEmpty)?!d:!a.skipEmptyTiles);d=K(a.mapsApiKey);var l=Gl(null!=(e=a.dimensions)?e:a.tileDimensions);e=L(a.stride);var m=L(a.minTimeMachineZoomSubset);a=L(a.maxTimeMachineZoomSubset);a=null==m&&null==a?null:new Lg({start:null!=m?m:0,end:a});return new Bf({kf:g,sg:b,scale:c,pg:f,Mf:d,dimensions:l,stride:e,Jg:a})},Gl=function(a){if(null==a)return null;var b=new Zf({height:0,width:0}); "string"===typeof a&&(-1!==a.indexOf("x")?a=a.split("x").map(Number):-1!==a.indexOf(",")&&(a=a.split(",").map(Number)));if(Array.isArray(a))if(2===a.length)b.height=a[0],b.width=a[1];else if(1===a.length)b.height=a[0],b.width=a[0];else throw Error("Unable to construct grid from dimensions: "+a);else if("number"!==typeof a||isNaN(a))if(t(a)&&null!=a.height&&null!=a.width)b.height=a.height,b.width=a.width;else throw Error("Unable to construct grid from dimensions: "+a);else b.height=a,b.width=a;return b}, Bl=function(a){var b=null;null!=a.writePublicTiles&&(b=a.writePublicTiles?"PUBLIC":"DEFAULT_OBJECT_ACL");return new Ye({We:K(a.outputBucket),xa:K(a.outputPrefix),Xe:a.bucketCorsUris||null,permissions:b})},Cl=function(a){return new kf({vf:K(a.driveFolder),xa:K(a.driveFileNamePrefix)})},Dl=function(a){return new We({name:Gk(a.assetId)})},El=function(a){if(!a)return null;var b=a;"string"===typeof a&&(a=a.split(","));if(Array.isArray(a))return new Gg({bg:(a||[]).map(Ll)});throw Error("Unable to build ranking rule from rules: "+ @@ -533,10 +533,10 @@ if("string"===typeof a.bands)try{a.bands=JSON.parse(a.bands)}catch(e){a.bands=xk JSON.parse(a.crs_transform)}catch(e){}var c=em(a.image,a);a=new Kg({name:null,l:Sl(ml(c)),F:uk(a.format),xa:a.name,da:a.bands&&xk(a.bands.map(function(e){return e.id})),grid:null});c={fields:"name"};var d=Ul();d&&(c.workloadTag=d);b=new J(b);return b.handle((new ah(b.M)).create(Ej(),a,c).then(function(e){return{docid:e.name,token:""}}))};w("ee.data.getDownloadId",fm);var gm=function(a){Cj();return Zj+"/v1/"+a.docid+":getPixels"};w("ee.data.makeDownloadUrl",gm); var hm=function(a,b){b=new J(b);var c=vk(a.format),d=Sl(ml(a.table)),e=null;if(null!=a.selectors)if("string"===typeof a.selectors)e=a.selectors.split(",");else if(Array.isArray(a.selectors)&&a.selectors.every(function(g){return"string"===typeof g}))e=a.selectors;else throw Error("'selectors' parameter must be an array of strings.");a=new Ig({name:null,l:d,F:c,selectors:e,filename:a.filename||null});c={fields:"name"};if(d=Ul())c.workloadTag=d;return b.handle((new $g(b.M)).create(Ej(),a,c).then(function(g){return{docid:g.name|| "",token:""}}))};w("ee.data.getTableDownloadId",hm);var im=function(a){return Zj+"/v1/"+a.docid+":getFeatures"};w("ee.data.makeTableDownloadUrl",im);var jm=function(a,b){var c=function(d){return Math.floor(Math.random()*Math.pow(2,4*d)).toString(16).padStart(d,"0")};a=fb(a||1).map(function(){return[c(8),c(4),"4"+c(3),(8+Math.floor(4*Math.random())).toString(16)+c(3),c(12)].join("-")});return b?b(a):a};w("ee.data.newTaskId",jm); -var km=function(a){return a.name&&a.done&&a.error},mm=function(a,b){var c=lm(a).map(Sk);if(1===c.length)return a=(new J(b)).sd(km),a.handle(a.Na().get(c[0]).then(function(e){return[Tk(e)]}));a=(new Jj(b)).sd(km);var d=a.Na();return a.send(c.map(function(e){return[e,d.get(e)]}),function(e){return c.map(function(g){return Tk(e[g])})})};w("ee.data.getTaskStatus",mm); +var km=function(a){return a.name&&a.done&&a.error},mm=function(a,b){var c=lm(a).map(Sk);if(1===c.length)return a=(new J(b)).pd(km),a.handle(a.Na().get(c[0]).then(function(e){return[Tk(e)]}));a=(new Jj(b)).pd(km);var d=a.Na();return a.send(c.map(function(e){return[e,d.get(e)]}),function(e){return c.map(function(g){return Tk(e[g])})})};w("ee.data.getTaskStatus",mm); var lm=function(a){if("string"===typeof a)return[a];if(Array.isArray(a))return a;throw Error("Invalid value: expected a string or an array of strings.");},om=function(a){return nm(void 0,a)};w("ee.data.getTaskList",om);var nm=function(a,b){return b?(pm(a,function(c,d){return b(c?{tasks:c.map(Tk)}:null,d)}),null):{tasks:pm(a).map(Tk)}};w("ee.data.getTaskListWithLimit",nm); var pm=function(a,b){var c=[],d={pageSize:500},e=function(l){db(c,l.Na||[]);!l.nextPageToken||a&&c.length>=a?b&&b(a?c.slice(0,a):c):(d.pageToken=l.nextPageToken,g.handle(f.list(Ej(),d).then(e)));return null},g=new J(b?function(l,m){return m&&b(l,m)}:void 0),f=g.Na();g.handle(f.list(Ej(),d).then(e));return b?null:a?c.slice(0,a):c};w("ee.data.listOperations",pm); -var qm=function(a,b){a=lm(a).map(Sk);var c=new Te;if(1===a.length)b=new J(b),b.handle(b.Na().cancel(a[0],c));else{b=new Jj(b);var d=b.Na();b.send(a.map(function(e){return[e,d.cancel(e,c)]}))}};w("ee.data.cancelOperation",qm);var rm=function(a,b){var c=lm(a).map(Sk);if(!Array.isArray(a))return a=(new J(b)).sd(km),a.handle(a.Na().get(c[0]));a=(new Jj(b)).sd(km);var d=a.Na();return a.send(c.map(function(e){return[e,d.get(e)]}))};w("ee.data.getOperation",rm); +var qm=function(a,b){a=lm(a).map(Sk);var c=new Te;if(1===a.length)b=new J(b),b.handle(b.Na().cancel(a[0],c));else{b=new Jj(b);var d=b.Na();b.send(a.map(function(e){return[e,d.cancel(e,c)]}))}};w("ee.data.cancelOperation",qm);var rm=function(a,b){var c=lm(a).map(Sk);if(!Array.isArray(a))return a=(new J(b)).pd(km),a.handle(a.Na().get(c[0]));a=(new Jj(b)).pd(km);var d=a.Na();return a.send(c.map(function(e){return[e,d.get(e)]}))};w("ee.data.getOperation",rm); var tm=function(a,b){return sm(a,"CANCEL",b)};w("ee.data.cancelTask",tm);var sm=function(a,b,c){if(!Mb(um,b))throw Error("Invalid action: "+b);a=lm(a);a=a.map(Sk);qm(a,c);return null};w("ee.data.updateTask",sm); var Am=function(a,b,c){b.id=a;var d=b.type;a=null!=b.sourceUrl?{__source_url__:b.sourceUrl}:{};if("workloadTag"in b)b.workloadTag||delete b.workloadTag;else{var e=Ul();e&&(b.workloadTag=e)}var g=new J(c);c=function(f){return g.handle(f.then(Uk))};switch(d){case "EXPORT_IMAGE":return b=vm(b,a),c(g.image().Ka(Ej(),b));case "EXPORT_FEATURES":return b=Fl(b),b.l=Sl(b.l,a),c(g.table().Ka(Ej(),b));case "EXPORT_VIDEO":return b=wm(b,a),c(g.video().Ka(Ej(),b));case "EXPORT_TILES":return b=xm(b,a),c(g.map().Ka(Ej(), b));case "EXPORT_VIDEO_MAP":return b=ym(b),c((new eh(g.M)).Ka(Ej(),b));case "EXPORT_CLASSIFIER":return b=zm(b,a),c((new Sg(g.M)).Ka(Ej(),b));default:throw Error("Unable to start processing for task of type "+d);}};w("ee.data.startProcessing",Am); @@ -546,8 +546,8 @@ O:L(c.maxWorkers)});d.oa=Jl(c,Al(c));d.l=Sl(d.l,b);a.workloadTag&&(d.workloadTag b;if(null==c.element)throw Error('"element" not found in params '+c);b=new Hf({l:ml(c.element),description:K(c.description),Pa:new Jf({framesPerSecond:L(c.framesPerSecond),maxFrames:L(c.maxFrames),maxPixelsPerFrame:null}),ec:Kl(c),dc:Jl(c,"GOOGLE_CLOUD_STORAGE"),requestId:K(c.id),version:K(c.version),O:L(c.maxWorkers)});b.l=Sl(b.l);a.workloadTag&&(b.workloadTag=a.workloadTag);return b},zm=function(a,b){if(null==a.element)throw Error('"element" not found in params '+a);var c=Al(a);if("ASSET"!=c)throw Error('Export destination "'+ c+'" unknown');c=new vf({l:ml(a.element),description:K(a.description),requestId:K(a.id),sa:new Ve({Ha:Dl(a)}),O:L(a.maxWorkers)});c.l=Sl(c.l,b);a.workloadTag&&(c.workloadTag=a.workloadTag);return c},Em=function(a,b,c){b=Yk(b);var d=function(e){return e?Uk(e):null};return d(Dm(a,b,c&&function(e,g){return c(d(e),g)}))};w("ee.data.startIngestion",Em); var Dm=function(a,b,c){b=new lg({Df:b,requestId:a,overwrite:null,description:null});a=new J(c,a?void 0:0);return a.handle(a.image().import(Ej(),b))},Fm=function(a,b,c){b=new mg({ug:b,requestId:a,overwrite:null,description:null});a=new J(c,a?void 0:0);return a.handle(a.table().import(Ej(),b))},Gm=function(a,b,c){b=Zk(b);var d=function(e){return e?Uk(e):null};return d(Fm(a,b,c&&function(e,g){return c(d(e),g)}))};w("ee.data.startTableIngestion",Gm); -var Hm=function(a,b){b=new J(b);a=Gk(a);return b.handle(b.assets().get(a,{prettyPrint:!1}).then(Hk))};w("ee.data.getAsset",Hm);w("ee.data.getInfo",Hm);var Im=function(a,b,c,d){b=void 0===b?{}:b;d=void 0===d?qc:d;var e=Ek.test(a);c=new J(c);var g=e?new Qg(c.M):c.assets();a=e?"projects/"+Fk(a):Gk(a);return c.handle(g.Xd(a,b).then(d))},Jm=function(a,b){return Im(a.id,Ok(a),b,function(c){return null==c?null:Ik(c)})};w("ee.data.getList",Jm);var Km=function(a,b,c){b=void 0===b?{}:b;return Im(a,b,c)}; -w("ee.data.listAssets",Km);var Lm=function(a,b,c){b=void 0===b?{}:b;b=Nk(b);return Im(a,b,c,function(d){if(null==d)return null;var e={};d.assets&&(e.images=d.assets);d.nextPageToken&&(e.nextPageToken=d.nextPageToken);return e})};w("ee.data.listImages",Lm);var Mm=function(a,b){b=new J(b);return b.handle((new Qg(b.M)).Xd(a||Ej()))};w("ee.data.listBuckets",Mm);var Nm=function(a){a=new J(a);return a.handle((new Qg(a.M)).Xd(Ej()).then(Ik))};w("ee.data.getAssetRoots",Nm); +var Hm=function(a,b){b=new J(b);a=Gk(a);return b.handle(b.assets().get(a,{prettyPrint:!1}).then(Hk))};w("ee.data.getAsset",Hm);w("ee.data.getInfo",Hm);var Im=function(a,b,c,d){b=void 0===b?{}:b;d=void 0===d?qc:d;var e=Ek.test(a);c=new J(c);var g=e?new Qg(c.M):c.assets();a=e?"projects/"+Fk(a):Gk(a);return c.handle(g.Wd(a,b).then(d))},Jm=function(a,b){return Im(a.id,Ok(a),b,function(c){return null==c?null:Ik(c)})};w("ee.data.getList",Jm);var Km=function(a,b,c){b=void 0===b?{}:b;return Im(a,b,c)}; +w("ee.data.listAssets",Km);var Lm=function(a,b,c){b=void 0===b?{}:b;b=Nk(b);return Im(a,b,c,function(d){if(null==d)return null;var e={};d.assets&&(e.images=d.assets);d.nextPageToken&&(e.nextPageToken=d.nextPageToken);return e})};w("ee.data.listImages",Lm);var Mm=function(a,b){b=new J(b);return b.handle((new Qg(b.M)).Wd(a||Ej()))};w("ee.data.listBuckets",Mm);var Nm=function(a){a=new J(a);return a.handle((new Qg(a.M)).Wd(Ej()).then(Ik))};w("ee.data.getAssetRoots",Nm); var Om=function(a,b){var c="projects/"+Fk(a);a="projects/earthengine-legacy"===c?a:void 0;var d=new lf({type:"Folder"});b=new J(b);b.handle(b.assets().create(c,d,{assetId:a}).then(Hk))};w("ee.data.createAssetHome",Om); var Pm=function(a,b,c,d,e){if(c)throw Error("Asset overwrite not supported.");if("string"===typeof a)throw Error("Asset cannot be specified as string.");b=a.name||b&&Gk(b);if(!b)throw Error("Either asset name or opt_path must be specified.");c=b.indexOf("/assets/");if(-1===c)throw Error("Asset name must contain /assets/.");a=Object.assign({},a);a.tilestoreEntry&&!a.tilestoreLocation&&(a.tilestoreLocation=a.tilestoreEntry,delete a.tilestoreEntry);a.tilestoreLocation&&(a.tilestoreLocation=new rf(a.tilestoreLocation)); a.gcsLocation&&!a.cloudStorageLocation&&(a.cloudStorageLocation=a.gcsLocation,delete a.gcsLocation);a.cloudStorageLocation&&(a.cloudStorageLocation=new Ze(a.cloudStorageLocation));d&&!a.properties&&(a.properties=Object.assign({},d));d=n(["title","description"]);for(var g=d.next();!g.done;g=d.next())if(g=g.value,a[g]){var f={};a.properties=Object.assign((f[g]=a[g],f),a.properties||{});delete a[g]}a=new lf(a);d=b.slice(0,c);b=b.slice(c+8);a.id=null;a.name=null;a:switch(c=a.type,c){case "ImageCollection":c= @@ -562,14 +562,14 @@ var Zm=function(){this.default=this.tag=""};Zm.prototype.get=function(){return t Zm.prototype.validate=function(a){if(null==a||""===a)return"";a=String(a);if(!/^([a-z0-9]|[a-z0-9][-_a-z0-9]{0,61}[a-z0-9])$/g.test(a))throw Error('Invalid tag, "'+a+'". Tags must be 1-63 characters, beginning and ending with a lowercase alphanumeric character ([a-z0-9]) with dashes (-), underscores (_), and lowercase alphanumerics between.');return a};var Ul=function(){return Nl(Zm).get()};w("ee.data.getWorkloadTag",Ul);var $m=function(a){Nl(Zm).set(a)};w("ee.data.setWorkloadTag",$m); var an=function(a){var b=Nl(Zm);b.default=b.validate(a);Nl(Zm).set(a)};w("ee.data.setDefaultWorkloadTag",an);var bn=function(a){a&&(a=Nl(Zm),a.default=a.validate(""));Nl(Zm).reset()};w("ee.data.resetWorkloadTag",bn);var um={Jl:"CANCEL",Ml:"UPDATE"};var N=function(a,b,c){if(!(this instanceof N))return cn(N,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.I=a;this.args=b;this.U=c||null;this.Bl=null};x(N,lk);w("ee.ComputedObject",N);N.prototype.Ih=function(){return this.Bl};N.prototype.evaluate=function(a){if(!a||"function"!==typeof a)throw Error("evaluate() requires a callback function.");$l(this,a)}; N.prototype.evaluate=N.prototype.evaluate;N.prototype.V=function(a){return $l(this,a)};N.prototype.getInfo=N.prototype.V;N.prototype.encode=function(a){if(null===this.I&&null===this.args)return{type:"ArgumentRef",value:this.U};var b={},c;for(c in this.args)void 0!==this.args[c]&&(b[c]=a(this.args[c]));b={type:"Invocation",arguments:b};a=a(this.I);b["string"===typeof a?"functionName":"function"]=a;return b}; -N.prototype.na=function(a){if(null===this.I&&null===this.args){a=this.U||a.Wi;if(!a)throw Error("A mapped function's arguments cannot be used in client-side operations");return new Le({Mb:a})}var b={},c;for(c in this.args)void 0!==this.args[c]&&(b[c]=ok(ul(a,this.args[c])));return"string"===typeof this.I?rk(String(this.I),b):this.I.Hd(a,b)};N.prototype.va=function(a){return(void 0===a?0:a)?il(this):sl(this)};N.prototype.serialize=N.prototype.va; +N.prototype.na=function(a){if(null===this.I&&null===this.args){a=this.U||a.Vi;if(!a)throw Error("A mapped function's arguments cannot be used in client-side operations");return new Le({Mb:a})}var b={},c;for(c in this.args)void 0!==this.args[c]&&(b[c]=ok(ul(a,this.args[c])));return"string"===typeof this.I?rk(String(this.I),b):this.I.Ed(a,b)};N.prototype.va=function(a){return(void 0===a?0:a)?il(this):sl(this)};N.prototype.serialize=N.prototype.va; N.prototype.toString=function(){return"ee."+this.name()+"("+kl(this)+")"};w("ee.ComputedObject.prototype.toString",N.prototype.toString);N.prototype.name=function(){return"ComputedObject"};N.prototype.Kg=function(a,b){var c=Array.from(arguments);c[0]=this;a.apply(r,c);return this};N.prototype.aside=N.prototype.Kg; var dn=function(a,b){if(b instanceof a.constructor)return b;var c=function(){};c.prototype=a.constructor.prototype;a=new c;a.I=b.I;a.args=b.args;a.U=b.U;return a},cn=function(a,b){function c(){return a.apply(this,b)}c.prototype=a.prototype;return new c};var en={},fn=function(a,b){if(b==a)return!0;switch(a){case "Element":return"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}},gn=function(a){return"number"===typeof a||a instanceof N&&"Number"==a.name()},hn=function(a){return"string"===typeof a||a instanceof N&&"String"==a.name()},jn=function(a){return t(a)&& "function"!==typeof a?(a=Object.getPrototypeOf(a),null!==a&&null===Object.getPrototypeOf(a)):!1},kn=function(a,b,c){c=void 0===c?!1:c;return 1===a.length&&jn(a[0])&&(a=b.args,c&&(a=a.slice(1)),a.length)?!(1===a.length||a[1].optional)||"Dictionary"!==a[0].type:!1};var ln=function(){if(!(this instanceof ln))return new ln};x(ln,lk);w("ee.Function",ln);var mn=qc;ln.prototype.call=function(a){return this.apply(nn(this,Array.prototype.slice.call(arguments,0)))};ln.prototype.call=ln.prototype.call;ln.prototype.apply=function(a){a=new N(this,on(this,a));return mn(a,this.Z().returns)};ln.prototype.apply=ln.prototype.apply; var pn=function(a,b,c){var d=void 0!==b,e=a.Z();if(kn(c,e,d)){if(c=Rb(c[0]),d){d=e.args[0].name;if(d in c)throw Error("Named args for "+e.name+" can't contain keyword "+d);c[d]=b}}else c=nn(a,d?[b].concat(c):c);return a.apply(c)},on=function(a,b){for(var c=a.Z().args,d={},e={},g=0;g/,"");for(var l=0;l/,"");return new O(f,g)}),a&&a())};a?Tl(c):c(Tl())}},yn=function(a,b,c,d){un();var e=d||"";Fb(sn,function(g,f){var l=f.split(".");if(2==l.length&&l[0]==b){l=e+l[1];var m=g.Z();tn[f]=!0;var p=!1;m.args.length&&(f=m.args[0].type,p="Object"!=f&&fn(f,c)); f=p?a.prototype:a;l in f&&!f[l].signature||(f[l]=function(v){return pn(g,p?this:void 0,Array.prototype.slice.call(arguments,0))},f[l].toString=u(g.toString,g,l,p),f[l].signature=m)}})},zn=function(a){var b=function(c){for(var d in c)"function"===typeof c[d]&&c[d].signature&&delete c[d]};b(a);b(a.prototype||{})};var R=function(a,b){var c=An(a),d=Wa(c,function(m){return m.replace(/^opt_/,"")});a=(a=r.EXPORTED_FN_INFO?r.EXPORTED_FN_INFO[a.toString()].name.split(".").pop()+"()":null)?" to function "+a:"";var e={},g=b[0],f=t(g)&&"function"!==typeof g&&!Array.isArray(g)&&"Object"===Object.getPrototypeOf(g).constructor.name;if(1d.length)throw Error("Received too many arguments"+a+". Expected at most "+d.length+" but got "+b.length+".");for(g=0;g"))+"_";for(e=0;e< d.length;e++){var g=d[e],f=c+e;b[g].U=f;a.args[g].name=f}return a};var sp=function(a,b){if(!(this instanceof sp))return cn(sp,arguments);if(a instanceof sp)return a;tp();var c=R(sp,arguments);a=c.date;c=c.tz;var d=new O("Date"),e={},g=null;if(hn(a)){if(e.value=a,c)if(hn(c))e.timeZone=c;else throw Error("Invalid argument specified for ee.Date(..., opt_tz): "+c);}else if(gn(a))e.value=a;else if(ya(a))e.value=Math.floor(a.getTime());else if(a instanceof N)a.I&&"Date"==a.I.Z().returns?(d=a.I,e=a.args,g=a.U):e.value=a;else throw Error("Invalid argument specified for ee.Date(): "+ a);N.call(this,d,e,g)};x(sp,N);w("ee.Date",sp);var up=!1,tp=function(){up||(yn(sp,"Date","Date"),up=!0)};sp.prototype.name=function(){return"Date"};w("ee.Deserializer",function(){});var wp=function(a){return vp(JSON.parse(a))};w("ee.Deserializer.fromJSON",wp);var vp=function(a){if("result"in a&&"values"in a)return xp(a);var b={};if(t(a)&&"CompoundValue"===a.type){for(var c=a.scope,d=0;da.y||a.y>=d)return c.createElement("div");var e=a.x%d;0>e&&(e+=d);d=new google.maps.Point(e,a.y);a=[a.x,a.y,b,this.yb++].join("-");e=this.yg.getUniqueId();a=[a,e].join("-");b=this.jh(d,b,c,a);b.tileSize=this.tileSize;gq(b.la,this.opacity);this.zb.set(a,b);jq(this,b);this.dispatchEvent(new kq(this.Nc()));this.yg.Kf(b,(new Date).getTime()/1E3);return b.la};h.releaseTile=function(a){var b=this.zb.get(a.id);this.zb.remove(a.id);b&&(b.abort(),Ha(b))}; -var jq=function(a,b){a.jb.Xa(b,"status-changed",function(){switch(b.getStatus()){case "loaded":var c=b.ll,d=(new Date).getTime();Yp(this.ke,b.zoom).tileLatencies.push(d-c);this.dispatchEvent(new lq(this.Nc()));break;case "throttled":Yp(this.ke,b.zoom).throttleCount++;this.dispatchEvent(new mq(b.Ca));break;case "failed":Yp(this.ke,b.zoom).errorCount++;this.dispatchEvent(new nq(b.Ca,b.Zk));break;case "aborted":this.dispatchEvent(new oq(this.Nc()))}})}; +var jq=function(a,b){a.jb.Xa(b,"status-changed",function(){switch(b.getStatus()){case "loaded":var c=b.kl,d=(new Date).getTime();Yp(this.ke,b.zoom).tileLatencies.push(d-c);this.dispatchEvent(new lq(this.Nc()));break;case "throttled":Yp(this.ke,b.zoom).throttleCount++;this.dispatchEvent(new mq(b.Ca));break;case "failed":Yp(this.ke,b.zoom).errorCount++;this.dispatchEvent(new nq(b.Ca,b.Yk));break;case "aborted":this.dispatchEvent(new oq(this.Nc()))}})}; hq.prototype.J=function(){D.prototype.J.call(this);this.zb.forEach(Ha);this.zb.clear();this.zb=null;Ha(this.jb);this.yg=this.jb=null};var iq=function(a,b){return Za(a.zb.aa(),function(c){return c.getStatus()==b})};w("ee.layers.AbstractOverlay",hq);hq.prototype.removeTileCallback=hq.prototype.fg;hq.prototype.addTileCallback=hq.prototype.Qe;var lq=function(){A.call(this,"tile-load")};q(lq,A);var kq=function(){A.call(this,"tile-start")};q(kq,A);var mq=function(){A.call(this,"tile-throttle")};q(mq,A); -var nq=function(a,b){A.call(this,"tile-fail");this.errorMessage=b};q(nq,A);var oq=function(){A.call(this,"tile-abort")};q(oq,A);var pq=function(a,b,c,d){D.call(this);this.rb=a;this.zoom=b;this.la=c.createElement("div");this.la.id=d;this.ol=5;this.ge=function(){};this.me="new";this.Bi=0;this.Hf=!1};q(pq,D);pq.prototype.getDiv=function(){return this.la}; -var rq=function(a){if(!a.Hf&&"loading"==a.getStatus())throw Error("startLoad() can only be invoked once. Use retryLoad() after the first attempt.");qq(a,"loading");a.ll=(new Date).getTime();a.Za=new Xi;a.Za.xc="blob";a.Za.Xa("complete",function(){var b=hj(a.Za),c=a.Za.getStatus();429==c&&qq(a,"throttled");if(Qi(c)){var d={};Fb(ij(a.Za),function(g,f){d[f.toLowerCase()]=g});a.Cl=d;a.Ii=b;a.Lc()}else if(b){var e=new fq;e.Xa("loadend",function(){a.kd(e.ca.result)});e.readAsText(b)}else a.kd("Failed to load tile.")}, -!1);a.Za.Xc("ready",Fa(Ha,a.Za));a.Ca&&a.Ca.endsWith("&profiling=1")&&(a.Ca=a.Ca.replace("&profiling=1",""),a.Za.headers.set("X-Earth-Engine-Computation-Profiling","1"));a.Za.send(a.Ca,"GET")};h=pq.prototype;h.Lc=function(){this.ge(this);qq(this,"loaded")};h.Hc=function(){Ha(this.Za)}; -h.kd=function(a){var b=function(c){try{if(c=JSON.parse(c),c.error&&c.error.message)return c.error.message}catch(d){}return c};this.Bi>=this.ol?(this.Zk=b(a),qq(this,"failed")):(this.Hc(),setTimeout(u(function(){this.Sa||(this.Hf=!0,rq(this),this.Hf=!1)},this),1E3*Math.pow(2,this.Bi++)))};h.abort=function(){this.Hc();"aborted"!=this.getStatus()&&"removed"!=this.getStatus()&&qq(this,this.me in sq?"removed":"aborted")};h.getStatus=function(){return this.me};var qq=function(a,b){a.me=b;a.dispatchEvent("status-changed")}; -pq.prototype.J=function(){D.prototype.J.call(this);this.Hc();this.la.remove();this.ge=null};var sq={aborted:!0,failed:!0,loaded:!0,removed:!0};var tq=function(){y.call(this)};q(tq,y);var uq=function(a,b){hq.call(this,a,b);this.Xg=new zc;this.vh=new zc};q(uq,hq);uq.prototype.jh=function(a,b,c,d){var e=new vq(a,b,c,d);this.jb.Xa(e,"status-changed",function(){"loaded"==e.getStatus()&&(this.Xg.set(a,new Float32Array(e.Bd)),this.vh.set(a,e.la))});return e};uq.prototype.J=function(){hq.prototype.J.call(this);this.vh=this.Xg=null};w("ee.layers.BinaryOverlay",uq);var vq=function(a,b,c,d){pq.call(this,a,b,c,d)};q(vq,pq); -vq.prototype.Lc=function(){var a=new fq;a.Xa("loadend",function(){this.Bd=a.ca.result;pq.prototype.Lc.call(this)},void 0,this);a.readAsArrayBuffer(this.Ii)};var wq=function(a){D.call(this);this.Sc={};this.Rc={};this.Tb=new Zp(this);this.X=a;this.af=!1};x(wq,D);var xq=["load","abort","error"],yq=function(a,b,c){if(c="string"===typeof c?c:c.src)a.af=!1,a.Sc[b]={src:c,ih:null}},zq=function(a,b){delete a.Sc[b];var c=a.Rc[b];c&&(delete a.Rc[b],a.Tb.ue(c,xq,a.ii))}; -wq.prototype.start=function(){var a=this.Sc;Lb(a).forEach(function(b){var c=a[b];if(c&&(delete a[b],!this.Sa)){if(this.X){var d=this.X;d=(d?new qh(ph(d)):Ja||(Ja=new qh)).Xk("IMG")}else d=new Image;c.ih&&(d.crossOrigin=c.ih);this.Tb.Xa(d,xq,this.ii);this.Rc[b]=d;d.id=b;d.src=c.src}},this)}; -wq.prototype.ii=function(a){var b=a.currentTarget;if(b){if("readystatechange"==a.type)if("complete"==b.readyState)a.type="load";else return;"undefined"==typeof b.naturalWidth&&("load"==a.type?(b.naturalWidth=b.width,b.naturalHeight=b.height):(b.naturalWidth=0,b.naturalHeight=0));zq(this,b.id);this.dispatchEvent({type:a.type,target:b});!this.Sa&&Pb(this.Rc)&&Pb(this.Sc)&&!this.af&&(this.af=!0,this.dispatchEvent("complete"))}};wq.prototype.J=function(){delete this.Sc;delete this.Rc;Ha(this.Tb);wq.L.J.call(this)};var Aq=function(a,b){hq.call(this,a,b)};q(Aq,hq);Aq.prototype.jh=function(a,b,c,d){return new Bq(a,b,c,d)};w("ee.layers.ImageOverlay",Aq);var Bq=function(a,b,c,d){pq.call(this,a,b,c,d);this.ge=Cq;this.Mh=this.ga=this.Td=null;this.ad=""};q(Bq,pq); -Bq.prototype.Lc=function(){try{var a=vj(this.Ii);this.ad=kd(a);var b=this.ad!==ld.toString()?this.ad:this.Ca}catch(c){b=this.Ca}this.ga=new wq;yq(this.ga,this.la.id+"-image",b);this.Mh=ac(this.ga,Dq,function(c){"load"==c.type?(this.Td=c.target,pq.prototype.Lc.call(this)):this.kd()},void 0,this);this.ga.start()};Bq.prototype.Hc=function(){pq.prototype.Hc.call(this);this.ga&&(jc(this.Mh),Ha(this.ga))};Bq.prototype.J=function(){pq.prototype.J.call(this);this.ad&&URL.revokeObjectURL(this.ad)}; -var Cq=function(a){a.la.appendChild(a.Td)},Dq=["load","abort","error"];var Eq=function(a){for(var b=arguments[0],c=1;cthis.Yd)throw Error("[goog.structs.Pool] Min can not be greater than max");this.Ta=new Hq;this.vb=new Ic;this.delay=0;this.If=null;this.ud()};x(Iq,y);Iq.prototype.Oc=function(){var a=Date.now();if(!(null!=this.If&&a-this.Ifthis.Yd&&0=this.R()){for(var c=this.Aa,d=0;d>1,a[d].getKey()>c.getKey())a[b]=a[d],b=d;else break;a[b]=c};h=Lq.prototype; +var nq=function(a,b){A.call(this,"tile-fail");this.errorMessage=b};q(nq,A);var oq=function(){A.call(this,"tile-abort")};q(oq,A);var pq=function(a,b,c,d){D.call(this);this.rb=a;this.zoom=b;this.la=c.createElement("div");this.la.id=d;this.nl=5;this.ge=function(){};this.me="new";this.Ai=0;this.Hf=!1};q(pq,D);pq.prototype.getDiv=function(){return this.la}; +var rq=function(a){if(!a.Hf&&"loading"==a.getStatus())throw Error("startLoad() can only be invoked once. Use retryLoad() after the first attempt.");qq(a,"loading");a.kl=(new Date).getTime();a.Za=new Xi;a.Za.xc="blob";a.Za.Xa("complete",function(){var b=hj(a.Za),c=a.Za.getStatus();429==c&&qq(a,"throttled");if(Qi(c)){var d={};Fb(ij(a.Za),function(g,f){d[f.toLowerCase()]=g});a.Cl=d;a.Hi=b;a.Lc()}else if(b){var e=new fq;e.Xa("loadend",function(){a.gd(e.ca.result)});e.readAsText(b)}else a.gd("Failed to load tile.")}, +!1);a.Za.Vc("ready",Fa(Ha,a.Za));a.Ca&&a.Ca.endsWith("&profiling=1")&&(a.Ca=a.Ca.replace("&profiling=1",""),a.Za.headers.set("X-Earth-Engine-Computation-Profiling","1"));a.Za.send(a.Ca,"GET")};h=pq.prototype;h.Lc=function(){this.ge(this);qq(this,"loaded")};h.Hc=function(){Ha(this.Za)}; +h.gd=function(a){var b=function(c){try{if(c=JSON.parse(c),c.error&&c.error.message)return c.error.message}catch(d){}return c};this.Ai>=this.nl?(this.Yk=b(a),qq(this,"failed")):(this.Hc(),setTimeout(u(function(){this.Sa||(this.Hf=!0,rq(this),this.Hf=!1)},this),1E3*Math.pow(2,this.Ai++)))};h.abort=function(){this.Hc();"aborted"!=this.getStatus()&&"removed"!=this.getStatus()&&qq(this,this.me in sq?"removed":"aborted")};h.getStatus=function(){return this.me};var qq=function(a,b){a.me=b;a.dispatchEvent("status-changed")}; +pq.prototype.J=function(){D.prototype.J.call(this);this.Hc();this.la.remove();this.ge=null};var sq={aborted:!0,failed:!0,loaded:!0,removed:!0};var tq=function(){y.call(this)};q(tq,y);var uq=function(a,b){hq.call(this,a,b);this.Xg=new zc;this.vh=new zc};q(uq,hq);uq.prototype.jh=function(a,b,c,d){var e=new vq(a,b,c,d);this.jb.Xa(e,"status-changed",function(){"loaded"==e.getStatus()&&(this.Xg.set(a,new Float32Array(e.yd)),this.vh.set(a,e.la))});return e};uq.prototype.J=function(){hq.prototype.J.call(this);this.vh=this.Xg=null};w("ee.layers.BinaryOverlay",uq);var vq=function(a,b,c,d){pq.call(this,a,b,c,d)};q(vq,pq); +vq.prototype.Lc=function(){var a=new fq;a.Xa("loadend",function(){this.yd=a.ca.result;pq.prototype.Lc.call(this)},void 0,this);a.readAsArrayBuffer(this.Hi)};var wq=function(a){D.call(this);this.Rc={};this.Qc={};this.Tb=new Zp(this);this.X=a;this.af=!1};x(wq,D);var xq=["load","abort","error"],yq=function(a,b,c){if(c="string"===typeof c?c:c.src)a.af=!1,a.Rc[b]={src:c,ih:null}},zq=function(a,b){delete a.Rc[b];var c=a.Qc[b];c&&(delete a.Qc[b],a.Tb.ue(c,xq,a.ii))}; +wq.prototype.start=function(){var a=this.Rc;Lb(a).forEach(function(b){var c=a[b];if(c&&(delete a[b],!this.Sa)){if(this.X){var d=this.X;d=(d?new qh(ph(d)):Ja||(Ja=new qh)).Wk("IMG")}else d=new Image;c.ih&&(d.crossOrigin=c.ih);this.Tb.Xa(d,xq,this.ii);this.Qc[b]=d;d.id=b;d.src=c.src}},this)}; +wq.prototype.ii=function(a){var b=a.currentTarget;if(b){if("readystatechange"==a.type)if("complete"==b.readyState)a.type="load";else return;"undefined"==typeof b.naturalWidth&&("load"==a.type?(b.naturalWidth=b.width,b.naturalHeight=b.height):(b.naturalWidth=0,b.naturalHeight=0));zq(this,b.id);this.dispatchEvent({type:a.type,target:b});!this.Sa&&Pb(this.Qc)&&Pb(this.Rc)&&!this.af&&(this.af=!0,this.dispatchEvent("complete"))}};wq.prototype.J=function(){delete this.Rc;delete this.Qc;Ha(this.Tb);wq.L.J.call(this)};var Aq=function(a,b){hq.call(this,a,b)};q(Aq,hq);Aq.prototype.jh=function(a,b,c,d){return new Bq(a,b,c,d)};w("ee.layers.ImageOverlay",Aq);var Bq=function(a,b,c,d){pq.call(this,a,b,c,d);this.ge=Cq;this.Mh=this.ga=this.Rd=null;this.Xc=""};q(Bq,pq); +Bq.prototype.Lc=function(){try{var a=vj(this.Hi);this.Xc=kd(a);var b=this.Xc!==ld.toString()?this.Xc:this.Ca}catch(c){b=this.Ca}this.ga=new wq;yq(this.ga,this.la.id+"-image",b);this.Mh=ac(this.ga,Dq,function(c){"load"==c.type?(this.Rd=c.target,pq.prototype.Lc.call(this)):this.gd()},void 0,this);this.ga.start()};Bq.prototype.Hc=function(){pq.prototype.Hc.call(this);this.ga&&(jc(this.Mh),Ha(this.ga))};Bq.prototype.J=function(){pq.prototype.J.call(this);this.Xc&&URL.revokeObjectURL(this.Xc)}; +var Cq=function(a){a.la.appendChild(a.Rd)},Dq=["load","abort","error"];var Eq=function(a){for(var b=arguments[0],c=1;cthis.Yd)throw Error("[goog.structs.Pool] Min can not be greater than max");this.Ta=new Hq;this.vb=new Ic;this.delay=0;this.If=null;this.rd()};x(Iq,y);Iq.prototype.Oc=function(){var a=Date.now();if(!(null!=this.If&&a-this.Ifthis.Yd&&0=this.R()){for(var c=this.Aa,d=0;d>1,a[d].getKey()>c.getKey())a[b]=a[d],b=d;else break;a[b]=c};h=Lq.prototype; h.remove=function(){var a=this.Aa,b=a.length,c=a[0];if(!(0>=b)){if(1==b)a.length=0;else{a[0]=a.pop();a=0;b=this.Aa;for(var d=b.length,e=b[a];a>1;){var g=2*a+1,f=2*a+2;g=fe.getKey())break;b[a]=b[g];a=g}b[a]=e}return c.we}};h.aa=function(){for(var a=this.Aa,b=[],c=a.length,d=0;dthis.pl)return!1;this.Og++;zq(this.ga,this.fa);setTimeout(u(this.Dl,this),0);return!0}; -h.Dl=function(){if(!this.kc){var a=u(function(d){this.kc||(yq(this.ga,this.fa,d),ac(this.ga,Xq,u(this.el,this)),this.ga.start())},this),b=this.getUrl();if(Ld(b).Ba.Pb("profiling")){var c=new Xi;c.xc="blob";c.Xa("complete",u(function(){this.ti=c.getResponseHeader("X-Earth-Engine-Computation-Profile")||null;if(200<=c.getStatus()&&300>c.getStatus())try{var d=kd(vj(hj(c)));var e=d!==ld.toString()}catch(g){}a(e?d:b)},this));c.Xc("ready",u(c.Ra,c));c.send(b,"GET")}else a(b)}};h.Og=0;h.kc=!1;h.ga=null; -h.Ti=null;h.Ja=null;h.ti=null;var Xq=["load","abort","error"],Yq=function(){y.call(this);this.Ea=!1};q(Yq,y);Yq.prototype.setActive=function(a){this.Ea=a};Yq.prototype.isActive=function(){return this.Ea};var Tq=function(a,b){Oq.call(this,a,b)};q(Tq,Oq);Tq.prototype.df=function(){return new Yq};Tq.prototype.Fd=function(a){a.Ra()};Tq.prototype.Uf=function(a){return!a.Sa&&!a.isActive()};var Zq=function(a,b,c,d,e){Nc.call(this,a,b,c,d,e);this.minZoom=d.minZoom||0;this.maxZoom=d.maxZoom||20;if(!window.google||!window.google.maps)throw Error("Google Maps API hasn't been initialized.");this.tileSize=d.tileSize||new google.maps.Size(256,256);this.name=d.name;this.Ag=new Ic;this.Vf=1;this.ua=e||null};q(Zq,Nc);h=Zq.prototype;h.Qe=function(a){return bc(this,"tileevent",a)};h.fg=function(a){jc(a)}; -h.getTile=function(a,b,c){if(ba.y||a.y>=1<this.ol)return!1;this.Og++;zq(this.ga,this.fa);setTimeout(u(this.Dl,this),0);return!0}; +h.Dl=function(){if(!this.kc){var a=u(function(d){this.kc||(yq(this.ga,this.fa,d),ac(this.ga,Xq,u(this.dl,this)),this.ga.start())},this),b=this.getUrl();if(Ld(b).Ba.Pb("profiling")){var c=new Xi;c.xc="blob";c.Xa("complete",u(function(){this.si=c.getResponseHeader("X-Earth-Engine-Computation-Profile")||null;if(200<=c.getStatus()&&300>c.getStatus())try{var d=kd(vj(hj(c)));var e=d!==ld.toString()}catch(g){}a(e?d:b)},this));c.Vc("ready",u(c.Ra,c));c.send(b,"GET")}else a(b)}};h.Og=0;h.kc=!1;h.ga=null; +h.Si=null;h.Ja=null;h.si=null;var Xq=["load","abort","error"],Yq=function(){y.call(this);this.Ea=!1};q(Yq,y);Yq.prototype.setActive=function(a){this.Ea=a};Yq.prototype.isActive=function(){return this.Ea};var Tq=function(a,b){Oq.call(this,a,b)};q(Tq,Oq);Tq.prototype.df=function(){return new Yq};Tq.prototype.Cd=function(a){a.Ra()};Tq.prototype.Uf=function(a){return!a.Sa&&!a.isActive()};var Zq=function(a,b,c,d,e){Nc.call(this,a,b,c,d,e);this.minZoom=d.minZoom||0;this.maxZoom=d.maxZoom||20;if(!window.google||!window.google.maps)throw Error("Google Maps API hasn't been initialized.");this.tileSize=d.tileSize||new google.maps.Size(256,256);this.name=d.name;this.Ag=new Ic;this.Vf=1;this.ua=e||null};q(Zq,Nc);h=Zq.prototype;h.Qe=function(a){return bc(this,"tileevent",a)};h.fg=function(a){jc(a)}; +h.getTile=function(a,b,c){if(ba.y||a.y>=1<\r\n\r\n" + partBody + "\r\n"; }).join("") + "--batch_EARTHENGINE_batch--\r\n", deserializeResponses = function(response) { @@ -18879,7 +18878,7 @@ module$contents$ee$apiclient_BatchCall.prototype.send = function(parts, getRespo return getResponse ? getResponse(result) : result; }; return this.callback ? (module$contents$ee$apiclient_apiclient.send(batchUrl, null, function(result, err) { - return $jscomp$this.callback(err ? result : deserializeResponses(result), err); + return $jscomp$this$294235699$27.callback(err ? result : deserializeResponses(result), err); }, "multipart/mixed; boundary=batch_EARTHENGINE_batch", body, void 0, this.detectPartialError), null) : deserializeResponses(module$contents$ee$apiclient_apiclient.send(batchUrl, null, void 0, "multipart/mixed; boundary=batch_EARTHENGINE_batch", body, void 0, this.detectPartialError)); }; var module$contents$ee$apiclient_BatchRequestService = function() { @@ -19026,8 +19025,8 @@ module$contents$ee$apiclient_apiclient.send = function(path, params, callback, m var profileHookAtCallTime = module$contents$ee$apiclient_apiclient.profileHook_, contentType = "application/x-www-form-urlencoded"; body && (contentType = "application/json", method && method.startsWith("multipart") && (contentType = method, method = "POST")); method = method || "POST"; - var headers = {"Content-Type":contentType}, version = "0.1.384"; - "0.1.384" === version && (version = "latest"); + var headers = {"Content-Type":contentType}, version = "0.1.385"; + "0.1.385" === version && (version = "latest"); headers[module$contents$ee$apiclient_apiclient.API_CLIENT_VERSION_HEADER] = "ee-js/" + version; var authToken = module$contents$ee$apiclient_apiclient.getAuthToken(); if (null != authToken) { @@ -19150,7 +19149,7 @@ module$contents$ee$apiclient_apiclient.ensureAuthLibLoaded_ = function(callback) delete goog.global[callbackName]; done(); }; - goog.net.jsloader.safeLoad(module$contents$safevalues$builders$resource_url_builders_trustedResourceUrl($jscomp$templatelit$294235699$0, callbackName)); + goog.net.jsloader.safeLoad(module$contents$safevalues$builders$resource_url_builders_trustedResourceUrl($jscomp$templatelit$294235699$94, callbackName)); } }; module$contents$ee$apiclient_apiclient.handleAuthResult_ = function(success, error, result) { @@ -20260,15 +20259,15 @@ ee.Serializer.prototype.encodeForCloudApi_ = function(obj) { } }; ee.Serializer.prototype.makeReference = function(obj) { - var $jscomp$this = this, makeRef = function(result) { + var $jscomp$this$1175707268$21 = this, makeRef = function(result) { var hash = ee.Serializer.computeHash(result); - goog.isObject(obj) && $jscomp$this.hashes_.set(obj, hash); - if ($jscomp$this.encoded_[hash]) { - return $jscomp$this.encoded_[hash]; + goog.isObject(obj) && $jscomp$this$1175707268$21.hashes_.set(obj, hash); + if ($jscomp$this$1175707268$21.encoded_[hash]) { + return $jscomp$this$1175707268$21.encoded_[hash]; } - var name = String($jscomp$this.scope_.length); - $jscomp$this.scope_.push([name, result]); - return $jscomp$this.encoded_[hash] = name; + var name = String($jscomp$this$1175707268$21.scope_.length); + $jscomp$this$1175707268$21.scope_.push([name, result]); + return $jscomp$this$1175707268$21.encoded_[hash] = name; }; if (goog.isObject(obj) && this.encoded_[this.hashes_.get(obj)]) { return this.encoded_[this.hashes_.get(obj)]; @@ -20286,24 +20285,24 @@ ee.Serializer.prototype.makeReference = function(obj) { } if (Array.isArray(obj)) { return makeRef(ee.rpc_node.array(obj.map(function(x) { - return ee.rpc_node.reference($jscomp$this.makeReference(x)); + return ee.rpc_node.reference($jscomp$this$1175707268$21.makeReference(x)); }))); } if (goog.isObject(obj) && "function" !== typeof obj) { var values = {}; Object.keys(obj).sort().forEach(function(k) { - values[k] = ee.rpc_node.reference($jscomp$this.makeReference(obj[k])); + values[k] = ee.rpc_node.reference($jscomp$this$1175707268$21.makeReference(obj[k])); }); return makeRef(ee.rpc_node.dictionary(values)); } throw Error("Can't encode object: " + obj); }; var ExpressionOptimizer = function(rootReference, values, isCompound, sourceNodeMap) { - var $jscomp$this = this; + var $jscomp$this$1175707268$22 = this; this.rootReference = rootReference; this.values = {}; values.forEach(function(tuple) { - return $jscomp$this.values[tuple[0]] = tuple[1]; + return $jscomp$this$1175707268$22.values[tuple[0]] = tuple[1]; }); this.referenceCounts = isCompound ? this.countReferences() : null; this.optimizedValues = {}; @@ -20325,12 +20324,12 @@ ExpressionOptimizer.prototype.optimizeReference = function(ref) { return mappedRef; }; ExpressionOptimizer.prototype.optimizeValue = function(value, depth) { - var $jscomp$this = this, isConst = function(v) { + var $jscomp$this$1175707268$25 = this, isConst = function(v) { return null !== v.constantValue; }, serializeConst = function(v) { return v === module$exports$eeapiclient$domain_object.NULL_VALUE ? null : v; }, storeInSourceMap = function(parentValue, valueNode) { - $jscomp$this.sourceNodeMap && $jscomp$this.sourceNodeMap.has(parentValue) && !$jscomp$this.sourceNodeMap.has(valueNode) && $jscomp$this.sourceNodeMap.set(valueNode, $jscomp$this.sourceNodeMap.get(parentValue)); + $jscomp$this$1175707268$25.sourceNodeMap && $jscomp$this$1175707268$25.sourceNodeMap.has(parentValue) && !$jscomp$this$1175707268$25.sourceNodeMap.has(valueNode) && $jscomp$this$1175707268$25.sourceNodeMap.set(valueNode, $jscomp$this$1175707268$25.sourceNodeMap.get(parentValue)); return valueNode; }; if (isConst(value) || null != value.integerValue || null != value.bytesValue || null != value.argumentReference) { @@ -20350,7 +20349,7 @@ ExpressionOptimizer.prototype.optimizeValue = function(value, depth) { } if (null != value.arrayValue) { var arr = value.arrayValue.values.map(function(v) { - return $jscomp$this.optimizeValue(v, depth + 3); + return $jscomp$this$1175707268$25.optimizeValue(v, depth + 3); }), optimized$jscomp$1 = arr.every(isConst) ? ee.rpc_node.constant(arr.map(function(v) { return serializeConst(v.constantValue); })) : ee.rpc_node.array(arr); @@ -20383,8 +20382,8 @@ ExpressionOptimizer.isAlwaysLiftable = function(value) { return null !== constant ? constant === module$exports$eeapiclient$domain_object.NULL_VALUE || "number" === typeof constant || "boolean" === typeof constant : null != value.argumentReference; }; ExpressionOptimizer.prototype.countReferences = function() { - var $jscomp$this = this, counts = {}, visitReference = function(reference) { - counts[reference] ? counts[reference]++ : (counts[reference] = 1, visitValue($jscomp$this.values[reference])); + var $jscomp$this$1175707268$27 = this, counts = {}, visitReference = function(reference) { + counts[reference] ? counts[reference]++ : (counts[reference] = 1, visitValue($jscomp$this$1175707268$27.values[reference])); }, visitValue = function(value) { if (null != value.arrayValue) { value.arrayValue.values.forEach(visitValue); @@ -22761,11 +22760,11 @@ ee.Image.prototype.getInfo = function(opt_callback) { }; goog.exportProperty(ee.Image.prototype, "getInfo", ee.Image.prototype.getInfo); ee.Image.prototype.getMapId = function(opt_visParams, opt_callback) { - var $jscomp$this = this, args = ee.arguments.extractFromFunction(ee.Image.prototype.getMap, arguments), request = ee.data.images.applyVisualization(this, args.visParams); + var $jscomp$this$m870018051$6 = this, args = ee.arguments.extractFromFunction(ee.Image.prototype.getMap, arguments), request = ee.data.images.applyVisualization(this, args.visParams); if (args.callback) { var callback = args.callback; ee.data.getMapId(request, function(data, error) { - var mapId = data ? Object.assign(data, {image:$jscomp$this}) : void 0; + var mapId = data ? Object.assign(data, {image:$jscomp$this$m870018051$6}) : void 0; callback(mapId, error); }); } else { @@ -23165,7 +23164,7 @@ module$contents$ee$batch_ExportTask.create = function(exportArgs) { return new module$contents$ee$batch_ExportTask(config); }; module$contents$ee$batch_ExportTask.prototype.start = function(opt_success, opt_error) { - var $jscomp$this = this; + var $jscomp$this$m1704548930$3 = this; goog.asserts.assert(this.config_, "Task config must be specified for tasks to be started."); this.id = this.id || ee.data.newTaskId(1)[0]; goog.asserts.assertString(this.id, "Failed to obtain task ID."); @@ -23175,7 +23174,7 @@ module$contents$ee$batch_ExportTask.prototype.start = function(opt_success, opt_ opt_error(error); } else { var $jscomp$nullish$tmp11; - $jscomp$this.id = null != ($jscomp$nullish$tmp11 = response.taskId) ? $jscomp$nullish$tmp11 : null; + $jscomp$this$m1704548930$3.id = null != ($jscomp$nullish$tmp11 = response.taskId) ? $jscomp$nullish$tmp11 : null; opt_success(); } }); @@ -24263,9 +24262,9 @@ module$contents$ee$layers$AbstractOverlayStats_AbstractOverlayStats.prototype.ha return 0 < this.statsByZoom_.size; }; module$contents$ee$layers$AbstractOverlayStats_AbstractOverlayStats.prototype.getSummaryList = function() { - var $jscomp$this = this, summaryList = []; + var $jscomp$this$m1171058278$7 = this, summaryList = []; this.statsByZoom_.forEach(function(stats, zoom) { - return summaryList.push({layerId:$jscomp$this.uniqueId_, zoomLevel:zoom, tileLatencies:stats.tileLatencies, throttleCount:stats.throttleCount, errorCount:stats.errorCount}); + return summaryList.push({layerId:$jscomp$this$m1171058278$7.uniqueId_, zoomLevel:zoom, tileLatencies:stats.tileLatencies, throttleCount:stats.throttleCount, errorCount:stats.errorCount}); }); return summaryList; }; @@ -25451,7 +25450,7 @@ ee.layers.AbstractTile.prototype.getDiv = function() { return this.div; }; ee.layers.AbstractTile.prototype.startLoad = function() { - var $jscomp$this = this; + var $jscomp$this$m442005483$27 = this; if (!this.isRetrying_ && this.getStatus() == ee.layers.AbstractTile.Status.LOADING) { throw Error("startLoad() can only be invoked once. Use retryLoad() after the first attempt."); } @@ -25460,24 +25459,24 @@ ee.layers.AbstractTile.prototype.startLoad = function() { this.xhrIo_ = new goog.net.XhrIo(); this.xhrIo_.setResponseType(goog.net.XhrIo.ResponseType.BLOB); this.xhrIo_.listen(goog.net.EventType.COMPLETE, function(event) { - var blob = $jscomp$this.xhrIo_.getResponse(), status = $jscomp$this.xhrIo_.getStatus(), HttpStatus = goog.net.HttpStatus; - status == HttpStatus.TOO_MANY_REQUESTS && $jscomp$this.setStatus(ee.layers.AbstractTile.Status.THROTTLED); + var blob = $jscomp$this$m442005483$27.xhrIo_.getResponse(), status = $jscomp$this$m442005483$27.xhrIo_.getStatus(), HttpStatus = goog.net.HttpStatus; + status == HttpStatus.TOO_MANY_REQUESTS && $jscomp$this$m442005483$27.setStatus(ee.layers.AbstractTile.Status.THROTTLED); if (HttpStatus.isSuccess(status)) { var sourceResponseHeaders = {}; - module$contents$goog$object_forEach($jscomp$this.xhrIo_.getResponseHeaders(), function(value, name) { + module$contents$goog$object_forEach($jscomp$this$m442005483$27.xhrIo_.getResponseHeaders(), function(value, name) { sourceResponseHeaders[name.toLowerCase()] = value; }); - $jscomp$this.sourceResponseHeaders = sourceResponseHeaders; - $jscomp$this.sourceData = blob; - $jscomp$this.finishLoad(); + $jscomp$this$m442005483$27.sourceResponseHeaders = sourceResponseHeaders; + $jscomp$this$m442005483$27.sourceData = blob; + $jscomp$this$m442005483$27.finishLoad(); } else if (blob) { var reader = new goog.fs.FileReader(); reader.listen(goog.fs.FileReader.EventType.LOAD_END, function() { - $jscomp$this.retryLoad(reader.getResult()); + $jscomp$this$m442005483$27.retryLoad(reader.getResult()); }, void 0); reader.readAsText(blob); } else { - $jscomp$this.retryLoad("Failed to load tile."); + $jscomp$this$m442005483$27.retryLoad("Failed to load tile."); } }, !1); this.xhrIo_.listenOnce(goog.net.EventType.READY, goog.partial(module$contents$goog$dispose_dispose, this.xhrIo_)); @@ -26535,13 +26534,13 @@ ee.data.Profiler.prototype.removeProfile_ = function(profileId) { 1 < count ? this.profileIds_[profileId]-- : void 0 !== count && (delete this.profileIds_[profileId], this.throttledRefresh_.start()); }; ee.data.Profiler.prototype.refresh_ = function(retryAttempt) { - var $jscomp$this = this; + var $jscomp$this$491634829$13 = this; retryAttempt = void 0 === retryAttempt ? 0 : retryAttempt; var marker = {}; this.lastRefreshToken_ = marker; var handleResponse = function(result, error) { - marker == $jscomp$this.lastRefreshToken_ && (error && "number" === typeof retryAttempt && retryAttempt < $jscomp$this.MAX_RETRY_COUNT_ ? goog.Timer.callOnce(goog.bind($jscomp$this.refresh_, $jscomp$this, retryAttempt + 1), 2 * ee.data.Profiler.DELAY_BEFORE_REFRESH_) : ($jscomp$this.profileError_ = error || null, $jscomp$this.profileData_ = error ? ee.data.Profiler.getEmptyProfile_($jscomp$this.format_) : result, $jscomp$this.lastRefreshToken_ = null, $jscomp$this.dispatchEvent(ee.data.Profiler.EventType.STATE_CHANGED), - $jscomp$this.dispatchEvent(ee.data.Profiler.EventType.DATA_CHANGED))); + marker == $jscomp$this$491634829$13.lastRefreshToken_ && (error && "number" === typeof retryAttempt && retryAttempt < $jscomp$this$491634829$13.MAX_RETRY_COUNT_ ? goog.Timer.callOnce(goog.bind($jscomp$this$491634829$13.refresh_, $jscomp$this$491634829$13, retryAttempt + 1), 2 * ee.data.Profiler.DELAY_BEFORE_REFRESH_) : ($jscomp$this$491634829$13.profileError_ = error || null, $jscomp$this$491634829$13.profileData_ = error ? ee.data.Profiler.getEmptyProfile_($jscomp$this$491634829$13.format_) : + result, $jscomp$this$491634829$13.lastRefreshToken_ = null, $jscomp$this$491634829$13.dispatchEvent(ee.data.Profiler.EventType.STATE_CHANGED), $jscomp$this$491634829$13.dispatchEvent(ee.data.Profiler.EventType.DATA_CHANGED))); }, ids = module$contents$goog$object_getKeys(this.profileIds_); 0 === ids.length ? handleResponse(ee.data.Profiler.getEmptyProfile_(this.format_), void 0) : (ee.ApiFunction._apply(this.showInternal_ ? "Profile.getProfilesInternal" : "Profile.getProfiles", {ids:ids, format:this.format_.toString()}).getInfo(handleResponse), this.dispatchEvent(ee.data.Profiler.EventType.STATE_CHANGED)); }; diff --git a/javascript/build/ee_api_js_npm.js b/javascript/build/ee_api_js_npm.js index a4997a2a4..2eba74588 100644 --- a/javascript/build/ee_api_js_npm.js +++ b/javascript/build/ee_api_js_npm.js @@ -1200,8 +1200,7 @@ $jscomp.polyfill("String.prototype.padStart", function(orig) { return $jscomp.stringPadding(opt_padString, targetLength - string.length) + string; }; }, "es8", "es3"); -var CLOSURE_TOGGLE_ORDINALS = {GoogFlags__async_throw_on_unicode_to_byte__enable:!1, GoogFlags__client_only_wiz_attribute_sanitization__disable:!1, GoogFlags__client_only_wiz_hook_context_fix__enable:!1, GoogFlags__jspb_disable_serializing_empty_repeated_and_map_fields__disable:!1, GoogFlags__override_disable_toggles:!1, GoogFlags__testonly_debug_flag__enable:!1, GoogFlags__testonly_disabled_flag__enable:!1, GoogFlags__testonly_stable_flag__disable:!1, GoogFlags__testonly_staging_flag__disable:!1, -GoogFlags__use_toggles:!1, GoogFlags__use_user_agent_client_hints__enable:!1}; +var CLOSURE_TOGGLE_ORDINALS = {GoogFlags__async_throw_on_unicode_to_byte__enable:!1, GoogFlags__jspb_disable_serializing_empty_repeated_and_map_fields__disable:!1, GoogFlags__override_disable_toggles:!1, GoogFlags__testonly_debug_flag__enable:!1, GoogFlags__testonly_disabled_flag__enable:!1, GoogFlags__testonly_stable_flag__disable:!1, GoogFlags__testonly_staging_flag__disable:!1, GoogFlags__use_toggles:!1, GoogFlags__use_user_agent_client_hints__enable:!1}; /* Copyright The Closure Library Authors. @@ -2966,8 +2965,6 @@ module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__use_toggles = !1; module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__override_disable_toggles = !1; module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__use_user_agent_client_hints__enable = !1; module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__async_throw_on_unicode_to_byte__enable = !1; -module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__client_only_wiz_attribute_sanitization__disable = !1; -module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__client_only_wiz_hook_context_fix__enable = !1; module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__jspb_disable_serializing_empty_repeated_and_map_fields__disable = !1; module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__testonly_disabled_flag__enable = !1; module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__testonly_debug_flag__enable = !1; @@ -2977,8 +2974,6 @@ goog.flags = {}; var module$contents$goog$flags_STAGING = goog.readFlagInternalDoNotUseOrElse(1, goog.FLAGS_STAGING_DEFAULT); goog.flags.USE_USER_AGENT_CLIENT_HINTS = module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__use_toggles ? module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__use_user_agent_client_hints__enable : goog.readFlagInternalDoNotUseOrElse(610401301, !1); goog.flags.ASYNC_THROW_ON_UNICODE_TO_BYTE = module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__use_toggles ? module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__async_throw_on_unicode_to_byte__enable : goog.readFlagInternalDoNotUseOrElse(899588437, !1); -goog.flags.CLIENT_ONLY_WIZ_ATTRIBUTE_SANITIZATION = module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__use_toggles ? module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__override_disable_toggles || !module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__client_only_wiz_attribute_sanitization__disable : goog.readFlagInternalDoNotUseOrElse(533565600, !0); -goog.flags.CLIENT_ONLY_WIZ_HOOK_CONTEXT_FIX = module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__use_toggles ? module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__client_only_wiz_hook_context_fix__enable : goog.readFlagInternalDoNotUseOrElse(563486499, !1); goog.flags.JSPB_DISABLE_SERIALIZING_EMPTY_REPEATED_AND_MAP_FIELDS = module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__use_toggles ? module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__override_disable_toggles || !module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__jspb_disable_serializing_empty_repeated_and_map_fields__disable : goog.readFlagInternalDoNotUseOrElse(572417392, !0); goog.flags.TESTONLY_DISABLED_FLAG = module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__use_toggles ? module$exports$closure$flags$flags$2etoggles.TOGGLE_GoogFlags__testonly_disabled_flag__enable : goog.readFlagInternalDoNotUseOrElse(2147483644, !1); @@ -3157,29 +3152,29 @@ module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.HighEntropyValue }; module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.HighEntropyValue.prototype.load = function() { var $jscomp$async$this = this, userAgentData; - return $jscomp.asyncExecutePromiseGeneratorProgram(function($jscomp$generator$context$m2110036436$1) { - if (1 == $jscomp$generator$context$m2110036436$1.nextAddress) { + return $jscomp.asyncExecutePromiseGeneratorProgram(function($jscomp$generator$context$m2110036436$14) { + if (1 == $jscomp$generator$context$m2110036436$14.nextAddress) { userAgentData = module$contents$goog$labs$userAgent$util_getUserAgentData(); if (!userAgentData) { - return $jscomp$generator$context$m2110036436$1.return(void 0); + return $jscomp$generator$context$m2110036436$14.return(void 0); } $jscomp$async$this.promise_ || ($jscomp$async$this.pending_ = !0, $jscomp$async$this.promise_ = function() { var dataValues; - return $jscomp.asyncExecutePromiseGeneratorProgram(function($jscomp$generator$context$m2110036436$0) { - if (1 == $jscomp$generator$context$m2110036436$0.nextAddress) { - return $jscomp$generator$context$m2110036436$0.setFinallyBlock(2), $jscomp$generator$context$m2110036436$0.yield(userAgentData.getHighEntropyValues([$jscomp$async$this.key_]), 4); + return $jscomp.asyncExecutePromiseGeneratorProgram(function($jscomp$generator$context$m2110036436$13) { + if (1 == $jscomp$generator$context$m2110036436$13.nextAddress) { + return $jscomp$generator$context$m2110036436$13.setFinallyBlock(2), $jscomp$generator$context$m2110036436$13.yield(userAgentData.getHighEntropyValues([$jscomp$async$this.key_]), 4); } - if (2 != $jscomp$generator$context$m2110036436$0.nextAddress) { - return dataValues = $jscomp$generator$context$m2110036436$0.yieldResult, $jscomp$async$this.value_ = dataValues[$jscomp$async$this.key_], $jscomp$generator$context$m2110036436$0.return($jscomp$async$this.value_); + if (2 != $jscomp$generator$context$m2110036436$13.nextAddress) { + return dataValues = $jscomp$generator$context$m2110036436$13.yieldResult, $jscomp$async$this.value_ = dataValues[$jscomp$async$this.key_], $jscomp$generator$context$m2110036436$13.return($jscomp$async$this.value_); } - $jscomp$generator$context$m2110036436$0.enterFinallyBlock(); + $jscomp$generator$context$m2110036436$13.enterFinallyBlock(); $jscomp$async$this.pending_ = !1; - return $jscomp$generator$context$m2110036436$0.leaveFinallyBlock(0); + return $jscomp$generator$context$m2110036436$13.leaveFinallyBlock(0); }); }()); - return $jscomp$generator$context$m2110036436$1.yield($jscomp$async$this.promise_, 2); + return $jscomp$generator$context$m2110036436$14.yield($jscomp$async$this.promise_, 2); } - return $jscomp$generator$context$m2110036436$1.return($jscomp$generator$context$m2110036436$1.yieldResult); + return $jscomp$generator$context$m2110036436$14.return($jscomp$generator$context$m2110036436$14.yieldResult); }); }; module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.HighEntropyValue.prototype.resetForTesting = function() { @@ -3411,12 +3406,12 @@ var module$contents$goog$labs$userAgent$browser_HighEntropyBrandVersion = functi this.useUach_ = useUach; }; module$contents$goog$labs$userAgent$browser_HighEntropyBrandVersion.prototype.getIfLoaded = function() { - var $jscomp$this = this; + var $jscomp$this$1683157560$24 = this; if (this.useUach_) { var loadedVersionList = module$exports$goog$labs$userAgent$highEntropy$highEntropyData.fullVersionList.getIfLoaded(); if (void 0 !== loadedVersionList) { var matchingBrand = loadedVersionList.find(function($jscomp$destructuring$var4) { - return $jscomp$this.brand_ === $jscomp$destructuring$var4.brand; + return $jscomp$this$1683157560$24.brand_ === $jscomp$destructuring$var4.brand; }); (0,goog.asserts.assertExists)(matchingBrand); return new module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.Version(matchingBrand.version); @@ -3428,27 +3423,27 @@ module$contents$goog$labs$userAgent$browser_HighEntropyBrandVersion.prototype.ge }; module$contents$goog$labs$userAgent$browser_HighEntropyBrandVersion.prototype.load = function() { var $jscomp$async$this = this, loadedVersionList, matchingBrand; - return $jscomp.asyncExecutePromiseGeneratorProgram(function($jscomp$generator$context$1683157560$0) { - if (1 == $jscomp$generator$context$1683157560$0.nextAddress) { - return $jscomp$async$this.useUach_ ? $jscomp$generator$context$1683157560$0.yield(module$exports$goog$labs$userAgent$highEntropy$highEntropyData.fullVersionList.load(), 5) : $jscomp$generator$context$1683157560$0.yield(0, 3); + return $jscomp.asyncExecutePromiseGeneratorProgram(function($jscomp$generator$context$1683157560$31) { + if (1 == $jscomp$generator$context$1683157560$31.nextAddress) { + return $jscomp$async$this.useUach_ ? $jscomp$generator$context$1683157560$31.yield(module$exports$goog$labs$userAgent$highEntropy$highEntropyData.fullVersionList.load(), 5) : $jscomp$generator$context$1683157560$31.yield(0, 3); } - if (3 != $jscomp$generator$context$1683157560$0.nextAddress && (loadedVersionList = $jscomp$generator$context$1683157560$0.yieldResult, void 0 !== loadedVersionList)) { + if (3 != $jscomp$generator$context$1683157560$31.nextAddress && (loadedVersionList = $jscomp$generator$context$1683157560$31.yieldResult, void 0 !== loadedVersionList)) { return matchingBrand = loadedVersionList.find(function($jscomp$destructuring$var6) { return $jscomp$async$this.brand_ === $jscomp$destructuring$var6.brand; - }), (0,goog.asserts.assertExists)(matchingBrand), $jscomp$generator$context$1683157560$0.return(new module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.Version(matchingBrand.version)); + }), (0,goog.asserts.assertExists)(matchingBrand), $jscomp$generator$context$1683157560$31.return(new module$exports$goog$labs$userAgent$highEntropy$highEntropyValue.Version(matchingBrand.version)); } module$contents$goog$labs$userAgent$browser_preUachHasLoaded = !0; - return $jscomp$generator$context$1683157560$0.return($jscomp$async$this.version_); + return $jscomp$generator$context$1683157560$31.return($jscomp$async$this.version_); }); }; var module$contents$goog$labs$userAgent$browser_preUachHasLoaded = !1; goog.labs.userAgent.browser.loadFullVersions = function() { - return $jscomp.asyncExecutePromiseGeneratorProgram(function($jscomp$generator$context$1683157560$1) { - if (1 == $jscomp$generator$context$1683157560$1.nextAddress) { - return module$contents$goog$labs$userAgent$browser_useUserAgentDataBrand(!0) ? $jscomp$generator$context$1683157560$1.yield(module$exports$goog$labs$userAgent$highEntropy$highEntropyData.fullVersionList.load(), 2) : $jscomp$generator$context$1683157560$1.jumpTo(2); + return $jscomp.asyncExecutePromiseGeneratorProgram(function($jscomp$generator$context$1683157560$32) { + if (1 == $jscomp$generator$context$1683157560$32.nextAddress) { + return module$contents$goog$labs$userAgent$browser_useUserAgentDataBrand(!0) ? $jscomp$generator$context$1683157560$32.yield(module$exports$goog$labs$userAgent$highEntropy$highEntropyData.fullVersionList.load(), 2) : $jscomp$generator$context$1683157560$32.jumpTo(2); } module$contents$goog$labs$userAgent$browser_preUachHasLoaded = !0; - $jscomp$generator$context$1683157560$1.jumpToEnd(); + $jscomp$generator$context$1683157560$32.jumpToEnd(); }); }; goog.labs.userAgent.browser.resetForTesting = function() { @@ -6062,7 +6057,7 @@ module$exports$eeapiclient$domain_object.strictDeserialize = function(type, raw) }; var module$contents$eeapiclient$domain_object_CopyValueGetter, module$contents$eeapiclient$domain_object_CopyValueSetter, module$contents$eeapiclient$domain_object_CopyConstructor, module$contents$eeapiclient$domain_object_CopyInstanciator; function module$contents$eeapiclient$domain_object_deepCopy(source, valueGetter, valueSetter, copyInstanciator, targetConstructor) { - for (var target = copyInstanciator(targetConstructor), metadata = module$contents$eeapiclient$domain_object_deepCopyMetadata(source, target), arrays = metadata.arrays || {}, objects = metadata.objects || {}, objectMaps = metadata.objectMaps || {}, $jscomp$iter$19 = $jscomp.makeIterator(metadata.keys || []), $jscomp$key$key = $jscomp$iter$19.next(), $jscomp$loop$m192531680$0 = {}; !$jscomp$key$key.done; $jscomp$loop$m192531680$0 = {mapMetadata:$jscomp$loop$m192531680$0.mapMetadata}, + for (var target = copyInstanciator(targetConstructor), metadata = module$contents$eeapiclient$domain_object_deepCopyMetadata(source, target), arrays = metadata.arrays || {}, objects = metadata.objects || {}, objectMaps = metadata.objectMaps || {}, $jscomp$iter$19 = $jscomp.makeIterator(metadata.keys || []), $jscomp$key$key = $jscomp$iter$19.next(), $jscomp$loop$m192531680$40 = {}; !$jscomp$key$key.done; $jscomp$loop$m192531680$40 = {mapMetadata:void 0}, $jscomp$key$key = $jscomp$iter$19.next()) { var key = $jscomp$key$key.value, value = valueGetter(key, source); if (null != value) { @@ -6075,11 +6070,11 @@ function module$contents$eeapiclient$domain_object_deepCopy(source, valueGetter, } else if (objects.hasOwnProperty(key)) { copy = module$contents$eeapiclient$domain_object_deepCopyValue(value, valueGetter, valueSetter, copyInstanciator, !1, !0, objects[key]); } else if (objectMaps.hasOwnProperty(key)) { - $jscomp$loop$m192531680$0.mapMetadata = objectMaps[key], copy = $jscomp$loop$m192531680$0.mapMetadata.isPropertyArray ? value.map(function($jscomp$loop$m192531680$0) { + $jscomp$loop$m192531680$40.mapMetadata = objectMaps[key], copy = $jscomp$loop$m192531680$40.mapMetadata.isPropertyArray ? value.map(function($jscomp$loop$m192531680$40) { return function(v) { - return module$contents$eeapiclient$domain_object_deepCopyObjectMap(v, $jscomp$loop$m192531680$0.mapMetadata, valueGetter, valueSetter, copyInstanciator); + return module$contents$eeapiclient$domain_object_deepCopyObjectMap(v, $jscomp$loop$m192531680$40.mapMetadata, valueGetter, valueSetter, copyInstanciator); }; - }($jscomp$loop$m192531680$0)) : module$contents$eeapiclient$domain_object_deepCopyObjectMap(value, $jscomp$loop$m192531680$0.mapMetadata, valueGetter, valueSetter, copyInstanciator); + }($jscomp$loop$m192531680$40)) : module$contents$eeapiclient$domain_object_deepCopyObjectMap(value, $jscomp$loop$m192531680$40.mapMetadata, valueGetter, valueSetter, copyInstanciator); } else if (Array.isArray(value)) { if (metadata.emptyArrayIsUnset && 0 === value.length) { continue; @@ -6125,39 +6120,39 @@ function module$contents$eeapiclient$domain_object_deepEquals(serializable1, ser if (!(module$contents$eeapiclient$domain_object_sameKeys(keys1, metadata2.keys || []) && module$contents$eeapiclient$domain_object_sameKeys(arrays1, arrays2) && module$contents$eeapiclient$domain_object_sameKeys(objects1, objects2) && module$contents$eeapiclient$domain_object_sameKeys(objectMaps1, objectMaps2))) { return !1; } - for (var $jscomp$iter$21 = $jscomp.makeIterator(keys1), $jscomp$key$key = $jscomp$iter$21.next(), $jscomp$loop$m192531680$1 = {}; !$jscomp$key$key.done; $jscomp$loop$m192531680$1 = {value2$jscomp$7:$jscomp$loop$m192531680$1.value2$jscomp$7, mapMetadata$jscomp$2:$jscomp$loop$m192531680$1.mapMetadata$jscomp$2}, $jscomp$key$key = $jscomp$iter$21.next()) { + for (var $jscomp$iter$21 = $jscomp.makeIterator(keys1), $jscomp$key$key = $jscomp$iter$21.next(), $jscomp$loop$m192531680$41 = {}; !$jscomp$key$key.done; $jscomp$loop$m192531680$41 = {value2$jscomp$7:void 0, mapMetadata$jscomp$2:void 0}, $jscomp$key$key = $jscomp$iter$21.next()) { var key = $jscomp$key$key.value, has1 = module$contents$eeapiclient$domain_object_hasAndIsNotEmptyArray(serializable1, key, metadata1), has2 = module$contents$eeapiclient$domain_object_hasAndIsNotEmptyArray(serializable2, key, metadata2); if (has1 !== has2) { return !1; } if (has1) { var value1 = serializable1.Serializable$get(key); - $jscomp$loop$m192531680$1.value2$jscomp$7 = serializable2.Serializable$get(key); + $jscomp$loop$m192531680$41.value2$jscomp$7 = serializable2.Serializable$get(key); if (arrays1.hasOwnProperty(key)) { - if (!module$contents$eeapiclient$domain_object_deepEqualsValue(value1, $jscomp$loop$m192531680$1.value2$jscomp$7, !0, !0)) { + if (!module$contents$eeapiclient$domain_object_deepEqualsValue(value1, $jscomp$loop$m192531680$41.value2$jscomp$7, !0, !0)) { return !1; } } else if (objects1.hasOwnProperty(key)) { - if (!module$contents$eeapiclient$domain_object_deepEqualsValue(value1, $jscomp$loop$m192531680$1.value2$jscomp$7, !1, !0)) { + if (!module$contents$eeapiclient$domain_object_deepEqualsValue(value1, $jscomp$loop$m192531680$41.value2$jscomp$7, !1, !0)) { return !1; } } else if (objectMaps1.hasOwnProperty(key)) { - if ($jscomp$loop$m192531680$1.mapMetadata$jscomp$2 = objectMaps1[key], $jscomp$loop$m192531680$1.mapMetadata$jscomp$2.isPropertyArray) { - if (!module$contents$eeapiclient$domain_object_sameKeys(value1, $jscomp$loop$m192531680$1.value2$jscomp$7) || value1.some(function($jscomp$loop$m192531680$1) { + if ($jscomp$loop$m192531680$41.mapMetadata$jscomp$2 = objectMaps1[key], $jscomp$loop$m192531680$41.mapMetadata$jscomp$2.isPropertyArray) { + if (!module$contents$eeapiclient$domain_object_sameKeys(value1, $jscomp$loop$m192531680$41.value2$jscomp$7) || value1.some(function($jscomp$loop$m192531680$41) { return function(v1, i) { - return !module$contents$eeapiclient$domain_object_deepEqualsObjectMap(v1, $jscomp$loop$m192531680$1.value2$jscomp$7[i], $jscomp$loop$m192531680$1.mapMetadata$jscomp$2); + return !module$contents$eeapiclient$domain_object_deepEqualsObjectMap(v1, $jscomp$loop$m192531680$41.value2$jscomp$7[i], $jscomp$loop$m192531680$41.mapMetadata$jscomp$2); }; - }($jscomp$loop$m192531680$1))) { + }($jscomp$loop$m192531680$41))) { return !1; } - } else if (!module$contents$eeapiclient$domain_object_deepEqualsObjectMap(value1, $jscomp$loop$m192531680$1.value2$jscomp$7, $jscomp$loop$m192531680$1.mapMetadata$jscomp$2)) { + } else if (!module$contents$eeapiclient$domain_object_deepEqualsObjectMap(value1, $jscomp$loop$m192531680$41.value2$jscomp$7, $jscomp$loop$m192531680$41.mapMetadata$jscomp$2)) { return !1; } } else if (Array.isArray(value1)) { - if (!module$contents$eeapiclient$domain_object_deepEqualsValue(value1, $jscomp$loop$m192531680$1.value2$jscomp$7, !0, !1)) { + if (!module$contents$eeapiclient$domain_object_deepEqualsValue(value1, $jscomp$loop$m192531680$41.value2$jscomp$7, !0, !1)) { return !1; } - } else if (!module$contents$eeapiclient$domain_object_deepEqualsValue(value1, $jscomp$loop$m192531680$1.value2$jscomp$7, !1, !1)) { + } else if (!module$contents$eeapiclient$domain_object_deepEqualsValue(value1, $jscomp$loop$m192531680$41.value2$jscomp$7, !1, !1)) { return !1; } } @@ -6578,7 +6573,6 @@ var module$contents$goog$html$SafeScript_CONSTRUCTOR_TOKEN_PRIVATE = {}, module$ throw Error("SafeScript is not meant to be built directly"); } this.privateDoNotAccessOrElseSafeScriptWrappedValue_ = value; - this.implementsGoogStringTypedString = !0; }; module$contents$goog$html$SafeScript_SafeScript.prototype.toString = function() { return this.privateDoNotAccessOrElseSafeScriptWrappedValue_.toString(); @@ -6590,9 +6584,6 @@ module$contents$goog$html$SafeScript_SafeScript.fromConstant = function(script) module$contents$goog$html$SafeScript_SafeScript.fromJson = function(val) { return module$contents$goog$html$SafeScript_SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(module$contents$goog$html$SafeScript_SafeScript.stringify_(val)); }; -module$contents$goog$html$SafeScript_SafeScript.prototype.getTypedStringValue = function() { - return this.privateDoNotAccessOrElseSafeScriptWrappedValue_.toString(); -}; module$contents$goog$html$SafeScript_SafeScript.unwrap = function(safeScript) { return module$contents$goog$html$SafeScript_SafeScript.unwrapTrustedScript(safeScript).toString(); }; @@ -7072,7 +7063,6 @@ var module$contents$goog$html$SafeStyleSheet_CONSTRUCTOR_TOKEN_PRIVATE = {}, mod throw Error("SafeStyleSheet is not meant to be built directly"); } this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_ = value; - this.implementsGoogStringTypedString = !0; }; module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.prototype.toString = function() { return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_.toString(); @@ -7118,9 +7108,6 @@ module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.fromConstant = function( (0,goog.asserts.assert)(!(0,goog.string.internal.contains)(styleSheetString, "<"), "Forbidden '<' character in style sheet string: " + styleSheetString); return module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(styleSheetString); }; -module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.prototype.getTypedStringValue = function() { - return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_; -}; module$contents$goog$html$SafeStyleSheet_SafeStyleSheet.unwrap = function(safeStyleSheet) { if (safeStyleSheet instanceof module$contents$goog$html$SafeStyleSheet_SafeStyleSheet && safeStyleSheet.constructor === module$contents$goog$html$SafeStyleSheet_SafeStyleSheet) { return safeStyleSheet.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_; @@ -7157,7 +7144,7 @@ module$contents$goog$html$SafeHtml_SafeHtml.unwrapTrustedHTML = function(safeHtm return "type_error:SafeHtml"; }; module$contents$goog$html$SafeHtml_SafeHtml.htmlEscape = function(textOrHtml) { - return textOrHtml instanceof module$contents$goog$html$SafeHtml_SafeHtml ? textOrHtml : module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.htmlEscape("object" == typeof textOrHtml && textOrHtml.implementsGoogStringTypedString ? textOrHtml.getTypedStringValue() : String(textOrHtml))); + return textOrHtml instanceof module$contents$goog$html$SafeHtml_SafeHtml ? textOrHtml : module$contents$goog$html$SafeHtml_SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.htmlEscape(String(textOrHtml))); }; module$contents$goog$html$SafeHtml_SafeHtml.htmlEscapePreservingNewlines = function(textOrHtml) { if (textOrHtml instanceof module$contents$goog$html$SafeHtml_SafeHtml) { @@ -7334,14 +7321,13 @@ function module$contents$goog$html$SafeHtml_getAttrNameAndValue(tagName, name, v } else if (value instanceof goog.html.SafeUrl) { value = goog.html.SafeUrl.unwrap(value); } else if ("string" === typeof value) { - value = goog.html.SafeUrl.sanitize(value).getTypedStringValue(); + value = goog.html.SafeUrl.sanitize(value).toString(); } else { throw Error(module$contents$goog$html$SafeHtml_SafeHtml.ENABLE_ERROR_MESSAGES ? 'Attribute "' + name + '" on tag "' + tagName + '" requires goog.html.SafeUrl, goog.string.Const, or string, value "' + value + '" given.' : ""); } } } - value.implementsGoogStringTypedString && (value = value.getTypedStringValue()); - goog.asserts.assert("string" === typeof value || "number" === typeof value, "String or number value expected, got " + typeof value + " with value: " + value); + goog.asserts.assert(value instanceof goog.html.SafeUrl || value instanceof goog.html.TrustedResourceUrl || value instanceof module$contents$goog$html$SafeStyle_SafeStyle || value instanceof module$contents$goog$html$SafeHtml_SafeHtml || "string" === typeof value || "number" === typeof value, "String or number value expected, got " + typeof value + " with value: " + value); return name + '="' + goog.string.internal.htmlEscape(String(value)) + '"'; } function module$contents$goog$html$SafeHtml_getStyleValue(value) { @@ -7466,36 +7452,33 @@ function module$contents$safevalues$restricted$reviewed_assertValidJustification throw Error("Calls to uncheckedconversion functions must go through security review. A justification must be provided to capture what security assumptions are being made. See go/unchecked-conversions"); } } -function module$contents$safevalues$restricted$reviewed_getJustificationDuringMigration(options) { - return "string" === typeof options ? options : options.justification; -} function module$contents$safevalues$restricted$reviewed_htmlSafeByReview(html, options) { - goog.DEBUG && module$contents$safevalues$restricted$reviewed_assertValidJustification(module$contents$safevalues$restricted$reviewed_getJustificationDuringMigration(options)); + goog.DEBUG && module$contents$safevalues$restricted$reviewed_assertValidJustification(options.justification); return module$contents$safevalues$internals$html_impl_createHtmlInternal(html); } module$exports$safevalues$restricted$reviewed.htmlSafeByReview = module$contents$safevalues$restricted$reviewed_htmlSafeByReview; function module$contents$safevalues$restricted$reviewed_scriptSafeByReview(script, options) { - goog.DEBUG && module$contents$safevalues$restricted$reviewed_assertValidJustification(module$contents$safevalues$restricted$reviewed_getJustificationDuringMigration(options)); + goog.DEBUG && module$contents$safevalues$restricted$reviewed_assertValidJustification(options.justification); return module$contents$safevalues$internals$script_impl_createScriptInternal(script); } module$exports$safevalues$restricted$reviewed.scriptSafeByReview = module$contents$safevalues$restricted$reviewed_scriptSafeByReview; function module$contents$safevalues$restricted$reviewed_resourceUrlSafeByReview(url, options) { - goog.DEBUG && module$contents$safevalues$restricted$reviewed_assertValidJustification(module$contents$safevalues$restricted$reviewed_getJustificationDuringMigration(options)); + goog.DEBUG && module$contents$safevalues$restricted$reviewed_assertValidJustification(options.justification); return module$contents$safevalues$internals$resource_url_impl_createResourceUrlInternal(url); } module$exports$safevalues$restricted$reviewed.resourceUrlSafeByReview = module$contents$safevalues$restricted$reviewed_resourceUrlSafeByReview; function module$contents$safevalues$restricted$reviewed_styleSheetSafeByReview(stylesheet, options) { - goog.DEBUG && module$contents$safevalues$restricted$reviewed_assertValidJustification(module$contents$safevalues$restricted$reviewed_getJustificationDuringMigration(options)); + goog.DEBUG && module$contents$safevalues$restricted$reviewed_assertValidJustification(options.justification); return module$contents$safevalues$internals$style_sheet_impl_createStyleSheetInternal(stylesheet); } module$exports$safevalues$restricted$reviewed.styleSheetSafeByReview = module$contents$safevalues$restricted$reviewed_styleSheetSafeByReview; function module$contents$safevalues$restricted$reviewed_urlSafeByReview(url, options) { - goog.DEBUG && module$contents$safevalues$restricted$reviewed_assertValidJustification(module$contents$safevalues$restricted$reviewed_getJustificationDuringMigration(options)); + goog.DEBUG && module$contents$safevalues$restricted$reviewed_assertValidJustification(options.justification); return module$contents$safevalues$internals$url_impl_createUrlInternal(url); } module$exports$safevalues$restricted$reviewed.urlSafeByReview = module$contents$safevalues$restricted$reviewed_urlSafeByReview; function module$contents$safevalues$restricted$reviewed_styleSafeByReview(style, options) { - goog.DEBUG && module$contents$safevalues$restricted$reviewed_assertValidJustification(module$contents$safevalues$restricted$reviewed_getJustificationDuringMigration(options)); + goog.DEBUG && module$contents$safevalues$restricted$reviewed_assertValidJustification(options.justification); return module$contents$safevalues$internals$style_impl_createStyleInternal(style); } module$exports$safevalues$restricted$reviewed.styleSafeByReview = module$contents$safevalues$restricted$reviewed_styleSafeByReview; @@ -7542,7 +7525,7 @@ goog.dom.safe.setInnerHtml = function(elem, html) { goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse(elem, html); }; goog.dom.safe.setInnerHtmlFromConstant = function(element, constHtml) { - goog.dom.safe.setInnerHtml(element, module$contents$safevalues$restricted$reviewed_htmlSafeByReview(goog.string.Const.unwrap(constHtml), "Constant HTML to be immediatelly used.")); + goog.dom.safe.setInnerHtml(element, module$contents$safevalues$restricted$reviewed_htmlSafeByReview(goog.string.Const.unwrap(constHtml), {justification:"Constant HTML to be immediatelly used."})); }; goog.dom.safe.setOuterHtml = function(elem, html) { elem.outerHTML = module$contents$goog$html$SafeHtml_SafeHtml.unwrapTrustedHTML(html); @@ -7816,7 +7799,7 @@ goog.string.unescapeEntitiesUsingDom_ = function(str, opt_document) { var n = Number("0" + entity.slice(1)); isNaN(n) || (value = String.fromCharCode(n)); } - value || (goog.dom.safe.setInnerHtml(div, module$contents$safevalues$restricted$reviewed_htmlSafeByReview(s + " ", "Single HTML entity.")), value = div.firstChild.nodeValue.slice(0, -1)); + value || (goog.dom.safe.setInnerHtml(div, module$contents$safevalues$restricted$reviewed_htmlSafeByReview(s + " ", {justification:"Single HTML entity."})), value = div.firstChild.nodeValue.slice(0, -1)); return seen[s] = value; }); }; @@ -8889,15 +8872,15 @@ module$exports$eeapiclient$multipart_request.MultipartRequest.prototype.addMetad this._metadataPayload += "Content-Type: application/json; charset=utf-8\r\n\r\n" + JSON.stringify(json) + ("\r\n--" + this._boundary + "\r\n"); }; module$exports$eeapiclient$multipart_request.MultipartRequest.prototype.build = function() { - var $jscomp$this = this, payload = "--" + this._boundary + "\r\n"; + var $jscomp$this$m667091202$6 = this, payload = "--" + this._boundary + "\r\n"; payload += this._metadataPayload; return Promise.all(this.files.map(function(f) { - return $jscomp$this.encodeFile(f); + return $jscomp$this$m667091202$6.encodeFile(f); })).then(function(filePayloads) { for (var $jscomp$iter$30 = $jscomp.makeIterator(filePayloads), $jscomp$key$filePayload = $jscomp$iter$30.next(); !$jscomp$key$filePayload.done; $jscomp$key$filePayload = $jscomp$iter$30.next()) { payload += $jscomp$key$filePayload.value; } - return payload += "\r\n--" + $jscomp$this._boundary + "--"; + return payload += "\r\n--" + $jscomp$this$m667091202$6._boundary + "--"; }); }; module$exports$eeapiclient$multipart_request.MultipartRequest.prototype.encodeFile = function(file) { @@ -8985,9 +8968,9 @@ module$exports$eeapiclient$promise_api_client.PromiseApiClient.prototype.$reques return this.$addHooksToRequest(requestParams, this.requestService.send(module$contents$eeapiclient$api_client_toMakeRequestParams(requestParams), responseCtor)); }; module$exports$eeapiclient$promise_api_client.PromiseApiClient.prototype.$uploadRequest = function(requestParams) { - var $jscomp$this = this, responseCtor = requestParams.responseCtor || void 0; + var $jscomp$this$1237977804$4 = this, responseCtor = requestParams.responseCtor || void 0; return this.$addHooksToRequest(requestParams, module$contents$eeapiclient$api_client_toMultipartMakeRequestParams(requestParams).then(function(params) { - return $jscomp$this.requestService.send(params, responseCtor); + return $jscomp$this$1237977804$4.requestService.send(params, responseCtor); })); }; var module$exports$eeapiclient$ee_api_client = {}, module$contents$eeapiclient$ee_api_client_module = module$contents$eeapiclient$ee_api_client_module || {id:"geo/gestalt/client/javascript/v1/ee_api_client.closure.js"}; @@ -15027,7 +15010,7 @@ goog.dom.createTable_ = function(doc, rows, columns, fillWithNbsp) { return table; }; goog.dom.constHtmlToNode = function(var_args) { - var stringArray = Array.prototype.map.call(arguments, goog.string.Const.unwrap), safeHtml = module$contents$safevalues$restricted$reviewed_htmlSafeByReview(stringArray.join(""), "Constant HTML string, that gets turned into a Node later, so it will be automatically balanced."); + var stringArray = Array.prototype.map.call(arguments, goog.string.Const.unwrap), safeHtml = module$contents$safevalues$restricted$reviewed_htmlSafeByReview(stringArray.join(""), {justification:"Constant HTML string, that gets turned into a Node later, so it will be automatically balanced."}); return goog.dom.safeHtmlToNode(safeHtml); }; goog.dom.safeHtmlToNode = function(html) { @@ -15744,9 +15727,9 @@ goog.debug.asyncStackTag = {}; var module$contents$goog$debug$asyncStackTag_createTask = goog.DEBUG && goog.global.console && goog.global.console.createTask ? goog.global.console.createTask.bind(goog.global.console) : void 0, module$contents$goog$debug$asyncStackTag_CONSOLE_TASK_SYMBOL = module$contents$goog$debug$asyncStackTag_createTask ? Symbol("consoleTask") : void 0; function module$contents$goog$debug$asyncStackTag_wrap(fn, name) { function wrappedFn() { - var args = $jscomp.getRestArguments.apply(0, arguments), $jscomp$this = this; + var args = $jscomp.getRestArguments.apply(0, arguments), $jscomp$this$1621498202$2 = this; return consoleTask.run(function() { - return fn.call.apply(fn, [$jscomp$this].concat($jscomp.arrayFromIterable(args))); + return fn.call.apply(fn, [$jscomp$this$1621498202$2].concat($jscomp.arrayFromIterable(args))); }); } name = void 0 === name ? "anonymous" : name; @@ -16281,9 +16264,9 @@ module$contents$goog$async$Throttle_Throttle.prototype.onTimer_ = function() { this.shouldFire_ && !this.pauseCount_ && (this.shouldFire_ = !1, this.doAction_()); }; module$contents$goog$async$Throttle_Throttle.prototype.doAction_ = function() { - var $jscomp$this = this; + var $jscomp$this$m92829211$8 = this; this.timer_ = goog.Timer.callOnce(function() { - return $jscomp$this.onTimer_(); + return $jscomp$this$m92829211$8.onTimer_(); }, this.interval_); var args = this.args_; this.args_ = null; @@ -16956,9 +16939,9 @@ third_party$javascript$closure$log$log$classdecl$var5.prototype.getLogRegistryEn return logRegistryEntry; }; third_party$javascript$closure$log$log$classdecl$var5.prototype.getAllLoggers = function() { - var $jscomp$this = this; + var $jscomp$this$17096019$34 = this; return Object.keys(this.entries).map(function(loggerName) { - return $jscomp$this.entries[loggerName].logger; + return $jscomp$this$17096019$34.entries[loggerName].logger; }); }; goog.log.LogRegistry_ = third_party$javascript$closure$log$log$classdecl$var5; @@ -17553,8 +17536,8 @@ function module$contents$safevalues$internals$attribute_impl_unwrapAttributePref throw Error(message); } module$exports$safevalues$internals$attribute_impl.unwrapAttributePrefix = module$contents$safevalues$internals$attribute_impl_unwrapAttributePrefix; -var $jscomp$templatelit$1274514361$0 = $jscomp.createTemplateTagFirstArg([""]), $jscomp$templatelit$1274514361$1 = $jscomp.createTemplateTagFirstArgWithRaw(["\x00"], ["\\0"]), $jscomp$templatelit$1274514361$2 = $jscomp.createTemplateTagFirstArgWithRaw(["\n"], ["\\n"]), $jscomp$templatelit$1274514361$3 = $jscomp.createTemplateTagFirstArgWithRaw(["\x00"], ["\\u0000"]), $jscomp$templatelit$1274514361$4 = $jscomp.createTemplateTagFirstArg([""]), $jscomp$templatelit$1274514361$5 = $jscomp.createTemplateTagFirstArgWithRaw(["\x00"], -["\\0"]), $jscomp$templatelit$1274514361$6 = $jscomp.createTemplateTagFirstArgWithRaw(["\n"], ["\\n"]), $jscomp$templatelit$1274514361$7 = $jscomp.createTemplateTagFirstArgWithRaw(["\x00"], ["\\u0000"]), module$contents$safevalues$internals$string_literal_module = module$contents$safevalues$internals$string_literal_module || {id:"third_party/javascript/safevalues/internals/string_literal.closure.js"}; +var $jscomp$templatelit$1274514361$5 = $jscomp.createTemplateTagFirstArg([""]), $jscomp$templatelit$1274514361$6 = $jscomp.createTemplateTagFirstArgWithRaw(["\x00"], ["\\0"]), $jscomp$templatelit$1274514361$7 = $jscomp.createTemplateTagFirstArgWithRaw(["\n"], ["\\n"]), $jscomp$templatelit$1274514361$8 = $jscomp.createTemplateTagFirstArgWithRaw(["\x00"], ["\\u0000"]), $jscomp$templatelit$1274514361$9 = $jscomp.createTemplateTagFirstArg([""]), $jscomp$templatelit$1274514361$10 = $jscomp.createTemplateTagFirstArgWithRaw(["\x00"], +["\\0"]), $jscomp$templatelit$1274514361$11 = $jscomp.createTemplateTagFirstArgWithRaw(["\n"], ["\\n"]), $jscomp$templatelit$1274514361$12 = $jscomp.createTemplateTagFirstArgWithRaw(["\x00"], ["\\u0000"]), module$contents$safevalues$internals$string_literal_module = module$contents$safevalues$internals$string_literal_module || {id:"third_party/javascript/safevalues/internals/string_literal.closure.js"}; function module$contents$safevalues$internals$string_literal_assertIsTemplateObject(templateObj, numExprs) { if (!module$contents$safevalues$internals$string_literal_isTemplateObject(templateObj) || numExprs + 1 !== templateObj.length) { throw new TypeError("\n ############################## ERROR ##############################\n\n It looks like you are trying to call a template tag function (fn`...`)\n using the normal function syntax (fn(...)), which is not supported.\n\n The functions in the safevalues library are not designed to be called\n like normal functions, and doing so invalidates the security guarantees\n that safevalues provides.\n\n If you are stuck and not sure how to proceed, please reach out to us\n instead through:\n - go/ise-hardening-yaqs (preferred) // LINE-INTERNAL\n - g/ise-hardening // LINE-INTERNAL\n - https://github.com/google/safevalues/issues\n\n ############################## ERROR ##############################"); @@ -17568,14 +17551,14 @@ function module$contents$safevalues$internals$string_literal_checkTranspiled(fn) return -1 === fn.toString().indexOf("`"); } var module$contents$safevalues$internals$string_literal_isTranspiled = module$contents$safevalues$internals$string_literal_checkTranspiled(function(tag) { - return tag($jscomp$templatelit$1274514361$0); + return tag($jscomp$templatelit$1274514361$5); }) || module$contents$safevalues$internals$string_literal_checkTranspiled(function(tag) { - return tag($jscomp$templatelit$1274514361$1); + return tag($jscomp$templatelit$1274514361$6); }) || module$contents$safevalues$internals$string_literal_checkTranspiled(function(tag) { - return tag($jscomp$templatelit$1274514361$2); + return tag($jscomp$templatelit$1274514361$7); }) || module$contents$safevalues$internals$string_literal_checkTranspiled(function(tag) { - return tag($jscomp$templatelit$1274514361$3); -}), module$contents$safevalues$internals$string_literal_frozenTSA = module$contents$safevalues$internals$string_literal_checkFrozen($jscomp$templatelit$1274514361$4) && module$contents$safevalues$internals$string_literal_checkFrozen($jscomp$templatelit$1274514361$5) && module$contents$safevalues$internals$string_literal_checkFrozen($jscomp$templatelit$1274514361$6) && module$contents$safevalues$internals$string_literal_checkFrozen($jscomp$templatelit$1274514361$7); + return tag($jscomp$templatelit$1274514361$8); +}), module$contents$safevalues$internals$string_literal_frozenTSA = module$contents$safevalues$internals$string_literal_checkFrozen($jscomp$templatelit$1274514361$9) && module$contents$safevalues$internals$string_literal_checkFrozen($jscomp$templatelit$1274514361$10) && module$contents$safevalues$internals$string_literal_checkFrozen($jscomp$templatelit$1274514361$11) && module$contents$safevalues$internals$string_literal_checkFrozen($jscomp$templatelit$1274514361$12); function module$contents$safevalues$internals$string_literal_isTemplateObject(templateObj) { return Array.isArray(templateObj) && Array.isArray(templateObj.raw) && templateObj.length === templateObj.raw.length && (module$contents$safevalues$internals$string_literal_isTranspiled || templateObj !== templateObj.raw) && (module$contents$safevalues$internals$string_literal_isTranspiled && !module$contents$safevalues$internals$string_literal_frozenTSA || module$contents$safevalues$internals$string_literal_checkFrozen(templateObj)) ? !0 : !1; @@ -17596,12 +17579,24 @@ function module$contents$safevalues$builders$attribute_builders_safeAttrPrefix(t } return module$contents$safevalues$internals$attribute_impl_createAttributePrefixInternal(attrPrefix); } -;var module$contents$safevalues$builders$document_fragment_builders_module = module$contents$safevalues$builders$document_fragment_builders_module || {id:"third_party/javascript/safevalues/builders/document_fragment_builders.closure.js"}; +;var module$exports$safevalues$builders$document_fragment_builders = {}, module$contents$safevalues$builders$document_fragment_builders_module = module$contents$safevalues$builders$document_fragment_builders_module || {id:"third_party/javascript/safevalues/builders/document_fragment_builders.closure.js"}; function module$contents$safevalues$builders$document_fragment_builders_safeFragment(templateObj) { + return module$contents$safevalues$builders$document_fragment_builders_htmlFragment(templateObj); +} +module$exports$safevalues$builders$document_fragment_builders.safeFragment = module$contents$safevalues$builders$document_fragment_builders_safeFragment; +function module$contents$safevalues$builders$document_fragment_builders_htmlFragment(templateObj) { goog.DEBUG && module$contents$safevalues$internals$string_literal_assertIsTemplateObject(templateObj, 0); return document.createRange().createContextualFragment(module$contents$safevalues$internals$html_impl_unwrapHtml(module$contents$safevalues$internals$html_impl_createHtmlInternal(templateObj[0]))); } -;var module$exports$safevalues$builders$style_sheet_builders = {}, module$contents$safevalues$builders$style_sheet_builders_module = module$contents$safevalues$builders$style_sheet_builders_module || {id:"third_party/javascript/safevalues/builders/style_sheet_builders.closure.js"}, module$contents$safevalues$builders$style_sheet_builders_Primitive; +module$exports$safevalues$builders$document_fragment_builders.htmlFragment = module$contents$safevalues$builders$document_fragment_builders_htmlFragment; +function module$contents$safevalues$builders$document_fragment_builders_svgFragment(templateObj) { + goog.DEBUG && module$contents$safevalues$internals$string_literal_assertIsTemplateObject(templateObj, 0); + var svgElem = document.createElementNS("http://www.w3.org/2000/svg", "svg"), range = document.createRange(); + range.selectNodeContents(svgElem); + return range.createContextualFragment(module$contents$safevalues$internals$html_impl_unwrapHtml(module$contents$safevalues$internals$html_impl_createHtmlInternal(templateObj[0]))); +} +module$exports$safevalues$builders$document_fragment_builders.svgFragment = module$contents$safevalues$builders$document_fragment_builders_svgFragment; +var module$exports$safevalues$builders$style_sheet_builders = {}, module$contents$safevalues$builders$style_sheet_builders_module = module$contents$safevalues$builders$style_sheet_builders_module || {id:"third_party/javascript/safevalues/builders/style_sheet_builders.closure.js"}, module$contents$safevalues$builders$style_sheet_builders_Primitive; module$exports$safevalues$builders$style_sheet_builders.safeStyleRule = function(templateObj) { var rest = $jscomp.getRestArguments.apply(1, arguments); goog.DEBUG && module$contents$safevalues$internals$string_literal_assertIsTemplateObject(templateObj, rest.length); @@ -17951,8 +17946,8 @@ module$exports$safevalues$builders$html_formatter.HtmlFormatter = function() { this.replacements = new Map(); }; module$exports$safevalues$builders$html_formatter.HtmlFormatter.prototype.format = function(format) { - var $jscomp$this = this, openedTags = [], marker = (0,module$exports$safevalues$builders$html_builders.htmlEscape)("_safevalues_format_marker_:").toString(), html = (0,module$exports$safevalues$builders$html_builders.htmlEscape)(format).toString().replace(new RegExp("\\{" + marker + "[\\w&#;]+\\}", "g"), function(match) { - return $jscomp$this.replaceFormattingString(openedTags, match); + var $jscomp$this$380122516$5 = this, openedTags = [], marker = (0,module$exports$safevalues$builders$html_builders.htmlEscape)("_safevalues_format_marker_:").toString(), html = (0,module$exports$safevalues$builders$html_builders.htmlEscape)(format).toString().replace(new RegExp("\\{" + marker + "[\\w&#;]+\\}", "g"), function(match) { + return $jscomp$this$380122516$5.replaceFormattingString(openedTags, match); }); if (0 !== openedTags.length) { if (goog.DEBUG) { @@ -18141,8 +18136,8 @@ module$exports$safevalues$builders$html_sanitizer$html_sanitizer.HtmlSanitizerIm return this.sanitizeToFragmentInternal(html, inertDocument); }; module$exports$safevalues$builders$html_sanitizer$html_sanitizer.HtmlSanitizerImpl.prototype.sanitizeToFragmentInternal = function(html, inertDocument) { - for (var $jscomp$this = this, dirtyFragment = module$contents$safevalues$builders$html_sanitizer$inert_fragment_createInertFragment(html, inertDocument), treeWalker = document.createTreeWalker(dirtyFragment, 5, function(n) { - return $jscomp$this.nodeFilter(n); + for (var $jscomp$this$m1803429925$10 = this, dirtyFragment = module$contents$safevalues$builders$html_sanitizer$inert_fragment_createInertFragment(html, inertDocument), treeWalker = document.createTreeWalker(dirtyFragment, 5, function(n) { + return $jscomp$this$m1803429925$10.nodeFilter(n); }, !1), currentNode = treeWalker.nextNode(), sanitizedFragment = inertDocument.createDocumentFragment(), sanitizedParent = sanitizedFragment; null !== currentNode;) { var sanitizedNode = void 0; if (module$contents$safevalues$builders$html_sanitizer$no_clobber_isText(currentNode)) { @@ -18602,7 +18597,9 @@ module$exports$safevalues$reporting$reporting.TEST_ONLY = {reset:function() { }}; var module$exports$safevalues$index = {}, module$contents$safevalues$index_module = module$contents$safevalues$index_module || {id:"third_party/javascript/safevalues/index.closure.js"}; module$exports$safevalues$index.safeAttrPrefix = module$contents$safevalues$builders$attribute_builders_safeAttrPrefix; +module$exports$safevalues$index.htmlFragment = module$contents$safevalues$builders$document_fragment_builders_htmlFragment; module$exports$safevalues$index.safeFragment = module$contents$safevalues$builders$document_fragment_builders_safeFragment; +module$exports$safevalues$index.svgFragment = module$contents$safevalues$builders$document_fragment_builders_svgFragment; module$exports$safevalues$index.concatHtmls = module$exports$safevalues$builders$html_builders.concatHtmls; module$exports$safevalues$index.doctypeHtml = module$exports$safevalues$builders$html_builders.doctypeHtml; module$exports$safevalues$index.htmlEscape = module$exports$safevalues$builders$html_builders.htmlEscape; @@ -18666,7 +18663,9 @@ module$exports$safevalues$index.createHtml = module$exports$safevalues$builders$ module$exports$safevalues$index.styleSheetToHtml = module$exports$safevalues$builders$html_builders.styleSheetToHtml; module$exports$safevalues$index.safeStyleRule = module$exports$safevalues$builders$style_sheet_builders.safeStyleRule; safevalues.safeAttrPrefix = module$contents$safevalues$builders$attribute_builders_safeAttrPrefix; +safevalues.htmlFragment = module$contents$safevalues$builders$document_fragment_builders_htmlFragment; safevalues.safeFragment = module$contents$safevalues$builders$document_fragment_builders_safeFragment; +safevalues.svgFragment = module$contents$safevalues$builders$document_fragment_builders_svgFragment; safevalues.concatHtmls = module$exports$safevalues$index.concatHtmls; safevalues.doctypeHtml = module$exports$safevalues$index.doctypeHtml; safevalues.htmlEscape = module$exports$safevalues$index.htmlEscape; @@ -18731,11 +18730,11 @@ safevalues.HtmlFormatter = module$exports$safevalues$builders$html_formatter.Htm safevalues.createHtml = module$exports$safevalues$index.createHtml; safevalues.styleSheetToHtml = module$exports$safevalues$index.styleSheetToHtml; safevalues.safeStyleRule = module$exports$safevalues$index.safeStyleRule; -var $jscomp$templatelit$294235699$0 = $jscomp.createTemplateTagFirstArg(["https://apis.google.com/js/client.js?onload=", ""]); +var $jscomp$templatelit$294235699$94 = $jscomp.createTemplateTagFirstArg(["https://apis.google.com/js/client.js?onload=", ""]); ee.apiclient = {}; var module$contents$ee$apiclient_apiclient = {}; ee.apiclient.VERSION = module$exports$ee$apiVersion.V1; -ee.apiclient.API_CLIENT_VERSION = "0.1.384"; +ee.apiclient.API_CLIENT_VERSION = "0.1.385"; ee.apiclient.NULL_VALUE = module$exports$eeapiclient$domain_object.NULL_VALUE; ee.apiclient.PromiseRequestService = module$exports$eeapiclient$promise_request_service.PromiseRequestService; ee.apiclient.MakeRequestParams = module$contents$eeapiclient$request_params_MakeRequestParams; @@ -18751,12 +18750,12 @@ module$contents$ee$apiclient_Call.prototype.withDetectPartialError = function(de return this; }; module$contents$ee$apiclient_Call.prototype.handle = function(response) { - var $jscomp$this = this; + var $jscomp$this$294235699$3 = this; if (response instanceof Promise) { if (this.callback) { var callback = function(result, error) { try { - return $jscomp$this.callback(result, error); + return $jscomp$this$294235699$3.callback(result, error); } catch (callbackError) { setTimeout(function() { throw callbackError; @@ -18835,7 +18834,7 @@ var module$contents$ee$apiclient_EERequestService = function(sync, retries) { }; $jscomp.inherits(module$contents$ee$apiclient_EERequestService, module$exports$eeapiclient$promise_request_service.PromiseRequestService); module$contents$ee$apiclient_EERequestService.prototype.send = function(params, responseCtor) { - var $jscomp$this = this; + var $jscomp$this$294235699$23 = this; module$contents$eeapiclient$request_params_processParams(params); var path = params.path || "", url = module$contents$ee$apiclient_apiclient.getSafeApiUrl() + path, args = module$contents$ee$apiclient_apiclient.makeRequest_(params.queryParams || {}), body = params.body ? JSON.stringify(params.body) : void 0; if (this.sync) { @@ -18849,7 +18848,7 @@ module$contents$ee$apiclient_EERequestService.prototype.send = function(params, return (new Promise(function(resolve, reject) { module$contents$ee$apiclient_apiclient.send(url, args, function(value, error) { error ? reject(error) : resolve(value); - }, params.httpMethod, body, $jscomp$this.retries, $jscomp$this.detectPartialError); + }, params.httpMethod, body, $jscomp$this$294235699$23.retries, $jscomp$this$294235699$23.detectPartialError); })).then(function(r) { return responseCtor ? module$contents$eeapiclient$domain_object_deserialize(responseCtor, r) : r; }); @@ -18867,7 +18866,7 @@ module$contents$ee$apiclient_BatchCall.prototype.withDetectPartialError = functi return this; }; module$contents$ee$apiclient_BatchCall.prototype.send = function(parts, getResponse) { - var $jscomp$this = this, batchUrl = module$contents$ee$apiclient_apiclient.getSafeApiUrl() + "/batch", body = parts.map(function($jscomp$destructuring$var40) { + var $jscomp$this$294235699$27 = this, batchUrl = module$contents$ee$apiclient_apiclient.getSafeApiUrl() + "/batch", body = parts.map(function($jscomp$destructuring$var40) { var $jscomp$destructuring$var41 = $jscomp.makeIterator($jscomp$destructuring$var40), id = $jscomp$destructuring$var41.next().value, $jscomp$destructuring$var42 = $jscomp.makeIterator($jscomp$destructuring$var41.next().value), partBody = $jscomp$destructuring$var42.next().value, ctor = $jscomp$destructuring$var42.next().value; return "--batch_EARTHENGINE_batch\r\nContent-Type: application/http\r\nContent-Transfer-Encoding: binary\r\nMIME-Version: 1.0\r\nContent-ID: <" + id + ">\r\n\r\n" + partBody + "\r\n"; }).join("") + "--batch_EARTHENGINE_batch--\r\n", deserializeResponses = function(response) { @@ -18879,7 +18878,7 @@ module$contents$ee$apiclient_BatchCall.prototype.send = function(parts, getRespo return getResponse ? getResponse(result) : result; }; return this.callback ? (module$contents$ee$apiclient_apiclient.send(batchUrl, null, function(result, err) { - return $jscomp$this.callback(err ? result : deserializeResponses(result), err); + return $jscomp$this$294235699$27.callback(err ? result : deserializeResponses(result), err); }, "multipart/mixed; boundary=batch_EARTHENGINE_batch", body, void 0, this.detectPartialError), null) : deserializeResponses(module$contents$ee$apiclient_apiclient.send(batchUrl, null, void 0, "multipart/mixed; boundary=batch_EARTHENGINE_batch", body, void 0, this.detectPartialError)); }; var module$contents$ee$apiclient_BatchRequestService = function() { @@ -19026,8 +19025,8 @@ module$contents$ee$apiclient_apiclient.send = function(path, params, callback, m var profileHookAtCallTime = module$contents$ee$apiclient_apiclient.profileHook_, contentType = "application/x-www-form-urlencoded"; body && (contentType = "application/json", method && method.startsWith("multipart") && (contentType = method, method = "POST")); method = method || "POST"; - var headers = {"Content-Type":contentType}, version = "0.1.384"; - "0.1.384" === version && (version = "latest"); + var headers = {"Content-Type":contentType}, version = "0.1.385"; + "0.1.385" === version && (version = "latest"); headers[module$contents$ee$apiclient_apiclient.API_CLIENT_VERSION_HEADER] = "ee-js/" + version; var authToken = module$contents$ee$apiclient_apiclient.getAuthToken(); if (null != authToken) { @@ -19150,7 +19149,7 @@ module$contents$ee$apiclient_apiclient.ensureAuthLibLoaded_ = function(callback) delete goog.global[callbackName]; done(); }; - goog.net.jsloader.safeLoad(module$contents$safevalues$builders$resource_url_builders_trustedResourceUrl($jscomp$templatelit$294235699$0, callbackName)); + goog.net.jsloader.safeLoad(module$contents$safevalues$builders$resource_url_builders_trustedResourceUrl($jscomp$templatelit$294235699$94, callbackName)); } }; module$contents$ee$apiclient_apiclient.handleAuthResult_ = function(success, error, result) { @@ -20260,15 +20259,15 @@ ee.Serializer.prototype.encodeForCloudApi_ = function(obj) { } }; ee.Serializer.prototype.makeReference = function(obj) { - var $jscomp$this = this, makeRef = function(result) { + var $jscomp$this$1175707268$21 = this, makeRef = function(result) { var hash = ee.Serializer.computeHash(result); - goog.isObject(obj) && $jscomp$this.hashes_.set(obj, hash); - if ($jscomp$this.encoded_[hash]) { - return $jscomp$this.encoded_[hash]; + goog.isObject(obj) && $jscomp$this$1175707268$21.hashes_.set(obj, hash); + if ($jscomp$this$1175707268$21.encoded_[hash]) { + return $jscomp$this$1175707268$21.encoded_[hash]; } - var name = String($jscomp$this.scope_.length); - $jscomp$this.scope_.push([name, result]); - return $jscomp$this.encoded_[hash] = name; + var name = String($jscomp$this$1175707268$21.scope_.length); + $jscomp$this$1175707268$21.scope_.push([name, result]); + return $jscomp$this$1175707268$21.encoded_[hash] = name; }; if (goog.isObject(obj) && this.encoded_[this.hashes_.get(obj)]) { return this.encoded_[this.hashes_.get(obj)]; @@ -20286,24 +20285,24 @@ ee.Serializer.prototype.makeReference = function(obj) { } if (Array.isArray(obj)) { return makeRef(ee.rpc_node.array(obj.map(function(x) { - return ee.rpc_node.reference($jscomp$this.makeReference(x)); + return ee.rpc_node.reference($jscomp$this$1175707268$21.makeReference(x)); }))); } if (goog.isObject(obj) && "function" !== typeof obj) { var values = {}; Object.keys(obj).sort().forEach(function(k) { - values[k] = ee.rpc_node.reference($jscomp$this.makeReference(obj[k])); + values[k] = ee.rpc_node.reference($jscomp$this$1175707268$21.makeReference(obj[k])); }); return makeRef(ee.rpc_node.dictionary(values)); } throw Error("Can't encode object: " + obj); }; var ExpressionOptimizer = function(rootReference, values, isCompound, sourceNodeMap) { - var $jscomp$this = this; + var $jscomp$this$1175707268$22 = this; this.rootReference = rootReference; this.values = {}; values.forEach(function(tuple) { - return $jscomp$this.values[tuple[0]] = tuple[1]; + return $jscomp$this$1175707268$22.values[tuple[0]] = tuple[1]; }); this.referenceCounts = isCompound ? this.countReferences() : null; this.optimizedValues = {}; @@ -20325,12 +20324,12 @@ ExpressionOptimizer.prototype.optimizeReference = function(ref) { return mappedRef; }; ExpressionOptimizer.prototype.optimizeValue = function(value, depth) { - var $jscomp$this = this, isConst = function(v) { + var $jscomp$this$1175707268$25 = this, isConst = function(v) { return null !== v.constantValue; }, serializeConst = function(v) { return v === module$exports$eeapiclient$domain_object.NULL_VALUE ? null : v; }, storeInSourceMap = function(parentValue, valueNode) { - $jscomp$this.sourceNodeMap && $jscomp$this.sourceNodeMap.has(parentValue) && !$jscomp$this.sourceNodeMap.has(valueNode) && $jscomp$this.sourceNodeMap.set(valueNode, $jscomp$this.sourceNodeMap.get(parentValue)); + $jscomp$this$1175707268$25.sourceNodeMap && $jscomp$this$1175707268$25.sourceNodeMap.has(parentValue) && !$jscomp$this$1175707268$25.sourceNodeMap.has(valueNode) && $jscomp$this$1175707268$25.sourceNodeMap.set(valueNode, $jscomp$this$1175707268$25.sourceNodeMap.get(parentValue)); return valueNode; }; if (isConst(value) || null != value.integerValue || null != value.bytesValue || null != value.argumentReference) { @@ -20350,7 +20349,7 @@ ExpressionOptimizer.prototype.optimizeValue = function(value, depth) { } if (null != value.arrayValue) { var arr = value.arrayValue.values.map(function(v) { - return $jscomp$this.optimizeValue(v, depth + 3); + return $jscomp$this$1175707268$25.optimizeValue(v, depth + 3); }), optimized$jscomp$1 = arr.every(isConst) ? ee.rpc_node.constant(arr.map(function(v) { return serializeConst(v.constantValue); })) : ee.rpc_node.array(arr); @@ -20383,8 +20382,8 @@ ExpressionOptimizer.isAlwaysLiftable = function(value) { return null !== constant ? constant === module$exports$eeapiclient$domain_object.NULL_VALUE || "number" === typeof constant || "boolean" === typeof constant : null != value.argumentReference; }; ExpressionOptimizer.prototype.countReferences = function() { - var $jscomp$this = this, counts = {}, visitReference = function(reference) { - counts[reference] ? counts[reference]++ : (counts[reference] = 1, visitValue($jscomp$this.values[reference])); + var $jscomp$this$1175707268$27 = this, counts = {}, visitReference = function(reference) { + counts[reference] ? counts[reference]++ : (counts[reference] = 1, visitValue($jscomp$this$1175707268$27.values[reference])); }, visitValue = function(value) { if (null != value.arrayValue) { value.arrayValue.values.forEach(visitValue); @@ -22761,11 +22760,11 @@ ee.Image.prototype.getInfo = function(opt_callback) { }; goog.exportProperty(ee.Image.prototype, "getInfo", ee.Image.prototype.getInfo); ee.Image.prototype.getMapId = function(opt_visParams, opt_callback) { - var $jscomp$this = this, args = ee.arguments.extractFromFunction(ee.Image.prototype.getMap, arguments), request = ee.data.images.applyVisualization(this, args.visParams); + var $jscomp$this$m870018051$6 = this, args = ee.arguments.extractFromFunction(ee.Image.prototype.getMap, arguments), request = ee.data.images.applyVisualization(this, args.visParams); if (args.callback) { var callback = args.callback; ee.data.getMapId(request, function(data, error) { - var mapId = data ? Object.assign(data, {image:$jscomp$this}) : void 0; + var mapId = data ? Object.assign(data, {image:$jscomp$this$m870018051$6}) : void 0; callback(mapId, error); }); } else { @@ -23165,7 +23164,7 @@ module$contents$ee$batch_ExportTask.create = function(exportArgs) { return new module$contents$ee$batch_ExportTask(config); }; module$contents$ee$batch_ExportTask.prototype.start = function(opt_success, opt_error) { - var $jscomp$this = this; + var $jscomp$this$m1704548930$3 = this; goog.asserts.assert(this.config_, "Task config must be specified for tasks to be started."); this.id = this.id || ee.data.newTaskId(1)[0]; goog.asserts.assertString(this.id, "Failed to obtain task ID."); @@ -23175,7 +23174,7 @@ module$contents$ee$batch_ExportTask.prototype.start = function(opt_success, opt_ opt_error(error); } else { var $jscomp$nullish$tmp11; - $jscomp$this.id = null != ($jscomp$nullish$tmp11 = response.taskId) ? $jscomp$nullish$tmp11 : null; + $jscomp$this$m1704548930$3.id = null != ($jscomp$nullish$tmp11 = response.taskId) ? $jscomp$nullish$tmp11 : null; opt_success(); } }); @@ -24263,9 +24262,9 @@ module$contents$ee$layers$AbstractOverlayStats_AbstractOverlayStats.prototype.ha return 0 < this.statsByZoom_.size; }; module$contents$ee$layers$AbstractOverlayStats_AbstractOverlayStats.prototype.getSummaryList = function() { - var $jscomp$this = this, summaryList = []; + var $jscomp$this$m1171058278$7 = this, summaryList = []; this.statsByZoom_.forEach(function(stats, zoom) { - return summaryList.push({layerId:$jscomp$this.uniqueId_, zoomLevel:zoom, tileLatencies:stats.tileLatencies, throttleCount:stats.throttleCount, errorCount:stats.errorCount}); + return summaryList.push({layerId:$jscomp$this$m1171058278$7.uniqueId_, zoomLevel:zoom, tileLatencies:stats.tileLatencies, throttleCount:stats.throttleCount, errorCount:stats.errorCount}); }); return summaryList; }; @@ -25451,7 +25450,7 @@ ee.layers.AbstractTile.prototype.getDiv = function() { return this.div; }; ee.layers.AbstractTile.prototype.startLoad = function() { - var $jscomp$this = this; + var $jscomp$this$m442005483$27 = this; if (!this.isRetrying_ && this.getStatus() == ee.layers.AbstractTile.Status.LOADING) { throw Error("startLoad() can only be invoked once. Use retryLoad() after the first attempt."); } @@ -25460,24 +25459,24 @@ ee.layers.AbstractTile.prototype.startLoad = function() { this.xhrIo_ = new goog.net.XhrIo(); this.xhrIo_.setResponseType(goog.net.XhrIo.ResponseType.BLOB); this.xhrIo_.listen(goog.net.EventType.COMPLETE, function(event) { - var blob = $jscomp$this.xhrIo_.getResponse(), status = $jscomp$this.xhrIo_.getStatus(), HttpStatus = goog.net.HttpStatus; - status == HttpStatus.TOO_MANY_REQUESTS && $jscomp$this.setStatus(ee.layers.AbstractTile.Status.THROTTLED); + var blob = $jscomp$this$m442005483$27.xhrIo_.getResponse(), status = $jscomp$this$m442005483$27.xhrIo_.getStatus(), HttpStatus = goog.net.HttpStatus; + status == HttpStatus.TOO_MANY_REQUESTS && $jscomp$this$m442005483$27.setStatus(ee.layers.AbstractTile.Status.THROTTLED); if (HttpStatus.isSuccess(status)) { var sourceResponseHeaders = {}; - module$contents$goog$object_forEach($jscomp$this.xhrIo_.getResponseHeaders(), function(value, name) { + module$contents$goog$object_forEach($jscomp$this$m442005483$27.xhrIo_.getResponseHeaders(), function(value, name) { sourceResponseHeaders[name.toLowerCase()] = value; }); - $jscomp$this.sourceResponseHeaders = sourceResponseHeaders; - $jscomp$this.sourceData = blob; - $jscomp$this.finishLoad(); + $jscomp$this$m442005483$27.sourceResponseHeaders = sourceResponseHeaders; + $jscomp$this$m442005483$27.sourceData = blob; + $jscomp$this$m442005483$27.finishLoad(); } else if (blob) { var reader = new goog.fs.FileReader(); reader.listen(goog.fs.FileReader.EventType.LOAD_END, function() { - $jscomp$this.retryLoad(reader.getResult()); + $jscomp$this$m442005483$27.retryLoad(reader.getResult()); }, void 0); reader.readAsText(blob); } else { - $jscomp$this.retryLoad("Failed to load tile."); + $jscomp$this$m442005483$27.retryLoad("Failed to load tile."); } }, !1); this.xhrIo_.listenOnce(goog.net.EventType.READY, goog.partial(module$contents$goog$dispose_dispose, this.xhrIo_)); @@ -26535,13 +26534,13 @@ ee.data.Profiler.prototype.removeProfile_ = function(profileId) { 1 < count ? this.profileIds_[profileId]-- : void 0 !== count && (delete this.profileIds_[profileId], this.throttledRefresh_.start()); }; ee.data.Profiler.prototype.refresh_ = function(retryAttempt) { - var $jscomp$this = this; + var $jscomp$this$491634829$13 = this; retryAttempt = void 0 === retryAttempt ? 0 : retryAttempt; var marker = {}; this.lastRefreshToken_ = marker; var handleResponse = function(result, error) { - marker == $jscomp$this.lastRefreshToken_ && (error && "number" === typeof retryAttempt && retryAttempt < $jscomp$this.MAX_RETRY_COUNT_ ? goog.Timer.callOnce(goog.bind($jscomp$this.refresh_, $jscomp$this, retryAttempt + 1), 2 * ee.data.Profiler.DELAY_BEFORE_REFRESH_) : ($jscomp$this.profileError_ = error || null, $jscomp$this.profileData_ = error ? ee.data.Profiler.getEmptyProfile_($jscomp$this.format_) : result, $jscomp$this.lastRefreshToken_ = null, $jscomp$this.dispatchEvent(ee.data.Profiler.EventType.STATE_CHANGED), - $jscomp$this.dispatchEvent(ee.data.Profiler.EventType.DATA_CHANGED))); + marker == $jscomp$this$491634829$13.lastRefreshToken_ && (error && "number" === typeof retryAttempt && retryAttempt < $jscomp$this$491634829$13.MAX_RETRY_COUNT_ ? goog.Timer.callOnce(goog.bind($jscomp$this$491634829$13.refresh_, $jscomp$this$491634829$13, retryAttempt + 1), 2 * ee.data.Profiler.DELAY_BEFORE_REFRESH_) : ($jscomp$this$491634829$13.profileError_ = error || null, $jscomp$this$491634829$13.profileData_ = error ? ee.data.Profiler.getEmptyProfile_($jscomp$this$491634829$13.format_) : + result, $jscomp$this$491634829$13.lastRefreshToken_ = null, $jscomp$this$491634829$13.dispatchEvent(ee.data.Profiler.EventType.STATE_CHANGED), $jscomp$this$491634829$13.dispatchEvent(ee.data.Profiler.EventType.DATA_CHANGED))); }, ids = module$contents$goog$object_getKeys(this.profileIds_); 0 === ids.length ? handleResponse(ee.data.Profiler.getEmptyProfile_(this.format_), void 0) : (ee.ApiFunction._apply(this.showInternal_ ? "Profile.getProfilesInternal" : "Profile.getProfiles", {ids:ids, format:this.format_.toString()}).getInfo(handleResponse), this.dispatchEvent(ee.data.Profiler.EventType.STATE_CHANGED)); }; @@ -26584,29 +26583,28 @@ ee.data.Profiler.Format.prototype.toString = function() { ee.data.Profiler.Format.TEXT = new ee.data.Profiler.Format("text"); ee.data.Profiler.Format.JSON = new ee.data.Profiler.Format("json"); (function() { - var exportedFnInfo = {}, orderedFnNames = "ee.ApiFunction._call ee.ApiFunction.lookup ee.ApiFunction._apply ee.batch.Export.table.toDrive ee.batch.Export.image.toCloudStorage ee.batch.Export.table.toCloudStorage ee.batch.Export.videoMap.toCloudStorage ee.batch.Export.table.toFeatureView ee.batch.Export.image.toDrive ee.batch.Export.table.toBigQuery ee.batch.Export.map.toCloudStorage ee.batch.Export.image.toAsset ee.batch.Export.table.toAsset ee.batch.Export.video.toCloudStorage ee.batch.Export.video.toDrive ee.batch.Export.classifier.toAsset ee.Collection.prototype.filter ee.Collection.prototype.limit ee.Collection.prototype.sort ee.Collection.prototype.filterMetadata ee.Collection.prototype.filterBounds ee.Collection.prototype.filterDate ee.Collection.prototype.map ee.Collection.prototype.iterate ee.ComputedObject.prototype.aside ee.ComputedObject.prototype.evaluate ee.ComputedObject.prototype.getInfo ee.ComputedObject.prototype.serialize ee.data.cancelTask ee.data.setDefaultWorkloadTag ee.data.getThumbId ee.data.getVideoThumbId ee.data.getTaskStatus ee.data.startIngestion ee.data.resetWorkloadTag ee.data.updateAsset ee.data.updateTask ee.data.getFilmstripThumbId ee.data.startProcessing ee.data.createFolder ee.data.makeThumbUrl ee.data.getList ee.data.setAssetAcl ee.data.authenticateViaOauth ee.data.renameAsset ee.data.listAssets ee.data.getMapId ee.data.getTaskList ee.data.setAssetProperties ee.data.getDownloadId ee.data.copyAsset ee.data.makeDownloadUrl ee.data.authenticate ee.data.getTileUrl ee.data.startTableIngestion ee.data.getTaskListWithLimit ee.data.listImages ee.data.deleteAsset ee.data.listOperations ee.data.getAssetRootQuota ee.data.cancelOperation ee.data.getTableDownloadId ee.data.listBuckets ee.data.getAssetAcl ee.data.authenticateViaPopup ee.data.makeTableDownloadUrl ee.data.getFeatureViewTilesKey ee.data.getWorkloadTag ee.data.getAsset ee.data.getAssetRoots ee.data.getOperation ee.data.listFeatures ee.data.getInfo ee.data.authenticateViaPrivateKey ee.data.newTaskId ee.data.createAssetHome ee.data.createAsset ee.data.setWorkloadTag ee.data.computeValue ee.Date ee.Deserializer.decode ee.Deserializer.decodeCloudApi ee.Deserializer.fromCloudApiJSON ee.Deserializer.fromJSON ee.Dictionary ee.apply ee.TILE_SIZE ee.initialize ee.call ee.reset ee.InitState ee.Algorithms ee.Element.prototype.set ee.Encodable.SourceFrame ee.Feature ee.Feature.prototype.getInfo ee.Feature.prototype.getMapId ee.Feature.prototype.getMap ee.FeatureCollection ee.FeatureCollection.prototype.getMap ee.FeatureCollection.prototype.getDownloadURL ee.FeatureCollection.prototype.getMapId ee.FeatureCollection.prototype.getInfo ee.FeatureCollection.prototype.select ee.Filter.lte ee.Filter.gte ee.Filter.prototype.not ee.Filter ee.Filter.eq ee.Filter.date ee.Filter.metadata ee.Filter.bounds ee.Filter.and ee.Filter.gt ee.Filter.neq ee.Filter.lt ee.Filter.inList ee.Filter.or ee.Function.prototype.call ee.Function.prototype.apply ee.Geometry.MultiPoint ee.Geometry.BBox ee.Geometry.LinearRing ee.Geometry.prototype.toGeoJSONString ee.Geometry.LineString ee.Geometry.Rectangle ee.Geometry.Point ee.Geometry.Polygon ee.Geometry.prototype.serialize ee.Geometry.MultiPolygon ee.Geometry.MultiLineString ee.Geometry.prototype.toGeoJSON ee.Geometry ee.Image.cat ee.Image.prototype.select ee.Image.prototype.getThumbURL ee.Image.rgb ee.Image ee.Image.prototype.clip ee.Image.prototype.getMap ee.Image.prototype.getMapId ee.Image.prototype.expression ee.Image.prototype.getDownloadURL ee.Image.prototype.getThumbId ee.Image.prototype.rename ee.Image.prototype.getInfo ee.ImageCollection.prototype.select ee.ImageCollection.prototype.linkCollection ee.ImageCollection.prototype.getVideoThumbURL ee.ImageCollection.prototype.first ee.ImageCollection.prototype.getMap ee.ImageCollection.prototype.getFilmstripThumbURL ee.ImageCollection.prototype.getMapId ee.ImageCollection ee.ImageCollection.prototype.getInfo ee.List ee.Number ee.Serializer.encodeCloudApi ee.Serializer.toJSON ee.Serializer.toReadableCloudApiJSON ee.Serializer.toReadableJSON ee.Serializer.encodeCloudApiPretty ee.Serializer.encode ee.Serializer.toCloudApiJSON ee.String ee.Terrain".split(" "), - orderedParamLists = [["name", "var_args"], ["name"], ["name", "namedArgs"], "collection opt_description opt_folder opt_fileNamePrefix opt_fileFormat opt_selectors opt_maxVertices".split(" "), "image opt_description opt_bucket opt_fileNamePrefix opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_shardSize opt_fileDimensions opt_skipEmptyTiles opt_fileFormat opt_formatOptions".split(" "), "collection opt_description opt_bucket opt_fileNamePrefix opt_fileFormat opt_selectors opt_maxVertices".split(" "), - "collection opt_description opt_bucket opt_fileNamePrefix opt_framesPerSecond opt_writePublicTiles opt_minZoom opt_maxZoom opt_scale opt_region opt_skipEmptyTiles opt_minTimeMachineZoomSubset opt_maxTimeMachineZoomSubset opt_tileWidth opt_tileHeight opt_tileStride opt_videoFormat opt_version opt_mapsApiKey opt_bucketCorsUris".split(" "), "collection opt_description opt_assetId opt_maxFeaturesPerTile opt_thinningStrategy opt_thinningRanking opt_zOrderRanking".split(" "), "image opt_description opt_folder opt_fileNamePrefix opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_shardSize opt_fileDimensions opt_skipEmptyTiles opt_fileFormat opt_formatOptions".split(" "), - "collection opt_description opt_table opt_overwrite opt_append opt_selectors opt_maxVertices".split(" "), "image opt_description opt_bucket opt_fileFormat opt_path opt_writePublicTiles opt_scale opt_maxZoom opt_minZoom opt_region opt_skipEmptyTiles opt_mapsApiKey opt_bucketCorsUris".split(" "), "image opt_description opt_assetId opt_pyramidingPolicy opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_shardSize".split(" "), ["collection", "opt_description", "opt_assetId", - "opt_maxVertices"], "collection opt_description opt_bucket opt_fileNamePrefix opt_framesPerSecond opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_maxFrames".split(" "), "collection opt_description opt_folder opt_fileNamePrefix opt_framesPerSecond opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_maxFrames".split(" "), ["classifier", "opt_description", "opt_assetId"], ["filter"], ["max", "opt_property", "opt_ascending"], ["property", "opt_ascending"], - ["name", "operator", "value"], ["geometry"], ["start", "opt_end"], ["algorithm", "opt_dropNulls"], ["algorithm", "opt_first"], ["func", "var_args"], ["callback"], ["opt_callback"], ["legacy"], ["taskId", "opt_callback"], ["tag"], ["params", "opt_callback"], ["params", "opt_callback"], ["taskId", "opt_callback"], ["taskId", "request", "opt_callback"], ["opt_resetDefault"], ["assetId", "asset", "updateFields", "opt_callback"], ["taskId", "action", "opt_callback"], ["params", "opt_callback"], ["taskId", - "params", "opt_callback"], ["path", "opt_force", "opt_callback"], ["id"], ["params", "opt_callback"], ["assetId", "aclUpdate", "opt_callback"], "clientId success opt_error opt_extraScopes opt_onImmediateFailed opt_suppressDefaultScopes".split(" "), ["sourceId", "destinationId", "opt_callback"], ["parent", "opt_params", "opt_callback"], ["params", "opt_callback"], ["opt_callback"], ["assetId", "properties", "opt_callback"], ["params", "opt_callback"], ["sourceId", "destinationId", "opt_overwrite", - "opt_callback"], ["id"], ["clientId", "success", "opt_error", "opt_extraScopes", "opt_onImmediateFailed"], ["id", "x", "y", "z"], ["taskId", "request", "opt_callback"], ["opt_limit", "opt_callback"], ["parent", "opt_params", "opt_callback"], ["assetId", "opt_callback"], ["opt_limit", "opt_callback"], ["rootId", "opt_callback"], ["operationName", "opt_callback"], ["params", "opt_callback"], ["project", "opt_callback"], ["assetId", "opt_callback"], ["opt_success", "opt_error"], ["id"], ["params", - "opt_callback"], [], ["id", "opt_callback"], ["opt_callback"], ["operationName", "opt_callback"], ["asset", "params", "opt_callback"], ["id", "opt_callback"], ["privateKey", "opt_success", "opt_error", "opt_extraScopes", "opt_suppressDefaultScopes"], ["opt_count", "opt_callback"], ["requestedId", "opt_callback"], ["value", "opt_path", "opt_force", "opt_properties", "opt_callback"], ["tag"], ["obj", "opt_callback"], ["date", "opt_tz"], ["json"], ["json"], ["json"], ["json"], ["opt_dict"], ["func", - "namedArgs"], [], "opt_baseurl opt_tileurl opt_successCallback opt_errorCallback opt_xsrfToken opt_project".split(" "), ["func", "var_args"], [], [], [], ["var_args"], [], ["geometry", "opt_properties"], ["opt_callback"], ["opt_visParams", "opt_callback"], ["opt_visParams", "opt_callback"], ["args", "opt_column"], ["opt_visParams", "opt_callback"], ["opt_format", "opt_selectors", "opt_filename", "opt_callback"], ["opt_visParams", "opt_callback"], ["opt_callback"], ["propertySelectors", "opt_newProperties", - "opt_retainGeometry"], ["name", "value"], ["name", "value"], [], ["opt_filter"], ["name", "value"], ["start", "opt_end"], ["name", "operator", "value"], ["geometry", "opt_errorMargin"], ["var_args"], ["name", "value"], ["name", "value"], ["name", "value"], ["opt_leftField", "opt_rightValue", "opt_rightField", "opt_leftValue"], ["var_args"], ["var_args"], ["namedArgs"], ["coords", "opt_proj"], ["west", "south", "east", "north"], ["coords", "opt_proj", "opt_geodesic", "opt_maxError"], [], ["coords", - "opt_proj", "opt_geodesic", "opt_maxError"], ["coords", "opt_proj", "opt_geodesic", "opt_evenOdd"], ["coords", "opt_proj"], ["coords", "opt_proj", "opt_geodesic", "opt_maxError", "opt_evenOdd"], ["legacy"], ["coords", "opt_proj", "opt_geodesic", "opt_maxError", "opt_evenOdd"], ["coords", "opt_proj", "opt_geodesic", "opt_maxError"], [], ["geoJson", "opt_proj", "opt_geodesic", "opt_evenOdd"], ["var_args"], ["var_args"], ["params", "opt_callback"], ["r", "g", "b"], ["opt_args"], ["geometry"], ["opt_visParams", - "opt_callback"], ["opt_visParams", "opt_callback"], ["expression", "opt_map"], ["params", "opt_callback"], ["params", "opt_callback"], ["var_args"], ["opt_callback"], ["selectors", "opt_names"], ["imageCollection", "opt_linkedBands", "opt_linkedProperties", "opt_matchPropertyName"], ["params", "opt_callback"], [], ["opt_visParams", "opt_callback"], ["params", "opt_callback"], ["opt_visParams", "opt_callback"], ["args"], ["opt_callback"], ["list"], ["number"], ["obj"], ["obj"], ["obj"], ["obj"], - ["obj"], ["obj", "opt_isCompound"], ["obj"], ["string"], []]; - [ee.ApiFunction._call, ee.ApiFunction.lookup, ee.ApiFunction._apply, module$contents$ee$batch_Export.table.toDrive, module$contents$ee$batch_Export.image.toCloudStorage, module$contents$ee$batch_Export.table.toCloudStorage, module$contents$ee$batch_Export.videoMap.toCloudStorage, module$contents$ee$batch_Export.table.toFeatureView, module$contents$ee$batch_Export.image.toDrive, module$contents$ee$batch_Export.table.toBigQuery, module$contents$ee$batch_Export.map.toCloudStorage, module$contents$ee$batch_Export.image.toAsset, - module$contents$ee$batch_Export.table.toAsset, module$contents$ee$batch_Export.video.toCloudStorage, module$contents$ee$batch_Export.video.toDrive, module$contents$ee$batch_Export.classifier.toAsset, ee.Collection.prototype.filter, ee.Collection.prototype.limit, ee.Collection.prototype.sort, ee.Collection.prototype.filterMetadata, ee.Collection.prototype.filterBounds, ee.Collection.prototype.filterDate, ee.Collection.prototype.map, ee.Collection.prototype.iterate, ee.ComputedObject.prototype.aside, - ee.ComputedObject.prototype.evaluate, ee.ComputedObject.prototype.getInfo, ee.ComputedObject.prototype.serialize, ee.data.cancelTask, ee.data.setDefaultWorkloadTag, ee.data.getThumbId, ee.data.getVideoThumbId, ee.data.getTaskStatus, ee.data.startIngestion, ee.data.resetWorkloadTag, ee.data.updateAsset, ee.data.updateTask, ee.data.getFilmstripThumbId, ee.data.startProcessing, ee.data.createFolder, ee.data.makeThumbUrl, ee.data.getList, ee.data.setAssetAcl, ee.data.authenticateViaOauth, ee.data.renameAsset, - ee.data.listAssets, ee.data.getMapId, ee.data.getTaskList, ee.data.setAssetProperties, ee.data.getDownloadId, ee.data.copyAsset, ee.data.makeDownloadUrl, ee.data.authenticate, ee.data.getTileUrl, ee.data.startTableIngestion, ee.data.getTaskListWithLimit, ee.data.listImages, ee.data.deleteAsset, ee.data.listOperations, ee.data.getAssetRootQuota, ee.data.cancelOperation, ee.data.getTableDownloadId, ee.data.listBuckets, ee.data.getAssetAcl, ee.data.authenticateViaPopup, ee.data.makeTableDownloadUrl, - ee.data.getFeatureViewTilesKey, ee.data.getWorkloadTag, ee.data.getAsset, ee.data.getAssetRoots, ee.data.getOperation, ee.data.listFeatures, ee.data.getInfo, ee.data.authenticateViaPrivateKey, ee.data.newTaskId, ee.data.createAssetHome, ee.data.createAsset, ee.data.setWorkloadTag, ee.data.computeValue, ee.Date, ee.Deserializer.decode, ee.Deserializer.decodeCloudApi, ee.Deserializer.fromCloudApiJSON, ee.Deserializer.fromJSON, ee.Dictionary, ee.apply, ee.TILE_SIZE, ee.initialize, ee.call, ee.reset, - ee.InitState, ee.Algorithms, ee.Element.prototype.set, ee.Encodable.SourceFrame, ee.Feature, ee.Feature.prototype.getInfo, ee.Feature.prototype.getMapId, ee.Feature.prototype.getMap, ee.FeatureCollection, ee.FeatureCollection.prototype.getMap, ee.FeatureCollection.prototype.getDownloadURL, ee.FeatureCollection.prototype.getMapId, ee.FeatureCollection.prototype.getInfo, ee.FeatureCollection.prototype.select, ee.Filter.lte, ee.Filter.gte, ee.Filter.prototype.not, ee.Filter, ee.Filter.eq, ee.Filter.date, - ee.Filter.metadata, ee.Filter.bounds, ee.Filter.and, ee.Filter.gt, ee.Filter.neq, ee.Filter.lt, ee.Filter.inList, ee.Filter.or, ee.Function.prototype.call, ee.Function.prototype.apply, ee.Geometry.MultiPoint, ee.Geometry.BBox, ee.Geometry.LinearRing, ee.Geometry.prototype.toGeoJSONString, ee.Geometry.LineString, ee.Geometry.Rectangle, ee.Geometry.Point, ee.Geometry.Polygon, ee.Geometry.prototype.serialize, ee.Geometry.MultiPolygon, ee.Geometry.MultiLineString, ee.Geometry.prototype.toGeoJSON, ee.Geometry, - ee.Image.cat, ee.Image.prototype.select, ee.Image.prototype.getThumbURL, ee.Image.rgb, ee.Image, ee.Image.prototype.clip, ee.Image.prototype.getMap, ee.Image.prototype.getMapId, ee.Image.prototype.expression, ee.Image.prototype.getDownloadURL, ee.Image.prototype.getThumbId, ee.Image.prototype.rename, ee.Image.prototype.getInfo, ee.ImageCollection.prototype.select, ee.ImageCollection.prototype.linkCollection, ee.ImageCollection.prototype.getVideoThumbURL, ee.ImageCollection.prototype.first, ee.ImageCollection.prototype.getMap, - ee.ImageCollection.prototype.getFilmstripThumbURL, ee.ImageCollection.prototype.getMapId, ee.ImageCollection, ee.ImageCollection.prototype.getInfo, ee.List, ee.Number, ee.Serializer.encodeCloudApi, ee.Serializer.toJSON, ee.Serializer.toReadableCloudApiJSON, ee.Serializer.toReadableJSON, ee.Serializer.encodeCloudApiPretty, ee.Serializer.encode, ee.Serializer.toCloudApiJSON, ee.String, ee.Terrain].forEach(function(fn, i) { + var exportedFnInfo = {}, orderedFnNames = "ee.ApiFunction._apply ee.ApiFunction.lookup ee.ApiFunction._call ee.batch.Export.image.toCloudStorage ee.batch.Export.table.toCloudStorage ee.batch.Export.videoMap.toCloudStorage ee.batch.Export.table.toFeatureView ee.batch.Export.image.toDrive ee.batch.Export.table.toBigQuery ee.batch.Export.map.toCloudStorage ee.batch.Export.video.toCloudStorage ee.batch.Export.video.toDrive ee.batch.Export.table.toAsset ee.batch.Export.image.toAsset ee.batch.Export.classifier.toAsset ee.batch.Export.table.toDrive ee.Collection.prototype.filterMetadata ee.Collection.prototype.filterBounds ee.Collection.prototype.iterate ee.Collection.prototype.filter ee.Collection.prototype.filterDate ee.Collection.prototype.map ee.Collection.prototype.sort ee.Collection.prototype.limit ee.ComputedObject.prototype.getInfo ee.ComputedObject.prototype.serialize ee.ComputedObject.prototype.aside ee.ComputedObject.prototype.evaluate ee.data.setAssetProperties ee.data.renameAsset ee.data.authenticateViaOauth ee.data.copyAsset ee.data.getMapId ee.data.getAssetRootQuota ee.data.getTaskList ee.data.deleteAsset ee.data.startTableIngestion ee.data.listImages ee.data.getDownloadId ee.data.makeDownloadUrl ee.data.authenticate ee.data.getWorkloadTag ee.data.getTileUrl ee.data.getTaskListWithLimit ee.data.cancelOperation ee.data.getFilmstripThumbId ee.data.getAssetAcl ee.data.listBuckets ee.data.listOperations ee.data.getAsset ee.data.getTableDownloadId ee.data.setWorkloadTag ee.data.authenticateViaPopup ee.data.getAssetRoots ee.data.getFeatureViewTilesKey ee.data.makeTableDownloadUrl ee.data.getInfo ee.data.setDefaultWorkloadTag ee.data.createAssetHome ee.data.createAsset ee.data.listFeatures ee.data.getOperation ee.data.resetWorkloadTag ee.data.authenticateViaPrivateKey ee.data.newTaskId ee.data.updateAsset ee.data.computeValue ee.data.cancelTask ee.data.startIngestion ee.data.getThumbId ee.data.setAssetAcl ee.data.getVideoThumbId ee.data.createFolder ee.data.makeThumbUrl ee.data.getTaskStatus ee.data.updateTask ee.data.getList ee.data.startProcessing ee.data.listAssets ee.Date ee.Deserializer.fromJSON ee.Deserializer.fromCloudApiJSON ee.Deserializer.decodeCloudApi ee.Deserializer.decode ee.Dictionary ee.TILE_SIZE ee.initialize ee.reset ee.call ee.Algorithms ee.InitState ee.apply ee.Element.prototype.set ee.Encodable.SourceFrame ee.Feature.prototype.getMap ee.Feature ee.Feature.prototype.getInfo ee.Feature.prototype.getMapId ee.FeatureCollection.prototype.select ee.FeatureCollection ee.FeatureCollection.prototype.getDownloadURL ee.FeatureCollection.prototype.getInfo ee.FeatureCollection.prototype.getMap ee.FeatureCollection.prototype.getMapId ee.Filter.gt ee.Filter.lt ee.Filter.neq ee.Filter.or ee.Filter.inList ee.Filter.lte ee.Filter.prototype.not ee.Filter.gte ee.Filter ee.Filter.eq ee.Filter.date ee.Filter.metadata ee.Filter.and ee.Filter.bounds ee.Function.prototype.call ee.Function.prototype.apply ee.Geometry ee.Geometry.prototype.serialize ee.Geometry.Polygon ee.Geometry.Point ee.Geometry.Rectangle ee.Geometry.LineString ee.Geometry.prototype.toGeoJSON ee.Geometry.LinearRing ee.Geometry.MultiLineString ee.Geometry.prototype.toGeoJSONString ee.Geometry.MultiPoint ee.Geometry.BBox ee.Geometry.MultiPolygon ee.Image.prototype.getThumbURL ee.Image.rgb ee.Image.prototype.clip ee.Image.prototype.rename ee.Image ee.Image.prototype.getDownloadURL ee.Image.cat ee.Image.prototype.select ee.Image.prototype.getInfo ee.Image.prototype.getMapId ee.Image.prototype.getMap ee.Image.prototype.getThumbId ee.Image.prototype.expression ee.ImageCollection.prototype.getMap ee.ImageCollection.prototype.first ee.ImageCollection.prototype.getVideoThumbURL ee.ImageCollection.prototype.getInfo ee.ImageCollection.prototype.select ee.ImageCollection.prototype.linkCollection ee.ImageCollection.prototype.getFilmstripThumbURL ee.ImageCollection ee.ImageCollection.prototype.getMapId ee.List ee.Number ee.Serializer.encode ee.Serializer.toCloudApiJSON ee.Serializer.encodeCloudApi ee.Serializer.toJSON ee.Serializer.toReadableCloudApiJSON ee.Serializer.toReadableJSON ee.Serializer.encodeCloudApiPretty ee.String ee.Terrain".split(" "), + orderedParamLists = [["name", "namedArgs"], ["name"], ["name", "var_args"], "image opt_description opt_bucket opt_fileNamePrefix opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_shardSize opt_fileDimensions opt_skipEmptyTiles opt_fileFormat opt_formatOptions".split(" "), "collection opt_description opt_bucket opt_fileNamePrefix opt_fileFormat opt_selectors opt_maxVertices".split(" "), "collection opt_description opt_bucket opt_fileNamePrefix opt_framesPerSecond opt_writePublicTiles opt_minZoom opt_maxZoom opt_scale opt_region opt_skipEmptyTiles opt_minTimeMachineZoomSubset opt_maxTimeMachineZoomSubset opt_tileWidth opt_tileHeight opt_tileStride opt_videoFormat opt_version opt_mapsApiKey opt_bucketCorsUris".split(" "), + "collection opt_description opt_assetId opt_maxFeaturesPerTile opt_thinningStrategy opt_thinningRanking opt_zOrderRanking".split(" "), "image opt_description opt_folder opt_fileNamePrefix opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_shardSize opt_fileDimensions opt_skipEmptyTiles opt_fileFormat opt_formatOptions".split(" "), "collection opt_description opt_table opt_overwrite opt_append opt_selectors opt_maxVertices".split(" "), "image opt_description opt_bucket opt_fileFormat opt_path opt_writePublicTiles opt_scale opt_maxZoom opt_minZoom opt_region opt_skipEmptyTiles opt_mapsApiKey opt_bucketCorsUris".split(" "), + "collection opt_description opt_bucket opt_fileNamePrefix opt_framesPerSecond opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_maxFrames".split(" "), "collection opt_description opt_folder opt_fileNamePrefix opt_framesPerSecond opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_maxFrames".split(" "), ["collection", "opt_description", "opt_assetId", "opt_maxVertices"], "image opt_description opt_assetId opt_pyramidingPolicy opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_shardSize".split(" "), + ["classifier", "opt_description", "opt_assetId"], "collection opt_description opt_folder opt_fileNamePrefix opt_fileFormat opt_selectors opt_maxVertices".split(" "), ["name", "operator", "value"], ["geometry"], ["algorithm", "opt_first"], ["filter"], ["start", "opt_end"], ["algorithm", "opt_dropNulls"], ["property", "opt_ascending"], ["max", "opt_property", "opt_ascending"], ["opt_callback"], ["legacy"], ["func", "var_args"], ["callback"], ["assetId", "properties", "opt_callback"], ["sourceId", + "destinationId", "opt_callback"], "clientId success opt_error opt_extraScopes opt_onImmediateFailed opt_suppressDefaultScopes".split(" "), ["sourceId", "destinationId", "opt_overwrite", "opt_callback"], ["params", "opt_callback"], ["rootId", "opt_callback"], ["opt_callback"], ["assetId", "opt_callback"], ["taskId", "request", "opt_callback"], ["parent", "opt_params", "opt_callback"], ["params", "opt_callback"], ["id"], ["clientId", "success", "opt_error", "opt_extraScopes", "opt_onImmediateFailed"], + [], ["id", "x", "y", "z"], ["opt_limit", "opt_callback"], ["operationName", "opt_callback"], ["params", "opt_callback"], ["assetId", "opt_callback"], ["project", "opt_callback"], ["opt_limit", "opt_callback"], ["id", "opt_callback"], ["params", "opt_callback"], ["tag"], ["opt_success", "opt_error"], ["opt_callback"], ["params", "opt_callback"], ["id"], ["id", "opt_callback"], ["tag"], ["requestedId", "opt_callback"], ["value", "opt_path", "opt_force", "opt_properties", "opt_callback"], ["asset", + "params", "opt_callback"], ["operationName", "opt_callback"], ["opt_resetDefault"], ["privateKey", "opt_success", "opt_error", "opt_extraScopes", "opt_suppressDefaultScopes"], ["opt_count", "opt_callback"], ["assetId", "asset", "updateFields", "opt_callback"], ["obj", "opt_callback"], ["taskId", "opt_callback"], ["taskId", "request", "opt_callback"], ["params", "opt_callback"], ["assetId", "aclUpdate", "opt_callback"], ["params", "opt_callback"], ["path", "opt_force", "opt_callback"], ["id"], ["taskId", + "opt_callback"], ["taskId", "action", "opt_callback"], ["params", "opt_callback"], ["taskId", "params", "opt_callback"], ["parent", "opt_params", "opt_callback"], ["date", "opt_tz"], ["json"], ["json"], ["json"], ["json"], ["opt_dict"], [], "opt_baseurl opt_tileurl opt_successCallback opt_errorCallback opt_xsrfToken opt_project".split(" "), [], ["func", "var_args"], [], [], ["func", "namedArgs"], ["var_args"], [], ["opt_visParams", "opt_callback"], ["geometry", "opt_properties"], ["opt_callback"], + ["opt_visParams", "opt_callback"], ["propertySelectors", "opt_newProperties", "opt_retainGeometry"], ["args", "opt_column"], ["opt_format", "opt_selectors", "opt_filename", "opt_callback"], ["opt_callback"], ["opt_visParams", "opt_callback"], ["opt_visParams", "opt_callback"], ["name", "value"], ["name", "value"], ["name", "value"], ["var_args"], ["opt_leftField", "opt_rightValue", "opt_rightField", "opt_leftValue"], ["name", "value"], [], ["name", "value"], ["opt_filter"], ["name", "value"], ["start", + "opt_end"], ["name", "operator", "value"], ["var_args"], ["geometry", "opt_errorMargin"], ["var_args"], ["namedArgs"], ["geoJson", "opt_proj", "opt_geodesic", "opt_evenOdd"], ["legacy"], ["coords", "opt_proj", "opt_geodesic", "opt_maxError", "opt_evenOdd"], ["coords", "opt_proj"], ["coords", "opt_proj", "opt_geodesic", "opt_evenOdd"], ["coords", "opt_proj", "opt_geodesic", "opt_maxError"], [], ["coords", "opt_proj", "opt_geodesic", "opt_maxError"], ["coords", "opt_proj", "opt_geodesic", "opt_maxError"], + [], ["coords", "opt_proj"], ["west", "south", "east", "north"], ["coords", "opt_proj", "opt_geodesic", "opt_maxError", "opt_evenOdd"], ["params", "opt_callback"], ["r", "g", "b"], ["geometry"], ["var_args"], ["opt_args"], ["params", "opt_callback"], ["var_args"], ["var_args"], ["opt_callback"], ["opt_visParams", "opt_callback"], ["opt_visParams", "opt_callback"], ["params", "opt_callback"], ["expression", "opt_map"], ["opt_visParams", "opt_callback"], [], ["params", "opt_callback"], ["opt_callback"], + ["selectors", "opt_names"], ["imageCollection", "opt_linkedBands", "opt_linkedProperties", "opt_matchPropertyName"], ["params", "opt_callback"], ["args"], ["opt_visParams", "opt_callback"], ["list"], ["number"], ["obj", "opt_isCompound"], ["obj"], ["obj"], ["obj"], ["obj"], ["obj"], ["obj"], ["string"], []]; + [ee.ApiFunction._apply, ee.ApiFunction.lookup, ee.ApiFunction._call, module$contents$ee$batch_Export.image.toCloudStorage, module$contents$ee$batch_Export.table.toCloudStorage, module$contents$ee$batch_Export.videoMap.toCloudStorage, module$contents$ee$batch_Export.table.toFeatureView, module$contents$ee$batch_Export.image.toDrive, module$contents$ee$batch_Export.table.toBigQuery, module$contents$ee$batch_Export.map.toCloudStorage, module$contents$ee$batch_Export.video.toCloudStorage, module$contents$ee$batch_Export.video.toDrive, + module$contents$ee$batch_Export.table.toAsset, module$contents$ee$batch_Export.image.toAsset, module$contents$ee$batch_Export.classifier.toAsset, module$contents$ee$batch_Export.table.toDrive, ee.Collection.prototype.filterMetadata, ee.Collection.prototype.filterBounds, ee.Collection.prototype.iterate, ee.Collection.prototype.filter, ee.Collection.prototype.filterDate, ee.Collection.prototype.map, ee.Collection.prototype.sort, ee.Collection.prototype.limit, ee.ComputedObject.prototype.getInfo, + ee.ComputedObject.prototype.serialize, ee.ComputedObject.prototype.aside, ee.ComputedObject.prototype.evaluate, ee.data.setAssetProperties, ee.data.renameAsset, ee.data.authenticateViaOauth, ee.data.copyAsset, ee.data.getMapId, ee.data.getAssetRootQuota, ee.data.getTaskList, ee.data.deleteAsset, ee.data.startTableIngestion, ee.data.listImages, ee.data.getDownloadId, ee.data.makeDownloadUrl, ee.data.authenticate, ee.data.getWorkloadTag, ee.data.getTileUrl, ee.data.getTaskListWithLimit, ee.data.cancelOperation, + ee.data.getFilmstripThumbId, ee.data.getAssetAcl, ee.data.listBuckets, ee.data.listOperations, ee.data.getAsset, ee.data.getTableDownloadId, ee.data.setWorkloadTag, ee.data.authenticateViaPopup, ee.data.getAssetRoots, ee.data.getFeatureViewTilesKey, ee.data.makeTableDownloadUrl, ee.data.getInfo, ee.data.setDefaultWorkloadTag, ee.data.createAssetHome, ee.data.createAsset, ee.data.listFeatures, ee.data.getOperation, ee.data.resetWorkloadTag, ee.data.authenticateViaPrivateKey, ee.data.newTaskId, ee.data.updateAsset, + ee.data.computeValue, ee.data.cancelTask, ee.data.startIngestion, ee.data.getThumbId, ee.data.setAssetAcl, ee.data.getVideoThumbId, ee.data.createFolder, ee.data.makeThumbUrl, ee.data.getTaskStatus, ee.data.updateTask, ee.data.getList, ee.data.startProcessing, ee.data.listAssets, ee.Date, ee.Deserializer.fromJSON, ee.Deserializer.fromCloudApiJSON, ee.Deserializer.decodeCloudApi, ee.Deserializer.decode, ee.Dictionary, ee.TILE_SIZE, ee.initialize, ee.reset, ee.call, ee.Algorithms, ee.InitState, ee.apply, + ee.Element.prototype.set, ee.Encodable.SourceFrame, ee.Feature.prototype.getMap, ee.Feature, ee.Feature.prototype.getInfo, ee.Feature.prototype.getMapId, ee.FeatureCollection.prototype.select, ee.FeatureCollection, ee.FeatureCollection.prototype.getDownloadURL, ee.FeatureCollection.prototype.getInfo, ee.FeatureCollection.prototype.getMap, ee.FeatureCollection.prototype.getMapId, ee.Filter.gt, ee.Filter.lt, ee.Filter.neq, ee.Filter.or, ee.Filter.inList, ee.Filter.lte, ee.Filter.prototype.not, ee.Filter.gte, + ee.Filter, ee.Filter.eq, ee.Filter.date, ee.Filter.metadata, ee.Filter.and, ee.Filter.bounds, ee.Function.prototype.call, ee.Function.prototype.apply, ee.Geometry, ee.Geometry.prototype.serialize, ee.Geometry.Polygon, ee.Geometry.Point, ee.Geometry.Rectangle, ee.Geometry.LineString, ee.Geometry.prototype.toGeoJSON, ee.Geometry.LinearRing, ee.Geometry.MultiLineString, ee.Geometry.prototype.toGeoJSONString, ee.Geometry.MultiPoint, ee.Geometry.BBox, ee.Geometry.MultiPolygon, ee.Image.prototype.getThumbURL, + ee.Image.rgb, ee.Image.prototype.clip, ee.Image.prototype.rename, ee.Image, ee.Image.prototype.getDownloadURL, ee.Image.cat, ee.Image.prototype.select, ee.Image.prototype.getInfo, ee.Image.prototype.getMapId, ee.Image.prototype.getMap, ee.Image.prototype.getThumbId, ee.Image.prototype.expression, ee.ImageCollection.prototype.getMap, ee.ImageCollection.prototype.first, ee.ImageCollection.prototype.getVideoThumbURL, ee.ImageCollection.prototype.getInfo, ee.ImageCollection.prototype.select, ee.ImageCollection.prototype.linkCollection, + ee.ImageCollection.prototype.getFilmstripThumbURL, ee.ImageCollection, ee.ImageCollection.prototype.getMapId, ee.List, ee.Number, ee.Serializer.encode, ee.Serializer.toCloudApiJSON, ee.Serializer.encodeCloudApi, ee.Serializer.toJSON, ee.Serializer.toReadableCloudApiJSON, ee.Serializer.toReadableJSON, ee.Serializer.encodeCloudApiPretty, ee.String, ee.Terrain].forEach(function(fn, i) { fn && (exportedFnInfo[fn.toString()] = {name:orderedFnNames[i], paramNames:orderedParamLists[i]}); }); goog.global.EXPORTED_FN_INFO = exportedFnInfo; diff --git a/javascript/package.json b/javascript/package.json index e78741504..a6f0b2d9f 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -1,6 +1,6 @@ { "name": "@google/earthengine", - "version": "0.1.384", + "version": "0.1.385", "description": "JavaScript client for Google Earth Engine API.", "author": "Google LLC", "license": "Apache-2.0", diff --git a/javascript/src/apiclient.js b/javascript/src/apiclient.js index a00ca6ae5..0bd1bcc56 100644 --- a/javascript/src/apiclient.js +++ b/javascript/src/apiclient.js @@ -25,7 +25,7 @@ const {trustedResourceUrl} = goog.require('safevalues'); /** @namespace */ const apiclient = {}; -const API_CLIENT_VERSION = '0.1.384'; +const API_CLIENT_VERSION = '0.1.385'; exports.VERSION = apiVersion.VERSION; exports.API_CLIENT_VERSION = API_CLIENT_VERSION; diff --git a/javascript/src/eeapiclient/api_client.ts b/javascript/src/eeapiclient/api_client.ts index 325759b85..adcabc134 100644 --- a/javascript/src/eeapiclient/api_client.ts +++ b/javascript/src/eeapiclient/api_client.ts @@ -1,4 +1,3 @@ -// g3-format-clang import {Serializable, serialize} from './domain_object'; import {GeneratedRequestParams} from './generated_types'; import {MultipartRequest} from './multipart_request'; @@ -13,36 +12,41 @@ export abstract class ApiClient { $validateParameter(param: any, pattern: RegExp): void { const paramStr = String(param); if (!pattern.test(paramStr)) { - throw new Error(`parameter [${paramStr}] does not match pattern [${ - pattern.toString()}]`); + throw new Error( + `parameter [${paramStr}] does not match pattern [${pattern.toString()}]`, + ); } } } -export function toMakeRequestParams(requestParams: GeneratedRequestParams): - MakeRequestParams { - const body = (requestParams.body instanceof Serializable) ? - serialize(requestParams.body) : - requestParams.body; +export function toMakeRequestParams( + requestParams: GeneratedRequestParams, +): MakeRequestParams { + const body = + requestParams.body instanceof Serializable + ? serialize(requestParams.body) + : requestParams.body; return { path: requestParams.path, httpMethod: requestParams.httpMethod, methodId: requestParams.methodId, body: body as Serializable, queryParams: requestParams.queryParams, - streamingType: requestParams.streamingType && - requestParams.streamingType as StreamingType + streamingType: + requestParams.streamingType && + (requestParams.streamingType as StreamingType), } as MakeRequestParams; } export function toMultipartMakeRequestParams( - requestParams: GeneratedRequestParams): Promise { + requestParams: GeneratedRequestParams, +): Promise { if (!(requestParams.body instanceof MultipartRequest)) { throw new Error(`${requestParams.path} request must be a MultipartRequest`); } const multipartRequest = requestParams.body; - return multipartRequest.payloadPromise().then(body => { + return multipartRequest.payloadPromise().then((body) => { const queryParams = requestParams.queryParams ?? {}; return { path: requestParams.path, @@ -51,8 +55,7 @@ export function toMultipartMakeRequestParams( queryParams: {...queryParams, 'uploadType': 'multipart'}, headers: { 'X-Goog-Upload-Protocol': 'multipart', - 'Content-Type': - `multipart/related; boundary=${multipartRequest.boundary()}` + 'Content-Type': `multipart/related; boundary=${multipartRequest.boundary()}`, }, body, }; diff --git a/javascript/src/eeapiclient/api_request_hook.ts b/javascript/src/eeapiclient/api_request_hook.ts index 1e230a9f5..e229f7ba4 100644 --- a/javascript/src/eeapiclient/api_request_hook.ts +++ b/javascript/src/eeapiclient/api_request_hook.ts @@ -1,4 +1,3 @@ -// g3-format-clang import {GeneratedRequestParams} from './generated_types'; export interface ApiClientRequestHook { @@ -11,13 +10,14 @@ export interface ApiClientRequestHook { } export abstract class ApiClientHookFactory { - abstract getRequestHook(requestParams: GeneratedRequestParams): - ApiClientRequestHook; + abstract getRequestHook( + requestParams: GeneratedRequestParams, + ): ApiClientRequestHook; } export interface ApiClientHookFactoryCtor { // tslint:disable-next-line:no-any ctor args are of any type - new(...args: any[]): ApiClientHookFactory; + new (...args: any[]): ApiClientHookFactory; } export class DefaultApiClientHookFactory implements ApiClientHookFactory { @@ -35,8 +35,9 @@ export class DefaultApiClientHookFactory implements ApiClientHookFactory { * from a {@link ApiClientHookFactory}. */ export function getRequestHook( - factory: ApiClientHookFactory|null|undefined, - requestParams: GeneratedRequestParams): ApiClientRequestHook|null { + factory: ApiClientHookFactory | null | undefined, + requestParams: GeneratedRequestParams, +): ApiClientRequestHook | null { if (factory == null) { return null; } diff --git a/javascript/src/eeapiclient/domain_object.ts b/javascript/src/eeapiclient/domain_object.ts index d1fddff78..88ef0a576 100644 --- a/javascript/src/eeapiclient/domain_object.ts +++ b/javascript/src/eeapiclient/domain_object.ts @@ -1,22 +1,21 @@ /** - * g3-format-clang * Utility map for ClassMetadata to describe how to create instances of child * properties. */ export type ObjectMap = { - [key: string]: T + [key: string]: T; }; export interface ObjectMapMetadata { isPropertyArray: boolean; isValueArray: boolean; isSerializable: boolean; - ctor: SerializableCtor|null; + ctor: SerializableCtor | null; } /** Primitive types used in ISerializable fields. */ -type Primitive = string|number|boolean|null|undefined; +type Primitive = string | number | boolean | null | undefined; /** * Mapped type that annotates all nested fields on an object as optional, @@ -24,13 +23,16 @@ type Primitive = string|number|boolean|null|undefined; * * i.e., {a: {b: {c: boolean}}} gets transformed into {a?: {b?: {c?: boolean}}} */ -export type DeepPartialISerializable = - T extends Primitive ? Partial: T extends ISerializable ? - Omit< - {[K in keyof T]?: DeepPartialISerializable}, - keyof ISerializable|'getPartialClassMetadata'>: - T extends object ? {[K in keyof T]?: DeepPartialISerializable} : - unknown; +export type DeepPartialISerializable = T extends Primitive + ? Partial + : T extends ISerializable + ? Omit< + {[K in keyof T]?: DeepPartialISerializable}, + keyof ISerializable | 'getPartialClassMetadata' + > + : T extends object + ? {[K in keyof T]?: DeepPartialISerializable} + : unknown; /** * Description of the properties in a Serializable class. @@ -85,7 +87,8 @@ export interface ISerializable { * this, then we can add new fields to ClassMetadata without updating all users. */ export function buildClassMetadataFromPartial( - partialClassMetadata: Partial): ClassMetadata { + partialClassMetadata: Partial, +): ClassMetadata { return { arrays: {}, descriptions: {}, @@ -126,9 +129,9 @@ export abstract class Serializable implements ISerializable { */ // tslint:disable-next-line:no-any Serializables work with arbitrary data Serializable$get(key: string): any { - return this.Serializable$values.hasOwnProperty(key) ? - this.Serializable$values[key] : - null; + return this.Serializable$values.hasOwnProperty(key) + ? this.Serializable$values[key] + : null; } /** @@ -153,7 +156,7 @@ export abstract class Serializable implements ISerializable { /** Constructs an ISerializable instance. */ export interface SerializableCtor { - new(): T; + new (): T; } /** @@ -161,8 +164,9 @@ export interface SerializableCtor { */ export function clone(serializable: T): T { return deserialize( - serializable.getConstructor() as SerializableCtor, - serialize(serializable)); + serializable.getConstructor() as SerializableCtor, + serialize(serializable), + ); } /** @@ -187,7 +191,11 @@ export function isEmpty(serializable: ISerializable): boolean { // tslint:disable-next-line:no-any export function serialize(serializable: ISerializable): ObjectMap { return deepCopy( - serializable, serializeGetter, serializeSetter, serializeInstanciator); + serializable, + serializeGetter, + serializeSetter, + serializeInstanciator, + ); } function serializeGetter(key: string, obj: unknown) { @@ -199,7 +207,7 @@ function serializeSetter(key: string, obj: {}, value: {}) { } function serializeInstanciator(ctor: CopyConstructor) { - return ({} as ObjectMap<{}>); + return {} as ObjectMap<{}>; } /** @@ -207,14 +215,20 @@ function serializeInstanciator(ctor: CopyConstructor) { * the data from the raw input to the new class instances. */ export function deserialize( - type: SerializableCtor, raw?: unknown): T { + type: SerializableCtor, + raw?: unknown, +): T { const result = new type(); if (raw == null) { return result; } return deepCopy( - raw, deserializeGetter, deserializeSetter, deserializeInstanciator, - type) as T; + raw, + deserializeGetter, + deserializeSetter, + deserializeInstanciator, + type, + ) as T; } function deserializeGetter(key: string, obj: unknown) { @@ -238,13 +252,15 @@ function deserializeInstanciator(ctor: CopyConstructor) { * class. */ export function strictDeserialize( - type: SerializableCtor, raw: DeepPartialISerializable) { + type: SerializableCtor, + raw: DeepPartialISerializable, +) { return deserialize(type, raw); } type CopyValueGetter = (key: string, obj: unknown) => {}; type CopyValueSetter = (key: string, obj: {}, value: {}) => void; -type CopyConstructor = SerializableCtor|null|undefined; +type CopyConstructor = SerializableCtor | null | undefined; type CopyInstanciator = (ctor: CopyConstructor) => T; /** @@ -260,9 +276,12 @@ type CopyInstanciator = (ctor: CopyConstructor) => T; * @param targetConstructor Optional. The target's constructor function. */ function deepCopy( - source: unknown, valueGetter: CopyValueGetter, valueSetter: CopyValueSetter, - copyInstanciator: CopyInstanciator, - targetConstructor?: CopyConstructor): T { + source: unknown, + valueGetter: CopyValueGetter, + valueSetter: CopyValueSetter, + copyInstanciator: CopyInstanciator, + targetConstructor?: CopyConstructor, +): T { const target = copyInstanciator(targetConstructor); const metadata = deepCopyMetadata(source, target); @@ -282,38 +301,61 @@ function deepCopy( continue; } copy = deepCopyValue( - value, valueGetter, valueSetter, copyInstanciator, true, true, - arrays[key]); - + value, + valueGetter, + valueSetter, + copyInstanciator, + true, + true, + arrays[key], + ); } else if (objects.hasOwnProperty(key)) { // Explicitly a serializable object copy = deepCopyValue( - value, valueGetter, valueSetter, copyInstanciator, false, true, - objects[key]); - + value, + valueGetter, + valueSetter, + copyInstanciator, + false, + true, + objects[key], + ); } else if (objectMaps.hasOwnProperty(key)) { // Serialize all the values in an object map. const mapMetadata = objectMaps[key]; - copy = mapMetadata.isPropertyArray ? - (value as Array>) - .map( - v => deepCopyObjectMap( - v, mapMetadata, valueGetter, valueSetter, - copyInstanciator)) : - deepCopyObjectMap( - value, mapMetadata, valueGetter, valueSetter, copyInstanciator); - - } else if (Array.isArray(value)) { // This needs to be second to last! + copy = mapMetadata.isPropertyArray + ? (value as Array>).map((v) => + deepCopyObjectMap( + v, + mapMetadata, + valueGetter, + valueSetter, + copyInstanciator, + ), + ) + : deepCopyObjectMap( + value, + mapMetadata, + valueGetter, + valueSetter, + copyInstanciator, + ); + } else if (Array.isArray(value)) { + // This needs to be second to last! // Implicitly an array, treat as primitives if (metadata.emptyArrayIsUnset && value.length === 0) { continue; } copy = deepCopyValue( - value, valueGetter, valueSetter, copyInstanciator, true, false); - + value, + valueGetter, + valueSetter, + copyInstanciator, + true, + false, + ); } else if (value instanceof NullClass) { copy = null as unknown as {}; - } else { copy = value; } @@ -324,27 +366,42 @@ function deepCopy( } function deepCopyObjectMap( - value: ObjectMap<{}>, mapMetadata: ObjectMapMetadata, - valueGetter: CopyValueGetter, valueSetter: CopyValueSetter, - copyInstanciator: CopyInstanciator) { + value: ObjectMap<{}>, + mapMetadata: ObjectMapMetadata, + valueGetter: CopyValueGetter, + valueSetter: CopyValueSetter, + copyInstanciator: CopyInstanciator, +) { const objMap: ObjectMap<{}> = {}; for (const mapKey of Object.keys(value)) { const mapValue = value[mapKey]; if (mapValue == null) continue; objMap[mapKey] = deepCopyValue( - mapValue, valueGetter, valueSetter, copyInstanciator, - mapMetadata.isValueArray, mapMetadata.isSerializable, mapMetadata.ctor); + mapValue, + valueGetter, + valueSetter, + copyInstanciator, + mapMetadata.isValueArray, + mapMetadata.isSerializable, + mapMetadata.ctor, + ); } return objMap; } function deepCopyValue( - value: {}, valueGetter: CopyValueGetter, valueSetter: CopyValueSetter, - copyInstanciator: CopyInstanciator, isArray: boolean, isRef: boolean, - ctor?: CopyConstructor) { + value: {}, + valueGetter: CopyValueGetter, + valueSetter: CopyValueSetter, + copyInstanciator: CopyInstanciator, + isArray: boolean, + isRef: boolean, + ctor?: CopyConstructor, +) { if (isRef && ctor == null) { throw new Error( - 'Cannot deserialize a reference object without a constructor.'); + 'Cannot deserialize a reference object without a constructor.', + ); } if (value == null) { @@ -353,27 +410,25 @@ function deepCopyValue( let deserialized: {}; if (isArray && isRef) { - deserialized = - (value as ISerializable[]) - .map( - v => deepCopy( - v, valueGetter, valueSetter, copyInstanciator, ctor)); - + deserialized = (value as ISerializable[]).map((v) => + deepCopy(v, valueGetter, valueSetter, copyInstanciator, ctor), + ); } else if (isArray && !isRef) { deserialized = (value as Array<{}>).map((v) => v); - } else if (!isArray && isRef) { - deserialized = - deepCopy(value, valueGetter, valueSetter, copyInstanciator, ctor); - + deserialized = deepCopy( + value, + valueGetter, + valueSetter, + copyInstanciator, + ctor, + ); } else if (value instanceof NullClass) { deserialized = null as unknown as {}; - } else if (typeof value === 'object') { // TODO(user): Assert as a type, declared interface, or `unknown`. // tslint:disable-next-line:ban-types no-unnecessary-type-assertion deserialized = JSON.parse(JSON.stringify(value)) as AnyDuringMigration; - } else { deserialized = value; } @@ -392,13 +447,14 @@ function deepCopyMetadata(source: unknown, target: {}) { return metadata; } - /** * Returns whether or not the two serializable objects are deeply equal. The * traversal logic should be identical to that of serialize. */ export function deepEquals( - serializable1: ISerializable, serializable2: ISerializable): boolean { + serializable1: ISerializable, + serializable2: ISerializable, +): boolean { const metadata1 = serializable1.getClassMetadata(); const keys1 = metadata1.keys || []; const arrays1 = metadata1.arrays || {}; @@ -411,8 +467,14 @@ export function deepEquals( const objects2 = metadata2.objects || {}; const objectMaps2 = metadata2.objectMaps || {}; - if (!(sameKeys(keys1, keys2) && sameKeys(arrays1, arrays2) && - sameKeys(objects1, objects2) && sameKeys(objectMaps1, objectMaps2))) { + if ( + !( + sameKeys(keys1, keys2) && + sameKeys(arrays1, arrays2) && + sameKeys(objects1, objects2) && + sameKeys(objectMaps1, objectMaps2) + ) + ) { return false; } @@ -457,12 +519,10 @@ export function deepEquals( if (!deepEqualsValue(value1, value2, true, true)) { return false; } - } else if (objects1.hasOwnProperty(key)) { if (!deepEqualsValue(value1, value2, false, true)) { return false; } - } else if (objectMaps1.hasOwnProperty(key)) { const mapMetadata = objectMaps1[key]; if (mapMetadata.isPropertyArray) { @@ -470,19 +530,21 @@ export function deepEquals( return false; } const value1Arr = value1 as Array>; - if (value1Arr.some( - (v1, i) => !deepEqualsObjectMap(v1, value2[i], mapMetadata))) { + if ( + value1Arr.some( + (v1, i) => !deepEqualsObjectMap(v1, value2[i], mapMetadata), + ) + ) { return false; } } else if (!deepEqualsObjectMap(value1, value2, mapMetadata)) { return false; } - - } else if (Array.isArray(value1)) { // This needs to be second to last! + } else if (Array.isArray(value1)) { + // This needs to be second to last! if (!deepEqualsValue(value1, value2, true, false)) { return false; } - } else if (!deepEqualsValue(value1, value2, false, false)) { return false; } @@ -491,8 +553,10 @@ export function deepEquals( } function hasAndIsNotEmptyArray( - serializable: ISerializable, key: string, - metadata: ClassMetadata): boolean { + serializable: ISerializable, + key: string, + metadata: ClassMetadata, +): boolean { if (!serializable.Serializable$has(key)) return false; if (!metadata.emptyArrayIsUnset) return true; const value = serializable.Serializable$get(key); @@ -501,8 +565,10 @@ function hasAndIsNotEmptyArray( } function deepEqualsObjectMap( - value1: ObjectMap<{}>, value2: ObjectMap<{}>, - mapMetadata: ObjectMapMetadata) { + value1: ObjectMap<{}>, + value2: ObjectMap<{}>, + mapMetadata: ObjectMapMetadata, +) { if (!sameKeys(value1, value2)) { return false; } @@ -511,9 +577,14 @@ function deepEqualsObjectMap( const mapValue1 = value1[mapKey]; const mapValue2 = value2[mapKey]; - if (!deepEqualsValue( - mapValue1, mapValue2, mapMetadata.isValueArray, - mapMetadata.isSerializable)) { + if ( + !deepEqualsValue( + mapValue1, + mapValue2, + mapMetadata.isValueArray, + mapMetadata.isSerializable, + ) + ) { return false; } } @@ -522,7 +593,11 @@ function deepEqualsObjectMap( } function deepEqualsValue( - value1: {}, value2: {}, isArray: boolean, isSerializable: boolean) { + value1: {}, + value2: {}, + isArray: boolean, + isSerializable: boolean, +) { if (value1 == null && value2 == null) { return true; } @@ -531,13 +606,13 @@ function deepEqualsValue( if (!sameKeys(value1, value2)) { return false; } - const serializableArr1 = (value1 as ISerializable[]); - const serializableArr2 = (value2 as ISerializable[]); - if (serializableArr1.some( - (v1, i) => !deepEquals(v1, serializableArr2[i]))) { + const serializableArr1 = value1 as ISerializable[]; + const serializableArr2 = value2 as ISerializable[]; + if ( + serializableArr1.some((v1, i) => !deepEquals(v1, serializableArr2[i])) + ) { return false; } - } else if (isArray && !isSerializable) { if (!sameKeys(value1, value2)) { return false; @@ -547,10 +622,8 @@ function deepEqualsValue( if (arr1.some((v, i) => v !== arr2[i])) { return false; } - } else if (isSerializable) { return deepEquals(value1 as ISerializable, value2 as ISerializable); - } else if (typeof value1 === 'object') { if (JSON.stringify(value1) !== JSON.stringify(value2)) { return false; @@ -593,9 +666,11 @@ function sameKeys(a: T, b: T) { * implementation details in the future. */ export function serializableEqualityTester( - left: unknown, right: unknown): boolean|undefined { + left: unknown, + right: unknown, +): boolean | undefined { if (left instanceof Serializable && right instanceof Serializable) { return deepEquals(left, right); } - return undefined; // Do not change behavior for other types. + return undefined; // Do not change behavior for other types. } diff --git a/javascript/src/eeapiclient/generated_types.ts b/javascript/src/eeapiclient/generated_types.ts index 019c9406b..c3edb905e 100644 --- a/javascript/src/eeapiclient/generated_types.ts +++ b/javascript/src/eeapiclient/generated_types.ts @@ -1,4 +1,3 @@ -// g3-format-clang import {Serializable, SerializableCtor} from './domain_object'; import {MultipartRequest} from './multipart_request'; @@ -15,8 +14,14 @@ export interface GeneratedInterface {} /** Type for the optional queryParams map: string-indexed primitive values. */ export interface GeneratedQueryParams { - [key: string]: number|ReadonlyArray|string|ReadonlyArray| - boolean|ReadonlyArray|undefined; + [key: string]: + | number + | ReadonlyArray + | string + | ReadonlyArray + | boolean + | ReadonlyArray + | undefined; } export interface GeneratedRequestParams { @@ -25,7 +30,7 @@ export interface GeneratedRequestParams { /** The id of the called method, from discovery. */ methodId?: string; queryParams?: GeneratedQueryParams; - body?: Serializable|GeneratedInterface|MultipartRequest|null; + body?: Serializable | GeneratedInterface | MultipartRequest | null; responseCtor?: SerializableCtor; /** * Whether the end-point is a streaming end-point and its type e.g. diff --git a/javascript/src/eeapiclient/multipart_request.ts b/javascript/src/eeapiclient/multipart_request.ts index 975222214..a60b497e6 100644 --- a/javascript/src/eeapiclient/multipart_request.ts +++ b/javascript/src/eeapiclient/multipart_request.ts @@ -1,4 +1,3 @@ -// g3-format-clang import {Serializable, serialize} from './domain_object'; export class MultipartRequest { @@ -6,7 +5,7 @@ export class MultipartRequest { private _metadataPayload = ''; private _payloadPromise: Promise; - constructor(private files: File[], private _metadata?: {}|null) { + constructor(private files: File[], private _metadata?: {} | null) { this._boundary = Date.now().toString(); if (_metadata) { this.addMetadata(_metadata); @@ -18,7 +17,7 @@ export class MultipartRequest { return this._boundary; } - metadata(): {}|undefined|null { + metadata(): {} | undefined | null { return this._metadata; } @@ -28,31 +27,37 @@ export class MultipartRequest { private addMetadata(metadata: {}): void { const json = - (metadata instanceof Serializable) ? serialize(metadata) : metadata; + metadata instanceof Serializable ? serialize(metadata) : metadata; this._metadataPayload += - 'Content-Type: application/json; charset=utf-8\r\n\r\n' + - JSON.stringify(json) + `\r\n--${this._boundary}\r\n`; + 'Content-Type: application/json; charset=utf-8\r\n\r\n' + + JSON.stringify(json) + + `\r\n--${this._boundary}\r\n`; } private build(): Promise { let payload = `--${this._boundary}\r\n`; payload += this._metadataPayload; - return Promise.all(this.files.map(f => this.encodeFile(f))) - .then(filePayloads => { - for (const filePayload of filePayloads) { - payload += filePayload; - } - payload += `\r\n--${this._boundary}--`; - return payload; - }); + return Promise.all(this.files.map((f) => this.encodeFile(f))).then( + (filePayloads) => { + for (const filePayload of filePayloads) { + payload += filePayload; + } + payload += `\r\n--${this._boundary}--`; + return payload; + }, + ); } private encodeFile(file: File): Promise { return this.base64EncodeFile(file).then( - base64Str => `Content-Type: ${file.type}\r\n` + - `Content-Disposition: form-data; name="file"; filename="${ - encodeURIComponent(file.name)}"\r\n` + - 'Content-Transfer-Encoding: base64\r\n\r\n' + base64Str); + (base64Str) => + `Content-Type: ${file.type}\r\n` + + `Content-Disposition: form-data; name="file"; filename="${encodeURIComponent( + file.name, + )}"\r\n` + + 'Content-Transfer-Encoding: base64\r\n\r\n' + + base64Str, + ); } private base64EncodeFile(file: File): Promise { diff --git a/javascript/src/eeapiclient/promise_api_client.ts b/javascript/src/eeapiclient/promise_api_client.ts index a8fa146a6..ed7432acc 100644 --- a/javascript/src/eeapiclient/promise_api_client.ts +++ b/javascript/src/eeapiclient/promise_api_client.ts @@ -1,20 +1,32 @@ -// g3-format-clang -import {ApiClient, toMakeRequestParams, toMultipartMakeRequestParams} from './api_client'; -import {ApiClientHookFactory, getRequestHook} from './api_request_hook'; +import { + ApiClient, + toMakeRequestParams, + toMultipartMakeRequestParams, +} from './api_client'; +import { + ApiClientHookFactory, + getRequestHook, +} from './api_request_hook'; import {Serializable} from './domain_object'; -import {GeneratedInterface, GeneratedRequestParams} from './generated_types'; +import { + GeneratedInterface, + GeneratedRequestParams, +} from './generated_types'; import {PromiseRequestService} from './promise_request_service'; export class PromiseApiClient extends ApiClient { constructor( - protected requestService: PromiseRequestService, - protected hookFactory: ApiClientHookFactory|null = null) { + protected requestService: PromiseRequestService, + protected hookFactory: ApiClientHookFactory | null = null, + ) { super(); } protected $addHooksToRequest( - requestParams: GeneratedRequestParams, promise: Promise): Promise { + requestParams: GeneratedRequestParams, + promise: Promise, + ): Promise { const hook = getRequestHook(this.hookFactory, requestParams); if (hook == null) { return promise; @@ -22,34 +34,41 @@ export class PromiseApiClient extends ApiClient { hook.onBeforeSend(); return promise.then( - (response) => { - hook.onSuccess(response); - return response; - }, - (error) => { - hook.onError(error); - throw error; - }); + (response) => { + hook.onSuccess(response); + return response; + }, + (error) => { + hook.onError(error); + throw error; + }, + ); } /** Converts a gapi.client.Request to an Promise. */ - $request( - requestParams: GeneratedRequestParams): Promise { + $request( + requestParams: GeneratedRequestParams, + ): Promise { const responseCtor = requestParams.responseCtor || void 0; return this.$addHooksToRequest( - requestParams, - this.requestService.send( - toMakeRequestParams(requestParams), responseCtor) as Promise); + requestParams, + this.requestService.send( + toMakeRequestParams(requestParams), + responseCtor, + ) as Promise, + ); } - $uploadRequest( - requestParams: GeneratedRequestParams): Promise { + $uploadRequest( + requestParams: GeneratedRequestParams, + ): Promise { const responseCtor = requestParams.responseCtor || void 0; return this.$addHooksToRequest( - requestParams, - toMultipartMakeRequestParams(requestParams) - .then( - params => this.requestService.send(params, responseCtor) as - Promise)); + requestParams, + toMultipartMakeRequestParams(requestParams).then( + (params) => + this.requestService.send(params, responseCtor) as Promise, + ), + ); } } diff --git a/javascript/src/eeapiclient/promise_request_service.ts b/javascript/src/eeapiclient/promise_request_service.ts index 5d1d607a6..56ed0939e 100644 --- a/javascript/src/eeapiclient/promise_request_service.ts +++ b/javascript/src/eeapiclient/promise_request_service.ts @@ -1,15 +1,22 @@ -// g3-format-clang -import {deserialize, Serializable, SerializableCtor} from './domain_object'; -import {MakeRequestParams, processParams} from './request_params'; +import { + deserialize, + Serializable, + SerializableCtor, +} from './domain_object'; +import { + MakeRequestParams, + processParams, +} from './request_params'; export abstract class PromiseRequestService { send( - params: MakeRequestParams, - responseCtor?: SerializableCtor): Promise { + params: MakeRequestParams, + responseCtor?: SerializableCtor, + ): Promise { processParams(params); - return this.makeRequest(params).then( - (response) => - responseCtor ? deserialize(responseCtor, response) : response as T); + return this.makeRequest(params).then((response) => + responseCtor ? deserialize(responseCtor, response) : (response as T), + ); } abstract makeRequest(params: MakeRequestParams): Promise<{}>; diff --git a/javascript/src/eeapiclient/request_params.ts b/javascript/src/eeapiclient/request_params.ts index 115d9c6ed..6579dc906 100644 --- a/javascript/src/eeapiclient/request_params.ts +++ b/javascript/src/eeapiclient/request_params.ts @@ -1,10 +1,9 @@ -// g3-format-clang import * as httpCors from 'goog:goog.net.rpc.HttpCors'; import {GeneratedQueryParams} from './generated_types'; /** Available HTTP methods supported by Google APIs */ -export type HttpMethod = 'GET'|'POST'|'PUT'|'PATCH'|'DELETE'; +export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** * {@link HttpMethod} come directly from the discovery file as strings. The code @@ -44,7 +43,7 @@ export enum StreamingType { NONE = 'NONE', CLIENT_SIDE = 'CLIENT_SIDE', SERVER_SIDE = 'SERVER_SIDE', - BIDIRECTONAL = 'BIDIRECTONAL' + BIDIRECTONAL = 'BIDIRECTONAL', } /** @@ -58,7 +57,7 @@ export interface MakeRequestParams { * custom HTTP methods. You can use {@link HttpMethodEnum#isHttpMethod} * to check if the httpMethod is of type {@link HttpMethod}. */ - httpMethod: HttpMethod|string; + httpMethod: HttpMethod | string; /** The id of the called method, from discovery. */ methodId?: string; // tslint:disable-next-line:no-any @@ -97,8 +96,10 @@ export function processParams(params: MakeRequestParams) { * therefore this function can be loose about type-checking the fields. */ export function buildQueryParams( - params: {}, mapping: Record, - passthroughParams: Record = {}): GeneratedQueryParams { + params: {}, + mapping: Record, + passthroughParams: Record = {}, +): GeneratedQueryParams { const paramsMap = params as unknown as GeneratedQueryParams; const urlQueryParams: GeneratedQueryParams = passthroughParams; @@ -110,8 +111,11 @@ export function buildQueryParams( return urlQueryParams; } -const simpleCorsAllowedHeaders: string[] = - ['accept', 'accept-language', 'content-language']; +const simpleCorsAllowedHeaders: string[] = [ + 'accept', + 'accept-language', + 'content-language', +]; const simpleCorsAllowedMethods: string[] = ['GET', 'HEAD', 'POST']; @@ -158,8 +162,11 @@ export function bypassCorsPreflight(params: MakeRequestParams) { } } - if (params.body != null || params.httpMethod === 'PUT' || - params.httpMethod === 'POST') { + if ( + params.body != null || + params.httpMethod === 'PUT' || + params.httpMethod === 'POST' + ) { // Normally, HttpClient detects the application/json Content-Type based on // the body of the request. We need to explicitly set it in the // pre-generateEncodedHttpHeadersOverwriteParam so that the header @@ -175,20 +182,26 @@ export function bypassCorsPreflight(params: MakeRequestParams) { if (hasUnsafeHeaders) { const finalParam = - httpCors.generateEncodedHttpHeadersOverwriteParam(unsafeHeaders); + httpCors.generateEncodedHttpHeadersOverwriteParam(unsafeHeaders); addQueryParameter(params, httpCors.HTTP_HEADERS_PARAM_NAME, finalParam); } params.headers = safeHeaders; if (!simpleCorsAllowedMethods.includes(params.httpMethod)) { addQueryParameter( - params, httpCors.HTTP_METHOD_PARAM_NAME, params.httpMethod); + params, + httpCors.HTTP_METHOD_PARAM_NAME, + params.httpMethod, + ); params.httpMethod = 'POST'; } } function addQueryParameter( - params: MakeRequestParams, key: string, value: string) { + params: MakeRequestParams, + key: string, + value: string, +) { if (params.queryParams) { params.queryParams[key] = value; } else { diff --git a/javascript/src/eeapiclient/request_params_test.ts b/javascript/src/eeapiclient/request_params_test.ts index c254c392b..e1eb3b8ea 100644 --- a/javascript/src/eeapiclient/request_params_test.ts +++ b/javascript/src/eeapiclient/request_params_test.ts @@ -1,7 +1,10 @@ -// g3-format-clang import 'jasmine'; -import {buildQueryParams, bypassCorsPreflight, MakeRequestParams} from './request_params'; +import { + buildQueryParams, + bypassCorsPreflight, + MakeRequestParams, +} from './request_params'; describe('buildQueryParams', () => { const PARAMS_MAP = { @@ -100,7 +103,7 @@ describe('bypassCorsPreflight', () => { expect(params.headers).toEqual({'Content-Type': 'text/plain'}); expect(params.httpMethod).toEqual('POST'); expect(params.queryParams).toEqual({ - '$httpHeaders': 'Content-Type%3Aapplication%2Fjson%0D%0A' + '$httpHeaders': 'Content-Type%3Aapplication%2Fjson%0D%0A', }); }); @@ -109,15 +112,16 @@ describe('bypassCorsPreflight', () => { path: 'v1/whatever', httpMethod: 'POST', methodId: 'someservice.whatever.post', - headers: - {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', + }, }; bypassCorsPreflight(params); expect(params.headers).toEqual({'Content-Type': 'text/plain'}); expect(params.httpMethod).toEqual('POST'); expect(params.queryParams).toEqual({ '$httpHeaders': - 'Content-Type%3Aapplication%2Fx-www-form-urlencoded%3Bcharset%3DUTF-8%0D%0A', + 'Content-Type%3Aapplication%2Fx-www-form-urlencoded%3Bcharset%3DUTF-8%0D%0A', }); }); @@ -134,26 +138,25 @@ describe('bypassCorsPreflight', () => { expect(params.httpMethod).toEqual('POST'); expect(params.queryParams).toEqual({ '$httpMethod': 'PUT', - '$httpHeaders': 'Content-Type%3Aapplication%2Fjson%0D%0A' + '$httpHeaders': 'Content-Type%3Aapplication%2Fjson%0D%0A', }); }); - it('handles would-trigger-preflight cors method with optional query params', - () => { - const params: MakeRequestParams = { - path: 'v1/whatever', - httpMethod: 'PUT', - methodId: 'someservice.whatever.put', - headers: {}, - }; - bypassCorsPreflight(params); - expect(params.headers).toEqual({'Content-Type': 'text/plain'}); - expect(params.httpMethod).toEqual('POST'); - expect(params.queryParams).toEqual({ - '$httpMethod': 'PUT', - '$httpHeaders': 'Content-Type%3Aapplication%2Fjson%0D%0A' - }); - }); + it('handles would-trigger-preflight cors method with optional query params', () => { + const params: MakeRequestParams = { + path: 'v1/whatever', + httpMethod: 'PUT', + methodId: 'someservice.whatever.put', + headers: {}, + }; + bypassCorsPreflight(params); + expect(params.headers).toEqual({'Content-Type': 'text/plain'}); + expect(params.httpMethod).toEqual('POST'); + expect(params.queryParams).toEqual({ + '$httpMethod': 'PUT', + '$httpHeaders': 'Content-Type%3Aapplication%2Fjson%0D%0A', + }); + }); it('handles simple cors headers', () => { const params: MakeRequestParams = { @@ -183,57 +186,55 @@ describe('bypassCorsPreflight', () => { expect(params.queryParams).toEqual({'$httpHeaders': 'foo%3Abar%0D%0A'}); }); - it('handles would-trigger-preflight cors headers without safe headers', - () => { - const params: MakeRequestParams = { - path: 'v1/whatever', - httpMethod: 'GET', - methodId: 'someservice.whatever.get', - headers: {'foo': 'bar'}, - queryParams: {}, - }; - bypassCorsPreflight(params); - expect(params.headers).toEqual({}); - expect(params.httpMethod).toEqual('GET'); - expect(params.queryParams).toEqual({'$httpHeaders': 'foo%3Abar%0D%0A'}); - }); - - it('handles would-trigger-preflight cors headers with existing query params', - () => { - const params: MakeRequestParams = { - path: 'v1/whatever', - httpMethod: 'GET', - methodId: 'someservice.whatever.get', - headers: {'accept-language': 'de', 'foo': 'bar', 'a': 'b'}, - queryParams: {'hello': 'world'}, - }; - bypassCorsPreflight(params); - expect(params.headers).toEqual({'accept-language': 'de'}); - expect(params.httpMethod).toEqual('GET'); - expect(params.queryParams).toEqual({ - 'hello': 'world', - '$httpHeaders': 'foo%3Abar%0D%0Aa%3Ab%0D%0A' - }); - }); - - it('handles would-trigger-preflight cors headers and method with existing query params', - () => { - const params: MakeRequestParams = { - path: 'v1/whatever', - httpMethod: 'PUT', - methodId: 'someservice.whatever.put', - headers: {'accept-language': 'de', 'foo': 'bar'}, - queryParams: {'hello': 'world'}, - }; - bypassCorsPreflight(params); - expect(params.headers) - .toEqual({'accept-language': 'de', 'Content-Type': 'text/plain'}); - expect(params.httpMethod).toEqual('POST'); - expect(params.queryParams).toEqual({ - 'hello': 'world', - '$httpHeaders': - 'foo%3Abar%0D%0AContent-Type%3Aapplication%2Fjson%0D%0A', - '$httpMethod': 'PUT' - }); - }); + it('handles would-trigger-preflight cors headers without safe headers', () => { + const params: MakeRequestParams = { + path: 'v1/whatever', + httpMethod: 'GET', + methodId: 'someservice.whatever.get', + headers: {'foo': 'bar'}, + queryParams: {}, + }; + bypassCorsPreflight(params); + expect(params.headers).toEqual({}); + expect(params.httpMethod).toEqual('GET'); + expect(params.queryParams).toEqual({'$httpHeaders': 'foo%3Abar%0D%0A'}); + }); + + it('handles would-trigger-preflight cors headers with existing query params', () => { + const params: MakeRequestParams = { + path: 'v1/whatever', + httpMethod: 'GET', + methodId: 'someservice.whatever.get', + headers: {'accept-language': 'de', 'foo': 'bar', 'a': 'b'}, + queryParams: {'hello': 'world'}, + }; + bypassCorsPreflight(params); + expect(params.headers).toEqual({'accept-language': 'de'}); + expect(params.httpMethod).toEqual('GET'); + expect(params.queryParams).toEqual({ + 'hello': 'world', + '$httpHeaders': 'foo%3Abar%0D%0Aa%3Ab%0D%0A', + }); + }); + + it('handles would-trigger-preflight cors headers and method with existing query params', () => { + const params: MakeRequestParams = { + path: 'v1/whatever', + httpMethod: 'PUT', + methodId: 'someservice.whatever.put', + headers: {'accept-language': 'de', 'foo': 'bar'}, + queryParams: {'hello': 'world'}, + }; + bypassCorsPreflight(params); + expect(params.headers).toEqual({ + 'accept-language': 'de', + 'Content-Type': 'text/plain', + }); + expect(params.httpMethod).toEqual('POST'); + expect(params.queryParams).toEqual({ + 'hello': 'world', + '$httpHeaders': 'foo%3Abar%0D%0AContent-Type%3Aapplication%2Fjson%0D%0A', + '$httpMethod': 'PUT', + }); + }); }); diff --git a/python/ee/__init__.py b/python/ee/__init__.py index b61d9bcf8..bfdb92b57 100644 --- a/python/ee/__init__.py +++ b/python/ee/__init__.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 """The EE Python library.""" -__version__ = '0.1.384' +__version__ = '0.1.385' # Using lowercase function naming to match the JavaScript names. # pylint: disable=g-bad-name @@ -44,6 +44,7 @@ from .geometry import Geometry from .image import Image from .imagecollection import ImageCollection +from .pixeltype import PixelType from .serializer import Serializer from .terrain import Terrain @@ -136,6 +137,14 @@ def Initialize( """ if credentials == 'persistent': credentials = data.get_persistent_credentials() + if not project and credentials and hasattr(credentials, 'quota_project_id'): + project = credentials.quota_project_id + # SDK credentials are not authorized for EE so a project must be given. + if not project and oauth.is_sdk_credentials(credentials): + raise EEException( + 'ee.Initialize: no project found. ' + 'Call with project= or see Earth Engine Authentication docs.' + ) data.initialize( credentials=credentials, @@ -162,6 +171,7 @@ def Initialize( ImageCollection.initialize() List.initialize() Number.initialize() + PixelType.initialize() String.initialize() Terrain.initialize() @@ -189,6 +199,7 @@ def Reset() -> None: ImageCollection.reset() List.reset() Number.reset() + PixelType.reset() String.reset() Terrain.reset() @@ -375,13 +386,14 @@ def _InitializeGeneratedClasses() -> None: def _MakeClass(name: str) -> Type[Any]: """Generates a dynamic API class for a given name.""" - def init(self, *args): + def init(self, *args, **kwargs): """Initializer for dynamically created classes. Args: self: The instance of this class. Listed to make the linter hush. *args: Either a ComputedObject to be promoted to this type, or arguments to an algorithm with the same name as this class. + **kwargs: Any kwargs passed to this class constructor. Returns: The new class. @@ -389,13 +401,11 @@ def init(self, *args): a_class = globals()[name] onlyOneArg = (len(args) == 1) # Are we trying to cast something that's already of the right class? - if onlyOneArg and isinstance(args[0], a_class): - pass - else: + if not (onlyOneArg and isinstance(args[0], a_class)): # Decide whether to call a server-side constructor or just do a # client-side cast. ctor = ApiFunction.lookupInternal(name) - firstArgIsPrimitive = not isinstance(args[0], ComputedObject) + firstArgIsPrimitive = not isinstance((args or [None])[0], ComputedObject) shouldUseConstructor = False if ctor: if not onlyOneArg: @@ -409,10 +419,10 @@ def init(self, *args): shouldUseConstructor = True # Apply our decision. - if shouldUseConstructor: + if shouldUseConstructor and ctor: # Call ctor manually to avoid having promote() called on the output. - ComputedObject.__init__( - self, ctor, ctor.promoteArgs(ctor.nameArgs(args))) + promoted_args = ctor.promoteArgs(ctor.nameArgs(args, kwargs)) + ComputedObject.__init__(self, ctor, promoted_args) else: # Just cast and hope for the best. if not onlyOneArg: diff --git a/python/ee/_cloud_api_utils.py b/python/ee/_cloud_api_utils.py index a26557c60..a15313bcc 100644 --- a/python/ee/_cloud_api_utils.py +++ b/python/ee/_cloud_api_utils.py @@ -165,6 +165,9 @@ def build_cloud_resource( if http_transport is None: http_transport = _Http(session, timeout) if credentials is not None: + # Suppress the quota project, to avoid serviceUsage error from discovery. + if credentials.quota_project_id: + credentials = credentials.with_quota_project(None) http_transport = google_auth_httplib2.AuthorizedHttp( credentials, http=http_transport ) diff --git a/python/ee/batch.py b/python/ee/batch.py index 6c7348b7c..02b535743 100644 --- a/python/ee/batch.py +++ b/python/ee/batch.py @@ -249,7 +249,7 @@ def __new__( single positive integer as the maximum dimension or "WIDTHxHEIGHT" where WIDTH and HEIGHT are each positive integers. - skipEmptyTiles: If true, skip writing empty (i.e. fully-masked) - image tiles. Defaults to false. + image tiles. Defaults to false. Only supported on GeoTIFF exports. If exporting to Google Drive (default): - driveFolder: The Google Drive Folder that the export will reside in. Note: (a) if the folder name exists at any level, the output @@ -390,7 +390,7 @@ def toCloudStorage(image, still be clipped to the overall image dimensions. Must be a multiple of shardSize. skipEmptyTiles: If true, skip writing empty (i.e. fully-masked) - image tiles. Defaults to false. + image tiles. Defaults to false. Only supported on GeoTIFF exports. fileFormat: The string file format to which the image is exported. Currently only 'GeoTIFF' and 'TFRecord' are supported, defaults to 'GeoTIFF'. @@ -461,7 +461,7 @@ def toDrive(image, still be clipped to the overall image dimensions. Must be a multiple of shardSize. skipEmptyTiles: If true, skip writing empty (i.e. fully-masked) - image tiles. Defaults to false. + image tiles. Defaults to false. Only supported on GeoTIFF exports. fileFormat: The string file format to which the image is exported. Currently only 'GeoTIFF' and 'TFRecord' are supported, defaults to 'GeoTIFF'. @@ -1099,8 +1099,11 @@ def _prepare_image_export_config( # into the image's Expression. # - The request ID will be populated when the Task is created. # We've been deleting config parameters as we handle them. Anything left - # over is a problem. + # over is a problem. We can provide helpful error messages for some edge + # cases like params that only work for specific export types. if config: + if 'skipEmptyTiles' in config: + raise ValueError('skipEmptyTiles is only supported for GeoTIFF exports.') raise ee_exception.EEException( 'Unknown configuration options: {}.'.format(config)) diff --git a/python/ee/blob.py b/python/ee/blob.py index ddad82e35..7952a4af9 100644 --- a/python/ee/blob.py +++ b/python/ee/blob.py @@ -30,7 +30,7 @@ class Blob(computedobject.ComputedObject): _HAS_DYNAMIC_ATTRIBUTES = True def __init__(self, url: Union[str, computedobject.ComputedObject]): - """Create a Blob wrapper. + """Creates a Blob wrapper. Args: url: Where to fetch the blob on GCS. Must start with "gs://". This must @@ -39,6 +39,11 @@ def __init__(self, url: Union[str, computedobject.ComputedObject]): self.initialize() if isinstance(url, computedobject.ComputedObject): + if url.func and url.func.getSignature()['returns'] == self.name(): + # If it is a call that is already returning a Blob, just cast. + super().__init__(url.func, url.args, url.varName) + return + super().__init__(apifunction.ApiFunction(self.name()), {'url': url}) return diff --git a/python/ee/cli/utils.py b/python/ee/cli/utils.py index f5a0bb6cb..0b47faf34 100644 --- a/python/ee/cli/utils.py +++ b/python/ee/cli/utils.py @@ -5,6 +5,7 @@ the commands supported by the EE command line tool. It also defines the classes for configuration and runtime context management. """ + import collections import datetime import json @@ -17,7 +18,6 @@ import urllib.parse from google.cloud import storage -from google.oauth2 import credentials import httplib2 import ee @@ -34,13 +34,9 @@ CONFIG_PARAMS: Dict[str, Union[str, List[str], None]] = { 'account': None, - 'client_id': ee.oauth.CLIENT_ID, - 'client_secret': ee.oauth.CLIENT_SECRET, 'cloud_api_key': None, 'private_key': None, 'project': None, - 'refresh_token': None, - 'scopes': ee.oauth.SCOPES, 'url': 'https://earthengine.googleapis.com', } @@ -70,13 +66,9 @@ class CommandLineConfig: # In CONFIG_PARAMS: account: str - client_id: str - client_secret: str cloud_api_key: str private_key: str project: str - refresh_token: str - scopes: List[str] url: str def __init__( @@ -107,14 +99,6 @@ def _get_credentials(self): self.service_account_file) elif self.account and self.private_key: return ee.ServiceAccountCredentials(self.account, self.private_key) - elif self.refresh_token: - return credentials.Credentials( - None, - client_id=self.client_id, - client_secret=self.client_secret, - refresh_token=self.refresh_token, - scopes=self.scopes, - token_uri=ee.oauth.TOKEN_URI) else: return 'persistent' diff --git a/python/ee/data.py b/python/ee/data.py index 0feec5052..f0c6c9c39 100644 --- a/python/ee/data.py +++ b/python/ee/data.py @@ -238,36 +238,46 @@ def is_initialized() -> bool: def get_persistent_credentials() -> credentials_lib.Credentials: - """Read persistent credentials from ~/.config/earthengine. + """Read persistent credentials from ~/.config/earthengine or ADC. Raises EEException with helpful explanation if credentials don't exist. Returns: - OAuth2Credentials built from persistently stored refresh_token + OAuth2Credentials built from persistently stored refresh_token, containing + the client project in the quota_project_id field, if available. """ + credentials = None + args = {} try: - return credentials_lib.Credentials( - None, **oauth.get_credentials_arguments() - ) + args = oauth.get_credentials_arguments() except IOError: - # Before raising, try default credentials as a fallback. + pass + if args.get('refresh_token'): + credentials = credentials_lib.Credentials(None, **args) + else: + # If EE credentials aren't available, try application default credentials. try: credentials, unused_project_id = google.auth.default() - return credentials except google.auth.exceptions.DefaultCredentialsError: pass - raise ee_exception.EEException( # pylint: disable=raise-missing-from - 'Please authorize access to your Earth Engine account by ' - 'running\n\nearthengine authenticate\n\n' - 'in your command line, or ee.Authenticate() in Python, and then retry.' - ) + if credentials: + # earthengine set_project always overrides gcloud set-quota-project + project = args.get('quota_project_id') or oauth.get_appdefault_project() + if project and project != credentials.quota_project_id: + credentials = credentials.with_quota_project(project) + return credentials + raise ee_exception.EEException( # pylint: disable=raise-missing-from + 'Please authorize access to your Earth Engine account by ' + 'running\n\nearthengine authenticate\n\n' + 'in your command line, or ee.Authenticate() in Python, and then retry.' + ) def reset() -> None: """Resets the data module, clearing credentials and custom base URLs.""" global _api_base_url, _tile_base_url, _credentials, _initialized global _requests_session, _cloud_api_resource, _cloud_api_resource_raw - global _cloud_api_base_url + global _cloud_api_base_url, _cloud_api_user_project global _cloud_api_key, _http_transport _credentials = None _api_base_url = None @@ -279,6 +289,8 @@ def reset() -> None: _cloud_api_key = None _cloud_api_resource = None _cloud_api_resource_raw = None + _cloud_api_user_project = None + _cloud_api_utils.set_cloud_api_user_project(DEFAULT_CLOUD_API_USER_PROJECT) _http_transport = None _initialized = False diff --git a/python/ee/oauth.py b/python/ee/oauth.py index 6d8805c4e..7229b7818 100644 --- a/python/ee/oauth.py +++ b/python/ee/oauth.py @@ -44,6 +44,7 @@ CLIENT_SECRET = 'RUP0RZ6e0pPhDzsqIJ7KlNd1' SCOPES = [ 'https://www.googleapis.com/auth/earthengine', + 'https://www.googleapis.com/auth/cloud-platform', 'https://www.googleapis.com/auth/devstorage.full_control' ] REDIRECT_URI = 'urn:ietf:wg:oauth:2.0:oob' # Prompts user to copy-paste code @@ -68,6 +69,8 @@ TEXT_BROWSERS = ['elinks', 'links', 'lynx', 'w3m', 'www-browser'] # Environment variables indicating valid compositors on Linux. DISPLAY_VARIABLES = ['DISPLAY', 'WAYLAND_DISPLAY', 'MIR_SOCKET'] +# Projects owned by Google SDKs, which do not have the EE API enabled. +SDK_PROJECTS = ['764086051850', '618104708054', '32555940559'] def get_credentials_path() -> str: @@ -82,13 +85,29 @@ def get_credentials_arguments() -> Dict[str, Any]: stored = json.load(creds) args = {} args['token_uri'] = TOKEN_URI # Not overridable in file - args['refresh_token'] = stored['refresh_token'] # Must be present + args['refresh_token'] = stored.get('refresh_token') args['client_id'] = stored.get('client_id', CLIENT_ID) args['client_secret'] = stored.get('client_secret', CLIENT_SECRET) args['scopes'] = stored.get('scopes', SCOPES) + args['quota_project_id'] = stored.get('project') return args +def is_sdk_credentials(credentials: Optional[Any]) -> bool: + client = (credentials and getattr(credentials, 'client_id', None)) or '' + return client.split('-')[0] in SDK_PROJECTS + + +def get_appdefault_project() -> Optional[str]: + try: + adc_path = _cloud_sdk.get_application_default_credentials_path() + with open(adc_path) as adc_json: + adc = json.load(adc_json) + return adc.get('quota_project_id') + except FileNotFoundError: + return None + + def _valid_credentials_exist() -> bool: try: creds = ee_data.get_persistent_credentials() @@ -413,7 +432,7 @@ def authenticate( auth_mode: Optional[str] = None, scopes: Optional[Sequence[str]] = None, force: bool = False, -) -> bool: +) -> Optional[bool]: """Prompts the user to authorize access to Earth Engine via OAuth2. Args: @@ -443,7 +462,8 @@ def authenticate( force: Will force authentication even if valid credentials already exist. Returns: - True if we found valid credentials and didn't run the auth flow. + True if we found valid credentials and didn't run the auth flow, or + otherwise None. Raises: Exception: on invalid arguments. diff --git a/python/ee/pixeltype.py b/python/ee/pixeltype.py new file mode 100644 index 000000000..3ace29297 --- /dev/null +++ b/python/ee/pixeltype.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python3 +"""A wrapper for PixelTypes.""" + +from typing import Any, Dict, Optional, Union + +from ee import apifunction +from ee import computedobject + + +class PixelType(computedobject.ComputedObject): + """An object to represent an Earth Engine PixelType. + + Examples: + # Convenience constructors: + ee.PixelType.int8() + ee.PixelType.int16() + ee.PixelType.int32() + ee.PixelType.int64() + + ee.PixelType.uint8() + ee.PixelType.uint16() + ee.PixelType.uint32() + + ee.PixelType.float() + ee.PixelType.double() + + # Explicit constructors: + ee.PixelType('int', 0, 1) + ee.PixelType('float', 1, 2, 3) + ee.PixelType('double', 2, 3, 4) + + # Example of the methods + pixeltype = ee.PixelType('double', -1, 2, 3) + print(pixeltype.getInfo()) + # {'type': 'PixelType', 'precision': 'double', 'min': -1, 'max': 2, + # 'dimensions': 3} + + print(pixeltype.precision().getInfo()) + # double + print(pixeltype.minValue().getInfo()) + # -1 + print(pixeltype.maxValue().getInfo()) + # 2 + print(pixeltype.dimensions().getInfo()) + # 3 + """ + + _initialized: bool = False + + def __init__( + self, + precision: Union[str, computedobject.ComputedObject], + # pylint: disable=invalid-name + minValue: Optional[Union[float, computedobject.ComputedObject]] = None, + maxValue: Optional[Union[float, computedobject.ComputedObject]] = None, + # pylint: enable=invalid-name + dimensions: Optional[Union[int, computedobject.ComputedObject]] = None, + ): + """Creates a PixelType wrapper. + + Args: + precision: The pixel precision, one of 'int', 'float', or 'double'. + minValue: The minimum value of pixels of this type. If precision is + 'float' or 'double', this can be null, signifying negative infinity. + maxValue: The maximum value of pixels of this type. If precision is + 'float' or 'double', this can be null, signifying positive infinity. + dimensions: The number of dimensions in which pixels of this type can + vary; 0 is a scalar, 1 is a vector, 2 is a matrix, etc. + """ + self.initialize() + + args: Dict[str, Any] = {'precision': precision} + if minValue is not None: + args['minValue'] = minValue + if maxValue is not None: + args['maxValue'] = maxValue + if dimensions is not None: + args['dimensions'] = dimensions + + func = apifunction.ApiFunction(self.name()) + super().__init__(func, args) + + @classmethod + def initialize(cls) -> None: + """Imports API functions to this class.""" + if not cls._initialized: + apifunction.ApiFunction.importApi(cls, cls.name(), cls.name()) + cls._initialized = True + + @classmethod + def reset(cls) -> None: + """Removes imported API functions from this class.""" + apifunction.ApiFunction.clearApi(cls) + cls._initialized = False + + @staticmethod + def name() -> str: + return 'PixelType' diff --git a/python/ee/tests/_cloud_api_utils_test.py b/python/ee/tests/_cloud_api_utils_test.py index 4e8ff5bd5..860cbca7e 100644 --- a/python/ee/tests/_cloud_api_utils_test.py +++ b/python/ee/tests/_cloud_api_utils_test.py @@ -2,8 +2,13 @@ """Test for ee._cloud_api_utils.""" import json +from unittest import mock import warnings +from google.oauth2 import credentials +from googleapiclient import discovery +import requests + from ee import _cloud_api_utils from ee import ee_exception import unittest @@ -15,6 +20,26 @@ def setUp(self): super().setUp() _cloud_api_utils.set_cloud_api_user_project('earthengine-legacy') + def test_build_cloud_resource(self): + base = 'https://earthengine.basetest' + path = '$discovery/rest?version=v1&labels=GOOGLE_INTERNAL&prettyPrint=false' + def check_build(api, unused_version, **kwargs): + self.assertEqual('earthengine', api) + self.assertEqual(base + '/' + path, kwargs.get('discoveryServiceUrl')) + http = kwargs.get('http') + self.assertIsNotNone(http) + self.assertIsNone(http.credentials.quota_project_id) + return mock.Mock() + + with mock.patch.object(discovery, 'build', side_effect=check_build) as run: + session = requests.Session() + cred_args = dict(token=None, refresh_token='rt', quota_project_id='qp') + resource = _cloud_api_utils.build_cloud_resource( + base, session, credentials=credentials.Credentials(**cred_args) + ) + self.assertEqual(base, resource._baseUrl) + run.assert_called_once() + def test_convert_dict_simple(self): result = _cloud_api_utils._convert_dict({ 'x': 99, diff --git a/python/ee/tests/batch_test.py b/python/ee/tests/batch_test.py index b78aa6121..d7d85dd0b 100644 --- a/python/ee/tests/batch_test.py +++ b/python/ee/tests/batch_test.py @@ -240,6 +240,19 @@ def testExportImageCloudApi(self): task.config, ) + def testExportImageCloudApiInvalidSkipEmptyTiles(self): + """Verifies errors are thrown when incorrectly specifying skipEmptyTiles.""" + with apitestcase.UsingCloudApi(): + with self.assertRaisesRegex( + ValueError, 'skipEmptyTiles is only supported for GeoTIFF' + ): + ee.batch.Export.image.toDrive( + ee.Image(1), + 'TestDescription', + fileFormat='TFRecord', + skipEmptyTiles=True, + ) + def testExportImageWithTfRecordCloudApi(self): """Verifies the task created by Export.image().""" with apitestcase.UsingCloudApi(): diff --git a/python/ee/tests/blob_test.py b/python/ee/tests/blob_test.py index 1ee2d721b..fb3e52c5a 100644 --- a/python/ee/tests/blob_test.py +++ b/python/ee/tests/blob_test.py @@ -36,6 +36,31 @@ def test_blob(self): } self.assertEqual(expect, result) + self.assertEqual({'value': 'fakeValue'}, blob.getInfo()) + + def test_computed_object(self): + """Verifies that untyped calls wrap the result in a ComputedObject.""" + url = 'gs://ee-docs-demos/something' + result = ee.ApiFunction.call_('Blob', url) + serialized = result.serialize() + self.assertIsInstance(serialized, str) + + expected = { + 'result': '0', + 'values': { + '0': { + 'functionInvocationValue': { + 'functionName': 'Blob', + 'arguments': { + 'url': {'constantValue': url}, + }, + } + } + }, + } + self.assertEqual(expected, json.loads(serialized)) + self.assertEqual({'value': 'fakeValue'}, result.getInfo()) + def test_wrong_arg_type(self): message = 'Blob url must be a string: -> "123"' with self.assertRaisesRegex(ValueError, message): diff --git a/python/ee/tests/ee_test.py b/python/ee/tests/ee_test.py index 9491b559b..fc23155c8 100644 --- a/python/ee/tests/ee_test.py +++ b/python/ee/tests/ee_test.py @@ -1,9 +1,14 @@ #!/usr/bin/env python3 """Test for the ee.__init__ file.""" +from unittest import mock + +import google.auth +from google.oauth2 import credentials + +import ee from ee import apitestcase import unittest -import ee class EETestCase(apitestcase.ApiTestCase): @@ -28,9 +33,10 @@ def MockAlgorithms(): self.assertFalse(ee.Image._initialized) # Verify that ee.Initialize() sets the URL and initializes classes. - ee.Initialize(None, 'foo') + ee.Initialize(None, 'foo', project='my-project') self.assertTrue(ee.data._initialized) self.assertEqual(ee.data._api_base_url, 'foo/api') + self.assertEqual(ee.data._cloud_api_user_project, 'my-project') self.assertEqual(ee.ApiFunction._api, {}) self.assertTrue(ee.Image._initialized) @@ -43,9 +49,51 @@ def MockAlgorithms(): ee.Reset() self.assertFalse(ee.data._initialized) self.assertIsNone(ee.data._api_base_url) + self.assertIsNone(ee.data._cloud_api_user_project) self.assertEqual(ee.ApiFunction._api, {}) self.assertFalse(ee.Image._initialized) + def testProjectInitialization(self): + """Verifies that we can fetch the client project from many locations. + + This also exercises the logic in data.get_persistent_credentials. + """ + + cred_args = dict(refresh_token='rt', quota_project_id='qp1') + google_creds = credentials.Credentials(token=None, quota_project_id='qp2') + expected_project = None + + def CheckDataInit(**kwargs): + self.assertEqual(expected_project, kwargs.get('project')) + + moc = mock.patch.object + with (moc(ee.oauth, 'get_credentials_arguments', new=lambda: cred_args), + moc(google.auth, 'default', new=lambda: (google_creds, None)), + moc(ee.data, 'initialize', side_effect=CheckDataInit) as inits): + expected_project = 'qp0' + ee.Initialize(project='qp0') + + expected_project = 'qp1' + ee.Initialize() + + cred_args['refresh_token'] = None + ee.Initialize() + + cred_args['quota_project_id'] = None + expected_project = 'qp2' + ee.Initialize() + + google_creds = google_creds.with_quota_project(None) + expected_project = None + ee.Initialize() + self.assertEqual(5, inits.call_count) + + cred_args['client_id'] = '764086051850-xxx' # dummy usable-auth client + cred_args['refresh_token'] = 'rt' + with self.assertRaisesRegex(ee.EEException, '.*no project found..*'): + ee.Initialize() + self.assertEqual(5, inits.call_count) + def testCallAndApply(self): """Verifies library initialization.""" @@ -287,6 +335,21 @@ def MockAlgorithms(): self.assertIsInstance(cast, ee.Bar) self.assertEqual(ctor, cast.func) + # Tests for kwargs. + foo = ee.Foo(arg1='a', arg2='b') + self.assertEqual(foo.args, {'arg1': 'a', 'arg2': 'b'}) + foo = ee.Foo('a', arg2='b') + self.assertEqual(foo.args, {'arg1': 'a', 'arg2': 'b'}) + foo = ee.Foo(arg2='b', arg1='a') + self.assertEqual(foo.args, {'arg1': 'a', 'arg2': 'b'}) + + # We should get an error for an invalid kwarg. + with self.assertRaisesRegex( + ee.EEException, + "Unrecognized arguments {'arg_invalid'} to function: Foo", + ): + ee.Foo('a', arg_invalid='b') + # We shouldn't be able to cast with more than 1 arg. with self.assertRaisesRegex( ee.EEException, 'Too many arguments for ee.Bar'): diff --git a/python/ee/tests/pixeltype_test.py b/python/ee/tests/pixeltype_test.py new file mode 100644 index 000000000..63a65c11f --- /dev/null +++ b/python/ee/tests/pixeltype_test.py @@ -0,0 +1,165 @@ +#!/usr/bin/env python3 +"""Tests for the ee.PixelType module. + +Everything except the PixelType constructor is dynamically generated. +""" + +import enum +import json + +import ee +from ee import apitestcase +import unittest + + +class Type(str, enum.Enum): + DOUBLE = 'double' + FLOAT = 'float' + INT = 'int' + +DIMENSIONS_KEY = 'dimensions' +MAX_VALUE_KEY = 'maxValue' +MIN_VALUE_KEY = 'minValue' +PRECISION_KEY = 'precision' + +PIXELTYPE = 'PixelType' + + +class PixelTypeTest(apitestcase.ApiTestCase): + + def test_int(self): + precision = Type.INT + min_value = 0 + max_value = 1 + dimensions = 2 + pixeltype = ee.PixelType(precision, min_value, max_value, dimensions) + self.assertEqual({'value': 'fakeValue'}, pixeltype.getInfo()) + + pixeltype_func = ee.ApiFunction.lookup('PixelType') + self.assertEqual(pixeltype_func, pixeltype.func) + + self.assertFalse(pixeltype.isVariable()) + self.assertEqual( + { + DIMENSIONS_KEY: dimensions, + MAX_VALUE_KEY: max_value, + MIN_VALUE_KEY: min_value, + PRECISION_KEY: precision, + }, + pixeltype.args, + ) + + result = json.loads(pixeltype.serialize()) + expect = { + 'result': '0', + 'values': { + '0': { + 'functionInvocationValue': { + 'arguments': { + DIMENSIONS_KEY: {'constantValue': dimensions}, + MAX_VALUE_KEY: {'constantValue': max_value}, + MIN_VALUE_KEY: {'constantValue': min_value}, + PRECISION_KEY: {'constantValue': precision}, + }, + 'functionName': PIXELTYPE, + } + } + }, + } + self.assertEqual(expect, result) + + def test_minimal_double(self): + precision = Type.DOUBLE + pixeltype = ee.PixelType(precision) + result = json.loads(pixeltype.serialize()) + expect = { + 'result': '0', + 'values': { + '0': { + 'functionInvocationValue': { + 'arguments': {PRECISION_KEY: {'constantValue': precision}}, + 'functionName': PIXELTYPE, + } + } + }, + } + self.assertEqual(expect, result) + + def test_float_named_args(self): + precision = Type.FLOAT + min_value = 3 + max_value = 4 + dimensions = 5 + pixeltype = ee.PixelType( + dimensions=dimensions, + precision=precision, + minValue=min_value, + maxValue=max_value, + ) + result = json.loads(pixeltype.serialize()) + expect = { + 'result': '0', + 'values': { + '0': { + 'functionInvocationValue': { + 'arguments': { + DIMENSIONS_KEY: {'constantValue': dimensions}, + MAX_VALUE_KEY: {'constantValue': max_value}, + MIN_VALUE_KEY: {'constantValue': min_value}, + PRECISION_KEY: {'constantValue': precision}, + }, + 'functionName': PIXELTYPE, + } + } + }, + } + self.assertEqual(expect, result) + + cast_result = json.loads(ee.PixelType(pixeltype).serialize()) + self.assertEqual(expect, cast_result) + + def test_float_computed_object_args(self): + precision = Type.FLOAT + min_value = 3 + max_value = 4 + dimensions = 5 + pixeltype = ee.PixelType( + precision=ee.String(precision).cat(''), + minValue=ee.Number(min_value), + maxValue=ee.Number(max_value), + dimensions=ee.Number(dimensions), + ) + result = json.loads(pixeltype.serialize()) + expected_precision = { + 'functionInvocationValue': { + 'functionName': 'String.cat', + 'arguments': { + 'string1': {'constantValue': 'float'}, + 'string2': {'constantValue': ''}, + }, + } + } + expect = { + 'result': '0', + 'values': { + '0': { + 'functionInvocationValue': { + 'arguments': { + DIMENSIONS_KEY: {'constantValue': dimensions}, + MAX_VALUE_KEY: {'constantValue': max_value}, + MIN_VALUE_KEY: {'constantValue': min_value}, + PRECISION_KEY: expected_precision, + }, + 'functionName': PIXELTYPE, + } + } + }, + } + self.assertEqual(expect, result) + + cast_result = json.loads(ee.PixelType(pixeltype).serialize()) + self.assertEqual(expect, cast_result) + + +if __name__ == '__main__': + unittest.main() diff --git a/python/pyproject.toml b/python/pyproject.toml index 6772f511c..4a26961f5 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "earthengine-api" -version = "0.1.384" +version = "0.1.385" description = "Earth Engine Python API" requires-python = ">=3.7" keywords = [ From 8fee1d9e26058a0f21a456772a53d376f76d5e3f Mon Sep 17 00:00:00 2001 From: Google Earth Engine Authors Date: Thu, 11 Jan 2024 17:29:46 +0000 Subject: [PATCH 002/201] v0.1.386 PiperOrigin-RevId: 597577360 --- javascript/build/ee_api_js.js | 664 +++++++++--------- javascript/build/ee_api_js_debug.js | 301 ++++---- javascript/build/ee_api_js_npm.js | 345 ++++----- javascript/package.json | 2 +- javascript/src/apiclient.js | 2 +- python/ee/__init__.py | 9 +- python/ee/_cloud_api_utils.py | 1 - python/ee/_helpers.py | 1 - python/ee/_utils.py | 1 - python/ee/apifunction.py | 1 - python/ee/apitestcase.py | 1 - python/ee/batch.py | 135 ++-- python/ee/blob.py | 3 +- python/ee/cli/__init__.py | 1 - python/ee/cli/commands.py | 1 - python/ee/cli/utils.py | 1 - python/ee/collection.py | 1 - python/ee/computedobject.py | 8 +- python/ee/customfunction.py | 1 - python/ee/data.py | 1 - python/ee/deprecation.py | 1 - python/ee/deserializer.py | 1 - python/ee/dictionary.py | 6 +- python/ee/ee_date.py | 3 +- python/ee/ee_exception.py | 1 - python/ee/ee_list.py | 1 - python/ee/ee_number.py | 1 - python/ee/ee_string.py | 3 +- python/ee/ee_types.py | 1 - python/ee/element.py | 1 - python/ee/encodable.py | 1 - python/ee/errormargin.py | 89 +++ python/ee/feature.py | 1 - python/ee/featurecollection.py | 1 - python/ee/filter.py | 1 - python/ee/function.py | 1 - python/ee/geometry.py | 1 - python/ee/image.py | 1 - python/ee/image_converter.py | 1 - python/ee/imagecollection.py | 1 - python/ee/join.py | 60 ++ python/ee/mapclient.py | 1 - python/ee/oauth.py | 4 +- python/ee/pixeltype.py | 1 - python/ee/serializer.py | 1 - python/ee/table_converter.py | 1 - python/ee/terrain.py | 1 - python/ee/tests/computedobject_test.py | 9 + python/ee/tests/data_test.py | 14 + python/ee/tests/errormargin_test.py | 169 +++++ python/ee/tests/image_test.py | 6 + python/ee/tests/join_test.py | 95 +++ .../examples/py/FeatureCollection/buffer.py | 1 - .../FeatureCollection/computed_area_filter.py | 1 - .../py/FeatureCollection/count_features.py | 1 - .../py/FeatureCollection/from_polygons.py | 1 - python/examples/py/FeatureCollection/join.py | 1 - .../py/FeatureCollection/reverse_mask.py | 1 - python/examples/py/Image/download.py | 1 - python/examples/py/Image/from_name.py | 1 - python/examples/py/Image/hdr_landsat.py | 1 - python/examples/py/Image/hillshade.py | 1 - python/examples/py/Image/hsv_pan_sharpen.py | 1 - python/examples/py/Image/landcover_cleanup.py | 1 - python/examples/py/Image/where.py | 1 - .../py/ImageCollection/clipped_composite.py | 1 - .../py/ImageCollection/expression_map.py | 1 - .../py/ImageCollection/filtered_composite.py | 1 - python/pyproject.toml | 2 +- 69 files changed, 1131 insertions(+), 846 deletions(-) create mode 100644 python/ee/errormargin.py create mode 100644 python/ee/join.py create mode 100644 python/ee/tests/errormargin_test.py create mode 100644 python/ee/tests/join_test.py diff --git a/javascript/build/ee_api_js.js b/javascript/build/ee_api_js.js index 8a3237d01..f67e25e85 100644 --- a/javascript/build/ee_api_js.js +++ b/javascript/build/ee_api_js.js @@ -1,17 +1,17 @@ (function(){var h,aa=function(a){var b=0;return function(){return b>>0)+"_",d=0,e=function(g){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new b(c+(g||"")+"_"+d++,g)};return e}); +da("Symbol",function(a){if(a)return a;var b=function(g,f){this.Vi=g;ba(this,"description",{configurable:!0,writable:!0,value:f})};b.prototype.toString=function(){return this.Vi};var c="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",d=0,e=function(g){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new b(c+(g||"")+"_"+d++,g)};return e}); da("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c>>0),Ba=0,Da=function(a,b,c){return a.call.apply(a.bind, arguments)},Ea=function(a,b,c){if(!a)throw Error();if(2c&&(c=Math.max(0,a.length+c));if("string"===typeof a)return"string"!==typeof b|| 1!=b.length?-1:a.lastIndexOf(b,c);for(;0<=c;c--)if(c in a&&a[c]===b)return c;return-1},Ua=Array.prototype.forEach?function(a,b){B(null!=a.length);Array.prototype.forEach.call(a,b,void 0)}:function(a,b){for(var c=a.length,d="string"===typeof a?a.split(""):a,e=0;ea-0)return[];for(var c=0;c>>0),cc=function(a){B(a,"Listener can not be null.");if("function"===typeof a)return a;B(a.handleEvent,"An object listener must have handleEvent method.");a[kc]||(a[kc]=function(b){return a.handleEvent(b)}); -return a[kc]};var D=function(){y.call(this);this.Ia=new Vb(this);this.Pk=this;this.Wf=null};x(D,y);D.prototype[Ab]=!0;h=D.prototype;h.addEventListener=function(a,b,c,d){bc(this,a,b,c,d)};h.removeEventListener=function(a,b,c,d){ic(this,a,b,c,d)}; -h.dispatchEvent=function(a){lc(this);var b=this.Wf;if(b){var c=[];for(var d=1;b;b=b.Wf)c.push(b),B(1E3>++d,"infinite loop")}b=this.Pk;d=a.type||a;if("string"===typeof a)a=new A(a,b);else if(a instanceof A)a.target=a.target||b;else{var e=a;a=new A(d,b);Ub(a,e)}e=!0;if(c)for(var g=c.length-1;!a.cd&&0<=g;g--){var f=a.currentTarget=c[g];e=mc(f,d,!0,a)&&e}a.cd||(f=a.currentTarget=b,e=mc(f,d,!0,a)&&e,a.cd||(e=mc(f,d,!1,a)&&e));if(c)for(g=0;!a.cd&&g=a.length)return sc;if(b in a)return{value:a[b++],done:!1};b++}};return c}throw Error("Not implemented");},uc=function(a,b){if(xa(a))Ua(a,b);else for(a=tc(a);;){var c=a.next();if(c.done)break;b.call(void 0,c.value,void 0,a)}};var yc=function(a){if(a instanceof vc||a instanceof wc||a instanceof xc)return a;if("function"==typeof a.next)return new vc(function(){return a});if("function"==typeof a[Symbol.iterator])return new vc(function(){return a[Symbol.iterator]()});if("function"==typeof a.Da)return new vc(function(){return a.Da()});throw Error("Not an iterator or iterable.");},vc=function(a){this.wf=a};vc.prototype.Da=function(){return new wc(this.wf())};vc.prototype[Symbol.iterator]=function(){return new xc(this.wf())}; -vc.prototype.Bg=function(){return new xc(this.wf())};var wc=function(a){this.Sc=a};q(wc,rc);wc.prototype.next=function(){return this.Sc.next()};wc.prototype[Symbol.iterator]=function(){return new xc(this.Sc)};wc.prototype.Bg=function(){return new xc(this.Sc)};var xc=function(a){vc.call(this,function(){return a});this.Sc=a};q(xc,vc);xc.prototype.next=function(){return this.Sc.next()};var zc=function(a,b){this.A={};this.K=[];this.od=this.size=0;var c=arguments.length;if(1++d,"infinite loop")}b=this.Lk;d=a.type||a;if("string"===typeof a)a=new A(a,b);else if(a instanceof A)a.target=a.target||b;else{var e=a;a=new A(d,b);Ub(a,e)}e=!0;if(c)for(var g=c.length-1;!a.cd&&0<=g;g--){var f=a.currentTarget=c[g];e=mc(f,d,!0,a)&&e}a.cd||(f=a.currentTarget=b,e=mc(f,d,!0,a)&&e,a.cd||(e=mc(f,d,!1,a)&&e));if(c)for(g=0;!a.cd&&g=a.length)return sc;if(b in a)return{value:a[b++],done:!1};b++}};return c}throw Error("Not implemented");},uc=function(a,b){if(xa(a))Ua(a,b);else for(a=tc(a);;){var c=a.next();if(c.done)break;b.call(void 0,c.value,void 0,a)}};var yc=function(a){if(a instanceof vc||a instanceof wc||a instanceof xc)return a;if("function"==typeof a.next)return new vc(function(){return a});if("function"==typeof a[Symbol.iterator])return new vc(function(){return a[Symbol.iterator]()});if("function"==typeof a.Da)return new vc(function(){return a.Da()});throw Error("Not an iterator or iterable.");},vc=function(a){this.uf=a};vc.prototype.Da=function(){return new wc(this.uf())};vc.prototype[Symbol.iterator]=function(){return new xc(this.uf())}; +vc.prototype.xg=function(){return new xc(this.uf())};var wc=function(a){this.Sc=a};q(wc,rc);wc.prototype.next=function(){return this.Sc.next()};wc.prototype[Symbol.iterator]=function(){return new xc(this.Sc)};wc.prototype.xg=function(){return new xc(this.Sc)};var xc=function(a){vc.call(this,function(){return a});this.Sc=a};q(xc,vc);xc.prototype.next=function(){return this.Sc.next()};var zc=function(a,b){this.A={};this.K=[];this.od=this.size=0;var c=arguments.length;if(12*this.size&&Ac(this),!0):!1};var Ac=function(a){if(a.size!=a.K.length){for(var b=0,c=0;b=d.K.length)return sc;var g=d.K[b++];return{value:a?g:d.A[g],done:!1}};return e};h.mb=function(a){this.size=a};var Bc=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var Dc=function(a){if(a.R&&"function"==typeof a.R)a=a.R();else if(xa(a)||"string"===typeof a)a=a.length;else{var b=0,c;for(c in a)b++;a=b}return a},Ec=function(a){if(a.aa&&"function"==typeof a.aa)return a.aa();if("undefined"!==typeof Map&&a instanceof Map||"undefined"!==typeof Set&&a instanceof Set)return Array.from(a.values());if("string"===typeof a)return a.split("");if(xa(a)){for(var b=[],c=a.length,d=0;d=d.K.length)return sc;var g=d.K[b++];return{value:a?g:d.A[g],done:!1}};return e};h.mb=function(a){this.size=a};var Bc=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var Dc=function(a){if(a.R&&"function"==typeof a.R)a=a.R();else if(xa(a)||"string"===typeof a)a=a.length;else{var b=0,c;for(c in a)b++;a=b}return a},Ec=function(a){if(a.aa&&"function"==typeof a.aa)return a.aa();if("undefined"!==typeof Map&&a instanceof Map||"undefined"!==typeof Set&&a instanceof Set)return Array.from(a.values());if("string"===typeof a)return a.split("");if(xa(a)){for(var b=[],c=a.length,d=0;dc)return!1;!(b instanceof Ic)&&5e&&(e+=d);return[a.ml,c,e,b.y].join("/")};Nc.prototype.Nc=function(){return this.Ab.length};var Pc=function(a){A.call(this,"tileevent");this.count=a};x(Pc,A);var Qc=function(){},Rc=new Qc;function Sc(a){return Object.assign({},{P:{},Pl:{},keys:[],Ma:{},s:{},H:{},wh:!1},a)}var E=function(){this.h={}},F=function(a,b){return a.h.hasOwnProperty(b)?a.h[b]:null},G=function(a,b){return null!=a.h[b]};function Tc(a,b){return F(b,a)}function Uc(a,b,c){b[a]=c}function Vc(){return{}}function Wc(a,b){var c=new a;return null==b?c:Xc(b,Yc,Zc,$c,a)}function Yc(a,b){return b[a]}function Zc(a,b,c){b.h[a]=c} +Ic.prototype[Symbol.iterator]=function(){return this.values()};Ic.prototype.mb=function(a){this.size=a};var Nc=function(a,b,c){D.call(this);this.il=b;this.token=c;this.Ab=[];this.vg=new Ic;this.yb=0;this.url=a};x(Nc,D);w("ee.AbstractOverlay",Nc);var Oc=function(a,b,c){var d=1<e&&(e+=d);return[a.il,c,e,b.y].join("/")};Nc.prototype.Nc=function(){return this.Ab.length};var Pc=function(a){A.call(this,"tileevent");this.count=a};x(Pc,A);var Qc=function(){},Rc=new Qc;function Sc(a){return Object.assign({},{P:{},Nl:{},keys:[],Ma:{},s:{},H:{},sh:!1},a)}var E=function(){this.h={}},F=function(a,b){return a.h.hasOwnProperty(b)?a.h[b]:null},G=function(a,b){return null!=a.h[b]};function Tc(a,b){return F(b,a)}function Uc(a,b,c){b[a]=c}function Vc(){return{}}function Wc(a,b){var c=new a;return null==b?c:Xc(b,Yc,Zc,$c,a)}function Yc(a,b){return b[a]}function Zc(a,b,c){b.h[a]=c} function $c(a){if(null==a)throw Error("Cannot deserialize, target constructor was null.");return new a} -function Xc(a,b,c,d,e){e=d(e);for(var g=ad(a,e),f=g.P||{},l=g.s||{},m=g.Ma||{},p=n(g.keys||[]),v=p.next(),z={};!v.done;z={Xd:void 0},v=p.next()){v=v.value;var C=b(v,a);if(null!=C){var Q=void 0;if(f.hasOwnProperty(v)){if(g.wh&&0===C.length)continue;Q=bd(C,b,c,d,!0,!0,f[v])}else if(l.hasOwnProperty(v))Q=bd(C,b,c,d,!1,!0,l[v]);else if(m.hasOwnProperty(v))z.Xd=m[v],Q=z.Xd.pa?C.map(function(oa){return function(S){return cd(S,oa.Xd,b,c,d)}}(z)):cd(C,z.Xd,b,c,d);else if(Array.isArray(C)){if(g.wh&&0===C.length)continue; +function Xc(a,b,c,d,e){e=d(e);for(var g=ad(a,e),f=g.P||{},l=g.s||{},m=g.Ma||{},p=n(g.keys||[]),v=p.next(),z={};!v.done;z={Vd:void 0},v=p.next()){v=v.value;var C=b(v,a);if(null!=C){var Q=void 0;if(f.hasOwnProperty(v)){if(g.sh&&0===C.length)continue;Q=bd(C,b,c,d,!0,!0,f[v])}else if(l.hasOwnProperty(v))Q=bd(C,b,c,d,!1,!0,l[v]);else if(m.hasOwnProperty(v))z.Vd=m[v],Q=z.Vd.pa?C.map(function(oa){return function(S){return cd(S,oa.Vd,b,c,d)}}(z)):cd(C,z.Vd,b,c,d);else if(Array.isArray(C)){if(g.sh&&0===C.length)continue; Q=bd(C,b,c,d,!0,!1)}else Q=C instanceof Qc?null:C;c(v,e,Q)}}return e}function cd(a,b,c,d,e){for(var g={},f=n(Object.keys(a)),l=f.next();!l.done;l=f.next()){l=l.value;var m=a[l];null!=m&&(g[l]=bd(m,c,d,e,b.ra,b.qa,b.ka))}return g} -function bd(a,b,c,d,e,g,f){if(g&&null==f)throw Error("Cannot deserialize a reference object without a constructor.");return null==a?a:e&&g?a.map(function(l){return Xc(l,b,c,d,f)}):e&&!g?a.map(function(l){return l}):!e&&g?Xc(a,b,c,d,f):a instanceof Qc?null:"object"===typeof a?JSON.parse(JSON.stringify(a)):a}function ad(a,b){if(b instanceof E)a=Sc(b.i());else if(a instanceof E)a=Sc(a.i());else throw Error("Cannot find ClassMetadata.");return a};var dd;var fd=function(a,b){if(b!==ed)throw Error("TrustedResourceUrl is not meant to be built directly");this.Yf=a};fd.prototype.toString=function(){return this.Yf+""};fd.prototype.Sd=!0;fd.prototype.Md=function(){return this.Yf.toString()}; -var gd=function(a){if(a instanceof fd&&a.constructor===fd)return a.Yf;Na("expected object of type TrustedResourceUrl, got '%s' of type %s",a,wa(a));return"type_error:TrustedResourceUrl"},ed={},hd=function(a){if(void 0===dd){var b=null;var c=r.trustedTypes;if(c&&c.createPolicy)try{b=c.createPolicy("goog#html",{createHTML:Ga,createScript:Ga,createScriptURL:Ga})}catch(d){r.console&&r.console.error(d.message)}dd=b}a=(b=dd)?b.createScriptURL(a):a;return new fd(a,ed)};var jd=function(a,b){if(b!==id)throw Error("SafeUrl is not meant to be built directly");this.Xf=a};jd.prototype.toString=function(){return this.Xf.toString()};jd.prototype.Sd=!0;jd.prototype.Md=function(){return this.Xf.toString()};var kd=function(a){if(a instanceof jd&&a.constructor===jd)return a.Xf;Na("expected object of type SafeUrl, got '"+a+"' of type "+wa(a));return"type_error:SafeUrl"},id={},ld=new jd("about:invalid#zClosurez",id);new jd("about:blank",id);var md={},nd=function(){if(md!==md)throw Error("SafeStyle is not meant to be built directly");this.ri="";this.Sd=!0};nd.prototype.Md=function(){return this.ri};nd.prototype.toString=function(){return this.ri.toString()};new nd;var od={},pd=function(){if(od!==od)throw Error("SafeStyleSheet is not meant to be built directly");this.sl=""};pd.prototype.toString=function(){return this.sl.toString()};new pd;var qd={},rd=function(){var a=r.trustedTypes&&r.trustedTypes.emptyHTML||"";if(qd!==qd)throw Error("SafeHtml is not meant to be built directly");this.pi=a;this.Sd=!0};rd.prototype.Md=function(){return this.pi.toString()};rd.prototype.toString=function(){return this.pi.toString()};new rd;var td=function(a,b){if(!t(a)||!t(a)||!t(a)||1!==a.nodeType||a.namespaceURI&&"http://www.w3.org/1999/xhtml"!==a.namespaceURI||a.tagName.toUpperCase()!=="SCRIPT".toString()){var c="SCRIPT".toString()+"; got: ";if(t(a))try{var d=a.constructor.displayName||a.constructor.name||Object.prototype.toString.call(a)}catch(e){d=""}else d=void 0===a?"undefined":null===a?"null":typeof a;Na("Argument is not an HTML Element with tag name "+(c+d))}a:{c=(a.ownerDocument&&a.ownerDocument.defaultView|| -r).document;if(c.querySelector&&(c=c.querySelector("script[nonce]"))&&(c=c.nonce||c.getAttribute("nonce"))&&sd.test(c))break a;c=""}c&&a.setAttribute("nonce",c);a.src=gd(b)},sd=/^[\w+/_-]+[=]{0,2}$/;var ud=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1"}else d=void 0===a?"undefined":null===a?"null":typeof a;Na("Argument is not an HTML Element with tag name "+(c+d))}a:{c=(a.ownerDocument&&a.ownerDocument.defaultView|| +r).document;if(c.querySelector&&(c=c.querySelector("script[nonce]"))&&(c=c.nonce||c.getAttribute("nonce"))&&sd.test(c))break a;c=""}c&&a.setAttribute("nonce",c);a.src=gd(b)},sd=/^[\w+/_-]+[=]{0,2}$/;var ud=function(a,b){for(var c=a.split("%s"),d="",e=Array.prototype.slice.call(arguments,1);e.length&&1b)throw Error("Bad port number "+b);a.vc=b}else a.vc=null};yd.prototype.getPath=function(){return this.Zb};yd.prototype.setPath=function(a,b){Ad(this);this.Zb=b?Dd(a,!0):a;return this};var Cd=function(a,b,c){Ad(a);b instanceof Ed?(a.Ba=b,a.Ba.lg(a.za)):(c||(b=Fd(b,Kd)),a.Ba=new Ed(b,a.za))};yd.prototype.getQuery=function(){return this.Ba.toString()}; -yd.prototype.removeParameter=function(a){Ad(this);this.Ba.remove(a);return this};var Ad=function(a){if(a.hl)throw Error("Tried to modify a read-only Uri");};yd.prototype.lg=function(a){this.za=a;this.Ba&&this.Ba.lg(a)}; +var zd=function(a,b,c){Ad(a);a.wb=c?Dd(b,!0):b;a.wb&&(a.wb=a.wb.replace(/:$/,""))},Bd=function(a,b){Ad(a);if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.vc=b}else a.vc=null};yd.prototype.getPath=function(){return this.Zb};yd.prototype.setPath=function(a,b){Ad(this);this.Zb=b?Dd(a,!0):a;return this};var Cd=function(a,b,c){Ad(a);b instanceof Ed?(a.Ba=b,a.Ba.hg(a.za)):(c||(b=Fd(b,Kd)),a.Ba=new Ed(b,a.za))};yd.prototype.getQuery=function(){return this.Ba.toString()}; +yd.prototype.removeParameter=function(a){Ad(this);this.Ba.remove(a);return this};var Ad=function(a){if(a.dl)throw Error("Tried to modify a read-only Uri");};yd.prototype.hg=function(a){this.za=a;this.Ba&&this.Ba.hg(a)}; var Ld=function(a){return a instanceof yd?a.clone():new yd(a)},Dd=function(a,b){return a?b?decodeURI(a.replace(/%25/g,"%2525")):decodeURIComponent(a):""},Fd=function(a,b,c){return"string"===typeof a?(a=encodeURI(a).replace(b,Md),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null},Md=function(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)},Gd=/[#\/\?@]/g,Id=/[#\?:]/g,Hd=/[#\?]/g,Kd=/[#\?@]/g,Jd=/#/g,Ed=function(a,b){this.Y=this.N=null;this.ta=a||null;this.za=!!b},Nd= function(a){a.N||(a.N=new Map,a.Y=0,a.ta&&xd(a.ta,function(b,c){a.add(decodeURIComponent(b.replace(/\+/g," ")),c)}))};h=Ed.prototype;h.R=function(){Nd(this);return this.Y};h.add=function(a,b){Nd(this);this.ta=null;a=Od(this,a);var c=this.N.get(a);c||this.N.set(a,c=[]);c.push(b);this.Y=Oa(this.Y)+1;return this};h.remove=function(a){Nd(this);a=Od(this,a);return this.N.has(a)?(this.ta=null,this.Y=Oa(this.Y)-this.N.get(a).length,this.N.delete(a)):!1};h.clear=function(){this.N=this.ta=null;this.Y=0}; h.isEmpty=function(){Nd(this);return 0==this.Y};h.Pb=function(a){Nd(this);a=Od(this,a);return this.N.has(a)};h.Ic=function(a){var b=this.aa();return $a(b,a)};h.forEach=function(a,b){Nd(this);this.N.forEach(function(c,d){c.forEach(function(e){a.call(b,e,d,this)},this)},this)};h.tb=function(){Nd(this);for(var a=Array.from(this.N.values()),b=Array.from(this.N.keys()),c=[],d=0;d