define(["jquery"],function(e){var t;return t=function(t){var n,r,i=this;return this.element=e(t),this.slideWidth=this.element.width(),(r=this.element.children(".panel-toggle"))[0]&&(r.on("click",function(){return i.element.panel("toggle")}),this.slideWidth-=r.width()),this.state=1,this.element.hasClass("panel-right")?this.side="right":this.side="left",this.element.hasClass("closed")&&(this.state=0,(n={})[this.side]=-this.slideWidth,this.element.css(n).show()),this},t.prototype={constructor:t,open:function(){var e;if(!this.state)return this.state=1,(e={})[this.side]=0,this.element.animate(e,300).removeClass("closed")},close:function(){var e;if(this.state)return this.state=0,(e={})[this.side]=-this.slideWidth,this.element.animate(e,300).addClass("closed")},toggle:function(){return this.state?this.close():this.open()}},e.fn.panel=function(n){return this.each(function(){var r,i;r=e(this),i=r.data("panel"),i||r.data("panel",i=new t(this));if(typeof n=="string")return i[n]()})},e.fn.panel.Constructor=t,e(function(){return e(".panel").panel(),e("[data-toggle*=panel]").each(function(){var t;return(t=e(this)).on("click",function(){var n;return t.data("target")?n=e(t.data("target")):n=t.parent(),n.panel("toggle")})})})})