// 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/on dojo/Evented dojo/_base/lang dojo/_base/html dojo/_base/declare jimu/dijit/Popup jimu/dijit/QueryableLayerSource jimu/dijit/LoadingIndicator esri/request".split(" "),function(e,f,c,g,h,k,l,m,n){return h([k,f],{width:830,height:560,titleLabel:"",dijitArgs:null,postCreate:function(){this.inherited(arguments);g.addClass(this.domNode,"jimu-queryable-layer-source-popup");this._initFls();this._initLoading()},getSelectedRadioType:function(){return this.sourceDijit.getSelectedRadioType()},
_initFls:function(){this.sourceDijit=new l(this.dijitArgs);this.sourceDijit.placeAt(this.contentContainerNode);this.sourceDijit.startup();this.own(e(this.sourceDijit,"ok",c.hitch(this,function(d){if(0!==d.length){var a=d[0];if(a.definition)try{a.definition.name=a.name,a.definition.url=a.url,this.emit("ok",a)}catch(b){console.error(b)}else this.loading.show(),n({url:a.url,content:{f:"json"},handleAs:"json",callbackParamName:"callback"}).then(c.hitch(this,function(b){if(this.domNode){this.loading.hide();
a.definition=b;try{a.definition.name=a.name,a.definition.url=a.url,this.emit("ok",a)}catch(p){console.error(p)}}}),c.hitch(this,function(b){console.error(b);this.domNode&&this.loading.hide()}))}})));this.own(e(this.sourceDijit,"cancel",c.hitch(this,function(){try{this.emit("cancel")}catch(d){console.error(d)}})))},_initLoading:function(){this.loading=new m({hidden:!0});this.loading.placeAt(this.domNode);this.loading.startup()}})});