!function(){"use strict";var e=jQuery(document);e.on("contentloaded",function(e){var t=jQuery(e.target),n=t.find(".field.client-type input"),a=t.find("fieldset.client");if(n.length&&a.length){var r=function(){var e=n.filter(":checked").val();e&&(a.removeClass("selected"),a.filter('[data-type="'+e+'"]').addClass("selected"))};n.on("change",function(){r()}),r()}}),e.on("contentloaded",function(e){var t=jQuery(e.target),n=t.find(".field.foreign-national input"),a=t.find(".field.person-id"),r=t.find(".field.birth-date");n.length&&(n.on("change",function(e){var t=this.checked;a.toggleClass("selected",!t),r.toggleClass("selected",t)}),n.trigger("change"))})}(),jQuery(function(){var e=jQuery("body");if(!(e.length<1)){e.on("expand",".expandable:not(.expanded)",function(e){if(e.currentTarget==e.target){var t=jQuery(e.target);t.find(".expandable-content").first().slideDown("fast"),t.addClass("expanded")}}),e.on("collapse",".expandable.expanded",function(e){if(e.currentTarget==e.target){var t=jQuery(e.target);t.find(".expandable-content").first().slideUp("fast"),t.removeClass("expanded")}}),e.on("toggle",".expandable",function(e){if(e.currentTarget==e.target){var t=jQuery(e.target);t.is(".expanded")?t.trigger("collapse"):t.trigger("expand")}}),e.on("click",".expandable-switch",function(e){var t=jQuery(e.target);if(t.is("a, button")||(t=t.closest("a, button")),!(t.length<1)){e.preventDefault(),e.stopPropagation();var n=t.closest(".expandable"),a=!n.is(".expanded");if(n.trigger("toggle"),t.is("a")){var r=n.attr("data-hash"),i=r?window.location.href:t.attr("href"),s=i.split("#")[0],o=r?s+"#"+r:i,d=a?o:s;jQuery(window).trigger("urlchange",d)}}}),e.on("contentloaded",function(e){jQuery(e.target).find(".expandable-switch").not("a, button").each(function(){var e=jQuery(this),t=jQuery("<button />").attr("type","button").attr("class",e.attr("class")).text(e.text());e.replaceWith(t)})});var t=function(){var t=document.location.hash.replace(/^#/,"");t.length<1||e.find(".expandable#"+t+', .expandable[data-hash="'+t+'"]').first().trigger("expand")};jQuery(window).on("hashchange",function(e){t()}),t()}}),jQuery(function(){var e=jQuery("body"),t=e.find(".usage-warning"),n=e.find(".js-continue");if(!(e.length<1)){e.on("change",".js-usage-purpose",function(e){if(e.currentTarget==e.target){var i=jQuery(e.target).find("option:selected");if(a(i))return t.addClass("is-shown"),void n.hide();r(i)&&(t.removeClass("is-shown"),n.show())}});var a=function(e){return e.hasClass("is-high-risk")&&!t.hasClass("is-shown")},r=function(e){return!e.hasClass("is-high-risk")&&t.hasClass("is-shown")}}});