(function(){var e,a,t;page.using={types:["GoogleAnalyticsProvider"]};page.onLoad=function(){var s=this.url,d=s.getUid(),l=s.get("formName"),u=s.get("textgroups"),p=s.getInt("initialTabNr",-1),f=s.get("pageTitle"),c=s.getBoolean("waitUntilCreated",true);if(s&&s.params&&s.params._action&&s.params.FormName){var m="Action: "+s.params._action;var g="Form: "+s.params.FormName;u8.services.googleAnalyticsProvider.sendCRMDataToGA(m,g)}window.document.body.id=l;if(c){$("body").css("visibility","hidden")}page.bind("PreProceed",o);var v=s.getHeader(),y=$("#header");if(v){a=y.widget("Header",{isDefault:true,updatePopupTitle:true,headerGroupName:v.headerGroupName,headerName:v.headerName,uid:d,parent:this})[0]}else{y.hide()}page.busy(true);if(typeof f==="undefined"&&s.params&&s.params._action){u8.request("ConfigurationChannel.GetActionItem",{name:s.params._action},function(e,a){if(a&&a.response&&a.response.actionItem){f={text:a.response.actionItem.label,image:a.response.actionItem.image,isLabelText:true}}C()}.bind(this),true)}else{C()}function C(){if(u){u8.using({texts:u},h)}else{h()}}function h(){var t={formName:l,validationManager:{summaryId:"validationSummary"},parent:page,isDefault:a?false:true,pageTitle:f};for(var r in page){if(!r.startsWith("Form.")){continue}var o=page[r];if(typeof o=="function"){o=o.bind(page)}t[r.substr("Form.".length)]=o}t.components=$.extend({},i(),n());t.onCreate=t.onCreate?[b,t.onCreate]:b;t.onPreCreate=t.onPreCreate?[x,t.onPreCreate]:x;e=new u8.Base.Widgets.Form($el("form"),t)}function b(e,a){var r=e.getComponent("businessObjectDataSource");if(d&&r){r.setUid(d)}if(p>0){var i=e.getWidget("root");if(u8.tools.isInstanceOfClass(i,"TabPanel")){i.setValue(p-1)}}if(t){t.layout()}$("body").css("visibility","inherit");page.busy(false);window.setTimeout(function(){window.scrollTo(0,0)},0)}function x(e,a){r(e)}};function r(e){var r=page.url.get("style","");var i=a&&a.isPageHeader()||r.indexOf("pageheader")>0;if(i){$("body").removeClass("spaced-l");$("#content").addClass("u8-margin-l");$("#header").prependTo("body");$("#validationSummary").insertAfter("#header")}var n=e.widgets&&e.widgets[e.rootWidget];if(n&&n.type=="DockPanel"){if(i){$("#header").addClass("top");$("#validationSummary").addClass("top");var o=$("#content").addClass("u8-layout-fill").removeClass("u8-panel");var s=$("<div>").addClass("center u8-panel u8-margin-l");o.wrap(s);$("#form").addClass("u8-layout-fill");t=$("body").data("layout","dock")}else{o=$("#content").addClass("u8-layout-fill u8-margin").removeClass("u8-panel");s=$("<div>").addClass("u8-layout-fill u8-margin-l u8-panel");o.wrap(s);$("#header").addClass("top");$("#validationSummary").addClass("top");$("#form").addClass("center");t=$("#content").data("layout","dock")}}if(r.indexOf("plain")>=0){$("body").children(".u8-panel").removeClass("u8-panel")}if(r.indexOf("popup")>=0){$("body").removeClass("u8-panels")}if(r.indexOf("hide-header")>=0){$("#header").hide()}}function i(){return{session:u8.session,url:page.url}}function n(){var e=page.process;if(!e){return}var a={};t(e.dataProviders);t(e.step&&e.step.dataProviders);function t(e){if(!e){return}for(var t in e){var r=e[t];if(r.isLoaded()){a[t]=r.getValue()}}}return a}function o(a,t){t.pending=true;e.apply(function(){var a=e.validationManager;if(a){var r=a.getStatus();if(r!="success"){t.cancel=true;s({severity:100,textId:"TXT_net_formcontrol_text_1"});return}}$.extend(t,e.context?e.context.getProperties():null);t.proceed()})}function s(e){page.notify(e)}})();