You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vargdjs;(function(c){consta=newc.Logger("JSON Manager");classi{constructor(n){this._loadedJsons={};this._callbacks={};this._resources=n}setResources(n){this._resources=n}preloadJsons(n,l){conste=this._resources.filter(function(o){returno.kind==="json"&&!o.disablePreload});if(e.length===0)returnl(e.length);lett=0;consts=function(o){o&&a.error("Error while preloading a json resource:"+o),t++,t===e.length?l(e.length):n(t,e.length)};for(leto=0;o<e.length;++o)this.loadJson(e[o].name,s)}loadJson(n,l){constr=this._resources.find(function(s){returns.kind==="json"&&s.name===n});if(!r){l(newError(`Can't find resource with name: "`+n+'" (or is not a json resource).'),null);return}if(this._loadedJsons[n]){l(null,this._loadedJsons[n]);return}{consts=this._callbacks[n];if(s){s.push(l);return}elsethis._callbacks[n]=[l]}conste=this,t=newXMLHttpRequest;t.responseType="json",t.open("GET",r.file),t.onload=function(){consts=e._callbacks[n];if(!!s){if(t.status!==200){for(constoofs)o(newError("HTTP error: "+t.status+"("+t.statusText+")"),null);deletee._callbacks[n];return}e._loadedJsons[n]=t.response;for(constoofs)o(null,t.response);deletee._callbacks[n]}},t.onerror=function(){consts=e._callbacks[n];if(!!s){for(constoofs)o(newError("Network error"),null);deletee._callbacks[n]}},t.onabort=function(){consts=e._callbacks[n];if(!!s){for(constoofs)o(newError("Request aborted"),null);deletee._callbacks[n]}},t.send()}isJsonLoaded(n){return!!this._loadedJsons[n]}getLoadedJson(n){returnthis._loadedJsons[n]||null}}c.JsonManager=i})(gdjs||(gdjs={}));