(function(){u8.Crm.FieldRenderHook=function(e){$.extend(this,u8.Crm.FieldRenderHook.defaults,e);var t=this;u8.debug.tryCatch(function(){t._renderFunction=new Function("$","oStyle","oValueControlProvider","g_cYes","g_cNo","BoolFormats","DateTimeFormats","date_EqualsDate",t.code)},function(){return t._getMessage("Evaluation failed while parsing",t.code)});if(this._renderFunction){this._sessionTrue=u8.session.localeSettings.booleanTrue;this._sessionFalse=u8.session.localeSettings.booleanFalse;this._sessionBoolFormats={FormatBool:function(e){return e?t._sessionTrue:t._sessionFalse}};this._sessionDateTimeFormats={ParseDate:function(e){return u8.services.typeConverter.toDate(e)}};this._legacy={obsoleteCalled:this.obsoleteCalled,create:e.create};this._legacyStyle=new u8.Crm.Legacy.FieldRenderHookStyle(this._legacy);this._legacyProvider=new u8.Crm.Legacy.FieldRenderHookValueControlProvider(this._legacy);this._legacyEqualsDateMethod=u8.Crm.Legacy.FieldRenderHookEqualsDateMethod}};u8.Crm.FieldRenderHook.defaults={widgetName:undefined,fieldId:undefined};$.extend(u8.Crm.FieldRenderHook,{create:function(e,t,o,i){var s=u8.create("FieldRenderHook",{code:e,widgetName:t,fieldId:o,obsoleteCalled:{},create:{imageAdd:i,imageReplace:i}});return s.isValid()?s:undefined}});$.extend(u8.Crm.FieldRenderHook.prototype,{execute:function(e){if(!this._renderFunction){return}this._legacy.$=e;var t=this;u8.debug.tryCatch(function(){t._renderFunction(e,t._legacyStyle,t._legacyProvider,t._sessionTrue,t._sessionFalse,t._sessionBoolFormats,t._sessionDateTimeFormats,t._legacyEqualsDateMethod)},function(){return t._getMessage("Error while executing",t.code)})},isValid:function(){return!!this._renderFunction},_getMessage:function(e,t){var o=e+" render hook for field";if(this.widgetName){o=this.widgetName+": "+o}if(this.fieldId){o=o+" '"+this.fieldId+"'"}return{message:o,artifacts:[t]}}});u8.Crm.FieldRenderHook.makeClass({name:"FieldRenderHook"})})();