var $protoLayerForeign={layer:null,alert:function(e){if(e){var a=$($("#protocolTemp").clone().html());$("body").append(a);this.layer=a;this.adjustLayout();$protocolForeign.getVersionBySelector(this.layer.find("a"));this.events(e.event);this.layer.find(".container-honor-protocol-common-layer").focus();$(".container-honor-protocol-common-layer").on("keydown",function(b){utils.dialogFocusLoopProcessing(b,$(this),function(){e.event.cancel()})})}},adjustLayout:function(){this.layer.find(".container-honor-protocol-common-layer").height(); var e=this.layer.find(".head-honor-protocol-common-layer").outerHeight(!0);this.layer.find(".content--honor-protocol-common-layer").outerHeight(!0);var a=this.layer.find(".referralAgreement-honor-protocol-common-layer");0utils.windowWidth()&&(this.layer.find(".content-honor-protocol-wrap").css("max-height","calc(100vh - "+(e+a+175+36)+"px)"),$("body").addClass("modal-open"))},events:function(e){var a= this.layer.find(".protocol-btn-cancel"),b=this.layer.find(".protocol-btn-confirm");a.on("click",e.cancel);b.on("click",e.submit)},close:function(){this.layer&&this.layer.remove()},addEventListener:function(){var e=this,a=e.layer.find(".marketingAgreement-checkbox");a.off("click").on("click",function(b){"0"==$(this).attr("value")?$(this).hasClass("checked")?(a.removeClass("checked"),a.attr("aria-checked","false")):(a.addClass("checked"),a.attr("aria-checked","true")):($(this).hasClass("checked")?($(this).removeClass("checked"), a.attr("aria-checked","false")):($(this).addClass("checked"),a.attr("aria-checked","true")),e.setCheckboxStute())})},setCheckboxStute:function(){var e=this.layer.find(".marketingAgreement-checkbox:not([value \x3d '0'])"),a=this.layer.find(".marketingAgreement-checkbox:not([value \x3d '0']).checked");e.length==a.length&&0!=a.length?(this.layer.find(".marketingAgreement-checkbox[value \x3d '0']").addClass("checked"),this.layer.find(".marketingAgreement-checkbox[value \x3d '0']").attr("aria-checked", "true")):(this.layer.find(".marketingAgreement-checkbox[value \x3d '0']").removeClass("checked"),this.layer.find(".marketingAgreement-checkbox[value \x3d '0']").attr("aria-checked","false"))}}; $(function(){var e={userId:$.cookie("userID")||"",serviceUrl:$.trim($("#honor-protocol-common-component-foreign").find("input[name\x3d'serverAddress']").val())||"",getContainer:function(){return $("#honor-protocol-common-component-foreign")},getCountryCode:function(){return $.trim(this.getContainer().find("input[name\x3d'countryCode']").val())},getAmsAdress:function(){return $.trim(this.getContainer().find("input[name\x3d'amsAdress']").val())},getProtocolList:function(){return $.trim(this.getContainer().find("input[name\x3d'protocolList']").val())}, jsonParse:function(a){return a&&"undefined"!==a&&"null"!==a?"string"===typeof a?JSON.parse(a.replace(/^[\\(]{1}|[\\)]{1}$/g,"")):a:!1},ajax:function(a,b,c){var d=getCookie("jwt_token"),f={};if(window.isUseNewLogin){d&&(f["X-UUM-JWT"]=d);var g=window.ccpcRequestHeaderProps||{};Object.keys(g).forEach(function(h){f[h]=g[h]})}$.ajax({url:a,type:"POST",dataType:"json",contentType:"application/json",headers:f,async:!1,xhrFields:{withCredentials:!0},data:JSON.stringify(b),success:function(h){h&&0===h.errorCode&& c&&c(h)}})},getBranchIdByProtocolNumber:function(a){if(a=this.aemProtocolMap[Number(a)])return Number(a.branchId)},aemProtocolMap:{},initAemProtocolMap:function(){for(var a=this.jsonParse(this.getProtocolList())||[],b={},c=0;c