// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/html dojo/_base/config dojo/cookie dojo/Deferred dojo/promise/all dojo/request/xhr dojo/request/script ./utils ./privilegeUtils ./WidgetManager ./shared/utils ./tokenUtils ./portalUtils ./appConfigResourceUtils ./portalUrlUtils ./AppStateManager esri/IdentityManager esri/config esri/urlUtils esri/arcgis/utils".split(" "),function(J,f,A,G,B,C,t,x,D,K,p,y,L,u,l,q,M,m,N,E,z,H,I){var v=null;var F=J(null,{urlParams:null,appConfig:null,
rawAppConfig:null,configFile:null,_configLoaded:!1,portalSelf:null,constructor:function(a,b){this._removeHash(a);this.urlParams=a||{};this.widgetManager=L.getInstance();f.mixin(this,b)},loadConfig:function(){console.time("Load Config");return this._tryLoadConfig().then(f.hitch(this,function(a){var b=this.checkConfig(a);if(b)throw Error(b);this.rawAppConfig=f.clone(a);N.getInstance().setRawAppConfig(this.rawAppConfig);a=this._upgradeAppConfig(a);this._processAfterTryLoad(a);this.appConfig=a;if(this.urlParams.id)return this.loadWidgetsManifest(a).then(f.hitch(this,
function(){return this.loadAndUpgradeAllWidgetsConfig(a)})).then(f.hitch(this,function(c){return this.updateNecessaryAttrOfResourceUrlInAppConfig(c,this.urlParams.id)})).then(f.hitch(this,function(){this._configLoaded=!0;this._setDocumentTitle(a);this._readAndSetSharedTheme(a);return this.getAppConfig()}));l.setPortalUrl(a.portalUrl);I.arcgisUrl=m.getBaseItemUrl(a.portalUrl);return this._proesssWebTierAndSignin(a).then(f.hitch(this,function(){if(this.urlParams.appid){if(window.appInfo.isRunInPortal){var c=
m.getStandardPortalUrl(a.portalUrl),d=q.getPortal(c);return y.checkIsSelfOrigin(this.urlParams.appid,d,l.isInBuilderWindow()).then(f.hitch(this,function(e){if(!e)throw e=Error(window.jimuNls.orgUrlMessage),e.isSelfOrigin=!1,e;})).then(f.hitch(this,function(){return y.checkEssentialAppsLicense(this.urlParams.appid,d,l.isInBuilderWindow()).then(f.hitch(this,function(){return this._getAppConfigFromTemplateAppId(a.portalUrl,this.urlParams.appid).then(f.hitch(this,function(e){this._tryUpdateAppConfigByLocationUrl(e);
return this._processInPortalAppProtocol(e)}))}),f.hitch(this,function(e){console.error(e);if(e.isBlockedByOrg)throw Error(window.jimuNls.blockedByAdminErrorForApp);throw Error(window.jimuNls.essentialAppsLicenseErrorForApp);}))}))}return this._processNotInPortalAppProtocol(a).then(f.hitch(this,function(e){return this._getAppDataAddTemplateDataFromTemplateAppId(e.portalUrl,this.urlParams.appid).then(f.hitch(this,function(h){h.appData.appConfig&&(e=h.appData.appConfig);e._appData=h.appData;e.templateConfig=
h.templateData;e.isTemplateApp=!0;return e}))}))}return this._processNotInPortalAppProtocol(a)})).then(f.hitch(this,function(c){this._processAfterTryLoad(c);this.appConfig=c;return c.map.itemId?c:(c.map["3D"]?q.getDefaultWebScene(c.portalUrl):q.getDefaultWebMap(c.portalUrl)).then(function(d){c.map.itemId=d;return c})})).then(f.hitch(this,function(c){return this.loadWidgetsManifest(c)})).then(f.hitch(this,function(c){return c._appData?c._appData.values&&c._appData.values.webmap?q.getPortal(c.portalUrl).getItemById(c._appData.values.webmap).then(f.hitch(this,
function(d){return p.template.mergeTemplateAppConfigToAppConfig(c,c._appData,d)})):p.template.mergeTemplateAppConfigToAppConfig(c,c._appData):c})).then(f.hitch(this,function(c){return this.loadAndUpgradeAllWidgetsConfig(c)})).then(f.hitch(this,function(c){return c._wabAppId?this.processResourceInAppConfigForConfigLoader(c,this.urlParams):c.appItemId&&-1<window.JSON.stringify(c).indexOf("${itemId}")?this.updateNecessaryAttrOfResourceUrlInAppConfig(c,c.appItemId):c})).then(f.hitch(this,function(c){this.appConfig=
c;this._configLoaded=!0;this._setDocumentTitle(c);this._readAndSetSharedTheme(c);return this.getAppConfig()}))}),f.hitch(this,function(a){var b=new t;b.reject(a);return b}))},processResourceInAppConfigForConfigLoader:function(a,b){var c=a.portalUrl,d=a.appItemId,e=b.appid,h=new t,g=f.clone(a);this.updateNecessaryAttrOfResourceUrlInAppConfig(g,e).then(function(){if("config"===b.mode){var k=this.getResourceUrlsOfAppConfig(a).result;0!==k.length?q.getItemResources(c,e).then(function(r){if(0===r.length)return k=
k.map(function(n){return{resUrl:n}}),M.AddResourcesToItemForAppSave(c,k,d,e).then(function(){h.resolve(g)},function(n){console.warn("Add resource to template based app error:"+n.message||n);h.resolve(g)});h.resolve(g)},function(r){console.warn("Get resource of template based item error:"+r.message||r);h.resolve(g)}):h.resolve(g)}else h.resolve(g)}.bind(this),function(k){console.warn("Insert appId to resource url of appConfig error:"+k.message||k);h.resolve(g)});return h},getResourceUrlsOfAppConfig:function(a){var b=
{test:function(c){return/^https?:\/\/(.)+\/sharing\/rest\/content\/items\/(.)+\/resources\/inConfig\//.test(c)},func:f.hitch(this,function(c){return c.value})};return p.processItemResourceOfAppConfig(a,b)},updateNecessaryAttrOfResourceUrlInAppConfig:function(a,b){function c(g){return/^https?:\/\/(.)+\/sharing\/rest\/content\/items\/(.)+\/resources\/inConfig\//.test(g)}function d(g,k){g=h.processItemIDAndTokenOfResources(k.value,g);g=h.setResouceProtocolForHttps(g);var r=k.obj,n=k.key;"number"===typeof k.i?
r[n][k.i]=g:r[n]=g;return!0}var e=a.portalUrl,h=this;return q.getPortal(e).getItemById(b).then(f.hitch(this,function(g){g={test:c,func:f.hitch(this,d,{appId:b,isPublic:"public"===g.access,portalUrl:e})};return p.processItemResourceOfAppConfig(a,g).appConfig}))},setResouceProtocolForHttps:function(a){var b=a;"https:"===window.location.protocol&&(b=a.replace(/^http(s?):\/\//i,"https://"));return b},processItemIDAndTokenOfResources:function(a,b){0<a.indexOf("${itemId}")&&(a=a.replace("${itemId}",b.appId));
/(\?|&)token=.+/.test(a)&&(a=a.replace(/(\?|&)token=.+/,""));b.isPublic||(b=l.getPortalCredential(b.portalUrl))&&(a+="?token\x3d"+b.token);return a},_setDocumentTitle:function(a){!window.isBuilder&&a&&a.title&&(document.title=p.stripHTML(a.title))},getAppConfig:function(){var a=f.clone(this.appConfig);a.getConfigElementById=function(b){return p.getConfigElementById(this,b)};a.getConfigElementsByName=function(b){return p.getConfigElementsByName(this,b)};a.visitElement=function(b){p.visitElement(this,
b)};this._addAuthorizedCrossOriginDomains(this.portalSelf,a);return a},_addAuthorizedCrossOriginDomains:function(a,b){a&&a.authorizedCrossOriginDomains&&l.addAuthorizedCrossOriginDomains(a.authorizedCrossOriginDomains);b&&b.authorizedCrossOriginDomains&&l.addAuthorizedCrossOriginDomains(b.authorizedCrossOriginDomains)},checkConfig:function(){return!1},processProxy:function(a){z.defaults.io.alwaysUseProxy=a.httpProxy&&a.httpProxy.useProxy&&a.httpProxy.alwaysUseProxy;z.defaults.io.proxyUrl="";z.defaults.io.proxyRules=
[];a.httpProxy&&a.httpProxy.useProxy&&a.httpProxy.url&&(z.defaults.io.proxyUrl=a.httpProxy.url);a.httpProxy&&a.httpProxy.useProxy&&a.httpProxy.rules&&A.forEach(a.httpProxy.rules,function(b){H.addProxyRule(b)})},addNeedValues:function(a){this._processNoUriWidgets(a);this._processEmptyGroups(a);this._addElementId(a);this._fixRepeatedId(a)},showError:function(a){a&&a.message&&(G.create("div",{"class":"app-error",innerHTML:p.sanitizeHTML(a.message)},document.body),G.setStyle(jimuConfig.loadingId,"display",
"none"))},_tryLoadConfig:function(){"stemapp"===this.urlParams.id&&(this.urlParams.config=window.appInfo.appPath+"config.json",delete this.urlParams.id);if(this.urlParams.config)return this.configFile=this.urlParams.config,D(this.configFile,{handleAs:"json",headers:{"X-Requested-With":null}}).then(f.hitch(this,function(d){l.setPortalUrl(d.portalUrl);d.portalUrl&&(window.portalUrl=d.portalUrl);return this.urlParams.token?l.registerToken(this.urlParams.token).then(function(){return d}):d}));if(this.urlParams.id){window.appInfo.isRunInPortal=
!0;var a=m.getPortalUrlFromLocation(),b=new t;l.setPortalUrl(a);window.portalUrl=a;I.arcgisUrl=m.getBaseItemUrl(a);if(this.urlParams.token)var c=l.registerToken(this.urlParams.token);else c=new t,c.resolve();c.then(f.hitch(this,function(){var d=q.getPortal(a);d.loadSelfInfo().then(f.hitch(this,function(e){this.portalSelf=e;e.allSSL&&"http:"===window.location.protocol?(console.log("redirect from http to https"),window.location.href=m.setHttpsProtocol(window.location.href),b.reject()):this._processSignIn(a).then(f.hitch(this,
function(){this._getAppConfigFromAppId(a,this.urlParams.id).then(f.hitch(this,function(h){return y.checkIsSelfOrigin(this.urlParams.id,d,l.isInBuilderWindow()).then(f.hitch(this,function(g){if(g)return h;g=Error(window.jimuNls.orgUrlMessage);g.isSelfOrigin=!1;throw g;}))})).then(f.hitch(this,function(h){return y.checkEssentialAppsLicense(this.urlParams.id,d,l.isInBuilderWindow()).then(f.hitch(this,function(){this._tryUpdateAppConfigByLocationUrl(h);return this._processInPortalAppProtocol(h)}),f.hitch(this,
function(g){console.error(g);if(g.isBlockedByOrg)throw Error(window.jimuNls.blockedByAdminErrorForApp);throw Error(window.jimuNls.essentialAppsLicenseErrorForApp);}))})).then(function(h){b.resolve(h)},function(h){b.reject(h)})}))}))}),f.hitch(this,function(d){this.showError(d)}));return b}this.configFile="config.json";return D(this.configFile,{handleAs:"json"}).then(f.hitch(this,function(d){l.setPortalUrl(d.portalUrl);d.portalUrl&&(window.portalUrl=d.portalUrl);return this.urlParams.token?l.registerToken(this.urlParams.token).then(function(){return d}):
d}))},_upgradeAppConfig:function(a){var b=window.wabVersion,c=a.wabVersion;a.configWabVersion=a.wabVersion;if(b===c)return a;var d=this.versionManager.getVersionIndex(c),e=this.versionManager.getVersionIndex(b);if(d>e)throw Error("Bad version number, "+c);a=this.versionManager.upgrade(a,c,b);a.wabVersion=b;return a},loadAndUpgradeAllWidgetsConfig:function(a){var b=new t,c=[];u.visitElement(a,f.hitch(this,function(d){d.uri&&(d=this.widgetManager.tryLoadWidgetConfig(d),c.push(d))}));x(c).then(f.hitch(this,
function(){b.resolve(a)}),function(d){b.reject(d)});return b},_processAfterTryLoad:function(a){this._setPortalUrl(a);this._tryUpdateAppConfigByLocationUrl(a);this._processUrlParams(a);this.addNeedValues(a);this.processProxy(a);E.tokenValidity=10080;return a},_readAndSetSharedTheme:function(a){a.theme.sharedTheme?this.portalSelf.portalProperties&&this.portalSelf.portalProperties.sharedTheme||(a.theme.sharedTheme.isPortalSupport=!1):(a.theme.sharedTheme={useHeader:!1,useLogo:!1},a.theme.sharedTheme.isPortalSupport=
this.portalSelf.portalProperties&&this.portalSelf.portalProperties.sharedTheme?!0:!1);a.theme.sharedTheme.useHeader&&(a.theme.sharedTheme.isPortalSupport&&this.portalSelf.portalProperties?(a.theme.customStyles={mainBackgroundColor:this.portalSelf.portalProperties.sharedTheme.header.background},a.titleColor=this.portalSelf.portalProperties.sharedTheme.header.text):console.error("Portal does not support sharedTheme."));a.theme.sharedTheme.useLogo&&(a.theme.sharedTheme.isPortalSupport&&this.portalSelf.portalProperties?
(a.logo=this.portalSelf.portalProperties.sharedTheme.logo.small?this.portalSelf.portalProperties.sharedTheme.logo.small:"images/app-logo.png",!a.logoLink&&this.portalSelf.portalProperties.sharedTheme.logo.link&&(a.logoLink=this.portalSelf.portalProperties.sharedTheme.logo.link)):(console.error("Portal does not support sharedTheme, use default logo."),a.logo="images/app-logo.png"))},_tryUpdateAppConfigByLocationUrl:function(a){if(!(this.urlParams.config&&-1<this.urlParams.config.indexOf("arcgis.com/sharing/rest/content/items/"))){var b=
m.getPortalUrlFromLocation();b=m.getStandardPortalUrl(b);m.isOnline(b)&&(b=m.updateUrlProtocolByOtherUrl(b,a.portalUrl),a.map.portalUrl&&m.isSamePortalUrl(a.portalUrl,a.map.portalUrl)&&(a.map.portalUrl=b),a.portalUrl=b,a.httpProxy&&a.httpProxy.url&&(a.httpProxy.url=m.getPortalProxyUrl(b)))}},_processWidgetJsons:function(a){u.visitElement(a,function(b,c){c.isWidget&&b.uri&&p.widgetJson.processWidgetJson(b)})},_processNoUriWidgets:function(a){var b=0;u.visitElement(a,function(c,d){d.isWidget&&!c.uri&&
(b++,c.placeholderIndex=b)})},_processEmptyGroups:function(a){var b=0;a.widgetOnScreen.groups&&A.forEach(a.widgetOnScreen.groups,function(c){if(!c.widgets||c.widgets&&0===c.widgets.length)b++,c.placeholderIndex=b})},_addElementId:function(a){var b=0,c;u.visitElement(a,function(d){if(d.id){d.id=d.id.replace(/\//g,"_");var e=d.id.lastIndexOf("_");-1<e&&(c=d.id.substr(e+1),b=Math.max(b,c))}});u.visitElement(a,function(d){d.id||(b++,d.id=d.itemId?d.itemId+"_"+b:d.uri?d.uri.replace(/\//g,"_")+"_"+b:"_"+
b)})},_setPortalUrl:function(a){if(a.portalUrl){var b=m.getPortalUrlFromLocation(),c=m.isOnline(b);m.isSamePortalUrl(a.portalUrl,b)||c||(window.appInfo.isRunInPortal=!1)}else window.isXT&&C("wab_portalurl")?a.portalUrl=C("wab_portalurl"):(window.appInfo.isRunInPortal=!0,a.portalUrl=m.getPortalUrlFromLocation())},_changePortalUrlProtocol:function(a,b){a.portalUrl=m.setProtocol(a.portalUrl,b);a.map.portalUrl&&(a.map.portalUrl=m.setProtocol(a.map.portalUrl,b));a.httpProxy&&(a.httpProxy.url=m.setProtocol(a.httpProxy.url,
b),a.httpProxy&&a.httpProxy.rules&&A.forEach(a.httpProxy.rules,f.hitch(this,function(c){c.proxyUrl=m.setProtocol(c.proxyUrl,b)})))},_processInPortalAppProtocol:function(a){var b=new t,c=q.getPortal(a.portalUrl),d=f.hitch(this,function(e){if("https:"===window.location.protocol)this._changePortalUrlProtocol(a,"https");else{if(e){console.log("redirect from http to https");window.location.href=m.setHttpsProtocol(window.location.href);b.reject();return}this._changePortalUrlProtocol(a,"http")}this._checkLocale();
b.resolve(a)});c.loadSelfInfo().then(f.hitch(this,function(e){this.portalSelf=e;"private"===e.access?(e=0===a.portalUrl.toLowerCase().indexOf("https://"),d(e)):d(e.allSSL)}),f.hitch(this,function(e){b.reject(e)}));return b},_processNotInPortalAppProtocol:function(a){var b=new t;a.portalUrl?q.getPortal(a.portalUrl).loadSelfInfo().then(f.hitch(this,function(c){this.portalSelf=c;var d="https:"===window.location.protocol;(c.allSSL||d)&&this._changePortalUrlProtocol(a,"https");0!==a.portalUrl.toLowerCase().indexOf("https://")||
d||l.isInConfigOrPreviewWindow()?b.resolve(a):(console.log("redirect from http to https"),window.location.href=m.setHttpsProtocol(window.location.href),b.reject())}),f.hitch(this,function(c){b.reject(c)})):b.resolve(a);return b},_proesssWebTierAndSignin:function(a){var b=new t,c=!1,d=a.portalUrl;this._processWebTier(a).then(f.hitch(this,function(e){c=e;return q.getPortal(d).loadSelfInfo()})).then(f.hitch(this,function(e){this.portalSelf=e;return this._processSignIn(d,c)})).then(f.hitch(this,function(){b.resolve()}),
function(e){b.reject(e)});return b},_processWebTier:function(a){var b=new t,c=a.portalUrl;a.isWebTier?(l.addAuthorizedCrossOriginDomains([c]),l.isWebTierPortal(c).then(f.hitch(this,function(){var d=l.getPortalCredential(c);d&&d.ssl&&"http:"===window.location.protocol&&!l.isInConfigOrPreviewWindow()?(console.log("redirect from http to https"),window.location.href=m.setHttpsProtocol(window.location.href)):b.resolve(a.isWebTier)}),f.hitch(this,function(d){b.reject(d)}))):b.resolve(!1);return b},_processSignIn:function(a,
b){var c=new t,d=q.getPortal(a),e=m.getSharingUrl(a),h=m.setHttpsProtocol(a+"/sharing/generateToken?f\x3djson");window.appInfo.isRunInPortal?(b=E.checkSignInStatus(e),b.promise.then(f.hitch(this,function(g){g.token?(window.postMessageToSw({type:"to_sw_credential",credential:g.toJson()}),c.resolve()):K.get(h,{jsonp:"callback"}).then(f.hitch(this,function(k){k&&k.token&&(g.token=k.token,g.expires||(g.expires=k.expires));c.resolve()}),f.hitch(this,function(k){console.error(k);c.resolve()}))}),f.hitch(this,
function(){window.postMessageToSw({type:"to_sw_no_credential"});window.isCredentialSettled=!0;c.resolve()}))):(window.postMessageToSw({type:"to_sw_no_credential"}),window.isCredentialSettled=!0,!l.isInBuilderWindow()&&!l.isInConfigOrPreviewWindow()&&this.portalSelf.supportsOAuth&&this.rawAppConfig&&this.rawAppConfig.appId&&!b&&l.registerOAuthInfo(a,this.rawAppConfig.appId),b=E.checkSignInStatus(e),b.promise.always(f.hitch(this,function(){l.xtGetCredentialFromCookie(a);d.loadSelfInfo().then(f.hitch(this,
function(g){this.portalSelf=g;this._checkLocale();c.resolve()}))})));return c},_checkLocale:function(){if(!l.isInConfigOrPreviewWindow()){var a=this.portalSelf.user&&this.portalSelf.user.culture||B.locale;a="hi"===a?"en":a.toLowerCase();!this.urlParams.locale&&p.isLocaleChanged(B.locale,a)&&(C("wab_app_locale",a),window.location.reload())}},_getAppConfigFromTemplateAppId:function(a,b){var c=q.getPortal(a);return this._getWabAppIdAndDataFromTemplateAppId(a,b).then(f.hitch(this,function(d){var e=d.appId,
h=d.appData;return x([this._getAppConfigFromAppId(a,e),c.getItemData(h.source)]).then(f.hitch(this,function(g){if(h.appConfig){var k=h.appConfig;delete h.appConfig}else k=g[0];k=this._upgradeAppConfig(k);g=g[1];k._appData=h;k._wabAppId=e;k.templateConfig=g;k.isTemplateApp=!0;return k}))}))},_getAppDataAddTemplateDataFromTemplateAppId:function(a,b){var c=q.getPortal(a);return c.getItemData(b).then(function(d){return c.getItemData(d.source).then(function(e){return{appData:d,templateData:e}})})},_getWabAppIdAndDataFromTemplateAppId:function(a,
b){var c=new t,d=q.getPortal(a);d.getItemData(b).then(f.hitch(this,function(e){d.getItemById(e.source).then(f.hitch(this,function(h){h=H.urlToObject(h.url);c.resolve({appId:h.query.id,appData:e})}))}),function(e){c.reject(e)});return c},_getAppConfigFromAppId:function(a,b){return q.getPortal(a).getItemData(b)},_removeHash:function(a){for(var b in a)a[b]&&(a[b]=a[b].replace("#",""))},loadWidgetsManifest:function(a){function b(h,g){return h.loadWidgetManifest(g).then(function(k){return k},function(k){console.log("Widget failed to load, it is removed.",
g.name);k.stack?console.error(k.stack):console.log(k);c(a,g)})}function c(h,g){function k(r){h[r]&&h[r].widgets&&(h[r].widgets=h[r].widgets.filter(function(n){if(g)return n.id!==g.id;n.uri&&!n.manifest&&console.error("Widget is removed because it is not loaded successfully.",n.uri);return n.manifest}));h[r]&&h[r].groups&&h[r].groups.forEach(function(n){n.widgets&&(n.widgets=n.widgets.filter(function(w){if(g)return w.id!==g.id;w.uri&&!w.manifest&&console.error("Widget is removed because it is not loaded successfully.",
w.uri);return w.manifest}))})}k("widgetOnScreen");k("widgetPool")}var d=[],e=new t;this.urlParams.manifest&&a._buildInfo&&a._buildInfo.widgetManifestsMerged&&delete a._buildInfo.widgetManifestsMerged;a._buildInfo&&a._buildInfo.widgetManifestsMerged?this._loadMergedWidgetManifests().then(f.hitch(this,function(h){u.visitElement(a,f.hitch(this,function(g){g.widgets||!g.uri&&!g.itemId||(g.uri&&h[g.uri]?(this._addNeedValuesForManifest(h[g.uri],g.uri),p.widgetJson.addManifest2WidgetJson(g,h[g.uri])):d.push(b(this.widgetManager,
g)))}));x(d).then(function(){e.resolve(a)})})):(u.visitElement(a,f.hitch(this,function(h){h.widgets||!h.uri&&!h.itemId||d.push(b(this.widgetManager,h))})),x(d).then(function(){e.resolve(a)}));setTimeout(function(){e.isResolved()||(c(a),e.resolve(a))},6E4);return e},_addNeedValuesForManifest:function(a,b){f.mixin(a,p.getUriInfo(b));p.manifest.addManifestProperies(a);p.manifest.processManifestLabel(a,B.locale)},_loadMergedWidgetManifests:function(){return D(window.appInfo.appPath+"widgets/widgets-manifest.json",
{handleAs:"json"})},_fixRepeatedId:function(a){var b=[];u.visitElement(a,function(c){0<=b.indexOf(c.id)&&(c.id+="_");b.push(c.id)})},_processUrlParams:function(a){var b=this.urlParams.itemid||this.urlParams.webmap;b&&a.map.itemId!==b&&(a.map.mapOptions&&p.deleteMapOptions(a.map.mapOptions),a.map.itemId=b);this.urlParams.mode&&(a.mode=this.urlParams.mode);a.map.mapOptions||(a.map.mapOptions={});this.urlParams.scale&&(a.map.mapOptions.scale=this.urlParams.scale);if(this.urlParams.level||this.urlParams.zoom)a.map.mapOptions.zoom=
this.urlParams.level||this.urlParams.zoom}});F.getInstance=function(a,b){null===v?v=new F(a,b):(v.urlParams=a||{},v.options=b);return v};return F});