define(["require","exports","page","stApp","angular"],(function(t,e){var o=t("stApp"),n=t("angular"),l=n.element,a=t("page");function i(){t(["shortcode-js"],(function(t){var e="https://"+location.host;(l(".pl-rates-div").length||l(".pl-terms-box").length)&&t.SetPrsWidgets(window,e),(l(".cc-mini-box").length||l(".cc-list-buttons").length||l(".cc-editorial-box").length||l(".ct-author-box").length)&&(t.ClearBoxes(),t.SetBoxes(window,e)),l(".cc-trust").length&&(t.ClearCCTrust(),t.SetCCTrust())}),(function(t){console.error(t)}))}o.angular.controller("IntroController",["$scope","$injector",function(t,e){var o=e.get("$stService");t.disclosure_scroll=function(){var t,e=n.element().cssSelect(".mob-disclosure");"block"==e.css("display")?(window.scrollTo(0,e.prop("offsetTop")-50),(t=e.cssSelect("p:last-child")).addClass("yellow"),t[0].focus(),setTimeout((function(){t.removeClass("yellow")}),2e3)):(t=n.element().cssSelect(".sidebar .box:last-child p:last-child"),window.scrollTo(0,t.prop("offsetTop")-20),t.addClass("yellow"),t[0].focus(),setTimeout((function(){t.removeClass("yellow")}),2e3))};var s=a.intro,r=a.intro2?a.intro2:"",c=n.element("<div>").html(s),d=n.element("<div>").html(r);function h(t){n.forEach(t,(function(t,e){var o=n.element(t),l="ulistcheck-"+e;o.attr("id",l);var a=o.closest(".cc-list-buttons");if(a.length){var i=a.find("label");i.length&&i.attr("for",l)}}))}function u(t){n.forEach(t,(function(t){var e=l(t);if(!e.hasClass("wh-pro-tip")){e.addClass("wh-pro-tip");var o=e.attr("data-title")||"WalletHub Pro Tip",n=l('<div class="wh-tip-content"></div>').html(e.html());e.html("").append('<span class="protip-icon"></span>','<div class="wh-tip-title">'+o+"</div>",n)}}))}function p(t,e){n.forEach(t,(function(t,o){var n=l(t);if(!n.hasClass("wh-drawer")){n.addClass("wh-drawer");var a="wh-drawer-"+e+o,i=n.attr("data-title")||"",s=n.attr("data-title-style")||"h2",r="<"+(s=["h1","h2","h3","h4","h5","h6","h2-small"].indexOf(s.toLowerCase())>=0?s:"h2")+">"+i+"</"+s+">";"h2-small"==s&&(r='<h2 class="small">'+i+"</h2>");var c='<div class="wh-drawer-content">'+n.html()+"</div>";n.html("").html('<input class="wh-drawer-checkbox" type="checkbox" hidden id="'+a+'"><label class="wh-drawer-hd" for="'+a+'">'+r+'<span class="dd-t-exp"></span></label>'+c)}}))}function f(e){t.$applyAsync((function(){s=c.html(),r=d.html(),"intro"in a&&""!=(a.intro+"").trim()&&(t.pageintro=window.TruncateHTML.truncate(s,window.get_intro_limit()),t.pageintro2=r,setTimeout((function(){e&&window.requestIdleCallback?window.requestIdleCallback(i):i()})))}))}u(l(c.find("[data-pro-tip]"))),p(l(c.find("[data-wh-drawer]")),"pri"),u(l(d.find("[data-pro-tip]"))),p(l(d.find("[data-wh-drawer]")),"sec"),h(l(c.find(".ulistcheck"))),h(l(d.find(".ulistcheck"))),n.element(window).on("resize",f),f(!0);var w=o.onIntroChange((function(t){"top"in t&&(s=t.top||""),"btm"in t&&(r=t.btm||""),c=n.element("<div>").html(s),d=n.element("<div>").html(r),f()}));t.$on("$destroy",(function(){w(),n.element(window).off("resize",f)})),t.toggleIntro=function(t){var e=n.element(t.target).closest("[data-ng-html-content='pageintro']");e.toggleClass("more");var o=e.hasClass("more"),l=e[0].querySelector("[data-show-more]");l&&(l.setAttribute("aria-hidden",o?"true":"false"),l.setAttribute("tabindex",o?"-1":"0")),e[0].focus(),setTimeout((function(){e[0].focus(),i()}))}}])}));