text: Ext.define("Ext.panel.Panel",{extend:"Ext.panel.AbstractPanel",requires:["Ext.panel.Header","Ext.fx.Anim","Ext.util.KeyMap","Ext.panel.DD","Ext.XTemplate","Ext.layout.component.Dock","Ext.util.Memento"],alias:"widget.panel",alternateClassName:"Ext.Panel",collapsedCls:"collapsed",animCollapse:Ext.enableFx,minButtonWidth:75,collapsed:false,collapseFirst:true,hideCollapseTool:false,titleCollapse:undefined,floatable:true,collapsible:undefined,closable:false,closeAction:"destroy",placeholderCollapseHideMode:Ext.Element.VISIBILITY,preventHeader:false,header:undefined,headerPosition:"top",frame:false,frameHeader:true,manageHeight:true,constrain:false,constrainHeader:false,initComponent:function(){var a=this;a.addEvents("beforeclose","close","beforeexpand","beforecollapse","expand","collapse","titlechange","iconchange","iconclschange","glyphchange","float","unfloat");if(a.collapsible){this.addStateEvents(["expand","collapse"])}if(a.unstyled){a.setUI("plain")}if(a.frame){a.setUI(a.ui+"-framed")}a.bridgeToolbars();a.callParent();a.collapseDirection=a.collapseDirection||a.headerPosition||Ext.Component.DIRECTION_TOP;a.hiddenOnCollapse=new Ext.dom.CompositeElement()},beforeDestroy:function(){var a=this;Ext.destroy(a.placeholder,a.ghostPanel,a.dd);a.callParent()},initAria:function(){this.callParent();this.initHeaderAria()},getFocusEl:function(){return this.el},initHeaderAria:function(){var b=this,a=b.el,c=b.header;if(a&&c){a.dom.setAttribute("aria-labelledby",c.titleCmp.id)}},getHeader:function(){return this.header},setTitle:function(f){var c=this,b=c.title,e=c.header,a=c.reExpander,d=c.placeholder;c.title=f;if(e){if(e.isHeader){e.setTitle(f)}else{e.title=f}}else{if(c.rendered){c.updateHeader()}}if(a){a.setTitle(f)}if(d&&d.setTitle){d.setTitle(f)}c.fireEvent("titlechange",c,f,b)},setIconCls:function(a){var c=this,b=c.iconCls,e=c.header,d=c.placeholder;c.iconCls=a;if(e){if(e.isHeader){e.setIconCls(a)}else{e.iconCls=a}}else{c.updateHeader()}if(d&&d.setIconCls){d.setIconCls(a)}c.fireEvent("iconclschange",c,a,b)},setIcon:function(a){var b=this,c=b.icon,e=b.header,d=b.placeholder;b.icon=a;if(e){if(e.isHeader){e.setIcon(a)}else{e.icon=a}}else{b.updateHeader()}if(d&&d.setIcon){d.setIcon(a)}b.fireEvent("iconchange",b,a,c)},setGlyph:function(c){var b=this,a=b.glyph,e=b.header,d=b.placeholder;b.glyph=c;if(e){if(e.isHeader){e.setGlyph(c)}else{e.glyph=c}}else{b.updateHeader()}if(d&&d.setGlyph){d.setIcon(c)}b.fireEvent("glyphchange",b,c,a)},bridgeToolbars:function(){var a=this,f=[],c,b,e=a.minButtonWidth;function d(g,i,h){if(Ext.isArray(g)){g={xtype:"toolbar",items:g}}else{if(!g.xtype){g.xtype="toolbar"}}g.dock=i;if(i=="left"||i=="right"){g.vertical=true}if(h){g.layout=Ext.applyIf(g.layout||{},{pack:{left:"start",center:"center"}[a.buttonAlign]||"end"})}return g}if(a.tbar){f.push(d(a.tbar,"top"));a.tbar=null}if(a.bbar){f.push(d(a.bbar,"bottom"));a.bbar=null}if(a.buttons){a.fbar=a.buttons;a.buttons=null}if(a.fbar){c=d(a.fbar,"bottom",true);c.ui="footer";if(e){b=c.defaults;c.defaults=function(g){var h=b||{};if((!g.xtype||g.xtype==="button"||(g.isComponent&&g.isXType("button")))&&!("minWidth" in h)){h=Ext.apply({minWidth:e},h)}return h}}f.push(c);a.fbar=null}if(a.lbar){f.push(d(a.lbar,"left"));a.lbar=null}if(a.rbar){f.push(d(a.rbar,"right"));a.rbar=null}if(a.dockedItems){if(!Ext.isArray(a.dockedItems)){a.dockedItems=[a.dockedItems]}a.dockedItems=a.dockedItems.concat(f)}else{a.dockedItems=f}},isPlaceHolderCollapse:function(){return this.collapseMode=="placeholder"},onBoxReady:function(){this.callParent();if(this.collapsed){this.setHiddenDocked()}},beforeRender:function(){var b=this,a;b.callParent();b.initTools();if(!(b.preventHeader||(b.header===false))){b.updateHeader()}if(b.collapsed){if(b.isPlaceHolderCollapse()){if(!b.hidden){b.setHiddenState(true);b.preventCollapseFire=true;b.placeholderCollapse();delete b.preventCollapseFire;a=b.collapsed;b.collapsed=false}}else{b.beginCollapse();b.addClsWithUI(b.collapsedCls)}}if(a){b.collapsed=a}},initTools:function(){var c=this,d=c.tools,b,a;c.tools=[];for(b=d&&d.length;b;){--b;c.tools[b]=a=d[b];a.toolOwner=c}if(c.collapsible&&!(c.hideCollapseTool||c.header===false||c.preventHeader)){c.collapseDirection=c.collapseDirection||c.headerPosition||"top";c.collapseTool=c.expandTool=Ext.widget({xtype:"tool",handler:c.toggleCollapse,scope:c});c.updateCollapseTool();if(c.collapseFirst){c.tools.unshift(c.collapseTool)}}c.addTools();if(c.closable){c.addClsWithUI("closable");c.addTool(Ext.widget({xtype:"tool",type:"close",handler:Ext.Function.bind(c.close,c,[])}))}if(c.collapseTool&&!c.collapseFirst){c.addTool(c.collapseTool)}},addTools:Ext.emptyFn,updateCollapseTool:function(){var b=this,a=b.collapseTool;if(a){if(b.collapsed&&!b.isPlaceHolderCollapse()){a.setType("expand-"+b.getOppositeDirection(b.collapseDirection))}else{a.setType("collapse-"+b.collapseDirection)}}},close:function(){if(this.fireEvent("beforeclose",this)!==false){this.doClose()}},doClose:function(){this.fireEvent("close",this);this[this.closeAction]()},updateHeader:function(d){var c=this,g=c.header,f=c.title,e=c.tools,b=c.icon||c.iconCls,a=c.headerPosition==="left"||c.headerPosition==="right";if(Ext.isObject(g)||(g!==false&&(d||(f||b)||(e&&e.length)||(c.collapsible&&!c.titleCollapse)))){if(g&&g.isHeader){g.show()}else{g=c.header=Ext.widget(Ext.apply({xtype:"header",title:f,titleAlign:c.titleAlign,orientation:a?"vertical":"horizontal",dock:c.headerPosition||"top",textCls:c.headerTextCls,iconCls:c.iconCls,icon:c.icon,glyph:c.glyph,baseCls:c.baseCls+"-header",tools:e,ui:c.ui,id:c.id+"_header",overCls:c.headerOverCls,indicateDrag:c.draggable,frame:(c.frame||c.alwaysFramed)&&c.frameHeader,ignoreParentFrame:c.frame||c.overlapHeader,ignoreBorderManagement:c.frame||c.ignoreHeaderBorderManagement,ownerCt:c,listeners:c.collapsible&&c.titleCollapse?{click:c.toggleCollapse,scope:c}:null},c.header));c.addDocked(g,0)}c.initHeaderAria()}else{if(g){g.hide()}}},setUI:function(b){var a=this;a.callParent(arguments);if(a.header&&a.header.rendered){a.header.setUI(b)}},getDefaultContentTarget:function(){return this.body},getTargetEl:function(){var a=this;return a.body||a.protoBody||a.frameBody||a.el},isVisible:function(a){var b=this;if(b.collapsed&&b.placeholder){return b.placeholder.isVisible(a)}return b.callParent(arguments)},onHide:function(){var a=this;if(a.collapsed&&a.placeholder){a.placeholder.hide()}else{a.callParent(arguments)}},onShow:function(){var a=this;if(a.collapsed&&a.isPlaceHolderCollapse()){a.setHiddenState(true);a.placeholderCollapse()}else{a.callParent(arguments)}},onRemoved:function(b){var a=this;if(a.placeholder&&!b){a.ownerCt.remove(a.placeholder,false)}a.callParent(arguments)},addTool:function(e){if(!Ext.isArray(e)){e=[e]}var d=this,f=d.header,c,a=e.length,b;for(c=0;c<a;c++){b=e[c];b.toolOwner=d;if(f&&f.isHeader){f.addTool(b)}else{d.tools.push(b)}}d.updateHeader()},getOppositeDirection:function(a){var b=Ext.Component;switch(a){case b.DIRECTION_TOP:return b.DIRECTION_BOTTOM;case b.DIRECTION_RIGHT:return b.DIRECTION_LEFT;case b.DIRECTION_BOTTOM:return b.DIRECTION_TOP;case b.DIRECTION_LEFT:return b.DIRECTION_RIGHT}},getWidthAuthority:function(){if(this.collapsed&&this.collapsedHorizontal()){return 1}return this.callParent()},getHeightAuthority:function(){if(this.collapsed&&this.collapsedVertical()){return 1}return this.callParent()},collapsedHorizontal:function(){var a=this.getCollapsed();return a==="left"||a==="right"},collapsedVertical:function(){var a=this.getCollapsed();return a==="top"||a==="bottom"},restoreDimension:function(){var a=this.collapseDirection;return(a==="top"||a==="bottom")?"height":"width"},getCollapsed:function(){var a=this;if(a.collapsed===true){return a.collapseDirection}return a.collapsed},getState:function(){var a=this,b=a.callParent(),c;b=a.addPropertyToState(b,"collapsed");if(a.collapsed){c=a.collapseMemento;c=c&&c.data;if(a.collapsedVertical()){if(b){delete b.height}if(c){b=a.addPropertyToState(b,"height",c.height)}}else{if(b){delete b.width}if(c){b=a.addPropertyToState(b,"width",c.width)}}}return b},findReExpander:function(g){var f=this,h=Ext.Component,e=f.dockedItems.items,a=e.length,b,d;if(f.collapseMode==="mini"){return}switch(g){case h.DIRECTION_TOP:case h.DIRECTION_BOTTOM:for(d=0;d<a;d++){b=e[d];if(!b.hidden){if(b.isHeader&&(!b.dock||b.dock==="top"||b.dock==="bottom")){return b}}}break;case h.DIRECTION_LEFT:case h.DIRECTION_RIGHT:for(d=0;d<a;d++){b=e[d];if(!b.hidden){if(b.isHeader&&(b.dock==="left"||b.dock==="right")){return b}}}break;default:throw ("Panel#findReExpander must be passed a valid collapseDirection")}},getReExpander:function(c){var b=this,d=c||b.collapseDirection,a=b.reExpander||b.findReExpander(d);b.expandDirection=b.getOppositeDirection(d);if(!a){b.reExpander=a=b.createReExpander(d,{dock:d,cls:Ext.baseCSSPrefix+"docked "+b.baseCls+"-"+b.ui+"-collapsed",isCollapsedExpander:true});b.dockedItems.insert(0,a)}return a},createReExpander:function(e,d){var c=this,g=e==="left",b=e==="right",f=g||b,a=Ext.apply({hideMode:"offsets",title:c.title||"&#160;",titleAlign:c.titleAlign,orientation:f?"vertical":"horizontal",textCls:c.headerTextCls,icon:c.icon,iconCls:c.iconCls,glyph:c.glyph,baseCls:c.self.prototype.baseCls+"-header",ui:c.ui,frame:c.frame&&c.frameHeader,ignoreParentFrame:c.frame||c.overlapHeader,indicateDrag:c.draggable,collapseImmune:true,ownerCt:c.ownerCt,ownerLayout:c.componentLayout,margin:c.margin},d);if(c.collapseMode==="mini"){if(f){a.width=1}else{a.height=1}}if(!c.hideCollapseTool){if(g||(b&&c.isPlaceHolderCollapse())){a.titlePosition=1}a.tools=[{xtype:"tool",type:"expand-"+c.getOppositeDirection(e),uiCls:["top"],handler:c.toggleCollapse,scope:c}]}a=new Ext.panel.Header(a);a.addClsWithUI(c.getHeaderCollapsedClasses(a));return a},getHeaderCollapsedClasses:function(d){var b=this,c=b.collapsedCls,a;a=[c,c+"-"+d.getDockName()];if(b.border&&(!b.frame||(b.frame&&Ext.supports.CSS3BorderRadius))){a.push(c+"-border-"+d.getDockName())}return a},beginCollapse:function(){var e=this,c=e.lastBox,g=e.rendered,b=e.collapseMemento||(e.collapseMemento=new Ext.util.Memento(e)),d=e.getSizeModel(),f=e.header,a;b.capture(["height","minHeight","width","minWidth"]);if(c){b.capture(e.restoreDimension(),c,"last.")}if(e.collapsedVertical()){if(d.width.shrinkWrap){e.width=g?e.getWidth():e.width||e.minWidth||100}delete e.height;e.minHeight=0}else{if(e.collapsedHorizontal()){if(d.height.shrinkWrap){e.height=g?e.getHeight():e.height||e.minHeight||100}delete e.width;e.minWidth=0}}if(e.ownerCt){e.ownerCt.getLayout().beginCollapse(e)}if(!e.isPlaceHolderCollapse()&&f!==false){if(f===(a=e.getReExpander())){f.collapseImmune=true;f.getHierarchyState().collapseImmune=true;f.addClsWithUI(e.getHeaderCollapsedClasses(f));if(f.rendered){f.updateFrame()}}else{if(a.el){a.el.show();a.hidden=false}}}if(e.resizer){e.resizer.disable()}},beginExpand:function(){var e=this,d=e.lastBox,c=e.collapseMemento,a=this.restoreDimension(),f=e.header,b;if(c){c.restore(["minHeight","minWidth",a]);if(d){c.restore(a,true,d,"last.")}}if(e.ownerCt){e.ownerCt.getLayout().beginExpand(e)}if(!e.isPlaceHolderCollapse()&&f!==false){if(f===(b=e.getReExpander())){delete f.collapseImmune;delete f.getHierarchyState().collapseImmune;f.removeClsWithUI(e.getHeaderCollapsedClasses(f));if(f.rendered){f.expanding=true;f.updateFrame();delete f.expanding}}else{b.hidden=true;b.el.hide()}}if(e.resizer){e.resizer.enable()}},collapse:function(d,a){var c=this,e=d||c.collapseDirection,b=c.ownerCt;if(c.isCollapsingOrExpanding){return c}if(arguments.length<2){a=c.animCollapse}if(c.collapsed||c.fireEvent("beforecollapse",c,d,a)===false){return c}if(b&&c.isPlaceHolderCollapse()){return c.placeholderCollapse(d,a)}c.collapsed=e;c.beginCollapse();c.getHierarchyState().collapsed=true;c.fireHierarchyEvent("collapse");return c.doCollapseExpand(1,a)},doCollapseExpand:function(a,b){var d=this,c=d.animCollapse,e=d.ownerLayout;d.animCollapse=b;d.isCollapsingOrExpanding=a;if(b){d.addCls(Ext.baseCSSPrefix+"animating-size")}if(e&&!b){e.onContentChange(d)}else{d.updateLayout({isRoot:true})}d.animCollapse=c;return d},afterCollapse:function(b){var a=this,c=a.ownerLayout;a.isCollapsingOrExpanding=0;a.updateCollapseTool();if(b){a.removeCls(Ext.baseCSSPrefix+"animating-size")}if(c&&b){c.onContentChange(a)}a.setHiddenDocked();a.fireEvent("collapse",a)},setHiddenDocked:function(){var g=this,d=g.hiddenOnCollapse,c=g.getDockedItems(),a=c.length,e=0,f,b;if(g.header!==false){b=g.getReExpander()}d.add(g.body);for(;e<a;e++){f=c[e];if(f&&f!==b&&f.el){d.add(f.el)}}d.setStyle("visibility","hidden")},restoreHiddenDocked:function(){var a=this.hiddenOnCollapse;a.setStyle("visibility","");a.clear()},getPlaceholder:function(e){var d=this,g=e||d.collapseDirection,c=null,f=d.placeholder,b=d.floatable,a=d.titleCollapse;if(!f){if(b||(d.collapsible&&a)){c={click:{fn:(!a&&b)?d.floatCollapsedPanel:d.toggleCollapse,element:"el",scope:d}}}d.placeholder=f=Ext.widget(d.createReExpander(g,{id:d.id+"-placeholder",listeners:c}))}if(!f.placeholderFor){if(!f.isComponent){d.placeholder=f=d.lookupComponent(f)}Ext.applyIf(f,{margins:d.margins,placeholderFor:d});f.addCls([Ext.baseCSSPrefix+"region-collapsed-placeholder",Ext.baseCSSPrefix+"region-collapsed-"+g+"-placeholder",d.collapsedCls])}return f},placeholderCollapse:function(f,a){var d=this,c=d.ownerCt,h=f||d.collapseDirection,b=Ext.baseCSSPrefix+"border-region-slide-in",g=d.getPlaceholder(h),e;d.isCollapsingOrExpanding=1;d.setHiddenState(true);d.collapsed=h;if(g.rendered){if(g.el.dom.parentNode!==d.el.dom.parentNode){d.el.dom.parentNode.insertBefore(g.el.dom,d.el.dom)}g.hidden=false;g.el.show();c.updateLayout()}else{c.insert(c.items.indexOf(d),g)}if(d.rendered){d.el.setVisibilityMode(d.placeholderCollapseHideMode);if(a){d.el.addCls(b);g.el.hide();e=d.convertCollapseDir(h);d.el.slideOut(e,{preserveScroll:true,duration:Ext.Number.from(a,Ext.fx.Anim.prototype.duration),listeners:{afteranimate:function(){d.el.removeCls(b);g.el.show().setStyle("display","none").slideIn(e,{easing:"linear",duration:100,listeners:{afteranimate:function(){g.focus();d.isCollapsingOrExpanding=0;d.fireEvent("collapse",d)}}})}}})}else{d.el.hide();d.isCollapsingOrExpanding=0;d.fireEvent("collapse",d)}}else{d.isCollapsingOrExpanding=0;if(!d.preventCollapseFire){d.fireEvent("collapse",d)}}return d},floatCollapsedPanel:function(){var c=this,h=c.placeholder,g=h.getSize(),d,b=Ext.baseCSSPrefix+"border-region-slide-in",f=c.collapsed,e=c.ownerCt||c,a;if(c.isSliding){return}if(c.el.hasCls(b)){c.slideOutFloatedPanel();return}c.isSliding=true;h.el.hide();h.hidden=true;c.el.show();c.setHiddenState(false);c.collapsed=false;e.updateLayout();d=c.getBox(false,true);h.el.show();h.hidden=false;c.el.hide();c.setHiddenState(true);c.collapsed=f;e.updateLayout();c.slideOutTask=c.slideOutTask||new Ext.util.DelayedTask(c.slideOutFloatedPanel,c);h.el.on("mouseleave",c.onMouseLeaveFloated,c);c.el.on("mouseleave",c.onMouseLeaveFloated,c);h.el.on("mouseenter",c.onMouseEnterFloated,c);c.el.on("mouseenter",c.onMouseEnterFloated,c);c.el.addCls(b);c.floated=true;if(c.collapseTool){c.collapseTool.el.hide()}switch(c.collapsed){case"top":c.setLocalXY(d.x,d.y+g.height-1);break;case"right":c.setLocalXY(d.x-g.width+1,d.y);break;case"bottom":c.setLocalXY(d.x,d.y-g.height+1);break;case"left":c.setLocalXY(d.x+g.width-1,d.y);break}a=c.convertCollapseDir(c.collapsed);c.floatedFromCollapse=c.collapsed;c.collapsed=false;c.setHiddenState(false);c.el.slideIn(a,{preserveScroll:true,duration:Ext.Number.from(c.animCollapse,Ext.fx.Anim.prototype.duration),listeners:{afteranimate:function(){c.isSliding=false;c.fireEvent("float",c)}}})},onMouseLeaveFloated:function(a){this.slideOutTask.delay(500)},onMouseEnterFloated:function(a){this.slideOutTask.cancel()},isLayoutRoot:function(){if(this.floatedFromCollapse){return true}return this.callParent()},slideOutFloatedPanel:function(){var a=this,c=this.el,b;if(a.isSliding||a.isDestroyed){return}a.isSliding=true;a.floated=false;a.slideOutFloatedPanelBegin();if(typeof a.collapsed=="string"){b=a.convertCollapseDir(a.collapsed)}c.slideOut(b,{preserveScroll:true,duration:Ext.Number.from(a.animCollapse,Ext.fx.Anim.prototype.duration),listeners:{afteranimate:function(){a.slideOutFloatedPanelEnd();a.el.removeCls(Ext.baseCSSPrefix+"border-region-slide-in")}}})},slideOutFloatedPanelBegin:function(){var b=this,c=b.placeholder.el,a=b.el;b.collapsed=b.floatedFromCollapse;b.setHiddenState(true);b.floatedFromCollapse=null;c.un("mouseleave",b.onMouseLeaveFloated,b);a.un("mouseleave",b.onMouseLeaveFloated,b);c.un("mouseenter",b.onMouseEnterFloated,b);a.un("mouseenter",b.onMouseEnterFloated,b)},slideOutFloatedPanelEnd:function(){var a=this;if(a.collapseTool){a.collapseTool.el.show()}a.slideOutTask.cancel();a.isSliding=false;a.fireEvent("unfloat",a)},expand:function(a){var b=this;if(b.isCollapsingOrExpanding){return b}if(!arguments.length){a=b.animCollapse}if(!b.collapsed&&!b.floatedFromCollapse){return b}if(b.fireEvent("beforeexpand",b,a)===false){return b}delete this.getHierarchyState().collapsed;if(b.isPlaceHolderCollapse()){return b.placeholderExpand(a)}b.restoreHiddenDocked();b.beginExpand();b.collapsed=false;return b.doCollapseExpand(2,a)},placeholderExpand:function(c){var e=this,g=e.collapsed,d=Ext.baseCSSPrefix+"border-region-slide-in",f,b,a=e.ownerLayout?e.ownerLayout.centerRegion:null;if(Ext.AbstractComponent.layoutSuspendCount){c=false}if(e.floatedFromCollapse){b=e.getPosition(true);e.slideOutFloatedPanelBegin();e.slideOutFloatedPanelEnd();e.floated=false}if(c){Ext.suspendLayouts();e.placeholder.hide();e.el.show();e.collapsed=false;e.setHiddenState(false);if(a&&!b){a.hidden=true}Ext.resumeLayouts(true);a.hidden=false;e.el.addCls(d);e.isCollapsingOrExpanding=2;if(b){f=e.getXY();e.setLocalXY(b[0],b[1]);e.setXY([f[0],f[1]],{duration:Ext.Number.from(c,Ext.fx.Anim.prototype.duration),listeners:{afteranimate:function(){e.el.removeCls(d);e.isCollapsingOrExpanding=0;e.fireEvent("expand",e)}}})}else{e.el.hide();e.placeholder.el.show();e.placeholder.hidden=false;e.setHiddenState(false);e.el.slideIn(e.convertCollapseDir(g),{preserveScroll:true,duration:Ext.Number.from(c,Ext.fx.Anim.prototype.duration),listeners:{afteranimate:function(){e.el.removeCls(d);e.placeholder.hide();e.updateLayout();e.isCollapsingOrExpanding=0;e.fireEvent("expand",e)}}})}}else{e.floated=e.collapsed=false;e.el.removeCls(d);Ext.suspendLayouts();e.placeholder.hide();e.show();Ext.resumeLayouts(true);e.fireEvent("expand",e)}return e},afterExpand:function(b){var a=this,c=a.ownerLayout;a.isCollapsingOrExpanding=0;a.updateCollapseTool();if(b){a.removeCls(Ext.baseCSSPrefix+"animating-size")}if(c&&b){c.onContentChange(a)}a.fireEvent("expand",a);a.fireHierarchyEvent("expand")},setBorder:function(a,c){if(c){return}var b=this,d=b.header;if(!a){a=0}else{if(a===true){a="1px"}else{a=b.unitizeBox(a)}}if(d){if(d.isHeader){d.setBorder(a)}else{d.border=a}}if(b.rendered&&b.bodyBorder!==false){b.body.setStyle("border-width",a)}b.updateLayout();b.border=a},toggleCollapse:function(){return(this.collapsed||this.floatedFromCollapse)?this.expand():this.collapse()},getKeyMap:function(){return this.keyMap||(this.keyMap=new Ext.util.KeyMap(Ext.apply({target:this.el},this.keys)))},initDraggable:function(){if(this.simpleDrag){this.initSimpleDraggable()}else{this.dd=new Ext.panel.DD(this,Ext.isBoolean(this.draggable)?null:this.draggable)}},initSimpleDraggable:function(){var c=this,b,a;if(!c.header){c.updateHeader(true)}if(c.header){b=Ext.applyIf({el:c.el,delegate:"#"+Ext.escapeId(c.header.id)},c.draggable);if(c.constrain||c.constrainHeader){b.constrain=c.constrain;b.constrainDelegate=c.constrainHeader;b.constrainTo=c.constrainTo||c.container}a=c.dd=new Ext.util.ComponentDragger(this,b);c.relayEvents(a,["dragstart","drag","dragend"]);if(c.maximized){a.disable()}}},ghostTools:function(){var e=[],f=this.header,d=f?f.query("tool[hidden=false]"):[],c,a,b;if(d.length){c=0;a=d.length;for(;c<a;c++){b=d[c];e.push({type:b.type})}}else{e=[{type:"placeholder"}]}return e},ghost:function(a){var d=this,b=d.ghostPanel,c=d.getBox(),e;if(!b){b=new Ext.panel.Panel({renderTo:Ext.getBody(),floating:{shadow:false},frame:d.frame&&!d.alwaysFramed,alwaysFramed:d.alwaysFramed,overlapHeader:d.overlapHeader,headerPosition:d.headerPosition,baseCls:d.baseCls,cls:d.baseCls+"-ghost "+(a||"")});d.ghostPanel=b}else{b.el.show()}d.ghostPanel.hidden=false;b.floatParent=d.floatParent;if(d.floating){b.zIndexManager.assignZIndices()}else{b.toFront()}if(!(d.preventHeader||(d.header===false))){e=b.header;if(e){e.suspendLayouts();Ext.Array.forEach(e.query("tool"),e.remove,e);e.resumeLayouts()}b.addTool(d.ghostTools());b.setTitle(d.title);if(d.iconCls){b.setIconCls(d.iconCls)}else{if(d.icon){b.setIcon(d.icon)}else{if(d.glyph){b.setGlyph(d.glyph)}}}b.header.addCls(Ext.baseCSSPrefix+"header-ghost")}b.setPagePosition(c.x,c.y);b.setSize(c.width,c.height);d.el.hide();return b},unghost:function(b,a){var c=this;if(!c.ghostPanel){return}if(b!==false){c.el.show();if(a!==false){c.setPagePosition(c.ghostPanel.getXY());if(c.hideMode=="offsets"){delete c.el.hideModeStyles}}Ext.defer(c.focus,10,c)}c.ghostPanel.el.hide();c.ghostPanel.hidden=true},beginDrag:function(){if(this.floatingDescendants){this.floatingDescendants.hide()}},endDrag:function(){if(this.floatingDescendants){this.floatingDescendants.show()}},initResizable:function(){this.callParent(arguments);if(this.collapsed){this.resizer.disable()}},convertCollapseDir:function(a){return a.substr(0,1)}},function(){this.prototype.animCollapse=Ext.enableFx});