//>>built
define("mill/jssupport/jsApplication/CabinetApp","dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/dom-style dojo/when mill/jssupport/jsApplication/BaseApplication mill/jssupport/base mill/jssupport/app mill/jssupport/session mill/mill".split(" "),function(p,k,l,d,m,q,h,g,e,f){return f.registerAlias("app.CabinetApp",p("mill.jssupport.jsApplication.CabinetApp",q,{registerHandler:null,registrationClass:null,accessCategory:null,postCreate:function(){this.inherited(arguments);g.registerHandler=
this.registerHandler;g.handlerDataByIdent=this.handlerDataByIdent.bind(this);g.getLayoutActionTitleIdent=this.getLayoutActionTitleIdent.bind(this);g.signin=this.signin.bind(this)},getLayoutActionTitleIdent:function(a){var b="";a=this.anonymousDataByIdent(a)[0];if(!a)return b;Object.prototype.hasOwnProperty.call(a,"description")&&(b=a.description);return Object.prototype.hasOwnProperty.call(a,"translationIdent")?(a=this.combinedTranslationIdent(a.translationIdent),h.getLocalization(a)?a:b):b},translationPattern:function(){return this.inherited(arguments).concat(["Office.*",
"IntCabinet.*"])},handlerBatchItems:function(){var a=this.inherited(arguments);null===this.controlSets&&h.logError("Property 'ControlSets' of the application is null.");l.forEach(this.controlSets||[],function(b){var c=this.anonymousDataByIdent(b.preLoadIdent)[0];c?Object.prototype.hasOwnProperty.call(c,"subsetNames")&&(a=a.concat(l.map(c.subsetNames.split(","),function(n){return{queryIdent:n+"Load",className:"TJSControlSubset",methodName:"Load",params:{ControlSetName:b.controlSetName,Name:n}}}))):
h.logError('queryIdent "'+b.preLoadIdent+'" not found by anonymousDataByIdent function. ')},this);return a},handlerDataByIdent:function(a,b){return this._dataByIdent(null,a,b)},logon:function(){return this.queryHandlerData()},disabledSignInForm:function(a,b){a&&function(){this.getFormWidget("password").focus();this.setWidgetAttr("login","disabled",b);this.setWidgetAttr("password","disabled",b);this.submitButton.set("disabled",b);!0===b?(this.set("submitButtonLabel",this.submittingApplicationLabel),
d.set(this.submitButton.domNode,{display:"none"}),d.set(this.progressNode.domNode,{display:"block"})):(this.set("submitButtonLabel",this.submitApplicationLabel),d.set(this.progressNode.domNode,{display:"none"}),d.set(this.submitButton.domNode,{display:"table"}))}.call(a)},createErrorMessage:function(a,b,c){a&&a._announcementWidget&&(a=a._announcementWidget,a.set("text",b),a.set("icon",c),a.set("color","red"),d.set(a.domNode,{opacity:1}))},createSuccessMessage:function(a,b,c){a&&a._announcementWidget&&
(a=a._announcementWidget,a.set("text",b),a.set("icon","smile"),a.set("color",c),d.set(a.domNode,{opacity:1}))},createInfoMessage:function(a,b){if(a&&a._announcementWidget){var c=a._announcementWidget;c.set("text",b);c.set("icon","info");c.set("color","blue");d.set(c.domNode,{opacity:1})}},signin:function(a,b){null!==a&&k.isObject(a)?(this.disabledSignInForm(b,!0),m(e.logout(!this.sync),function(){m(e.load(a.login,a.password,this.handler,!this.sync,{RoistatCategoryName:a.RoistatCategoryName,RoistatCounter:a.RoistatCounter}),
function(){e.sysInfo?e.hasRemoteUser()&&e.checkRemoteUserAccessCategory(this.accessCategory)?(b&&this.createSuccessMessage(b,"Office.LoadingData","blue"),this.logon()):b&&(this.disabledSignInForm(b,!1),this.createErrorMessage(b,"Office.IncorrectLoginOrPassword","sad")):b&&(this.disabledSignInForm(b,!1),this.createErrorMessage(b,"Office.IncorrectLoginOrPassword","sad"))}.bind(this))}.bind(this))):e.hasRemoteUser()&&e.checkRemoteUserAccessCategory(this.accessCategory)&&(b&&(k.isObject(f.session.values)&&
Object.prototype.hasOwnProperty.call(f.session.values,"UserName")&&(b.setWidgetAttr("login","value",f.session.values.UserName),b.setWidgetAttr("password","value",f.session.values.UserName)),this.disabledSignInForm(b,!0),this.createSuccessMessage(b,"Office.LoadingData","blue")),this.logon())}}))});