//>>built require({cache:{"url:dojox/grid/resources/Expando.html":'\x3cdiv class\x3d"dojoxGridExpando"\r\n\t\x3e\x3cdiv class\x3d"dojoxGridExpandoNode" dojoAttachEvent\x3d"onclick:onToggle"\r\n\t\t\x3e\x3cdiv class\x3d"dojoxGridExpandoNodeInner" dojoAttachPoint\x3d"expandoInner"\x3e\x3c/div\r\n\t\x3e\x3c/div\r\n\x3e\x3c/div\x3e\r\n'}}); define("dojo/_base/kernel dojo/_base/declare dojo/_base/lang dojo/_base/event dojo/_base/array dojo/query dojo/parser dojo/dom-construct dojo/dom-class dojo/dom-style dojo/dom-geometry dojo/dom dojo/keys dojo/text!./resources/Expando.html dijit/_Widget dijit/_TemplatedMixin ./TreeGrid ./_Builder ./_View ./_Layout ./cells/tree ./_RowManager ./_FocusManager ./_EditManager ./DataSelection ./util".split(" "),function(C,k,h,D,v,z,E,A,q,F,t,G,H,u,I,J,B,K,y,L,M,N,O,P,Q,R){var S=k("dojox.grid._LazyExpando", [I,J],{grid:null,view:null,rowIdx:-1,cellIdx:-1,level:0,itemId:"",templateString:u,onToggle:function(a){if(this.grid._treeCache.items[this.rowIdx]){this.grid.focus.setFocusIndex(this.rowIdx,this.cellIdx);this.setOpen(!this.grid._treeCache.items[this.rowIdx].opened);try{D.stop(a)}catch(b){}}},setOpen:function(a){var b=this.grid,c=b._by_idx[this.rowIdx].item;c&&b.treeModel.mayHaveChildren(c)&&!b._loading&&b._treeCache.items[this.rowIdx].opened!==a&&(b._treeCache.items[this.rowIdx].opened=a,b.expandoFetch(this.rowIdx, a),this._updateOpenState(c))},_updateOpenState:function(a){var b=this.grid;a&&b.treeModel.mayHaveChildren(a)?(a=b._treeCache.items[this.rowIdx].opened,this.expandoInner.innerHTML=a?"-":"+",q.toggle(this.domNode,"dojoxGridExpandoOpened",a),this.domNode.parentNode.setAttribute("aria-expanded",a)):q.remove(this.domNode,"dojoxGridExpandoOpened")},setRowNode:function(a,b,c){if(0>this.cellIdx||!this.itemId)return!1;this.view=c;this.grid=c.grid;this.rowIdx=a;a=this.grid.isLeftToRight()?"marginLeft":"marginRight"; F.set(this.domNode.parentNode,a,1.125*this.level+"em");this._updateOpenState(this.grid._by_idx[this.rowIdx].item);return!0}});u=k("dojox.grid._TreeGridContentBuilder",K._ContentBuilder,{generateHtml:function(a,b){a=this.getTableArray();var c=this.grid,d=this.view.structure.cells,g=c.getItem(b),e=0,f="",l=c._treeCache.items[b]?c._treeCache.items[b].treePath:null;R.fire(this.view,"onBeforeRow",[b,d]);g&&h.isArray(l)&&(e=l.length,f=c.treeModel.mayHaveChildren(g)?"":"dojoxGridNoChildren");for(var m=0, c=0,k,n,q=0,u=[];k=d[c];c++)if(!k.hidden&&!k.header){a.push('\x3ctr class\x3d"'+f+'"\x3e');(l=this._getColSpans(e))&&v.forEach(l,function(a){for(m=0;n=k[m];m++)m>=a.start&&m<=a.end&&(q+=this._getCellWidth(k,m));u.push(q);q=0},this);for(var p,w,x,r=0,m=0;n=k[m];m++)p=n.markup,w=n.customClasses=[],x=n.customStyles=[],l&&l[r]&&m>=l[r].start&&m<=l[r].end?m==(l[r].primary||l[r].start)?(p[5]=n.formatAtLevel(g,e,b),p[1]=w.join(" "),w=t.getMarginBox(n.getHeaderNode()).w-t.getContentBox(n.getHeaderNode()).w, x=n.customStyles=["width:"+(u[r]-w)+"px"],p[3]=x.join(";"),a.push.apply(a,p)):m==l[r].end&&r++:(p[5]=n.formatAtLevel(g,e,b),p[1]=w.join(" "),p[3]=x.join(";"),a.push.apply(a,p));a.push("\x3c/tr\x3e")}a.push("\x3c/table\x3e");return a.join("")},_getColSpans:function(a){var b=this.grid.colSpans;return b&&b[a]?b[a]:null},_getCellWidth:function(a,b){var c=a[b],d=c.getHeaderNode();if(c.hidden)return 0;if(b==a.length-1||v.every(a.slice(b+1),function(a){return a.hidden}))return a=t.position(a[b].view.headerContentNode.firstChild), a.x+a.w-t.position(d).x;do c=a[++b];while(c.hidden);return t.position(c.getHeaderNode()).x-t.position(d).x}});k("dojox.grid._TreeGridView",y,{_contentBuilderClass:u,postCreate:function(){this.inherited(arguments);this._expandos={};this.connect(this.grid,"_onCleanupExpandoCache","_cleanupExpandoCache")},destroy:function(){this._cleanupExpandoCache();this.inherited(arguments)},_cleanupExpandoCache:function(a){if(a&&this._expandos[a])this._expandos[a].destroy(),delete this._expandos[a];else{for(var b in this._expandos)this._expandos[b].destroy(); this._expandos={}}},onAfterRow:function(a,b,c){z("span.dojoxGridExpando",c).forEach(function(b){if(b&&b.parentNode){var d,e,f=this.grid._by_idx;f&&f[a]&&f[a].idty&&(d=f[a].idty,e=this._expandos[d]);e?(A.place(e.domNode,b,"replace"),e.itemId=b.getAttribute("itemId"),e.cellIdx=parseInt(b.getAttribute("cellIdx"),10),isNaN(e.cellIdx)&&(e.cellIdx=-1)):(e=E.parse(b.parentNode)[0],d&&(this._expandos[d]=e));e.setRowNode(a,c,this)||e.domNode.parentNode.removeChild(e.domNode);A.destroy(b)}},this);this.inherited(arguments)}, updateRow:function(a){var b=this.grid,c;b.keepSelection&&(c=b.getItem(a))&&b.selection.preserver._reSelectById(c,a);this.inherited(arguments)}});var T=h.mixin(h.clone(M),{formatAtLevel:function(a,b,c){if(!a)return this.formatIndexes(c,a,b);var d="";this.isCollapsable&&this.grid.store.isItem(a)&&(d="\x3cspan "+C._scopeName+'Type\x3d"dojox.grid._LazyExpando" level\x3d"'+b+'" class\x3d"dojoxGridExpando" itemId\x3d"'+this.grid.store.getIdentity(a)+'" cellIdx\x3d"'+this.index+'"\x3e\x3c/span\x3e');a=this.formatIndexes(c, a,b);return""!==d?"\x3cdiv\x3e"+d+a+"\x3c/div\x3e":a},formatIndexes:function(a,b,c){var d=this.grid.edit.info;b=this.get?this.get(a,b):this.value||this.defaultValue;if(this.editable&&(this.alwaysEditing||d.rowIndex===a&&d.cell===this))return this.formatEditing(b,a);d=this.textDir||this.grid.textDir;a=this._defaultFormat(b,[b,a,c,this]);d&&this._enforceTextDirWithUcc&&(a=this._enforceTextDirWithUcc(d,a));return a}});y=k("dojox.grid._LazyTreeLayout",L,{setStructure:function(a){var b=a;this.grid&&!v.every(b, function(a){return!!a.cells})&&(b=arguments[0]=[{cells:[b]}]);1===b.length&&1===b[0].cells.length&&(b[0].type="dojox.grid._TreeGridView",this._isCollapsable=!0,b[0].cells[0][this.grid.expandoCell].isCollapsable=!0);this.inherited(arguments)},addCellDef:function(a,b,c){var d=this.inherited(arguments);return h.mixin(d,T)}});var U=k("dojox.grid._LazyTreeGridCache",null,{constructor:function(){this.items=[]},getSiblingIndex:function(a,b){--a;for(var c=0,d;0<=a;a--)if(d=this.items[a]?this.items[a].treePath: [],d.join("/")===b.join("/"))c++;else if(d.length=a?this.updateRows(b*this.rowsPerPage,this.rowsPerPage):(b+1)*this.rowsPerPage>=a&&this.updateRows(a,(b+1)*this.rowsPerPage-a+1)},this)},_fold:function(a,b){var c=-1,d=0,g=this._by_idx,e=this._by_idty[a];if(e&&e.item&&this.treeModel.mayHaveChildren(e.item)){for(;d