//>>built
define("dojox/mvc/StatefulSeries",["dojo/_base/array","dojo/_base/declare","dojo/_base/lang","dojox/mvc/at"],function(f,j,c){return j("dojox.mvc.StatefulSeries",null,{constructor:function(a){function g(){d.series&&(d.series.chart.updateSeries(d.series.name,d),d.series.chart.delayedRender())}var d=this;this._handles=[];this.data=f.map(a,function(a,f){if("dojox.mvc.at"==(a||{}).atsignature){var b=a.target,e=a.targetProp;if(c.isString(b))throw Error("Literal-based dojox/mvc/at is not supported in dojox/mvc/StatefulSeries.");
if(e&&c.isFunction(b.set)&&c.isFunction(b.watch)){var h=a.converter,i=(h||{}).format&&c.hitch({target:b,source:this},h.format);this._handles.push(b.watch(e,function(a,b,c){d.data[f]=i?i(c):c;g()}))}return!e?b:c.isFunction(b.get)?b.get(e):b[e]}return a},this);g()},destroy:function(){for(var a=null;a=this._handles.pop();)a.unwatch()},setSeriesObject:function(a){this.series=a}})});