!function(){Bootstrap.BsWizardStep=Bootstrap.ItemView.extend(Bootstrap.ItemSelection,Bootstrap.NavItem,{classNames:["wizard-step"],classNameBindings:["completed"],completed:!1,template:Ember.Handlebars.compile(["{{view view.stepAsLink}}"].join("\n")),stepAsLink:Ember.View.extend({tagName:"a",template:Ember.Handlebars.compile("{{view.parentView.title}}"),attributeBindings:["href"],href:"#"})}),Bootstrap.BsWizardSteps=Bootstrap.ItemsView.extend(Bootstrap.Nav,{navType:"pills",classNames:["wizard-steps"],itemViewClass:Bootstrap.BsWizardStep,currentItemIdx:function(){var a,b,c,d,e,f,g;for(b=this.get("selected"),a=0,g=this._childViews,e=0,f=g.length;f>e;e++){if(d=g[e],d.get("content")===b){c=d;break}a++}return c?a:null}.property("selected")}),Bootstrap.BsWizardStepPane=Bootstrap.ItemPaneView.extend(),Bootstrap.BsWizardStepsPanes=Bootstrap.ItemsPanesView.extend({classNames:["wizard-panes"],itemViewClass:Bootstrap.BsWizardStepPane}),Bootstrap.BsWizardComponent=Ember.ContainerView.extend(Ember.TargetActionSupport,{classNames:["wizard"],childViews:["steps","panes","controls"],prevAllowed:!0,items:function(){var a;return null!=(a=this._childViews)?a[0]:void 0}.property("content"),panes:function(){return this._childViews[1]}.property("content"),steps:Bootstrap.BsWizardSteps.extend({contentBinding:"parentView.content",selectedBinding:"parentView.selected"}),panes:Bootstrap.BsWizardStepsPanes.extend({contentBinding:"parentView.content"}),controls:Ember.ContainerView.extend({childViews:["prev","next","finish"],prev:Bootstrap.BsButtonComponent.extend({layoutName:"components/bs-button",title:"Prev",size:"xs","data-rel":"PREV",isVisible:function(){return this.get("parentView").get("parentView").get("hasPrev")}.property("parentView.parentView.items.selected")}),next:Bootstrap.BsButtonComponent.extend({layoutName:"components/bs-button",title:"Next",size:"xs","data-rel":"NEXT",isVisible:function(){return this.get("parentView").get("parentView").get("hasNext")}.property("parentView.parentView.items.selected")}),finish:Bootstrap.BsButtonComponent.extend({layoutName:"components/bs-button",title:"Finish",size:"xs","data-rel":"FINISH",isVisible:function(){return this.get("parentView").get("parentView").get("isLast")}.property("parentView.parentView.items.selected")})}),currentStepIdx:function(){return this.get("items").get("currentItemIdx")}.property("items.selected"),willInsertElement:function(){return this.get("panes").set("items-id",this.get("items").get("elementId")),this.get("items").set("default",this.get("items")._childViews[0].get("content").get("title"))},click:function(a){var b;return b=a.target.getAttribute("data-rel"),"PREV"===b&&this.prev(),"NEXT"===b&&this.next(),"FINISH"===b?this.close():void 0},next:function(){var a;return this.get("hasNext")?(this.stepCompleted(this.get("currentStepIdx")),a=this.get("currentStepIdx")+1,this.move(a),this.triggerAction({action:"onNext",actionContext:this.get("targetObject")})):void 0},prev:function(){var a;return this.get("hasPrev")?(a=this.get("currentStepIdx")-1,this.stepCompleted(a,!1),this.move(a),this.triggerAction({action:"onPrev",actionContext:this.get("targetObject")})):void 0},move:function(a){var b,c;return null!=(b=this._childViews[0])?b.set("selected",null!=(c=this._childViews[0]._childViews[a])?c.get("content"):void 0):void 0},hasNext:function(){return this.get("items")._childViews.length>this.get("currentStepIdx")+1}.property("currentStepIdx"),hasPrev:function(){return this.get("currentStepIdx")>0,this.get("currentStepIdx")>0&&this.get("prevAllowed")}.property("currentStepIdx"),isLast:function(){return this.get("items")._childViews.length===this.get("currentStepIdx")+1}.property("currentStepIdx"),close:function(){return this.triggerAction({action:"onFinish",actionContext:this.get("targetObject")}),this.destroy()},stepCompleted:function(a,b){return null==b&&(b=!0),this._childViews[0]._childViews[a].set("completed",b)}}),Bootstrap.BsWizardComponent=Bootstrap.BsWizardComponent.reopenClass({build:function(a){var b;return a||(a={}),a.manual=!0,b=this.create(a),b.append()}}),Ember.Handlebars.helper("bs-wizard",Bootstrap.BsWizardComponent)}.call(this);