//>>built
define("dojox/dtl/contrib/data",["dojo/_base/kernel","dojo/_base/lang","../_base","dojo/_base/array"],function(p,f,g,q){var d=f.getObject("contrib.data",!0,g),k=!0;d._BoundItem=f.extend(function(a,c){this.item=a;this.store=c},{get:function(a){var c=this.store,b=this.item;if("getLabel"==a)return c.getLabel(b);if("getAttributes"==a)return c.getAttributes(b);if("getIdentity"==a)return c.getIdentity?c.getIdentity(b):"Store has no identity API";if(!c.hasAttribute(b,a)&&("s"==a.slice(-1)&&(k&&(k=!1,p.deprecated("You no longer need an extra s to call getValues, it can be figured out automatically")),
a=a.slice(0,-1)),!c.hasAttribute(b,a)))return;if(a=c.getValues(b,a)){if(!f.isArray(a))return new d._BoundItem(a,c);a=q.map(a,function(e){return f.isObject(e)&&c.isItem(e)?new d._BoundItem(e,c):e});a.get=d._get;return a}}});d._BoundItem.prototype.get.safe=!0;d.BindDataNode=f.extend(function(a,c,b,e){this.items=a&&new g._Filter(a);this.query=c&&new g._Filter(c);this.store=new g._Filter(b);this.alias=e},{render:function(a,c){var b=this.items&&this.items.resolve(a),e=this.query&&this.query.resolve(a),
h=this.store.resolve(a);if(!h||!h.getFeatures)throw Error("data_bind didn't receive a store");if(e){var l=!1;h.fetch({query:e,sync:!0,scope:this,onComplete:function(r){l=!0;b=r}});if(!l)throw Error("The bind_data tag only works with a query if the store executed synchronously");}e=[];if(b)for(var m=0,n;n=b[m];m++)e.push(new d._BoundItem(n,h));a[this.alias]=e;return c},unrender:function(a,c){return c},clone:function(){return this}});f.mixin(d,{_get:function(a){if(this.length)return this[0]instanceof
d._BoundItem?this[0].get(a):this[0][a]},bind_data:function(a,c){var b=c.contents.split();if("to"!=b[2]||"as"!=b[4]||!b[5])throw Error("data_bind expects the format: 'data_bind items to store as varName'");return new d.BindDataNode(b[1],null,b[3],b[5])},bind_query:function(a,c){var b=c.contents.split();if("to"!=b[2]||"as"!=b[4]||!b[5])throw Error("data_bind expects the format: 'bind_query query to store as varName'");return new d.BindDataNode(null,b[1],b[3],b[5])}});d._get.safe=!0;g.register.tags("dojox.dtl.contrib",
{data:["bind_data","bind_query"]});return d});