/*
 COPYRIGHT 2009 ESRI

 TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
 Unpublished material - all rights reserved under the
 Copyright Laws of the United States and applicable international
 laws, treaties, and conventions.

 For additional information, contact:
 Environmental Systems Research Institute, Inc.
 Attn: Contracts and Legal Services Department
 380 New York Street
 Redlands, California, 92373
 USA

 email: contracts@esri.com
 */

window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","esri.tasks.find"],["require","esri.tasks._task"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["esri.tasks.find"]){_4._hasResource["esri.tasks.find"]=true;_4.provide("esri.tasks.find");_4.require("esri.tasks._task");_4.declare("esri.tasks.FindTask",esri.tasks._Task,{constructor:function(_7,_8){this._url.path+="/find";this._handler=_4.hitch(this,this._handler);this.gdbVersion=_8&&_8.gdbVersion;},_handler:function(_9,io,_a,_b,_c){try{var _d=[],_e=esri.tasks.FindResult;_4.forEach(_9.results,function(_f,i){_d[i]=new _e(_f);});this._successHandler([_d],"onComplete",_a,_c);}catch(err){this._errorHandler(err,_b,_c);}},execute:function(_10,_11,_12){var _13=this._encode(_4.mixin({},this._url.query,{f:"json"},_10.toJson())),_14=this._handler,_15=this._errorHandler;if(this.gdbVersion){_13.gdbVersion=this.gdbVersion;}var dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path,content:_13,callbackParamName:"callback",load:function(r,i){_14(r,i,_11,_12,dfd);},error:function(r){_15(r,_12,dfd);}});return dfd;},onComplete:function(){}});_4.declare("esri.tasks.FindParameters",null,{searchText:null,contains:true,searchFields:null,outSpatialReference:null,layerIds:null,returnGeometry:false,layerDefinitions:null,dynamicLayerInfos:null,toJson:function(){var _16={searchText:this.searchText,contains:this.contains,returnGeometry:this.returnGeometry,maxAllowableOffset:this.maxAllowableOffset},_17=this.layerIds,_18=this.searchFields,_19=this.outSpatialReference;if(_17){_16.layers=_17.join(",");}if(_18){_16.searchFields=_18.join(",");}if(_19){_16.sr=_19.wkid||_4.toJson(_19.toJson());}_16.layerDefs=esri._serializeLayerDefinitions(this.layerDefinitions);if(this.dynamicLayerInfos&&this.dynamicLayerInfos.length>0){var _1a,_1b=[];_4.forEach(this.dynamicLayerInfos,function(_1c){if(!_1c.subLayerIds){var _1d=_1c.id;if(this.layerIds&&_4.indexOf(this.layerIds,_1d)!==-1){var _1e={id:_1d};_1e.source=_1c.source&&_1c.source.toJson();var _1f;if(this.layerDefinitions&&this.layerDefinitions[_1d]){_1f=this.layerDefinitions[_1d];}if(_1f){_1e.definitionExpression=_1f;}_1b.push(_1e);}}},this);_1a=_4.toJson(_1b);if(_1a==="[]"){_1a="[{}]";}_16.dynamicLayers=_1a;}return _16;}});_4.declare("esri.tasks.FindResult",null,{constructor:function(_20){_4.mixin(this,_20);this.feature=new esri.Graphic(_20.geometry?esri.geometry.fromJson(_20.geometry):null,null,_20.attributes);delete this.geometry;delete this.attributes;}});}}};});