!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("intersect-observer",["require","exports","jquery"],e)}((function(e,t){function n(e,t){if(!function(e){return Array.isArray?Array.isArray(e):e&&"[object Array]"===Object.prototype.toString.call(e)}(e))throw new TypeError("forEach called on a non-array type value. The given value is "+typeof e);for(var n,s=e.length-1;s>=0&&("boolean"!=typeof(n=t.call(e,e[s],s,e))||n);s--);}function s(e){return null==e||void 0===e}function i(e,t){void 0===e&&(e=.5),void 0===t&&(t=250),this._intersectionObserver=null,this.threshold=e,this.scrollwait=t,this._viewport=null,this._obsEl=[],this._intersected=[],this._scrolltimer=null,this._GetViewportSize(),this._OnScroll=this._OnScroll.bind(this),this._OnResize=this._OnResize.bind(this);var n=!1;try{var s=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("test",s,s),window.removeEventListener("test",s,s)}catch(e){n=!1}window.addEventListener("scroll",this._OnScroll,!!n&&{passive:!0}),window.addEventListener("resize",this._OnResize)}return i.prototype._OnScroll=function(){var e=this;clearTimeout(e._scrolltimer),e._scrolltimer=setTimeout((function(){e._intersectionObserver?(n(e._intersected,(function(t){var s;n(e._obsEl,(function(e,n){if(e&&e.el==t)return s=n,!1}));var i=e._obsEl[s];i&&(i.handler(),e._obsEl[s]=null,e._intersectionObserver.unobserve(t))})),e._intersected=[]):e.CheckInView()}),e.scrollwait)},i.prototype._OnResize=function(){var e=this;requestAnimationFrame((function(){e._GetViewportSize(),e._intersectionObserver||e.CheckInView()}))},i.prototype.Destroy=function(){this._intersected=null,this._obsEl=null,this._obs=null,window.removeEventListener("scroll",this._OnScroll),window.removeEventListener("resize",this._OnResize)},i.prototype.Observe=function(e,t){var s=this,i=-1;n(this._obsEl,(function(t,n){if(t&&t.el==e)return i=n,!1})),i<0?(this._obsEl.push({el:e,handler:t}),i=this._obsEl.length-1):this._obsEl[i].handler=t,requestAnimationFrame((function(){s._InViewport(e)?(s._obsEl[i]=null,s._intersectionObserver&&s._intersectionObserver.unobserve(e),t()):s._intersectionObserver&&(s._intersectionObserver.unobserve(e),s._intersectionObserver.unobserve(e))}))},i.prototype.Unobserve=function(e){var t;n(this._obsEl,(function(n,s){if(n&&n.el==e)return t=s,!1})),t>-1&&(this._obsEl[t]=null,this._intersectionObserver&&this._intersectionObserver.unobserve(e))},i.prototype._GetViewportSize=function(){var e=window;null!=e.innerWidth&&(this._viewport={w:e.innerWidth,h:e.innerHeight})},i.prototype._InViewport=function(e){if(!this._viewport)return!1;var t=e instanceof Element?e.getBoundingClientRect():e.boundingClientRect,n=t.height||t.bottom-t.top,s=t.width||t.right-t.left;return!(!n||!s||t.top+t.height*this.threshold>this._viewport.h||t.bottom<0)},i.prototype.CheckForIntersection=function(e){this._intersected=[];for(var t=0,n=e.length;t<n;t++){var i=e[t],a=e[t].target;(i.isIntersecting||s(i.isIntersecting)&&this._InViewport(i))&&this._intersected.push(a)}},i.prototype.CheckInView=function(){var e=this,t=[];this._obsEl&&n(this._obsEl,(function(n,s){n&&e._InViewport(n.el)?n.handler():t.push(n)})),this._obsEl=t},i.prototype.PixelObserve=function(t,n,s){e(["cookie-helper","jquery"],(function(i){var a=e("jquery"),o=a.fn.Uniqid(),r=a.fn.Uniqid();this.Observe(t,(function(){a.get("/pixel.png",Object.assign({adview_id:o,adview_offer_type:n,adview_page:window.location.pathname},s))})),a(t).on("click",(function(){if("Personal_Loan_PQ_Button"==n){var e=JSON.stringify({view:o,click:r,type:n,adview_page:window.location.pathname});try{window.sessionStorage.setItem("mw_prequal_start",e)}catch(t){i.create("mw_prequal_start",e,0)}}a.get("/pixel.png",Object.assign({adview_id:o,adview_offer_type:n,adview_page:window.location.pathname,adview_click:r},s))}))}))},i})),define("stQna",["require","exports","stApp","angular","cookie-helper","wh.jsencrypt","intersect-observer"],(function(e,t){function n(){return null!=c.match(/iPhone|iPad|iPod/i)||d&&null!=d.match(/iPhone|iPad|iPod/i)}var s=e("stApp"),i=e("angular"),a=e("cookie-helper"),o=e("wh.jsencrypt"),r=e("intersect-observer"),l=i.element,c=navigator.userAgent,d=navigator.platform?navigator.platform:"";s.register.factory("$question-resolver",(function(){var e;return{set:function(t){e=t},clear:function(){e=null},get:function(){return e}}})),s.register.controller("CommunitySearchController",["$rootScope","$scope","$element","$timeout","$question-resolver","$http","$q","$window","$location",function(t,s,o,c,d,u,p,f,h){function m(e){i.forEach(e,(function(e){var t=e.ques_content,n=document.createElement("div");n.innerHTML=t,e.ques_content_label=n.innerText,i.forEach(e.answers||[],(function(e){i.isArray(e.content)&&2==e.content.length&&"[[:hellip:]]"==e.content[0]?e.content_parsed=e.content[1]||"":e.content_parsed=function(e){var t="<span class='ellipsis' aria-hidden='true' tabindex='-1'>&hellip;</span><br><span data-hm-tap='morelink($event);' class='more-link' tabindex='0' role='button'>show more <i class='af-icon-down-open' ng-aria-hidden></i></span>";return i.isArray(e.content)&&2==e.content.length?"<div class='condensed'>"+e.content[0].replace("[[:hellip:]]",t)+"</div><div class='hidden'>"+e.content[1]+"</div><span data-hm-tap='lesslink($event);' class='less-link' tabindex='0' role='button'>show less <i class='af-icon-up-open' ng-aria-hidden></i></span>":e.content.replace("[[:hellip:]]",t)}(e)}))}))}s.is_curi_left_filter_template=!1,i.element().cssSelect("body").hasClass("curi-with-left-filter")&&(s.is_curi_left_filter_template=!0),s.comsearch_q_link=function(e){return"/answers/"+e.ques_slug+"-"+e.id.replace(/^q/,"")+"/"},s.has_cards_disclosure=function(){return document.querySelector(".non-aff-disc")},s.go_to_cards_disclosure=function(){var e=document.getElementById("cards-disclosure");window.scrollTo(0,e.offsetTop+50)},s.morelink=function(e){l(e.target).closest(".answer-content").addClass("more")},s.lesslink=function(e){l(e.target).closest(".answer-content").removeClass("more")},s.open_sort=function(e){l(e.target).next(".popup-list").addClass("show")},s.comresults_loading=!1,s.sort_ans_opts=[["Most Popular","mp"],["Most Upvotes","mv"]],s.ans_sort="mp",s.$watch("ans_sort",(function(e,t){e!=t&&u({url:"/ajax.php",params:{action:"Answers.CommunityQASort",uri:document.location.pathname,sort_by:e}}).then((function(e){var t=e.data,n=l(o),i=n.find(".questions");i.html(t.html),i.find(".answer-user-avatar[data-src]").each((function(){var e=l(this);e.attr("src",e.attr("data-src")),e.removeAttr("data-src"),e.addClass("answer-user-avatar-load"),e.css({display:"block"})})),n.data("qp",1),s.is_curi_left_filter_template?1==t.pages?l(o).find(".ftrbtns .viewmore").addClass("ng-hide"):l(o).find(".ftrbtns .viewmore").removeClass("ng-hide"):1==t.pages?l(o).find(".ftrbtns .viewmore").remove():0==l(o).find(".ftrbtns .viewmore").length&&l("<span class='btn blank grey no-decoration viewmore'><span class='txt'>View More Questions</span><span class='af-icon-spin6 animate-spin'></span></span>").prependTo(l(o).find(".ftrbtns")),setTimeout((function(){l(o).find(".questions .question .main-q .more-info").each((function(){var e=l(this);e.prop("scrollHeight")<=e.prop("offsetHeight")+(e.find("span.match").length>0?2:0)&&e.next(".more-info-more").remove()}))}),150)}))})),s.showUserGeneratedDisc=!1,s.showMoreDisc=function(e,t){s.showUserGeneratedDisc="more"==t},s.isShowIntroQA=!1,s.showIntroQA=function(e,t){"more"==t?(s.isShowIntroQA=!0,c((function(){s.isShowIntroQA=!0}))):s.isShowIntroQA=!1},s.autoExpand=function(e){var t="object"==typeof e?e.target:document.getElementById(e),n=t.offsetHeight-t.clientHeight;t.style.height="auto",t.style.height=t.scrollHeight+n+"px"},s.live_status="",l(o).on("click",".questions .question .main-q .more-info-more span[class$=-link]",(function(){l(this).closest(".main-q").toggleClass("more")})).on("click",".questions .question .main-q .reply",(function(){function t(t){var s=c[0];c.show().trigger("focus").hide();var i=c.data("ckeditor-instance");i?i.setValue(t||""):e(["input-ckeditor"],(function(e){var i=e(s,{},t,!0);i.ready((function(e){e?c.data("ckeditor-instance",i):(s.show().focus(),n.attr("aria-expanded","true"))}))}))}var n=l(this),s=n.closest(".question"),o=s.data("id"),r=s.find(".replyform"),c=r.find(".editor-content"),d=a.read("mw_signon")||"{}",p=a.is_logged_in();d.length>2&&"{"==d.charAt(0)&&"}"==d.charAt(d.length-1)&&(d=i.fromJson(d),i.isObject(d)&&"pp"in d&&r.find(".avatar img").attr("src",d.pp)),s.addClass("show-reply"),o&&0===o.indexOf("q")&&(o=o.substring(1)),p?(r.addClass("disabled"),c.attr("disabled","disabled"),u({url:"/ajax.php",params:{action:"Answers.QuestionHasAnswered",qid:o}}).then((function(e){r.removeClass("disabled"),c.removeAttr("disabled");var n=e.data;"answer"in n?t(n.answer):t()}),(function(e){401!=e.status?(s.removeClass("disabled"),c.removeAttr("disabled"),t()):top.location.href="/join/light?lg&redirect_to="+encodeURIComponent(document.location.href)}))):t()})).on("click",".questions .question .replyform .hide-reply",(function(){l(this).closest(".question").removeClass("show-reply");var e=l(this).closest(".question").find(".main-q .reply");e.attr("aria-expanded","false"),e.trigger("focus")})).on("click",".questions .question .replyform .submit",(function(){var e=l(this).closest(".question"),t=e.find(".replyform"),n=t.find(".editor-content"),i=n.data("ckeditor-instance")&&n.data("ckeditor-instance").value||n.val();if(!t.hasClass("disabled")){if(i.length<30)return window.alert("Please add at least 30 characters."),void(n.data("ckeditor-instance")&&n.data("ckeditor-instance").view||n).focus();s.$applyAsync((function(){s.live_status="Posting Answer"})),t.addClass("disabled"),u({method:"POST",url:"/ajax.php",data:{action:"Answers.AnswerQuestion",do:"user-answer",question_id:e.data("id").replace(/^q/,""),answer:i}}).then((function(i){t.removeClass("disabled");var a,o=i.data;if(o){if("redirect"in o)return void(top.location.href=o.redirect);if("error"in o&&!0===o.error&&"message"in o){var r=o.message.match(/^Bad word `(.+)` detected\.$/);return r&&r.length?window.alert('Profanity is not allowed, including words such as "'+r[1]+'". Please adjust.'):window.alert(o.message),void n.trigger("focus")}if("id"in o){if((a=e.find(".message[data-id="+o.id+"]")).length>0)"answer"in o&&a.find(".answer-content").html(o.answer);else{var d="<div class='message more-content show' data-id='"+o.id+"'><div class='answer-top'><div class='avatar'><img src='"+o.avatar+"' class='avatar-img' alt='user avatar' width='40' height='40'></div><div class='answer-names'><div class='full-name' tabindex='0'>"+o.fullname+"</div><div class='second-name' aria-hidden='true' tabindex='-1'>@"+o.username+'</div></div></div><span class="ng-hide" role="tooltip" id="ans-desc-'+o.id+'">Answer provided by you</span><div class="answer-content" tabindex="0" aria-describedby="ans-desc-'+o.id+'">'+o.answer+"</div><div class='thumbs' role='none'><span class='upvote bf-icon-upvote' role='button' tabindex='0' aria-label='0 up votes'><span class='upvotes'>0<i class='af-icon-spin6 animate-spin' aria-hidden='true' tabindex='-1'></i></span></span><span class='dnvote bf-icon-downvote' role='button' tabindex='0' aria-label='0 down votes'><span class='dnvotes'>0<i class='af-icon-spin6 animate-spin' aria-hidden='true' tabindex='-1'></i></span></span></div></div>";0==(a=e.find(".answers")).length&&(a=l("<div class='answers'></div>").insertAfter(e.find(".main-q"))),a.append(d),s.$applyAsync((function(){s.live_status="Answer Posted",c((function(){s.live_status="",a.find(".message").last().find(".answer-content").focus()}),1e3)}))}e.find(".main-q span.reply").hide()}e.removeClass("show-reply"),e.find(".main-q span.reply").attr("aria-expanded","false")}}),(function(e){t.removeClass("disabled"),401==e.status&&(top.location.href="/join/light?lg&redirect_to="+encodeURIComponent(document.location.href))}))}})).on("click",".questions .question .moreans",(function(){var e=l(this),t=e.closest(".question"),i=t.find(".q-title").attr("href"),a={action:"Answers.GetMoreAnswers"};a.qid=t.data("id"),a.v=2,a.answers=t.find(".answers > .message").length,e.focus(),e.addClass("loading"),s.$applyAsync((function(){s.live_status="Loading more answers"})),u({url:"/ajax.php",params:a}).then((function(a){for(var o=a.data,r=0;r<o.answers.length;r++){var l=o.answers[r],c="<div class='message more-content' data-id='"+l.id+"'><div class='answer-top'><div class='avatar'><img src='"+l.user_avatar+"' class='avatar-img' width='40' height='40' alt='user avatar' tabindex='0' /></div><div class='answer-names'>";""!=l.user_title?c+="<div class='full-name' role='text' tabindex='0'>"+l.user_fullname+"<span class='cap'>, "+l.user_title+"</span></div>":c+="<div class='full-name' role='text' tabindex='0'>"+l.user_fullname+"</div>",c+="<div class='second-name' tabindex='-1' aria-hidden='true'>@"+l.user_login+'</div></div></div><span class="ng-hide" id="ans-desc-'+l.id+'">Answer provided by user: '+l.user_fullname+"</span><div class='answer-content' tabindex='0' aria-describedby='ans-desc-"+l.id+"'>"+l.content+"</div><div class='answer-content-more'><a href='"+i+"' class='more-link' tabindex='0' rel='nofollow'>show more<span class='bf-icon-right-open-big' aria-hidden='true' tabindex='-1'></span></a></div><div class='thumbs'><span class='upvote bf-icon-upvote' role='button' tabindex='0' aria-label='"+l.upvote+" up vote"+(1!=l.upvote?"s":"")+"'><span class='upvotes'>"+l.upvote+"<i class='af-icon-spin6 animate-spin'></i></span></span><span class='dnvote bf-icon-downvote' role='button' tabindex='0' aria-label='"+l.upvote+" down vote"+(1!=l.upvote?"s":"")+"'><span class='dnvotes'>"+l.downvote+"<span class='af-icon-spin6 animate-spin'></span></span></span></div></div>",l=t.find(".answers").append(c).find(".answer-content:last")}0==o.left?e.closest(".moreans").hide():e.closest(".moreans").removeClass("loading");var d=o.answers.length;if(d){var u=document.querySelector("[data-status-ans]")||document.createElement("div");u.setAttribute("data-status-ans","status"),u.setAttribute("aria-live","polite"),u.setAttribute("role","status"),u.setAttribute("tabindex","-1"),u.setAttribute("aria-hidden","true");var p=document.querySelector('.answers .message[data-id="'+o.answers[0].id+'"]');t.find(".answers")[0].insertBefore(u,p),u.setAttribute("aria-label","");var f="Loaded "+d+" more answer"+(1!=d?"s":"");u.setAttribute("aria-label",f),n()&&s.$applyAsync((function(){s.live_status=f})),requestAnimationFrame((function(){u.focus()}))}}))})).on("click",".question-form.no-question .q-btn,.question-form .question-box .q-btn,.question-form .search-notice .btn,.ftrbtns .btn.blue",(function(){function e(){d.set(s.comsearch),l(".ask-overlay .askform").css("top",f.scrollY-55+"px"),s.$apply((function(){t.show_ask_overlay=!0}))}var n=l(document).height();n-l(document).scrollTop()<1200?(l("html,body").scrollTop(n-1200),e()):e()})).on("click",".answer-content-more span",(function(){var e=l(this).closest(".message");e.toggleClass("show"),e.hasClass("show")?e.find(".answer-content").focus():(e.find(".more-link").focus(),setTimeout((function(){e.find(".more-link").focus()})))})).on("click",".ftrbtns .viewmore",(function(){var e=l(this),t=l(o),i=!1;"p"in h.search()&&void 0===t.data("qp")&&t.data("qp",parseInt(h.search().p));var a=(t.data("qp")||1)+1;e.addClass("loading"),s.is_curi_left_filter_template&&void 0!==t.data("curi_page_data_changing")&&t.data("curi_page_data_changing")&&(i=!0,a=1,t.data("qp",1),t.data("curi_page_data_changing",!1));var r=document.location.href,d=e.data("url");void 0!==d&&""!=d&&(r=d),s.$applyAsync((function(){s.live_status="Loading more questions"})),u({url:"/ajax.php",params:{action:"Answers.GetMoreQuestions",url:r,p:a,sort_by:s.ans_sort}}).then((function(r){s.$applyAsync((function(){s.live_status=""}));var d=r.data;e.removeClass("loading"),i&&(""==d.html?(l(t).find(".question-form.no-question").removeClass("ng-hide"),l(t).find(".with-question").addClass("ng-hide")):(l(t).find(".question-form.no-question").addClass("ng-hide"),l(t).find(".with-question").removeClass("ng-hide"),l(t).find(".questions").html(""),d.more&&e.removeClass("ng-hide")));var u=document.querySelectorAll(".comqa .questions .question"),p=u[u.length-1],f=u.length,h=document.createElement("div");l(h).html(d.html),l(h).find(".answer-user-avatar[data-src]").each((function(){var e=l(this);e.attr("src",e.attr("data-src")),e.removeAttr("data-src"),e.addClass("answer-user-avatar-load"),e.css({display:"block"})})),t.find(".questions").append(l(h).html()),i||(s.after_loading_more=!0,c((function(){s.after_loading_more=!1}),100));var m=(u=document.querySelectorAll(".comqa .questions .question")).length-f,v=document.querySelector("[data-status-question]")||document.createElement("div");v.setAttribute("data-status-question","status"),v.setAttribute("aria-live","polite"),v.setAttribute("role","status"),v.setAttribute("tabindex","-1"),v.setAttribute("aria-hidden","true"),p&&document.querySelector(".comqa .questions").insertBefore(v,p.nextSibling||p),v.setAttribute("aria-label","");var g="Loaded "+m+" more question"+(1!=m?"s":"");v.setAttribute("aria-label",g),n()&&s.$applyAsync((function(){s.live_status=g})),requestAnimationFrame((function(){v.focus()})),setTimeout((function(){l(o).find(".questions .question .main-q .more-info").each((function(){var e=l(this);e.prop("scrollHeight")<=e.prop("offsetHeight")+(e.find("span.match").length>0?2:0)&&e.next(".more-info-more").remove()}))}),150),!1===d.more?s.is_curi_left_filter_template?e.addClass("ng-hide"):e.remove():t.data("qp",a)}))})).on("click",".upvote,.dnvote",(function(){if(!a.is_logged_in())return top.location.href="/join/light?redirect_to="+encodeURI(document.location.href),!1;var e=l(this),t=e.closest(".question"),n=e.find("> span[class$='votes']").addClass("loading"),o="answer",r="up",c=t.data("id");e.parent().hasClass("main-q")&&(o="question"),e.hasClass("dnvote")&&(r="dn"),"answer"==o&&(c=e.closest(".message").data("id")),s.live_status="Voting "+o;var d=c.match(/^([abceq])(\d+)$/);d&&(c=d.pop(),o=d.pop(),~["q","a"].indexOf(o)||(o="q"+o)),u.post("/ajax.php?action=Answers.Vote",{dir:r,kind:o,id:c}).then((function(i){s.live_status="",n.removeClass("loading");var a,r,l=i.data;l.error?window.alert("An unknown error has ocured."):(e.attr("aria-live","polite"),setTimeout((function(){e.attr("aria-live","off")}),1e3),"q"==o.charAt(0)?(t.find("> .upvotes strong").text(l.votes_up),a=t.find(".main-q .upvotes"),r=t.find(".main-q .dnvotes"),a.parent().attr("aria-label",l.votes_up+" up vote"+(1!=l.votes_up?"s":"")),a.html(l.votes_up+"<i class='af-icon-spin6 animate-spin'></i>"),r.parent().attr("aria-label",l.votes_dn+" down vote"+(1!=l.votes_dn?"s":"")),r.html(l.votes_dn+"<i class='af-icon-spin6 animate-spin'></i>")):(a=n.closest(".thumbs").find(".upvotes"),r=n.closest(".thumbs").find(".dnvotes"),a.parent().attr("aria-label",l.votes_up+" up vote"+(1!=l.votes_up?"s":"")),a.html(l.votes_up+"<i class='af-icon-spin6 animate-spin'></i>"),r.parent().attr("aria-label",l.votes_dn+" down vote"+(1!=l.votes_dn?"s":"")),r.html(l.votes_dn+"<i class='af-icon-spin6 animate-spin'></i>")),l.upClass&&a?a.parent().attr("aria-label",a.parent().attr("aria-label")+". Pressed"):l.dnClass&&r&&r.parent().attr("aria-label",r.parent().attr("aria-label")+". Pressed"))}),(function(e){if(s.live_status="",n.removeClass("loading"),i.isObject(e)&&"data"in e)return 401==e.status?void(top.location.href="/join/light?redirect_to="+encodeURI(document.location.href)):void window.alert("An unknown error has ocured.")}))})).on("change","#sorting",(function(){var e=l(this);u({url:"/ajax.php",params:{action:"Answers.CommunityQASort",uri:document.location.pathname,sort_by:e.val()}}).then((function(e){var t=e.data,n=l(o),i=n.find(".questions");i.html(t.html),i.find(".answer-user-avatar[data-src]").each((function(){var e=l(this);e.attr("src",e.attr("data-src")),e.removeAttr("data-src"),e.addClass("answer-user-avatar-load"),e.css({display:"block"})})),n.data("qp",1),s.is_curi_left_filter_template?1==t.pages?l(o).find(".ftrbtns .viewmore").addClass("ng-hide"):l(o).find(".ftrbtns .viewmore").removeClass("ng-hide"):1==t.pages?l(o).find(".ftrbtns .viewmore").remove():0==l(o).find(".ftrbtns .viewmore").length&&l("<span class='btn blank grey no-decoration viewmore'><span class='txt'>View More Questions</span><span class='af-icon-spin6 animate-spin'></span></span>").prependTo(l(o).find(".ftrbtns")),setTimeout((function(){l(o).find(".questions .question .main-q .more-info").each((function(){var e=l(this);e.prop("scrollHeight")<=e.prop("offsetHeight")+(e.find("span.match").length>0?2:0)&&e.next(".more-info-more").remove()}))}),150)}))}));var v,g=new RegExp("\\/css\\/searchtools\\/common\\.v13\\.d(_V[\\da-f]+_)?\\.css(\\.gz)?"),_=s.$watch((function(){for(var e=0;e<document.styleSheets.length;e++)if("href"in document.styleSheets[e]&&null!=document.styleSheets[e].href&&!1!==g.test(document.styleSheets[e].href))return!0;return!1}),(function(e){e&&setTimeout((function(){l(o).find(".questions .question .main-q .more-info").each((function(){var e=l(this);e.prop("scrollHeight")<=e.prop("offsetHeight")&&e.next(".more-info-more").remove()})),_()}))})),w=p.defer();s.qna_result_label="",s.$watch("comsearch",(function(e,n){e!=n?(c.cancel(v),t.comsearch=e,l(".question-form.no-question:not(.ng-hide)").length>0||(s.comresults_loading=!0,""==e?(w.resolve(),w=p.defer(),delete s.comresults,s.comresults_loading=!1):v=c((function(){!function(e){var t={action:"Answers.CommunitySearch",query:e};"/credit-cards/compare/"==document.location.pathname?t.category="credit-cards":t.uri=document.location.pathname,u({url:"/ajax.php",params:t,timeout:w.promise}).then((function(e){if(""!=s.comsearch){s.comresults=e.data,s.comresults_loading=!1,m(s.comresults||[]);var t=(s.comresults||[]).length;s.qna_result_label="Questions results. "+(t||"No ")+"Result"+(1!=t?"s":""),setTimeout((function(){l(o).find(".questions .question .main-q .more-info").each((function(){var e=l(this);e.prop("scrollHeight")<=e.prop("offsetHeight")+(e.find("span.match").length>0?2:0)&&e.next(".more-info-more").remove()}))}),100)}}))}(e)}),300))):c.cancel(v)}));var b=new r(.5,50);l(".answer-user-avatar").each((function(e){var t=this,n=t.getAttribute("data-src");b.Observe(t.parentNode,(function(){t.addEventListener("load",(function(){l(t).addClass("answer-user-avatar-load")})),t.setAttribute("src",n),t.style.display="block",t.removeAttribute("data-src")}))}))}]),s.register.controller("CommunitySearchAskFormController",["$rootScope","$scope","$element","$question-resolver","$http",function(e,t,n,s,i){var r=1,c=!1;t.question="",t.details="",t.overlay_shown=!1,t.live_status="",e.$watch("show_ask_overlay",(function(e){e&&(t.question=s.get()),t.overlay_shown!=e&&(t.overlay_shown=e||!1)})),t.autoExpand=function(e){var t="object"==typeof e?e.target:document.getElementById(e),n=t.offsetHeight-t.clientHeight;t.style.height="auto",t.style.height=t.scrollHeight+n+"px"};var d=140,u=3;t.chars_left=d,l(n).on("click touchend",".askform > span.closebtn",(function(){t.$apply((function(){e.show_ask_overlay=!1}));var n=document.querySelector(".comqa .search-notice .btn")||document.querySelector(".question-form.no-question .q-btn,.question-form .question-box .q-btn,.question-form .search-notice .btn,.ftrbtns .btn.blue");n&&n.focus()})).on("click touchend",".askform .ask .btn.next,.askform .step4 .btn.login,.askform .step4 .btn.em",(function(){!function(e){if(t.question)if([].concat(t.question.split(/\s+/)).length<u)t.notice="Question must have at least "+u+" word"+(1!=u?"s":"")+".";else if(t.question.length>d)t.notice="Question cannot have more than "+d+" character"+(1!=d?"s":"");else if(!a.is_logged_in()&&r<4)r=4;else{c=!0;var n={question:t.question,url:document.location.href+""};""!=t.details&&(n.details=t.details),t.email?(n.email=o.localencrypt(t.email),n.publickey=o.localkey):e&&(n.light="true"),t.live_status="Submitting question",i({url:"/ajax.php?action=Answers.PostQuestion",method:"POST",data:n}).then((function(n){var s=n.data;if(c=!1,t.live_status="",s.error){if(!("message"in s))return void(s.message="Unexpected error. Please contact help@evolutionfinance.com");var i=s.message.match(/^Bad word `(.+)` detected\.$/);return i&&i.length&&(s.message='Profanity is not allowed, including words such as "'+i[1]+'". Please adjust.'),void(t.notice=s.message)}e&&"redirect"in s?top.location.href=s.redirect:(r=5,t.question="",t.details="",t.email="",l(".ask-overlay .closebtn").one("click touchend",(function(){r=1})))}))}else t.notice="Please enter your question."}(4==l(this).closest("section").data("step"))})),t.is_overlay_step=function(e){return r==e},t.is_additional_details_visible=function(){return t.chars_left<d},t.is_form_loading=function(){return c},t.back=function(){r=1}}]),e(["shortcode-js"],(function(e){var t="https://"+location.host;(l(".pl-rates-div").length||l(".pl-terms-box").length)&&e.SetPrsWidgets(window,t),(l(".cc-mini-box").length||l(".cc-list-buttons").length||l(".cc-editorial-box").length)&&(e.ClearBoxes(),e.SetBoxes(window,t)),l(".cc-trust").length&&(e.ClearCCTrust(),e.SetCCTrust())}),(function(e){console.error(e)})),s.pageInjector.get("$stService").setControllerReady("CommunitySearchController"),s.pageInjector.get("$stService").setControllerReady("CommunitySearchAskFormController")}));