AdfRichUIPeer.createPeerClass(AdfDhtmlInputBasePeer,"AdfDhtmlInputDatePeer");AdfDhtmlInputDatePeer.prototype.getConvertedValue=function(a,b){var d=b;null==a&&(a=this.getComponent());var e=a.getProperty("_losslessConverter");if(e){var f=a.getConverter();if(null!=f){var g=a.getProperty("label");try{d=f.getAsObject(b,g)}catch(h){try{d=e.getAsObject(b,g)}catch(k){throw h;}}}}else return AdfDhtmlInputDatePeer.superclass.getConvertedValue.call(this,a,b);return d};
AdfDhtmlInputDatePeer.prototype.handleReturnFromChooseComponent=function(a,b){b&&this._hidePopup(a);var d=AdfAgent.AGENT;if(d.getCapabilities()[AdfAgent.CAP_TOUCH_SCREEN]==AdfAgent.CAP_TOUCH_SCREEN_NONE){var e=AdfDhtmlEditableValuePeer.getContentNode(a);AdfFocusUtils.focusElement(e)}e=this.getDomElement();d.setExpandoProperty(e,AdfDhtmlInputDatePeer._UPDATE_FROM_CHOOSEDATE_ATTR,"t");this.Validate(a);d.setExpandoProperty(e,AdfDhtmlInputDatePeer._UPDATE_FROM_CHOOSEDATE_ATTR,null);this._returnedFromChooseComponent=
1};
AdfDhtmlInputDatePeer.prototype.handleUpdateFromChooseComponent=function(a,b,d){b==AdfUIValue.VALUE?(this._updateLosslessNode(a,d),d=this.getConvertedObject(a,d),this.SetDisplayValue(a,null,d)):b==AdfDhtmlChooseDatePeer.TIMEZONE_SEL_DISPLAY?(a=AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlInputDatePeer._TIMEZONE_DISPNAME_ID),a=AdfAgent.AGENT.getElementById(a),AdfAgent.AGENT.setTextContent(a,d)):b==AdfDhtmlChooseDatePeer.TIMEZONE_SEL_ID&&(a=AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlInputDatePeer._TIMEZONE_DISPID_ID),AdfAgent.AGENT.getElementById(a).value=
d)};
AdfDhtmlInputDatePeer.InitSubclass=function(){AdfObject.ensureClassInitialization(AdfUIValue);AdfObject.ensureClassInitialization(AdfRichChooseDate);AdfObject.ensureClassInitialization(AdfRichInputDate);AdfObject.ensureClassInitialization(AdfRichPopup);AdfObject.ensureClassInitialization(AdfDhtmlChooseDatePeer);AdfRichUIPeer.addComponentEventHandlers(this,AdfUIInputEvent.KEY_DOWN_EVENT_TYPE,AdfUIInputEvent.KEY_PRESS_EVENT_TYPE,AdfUIInputEvent.CLICK_EVENT_TYPE,AdfDialogEvent.EVENT_TYPE,AdfUIInputEvent.FOCUS_EVENT_TYPE,AdfValueChangeEvent.VALUE_CHANGE_TYPE);
AdfRichUIPeer.addComponentPropertyChanges(this,AdfUIValue.VALUE);AdfRichUIPeer.addComponentPropertyGetters(this,AdfRichInputDate.MIN_VALUE);AdfRichUIPeer.addComponentPropertyGetters(this,AdfRichInputDate.MAX_VALUE);AdfRichUIPeer.addComponentPropertyGetters(this,AdfRichInputDate.LABEL);AdfRichUIPeer.addComponentPropertyChanges(this,AdfRichInputDate.LABEL);this._CHILD_EXPANDO="child";this._LOSSLESS_SUBID="lcId";this._GLYPH_ID="glyph";this._CHOOSEDATE_ID="cd";this._POPUP_ID="pop";this._TIMEZONE_ID="tz";
this._TIMEZONE_DISPID_ID="tzDispId";this._TIMEZONE_DISPNAME_ID="tzDispName";this._UPDATE_FROM_CHOOSEDATE_ATTR="ufc";this._MIN_ATTR="data-afr-adfmin";this._MAX_ATTR="data-afr-adfmax";this._MIN_ISO_ATTR="data-afr-adfmnis";this._MAX_ISO_ATTR="data-afr-adfmxis"};AdfDhtmlInputDatePeer.prototype.InitDomElement=function(a,b){AdfDhtmlInputDatePeer.superclass.InitDomElement.call(this,a,b);return AdfPage.PAGE.scheduleTimer(this,this._hookUpChooseDate,a.getClientId(),0)};
AdfDhtmlInputDatePeer.prototype.ComponentValueChanged=function(a,b,d,e){AdfDhtmlInputDatePeer.superclass.ComponentValueChanged.call(this,a,b,d,e);if(this._isChooserSuppressed()){e=a.getProperty(AdfRichInputDate.CHOOSE_ID);var f=this.getDomElement(),f=AdfAgent.AGENT.getExpandoProperty(f,AdfDhtmlInputDatePeer._UPDATE_FROM_CHOOSEDATE_ATTR);null!=e&&!f&&AdfDhtmlInputChooseBindingUtils.updateChooseComponentProperty(a,e,AdfUIValue.VALUE,AdfDhtmlChooseDatePeer.SELECTED_DATE)}this._updateLosslessNode(a,d);
a=AdfDhtmlEditableValuePeer.getContentNode(a,b);AdfDhtmlInputBasePeer.setLastValue(a)};AdfDhtmlInputDatePeer.prototype.Validate=function(a,b){null!=b&&this._updateLosslessNode(a,null);AdfDhtmlInputDatePeer.superclass.Validate.call(this,a,b)};AdfDhtmlInputDatePeer.prototype.GetSubmittedValue=function(a,b){var d=this._getLosslessConvertedNode(a);return d&&d.value?d.value:AdfDhtmlInputDatePeer.superclass.GetSubmittedValue.call(this,a,b)};
AdfDhtmlInputDatePeer.prototype.GetComponentLabel=function(a,b){for(var d=AdfAgent.AGENT,e=b.getElementsByTagName("LABEL"),f=AdfRichUIPeer.CreateSubId(a.getClientId(),"content"),g=null,h=0;h<e.length;h++)if(d.getAttribute(e[h],"for")==f){g=e[h];break}return g?d.getTextContent(g):null};
AdfDhtmlInputDatePeer.prototype.HandleComponentClick=function(a){AdfDhtmlInputDatePeer.superclass.HandleComponentClick.call(this,a);var b=a.getSource(),d=a.getNativeEvent(),d=AdfAgent.AGENT.getEventTarget(d),e=AdfRichUIPeer.CreateSubId(b.getClientId(),AdfDhtmlInputDatePeer._GLYPH_ID),f=a.getCurrentTarget();f==b&&this._isGlyphElement(d,e)&&(this._handleChooseDatePopupLaunch(f),a.cancel())};
AdfDhtmlInputDatePeer.prototype.HandleComponentDialog=function(a){var b=this.getComponent(),d=a.getOutcome();d==AdfDialogEvent.OUTCOME_OK?(b=this._getRuntimeChooseDateId(b),b=AdfPage.PAGE.findComponent(b),d=b.getPeer(),d.bind(b),d.submitValueToInput(null,b),a.cancel()):d==AdfDialogEvent.OUTCOME_CANCEL&&(this._hidePopup(b),b=this._getGlyph(b),null!=b&&AdfFocusUtils.focusElement(b),a.cancel())};
AdfDhtmlInputDatePeer.prototype.HandleComponentFocus=function(a){AdfDhtmlInputDatePeer.superclass.HandleComponentFocus.call(this,a);a=this.getComponent();var b=AdfDhtmlInputChooseBindingUtils.getChooseId(a);null!=b&&AdfDhtmlInputChooseBindingUtils.registerBinding(!0,b,a.getClientId())};
AdfDhtmlInputDatePeer.prototype.HandleComponentKeyDown=function(a){this.StopArrowKeyBubbling(a);var b=a.getNativeEvent(),b=AdfAgent.AGENT.getKeyCode(b),d=!1,e=this.getComponent(),f=a.getSource();switch(b){case AdfKeyStroke.ENTER_KEY:this.RunValidation(e,a.getNativeEventTarget());break;case AdfKeyStroke.ARROWDOWN_KEY:!this._isChooserSuppressed()&&e==f&&(this._handleChooseDatePopupLaunch(e),d=!0)}d&&a.cancel()};AdfDhtmlInputDatePeer.prototype.HandleComponentKeyPress=function(a){this.StopArrowKeyBubbling(a)};
AdfDhtmlInputDatePeer.prototype.LazyInitialize=function(a,b){AdfDhtmlInputDatePeer.superclass.LazyInitialize.call(this,a,b);this._createClientSideValidators(a,b)};
AdfDhtmlInputDatePeer.prototype.HandleComponentValueChange=function(a){var b=a.getSource().getClientId();a=this.getComponent();if(this._isChooserSuppressed()){var d=AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlInputDatePeer._TIMEZONE_ID);b==d&&(b=AdfPage.PAGE.findComponent(d),d=b.getPeer().getDomElement(),b=AdfDhtmlEditableValuePeer.getContentNode(b,d),a=AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlInputDatePeer._TIMEZONE_DISPID_ID),AdfAgent.AGENT.getElementById(a).value=b.value)}};
AdfDhtmlInputDatePeer.prototype.IsSecret=function(a){return!1};AdfDhtmlInputDatePeer.prototype.SetDisplayValue=function(a,b,d){AdfAssert.assertString(d);b=AdfDhtmlEditableValuePeer.getContentNode(a,b);var e="INPUT"==AdfAgent.AGENT.getNodeName(b);a.getReadOnly()?AdfAgent.AGENT.setTextContent(b,d):(b.title=d,e?b.value=d:AdfAgent.AGENT.setTextContent(b,d))};
AdfDhtmlInputDatePeer.prototype.VetoShowNoteWindow=function(a){return this._isPopupVisible(a)||!this._isChooserSuppressed()&&(a=AdfDhtmlEditableValuePeer.getContentNode(a),AdfPage.PAGE.getActiveDomElement()!=a)?!0:AdfDhtmlInputDatePeer.superclass.VetoShowNoteWindow.call(this)};
AdfDhtmlInputDatePeer.prototype.GetComponentMinValue=function(a,b){var d=AdfDhtmlEditableValuePeer.getContentNode(a);return(d=AdfAgent.AGENT.getAttribute(d,AdfDhtmlInputDatePeer._MIN_ISO_ATTR,-1))?AdfDhtmlInputDatePeer._getISOStandardConverter().getAsObject(d):null};
AdfDhtmlInputDatePeer.prototype.GetComponentMaxValue=function(a,b){var d=AdfDhtmlEditableValuePeer.getContentNode(a);return(d=AdfAgent.AGENT.getAttribute(d,AdfDhtmlInputDatePeer._MAX_ISO_ATTR,-1))?AdfDhtmlInputDatePeer._getISOStandardConverter().getAsObject(d):null};AdfDhtmlInputDatePeer.prototype.GetInlineEditor=function(a){return AdfDhtmlSimpleLabelEditor.getInlineEditor()};AdfDhtmlInputDatePeer.prototype.__trace=function(a){AdfLogger.LOGGER.severe("InputDatePeer: "+a)};
AdfDhtmlInputDatePeer.prototype._handleChooseDatePopupLaunch=function(a){var b=this._getPopup(a);if(null!=b)if(b.isPopupVisible())b.hide();else{this.HideNoteWindow();var d=this._getRuntimeChooseDateId(a),e=AdfAgent.AGENT.getElementById(d);this._updateChooseDateExpandos(a,e,f);var f=AdfPage.PAGE.findComponent(d),d=f.getPeer();d.bind(f);d.hardRefreshDOM();b.show(this._getChooserPopupHints(a))}else this._showPopup(a)};
AdfDhtmlInputDatePeer.prototype._createClientSideValidators=function(a,b){AdfAssert.assertDomElement(b);var d=AdfDhtmlEditableValuePeer.getContentNode(a),e=AdfAgent.AGENT.getAttribute(d,AdfDhtmlInputDatePeer._MIN_ATTR,-1),f=AdfAgent.AGENT.getAttribute(d,AdfDhtmlInputDatePeer._MAX_ATTR,-1),g=a.getDisabledMonths(),h=a.getDisabledDaysOfWeek();if(e||f){var k=AdfAgent.AGENT.getAttribute(d,AdfDhtmlInputDatePeer._MIN_ISO_ATTR,-1),d=AdfAgent.AGENT.getAttribute(d,AdfDhtmlInputDatePeer._MAX_ISO_ATTR,-1),e=
new TrDateTimeRangeValidator(f,e,null,d,k);a.addValidator(e)}if(h||g)g=new TrDateRestrictionValidator(h,g,null),a.addValidator(g)};AdfDhtmlInputDatePeer.prototype._getGlyph=function(a){a=AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlInputDatePeer._GLYPH_ID);return AdfAgent.AGENT.getElementById(a)};AdfDhtmlInputDatePeer.prototype._getPopup=function(a){a=this._getPopupId(a);return AdfPage.PAGE.findComponent(a)};
AdfDhtmlInputDatePeer.prototype._showPopup=function(a){var b=AdfDhtmlEditableValuePeer.getContentNode(a),d=b.ownerDocument,e=AdfAgent.AGENT,f=this._getPopupId(a),g=AdfPage.PAGE.findComponent(f),h=this._getRuntimeChooseDateId(a),k=e.getElementById(h),l=AdfPage.PAGE.findComponent(h);if(null==e.getElementById(f)){var m=d.createElement("div");b.parentNode.appendChild(m);e.setAttribute(m,"id",f);e.setAttribute(m,"style","display:none");k=AdfRichUIPeer.CreateSubId(f,"content");g=d.createElement("div");
m.appendChild(g);e.setAttribute(g,"style","top:auto; right:auto; left:auto; bottom:auto; width:auto; height:auto; position:relative;");e.setAttribute(g,"id",k);k=d.createElement("span");g.appendChild(k);e.setAttribute(k,"id",h);g=new AdfRichPopup(f,{contentDelivery:"immediate"});l=new AdfRichChooseDate(h);this._updateChooseDateExpandos(a,k,l);e.elementsAdded(m);AdfPage.PAGE.addComponents(l,g)}else this._updateChooseDateExpandos(a,k,l),d=l.getPeer(),d.BindToComponent(l,k),d.hardRefreshDOM();AdfObject.ensureClassInitialization(AdfRichPopup);
g.show(this._getChooserPopupHints(a))};
AdfDhtmlInputDatePeer.prototype._updateChooseDateExpandos=function(a,b,d){AdfAssert.assert(null!=a);var e=AdfAgent.AGENT;if(null==b){var f=this._getRuntimeChooseDateId(a);b=e.getElementById(f)}e.setAttribute(b,AdfDhtmlChooseDatePeer._PARENT_ID,a.getClientId());var g=a.getValue(),f=AdfDhtmlEditableValuePeer.getContentNode(a),h=AdfDhtmlInputDatePeer._getISOStandardConverter(),k=e.getAttribute(f,AdfDhtmlChooseDatePeer._TODAY_DATE),l=h.getAsObject(k);null==g&&(g=l);g=h.getAsString(g);e.setAttribute(b,
AdfDhtmlChooseDatePeer._SELECTED_DATE,g);e.setAttribute(b,AdfDhtmlChooseDatePeer._SHOW_DATE,g);e.setAttribute(b,AdfDhtmlChooseDatePeer._TODAY_DATE,k);k=e.getAttribute(f,AdfDhtmlChooseDatePeer._SHOW_DATE);null!=k&&(k=h.getAsObject(k),k.setYear(k.getFullYear()-AdfDhtmlChooseDatePeer._MAX_CLIENT_RANGE_YEARS/2),k.setDate(1),e.setAttribute(b,AdfDhtmlChooseDatePeer._RANGE_START,h.getAsString(k)),k.setYear(k.getFullYear()+AdfDhtmlChooseDatePeer._MAX_CLIENT_RANGE_YEARS),e.setAttribute(b,AdfDhtmlChooseDatePeer._RANGE_END,
h.getAsString(k)));h=e.getAttribute(f,AdfDhtmlChooseDatePeer._FIRST_DAY_OF_WEEK);null!=h&&e.setAttribute(b,AdfDhtmlChooseDatePeer._FIRST_DAY_OF_WEEK,h);h=e.getAttribute(f,AdfDhtmlChooseDatePeer._ALLOW_TIME_SELECTION);null!=h&&e.setAttribute(b,AdfDhtmlChooseDatePeer._ALLOW_TIME_SELECTION,h);h=e.getAttribute(f,AdfDhtmlChooseDatePeer._NUMBER_HOUR_DIGITS);null!=h&&e.setAttribute(b,AdfDhtmlChooseDatePeer._NUMBER_HOUR_DIGITS,h);h=e.getAttribute(f,AdfDhtmlChooseDatePeer._SHOW_24_HOUR_FORMAT);null!=h&&e.setAttribute(b,
AdfDhtmlChooseDatePeer._SHOW_24_HOUR_FORMAT,h);h=e.getAttribute(f,AdfDhtmlChooseDatePeer._SHOW_AM_PM);null!=h&&e.setAttribute(b,AdfDhtmlChooseDatePeer._SHOW_AM_PM,h);h=e.getAttribute(f,AdfDhtmlChooseDatePeer._SHOW_AM_PM_IN_2_ROWS);null!=h&&e.setAttribute(b,AdfDhtmlChooseDatePeer._SHOW_AM_PM_IN_2_ROWS,h);h=e.getAttribute(f,AdfDhtmlChooseDatePeer._NUMBER_MINUTE_DIGITS);null!=h&&e.setAttribute(b,AdfDhtmlChooseDatePeer._NUMBER_MINUTE_DIGITS,h);h=e.getAttribute(f,AdfDhtmlChooseDatePeer._NUMBER_SECOND_DIGITS);
null!=h&&e.setAttribute(b,AdfDhtmlChooseDatePeer._NUMBER_SECOND_DIGITS,h);h=e.getAttribute(f,AdfDhtmlChooseDatePeer._SHOW_TIMEZONE);null!=h&&e.setAttribute(b,AdfDhtmlChooseDatePeer._SHOW_TIMEZONE,h);h=e.getAttribute(f,AdfDhtmlChooseDatePeer._COUNT_ZERO_BASED);null!=h&&e.setAttribute(b,AdfDhtmlChooseDatePeer._COUNT_ZERO_BASED,h);h=e.getAttribute(f,AdfDhtmlChooseDatePeer._CLIENT_TIME_ZONE);null!=h&&e.setAttribute(b,AdfDhtmlChooseDatePeer._CLIENT_TIME_ZONE,h);d&&(d.setDisabledDays(a.getDisabledDays()),
d.setDisabledMonths(a.getDisabledMonths()),d.setDisabledDaysOfWeek(a.getDisabledDaysOfWeek()),a=e.getAttribute(f,AdfDhtmlInputDatePeer._MIN_ISO_ATTR),d.setMinValue(a),e=e.getAttribute(f,AdfDhtmlInputDatePeer._MAX_ISO_ATTR),d.setMaxValue(e))};
AdfDhtmlInputDatePeer.prototype._getChooserPopupHints=function(a){var b={};b[AdfDhtmlPopupHints.FOCUS]=!0;b[AdfRichPopup.HINT_ALIGN]=AdfRichPopup.ALIGN_AFTER_START;b[AdfRichPopup.HINT_ALIGN_ID]=AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlInputDatePeer._GLYPH_ID);b[AdfDhtmlPopupHints.CLOSE_HANDLER]=this.createCallback(this._chooserPopupClosedHandler);b[AdfDhtmlPopupHints.CLOSE_HANDLER_PARAM]={};var d=a.getLabel();d||(a=this._getGlyph(a),d=AdfAgent.AGENT.getAttribute(a,"title"));b[AdfDhtmlPopupHints.ARIA_LABEL]=
d;return b};AdfDhtmlInputDatePeer.prototype._chooserPopupClosedHandler=function(a){a=this.getComponent();a=AdfDhtmlEditableValuePeer.getContentNode(a);AdfFocusUtils.focusElement(a)};AdfDhtmlInputDatePeer.prototype._getPopupId=function(a){return AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlInputDatePeer._POPUP_ID)};
AdfDhtmlInputDatePeer.prototype._getRuntimeChooseDateId=function(a){var b=AdfDhtmlEditableValuePeer.getContentNode(a),d=AdfDhtmlInputChooseBindingUtils.getChooseId(a,AdfRichInputDate.CHOOSE_ID);return null==d?(a=AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlInputDatePeer._POPUP_ID),(b=b.getAttribute(AdfDhtmlInputDatePeer._CHILD_EXPANDO))&&(a=AdfRichUIPeer.CreateSubId(a,b)),AdfRichUIPeer.CreateSubId(a,AdfDhtmlInputDatePeer._CHOOSEDATE_ID)):d};
AdfDhtmlInputDatePeer.prototype._hidePopup=function(a){a=this._getPopup(a);null!=a&&a.isPopupVisible()&&a.hide()};AdfDhtmlInputDatePeer.prototype._hookUpChooseDate=function(a){a=AdfPage.PAGE.findComponent(a);var b=this._getRuntimeChooseDateId(a);null!=b&&AdfDhtmlInputChooseBindingUtils.registerBinding(!0,b,a.getClientId())};AdfDhtmlInputDatePeer.prototype._isChooserSuppressed=function(){return"0"==AdfDhtmlEditableValuePeer.getContentNode(this.getComponent()).getAttribute(AdfDhtmlInputDatePeer._CHILD_EXPANDO)};
AdfDhtmlInputDatePeer.prototype._isGlyphElement=function(a,b){var d=AdfAgent.AGENT.getElementById(b);return null==d?!1:a==d||a==d.getElementsByTagName("img")[0]?!0:!1};AdfDhtmlInputDatePeer.prototype._isPopupVisible=function(a){a=this._getPopup(a);return null!=a&&a.isPopupVisible()?!0:!1};
AdfDhtmlInputDatePeer._getISOStandardConverter=function(){AdfDhtmlInputDatePeer.ISO_STANDARD_CONVERTER||(AdfDhtmlInputDatePeer.ISO_STANDARD_CONVERTER=new TrDateTimeConverter("yyyy-MM-dd HH:mm:ss",null,null,null,null));return AdfDhtmlInputDatePeer.ISO_STANDARD_CONVERTER};AdfDhtmlInputDatePeer.prototype._getLosslessConvertedObject=function(a,b){if(null!=b){var d=b,e=a.getProperty("_losslessConverter");return e&&(d=e.getAsString(b,a.getProperty("label")),void 0===d)?null:d}return null};
AdfDhtmlInputDatePeer.prototype._getLosslessConvertedNode=function(a){a=AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlInputDatePeer._LOSSLESS_SUBID);return AdfAgent.AGENT.getElementById(a)};AdfDhtmlInputDatePeer.prototype._updateLosslessNode=function(a,b){var d=this._getLosslessConvertedNode(a);if(d)if(b){var e=this._getLosslessConvertedObject(a,b);d.value=e}else d.value=""};