(function(){page.using={types:["Formats","ActivityExecutionFormat","DefineDocumentationForContactView"]};var e;page.onInit=function(){t();page.bind("PreUnload",u);u8.services.events.bind("u8.services.navigation.onPreNavigate",g.bind(this),this.id)};page.onLoad=function(){a()};function t(){var e=page.url.get("stage");if(page.process){page.process.set("stage",e).update("phases")}}function a(){page.busy(true);if(e){e.dispose()}var t={defaultFormatName:n(page),formatDefinitionFormName:page.url.get("defaultValuesDefinitionForm"),formatEditFormName:page.url.get("defaultValuesEditForm"),parent:page,activityUid:page.url.get("activityUid")};var a=$("#content").uniqueId("defineDocumentationForContact",true);e=u8.widget("DefineDocumentationForContactView",a,t);e.bind("Proceed",i).bind(this);e.bind("Save",o).bind(this);page.busy(false)}function n(){if(page.process){return page.process.get("defaultValuesForContactDefaultFormatName")}return page.url.get("defaultValuesForContactDefaultFormatName")}function i(){s(function(e){if(e.navigateAway){u8.services.events.unbind("u8.services.navigation.onPreNavigate",page.id);page.process.proceed({})}})}function o(e,t){if(page.process){page.process.set("defaultValuesForContactFormatName",t.formatName)}}function s(e){if(r()){u8.Base.Widgets.MessageBox.showQuestion({message:$t("TXT_Campaign_Designer_142"),buttons:"Ok,Cancel"},function(t,a){if(a.command==="Ok"){e({navigateAway:true})}else{e({navigateAway:false})}})}else{e({navigateAway:true})}}function u(e,t){u8.services.events.unbind("u8.services.navigation.onPreNavigate",this.id)}function r(){return e.isModified()}function g(e,t){if(t.options&&t.options.arguments&&t.options.arguments.target){t.pending=true;s(function(e){if(e.navigateAway){t.cancel=!e.navigateAway;if(t.pending){t.proceed()}}})}}})();