window.TrIntegerConverter=function(a,b,d,e,g){this._message=a;this._maxPrecision=b;this._maxScale=d;this._maxValue=e;this._minValue=g;this._class="TrIntegerConverter"};TrIntegerConverter.prototype=new TrConverter;TrIntegerConverter.prototype.getFormatHint=function(){return null};TrIntegerConverter.prototype.getAsString=function(a){return""+a};
TrIntegerConverter.prototype.getAsObject=function(a,b){return _decimalParse(a,this._message,"org.apache.myfaces.trinidad.convert.IntegerConverter",this._maxPrecision,this._maxScale,this._maxValue,this._minValue,b,null)};window.TrLongConverter=function(a,b,d,e,g){this._message=a;this._maxPrecision=b;this._maxScale=d;this._maxValue=e;this._minValue=g;this._class="TrLongConverter"};TrLongConverter.prototype=new TrConverter;TrLongConverter.prototype.getFormatHint=function(){return null};
TrLongConverter.prototype.getAsString=function(a){return""+a};TrLongConverter.prototype.getAsObject=function(a,b){if(TrFormatUtils.isNumberConvertible(a))return _decimalParse(a,this._message,"org.apache.myfaces.trinidad.convert.LongConverter",this._maxPrecision,this._maxScale,this._maxValue,this._minValue,b,null)};window.TrShortConverter=function(a,b,d,e,g){this._message=a;this._maxPrecision=b;this._maxScale=d;this._maxValue=e;this._minValue=g;this._class="TrShortConverter"};
TrShortConverter.prototype=new TrConverter;TrShortConverter.prototype.getFormatHint=function(){return null};TrShortConverter.prototype.getAsString=function(a){return""+a};TrShortConverter.prototype.getAsObject=function(a,b){return _decimalParse(a,this._message,"org.apache.myfaces.trinidad.convert.ShortConverter",this._maxPrecision,this._maxScale,this._maxValue,this._minValue,b,null)};
window.TrByteConverter=function(a,b,d,e,g){this._message=a;this._maxPrecision=b;this._maxScale=d;this._maxValue=e;this._minValue=g;this._class="TrByteConverter"};TrByteConverter.prototype=new TrConverter;TrByteConverter.prototype.getFormatHint=function(){return null};TrByteConverter.prototype.getAsString=function(a){return""+a};
TrByteConverter.prototype.getAsObject=function(a,b){return _decimalParse(a,this._message,"org.apache.myfaces.trinidad.convert.ByteConverter",this._maxPrecision,this._maxScale,this._maxValue,this._minValue,b,null)};window.TrDoubleConverter=function(a,b,d,e,g){this._message=a;this._maxPrecision=b;this._maxScale=d;this._maxValue=e;this._minValue=g;this._class="TrDoubleConverter"};TrDoubleConverter.prototype=new TrConverter;TrDoubleConverter.prototype.getFormatHint=function(){return null};
TrDoubleConverter.prototype.getAsString=function(a){var b=""+a;return-1!=b.indexOf(".")?b:""+a.toFixed(1)};TrDoubleConverter.prototype.getAsObject=function(a,b){return _decimalParse(a,this._message,"org.apache.myfaces.trinidad.convert.DoubleConverter",this._maxPrecision,this._maxScale,this._maxValue,this._minValue,b,!0,!0)};window.TrFloatConverter=function(a,b,d,e,g){this._message=a;this._maxPrecision=b;this._maxScale=d;this._maxValue=e;this._minValue=g;this._class="TrFloatConverter"};
TrFloatConverter.prototype=new TrConverter;TrFloatConverter.prototype.getFormatHint=function(){return null};TrFloatConverter.prototype.getAsString=function(a){var b=""+a;return-1!=b.indexOf(".")?b:""+a.toFixed(1)};TrFloatConverter.prototype.getAsObject=function(a,b){return _decimalParse(a,this._message,"org.apache.myfaces.trinidad.convert.FloatConverter",this._maxPrecision,this._maxScale,this._maxValue,this._minValue,b,!0,!0)};
window.TrRangeValidator=function(a,b,d){this._maxValue=a;this._minValue=b;this._messages=d;this._class="TrRangeValidator"};TrRangeValidator.prototype=new TrValidator;
TrRangeValidator.prototype.getHints=function(){return _returnRangeHints(this._messages,this._maxValue,this._minValue,"org.apache.myfaces.trinidad.validator.RangeValidator.MAXIMUM_HINT","org.apache.myfaces.trinidad.validator.RangeValidator.MINIMUM_HINT","org.apache.myfaces.trinidad.validator.RangeValidator.RANGE_HINT","hintMax","hintMin","hintRange")};
TrRangeValidator.prototype.validate=function(a,b){string=""+a;numberValue=parseFloat(string);var d;if(null!=this._minValue&&null!=this._maxValue){if(numberValue>=this._minValue&&numberValue<=this._maxValue)return string;d="org.apache.myfaces.trinidad.validator.LongRangeValidator.NOT_IN_RANGE";d=this._messages&&this._messages.range?_createCustomFacesMessage(TrMessageFactory.getSummaryString(d),this._messages.range,b,string,""+this._minValue,""+this._maxValue):_createFacesMessage(d,b,string,""+this._minValue,
""+this._maxValue)}else if(null!=this._minValue){if(numberValue>=this._minValue)return string;d="org.apache.myfaces.trinidad.validator.LongRangeValidator.MINIMUM";d=this._messages&&this._messages.min?_createCustomFacesMessage(TrMessageFactory.getSummaryString(d),this._messages.min,b,string,""+this._minValue):_createFacesMessage(d,b,string,""+this._minValue)}else{if(null==this._maxValue||numberValue<=this._maxValue)return string;d="org.apache.myfaces.trinidad.validator.LongRangeValidator.MAXIMUM";
d=this._messages&&this._messages.max?_createCustomFacesMessage(TrMessageFactory.getSummaryString(d),this._messages.max,b,string,""+this._maxValue):_createFacesMessage(d,b,string,""+this._maxValue)}throw new TrConverterException(d);};window.TrLengthValidator=function(a,b,d){this._maxValue=a;this._minValue=b;this._messages=d;this._class="TrLengthValidator"};TrLengthValidator.prototype=new TrValidator;
TrLengthValidator.prototype.getHints=function(){return _returnRangeHints(this._messages,this._maxValue,this._minValue,"org.apache.myfaces.trinidad.validator.LengthValidator.MAXIMUM_HINT","org.apache.myfaces.trinidad.validator.LengthValidator.MINIMUM_HINT",this._minValue==this._maxValue?"org.apache.myfaces.trinidad.validator.LengthValidator.EXACT_HINT":"org.apache.myfaces.trinidad.validator.LengthValidator.RANGE_HINT","hintMax","hintMin","hintRange")};
TrLengthValidator.prototype.validate=function(a,b){var d=""+a,e=d.length;if(e>=this._minValue&&(null==this._maxValue||e<=this._maxValue))return d;0<this._minValue&&null!=this._maxValue?(e=this._minValue==this._maxValue?"org.apache.myfaces.trinidad.validator.LengthValidator.EXACT":"org.apache.myfaces.trinidad.validator.LengthValidator.NOT_IN_RANGE",d=this._messages&&this._messages.range?_createCustomFacesMessage(TrMessageFactory.getSummaryString(e),this._messages.range,b,d,""+this._minValue,""+this._maxValue):
_createFacesMessage(e,b,d,""+this._minValue,""+this._maxValue)):e<this._minValue?(e="org.apache.myfaces.trinidad.validator.LengthValidator.MINIMUM",d=this._messages&&this._messages.min?_createCustomFacesMessage(TrMessageFactory.getSummaryString(e),this._messages.min,b,d,""+this._minValue):_createFacesMessage(e,b,d,""+this._minValue)):(e="org.apache.myfaces.trinidad.validator.LengthValidator.MAXIMUM",d=this._messages&&this._messages.max?_createCustomFacesMessage(TrMessageFactory.getSummaryString(e),
this._messages.max,b,d,""+this._maxValue):_createFacesMessage(e,b,d,""+this._maxValue));throw new TrConverterException(d);};window.TrDateTimeRangeValidator=function(a,b,d,e,g){this._maxValue=a;this._maxISODate=e;this._minValue=b;this._minISODate=g;this._messages=d;this._class="TrDateTimeRangeValidator"};TrDateTimeRangeValidator.prototype=new TrValidator;
TrDateTimeRangeValidator.prototype.getHints=function(){var a=null,b=null;this._maxValue&&(a=this._maxValue);this._minValue&&(b=this._minValue);return _returnRangeHints(this._messages,a,b,"org.apache.myfaces.trinidad.validator.DateTimeRangeValidator.MAXIMUM_HINT","org.apache.myfaces.trinidad.validator.DateTimeRangeValidator.MINIMUM_HINT","org.apache.myfaces.trinidad.validator.DateTimeRangeValidator.RANGE_HINT","hintMax","hintMin","hintRange")};
TrDateTimeRangeValidator.prototype.validate=function(a,b,d){dateTime=a.getTime();var e=this._getISOConverter();if(this._minValue&&this._maxValue){try{minDate=null==this._minISODate?d.getAsObject(this._minValue).getTime():e.getAsObject(this._minISODate).getTime(),maxDate=null==this._maxISODate?d.getAsObject(this._maxValue).getTime():e.getAsObject(this._maxISODate).getTime()}catch(g){return a}if(dateTime>=minDate&&dateTime<=maxDate)return a;e="org.apache.myfaces.trinidad.validator.DateTimeRangeValidator.NOT_IN_RANGE";
a=this._messages&&this._messages.range?_createCustomFacesMessage(TrMessageFactory.getSummaryString(e),this._messages.range,b,""+d.getAsString(a),""+this._minValue,""+this._maxValue):_createFacesMessage(e,b,""+d.getAsString(a),""+this._minValue,""+this._maxValue)}else if(this._minValue){try{minDate=null==this._minISODate?d.getAsObject(this._minValue).getTime():e.getAsObject(this._minISODate).getTime()}catch(h){return a}if(dateTime>=minDate)return a;e="org.apache.myfaces.trinidad.validator.DateTimeRangeValidator.MINIMUM";
a=this._messages&&this._messages.min?_createCustomFacesMessage(TrMessageFactory.getSummaryString(e),this._messages.min,b,""+d.getAsString(a),""+this._minValue):_createFacesMessage(e,b,""+d.getAsString(a),""+this._minValue)}else if(this._maxValue){try{maxDate=null==this._maxISODate?d.getAsObject(this._maxValue).getTime():e.getAsObject(this._maxISODate).getTime()}catch(k){return a}if(dateTime<=maxDate)return a;e="org.apache.myfaces.trinidad.validator.DateTimeRangeValidator.MAXIMUM";a=this._messages&&
this._messages.max?_createCustomFacesMessage(TrMessageFactory.getSummaryString(e),this._messages.max,b,""+d.getAsString(a),""+this._maxValue):_createFacesMessage(e,b,""+d.getAsString(a),""+this._maxValue)}else return a;throw new TrConverterException(a);};TrDateTimeRangeValidator.prototype._getISOConverter=function(){null==this._ISO_CONVERTER&&(this._ISO_CONVERTER=new TrDateTimeConverter("yyyy-MM-dd HH:mm:ss",null,null,null,null));return this._ISO_CONVERTER};
window.TrDateRestrictionValidator=function(a,b,d){this._weekdaysValue=a;this._monthValue=b;this._messages=d;this._weekdaysMap={2:"tue",4:"thu",6:"sat",1:"mon",3:"wed",5:"fri","0":"sun"};this._translatedWeekdaysMap={sun:"0",mon:"1",tue:"2",wed:"3",thu:"4",fri:"5",sat:"6"};this._monthMap={2:"mar",4:"may",9:"oct",8:"sep",11:"dec",6:"jul",1:"feb",3:"apr",10:"nov",7:"aug",5:"jun","0":"jan"};this._translatedMonthMap={jan:"0",feb:"1",mar:"2",apr:"3",may:"4",jun:"5",jul:"6",aug:"7",sep:"8",oct:"9",nov:"10",
dec:"11"};this._class="TrDateRestrictionValidator"};TrDateRestrictionValidator.prototype=new TrValidator;
TrDateRestrictionValidator.prototype.getHints=function(a){var b="mon,tue,wed,thu,fri,sat,sun".split(","),d="jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec".split(",");this._weekdaysValue&&this._removeDisabledValues(this._weekdaysValue,b);this._monthValue&&this._removeDisabledValues(this._monthValue,d);return _returnHints(this._messages,!this._weekdaysValue?this._weekdaysValue:this._translate(b,this._translatedWeekdaysMap,a.getLocaleSymbols().getWeekdays()),!this._monthValue?this._monthValue:this._translate(d,
this._translatedMonthMap,a.getLocaleSymbols().getMonths()),"org.apache.myfaces.trinidad.validator.DateRestrictionValidator.WEEKDAY_HINT","org.apache.myfaces.trinidad.validator.DateRestrictionValidator.MONTH_HINT","hintWeek","hintMonth")};TrDateRestrictionValidator.prototype._translate=function(a,b,d){if(a){var e=[],a=eval(a);for(i=0;i<a.length;i++)e.push(d[b[a[i].toLowerCase()]]);return eval(e)}return a};
TrDateRestrictionValidator.prototype._removeDisabledValues=function(a,b){if(a&&b)for(i=0;i<b.length;i++)void 0!=a[b[i].toLowerCase()]&&(b.splice(i,1),i--)};
TrDateRestrictionValidator.prototype.validate=function(a,b,d){submittedDay=a.getDay();if(weekDaysArray=eval(this._weekdaysValue))for(var e=this._weekdaysMap[submittedDay],g=0;g<weekDaysArray.length;++g)if(weekDaysArray[g].toLowerCase()==e)throw g="mon,tue,wed,thu,fri,sat,sun".split(","),this._removeDisabledValues(this._weekdaysValue,g),e=_trToString(this._translate(g,this._translatedWeekdaysMap,d.getLocaleSymbols().getWeekdays())),g="org.apache.myfaces.trinidad.validator.DateRestrictionValidator.WEEKDAY",
a=this._messages&&this._messages.days?_createCustomFacesMessage(TrMessageFactory.getSummaryString(g),this._messages.days,b,""+d.getAsString(a),e):_createFacesMessage(g,b,""+d.getAsString(a),e),new TrConverterException(a);submittedMonth=a.getMonth();if(monthArray=eval(this._monthValue)){e=this._monthMap[submittedMonth];for(g=0;g<monthArray.length;++g)if(monthArray[g].toLowerCase()==e)throw g="jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec".split(","),TrCollections.removeValuesFromArray(this._monthValue,
g),e=_trToString(this._translate(g,this._translatedMonthMap,d.getLocaleSymbols().getMonths())),g="org.apache.myfaces.trinidad.validator.DateRestrictionValidator.MONTH",a=this._messages&&this._messages.month?_createCustomFacesMessage(TrMessageFactory.getSummaryString(g),this._messages.month,b,""+d.getAsString(a),e):_createFacesMessage(g,b,""+d.getAsString(a),e),new TrConverterException(a);}return a};
window._decimalParse=function(a,b,d,e,g,h,k,m,n,o){if(null==a)return null;a=TrFormatUtils.trim(a);if(0==a.length)return null;e=null;if((g=getLocaleSymbols())&&!0!=o){o=g.getGroupingSeparator();if(0==a.indexOf(o)||a.lastIndexOf(o)==a.length-1)throw e=_createFacesMessage(d+".CONVERT",m,a),new TrConverterException(e);"\u00a0"==o&&(a=a.replace(RegExp("\\ ","g"),"\u00a0"));a=a.replace(RegExp("\\"+o,"g"),"");o=RegExp("\\"+g.getDecimalSeparator(),"g");a=a.replace(o,".")}if(0>a.indexOf("e")&&0>a.indexOf("E")&&
(0==a*a||1==a/a))if(o=null,g=!1,null!=n?(a=TrNumberFormat.trimLeadingZeroes(a),o=n?parseFloat(a):parseInt(a)):(o=parseInt(a),Math.abs(o)<Math.abs(parseFloat(a))&&(g=!0)),!g&&!isNaN(o)){b=a.lastIndexOf(".");-1!=b&&parseInt(a.length-parseInt(b+1));var q,s;null!=h&&o>h?(q=d+".MAXIMUM",s=h):null!=k&&o<k&&(q=d+".MINIMUM",s=k);if(q)throw e=_createFacesMessage(q,m,a,""+s),new TrConverterException(e);return o}h=null;k=!1;-1==d.indexOf("NumberConverter")?h=d+".CONVERT":(h=d+".CONVERT_NUMBER",b&&b.number&&
(e=_createCustomFacesMessage(TrMessageFactory.getSummaryString(h),b.number,m,a),k=!0));k||(e=_createFacesMessage(h,m,a));throw new TrConverterException(e);};window.TrRegExpValidator=function(a,b){this._pattern=a;this._messages=b;this._class="TrRegExpValidator"};TrRegExpValidator.prototype=new TrValidator;TrRegExpValidator.prototype.getHints=function(){var a=null;this._messages.hint&&(a=[],a.push(TrMessageFactory.createCustomMessage(this._messages.hint,""+this._pattern)));return a};
TrRegExpValidator.prototype.validate=function(a,b){var a=a+"",d=a.match("^("+this._pattern+")$");if(void 0!=d&&d[0]==a)return a;d=this._messages&&this._messages.detail?_createCustomFacesMessage(TrMessageFactory.getSummaryString("org.apache.myfaces.trinidad.validator.RegExpValidator.NO_MATCH"),this._messages.detail,b,a,this._pattern):_createFacesMessage("org.apache.myfaces.trinidad.validator.RegExpValidator.NO_MATCH",b,a,this._pattern);throw new TrValidatorException(d);};
function _returnRangeHints(a,b,d,e,g,h,k,m,n){return null!=b&&null!=d?(e=[],a&&a[n]?e.push(TrMessageFactory.createCustomMessage(a[n],""+d,""+b)):e.push(TrMessageFactory.createMessage(h,""+d,""+b)),e):_returnHints(a,b,d,e,g,k,m)}function _trToString(a){return Array.prototype.isPrototypeOf(a)?a.join(", "):""+a}
function _returnHints(a,b,d,e,g,h,k){var m;null!=b&&(m=[],a&&a[h]?m.push(TrMessageFactory.createCustomMessage(a[h],_trToString(b))):m.push(TrMessageFactory.createMessage(e,_trToString(b))));null!=d&&(m||(m=[]),a&&a[k]?m.push(TrMessageFactory.createCustomMessage(a[k],_trToString(d))):m.push(TrMessageFactory.createMessage(g,_trToString(d))));return m};