text: //>>built
  require({cache:{"url:widgets/BasemapGallery/setting/Edit.html":'\x3cdiv style\x3d"width: 100%"\x3e\r\n\x3c!--   \x3cdiv data-dojo-attach-point\x3d"secondPage" \x3e --\x3e\r\n  \x3cdiv class\x3d"setting-content-div" data-dojo-attach-point\x3d"settingContentDiv"\x3e\r\n    \x3cdiv class\x3d"error-massage-div" data-dojo-attach-point\x3d"errorMassage"\x3e\x3c/div\x3e\r\n    \x3ctable class\x3d"setting-table input-table" cellspacing\x3d"0" data-dojo-attach-point\x3d"firstTable"\x3e\r\n      \x3ctbody data-dojo-attach-point\x3d"body"\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd class\x3d"first"\x3e*${nls.title}\x3c/td\x3e\r\n          \x3ctd class\x3d"second"\x3e\r\n            \x3cinput type\x3d"text" data-dojo-type\x3d"dijit/form/ValidationTextBox" data-dojo-attach-point\x3d"title" \r\n            required\x3d"true" placeHolder\x3d\'${nls.titlePH}\' data-dojo-props\x3d\'style:{width:"100%"}\'/\x3e\x3c/input\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd class\x3d"first"\x3e${nls.thumbnail}\x3c/td\x3e\r\n          \x3ctd class\x3d"second"\x3e\r\n            \x3cdiv class\x3d"image_chooser_base" data-dojo-attach-point\x3d"imageChooserBase"\x3e\x3c/div\x3e\x26nbsp;\x26nbsp;\x26nbsp;\x26nbsp;(${nls.thumbnailHint})\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e     \r\n        \x3ctr data-dojo-attach-point\x3d"urlPart"\x3e\r\n          \x3ctd class\x3d"first"\x3e*${nls.url}\x3c/td\x3e\r\n          \x3ctd class\x3d"second"\x3e\r\n          \x3cinput class\x3d"url_field_dom" type\x3d"text" data-dojo-type\x3d"jimu/dijit/ServiceURLInput" data-dojo-attach-point\x3d"url" \r\n            required\x3d"true" \r\n            placeHolder\x3d\'${nls.urlPH}\' data-dojo-props\x3d\'style:{width:"100%"}\'/\x3e\x3c/input\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3c!--tr data-dojo-attach-point\x3d"addLayerTr"\x3e\r\n          \x3ctd class\x3d"first"\x3e\x3c/td\x3e\r\n            \x3ctd class\x3d"second"\x3e\r\n             \x3cdiv class\x3d"add-layer-url" data-dojo-attach-event\x3d"onclick: onAddLayerUrl"\x3e\r\n               \x3cspan class\x3d"add-layer-url-label"\x3e${nls.addlayer}\x3c/span\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd class\x3d"third"\x3e\r\n            \x3cdiv class\x3d"add-layer-url" data-dojo-attach-event\x3d"onclick: onAddLayerUrl"\x3e\r\n              \x3cspan class\x3d"add-layer-url-icon"\x3e\x3c/span\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr--\x3e                                                              \r\n      \x3c/tbody\x3e\r\n    \x3c/table\x3e\r\n    \x3ctable class\x3d"setting-table input-table" cellspacing\x3d"0" data-dojo-attach-point\x3d"secondTable"\x3e\r\n      \x3ctbody\x3e\r\n        \x3ctr data-dojo-attach-point\x3d"addLayerTr"\x3e\r\n          \x3ctd class\x3d"first"\x3e\x3c/td\x3e\r\n            \x3ctd class\x3d"second"\x3e\r\n             \x3cdiv class\x3d"add-layer-url" data-dojo-attach-event\x3d"onclick: onAddLayerUrl"\x3e\r\n               \x3cspan class\x3d"add-layer-url-label jimu-float-trailing"\x3e${nls.addBaselayer}\x3c/span\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd class\x3d"third"\x3e\r\n            \x3cdiv class\x3d"add-layer-url" data-dojo-attach-event\x3d"onclick: onAddLayerUrl"\x3e\r\n              \x3cspan class\x3d"add-layer-url-icon"\x3e\x3c/span\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e \r\n      \x3c/tbody\x3e\r\n    \x3c/table\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e'}});
  define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/html dojo/on dojo/query dijit/_WidgetsInTemplateMixin dijit/registry jimu/BaseWidgetSetting jimu/dijit/ImageChooser dojo/text!./Edit.html jimu/dijit/ServiceURLInput jimu/SpatialReference/wkidUtils jimu/utils ../utils".split(" "),function(l,e,m,d,h,n,p,q,r,g,s,t,u,v,k){return l([r,p],{baseClass:"jimu-basemapgallery-Edit",ImageChooser:null,templateString:s,validUrl:!1,mapName:null,subLayerUrlNum:0,urlInputS:[],baseMapSRID:null,spatialReference:null,
  postCreate:function(){this.inherited(arguments);this.imageChooser=new g({cropImage:!0,defaultSelfSrc:this.folderUrl+"images/default.jpg",showSelfImg:!0,format:[g.GIF,g.JPEG,g.PNG],goldenWidth:84,goldenHeight:67});d.addClass(this.imageChooser.domNode,"img-chooser");d.place(this.imageChooser.domNode,this.imageChooserBase,"replace");this.own(h(this.url,"Change",e.hitch(this,"_onServiceUrlChange")));this.title.proceedValue=!1;this.own(h(this.title,"Change",e.hitch(this,"_onBaseMapTitleChange")));this.url.proceedValue=
  !1;this.url.setProcessFunction(e.hitch(this,"_onServiceFetch",this.url),e.hitch(this,"_onServiceFetchError"))},startup:function(){var a;this.basemap&&this.basemap.title&&this.title.set("value",this.basemap.title);a=this.basemap&&this.basemap.thumbnailUrl?0===this.basemap.thumbnailUrl.indexOf("//")?this.basemap.thumbnailUrl+this.token:v.processUrlInWidgetConfig(this.basemap.thumbnailUrl,this.folderUrl):this.folderUrl+"images/default.jpg";this.imageChooser.setDefaultSelfSrc(a);if(this.basemap&&this.basemap.layers)if(k.isNoUrlLayerMap(this.basemap))d.destroy(this.urlPart),
  d.setStyle(this.secondTable,"display","none"),d.setStyle(this.settingContentDiv,"height","150px");else{a=this.basemap.layers.length;this.basemap.layers[0]&&this.basemap.layers[0].url&&this.url.set("value",this.basemap.layers[0].url);for(var b=1;b<a;b++)this.addLayerUrl(this.basemap.layers[b].url)}},_onServiceUrlChange:function(){this.popup.disableButton(0)},_checkTitle:function(a){for(var b=!0,c=0;c<this.basemaps.length;c++)this.basemaps[c].title===a&&(b=this.basemap&&this.basemap.title===a?!0:!1);
  return b},_onBaseMapTitleChange:function(a){var b=this._checkTitle(a),c=null;a?b?this.title.proceedValue=!0:(this.title.proceedValue=!1,c=this.nls.invalidTitle1+a+this.nls.invalidTitle2):this.title.proceedValue=!1;this._checkProceed(c)},_checkProceed:function(a){var b=!0,c=[];d.setAttr(this.errorMassage,"innerHTML","");if(this.title.proceedValue)for(var c=this._getUrlDijits(),f=0;f<c.length;f++)b=b&&c[f].proceedValue;else b=!1;b?this.popup.enableButton(0):(this.popup.disableButton(0),a&&d.setAttr(this.errorMassage,
  "innerHTML",a))},_onServiceFetch:function(a,b){var c=!1,d=null,c=b.url.replace(/\/*$/g,"");if(this._isStringEndWith(c,"/MapServer")||this._isStringEndWith(c,"/ImageServer")){var c=this.map.spatialReference,e=b.data.spatialReference||b.data.extent.spatialReference||b.data.initialExtent.spatialReference||b.data.fullExtent.spatialReference;c&&e&&u.isSameSR(c.wkid,e.wkid)?c=a.proceedValue=!0:(c=a.proceedValue=!1,d=this.nls.invalidBasemapUrl2)}else c=a.proceedValue=!1,d=this.nls.invalidBasemapUrl1;this._checkProceed(d);
  return c},_isStringEndWith:function(a,b){return a.lastIndexOf(b)+b.length===a.length},_onServiceFetchError:function(){},onAddLayerUrl:function(){this.addLayerUrl()},addLayerUrl:function(a){var b=d.create("tr",{},this.body);d.create("td",{"class":"first"},b);var c=d.create("td",{"class":"second"},b),f=d.create("td",{"class":"third"},b),c=(new t({placeHolder:this.nls.urlPH,required:!0,proceedValue:0,style:{width:"100%"}})).placeAt(c);d.addClass(c.domNode,"url_field_dom");a&&c.set("value",a);a=d.create("span",
  {"class":"delete-layer-url-icon"},f);c.setProcessFunction(e.hitch(this,"_onServiceFetch",c),e.hitch(this,"_onServiceFetchError"));this.own(h(a,"click",e.hitch(this,"_onDeleteClick",b)));this._checkProceed()},_onDeleteClick:function(a){d.destroy(a);this._checkProceed()},_getUrlDijits:function(){var a=[];n(".url_field_dom",this.firstTable).forEach(e.hitch(this,function(b){a.push(q.byNode(b))}));return a},_getEditedBaseMap:function(){var a={title:this.title.value,thumbnailUrl:k.getStanderdUrl(this.imageChooser.imageData),
  layers:[],spatialReference:this.basemap&&this.basemap.spatialReference||this.map.spatialReference};k.isNoUrlLayerMap(this.basemap)?a.layers=this.basemap.layers:m.forEach(this._getUrlDijits(),function(b){a.layers.push({url:b.value})},this);return a},_onEditOk:function(a){this.basemap?a.basemaps[a._findBaseMapByTitle(this.basemap.title)]=this._getEditedBaseMap():a.basemaps.push(this._getEditedBaseMap());a.popup.close();a.refreshMapGallary()},_onEditClose:function(a){a.popup&&a.popup.close();this.destroy()}})});