(function(){u8.Crm.Widgets.MultiLanguageTextInput=function(t,e){e=$.extend({},u8.Crm.Widgets.MultiLanguageTextInput.defaults,e);if(!("actions"in e)){e.actions=[{image:"u8-img-multilanguagetext-s",command:"Edit",title:$t("TXT_button_text_42")}]}this.TextInput(t,e)};u8.Crm.Widgets.MultiLanguageTextInput.makeClass({name:"MultiLanguageTextInput",deriveFrom:u8.Base.Widgets.TextInput,events:["PropertyChange"]});u8.Crm.Widgets.MultiLanguageTextInput.defaults={popupOptions:{sizing:"fit",position:"center-top",allowMove:true,allowMaximize:false,allowClose:false,showArrow:true}};u8.Crm.Widgets.MultiLanguageTextInput.override({_onKeyDown:function(t,e){var i=this.$.ui.keyCode;switch(e.keyCode){case i.DOWN:if(e.altKey){e.preventDefault();e.stopImmediatePropagation();this.edit()}break}t(e)}});$.extend(u8.Crm.Widgets.MultiLanguageTextInput.prototype,{getUid:function(){return this.uid},setUid:function(t){this.uid=t},getStatNo:function(){return this.statNo},setStatNo:function(t){if(this.statNo===t){return}this.statNo=t;this.raise("PropertyChange",{propertyName:"statNo",value:t})},getSeqNo:function(){return this.seqNo},setSeqNo:function(t){if(this.seqNo===t){return}this.seqNo=t;this.raise("PropertyChange",{propertyName:"seqNo",value:t})},edit:function(){var t=Math.max(this.$(this.element).width(),350);var e;var i=this;u8.using({schema:this.uid.infoAreaId},s.bind(this));function s(){var i=u8.services.schema.getField(this.uid.infoAreaId,this.field);var s=i&&i.label||this.field;u8.Base.Widgets.Popup.openWidgetPopup({type:"MultiLanguageTextEditor",html:"<div style='width:"+t+"px'></div>",widgetOptions:{uid:this.uid,field:this.field,languageNo:this.languageNo,multiLine:this.multiLine,multiLineLines:this.multiLineLines,isDefault:true,value:this.getValue(),maxLength:this.maxLength,statNo:this.statNo,seqNo:this.seqNo},popupOptions:$.extend({title:s,parent:this,alignTo:this.element,autoShow:false,onClose:o,"Command.Save":n,"Command.Cancel":u},this.popupOptions)},function(t,i){i.popup.show();e=i.widget;e.focus()})}function n(){var t=this.busy(),i=this;e.save(function(e,s){t.hide();if(!s.error){i.close(s)}})}function u(){this.close({cancel:true})}function o(t,s){if(i._isDisposed){return}if(s.cancel||!e){i.focus();return}i.setValue(e.getValue()||"");if(s.isNew){i.setStatNo(e.getStatNo());i.setSeqNo(e.getSeqNo())}i.focus()}},"Command.Edit":function(){this.edit()}})})();