AUI.add("aui-panel",function(T){var H=T.Lang,P=H.isArray,M=H.isBoolean,Z="boundingBox",E="collapse",L="collapsed",R="collapsible",F="icon",V="minus",C="panel",D="plus",S="title",Q="icons",X="visible",J=T.ClassNameManager.getClassName,K=J("helper","clearfix"),G=J(C,L),O=J(C),Y=J(C,"hd","text"),B=J(C,"icons"),I={body:"bd",footer:"ft",header:"hd"},U=document.createTextNode(""),N='<span class="'+Y+'"></span>';var W=function(){};W.ATTRS={collapsed:{value:false,validator:M},collapsible:{value:false,validator:M},title:{value:"",validator:function(A){return H.isString(A)||M(A);}},icons:{value:[],validator:P}};W.prototype={initializer:function(a){var A=this;if(!a.bodyContent){A.set("bodyContent",U);}if(!a.headerContent){A.set("headerContent",U);}A.after("collapsedChange",A._afterCollapsedChange);A.after("render",A._afterPanelRender);A.after("titleChange",A._afterTitleChange);},collapse:function(){var A=this;A.set(L,true);},expand:function(){var A=this;A.set(L,false);},toggle:function(){var A=this;A.set(X,!A.get(X));},toggleCollapse:function(){var A=this;if(A.get(L)){A.expand();}else{A.collapse();}},_addPanelClass:function(f){var A=this;var e=A[f+"Node"];if(e){var c=I[f];var d=J(C,c);var b=A.name;var a=J(b,c);e.addClass(d);e.addClass(a);}},_renderIconButtons:function(){var A=this;var a=A.get(Q);if(A.get(R)){var b=A.get(L)?D:V;a.unshift({icon:b,id:E,handler:{fn:A.toggleCollapse,context:A}});}A.icons=new T.Toolbar({children:a}).render(A.headerNode);A.icons.get(Z).addClass(B);},_renderHeaderText:function(){var A=this;var a=A.headerNode;var b=T.Node.create(N);var c=a.html();a.empty();b.addClass(Y);a.prepend(b);A.headerTextNode=b;if(!A.get(S)){A.set(S,c);}A._syncTitleUI();},_syncCollapsedUI:function(){var A=this;if(A.get(R)){var d=A.bodyNode;var a=A.get(Z);var e=A.get(L);if(A.icons){var b=A.icons;var c=b.item(E);if(c){c.set(F,e?D:V);}}if(e){d.hide();a.addClass(G);}else{d.show();a.removeClass(G);}}},_syncTitleUI:function(){var A=this;var a=A.get(S);A.headerTextNode.html(a);},_afterCollapsedChange:function(a){var A=this;A._syncCollapsedUI();},_afterPanelRender:function(a){var A=this;A.headerNode.addClass(K);A._addPanelClass("body");A._addPanelClass("footer");A._addPanelClass("header");A._renderHeaderText();A._renderIconButtons();A._syncCollapsedUI();},_afterTitleChange:function(a){var A=this;A._syncTitleUI();}};T.Panel=T.Base.build(C,T.Component,[W,T.WidgetStdMod]);},"1.0.1",{skinnable:true,requires:["aui-component","widget-stdmod","aui-toolbar"]});