//>>built define("dijit/tree/TreeStoreModel",["dojo/_base/array","dojo/aspect","dojo/_base/declare","dojo/_base/json","dojo/_base/lang"],function(_1,_2,_3,_4,_5){ return _3("dijit.tree.TreeStoreModel",null,{store:null,childrenAttrs:["children"],newItemIdAttr:"id",labelAttr:"",root:null,query:null,deferItemLoadingUntilExpand:false,constructor:function(_6){ _5.mixin(this,_6); this.connects=[]; var _7=this.store; if(!_7.getFeatures()["dojo.data.api.Identity"]){ throw new Error("dijit.Tree: store must support dojo.data.Identity"); } if(_7.getFeatures()["dojo.data.api.Notification"]){ this.connects=this.connects.concat([_2.after(_7,"onNew",_5.hitch(this,"onNewItem"),true),_2.after(_7,"onDelete",_5.hitch(this,"onDeleteItem"),true),_2.after(_7,"onSet",_5.hitch(this,"onSetItem"),true)]); } },destroy:function(){ var h; while(h=this.connects.pop()){ h.remove(); } },getRoot:function(_8,_9){ if(this.root){ _8(this.root); }else{ this.store.fetch({query:this.query,onComplete:_5.hitch(this,function(_a){ if(_a.length!=1){ throw new Error(this.declaredClass+": query "+_4.stringify(this.query)+" returned "+_a.length+" items, but must return exactly one item"); } this.root=_a[0]; _8(this.root); }),onError:_9}); } },mayHaveChildren:function(_b){ return _1.some(this.childrenAttrs,function(_c){ return this.store.hasAttribute(_b,_c); },this); },getChildren:function(_d,_e,_f){ var _10=this.store; if(!_10.isItemLoaded(_d)){ var _11=_5.hitch(this,arguments.callee); _10.loadItem({item:_d,onItem:function(_12){ _11(_12,_e,_f); },onError:_f}); return; } var _13=[]; for(var i=0;i