// 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
require({cache:{"widgets/Geoprocessing/editorManager":function(){define("dojo/_base/array dojo/on dojo/aspect dijit/form/Select dijit/form/TextBox jimu/dijit/CheckBox jimu/dijit/URLInput jimu/utils ./editors/simpleEditors ./editors/FeatureSetEditorChooser ./editors/FeatureSetResultEditor ./editors/SelectFeatureSetFromUrl ./editors/SelectFeatureSetFromLayer ./editors/SelectFeatureSetFromFile ./editors/SelectFeatureSetFromDraw ./editors/DataFileEditor ./editors/RasterLayerEditor ./editors/RecordSetEditor ./editors/RecordSetEditorChooser ./editors/SelectRecordSetFromTable".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w){function F(r,t,C){return r.editorName&&0>r.dataType.indexOf("GPMultiValue")?r.editorName:"input"===t?"GPMultiValue:GPFeatureRecordSetLayer"===r.dataType?"UnsupportEditor":-1<r.dataType.indexOf("GPMultiValue")&&r.choiceList&&0<r.choiceList.length?"MultiValueChooser":-1<r.dataType.indexOf("GPMultiValue")&&(!r.choiceList||0===r.choiceList.length)?"MultiValueEditor":"GPLong"===r.dataType?"LongNumberTextBox":"GPDouble"===r.dataType?"DoubleNumberTextBox":
"GPString"===r.dataType?r.choiceList&&0<r.choiceList.length?"Select":"TextBox":"GPBoolean"===r.dataType?"CheckBox":"GPLinearUnit"===r.dataType?"LinerUnitEditor":"GPDate"===r.dataType?"DateTimeEditor":"GPDataFile"===r.dataType?"DataFileEditor":"GPRasterDataLayer"===r.dataType?"RasterLayerEditor":"GPRecordSet"===r.dataType?"setting"===C?"RecordSetEditorChooser":"json"===r.recordSetMode?"SimpleJsonEditor":"table"===r.recordSetMode?"SelectRecordSetFromTable":"UnsupportEditor":"GPFeatureRecordSetLayer"===
r.dataType?"setting"===C?"FeatureSetEditorChooser":"draw"===r.featureSetMode?"SelectFeatureSetFromDraw":"layers"===r.featureSetMode?"SelectFeatureSetFromLayer":"url"===r.featureSetMode?"SelectFeatureSetFromUrl":"file"===r.featureSetMode?"SelectFeatureSetFromFile":"map"===r.featureSetMode?"SelectFeatureSetFromMap":"UnsupportEditor":"UnsupportEditor":"GPFeatureRecordSetLayer"===r.dataType?"FeatureSetResultEditor":"GPRecordSet"===r.dataType?"RecordSetEditor":"MapServiceLayer"===r.dataType?"MapServiceLayer":
"ShowMessage"}var y={},D,B=[],x;y.createEditor=function(r,t,C,J){t=F(r,t,C);C={param:r,widgetUID:J?J.uid:void 0,config:J?J.config:void 0,appConfig:J?J.appConfig:void 0,map:D,nls:x,context:C,editorManager:y,style:{width:"100%"}};if("UnsupportEditor"===t){C.message="type "+r.dataType+" is not supported for now.";var L=new b.UnsupportEditor(C)}else"ShowMessage"===t?(C.message="GPRecordSet"===r.dataType?"table":"GPDataFile"===r.dataType||"GPRasterDataLayer"===r.dataType?"link":"text",L=new b.UnsupportEditor(C)):
"MapServiceLayer"===t?(C.message=x.useResultMapService,L=new b.UnsupportEditor(C)):"RecordSetEditor"===t?L=new u(C):"MultiValueChooser"===t?L=new b.MultiValueChooser(C):"MultiValueEditor"===t?L=new b.MultiValueEditor(C):"LongNumberTextBox"===t?L=new b.LongNumberEditor(C):"DoubleNumberTextBox"===t?L=new b.DoubleNumberEditor(C):"Select"===t?(C.gEditor=new n({options:H.map(r.choiceList,function(P){return{label:P,value:P}}),value:void 0===r.defaultValue?"":r.defaultValue}),C.editorName="Select",L=new b.GeneralEditorWrapperEditor(C)):
"TextBox"===t?(C.gEditor=new q({value:void 0===r.defaultValue?"":r.defaultValue}),L=new b.GeneralEditorWrapperEditor(C)):"CheckBox"===t?(C.gEditor=new f({checked:void 0===r.defaultValue?!1:r.defaultValue}),L=new b.GeneralEditorWrapperEditor(C)):"LinerUnitEditor"===t?L=new b.LinerUnitEditor(C):"DateTimeEditor"===t?L=new b.DateTimeEditor(C):"URLInput"===t?(C.gEditor=new c({value:void 0===r.defaultValue?"":r.defaultValue}),L=new b.GeneralEditorWrapperEditor(C)):"ObjectUrlEditor"===t?(r.defaultValue&&
"string"===typeof r.defaultValue&&(C.value=r.defaultValue),L=new b.ObjectUrlEditor(C)):"SimpleJsonEditor"===t?(r.defaultValue&&(C.value=r.defaultValue),L=new b.SimpleJsonEditor(C)):"DataFileEditor"===t?(r.defaultValue&&(C.value=r.defaultValue),L=new v(C)):"RasterLayerEditor"===t?(r.defaultValue&&(C.value=r.defaultValue),L=new z(C)):"SelectFeatureSetFromMap"===t?(C.message=x.currentMapExtent,L=new b.currentExtentEditor(C)):"SelectFeatureSetFromDraw"===t?void 0===r.defaultValue?(C.message="No defaultValue property.",
L=new b.UnsupportEditor(C)):(r.defaultValue&&r.defaultValue.geometryType&&(J=a.getTypeByGeometryType(r.defaultValue.geometryType),C.types=[J]),C.showClear=!0,L=new p(C)):"SelectFeatureSetFromLayer"===t?(r.defaultValue&&(C.value=r.defaultValue),L=new e(C)):"SelectFeatureSetFromUrl"===t?(C.querySetting=r.defaultValue,L=new g(C)):"SelectFeatureSetFromFile"===t?L=new l(C):"FeatureSetEditorChooser"===t?L=new k(C):"RecordSetEditorChooser"===t?L=new E(C):"SelectRecordSetFromTable"===t?L=new w(C):"FeatureSetResultEditor"===
t?L=new h(C):"GetUrlObjectFromLayer"===t?(r.defaultValue&&(C.value=r.defaultValue),L=new b.GetUrlObjectFromLayer(C)):(C.message="wrong editorName."+t,L=new b.UnsupportEditor(C));r.editorDependParamName&&(L.dependParam=r.editorDependParamName);m.before(L,"destroy",function(){B.splice(B.indexOf(L),1)});L.dependParam&&H.forEach(B,function(P){P.param.name===L.dependParam&&L.update(P.getValue())});"SelectFeatureSetFromLayer"===t&&d(L,"change",function(){H.forEach(B,function(P){P.dependParam===r.name&&
P.update(L.getValue())})});B.push(L);return L};y.setMap=function(r){D=r};y.setNls=function(r){x=r};return y})},"widgets/Geoprocessing/editors/simpleEditors":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/html dojo/on dojo/Deferred dojo/promise/all dojo/json dijit/form/NumberTextBox dijit/form/Select dijit/form/Textarea dijit/form/DateTextBox dijit/form/TimeTextBox jimu/dijit/CheckBox jimu/dijit/URLInput jimu/utils esri/tasks/LinearUnit esri/tasks/FeatureSet esri/geometry/Polygon esri/graphic ../BaseEditor".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F){function y(r,t){return new k({value:t,options:m.map(r,function(C){return{label:C,value:C}})})}function D(r){return r.filter&&r.filter.type?r.filter.type.toLowerCase():null}function B(r){if(r.list&&2===r.list.length){var t=+r.list[0];r=+r.list[1]}else t=r.minimum,r=r.maximum;return isNaN(t)||isNaN(r)?null:(t=Math.min(t,r),r=Math.max(t,r),[t,r])}var x={};x.UnsupportEditor=H(F,{baseClass:"jimu-gp-editor-base jimu-gp-editor-unsupport",editorName:"UnsupportEditor",
postCreate:function(){this.inherited(arguments);n.setAttr(this.domNode,"innerHTML",v.sanitizeHTML(this.message))},getValue:function(){return null}});x.ShowMessage=H(F,{baseClass:"jimu-gp-editor-base jimu-gp-editor-message",editorName:"ShowMessage",postCreate:function(){this.inherited(arguments);n.setAttr(this.domNode,"innerHTML",v.sanitizeHTML(this.message))},getValue:function(){return null}});x.GeneralEditorWrapperEditor=H(F,{baseClass:"jimu-gp-editor-base jimu-gp-editor-wrapper",editorName:"GeneralEditorWrapperEditor",
postCreate:function(){this.inherited(arguments);n.setStyle(this.gEditor.domNode,"width","100%");"Select"===this.editorName?n.addClass(this.gEditor.domNode,"restrict-select-width"):"valuelist"===D(this.param)&&this.param.filter.list&&0<this.param.filter.list.length&&(this.gEditor=y(this.param.filter.list,this.param.defaultValue),n.addClass(this.gEditor.domNode,"restrict-select-width"));this.gEditor.placeAt(this.domNode)},reset:function(){this.gEditor.set("value","")},getValue:function(){var r=this.gEditor.getValue();
return"string"===typeof r&&""===d.trim(r)?null:r}});x.LongNumberEditor=H(F,{baseClass:"jimu-gp-editor-base jimu-gp-editor-long",editorName:"LongNumberEditor",postCreate:function(){this.inherited(arguments);this.value=isNaN(this.param.defaultValue)?NaN:this.param.defaultValue;var r=D(this.param);if("range"===r){if(r=B(this.param.filter))this.editor=new b({value:this.value,constraints:{places:0,min:r[0],max:r[1]}})}else"valuelist"===r&&this.param.filter.list&&0<this.param.filter.list.length&&(this.editor=
y(this.param.filter.list,this.param.defaultValue));this.editor||(this.editor=new b({value:this.value,constraints:{places:0}}));this.editor.placeAt(this.domNode)},reset:function(){this.editor.set("value",NaN)},getValue:function(){var r=this.editor.get("value");return isNaN(r)?null:r}});x.DoubleNumberEditor=H(F,{baseClass:"jimu-gp-editor-base jimu-gp-editor-double",editorName:"DoubleNumberEditor",postCreate:function(){this.inherited(arguments);this.value=isNaN(this.param.defaultValue)?NaN:this.param.defaultValue;
var r=D(this.param);if("range"===r){if(r=B(this.param.filter))this.editor=new b({value:this.value,constraints:{places:"0,15",min:r[0],max:r[1]}})}else"valuelist"===r&&this.param.filter.list&&0<this.param.filter.list.length&&(this.editor=y(this.param.filter.list,this.param.defaultValue));this.editor||(this.editor=new b({value:this.value,constraints:{places:"0,15"}}));this.editor.placeAt(this.domNode)},reset:function(){this.editor.set("value",NaN)},getValue:function(){var r=this.editor.get("value");
return isNaN(r)?null:r}});x.MultiValueChooser=H(F,{baseClass:"jimu-gp-editor-base jimu-gp-editor-multivalue-chooser",editorName:"MultiValueChooser",postCreate:function(){this.inherited(arguments);this.checkBoxs=[];m.forEach(this.param.choiceList,function(r){r=new l({label:r,checked:this.param.defaultValue&&-1<this.param.defaultValue.indexOf(r)?!0:!1});r.placeAt(this.domNode);this.checkBoxs.push(r)},this)},getValue:function(){var r=[];m.forEach(this.checkBoxs,function(t){t.checked&&r.push(t.label)},
this);return r}});x.MultiValueEditor=H(F,{baseClass:"jimu-gp-editor-base jimu-gp-editor-multivalue",editorName:"MultiValueEditor",postCreate:function(){this.inherited(arguments);this.editors=[];var r=n.create("div",{"class":"input-list"},this.domNode),t=d.clone(this.param,r);t.dataType=this.param.dataType.substr(13,this.param.dataType.length);t.originParam=this.param;this._initChildEditors(t,r);this._createAddInputNode(t,r)},_initChildEditors:function(r,t){this.param.defaultValue&&0<this.param.defaultValue.length?
m.forEach(this.param.defaultValue,function(C){r.defaultValue=C;this._createSingleInputContainerNode(r,t)},this):(delete r.defaultValue,this._createSingleInputContainerNode(r,t))},getValue:function(){var r=[];m.forEach(this.editors,function(t){(t=t.getValue())&&r.push(t)},this);return r},getGPValue:function(){var r=new f,t=[];m.forEach(this.editors,function(C){t.push(C.getGPValue())},this);c(t).then(function(C){r.resolve(C)},function(C){r.reject(C)});return r},destroy:function(){m.forEach(this.editors,
function(r){r.destroy()});this.editors=[];this.inherited(arguments)},_createSingleInputContainerNode:function(r,t){t=n.create("div",{"class":"single-input"},t);r=this.editorManager.createEditor(r,"input",this.context,{widgetUID:this.widgetUID,config:this.config});r.placeAt(t);this._createRemoveInputNode(t);t.inputEditor=r;this.editors.push(r);return t},_createRemoveInputNode:function(r){var t=n.create("div",{"class":"remove",innerHTML:"-"},r);this.own(q(t,"click",d.hitch(this,function(){this.editors.splice(this.editors.indexOf(r.inputEditor),
1);r.inputEditor.destroy();n.destroy(r)})));return t},_createAddInputNode:function(r,t){var C=n.create("div",{"class":"add-input"},this.domNode),J=n.create("div",{"class":"add-btn",innerHTML:"+"},C);this.own(q(J,"click",d.hitch(this,function(){this._createSingleInputContainerNode(r,t)})));return C}});x.LinerUnitEditor=H(F,{baseClass:"jimu-gp-editor-base jimu-gp-editor-liner-unit",editorName:"LinerUnitEditor",postCreate:function(){this.inherited(arguments);this.distance=this.param.defaultValue?this.param.defaultValue.distance:
0;this.units=this.param.defaultValue?this.param.defaultValue.units:"esriMeters";this.inputDijit=new b({value:this.distance,constraints:{places:"0,15"}});this.selectDijit=new k({value:this.units,options:[{label:this.nls.meters,value:"esriMeters"},{label:this.nls.kilometers,value:"esriKilometers"},{label:this.nls.feet,value:"esriFeet"},{label:this.nls.miles,value:"esriMiles"},{label:this.nls.nauticalMiles,value:"esriNauticalMiles"},{label:this.nls.yards,value:"esriYards"}]});n.addClass(this.selectDijit.domNode,
"restrict-select-width");this.inputDijit.placeAt(this.domNode);this.selectDijit.placeAt(this.domNode)},getValue:function(){var r=new z;r.distance=this.inputDijit.getValue();r.units=this.selectDijit.getValue();return r}});x.DateTimeEditor=H(F,{baseClass:"jimu-gp-editor-base jimu-gp-editor-datatime",editorName:"DateTimeEditor",postCreate:function(){var r=new Date(this.param.defaultValue);this.value=this.param.defaultValue?new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),
r.getSeconds()):null;this.inherited(arguments);this.dateDijit=new g({value:this.value,style:{width:"60%"}});this.timeDijit=new e({value:this.value,style:{width:"40%"},constraints:{timePattern:"HH:mm:ss",clickableIncrement:"T00:15:00",visibleIncrement:"T00:15:00"}});this.dateDijit.placeAt(this.domNode);this.timeDijit.placeAt(this.domNode)},startup:function(){this.dateDijit.startup();this.timeDijit.startup()},reset:function(){this.dateDijit.set("value",void 0);this.timeDijit.set("value",void 0)},getValue:function(){var r=
new Date,t=this.dateDijit.getValue(),C=this.timeDijit.getValue();return null!==t&&null!==C?(r.setFullYear(t.getFullYear()),r.setMonth(t.getMonth()),r.setDate(t.getDate()),r.setHours(C.getHours()),r.setMinutes(C.getMinutes()),r.setSeconds(C.getSeconds()),r.getTime()):null}});x.GetUrlObjectFromLayer=H([F,k],{editorName:"GetUrlObjectFromLayer",postCreate:function(){this.options=[];m.forEach(this.map.graphicsLayerIds,function(r){r=this.map.getLayer(r);"esri.layers.FeatureLayer"!==r.declaredClass||this.geometryType&&
r.geometryType!==this.geometryType||this.options.push({label:r.label||r.title||r.name||r.id,value:r.id})},this);this.inherited(arguments);this.setValue(this.value);n.addClass(this.domNode,"jimu-gp-editor-sffl");n.addClass(this.domNode,"jimu-gp-editor-base")},getValue:function(){return this.value},getGPValue:function(){var r;m.forEach(this.map.graphicsLayerIds,function(C){var J=this.map.getLayer(C);C===this.getValue()&&(r=J.url)},this);var t={url:r};t=this.wrapGPValue(t);return this.wrapValueToDeferred(t)}});
x.ObjectUrlEditor=H([F,p],{editorName:"ObjectUrlEditor",postCreate:function(){this.rest=!1;this.inherited(arguments);n.addClass(this.domNode,"jimu-gp-editor-ourl");n.addClass(this.domNode,"jimu-gp-editor-base")},getValue:function(){return this.value},getGPValue:function(){var r=this.getValue()?{url:this.getValue()}:null;r=this.wrapGPValue(r);return this.wrapValueToDeferred(r)}});x.SimpleJsonEditor=H([F,h],{editorName:"SimpleJsonEditor",postMixInProperties:function(){this.inherited(arguments);"object"===
typeof this.value&&(this.value=a.stringify(this.value))},postCreate:function(){this.inherited(arguments);n.addClass(this.domNode,"jimu-gp-editor-json");n.addClass(this.domNode,"jimu-gp-editor-base");this.set("placeholder",this.nls.jsonPlaceholder)},getValue:function(){return this.value},getGPValue:function(){var r=this.getValue()?a.parse(this.getValue()):null;r=this.wrapGPValue(r);return this.wrapValueToDeferred(r)}});x.currentExtentEditor=H(F,{editorName:"SelectFeatureSetFromMap",postCreate:function(){this.inherited(arguments);
n.setAttr(this.domNode,"innerHTML",this.message)},getValue:function(){var r=new u,t=[new w(E.fromExtent(this.map.extent))];r.features=t;return r}});return x})},"dijit/form/Textarea":function(){define(["dojo/_base/declare","dojo/dom-style","./_ExpandingTextAreaMixin","./SimpleTextarea"],function(H,d,m,n){return H("dijit.form.Textarea",[n,m],{baseClass:"dijitTextBox dijitTextArea dijitExpandingTextArea",cols:"",buildRendering:function(){this.inherited(arguments);d.set(this.textbox,{overflowY:"hidden",
overflowX:"auto",boxSizing:"border-box",MsBoxSizing:"border-box",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box"})}})})},"dijit/form/_ExpandingTextAreaMixin":function(){define("dojo/_base/declare dojo/dom-construct dojo/has dojo/_base/lang dojo/on dojo/_base/window ../Viewport".split(" "),function(H,d,m,n,q,f,c){m.add("textarea-needs-help-shrinking",function(){var a=f.body(),b=d.create("textarea",{rows:"5",cols:"20",value:" ",style:{zoom:1,fontSize:"12px",height:"96px",overflow:"hidden",visibility:"hidden",
position:"absolute",border:"5px solid white",margin:"0",padding:"0",boxSizing:"border-box",MsBoxSizing:"border-box",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box"}},a,"last"),k=b.scrollHeight>=b.clientHeight;a.removeChild(b);return k});return H("dijit.form._ExpandingTextAreaMixin",null,{_setValueAttr:function(){this.inherited(arguments);this.resize()},postCreate:function(){this.inherited(arguments);var a=this.textbox;a.style.overflowY="hidden";this.own(q(a,"focus, resize",n.hitch(this,"_resizeLater")))},
startup:function(){this.inherited(arguments);this.own(c.on("resize",n.hitch(this,"_resizeLater")));this._resizeLater()},_onInput:function(a){this.inherited(arguments);this.resize()},_estimateHeight:function(){var a=this.textbox;a.rows=(a.value.match(/\n/g)||[]).length+1},_resizeLater:function(){this.defer("resize")},resize:function(){function a(){var v=!1;""===b.value&&(b.value=" ",v=!0);var z=b.scrollHeight;v&&(b.value="");return z}var b=this.textbox;"hidden"==b.style.overflowY&&(b.scrollTop=0);
if(!this.busyResizing){this.busyResizing=!0;if(a()||b.offsetHeight){var k=a()+Math.max(b.offsetHeight-b.clientHeight,0),h=k+"px";h!=b.style.height&&(b.style.height=h,b.rows=1);if(m("textarea-needs-help-shrinking")){var g=a(),e=b.style.minHeight,l=4,p=b.scrollTop;b.style.minHeight=h;for(b.style.height="auto";0<k;){b.style.minHeight=Math.max(k-l,4)+"px";h=a();g-=h;k-=g;if(g<l)break;g=h;l<<=1}b.style.height=k+"px";b.style.minHeight=e;b.scrollTop=p}b.style.overflowY=a()>b.clientHeight?"auto":"hidden";
"hidden"==b.style.overflowY&&(b.scrollTop=0)}else this._estimateHeight();this.busyResizing=!1}}})})},"esri/tasks/LinearUnit":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(H,d,m,n){H=H(null,{declaredClass:"esri.tasks.LinearUnit",constructor:function(q){q&&d.mixin(this,q)},distance:0,units:null,toJson:function(){var q={};this.distance&&(q.distance=this.distance);this.units&&(q.units=this.units);return q}});m("extend-esri")&&d.setObject("tasks.LinearUnit",
H,n);return H})},"widgets/Geoprocessing/BaseEditor":function(){define(["dojo/_base/declare","dojo/Deferred","dijit/_WidgetBase","dijit/_TemplatedMixin"],function(H,d,m){return H([m],{baseClass:"jimu-gp-editor-base",editorName:"BaseEditor",dependParam:"",postCreate:function(){this.inherited(arguments)},getValue:function(){},reset:function(){},getGPValue:function(){var n=new d;n.resolve(this.getValue());return n},wrapGPValue:function(n){if(!n)return n;n.toJson||(n.toJson=function(){return n});return n},
wrapValueToDeferred:function(n){var q=new d;q.resolve(n);return q},update:function(n){}})})},"widgets/Geoprocessing/editors/FeatureSetEditorChooser":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/html dojo/on dojo/text!./FeatureSetEditorChooser.html dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin jimu/dijit/SymbolChooser jimu/dijit/CheckBox jimu/utils esri/symbols/jsonUtils ../BaseEditor dijit/form/RadioButton".split(" "),function(H,d,m,n,q,f,c,a,b,k,h,g){return H([g,f,c],{baseClass:"jimu-gp-editor-base jimu-gp-editor-fsec",
templateString:q,editorName:"FeatureSetEditorChooser",postCreate:function(){this.inherited(arguments);this.value={};this.featureSetUrl.set("placeholder",this.nls.urlPlaceholder);this.visibleCheckbox=new b({checked:"url"===this.param.featureSetMode&&this.param.showUrlContent,label:this.nls.showLayerContent,onChange:d.hitch(this,this._viewLayerContent)});this.visibleCheckbox.placeAt(this.visibleCheckboxDiv);this.layerOptionCheckbox=new b({checked:"layers"===this.param.featureSetMode&&this.param.useFeatureCollection,
label:this.nls.useFeatureCollection,onChange:d.hitch(this,this._layerOptionChanged)});this.layerOptionCheckbox.placeAt(this.layerOptionCheckboxDiv);this.param.defaultValue&&"esriGeometryPolygon"===this.param.defaultValue.geometryType?m.setStyle(this.mapModeWrapper,"display","block"):m.setStyle(this.mapModeWrapper,"display","none");"url"===this.param.featureSetMode&&this.param.featureSetUrl&&this.featureSetUrl.setValue(this.param.featureSetUrl);this.own(n(this.mapMode,"click",d.hitch(this,this._onMapModeSelect)));
this.own(n(this.drawMode,"click",d.hitch(this,this._onDrawModeSelect)));this.own(n(this.fileMode,"click",d.hitch(this,this._onFileModeSelect)));this.own(n(this.layersMode,"click",d.hitch(this,this._onLayersModeSelect)));this.own(n(this.urlMode,"click",d.hitch(this,this._onUrlModeSelect)));switch(this.param.featureSetMode){case "map":this.mapMode.set("checked",!0);this._onMapModeSelect();break;case "draw":this.drawMode.set("checked",!0);this._onDrawModeSelect();break;case "file":this.fileMode.set("checked",
!0);this._onFileModeSelect();break;case "layers":this.layersMode.set("checked",!0);this._onLayersModeSelect();break;case "url":this.urlMode.set("checked",!0),this._onUrlModeSelect()}},getValue:function(){this.featureSetUrl.value&&(this.value.featureSetUrl=this.featureSetUrl.value);this.symbolChooser&&"block"===m.getStyle(this.symbolChooserSection,"display")&&(this.value.symbol=this.symbolChooser.getSymbol().toJson());"url"===this.value.featureSetMode&&(this.value.showUrlContent=this.visibleCheckbox.getValue());
"layers"===this.value.featureSetMode&&(this.value.useFeatureCollection=this.layerOptionCheckbox.getValue());return this.value},_onMapModeSelect:function(){m.setStyle(this.symbolChooserSection,"display","none");m.setStyle(this.urlOptionsDiv,"display","none");m.setStyle(this.layerOptionSection,"display","none");this.value.featureSetMode="map"},_onDrawModeSelect:function(){this._showSymbolChooser();m.setStyle(this.urlOptionsDiv,"display","none");m.setStyle(this.layerOptionSection,"display","none");this.value.featureSetMode=
"draw"},_showSymbolChooser:function(){if(this.param.defaultValue&&this.param.defaultValue.geometryType){if(!this.symbolChooser){var e={};this.param.symbol?e.symbol=h.fromJson(this.param.symbol):e.type=k.getSymbolTypeByGeometryType(this.param.defaultValue.geometryType);this.symbolChooser=new a(e,this.symbolChooserNode);this.symbolChooser.startup()}m.setStyle(this.symbolChooserSection,"display","block")}else m.setStyle(this.symbolChooserSection,"display","none")},_onLayersModeSelect:function(){m.setStyle(this.symbolChooserSection,
"display","none");m.setStyle(this.urlOptionsDiv,"display","none");m.setStyle(this.layerOptionSection,"display","");this.value.featureSetMode="layers"},_onFileModeSelect:function(){m.setStyle(this.symbolChooserSection,"display","none");m.setStyle(this.urlOptionsDiv,"display","none");m.setStyle(this.layerOptionSection,"display","none");this.value.featureSetMode="file"},_onUrlModeSelect:function(){m.setStyle(this.urlOptionsDiv,"display","");m.setStyle(this.layerOptionSection,"display","none");this.visibleCheckbox.getValue()?
this._showSymbolChooser():m.setStyle(this.symbolChooserSection,"display","none");this.value.featureSetMode="url"},_viewLayerContent:function(e){e?this._showSymbolChooser():m.setStyle(this.symbolChooserSection,"display","none")}})})},"widgets/Geoprocessing/editors/FeatureSetResultEditor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/on dojo/text!./FeatureSetResultEditor.html dijit/_TemplatedMixin ../BaseEditor ./FeatureSetRendererEditor ../PopupConfig jimu/dijit/TabContainer jimu/dijit/CheckBox".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h){return H([c,f],{baseClass:"jimu-gp-editor-base jimu-gp-editor-fsrse",editorName:"FeatureSetResultEditor",templateString:q,featureSetRendererEditor:null,popupConfig:null,tab:null,args:null,constructor:function(g){this.args=d.mixin({},g)},postCreate:function(){this.inherited(arguments);this.tab=new k({tabs:[{title:this.nls.renderer,content:this.rendererTab},{title:this.nls.popup,content:this.popupConfigTab}],isNested:!0});this.tab.placeAt(this.domNode);this.tab.startup();
this.featureSetRendererEditor=new a(this.args);this.featureSetRendererEditor.placeAt(this.rendererTab);this.featureSetRendererEditor.startup();var g={};if(this.args&&this.args.param){this.args.param.defaultValue&&(g.fields=d.clone(this.args.param.defaultValue.fields||[]));var e=this.args.param.popup;if(e){if(e.fields.length!==g.fields.length){var l=m.map(e.fields,function(p){return p.name});g.fields=m.map(g.fields,function(p){var v=0<=m.indexOf(l,p.name);p.visible=v;m.some(e.fields,function(z){if(z.name===
p.name)return p.alias=z.alias||p.alias,!0});return p})}else g.fields=e.fields;g.title=e.title}}this.popupConfig=new b(g);this.popupConfig.placeAt(this.popupConfigTab);this.popupConfig.startup();this.own(n(this.popupConfig,"noVisibleField",d.hitch(this,function(){this.enablePopup.setValue(!1);this.enablePopup.setStatus(!1)})));this.own(n(this.popupConfig,"hasVisibleField",d.hitch(this,function(){this.enablePopup.setStatus(!0)})));this.enablePopup=new h({checked:!this.args.param.popup||this.args.param.popup&&
this.args.param.popup.enablePopup},this.enablePopupNode);this.enablePopup.startup()},destroy:function(){this.featureSetRendererEditor&&(this.featureSetRendererEditor.destroy(),this.featureSetRendererEditor=null);this.popupConfig&&(this.popupConfig.destroy(),this.popupConfig=null);this.inherited(arguments)},getValue:function(){var g={renderer:null,popup:this.popupConfig.getConfig()};g.popup.enablePopup=this.enablePopup.checked?!0:!1;var e=this.featureSetRendererEditor.getValue();e&&(g.renderer=e.renderer);
return g}})})},"widgets/Geoprocessing/editors/FeatureSetRendererEditor":function(){define("dojo/_base/declare dojo/_base/array esri/renderers/jsonUtils jimu/dijit/RendererChooser ../BaseEditor ./simpleEditors".split(" "),function(H,d,m,n,q,f){return H([q],{baseClass:"jimu-gp-editor-base jimu-gp-editor-fsre",editorName:"FeatureSetRendererEditor",postCreate:function(){this.inherited(arguments);var c={};if(this.param.renderer)c.renderer=m.fromJson(this.param.renderer),this.param.renderer._colorType&&
(c.renderer._colorType=this.param.renderer._colorType),c.renderer._showOthersSymbol=void 0!==this.param.renderer._showOthersSymbol?this.param.renderer._showOthersSymbol:!0;else if(c.type=this._getSymbolType(),!c.type){(new f.UnsupportEditor({message:this.nls.unSupportGeometryType})).placeAt(this.domNode);return}c.fields=d.map(this.param.defaultValue.fields,function(a){return a.name});this.renderer=new n(c);this.renderer.placeAt(this.domNode);this.renderer.startup()},getValue:function(){if(this.renderer){var c=
this.renderer.getRenderer(),a={renderer:c.toJson()};c._colorType&&(a.renderer._colorType=c._colorType);void 0!==c._showOthersSymbol&&(a.renderer._showOthersSymbol=!!c._showOthersSymbol);return a}return null},_getSymbolType:function(){switch(this.param.defaultValue.geometryType){case "esriGeometryPoint":case "esriGeometryMultipoint":return"marker";case "esriGeometryPolyline":return"line";case "esriGeometryPolygon":return"fill"}}})})},"jimu/dijit/RendererChooser":function(){define("dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./templates/RendererChooser.html dojo/_base/lang dojo/_base/html dojo/_base/array dojo/on dojo/query dojox/gfx dojo/_base/Color jimu/symbolUtils jimu/rendererUtils esri/renderers/SimpleRenderer esri/renderers/UniqueValueRenderer esri/renderers/ClassBreaksRenderer esri/symbols/jsonUtils esri/symbols/SimpleMarkerSymbol jimu/dijit/CheckBox jimu/dijit/Message dijit/form/Select dijit/form/ComboBox dijit/form/NumberSpinner dijit/form/NumberTextBox jimu/dijit/SymbolChooser".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F){return H([d,m,n],{templateString:q,baseClass:"jimu-renderer-chooser",declaredClass:"jimu.dijit.RendererChooser",renderer:null,type:null,nls:null,fields:null,_uniqueColors:{color1:"#fce138 #fff799 #fcd27e #f1983c #a553b7 #b1a9d0 #6ecffc #4c81cd #fc6f84 #fc3e5a #69f488 #48885c".split(" "),color2:"#102432 #144d59 #ffc754 #ea9010 #a54e1d #661510 #d8341a #b31515 #4a0932 #8c213f #18382e #2c6954".split(" "),color3:"#be9626 #607100 #00734c #704489 #01acca #024e76 #f09100 #ea311f #c6004b #7570b3 #666666 #333333".split(" "),
color4:"#fffa00 #f5cb11 #9fd40c #46e29c #32b8a6 #7ff2fa #ad00f2 #c461ea #eb7200 #e8a784 #bf2e2e #6c7000".split(" "),color5:"#191921 #11495c #78b1c2 #454f4b #8f8f82 #99dbbc #87b051 #f7ec88 #ebdcc1 #dbb658 #c43541 #75351e".split(" "),color6:"#332424 #751555 #d47013 #d68989 #211173 #82aad6 #7bfaeb #6ec9a8 #6b6408 #e9da40 #ccc54a #1fc235".split(" ")},_classBreaksColors:{color1:["#eaf0fd","#03519e"],color2:["#ebf9e7","#046e2e"],color3:["#f5f5f5","#2a2a2a"],color4:["#ffeddd","#a83a00"],color5:["#f2eef6",
"#582890"],color6:["#ffe3d7","#a71713"],color7:["#ecf7fb","#006d2a"],color8:["#edf8fa","#83067e"],color9:["#eef9e8","#0167af"],color10:["#fff1d7","#b80201"],color11:["#f0eef6","#015b90"],color12:["#f5eff7","#006dfa"],color13:["#f1eef7","#9c0042"],color14:["#ffebe2","#7d0078"],color15:["#ffffc9","#016a35"],color16:["#ffffcb","#253197"],color17:["#fffed1","#9e3601"],color18:["#ffffad","#c20120"],color19:["#a9620d","#038772"],color20:["#d3168c","#46ae1b"],color21:["#7c2d96","#048936"],color22:["#eb6300",
"#603b9b"],color23:["#cc0117","#0471b2"],color24:["#ce0118","#424242"],color25:["#db1a10","#287cba"],color26:["#da1baf","#03983e"],color27:["#db1a10","#2483bb"]},_selectedUniqueValueTr:null,_selectedClassBreakTr:null,_isDrawing:!1,_showOthersSymbol:!0,_jimuUrl:window.location.protocol+"//"+window.location.host+require.toUrl("jimu"),postMixInProperties:function(){this.fields||(this.fields=[]);this.nls=f.mixin({},window.jimuNls.common,window.jimuNls.rendererChooser);this.inherited(arguments)},postCreate:function(){this.inherited(arguments);
this._initFields();this.own(b(this.rendererSelect,"change",f.hitch(this,this._onRendererSelectChange)));this.own(b(this.defaultSymbolChooser,"change",f.hitch(this,this._onDefaultSymbolChange)));this.own(b(this.selectedSymbolChooser,"change",f.hitch(this,this._onSelectedSymbolChange)));this._bindUniqueSettingEvents();this._bindClassBreaksEvents();this.renderer?(this._showOthersSymbol=!!this.renderer._showOthersSymbol,this.showByRenderer(this.renderer)):this.type&&this.showByType(this.type);this._onRendererSelectChange()},
getRenderer:function(){var y=null,D=this.rendererSelect.get("value");if("simple"===D)y=this._getSimpleRenderer();else if("unique"===D)y=this._getUniqueValueRenderer();else if("color"===D||"size"===D)y=this._getClassBreaksRenderer();return y},reset:function(){this.type=this.renderer=null;c.setStyle(this.domNode,"display","none")},showByRenderer:function(y){this.reset();c.setStyle(this.domNode,"display","block");this.renderer=y;this.type=null;this._setDefaultSymbol(this.renderer&&(this.renderer.defaultSymbol||
this.renderer.symbol));this._updateRendererSelect();l.isSimpleRenderer(this.renderer)?this.rendererSelect.set("value","simple"):l.isUniqueValueRenderer(this.renderer)?this._showUniqueValueRenderer(this.renderer):l.isClassBreaksRenderer(this.renderer)?this._showClassBreaksRenderer(this.renderer):this.showByType(this.type);(y=this.defaultSymbolChooser.getSymbol())&&this._onDefaultSymbolChange(y)},showByType:function(y){this.reset();this.type=this.renderer=null;if("marker"===y||"line"===y||"fill"===
y)c.setStyle(this.domNode,"display","block"),this.type=y,this.defaultSymbolChooser.showByType(y),this._updateRendererSelect(),(y=this.defaultSymbolChooser.getSymbol())&&this._onDefaultSymbolChange(y)},_setDefaultSymbol:function(y){this.type=null;y&&(e.isSimpleMarkerSymbol(y)||e.isPictureMarkerSymbol(y)?this.type="marker":e.isSimpleLineSymbol(y)?this.type="line":e.isSimpleFillSymbol(y)&&(this.type="fill"),this.type&&this.defaultSymbolChooser.showBySymbol(y))},_getDefaultSymbolTr:function(){var y=this.rendererSelect.get("value");
if("unique"===y)var D=this.uniqueSysTbody;else if("color"===y||"size"===y)D=this.classBreaksTbody;if(!D)return null;y=k(".default-symbol-tr",D);return 0===y.length?null:y[0]},_onDefaultSymbolChange:function(y){var D=this._getDefaultSymbolTr();D&&(D.symbol=y,D=k(".symbol-div",D)[0],this._drawSymbolPreview(D,y))},_setDefaultSymbolStatus:function(y){var D=this._getDefaultSymbolTr();D&&D.checkbox.getStatus()!==y&&(y||(this._showOthersSymbol=!0,D.checkbox.setValue(!0)),D.checkbox.setStatus(y))},_updateRendererSelect:function(){var y=
this.rendererSelect.getOptions("size");"marker"===this.type?y||this.rendererSelect.addOption({value:"size",label:"Size"}):("line"===this.type||"fill"===this.type)&&y&&this.rendererSelect.removeOption(y)},_initFields:function(){if(this.fields&&0<this.fields.length){var y="";a.forEach(this.fields,f.hitch(this,function(D){D&&"string"===typeof D&&(y||(y=D),this._addField(D))}));y&&!this.fieldComboBox.get("displayedValue")&&this.fieldComboBox.set("displayedValue",y)}},_addField:function(y){this.fieldComboBox.get("store").add({name:y})},
_onRendererSelectChange:function(){var y=this.rendererSelect.get("value");this._showDefaultSymbol();"simple"===y?(c.setStyle(this.fieldSelectTr,"display","none"),c.setStyle(this.colorBlockTr,"display","none"),c.setStyle(this.colorBarTr,"display","none"),c.setStyle(this.domainTr,"display","none"),c.setStyle(this.classCountTr,"display","none"),c.setStyle(this.uniqueSetting,"display","none"),c.setStyle(this.classBreaksSetting,"display","none"),c.setStyle(this.symbolSizeDomainTr,"display","none")):"unique"===
y?(c.setStyle(this.fieldSelectTr,"display","table-row"),c.setStyle(this.colorBlockTr,"display","table-row"),c.setStyle(this.colorBarTr,"display","none"),c.setStyle(this.domainTr,"display","none"),c.setStyle(this.classCountTr,"display","none"),c.setStyle(this.uniqueSetting,"display","block"),c.setStyle(this.classBreaksSetting,"display","none"),c.setStyle(this.symbolSizeDomainTr,"display","none"),this._updateUniqueValueDivVisibility()):"color"===y?(c.setStyle(this.fieldSelectTr,"display","table-row"),
c.setStyle(this.colorBlockTr,"display","none"),c.setStyle(this.classCountTr,"display","table-row"),c.setStyle(this.domainTr,"display","table-row"),c.setStyle(this.colorBarTr,"display","table-row"),c.setStyle(this.uniqueSetting,"display","none"),c.setStyle(this.symbolSizeDomainTr,"display","none"),this._updateClassBreaksSettingVisibility()):"size"===y&&(c.setStyle(this.fieldSelectTr,"display","table-row"),c.setStyle(this.colorBlockTr,"display","none"),c.setStyle(this.colorBarTr,"display","none"),c.setStyle(this.domainTr,
"display","table-row"),c.setStyle(this.classCountTr,"display","table-row"),c.setStyle(this.uniqueSetting,"display","none"),c.setStyle(this.symbolSizeDomainTr,"display","table-row"),this._updateClassBreaksSettingVisibility())},_showDefaultSymbol:function(){c.setStyle(this.defaultSymSection,"display","block");c.setStyle(this.selectedSymSection,"display","none")},_showSelectedSymbol:function(y){c.setStyle(this.defaultSymSection,"display","none");c.setStyle(this.selectedSymSection,"display","block");
var D=this.rendererSelect.get("value");if("simple"===D)c.setStyle(this.uniqueSelectedSymInfoSet,"display","none"),c.setStyle(this.classBreaksSelectedInfoSet,"display","none");else if("unique"===D)c.setStyle(this.uniqueSelectedSymInfoSet,"display","block"),c.setStyle(this.classBreaksSelectedInfoSet,"display","none");else if("color"===D||"size"===D)c.setStyle(this.uniqueSelectedSymInfoSet,"display","none"),c.setStyle(this.classBreaksSelectedInfoSet,"display","block");this.selectedSymbolChooser.showBySymbol(y)},
_onSelectedSymbolChange:function(y){var D=this.rendererSelect.get("value");"unique"===D?this._onUniqueSelectedSymbolChange(y):"color"===D?this._onClassBreakSelectedSymbolChange(y):"size"===D&&this._onClassBreakSelectedSymbolChange(y)},_cloneSymbol:function(y){if(!y)return null;y=y.toJson();return u.fromJson(y)},_drawSymbolPreview:function(y,D){var B=this._cloneSymbol(D);c.empty(y);D=80;var x=30;if("simplemarkersymbol"===B.type)x=D=Math.min(B.size+12,125);else if("picturemarkersymbol"===B.type){if(!B.url||
"http://"===B.url||-1===B.url.indexOf("http://")&&-1===B.url.indexOf("https://")&&-1===B.url.indexOf("data:"))return;x=D=Math.min(Math.max(B.width,B.height),125)}else if("simplelinesymbol"===B.type||"cartographiclinesymbol"===B.type)D=190,x=20;60<D&&(D=60);y=h.createSurface(y,D,x);if("vml"===h.renderer){var r=y.getEventSource();c.setStyle(r,"position","relative");c.setStyle(r.parentNode,"position","relative")}r=null;r=u.getShapeDescriptors(B);try{var t=y.createShape(r.defaultShape).setFill(r.fill).setStroke(r.stroke)}catch(J){y.clear();
y.destroy();return}B=y.getDimensions();B={dx:B.width/2,dy:B.height/2};var C=t.getBoundingBox();r=C.width;C=C.height;if(r>D||C>x)D=((D<x?D:x)-5)/(r>C?r:C),f.mixin(B,{xx:D,yy:D});t.applyTransform(B);return y},_getSimpleRenderer:function(){var y=this.defaultSymbolChooser.getSymbol();return new p(y)},_bindUniqueSettingEvents:function(){this.own(b(this.btnAddUniqueValue,"click",f.hitch(this,this._onAddUniqueValue)));this.own(b(this.uniqueSelectedValue,"change",f.hitch(this,this._onUniqueSelectedValueChange)));
this.own(b(this.uniqueSelectedLabel,"change",f.hitch(this,this._onUniqueSelectedLabelChange)));this.own(b(this.uniqueColorSelect,"change",f.hitch(this,this._onUniqueColorSelectChange)))},_showUniqueValueRenderer:function(y){this.rendererSelect.set("value","unique");this.fieldComboBox.set("displayedValue",y.attributeField);y._colorType&&this.uniqueColorSelect.set("value",y._colorType);c.empty(this.uniqueSysTbody);a.forEach(y.infos,f.hitch(this,function(D){this._addUniqueValueTr(D.symbol,D.value,D.label||
D.value)}));this._addDefaultValueTr(this.uniqueSysTbody)},_getUniqueValueRenderer:function(){var y=this.defaultSymbolChooser.getSymbol(),D=this.fieldComboBox.get("value"),B=new v(y,D);y=k(".unique-symbol-tr",this.uniqueSysTbody);a.forEach(y,f.hitch(this,function(x){B.addValue({value:x.value,symbol:x.symbol,label:x.label,description:x.label})}));B._colorType=this.uniqueColorSelect.get("value");B._showOthersSymbol=this._showOthersSymbol;return B},_onUniqueColorSelectChange:function(){var y=this._getSelectedUniqueColors(),
D=k(".unique-symbol-tr",this.uniqueSysTbody);a.forEach(D,f.hitch(this,function(B,x){B.symbol&&!e.isPictureMarkerSymbol(B.symbol)&&(B.symbol.setColor(y[x%y.length]),x=k(".symbol-div",B)[0],this._drawSymbolPreview(x,B.symbol),this._selectedUniqueValueTr===B&&this._showSelectedSymbol(B.symbol))}))},_onUniqueSelectedValueChange:function(){var y=this._selectedUniqueValueTr,D=this.uniqueSelectedValue.value;if(y&&D!==y.value){var B=k(".unique-symbol-tr",this.uniqueSysTbody);if(a.some(B,function(r){return r.value===
D})){var x=new F({message:this.nls.duplicatedValue.replace("${value}",D),buttons:[{label:this.nls.ok,onClick:function(){x.close()}}]});this.uniqueSelectedValue.value=y.value}else y.value=this.uniqueSelectedValue.value}},_onUniqueSelectedLabelChange:function(){var y=this._selectedUniqueValueTr;y&&(y.label=this.uniqueSelectedLabel.value,k(".label-div",y)[0].innerHTML=y.label)},_onUniqueSelectedSymbolChange:function(y){var D=this._selectedUniqueValueTr;D&&(D.symbol=y,(D=k(".symbol-div",D)[0])&&this._drawSymbolPreview(D,
y))},_onAddUniqueValue:function(){var y=f.trim(this.uniqueEditValue.value);if(y){var D=k(".unique-symbol-tr",this.uniqueSysTbody);if(a.some(D,function(r){return r.value===y}))var B=new F({message:this.nls.duplicatedValue.replace("${value}",y),buttons:[{label:this.nls.ok,onClick:function(){B.close()}}]});else{var x=this._getSelectedUniqueColors();D=this._getUniqueSymbol(x[D.length%x.length]);this._addUniqueValueTr(D,y,y);this._setDefaultSymbolStatus(!0)}}this.uniqueEditValue.value=""},_addUniqueValueTr:function(y,
D,B){D=f.trim(D);var x=c.toDom('\x3ctr class\x3d"unique-symbol-tr"\x3e\x3ctd class\x3d"symbol-td"\x3e\x3cdiv class\x3d"symbol-div"\x3e\x3c/div\x3e\x3c/td\x3e\x3ctd class\x3d"edit-td"\x3e\x3cdiv wrap class\x3d"label-div"\x3e\x3c/div\x3e\x3c/td\x3e\x3ctd class\x3d"delete-td"\x3e\x3cdiv class\x3d"delete-div jimu-icon jimu-icon-delete"\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e'),r=k(".default-symbol-tr",this.uniqueSysTbody);0<r.length?c.place(x,r[0],"before"):c.place(x,this.uniqueSysTbody);this._updateUniqueSymTableStyle();
r=k(".symbol-div",x)[0];var t=k(".label-div",x)[0],C=k(".delete-div",x)[0];t.innerHTML=B;this.own(b(x,"click",f.hitch(this,function(){this._selectUniqueValueTr(x)})));this.own(b(C,"click",f.hitch(this,function(J){J.stopPropagation();this._selectedUniqueValueTr===x&&(this._selectedUniqueValueTr=null);c.destroy(x);this._updateUniqueSymTableStyle();this._updateUniqueValueDivVisibility()})));this._drawSymbolPreview(r,y);x.symbol=y;x.value=D;x.label=B;this._selectUniqueValueTr(x);c.setStyle(this.uniqueValueDiv,
"display","block")},_selectUniqueValueTr:function(y){k("tr",this.uniqueSysTbody).removeClass("selected");c.addClass(y,"selected");this._selectedUniqueValueTr=y;this.uniqueSelectedValue.value=y.value;this.uniqueSelectedLabel.value=y.label;this._showSelectedSymbol(y.symbol)},_updateUniqueSymTableStyle:function(){},_getSelectedUniqueColors:function(){var y=this.uniqueColorSelect.get("value");return a.map(this._uniqueColors[y],f.hitch(this,function(D){return new g(D)}))},_getUniqueSymbol:function(y){var D=
null;if("marker"===this.type)D=new E({style:"esriSMSCircle",color:[0,0,128,128],name:"Circle",outline:{color:[191,151,39,255],width:1},type:"esriSMS",size:18}),D.setColor(y);else if("line"===this.type||"fill"===this.type)D=this.defaultSymbolChooser.getSymbol(),D=u.fromJson(D.toJson()),D.setColor(y);return D},_updateUniqueValueDivVisibility:function(){var y=k("tr",this.uniqueSysTbody);0===y.length?(this._addDefaultValueTr(this.uniqueSysTbody),this._setDefaultSymbolStatus(!1)):1===y.length&&c.hasClass(y[0],
"default-symbol-tr")&&this._setDefaultSymbolStatus(!1);y.removeClass("selected");k(".default-symbol-tr",this.uniqueSysTbody).addClass("selected");c.setStyle(this.uniqueValueDiv,"display","block")},_bindClassBreaksEvents:function(){this.own(b(this.minDomain,"change",f.hitch(this,this._updateClassBreaksTable)));this.own(b(this.maxDomain,"change",f.hitch(this,this._updateClassBreaksTable)));this.own(b(this.classCount,"change",f.hitch(this,this._updateClassBreaksTable)));this.own(b(this.selectedFrom,
"change",f.hitch(this,this._onSelectedRangeChange)));this.own(b(this.selectedTo,"change",f.hitch(this,this._onSelectedRangeChange)));this.own(b(this.classBreakSelectedLabel,"change",f.hitch(this,this._onClassBreakSelectedLabelChange)));this.own(b(this.classBreaksColorSelect,"change",f.hitch(this,this._updateClassBreaksTable)));this.own(b(this.minSymbolSize,"change",f.hitch(this,this._updateClassBreaksTable)));this.own(b(this.maxSymbolSize,"change",f.hitch(this,this._updateClassBreaksTable)))},_showClassBreaksRenderer:function(y){this._isDrawing=
!0;this.rendererSelect.set("value","color");y._colorType&&this.classBreaksColorSelect.set("value",y._colorType);var D=Infinity,B=-Infinity;this.fieldComboBox.set("displayedValue",y.attributeField);this.classCount.set("value",y.infos.length);c.empty(this.classBreaksTbody);a.forEach(y.infos,f.hitch(this,function(C){var J=C.minValue,L=C.maxValue;this._addClassBreaksTr(C.symbol,J,L,C.label?C.label:C.minValue+" \u2014\u2014 "+C.maxValue);D=Math.min(D,J);B=Math.max(B,L)}));this.minDomain.set("value",D);
this.maxDomain.set("value",B);this._addDefaultValueTr(this.classBreaksTbody);if("marker"===this.type){var x=Infinity,r=-Infinity;a.forEach(y.infos,f.hitch(this,function(C){C=C.symbol;C=e.isPictureMarkerSymbol(C)?C.width:C.size;x=Math.min(C,x);r=Math.max(C,r)}));this.minSymbolSize.set("value",x);this.maxSymbolSize.set("value",r);this.minSymSize!==this.maxSymSize&&this.rendererSelect.set("value","size")}var t=this;setTimeout(function(){t._isDrawing=!1},1E3)},_getClassBreaksRenderer:function(){var y=
this.defaultSymbolChooser.getSymbol(),D=this.fieldComboBox.get("value"),B=new z(y,D);y=k(".class-breaks-tr",this.classBreaksTbody);a.forEach(y,f.hitch(this,function(x){B.addBreak({minValue:x.from,maxValue:x.to,symbol:x.symbol,label:x.label})}));B._colorType=this.classBreaksColorSelect.get("value");B._showOthersSymbol=this._showOthersSymbol;return B},_onClassBreakSelectedSymbolChange:function(y){var D=this._selectedClassBreakTr;D&&(D.symbol=y,D=k(".symbol-div",D)[0],this._drawSymbolPreview(D,y))},
_onSelectedRangeChange:function(){var y=parseFloat(this.selectedFrom.get("value")),D=parseFloat(this.selectedTo.get("value"));if(y>D){var B=y;y=D;D=B;this.selectedFrom.set("value",y);this.selectedTo.set("value",D)}!(B=this._selectedClassBreakTr)||B.from===y&&B.to===D||(B.from=y,B.to=D,y=y+" \u2014 "+D,B.label=y,this.classBreakSelectedLabel.value=y,k(".label-div",B)[0].innerHTML=y)},_onClassBreakSelectedLabelChange:function(){var y=this._selectedClassBreakTr;if(y){var D=this.classBreakSelectedLabel.value;
y.label=D;k(".label-div",y)[0].innerHTML=D}},_updateClassBreaksTable:function(){if(!this._isDrawing){c.setStyle(this.classBreaksSetting,"display","none");c.empty(this.classBreaksTbody);var y=parseFloat(this.minDomain.get("value")),D=parseFloat(this.maxDomain.get("value"));if(y>D){var B=y;y=D;D=B;this.minDomain.set("value",y);this.maxDomain.set("value",D)}else if(y===D)return;var x=parseFloat(this.minSymbolSize.get("value")),r=parseFloat(this.maxSymbolSize.get("value"));x>r&&(B=x,x=r,r=B,this.minSymbolSize.set("value",
x),this.maxSymbolSize.set("value",r));B=parseInt(this.classCount.get("value"),10);var t=(D-y)/B;D=[];var C;for(C=0;C<=B;C++){var J=y+t*C;J=parseFloat(J.toFixed(4));D.push(J)}C=this.rendererSelect.get("value");y=[];"color"===C?y=this._createColorClassBreaksSymbols(B):"size"===C&&(y=this._createSizeClassBreaksSymbols(B,x,r));for(C=0;C<B;C++)x=D[C],r=D[C+1],this._addClassBreaksTr(y[C],x,r,x+" \u2014 "+r);this._addDefaultValueTr(this.classBreaksTbody);this._updateClassBreaksSettingVisibility()}},_selectClassBreaksTr:function(y){k("tr",
this.classBreaksTbody).removeClass("selected");c.addClass(y,"selected");this._selectedClassBreakTr=y;var D=y.symbol,B=parseFloat(y.from),x=parseFloat(y.to);y=y.label;this.selectedFrom.set("value",B);this.selectedTo.set("value",x);this.classBreakSelectedLabel.value=y;this._showSelectedSymbol(D)},_addClassBreaksTr:function(y,D,B,x){var r=c.toDom('\x3ctr class\x3d"class-breaks-tr"\x3e\x3ctd class\x3d"symbol-td"\x3e\x3cdiv class\x3d"symbol-div"\x3e\x3c/div\x3e\x3c/td\x3e\x3ctd class\x3d"label-td"\x3e\x3cdiv wrap class\x3d"label-div"\x3e\x3c/div\x3e\x3c/td\x3e\x3ctd class\x3d"delete-td"\x3e\x3cdiv class\x3d"delete-div jimu-icon jimu-icon-delete"\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e'),
t=k(".default-symbol-tr",this.classBreaksTbody);0<t.length?c.place(r,t[0],"before"):c.place(r,this.classBreaksTbody);r.symbol=y;r.from=D;r.to=B;r.label=x;D=k(".symbol-div",r)[0];B=k(".label-div",r)[0];t=k(".delete-div",r)[0];this._drawSymbolPreview(D,y);B.innerHTML=x;this.own(b(r,"click",f.hitch(this,function(){this._selectClassBreaksTr(r)})));this.own(b(t,"click",f.hitch(this,function(C){C.stopPropagation();this._selectClassBreaksTr===r&&(this._selectClassBreaksTr=null);c.destroy(r);this._updateClassBreaksSettingVisibility()})));
this._updateClassBreaksTableStyle();this._showDefaultSymbol();c.setStyle(this.classBreaksSetting,"display","block")},_addDefaultValueTr:function(y){if(!(0<k(".default-symbol-tr",y).length)){var D=this.defaultSymbolChooser.getSymbol(),B=this.nls.defaultSymbol,x=c.toDom('\x3ctr class\x3d"default-symbol-tr"\x3e\x3ctd class\x3d"symbol-td"\x3e\x3cdiv class\x3d"symbol-div"\x3e\x3c/div\x3e\x3c/td\x3e\x3ctd class\x3d"label-td"\x3e\x3cdiv wrap class\x3d"label-div"\x3e\x3c/div\x3e\x3c/td\x3e\x3ctd class\x3d"check-td"\x3e\x3cdiv class\x3d"check-div"\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e');
c.place(x,y);var r=k(".symbol-div",x)[0],t=k(".label-div",x)[0],C=k(".check-div",x)[0];c.setAttr(C,"title",this.nls.othersSymbolTip);var J=new w({checked:this._showOthersSymbol});J.placeAt(C);J.startup();t.innerHTML=this.nls.othersSymbol;this.own(b(x,"click",f.hitch(this,function(){k("tr",y).removeClass("selected");c.addClass(x,"selected");this._showDefaultSymbol()})));this.own(b(J,"change",f.hitch(this,function(L){this._showOthersSymbol=L})));this._drawSymbolPreview(r,D);x.symbol=D;x.label=B;x.checkbox=
J;c.setStyle(this.uniqueValueDiv,"display","block")}},_updateClassBreaksTableStyle:function(){},_updateClassBreaksSettingVisibility:function(){var y=k("tr",this.classBreaksTbody);0===y.length?(this._addDefaultValueTr(this.classBreaksTbody),this._setDefaultSymbolStatus(!1)):1===y.length&&c.hasClass(y[0],"default-symbol-tr")&&this._setDefaultSymbolStatus(!1);y.removeClass("selected");k(".default-symbol-tr",this.classBreaksTbody).addClass("selected");c.setStyle(this.classBreaksSetting,"display","block")},
_createColorClassBreaksSymbols:function(y){for(var D=[],B=this._createClassBreaksColors(y),x=0;x<y;x++){var r=B[x],t=null;if("marker"===this.type)t=new E({style:"esriSMSCircle",color:[0,0,128,128],name:"Circle",outline:{color:[191,151,39,255],width:1},type:"esriSMS",size:18}),t.setColor(r);else if("line"===this.type||"fill"===this.type)t=this.defaultSymbolChooser.getSymbol(),t=u.fromJson(t.toJson()),t.setColor(r);D.push(t)}return D},_createClassBreaksColors:function(y){var D=[],B=this.classBreaksColorSelect.get("value"),
x=this._classBreaksColors[B];B=new g(x[0]);var r=new g(x[1]);x=Math.floor((r.r-B.r)/y);var t=Math.floor((r.g-B.g)/y);r=Math.floor((r.b-B.b)/y);for(var C=0;C<y;C++){var J=new g([B.r+x*C,B.g+t*C,B.b+r*C,255]);D.push(J)}return D},_createSizeClassBreaksSymbols:function(y,D,B){var x=this.defaultSymbolChooser.getSymbol(),r=[];B=(B-D)/(y-1);for(var t=0;t<y;t++){var C=Math.round(D+B*t),J=x.toJson();J=u.fromJson(J);e.isPictureMarkerSymbol(J)?(J.setWidth(C),J.setHeight(C)):J.setSize(C);r.push(J)}return r}})})},
"jimu/rendererUtils":function(){define(["esri/renderers/jsonUtils"],function(H){return{cloneRenderer:function(d){if(!d)return null;var m=null;try{var n=d.toJson();m=H.fromJson(n)}catch(q){console.error(q)}return m},isSimpleRenderer:function(d){return d&&"esri.renderer.SimpleRenderer"===d.declaredClass},isUniqueValueRenderer:function(d){return d&&"esri.renderer.UniqueValueRenderer"===d.declaredClass},isClassBreaksRenderer:function(d){return d&&"esri.renderer.ClassBreaksRenderer"===d.declaredClass},
isDotDensityRenderer:function(d){return d&&"esri.renderer.DotDensityRenderer"===d.declaredClass},isScaleDependentRenderer:function(d){return d&&"esri.renderer.ScaleDependentRenderer"===d.declaredClass},isTemporalRenderer:function(d){return d&&"esri.renderer.TemporalRenderer"===d.declaredClass}}})},"widgets/Geoprocessing/PopupConfig":function(){define("dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./PopupConfig.html dojo/_base/lang dojo/_base/html dojo/_base/array dojo/Evented esri/request dijit/MenuItem jimu/dijit/SimpleTable dijit/form/TextBox dijit/form/DropDownButton dijit/TooltipDialog dijit/Menu".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g){return H([d,m,n,b],{_def:null,declaredClass:"jimu.dijit.PopupConfig",baseClass:"jimu-dijit-popup-config",templateString:q,url:null,title:null,fields:null,config:null,showTitle:!0,postMixInProperties:function(){this.nls=window.jimuNls.popupConfig},postCreate:function(){this.inherited(arguments);this._initFieldsTable();this.clear();this.showTitle?(c.setStyle(this.titleTR,"display",""),this.title&&this.titleTextBox.set("value",this.title)):c.setStyle(this.titleTR,"display",
"none");this.fields?this.setFields(this.fields):this.url&&this.setUrl(this.url)},getConfig:function(){var e={title:f.trim(this.titleTextBox.get("value")),fields:[]},l=this.fieldsTable.getRows();a.forEach(l,f.hitch(this,function(p){var v=this.fieldsTable.getRowData(p);e.fields.push({name:v.name,alias:v.alias,type:p.fieldType,visible:v.visibility})}));return e},setUrl:function(e){if("string"===typeof e)return this.url=e=f.trim(e),this.clear(),this._requestLayerInfo(e)},setFields:function(e){e instanceof
Array&&this._setFields(e)},clear:function(){this.fieldsTable.clear();this._resetMenu();this._addEmptyMenuItem()},_initFieldsTable:function(){c.empty(this.fieldsTableTd);var e=[{name:"visibility",title:this.nls.visibility,type:"checkbox",onChange:f.hitch(this,this._onFieldVisibleChange)},{name:"name",title:this.nls.name,type:"text",editable:!1},{name:"alias",title:this.nls.alias,type:"text",editable:!0},{name:"actions",title:this.nls.actions,type:"actions",actions:["up","down"]}];this.fieldsTable=
new g({fields:e});this.fieldsTable.placeAt(this.fieldsTableTd)},_onFieldVisibleChange:function(){var e=this.fieldsTable.getRows();a.every(e,function(l){return!1===this.fieldsTable.getRowData(l).visibility},this)?this.emit("noVisibleField"):this.emit("hasVisibleField")},_resetMenu:function(){var e=this.menu.getChildren();a.forEach(e,f.hitch(this,function(l){this.menu.removeChild(l)}))},_addEmptyMenuItem:function(){var e=new h({label:this.nls.noField,onClick:f.hitch(this,function(){var l=this.menu.getParent();
c.setStyle(l.domNode.parentNode,"display","none")})});this.menu.addChild(e)},_setFields:function(e){this._resetMenu();this.fields=a.filter(e,function(l){return"esriFieldTypeGeometry"!==l.type});0<this.fields.length?a.forEach(this.fields,f.hitch(this,function(l){this._addMenuItem(l);this._addRow(l)})):this._addEmptyMenuItem()},_requestLayerInfo:function(e){this._def&&this._def.cancel();this._def=k({url:e,content:{f:"json"},handleAs:"json",callbackParamName:"callback"});this._def.then(f.hitch(this,
function(l){l&&l.fields&&this._setFields(l.fields)}),f.hitch(this,function(l){console.error("request layer info failed",l)}));return this._def},_addMenuItem:function(e){var l=new h({label:e.name+" {"+e.name+"}",onClick:f.hitch(this,function(){var p=this.titleTextBox.get("value")+"${"+e.name+"}";this.titleTextBox.set("value",p);p=this.menu.getParent();c.setStyle(p.domNode.parentNode,"display","none")})});this.menu.addChild(l)},_addRow:function(e){var l=this.fieldsTable.addRow({visibility:!1!==e.visible,
name:e.name,alias:e.alias||e.name});l.success&&(l.tr.fieldType=e.type)}})})},"widgets/Geoprocessing/editors/SelectFeatureSetFromUrl":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin jimu/dijit/CheckBox jimu/dijit/LoadingIndicator jimu/dijit/Message esri/tasks/query esri/layers/GraphicsLayer esri/SpatialReference esri/tasks/QueryTask esri/symbols/jsonUtils esri/renderers/SimpleRenderer ./BaseFeatureSetEditor dojo/text!./SelectFeatureSetFromUrl.html jimu/dijit/URLInput".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v){return H([p,n,q],{baseClass:"jimu-gp-editor-base jimu-gp-editor-url",templateString:v,editorName:"SelectFeatureSetFromUrl",postCreate:function(){this.inherited(arguments);this.featureSetUrl.set("placeholder",this.nls.urlPlaceholder);this.inputLayer=new k;if(this.param.symbol){var z=new l(e.fromJson(this.param.symbol));this.inputLayer.setRenderer(z)}this.map.addLayer(this.inputLayer);this.param.featureSetUrl&&this.featureSetUrl.set("value",this.param.featureSetUrl);
this.param.showUrlContent&&(this.visibleCheckbox=new f({checked:!1,label:this.nls.showLayerContent,onChange:d.hitch(this,this.viewLayerContent)}),this.visibleCheckbox.placeAt(this.visibleCheckboxDiv));this.loading=new c({hidden:!0},this.loadingNode);this.loading.startup()},viewLayerContent:function(z){z?this.featureSetUrl.isValid()?(this._showLoading(),z=new b,z.geometry=this.map.extent,z.spatialRelationship=b.SPATIAL_REL_INTERSECTS,z.returnGeometry=!0,z.outFields=["*"],z.outSpatialReference=new h(this.map.spatialReference.wkid),
this.queryTask=new g(this.getValue()),this.queryTask.execute(z,d.hitch(this,this._addToLayer),d.hitch(this,this._queryError))):new a({message:this.nls.invalidUrl}):this.inputLayer.clear()},_showLoading:function(){this.visibleCheckbox.setStatus(!1);this.loading.show()},_hideLoading:function(){this.visibleCheckbox.setStatus(!0);this.loading.hide()},_queryError:function(z){this._hideLoading();new a({message:z.message})},_addToLayer:function(z){m.forEach(z.features,function(u){this.inputLayer.add(u)},
this);this._hideLoading()},destroy:function(){this.inputLayer.clear();this.map.removeLayer(this.inputLayer)},getValue:function(){return 0===this.activeViewIndex?this.featureSetUrl.get("value"):this.getFeatureSet()},getGPValue:function(){if(0===this.activeViewIndex){var z=new b;z.where="1\x3d1";z.returnGeometry=!0;z.outFields=["*"];z.outSpatialReference=new h(this.querySetting.spatialReference.wkid);this.queryTask=new g(this.getValue());return this.queryTask.execute(z)}return this.wrapValueToDeferred(this.getFeatureSet())}})})},
"widgets/Geoprocessing/editors/BaseFeatureSetEditor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/html dojo/on jimu/dijit/ViewStack ../BaseEditor ./SelectFeatureSetFromSelection".split(" "),function(H,d,m,n,q,f,c){return H([f],{editorName:"BaseFeatureSetEditor",viewStack:null,activeViewIndex:0,postCreate:function(){this.inherited(arguments);this.viewStack=new q({viewType:"dom",views:[this.inputNode,this.featuresetNode]});m.place(this.viewStack.domNode,this.domNode);this.viewStack.startup();
this.switchView(0)},switchView:function(a){this.activeViewIndex=a;this.viewStack.switchView(a)},setFeatureSet:function(a,b){a.features&&0<a.features.length&&(m.empty(this.featuresetNode),this.featuresetDijit=new c({featureset:a,nls:this.nls}),m.place(this.featuresetDijit.domNode,this.featuresetNode),this.featuresetDijit.startup(),this.own(n(this.featuresetDijit,"close",d.hitch(this,function(){this.switchView(0)}))),this.switchView(1))},getFeatureSet:function(){return this.featuresetDijit?this.featuresetDijit.getValue():
null}})})},"widgets/Geoprocessing/editors/SelectFeatureSetFromSelection":function(){define("dojo/_base/declare dojo/_base/lang dojo/on dojo/Evented dijit/_TemplatedMixin ../BaseEditor".split(" "),function(H,d,m,n,q,f){return H([f,q,n],{baseClass:"jimu-gp-editor-selection",templateString:'\x3cdiv\x3e\x3cdiv class\x3d"label"\x3e${nls.useSelectedFeatureset}\x3c/div\x3e\x3cdiv class\x3d"icon" data-dojo-attach-point\x3d"closeBtn" title\x3d"${nls.closeSelectedFeatureset}"\x3e\x3cdiv class\x3d"feature-action icon-close"\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e',
editorName:"SelectFeatureSetFromSelection",postCreate:function(){this.inherited(arguments);this.own(m(this.closeBtn,"click",d.hitch(this,function(){this.emit("close")})))},getValue:function(){return this.featureset},getGPValue:function(){return this.wrapValueToDeferred(this.featureset)}})})},"widgets/Geoprocessing/editors/SelectFeatureSetFromLayer":function(){define("dojo/_base/declare dojo/Deferred dijit/_TemplatedMixin jimu/dijit/SpatialFilterByFeatures jimu/utils ./BaseFeatureSetEditor dojo/text!./SelectFeatureSetFromLayer.html esri/dijit/analysis/utils esri/tasks/query".split(" "),
function(H,d,m,n,q,f,c,a,b){var k=H(null,{constructor:function(h){this.layerObject=h},layerObject:0,toJson:function(){return this.layerObject}});return H([f,m],{templateString:c,editorName:"SelectFeatureSetFromLayer",postCreate:function(){this.inherited(arguments);this.spatialFilterByFeatures=new n({map:this.map,types:this.param.defaultValue&&this.param.defaultValue.geometryType?[q.getTypeByGeometryType(this.param.defaultValue.geometryType)]:["point","polyline","polygon"]});this.spatialFilterByFeatures.placeAt(this.layerChooseNode);
this.spatialFilterByFeatures.startup()},getGPValue:function(){if(0===this.activeViewIndex){var h=new d,g=this.spatialFilterByFeatures.getSelectedLayer();if(g){var e=this.spatialFilterByFeatures.featureSetChooserForSingleLayer.syncGetFeatures();e&&0<e.length?(g=q.getFeatureSetByLayerAndFeatures(g,e),h.resolve(g)):this.param.useFeatureCollection?g.url?(e=new b,e.where="1\x3d1",g.queryFeatures(e).then(function(l){h.resolve(l)},function(l){h.reject(l)})):(g=q.getFeatureSetByLayerAndFeatures(g,g.graphics),
h.resolve(g)):h.resolve(new k(a.constructAnalysisInputLyrObj(g)))}else h.resolve(null);return h}return this.wrapValueToDeferred(this.getFeatureSet())}})})},"jimu/dijit/SpatialFilterByFeatures":function(){define("dojo/_base/array dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./templates/SpatialFilterByFeatures.html dojo/on dojo/Evented dojo/Deferred dojo/_base/html dojo/_base/lang jimu/utils jimu/Query jimu/dijit/CheckBox jimu/dijit/FeaturelayerChooserFromMap jimu/dijit/LayerChooserFromMapWithDropbox jimu/dijit/SearchDistance jimu/LayerInfos/LayerInfos esri/graphic esri/tasks/query esri/symbols/jsonUtils esri/layers/GraphicsLayer esri/renderers/SimpleRenderer esri/geometry/geometryEngine jimu/dijit/FeatureSetChooserForSingleLayer".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F,y,D,B,x){d=d([m,n,q,a],{baseClass:"jimu-dijit-spatial-filter-features",templateString:f,_bufferLayer:null,_defaultRelationship:"SPATIAL_REL_INTERSECTS",drawBox:null,selectionRadio:null,_selectionHandle:null,layerInfosObj:null,_layerAllFeaturesCache:null,map:null,types:null,enableBuffer:!1,distance:0,unit:"",showLoading:!1,ignoredFeaturelayerIds:null,postMixInProperties:function(){this.inherited(arguments);this.nls=window.jimuNls.spatialFilterByFeatures;
this.ignoredFeaturelayerIds||(this.ignoredFeaturelayerIds=[]);this._layerAllFeaturesCache={}},postCreate:function(){this.inherited(arguments);this.selectionRadio=new l({label:this.nls.selectedFeatures});this.selectionRadio.placeAt(this.selectionOptionDiv);this.selectionRadio.setStatus(!1);this.own(c(this.selectionRadio,"change",h.hitch(this,this._onRadioChanged)));k.setStyle(this.domNode,"position","relative");var r=F.fromJson({style:"esriSFSSolid",color:[79,129,189,77],type:"esriSFS",outline:{style:"esriSLSSolid",
color:[54,93,141,255],width:1.5,type:"esriSLS"}});r=new D(r);this._bufferLayer=new y;this._bufferLayer.setRenderer(r);this.map.addLayer(this._bufferLayer);r=new p({createMapResponse:this.map.webMapResponse,types:this.types,showLayerFromFeatureSet:!0,onlyShowVisible:!1,updateWhenLayerInfosIsShowInMapChanged:!0,ignoredFeaturelayerIds:this.ignoredFeaturelayerIds});this.layerChooserFromMapWithDropbox=new v({label:this.nls.relatedLayer,layerChooser:r});this.layerChooserFromMapWithDropbox.placeAt(this.layerSelectDiv);
this.own(c(this.layerChooserFromMapWithDropbox,"selection-change",h.hitch(this,this._onLayerChanged)));this.layerInfosObj=u.getInstanceSync();this.own(c(this.layerInfosObj,"layerInfosIsShowInMapChanged",h.hitch(this,this._onLayerInfosIsShowInMapChanged)));this.searchDistance=new z({tip:window.jimuNls.searchDistance.applySearchDistanceToFeatures,distance:this.distance,unit:this.unit});this.searchDistance.placeAt(this.searchDistanceDiv);this.enableBuffer?(this.searchDistance.enable(),this.own(c(this.searchDistance,
"change",h.hitch(this,this._onSearchDistanceChange)))):(this.searchDistance.disable(),k.setStyle(this.searchDistanceDiv,"display","none"));this._onLayerChanged()},reset:function(r){r&&(this.searchDistance.reset(),this.searchDistance.setDistance(this.distance),this.searchDistance.setUnit(this.unit));this.clearAllGraphics()},hideTempLayers:function(){this._bufferLayer&&this._bufferLayer.hide();this.drawBox&&this.drawBox.hideLayer();this.featureSetChooserForSingleLayer&&this.featureSetChooserForSingleLayer.hideMiddleFeatureLayer()},
showTempLayers:function(){this._bufferLayer&&this._bufferLayer.show();this.drawBox&&this.drawBox.showLayer();this.featureSetChooserForSingleLayer&&this.featureSetChooserForSingleLayer.showMiddleFeatureLayer()},disable:function(r){r&&this._hideAllLayers()},enable:function(){this._showAllLayers()},deactivate:function(){this.featureSetChooserForSingleLayer&&this.featureSetChooserForSingleLayer.deactivate()},clearAllGraphics:function(){this._clearBufferLayer();this.featureSetChooserForSingleLayer&&this.featureSetChooserForSingleLayer.clearAllGraphics()},
setSelectedLayer:function(r){return this.layerChooserFromMapWithDropbox.setSelectedLayer(r)},getSelectedLayer:function(){return this._getSelectedLayerInfomation().layer},checkSelectedFeaturesRadio:function(){this.selectionRadio.getValue()||this.selectionRadio.check()},uncheckSelectedFeaturesRadio:function(){this.selectionRadio.getValue()&&this.selectionRadio.uncheck()},isValidSearchDistance:function(){return 0<=this.searchDistance.getStatus()},getGeometryInfo:function(r){var t=new b,C={status:null,
geometry:null};this._updateBuffer();if(0===this._getSelectedLayerInfomation().type)return C.status=-1,t.resolve(C),t;if(0>this.searchDistance.getData().status)return C.status=-2,t.resolve(C),t;this._getFeatures(r).then(h.hitch(this,function(){C.geometry=this._updateBuffer();C.status=C.geometry?1:0;t.resolve(C)}),h.hitch(this,function(J){t.reject(J)}));return t},getFeatureSet:function(r){var t=new b,C=null,J=this._getSelectedLayerInfomation().layer;J?this._getFeatures(r).then(h.hitch(this,function(L){C=
g.getFeatureSetByLayerAndFeatures(J,L);t.resolve(C)}),h.hitch(this,function(L){t.reject(L)})):t.resolve(C);return t},_getFeatures:function(){var r=new b,t=[],C=this._getSelectedLayerInfomation(),J=C.type;0===J?r.resolve(t):this.selectionRadio.getStatus()&&this.selectionRadio.getValue()?(t=C.layer.getSelectedFeatures(),r.resolve(t)):this.featureSetChooserForSingleLayer.isLoading()?r=this.featureSetChooserForSingleLayer.getFeatures():(t=this.featureSetChooserForSingleLayer.syncGetFeatures(),0<t.length?
r.resolve(t):3===J?(t=C.layer.graphics,r.resolve(t)):r=this._getAllFeaturesFromFeaturelayer(C.layer));return r},_getAllFeaturesFromFeaturelayer:function(r){var t=new b;if(this._layerAllFeaturesCache[r.id])t.resolve(this._layerAllFeaturesCache[r.id]);else{var C=g.getFeatureLayerDefinition(r);C||(C={currentVersion:r.currentVersion,fields:h.clone(r.fields)});this.emit("loading");C=new w;C.where=r.getDefinitionExpression()||"1\x3d1";C.geometry=null;C.outSpatialReference=this.map.spatialReference;C.returnGeometry=
!0;(new e({url:r.url,query:C})).getAllFeatures().then(h.hitch(this,function(J){this.emit("unloading");J?(J=J.features||[],this._layerAllFeaturesCache[r.id]=J,t.resolve(J)):t.reject("Can't get all features from featureLayer "+r.id)}),h.hitch(this,function(J){this.emit("unloading");t.reject(J)}))}return t},_syncGetFeatures:function(){var r=[],t=this._getSelectedLayerInfomation(),C=t.type;0!==C&&(this.selectionRadio.getStatus()&&this.selectionRadio.getValue()?r=t.layer.getSelectedFeatures():(r=this.featureSetChooserForSingleLayer.syncGetFeatures(),
0===r.length&&(3===C?r=t.layer.graphics:(t=this._layerAllFeaturesCache[t.layer.id])&&(r=t))));return r},isLoading:function(){return this.featureSetChooserForSingleLayer&&this.featureSetChooserForSingleLayer.isLoading()},_onLoading:function(){this.showLoading&&this.loading.show();this.emit("loading")},_onUnloading:function(){this.loading.hide();this.emit("unloading")},_showAllLayers:function(){this._bufferLayer&&this._bufferLayer.show()},_hideAllLayers:function(){this._bufferLayer&&this._bufferLayer.hide()},
_onRadioChanged:function(){this.selectionRadio.getValue()&&this.featureSetChooserForSingleLayer&&(this.featureSetChooserForSingleLayer.deactivate(),this.featureSetChooserForSingleLayer.clearAllGraphics());this._updateBuffer()},_getSelectedLayerInfomation:function(){var r=0,t=null,C=null,J=this.layerChooserFromMapWithDropbox.getSelectedItems();0<J.length&&(t=J[0]);t&&(C=t.layerInfo.layerObject,r=C.url?0<=this.map.graphicsLayerIds.indexOf(C.id)?1:2:3);return{type:r,layerItem:t,layer:C}},_onLayerChanged:function(){this.clearAllGraphics();
this._clearSelectionHandle();this._updateSelectedFeaturesCount();this.featureSetChooserForSingleLayer&&this.featureSetChooserForSingleLayer.destroy();this.featureSetChooserForSingleLayer=null;var r=this._getSelectedLayerInfomation();0<r.type&&(this.featureSetChooserForSingleLayer=new x({map:this.map,featureLayer:r.layer,updateSelection:!1}),this._selectionHandle=c(r.layer,"selection-complete",h.hitch(this,function(){var t=this.selectionRadio.getStatus()&&this.selectionRadio.getValue();this._updateSelectedFeaturesCount();
t&&this._updateBuffer()})),this.own(c(this.featureSetChooserForSingleLayer,"user-clear",h.hitch(this,this._onUserClear))),this.own(c(this.featureSetChooserForSingleLayer,"loading",h.hitch(this,h.hitch(this,function(){this._clearBufferLayer();this._onLoading()})))),this.own(c(this.featureSetChooserForSingleLayer,"unloading",h.hitch(this,h.hitch(this,function(){this._onUnloading();this._updateBuffer()})))),this.featureSetChooserForSingleLayer.placeAt(this.featureSetChooserDiv),this.own(c(this.featureSetChooserForSingleLayer,
"draw-activate",h.hitch(this,function(){this.uncheckSelectedFeaturesRadio()}))));this._updateFeatureSetChooserForSingleLayerStatus();this._updateBuffer()},_onLayerInfosIsShowInMapChanged:function(){this._updateFeatureSetChooserForSingleLayerStatus()},_onSearchDistanceChange:function(){this._updateBuffer();this.emit("search-distance-change")},_updateFeatureSetChooserForSingleLayerStatus:function(){if(this.featureSetChooserForSingleLayer){var r=!1,t=this.featureSetChooserForSingleLayer.getFeatureLayer();
(t=this.layerInfosObj.getLayerInfoById(t.id))&&(r=t.isShowInMap());r?(this.featureSetChooserForSingleLayer.enable(),k.removeClass(this.featureSetChooserForSingleLayer.domNode,"not-visible")):(this.featureSetChooserForSingleLayer.disable(),this.featureSetChooserForSingleLayer.clearAllGraphics(),k.addClass(this.featureSetChooserForSingleLayer.domNode,"not-visible"),this._updateBuffer())}},_updateBuffer:function(){this._clearBufferLayer();var r=this.searchDistance.getData(),t=r.status,C=r.distance;r=
r.bufferUnit;if(0>t)return null;var J=this._syncGetFeatures(),L=null,P=[];H.forEach(J,h.hitch(this,function(U){U&&U.geometry&&P.push(U.geometry)}));0<P.length&&(L="polygon"===P[0].type?B.union(P):g.combineGeometries(P));return 0===t?L:L?(L=B.simplify(L),J=L.spatialReference,t=null,t=J.isWebMercator()||4326===J.wkid?B.geodesicBuffer(L,C,r,!0):B.buffer(L,C,r,!0),C=new E(t),this._bufferLayer.add(C),t):null},_onUserClear:function(){this.clearAllGraphics()},_clearBufferLayer:function(){this._bufferLayer&&
this._bufferLayer.clear()},_updateSelectedFeaturesCount:function(){this.selectionRadio.setStatus(!0);var r=this._getSelectedLayerInfomation(),t=0;r.layer&&(r=r.layer.getSelectedFeatures())&&(t=r.length);0===t?(this.selectionRadio.getValue()&&this.selectionRadio.uncheck(),this.selectionRadio.setStatus(!1),k.addClass(this.selectionOptionDiv,"not-visible")):k.removeClass(this.selectionOptionDiv,"not-visible");this.selectionRadio.setLabel(this.nls.selectedFeatures+(window.isRTL?"\x26rlm;":" ")+"("+t+
")")},_clearSelectionHandle:function(){this._selectionHandle&&this._selectionHandle.remove();this._selectionHandle=null},destroy:function(){this._bufferLayer&&this.map.removeLayer(this._bufferLayer);this._bufferLayer=null;this._clearSelectionHandle();this.inherited(arguments)}});d.NONE_SELECTED_FEATURES_NOT_DRAW_SHAPES="NONE_SELECTED_FEATURES_NOT_DRAW_SHAPES";return d})},"jimu/dijit/FeaturelayerChooserFromMap":function(){define(["dojo/_base/declare","dojo/Deferred","dojo/_base/html","dojo/_base/lang",
"./LayerChooserFromMap"],function(H,d,m,n,q){return H([q],{baseClass:"jimu-featurelayer-chooser-from-map",declaredClass:"jimu.dijit.FeaturelayerChooserFromMap",types:null,showLayerFromFeatureSet:!1,showTable:!1,onlyShowVisible:!1,ignoredFeaturelayerIds:null,mustSupportStatistics:!1,ignoreVirtualLayer:!1,postMixInProperties:function(){this.inherited(arguments);this.ignoredFeaturelayerIds||(this.ignoredFeaturelayerIds=[]);this.basicFilter=n.hitch(this,this.basicFilter);this.filter=q.createFeaturelayerFilter(this.types,
this.showLayerFromFeatureSet,this.showTable,this.mustSupportStatistics);this.ignoreVirtualLayer&&(this.filter=q.andCombineFilters([this.filter,n.hitch(this,this._ignoreVirtualLayerFilter)]))},postCreate:function(){this.inherited(arguments);m.addClass(this.domNode,"jimu-basic-layer-chooser-from-map")},_ignoreVirtualLayerFilter:function(f){return f.getLayerType().then(function(c){return!("ArcGISDynamicMapServiceLayer"===c||"ArcGISTiledMapServiceLayer"===c||"GroupLayer"===c)})},basicFilter:function(f){var c=
new d;0<=this.ignoredFeaturelayerIds.indexOf(f.id)?c.resolve(!1):this.onlyShowVisible&&"Table"!==f.getLayerType()?c.resolve(f.isShowInMap()):c.resolve(!0);return c},getHandledItem:function(f){var c=this.inherited(arguments),a=f&&f.layerInfo;a=a&&a.layerObject;c.url=a&&a.url||"";return c}})})},"jimu/dijit/LayerChooserFromMap":function(){define("dojo/on dojo/Evented dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/store/Memory dojo/Deferred dojo/store/Observable dijit/tree/ObjectStoreModel dojo/promise/all dojo/_base/lang dojo/_base/html dojo/_base/array jimu/utils jimu/dijit/_Tree jimu/LayerInfos/LayerInfos jimu/dijit/LoadingIndicator".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u){var E=m([n,q,f,d],{templateString:'\x3cdiv style\x3d"width:100%;"\x3e\x3cdiv data-dojo-attach-point\x3d"errorTipSection" class\x3d"error-tip-section"\x3e\x3cspan class\x3d"jimu-icon jimu-icon-error"\x3e\x3c/span\x3e\x3cspan class\x3d"jimu-state-error-text" data-dojo-attach-point\x3d"errTip"\x3e${nls.noLayersTip}\x3c/span\x3e\x3c/div\x3e\x3c/div\x3e',_store:null,_id:0,_treeClass:"layer-chooser-tree",createMapResponse:null,multiple:!1,onlyShowVisible:!1,
updateWhenLayerInfosIsShowInMapChanged:!1,onlyShowWebMapLayers:!1,displayTooltipForTreeNode:!1,onlyFilterCurrentLayerWhenAddItem:!1,postMixInProperties:function(){this.nls=window.jimuNls.basicLayerChooserFromMap},postCreate:function(){this.inherited(arguments);e.addClass(this.domNode,"jimu-basic-layer-chooser-from-map");this.multiple=!!this.multiple;this.shelter=new u({hidden:!0});this.shelter.placeAt(this.domNode);this.shelter.startup();this._createTree();this.basicFilter=g.hitch(this,this.basicFilter);
this.filter=E.andCombineFilters([this.basicFilter,this.filter]);this.createMapResponse&&this.setCreateMapResponse(this.createMapResponse)},basicFilter:function(w){var F=new a;this.onlyShowVisible?F.resolve(w.isShowInMap()):F.resolve(!0);return F},filter:function(w){w=new a;w.resolve(!0);return w},getSelectedItems:function(){var w=this.tree.getSelectedItems();return l.map(w,g.hitch(this,function(F){return this.getHandledItem(F)}))},getAllItems:function(){var w=this.tree.getAllItems(),F=[];l.forEach(w,
g.hitch(this,function(y){"root"!==y.id&&(y=this.getHandledItem(y),F.push(y))}));return F},getHandledItem:function(w){return{name:w.name,layerInfo:w.layerInfo}},_isLeafItem:function(w){return w.isLeaf},setCreateMapResponse:function(w){this.createMapResponse=w;z.getInstance(this.createMapResponse.map,this.createMapResponse.itemInfo).then(g.hitch(this,function(F){this.layerInfosObj=F;this.own(H(this.layerInfosObj,"layerInfosChanged",g.hitch(this,this._onLayerInfosChanged)));this.updateWhenLayerInfosIsShowInMapChanged&&
this.own(H(this.layerInfosObj,"layerInfosIsShowInMapChanged",g.hitch(this,this._onLayerInfosIsShowInMapChanged)));this._buildTree(this.layerInfosObj)}))},_onLayerInfosChanged:function(w,F){this._buildTree(this.layerInfosObj);this.emit("update")},_onLayerInfosIsShowInMapChanged:function(w){this._buildTree(this.layerInfosObj);this.emit("update")},_buildTree:function(w){this._clear();e.setStyle(this.errorTipSection,"display","block");var F=[];this.onlyShowWebMapLayers?(F=w.getLayerInfoArrayOfWebmap(),
F=F.concat(w.getTableInfoArrayOfWebmap())):(F=w.getLayerInfoArray(),F=F.concat(w.getTableInfoArray()));0!==F.length&&(e.setStyle(this.errorTipSection,"display","none"),l.forEach(F,g.hitch(this,function(y){this._addDirectLayerInfo(y)})))},_addDirectLayerInfo:function(w){w&&w.getLayerObject().then(g.hitch(this,function(){this._addItem("root",w)}),g.hitch(this,function(F){console.error(F)}))},_clear:function(){var w=this._store.query({parent:"root"});l.forEach(w,g.hitch(this,function(F){F&&"root"!==
F.id&&this._store.remove(F.id)}))},_addItem:function(w,F){var y=null,D=F.getLayerType(),B=this.filter(F);h({layerType:D,valid:B}).then(g.hitch(this,function(x){if(x.valid){var r=g.hitch(this,function(L,P){this._id++;y={name:F.title||"",parent:w,layerInfo:F,type:x.layerType,layerClass:F.layerObject.declaredClass,id:this._id.toString(),isLeaf:L,hasChildren:P};this._store.add(y)}),t=F.getSubLayers(),C=0===t.length,J=!0;this.onlyFilterCurrentLayerWhenAddItem?(C&&(J=!1),r(C,J)):C?r(C,!1):(t=l.map(t,g.hitch(this,
function(L){return this.filter(L)})),h(t).then(g.hitch(this,function(L){(L=l.some(L,function(P){return P}))&&r(C,L)})))}}))},_getRootItem:function(){return{id:"root",name:"Map Root",type:"root",isLeaf:!1,hasChildren:!0}},_createTree:function(){var w=this._getRootItem();w=new c({data:[w],getChildren:function(F){return this.query({parent:F.id})}});this._store=new b(w);w=new k({store:this._store,query:{id:"root"},mayHaveChildren:g.hitch(this,this._mayHaveChildren)});this.tree=new v({multiple:this.multiple,
model:w,showRoot:!1,isLeafItem:g.hitch(this,this._isLeafItem),style:{width:"100%"},onOpen:g.hitch(this,function(F,y){"root"!==F.id&&this._onTreeOpen(F,y)}),onClick:g.hitch(this,function(F,y,D){this._onTreeClick(F,y,D);this.emit("tree-click",F,y,D)}),getIconStyle:g.hitch(this,function(F,y){var D=null;if(!F||"root"===F.id)return null;var B={width:"20px",height:"20px",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundImage:""},x=window.location.protocol+"//"+window.location.host+
require.toUrl("jimu");if(F=this._getIconInfo(F,y).imageName)B.backgroundImage="url("+x+"/css/images/"+F+")",D=B;return D}),getIconClass:g.hitch(this,function(F,y){return this._getIconInfo(F,y).className}),getTooltip:g.hitch(this,function(F){return this.displayTooltipForTreeNode?F.layerInfo.title:""})});e.addClass(this.tree.domNode,this._treeClass);this.tree.placeAt(this.shelter.domNode,"before")},_mayHaveChildren:function(w){return w.hasChildren},_getIconInfo:function(w,F){var y="",D="";"ArcGISDynamicMapServiceLayer"===
w.type||"ArcGISTiledMapServiceLayer"===w.type?F?(y="mapserver_open.png",D="mapservice-layer-icon open"):(y="mapserver_close.png",D="mapservice-layer-icon close"):"GroupLayer"===w.type?F?(y="group_layer2.png",D="group-layer-icon open"):(y="group_layer1.png",D="group-layer-icon close"):"FeatureLayer"===w.type?(w=p.getTypeByGeometryType(w.layerInfo.layerObject.geometryType),"point"===w?(y="point_layer1.png",D="point-layer-icon"):"polyline"===w?(y="line_layer1.png",D="line-layer-icon"):"polygon"===w&&
(y="polygon_layer1.png",D="polygon-layer-icon")):"Table"===w.type?(y="table.png",D="table-icon"):"ArcGISImageServiceLayer"===w.type||"ArcGISImageServiceVectorLayer"===w.type?(y="image_layer.png",D="iamge-layer-icon"):F?(y="mapserver_open.png",D="mapservice-layer-icon open"):(y="mapserver_close.png",D="mapservice-layer-icon close");return{imageName:y,className:D}},_onTreeOpen:function(w,F){if("root"!==w.id){var y=[];F=[];y=w.layerInfo.getSubLayers();w.checked||(this.shelter.show(),F=l.map(y,g.hitch(this,
function(D){return D.getLayerObject()})),h(F).then(g.hitch(this,function(){this.domNode&&(l.forEach(y,g.hitch(this,function(D){this._addItem(w.id,D)})),w.checked=!0,this.shelter.hide())}),g.hitch(this,function(D){console.error(D);this.shelter.hide()})))}},_onTreeClick:function(w,F,y){},destroy:function(){this.shelter&&(this.shelter.destroy(),this.shelter=null);this.tree&&this.tree.destroy();this.inherited(arguments)}});E.createFilterByLayerType=function(w){g.isArrayLike(w)||(w=[]);return function(F){var y=
new a;if(0===w.length)y.resolve(!0);else{var D=[];F.traversal(function(B){D.push(B.getLayerType())});h(D).then(function(B){for(var x=0;x<B.length;x++)for(var r=0;r<w.length;r++)if(B[x]===w[r]){y.resolve(!0);return}y.resolve(!1)},function(B){console.error(B);y.reject(B)})}return y}};E.createFeaturelayerFilter=function(w,F,y,D){var B=["point","polyline","polygon"];w&&0<w.length?(w=l.filter(w,function(x){return 0<=B.indexOf(x)}),0===w.length&&(w=B)):w=B;return function(x){var r=x.getLayerType();x=x.getLayerObject();
return h({layerType:r,layerObject:x}).then(function(t){var C=t.layerType;t=t.layerObject;if("ArcGISDynamicMapServiceLayer"===C||"ArcGISTiledMapServiceLayer"===C||"GroupLayer"===C||"FeatureCollection"===C)return!0;if("FeatureLayer"===C){C=p.getTypeByGeometryType(t.geometryType);C=0<=l.indexOf(w,C);var J=E._shouldPassStatisticsCheck(D,t);return t.url?(t=p.isFeaturelayerUrlSupportQuery(t.url,t.capabilities),C&&t&&J):F&&C}return"Table"===C?(C=p.isFeaturelayerUrlSupportQuery(t.url,t.capabilities),t=E._shouldPassStatisticsCheck(D,
t),y&&C&&t):!1})}};E.createImageServiceLayerFilter=function(w,F){return function(y){var D=y.getLayerType();y=y.getLayerObject();return h({layerType:D,layerObject:y}).then(function(B){var x=B.layerType,r=B.layerObject;return"ArcGISImageServiceLayer"===x||"ArcGISImageServiceVectorLayer"===x?w?p.isImageServiceSupportQuery(B.layerObject.capabilities)?F?E._shouldPassStatisticsCheck(F,r):!0:!1:!0:!1})}};E._shouldPassStatisticsCheck=function(w,F){return w?(w=!1,w=F.advancedQueryCapabilities?!!F.advancedQueryCapabilities.supportsStatistics:
!!F.supportsStatistics):!0};E.createQueryableLayerFilter=function(w){var F=E.createFeaturelayerFilter(["point","polyline","polygon"],!1,!0,w);w=E.createImageServiceLayerFilter(!0,w);return E.orCombineFilters([F,w])};E.andCombineFilters=function(w){return E._combineFilters(w,!0)};E.orCombineFilters=function(w){return E._combineFilters(w,!1)};E._combineFilters=function(w,F){return function(y){var D=new a,B=l.map(w,function(x){return x(y)});h(B).then(function(x){var r=!1;r=F?l.every(x,function(t){return t}):
l.some(x,function(t){return t});D.resolve(r)},function(x){console.error(x);D.reject(x)});return D}};return E})},"dijit/tree/ObjectStoreModel":function(){define("dojo/_base/array dojo/aspect dojo/_base/declare dojo/Deferred dojo/_base/lang dojo/when ../Destroyable".split(" "),function(H,d,m,n,q,f,c){return m("dijit.tree.ObjectStoreModel",c,{store:null,labelAttr:"name",labelType:"text",root:null,query:null,constructor:function(a){q.mixin(this,a);this.childrenCache={}},getRoot:function(a,b){if(this.root)a(this.root);
else{var k=this.store.query(this.query);k.then&&this.own(k);f(k,q.hitch(this,function(h){if(1!=h.length)throw Error("dijit.tree.ObjectStoreModel: root query returned "+h.length+" items, but must return exactly one");this.root=h[0];a(this.root);k.observe&&k.observe(q.hitch(this,function(g){this.onChange(g)}),!0)}),b)}},mayHaveChildren:function(){return!0},getChildren:function(a,b,k){var h=this.store.getIdentity(a);if(this.childrenCache[h])f(this.childrenCache[h],b,k);else{var g=this.childrenCache[h]=
this.store.getChildren(a);g.then&&this.own(g);g.observe&&this.own(g.observe(q.hitch(this,function(e,l,p){this.onChange(e);l!=p&&f(g,q.hitch(this,"onChildrenChange",a))}),!0));f(g,b,k)}},isItem:function(){return!0},getIdentity:function(a){return this.store.getIdentity(a)},getLabel:function(a){return a[this.labelAttr]},newItem:function(a,b,k,h){return this.store.put(a,{parent:b,before:h})},pasteItem:function(a,b,k,h,g,e){var l=new n;if(b===k&&!h&&!e)return l.resolve(!0),l;b&&!h?this.getChildren(b,q.hitch(this,
function(p){p=[].concat(p);var v=H.indexOf(p,a);p.splice(v,1);this.onChildrenChange(b,p);l.resolve(this.store.put(a,{overwrite:!0,parent:k,oldParent:b,before:e,isCopy:!1}))})):l.resolve(this.store.put(a,{overwrite:!0,parent:k,oldParent:b,before:e,isCopy:!0}));return l},onChange:function(){},onChildrenChange:function(){},onDelete:function(){}})})},"jimu/dijit/_Tree":function(){define("dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dojo/text!./templates/_TreeNode.html dojo/_base/lang dojo/_base/html dojo/_base/array dojo/_base/event dojo/query dojo/aspect dojo/on dojo/keys dojo/Evented dijit/registry dijit/Tree jimu/utils".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v){var z=H([p._TreeNode,e],{templateString:n,declaredClass:"jimu._TreeNode",isLeaf:!1,groupId:"",postCreate:function(){this.inherited(arguments);f.addClass(this.domNode,"jimu-tree-node");this.isLeaf=!!this.isLeaf;this.groupId?(this.checkNode=f.toDom('\x3cinput type\x3d"radio" /\x3e'),this.checkNode.name=this.groupId):this.checkNode=f.toDom('\x3cinput type\x3d"checkbox" /\x3e');f.addClass(this.checkNode,"jimu-tree-check-node");f.place(this.checkNode,this.contentNode,
"first");this.own(h(this.checkNode,"click",q.hitch(this,this._onClick)));this.own(h(this.rowNode,"keydown",q.hitch(this,function(u,E){E.target=u;E.keyCode!==g.ENTER&&E.keyCode!==g.SPACE||this._onClick(E)},this.checkNode)));this.isLeaf?this.groupId?f.setStyle(this.checkNode,"display","none"):f.setStyle(this.checkNode,"display","inline"):f.setStyle(this.checkNode,"display","none");this.isLeaf?f.addClass(this.domNode,"jimu-tree-leaf-node"):f.addClass(this.domNode,"jimu-tree-not-leaf-node")},select:function(){this.isLeaf&&
(this.checkNode.checked=!0,f.addClass(this.domNode,"jimu-tree-selected-leaf-node"))},unselect:function(){this.isLeaf&&(this.checkNode.checked=!1,f.removeClass(this.domNode,"jimu-tree-selected-leaf-node"))},toggleSelect:function(){this.isLeaf&&(this.checkNode.checked?this.unselect():this.select())},_onClick:function(u){(u.target||u.srcElement)===this.checkNode?this.tree._onCheckNodeClick(this,this.checkNode.checked,u):this.tree._onClick(this,u)},_onChange:function(){this.isLeaf&&setTimeout(q.hitch(this,
function(){this.checkNode.checked?this.emit("tn-select",this):this.emit("tn-unselect",this)}),100)},destroy:function(){delete this.tree;this.inherited(arguments)}});return H([p,e],{declaredClass:"jimu._Tree",openOnClick:!0,multiple:!0,uniqueId:"",showRoot:!1,postMixInProperties:function(){this.inherited(arguments);this.uniqueId="tree_"+v.getRandomString()},postCreate:function(){this.inherited(arguments);f.addClass(this.domNode,"jimu-tree");this.own(k.before(this,"onClick",q.hitch(this,this._jimuBeforeClick)));
this.rootLoadingIndicator&&f.setStyle(this.rootLoadingIndicator,"display","none");this.dndController.singular=!0;f.setAttr(this.domNode,"tabindex",0)},removeItem:function(u){this.model.store.remove(u)},getAllItems:function(){var u=this.getAllTreeNodeWidgets();return c.map(u,q.hitch(this,function(E){var w=E.item;w.selected=E.checkNode.checked;return w}))},getSelectedItems:function(){var u=this.getAllTreeNodeWidgets();u=c.filter(u,q.hitch(this,function(E){return E.checkNode.checked}));return c.map(u,
q.hitch(this,function(E){return E.item}))},getFilteredItems:function(u){var E=this.getAllTreeNodeWidgets();E=c.map(E,q.hitch(this,function(w){var F=w.item;F.selected=w.checkNode.checked;return F}));return c.filter(E,q.hitch(this,function(w){return u(w)}))},getTreeNodeByItemId:function(u){for(var E=this._getAllTreeNodeDoms(),w=0;w<E.length;w++){var F=l.byNode(E[w]);if(F.item.id.toString()===u.toString())return F}return null},selectItem:function(u){(u=this.getTreeNodeByItemId(u))&&u.isLeaf&&this.selectNodeWidget(u)},
unselectItem:function(u){(u=this.getTreeNodeByItemId(u))&&u.isLeaf&&u.unselect()},getAllLeafTreeNodeWidgets:function(){var u=this.getAllTreeNodeWidgets();return c.filter(u,q.hitch(this,function(E){return E.isLeaf}))},getAllTreeNodeWidgets:function(){var u=this._getAllTreeNodeDoms();return c.map(u,q.hitch(this,function(E){return l.byNode(E)}))},isLeafItem:function(u){return u&&u.isLeaf},_getAllTreeNodeDoms:function(){return b(".dijitTreeNode",this.domNode)},_createTreeNode:function(u){u.isLeaf=this.isLeafItem(u.item);
this.multiple||(u.groupId=this.uniqueId);return new z(u)},_onTreeNodeSelect:function(u){this.emit("item-select",{item:u.item,treeNode:u})},_onTreeNodeUnselect:function(u){this.emit("item-unselect",{item:u.item,treeNode:u})},selectNodeWidget:function(u){this.multiple||this.unselectAllLeafNodeWidgets();u.select()},_jimuBeforeClick:function(u,E,w){E.isLeaf&&(f.hasClass(w.target||w.srcElement,"jimu-tree-check-node")||(this.multiple?E.toggleSelect():this.selectNodeWidget(E)));return arguments},_onCheckNodeClick:function(u,
E,w){!this.multiple&&E&&this.unselectAllLeafNodeWidgets();a.stop(w);this.focusNode(u);setTimeout(q.hitch(this,function(){E?this.selectNodeWidget(u):u.unselect();this.onClick(u.item,u,w)}),0)},unselectAllLeafNodeWidgets:function(){var u=this.getAllLeafTreeNodeWidgets();c.forEach(u,q.hitch(this,function(E){E.unselect()}))}})})},"dijit/Tree":function(){define("dojo/_base/array dojo/aspect dojo/cookie dojo/_base/declare dojo/Deferred dojo/promise/all dojo/dom dojo/dom-class dojo/dom-geometry dojo/dom-style dojo/errors/create dojo/fx dojo/has dojo/_base/kernel dojo/keys dojo/_base/lang dojo/on dojo/topic dojo/touch dojo/when ./a11yclick ./focus ./registry ./_base/manager ./_Widget ./_TemplatedMixin ./_Container ./_Contained ./_CssStateMixin ./_KeyNavMixin dojo/text!./templates/TreeNode.html dojo/text!./templates/Tree.html ./tree/TreeStoreModel ./tree/ForestStoreModel ./tree/_dndSelector dojo/query!css2".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F,y,D,B,x,r,t,C,J,L,P,U,aa,ea,ba){function oa(S){return v.delegate(S.promise||S,{addCallback:function(W){this.then(W)},addErrback:function(W){this.otherwise(W)}})}var da=n("dijit._TreeNode",[x,r,t,C,J],{item:null,isTreeNode:!0,label:"",_setLabelAttr:function(S){this.labelNode["html"==this.labelType?"innerHTML":"innerText"in this.labelNode?"innerText":"textContent"]=S;this._set("label",S);e("dojo-bidi")&&this.applyTextDir(this.labelNode)},labelType:"text",
isExpandable:null,isExpanded:!1,state:"NotLoaded",templateString:P,baseClass:"dijitTreeNode",cssStateNodes:{rowNode:"dijitTreeRow"},_setTooltipAttr:{node:"rowNode",type:"attribute",attribute:"title"},buildRendering:function(){this.inherited(arguments);this._setExpando();this._updateItemClasses(this.item);this.isExpandable&&this.labelNode.setAttribute("aria-expanded",this.isExpanded);this.setSelected(!1)},_setIndentAttr:function(S){var W=Math.max(S,0)*this.tree._nodePixelIndent+"px";k.set(this.domNode,
"backgroundPosition",W+" 0px");k.set(this.rowNode,this.isLeftToRight()?"paddingLeft":"paddingRight",W);H.forEach(this.getChildren(),function(la){la.set("indent",S+1)});this._set("indent",S)},markProcessing:function(){this.state="Loading";this._setExpando(!0)},unmarkProcessing:function(){this._setExpando(!1)},_updateItemClasses:function(S){var W=this.tree,la=W.model;W._v10Compat&&S===la.root&&(S=null);this._applyClassAndStyle(S,"icon","Icon");this._applyClassAndStyle(S,"label","Label");this._applyClassAndStyle(S,
"row","Row");this.tree._startPaint(!0)},_applyClassAndStyle:function(S,W,la){var K="_"+W+"Class";W+="Node";var O=this[K];this[K]=this.tree["get"+la+"Class"](S,this.isExpanded);a.replace(this[W],this[K]||"",O||"");k.set(this[W],this.tree["get"+la+"Style"](S,this.isExpanded)||{})},_updateLayout:function(){var S=this.getParent();S=!S||!S.rowNode||"none"==S.rowNode.style.display;a.toggle(this.domNode,"dijitTreeIsRoot",S);a.toggle(this.domNode,"dijitTreeIsLast",!S&&!this.getNextSibling())},_setExpando:function(S){var W=
["dijitTreeExpandoLoading","dijitTreeExpandoOpened","dijitTreeExpandoClosed","dijitTreeExpandoLeaf"];S=S?0:this.isExpandable?this.isExpanded?1:2:3;a.replace(this.expandoNode,W[S],W);this.expandoNodeText.innerHTML=["*","-","+","*"][S]},expand:function(){if(this._expandDeferred)return oa(this._expandDeferred);this._collapseDeferred&&(this._collapseDeferred.cancel(),delete this._collapseDeferred);this.isExpanded=!0;this.labelNode.setAttribute("aria-expanded","true");(this.tree.showRoot||this!==this.tree.rootNode)&&
this.containerNode.setAttribute("role","group");a.add(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);this==this.tree.rootNode&&this.tree.showRoot&&this.tree.domNode.setAttribute("aria-expanded","true");var S=g.wipeIn({node:this.containerNode,duration:B.defaultDuration}),W=this._expandDeferred=new q(function(){S.stop()});d.after(S,"onEnd",function(){W.resolve(!0)},!0);S.play();return oa(W)},collapse:function(){if(this._collapseDeferred)return oa(this._collapseDeferred);
this._expandDeferred&&(this._expandDeferred.cancel(),delete this._expandDeferred);this.isExpanded=!1;this.labelNode.setAttribute("aria-expanded","false");this==this.tree.rootNode&&this.tree.showRoot&&this.tree.domNode.setAttribute("aria-expanded","false");a.remove(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);var S=g.wipeOut({node:this.containerNode,duration:B.defaultDuration}),W=this._collapseDeferred=new q(function(){S.stop()});d.after(S,"onEnd",
function(){W.resolve(!0)},!0);S.play();return oa(W)},indent:0,setChildItems:function(S){var W=this.tree,la=W.model,K=[],O=W.focusedChild,G=this.getChildren();H.forEach(G,function(M){t.prototype.removeChild.call(this,M)},this);this.defer(function(){H.forEach(G,function(M){if(!M._destroyed&&!M.getParent()){W.dndController.removeTreeNode(M);(function ja(ka){var R=la.getIdentity(ka.item),ha=W._itemNodesMap[R];1==ha.length?delete W._itemNodesMap[R]:(R=H.indexOf(ha,ka),-1!=R&&ha.splice(R,1));H.forEach(ka.getChildren(),
ja)})(M);if(W.persist){var N=H.map(M.getTreePath(),function(ka){return W.model.getIdentity(ka)}).join("/"),V;for(V in W._openedNodes)V.substr(0,N.length)==N&&delete W._openedNodes[V];W._saveExpandedNodes()}W.lastFocusedChild&&!c.isDescendant(W.lastFocusedChild.domNode,W.domNode)&&delete W.lastFocusedChild;O&&!c.isDescendant(O.domNode,W.domNode)&&W.focus();M.destroyRecursive()}})});this.state="Loaded";S&&0<S.length?(this.isExpandable=!0,H.forEach(S,function(M){var N=la.getIdentity(M),V=W._itemNodesMap[N];
if(V)for(var Y=0;Y<V.length;Y++)if(V[Y]&&!V[Y].getParent()){var ka=V[Y];ka.set("indent",this.indent+1);break}ka||(ka=this.tree._createTreeNode({item:M,tree:W,isExpandable:la.mayHaveChildren(M),label:W.getLabel(M),labelType:W.model&&W.model.labelType||"text",tooltip:W.getTooltip(M),ownerDocument:W.ownerDocument,dir:W.dir,lang:W.lang,textDir:W.textDir,indent:this.indent+1}),V?V.push(ka):W._itemNodesMap[N]=[ka]);this.addChild(ka);(this.tree.autoExpand||this.tree._state(ka))&&K.push(W._expandNode(ka))},
this),H.forEach(this.getChildren(),function(M){M._updateLayout()})):this.isExpandable=!1;this._setExpando&&this._setExpando(!1);this._updateItemClasses(this.item);S=f(K);this.tree._startPaint(S);return oa(S)},getTreePath:function(){for(var S=this,W=[];S&&S!==this.tree.rootNode;)W.unshift(S.item),S=S.getParent();W.unshift(this.tree.rootNode.item);return W},getIdentity:function(){return this.tree.model.getIdentity(this.item)},removeChild:function(S){this.inherited(arguments);var W=this.getChildren();
0==W.length&&(this.isExpandable=!1,this.collapse());H.forEach(W,function(la){la._updateLayout()})},makeExpandable:function(){this.isExpandable=!0;this._setExpando(!1)},setSelected:function(S){this.labelNode.setAttribute("aria-selected",S?"true":"false");a.toggle(this.rowNode,"dijitTreeRowSelected",S)},focus:function(){y.focus(this.focusNode)}});e("dojo-bidi")&&da.extend({_setTextDirAttr:function(S){!S||this.textDir==S&&this._created||(this._set("textDir",S),this.applyTextDir(this.labelNode),H.forEach(this.getChildren(),
function(W){W.set("textDir",S)},this))}});var fa=n("dijit.Tree",[x,L,r,J],{baseClass:"dijitTree",store:null,model:null,query:null,label:"",showRoot:!0,childrenAttr:["children"],paths:[],path:[],selectedItems:null,selectedItem:null,openOnClick:!1,openOnDblClick:!1,templateString:U,persist:!1,autoExpand:!1,dndController:ba,dndParams:"onDndDrop itemCreator onDndCancel checkAcceptance checkItemAcceptance dragThreshold betweenThreshold".split(" "),onDndDrop:null,itemCreator:null,onDndCancel:null,checkAcceptance:null,
checkItemAcceptance:null,dragThreshold:5,betweenThreshold:0,_nodePixelIndent:19,_publish:function(S,W){u.publish(this.id,v.mixin({tree:this,event:S},W||{}))},postMixInProperties:function(){this.tree=this;this.autoExpand&&(this.persist=!1);this._itemNodesMap={};!this.cookieName&&this.id&&(this.cookieName=this.id+"SaveStateCookie");this.expandChildrenDeferred=new q;this.pendingCommandsPromise=this.expandChildrenDeferred.promise;this.inherited(arguments)},postCreate:function(){this._initState();var S=
this;this.own(z(this.containerNode,z.selector(".dijitTreeNode",E.enter),function(K){S._onNodeMouseEnter(D.byNode(this),K)}),z(this.containerNode,z.selector(".dijitTreeNode",E.leave),function(K){S._onNodeMouseLeave(D.byNode(this),K)}),z(this.containerNode,z.selector(".dijitTreeRow",F.press),function(K){S._onNodePress(D.getEnclosingWidget(this),K)}),z(this.containerNode,z.selector(".dijitTreeRow",F),function(K){S._onClick(D.getEnclosingWidget(this),K)}),z(this.containerNode,z.selector(".dijitTreeRow",
"dblclick"),function(K){S._onDblClick(D.getEnclosingWidget(this),K)}));this.model||this._store2model();this.own(d.after(this.model,"onChange",v.hitch(this,"_onItemChange"),!0),d.after(this.model,"onChildrenChange",v.hitch(this,"_onItemChildrenChange"),!0),d.after(this.model,"onDelete",v.hitch(this,"_onItemDelete"),!0));this.inherited(arguments);if(this.dndController){v.isString(this.dndController)&&(this.dndController=v.getObject(this.dndController));for(var W={},la=0;la<this.dndParams.length;la++)this[this.dndParams[la]]&&
(W[this.dndParams[la]]=this[this.dndParams[la]]);this.dndController=new this.dndController(this,W)}this._load();this.onLoadDeferred=oa(this.pendingCommandsPromise);this.onLoadDeferred.then(v.hitch(this,"onLoad"))},_store2model:function(){this._v10Compat=!0;l.deprecated("Tree: from version 2.0, should specify a model object rather than a store/query");var S={id:this.id+"_ForestStoreModel",store:this.store,query:this.query,childrenAttrs:this.childrenAttr};this.params.mayHaveChildren&&(S.mayHaveChildren=
v.hitch(this,"mayHaveChildren"));this.params.getItemChildren&&(S.getChildren=v.hitch(this,function(W,la,K){this.getItemChildren(this._v10Compat&&W===this.model.root?null:W,la,K)}));this.model=new ea(S);this.showRoot=!!this.label},onLoad:function(){},_load:function(){this.model.getRoot(v.hitch(this,function(S){var W=this.rootNode=this.tree._createTreeNode({item:S,tree:this,isExpandable:!0,label:this.label||this.getLabel(S),labelType:this.model.labelType||"text",textDir:this.textDir,indent:this.showRoot?
0:-1});this.showRoot?(this.domNode.setAttribute("aria-multiselectable",!this.dndController.singular),this.rootLoadingIndicator.style.display="none"):(W.rowNode.style.display="none",this.domNode.setAttribute("role","presentation"),this.domNode.removeAttribute("aria-expanded"),this.domNode.removeAttribute("aria-multiselectable"),this["aria-label"]?(W.containerNode.setAttribute("aria-label",this["aria-label"]),this.domNode.removeAttribute("aria-label")):this["aria-labelledby"]&&(W.containerNode.setAttribute("aria-labelledby",
this["aria-labelledby"]),this.domNode.removeAttribute("aria-labelledby")),W.labelNode.setAttribute("role","presentation"),W.labelNode.removeAttribute("aria-selected"),W.containerNode.setAttribute("role","tree"),W.containerNode.setAttribute("aria-expanded","true"),W.containerNode.setAttribute("aria-multiselectable",!this.dndController.singular));this.containerNode.appendChild(W.domNode);S=this.model.getIdentity(S);this._itemNodesMap[S]?this._itemNodesMap[S].push(W):this._itemNodesMap[S]=[W];W._updateLayout();
this._expandNode(W).then(v.hitch(this,function(){this._destroyed||(this.rootLoadingIndicator.style.display="none",this.expandChildrenDeferred.resolve(!0))}))}),v.hitch(this,function(S){console.error(this,": error loading root: ",S)}))},getNodesByItem:function(S){if(!S)return[];S=v.isString(S)?S:this.model.getIdentity(S);return[].concat(this._itemNodesMap[S])},_setSelectedItemAttr:function(S){this.set("selectedItems",[S])},_setSelectedItemsAttr:function(S){var W=this;return this.pendingCommandsPromise=
this.pendingCommandsPromise.always(v.hitch(this,function(){var la=H.map(S,function(O){return!O||v.isString(O)?O:W.model.getIdentity(O)}),K=[];H.forEach(la,function(O){K=K.concat(W._itemNodesMap[O]||[])});this.set("selectedNodes",K)}))},_setPathAttr:function(S){return S.length?oa(this.set("paths",[S]).then(function(W){return W[0]})):oa(this.set("paths",[]).then(function(W){return W[0]}))},_setPathsAttr:function(S){function W(K,O){var G=K.shift(),M=H.filter(O,function(N){return N.getIdentity()==G})[0];
if(M)return K.length?la._expandNode(M).then(function(){return W(K,M.getChildren())}):M;throw new fa.PathError("Could not expand path at "+G);}var la=this;return oa(this.pendingCommandsPromise=this.pendingCommandsPromise.always(function(){return f(H.map(S,function(K){K=H.map(K,function(O){return O&&v.isObject(O)?la.model.getIdentity(O):O});if(K.length)return W(K,[la.rootNode]);throw new fa.PathError("Empty path");}))}).then(function(K){la.set("selectedNodes",K);return la.paths}))},_setSelectedNodeAttr:function(S){this.set("selectedNodes",
[S])},_setSelectedNodesAttr:function(S){this.dndController.setSelection(S)},expandAll:function(){function S(la){return W._expandNode(la).then(function(){var K=H.filter(la.getChildren()||[],function(O){return O.isExpandable});return f(H.map(K,S))})}var W=this;return oa(S(this.rootNode))},collapseAll:function(){function S(la){var K=H.filter(la.getChildren()||[],function(O){return O.isExpandable});K=f(H.map(K,S));return!la.isExpanded||la==W.rootNode&&!W.showRoot?K:K.then(function(){return W._collapseNode(la)})}
var W=this;return oa(S(this.rootNode))},mayHaveChildren:function(){},getItemChildren:function(){},getLabel:function(S){return this.model.getLabel(S)},getIconClass:function(S,W){return!S||this.model.mayHaveChildren(S)?W?"dijitFolderOpened":"dijitFolderClosed":"dijitLeaf"},getLabelClass:function(){},getRowClass:function(){},getIconStyle:function(){},getLabelStyle:function(){},getRowStyle:function(){},getTooltip:function(){return""},_onDownArrow:function(S,W){(S=this._getNext(W))&&S.isTreeNode&&this.focusNode(S)},
_onUpArrow:function(S,W){if(S=W.getPreviousSibling())for(W=S;W.isExpandable&&W.isExpanded&&W.hasChildren();)W=W.getChildren(),W=W[W.length-1];else if(S=W.getParent(),this.showRoot||S!==this.rootNode)W=S;W&&W.isTreeNode&&this.focusNode(W)},_onRightArrow:function(S,W){W.isExpandable&&!W.isExpanded?this._expandNode(W):W.hasChildren()&&(W=W.getChildren()[0])&&W.isTreeNode&&this.focusNode(W)},_onLeftArrow:function(S,W){W.isExpandable&&W.isExpanded?this._collapseNode(W):(S=W.getParent())&&S.isTreeNode&&
(this.showRoot||S!==this.rootNode)&&this.focusNode(S)},focusLastChild:function(){var S=this._getLast();S&&S.isTreeNode&&this.focusNode(S)},_getFirst:function(){return this.showRoot?this.rootNode:this.rootNode.getChildren()[0]},_getLast:function(){for(var S=this.rootNode;S.isExpanded;){var W=S.getChildren();if(!W.length)break;S=W[W.length-1]}return S},_getNext:function(S){if(S.isExpandable&&S.isExpanded&&S.hasChildren())return S.getChildren()[0];for(;S&&S.isTreeNode;){var W=S.getNextSibling();if(W)return W;
S=S.getParent()}return null},childSelector:".dijitTreeRow",isExpandoNode:function(S,W){return c.isDescendant(S,W.expandoNode)||c.isDescendant(S,W.expandoNodeText)},_onNodePress:function(S,W){this.focusNode(S)},__click:function(S,W,la,K){var O=this.isExpandoNode(W.target,S);S.isExpandable&&(la||O)?this._onExpandoClick({node:S}):(this._publish("execute",{item:S.item,node:S,evt:W}),this[K](S.item,S,W),this.focusNode(S));W.stopPropagation();W.preventDefault()},_onClick:function(S,W){this.__click(S,W,
this.openOnClick,"onClick")},_onDblClick:function(S,W){this.__click(S,W,this.openOnDblClick,"onDblClick")},_onExpandoClick:function(S){S=S.node;this.focusNode(S);S.isExpanded?this._collapseNode(S):this._expandNode(S)},onClick:function(){},onDblClick:function(){},onOpen:function(){},onClose:function(){},_getNextNode:function(S){l.deprecated(this.declaredClass+"::_getNextNode(node) is deprecated. Use _getNext(node) instead.","","2.0");return this._getNext(S)},_getRootOrFirstNode:function(){l.deprecated(this.declaredClass+
"::_getRootOrFirstNode() is deprecated. Use _getFirst() instead.","","2.0");return this._getFirst()},_collapseNode:function(S){S._expandNodeDeferred&&delete S._expandNodeDeferred;if("Loading"!=S.state&&S.isExpanded){var W=S.collapse();this.onClose(S.item,S);this._state(S,!1);this._startPaint(W);return W}},_expandNode:function(S){if(S._expandNodeDeferred)return S._expandNodeDeferred;var W=this.model,la=S.item,K=this;S._loadDeferred||(S.markProcessing(),S._loadDeferred=new q,W.getChildren(la,function(O){S.unmarkProcessing();
S.setChildItems(O).then(function(){S._loadDeferred.resolve(O)})},function(O){console.error(K,": error loading "+S.label+" children: ",O);S._loadDeferred.reject(O)}));W=S._loadDeferred.then(v.hitch(this,function(){var O=S.expand();this.onOpen(S.item,S);this._state(S,!0);return O}));this._startPaint(W);return W},focusNode:function(S){for(var W=[],la=this.domNode;la&&la.tagName&&"IFRAME"!==la.tagName.toUpperCase();la=la.parentNode)W.push({domNode:la.contentWindow||la,scrollLeft:la.scrollLeft||0,scrollTop:la.scrollTop||
0});this.focusChild(S);this.defer(function(){for(var K=0,O=W.length;K<O;K++)W[K].domNode.scrollLeft=W[K].scrollLeft,W[K].domNode.scrollTop=W[K].scrollTop},0)},_onNodeMouseEnter:function(){},_onNodeMouseLeave:function(){},_onItemChange:function(S){var W=this.model.getIdentity(S);if(W=this._itemNodesMap[W]){var la=this.getLabel(S),K=this.getTooltip(S);H.forEach(W,function(O){O.set({item:S,label:la,tooltip:K});O._updateItemClasses(S)})}},_onItemChildrenChange:function(S,W){S=this.model.getIdentity(S);
(S=this._itemNodesMap[S])&&H.forEach(S,function(la){la.setChildItems(W)})},_onItemDelete:function(S){S=this.model.getIdentity(S);var W=this._itemNodesMap[S];W&&(H.forEach(W,function(la){this.dndController.removeTreeNode(la);var K=la.getParent();K&&K.removeChild(la);this.lastFocusedChild&&!c.isDescendant(this.lastFocusedChild.domNode,this.domNode)&&delete this.lastFocusedChild;this.focusedChild&&!c.isDescendant(this.focusedChild.domNode,this.domNode)&&this.focus();la.destroyRecursive()},this),delete this._itemNodesMap[S])},
_initState:function(){this._openedNodes={};if(this.persist&&this.cookieName){var S=m(this.cookieName);S&&H.forEach(S.split(","),function(W){this._openedNodes[W]=!0},this)}},_state:function(S,W){if(!this.persist)return!1;var la=H.map(S.getTreePath(),function(K){return this.model.getIdentity(K)},this).join("/");if(1===arguments.length)return this._openedNodes[la];W?this._openedNodes[la]=!0:delete this._openedNodes[la];this._saveExpandedNodes()},_saveExpandedNodes:function(){if(this.persist&&this.cookieName){var S=
[],W;for(W in this._openedNodes)S.push(W);m(this.cookieName,S.join(","),{expires:365})}},destroy:function(){this._curSearch&&(this._curSearch.timer.remove(),delete this._curSearch);this.rootNode&&this.rootNode.destroyRecursive();this.dndController&&!v.isString(this.dndController)&&this.dndController.destroy();this.rootNode=null;this.inherited(arguments)},destroyRecursive:function(){this.destroy()},resize:function(S){S&&b.setMarginBox(this.domNode,S);this._nodePixelIndent=b.position(this.tree.indentDetector).w||
this._nodePixelIndent;this.expandChildrenDeferred.then(v.hitch(this,function(){this.rootNode.set("indent",this.showRoot?0:-1);this._adjustWidths()}))},_outstandingPaintOperations:0,_startPaint:function(S){this._outstandingPaintOperations++;this._adjustWidthsTimer&&(this._adjustWidthsTimer.remove(),delete this._adjustWidthsTimer);var W=v.hitch(this,function(){this._outstandingPaintOperations--;0>=this._outstandingPaintOperations&&!this._adjustWidthsTimer&&this._started&&(this._adjustWidthsTimer=this.defer("_adjustWidths"))});
w(S,W,W)},_adjustWidths:function(){this._adjustWidthsTimer&&(this._adjustWidthsTimer.remove(),delete this._adjustWidthsTimer);this.containerNode.style.width="auto";this.containerNode.style.width=this.domNode.scrollWidth>this.domNode.offsetWidth?"auto":"100%"},_createTreeNode:function(S){return new da(S)},focus:function(){this.lastFocusedChild?this.focusNode(this.lastFocusedChild):this.focusFirstChild()}});e("dojo-bidi")&&fa.extend({_setTextDirAttr:function(S){S&&this.textDir!=S&&(this._set("textDir",
S),this.rootNode.set("textDir",S))}});fa.PathError=h("TreePathError");fa._TreeNode=da;return fa})},"dijit/tree/TreeStoreModel":function(){define(["dojo/_base/array","dojo/aspect","dojo/_base/declare","dojo/_base/lang"],function(H,d,m,n){return m("dijit.tree.TreeStoreModel",null,{store:null,childrenAttrs:["children"],newItemIdAttr:"id",labelAttr:"",root:null,query:null,deferItemLoadingUntilExpand:!1,constructor:function(q){n.mixin(this,q);this.connects=[];q=this.store;if(!q.getFeatures()["dojo.data.api.Identity"])throw Error("dijit.tree.TreeStoreModel: store must support dojo.data.Identity");
q.getFeatures()["dojo.data.api.Notification"]&&(this.connects=this.connects.concat([d.after(q,"onNew",n.hitch(this,"onNewItem"),!0),d.after(q,"onDelete",n.hitch(this,"onDeleteItem"),!0),d.after(q,"onSet",n.hitch(this,"onSetItem"),!0)]))},destroy:function(){for(var q;q=this.connects.pop();)q.remove()},getRoot:function(q,f){this.root?q(this.root):this.store.fetch({query:this.query,onComplete:n.hitch(this,function(c){if(1!=c.length)throw Error("dijit.tree.TreeStoreModel: root query returned "+c.length+
" items, but must return exactly one");this.root=c[0];q(this.root)}),onError:f})},mayHaveChildren:function(q){return H.some(this.childrenAttrs,function(f){return this.store.hasAttribute(q,f)},this)},getChildren:function(q,f,c){var a=this.store;if(a.isItemLoaded(q)){for(var b=[],k=0;k<this.childrenAttrs.length;k++){var h=a.getValues(q,this.childrenAttrs[k]);b=b.concat(h)}var g=0;this.deferItemLoadingUntilExpand||H.forEach(b,function(l){a.isItemLoaded(l)||g++});0==g?f(b):H.forEach(b,function(l,p){a.isItemLoaded(l)||
a.loadItem({item:l,onItem:function(v){b[p]=v;0==--g&&f(b)},onError:c})})}else{var e=n.hitch(this,arguments.callee);a.loadItem({item:q,onItem:function(l){e(l,f,c)},onError:c})}},isItem:function(q){return this.store.isItem(q)},fetchItemByIdentity:function(q){this.store.fetchItemByIdentity(q)},getIdentity:function(q){return this.store.getIdentity(q)},getLabel:function(q){return this.labelAttr?this.store.getValue(q,this.labelAttr):this.store.getLabel(q)},newItem:function(q,f,c){var a={parent:f,attribute:this.childrenAttrs[0]},
b;this.newItemIdAttr&&q[this.newItemIdAttr]?this.fetchItemByIdentity({identity:q[this.newItemIdAttr],scope:this,onItem:function(k){k?this.pasteItem(k,null,f,!0,c):(b=this.store.newItem(q,a))&&void 0!=c&&this.pasteItem(b,f,f,!1,c)}}):(b=this.store.newItem(q,a))&&void 0!=c&&this.pasteItem(b,f,f,!1,c)},pasteItem:function(q,f,c,a,b){var k=this.store,h=this.childrenAttrs[0];f&&H.forEach(this.childrenAttrs,function(e){if(k.containsValue(f,e,q)){if(!a){var l=H.filter(k.getValues(f,e),function(p){return p!=
q});k.setValues(f,e,l)}h=e}});if(c)if("number"==typeof b){var g=k.getValues(c,h).slice();g.splice(b,0,q);k.setValues(c,h,g)}else k.setValues(c,h,k.getValues(c,h).concat(q))},onChange:function(){},onChildrenChange:function(){},onDelete:function(){},onNewItem:function(q,f){f&&this.getChildren(f.item,n.hitch(this,function(c){this.onChildrenChange(f.item,c)}))},onDeleteItem:function(q){this.onDelete(q)},onSetItem:function(q,f){if(-1!=H.indexOf(this.childrenAttrs,f))this.getChildren(q,n.hitch(this,function(c){this.onChildrenChange(q,
c)}));else this.onChange(q)}})})},"dijit/tree/ForestStoreModel":function(){define(["dojo/_base/array","dojo/_base/declare","dojo/_base/kernel","dojo/_base/lang","./TreeStoreModel"],function(H,d,m,n,q){return d("dijit.tree.ForestStoreModel",q,{rootId:"$root$",rootLabel:"ROOT",query:null,constructor:function(f){this.root={store:this,root:!0,id:f.rootId,label:f.rootLabel,children:f.rootChildren}},mayHaveChildren:function(f){return f===this.root||this.inherited(arguments)},getChildren:function(f,c,a){f===
this.root?this.root.children?c(this.root.children):this.store.fetch({query:this.query,onComplete:n.hitch(this,function(b){this.root.children=b;c(b)}),onError:a}):this.inherited(arguments)},isItem:function(f){return f===this.root?!0:this.inherited(arguments)},fetchItemByIdentity:function(f){if(f.identity==this.root.id){var c=f.scope||m.global;f.onItem&&f.onItem.call(c,this.root)}else this.inherited(arguments)},getIdentity:function(f){return f===this.root?this.root.id:this.inherited(arguments)},getLabel:function(f){return f===
this.root?this.root.label:this.inherited(arguments)},newItem:function(f,c,a){return c===this.root?(this.onNewRootItem(f),this.store.newItem(f)):this.inherited(arguments)},onNewRootItem:function(){},pasteItem:function(f,c,a,b,k){if(c===this.root&&!b)this.onLeaveRoot(f);this.inherited(arguments,[f,c===this.root?null:c,a===this.root?null:a,b,k]);if(a===this.root)this.onAddToRoot(f)},onAddToRoot:function(f){console.log(this,": item ",f," added to root")},onLeaveRoot:function(f){console.log(this,": item ",
f," removed from root")},_requeryTop:function(){var f=this.root.children||[];this.store.fetch({query:this.query,onComplete:n.hitch(this,function(c){this.root.children=c;if(f.length!=c.length||H.some(f,function(a,b){return c[b]!=a}))this.onChildrenChange(this.root,c)})})},onNewItem:function(f,c){this._requeryTop();this.inherited(arguments)},onDeleteItem:function(f){-1!=H.indexOf(this.root.children,f)&&this._requeryTop();this.inherited(arguments)},onSetItem:function(f,c,a,b){this._requeryTop();this.inherited(arguments)}})})},
"dijit/tree/_dndSelector":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/kernel dojo/_base/lang dojo/dnd/common dojo/dom dojo/mouse dojo/on dojo/touch ../a11yclick ./_dndContainer".split(" "),function(H,d,m,n,q,f,c,a,b,k,h){return d("dijit.tree._dndSelector",h,{constructor:function(){this.selection={};this.anchor=null;this.events.push(a(this.tree.domNode,b.press,n.hitch(this,"onMouseDown")),a(this.tree.domNode,b.release,n.hitch(this,"onMouseUp")),a(this.tree.domNode,b.move,n.hitch(this,
"onMouseMove")),a(this.tree.domNode,k.press,n.hitch(this,"onClickPress")),a(this.tree.domNode,k.release,n.hitch(this,"onClickRelease")))},singular:!1,getSelectedTreeNodes:function(){var g=[],e=this.selection,l;for(l in e)g.push(e[l]);return g},selectNone:function(){this.setSelection([]);return this},destroy:function(){this.inherited(arguments);this.selection=this.anchor=null},addTreeNode:function(g,e){this.setSelection(this.getSelectedTreeNodes().concat([g]));e&&(this.anchor=g);return g},removeTreeNode:function(g){var e=
H.filter(this.getSelectedTreeNodes(),function(l){return!f.isDescendant(l.domNode,g.domNode)});this.setSelection(e);return g},isTreeNodeSelected:function(g){return g.id&&!!this.selection[g.id]},setSelection:function(g){var e=this.getSelectedTreeNodes();H.forEach(this._setDifference(e,g),n.hitch(this,function(l){l.setSelected(!1);this.anchor==l&&delete this.anchor;delete this.selection[l.id]}));H.forEach(this._setDifference(g,e),n.hitch(this,function(l){l.setSelected(!0);this.selection[l.id]=l}));this._updateSelectionProperties()},
_setDifference:function(g,e){H.forEach(e,function(l){l.__exclude__=!0});g=H.filter(g,function(l){return!l.__exclude__});H.forEach(e,function(l){delete l.__exclude__});return g},_updateSelectionProperties:function(){var g=this.getSelectedTreeNodes(),e=[],l=[];H.forEach(g,function(p){var v=p.getTreePath();l.push(p);e.push(v)},this);g=H.map(l,function(p){return p.item});this.tree._set("paths",e);this.tree._set("path",e[0]||[]);this.tree._set("selectedNodes",l);this.tree._set("selectedNode",l[0]||null);
this.tree._set("selectedItems",g);this.tree._set("selectedItem",g[0]||null)},onClickPress:function(g){if(!(this.current&&this.current.isExpandable&&this.tree.isExpandoNode(g.target,this.current))){"mousedown"==g.type&&c.isLeft(g)&&g.preventDefault();var e="keydown"==g.type?this.tree.focusedChild:this.current;if(e){var l=q.getCopyKeyState(g),p=e.id;this.singular||g.shiftKey||!this.selection[p]?(this._doDeselect=!1,this.userSelect(e,l,g.shiftKey)):this._doDeselect=!0}}},onClickRelease:function(g){this._doDeselect&&
(this._doDeselect=!1,this.userSelect("keyup"==g.type?this.tree.focusedChild:this.current,q.getCopyKeyState(g),g.shiftKey))},onMouseMove:function(){this._doDeselect=!1},onMouseDown:function(){},onMouseUp:function(){},_compareNodes:function(g,e){if(g===e)return 0;if("sourceIndex"in document.documentElement)return g.sourceIndex-e.sourceIndex;if("compareDocumentPosition"in document.documentElement)return g.compareDocumentPosition(e)&2?1:-1;if(document.createRange){var l=doc.createRange();l.setStartBefore(g);
g=doc.createRange();g.setStartBefore(e);return l.compareBoundaryPoints(l.END_TO_END,g)}throw Error("dijit.tree._compareNodes don't know how to compare two different nodes in this browser");},userSelect:function(g,e,l){if(this.singular)this.anchor==g&&e?this.selectNone():(this.setSelection([g]),this.anchor=g);else if(l&&this.anchor){e=this._compareNodes(this.anchor.rowNode,g.rowNode);l=this.anchor;0>e?e=l:(e=g,g=l);for(l=[];e!=g;)l.push(e),e=this.tree._getNext(e);l.push(g);this.setSelection(l)}else this.selection[g.id]&&
e?this.removeTreeNode(g):e?this.addTreeNode(g,!0):(this.setSelection([g]),this.anchor=g)},getItem:function(g){return{data:this.selection[g],type:["treeNode"]}},forInSelectedItems:function(g,e){e=e||m.global;for(var l in this.selection)g.call(e,this.getItem(l),l,this)}})})},"dijit/tree/_dndContainer":function(){define("dojo/aspect dojo/_base/declare dojo/dom-class dojo/_base/lang dojo/on dojo/touch".split(" "),function(H,d,m,n,q,f){return d("dijit.tree._dndContainer",null,{constructor:function(c,a){this.tree=
c;this.node=c.domNode;n.mixin(this,a);this.containerState="";m.add(this.node,"dojoDndContainer");this.events=[q(this.node,f.enter,n.hitch(this,"onOverEvent")),q(this.node,f.leave,n.hitch(this,"onOutEvent")),H.after(this.tree,"_onNodeMouseEnter",n.hitch(this,"onMouseOver"),!0),H.after(this.tree,"_onNodeMouseLeave",n.hitch(this,"onMouseOut"),!0),q(this.node,"dragstart, selectstart",function(b){b.preventDefault()})]},destroy:function(){for(var c;c=this.events.pop();)c.remove();this.node=this.parent=
null},onMouseOver:function(c){this.current=c},onMouseOut:function(){this.current=null},_changeState:function(c,a){var b="dojoDnd"+c;c=c.toLowerCase()+"State";m.replace(this.node,b+a,b+this[c]);this[c]=a},_addItemClass:function(c,a){m.add(c,"dojoDndItem"+a)},_removeItemClass:function(c,a){m.remove(c,"dojoDndItem"+a)},onOverEvent:function(){this._changeState("Container","Over")},onOutEvent:function(){this._changeState("Container","")}})})},"jimu/dijit/LayerChooserFromMapWithDropbox":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/html dojo/on dojo/keys dojo/Evented dojo/Deferred dijit/popup dijit/_WidgetBase dijit/_TemplatedMixin dojo/text!./templates/LayerChooserFromMapWithDropbox.html jimu/LayerInfos/LayerInfos".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g){return H([b,k,f],{templateString:h,baseClass:"jimu-layer-chooser-from-map-withdropbox",declaredClass:"jimu.dijit.LayerChooserFromMapWithDropbox",_selectedItem:null,_isLayerChooserShow:!1,layerInfosObj:null,layerChooser:null,customClass:"",postMixInProperties:function(){this.inherited(arguments);this.nls=window.jimuNls.queryableLayerSource;this.nls.customSelectLayer=this.label?this.label:this.nls.selectLayer},postCreate:function(){this.inherited(arguments);this.layerInfosObj=
g.getInstanceSync();this.layerChooser.domNode.style.zIndex=1;this.layerChooser.tree.domNode.style.borderTop="0";this.layerChooser.tree.domNode.style.maxHeight="290px";this.own(n(this.layerChooser,"tree-click",d.hitch(this,this._onTreeClick)));this.own(n(this.layerChooser,"update",d.hitch(this,this._onLayerChooserUpdate)));this.own(n(document.body,"click",d.hitch(this,this._onBodyClicked)));this.own(n(document.body,"keydown",d.hitch(this,function(e){e.keyCode===q.ENTER&&this._onBodyClicked(e)})));
this.own(n(this.layerChooser.domNode,"keydown",d.hitch(this,function(e){e.keyCode===q.ESCAPE&&this.hideLayerChooser()})))},destroy:function(){this.hideLayerChooser();this.layerChooser&&this.layerChooser.destroy();this.layerChooser=null;this.inherited(arguments)},getLayerChooser:function(){return this.layerChooser},setSelectedLayer:function(e){var l=new c;if(e){var p=this.layerInfosObj.getLayerOrTableInfoById(e.id);p?this.layerChooser.filter(p).then(d.hitch(this,function(v){v?(this._onSelectNewItem({layerInfo:p,
name:p.title,url:e.url}),l.resolve(!0)):l.resolve(!1)}),d.hitch(this,function(){l.resolve(!1)})):l.resolve(!1)}else this._onSelectNewItem(null),l.resolve(!0);return l},getSelectedItem:function(){return this._selectedItem},getSelectedItems:function(){return[this._selectedItem]},_onBodyClicked:function(e){e=e.target||e.srcElement;e===this.domNode||m.isDescendant(e,this.domNode)||e===this.layerChooser.domNode||m.isDescendant(e,this.layerChooser.domNode)||this.hideLayerChooser()},_onDropDownClick:function(e){e.stopPropagation();
e.preventDefault();this._isLayerChooserShow?this.hideLayerChooser():(this.isActive=!0,this.showLayerChooser())},_onDropDownKeydown:function(e){e.keyCode===q.ENTER&&this._onDropDownClick(e)},_getSelectedItems:function(){return this.layerChooser.getSelectedItems()},showLayerChooser:function(){this.layerChooser.domNode.style.minWidth=this.domNode.clientWidth+2+"px";a.open({parent:this,popup:this.layerChooser,around:this.domNode});var e=this.layerChooser.domNode.parentNode;e&&(m.addClass(e,"jimu-layer-chooser-from-map-withdropbox-popup"),
this.customClass&&m.addClass(e,this.customClass),this.layerChooser.tree.domNode.focus());this._isLayerChooserShow=!0},hideLayerChooser:function(){a.close(this.layerChooser);this._isLayerChooserShow=!1;this.isActive&&(this.dropDownBtn.focus(),this.isActive=!1)},_onLayerChooserUpdate:function(){this._selectedItem&&this.layerChooser.onlyShowVisible&&!this._selectedItem.layerInfo.isShowInMap()&&(this._selectedItem=null,this.emit("selection-change",[]))},_onSelectNewItem:function(e){var l=d.getObject("layerInfo.id",
!1,this._selectedItem)||-1,p=d.getObject("layerInfo.id",!1,e)||-1;l=l!==p;this._selectedItem=e;this.hideLayerChooser();e=d.getObject("layerInfo.title",!1,this._selectedItem)||"";this.layerNameNode.innerHTML=e;m.setAttr(this.layerNameNode,"title",e);e=d.getObject("layerInfo.layerObject",!1,this._selectedItem);l&&this.emit("selection-change",[e])},_onTreeClick:function(){var e=this._getSelectedItems();this._onSelectNewItem(0<e.length?e[0]:null)}})})},"jimu/dijit/SearchDistance":function(){define("dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./templates/SearchDistance.html dojo/Evented dojo/_base/lang jimu/utils jimu/dijit/CheckBox esri/tasks/GeometryService jimu/dijit/formSelect dijit/form/NumberTextBox".split(" "),
function(H,d,m,n,q,f,c,a,b,k){return H([d,m,n,f],{baseClass:"jimu-dijit-searchdistance",templateString:q,lastMeters:0,tip:"",distance:0,unit:"",postMixInProperties:function(){this.inherited(arguments);this.nls=c.clone(window.jimuNls.units);this.tip||(this.tip=window.jimuNls.searchDistance.applySearchDistance)},postCreate:function(){this.inherited(arguments);this.cbx=new b({label:this.tip,onChange:c.hitch(this,this._onCbxChanged)});this.cbx.placeAt(this.cbxDiv);this.reset();this.setDistance(this.distance);
this.setUnit(this.unit);this.lastMeters=this.getMeters()},enable:function(){this.cbx.check()},disable:function(){this.cbx.uncheck()},isEnabled:function(){return this.cbx.getValue()},reset:function(){this.numberTextBox.set("value",0);this.unitSelect.set("value","MILES")},getData:function(){return{status:this.getStatus(),isEnabled:this.isEnabled(),distance:this.getDistance(),unit:this.getUnit(),bufferUnit:this.getUnitToBuffer(),meters:this.getMeters()}},getStatus:function(){if(this.isEnabled()){var h=
this.getDistance();h=0<h?1:0===h?0:-1}else h=0;return h},getMeters:function(){var h=0,g=this.getStatus();if(0<g){g=this.getDistance();var e=this.getUnit();"MILES"===e?h=1609.344*g:"KILOMETERS"===e?h=1E3*g:"FEET"===e?h=.3048*g:"METERS"===e?h=g:"YARDS"===e?h=.9144*g:"NAUTICAL_MILES"===e&&(h=1852*g);h=parseFloat(h.toFixed(3))}else 0===g?h=0:0>g&&(h=-1);return h},setDistance:function(h){"number"===typeof h&&0<=h&&this.numberTextBox.set("value",h)},setUnit:function(h){h&&"string"===typeof h&&this.unitSelect.set("value",
h)},tryShowValidationError:function(){this.numberTextBox.validate()||a.showValidationErrorTipForFormDijit(this.numberTextBox)},getDistance:function(){return this.numberTextBox.validate()?this.numberTextBox.get("value"):(a.showValidationErrorTipForFormDijit(this.numberTextBox),-1)},getUnit:function(){return this.unitSelect.get("value")},getUnitToBuffer:function(){var h="";switch(this.unitSelect.get("value")){case "MILES":h=k.UNIT_STATUTE_MILE;break;case "KILOMETERS":h=k.UNIT_KILOMETER;break;case "FEET":h=
k.UNIT_FOOT;break;case "METERS":h=k.UNIT_METER;break;case "YARDS":h=k.UNIT_INTERNATIONAL_YARD;break;case "NAUTICAL_MILES":h=k.UNIT_NAUTICAL_MILE}return h},_onCbxChanged:function(){this.cbx.getValue()?(this.numberTextBox.set("disabled",!1),this.unitSelect.set("disabled",!1)):(this.numberTextBox.set("disabled",!0),this.unitSelect.set("disabled",!0));this._emitEvent()},_onNumberTextBoxChanged:function(){this._emitEvent()},_onUnitSelectChanged:function(){this._emitEvent()},_emitEvent:function(){var h=
this.getData();h.meters!==this.lastMeters&&(this.lastMeters=h.meters,this.emit("change",h))}})})},"jimu/dijit/FeatureSetChooserForSingleLayer":function(){define("dojo/on dojo/Evented dojo/_base/lang dojo/_base/array dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin jimu/dijit/DrawBox jimu/dijit/_FeatureSetChooserCore esri/symbols/jsonUtils".split(" "),function(H,d,m,n,q,f,c,a,b,k,h){return q([f,c,a,d],{baseClass:"jimu-single-layer-featureset-chooser",templateString:"\x3cdiv\x3e\x3c/div\x3e",
drawBox:null,map:null,featureLayer:null,updateSelection:!1,postCreate:function(){this.inherited(arguments);var g=h.fromJson({style:"esriSFSSolid",color:[79,129,189,77],type:"esriSFS",outline:{style:"esriSLSSolid",color:[54,93,141,255],width:1.5,type:"esriSLS"}});this.drawBox=new b({map:this.map,showClear:!0,keepOneGraphic:!0,geoTypes:["EXTENT"]});this.drawBox.setPolygonSymbol(g);g=this.drawBox.getDrawItemIcons();n.forEach(g,m.hitch(this,function(e){e.title=""}));this.drawBox.extentIcon.title=window.jimuNls.spatialFilterByFeatures.drawShapesTip;
this.drawBox.placeAt(this.domNode);this.own(H(this.drawBox,"user-clear",m.hitch(this,this._onDrawBoxUserClear)));this.own(H(this.drawBox,"draw-activate",m.hitch(this,function(){this.emit("draw-activate")})));this.own(H(this.drawBox,"draw-deactivate",m.hitch(this,function(){this.emit("draw-deactivate")})));this.own(H(this.drawBox,"draw-end",m.hitch(this,this._onDrawEnd)));this.featureSetChooserCore=new k({map:this.map,featureLayer:this.featureLayer,drawBox:this.drawBox,updateSelection:this.updateSelection});
this.own(H(this.featureSetChooserCore,"loading",m.hitch(this,function(){this.emit("loading")})));this.own(H(this.featureSetChooserCore,"unloading",m.hitch(this,function(){this.emit("unloading")})));this.own(H(this.featureLayer,"visibility-change",m.hitch(this,function(){this.featureLayer.visible?this.drawBox.enable():this.drawBox.disable()})))},getFeatures:function(){return this.featureSetChooserCore.getFeatures()},syncGetFeatures:function(){return this.featureSetChooserCore.syncGetFeatures()},disable:function(){this.drawBox.disable()},
enable:function(){this.drawBox.enable()},deactivate:function(){this.drawBox.deactivate()},clearAllGraphics:function(){this.featureSetChooserCore.clear(!1)},isLoading:function(){return this.featureSetChooserCore.isLoading()},getFeatureLayer:function(){return this.featureLayer},destroy:function(){this.featureSetChooserCore&&this.featureSetChooserCore.destroy();this.featureSetChooserCore=null;this.inherited(arguments)},_onDrawEnd:function(){this.drawBox.clear()},_onDrawBoxUserClear:function(){this.clearAllGraphics();
this.emit("user-clear")},showMiddleFeatureLayer:function(){this.featureSetChooserCore&&this.featureSetChooserCore.showMiddleFeatureLayer()},hideMiddleFeatureLayer:function(){this.featureSetChooserCore&&this.featureSetChooserCore.hideMiddleFeatureLayer()}})})},"jimu/dijit/_FeatureSetChooserCore":function(){define("dojo/on dojo/sniff dojo/Evented dojo/Deferred dojo/_base/lang dojo/_base/array dojo/_base/declare jimu/utils jimu/symbolUtils jimu/SelectionManager jimu/LayerInfos/LayerInfos esri/graphic esri/tasks/query esri/tasks/QueryTask esri/layers/FeatureLayer esri/symbols/jsonUtils esri/geometry/geometryEngine".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z){return c([m],{baseClass:"jimu-featureset-chooser-core",_middleFeatureLayer:null,_isLoading:!1,_def:null,_isDestroyed:!1,_handles:null,selectionManager:null,layerInfosObj:null,layerInfo:null,map:null,featureLayer:null,drawBox:null,updateSelection:!1,fullyWithin:!1,constructor:function(u){q.mixin(this,u);this.layerInfosObj=h.getInstanceSync();this.selectionManager=k.getInstance();this.featureLayer.getSelectionSymbol()||this.selectionManager.setSelectionSymbol(this.featureLayer);
u=a.getFeatureLayerDefinition(this.featureLayer);delete u.id;this._middleFeatureLayer=new p({layerDefinition:u,featureSet:null},{id:"featureLayer_"+a.getRandomString()});u=null;var E=this._middleFeatureLayer.geometryType;"esriGeometryPoint"===E?u=b.getDefaultMarkerSymbol():"esriGeometryPolyline"===E?u=b.getDefaultLineSymbol():"esriGeometryPolygon"===E&&(u=v.fromJson({style:"esriSFSSolid",color:[79,129,189,77],type:"esriSFS",outline:{style:"esriSLSSolid",color:[54,93,141,255],width:1.5,type:"esriSLS"}}));
this._middleFeatureLayer.setSelectionSymbol(u);u=H(this.drawBox,"user-clear",q.hitch(this,this._onDrawBoxUserClear));E=H(this.drawBox,"draw-end",q.hitch(this,this._onDrawEnd));this._handles=[u,E];if(this.layerInfo=this.layerInfosObj.getLayerInfoById(this.featureLayer.id))u=H(this.layerInfo,"filterChanged",q.hitch(this,this._handleFilterChange)),this._handles.push(u)},hideMiddleFeatureLayer:function(){if(this._middleFeatureLayer){this._middleFeatureLayer.hide();var u=this.selectionManager.getDisplayLayer(this._middleFeatureLayer.id);
u&&u.hide()}},showMiddleFeatureLayer:function(){if(this._middleFeatureLayer){this._middleFeatureLayer.show();var u=this.selectionManager.getDisplayLayer(this._middleFeatureLayer.id);u&&u.show()}},clear:function(u){this.drawBox.clear();this._clearMiddleFeatureLayer();u&&this.selectionManager.clearSelection(this.featureLayer)},getFeatures:function(){var u=new n,E=q.hitch(this,function(){var F=this.syncGetFeatures();u.resolve(F)}),w=q.hitch(this,function(F){u.reject(F)});1===this._getDeferredStatus(this._def)?
this._def.then(E,w):E();return u},syncGetFeatures:function(){return(this.updateSelection?this.featureLayer:this._middleFeatureLayer).getSelectedFeatures()},isLoading:function(){return 1===this._getDeferredStatus(this._def)},_onLoading:function(){this.drawBox.deactivate();this.emit("loading")},_onUnloading:function(){this.emit("unloading")},_getDeferredStatus:function(u){var E=0;return E=u?u.isResolved()?2:u.isRejected()?-1:1:0},_onDrawEnd:function(u,E,w,F,y,D){if(this.isLoading())throw"should not draw when loading";
if(this.featureLayer.visible){var B=new n;this._def=B;var x=p.SELECTION_NEW;F&&(x=p.SELECTION_ADD);d("mac")?D&&(x=p.SELECTION_SUBTRACT):y&&(x=p.SELECTION_SUBTRACT);this.emit("loading");this._getFeaturesByGeometry(u.geometry).then(q.hitch(this,function(r){this.selectionManager.updateSelectionByFeatures(this.updateSelection?this.featureLayer:this._middleFeatureLayer,r,x);this._onUnloading();B.resolve(r)}),q.hitch(this,function(r){console.error(r);this._onUnloading();B.reject(r)}))}},_addTolerance:function(u){var E=
2.54*this.map.getScale()/9600;return z.buffer(u,10*E,"meters")},_getFeaturesByGeometry:function(u){"point"!==u.type&&"polyline"!==u.type||"esriGeometryPoint"!==this.featureLayer.geometryType||(u=this._addTolerance(u));var E=new n,w=[];if(this.featureLayer.getMap()&&this.featureLayer.mode!==p.MODE_SELECTION)u=this.selectionManager.getClientFeaturesByGeometry(this.featureLayer,u,this.fullyWithin),0<u.length&&(w=f.map(u,q.hitch(this,function(y){return new g(y.toJson())}))),E.resolve(w);else{w=new e;
w.geometry=u;w.outSpatialReference=this.map.spatialReference;w.returnGeometry=!0;w.spatialRelationship=this.fullyWithin?e.SPATIAL_REL_CONTAINS:e.SPATIAL_REL_INTERSECTS;(u=this.featureLayer.getDefinitionExpression())||(u="1\x3d1");if(this.layerInfo){var F=this.layerInfo.getFilter();F&&(u="("+u+") AND ("+F+")")}u&&(w.where=u);w.outFields=["*"];(new l(this.featureLayer.url)).execute(w).then(q.hitch(this,function(y){E.resolve(y.features)}),q.hitch(this,function(y){E.reject(y)}))}return E},_onDrawBoxUserClear:function(){this.clear()},
_clearMiddleFeatureLayer:function(){this._middleFeatureLayer&&(this._middleFeatureLayer.clear(),this.selectionManager.clearSelection(this._middleFeatureLayer))},_handleFilterChange:function(){var u=this.layerInfo.getFilter()||"1\x3d1",E=this.featureLayer.getSelectedFeatures(),w=this.featureLayer.objectIdField;if(E&&0<E.length){var F=f.map(E,function(D){return D.attributes[w]}),y=new e;y.where=w+" in ("+F.join(",")+") AND "+u;(new l(this.featureLayer.url)).executeForIds(y).then(q.hitch(this,function(D){f.forEach(E,
function(B){0<=D.indexOf(B.attributes[w])?B.show():B.hide()});this.selectionManager._isLayerNeedDisplayLayer(this.featureLayer)&&this.selectionManager._updateDisplayLayer(this.featureLayer,E,p.SELECTION_NEW);this.featureLayer.emit("selection-complete",{features:this.featureLayer.getSelectedFeatures()})}),q.hitch(this,function(D){console.error(D)}))}},destroy:function(){this._isDestroyed||(f.forEach(this._handles,q.hitch(this,function(u){u.remove()})),this._handles=null,this.clear());this._isDestroyed=
!0}})})},"esri/dijit/analysis/utils":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/event dojo/_base/fx dojo/_base/json dojo/_base/kernel dojo/dom-attr dojo/has dojo/i18n dojo/io-query dojo/i18n!../../nls/jsapi dojo/json dojo/string dojo/query dojo/date/locale dojo/dom-style dojo/dom-class dojo/dom-construct dojo/Deferred dojo/promise/all dojo/fx/easing dojo/number dojo/_base/window dojo/when dojo/dom dojo/on dojo/data/ItemFileWriteStore dojo/topic dojo/store/Memory dojox/mvc/equals dijit/registry dijit/Dialog dijit/form/CheckBox ../../kernel ../../lang ../../units ../../request ./HelpWindow ../../tasks/query ../../dijit/BrowseItems ../../layers/FeatureLayer ./PluginAnalysisLayers ../../tasks/Geoprocessor ../../dijit/SingleFilter ./FeatureRecordSetLayer ./PluginLayers ./PCSList ./ItemTypes ../../layers/ArcGISImageServiceLayer ../../layers/RasterXLayer ../../layers/RasterFunction ./AnalysisRegistry ../RasterFunctionEditor/utils".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F,y,D,B,x,r,t,C,J,L,P,U,aa,ea,ba,oa,da,fa,S,W,la,K,O,G,M,N,V,Y,ka,ja,R,ha,qa,ia,pa){H={};d.mixin(H,{_helpDialog:null,systemRFTGroupName:"Raster Function Templates",i18n:null,UNITSMAP:{Feet:"esriFeet",Yards:"esriYards",Miles:"esriMiles",Meters:"esriMeters",Kilometers:"esriKilometers",NauticalMiles:"esriNauticalMiles"},initHelpLinks:function(A,I,T){if(A){var Q=aa.byNode(A),Z=Q?Q.get("helpFileName"):T&&T.helpFileName?T.helpFileName:null,X=Q?Q.get("isSingleTenant"):
T&&T.isSingleTenant?T.isSingleTenant:!1,ca=ia.Modes.standard,ma=Q&&Q.portalSelf?Q.portalSelf.helpBase:T&&T.helpBase?T.helpBase:null,na=Q&&Q.portalSelf;this._helpDialog||(this._helpDialog=new W({isPortal:X,portalSelf:na}));Q&&(Q.showGeoAnalyticsParams||Q.showBigData)||T&&T.analysisMode&&T.analysisMode===ia.Modes.Bigdata?(Z+="_bd",ca=ia.Modes.Bigdata):T&&T.analysisMode&&"raster"===T.analysisMode&&(Z+="_ra",ca=ia.Modes.Raster);v("[esriHelpTopic]",A).forEach(function(sa,Ba,wa){sa&&(u.set(sa,"display",
da.isDefined(I)&&!0!==I?"none":""),da.isDefined(sa._helpClickHandler)&&(sa._helpClickHandler.remove(),sa._helpClickHandler=null),sa._helpClickHandler=C(sa,"click",d.hitch(this,function(ta){q.stop(ta);T&&T.showHelpFromUrl&&T.helpUrl?this._helpDialog.show(ta,{showHelpFromUrl:T.showHelpFromUrl,helpUrl:T.helpUrl}):this._helpDialog.show(ta,{helpId:b.get(sa,"esriHelpTopic"),helpFileName:Z,analysisGpServer:T&&T.analysisGpServer?T.analysisGpServer:null,helpParentNode:A,isPortal:X,analysisMode:ca,helpBase:ma,
portalSelf:Q&&Q.portalSelf})})))},this)}},constructAnalysisFeatColl:function(A){var I={},T;I.featureCollection=A.layerDefinition;for(T in I.featureCollection)I.featureCollection.hasOwnProperty(T)&&"objectIdField"===T&&(I.featureCollection.objectIdFieldName=d.clone(I.featureCollection.objectIdField),delete I.featureCollection.objectIdField);I.featureCollection.features=A.featureSet.features;return I},constructAnalysisInputLyrObj:function(A,I,T){if(A instanceof R||"Image Service"===A.type||"esri.layers.RasterXLayer"===
A.declaredClass)return pa.getRasterJsonFromLayer(A);var Q={},Z="";da.isDefined(T)||(T=!0);if(A.getMap)var X=A.getMap();else A._map&&(X=A._map);if(A.url&&!A._collection)Q={url:A.url},this.isHostedService(A.url),A.getDefinitionExpression&&A.getDefinitionExpression()?Q.filter=A.getDefinitionExpression():da.isDefined(A.definitionExpression)&&""!==A.definitionExpression&&(Q.filter=A.definitionExpression),A.useMapTime&&A.timeInfo&&X&&X.timeExtent&&T&&(X.timeExtent.startTime?(Z+=X.timeExtent.startTime.getTime(),
X.timeExtent.endTime&&(Z+=","+X.timeExtent.endTime.getTime())):X.timeExtent.endTime&&(Z+=X.timeExtent.endTime.getTime()),Z&&(Q.time=Z)),A.credential&&(Q.serviceToken=A.credential.token),-1!==Q.url.indexOf("?")&&(T=Q.url.substring(Q.url.indexOf("?")+1,Q.url.length),T=g.queryToObject(T),d.mixin(Q,T),Q.url=Q.url.substring(0,Q.url.indexOf("?")));else if(!A.url||A._collection)try{Q=A.toJson()}catch(ca){A._json=l.parse(A._json),Q=A.toJson()}Q.name=A.name;I&&(Q=new V(Q));return Q},formatDate:function(A){return z.format(A,
{datePattern:"yyyy-MM-dd",selector:"date"})+" "+z.format(A,{selector:"time",timePattern:"HH:mm:ss"})},isHostedService:function(A){if(!A)return!1;var I=-1!==A.indexOf(".arcgis.com/");A=-1!==A.indexOf("/services")||-1!==A.indexOf("//tiles")||-1!==A.indexOf("//features");return I&&A},isPortalHostedService:function(A){return A?-1!==A.toLowerCase().indexOf("/hosted/"):!1},isTimeEnabled:function(A){var I=10.2<=A.version&&A._useStandardizedQueries;return A.useMapTime&&A.timeInfo&&(I||10.2<=A.version)||da.isDefined(A.time)},
isTimeInstantLayer:function(A){return da.isDefined(A.timeInfo)&&da.isDefined(A.timeInfo.startTimeField)&&!da.isDefined(A.timeInfo.endTimeField)||da.isDefined(A.time)&&da.isDefined(A.time.timeType)&&"instant"===A.time.timeType},buildReport:function(A,I){var T="";I||(I={},d.mixin(I,e.analysisMsgCodes));m.forEach(A,function(Q,Z){if("string"===typeof Q.message){var X=da.isDefined(I[Q.messageCode])?I[Q.messageCode]:Q.message;T+=Q.style.substring(0,Q.style.indexOf("\x3c/"))+(this._isEmptyObject(Q.params)?
X:p.substitute(X,Q.params))+Q.style.substring(Q.style.indexOf("\x3c/"))}else if(d.isArray(Q.message)){var ca=[];var ma=d.clone(Q.style);m.forEach(Q.message,function(na,sa){ma=ma.replace(/<\//,"${"+sa+"}");X=da.isDefined(I[Q.messageCode+"_"+sa])?I[Q.messageCode+"_"+sa]:na;X=this._isEmptyObject(Q.params)?X:p.substitute(X,Q.params);"string"===typeof X&&(X=this.safetagsReplace(X));ca.push(X+"\x3c/")},this);ma=p.substitute(ma,ca);T+=ma}},this);return T},getLayerFeatureCount:function(A,I){var T=new la,
Q=new F;I||(I={});T.geometry=I.geometry;T.geometryType=I.geometryType||"esriGeometryEnvelope";A.url||T.geometry?(A.url&&(T.where=I.where||"1\x3d1",A.getDefinitionExpression&&A.getDefinitionExpression()&&!I.where?T.where=A.getDefinitionExpression():da.isDefined(A.definitionExpression)&&""!==A.definitionExpression&&!I.where&&(T.where=A.definitionExpression)),Q=A.queryCount(T)):Q.resolve(A.graphics.length);return Q.promise},createPolygonFeatureCollection:function(A){var I={layerDefinition:null,featureSet:{features:[],
geometryType:ia.GeometryTypes.Polygon}};I.layerDefinition={currentVersion:10.2,copyrightText:"",defaultVisibility:!0,relationships:[],isDataVersioned:!1,supportsRollbackOnFailureParameter:!0,supportsStatistics:!0,supportsAdvancedQueries:!0,geometryType:ia.GeometryTypes.Polygon,minScale:0,maxScale:0,objectIdField:"OBJECTID",templates:[],type:"Feature Layer",displayField:"TITLE",visibilityField:"VISIBLE",name:A,hasAttachments:!1,typeIdField:"TYPEID",capabilities:"Query",allowGeometryUpdates:!0,htmlPopupType:"",
hasM:!1,hasZ:!1,globalIdField:"",supportedQueryFormats:"JSON",hasStaticData:!1,maxRecordCount:-1,indexes:[],types:[],drawingInfo:{renderer:{type:"simple",symbol:{color:[0,0,0,255],outline:{color:[0,0,0,255],width:3,type:"esriSLS",style:"esriSLSSolid"},type:"esriSFS",style:"esriSFSNull"},label:"",description:""},transparency:0,labelingInfo:null,fixedSymbols:!0},fields:[{alias:"OBJECTID",name:"OBJECTID",type:"esriFieldTypeOID",editable:!1},{alias:"Title",name:"TITLE",length:50,type:"esriFieldTypeString",
editable:!0},{alias:"Visible",name:"VISIBLE",type:"esriFieldTypeInteger",editable:!0},{alias:"Description",name:"DESCRIPTION",length:1073741822,type:"esriFieldTypeString",editable:!0},{alias:"Type ID",name:"TYPEID",type:"esriFieldTypeInteger",editable:!0}]};return I},createPointFeatureCollection:function(A){var I={layerDefinition:null,featureSet:{features:[],geometryType:ia.GeometryTypes.Point}};I.layerDefinition={objectIdField:"OBJECTID",templates:[],type:"Feature Layer",drawingInfo:{renderer:{field1:"TYPEID",
type:"simple",symbol:{height:24,xoffset:0,yoffset:12,width:24,contentType:"image/png",type:"esriPMS",url:"http://static.arcgis.com/images/Symbols/Basic/GreenStickpin.png"},description:"",value:"0",label:"Stickpin"}},displayField:"TITLE",visibilityField:"VISIBLE",name:A,hasAttachments:!1,typeIdField:"TYPEID",capabilities:"Query",types:[],geometryType:ia.GeometryTypes.Point,fields:[{alias:"OBJECTID",name:"OBJECTID",type:"esriFieldTypeOID",editable:!1},{alias:"Title",name:"TITLE",length:50,type:"esriFieldTypeString",
editable:!0},{alias:"Visible",name:"VISIBLE",type:"esriFieldTypeInteger",editable:!0},{alias:"Description",name:"DESCRIPTION",length:1073741822,type:"esriFieldTypeString",editable:!0},{alias:"Type ID",name:"TYPEID",type:"esriFieldTypeInteger",editable:!0}]};return I},createFolderStore:function(A,I){var T=new J({data:{identifier:"id",label:"name",items:[]}});T.newItem({name:I,id:""});m.forEach(A,function(Q){T.newItem({name:Q.title,id:Q.id})});return T},setupFoldersUI:function(A){A.folderSelect.set("store",
A.folderStore);A.folderSelect.set("required",!0);A.folderSelect.set("searchAttr","name");da.isDefined(A.folderId)?A.folderStore.get(A.folderId).then(d.hitch(this,function(I){da.isDefined(I)?A.folderSelect.set("item",I):A.folderStore.get("").then(function(T){A.folderSelect.set("item",T)},this)})):A.folderName?A.folderStore.fetch({query:{name:A.folderName},onComplete:d.hitch(this,function(I){da.isDefined(I)&&0<I.length?A.folderSelect.set("item",I[0]):A.folderStore.get("").then(function(T){A.folderSelect.set("item",
T)},this)})}):A.username?A.folderSelect.set("displayedValue",A.username):A.folderStore.get("").then(function(I){A.folderSelect.set("item",I)},this)},_isEmptyObject:function(A){for(var I in A)if(A.hasOwnProperty(I))return!1;return!0},validateServiceName:function(A,I){var T=/(:|&|<|>|%|#|\?|\\|"|\/|\+|=|\*|@|'|;|\||,)/g.test(A),Q=!0,Z=!0;if(da.isDefined(I)&&I.textInput)var X=I.textInput;da.isDefined(I)&&da.isDefined(I.isItem)&&(Z=I.isItem);this.initI18n();if(0===A.length||0===p.trim(A).length){var ca=
this.i18n.requiredValue;Q=!1}else if(T)ca=this.i18n.invalidServiceName,Q=!1;else if(Z&&98<A.length)ca=this.i18n.invalidServiceNameLength,Q=!1;else if(Z&&170<encodeURIComponent(A).length){for(A+="";170<encodeURIComponent(A).length;)A=A.substring(0,A.length-1);ca=p.substitute(this.i18n.suggestedServiceNameLength,{count:A.length});Q=!1}X&&!Q&&X.set("invalidMessage",ca);return Q},getStepNumber:function(A){v(".esriAnalysisNumberLabel",A).forEach(function(I,T){T=this._getNumberLabel(T);b.set(I,"innerHTML",
T)},this)},_getNumberLabel:function(A){var I="";this.initI18n();switch(A){case 0:I=this.i18n.oneLabel;break;case 1:I=this.i18n.twoLabel;break;case 2:I=this.i18n.threeLabel;break;case 3:I=this.i18n.fourLabel;break;case 4:I=this.i18n.fiveLabel;break;case 5:I=this.i18n.sixLabel;break;case 6:I=this.i18n.sevenLabel;break;case 7:I=this.i18n.eightLabel;break;case 8:I=this.i18n.nineLabel;break;case 9:I=this.i18n.tenLabel;break;case 10:I=this.i18n.elevenLabel;break;case 11:I=this.i18n.twelveLabel;break;case 12:I=
this.i18n.thirteenLabel}return I},populateAnalysisLayers:function(A,I,T,Q){if(A){var Z=[],X=A.get(I);I=Q&&Q.layerSelect?Q.layerSelect:A._analysisSelect;A.rerun&&!X&&(Q||(Q={}),Q.chooseBlank=!0);A._titleRow&&u.set(A._titleRow,"display","none");A._analysisLabelRow&&u.set(A._analysisLabelRow,"display","table-row");A._selectAnalysisRow&&(u.set(A._selectAnalysisRow,"display","table-row"),u.set(A._analysisSelect.domNode.parentNode,"padding-bottom","1em"));A.domNode&&this.getStepNumber(A.domNode);da.isDefined(Q)&&
Q.chooseLabel&&Z.push({value:-1,label:this.i18n.chooseLabel});da.isDefined(Q)&&Q.chooseBlank&&Z.push({value:"  ",label:""});da.isDefined(Q)&&da.isDefined(Q.posIncrement)||(da.isDefined(Q)||(Q={}),Q.posIncrement=0);A.get(T)||A.set(T,[]);m.forEach(A.get(T),function(ca,ma){ma+=Q.posIncrement;ma={value:da.isDefined(Q)&&Q.chooseLabel?""+ma+1:""+ma,label:ca.name};X&&(ca.name===X.name||ca.url&&X.url&&ca.url===X.url)&&(ma.selected=!0);Z.push(ma)},this);I.addOption(Z);I.set("required",!0);Q.chooseBlank&&"  "===
I.get("value")&&setTimeout(d.hitch(this,this._validateSelectUI,I),100)}},isValidAnalysisLayer:function(A){var I="",T=!0;var Q={isValid:T,validationMessage:I};var Z,X,ca=0,ma=0,na=0,sa,Ba,wa,ta=!0;if(!da.isDefined(A)||!da.isDefined(A.toolName))return Q;this.initI18n();Q=A.toolName;var ua=A.layers;var ra=A.analysisLayer;var va=Q.charAt(0).toLowerCase()+Q.substring(1);var za=this.i18n;A=A.showReadyToUseLayers||!1;m.forEach(ua,function(Aa){ta=!1;if(Aa instanceof R||"esri.layers.RasterXLayer"===Aa.declaredClass)sa=
!0;sa&&1<Aa.bandCount&&(Ba=!0);sa&&1===Aa.bandCount&&(wa=!0);Aa.geometryType===ia.GeometryTypes.Point&&(Ea=!0,ca++);if(Aa.geometryType===ia.GeometryTypes.Point||Aa.geometryType===ia.GeometryTypes.MultiPoint)Z=!0;Aa.geometryType===ia.GeometryTypes.Line&&(X=!0,na++);Aa.geometryType===ia.GeometryTypes.Polygon&&(Oa=!0,ma++)},this);if(-1!==m.indexOf(["CreateDriveTimeAreas","PlanRoutes","ConnectOriginsToDestinations"],Q)&&(!Ea||ra&&ra.geometryType!==ia.GeometryTypes.Point))I=p.substitute(this.i18n.selectPointLayer,
{toolName:za[va]}),T=!1;else if("AggregatePoints"!==Q&&"InterpolatePoints"!==Q||(!ra||ra.geometryType===ia.GeometryTypes.Point||ra.geometryType===ia.GeometryTypes.MultiPoint)&&Z)if("CalculateDensity"===Q&&(!Z&&!X||ra&&ra.geometryType!==ia.GeometryTypes.Point&&ra.geometryType!==ia.GeometryTypes.MultiPoint&&ra.geometryType!==ia.GeometryTypes.Line))I=p.substitute(this.i18n.areaFeatureInvalidMsg,{toolName:za[va]}),T=!1;else if("FindHotSpots"!==Q&&"FindOutliers"!==Q||A||!(!Z&&!Oa||ra&&ra.geometryType!==
ia.GeometryTypes.Point&&ra.geometryType!==ia.GeometryTypes.MultiPoint&&ra.geometryType!==ia.GeometryTypes.Polygon))if("OverlayLayers"!==Q&&"AggregatePoints"!==Q&&"SummarizeWithin"!==Q&&"SummarizeNearby"!==Q&&"FindNearest"!==Q&&"MergeLayers"!==Q||A||0!==ua.length&&(1!==ua.length||ua[0]!==ra&&da.isDefined(ra)))if("ConnectOriginsToDestinations"===Q&&!A&&(ta||2>ca))I=p.substitute(this.i18n.odPointMsg,{toolName:za[va]}),T=!1;else if(this.isFindCentroids(Q)&&this.isPointLayer(ra))I=p.substitute(this.i18n.selectNoPointLayer,
{toolName:za[va]}),T=!1;else if("AggregatePoints"===Q&&!A&&1<ua.length){var Oa=m.some(ua,function(Aa){return Aa.geometryType===ia.GeometryTypes.Polygon});Oa||(I=p.substitute(this.i18n.aggregatePolyMsg,{toolName:za[va]}),T=!1)}else if("MergeLayers"===Q&&!A&&1<ua.length)1<ca||1<na||1<ma||(I=this.i18n.mergeValidationMsg,T=!1);else if("SummarizeWithin"!==Q&&"DissolveBoundaries"!==Q||(!ra||ra.geometryType===ia.GeometryTypes.Polygon)&&Oa||A)if("ExtractData"===Q)(T=m.some(ua,function(Aa){return-1!==Aa.capabilities.indexOf("Extract")}))||
(I=p.substitute(this.i18n.extractValidationMsg));else if(("ConnectOriginsToDestinations"===Q||Q===ia.Tools.ChooseBestFacilities)&&1<ua.length){var Ea=m.some(ua,function(Aa){var Wa=da.isDefined(ra)&&ra.id===Aa.id;return Aa.geometryType===ia.GeometryTypes.Point&&!Wa});Ea||(I=p.substitute(Q===ia.Tools.ChooseBestFacilities?this.i18n.selectPointLayer:this.i18n.odPointMsg,{toolName:za[va]}),T=!1)}else"CalculateSlope"===Q||"DeriveAspect"===Q||"RemapValues"===Q?sa?wa||(T=!1,I=p.substitute(this.i18n.noSingleBandISMsg,
{toolName:za[va]})):(T=!1,I=p.substitute(this.i18n.noImageServiceMsg,{toolName:za[va]})):"ExtractRaster"===Q?sa||(T=!1,I=p.substitute(this.i18n.noImageServiceMsg,{toolName:za[va]})):"MonitorVegetation"===Q&&(sa?Ba||(T=!1,I=p.substitute(this.i18n.noMultiBandISMsg,{toolName:za[va]})):(T=!1,I=p.substitute(this.i18n.noImageServiceMsg,{toolName:za[va]})));else I=p.substitute(this.i18n.selectPolyLayer,{toolName:za[va]}),T=!1;else I=p.substitute(this.i18n.overlayValidationMsg,{toolName:za[va]}),T=!1;else I=
p.substitute(this.i18n.hotspotsLineFeatureMsg,{toolName:za[va]}),T=!1;else I=p.substitute(this.i18n.selectPointLayer,{toolName:za[va]}),T=!1;return Q={isValid:T,validationMessage:I}},isFindCentroids:function(A){return A===ia.Tools.FindCentroids},isPointLayer:function(A){return A&&A.geometryType===ia.GeometryTypes.Point},initI18n:function(){this.i18n||(this.i18n={},d.mixin(this.i18n,e.common),d.mixin(this.i18n,e.analysisTools),d.mixin(this.i18n,e.analysisMsgCodes),d.mixin(this.i18n,e.browseLayersDlg),
d.mixin(this.i18n,e.driveTimes),d.mixin(this.i18n,e.calculateFields))},addBrowseAnalysisDialog:function(A){if(A&&A.widget){this.i18n||this.initI18n();var I="esri/dijit/analysis/PluginAnalysisLayers",T=function(ua){return"\x3cimg class\x3d'grid-item galleryThumbnail' width\x3d'120px' height\x3d'80px' alt\x3d'' src\x3d'"+(ua.thumbnailUrl||this._portal.staticImagesUrl+"/desktopapp.png")+"'\x3e"},Q=function(ua){return'\x3cdiv class\x3d"galleryLabelContainer"\x3e\x3cspan alt\x3d\''+(ua.title||ua.name||
"\x3cNo Title\x3e")+"'\x3e"+(ua.title.replace(/_/g," ")||ua.name.replace(/_/g," ")||"\x3cNo Title\x3e")+"\x3c/span\x3e\x3c/div\x3e"},Z=function(ua){return"\x3cimg class\x3d'grid-item-thumb' width\x3d'16px' height\x3d'16px' alt\x3d'' src\x3d'"+ua.iconUrl+"'/\x3e"},X=function(ua){return"\x3cimg class\x3d'grid-item-thumb' width\x3d'16px' height\x3d'16px' alt\x3d'' src\x3d'"+ua.iconUrl+"'/\x3e"},ca=x.doc.createDocumentFragment();ca=w.create("div",{style:"width:100%;height:100%;"},ca);var ma=w.create("div",
{style:"width:100%;height:10%;","class":""}),na=w.create("div",{style:"width:100%"},ca),sa=this._isCustomAnalysisQuery(A.widget);1===A.browseType?(I="esri/dijit/analysis/PluginLayers",I={portalUrl:A.widget.get("portalUrl"),message:"",plugin:I,sortDescending:!0,sort:"title",self:A.widget.get("portalSelf"),itemsPerPage:100,demandList:!0,extent:A.widget.get("map").extent,useExtent:!1,fetchTimeout:600,galleryTemplate:"\x3cdiv class\x3d'listServiceTitle'\x3e\x3ctable cellpadding\x3d'0' cellspacing\x3d'0' width\x3d'100%'\x3e\x3ctr width\x3d'100%'\x3e\x3ctd nowrap\x3d'nowrap'\x3e  \x3cdiv  style\x3d\"position:absolute;left:80px; top:10px; width:1px; height:1px; background: transparent;\"\x3e\x3c/div\x3e\x3cdiv style\x3d'overflow:hidden;'\x3e\x3ca style\x3d\"height:16px;\"\x3e${item.title}\x3c/a\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3ctable cellpadding\x3d'0' cellspacing\x3d'0' width\x3d'100%'\x3e\x3ctr width\x3d'100%' class\x3d'bottomRowTable'\x3e\x3ctd width\x3d'20'\x3e  \x3cspan class\x3d'esriAlignLeading'\x3e${item:_formatThumbnail}\x3c/span\x3e\x3c/td\x3e\x3ctd nowrap\x3d'nowrap'\x3e  \x3cspan class\x3d'esriAlignLeading' style\x3d'color:#656565;'\x3e${item.owner}\x3c/span\x3e\x3c/td\x3e\x3ctd style\x3d'padding-right:5px;padding-left:3px;'\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e",
showInfoPanel:!0,isAutoClose:!1,checkIsButtonEnabled:!0,formatThumbnail:X,formatInfoPanelImage:Z,"class":"esriAnalysisLayersItems"}):I={portalUrl:A.widget.get("portalUrl"),message:"",plugin:I,sortDescending:!0,sort:"title",self:A.widget.get("portalSelf"),pagingLinks:1,rowsPerPage:6,"class":"esriBrowseAnalysisLayers itemsGallery esriFloatLeading",extent:A.widget.get("map").extent,useExtent:!sa,fetchTimeout:600,galleryTemplate:'\x3cdiv style\x3d\'opacity:1;\' class\x3d\'grid-item gallery-view galleryNode\'\x3e${item:_formatItemTitle}${item:_formatThumbnail}\x3cdiv class\x3d"linksDiv" style\x3d\'display:none;\'\x3e\x3cdiv class\x3d"esriItemLinks"\x3e\x3cdiv class\x3d"esriFloatLeading"\x3e\x3ca style\x3d"text-decoration: none;"\x3e\x3cspan\x3eAdd layer to analysis\x3c/span\x3e\x3cdiv class\x3d"dijitReset dijitInline esriArrows"\x3e\x3c/div\x3e\x3c/a\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e',
formatItemTitle:Q,showInfoPanel:!1,showTooltip:!0,formatThumbnail:T,style:"width:48em;height:100%;clear:both;"};Q=w.toDom('\x3cdiv class\x3d"esriBrowseOptions"\x3e');w.place(Q,ma);T=w.create("div",{"class":"esriBrowseOption"},Q);if(!A.browseType||1!==A.browseType){Q=w.create("div",{"class":"esriBrowseOption"},Q);var Ba=new ba({name:"addlayer",id:A.widget.id+(A.browseType?A.browseType:"")+"_addlayercheck","class":"",value:!1,checked:!1},w.create("input",{},Q));w.create("label",{"for":A.widget.id+"_addlayercheck",
"class":"esriBrowseOption_label",innerHTML:this.i18n.addLayer},Q)}Q=!0;A.browseType&&1===A.browseType?Q=!1:sa&&(Q=!1);Q=new ba({name:"extentcheck",id:A.widget.id+(A.browseType?A.browseType:"")+"_addextentcheck","class":"",value:Q,checked:Q},w.create("input",{},T));w.create("label",{"for":A.widget.id+(A.browseType?A.browseType:"")+"_addextentcheck","class":"esriBrowseOption_label",innerHTML:this.i18n.withinMapArea},T);I.messageRight=ma;var wa=new K(I,na);Q.on("change",d.hitch(this,function(ua){wa.set("useExtent",
ua)}));var ta=new ea({title:1===A.browseType?this.i18n.browseLayers:sa?this.i18n.browseAnalysisLayers:this.i18n.browseAnalysisTitle,content:ca,browseItems:wa,addlayerCheckBox:Ba,style:A.browseType&&1===A.browseType?"":"padding:.75em 0;background-color: #fff;width:50em;"});A.widget.own(ta.on("hide",d.hitch(ta,function(ua){ta.browseItems.reset()})));return ta}},addAnalysisReadyLayer:function(A,I){function T(wa){var ta;if("Feature Service"===X.type){var ua=new O(X.url,{outFields:["*"]});d.mixin(X,ua)}"Image Service"===
X.type&&(ua=-1<wa.capabilities.indexOf("TilesOnly")?new ha(X.url,{outFields:["*"]}):new R(X.url,{outFields:["*"]}),d.mixin(X,ua));d.mixin(X,wa);X.id=X.title+"_"+wa.id;X.title=A.item.selectedLayer?X.title+"-"+wa.name:X.title.replace(/_/g," ");X.name=X.title;X.version=X.currentVersion;if(ma&&A.widget.showBrowseLayers){var ra=(ta=A.layersSelect.get("store"))&&ta.data;ta=2;ta=ra.splice(ra.length-ta,ta);var va={id:ra.length,label:X.title,name:X.title,url:X.url};ra.push(va);ra=ra.concat(ta);ta=new P({data:ra,
idProperty:"id"});A.layersSelect.set("store",ta);A.layersSelect.set("value",va.name)}else{ra=A.layersSelect.getOptions();if(A.widget.useArcGISComponents&&(A.widget.showBrowseLayers||A.widget.showReadyToUseLayers))ta=2;else if(A.widget.showBrowseLayers&&A.widget.showReadyToUseLayers)ta=3;else if(A.widget.showBrowseLayers||A.widget.showReadyToUseLayers)ta=2;ta=ra.splice(ra.length-ta,ta);A.layersSelect.removeOption(ta);ra=A.layers.length;A.posIncrement&&(ra+=A.posIncrement);ra=""+ra;ta.unshift({value:ra,
label:X.title,selected:!0});A.layersSelect.addOption(ta);A.layersSelect.set("value",ra)}ua&&(X.lyr=ua,ua.name=X.name);X.linfo=wa;A.layers.push(X);if(A.browseDialog.addlayerCheckBox&&A.browseDialog.addlayerCheckBox.get("checked")||ca||I)this._addLayerHandle&&this._addLayerHandle.remove(),this._addLayerHandle=A.widget.map.on("layer-add",d.hitch(this,function(za){this._addLayerHandle.remove();A.widget.emit("add-ready-to-use-layer",{layer:za.layer,layerInfo:wa,item:X})})),A.widget.map.addLayer(ua);A.browseDialog.browseItems&&
A.browseDialog.browseItems.clear()}if(da.isDefined(A)&&da.isDefined(A.item)&&da.isDefined(A.layersSelect)&&da.isDefined(A.layers)&&da.isDefined(A.browseDialog)){A.browseDialog.hide&&A.browseDialog.hide();var Q,Z;(Q=!A.item.selectedLayer&&A.item.url?A.item.type===ja.IS?A.item.url:A.item.url+"/0":A.item.selectedLayer.url)&&-1!==window.location.protocol.indexOf("https:")&&(Q=Q.replace("http:","https:"));var X={url:Q,itemId:A.item.id,title:A.item.title,type:A.item.type,analysisReady:!0};Q=m.some(A.layers,
function(wa,ta){var ua=wa.analysisReady&&X.analysisReady&&wa.itemId===X.itemId;A.item.selectedLayer&&A.item.selectedLayer.url&&(ua=wa.itemId&&X.itemId?wa.itemId===X.itemId&&wa.url===X.url:wa.url===X.url);ua&&(Z=ta);return ua});var ca;A.browseDialog.browseItems&&v(".js-add-layer-checkbox",A.browseDialog.browseItems.infoPanel).forEach(function(wa){ca=wa.checked});var ma=-1!==A.layersSelect.baseClass.indexOf("dijitComboBox");var na=new F;var sa="sync";if(Q){A.posIncrement&&(Z+=A.posIncrement);if(A.browseDialog.addlayerCheckBox&&
A.browseDialog.addlayerCheckBox.get("checked")||ca||I){A.posIncrement||(A.posIncrement=0);var Ba=A.layers[Z-A.posIncrement];A.widget.map.getLayer(Ba.lyr.id)||(this._addLayerHandle&&this._addLayerHandle.remove(),this._addLayerHandle=A.widget.map.on("layer-add",d.hitch(this,function(wa){this._addLayerHandle.remove();A.widget.emit("add-ready-to-use-layer",{layer:wa.layer,layerInfo:Ba.linfo,item:Ba})})),A.widget.map.addLayer(Ba.lyr))}ma?A.layersSelect.set("value",A.layers[Z-1].name):A.layersSelect.set("value",
""+Z);A.browseDialog.browseItems&&A.browseDialog.browseItems.clear();na.resolve()}else A.item.selectedLayer?(X.url=A.item.selectedLayer.url,na.then(d.hitch(this,T)),setTimeout(function(){na.resolve(A.item.selectedLayer)},500)):(sa=A.item.itemDataUrl?S({url:A.item.itemDataUrl,content:{f:"json"}}):"sync",r(sa,d.hitch(this,function(wa){wa&&wa.layers&&wa.layers[0].id&&(X.url=X.url.substring(0,X.url.lastIndexOf("/0"))+"/"+wa.layers[0].id);S({url:X.url,content:{f:"json"}}).then(d.hitch(this,function(ta){T(ta);
na.resolve()}))})));return na.promise}},addReadyToUseLayerOption:function(A,I){A&&(A.showReadyToUseLayers||A.showBrowseLayers)&&(I||(I=[]),A.signInPromise||(A.signInPromise=new F,setTimeout(d.hitch(this,function(){A.signInPromise.resolve()}),100)),A.i18n||(this.initI18n(),A.i18n=this.i18n),A.signInPromise.then(d.hitch(this,function(){m.forEach(I,function(T){var Q=T.select||T;if(-1!==Q.baseClass.indexOf("dijitComboBox")&&A.showBrowseLayers){if(T=Q.get("store"))T.put({id:"separator",name:"separator",
label:"\x3chr\x3e"}),T.put({id:"browselayers",name:"browselayers",label:A.i18n.browseLayers})}else{var Z=Q.getOptions();m.some(Z,function(X){return"separator"===X.type},this)||!A.showReadyToUseLayers&&!A.showBrowseLayers||Q.addOption({type:"separator",value:""});this.addBrowseOptionForTool({select:Q,disableLAAL:T.disableLAAL},A)}},this);A.showReadyToUseLayers&&!da.isDefined(A._browsedlg)&&(A._browsedlg=this.addBrowseAnalysisDialog({widget:A}),A.own(A._browsedlg.browseItems.on("select-change",d.hitch(A,
A._handleBrowseItemsSelect)),A._browsedlg.on("hide",d.hitch(A,function(){m.forEach(I,function(T){"browse"===T.get("value")&&T.reset()});A.layersSelect&&A.layersSelect.reset()}))));A.showBrowseLayers&&!da.isDefined(A._browseLyrsdlg)&&(A._browseLyrsdlg=this.addBrowseAnalysisDialog({widget:A,browseType:1}),A.own(A._browseLyrsdlg.on("browseitems-close",d.hitch(this,function(T){"add-layer"===T.action&&(A._browseLyrsdlg.browseItems.plugIn._grid&&(T.selection.selectedLayer=A._browseLyrsdlg.browseItems.plugIn._selectedLayer,
A._handleBrowseItemsSelect({dialog:A._browseLyrsdlg,selection:T.selection})),A._browseLyrsdlg.browseItems.closeInfoPanel())})),A._browseLyrsdlg.on("hide",d.hitch(A,function(){m.forEach(I,function(T){"browselayers"===T.get("value")&&T.reset()})}))))})))},addBrowseOptionForTool:function(A,I){var T=A.select,Q=A.disableLAAL||!1,Z=T.getOptions();A=[];var X=!1;if(!m.some(Z,function(ca){return"browselayers"===ca.value||"browse"===ca.value},this)){if(0<Z.length&&"separator"!==Z[Z.length-1].type||0===Z.length)A.push({type:"separator"}),
X=!0;I.useArcGISComponents&&(I.showBrowseLayers||I.showReadyToUseLayers)?A.push({value:"browselayers",label:I.i18n.browseAnalysisLayers}):(!Q&&I.showReadyToUseLayers&&(Q=I.i18n.browseAnalysisTitle,this._isCustomAnalysisQuery(I)&&(Q=I.i18n.browseAnalysisLayers),A.push({value:"browse",label:Q})),I.showBrowseLayers&&A.push({value:"browselayers",label:I.i18n.browseLayers}));(!0===X&&1<A.length||!1===X&&0<A.length)&&T.addOption(A)}},_isCustomAnalysisQuery:function(A){var I='title:"Living Atlas Analysis Layers" AND owner:esri',
T=!1;A&&A.isSingleTenant&&(I='title:"Living Atlas Analysis Layers" AND owner:esri_livingatlas');A.portalSelf&&A.portalSelf.analysisLayersGroupQuery&&A.portalSelf.analysisLayersGroupQuery!==I?T=!0:A._portal&&A._portal.analysisLayersGroupQuery&&A._portal.analysisLayersGroupQuery!==I&&(T=!0);return T},getMaxInputByMode:function(A){if(A&&A.units&&A.type&&A.limits&&A.travelMode){var I,T=A.limits.maximumBreakDistanceValue,Q=A.limits.maximumBreakDistanceValueUnits,Z=A.limits.maximumBreakTimeValue,X=A.limits.maximumBreakTimeValueUnits,
ca=this.isWalkingTravelMode(A.travelMode.travelMode);ca&&(T=A.limits.maximumBreakWalkingDistanceValue,Q=A.limits.maximumBreakWalkingDistanceValueUnits,Z=A.limits.maximumBreakWalkingTimeValue,X=A.limits.maximumBreakWalkingTimeValueUnits);"reachableStreets"===A.alternateLimits&&(X=this.generateLimitsForReachableStreets({limits:A.limits,isWalking:ca}),T=X.driveDistanceLimit,Q=X.driveDistanceUnit,Z=X.driveTimeLimit,X=X.driveTimeUnit);"unreachableAreas"===A.alternateLimits&&(X=this.generateLimitsForUnreachableAreas({limits:A.limits,
isWalking:ca}),T=X.driveDistanceLimit,Q=X.driveDistanceUnit,Z=X.driveTimeLimit,X=X.driveTimeUnit);Z*=this.perMinute(X);T*=this.perMile(Q);"StraightLine"===A.type?"Miles"===A.units?I=1E3:"Yards"===A.units?I=176E4:"Kilometers"===A.units?I=B.format(1609.344,{places:2}):"Meters"===A.units?I=B.format(1609344,{places:2}):"Feet"===A.units&&(I=528E4):this.isDistanceMode(A.travelMode)?"Miles"===A.units?I=T:"Yards"===A.units?I=1760*T:"Kilometers"===A.units?I=B.format(1.609344*T,{places:2}):"Meters"===A.units?
I=B.format(1609.344*T,{places:2}):"Feet"===A.units&&(I=5280*T):this.isTimeMode(A.travelMode)&&("Minutes"===A.units?I=Z:"Seconds"===A.units?I=60*Z:"Hours"===A.units&&(I=Z/60));return"string"===typeof I?B.parse(I):parseFloat(I)}},isWalkingTravelMode:function(A){if(A&&A.restrictionAttributeNames)return A.restrictionAttributeNames.some(function(I){return"walking"===I.toLowerCase()})},isDistanceMode:function(A){return"Distance"===A.units},isTimeMode:function(A){return"Time"===A.units},generateLimitsForUnreachableAreas:function(A){var I=
{driveDistanceLimit:null,driveDistanceUnit:null,driveTimeLimit:null,driveTimeUnit:null};A.isWalking?(I.driveDistanceLimit=A.limits.maximumBreakWalkingDistanceValueDetailedPolygons,I.driveDistanceUnit=A.limits.maximumBreakWalkingDistanceValueUnitsDetailedPolygons,I.driveTimeLimit=A.limits.maximumBreakWalkingTimeValueDetailedPolygons,I.driveTimeUnit=A.limits.maximumBreakWalkingTimeValueUnitsDetailedPolygons):(I.driveDistanceLimit=A.limits.maximumBreakDistanceValueDetailedPolygons,I.driveDistanceUnit=
A.limits.maximumBreakDistanceValueUnitsDetailedPolygons,I.driveTimeLimit=A.limits.maximumBreakTimeValueDetailedPolygons,I.driveTimeUnit=A.limits.maximumBreakTimeValueUnitsDetailedPolygons);return I},generateLimitsForReachableStreets:function(A){var I={driveDistanceLimit:null,driveDistanceUnit:null,driveTimeLimit:null,driveTimeUnit:null};A.isWalking?(I.driveDistanceLimit=A.limits.maximumBreakWalkingDistanceValueServiceAreaLines,I.driveDistanceUnit=A.limits.maximumBreakWalkingDistanceValueUnitsServiceAreaLines,
I.driveTimeLimit=A.limits.maximumBreakWalkingTimeValueServiceAreaLines,I.driveTimeUnit=A.limits.maximumBreakWalkingTimeValueUnitsServiceAreaLines):(I.driveDistanceLimit=A.limits.maximumBreakDistanceValueServiceAreaLines,I.driveDistanceUnit=A.limits.maximumBreakDistanceValueUnitsServiceAreaLines,I.driveTimeLimit=A.limits.maximumBreakTimeValueServiceAreaLines,I.driveTimeUnit=A.limits.maximumBreakTimeValueUnitsServiceAreaLines);return I},updateModeConstraints:function(A){if(A&&A.validateWidget&&A.units&&
A.type&&A.travelMode){var I=A.validateWidget.get("constraints");I.max=this.getMaxInputByMode(A);A.validateWidget.set(I)}},getTravelModes:function(A){var I=new F,T,Q,Z,X;da.isDefined(this.travelModes)&&0<this.travelModes.length?I.resolve(this.travelModes):A&&A.widget?A.widget.signInPromise.then(d.hitch(this,function(ca){(X=A.widget.get("helperServices"))&&X.routingUtilities?(Z=X.routingUtilities.url,T="sync"):T=A.widget._getSelf(A.widget.portalUrl);r(T,d.hitch(this,function(ma){ma&&ma.helperServices&&
ma.helperServices.routingUtilities&&(Z=ma.helperServices.routingUtilities.url);da.isDefined(Z)?(Q=new M(Z+"/GetTravelModes"),Q.execute({}).then(d.hitch(this,function(na){this.travelModes=m.map(na[0].value&&na[0].value.features,function(sa){return c.fromJson(sa.attributes.TravelMode)});na[1]&&na[1].paramName&&"defaultTravelMode"===na[1].paramName&&(this.defaultTravelModeId=na[1].value);I.resolve(this.travelModes)}),d.hitch(this,function(na){I.reject(na)}))):I.reject(Error("Missing Routing Utility Service to get Travel Modes"))}),
function(ma){I.reject(ma)})})):I.reject(Error("Missing parameter: params.widget required parameter"));return I.promise},populateTravelModes:function(A){if(A&&A.selectWidget&&A.widget){var I=[],T=A.allowmode||"all",Q=!1;this.initI18n();A.addStraightLine&&I.push({value:"StraightLine",label:'\x3cdiv class\x3d"esriFloatLeading bufferIcon esriStraightLineDistanceIcon"\x3e\x3c/div\x3e\x3cdiv class\x3d"esriLeadingMargin4" style\x3d"height:20px;margin-top:10px;"\x3e'+this.i18n.straightLineDistance+"\x3c/div\x3e",
selected:A.value&&"StraightLine"===A.value});this.getTravelModes({widget:A.widget}).then(d.hitch(this,function(Z){var X=da.isDefined(A.enableTravelModes)&&!A.enableTravelModes;m.forEach(Z,function(ca,ma){ma=this.createOptionForTravelMode(ca,{name:ca.name,disabled:X,separator:A.separator});this.isTravelModeAllowed(T,ma.units)&&("all"!==T&&(ma.value=ma.value.replace(ma.units,"")),A.value&&A.value.id===ca.id?U(A.value,ca)&&(ma.selected=!ma.disabled,Q=!0):!A.value&&A.selectDefaultMode&&this.defaultTravelModeId&&
this.defaultTravelModeId===ca.id&&(ma.selected=!0),I.push(ma))},this);!Q&&this.isRequiredToAddTravelMode(A)&&this.isTravelModeAllowed(T,this.getTravelModeUnits(A.value))&&I.push(this.getOptionForCustomTravelMode(A,X));A.selectWidget.removeOption();A.selectWidget.addOption(I);A.widget.emit("travelmodes-added",{travelOptions:I})}),d.hitch(this,function(Z){I&&0<I.length&&(A.selectWidget.removeOption(),A.selectWidget.addOption(I),A.widget.emit("travelmodes-added",{travelOptions:I}))}))}},getTravelModeLabel:function(A,
I){I=I?I:A.name;return'\x3cdiv class\x3d"esriFloatLeading bufferIcon esri'+this.getTravelModei18nKey(A.type)+this.getTravelModeUnits(A)+'Icon"\x3e\x3c/div\x3e\x3cdiv class\x3d"esriLeadingMargin4" style\x3d"height:20px;margin-top:10px;" title\x3d"'+A.description+'"\x3e'+I+"\x3c/div\x3e"},getTravelModeUnits:function(A){var I=A.units||name.split(/\s/)[1];return I=A.impedanceAttributeName===A.timeAttributeName?"Time":A.impedanceAttributeName===A.distanceAttributeName?"Distance":"Other"},getTravelModeValue:function(A,
I){return A.replace(/\s/g,I||"")},getTravelModei18nKey:function(A){return"AUTOMOBILE"===A?"Driving":"TRUCK"===A?"Trucking":"WALK"===A?"Walking":"Other"},isTravelModeAllowed:function(A,I){return"all"===A||A.toLowerCase()===I.toLowerCase()},isRequiredToAddTravelMode:function(A){return A.widget.rerun&&"StraightLine"!==A.value},isTrafficBasedTravelMode:function(A){var I=this.getTravelModei18nKey(A.type).toLowerCase();return"time"===this.getTravelModeUnits(A).toLowerCase()&&("driving"===I||"trucking"===
I)},getOptionForCustomTravelMode:function(A,I){A=this.createOptionForTravelMode(A.value,{name:"\x26lt"+A.value.name+"\x26gt",disabled:I,separator:A.separator});A.selected=!0;return A},createOptionForTravelMode:function(A,I){return{label:this.getTravelModeLabel(A,I.name),value:this.getTravelModeValue(I.name,I.separator),travelMode:A,disabled:I.disabled,modei18nKey:this.getTravelModei18nKey(A.type).toLowerCase(),units:this.getTravelModeUnits(A)}},updateDisplay:function(A,I,T){(new v.NodeList(A)).style("display",
I?T?T:"block":"none")},isGreaterThanZero:function(){return 0<this.get("value")},getExprFunctions:function(){this.i18n||this.initI18n();this.exprFunctions||(this.exprFunctions=[{type:"NumType",label:p.substitute(this.i18n.asMetersFunc,{functionName:"as_meters(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"as_meters()"},{type:"NumType",label:p.substitute(this.i18n.asKilometersFunc,{functionName:"as_kilometers(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"as_kilometers()"},
{type:"NumType",label:p.substitute(this.i18n.asFeetFunc,{functionName:"as_feet(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"as_feet()"},{type:"NumType",label:p.substitute(this.i18n.asYardsFunc,{functionName:"as_yards(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"as_yards()"},{type:"NumType",label:p.substitute(this.i18n.asMilesFunc,{functionName:"as_miles(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"as_miles()"},{type:"NumType",label:p.substitute(this.i18n.asNuaticalMilesFunc,
{functionName:"as_nautical_miles(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"as_nautical_miles()"},{type:"NumType",label:p.substitute(this.i18n.absFunc,{functionName:"abs(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"abs()"},{type:"NumType",label:p.substitute(this.i18n.logFunc,{functionName:"log(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"log()"},{type:"NumType",label:p.substitute(this.i18n.sinFunc,{functionName:"sin(\x3ci\x3enumber\x3c/i\x3e)",
num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"sin()"},{type:"NumType",label:p.substitute(this.i18n.cosFunc,{functionName:"cos(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"cos()"},{type:"NumType",label:p.substitute(this.i18n.tanFunc,{functionName:"tan(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"tan()"},{type:"NumType",label:p.substitute(this.i18n.squareRootFunc,{functionName:"sqrt(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"sqrt()"},
{type:"NumType",label:p.substitute(this.i18n.minFunc,{functionName:"min(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"min()"},{type:"NumType",label:p.substitute(this.i18n.maxFunc,{functionName:"max(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"max()"},{type:"NumType",label:p.substitute(this.i18n.constrainFunc,{functionName:"constrain(\x3ci\x3enumber\x3c/i\x3e, \x3ci\x3elow\x3c/i\x3e, \x3ci\x3ehigh\x3c/i\x3e",num:"\x3ci\x3enumber\x3c/i\x3e",low:"\x3ci\x3elow\x3c/i\x3e",
high:"\x3ci\x3ehigh\x3c/i\x3e"}),name:"constrain(,,)"},{type:"NumType",label:p.substitute(this.i18n.iffFunc,{functionName:"iif(\x3ci\x3econdition\x3c/i\x3e,\x3ci\x3evalue if TRUE\x3c/i\x3e,\x3ci\x3evalue if FALSE\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"iif(,,)"},{type:"NumType",label:p.substitute(this.i18n.whenFunc,{functionName:"when(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"when(,)"},{type:"NumType",label:p.substitute(this.i18n.decodeFunc,{functionName:"decode(\x3ci\x3eexpression\x3c/i\x3e, \x3ci\x3ecase1,return1,..caseN,returnN\x3c/i\x3e, \x3ci\x3edefault\x3c/i\x3e)",
num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"decode(,,,)"}]);return this.exprFunctions},addAttributeOptions:function(A){this.initI18n();da.isDefined(A.allowSelectLabel)||(A.allowSelectLabel=!0);var I=[],T=da.isDefined(A.emptyValue)?A.emptyValue:"";if(A.allowNumericType||void 0===A.allowNumericType)I=[ia.FieldTypes.Short,ia.FieldTypes.Integer,ia.FieldTypes.Float,ia.FieldTypes.Double];var Q=A.layer;var Z=A.selectWidget;var X=Q?Q.fields:[];Z.removeOption(Z.getOptions());A.allowSelectLabel&&Z.addOption({value:T,
label:this.i18n.attribute});A.allowStringType&&I.push(ia.FieldTypes.String);A.allowDateType&&I.push(ia.FieldTypes.Date);var ca=[];m.forEach(X,function(ma){-1!==m.indexOf(I,ma.type)&&ma.name!==Q.objectIdField&&ca.push({value:ma.name,label:da.isDefined(ma.alias)&&""!==ma.alias?ma.alias:ma.name,type:ma.type===ia.FieldTypes.String?ia.PseudoFieldTypes.String:ma.type===ia.FieldTypes.Date?ia.PseudoFieldTypes.Date:ia.PseudoFieldTypes.Number})},this);if(0===ca.length)return!1;Z.addOption(ca);da.isDefined(A.priorityChange)?
Z.set("value",T,A.priorityChange):Z.set("value",T);Z.set("disabled",!Q||0===Q.fields.length);return!0},addStatisticsOptions:function(A){this.initI18n();var I=A.selectWidget,T=[{value:"SUM",label:this.i18n.sum},{value:"MIN",label:this.i18n.minimum},{value:"MAX",label:this.i18n.maximum},{value:"MEAN",label:A.showGeoAnalyticsParams?this.i18n.mean:this.i18n.average},{value:"STDDEV",label:this.i18n.standardDev}],Q=[{value:"MIN",label:this.i18n.minimum},{value:"MAX",label:this.i18n.maximum}],Z=[{value:"First",
label:this.i18n.first},{value:"Last",label:this.i18n.last}],X=da.isDefined(A.emptyValue)?A.emptyValue:"";I.removeOption(I.getOptions());I.addOption([{value:X,label:this.i18n.statistic}]);A.showGeoAnalyticsParams&&(I.addOption({value:"COUNT",label:this.i18n.count}),T.push({value:"VARIANCE",label:this.i18n.variance}),T.splice(4,0,{value:"RANGE",label:this.i18n.range}));A.showFirstLastStats&&I.addOption(Z);A.type&&"number"!==A.type?A.type&&"string"===A.type?(I.addOption({value:"ANY",label:this.i18n.any}),
A.selectWidget.optionsType="string"):A.type&&"date"===A.type&&(I.addOption(Q),A.selectWidget.optionsType="date"):(I.addOption(T),A.selectWidget.optionsType="number");I.set("value",X)},addFillOptions:function(A){var I=A.selectWidget,T=[{value:"ZEROES",label:this.i18n.zeroes},{value:"SPATIAL_NEIGHBORS",label:this.i18n.spatialneighbhors},{value:"SPACE_TIME_NEIGHBORS",label:this.i18n.spacetimeneighbors},{value:"TEMPORAL_TREND",label:this.i18n.temporaltrend}];I.removeOption(I.getOptions());I.addOption([{value:"0",
label:this.i18n.fill}]);A.type&&"number"!==A.type||I.addOption(T)},perMeter:function(A){var I=1;switch(A){case fa.MILLIMETERS:I=1E3;break;case fa.CENTIMETERS:I=100;break;case fa.DECIMETERS:I=10;break;case fa.METERS:I=1;break;case fa.KILOMETERS:I=.001;break;case fa.INCHES:I=39.370079;break;case fa.FEET:I=3.2808399;break;case fa.YARDS:I=1.0936133;break;case fa.MILES:I=6.2137119E-4;break;case fa.NAUTICAL_MILES:I=5.399568E-4;break;case fa.ACRES:I=2.4710538E-4;break;case fa.ARES:I=.01;break;case fa.HECTARES:I=
1E-4;break;case fa.SQUARE_INCHES:I=1550.0031;break;case fa.SQUARE_FEET:I=10.7639104;break;case fa.SQUARE_YARDS:I=1.19599005;break;case fa.SQUARE_MILES:I=3.86102159E-7;break;case fa.SQUARE_NAUTICAL_MILES:I=2.9155335E-7;break;case fa.SQUARE_MILLIMETERS:I=1E6;break;case fa.SQUARE_CENTIMETERS:I=1E4;break;case fa.SQUARE_DECIMETERS:I=100;break;case fa.SQUARE_METERS:I=1;break;case fa.SQUARE_KILOMETERS:I=1E-6}return I},perMile:function(A){var I=1;switch(A){case "Feet":I=1.89394E-4;break;case "Yards":I=5.68182E-4;
break;case "Meters":I=6.21371E-4;break;case "Kilometers":I=.621371}return I},perMinute:function(A){var I=1;switch(A){case "Seconds":I=.0166667;break;case "Hours":I=60}return I},getType:function(A){var I=null;switch(A){case fa.ACRES:I=2;break;case fa.ARES:I=2;break;case fa.CENTIMETERS:I=1;break;case fa.DECIMETERS:I=1;break;case fa.FEET:I=1;break;case fa.HECTARES:I=2;break;case fa.INCHES:I=1;break;case fa.KILOMETERS:I=1;break;case fa.METERS:I=1;break;case fa.MILES:I=1;break;case fa.MILLIMETERS:I=1;
break;case fa.NAUTICAL_MILES:I=1;break;case fa.SQUARE_CENTIMETERS:I=2;break;case fa.SQUARE_DECIMETERS:I=2;break;case fa.SQUARE_FEET:I=2;break;case fa.SQUARE_INCHES:I=2;break;case fa.SQUARE_KILOMETERS:I=2;break;case fa.SQUARE_METERS:I=2;break;case fa.SQUARE_MILES:I=2;break;case fa.SQUARE_MILLIMETERS:I=2;break;case fa.SQUARE_NAUTICAL_MILES:I=2;break;case fa.SQUARE_YARDS:I=2;break;case fa.YARDS:I=1;break;default:I=0}return I},unitConversion:function(A,I,T){var Q=!0;da.isDefined(A)||(this.emitError("The 'From' Value must be a valid numeric value: "+
A),Q=!1);da.isDefined(I)||(this.emitError("The 'From' Units must be defined: "+I),Q=!1);da.isDefined(T)||(this.emitError("The 'To' Units must be defined: "+T),Q=!1);A instanceof Array&&(this.emitError("Only single 'From' Value supported: "+A),Q=!1);I instanceof Array&&(this.emitError("Only single 'From' Units supported: "+I),Q=!1);T instanceof Array&&(this.emitError("Only single 'To' Units supported: "+T),Q=!1);var Z=this.getType(I),X=this.getType(T);0===Z&&(this.emitError("Unsupported 'From' Units: "+
I),Q=!1);0===X&&(this.emitError("Unsupported 'To' Units: "+T),Q=!1);Z!==X&&(this.emitError("Incompatible 'From' and 'To' Units: "+I+" and "+T),Q=!1);return Q?I===T?+A:+A/this.perMeter(I)*this.perMeter(T):Number.NaN},emitError:function(A){console.log("error",Error(A))},isEmpty:function(A){for(var I in A)if(A.hasOwnProperty(I))return!1;return l.stringify(A)===l.stringify({})},getRoutingUtilities:function(A){var I=new F,T={},Q,Z,X,ca;A||I.reject(Error("Missing parameter: widget required parameter"));
-1!==m.indexOf(["CreateDriveTimeAreas","EnrichLayer","SummarizeNearby"],A.toolName)?d.mixin(T,{toolName:"GenerateServiceAreas",serviceName:"asyncServiceArea"}):A.toolName===ia.Tools.ChooseBestFacilities?d.mixin(T,{toolName:"SolveLocationAllocation",serviceName:"asyncLocationAllocation"}):"PlanRoutes"===A.toolName?d.mixin(T,{toolName:"SolveVehicleRoutingProblem",serviceName:"asyncVRP"}):"FindNearest"===A.toolName?d.mixin(T,{toolName:"FindClosestFacilities",serviceName:"asyncClosestFacility"}):"ConnectOriginsToDestinations"===
A.toolName&&d.mixin(T,{toolName:"FindRoutes",serviceName:"asyncRoute"});this.routingUtilities||(this.routingUtilities={});this.routingUtilities&&this.routingUtilities[A.toolName]?I.resolve(this.routingUtilities[A.toolName]):A.signInPromise.then(d.hitch(this,function(ma){(ca=A.get("helperServices"))&&ca.routingUtilities?(X=ca.routingUtilities.url,Q="sync"):Q=A._getSelf(A.portalUrl);r(Q,d.hitch(this,function(na){na&&na.helperServices&&na.helperServices.routingUtilities&&(X=na.helperServices.routingUtilities.url);
da.isDefined(X)||I.reject(Error("Missing Routing Utility Service to get Network Analysis Service Limits."));Z=new M(X+"/GetToolInfo");Z.execute(T).then(d.hitch(this,function(sa){sa&&0<sa.length&&sa[0].value?(this.routingUtilities[A.toolName]=sa[0].value,I.resolve(sa[0].value)):I.reject("Routing Utility Service 'GetToolInfo' job did not return service limits.")}),function(sa){I.reject(sa)})}))}),function(ma){I.reject(ma)});return I.promise},getNetworkAnalysisLimits:function(A){var I=new F;A||I.reject(Error("Missing parameter: widget required parameter"));
this.getRoutingUtilities(A).then(d.hitch(this,function(T){T.serviceLimits?I.resolve(T.serviceLimits):I.reject()}),function(T){I.reject(T)});return I.promise},isEsriWorldGeocoder:function(A){var I=this.isAgoWorldGeocodeServer(A);A=this.isAgoWorldGeocodeServerProxy(A);return I||A},isAgoWorldGeocodeServer:function(A){return A&&!!A.match(/(arcgis.com\/arcgis\/rest\/services\/world\/geocodeserver).*/ig)},isCustomGeoEnrichmentServer:function(A,I){var T=(A||"").toLowerCase();A=-1<T.indexOf("/geoenrichmentserver")&&
-1<T.indexOf("/servers/")&&-1<T.indexOf("/rest/services/");I=!I&&T.indexOf("utility")&&-1<T.indexOf(".arcgis.com");return A&&I},isAgoWorldGeocodeServerProxy:function(A){return A&&!!A.match(/(\/servers\/[\da-z\.-]+\/rest\/services\/world\/geocodeserver).*/ig)},isWorldGeoLocator:function(A){return A&&!!A.match(/(\/rest\/services\/world\/geocodeserver).*/ig)},showMessages:function(A,I,T){b.set(I,"innerHTML",A);f.fadeIn({node:T,easing:D.quadIn,onEnd:d.hitch(this,function(){u.set(T,{display:""})})}).play()},
hideMessages:function(A){f.fadeOut({node:A,easing:D.quadOut,onEnd:function(){u.set(A,{display:"none"})}}).play()},getHelpUrl:function(A){if(A.topic&&A.widget){var I;A.widget.portalSelf&&A.widget.portalSelf.helpBase?I=A.widget.portalSelf.helpBase+"index.html#":!A.widget.isSingleTenant||A.widget.portalSelf&&A.widget.portalSelf.helpBase||(I="http://server.arcgis.com/en/portal/latest/use/");"BufferExpression"===A.topic&&(I+="Use_expressions_with_GeoAnalytics_Tools/019300000183000000/");return I}},isPCS:function(A){return!!A&&
!!ka&&-1!==m.indexOf(ka,A)},isPCSByLayerType:function(A){var I=!!A&&!!A.fullExtent&&this.isPCS(A.fullExtent.spatialReference.wkid);!I&&A.extent&&(I=!!A&&!!A.extent&&this.isPCS(A.extent.spatialReference.wkid));!I&&A.spatialReference&&(I=!!A&&!!A.spatialReference&&this.isPCS(A.spatialReference.wkid));return I},checkPCSforAnalysis:function(A){var I=A.widget&&A.widget.toolName,T=!!A.widget&&!!A.widget.context&&!!A.widget.context.processSR&&this.isPCS(A.widget.context.processSR.wkid),Q=!0,Z=A.jobParams||
A.widget.jobParams,X=!!A.widget&&!!A.widget.context&&!!A.widget.context.processSR&&!!A.widget.context.processSR.wkid;if(!I||!Z||!A.widget.showGeoAnalyticsParams)return!1;var ca="\x3ca  href\x3d'#' id\x3d'"+A.widget.id+"_warn_settings_link'\x3e"+A.widget.i18n.analysisSettings+"\x3c/a\x3e\x3cdiv class\x3d'esriAnalysisSettingsIcon'\x3e\x3c/div\x3e";var ma=p.substitute(A.widget.i18n.PCSReqMsg,{defaultSpatialRef:A.widget.i18n.worldCylindrical,settingsIcon:ca});"FindHotSpots"!==I&&"FindPointClusters"!==
I||T?"CalculateDensity"!==I&&"FindPointClusters"!==I&&"GeographicallyWeightedRegression"!==I||T?"AggregatePoints"!==I||-1===m.indexOf(["HEXAGON","SQUARE"],Z.binType)||T?"SummarizeWithin"===I&&Z.summaryPolygons&&!T?Q=this.isPCSByLayerType(A.widget.sumWithinLayer):"SummarizeWithin"!==I||-1===m.indexOf(["HEXAGON","SQUARE"],Z.binType)||T?"JoinFeatures"===I&&Z.spatialNearDistance&&"Near"===Z.spatialRelationship&&!T?(Q=this.isPCSByLayerType(A.widget.targetLayer))||(ma=p.substitute(A.widget.i18n.JFPCSReqMsg,
{settingsIcon:ca})):"BuildMultiVariableGrid"!==I||T?"CalculateMotionStatistics"===I&&"Planar"===Z.distanceMethod&&(1<Z.motionStatistics.split(",").length||1===Z.motionStatistics.split(",").length&&-1===Z.motionStatistics.indexOf("Duration"))&&!T?(Q=this.isPCSByLayerType(A.widget.inputLayer))||(ma=p.substitute(A.widget.i18n.CMSPCSReqMsg,{settingsIcon:ca})):"TraceProximityEvents"!==I||"Planar"!==Z.distanceMethod||T||(Q=this.isPCSByLayerType(A.widget.inputLayer))||(ma=p.substitute(A.widget.i18n.TPEPCSReqMsg,
{settingsIcon:ca})):Q=m.every(A.inputLayers,function(na){return this.isPCSByLayerType(na)},this):Q=this.isPCSByLayerType(A.widget.summaryLayer):Q=this.isPCSByLayerType(A.widget.pointLayer):(Q=this.isPCSByLayerType(A.widget.inputLayer),"GeographicallyWeightedRegression"!==I||Q||(ma=p.substitute(A.widget.i18n.GWRPCSReqMsg,{settingsIcon:ca}))):(Q=this.isPCSByLayerType(A.widget.analysisLayer),"FindPointClusters"!==I||Q||(ma=p.substitute(A.widget.i18n.FPCSReqMsg,{settingsIcon:ca})));Q||A.hasPCSWarnShown||
(A.widget.set("disableRunAnalysis",Q),this.settingsVM&&this.settingsDlg&&A.widget._bodyNode&&A.widget._errorMessagePane&&(this.showMessages(ma,A.widget._bodyNode,A.widget._errorMessagePane),t.byId(A.widget.id+"_warn_settings_link")&&C(t.byId(A.widget.id+"_warn_settings_link"),"click",d.hitch(A.widget,A.widget.showSettingsDlg))));!Q&&A.hasPCSWarnShown&&X&&(Q=!0);return Q},tryParseJSON:function(A){try{var I=l.parse(A);if(I&&"object"===typeof I&&null!==I)return I}catch(T){}return!1},decodeTag:function(A){return{"\x26lt;":"\x3c",
"\x26gt;":"\x3e"}[A]||A},stringDecode:function(A){return A.replace(/(&lt;|&gt;)/g,this.decodeTag)},jobParamsToWidgetProps:function(A){if(A&&A.jobParams){var I=A.jobParams,T=new F,Q=[],Z=[],X;for(X in I){var ca;I.hasOwnProperty(X)&&("string"===typeof I[X]&&-1!==I[X].search(/(&lt;|&gt;)/g)&&(I[X]=this.stringDecode(I[X])),ca="string"===typeof I[X]?this.tryParseJSON(I[X]):I[X])&&(-1!==X.toLowerCase().indexOf("layer")&&"object"===typeof ca?Z.push({key:X,obj:ca}):ca&&(ca.Raster||ca.url)&&Z.push({key:X,
obj:ca}),I[X]=ca)}for(X=0;X<Z.length;X++){ca=Z[X].obj;var ma=Z[X].key;"object"===typeof ca&&ca.length?(I[ma]=[],m.forEach(ca,function(na,sa){this._getFlayers(na,ma,I,Q,!0,sa)},this)):"object"===typeof ca&&ca.Raster?(ca.url=ca.Raster.url,this._getFlayers(ca,ma,I,Q,!0,"Raster")):this._getFlayers(ca,ma,I,Q)}y(Q).then(d.hitch(this,function(){T.resolve(A)}),d.hitch(this,function(){T.resolve(A)}));return T.promise}},_getLayerType:function(A){return A?-1!==A.indexOf("BigDataCatalogServer")?ja.BIGDATA:-1!==
A.indexOf("ImageServer")?ja.IS:ja.FS:null},_getFlayers:function(A,I,T,Q,Z,X){if(A.url){var ca=S({url:A.url,content:{f:"json"}});var ma=new F;Q.push(ma);ca.then(d.hitch(this,function(na,sa,Ba,wa,ta){var ua=this._getLayerType(na.url);if(ua===ja.FS){var ra=new O(na.url,{mode:O.MODE_ONDEMAND,outFields:["*"],resourceInfo:ta});na.filter&&ra.setDefinitionExpression(na.filter);ra.filter=na.filter}else ua===ja.BIGDATA?(ra=ta,d.mixin(ra,na)):ua===ja.IS&&(ta=na.Raster||na,ra=new R(ta.url),ta.renderingRule&&
ra.setRenderingRule(new qa(ta.renderingRule)),ta.name&&(ra.name=ta.name),na.Raster&&na.Raster.url===na.url&&delete na.url);na.name&&(ra.name=na.name);Z?T[sa][wa]=ra:Z&&ua===ja.IS?d.mixin(T[sa][wa],ra):T[sa]=ra;Ba.resolve()},A,I,ma,X),d.hitch(this,function(na,sa,Ba,wa,ta){na={name:na.name,empty:!0};Z?T[sa][wa]=na:T[sa]=na;Ba.resolve()},A,I,ma,X))}else Q=new O(A,{outFields:["*"]}),A.name&&(Q.name=A.name),Z?T[I][X]=Q:T[I]=Q},isLayerInLayers:function(A,I){return m.some(I,function(T){return this.isSameLayer(A,
T)},this)},addBlankOption:function(A,I){I&&I.length?I.push({value:"  ",label:""}):A.addOption({value:"  ",label:""});setTimeout(d.hitch(this,this._validateSelectUI,A),100)},_validateSelectUI:function(A){A._hasBeenBlurred=!0;A.set("focused",!0);A.validate();A.set("focused",!1);A._hasBeenBlurred=!1;setTimeout(d.hitch(this,function(){A.reset()}),1E3)},updateExpressions:function(A){A&&A.selectedInputLayers&&A.inputLayers&&A.data&&A.expressions&&(m.forEach(A.selectedInputLayers,function(I,T){m.forEach(A.inputLayers,
function(Q,Z){Q&&I&&(!I.url&&!Q.url&&I.name===Q.name||I.url&&Q.url&&I.url===Q.url)&&(I._oldIndex=T,I._newIndex=Z)})}),m.forEach(A.data,function(I,T){0<T&&I&&(T=A.expressions[T-1],da.isDefined(I.layer)&&(I.layer=T&&T.layer),da.isDefined(I.selectingLayer)&&(I.selectingLayer=T&&T.selectingLayer))}),m.forEach(A.data,function(I){var T=!1,Q=!1;m.forEach(A.selectedInputLayers,function(Z){da.isDefined(I.layer)&&I.layer===Z._oldIndex&&!T&&(I.layer=Z._newIndex,T=!0);da.isDefined(I.selectingLayer)&&I.selectingLayer===
Z._oldIndex&&!Q&&(I.selectingLayer=Z._newIndex,Q=!0)},this)},this))},isBigDataTypeTobeAdded:function(A){return-1==m.indexOf(A,'type:"Big Data File Share"')?!0:!1},removeDuplicates:function(A,I){for(var T=[],Q={},Z=0;Z<A.length;Z++)Q[A[Z]]?Q[A[Z]]+=1:(T.push(A[Z]),Q[A[Z]]=1);return I?Q:T},isPoint:function(A){return A&&A.geometryType===ia.GeometryTypes.Point},isLine:function(A){return A&&A.geometryType===ia.GeometryTypes.Line},isPolygon:function(A){return A&&A.geometryType===ia.GeometryTypes.Polygon},
isSameLayer:function(A,I){return A&&I&&(A.name&&I.name&&A.name===I.name||A.url&&I.url&&A.url===I.url)},getTimeType:function(A){return A?da.isDefined(A.timeInfo)&&da.isDefined(A.timeInfo.startTimeField)&&!da.isDefined(A.timeInfo.endTimeField)?ia.TimeTypes.Instant:da.isDefined(A.timeInfo)&&da.isDefined(A.timeInfo.startTimeField)&&da.isDefined(A.timeInfo.endTimeField)?ia.TimeTypes.Interval:da.isDefined(A.time)&&da.isDefined(A.time.timeType)?A.time.timeType:!1:!1},fetchGroupForRFT:function(A){var I=new F,
T=a.locale,Q=T?T.substring(0,2):"en";T=this.systemRFTGroupName+" owner: ("+("en"===Q?["esri_en"]:["esri_en","esri_"+Q]).join(" OR ")+")";A.queryGroups({q:T},!0).then(function(Z){0<Z.total&&Z.results?(Z=Z.results,Z=this.findRFTLocaleGroup(Z,Q)||this.findRFTLocaleGroup(Z,"en"),I.resolve(Z)):I.resolve(null)}.bind(this));return I},findRFTLocaleGroup:function(A,I){var T;A.some(function(Q){var Z=Q.owner;if(Z&&Z.substring(Z.length-2)===I)return T=Q,!0});return T},updateOptions:function(A,I){if(A){for(;0<
A.getOptions().length;)A.removeOption(A.getOptions());A._setDisplay("");I&&0<I.length&&A.addOption(I)}},addOptionsFromLayers:function(A){A.select&&A.layers&&(A.customOptions=A.customOptions||[],A.forbiddenLayers=A.forbiddenLayers||[],A.layers.forEach(function(I,T){this.isLayerInLayers(I,A.forbiddenLayers)||A.customOptions.push({value:T.toString(),label:I.name,selected:A.selectedOption&&this.isSameLayer(A.selectedOption,I)})},this),this.updateOptions(A.select,A.customOptions),this.addBrowseOptionForTool({select:A.select,
disableLAAL:!0},A.widget))},replaceTag:function(A){return{"\x26":"\x26amp;","\x3c":"\x26lt;","\x3e":"\x26gt;"}[A]||A},safetagsReplace:function(A){return A.replace(/[<>]/g,this.replaceTag)}});k("extend-esri")&&d.setObject("dijit.analysis.utils",H,oa);return H})},"dojo/fx/easing":function(){define(["../_base/lang"],function(H){var d={linear:function(m){return m},quadIn:function(m){return Math.pow(m,2)},quadOut:function(m){return m*(m-2)*-1},quadInOut:function(m){m*=2;return 1>m?Math.pow(m,2)/2:-1*(--m*
(m-2)-1)/2},cubicIn:function(m){return Math.pow(m,3)},cubicOut:function(m){return Math.pow(m-1,3)+1},cubicInOut:function(m){m*=2;return 1>m?Math.pow(m,3)/2:(Math.pow(m-2,3)+2)/2},quartIn:function(m){return Math.pow(m,4)},quartOut:function(m){return-1*(Math.pow(m-1,4)-1)},quartInOut:function(m){m*=2;return 1>m?Math.pow(m,4)/2:-.5*(Math.pow(m-2,4)-2)},quintIn:function(m){return Math.pow(m,5)},quintOut:function(m){return Math.pow(m-1,5)+1},quintInOut:function(m){m*=2;return 1>m?Math.pow(m,5)/2:(Math.pow(m-
2,5)+2)/2},sineIn:function(m){return-1*Math.cos(Math.PI/2*m)+1},sineOut:function(m){return Math.sin(Math.PI/2*m)},sineInOut:function(m){return-1*(Math.cos(Math.PI*m)-1)/2},expoIn:function(m){return 0==m?0:Math.pow(2,10*(m-1))},expoOut:function(m){return 1==m?1:-1*Math.pow(2,-10*m)+1},expoInOut:function(m){if(0==m)return 0;if(1==m)return 1;m*=2;if(1>m)return Math.pow(2,10*(m-1))/2;--m;return(-1*Math.pow(2,-10*m)+2)/2},circIn:function(m){return-1*(Math.sqrt(1-Math.pow(m,2))-1)},circOut:function(m){return Math.sqrt(1-
Math.pow(m-1,2))},circInOut:function(m){m*=2;return 1>m?-.5*(Math.sqrt(1-Math.pow(m,2))-1):.5*(Math.sqrt(1-Math.pow(m-2,2))+1)},backIn:function(m){return Math.pow(m,2)*(2.70158*m-1.70158)},backOut:function(m){--m;return Math.pow(m,2)*(2.70158*m+1.70158)+1},backInOut:function(m){m*=2;if(1>m)return Math.pow(m,2)*(3.5949095*m-2.5949095)/2;m-=2;return(Math.pow(m,2)*(3.5949095*m+2.5949095)+2)/2},elasticIn:function(m){if(0==m||1==m)return m;--m;return-1*Math.pow(2,10*m)*Math.sin(2*(m-.075)*Math.PI/.3)},
elasticOut:function(m){return 0==m||1==m?m:Math.pow(2,-10*m)*Math.sin(2*(m-.075)*Math.PI/.3)+1},elasticInOut:function(m){if(0==m)return 0;m*=2;if(2==m)return 1;var n=.3*1.5,q=n/4;if(1>m)return--m,-.5*Math.pow(2,10*m)*Math.sin(2*(m-q)*Math.PI/n);--m;return.5*Math.pow(2,-10*m)*Math.sin(2*(m-q)*Math.PI/n)+1},bounceIn:function(m){return 1-d.bounceOut(1-m)},bounceOut:function(m){return m<1/2.75?7.5625*Math.pow(m,2):m<2/2.75?7.5625*Math.pow(m-1.5/2.75,2)+.75:m<2.5/2.75?7.5625*Math.pow(m-2.25/2.75,2)+.9375:
7.5625*Math.pow(m-2.625/2.75,2)+.984375},bounceInOut:function(m){return.5>m?d.bounceIn(2*m)/2:d.bounceOut(2*m-1)/2+.5}};H.setObject("dojo.fx.easing",d);return d})},"dojox/mvc/equals":function(){define(["dojo/_base/array","dojo/_base/lang","dojo/Stateful","./StatefulArray"],function(H,d,m,n){var q=function(f,c,a){a=a||q;var b=[a.getType(f),a.getType(c)];return b[0]!=b[1]?!1:a["equals"+b[0].replace(/^[a-z]/,function(k){return k.toUpperCase()})](f,c)};return d.setObject("dojox.mvc.equals",d.mixin(q,
{getType:function(f){return d.isArray(f)?"array":d.isFunction((f||{}).getTime)?"date":null!=f&&("[object Object]"=={}.toString.call(f)||d.isFunction((f||{}).set)&&d.isFunction((f||{}).watch))?"object":"value"},equalsArray:function(f,c){for(var a=0,b=Math.max(f.length,c.length);a<b;a++)if(!q(f[a],c[a]))return!1;return!0},equalsDate:function(f,c){return f.getTime()==c.getTime()},equalsObject:function(f,c){var a=d.mixin({},f,c),b;for(b in a)if(!(b in m.prototype||"_watchCallbacks"==b||q(f[b],c[b])))return!1;
return!0},equalsValue:function(f,c){return f===c}}))})},"dojox/mvc/StatefulArray":function(){define(["dojo/_base/lang","dojo/Stateful"],function(H,d){function m(q){q._watchElementCallbacks&&q._watchElementCallbacks(void 0,[],[]);return q}var n=function(q){q=H._toArray(q||[]);q.constructor=n;return H.mixin(q,{pop:function(){return this.splice(this.get("length")-1,1)[0]},push:function(){this.splice.apply(this,[this.get("length"),0].concat(H._toArray(arguments)));return this.get("length")},reverse:function(){return m([].reverse.apply(this,
H._toArray(arguments)))},shift:function(){return this.splice(0,1)[0]},sort:function(){return m([].sort.apply(this,H._toArray(arguments)))},splice:function(f,c){var a=this.get("length");f+=0>f?a:0;var b=Math.min(f,a),k=this.slice(f,f+c),h=H._toArray(arguments).slice(2);[].splice.apply(this,[f,c].concat(Array(h.length)));for(var g=0;g<h.length;g++)this[b+g]=h[g];this._watchElementCallbacks&&this._watchElementCallbacks(f,k,h);this._watchCallbacks&&this._watchCallbacks("length",a,a-k.length+h.length);
return k},unshift:function(){this.splice.apply(this,[0,0].concat(H._toArray(arguments)));return this.get("length")},concat:function(f){return new n([].concat.apply(this,arguments))},join:function(f){for(var c=[],a=this.get("length"),b=0;b<a;b++)c.push(this.get(b));return c.join(f)},slice:function(f,c){var a=this.get("length");c=(void 0===c?a:c)+(0>c?a:0);var b=[];for(f=f+(0>f?a:0)||0;f<Math.min(c,this.get("length"));f++)b.push(this.get(f));return new n(b)},watchElements:function(f){var c=this._watchElementCallbacks,
a=this;c||(c=this._watchElementCallbacks=function(k,h,g){for(var e=[].concat(c.list),l=0;l<e.length;l++)e[l].call(a,k,h,g)},c.list=[]);c.list.push(f);var b={};b.unwatch=b.remove=function(){for(var k=c.list,h=0;h<k.length;h++)if(k[h]==f){k.splice(h,1);break}};return b}},d.prototype,{set:function(f,c){if("length"==f)f=this.get("length"),f<c?this.splice.apply(this,[f,0].concat(Array(c-f))):c<f&&this.splice.apply(this,[c,f-c]);else{var a=this.length;d.prototype.set.call(this,f,c);a!=this.length&&d.prototype.set.call(this,
"length",this.length)}return this},isInstanceOf:function(f){return d.prototype.isInstanceOf.apply(this,arguments)||f==n}})};n._meta={bases:[d]};return H.setObject("dojox.mvc.StatefulArray",n)})},"esri/dijit/analysis/HelpWindow":function(){define("require dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/event dojo/_base/kernel dojo/aspect dojo/has dojo/dom-construct dojo/dom-class dojo/dom-attr dojo/dom-style dojo/query dojo/window dojo/dom-geometry dijit/_Widget dijit/TooltipDialog dijit/popup ../../kernel ../../lang ../../urlUtils ../../request ../_EventedWidget dojo/i18n!../../nls/jsapi".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F,y,D,B,x){m=m([z],{declaredClass:"esri.dijit.analysis.HelpWindow",i18n:null,onlineHelpMap:null,showLearnMore:!1,"class":"esriAnalyisHelpWindow",constructor:function(r){this.isPortal=r&&r.isPortal},postMixInProperties:function(){this.inherited(arguments);this.i18n={};n.mixin(this.i18n,x.common);n.mixin(this.i18n,x.analysisHelp)},postCreate:function(){this.inherited(arguments);var r=["ar","he"],t;this.onlineHelpMap={};for(t=0;t<r.length;t+=1){var C=
r[t];c.locale&&-1!==c.locale.indexOf(C)&&(-1!==c.locale.indexOf("-")?-1!==c.locale.indexOf(C+"-")&&(this._isRightToLeft=!0):this._isRightToLeft=!0)}r=H.toUrl(this.isPortal?"./help/helpmap_enterprise.json":"./help/helpmap.json");D({url:r}).then(n.hitch(this,function(J){this.onlineHelpMap=J.map}));this._initSelfHelpMap()},_getAbsoluteUrl:function(r){var t=y.getProtocolForWebResource();if(/^https?:/i.test(r))return r;if(/^\/\//i.test(r))return t+r;if(/^\//i.test(r))return t+"//"+window.location.host+
r},_computeSize:function(r){var t={w:400,h:200};b("esri-mobile")?t={w:"50%",h:"90%"}:-1!==r.indexOf("Category")?(t.w=400,t.h=320):-1!==r.indexOf("Tool")?(t.w=400,t.h=320):-1!==r.indexOf("toolDescription")&&(t.w=400,t.h=520);return t},_initSelfHelpMap:function(){this.isPortal&&this.portalSelf&&this.portalSelf.helpMap&&(this.selfHelpMap=this.portalSelf.helpMap.m)},_setHelpTopicAttr:function(r){this.tooltipHelpDlg&&(E.close(this.tooltipHelpDlg),this.tooltipHelpDlg.destroy(),this.tooltipHelpDlg=null);
var t="";this.showLearnMore=!1;var C=this._analysisGpServer&&-1!==this._analysisGpServer.indexOf("dev")?"dev":this._analysisGpServer&&-1!==this._analysisGpServer.indexOf("qa")?"uat":"";t=this.isPortal?"-PortalOnly":"-OnlineOnly";var J=n.clone(c.locale);var L="es-es es-mx fr-fr fr-ch it-ch it-it de-de de-ch".split(" ");"nb"===J?J="no":-1!==d.indexOf(L,J)&&(J=J.split("-")[0]);var P="ar bs ca cs da de es el et fi fr he hr hu id it ja ko lt lv ru nl no pl pt-br pt-pt ro sl sk sv sr th tr uk vi zh-cn zh-hk zh-tw".split(" ");
var U="ar de es fr it ja ko ru pl pt-br zh-cn".split(" ");if("SHOWHELPURL"===r)L=this.helpIdUrl,this.showLearnMore=!1;else{L=H.toUrl("esri/dijit/analysis/help/"+this.helpFileName+".html");var aa=this.helpFileName;if(F.isDefined(this.onlineHelpMap[aa])&&F.isDefined(this.onlineHelpMap[aa][r])){this.showLearnMore=!0;var ea="https://doc"+C+".arcgis.com/en/arcgis-online/analyze/"+this.onlineHelpMap[aa][r];this.isPortal&&this.helpBase&&this.selfHelpMap&&(ea=this.helpBase+this.selfHelpMap[this.onlineHelpMap[aa][r]])}-1!==
d.indexOf(P,J)&&(-1!==J.indexOf("-")&&(J=J.split("-"),J=J[0]+"-"+J[1].toUpperCase()),L=H.toUrl("esri/dijit/analysis/help/"+J+"/"+this.helpFileName+".html"));-1!==d.indexOf(U,J)&&this.showLearnMore&&(ea="https://doc"+C+".arcgis.com/"+J+"/arcgis-online/analyze/"+this.onlineHelpMap[aa][r],this.isPortal&&this.helpBase&&this.selfHelpMap?ea=this.helpBase+this.selfHelpMap[this.onlineHelpMap[aa][r]]:this.isPortal&&!this.helpBase&&(ea="https://server"+C+".arcgis.com/"+J+"/portal/latest/use/"+this.onlineHelpMap[aa][r]))}this._size=
C=this._computeSize(r);this.tooltipHelpDlg=new u({preload:!0,content:"\x3cdiv class\x3d'' style\x3d'position:relative'\x3cdiv class\x3d'sizer content'\x3e\x3cdiv class\x3d'contentPane'\x3e\x3cdiv class\x3d'esriFloatTrailing' style\x3d'padding:0;'\x3e\x3ca href\x3d'#' class\x3d'esriAnalysisCloseIcon' title\x3d'"+this.i18n.close+"'\x3e\x3c/a\x3e\x3c/div\x3e\x3ciframe frameborder\x3d'0'  id\x3d'"+r+"' src\x3d'"+L+"#"+r+t+"' width\x3d'"+C.w+"' height\x3d'"+C.h+"' marginheight\x3d'0' marginwidth\x3d'0'\x3e\x3c/iframe\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d'sizer'\x3e\x3cdiv class\x3d'actionsPane'\x3e\x3cdiv class\x3d'actionList"+
(this.showLearnMore?"'\x3e":" hidden'\x3e")+"\x3ca class\x3d'action zoomTo' href\x3d'"+(this.showLearnMore?ea:"#")+"' target\x3d'_help'\x3e"+this.i18n.learnMore+"\x3c/a\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e","class":"esriHelpPopup esriHelpPopupWrapper esriAnalyisHelpWindow"});this.tooltipHelpDlg.startup()},show:function(r,t){this.helpFileName=t.helpFileName;this._analysisGpServer=t.analysisGpServer;this.isPortal=t.isPortal;this.helpBase=t.helpBase;t.portalSelf&&(this.portalSelf=
t.portalSelf);this.selfHelpMap||this._initSelfHelpMap();t.analysisMode&&(this.analysisMode=t.analysisMode);t.showHelpFromUrl&&t.helpUrl&&(this.showHelpFromUrl=t.showHelpFromUrl,this.helpIdUrl=t.helpUrl,t.helpId="SHOWHELPURL");this.set("helpTopic",t.helpId);var C=a.after(E,"open",n.hitch(this,function(){l(".esriAnalysisCloseIcon",this.tooltipHelpDlg.domNode).on("click",n.hitch(this,this.close));C.remove()})),J=r.pageX,L=p.getBox(),P;var U=!1;if(t.helpParentNode)var aa=t.helpParentNode;aa&&(P=v.position(aa));
P&&L.w-r.pageX<P.w?(U=!0,J=P.x-this._size.w-10,this._isRightToLeft&&(J-=10)):this._isRightToLeft&&J-40<this._size.w&&(J=P.w+this._size.w+80);E.open({popup:this.tooltipHelpDlg,x:!0===this._isRightToLeft||U?J-40:J+40,y:r.screenY-r.pageY+10,onCancel:n.hitch(this,function(){this.close()}),onExecute:function(){this.close()}});this.tooltipHelpDlg.domNode.parentNode&&e.set(this.tooltipHelpDlg.domNode.parentNode,"overflowY","hidden")},close:function(r,t){E.close(this.tooltipHelpDlg)}});b("extend-esri")&&
n.setObject("dijit.analysis.HelpWindow",m,w);return m})},"esri/dijit/BrowseItems":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/window dojo/_base/event dojo/dom-class dojo/dom-style dojo/dom-attr dojo/string dojo/on dojo/aspect dojo/has dojo/dom dojo/dom-construct dojo/mouse dojo/topic dojo/query dojo/parser dijit/registry dijit/TooltipDialog dijit/popup dojo/promise/all dojo/Deferred dgrid/Grid dgrid/extensions/Pagination dgrid/extensions/DijitRegistry dgrid/OnDemandGrid dgrid/Selection dgrid/selector dgrid/Keyboard dgrid/util/mouse dgrid/util/touch put-selector/put dojo/store/Observable dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin ../arcgis/Portal ../Evented ../PluginTarget dojo/i18n!../nls/jsapi ./_AppTemplateFiltersMixin ./_RefreshMixin ../kernel ../lang ../config ../geometry/webMercatorUtils ../tasks/GeometryService ../SpatialReference dojo/NodeList-dom".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F,y,D,B,x,r,t,C,J,L,P,U,aa,ea,ba,oa,da,fa,S,W,la,K,O,G,M,N,V,Y,ka){var ja=H(null,{idProperty:"id",constructor:function(R){H.safeMixin(this,R)},get:function(R,ha){return fa.PortalUtil.request(this.portalUrl+"content/items/"+R,ha).then(function(qa){return new fa.PortalItem(d.mixin(qa,{portal:this.portal}))})},getIdentity:function(R){return R[this.idProperty]},query:function(R,ha){R=d.isObject(R)?R:{q:R};var qa=null;if(ha){R=d.mixin(R,{num:ha.count,start:(ha.start||
0)+1});if(ha.sort&&ha.sort.length){var ia=ha.sort[0];R=d.mixin(R,{sortField:encodeURIComponent("created"===ia.attribute?"uploaded":ia.attribute),sortOrder:ia.descending?"desc":"asc"})}ha.useExtent&&ha.extent&&(R.bbox=ha.extent);ha.queryType&&"group"===ha.queryType&&(qa="group")}ha="group"===qa?this.portal.queryGroups(R,!0).then(function(pa){pa.results.total=pa.total;return pa.results}):this.portal.queryItems(R,!0).then(function(pa){pa.results.total=pa.total;return pa.results});return fa.PortalResult(ha)}});
n=H([ba,oa,da,W],{templateString:'\x3cdiv\x3e\x3cdiv class\x3d"top-bar"\x3e\x3cdiv  class\x3d"esriFloatLeading instructions"\x3e\x3cspan class\x3d"messageLeft hide" data-dojo-attach-point\x3d"messageNodeLeft"\x3e\x3c/span\x3e\x3cspan class\x3d"messageRight hide" data-dojo-attach-point\x3d"messageNodeRight"\x3e\x3c/span\x3e\x3ca tabIndex\x3d"-1" data-dojo-attach-point\x3d"helpLink" class\x3d"esriHelpIcon hide" title\x3d"${i18n.browseItems.learnMoreConfigurableApps}" href\x3d"#" target\x3d"_blank"\x3e\x3c/a\x3e\x3c/div\x3e\x3cdiv id\x3d"${id}_search"class\x3d"searchBar esriFloatTrailing"\x3e\x3cinput tabIndex\x3d"1" placeholder\x3d"${i18n.browseItems.searchTitle}" class\x3d"esriSearchBox dijitTextBox" type\x3d"search"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"gallery"\x3e\x3cdiv class\x3d"gallery-left  quiet-scroll"\x3e\x3cul class\x3d"filters"\x3e\x3c/ul\x3e\x3c/div\x3e\x3cdiv class\x3d"templates gallery-right"\x3e\x3cp id\x3d"${id}_filterTitle" class\x3d"filter-title hide" data-dojo-attach-point\x3d"filterDescription"\x3e\x3c/p\x3e\x3cdiv id\x3d"${id}_grid"class\x3d"dgrid-autoheight quiet-scroll"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv  class\x3d"loaderWrap" data-dojo-attach-point\x3d"loaderWrap"\x3e\x3c/div\x3e\x3cdiv  class\x3d"js-info-panel templateInfoPanel" data-dojo-attach-point\x3d"infoPanel"\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e',
galleryTemplate:"\x3cdiv style\x3d'opacity:1;' class\x3d'grid-item gallery-view'\x3e${item:_formatThumbnail}${item:_formatItemTitle}\x3cp class\x3d\"template-overlay\" style\x3d\"display:none;\"\x3e${i18n.browseItems.selectDetails}\x3c/p\x3e\x3c/div\x3e",infoPanelTemplate:'\x3cdiv\x3e\x3cdiv class\x3d"template-info-showing"\x3e\x3cdiv class\x3d"thumbnail"\x3e\x3cimg src\x3d"${item:_formatInfoPanelImage}"\x3e\x3c/div\x3e\x3ch4\x3e${item.title}\x3c/h4\x3e\x3cdiv class\x3d"template-info"\x3e\x3cp class\x3d"quiet-scroll"\x3e${item.snippet}\x3c/p\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"panel-actions"\x3e\x3cbutton class\x3d"btn blue btn-main" id\x3d"on-next"\x3e${i18n.browseItems.configure}\x3c/button\x3e\x3cbutton class\x3d"btn btn-cancel" id\x3d"close-panel"\x3e${i18n.common.close}\x3c/button\x3e\x3c/div\x3e\x3cdiv\x3e',
_popupTemplate:'\x3cdiv class\x3d"esriBrowsePopup quiet-scroll"\x3e\x3cp\x3e{summary}\x3c/p\x3e\x3c/div\x3e',showInfoPanel:!0,isAutoClose:!0,showTooltip:!1,filterWithinGroup:!0,checkIsButtonEnabled:!1,baseClass:"esriBrowseItemsCtr",i18n:la,postMixInProperties:function(){this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this.self?(this._portal=new fa.Portal({url:this.portalUrl,self:this.self}),this._init(),this._portal.on("load",d.hitch(this,function(){this.emit("portal-load",
{portal:this._portal});this._fetchData()}))):(this._portal=new fa.Portal(this.portalUrl),this._portal.signIn().then(d.hitch(this,function(){this.emit("portal-load",{portal:this._portal});this._init();this._fetchData()})))},_init:function(){this._canSearchPublic=this.self?this.self.canSearchPublic:this._portal.canSearchPublic;this.query=d.mixin(this.query||{},{get:function(R){return this[R]&&this[R].length?"("+this[R].join(" OR ")+") ":""},toString:function(){return{q:this.get("groups")+this.get("tags")+
this.get("persistentTypekeywords")+this.get("typekeywords")+this.get("types")+this.get("owners")+this.get("orgids")+this.get("custom")+(this.query||"")+(this.search||"")+' -type:"Attachment" -tags:"mature support"'}}});this.self?this.self.canSearchPublic=!0:this._portal.canSearchPublic=!0;this.galleryTemplate=this.plugIn&&this.plugIn.galleryTemplate||this.galleryTemplate;this.infoPanelTemplate=this.plugIn&&this.plugIn.infoPanelTemplate||this.infoPanelTemplate;if(this.helpLinkUrl=this.plugIn&&this.plugIn.helpLinkUrl||
"")a.set(this.helpLink,"href",this.helpLinkUrl),f.remove(this.helpLink,"hide");z(".templates",this.domNode).addClass("fade");z(".dgrid-footer",this.domNode).addClass("hide");c.set(this.infoPanel,"display","none")},destroy:function(){this.inherited(arguments);this._grid&&this._grid.destroy();this._img_connect&&(this._img_connect.remove(),this._img_connect_error.remove());this._queryTimer&&clearTimeout(this._queryTimer);this._grid=this._portal=null},closeInfoPanel:function(){e.byId("close-panel").click()},
_setItemQueryAttr:function(R){this.itemQuery=R},_setPluginAttr:function(R){this.addPlugin(R)},_setMessageAttr:function(R){this.set("messageRight",R)},_setMessageRightAttr:function(R){"string"===typeof R?a.set(this.messageNodeRight,"innerHTML",R):R instanceof HTMLElement&&l.place(R,this.messageNodeRight);f.remove(this.messageNodeRight,"hide")},_setMessageLeftAttr:function(R){"string"===typeof R?a.set(this.messageNodeLeft,"innerHTML",R):R instanceof HTMLElement&&l.place(R,this.messageNodeLeft);f.remove(this.messageNodeLeft,
"hide")},_setDisabledAttr:function(R){var ha=E.findWidgets(this.domNode).concat(E.findWidgets(this._content));m.forEach(ha,function(qa){qa.set("disabled",R)});f[R?"add":"remove"](this._interval.domNode,"dijitTextBoxDisabled")},_setSortAttr:function(R){this.sortAttribute=R},_setSortDescendingAttr:function(R){this.sortDescending=R},_getSelectionAttr:function(){var R=this._grid.selection,ha;for(ha in R)if(R.hasOwnProperty(ha))break;return ha&&this._grid.row(ha).data},_setGalleryTemplateAttr:function(R){M.isDefined(R)&&
(this.galleryTemplate=R)},_setFormatThumbnailAttr:function(R){M.isDefined(R)&&"function"===typeof R&&(this._formatThumbnail=R)},_setFormatItemTitleAttr:function(R){M.isDefined(R)&&"function"===typeof R&&(this._formatItemTitle=R)},_setRowsPerPageAttr:function(R){this._set("rowsPerPage",R)},_setPagingLinksAttr:function(R){this._set("pagingLinks",R)},_getQueryAttr:function(){return this.query},_setQueryAttr:function(R){this._set("query",R);this._grid&&this._grid.set("query",R.toString())},_setExtentAttr:function(R){R&&
this._set("extent",this._extentToString(R))},_setUseExtentAttr:function(R){this._set("useExtent",R)},_setQueryTypeAttr:function(R){this._set("queryType",R)},_setFetchTimeoutAttr:function(R){this._set("fetchTimeout",R)},_setShowInfoPanelAttr:function(R){this._set("showInfoPanel",R)},_setSelectionModeAttr:function(R){-1===m.indexOf(["extended","toggle","multiple","single","none"],R)&&(console.log("Incorrect Value provided for selectionMode. It is one of the following: extended, toggle, multiple, single, none"),
R="single");this._set("selectionMode",R)},_setDemandListAttr:function(R){this._set("demandList",R)},_validate:function(){return!!this.get("selection")},reset:function(){z(".esriSearchBox",e.byId(this.id+"_search")).forEach(function(pa){a.set(pa,"value","")});this.query.search="";if(this.plugIn.filters){var R=[],ha=[],qa=[],ia=[];z("li.active",this.domNode).forEach(function(pa){f.remove(pa,"active");var A=this.plugIn.filters[pa.childNodes[0].id];pa=m.map(A.tags,function(Q){return'tags:"'+Q+'"'},this);
var I=m.map(A.owners,function(Q){return'owner:"'+Q+'"'},this),T=m.map(A.orgids,function(Q){return'orgid:"'+Q+'"'},this);A=m.map(A.typekeywords,function(Q){return'typekeywords:"'+Q+'"'},this);R.push(pa);qa.push(I);ia.push(T);ha.push(A)},this);this.query.tags=m.filter(this.query.tags,function(pa){return-1!==m.indexOf(R,pa)});this.query.owners=m.filter(this.query.owners,function(pa){return-1!==m.indexOf(qa,pa)});this.query.orgids=m.filter(this.query.orgids,function(pa){return-1!==m.indexOf(ia,pa)});
this.query.typekeywords=m.filter(this.query.typekeywords,function(pa){return-1!==m.indexOf(ha,pa)});e.byId("all").click()}},_showPopup:function(R){if(!this._isInsideTooltipDialog){this._closePopup();var ha=this._grid.row(R);R=z("img",ha.element)[0];if(ha={summary:ha.data.snippet},ha.summary)this._tooltip=new w({content:d.replace(this._popupTemplate,ha),onMouseEnter:d.hitch(this,function(){this._isInsideTooltipDialog=!0}),onMouseLeave:d.hitch(this,function(){this._isInsideTooltipDialog=!1;this._closePopup()})}),
F.open({className:"esriBrowsePopupCtr",popup:this._tooltip,around:R,orient:["after-centered","before-centered"]}),this._onCloseConnect=z(".dijitDialogCloseIcon",this._tooltip.domNode).on("click",d.hitch(this,function(qa){qa.preventDefault();this._closePopup()}))}},_closePopup:function(){this._tooltip&&(this._onCloseConnect&&this._onCloseConnect.remove(),F.close(this._tooltip),this._tooltip.destroyRecursive(),this._tooltip=this._onCloseConnect=void 0)},_clearQueryTimeout:function(){clearTimeout(this._queryTimer);
this._queryTimer=null},_clearClosePanelTimeout:function(){clearTimeout(this._panelClosing);this._panelClosing=null;m.forEach(this._panelClickHandles,"item.remove();");l.empty(this.infoPanel)},_createGrid:function(){var R=H([B,x,C,O,r]),ha=new ea(new ja({portal:this._portal})),qa=this.query,ia=d.hitch(this,function(I){I.snippet=I.snippet||"";var T=aa("div");I=b.substitute(this.galleryTemplate,{item:I,i18n:this.i18n},null,this);l.place(I,T);return T}),pa={};this.get("demandList")&&(R=H([B,t,C,O,r]));
this.get("useExtent")&&(pa.extent=this.get("extent"),pa.useExtent=this.get("useExtent"));this.get("queryType")&&(pa.queryType=this.get("queryType"));var A={store:ha,query:qa.toString(),selectionMode:this.selectionMode||"single",pagingLinks:this.get("pagingLinks")||2,rowsPerPage:this.plugIn&&this.plugIn.rowsPerPage||this.get("itemsPerPage")||6,loadingMessage:"Loading items...",showLoadingMessage:!1,renderRow:ia,noDataMessage:this.i18n.gallery.noItemsToDisplay,deselectOnRefresh:!("multiple"===this.selectionMode||
"extended"===this.selectionMode||"toggle"===this.selectionMode),sort:[{attribute:this.sortAttribute||"title",descending:this.sortDescending||!1}],queryOptions:pa};this.get("demandList")&&(A={store:ha,query:qa.toString(),minRowsPerPage:this.plugIn&&this.plugIn.rowsPerPage||this.get("itemsPerPage")||50,selectionMode:this.selectionMode||"single",loadingMessage:"Loading items...",showLoadingMessage:!1,renderRow:ia,pagingMethod:"throttleDelayed",noDataMessage:this.i18n.gallery.noItemsToDisplay,deselectOnRefresh:!("multiple"===
this.selectionMode||"extended"===this.selectionMode||"toggle"===this.selectionMode),sort:[{attribute:this.sortAttribute||"title",descending:this.sortDescending||!1}],queryOptions:pa});this._grid=new R(A,this.id+"_grid");this._grid.startup();this.own(k(this.domNode,"click",d.hitch(this,function(I){e.byId("close-panel")&&this.isAutoClose&&e.byId("close-panel").click()})),this._grid.on(P.enterRow,d.hitch(this,function(I){!1===f.contains(this.domNode,"showing")&&this.showInfoPanel&&this._showOverlay(!0,
I);this.showTooltip&&!this.showInfoPanel&&this._showPopup(I)})),this._grid.on(P.leaveRow,d.hitch(this,function(I){this._showOverlay(!1,I);this.showTooltip&&!this.showInfoPanel&&this._closePopup(I)})),this._grid.on(".dgrid-row:click",d.hitch(this,function(I){this.emit("grid-row-click",I);if(!1===f.contains(this.domNode,"showing")&&this.showInfoPanel){I.preventDefault();q.stop(I);this._clearClosePanelTimeout();var T=this.get("selection");this._showOverlay(!1,I);this.showInfoPanel&&this.infoPanelTemplate?
(c.set(this.infoPanel,"display","block"),l.place(b.substitute(this.infoPanelTemplate,{item:T,i18n:this.i18n},function(Q){return M.isDefined(Q)?Q:""},this),this.infoPanel)):c.set(this.infoPanel,"display","none");this.emit("show-info-panel");f.add(this.domNode,"showing");this._panelClickHandles=[z(".template-info-showing .thumbnail img",this.domNode).on("error",d.hitch(this,function(Q){a.set(Q.target,"src",T.thumbnailUrl)})),z(".panel-actions .btn").on("click",d.hitch(this,function(Q){Q.preventDefault();
q.stop(Q);this.checkIsButtonEnabled&&f.contains(Q.target,"disabled")||("close-panel"===Q.target.id?(f.remove(this.domNode,"showing"),c.set(this.infoPanel,"display","none"),this._panelClosing=setTimeout(d.hitch(this,function(){m.forEach(void 0,"item.remove();");l.empty(this.infoPanel)},250))):(v.publish("/esri/browseitems/close",Q.target.id,this.get("selection")),Q={selection:this.get("selection"),action:Q.target.id},this.emit("browseitems-close",Q)))})),z(".js-info-panel",this.domNode).on("click",
d.hitch(this,function(Q){this.isAutoClose&&(Q.preventDefault(),q.stop(Q))})),k(z(".dgrid-footer,.dgrid-header",this._grid.domNode),p.leave,d.hitch(this,function(Q){this.showTooltip&&!this.showInfoPanel&&this._closePopup()}))]}})),this._grid.on("dgrid-refresh-complete",d.hitch(this,function(I){z(".templates",this.domNode).removeClass("fade");z(".loaderWrap",this.domNode).addClass("hide");z(".dgrid-footer",this.domNode)[this._grid._total<=this._grid.rowsPerPage?"addClass":"removeClass"]("hide");this.showTooltip&&
!this.showInfoPanel&&this._closePopup()})),this._grid.on("refresh",d.hitch(this,function(){this.showTooltip&&!this.showInfoPanel&&this._closePopup();this._img_connect&&(this._img_connect.remove(),this._img_connect_error.remove(),this._img_connect_error=this._img_connect=null);this._img_connect=z(".grid-item-thumb",this._grid.domNode).on("load",d.hitch(this,function(I){(I=this._grid.row(I))&&I.element&&z(".grid-item",I.element).addClass("fadeIn").style("opacity","1")}));this._img_connect_error=z(".grid-item-thumb",
this._grid.domNode).on("error",d.hitch(this,function(I){a.set(I.target,"src",this._portal.staticImagesUrl+"/desktopapp.png")}))})),k(e.byId(this.id+"_search"),"keyup",d.hitch(this,function(I){I.preventDefault();this._clearQueryTimeout();this._queryTimer=setTimeout(d.hitch(this,function(){this.query.search=a.get(I.target,"value");this._fetchItems(this.query).then(d.hitch(this,function(){this._clearQueryTimeout()}))}),this.searchKeypressDelay||450)})),k(e.byId(this.id+"_search"),"search",d.hitch(this,
function(I){this._queryTimer||(I.preventDefault(),this.query.search=a.get(I.target,"value"),this._fetchItems(this.query))})),this.watch("extent",d.hitch(this,function(I,T,Q){this._grid.queryOptions.extent=this.get("extent");this._grid.queryOptions.useExtent=this.get("useExtent");this._grid.query.bbox=this._grid.queryOptions.useExtent?this._grid.queryOptions.extent:"";this._grid.refresh()})),this.watch("useExtent",d.hitch(this,function(I,T,Q){this._grid.queryOptions.extent=this.get("extent");this._grid.queryOptions.useExtent=
Q;this._grid.query.bbox=this._grid.queryOptions.useExtent?this._grid.queryOptions.extent:"";this._grid.refresh()})));this.showInfoPanel||("single"===this._grid.selectionMode?this.own(this._grid.on("dgrid-select,dgrid-deselect",d.hitch(this,function(I){I={selection:this.get("selection")};this.emit("select-change",I)}))):-1!==m.indexOf(["toggle","multiple","extended"],this._grid.selectionMode)&&this.own(this._grid.on("dgrid-select,dgrid-deselect",d.hitch(this,function(I){I=I.grid.selection;var T,Q=
[];for(T in I)I[T]&&Q.push(this._grid.row(T).data);this.emit("select-change",{selection:Q})}))));this.emit("grid-ready",{grid:this._grid,ready:!0})},_createFilters:function(){if(this.plugIn&&this.plugIn.filters){var R=this.plugIn.filters,ha=this.plugIn.filterStrings,qa,ia=z(".filters",this.domNode)[0];for(qa in R)l.create("li",{"class":"all"===qa?"active":"",innerHTML:"\x3ca id\x3d'"+qa+"'  href\x3d'#'\x3e"+ha[qa].title+"\x3c/a\x3e"},ia);this.own(k(ia,"li a:click",d.hitch(this,function(pa){pa.preventDefault();
var A=pa.target;z(".active",ia).removeClass("active");f.add(A.parentNode,"active");z(".templates",this.domNode).addClass("fade");setTimeout(d.hitch(this,function(){f["all"===A.id?"add":"remove"](this.filterDescription,"hide");a.set(this.filterDescription,"innerHTML",ha[A.id].description||"")}),225);pa=d.mixin({},R[A.id]||{});this.query.tags=m.map(pa.tags||[],function(I){return'tags:"'+I+'"'});this.query.owners=m.map(pa.owners,function(I){return'owner:"'+I+'"'});this.query.orgids=m.map(pa.orgids,function(I){return'orgid:"'+
I+'"'});this.query.typekeywords=[].concat(m.map(pa.typekeywords||[],function(I){return'typekeywords:"'+I+'"'}));this.filterWithinGroup||(this.query.groups=m.map(pa.groups,function(I){return'group:"'+I+'"'}));this._fetchItems(this.query)})));f.add(this.domNode,"filters");f.remove(this.domNode,"nofilters")}else f.add(this.domNode,"nofilters"+(this.plugIn&&this.plugIn.extraClasses?" "+this.plugIn.extraClasses.join(" "):"")),f.remove(this.domNode,"filters")},_showOverlay:function(R,ha){(ha=this._grid.row(ha))&&
z(".template-overlay",ha.element).style("display",R?"":"none")},_fetchData:function(){this._user=this._portal.getPortalUser();return this.plugIn&&this.plugIn.fetchData?this.plugIn.fetchData():this._fetchItems(this.itemQuery)},_fetchItems:function(R,ha){var qa={sort:[{attribute:this.sortAttribute||"title",descending:this.sortDescending||!1}]},ia=new D;this.get("useExtent")&&(qa.extent=this.get("extent"),qa.useExtent=this.get("useExtent"));this.get("queryType")&&(qa.queryType=this.get("queryType"));
z(".templates",this.domNode).addClass("fade");z(".dgrid-footer",this.domNode).addClass("hide");z(".loaderWrap",this.domNode).removeClass("hide");setTimeout(d.hitch(this,function(){this.query=d.mixin(this.query,R);this._grid?this._grid.set("query",this.query.toString(),qa):(this._createFilters(),this._createGrid());ia.resolve(this._grid)}),60);return ia},_formatThumbnail:function(R){var ha=R.thumbnailUrl||this._portal.staticImagesUrl+"/desktopapp.png";R.thumbnailUrl=ha;return"\x3cimg class\x3d'grid-item-thumb' width\x3d'187px' height\x3d'125px' alt\x3d'' src\x3d'"+
ha+"'\x3e"},_formatInfoPanelImage:function(R){var ha=R.screenshots&&R.screenshots.length?R.screenshots[0]:null;return ha?R.itemUrl+"/info/"+ha:R.thumbnailUrl},_formatItemTitle:function(R){return"\x3ch5\x3e"+(R.title||R.name||"\x3cNo Title\x3e")+"\x3c/h5\x3e"},clear:function(){this._grid.clearSelection()},doProject:function(R,ha){var qa=[102113,102100,3857],ia=new D;var pa=function(I,T){!(I&&0<I.length&&I[0]&&"extent"==I[0].type)||isNaN(I[0].xmin)||isNaN(I[0].ymin)||isNaN(I[0].xmax)||isNaN(I[0].ymax)?
I&&0<I.length&&I[0]&&"point"==I[0].type&&!isNaN(I[0].x)&&!isNaN(I[0].y)&&ia.resolve(I,T):ia.resolve(I,T)};if(null!=R.spatialReference.wkid&&4326==R.spatialReference.wkid&&null!=ha.wkid&&this.contains(qa,ha.wkid)){R.ymin=Math.max(R.ymin,-89.99);R.ymax=Math.min(R.ymax,89.99);R=V.geographicToWebMercator(R);if((qa=R.spatialReference._getInfo())&&R.xmin>R.xmax){pa=qa.valid[1]-R.xmin;var A=R.xmax-qa.valid[0];pa>A?R.xmax=qa.valid[1]+A:R.xmin=qa.valid[0]-pa}R.spatialReference.wkid=ha.wkid;ia.resolve([R])}else null!=
R.spatialReference.wkid&&this.contains(qa,R.spatialReference.wkid)&&null!=ha.wkid&&4326==ha.wkid?(R=V.webMercatorToGeographic(R),(qa=R.spatialReference._getInfo())&&R.xmin>R.xmax&&(pa=qa.valid[1]-R.xmin,A=R.xmax-qa.valid[0],pa>A?R.xmax=qa.valid[1]+A:R.xmin=qa.valid[0]-pa),ia.resolve([R])):(this.geometryService||(this.geometryService=new Y(N.defaults.geometryService)),this.geometryService.project([R],ha,pa));return ia},contains:function(R,ha){for(var qa=R.length;qa--;)if(R[qa]===ha)return!0;return!1},
_extentToGCS:function(R){R=R.shiftCentralMeridian(!0);return V.webMercatorToGeographic(R)},_extentToString:function(R){var ha="";null!=R&&(R=this._extentToGCS(R),ha=this._roundValue(R.xmin,1E4)+","+this._roundValue(R.ymin,1E4)+","+this._roundValue(R.xmax,1E4)+","+this._roundValue(R.ymax,1E4));return ha},_roundValue:function(R,ha){return Math.round(R*ha)/ha}});g("extend-esri")&&d.setObject("dijit.BrowseItems",n,G);return n})},"dgrid/extensions/Pagination":function(){define("../_StoreMixin dojo/_base/declare dojo/_base/array dojo/_base/lang dojo/_base/Deferred dojo/on dojo/query dojo/string dojo/has put-selector/put ../util/misc dojo/i18n!./nls/pagination dojo/_base/sniff xstyle/css!../css/extensions/Pagination.css".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g){function e(p){p.noDataNode?(k(p.noDataNode,"!"),delete p.noDataNode):p.cleanup();p.contentNode.innerHTML=""}function l(p){if(p.loadingNode)k(p.loadingNode,"!"),delete p.loadingNode;else if(p._oldPageNodes){for(var v in p._oldPageNodes)p.removeRow(p._oldPageNodes[v]);delete p._oldPageNodes;p._oldPageObserver&&(p._oldPageObserver.cancel(),p._numObservers--,delete p._oldPageObserver)}delete p._isLoading}return d("dgrid.extensions.Pagination",H,{rowsPerPage:10,pagingTextBox:!1,
previousNextArrows:!0,firstLastArrows:!1,pagingLinks:2,pageSizeOptions:null,showLoadingMessage:!0,i18nPagination:g,showFooter:!0,_currentPage:1,_total:0,buildRendering:function(){this.inherited(arguments);var p=this,v=this.paginationNode=k(this.footerNode,"div.dgrid-pagination"),z=this.paginationStatusNode=k(v,"div.dgrid-status"),u=this.i18nPagination;z.tabIndex=0;this._updatePaginationSizeSelect();this._updateRowsPerPageOption();z.innerHTML=a.substitute(u.status,{start:1,end:1,total:0});v=this.paginationNavigationNode=
k(v,"div.dgrid-navigation");this.firstLastArrows&&(z=this.paginationFirstNode=k(v,"span.dgrid-first.dgrid-page-link","\u00ab"),z.setAttribute("aria-label",u.gotoFirst),z.tabIndex=0);this.previousNextArrows&&(z=this.paginationPreviousNode=k(v,"span.dgrid-previous.dgrid-page-link","\u2039"),z.setAttribute("aria-label",u.gotoPrev),z.tabIndex=0);this.paginationLinksNode=k(v,"span.dgrid-pagination-links");this.previousNextArrows&&(z=this.paginationNextNode=k(v,"span.dgrid-next.dgrid-page-link","\u203a"),
z.setAttribute("aria-label",u.gotoNext),z.tabIndex=0);this.firstLastArrows&&(z=this.paginationLastNode=k(v,"span.dgrid-last.dgrid-page-link","\u00bb"),z.setAttribute("aria-label",u.gotoLast),z.tabIndex=0);this._listeners.push(f(v,".dgrid-page-link:click,.dgrid-page-link:keydown",function(E){if("keydown"!==E.type||13===E.keyCode)if(E=this.className,!(p._isLoading||-1<E.indexOf("dgrid-page-disabled"))){var w=p._currentPage;var F=Math.ceil(p._total/p.rowsPerPage);this===p.paginationPreviousNode?p.gotoPage(w-
1):this===p.paginationNextNode?p.gotoPage(w+1):this===p.paginationFirstNode?p.gotoPage(1):this===p.paginationLastNode?p.gotoPage(F):"dgrid-page-link"===E&&p.gotoPage(+this.innerHTML)}}))},destroy:function(){this.inherited(arguments);this._pagingTextBoxHandle&&this._pagingTextBoxHandle.remove()},_updatePaginationSizeSelect:function(){var p=this.pageSizeOptions,v=this.paginationSizeSelect;if(p&&p.length){if(!v){v=this.paginationSizeSelect=k(this.paginationNode,"select.dgrid-page-size[aria-label\x3d"+
this.i18nPagination.rowsPerPage+"]");var z=this._paginationSizeChangeHandle=f(v,"change",n.hitch(this,function(){this.set("rowsPerPage",+this.paginationSizeSelect.value)}));this._listeners.push(z)}for(z=v.options.length=0;z<p.length;z++)k(v,"option",p[z],{value:p[z],selected:this.rowsPerPage===p[z]});this._updateRowsPerPageOption()}else p&&p.length||!v||(k(v,"!"),this.paginationSizeSelect=null,this._paginationSizeChangeHandle.remove())},_setPageSizeOptions:function(p){this.pageSizeOptions=p&&p.sort(function(v,
z){return v-z});this._updatePaginationSizeSelect()},_updateRowsPerPageOption:function(){var p=this.rowsPerPage,v=this.pageSizeOptions,z=this.paginationSizeSelect;z&&(0>m.indexOf(v,p)?this._setPageSizeOptions(v.concat([p])):z.value=""+p)},_setRowsPerPage:function(p){this.rowsPerPage=p;this._updateRowsPerPageOption();this.gotoPage(1)},_updateNavigation:function(){function p(C,J){if(z.pagingTextBox&&C==w&&1<D)J=k(E,"input.dgrid-page-input[type\x3dtext][value\x3d$]",w),J.setAttribute("aria-label",u.jumpPage),
z._pagingTextBoxHandle=f(J,"change",function(){var P=+this.value;!isNaN(P)&&0<P&&P<=D&&z.gotoPage(+this.value)}),x&&"INPUT"===x.tagName&&J.focus();else{var L=C===w;J=k(E,"span"+(L?".dgrid-page-disabled":"")+".dgrid-page-link",C+(J?" ":""));J.setAttribute("aria-label",u.gotoPage);J.tabIndex=L?-1:0;r===C&&(L?C<D?r++:t.focus():J.focus());L||(t=J)}}function v(C,J){k(C,(J?".":"!")+"dgrid-page-disabled");C.tabIndex=J?-1:0}var z=this,u=this.i18nPagination,E=this.paginationLinksNode,w=this._currentPage,F=
this.pagingLinks,y=this.paginationNavigationNode,D=Math.ceil(this._total/this.rowsPerPage),B=this._pagingTextBoxHandle,x=document.activeElement,r,t;x&&h.contains(this.paginationNavigationNode,x)?"dgrid-page-link"===x.className&&(r=+x.innerHTML):x=null;B&&B.remove();E.innerHTML="";c(".dgrid-first, .dgrid-previous",y).forEach(function(C){v(C,1===w)});c(".dgrid-last, .dgrid-next",y).forEach(function(C){v(C,w>=D)});if(F&&0<D){p(1,!0);y=w-F;for(2<y?k(E,"span.dgrid-page-skip","..."):y=2;y<Math.min(w+F+
1,D);y++)p(y,!0);w+F+1<D&&k(E,"span.dgrid-page-skip","...");1<D&&p(D)}else z.pagingTextBox&&p(w);x&&-1===x.tabIndex&&(F=c("[tabindex\x3d'0']",this.paginationNavigationNode),x===this.paginationPreviousNode||x===this.paginationFirstNode?x=F[0]:F.length&&(x=F[F.length-1]),x&&x.focus())},refresh:function(){var p=this;this.inherited(arguments);if(this.store)return this.gotoPage(1).then(function(v){setTimeout(function(){f.emit(p.domNode,"dgrid-refresh-complete",{bubbles:!0,cancelable:!1,grid:p,results:v})},
0);return v});console.warn("Pagination requires a store to operate.")},_onNotification:function(p){p.length!==this._rowsOnPage&&this.gotoPage(this._currentPage)},renderArray:function(p,v){var z=this,u=this.inherited(arguments);this._lastCollection=null;v||(this._topLevelRequest&&this._topLevelRequest!==p&&(this._topLevelRequest.cancel(),delete this._topLevelRequest),"function"===typeof p.cancel&&(this._topLevelRequest=p),q.when(p,function(){z._topLevelRequest&&delete z._topLevelRequest}));return u},
insertRow:function(){var p=this._oldPageNodes,v=this.inherited(arguments);p&&v===p[v.id]&&delete p[v.id];return v},gotoPage:function(p){var v=this,z=new q;this._trackError(function(){var u=v.rowsPerPage,E=(p-1)*u,w=n.mixin(v.get("queryOptions"),{start:E,count:u}),F=v.contentNode,y;if(v.showLoadingMessage){e(v);var D=v.loadingNode=k(F,"div.dgrid-loading");D.innerHTML=v.loadingMessage}else{v._oldPageNodes=D={};F=F.children;var B=0;for(y=F.length;B<y;B++)D[F[B].id]=F[B];v._oldPageObserver=v.observers.pop()}v._isLoading=
!0;var x=v.store.query(v.query,w);q.when(v.renderArray(x,null,w),function(r){l(v);v.scrollTo({y:0});q.when(x.total,function(t){t||(v.noDataNode&&(k(v.noDataNode,"!"),delete v.noDataNode),v.noDataNode=k(v.contentNode,"div.dgrid-no-data"),v.noDataNode.innerHTML=v.noDataMessage);v.paginationStatusNode.innerHTML=a.substitute(v.i18nPagination.status,{start:Math.min(E+1,t),end:Math.min(t,E+u),total:t});v._total=t;v._currentPage=p;v._rowsOnPage=r.length;v._updateNavigation()});(7>b("ie")||b("ie")&&b("quirks"))&&
v.resize();z.resolve(x)},function(r){l(v);z.reject(r)});return z.promise})||z.reject();return z.promise}})})},"dgrid/extensions/DijitRegistry":function(){define(["dojo/_base/declare","dojo/dom-geometry","dijit/registry"],function(H,d,m){return H("dgrid.extensions.DijitRegistry",null,{minSize:0,maxSize:Infinity,layoutPriority:0,showTitle:!0,buildRendering:function(){m.add(this);this.inherited(arguments);this.domNode.setAttribute("widgetId",this.id)},startup:function(){if(!this._started){this.inherited(arguments);
var n=m.getEnclosingWidget(this.domNode.parentNode);n&&n.isLayoutContainer&&this._resizeHandle.remove()}},destroyRecursive:function(){this.destroy()},destroy:function(){this.inherited(arguments);m.remove(this.id)},getChildren:function(){return[]},isLeftToRight:function(){return!this.isRTL},resize:function(n){n&&d.setMarginBox(this.domNode,n);this.inherited(arguments)},_set:function(n,q){this[n]=q},watch:function(){},getParent:function(){return m.getEnclosingWidget(this.domNode.parentNode)}})})},"dgrid/selector":function(){define("dojo/_base/kernel dojo/_base/array dojo/_base/lang dojo/on dojo/aspect dojo/_base/sniff put-selector/put".split(" "),
function(H,d,m,n,q,f,c){m.getObject("dgrid.selector",!0);return dgrid.selector=function(a,b){function k(u){return!p.allowSelect(p.row(u))}function h(u){return function(E){var w=E.rows,F=w.length;E="false";var y;for(y=0;y<F;y++){var D=p.cell(w[y],a.id).element;D&&(D=(D.contents||D).input)&&!D.disabled&&(D.checked=u,D.setAttribute("aria-checked",u))}if("checkbox"==v.type){w=p.selection;F=!1;for(y in w)if(w[y]!=p.allSelected){F=!0;break}v.indeterminate=F;v.checked=p.allSelected;F?E="mixed":p.allSelected&&
(E="true");v.setAttribute("aria-checked",E)}}}function g(u){if("click"==u.type||32==u.keyCode||!f("opera")&&13==u.keyCode||0===u.keyCode){var E=p.row(u);p._selectionTriggerEvent=u;if(E){if(p.allowSelect(E)){var w=p._lastSelected&&p.row(p._lastSelected);"radio"==b?w&&w.id==E.id||(p.clearSelection(),p.select(E,null,!0),p._lastSelected=E.element):E&&(u.shiftKey?h(!0)({rows:[E]}):w=null,w=u.shiftKey?w:null,p.select(w||E,E,w?void 0:null),p._lastSelected=E.element)}}else c(this,(p.allSelected?"!":".")+
"dgrid-select-all"),p[p.allSelected?"clearSelection":"selectAll"]();p._selectionTriggerEvent=null}}function e(){p._hasSelectorInputListener=!0;l.push(p.on(".dgrid-selector:click,.dgrid-selector:keydown",g));var u=p._handleSelect;p._handleSelect=function(F){this.cell(F).column!=a&&u.apply(this,arguments)};if("function"==typeof a.disabled){var E=p.allowSelect,w=a.disabled;p.allowSelect=function(F){var y=E.call(this,F);return w===k?y:y&&!w.call(a,F.data)}}a.disabled=k;l.push(p.on("dgrid-select",h(!0)));
l.push(p.on("dgrid-deselect",h(!1)))}var l=[],p,v;a||(a={});a.type&&(a.selectorType=a.type,H.deprecated("columndef.type","use columndef.selectorType instead","dgrid 0.4"));a.selectorType=b=b||a.selectorType||"checkbox";a.sortable=!1;var z="function"==typeof b?b:function(u,E,w){var F=E.parentNode;p._hasSelectorInputListener||e();var y=a.disabled;c(F&&F.contents?F:E,".dgrid-selector");E=E.input||(E.input=c(E,"input[type\x3d"+b+"]",{tabIndex:isNaN(a.tabIndex)?-1:a.tabIndex,disabled:y&&("function"==typeof y?
y.call(a,w):y),checked:u}));E.setAttribute("aria-checked",!!u);return E};q.after(a,"init",function(){p=a.grid});q.after(a,"destroy",function(){d.forEach(l,function(u){u.remove()});p._hasSelectorInputListener=!1});a.renderCell=function(u,E,w,F,y){E=(E=u&&p.row(u))&&p.selection[E.id];z(E,w,u)};a.renderHeaderCell=function(u){var E="label"in a?a.label:a.field||"";"radio"!=b&&p.allowSelectAll?z(!1,u,{}):(u.appendChild(document.createTextNode(E)),p._hasSelectorInputListener||e());v=u.lastChild};return a}})},
"dgrid/Keyboard":function(){define("dojo/_base/declare dojo/aspect dojo/on dojo/_base/lang dojo/has put-selector/put ./util/misc dojo/_base/Deferred dojo/_base/sniff".split(" "),function(H,d,m,n,q,f,c,a){function b(x){x.preventDefault()}var k={checkbox:1,radio:1,button:1},h=/\bdgrid-cell\b/,g=/\bdgrid-row\b/,e=H("dgrid.Keyboard",null,{pageSkip:10,tabIndex:0,keyMap:null,headerKeyMap:null,postMixInProperties:function(){this.inherited(arguments);this.keyMap||(this.keyMap=n.mixin({},e.defaultKeyMap));
this.headerKeyMap||(this.headerKeyMap=n.mixin({},e.defaultHeaderKeyMap))},postCreate:function(){function x(C){var J=C.target;return J.type&&(!k[J.type]||32==C.keyCode)}function r(C){function J(){t._focusedHeaderNode&&(t._focusedHeaderNode.tabIndex=-1);if(t.showHeader){if(L)for(var ea=0,ba,oa=t.headerNode.getElementsByTagName("th");ba=oa[ea];++ea){if(P.test(ba.className)){t._focusedHeaderNode=aa=ba;break}}else t._focusedHeaderNode=aa=t.headerNode;aa&&(aa.tabIndex=t.tabIndex)}}var L=t.cellNavigation,
P=L?h:g,U=C===t.headerNode,aa=C;U?(J(),d.after(t,"renderHeader",J,!0)):d.after(t,"renderArray",function(ea){return a.when(ea,function(ba){var oa=t._focusedNode||aa;if(P.test(oa.className)&&c.contains(C,oa))return ba;for(var da=0,fa=C.getElementsByTagName("*"),S;S=fa[da];++da)if(P.test(S.className)){oa=t._focusedNode=S;break}oa.tabIndex=t.tabIndex;return ba})});t._listeners.push(m(C,"mousedown",function(ea){x(ea)||t._focusOnNode(ea.target,U,ea)}));t._listeners.push(m(C,"keydown",function(ea){if(!ea.metaKey&&
!ea.altKey){var ba=t[U?"headerKeyMap":"keyMap"][ea.keyCode];ba&&!x(ea)&&ba.call(t,ea)}}))}this.inherited(arguments);var t=this;this.tabableHeader&&(r(this.headerNode),this._listeners.push(m(this.headerNode,"dgrid-cellfocusin",function(){t.scrollTo({x:this.scrollLeft})})));r(this.contentNode);this._debouncedEnsureScroll=c.debounce(this._ensureScroll,this)},removeRow:function(x){if(!this._focusedNode)return this.inherited(arguments);var r=this,t=document.activeElement===this._focusedNode,C=this[this.cellNavigation?
"cell":"row"](this._focusedNode),J=C.row||C,L;x=x.element||x;x===J.element&&((L=this.down(J,!0))&&L.element!==x||(L=this.up(J,!0)),this._removedFocus={active:t,rowId:J.id,columnId:C.column&&C.column.id,siblingId:L&&L.element!==x?L.id:void 0},setTimeout(function(){r._removedFocus&&r._restoreFocus(J.id)},0),this._focusedNode=null);this.inherited(arguments)},insertRow:function(x){var r=this.inherited(arguments);this._removedFocus&&!this._removedFocus.wait&&this._restoreFocus(r);return r},_restoreFocus:function(x){var r=
this._removedFocus,t;if((x=(x=x&&this.row(x))&&x.element&&x.id===r.rowId?x:"undefined"!==typeof r.siblingId&&this.row(r.siblingId))&&x.element){if(!x.element.parentNode.parentNode){r.wait=!0;return}"undefined"!==typeof r.columnId&&(t=this.cell(x,r.columnId))&&t.element&&(x=t);r.active&&0!==x.element.offsetHeight?this._focusOnNode(x,!1,null):(f(x.element,".dgrid-focus"),x.element.tabIndex=this.tabIndex,this._focusedNode=x.element)}delete this._removedFocus},addKeyHandler:function(x,r,t){return d.after(this[t?
"headerKeyMap":"keyMap"],x,r,!0)},_ensureRowScroll:function(x){var r=this.getScrollPosition().y;r>x.offsetTop?this.scrollTo({y:x.offsetTop}):r+this.contentNode.offsetHeight<x.offsetTop+x.offsetHeight&&this.scrollTo({y:x.offsetTop-this.contentNode.offsetHeight+x.offsetHeight})},_ensureColumnScroll:function(x){var r=this.getScrollPosition().x,t=x.offsetLeft;if(r>t)this.scrollTo({x:t});else{var C=this.bodyNode.clientWidth;x=x.offsetWidth;var J=t+x;r+C<J&&this.scrollTo({x:C>x?J-C:t})}},_ensureScroll:function(x,
r){this.cellNavigation&&(this.columnSets||1<this.subRows.length)&&!r&&this._ensureRowScroll(x.row.element);this.bodyNode.clientWidth<this.contentNode.offsetWidth&&this._ensureColumnScroll(x.element)},_focusOnNode:function(x,r,t){var C="_focused"+(r?"Header":"")+"Node",J=this[C],L=this.cellNavigation?"cell":"row",P=this[L](x),U;if(x=P&&P.element){if(this.cellNavigation){var aa=x.getElementsByTagName("input");var ea=0;for(U=aa.length;ea<U;ea++){var ba=aa[ea];if((-1!=ba.tabIndex||"_dgridLastValue"in
ba)&&!ba.disabled){8>q("ie")&&(ba.style.position="relative");ba.focus();8>q("ie")&&(ba.style.position="");var oa=!0;break}}}null!==t&&(t=n.mixin({grid:this},t),t.type&&(t.parentType=t.type),t.bubbles||(t.bubbles=!0));J&&(f(J,"!dgrid-focus[!tabIndex]"),8>q("ie")&&(J.style.position=""),t&&(t[L]=this[L](J),m.emit(J,"dgrid-cellfocusout",t)));J=this[C]=x;t&&(t[L]=P);C=this.cellNavigation?h:g;!oa&&C.test(x.className)&&(8>q("ie")&&(x.style.position="relative"),x.tabIndex=this.tabIndex,x.focus());f(x,".dgrid-focus");
t&&m.emit(J,"dgrid-cellfocusin",t);this._debouncedEnsureScroll(P,r)}},focusHeader:function(x){this._focusOnNode(x||this._focusedHeaderNode,!0)},focus:function(x){(x=x||this._focusedNode)?this._focusOnNode(x,!1):this.contentNode.focus()}}),l=e.moveFocusVertical=function(x,r){if(this._focusOnNode&&x.target!==this.contentNode){var t=this.cellNavigation,C=this[t?"cell":"row"](x);C=t&&C.column.id;r=this.down(this._focusedNode,r,!0);t&&(r=this.cell(r,C));this._focusOnNode(r,!1,x);x.preventDefault()}};H=
e.moveFocusUp=function(x){l.call(this,x,-1)};var p=e.moveFocusDown=function(x){l.call(this,x,1)},v=e.moveFocusPageUp=function(x){l.call(this,x,-this.pageSkip)},z=e.moveFocusPageDown=function(x){l.call(this,x,this.pageSkip)},u=e.moveFocusHorizontal=function(x,r){if(this.cellNavigation&&x.target!==this.contentNode){var t=!this.row(x);this._focusOnNode(this.right(this["_focused"+(t?"Header":"")+"Node"],r),t,x);x.preventDefault()}},E=e.moveFocusLeft=function(x){u.call(this,x,-1)},w=e.moveFocusRight=function(x){u.call(this,
x,1)},F=e.moveHeaderFocusEnd=function(x,r){if(this.cellNavigation){var t=this.headerNode.getElementsByTagName("th");this._focusOnNode(t[r?0:t.length-1],!0,x)}x.preventDefault()},y=e.moveHeaderFocusHome=function(x){F.call(this,x,!0)},D=e.moveFocusEnd=function(x,r){var t=this,C=this.cellNavigation,J=this.contentNode,L=J.scrollTop+(r?0:J.scrollHeight);J=J[r?"firstChild":"lastChild"];var P=-1<J.className.indexOf("dgrid-preload"),U=P?J[(r?"next":"previous")+"Sibling"]:J,aa=U.offsetTop+(r?0:U.offsetHeight);
if(P){for(;U&&0>U.className.indexOf("dgrid-row");)U=U[(r?"next":"previous")+"Sibling"];if(!U)return}if(!P||1>J.offsetHeight)C&&(U=this.cell(U,this.cell(x).column.id)),this._focusOnNode(U,!1,x);else{q("dom-addeventlistener")||(x=n.mixin({},x));var ea=d.after(this,"renderArray",function(ba){ea.remove();return a.when(ba,function(oa){oa=oa[r?0:oa.length-1];C&&(oa=t.cell(oa,t.cell(x).column.id));t._focusOnNode(oa,!1,x)})})}L===aa&&x.preventDefault()},B=e.moveFocusHome=function(x){D.call(this,x,!0)};e.defaultKeyMap=
{32:b,33:v,34:z,35:D,36:B,37:E,38:H,39:w,40:p};e.defaultHeaderKeyMap={32:b,35:F,36:y,37:E,39:w};return e})},"dgrid/util/mouse":function(){define(["dojo/_base/lang","dojo/on","dojo/dom","dojo/query"],function(H,d,m){function n(f,c){return function(a,b){return d(a,f+":"+c,function(k){if(!m.isDescendant(k.relatedTarget,this))return b.call(this,k)})}}var q={enterRow:n(".dgrid-content .dgrid-row","mouseover"),enterCell:n(".dgrid-content .dgrid-cell","mouseover"),enterHeaderCell:n(".dgrid-header .dgrid-cell",
"mouseover"),leaveRow:n(".dgrid-content .dgrid-row","mouseout"),leaveCell:n(".dgrid-content .dgrid-cell","mouseout"),leaveHeaderCell:n(".dgrid-header .dgrid-cell","mouseout"),createDelegatingHandler:n};H.getObject("dgrid.util.mouse",!0);H.mixin(dgrid.util.mouse,q);return q})},"dgrid/util/touch":function(){define(["dojo/on","dojo/query"],function(H,d){function m(q,f,c,a){if(!(1<c.targetTouches.length)){var b=c.changedTouches[0],k=b.screenX,h=b.screenY;a&&c.preventDefault();var g=H(q,"touchend",function(e){var l=
e.changedTouches[0];e.targetTouches.length||(Math.abs(l.screenX-k)<n.tapRadius&&Math.abs(l.screenY-h)<n.tapRadius&&(a&&e.preventDefault(),f.call(this,e)),g.remove())})}}var n={tapRadius:10,dbltapTime:250,selector:function(q,f,c){return function(a,b){var k=f.bubble;k?f=k:!1!==c&&(c=!0);return H(a,f,function(h){var g=h.target;3==g.nodeType&&(g=g.parentNode);for(;!d.matches(g,q,a);)if(g==a||!c||!(g=g.parentNode))return;return b.call(g,h)})}},countCurrentTouches:function(q,f){if(!("touches"in q))return-1;
var c,a,b;for(a=c=0;b=q.touches[c];++c)f.contains(b.target)&&++a;return a},tap:function(q,f){return H(q,"touchstart",function(c){m(q,f,c)})},dbltap:function(q,f){var c,a;return H(q,"touchstart",function(b){c?m(q,function(k){if(c){var h=k.changedTouches[0];Math.abs(h.screenX-c.screenX)<n.tapRadius&&Math.abs(h.screenY-c.screenY)<n.tapRadius&&(a&&clearTimeout(a),c=a=null,f.call(this,k))}},b,!0):m(q,function(k){c=k.changedTouches[0];a=setTimeout(function(){c=a=null},n.dbltapTime)},b)})}};return n})},
"esri/dijit/_AppTemplateFiltersMixin":function(){define(["dojo/_base/declare"],function(){return{rootNodes:{app:{all:{},narrate:{typekeywords:["story"]},collect:{typekeywords:["collect"]},compare:{typekeywords:["compare"]},"3dscene":{typekeywords:["3Dscene"]},analyze:{typekeywords:["summarize"]},present:{typekeywords:["gallery"]},social:{typekeywords:["social"]},local:{typekeywords:["local"]},route:{typekeywords:["route"]},showcase:{typekeywords:["showcase"]}}}}})},"esri/dijit/_RefreshMixin":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/on dojo/has ../kernel".split(" "),
function(H,d,m,n,q,f){function c(a){"object"!==typeof a&&(a=Error(a));a.grid=this;n.emit(this.domNode,"dgrid-error",{grid:this,error:a,cancelable:!0,bubbles:!0})&&console.error(a)}H=H(null,{_trackError:function(a){"string"===typeof a&&(a=d.hitch(this,a));try{var b=a()}catch(k){c.call(this,k)}return m.when(b,d.hitch(this,function(){n.emit(this.domNode,"refresh",{cancelable:!0,bubbles:!0})}),d.hitch(this,c))}});q("extend-esri")&&d.setObject("dijit._RefreshMixin",H,f);return H})},"esri/dijit/analysis/PluginAnalysisLayers":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/promise/all dojo/has ../../kernel dojo/i18n!../../nls/jsapi".split(" "),
function(H,d,m,n,q,f,c){var a=H(null,{filters:{all:{},categoryBoundaries:{tags:["boundaries","places"]},subCategoryBoundaries:{tags:["boundaries"]},subCategoryPlaces:{tags:["places"]},categoryHexBins:{tags:["hex"]},categoryTransportation:{tags:["transportation"]}},constructor:function(b){d.mixin(this,b);this.i18n=d.mixin({},c.browseLayersDlg);this.filterStrings={all:{title:this.i18n.categoryAll},categoryBoundaries:{title:this.i18n.categoryBoundaries},subCategoryBoundaries:{title:"\x26nbsp;\x26nbsp;\x26nbsp;\x26nbsp;"+
this.i18n.subCategoryBoundaries},subCategoryPlaces:{title:"\x26nbsp;\x26nbsp;\x26nbsp;\x26nbsp;"+this.i18n.subCategoryPlaces},categoryHexBins:{title:this.i18n.categoryHexBins},categoryTransportation:{title:this.i18n.categoryTransportation}}},fetchData:function(){this._portal=this.parent._portal;var b;return this._fetchGroups().then(d.hitch(this,function(k){b=m.map(k||[],function(h){if(h)return'group:"'+h.id+'"'});return this._fetchGroupItems(b)}))},_fetchGroup:function(b,k){this._groups=this._groups||
[];return this._groups[b]||this._portal.queryGroups(k,!0).then(d.hitch(this,function(h){0<h.total&&h.results&&(this._groups[b]=h.results);return this._groups[b]||[]}))},_fetchGroupItems:function(b,k){var h=this._isCustom?['-typekeywords:"Multilayer"']:['typekeywords:"Analysis Ready"'];this._portal&&this._portal.user&&this._portal.user.demographics||h.push('-typekeywords:"Requires Credits"');return this.parent._fetchItems({groups:b,query:k,types:['type:"Map Service"','type:"Feature Service"'],typekeywords:h})},
_fetchGroups:function(){return this._fetchEsriAnalysisLayers()},_fetchEsriAnalysisLayers:function(){if(this._portal&&this._portal.analysisLayersGroupQuery){var b=this._portal.analysisLayersGroupQuery;this._isCustomAnalysisQuery()&&(this.filterStrings=this.filters=null)}return this._fetchGroup("esriAnalysisLayers",{q:b,num:100,start:0}).then(d.hitch(this,function(k){k&&0<k.length&&(this.parent.sortAttribute=k[0].sortField,this.parent.sortDescending="asc"!==k[0].sortOrder);return k}))},_isCustomAnalysisQuery:function(){var b=
'title:"Living Atlas Analysis Layers" AND owner:esri',k=!1;this._portal&&this._portal.isPortal&&(b='title:"Living Atlas Analysis Layers" AND owner:esri_livingatlas');this._portal&&this._portal.analysisLayersGroupQuery&&this._portal.analysisLayersGroupQuery!==b&&(k=!0);return this._isCustom=k}});d.mixin(a,{add:function(b,k){b.plugIn||(k=k||{},k.parent=b,b.plugIn=new a(k))},remove:function(b){b.plugIn&&(b.plugIn.destroy(),delete b.plugIn)}});q("extend-esri")&&d.setObject("dijit.analysis.PluginAnalysisLayers",
a,f);return a})},"esri/tasks/Geoprocessor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/Deferred dojo/_base/json dojo/has dojo/io-query ../kernel ../request ../deferredUtils ../geometry/normalizeUtils ./Task ./FeatureSet ./JobInfo ./GPMessage ./LinearUnit ./DataFile ./RasterData ./Date ./ParameterValue ./GPResultImageLayer ../layers/ArcGISDynamicMapServiceLayer ../layers/MapImage".split(" "),function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F,y,D){H=H(g,{declaredClass:"esri.tasks.Geoprocessor",
_eventMap:{"execute-complete":["results","messages"],"get-result-data-complete":["result"],"get-result-image-complete":["mapImage"],"get-result-image-layer-complete":["layer"],"job-cancel":["jobInfo"],"job-complete":["jobInfo"],"status-update":["jobInfo"]},constructor:function(B){this._jobUpdateHandler=d.hitch(this,this._jobUpdateHandler);this._getJobStatus=d.hitch(this,this._getJobStatus);this._getResultDataHandler=d.hitch(this,this._getResultDataHandler);this._getResultImageHandler=d.hitch(this,
this._getResultImageHandler);this._executeHandler=d.hitch(this,this._executeHandler);this._updateTimers=[];this.registerConnectEvents()},updateDelay:1E3,processSpatialReference:null,outputSpatialReference:null,outSpatialReference:null,setUpdateDelay:function(B){this.updateDelay=B},setProcessSpatialReference:function(B){this.processSpatialReference=B},setOutputSpatialReference:function(B){this._setOutSR(B)},setOutSpatialReference:function(B){this._setOutSR(B)},__msigns:[{n:"execute",c:3,a:[{i:0,p:["*"]}],
e:2,f:1},{n:"submitJob",c:4,a:[{i:0,p:["*"]}],e:3}],_setOutSR:function(B){this.outSpatialReference=this.outputSpatialReference=B},_getOutSR:function(){return this.outSpatialReference||this.outputSpatialReference},_gpEncode:function(B,x,r){for(var t in B){var C=B[t];d.isArray(C)?B[t]=q.toJson(m.map(C,function(J){return this._gpEncode({item:J},!0).item},this)):C instanceof Date&&(B[t]=C.getTime())}return this._encode(B,x,r)},_decode:function(B){var x=B.dataType,r=new w(B);if(-1!==m.indexOf(["GPBoolean",
"GPDouble","GPLong","GPString"],x))return r;if("GPLinearUnit"===x)r.value=new v(r.value);else if("GPFeatureRecordSetLayer"===x||"GPRecordSet"===x)r.value=new e(r.value);else if("GPDataFile"===x)r.value=new z(r.value);else if("GPDate"===x)B=r.value,d.isString(B)?r.value=new E({date:B}):r.value=new Date(B);else if("GPRasterData"===x||"GPRasterDataLayer"===x)B=B.value.mapImage,r.value=B?new D(B):new u(r.value);else if(-1!==x.indexOf("GPMultiValue:")){var t=x.split(":")[1];B=r.value;r.value=m.map(B,function(C){return this._decode({paramName:"_name",
dataType:t,value:C}).value},this)}else console.log(this.declaredClass+" : GP Data type not handled. : "+r.dataType),r=null;return r},submitJob:function(B,x,r,t,C){var J=this._getOutSR(),L=C.assembly;B=this._gpEncode(d.mixin({},this._url.query,{f:"json","env:outSR":J?J.wkid||q.toJson(J.toJson()):null,"env:processSR":this.processSpatialReference?this.processSpatialReference.wkid||q.toJson(this.processSpatialReference.toJson()):null},B),null,L&&L[0]);var P=this._jobUpdateHandler,U=this._errorHandler;
return b({url:this._url.path+"/submitJob",content:B,callbackParamName:"callback",load:function(aa,ea){P(aa,ea,!1,x,r,C.dfd)},error:function(aa){U(aa,t,C.dfd)}})},_jobUpdateHandler:function(B,x,r,t,C,J){var L=B.jobId;x=new l(B);this._successHandler([x],"onStatusUpdate",C,r&&J);if(!r)switch(clearTimeout(this._updateTimers[L]),this._updateTimers[L]=null,J&&J.progress(x),B.jobStatus){case l.STATUS_SUBMITTED:case l.STATUS_EXECUTING:case l.STATUS_WAITING:case l.STATUS_NEW:var P=this._getJobStatus;this._updateTimers[L]=
setTimeout(function(){P(L,r,t,C,J)},this.updateDelay);break;default:this._successHandler([x],"onJobComplete",t,J)}},_getJobStatus:function(B,x,r,t,C){var J=this._jobUpdateHandler;b({url:this._url.path+"/jobs/"+B,content:d.mixin({},this._url.query,{f:"json"}),callbackParamName:"callback",load:function(L,P){J(L,P,x,r,t,C)},error:this._errorHandler})},_getResultDataHandler:function(B,x,r,t,C){try{var J=this._decode(B);this._successHandler([J],"onGetResultDataComplete",r,C)}catch(L){this._errorHandler(L,
t,C)}},getResultData:function(B,x,r,t){var C=this._getResultDataHandler,J=this._errorHandler,L=new n(k._dfdCanceller);L._pendingDfd=b({url:this._url.path+"/jobs/"+B+"/results/"+x,content:d.mixin({},this._url.query,{f:"json",returnType:"data"}),callbackParamName:"callback",load:function(P,U){C(P,U,r,t,L)},error:function(P){J(P,t,L)}});return L},checkJobStatus:function(B,x,r){var t=this._jobUpdateHandler,C=this._errorHandler,J=new n(k._dfdCanceller);J._pendingDfd=b({url:this._url.path+"/jobs/"+B,content:d.mixin({},
this._url.query,{f:"json"}),callbackParamName:"callback",load:function(L,P){t(L,P,!0,null,x,J)},error:function(L){C(L,r,J)}});return J},cancelJob:function(B,x,r){var t=this._errorHandler,C=new n(k._dfdCanceller);C._pendingDfd=b({url:this._url.path+"/jobs/"+B+"/cancel",content:d.mixin({},this._url.query,{f:"json"}),callbackParamName:"callback",load:d.hitch(this,function(J,L){this._successHandler([J],"onJobCancel",x,C)}),error:function(J){t(J,r,C)}});return C},execute:function(B,x,r,t){var C=this._getOutSR(),
J=t.assembly;B=this._gpEncode(d.mixin({},this._url.query,{f:"json","env:outSR":C?C.wkid||q.toJson(C.toJson()):null,"env:processSR":this.processSpatialReference?this.processSpatialReference.wkid||q.toJson(this.processSpatialReference.toJson()):null},B),null,J&&J[0]);var L=this._executeHandler,P=this._errorHandler;return b({url:this._url.path+"/execute",content:B,callbackParamName:"callback",load:function(U,aa){L(U,aa,x,r,t.dfd)},error:function(U){P(U,r,t.dfd)}})},_executeHandler:function(B,x,r,t,C){try{var J=
B.results,L,P=B.messages;var U=0;for(L=J.length;U<L;U++)J[U]=this._decode(J[U]);U=0;for(L=P.length;U<L;U++)P[U]=new p(P[U]);this._successHandler([J,P],"onExecuteComplete",r,C)}catch(aa){this._errorHandler(aa,t,C)}},_getResultImageHandler:function(B,x,r,t,C){try{var J=this._decode(B);this._successHandler([J],"onGetResultImageComplete",r,C)}catch(L){this._errorHandler(L,t,C)}},getResultImage:function(B,x,r,t,C){var J=this._getResultImageHandler,L=this._errorHandler;r=this._gpEncode(d.mixin({},this._url.query,
{f:"json"},r.toJson()));var P=new n(k._dfdCanceller);P._pendingDfd=b({url:this._url.path+"/jobs/"+B+"/results/"+x,content:r,callbackParamName:"callback",load:function(U,aa){J(U,aa,t,C,P)},error:function(U){L(U,C,P)}});return P},cancelJobStatusUpdates:function(B){clearTimeout(this._updateTimers[B]);this._updateTimers[B]=null},getResultImageLayer:function(B,x,r,t){if(null==x){var C=this._url.path.indexOf("/GPServer/");B=this._url.path.substring(0,C)+"/MapServer/jobs/"+B}else B=this._url.path+"/jobs/"+
B+"/results/"+x;this._url.query&&(B+="?"+c.objectToQuery(this._url.query));x=null==x?new y(B,{imageParameters:r}):new F(B,{imageParameters:r},!0);this.onGetResultImageLayerComplete(x);t&&t(x);return x},onStatusUpdate:function(){},onJobComplete:function(){},onExecuteComplete:function(){},onGetResultDataComplete:function(){},onGetResultImageComplete:function(){},onGetResultImageLayerComplete:function(){},onJobCancel:function(){}});h._createWrappers(H);f("extend-esri")&&d.setObject("tasks.Geoprocessor",
H,a);return H})},"esri/tasks/JobInfo":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel","./GPMessage"],function(H,d,m,n,q){H=H(null,{declaredClass:"esri.tasks.JobInfo",constructor:function(f){this.messages=[];d.mixin(this,f);f=this.messages;var c,a=f.length;for(c=0;c<a;c++)f[c]=new q(f[c])},jobId:"",jobStatus:""});d.mixin(H,{STATUS_CANCELLED:"esriJobCancelled",STATUS_CANCELLING:"esriJobCancelling",STATUS_DELETED:"esriJobDeleted",STATUS_DELETING:"esriJobDeleting",STATUS_EXECUTING:"esriJobExecuting",
STATUS_FAILED:"esriJobFailed",STATUS_NEW:"esriJobNew",STATUS_SUBMITTED:"esriJobSubmitted",STATUS_SUCCEEDED:"esriJobSucceeded",STATUS_TIMED_OUT:"esriJobTimedOut",STATUS_WAITING:"esriJobWaiting"});m("extend-esri")&&d.setObject("tasks.JobInfo",H,n);return H})},"esri/tasks/GPMessage":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(H,d,m,n){H=H(null,{declaredClass:"esri.tasks.GPMessage",constructor:function(q){d.mixin(this,q)}});d.mixin(H,{TYPE_INFORMATIVE:"esriJobMessageTypeInformative",
TYPE_PROCESS_DEFINITION:"esriJobMessageTypeProcessDefinition",TYPE_PROCESS_START:"esriJobMessageTypeProcessStart",TYPE_PROCESS_STOP:"esriJobMessageTypeProcessStop",TYPE_WARNING:"esriJobMessageTypeWarning",TYPE_ERROR:"esriJobMessageTypeError",TYPE_EMPTY:"esriJobMessageTypeEmpty",TYPE_ABORT:"esriJobMessageTypeAbort"});m("extend-esri")&&d.setObject("tasks.GPMessage",H,n);return H})},"esri/tasks/DataFile":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(H,d,m,
n){H=H(null,{declaredClass:"esri.tasks.DataFile",constructor:function(q){q&&d.mixin(this,q)},url:null,itemID:null,toJson:function(){var q={};this.url&&(q.url=this.url);this.itemID&&(q.itemID=this.itemID);return q}});m("extend-esri")&&d.setObject("tasks.DataFile",H,n);return H})},"esri/tasks/RasterData":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(H,d,m,n){H=H(null,{declaredClass:"esri.tasks.RasterData",constructor:function(q){q&&d.mixin(this,q)},url:null,
format:null,itemID:null,toJson:function(){var q={};this.url&&(q.url=this.url);this.format&&(q.format=this.format);this.itemID&&(q.itemID=this.itemID);return q}});m("extend-esri")&&d.setObject("tasks.RasterData",H,n);return H})},"esri/tasks/Date":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/date/locale","dojo/has","../kernel"],function(H,d,m,n,q){H=H(null,{declaredClass:"esri.tasks.Date",constructor:function(f){f&&(f.format&&(this.format=f.format),this.date=m.parse(f.date,{selector:"date",
datePattern:this.format}))},date:new Date,format:"EEE MMM dd HH:mm:ss zzz yyyy",toJson:function(){return{date:m.format(this.date,{selector:"date",datePattern:this.format}),format:this.format}}});n("extend-esri")&&d.setObject("tasks.Date",H,q);return H})},"esri/tasks/ParameterValue":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(H,d,m,n){H=H(null,{declaredClass:"esri.tasks.ParameterValue",constructor:function(q){d.mixin(this,q)}});m("extend-esri")&&d.setObject("tasks.ParameterValue",
H,n);return H})},"esri/tasks/GPResultImageLayer":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has dojo/io-query ../kernel ../layers/ArcGISDynamicMapServiceLayer".split(" "),function(H,d,m,n,q,f,c){H=H(c,{declaredClass:"esri.tasks._GPResultImageLayer",constructor:function(a,b){b&&b.imageParameters&&b.imageParameters.extent&&(this.initialExtent=this.fullExtent=b.imageParameters.extent,this.spatialReference=this.initialExtent.spatialReference);this.getImageUrl=d.hitch(this,
this.getImageUrl);this.loaded=!0;this.onLoad(this)},getImageUrl:function(a,b,k,h){var g=a.spatialReference.wkid;h(this._url.path+"?"+q.objectToQuery(d.mixin(this._params,{f:"image",bbox:m.toJson(a.toJson()),bboxSR:g,imageSR:g,size:b+","+k})))}});n("extend-esri")&&d.setObject("tasks._GPResultImageLayer",H,f);return H})},"esri/dijit/SingleFilter":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/json dojo/has dojo/json dojo/string dojo/number dojo/dom dojo/dom-style dojo/dom-attr dojo/dom-construct dojo/query dojo/dom-class dojo/_base/event dojo/Evented dojo/data/ItemFileWriteStore dojo/date/locale dojo/parser dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dijit/_OnDijitClickMixin dijit/_FocusMixin dijit/registry dijit/form/TextBox dijit/form/FilteringSelect dijit/form/RadioButton dijit/form/DateTextBox dijit/form/NumberTextBox ../config ../kernel ../lang ../tasks/GenerateRendererTask ../tasks/UniqueValueDefinition ../tasks/GenerateRendererParameters ../layers/FeatureLayer ../layers/GeoRSSLayer ./analysis/ItemTypes dojo/i18n!../nls/jsapi dojo/text!./templates/SingleFilter.html".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F,y,D,B,x,r,t,C,J,L,P,U,aa,ea,ba,oa,da,fa,S,W,la,K,O){H=d([y,D,B,x,r,u],{declaredClass:"esri.dijit.SingleFilter",widgetsInTemplate:!0,templateString:O,valueHandlers:[],onFieldChangeEnabled:!0,onOperatorChangeEnabled:!0,onPromptChangeHandler:null,onHintChangeHandler:null,fieldDomains:{},fieldsStore:null,fieldsInfo:{stringFieldsCount:0,numberFieldsCount:0,dateFieldsCount:0},stringOperatorStore:null,dateOperatorStore:null,numberOperatorStore:null,uniqueValuesStore:null,
isEnableInteractiveFilter:!0,uniqueValuesResults:{},partsObj:null,dayInMS:86399E3,allowAllDateTypes:!1,showUnique:!0,postMixInProperties:function(){this.inherited(arguments);this.i18n={};this.i18n=m.mixin(this.i18n,K.filterDlg)},parseExpressionTemplate:function(){var G=function(qa,ia){h.byId(ia).className="attributeValueContainer";"field_dropdown"===qa?h.byId(ia).innerHTML=M:"operator_dropdown"===qa?h.byId(ia).innerHTML=N:"values_input"===qa?h.byId(ia).innerHTML=V+Y:console.error("problem with expressionTemplate from localization file")},
M='\x3cselect id\x3d"'+this.id+'.fieldsList" class\x3d"attributeField" data-dojo-type\x3d"dijit/form/FilteringSelect" maxHeight\x3d"150" sortByLabel\x3d"true"\x3e\x3c/select\x3e',N='\x3cselect id\x3d"'+this.id+'.operatorList" class\x3d"operator" data-dojo-type\x3d"dijit/form/FilteringSelect" maxHeight\x3d"150" sortByLabel\x3d"false"\x3e\x3c/select\x3e',V='\x3cdiv id\x3d"'+this.id+'.attributeValueContainer"\x3e\x3c/div\x3e',Y='\x3cdiv class\x3d"attributeValueOptions"\x3e\x3ctable cellpadding\x3d"0" cellspacing\x3d"0"\x3e  \x3ctbody\x3e    \x3ctr\x3e      \x3ctd nowrap\x3d"nowrap"\x3e        \x3cinput id\x3d"'+
this.id+'.radioValue" class\x3d"radioValue attributeValueRadio" checked\x3d"checked" name\x3d"'+this.id+'.inputOption" data-dojo-type\x3d"dijit/form/RadioButton" title\x3d"'+this.i18n.valueTooltip+'"/\x3e        \x3clabel class\x3d"labels" title\x3d"'+this.i18n.valueTooltip+'"\x3e'+this.i18n.value+'        \x3c/label\x3e      \x3c/td\x3e      \x3ctd nowrap\x3d"nowrap" class\x3d"esriLeadingPadding05"\x3e        \x3cinput id\x3d"'+this.id+'.radioFields" class\x3d"radioFields attributeValueRadio" name\x3d"'+
this.id+'.inputOption" data-dojo-type\x3d"dijit/form/RadioButton" title\x3d"'+this.i18n.fieldTooltip+'"/\x3e        \x3clabel class\x3d"labels" title\x3d"'+this.i18n.fieldTooltip+'"\x3e'+this.i18n.field+'        \x3c/label\x3e      \x3c/td\x3e      \x3ctd id\x3d"'+this.id+'.radioUniqueColumn" nowrap\x3d"nowrap" class\x3d"esriLeadingPadding05"\x3e        \x3cinput id\x3d"'+this.id+'.radioUnique" class\x3d"radioUnique attributeValueRadio" name\x3d"'+this.id+'.inputOption" data-dojo-type\x3d"dijit/form/RadioButton" title\x3d"'+
this.i18n.uniqueValueTooltip+'"/\x3e        \x3clabel class\x3d"labels" title\x3d"'+this.i18n.uniqueValueTooltip+'"\x3e'+this.i18n.uniqueValues+"        \x3c/label\x3e      \x3c/td\x3e    \x3c/tr\x3e  \x3c/tbody\x3e\x3c/table\x3e\x3c/div\x3e",ka=this.i18n.expressionTemplate,ja=ka.indexOf("${"),R=ka.substring(0,ja).trim();h.byId(this.id+".column1").innerHTML=R.length?"\x3cdiv class\x3d'attributeText'\x3e"+R+"\x3c/div\x3e":"";R=ka.indexOf("}",ja+1);var ha=ka.substring(ja+2,R);G(ha,this.id+".column2");
ja=ka.indexOf("${",ja+1);R=ka.substring(R+1,ja).trim();h.byId(this.id+".column3").innerHTML=R.length?"\x3cdiv class\x3d'attributeText'\x3e"+R+"\x3c/div\x3e":"";R=ka.indexOf("}",ja+1);ha=ka.substring(ja+2,R);G(ha,this.id+".column4");ja=ka.indexOf("${",ja+1);R=ka.substring(R+1,ja).trim();h.byId(this.id+".column5").innerHTML=R.length?"\x3cdiv class\x3d'attributeText'\x3e"+R+"\x3c/div\x3e":"";R=ka.indexOf("}",ja+1);ha=ka.substring(ja+2,R);G(ha,this.id+".column6");R=ka.substring(R+1,ka.length).trim();
h.byId(this.id+".column7").innerHTML=R.length?"\x3cdiv class\x3d'attributeText'\x3e"+R+"\x3c/div\x3e":""},postCreate:function(){this.inherited(arguments);this.parseExpressionTemplate();this.createOperatorStores();this.createFieldsStore(this.fields);this.readCodedValues();F.parse(h.byId(this.id+".exprTable")).then(m.hitch(this,function(G){q.connect(this.getFieldsList(),"onChange",this,"onChangeField");q.connect(this.getOperatorList(),"onChange",this,"onChangeOperator");q.connect(t.byId(this.id+".radioValue"),
"onClick",this,"showValueInput");q.connect(t.byId(this.id+".radioFields"),"onClick",this,"showFields");q.connect(t.byId(this.id+".radioUnique"),"onClick",this,"showUniqueList");this.version&&10.1>this.version&&this.mapLayer.url&&this.showUnique&&g.set(h.byId(this.id+".radioUniqueColumn"),"display","none");q.connect(h.byId(this.id+".deleteExpression"),"onclick",this,"onClickDeleteExpression");q.connect(this.interactiveCheck,"onclick",this,"onInteractiveClick");q.connect(this.interactiveArrow,"onclick",
this,"onClickShowHideInteractive");this.enableInteractiveHandlers();this.isEnableInteractiveFilter||g.set(this._interactiveFilterRow,"display","none");g.set(h.byId(this.id+".radioUniqueColumn"),"display",this.showUnique?"block":"none");this.own(this.watch("showUnique",m.hitch(this,function(M,N,V){g.set(h.byId(this.id+".radioUniqueColumn"),"display",V?"block":"none")})))}))},constructor:function(G,M){this.id=G.id||"";this.owner=G.owner;this.version=G.version;this.part=G.part;this.fields=G.fields;this.mapLayer=
G.mapLayer;!1===G.enableEvents&&(this.onOperatorChangeEnabled=this.onFieldChangeEnabled=!1)},init:function(G){if(!G.part||this.mapLayer&&G.mapLayer&&this.mapLayer.id!==G.mapLayer.id)this.clearAttributeValueDijits(),this.mapLayer=G.mapLayer,this.version=G.version,this.fields=G.fields,this.createOperatorStores(),this.createFieldsStore(this.fields),this.readCodedValues(),this.fillFieldsList(this.fieldsStore),this.onChangeField();G.part&&(this.part=G.part,this.onOperatorChangeEnabled=this.onFieldChangeEnabled=
!1,this.buildEditUIField(this.part,this))},destroy:function(){this.onOperatorChangeEnabled=this.onFieldChangeEnabled=!1;this.clearAttributeValueDijits();n.forEach(t.findWidgets(h.byId(this.id)),function(G){G.destroyRecursive()});this.inherited(arguments)},toJson:function(){var G=null;this.isInteractiveChecked()&&(G={prompt:this.promptText.attr("value"),hint:this.hintText.attr("value")});return{fieldObj:this.getField(),operator:this.getOperator(),valueObj:this.getValue(),interactiveObj:G}},buildFriendlyTextExpr:function(G){var M=
this.i18n.expressionTemplate,N=function(ka,ja,R){return b.substitute(M,{field_dropdown:ka,operator_dropdown:ja,values_input:R})};if(!1===G.valueObj.isValid)return"\x26lt;expression is missing value\x26gt;";var V="";if("string"===G.fieldObj.shortType)G.operator===this.i18n.stringOperatorIsBlank||G.operator===this.i18n.stringOperatorIsNotBlank?V=N(G.fieldObj.label,G.operator,""):"field"===G.valueObj.type?V=N(G.fieldObj.label,G.operator,G.valueObj.label):(V=this.getDecodedValue(G.interactiveObj?G.interactiveObj.value:
G.valueObj.value,G.fieldObj.name),V=N(G.fieldObj.label,G.operator,"'"+V+"'"));else if("number"===G.fieldObj.shortType)if(G.operator===this.i18n.numberOperatorIsBetween||G.operator===this.i18n.numberOperatorIsNotBetween)V=G.interactiveObj?G.interactiveObj.value2:G.valueObj.value2,V=N(G.fieldObj.label,G.operator,k.format(G.interactiveObj?G.interactiveObj.value1:G.valueObj.value1,{pattern:"#####0.##########"})+" "+this.i18n.andBetweenValues+" "+k.format(V,{pattern:"#####0.##########"}));else if(G.operator===
this.i18n.numberOperatorIsBlank||G.operator===this.i18n.numberOperatorIsNotBlank)V=N(G.fieldObj.label,G.operator,"");else if("field"===G.valueObj.type)V=N(G.fieldObj.label,G.operator,G.valueObj.label);else{V=G.interactiveObj?G.interactiveObj.value:G.valueObj.value;var Y=this.getDecodedValue(V,G.fieldObj.name);V=N(G.fieldObj.label,G.operator,V!==Y?"'"+Y+"'":k.format(V,{pattern:"#####0.##########"}))}else ba.isDefined(G.valueObj.value)&&"field"!==G.valueObj.type&&"string"===typeof G.valueObj.value&&
(G.valueObj.value=new Date(G.valueObj.value)),V=G.operator===this.i18n.dateOperatorIsBetween||G.operator===this.i18n.dateOperatorIsNotBetween?N(G.fieldObj.label,G.operator,(G.interactiveObj?this.formatFriendlyDate(G.interactiveObj.value1):this.formatFriendlyDate(G.valueObj.value1))+" "+this.i18n.andBetweenValues+" "+(G.interactiveObj?this.formatFriendlyDate(G.interactiveObj.value2):this.formatFriendlyDate(this.addDay(G.valueObj.value2)))):G.operator===this.i18n.dateOperatorIsBlank||G.operator===this.i18n.dateOperatorIsNotBlank?
N(G.fieldObj.label,G.operator,""):"field"===G.valueObj.type?N(G.fieldObj.label,G.operator,G.valueObj.label):N(G.fieldObj.label,G.operator,G.interactiveObj?this.formatFriendlyDate(G.interactiveObj.value):this.formatFriendlyDate(G.valueObj.value));return V},builtSingleFilterString:function(G,M){if(ba.isDefined(G.valueObj.isValid)&&!G.valueObj.isValid)return{whereClause:null};var N=G.valueObj.value,V=G.valueObj.value1,Y=G.valueObj.value2,ka=!1;if(G.interactiveObj){if(!G.interactiveObj.prompt||!G.interactiveObj.hint)return{whereClause:null};
ba.isDefined(M)&&(ka=!0,ba.isDefined(G.valueObj.value)&&(N="{"+M+"}"),ba.isDefined(G.valueObj.value1)&&(V="{"+M+"}"),ba.isDefined(G.valueObj.value2)&&(Y="{"+(M+1)+"}"))}var ja="",R=G.fieldObj.name;this.mapLayer&&this.mapLayer.url&&-1!==this.mapLayer.url.indexOf("BigDataCatalogServer")&&this.hasWhiteSpace(R)&&(R='"'+R+'"');if("string"===G.fieldObj.shortType)switch(M="",N&&"field"!==G.valueObj.type&&this.isHostedService(this.mapLayer.url)&&this.containsNonLatinCharacter(N)&&(M="N"),G.operator){case this.i18n.stringOperatorIs:ja=
"field"===G.valueObj.type?R+" \x3d "+N:R+" \x3d "+M+"'"+N.replace(/'/g,"''")+"'";break;case this.i18n.stringOperatorIsNot:ja="field"===G.valueObj.type?R+" \x3c\x3e "+N:R+" \x3c\x3e "+M+"'"+N.replace(/'/g,"''")+"'";break;case this.i18n.stringOperatorStartsWith:ja=R+" LIKE "+M+"'"+N.replace(/'/g,"''")+"%'";break;case this.i18n.stringOperatorEndsWith:ja=R+" LIKE "+M+"'%"+N.replace(/'/g,"''")+"'";break;case this.i18n.stringOperatorContains:ja=R+" LIKE "+M+"'%"+N.replace(/'/g,"''")+"%'";break;case this.i18n.stringOperatorDoesNotContain:ja=
R+" NOT LIKE "+M+"'%"+N.replace(/'/g,"''")+"%'";break;case this.i18n.stringOperatorIsBlank:ja=R+" IS NULL";break;case this.i18n.stringOperatorIsNotBlank:ja=R+" IS NOT NULL"}else if("number"===G.fieldObj.shortType)switch(G.operator){case this.i18n.numberOperatorIs:ja=R+" \x3d "+N;break;case this.i18n.numberOperatorIsNot:ja=R+" \x3c\x3e "+N;break;case this.i18n.numberOperatorIsAtLeast:ja=R+" \x3e\x3d "+N;break;case this.i18n.numberOperatorIsLessThan:ja=R+" \x3c "+N;break;case this.i18n.numberOperatorIsAtMost:ja=
R+" \x3c\x3d "+N;break;case this.i18n.numberOperatorIsGreaterThan:ja=R+" \x3e "+N;break;case this.i18n.numberOperatorIsBetween:ja=R+" BETWEEN "+V+" AND "+Y;break;case this.i18n.numberOperatorIsNotBetween:ja=R+" NOT BETWEEN "+V+" AND "+Y;break;case this.i18n.numberOperatorIsBlank:ja=R+" IS NULL";break;case this.i18n.numberOperatorIsNotBlank:ja=R+" IS NOT NULL"}else switch(ba.isDefined(N)&&"field"!==G.valueObj.type&&"string"===typeof N&&(N=this.parseFriendlyDate(N)),G.operator){case this.i18n.dateOperatorIsOn:ja=
"field"===G.valueObj.type?R+" \x3d "+N:ka?R+" BETWEEN "+(this.supportsStandardizedQuery?"timestamp ":"")+"'{"+M+"}' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'{"+(M+1)+"}'":R+" BETWEEN "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(N)+"' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(this.addDay(N))+"'";break;case this.i18n.dateOperatorIsNotOn:ja="field"===G.valueObj.type?R+" \x3c\x3e "+N:ka?R+" NOT BETWEEN "+(this.supportsStandardizedQuery?
"timestamp ":"")+"'{"+M+"}' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'{"+(M+1)+"}'":R+" NOT BETWEEN "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(N)+"' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(this.addDay(N))+"'";break;case this.i18n.dateOperatorIsBefore:ja="field"===G.valueObj.type?R+" \x3c "+N:R+" \x3c "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(N)+"'";break;case this.i18n.dateOperatorIsAfter:ja=
"field"===G.valueObj.type?R+" \x3e "+N:R+" \x3e "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(this.addDay(N))+"'";break;case this.i18n.dateOperatorIsBetween:ja=ka?R+" BETWEEN '"+V+"' AND '"+Y+"'":R+" BETWEEN "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(V)+"' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(this.addDay(Y))+"'";break;case this.i18n.dateOperatorIsNotBetween:ja=ka?R+" NOT BETWEEN '"+V+"' AND '"+Y+"'":R+" NOT BETWEEN "+
(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(V)+"' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(this.addDay(Y))+"'";break;case this.i18n.dateOperatorIsBlank:ja=R+" IS NULL";break;case this.i18n.dateOperatorIsNotBlank:ja=R+" IS NOT NULL"}return{whereClause:ja}},showDeleteIcon:function(){g.set(h.byId(this.id+".deleteExpression"),"display","block")},hideDeleteIcon:function(){g.set(h.byId(this.id+".deleteExpression"),"display","none")},createFieldsStore:function(G){if(G&&
G.length){G=m.clone(G);G=G.sort(function(N,V){N.label=N.alias||N.name;V.label=V.alias||V.name;return N.label<V.label?-1:N.label>V.label?1:0});var M=this.isHostedService(this.mapLayer.url);this.supportsStandardizedQuery=10.2<=this.mapLayer.version&&(this.mapLayer.useStandardizedQueries||this.isBigDataLayer(this.mapLayer));G=n.filter(G,function(N,V){return"esriFieldTypeString"===N.type||"esriFieldTypeDouble"===N.type||"esriFieldTypeSingle"===N.type||"esriFieldTypeInteger"===N.type||"esriFieldTypeSmallInteger"===
N.type||"esriFieldTypeDate"===N.type&&(this.allowAllDateTypes||M||this.supportsStandardizedQuery)?!0:!1},this);G=n.map(G,function(N,V){switch(N.type){case "esriFieldTypeString":var Y="string";this.fieldsInfo.stringFieldsCount++;break;case "esriFieldTypeDate":Y="date";this.fieldsInfo.dateFieldsCount++;break;default:Y="number",this.fieldsInfo.numberFieldsCount++}return{id:V,label:N.label,shortType:Y,alias:N.alias,editable:N.editable,name:N.name,nullable:N.nullable,type:N.type}},this);G.length&&(this.fieldsStore=
new E({data:{identifier:"id",label:"label",items:G}}))}},createOperatorStores:function(){var G=[];G.push({name:this.i18n.stringOperatorIs,name_:this.i18n.stringOperatorIs,id:0});G.push({name:this.i18n.stringOperatorIsNot,name_:this.i18n.stringOperatorIsNot,id:1});G.push({name:this.i18n.stringOperatorStartsWith,name_:this.i18n.stringOperatorStartsWith,id:2});G.push({name:this.i18n.stringOperatorEndsWith,name_:this.i18n.stringOperatorEndsWith,id:3});G.push({name:this.i18n.stringOperatorContains,name_:this.i18n.stringOperatorContains,
id:4});G.push({name:this.i18n.stringOperatorDoesNotContain,name_:this.i18n.stringOperatorDoesNotContain,id:5});G.push({name:this.i18n.stringOperatorIsBlank,name_:this.i18n.stringOperatorIsBlank,id:6});G.push({name:this.i18n.stringOperatorIsNotBlank,name_:this.i18n.stringOperatorIsNotBlank,id:7});this.stringOperatorStore=new E({data:{label:"name",identifier:"id",items:G}});G=[];G.push({name:this.i18n.dateOperatorIsOn,id:0});G.push({name:this.i18n.dateOperatorIsNotOn,id:1});G.push({name:this.i18n.dateOperatorIsBefore,
id:2});G.push({name:this.i18n.dateOperatorIsAfter,id:3});G.push({name:this.i18n.dateOperatorIsBetween,id:6});G.push({name:this.i18n.dateOperatorIsNotBetween,id:7});G.push({name:this.i18n.dateOperatorIsBlank,id:8});G.push({name:this.i18n.dateOperatorIsNotBlank,id:9});this.dateOperatorStore=new E({data:{label:"name",identifier:"id",items:G}});G=[];G.push({name:this.i18n.numberOperatorIs,name_:this.i18n.numberOperatorIs,id:0});G.push({name:this.i18n.numberOperatorIsNot,name_:this.i18n.numberOperatorIsNot,
id:1});G.push({name:this.i18n.numberOperatorIsAtLeast,name_:this.i18n.numberOperatorIsAtLeast,id:2});G.push({name:this.i18n.numberOperatorIsLessThan,name_:this.i18n.numberOperatorIsLessThan,id:3});G.push({name:this.i18n.numberOperatorIsAtMost,name_:this.i18n.numberOperatorIsAtMost,id:4});G.push({name:this.i18n.numberOperatorIsGreaterThan,name_:this.i18n.numberOperatorIsGreaterThan,id:5});G.push({name:this.i18n.numberOperatorIsBetween,name_:this.i18n.numberOperatorIsBetween,id:6});G.push({name:this.i18n.numberOperatorIsNotBetween,
name_:this.i18n.numberOperatorIsNotBetween,id:7});G.push({name:this.i18n.numberOperatorIsBlank,name_:this.i18n.numberOperatorIsBlank,id:8});G.push({name:this.i18n.numberOperatorIsNotBlank,name_:this.i18n.numberOperatorIsNotBlank,id:9});this.numberOperatorStore=new E({data:{label:"name",identifier:"id",items:G}})},readCodedValues:function(){n.forEach(this.mapLayer.fields,function(G){G.domain&&G.domain.codedValues&&(this.fieldDomains[G.name]=G.domain.codedValues)},this)},getDecodedValue:function(G,
M){M=this.getCodedValues(M);var N;if(M)for(N=0;N<M.length;N+=1){var V=M[N];if(V.code===G)return V.name}return G},getCodedValues:function(G){return this.fieldDomains[G]},getFieldsList:function(){return t.byId(this.id+".fieldsList")},getOperatorList:function(){return t.byId(this.id+".operatorList")},getValueFieldsList:function(){return t.byId(this.id+".valueFields")},getAttrValContNode:function(){return h.byId(this.id+".attributeValueContainer")},getField:function(){var G=this.getFieldsList();return{name:G.store.getValue(G.item,
"name"),label:G.store.getValue(G.item,"label"),shortType:G.store.getValue(G.item,"shortType"),type:G.store.getValue(G.item,"type")}},getOperator:function(){var G=this.getOperatorList();return G.item?G.store.getValue(G.item,"name"):""},getValue:function(){return{}},isInteractiveChecked:function(){return this.interactiveCheck.checked},setInteractiveSection:function(G,M,N){this.disableInteractiveHandlers();this.interactiveCheck.checked=G;this.promptText.attr("value",M);this.hintText.attr("value",N);
g.set(this.interactiveSpace,"display","block");this.interactiveArrow.innerHTML="\x26nbsp;\x26#9650;";this.enableInteractiveHandlers()},enableInteractiveHandlers:function(){this.onPromptChangeHandler=q.connect(this.promptText,"onChange",this,"onChangeInteractive");this.onHintchangeHandler=q.connect(this.hintText,"onChange",this,"onChangeInteractive")},disableInteractiveHandlers:function(){q.disconnect(this.onPromptChangeHandler);q.disconnect(this.onHintChangeHandler)},fillFieldsList:function(G){var M=
this.getFieldsList();M.set("labelAttr","label");M.set("searchAttr","label");M.set("store",G);M.set("value",0)},fillOperatorList:function(G,M,N){var V=this.getOperatorList();V.set("labelAttr","name");V.set("searchAttr","name");V.set("query",N?N:{});V.set("store",G);if(M){var Y=!1;for(N=0;20>N&&(G.fetchItemByIdentity({identity:N,onItem:m.hitch(this,function(ka){ka&&ka.name[0]===M&&(V.set("value",ka.id[0]),Y=!0)})}),!Y);N++);}else V.set("value",0)},createValueString:function(G){var M=this.getAttrValContNode();
this.clearAttributeValueDijits();l.empty(M);if(G){M=new J({id:this.id+".value","class":"attributeValue",maxHeight:150,sortByLabel:!0},l.create("div",{},M));var N=this.buildCodedValuesStore(G);M.set("store",N);M.set("value",0);this.valueHandlers.push(q.connect(M,"onChange",this,"onValueChange"))}else M=new C({id:this.id+".value","class":"attributeValue",required:!0,placeHolder:"",intermediateChanges:!0},l.create("div",{},M)),this.valueHandlers.push(q.connect(M,"onChange",this,"onValueChange"));this.checkDefaultOption();
this.getValue=function(){var V=t.byId(this.id+".value"),Y=!0;G?V.item?V=V.item.code[0]:(V="",Y=!1):Y=V=V.get("value");return{value:V,isValid:Y}}},createValueDate:function(){var G=this.getAttrValContNode();this.clearAttributeValueDijits();l.empty(G);G=new P({id:this.id+".value","class":"attributeValue",trim:!0,required:!0,placeHolder:"",constraints:{formatLength:"short"}},l.create("div",{},G));this.checkDefaultOption();this.valueHandlers.push(q.connect(G,"onChange",this,"onValueChange"));this.getValue=
function(){var M=t.byId(this.id+".value").get("value");return{value:M,isValid:ba.isDefined(M)}}},createValueNumber:function(G){var M=this.getAttrValContNode();this.clearAttributeValueDijits();l.empty(M);if(G){M=new J({id:this.id+".value","class":"attributeValue",maxHeight:150,sortByLabel:!0},l.create("div",{},M));var N=this.buildCodedValuesStore(G);M.set("store",N);M.set("value",0);this.valueHandlers.push(q.connect(M,"onChange",this,"onValueChange"))}else M=new U({id:this.id+".value","class":"attributeValue",
required:!0,placeHolder:"",intermediateChanges:!0,constraints:{pattern:"#####0.##########"}},l.create("div",{},M)),this.valueHandlers.push(q.connect(M,"onChange",this,"onValueChange"));this.checkDefaultOption();this.getValue=function(){var V=t.byId(this.id+".value"),Y=!0;G?V.item?V=V.item.code[0]:(V="",Y=!1):(V=V.get("value"),Y=ba.isDefined(V)&&!isNaN(V));return{value:V,isValid:Y}}},createValueBetweenDate:function(){var G=this.getAttrValContNode();this.clearAttributeValueDijits();l.empty(G);var M=
new P({id:this.id+".value1","class":"attributeValue1",trim:!0,required:!0,placeHolder:"",constraints:{formatLength:"short"}},l.create("div",{},G));l.create("span",{innerHTML:this.i18n.andBetweenValues,"class":"attributeBetweenValues"},G);G=new P({id:this.id+".value2","class":"attributeValue2",trim:!0,required:!0,placeHolder:"",constraints:{formatLength:"short"}},l.create("div",{},G));this.checkDefaultOption();this.valueHandlers.push(q.connect(M,"onChange",this,"onValueChange"));this.valueHandlers.push(q.connect(G,
"onChange",this,"onValueChange"));this.getValue=function(){var N=t.byId(this.id+".value1").get("value"),V=t.byId(this.id+".value2").get("value");return{value1:N,value2:V,isValid:ba.isDefined(N)&&ba.isDefined(V)}}},createValueBetweenNumber:function(){var G=this.getAttrValContNode();this.clearAttributeValueDijits();l.empty(G);var M=new U({id:this.id+".value1","class":"attributeValue1",required:!0,placeHolder:"",intermediateChanges:!0,constraints:{pattern:"#####0.##########"}},l.create("div",{},G));
l.create("span",{innerHTML:this.i18n.andBetweenValues,"class":"attributeBetweenValues"},G);G=new U({id:this.id+".value2","class":"attributeValue2",required:!0,placeHolder:"",intermediateChanges:!0,constraints:{pattern:"#####0.##########"}},l.create("div",{},G));this.checkDefaultOption();this.valueHandlers.push(q.connect(M,"onChange",this,"onValueChange"));this.valueHandlers.push(q.connect(G,"onChange",this,"onValueChange"));this.getValue=function(){var N=t.byId(this.id+".value1").get("value"),V=t.byId(this.id+
".value2").get("value");return{value1:N,value2:V,isValid:ba.isDefined(N)&&ba.isDefined(V)&&!isNaN(N)&&!isNaN(V)&&N<=V}}},createValueInTheLastDate:function(){},createValueIsBlank:function(){var G=this.getAttrValContNode();this.clearAttributeValueDijits();l.empty(G);G.innerHTML="\x3cinput id\x3d'"+this.id+".value' class\x3d'attributeValue' type\x3d'text' disabled\x3d'true'/\x3e";this.checkDefaultOption();this.getValue=function(){return{value:null,isValid:!0}}},createValueFields:function(G,M,N){var V=
this.getAttrValContNode();this.clearAttributeValueDijits();l.empty(V);var Y=new J({id:this.id+".valueFields","class":"attributeValue",maxHeight:150,labelAttr:"label",searchAttr:"label",store:G,query:M},l.create("div",{},V));if(N){var ka=!1;for(V=0;100>V&&(G.fetchItemByIdentity({identity:V,onItem:m.hitch(this,function(ja){ja&&ja.shortType[0]===M.shortType&&ja.name[0]!==N&&(Y.set("value",ja.id),ka=!0)})}),!ka);V++);}this.valueHandlers.push(q.connect(Y,"onChange",this,"onValueChange"));this.getValue=
function(){var ja=t.byId(this.id+".valueFields");return{value:ja.store.getValue(ja.item,"name"),label:ja.store.getValue(ja.item,"label"),type:"field",isValid:!0}}},createValueUnique:function(G){var M=this.getAttrValContNode();this.clearAttributeValueDijits();l.empty(M);G=new J({id:this.id+".valueUnique","class":"attributeValue",maxHeight:150,store:G},l.create("div",{},M));G.set("value",0);this.valueHandlers.push(q.connect(G,"onChange",this,"onValueChange"));this.getValue=function(){var N=t.byId(this.id+
".valueUnique");return{value:N.store.getValue(N.item,"value"),isValid:!0}}},setValue:function(G,M){if(M)for(var N=0;N<M.length;N++){if(G===M[N].code){t.byId(this.id+".value").set("value",N);break}}else"date"===this.part.fieldObj.shortType?t.byId(this.id+".value").set("value",new Date(G)):("number"===this.part.fieldObj.shortType&&(G=Number(G)),t.byId(this.id+".value").set("value",G))},setValue1:function(G){"date"===this.part.fieldObj.shortType?G=new Date(G):"number"===this.part.fieldObj.shortType&&
(G=Number(G));t.byId(this.id+".value1").set("value",G)},setValue2:function(G){"date"===this.part.fieldObj.shortType?G=new Date(G):"number"===this.part.fieldObj.shortType&&(G=Number(G));t.byId(this.id+".value2").set("value",G)},setValueFieldById:function(G){this.getValueFieldsList().set("value",G)},enableOnFieldChange:function(){this.onFieldChangeEnabled=!0},enableOnOperatorChange:function(){this.onOperatorChangeEnabled=!0},onChangeField:function(G){this.onFieldChangeEnabled&&this._onChangeField(this.getFieldsList(),
this)},onChangeOperator:function(G){this.onOperatorChangeEnabled&&this._onChangeOperator(this.getOperatorList(),this)},onClickDeleteExpression:function(G){this._deleteExpression(this)},_onChangeField:function(G,M,N){var V=!!this.mapLayer&&this.isPortalHostedService(this.mapLayer.url);this.isBigDataLayer(this.mapLayer)||V&&"esriFieldTypeDate"===this.fieldsStore.getValue(G.item,"type")?g.set(h.byId(this.id+".radioUniqueColumn"),"display","none"):g.set(h.byId(this.id+".radioUniqueColumn"),"display",
"");V=M.getOperatorList();switch(this.fieldsStore.getValue(G.item,"type")){case "esriFieldTypeString":var Y=null;G=this.fieldsStore.getValue(G.item,"name");this.getCodedValues(G)&&(Y=this.i18n.stringOperatorStartsWith,Y+="|"+this.i18n.stringOperatorEndsWith,Y+="|"+this.i18n.stringOperatorContains,Y+="|"+this.i18n.stringOperatorDoesNotContain,Y={name_:new RegExp("^(?!("+Y+")$)")});V.attr("value")===this.i18n.stringOperatorIs?(M.fillOperatorList(this.stringOperatorStore,this.i18n.stringOperatorIs,Y),
this.onChangeOperator(V,M,N)):M.fillOperatorList(this.stringOperatorStore,this.i18n.stringOperatorIs,Y);M.createValueString(this.getCodedValues(G));break;case "esriFieldTypeDate":M.fillOperatorList(this.dateOperatorStore,this.i18n.dateOperatorIsOn);M.createValueDate();break;default:Y=null,G=this.fieldsStore.getValue(G.item,"name"),this.getCodedValues(G)&&(Y=this.i18n.numberOperatorIsBetween,Y+="|"+this.i18n.numberOperatorIsNotBetween,Y+="|"+this.i18n.numberOperatorIsAtLeast,Y+="|"+this.i18n.numberOperatorIsLessThan,
Y+="|"+this.i18n.numberOperatorIsAtMost,Y+="|"+this.i18n.numberOperatorIsGreaterThan,Y={name_:new RegExp("^(?!("+Y+")$)")}),V.attr("value")===this.i18n.numberOperatorIs?(M.fillOperatorList(this.numberOperatorStore,this.i18n.numberOperatorIs,Y),this.onChangeOperator(V,M,N)):M.fillOperatorList(this.numberOperatorStore,this.i18n.numberOperatorIs,Y),M.createValueNumber(this.getCodedValues(G))}"date"===this.fieldsStore.getValue(M.getFieldsList().item,"shortType")?M.disableInteractiveCheck():M.enableInteractiveCheck();
q.publish("filter-expression-change",this)},_onChangeOperator:function(G,M,N){G=G.item?G.item.name[0]:G.value;N=this.fieldsStore.getValue(M.getFieldsList().item,"shortType");var V=this.fieldsStore.getValue(M.getFieldsList().item,"name");M.enableOptions();if("date"!==N&&"number"!==N||G!==this.i18n.dateOperatorIsBetween&&G!==this.i18n.numberOperatorIsBetween&&G!==this.i18n.dateOperatorIsNotBetween&&G!==this.i18n.numberOperatorIsNotBetween)if("date"!==N||G!==this.i18n.dateOperatorInTheLast&&G!==this.i18n.dateOperatorNotInTheLast)if(G===
this.i18n.stringOperatorIsBlank||G===this.i18n.dateOperatorIsBlank||G===this.i18n.numberOperatorIsBlank||G===this.i18n.stringOperatorIsNotBlank||G===this.i18n.dateOperatorIsNotBlank||G===this.i18n.numberOperatorIsNotBlank)M.createValueIsBlank(),M.disableOptions();else switch(N){case "string":M.createValueString(this.getCodedValues(V));break;case "date":M.createValueDate();break;default:M.createValueNumber(this.getCodedValues(V))}else M.disableOptions(),M.createValueInTheLastDate();else M.disableOptions(),
"date"===N?M.createValueBetweenDate():M.createValueBetweenNumber();q.publish("filter-expression-change",this)},onInteractiveClick:function(G){this.isInteractiveChecked()?(g.set(this.interactiveSpace,"display","block"),this.interactiveArrow.innerHTML="\x26nbsp;\x26#9650;"):(g.set(this.interactiveSpace,"display","none"),this.interactiveArrow.innerHTML="\x26nbsp;\x26#9660;");q.publish("filter-expression-change",this)},onClickShowHideInteractive:function(G){this.interactiveCheck.disabled||("none"===g.set(this.interactiveSpace,
"display")?(g.set(this.interactiveSpace,"display","block"),this.interactiveArrow.innerHTML="\x26nbsp;\x26#9650;"):(g.set(this.interactiveSpace,"display","none"),this.interactiveArrow.innerHTML="\x26nbsp;\x26#9660;"))},onChangeInteractive:function(){q.publish("filter-expression-change",this)},showValueInput:function(G){this._showValueInput(t.byNode(G.target),this)},showFields:function(G){this._showFields(t.byNode(G.target),this)},showUniqueList:function(G){this._showUniqueList(t.byNode(G.target),this)},
onValueChange:function(){this.onValueChangeHandler&&clearTimeout(this.onValueChangeHandler);this.onValueChangeHandler=setTimeout(m.hitch(this,function(){this.onValueChangeHandler=null;q.publish("filter-expression-change",this)}),800)},_showValueInput:function(G,M,N){M.onChangeOperator(G,M,N);M.enableInteractiveCheck()},_showFields:function(G,M,N){N=M.getFieldsList().item;G=this.fieldsStore.getValue(N,"shortType");N=this.fieldsStore.getValue(N,"name");M.createValueFields(this.fieldsStore,{shortType:G,
name:new RegExp("^(?!"+N+"$)")},N);M.disableInteractiveCheck()},_showUniqueList:function(G,M,N){this.uniqueValuesStore&&delete this.uniqueValuesStore;N=this.fieldsStore.getValue(M.getFieldsList().item,"name");if(10.1<=this.version||!this.mapLayer.url){var V=null;this.mapLayer.queryServiceUrl?V=this.mapLayer.queryServiceUrl:this.mapLayer.itemLayers&&n.forEach(this.mapLayer.itemLayers,function(Y){Y.id===this.layerInfo.id&&Y.layerUrl&&(V=Y.layerUrl)},this);V||(V=this.mapLayer.url);if(this.uniqueValuesResults[this.mapLayer.id+
"_"+N])this.onGenerateRendererResults(M,G,this.uniqueValuesResults[this.mapLayer.id+"_"+N]);else this.generateRendererUniqueValues(N,V,m.hitch(this,"onGenerateRendererResults",M,G),m.hitch(this,function(){this.showValueInput(G,M)}))}else G&&this.showValueInput(G,M)},onGenerateRendererResults:function(G,M,N){var V=this.fieldsStore.getValue(G.getFieldsList().item,"name"),Y=this.fieldsStore.getValue(G.getFieldsList().item,"shortType"),ka=this.fieldsStore.getValue(G.getFieldsList().item,"type");this.uniqueValuesResults[this.mapLayer.id+
"_"+V]=N;var ja=null;n.forEach(this.mapLayer.fields,function(R){R.name===V&&R.domain&&(ja=R.domain)});N=n.filter(N,function(R,ha){return"string"===Y?"\x3cNull\x3e"!==R&&""!==R.trim():"\x3cNull\x3e"!==R&&""!==R});N.length?("date"===Y?(N=n.map(N,function(R){return new Date(R)}),N=N.sort(function(R,ha){R=R.getTime();ha=ha.getTime();return R<ha?-1:R>ha?1:0}),N=n.map(N,function(R){return this.formatFriendlyDate(R)},this)):"number"===Y?(N=n.map(N,function(R){return"esriFieldTypeDouble"===ka||"esriFieldTypeSingle"===
ka?parseFloat(R):parseInt(R,10)}),N=N.sort(function(R,ha){return R<ha?-1:R>ha?1:0})):N=N.sort(function(R,ha){return R<ha?-1:R>ha?1:0}),M=n.map(N,function(R,ha){var qa=R;"string"===Y&&(qa=""===R?"\x3c"+this.i18n.emptyString+"\x3e":R);if(ja&&ja.codedValues){for(var ia=0;ia<ja.codedValues.length;ia++){var pa=ja.codedValues[ia];if(R===pa.code)return{id:ha,name:pa.name||qa,value:R}}return{id:ha,name:""+qa,value:R}}if("esriFieldTypeDouble"===ka||"esriFieldTypeSingle"===ka)qa=k.format(R,{pattern:"#####0.##########"});
return{id:ha,name:""+qa,value:R}},this),this.uniqueValuesStore=new E({data:{label:"name",identifier:"id",items:M}}),G.createValueUnique(this.uniqueValuesStore)):this.showValueInput(M,G)},generateRendererUniqueValues:function(G,M,N,V){G instanceof Array&&(G=G.toString());var Y=new da;Y.attributeField=G;G=new fa;G.classificationDefinition=Y;this.mapLayer instanceof W?M=new oa(this.mapLayer):this.mapLayer instanceof S&&!this.mapLayer.url?M=new oa(this.mapLayer):this.hasDynamicLayers(this.mapLayer)?(Y=
this.mapLayer.layerDefinitions&&this.mapLayer.layerDefinitions[this.mapLayer.id]?this.mapLayer.layerDefinitions[this.mapLayer.id]:null,G.where=Y?Y:null,M=new oa(this.mapLayer.url+"/dynamicLayer",{source:this.layerInfo.source})):(Y=this.mapLayer.getDefinitionExpression(),G.where=Y?Y:null,M=new oa(M));aa.defaults.io.timeout=1E4;M.execute(G,function(ka){aa.defaults.io.timeout=6E4;ka=n.map(ka.infos,function(ja){return ja.value});N(ka)},m.hitch(this,function(ka){aa.defaults.io.timeout=6E4;V()}))},hasDynamicLayers:function(G){return G&&
G.supportsDynamicLayers?!0:!1},formatDate:function(G){return w.format(G,{datePattern:"yyyy-MM-dd",selector:"date"})+" "+w.format(G,{selector:"time",timePattern:"HH:mm:ss"})},formatFriendlyDate:function(G){return w.format(G,{formatLength:"short",selector:"date"})},parseFriendlyDate:function(G){return w.parse(G,{formatLength:"short",selector:"date"})},parseDate:function(G){var M=w.parse(G,{datePattern:"yyyy-MM-dd",timePattern:"HH:mm:ss"});M||(M=w.parse(G.replace(" ",", "),{datePattern:"yyyy-MM-dd",
timePattern:"HH:mm:ss"}))||(M=w.parse(G.replace(" "," - "),{datePattern:"yyyy-MM-dd",timePattern:"HH:mm:ss"}));return M},addDay:function(G){return new Date(G.getTime()+this.dayInMS)},subtractDay:function(G){return new Date(G.getTime()-this.dayInMS)},containsNonLatinCharacter:function(G){for(var M=0;M<G.length;M++)if(255<G.charCodeAt(M))return!0;return!1},hasWhiteSpace:function(G){return/\s/g.test(G)},buildCodedValuesStore:function(G){G=n.map(G,function(M,N){return{name:M.name,code:M.code,id:N}});
return new E({data:{label:"name",identifier:"id",items:G}})},clearAttributeValueDijits:function(){this.valueHandlers&&0!==this.valueHandlers.length&&(n.forEach(this.valueHandlers,m.hitch(this,function(G){q.disconnect(G);G=null})),this.valueHandlers=[],t.byId(this.id+".value")?t.byId(this.id+".value").destroy():h.byId(this.id+".value")&&this.getAttrValContNode().removeChild(h.byId(this.id+".value")),t.byId(this.id+".value1")?t.byId(this.id+".value1").destroy():h.byId(this.id+".value1")&&this.getAttrValContNode().removeChild(h.byId(this.id+
".value1")),t.byId(this.id+".value2")?t.byId(this.id+".value2").destroy():h.byId(this.id+".value2")&&this.getAttrValContNode().removeChild(h.byId(this.id+".value2")),t.byId(this.id+".valueFields")&&t.byId(this.id+".valueFields").destroy(),t.byId(this.id+".valueUnique")&&t.byId(this.id+".valueUnique").destroy())},checkDefaultOption:function(){p(".attributeValueOptions .attributeValueRadio",this.domNode).forEach(function(G){t.byNode(G).set("checked",-1<G.className.indexOf("radioValue"))})},disableOptions:function(){p(".attributeValueOptions .attributeValueRadio",
this.domNode).forEach(function(G){t.byNode(G).set("disabled",!0)})},enableOptions:function(){p(".attributeValueOptions .attributeValueRadio",this.domNode).forEach(function(G){t.byNode(G).set("disabled",!1)})},checkFieldOption:function(){t.byId(this.id+".radioFields").set("checked",!0)},disableFieldOption:function(){t.byId(this.id+".radioFields").set("disabled",!0)},disableUniqueOption:function(){t.byId(this.id+".radioUnique").set("disabled",!0)},enableInteractiveCheck:function(){this.interactiveCheck.disabled=
!1},disableInteractiveCheck:function(){this.interactiveCheck.checked=!1;this.interactiveCheck.disabled=!0},isBigDataLayer:function(G){return!!G.url&&-1!==G.url.indexOf("BigDataCatalogServer")&&("featureClass"===G.type||"table"===G.type)},isPortalHostedService:function(G){return G?-1!==G.toLowerCase().indexOf("/hosted/"):!1},isHostedService:function(G){if(!G)return!1;var M=-1!==G.indexOf(".arcgis.com/");G=-1!==G.indexOf("//services")||-1!==G.indexOf("//tiles")||-1!==G.indexOf("//features");return M&&
G},buildEditUIField:function(G,M,N){this.getFieldItemByName({name:G.fieldObj.name},m.hitch(this,function(V){M.getFieldsList().set("value",V.id[0],!1);this.buildEditUIOperator(G,M,N)}),m.hitch(this,function(){M.getFieldsList().set("value",0);this.buildEditUIOperator(G,M,N)}))},buildEditUIOperator:function(G,M,N){switch(G.fieldObj.shortType){case "string":M.fillOperatorList(this.stringOperatorStore,G.operator);break;case "date":M.fillOperatorList(this.dateOperatorStore,G.operator);break;default:M.fillOperatorList(this.numberOperatorStore,
G.operator)}setTimeout(m.hitch(this,function(){this.getOperatorItemByName(M.getOperatorList().store,{name:G.operator},m.hitch(this,function(V){M.getOperatorList().set("value",V.id[0],!1);this.buildEditUIValue(G,M,N)}),m.hitch(this,function(){M.getOperatorList().set("value",0);this.buildEditUIValue(G,M,N)}))}),100)},buildEditUIValue:function(G,M,N){this.onOperatorChangeEnabled=this.onFieldChangeEnabled=!0;var V=G.operator;this.onChangeOperator(M.getOperatorList(),M);M.enableOptions();setTimeout(m.hitch(this,
function(){V===this.i18n.stringOperatorIsBlank||V===this.i18n.dateOperatorIsBlank||V===this.i18n.numberOperatorIsBlank||V===this.i18n.stringOperatorIsNotBlank||V===this.i18n.dateOperatorIsNotBlank||V===this.i18n.numberOperatorIsNotBlank?(M.createValueIsBlank(),M.disableOptions()):"field"===G.valueObj.type?(M.createValueFields(this.fieldsStore,{shortType:G.fieldObj.shortType,name:new RegExp("^(?!"+G.fieldObj.name+"$)")}),M.checkFieldOption(),this.getFieldItemByName({name:G.valueObj.value},m.hitch(this,
function(Y){M.setValueFieldById(Y.id[0])}),m.hitch(this,function(){M.setValueFieldById(0)}))):ba.isDefined(G.valueObj.value1)?(M.setValue1(G.valueObj.value1),M.setValue2(G.valueObj.value2)):M.setValue(G.valueObj.value,this.getCodedValues(G.fieldObj.name))}),100)},getFieldItemByName:function(G,M,N){this.fieldsStore.fetch({query:G,onComplete:m.hitch(this,function(V){V&&V.length?M(V[0]):N()})})},getOperatorItemByName:function(G,M,N,V){G.fetch({query:M,onComplete:m.hitch(this,function(Y){Y&&Y.length?
N(Y[0]):V()})})}});c("extend-esri")&&m.setObject("dijit.SingleFilter",H,ea);return H})},"esri/tasks/GenerateRendererTask":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/number dojo/_base/json dojo/_base/Deferred dojo/has ../kernel ../request ../deferredUtils ../urlUtils ../renderers/jsonUtils ./StatisticDefinition ./Task ./QueryTask ./query dojo/has!extend-esri?./GenerateRendererParameters dojo/has!extend-esri?./ClassificationDefinition dojo/has!extend-esri?./ClassBreaksDefinition dojo/has!extend-esri?./UniqueValueDefinition dojo/has!extend-esri?./ColorRamp dojo/has!extend-esri?./AlgorithmicColorRamp dojo/has!extend-esri?./MultipartColorRamp".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z){d=d(p,{declaredClass:"esri.tasks.GenerateRendererTask",_eventMap:{complete:["renderer"]},constructor:function(u,E){!m.isObject(u)||"esri.layers.FeatureLayer"!==u.declaredClass&&"esri.layers.CSVLayer"!==u.declaredClass?(this.url=u,this._url.path+="/generateRenderer"):u.url&&m.isString(u.url)&&"esri.layers.CSVLayer"!==u.declaredClass?(this.url=u.url,this._url=g.urlToObject(this.url),this._url.path+="/generateRenderer"):this._features=u.graphics;this._handler=
m.hitch(this,this._handler);this.source=E&&E.source;this.gdbVersion=E&&E.gdbVersion;this.checkValueRange=E&&E.checkValueRange;this.registerConnectEvents()},_handler:function(u,E,w,F,y){try{if("esri.renderer.ClassBreaksRenderer"===u.declaredClass||"esri.renderer.UniqueValueRenderer"===u.declaredClass)var D=u;else D=e.fromJson(u),"classBreaks"===u.type&&D.setMaxInclusive(!0);if(this.checkValueRange){var B=new v(this.url),x=new z,r=new l;r.statisticType="min";r.onStatisticField=this._field;var t=new l;
t.statisticType="max";t.onStatisticField=this._field;x.outStatistics=[r,t];B.execute(x).then(m.hitch(this,function(C){C=C.features[0].attributes;for(var J in C)if(0===J.toLowerCase().indexOf("min"))var L=C[J];else var P=C[J];D=this._processRenderer(D,this._prefix,this._unitLabel,this._formatLabel,this._precision,L,P);this._successHandler([D],"onComplete",w,y)}))}else D=this._processRenderer(D,this._prefix,this._unitLabel,this._formatLabel,this._precision),this._successHandler([D],"onComplete",w,y)}catch(C){this._errorHandler(C,
F,y)}},_processRenderer:function(u,E,w,F,y,D,B){"esri.renderer.ClassBreaksRenderer"===u.declaredClass?n.forEach(u.infos,function(x,r){0===r&&void 0!==D&&null!==D&&(x.minValue=D);r===u.infos.length-1&&void 0!==B&&null!==B&&(x.classMaxValue=x.maxValue=B);y&&(x.classMaxValue=x.maxValue=Math.round(x.maxValue/y)*y,x.minValue=Math.round(x.minValue/y)*y);F&&(x.label=q.format(x.minValue)+" - "+q.format(x.maxValue));E&&(x.label=E+" "+x.label);w&&(x.label=x.label+" "+w)}):n.forEach(u.infos,function(x,r){0===
r&&void 0!==D&&null!==D&&(x.value=D);r===u.infos.length-1&&void 0!==B&&null!==B&&(x.value=B);F&&(x.label=q.format(x.value));E&&(x.label=E+" "+x.label);w&&(x.label=x.label+" "+w)});return u},execute:function(u,E,w){var F=this._handler,y=this._errorHandler;this._precision=u.precision;this._prefix=u.prefix;this._unitLabel=u.unitLabel;this._formatLabel=u.formatLabel;if(this._features=u.features||this._features){var D=new c;var B=this._features;H(["./generateRenderer"],function(t){var C;"esri.tasks.ClassBreaksDefinition"===
u.classificationDefinition.declaredClass?C=t.createClassBreaksRenderer({features:B,definition:u.classificationDefinition}):"esri.tasks.UniqueValueDefinition"===u.classificationDefinition.declaredClass&&(C=t.createUniqueValueRenderer({features:B,definition:u.classificationDefinition}));C?F(C,null,E,w,D):y(null,w,D)})}else{var x=m.mixin(u.toJson(),{f:"json"});this._field="esri.tasks.ClassBreaksDefinition"===u.classificationDefinition.declaredClass?u.classificationDefinition.classificationField:u.classificationDefinition.attributeField;
if(this.source){var r={source:this.source.toJson()};x.layer=f.toJson(r)}this.gdbVersion&&(x.gdbVersion=this.gdbVersion);D=new c(h._dfdCanceller);D._pendingDfd=k({url:this._url.path,content:x,callbackParamName:"callback",load:function(t,C){F(t,C,E,w,D)},error:function(t){y(t,w,D)}})}return D},onComplete:function(){}});a("extend-esri")&&m.setObject("tasks.GenerateRendererTask",d,b);return d})},"esri/tasks/UniqueValueDefinition":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel",
"./ClassificationDefinition"],function(H,d,m,n,q){H=H(q,{declaredClass:"esri.tasks.UniqueValueDefinition",type:"uniqueValueDef",attributeField:null,attributeField2:null,attributeField3:null,fieldDelimiter:null,toJson:function(){var f=this.inherited(arguments);this.uniqueValueFields=[];this.attributeField&&this.uniqueValueFields.push(this.attributeField);this.attributeField2&&this.uniqueValueFields.push(this.attributeField2);this.attributeField3&&this.uniqueValueFields.push(this.attributeField3);d.mixin(f,
{type:this.type,uniqueValueFields:this.uniqueValueFields});this.fieldDelimiter&&d.mixin(f,{fieldDelimiter:this.fieldDelimiter});return f}});m("extend-esri")&&d.setObject("tasks.UniqueValueDefinition",H,n);return H})},"esri/tasks/ClassificationDefinition":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(H,d,m,n){H=H(null,{declaredClass:"esri.tasks.ClassificationDefinition",type:null,baseSymbol:null,colorRamp:null,toJson:function(){var q={};this.baseSymbol&&
d.mixin(q,{baseSymbol:this.baseSymbol.toJson()});this.colorRamp&&!d.isString(this.colorRamp)&&d.mixin(q,{colorRamp:this.colorRamp.toJson()});return q}});m("extend-esri")&&d.setObject("tasks.ClassificationDefinition",H,n);return H})},"esri/tasks/GenerateRendererParameters":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/json","dojo/has","../kernel"],function(H,d,m,n,q){H=H(null,{declaredClass:"esri.tasks.GenerateRendererParameters",classificationDefinition:null,where:null,precision:null,
prefix:null,unitLabel:null,formatLabel:null,toJson:function(){return{classificationDef:m.toJson(this.classificationDefinition.toJson()),where:this.where}}});n("extend-esri")&&d.setObject("tasks.GenerateRendererParameters",H,q);return H})},"esri/layers/GeoRSSLayer":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has ../kernel ../config ../request ../urlUtils ./ServiceGeneratedFeatureCollection".split(" "),function(H,d,m,n,q,f,c,a,b){H=H([b],{declaredClass:"esri.layers.GeoRSSLayer",
serviceUrl:a.getProtocolForWebResource()+"//utility.arcgis.com/sharing/rss",constructor:function(k,h){this._url=a.urlToObject(this.url=k);f.defaults.geoRSSService&&(this.serviceUrl=f.defaults.geoRSSService);this._createLayer()},parse:function(){return this._io=c({url:this.serviceUrl,content:{url:this.url,refresh:this.loaded?!0:void 0,outSR:this._outSR?m.toJson(this._outSR.toJson()):void 0},callbackParamName:"callback"})},_initLayer:function(k){this.inherited(arguments);this.loaded||(this.loaded=!0,
this.onLoad(this))}});n("extend-esri")&&d.setObject("layers.GeoRSSLayer",H,q);return H})},"esri/layers/ServiceGeneratedFeatureCollection":function(){define("dojo/_base/declare dojo/_base/connect dojo/_base/lang dojo/_base/array dojo/dom-construct dojo/dom-style dojo/has ../kernel ../SpatialReference ../geometry/Extent ../geometry/webMercatorUtils ../renderers/SimpleRenderer ./layer ./FeatureLayer ../dijit/PopupTemplate".split(" "),function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p){H=H([e],{declaredClass:"esri.layers._ServiceGeneratedFeatureCollection",
constructor:function(v,z){this.pointSymbol=z&&z.pointSymbol;this.polylineSymbol=z&&z.polylineSymbol;this.polygonSymbol=z&&z.polygonSymbol;this._outSR=z&&(z.outSpatialReference||z.outSR)||new b({wkid:4326});this._options=m.mixin({},z)},parse:function(){console.error("parse function has not been implemented")},getFeatureLayers:function(){var v=[];this._fLayers&&(v=v.concat(this._fLayers));return v},onRefresh:function(){},onOpacityChange:function(){},refresh:function(){this.loaded&&this._map&&!this._io&&
this.visible&&this._createLayer()},_createLayer:function(v){var z=this;this._fireUpdateStart();v=this.parse(v);v.addCallback(function(u){z._io=null;z._initLayer(u)});v.addErrback(function(u){z._io=null;u=m.mixin(Error(),u);u.message="Unable to load resource: "+z.url+" "+(u.message||"");z._fireUpdateEnd(u);z.onError(u)})},_initLayer:function(v){this.loaded&&this._removeInternalLayers();this.name=v.name;this.description=v.description;this.snippet=v.snippet;this.featureInfos=v.featureInfos;this.fullExtent=
this.initialExtent=new k(v.lookAtExtent);this.copyright=v.author||v.copyright;var z;(v=m.getObject("featureCollection.layers",!1,v))&&0<v.length&&(this._fLayers=[],n.forEach(v,function(u,E){var w=m.getObject("featureSet.features",!1,u);w&&0<w.length&&(z=m.mixin({outFields:["*"],infoTemplate:u.popupInfo?new p(u.popupInfo):null,editable:!1},this._options),z.id&&(z.id=z.id+"_"+E),z.webgl=!1,u.layerDefinition.capabilities="Query,Data",u=new l(u,z),u.geometryType&&(this["_"+u.geometryType]=u),this._fLayers.push(u))},
this),0===this._fLayers.length&&delete this._fLayers);this.items=[];this._esriGeometryPoint&&(this.items=this.items.concat(this._esriGeometryPoint.graphics),this.pointSymbol&&(v=new g(this.pointSymbol),this._esriGeometryPoint.setRenderer(v)));this._esriGeometryPolyline&&(this.items=this.items.concat(this._esriGeometryPolyline.graphics),this.polylineSymbol&&(v=new g(this.polylineSymbol),this._esriGeometryPolyline.setRenderer(v)));this._esriGeometryPolygon&&(this.items=this.items.concat(this._esriGeometryPolygon.graphics),
this.polygonSymbol&&(v=new g(this.polygonSymbol),this._esriGeometryPolygon.setRenderer(v)));this._fireUpdateEnd();this.loaded&&(this._addInternalLayers(),this.onRefresh())},_addInternalLayers:function(){var v=this._map;this._fireUpdateStart();var z=v.spatialReference,u=this._outSR;if(z.wkid)var E=z._isWebMercator()&&u._isWebMercator()||z.wkid===u.wkid;else if(z.wkt)E=z.wkt===u.wkt;else{console.log("_setMap - map has invalid spatial reference");return}if(!E)if(z._isWebMercator()&&4326===u.wkid)this._converter=
h.geographicToWebMercator;else if(u._isWebMercator()&&4326===z.wkid)this._converter=h.webMercatorToGeographic;else{console.log("_setMap - unsupported workflow. Spatial reference of the map and layer do not match, and the conversion cannot be done on the client.");return}(z=this._fLayers)&&0<z.length&&n.forEach(z,function(w){if(this._converter){var F=w.graphics,y,D,B=F?F.length:0;for(y=0;y<B;y++)(D=F[y].geometry)&&F[y].setGeometry(this._converter(D))}v.addLayer(w)},this);this.setVisibility(this.visible);
this._fireUpdateEnd()},_removeInternalLayers:function(){var v=this._map;v&&n.forEach(this.getFeatureLayers(),v.removeLayer,v)},setScaleRange:function(v,z){this.inherited(arguments);n.forEach(this.getFeatureLayers(),function(u){u.setScaleRange(v,z)});this._options.minScale=this.minScale;this._options.maxScale=this.maxScale},setOpacity:function(v){this.opacity!=v&&(n.forEach(this.getFeatureLayers(),function(z){z.setOpacity(v)}),this.opacity=this._options.opacity=v,this.onOpacityChange(v))},onVisibilityChange:function(v){this._fireUpdateStart();
n.forEach(this.getFeatureLayers(),function(z){z.setVisibility(v)});this._fireUpdateEnd()},_setMap:function(v,z){this.inherited(arguments);this._map=v;var u=this._div=q.create("div",null,z);f.set(u,"position","absolute");this._addInternalLayers();this.evaluateSuspension();return u},_unsetMap:function(v,z){this._io&&this._io.cancel();d.disconnect(this._extChgHandle);delete this._extChgHandle;this._removeInternalLayers();var u=this._div;u&&(z.removeChild(u),q.destroy(u));this._div=null;this.inherited(arguments)}});
c("extend-esri")&&m.setObject("layers._ServiceGeneratedFeatureCollection",H,a);return H})},"esri/dijit/analysis/ItemTypes":function(){define(["dojo/_base/lang","dojo/has","../../kernel"],function(H,d,m){var n={BIGDATA:"Big Data File Share",CSV:"CSV",XLS:"Microsoft Excel",FS:"Feature Service",MS:"Map Service",IS:"Image Service",FLAYER:"Feature Layer",BDATAFEATURE:"featureClass",TABLE:"Table",BTABLE:"table",FLAYERVIEW:"FeatureLayerView",MVGRID:"Multi-Variable Grid",GPSERVICE:"Geoprocessing Service",
RFT:"Raster function template",BDFSTEMPLATE:"bdfstemplate",DLPK:"Deep Learning Package",FILE:"files",DOC:"documents",IMG:"images",PDF:"pdfs",CSVS:"csvs"};d("extend-esri")&&H.setObject("dijit.analysis.itemTypes",n,m);return n})},"esri/dijit/analysis/FeatureRecordSetLayer":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../../tasks/DataFile","../../kernel"],function(H,d,m,n,q){H=H(n,{declaredClass:"esri.dijit.analysis.FeatureRecordSetLayer",constructor:function(f){f&&d.mixin(this,
f)},toJson:function(){var f={};this.url&&(f.url=this.url);this.filter&&(f.filter=this.filter);this.serviceToken&&(f.serviceToken=this.serviceToken);this.featureSet&&(f.featureSet=this.featureSet);this.layerDefinition&&(f.layerDefinition=this.layerDefinition);this.time&&(f.time=this.time);return f}});m("extend-esri")&&d.setObject("dijit.analysis.FeatureRecordSetLayer",H,q);return H})},"esri/dijit/analysis/PluginLayers":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/dom-construct dojo/Deferred dojo/promise/all dojo/dom dojo/dom-attr dojo/dom-class dojo/dom-style dojo/query dojo/store/Memory dojo/store/Observable dojo/Evented dojo/has ./ItemTypes ../../request ../../kernel ../../lang dgrid/OnDemandGrid dgrid/Selection ./AnalysisRegistry dojo/i18n!../../nls/jsapi".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F,y,D){var B=H([l],{infoPanelTemplate:'\x3cdiv\x3e\x3cdiv class\x3d"template-info-showing"\x3e\x3cdiv\x3e\x3cimg width\x3d\'16px\' height\x3d\'16px\' alt\x3d\'\' src\x3d\'${item.iconUrl}\'\x3e\x3c/div\x3e\x3ch4\x3e${item.title}\x3c/h4\x3e\x3cdiv class\x3d"template-info"\x3e\x3cp class\x3d""\x3e${item.snippet}\x3c/p\x3e${item:plugIn._showLayers}\x3cdiv id\x3d"${item.id}_details" class\x3d"quiet-scroll layer-container"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"panel-actions"\x3e${item:plugIn._addLayerToMap}\x3cbutton class\x3d"btn blue btn-main disabled" id\x3d"add-layer"\x3e${i18n.common.addLayerBtnLabel}\x3c/button\x3e\x3cbutton class\x3d"btn btn-cancel" id\x3d"close-panel"\x3e${i18n.common.close}\x3c/button\x3e\x3c/div\x3e\x3cdiv\x3e',
geometryTypes:[y.GeometryTypes.Point,y.GeometryTypes.Point.MultiPoint,y.GeometryTypes.Line,y.GeometryTypes.Polygon],layerTypes:[v.FLAYER,v.BDATAFEATURE,v.BTABLE,v.TABLE],timeTypes:[y.TimeTypes.Instant,y.TimeTypes.Interval],checkGeometryType:!0,checkLayerType:!1,checkTimeFilter:!1,fetchType:['type:"'+v.MS+'"','type:"'+v.FS+'"'],constructor:function(x){d.mixin(this,x);this.filters={all:{},mycontent:{owners:this.self?[this.self.user.username]:[]},esriBoundaryLayers:{owners:["esri_boundaries"]}};this.i18n=
d.mixin({},D.browseLayersDlg);d.mixin(this.i18n,D.browseItems);d.mixin(this.i18n,D.common);this.filterStrings={all:{title:this.self&&this.self.isPortal?this.i18n.items.portalOrg:this.i18n.items.organizationLabel},mycontent:{title:this.i18n.items.contentLabel},esriBoundaryLayers:{title:this.i18n.esriBoundaryLayers}}},fetchData:function(){this._portal=this.parent._portal;this._user=this._portal.getPortalUser();this.filters.mycontent.owner=this._user;this.parent.fetchType&&(this.fetchType=this.parent.fetchType);
return this._fetchItems()},_fetchItems:function(){return this.parent._fetchItems({types:this.fetchType})},_fetchServiceInfo:function(x){var r=new q,t,C={f:"json"};x.url?(-1!==window.location.protocol.indexOf("https:")&&(x.url=x.url.replace("http:","https:")),z({url:x.url,content:C}).then(function(J){r.resolve(J)},d.hitch(this,function(J){t=J.details&&J.details.length?J.details.shift():"";J&&403===J.httpCode&&-1<t.indexOf("SSL Required")?(x.set("url",x.url.replace("http:","https:")),this._fetchServiceInfo(x).then(function(L){r.resolve(L)})):
(x.isLoaded=!0,r.resolve({error:J}))}))):r.resolve(null);return r},_addLayerToMap:function(x){return x.type===v.BIGDATA||x.type===v.CSV||x.type===v.XLS?"":'\x3cdiv class\x3d"esriFloatLeading esriLeadingPadding1 padding-trailer-half js-add-layer-node"\x3e\x3clabel\x3e\x3cinput name\x3d"addlayertomap" class\x3d"js-add-layer-checkbox" type\x3d"checkbox"\x3e\x3cspan class\x3d"esriLeadingPadding1"\x3e'+this.i18n.common.addLayer+"\x3c/span\x3e\x3c/label\x3e\x3c/div\x3e"},_showLayers:function(x){if(x&&-1!==
m.indexOf([v.FS,v.MS,v.IS,v.BIGDATA,v.CSV,v.XLS],x.type)){if(x.type===v.CSV||x.type===v.XLS)x.url=x.itemUrl;this.plugIn._fetchServiceInfo(x).then(d.hitch(this,function(r){var t=[],C={f:"json"};r.layers&&(t=[].concat(t).concat(r.layers));r.tables&&0<r.tables.length&&(t=[].concat(t).concat(r.tables));r.children&&(t=r.children);!x||x.type!==v.CSV&&x.type!==v.XLS&&x.type!==v.IS||(t=[x]);if(!t.length)var J=this.plugIn.i18n.noDataMessages.noItemInfo;this.plugIn._createLayerGrid(n.create("div",null,c.byId(x.id+
"_details")),J);m.forEach(t,function(L,P){x.type===v.BIGDATA?(L.url=x.url+"/"+L.name,L.url=encodeURI(L.url)):L.url=x.type===v.CSV?x.itemUrl:x.type===v.IS?x.url:x.url+"/"+P;-1!==window.location.protocol.indexOf("https:")&&(L.url=L.url.replace("http:","https:"));z({url:L.url,content:C}).then(d.hitch(this,function(U){L=d.mixin(L,U);this.plugIn._store.put(L);this.plugIn._grid.refresh()}),d.hitch(this,function(U){this.plugIn._grid.noDataMessage=this.plugIn.i18n.noDataMessages.noLayerInfo;this.plugIn._grid.refresh()}))},
this)}))}return""},_getLayerHead:function(){return"\x3ctr\x3e\x3cth\x3e\x3c/th\x3e\x3cth\x3eLayer Name\x3c/th\x3e\x3cth\x3e Geometry Type\x3c/th\x3e\x3c/tr\x3e"},_getLayerNode:function(x,r,t){r=x.name;var C='\x3ctr\x3e\x3ctd\x3e\x3cinput type\x3d"checkbox" class\x3d"js-layer-check" name\x3d"layers" value\x3d"'+r+' checked"\x3e\x3c/td\x3e\x3ctd\x3e',J="\x3c/td\x3e\x3ctd\x3e"+x.geometryType+"\x3c/td\x3e\x3c/tr\x3e";return x.itemUrl||x.url?C+'\x3ca class\x3d"'+(t||"")+'"\x3e'+r+"\x3c/a\x3e"+J:C+r+J},
_createLayerGrid:function(x,r){var t=H([w,F]);this._store=e(new g({idProperty:"name"}));this._atleastALayerAvailable=!1;this._grid=new t({store:this._store,query:d.hitch(this,function(C){var J=!0,L=!0,P=!0,U=!0;this.checkGeometryType&&C.type!==v.IS&&(P=-1!==m.indexOf(this.geometryTypes,C.geometryType));this.checkTimeFilter&&(J=-1!==m.indexOf(this.timeTypes,this.getTimeType(C)));this.checkLayerType&&(L=-1!==m.indexOf(this.layerTypes,C.type));"function"===typeof this.customCheckHandler&&(U=this.customCheckHandler(C));
C=C&&P&&J&&L&&U;C||(this._grid.noDataMessage=this.getNoDataMessage({geomCheck:P,timeCheck:J,typeCheck:L,customCheck:U}));!this._atleastALayerAvailable&&C&&(this._atleastALayerAvailable=C);h(".js-add-layer-checkbox",this.parent.infoPanel).forEach(function(aa){a.set(aa,"disabled",!this._atleastALayerAvailable)},this);return C}),selectionMode:"single","class":"esriAnalysisLayersGrid quiet-scroll",noDataMessage:r||this.i18n.noValidLayerMsg,allowSelect:d.hitch(this,function(C){var J;this.checkLayerType&&
C.data&&(J=-1!==m.indexOf(this.layerTypes,C.data.type));J=C.data.geometryType?-1!==m.indexOf(this.geometryTypes,C.data.geometryType)||this.checkLayerType&&J:!0;return C&&C.data&&J}),renderRow:d.hitch(this,this._renderer)},x);this._grid.startup();this._grid.on("dgrid-select,dgrid-deselect",d.hitch(this,function(C){C=C.grid.selection;var J=[];for(L in C)C[L]&&J.push(this._grid.row(L).data);var L={selection:J};h(".panel-actions .btn-main",this.parent.infoPanel).forEach(function(P){b.toggle(P,"disabled",
0===J.length)},this);J[0]&&(this._selectedLayer=J[0]);this.emit("layer-change",L)}))},hasTimeInfo:function(x){return x&&x.timeInfo},getTimeType:function(x){return x?E.isDefined(x.timeInfo)&&E.isDefined(x.timeInfo.startTimeField)&&!E.isDefined(x.timeInfo.endTimeField)?y.TimeTypes.Instant:E.isDefined(x.timeInfo)&&E.isDefined(x.timeInfo.startTimeField)&&E.isDefined(x.timeInfo.endTimeField)?y.TimeTypes.Interval:E.isDefined(x.time)&&E.isDefined(x.time.timeType)?x.time.timeType:!1:!1},getNoDataMessage:function(x){if(x.geomCheck)if(x.timeCheck){if(!x.typeCheck)return this.i18n.noDataMessages.typeCheckFailure;
if(!x.customCheck)return this.customCheckFailureMessage}else return this.i18n.noDataMessages.timeCheckFailure;else return this.i18n.noDataMessages.geomCheckFailure},getDateFields:function(x){return m.filter(x&&x.fields||[],function(r){return r&&"esriFieldTypeDate"===r.type})},_renderer:function(x){x.snippet=x.snippet||"";var r=n.create("div"),t=this._getLabel(x);n.place('\x3cdiv class\x3d"panel panel-white panel-bordered panel-compact border-bottom-clear"\x3e\x3ch5 class\x3d"trailer-0 font-size-0 word-break"\x3e\x3ca\x3e'+
x.name+'\x3c/a\x3e\x3c/h5\x3e\x3cnav class\x3d"inline-block"\x3e\x3ca class\x3d"link-gray font-size--2 esriTrailingPadding1 esriTrailingMargin05"\x3e\x3cspan class\x3d"'+t.icon+'"\x3e\x3c/span\x3e'+t.name+"\x3c/a\x3e"+(x.timeInfo||x.time&&"instant"===x.time.timeType?'\x3ca class\x3d"link-gray font-size--2 esriTrailingPadding1" data-action\x3d"timeSettings" data-layerid\x3d"0"\x3e\x3cspan class\x3d"esri-icon-time-clock"\x3e\x3c/span\x3e'+this.i18n.timeEnabled+"\x3c/a\x3e":'\x3ca class\x3d"esriTrailingPadding1"\x3e\x3c/a\x3e')+
"\x3c/nav\x3e\x3c/div\x3e",r);return r},_getLabel:function(x){var r={icon:"",name:""},t=x.geometryType;t===y.GeometryTypes.Point||t===y.GeometryTypes.MultiPoint?(r.name=this.i18n.points,r.icon="esri-icon-map-pin"):t===y.GeometryTypes.Polygon?(r.name=this.i18n.areas,r.icon="esri-icon-polygon"):t===y.GeometryTypes.Line?(r.name=this.i18n.lines,r.icon="esri-icon-polyline"):x.type===v.IS?(r.name=this.i18n.imageService,r.icon="esri-icon-layers"):(r.name=this.i18n.table,r.icon="esri-icon-table");return r}});
d.mixin(B,{add:function(x,r){x.plugIn||(r=r||{},r.parent=x,r.self=x.self,x.plugIn=new B(r))},remove:function(x){x.plugIn&&(x.plugIn.destroy(),delete x.plugIn)}});p("extend-esri")&&d.setObject("dijit.analysis.PluginLayers",B,u);return B})},"esri/dijit/analysis/AnalysisRegistry":function(){define(["dojo/_base/lang","dojo/has","../../kernel"],function(H,d,m){var n={Modes:{Raster:"raster",Bigdata:"bigdata",Standard:"standard",Feature:"feature"},Tools:{FindCentroids:"FindCentroids",ChooseBestFacilities:"ChooseBestFacilities"},
ProcessInfoTools:{DescribeDataset:{Name:"DescribeDataset",Gax:!0,Std:!1},GeneralizedLinearRegression:{Name:"GeneralizedLinearRegression",Gax:!0,Std:!1},ForestBasedClassificationAndRegression:{Name:"ForestBasedClassificationAndRegression",Gax:!0,Std:!1},GeographicallyWeightedRegression:{Name:"GeographicallyWeightedRegression",Gax:!0,Std:!1},FindSimilarLocations:{Name:"FindSimilarLocations",Gax:!0,Std:!0},FindHotSpots:{Name:"FindHotSpots",Gax:!1,Std:!0},FindOutliers:{Name:"FindOutliers",Gax:!0,Std:!0}},
ToolCategory:{Gax:"GeoAnalyticsTools",Std:"SpatialAnalysisTools"},GeometryTypes:{Polygon:"esriGeometryPolygon",Line:"esriGeometryPolyline",Point:"esriGeometryPoint",MultiPoint:"esriGeometryMultipoint"},PseudoGeometryTypes:{Point:"point",Line:"line",Polygon:"polygon"},TimeTypes:{Instant:"instant",Interval:"interval"},FieldTypes:{ObjectId:"esriFieldTypeOID",String:"esriFieldTypeString",Short:"esriFieldTypeSmallInteger",Integer:"esriFieldTypeInteger",Float:"esriFieldTypeSingle",Double:"esriFieldTypeDouble",
Date:"esriFieldTypeDate"},PseudoFieldTypes:{Number:"number",String:"string",Date:"date"},Shapes:{square:"SQUARE",hexagon:"HEXAGON",transverseHexagon:"TRANSVERSEHEXAGON",triangle:"TRIANGLE",diamond:"DIAMOND"},DistanceMethods:{geodesic:"Geodesic",planar:"Planar"}};d("extend-esri")&&H.setObject("dijit.analysis.AnalysisRegistry",n,m);return n})},"esri/dijit/analysis/PCSList":function(){define(["dojo/_base/lang","dojo/has","../../kernel"],function(H,d,m){var n=[2E3,2001,2002,2003,2004,2005,2006,2007,2008,
2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2072,2073,2074,2075,2076,2077,2078,2079,2080,2081,2082,2083,2084,2085,2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099,2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118,2119,
2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134,2135,2136,2137,2138,2139,2140,2141,2142,2143,2144,2145,2146,2147,2148,2149,2150,2151,2152,2153,2154,2155,2157,2158,2159,2160,2161,2162,2163,2164,2165,2166,2167,2168,2169,2170,2172,2173,2174,2175,2176,2177,2178,2179,2180,2181,2182,2183,2184,2185,2186,2187,2188,2189,2190,2191,2192,2193,2195,2196,2197,2198,2200,2201,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2213,2214,2215,2216,2217,2219,2220,2222,2223,2224,2225,2226,
2227,2228,2229,2230,2231,2232,2233,2234,2235,2236,2237,2238,2239,2240,2241,2242,2243,2244,2245,2246,2247,2248,2249,2250,2251,2252,2253,2254,2255,2256,2257,2258,2259,2260,2261,2262,2263,2264,2265,2266,2267,2268,2269,2270,2271,2272,2273,2274,2275,2276,2277,2278,2279,2280,2281,2282,2283,2284,2285,2286,2287,2288,2289,2290,2291,2292,2294,2295,2308,2309,2310,2311,2312,2313,2314,2315,2316,2317,2318,2319,2320,2321,2322,2323,2324,2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2335,2336,2337,2338,2339,2340,
2341,2342,2343,2344,2345,2346,2347,2348,2349,2350,2351,2352,2353,2354,2355,2356,2357,2358,2359,2360,2361,2362,2363,2364,2365,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2384,2385,2386,2387,2388,2389,2390,2391,2392,2393,2394,2395,2396,2397,2398,2399,2400,2401,2402,2403,2404,2405,2406,2407,2408,2409,2410,2411,2412,2413,2414,2415,2416,2417,2418,2419,2420,2421,2422,2423,2424,2425,2426,2427,2428,2429,2430,2431,2432,2433,2434,2435,2436,2437,2438,2439,2440,2441,
2442,2443,2444,2445,2446,2447,2448,2449,2450,2451,2452,2453,2454,2455,2456,2457,2458,2459,2460,2461,2462,2463,2464,2465,2466,2467,2468,2469,2470,2471,2472,2473,2474,2475,2476,2477,2478,2479,2480,2481,2482,2483,2484,2485,2486,2487,2488,2489,2490,2491,2494,2495,2496,2497,2498,2499,2500,2501,2502,2503,2504,2505,2506,2507,2508,2509,2510,2511,2512,2513,2514,2515,2516,2517,2518,2519,2520,2521,2522,2523,2524,2525,2526,2527,2528,2529,2530,2531,2532,2533,2534,2535,2536,2537,2538,2539,2540,2541,2542,2543,2544,
2545,2546,2547,2548,2549,2550,2551,2552,2553,2554,2555,2556,2557,2558,2559,2560,2561,2562,2563,2564,2565,2566,2567,2568,2569,2570,2571,2572,2573,2574,2575,2576,2577,2578,2579,2580,2581,2582,2583,2584,2585,2586,2587,2588,2589,2590,2591,2592,2593,2594,2595,2596,2597,2598,2599,2600,2601,2602,2603,2604,2605,2606,2607,2608,2609,2610,2611,2612,2613,2614,2615,2616,2617,2618,2619,2620,2621,2622,2623,2624,2625,2626,2627,2628,2629,2630,2631,2632,2633,2634,2635,2636,2637,2638,2639,2640,2641,2642,2643,2644,2645,
2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658,2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,2726,2727,2728,2729,2730,2731,2732,2733,2734,2735,2736,2737,2738,2739,2740,2741,2742,2743,2744,2745,2746,
2747,2748,2749,2750,2751,2752,2753,2754,2755,2756,2757,2758,2759,2760,2761,2762,2763,2764,2765,2766,2767,2768,2769,2770,2771,2772,2773,2774,2775,2776,2777,2778,2779,2780,2781,2782,2783,2784,2785,2786,2787,2788,2789,2790,2791,2792,2793,2794,2795,2796,2797,2798,2799,2800,2801,2802,2803,2804,2805,2806,2807,2808,2809,2810,2811,2812,2813,2814,2815,2816,2817,2818,2819,2820,2821,2822,2823,2824,2825,2826,2827,2828,2829,2830,2831,2832,2833,2834,2835,2836,2837,2838,2839,2840,2841,2842,2843,2844,2845,2846,2847,
2848,2849,2850,2851,2852,2853,2854,2855,2856,2857,2858,2859,2860,2861,2862,2863,2864,2865,2866,2867,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,2931,2932,2933,2934,2935,2936,2937,2938,2939,2940,2941,2942,2943,2944,2945,2946,2947,2948,2949,2950,
2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2961,2962,2964,2965,2966,2967,2968,2969,2970,2971,2972,2973,2975,2976,2977,2978,2979,2980,2981,2982,2983,2984,2985,2986,2987,2988,2989,2990,2991,2992,2993,2994,2995,2996,2997,2998,2999,3E3,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,3051,3054,3055,
3056,3057,3058,3059,3060,3061,3062,3063,3064,3065,3066,3067,3068,3069,3070,3071,3072,3073,3074,3075,3076,3077,3078,3079,3080,3081,3082,3083,3084,3085,3086,3087,3088,3089,3090,3091,3092,3093,3094,3095,3096,3097,3098,3099,3100,3101,3102,3106,3107,3108,3109,3110,3111,3112,3113,3114,3115,3116,3117,3118,3119,3120,3121,3122,3123,3124,3125,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3141,3142,3146,3147,3148,3149,3150,3151,3153,3154,3155,3156,3157,3158,3159,3160,3161,3162,3163,3164,3165,
3166,3167,3168,3169,3170,3171,3172,3174,3175,3176,3177,3178,3179,3180,3181,3182,3183,3184,3185,3186,3187,3188,3189,3190,3191,3192,3193,3194,3195,3196,3197,3198,3199,3200,3201,3202,3203,3294,3295,3296,3297,3298,3299,3300,3301,3302,3303,3304,3305,3306,3307,3308,3309,3310,3311,3312,3313,3314,3315,3316,3317,3318,3319,3320,3321,3322,3323,3324,3325,3326,3327,3328,3329,3330,3331,3332,3333,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,3344,3345,3346,3347,3348,3349,3350,3351,3352,3353,3354,3355,3356,3357,
3358,3359,3360,3361,3362,3363,3364,3365,3366,3367,3368,3369,3370,3371,3372,3373,3374,3375,3376,3377,3378,3379,3380,3381,3382,3383,3384,3385,3386,3387,3388,3389,3390,3391,3392,3393,3394,3395,3396,3397,3398,3399,3400,3401,3402,3403,3404,3405,3406,3407,3408,3409,3410,3411,3412,3413,3414,3415,3416,3417,3418,3419,3420,3421,3422,3423,3424,3425,3426,3427,3428,3429,3430,3431,3432,3433,3434,3435,3436,3437,3438,3439,3440,3441,3442,3443,3444,3445,3446,3447,3448,3449,3450,3451,3452,3453,3454,3455,3456,3457,3458,
3459,3460,3461,3462,3463,3464,3465,3466,3467,3468,3469,3470,3471,3472,3473,3474,3475,3476,3477,3478,3479,3480,3481,3482,3483,3484,3485,3486,3487,3488,3489,3490,3491,3492,3493,3494,3495,3496,3497,3498,3499,3500,3501,3502,3503,3504,3505,3506,3507,3508,3509,3510,3511,3512,3513,3514,3515,3516,3517,3518,3519,3520,3521,3522,3523,3524,3525,3526,3527,3528,3529,3530,3531,3532,3533,3534,3535,3536,3537,3538,3539,3540,3541,3542,3543,3544,3545,3546,3547,3548,3549,3550,3551,3552,3553,3554,3555,3556,3557,3558,3559,
3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3571,3572,3573,3574,3575,3576,3577,3578,3579,3580,3581,3582,3583,3584,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3643,3644,3645,3646,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,
3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,3676,3677,3678,3679,3680,3681,3682,3683,3684,3685,3686,3687,3688,3689,3690,3691,3692,3693,3694,3695,3696,3697,3698,3699,3700,3701,3702,3703,3704,3705,3706,3707,3708,3709,3710,3711,3712,3713,3714,3715,3716,3717,3718,3719,3720,3721,3722,3723,3724,3725,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,3739,3740,3741,3742,3743,3744,3745,3746,3747,3748,3749,3750,3751,3753,3754,3755,3756,3757,3758,3759,3760,3761,3762,
3763,3764,3765,3766,3767,3768,3769,3770,3771,3772,3773,3775,3776,3777,3779,3780,3781,3783,3784,3785,3788,3789,3790,3791,3793,3794,3797,3798,3799,3800,3801,3802,3812,3814,3815,3816,3825,3826,3827,3828,3829,3832,3833,3834,3835,3836,3837,3838,3839,3840,3841,3844,3845,3846,3847,3848,3849,3850,3851,3852,3854,3857,3873,3874,3875,3876,3877,3878,3879,3880,3881,3882,3883,3884,3885,3890,3891,3892,3893,3907,3908,3909,3910,3911,3912,3920,3942,3943,3944,3945,3946,3947,3948,3949,3950,3968,3969,3970,3973,3974,3975,
3976,3978,3979,3986,3987,3988,3989,3991,3992,3994,3995,3996,3997,4026,4037,4038,4048,4049,4050,4051,4056,4057,4058,4059,4060,4061,4062,4063,4071,4082,4083,4087,4088,4093,4094,4095,4096,4217,4390,4391,4392,4393,4394,4395,4396,4397,4398,4399,4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4414,4415,4417,4418,4419,4420,4421,4422,4423,4424,4425,4426,4427,4428,4429,4430,4431,4432,4433,4434,4437,4438,4439,4455,4456,4457,4462,4467,4471,4474,4484,4485,4486,4487,4488,4489,4491,4492,4493,
4494,4495,4496,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,4519,4520,4521,4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,4536,4537,4538,4539,4540,4541,4542,4543,4544,4545,4546,4547,4548,4549,4550,4551,4552,4553,4554,4559,4568,4569,4570,4571,4572,4573,4574,4575,4576,4577,4578,4579,4580,4581,4582,4583,4584,4585,4586,4587,4588,4589,4647,4652,4653,4654,4655,4656,4766,4767,4768,4769,4770,4771,4772,4773,4774,4775,4776,
4777,4778,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,4789,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,4800,4822,4826,4839,5014,5015,5016,5018,5048,5069,5070,5071,5072,5105,5106,5107,5108,5109,5110,5111,5112,5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5167,5168,5173,5174,5175,5176,5177,5178,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5221,5223,5234,5235,5243,5247,5253,5254,5255,5256,5257,5258,5259,5266,5269,5270,5271,5272,5273,5274,5275,
5292,5293,5294,5295,5296,5297,5298,5299,5300,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5316,5320,5321,5325,5329,5330,5331,5337,5343,5344,5345,5346,5347,5348,5349,5355,5356,5357,5361,5362,5367,5382,5383,5387,5388,5389,5396,5456,5457,5459,5460,5461,5462,5463,5469,5472,5479,5480,5481,5482,5490,5513,5514,5518,5519,5520,5523,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5550,5551,5552,5559,5562,5563,5564,5565,5566,5567,5568,5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,
5582,5583,5588,5589,5596,5623,5624,5625,5627,5629,5631,5632,5633,5634,5635,5636,5637,5638,5639,5641,5643,5644,5646,5649,5650,5651,5652,5653,5654,5655,5659,5663,5664,5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680,5682,5683,5684,5685,5700,5825,5836,5837,5839,5842,5844,5858,5875,5876,5877,5879,5880,5887,5890,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,
6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6128,6129,6141,6204,6210,6211,6244,6245,6246,6247,6248,6249,6250,6251,6252,6253,6254,6255,6256,6257,6258,6259,6260,6261,6262,6263,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275,
6307,6312,6316,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,6338,6339,6340,6341,6342,6343,6344,6345,6346,6347,6348,6350,6351,6352,6353,6354,6355,6356,6362,6366,6367,6368,6369,6370,6371,6372,6381,6382,6383,6384,6385,6386,6387,6391,6393,6394,6395,6396,6397,6398,6399,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,6412,6413,6414,6415,6416,6417,6418,6419,6420,6421,6422,6423,6424,6425,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,
6447,6448,6449,6450,6451,6452,6453,6454,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499,6500,6501,6502,6503,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,
6549,6550,6551,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,6600,6601,6602,6603,6605,6606,6607,6608,6609,6610,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,6646,6669,6670,6671,6672,6673,6674,6675,6676,6677,6678,6679,6680,
6681,6682,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6703,6707,6708,6709,6720,6721,6722,6723,6732,6733,6734,6735,6736,6737,6738,6784,6785,6786,6787,6788,6789,6790,6791,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,6810,6811,6812,6813,6814,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,6836,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,6847,6848,6849,6850,6851,6852,6853,6854,6855,6856,6857,
6858,6859,6860,6861,6862,6863,6867,6868,6870,6875,6876,6879,6880,6884,6885,6886,6887,6915,6922,6923,6924,6925,6931,6932,6933,6956,6957,6958,6959,6962,6984,6991,7005,7006,7007,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7074,7075,7076,7077,7078,7079,7080,7081,7082,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7131,7132,7257,7258,7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,
7278,7279,7280,7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,7314,7315,7316,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7374,7375,7376,7528,7529,7530,7531,7532,
7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,7550,7551,7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,
7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7845,7846,7847,7848,7849,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,20002,20003,20004,20005,20006,20007,20008,20009,20010,20011,20012,20013,20014,20015,20016,20017,20018,20019,20020,20021,20022,20023,20024,20025,20026,20027,20028,20029,20030,20031,20032,20062,20063,20064,20065,20066,20067,20068,20069,20070,20071,20072,20073,20074,20075,20076,20077,20078,20079,20080,20081,20082,20083,20084,20085,20086,20087,20088,20089,20090,20091,
20092,20135,20136,20137,20138,20248,20249,20250,20251,20252,20253,20254,20255,20256,20257,20258,20348,20349,20350,20351,20352,20353,20354,20355,20356,20357,20358,20436,20437,20438,20439,20440,20499,20538,20539,20790,20791,20822,20823,20824,20934,20935,20936,21035,21036,21037,21095,21096,21097,21148,21149,21150,21291,21292,21413,21414,21415,21416,21417,21418,21419,21420,21421,21422,21423,21473,21474,21475,21476,21477,21478,21479,21480,21481,21482,21483,21500,21780,21781,21782,21817,21818,21891,21892,
21893,21894,21896,21897,21898,21899,22032,22033,22091,22092,22171,22172,22173,22174,22175,22176,22177,22181,22182,22183,22184,22185,22186,22187,22191,22192,22193,22194,22195,22196,22197,22234,22235,22236,22332,22391,22392,22521,22522,22523,22524,22525,22700,22770,22780,22832,22991,22992,22993,22994,23028,23029,23030,23031,23032,23033,23034,23035,23036,23037,23038,23090,23095,23239,23240,23433,23700,23830,23831,23832,23833,23834,23835,23836,23837,23838,23839,23840,23841,23842,23843,23844,23845,23846,
23847,23848,23849,23850,23851,23852,23853,23866,23867,23868,23869,23870,23871,23872,23877,23878,23879,23880,23881,23882,23883,23884,23886,23887,23888,23889,23890,23891,23892,23893,23894,23946,23947,23948,24047,24048,24100,24200,24305,24306,24311,24312,24313,24342,24343,24344,24345,24346,24347,24370,24371,24372,24373,24374,24375,24376,24377,24378,24379,24380,24381,24382,24383,24500,24547,24548,24571,24600,24718,24719,24720,24721,24817,24818,24819,24820,24821,24877,24878,24879,24880,24881,24882,24891,
24892,24893,25E3,25231,25391,25392,25393,25394,25395,25828,25829,25830,25831,25832,25833,25834,25835,25836,25837,25838,25884,25932,26191,26192,26193,26194,26195,26237,26331,26332,26391,26392,26393,26432,26591,26592,26632,26692,26701,26702,26703,26704,26705,26706,26707,26708,26709,26710,26711,26712,26713,26714,26715,26716,26717,26718,26719,26720,26721,26722,26729,26730,26731,26732,26733,26734,26735,26736,26737,26738,26739,26740,26741,26742,26743,26744,26745,26746,26747,26748,26749,26750,26751,26752,
26753,26754,26755,26756,26757,26758,26759,26760,26761,26762,26763,26764,26765,26766,26767,26768,26769,26770,26771,26772,26773,26774,26775,26776,26777,26778,26779,26780,26781,26782,26783,26784,26785,26786,26787,26788,26789,26790,26791,26792,26793,26794,26795,26796,26797,26798,26799,26801,26802,26803,26811,26812,26813,26847,26848,26849,26850,26851,26852,26853,26854,26855,26856,26857,26858,26859,26860,26861,26862,26863,26864,26865,26866,26867,26868,26869,26870,26891,26892,26893,26894,26895,26896,26897,
26898,26899,26901,26902,26903,26904,26905,26906,26907,26908,26909,26910,26911,26912,26913,26914,26915,26916,26917,26918,26919,26920,26921,26922,26923,26929,26930,26931,26932,26933,26934,26935,26936,26937,26938,26939,26940,26941,26942,26943,26944,26945,26946,26948,26949,26950,26951,26952,26953,26954,26955,26956,26957,26958,26959,26960,26961,26962,26963,26964,26965,26966,26967,26968,26969,26970,26971,26972,26973,26974,26975,26976,26977,26978,26979,26980,26981,26982,26983,26984,26985,26986,26987,26988,
26989,26990,26991,26992,26993,26994,26995,26996,26997,26998,27037,27038,27039,27040,27120,27200,27205,27206,27207,27208,27209,27210,27211,27212,27213,27214,27215,27216,27217,27218,27219,27220,27221,27222,27223,27224,27225,27226,27227,27228,27229,27230,27231,27232,27258,27259,27260,27291,27292,27391,27392,27393,27394,27395,27396,27397,27398,27429,27492,27493,27500,27561,27562,27563,27564,27571,27572,27573,27574,27581,27582,27583,27584,27591,27592,27593,27594,27700,28191,28192,28193,28232,28348,28349,
28350,28351,28352,28353,28354,28355,28356,28357,28358,28402,28403,28404,28405,28406,28407,28408,28409,28410,28411,28412,28413,28414,28415,28416,28417,28418,28419,28420,28421,28422,28423,28424,28425,28426,28427,28428,28429,28430,28431,28432,28462,28463,28464,28465,28466,28467,28468,28469,28470,28471,28472,28473,28474,28475,28476,28477,28478,28479,28480,28481,28482,28483,28484,28485,28486,28487,28488,28489,28490,28491,28492,28600,28991,28992,29100,29101,29118,29119,29120,29121,29122,29168,29169,29170,
29171,29172,29177,29178,29179,29180,29181,29182,29183,29184,29185,29187,29188,29189,29190,29191,29192,29193,29194,29195,29220,29221,29333,29635,29636,29701,29738,29739,29849,29850,29871,29872,29873,29900,29901,29902,29903,30161,30162,30163,30164,30165,30166,30167,30168,30169,30170,30171,30172,30173,30174,30175,30176,30177,30178,30179,30200,30339,30340,30491,30492,30493,30494,30591,30592,30729,30730,30731,30732,30791,30792,30800,31028,31121,31154,31170,31171,31251,31252,31253,31254,31255,31256,31257,
31258,31259,31265,31266,31267,31268,31275,31276,31277,31278,31279,31281,31282,31283,31284,31285,31286,31287,31288,31289,31290,31291,31292,31293,31294,31295,31296,31297,31370,31461,31462,31463,31464,31465,31466,31467,31468,31469,31491,31492,31493,31494,31495,31528,31529,31600,31700,31838,31839,31900,31901,31917,31918,31919,31920,31921,31922,31965,31966,31967,31968,31969,31970,31971,31972,31973,31974,31975,31976,31977,31978,31979,31980,31981,31982,31983,31984,31985,31986,31987,31988,31989,31990,31991,
31992,31993,31994,31995,31996,31997,31998,31999,32E3,32001,32002,32003,32005,32006,32007,32008,32009,32010,32011,32012,32013,32014,32015,32016,32017,32018,32019,32020,32021,32022,32023,32024,32025,32026,32027,32028,32029,32030,32031,32033,32034,32035,32036,32037,32038,32039,32040,32041,32042,32043,32044,32045,32046,32047,32048,32049,32050,32051,32052,32053,32054,32055,32056,32057,32058,32059,32060,32061,32062,32064,32065,32066,32067,32074,32075,32076,32077,32081,32082,32083,32084,32085,32086,32098,
32099,32100,32104,32107,32108,32109,32110,32111,32112,32113,32114,32115,32116,32117,32118,32119,32120,32121,32122,32123,32124,32125,32126,32127,32128,32129,32130,32133,32134,32135,32136,32137,32138,32139,32140,32141,32142,32143,32144,32145,32146,32147,32148,32149,32150,32151,32152,32153,32154,32155,32156,32157,32158,32161,32164,32165,32166,32167,32180,32181,32182,32183,32184,32185,32186,32187,32188,32189,32190,32191,32192,32193,32194,32195,32196,32197,32198,32199,32201,32202,32203,32204,32205,32206,
32207,32208,32209,32210,32211,32212,32213,32214,32215,32216,32217,32218,32219,32220,32221,32222,32223,32224,32225,32226,32227,32228,32229,32230,32231,32232,32233,32234,32235,32236,32237,32238,32239,32240,32241,32242,32243,32244,32245,32246,32247,32248,32249,32250,32251,32252,32253,32254,32255,32256,32257,32258,32259,32260,32301,32302,32303,32304,32305,32306,32307,32308,32309,32310,32311,32312,32313,32314,32315,32316,32317,32318,32319,32320,32321,32322,32323,32324,32325,32326,32327,32328,32329,32330,
32331,32332,32333,32334,32335,32336,32337,32338,32339,32340,32341,32342,32343,32344,32345,32346,32347,32348,32349,32350,32351,32352,32353,32354,32355,32356,32357,32358,32359,32360,32601,32602,32603,32604,32605,32606,32607,32608,32609,32610,32611,32612,32613,32614,32615,32616,32617,32618,32619,32620,32621,32622,32623,32624,32625,32626,32627,32628,32629,32630,32631,32632,32633,32634,32635,32636,32637,32638,32639,32640,32641,32642,32643,32644,32645,32646,32647,32648,32649,32650,32651,32652,32653,32654,
32655,32656,32657,32658,32659,32660,32661,32662,32664,32665,32666,32667,32701,32702,32703,32704,32705,32706,32707,32708,32709,32710,32711,32712,32713,32714,32715,32716,32717,32718,32719,32720,32721,32722,32723,32724,32725,32726,32727,32728,32729,32730,32731,32732,32733,32734,32735,32736,32737,32738,32739,32740,32741,32742,32743,32744,32745,32746,32747,32748,32749,32750,32751,32752,32753,32754,32755,32756,32757,32758,32759,32760,32761,32766,53001,53002,53003,53004,53008,53009,53010,53011,53012,53013,
53014,53015,53016,53017,53018,53019,53021,53022,53023,53024,53025,53026,53027,53028,53029,53030,53031,53032,53034,53042,53043,53044,53045,53046,53048,53049,53074,53075,53076,53077,53078,53079,53080,54001,54002,54003,54004,54008,54009,54010,54011,54012,54013,54014,54015,54016,54017,54018,54019,54021,54022,54023,54024,54025,54026,54027,54028,54029,54030,54031,54032,54034,54042,54043,54044,54045,54046,54048,54049,54050,54051,54052,54053,54074,54075,54076,54077,54078,54079,54080,65061,65062,65161,65163,
102001,102002,102003,102004,102005,102006,102007,102008,102009,102010,102011,102012,102013,102014,102015,102016,102017,102018,102019,102020,102021,102022,102023,102024,102025,102026,102027,102028,102029,102030,102031,102032,102033,102034,102035,102036,102037,102038,102039,102040,102041,102042,102043,102044,102045,102046,102047,102048,102049,102050,102051,102052,102053,102054,102055,102056,102057,102058,102059,102060,102061,102062,102063,102064,102065,102066,102067,102068,102069,102070,102071,102072,
102073,102074,102075,102076,102077,102078,102079,102080,102081,102082,102083,102084,102085,102086,102087,102088,102089,102090,102091,102092,102093,102094,102095,102096,102097,102098,102099,102100,102101,102102,102103,102104,102105,102106,102107,102108,102109,102110,102111,102112,102113,102114,102115,102116,102117,102118,102119,102120,102121,102122,102123,102124,102125,102126,102127,102128,102129,102130,102131,102132,102133,102134,102135,102136,102137,102138,102139,102140,102141,102142,102143,102144,
102145,102146,102147,102148,102149,102150,102151,102152,102153,102154,102155,102156,102157,102158,102159,102160,102161,102162,102163,102164,102165,102166,102167,102168,102169,102170,102171,102172,102173,102174,102175,102176,102177,102178,102179,102180,102181,102182,102183,102184,102185,102186,102187,102188,102189,102190,102191,102192,102193,102194,102195,102196,102197,102198,102199,102200,102201,102202,102203,102204,102205,102206,102207,102208,102209,102210,102211,102212,102213,102214,102215,102216,
102217,102218,102219,102220,102221,102222,102223,102224,102225,102226,102227,102228,102229,102230,102231,102232,102233,102234,102235,102236,102237,102238,102239,102240,102241,102242,102243,102244,102245,102246,102247,102248,102249,102250,102251,102252,102253,102254,102255,102256,102257,102258,102259,102260,102261,102262,102263,102264,102265,102266,102267,102268,102269,102270,102271,102272,102273,102274,102275,102276,102277,102278,102279,102280,102281,102282,102283,102284,102285,102286,102287,102288,
102289,102290,102291,102292,102293,102294,102295,102296,102297,102298,102299,102300,102301,102302,102303,102304,102305,102306,102307,102308,102309,102310,102311,102312,102313,102314,102315,102316,102317,102318,102319,102320,102321,102322,102323,102324,102325,102326,102327,102328,102329,102330,102331,102332,102333,102334,102335,102336,102337,102338,102339,102340,102341,102342,102343,102344,102345,102346,102347,102348,102349,102350,102351,102352,102353,102354,102355,102356,102357,102358,102359,102360,
102361,102362,102363,102364,102365,102366,102367,102368,102369,102370,102371,102372,102373,102374,102375,102376,102377,102378,102379,102380,102381,102382,102383,102384,102385,102386,102387,102388,102389,102390,102391,102392,102393,102394,102395,102396,102397,102398,102399,102400,102401,102402,102403,102404,102405,102406,102407,102408,102409,102410,102411,102412,102413,102414,102415,102416,102417,102418,102419,102420,102421,102422,102423,102424,102425,102426,102427,102428,102429,102430,102431,102432,
102433,102434,102435,102436,102437,102438,102439,102440,102441,102442,102443,102444,102445,102446,102447,102448,102449,102450,102451,102452,102453,102454,102455,102456,102457,102458,102459,102460,102461,102462,102463,102464,102465,102466,102467,102468,102469,102470,102471,102472,102473,102474,102475,102476,102477,102478,102479,102480,102481,102482,102483,102484,102485,102486,102487,102488,102489,102490,102491,102492,102493,102494,102495,102496,102500,102501,102502,102503,102504,102505,102506,102507,
102508,102509,102510,102511,102512,102513,102514,102515,102516,102517,102518,102519,102520,102521,102522,102523,102524,102525,102526,102527,102528,102529,102530,102531,102532,102533,102534,102535,102536,102537,102538,102539,102540,102541,102542,102543,102544,102545,102546,102547,102548,102549,102550,102551,102552,102553,102554,102555,102556,102557,102558,102559,102560,102561,102570,102571,102572,102573,102574,102575,102576,102577,102578,102579,102580,102581,102582,102583,102584,102585,102586,102587,
102588,102589,102590,102591,102592,102593,102594,102595,102596,102597,102598,102599,102600,102601,102602,102603,102604,102605,102606,102607,102608,102609,102610,102611,102612,102613,102614,102615,102616,102617,102618,102619,102620,102621,102622,102623,102624,102625,102626,102627,102628,102629,102630,102631,102632,102633,102634,102635,102636,102637,102638,102639,102640,102641,102642,102643,102644,102645,102646,102647,102648,102649,102650,102651,102652,102653,102654,102655,102656,102657,102658,102659,
102660,102661,102662,102663,102664,102665,102666,102667,102668,102669,102670,102671,102672,102673,102674,102675,102676,102677,102678,102679,102680,102681,102682,102683,102684,102685,102686,102687,102688,102689,102690,102691,102692,102693,102694,102695,102696,102697,102698,102699,102700,102701,102702,102703,102704,102705,102706,102707,102708,102709,102710,102711,102712,102713,102714,102715,102716,102717,102718,102719,102720,102721,102722,102723,102724,102725,102726,102727,102728,102729,102730,102733,
102734,102735,102736,102737,102738,102739,102740,102741,102742,102743,102744,102745,102746,102747,102748,102749,102750,102751,102752,102753,102754,102755,102756,102757,102758,102761,102762,102763,102764,102765,102766,102767,102768,102769,102770,102771,102772,102773,102774,102775,102776,102777,102778,102779,102780,102781,102782,102783,102784,102785,102786,102787,102788,102789,102790,102791,102792,102793,102794,102795,102796,102797,102798,102962,102963,102965,102966,102967,102968,102969,102970,102971,
102972,102973,102974,102975,102976,102977,102978,102979,102980,102981,102982,102983,102984,102985,102986,102987,102988,102989,102990,102991,102992,102993,102994,102995,102996,102997,102998,102999,103E3,103001,103002,103003,103004,103005,103006,103007,103008,103009,103010,103011,103012,103013,103014,103015,103016,103017,103018,103019,103020,103021,103022,103023,103024,103025,103026,103027,103028,103029,103030,103031,103032,103033,103034,103035,103036,103037,103038,103039,103040,103041,103042,103043,
103044,103045,103046,103047,103048,103049,103050,103051,103052,103053,103054,103055,103056,103057,103058,103059,103060,103061,103062,103063,103064,103065,103066,103067,103068,103069,103070,103071,103072,103073,103074,103075,103076,103077,103078,103079,103080,103081,103082,103083,103084,103085,103086,103087,103088,103089,103090,103091,103092,103093,103094,103095,103096,103097,103098,103099,103100,103101,103102,103103,103104,103105,103106,103107,103108,103109,103110,103111,103112,103113,103114,103115,
103116,103117,103118,103119,103120,103121,103122,103123,103124,103125,103126,103127,103128,103129,103130,103131,103132,103133,103134,103135,103136,103137,103138,103139,103140,103141,103142,103143,103144,103145,103146,103147,103148,103149,103150,103151,103152,103153,103154,103155,103156,103157,103158,103159,103160,103161,103162,103163,103164,103165,103166,103167,103168,103169,103170,103171,103172,103173,103174,103175,103176,103177,103178,103179,103180,103181,103182,103183,103184,103185,103186,103187,
103188,103189,103190,103191,103192,103193,103194,103195,103196,103197,103198,103199,103200,103201,103202,103203,103204,103205,103206,103207,103208,103209,103210,103211,103212,103213,103214,103215,103216,103217,103218,103219,103220,103221,103222,103223,103224,103225,103226,103227,103228,103229,103230,103231,103232,103233,103234,103235,103236,103237,103238,103239,103240,103241,103242,103243,103244,103245,103246,103247,103248,103249,103250,103251,103252,103253,103254,103255,103256,103257,103258,103259,
103260,103261,103262,103263,103264,103265,103266,103267,103268,103269,103270,103271,103272,103273,103274,103275,103276,103277,103278,103279,103280,103281,103282,103283,103284,103285,103286,103287,103288,103289,103290,103291,103292,103293,103294,103295,103296,103297,103298,103299,103300,103301,103302,103303,103304,103305,103306,103307,103308,103309,103310,103311,103312,103313,103314,103315,103316,103317,103318,103319,103320,103321,103322,103323,103324,103325,103326,103327,103328,103329,103330,103331,
103332,103333,103334,103335,103336,103337,103338,103339,103340,103341,103342,103343,103344,103345,103346,103347,103348,103349,103350,103351,103352,103353,103354,103355,103356,103357,103358,103359,103360,103361,103362,103363,103364,103365,103366,103367,103368,103369,103370,103371,103372,103373,103374,103375,103376,103377,103378,103379,103380,103381,103382,103383,103384,103385,103386,103387,103388,103389,103390,103391,103392,103393,103394,103395,103396,103397,103398,103399,103400,103401,103402,103403,
103404,103405,103406,103407,103408,103409,103410,103411,103412,103413,103414,103415,103416,103417,103418,103419,103420,103421,103422,103423,103424,103425,103426,103427,103428,103429,103430,103431,103432,103433,103434,103435,103436,103437,103438,103439,103440,103441,103442,103443,103444,103445,103446,103447,103448,103449,103450,103451,103452,103453,103454,103455,103456,103457,103458,103459,103460,103461,103462,103463,103464,103465,103466,103467,103468,103469,103470,103471,103472,103473,103474,103475,
103476,103477,103478,103479,103480,103481,103482,103483,103484,103485,103486,103487,103488,103489,103490,103491,103492,103493,103494,103495,103496,103497,103498,103499,103500,103501,103502,103503,103504,103505,103506,103507,103508,103509,103510,103511,103512,103513,103514,103515,103516,103517,103518,103519,103520,103521,103522,103523,103524,103525,103526,103527,103528,103529,103530,103531,103532,103533,103534,103535,103536,103537,103538,103539,103540,103541,103542,103543,103544,103545,103546,103547,
103548,103549,103550,103551,103552,103553,103554,103555,103556,103557,103558,103559,103560,103561,103562,103563,103564,103565,103566,103567,103568,103569,103570,103571,103572,103573,103574,103575,103576,103577,103578,103579,103580,103581,103582,103583,103584,103585,103600,103601,103602,103603,103604,103605,103606,103607,103608,103609,103610,103611,103612,103613,103614,103615,103616,103617,103618,103619,103620,103621,103622,103623,103624,103625,103626,103627,103628,103629,103630,103631,103632,103633,
103634,103635,103636,103637,103638,103639,103640,103641,103642,103643,103644,103645,103646,103647,103648,103649,103650,103651,103652,103653,103654,103655,103656,103657,103658,103659,103660,103661,103662,103663,103664,103665,103666,103667,103668,103669,103670,103671,103672,103673,103674,103675,103676,103677,103678,103679,103680,103681,103682,103683,103684,103685,103686,103687,103688,103689,103690,103691,103692,103693,103694,103695,103700,103701,103702,103703,103704,103705,103706,103707,103708,103709,
103710,103711,103712,103713,103714,103715,103716,103717,103718,103719,103720,103721,103722,103723,103724,103725,103726,103727,103728,103729,103730,103731,103732,103733,103734,103735,103736,103737,103738,103739,103740,103741,103742,103743,103744,103745,103746,103747,103748,103749,103750,103751,103752,103753,103754,103755,103756,103757,103758,103759,103760,103761,103762,103763,103764,103765,103766,103767,103768,103769,103770,103771,103772,103773,103774,103775,103776,103777,103778,103779,103780,103781,
103782,103783,103784,103785,103786,103787,103788,103789,103790,103791,103792,103793,103794,103795,103796,103797,103798,103799,103800,103801,103802,103803,103804,103805,103806,103807,103808,103809,103810,103811,103812,103813,103814,103815,103816,103817,103818,103819,103820,103821,103822,103823,103824,103825,103826,103827,103828,103829,103830,103831,103832,103833,103834,103835,103836,103837,103838,103839,103840,103841,103842,103843,103844,103845,103846,103847,103848,103849,103850,103851,103852,103853,
103854,103855,103856,103857,103858,103859,103860,103861,103862,103863,103864,103865,103866,103867,103868,103869,103870,103871,103900,103901,103902,103903,103904,103905,103906,103907,103908,103909,103910,103911,103912,103913,103914,103915,103916,103917,103918,103919,103920,103921,103922,103923,103924,103925,103926,103927,103928,103929,103930,103931,103932,103933,103934,103935,103936,103937,103938,103939,103940,103941,103942,103943,103944,103945,103946,103947,103948,103949,103950,103951,103952,103953,
103954,103955,103956,103957,103958,103959,103960,103961,103962,103963,103964,103965,103966,103967,103968,103969,103970,103971];d("extend-esri")&&H.setObject("dijit.analysis.PCSList",n,m);return n})},"esri/layers/RasterXLayer":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/array dojo/_base/Deferred dojo/sniff dojo/dom-construct dojo/dom-style dojo/on dojox/gfx/matrix dojo/when dojo/DeferredList ../kernel ../config ../lang ../domUtils ../urlUtils ../graphic ../request ../renderers/ClassBreaksRenderer ../renderers/StretchRenderer ../renderers/UniqueValueRenderer ../renderers/ColormapRenderer ../renderers/ShadedReliefRenderer ../geometry/Extent ../SpatialReference ../geometry/Point ./Field ./TimeInfo ./MosaicRule ./DimensionalDefinition ./PixelBlock ./ImageServiceLayerMixin ./rasterLib/raster/rasterFactory ./rasterLib/raster/rasterProjectionHelper ./rasterLib/renderer/rasterRendererHelper ./rasterLib/tile/RasterTileInfo ./rasterLib/tile/RasterTileManager ./rasterLib/tile/RasterHandler ./layer".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F,y,D,B,x,r,t,C,J,L,P,U,aa,ea,ba,oa,da,fa,S,W){var la=l.defaults.map.zoomDuration;H=H([W],{declaredClass:"esri.layers.RasterXLayer",managedSuspension:!0,opacity:1,tileMode:!0,useWebGL:!0,drawMode:!0,_eventMap:{"raster-change":!0,"renderer-change":!0},_lastPopup:[],_rasterFieldPrefix:"Raster.",_cachedVariableStats:{},_cachedVariableHistogram:{},constructor:function(K,O){O=O||{};this.tileMode=null!=O.tileMode?O.tileMode:this.tileMode;this.useWebGL=null!=
O.useWebGL?O.useWebGL:this.useWebGL;this.roaming=null!=O.roaming?O.roaming:this.roaming;this.drawMode=null!=O.drawMode?O.drawMode:this.drawMode;this.bandIds=O.bandIds&&0<O.bandIds.length?O.bandIds:null;this.renderer=O.renderer;this._customModules=O.customModules;this.useMapTime=O.useMapTime;if(O.multidimensionalDefinition&&0<O.multidimensionalDefinition.length){var G=new L;G.multidimensionalDefinition=O.multidimensionalDefinition.map(function(M){return M.toJson?M:new P(M)});G.method=L.METHOD_NONE;
this.mosaicRule=G}this.infoTemplate=O.infoTemplate;this.drawMode||(this._contextType=O._contextType||O.drawType);this._supportLegacyPropMethods=!1!==O.legacySupport;this._rasterHandler=new S({customModules:this._customModules});this._workInitPromise=this._rasterHandler.start();this.pixelData=null;this._initialize(K,O);b(this,"load",d.hitch(this,function(){h(this._rasterHandler._connected||this._rasterHandler._connectionPromise,d.hitch(this,function(){this._rasterHandler.setLayer({layerId:this.id,
raster:{rasterInfo:this.raster.rasterInfo,rasterFunction:this.raster.rasterFunction&&this.raster.rasterFunction.toJson()},bandCount:this.raster.rasterInfo.bandCount});this.raster.rasterFunction&&this._rasterHandler.setRasterFunction({layerId:this.id,data:this.raster.rasterFunction.toJson(!0)});this._rasterRenderer&&this._rasterHandler.setRasterRenderer({layerId:this.id,data:this._rasterRenderer.toJson(!0)})}))}));this._animatePan2d=d.hitch(this,this._animatePan2d)},setOpacity:function(K){this.opacity!==
K&&(this.opacity=K,this.onOpacityChange(K))},onOpacityChange:function(){},onRendererChange:function(){},refresh:function(){if(this.loaded&&this._map)if(!this._canDraw()||10>f("ie"))this.onError(Error("Unable to refresh. This layer is not supported in the current browser."));else this._map&&this._extentChangeHandler(this._map.extent)},clear:function(K,O,G,M){this._canDraw()&&(this.useWebGL||(G?this._context.clearRect(K,O,G,M):this._context.clearRect(0,0,this._map.width,this._map.height)))},getContext:function(){return this._context},
onResume:function(){this.inherited(arguments);this._toggleTime();v.show(this._div);if("css-transforms"===this._map.navigationMode){var K=this._map.__visibleDelta;this._left=this._tdx=K.x;this._top=this._tdy=K.y;a.set(this._div,e._css.names.transform,e._css.translate(this._left,this._top))}this._displayTimer=this._displayTimer||setTimeout(d.hitch(this,function(){this._extentChangeHandler(this._map.extent,null,!0)}),0)},onSuspend:function(){this.inherited(arguments);this._fireUpdateEnd();this._toggleTime();
v.hide(this._div);clearTimeout(this._displayTimer);this._displayTimer=null},redraw:function(){this.useWebGL&&this._glSetting&&(this._glSetting.hasNewTexture=!1);var K=this.tileMode?this.tileManager.originalPixelData:this.originalPixelData;if(this.tileMode?K&&(K.src||K.texture):K)if(this.tileMode)if(this.useWebGL)this._updateAllTilesOnce(K);else{this.tileManager.tiles.forEach(function(G){G&&(G.update=null,G.completed=!1,G.processedPixelBlock=null,G.renderedPixelBlock=null)});K.processedPixelBlock=
null;var O=this.raster.rasterFunction?this.raster.rasterFunction.read(K):{extent:K.extent,pixelBlock:K.src[this.tileManager.identifiers[0]]&&K.src[this.tileManager.identifiers[0]].pixelBlock};K.renderedPixelBlock=null;K=this._rasterRenderer?this._rasterRenderer.draw(O):O;this._drawOneFrame(K)}else this._supportLegacyPropMethods&&this.pixelFilter?this._setPixelData(this.originalPixelData):(K.processedPixelBlock=null,O=this.raster.rasterFunction?this.raster.rasterFunction.read(K):{extent:K.extent,pixelBlock:K.src?
K.src[this.tileManager.identifiers[0]]&&K.src[this.tileManager.identifiers[0]].pixelBlock:K.pixelBlock},K.renderedPixelBlock=null,K=this._rasterRenderer?this._rasterRenderer.draw(O):O,this._drawOneFrame(K))},getCurrentResolution:function(){var K=this._map.extent;return new t((K.xmax-K.xmin)/this._map.width,(K.ymax-K.ymin)/this._map.height,K.spatialReference)},getCustomRasterFields:function(K){var O=K?K.rasterAttributeTableFieldPrefix:this._rasterFieldPrefix,G={name:this._rasterFieldPrefix+"ServicePixelValue",
alias:"Pixel Value",domain:null,editable:!1,length:50,type:10.3<=this.version?"esriFieldTypeDouble":"esriFieldTypeString"};K=this.fields?d.clone(this.fields):[];K.push(G);(G=this.rasterAttributeTable&&this.rasterAttributeTable.fields)&&0<G.length&&(G=n.filter(G,function(M){return"esriFieldTypeOID"!==M.type&&"value"!==M.name.toLowerCase()}),G=n.map(G,function(M){var N=d.clone(M);N.name=O+M.name;return N}),K=K.concat(G));return K},setRenderer:function(K,O){if(this.loaded&&K){if(K.declaredClass&&-1<
K.declaredClass.indexOf("esri.layers.rasterLib")){this._rasterRenderer=K;this._rasterRenderer.bind({layer:this});var G=this.bandIds=K.bandIndex;this.raster&&this.raster.setFetchParameters({bandIds:G});this._params&&(this._params.bandIds=G&&0<G.length?G.join(","):null);this.renderer=this._getCommonRenderer(K)}else G=d.clone(K.toJson?K.toJson():K),"rasterStretch"===G.type&&(G.bandIndex=this.bandIds,G.bandIndex&&1<G.bandIndex.length||!G.bandIndex&&this.raster&&1<this.raster.rasterInfo.bandCount)&&(G.type=
"rgb"),this._rasterRenderer=oa.create(G),this.renderer=K.declaredClass?K:this._getCommonRenderer(this._rasterRenderer),this._rasterRenderer.bind({layer:this});if(this._map){if(this.loaded&&this._rasterHandler._connected){var M=this._rasterHandler.setRasterRenderer({layerId:this.id,data:this._rasterRenderer.toJson(!0)});this._updateTilingEffects()}O||(M?M.then(d.hitch(this,function(){this.redraw()})):this.redraw());this.onRendererChange()}}},setBandIds:function(K,O){this.bandIds=K;this.raster&&this.raster.setFetchParameters({bandIds:K});
this._params&&(this._params.bandIds=K&&0<K.length?K.join(","):null);this.setRenderer(this.renderer,O)},_setTime:function(K){K=K?K.toJson():null;this._params&&(this._params.time=K);this.raster.setFetchParameters({time:K});this.tileManager&&this.tileManager.tiles&&this.tileManager.resetTiles()},setInfoTemplate:function(K){this.infoTemplate=K;this._updateInfoTemplateFields(this.fields)},setMultiDimensionalDefinition:function(K,O){var G=K&&K.multidimensionalDefinition;if(G&&this.loaded){var M=G&&G[0].variableName;
""===M&&(M=this._multidimensionalInfo.variables[0].name,G.forEach(function(V){V.variableName=M}));if("ImageService"===this.raster.sourceType){var N=this.raster._getAllDimensionDefinition(G,M);N.defChanged&&(K.multidimensionalDefinition=N.definition,this.setMosaicRule(K,!0))}this.raster.setFetchParameters({multidimensionalDefinition:G});this.tileManager&&this.tileManager.tiles&&this.tileManager.resetTiles();M&&this._updateRasterInfo(M);O||this.refresh()}},_updateRasterInfo:function(K){var O=this.raster.rasterInfo,
G=this.getHistograms(K);K=this.getStatistics(K);(new g([G,K])).then(d.hitch(this,function(M){M[0][0]&&(O.histograms=M[0][1].histograms);M[1][0]&&(O.statistics=M[1][1]);this.refresh()}))},_updateInfoTemplateFields:function(K){if(K&&!(1>K.length)&&this.infoTemplate&&this.infoTemplate.info&&this.infoTemplate.info.fieldInfos&&!(1>this.infoTemplate.info.fieldInfos.length)){var O,G;var M=this.infoTemplate.info.fieldInfos;for(O=0;O<K.length;O++){var N=K[O];for(G=0;G<M.length;G++)if(M[G].fieldName.toLowerCase()===
N.name.toLowerCase()&&M[G].fieldName!==N.name){M[G].fieldName=N.name;break}}}},getPixelData:function(K){return this.tileMode?K?this.tileManager.originalPixelData.src&&this.tileManager.originalPixelData.src[this.tileManager.identifiers[0]]:null:this.inherited(arguments)},fetchPopupFromTiles:function(K){var O=new q;this.identify(K.geometry).then(function(G){var M=G.pixelValue;this.hasStdTime()&&M&&M.length&&null!=M[0]&&(M=M.map(function(Y){return this.getStdTimeValue(Y)}.bind(this)).join(", "));if(M){G=
{ObjectId:0,"Raster.ServicePixelValue":M};var N=this.rasterAttributeTable&&this.rasterAttributeTable.features;if(N&&0<N.length&&(N=n.filter(N,function(Y){if(Y&&Y.attributes)return Y.attributes.hasOwnProperty("Value")?Y.attributes.Value==M:Y.attributes.VALUE==M}),0<N.length&&(N=d.clone(N[0]))))for(var V in N.attributes)N.attributes.hasOwnProperty(V)&&(G[this._rasterFieldPrefix+V]=N.attributes[V]);V=new u(new x(this.projectedFullExtent||this.fullExtent),null,G);V.setInfoTemplate(this.infoTemplate);
V._layer=this;this._lastPopup=[V];O.resolve([V])}else this._lastPopup=[],O.resolve()}.bind(this),function(G){this._lastPopup=[];O.resolve(G)});return O},getPopupFromTiles:function(){return this._lastPopup},identify:function(K,O){return this.raster?this.raster.identify(K):(K=new q,K.reject("layer must be initialized to identify"),K.promise)},_getCommonRenderer:function(K){switch(K.rendererName){case "RGB":case "Stretch":return new F(K.toCommonRendererJson());case "UniqueValue":return new y(K.toCommonRendererJson());
case "ClassBreaks":return new w(K.toCommonRendererJson());case "Colormap":return new D(K.toCommonRendererJson());case "ShadedRelief":return new B(K.toCommonRendererJson())}},_getProjectedFullExtent:function(K){return this.raster.getProjectedFullExtent(K).then(d.hitch(this,function(O){this.projectedFullExtent=O}))},_initialize:function(K,O){O=O||{};this._supportLegacyPropMethods&&this.constructor._onMap&&(this.constructor._onMap["rendering-change"]={method:"onRenderingChange"},this.constructor._onMap["mosaic-rule-change"]=
{method:"onMosaicRuleChange"},this.constructor._onMap["spatial-reference-change"]={method:"onSpatialReferenceChange"});this.raster={};var G=O.raster?O.raster.url:K;G&&-1<G.toLowerCase().indexOf("/imageserver")&&this._supportLegacyPropMethods&&this._addLegacySupport(G,O);var M=d.hitch(this,function(){this.loaded=!0;this.mosaicRule&&this.mosaicRule.multidimensionalDefinition&&0<this.mosaicRule.multidimensionalDefinition.length&&this.setMultiDimensionalDefinition(this.mosaicRule,!0);this.raster._setRasterHandler(this._rasterHandler);
this.onLoad(this);var N=this._loadCallback;N&&(delete this._loadCallback,N(this))});(K?ea.create(d.mixin({url:K},O)):O.raster&&O.raster.open()).then(d.hitch(this,function(N){if(N){this.raster=N;var V=this._getSourceImageServiceRaster();this.url||(this.url=V&&V.url);this.url&&(this._url=z.urlToObject(K));var Y=O.minScale,ka=O.maxScale,ja=N.tileInfo&&"Raster"===N.tileInfo.tileType;null==ka&&(ka=ja&&O.zoomFactor?N.tileInfo.lods[N.tileInfo.lods.length-1].scale/O.zoomFactor:this.maxScale);null==Y&&(Y=
ja&&O.zoomFactor?N.tileInfo.lods[0].scale*O.zoomFactor:this.minScale);V&&"ImageService"===V.sourceType&&this._supportLegacyPropMethods&&this._addGeneralProperties(K,O);this.initialExtent=this.fullExtent=this.extent=this.raster.rasterInfo.extent;this.spatialReference=this.extent.spatialReference;this.timeInfo=this.raster.rasterInfo.timeInfo?new J(this.raster.rasterInfo.timeInfo):null;this.rasterAttributeTable=this.raster.rasterInfo.vat;this._multidimensionalInfo=this.raster.rasterInfo.multidimensionalInfo;
this.rasterAttributeTable&&(this._rasterAttributeTableFields=this.rasterAttributeTable.fields);this.mosaicRule&&this.raster.setFetchParameters({multidimensionalDefinition:this.mosaicRule.multidimensionalDefinition});this._multidimensionalInfo&&(this._getDefaultMultidimensionalDefinition(this._multidimensionalInfo,!0,!0),this.mosaicRule||(this.mosaicRule=this.defaultMosaicRule,this.raster.setFetchParameters({multidimensionalDefinition:this._defaultMultidimensionalDefinition})),this.raster.defaultMultidimensionalDefinition=
this._defaultMultidimensionalDefinition);null==Y||this._hasMin||this.setMinScale(Y);null==ka||this._hasMax||this.setMaxScale(ka);this._workInitPromise?this._workInitPromise.then(M,M):M()}else console.error("cannot create rasterx layer as the raster data source cannot be opened")}),this._errorHandler)},_getSourceImageServiceRaster:function(){var K=this.raster&&"Function"===this.raster.sourceType?1===this.raster.getMemberRasters().length?this.raster.getMemberRasters()[0]:null:this.raster;if(K&&"ImageService"===
K.sourceType)return K},_addLegacySupport:function(K,O){this._url=z.urlToObject(K);O=O||{};this.format=(K=O.imageServiceParameters)&&K.format;this.compressionTolerance=K&&K.compressionTolerance?K.compressionTolerance:.01;this.interpolation=K?K.interpolation:null;this.compressionQuality=K?K.compressionQuality:null;this.bandIds=K&&K.bandIds||O&&O.bandIds||null;this.mosaicRule||(this.mosaicRule=K?K.mosaicRule:null);this.renderingRule||(this.renderingRule=K?K.renderingRule:null);this.useMapDimensionValue=
O.hasOwnProperty("useMapDimensionValue")?!!O.useMapDimensionValue:!0;this.hasImageFilter=O.hasImageFilter;this.activeMapDimensions=O.activeMapDimensions;this._params=d.mixin({},this._url.query,{f:"image",interpolation:this.interpolation,format:this.format,compressionQuality:this.compressionQuality,bandIds:this.bandIds?this.bandIds.join(","):null},K?K.toJson():{});this.pixelFilter=O.pixelFilter;this.originalPixelData=this.pixelData=null;this._queryVisibleRastersHandler=d.hitch(this,this._queryVisibleRastersHandler);
this._useRenderingRuleAttributeTable=!1;this._rasterFunctionTemplateInfos={};this._customRenderingRuleId={};this._setDefaultFilter=function(){};var G={setInterpolation:"interpolation",setCompressionQuality:"compressionQuality",setCompressionTolerance:"compressionTolerance",setBandIds:"bandIds",setDefaultBandIds:"bandIds",setMosaicRule:"mosaicRule",setRenderingRule:"renderingRule",setImageFormat:"format"},M,N=new aa;Object.keys(G).forEach(d.hitch(this,function(V){this[V]=d.hitch(this,function(Y,ka){M=
{};M[G[V]]=Y;this.raster&&(this.raster.setFetchParameters(M),N[V].bind(this)(Y,ka))})}));this.setDisableClientCaching=function(V){N.setDisableClientCaching.bind(this)(V);var Y=this._getSourceImageServiceRaster();Y?Y.disableClientCaching=V:null}.bind(this);this.setDefinitionExpression=N.setDefinitionExpression.bind(this);this.setUseMapTime=N.setUseMapTime.bind(this);this._toggleTime=N._toggleTime.bind(this);this._onTimeExtentChangeHandler=N._onTimeExtentChangeHandler.bind(this);this.setPixelFilter=
N.setPixelFilter.bind(this);this.getHistograms=N.getHistograms.bind(this);this.getRasterFunctionInfos=N.getRasterFunctionInfos.bind(this);this.getKeyProperties=N.getKeyProperties.bind(this);this.getRasterAttributeTable=N.getRasterAttributeTable.bind(this);this.getRenderingRuleServiceInfo=N.getRenderingRuleServiceInfo.bind(this);this._getRenderingRuleId=N._getRenderingRuleId.bind(this);this._isRenderingRuleAProcessingTemplate=N._isRenderingRuleAProcessingTemplate.bind(this);this.handleSpatialReferenceChange=
N.handleSpatialReferenceChange.bind(this);this.onRenderingChange=this.onRenderingChange||function(){};this.onSpatialReferenceChange=this.onSpatialReferenceChange||function(){};this.onMosaicRuleChange=this.onMosaicRuleChange||function(V){};this.setRasterRenderer=this.setRenderer;this.getMultidimensionalInfo=N.getMultidimensionalInfo.bind(this);this.getColormap=N.getColormap.bind(this);this.getRenderingRuleColormap=N.getRenderingRuleColormap.bind(this);this.getDefaultMultidimensionalDefinition=N.getDefaultMultidimensionalDefinition.bind(this);
this._getDefaultMultidimensionalDefinition=N._getDefaultMultidimensionalDefinition.bind(this);this._getDefaultDimensionValue=N._getDefaultDimensionValue.bind(this);this.getStatistics=N.getStatistics.bind(this)},_addGeneralProperties:function(){var K=this._getSourceImageServiceRaster();if(K){var O=["minScale","maxScale","tileInfo"];Object.keys(K.serviceInfo).forEach(function(N){null==this[N]&&-1===O.indexOf(N)&&(this[N]=K.serviceInfo[N])}.bind(this));this.pixelSizeX=parseFloat(this.pixelSizeX);this.pixelSizeY=
parseFloat(this.pixelSizeY);this.bands=K.rasterInfo.statistics;var G,M=[];this.fields=this.fields||[];for(G=0;G<this.fields.length;G++)M.push(new C(this.fields[G]));this.fields=M;this.version=this.currentVersion;this.defaultMosaicRule=K.serviceInfo.defaultMosaicRule}},setDefaultRenderer:function(){if(this.loaded&&this._canvas&&!this.pixelFilter){var K=oa.createDefaultRenderer(this);if(null!=K){var O=this.mosaicRule&&this.mosaicRule.multidimensionalDefinition&&0<this.mosaicRule.multidimensionalDefinition.length;
if(this._multidimensionalInfo&&O&&"Stretch"===K.rendererName){var G=this.mosaicRule.multidimensionalDefinition[0].variableName;(O=this._multidimensionalInfo.variables.filter(function(M){return M.name===G})[0])&&O.histograms&&O.histograms.length&&(K.histograms=O.histograms,6===K.stretchType&&(K.dra=!1));O&&O.statistics&&O.statistics.length&&(K.statistics=O.statistics.map(function(M){return[M.min,M.max,M.mean,M.stddev||M.standardDeviation]}),6!==K.stretchType&&(K.dra=!1))}this.setRenderer(K,!0)}}},
setDefaultInterpolation:function(){if(this.loaded&&this._canvas){var K=this.raster.serviceInfo&&this.raster.serviceInfo.defaultResamplingMethod;if(K)switch(K.toLowerCase()){case "bilinear":this.interpolation="RSP_BilinearInterpolation";break;case "cubic":this.interpolation="RSP_CubicConvolution";break;case "majority":this.interpolation="RSP_Majority";break;case "nearest":this.interpolation="RSP_NearestNeighbor"}else{K=this.raster.dataType&&this.raster.dataType.toLowerCase();var O=!!this.raster.rasterInfo.colormap;
this.raster.rasterInfo.vat||O||"thematic"===K||"StdTime"===K?"RSP_NearestNeighbor":"RSP_BilinearInterpolation"}}},_toggleTime:function(){},_updateTilingEffects:function(){(this._hasTilingEffects=this._rasterRenderer&&this._rasterRenderer.hasTilingEffects()||this.raster&&this.raster.rasterFunction&&this.raster.rasterFunction.hasTilingEffects())&&this._map&&this.tileMode&&this.useWebGL&&this.tileManager&&(this._hasTilingEffects=!1)},_setMap:function(K,O){this.inherited(arguments);K.spatialReference&&
(K.spatialReference.ics||K.spatialReference.icsId)&&(this.roaming=this.useWebGL=this.tileMode=!1);if(this.tileMode){this.virtualTileInfo=new da(null,{refTileInfo:K.tileInfo,spatialReference:K.spatialReference,extent:this.raster.rasterInfo.extent});var G=this.raster.tileInfo&&(-1<["Elevation","Raster"].indexOf(this.raster.tileInfo.tileType)||3===this.raster.rasterInfo.bandCount&&"U8"===this.raster.rasterInfo.pixelType)?this.raster.tileInfo:this.virtualTileInfo;this._tileParams=this._tileParams||{};
this._tileParams.size=G.cols+","+G.rows;this.tileManager=new fa({tileInfo:G,layer:this,mapSR:K.spatialReference})}this._dragOrigin={x:0,y:0};G=this._div=c.create("div",null,O);var M={width:K.width+"px",height:K.height+"px",position:"absolute"};"css-transforms"===K.navigationMode?this.roaming&&this.tileMode&&this.useWebGL||(M[e._css.names.transform]=e._css.translate(K.__visibleDelta.x,K.__visibleDelta.y),this._left=K.__visibleDelta.x,this._top=K.__visibleDelta.y):this._left=this._top=0;a.set(G,M);
this._canvas=c.create("canvas",{width:K.width+"px",height:K.height+"px",style:"position: absolute;"},G);p.isDefined(this.opacity)&&a.set(G,"opacity",this.opacity);this._contextType?(this._context=this._canvas.getContext(this._contextType,null),this.useWebGL=this._context instanceof WebGLRenderingContext):this.useWebGL?(this._context=this._canvas.getContext("webgl",null)||this._canvas.getContext("experimental-webgl",null),this.drawMode=!1):(this._context=this._canvas.getContext("2d"),this.drawMode=
!0);this._context||console.error("Unable to create the context. This browser might not support \x3ccanvas\x3e elements.");this.useWebGL&&(K.acquireWebGLContext(this),this._glSetting={gl:this._context,branchCount:this.raster.rasterFunction?this.raster.rasterFunction.branchCount:0,pingpong:null,branches:null,drawMesh:this._drawMesh,programUniforms:{}});this.raster.rasterFunction&&(this._updateTilingEffects(),this.raster.setProcessingContext({layer:this}));this.setRenderer(this.renderer,!0);this._rasterRenderer||
this.setDefaultRenderer();this.interpolation||this.setDefaultInterpolation();this._mapWidth=K.width;this._mapHeight=K.height;this._connects=[];this._connects.push(m.connect(K,"onPan",this,this._panHandler));this._connects.push(m.connect(K,"onPanEnd",this,this._panEndHandler));"css-transforms"===K.navigationMode?this._connects.push(m.connect(K,"onScale",this,this._onScaleHandler)):(this._connects.push(m.connect(K,"onZoom",this,this._onZoomHandler)),this._connects.push(m.connect(K,"onZoomEnd",this,
this._onZoomEndHandler)));this._connects.push(m.connect(K,"onResize",this,this._onResizeHandler));this._connects.push(m.connect(K,"onExtentChange",this,this._extentChangeHandler));this._connects.push(m.connect(this,"onVisibilityChange",this,this._visibilityChangeHandler));this._connects.push(m.connect(this,"onOpacityChange",this,this._opacityChangeHandler));this._startRect={left:0,top:0,width:K.width,height:K.height};this.evaluateSuspension();if(this.suspended&&!K.loaded)var N=m.connect(K,"onLoad",
this,function(){m.disconnect(N);N=null;this.evaluateSuspension()});return G},_unsetMap:function(K,O){this.useWebGL&&K.releaseWebGLContext(this);n.forEach(this._connects,m.disconnect,this);var G=this._div;G&&(O.removeChild(G),c.destroy(G));this._map=this._canvas=this._context=this.data=this._connects=null;clearTimeout(this._displayTimer);this._displayTimer=null;this.inherited(arguments)},_canDraw:function(){return!!(this._map&&this._canvas&&this._context)},_requestDataErrorHandler:function(K){"CancelError"!==
K.name&&(this.clear(),this.onError(K))},_clonePixelData:function(K){if(null===K||K.texture)return K;var O={};K.extent&&(O.extent=d.clone(K.extent));var G=K.pixelBlock;null!=G&&(O.pixelBlock=G.clone());O.texture=K.texture;return O},_setPixelData:function(K){if(K){K=this._clonePixelData(K);this.pixelFilter&&(this.pixelFilter.filter?(this.pixelFilter.renderTexture=!0,this.pixelFilter.filter(K)):this.pixelFilter(K));this.pixelData=K;if(this._rasterReadPromise&&this._rasterReadPromise.isCanceled())return;
this._drawPixelData()}this._rasterReadPromise=null},_requestData:function(K,O,G){this._rasterReadPromise&&this._rasterReadPromise.cancel();K=d.clone(K)._normalize(!0);this._rasterReadPromise=this.raster.read({extent:K,width:this._map.width,height:this._map.height});this._rasterReadPromise.then(d.hitch(this,function(M){this._rasterReadPromise&&this._rasterReadPromise.isCanceled()||(this.originalPixelData=M&&M.srcData?{extent:M.extent,src:M.srcData}:M,this.useWebGL&&this._glSetting&&(this._glSetting.hasNewTexture=
!0),this._setPixelData(M))}),d.hitch(this,this._requestDataErrorHandler));return this._rasterReadPromise},_drawPixelData:function(K){a.set(this._canvas,{left:"0px",top:"0px",width:this._map.width+"px",height:this._map.height+"px"});this._startRect={left:0,top:0,width:this._map.width,height:this._map.height};this.drawMode||"css-transforms"!==this._map.navigationMode||(this._tdx=this._left,this._tdy=this._top,this._multiply=null,a.set(this._div,e._css.names.transform,e._css.translate(this._left,this._top)),
a.set(this._canvas,e._css.names.transform,e._css.translate(-this._left,-this._top)),this._dragOrigin={x:0,y:0});this.useWebGL&&this._rasterRenderer&&this._rasterRenderer.draw(this.pixelData);if(this._canDraw()&&this.drawMode&&this.drawMode&&(K=K||this.pixelData)&&K.pixelBlock){var O=this.pixelFilter?this.pixelData:this._rasterRenderer?this._rasterRenderer.draw(K):K;K=O.pixelBlock;var G=this._context,M=G.createImageData(K.width,K.height);M.data.set(K.getAsRGBA());O=O.extent;var N=this._map.extent,
V=this.getCurrentResolution(),Y=0,ka=0;Math.abs(O.xmin-N.xmin)>V.x&&(Y=Math.round((O.xmin-N.xmin)/V.x));Math.abs(N.ymax-O.ymax)>V.y&&(ka=Math.round((N.ymax-O.ymax)/V.y));"css-transforms"===this._map.navigationMode?(this._tdx=this._left,this._tdy=this._top,this._multiply=null,a.set(this._div,e._css.names.transform,e._css.translate(this._left,this._top)),a.set(this._canvas,e._css.names.transform,e._css.translate(-this._left,-this._top))):(a.set(this._div,{left:"0px",top:"0px",width:this._map.width+
"px",height:this._map.height+"px"}),a.set(this._canvas,{left:"0px",top:"0px",width:this._map.width+"px",height:this._map.height+"px"}));this._dragOrigin={x:0,y:0};this.tileMode?this.clear(Y,ka,K.width,K.height):this.clear();G.putImageData(M,Y,ka,0,0,K.width,K.height);this._fireUpdateEnd()}},hasStdTime:function(){if(!this.hasMultidimensions||"StdTime"!==this.raster.dataType)return!1;var K=this.mosaicRule&&this.mosaicRule.multidimensionalDefinition,O=K&&K.length?K[0].variableName:this._defaultMultidimensionalDefinition[0].variableName;
return this.raster.rasterInfo.multidimensionalInfo.variables.some(function(G){if(G.name===O)return G.dimensions.some(function(M){return"StdTime"===M.name})})},getStdTimeValue:function(K){return(new Date(864E5*(K-25569))).toString()},_animatePan2d:function(){this._oldDelta&&this._delta.x===this._oldDelta.x&&this._delta.y===this._oldDelta.y||(this.tileManager.updateTile(this.tileManager.originalPixelData,!0),this._oldDelta={x:this._delta.x,y:this._delta.y});this._roamingAnimation&&this.tileMode&&this.useWebGL&&
(this._roamingAnimation=requestAnimationFrame(this._animatePan2d))},_cancelAnimation:function(){this._animation&&(cancelAnimationFrame(this._animation),this._animation=null)},_updateAllTilesOnce:function(K,O){return this.tileManager.updateTile(K,!0).then(d.hitch(this,function(G){(this._hasTilingEffects||this.useWebGL||O)&&this._drawOneFrame(G)}))},_drawOneFrame:function(K,O){if(!(this.suspended||!this._map||this.tileMode&&!this._drawTile||(this.tileMode&&this.useWebGL&&this.tileManager.originalPixelData.isEmpty&&
this._context.clear(this._context.COLOR_BUFFER_BIT),this.tileMode&&this.useWebGL&&this.tileManager.xformSetting&&this.tileManager.xformSetting.requireProjection&&!this.tileManager.xformSetting.gridConfig))){if(!this._resetCss||this._levelChange)this._levelChange=!1,this._resetDrawing();if(K&&(K.renderedPixelBlock||K.pixelBlock)&&this._canDraw()&&this.drawMode){O=K.extent;var G=this._map.extent;if(!this._isExtentOutSide(O,G)){var M=K.pixelBlock||K.renderedPixelBlock,N=this._context,V=N.createImageData(M.width,
M.height);V.data.set((K.renderedPixelBlock||K.pixelBlock).getAsRGBA());K=this.getCurrentResolution();var Y=0,ka=0;Math.abs(O.xmin-G.xmin)>K.x&&(Y=Math.round((O.xmin-G.xmin)/K.x));Math.abs(G.ymax-O.ymax)>K.y&&(ka=Math.round((G.ymax-O.ymax)/K.y));N.putImageData(V,Y,ka,0,0,M.width,M.height)}}else this._fireUpdateEnd()}},_isExtentOutSide:function(K,O){return K.xmax<=O.xmin||K.xmin>=O.xmax||K.ymax<=O.ymin||K.ymin>=O.ymax},_resetDrawing:function(){this._resetCss=!0;if(!this.useWebGL)if(this._multiply||
this._startRect.width!==this._map.width||this._startRect.height!==this._map.height)this.clear();else{var K=this._context.getImageData(0,0,this._map.width,this._map.height);this.clear();this._context.putImageData(K,this._startRect.left,this._startRect.top)}this._dragOrigin={x:0,y:0};this._startRect={left:0,top:0,width:this._map.width,height:this._map.height};a.set(this._canvas,{left:"0px",top:"0px",width:this._map.width+"px",height:this._map.height+"px"});"css-transforms"===this._map.navigationMode?
(this.roaming&&this.tileMode&&this.useWebGL&&(this._delta=null),this._tdx=this._left,this._tdy=this._top,this._multiply=null,a.set(this._div,e._css.names.transform,e._css.translate(this._left,this._top)),a.set(this._canvas,e._css.names.transform,e._css.translate(-this._left,-this._top))):(a.set(this._div,{left:"0px",top:"0px",width:this._map.width+"px",height:this._map.height+"px"}),a.set(this._canvas,{left:"0px",top:"0px",width:this._map.width+"px",height:this._map.height+"px"}))},_drawAllFrames:function(){if(!this.suspended&&
this._map&&(!this.tileMode||this._drawTile))if(this._resetCss){var K=this._frames,O=0,G;for(G=0;G<K.length;G++)if(K[G].completed)O++;else if(K[G].tileData.renderedPixelBlock){K[G].completed=!0;var M=K[G].tileData;break}else if(K[G].tileData._fetched&&!K[G].tileData.src){K[G].completed=!0;break}else if(K[G].tileData.update&&K[G].tileData.update.isFulfilled()&&!K[G].tileData.renderedPixelBlock){K[G].completed=!0;break}else K[G].tileData.fetch&&(!0===K[G].tileData.fetch||K[G].tileData.fetch.isCanceled()||
K[G].tileData.fetch.isRejected())?(K[G].completed=!0,O++):this._isExtentOutSide(K[G].tileData.extent,this._map.extent)&&(K[G].completed=!0,O++);if(M){O++;var N=M.extent,V=this._map.extent,Y=this.getCurrentResolution(),ka=G=0;Math.abs(N.xmin-V.xmin)>Y.x&&(G=Math.round((N.xmin-V.xmin)/Y.x));Math.abs(V.ymax-N.ymax)>Y.y&&(ka=Math.round((V.ymax-N.ymax)/Y.y));M.renderedPixelBlock?(N=M.renderedPixelBlock,V=this._context.createImageData(N.width,N.height),V.data.set(M.renderedPixelBlock.getAsRGBA()),this._context.putImageData(V,
G,ka,0,0,N.width,N.height)):this.clear(G,ka,M.width,M.height)}O===K.length?(this._animation=null,this._fireUpdateEnd()):this._animation=requestAnimationFrame(d.hitch(this,this._drawAllFrames))}else this._resetDrawing(),this._animation=requestAnimationFrame(d.hitch(this,this._drawAllFrames))},_fetchTiles:function(K,O){if(!this.suspended&&this.loaded){this._cancelAnimation();var G=this.tileManager,M=!(G.xformSetting.requireProjection&&G.xformSetting.requirePE)||ba.load();h(M,d.hitch(this,function(){G.updateExtent(K,
this.getCurrentResolution());this._resetCss=!1;G.fetchTiles(O);O&&(this._hasTilingEffects||this.useWebGL?this.useWebGL&&0<G.tiles.length?(G.fillupTiles(),G._validateRawPixelBlocks(G.originalPixelData)?this._updateAllTilesOnce(G.originalPixelData):G.originalPixelData&&G.originalPixelData.src&&G.tiles.some(function(N){return N.updateCompleted})&&this._context.clear(this._context.COLOR_BUFFER_BIT),G.tiles.forEach(d.hitch(this,function(N){N.update&&!N.updateCompleted&&N.update.then(function(V){N.updateCompleted||
(N.updateCompleted=!0);(this._hasTilingEffects||this.useWebGL)&&this._drawOneFrame(V)}.bind(this))}))):this._hasTilingEffects&&h(G.fetchAllCompleted.isResolved()||G.fetchAllCompleted,d.hitch(this,function(){this._updateAllTilesOnce(G.originalPixelData)})):(this._frames=G.tiles.map(function(N){return{completed:!1,tileData:N}}),this._drawAllFrames()))}))}},_redrawTiles:function(){this._fetchTiles(this._map.extent,!0)},_panHandler:function(K,O){this._drawTile=!1;"css-transforms"===this._map.navigationMode?
this.roaming&&this.tileMode&&this.useWebGL?(this._delta=O,!this._roamingAnimation&&this.tileMode&&(this._roamingAnimation=requestAnimationFrame(this._animatePan2d))):(this._left=this._map.__visibleDelta.x+O.x,this._top=this._map.__visibleDelta.y+O.y,a.set(this._div,e._css.names.transform,e._css.translate(this._left,this._top))):a.set(this._div,{left:this._startRect.left+O.x+"px",top:this._startRect.top+O.y+"px"});this.tileMode&&this._fetchTiles(K)},_panEndHandler:function(K,O){O&&(this._startRect.left+=
O.x,this._startRect.top+=O.y);this.oldData=null;this._roamingAnimation&&(cancelAnimationFrame(this._roamingAnimation),this._oldDelta=this._roamingAnimation=null)},_onScaleHandler:function(K,O){var G={},M=e._css.names;a.set(this._canvas,M.transition,O?"none":M.transformName+" "+la+"ms ease");this._matrix=K;K=this._multiply?k.multiply(K,this._multiply):K;if(this._tdx||this._tdy)K=k.multiply(K,{xx:1,xy:0,yx:0,yy:1,dx:-this._tdx,dy:-this._tdy});G[M.transform]=e._css.matrix(K);a.set(this._canvas,G)},_onZoomHandler:function(K,
O,G){var M=this._startRect;K=M.width*O;O*=M.height;var N=M.left-(K-M.width)*(G.x-M.left)/M.width;G=M.top-(O-M.height)*(G.y-M.top)/M.height;a.set(this._canvas,{left:N+"px",top:G+"px",width:K+"px",height:O+"px"});this._endRect={left:N,top:G,width:K,height:O}},_onZoomEndHandler:function(){this._endRect&&(this._startRect=this._endRect)},_onResizeHandler:function(K,O,G){a.set(this._div,{width:O+"px",height:G+"px"});a.set(this._canvas,{width:O+"px",height:G+"px"});this._startRect.width=this._canvas.width=
O;this._startRect.height=this._canvas.height=G;this.useWebGL&&this._glSetting&&(this._glSetting.pingpong=null,this._glSetting.branches=null)},_extentChangeHandler:function(K,O,G,M){if(this.loaded&&!this.suspended&&(!O||0!==O.x||0!==O.y||G)){this._drawTile=!0;"css-transforms"===this._map.navigationMode&&(O&&(this._dragOrigin.x+=O.x,this._dragOrigin.y+=O.y),this._left=this._map.__visibleDelta.x,this._top=this._map.__visibleDelta.y,this.roaming&&this.tileMode&&this.useWebGL||G||a.set(this._div,e._css.names.transform,
e._css.translate(this._left,this._top)),G&&(a.set(this._canvas,e._css.names.transition,"none"),this._multiply=this._multiply?k.multiply(this._matrix,this._multiply):this._matrix,this._levelChange=!0));this._fireUpdateStart();var N=this._map;O=this.raster.rasterFunction?this.raster.getMemberRasters().map(function(Y){return Y._rasterId}):[this.raster._rasterId];var V={};this.tileMode?((this.roaming||this.useWebGL)&&this.tileMode||(O.forEach(function(Y,ka){V[Y]={extent:N.extent,pixelBlock:new U({width:N.width,
height:N.height,pixels:[],pixelType:"",mask:null,statistics:[]})}}),this.tileManager.originalPixelData={extent:N.extent,src:V}),this.projectedFullExtent?this._fetchTiles(K,!0):this._getProjectedFullExtent(N.spatialReference).then(d.hitch(this,function(){this._fetchTiles(K,!0)}))):this._requestData(N.extent,N.width,N.height)}},_visibilityChangeHandler:function(K){K?v.show(this._div):v.hide(this._div)},_opacityChangeHandler:function(K){a.set(this._div,"opacity",K)}});f("extend-esri")&&d.setObject("layers.RasterXLayer",
H,e);return H})},"esri/layers/rasterLib/raster/rasterFactory":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/_base/array dojo/_base/config dojo/sniff dojo/when ../../../kernel ../../../Evented ../../../request ../../../deferredUtils ../../../urlUtils ./ImageServiceRaster ./TileServiceRaster ./TileRaster ./FunctionRaster".split(" "),function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z){H={customDrivers:[],create:function(u){if(u){if(u.url){var E=e.urlToObject(u.url);var w=
E.path;var F=E.query}E=u.serviceInfo;var y=u.rasterFxArgs||{},D=new n,B=m.hitch(this,function(C){console.error(C);this._trycustomDrivers(m.mixin({url:w},u),0,D)});if(w)if(-1===w.toLowerCase().indexOf("imageserver")&&-1===w.toLowerCase().indexOf("mapserver")){var x=new v(m.mixin({},u,{url:w}));u.rasterFx&&(x=new z({rasterFx:u.rasterFx,rasterFxArgs:m.mixin({},y,{raster:x})}));var r=x}else{r=new n;E=E||this._getServiceInfo(w,F);var t=m.hitch(this,function(C){C.bandCount?x=C.capabilities&&-1<C.capabilities.toLowerCase().indexOf("tileonly")?
new p(m.mixin({},{serviceInfo:C},F,u,{url:w})):new l(m.mixin({},{serviceInfo:C},F,u,{url:w})):C.tileInfo&&(x=new p(m.mixin({},{serviceInfo:C},F,this._options,{url:w})));u.rasterFx&&(x=new z({rasterFx:u.rasterFx,rasterFxArgs:m.mixin({},y,{raster:x})}));r.resolve(x)});a(E,t,B)}else r=x=new z({rasterFx:u.rasterFx,rasterFxArgs:m.mixin({},y,{raster:x})});a(r,m.hitch(this,function(C){C?C.open().then(m.hitch(this,function(J){D.resolve(C)}),B):B(Error("There is no raster to open"))}),B);return D.promise}},
register:function(u){this.customDrivers=this.customDrivers||[];0<this.customDrivers.filter(function(E){return E.sourceType===u.prototype.sourceType}).length||this.customDrivers.push(u)},_trycustomDrivers:function(u,E,w){w=w||new n;var F=this.customDrivers[E];if(F){var y=new F(u);y.open().then(m.hitch(this,function(D){w.resolve(y)}),m.hitch(this,function(D){this._trycustomDrivers(u,E+1,w)}))}else w.reject("cannot load layer "+(u&&u.url||""));return w.promise},_getServiceInfo:function(u,E){E=E||{};
var w=E.bandIds;E=E.renderingRule;var F=new n(g._dfdCanceller),y={f:"json"};w&&(y.bandIds=w);E&&(y.renderingRule=E.toJson?JSON.stringify(E.toJson()):JSON.stringify(E));F._pendingDfd=h({url:u,content:y,handleAs:"json",callbackParamName:"callback"});F._pendingDfd.then(function(D){F.callback(D)},function(D){F.errback(D)});return F.promise}};c("extend-esri")&&m.setObject("layers.rasterLib.raster.rasterFactory",H,b);return H})},"esri/layers/rasterLib/raster/ImageServiceRaster":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/_base/array dojo/_base/config dojo/_base/json dojo/sniff dojo/DeferredList dojo/when ../../../kernel ../../../Evented ../../../request ../../../geometry/Extent ../../../geometry/Point ../../../SpatialReference ../../../WKIDUnitConversion ../../../deferredUtils ../../../urlUtils ../../MosaicRule ../../ImageServiceParameters ../../PixelBlock ./RasterInfo ./BasicRaster ../../rasterFormats/rasterCodec ../tile/RasterTileInfo".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F,y,D,B,x,r){H=d([B],{declaredClass:"esri.layers.rasterLib.raster.ImageServiceRaster",sourceType:"ImageService",constructor:function(t){t&&(this._imageServiceParams=t.imageServiceParameters,this._commonReqParams=t._commonReqParams,this._imageServiceParams||(this._imageServiceParams={interpolation:t.interpolation,pixelType:t.pixelType,format:t.format||"lerc",compressionQuality:t.compressionQuality,bandIds:t.bandIds,noDataInterpretation:t.noDataInterpretation,
adjustAspectRatio:t.adjustAspectRatio,mosaicRule:t.mosaicRule,renderingRule:t.interpolation}))},open:function(){var t=new n;if(this.serviceInfo&&this.rasterInfo)return this.loaded=!0,this._findCredential(),this.setFetchParameters(this._imageServiceParams),t.resolve(this),t.promise;var C=this.serviceInfo||this._generateServiceInfo(this._imageServiceParams&&this._imageServiceParams.renderingRule),J=m.hitch(this,function(P){this._fixServiceInfo(P);this.serviceInfo=P;this._findCredential();var U=this._parseRasterInfo(P),
aa={};P.defaultMosaicMethod?(aa.method=P.defaultMosaicMethod,aa.operation=P.mosaicOperator,aa.sortField=P.sortField,aa.sortValue=P.sortValue):aa.method=w.METHOD_NONE;this.serviceInfo.defaultMosaicRule=new w(aa);this.serviceInfo.defaultMosaicRule.ascending=!0;P=this._getColormap(this);aa=this._getHistograms(this);var ea=this._getRasterAttributeTable(this),ba=this._getKeyProperties(this),oa=this._getMultidimensionalInfo(),da=this._getSlices();(new b([P,aa,ea,ba,oa,da])).then(m.hitch(this,function(fa){fa[0][0]&&
(U.colormap=fa[0][1]);fa[1][0]&&(U.histograms=fa[1][1]);fa[2][0]&&(U.vat=fa[2][1]);fa[3][0]&&(U.keyProperties=fa[3][1]);fa[4][0]&&(U.multidimensionalInfo=fa[4][1]);this._slices=fa[5][0]?fa[5][1]:null;U.keyProperties&&U.keyProperties.DataType&&(this.dataType=U.keyProperties.DataType);this.loaded=!0;this.rasterInfo=U;this.setFetchParameters(this._imageServiceParams);t.resolve(this)}))}),L=m.hitch(this,function(P){this.loaded=!0;t.reject(P)});k(C,J,L);return t.promise},setFetchParameters:function(t,
C){if(C)this.imageServiceParams=t;else{var J=this.imageServiceParams;J&&t?Object.keys(t).forEach(function(L){J[L]=t[L]}):this.imageServiceParams=t}this._constructGetImageParams();this._getRasterIdentifier(!0)},read:function(t){if(t.pixelBlock||t.texture){var C=new n;C.resolve(t);return C.promise}if(!1===t.virtual&&this.tileInfo&&!this.tileInfo.virtual)return this.readTile(t);if(this._slices){var J=this._getSliceId();if(null==J)return C=new n,C.resolve(t),C.promise}var L=t.extent,P=L.spatialReference.wkid||
c.toJson(L.spatialReference.toJson(!1)),U=t.timeExtent?t.timeExtent.toJson().join(","):null;C=this.url+"/exportImage";var aa={};this._slices&&(aa.sliceid=J);this.disableClientCaching&&(aa._ts=(new Date).getTime());J=m.mixin({},this._commonReqParams,{bbox:L.xmin+","+L.ymin+","+L.xmax+","+L.ymax,imageSR:P,bboxSR:P,size:t.width+","+t.height,time:U},aa);return this._requestPixels({url:C,payload:J,decodeParams:{width:t.width,height:t.height,planes:null,pixelType:null,format:null,decodeFunc:null,isPoint:!1},
tileOptions:t})},readTile:function(t){var C=this.tileBoundary&&this.tileBoundary[t.level];if(C&&(C.minRow>t.row||C.maxRow<t.row||C.minCol>t.col||C.maxCol<t.col)){var J=new n;J.resolve(t);return J.promise}if(this._slices&&(J=this._getSliceId(),null==J))return J=new n,J.resolve(t),J.promise;C=this.url+"/tile/"+t.level+"/"+t.row+"/"+t.col;var L={width:this.tileInfo.cols,height:this.tileInfo.rows,planes:null,pixelType:null,format:null,decodeFunc:null,isPoint:"elevation"===t.tileType.toLowerCase()?!0:
!1};J=this._slices?"sliceid\x3d"+J+"\x26":"";J=this.disableClientCaching?"_ts\x3d "+(new Date).getTime():J.replace(/&$/,"");return this._requestPixels({url:C+(0<J.length?"?"+J:""),payload:{},decodeParams:L,tileOptions:t})},toJson:function(){return{url:this.url,tileInfo:this.tileInfo,rasterInfo:this.rasterInfo,serviceInfo:this.serviceInfo,sourceType:this.sourceType,_commonReqParams:this._commonReqParams,_rasterId:this._rasterId}},_getSliceId:function(){var t=m.clone(this._imageServiceParams.multidimensionalDefinition),
C=m.clone(this._imageServiceParams.time);if(null==this._slices||null==C&&(null==t||0===t.length))return 0;var J=t||this.defaultMultidimensionalDefinition,L=J[0].variableName;J=this._getAllDimensionDefinition(J,L).definition;t=null;if(null==J||0===J.length)return null;if(C&&this.serviceInfo.timeInfo){if(null==C[1]||C[1]===C[0])var P=C[0];else{var U=this.serviceInfo.timeInfo.startTimeField;P=this.rasterInfo.multidimensionalInfo.variables.find(function(ba){return ba.name===L}).dimensions.find(function(ba){return ba.name===
U}).values.filter(function(ba){return Array.isArray(ba)?Math.max(ba[0],C[0])<Math.min(ba[1],C[1]):ba>=C[0]&&ba<=C[1]}).sort(function(ba,oa){ba=Array.isArray(ba)?ba[1]:ba;oa=Array.isArray(oa)?ba[1]:oa;return Math.abs(C[1]-ba)-Math.abs(C[1]-oa)})[0]||[C[1]]}J.some(function(ba){if(ba.dimensionName===U)return ba.values[0]=P,!0;if(!ba.dimensionName)return ba.dimensionName=U,ba.isSlice=!0,ba.values=[P],!0})||J.push({variableName:L,dimensionName:U,isSlice:!0,values:[P]})}for(var aa=0;aa<this._slices.length;aa++){var ea=
this._slices[aa].multidimensionalDefinition;if(ea.length===J.length&&!ea.some(function(ba){var oa=J.filter(function(fa){return ba.variableName===fa.variableName&&fa.dimensionName===ba.dimensionName})[0];if(!oa)return!0;var da=Array.isArray(ba.values[0])?ba.values[0][0]:ba.values[0];oa=Array.isArray(oa.values[0])?oa.values[0][0]:oa.values[0];return da!==oa})){t=aa;break}}return t},_getAllDimensionDefinition:function(t,C){var J=t.map(function(P){return P.dimensionName}),L=!1;this.rasterInfo.multidimensionalInfo.variables.forEach(function(P){P.name!==
C||P.dimensions.length===t.length&&J[0]||(P.dimensions.forEach(function(U){0>J.indexOf(U.name)&&(J[0]?t.push({variableName:C,dimensionName:U.name,values:[U.values[0]]}):(t[0].dimensionName=U.name,t[0].values=[U.values[0]],U[0]=U.name))}),L=!0)},this);return{defChanged:L,definition:t}},_generateServiceInfo:function(t){var C=this.url,J=new n(u._dfdCanceller);J._pendingDfd=e({url:C,content:{f:"json",renderingRule:t?c.toJson(t.toJson()):null},handleAs:"json",callbackParamName:"callback"});J._pendingDfd.then(function(L){J.callback(L)},
function(L){J.errback(L)});return J},_fixServiceInfo:function(t){var C=t.spatialReference.wkid;t.tileInfo&&0===t.extent.xmin&&360===t.extent.xmax&&C&&null==z[C]&&(t.tileInfo.applyGCS360Transform=!0)},_parseRasterInfo:function(t){var C=new D;C.bandCount=t.bandCount;C.extent=new l(t.fullExtent);C.spatialReference=t.spatialReference;C.pixelType=t.pixelType;C.width=Math.floor((t.fullExtent.xmax-t.fullExtent.xmin)/t.pixelSizeX+.5);C.height=Math.floor((t.fullExtent.ymax-t.fullExtent.ymin)/t.pixelSizeY+
.5);C.cellSize=new p({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:t.spatialReference});var J;if(t.minValues&&0<t.minValues.length&&t.maxValues&&t.stdvValues&&t.meanValues){var L=[];for(J=0;J<t.minValues.length;J++)L.push({min:t.minValues[J],max:t.maxValues[J],mean:t.meanValues[J],stddev:t.stdvValues[J]});t.bandCount!==L.length&&(L=null)}this.dataType=t.serviceDataType?t.serviceDataType.replace("esriImageServiceDataType",""):"Generic";C.statistics=L;t.objectIdField&&t.fields&&(C.catalogInfo={objectIdField:t.objectIdField,
fields:t.fields});C.timeInfo=t.timeInfo;if(t.tileInfo){this.tileInfo=new r(t.tileInfo);this.tileInfo.tileType=t.cacheType||"Map";C.tileInfo=this.tileInfo;var P=C.extent,U=this.tileInfo.origin,aa=this.tileInfo.cols,ea=this.tileInfo.rows;this.tileBoundary=this.tileInfo.lods.map(function(ba){return{minCol:Math.floor((P.xmin-U.x+.1*ba.resolution)/aa/ba.resolution),maxCol:Math.floor((P.xmax-U.x-.1*ba.resolution)/aa/ba.resolution),minRow:Math.floor((U.y-P.ymax+.1*ba.resolution)/ea/ba.resolution),maxRow:Math.floor((U.y-
P.ymin-.1*ba.resolution)/ea/ba.resolution)}})}return C},_getColormap:function(t){t=this.url+"/colormap";var C=new n(u._dfdCanceller),J={f:"json"},L=this.serviceInfo.hasColormap||this.rasterInfo&&this.rasterInfo.hasColormap;10<this.serviceInfo.currentVersion&&L?(C._pendingDfd=e({url:t,content:J,handleAs:"json",callbackParamName:"callback"}),C._pendingDfd.then(function(P){C.callback(P.colormap)},function(P){C.errback(P)})):C.callback(null);return C},_getHistograms:function(t){var C=this.url+"/histograms",
J=new n(u._dfdCanceller),L={f:"json"},P=this.serviceInfo.hasHistograms||this.rasterInfo&&this.rasterInfo.hasHistograms;t&&t.renderingRule&&(L.renderingRule=c.toJson(t.renderingRule.toJson()),P=!0);10<this.serviceInfo.currentVersion&&P?(J._pendingDfd=e({url:C,content:L,handleAs:"json",callbackParamName:"callback"}),J._pendingDfd.then(function(U){J.callback(U.histograms)},function(U){J.errback(U)})):J.callback(null);return J},_getRasterAttributeTable:function(t){var C=this.url+"/rasterAttributeTable",
J=new n(u._dfdCanceller),L={f:"json"},P=this.serviceInfo.hasRasterAttributeTable;t&&t.renderingRule&&(L.renderingRule=c.toJson(t.renderingRule.toJson()),P=!0);10<this.serviceInfo.currentVersion&&P?(J._pendingDfd=e({url:C,content:L,handleAs:"json",callbackParamName:"callback"}),J._pendingDfd.then(function(U){J.callback(U)},function(U){J.errback(U)})):J.callback(null);return J},_getKeyProperties:function(t){var C=this.url+"/keyProperties",J=new n(u._dfdCanceller),L={f:"json"};t&&t.renderingRule&&(L.renderingRule=
c.toJson(t.renderingRule.toJson()));10<this.serviceInfo.currentVersion?(J._pendingDfd=e({url:C,content:L,handleAs:"json",callbackParamName:"callback"}),J._pendingDfd.then(function(P){J.callback(P)},function(P){J.errback(P)})):J.callback(null);return J},_getMultidimensionalInfo:function(){var t=this.url+"/multidimensionalInfo",C=new n(u._dfdCanceller);10.3<=this.serviceInfo.currentVersion&&this.serviceInfo.hasMultidimensions?(C._pendingDfd=e({url:t,content:{f:"json"},handleAs:"json",callbackParamName:"callback"}),
C._pendingDfd.then(m.hitch(this,function(J){C.callback(J.multidimensionalInfo)}),function(J){C.errback(J)})):C.callback(null);return C},_getSlices:function(){var t=this.url+"/slices",C=new n(u._dfdCanceller);this.serviceInfo.hasMultidimensions?(C._pendingDfd=e({url:t,content:{f:"json"},handleAs:"json",callbackParamName:"callback"}),C._pendingDfd.then(m.hitch(this,function(J){C.callback(J.slices)}),function(J){C.errback(J)})):C.callback(null);return C},_initializationFailed:function(){},_constructGetImageParams:function(){var t=
this.imageServiceParams||{},C=m.mixin({},this._query,{f:"image",interpolation:t.interpolation,pixelType:t.pixelType,format:t.format||"lerc",compressionQuality:t.compressionQuality,bandIds:t.bandIds?t.bandIds.join(","):null,noData:null!=t.noData?t.noData.join(","):null,noDataInterpretation:t.noDataInterpretation,adjustAspectRatio:null==t.adjustAspectRatio?null:t.adjustAspectRatio,mosaicRule:t.mosaicRule?c.toJson(t.mosaicRule.toJson()):null,renderingRule:t.renderingRule?c.toJson(t.renderingRule.toJson()):
null,token:this.credential&&this.credential.token||null});"lerc"===C.format.toLowerCase()?(C.compressionTolerance=t.compressionTolerance,10.5<=this.serviceInfo.currentVersion&&(C.lercVersion=t.lercVersion||2)):"tiff"===C.format.toLowerCase()?C.compression=t.compression:-1<["jpg","jpeg","jpg","jpgpng"].indexOf(C.format.toLowerCase())&&(C.compression=t.compression);this._commonReqParams=C},_getRasterIdentifier:function(t){if(this._rasterId)return this._rasterId;t=this.url.replace("http:","").replace("https:",
"");var C=[],J=this.imageServiceParams||{};C.push(t);C.push(J.interpolation);C.push(J.pixelType);C.push(J.compressionQuality);C.push(J.bandIds?J.bandIds.join(","):"");C.push(J.mosaicRule?c.toJson(J.mosaicRule.toJson()):"");C.push(J.renderingRule?c.toJson(J.renderingRule.toJson()):"");t=C.join("|");return this._rasterId=this._computeSignature(t)},_wrapExtent:function(t){var C=t.spatialReference._getInfo();if(C){var J=C.valid[0];C=C.valid[1];if(t.xmin<J-this.resolution.x||t.xmax>C+this.resolution.y){var L=
new l((t.xmin-J)%(C-J),t.ymin,(t.xmax-C)%(C-J),t.ymax,t.spatialReference);L.xmax<L.xmin&&(L=null)}}return L||t}});a("extend-esri")&&m.setObject("layers.rasterLib.raster.ImageServiceRaster",H,h);return H})},"esri/layers/ImageServiceParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has ../kernel ../lang".split(" "),function(H,d,m,n,q,f){H=H(null,{declaredClass:"esri.layers.ImageServiceParameters",extent:null,width:null,height:null,imageSpatialReference:null,format:null,
interpolation:null,compressionQuality:null,bandIds:null,timeExtent:null,mosaicRule:null,renderingRule:null,renderer:null,noData:null,compressionTolerance:null,adjustAspectRatio:null,lercVersion:null,toJson:function(c){var a=this.bbox||this.extent;c=(a=a&&c&&a._normalize(!0))?a.spatialReference.wkid||m.toJson(a.spatialReference.toJson()):null;var b=this.imageSpatialReference;a={bbox:a?a.xmin+","+a.ymin+","+a.xmax+","+a.ymax:null,bboxSR:c,size:null!==this.width&&null!==this.height?this.width+","+this.height:
null,imageSR:b?b.wkid||m.toJson(b.toJson()):c,format:this.format,interpolation:this.interpolation,compressionQuality:this.compressionQuality,bandIds:this.bandIds?this.bandIds.join(","):null,mosaicRule:this.mosaicRule?m.toJson(this.mosaicRule.toJson()):null,renderingRule:this.renderingRule?m.toJson(this.renderingRule.toJson()):null,renderer:this.renderer?m.toJson(this.renderer.toJson()):null,noData:this.noData,noDataInterpretation:this.noDataInterpretation,compressionTolerance:this.compressionTolerance,
adjustAspectRatio:this.adjustAspectRatio,lercVersion:this.lercVersion};c=this.timeExtent;a.time=c?c.toJson().join(","):null;return f.filter(a,function(k){if(null!==k&&void 0!==k)return!0})}});d.mixin(H,{INTERPOLATION_BILINEAR:"RSP_BilinearInterpolation",INTERPOLATION_CUBICCONVOLUTION:"RSP_CubicConvolution",INTERPOLATION_MAJORITY:"RSP_Majority",INTERPOLATION_NEARESTNEIGHBOR:"RSP_NearestNeighbor",NODATA_MATCH_ALL:"esriNoDataMatchAll",NODATA_MATCH_ANY:"esriNoDataMatchAny"});n("extend-esri")&&d.setObject("layers.ImageServiceParameters",
H,q);return H})},"esri/layers/rasterLib/raster/RasterInfo":function(){define(["dojo/_base/declare","dojo/_base/lang","../../../geometry/Extent","../../../SpatialReference","../tile/RasterTileInfo"],function(H,d,m,n,q){return H(null,{declaredClass:"esri.layers.rasterLib.raster.RasterInfo",bandCount:null,pixelType:null,extent:null,spatialReference:null,width:null,height:null,colormap:null,attributeTable:null,multiDimensionalInfo:null,statistics:null,histograms:null,catalogInfo:null,keyProperties:null,
cellSize:null,format:null,compression:null,compressionQuality:null,packetSize:null,geodataXform:null,constructor:function(f){d.mixin(this,f);this.extent=this.extent?this.extent.toJson?this.extent:new m(this.extent):null;this.spatialReference=this.spatialReference?this.spatialReference.toJson?this.spatialReference:new n(this.spatialReference):null;this.tileInfo=this.tileInfo?this.tileInfo.toJson?this.tileInfo:new q(this.tileInfo):null},toJson:function(){return{bandCount:this.bandCount,pixelType:this.pixelType,
extent:this.extent&&this.extent.toJson?this.extent.toJson():this.extent,spatialReference:this.spatialReference&&this.spatialReference.toJson?this.spatialReference.toJson():this.spatialReference,width:this.width,height:this.height,colormap:this.colormap?d.clone(this.colormap):null,attributeTable:this.attributeTable?d.clone(this.attributeTable):null,multiDimensionalInfo:this.multiDimensionalInfo?d.clone(this.multiDimensionalInfo):null,statistics:this.statistics?d.clone(this.statistics):null,histograms:this.histograms?
d.clone(this.histograms):null,catalogInfo:this.catalogInfo?d.clone(this.catalogInfo):null,keyProperties:this.keyProperties?d.clone(this.keyProperties):null,cellSize:this.cellSize&&this.cellSize.toJson?this.cellSize.toJson():this.cellSize,tileInfo:this.tileInfo&&this.tileInfo.toJson?this.tileInfo.toJson():this.tileInfo,format:this.format,compression:this.compression,compressionQuality:this.compressionQuality,packetSize:this.packetSize,geodataXform:this.geodataXform?d.clone(this.geodataXform):null}},
clone:function(){return new this.constructor(this.toJson())}})})},"esri/layers/rasterLib/tile/RasterTileInfo":function(){define("dojo/_base/declare dojo/_base/lang ../../../geometry/Extent ../../../SpatialReference ../../../geometry/Point ../../../lang ../../TileInfo".split(" "),function(H,d,m,n,q,f,c){return H([c],{declaredClass:"esri.layers.rasterLib.tile.RasterTileInfo",rows:512,cols:512,compressionQuality:95,lercError:.01,spatialReference:null,origin:null,virtual:!0,tileType:"Raster",constructor:function(a,
b){if(a||b){var k=b&&b.refTileInfo;a?this.virtual=!1:(this.virtual=!0,d.mixin(this,{rows:b.rows||this.rows,cols:b.cols||this.cols,compressionQuality:b.compressionQuality||95,lercError:b.compressionTolerance||.01,spatialReference:b.spatialReference,origin:b.origin}),this.width=this.cols,this.height=this.rows,this.origin||(k?this.origin=k.origin:b.spatialReference.isWebMercator()||b.extent&&360<=Math.max(Math.abs(b.extent.xmin),Math.abs(b.extent.xmax))?this.origin={x:-2.0037508342787E7,y:2.0037508342787E7}:
-1<[4326,4269].indexOf(b.spatialReference.wkid)||360>Math.max(Math.abs(b.extent.xmin),Math.abs(b.extent.xmax))?this.origin={x:-180,y:90}:this.origin={x:b.extent.xmin,y:b.extent.ymax}))}},toJson:function(){var a=c.prototype.toJson.apply(this);a.tileType=this.tileType;a.virtual=this.virtual;a.lercError=this.lercError;return a},clone:function(){return new this.prototype(this.toJson())}})})},"esri/layers/rasterLib/raster/BasicRaster":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/_base/array dojo/_base/config dojo/_base/json dojo/sniff dojo/DeferredList dojo/when ../../../kernel ../../../Evented ../../../request ../../../geometry/Extent ../../../geometry/Point ../../../SpatialReference ../../../deferredUtils ../../../urlUtils ../../MosaicRule ../../ImageServiceParameters ../../PixelBlock ../../rasterFormats/rasterCodec ../tile/RasterHandler ./rasterProjectionHelper ./RasterInfo".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F,y,D,B,x){return d([g],{url:null,dataType:null,rasterInfo:null,tileInfo:null,serviceInfo:null,loaded:null,constructor:function(r){if(r){var t=r.url;t&&(t=u.urlToObject(t),this.url=t.path,this._query=t.query);this.dataType=r.dataType;this.serviceInfo=r.serviceInfo;this.rasterInfo=r.rasterInfo;this.tileInfo=r.tileInfo;this.serviceInfo=r.serviceInfo}},open:function(){},read:function(r){},identify:function(r){var t=new n,C=this.rasterInfo.extent;if(B.requirePE(C.spatialReference,
r.spatialReference))B.load().then(m.hitch(this,function(){J=B.project(r,C.spatialReference);t.resolve(J)}),function(){t.reject(Error("cannot project into this spatial reference"))});else{var J=B.project(r,C.spatialReference);t.resolve(J)}return t.then(m.hitch(this,function(L){var P=this.tileInfo,U=P.origin,aa=P.lods[P.lods.length-1],ea=(L.x-U.x)/P.cols/aa.resolution;L=(U.y-L.y)/P.rows/aa.resolution;var ba=Math.round((L-Math.floor(L))*P.rows)*P.cols+Math.round((ea-Math.floor(ea))*P.cols);U=new l(U.x+
aa.resolution*P.cols*ea,U.y-aa.resolution*P.rows*(L+1),U.x+aa.resolution*P.cols*(ea+1),U.y-aa.resolution*P.rows*L,C.spatialReference);var oa=this.getMemberRasters?this.getMemberRasters()[0]:this;return oa.read({level:aa.level,row:Math.floor(L),col:Math.floor(ea),extent:U,width:P.cols,height:P.rows,virtual:oa.tileInfo.virtual,tileType:oa.tileInfo.tileType}).then(function(da){return(da=da&&da.pixelBlock)&&da.pixels&&0<da.pixels.length&&(!da.mask||da.mask[ba])?{pixelValue:da.pixels.map(function(fa){return fa[ba]})}:
{pixelValue:null}})}))},getProjectedFullExtent:function(r,t){var C=new n;if(this.projectedFullExtent&&!t)return C.resolve(this.projectedFullExtent),C.promise;var J=this.rasterInfo.extent;if(B.requirePE(this.rasterInfo.extent.spatialReference,r))B.load().then(m.hitch(this,function(){L=B.project(J,r);this.projectedFullExtent=L=new l(L.toJson());C.resolve(L)}),function(){C.reject(Error("cannot project into this spatial reference"))});else{var L=B.project(J,r);this.projectedFullExtent=L=new l(L.toJson());
C.resolve(L)}return C.promise},setFetchParameters:function(r,t){},_setRasterHandler:function(r){this._rasterHandler=r;this.getMemberRasters&&this.getMemberRasters().forEach(m.hitch(this,function(t){t._rasterHandler=r}))},_findCredential:function(){this.url&&((this._credential=h.id&&h.id.findCredential(this.url))&&this._credential.ssl||this.serviceInfo&&this.serviceInfo._ssl)&&(this.url=this.url.replace(/^http:/i,"https:"))},_initWorker:function(){this._rasterHandler=new D;this._rasterHandler.start().then(function(){this._rasterHandlerInitialized=
!0}.bind(this))},_requestPixels:function(r){var t=r.url,C=r.payload,J=r.decodeParams,L=r.tileOptions,P=new n(z._dfdCanceller);this._rasterHandler||this._initWorker();var U=this._rasterHandler,aa={};t={url:t,handleAs:"arraybuffer",content:C};r.headers&&(t.headers=r.headers);P._pendingDfd=e(t).then(m.hitch(this,function(ea){(U&&this._rasterHandlerInitialized?U.decode({encodedData:ea,decodeParams:J}):y.decode(ea,J)).then(function(ba){aa.pixelBlock=new F(ba);aa.extent=L.extent;aa.level=L.level;aa.row=
L.row;aa.col=L.col;aa.width=L.width;aa.height=L.height;z._resDfd(P,[aa])},function(ba){z._resDfd(P,[ba],!0)})}),function(ea){z._resDfd(P,[ea],!0)});return P},_computeSignature:function(r){if("string"===typeof r){for(var t=new Uint8Array(r.length),C=0;C<r.length;C++)t[C]=r.charCodeAt(C);r=t}C=t=65535;for(var J=r.length,L=Math.floor(J/2),P=0;L;){var U=359<=L?359:L;L-=U;do t+=r[P++]<<8,C+=t+=r[P++];while(--U);t=(t&65535)+(t>>>16);C=(C&65535)+(C>>>16)}J&1&&(C+=t+=r[P]<<8);return((C&65535)+(C>>>16)<<16|
(t&65535)+(t>>>16))>>>0}})})},"esri/layers/rasterFormats/rasterCodec":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/Deferred ../PixelBlock ./LercCodec ./Lerc2Codec ./JpgPlus ./Png ./Raw ./TiffDecoder".split(" "),function(H,d,m,n,q,f,c,a,b,k,h){return{validPixelTypes:"U1 U2 U4 U8 U16 U32 S8 S16 S32 F32".split(" "),supportedFormats:"lerc jpeg jpg jpgpng png png8 png24 png32 bip bsq tiff".split(" "),_isPlatformLittleEndian:function(){var g=new ArrayBuffer(4),e=new Uint8Array(g);
(new Uint32Array(g))[0]=1;return 1===e[0]}(),decode:function(g,e){if(void 0===e||null===e)throw"missing decode options";var l;e.format&&(l=e.format.toUpperCase());"BSQ"!==l&&"BIP"!==l&&(l=this._getFormat(g));var p=e.decodeFunc;if(void 0===p||null===p)p=this._getFormatDecoderDfd(l);return p(g,e)},_getFormatDecoderDfd:function(g){var e=null;switch(g){case "LERC":e=this._decodeLerc;break;case "LERC2":e=this._decodeLerc2;break;case "JPEG":e=this._decodeJpeg;break;case "PNG":e=this._decodePng;break;case "BSQ":e=
this._decodeBsq;break;case "BIP":e=this._decodeBip;break;case "TIFF":e=this._decodeTiff;break;default:e=function(l,p){throw"The raster format is not supported";}}e=m.hitch(this,e);return function(l,p){var v=new n;p.isPoint&&p.width&&(p.width++,p.height++);l=e(l,p);p.isPoint&&p.width&&(this._interpolatePointGrid(l),p.width--,p.height--);v.resolve(l);return v}.bind(this)},_getFormat:function(g){g=new Uint8Array(g,0,10);var e="";if(255===g[0]&&216===g[1])e="JPEG";else if(137===g[0]&&80===g[1]&&78===
g[2]&&71===g[3])e="PNG";else if(67===g[0]&&110===g[1]&&116===g[2]&&90===g[3]&&73===g[4]&&109===g[5]&&97===g[6]&&103===g[7]&&101===g[8]&&32===g[9])e="LERC";else if(76===g[0]&&101===g[1]&&114===g[2]&&99===g[3]&&50===g[4]&&32===g[5])e="LERC2";else if(-1<String.fromCharCode.apply(null,g).toLowerCase().indexOf("error"))e="ERROR";else if(73===g[0]&&73===g[1]&&42===g[2]&&0===g[3]||77===g[0]&&77===g[1]&&0===g[2]&&42===g[3])e="TIFF";return e},_validateDecodeParams:function(g){if(!g.height||Math.floor(g.height)!==
g.height)throw"Height not provided.";if(!g.width||Math.floor(g.width)!==g.width)throw"Width not provided.";},_decodeJpeg:function(g,e){if(!a)throw"The jpeg decoder module is not loaded.";this._validateDecodeParams(e);g=(new a).decode(g);if(!this._verifyResult(g,e))throw"The decoded image dimensions are incorrect.";e=new q({width:g.width,height:g.height,pixels:g.pixels,pixelType:"U8",mask:g.mask,statistics:null});e.calculateStatistics();return e},_decodePng:function(g,e){if(!b)throw"The png decoder module is not loaded.";
this._validateDecodeParams(e);g=new Uint8Array(g);var l=new b(g);g=new Uint8Array(e.width*e.height*4);l.copyToImageData(g,l.decodePixels());var p=l=0;p=new Uint8Array(e.width*e.height);for(l=0;l<e.width*e.height;l++)p[l]=g[4*l+3];var v=new q({width:e.width,height:e.height,pixels:[],pixelType:"U8",mask:p,statistics:[]});for(l=0;3>l;l++){var z=new Uint8Array(e.width*e.height);for(p=0;p<e.width*e.height;p++)z[p]=g[4*p+l];v.addData({pixels:z})}v.calculateStatistics();return v},_decodeBsq:function(g,e){if(!k)throw"The bsq decoder module is not loaded.";
this._validateDecodeParams(e);var l=e.noDataValue;e.pixelType=this._getpixelTypeAndNoData(e.pixelType);g=k.decodeBSQ(g,{bandCount:e.planes,width:e.width,height:e.height,pixelType:e.pixelType,noDataValue:l});e=new q({width:e.width,height:e.height,pixels:g.pixels,pixelType:e.pixelType,mask:g.maskData,statistics:null});e.calculateStatistics();return e},_decodeBip:function(g,e){this._validateDecodeParams(e);var l=e.noDataValue;e.pixelType=this._getpixelTypeAndNoData(e.pixelType);g=k.decodeBIP(g,{bandCount:e.planes,
width:e.width,height:e.height,pixelType:e.pixelType,noDataValue:l});e=new q({width:e.width,height:e.height,pixels:g.pixels,pixelType:e.pixelType,mask:g.maskData,statistics:null});e.calculateStatistics();return e},_decodeTiff:function(g,e){this._validateDecodeParams(e);e.pixelType=this._getpixelTypeAndNoData(e.pixelType);g=h.decode(g);g=new q({width:g.width,height:g.height,pixels:g.pixels,pixelType:g.pixelType,mask:g.maskData,statistics:null});g.calculateStatistics();return g},_decodeLerc:function(g,
e){if(!this._isPlatformLittleEndian)throw"lerc decoder is not supported on big endian platform";this._validateDecodeParams(e);var l=e.noDataValue;e.pixelType=this._getpixelTypeAndNoData(e.pixelType);for(var p=0,v,z=0,u,E=g.byteLength-10;z<E;){var w=f.decode(g,{inputOffset:z,encodedMaskData:v,returnMask:0===p?!0:!1,returnEncodedMask:0===p?!0:!1,returnFileInfo:!0,pixelType:e.pixelType,noDataValue:l});z=w.fileInfo.eofOffset;0===p&&(v=w.encodedMaskData,u=new q({width:e.width,height:e.height,pixels:[],
pixelType:e.pixelType,mask:w.maskData,statistics:[]}));p++;if(!this._verifyResult(w,e))throw"The decoded image dimensions are incorrect";u.addData({pixels:w.pixelData,statistics:{minValue:w.minValue,maxValue:w.maxValue,noDataValue:w.noDataValue}})}return u},_decodeLerc2:function(g,e){if(!this._isPlatformLittleEndian)throw"lerc2 decoder is not supported on big endian platform";this._validateDecodeParams(e);e.pixelType=this._getpixelTypeAndNoData(e.pixelType);for(var l=0,p,v,z,u=0,E,w=g.byteLength-
10,F=[],y,D=0;u<w;){v=c.decode(g,{inputOffset:u,maskData:p,returnFileInfo:!0});u=v.fileInfo.eofOffset;p=v.maskData;0===l&&(z=v.fileInfo.numValidPixel,E=new q({width:e.width,height:e.height,pixels:[],dimCount:v.dimCount||1,pixelType:v.fileInfo.pixelType,mask:p,statistics:[]}));v.fileInfo.mask&&0<v.fileInfo.mask.numBytes&&D++;p&&F.push(p);l++;if(!this._verifyResult(v,e))throw"The decoded image dimensions are incorrect";E.addData({pixels:v.pixelData,statistics:{minValue:v.minValue,maxValue:v.maxValue,
noDataValue:v.noDataValue,dimStats:v.dimStats}})}if(1<D){e=E.width*E.height;E.bandMasks=F;p=new Uint8Array(e);p.set(F[0]);for(z=1;z<F.length;z++)for(y=F[z],g=0;g<e;g++)p[g]&=y[g];for(g=z=0;g<e;g++)z+=y[g];E.mask=p}E.validPixelCount=z;return E},_interpolatePointGrid:function(g,e){var l=g.pixels;if(l&&0!==l.length){var p=l.length,v=g.width,z=g.mask,u=v-1,E=g.height-1,w=[],F,y;if(0===(null==e?1:e)){for(e=0;e<p;e++){var D=l[e];var B=new D.constructor(u*E);for(F=0;F<E;F++){var x=F*v;for(y=0;y<u;y++)B[F*
u+y]=D[x+y]}w.push(B)}if(z){var r=new Uint8Array(u*E);for(F=0;F<E;F++)for(x=F*v,y=0;y<u;y++)r[F*u+y]=z[x+y]}}else{for(e=0;e<p;e++){D=l[e];B=new D.constructor(u*E);for(F=0;F<E;F++)for(x=F*v,y=0;y<u;y++)B[F*u+y]=(D[x+y]+D[x+y+1]+D[x+v+y]+D[x+v+y+1])/4;w.push(B)}if(z)for(r=new Uint8Array(u*E),F=0;F<E;F++)for(x=F*v,y=0;y<u;y++)r[F*u+y]=Math.min.apply(null,[z[x+y],z[x+y+1],z[x+v+y],z[x+v+y+1]])}g.width=u;g.height=E;g.mask=r;g.pixels=w;return g}},_getpixelTypeAndNoData:function(g){return"U1"===g||"U2"===
g||"U4"===g||"U8"===g?"U8":g},_verifyResult:function(g,e){return g.height!==e.height||g.width!==e.width?!1:!0}}})},"esri/layers/rasterFormats/JpgPlus":function(){define(["dojo/_base/declare","./Zlib","./Jpg"],function(H,d,m){return H(null,{constructor:function(){},decode:function(n){var q=new Uint8Array(n);n=new m;n.parse(q);var f=n.numComponents,c=n.getData(n.width,n.height,!0),a=n.width*n.height,b=n.eof,k=0,h=0,g=0;if(b<q.length-1){h=(new d(q.subarray(b))).getBytes();var e=new Uint8Array(a);for(k=
q=0;k<h.length;k++)for(g=7;0<=g;g--)e[q++]=h[k]>>g&1}q=[];if(1===f)q=[c,c,c];else{for(k=0;3>k;k++)f=new Uint8Array(a),q.push(f);for(h=g=0;h<a;h++)for(k=0;3>k;k++)q[k][h]=c[g++]}return{width:n.width,height:n.height,pixels:q,mask:e}}})})},"esri/layers/rasterFormats/Zlib":function(){define([],function(){var H=function(){function d(){this.bufferLength=this.pos=0;this.eof=!1;this.buffer=null}d.prototype={ensureBuffer:function(m){var n=this.buffer,q=n?n.byteLength:0;if(m<q)return n;for(var f=512;f<m;)f<<=
1;m=new Uint8Array(f);for(f=0;f<q;++f)m[f]=n[f];return this.buffer=m},getByte:function(){for(var m=this.pos;this.bufferLength<=m;){if(this.eof)return null;this.readBlock()}return this.buffer[this.pos++]},getBytes:function(m){var n=this.pos;if(m){this.ensureBuffer(n+m);for(m=n+m;!this.eof&&this.bufferLength<m;)this.readBlock();var q=this.bufferLength;m>q&&(m=q)}else{for(;!this.eof;)this.readBlock();m=this.bufferLength}this.pos=m;return this.buffer.subarray(n,m)},lookChar:function(){for(var m=this.pos;this.bufferLength<=
m;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var m=this.pos;this.bufferLength<=m;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(m,n,q){for(var f=m+n;this.bufferLength<=f&&!this.eof;)this.readBlock();return new Stream(this.buffer,m,n,q)},skip:function(m){m||(m=1);this.pos+=m},reset:function(){this.pos=0}};return d}();return function(){function d(b){throw Error(b);
}function m(b){var k=0,h=b[k++],g=b[k++];-1!=h&&-1!=g||d("Invalid header in flate stream");8!=(h&15)&&d("Unknown compression method in flate stream");0!=((h<<8)+g)%31&&d("Bad FCHECK in flate stream");g&32&&d("FDICT bit set in flate stream");this.bytes=b;this.bytesPos=k;this.codeBuf=this.codeSize=0;H.call(this)}if(!self||!self.Uint32Array)return null;var n=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),q=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,
131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),f=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),c=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,
459020,524392,524328,59E4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,
459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,
459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,
459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,
459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,
459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,
459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],a=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,
327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];m.prototype=Object.create(H.prototype);m.prototype.getBits=function(b){for(var k=this.codeSize,h=this.codeBuf,g=this.bytes,e=this.bytesPos,l;k<b;)"undefined"==typeof(l=g[e++])&&d("Bad encoding in flate stream"),h|=l<<k,k+=8;this.codeBuf=h>>b;this.codeSize=k-=b;this.bytesPos=e;return h&(1<<b)-1};m.prototype.getCode=function(b){var k=b[0],h=b[1];b=this.codeSize;for(var g=
this.codeBuf,e=this.bytes,l=this.bytesPos;b<h;){var p;"undefined"==typeof(p=e[l++])&&d("Bad encoding in flate stream");g|=p<<b;b+=8}h=k[g&(1<<h)-1];k=h>>16;h&=65535;(0==b||b<k||0==k)&&d("Bad encoding in flate stream");this.codeBuf=g>>k;this.codeSize=b-k;this.bytesPos=l;return h};m.prototype.generateHuffmanTable=function(b){for(var k=b.length,h=0,g=0;g<k;++g)b[g]>h&&(h=b[g]);for(var e=1<<h,l=new Uint32Array(e),p=1,v=0,z=2;p<=h;++p,v<<=1,z<<=1)for(var u=0;u<k;++u)if(b[u]==p){var E=0,w=v;for(g=0;g<p;++g)E=
E<<1|w&1,w>>=1;for(g=E;g<e;g+=z)l[g]=p<<16|u;++v}return[l,h]};m.prototype.readBlock=function(){function b(E,w,F,y,D){for(E=E.getBits(F)+y;0<E--;)w[v++]=D}var k=this.getBits(3);k&1&&(this.eof=!0);k>>=1;if(0==k){var h=this.bytes,g=this.bytesPos,e;"undefined"==typeof(e=h[g++])&&d("Bad block header in flate stream");var l=e;"undefined"==typeof(e=h[g++])&&d("Bad block header in flate stream");l|=e<<8;"undefined"==typeof(e=h[g++])&&d("Bad block header in flate stream");k=e;"undefined"==typeof(e=h[g++])&&
d("Bad block header in flate stream");(k|e<<8)!=(~l&65535)&&d("Bad uncompressed block length in flate stream");this.codeSize=this.codeBuf=0;e=this.bufferLength;k=this.ensureBuffer(e+l);this.bufferLength=l=e+l;for(var p=e;p<l;++p){if("undefined"==typeof(e=h[g++])){this.eof=!0;break}k[p]=e}this.bytesPos=g}else{if(1==k)g=c,e=a;else if(2==k){k=this.getBits(5)+257;e=this.getBits(5)+1;h=this.getBits(4)+4;g=Array(n.length);for(var v=0;v<h;)g[n[v++]]=this.getBits(3);g=this.generateHuffmanTable(g);v=h=0;e=
k+e;for(l=Array(e);v<e;)p=this.getCode(g),16==p?b(this,l,2,3,h):17==p?b(this,l,3,3,h=0):18==p?b(this,l,7,11,h=0):l[v++]=h=p;g=this.generateHuffmanTable(l.slice(0,k));e=this.generateHuffmanTable(l.slice(k,e))}else d("Unknown block type in flate stream");l=(k=this.buffer)?k.length:0;for(p=this.bufferLength;;){var z=this.getCode(g);if(256>z)p+1>=l&&(k=this.ensureBuffer(p+1),l=k.length),k[p++]=z;else{if(256==z){this.bufferLength=p;break}z-=257;z=q[z];var u=z>>16;0<u&&(u=this.getBits(u));h=(z&65535)+u;
z=this.getCode(e);z=f[z];u=z>>16;0<u&&(u=this.getBits(u));z=(z&65535)+u;p+h>=l&&(k=this.ensureBuffer(p+h),l=k.length);for(u=0;u<h;++u,++p)k[p]=k[p-z]}}}};return m}()})},"esri/layers/rasterFormats/Jpg":function(){define([],function(){var H=function(){function d(m){this.message="JPEG error: "+m}d.prototype=Error();d.prototype.name="JpegError";return d.constructor=d}();return function(){function d(){this.decodeTransform=null;this.colorTransform=-1}function m(a,b){for(var k=0,h=[],g,e,l=16;0<l&&!a[l-
1];)l--;h.push({children:[],index:0});var p=h[0],v;for(g=0;g<l;g++){for(e=0;e<a[g];e++){p=h.pop();for(p.children[p.index]=b[k];0<p.index;)p=h.pop();p.index++;for(h.push(p);h.length<=g;)h.push(v={children:[],index:0}),p.children[p.index]=v.children,p=v;k++}g+1<l&&(h.push(v={children:[],index:0}),p.children[p.index]=v.children,p=v)}return h[0].children}function n(a,b,k,h,g,e,l,p,v){function z(){if(0<J)return J--,C>>J&1;C=a[b++];if(255===C){var O=a[b++];if(O)throw new H("unexpected marker "+(C<<8|O).toString(16));
}J=7;return C>>>7}function u(O){for(;;){O=O[z()];if("number"===typeof O)return O;if("object"!==typeof O)throw new H("invalid huffman sequence");}}function E(O){for(var G=0;0<O;)G=G<<1|z(),O--;return G}function w(O){if(1===O)return 1===z()?1:-1;var G=E(O);return G>=1<<O-1?G:G+(-1<<O)+1}function F(O,G){var M=u(O.huffmanTableDC);M=0===M?0:w(M);O.blockData[G]=O.pred+=M;for(M=1;64>M;){var N=u(O.huffmanTableAC),V=N&15;N>>=4;if(0===V){if(15>N)break;M+=16}else M+=N,O.blockData[G+c[M]]=w(V),M++}}function y(O,
G){var M=u(O.huffmanTableDC);M=0===M?0:w(M)<<v;O.blockData[G]=O.pred+=M}function D(O,G){O.blockData[G]|=z()<<v}function B(O,G){if(0<L)L--;else for(var M=e;M<=l;){var N=u(O.huffmanTableAC),V=N&15;N>>=4;if(0===V){if(15>N){L=E(N)+(1<<N)-1;break}M+=16}else M+=N,O.blockData[G+c[M]]=w(V)*(1<<v),M++}}function x(O,G){for(var M=e,N=0,V;M<=l;){V=c[M];switch(P){case 0:N=u(O.huffmanTableAC);V=N&15;N>>=4;if(0===V)15>N?(L=E(N)+(1<<N),P=4):(N=16,P=1);else{if(1!==V)throw new H("invalid ACn encoding");U=w(V);P=N?
2:3}continue;case 1:case 2:O.blockData[G+V]?O.blockData[G+V]+=z()<<v:(N--,0===N&&(P=2===P?3:0));break;case 3:O.blockData[G+V]?O.blockData[G+V]+=z()<<v:(O.blockData[G+V]=U<<v,P=0);break;case 4:O.blockData[G+V]&&(O.blockData[G+V]+=z()<<v)}M++}4===P&&(L--,0===L&&(P=0))}var r=k.mcusPerLine,t=b,C=0,J=0,L=0,P=0,U,aa=h.length,ea,ba,oa,da;p=k.progressive?0===e?0===p?y:D:0===p?B:x:F;var fa=0;k=1===aa?h[0].blocksPerLine*h[0].blocksPerColumn:r*k.mcusPerColumn;for(var S,W;fa<k;){var la=g?Math.min(k-fa,g):k;for(ea=
0;ea<aa;ea++)h[ea].pred=0;L=0;if(1===aa){var K=h[0];for(da=0;da<la;da++)p(K,64*((K.blocksPerLine+1)*(fa/K.blocksPerLine|0)+fa%K.blocksPerLine)),fa++}else for(da=0;da<la;da++){for(ea=0;ea<aa;ea++)for(K=h[ea],S=K.h,W=K.v,ba=0;ba<W;ba++)for(oa=0;oa<S;oa++)p(K,64*((K.blocksPerLine+1)*((fa/r|0)*K.v+ba)+(fa%r*K.h+oa)));fa++}J=0;(K=f(a,b))&&K.invalid&&(console.log("decodeScan - unexpected MCU data, next marker is: "+K.invalid),b=K.offset);K=K&&K.marker;if(!K||65280>=K)throw new H("marker was not found");
if(65488<=K&&65495>=K)b+=2;else break}(K=f(a,b))&&K.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+K.invalid),b=K.offset);return b-t}function q(a,b){a=b.blocksPerLine;for(var k=b.blocksPerColumn,h=new Int16Array(64),g=0;g<k;g++)for(var e=0;e<a;e++){var l=void 0,p=void 0,v=void 0,z=void 0,u=void 0,E=void 0,w=void 0,F=void 0,y=u=E=z=p=l=void 0,D=void 0,B=void 0,x=void 0,r=64*((b.blocksPerLine+1)*g+e),t=h,C=b.quantizationTable,J=b.blockData;if(!C)throw new H("missing required Quantization Table.");
for(var L=0;64>L;L+=8)l=J[r+L],F=J[r+L+1],w=J[r+L+2],E=J[r+L+3],u=J[r+L+4],z=J[r+L+5],v=J[r+L+6],p=J[r+L+7],l*=C[L],0===(F|w|E|u|z|v|p)?(l=5793*l+512>>10,t[L]=l,t[L+1]=l,t[L+2]=l,t[L+3]=l,t[L+4]=l,t[L+5]=l,t[L+6]=l,t[L+7]=l):(F*=C[L+1],w*=C[L+2],E*=C[L+3],u*=C[L+4],z*=C[L+5],v*=C[L+6],p*=C[L+7],x=5793*l+128>>8,B=5793*u+128>>8,D=w,y=v,u=2896*(F-p)+128>>8,p=2896*(F+p)+128>>8,E<<=4,z<<=4,x=x+B+1>>1,B=x-B,l=3784*D+1567*y+128>>8,D=1567*D-3784*y+128>>8,y=l,u=u+z+1>>1,z=u-z,p=p+E+1>>1,E=p-E,x=x+y+1>>1,y=
x-y,B=B+D+1>>1,D=B-D,l=2276*u+3406*p+2048>>12,u=3406*u-2276*p+2048>>12,p=l,l=799*E+4017*z+2048>>12,E=4017*E-799*z+2048>>12,z=l,t[L]=x+p,t[L+7]=x-p,t[L+1]=B+z,t[L+6]=B-z,t[L+2]=D+E,t[L+5]=D-E,t[L+3]=y+u,t[L+4]=y-u);for(C=0;8>C;++C)l=t[C],F=t[C+8],w=t[C+16],E=t[C+24],u=t[C+32],z=t[C+40],v=t[C+48],p=t[C+56],0===(F|w|E|u|z|v|p)?(l=5793*l+8192>>14,l=-2040>l?0:2024<=l?255:l+2056>>4,J[r+C]=l,J[r+C+8]=l,J[r+C+16]=l,J[r+C+24]=l,J[r+C+32]=l,J[r+C+40]=l,J[r+C+48]=l,J[r+C+56]=l):(x=5793*l+2048>>12,B=5793*u+2048>>
12,D=w,y=v,u=2896*(F-p)+2048>>12,p=2896*(F+p)+2048>>12,x=(x+B+1>>1)+4112,B=x-B,l=3784*D+1567*y+2048>>12,D=1567*D-3784*y+2048>>12,y=l,u=u+z+1>>1,z=u-z,p=p+E+1>>1,E=p-E,x=x+y+1>>1,y=x-y,B=B+D+1>>1,D=B-D,l=2276*u+3406*p+2048>>12,u=3406*u-2276*p+2048>>12,p=l,l=799*E+4017*z+2048>>12,E=4017*E-799*z+2048>>12,z=l,l=x+p,p=x-p,F=B+z,v=B-z,w=D+E,z=D-E,E=y+u,u=y-u,l=16>l?0:4080<=l?255:l>>4,F=16>F?0:4080<=F?255:F>>4,w=16>w?0:4080<=w?255:w>>4,E=16>E?0:4080<=E?255:E>>4,u=16>u?0:4080<=u?255:u>>4,z=16>z?0:4080<=z?
255:z>>4,v=16>v?0:4080<=v?255:v>>4,p=16>p?0:4080<=p?255:p>>4,J[r+C]=l,J[r+C+8]=F,J[r+C+16]=w,J[r+C+24]=E,J[r+C+32]=u,J[r+C+40]=z,J[r+C+48]=v,J[r+C+56]=p)}return b.blockData}function f(a,b,k){var h=a.length-1;k=k<b?k:b;if(b>=h)return null;var g=a[b]<<8|a[b+1];if(65472<=g&&65534>=g)return{invalid:null,marker:g,offset:b};for(b=a[k]<<8|a[k+1];!(65472<=b&&65534>=b);){if(++k>=h)return null;b=a[k]<<8|a[k+1]}return{invalid:g.toString(16),marker:b,offset:k}}if(!self||!self.Uint8ClampedArray)return null;var c=
new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);d.prototype={parse:function(a){function b(){var C=a[g]<<8|a[g+1];g+=2;return C}function k(){var C=b();C=g+C-2;var J=f(a,C,g);J&&J.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+J.invalid),C=J.offset);C=a.subarray(g,C);g+=C.length;return C}function h(C){for(var J=Math.ceil(C.samplesPerLine/
8/C.maxH),L=Math.ceil(C.scanLines/8/C.maxV),P=0;P<C.components.length;P++){t=C.components[P];var U=Math.ceil(Math.ceil(C.samplesPerLine/8)*t.h/C.maxH),aa=Math.ceil(Math.ceil(C.scanLines/8)*t.v/C.maxV);t.blockData=new Int16Array(64*L*t.v*(J*t.h+1));t.blocksPerLine=U;t.blocksPerColumn=aa}C.mcusPerLine=J;C.mcusPerColumn=L}var g=0,e=null,l=null,p=[],v=[],z=[],u=b();if(65496!==u)throw new H("SOI not found");for(u=b();65497!==u;){switch(u){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var E=
k();65504===u&&74===E[0]&&70===E[1]&&73===E[2]&&70===E[3]&&0===E[4]&&(e={version:{major:E[5],minor:E[6]},densityUnits:E[7],xDensity:E[8]<<8|E[9],yDensity:E[10]<<8|E[11],thumbWidth:E[12],thumbHeight:E[13],thumbData:E.subarray(14,14+3*E[12]*E[13])});65518===u&&65===E[0]&&100===E[1]&&111===E[2]&&98===E[3]&&101===E[4]&&(l={version:E[5]<<8|E[6],flags0:E[7]<<8|E[8],flags1:E[9]<<8|E[10],transformCode:E[11]});break;case 65499:u=b()+g-2;for(var w;g<u;){var F=a[g++],y=new Uint16Array(64);if(0===F>>4)for(E=
0;64>E;E++)w=c[E],y[w]=a[g++];else if(1===F>>4)for(E=0;64>E;E++)w=c[E],y[w]=b();else throw new H("DQT - invalid table spec");p[F&15]=y}break;case 65472:case 65473:case 65474:if(D)throw new H("Only single frame JPEGs supported");b();var D={};D.extended=65473===u;D.progressive=65474===u;D.precision=a[g++];D.scanLines=b();D.samplesPerLine=b();D.components=[];D.componentIds={};E=a[g++];for(u=y=F=0;u<E;u++){w=a[g];var B=a[g+1]>>4;var x=a[g+1]&15;F<B&&(F=B);y<x&&(y=x);B=D.components.push({h:B,v:x,quantizationId:a[g+
2],quantizationTable:null});D.componentIds[w]=B-1;g+=3}D.maxH=F;D.maxV=y;h(D);break;case 65476:w=b();for(u=2;u<w;){F=a[g++];y=new Uint8Array(16);for(E=B=0;16>E;E++,g++)B+=y[E]=a[g];x=new Uint8Array(B);for(E=0;E<B;E++,g++)x[E]=a[g];u+=17+B;(0===F>>4?z:v)[F&15]=m(y,x)}break;case 65501:b();var r=b();break;case 65498:b();w=a[g++];E=[];for(u=0;u<w;u++){F=D.componentIds[a[g++]];var t=D.components[F];F=a[g++];t.huffmanTableDC=z[F>>4];t.huffmanTableAC=v[F&15];E.push(t)}u=a[g++];w=a[g++];F=a[g++];u=n(a,g,
D,E,r,u,w,F>>4,F&15);g+=u;break;case 65535:255!==a[g]&&g--;break;default:if(255===a[g-3]&&192<=a[g-2]&&254>=a[g-2])g-=3;else throw new H("unknown marker "+u.toString(16));}u=b()}this.width=D.samplesPerLine;this.height=D.scanLines;this.jfif=e;this.eof=g;this.adobe=l;this.components=[];for(u=0;u<D.components.length;u++){t=D.components[u];if(e=p[t.quantizationId])t.quantizationTable=e;this.components.push({output:q(D,t),scaleX:t.h/D.maxH,scaleY:t.v/D.maxV,blocksPerLine:t.blocksPerLine,blocksPerColumn:t.blocksPerColumn})}this.numComponents=
this.components.length},_getLinearizedBlockData:function(a,b){var k=this.width/a,h=this.height/b,g,e,l=0,p=this.components.length,v=a*b*p,z=new Uint8ClampedArray(v),u=new Uint32Array(a);for(e=0;e<p;e++){var E=this.components[e];var w=E.scaleX*k;var F=E.scaleY*h;l=e;var y=E.output;var D=E.blocksPerLine+1<<3;for(g=0;g<a;g++)E=0|g*w,u[g]=(E&4294967288)<<3|E&7;for(w=0;w<b;w++)for(E=0|w*F,E=D*(E&4294967288)|(E&7)<<3,g=0;g<a;g++)z[l]=y[E+u[g]],l+=p}if(b=this.decodeTransform)for(e=0;e<v;)for(a=E=0;E<p;E++,
e++,a+=2)z[e]=(z[e]*b[a]>>8)+b[a+1];return z},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0===this.colorTransform?!1:!0:1===this.colorTransform?!0:!1},_convertYccToRgb:function(a){for(var b,k,h,g=0,e=a.length;g<e;g+=3)b=a[g],k=a[g+1],h=a[g+2],a[g]=b-179.456+1.402*h,a[g+1]=b+135.459-.344*k-.714*h,a[g+2]=b-226.816+1.772*k;return a},_convertYcckToRgb:function(a){for(var b,k,h,g,e=0,l=0,p=a.length;l<p;l+=4)b=a[l],k=a[l+1],h=a[l+2],g=a[l+3],a[e++]=
-122.67195406894+k*(-6.60635669420364E-5*k+4.37130475926232E-4*h-5.4080610064599E-5*b+4.8449797120281E-4*g-.154362151871126)+h*(-9.57964378445773E-4*h+8.17076911346625E-4*b-.00477271405408747*g+1.53380253221734)+b*(9.61250184130688E-4*b-.00266257332283933*g+.48357088451265)+g*(-3.36197177618394E-4*g+.484791561490776),a[e++]=107.268039397724+k*(2.19927104525741E-5*k-6.40992018297945E-4*h+6.59397001245577E-4*b+4.26105652938837E-4*g-.176491792462875)+h*(-7.78269941513683E-4*h+.00130872261408275*b+7.70482631801132E-4*
g-.151051492775562)+b*(.00126935368114843*b-.00265090189010898*g+.25802910206845)+g*(-3.18913117588328E-4*g-.213742400323665),a[e++]=-20.810012546947+k*(-5.70115196973677E-4*k-2.63409051004589E-5*h+.0020741088115012*b-.00288260236853442*g+.814272968359295)+h*(-1.53496057440975E-5*h-1.32689043961446E-4*b+5.60833691242812E-4*g-.195152027534049)+b*(.00174418132927582*b-.00255243321439347*g+.116935020465145)+g*(-3.43531996510555E-4*g+.24165260232407);return a},_convertYcckToCmyk:function(a){for(var b,
k,h,g=0,e=a.length;g<e;g+=4)b=a[g],k=a[g+1],h=a[g+2],a[g]=434.456-b-1.402*h,a[g+1]=119.541-b+.344*k+.714*h,a[g+2]=481.816-b-1.772*k;return a},_convertCmykToRgb:function(a){for(var b,k,h,g,e=0,l=1/255,p=0,v=a.length;p<v;p+=4)b=a[p]*l,k=a[p+1]*l,h=a[p+2]*l,g=a[p+3]*l,a[e++]=255+b*(-4.387332384609988*b+54.48615194189176*k+18.82290502165302*h+212.25662451639585*g-285.2331026137004)+k*(1.7149763477362134*k-5.6096736904047315*h-17.873870861415444*g-5.497006427196366)+h*(-2.5217340131683033*h-21.248923337353073*
g+17.5119270841813)-g*(21.86122147463605*g+189.48180835922747),a[e++]=255+b*(8.841041422036149*b+60.118027045597366*k+6.871425592049007*h+31.159100130055922*g-79.2970844816548)+k*(-15.310361306967817*k+17.575251261109482*h+131.35250912493976*g-190.9453302588951)+h*(4.444339102852739*h+9.8632861493405*g-24.86741582555878)-g*(20.737325471181034*g+187.80453709719578),a[e++]=255+b*(.8842522430003296*b+8.078677503112928*k+30.89978309703729*h-.23883238689178934*g-14.183576799673286)+k*(10.49593273432072*
k+63.02378494754052*h+50.606957656360734*g-112.23884253719248)+h*(.03296041114873217*h+115.60384449646641*g-193.58209356861505)-g*(22.33816807309886*g+180.12613974708367);return a},getData:function(a,b,k){if(4<this.numComponents)throw new H("Unsupported color mode");a=this._getLinearizedBlockData(a,b);if(1===this.numComponents&&k){k=a.length;b=new Uint8ClampedArray(3*k);for(var h=0,g=0;g<k;g++){var e=a[g];b[h++]=e;b[h++]=e;b[h++]=e}return b}if(3===this.numComponents&&this._isColorConversionNeeded())return this._convertYccToRgb(a);
if(4===this.numComponents){if(this._isColorConversionNeeded())return k?this._convertYcckToRgb(a):this._convertYcckToCmyk(a);if(k)return this._convertCmykToRgb(a)}return a}};return d}()})},"esri/layers/rasterFormats/Png":function(){define(["./Zlib"],function(H){return function(){function d(n){var q,f;this.data=n;this.pos=8;this.palette=[];this.imgData=[];this.transparency={};this.animation=null;this.text={};for(f=null;;){var c=this.readUInt32();var a=n=void 0;n=[];for(a=0;4>a;++a)n.push(String.fromCharCode(this.data[this.pos++]));
n=n.join("");switch(n){case "IHDR":this.width=this.readUInt32();this.height=this.readUInt32();this.bits=this.data[this.pos++];this.colorType=this.data[this.pos++];this.compressionMethod=this.data[this.pos++];this.filterMethod=this.data[this.pos++];this.interlaceMethod=this.data[this.pos++];break;case "acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||Infinity,frames:[]};break;case "PLTE":this.palette=this.read(c);break;case "fcTL":f&&this.animation.frames.push(f);this.pos+=
4;f={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()};n=this.readUInt16();c=this.readUInt16()||100;f.delay=1E3*n/c;f.disposeOp=this.data[this.pos++];f.blendOp=this.data[this.pos++];f.data=[];break;case "IDAT":case "fdAT":"fdAT"===n&&(this.pos+=4,c-=4);n=(null!=f?f.data:void 0)||this.imgData;for(a=0;0<=c?a<c:a>c;0<=c?++a:--a)n.push(this.data[this.pos++]);break;case "tRNS":this.transparency={};switch(this.colorType){case 3:this.transparency.indexed=
this.read(c);c=255-this.transparency.indexed.length;if(0<c)for(n=0;0<=c?n<c:n>c;0<=c?++n:--n)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(c)[0];break;case 2:this.transparency.rgb=this.read(c)}break;case "tEXt":a=this.read(c);c=a.indexOf(0);n=String.fromCharCode.apply(String,a.slice(0,c));this.text[n]=String.fromCharCode.apply(String,a.slice(c+1));break;case "IEND":f&&this.animation.frames.push(f);a:{switch(this.colorType){case 0:case 3:case 4:f=1;break a;
case 2:case 6:f=3;break a}f=void 0}this.colors=f;this.hasAlphaChannel=4===(q=this.colorType)||6===q;q=this.colors+(this.hasAlphaChannel?1:0);this.pixelBitlength=this.bits*q;a:{switch(this.colors){case 1:q="DeviceGray";break a;case 3:q="DeviceRGB";break a}q=void 0}this.colorSpace=q;this.imgData=new Uint8Array(this.imgData);return;default:this.pos+=c}this.pos+=4;if(this.pos>this.data.length)throw Error("Incomplete or corrupt PNG file");}}d.load=function(n,q,f){"function"===typeof q&&(f=q);var c=new XMLHttpRequest;
c.open("GET",n,!0);c.responseType="arraybuffer";c.onload=function(){var a=new Uint8Array(c.response||c.mozResponseArrayBuffer);a=new d(a);"function"===typeof(null!=q?q.getContext:void 0)&&a.render(q);return"function"===typeof f?f(a):void 0};return c.send(null)};d.prototype.read=function(n){var q;var f=[];for(q=0;0<=n?q<n:q>n;0<=n?++q:--q)f.push(this.data[this.pos++]);return f};d.prototype.readUInt32=function(){var n=this.data[this.pos++]<<24;var q=this.data[this.pos++]<<16;var f=this.data[this.pos++]<<
8;var c=this.data[this.pos++];return n|q|f|c};d.prototype.readUInt16=function(){var n=this.data[this.pos++]<<8;var q=this.data[this.pos++];return n|q};d.prototype.decodePixels=function(n){var q,f,c,a,b,k,h,g;null==n&&(n=this.imgData);if(0===n.length)return new Uint8Array(0);n=new H(n);n=n.getBytes();var e=this.pixelBitlength/8;var l=e*this.width;var p=new Uint8Array(l*this.height);var v=n.length;for(f=a=b=0;a<v;){switch(n[a++]){case 0:for(c=q=0;q<l;c=q+=1)p[f++]=n[a++];break;case 1:for(c=k=0;k<l;c=
k+=1){q=n[a++];var z=c<e?0:p[f-e];p[f++]=(q+z)%256}break;case 2:for(c=z=0;z<l;c=z+=1){q=n[a++];var u=(c-c%e)/e;k=b&&p[(b-1)*l+u*e+c%e];p[f++]=(k+q)%256}break;case 3:for(c=g=0;g<l;c=g+=1)q=n[a++],u=(c-c%e)/e,z=c<e?0:p[f-e],k=b&&p[(b-1)*l+u*e+c%e],p[f++]=(q+Math.floor((z+k)/2))%256;break;case 4:for(c=g=0;g<l;c=g+=1){q=n[a++];u=(c-c%e)/e;z=c<e?0:p[f-e];0===b?k=h=0:(k=p[(b-1)*l+u*e+c%e],h=u&&p[(b-1)*l+(u-1)*e+c%e]);var E=z+k-h;c=Math.abs(E-z);u=Math.abs(E-k);E=Math.abs(E-h);z=c<=u&&c<=E?z:u<=E?k:h;p[f++]=
(q+z)%256}break;default:throw Error("Invalid filter algorithm: "+n[a-1]);}b++}return p};d.prototype.decodePalette=function(){var n,q,f,c,a;var b=this.palette;var k=this.transparency.indexed||[];var h=new Uint8Array((k.length||0)+b.length);var g=f=n=q=0;for(c=b.length;f<c;g=f+=3)h[q++]=b[g],h[q++]=b[g+1],h[q++]=b[g+2],h[q++]=null!=(a=k[n++])?a:255;return h};d.prototype.copyToImageData=function(n,q){var f,c;var a=this.colors;var b=null;var k=this.hasAlphaChannel;this.palette.length&&(b=null!=(f=this._decodedPalette)?
f:this._decodedPalette=this.decodePalette(),a=4,k=!0);n=n.data||n;var h=n.length;var g=b||q;f=c=0;if(1===a)for(;f<h;)a=b?4*q[f/4]:c,c=g[a++],n[f++]=c,n[f++]=c,n[f++]=c,n[f++]=k?g[a++]:this.transparency.grayscale&&this.transparency.grayscale===c?0:255,c=a;else for(;f<h;)a=b?4*q[f/4]:c,n[f++]=g[a++],n[f++]=g[a++],n[f++]=g[a++],n[f++]=k?g[a++]:this.transparency.rgb&&this.transparency.rgb[1]===g[a-3]&&this.transparency.rgb[3]===g[a-2]&&this.transparency.rgb[5]===g[a-1]?0:255,c=a};d.prototype.decode=function(){var n=
new Uint8Array(this.width*this.height*4);this.copyToImageData(n,this.decodePixels());return n};var m=function(n){(void 0).clearRect(0,0,n.width,n.height);(void 0).putImageData(n,0,0);n=new Image;n.src=(void 0).toDataURL();return n};d.prototype.decodeFrames=function(n){var q,f;if(this.animation){var c=this.animation.frames;var a=[];var b=q=0;for(f=c.length;q<f;b=++q){b=c[b];var k=n.createImageData(b.width,b.height);var h=this.decodePixels(new Uint8Array(b.data));this.copyToImageData(k,h);b.imageData=
k;a.push(b.image=m(k))}return a}};d.prototype.renderFrame=function(n,q){var f=this.animation.frames;var c=f[q];f=f[q-1];0===q&&n.clearRect(0,0,this.width,this.height);1===(null!=f?f.disposeOp:void 0)?n.clearRect(f.xOffset,f.yOffset,f.width,f.height):2===(null!=f?f.disposeOp:void 0)&&n.putImageData(f.imageData,f.xOffset,f.yOffset);0===c.blendOp&&n.clearRect(c.xOffset,c.yOffset,c.width,c.height);return n.drawImage(c.image,c.xOffset,c.yOffset)};d.prototype.animate=function(n){var q,f=this;var c=0;var a=
this.animation;var b=a.numFrames;var k=a.frames;var h=a.numPlays;return(q=function(){var g=c++%b;var e=k[g];f.renderFrame(n,g);if(1<b&&c/b<h)return f.animation._timeout=setTimeout(q,e.delay)})()};d.prototype.stopAnimation=function(){var n;return clearTimeout(null!=(n=this.animation)?n._timeout:void 0)};d.prototype.render=function(n){n._png&&n._png.stopAnimation();n._png=this;n.width=this.width;n.height=this.height;n=n.getContext("2d");if(this.animation)return this.decodeFrames(n),this.animate(n);
var q=n.createImageData(this.width,this.height);this.copyToImageData(q,this.decodePixels());return n.putImageData(q,0,0)};return d}()})},"esri/layers/rasterFormats/Raw":function(){define([],function(){return{decodeBIP:function(H,d){var m=d.pixelType,n=d.bandCount,q=[],f=d.width*d.height,c=this.getBandCount(H,d);n=n||c;var a=H.byteLength-H.byteLength%(f*this._getPixelLength(m)),b=new m(H,0,f*c),k,h,g;for(k=0;k<n;k++){var e=new m(f);for(h=0;h<f;h++)e[h]=b[h*c+k];q.push(e)}a<H.byteLength-1&&(g=this._decodeMask(H.slice(a),
d));return{pixels:q,maskData:g}},decodeBSQ:function(H,d){var m=d.pixelType,n=d.bandCount;if(void 0===n||null===n)n=this.getBandCount(H,d);var q=[],f=d.width*d.height,c=f*n,a=H.byteLength-H.byteLength%(f*this._getPixelLength(m));m=new m(H,0,c);var b;for(c=0;c<n;c++)q.push(m.subarray(c*f,(c+1)*f));a<H.byteLength-1&&(b=this._decodeMask(H.slice(a),d));return{pixels:q,maskData:b}},getBandCount:function(H,d){return Math.floor(H.byteLength/(d.width*d.height*this._getPixelLength(d.pixelType)))},_getPixelLength:function(H){var d=
1;switch(H){case Uint8Array:case Int8Array:case Uint8ClampedArray:d=1;break;case Uint16Array:case Int16Array:d=2;break;case Uint32Array:case Int32Array:case Float32Array:d=4;break;case Float64Array:d=8}return d},_decodeMask:function(H,d){var m=d.width*d.height;if(8*H.byteLength<m)return null;H=new Uint8Array(H,0,Math.ceil(m/8));d=new Uint8Array(d.width*d.height);var n=0,q=0,f=0,c=0;for(f=0;f<H.length-1;f++)for(q=H[f],c=7;0<=c;c--)d[n++]=q>>c&1;for(c=7;n<m-1;)q=H[H.length-1],d[n++]=q>>c&1,c--;return d}}})},
"esri/layers/rasterFormats/TiffDecoder":function(){define(["./Jpg","./Zlib"],function(H,d){var m=function(){var c=new ArrayBuffer(4),a=new Uint8Array(c);c=new Uint32Array(c);a[0]=1;a[1]=2;a[2]=3;a[3]=4;return 67305985===c[0]},n=function(){var c=[];c[254]="NEWSUBFILETYPE";c[255]="SUBFILETYPE";c[256]="IMAGEWIDTH";c[257]="IMAGELENGTH";c[258]="BITSPERSAMPLE";c[259]="COMPRESSION";c[262]="PHOTOMETRICINTERPRETATION";c[263]="THRESHHOLDING";c[264]="CELLWIDTH";c[265]="CELLLENGTH";c[266]="FILLORDER";c[269]=
"DOCUMENTNAME";c[270]="IMAGEDESCRIPTION";c[271]="MAKE";c[272]="MODEL";c[273]="STRIPOFFSETS";c[274]="ORIENTATION";c[277]="SAMPLESPERPIXEL";c[278]="ROWSPERSTRIP";c[279]="STRIPBYTECOUNTS";c[280]="MINSAMPLEVALUE";c[281]="MAXSAMPLEVALUE";c[282]="XRESOLUTION";c[283]="YRESOLUTION";c[284]="PLANARCONFIGURATION";c[285]="PAGENAME";c[286]="XPOSITION";c[287]="YPOSITION";c[288]="FREEOFFSETS";c[289]="FREEBYTECOUNTS";c[290]="GRAYRESPONSEUNIT";c[291]="GRAYRESPONSECURVE";c[292]="T4OPTIONS";c[293]="T6OPTIONS";c[296]=
"RESOLUTIONUNIT";c[297]="PAGENUMBER";c[300]="COLORRESPONSEUNIT";c[301]="TRANSFERFUNCTION";c[305]="SOFTWARE";c[306]="DATETIME";c[315]="ARTIST";c[316]="HOSTCOMPUTER";c[317]="PREDICTOR";c[318]="WHITEPOINT";c[319]="PRIMARYCHROMATICITIES";c[320]="COLORMAP";c[321]="HALFTONEHINTS";c[322]="TILEWIDTH";c[323]="TILELENGTH";c[324]="TILEOFFSETS";c[325]="TILEBYTECOUNTS";c[326]="BADFAXLINES";c[327]="CLEANFAXDATA";c[328]="CONSECUTIVEBADFAXLINES";c[330]="SUBIFD";c[332]="INKSET";c[333]="INKNAMES";c[334]="NUMBEROFINKS";
c[336]="DOTRANGE";c[337]="TARGETPRINTER";c[338]="EXTRASAMPLES";c[339]="SAMPLEFORMAT";c[340]="SMINSAMPLEVALUE";c[341]="SMAXSAMPLEVALUE";c[342]="TRANSFERRANGE";c[347]="JPEGTABLES";c[512]="JPEGPROC";c[513]="JPEGIFOFFSET";c[514]="JPEGIFBYTECOUNT";c[515]="JPEGRESTARTINTERVAL";c[517]="JPEGLOSSLESSPREDICTORS";c[518]="JPEGPOINTTRANSFORM";c[519]="JPEGQTABLES";c[520]="JPEGDCTABLES";c[521]="JPEGACTABLES";c[529]="YCBCRCOEFFICIENTS";c[530]="YCBCRSUBSAMPLING";c[531]="YCBCRPOSITIONING";c[532]="REFERENCEBLACKWHITE";
c[33550]="GEOPIXELSCALE";c[33922]="GEOTIEPOINTS";c[33432]="COPYRIGHT";c[42112]="GDAL_METADATA";c[42113]="GDAL_NODATA";c[50844]="RPCCOEFFICIENT";c[34735]="GEOKEYDIRECTORY";c[34736]="GEODOUBLEPARAMS";c[34737]="GEOASCIIPARAMS";return c}(),q=[0,1,1,2,4,8,1,1,2,4,8,4,8],f=function(c,a){var b="UNKNOWN";3===c?b="F32":1===c?8>=a?b="U8":16>=a?b="U16":32>=a&&(b="U32"):2===c&&(8>=a?b="S8":16>=a?b="S16":32>=a&&(b="S32"));return b};return{decode:function(c){var a=new DataView(c,0,8),b=a.getUint16(0,!1);if(18761===
b)var k=!0;else if(19789===b)k=!1;else throw"unexpected endianess byte";if(42!==a.getUint16(2,k))throw"unexpected tiff identifier";var h=a.getUint32(4,k);var g=k;var e,l;var p=h;for(var v=[];p;){var z=(new DataView(c,p,2)).getUint16(0,g);var u=p+2;p=(new DataView(c,u+12*z,4)).getUint32(0,g);var E={};for(e=0;e<z;e++){var w=new DataView(c,u,12);var F=w.getUint16(0,g);var y=w.getUint16(2,g);var D=w.getUint32(4,g);var B=w.getUint32(8,g);u+=12;if(!(7===y||12<y)){var x=l={fieldTag:F,fieldType:y,fieldValueCount:D,
fieldValueOffset:B},r=void 0,t=void 0,C=c,J=g,L=[],P=l.fieldType,U=l.fieldValueCount,aa=l.fieldValueOffset,ea=aa,ba=q[P],oa=8*ba,da=U*ba,fa=U*q[P]*8;if(32>=fa)if(J||(aa>>>=32-fa),1===U)L=[aa];else for(r=0;r<U;r++)L.push(aa<<oa*r>>>32-oa);else for(ea=aa;ea<aa+da;ea+=ba){switch(P){case 1:t=(new DataView(C,ea,1)).getUint8(0);break;case 2:t=(new DataView(C,ea,1)).getUint8(0);break;case 3:t=(new DataView(C,ea,2)).getUint16(0,J);break;case 4:t=(new DataView(C,ea,4)).getUint32(0,J);break;case 5:t=(new DataView(C,
ea,4)).getUint32(0,J)/(new DataView(C,ea+4,4)).getUint32(0,J);break;case 6:t=(new DataView(C,ea,1)).getInt8(0);break;case 8:t=(new DataView(C,ea,2)).getInt16(0,J);break;case 9:t=(new DataView(C,ea,4)).getInt32(0,J);break;case 10:t=(new DataView(C,ea,4)).getInt32(0,J)/(new DataView(C,ea+4,4)).getInt32(0,J);break;case 11:t=(new DataView(C,ea,4)).getFloat32(0,J);break;case 12:t=(new DataView(C,ea,8)).getFloat64(0,J);break;case 7:t=null;break;default:t=null}L.push(t)}if(2===P){var S="",W=L;L=[];for(r=
0;r<W.length;r++)0===W[r]&&""!==S?(L.push(S),S=""):S+=String.fromCharCode(W[r]);""===S&&0!==L.length||L.push(S)}x.fieldValues=L;var la=E,K=n[F];void 0===K&&(K="unknown"+F);la[K]={type:y,values:l.fieldValues}}}v.push(E)}if(0===v.length)throw"no valid image file directory";var O,G=v[0],M=void 0===G.GDAL_NODATA||null===G.GDAL_NODATA?null:parseFloat(G.GDAL_NODATA.values[0]);if(G.TILEOFFSETS){var N=m()===g,V=G.TILEOFFSETS?G.TILEOFFSETS.values:void 0;if(void 0===V)var Y=void 0;else{var ka=G.TILEBYTECOUNTS.values,
ja=G.TILEWIDTH.values[0],R=G.TILELENGTH.values[0],ha=G.IMAGEWIDTH.values[0],qa=G.IMAGELENGTH.values[0],ia=ha*qa,pa=G.BITSPERSAMPLE.values[0],A=G.SAMPLESPERPIXEL.values[0],I=G.SAMPLEFORMAT?G.SAMPLEFORMAT.values[0]:1,T=f(I,pa);if(1!==(G.PLANARCONFIGURATION?G.PLANARCONFIGURATION.values[0]:1))throw console.log("can only handle PLANARCONFIGURATION\x3d1"),"can only handle PLANARCONFIGURATION\x3d1";var Q=G.COMPRESSION?G.COMPRESSION.values[0]:1;if(1!==Q&&6!==Q&&8!==Q&&32946!==Q)throw console.log("this compression is not supported at this moment"),
"this compression is not supported at this moment";if(3<I)Y=void 0;else{if(3===I){var Z=new Float32Array(ia*A);var X=Float32Array}else 1===I?8>=pa?(Z=new Uint8Array(ia*A),X=Uint8Array):16>=pa?(Z=new Uint16Array(ia*A),X=Uint16Array):32>=pa&&(Z=new Uint32Array(ia*A),X=Uint32Array):2===I&&(8>=pa?(Z=new Int8Array(ia*A),X=Int8Array):16>=pa?(Z=new Int16Array(ia*A),X=Int16Array):32>=pa&&(Z=new Int32Array(ia*A),X=Int32Array));var ca,ma,na,sa,Ba,wa=Math.ceil(ha/ja);if(0===pa%8)for(ca=0;ca<V.length;ca++){var ta=
Math.floor(ca/wa)*R;var ua=ca%wa*ja;var ra=(ta*ha+ua)*A;if("U8"===T||"S8"===T||N)if(8===Q||32946===Q){var va=new Uint8Array(c,V[ca],ka[ca]);var za=new d(va);var Oa=za.getBytes();var Ea=new ArrayBuffer(Oa.length);va=new Uint8Array(Ea);va.set(Oa);va.length!==ja*R*A*pa/8&&console.log("tile byte counts is different than expected")}else if(6===Q){va=new Uint8Array(c,V[ca],ka[ca]);var Aa=new H;Aa.parse(va);var Wa=Aa.getData(Aa.width,Aa.height);Ea=new ArrayBuffer(Wa.length);va=new Uint8Array(Ea);va.set(Wa)}else 1===
Q&&(ka[ca]!==ja*R*A*pa/8&&console.log("tile byte counts is different than expected"),Ea=c.slice(V[ca],V[ca]+ka[ca]));else{if(8===Q||32946===Q){va=new Uint8Array(c,V[ca],ka[ca]);za=new d(va);va=za.getBytes();Ea=new ArrayBuffer(va.length);var Pa=new Uint8Array(Ea);va.length!==ja*R*A*pa/8&&console.log("tile byte counts is different than expected")}else 1===Q&&(ka[ca]!==ja*R*A*pa/8&&console.log("tile byte counts is different than expected"),Ea=new ArrayBuffer(ka[ca]),va=new Uint8Array(c,V[ca],ka[ca]),
Pa=new Uint8Array(Ea));switch(T){case "U16":case "S16":for(na=0;na<va.length;na+=2)Pa[na]=va[na+1],Pa[na+1]=va[na];break;case "U32":case "S32":case "F32":for(na=0;na<va.length;na+=4)Pa[na]=va[na+3],Pa[na+1]=va[na+2],Pa[na+2]=va[na+1],Pa[na+3]=va[na]}}var hb=new X(Ea);var ab=0;var bb=ra;var ib=Math.min(ja,ha-ua);var jb=Math.min(R,qa-ta);for(sa=0;sa<jb;sa++)for(bb=ra+sa*ha*A,ab=sa*ja*A,Ba=0;Ba<ib*A;Ba++,bb++,ab++)Z[bb]=hb[ab]}var Xa={width:ha,height:qa,pixelType:T};if(1===A)Xa.pixels=[Z];else for(Xa.pixels=
[],ca=0;ca<A;ca++){var db=new X(ia);for(ma=0;ma<ia;ma++)db[ma]=Z[ma*A+ca];Xa.pixels.push(db)}Y=Xa}}}else if(G.STRIPOFFSETS){var kb=m()===g,Ja=G.STRIPOFFSETS?G.STRIPOFFSETS.values:void 0;if(void 0===Ja)Y=void 0;else{var Ka=G.STRIPBYTECOUNTS.values,Ra=G.ROWSPERSTRIP.values,La=G.IMAGEWIDTH.values[0],Sa=G.IMAGELENGTH.values[0],Ma=La*Sa,Fa=G.BITSPERSAMPLE.values[0],Da=G.SAMPLESPERPIXEL.values[0],Ta=G.SAMPLEFORMAT?G.SAMPLEFORMAT.values[0]:1,Ya=f(Ta,Fa);if(1!==(G.PLANARCONFIGURATION?G.PLANARCONFIGURATION.values[0]:
1))throw console.log("can only handle PLANARCONFIGURATION\x3d1"),"can only handle PLANARCONFIGURATION\x3d1";var Ga=G.COMPRESSION?G.COMPRESSION.values[0]:1;if(1!==Ga&&6!==Ga&&8!==Ga&&32946!==Ga)throw console.log("compressed tiff is not supported at this moment"),"compressed tiff is not supported at this moment";if(3<Ta)Y=void 0;else{if(3===Ta){var Ha=new Float32Array(Ma*Da);var Na=Float32Array}else 1===Ta?8>=Fa?(Ha=new Uint8Array(Ma*Da),Na=Uint8Array):16>=Fa?(Ha=new Uint16Array(Ma*Da),Na=Uint16Array):
32>=Fa&&(Ha=new Uint32Array(Ma*Da),Na=Uint32Array):2===Ta&&(8>=Fa?(Ha=new Int8Array(Ma*Da),Na=Int8Array):16>=Fa?(Ha=new Int16Array(Ma*Da),Na=Int16Array):32>=Fa&&(Ha=new Int32Array(La*Sa*Da),Na=Int32Array));var xa,Ua,Ca,Va=Ra;if(0===Fa%8)for(xa=0;xa<Ja.length;xa++){var lb=xa*Ra*La*Da;Va=(xa+1)*Ra>Sa?Sa-xa*Ra:Ra;if("U8"===Ya||"S8"===Ya||kb)if(8===Ga||32946===Ga){var ya=new Uint8Array(c,Ja[xa],Ka[xa]);var cb=new d(ya);var eb=cb.getBytes();var Ia=new ArrayBuffer(eb.length);ya=new Uint8Array(Ia);ya.set(eb);
ya.length!==Va*La*Da*Fa/8&&console.log("strip byte counts is different than expected")}else if(6===Ga){ya=new Uint8Array(c,Ja[xa],Ka[xa]);var Za=new H;Za.parse(ya);var fb=Za.getData(Za.width,Za.height);Ia=new ArrayBuffer(fb.length);ya=new Uint8Array(Ia);ya.set(fb)}else 1===Ga&&(Ka[xa]!==Va*La*Da*Fa/8&&console.log("strip byte counts is different than expected"),Ia=c.slice(Ja[xa],Ja[xa]+Ka[xa]));else{if(6===Ga||8===Ga||32946===Ga){ya=new Uint8Array(c,Ja[xa],Ka[xa]);cb=new d(ya);ya=cb.getBytes();Ia=
new ArrayBuffer(ya.length);var Qa=new Uint8Array(Ia);ya.length!==Va*La*Da*Fa/8&&console.log("strip byte counts is different than expected")}else 1===Ga&&(Ka[xa]!==Va*La*Da*Fa/8&&console.log("strip byte counts is different than expected"),Ia=new ArrayBuffer(Ka[xa]),ya=new Uint8Array(c,Ja[xa],Ka[xa]),Qa=new Uint8Array(Ia));switch(Ya){case "U16":case "S16":for(Ca=0;Ca<ya.length;Ca+=2)Qa[Ca]=ya[Ca+1],Qa[Ca+1]=ya[Ca];break;case "U32":case "S32":case "F32":for(Ca=0;Ca<ya.length;Ca+=4)Qa[Ca]=ya[Ca+3],Qa[Ca+
1]=ya[Ca+2],Qa[Ca+2]=ya[Ca+1],Qa[Ca+3]=ya[Ca]}}var mb=new Na(Ia);Ha.set(mb,lb)}var $a={width:La,height:Sa,pixelType:Ya};if(1===Da)$a.pixels=[Ha];else for($a.pixels=[],xa=0;xa<Da;xa++){var gb=new Na(Ma);for(Ua=0;Ua<Ma;Ua++)gb[Ua]=Ha[Ua*Da+xa];$a.pixels.push(gb)}Y=$a}}}if(null!==M){Y.maskData=new Uint8Array(Y.width*Y.height);if(1E24<Math.abs(M))for(O=0;O<Y.width*Y.height;O++)Y.maskData[O]=1E-6>Math.abs((Y.pixels[0][O]-M)/M)?0:1;else for(O=0;O<Y.width*Y.height;O++)Y.maskData[O]=Y.pixels[0][O]===M?0:
1;Y.noDataValue=M}return Y}}})},"esri/layers/rasterLib/tile/RasterHandler":function(){define("require exports module dojo/Deferred dojo/promise/all ../../PixelBlock ../../vectorTiles/core/workers ../../vectorTiles/core/promiseUtils ../../vectorTiles/core/requireUtils ../../vectorTiles/request ../../rasterLib/function/rasterFunctionHelper ../../rasterLib/renderer/rasterRendererHelper".split(" "),function(H,d,m,n,q,f,c,a,b,k,h,g){function e(l){var p=new n;q(l).then(function(v){p.resolve()});return p.promise}
return function(){function l(p){this.customModules=p&&p.customModules}l.prototype.destroy=function(){this.stop();this.customModules=this.rasterLayer=null};l.prototype.start=function(){this.stop();var p=new n,v=0,z=this.customModules?this.customModules.length+1:1,u=b.getAbsMid("esri/layers/rasterLib/tile/RasterWorker",H,m),E=c.open(u,{client:this}).then(function(w){this._connection=w;v++;v===z&&(this._connected=!0,p.resolve())}.bind(this));this._openDL=[E];this.customModules&&this.customModules.forEach(function(w){E=
c.open(w,{client:this}).then(function(F){v++;v===z&&(this._connected=!0,p.resolve())});this._openDL.push(E);console.log(w)}.bind(this));return this._connectionPromise=p.promise};l.prototype.stop=function(){this._openDL?this._openDL.forEach(function(p){p.isFulfilled()||p.cancel()}.bind(this)):this._connectionPromise&&!this._connectionPromise.isFulfilled()&&this._connectionPromise.cancel();this._connection&&(this._connection.close(),this._connection=null)};l.prototype.decode=function(p){if(!this._connectionPromise.isFulfilled()||
!this._connection)return a.reject(Error("no connection"));var v={id:null};return this._connection.invoke("decode",p,[],v).then(function(z){z.targetWorker=v;return z})};l.prototype.process=function(p){if(!this._connectionPromise.isFulfilled()||!this._connection)return a.reject(Error("no connection"));var v={id:null};p.layerId=this.rasterLayer.layerId;var z=new n;this._connection.invoke("process",p,[],v).then(function(u){u.targetWorker=v;u.src?Object.keys(u.src).forEach(function(E){u.src[E].pixelBlock=
new f(u.src[E].pixelBlock)}):u.src=null;u.pixelBlock&&(u.pixelBlock=new f(u.pixelBlock));z.resolve(u)});return z.promise};l.prototype.render=function(p){if(!this._connectionPromise.isFulfilled()||!this._connection)return a.reject(Error("no connection"));var v={id:null};p.layerId=this.rasterLayer.layerId;return this._connection.invoke("render",p,[],v).then(function(z){z.targetWorker=v;z.pixelBlock=z.pixelBlock?new f(z.pixelBlock):null;return z})};l.prototype.setLayer=function(p){if(!this._connectionPromise.isFulfilled()||
!this._connection)return a.reject(Error("no connection"));this.rasterLayer=p;p=this._connection.broadcast("setLayer",p,[],{id:null});return e(p)};l.prototype.setRasterFunction=function(p){if(!this._connectionPromise.isFulfilled()||!this._connection)return a.reject(Error("no connection"));p=this._connection.broadcast("setRasterFunction",p,[],{id:null});return e(p)};l.prototype.setRasterRenderer=function(p){if(!this._connectionPromise.isFulfilled()||!this._connection)return a.reject(Error("no connection"));
p=this._connection.broadcast("setRasterRenderer",p,[],{id:null});return e(p)};return l}()})},"esri/layers/vectorTiles/core/workers":function(){define(["require","exports","./workers/workers"],function(H,d,m){Object.defineProperty(d,"__esModule",{value:!0});for(var n in m)d.hasOwnProperty(n)||(d[n]=m[n])})},"esri/layers/vectorTiles/core/workers/workers":function(){define("require exports dojo/sniff dojo/promise/all ../Logger ../promiseUtils ./Connection ./RemoteClient ./WorkerOwner".split(" "),function(H,
d,m,n,q,f,c,a,b){function k(){if(v)return v;for(var z=h+g,u=[],E=function(F){var y=b.create(F).then(function(D){return p[F]=D});u.push(y)},w=0;w<z;w++)E(w);return v=n(u).then(function(){})}Object.defineProperty(d,"__esModule",{value:!0});d.Connection=c;d.RemoteClient=a;(c=navigator.hardwareConcurrency)||(c=m("safari")&&m("mac")||m("trident")?8:2);var h=m("esri-workers-debug")?1:Math.max(1,Math.ceil(c/2)),g=m("esri-workers-debug")?1:Math.max(1,Math.floor(c/2)),e=q.getLogger("esri.core.workers"),l=
0,p=[];d.initialize=function(){k()};d.open=function(z,u,E){void 0===u&&(u={});if(Array.isArray(z))return new d.Connection(z.map(function(y){return new d.RemoteClient(y,u.client)}));if("string"!==typeof z){e.warn("workers-open:signature-deprecated","DEPRECATED: workers.open() changed signature.");var w=z;z=u;u={client:w,strategy:E?"dedicated":"distributed"}}var F=u.strategy||"distributed";return"local"===F?f.create(function(y){H([z],function(D){y(d.RemoteClient.connect(D))})}).then(function(y){return new d.Connection([new d.RemoteClient(y,
u.client)])}):k().then(function(){if("dedicated"===F){var y=h+l++;l%=g;return p[y].open(z).then(function(D){return new d.Connection([new d.RemoteClient(D,u.client)])})}return f.all(p.map(function(D){return D.open(z)})).then(function(D){return new d.Connection(D.map(function(B){return new d.RemoteClient(B,u.client)}))})})};d.terminate=function(){for(var z=0;z<p.length;z++)p[z]&&p[z].terminate();p.length=0};var v})},"esri/layers/vectorTiles/core/Logger":function(){define(["require","exports","dojo/has"],
function(H,d,m){var n={info:0,warn:1,error:2};H=function(){function q(f){void 0===f&&(f={});this.module=f.module||"";this.writer=f.writer||null;this.level=f.level||null;null!=f.enabled&&(this.enabled=!!f.enabled);q._loggers[this.module]=this;f=this.module.lastIndexOf(".");-1!==f&&(this.parent=q.getLogger(this.module.slice(0,f)))}q.prototype.log=function(f){for(var c=[],a=1;a<arguments.length;a++)c[a-1]=arguments[a];this._isEnabled()&&this._matchLevel(f)&&(a=this._inheritedWriter())&&a.apply(void 0,
[f,this.module].concat(c))};q.prototype.error=function(){for(var f=[],c=0;c<arguments.length;c++)f[c]=arguments[c];this.log.apply(this,["error"].concat(f))};q.prototype.warn=function(){for(var f=[],c=0;c<arguments.length;c++)f[c]=arguments[c];this.log.apply(this,["warn"].concat(f))};q.prototype.info=function(){for(var f=[],c=0;c<arguments.length;c++)f[c]=arguments[c];this.log.apply(this,["info"].concat(f))};q.prototype.getLogger=function(f){return q.getLogger(this.module+"."+f)};q.getLogger=function(f){var c=
q._loggers[f];c||(c=new q({module:f}));return c};q.prototype._parentWithMember=function(f,c){for(var a=this;a&&null==a[f];)a=a.parent;return a?a[f]:c};q.prototype._inheritedWriter=function(){return this._parentWithMember("writer",this._consoleWriter)};q.prototype._consoleWriter=function(f,c){for(var a=[],b=2;b<arguments.length;b++)a[b-2]=arguments[b];console[f].apply(console,["["+c+"]"].concat(a))};q.prototype._matchLevel=function(f){return n[this._parentWithMember("level","error")]<=n[f]};q.prototype._isEnabled=
function(){return this._parentWithMember("enabled",!0)};q._loggers={};return q}();d=H.getLogger("esri");m("dojo-debug-messages")?d.level="info":d.level="warn";return H})},"esri/layers/vectorTiles/core/promiseUtils":function(){define("require exports dojo/Deferred dojo/when dojo/promise/all ./Error".split(" "),function(H,d,m,n,q,f){function c(a){if(a){if("function"!==typeof a.forEach){var b=Object.keys(a),k=b.map(function(l){return a[l]});return c(k).then(function(l){var p={};b.forEach(function(v,
z){return p[v]=l[z]});return p})}var h=new m,g=[],e=a.length;0===e&&h.resolve(g);a.forEach(function(l){var p={promise:l};g.push(p);l.then(function(v){p.value=v}).catch(function(v){p.error=v}).then(function(){--e;0===e&&h.resolve(g)})});return h.promise}}Object.defineProperty(d,"__esModule",{value:!0});d.all=function(a){return q(a)};d.filter=function(a,b){var k=a.slice();return q(a.map(function(h,g){return b(h,g)})).then(function(h){return k.filter(function(g,e){return h[e]})})};d.eachAlways=c;d.create=
function(a,b){var k=new m(b);a(function(h){void 0===h&&(h=null);return n(h).then(k.resolve)},k.reject);return k.promise};d.reject=function(a){var b=new m;b.reject(a);return b.promise};d.resolve=function(a){void 0===a&&(a=null);var b=new m;b.resolve(a);return b.promise};d.after=function(a,b){void 0===b&&(b=null);var k=0,h=new m(function(){k&&(clearTimeout(k),k=0)});k=setTimeout(function(){h.resolve(b)},a);return h.promise};d.timeout=function(a,b,k){var h=0,g=new m(a.cancel);a.then(function(e){g.isFulfilled()||
(g.resolve(e),h&&(clearTimeout(h),h=0))});a.catch(function(e){g.isFulfilled()||(g.reject(e),h&&(clearTimeout(h),h=0))});h=setTimeout(function(){var e=k||new f("promiseUtils:timeout","The wrapped promise did not resolve within "+b+" ms");g.reject(e)},b);return g.promise};d.wrapCallback=function(a){var b=!1,k=new m(function(){return b=!0});a(function(h){b||k.resolve(h)});return k.promise};d.isThenable=function(a){return a&&"function"===typeof a.then};d.when=function(a){return n(a)}})},"esri/layers/vectorTiles/core/Error":function(){define(["require",
"exports","./tsSupport/extendsHelper","./lang","./Message"],function(H,d,m,n,q){H=function(f){function c(a,b,k){var h=f.call(this,a,b,k)||this;return h instanceof c?h:new c(a,b,k)}m(c,f);c.prototype.toJSON=function(){return{name:this.name,message:this.message,details:n.clone(this.details),dojoType:this.dojoType}};c.fromJSON=function(a){var b=new c(a.name,a.message,a.details);null!=a.dojoType&&(b.dojoType=a.dojoType);return b};return c}(q);H.prototype.type="error";return H})},"esri/layers/vectorTiles/core/tsSupport/extendsHelper":function(){define([],
function(){return function(){var H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,m){d.__proto__=m}||function(d,m){for(var n in m)m.hasOwnProperty(n)&&(d[n]=m[n])};return function(d,m){function n(){this.constructor=d}H(d,m);d.prototype=null===m?Object.create(m):(n.prototype=m.prototype,new n)}}()})},"esri/layers/vectorTiles/core/lang":function(){define("dojo/_base/kernel dojo/_base/lang dojo/date dojo/number dojo/date/locale dojo/i18n!../nls/common".split(" "),function(H,d,m,n,
q,f){function c(l){return void 0!==l&&null!==l}function a(l){return c(l)?l:""}function b(l,p,v){var z=v.match(/([^\(]+)(\([^\)]+\))?/i),u=d.trim(z[1]);v=p[l];z=JSON.parse((z[2]?d.trim(z[2]):"{}").replace(/^\(/,"{").replace(/\)$/,"}").replace(/([{,])\s*([0-9a-zA-Z_]+)\s*:/gi,'$1"$2":').replace(/"\s*:\s*'/gi,'":"').replace(/'\s*(,|\})/gi,'"$1'));var E=z.utcOffset;if(-1===g.indexOf(u))u=d.getObject(u),d.isFunction(u)&&(v=u(v,l,p,z));else if("number"===typeof v||"string"===typeof v&&v&&!isNaN(Number(v)))switch(v=
Number(v),u){case "NumberFormat":l=d.mixin({},z);p=parseFloat(l.places);if(isNaN(p)||0>p)l.places=Infinity;return n.format(v,l);case "DateString":v=new Date(v);if(z.local||z.systemLocale)return z.systemLocale?v.toLocaleDateString()+(z.hideTime?"":" "+v.toLocaleTimeString()):v.toDateString()+(z.hideTime?"":" "+v.toTimeString());v=v.toUTCString();z.hideTime&&(v=v.replace(/\s+\d\d:\d\d:\d\d\s+(utc|gmt)/i,""));return v;case "DateFormat":return v=new Date(v),c(E)&&(v=m.add(v,"minute",v.getTimezoneOffset()-
E)),q.format(v,z)}return a(v)}function k(l,p){var v;if(p)for(v in l)l.hasOwnProperty(v)&&(void 0===l[v]?delete l[v]:l[v]instanceof Object&&k(l[v],!0));else for(v in l)l.hasOwnProperty(v)&&void 0===l[v]&&delete l[v];return l}function h(l){if(!l||"object"!=typeof l||d.isFunction(l))return l;if(l instanceof Int8Array||l instanceof Uint8Array||l instanceof Uint8ClampedArray||l instanceof Int16Array||l instanceof Int32Array||l instanceof Uint16Array||l instanceof Uint32Array||l instanceof Float32Array||
l instanceof Float64Array||l instanceof Date)return new l.constructor(l);if(l instanceof ArrayBuffer)return l.slice(0,l.byteLength);if("function"===typeof l.clone)l=l.clone();else if("function"===typeof l.map&&"function"===typeof l.forEach)l=l.map(h);else if("function"===typeof l.notifyChange&&"function"===typeof l.watch)l=l.clone();else{var p={},v,z={};for(v in l){var u=l[v];var E=!(v in z)||z[v]!==u;if(!(v in p)||p[v]!==u&&E)p[v]=h?h(u):u}l=p}return l}var g=["NumberFormat","DateString","DateFormat"],
e=/<\/?[^>]+>/g;return{equals:function(l,p){return l===p||"number"===typeof l&&isNaN(l)&&"number"===typeof p&&isNaN(p)||d.isFunction((l||{}).getTime)&&d.isFunction((p||{}).getTime)&&l.getTime()==p.getTime()||d.isFunction((l||{}).equals)&&l.equals(p)||d.isFunction((p||{}).equals)&&p.equals(l)||!1},mixin:d.mixin,valueOf:function(l,p){for(var v in l)if(l[v]==p)return v;return null},stripTags:function(l){if(l){var p=typeof l;if("string"===p)l=l.replace(e,"");else if("object"===p)for(var v in l)(p=l[v])&&
"string"===typeof p&&(p=p.replace(e,"")),l[v]=p}return l},substitute:function(l,p,v){if(c(v))if(d.isObject(v)){var z=v.first;var u=v.dateFormat;var E=v.numberFormat}else z=v;if(p&&"{*}"!==p)return d.replace(p,d.hitch({obj:l},function(F,y){F=y.split(":");return 1<F.length?(y=F[0],F.shift(),b(y,this.obj,F.join(":"))):u&&-1!==(u.properties||[]).indexOf(y)?b(y,this.obj,u.formatter||"DateString"):E&&-1!==(E.properties||[]).indexOf(y)?b(y,this.obj,E.formatter||"NumberFormat"):a(this.obj[y])}));p=[];var w;
p.push('\x3ctable class\x3d"esri-widget__table" summary\x3d"'+f.fieldsSummary+'"\x3e\x3ctbody\x3e');for(w in l)if(v=l[w],u&&-1!==(u.properties||[]).indexOf(w)?v=b(w,l,u.formatter||"DateString"):E&&-1!==(E.properties||[]).indexOf(w)&&(v=b(w,l,E.formatter||"NumberFormat")),p.push("\x3ctr\x3e\x3cth\x3e"+w+"\x3c/th\x3e\x3ctd\x3e"+a(v)+"\x3c/td\x3e\x3c/tr\x3e"),z)break;p.push("\x3c/tbody\x3e\x3c/table\x3e");return p.join("")},filter:function(l,p,v){p=[d.isString(l)?l.split(""):l,v||H.global,d.isString(p)?
new Function("item","index","array",p):p];v={};var z;l=p[0];for(z in l)p[2].call(p[z],l[z],z,l)&&(v[z]=l[z]);return v},startsWith:function(l,p,v){v=v||0;return l.indexOf(p,v)===v},endsWith:function(l,p,v){if("number"!==typeof v||!isFinite(v)||Math.floor(v)!==v||v>l.length)v=l.length;v-=p.length;l=l.indexOf(p,v);return-1!==l&&l===v},isDefined:c,fixJson:k,clone:h}})},"esri/layers/vectorTiles/core/Message":function(){define(["require","exports","dojo/string"],function(H,d,m){return function(){function n(q,
f,c){this instanceof n&&(this.name=q,this.message=f&&m.substitute(f,c,function(a){return null==a?"":a})||"",this.details=c)}n.prototype.toString=function(){return"["+this.name+"]: "+this.message};return n}()})},"esri/layers/vectorTiles/core/workers/Connection":function(){define(["require","exports","../promiseUtils"],function(H,d,m){return function(){function n(q){this._clientIdx=0;this._clients=q}n.prototype.broadcast=function(q,f,c){for(var a=[],b=0,k=this._clients;b<k.length;b++)a.push(k[b].invoke(q,
f,c));return a};n.prototype.close=function(){for(var q=0,f=this._clients;q<f.length;q++)f[q].close();this._clients=[]};n.prototype.invoke=function(q,f,c,a){var b=a&&a.client;if(!this._clients||!this._clients.length)return m.reject(Error("Connection closed"));null!=b&&-1!==this._clients.indexOf(b)||this._clients.some(function(k){return k.isBusy()?!1:(b=k,!0)})||(this._clientIdx=(this._clientIdx+1)%this._clients.length,b=this._clients[this._clientIdx]);q=b.invoke(q,f,c);a&&(a.client=b);return q};n.prototype.openPorts=
function(){return m.all(this._clients.map(function(q){return q.openPort()}))};return n}()})},"esri/layers/vectorTiles/core/workers/RemoteClient":function(){define("require exports dojo/Deferred ../Error ../promiseUtils ./utils".split(" "),function(H,d,m,n,q,f){function c(l,p){l["delete"](p)}var a=f.MessageType.CLOSE,b=f.MessageType.CANCEL,k=f.MessageType.INVOKE,h=f.MessageType.RESPONSE,g=f.MessageType.OPEN_PORT,e=function(){function l(p){this._timer=null;this._cancelledJobIds=new Set;this._invokeMessages=
[];this._invoke=p;this._timer=null;this._process=this._process.bind(this)}l.prototype.push=function(p){p.type===f.MessageType.CANCEL?this._cancelledJobIds.add(p.jobId):(this._invokeMessages.push(p),null===this._timer&&(this._timer=setTimeout(this._process,0)))};l.prototype.clear=function(){this._invokeMessages.length=0;this._cancelledJobIds.clear();this._timer=null};l.prototype._process=function(){this._timer=null;for(var p=0,v=this._invokeMessages;p<v.length;p++){var z=v[p];this._cancelledJobIds.has(z.jobId)||
this._invoke(z)}this._cancelledJobIds.clear();this._invokeMessages.length=0};return l}();return function(){function l(p,v,z){this._outJobs=new Map;this._inJobs=new Map;this._queue=new e(this._onInvoke.bind(this));this._onMessage=this._onMessage.bind(this);this._client=v;this._port=p;this._port.addEventListener("message",this._onMessage);this._port.start();this._channel=z}l.connect=function(p){var v=new MessageChannel;p="function"===typeof p?new p:"default"in p&&"function"===typeof p.default?new p.default:
p;p.remoteClient=new l(v.port1,p,v);return v.port2};l.prototype.close=function(){this._post({type:a});this._close()};l.prototype.isBusy=function(){return 0<this._outJobs.size};l.prototype.invoke=function(p,v,z){var u=this;if(!this._port)return q.reject(new n("remote-client:port-closed","Can't invoke(), port is closed"));var E=f.newJobId(),w=new m(function(){c(u._outJobs,E);u._post({type:b,jobId:E})});this._outJobs.set(E,w);this._post({type:k,jobId:E,methodName:p},v,z);return w.promise};l.prototype.openPort=
function(){var p=this,v=f.newJobId(),z=new m(function(){c(p._outJobs,v);p._post({type:b,jobId:v})});this._outJobs.set(v,z);this._post({type:g,jobId:v});return z.promise};l.prototype._close=function(){this._channel&&(this._channel=null);this._port.removeEventListener("message",this._onMessage);this._port.close();this._outJobs.forEach(function(p){p.cancel()});this._inJobs.clear();this._outJobs.clear();this._queue.clear();this._port=this._client=null};l.prototype._onMessage=function(p){if(p=f.receiveMessage(p))switch(p.type){case h:this._onResponse(p);
break;case k:this._queue.push(p);break;case b:this._onCancel(p);break;case a:this._close();break;case g:this._onOpenPort(p)}};l.prototype._onCancel=function(p){var v=this._inJobs,z=p.jobId,u=v.get(z);this._queue.push(p);u&&(c(v,z),u.cancel())};l.prototype._onInvoke=function(p){var v=this,z=p.methodName,u=p.jobId;p=p.data;var E=this._inJobs,w=this._client,F=w[z];try{if(!F&&z&&-1!==z.indexOf("."))for(var y=z.split("."),D=0;D<y.length-1;D++)w=w[y[D]],F=w[y[D+1]];if("function"!==typeof F)throw new TypeError(z+
" is not a function");var B=F.call(w,p,this)}catch(x){this._post({type:h,jobId:u,error:f.toInvokeError(x)});return}q.isThenable(B)?(E.set(u,B),B.then(function(x){E.has(u)&&(c(E,u),v._post({type:h,jobId:u},x))}).catch(function(x){E.has(u)&&(c(E,u),x&&"cancel"===x.dojoType||v._post({type:h,jobId:u,error:f.toInvokeError(x||{message:"Error encountered at method "+z})}))})):this._post({type:h,jobId:u},B)};l.prototype._onOpenPort=function(p){var v=new MessageChannel;new l(v.port1,this._client);this._post({type:h,
jobId:p.jobId},v.port2,[v.port2])};l.prototype._onResponse=function(p){var v=p.jobId,z=p.error;p=p.data;var u=this._outJobs;if(u.has(v)){var E=u.get(v);c(u,v);z?E.reject(n.fromJSON(JSON.parse(z))):E.resolve(p)}};l.prototype._post=function(p,v,z){return f.postMessage(this._port,p,v,z)};return l}()})},"esri/layers/vectorTiles/core/workers/utils":function(){define(["require","exports","dojo/has"],function(H,d,m){function n(f){return f&&"object"===typeof f&&("result"in f||"transferList"in f)}Object.defineProperty(d,
"__esModule",{value:!0});(function(f){f[f.HANDSHAKE=0]="HANDSHAKE";f[f.CONFIGURE=1]="CONFIGURE";f[f.CONFIGURED=2]="CONFIGURED";f[f.OPEN=3]="OPEN";f[f.OPENED=4]="OPENED";f[f.RESPONSE=5]="RESPONSE";f[f.INVOKE=6]="INVOKE";f[f.CANCEL=7]="CANCEL";f[f.CLOSE=8]="CLOSE";f[f.OPEN_PORT=9]="OPEN_PORT"})(d.MessageType||(d.MessageType={}));var q=0;d.newJobId=function(){return q++};d.isTranferableResult=n;d.toInvokeError=function(f){return f?f.toJSON?JSON.stringify(f):JSON.stringify({name:f.name,message:f.message,
details:f.details,stack:f.stack}):null};d.postMessage=function(f,c,a,b){2===arguments.length||void 0===a&&void 0===b?f.postMessage(c):(m("esri-workers-supports-transfer-arraybuffer")||(b?(b=b.filter(function(k){return!(k instanceof ArrayBuffer)}),b.length||(b=null)):n(a)&&a.transferList&&(a.transferList=a.transferList.filter(function(k){return!(k instanceof ArrayBuffer)}),a.transferList.length||(a.transferList=null))),b?(c.data=a,f.postMessage(c,b)):n(a)?(c.data=a.result,a.transferList?f.postMessage(c,
a.transferList):f.postMessage(c)):(c.data=a,f.postMessage(c)))};d.receiveMessage=function(f){return f?(f=f.data)?"string"===typeof f?JSON.parse(f):f:null:null}})},"esri/layers/vectorTiles/core/workers/WorkerOwner":function(){define("require exports dojo/Deferred ../../kernel ../Error ../Logger ../promiseUtils ./utils ./workerFactory".split(" "),function(H,d,m,n,q,f,c,a,b){var k=f.getLogger("esri.core.workers"),h=a.MessageType.CANCEL,g=a.MessageType.INVOKE,e=a.MessageType.OPEN,l=a.MessageType.OPENED,
p=a.MessageType.RESPONSE;return function(){function v(z,u){this._outJobs=new Map;this._inJobs=new Map;this.worker=z;this.id=u;z.addEventListener("message",this._onMessage.bind(this));z.addEventListener("error",function(E){E.preventDefault();k.error(E)})}v.create=function(z){return b.createWorker().then(function(u){return new v(u,z)})};v.prototype.terminate=function(){this.worker.terminate()};v.prototype.open=function(z){var u=this,E=a.newJobId(),w=new m(function(F){u._outJobs["delete"](E);u._post({type:h,
jobId:E})});this._outJobs.set(E,w);this._post({type:e,jobId:E,modulePath:z});return w.promise};v.prototype._onMessage=function(z){if(z=a.receiveMessage(z))switch(z.type){case l:case p:this._onResponse(z);break;case h:this._onCancel(z);break;case g:this._onInvoke(z)}};v.prototype._onCancel=function(z){(z=this._inJobs.get(z.jobId))&&z.cancel()};v.prototype._onInvoke=function(z){var u=this,E=z.methodName,w=z.jobId;z=z.data;var F=this._inJobs,y=n.workerMessages[E];try{if("function"!==typeof y)throw new TypeError(E+
" is not a function");var D=y.call(null,z)}catch(B){this._post({type:p,jobId:w,error:a.toInvokeError(B)});return}c.isThenable(D)?(F.set(w,D),D.then(function(B){F["delete"](w);u._post({type:p,jobId:w},B)}).catch(function(B){F["delete"](w);B||(B={message:"Error encountered at method"+E});B.dojoType&&"cancel"===B.dojoType||u._post({type:p,jobId:w,error:a.toInvokeError(B)})})):this._post({type:p,jobId:w},D)};v.prototype._onResponse=function(z){var u=z.jobId,E=z.error;z=z.data;var w=this._outJobs.get(u);
w&&(this._outJobs["delete"](u),E?w.reject(q.fromJSON(JSON.parse(E))):w.resolve(z))};v.prototype._post=function(z,u,E){return a.postMessage(this.worker,z,u,E)};return v}()})},"esri/layers/vectorTiles/core/workers/workerFactory":function(){define("require exports ../tsSupport/assignHelper dojo/_base/kernel ../../config ../../request ../Logger ../promiseUtils ../sniff ../urlUtils ./loaderConfig ./utils ./WorkerFallback".split(" "),function(H,d,m,n,q,f,c,a,b,k,h,g,e){function l(y){return a.create(function(D){function B(r){if(r=
g.receiveMessage(r))switch(r.type){case F:r=y;var t=q.workers.loaderUrl||h.DEFAULT_LOADER_URL;if(null!=q["default"]){var C=m({},q);delete C["default"];C=JSON.parse(JSON.stringify(C))}else C=JSON.parse(JSON.stringify(q));var J=q.workers.loaderConfig;J=h.default({baseUrl:J.baseUrl,locale:n.locale,has:m({"config-deferredInstrumentation":0,"dojo-test-sniff":0,"esri-cors":1,"esri-secure-context":b("esri-secure-context"),"esri-workers-supports-transfer-arraybuffer":b("esri-workers-supports-transfer-arraybuffer"),
"events-keypress-typed":0,"host-webworker":1},J.has),map:m({},J.map),paths:m({},J.paths),packages:J.packages||[]});r.postMessage({type:w,configure:{esriConfig:C,loaderUrl:t,loaderConfig:J}});break;case E:y.removeEventListener("message",B),y.removeEventListener("error",x),D(y)}}function x(r){r.preventDefault();y.removeEventListener("message",B);y.removeEventListener("error",x);z.warn("Failed to create Worker. Fallback to execute module in main thread",r);y=new e;y.addEventListener("message",B);y.addEventListener("error",
x)}y.addEventListener("message",B);y.addEventListener("error",x)})}Object.defineProperty(d,"__esModule",{value:!0});var p=k.normalize(H.toUrl("./worker.js")),v=!k.hasSameOrigin(p,location.href),z=c.getLogger("esri.core.workers"),u=null,E=g.MessageType.CONFIGURED,w=g.MessageType.CONFIGURE,F=g.MessageType.HANDSHAKE;d.createWorker=function(){if(!b("esri-workers"))return l(new e);if(!v){var y=void 0;try{y=new Worker(p)}catch(D){z.warn("Failed to create Worker. Fallback to execute module in main thread",
event),y=new e}return l(y)}u||(u=f(p,{responseType:"text"}));return u.then(function(D){return new Worker(URL.createObjectURL(new Blob([D.data],{type:"text/javascript"})))}).catch(function(D){z.warn("Failed to create Worker. Fallback to execute module in main thread",D);return new e}).then(function(D){return l(D)})}})},"esri/layers/vectorTiles/core/tsSupport/assignHelper":function(){define([],function(){return Object.assign||function(H){for(var d,m=1,n=arguments.length;m<n;m++){d=arguments[m];for(var q in d)Object.prototype.hasOwnProperty.call(d,
q)&&(H[q]=d[q])}return H}})},"esri/layers/vectorTiles/config":function(){define(["require","exports","esri/config"],function(H,d,m){Object.defineProperty(m,"workers",{get:function(){return m.defaults.workers},set:function(n){return m.defaults.workers=n}});return m})},"esri/layers/vectorTiles/request":function(){define(["require","exports","esri/request","dojo/_base/lang","dojo/Deferred"],function(H,d,m,n,q){return function(f,c){f=n.mixin({},{url:f,failOk:!0},c);"array-buffer"===c.responseType?(f.handleAs=
"arraybuffer",delete f.responseType):c.responseType&&(f.handleAs=c.responseType,delete f.responseType);null!==c.query&&(f.content=f.query,delete f.query);if(c.hasOwnProperty("allowImageDataAccess")){var a={allowImageDataAccess:c.allowImageDataAccess};delete f.allowImageDataAccess}var b=new q(function(){k.isFulfilled()||k.cancel()});var k=m(f,a).then(function(h){b.resolve({data:h})}).catch(function(h){h&&null!=h.httpCode&&(h.details=h.details||{},h.details.httpStatus=h.httpCode);b.reject(h)});return b.promise}})},
"esri/layers/vectorTiles/core/sniff":function(){define(["require","exports","dojo/sniff","./global","../views/webgl/context-util"],function(H,d,m,n,q){function f(){var k={available:!1,version:0,majorPerformanceCaveat:!1,supportsHighPrecisionFragment:!1,supportsVertexShaderSamplers:!1,supportsElementIndexUint:!1,supportsStandardDerivatives:!1},h=document.createElement("canvas");if(!h)return k;var g=q.createContext(h,{failIfMajorPerformanceCaveat:!0},"webgl");!g&&(g=q.createContext(h,{},"webgl"))&&
(k.majorPerformanceCaveat=!0);if(!g)return k;h=g.getParameter(g.VERSION);if(!h)return k;if(h=h.match(/^WebGL\s+([\d.]*)/))k.version=parseFloat(h[1]),k.available=.94<=k.version,h=g.getShaderPrecisionFormat(g.FRAGMENT_SHADER,g.HIGH_FLOAT),k.supportsHighPrecisionFragment=h&&0<h.precision,k.supportsVertexShaderSamplers=0<g.getParameter(g.MAX_VERTEX_TEXTURE_IMAGE_UNITS),k.supportsElementIndexUint=null!==g.getExtension("OES_element_index_uint"),k.supportsStandardDerivatives=null!==g.getExtension("OES_standard_derivatives");
return k}function c(){var k={available:!1,version:0},h=document.createElement("canvas");if(!h)return k;h=q.createContext(h,{},"webgl2");if(!h)return k;k.available=!0;h=h.getParameter(h.VERSION);if(!h)return k;if(h=h.match(/^WebGL\s+([\d.]*)/))k.version=parseFloat(h[1]);return k}(function(){var k=navigator.userAgent,h=k.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i);k=k.match(/iPhone/i);h&&m.add("esri-mobile",h);k&&m.add("esri-iPhone",k);m.add("esri-phonegap",!!n.cordova);
m.add("esri-cors",m("esri-phonegap")||"XMLHttpRequest"in n&&"withCredentials"in new XMLHttpRequest);m.add("esri-geolocation",function(){return!!navigator.geolocation});m.add("esri-canvas-svg-support",function(){return!(m("trident")||m("ie"))});m.add("esri-secure-context",function(){if("isSecureContext"in n)return n.isSecureContext;if(n.location&&n.location.origin)return 0===n.location.origin.indexOf("https:")});m.add("esri-wasm","WebAssembly"in n);m("host-webworker")||(m.add("esri-workers","Worker"in
n),m.add("esri-script-sandbox",function(){return"MessageChannel"in n&&"HTMLIFrameElement"in n&&"sandbox"in HTMLIFrameElement.prototype}),m.add("esri-url-encodes-apostrophe",function(){var g=n.document.createElement("a");g.href="?'";return-1<g.href.indexOf("?%27")}),a||(a=f()),m.add("esri-webgl",a.available),m.add("esri-webgl-high-precision-fragment",a.supportsHighPrecisionFragment),m.add("esri-webgl-vertex-shader-samplers",a.supportsVertexShaderSamplers),m.add("esri-webgl-element-index-uint",a.supportsElementIndexUint),
m.add("esri-webgl-standard-derivatives",a.supportsStandardDerivatives),m.add("esri-webgl-major-performance-caveat",a.majorPerformanceCaveat),m.add("esri-featurelayer-webgl-labeling",!0),b||(b=c()),m.add("esri-webgl2",b.available))})();var a=null,b=null;return m})},"esri/layers/vectorTiles/core/global":function(){define(["require","exports"],function(H,d){return function(){if("undefined"!==typeof global)return global;if("undefined"!==typeof window)return window;if("undefined"!==typeof self)return self}()})},
"esri/layers/vectorTiles/views/webgl/context-util":function(){define(["require","exports"],function(H,d){function m(c,a,b){void 0===a&&(a={});switch(b){case "webgl":var k=["webgl","experimental-webgl","webkit-3d","moz-webgl"];break;case "webgl2":k=["webgl2"];break;default:k=["webgl","experimental-webgl","webkit-3d","moz-webgl"]}b=null;for(var h=0;h<k.length;h++){var g=k[h];try{b=c.getContext(g,a)}catch(e){}if(b)break}return b}function n(c,a){(c=c.parentNode)&&(c.innerHTML='\x3ctable style\x3d"background-color: #8CE; width: 100%; height: 100%;"\x3e\x3ctr\x3e\x3ctd align\x3d"center"\x3e\x3cdiv style\x3d"display: table-cell; vertical-align: middle;"\x3e\x3cdiv style\x3d""\x3e'+
a+"\x3c/div\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e")}Object.defineProperty(d,"__esModule",{value:!0});d.createContextOrErrorHTML=function(c,a,b){void 0===a&&(a={});if(!window.WebGLRenderingContext)return n(c,q),null;a=m(c,a,b);return a?a:(n(c,f),null)};d.createContext=m;var q='This page requires a browser that supports WebGL.\x3cbr/\x3e\x3ca href\x3d"http://get.webgl.org"\x3eClick here to upgrade your browser.\x3c/a\x3e',f='It doesn\'t appear your computer can support WebGL.\x3cbr/\x3e\x3ca href\x3d"http://get.webgl.org/troubleshooting/"\x3eClick here for more information.\x3c/a\x3e'})},
"esri/layers/vectorTiles/core/urlUtils":function(){define(["require","exports","esri/urlUtils","dojo/_base/url"],function(H,d,m,n){function q(w){return m.normalize(w)}function f(w){return"data:"===w.slice(0,5)}function c(w){return a(w)||u.test(w)}function a(w){return w&&"/"===w[0]&&"/"===w[1]}function b(w){return m.urlToObject(w)}function k(w){if("string"===typeof w)return new n(g(w));w.scheme||(w.scheme=d.appUrl.scheme);return w}function h(w){if(f(w))return null;var F=w.indexOf("://");if(-1===F&&
a(w))F=2;else if(-1!==F)F+=3;else return null;F=w.indexOf("/",F);return-1===F?w:w.slice(0,F)}function g(w,F,y){void 0===F&&(F=d.appBaseUrl);if(a(w))return y&&y.preserveProtocolRelative?w:"http"===d.appUrl.scheme&&d.appUrl.authority===h(w).slice(2)?"http:"+w:"https:"+w;if(u.test(w))return w;"/"===w[0]&&(y=F.indexOf("//"),y=F.indexOf("/",y+2),F=-1===y?F:F.slice(0,y));return l(F,w)}function e(w,F,y){void 0===y&&(y=!1);w=k(w);F=k(F);return y||w.scheme===F.scheme?w.host.toLowerCase()===F.host.toLowerCase()&&
w.port===F.port:!1}function l(){for(var w=[],F=0;F<arguments.length;F++)w[F]=arguments[F];if(w&&w.length){F=[];if(c(w[0])){var y=w[0],D=y.indexOf("//");F.push(y.slice(0,D+1));z.test(w[0])&&(F[0]+="/");w[0]=y.slice(D+2)}else"/"===w[0][0]&&F.push("");w=w.reduce(function(B,x){return x?B.concat(x.split("/")):B},[]);for(y=0;y<w.length;y++)D=w[y],".."===D&&0<F.length?F.pop():!D||"."===D&&0!==F.length||F.push(D);return F.join("/")}}function p(w,F,y){if(!(F&&y&&w&&c(w)))return w;var D=w.indexOf("//"),B=w.indexOf("/",
D+2),x=w.indexOf(":",D+2);B=Math.min(0>B?w.length:B,0>x?w.length:x);if(w.slice(D+2,B).toLowerCase()!==F.toLowerCase())return w;F=w.slice(0,D+2);w=w.slice(B);return""+F+y+w}function v(w,F,y){void 0===F&&(F=d.appBaseUrl);if(!c(w))return w;var D=q(w),B=D.toLowerCase();F=q(F).toLowerCase().replace(/\/+$/,"");if((y=y?q(y).toLowerCase().replace(/\/+$/,""):null)&&0!==F.indexOf(y))return w;for(var x=function(C,J,L){L=C.indexOf(J,L);return-1===L?C.length:L},r=x(B,"/",B.indexOf("//")+2),t=-1;B.slice(0,r+1)===
F.slice(0,r)+"/";){t=r+1;if(r===B.length)break;r=x(B,"/",r+1)}if(-1===t||y&&t<y.length)return w;w=D.slice(t);D=F.slice(t-1).replace(/[^/]+/g,"").length;if(0<D)for(B=0;B<D;B++)w="../"+w;else w="./"+w;return w}Object.defineProperty(d,"__esModule",{value:!0});d.normalize=q;d.canUseXhr=function(w){return m.canUseXhr(w)};d.removeTrailingSlash=function(w){return w.replace(/\/+$/,"")};H=Function("return this")();d.appUrl=new n(H.location);d.appBaseUrl=function(){var w=d.appUrl.path;w=w.substring(0,w.lastIndexOf(w.split("/")[w.split("/").length-
1]));return d.appUrl.scheme+"://"+d.appUrl.host+(null!=d.appUrl.port?":"+d.appUrl.port:"")+w}();var z=/^\s*file:/i,u=/^\s*[a-z][a-z0-9-+.]*:[^0-9]/i;d.isDataProtocol=f;d.isAbsolute=c;d.isProtocolRelative=a;d.urlToObject=b;d.getOrigin=h;d.makeAbsolute=g;d.hasSameOrigin=e;d.join=l;d.removeFile=function(w){var F=0;if(c(w)){var y=w.indexOf("//");-1!==y&&(F=y+2)}y=w.lastIndexOf("/");return y<F?w:w.slice(0,y+1)};d.addProxy=function(w){return m.addProxy(w)};d.makeData=function(w){return w.isBase64?"data:"+
w.mediaType+";base64,"+w.data:"data:"+w.mediaType+","+w.data};var E=/^data:(.*?)(;base64)?,(.*)$/;d.dataComponents=function(w){return(w=w.match(E))?{mediaType:w[1],isBase64:!!w[2],data:w[3]}:null};d.changeDomain=p;d.read=function(w,F){var y=F&&F.url&&F.url.path;w&&y&&(w=g(w,y,{preserveProtocolRelative:!0}));(F=F&&F.portal)&&!F.isPortal&&F.urlKey&&F.customBaseUrl?(y=F.urlKey+"."+F.customBaseUrl,F=e(d.appUrl,d.appUrl.scheme+"://"+y)?p(w,F.portalHostname,y):p(w,y,F.portalHostname)):F=w;return F};d.write=
function(w,F){if(!w)return w;!c(w)&&F&&F.blockedRelativeUrls&&F.blockedRelativeUrls.push(w);var y=g(w);if(F){var D=F.verifyItemRelativeUrls&&F.verifyItemRelativeUrls.rootPath||F.url&&F.url.path;D&&(y=v(y,D,D),y!==w&&F.verifyItemRelativeUrls&&F.verifyItemRelativeUrls.writtenUrls.push(y))}w=y;y=(F=F&&F.portal)&&!F.isPortal&&F.urlKey&&F.customBaseUrl?p(w,F.urlKey+"."+F.customBaseUrl,F.portalHostname):w;return y};d.makeRelative=v;d.removeQueryParameters=function(w){w=b(w);Object.keys(w.query||{});return w.path}})},
"esri/layers/vectorTiles/core/workers/loaderConfig":function(){define(["require","exports","../tsSupport/assignHelper","dojo/has","../urlUtils"],function(H,d,m,n,q){Object.defineProperty(d,"__esModule",{value:!0});d.DEFAULT_LOADER_URL=q.makeAbsolute(q.removeQueryParameters(H.toUrl("./worker-init.js")));d.DEFAULT_CONFIG={baseUrl:function(){var f=q.removeQueryParameters(H.toUrl("dojo/x.js"));return q.makeAbsolute(f.slice(0,f.length-5))}(),packages:[{name:"esri"},{name:"dojo"},{name:"dojox"},{name:"dstore"},
{name:"moment",main:"moment"},{name:"@dojo"},{name:"cldrjs",main:"dist/cldr"},{name:"globalize",main:"dist/globalize"},{name:"maquette",main:"dist/maquette.umd"},{name:"maquette-css-transitions",main:"dist/maquette-css-transitions.umd"},{name:"maquette-jsx",main:"dist/maquette-jsx.umd"},{name:"tslib",main:"tslib"}],map:{globalize:{cldr:"cldrjs/dist/cldr","cldr/event":"cldrjs/dist/cldr/event","cldr/supplemental":"cldrjs/dist/cldr/supplemental","cldr/unresolved":"cldrjs/dist/cldr/unresolved"}}};d.default=
function(f){var c={async:f.async,isDebug:f.isDebug,locale:f.locale,baseUrl:f.baseUrl,has:m({},f.has),map:m({},f.map),packages:f.packages&&f.packages.concat()||[],paths:m({},f.paths)};f.hasOwnProperty("async")||(c.async=!0);f.hasOwnProperty("isDebug")||(c.isDebug=!1);f.baseUrl||(c.baseUrl=d.DEFAULT_CONFIG.baseUrl);d.DEFAULT_CONFIG.packages.forEach(function(h){a:{for(var g=c.packages,e=0;e<g.length;e++)if(g[e].name===h.name)break a;h=m({},h);e=q.removeQueryParameters(H.toUrl(h.name+"/x.js"));e=e.slice(0,
e.length-5);h.location=q.makeAbsolute(e);g.push(h)}});f=c.map=c.map||{};for(var a=0,b=Object.keys(d.DEFAULT_CONFIG.map);a<b.length;a++){var k=b[a];f[k]||(f[k]=d.DEFAULT_CONFIG.map[k])}return c}})},"esri/layers/vectorTiles/core/workers/WorkerFallback":function(){define(["require","exports","dojo/has","../global","./utils"],function(H,d,m,n,q){var f=function(){return function(){var b=this,k=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach(function(h){b[h]=
function(){for(var g=[],e=0;e<arguments.length;e++)g[e]=arguments[e];return k[h].apply(k,g)}})}}(),c=n.MutationObserver||n.WebKitMutationObserver,a=function(){if(n.process&&n.process.nextTick)var b=function(g){n.process.nextTick(g)};else if(n.Promise)b=function(g){n.Promise.resolve().then(g)};else if(c){var k=[],h=document.createElement("div");(new c(function(){for(;0<k.length;)k.shift()()})).observe(h,{attributes:!0});b=function(g){k.push(g);h.setAttribute("queueStatus","1")}}return b}();return function(){function b(){this._dispatcher=
new f;this._isInitialized=!1;this._workerPostMessage({type:q.MessageType.HANDSHAKE})}b.prototype.terminate=function(){};Object.defineProperty(b.prototype,"onmessage",{get:function(){return this._onmessageHandler},set:function(k){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler);(this._onmessageHandler=k)&&this.addEventListener("message",k)},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"onerror",{get:function(){return this._onerrorHandler},set:function(k){this._onerrorHandler&&
this.removeEventListener("error",this._onerrorHandler);(this._onerrorHandler=k)&&this.addEventListener("error",k)},enumerable:!0,configurable:!0});b.prototype.postMessage=function(k,h){var g=this;a(function(){g._workerMessageHandler(new MessageEvent("message",{data:k}))})};b.prototype.dispatchEvent=function(k){return this._dispatcher.dispatchEvent(k)};b.prototype.addEventListener=function(k,h,g){this._dispatcher.addEventListener(k,h,g)};b.prototype.removeEventListener=function(k,h,g){this._dispatcher.removeEventListener(k,
h,g)};b.prototype._workerPostMessage=function(k,h){var g=this;a(function(){g.dispatchEvent(new MessageEvent("message",{data:k}))})};b.prototype._workerMessageHandler=function(k){var h=this;if(k=q.receiveMessage(k)){var g=k.jobId;switch(k.type){case q.MessageType.CONFIGURE:this._isInitialized||this._workerPostMessage({type:q.MessageType.CONFIGURED});break;case q.MessageType.OPEN:k=k.modulePath,m("esri-webpack")?H(["esri/core/workers/RemoteClient","esri/views/vectorTiles/WorkerTileHandler","esri/views/2d/layers/features/Pipeline",
"esri/views/3d/layers/PointCloudWorker","esri/views/3d/layers/SceneLayerWorker","esri/layers/graphics/sources/support/CSVSourceWorker","esri/views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker",k],function(e,l,p,v,z,u,E,w){switch(w){case "esri/views/vectorTiles/WorkerTileHandler":break;case "esri/views/2d/layers/features/Pipeline":l=p;break;case "esri/views/3d/layers/PointCloudWorker":l=v;break;case "esri/views/3d/layers/SceneLayerWorker":l=z;break;case "esri/layers/graphics/sources/support/CSVSourceWorker":l=
u;break;case "esri/views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker":l=E;break;default:l=w}e=e.connect(l);h._workerPostMessage({type:q.MessageType.OPENED,jobId:g,data:e})}):H(["./RemoteClient",k],function(e,l){e=e.connect(l);h._workerPostMessage({type:q.MessageType.OPENED,jobId:g,data:e})})}}};return b}()})},"esri/layers/vectorTiles/core/requireUtils":function(){define(["require","exports","dojo/Deferred"],function(H,d,m){function n(q,f){if(Array.isArray(f)){var c=new m;q(f,function(){for(var a=
[],b=0;b<arguments.length;b++)a[b]=arguments[b];c.resolve(a)});return c.promise}return n(q,[f]).then(function(a){return a[0]})}Object.defineProperty(d,"__esModule",{value:!0});d.when=n;d.getAbsMid=function(q,f,c){return f.toAbsMid?f.toAbsMid(q):c.id.replace(/\/[^\/]*$/gi,"/")+q}})},"esri/layers/rasterLib/function/rasterFunctionHelper":function(){define(["dojo/_base/declare","dojo/_base/lang","./rasterFunctionRegistry"],function(H,d,m){return{create:function(n,q){if(n){var f=n.renderTexture,c=Object.keys(n);
if(n.read&&!q)return n;n.read&&q&&(n=n.toJson());-1<c.indexOf("name")&&c.indexOf(!1)?(n=d.mixin({},n),q=this._parseV2(n,q)):(n="esri.layers.RasterFunction"===n.declaredClass?n.toJson():d.mixin({},n),q=this._parseV1(n,q));q.branchCount=q.updateBranchStructure();q.renderTexture||(q.renderTexture=!!f);return q}},_parseV1:function(n,q){var f=n.rasterFunction,c=n.rasterFunctionArguments,a=n.renderTexture||n.rasterFunctionArguments.renderTexture||!1,b,k,h,g,e,l,p;(g=c.raster||c.Raster)&&g.rasterFunction&&
(b=this._parseV1(g,q));(g=c.raster2||c.Raster2)&&g.rasterFunction&&(k=this._parseV1(g,q));(g=c.rasters||c.Rasters)&&0<g.length&&(h=g.map(d.hitch(this,function(v){return v&&v.rasterFunction?this._parseV1(v,q):v})));(g=c.dem||c.DEM)&&(g.functionName||g.rasterFunction)&&(e=this._parseV1(g,q));(g=c.fillRaster||c.FillRaster)&&(g.functionName||g.rasterFunction)&&(l=this._parseV1(g,q));g=m.functions[f];if(!g)return console.error("Function is not currently supported: "+f),null;f=new g(c);f.variableName&&
(g=c[f.variableName])&&(g.functionName||g.rasterFunction)&&(p=this._parseV1(g,q));n.outputPixelType&&(f.pixelType=n.outputPixelType);"$$"===b?f.functionArguments.raster=q&&q.raster:null!=b?f.functionArguments.raster=b:f.functionArguments.raster||(f.functionArguments.raster=q&&q.raster);null!=k&&(f.functionArguments.raster2=k);null!=h&&(f.functionArguments.rasters=h.map(function(v){"$$"===v&&(v=q&&q.raster);return v}));null!=e&&(f.functionArguments.dem=e);null!=l&&(f.functionArguments.fillRaster=l);
null!=p&&(f.functionArguments[f.variableName]=p);f.renderTexture=a;return f},_parseV2:function(n,q){if(!n)return null;n=d.clone(n);this._bindV2Args(n,q);var f={};this._convertTov1(n,f);return this._parseV1(f,q)},_bindV2Args:function(n,q){(n||q)&&Object.keys(n).forEach(function(f){n[f]["function"]&&n[f].arguments?this._bindV2Args(n[f].arguments,q):null!=q[n[f].name]&&(n[f].value=q[n[f].name])}.bind(this))},_convertV2Types:function(n){if(!n)return null;"ArgumentArray"===n.type?n.elements&&"RasterStatistics"===
n.elements[0].type&&(n=n.elements):n instanceof Array&&0===n.length&&(n=null);return n},_convertTov1:function(n,q){if((n||q)&&n["function"]){var f=n["function"],c=n.arguments;q.rasterFunction=f.type.replace("Function","");q.outputPixelType="UNKNOWN"===f.pixelType?"Unknown":f.pixelType;q.rasterFunctionArguments={};var a;Object.keys(c).forEach(function(b){c[b]["function"]&&c[b].arguments?(q.rasterFunctionArguments[b]={},this._convertTov1(c[b],q.rasterFunctionArguments[b])):(a=c[b].value,q.rasterFunctionArguments[b]=
"object"!==typeof a||a.functionArguments?a:this._convertV2Types(a))}.bind(this))}}}})},"esri/layers/rasterLib/function/rasterFunctionRegistry":function(){define("dojo/_base/declare dojo/_base/lang ../../rasterLib/function/AspectFunction ../../rasterLib/function/BandArithmeticFunction ../../rasterLib/function/ColormapFunction ../../rasterLib/function/CompositeBandFunction ../../rasterLib/function/ContrastBrightnessFunction ../../rasterLib/function/ConvolutionFunction ../../rasterLib/function/ExtractBandFunction ../../rasterLib/function/HillshadeFunction ../../rasterLib/function/LocalFunction ../../rasterLib/function/MaskFunction ../../rasterLib/function/NDVIFunction ../../rasterLib/function/SlopeFunction ../../rasterLib/function/StretchFunction ../../rasterLib/function/RemapFunction ../../rasterLib/function/IdentityFunction ../../rasterLib/function/ResampleFunction".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u){return function(){function E(D){D.prototype.supportWebGL&&(F[D.prototype.functionName]=D);D.prototype.support2D&&(w[D.prototype.functionName]=D);y[D.prototype.functionName]=D}var w={},F={},y={};E(m);E(n);E(q);E(f);E(c);E(a);E(b);E(k);E(h);E(g);E(e);E(l);E(p);E(v);E(z);E(u);return{cpu:w,gpu:F,functions:y,register:E,getFunction:function(D){return y[D]},support:function(D,B){return!!("gpu"===B?F:"cpu"===B?w:y)[D]}}}()})},"esri/layers/rasterLib/function/AspectFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../../WKIDUnitConversion ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./surfaceUtils".split(" "),
function(H,d,m,n,q,f,c,a){return H([m,c],{declaredClass:"esri.layers.rasterLib.function.AspectFunction",functionName:"Aspect",supportWebGL:!0,support2D:!0,constructor:function(b){this.functionArguments=this.mixinIgnoreCase({raster:null},b)},bind:function(){var b=this.getSourceRasterInfo();if(!b.raster)return Error("The raster input to aspect function is invalid.");this.rasterInfo=d.mixin(b.raster,{bandCount:1,pixelType:this._calculatePixelType(this.pixelType,"F32"),statistics:[{min:0,max:360}],histograms:null});
this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Generic";return!0},read2D:function(b){this._performance.start();b=a.aspect(b.raster);this._addPerformanceMetric(this._performance.elapsed());return b},readGL:function(b){this._performance.start();this._initializeProgram({fragment:f.aspect,fragmentName:"Aspect"});var k=this._setupTextureData(b.raster),h=this.bindFrameBuffer(),g=this.gl,e=g.drawingBufferWidth;g=g.drawingBufferHeight;var l=k.extent;
this._setUniforms({u_resolution:b&&b.raster&&b.raster.pixelBlock?[1/b.raster.pixelBlock.width,1/b.raster.pixelBlock.height]:[1/e,1/g],u_cellSize:[(l.xmax-l.xmin)/e,(l.ymax-l.ymin)/g]});this._bindTexture(k.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:k.extent,texture:h.texture}}})})},"esri/layers/rasterLib/function/RasterFunctionX":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/config ../raster/RasterInfo ../../../geometry/Extent ../../PixelBlock".split(" "),
function(H,d,m,n,q,f){return H(null,{functionName:null,functionArguments:null,pixelType:"Unknown",rasterInfo:null,constructor:function(c){c&&(this.pixelType=c.outputPixelType||c.OutputPixelType||this.pixelType,this.renderTexture=c.renderTexture,this._initFunction())},mixinIgnoreCase:function(c,a){var b=Object.keys(c),k=Object.keys(a),h,g,e=b.length;for(h=0;h<k.length;h++){var l=a[k[h]];if(null!=l)for(g=0;g<e;g++)if(b[g].toLowerCase()===k[h].toLowerCase()){c[b[g]]=l;break}}return c},bind:function(c){},
setProcessingContext:function(c){if(!c)throw"cannot bind to layer without options";this.useWebGL=!!c.useWebGL;this._tileMode=!!c.tileMode;this._glSetting=c.glSetting;this._rawRasterInfo=c.rawRasterInfo;this._xformSetting=c.xformSetting||this._xformSetting;if(!this.useWebGL||this._glSetting&&this._glSetting.gl){this.gl=this.useWebGL?this._glSetting.gl:null;this._glSetting&&(this._glSetting.pingpong=null,this._glSetting.branches=null);var a=this.functionArguments.raster,b=this.functionArguments.raster2,
k=this.functionArguments.dem,h=this.functionArguments.fillRaster,g=this.functionArguments.rasters;a&&a.functionArguments&&a.setProcessingContext(c);b&&b.functionArguments&&b.setProcessingContext(c);k&&k.functionArguments&&k.setProcessingContext(c);h&&h.functionArguments&&h.setProcessingContext(c);if(g)for(a=0;a<g.length;a++)g[a]&&g[a].functionArguments&&g[a].setProcessingContext(c);this.bind()}},updateBranchStructure:function(){var c=0,a=this.functionArguments;a.raster&&a.raster.read&&a.raster.functionArguments&&
(c+=a.raster.updateBranchStructure());a.raster2&&a.raster2.read&&a.raster2.functionArguments&&(c+=a.raster2.updateBranchStructure(),a.raster2.isBranch=!0,a.raster&&a.raster.read&&(a.raster.isBranch=!0));a.rasters&&(c=a.rasters.length,a.rasters.forEach(function(b){b.read&&b.functionArguments&&(b.isBranch=!0)}));a.dem&&a.dem.read&&a.dem.functionArguments&&(c+=a.dem.updateBranchStructure());return 1===c?0:c},read:function(c){c=this.processRasterArgument(c);return this.useWebGL?this.readGL(c):this.read2D(c)},
hasTilingEffects:function(){return!1},read2D:function(){},readGL:function(){},getSourceRasterInfo:function(){var c,a={};if(this.functionArguments.raster2)a.functionArguments.raster=this._bindRaster(this.functionArguments.raster),a.functionArguments.raster2=this._bindRaster(this.functionArguments.raster2);else if(this.functionArguments.rasters)for(a.rasters=[],c=0;c<this.functionArguments.rasters.length;c++)a.rasters[c]=this._bindRaster(this.functionArguments.rasters[c]);else a.raster=this._bindRaster(this.functionArguments.raster);
return this.sourceRasterInfo=a},processRasterArgument:function(c){var a=this.bind();if(!0!==a)throw a;var b={};if(this.functionArguments.raster2)b.raster=this._readRaster(this.functionArguments.raster,c),b.raster2=this._readRaster(this.functionArguments.raster2,c);else if(this.functionArguments.rasters)for(b.rasters=[],a=0;a<this.functionArguments.rasters.length;a++)b.rasters[a]=this._readRaster(this.functionArguments.rasters[a],c);else b.raster=this._readRaster(this.functionArguments.raster,c);return b},
toJson:function(){var c=this.functionArguments,a=c.raster,b=c.raster2;c=c.rasters;a=a?a.toJson?a.toJson():a:null;b=b?b.toJson?b.toJson():b:null;var k;c&&0<c.length&&(k=c.map(function(h){return h.toJson?h.toJson():h}));c=d.mixin({},this.functionArguments);c.raster=a;c.raster2=b;c.rasters=k;c=this._fixRasterFunctionJson(c);return{rasterFunction:this.functionName,rasterFunctionArguments:c,outputPixelType:this.pixelType}},_initFunction:function(c){},_getIntegerRange:function(c){switch(c){case "U8":var a=
[0,255];break;case "U16":a=[0,65535];break;case "U32":a=[0,4294967295];break;case "S8":a=[-128,127];break;case "S16":a=[-32768,32767];break;case "S32":a=[-2147483648,2147483647]}return a},_calculatePixelType:function(c,a){return c&&"unknown"!==c.toLowerCase()?c:a},_clonePixelData:function(c){if(null==c)return c;var a={};c.extent&&(a.extent=new q(c.extent.xmin,c.extent.ymin,c.extent.xmax,c.extent.ymax,c.extent.spatialReference));c=c.pixelBlock;if(null==c)return a;a.pixelBlock=c.clone?c.clone():f.prototype.clone(c);
return a},_readRaster:function(c,a){if(null==c||"$$"===c)var b=this._clonePixelData(a.src[Object.keys(a.src)[0]]);else c&&c.rasterInfo&&!c.functionArguments?b=this._clonePixelData(a.src[c._rasterId]):isNaN(c)?c.read&&(b=c.functionArguments?c.read(a):this._clonePixelData(a)):(b=a.src?a.src[Object.keys(a.src)[0]]:a,a=b.pixelBlock,a=new Float32Array(a.width*a.height),a.fill(parseFloat(c)),b=this._clonePixelData(b),b.pixelBlock.pixels=[a],b.isConstant=!0);return b},_bindRaster:function(c){if(c&&"$$"!==
c)isNaN(c)?c.rasterInfo?a=c.rasterInfo:c.bind&&c.bind()&&(a=c.rasterInfo):a={};else var a=this._rawRasterInfo;a&&(a=a.clone?a.clone():new n(a),a.bandCount=a.bandCount||3);return a},_getOutputBand:function(c,a){switch(c){case "U8":c=new Uint8Array(a);break;case "U16":c=new Uint16Array(a);break;case "U32":c=new Uint32Array(a);break;case "S8":c=new Int8Array(a);break;case "S16":c=new Int16Array(a);break;case "S32":c=new Int32Array(a);break;case "U32":c=new Uint32Array(a);break;case "F32":c=new Float32Array(a);
break;case "F64":c=new Float64Array(a);break;default:c=new Float32Array(a)}return c},_clampBand:function(c,a,b){if(("F64"===a||"F32"===a)&&!b)return c;var k,h=this._getIntegerRange(a),g=c.length;if(h)for(b=h[1],h=h[0],a=this._getOutputBand(a,g),k=0;k<g;k++){var e=c[k];a[k]=e>b?b:e<h?h:e}else a=c;return a},_performance:{start:function(){return this._start=self.performance&&self.performance.now()||new Date}.bind(this),elapsed:function(){return(self.performance&&self.performance.now()||new Date)-this._start}.bind(this)},
_addPerformanceMetric:function(c){m.isDebug&&(self.rasterFunctionPerformance||(self.rasterFunctionPerformance=[]),self.rasterFunctionPerformance.push(c),50<self.rasterFunctionPerformance.length&&self.rasterFunctionPerformance.shift())},_fixRasterFunctionJson:function(c){for(var a in c)c.hasOwnProperty(a)&&(null==c[a]?delete c[a]:c[a]instanceof Object&&!c[a].sourceType&&this._fixRasterFunctionJson(c[a],!0));return c}})})},"esri/layers/rasterLib/function/pixelShaders":function(){define(["dojo/_base/declare",
"dojo/_base/lang","./pixelShaderScripts"],function(H,d,m){H={shaderType:"fragment",getShader:function(n,q){var f=n.createShader(n.FRAGMENT_SHADER);n.shaderSource(f,q);n.compileShader(f);n.getShaderParameter(f,n.COMPILE_STATUS)||(f=null);return f}};d.mixin(H,m);return H})},"esri/layers/rasterLib/function/pixelShaderScripts":function(){define([],function(){return{aspect:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform vec2 u_resolution;\nuniform vec2 u_cellSize;\nfloat getNeighborHoodAlpha(float a, float b, float c, float d, float e, float f, float g, float h, float i){\nif (a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0 || a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0 || a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0) {\nreturn 0.0;\n}\nelse {\nreturn e;\n}\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\nfloat pi \x3d 3.141592653589793238;\nfloat dz_dx \x3d 0.0;\nfloat dz_dy \x3d 0.0;\nvec4 va, vb, vc,vd,ve,vf,vg,vh,vi;\nvec2 axy \x3d vec2(-1.0,-1.0);\nvec2 bxy \x3d vec2(0.0, -1.0);\nvec2 cxy \x3d vec2(1.0, -1.0);\nvec2 dxy \x3d vec2(-1.0, 0.0);\nvec2 fxy \x3d vec2(1.0, 0.0);\nvec2 gxy \x3d vec2(-1.0, 1.0);\nvec2 hxy \x3d vec2(0.0, 1.0);\nvec2 ixy \x3d vec2(1.0, 1.0);\nif (v_texCoord.s \x3c u_resolution.s)\n{\naxy[0] \x3d 1.0;\ndxy[0] \x3d 1.0;\ngxy[0] \x3d 1.0;\n}\nif (v_texCoord.t \x3c u_resolution.t)\n{\naxy[1] \x3d 1.0;\nbxy[1] \x3d 1.0;\ncxy[1] \x3d 1.0;\n}\nif (v_texCoord.s \x3e1.0-u_resolution.s)\n{\ncxy[0] \x3d -1.0;\nfxy[0] \x3d -1.0;\nixy[0] \x3d -1.0;\n}\nif (v_texCoord.t \x3e 1.0- u_resolution.t)\n{\ngxy[1] \x3d -1.0;\nhxy[1] \x3d -1.0;\nixy[1] \x3d -1.0;\n}\nif (v_texCoord.s \x3e\x3d u_resolution.s \x26\x26 (1.0-u_resolution.s)\x3e\x3dv_texCoord.s \x26\x26 v_texCoord.t \x3e\x3d u_resolution.t \x26\x26 (1.0-u_resolution.t)\x3e\x3dv_texCoord.t)\n{\nva \x3d texture2D(u_image, v_texCoord + u_resolution* axy);\nvb \x3d texture2D(u_image, v_texCoord + u_resolution* bxy);\nvc \x3d texture2D(u_image, v_texCoord + u_resolution* cxy);\nvd \x3d texture2D(u_image, v_texCoord + u_resolution* dxy);\nve \x3d texture2D(u_image, v_texCoord + u_resolution* vec2(0, 0));\nvf \x3d texture2D(u_image, v_texCoord + u_resolution* fxy);\nvg \x3d texture2D(u_image, v_texCoord + u_resolution* gxy);\nvh \x3d texture2D(u_image, v_texCoord + u_resolution* hxy);\nvi \x3d texture2D(u_image, v_texCoord + u_resolution* ixy);\n}\ndz_dx \x3d (vc+2.0*vf+vi - va - 2.0*vd - vg).r/(8.0*u_cellSize[0]);\ndz_dy \x3d -(vg+2.0*vh+vi - va - 2.0*vb - vc).r/(8.0*u_cellSize[1]);\nfloat alpha \x3d getNeighborHoodAlpha(va.a, vb.a, vc.a, vd.a, ve.a, vf.a, vg.a, vh.a, vi.a);\nfloat aspect_rad \x3d 0.0;\nif (dz_dx \x3d\x3d 0.0)\n{\nif (dz_dy \x3e 0.0)\naspect_rad \x3d 0.5 * pi;\nelse if (dz_dy \x3c 0.0)\naspect_rad \x3d 1.5 * pi;\nelse\nalpha \x3d 0.0;//undefined make it nodata\n}\nelse\n{\naspect_rad \x3d 0.5*pi + atan(dz_dy, -dz_dx);\nif (aspect_rad \x3c 0.0)\naspect_rad \x3d 2.0*pi + aspect_rad;\n}\nfloat aspect \x3d aspect_rad * 180.0 / pi;\ngl_FragColor \x3d vec4(aspect, aspect, aspect, alpha);\n}",
bandArithmetic:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform int u_bandId_nir;\nuniform int u_bandId_red;\nuniform bool u_scaled;\nuniform int u_bandCount;\nuniform int u_method;\nuniform float u_constants[6];\nvec4 calculateNDVI() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat red \x3d float(u_bandId_red \x3d\x3d 0 ? currentPixel.r : (u_bandId_red \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat nir \x3d float(u_bandId_nir \x3d\x3d 0 ? currentPixel.r : (u_bandId_nir \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat ndvi_denom \x3d nir + red;\nfloat ndvi;\nif (ndvi_denom \x3d\x3d 0.0) {\nndvi \x3d 0.0;\n} else {\nndvi \x3d (nir - red) / ndvi_denom;\nif (u_scaled) {\nndvi \x3d float(floor(ndvi * 100.0 + 100.5));\n}\n}\nreturn vec4(ndvi, ndvi, ndvi, currentPixel.a);\n}\nvec4 calculateSAVI() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat red \x3d float(u_bandId_red \x3d\x3d 0 ? currentPixel.r : (u_bandId_red \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat nir \x3d float(u_bandId_nir \x3d\x3d 0 ? currentPixel.r : (u_bandId_nir \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat savi_denom \x3d nir + red + u_constants[0];\nfloat savi;\nif (savi_denom \x3d\x3d 0.0) {\nsavi \x3d 0.0;\n} else {\nsavi \x3d (nir - red) / savi_denom * (1.0 + u_constants[0]);\n}\nreturn vec4(savi, savi, savi, currentPixel.a);\n}\nvec4 calculateMSAVI() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat red \x3d float(u_bandId_red \x3d\x3d 0 ? currentPixel.r : (u_bandId_red \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat nir \x3d float(u_bandId_nir \x3d\x3d 0 ? currentPixel.r : (u_bandId_nir \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat msavi \x3d 0.5 * (2.0 * (nir + 1.0) - sqrt(pow((2.0 * nir + 1.0), 2.0) - 8.0 * (nir - red)));\nreturn vec4(msavi, msavi, msavi, currentPixel.a);\n}\nvec4 calculateTSAVI() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat red \x3d float(u_bandId_red \x3d\x3d 0 ? currentPixel.r : (u_bandId_red \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat nir \x3d float(u_bandId_nir \x3d\x3d 0 ? currentPixel.r : (u_bandId_nir \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat s \x3d u_constants[0];\nfloat a \x3d u_constants[1];\nfloat x \x3d u_constants[2];\nfloat tsavi_denom \x3d a * nir + red - a * s + x * (1.0 + s * s);\nfloat tsavi;\nif (tsavi_denom \x3d\x3d 0.0) {\ntsavi \x3d 0.0;\n} else {\ntsavi \x3d s * (nir - s * red - a) / tsavi_denom;\n}\nreturn vec4(tsavi, tsavi, tsavi, currentPixel.a);\n}\nvec4 calculatePVI() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat red \x3d float(u_bandId_red \x3d\x3d 0 ? currentPixel.r : (u_bandId_red \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat nir \x3d float(u_bandId_nir \x3d\x3d 0 ? currentPixel.r : (u_bandId_nir \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat a \x3d u_constants[0];\nfloat b \x3d u_constants[1];\nfloat pvi \x3d (nir - a * red - b) / sqrt(1.0 + a * 2.0);\nreturn vec4(pvi, pvi, pvi, currentPixel.a);\n}\nvec4 calculateGEMI() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat red \x3d float(u_bandId_red \x3d\x3d 0 ? currentPixel.r : (u_bandId_red \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat nir \x3d float(u_bandId_nir \x3d\x3d 0 ? currentPixel.r : (u_bandId_nir \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat gemi;\nif (red \x3d\x3d 1.0) {\ngemi \x3d 0.0;\n} else {\nfloat eta \x3d (2.0 * (nir * nir - red * red) + 1.5 * nir + 0.5 * red) / (nir + red + 0.5);\nfloat gemi \x3d eta * (1.0 - 0.25*eta) - (red - 0.125) / (1.0 - red);\n}\nreturn vec4(gemi, gemi, gemi, currentPixel.a);\n}\nvec4 calculateVARI() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat red \x3d float(currentPixel.r);\nfloat green \x3d float(currentPixel.g);\nfloat blue \x3d float(currentPixel.b);\nfloat vari \x3d (green - red) /(green + red - blue);\nreturn vec4(vari, vari, vari, currentPixel.a);\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\nvec4 pv;\nif (u_method \x3c 4) {\nif (u_method \x3d\x3d 1) {\npv \x3d calculateNDVI();\n} else if (u_method \x3d\x3d 2) {\npv \x3d calculateSAVI();\n} else if (u_method \x3d\x3d 3) {\npv \x3d calculateTSAVI();\n} else if (u_method \x3d\x3d 4) {\npv \x3d calculateMSAVI();\n}\n} else {\nif (u_method \x3d\x3d 5) {\npv \x3d calculateGEMI();\n} else if (u_method \x3d\x3d 6) {\npv \x3d calculatePVI();\n} else if (u_method \x3d\x3d 7) {\npv \x3d calculateGEMI();\n} else if (u_method \x3d\x3d 9) {\npv \x3d calculateVARI();\n}\n}\ngl_FragColor \x3d pv;\n}",
colormap:"precision mediump float;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\nvarying vec2 v_texCoord;\nuniform float u_indexedColormapOffset;\nuniform float u_indexedColormapMaxIndex;\nvec4 colorize() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat clrIndex \x3d currentPixel.r - u_indexedColormapOffset;\nvec4 result;\nif (currentPixel.a \x3d\x3d 0.0 || clrIndex \x3e u_indexedColormapMaxIndex) {\nresult \x3d vec4(0.0, 0.0, 0.0, 0.0);\n}\nelse {\nvec2 clrPosition \x3d vec2(clrIndex / u_indexedColormapMaxIndex, 0.0);\nvec4 color \x3d texture2D(u_image1, clrPosition);\nresult \x3d vec4(color.r, color.g, color.b, color.a);\n}\nreturn result;\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d colorize();\n}",
compositeBand:"precision mediump float;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\nuniform sampler2D u_image2;\nvarying vec2 v_texCoord;\nuniform int u_rasterCount;\nvec4 composite() {\nvec4 p0, p1, p2;\np0 \x3d texture2D(u_image, v_texCoord);\nvec4 result;\nif (u_rasterCount \x3d\x3d 1){\nresult \x3d p0;\n}\nelse if (u_rasterCount \x3d\x3d 2){\np1 \x3d texture2D(u_image1, v_texCoord);\nresult \x3d vec4(p0.r,p1.r,0.0,min(p0.a,p1.a));\n}\nelse if (u_rasterCount \x3d\x3d 3){\np1 \x3d texture2D(u_image1, v_texCoord);\np2 \x3d texture2D(u_image2, v_texCoord);\nresult \x3d vec4(p0.r,p1.r,p2.r,min(min(p0.a,p1.a),p2.a));\n}\nreturn result;\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d composite();\n}",
constant:"precision mediump float;\nuniform vec4 u_color;\nvoid main() {\ngl_FragColor \x3d u_color;\n}",contrastBrightness:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform float u_contrastOffset;\nuniform float u_brightnessOffset;\nuniform float u_scaleFactor;\nvec4 adjustContrastBrightness() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat c \x3d u_contrastOffset;\nfloat b \x3d u_brightnessOffset;\nfloat maxI \x3d 255.0;\nfloat mid \x3d 128.0;\nvec4 v;\nif (c \x3e 0.0 \x26\x26 c \x3c 100.0) {\nv \x3d (200.0 * currentPixel - 100.0 * maxI + 2.0 * maxI * b) / (2.0 * (100.0 - c)) + mid;\n} else if (c \x3c\x3d 0.0 \x26\x26 c \x3e -100.0) {\nv \x3d (200.0 * currentPixel - 100.0 * maxI + 2.0 * maxI * b) * (100.0 + c) / 20000.0 + mid;\n} else if (c \x3d\x3d 100.0) {\nv \x3d (200.0 * currentPixel - 100.0 * maxI + (maxI + 1.0) * (100.0 - c) + 2.0 * maxI * b);\nv \x3d (sign(v) + 1.0) / 2.0; //binary contrast with extra mid tone at 0.5\n} else if (c \x3d\x3d -100.0) {\nv \x3d vec4(mid, mid, mid, currentPixel.a); //no contrast\n}\nreturn vec4(v.r / u_scaleFactor, v.g / u_scaleFactor, v.b / u_scaleFactor, currentPixel.a);\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d adjustContrastBrightness();\n}",
convolution:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform vec2 u_resolution;\nuniform float u_kernel[25];\nuniform int u_kernelSize;\nvec4 convolve33(){\nvec4 vp11, vp12, vp13, vp21, vp22, vp23, vp31, vp32, vp33;\nvec2 xy11 \x3d vec2(-1.0, -1.0);\nvec2 xy12 \x3d vec2(0.0, -1.0);\nvec2 xy13 \x3d vec2(1.0, -1.0);\nvec2 xy21 \x3d vec2(-1.0, 0.0);\nvec2 xy23 \x3d vec2(1.0, 0.0);\nvec2 xy31 \x3d vec2(-1.0, 1.0);\nvec2 xy32 \x3d vec2(0.0, 1.0);\nvec2 xy33 \x3d vec2(1.0, 1.0);\nif (v_texCoord.s \x3c u_resolution.s) {\nxy11[0] \x3d 1.0;\nxy21[0] \x3d 1.0;\nxy31[0] \x3d 1.0;\n}\nif (v_texCoord.t \x3c u_resolution.t) {\nxy11[1] \x3d 1.0;\nxy12[1] \x3d 1.0;\nxy13[1] \x3d 1.0;\n}\nif (v_texCoord.s \x3e 1.0 - u_resolution.s) {\nxy13[0] \x3d -1.0;\nxy23[0] \x3d -1.0;\nxy33[0] \x3d -1.0;\n}\nif (v_texCoord.t \x3e 1.0 - u_resolution.t) {\nxy31[1] \x3d -1.0;\nxy32[1] \x3d -1.0;\nxy33[1] \x3d -1.0;\n}\nvec4 convolResult \x3d\ntexture2D(u_image, v_texCoord + u_resolution * xy11) * u_kernel[0] +\ntexture2D(u_image, v_texCoord + u_resolution * xy12) * u_kernel[1] +\ntexture2D(u_image, v_texCoord + u_resolution * xy13) * u_kernel[2] +\ntexture2D(u_image, v_texCoord + u_resolution * xy21) * u_kernel[3] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(0, 0)) * u_kernel[4] +\ntexture2D(u_image, v_texCoord + u_resolution * xy23) * u_kernel[5] +\ntexture2D(u_image, v_texCoord + u_resolution * xy31) * u_kernel[6] +\ntexture2D(u_image, v_texCoord + u_resolution * xy32) * u_kernel[7] +\ntexture2D(u_image, v_texCoord + u_resolution * xy33) * u_kernel[8];\nreturn vec4(convolResult.rgb, texture2D(u_image, v_texCoord).a);\n}\nvec4 convolve55(){\nvec4 vp11, vp12, vp13, vp21, vp22, vp23, vp31, vp32, vp33;\nfloat xdif[5];//https://www.opengl.org/wiki/Data_Type_(GLSL) array constructor ES3.0\nfloat ydif[5];\nfloat a \x3d -2.0;\nfor (int i\x3d0; i\x3c5; i++){\nxdif[i] \x3d a;\nydif[i] \x3d a;\na++;\n}\nif (v_texCoord.s \x3c u_resolution.s *2.0) { //2 pixel\nxdif[0] \x3d 2.0;\nif (v_texCoord.s \x3c u_resolution.s) { //1 pixel\nxdif[1] \x3d 1.0;\n}\n}\nelse if (v_texCoord.s \x3e 1.0 - u_resolution.s *2.0) {\nxdif[0] \x3d -2.0;\nif (v_texCoord.s \x3e 1.0 - u_resolution.s) {\nxdif[1] \x3d -1.0;\n}\n}\nif (v_texCoord.t \x3c u_resolution.t *2.0) {\nydif[0] \x3d 2.0;\nif (v_texCoord.t \x3c u_resolution.t) {\nydif[1] \x3d 1.0;\n}\n}\nelse if (v_texCoord.t \x3e 1.0 - u_resolution.t*2.0) {\nydif[0] \x3d -2.0;\nif (v_texCoord.t \x3e 1.0 - u_resolution.t) {\nydif[1] \x3d -1.0;\n}\n}\nvec4 convolResult \x3d\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[0], ydif[0])) * u_kernel[0] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[1], ydif[0])) * u_kernel[1] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[2], ydif[0])) * u_kernel[2] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[3], ydif[0])) * u_kernel[3] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[4], ydif[0])) * u_kernel[4] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[0], ydif[1])) * u_kernel[5] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[1], ydif[1])) * u_kernel[6] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[2], ydif[1])) * u_kernel[7] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[3], ydif[1])) * u_kernel[8] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[4], ydif[1])) * u_kernel[9] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[0], ydif[2])) * u_kernel[10] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[1], ydif[2])) * u_kernel[11] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[2], ydif[2])) * u_kernel[12] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[3], ydif[2])) * u_kernel[13] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[4], ydif[2])) * u_kernel[14] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[0], ydif[3])) * u_kernel[15] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[1], ydif[3])) * u_kernel[16] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[2], ydif[3])) * u_kernel[17] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[3], ydif[3])) * u_kernel[18] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[4], ydif[3])) * u_kernel[19] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[0], ydif[4])) * u_kernel[20] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[1], ydif[4])) * u_kernel[21] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[2], ydif[4])) * u_kernel[22] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[3], ydif[4])) * u_kernel[23] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[4], ydif[4])) * u_kernel[24];\nreturn vec4(convolResult.rgb, texture2D(u_image, v_texCoord).a);\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\nif (u_kernelSize \x3d\x3d 9){\ngl_FragColor \x3d convolve33();\n}\nelse {\ngl_FragColor \x3d convolve55();\n}\n}",
extractBand:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform int u_bandIDs[3];\nuniform bool u_alterBand;\nvec4 extractBand() {\nvec4 p \x3d texture2D(u_image, v_texCoord);\nif (!u_alterBand){\nreturn p;\n}\nfloat r, g, b;\nif (u_bandIDs[0] \x3d\x3d0){\nr \x3d p.r;\n}\nelse if (u_bandIDs[0] \x3d\x3d1){\nr \x3d p.g;\n}\nelse if (u_bandIDs[0] \x3d\x3d2){\nr \x3d p.b;\n}\nif (u_bandIDs[1] \x3d\x3d0){\ng \x3d p.r;\n}\nelse if (u_bandIDs[1] \x3d\x3d1){\ng \x3d p.g;\n}\nelse if (u_bandIDs[1] \x3d\x3d2){\ng \x3d p.b;\n}\nif (u_bandIDs[2] \x3d\x3d0){\nb \x3d p.r;\n}\nelse if (u_bandIDs[2] \x3d\x3d1){\nb \x3d p.g;\n}\nelse if (u_bandIDs[2] \x3d\x3d2){\nb \x3d p.b;\n}\nreturn vec4(r, g, b, p.a);\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d extractBand();\n}",
hillshade:"precision mediump float;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\nvarying vec2 v_texCoord;\nuniform vec2 u_resolution;\nuniform int u_slopeType;\nuniform int u_hillshadeType;\nuniform int u_lightSourceCount;\nuniform float u_sinZcosA;\nuniform float u_sinZsinA;\nuniform float u_cosZ;\nuniform float u_sinZcosAs[6];\nuniform float u_sinZsinAs[6];\nuniform float u_cosZs[6];\nuniform float u_weights[6];\nuniform float u_xFactor;\nuniform float u_yFactor;\nuniform bool u_scaled;\nuniform float u_minValue;\nuniform float u_maxValue;\nuniform bool u_applyColorramp;\nuniform float u_indexedColormapOffset;\nuniform float u_indexedColormapMaxIndex;\nuniform vec2 u_rawResolution;\nuniform int u_resampling;\nvec4 getPixelValue(vec2 coords) {\nif (u_resampling \x3d\x3d 0) {\nreturn texture2D(u_image, coords);\n}\nvec2 pos_ul \x3d floor(coords / u_rawResolution) * u_rawResolution;\nvec2 pos_ur \x3d pos_ul + vec2(1.0, 0.0) * u_rawResolution;\nvec2 pos_ll \x3d pos_ul + vec2(0.0, 1.0) * u_rawResolution;\nvec2 pos_lr \x3d pos_ul + vec2(1.0, 1.0) * u_rawResolution;\nvec2 weight \x3d fract(coords / u_rawResolution);\nvec4 vp_ul \x3d texture2D(u_image, pos_ul);\nvec4 vp_ur \x3d texture2D(u_image, pos_ur);\nvec4 vp_ll \x3d texture2D(u_image, pos_ll);\nvec4 vp_lr \x3d texture2D(u_image, pos_lr);\nvec4 vp \x3d mix(mix(vp_ul, vp_ur, weight.x), mix(vp_ll, vp_lr, weight.x), weight.y);\nreturn vp;\n}\nfloat getNeighborHoodAlpha(float a, float b, float c, float d, float e, float f, float g, float h, float i){\nif (a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0 || a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0 || a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0) {\nreturn 0.0;\n}\nelse {\nreturn e;\n}\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvec3 rgb2hsv(vec3 c) {\nvec4 K \x3d vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nvec4 p \x3d c.g \x3c c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);\nvec4 q \x3d c.r \x3c p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);\nfloat d \x3d q.x - min(q.w, q.y);\nfloat e \x3d 1.0e-10;\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);\n}\nvec3 hsv2rgb(vec3 c) {\nvec4 K \x3d vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvec3 p \x3d abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\nreturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\nvec4 overlay(float val, float minValue, float maxValue, float hillshade, float alpha) {\nfloat clrIndex \x3d clamp((val - minValue) / (maxValue - minValue), 0.0, 1.0);\nvec4 rgb \x3d texture2D(u_image1, vec2(clrIndex, 0.0));\nvec3 hsv \x3d rgb2hsv(rgb.xyz);\nhsv.z \x3d hillshade;\nreturn vec4(hsv2rgb(hsv) * alpha, alpha);\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\nvec4 va, vb, vc, vd, ve, vf, vg, vh, vi;\nvec2 axy \x3d vec2(-1.0, -1.0);\nvec2 bxy \x3d vec2(0.0, -1.0);\nvec2 cxy \x3d vec2(1.0, -1.0);\nvec2 dxy \x3d vec2(-1.0, 0.0);\nvec2 fxy \x3d vec2(1.0, 0.0);\nvec2 gxy \x3d vec2(-1.0, 1.0);\nvec2 hxy \x3d vec2(0.0, 1.0);\nvec2 ixy \x3d vec2(1.0, 1.0);\nif (v_texCoord.s \x3c u_resolution.s) {\naxy[0] \x3d 1.0;\ndxy[0] \x3d 1.0;\ngxy[0] \x3d 1.0;\n}\nif (v_texCoord.t \x3c u_resolution.t) {\naxy[1] \x3d 1.0;\nbxy[1] \x3d 1.0;\ncxy[1] \x3d 1.0;\n}\nif (v_texCoord.s \x3e 1.0 - u_resolution.s) {\ncxy[0] \x3d -1.0;\nfxy[0] \x3d -1.0;\nixy[0] \x3d -1.0;\n}\nif (v_texCoord.t \x3e 1.0 - u_resolution.t) {\ngxy[1] \x3d -1.0;\nhxy[1] \x3d -1.0;\nixy[1] \x3d -1.0;\n}\nva \x3d texture2D(u_image, v_texCoord + u_resolution * axy);\nvb \x3d texture2D(u_image, v_texCoord + u_resolution * bxy);\nvc \x3d texture2D(u_image, v_texCoord + u_resolution * cxy);\nvd \x3d texture2D(u_image, v_texCoord + u_resolution * dxy);\nve \x3d texture2D(u_image, v_texCoord + u_resolution * vec2(0, 0));\nvf \x3d texture2D(u_image, v_texCoord + u_resolution * fxy);\nvg \x3d texture2D(u_image, v_texCoord + u_resolution * gxy);\nvh \x3d texture2D(u_image, v_texCoord + u_resolution * hxy);\nvi \x3d texture2D(u_image, v_texCoord + u_resolution * ixy);\nfloat alpha \x3d getNeighborHoodAlpha(va.a, vb.a, vc.a, vd.a, ve.a, vf.a, vg.a, vh.a, vi.a);\nfloat dzx \x3d (vc + 2.0 * vf + vi - va - 2.0 * vd - vg).r * u_xFactor;\nfloat dzy \x3d (vg + 2.0 * vh + vi - va - 2.0 * vb - vc).r * u_yFactor; //flip\nfloat s2 \x3d sqrt(1.0 + dzx * dzx + dzy * dzy);\nfloat hillshade \x3d 0.0;\nif (u_hillshadeType \x3d\x3d 0){\nfloat cosDelta \x3d u_sinZsinA * dzy - u_sinZcosA * dzx;\nfloat z \x3d (u_cosZ + cosDelta) / s2;\nif (z \x3c 0.0)  z \x3d 0.0;\nhillshade \x3d z;\n}\nelse if (u_hillshadeType \x3d\x3d 1){\nfor (int k \x3d 0; k \x3c 6; k++) {\nfloat cosDelta \x3d u_sinZsinAs[k] * dzy - u_sinZcosAs[k] * dzx;\nfloat z \x3d (u_cosZs[k] + cosDelta) / s2;\nif (z \x3c 0.0) z \x3d 0.0;\nhillshade \x3d hillshade + z * u_weights[k];\nif (k \x3d\x3d u_lightSourceCount-1) break;\n}\n}\nif (u_applyColorramp) {\nvec4 result \x3d overlay(ve.r, u_minValue, u_maxValue, hillshade, alpha);\nif (u_scaled) {\nresult \x3d vec4(result.rgb * 255.0, result.a);\n}\ngl_FragColor \x3d result;\n} else {\nif (u_scaled) {\nhillshade \x3d hillshade * 255.0;\nif (hillshade\x3e 255.0) {\nhillshade \x3d 255.0;\n}\n}\ngl_FragColor \x3d vec4(hillshade, hillshade, hillshade, alpha);\n}\n}",
identity:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform int u_bandCount;\nfloat shift_right(float v, float amt) {\nv \x3d floor(v) + 0.5;\nreturn floor(v / exp2(amt));\n}\nfloat shift_left(float v, float amt) {\nreturn floor(v * exp2(amt) + 0.5);\n}\nfloat mask_last(float v, float bits) {\nreturn mod(v, shift_left(1.0, bits));\n}\nfloat extract_bits(float num, float from, float to) {\nfrom \x3d floor(from + 0.5);\nto \x3d floor(to + 0.5);\nreturn mask_last(shift_right(num, from), to - from);\n}\nvec4 encode_float(float val) {\nif (val \x3d\x3d 0.0)\nreturn vec4(0, 0, 0, 0);\nfloat sign \x3d val \x3e 0.0 ? 0.0 : 1.0;\nval \x3d abs(val);\nfloat exponent \x3d floor(log2(val));\nfloat biased_exponent \x3d exponent + 127.0;\nfloat fraction \x3d ((val / exp2(exponent)) - 1.0) * 8388608.0;\nfloat t \x3d biased_exponent / 2.0;\nfloat last_bit_of_biased_exponent \x3d fract(t) * 2.0;\nfloat remaining_bits_of_biased_exponent \x3d floor(t);\nfloat byte4 \x3d extract_bits(fraction, 0.0, 8.0) / 255.0;\nfloat byte3 \x3d extract_bits(fraction, 8.0, 16.0) / 255.0;\nfloat byte2 \x3d (last_bit_of_biased_exponent * 128.0 + extract_bits(fraction, 16.0, 23.0)) / 255.0;\nfloat byte1 \x3d (sign * 128.0 + remaining_bits_of_biased_exponent) / 255.0;\nreturn vec4(byte4, byte3, byte2, byte1);\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\nvec4 currentPixel \x3d  texture2D(u_image, v_texCoord);\ngl_FragColor \x3d vec4( currentPixel.rgb, currentPixel.a); //encode_float(currentPixel.r);\n}",
local:"precision mediump float;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\nuniform sampler2D u_image2;\nvarying vec2 v_texCoord;\nuniform int u_rasterCount;\nvec4 polyfill;\nvec4 localOp1() {\nvec4 a \x3d texture2D(u_image, v_texCoord);\nvec4 result;\nvec4 replaceme1;\nreturn result;\n}\nvec4 localOp2() {\nvec4 a \x3d texture2D(u_image, v_texCoord);\nvec4 b \x3d texture2D(u_image1, v_texCoord);\nvec4 result;\nvec4 replaceme2;\nreturn result;\n}\nvec4 localOp3() {\nvec4 a \x3d texture2D(u_image, v_texCoord);\nvec4 b \x3d texture2D(u_image1, v_texCoord);\nvec4 c \x3d texture2D(u_image2, v_texCoord);\nvec4 result;\nvec4 replaceme3;\nreturn result;\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d localOp1();\n}",
local0:"precision mediump float;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_texCoord;\nuniform float u_minCutOff[3];\nuniform float u_maxCutOff[3];\nuniform float u_minOutput[3];\nuniform float u_maxOutput[3];\nuniform float u_factor[3];\nuniform int u_operation;\nuniform int u_constant[3];\nuniform vec4 gamma;\nfloat localOperate1(float a, float b, float c){\nfloat result;\nif (u_operation \x3d\x3d 1){\nresult \x3d a + b;\n}\nelse if (u_operation \x3d\x3d 2){\nresult \x3d a - b;\n}\nelse if (u_operation \x3d\x3d3){\nresult \x3d a * b;\n}\nelse if (u_operation \x3d\x3d4){\nresult \x3d sqrt(a);\n}\nelse if (u_operation \x3d\x3d5){\nresult \x3d pow(a, b);\n}\nelse if (u_operation \x3d\x3d6){\nresult \x3d acos(a);\n}\nelse if (u_operation \x3d\x3d7){\nresult \x3d asin(a);\n}\nelse if (u_operation \x3d\x3d8){\nresult \x3d atan(a);\n}\nelse if (u_operation \x3d\x3d9){\nresult \x3d 999.0; //atanh not available\n}\nelse if (u_operation \x3d\x3d10){\nresult \x3d abs(a);\n}\nelse if (u_operation \x3d\x3d13){\nresult \x3d 999.0; //bitwise not available\n}\nelse if (u_operation \x3d\x3d17){\nresult \x3d a !\x3d 0.0 \x26\x26 b !\x3d0.0;\n}\nelse if (u_operation \x3d\x3d18){\nresult \x3d a \x3d\x3d0.0? 1.0:0.0;\n}\nelse if (u_operation \x3d\x3d19){\nresult \x3d a !\x3d 0.0 || b !\x3d0.0;\n}\nelse if (u_operation \x3d\x3d20){\nresult \x3d a !\x3d 0.0 ^^ b !\x3d0.0; //exclusive or\n}\nelse if (u_operation \x3d\x3d21){\nresult \x3d cos(a);\n}\nelse if (u_operation \x3d\x3d23){\nresult \x3d a / b;\n}\nelse if (u_operation \x3d\x3d24){\nresult \x3d a \x3d\x3d b ? 1.0:0.0;\n}\nelse if (u_operation \x3d\x3d25){\nresult \x3d exp(a);\n}\nelse if (u_operation \x3d\x3d26){\nresult \x3d pow(10.0, a);\n}\nelse if (u_operation \x3d\x3d27){\nresult \x3d exp2(a);\n}\nelse if (u_operation \x3d\x3d28){\nresult \x3d a \x3e b? 1.0 : 0.0;\n}\nelse if (u_operation \x3d\x3d29){\nresult \x3d  a \x3e\x3d b? 1.0 : 0.0;\n}\nelse if (u_operation \x3d\x3d30){\nresult \x3d floor(a); //int\n}\nelse if (u_operation \x3d\x3d31){\nresult \x3d a \x3d\x3d0? 1.0:0.0; //null pass mask\n}\nelse if (u_operation \x3d\x3d32){\nresult \x3d a; //float\n}\nelse if (u_operation \x3d\x3d33){\nresult \x3d a \x3c b? 1.0 : 0.0;\n}\nelse if (u_operation \x3d\x3d34){\nresult \x3d a \x3c\x3d b? 1.0 : 0.0;\n}\nelse if (u_operation \x3d\x3d35){\nresult \x3d log(a);\n}\nelse if (u_operation \x3d\x3d36){\nresult \x3d log2(a) / log2(10.0);\n}\nelse if (u_operation \x3d\x3d37){\nresult \x3d log2(a);\n}\nelse if (u_operation \x3d\x3d44){\nresult \x3d mod(a, b);\n}\nelse if (u_operation \x3d\x3d45){\nresult \x3d -a;\n}\nelse if (u_operation \x3d\x3d46){\nresult \x3d a !\x3d b? 1.0 : 0.0;\n}\nelse if (u_operation \x3d\x3d48){\nresult \x3d ceil(a);\n}\nelse if (u_operation \x3d\x3d49){\nresult \x3d floor(a);\n}\nelse if (u_operation \x3d\x3d51){\nresult \x3d sin(a);\n}\nelse if (u_operation \x3d\x3d53){\nresult \x3d a * a;\n}\nelse if (u_operation \x3d\x3d56){\nresult \x3d tan(a);\n}\nelse if (u_operation \x3d\x3d57){\nresult \x3d 999.0; //tanh not available\n}\nelse if (u_operation \x3d\x3d59){\nresult \x3d 999.0; //acosh not available\n}\nelse if (u_operation \x3d\x3d60){\nresult \x3d 999.0; //asinh not available\n}\nelse if (u_operation \x3d\x3d61){\nresult \x3d atan(a, b);\n}\nelse if (u_operation \x3d\x3d64){\nresult \x3d a / b;\n}\nelse if (u_operation \x3d\x3d65){\nresult \x3d floor(a/b);\n}\nelse if (u_operation \x3d\x3d76){\nresult \x3d a !\x3d0? b:c;\n}\n}\nvoid main() {\nvec4 currentPixel0 \x3d  texture2D(u_image0, v_texCoord);\nfloat graya, reda, greena, bluea;\nif (u_bandCount \x3d\x3d 1) {\ngraya \x3d stretchOneaue(float(currentPixel.r), u_minCutOff[0], u_maxCutOff[0], u_minOutput[0], u_maxOutput[0], u_factor[0]);\ngl_FragColor \x3d vec4(graya, graya, graya, currentPixel.a);\n}\nelse if (u_bandCount \x3d\x3d 3) {\nreda \x3d stretchOneaue(float(currentPixel.r), u_minCutOff[0], u_maxCutOff[0], u_minOutput[0], u_maxOutput[0], u_factor[0]);\ngreena \x3d stretchOneaue(float(currentPixel.g), u_minCutOff[1], u_maxCutOff[1], u_minOutput[1], u_maxOutput[1], u_factor[1]);\nbluea \x3d stretchOneaue(float(currentPixel.b), u_minCutOff[2], u_maxCutOff[2], u_minOutput[2], u_maxOutput[2], u_factor[2]);\ngl_FragColor \x3d vec4(reda, greena, bluea, currentPixel.a);\n}\n}",
mask:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform float u_includedRanges[6];\nuniform bool u_includedRanges_specified;\nuniform float u_noDataValues[6];\nuniform bool u_noDataValues_specified;\nuniform int u_noDataInterpretation;\nuniform int u_bandCount;\nvec4 mask() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nvec4 processedPixel \x3d currentPixel;\nif (u_includedRanges_specified) {\nif (u_bandCount \x3d\x3d 1) {\nif (currentPixel.r \x3e u_includedRanges[0] \x26\x26 currentPixel.r \x3c u_includedRanges[1])\nprocessedPixel \x3d vec4(currentPixel.rgb, currentPixel.a);\nelse\nprocessedPixel \x3d vec4(currentPixel.rgb, 0);\n} else if (u_bandCount \x3d\x3d 3) {\nif (currentPixel.r \x3e u_includedRanges[0] \x26\x26 currentPixel.r \x3c u_includedRanges[1] \x26\x26 currentPixel.g \x3e u_includedRanges[2] \x26\x26 currentPixel.g \x3c u_includedRanges[3] \x26\x26 currentPixel.b \x3e u_includedRanges[4] \x26\x26 currentPixel.b \x3c u_includedRanges[5])\nprocessedPixel \x3d vec4(currentPixel.rgb, currentPixel.a);\nelse\nprocessedPixel \x3d vec4(currentPixel.rgb, 0);\n}\n}\nif (u_noDataValues_specified) {\nif (u_bandCount \x3d\x3d 1) {\nif (processedPixel.r \x3d\x3d u_noDataValues[0])\nprocessedPixel \x3d vec4(processedPixel.rgb, 0);\nelse\nprocessedPixel \x3d vec4(processedPixel.rgb, processedPixel.a);\n} else if (u_bandCount \x3d\x3d 3) {\nif (u_noDataInterpretation \x3d\x3d1 \x26\x26 processedPixel.r \x3d\x3d u_noDataValues[0] \x26\x26 processedPixel.g \x3d\x3d u_noDataValues[1] \x26\x26 processedPixel.b \x3d\x3d u_noDataValues[2])\nprocessedPixel \x3d vec4(processedPixel.rgb, 0);\nelse if (processedPixel.r \x3d\x3d u_noDataValues[0] || processedPixel.g \x3d\x3d u_noDataValues[1] || processedPixel.b \x3d\x3d u_noDataValues[2])\nprocessedPixel \x3d vec4(processedPixel.rgb, 0);\nelse\nprocessedPixel \x3d vec4(processedPixel.rgb, processedPixel.a);\n}\n}\nreturn processedPixel;\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d mask();\n}",
ndvi:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform int u_bandId_red;\nuniform int u_bandId_nir;\nuniform bool u_scaled;\nuniform int u_bandCount;\nvec4 calculateNDVI(){\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat red \x3d float(u_bandId_red \x3d\x3d 0 ? currentPixel.r : (u_bandId_red \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat nir \x3d float(u_bandId_nir \x3d\x3d 0 ? currentPixel.r : (u_bandId_nir \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat ndvi_denom \x3d nir + red;\nfloat ndvi;\nif (ndvi_denom \x3d\x3d 0.0) {\nndvi \x3d 0.0;\n}\nelse {\nndvi \x3d (nir - red) / ndvi_denom;\nif (u_scaled) {\nndvi \x3d float(floor(ndvi * 100.0 + 100.5));\n}\n}\nreturn vec4(ndvi, ndvi, ndvi, currentPixel.a);\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d calculateNDVI();\n}",
remap:"precision mediump float;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\nvarying vec2 v_texCoord;\nuniform float u_indexedColormapOffset;\nuniform float u_indexedColormapMaxIndex;\nuniform float u_breaks[16];\nuniform vec2 u_rawResolution;\nuniform int u_resampling;\nvec4 getPixelValue(vec2 coords) {\nif (u_resampling \x3d\x3d 0) {\nreturn texture2D(u_image, coords);\n}\nvec2 pos_ul \x3d floor(coords / u_rawResolution) * u_rawResolution;\nvec2 pos_ur \x3d pos_ul + vec2(1.0, 0.0) * u_rawResolution;\nvec2 pos_ll \x3d pos_ul + vec2(0.0, 1.0) * u_rawResolution;\nvec2 pos_lr \x3d pos_ul + vec2(1.0, 1.0) * u_rawResolution;\nvec2 weight \x3d fract(coords / u_rawResolution);\nvec4 vp_ul \x3d texture2D(u_image, pos_ul);\nvec4 vp_ur \x3d texture2D(u_image, pos_ur);\nvec4 vp_ll \x3d texture2D(u_image, pos_ll);\nvec4 vp_lr \x3d texture2D(u_image, pos_lr);\nvec4 vp \x3d mix(mix(vp_ul, vp_ur, weight.x), mix(vp_ll, vp_lr, weight.x), weight.y);\nreturn vp;\n}\nfloat getRemapIndex(float pixelValue) {\nif (pixelValue \x3c u_breaks[0] || pixelValue \x3e u_breaks[15]) {\nreturn -1.0;\n}\nfor (int i \x3d 0; i \x3c 16; i++) {\nif (pixelValue \x3c u_breaks[i]) {\nreturn float(i - 1);\n}\n}\nif (pixelValue \x3d\x3d u_breaks[15]) {\nreturn 15.0;\n}\nreturn 0.0;\n}\nvec4 colorize(float pv) {\nfloat clrIndex \x3d pv - u_indexedColormapOffset;\nvec4 result;\nif (clrIndex \x3e u_indexedColormapMaxIndex) {\nresult \x3d vec4(0.0, 0.0, 0.0, 0.0);\n}\nelse {\nvec2 clrPosition \x3d vec2(clrIndex / u_indexedColormapMaxIndex, 0.0);\nvec4 color \x3d texture2D(u_image1, clrPosition);\nresult \x3d vec4(color.r, color.g, color.b, color.a);\n}\nreturn result;\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nif (currentPixel.a \x3d\x3d 0.0) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn;\n}\nfloat remappedIndex \x3d getRemapIndex(currentPixel.r);\nif (remappedIndex \x3c 0.0) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn;\n}\ngl_FragColor \x3d colorize(remappedIndex);\n}",
resample:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform vec2 u_resamplingRatio;\nuniform int u_resamplingType;\nuniform vec2 u_anchor;\nuniform vec2 u_resolution;\nvec4 resample(){\nvec2 pos_nn, pos_ul, pos_ur, pos_ll, pos_lr, pos_offset;\nfloat weight,weight_total, weight_ul, weight_ur, weight_ll, weight_lr;\nvec4 vp;  //v_texCoord is canvas space 0-1\nvec2 originalResolution \x3d vec2(u_resolution.s*u_resamplingRatio.s, u_resolution.t*u_resamplingRatio.t);\nvec2 pos \x3d vec2(u_anchor.s+(v_texCoord.s-u_anchor.s),(u_anchor.t+(v_texCoord.t-u_anchor.t)));\nif (u_resamplingType \x3d\x3d 0)\n{//shift and scaling, y \x3d ax+b so x \x3d (y-b)/a\npos_nn \x3d vec2(floor(pos.s/originalResolution.s+0.5)*originalResolution.s,floor(pos.t/originalResolution.t+0.5)*originalResolution.t);\nif (pos_nn.s \x3c0.0 || pos_nn.s \x3e 1.0 || pos_nn.t \x3c0.0 || pos_nn.t \x3e 1.0){\nvp \x3d vec4(1.0, 0.0, 0.0, 1.0);//vec4(0.0, 1.0, 0.0, vp.a);\n}\nelse {\nvp \x3d texture2D(u_image, vec2(pos_nn.s, pos_nn.t));\n}\n}\nelse if (u_resamplingType \x3d\x3d 1)\n{//shift and scaling, 4 neighbors y \x3d ax+b so x \x3d (y-b)/a\npos_ul \x3d vec2(floor(pos.s/originalResolution.s)*originalResolution.s,floor(pos.t/originalResolution.t)*originalResolution.t);\npos_ur \x3d vec2(pos_ul.s+originalResolution.s, pos_ul.t);\npos_ll \x3d vec2(pos_ul.s, pos_ul.t+originalResolution.t);\npos_lr \x3d vec2(pos_ul.s+originalResolution.s, pos_ul.t+originalResolution.t);\npos_offset \x3d vec2(pos.s - floor(pos_ul.s),pos.t - floor(pos_ul.t));\nweight_lr \x3d sqrt(pow(pos_offset.s,2.0) + pow(pos_offset.t,2.0));\nweight_ul \x3d sqrt(pow( originalResolution.s- pos_offset.s,2.0)+ pow(originalResolution.t- pos_offset.t,2.0));\nweight_ur \x3d sqrt(pow( pos_offset.s,2.0)+ 1.0- pow(originalResolution.t - pos_offset.t,2.0));\nweight_ll \x3d sqrt(pow( originalResolution.s- pos_offset.s,2.0)+ pow(pos_offset.t,2.0));\nvp \x3d (texture2D(u_image, pos_ul) * weight_ul + texture2D(u_image, pos_ur) * weight_ur + texture2D(u_image, pos_ll) * weight_ll + texture2D(u_image, pos_lr) * weight_lr)/(weight_ul+weight_ur+weight_ll+weight_lr);\n}\nelse if (u_resamplingType \x3d\x3d 2)\n{//shift and scaling, 16 neighbors\nweight_total \x3d 0.0;\nvp \x3d vec4(0.0,0.0,0.0,0.0);\npos_ul \x3d vec2(floor(pos.s/originalResolution.s)*originalResolution.s-originalResolution.s,floor(pos.t/originalResolution.t)*originalResolution.t-originalResolution.t);\npos_offset \x3d vec2(pos.s - floor(pos_ul.s),pos.t - floor(pos_ul.t));\nfor (int i\x3d0; i\x3c4; i++){//row\nfor (int j\x3d0; j\x3c4; j++){//col\nweight \x3d sqrt(pow(pos_offset.s-float(j),2.0)+ pow(pos_offset.t-float(i),2.0));\nvp +\x3dtexture2D(u_image, vec2(pos_ul.s+float(i)*originalResolution.s,pos_ul.t+float(j)*originalResolution.t)) * weight;\nweight_total +\x3d weight;\n}\n}\nvp \x3d vp/weight_total;\n}\nreturn vp;\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d resample();\n}",
slope:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform vec2 u_resolution;\nuniform vec2 u_cellSize;\nuniform float u_zfactor;\nuniform float u_altitude;\nuniform float u_azimuth;\nfloat shift_right(float v, float amt) {\nv \x3d floor(v) + 0.5;\nreturn floor(v / exp2(amt));\n}\nfloat shift_left(float v, float amt) {\nreturn floor(v * exp2(amt) + 0.5);\n}\nfloat mask_last(float v, float bits) {\nreturn mod(v, shift_left(1.0, bits));\n}\nfloat extract_bits(float num, float from, float to) {\nfrom \x3d floor(from + 0.5);\nto \x3d floor(to + 0.5);\nreturn mask_last(shift_right(num, from), to - from);\n}\nvec4 encode_float(float val) {\nif (val \x3d\x3d 0.0)\nreturn vec4(0, 0, 0, 0);\nfloat sign \x3d val \x3e 0.0 ? 0.0 : 1.0;\nval \x3d abs(val);\nfloat exponent \x3d floor(log2(val));\nfloat biased_exponent \x3d exponent + 127.0;\nfloat fraction \x3d ((val / exp2(exponent)) - 1.0) * 8388608.0;\nfloat t \x3d biased_exponent / 2.0;\nfloat last_bit_of_biased_exponent \x3d fract(t) * 2.0;\nfloat remaining_bits_of_biased_exponent \x3d floor(t);\nfloat byte4 \x3d extract_bits(fraction, 0.0, 8.0) / 255.0;\nfloat byte3 \x3d extract_bits(fraction, 8.0, 16.0) / 255.0;\nfloat byte2 \x3d (last_bit_of_biased_exponent * 128.0 + extract_bits(fraction, 16.0, 23.0)) / 255.0;\nfloat byte1 \x3d (sign * 128.0 + remaining_bits_of_biased_exponent) / 255.0;\nreturn vec4(byte4, byte3, byte2, byte1);\n}\nfloat getNeighborHoodAlpha(float a, float b, float c, float d, float e, float f, float g, float h, float i){\nif (a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0 || a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0 || a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0) {\nreturn 0.0;\n}\nelse {\nreturn e;\n}\n}\nvec4 calculateSlope() {\nfloat pi \x3d 3.141592653589793238;\nfloat dzx \x3d 0.0;\nfloat dzy \x3d 0.0;\nvec4 va,  vb,  vc,  vd,  ve,  vf,  vg,  vh,  vi;\nvec2 axy \x3d vec2(-1.0, -1.0);\nvec2 bxy \x3d vec2(0.0, -1.0);\nvec2 cxy \x3d vec2(1.0, -1.0);\nvec2 dxy \x3d vec2(-1.0, 0.0);\nvec2 fxy \x3d vec2(1.0, 0.0);\nvec2 gxy \x3d vec2(-1.0, 1.0);\nvec2 hxy \x3d vec2(0.0, 1.0);\nvec2 ixy \x3d vec2(1.0, 1.0);\nif (v_texCoord.s \x3c u_resolution.s) {\naxy[0] \x3d 1.0;\ndxy[0] \x3d 1.0;\ngxy[0] \x3d 1.0;\n}\nif (v_texCoord.t \x3c u_resolution.t) {\naxy[1] \x3d 1.0;\nbxy[1] \x3d 1.0;\ncxy[1] \x3d 1.0;\n}\nif (v_texCoord.s \x3e 1.0 - u_resolution.s) {\ncxy[0] \x3d -1.0;\nfxy[0] \x3d -1.0;\nixy[0] \x3d -1.0;\n}\nif (v_texCoord.t \x3e 1.0 - u_resolution.t) {\ngxy[1] \x3d -1.0;\nhxy[1] \x3d -1.0;\nixy[1] \x3d -1.0;\n}\nif (v_texCoord.s \x3e\x3d u_resolution.s \x26\x26 (1.0 - u_resolution.s) \x3e\x3d v_texCoord.s \x26\x26 v_texCoord.t \x3e\x3d u_resolution.t \x26\x26 (1.0 - u_resolution.t) \x3e\x3d v_texCoord.t) {\nva \x3d texture2D(u_image, v_texCoord + u_resolution * axy);\nvb \x3d texture2D(u_image, v_texCoord + u_resolution * bxy);\nvc \x3d texture2D(u_image, v_texCoord + u_resolution * cxy);\nvd \x3d texture2D(u_image, v_texCoord + u_resolution * dxy);\nve \x3d texture2D(u_image, v_texCoord + u_resolution * vec2(0, 0));\nvf \x3d texture2D(u_image, v_texCoord + u_resolution * fxy);\nvg \x3d texture2D(u_image, v_texCoord + u_resolution * gxy);\nvh \x3d texture2D(u_image, v_texCoord + u_resolution * hxy);\nvi \x3d texture2D(u_image, v_texCoord + u_resolution * ixy);\n}\ndzx \x3d (vc + 2.0 * vf + vi - va - 2.0 * vd - vg).r / (8.0 * u_cellSize[0]);\ndzy \x3d -(vg + 2.0 * vh + vi - va - 2.0 * vb - vc).r / (8.0 * u_cellSize[1]);\nfloat alpha \x3d getNeighborHoodAlpha(va.a, vb.a, vc.a, vd.a, ve.a, vf.a, vg.a, vh.a, vi.a);\nfloat slope \x3d atan(u_zfactor * sqrt(dzx * dzx + dzy * dzy)) * 57.2957795;\nreturn vec4(slope, slope, slope, alpha);\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d calculateSlope();\n}",
stretch:"precision mediump float;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\nuniform sampler2D u_image2;\nvarying vec2 v_texCoord;\nuniform float u_minCutOff[3];\nuniform float u_maxCutOff[3];\nuniform float u_minOutput[3];\nuniform float u_maxOutput[3];\nuniform float u_factor[3];\nuniform int u_bandCount;\nuniform vec2 u_sourceDim;\nuniform vec2 u_targetDim;\nuniform int u_state;\nuniform bool u_minMaxTexture;\nuniform bool u_useGamma;\nuniform float u_gamma[4];\nuniform float u_gammaCorrection[4];\nuniform bool u_scaled;\nuniform vec2 u_rawResolution;\nuniform int u_resampling;\nvec4 getPixelValue(vec2 coords) {\nif (u_resampling \x3d\x3d 0) {\nreturn texture2D(u_image, coords);\n}\nvec2 pos_ul \x3d floor(coords / u_rawResolution) * u_rawResolution;\nvec2 pos_ur \x3d pos_ul + vec2(1.0, 0.0) * u_rawResolution;\nvec2 pos_ll \x3d pos_ul + vec2(0.0, 1.0) * u_rawResolution;\nvec2 pos_lr \x3d pos_ul + vec2(1.0, 1.0) * u_rawResolution;\nvec2 weight \x3d fract(coords / u_rawResolution);\nvec4 vp_ul \x3d texture2D(u_image, pos_ul);\nvec4 vp_ur \x3d texture2D(u_image, pos_ur);\nvec4 vp_ll \x3d texture2D(u_image, pos_ll);\nvec4 vp_lr \x3d texture2D(u_image, pos_lr);\nvec4 vp \x3d mix(mix(vp_ul, vp_ur, weight.x), mix(vp_ll, vp_lr, weight.x), weight.y);\nif (u_bandCount \x3d\x3d 1) {\nfloat alpha \x3d vp_ul.a * vp_ur.a * vp_ll.a * vp_lr.a;\nvec4 vp_nn \x3d texture2D(u_image, coords);\nreturn alpha \x3d\x3d 0.0 ? vp_nn : vec4(vp.rgb, alpha);\n}\nreturn vp;\n}\nvec4 findMin(vec4 p1, vec4 p2) {\nif (p1.a \x3d\x3d 0.0) {\nreturn p2;\n} else if (p2.a \x3d\x3d 0.0) {\nreturn p1;\n} else {\nreturn vec4(min(p1.r, p2.r),min(p1.g, p2.g),min(p1.b, p2.b),p1.a);\n}\n}\nvec4 findMax(vec4 p1, vec4 p2) {\nif (p1.a \x3d\x3d 0.0) {\nreturn p2;\n} else if (p2.a \x3d\x3d 0.0) {\nreturn p1;\n} else {\nreturn vec4(max(p1.r, p2.r),max(p1.g, p2.g),max(p1.b, p2.b),p1.a);\n}\n}\nvec4 findMinMax(vec4 p1, vec4 p2) {\nif (p1.a \x3d\x3d 0.0) {\nreturn p2;\n} else if (p2.a \x3d\x3d 0.0) {\nreturn p1;\n} else {\nreturn vec4(min(p1.r, p2.r), max(p1.g, p2.g), 0.0, p1.a);\n}\n}\nvec4 minMax(int state) {\nvec2 pixelFract \x3d fract(v_texCoord * u_sourceDim);\nfloat xshift \x3d ((pixelFract.s \x3e\x3d 0.5 || pixelFract.s \x3d\x3d 0.0) ? -1.0 : 1.0) / u_sourceDim.s; //take left pixel if \x3e 0.5\nfloat yshift \x3d ((pixelFract.s \x3e\x3d 0.5 || pixelFract.s \x3d\x3d 0.0) ? -1.0 : 1.0) / u_sourceDim.t; //take bottom pixel if \x3e 0.5\nif (u_sourceDim.s \x3d\x3d 1.0) {\nxshift \x3d 0.0;\n}\nif (u_sourceDim.t \x3d\x3d 1.0) {\nyshift \x3d 0.0;\n}\nvec4 p1 \x3d texture2D(u_image, v_texCoord);\nvec4 p2 \x3d texture2D(u_image, v_texCoord + vec2(xshift, 0.0));\nvec4 p3 \x3d texture2D(u_image, v_texCoord + vec2(0.0, yshift));\nvec4 p4 \x3d texture2D(u_image, v_texCoord + vec2(xshift, yshift));\nvec4 pval;\nif (state \x3d\x3d 2) {\npval \x3d findMinMax(findMinMax(p1, p2), findMinMax(p3, p4));\n} else if (state \x3d\x3d 1) {\npval \x3d findMax(findMax(p1, p2), findMax(p3, p4));\n} else if (state \x3d\x3d 0) {\npval \x3d findMin(findMin(p1, p2), findMin(p3, p4));\n}\nreturn pval;\n}\nfloat stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, bool scaled) {\nfloat stretchedVal;\nif (val \x3e minCutOff \x26\x26 val \x3c maxCutOff) {\nstretchedVal \x3d minOutput + (val - minCutOff) * factor;\n} else if (val \x3e\x3d maxCutOff) {\nstretchedVal \x3d maxOutput;\n} else {\nstretchedVal \x3d minOutput;\n}\nif (scaled) {\nreturn stretchedVal;\n}\nelse {\nreturn stretchedVal / maxOutput; //0-1\n}\n}\nfloat stretchOneValueGamma(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, float gamma, float gammaCorrection, bool scaled) {\nfloat stretchedVal;\nfloat tempf \x3d 1.0;\nfloat outRange \x3d maxOutput - minOutput;\nfloat relativeVal \x3d (val - minCutOff) / (maxCutOff - minCutOff);\nif (val \x3e minCutOff \x26\x26 val \x3c maxCutOff) {\nif (gamma \x3e 1.0) {\ntempf -\x3d pow(1.0 / outRange, relativeVal * gammaCorrection);\n}\nstretchedVal \x3d floor(tempf * outRange * pow(relativeVal, 1.0 / gamma)) + minOutput;\n}\nelse if (val \x3e\x3d maxCutOff) {\nstretchedVal \x3d maxOutput;\n} else {\nstretchedVal \x3d minOutput;\n}\nif (scaled) {\nreturn stretchedVal;\n}\nelse {\nreturn stretchedVal / maxOutput; //0-1\n}\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\nif (u_state \x3d\x3d 100) {\nvec4 currentPixel \x3d getPixelValue(v_texCoord);\nfloat grayVal,\nredVal,\ngreenVal,\nblueVal;\nfloat min0,\nmax0,\nmin1,\nmax1,\nmin2,\nmax2,\nfactor0,\nfactor1,\nfactor2;\nvec4 minV, maxV;\nif (u_minMaxTexture) {\nif (u_bandCount \x3d\x3d 1) {\nminV \x3d texture2D(u_image1, v_texCoord);\nmin0 \x3d minV.r;\nmax0 \x3d minV.g;\nfactor0 \x3d (u_maxOutput[0] - u_minOutput[0]) / (max0 - min0);\n} else {\nminV \x3d texture2D(u_image1, v_texCoord);\nmaxV \x3d texture2D(u_image2, v_texCoord);\nmin0 \x3d minV.r;\nmax0 \x3d maxV.r;\nmin1 \x3d minV.g;\nmax1 \x3d maxV.g;\nmin2 \x3d minV.b;\nmax2 \x3d maxV.b;\nfactor0 \x3d (u_maxOutput[0] - u_minOutput[0]) / (max0 - min0);\nfactor1 \x3d (u_maxOutput[1] - u_minOutput[1]) / (max1 - min1);\nfactor2 \x3d (u_maxOutput[2] - u_minOutput[2]) / (max2 - min2);\n}\n} else {\nmin0 \x3d u_minCutOff[0];\nmax0 \x3d u_maxCutOff[0];\nmin1 \x3d u_minCutOff[1];\nmax1 \x3d u_maxCutOff[1];\nmin2 \x3d u_minCutOff[2];\nmax2 \x3d u_maxCutOff[2];\nfactor0 \x3d u_factor[0];\nfactor1 \x3d u_factor[1];\nfactor2 \x3d u_factor[2];\n}\nif (u_useGamma){\nif (u_bandCount \x3d\x3d 1) {\ngrayVal \x3d stretchOneValueGamma(float(currentPixel.r), min0, max0, u_minOutput[0], u_maxOutput[0], factor0, u_gamma[0], u_gammaCorrection[0], u_scaled);\ngl_FragColor \x3d vec4(grayVal, grayVal, grayVal, currentPixel.a);\n} else {\nredVal \x3d stretchOneValueGamma(float(currentPixel.r), min0, max0, u_minOutput[0], u_maxOutput[0], factor0, u_gamma[0], u_gammaCorrection[0], u_scaled);\ngreenVal \x3d stretchOneValueGamma(float(currentPixel.g), min1, max1, u_minOutput[1], u_maxOutput[1], factor1, u_gamma[1], u_gammaCorrection[1], u_scaled);\nblueVal \x3d stretchOneValueGamma(float(currentPixel.b), min2, max2, u_minOutput[2], u_maxOutput[2], factor2, u_gamma[1], u_gammaCorrection[2], u_scaled);\ngl_FragColor \x3d vec4(redVal, greenVal, blueVal, currentPixel.a);\n}\n}\nelse {\nif (u_bandCount \x3d\x3d 1) {\ngrayVal \x3d stretchOneValue(float(currentPixel.r), min0, max0, u_minOutput[0], u_maxOutput[0], factor0, u_scaled);\ngl_FragColor \x3d vec4(grayVal, grayVal, grayVal, currentPixel.a);\n} else {\nredVal \x3d stretchOneValue(float(currentPixel.r), min0, max0, u_minOutput[0], u_maxOutput[0], factor0, u_scaled);\ngreenVal \x3d stretchOneValue(float(currentPixel.g), min1, max1, u_minOutput[1], u_maxOutput[1], factor1, u_scaled);\nblueVal \x3d stretchOneValue(float(currentPixel.b), min2, max2, u_minOutput[2], u_maxOutput[2], factor2, u_scaled);\ngl_FragColor \x3d vec4(redVal, greenVal, blueVal, currentPixel.a);\n}\n}\n} else {\nvec4 currentPixel \x3d minMax(u_state);\ngl_FragColor \x3d currentPixel;\n}\n}"}})},
"esri/layers/rasterLib/function/RasterFunctionWebGLMixin":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ./pixelShaders ./vertexShaders ./webglHelper ./convolutionKernel".split(" "),function(H,d,m,n,q,f,c){return H(null,{gl:null,rgbaFloatData:null,originalTexture:null,lastTexture:null,renderTexture:!1,constructor:function(a){this._isProgramInitialized=!1;this.gl=a&&a.gl;a&&a.renderTexture&&(this.renderTexture=a.renderTexture);this._xformSetting=a&&a._xformSetting||{requireProjection:!1,
meshSize:[20,20]}},bindFrameBuffer:function(){var a=this.gl;this._setupPingPongTextures();this._setupBranchingTextures();var b=this._glSetting;this.isBranch?(b.branchIndex=(b.branchIndex+1)%b.branchCount,b=b.branches[b.branchIndex]):(b.pingpongIndex=(b.pingpongIndex+1)%b.pingpong.length,b=b.pingpong[b.pingpongIndex]);a.bindFramebuffer(a.FRAMEBUFFER,b.frameBuffer);a.viewport(0,0,a.drawingBufferWidth,a.drawingBufferHeight);return b},_initializeProgram:function(a){if(this.gl)try{var b=this.gl;b.viewport(0,
0,b.drawingBufferWidth,b.drawingBufferHeight);var k=this._glSetting.programUniforms,h="local"===this.functionName?"local"+this.functionArguments.operation:this.functionName,g=k[h];if(g)this._uniforms=g.uniforms,this.rasterProgram=g.program;else{var e=(this._useMesh=this._tileMode&&this._xformSetting.requireProjection)?q.mesh:q.basic,l=q.getShader(b,a.vertex||e),p=n.getShader(b,a.fragment),v=this._loadProgram(l,p),z={rasterProgram:f.getUniforms(b,v)};k[h]={uniforms:z,program:v};this.rasterProgram=
v;this._uniforms=z}b.useProgram(this.rasterProgram);var u=b.getAttribLocation(this.rasterProgram,"a_texCoord"),E=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,E);var w=f.createMesh(this._xformSetting.meshSize);b.bufferData(b.ARRAY_BUFFER,w,b.STATIC_DRAW);b.enableVertexAttribArray(u);b.vertexAttribPointer(u,2,b.FLOAT,!1,0,0);b.disable(b.DEPTH_TEST);b.blendFunc(b.SRC_ALPHA,b.ZERO);b.disable(b.BLEND);b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1);this._shaderInfo=
{fragment:a.fragmentName}}catch(F){console.error("webgl exception: "+F.message)}else console.error("WebGL is required.")},_setUniform:function(a,b,k){null!=b&&(k&&!this._uniforms[k]&&(this._uniforms[k]=f.getUniforms(this.gl,this[k])),k=k?this._uniforms[k]:this._uniforms.rasterProgram,(a=k[a]||k[a+"[0]"])&&f.setUniform(this.gl,a,b))},_setUniforms:function(a,b){var k=Object.keys(a),h,g=k.length;for(h=0;h<g;h++)this._setUniform(k[h],a[k[h]],b);this.rawInput?this._setUniform("u_flipY",!0,b):this._setUniform("u_flipY",
!1,b);this._tileMode?(this.rawInput?(a=this._xformSetting.offset,k=this._xformSetting.scale):(a=[0,0],k=[1,1]),this._setUniform("u_xformOffset",a,b),this._setUniform("u_xformScale",k,b),this._xformSetting.requireProjection&&(this.rawInput?(this._setupXformTexture(),this._setUniform("u_projection",!0,b),this._setUniform("u_transformGridSize",this._xformSetting.gridConfig.size,b),this._setUniform("u_transformSpacing",this._xformSetting.gridConfig.spacing,b),this._setUniform("u_targetImageSize",new Float32Array([this.gl.drawingBufferWidth,
this.gl.drawingBufferHeight]),b)):this._setUniform("u_projection",!1,b))):(a=[0,0],k=[1,1],this._setUniform("u_xformOffset",a,b),this._setUniform("u_xformScale",k,b));this.rawInput&&this._rawResolution&&("RSP_BilinearInterpolation"===this.interpolation||"RSP_CubicConvolution"===this.interpolation)?(this._setUniform("u_resampling",1),this._setUniform("u_rawResolution",this._rawResolution)):this._setUniform("u_resampling",0)},_setupTextureData:function(a,b){if(a.texture)return a;a.raster&&a.raster.pixelBlock&&
(a=a.raster);this.rawInput=!0;var k=b&&b.notOriginal,h=b&&b.bandIDs;b&&b.reCreate?b=!1:(b=this._tileMode?!this._xformSetting.hasNewTexture:!this._glSetting.hasNewTexture)&&this._originalBandIDs&&(b=h?this._originalBandIDs.join("")===h.join(""):!1);0<this._glSetting.branchCount&&(b=!1);if(b&&this.originalTexture)return{extent:a.extent,texture:this.originalTexture};b=this._createTexture();k||(this.originalTexture=b,this._originalBandIDs=h);k=this.gl;var g=a.pixelBlock;this._rawResolution=g?[1/a.pixelBlock.width,
1/a.pixelBlock.height]:[1/this.gl.drawingBufferWidth,1/this.gl.drawingBufferHeight];var e=0;h&&0<h.length&&g&&(e=Math.max.apply(null,h),g.pixels.length>e&&h&&(g.pixels=h.map(function(p){return g.pixels[p]}),g.statistics&&(g.statistics=h.map(function(p){return g.statistics[p]}))));h=g.width;e=g.height;k.getExtension("OES_texture_float");var l=g.getAsRGBAFloat();k.texImage2D(k.TEXTURE_2D,0,k.RGBA,h,e,0,k.RGBA,k.FLOAT,l);return{extent:a.extent,texture:b}},_setupPingPongTextures:function(){var a=this._glSetting;
if(!a||!a.pingpong){a.pingpong=[];var b=f.createBufferTexture(this.gl,!1);a.pingpong.push(b);b=f.createBufferTexture(this.gl,!1);a.pingpong.push(b);a.pingpongIndex=1}},_setupBranchingTextures:function(){var a=this._glSetting;if(!a||!a.branches){a.branches=[];var b=0,k=a.branchCount;if(0<k){for(b=0;b<k;b++){var h=f.createBufferTexture(this.gl,!1);a.branches.push(h)}a.branchIndex=k-1}}},_setupXformTexture:function(a){for(var b=this._createTexture(),k=this.gl,h=4*this._xformSetting.gridConfig.size[0],
g=this._xformSetting.gridConfig.size[1],e=new Float32Array(h*g*4),l=0,p=0;p<this._xformSetting.gridConfig.coefficients.length;p++)e[l++]=this._xformSetting.gridConfig.coefficients[p],2===p%3&&(e[l++]=1);k.getExtension("OES_texture_float");k.texImage2D(k.TEXTURE_2D,0,k.RGBA,h,g,0,k.RGBA,k.FLOAT,e);this._bindTexture(b,"u_transformGrid",a)},_createTexture:function(a){return f.createTexture(this.gl,a)},_bindTexture:function(a,b,k){b=b||"u_image";k=this._uniforms[k||"rasterProgram"];var h=this._getTextureIndex(b);
if(-1!==h){var g=this.gl;g.uniform1i(k[b].location,h);g.activeTexture(g.TEXTURE0+h);g.bindTexture(g.TEXTURE_2D,a)}},_getTextureIndex:function(a,b){b=this._uniforms[b||"rasterProgram"];if(!b||!b[a]||b[a].info.type!==this.gl.SAMPLER_2D)return-1;if("u_transformGrid"===a)return 0;a="u_image"===a?0:parseInt(a.replace("u_image",""));return this._xformSetting.requireProjection?a+1:a},_drawGL:function(a){var b=this.gl;this.renderTexture?(b.enable(b.BLEND),b.bindFramebuffer(b.FRAMEBUFFER,null)):b.disable(b.BLEND);
a||b.viewport(0,0,b.drawingBufferWidth,b.drawingBufferHeight);a=this._xformSetting.meshSize||[1,1];b.drawArrays(b.TRIANGLES,0,a[0]*a[1]*6);this._drawMesh()},_drawMesh:function(){if(this.renderTexture&&this._glSetting.drawMesh){this.meshProgram=this.meshProgram||this._setupMeshProgram();var a=this.gl;a.useProgram(this.meshProgram);a.bindFramebuffer(a.FRAMEBUFFER,null);var b=a.getAttribLocation(this.meshProgram,"a_texCoord"),k=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,k);k=this._xformSetting.meshSize||
[1,1];var h=f.createMesh(k,!0);a.bufferData(a.ARRAY_BUFFER,h,a.STATIC_DRAW);a.enableVertexAttribArray(b);a.vertexAttribPointer(b,2,a.FLOAT,!1,0,0);a.disable(a.DEPTH_TEST);a.blendFunc(a.ONE,a.ZERO);this._setUniforms({u_color:[0,0,1,1],u_drawMeshLines:!0},"meshProgram");a.drawArrays(a.LINES,0,k[0]*k[1]*10)}},_setupMeshProgram:function(){var a=q.getShader(this.gl,q.mesh),b=n.getShader(this.gl,n.constant);return this._loadProgram(a,b)},_loadProgram:function(a,b){return f.loadProgram(this.gl,a,b)},_getShaderScript:function(a,
b){b=document.getElementById(b);if(!b)return null;a="";for(b=b.firstChild;b;)3==b.nodeType&&(a+=b.textContent),b=b.nextSibling;return a}})})},"esri/layers/rasterLib/function/vertexShaders":function(){define(["dojo/_base/declare","dojo/_base/lang","./vertexShaderScripts"],function(H,d,m){H={shaderType:"vertex",getShader:function(n,q){var f=n.createShader(n.VERTEX_SHADER);n.shaderSource(f,q);n.compileShader(f);n.getShaderParameter(f,n.COMPILE_STATUS)||(f=null);return f}};d.mixin(H,m);return H})},"esri/layers/rasterLib/function/vertexShaderScripts":function(){define([],
function(){return{basic:"varying vec2 v_texCoord;\nattribute vec2 a_texCoord;\nuniform vec2 u_xformOffset;\nuniform vec2 u_xformScale;\nuniform bool u_flipY;\nvoid main() {\nv_texCoord \x3d u_xformOffset + a_texCoord * u_xformScale;\nif (u_flipY) {\nv_texCoord.t \x3d 1.0 - v_texCoord.t;\n}\nvec2 position \x3d a_texCoord * 2.0 - 1.0;\ngl_Position \x3d vec4(position, 0.0, 1.0);\n}",histogram:"attribute float a_pixelIndex;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\nuniform sampler2D u_image2;\nuniform vec2 u_sourceDim;\nuniform vec2 u_halfPixel;\nuniform vec4 u_bandSelection;\nuniform vec4 u_mins;\nuniform vec4 u_factors;\nuniform float u_size;\nuniform int u_bandCount;\nuniform bool u_minMaxTexture;\nvoid main() {\nfloat row \x3d a_pixelIndex/u_sourceDim.s;\nvec2 coord \x3d vec2(fract(row), floor(row)/u_sourceDim.t);\nvec4 pv \x3d texture2D(u_image, coord + u_halfPixel);\nvec4 minVal, maxVal, pvm;\nif (u_minMaxTexture){\nif (u_bandCount \x3d\x3d1){ //min \x3d red, max \x3d green\nvec4 minmax \x3d texture2D(u_image1, vec2(0.5,0.5));\nminVal \x3d vec4(minmax.r, minmax.r, minmax.r, 0.0);\nmaxVal \x3d vec4(minmax.g, minmax.g, minmax.g, 0.0);\n}\nelse if (u_bandCount \x3d\x3d3){ //min \x3d red, max \x3d green\nminVal \x3d texture2D(u_image1, vec2(0.5,0.5));\nmaxVal \x3d texture2D(u_image2, vec2(0.5,0.5));\n}\nvec4 factors \x3d u_size/(maxVal-minVal+vec4(0.0,0.0,0.0,1.0)) * u_factors;\npvm \x3d (pv - minVal) * factors;\n}\nelse {\npvm \x3d (pv - u_mins) * u_factors;\n}\nfloat histVal \x3d min(floor(pvm.r+pvm.g+pvm.b), u_size-1.0);\nhistVal \x3d pv.a \x3d\x3d 1.0? histVal: u_size;\ngl_Position \x3d vec4((histVal+0.1) / (u_size+1.0) * 2.0 - 1.0, 0.5, 0, 1);\ngl_PointSize \x3d 1.0;\n}",
mesh:"varying vec2 v_texCoord;\nattribute vec2 a_texCoord;\nuniform bool u_drawMeshLines;\nuniform bool u_flipY;\nuniform vec2 u_xformOffset;\nuniform vec2 u_xformScale;\nuniform sampler2D u_transformGrid;\nuniform vec2 u_transformSpacing;\nuniform vec2 u_transformGridSize;\nuniform vec2 u_targetImageSize;\nuniform vec2 u_srcImageSize;\nuniform bool u_projection;\nvec2 projectPixelLocation(vec2 coords) {\nvec2 index_image \x3d floor(coords * u_targetImageSize);\nvec2 oneTransformPixel \x3d vec2(0.25 / u_transformGridSize.s, 1.0 / u_transformGridSize.t);\nvec2 index_transform \x3d floor(index_image / u_transformSpacing) / u_transformGridSize;\nvec2 pos \x3d fract((index_image + vec2(0.5, 0.5)) / u_transformSpacing);\nvec2 srcLocation;\nvec2 transform_location \x3d index_transform + oneTransformPixel * 0.5;\nif (pos.s \x3c\x3d pos.t) {\nvec4 ll_abc \x3d texture2D(u_transformGrid, vec2(transform_location.s, transform_location.t));\nvec4 ll_def \x3d texture2D(u_transformGrid, vec2(transform_location.s + oneTransformPixel.s, transform_location.t));\nsrcLocation.s \x3d dot(ll_abc.rgb, vec3(pos, 1.0));\nsrcLocation.t \x3d dot(ll_def.rgb, vec3(pos, 1.0));\n} else {\nvec4 ur_abc \x3d texture2D(u_transformGrid, vec2(transform_location.s + 2.0 * oneTransformPixel.s, transform_location.t));\nvec4 ur_def \x3d texture2D(u_transformGrid, vec2(transform_location.s + 3.0 * oneTransformPixel.s, transform_location.t));\nsrcLocation.s \x3d dot(ur_abc.rgb, vec3(pos, 1.0));\nsrcLocation.t \x3d dot(ur_def.rgb, vec3(pos, 1.0));\n}\nreturn srcLocation;// + halfPixel;\n}\nvoid main() {\nif (u_projection) {\nv_texCoord \x3d projectPixelLocation(a_texCoord);\n} else {\nv_texCoord \x3d u_xformOffset + a_texCoord * u_xformScale;\n}\nif (u_flipY) {\nv_texCoord.t \x3d 1.0 - v_texCoord.t;\n}\nvec2 position \x3d a_texCoord * 2.0 - 1.0;\nif (u_drawMeshLines){\nvec2 adjustedPos \x3d (v_texCoord - u_xformOffset) / u_xformScale;\ngl_Position \x3d vec4( adjustedPos * 2.0 - 1.0, 0.0, 1.0);\n}\nelse {\ngl_Position \x3d vec4(position, 0.0, 1.0);\n}\n}"}})},
"esri/layers/rasterLib/function/webglHelper":function(){define([],function(){var H={getUniforms:function(d,m){var n=d.getProgramParameter(m,d.ACTIVE_UNIFORMS),q,f,c={};for(q=0;q<n;q++)(f=d.getActiveUniform(m,q))&&(c[f.name]={location:d.getUniformLocation(m,f.name),info:f});return c},setUniform:function(d,m,n){var q=m.info,f=m.location,c=q.type;if(null==n)console.log("uniform "+m.info.name+" has null or undefined value");else switch(c){case d.FLOAT:1<q.size?0===n.length?console.log("uniform "+m.info.name+
" has length 0"):d.uniform1fv(f,n):d.uniform1f(f,n);break;case d.FLOAT_VEC2:if(0===n.length){console.log("uniform "+m.info.name+" has length 0");break}d.uniform2fv(f,n);break;case d.FLOAT_VEC3:if(0===n.length){console.log("uniform "+m.info.name+" has length 0");break}d.uniform3fv(f,n);break;case d.FLOAT_VEC4:if(0===n.length){console.log("uniform "+m.info.name+" has length 0");break}d.uniform4fv(f,n);break;case d.INT:case d.BOOL:1<q.size?0===n.length?console.log("uniform "+m.info.name+" has length 0"):
d.uniform1iv(f,n):d.uniform1i(f,n);break;case d.INT_VEC2:case d.BOOL_VEC2:if(0===n.length){console.log("uniform "+m.info.name+" has length 0");break}d.uniform2iv(f,n);break;case d.INT_VEC3:case d.BOOL_VEC3:if(0===n.length){console.log("uniform "+m.info.name+" has length 0");break}d.uniform3iv(f,n);break;case d.INT_VEC4:case d.BOOL_VEC4:0===n.length?console.log("uniform "+m.info.name+" has length 0"):d.uniform4iv(f,n)}},createTexture:function(d,m){var n=d.createTexture();d.bindTexture(d.TEXTURE_2D,
n);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,m?d.LINEAR:d.NEAREST);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,m?d.LINEAR:d.NEAREST);return n},createBufferTexture:function(d,m,n){m=H.createTexture(d,m);d.getExtension("OES_texture_float");n=n||[d.drawingBufferWidth,d.drawingBufferHeight];d.texImage2D(d.TEXTURE_2D,0,d.RGBA,n[0],n[1],0,d.RGBA,d.FLOAT,null);n=d.createFramebuffer();
d.bindFramebuffer(d.FRAMEBUFFER,n);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,m,0);return{texture:m,frameBuffer:n}},getShader:function(d,m,n){n=n?d.createShader(d.VERTEX_SHADER):d.createShader(d.FRAGMENT_SHADER);d.shaderSource(n,m);d.compileShader(n);d.getShaderParameter(n,d.COMPILE_STATUS)||(console.log(d.getShaderInfoLog(n)),n=null);return n},loadProgram:function(d,m,n){var q=d.createProgram();d.attachShader(q,m);d.attachShader(q,n);d.linkProgram(q);d.getProgramParameter(q,
d.LINK_STATUS)||(console.warn("failed to load webgl program: "+d.getProgramInfoLog(q)),d.deleteProgram(q),q=null);return q},createMesh:function(d,m){if(!d||1===d[0]&&1===d[1])return new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);var n=d&&m?new Float32Array(d[0]*d[1]*20):new Float32Array(d[0]*d[1]*12);var q=.9998/d[1],f=.9998/d[0],c,a,b=0;for(c=0;c<d[1];c++)for(a=0;a<d[0];a++){var k=1E-4+q*c;var h=1E-4+f*a;d&&!m?(n[b++]=k,n[b++]=h,n[b++]=k+q,n[b++]=h,n[b++]=k,n[b++]=h+f,n[b++]=k,n[b++]=h+f,n[b++]=k+q,
n[b++]=h,n[b++]=k+q,n[b++]=h+f):(n[b++]=k,n[b++]=h,n[b++]=k,n[b++]=h+f,n[b++]=k,n[b++]=h+f,n[b++]=k+q,n[b++]=h+f,n[b++]=k+q,n[b++]=h+f,n[b++]=k+q,n[b++]=h,n[b++]=k,n[b++]=h,n[b++]=k+q,n[b++]=h,n[b++]=k,n[b++]=h+f,n[b++]=k+q,n[b++]=h)}return n}};return H})},"esri/layers/rasterLib/function/convolutionKernel":function(){define([],function(){var H={Default:[0,0,0,0,1,0,0,0,0],LineDetectionHorizontal:[-1,-1,-1,2,2,2,-1,-1,-1],LineDetectionVertical:[-1,2,-1,-1,2,-1,-1,2,-1],LineDetectionLeftDiagonal:[2,
-1,-1,-1,2,-1,-1,-1,2],LineDetectionRightDiagonal:[-1,-1,2,-1,2,-1,2,-1,-1],GradientNorth:[-1,-2,-1,0,0,0,1,2,1],GradientWest:[-1,0,1,-2,0,2,-1,0,1],GradientEast:[1,0,-1,2,0,-2,1,0,-1],GradientSouth:[1,2,1,0,0,0,-1,-2,-1],GradientNorthEast:[0,-1,-2,1,0,-1,2,1,0],GradientNorthWest:[-2,-1,0,-1,0,1,0,1,2],SmoothArithmeticMean:[.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111],Smoothing3x3:[.0625,.125,.0625,.125,.25,.125,.0625,
.125,.0625],Smoothing5x5:[1,1,1,1,1,1,4,4,4,1,1,4,12,4,1,1,4,4,4,1,1,1,1,1,1],Sharpening3x3:[-1,-1,-1,-1,9,-1,-1,-1,-1],Sharpening5x5:[-1,-3,-4,-3,-1,-3,0,6,0,-3,-4,6,21,6,-4,-3,0,6,0,-3,-1,-3,-4,-3,-1],Laplacian3x3:[0,-1,0,-1,4,-1,0,-1,0],Laplacian5x5:[0,0,-1,0,0,0,-1,-2,-1,0,-1,-2,17,-2,-1,0,-1,-2,-1,0,0,0,-1,0,0],SobelHorizontal:[-1,-2,-1,0,0,0,1,2,1],SobelVertical:[-1,0,1,-2,0,2,-1,0,1],Sharpen:[0,-.25,0,-.25,2,-.25,0,-.25,0],Sharpen2:[-.25,-.25,-.25,-.25,3,-.25,-.25,-.25,-.25],PointSpread:[-.627,
.352,-.627,.352,2.923,.352,-.627,.352,-.627],getKernel:function(d){switch(d){case 0:return H.LineDetectionHorizontal;case 1:return H.LineDetectionVertical;case 2:return H.LineDetectionLeftDiagonal;case 3:return H.LineDetectionRightDiagonal;case 4:return H.GradientNorth;case 5:return H.GradientWest;case 6:return H.GradientEast;case 7:return H.GradientSouth;case 8:return H.GradientNorthEast;case 9:return H.GradientNorthWest;case 10:return H.SmoothArithmeticMean;case 11:return H.Smoothing3x3;case 12:return H.Smoothing5x5;
case 13:return H.Sharpening3x3;case 14:return H.Sharpening5x5;case 15:return H.Laplacian3x3;case 16:return H.Laplacian5x5;case 17:return H.SobelHorizontal;case 18:return H.SobelVertical;case 19:return H.Sharpen;case 20:return H.Sharpen2;case 21:return H.PointSpread;default:return H.Default}}};return H})},"esri/layers/rasterLib/function/surfaceUtils":function(){define(["dojo/_base/lang"],function(H){return{hillshade:function(d,m){if(null!==d&&null!==d.pixelBlock&&null!==d.pixelBlock.pixels){var n=
this._clonePixelBlock(d.pixelBlock),q=m.altitude,f=m.azimuth,c=m.zFactor,a=m.psPower,b=m.psFactor,k=m.hillshadeType,h=m.slopeType,g=m.isGCS;1===k&&(c*=2);m=n.width;var e=n.height,l=n.pixels[0],p=n.mask,v=new Uint8Array(m*e);p&&v.set(p);var z=new Uint8Array(m*e),u=(d.extent.xmax-d.extent.xmin)/m,E=(d.extent.ymax-d.extent.ymin)/e,w=c/(8*u),F=c/(8*E);.001<c&&g&&(w/=111E3,F/=111E3);3===h&&(g?(w=111E3*u,F=111E3*E,w=(c+Math.pow(w,a)*b)/(8*w),F=(c+Math.pow(F,a)*b)/(8*F)):(w=(c+Math.pow(u,a)*b)/(8*u),F=(c+
Math.pow(E,a)*b)/(8*E)));g=(90-q)*Math.PI/180;q=Math.cos(g);var y=(360-f+90)*Math.PI/180;f=Math.sin(g)*Math.cos(y);g=Math.sin(g)*Math.sin(y);c=[];a=[];b=[];u=[315,270,225,360,180,0];var D=[60,60,60,60,60,90];h=[3,5,3,2,1,4];var B=h.reduce(function(aa,ea){return aa+ea});E=h.map(function(aa){return aa/B});if(1===k){var x=u.length;for(h=0;h<x;h++)q=D[h],f=u[h],g=(90-q)*Math.PI/180,q=Math.cos(g),y=(360-f+90)*Math.PI/180,f=Math.sin(g)*Math.cos(y),g=Math.sin(g)*Math.sin(y),c.push(q),a.push(f),b.push(g)}var r=
0;for(h=1;h<e-1;h++)for(D=h*m,u=1;u<m-1;u++)if(p&&!p[D+u])z[D+u]=0;else{y=0;if(p&&(y=p[D-m+u-1]+p[D-m+u]+p[D-m+u+1]+p[D+u-1]+p[D+u+1]+p[D+m+u-1]+p[D+m+u]+p[D+m+u+1],7>y)){z[D+u]=0;v[D+u]=0;continue}if(7===y){var t=p[D-m+u-1]?l[D-m+u-1]:l[D+u];var C=p[D-m+u]?l[D-m+u]:l[D+u];var J=p[D-m+u+1]?l[D-m+u+1]:l[D+u];y=p[D+u-1]?l[D+u-1]:l[D+u];var L=p[D+u+1]?l[D+u+1]:l[D+u];r=p[D+m+u-1]?l[D+m+u-1]:l[D+u];var P=p[D+m+u]?l[D+m+u]:l[D+u];var U=p[D+m+u+1]?l[D+m+u+1]:l[D+u]}else t=l[D-m+u-1],C=l[D-m+u],J=l[D-m+
u+1],y=l[D+u-1],L=l[D+u+1],r=l[D+m+u-1],P=l[D+m+u],U=l[D+m+u+1];y=(J+L+L+U-(t+y+y+r))*w;C=(r+P+P+U-(t+C+C+J))*F;J=Math.sqrt(1+y*y+C*C);r=0;if(0===k)P=g*C-f*y,P=255*(q+P)/J,0>P&&(P=0),r=P;else if(1===k)for(t=0;t<x;t++)P=b[t]*C-a[t]*y,P=255*(c[t]+P)/J,0>P&&(P=0),r+=P*E[t];z[D+u]=r}for(h=0;h<e;h++)z[h*m]=z[h*m+1],z[(h+1)*m-1]=z[(h+1)*m-2];for(h=1;h<m-1;h++)z[h]=z[h+m],z[h+(e-1)*m]=z[h+(e-2)*m];n.pixelType="U8";n.pixels=[z];n.statistics=[{minValue:0,maxValue:255}];p&&(n.mask=v);return{extent:d.extent,
pixelBlock:n}}},slope:function(d,m){if(null!==d&&null!==d.pixelBlock&&null!==d.pixelBlock.pixels){var n=this._clonePixelBlock(d.pixelBlock),q=m.zFactor,f=m.psPower,c=m.psFactor,a=m.slopeType,b=m.isGCS;m=n.width;var k=n.height,h=n.pixels[0],g=n.mask,e=new Uint8Array(m*k);g&&e.set(g);var l=new Float32Array(m*k),p=(d.extent.xmax-d.extent.xmin)/m,v=(d.extent.ymax-d.extent.ymin)/k,z=q/(8*p),u=q/(8*v);1E-4>Math.abs(q-1)&&b&&(z/=111E3,u/=111E3);3===a&&(b?(z=111E3*p,u=111E3*v,z=(q+Math.pow(z,f)*c)/(8*z),
u=(q+Math.pow(u,f)*c)/(8*u)):(z=(q+Math.pow(p,f)*c)/(8*p),u=(q+Math.pow(v,f)*c)/(8*v)));for(q=1;q<k-1;q++)for(c=q*m,f=1;f<m-1;f++)if(g&&!g[c+f])l[c+f]=0;else{v=0;if(g&&(v=g[c-m+f-1]+g[c-m+f]+g[c-m+f+1]+g[c+f-1]+g[c+f+1]+g[c+m+f-1]+g[c+m+f]+g[c+m+f+1],7>v)){l[c+f]=0;e[c+f]=0;continue}if(7===v){v=g[c-m+f-1]?h[c-m+f-1]:h[c+f];b=g[c-m+f]?h[c-m+f]:h[c+f];p=g[c-m+f+1]?h[c-m+f+1]:h[c+f];var E=g[c+f-1]?h[c+f-1]:h[c+f];var w=g[c+f+1]?h[c+f+1]:h[c+f];var F=g[c+m+f-1]?h[c+m+f-1]:h[c+f];var y=g[c+m+f]?h[c+m+
f]:h[c+f];var D=g[c+m+f+1]?h[c+m+f+1]:h[c+f]}else v=h[c-m+f-1],b=h[c-m+f],p=h[c-m+f+1],E=h[c+f-1],w=h[c+f+1],F=h[c+m+f-1],y=h[c+m+f],D=h[c+m+f+1];E=(p+w+w+D-(v+E+E+F))*z;v=(F+y+y+D-(v+b+b+p))*u;v=Math.sqrt(E*E+v*v);l[c+f]=1===a||3===a?57.2957795*Math.atan(v):100*v}for(q=0;q<k;q++)l[q*m]=l[q*m+1],l[(q+1)*m-1]=l[(q+1)*m-2];for(q=1;q<m-1;q++)l[q]=l[q+m],l[q+(k-1)*m]=l[q+(k-2)*m];n.pixelType="F32";n.pixels=[l];n.statistics=[{minValue:0,maxValue:255}];g&&(n.mask=e);return{extent:d.extent,pixelBlock:n}}},
aspect:function(d){if(null!==d&&null!==d.pixelBlock&&null!==d.pixelBlock.pixels){var m=this._clonePixelBlock(d.pixelBlock),n=m.width,q=m.height,f=m.pixels[0],c=m.mask,a=new Uint8Array(n*q);c&&a.set(c);var b=new Float32Array(n*q),k=1/((d.extent.xmax-d.extent.xmin)/n),h=1/((d.extent.ymax-d.extent.ymin)/q),g,e;for(g=1;g<q-1;g++){var l=g*n;for(e=1;e<n-1;e++)if(c&&!c[l+e])b[l+e]=0;else{var p=0;if(c&&(p=c[l-n+e-1]+c[l-n+e]+c[l-n+e+1]+c[l+e-1]+c[l+e+1]+c[l+n+e-1]+c[l+n+e]+c[l+n+e+1],7>p)){b[l+e]=0;a[l+e]=
0;continue}if(7===p){p=c[l-n+e-1]?f[l-n+e-1]:f[l+e];var v=c[l-n+e]?f[l-n+e]:f[l+e];var z=c[l-n+e+1]?f[l-n+e+1]:f[l+e];var u=c[l+e-1]?f[l+e-1]:f[l+e];var E=c[l+e+1]?f[l+e+1]:f[l+e];var w=c[l+n+e-1]?f[l+n+e-1]:f[l+e];var F=c[l+n+e]?f[l+n+e]:f[l+e];var y=c[l+n+e+1]?f[l+n+e+1]:f[l+e]}else p=f[l-n+e-1],v=f[l-n+e],z=f[l-n+e+1],u=f[l+e-1],E=f[l+e+1],w=f[l+n+e-1],F=f[l+n+e],y=f[l+n+e+1];u=(z+E+E+y-(p+u+u+w))*k;p=(w+F+F+y-(p+v+v+z))*h;0===u&&0===p?p=-1:(p=90-57.29578*Math.atan2(p,-u),0>p&&(p+=360),360===p?
p=0:360<p&&(p%=360));b[l+e]=p}}for(g=0;g<q;g++)b[g*n]=b[g*n+1],b[(g+1)*n-1]=b[(g+1)*n-2];for(g=1;g<n-1;g++)b[g]=b[g+n],b[g+(q-1)*n]=b[g+(q-2)*n];m.pixelType="F32";m.pixels=[b];m.statistics={minValue:0,maxValue:360};c&&(m.mask=a);return{extent:d.extent,pixelBlock:m}}},_clonePixelBlock:function(d){return d.clone?d.clone():H.clone(d)}}})},"esri/layers/rasterLib/function/BandArithmeticFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./rasterIndex".split(" "),
function(H,d,m,n,q,f,c){return H([m,f],{declaredClass:"esri.layers.rasterLib.function.BandArithmeticFunction",functionName:"BandArithmetic",supportWebGL:!0,support2D:!0,constructor:function(a){this.functionArguments=this.mixinIgnoreCase({method:1,bandIndexes:"",raster:null},a)},bind:function(a){a=this.getSourceRasterInfo(a);if(!a.raster)return Error("The raster input to band arithmetic function is invalid.");this.rasterInfo=d.mixin(a.raster,{bandCount:8===this.functionArguments.method?a.raster.bandCount:
1,pixelType:this._calculatePixelType(this.pixelType,"F32"),statistics:null,histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Generic";return!0},read2D:function(a){this._performance.start();a=a.raster;var b=c.calculate(a.pixelBlock,{bandIndexes:this.functionArguments.bandIndexes,method:this.functionArguments.method});this._addPerformanceMetric(this._performance.elapsed());"Unknown"!==this.pixelType&&(b.pixelType=this.pixelType);
return{extent:a.extent,pixelBlock:b}},readGL:function(a){this._performance.start();this._initializeProgram({fragment:q.bandArithmetic,fragmentName:"bandArithmetic"});var b=this.functionArguments.bandIndexes.trim().split(" ").map(function(e){return parseInt(e,10)});this._infraredBandID=b[0]-1;this._visibleBandID=b[1]-1;this._alterBand=2<Math.max(this._infraredBandID,this._visibleBandID)?!0:!1;a=this._setupTextureData(a.raster,this._alterBand&&2==b.length?{bandIDs:[this._infraredBandID,this._visibleBandID,
this._infraredBandID]}:{bandIDs:[b[0]-1,b[1]-1,b[2]-1]});var k=this.bindFrameBuffer(),h=this.functionArguments.method,g=2<b.length?b.slice(2):null;this._alterBand?this._setUniforms({u_method:h,u_bandId_nir:0,u_bandId_red:1,u_constants:g}):this._setUniforms({u_method:h,u_bandId_nir:b[0]-1,u_bandId_red:b[1]-1,u_constants:g});this._bindTexture(a.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:a.extent,texture:k.texture}}})})},"esri/layers/rasterLib/function/rasterIndex":function(){define(["dojo/_base/lang"],
function(H){return{calculate:function(d,m){if(d&&d.pixels&&d.pixels.length){var n=m&&m.bandIndexes;m=m&&m.method;var q=n.trim().split(" ").map(function(a){return parseInt(a,10)}).filter(function(a){return null!=a});d=this._clonePixelBlock(d);var f=d.pixels,c=d.mask;switch(m){case 1:f=this._calculateNDVI(c,f[q[0]-1],f[q[1]-1]);break;case 2:f=this._calculateSAVI(c,f[q[0]-1],f[q[1]-1],q[2]);break;case 3:f=this._calculateTSAVI(c,f[q[0]-1],f[q[1]-1],q[2],q[3],q[4]);break;case 4:f=this._calculateMSAVI(c,
f[q[0]-1],f[q[1]-1]);break;case 5:f=this._calculateGEMI(c,f[q[0]-1],f[q[1]-1]);break;case 6:f=this._calculatePVI(c,f[q[0]-1],f[q[1]-1],q[2],q[3]);break;case 7:f=this._calculateGVITM(c,f[q[0]-1],f[q[1]-1],f[q[2]-1],f[q[3]-1],f[q[4]-1],f[q[5]-1]);break;case 8:f=this._calculateSultan(c,f[q[0]-1],f[q[1]-1],f[q[2]-1],f[q[3]-1],f[q[4]-1],f[q[5]-1]);break;case 9:f=this._calculateVARI(c,f[q[0]-1],f[q[1]-1],f[q[2]-1]);break;case 0:f=this._calculateUserDefined(c,f,n)}d.pixels=f;d.pixelType="F32";d.calculateStatistics();
return d}},_clonePixelBlock:function(d){return d.clone?d.clone():H.clone(d)},_parseUserDefined:function(d,m){d=d.replace(" ","");0===d.indexOf("-")&&(d="0"+d);0===d.indexOf("+")&&(d=d.slice(1,d.length));d=d.split("");var n=[],q=[],f="+-*/()".split(""),c,a="";for(c=0;c<d.length;c++){var b=d[c];f.some(function(k){return k===b})?(""!==a&&q.push(parseFloat(a)),n.push(b),a=""):"b"===b.toLowerCase()?(c++,a=b.concat(d[c]),q.push(m[parseInt(a[1],10)-1]),a=""):(a=a.concat(b),c===d.length-1&&q.push(parseFloat(a)))}return{ops:n,
nums:q}},_op:function(d,m,n,q){if(n.constructor===Number&&q.constructor===Number)return n+q;var f;if(n.constructor===Number){var c=q.length;var a=n;n=new Float32Array(c);for(f=0;f<c;f++)n[f]=a}else if(c=n.length,q.constructor===Number)for(a=q,q=new Float32Array(c),f=0;f<c;f++)q[f]=a;a=new Float32Array(c);if(null==d)if("+"===m)for(f=0;f<c;f++)a[f]=n[f]+q[f];else if("-"===m)for(f=0;f<c;f++)a[f]=n[f]-q[f];else if("*"===m)for(f=0;f<c;f++)a[f]=n[f]*q[f];else{if("/"===m)for(f=0;f<c;f++)a[f]=n[f]/q[f]}else if("+"===
m)for(f=0;f<c;f++)d[f]&&(a[f]=n[f]+q[f]);else if("-"===m)for(f=0;f<c;f++)d[f]&&(a[f]=n[f]-q[f]);else if("*"===m)for(f=0;f<c;f++)d[f]&&(a[f]=n[f]*q[f]);else if("/"===m)for(f=0;f<c;f++)d[f]&&(a[f]=n[f]/q[f]);return a},_shrinkOp:function(d,m){d.splice(m,1);var n=m=0,q=0;do{for(m=q=n=0;m<d.length;m++)if("("===d[m])n=m;else if(")"===d[m]){q=m;break}q===n+1&&d.splice(n,2)}while(q===n+1);return d},_getPriorityOpIndex:function(d,m){if(1===d.length)return{opIndex:0,numIndex:0};var n=m=0,q=0,f=-1,c=0;for(m=
0;m<d.length;m++)if("("===d[m])n=m;else if(")"===d[m]){q=m;break}var a=0===q?d:d.slice(n+1,q);for(m=0;m<a.length;m++)if("*"===a[m]||"/"===a[m]){f=m;break}if(!(-1<f))for(m=0;m<a.length;m++)if("+"===a[m]||"-"===a[m]){f=m;break}0<q&&(f+=n+1);for(m=0;m<f;m++)"("===d[m]&&c++;return{opIndex:f,numIndex:f-c}},_calculateUserDefined:function(d,m,n){m=this._parseUserDefined(n,m);n=m.ops;for(var q=m.nums,f,c,a;0<n.length&&(m=this._getPriorityOpIndex(n,q),f=n[m.opIndex],c=q[m.numIndex],a=q[m.numIndex+1],f=this._op(d,
f,c,a),1!==n.length);)n=this._shrinkOp(n,m.opIndex),q.splice(m.numIndex,2,f);return[f]},_calculateNDVI:function(d,m,n){var q=n.length,f=new Float32Array(q),c;if(null==d)for(c=0;c<q;c++){var a=n[c];var b=m[c];f[c]=(b-a)/(b+a)}else for(c=0;c<q;c++)d[c]&&(a=n[c],b=m[c],f[c]=(b-a)/(b+a));return[f]},_calculateSAVI:function(d,m,n,q){var f=n.length,c=new Float32Array(f),a;if(null==d)for(a=0;a<f;a++){var b=n[a];var k=m[a];c[a]=(k-b)/(k+b+q)*(1+q)}else for(a=0;a<f;a++)d[a]&&(b=n[a],k=m[a],c[a]=(k-b)/(k+b+
q)*(1+q));return[c]},_calculateTSAVI:function(d,m,n,q,f,c){var a=n.length,b=new Float32Array(a),k=-f*q+c*(1+q*q);if(null==d)for(c=0;c<a;c++){var h=n[c];var g=m[c];b[c]=q*(g-q*h-f)/(f*g+h+k)}else for(c=0;c<a;c++)d[c]&&(h=n[c],g=m[c],b[c]=q*(g-q*h-f)/(f*g+h+k));return[b]},_calculateMSAVI:function(d,m,n){var q=n.length,f=new Float32Array(q),c;if(null==d)for(c=0;c<q;c++){var a=n[c];var b=m[c];f[c]=.5*(2*(b+1)-Math.sqrt(Math.pow(2*b+1,2)-8*(b-a)))}else for(c=0;c<q;c++)d[c]&&(f[c]=.5*(2*(b+1)-Math.sqrt(Math.pow(2*
b+1,2)-8*(b-a))));return[f]},_calculateGEMI:function(d,m,n){var q=n.length,f=new Float32Array(q),c;if(null==d)for(c=0;c<q;c++){var a=n[c];var b=m[c];b=(2*(b*b-a*a)+1.5*b+.5*a)/(b+a+.5);f[c]=b*(1-.25*b)-(a-.125)/(1-a)}else for(c=0;c<q;c++)d[c]&&(a=n[c],b=m[c],b=(2*(b*b-a*a)+1.5*b+.5*a)/(b+a+.5),f[c]=b*(1-.25*b)-(a-.125)/(1-a));return[f]},_calculatePVI:function(d,m,n,q,f){var c=n.length,a=new Float32Array(c),b,k=Math.sqrt(1+q*q);if(null==d)for(b=0;b<c;b++){var h=n[b];var g=m[b];a[b]=(g-q*h-f)/k}else for(b=
0;b<c;b++)d[b]&&(h=n[b],g=m[b],a[b]=(g-q*h-f)/k);return[a]},_calculateGVITM:function(d,m,n,q,f,c,a){var b=m.length,k=new Float32Array(b),h;if(null==d)for(h=0;h<b;h++)k[h]=-.2848*m[h]-.2435*n[h]-.5436*q[h]+.7243*f[h]+.084*c[h]-1.18*a[h];else for(h=0;h<b;h++)d[h]&&(k[h]=-.2848*m[h]-.2435*n[h]-.5436*q[h]+.7243*f[h]+.084*c[h]-1.18*a[h]);return[k]},_calculateSultan:function(d,m,n,q,f,c,a){n=m.length;var b=new Float32Array(n),k=new Float32Array(n),h=new Float32Array(n),g;if(null==d)for(g=0;g<n;g++)b[g]=
c[g]/a[g]*100,k[g]=c[g]/m[g]*100,h[g]=q[g]/f[g]*(c[g]/f[g])*100;else for(g=0;g<n;g++)d[g]&&(b[g]=c[g]/a[g]*100,k[g]=c[g]/m[g]*100,h[g]=q[g]/f[g]*(c[g]/f[g])*100);return[b,k,h]},_calculateVARI:function(d,m,n,q){var f=m.length,c=new Float32Array(f),a;if(null==d)for(a=0;a<f;a++){var b=m[a];var k=n[a];var h=q[a];c[a]=(k-b)/(k+b-h)}else for(a=0;a<f;a++)if(d[a])for(a=0;a<f;a++)b=m[a],k=n[a],h=q[a],c[a]=(k-b)/(k+b-h);return[c]}}})},"esri/layers/rasterLib/function/ColormapFunction":function(){define("dojo/_base/declare dojo/_base/lang ../../../renderers/colorRampGenerator ./RasterFunctionX ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),
function(H,d,m,n,q,f,c){return H([n,f],{declaredClass:"esri.layers.rasterLib.function.ColormapFunction",functionName:"Colormap",pixelType:"U8",renderTexture:!1,supportWebGL:!0,support2D:!0,constructor:function(a){this.functionArguments=this.mixinIgnoreCase({colormap:null,colorRampName:null,colorRamp:null,colorMapName:null,raster:null},a);this.invert=a&&a.invert;a=a.colormap||a.Colormap;if(a){if(a.features||a[0].attributes){a=a.features||a;var b=Object.keys(a[0].attributes);var k=b.filter(function(v){return"alpha"===
v.toLowerCase()})[0];var h=b.filter(function(v){return"value"===v.toLowerCase()})[0];var g=b.filter(function(v){return"red"===v.toLowerCase()})[0];var e=b.filter(function(v){return"green"===v.toLowerCase()})[0];var l=b.filter(function(v){return"blue"===v.toLowerCase()})[0];if(!(h&&g&&e&&l))throw"invalid colormap";a=a.map(function(v){return k?[v.attributes[h],v.attributes[g],v.attributes[e],v.attributes[l],v.attributes[k]]:[v.attributes[h],v.attributes[g],v.attributes[e],v.attributes[l]]});var p=1.1>
Math.max.apply(null,a.map(function(v){return v[1]}));b=k&&1.1>Math.max.apply(null,a.map(function(v){return v[4]}));if(p)for(p=0;p<a.length;p++)a[p][1]=Math.round(255*a[p][1]),a[p][2]=Math.round(255*a[p][2]),a[p][3]=Math.round(255*a[p][3]),b&&(a[p][4]=Math.round(255*a[p][4]))}this.functionArguments.colormap=this._sortClr(a)}this._initialize()},bind:function(a){this._initialize();a=this.getSourceRasterInfo(a);if(!a.raster||"F32"===a.raster.pixelType)return Error("The raster input to colormap function is invalid. It must be integer type.");
this.rasterInfo=d.mixin(a.raster,{bandCount:3,pixelType:this._calculatePixelType(this.pixelType,"U8"),statistics:null,histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Processed";return!0},read2D:function(a){return this._colorize(a.raster)},readGL:function(a){return this._colorizeGL(a.raster)},_colorize:function(a){this._performance.start();var b=c.colorize(a.pixelBlock,{indexedColormap:this._indexedColormap,indexedColormapOffset:this._indexedColormapOffset,
indexed2DColormap:this._indexed2DColormap,alphaSpecified:this._alphaSpecified});this._addPerformanceMetric(this._performance.elapsed());return{extent:a.extent,pixelBlock:b}},_binarySearchClr:function(a,b){for(var k=0,h=a.length-1,g=0,e=0;k<h;)if(g=Math.floor((k+h)/2),e=a[g],e[0]<b)k=g;else if(e[0]>b)h=g;else return e.slice(1);return null},_sortClr:function(a,b){var k,h=[];for(k=0;k<a.length;k++)h.push(a[k]);for(k=0;k<h.length-1;k++){var g=h[k];for(a=k+1;a<h.length;a++)g[0]>h[a][0]&&(g=h[a],h[a]=h[k],
h[k]=g)}if(b)for(k=0;k<h.length/2;k++)g=h[k],h[h.length-1-k]=h[k],h[k]=g;return h},_invertColorRamp:function(a){if(!a)return a;var b={type:a.type};"random"===a.type?b=a:"multipart"===a.type?b.colorRamps=a.colorRamps.map(function(k){return{fromColor:k.toColor,toColor:k.fromColor}}).reverse():(b.fromColor=a.toColor,b.toColor=a.fromColor);return b},_initialize:function(){this._indexedColormapOffset=0;if(this.functionArguments.colormap){var a=c.buildIndexedColormap(this.functionArguments.colormap);this._alphaSpecified=
a&&a.alphaSpecified;this._indexedColormap=a&&a.indexedColormap;this._indexedColormapOffset=a&&a.offset;this._indexedColormap||(this._indexed2DColormap=this._getIndexed2DColormap())}else this.functionArguments.colorRamp?this._indexedColormap="multipart"===this.functionArguments.colorRamp.type?this.invert?m.createMultiPartColorRamp(this._invertColorRamp(this.functionArguments.colorRamp)):m.createMultiPartColorRamp(this.functionArguments.colorRamp):this.invert?m.createAlgorithmicColorRamp(this._invertColorRamp(this.functionArguments.colorRamp)):
m.createAlgorithmicColorRamp(this.functionArguments.colorRamp):this.functionArguments.colormapName&&"random"===this.functionArguments.colormapName.toLowerCase()&&(this._indexedColormap=m.createRandomColorRamp())},_getIndexed2DColormap:function(){var a=this.functionArguments.colormap;if(!a)return null;var b=0;0>a[0][0]&&(b=a[0][0]);var k=[],h=5===a[0].length,g;for(g=0;g<a.length;g++)k[a[g][0]-b]=h?a[g].slice(1):a[g].slice(1).concat([255]);return k},_colorizeGL:function(a){this._performance.start();
this._initializeProgram({fragment:q.colormap,fragmentName:"Colormap"});var b=this._indexedColormap,k=this._indexedColormapOffset;this._clrTexture||(this._clrTexture=this._setupColormapTexture(b));var h=this._clrTexture,g=this.bindFrameBuffer();a=this._setupTextureData(a);this._setUniforms({u_indexedColormapOffset:k,u_indexedColormapMaxIndex:b.length/4-1});this._bindTexture(h,"u_image1");this._bindTexture(a.texture,"u_image");this._drawGL();return{extent:a.extent,texture:g.texture}},_setupColormapTexture:function(a){var b=
this._createTexture(),k=this.gl,h=a.length/4,g=new Float32Array(a.length),e,l=this.renderTexture?255:1;for(e=0;e<a.length;e++)g[e]=a[e]/l;k.getExtension("OES_texture_float");k.texImage2D(k.TEXTURE_2D,0,k.RGBA,h,1,0,k.RGBA,k.FLOAT,g);return b}})})},"esri/renderers/colorRampGenerator":function(){define(["dojo/_base/declare","dojo/_base/lang","../renderers/colorUtils"],function(H,d,m){return{createAlgorithmicColorRamp:function(n,q){if(!n)return null;var f=n.fromColor,c=n.toColor;if(!f||!c)return null;
void 0===f.r&&3<=f.length&&(f={r:f[0],g:f[1],b:f[2]});void 0===c.r&&3<=c.length&&(c={r:c[0],g:c[1],b:c[2]});var a=n.size||256;n=n.algorithm||"cie-lab";if(1===a)var b=[f.r,f.g,f.b,255];else if(2===a)b=[f.r,f.g,f.b,255,c.r,c.g,f.b,255];else if(-1<n.toLowerCase().indexOf("hsv")){b=m.toHSV(f);c=m.toHSV(c);a=a||256;var k=0===b.s,h=0===c.s;f=b.h;n=c.h;k&&!h?f=b.h=n:h&&!k&&(n=c.h=f);k=Math.abs(n-f);180>k?n=(n-f)/(a-1):(k=360-k,n=f>n?k/(a-1):-k/(a-1));k=(c.s-b.s)/(a-1);h=(c.v-b.v)/(a-1);var g=b.s;b=b.v;var e,
l=new Uint8Array(4*a);for(e=0;e<a-1;e++){var p=m.toRGB({h:f,s:g,v:b});l[4*e]=p.r;l[4*e+1]=p.g;l[4*e+2]=p.b;l[4*e+3]=255;f+=n;g+=k;b+=h;360<f?f-=360:0>f&&(f+=360)}p=m.toRGB(c);l[4*(a-1)]=p.r;l[4*(a-1)+1]=p.g;l[4*(a-1)+2]=p.b;l[4*(a-1)+3]=255;b=l}else if(-1<n.toLowerCase().indexOf("lch")){g=m.toLCH(f);c=m.toLCH(c);a=a||256;b=(c.l-g.l)/(a-1);f=(c.c-g.c)/(a-1);n=(c.h-g.h)/(a-1);k=g.l;h=g.c;g=g.h;l=new Uint8Array(4*a);for(e=0;e<a-1;e++)p=m.toRGB({l:k,c:h,h:g}),l[4*e]=p.r,l[4*e+1]=p.g,l[4*e+2]=p.b,l[4*
e+3]=255,k+=b,h+=f,g+=n;p=m.toRGB(c);l[4*(a-1)]=p.r;l[4*(a-1)+1]=p.g;l[4*(a-1)+2]=p.b;l[4*(a-1)+3]=255;b=l}else if(-1<n.toLowerCase().indexOf("lab")){g=m.toLAB(f);c=m.toLAB(c);a=a||256;b=(c.l-g.l)/(a-1);f=(c.a-g.a)/(a-1);n=(c.b-g.b)/(a-1);k=g.l;h=g.a;g=g.b;l=new Uint8Array(4*a);for(e=0;e<a-1;e++)p=m.toRGB({l:k,a:h,b:g}),l[4*e]=p.r,l[4*e+1]=p.g,l[4*e+2]=p.b,l[4*e+3]=255,k+=b,h+=f,g+=n;p=m.toRGB(c);l[4*(a-1)]=p.r;l[4*(a-1)+1]=p.g;l[4*(a-1)+2]=p.b;l[4*(a-1)+3]=255;b=l}if(q&&!1===q.flattened)for(q=b,
b=[],c=0;c<b/4;c++)b[c]=q.slice(4*c,4*c+4);return b},createMultiPartColorRamp:function(n,q){if(!n)return null;q=q&&d.clone(q)||{flattened:!0};var f=n.colorRamps;if(!f||0===f.length)return null;var c=n.size||256;n=Math.max(Math.floor(c/f.length),1);var a=Math.max(n,c-(f.length-1)*n),b=!1!==q.flattened;q.flattened=!0;c=(f.length-1)*n+a;var k=new Uint8Array(4*c);for(c=0;c<f.length;c++){var h={fromColor:f[c].fromColor,toColor:f[c].toColor,size:c===f.length-1?a:n};k instanceof Array?k.concat(this.createAlgorithmicColorRamp(h,
q)):k.set(this.createAlgorithmicColorRamp(h,q),n*c*4)}if(!b)for(q=k,k=[],c=0;c<k/4;c++)k[c]=q.slice(4*c,4*c+4);return k},createRandomColorRamp:function(n){n=n||{};var q=n.size||256,f=!1===n.flattened;var c=f?new Uint8Array(4*q):[];for(n=0;n<q;n++)f?(c[4*n]=Math.round(255*Math.random()),c[4*n+1]=Math.round(255*Math.random()),c[4*n+2]=Math.round(255*Math.random()),c[4*n+3]=255):c[n]=[Math.round(255*Math.random()),Math.round(255*Math.random()),Math.round(255*Math.random()),255];return c}}})},"esri/layers/rasterLib/function/rasterUtils":function(){define(["dojo/_base/lang"],
function(H){return{mask:function(d,m){if(d&&d.pixels&&d.pixels.length){d=this._clonePixelBlock(d);var n=m.includedRanges,q=m.noDataInterpretation;m=m.noDataValues;if(null===n&&null===m)return d;var f=d.pixels,c=d.mask,a=d.width*d.height,b=f.length,k;if(null!==m&&m.length!==b)throw"expect "+b+" elements in noDataValues";if(null!==n&&n.length!==2*b)throw"expect "+2*b+" elements in IncludeRanges";if(null==c){c=new Uint8Array(a);for(k=0;k<a;k++)c[k]=1;d.mask=c}if(0===q)for(q=0;q<b;q++){var h=f[q];var g=
null===n?null:n[2*q];var e=null===n?null:n[2*q+1];var l=null===m?null:parseFloat(m[q]);if(null===g||null===e)for(k=0;k<a;k++){if(c[k]){var p=h[k];p===l&&(c[k]=0)}}else if(null===l)for(k=0;k<a;k++)c[k]&&(p=h[k],p<g||p>e)&&(c[k]=0);else for(k=0;k<a;k++)c[k]&&(p=h[k],p<g||p>e||p===l)&&(c[k]=0)}else{var v=new Uint8Array(a);for(k=0;k<a;k++)v[k]=c[k];for(q=0;q<b;q++)if(h=f[q],g=null===n?null:n[2*q],e=null===n?null:n[2*q+1],l=null===m?null:parseFloat(m[q]),null===g||null===e)for(k=0;k<a;k++)v[k]&&(p=h[k],
p!==l&&(v=0));else if(null===l)for(k=0;k<a;k++)v[k]&&(p=h[k],p<=g&&p<=e&&(v=0));else for(k=0;k<a;k++)v[k]&&(p=h[k],p<=g&&p<=e&&p!==l&&(v=0));for(k=0;k<a;k++)c[k]&&v[k]&&(c[k]=0)}return d}},calculateStatisticsHistograms:function(d,m){d=this._clonePixelBlock(d);m=d.pixelType;var n=d.pixels,q=d.mask,f=n.length,c,a,b=[],k;for(c=0;c<f;c++){var h={min:-.5,max:255.5,size:256,counts:new Uint32Array(256)};var g=h.counts;var e=n[c];if("U8"===m)if(q)for(a=0;a<d.width*d.height;a++)q[a]&&g[e[a]]++;else for(a=
0;a<d.width*d.height;a++)g[e[a]]++;else{var l=d.statistics[c].minValue;var p=d.statistics[c].maxValue;h.min=l;h.max=p;p=(p-l)/256;var v=new Uint32Array(257);if(q)for(a=0;a<d.width*d.height;a++)q[a]&&v[Math.floor((e[a]-l)/p)]++;else for(a=0;a<d.width*d.height;a++)v[Math.floor((e[a]-l)/p)]++;for(a=0;255>a;a++)g[a]=v[a];g[255]=v[255]+v[256]}b.push(h);l=d.statistics[c].minValue;p=d.statistics[c].maxValue;for(a=v=k=e=0;a<h.size;a++)e+=g[a],k+=a*g[a];k/=e;for(a=0;a<h.size;a++)v+=g[a]*Math.pow(a-k,2);g=
Math.sqrt(v/(e-1));a=(k+.5)*(h.max-h.min)/h.size+h.min;h=g*(h.max-h.min)/h.size;d.statistics[c]={min:l,minValue:l,max:p,maxValue:p,mean:a,stddev:h}}d.histograms=b;return d},buildIndexedColormap:function(d,m){if(!d)return null;var n=0;0>d[0][0]&&(n=d[0][0]);var q=Math.max(256,d[d.length-1][0]-n);if(65536<q)return null;var f=new Uint8Array(4*q),c=[],a=0,b=5===d[0].length;if(m)for(c=d[a],m=c[0]-n;m<q;m++)f[4*m]=c[1],f[4*m+1]=c[2],f[4*m+2]=c[3],f[4*m+3]=b?c[4]:255,m===c[0]-n&&(c=a===d.length-1?c:d[++a]);
else for(m=0;m<d.length;m++)c=d[m],a=4*(c[0]-n),f[a]=c[1],f[a+1]=c[2],f[a+2]=c[3],f[a+3]=b?c[4]:255;return{indexedColormap:f,offset:n,alphaSpecified:b}},colorize:function(d,m){if(null!==d&&null!==d.pixels){d=this._clonePixelBlock(d);var n=d.pixels,q=d.width*d.height,f=d.mask,c=m.indexedColormap,a=m.indexedColormapOffset,b=c&&c.length-1,k=m.indexed2DColormap;m=m.alphaSpecified;if(3<=n.length)throw"colormap only works on single band image";var h=n[0],g=new Uint8Array(h.length),e=new Uint8Array(h.length),
l=new Uint8Array(h.length),p=0;if(c)if(f)for(n=0;n<q;n++)f[n]&&(p=4*(h[n]-a),p<a||p>b?f[n]=0:(g[n]=c[p],e[n]=c[p+1],l[n]=c[p+2],f[n]=c[p+3]));else{f=new Uint8Array(q);for(n=0;n<q;n++)p=4*(h[n]-a),p<a||p>b?f[n]=0:(g[n]=c[p],e[n]=c[p+1],l[n]=c[p+2],f[n]=c[p+3]);d.mask=f}else if(f)for(n=0;n<q;n++)f[n]&&(c=k[h[n]],g[n]=c[0],e[n]=c[1],l[n]=c[2],f[n]=c[3]);else{f=new Uint8Array(q);for(n=0;n<q;n++)c=k[h[n]],g[n]=c[0],e[n]=c[1],l[n]=c[2],f[n]=c[3];d.mask=f}d.pixels=[g,e,l];d.statistics=null;d.pixelType="U8";
d.maskIsAlpha=m;return d}},convolute:function(d,m){d=this._clonePixelBlock(d);var n=d.pixels,q=d.width,f=d.height,c=q*f,a=n.length,b,k,h,g,e=[],l=[],p=m.normalizedKernel,v=m.kernelRows,z=m.kernelCols;for(m=0;m<a;m++){var u=n[m];var E=new Float32Array(c);E.set(u);for(h=1;h<f-1;h++){var w=h*q;for(g=1;g<q-1;g++){for(b=l=0;b<v;b++)for(k=0;k<z;k++)l+=u[w+g+(b-1)*q+k-1]*p[b*z+k];E[w+g]=l}}e.push(E)}d.pixels=e;return d},contrastBrightnessStretch:function(d,m){if(null!==d&&null!==d.pixels){d=this._clonePixelBlock(d);
var n=d.pixels,q=d.mask,f=d.width*d.height,c=n.length;var a=m&&m.contrastOffset;m=m&&m.brightnessOffset;if("U8"!==d.pixelType)throw"the contrast and brightness function only supports 8 bit unsigned integer data";var b=this._createContrastBrightnessLUT(a,m);if(null==q)for(a=0;a<f;a++)for(m=0;m<c;m++)n[m][a]=b[n[m][a]];else for(a=0;a<f;a++)if(q[a])for(m=0;m<c;m++)n[m][a]=b[n[m][a]];d.pixelType="U8";return d}},isNull:function(d,m){if(null!==d&&null!==d.pixels){d=this._clonePixelBlock(d);m=d.mask;var n=
d.pixels[0],q=n.length,f;if(m){for(f=0;f<q;f++)n[f]=m[f]?0:1;d.mask=null}else if(n.fill)n.fill(0);else for(f=0;f<q;f++)n[f]=0;return d}},setNull:function(d){if(null!==m&&null!==m.pixels){var m=this._clonePixelBlock(d);d=m.mask;var n=m.pixels[0],q=n.length,f;d=d||new Uint8Array(q);for(f=0;f<q;f++)d[f]=n[f]?0:1;m.mask=d;return m}},local:function(d,m){if(!m)return d[0];var n=m.rasterCountNeeded;m=m.functor;var q=this._clonePixelBlock(d[0]);if(null!==q&&null!==q.pixels){var f=q.width*q.height,c;d=(c=
d[1])&&c.pixels[0];var a=c&&c.mask,b=q.mask,k=q.pixels[0];if(2===n)if(!b&&a)b=a;else if(b&&a)for(c=0;c<f;c++)b[c]=b[c]&&a[c]?1:0;q.mask=b;if(1===n)if(null==b)for(c=0;c<f;c++)k[c]=m(k[c]);else for(c=0;c<f;c++)b[c]&&(k[c]=m(k[c]));else if(2===n)if(null==b)for(c=0;c<f;c++)k[c]=m(k[c],d[c]);else for(c=0;c<f;c++)b[c]&&(k[c]=m(k[c],d[c]));q.mask=b;q.calculateStatistics();return q}},remapColor:function(d,m){d=this._clonePixelBlock(d);var n=d.width*d.height,q=m.length,f=Math.floor(q/2),c=m[Math.floor(f)],
a=m[0].value,b=m[m.length-1].value,k=d.pixels[0],h,g,e=!1,l=new Uint8Array(n),p=new Uint8Array(n),v=new Uint8Array(n),z=d.mask,u=4===m[0].mappedColor.length;z&&0!==z.length||(z=new Uint8Array(n),z.fill(u?255:1),d.mask=z);for(g=0;g<n;g++)if(z[g]){var E=k[g];if(E<a||E>b)l[g]=p[g]=v[g]=z[g]=0;else{e=!1;var w=f;var F=c;var y=0;for(h=q-1;1<h-y;){if(E===F.value){e=!0;break}E>F.value?y=w:h=w;w=Math.floor((y+h)/2);F=m[Math.floor(w)]}e||(F=E===m[h].value?m[h]:m[y]);l[g]=F.mappedColor[0];p[g]=F.mappedColor[1];
v[g]=F.mappedColor[2];z[g]=F.mappedColor[3]}}d.pixels=[l,p,v];d.mask=z;d.pixelType="u8";d.maskIsAlpha=u;return d},_clonePixelBlock:function(d){if(d.clone)return d.clone();var m=H.clone(d),n;if(d.pixels&&d.pixels[0]&&0<d.pixels[0].length&&!(m.pixels&&m.pixels[0]&&0<m.pixels[0].length)){m.pixels=[];var q=d.pixels.length;for(n=0;n<q;n++)m.pixels[n]=new d.pixels[n].constructor(d.pixels[n])}if(d.statistics)for(m.statistics=[],q=d.statistics.length,n=0;n<q;n++)m.statistics[n]=H.clone(d.statistics[n]);d.mask&&
(m.mask=new Uint8Array(d.mask));return m},_createContrastBrightnessLUT:function(d,m){if(this._contrastCache&&this._contrastCache.contrastOffset===d&&this._contrastCache.brightnessOffset===m)return this._contrastCache.lut;var n=Math.min(Math.max(d,-100),100),q=Math.min(Math.max(m,-100),100),f,c=new Uint8Array(256);for(f=0;256>f;f++){if(0<n&&100>n)var a=(200*f-25500+510*q)/(2*(100-n))+128;else 0>=n&&-100<n?a=(200*f-25500+510*q)*(100+n)/2E4+128:100===n?(a=200*f-25500+256*(100-n)+510*q,a=0<a?255:0):-100===
n&&(a=128);c[f]=255<a?255:0>a?0:a}this._contrastCache={contrastOffset:d,brightnessOffset:m,lut:c};return c}}})},"esri/layers/rasterLib/function/CompositeBandFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin".split(" "),function(H,d,m,n,q,f){return H([m,f],{declaredClass:"esri.layers.rasterLib.function.CompositeBandFunction",functionName:"CompositeBand",supportWebGL:!0,support2D:!0,constructor:function(c){this.functionArguments=
this.mixinIgnoreCase({rasters:null},c)},bind:function(c){c=this.getSourceRasterInfo(c);if(!c.rasters)return Error("The rasters input to composite band function is invalid.");var a=[],b=[],k=c.rasters.length,h;if(c.rasters[0].statistics)for(h=0;h<k;h++)a.push(c.rasters[h].statistics[0]);if(c.rasters[0].histograms)for(h=0;h<k;h++)b.push(c.rasters[h].histograms[0]);this.rasterInfo=d.mixin(c.rasters[0],{bandCount:k,pixelType:this._calculatePixelType(this.pixelType,c.rasters[0].pixelType),statistics:a,
histograms:b});return!0},read2D:function(c){c=c.rasters;if(null!=c&&0!==c.length){var a=this._clonePixelData(c[0]),b=a.pixelBlock,k=[],h=[];for(g=0;g<c.length;g++)k.push(c[g].pixelBlock.pixels[0]),h.push(c[g].pixelBlock.statistics[0]);b.pixels=k;b.stackedStatistics=h;b.planes=c.length;var g;h=b.width*b.height;for(g=0;g<c.length;g++)if(b=c[g].pixelBlock.mask,e&&b)for(k=0;k<h;k++)e[k]&=b[k];else var e=e||b;a.maks=e;return a}},readGL:function(c){this._performance.start();this._initializeProgram({fragment:q.compositeBand,
fragmentName:"CompositeBand"});var a=c.rasters;if(null!=a&&0!==a.length){a=a.length;var b,k=this.bindFrameBuffer();for(b=0;b<a;b++){var h=this._setupTextureData(c.rasters[b],{notOriginal:0<b});var g=0<b?b.toString():"";this._bindTexture(h.texture,"u_image"+g)}this._setUniforms({u_rasterCount:a});this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:h.extent,texture:k.texture}}}})})},"esri/layers/rasterLib/function/ContrastBrightnessFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),
function(H,d,m,n,q,f,c){return H([m,f],{declaredClass:"esri.layers.rasterLib.function.ContrastBrightnessFunction",renderTexture:!0,functionName:"ContrastBrightness",supportWebGL:!0,support2D:!0,pixelType:"U8",constructor:function(a){this.functionArguments=this.mixinIgnoreCase({contrastOffset:0,brightnessOffset:0,raster:null},a)},bind:function(a){a=this.getSourceRasterInfo(a);if(!a.raster)return Error("The raster input to contrast and brightness function is invalid.");this.rasterInfo=d.mixin(a.raster,
{bandCount:a.raster.bandCount,pixelType:this._calculatePixelType(this.pixelType,"U8"),statistics:null,histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Processed";return!0},read2D:function(a){a=a.raster;if(null!==a&&null!==a.pixelBlock&&null!==a.pixelBlock.pixels){var b=c.contrastBrightnessStretch(a.pixelBlock,{contrastOffset:this.functionArguments.contrastOffset,brightnessOffset:this.functionArguments.brightnessOffset});"Unknown"!==
this.pixelType&&(b.pixelType=this.pixelType,b.pixels=b.pixels.map(d.hitch(this,function(k){return this._clampBand(k,b.pixelType)})));return{extent:a.extent,pixelBlock:b}}},readGL:function(a){return this._cbGL(a.raster)},_cbGL:function(a){this._performance.start();this._initializeProgram({fragment:q.contrastBrightness,fragmentName:"ContrastBrightness"});a=this._setupTextureData(a);this._setUniforms({u_contrastOffset:Math.min(Math.max(this.functionArguments.contrastOffset,-100),100),u_brightnessOffset:Math.min(Math.max(this.functionArguments.brightnessOffset,
-100),100),u_scaleFactor:this.renderTexture?255:1});this._bindTexture(a.texture,"u_image");var b=this.bindFrameBuffer();this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:a.extent,texture:b.texture}}})})},"esri/layers/rasterLib/function/ConvolutionFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./convolutionKernel ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),function(H,d,m,n,q,f,c,a){return H([m,
c],{declaredClass:"esri.layers.rasterLib.function.ConvolutionFunction",functionName:"Convolution",supportWebGL:!0,support2D:!0,constructor:function(b){this.functionArguments=this.mixinIgnoreCase({columns:3,rows:3,type:0,kernel:null,raster:null},b)},bind:function(b){b=this.getSourceRasterInfo(b);if(!b.raster)return Error("The raster input to convolution function is invalid.");this.rasterInfo=d.mixin(b.raster,{bandCount:b.raster.bandCount,pixelType:this._calculatePixelType(this.pixelType,b.raster.pixelType),
statistics:b.raster.statistics,histograms:b.raster.histograms});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Generic";return!0},read2D:function(b){this._performance.start();b=b.raster;var k=this._analyzeKernel(),h=a.convolute(b.pixelBlock,{normalizedKernel:k.normalizedKernel,kernelCols:this.functionArguments.columns,kernelRows:this.functionArguments.rows});this._addPerformanceMetric(this._performance.elapsed());"Unknown"!==this.pixelType&&
(h.pixelType=this.pixelType);h.pixels=h.pixels.map(d.hitch(this,function(g){return this._clampBand(g,h.pixelType)}));return{extent:b.extent,pixelBlock:h}},readGL:function(b){this._performance.start();this._initializeProgram({fragment:f.convolution,fragmentName:"Convolution"});var k=this._setupTextureData(b.raster),h=this.bindFrameBuffer(),g=this.gl,e=g.drawingBufferWidth;g=g.drawingBufferHeight;var l=this.functionArguments.kernel;this._setUniforms({u_resolution:b&&b.raster&&b.raster.pixelBlock?[1/
b.raster.pixelBlock.width,1/b.raster.pixelBlock.height]:[1/e,1/g],u_kernel:l,u_kernelSize:l.length});this._bindTexture(k.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:k.extent,texture:h.texture}},_analyzeKernel:function(){var b=this.functionArguments.kernel,k=b.reduce(function(e,l){return e+l});0!==k&&1!==k&&(b=b.map(function(e){return e/k}));var h,g=[];for(h=0;h<b.length;h++)g.some(function(e){return e===b[h]})||g.push(b[h]);return{normalizedKernel:b,
distinctValues:g}},_analyzeKernelPattern:function(){var b=this.functionArguments.rows,k=this.functionArguments.columns,h=this.functionArguments.kernel,g=[],e,l;for(e=0;e<b;e++)g.push({weights:h.slice(e*k,(e+1)*k)});var p;for(e=1;e<b;e++){var v=g[e].weights;for(h=0;h<e;h++)if(p=g[h].weights){var z=v[0]/p[0];for(l=1;l<k;l++)v[l]/p[l]!==z&&(z=null);null!==z&&(g[e]={row:h,factor:z})}}return g}})})},"esri/layers/rasterLib/function/ExtractBandFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin".split(" "),
function(H,d,m,n,q,f){return H([m,f],{declaredClass:"esri.layers.rasterLib.function.ExtractBandFunction",functionName:"ExtractBand",supportWebGL:!0,support2D:!0,constructor:function(c){this.functionArguments=this.mixinIgnoreCase({bandIDs:[],missingBandAction:0,raster:null},c)},bind:function(c){c=this.getSourceRasterInfo(c);if(!c.raster)return Error("The raster input to extract band function is invalid.");var a=[],b=c.raster.statistics,k=[],h=c.raster.histograms,g=this.functionArguments.bandIDs.length||
c.raster.bandCount;this.functionArguments.bandIDs.forEach(d.hitch(this,function(e){if(e>=g-1){if(1===this.functionArguments.missingBandAction)return Error("missing band "+e);e=g-1}if(0>e)return Error("missing band "+e);void 0!==b&&null!==b&&0<b.length&&a.push(b[e]);void 0!==h&&null!==h&&0<h.length&&k.push(h[e])}));this.rasterInfo=d.mixin(c.raster,{bandCount:g,pixelType:this._calculatePixelType(this.pixelType,c.raster.pixelType),statistics:a,histograms:k});return!0},read2D:function(c){c=this._clonePixelData(c.raster);
if(null!==c&&null!==c.pixelBlock&&null!==c.pixelBlock.pixels){this._performance.start();var a=c.pixelBlock,b=a.statistics,k=a.pixels,h=k.length;if(null==this.functionArguments.bandIDs)throw"missing bandIDs parameter";if(0===this.functionArguments.bandIDs.length)return c;var g=[],e=[];this.functionArguments.bandIDs.forEach(function(l){if(l>=h-1){if(1===this.functionArguments.missingBandAction)throw"missing band "+l;l=h-1}if(0>l)throw"missing band "+l;g.push(k[l]);void 0!==b&&null!==b&&0<b.length&&
e.push(b[l])});a.pixels=g;a.statistics=e;a.planes=this.functionArguments.bandIDs.length;return c}},readGL:function(c){this._performance.start();if(null==this.functionArguments.bandIDs)throw"missing bandIDs parameter";if(3<this.functionArguments.bandIDs.length)throw"this version does not support more than 3 bands yet";this._initializeProgram({fragment:q.extractBand,fragmentName:"ExtractBand"});var a=this.functionArguments.bandIDs;1===a.length&&(a=[a[0],a[0],a[0]]);this._bandIDs=a;this._alterBand=!(0===
this.functionArguments.bandIDs.length||0===a[0]&&1===a[1]&&2===a[2]);var b=!!(this._alterBand&&c.raster&&c.raster.texture);c=this._setupTextureData(c.raster,{bandIDs:a});var k=this.bindFrameBuffer();b?this._setUniforms({u_bandIDs:a,u_alterBand:this._alterBand}):this._setUniforms({u_bandIDs:a,u_alterBand:!1});this._bindTexture(c.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:c.extent,texture:k.texture}}})})},"esri/layers/rasterLib/function/HillshadeFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../../renderers/colorRampGenerator ../../../WKIDUnitConversion ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./surfaceUtils ./rasterUtils".split(" "),
function(H,d,m,n,q,f,c,a,b,k){return H([m,a],{declaredClass:"esri.layers.rasterLib.function.HillshadeFunction",functionName:"Hillshade",supportWebGL:!0,support2D:!0,renderTexture:!0,constructor:function(h){this.functionArguments=this.mixinIgnoreCase({hillshadeType:0,altitude:45,azimuth:315,zFactor:1,slopeType:1,psPower:.664,psFactor:.024,colorRamp:null,raster:null},h);this._azimuths=[315,270,225,360,180,0];this._altitudes=[60,60,60,60,60,90];this._weights=[3,5,3,2,1,4];var g=this._weights.reduce(function(e,
l){return e+l});this._weights=this._weights.map(function(e){return e/g})},bind:function(h){h=this.getSourceRasterInfo(h);if(!h.raster)return Error("The raster input to hillshade function is invalid.");h.raster.statistics&&(this.srcStatistics=h.raster.statistics);this.rasterInfo=d.mixin(h.raster,{bandCount:1,pixelType:this._calculatePixelType(this.pixelType,"U8"),statistics:[{min:0,max:255}],histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType=
"Generic";this._initializeColormap();return!0},read2D:function(h){this._performance.start();h=h.raster;h=b.hillshade(h,{altitude:this.functionArguments.altitude,azimuth:this.functionArguments.azimuth,zFactor:this.functionArguments.zFactor,psPower:this.functionArguments.psPower,psFactor:this.functionArguments.psFactor,hillshadeType:this.functionArguments.hillshadeType,slopeType:this.functionArguments.slopeType,isGCS:h.extent.spatialReference.wkid&&null==q[h.extent.spatialReference.wkid]});this._addPerformanceMetric(this._performance.elapsed());
return h},readGL:function(h){this._performance.start();this._initializeProgram({fragment:c.hillshade,fragmentName:"Hillshade"});this.functionArguments.colorRamp&&this._indexedColormap&&!this._clrTexture&&(this._clrTexture=this._setupColormapTexture(this._indexedColormap));var g=this._setupTextureData(h.raster),e=this.bindFrameBuffer(),l=this.gl,p=l.drawingBufferWidth;l=l.drawingBufferHeight;var v=g.extent,z=(v.xmax-v.xmin)/p,u=(v.ymax-v.ymin)/l,E=this.functionArguments.altitude,w=this.functionArguments.azimuth,
F=this.functionArguments.zFactor;1===this.functionArguments.hillshadeType&&(F*=2);var y=F/(8*z),D=F/(8*u);.001<F&&v.spatialReference.wkid&&null==q[v.spatialReference.wkid]&&(y/=111E3,D/=111E3);var B=this.functionArguments.psPower,x=this.functionArguments.psFactor;3===this.functionArguments.slopeType&&((y=v.spatialReference.wkid&&null==q[v.spatialReference.wkid])?(y=111E3*z,D=111E3*u,y=(F+Math.pow(y,B)*x)/(8*y),D=(F+Math.pow(D,B)*x)/(8*D)):(y=(F+Math.pow(z,B)*x)/(8*z),D=(F+Math.pow(u,B)*x)/(8*u)));
var r=(90-E)*Math.PI/180;E=Math.cos(r);var t=(360-w+90)*Math.PI/180;w=Math.sin(r)*Math.cos(t);r=Math.sin(r)*Math.sin(t);B=Array(6);x=Array(6);v=Array(6);var C=this._weights,J;if(1===this.functionArguments.hillshadeType){var L=this._azimuths.length;for(J=0;J<L;J++)E=this._altitudes[J],w=this._azimuths[J],r=(90-E)*Math.PI/180,E=Math.cos(r),t=(360-w+90)*Math.PI/180,w=Math.sin(r)*Math.cos(t),r=Math.sin(r)*Math.sin(t),B[J]=E,x[J]=w,v[J]=r}else B[0]=E,x[0]=w,v[0]=r;B=B.map(function(P){return parseFloat(P)});
x=x.map(function(P){return parseFloat(P)});v=v.map(function(P){return parseFloat(P)});this._setUniforms({u_cellSize:[z,u],u_zfactor:F,u_xFactor:y,u_yFactor:D,u_sinZcosA:w,u_sinZsinA:r,u_cosZ:E,u_sinZcosAs:x,u_sinZsinAs:v,u_cosZs:B,u_weights:C,u_hillshadeType:this.functionArguments.hillshadeType,u_resolution:h&&h.raster&&h.raster.pixelBlock?[1/h.raster.pixelBlock.width,1/h.raster.pixelBlock.height]:[1/p,1/l],u_scaled:!this.renderTexture,u_applyColorramp:this._clrTexture?!0:!1,u_minValue:this.srcStatistics[0].min,
u_maxValue:this.srcStatistics[0].max,u_indexedColormapOffset:this._indexedColormapOffset||0,u_indexedColormapMaxIndex:this._indexedColormap?this._indexedColormap.length/4-1:0});this._clrTexture&&this._bindTexture(this._clrTexture,"u_image1");this._bindTexture(g.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:g.extent,texture:e.texture}},_initializeColormap:function(){this._indexedColormapOffset=0;var h=this._indexedColormap,g=this.functionArguments.colorRamp;
this.functionArguments.colormap?(this._alphaSpecified=(g=k.buildIndexedColormap(this.functionArguments.colormap))&&g.alphaSpecified,this._indexedColormap=g&&g.indexedColormap,this._indexedColormapOffset=g&&g.offset):g?(this._indexedColormap="multipart"===g.type?this.invert?n.createMultiPartColorRamp(this._invertColorRamp(g)):n.createMultiPartColorRamp(g):this.invert?n.createAlgorithmicColorRamp(this._invertColorRamp(g)):n.createAlgorithmicColorRamp(g),g.fromColor&&g.toColor&&"000"===g.fromColor.slice(0,
3).join("")&&"255255255"===g.toColor.slice(0,3).join("")&&(this._clrTexture=this._indexedColormap=null)):this.functionArguments.colormapName?"random"===this.functionArguments.colormapName.toLowerCase()&&(this._indexedColormap=n.createRandomColorRamp()):this._clrTexture=this._indexedColormap=null;if(h&&this._indexedColormap){g=!0;for(var e=0;e<h.length;e++)if(h[e]!==this._indexedColormap[e]){g=!1;break}g||(this._clrTexture=null)}},_setupColormapTexture:function(h){var g=this._createTexture(),e=this.gl,
l=h.length/4,p=new Float32Array(h.length),v;for(v=0;v<h.length;v++)p[v]=h[v]/255;e.getExtension("OES_texture_float");e.texImage2D(e.TEXTURE_2D,0,e.RGBA,l,1,0,e.RGBA,e.FLOAT,p);return g}})})},"esri/layers/rasterLib/function/LocalFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),function(H,d,m,n,q,f,c){return H([m,f],{declaredClass:"esri.layers.rasterLib.function.LocalFunction",functionName:"Local",
supportWebGL:!0,support2D:!0,constructor:function(a){this.functionArguments=this.mixinIgnoreCase({operation:null,rasters:null},a)},bind:function(a){a=this.getSourceRasterInfo(a);var b=0;a.raster?b=a.raster.bandCount:a.rasters&&(b=Math.max.apply(null,a.rasters.map(function(k){return k.bandCount})));if(0===b)return Error("The raster input to local function is invalid. It only takes single band input.");a=a.raster||a.rasters.filter(function(k){return!!k.extent})[0];this.rasterInfo=d.mixin(a,{bandCount:1,
pixelType:this._calculatePixelType(this.pixelType,"F32"),statistics:null,histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Generic";return!0},read2D:function(a){var b=[];b=a.raster?a.raster2?[a.raster,a.raster2]:[a.raster]:a.rasters;a=b.map(function(l){return l.pixelBlock});var k=this.functionArguments.operation;if(null===k)return b[0];this._performance.start();var h=this._getOperations(),g=h.operators[k-1];h=h.functors[k-1];
if(!this.functionArguments.rasters){if(1!==g)throw"no sufficient rasters, require "+g;}else if(999!==g&&this.functionArguments.rasters.length!==g)throw"number of rasters does not meet (short or exceed) the operation requirment, require "+g;var e=31===k?c.isNull(a[0]):50===k?c.setNull(a[0]):c.local(a,{rasterCountNeeded:g,functor:h});"Unknown"!==this.pixelType&&(e.pixelType=this.pixelType,e.pixels=e.pixels.map(d.hitch(this,function(l){return this._clampBand(l,e.pixelType)})));e.statistics||e.calculateStatistics();
return{extent:b[0].extent,pixelBlock:e}},readGL:function(a){this._performance.start();var b=this.functionArguments.operation,k=this._getWebGLOperations(),h=k.operators[b-1],g=q.local;k="result\x3d"+k.functors[b-1]+";";31!==b&&50!==b&&(k+="result \x3d vec4(result.rgb, a.a);");g=g.replace("vec4 replaceme"+h+";",k);k=this.gl.getParameter(this.gl.VERSION);var e="";if(-1<k.toLowerCase().indexOf("webgl 1.0")||-1<k.toLowerCase().indexOf("webgl 0."))e=this._getPolyfill(b);g=g.replace("vec4 polyfill;",e);
1<h&&(g=g.replace("gl_FragColor \x3d localOp1();","gl_FragColor \x3d localOp1();".replace("1",h.toString())));this._initializeProgram({fragment:g,fragmentName:"Local"});b=a.rasters;if(null!=b&&0!==b.length){b=b.length;k=this.bindFrameBuffer();for(h=0;h<b;h++){g=0<h?h.toString():"";var l=this._setupTextureData(a.rasters[h],{reCreate:!0});this._bindTexture(l.texture,"u_image"+g)}this._setUniforms({});this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:l.extent,texture:k.texture}}},
_getOperations:function(){return{operators:[2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,1,1,1,1,999,999,1,1,999,1,1,2,2,2,999,999,999,999,999,999,999,999,999,999,3],functors:[function(a,b){return a+b},function(a,b){return a-b},function(a,b){return a*b},function(a){return Math.sqrt(a)},function(a,b){return Math.pow(a,b)},function(a){return Math.acos(a)},function(a){return Math.asin(a)},function(a){return Math.atan(a)},function(a){return Math.atanh(a)},
function(a){return Math.abs(a)},function(a,b){return a&b},function(a,b){return a<<b},function(a){return~a},function(a,b){return a|b},function(a,b){return a>>b},function(a,b){return a^b},function(a,b){return a&&b},function(a){return!a},function(a,b){return a||b},function(a,b){return a!=b},function(a){return Math.cos(a)},function(a,b){return Math.cosh(a)},function(a,b){return a/b},function(a,b){return a==b},function(a){return Math.exp(a)},function(a){return Math.pow(10,a)},function(a){return Math.pow(2,
a)},function(a,b){return a>b?1:0},function(a,b){return a>=b?1:0},function(a,b){return Math.floor(a)},function(a){return!a},function(a){return a},function(a,b){return a<b?1:0},function(a,b){return a<=b?1:0},function(a){return Math.log(a)},function(a,b){return Math.log10(a)},function(a,b){return Math.log2(a)},999,999,999,999,999,999,function(a,b){return a%b},function(a){return-a},function(a,b){return a!=b?1:0},999,function(a,b){return Math.floor(a)},function(a,b){return Math.ceil(a)},function(a,b){return b?
0:a},function(a,b){return Math.sin(a)},function(a,b){return Math.sinh(a)},function(a,b){return a*a},999,999,function(a){return Math.tan(a)},function(a){return Math.tanh(a)},999,function(a){return Math.acosh(a)},function(a){return Math.asinh(a)},function(a,b){return Math.atan2(a,b)},function(a,b){return a/b},function(a,b){return Math.floor(a/b)},999,999,999,999,999,999,999,999,999,999,function(a,b,k){return a?b:k}]}},_polyfill:{sinh:"vec4 sinh(vec4 x) {\nvec4 halfexp \x3d exp(x)/2.0;\nreturn halfexp - 1.0/halfexp;\n}",
asinh:"vec4 asinh(vec4 x) {\nvec4 halfexp \x3d exp(x)/2.0;\nreturn 1.0/(halfexp - 1.0/halfexp);\n}",cosh:"vec4 cosh(vec4 x) {\nvec4 halfexp \x3d exp(x)/2.0;\nreturn halfexp + 1.0/halfexp;\n}",acosh:"vec4 acosh(vec4 x) {\nvec4 halfexp \x3d exp(x)/2.0;\nreturn 1.0/(halfexp + 1.0/halfexp);\n}",tanh:"vec4 tanh(vec4 x) {\nvec4 expx \x3d exp(x);\nreturn (expx - 1.0/expx)/(expx + 1.0/expx);\n}",atanh:"vec4 atanh(vec4 x) {\nvec4 expx \x3d exp(x);\nreturn (expx + 1.0/expx)/(expx - 1.0/expx);\n}"},_getPolyfill:function(a){var b=
"";switch(a){case 9:b=this._polyfill.atanh;break;case 22:b=this._polyfill.cosh;break;case 52:b=this._polyfill.sinh;break;case 57:b=this._polyfill.tanh;break;case 59:b=this._polyfill.acosh;break;case 60:b=this._polyfill.asinh}return b},_getWebGLOperations:function(){return{operators:[2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,1,1,1,1,999,999,1,1,999,1,1,2,2,2,999,999,999,999,999,999,999,999,999,999,3],functors:["(a + b)","(a - b)",
"(a * b)","sqrt(a)","pow(a, b)","acos(a)","asin(a)","atan(a)","atanh(a)","abs(a)","a","a","a","a","a","a","(a.r\x3d\x3d0.0 || b.r\x3d\x3d0.0) ? vec4(0.0,0.0,0.0,a.a) : vec4(1.0,1.0,1.0,a.a)","a.r\x3d\x3d0.0?vec4(1.0,1.0,1.0,a.a) : vec4(0.0,0.0,0.0,a.a)","(a.r\x3d\x3d0.0 \x26\x26 b.r\x3d\x3d0.0) ? vec4(0.0,0.0,0.0,a.a) : vec4(1.0,1.0,1.0,a.a)","(a.r\x3d\x3d0.0 ^^ b.r\x3d\x3d0.0) ? vec4(1.0,1.0,1.0,a.a) : vec4(0.0,0.0,0.0,a.a)","cos(a)","cosh(a)","a / b","a.r \x3d\x3d b.r? vec4(1.0,1.0,1.0,a.a) : vec4(0.0,0.0,0.0,a.a)",
"exp(a)","pow(10.0, a)","pow(2.0, a)","a.r \x3e b.r ? vec4(1.0,1.0,1.0,a.a) : vec4(0.0,0.0,0.0,a.a)","a.r \x3e\x3d b.r ? vec4(1.0,1.0,1.0,a.a) : vec4(0.0,0.0,0.0,a.a)","floor(a)","a.a \x3d\x3d 0.0? vec4(1.0,1.0,1.0,1.0) : vec4(0.0,0.0,0.0,1.0)","a","a.r \x3c b.r ? vec4(1.0,1.0,1.0,a.a) : vec4(0.0,0.0,0.0,a.a)","a.r \x3c\x3d b.r ? vec4(1.0,1.0,1.0,a.a) : vec4(0.0,0.0,0.0,a.a)","log(a)","log2(a) / log2(10.0)","log2(a)",999,999,999,999,999,999,"mod(a, b)","-a","a.r !\x3d b.r ? vec4(1.0,1.0,1.0,a.a) : vec4(0.0,0.0,0.0,a.a)",
999,"floor(a)","ceil(a)","a.r !\x3d 0.0 ? vec4(0.0,0.0,0.0,0.0) : a","sin(a)","sinh(a)","a * a",999,999,"tan(a)","tanh(a)",999,"acosh(a)","asinh(a)","atan(a, b)","a / b","floor(a / b)",999,999,999,999,999,999,999,999,999,999,"a.r!\x3d0 ? b : c"]}}})})},"esri/layers/rasterLib/function/MaskFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),function(H,d,m,n,q,f,c){return H([m,f],{declaredClass:"esri.layers.rasterLib.function.MaskFunction",
functionName:"Mask",supportWebGL:!0,support2D:!0,constructor:function(a){this.functionArguments=this.mixinIgnoreCase({includedRanges:null,noDataInterpretation:0,noDataValues:null,raster:null},a)},bind:function(a){a=this.getSourceRasterInfo(a);if(!a.raster)return Error("The raster input to mask function is invalid.");this.rasterInfo=d.mixin(a.raster,{bandCount:a.raster.bandCount,pixelType:this._calculatePixelType(this.pixelType,a.raster.pixelType),statistics:a.raster.statistics,histograms:a.raster.histograms});
return!0},read2D:function(a){this._performance.start();a=a.raster;var b=c.mask(a.pixelBlock,{includedRanges:this.functionArguments.includedRanges,noDataInterpretation:this.functionArguments.noDataInterpretation,noDataValues:this.functionArguments.noDataValues});this._addPerformanceMetric(this._performance.elapsed());"Unknown"!==this.pixelType&&(b.pixelType=this.pixelType);return{extent:a.extent,pixelBlock:b}},readGL:function(a){this._performance.start();this._initializeProgram({fragment:q.mask,fragmentName:"Mask"});
a=this._setupTextureData(a.raster);var b=this.bindFrameBuffer(),k=this.functionArguments.includedRanges,h=this.functionArguments.noDataValues?this.functionArguments.noDataValues.map(function(g){return parseFloat(g,10)}):null;this._setUniforms({u_includedRanges:k,u_includedRanges_specified:k?!0:!1,u_noDataValues:h,u_noDataValues_specified:h?!0:!1,u_noDataInterpretation:this.functionArguments.noDataInterpretation,u_bandCount:Math.min(this.sourceRasterInfo.raster.bandCount,3)});this._bindTexture(a.texture,
"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:a.extent,texture:b.texture}}})})},"esri/layers/rasterLib/function/NDVIFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./rasterIndex".split(" "),function(H,d,m,n,q,f,c){return H([m,f],{declaredClass:"esri.layers.rasterLib.function.NDVIFunction",functionName:"NDVI",supportWebGL:!0,support2D:!0,constructor:function(a){this.functionArguments=
this.mixinIgnoreCase({visibleBandID:1,infraredBandID:2,scaled:!0,raster:null},a)},bind:function(a){a=this.getSourceRasterInfo(a);if(!(a.raster&&1<a.raster.bandCount))return Error("The raster input to ndvi function is invalid. It requires more than 1 band.");this.rasterInfo=d.mixin(a.raster,{bandCount:1,pixelType:this._calculatePixelType(this.pixelType,this.scaled?"U8":"F32"),statistics:this.scaled?[{min:0,max:200}]:[{min:-1,max:1}],histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||
{};this.rasterInfo.keyProperties.DataType="Generic";return!0},read2D:function(a){this._performance.start();a=a.raster;var b=c.calculate(a.pixelBlock,{bandIndexes:[this.functionArguments.infraredBandID+1,this.functionArguments.visibleBandID+1].join(" "),method:1}),k;if(this.functionArguments.scaled){var h=b.pixels[0];var g=b.mask;var e=h.length;var l=new Uint8Array(e);if(null==g)for(k=0;k<e;k++)l[k]=100*h[k]+100&255;else for(k=0;k<e;k++)g[k]&&(l[k]=100*h[k]+100&255);b.pixels[0]=l;b.pixelType="U8"}this._addPerformanceMetric(this._performance.elapsed());
"Unknown"!==this.pixelType&&(b.pixelType=this.pixelType);return{extent:a.extent,pixelBlock:b}},readGL:function(a){this._performance.start();this._initializeProgram({fragment:q.ndvi,fragmentName:"NDVI"});var b=this.functionArguments.visibleBandID,k=this.functionArguments.infraredBandID,h=this.functionArguments.scaled||!1;this._alterBand=2<Math.max(k,b)?!0:!1;a=this._setupTextureData(a.raster,{bandIDs:this._alterBand?{bandIDs:[k,b,k]}:null});var g=this.bindFrameBuffer();this._alterBand?this._setUniforms({u_bandId_nir:0,
u_bandId_red:1,u_scaled:h}):this._setUniforms({u_bandId_nir:k,u_bandId_red:b,u_scaled:h});this._bindTexture(a.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:a.extent,texture:g.texture}}})})},"esri/layers/rasterLib/function/SlopeFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../../WKIDUnitConversion ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./surfaceUtils".split(" "),function(H,d,m,n,q,f,
c,a){return H([m,c],{declaredClass:"esri.layers.rasterLib.function.SlopeFunction",functionName:"Slope",supportWebGL:!0,support2D:!0,constructor:function(b){this.functionArguments=this.mixinIgnoreCase({zFactor:1,slopeType:1,psPower:.664,psFactor:.024,raster:null},b)},bind:function(b){b=this.getSourceRasterInfo(b);if(!b.raster)return Error("The raster input to slope function is invalid.");this.rasterInfo=d.mixin(b.raster,{bandCount:1,pixelType:this._calculatePixelType(this.outputPixelType,"F32"),statistics:1===
this.slopeType||3===this.slopeType?[{min:0,max:90}]:null,histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Generic";return!0},read2D:function(b){this._performance.start();b=b.raster;b=a.slope(b,{zFactor:this.functionArguments.zFactor,psPower:this.functionArguments.psPower,psFactor:this.functionArguments.psFactor,slopeType:this.functionArguments.slopeType,isGCS:b.extent.spatialReference.wkid&&null==n[b.extent.spatialReference.wkid]});
this._addPerformanceMetric(this._performance.elapsed());return b},readGL:function(b){this._performance.start();this._initializeProgram({fragment:f.slope,fragmentName:"Slope"});var k=this._setupTextureData(b.raster),h=this.bindFrameBuffer(),g=this.gl,e=g.drawingBufferWidth;g=g.drawingBufferHeight;var l=k.extent;this._setUniforms({u_resolution:b&&b.raster&&b.raster.pixelBlock?[1/b.raster.pixelBlock.width,1/b.raster.pixelBlock.height]:[1/e,1/g],u_cellSize:[(l.xmax-l.xmin)/e,(l.ymax-l.ymin)/g],u_zfactor:this.functionArguments.zFactor});
this._bindTexture(k.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:k.extent,texture:h.texture}}})})},"esri/layers/rasterLib/function/StretchFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./vertexShaders ./pixelShaders ./RasterFunctionWebGLMixin".split(" "),function(H,d,m,n,q,f,c){return H([m,c],{declaredClass:"esri.layers.rasterLib.function.StretchFunction",functionName:"Stretch",supportWebGL:!0,
support2D:!0,constructor:function(a){this.functionArguments=this.mixinIgnoreCase({stretchType:0,min:0,max:255,numberOfStandardDeviations:2,statistics:null,histograms:null,dra:!1,minPercent:.25,maxPercent:.5,useGamma:!1,gamma:null,raster:null,computeGamma:!1},a);this.functionArguments.statistics=this._convertStats(this.functionArguments.statistics);-1===[0,3,5,6].indexOf(this.functionArguments.stretchType)&&(console.error("The specific stretch type has not been implemented: "+this.functionArguments.stretchType),
this.functionArguments.stretchType=5);this.min=null==this.min?0:this.min;this.max=null==this.max?255:this.max},bind:function(a){a=this.getSourceRasterInfo(a);if(!a.raster)return Error("The raster input to stretch function is invalid.");a.raster.statistics&&(this.srcStatistics=this._convertStats(a.raster.statistics));a.raster.histograms&&(this.srcHistograms=a.raster.histograms);this.rasterInfo=d.mixin({},a.raster,{bandCount:a.raster.bandCount,pixelType:this._calculatePixelType(this.pixelType,"U8"),
statistics:null,histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Generic";return!0},read2D:function(a){a=a.raster;this._stretch(a);return a},hasTilingEffects:function(a){a=a||this.functionArguments;return!!(a.dra||a.raster&&"object"===typeof a.raster&&a.raster.dra)},_convertStats:function(a){return a?a.map(function(b){return b&&null!=b.min?[b.min,b.max,b.mean,b.stddev]:b}):null},_updateStatistisHistograms:function(a){var b=this.functionArguments,
k=b.histograms||this.srcHistograms;if(a&&a.pixelBlock&&a.pixelBlock.pixels){if(0===b.stretchType)this._statistics=b.statistics&&0<b.statistics.length?b.statistics:this.srcStatistics,this._histograms=k;else{var h=a.pixelBlock,g=h.pixels.length,e=6===b.stretchType&&(b.dra||!k)||3===b.stretchType&&b.dra;e&&(h.statistics||h.calculateStatistics(),this._calculateStatisticsHistograms(a));if(b.dra)if(h.statistics||h.calculateStatistics(),e)this._statistics=h.statistics,this._histograms=h.histograms;else for(b=
h.statistics,this._statistics=[],a=0;a<g;a++)this._statistics[a]=[b[a].minValue,b[a].maxValue,0,0];else this._statistics=b.statistics&&0<b.statistics.length?b.statistics:this.srcStatistics,this._histograms=k}this._statistics=this._convertStats(this._statistics);this._gammaCorrection=this._getGammaCorrection()}else this._statistics=b.statistics&&0<b.statistics.length?b.statistics:this.srcStatistics,this._histograms=k,this._gammaCorrection=this._getGammaCorrection(),this._statistics=this._convertStats(this._statistics)},
_getGammaCorrection:function(){var a=this.functionArguments.gamma;if(a){var b=[],k;for(k=0;k<a.length;k++)b[k]=1<a[k]?2<a[k]?6.5+Math.pow(a[k]-2,2.5):6.5+100*Math.pow(2-a[k],4):1;return b}},_stretch:function(a){if(null!==a&&null!==a.pixelBlock&&null!==a.pixelBlock.pixels&&0!==this.functionArguments.stretchType){this._updateStatistisHistograms(a);var b=a.pixelBlock,k=b.pixels;b=b.width*b.height;var h=k.length,g,e;this._createLUT(a);if(null==this.LUT)return this._filterNoLUT(a);var l=this.LUT,p=this.LUTOffset;
for(g=0;g<h;g++){var v=l[g];for(e=0;e<b;e++){var z=k[g][e];k[g][e]=v[z-p]}}a.pixelBlock.pixelType="U8"}},_calculateStatisticsHistograms:function(a){a=a.pixelBlock;var b=a.pixelType,k=a.pixels,h=a.mask,g=k.length,e,l,p=function(x){this.min=-.5;this.max=255.5;this.size=256;d.mixin(this,x);this.counts=this.counts||new Uint32Array(this.size)},v=[],z,u;for(e=0;e<g;e++){var E=new p;var w=E.counts;var F=k[e];if("U8"===b)if(h)for(l=0;l<a.width*a.height;l++)h[l]&&w[F[l]]++;else for(l=0;l<a.width*a.height;l++)w[F[l]]++;
else{var y=a.statistics[e].minValue;var D=a.statistics[e].maxValue;E.min=y;E.max=D;D=(D-y)/256;var B=new Uint32Array(257);if(h)for(l=0;l<a.width*a.height;l++)h[l]&&B[Math.floor((F[l]-y)/D)]++;else for(l=0;l<a.width*a.height;l++)B[Math.floor((F[l]-y)/D)]++;for(l=0;255>l;l++)w[l]=B[l];w[255]=B[255]+B[256]}v.push(E);F=[];y=a.statistics[e].minValue;D=a.statistics[e].maxValue;for(l=u=z=B=0;l<E.size;l++)B+=w[l],z+=l*w[l];z/=B;for(l=0;l<E.size;l++)u+=w[l]*Math.pow(l-z,2);w=Math.sqrt(u/(B-1));l=(z+.5)*(E.max-
E.min)/E.size+E.min;E=w*(E.max-E.min)/E.size;F.push(y);F.push(D);F.push(l);F.push(E);a.statistics[e]={min:y,minValue:y,max:D,maxValue:D,mean:l,stddev:E}}a.histograms=v},_getCutOffPoints:function(a){var b=this.functionArguments,k=999;a&&a.pixelBlock?k=a.pixelBlock.pixels.length:a&&a.texture&&(k=3);a=Math.min(k,this._statistics.length);var h=[],g=[],e,l;switch(b.stretchType){case 5:for(e=0;e<a;e++)h[e]=this._statistics[e][0],g[e]=this._statistics[e][1];break;case 3:for(e=0;e<a;e++)h[e]=this._statistics[e][2]-
b.numberOfStandardDeviations*this._statistics[e][3],g[e]=this._statistics[e][2]+b.numberOfStandardDeviations*this._statistics[e][3],h[e]<this._statistics[e][0]&&(h[e]=this._statistics[e][0]),g[e]>this._statistics[e][1]&&(g[e]=this._statistics[e][1]);break;case 6:for(e=0;e<a;e++){k=this._histograms[e];var p=new Uint32Array(k.size);var v=k.counts;var z=0;var u=-.5===k.min&&1===(k.max-k.min)/v?.5:0;for(l=0;l<k.size;l++)z+=v[l],p[l]=z;v=b.minPercent*z/100;for(l=0;l<k.size;l++)if(p[l]>v){h[e]=k.min+(k.max-
k.min)/k.size*(l+u);break}v=(1-b.maxPercent/100)*z;for(l=k.size-2;0<=l;l--)if(p[l]<v){g[e]=k.min+(k.max-k.min)/k.size*(l+2-u);break}}break;default:for(e=0;e<k;e++)h[e]=0,g[e]=255}return{minCutOff:h,maxCutOff:g}},_createLUT:function(a){var b=this.functionArguments,k=a.pixelBlock,h=k.pixelType;if("U8"===h||"U16"===h||"S8"===h||"S16"===h){if(this._LUTSignature&&(h=this._computeLutSignature(),h.length===this._LUTSignature.length&&!h.some(function(r,t){return r!==this._LUTSignature[t]}.bind(this))))return;
h=k.pixels.length;var g=[],e=[],l=b.max,p=b.min,v=b.gamma,z=l-p,u=this._getCutOffPoints(a);a=u.minCutOff;u=u.maxCutOff;var E=0,w=256;"S8"===k.pixelType?E=-127:"S16"===k.pixelType&&(E=-32767);if("U16"===k.pixelType||"S16"===k.pixelType)w=65536;for(k=0;k<h;k++)g[k]=u[k]-a[k];var F=this._gammaCorrection;if(b.useGamma)for(k=0;k<h;k++){var y=[];for(b=0;b<w;b++){var D=b+E;var B=(D-a[k])/g[k];var x=1;1<v[k]&&(x-=Math.pow(1/z,B*F[k]));D<u[k]&&D>a[k]?y[b]=Math.floor(x*z*Math.pow(B,1/v[k]))+p:D>u[k]?y[b]=l:
D<a[k]&&(y[b]=p)}e[k]=y}else for(k=0;k<h;k++){y=[];for(b=0;b<w;b++)D=b+E,y[b]=D<a[k]?p:D>u[k]?l:Math.floor((D-a[k])/g[k]*z)+p;e[k]=y}this.LUT=e;this.LUTOffset=E;this._LUTSignature=this._computeLutSignature()}},_computeLutSignature:function(){var a=this.functionArguments,b=[],k,h;b.push(a.stretchType);b.push(a.min);b.push(a.max);b.push(a.numberOfStandardDeviations);if(this._statistics)for(k=0;k<this._statistics.length;k++)for(h=0;h<this._statistics[k].length;h++)b.push(this._statistics[k][h]);b.push(a.dra?
1:0);b.push(a.minPercent);b.push(a.maxPercent);if(a.gamma)for(k=0;k<this._statistics.length;k++)b.push(a.gamma[k]);b.push(a.useGamma?1:0);return b},_filterNoLUT:function(a){if(null!==a&&null!==a.pixelBlock&&null!==a.pixelBlock.pixels){var b=this.functionArguments,k=a.pixelBlock,h=k.pixels,g=k.mask;k=k.width*k.height;var e=h.length,l=[],p=[],v=b.max,z=b.min,u=b.gamma,E=v-z;var w=this._getCutOffPoints(a);var F=w.minCutOff,y=w.maxCutOff;for(w=0;w<e;w++)l[w]=y[w]-F[w];if(b.useGamma&&null!==u&&u.length>=
e)for(w=0;w<e;w++)p[w]=1<u[w]?2<u[w]?6.5+Math.pow(u[w]-2,2.5):6.5+100*Math.pow(2-u[w],4):1;if(b.useGamma)if(void 0!==g&&null!==g)for(b=0;b<k;b++){if(g[b])for(w=0;w<e;w++){var D=h[w][b];var B=(D-F[w])/l[w];var x=1;1<u[w]&&(x-=Math.pow(1/E,B*p[w]));D<y[w]&&D>F[w]?h[w][b]=Math.floor(x*E*Math.pow(B,1/u[w]))+z:D>y[w]?h[w][b]=v:D<F[w]&&(h[w][b]=z)}}else for(b=0;b<k;b++)for(w=0;w<e;w++)D=h[w][b],B=(D-F[w])/l[w],x=1,1<u[w]&&(x-=Math.pow(1/E,B*p[w])),D<y[w]&&D>F[w]?h[w][b]=Math.floor(x*E*Math.pow(B,1/u[w]))+
z:D>y[w]?h[w][b]=v:D<F[w]&&(h[w][b]=z);else if(void 0!==g&&null!==g)for(b=0;b<k;b++){if(g[b])for(w=0;w<e;w++)D=h[w][b],D<y[w]&&D>F[w]?h[w][b]=Math.floor((D-F[w])/l[w]*E)+z:D>y[w]?h[w][b]=v:D<F[w]&&(h[w][b]=z)}else for(b=0;b<k;b++)for(w=0;w<e;w++)D=h[w][b],D<y[w]&&D>F[w]?h[w][b]=Math.floor((D-F[w])/l[w]*E)+z:D>y[w]?h[w][b]=v:D<F[w]&&(h[w][b]=z);a.pixelBlock.pixelType="U8";return a}},_computeGammaValues:function(a){var b=this._statistics.length,k,h=[];for(k=0;k<b;k++){var g=this._statistics[k][2];"U8"!==
a&&(g=255*(g-this._statistics[k][0])/(this._statistics[k][1]-this._statistics[k][0]));h.push(this._computeGammaValue(g))}return h},_computeGammaValue:function(a){if(0!==a&&!(255<a||0>a)){var b=0;0<a&&150!=a&&255>a&&(b=150>=a?45*Math.cos(.01047*a):17*Math.sin(.021*a));b=Math.log((a+b)/255);if(0!==b&&(a=Math.log(a/255)/b,!isNaN(a)))return Math.min(9.9,Math.max(.01,a))}},readGL:function(a){return this._stretchGL(a.raster)},_stretchGL:function(a){this._performance.start();var b=this.renderTexture,k,h=
a.pixelBlock&&a.pixelBlock.pixels&&a.pixelBlock.pixels.length||this.sourceRasterInfo.raster.bandCount,g=a.pixelBlock,e=this.gl,l=e.drawingBufferWidth,p=e.drawingBufferHeight;if(!g&&this.functionArguments.dra){var v=new Float32Array(l*p*4),z=new Uint8Array(l*p);var u=new Float32Array(l*p);var E=new Float32Array(l*p);var w=new Float32Array(l*p);e.checkFramebufferStatus(e.FRAMEBUFFER)==e.FRAMEBUFFER_COMPLETE&&e.readPixels(0,0,l,p,e.RGBA,e.FLOAT,v);for(k=0;k<l*p;k++)u[k]=v[4*k],E[k]=v[4*k+1],w[k]=v[4*
k+2],z[k]=v[4*k+3];a.pixelBlock=new n({width:l,height:p,pixels:[u,E,w],mask:z});a.pixelBlock.calculateStatistics()}!g&&this.functionArguments.dra&&this._useGPUStats?(u=new Float32Array(h),E=new Float32Array(h)):(this._updateStatistisHistograms(a),v=this._getCutOffPoints(a),u=new Float32Array(h),E=new Float32Array(h),u.set(v.minCutOff.slice(0,h)),E.set(v.maxCutOff.slice(0,h)));this._initializeProgram({fragment:f.stretch,fragmentName:"Stretch"});v=this._setupTextureData(a);z=this.bindFrameBuffer();
this.renderTexture=!1;this._performance.start();if(!g&&this.functionArguments.dra&&this._useGPUStats){this._setUniforms({u_sourceDim:[l,p],u_bandCount:h});if(1===h)var F=this._readMinMax(v,2);else{F=this._readMinMax(v,0);var y=this._readMinMax(v,1)}if(6===this.functionArguments.stretchType||3===this.functionArguments.stretchType&&this.functionArguments.dra)k=this._readHistogram(F,y,a),u=k.minCutOff||u,E=k.minCutOff||E}w=this.functionArguments.max-this.functionArguments.min;a=new Float32Array(h);for(k=
0;k<h;k++)a[k]=w/(E[k]-u[k]);this._useGPUStats&&this._initializeProgram({fragment:f.stretch,fragmentName:"Stretch"});e.blendFunc(e.SRC_ALPHA,e.ZERO);w=new Float32Array(3);var D=new Float32Array(3);for(k=0;3>k;k++)w[k]=this.functionArguments.min,D[k]=this.functionArguments.max;k=this.functionArguments.useGamma;var B=this.functionArguments.gamma,x=this._gammaCorrection;Array.isArray(B)&&B.length>=h||(k=!1);this._setUniforms({u_sourceDim:[l,p],u_bandCount:h,u_minOutput:w,u_maxOutput:D,u_minCutOff:u,
u_maxCutOff:E,u_factor:a,u_state:100,u_useGamma:k,u_gamma:B,u_scaled:!b,u_gammaCorrection:x,u_minMaxTexture:!g&&this.functionArguments.dra&&this._useGPUStats?!0:!1});this.renderTexture=b;e.viewport(0,0,l,p);this._bindTexture(v.texture,"u_image");!g&&this.functionArguments.dra&&this._useGPUStats&&(b=e.getUniformLocation(this.rasterProgram,"u_image1"),e.uniform1i(b,1),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,F.texture),1<h&&(h=e.getUniformLocation(this.rasterProgram,"u_image2"),e.uniform1i(h,
2),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,y.texture)));this._drawGL();return{extent:v.extent,texture:z.texture}},_readMinMax:function(a,b){var k=this.gl,h=a.width||k.drawingBufferWidth,g=a.height||k.drawingBufferHeight;this._setUniforms({u_state:b});this.renderTexture=!1;var e=a.texture;for(k.activeTexture(k.TEXTURE0);1<h||1<g;){var l=this._createTexture();b=Math.max(Math.ceil(h/2),1);var p=Math.max(Math.ceil(g/2),1);k.getExtension("OES_texture_float");k.texImage2D(k.TEXTURE_2D,0,
k.RGBA,b,p,0,k.RGBA,k.FLOAT,null);a=k.createFramebuffer();k.bindFramebuffer(k.FRAMEBUFFER,a);k.framebufferTexture2D(k.FRAMEBUFFER,k.COLOR_ATTACHMENT0,k.TEXTURE_2D,l,0);k.viewport(0,0,b,p);k.bindTexture(k.TEXTURE_2D,e);this._setUniforms({u_sourceDim:[h,g]});h=b;g=p;this._drawGL(!0);e=l}a=new Float32Array(h*g*4);k.checkFramebufferStatus(k.FRAMEBUFFER)==k.FRAMEBUFFER_COMPLETE&&k.readPixels(0,0,h,g,k.RGBA,k.FLOAT,a);return{texture:l,minmax:a}},_readHistogram:function(a,b,k){if(a)try{var h=this.gl,g=h.drawingBufferWidth,
e=h.drawingBufferHeight,l,p,v;if(a.texture instanceof WebGLTexture){var z=!0;var u=[1,0,0,1];if(b){var E=a.minmax;var w=b.minmax}else E=[a.minmax[0]],w=[a.minmax[1]]}else for(w=b,E=a,u=new Float32Array(w.length),l=0;l<w.length;l++)u[l]=256/(w[l]-E[l]);var F=new Float32Array(g*e);for(v=0;v<F.length;v++)F[v]=v;if(!this.histogramProgram){var y=q.getShader(h,q.histogram),D=f.getShader(h,f.constant);this.histogramProgram=this._loadProgram(y,D)}h.blendFunc(h.ONE,h.ONE);h.enable(h.BLEND);h.useProgram(this.histogramProgram);
var B=h.getAttribLocation(this.histogramProgram,"a_pixelIndex"),x=h.createBuffer();h.bindBuffer(h.ARRAY_BUFFER,x);h.bufferData(h.ARRAY_BUFFER,F,h.STATIC_DRAW);h.enableVertexAttribArray(B);h.vertexAttribPointer(B,1,h.FLOAT,!1,0,0);var r=this._setupHistTexture(k),t=this._createTexture();h.getExtension("OES_texture_float");h.texImage2D(h.TEXTURE_2D,0,h.RGBA,257,1,0,h.RGBA,h.FLOAT,null);var C=h.createFramebuffer();h.bindFramebuffer(h.FRAMEBUFFER,C);h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,
h.TEXTURE_2D,t,0);h.viewport(0,0,257,1);var J=h.getUniformLocation(this.histogramProgram,"u_image");h.uniform1i(J,0);h.activeTexture(h.TEXTURE0);h.bindTexture(h.TEXTURE_2D,r);var L=h.getUniformLocation(this.histogramProgram,"u_sourceDim");h.uniform2f(L,g,e);var P=h.getUniformLocation(this.histogramProgram,"u_bandCount");h.uniform1i(P,3);var U=h.getUniformLocation(this.histogramProgram,"u_halfPixel");h.uniform2f(U,.5/g,.5/e);var aa=h.getUniformLocation(this.histogramProgram,"u_minMaxTexture");if(z){h.uniform1i(aa,
1);var ea=h.getUniformLocation(this.histogramProgram,"u_image1");h.uniform1i(ea,1);h.activeTexture(h.TEXTURE1);h.bindTexture(h.TEXTURE_2D,a.texture);if(b){var ba=h.getUniformLocation(this.histogramProgram,"u_image2");h.uniform1i(ba,2);h.activeTexture(h.TEXTURE2);h.bindTexture(h.TEXTURE_2D,b.texture)}}else{var oa=h.getUniformLocation(this.histogramProgram,"u_mins");h.uniform4f(oa,E[0],E[0],E[0],E[0]);h.uniform1i(aa,0)}var da=h.getUniformLocation(this.histogramProgram,"u_color"),fa=h.getUniformLocation(this.histogramProgram,
"u_factors"),S=h.getUniformLocation(this.histogramProgram,"u_size");h.uniform1f(S,256);a=[];b=[];h.uniform4fv(da,[1,0,0,1]);h.uniform4fv(fa,[u[0],0,0,1]);h.drawArrays(h.POINTS,0,F.length);var W=this.sourceRasterInfo.raster.bandCount;1<W&&(h.uniform4fv(da,[0,1,0,1]),h.uniform4fv(fa,[0,u[0],0,1]),h.drawArrays(h.POINTS,0,F.length),h.uniform4fv(da,[0,0,1,1]),h.uniform4fv(fa,[0,0,u[0],1]),h.drawArrays(h.POINTS,0,F.length));if(h.checkFramebufferStatus(h.FRAMEBUFFER)==h.FRAMEBUFFER_COMPLETE){var la=new Float32Array(1028);
h.readPixels(0,0,257,1,h.RGBA,h.FLOAT,la);h=0;var K=-.5===E[0]&&1===(w[0]-E[0])/256?.5:0;for(l=0;l<W;l++){var O=new Float32Array(257);var G=new Float32Array(257);for(v=h=0;256>v;v++)h+=la[4*v+l],O[v]=h,G[v]=la[4*v+l];G[256]=la[1024+l];O[256]=h+la[1024+l];var M=this.functionArguments.minPercent*h/100;if(w){for(p=0;256>p;p++)if(O[p]>M){a[l]=E[0]+(w[0]-E[0])/256*(p+K);break}M=(1-this.functionArguments.maxPercent/100)*h;for(p=254;0<=p;p--)if(O[p]<M){b[l]=E[0]+(w[0]-E[0])/256*(p+2-K);break}}}}return{histogram:la,
minCutOff:a,maxCutOff:b}}catch(N){console.debug("webgl filter exception: "+N.message)}},_setupHistTexture:function(a){if(a instanceof WebGLTexture)return a;var b=this.originalHistTexture=this._createTexture(),k=this.gl;a=a.pixelBlock;var h=a.width,g=a.height;k.getExtension("OES_texture_float");this.rgbaFloatData=a.getAsRGBAFloat();k.texImage2D(k.TEXTURE_2D,0,k.RGBA,h,g,0,k.RGBA,k.FLOAT,this.rgbaFloatData);return b}})})},"esri/layers/rasterLib/function/RemapFunction":function(){define("dojo/_base/declare dojo/_base/lang ../../../renderers/colorRampGenerator ./RasterFunctionX ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),
function(H,d,m,n,q,f,c){return H([n,f],{declaredClass:"esri.layers.rasterLib.function.RemapFunction",functionName:"Remap",pixelType:"U8",renderTexture:!1,supportWebGL:!0,support2D:!0,constructor:function(a){this.functionArguments=this.mixinIgnoreCase({inputRanges:null,outputValues:null,outputColors:null,colorBreaks:null,raster:null},a)},bind:function(a){a=this.getSourceRasterInfo(a);if(!a.raster)return Error("The raster input is not available.");var b=!(!this.functionArguments.outputColors&&!this.functionArguments.colorBreaks);
this.rasterInfo=d.mixin(a.raster,{bandCount:b?3:1,pixelType:this._calculatePixelType(this.pixelType,"U8"),statistics:null,histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType=b?"Processed":"Thematic";return!0},read2D:function(a){return this._remap(a.raster)},readGL:function(a){return this._remapGL(a.raster)},_remap:function(a){this._performance.start();var b=c.remapColor(a.pixelBlock,this.functionArguments.colorBreaks);this._addPerformanceMetric(this._performance.elapsed());
return{extent:a.extent,pixelBlock:b}},_remapGL:function(a){this._performance.start();this._initializeProgram({fragment:q.remap,fragmentName:"Remap"});var b=new Uint8Array(64),k=this.functionArguments.colorBreaks;k.forEach(function(l,p){b[4*p]=l.mappedColor[0];b[4*p+1]=l.mappedColor[1];b[4*p+2]=l.mappedColor[2];b[4*p+3]=1>=l.mappedColor[3]?255*l.mappedColor[3]:l.mappedColor[3]});var h=k[k.length-1],g=h.mappedColor;b[60]=g[0];b[61]=g[1];b[62]=g[2];b[63]=1>=g[3]?255*g[3]:g[3];var e=new Float32Array(16);
k.forEach(function(l,p){e[p]=l.value});e[15]=h.value;this._clrTexture||(this._clrTexture=this._setupColormapTexture(b));k=this._clrTexture;h=this.bindFrameBuffer();a=this._setupTextureData(a);this._setUniforms({u_indexedColormapOffset:0,u_indexedColormapMaxIndex:b.length/4-1,u_breaks:e});this._bindTexture(k,"u_image1");this._bindTexture(a.texture,"u_image");this._drawGL();return{extent:a.extent,texture:h.texture}},_setupColormapTexture:function(a){var b=this._createTexture(),k=a.length/4,h=new Float32Array(a.length),
g=this.renderTexture?255:1,e,l=this.gl;for(e=0;e<a.length;e++)h[e]=a[e]/g;l.getExtension("OES_texture_float");l.texImage2D(l.TEXTURE_2D,0,l.RGBA,k,1,0,l.RGBA,l.FLOAT,h);return b}})})},"esri/layers/rasterLib/function/IdentityFunction":function(){define(["dojo/_base/declare","dojo/_base/lang","./pixelShaders","./RasterFunctionX","./RasterFunctionWebGLMixin"],function(H,d,m,n,q){return H([n,q],{declaredClass:"esri.layers.rasterLib.function.IdentityFunction",functionName:"Identity",supportWebGL:!0,support2D:!0,
constructor:function(f){this.functionArguments={raster:null}},bind:function(f){f=this.getSourceRasterInfo(f);if(!f.raster)return Error("The raster input to identity function is invalid.");this.rasterInfo=d.mixin(f.raster,{});return!0},read2D:function(f){return f.raster},readGL:function(f){this._initializeProgram({fragment:m.identity,fragmentName:"identity"});f=this._setupTextureData(f.raster);var c=this.bindFrameBuffer();this._bindTexture(f.texture,"u_image");this._drawGL();return{extent:f.extent,
texture:c.texture}}})})},"esri/layers/rasterLib/function/ResampleFunction":function(){define(["dojo/_base/declare","dojo/_base/lang","./pixelShaders","./RasterFunctionX","./RasterFunctionWebGLMixin"],function(H,d,m,n,q){return H([n,q],{declaredClass:"esri.layers.rasterLib.function.ResampleFunction",renderTexture:!0,resamplingOrigin:null,resamplingRatio:null,zFactor:1,functionName:"Resample",supportWebGL:!0,support2D:!1,constructor:function(f){this.functionArguments=this.mixinIgnoreCase({resamplingType:0},
f)},bind:function(f){f=this.getSourceRasterInfo(f);if(!f.raster)return Error("The raster input to convolution function is invalid.");this.rasterInfo=d.mixin(f.raster,{bandCount:f.raster.bandCount,pixelType:this._calculatePixelType(this.pixelType,f.raster.pixelType),statistics:f.raster.statistics,histograms:f.raster.histograms});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};return!0},readGL:function(f){this._performance.start();this._initializeProgram({fragment:m.resample,fragmentName:"Resample"});
var c=this._setupTextureData(f.raster),a=this.bindFrameBuffer(),b=this.gl,k=b.drawingBufferWidth;b=b.drawingBufferHeight;var h=f.raster;void 0!==h.pixelBlock?(c=c||this._setupTextureData(h),f=h.pixelBlock.width,h=h.pixelBlock.height):(c=c||h,f=k,h=b);this._setUniforms({u_resamplingRatio:this.resamplingRatio||[f/k,h/b],u_anchor:this.resamplingOrigin||[0,1],u_resamplingType:this.functionArguments.resamplingType,u_resolution:[1/k,1/b]});this._drawGL();this._addPerformanceMetric(this._performance.elapsed());
return{extent:c.extent,texture:a.texture}}})})},"esri/layers/rasterLib/renderer/rasterRendererHelper":function(){define("dojo/_base/declare dojo/_base/lang ../../PixelBlock ./RasterColormapRenderer ./RasterUniqueValueRenderer ./RasterRGBRenderer ./RasterStretchColorRampRenderer ./RasterClassBreaksRenderer ./RasterShadedReliefRenderer".split(" "),function(H,d,m,n,q,f,c,a,b){var k=function(){function h(e){g[e.prototype.rendererName]=e}var g={};h(n);h(f);h(c);h(q);h(a);h(b);return g}();return{wellKnownRenderers:k,
isSupported:function(h){if(!h)return!1;var g=!0;k[h.rendererName]||(g=!1);return g},create:function(h){if(!h)return null;if(h.rendererName){var g=h.rendererName;h=h.rendererArguments}else g="uniqueValue rasterStretch rasterShadedRelief rgb rasterColormap classBreaks".split(" ").indexOf(h.type),g="UniqueValue Stretch ShadedRelief RGB Colormap ClassBreaks".split(" ")[g],"rasterStretch"===h.type&&h.bandIndex&&1<h.bandIndex.length&&(g="RGB");return(g=k[g])?new g(h):null},createDefaultRenderer:function(h){if(h&&
h.raster){var g=h.raster.rasterInfo,e=h.raster.dataType;if(g){var l=h.raster.rasterFunction,p=["Stretch","Colormap","ContrastAndBrightness"];if(l&&"U8"===g.pixelType&&-1<p.indexOf(l.functionName))l.renderTexture=!0;else if("Processed"!==e||!(h.useWebGL&&l&&l.renderTexture||!h.useWebGL&&"U8"===g.pixelType)){l&&(g=l.rasterInfo);l=g.bandCount;var v=g.colormap,z=g.vat;p=g.histograms;p&&0===p.length&&(p=null);var u=g.statistics&&g.statistics.map(function(F){return[F.min,F.max,F.mean,F.stddev]});if(1===
l&&v&&0<v.length)var E=this._getDefaultColormapRenderer(z,v);else if(1===l&&z&&z.features&&0<z.features.length)E=new q({});else{v=0;z=!1;e||!h.raster||!h.raster.tileInfo||void 0!==h.raster.tileInfo.tileType&&"Map"!==h.raster.tileInfo.tileType?"U8"===g.pixelType&&"Processed"===e?(v=5,u=u||[[0,255,0,0],[0,255,0,0],[0,255,0,0]],z=!1):"U8"===g.pixelType||"Elevation"===e?(v=5,z=u?!1:!0):"Scientific"===e||"StdTime"===e?(v=5,z=u?!1:!0,E=this._getDefaultScientificColorRamp()):p&&0<p.length?(v=6,z=!1):u?(v=
5,z=!1):(v=6,z=!0):(u=[[0,255,0,0],[0,255,0,0],[0,255,0,0]],v=5,z=!1);u||(v=5,z=!0);var w;3<=l&&!(h.bandIds||h.raster&&h.raster.imageServiceParams&&h.raster.imageServiceParams.bandIds)&&(w=this.getDefaultBandCombination(g));w&&(u=w.map(function(F){return u[F]}));h={stretchType:v,min:0,max:255,dra:z,minPercent:.25,maxPercent:.25,useGamma:!1,computeGamma:!1,statistics:u,histograms:p,numberOfStandardDeviations:2.5,bandIndex:w};1===l||w&&1===w.length?(E&&(h.colorRamp=E,h.invert=!1),E=new c(h)):E=new f(h)}return E}}}},
getDefaultBandCombination:function(h){var g=h.bandCount;if(1===g)return null;if(2===g)return[0];var e=(h=h.keyProperties)&&h.ChangeAnalysisParameters&&h.ChangeAnalysisParameters.AnalysisType;if(e&&("ccdc"===e.toLowerCase()||"landtrendr"===e.toLowerCase()))return[0];h=h&&h.BandProperties;var l;if(h&&h.length===g){var p=this.getWellKnownBandIndexes(h);h=p.red;e=p.green;var v=p.blue;p=p.nir;null!=h&&null!=e&&null!=v?l=[h,e,v]:null!=p&&null!=h&&null!=e&&(l=[p,h,e])}!l&&3<=g&&(l=[0,1,2]);return l},getWellKnownBandIndexes:function(h){for(var g=
{},e=0;e<h.length;e++){var l=h[e],p=l.BandName&&l.BandName.toLowerCase();"red"===p?g.red=e:"green"===p?g.green=e:"blue"===p?g.blue=e:"nearinfrared"===p||"nearinfrared_1"===p||"nir"===p?g.nir=e:l.WavelengthMax&&l.WavelengthMin&&(p=l.WavelengthMin,l=l.WavelengthMax,null==g.blue&&410<=p&&480>=p&&480<=l&&540>=l?g.blue=e:null==g.green&&490<=p&&560>=p&&560<=l&&610>=l?g.green=e:null==g.red&&595<=p&&670>=p&&660<=l&&730>=l?g.red=e:null==g.nir&&700<=p&&860>=p&&800<=l&&950>=l&&(g.nir=e))}return g},_getDefaultColormapRenderer:function(h,
g){if(g||g.length){var e=[],l=this._ratContainsColormap(h);if(l)var p=this._getRATValueClassNameMap(h);g.forEach(function(v){var z=p?p[v[0]]:v[0];e.push({color:[v[1],v[2],v[3]],value:v[0],label:l?null!=z?z:"":v[0]})});return new n({colormapInfos:e})}},_ratContainsColormap:function(h){if(!h||!h.fields)return!1;var g,e,l;return h.fields.some(function(p){p&&p.name&&(p=p.name.toLowerCase(),"red"===p&&(g=!0),"green"===p&&(e=!0),"blue"===p&&(l=!0));return g&&e&&l})},_getRATValueClassNameMap:function(h){if(!h||
!h.fields)return null;var g={},e,l;h.fields.forEach(function(p){if("classname"===p.name.toLowerCase()||"class_name"===p.name.toLowerCase())e=p.name;"value"===p.name.toLowerCase()&&(l=p.name)});h.features.forEach(function(p){p=p.attributes;g[p[l]]=e?p[e]:p[l]});return g},_getDefaultScientificColorRamp:function(){return{type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}].map(function(h){return{fromColor:h.toColor,
toColor:h.fromColor}}).reverse()}}}})},"esri/layers/rasterLib/renderer/RasterColormapRenderer":function(){define(["dojo/_base/declare","dojo/_base/lang","./RasterRenderer","../function/ColormapFunction"],function(H,d,m,n){return H([m],{declaredClass:"esri.layers.rasterLib.renderer.RasterColormapRenderer",rendererName:"Colormap",renderTexture:!0,constructor:function(q){q&&q.colormapInfos&&(q.colormap=q.colormapInfos.map(function(f){return[f.value].concat(f.color)}));this._function=new n(q);this._function.outputPixelType=
"U8";this._function.renderTexture=!0},draw2D:function(q){this._updateColormapParameters();q=this._clonePixelData(q);return q=this._function._colorize(q)},drawGL:function(q){this._updateColormapParameters();this._function._colorizeGL(q)},toJson:function(){var q=this._function.toJson().rasterFunctionArguments;return{rendererName:this.rendererName,rendererArguments:q}},toCommonRendererJson:function(){return{type:"rasterColormap",colormapInfos:this.colormapInfos||this.colormap.map(function(q){return{value:q[0],
color:q.slice(1),label:q[0]}})}},_updateColormapParameters:function(){var q=this._function.functionArguments;q.colormap=this.colormap;q.colormapName=this.colormapName;q.colorRamp=this.colorRamp;q.colorRampName=this.colorRampName}})})},"esri/layers/rasterLib/renderer/RasterRenderer":function(){define(["dojo/_base/declare","dojo/_base/lang","../../../geometry/Extent","../../PixelBlock"],function(H,d,m,n){return H(null,{declaredClass:"esri.layers.rasterLib.renderer.RasterRenderer",raster:null,constructor:function(q){q=
q||{};this.raster=q.raster||q.Raster||this.raster;this.draw=d.hitch(this,this.draw);this.bind=d.hitch(this,this.bind);q=d.clone(q);Object.keys(q).forEach(function(f){null==q[f]&&delete q[f]});d.mixin(this,q)},bind:function(q){if(!q)throw"failed to bind without options";var f=q;q.layer&&(q=q.layer,f={id:q.id,rawRasterInfo:q.raster.rasterInfo,glSetting:q._glSetting,xformSetting:q.tileManager&&q.tileManager.xformSetting,useWebGL:q.useWebGL,resampling:q.tileMode&&q.tileManager&&q.tileManager.xformSetting.requireProjection&&
!q._hasTilingEffects&&"Thematic"!==q.raster.dataType?1:0,tileMode:q.tileMode});this._rawRasterInfo=f.rawRasterInfo;this.useWebGL=f.useWebGL;this._function&&this._function.setProcessingContext(d.mixin({useProcessedData:!0},f));this._processingContext=f},hasTilingEffects:function(){},draw:function(q){return this.useWebGL?this.drawGL(q):this.draw2D(q)},toJson:function(){},_clonePixelData:function(q){if(null==q)return q;var f={};q.extent&&(f.extent=new m(q.extent.xmin,q.extent.ymin,q.extent.xmax,q.extent.ymax,
q.extent.spatialReference));q=q.processedPixelBlock||q.pixelBlock;if(null==q)return f;f.pixelBlock=q.clone?q.clone():n.prototype.clone(q);return f}})})},"esri/layers/rasterLib/renderer/RasterUniqueValueRenderer":function(){define(["dojo/_base/declare","dojo/_base/lang","./RasterRenderer","../function/ColormapFunction","../../../renderers/colorRampGenerator"],function(H,d,m,n,q){return H([m],{declaredClass:"esri.layers.rasterLib.renderer.RasterUniqueValueRenderer",rendererName:"UniqueValue",field:"",
alias:"",uniqueValueInfos:null,constructor:function(f){f&&f.colormap&&(this.colormap=f.colormap,this._function=new n(f),this._function.outputPixelType="U8",this._function.renderTexture=!0)},bind:function(f){this.inherited(arguments);if(!this._function){var c=(this.raster&&this.raster.rasterInfo||this._rawRasterInfo).vat;if(!c)throw"uv renderer requires data source to have raster attribute table";var a=this.attributeField||this.field1||this.field,b=this.infos||this.uniqueValueInfos;this.defaultColor=
this.defaultColor||this.defaultSymbol&&this.defaultSymbol.color;var k=c.fields.filter(function(E){return"value"===E.name.toLowerCase()})[0];if(k)var h=k.name;a||((a=c.fields.filter(function(E){return-1<["classname","category"].indexOf(E.name.toLowerCase())})[0])||(a=c.fields.filter(function(E){return"esriFieldTypeString"===E.type})[0]),this.alias=(this.field=a=a&&a.name||h)&&a.alias||h);var g=[],e;if(!b){b=[];var l=c.fields.filter(function(E){return"alpha"===E.name.toLowerCase()})[0];var p=c.fields.filter(function(E){return"red"===
E.name.toLowerCase()})[0];var v=c.fields.filter(function(E){return"green"===E.name.toLowerCase()})[0];var z=c.fields.filter(function(E){return"blue"===E.name.toLowerCase()})[0];for(k=0;k<c.features.length;k++){var u=c.features[k].attributes;(e=b.some(function(E){E.value===u[a]}))||(l&&p&&v&&z?b.push({value:u[a],alias:u[a],color:[u[p.name],u[v.name],u[z.name],u[l.name]]}):p&&v&&z?b.push({value:u[a],alias:u[a],color:[u[p.name],u[v.name],u[z.name]]}):b.push({value:u[a],alias:u[a]}))}if(!(p&&v&&z))for(e=
q.createRandomColorRamp({size:b.length}),k=0;k<b.length;k++)b[k].color=e[k];this.uniqueValueInfos=b}if(b)b.forEach(function(E){g=g.concat(c.features.filter(function(w){return E.value==w.attributes[a]}).map(function(w){return[w.attributes[h]].concat(E.color||E.symbol&&E.symbol.color)}))}),this.defaultColor&&c.features.filter(function(E){g.some(function(w){return w[0]===E.attributes[h]})||g.push([E.attributes[h]].concat(this.defaultColor))});else throw"missing uniqueValueInfos property";this._function=
new n({colormap:g});this.colormap=g;this._function.outputPixelType="U8";this._function.renderTexture=!0;this._function.setProcessingContext(this._processingContext)}},draw2D:function(f){f=this._clonePixelData(f);return f=this._function._colorize(f)},drawGL:function(f){this._function._colorizeGL(f)},toJson:function(f){var c={field:this.field,uniqueValueInfos:this.uniqueValueInfos,defaultColor:this.defaultColor};f&&(c.colormap=this.colormap);return{rendererName:this.rendererName,rendererArguments:c}},
toCommonRendererJson:function(){var f=this.attributeField||this.field1||this.field,c=(this.infos||this.uniqueValueInfos).map(function(a){return{value:a.value,label:a.alias+"",symbol:{color:3===a.color.length?a.color.concat([255]):a.color,type:"esriSFS",style:"esriSFSSolid"}}});return{type:"uniqueValue",field1:f,uniqueValueInfos:c}}})})},"esri/layers/rasterLib/renderer/RasterRGBRenderer":function(){define("dojo/_base/declare dojo/_base/lang ./RasterRenderer ../function/StretchFunction ../function/ContrastBrightnessFunction ../function/rasterUtils".split(" "),
function(H,d,m,n,q,f){return H([m],{declaredClass:"esri.layers.rasterLib.renderer.RasterRGBRenderer",rendererName:"RGB",bandIndex:null,stretchType:0,min:0,max:255,numberOfStandardDeviations:2,statistics:null,histograms:null,dra:!1,minPercent:.25,maxPercent:.5,useGamma:!1,gamma:null,computeGamma:!1,sigmoidStrengthLevel:1,constructor:function(c){this.stretchType="number"===typeof this.stretchType?this.stretchType:"none   standardDeviation histogramEqualization minMax percentClip   sigmoid".split(" ").indexOf(this.stretchType);
c=d.mixin({},c,{stretchType:this.stretchType});this._stretchFunction=new n(c);this._stretchFunction.outputPixelType="U8";this._stretchFunction.renderTexture=!1;this.bandIndex=c.bandIndex||c.BandIndex;this._function=new q(c);this._function.functionArguments.raster=this._stretchFunction;this._function.renderTexture=!0},hasTilingEffects:function(){return this._stretchFunction.hasTilingEffects()},draw2D:function(c){this._updateStretchParameters();c=this._clonePixelData(c);if("U8"===c.pixelBlock.pixelType&&
!this.contrastOffset&&!this.brightnessOffset)return c;this._stretchFunction._stretch(c);var a=c.pixelBlock,b=this.bandIndex,k=Math.max.apply(null,b);a&&a.pixels.length>k&&b&&(a.pixels=b.map(function(h){return a.pixels[h]}),a.statistics&&(a.statistics=b.map(function(h){return a.statistics[h]})));if(this.contrastOffset||this.brightnessOffset)c.pixelBlock=f.contrastBrightnessStretch(c.pixelBlock,{contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset});return c},drawGL:function(c){this._updateStretchParameters();
c.pixelBlock&&(c=this._clonePixelData(c));var a=c.pixelBlock,b=this.bandIndex,k=Math.max.apply(null,b),h=this.statistics&&0<this.statistics.length?this.statistics:this._stretchFunction&&this._stretchFunction.srcStatistics,g=this.histograms&&0<this.histograms.length?this.histograms:this._stretchFunction&&this._stretchFunction.srcHistograms,e,l;a&&a.pixels.length>k&&b&&(a.pixels=b.map(function(p){return a.pixels[p]}),a.statistics&&(a.statistics=b.map(function(p){return a.statistics[p]})),h&&0<h.length&&
h.length!==b.length&&(e=b.map(function(p){return h[p]})),g&&0<g.length&&g.length!==b.length&&(l=b.map(function(p){return g[p]})));this._stretchFunction.functionArguments.statistics=e||h;this._stretchFunction.functionArguments.histograms=l||g;this.contrastOffset||this.brightnessOffset?(this._stretchFunction.renderTexture=!1,this._function.renderTexture=!0,c=this._stretchFunction._stretchGL(c),this._function._cbGL(c)):(this._stretchFunction.renderTexture=!0,this._stretchFunction._stretchGL(c))},toJson:function(){var c=
this._stretchFunction.toJson().rasterFunctionArguments;c.bandIndex=this.bandIndex;c.contrastOffset=this.contrastOffset;c.brightnessOffset=this.brightnessOffset;return{rendererName:this.rendererName,rendererArguments:c}},toCommonRendererJson:function(){return{type:"rasterStretch",stretchType:"none   standardDeviation histogramEqualization minMax percentClip   sigmoid".split(" ")[this.stretchType]||"minMax",min:this.min,max:this.max,numberOfStandardDeviations:this.numberOfStandardDeviations,statistics:d.clone(this.statistics),
dra:this.dra,minPercent:this.minPercent,maxPercent:this.maxPercent,useGamma:this.useGamma,gamma:d.clone(this.gamma),computeGamma:this.computeGamma,sigmoidStrengthLevel:this.sigmoidStrengthLevel}},_updateStretchParameters:function(){var c=this._stretchFunction.functionArguments;c.stretchType=this.stretchType;c.min=this.min;c.max=this.max;c.numberOfStandardDeviations=this.numberOfStandardDeviations;c.statistics=this.statistics;c.histograms=this.histograms;c.dra=this.dra;c.minPercent=this.minPercent;
c.maxPercent=this.maxPercent;c.useGamma=this.useGamma;c.gamma=this.gamma;c.computeGamma=this.computeGamma;this._stretchFunction.interpolation=this.interpolation}})})},"esri/layers/rasterLib/renderer/RasterStretchColorRampRenderer":function(){define("dojo/_base/declare dojo/_base/lang ./RasterRenderer ../function/ResampleFunction ../function/StretchFunction ../function/ContrastBrightnessFunction ../function/ColormapFunction ../function/rasterUtils".split(" "),function(H,d,m,n,q,f,c,a){return H([m],
{declaredClass:"esri.layers.rasterLib.renderer.RasterStretchColorRampRenderer",rendererName:"Stretch",bandIndex:[0],colorRamp:null,invert:!1,stretchType:0,min:0,max:255,numberOfStandardDeviations:2,statistics:null,histograms:null,dra:!1,minPercent:.25,maxPercent:.5,useGamma:!1,gamma:null,computeGamma:!1,sigmoidStrengthLevel:1,constructor:function(b){this.stretchType="number"===typeof this.stretchType?this.stretchType:"none   standardDeviation histogramEqualization minMax percentClip   sigmoid".split(" ").indexOf(this.stretchType);
b=d.mixin({},b,{stretchType:this.stretchType});Object.keys(b).forEach(function(k){null==b[k]&&delete b[k]});this._function=new f(b);this._stretchFunction=new q(b);this._stretchFunction.outputPixelType="U8";this._stretchFunction.renderTexture=!1;this._clrFunction=new c(b);this._clrFunction.functionArguments.raster=this._stretchFunction;this._clrFunction.renderTexture=!1;this._function.functionArguments.raster=this._clrFunction},hasTilingEffects:function(){return this._stretchFunction.hasTilingEffects()},
draw2D:function(b){this._updateStretchParameters();b=this._clonePixelData(b);if("U8"===b.pixelBlock.pixelType&&!(this.contrastOffset||this.brightnessOffset||this.colorRamp))return b;this._stretchFunction._stretch(b);var k=b.pixelBlock,h=this.bandIndex?this.bandIndex[0]:0;k&&1<k.pixels.length&&k.pixels.length>h&&(k.pixels=[k.pixels[h]],k.statistics&&(k.statistics=[k.statistics[h]]));this.colorRamp&&(b=this._clrFunction._colorize(b));if(this.contrastOffset||this.brightnessOffset)b.pixelBlock=a.contrastBrightnessStretch(b.pixelBlock,
{contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset});return b},drawGL:function(b){this._updateStretchParameters();b.pixelBlock&&(b=this._clonePixelData(b));var k=b.pixelBlock,h=this.bandIndex?this.bandIndex[0]||0:0,g=this.statistics&&0<this.statistics.length?this.statistics:this._stretchFunction&&this._stretchFunction.srcStatistics,e=this.histograms&&0<this.histograms.length?this.histograms:this._stretchFunction&&this._stretchFunction.srcHistograms,l,p;k&&1<k.pixels.length&&
k.pixels.length>h&&(k.pixels=[k.pixels[h]],k.statistics&&(k.statistics=[k.statistics[h]]),g&&g.length>h&&(l=[g[h]]),e&&e.length>h&&(p=[e[h]]));this._stretchFunction.functionArguments.statistics=l||g;this._stretchFunction.functionArguments.histograms=p||e;k=!!this.colorRamp;this.contrastOffset||this.brightnessOffset?(this._stretchFunction.renderTexture=!1,this._clrFunction.renderTexture=!1,this._function.renderTexture=!0,b=this._stretchFunction._stretchGL(b),k&&(b=this._clrFunction._colorizeGL(b)),
this._function._cbGL(b)):k?(this._stretchFunction.renderTexture=!1,this._clrFunction.renderTexture=!0,b=this._stretchFunction._stretchGL(b),this._clrFunction._colorizeGL(b)):(this._stretchFunction.renderTexture=!0,this._stretchFunction._stretchGL(b))},toJson:function(){var b=this._stretchFunction.toJson().rasterFunctionArguments;b.colorRamp=this.colorRamp||"";this.invert&&(b.invert=!0);b.contrastOffset=this.contrastOffset;b.brightnessOffset=this.brightnessOffset;return{rendererName:this.rendererName,
rendererArguments:b}},toCommonRendererJson:function(){return{type:"rasterStretch",stretchType:"none   standardDeviation histogramEqualization minMax percentClip   sigmoid".split(" ")[this.stretchType]||"minMax",colorRamp:this.colorRamp&&this.colorRamp.toJson?this.colorRamp.toJson():this.colorRamp,min:this.min,max:this.max,numberOfStandardDeviations:this.numberOfStandardDeviations,statistics:d.clone(this.statistics),dra:this.dra,minPercent:this.minPercent,maxPercent:this.maxPercent,useGamma:this.useGamma,
gamma:d.clone(this.gamma),computeGamma:this.computeGamma,sigmoidStrengthLevel:this.sigmoidStrengthLevel}},_updateStretchParameters:function(){var b=this._stretchFunction.functionArguments;b.stretchType=this.stretchType;b.min=this.min;b.max=this.max;b.numberOfStandardDeviations=this.numberOfStandardDeviations;b.statistics=this.statistics;b.histograms=this.histograms;b.dra=this.dra;b.minPercent=this.minPercent;b.maxPercent=this.maxPercent;b.useGamma=this.useGamma;b.gamma=this.gamma;b.computeGamma=this.computeGamma;
this._stretchFunction.interpolation=this.interpolation}})})},"esri/layers/rasterLib/renderer/RasterClassBreaksRenderer":function(){define(["dojo/_base/declare","dojo/_base/lang","./RasterRenderer","../function/ColormapFunction","../function/RemapFunction"],function(H,d,m,n,q){return H([m],{declaredClass:"esri.layers.rasterLib.renderer.RasterClassBreaksRenderer",rendererName:"ClassBreaks",renderTexture:!0,constructor:function(f){f=f||{};this._function=new q(f);this._function.outputPixelType="U8";var c=
f.classBreakInfos;f=f.minValue;null!=f&&c&&(this._function.functionArguments.colorBreaks=this._getSortedColorBreaks(f,c))},bind:function(f){this.inherited(arguments);this.isColormapFunction=!1;var c=this.raster&&this.raster.rasterInfo||this._rawRasterInfo,a=c&&c.vat;if(a&&"u8"===c.pixelType.toLowerCase()&&this.classBreakInfos){var b=this.field;if(c=a.fields.filter(function(p){return"value"===p.name.toLowerCase()})[0])var k=c.name;var h=a.features.sort(function(p,v){return parseFloat(p.attributes[b])-
parseFloat(v.attributes[b])})[0].attributes[b];this.isColormapFunction=!0;var g=[],e=this.field,l=this.classBreakInfos;l.forEach(function(p,v){a.features.forEach(function(z){var u=l[v-1]&&l[v-1].classMaxValue||h;z.attributes[e]<=p.classMaxValue&&(z.attributes[e]>u||z.attributes[e]===h)&&(u=p.symbol.color,g.some(function(E){return E[0]===z.attributes[k]})||g.push([z.attributes[k]].concat(u)))})});this._function=new n({colormap:g});this.colormap=g;this._function.outputPixelType="U8";this._function.renderTexture=
!0}this._function&&this._function.setProcessingContext(d.mixin({useProcessedData:!0},this._processingContext))},draw2D:function(f){if(this.isColormapFunction)return this._updateColormapParameters(),f=this._clonePixelData(f),f=this._function._colorize(f);this._updateRemapParameters();return this._function._remap(f)},drawGL:function(f){this.isColormapFunction?(this._updateColormapParameters(),this._function._colorizeGL(f)):(this._function.renderTexture=!0,this._updateRemapParameters(),this._function._remapGL(f))},
toJson:function(){var f=this._function.toJson().rasterFunctionArguments;return{rendererName:this.rendererName,rendererArguments:f}},toCommonRendererJson:function(){var f,c=this.classBreakInfos,a=this.colorBreaks;if(null==c&&a)for(c=[],f=0;f<a.length-1;f++)c.push({classMaxValue:a[f+1].value,symbol:{color:a[f].mappedColor,type:"esriSFS",style:"esriSFSSolid"},label:a[f].value+" - "+a[f+1].value});return{type:"classBreaks",field:"Value",minValue:null!=this.minValue?this.minValue:a[0].value,classBreakInfos:c}},
_updateRemapParameters:function(){var f=this.classBreakInfos,c=this.minValue;null!=c&&f&&(this._function.functionArguments.colorBreaks=this._getSortedColorBreaks(c,f))},_getSortedColorBreaks:function(f,c){c=c.map(function(b){return{maxValue:b.classMaxValue,color:b.symbol.color}}).sort(function(b,k){return b.maxValue-k.maxValue});var a=[{value:f,mappedColor:c[0].color}];for(f=0;f<c.length;f++)a.push({value:c[f].maxValue,mappedColor:f===c.length-1?c[f].color:c[f+1].color});return a},_updateColormapParameters:function(){this._function.functionArguments.colormap=
this.colormap;this._function.interpolation=this.interpolation}})})},"esri/layers/rasterLib/renderer/RasterShadedReliefRenderer":function(){define("dojo/_base/declare dojo/_base/lang ./RasterRenderer ../function/HillshadeFunction ../function/ContrastBrightnessFunction ../function/ColormapFunction ../function/rasterUtils".split(" "),function(H,d,m,n,q,f,c){return H([m],{declaredClass:"esri.layers.rasterLib.renderer.RasterShadedReliefRenderer",rendererName:"ShadedRelief",hillshadeType:null,azimuth:315,
altitude:45,zFactor:1,slopeType:null,psPower:.664,psFactor:.024,raster:null,constructor:function(a){this.hillshadeType="number"===typeof this.hillshadeType?this.hillshadeType:["traditional","multi-directional"].indexOf(this.hillshadeType);a&&a.scalingType&&(this.slopeType="adjusted"===a.scalingType?3:1);a&&a.pixelSizePower&&(this.psPower=a.pixelSizePower);a&&a.pixelSizeFactor&&(this.psFactor=a.pixelSizeFactor);a=d.mixin({},a,{hillshadeType:this.hillshadeType,psPower:this.psPower,psFactor:this.psFactor,
slopeType:this.slopeType});Object.keys(a).forEach(function(b){null==a[b]&&delete a[b]});this._function=new q(a);this._hillshadeFunction=new n(a);this._hillshadeFunction.outputPixelType="U8";this._hillshadeFunction.renderTexture=!1;this._function.functionArguments.raster=this._hillshadeFunction},hasTilingEffects:function(){return this._hillshadeFunction.hasTilingEffects()},draw2D:function(a){this._updateHillshadeParameters();a=this._clonePixelData(a);a=this._hillshadeFunction.read2D({raster:a});if(this.contrastOffset||
this.brightnessOffset)a.pixelBlock=c.contrastBrightnessStretch(a.pixelBlock,{contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset});return a},drawGL:function(a){this._updateHillshadeParameters();this.contrastOffset||this.brightnessOffset?(this._hillshadeFunction.renderTexture=!1,this._function.renderTexture=!0,a=this._hillshadeFunction.readGL({raster:a}),this._function._cbGL(a)):(this._hillshadeFunction.renderTexture=!0,this._hillshadeFunction.readGL({raster:a}))},toJson:function(){var a=
this._hillshadeFunction.toJson().rasterFunctionArguments;a.colorRamp=this.colorRamp||"";this.invert&&(a.invert=!0);a.contrastOffset=this.contrastOffset;a.brightnessOffset=this.brightnessOffset;return{rendererName:this.rendererName,rendererArguments:a}},toCommonRendererJson:function(){return{type:"rasterShadedRelief",hillshadeType:["traditional","multi-directional"][this.hillshadeType]||"traditional",azimuth:this.azimuth,altitude:this.altitude,zFactor:this.zFactor,scalingType:3===this.slopeType?"adjusted":
"none",pixelSizePower:this.psPower,pixelSizeFactor:this.psFactor,colorRamp:this.colorRamp&&this.colorRamp.toJson?this.colorRamp.toJson():this.colorRamp}},_updateHillshadeParameters:function(){var a=this._hillshadeFunction.functionArguments;a.hillshadeType=this.hillshadeType;a.azimuth=this.azimuth;a.altitude=this.altitude;a.zFactor=this.zFactor;a.slopeType=this.slopeType;a.psPower=this.psPower;a.psFactor=this.psFactor}})})},"esri/layers/rasterLib/raster/rasterProjectionHelper":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/sniff ../../../kernel ../../../WKIDUnitConversion ../../../geometry/Extent ../../../geometry/projection ../../../geometry/webMercatorUtils ../../../SpatialReference ../../../geometry/Point".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h){H={requirePE:function(e,l){return!(e.equals(l)||e._canProject(l))},load:function(){var e=new m;if(!this._loadPromise)if(a.isSupported())this._loadPromise=a.load();else{var l=new m;l.reject("projection engine is not supported on this version of the browser, please try with a modern browser");this._loadPromise=l.promise}this._loadPromise.isFulfilled()?this._loadPromise.isResolved()?e.resolve():this._loadPromise.isRejected()&&e.resolve():(this._pendingdfds=this._pendingdfds||
[],this._pendingdfds.push(e),this._loadPromise.then(d.hitch(this,function(){this._pendingdfds.forEach(function(p){p.isFulfilled()||p.resolve()})}),d.hitch(this,function(){this._pendingdfds.forEach(function(p){p.isFulfilled()||p.reject()})})));return e.promise},computeError:function(e,l){return[Math.abs((e[0]+e[4]+e[4*l.rows]+e[4*l.rows+4])/4-e[2*l.rows+2]),Math.abs((e[1]+e[5]+e[4*l.rows+1]+e[4*l.rows+5])/4-e[2*l.rows+3])]},getDefaultDatumTransformationForDataset:function(e,l,p){if(!(l&&e.spatialReference&&
this.requirePE(e.spatialReference,l)&&a.isLoaded()))return null;e=new c(e.toJson());l=new k(l.toJson());return p?a.getTransformation(l,e.spatialReference,e):a.getTransformation(e.spatialReference,l,e)},project:function(e,l,p){if(!l||e.spatialReference.equals(l))return e;var v=a.isLoaded()?a:b;"esri.geometry.Extent"===e.declaredClass?e=new c(e.toJson()):"esri.geometry.Point"===e.declaredClass&&(e=new h(e.toJson()));l=new k(l.toJson());(e=v.project(e,l))&&"esri.geometry.Extent"===e.declaredClass?(e=
new c(e.toJson()),p&&(1E-5>Math.abs(e.xmin+180)&&1E-5>Math.abs(e.xmax-180)?(e.xmin=0,e.xmax=360):(0>e.xmin&&(e.xmin+=360,e.xmax+=360),0>e.xmax&&(e.xmax+=360)))):e&&"esri.geometry.Point"===e.declaredClass&&(e=new h(e.toJson()),p&&0>e.x&&(e.x+=360));return e},projectResolution:function(e,l,p){var v=p.xmin+(p.xmax-p.xmin)/2;p=p.ymin+(p.ymax-p.ymin)/2;e=new c(v,p,v+e.x,p+e.y,e.spatialReference);e=this.project(e,l);return new h(e.xmax-e.xmin,e.ymax-e.ymin,l)},getProjectionOffsetGrid:function(e,l,p,v,z,
u,E){null==E&&(E=[32,32]);var w=e.xmin,F=e.ymin,y=e.xmax,D=e.ymax,B=e.spatialReference,x=l.spatialReference,r=a.isLoaded()?a:b,t=z?-z:null,C=E[0]*p.x,J=E[1]*p.y;y={cols:Math.ceil((y-w)/C)+1,rows:Math.ceil((D-F)/J)+1};e=[];for(D=0;D<y.cols;D++){var L=P;var P=[];for(p=0;p<y.rows;p++){var U=new h({x:w+C*D,y:F+J*p,spatialReference:B});U=r.project(U,x,u);if(!U)return null;v&&0>U.x&&(U.x+=360);P.push(U);0<D&&null!=t&&U.x<L[p].x&&(U.x+=z-t,U.x<L[p].x&&(U.x+=z-t));e.push((U.x-l.xmin)/(l.xmax-l.xmin));e.push((U.y-
l.ymin)/(l.ymax-l.ymin))}}l=this.computeError(e,y);v=new Float32Array((y.cols-1)*(y.rows-1)*12);z=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]);u=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(D=0;D<y.cols-1;D++)for(p=0;p<y.rows-1;p++){C=D*y.rows*2+2*p;w=e[C];F=e[C+1];P=e[C+2];B=e[C+3];C+=2*y.rows;x=e[C];r=e[C+1];t=e[C+2];J=e[C+3];L=0;U=12*(p*(y.cols-1)+D);for(C=0;3>C;C++)v[U++]=z[L++]*w+z[L++]*P+z[L++]*t;for(C=L=0;3>C;C++)v[U++]=z[L++]*F+z[L++]*B+z[L++]*J;for(C=L=0;3>C;C++)v[U++]=u[L++]*w+u[L++]*x+u[L++]*
t;for(C=L=0;3>C;C++)v[U++]=u[L++]*F+u[L++]*r+u[L++]*J}return{offsets:e,error:l,coefficients:v,spacing:E,size:[y.cols-1,y.rows-1]}},getHalfWorldWidth:function(e){var l=e&&e.wkid;if(null!=l)return e.isWebMercator()&&(l=3857),null==f[l]?180:g[l]}};n("extend-esri")&&d.setObject("layers.rasterLib.raster.rasterProjectionHelper",H,q);var g={3395:2.0037508342789244E7,3410:1.7334193943686873E7,3832:3339584.723798206,3857:2.0037508342788905E7,3975:1.7367530445161372E7,4087:2.0037508342789244E7,4088:2.0015108787169147E7,
6933:1.7367530445161372E7,8858:7396237.374497803,8859:2465412.4581659334,32662:2.0037508342789244E7,53001:2.001508679602057E7,53002:1.000754339801029E7,53003:2.001508679602057E7,53004:2.001508679602057E7,53016:1.4152803599503474E7,53017:1.7333573624304302E7,53025:7276828.3848298555,53031:1.0384677558821043E7,53034:2.001508679602057E7,53036:7389443.187332862,53037:2463147.729110953,53079:2.0015114352186374E7,53080:2.0015114352186374E7,54001:2.0037508342789244E7,54002:1.0018754171394624E7,54003:2.0037508342789244E7,
54004:2.0037508342789244E7,54016:1.4168658027268292E7,54017:1.736753044516137E7,54025:7311399.09166516,54031:1.0396310810074743E7,54034:2.0037508342789244E7,54050:808820.9223376509,54053:1920897.3915568967,54079:2.0037508342789244E7,54080:2.0037508342789244E7,54099:1.3524439768288724E7,54100:2.0037508342789244E7,54101:2.0037508342789244E7,102038:4297258.582585486,102299:5013965.117483125};return H})},"esri/geometry/projection":function(){define("require exports dojo/Deferred ./pe ../SpatialReference ./GeographicTransformation".split(" "),
function(H,d,m,n,q,f){function c(g,e,l,p,v){void 0===p&&(p=null);void 0===v&&(v=!1);if(null===p){var z=f.cacheKey(e,l);void 0!==h[z]?p=h[z]:(p=a(e,l,null),null===p&&(p=new f),h[z]=p)}return b._project(g,e,l instanceof q||!1===v?l:new q(l),p,v)}function a(g,e,l){void 0===l&&(l=null);g=b._getTransformation(g,e,l);return null!==g?f.fromGE(g):null}Object.defineProperty(d,"__esModule",{value:!0});var b=null;d.isLoaded=function(){return!!b&&n.isLoaded()};d.isSupported=function(){return n.isSupported()};
var k=null;d.load=function(){if(k)return k.promise;k=new m;var g=n.load();H(["./geometryEngine"],function(e){b=e;g.then(function(){b._enableProjection(n);k.resolve()},function(l){k.reject(l)})});return k.promise};d.project=function(g,e,l){void 0===l&&(l=null);return g instanceof Array?0===g.length?[]:c(g,g[0].spatialReference,e,l):c([g],g.spatialReference,e,l)[0]};var h={};d.projectMany=c;d.getTransformation=a;d.getTransformations=function(g,e,l){void 0===l&&(l=null);g=b._getTransformationBySuitability(g,
e,l);if(null!==g){e=[];for(l=0;l<g.length;l++)e.push(f.fromGE(g[l]));return e}return[]}})},"esri/geometry/pe":function(){define(["require","exports","../core/tsSupport/extendsHelper","dojo/Deferred","../core/sniff"],function(H,d,m,n,q){function f(z){function u(y,D,B){y[D]=B(y[D])}d._pe=z;g.init();e.init();l.init();p.init();v.init();d.PeGCSExtent=function(y){function D(){return null!==y&&y.apply(this,arguments)||this}m(D,y);D.prototype.destroy=function(){d._pe.destroy(this)};return D}(d._pe.PeGCSExtent);
for(var E=0,w=[d._pe.PeDatum,d._pe.PeGeogcs,d._pe.PeGeogtran,d._pe.PeObject,d._pe.PeParameter,d._pe.PePrimem,d._pe.PeProjcs,d._pe.PeSpheroid,d._pe.PeUnit];E<w.length;E++)z=w[E],u(z.prototype,"getName",function(y){return function(){return y.call(this,Array(g.PE_NAME_MAX))}});E=0;for(w=[d._pe.PeGeogtran,d._pe.PeProjcs];E<w.length;E++)z=w[E],u(z.prototype,"getParameters",function(y){return function(){for(var D=Array(g.PE_PARM_MAX),B=y.call(this),x=0;x<D.length;x++){var r=d._pe.getValue(B,"*");D[x]=r?
d._pe.wrapPointer(r,d._pe.PeParameter):null;B+=Int32Array.BYTES_PER_ELEMENT}return D}});u(d._pe.PeHorizon.prototype,"getCoord",function(y){return function(){var D=this.getSize();if(!D)return null;var B=[],x=y.call(this);k(B,D,x);return B}});u(d._pe.PeGTlistExtendedEntry.prototype,"getEntries",function(y){var D=d._pe._pe_getPeGTlistExtendedGTsSize();return function(){var B=null,x=y.call(this);if(!d._pe.compare(x,d._pe.NULL)){B=[x];var r=this.getSteps();if(1<r){x=d._pe.getPointer(x);for(var t=1;t<r;t++)B.push(d._pe.wrapPointer(x+
D*t,d._pe.PeGTlistExtendedGTs))}}return B}});var F=d._pe._pe_getPeHorizonSize();z=function(y){return function(){var D=this._cache;D||(this._cache=D=new Map);if(D.has(y))return D.get(y);var B=null,x=y.call(this);if(!d._pe.compare(x,d._pe.NULL)){B=[x];var r=x.getNump();if(1<r){x=d._pe.getPointer(x);for(var t=1;t<r;t++)B.push(d._pe.wrapPointer(x+F*t,d._pe.PeHorizon))}}D.set(y,B);return B}};u(d._pe.PeProjcs.prototype,"horizonGcsGenerate",z);u(d._pe.PeProjcs.prototype,"horizonPcsGenerate",z);d._pe.PeObject.prototype.toString=
function(y){void 0===y&&(y=g.PE_STR_OPTS_NONE);d._pe.ensureCache.prepare();var D=d._pe.getPointer(this),B=d._pe.ensureInt8(Array(g.PE_BUFFER_MAX));return d._pe.UTF8ToString(d._pe._pe_object_to_string_ext(D,y,B))}}function c(z){if(z){var u=d._pe.getClass(z);u&&(u=d._pe.getCache(u))&&(z=d._pe.getPointer(z))&&delete u[z]}}function a(z,u){var E=[];u=Array(u);for(var w=0;w<z;w++)E.push(d._pe.ensureInt8(u));return E}function b(z){if(Array.isArray(z[0])){var u=[];z.forEach(function(E){u.push(E[0],E[1])})}else u=
z;return u}function k(z,u,E,w){void 0===w&&(w=!1);if(w)for(w=0;w<2*u;w++)z[w]=d._pe.getValue(E+w*Float64Array.BYTES_PER_ELEMENT,"double");else{var F=0===z.length;for(w=0;w<u;w++)F&&(z[w]=Array(2)),z[w][0]=d._pe.getValue(E,"double"),z[w][1]=d._pe.getValue(E+Float64Array.BYTES_PER_ELEMENT,"double"),E+=2*Float64Array.BYTES_PER_ELEMENT}}Object.defineProperty(d,"__esModule",{value:!0});var h;d._pe=null;d.isLoaded=function(){return!!d._pe};d.isSupported=function(){return!!q("esri-wasm")};d.load=function(){if(h)return h.promise;
h=new n;H(["./support/pe-wasm"],function(z){z({locateFile:function(u){return H.toUrl("./support/"+u)},onAbort:function(u){h.reject(Error(u))}}).then(function(u){f(u);h.resolve()})});return h.promise};(function(z){function u(F,y,D){d._pe.ensureCache.prepare();var B=b(D),x=D===B;B=d._pe.ensureFloat64(B);(F=d._pe._pe_geog_to_proj(d._pe.getPointer(F),y,B))&&k(D,y,B,x);return F}function E(F,y,D){return w(F,y,D,0)}function w(F,y,D,B){d._pe.ensureCache.prepare();var x=b(D),r=D===x;x=d._pe.ensureFloat64(x);
(F=d._pe._pe_proj_to_geog_center(d._pe.getPointer(F),y,x,B))&&k(D,y,x,r);return F}z.geogToProj=u;z.projGeog=function(F,y,D,B){switch(B){case g.PE_TRANSFORM_P_TO_G:return E(F,y,D);case g.PE_TRANSFORM_G_TO_P:return u(F,y,D)}return 0};z.projToGeog=E;z.projToGeogCenter=w})(d.PeCSTransformations||(d.PeCSTransformations={}));var g;(function(z){z.init=function(){z.PE_BUFFER_MAX=d._pe.PeDefs.prototype.PE_BUFFER_MAX;z.PE_NAME_MAX=d._pe.PeDefs.prototype.PE_NAME_MAX;z.PE_MGRS_MAX=d._pe.PeDefs.prototype.PE_MGRS_MAX;
z.PE_USNG_MAX=d._pe.PeDefs.prototype.PE_USNG_MAX;z.PE_DD_MAX=d._pe.PeDefs.prototype.PE_DD_MAX;z.PE_DDM_MAX=d._pe.PeDefs.prototype.PE_DDM_MAX;z.PE_DMS_MAX=d._pe.PeDefs.prototype.PE_DMS_MAX;z.PE_UTM_MAX=d._pe.PeDefs.prototype.PE_UTM_MAX;z.PE_PARM_MAX=d._pe.PeDefs.prototype.PE_PARM_MAX;z.PE_TYPE_NONE=d._pe.PeDefs.prototype.PE_TYPE_NONE;z.PE_TYPE_GEOGCS=d._pe.PeDefs.prototype.PE_TYPE_GEOGCS;z.PE_TYPE_PROJCS=d._pe.PeDefs.prototype.PE_TYPE_PROJCS;z.PE_TYPE_GEOGTRAN=d._pe.PeDefs.prototype.PE_TYPE_GEOGTRAN;
z.PE_TYPE_COORDSYS=d._pe.PeDefs.prototype.PE_TYPE_COORDSYS;z.PE_TYPE_UNIT=d._pe.PeDefs.prototype.PE_TYPE_UNIT;z.PE_STR_OPTS_NONE=d._pe.PeDefs.prototype.PE_STR_OPTS_NONE;z.PE_STR_AUTH_NONE=d._pe.PeDefs.prototype.PE_STR_AUTH_NONE;z.PE_STR_AUTH_TOP=d._pe.PeDefs.prototype.PE_STR_AUTH_TOP;z.PE_STR_NAME_CANON=d._pe.PeDefs.prototype.PE_STR_NAME_CANON;z.PE_PARM_X0=d._pe.PeDefs.prototype.PE_PARM_X0;z.PE_PARM_ND=d._pe.PeDefs.prototype.PE_PARM_ND;z.PE_TRANSFORM_1_TO_2=d._pe.PeDefs.prototype.PE_TRANSFORM_1_TO_2;
z.PE_TRANSFORM_2_TO_1=d._pe.PeDefs.prototype.PE_TRANSFORM_2_TO_1;z.PE_TRANSFORM_P_TO_G=d._pe.PeDefs.prototype.PE_TRANSFORM_P_TO_G;z.PE_TRANSFORM_G_TO_P=d._pe.PeDefs.prototype.PE_TRANSFORM_G_TO_P;z.PE_HORIZON_RECT=d._pe.PeDefs.prototype.PE_HORIZON_RECT;z.PE_HORIZON_POLY=d._pe.PeDefs.prototype.PE_HORIZON_POLY;z.PE_HORIZON_LINE=d._pe.PeDefs.prototype.PE_HORIZON_LINE;z.PE_HORIZON_DELTA=d._pe.PeDefs.prototype.PE_HORIZON_DELTA}})(g=d.PeDefs||(d.PeDefs={}));(function(z){function u(y,D){var B=null,x=w[y];
x||(x={},w[y]=x);x.hasOwnProperty(String(D))?B=x[D]:(y=d._pe.PeFactory.prototype.factoryByType(y,D),d._pe.compare(y,d._pe.NULL)||(B=y,x[D]=B));return B=E(B)}function E(y){if(y){var D=y.getType();switch(D){case g.PE_TYPE_GEOGCS:y=d._pe.castObject(y,d._pe.PeGeogcs);break;case g.PE_TYPE_PROJCS:y=d._pe.castObject(y,d._pe.PeProjcs);break;case g.PE_TYPE_GEOGTRAN:y=d._pe.castObject(y,d._pe.PeGeogtran);break;default:D&g.PE_TYPE_UNIT&&(y=d._pe.castObject(y,d._pe.PeUnit))}}return y}var w={},F={};z.initialize=
function(){d._pe.PeFactory.prototype.initialize(null)};z.coordsys=function(y){return u(g.PE_TYPE_COORDSYS,y)};z.factoryByType=u;z.fromString=function(y,D){var B=null,x=F[y];x||(x={},F[y]=x);x.hasOwnProperty(D)?B=x[D]:(y=d._pe.PeFactory.prototype.fromString(y,D),d._pe.compare(y,d._pe.NULL)||(B=y,x[D]=B));return B=E(B)};z.geogcs=function(y){return u(g.PE_TYPE_GEOGCS,y)};z.geogtran=function(y){return u(g.PE_TYPE_GEOGTRAN,y)};z.getCode=function(y){return d._pe.PeFactory.prototype.getCode(y)};z.projcs=
function(y){return u(g.PE_TYPE_PROJCS,y)};z.unit=function(y){return u(g.PE_TYPE_UNIT,y)}})(d.PeFactory||(d.PeFactory={}));d.PeGCSExtent=null;var e;(function(z){var u;z.init=function(){z.PE_GTLIST_OPTS_COMMON=d._pe.PeGTlistExtended.prototype.PE_GTLIST_OPTS_COMMON;u=d._pe._pe_getPeGTlistExtendedEntrySize()};z.getGTlist=function(E,w,F,y,D,B){var x=null,r=new d._pe.PeInteger(B);try{var t=d._pe.PeGTlistExtended.prototype.getGTlist(E,w,F,y,D,r);if(B=r.val)if(x=[t],1<B){var C=d._pe.getPointer(t);for(E=1;E<
B;E++)x.push(d._pe.wrapPointer(C+u*E,d._pe.PeGTlistExtendedEntry))}}finally{d._pe.destroy(r)}return x}})(e=d.PeGTlistExtended||(d.PeGTlistExtended={}));(function(z){z.destroy=function(u){if(u&&u.length){for(var E=0;E<u.length;E++){var w=u[E];c(w);w.getEntries().forEach(function(F){c(F);F=F.getGeogtran();c(F);F.getParameters().forEach(c);[F.getGeogcs1(),F.getGeogcs2()].forEach(function(y){c(y);var D=y.getDatum();c(D);c(D.getSpheroid());c(y.getPrimem());c(y.getUnit())})})}d._pe.PeGTlistExtendedEntry.prototype.Delete(u[0])}}})(d.PeGTlistExtendedEntry||
(d.PeGTlistExtendedEntry={}));(function(z){z.geogToGeog=function(u,E,w,F,y){d._pe.ensureCache.prepare();var D=b(w),B=w===D;D=d._pe.ensureFloat64(D);var x=0;F&&(x=d._pe.ensureFloat64(F));(u=d._pe._pe_geog_to_geog(d._pe.getPointer(u),E,D,x,y))&&k(w,E,D,B);return u}})(d.PeGTTransformations||(d.PeGTTransformations={}));(function(z){function u(w,F,y,D,B,x){d._pe.ensureCache.prepare();switch(w){case "dd":var r=d._pe._pe_geog_to_dd;var t=g.PE_DD_MAX;break;case "ddm":r=d._pe._pe_geog_to_ddm;t=g.PE_DDM_MAX;
break;case "dms":r=d._pe._pe_geog_to_dms,t=g.PE_DMS_MAX}w=0;F&&(w=d._pe.getPointer(F));F=b(D);F=d._pe.ensureFloat64(F);t=a(y,t);D=d._pe.ensureInt32(t);if(B=r(w,y,F,B,D))for(r=0;r<y;r++)x[r]=d._pe.UTF8ToString(t[r]);return B}function E(w,F,y,D,B){d._pe.ensureCache.prepare();switch(w){case "dd":var x=d._pe._pe_dd_to_geog;break;case "ddm":x=d._pe._pe_ddm_to_geog;break;case "dms":x=d._pe._pe_dms_to_geog}w=0;F&&(w=d._pe.getPointer(F));F=D.map(function(r){return d._pe.ensureString(r)});D=d._pe.ensureInt32(F);
F=d._pe.ensureFloat64(Array(2*y));(x=x(w,y,D,F))&&k(B,y,F);return x}z.geog_to_dms=function(w,F,y,D,B){return u("dms",w,F,y,D,B)};z.dms_to_geog=function(w,F,y,D){return E("dms",w,F,y,D)};z.geog_to_ddm=function(w,F,y,D,B){return u("ddm",w,F,y,D,B)};z.ddm_to_geog=function(w,F,y,D){return E("ddm",w,F,y,D)};z.geog_to_dd=function(w,F,y,D,B){return u("dd",w,F,y,D,B)};z.dd_to_geog=function(w,F,y,D){return E("dd",w,F,y,D)}})(d.PeNotationDms||(d.PeNotationDms={}));var l;(function(z){z.init=function(){z.PE_MGRS_STYLE_NEW=
d._pe.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW;z.PE_MGRS_STYLE_OLD=d._pe.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD;z.PE_MGRS_STYLE_AUTO=d._pe.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO;z.PE_MGRS_180_ZONE_1_PLUS=d._pe.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS;z.PE_MGRS_ADD_SPACES=d._pe.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES};z.geog_to_mgrs_extended=function(u,E,w,F,y,D,B){d._pe.ensureCache.prepare();var x=0;u&&(x=d._pe.getPointer(u));u=b(w);w=d._pe.ensureFloat64(u);u=a(E,g.PE_MGRS_MAX);
var r=d._pe.ensureInt32(u);if(F=d._pe._pe_geog_to_mgrs_extended(x,E,w,F,y,D,r))for(y=0;y<E;y++)B[y]=d._pe.UTF8ToString(u[y]);return F};z.mgrs_to_geog_extended=function(u,E,w,F,y){d._pe.ensureCache.prepare();var D=0;u&&(D=d._pe.getPointer(u));u=w.map(function(B){return d._pe.ensureString(B)});w=d._pe.ensureInt32(u);u=d._pe.ensureFloat64(Array(2*E));(F=d._pe._pe_mgrs_to_geog_extended(D,E,w,F,u))&&k(y,E,u);return F}})(l=d.PeNotationMgrs||(d.PeNotationMgrs={}));(function(z){z.geog_to_usng=function(u,
E,w,F,y,D,B){d._pe.ensureCache.prepare();var x=0;u&&(x=d._pe.getPointer(u));u=b(w);w=d._pe.ensureFloat64(u);u=a(E,g.PE_MGRS_MAX);var r=d._pe.ensureInt32(u);if(F=d._pe._pe_geog_to_usng(x,E,w,F,y,D,r))for(y=0;y<E;y++)B[y]=d._pe.UTF8ToString(u[y]);return F};z.usng_to_geog=function(u,E,w,F){d._pe.ensureCache.prepare();var y=0;u&&(y=d._pe.getPointer(u));u=w.map(function(D){return d._pe.ensureString(D)});w=d._pe.ensureInt32(u);u=d._pe.ensureFloat64(Array(2*E));(y=d._pe._pe_usng_to_geog(y,E,w,u))&&k(F,E,
u);return y}})(d.PeNotationUsng||(d.PeNotationUsng={}));var p;(function(z){z.init=function(){z.PE_UTM_OPTS_NONE=d._pe.PeNotationUtm.prototype.PE_UTM_OPTS_NONE;z.PE_UTM_OPTS_ADD_SPACES=d._pe.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES;z.PE_UTM_OPTS_NS=d._pe.PeNotationUtm.prototype.PE_UTM_OPTS_NS};z.geog_to_utm=function(u,E,w,F,y){d._pe.ensureCache.prepare();var D=0;u&&(D=d._pe.getPointer(u));u=b(w);w=d._pe.ensureFloat64(u);u=a(E,g.PE_UTM_MAX);var B=d._pe.ensureInt32(u);if(F=d._pe._pe_geog_to_utm(D,
E,w,F,B))for(D=0;D<E;D++)y[D]=d._pe.UTF8ToString(u[D]);return F};z.utm_to_geog=function(u,E,w,F,y){d._pe.ensureCache.prepare();var D=0;u&&(D=d._pe.getPointer(u));u=w.map(function(B){return d._pe.ensureString(B)});w=d._pe.ensureInt32(u);u=d._pe.ensureFloat64(Array(2*E));(F=d._pe._pe_utm_to_geog(D,E,w,F,u))&&k(y,E,u);return F}})(p=d.PeNotationUtm||(d.PeNotationUtm={}));var v;(function(z){var u=new Map;z.init=function(){z.PE_PCSINFO_OPTION_NONE=d._pe.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE;z.PE_PCSINFO_OPTION_DOMAIN=
d._pe.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN;z.PE_POLE_OUTSIDE_BOUNDARY=d._pe.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY;z.PE_POLE_POINT=d._pe.PePCSInfo.prototype.PE_POLE_POINT};z.generate=function(E,w){void 0===w&&(w=z.PE_PCSINFO_OPTION_DOMAIN);var F;if(u.has(E)){var y=u.get(E);y[w]&&(F=y[w])}F||(F=d._pe.PePCSInfo.prototype.generate(E,w),y||(y=[],u.set(E,y)),y[w]=F);return F}})(v=d.PePCSInfo||(d.PePCSInfo={}));(function(z){z.version_string=function(){return d._pe.PeVersion.prototype.version_string()}})(d.PeVersion||
(d.PeVersion={}));d._init=f})},"esri/core/tsSupport/extendsHelper":function(){define([],function(){return function(){var H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,m){d.__proto__=m}||function(d,m){for(var n in m)m.hasOwnProperty(n)&&(d[n]=m[n])};return function(d,m){function n(){this.constructor=d}H(d,m);d.prototype=null===m?Object.create(m):(n.prototype=m.prototype,new n)}}()})},"esri/geometry/GeographicTransformation":function(){define(["require","exports","./GeographicTransformationStep"],
function(H,d,m){return function(){function n(q){this.steps=[];this._cached_projection={};this._chain="";this._gtlistentry=null;if(q&&q.steps){var f=0;for(q=q.steps;f<q.length;f++){var c=q[f];c instanceof m?this.steps.push(c):this.steps.push(new m({wkid:c.wkid,wkt:c.wkt,isInverse:c.isInverse}))}}}n.cacheKey=function(q,f){return[void 0!==q.wkid&&null!==q.wkid?q.wkid.toString():"-1",void 0!==q.wkt&&null!==q.wkt?q.wkt.toString():"",void 0!==f.wkid&&null!==f.wkid?f.wkid.toString():"-1",void 0!==f.wkt&&
null!==f.wkt?f.wkt.toString():""].join()};n.fromGE=function(q){var f=new n,c="",a=0;for(q=q.steps;a<q.length;a++){var b=m.fromGE(q[a]);f.steps.push(b);c+=b.uid.toString()+","}f._cached_projection={};f._gtlistentry=null;f._chain=c;return f};n.prototype.getInverse=function(){var q=new n;q.steps=[];for(var f=this.steps.length-1;0<=f;f--)q.steps.push(this.steps[f].getInverse());return q};n.prototype.getGTListEntry=function(){for(var q="",f=0,c=this.steps;f<c.length;f++)q+=c[f].uid.toString()+",";q!==
this._chain&&(this._gtlistentry=null,this._cached_projection={},this._chain=q);return this._gtlistentry};n.prototype.assignCachedGe=function(q,f,c){this._cached_projection[n.cacheKey(q,f)]=c};n.prototype.getCachedGeTransformation=function(q,f){for(var c="",a=0,b=this.steps;a<b.length;a++)c+=b[a].uid.toString()+",";c!==this._chain&&(this._gtlistentry=null,this._cached_projection={},this._chain=c);q=this._cached_projection[n.cacheKey(q,f)];return void 0===q?null:q};return n}()})},"esri/geometry/GeographicTransformationStep":function(){define(["require",
"exports"],function(H,d){var m=0;return function(){function n(q){void 0===q&&(q=null);this.uid=m++;q?(this._wkt=void 0!==q.wkt?q.wkt:null,this._wkid=void 0!==q.wkid?q.wkid:-1,this._isInverse=void 0!==q.isInverse?!0===q.isInverse:!1):(this._wkt=null,this._wkid=-1,this._isInverse=!1)}n.fromGE=function(q){var f=new n;f._wkt=q.wkt;f._wkid=q.wkid;f._isInverse=q.isInverse;return f};Object.defineProperty(n.prototype,"wkt",{get:function(){return this._wkt},set:function(q){this._wkt=q;this.uid=m++},enumerable:!0,
configurable:!0});Object.defineProperty(n.prototype,"wkid",{get:function(){return this._wkid},set:function(q){this._wkid=q;this.uid=m++},enumerable:!0,configurable:!0});Object.defineProperty(n.prototype,"isInverse",{get:function(){return this._isInverse},set:function(q){this._isInverse=q;this.uid=m++},enumerable:!0,configurable:!0});n.prototype.getInverse=function(){var q=new n;q._wkt=this.wkt;q._wkid=this._wkid;q._isInverse=!this.isInverse;return q};return n}()})},"esri/layers/rasterLib/raster/TileServiceRaster":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/_base/array dojo/_base/config dojo/_base/json dojo/sniff dojo/DeferredList dojo/when ../../../kernel ../../../Evented ../../../request ../../../geometry/Extent ../../../geometry/Point ../../../SpatialReference ../../../deferredUtils ../../../urlUtils ../../PixelBlock ../../rasterFormats/rasterCodec ../tile/RasterTileInfo ./RasterInfo ./BasicRaster".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F,y,D){H=d([D],{declaredClass:"esri.layers.rasterLib.raster.TileServiceRaster",constructor:function(B){},open:function(){var B=new n,x=this.serviceInfo||this._getServiceInfo(null),r=m.hitch(this,function(C){this.serviceInfo=C;this.version=C.currentVersion;this.rasterInfo=this._parseRasterInfo(C);this.loaded=!0;this._getRasterIdentifier();B.resolve(this)}),t=m.hitch(this,function(C){this.loaded=!0;this._getRasterIdentifier();B.reject(C)});k(x,r,t);return B.promise},
read:function(B){var x=this.url+"/tile/"+B.level+"/"+B.row+"/"+B.col,r={width:this.tileInfo.cols,height:this.tileInfo.rows,planes:null,pixelType:null,format:null,decodeFunc:null,isPoint:"elevation"===this.tileType.toLowerCase()?!0:!1};return this._requestPixels({url:x+(this.disableClientCaching?"?_ts\x3d "+(new Date).getTime():""),payload:{},decodeParams:r,tileOptions:B})},identify:function(B,x){null==x&&(x=this.tileInfo.lods[this.tileInfo.lods.length-1].level);var r=(B.x-this.tileInfo.origin.x)/
this.tileInfo.lods[x].resolution/this.tileInfo.cols;B=(this.tileInfo.origin.y-B.y)/this.tileInfo.lods[x].resolution/this.tileInfo.rows;var t=Math.floor(r),C=Math.floor(B),J=Math.floor((r-t)*this.tileInfo.cols);J=Math.min(J,this.tileInfo.cols-1);var L=Math.floor((B-C)*this.tileInfo.rows);L=Math.min(L,this.tileInfo.rows-1);var P=new n;this.read({level:x,row:C,col:t}).then(function(U){var aa=L*U.width+J;U&&U.pixels&&0<U.pixels.length?(U=U.mask?U.mask[aa]?U.pixels.map(function(ea){return ea[aa]}):null:
U.pixels.map(function(ea){return ea[aa]}),P.resolve(U)):P.reject("no valid data")},function(U){P.reject(U)});return P.promise},setFetchParameters:function(B,x){},_getRasterIdentifier:function(){this._rasterId||(this._rasterId=this.url.replace("http:","").replace("https:",""));return this._rasterId},_getServiceInfo:function(){var B=this.url,x=new n(z._dfdCanceller);x._pendingDfd=e({url:B,content:{f:"json"},handleAs:"json",callbackParamName:"callback"});x._pendingDfd.then(function(r){x.callback(r)},
function(r){x.errback(r)});return x},_parseRasterInfo:function(B){var x=new y;x.extent=new l(B.fullExtent);x.spatialReference=new v(B.spatialReference);this.tileType=B.cacheType||"Map";switch(this.tileType){case "Map":x.bandCount=3;x.pixelType="U8";this.dataType="Processed";break;case "Elevation":x.bandCount=1;x.pixelType=B.pixelType||"F32";this.dataType="Elevation";break;case "Raster":x.bandCount=null,x.pixelType=null,this.dataType=B.serviceDataType&&B.serviceDataType.replace("esriImageServiceDataType",
"")||"Generic"}var r=B.tileInfo;x.width=Math.floor((B.fullExtent.xmax-B.fullExtent.xmin)/r.lods[r.lods.length-1].resolution+.5);x.height=Math.floor((B.fullExtent.ymax-B.fullExtent.ymin)/r.lods[r.lods.length-1].resolution+.5);x.cellSize=new p({x:r.lods[r.lods.length-1].resolution,y:r.lods[r.lods.length-1].resolution,spatialReference:B.spatialReference});this.tileInfo=new F(r);this.tileInfo.tileType=this.tileType;return x}});a("extend-esri")&&m.setObject("layers.rasterLib.raster.TileServiceRaster",
H,h);return H})},"esri/layers/rasterLib/raster/TileRaster":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/_base/array dojo/_base/config dojo/_base/json dojo/sniff dojo/DeferredList dojo/when ../../../kernel ../../../Evented ../../../request ../../../geometry/Extent ../../../geometry/Point ../../../SpatialReference ../../../deferredUtils ../../../urlUtils ../../PixelBlock ../../rasterFormats/rasterCodec ../tile/RasterTileInfo ./RasterInfo ./BasicRaster".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F,y,D){H=d([D],{declaredClass:"esri.layers.rasterLib.raster.TileRaster",sourceType:"TileCache",_RECORD_SIZE:8,constructor:function(B){this._cloudBlobStorage=B&&B._cloudBlobStorage},open:function(){var B=new n,x=this.datasetInfo||this._getDatasetInfo(null),r=m.hitch(this,function(C){this.datasetInfo=C;this.rasterInfo=C=this._parseRasterInfo(C);this.tileType="Cache/LERC"===C.format?"Elevation":"Cache/MIXED"===C.format||"Cache/JPEG"===C.format||"Cache/PNG"===
C.format?"Map":"Raster";this.tileInfo=C.tileInfo;this.dataType=["Generic","Elevation","Processed"][["Raster","Elevation","Map"].indexOf(this.tileType)];this._HEADER_SIZE=C.packetSize*C.packetSize*this._RECORD_SIZE+64;this.loaded=!0;this._cloudBlobStorage=this._cloudBlobStorage||-1<this.url.toLowerCase().indexOf("s3.amazonaws.com")||-1<this.url.toLowerCase().indexOf("windows.net")||-1<this.url.toLowerCase().indexOf("googleapis.com");this._getRasterIdentifier();B.resolve(this)}),t=m.hitch(this,function(C){this.loaded=
!0;this._getRasterIdentifier();B.reject(C)});k(x,r,t);return B.promise},read:function(B){var x=new n,r=B.level,t=B.row,C=B.col,J=this._buildCacheFilePath(this.url,r,t,C),L=this._getIndexRecordFromBundle(r,t,C);e({url:J,content:{},headers:{Range:"bytes\x3d0-"+(this._HEADER_SIZE-1).toString()},handleAs:"arraybuffer"}).then(m.hitch(this,function(P,U){if(!x.isCanceled()){console.log("time in ms request "+(new Date-aa));var aa=new Date;P=new Uint8Array(P);P=this._getTileEndAndContentType(P,L);U={width:this.tileInfo.cols,
height:this.tileInfo.rows,planes:null,pixelType:null,format:null,decodeFunc:null,isPoint:"elevation"===this.tileType.toLowerCase()?!0:!1};this._requestPixels({url:J+(this.disableClientCaching?"?_ts\x3d "+(new Date).getTime():""),payload:{},headers:{Range:"bytes\x3d"+P.position.toString()+"-"+(P.position+P.recordSize).toString()},decodeParams:U,tileOptions:B}).then(function(ea){x.isCanceled()||x.resolve(ea)},function(ea){x.isCanceled()||x.reject(ea)})}}));return x.promise},identify:function(){return null},
setFetchParameters:function(B,x){},toJson:function(){return{url:this.url,tileInfo:this.tileInfo.toJson(),rasterInfo:this.rasterInfo.toJson(),datasetInfo:this.datasetInfo,sourceType:this.sourceType,tileType:this.tileType,_rasterId:this._rasterId}},_getDatasetInfo:function(){return e({url:this.url+"/conf.json",handleAs:"json",content:{}})},_parseRasterInfo:function(B){var x=new y;switch(B.pixelType){case 1:var r="U1";break;case 1:r="U2";break;case 2:r="U4";break;case 3:r="U8";break;case 4:r="S8";break;
case 5:r="U16";break;case 6:r="S16";break;case 7:r="U32";break;case 8:r="S32";break;case 9:r="F32";break;default:r="F32"}var t,C=[],J=B.LODInfos;for(t=0;t<J.levels.length;t++)C.push({level:J.levels[t],resolution:J.resolutions[t],scale:96/.0254*J.resolutions[t]});t=new v(B.extent.spatialReference||B.geodataXform.spatialReference);C=new F({rows:B.blockHeight,cols:B.blockWidth,dpi:96,format:B.format,compressionQuality:0,origin:B.origin,spatialReference:t,lods:C});x.pixelType=r;x.bandCount=B.bandCount;
x.spatialReference=t;x.extent=new l({xmin:B.extent.xmin,ymin:B.extent.ymin,xmax:B.extent.xmax,ymax:B.extent.ymax,spatialReference:t});x.cellSize=new p({x:B.pixelSizeX,y:B.pixelSizeY,spatialReference:t});x.width=Math.floor((x.extent.xmax-x.extent.xmin)/x.cellSize.x+.5);x.height=Math.floor((x.extent.ymax-x.extent.ymin)/x.cellSize.y+.5);x.statistics=B.statistics.map(function(L){Object.keys(L).forEach(function(P){isNaN(L[P])&&(L[P]=null)});return L});x.histograms=B.histograms;x.geodataXform=B.geodataXform;
x.packetSize=B.packetSize;x.format=B.format;x.compressionQuality=B.compressionQuality;x.tileInfo=C;return x},_getRasterIdentifier:function(){this._rasterId||(this._rasterId=this.url.replace("http:","").replace("https:",""));return this._rasterId},_buildCacheFilePath:function(B,x,r,t){var C=this.rasterInfo.packetSize;t=Math.floor(t/C)*C;r="R"+this._toHexString4(Math.floor(r/C)*C)+"C"+this._toHexString4(t);C="L";C=10<=x?C+x.toString():C+("0"+x.toString());return this._cloudBlobStorage?B+"/_alllayers/"+
C+"/"+r+".bundle":B+"/"+C+"_"+r+"/bundle"},_getIndexRecordFromBundle:function(B,x,r){B=this.rasterInfo.packetSize;x=x%B*B+r%B;if(0>x)throw"Invalid level / row / col";return x*this._RECORD_SIZE+64},_getTileEndAndContentType:function(B,x){B=B.subarray(x,x+8);x=0;var r;for(r=0;5>r;r++)x|=(B[r]&255)<<8*r;var t=x&0xffffffffff;x=0;for(r=5;8>r;r++)x|=(B[r]&255)<<8*(r-5);return{position:t,recordSize:x&0xffffffffff}},_toHexString4:function(B){B=B.toString(16);if(4!=B.length)for(var x=4-B.length;0<x--;)B="0"+
B;return B}});a("extend-esri")&&m.setObject("layers.rasterLib.raster.TileRaster",H,h);return H})},"esri/layers/rasterLib/raster/FunctionRaster":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/_base/array dojo/_base/config dojo/_base/json dojo/sniff ../DeferredList2 dojo/when ../../../kernel ../../../Evented ../../../request ../../../deferredUtils ../../../geometry/Extent ../../../geometry/Point ../../../SpatialReference ../../../deferredUtils ../../../urlUtils ../../rasterFormats/rasterCodec ./RasterInfo ./BasicRaster ../../rasterLib/function/rasterFunctionHelper".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F,y,D){H=d([y],{declaredClass:"esri.layers.rasterLib.raster.FunctionRaster",rasterFunction:null,sourceType:"Function",constructor:function(B){B&&B.rasterFx&&this._init(B.rasterFx,B.rasterFxArgs)},open:function(){var B=this.getMemberRasters().map(function(r){return r.open()});this.identifiers=this.getMemberRasters().map(function(r){return r._rasterId});var x=new n;(new b(B,null,null,!0)).then(function(r){r.some(function(t){return!t[0]})?x.reject(r):
(this.rasterFunction.bind(),this.rasterInfo=this.rasterFunction.rasterInfo,this.dataType=this.rasterInfo.keyProperties&&this.rasterInfo.keyProperties.DataType||"Generic",this.tileInfo=r[0][1].tileInfo,x.resolve(this))}.bind(this));return x.promise},getProjectedFullExtent:function(B){var x=new n;this.getMemberRasters()[0].getProjectedFullExtent(B).then(m.hitch(this,function(r){this.projectedFullExtent=r;x.resolve(r)}));return x.promise},setProcessingContext:function(B){var x=B;B.layer&&(B=B.layer,
x={id:B.id,rawRasterInfo:B.raster.rasterInfo,glSetting:B._glSetting,xformSetting:B.tileManager&&B.tileManager.xformSetting,useWebGL:B.useWebGL,resampling:B.tileMode&&B.tileManager&&B.tileManager.xformSetting.requireProjection&&!B._hasTilingEffects&&"Thematic"!==B.raster.dataType?1:0,tileMode:B.tileMode});this.rasterFunction.setProcessingContext(x);this._layerOptions=x},alterDefinition:function(B){if(B=B||this.rasterFunction)1===this.memberRasters.length&&!B._bindComplete&&(this.rasterFunction=D.create(B,
{raster:this.memberRasters[0]}))&&(this.rasterFunction.bind(),this.rasterInfo=this.rasterFunction.rasterInfo,this.dataType=this.rasterInfo.keyProperties&&this.rasterInfo.keyProperties.DataType||"Generic",this.rasterFunction.setProcessingContext(this._layerOptions)),this._rasterHandler&&this._rasterHandler._connected&&this.rasterFunction&&this._rasterHandler.setRasterFunction({layerId:this._layerOptions.id,data:this.rasterFunction.toJson(!0)})},setFetchParameters:function(B,x){var r=this.getMemberRasters();
r&&1===r.length&&r[0].setFetchParameters(B,x)},getMemberRasters:function(){this.memberRasters||(this.memberRasters=[],this._getMemberRasters(this.rasterFunction.functionArguments,this.memberRasters));return this.memberRasters},read:function(B){var x=new n(l._dfdCanceller);if(B.src){var r=this.rasterFunction.read(B);x.resolve(r);return x.promise}var t=this.getMemberRasters().map(function(P){return P.read(B)});t=new b(t);var C,J,L=this.identifiers;x._pendingDfd=t;t.then(m.hitch(this,function(P){if(C=
P.some(function(U){return U[0]}))J={},P.forEach(function(U,aa){J[L[aa]]=U[0]?U[1]:null});r=J?this.rasterFunction.read({extent:B.extent,src:J}):null;r.srcData=J;x.resolve(r)}));return x},_init:function(B,x){if(this.rasterFunction=D.create(B,x))this.rasterFunction._bindComplete=!0;else throw"Cannot initialize a function raster without a raster function";},_getMemberRasters:function(B,x){var r=Object.keys(B),t,C,J;for(t=0;t<r.length;t++)if(J=B[r[t]]){var L=J instanceof Array?J:[J];for(C=0;C<L.length;C++)(J=
L[C])&&("function"===typeof J||"object"===typeof J)&&J.read&&(J.functionArguments?this._getMemberRasters(J.functionArguments,x):J.sourceType&&"Function"!==J.sourceType&&(J._identifier=J._getRasterIdentifier(),x.some(function(P){return P._identifier===J._identifier})||x.push(J)))}return x}});a("extend-esri")&&m.setObject("layers.rasterLib.raster.FunctionRaster",H,h);return H})},"esri/layers/rasterLib/DeferredList2":function(){define(["dojo/DeferredList"],function(H){return function(d,m,n,q,f){this.list=
d;m=new H(d,m,n,q,f);var c=m.resolve.bind(m),a=m.cancel.bind(m);m.cancel=function(){d&&d.forEach(function(b){b.cancel&&b.cancel()});a.apply(this,arguments)}.bind(m);m.resolve=function(){this.isFulfilled()||c.apply(this,arguments)}.bind(m);return m}})},"esri/layers/rasterLib/tile/RasterTileManager":function(){define("dojo/_base/declare dojo/_base/lang dojo/Deferred dojo/when ../DeferredList2 ../../../geometry/Extent ../../../SpatialReference ../../../geometry/Point ../../PixelBlock ./RasterTileInfo ../raster/rasterProjectionHelper".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h){var g=function(e,l){var p;for(p=0;p<e.length;p++)if(l(e[p]))return p;return-1};return H(null,{declaredClass:"esri.layers.rasterLib.tile.RasterTileManager",count:null,fullBoundary:null,tileBoundary:null,tiles:null,resolution:null,virtual:!0,prefetchBufferSize:0,_progressiveGlobal:!1,_MAX_TILES:128,_defaultMatrixResolution:20,constructor:function(e){this.tiles=[];this.xformSetting={};this.mapSpatialReference=e&&e.mapSR;this.layer=e&&e.layer;this.identifiers=this.layer.raster.rasterFunction?
this.layer.raster.getMemberRasters().map(function(l){return l._rasterId}):[this.layer.raster._rasterId];(e=e&&e.tileInfo)&&this.setTileInfo(e)},setTileInfo:function(e){this.tileInfo=e;this.virtual=e.virtual;this.mapResolution=null;this.tiles.length=0;this.xformSetting.requireProjection=!this.virtual&&!this.mapSpatialReference.equals(this.tileInfo.spatialReference);this.xformSetting.requirePE=h.requirePE(this.mapSpatialReference,this.tileInfo.spatialReference);this.xformSetting.meshSize=this.xformSetting.requireProjection?
[this._defaultMatrixResolution,this._defaultMatrixResolution]:[1,1];this.halfWorldWidth=h.getHalfWorldWidth(e.spatialReference)},updateResolution:function(e,l){if(!(this.mapResolution&&e&&this._resolutionEqual(this.mapResolution.x,e.x)&&this._resolutionEqual(this.mapResolution.y,e.y))){this.resetTiles();var p=this.xformSetting.requireProjection;this.mapResolution=this.resolution=e;p&&(this.resolution=h.projectResolution(e,this.tileInfo.spatialReference,this.layer.projectedFullExtent||l));this._resolution=
this.resolution;e=this.resolution;if(!this.tileInfo.virtual){p=.75*Math.min(e.x,e.y)+.25*Math.max(e.x,e.y);if(p>=this.tileInfo.lods[0].resolution){var v=this.tileInfo.lods[0];this.ooe=!0}else{if(p<=this.tileInfo.lods[this.tileInfo.lods.length-1].resolution)v=this.tileInfo.lods[this.tileInfo.lods.length-1];else for(e=0;e<this.tileInfo.lods.length-1;e++)if(v=this.tileInfo.lods[e],l=this.tileInfo.lods[e+1],v.resolution>=p&&l.resolution<=p){v.resolution-p>p-l.resolution&&(v=l);break}this.ooe=!1}this.level=
v&&v.level;e=this.resolution=new a({x:v.resolution,y:v.resolution,spatialReference:this.tileInfo.spatialReference})}p=this.layer.raster.rasterInfo.extent;v=this.tileInfo.origin;l=this.tileInfo.cols;var z=this.tileInfo.rows;this.fullBoundary={rowStart:Math.floor((v.y-p.ymax)/e.y/z),rowEnd:Math.floor((v.y-p.ymin-e.y)/e.y/z),colStart:Math.floor((p.xmin-v.x)/e.x/l),colEnd:Math.floor((p.xmax-v.x-e.x)/e.x/l)};if(p=this.halfWorldWidth){z=Math.ceil(p/e.x/(l/2));var u=this.tileInfo.applyGCS360Transform?360:
p,E=Math.round(l-(u-v.x)/e.x%l);E===l&&(E=0);this.fullBoundary.colRange=z;this.fullBoundary.paddingRight=E;this.fullBoundary.paddingLeft=Math.round((z*l*e.x+v.x-u-(this.tileInfo.applyGCS360Transform?0:v.x+p))/e.x)}this.hasNewData=!0}},getXformGrid:function(){var e=this.mapExtent,l=this.layer._hasTilingEffects?this.extent:this.fullExtent,p=this.layer.getCurrentResolution(),v=JSON.stringify(e.toJson())+JSON.stringify(l.toJson());this._datumTransformationInitialized||(this._datumTransformationInitialized=
!0,this._datumTransformation=h.getDefaultDatumTransformationForDataset(this.layer.raster.rasterInfo.extent,e.spatialReference,!0));this._cachedExtentString&&this._cachedExtentString===v||(this._cachedExtentString=v,this._xformGrid=e=h.getProjectionOffsetGrid(e,l,p,this.tileInfo.applyGCS360Transform,this.halfWorldWidth,this._datumTransformation));e=this._xformGrid;this.xformSetting.meshSize=e&&e.size;return e},getWrapTimes:function(e){var l=h.getHalfWorldWidth(e.spatialReference);if(!l)return 0;var p=
2*l;l=this.tileInfo.applyGCS360Transform?0:-l;return Math.floor((e.xmax-l)/p)-Math.floor((e.xmin-l)/p)},normalizeCoordinate:function(e,l){if(!l)return 0;var p=2*l;if(0<e){for(;e>l;)e-=p;return e}for(;e<-l;)e+=p;return e},resetTiles:function(){this.tiles.forEach(d.hitch(this,function(e){e.fetch&&!e.fetch.isCanceled()&&e.fetch.cancel();e.update&&!e.update.isCanceled()&&e.update.cancel()}));this.tiles.length=0},updateExtent:function(e,l){this.mapExtent=this.extent=e;var p=this.xformSetting.requireProjection;
if(p){this.extent=h.project(e,this.tileInfo.spatialReference,this.tileInfo.applyGCS360Transform);if(!this.extent)return;this.extent.spatialReference=new c(this.extent.spatialReference.toJson())}this.updateResolution(l,e);var v=this.extent,z=this.tileInfo,u=z.cols,E=z.rows;l=this.resolution;var w=v;p=p?this.layer.raster.rasterInfo.extent:this.layer.raster.projectedFullExtent;this.ooe&&(w=this._getIntersect(v,p));var F=Math.floor((w.xmin-z.origin.x)/l.x/u)-this.prefetchBufferSize,y=Math.floor((w.xmax-
z.origin.x)/l.x/u)+this.prefetchBufferSize,D=null;e=this.getWrapTimes(e);var B=this.fullBoundary&&this.fullBoundary.colRange;e&&this.halfWorldWidth&&(y===F&&(D=F),y+=e*B);var x=this.halfWorldWidth&&this.tiles.length&&(e!==this.wrapTimes||D!==this._circlularColId);x&&(this._wrapSwitchCount=this._wrapSwitchCount?this._wrapSwitchCount+1:1);this.wrapTimes=e;this._circlularColId=D;var r=Math.floor((z.origin.y-w.ymax)/l.y/E)-this.prefetchBufferSize;D=Math.floor((z.origin.y-w.ymin)/l.y/E)+this.prefetchBufferSize;
this.tileBoundary={rowStart:r,rowEnd:D,colStart:F,colEnd:y};var t,C;((w=(D-r+1)*(y-F+1)>this._MAX_TILES||!this.virtual&&this._resolution.x>8*this.tileInfo.lods[0].resolution)||2<e||x)&&this.resetTiles();if(!(w||2<e)){x=this.tiles;w=!1;for(t=x.length-1;0<=t;t--){var J=x[t].row;var L=x[t].wrapCol;if(J<r||J>D||L<F||L>y)x[t].fetch&&!x[t].fetch.isCanceled()&&x[t].fetch.cancel(),x[t].update&&!x[t].update.isCanceled()&&x[t].update.cancel(),x.splice(t,1),w=!0}for(t=r;t<=D;t++)for(C=F;C<=y;C++){r=new f(z.origin.x+
l.x*u*C,z.origin.y-l.y*E*(t+1),z.origin.x+l.x*u*(C+1),z.origin.y-l.y*E*t,v.spatialReference);var P=e&&B?0<=C?C%B:B- -C%B:C;J=g(x,function(U){return U.row===t&&U.col===P&&U.wrapCol===C});L=p.xmax>=r.xmax?u:Math.round((p.xmax-r.xmin)/l.x);-1===J&&(x.push({row:t,col:P,wrapCol:C,cellsizeX:l.x,cellsizeY:l.y,width:u,height:E,actualWidth:L,extent:r,normalizedExtent:this._wrapExtent(r,P),pixelBlock:null,virtual:this.virtual,level:this.level,tileType:this.tileInfo.tileType||"Raster"}),w=!0)}w&&this._sortTiles();
l=this.tileInfo.rows*(this.tileBoundary.rowEnd-this.tileBoundary.rowStart+1);this.width=this.tileInfo.cols*(this.tileBoundary.colEnd-this.tileBoundary.colStart+1);this.height=l;this.count=x.length;l=Math.min.apply(null,x.map(function(U){return U.extent.xmin}));z=Math.max.apply(null,x.map(function(U){return U.extent.xmax}));u=Math.min.apply(null,x.map(function(U){return U.extent.ymin}));E=Math.max.apply(null,x.map(function(U){return U.extent.ymax}));l=this.fullExtent=new f(l,u,z,E,v.spatialReference);
if(this.layer.roaming||this.layer.useWebGL)this.layer._hasTilingEffects?(this.xformSetting.offset=[0,0],this.xformSetting.scale=[1,1]):(w&&(this._tilesChanged=!0),this.xformSetting.offset=[(v.xmin-l.xmin)/(l.xmax-l.xmin),-(l.ymin-v.ymin)/(l.ymax-l.ymin)],this.xformSetting.scale=[(v.xmax-v.xmin)/(l.xmax-l.xmin),(v.ymax-v.ymin)/(l.ymax-l.ymin)])}},fetchTiles:function(e){(this._tilesChanged||e)&&this._fetchTiles(e)},_fetchTiles:function(e){this._fetchCounter=0;var l=this.extent;this.fetchAllCompleted=
e?new m:null;(this._tilesChanged||e&&this.layer._hasTilingEffects)&&this.tiles.forEach(d.hitch(this,function(v){v.updateCompleted=!1}));var p={};!this.layer.roaming&&this.layer._hasTilingEffects&&e?(this.identifiers.forEach(function(v,z){p[v]={extent:this.extent,pixelBlock:new b({width:this.layer._map.width,height:this.layer._map.height,pixels:[],pixelType:"",mask:null,statistics:[]})}}.bind(this)),this.originalPixelData={extent:this.extent,src:p,isEmpty:!0}):this._tilesChanged&&(this.identifiers.forEach(function(v,
z){p[v]={extent:this.fullExtent,pixelBlock:new b({width:128,height:128,pixels:[],pixelType:"",mask:null,statistics:[]})}}.bind(this)),this.originalPixelData={extent:this.fullExtent,src:p,isEmpty:!0});this.tiles.forEach(d.hitch(this,function(v){if(v.fetch)v.update||(v.update=this.updateTile(v));else{if(this._isTileOutSide(v,l)){v.updateCompleted=!0;return}this._requestTile(v)}this.layer.roaming&&this.layer.useWebGL?this._fillPixelData(v):v.src&&e&&(this.layer._hasTilingEffects||this.layer.useWebGL)&&
(this._fillPixelData(v),this.layer._hasTilingEffects&&(v.updateCompleted=!0),v.processedPixelBlock=null,v.renderedPixelBlock=null)}));0===this._fetchCounter&&(this._fetched=!0);this._tilesChanged=!1;e&&this._updateFetchStatus()},updateTile:function(e,l){var p=new m;if(!e.src&&!e.fetch)return p.resolve(e),p.promise;n(e.src||e._fetched||e.fetch,d.hitch(this,function(){var v=this.layer.tileMode&&this.layer._rasterHandler&&!(this.layer._hasTilingEffects||this.layer.useWebGL),z=this.layer._drawTile,u=
this._validateRawPixelBlocks(e);this.layer._hasTilingEffects&&!this.layer.useWebGL&&(z=z&&(this._progressiveGlobal||l));if((l||!l&&u)&&(v||z||this.layer.roaming)){if(this.xformSetting.requireProjection&&this.layer.useWebGL&&(this.xformSetting.gridConfig=this.getXformGrid(),null==this.xformSetting.gridConfig))return p.cancel(),p.promise;this._processTile(e,l).then(d.hitch(this,function(E){p.isCanceled()||this._renderTile(E,l).then(d.hitch(this,function(w){this.hasNewData=!1;p.isCanceled()||p.resolve(w)}))}))}else l||
u||(e.updateCompleted=!0),this.layer.useWebGL||this.layer._hasTilingEffects?p.resolve(this.originalPixelData):p.resolve()}));return p.promise},setLayer:function(e){this.layer=e},fillupTiles:function(){this.tiles.forEach(d.hitch(this,function(e){e.update&&e.updateCompleted&&!e.filled&&(e.updateCompleted=!1,this._fillPixelData(e),e.updateCompleted=!0)}))},_validateRawPixelBlocks:function(e){return e&&e.src&&!this.identifiers.some(function(l){return!(e.src[l].pixelBlock&&0!==e.src[l].pixelBlock.validPixelCount&&
e.src[l].pixelBlock.pixels&&0<e.src[l].pixelBlock.pixels.length)})},_wrapExtent:function(e,l){if(e){if(this.tileInfo.applyGCS360Transform){var p=this.normalizeCoordinate(e.xmin,180);0>p&&(p+=360);return new f({xmin:p,ymin:e.ymin,xmax:e.xmax-e.xmin+p,ymax:e.ymax,spatialReference:e.spatialReference})}if(this.halfWorldWidth){p=null!=l?new f({xmin:this.tileInfo.origin.x+this.tileInfo.cols*l*this.resolution.x,ymin:e.ymin,xmax:this.tileInfo.origin.x+this.tileInfo.cols*(l+1)*this.resolution.x,ymax:e.ymax,
spatialReference:e.spatialReference}):new f({xmin:e.xmin,ymin:e.ymin,xmax:e.xmax,ymax:e.ymax,spatialReference:e.spatialReference});l=this.normalizeCoordinate(p.xmin,this.halfWorldWidth);var v=l-p.xmin;.01<Math.abs(v)&&(p.xmin=l,p.xmax+=v)}return p||e}},_getIntersect:function(e,l){return new f(Math.max(e.xmin,l.xmin),Math.max(e.ymin,l.ymin),Math.min(e.xmax,l.xmax),Math.min(e.ymax,l.ymax),e.spatialReference)},_isTileOutSide:function(e,l){var p=!1;if(e.virtual){var v=e.normalizedExtent;if(l=l||(this.xformSetting.requireProjection?
this.layer.raster.rasterInfo.extent:this.layer.raster.projectedFullExtent)){e=v.xmin-this.prefetchBufferSize*this.tileInfo.cols*this.resolution.x;p=v.ymin-this.prefetchBufferSize*this.tileInfo.rows*this.resolution.y;var z=v.xmax+this.prefetchBufferSize*this.tileInfo.cols*this.resolution.x;v=v.ymax+this.prefetchBufferSize*this.tileInfo.rows*this.resolution.y;p=z<=l.xmin||e>=l.xmax||v<=l.ymin||p>=l.ymax}else p=!1}else p=0>e.level||e.row<this.fullBoundary.rowStart||e.row>this.fullBoundary.rowEnd||e.col<
this.fullBoundary.colStart||e.col>this.fullBoundary.colEnd;return p},_resolutionEqual:function(e,l){return e===l||e&&l&&Math.abs(e-l)<Math.abs(l/1E4)?!0:!1},_requestTile:function(e){var l=this.identifiers,p;if(this._isTileOutSide(e)){var v=new m;e.updateCompleted=!0;v.resolve(null);v=v.promise}else v=this.layer.raster.rasterFunction?new q(this.layer.raster.getMemberRasters().map(function(z){return z.read(e)})):new q([this.layer.raster.read(e)]);e.fetch=v;this._fetchCounter++;n(e.src||e._fetched||
v,d.hitch(this,function(z){if(p=z&&z.some(function(E){return E[0]})){var u={};z.forEach(function(E,w){u[l[w]]=E[0]&&E[1]?{extent:E[1].extent,pixelBlock:E[1].pixelBlock,width:E[1].width,height:E[1].height}:null});e.src=u}else e.src=null;this._fetchCounter--;0===this._fetchCounter&&(this._fetched=!0);e._fetched=!0;this._updateFetchStatus()}),d.hitch(this,function(){this._fetchCounter--;0===this._fetchCounter&&(this._fetched=!0);e._fetched=!0;this._updateFetchStatus()}));e.update=this.updateTile(e)},
_updateFetchStatus:function(){this.layer._drawTile&&this.fetchAllCompleted&&!this.fetchAllCompleted.isResolved()&&!this.tiles.some(function(e){return!e._fetched})&&(this.tiles.forEach(d.hitch(this,function(e){this._fillPixelData(e)})),this.fetchAllCompleted.resolve())},_fillPixelData:function(e,l){if(e&&!e.updateCompleted)if(Math.abs(e.cellsizeX-this.resolution.x)>e.cellsizeX/10)e.updateCompleted=!0;else if(!1===this._validateRawPixelBlocks(e))e.updateCompleted=!0;else{var p=e.extent;if(this.layer.roaming||
this.layer.useWebGL&&!this.layer._hasTilingEffects){var v=this.fullExtent;var z=this.tileInfo.cols*(this.tileBoundary.colEnd-this.tileBoundary.colStart+1);var u=this.tileInfo.rows*(this.tileBoundary.rowEnd-this.tileBoundary.rowStart+1);l?this.originalPixelData.renderedPixelBlock||(this.originalPixelData.renderedPixelBlock=new b({width:z,height:u,pixels:[],pixelType:"",mask:null,statistics:[]})):this.identifiers.forEach(d.hitch(this,function(w){this.originalPixelData.src[w].pixelBlock.width=z;this.originalPixelData.src[w].pixelBlock.height=
u}))}else v=this.extent,z=this.layer._map.width,u=this.layer._map.height,l?this.originalPixelData.renderedPixelBlock||(this.originalPixelData.renderedPixelBlock=new b({width:z,height:u,pixels:[],pixelType:"",mask:null,statistics:[]})):this.identifiers.forEach(d.hitch(this,function(w){this.originalPixelData.src[w].pixelBlock.width=z;this.originalPixelData.src[w].pixelBlock.height=u}));if(v.xmax<=p.xmin||v.xmin>=p.xmax||v.ymax<=p.ymin||v.ymin>=p.ymax)return null;var E=this.originalPixelData.isEmpty=
!1;this.identifiers.forEach(d.hitch(this,function(w){e.src&&(this._fillPixelBlock(e.src[w],this.originalPixelData.src[w],{extent:v,width:z,height:u,normalizedExtent:e.normalizedExtent},!1),E=!0)}));e.filled=E;this.hasNewData=!0}},_fillPixelBlock:function(e,l,p,v){var z=e.extent,u=p.extent;v=p.width;var E=p.height;if(e.pixelBlock&&e.pixelBlock.pixels&&e.pixelBlock.pixels[0]){var w=(z.xmax-z.xmin)/e.width,F=Math.max(z.xmin,u.xmin),y=Math.min(z.ymax,u.ymax),D=Math.round((F-z.xmin)/w),B=e.width-Math.round(Math.abs(z.xmax-
Math.min(z.xmax,u.xmax))/w),x=Math.round(Math.abs(z.ymax-y)/w),r=e.height-Math.round((Math.max(z.ymin,u.ymin)-z.ymin)/w),t=this.halfWorldWidth;F=Math.round((F-u.xmin)/w);p=p.normalizedExtent;if(!(this.wrapTimes&&t&&z.xmin<-t)){if(this.wrapTimes&&t){if(this.tileInfo.applyGCS360Transform)360<z.xmin&&(F-=this.fullBoundary.paddingLeft);else if(z.xmin>t){F-=this.fullBoundary.paddingLeft;var C=this.normalizeCoordinate(z.xmin,t);var J=this.normalizeCoordinate(z.xmax,t)}else C=z.xmin,J=z.xmax;this.tileInfo.applyGCS360Transform?
p&&360>p.xmin&&360<p.xmax&&(B-=this.fullBoundary.paddingRight):p&&p.xmin<t&&p.xmax>t?B-=this.fullBoundary.paddingRight:C<t&&J>t&&(B-=this.fullBoundary.paddingRight)}C=Math.round(Math.abs(u.ymax-y)/w);J=e.pixelBlock.pixels.length;l=l.pixelBlock;p=e.width;z=l.mask||new Uint8Array(v*E);var L=e.pixelBlock,P=L.mask,U=0;for(w=0;w<J;w++){y=L.pixels[w];t=l.pixels[w]||new y.constructor(v*E);for(e=x;e<r;e++)for(U=(C+e-x)*v+F,u=D;u<B;u++)t[U+u-D]=y[e*p+u];l.pixels[w]=t}if(P)for(e=x;e<r;e++)for(U=(C+e-x)*v+F,
u=D;u<B;u++)z[U+u-D]=P[e*p+u];else for(e=x;e<r;e++)for(U=(C+e-x)*v+F,u=D;u<B;u++)z[U+u-D]=1;l.pixelType=l.pixelType||L.pixelType;l.mask=z;if(!(l.statistics&&0<l.statistics.length))for(l.statistics=[],e=0;e<L.statistics.length;e++)l.statistics[e]={minValue:L.statistics[e].minValue,maxValue:L.statistics[e].maxValue};else if(L.statistics&&l.statistics)for(e=0;e<l.statistics.length;e++)l.statistics[e].minValue=Math.min(L.statistics[e].minValue,l.statistics[e].minValue),l.statistics[e].maxValue=Math.max(L.statistics[e].maxValue,
l.statistics[e].maxValue)}}},_processTile:function(e,l){var p=new m,v=this.layer._hasTilingEffects,z=this.layer.useWebGL,u=v||z,E=this.layer.raster.rasterFunction&&e&&(v||z||!e.processedPixelBlock);if(l)var w=e;else this._fillPixelData(e),w=u?this.originalPixelData:e;this.xformSetting.hasNewTexture=this.hasNewData;var F;E?(this.identifiers.forEach(function(y){if(0===w.src[y].pixelBlock.pixels.length||0===w.src[y].pixelBlock.pixels[0].length)F=!0}),F?p.resolve({extent:w.extent,processedPixelBlock:w.src[this.identifiers[0]],
pixelBlock:w.src[this.identifiers[0]]}):z?(this.processedPixelData=this.layer.raster.rasterFunction.read(w),p.resolve(this.processedPixelData)):this.layer._rasterHandler?this.layer._rasterHandler.process({extent:w.extent,src:w.src}).then(function(y){v?(this.processedPixelData=y,p.resolve(this.processedPixelData)):(e.processedPixelBlock=y.pixelBlock,p.resolve(e))}):(l=this.layer.raster.rasterFunction.read(e),e.processedPixelBlock=l.pixelBlock,p.resolve(e))):u?p.resolve(w.src[this.identifiers[0]]):
(e.pixelBlock=w.src[this.identifiers[0]]&&w.src[this.identifiers[0]].pixelBlock,p.resolve(e));return p.promise},_renderTile:function(e){var l=new m,p=this.layer._hasTilingEffects,v=this.layer.useWebGL,z=Math.abs((e.extent.xmax-e.extent.xmin)/e.width-this.layer.getCurrentResolution().x)>this.resolution.x/10;z=this.layer.useWebGL&&(z||this._isTileOutSide(e,this.layer._map.extent));this.xformSetting.hasNewTexture=this.hasNewData;this.layer._rasterRenderer&&e&&(e.texture||e.src||e.pixelBlock||e.processedPixelBlock)?
(this.layer._rasterRenderer.interpolation=this.layer.interpolation,v&&!z?(this.layer.raster.rasterFunction&&this.layer.raster.rasterFunction.renderTexture||this.layer._rasterRenderer.draw(e),l.resolve(e)):this.layer._rasterHandler?this.layer._rasterHandler.render({extent:e.extent,pixelBlock:e.processedPixelBlock||e.pixelBlock}).then(function(u){p?(u.renderedPixelBlock=u.pixelBlock,l.resolve(u)):(e.renderedPixelBlock=u.pixelBlock,l.resolve(e))}.bind(this)):(e.renderedPixelBlock=this.layer._rasterRenderer.draw(e).pixelBlock,
l.resolve(e))):(e.renderedPixelBlock=e.processedPixelBlock||e.pixelBlock,l.resolve(e));return l.promise},_sortTiles:function(){this.tiles.sort(function(e,l){return e.row<l.row||e.row==l.row&&e.col<l.col?-1:1})}})})},"esri/dijit/RasterFunctionEditor/utils":function(){define("dojo/_base/lang dojo/_base/url dojo/has dojo/on dojo/Deferred dojo/_base/array ../../kernel ../../request ../../lang ../../config ../../layers/ArcGISImageServiceLayer ../../layers/ImageServiceParameters ../../layers/MosaicRule ../../layers/RasterFunction ../../tasks/Geoprocessor ../../tasks/JobInfo ../../renderers/colorUtils ../../renderers/colorRampUtils".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u){function E(r){if(r){var t=f.map([r.FromColor,r.ToColor],function(C){C=z.toRGB({h:C.Hue,s:C.Saturation,v:C.Value});return[C.r,C.g,C.b]});return{fromColor:t[0],toColor:t[1],type:"algorithmic",algorithm:r.Algorithm}}}function w(r){if(r)return r=z.toHSV(z.getDojoColor(r)),{type:"HsvColor",Hue:r.h,Saturation:r.s,Value:r.v,AlphaValue:255}}function F(r){if(r){var t=r.toJson?r.toJson():void 0;return{Algorithm:t&&t.Algorithm||"esriHSVAlgorithm",type:"AlgorithmicColorRamp",
FromColor:w(r.fromColor),ToColor:w(r.toColor)}}}var y={},D,B,x;H.mixin(y,{fetchRFT:function(r,t,C,J,L){var P=new q;var U=(U=(U=r.name)&&U.slice(-8))&&".rft.xml"===U.toLowerCase();return r&&r.itemDataUrl?U?L?this.convertRFT({url:L+"/ConvertRasterFunctionTemplate",rft:{itemId:r.id},format:"json"},t,J,C):(C("errorUtilitiesServiceNotAvailable"),P.reject(Error("errorUtilitiesServiceNotAvailable")),P.promise):a({url:r.itemDataUrl,callbackParamName:"callback",content:{f:"json"},handleAs:"json",load:t,error:C}).then(J):
(C("errorRetrievingRFTItem"),P.reject(Error("errorRetrievingRFTItem")),P.promise)},convertRFT:function(r,t,C,J){var L=r.url,P=function(){x&&(x.remove(),x=null);B&&(B.remove(),B=null)};D||(D=new p(L),n(D,"error",P));B=n(D,"job-complete",function(U){B&&(B.remove(),B=null);U.jobInfo.jobStatus!==v.STATUS_SUCCEEDED?(P(),J(U)):D.getResultData(U.jobInfo.jobId,"outputRasterFunction")});x=n(D,"get-result-data-complete",function(U){x&&(x.remove(),x=null);var aa=U&&U.result&&U.result.value;aa&&aa.url&&(U={url:aa.url,
handleAs:"json",load:C,error:J},aa=(new d(aa.url)).authority,-1===k.defaults.io.corsEnabledServers.indexOf(aa)&&k.defaults.io.corsEnabledServers.push(aa),a(U))});r={inputRasterFunction:JSON.stringify(r.rft),format:r.format};return D.submitJob(r,t,null,J)},getRasterJsonFromLayer:function(r){if(!r)return null;var t=r.url;t&&0<t.indexOf("?token\x3d")&&(t=t.slice(0,t.indexOf("?token\x3d")));var C=r.credential||t&&c.id.findCredential(t);b.isDefined(C)&&(t=t+"?token\x3d"+C.token,C.referer&&(t+=C.referer));
t={url:t,name:r.name};r.renderingRule&&(t.renderingRule=r.renderingRule.toJson?r.renderingRule.toJson():r.renderingRule);r.mosaicRule&&(t.mosaicRule=r.mosaicRule.toJson?r.mosaicRule.toJson():r.mosaicRule);return t},getLayerIdfromRasterValue:function(r,t){if(r&&t){var C;f.some(t,function(J){if(J&&J.url===r.url&&J.name===r.name&&r.name)return C=J.id,!0});return C}},getColorRampFromArg:function(r){if(r){var t;if(r.type&&-1<r.type.toLowerCase().indexOf("colorramp"))var C=r;else r.value&&-1<r.value.type.toLowerCase().indexOf("colorramp")&&
(C=r.value);if(C)return r=C.type.toLowerCase(),"multipartcolorramp"===r?t=u.fromJson({type:"multipart",colorRamps:f.map(C.ArrayOfColorRamp,function(J){return E(J)})}):"algorithmiccolorramp"===r&&(t=u.fromJson(E(C))),t.id=t.name=C.Name,t}},getRFxArgColorRampValue:function(r){if(r){if(r.fromColor&&r.toColor)return H.mixin(F(r),{Name:r.name});if(r.colorRamps){var t=f.map(r.colorRamps,F);return{type:"MultiPartColorRamp",NumColorRamps:t.length,ArrayOfColorRamp:t,Name:r.name}}}},RFX_VARIABLE_TYPE:"RasterFunctionVariable",
RFX_TEMPLATE_TYPE:"RasterFunctionTemplate",ARGUMENT_ARRAY_TYPE:"ArgumentArray",getArgRFT:function(r){if(r){if("RasterFunctionTemplate"===r.type)return r;if(r.value&&"RasterFunctionTemplate"===r.value.type)return r.value}},getEnumData:function(r,t,C){if(Array.isArray(r))return r.forEach(function(J){J.key=J.key.toString()}),r},getImageServiceTitle:function(r){r=r.split("/");return r[r.length-2]},isReferencedObject:function(r){if(r&&b.isDefined(r._object_ref_id))return!0},functionTypes:{local:"LocalFunction",
gpAdapter:"GPAdapterFunction",pythonAdapter:"PythonAdapterFunction"},defaultRasterNodeProps:{name:"Raster",isDataset:!0,isPublic:!1,type:"RasterFunctionVariable"},getArcGISImageServiceLayerItem:function(r){if(r){r=H.clone(r);r.name||(r.name=this.getImageServiceTitle(r.url));var t=new g;r.mosaicRule&&(t.mosaicRule=new e(r.mosaicRule));r.renderingRule&&(t.renderingRule=new l(r.renderingRule));t=new h(r.url,{id:r.name+(new Date).toString(),imageServiceParameters:t});t.name=r.name;return t}},filterMDInfoIfMosiacRuleIsSet:function(r){var t=
H.clone(r.multidimensionalInfo),C=[],J=r.mosaicRule&&r.mosaicRule.multidimensionalDefinition;if(J&&0<J.length){var L=t.variables.filter(function(P){return J[0].variableName===P.name}.bind(this));if(!L||0===L.length)return t;L=L[0];C=H.clone(L);C.dimensions=[];J.forEach(function(P){var U=L.dimensions.filter(function(da){return P.dimensionName===da.name}.bind(this));if(U&&0!==U.length){var aa=(U=U[0])&&U.values,ea=0,ba=1,oa=P.values&&P.values.length;switch(P.values&&P.values[0].length||oa){case 1:ea=
aa.indexOf(P.values[0]);ba=ea+1;break;case 2:ea=aa.indexOf(P.values[0][0]),ba=aa.indexOf(P.values[0][1])+1}aa=aa.slice(ea,ba);U.values=aa;C.dimensions.push(U)}else C.dimensions=H.clone(L.dimensions)}.bind(this));t.variables=[C]}return t}});m("extend-esri")&&H.setObject("dijit.RasterFunctionEditor.utils",y,c);return y})},"widgets/Geoprocessing/editors/SelectFeatureSetFromFile":function(){define("dojo/_base/declare dojo/_base/lang dojo/dom-attr dojo/dom-style dojo/on dojo/json dojo/text!./SelectFeatureSetFromFile.html dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin esri/request esri/geometry/scaleUtils esri/InfoTemplate esri/layers/FeatureLayer esri/renderers/SimpleRenderer esri/tasks/FeatureSet jimu/dijit/Message jimu/dijit/CheckBox jimu/portalUrlUtils jimu/symbolUtils jimu/utils ./BaseFeatureSetEditor ../utils dijit/form/Form dijit/form/Select".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F,y){return H([F,a,b],{baseClass:"jimu-gp-editor-base jimu-gp-editor-file",templateString:c,editorName:"SelectFeatureSetFromFile",layer:void 0,constructor:function(){this.uniqueID=y.uniqueId()},postCreate:function(){this.inherited(arguments);n.set(this.clearLink,"display","none");n.set(this.uploadStatus,"display","none");this.uploadStatus.src=require.toUrl("jimu")+"/images/loading_circle.gif";this.generalizeCheckbox=new z({checked:!0,label:this.nls.generalize});
this.generalizeCheckbox.placeAt(this.checkboxNode)},destroy:function(){this._clear()},getValue:function(){if(0===this.activeViewIndex){if(this.layer){var D=new p;D.features=this.layer.graphics;return D}return null}return this.getFeatureSet()},_onUpload:function(){if(m.get(this.fileInput,"value")){var D=m.get(this.fileInput,"value");D=D.replace(/\\/g,"/");D=D.substr(D.lastIndexOf("/")+1);this.fileInfo.innerHTML=w.sanitizeHTML(D);n.set(this.uploadStatus,"display","");D={name:D,targetSR:this.map.spatialReference,
maxRecordCount:4E3,enforceInputFileSizeLimit:!0,enforceOutputJsonSizeLimit:!0};var B;if(this.generalizeCheckbox.getValue()){var x=h.getExtentForScale(this.map,4E4);x=x.getWidth()/this.map.width;D.generalize=!0;D.maxAllowableOffset=x;x/=10}else x=h.getExtentForScale(this.map,400),x=x.getWidth()/this.map.width;for(B=0;1>x;)x*=10,B++;D.reducePrecision=!0;D.numberOfDigitsAfterDecimal=B;k({url:this._getPortalUrl()+"/sharing/rest/content/features/generate",content:{filetype:"shapefile",publishParameters:f.stringify(D),
f:"json"},form:this.fileForm.domNode,handleAs:"json",load:d.hitch(this,function(r){n.set(this.uploadStatus,"display","none");r.error?new v({message:r.error.message||r.error}):this.addToMap(r.featureCollection)}),error:d.hitch(this,function(){n.set(this.uploadStatus,"display","none");var r=this.nls.generateShapefileError+this._getPortalUrl()+"/sharing/rest/content/features/generate";new v({message:r})})})}else new v({message:this.nls.noFileSelected})},addToMap:function(D){this._clear();D=D.layers[0];
var B=new g("Details","${*}");this.layer=new e(D,{infoTemplate:B});this.own(q(this.layer,"click",d.hitch(this,function(x){this.map.infoWindow.setFeatures([x.graphic])})));this.changeRenderer();D=this.layer.fullExtent;this.map.addLayer(this.layer);this.map.setExtent(D.expand(1.25),!0);n.set(this.clearLink,"display","")},changeRenderer:function(){var D=null;switch(this.layer.geometryType){case "esriGeometryPoint":D=E.getDefaultMarkerSymbol();break;case "esriGeometryPolyline":D=E.getDefaultLineSymbol();
break;case "esriGeometryPolygon":D=E.getDefaultFillSymbol()}D&&this.layer.setRenderer(new l(D))},_getPortalUrl:function(){return u.getStandardPortalUrl(this.appConfig.portalUrl)},_clear:function(){this.layer&&(this.layer.clear(),this.map.removeLayer(this.layer),this.fileInfo.innerHTML="",m.set(this.fileInput,"value",""),n.set(this.clearLink,"display","none"))}})})},"widgets/Geoprocessing/utils":function(){define(["dojo/_base/array","dojo/Deferred","esri/request"],function(H,d,m){var n={},q=0;n.promisifyGetValue=
function(f){var c=f.getValue;f.getValue=function(){var a=c.apply(f);if(null!==a&&a.then)return a;var b=new d;b.resolve(a);return b}};n.allowShareResult=function(f){return H.some(f.outputParams,function(c){return"GPRecordSet"===c.dataType||"GPFeatureRecordSetLayer"===c.dataType&&c.defaultValue&&c.defaultValue.geometryType})};n.getServiceDescription=function(f){var c;return m({url:f,content:{f:"json"},handleAs:"json",callbackParamName:"callback"}).then(function(a){c=a;return n.getGPServerDescription(f).then(function(b){c.serverInfo=
b;c.useResultMapServer=b.hasResultMapServer;return n.uploadSupported(b).then(function(k){c.serverInfo.supportsUpload=k.supportsUpload;"maxUploadFileSize"in k&&(c.serverInfo.maxUploadFileSize=k.maxUploadFileSize);return c})})})};n.getGPServerDescription=function(f){var c={url:n.getGPServerUrl(f),content:{f:"json"},handleAs:"json",callbackParamName:"callback"};return m(c,{useProxy:!1}).then(function(a){var b={};b.currentVersion=a.currentVersion||0;b.url=c.url;b.hasResultMapServer="esriExecutionTypeAsynchronous"===
a.executionType&&"resultMapServerName"in a&&""!==a.resultMapServerName;b.resultMapServerName=a.resultMapServerName;return b})};n.getGPServerUrl=function(f){if(!/\/GPServer\/.+$/.test(f))return"";var c=f.lastIndexOf("/");return f.substr(0,c+1)};n.getResultMapServerUrl=function(f,c){if(!/\/rest\/services\//.test(f))return"";var a=f.search(/\/rest\/services\//);return f.substr(0,a+15)+c+"/MapServer"};n.uploadSupported=function(f){if(10.1<=f.currentVersion)return m({url:f.url+"uploads/info",content:{f:"json"},
handleAs:"json"}).then(function(c){return{supportsUpload:!0,maxUploadFileSize:c.maxUploadFileSize}},function(){return{supportsUpload:!1}});f=new d;f.resolve({supportsUpload:!1});return f};n.getResultMapLayers=function(f,c){f={url:n.getResultMapServerUrl(f,c),content:{f:"json"},handleAs:"json",callbackParamName:"callback"};return m(f,{useProxy:!1}).then(function(a){var b=H.map(a.layers,function(k){return k.name});H.forEach(a.tables,function(k){b.push(k.name)});return b})};n.useDynamicSchema=function(f,
c){return"useDynamicSchema"in f?!0===f.useDynamicSchema:!0===c.useDynamicSchema};n.uniqueId=function(){var f=Date.now();f<=q?f=++q:q=f;return f};return n})},"widgets/Geoprocessing/editors/SelectFeatureSetFromDraw":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/html dijit/_TemplatedMixin jimu/dijit/DrawBox esri/symbols/jsonUtils esri/tasks/FeatureSet esri/geometry/Polygon esri/graphic esri/graphicsUtils ./BaseFeatureSetEditor dojo/text!./SelectFeatureSetFromDraw.html ../LayerOrderUtil".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l){return H([g,q],{editorName:"SelectFeatureSetFromDraw",templateString:e,constructor:function(p){this.inherited(arguments);this.paramName=p.param.name;this.drawLayerId=p.widgetUID+p.param.name},postCreate:function(){this.inherited(arguments);n.addClass(this.domNode,"jimu-gp-editor-draw");n.addClass(this.domNode,"jimu-gp-editor-base");var p={types:this.types,drawLayerId:this.drawLayerId,showClear:this.showClear,map:this.map};this.param.symbol&&(p[this.types[0]+"Symbol"]=
c.fromJson(this.param.symbol));this.drawBox=new f(p);n.place(this.drawBox.domNode,this.inputNode);this.drawBox.startup();try{(new l(this.config,this.map)).calculateLayerIndex(this.paramName,this.widgetUID).then(d.hitch(this,function(v){-1!==v&&this.map.reorderLayer(this.drawBox.drawLayer,v)}))}catch(v){console.error(v.message)}this.startup()},getValue:function(){return 0===this.activeViewIndex?this.drawBox.drawLayer&&0<this.drawBox.drawLayer.graphics.length?this._createFeatureSet(this.drawBox.drawLayer.graphics):
null:this.getFeatureSet()},_createFeatureSet:function(p){var v=new a,z=[];p=h.getGeometries(p);m.forEach(p,function(u){u="extent"===u.type?new k(b.fromExtent(u)):new k(u);z.push(u)});v.features=z;return v}})})},"widgets/Geoprocessing/LayerOrderUtil":function(){define(["dojo/_base/declare","dojo/_base/array","dojo/Deferred","jimu/LayerInfos/LayerInfos"],function(H,d,m,n){return H(null,{config:null,constructor:function(q,f){this.config=q;this.map=f;"layerOrder"in this.config&&0!==this.config.layerOrder.length||
(this.config.layerOrder=this.getCandidateParamNames(!1))},getCandidateParamNames:function(q){var f=[];if(!this.config)return f;d.forEach(this.config.outputParams,function(c){"GPFeatureRecordSetLayer"!==c.dataType||q&&!0===this.config.useResultMapServer||f.push(c.name)},this);d.forEach(this.config.inputParams,function(c){"GPFeatureRecordSetLayer"!==c.dataType||q&&"draw"!==c.featureSetMode||f.push(c.name)},this);return f},getOrderableInput:function(){var q=[];if(!this.config)return q;d.forEach(this.config.inputParams,
function(f){"GPFeatureRecordSetLayer"===f.dataType&&"draw"===f.featureSetMode&&q.push(f.name)},this);return d.filter(this.config.layerOrder,function(f){return-1!==d.indexOf(q,f)},this)},getOrderableOutput:function(){var q=[];if(!this.config)return q;d.forEach(this.config.outputParams,function(f){"GPFeatureRecordSetLayer"===f.dataType&&!0!==this.config.useResultMapServer&&q.push(f.name)},this);return d.filter(this.config.layerOrder,function(f){return-1!==d.indexOf(q,f)},this)},calculateLayerIndex:function(q,
f){if(!this.map)throw Error("The map cannot be null in LayerOrderUtil.calculateLayerIndex");var c=new m,a=this.config.layerOrder;var b=d.indexOf(a,q);if(-1===b)throw Error(q+"cannot be found in the orderable params");for(q=b-1;0<=q;q--){var k=d.indexOf(this.map.graphicsLayerIds,f+a[q]);if(-1!==k)return c.resolve(k),c}q=b+1;for(b=a.length;q<b;q++)if(k=d.indexOf(this.map.graphicsLayerIds,f+a[q]),-1!==k)return c.resolve(k+1),c;c.isResolved()||n.getInstance(this.map,this.map.itemInfo).then(function(h){h=
h.getMapNotesLayerInfoArray();if(0===h.length)c.resolve(-1);else{h=h[h.length-1];var g=h.getSubLayers();h=0===g.length?h.layerObject.id:g[g.length-1].layerObject.id;k=d.indexOf(this.map.graphicsLayerIds,h);c.resolve(k)}});return c}})})},"widgets/Geoprocessing/editors/DataFileEditor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/html dojo/_base/array dojo/dom-style dojo/dom-attr dojo/on dojo/Deferred dojo/text!./DataFileEditor.html dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin esri/tasks/DataFile esri/request jimu/dijit/ViewStack jimu/dijit/Message jimu/utils ../BaseEditor ../utils dijit/form/Form jimu/dijit/URLInput dijit/form/RadioButton".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u){return H([z,k,h],{baseClass:"jimu-gp-editor-base jimu-gp-editor-datafile",templateString:b,editorName:"DataFileEditor",mode:"url",_url:"",_itemID:null,uniqueID:null,constructor:function(){this.inherited(arguments);this.uniqueID=u.uniqueId()},postCreate:function(){this.inherited(arguments);this.value&&this.parseDefaultValue();f.set(this.urlEditor,"tooltip",this.param.tooltip);"setting"===this.context?(this.viewStack=null,q.set(this.fileNode,"display","none")):
(this.viewStack=new l({viewType:"dom",views:[this.urlNode,this.fileNode]}),this.viewStack.placeAt(this.settingNode),this.viewStack.startup());!0===this.config.serverInfo.supportsUpload&&q.set(this.modeSelection,"display","");this.own(c(this.urlMode,"click",d.hitch(this,this._onUrlModeSelect)));this.own(c(this.itemMode,"click",d.hitch(this,this._onItemModeSelect)));"item"===this.mode&&this.config.serverInfo.supportsUpload?(this.itemMode.set("checked",!0),this._onItemModeSelect()):(this.urlMode.set("checked",
!0),this._onUrlModeSelect(),this.urlEditor.set("value",this._url));if(this.param.filter&&this.param.filter.type&&"file"===this.param.filter.type.toLowerCase()&&this.param.filter.list&&0<this.param.filter.list.length){var E=n.map(this.param.filter.list,function(w){return"."+w});m.setAttr(this.fileInput,"accept",E.join(","))}},parseDefaultValue:function(){0===this.value.indexOf("itemID:")?this.mode="item":(0===this.value.indexOf("url:")&&(this._url=this.value.substring(4)),this.mode="url")},hasValidValue:function(){if("item"===
this.mode)return!0;if("url"===this.mode)return this.urlEditor.isValid()},getValue:function(){return"url"===this.mode?"url:"+this._getUrl():"item"===this.mode?"itemID:":""},getGPValue:function(){var E=new a,w=new g;"url"===this.mode?w.url=this._getUrl():w.itemID=this.itemIDInput;w.url||w.itemID?E.resolve(w):E.resolve(null);return E},_getUrl:function(){return this.urlEditor.isValid()?this.urlEditor.get("value"):""},_onUrlModeSelect:function(){this.mode="url";this.viewStack?this.viewStack.switchView(0):
q.set(this.urlNode,"display","block")},_onItemModeSelect:function(){this.mode="item";this.viewStack?this.viewStack.switchView(1):q.set(this.urlNode,"display","none")},_onUpload:function(){f.get(this.fileInput,"value")&&this._doUpload().then(d.hitch(this,function(E){E&&new p({message:this.nls.uploadSuccess})}),function(E){new p({message:E.message||E})})},_doUpload:function(){var E=new a,w=f.get(this.fileInput,"value");w=w.replace(/\\/g,"/");w=w.substr(w.lastIndexOf("/")+1);e({url:this.config.serverInfo.url+
"uploads/upload",form:this.fileForm.domNode,handleAs:"json"}).then(d.hitch(this,function(F){F.success&&(this.itemIDInput=F.item.itemID,f.set(this.fileInput,"value",""),f.set(this.uploadFileName,"innerHTML",v.sanitizeHTML(w)));E.resolve(F.success)}),function(F){E.reject(F)});return E}})})},"widgets/Geoprocessing/editors/RasterLayerEditor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/dom-style dojo/dom-attr dojo/on dojo/Deferred dojo/text!./RasterLayerEditor.html dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin esri/tasks/RasterData esri/request jimu/dijit/ViewStack jimu/dijit/Message ../BaseEditor ../utils dijit/form/TextBox jimu/dijit/URLInput dijit/form/RadioButton".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v){return H([p,b,k],{baseClass:"jimu-gp-editor-base jimu-gp-editor-wrapper",templateString:a,editorName:"RasterLayerEditor",mode:"url",_url:"",_format:"",_itemID:null,uniqueID:null,constructor:function(){this.inherited(arguments);this.uniqueID=v.uniqueId()},postCreate:function(){this.inherited(arguments);this.value&&this.parseDefaultValue();q.set(this.urlEditor,"tooltip",this.param.tooltip);"setting"===this.context?(this.viewStack=null,n.set(this.fileNode,"display",
"none")):(this.viewStack=new e({viewType:"dom",views:[this.urlNode,this.fileNode]}),this.viewStack.placeAt(this.settingNode),this.viewStack.startup());this.config.serverInfo.supportsUpload&&n.set(this.modeSelection,"display","");this.own(f(this.urlMode,"click",d.hitch(this,this._onUrlModeSelect)));this.own(f(this.itemMode,"click",d.hitch(this,this._onItemModeSelect)));"item"===this.mode&&this.config.serverInfo.supportsUpload?(this.itemMode.set("checked",!0),this._onItemModeSelect()):(this.urlMode.set("checked",
!0),this._onUrlModeSelect(),this.rasterFormatInput.set("value",this._format),this.urlEditor.set("value",this._url))},parseDefaultValue:function(){if(0===this.value.indexOf("itemID:"))this.mode="item";else{if(0===this.value.indexOf("url:")||0===this.value.indexOf("format:")){var z=this.value.split(",");m.forEach(z,function(u){0===u.indexOf("url:")?this._url=u.substring(4):u.indexOf(!1)&&(this._format=u.substring(7))},this)}this.mode="url"}},hasValidValue:function(){if("item"===this.mode)return!0;if("url"===
this.mode)return this.urlEditor.isValid()},getValue:function(){return"url"===this.mode?"url:"+this._getUrl()+",format:"+this.rasterFormatInput.get("value"):"item"===this.mode?"itemID:":""},getGPValue:function(){var z=new c,u=new h;"url"===this.mode?(u.url=this._getUrl(),u.format=this.rasterFormatInput.get("value")):u.itemID=this.itemIDInput;u.url||u.itemID?z.resolve(u):z.resolve(null);return z},_getUrl:function(){return this.urlEditor.isValid()?this.urlEditor.get("value"):""},_onUrlModeSelect:function(){this.mode=
"url";this.viewStack?this.viewStack.switchView(0):n.set(this.urlNode,"display","block")},_onItemModeSelect:function(){this.mode="item";this.viewStack?this.viewStack.switchView(1):n.set(this.urlNode,"display","none")},_onUpload:function(){if(q.get(this.fileInput,"value")){var z=q.get(this.fileInput,"value");z=z.replace(/\\/g,"/");z=z.substr(z.lastIndexOf("/")+1);g({url:this.config.serverInfo.url+"uploads/upload",form:this.fileForm.domNode,handleAs:"json"}).then(d.hitch(this,function(u){u.success&&
(this.itemIDInput=u.item.itemID,q.set(this.fileInput,"value",""),q.set(this.uploadFileName,"innerHTML",z),new l({message:this.nls.uploadSuccess}))}),d.hitch(this,function(u){new l({message:u.message||u})}))}}})})},"widgets/Geoprocessing/editors/RecordSetEditor":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","../BaseEditor","../PopupConfig"],function(H,d,m,n,q){return H([n],{baseClass:"jimu-gp-editor-base jimu-gp-editor-rse",editorName:"RecordSetEditor",popupConfig:null,
args:null,constructor:function(f){this.args=d.mixin({},f)},postCreate:function(){this.inherited(arguments);this.value={};var f={showTitle:!1};if(this.args&&this.args.param&&this.args.param.defaultValue){this.value=d.clone(this.args.param.defaultValue);var c=this.value.fields;if(this.value.output&&this.value.output.fields)if(this.value.output.fields.length!==c.length){var a=m.map(this.value.output.fields,function(b){return b.name});m.forEach(c,function(b){0<=a.indexOf(b.name)?b.visible=!0:b.visible=
!1})}else c=this.value.output.fields;f.fields=c;this.popupConfig=new q(f);this.popupConfig.placeAt(this.domNode);this.popupConfig.startup()}else this.domNode.innerHTML="table"},destroy:function(){this.popupConfig&&(this.popupConfig.destroy(),this.popupConfig=null);this.inherited(arguments)},getValue:function(){if(this.popupConfig){var f=this.popupConfig.getConfig();this.value.output={title:f.title,fields:f.fields};this.value.fields=this.args.param.defaultValue.fields}return this.value}})})},"widgets/Geoprocessing/editors/RecordSetEditorChooser":function(){define("dojo/_base/declare dojo/_base/html dojo/_base/lang dojo/on dojo/text!./RecordSetEditorChooser.html dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin ../BaseEditor ./simpleEditors dojo/i18n!../nls/strings dijit/form/RadioButton".split(" "),
function(H,d,m,n,q,f,c,a,b,k){return H([a,f,c],{baseClass:"jimu-gp-editor-base jimu-gp-editor-rsec",templateString:q,editorName:"RecordSetEditorChooser",postMixInProperties:function(){this.inherited(arguments);m.mixin(this.nls,k)},postCreate:function(){this.inherited(arguments);this.value={};this.own(n(this.jsonMode,"click",m.hitch(this,this._onJSONModeSelect)));this.own(n(this.tableMode,"click",m.hitch(this,this._onTableModeSelect)));"json"===this.param.recordSetMode?(this.jsonMode.set("checked",
!0),this._onJSONModeSelect()):"table"===this.param.recordSetMode&&(this.tableMode.set("checked",!0),this._onTableModeSelect());this.editor=new b.SimpleJsonEditor({value:this.param.defaultValue,nls:this.nls});this.editor.placeAt(this.jsonEditorDiv)},getValue:function(){"json"===this.value.recordSetMode&&(this.value.defaultValue=this.editor.getValue());return this.value},_onJSONModeSelect:function(){this.value.recordSetMode="json";d.setStyle(this.defaultJSONDiv,"display","block")},_onTableModeSelect:function(){this.value.recordSetMode=
"table";d.setStyle(this.defaultJSONDiv,"display","none")}})})},"widgets/Geoprocessing/editors/SelectRecordSetFromTable":function(){define("dojo/_base/declare dojo/Deferred dojo/_base/lang dojo/_base/array jimu/LayerInfos/LayerInfos dijit/form/Select esri/tasks/query esri/tasks/QueryTask dijit/_TemplatedMixin ../BaseEditor".split(" "),function(H,d,m,n,q,f,c,a,b,k){return H([k,b],{templateString:'\x3cdiv\x3e\x3cdiv class\x3d"recordset-editor" data-dojo-attach-point\x3d"tableChooseNode"\x3e\x3c/div\x3e\x3c/div\x3e',
editorName:"SelectRecordSetFromTable",postCreate:function(){this.inherited(arguments);var h=q.getInstanceSync().getTableInfoArray(),g=[{label:this.nls.chooseATable,value:"",selected:!0}];n.forEach(h,function(e){g.push({label:e.title||e.name,value:e})});this.selectDijit=new f({name:"tableSelctor","class":"table-select",options:g});this.selectDijit.placeAt(this.tableChooseNode).startup()},getGPValue:function(){var h=new d,g=this.selectDijit.get("value");g?g.getLayerObject().then(m.hitch(this,function(e){if(e)if(e.featureCollectionData)h.resolve(e.featureCollectionData);
else if(e.url){e=new a(e.url);var l=new c;l.where="1\x3d1";l.outFields=["*"];e.execute(l,function(p){h.resolve(p)},function(p){h.reject(p)})}else h.resolve(null);else h.resolve(null)})):h.resolve(null);return h}})})},"widgets/Geoprocessing/resultRendererManager":function(){define(["jimu/utils","dojo/_base/array","./resultrenderers/simpleResultRenderers"],function(H,d,m){var n={},q,f;n.createResultRenderer=function(c,a,b){var k="MapServiceLayer"===c.dataType?"AddResultImageLayer":"GPFeatureRecordSetLayer"===
c.dataType?"DrawResultFeatureSet":"GPRecordSet"===c.dataType?"RecordSetTable":"error"===c?"Error":"SimpleResultRenderer";b={param:c,widgetUID:b.uid,map:q,nls:f,config:b.config};if("DrawResultFeatureSet"===k)b.value=a.value,a=new m.DrawResultFeatureSet(b);else if("RecordSetTable"===k)b.value=a.value,a=new m.RecordSetTable(b);else if("SimpleResultRenderer"===k){var h="";a=a.value;Array.isArray(a)||(a=[a]);d.forEach(a,function(g){""!==h&&(h+="\x3cbr\x3e");if(["GPLong","GPDouble","GPString","GPBoolean"].some(function(e){return 0<=
c.dataType.indexOf(e)}))h+=H.sanitizeHTML(g);else if(0<=c.dataType.indexOf("GPLinearUnit"))h+=g.distance+"\x26nbsp;"+g.units;else if(0<=c.dataType.indexOf("GPDate"))h+=(new Date(g)).toLocaleTimeString();else if(0<=c.dataType.indexOf("GPRecordSet"))h+="table";else if(0<=c.dataType.indexOf("GPDataFile")||0<=c.dataType.indexOf("GPRasterDataLayer"))h=g.url?h+('\x3ca target\x3d"_blank" href\x3d"'+g.url+'"\x3e'+g.url+"\x3c/a\x3e"):h+(c.paramName+": null")});b.message=h;a=new m.SimpleResultRenderer(b)}else"AddResultImageLayer"===
k?(b.layer=a,a=new m.AddResultImageLayer(b)):"UnsupportRenderer"===k?(b.message="type "+c.dataType+" is not supported for now.",a=new m.UnsupportRenderer(b)):"Error"===k?(b.message=f.error,a=new m.ErrorResultRenderer(b)):(b.message="unknown renderer name: "+k,a=new m.UnsupportRenderer(b));return a};n.setMap=function(c){q=c};n.setNls=function(c){f=c};return n})},"widgets/Geoprocessing/resultrenderers/simpleResultRenderers":function(){define("dojo/_base/declare dojo/_base/html ../BaseResultRenderer ./FeatureSetRenderer ./RecordSetRenderer ./ResultImageLayerRenderer".split(" "),
function(H,d,m,n,q,f){var c={};c.UnsupportRenderer=H(m,{baseClass:"jimu-gp-resultrenderer-base jimu-gp-renderer-unsupport",postCreate:function(){this.inherited(arguments);d.setAttr(this.domNode,"innerHTML",this.message)}});c.SimpleResultRenderer=H(m,{baseClass:"jimu-gp-resultrenderer-base jimu-gp-renderer-simple",postCreate:function(){this.inherited(arguments);d.setAttr(this.domNode,"innerHTML",this.message)}});c.ErrorResultRenderer=H(m,{baseClass:"jimu-gp-resultrenderer-base jimu-gp-renderer-error",
postCreate:function(){this.inherited(arguments);d.setAttr(this.domNode,"innerHTML",this.message)}});c.RecordSetTable=q;c.DrawResultFeatureSet=n;c.AddResultImageLayer=f;return c})},"widgets/Geoprocessing/BaseResultRenderer":function(){define(["dojo/_base/declare","dijit/_WidgetBase"],function(H,d){return H([d],{baseClass:"jimu-gp-resultrenderer-base",postCreate:function(){this.inherited(arguments)}})})},"widgets/Geoprocessing/resultrenderers/FeatureSetRenderer":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/dom-style dojo/dom-attr dojo/on dojo/dom-geometry dijit/_TemplatedMixin esri/layers/GraphicsLayer esri/layers/FeatureLayer esri/graphicsUtils esri/renderers/SimpleRenderer esri/renderers/jsonUtils esri/InfoTemplate jimu/dijit/FeatureActionPopupMenu dojo/text!./FeatureSetRenderer.html ../BaseResultRenderer ../LayerOrderUtil ./defaultSymbol ../utils".split(" "),
function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w){return H([z,a],{baseClass:"jimu-gp-resultrenderer-base jimu-gp-renderer-draw-feature",templateString:v,postCreate:function(){this.inherited(arguments);this.popupMenu=p.getInstance();this.value.features&&0<this.value.features.length?(this._displayText(),this._drawResultFeature(this.param,this.value)):this.value.url?(this._displayText(!0),this._addResultURL(this.param,this.value.url)):(n.set(this.clearNode,"display","none"),n.set(this.exportNode,"display",
"none"),this.labelContent.innerHTML=this.nls.emptyResult)},destroy:function(){this.resultLayer&&this.map.removeLayer(this.resultLayer);this.inherited(arguments)},_displayText:function(F){n.set(this.clearNode,"display","");q.set(this.clearNode,"title",this.nls.clear);this.own(f(this.clearNode,"click",d.hitch(this,function(){this.resultLayer&&(this.map.infoWindow.isShowing&&this.map.infoWindow.hide(),this.resultLayer.clear(),this.map.removeLayer(this.resultLayer));n.set(this.exportNode,"display","none");
n.set(this.clearNode,"display","none");this.labelContent.innerHTML=this.nls.cleared})));F||(n.set(this.exportNode,"display",""),q.set(this.exportNode,"title",this.nls.exportOutput),this.own(f(this.exportNode,"click",d.hitch(this,this._showActions))))},_showActions:function(F){this.popupMenu.prepareActions(this.value,this.config.showExportButton).then(d.hitch(this,function(){var y=c.position(F.target);this.popupMenu.show(y)}))},_addResultURL:function(F,y){this.resultLayer=new k(y,{id:this.widgetUID+
F.name});this.resultLayer.title=F.label||F.name;F.renderer&&(y=e.fromJson(F.renderer),!1===F.renderer._showOthersSymbol&&(y.defaultSymbol=null),this.resultLayer.setRenderer(y));this.resultLayer.setVisibility(!0!==F.layerInvisible);this._addResultLayer(F.name);this.own(f(this.resultLayer,"load",d.hitch(this,function(D){D.layer&&D.layer.fullExtent&&this.map.setExtent(D.layer.fullExtent.expand(1.2))})))},_drawResultFeature:function(F,y){var D,B=w.useDynamicSchema(F,this.config);if(!F.popup||B)F.popup=
{enablePopup:!0,title:"",fields:[]};F.popup.enablePopup&&(D=new l(F.popup.title||"${Non-Exist-Field}",this._generatePopupContent(y,B)));if(this.config.shareResults&&!B){if(!F.defaultValue||!F.defaultValue.geometryType)throw Error("Output parameter default value does not provide enough information to draw feature layer.");F.defaultValue.name=F.name;this.resultLayer=new k({layerDefinition:F.defaultValue,featureSet:null},{id:this.widgetUID+F.name,infoTemplate:D})}else this.resultLayer=new b({id:this.widgetUID+
F.name,infoTemplate:D});m.forEach(y.features,function(r){this.resultLayer.add(r)},this);this.resultLayer.title=F.label||F.name;D=F.renderer;B||!D?"esriGeometryPoint"===y.geometryType||"esriGeometryMultipoint"===y.geometryType?D=new g(E.pointSymbol):"esriGeometryPolyline"===y.geometryType?D=new g(E.lineSymbol):"esriGeometryPolygon"===y.geometryType&&(D=new g(E.polygonSymbol)):(D=e.fromJson(D),!1===F.renderer._showOthersSymbol&&(D.defaultSymbol=null));this.resultLayer.setRenderer(D);this.resultLayer.setVisibility(!0!==
F.layerInvisible);this._addResultLayer(F.name);try{if(y.features&&0<y.features.length&&y.features[0].geometry){var x=h.graphicsExtent(y.features);x&&(this.resultLayer.fullExtent=x)}}catch(r){console.error(r)}},_addResultLayer:function(F){var y=new u(this.config,this.map);try{y.calculateLayerIndex(F,this.widgetUID).then(d.hitch(this,function(D){-1!==D?this.map.addLayer(this.resultLayer,D):this.map.addLayer(this.resultLayer)}))}catch(D){console.error(D.message),console.warn("Draw result feature set on the top of map"),
this.map.addLayer(this.resultLayer)}},_generatePopupContent:function(F,y){var D="";F=!y&&this.param.popup.fields&&0<this.param.popup.fields.length?m.filter(this.param.popup.fields,d.hitch(this,function(B){return!1!==B.visible})):F.fields;m.forEach(F,function(B){D+='\x3ctr valign\x3d"top"\x3e\x3ctd class\x3d"attr-name"\x3e'+B.alias+'\x3c/td\x3e\x3ctd class\x3d"attr-value"\x3e${'+B.name+"}\x3c/td\x3e\x3c/tr\x3e"});return'\x3cdiv class\x3d"geoprocessing-popup"\x3e\x3ctable class\x3d"geoprocessing-popup-table" cellpadding\x3d"0" cellspacing\x3d"0"\x3e\x3ctbody\x3e'+
D+"\x3c/tbody\x3e\x3c/table\x3e\x3c/div\x3e"}})})},"widgets/Geoprocessing/resultrenderers/defaultSymbol":function(){define("dojo/json dojo/text!./symbol.json esri/symbols/SimpleLineSymbol esri/symbols/SimpleFillSymbol esri/symbols/jsonUtils esri/Color".split(" "),function(H,d,m,n,q,f){H=H.parse(d);d={};d.pointSymbol=q.fromJson(H.pointSymbol);d.lineSymbol=new m(m.STYLE_SOLID,new f([0,69,117]),2);d.polygonSymbol=new n(n.STYLE_SOLID,new m(m.STYLE_SOLID,new f([110,110,110]),1),new f([0,100,255,.6]));
return d})},"widgets/Geoprocessing/resultrenderers/RecordSetRenderer":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/dom-construct dojo/dom-style dojo/dom-attr dojo/on dojo/dom-geometry dijit/_TemplatedMixin dojo/store/Memory dgrid/OnDemandGrid dgrid/extensions/ColumnResizer jimu/dijit/FeatureActionPopupMenu jimu/LayerInfos/LayerInfos jimu/dijit/Popup dojo/text!./RecordSetRenderer.html ../BaseResultRenderer ../utils".split(" "),function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,
z,u){return H([z,b],{baseClass:"jimu-gp-resultrenderer-base jimu-gp-renderer-table",templateString:v,postCreate:function(){this.inherited(arguments);this.popupMenu=e.getInstance();var E=[];if(this.value.features&&0!==this.value.features.length){q.set(this.magnifyNode,"display","");if(!u.useDynamicSchema(this.param,this.config)&&this.param.defaultValue&&this.param.defaultValue.output&&this.param.defaultValue.output.fields&&0<this.param.defaultValue.output.fields.length)E=m.filter(this.param.defaultValue.output.fields,
d.hitch(this,function(B){return!1!==B.visible}));else if(this.value.fields)E=this.value.fields;else if(this.value.features&&0<this.value.features.length)for(var w in this.value.features[0].attributes)E.push({name:w});if(this.config.shareResults){var F=l.getInstanceSync();var y=F.addTable({featureCollectionData:{layerDefinition:{fields:E},featureSet:this.value},title:this.param.label||this.param.name});q.set(this.clearNode,"display","");f.set(this.clearNode,"title",this.nls.clear);this.own(c(this.clearNode,
"click",d.hitch(this,function(){F.removeTable(y);q.set(this.exportNode,"display","none");q.set(this.clearNode,"display","none");q.set(this.magnifyNode,"display","none");this.labelContent.innerHTML=this.nls.cleared;n.empty(this.tableNode);this.table&&this.table.destroy()})))}w=m.map(this.value.features,function(B){return B.attributes});f.set(this.magnifyNode,"title",this.nls.enlargeView);this.own(c(this.magnifyNode,"click",d.hitch(this,this.magnifyTable)));this.config.showExportButton&&(f.set(this.exportNode,
"title",this.nls.exportOutput),q.set(this.exportNode,"display",""),this.own(c(this.exportNode,"click",d.hitch(this,this._showActions))));E=m.map(E,function(B){return{label:B.alias||B.name,field:B.name}});var D;m.some(this.value.fields,function(B){if("esriFieldTypeOID"===B.type)return D=B.name,!0});w=new k({data:w,idProperty:D});this.table=new (H([h,g]))({columns:E,store:w});n.place(this.table.domNode,this.tableNode)}else q.set(this.clearNode,"display","none"),q.set(this.exportNode,"display","none"),
q.set(this.magnifyNode,"display","none"),this.tableNode.innerHTML=this.nls.emptyResult},startup:function(){this.inherited(arguments);this.table.startup()},_showActions:function(E){this.popupMenu.prepareActions(this.value,this.config.showExportButton).then(d.hitch(this,function(){var w=a.position(E.target);this.popupMenu.show(w)}))},magnifyTable:function(){var E=n.create("div",{"class":"gp-table-magnified"});n.place(this.table.domNode,E);(new p({content:E,titleLabel:this.param.tooltip||this.param.label||
"",container:"main-page",customPosition:{top:"5%",left:"5%",width:"90%",height:"90%"},onClose:d.hitch(this,function(){n.place(this.table.domNode,this.tableNode);this.table.resize()})})).startup();this.table.resize()}})})},"dgrid/extensions/ColumnResizer":function(){define("dojo/_base/declare dojo/on dojo/query dojo/_base/lang dojo/dom dojo/dom-geometry dojo/has ../util/misc put-selector/put dojo/_base/html xstyle/css!../css/extensions/ColumnResizer.css".split(" "),function(H,d,m,n,q,f,c,a,b){function k(p){for(var v=
p.length,z=v,u=p[0].length,E=Array(v);v--;)E[v]=Array(u);var w={};for(v=0;v<z;v++)for(var F=E[v],y=p[v],D=0,B=0;D<u;D++){var x=y[B];if("undefined"==typeof F[D]){F[D]=x.id;if(x.rowSpan&&1<x.rowSpan){var r=E;for(var t=x.rowSpan,C=v,J=D,L=x.id,P=1;P<t;P++)r[C+P][J]=L}if(0<v&&x.colSpan&&1<x.colSpan)for(r=1;r<x.colSpan;r++)if(F[++D]=x.id,x.rowSpan&&1<x.rowSpan){t=E;C=x.rowSpan;J=v;L=D;P=x.id;for(var U=1;U<C;U++)t[J+U][L]=P}w[x.id]=p[0][D].id;B++}}return w}function h(p,v,z,u,E){if(!(0>=z)){var w=p.columns[v];
if(w){var F={grid:p,columnId:v,width:z,bubbles:!0,cancelable:!0};u&&(F.parentType=u);if(!p._resizedColumns||d.emit(p.headerNode,"dgrid-columnresize",F))return"auto"===z?delete w.width:(w.width=z,z+="px"),(u=p._columnSizes[v])?u.set("width",z):u=a.addCssRule("#"+a.escapeCssIdentifier(p.domNode.id)+" .dgrid-column-"+a.escapeCssIdentifier(v,"-"),"width: "+z+";"),p._columnSizes[v]=u,!1!==E&&p.resize(),!0}}}var g,e=0,l={create:function(){g=b("div.dgrid-column-resizer")},destroy:function(){b(g,"!");g=null},
show:function(p){p=f.position(p.domNode,!0);g.style.top=p.y+"px";g.style.height=p.h+"px";b(document.body,g)},move:function(p){g.style.left=p+"px"},hide:function(){g.parentNode.removeChild(g)}};return H("dgrid.extensions.ColumnResizer",null,{resizeNode:null,minWidth:40,adjustLastColumn:!0,_resizedColumns:!1,buildRendering:function(){this.inherited(arguments);e++||l.create()},destroy:function(){this.inherited(arguments);for(var p in this._columnSizes)this._columnSizes[p].remove();--e||l.destroy()},
resizeColumnWidth:function(p,v){return h(this,p,v)},configStructure:function(){var p=this._oldColumnSizes=n.mixin({},this._columnSizes),v;this._resizedColumns=!1;this._columnSizes={};this.inherited(arguments);for(v in p)v in this._columnSizes||p[v].remove();delete this._oldColumnSizes},_configColumn:function(p){this.inherited(arguments);var v=p.id,z;"width"in p&&((z=this._oldColumnSizes[v])?z.set("width",p.width+"px"):z=a.addCssRule("#"+a.escapeCssIdentifier(this.domNode.id)+" .dgrid-column-"+a.escapeCssIdentifier(v,
"-"),"width: "+p.width+"px;"),this._columnSizes[v]=z)},renderHeader:function(){this.inherited(arguments);var p=this;if(this.columnSets&&this.columnSets.length)for(var v=this.columnSets.length;v--;)var z=n.mixin(z||{},k(this.columnSets[v]));else this.subRows&&1<this.subRows.length&&(z=k(this.subRows));v=m(".dgrid-cell",p.headerNode);for(var u=v.length;u--;){var E=v[u],w=E.columnId,F=p.columns[w],y=E.childNodes;if(F&&!1!==F.resizable){F=b("div.dgrid-resize-header-container");for(E.contents=F;0<y.length;)b(F,
y[0]);b(E,F,"div.dgrid-resize-handle.resizeNode-"+a.escapeCssIdentifier(w,"-")).columnId=z&&z[w]||w}}p.mouseMoveListen||(d(p.headerNode,".dgrid-resize-handle:mousedown"+(c("touch")?",.dgrid-resize-handle:touchstart":""),function(D){p._resizeMouseDown(D,this);p.mouseMoveListen.resume();p.mouseUpListen.resume()}),p._listeners.push(p.mouseMoveListen=d.pausable(document,"mousemove"+(c("touch")?",touchmove":""),a.throttleDelayed(function(D){p._updateResizerPosition(D)}))),p._listeners.push(p.mouseUpListen=
d.pausable(document,"mouseup"+(c("touch")?",touchend":""),function(D){p._resizeMouseUp(D);p.mouseMoveListen.pause();p.mouseUpListen.pause()})),p.mouseMoveListen.pause(),p.mouseUpListen.pause())},_resizeMouseDown:function(p,v){p.preventDefault();q.setSelectable(this.domNode,!1);this._startX=this._getResizeMouseLocation(p);this._targetCell=m(".dgrid-column-"+a.escapeCssIdentifier(v.columnId,"-"),this.headerNode)[0];this._updateResizerPosition(p);l.show(this)},_resizeMouseUp:function(p){var v=this._columnSizes,
z;this.adjustLastColumn&&(z=this.headerNode.clientWidth-1);if(!this._resizedColumns){var u=m(".dgrid-cell",this.headerNode);this.columnSets&&this.columnSets.length?u=u.filter(function(x){return"0"==x.columnId.split("-")[0]&&!(x.columnId in v)}):this.subRows&&1<this.subRows.length&&(u=u.filter(function(x){return"0"==x.columnId.charAt(0)&&!(x.columnId in v)}));var E=u.map(function(x){return x.offsetWidth});u.forEach(function(x,r){h(this,x.columnId,E[r],null,!1)},this);this._resizedColumns=!0}q.setSelectable(this.domNode,
!0);u=this._targetCell;var w=this._getResizeMouseLocation(p)-this._startX,F=u.offsetWidth+w,y=this._getResizedColumnWidths(),D=y.totalWidth;y=y.lastColId;var B=m(".dgrid-column-"+a.escapeCssIdentifier(y,"-"),this.headerNode)[0].offsetWidth;F<this.minWidth&&(F=this.minWidth);h(this,u.columnId,F,p.type)&&u.columnId!=y&&this.adjustLastColumn&&(D+w<z?h(this,y,"auto",p.type):B-w<=this.minWidth&&h(this,y,this.minWidth,p.type));l.hide();delete this._startX;delete this._targetCell},_updateResizerPosition:function(p){if(this._targetCell){p=
this._getResizeMouseLocation(p);var v=this._targetCell.offsetWidth,z=p;v+(p-this._startX)<this.minWidth&&(z=this._startX-(v-this.minWidth));l.move(z)}},_getResizeMouseLocation:function(p){var v=0;p.pageX?v=p.pageX:p.clientX&&(v=p.clientX+document.body.scrollLeft+document.documentElement.scrollLeft);return v},_getResizedColumnWidths:function(){var p=0,v=m((this.columnSets?".dgrid-column-set-cell ":"")+"tr:first-child .dgrid-cell",this.headerNode),z=v.length;if(!z)return{};for(var u=v[z-1].columnId;z--;)p+=
v[z].offsetWidth;return{totalWidth:p,lastColId:u}}})})},"widgets/Geoprocessing/resultrenderers/ResultImageLayerRenderer":function(){define("dojo/_base/declare dojo/_base/lang dojo/dom-style dojo/on dijit/_TemplatedMixin dojo/text!./ResultImageLayerRenderer.html ../BaseResultRenderer".split(" "),function(H,d,m,n,q,f,c){return H([c,q],{baseClass:"jimu-gp-resultrenderer-base jimu-gp-renderer-draw-feature",templateString:f,postCreate:function(){this.inherited(arguments);this.layer&&(this._displayText(),
this._addResultLayer(this.layer))},destroy:function(){this.layer&&(this.map.removeLayer(this.layer),this.layer=null);this.inherited(arguments)},_displayText:function(){m.set(this.clearNode,"display","");this.own(n(this.clearNode,"click",d.hitch(this,function(){this.layer&&(this.map.infoWindow.isShowing&&this.map.infoWindow.hide(),this.map.removeLayer(this.layer),this.layer=null);m.set(this.clearNode,"display","none");m.set(this.domNode,"display","none")})))},_addResultLayer:function(a){this.map.addLayers([a])}})})},
"widgets/Geoprocessing/_build-generate_module":function(){define(["dojo/text!./Widget.html","dojo/text!./css/style.css","dojo/i18n!./nls/strings"],function(){})},"url:widgets/Geoprocessing/editors/FeatureSetEditorChooser.html":'\x3cdiv\x3e\r\n  \x3cdiv class\x3d"field" data-dojo-attach-point\x3d"mapModeWrapper"\x3e\r\n    \x3cinput id\x3d"gpFSModeMap" name\x3d"mode" data-dojo-type\x3d"dijit/form/RadioButton" data-dojo-attach-point\x3d"mapMode" class\x3d"jimu-leading-margin10"\x3e\r\n    \x3clabel for\x3d"gpFSModeMap" style\x3d"width: auto;" class\x3d"jimu-leading-margin025"\x3e${nls.useCurrentMapExtent}\x3c/label\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"field"\x3e\r\n    \x3cinput id\x3d"gpFSModeDraw" name\x3d"mode" data-dojo-type\x3d"dijit/form/RadioButton" data-dojo-attach-point\x3d"drawMode" class\x3d"jimu-leading-margin10"\x3e\r\n    \x3clabel for\x3d"gpFSModeDraw" style\x3d"width: auto;" class\x3d"jimu-leading-margin025"\x3e${nls.drawOnMap}\x3c/label\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"field"\x3e\r\n    \x3cinput id\x3d"gpFSModeFile" name\x3d"mode" data-dojo-type\x3d"dijit/form/RadioButton" data-dojo-attach-point\x3d"fileMode" class\x3d"jimu-leading-margin10"\x3e\r\n    \x3clabel for\x3d"gpFSModeFile" style\x3d" width: auto;" class\x3d"jimu-leading-margin025"\x3e${nls.useShapefile}\x3c/label\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"field"\x3e\r\n    \x3cinput id\x3d"gpFSModeLayer" name\x3d"mode" data-dojo-type\x3d"dijit/form/RadioButton" data-dojo-attach-point\x3d"layersMode" class\x3d"jimu-leading-margin10"\x3e\r\n    \x3clabel for\x3d"gpFSModeLayer" style\x3d" width: auto;" class\x3d"jimu-leading-margin025"\x3e${nls.selectLayer}\x3c/label\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"field" style\x3d"height: 60px;"\x3e\r\n    \x3cinput id\x3d"gpFSModeURL" name\x3d"mode" data-dojo-type\x3d"dijit/form/RadioButton" data-dojo-attach-point\x3d"urlMode" class\x3d"jimu-leading-margin10"\x3e\r\n    \x3clabel for\x3d"gpFSModeURL" style\x3d"width: auto" class\x3d"jimu-leading-margin025"\x3e${nls.url}\x3c/label\x3e\r\n    \x3cdiv style\x3d"margin-top:5px;display:none;" data-dojo-attach-point\x3d"urlOptionsDiv"\x3e\r\n      \x3cinput name\x3d"mode" data-dojo-type\x3d"jimu/dijit/URLInput" data-dojo-attach-point\x3d"featureSetUrl" class\x3d"jimu-leading-margin10" style\x3d"display: inline-block;"\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"visibleCheckboxDiv" style\x3d"display: inline-block;"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"symbolChooserSection"\x3e\r\n    \x3clabel\x3e${nls.symbol}:\x3c/label\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"symbolChooserNode"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"layerOptionSection"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"layerOptionCheckboxDiv"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/Geoprocessing/editors/FeatureSetResultEditor.html":'\x3cdiv\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"rendererTab"\x3e\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"popupConfigTab"\x3e\r\n    \x3cdiv style\x3d"margin: 10px"\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"enablePopupNode"\x3e\x3c/div\x3e \x3clabel\x3e${nls.enablePopup}\x3c/label\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',"url:jimu/dijit/templates/RendererChooser.html":'\x3cdiv\x3e\r\n\t\x3ctable\x3e\r\n\t\t\x3ctbody\x3e\r\n\t\t\t\x3ctr\x3e\r\n\t\t\t\t\x3ctd class\x3d"leading-td"\x3e\r\n\t\t\t\t\t\x3cdiv class\x3d"setting-section" style\x3d"display:inline-block;width:263px;"\x3e\r\n\t\t\t\t\t\t\x3ctable class\x3d"renderer-setting-table" cellpadding\x3d"0" cellspacing\x3d"0"\x3e\r\n\t\t\t\t\t\t\t\x3ccolgroup\x3e\r\n\t\t\t\t\t\t\t\t\x3ccol width\x3d"auto"\x3e\x3c/col\x3e\r\n\t\t\t\t\t\t\t\t\x3ccol width\x3d"180px"\x3e\x3c/col\x3e\r\n\t\t\t\t\t\t    \x3c/colgroup\x3e\r\n\t\t\t\t\t\t\t\x3ctbody\x3e\r\n\t\t\t\t\t\t\t\t\x3ctr data-dojo-attach-point\x3d"rendererSelectTr"\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctd class\x3d"first-td"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cspan\x3e${nls.use}:\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cselect data-dojo-attach-point\x3d"rendererSelect" class\x3d"render-select" data-dojo-type\x3d"dijit/form/Select" style\x3d"width:100%;height:30px;"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3coption value\x3d"simple" selected\x3dtrue\x3e${nls.singleSymbol}\x3c/option\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3coption value\x3d"unique"\x3e${nls.uniqueSymbol}\x3c/option\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3coption value\x3d"color"\x3e${nls.color}\x3c/option\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3coption value\x3d"size"\x3e${nls.size}\x3c/option\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3c/select\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\x3c/tr\x3e\r\n\t\t\t\t\t\t\t\t\x3ctr data-dojo-attach-point\x3d"fieldSelectTr" style\x3d"display:none;"\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctd class\x3d"first-td"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cspan\x3e${nls.toShow}:\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctd class\x3d"field-combobox-td"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"fieldComboBox" data-dojo-type\x3d"dijit/form/ComboBox" class\x3d"dijit-form-CombBox" style\x3d"width:100%;"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3c/div\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\x3c/tr\x3e\r\n\t\t\t\t\t\t\t\t\x3ctr data-dojo-attach-point\x3d"colorBlockTr" style\x3d"display:none;"\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctd class\x3d"first-td"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cspan\x3e${nls.colors}:\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"uniqueColorSelect" data-dojo-type\x3d"dijit/form/Select" style\x3d"width:100%;height:30px;"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d\'color1\'\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg  style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/c1.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d\'color2\'\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg  style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/c2.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d\'color3\'\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg  style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/c3.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d\'color4\'\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg  style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/c4.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d\'color5\'\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg  style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/c5.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d\'color6\'\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg  style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/c6.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3c/div\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\x3c/tr\x3e\r\n\t\t\t\t\t\t\t\t\x3ctr data-dojo-attach-point\x3d"domainTr" style\x3d"display:none;"\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctd class\x3d"first-td"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cspan\x3e${nls.domain}:\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cinput data-dojo-attach-point\x3d"minDomain" type\x3d"text" data-dojo-type\x3d"dijit/form/NumberTextBox" required\x3d"true" value\x3d"0"\r\n\t\t\t\t\t\t\t\t\t\t style\x3d"width:60px;" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cspan\x3e  \u2014  \x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cinput data-dojo-attach-point\x3d"maxDomain" type\x3d"text" data-dojo-type\x3d"dijit/form/NumberTextBox" required\x3d"true" value\x3d"0"\r\n\t\t\t\t\t\t\t\t\t\t style\x3d"width:60px;" /\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\x3c/tr\x3e\r\n\t\t\t\t\t\t\t\t\x3ctr data-dojo-attach-point\x3d"classCountTr" style\x3d"display:none;"\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctd class\x3d"first-td"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cspan\x3e${nls.classes}:\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cinput data-dojo-attach-point\x3d"classCount" data-dojo-type\x3d"dijit/form/NumberSpinner" style\x3d"display:inline-block;width:100px;"\r\n\t\t\t\t\t\t\t\t\t\tdata-dojo-props\x3d\'value:5,smallDelta:1,constraints:{min:2,max:20},intermediateChanges:true\' /\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\x3c/tr\x3e\r\n\t\t\t\t\t\t\t\t\x3ctr data-dojo-attach-point\x3d"colorBarTr" style\x3d"display:none;"\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctd class\x3d"first-td"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cspan\x3e${nls.colors}:\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"classBreaksColorSelect" data-dojo-type\x3d"dijit/form/Select" style\x3d"width:100%;height:30px;"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color1"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb1.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color2"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb2.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color3"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb3.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color4"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb4.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color5"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb5.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color6"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb6.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color7"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb7.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color8"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb8.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color9"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb9.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color10"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb10.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color11"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb11.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color12"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb12.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color13"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb13.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color14"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb14.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color15"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb15.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color16"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb16.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color17"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb17.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color18"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb18.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color19"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb19.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color20"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb20.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color21"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb21.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color22"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb22.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color23"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb23.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color24"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb24.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color25"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb25.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color26"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb26.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-value\x3d"color27"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cimg style\x3d"width:140px;height:20px;vertical-align: middle;margin-top: 1px;margin-bottom:1px;" src\x3d"${_jimuUrl}/css/images/symbol/cb27.png" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3c/div\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\x3c/tr\x3e\r\n\t\t\t\t\t\t\t\t\x3ctr data-dojo-attach-point\x3d"symbolSizeDomainTr" style\x3d"display:none;"\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctd class\x3d"first-td"\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cspan\x3e${nls.symbolSize}:\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cinput data-dojo-attach-point\x3d"minSymbolSize" type\x3d"text" data-dojo-type\x3d"dijit/form/NumberTextBox" required\x3d"true" value\x3d"5" data-dojo-props\x3d"constraints:{min:1,max:50,places:0}" style\x3d"width:60px;" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cspan\x3e  \u2014  \x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3cinput data-dojo-attach-point\x3d"maxSymbolSize" type\x3d"text" data-dojo-type\x3d"dijit/form/NumberTextBox" required\x3d"true" value\x3d"30" data-dojo-props\x3d"constraints:{min:1,max:50,places:0}"  style\x3d"width:60px;" /\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\x3c/tr\x3e\r\n\t\t\t\t\t\t\t\x3c/tbody\x3e\r\n\t\t\t\t\t\t\x3c/table\x3e\r\n\t\t\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"uniqueSetting" style\x3d"display:none;"\x3e\r\n\t\t\t\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"uniqueValueDiv" class\x3d"unique-value-div"\x3e\r\n\t\t\t\t\t\t\t\t\x3ctable class\x3d"unique-symbol-table" style\x3d"width:100%;"\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctbody data-dojo-attach-point\x3d"uniqueSysTbody"\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/tbody\x3e\r\n\t\t\t\t\t\t\t\t\x3c/table\x3e\r\n\t\t\t\t\t\t\t\x3c/div\x3e\r\n\t\t\t\t\t\t\t\x3cdiv\x3e\r\n\t\t\t\t\t\t\t\t\x3cdiv style\x3d"padding-top:20px; margin-bottom:5px;"\x3e${nls.addValue}:\x3c/div\x3e\r\n\t\t\t\t\t\t\t\t\x3cdiv\x3e\r\n\t\t\t\t\t\t\t\t\t\x3cinput data-dojo-attach-point\x3d"uniqueEditValue" type\x3d"text" /\x3e\r\n\t\t\t\t\t\t\t\t\t\x3cspan data-dojo-attach-point\x3d"btnAddUniqueValue" class\x3d"jimu-icon jimu-icon-add"\r\n\t\t\t\t\t\t\t\t\t style\x3d\'cursor:pointer;position:relative;top:3px;\'\x3e\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\x3c/div\x3e\r\n\t\t\t\t\t\t\t\x3c/div\x3e\r\n\t\t\t\t\t\t\x3c/div\x3e\r\n\t\t\t\t\t\t\x3cdiv class\x3d"class-breaks-div" data-dojo-attach-point\x3d"classBreaksSetting" style\x3d"display:none;"\x3e\r\n\t\t\t\t\t\t\t\x3ctable class\x3d"class-breaks-table" style\x3d"width:100%;"\x3e\r\n\t\t\t\t\t\t\t\t\x3ctbody data-dojo-attach-point\x3d"classBreaksTbody"\x3e\r\n\t\t\t\t\t\t\t\t\x3c/tbody\x3e\r\n\t\t\t\t\t\t\t\x3c/table\x3e\r\n\t\t\t\t\t\t\x3c/div\x3e\r\n\t\t\t\t\t\x3c/div\x3e\r\n\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\x3ctd class\x3d"trailing-td"\x3e\r\n\t\t\t\t\t\x3cdiv class\x3d"symbol-section" style\x3d"display:inline-block;"\x3e\r\n\t\t\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"defaultSymSection"\x3e\r\n\t\t\t\t\t\t\t\x3cdiv\x3e${nls.defaultSymbol}\x3c/div\x3e\r\n\t\t\t\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"defaultSymbolChooser" data-dojo-type\x3d"jimu/dijit/SymbolChooser"\x3e\x3c/div\x3e\r\n\t\t\t\t\t\t\x3c/div\x3e\r\n\t\t\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"selectedSymSection" style\x3d"display:none;"\x3e\r\n\t\t\t\t\t\t\t\x3cdiv\x3e${nls.selectedSymbol}\x3c/div\x3e\r\n\t\t\t\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"uniqueSelectedSymInfoSet" style\x3d"display:none;"\x3e\r\n\t\t\t\t\t\t\t\t\x3ctable style\x3d"width:100%;"\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctbody\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3ctr\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cspan\x3e${nls.value}:\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cinput data-dojo-attach-point\x3d"uniqueSelectedValue" type\x3d"text" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3c/tr\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3ctr\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cspan\x3e${nls.label}:\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cinput data-dojo-attach-point\x3d"uniqueSelectedLabel" type\x3d"text" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3c/tr\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/tbody\x3e\r\n\t\t\t\t\t\t\t\t\x3c/table\x3e\r\n\t\t\t\t\t\t\t\x3c/div\x3e\r\n\t\t\t\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"classBreaksSelectedInfoSet" style\x3d"display:none;"\x3e\r\n\t\t\t\t\t\t\t\t\x3ctable style\x3d"width:100%;margin-top:10px;"\x3e\r\n\t\t\t\t\t\t\t\t\t\x3ctbody\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3ctr\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cspan\x3e${nls.range}:\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cinput data-dojo-attach-point\x3d"selectedFrom" type\x3d"text" data-dojo-type\x3d"dijit/form/NumberTextBox" required\x3d"true" value\x3d"0" style\x3d"width:60px;" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cspan\x3e  \u2014  \x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cinput data-dojo-attach-point\x3d"selectedTo" type\x3d"text" data-dojo-type\x3d"dijit/form/NumberTextBox" required\x3d"true" value\x3d"0"  style\x3d"width:60px;" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3c/tr\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3ctr\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cspan\x3e${nls.label}:\x3c/span\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\t\x3cinput data-dojo-attach-point\x3d"classBreakSelectedLabel" type\x3d"text" /\x3e\r\n\t\t\t\t\t\t\t\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\t\t\t\t\t\t\x3c/tr\x3e\r\n\t\t\t\t\t\t\t\t\t\x3c/tbody\x3e\r\n\t\t\t\t\t\t\t\t\x3c/table\x3e\r\n\t\t\t\t\t\t\t\x3c/div\x3e\r\n\t\t\t\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"selectedSymbolChooser" data-dojo-type\x3d"jimu/dijit/SymbolChooser"\x3e\x3c/div\x3e\r\n\t\t\t\t\t\t\x3c/div\x3e\r\n\t\t\t\t\t\x3c/div\x3e\r\n\t\t\t\t\x3c/td\x3e\r\n\t\t\t\x3c/tr\x3e\r\n\t\t\x3c/tbody\x3e\r\n\t\x3c/table\x3e\r\n\x3c/div\x3e',
"url:widgets/Geoprocessing/PopupConfig.html":'\x3cdiv style\x3d"width:560px;"\x3e\r\n\t\x3ctable class\x3d"popup-config-layout" style\x3d"width:100%;table-layout:fixed;"\x3e\r\n\t\t\x3ccolgroup\x3e\r\n\t\t\t\x3ccol width\x3d"auto"\x3e\x3c/col\x3e\r\n\t\t\t\x3ccol width\x3d"370px"\x3e\x3c/col\x3e\r\n\t\t\t\x3ccol width\x3d"70px"\x3e\x3c/col\x3e\r\n\t\t\x3c/colgroup\x3e\r\n\t\t\x3ctbody\x3e\r\n\t\t\t\x3ctr data-dojo-attach-point\x3d"titleTR"\x3e\r\n\t\t\t\t\x3ctd nowrap\x3e\r\n\t\t\t\t\t\x3cspan\x3e${nls.title}\x3c/span\x3e\r\n\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\x3cinput data-dojo-attach-point\x3d"titleTextBox" data-dojo-type\x3d"dijit/form/TextBox" style\x3d"width:100%;" /\x3e\r\n\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"btnAdd" data-dojo-type\x3d"dijit/form/DropDownButton"\x3e\r\n\t\t\t\t\t\t\x3cspan\x3e${nls.add}\x3c/span\x3e\r\n\t\t\t\t\t\t\x3cdiv data-dojo-type\x3d"dijit/TooltipDialog"\x3e\r\n\t\t\t\t\t\t\t\x3cdiv data-dojo-attach-point\x3d"menu" data-dojo-type\x3d"dijit/Menu"\x3e\x3c/div\x3e\r\n\t\t\t\t\t\t\x3c/div\x3e\r\n\t\t\t\t\t\x3c/div\x3e\r\n\t\t\t\t\x3c/td\x3e\r\n\t\t\t\x3c/tr\x3e\r\n\t\t\t\x3ctr data-dojo-attach-point\x3d"fieldsTR"\x3e\r\n\t\t\t\t\x3ctd nowrap\x3e\r\n\t\t\t\t\t\x3cspan\x3e${nls.fields}\x3c/span\x3e\r\n\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\x3ctd colspan\x3d"2" data-dojo-attach-point\x3d"fieldsTableTd"\x3e\r\n\t\t\t\t\x3c/td\x3e\r\n\t\t\t\x3c/tr\x3e\r\n\t\t\x3c/tbody\x3e\r\n\t\x3c/table\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/Geoprocessing/editors/SelectFeatureSetFromUrl.html":'\x3cdiv\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"inputNode"\x3e\r\n    \x3cinput name\x3d"url" data-dojo-type\x3d"jimu/dijit/URLInput" data-dojo-attach-point\x3d"featureSetUrl"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"loadingNode" class\x3d"loading"\x3e\x3c/div\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"visibleCheckboxDiv"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"featuresetNode"\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:jimu/dijit/templates/SpatialFilterByFeatures.html":'\x3cdiv\x3e\r\n\t\x3cdiv class\x3d"layer-tip second-stress" data-dojo-attach-point\x3d"tipNode"\x3e${nls.relatedLayer}\x3c/div\x3e\r\n\t\x3ctable\x3e\r\n\t\t\x3ccolgroup\x3e\r\n\t\t\t\x3ccol width\x3d"auto"\x3e\x3c/col\x3e\r\n\t\t\t\x3ccol width\x3d"100"\x3e\x3c/col\x3e\r\n\t\t\x3c/colgroup\x3e\r\n\t\t\x3ctbody\x3e\r\n\t\t\t\x3ctr\x3e\r\n\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\x3cdiv class\x3d"layers-select-div" data-dojo-attach-point\x3d"layerSelectDiv"\x3e\x3c/div\x3e\r\n\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\x3cdiv class\x3d"jimu-float-trailing" data-dojo-attach-point\x3d"featureSetChooserDiv"\x3e\x3c/div\x3e\r\n\t\t\t\t\x3c/td\x3e\r\n\t\t\t\x3c/tr\x3e\r\n\t\t\x3c/tbody\x3e\r\n\t\x3c/table\x3e\r\n\r\n\t\x3cdiv class\x3d"selection-option not-visible" data-dojo-attach-point\x3d"selectionOptionDiv"\x3e\x3c/div\x3e\r\n\r\n\t\x3cdiv class\x3d"search-distance-div" data-dojo-attach-point\x3d"searchDistanceDiv"\x3e\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"loading" data-dojo-type\x3d"jimu/dijit/LoadingShelter" data-dojo-props\x3d\'hidden:true\'\x3e\x3c/div\x3e\r\n\x3c/div\x3e',
"url:jimu/dijit/templates/_TreeNode.html":'\x3cdiv class\x3d"dijitTreeNode" role\x3d"presentation"\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"rowNode" class\x3d"dijitTreeRow" role\x3d"presentation"\x3e\r\n\t\t\x3cspan data-dojo-attach-point\x3d"expandoNode" class\x3d"dijitInline dijitTreeExpando" role\x3d"presentation"\x3e\x3c/span\x3e\r\n\t\t\x3cspan data-dojo-attach-point\x3d"expandoNodeText" class\x3d"dijitExpandoText" role\x3d"presentation"\x3e\x3c/span\x3e\r\n\t\t\x3cspan data-dojo-attach-point\x3d"contentNode" class\x3d"dijitTreeContent" role\x3d"presentation"\x3e\r\n\t\t\t\x3cspan role\x3d"presentation" class\x3d"dijitInline dijitIcon dijitTreeIcon" data-dojo-attach-point\x3d"iconNode"\x3e\x3c/span\x3e\r\n\t\t\t\x3cspan data-dojo-attach-point\x3d"labelNode,focusNode" class\x3d"dijitTreeLabel" role\x3d"treeitem" tabindex\x3d"-1" aria-selected\x3d"false"\x3e\x3c/span\x3e\r\n\t\t\x3c/span\x3e\r\n\t\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"containerNode" class\x3d"dijitTreeNodeContainer" role\x3d"presentation" style\x3d"display: none;"\x3e\x3c/div\x3e\r\n\x3c/div\x3e',
"url:dijit/templates/TreeNode.html":'\x3cdiv class\x3d"dijitTreeNode" role\x3d"presentation"\r\n\t\x3e\x3cdiv data-dojo-attach-point\x3d"rowNode" class\x3d"dijitTreeRow" role\x3d"presentation"\r\n\t\t\x3e\x3cspan data-dojo-attach-point\x3d"expandoNode" class\x3d"dijitInline dijitTreeExpando" role\x3d"presentation"\x3e\x3c/span\r\n\t\t\x3e\x3cspan data-dojo-attach-point\x3d"expandoNodeText" class\x3d"dijitExpandoText" role\x3d"presentation"\x3e\x3c/span\r\n\t\t\x3e\x3cspan data-dojo-attach-point\x3d"contentNode"\r\n\t\t\tclass\x3d"dijitTreeContent" role\x3d"presentation"\x3e\r\n\t\t\t\x3cspan role\x3d"presentation" class\x3d"dijitInline dijitIcon dijitTreeIcon" data-dojo-attach-point\x3d"iconNode"\x3e\x3c/span\r\n\t\t\t\x3e\x3cspan data-dojo-attach-point\x3d"labelNode,focusNode" class\x3d"dijitTreeLabel" role\x3d"treeitem"\r\n\t\t\t\t   tabindex\x3d"-1" aria-selected\x3d"false" id\x3d"${id}_label"\x3e\x3c/span\x3e\r\n\t\t\x3c/span\r\n\t\x3e\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"containerNode" class\x3d"dijitTreeNodeContainer" role\x3d"presentation"\r\n\t\t style\x3d"display: none;" aria-labelledby\x3d"${id}_label"\x3e\x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:dijit/templates/Tree.html":'\x3cdiv role\x3d"tree"\x3e\r\n\t\x3cdiv class\x3d"dijitInline dijitTreeIndent" style\x3d"position: absolute; top: -9999px" data-dojo-attach-point\x3d"indentDetector"\x3e\x3c/div\x3e\r\n\t\x3cdiv class\x3d"dijitTreeExpando dijitTreeExpandoLoading" data-dojo-attach-point\x3d"rootLoadingIndicator"\x3e\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"containerNode" class\x3d"dijitTreeContainer" role\x3d"presentation"\x3e\r\n\t\x3c/div\x3e\r\n\x3c/div\x3e\r\n',"url:jimu/dijit/templates/LayerChooserFromMapWithDropbox.html":'\x3cdiv\x3e\r\n\x3ctable role\x3d"listbox" aria-haspopup\x3d"true" data-dojo-attach-point\x3d"dropDownBtn" data-dojo-attach-event\x3d"onclick: _onDropDownClick,onkeydown: _onDropDownKeydown"\r\n  tabindex\x3d"0" title\x3d"${nls.customSelectLayer}" aria-label\x3d"${nls.customSelectLayer}"\x3e\r\n    \x3ccaption class\x3d"screen-readers-only-no-position"\x3e${nls.customSelectLayer}\x3c/caption\x3e\r\n    \x3ccolgroup\x3e\r\n      \x3ccol width\x3d"10px"\x3e\x3c/col\x3e\r\n      \x3ccol width\x3d"auto"\x3e\x3c/col\x3e\r\n      \x3ccol width\x3d"30px"\x3e\x3c/col\x3e\r\n    \x3c/colgroup\x3e\r\n    \x3ctbody\x3e\r\n      \x3ctr\x3e\r\n        \x3ctd\x3e\x3c/td\x3e\r\n        \x3ctd\x3e\r\n          \x3cdiv class\x3d"layer-name jimu-ellipsis" data-dojo-attach-point\x3d"layerNameNode"\x3e\x3c/div\x3e\r\n        \x3c/td\x3e\r\n        \x3ctd\x3e\r\n          \x3cdiv class\x3d"drop-select jimu-float-trailing" data-dojo-attach-point\x3d"dropArrowNode"\x3e\r\n            \x3cdiv class\x3d"jimu-icon jimu-icon-down-arrow-8"\x3e\x3c/div\x3e\r\n        \x3c/div\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',
"url:jimu/dijit/templates/SearchDistance.html":'\x3cdiv\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"cbxDiv"\x3e\x3c/div\x3e\r\n\t\x3ctable style\x3d"table-layout:fixed;width:100%;"\x3e\r\n\t\t\x3ccolgroup\x3e\r\n\t\t\t\x3ccol width\x3d"auto"\x3e\x3c/col\x3e\r\n\t\t\t\x3ccol width\x3d"15px"\x3e\x3c/col\x3e\r\n\t\t\t\x3ccol width\x3d"auto"\x3e\x3c/col\x3e\r\n\t\t\x3c/colgroup\x3e\r\n\t\t\x3ctbody\x3e\r\n\t\t\t\x3ctr\x3e\r\n\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\x3cinput data-dojo-attach-point\x3d"numberTextBox" data-dojo-type\x3d"dijit/form/NumberTextBox"\r\n\t\t\t\t\t data-dojo-props\x3d\'"required":true,intermediateChanges:false,constraints:{min:0,pattern:"#####0.##########"}\'\r\n\t\t\t\t\t style\x3d"width:100%;" data-dojo-attach-event\x3d"change:_onNumberTextBoxChanged" /\x3e\r\n\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\x3ctd\x3e\x3c/td\x3e\r\n\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\x3cselect data-dojo-type\x3d"jimu/dijit/formSelect" data-dojo-attach-point\x3d"unitSelect"\r\n\t\t\t\t\tdata-dojo-attach-event\x3d"change:_onUnitSelectChanged" style\x3d"width:100%;"\x3e\r\n\t\t\t\t\t\t\x3coption value\x3d"MILES" selected\x3e${nls.miles}\x3c/option\x3e\r\n\t\t\t\t\t\t\x3coption value\x3d"KILOMETERS"\x3e${nls.kilometers}\x3c/option\x3e\r\n\t\t\t\t\t\t\x3coption value\x3d"FEET"\x3e${nls.feet}\x3c/option\x3e\r\n\t\t\t\t\t\t\x3coption value\x3d"METERS"\x3e${nls.meters}\x3c/option\x3e\r\n\t\t\t\t\t\t\x3coption value\x3d"YARDS"\x3e${nls.yards}\x3c/option\x3e\r\n\t\t\t\t\t\t\x3coption value\x3d"NAUTICAL_MILES"\x3e${nls.nauticalMiles}\x3c/option\x3e\r\n\t\t\t\t\t\x3c/select\x3e\r\n\t\t\t\t\x3c/td\x3e\r\n\t\t\t\x3c/tr\x3e\r\n\t\t\x3c/tbody\x3e\r\n\t\x3c/table\x3e\r\n\x3c/div\x3e',
"url:widgets/Geoprocessing/editors/SelectFeatureSetFromLayer.html":'\x3cdiv\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"inputNode"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"layerChooseNode"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"featuresetNode"\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',"url:esri/dijit/templates/SingleFilter.html":'\x3cdiv class\x3d"esriSingleFilterForm singleFilter" id\x3d"${id}.singleFilter"\x3e\r\n  \x3cdiv\x3e\r\n    \x3ctable id\x3d"${id}.exprTable" class\x3d"rowTable" cellpadding\x3d"0" cellspacing\x3d"0"\x3e\r\n      \x3ctbody\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd valign\x3d"top" nowrap\x3e\r\n            \x3cdiv id\x3d"${id}.column1"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd valign\x3d"top" nowrap\x3e\r\n            \x3cdiv id\x3d"${id}.column2"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd valign\x3d"top" nowrap\x3e\r\n            \x3cdiv id\x3d"${id}.column3"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd valign\x3d"top" nowrap\x3e\r\n            \x3cdiv id\x3d"${id}.column4"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd valign\x3d"top" nowrap\x3e\r\n            \x3cdiv id\x3d"${id}.column5"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd valign\x3d"top" nowrap\x3e\r\n            \x3cdiv id\x3d"${id}.column6"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd valign\x3d"top" nowrap\x3e\r\n            \x3cdiv id\x3d"${id}.column7"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd valign\x3d"top" nowrap\x3e\r\n            \x3ca id\x3d"${id}.deleteExpression" href\x3d"JavaScript:void(0);" style\x3d"margin:0 5px;display:none;" class\x3d"esriAGOFilterRemoveIcon" title\x3d"${i18n.deleteExpression}"\x3e\x3c/a\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr data-dojo-attach-point\x3d"_interactiveFilterRow"\x3e\r\n          \x3ctd colspan\x3d"8"\x3e\r\n            \x3ctable cellpadding\x3d"0" cellspacing\x3d"0" class\x3d"interactiveFilter"\x3e\r\n              \x3ctbody\x3e\r\n                \x3ctr\x3e\r\n                  \x3ctd nowrap\x3d"nowrap"\x3e\r\n                    \x3ctable cellpadding\x3d"0" cellspacing\x3d"0"\x3e\r\n                      \x3ctbody\x3e\r\n                        \x3ctr\x3e\r\n                          \x3ctd nowrap\x3d"nowrap"\x3e\r\n                            \x3cinput dojoAttachPoint\x3d"interactiveCheck" type\x3d"checkbox" class\x3d"promptCheckBox" title\x3d"${i18n.promptMsg}"/\x3e\r\n                          \x3c/td\x3e\r\n                          \x3ctd nowrap\x3d"nowrap"\x3e\r\n                            \x3clabel class\x3d"labels" for\x3d"promptCheckBox"\x3e\r\n                              \x26nbsp;\x26nbsp;${i18n.askForValues}\r\n                            \x3c/label\x3e\r\n                          \x3c/td\x3e\r\n                          \x3ctd\x3e\r\n                            \x3cspan dojoAttachPoint\x3d"interactiveArrow" style\x3d"color:#cbcbcb;cursor:pointer;" class\x3d"showHidePromptDiv"\x3e\x26nbsp;\x26#9660;\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/td\x3e\r\n                \x3c/tr\x3e\r\n                \x3ctr dojoAttachPoint\x3d"interactiveSpace" style\x3d"display:none"\x3e\r\n                  \x3ctd nowrap\x3d"nowrap"\x3e\r\n                    \x3ctable cellpadding\x3d"0" cellspacing\x3d"0"\x3e\r\n                      \x3ctbody\x3e\r\n                        \x3ctr\x3e\r\n                          \x3ctd nowrap\x3d"nowrap"\x3e\r\n                            ${i18n.prompt}\r\n                          \x3c/td\x3e\r\n                          \x3ctd width\x3d"10"\x3e\r\n                            \x26nbsp;\r\n                          \x3c/td\x3e\r\n                          \x3ctd\x3e\r\n                            \x3cdiv dojoAttachPoint\x3d"promptText" dojotype\x3d"dijit.form.TextBox" intermediateChanges\x3d"true" style\x3d"width:250px;"\x3e\r\n                            \x3c/div\x3e\r\n                          \x3c/td\x3e\r\n                        \x3c/tr\x3e\r\n                        \x3ctr\x3e\r\n                          \x3ctd nowrap\x3d"nowrap"\x3e\r\n                            ${i18n.hint}\r\n                          \x3c/td\x3e\r\n                          \x3ctd width\x3d"10"\x3e\r\n                            \x26nbsp;\r\n                          \x3c/td\x3e\r\n                          \x3ctd\x3e\r\n                            \x3cdiv dojoAttachPoint\x3d"hintText" dojotype\x3d"dijit.form.TextBox" intermediateChanges\x3d"true" style\x3d"width:250px;"\x3e\r\n                            \x3c/div\x3e\r\n                          \x3c/td\x3e\r\n                        \x3c/tr\x3e\r\n                      \x3c/tbody\x3e\r\n                    \x3c/table\x3e\r\n                  \x3c/td\x3e\r\n                \x3c/tr\x3e\r\n              \x3c/tbody\x3e\r\n            \x3c/table\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  \x3cdiv class\x3d"promptDiv" style\x3d"display:none;padding:10px 0px;"\x3e\r\n    \x3clabel class\x3d"labels promptLabels" for\x3d"txtPrompt"\x3e\r\n      ${i18n.prompt}\r\n    \x3c/label\x3e\r\n    \x3cinput class\x3d"promptFields txtPrompt" type\x3d"text"/\x3e\r\n    \x3cbr/\x3e\r\n    \x3clabel class\x3d"labels promptLabels" for\x3d"txtHint"\x3e\r\n      ${i18n.hint}\r\n    \x3c/label\x3e\r\n    \x3cinput class\x3d"promptFields txtHint" type\x3d"text" /\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/Geoprocessing/editors/SelectFeatureSetFromFile.html":'\x3cdiv\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"inputNode"\x3e\r\n    \x3cdiv class\x3d"jimu-r-row" style\x3d"margin-top: 10px;"\x3e\r\n      \x3cdiv class\x3d"col-1-2"\x3e\r\n        \x3cform data-dojo-attach-point\x3d"fileForm"\r\n            enctype\x3d"multipart/form-data"\r\n            method\x3d"POST" data-dojo-type\x3d"dijit/form/Form"\x3e\r\n          \x3cinput id\x3d"${uniqueID}_fs_file" type\x3d"file" multiple\x3d"false" name\x3d"file"\r\n            data-dojo-attach-point\x3d"fileInput" accept\x3d"application/zip"\r\n            data-dojo-attach-event\x3d"onChange: _onUpload" style\x3d"display:none"/\x3e\r\n          \x3cdiv class\x3d"jimu-btn jimu-leading-margin10 jimu-float-leading"\x3e\r\n            \x3clabel class\x3d"file-input-label" for\x3d"${uniqueID}_fs_file"\x3e\r\n              ${nls.addShapefile}\r\n            \x3c/label\x3e\r\n          \x3c/div\x3e\r\n          \x3cinput type\x3d"hidden" name\x3d"f" value\x3d"json"/\x3e\r\n        \x3c/form\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"col-1-2"\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"clearLink"\r\n          data-dojo-attach-event\x3d"onClick: _clear"\r\n          class\x3d"jimu-float-trailing shp-clear"\x3e${nls.clear}\x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"jimu-r-row" style\x3d"margin-top: 10px;"\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"checkboxNode"/\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"jimu-r-row shp-info"\x3e\r\n      \x3cimg data-dojo-attach-point\x3d"uploadStatus" class\x3d"upload-status" src\x3d""/\x3e\r\n      \x3cspan data-dojo-attach-point\x3d"fileInfo"\x3e\x3c/span\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"featuresetNode"\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/Geoprocessing/editors/SelectFeatureSetFromDraw.html":'\x3cdiv\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"inputNode"\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"featuresetNode"\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n',"url:widgets/Geoprocessing/editors/DataFileEditor.html":'\x3cdiv\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"modeSelection" style\x3d"display:none"\x3e\r\n    \x3cdiv class\x3d"field"\x3e\r\n      \x3cinput name\x3d"${uniqueID}_dataFileMode" data-dojo-type\x3d"dijit/form/RadioButton" data-dojo-attach-point\x3d"urlMode"\r\n        style\x3d"font-size: 12px;" id\x3d"${uniqueID}_gpSettingFileUrl"\x3e\r\n        \x3clabel style\x3d"width: auto;" for\x3d"${uniqueID}_gpSettingFileUrl" class\x3d"jimu-leading-margin05"\x3e${nls.useUrlForGPInput}\x3c/label\x3e\r\n      \x3cinput name\x3d"${uniqueID}_dataFileMode" data-dojo-type\x3d"dijit/form/RadioButton" data-dojo-attach-point\x3d"itemMode"\r\n        style\x3d"font-size: 12px;" class\x3d"jimu-leading-margin35" id\x3d"${uniqueID}_gpSettingFileItem"\x3e\r\n      \x3clabel style\x3d"width: auto;"\r\n        class\x3d"jimu-leading-margin05" for\x3d"${uniqueID}_gpSettingFileItem"\x3e${nls.useUploadForGPInput}\x3c/label\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"settingNode"\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"urlNode" data-dojo-props\x3d"label:urlNode"\x3e\r\n        \x3cdiv\x3e\r\n          \x3cinput type\x3d"text" data-dojo-attach-point\x3d"urlEditor" style\x3d"width:100%"\r\n            data-dojo-type\x3d"jimu/dijit/URLInput" data-dojo-props\x3d"rest:false" class\x3d"common-input"/\x3e\r\n        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"fileNode" data-dojo-props\x3d"label:fileNode"\x3e\r\n        \x3cdiv\x3e\r\n          \x3cform data-dojo-attach-point\x3d"fileForm"\r\n                enctype\x3d"multipart/form-data"\r\n                method\x3d"POST" data-dojo-type\x3d"dijit/form/Form"\x3e\r\n            \x3cinput id\x3d"${uniqueID}_file" type\x3d"file" multiple\x3d"false" name\x3d"file"\r\n              data-dojo-attach-point\x3d"fileInput"\r\n              data-dojo-attach-event\x3d"onChange: _onUpload" style\x3d"display:none"/\x3e\r\n            \x3cdiv class\x3d"jimu-btn jimu-leading-margin10 jimu-float-leading"\x3e\r\n              \x3clabel class\x3d"file-input-label" for\x3d"${uniqueID}_file"\x3e\r\n                ${nls.selectFileToUpload}\r\n              \x3c/label\x3e\r\n            \x3c/div\x3e\r\n            \x3cinput type\x3d"hidden" name\x3d"f" value\x3d"json"/\x3e\r\n          \x3c/form\x3e\r\n          \x3cspan data-dojo-attach-point\x3d"uploadFileName" class\x3d"jimu-leading-margin2"\x3e\x3c/span\x3e\r\n        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/Geoprocessing/editors/RasterLayerEditor.html":'\x3cdiv\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"modeSelection" style\x3d"display:none"\x3e\r\n    \x3cdiv class\x3d"field"\x3e\r\n      \x3cinput id\x3d"${uniqueID}_gpRasterModeURL" name\x3d"${uniqueID}_rasterDataMode" data-dojo-type\x3d"dijit/form/RadioButton" data-dojo-attach-point\x3d"urlMode"\r\n        style\x3d"font-size: 10px;" class\x3d"jimu-leading-margin10"\x3e\r\n      \x3clabel for\x3d"${uniqueID}_gpRasterModeURL" style\x3d"width: auto;" class\x3d"jimu-leading-margin025"\x3e${nls.useUrlForGPInput}\x3c/label\x3e\r\n      \x3cinput id\x3d"${uniqueID}_gpRasterModeItem" name\x3d"${uniqueID}_rasterDataMode" data-dojo-type\x3d"dijit/form/RadioButton" data-dojo-attach-point\x3d"itemMode"\r\n        style\x3d"font-size: 10px;" class\x3d"jimu-leading-margin2"\x3e\r\n      \x3clabel for\x3d"${uniqueID}_gpRasterModeItem" style\x3d" width: auto;" class\x3d"jimu-leading-margin025"\x3e${nls.useUploadForGPInput}\x3c/label\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"settingNode"\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"urlNode" data-dojo-props\x3d"label:urlNode"\x3e\r\n        \x3ctable\x3e\r\n          \x3ctr\x3e\r\n            \x3ctd\x3e\x3clabel title\x3d"${nls.rasterFormat}"\x3e${nls.rasterFormat}\x3c/label\x3e\x3c/td\x3e\r\n            \x3ctd\x3e\x3cinput type\x3d"text" data-dojo-attach-point\x3d"rasterFormatInput"\r\n                data-dojo-type\x3d"dijit/form/TextBox" class\x3d"common-input"/\x3e\x3c/td\x3e\r\n          \x3c/tr\x3e\r\n          \x3ctr\x3e\r\n            \x3ctd\x3e\x3clabel title\x3d"${nls.url}"\x3e${nls.url}\x3c/label\x3e\x3c/td\x3e\r\n            \x3ctd\x3e\r\n            \x3cinput data-dojo-type\x3d"jimu/dijit/URLInput" data-dojo-props\x3d"rest:false"\r\n              data-dojo-attach-point\x3d"urlEditor" class\x3d"common-input"\x3e\x3c/td\x3e\r\n          \x3c/tr\x3e\r\n        \x3c/table\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"fileNode" data-dojo-props\x3d"label:fileNode"\x3e\r\n        \x3cdiv\x3e\r\n          \x3cform data-dojo-attach-point\x3d"fileForm"\r\n                enctype\x3d"multipart/form-data"\r\n                method\x3d"POST" data-dojo-type\x3d"dijit/form/Form"\x3e\r\n            \x3cinput id\x3d"${uniqueID}_raster" type\x3d"file" multiple\x3d"false" name\x3d"file"\r\n              data-dojo-attach-point\x3d"fileInput" style\x3d"display:none"\r\n              data-dojo-attach-event\x3d"onChange: _onUpload"/\x3e\r\n            \x3cdiv class\x3d"jimu-btn jimu-leading-margin10 jimu-float-leading"\x3e\r\n              \x3clabel class\x3d"file-input-label" for\x3d"${uniqueID}_raster"\x3e\r\n                ${nls.selectFileToUpload}\r\n              \x3c/label\x3e\r\n            \x3c/div\x3e\r\n            \x3cinput type\x3d"hidden" name\x3d"f" value\x3d"json"/\x3e\r\n          \x3c/form\x3e\r\n          \x3cspan data-dojo-attach-point\x3d"uploadFileName" class\x3d"jimu-leading-margin2"\x3e\x3c/span\x3e\r\n        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/Geoprocessing/editors/RecordSetEditorChooser.html":'\x3cdiv\x3e\r\n  \x3cdiv class\x3d"field"\x3e\r\n    \x3cinput id\x3d"gpRecordModeJSON" name\x3d"mode" data-dojo-type\x3d"dijit/form/RadioButton" data-dojo-attach-point\x3d"jsonMode" data-dojo-attach-event\x3d"onclick: _onJSONModeSelect" class\x3d"jimu-leading-margin10"\x3e\r\n    \x3clabel for\x3d"gpRecordModeJSON" style\x3d"width: auto;" class\x3d"jimu-leading-margin025"\x3e${nls.inputJSONString}\x3c/label\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"field"\x3e\r\n    \x3cinput id\x3d"gpRecordModeTable" name\x3d"mode" data-dojo-type\x3d"dijit/form/RadioButton" data-dojo-attach-point\x3d"tableMode" data-dojo-attach-event\x3d"onclick: _onTableModeSelect" class\x3d"jimu-leading-margin10"\x3e\r\n    \x3clabel for\x3d"gpRecordModeTable" style\x3d" width: auto;" class\x3d"jimu-leading-margin025"\x3e${nls.selectTable}\x3c/label\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv style\x3d"margin-top:5px;display:none;" data-dojo-attach-point\x3d"defaultJSONDiv"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"jsonEditorDiv"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/Geoprocessing/resultrenderers/FeatureSetRenderer.html":'\x3cdiv\x3e\r\n  \x3cdiv class\x3d"output-label" data-dojo-attach-point\x3d"labelNode"\x3e\r\n    \x3cspan data-dojo-attach-point\x3d"labelContent"\x3e${nls.drawnOnMap}\x3c/span\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"clear-node" data-dojo-attach-point\x3d"clearNode" style\x3d"display:none"\x3e\x3c/div\x3e\r\n  \x3cdiv class\x3d"popup-menu-button" data-dojo-attach-point\x3d"exportNode" style\x3d"display:none"\x3e\x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/Geoprocessing/resultrenderers/symbol.json":'{\r\n  "pointSymbol": {\r\n    "angle": 0,\r\n    "xoffset": 0,\r\n    "yoffset": 0,\r\n    "type": "esriPMS",\r\n    "url": "http://static.arcgis.com/images/Symbols/Shapes/BlueCircleLargeB.png",\r\n    "imageData": " ",\r\n    "contentType": "image/png",\r\n    "width": 15,\r\n    "height": 15\r\n  }\r\n}',
"url:widgets/Geoprocessing/resultrenderers/RecordSetRenderer.html":'\x3cdiv\x3e\r\n  \x3cdiv class\x3d"output-label" data-dojo-attach-point\x3d"labelNode"\x3e\r\n    \x3cspan data-dojo-attach-point\x3d"labelContent"\x3e\x3c/span\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"control-section"\x3e\r\n    \x3cdiv class\x3d"clear-node jimu-float-trailing" data-dojo-attach-point\x3d"clearNode" style\x3d"display:none"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"popup-menu-button jimu-float-trailing" data-dojo-attach-point\x3d"exportNode" style\x3d"display:none"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"magnify-node jimu-float-trailing" data-dojo-attach-point\x3d"magnifyNode"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"table-node" data-dojo-attach-point\x3d"tableNode"\x3e\x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/Geoprocessing/resultrenderers/ResultImageLayerRenderer.html":'\x3cdiv\x3e\r\n  \x3cdiv class\x3d"output-label" data-dojo-attach-point\x3d"labelNode"\x3e\r\n    \x3cspan\x3e${nls.drawnOnMap}\x3c/span\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"clear-node" data-dojo-attach-point\x3d"clearNode" style\x3d"display:none"\x3e\x3c/div\x3e\r\n\x3c/div\x3e\r\n',"url:widgets/Geoprocessing/Widget.html":'\x3cdiv\x3e\r\n  \x3cdiv class\x3d"jimu-widget error-message" data-dojo-attach-point\x3d"errorNode"\r\n      style\x3d"display:none;"\x3e${nls.noToolConfig}\x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"toolNode"\x3e\r\n    \x3cdiv class\x3d"input-pane" data-dojo-attach-point\x3d"inputPaneNode"\x3e\r\n      \x3cdiv class\x3d"section" data-dojo-attach-point\x3d"inputSectionNode"\x3e\x3c/div\x3e\r\n      \x3cdiv class\x3d"section jimu-r-row opts" data-dojo-attach-point\x3d"optsSectionNode"\x3e\r\n        \x3cdiv class\x3d"col-1-2"\x3e\r\n          \x3ca class\x3d"help" data-dojo-attach-point\x3d"helpLinkNode" target\x3d"_blank"\x3e${nls.help}\x3c/a\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv class\x3d"col-1-2"\x3e\r\n          \x3cdiv class\x3d"jimu-btn" data-dojo-attach-point\x3d"exeNode" data-dojo-attach-event\x3d"onclick: _onExecuteClick"\x3e${nls.run}\x3c/div\x3e\r\n        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"output-pane" data-dojo-attach-point\x3d"outputPaneNode"\x3e\r\n      \x3cdiv class\x3d"section info" data-dojo-attach-point\x3d"infoNode"\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"loadingNode" class\x3d"loading"\x3e\x3c/div\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"infoTextNode" class\x3d"text"\x3e\x3c/div\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"section" data-dojo-attach-point\x3d"outputSectionNode"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/Geoprocessing/css/style.css":".jimu-gp-editor-base{display: inline-block;}.jimu-gp-editor-multivalue .single-input{margin-top: 5px; display: flex;}.jimu-gp-editor-multivalue .jimu-gp-editor-base {width: calc(100% - 33px) !important;}.jimu-gp-editor-multivalue .remove{background-color: #24B9F0; width: 20px; height: 20px; border-radius: 10px; color: white; font-size: 20px; font-weight: bold; line-height: 19px; margin-left: auto; display: inline-block; cursor: pointer; text-align: center;}.jimu-rtl .jimu-gp-editor-multivalue .remove{margin-left: 0; margin-right: auto;}.jimu-gp-editor-multivalue .add-input{text-align: initial; display: flex;}.jimu-gp-editor-multivalue .add-input .add-btn{background-color: #24B9F0; width: 20px; height: 20px; border-radius: 10px; color: white; font-size: 20px; font-weight: bold; line-height: 19px; margin-left: auto; display: inline-block; cursor: pointer; text-align: center;}.jimu-rtl .jimu-gp-editor-multivalue .add-input .add-btn{margin-left: 0; margin-right: auto;}.jimu-gp-editor-sffl{height: 30px; position: relative;}.jimu-widget-geoprocessing{height: 100%; margin: -14px; font-size: 14px;}.jimu-widget-geoprocessing .jimu-viewstack{padding: 14px;}.jimu-widget-geoprocessing .input-node .jimu-viewstack{padding: 0 !important; margin-top: 10px;}.jimu-widget-geoprocessing .section{overflow: visible;}.jimu-widget-geoprocessing .opts [class*\x3d\"col\"]{height: 45px;}.jimu-widget-geoprocessing .opts a.help{line-height: 45px;}.jimu-widget-geoprocessing .section.opts{margin-top: 20px;}.jimu-widget-geoprocessing .section .jimu-btn{float: none; margin: auto; width: 150px;}.jimu-widget-geoprocessing .info{display: none; height: 100%; position: relative;}.jimu-widget-geoprocessing .info .text{text-align: left; width: 100%; height: 100%; position: absolute; overflow: auto;}.jimu-widget-geoprocessing .info .loading{pointer-events: none;}.jimu-widget-geoprocessing .input-node, .jimu-widget-geoprocessing .output-node{overflow: visible; margin-top: 20px;}.jimu-widget-geoprocessing .input-node\x3e.input-label, .jimu-widget-geoprocessing .output-node\x3e.output-label{overflow: hidden; font-size: 14px; color: #686868; font-weight: bold;}.jimu-widget-geoprocessing .input-node\x3e.editor-container, .jimu-widget-geoprocessing .output-node\x3e.renderer-container{margin-top: 5px; width: 100%;}.TabTheme .jimu-widget-geoprocessing .jimu-tab\x3e.control\x3e.tab.jimu-state-selected{border-top: 0;}.jimu-widget-geoprocessing li{list-style: none;}.jimu-widget-geoprocessing .jimu-basic-layer-chooser-from-map .jimu-tree{border: 1px solid #aaaaaa;}.jimu-widget-geoprocessing .jimu-gp-editor-url .jimu-url-input{width: 100%;}.jimu-widget-geoprocessing .file-input-label{display: inline-block; width: 100%; height: 100%; cursor: pointer;}.jimu-widget-geoprocessing .jimu-gp-editor-datafile form \x3e .jimu-btn{padding: 0;}.geoprocessing-popup-title{height: 20px;}.geoprocessing-popup .header{font-weight: bold;}.geoprocessing-popup .hzLine{border-top: 1px solid #333333; margin-top: 6px; margin-bottom: 6px;}.geoprocessing-popup .geoprocessing-popup-table{border-collapse: collapse;}.geoprocessing-popup .geoprocessing-popup-table td{padding:2px 2px 5px 2px;}.geoprocessing-popup .geoprocessing-popup-table .attr-name{color: #888888;}.jimu-widget-geoprocessing .output-node .dgrid .dgrid-cell {width: 80px;}.jimu-widget-geoprocessing .shp-info{margin-top: 20px; height: 24px;}.jimu-widget-geoprocessing .shp-clear{cursor: pointer; line-height: 32px;}.jimu-widget-geoprocessing .upload-status{width: 24px; height: 24px;}.jimu-widget-geoprocessing .jimu-gp-renderer-draw-feature{position: relative; height: 40px; width: 100%;}.jimu-widget-geoprocessing .clear-node {width: 16px; height: 16px; background-image: url(images/del.png); cursor: pointer;}.jimu-widget-geoprocessing .clear-node:hover {background-image: url(images/del_hover.png);}.jimu-widget-geoprocessing .magnify-node {width: 16px; height: 16px; background-image: url(images/zoom_normal.png); cursor: pointer;}.jimu-widget-geoprocessing .magnify-node:hover {background-image: url(images/zoom_hover.png);}.jimu-widget-geoprocessing .jimu-gp-renderer-draw-feature .output-label{position: absolute; font-size: 12px; line-height: 30px; left: 0; right: 75px;}.jimu-rtl .jimu-widget-geoprocessing .jimu-gp-renderer-draw-feature .output-label{left: 75px; right: 0;}.jimu-widget-geoprocessing .jimu-gp-renderer-draw-feature .clear-node {position: absolute; top: 50%; margin-top: -8px; right: 20px;}.jimu-rtl .jimu-widget-geoprocessing .jimu-gp-renderer-draw-feature .clear-node{left: 20px; right: auto;}.jimu-widget-geoprocessing .popup-menu-button {width: 16px; height: 16px;}.jimu-widget-geoprocessing .jimu-gp-renderer-draw-feature .popup-menu-button {position: absolute; top: 50%; margin-top: -8px; right: 47px;}.jimu-rtl .jimu-widget-geoprocessing .jimu-gp-renderer-draw-feature .popup-menu-button{left: 47px; right: auto;}.jimu-widget-geoprocessing .jimu-gp-renderer-table{position: relative; margin-top:30px;}.jimu-widget-geoprocessing .jimu-gp-renderer-table \x3e .control-section{position: absolute; height: 30px; width: 100%; top: -30px; left: 0;}.jimu-widget-geoprocessing .jimu-gp-renderer-table \x3e .control-section \x3e .popup-menu-button,.jimu-widget-geoprocessing .jimu-gp-renderer-table \x3e .control-section \x3e .magnify-node,.jimu-widget-geoprocessing .jimu-gp-renderer-table \x3e .control-section \x3e .clear-node {margin: 5px;}.jimu-widget-geoprocessing .jimu-gp-renderer-table .table-node{width: 100%;}.jimu-widget-geoprocessing .jimu-export-chooser{z-index: 1;}.gp-table-magnified{width: 100%; height: 100%;}.gp-table-magnified \x3e .dgrid{height: 100%;}.jimu-widget-geoprocessing .jimu-gp-editor-selection{position: relative; width: 100%; height: 40px; background: #EEEEEE;}.jimu-widget-geoprocessing .jimu-gp-editor-selection .label{position: absolute; left: 0; right: 36px; margin: 0 10px; height: 40px; line-height: 40px; font-family: 'Avenir-Light'; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}.jimu-rtl .jimu-widget-geoprocessing .jimu-gp-editor-selection .label{left: 36px; right: 0;}.jimu-widget-geoprocessing .jimu-gp-editor-selection .icon{width: 40px; height: 40px; cursor: pointer; position: absolute; right: 0;}.jimu-rtl .jimu-widget-geoprocessing .jimu-gp-editor-selection .icon{right: auto; left: 0;}.jimu-widget-geoprocessing .jimu-gp-editor-selection .icon-close{margin: 14px; font-size: 12px;}.jimu-widget-geoprocessing .renderer-container .output-loading {background: url(images/loading.gif) no-repeat center; width: 60px; height: 10px;}.jimu-widget-geoprocessing .jimu-gp-editor-multivalue-chooser .jimu-checkbox {display: block;}.jimu-widget-geoprocessing .jimu-gp-editor-multivalue-chooser .jimu-checkbox:not(:first-child) {margin-top: 5px;}.jimu-widget-geoprocessing .recordset-editor .table-select{width: 100%;}.jimu-widget-geoprocessing .job-message.warning {color: #CC6600;}.jimu-widget-geoprocessing .job-message.error {color: #CC0000;}",
"*now":function(H){H(['dojo/i18n!*preload*widgets/Geoprocessing/nls/Widget*["ar","bs","ca","cs","da","de","en","el","es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","nb","nl","pl","pt-br","pt-pt","ro","ru","sk","sl","sr","sv","th","tr","zh-cn","uk","vi","zh-hk","zh-tw","ROOT"]'])},"*noref":1}});
define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/html dojo/on dojo/query dojo/Deferred dojo/promise/all jimu/BaseWidget jimu/dijit/TabContainer jimu/dijit/LoadingIndicator jimu/dijit/Message jimu/utils jimu/zoomToUtils jimu/LayerInfos/LayerInfos ./editorManager ./resultRendererManager esri/tasks/GPMessage esri/tasks/Geoprocessor esri/tasks/JobInfo esri/layers/ImageParameters esri/request ./utils".split(" "),function(H,d,m,n,q,f,c,a,b,k,h,g,e,l,p,v,z,u,E,w,F,y,D){return H([b],
{baseClass:"jimu-widget-geoprocessing",name:"Geoprocessing",messageInterval:null,jodId:"",postMixInProperties:function(){this.inherited(arguments);d.mixin(this.nls,window.jimuNls.common);d.mixin(this.nls,window.jimuNls.units)},startup:function(){this.inherited(arguments);this.config.taskUrl?(this.inputNodes=[],this.drawTools=[],this.resultNodes=[],this.resultLayers=[],this.resultExtentMap={},this.visibleOutputNames=[],this.config.useResultMapServer?m.some(this.config.outputParams,d.hitch(this,function(B){if(!B.ignore&&
!B.layerInvisible&&"MapServiceLayer"===B.dataType)return this.visibleOutputNames.push(B.name),!0})):m.forEach(this.config.outputParams,d.hitch(this,function(B){B.ignore||B.layerInvisible||"GPFeatureRecordSetLayer"!==B.dataType||this.visibleOutputNames.push(B.name)})),v.setMap(this.map),v.setNls(this.nls),z.setMap(this.map),z.setNls(this.nls),this.gp=new E(this.config.taskUrl),this.gp.setOutSpatialReference(this.map.spatialReference),this.config.updateDelay&&this.gp.setUpdateDelay(this.config.updateDelay),
this.tab=new k({tabs:[{title:this.nls.input,content:this.inputPaneNode},{title:this.nls.output,content:this.outputPaneNode}],selected:this.nls.input}),this.tab.placeAt(this.domNode),this.tab.startup(),this.loading=new h({hidden:!0},this.loadingNode),this.loading.startup(),this.own(q(this.gp,"execute-complete",d.hitch(this,this.onExecuteComplete))),this.own(q(this.gp,"job-complete",d.hitch(this,this.onJobComplete))),this.own(q(this.gp,"job-cancel",d.hitch(this,this.onJonCancel))),this.own(q(this.gp,
"status-update",d.hitch(this,this.onStatusUpdate))),this.own(q(this.gp,"get-result-data-complete",d.hitch(this,this.onGetResultDataComplate))),this.own(q(this.gp,"get-result-image-layer-complete",d.hitch(this,this.onGetResultImageLayerComplete))),this.own(q(this.gp,"error",d.hitch(this,this.onError))),n.setAttr(this.helpLinkNode,"href",this.config.helpUrl),this._generateUniqueID(),"serverInfo"in this.config?this._createInputNodes():D.getServiceDescription(this.config.taskUrl).then(d.hitch(this,function(B){this.config.serverInfo=
B.serverInfo;this._createInputNodes()}))):(n.setStyle(this.toolNode,"display","none"),n.setStyle(this.errorNode,"display",""))},executeGP:function(){this._clearLastResult();n.addClass(this.exeNode,"jimu-state-disabled");this._getInputParamValues().then(d.hitch(this,function(B){this._showLoading();y({url:this.config.taskUrl,content:{f:"json"},handleAs:"json",callbackParamName:"callback"}).then(d.hitch(this,function(){this.config.isSynchronous?(this.gp.execute(B),this.infoTextNode.innerHTML=this.nls.executing):
this.gp.submitJob(B);this.tab.selectTab(this.nls.output)}),d.hitch(this,function(){n.removeClass(this.exeNode,"jimu-state-disabled")}))}),d.hitch(this,function(){n.removeClass(this.exeNode,"jimu-state-disabled")}))},onDeActive:function(){m.forEach(this.drawTools,function(B){B.deactivate()})},onExecuteComplete:function(B){this._hideLoading();if(B.messages&&0<B.messages.length){var x=m.filter(B.messages,function(r){return r.type===u.TYPE_WARNING||r.type===u.TYPE_ERROR});0<x.length&&this._createErrorMessages(x)}this._createOutputNodes(B.results);
n.removeClass(this.exeNode,"jimu-state-disabled")},onJobComplete:function(B){this._hideLoading();this._clearMessageInterval();n.removeClass(this.exeNode,"jimu-state-disabled");if(B.jobInfo.jobStatus!==w.STATUS_SUCCEEDED)this._createErrorMessages(B.jobInfo.messages);else if(this._createOutputPlaceholders(),this.config.useResultMapServer){var x=new F({imageSpatialReference:this.map.spatialReference}),r=this._getResultMapServiceParam();0<=this.visibleOutputNames.indexOf(r.name)&&this.gp.getResultImageLayer(B.jobInfo.jobId,
null,x);m.forEach(this.config.outputParams,function(t){!0!==t.ignore&&"GPFeatureRecordSetLayer"!==t.dataType&&"GPRasterDataLayer"!==t.dataType&&"GPRecordSet"!==t.dataType&&this.gp.getResultData(B.jobInfo.jobId,t.name)},this)}else m.forEach(this.config.outputParams,function(t){!0!==t.ignore&&this.gp.getResultData(B.jobInfo.jobId,t.name)},this)},onJonCancel:function(){this.loading.hide();this.infoTextNode.innerHTML="Canceled";n.removeClass(this.exeNode,"jimu-state-disabled");this._clearMessageInterval()},
onStatusUpdate:function(B){this.jobId=B.jobInfo.jobId;B.jobInfo.jobStatus===w.STATUS_SUCCEEDED?(this._hideLoading(),this._clearMessageInterval()):this._showLoading(B.jobInfo.jobStatus);!this.messageInterval&&this.jobId&&this._setupMessageInterval()},onGetResultDataComplate:function(B){this._updateOutputNode(this._getOutputParamByName(B.result.paramName),B.result)},onGetResultImageLayerComplete:function(B){var x=B.layer;if(x){B=x.url.substring(x.url.lastIndexOf("/")+1);var r={name:B,title:B,tooltip:B,
dataType:"MapServiceLayer"};x._wab_type="ArcGISDynamicMapServiceLayer";var t=this._getResultMapServiceParam();t&&(r.label=t.label,r.tooltip=t.tooltip,r.layerInvisible=t.layerInvisible,x.title=t.label,x.setVisibility(!0!==t.layerInvisible));var C=this._updateOutputNode(r,x);if(null!==C){this.resultLayers.push(x);var J=p.getInstanceSync(),L=q(J,"layerInfosChanged",d.hitch(this,function(){var P=J.getLayerInfoById(x.id);if(P){L.remove();if(!r.label){var U=f(".output-label",C);U&&0<U.length&&P.title&&
(U[0].innerHTML=e.sanitizeHTML(P.title))}P.getExtent().then(d.hitch(this,function(aa){d.isArray(aa)&&0<aa.length?(this.resultExtentMap[t.name]=aa[0],this._updateResultExtent()):aa&&(this.resultExtentMap[t.name]=aa,this._updateResultExtent())}))}}))}}},onError:function(B){this.loading.hide();n.empty(this.infoTextNode);n.create("div",{"class":"job-message error",innerHTML:e.sanitizeHTML(B.error.message)},this.infoTextNode);n.removeClass(this.exeNode,"jimu-state-disabled");this._clearMessageInterval()},
_updateJobMessage:function(){y({url:this.config.taskUrl+"/jobs/"+this.jobId,content:{f:"json",returnMessages:!0},handleAs:"json",callbackParamName:"callback"}).then(d.hitch(this,function(B){B.messages&&0<B.messages.length&&(n.empty(this.infoTextNode),m.forEach(B.messages,function(x){var r="normal";x.type===u.TYPE_WARNING?r="warning":x.type===u.TYPE_ERROR&&(r="error");n.create("div",{"class":"job-message "+r,innerHTML:e.sanitizeHTML(x.description)},this.infoTextNode)},this))}))},_setupMessageInterval:function(){this.messageInterval=
setInterval(d.hitch(this,this._updateJobMessage),3E3)},_clearMessageInterval:function(){this.jobId="";this.messageInterval&&(clearInterval(this.messageInterval),this.messageInterval=null)},destroy:function(){this._clearLastInput();this._clearLastResult();this._clearMessageInterval();this.inherited(arguments)},_generateUniqueID:function(){this.uniqueID=this.id.replace(/[\/\.]/g,"_")},_showLoading:function(){this.loading.show();n.setStyle(this.infoNode,"display","block")},_hideLoading:function(){n.setStyle(this.infoNode,
"display","none");this.loading.hide()},_getOutputParamByName:function(B){for(var x=0;x<this.config.outputParams.length;x++)if(this.config.outputParams[x].name===B)return this.config.outputParams[x]},_getInputParamValues:function(){var B=new c,x={},r=[],t=[],C,J="";m.forEach(this.inputNodes,function(L){C=L.inputEditor.getGPValue();C.param=L.param;L.param.required?r.push(C):t.push(C)},this);a(r).then(d.hitch(this,function(L){for(var P=0;P<L.length;P++){if(null===L[P]||void 0===L[P]){J=r[P].param.label+
" "+this.nls.requiredInfo;new g({message:J});B.reject(J);break}x[r[P].param.name]=L[P]}}),function(L){new g({message:L});B.reject(L)}).then(function(){return a(t)}).then(d.hitch(this,function(L){for(var P=0;P<L.length;P++)x[t[P].param.name]=L[P];B.resolve(x)}),function(){B.resolve(x)});return B},_createInputNodes:function(){m.forEach(this.config.inputParams,function(B){this._createInputNode(B)},this)},_clearLastInput:function(){m.forEach(this.inputNodes,function(B){B.inputEditor.clear&&d.isFunction(B.inputEditor.clear)&&
B.inputEditor.clear()},this)},_clearLastResult:function(){n.empty(this.infoTextNode);m.forEach(this.resultNodes,function(B){n.destroy(B.labelNode);B.resultRenderer&&B.resultRenderer.destroy();n.destroy(B)});m.forEach(this.resultLayers,function(B){null!==B&&this.map.removeLayer(B)},this);this.resultNodes=[];this.resultLayers=[];this.resultExtentMap={}},_createErrorMessages:function(B){this.infoTextNode.innerHTML="";var x=n.create("ul",{"class":"output-node"},this.outputSectionNode);this.resultNodes.push(x);
m.forEach(B,d.hitch(this,function(r){var t="normal";r.type===u.TYPE_WARNING?t="warning":r.type===u.TYPE_ERROR&&(t="error");n.create("li",{"class":"job-message "+t,innerHTML:e.sanitizeHTML(r.description)},x)}))},_createOutputNodes:function(B){var x=[];m.forEach(this.config.outputParams,function(t,C){x.push(this._createOutputNode(t,B[C]))},this);if(m.some(x,function(t){return null!==t})){var r=[];m.forEach(B,d.hitch(this,function(t){"GPFeatureRecordSetLayer"===t.dataType&&(t=t.value&&t.value.features)&&
0<t.length&&(r=r.concat(t))}));0<r.length&&e.featureAction.zoomTo(this.map,r)}},_onExecuteClick:function(){n.hasClass(this.exeNode,"jimu-state-disabled")||this.executeGP()},_createInputNode:function(B){var x=n.create("div",{"class":"input-node"},this.inputSectionNode),r=n.create("div",{"class":"input-label",title:B.tooltip||B.label||""},x);n.create("span",{"class":"label-text",innerHTML:e.sanitizeHTML(B.label)},r);B.required&&n.create("span",{"class":"label-star",innerHTML:"*"},r);r=n.create("div",
{"class":"editor-container"},x);var t=v.createEditor(B,"input","widget",{uid:this.uniqueID,config:this.config,appConfig:this.appConfig});t.placeAt(r);"SelectFeatureSetFromDraw"===t.editorName&&this.drawTools.push(t.drawBox);x.param=B;x.inputEditor=t;this.inputNodes.push(x);!1===B.visible&&n.setStyle(x,"display","none");return x},_updateOutputNode:function(B,x){var r;m.some(this.resultNodes,d.hitch(this,function(C){if("MapServiceLayer"!==B.dataType&&C.param.name===B.name||"MapServiceLayer"===B.dataType&&
"MapServiceLayer"===C.param.dataType)return r=C,!0}));if(!r)return null;try{var t=z.createResultRenderer(B,x,{uid:this.uniqueID,config:this.config});"GPFeatureRecordSetLayer"===B.dataType&&(this.resultExtentMap[B.name]=t.resultLayer&&t.resultLayer.fullExtent?t.resultLayer.fullExtent:"empty",this._updateResultExtent())}catch(C){console.error(C),t=z.createResultRenderer("error",x,{uid:this.uniqueID,config:this.config})}n.empty(r.placeholderNode);t.placeAt(r.placeholderNode);t.startup();r.resultRenderer=
t;this.config.useResultMapServer||"GPFeatureRecordSetLayer"!==B.dataType&&"GPRecordSet"!==B.dataType||!B.defaultValue||!B.defaultValue.fields||D.useDynamicSchema(B,this.config)||this.updateDataSourceData("filter-"+B.name,{features:x.value.features});return r},_createOutputPlaceholders:function(){m.forEach(this.config.outputParams,function(B){if((this.config.useResultMapServer||"MapServiceLayer"!==B.dataType)&&(!this.config.useResultMapServer||"GPFeatureRecordSetLayer"!==B.dataType&&"GPRasterDataLayer"!==
B.dataType&&"GPRecordSet"!==B.dataType)&&!0!==B.ignore){var x=n.create("div",{"class":"output-node"},this.outputSectionNode),r=n.create("div",{"class":"output-label",title:B.tooltip||B.label||"",innerHTML:e.sanitizeHTML(B.label)},x),t=n.create("div",{"class":"renderer-container",innerHTML:'\x3cdiv class\x3d"output-loading"\x3e\x3c/div\x3e'},x);x.param=B;x.labelNode=r;x.placeholderNode=t;this.resultNodes.push(x)}},this)},_createOutputNode:function(B,x){if(!0!==B.ignore){try{var r=z.createResultRenderer(B,
x,{uid:this.uniqueID,config:this.config});"GPFeatureRecordSetLayer"===B.dataType&&(this.resultExtentMap[B.name]=r.resultLayer&&r.resultLayer.fullExtent?r.resultLayer.fullExtent:"empty",this._updateResultExtent())}catch(J){console.error(J),r=z.createResultRenderer("error",x,{uid:this.uniqueID,config:this.config})}var t=n.create("div",{"class":"output-node"},this.outputSectionNode);this.resultNodes.push(t);var C=n.create("div",{"class":"output-label",title:B.tooltip||B.label||"",innerHTML:e.sanitizeHTML(B.label)},
t);t.param=B;t.labelNode=C;C=n.create("div",{"class":"renderer-container"},t);r.placeAt(C);r.startup();t.resultRenderer=r;this.config.useResultMapServer||"GPFeatureRecordSetLayer"!==B.dataType&&"GPRecordSet"!==B.dataType||!B.defaultValue||!B.defaultValue.fields||D.useDynamicSchema(B,this.config)||this.updateDataSourceData("filter-"+B.name,{features:x.value.features});return t}return null},_getResultMapServiceParam:function(){var B;m.some(this.config.outputParams,function(x){if("MapServiceLayer"===
x.dataType)return B=x,!0});return B},_updateResultExtent:function(){if(m.every(this.visibleOutputNames,d.hitch(this,function(x){return void 0!==this.resultExtentMap[x]}))){var B;m.forEach(this.visibleOutputNames,d.hitch(this,function(x){"empty"!==this.resultExtentMap[x]&&(B=B?B.union(this.resultExtentMap[x]):this.resultExtentMap[x])}));B&&l.zoomToExtent(this.map,B)}},useSelectionAsInput:function(B,x){m.forEach(this.inputNodes,function(r){"GPFeatureRecordSetLayer"===r.param.dataType&&r.param.defaultValue&&
e.getTypeByGeometryType(r.param.defaultValue.geometryType)===B.geometryType&&r.inputEditor.setFeatureSet(B,x)},this);this.tab.selectTab(this.nls.input)}})});