(function(n){var t=function(t,i){var t=n(t),u=this,e='li:has([data-toggle="tab"])',s=[],r=n.extend({},n.fn.bootstrapWizard.defaults,i),o=null,f=null,h,c;if(this.rebindClick=function(n,t){n.unbind("click",t).bind("click",t)},this.fixNavigationButtons=function(){return o.length||(f.find("a:first").tab("show"),o=f.find(e+":first")),n(r.previousSelector,t).toggleClass("disabled",u.firstIndex()>=u.currentIndex()),n(r.nextSelector,t).toggleClass("disabled",u.currentIndex()>=u.navigationLength()),n(r.nextSelector,t).toggleClass("hidden",u.currentIndex()>=u.navigationLength()&&n(r.finishSelector,t).length>0),n(r.lastSelector,t).toggleClass("hidden",u.currentIndex()>=u.navigationLength()&&n(r.finishSelector,t).length>0),n(r.finishSelector,t).toggleClass("hidden",u.currentIndex()<u.navigationLength()),n(r.backSelector,t).toggleClass("disabled",s.length==0),n(r.backSelector,t).toggleClass("hidden",u.currentIndex()>=u.navigationLength()&&n(r.finishSelector,t).length>0),u.rebindClick(n(r.nextSelector,t),u.next),u.rebindClick(n(r.previousSelector,t),u.previous),u.rebindClick(n(r.lastSelector,t),u.last),u.rebindClick(n(r.firstSelector,t),u.first),u.rebindClick(n(r.finishSelector,t),u.finish),u.rebindClick(n(r.backSelector,t),u.back),r.onTabShow&&typeof r.onTabShow=="function"&&r.onTabShow(o,f,u.currentIndex())===!1?!1:void 0},this.next=function(){if(t.hasClass("last")||r.onNext&&typeof r.onNext=="function"&&r.onNext(o,f,u.nextIndex())===!1)return!1;var n=u.currentIndex();$index=u.nextIndex();$index>u.navigationLength()||(s.push(n),f.find(e+":eq("+$index+") a").tab("show"))},this.previous=function(){if(t.hasClass("first")||r.onPrevious&&typeof r.onPrevious=="function"&&r.onPrevious(o,f,u.previousIndex())===!1)return!1;var n=u.currentIndex();$index=u.previousIndex();$index<0||(s.push(n),f.find(e+":eq("+$index+") a").tab("show"))},this.first=function(){if(r.onFirst&&typeof r.onFirst=="function"&&r.onFirst(o,f,u.firstIndex())===!1||t.hasClass("disabled"))return!1;s.push(u.currentIndex());f.find(e+":eq(0) a").tab("show")},this.last=function(){if(r.onLast&&typeof r.onLast=="function"&&r.onLast(o,f,u.lastIndex())===!1||t.hasClass("disabled"))return!1;s.push(u.currentIndex());f.find(e+":eq("+u.navigationLength()+") a").tab("show")},this.finish=function(){if(r.onFinish&&typeof r.onFinish=="function")r.onFinish(o,f,u.lastIndex())},this.back=function(){if(s.length==0)return null;var n=s.pop();if(r.onBack&&typeof r.onBack=="function"&&r.onBack(o,f,n)===!1)return s.push(n),!1;t.find(e+":eq("+n+") a").tab("show")},this.currentIndex=function(){return f.find(e).index(o)},this.firstIndex=function(){return 0},this.lastIndex=function(){return u.navigationLength()},this.getIndex=function(n){return f.find(e).index(n)},this.nextIndex=function(){return f.find(e).index(o)+1},this.previousIndex=function(){return f.find(e).index(o)-1},this.navigationLength=function(){return f.find(e).length-1},this.activeTab=function(){return o},this.nextTab=function(){return f.find(e+":eq("+(u.currentIndex()+1)+")").length?f.find(e+":eq("+(u.currentIndex()+1)+")"):null},this.previousTab=function(){return u.currentIndex()<=0?null:f.find(e+":eq("+parseInt(u.currentIndex()-1)+")")},this.show=function(n){var i=isNaN(n)?t.find(e+" a[href=#"+n+"]"):t.find(e+":eq("+n+") a");i.length>0&&(s.push(u.currentIndex()),i.tab("show"))},this.disable=function(n){f.find(e+":eq("+n+")").addClass("disabled")},this.enable=function(n){f.find(e+":eq("+n+")").removeClass("disabled")},this.hide=function(n){f.find(e+":eq("+n+")").hide()},this.display=function(n){f.find(e+":eq("+n+")").show()},this.remove=function(t){var u=t[0],o=typeof t[1]!="undefined"?t[1]:!1,i=f.find(e+":eq("+u+")"),r;o&&(r=i.find("a").attr("href"),n(r).remove());i.remove()},h=function(t){var i=f.find(e),s=i.index(n(t.currentTarget).parent(e)),h=n(i[s]);if(r.onTabClick&&typeof r.onTabClick=="function"&&r.onTabClick(o,f,u.currentIndex(),s,h)===!1)return!1},c=function(t){$element=n(t.target).parent();var i=f.find(e).index($element);if($element.hasClass("disabled")||r.onTabChange&&typeof r.onTabChange=="function"&&r.onTabChange(o,f,u.currentIndex(),i)===!1)return!1;o=$element;u.fixNavigationButtons()},this.resetWizard=function(){n('a[data-toggle="tab"]',f).off("click",h);n('a[data-toggle="tab"]',f).off("shown shown.bs.tab",c);f=t.find("ul:first",t);o=f.find(e+".active",t);n('a[data-toggle="tab"]',f).on("click",h);n('a[data-toggle="tab"]',f).on("shown shown.bs.tab",c);u.fixNavigationButtons()},f=t.find("ul:first",t),o=f.find(e+".active",t),f.hasClass(r.tabClass)||f.addClass(r.tabClass),r.onInit&&typeof r.onInit=="function")r.onInit(o,f,0);if(r.onShow&&typeof r.onShow=="function")r.onShow(o,f,u.nextIndex());n('a[data-toggle="tab"]',f).on("click",h);n('a[data-toggle="tab"]',f).on("shown shown.bs.tab",c)};n.fn.bootstrapWizard=function(i){if(typeof i=="string"){var r=Array.prototype.slice.call(arguments,1);return r.length===1&&r.toString(),this.data("bootstrapWizard")[i](r)}return this.each(function(){var r=n(this),u;r.data("bootstrapWizard")||(u=new t(r,i),r.data("bootstrapWizard",u),u.fixNavigationButtons())})};n.fn.bootstrapWizard.defaults={tabClass:"nav nav-pills",nextSelector:".wizard li.next",previousSelector:".wizard li.previous",firstSelector:".wizard li.first",lastSelector:".wizard li.last",finishSelector:".wizard li.finish",backSelector:".wizard li.back",onShow:null,onInit:null,onNext:null,onPrevious:null,onLast:null,onFirst:null,onFinish:null,onBack:null,onTabChange:null,onTabClick:null,onTabShow:null}})(jQuery),function(n,t,i){function h(n,i,u){return u===0?(t("#feedback-wizard-previous, #feedback-wizard-send").addClass("hidden"),t("#feedback-wizard-next").removeClass("hidden"),!1):(r.$captcha.captcha("refresh"),t("#feedback-wizard-next").addClass("hidden"),t("#feedback-wizard-previous, #feedback-wizard-send").removeClass("hidden disabled"),t("#feedback-name").val()===""?t("#feedback-name").focus():t("#feedback-text").focus(),!1)}function c(n,i,u){return u===1&&t.ajax({url:"/Api/V1/Bidopia/Feedback",type:"GET",success:function(n){r.$form.validate().resetForm();r.$form.validate().reset();t("#feedback-name").val(n.name);t("#feedback-email").val(n.email);t("#feedback-phone").val(n.phone);t("#feedback-name").val()===""?t("#feedback-name").focus():t("#feedback-text").focus()}}),!0}function f(){r.$form.validate().resetForm();r.$form.validate().reset();r.$captcha.captcha("clear");r.$wizard.bootstrapWizard("first");r.$modal.modal("hide");r.$form.find("input[type=text], textarea").val("")}function o(){return this.each(function(){var n=t(this),i=n.data("feedback-plugin"),r=t.extend({},n.data());i||n.data("feedback-plugin",i=new u(this,r));i.show()})}function s(){var n=t(this);n.is("a")&&e.preventDefault();o.call(n)}var r,u=function(n,u){if(this.options=u,r==i){r={$modal:t("#feedback-modal"),$wizard:t("#feedback-wizard"),$responseModal:t("#feedback-response-modal"),$successTitle:t("#feedback-response-success-title"),$faiiureTitle:t("#feedback-response-failure-title"),$responseMessage:t("#feedback-response-message"),$captcha:t("#feedback-form").captcha("feedback")};r.$wizard=r.$wizard.bootstrapWizard({onTabShow:h,onNext:c});r.$form=t("#feedback-form").ajaxForm({statusHandlers:{200:function(n){n.result?(r.$successTitle.removeClass("hidden"),r.$faiiureTitle.addClass("hidden")):(r.$successTitle.removeClass("hidden"),r.$faiiureTitle.addClass("hidden"));f(null);r.$responseMessage.text(n.message);r.$responseModal.modal("show")},400:function(){r.$captcha.captcha("refresh")}}});t("#feedback-wizard-cancel").on("click",f)}};u.prototype.show=function(){var n=this.options;r.$modal.modal("show")};u.prototype._getBidopiaHelpSuccess=function(n){var i=t("#bidding-help-modal");return t("#bidding-help-body").html(n).find("table").removeAttr("width"),this.$loadingBar.loadingBar("hide"),!1};t.fn.feedback=o;t.fn.feedback.Constructor=u;t(n).on("click.bidopia.feedback.data-api",".btn-feedback, .feedback",function(){s()});t(n).on("click.bidopia.feedback.data-api",".lot-feedback",function(){s();t("#feedback-wizard-next").click();t("#feedback-type-auction-lot").prop("checked",!0)})}(document,jQuery)