"use strict";define(["app","Controller","../../../../Components/Overlay/Views/OverlayView","../Views/WelcomeView","utils"],function(e,f,d,c,b){var a=f.extend({initialize:function(g){f.prototype.initialize.apply(this,arguments);_.extend(this,g);this.overlayView=new d({framework:e.instance().FrontendFramework(),css:{display:"none","background-color":"#F5F5F5"}});this.welcomeView=new c({parent:this.overlayView});},open:function(h,i,j){h.languages=_.map(e.instance().Cache.LanguageSettings.Languages,function(k){return{text:b.getLanguageName(k),langCd:k};});this.view=this.welcomeView.render(h,j);this.listenTo(this.view,"view:closed",this.close);var g=i||!(typeof(e.instance().Cache.welcomeImage)!=="undefined"&&e.instance().Cache.welcomeImage!==null);if(g){$.ajax({url:"/FirstAccess/GetWelcomeImage",data:{profileId:(h.profileid===undefined?-1:h.profileid)}}).done(_.bind(function(l){if(l&&l.length){var k=JSON.parse(l).FileContent;this.view.$el.find("#splashScreen").css("background","url("+k+")");e.instance().Cache.welcomeImage=k;}this.trigger("controller:loaded");},this));}else{this.view.$el.find("#splashScreen").css("background","url("+e.instance().Cache.welcomeImage+")");this.trigger("controller:loaded");}},close:function(){this.trigger("controller:closed");}});return a;});