@googlemaps/js-api-loader
Version:
Wrapper for the loading of Google Maps JavaScript API script in the browser
2 lines (1 loc) • 22.2 kB
JavaScript
this.google=this.google||{},this.google.maps=this.google.maps||{},this.google.maps.plugins=this.google.maps.plugins||{},this.google.maps.plugins.loader=function(t){"use strict";function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t,e){return t(e={exports:{}},e.exports),e.exports}var o=function(t){return t&&t.Math==Math&&t},i=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof n&&n)||function(){return this}()||Function("return this")(),c=function(t){try{return!!t()}catch(t){return!0}},a=!c((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),u={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,f={f:s&&!u.call({1:2},1)?function(t){var e=s(this,t);return!!e&&e.enumerable}:u},l=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},h={}.toString,p=function(t){return h.call(t).slice(8,-1)},d="".split,v=c((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==p(t)?d.call(t,""):Object(t)}:Object,g=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},y=function(t){return v(g(t))},m=function(t){return"object"==typeof t?null!==t:"function"==typeof t},b=function(t,e){if(!m(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!m(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!m(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!m(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},w={}.hasOwnProperty,S=function(t,e){return w.call(t,e)},j=i.document,E=m(j)&&m(j.createElement),O=function(t){return E?j.createElement(t):{}},k=!a&&!c((function(){return 7!=Object.defineProperty(O("div"),"a",{get:function(){return 7}}).a})),T=Object.getOwnPropertyDescriptor,L={f:a?T:function(t,e){if(t=y(t),e=b(e,!0),k)try{return T(t,e)}catch(t){}if(S(t,e))return l(!f.f.call(t,e),t[e])}},M=function(t){if(!m(t))throw TypeError(String(t)+" is not an object");return t},P=Object.defineProperty,x={f:a?P:function(t,e,n){if(M(t),e=b(e,!0),M(n),k)try{return P(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},C=a?function(t,e,n){return x.f(t,e,l(1,n))}:function(t,e,n){return t[e]=n,t},A=function(t,e){try{C(i,t,e)}catch(n){i[t]=e}return e},I="__core-js_shared__",_=i[I]||A(I,{}),N=Function.toString;"function"!=typeof _.inspectSource&&(_.inspectSource=function(t){return N.call(t)});var R,D,F,G,K=_.inspectSource,V=i.WeakMap,B="function"==typeof V&&/native code/.test(K(V)),U=r((function(t){(t.exports=function(t,e){return _[t]||(_[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.9.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),z=0,H=Math.random(),q=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++z+H).toString(36)},W=U("keys"),J={},Y=i.WeakMap;if(B){var Q=_.state||(_.state=new Y),X=Q.get,Z=Q.has,$=Q.set;R=function(t,e){return e.facade=t,$.call(Q,t,e),e},D=function(t){return X.call(Q,t)||{}},F=function(t){return Z.call(Q,t)}}else{var tt=W[G="state"]||(W[G]=q(G));J[tt]=!0,R=function(t,e){return e.facade=t,C(t,tt,e),e},D=function(t){return S(t,tt)?t[tt]:{}},F=function(t){return S(t,tt)}}var et,nt,rt={set:R,get:D,has:F,enforce:function(t){return F(t)?D(t):R(t,{})},getterFor:function(t){return function(e){var n;if(!m(e)||(n=D(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},ot=r((function(t){var e=rt.get,n=rt.enforce,r=String(String).split("String");(t.exports=function(t,e,o,c){var a,u=!!c&&!!c.unsafe,s=!!c&&!!c.enumerable,f=!!c&&!!c.noTargetGet;"function"==typeof o&&("string"!=typeof e||S(o,"name")||C(o,"name",e),(a=n(o)).source||(a.source=r.join("string"==typeof e?e:""))),t!==i?(u?!f&&t[e]&&(s=!0):delete t[e],s?t[e]=o:C(t,e,o)):s?t[e]=o:A(e,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||K(this)}))})),it=i,ct=function(t){return"function"==typeof t?t:void 0},at=function(t,e){return arguments.length<2?ct(it[t])||ct(i[t]):it[t]&&it[t][e]||i[t]&&i[t][e]},ut=Math.ceil,st=Math.floor,ft=function(t){return isNaN(t=+t)?0:(t>0?st:ut)(t)},lt=Math.min,ht=function(t){return t>0?lt(ft(t),9007199254740991):0},pt=Math.max,dt=Math.min,vt=function(t){return function(e,n,r){var o,i=y(e),c=ht(i.length),a=function(t,e){var n=ft(t);return n<0?pt(n+e,0):dt(n,e)}(r,c);if(t&&n!=n){for(;c>a;)if((o=i[a++])!=o)return!0}else for(;c>a;a++)if((t||a in i)&&i[a]===n)return t||a||0;return!t&&-1}},gt={includes:vt(!0),indexOf:vt(!1)}.indexOf,yt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),mt={f:Object.getOwnPropertyNames||function(t){return function(t,e){var n,r=y(t),o=0,i=[];for(n in r)!S(J,n)&&S(r,n)&&i.push(n);for(;e.length>o;)S(r,n=e[o++])&&(~gt(i,n)||i.push(n));return i}(t,yt)}},bt={f:Object.getOwnPropertySymbols},wt=at("Reflect","ownKeys")||function(t){var e=mt.f(M(t)),n=bt.f;return n?e.concat(n(t)):e},St=function(t,e){for(var n=wt(e),r=x.f,o=L.f,i=0;i<n.length;i++){var c=n[i];S(t,c)||r(t,c,o(e,c))}},jt=/#|\.prototype\./,Et=function(t,e){var n=kt[Ot(t)];return n==Lt||n!=Tt&&("function"==typeof e?c(e):!!e)},Ot=Et.normalize=function(t){return String(t).replace(jt,".").toLowerCase()},kt=Et.data={},Tt=Et.NATIVE="N",Lt=Et.POLYFILL="P",Mt=Et,Pt=L.f,xt=function(t,e){var n,r,o,c,a,u=t.target,s=t.global,f=t.stat;if(n=s?i:f?i[u]||A(u,{}):(i[u]||{}).prototype)for(r in e){if(c=e[r],o=t.noTargetGet?(a=Pt(n,r))&&a.value:n[r],!Mt(s?r:u+(f?".":"#")+r,t.forced)&&void 0!==o){if(typeof c==typeof o)continue;St(c,o)}(t.sham||o&&o.sham)&&C(c,"sham",!0),ot(n,r,c,t)}},Ct=Array.isArray||function(t){return"Array"==p(t)},At=function(t){return Object(g(t))},It=function(t,e,n){var r=b(e);r in t?x.f(t,r,l(0,n)):t[r]=n},_t="process"==p(i.process),Nt=at("navigator","userAgent")||"",Rt=i.process,Dt=Rt&&Rt.versions,Ft=Dt&&Dt.v8;Ft?nt=(et=Ft.split("."))[0]+et[1]:Nt&&(!(et=Nt.match(/Edge\/(\d+)/))||et[1]>=74)&&(et=Nt.match(/Chrome\/(\d+)/))&&(nt=et[1]);var Gt,Kt=nt&&+nt,Vt=!!Object.getOwnPropertySymbols&&!c((function(){return!Symbol.sham&&(_t?38===Kt:Kt>37&&Kt<41)})),Bt=Vt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ut=U("wks"),zt=i.Symbol,Ht=Bt?zt:zt&&zt.withoutSetter||q,qt=function(t){return S(Ut,t)&&(Vt||"string"==typeof Ut[t])||(Vt&&S(zt,t)?Ut[t]=zt[t]:Ut[t]=Ht("Symbol."+t)),Ut[t]},Wt=qt("species"),Jt=function(t,e){var n;return Ct(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!Ct(n.prototype)?m(n)&&null===(n=n[Wt])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},Yt=qt("species"),Qt=qt("isConcatSpreadable"),Xt=9007199254740991,Zt="Maximum allowed index exceeded",$t=Kt>=51||!c((function(){var t=[];return t[Qt]=!1,t.concat()[0]!==t})),te=(Gt="concat",Kt>=51||!c((function(){var t=[];return(t.constructor={})[Yt]=function(){return{foo:1}},1!==t[Gt](Boolean).foo}))),ee=function(t){if(!m(t))return!1;var e=t[Qt];return void 0!==e?!!e:Ct(t)};xt({target:"Array",proto:!0,forced:!$t||!te},{concat:function(t){var e,n,r,o,i,c=At(this),a=Jt(c,0),u=0;for(e=-1,r=arguments.length;e<r;e++)if(ee(i=-1===e?c:arguments[e])){if(u+(o=ht(i.length))>Xt)throw TypeError(Zt);for(n=0;n<o;n++,u++)n in i&&It(a,u,i[n])}else{if(u>=Xt)throw TypeError(Zt);It(a,u++,i)}return a.length=u,a}});var ne=function(t,e){var n=[][t];return!!n&&c((function(){n.call(null,e||function(){throw 1},1)}))},re=[].join,oe=v!=Object,ie=ne("join",",");xt({target:"Array",proto:!0,forced:oe||!ie},{join:function(t){return re.call(y(this),void 0===t?",":t)}});var ce=i.Promise,ae=x.f,ue=qt("toStringTag"),se=qt("species"),fe=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},le={},he=qt("iterator"),pe=Array.prototype,de=function(t,e,n){if(fe(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},ve={};ve[qt("toStringTag")]="z";var ge="[object z]"===String(ve),ye=qt("toStringTag"),me="Arguments"==p(function(){return arguments}()),be=ge?p:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),ye))?n:me?p(e):"Object"==(r=p(e))&&"function"==typeof e.callee?"Arguments":r},we=qt("iterator"),Se=function(t){var e=t.return;if(void 0!==e)return M(e.call(t)).value},je=function(t,e){this.stopped=t,this.result=e},Ee=function(t,e,n){var r,o,i,c,a,u,s,f,l=n&&n.that,h=!(!n||!n.AS_ENTRIES),p=!(!n||!n.IS_ITERATOR),d=!(!n||!n.INTERRUPTED),v=de(e,l,1+h+d),g=function(t){return r&&Se(r),new je(!0,t)},y=function(t){return h?(M(t),d?v(t[0],t[1],g):v(t[0],t[1])):d?v(t,g):v(t)};if(p)r=t;else{if("function"!=typeof(o=function(t){if(null!=t)return t[we]||t["@@iterator"]||le[be(t)]}(t)))throw TypeError("Target is not iterable");if(void 0!==(f=o)&&(le.Array===f||pe[he]===f)){for(i=0,c=ht(t.length);c>i;i++)if((a=y(t[i]))&&a instanceof je)return a;return new je(!1)}r=o.call(t)}for(u=r.next;!(s=u.call(r)).done;){try{a=y(s.value)}catch(t){throw Se(r),t}if("object"==typeof a&&a&&a instanceof je)return a}return new je(!1)},Oe=qt("iterator"),ke=!1;try{var Te=0,Le={next:function(){return{done:!!Te++}},return:function(){ke=!0}};Le[Oe]=function(){return this},Array.from(Le,(function(){throw 2}))}catch(t){}var Me,Pe,xe,Ce=qt("species"),Ae=at("document","documentElement"),Ie=/(iphone|ipod|ipad).*applewebkit/i.test(Nt),_e=i.location,Ne=i.setImmediate,Re=i.clearImmediate,De=i.process,Fe=i.MessageChannel,Ge=i.Dispatch,Ke=0,Ve={},Be="onreadystatechange",Ue=function(t){if(Ve.hasOwnProperty(t)){var e=Ve[t];delete Ve[t],e()}},ze=function(t){return function(){Ue(t)}},He=function(t){Ue(t.data)},qe=function(t){i.postMessage(t+"",_e.protocol+"//"+_e.host)};Ne&&Re||(Ne=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return Ve[++Ke]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},Me(Ke),Ke},Re=function(t){delete Ve[t]},_t?Me=function(t){De.nextTick(ze(t))}:Ge&&Ge.now?Me=function(t){Ge.now(ze(t))}:Fe&&!Ie?(xe=(Pe=new Fe).port2,Pe.port1.onmessage=He,Me=de(xe.postMessage,xe,1)):i.addEventListener&&"function"==typeof postMessage&&!i.importScripts&&_e&&"file:"!==_e.protocol&&!c(qe)?(Me=qe,i.addEventListener("message",He,!1)):Me=Be in O("script")?function(t){Ae.appendChild(O("script")).onreadystatechange=function(){Ae.removeChild(this),Ue(t)}}:function(t){setTimeout(ze(t),0)});var We,Je,Ye,Qe,Xe,Ze,$e,tn,en={set:Ne,clear:Re},nn=/web0s(?!.*chrome)/i.test(Nt),rn=L.f,on=en.set,cn=i.MutationObserver||i.WebKitMutationObserver,an=i.document,un=i.process,sn=i.Promise,fn=rn(i,"queueMicrotask"),ln=fn&&fn.value;ln||(We=function(){var t,e;for(_t&&(t=un.domain)&&t.exit();Je;){e=Je.fn,Je=Je.next;try{e()}catch(t){throw Je?Qe():Ye=void 0,t}}Ye=void 0,t&&t.enter()},Ie||_t||nn||!cn||!an?sn&&sn.resolve?($e=sn.resolve(void 0),tn=$e.then,Qe=function(){tn.call($e,We)}):Qe=_t?function(){un.nextTick(We)}:function(){on.call(i,We)}:(Xe=!0,Ze=an.createTextNode(""),new cn(We).observe(Ze,{characterData:!0}),Qe=function(){Ze.data=Xe=!Xe}));var hn,pn,dn,vn,gn,yn,mn,bn=ln||function(t){var e={fn:t,next:void 0};Ye&&(Ye.next=e),Je||(Je=e,Qe()),Ye=e},wn=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=fe(e),this.reject=fe(n)},Sn={f:function(t){return new wn(t)}},jn=function(t,e){if(M(t),m(e)&&e.constructor===t)return e;var n=Sn.f(t);return(0,n.resolve)(e),n.promise},En=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},On=en.set,kn=qt("species"),Tn="Promise",Ln=rt.get,Mn=rt.set,Pn=rt.getterFor(Tn),xn=ce,Cn=i.TypeError,An=i.document,In=i.process,_n=at("fetch"),Nn=Sn.f,Rn=Nn,Dn=!!(An&&An.createEvent&&i.dispatchEvent),Fn="function"==typeof PromiseRejectionEvent,Gn="unhandledrejection",Kn=Mt(Tn,(function(){if(!(K(xn)!==String(xn))){if(66===Kt)return!0;if(!_t&&!Fn)return!0}if(Kt>=51&&/native code/.test(xn))return!1;var t=xn.resolve(1),e=function(t){t((function(){}),(function(){}))};return(t.constructor={})[kn]=e,!(t.then((function(){}))instanceof e)})),Vn=Kn||!function(t,e){if(!e&&!ke)return!1;var n=!1;try{var r={};r[Oe]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}((function(t){xn.all(t).catch((function(){}))})),Bn=function(t){var e;return!(!m(t)||"function"!=typeof(e=t.then))&&e},Un=function(t,e){if(!t.notified){t.notified=!0;var n=t.reactions;bn((function(){for(var r=t.value,o=1==t.state,i=0;n.length>i;){var c,a,u,s=n[i++],f=o?s.ok:s.fail,l=s.resolve,h=s.reject,p=s.domain;try{f?(o||(2===t.rejection&&Wn(t),t.rejection=1),!0===f?c=r:(p&&p.enter(),c=f(r),p&&(p.exit(),u=!0)),c===s.promise?h(Cn("Promise-chain cycle")):(a=Bn(c))?a.call(c,l,h):l(c)):h(r)}catch(t){p&&!u&&p.exit(),h(t)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&Hn(t)}))}},zn=function(t,e,n){var r,o;Dn?((r=An.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),i.dispatchEvent(r)):r={promise:e,reason:n},!Fn&&(o=i["on"+t])?o(r):t===Gn&&function(t,e){var n=i.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}("Unhandled promise rejection",n)},Hn=function(t){On.call(i,(function(){var e,n=t.facade,r=t.value;if(qn(t)&&(e=En((function(){_t?In.emit("unhandledRejection",r,n):zn(Gn,n,r)})),t.rejection=_t||qn(t)?2:1,e.error))throw e.value}))},qn=function(t){return 1!==t.rejection&&!t.parent},Wn=function(t){On.call(i,(function(){var e=t.facade;_t?In.emit("rejectionHandled",e):zn("rejectionhandled",e,t.value)}))},Jn=function(t,e,n){return function(r){t(e,r,n)}},Yn=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,Un(t,!0))},Qn=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw Cn("Promise can't be resolved itself");var r=Bn(e);r?bn((function(){var n={done:!1};try{r.call(e,Jn(Qn,n,t),Jn(Yn,n,t))}catch(e){Yn(n,e,t)}})):(t.value=e,t.state=1,Un(t,!1))}catch(e){Yn({done:!1},e,t)}}};Kn&&(xn=function(t){!function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}(this,xn,Tn),fe(t),hn.call(this);var e=Ln(this);try{t(Jn(Qn,e),Jn(Yn,e))}catch(t){Yn(e,t)}},(hn=function(t){Mn(this,{type:Tn,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,e,n){for(var r in e)ot(t,r,e[r],n);return t}(xn.prototype,{then:function(t,e){var n,r,o,i=Pn(this),c=Nn((n=xn,void 0===(o=M(this).constructor)||null==(r=M(o)[Ce])?n:fe(r)));return c.ok="function"!=typeof t||t,c.fail="function"==typeof e&&e,c.domain=_t?In.domain:void 0,i.parent=!0,i.reactions.push(c),0!=i.state&&Un(i,!1),c.promise},catch:function(t){return this.then(void 0,t)}}),pn=function(){var t=new hn,e=Ln(t);this.promise=t,this.resolve=Jn(Qn,e),this.reject=Jn(Yn,e)},Sn.f=Nn=function(t){return t===xn||t===dn?new pn(t):Rn(t)},"function"==typeof ce&&(vn=ce.prototype.then,ot(ce.prototype,"then",(function(t,e){var n=this;return new xn((function(t,e){vn.call(n,t,e)})).then(t,e)}),{unsafe:!0}),"function"==typeof _n&&xt({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return jn(xn,_n.apply(i,arguments))}}))),xt({global:!0,wrap:!0,forced:Kn},{Promise:xn}),yn=Tn,mn=!1,(gn=xn)&&!S(gn=mn?gn:gn.prototype,ue)&&ae(gn,ue,{configurable:!0,value:yn}),function(t){var e=at(t),n=x.f;a&&e&&!e[se]&&n(e,se,{configurable:!0,get:function(){return this}})}(Tn),dn=at(Tn),xt({target:Tn,stat:!0,forced:Kn},{reject:function(t){var e=Nn(this);return e.reject.call(void 0,t),e.promise}}),xt({target:Tn,stat:!0,forced:Kn},{resolve:function(t){return jn(this,t)}}),xt({target:Tn,stat:!0,forced:Vn},{all:function(t){var e=this,n=Nn(e),r=n.resolve,o=n.reject,i=En((function(){var n=fe(e.resolve),i=[],c=0,a=1;Ee(t,(function(t){var u=c++,s=!1;i.push(void 0),a++,n.call(e,t).then((function(t){s||(s=!0,i[u]=t,--a||r(i))}),o)})),--a||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=Nn(e),r=n.reject,o=En((function(){var o=fe(e.resolve);Ee(t,(function(t){o.call(e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}});var Xn=ge?{}.toString:function(){return"[object "+be(this)+"]"};ge||ot(Object.prototype,"toString",Xn,{unsafe:!0});var Zn=[].push,$n=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,c=7==t,a=5==t||i;return function(u,s,f,l){for(var h,p,d=At(u),g=v(d),y=de(s,f,3),m=ht(g.length),b=0,w=l||Jt,S=e?w(u,m):n||c?w(u,0):void 0;m>b;b++)if((a||b in g)&&(p=y(h=g[b],b,d),t))if(e)S[b]=p;else if(p)switch(t){case 3:return!0;case 5:return h;case 6:return b;case 2:Zn.call(S,h)}else switch(t){case 4:return!1;case 7:Zn.call(S,h)}return i?-1:r||o?o:S}},tr={forEach:$n(0),map:$n(1),filter:$n(2),some:$n(3),every:$n(4),find:$n(5),findIndex:$n(6),filterOut:$n(7)}.forEach,er=ne("forEach")?[].forEach:function(t){return tr(this,t,arguments.length>1?arguments[1]:void 0)};for(var nr in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var rr=i[nr],or=rr&&rr.prototype;if(or&&or.forEach!==er)try{C(or,"forEach",er)}catch(t){or.forEach=er}}var ir="__googleMapsScriptId",cr=function(){function t(e){var n=e.apiKey,r=e.channel,o=e.client,i=e.id,c=void 0===i?ir:i,a=e.libraries,u=void 0===a?[]:a,s=e.language,f=e.region,l=e.version,h=e.mapIds,p=e.nonce,d=e.retries,v=void 0===d?3:d,g=e.url,y=void 0===g?"https://maps.googleapis.com/maps/api/js":g;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.version=l,this.apiKey=n,this.channel=r,this.client=o,this.id=c||ir,this.libraries=u,this.language=s,this.region=f,this.mapIds=h,this.nonce=p,this.retries=v,this.url=y,t.instance){if(!function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(o=r;0!=o--;)if(!t(e[o],n[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((r=(i=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var c=i[o];if(!t(e[c],n[c]))return!1}return!0}return e!=e&&n!=n}(this.options,t.instance.options))throw new Error("Loader must not be called again with different options. ".concat(JSON.stringify(this.options)," !== ").concat(JSON.stringify(t.instance.options)));return t.instance}t.instance=this}var n,r,o;return n=t,(r=[{key:"options",get:function(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url}}},{key:"createUrl",value:function(){var t=this.url;return t+="?callback=".concat(this.CALLBACK),this.apiKey&&(t+="&key=".concat(this.apiKey)),this.channel&&(t+="&channel=".concat(this.channel)),this.client&&(t+="&client=".concat(this.client)),this.libraries.length>0&&(t+="&libraries=".concat(this.libraries.join(","))),this.language&&(t+="&language=".concat(this.language)),this.region&&(t+="®ion=".concat(this.region)),this.version&&(t+="&v=".concat(this.version)),this.mapIds&&(t+="&map_ids=".concat(this.mapIds.join(","))),t}},{key:"load",value:function(){return this.loadPromise()}},{key:"loadPromise",value:function(){var t=this;return new Promise((function(e,n){t.loadCallback((function(t){t?n(t):e()}))}))}},{key:"loadCallback",value:function(t){this.callbacks.push(t),this.execute()}},{key:"setScript",value:function(){if(document.getElementById(this.id))this.callback();else{var t=this.createUrl(),e=document.createElement("script");e.id=this.id,e.type="text/javascript",e.src=t,e.onerror=this.loadErrorCallback.bind(this),e.defer=!0,e.async=!0,this.nonce&&(e.nonce=this.nonce),document.head.appendChild(e)}}},{key:"deleteScript",value:function(){var t=document.getElementById(this.id);t&&t.remove()}},{key:"resetIfRetryingFailed",value:function(){var t=this.retries+1;this.done&&!this.loading&&this.errors.length>=t&&(this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null)}},{key:"loadErrorCallback",value:function(t){var e=this;if(this.errors.push(t),this.errors.length<=this.retries){var n=this.errors.length*Math.pow(2,this.errors.length);console.log("Failed to load Google Maps script, retrying in ".concat(n," ms.")),setTimeout((function(){e.deleteScript(),e.setScript()}),n)}else this.onerrorEvent=t,this.callback()}},{key:"setCallback",value:function(){window.__googleMapsCallback=this.callback.bind(this)}},{key:"callback",value:function(){var t=this;this.done=!0,this.loading=!1,this.callbacks.forEach((function(e){e(t.onerrorEvent)})),this.callbacks=[]}},{key:"execute",value:function(){window.google&&window.google.maps&&window.google.maps.version&&(console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),this.callback()),this.resetIfRetryingFailed(),this.done?this.callback():this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}])&&e(n.prototype,r),o&&e(n,o),t}();return t.DEFAULT_ID=ir,t.Loader=cr,Object.defineProperty(t,"__esModule",{value:!0}),t}({});