!function(u){u.jqx.jqxWidget("jqxFormattedInput","",{}),u.extend(u.jqx._jqxFormattedInput.prototype,{defineInstance:function(){var t={width:null,height:null,radix:10,decimalNotation:"default",value:"0",min:"-9223372036854775808",max:"9223372036854775807",upperCase:!1,spinButtons:!0,spinButtonsStep:1,dropDown:!1,dropDownWidth:null,popupZIndex:2e4,placeHolder:"",roundedCorners:!0,disabled:!1,rtl:!1,changeType:null,template:"",hint:!0,_opened:!1,$popup:u("
"),item:'',events:["open","close","change","radixChange"]};return this===u.jqx._jqxFormattedInput.prototype||u.extend(!0,this,t),t},createInstance:function(){var t=this;t._Long(),t._regex={2:new RegExp(/([0-1])/),8:new RegExp(/([0-7])/),10:new RegExp(/([0-9\-])/),16:new RegExp(/([0-9]|[a-f])/i)},t.render()},render:function(){var t,o=this;if(o._radixNumber=o._getRadix(o.radix),""!==o.value&&(o._number=new o.longObj.math.Long.fromString(o.value.toString(),o._radixNumber)),this.element instanceof HTMLInputElement&&((t=u("")).addClass(o.toThemeProperty("jqx-input-group")),this.host.after(t),r=this.element,e=this.host.data(),t.append(r),t[0].id=this.element.id,this.element.removeAttribute("id"),this.element.setAttribute("hint",!0),t[0].style=this.element.style,o.input=o.element,this.input instanceof HTMLInputElement||(this.input=this.host.find("input"),0'),o._arrow.appendTo(o._addon)),o.template&&o._addon.addClass(o.toThemeProperty("jqx-"+o.template))},!(o.appendSpinButtons=function(t){o._spinButtonsContainer=u(t),o._spinButtonsContainer.addClass(o.toThemeProperty("jqx-formatted-input-spin-buttons-container"));var e='';o._upbutton=u(e),o._spinButtonsContainer.append(o._upbutton),o._downbutton=u(e),o._spinButtonsContainer.append(o._downbutton),o._upArrow=o._upbutton.find("div"),o._upArrow.addClass(o.toThemeProperty("jqx-icon-arrow-up")),o._downArrow=o._downbutton.find("div"),o._downArrow.addClass(o.toThemeProperty("jqx-icon-arrow-down")),o.template&&(o._upbutton.addClass(o.toThemeProperty("jqx-"+o.template)),o._downbutton.addClass(o.toThemeProperty("jqx-"+o.template))),o._spinButtonsStepLong=new o.longObj.math.Long.fromNumber(o.spinButtonsStep)})===o.rtl?o._spinButtonsContainer||!0!==o.spinButtons?o._addon||!0!==o.dropDown||2!==t&&(1!==t||!1!==o.spinButtons)||e(this):o.appendSpinButtons(this):o._addon||!0!==o.dropDown?o._spinButtonsContainer||!0!==o.spinButtons||1!==t&&(0!==t||!1!==o.dropDown)||(o.appendSpinButtons(this),o._spinButtonsContainer.addClass(o.toThemeProperty("jqx-formatted-input-spin-buttons-container-rtl")),!0===o.dropDown&&o._addon.addClass(o.toThemeProperty("jqx-formatted-input-addon-rtl"))):(e(this),!0===o.spinButtons&&o._addon.addClass(o.toThemeProperty("jqx-formatted-input-addon-rtl"))))}))}o._inputAndAddon=o.host,o.baseHost&&(o._spinButtonsContainer&&(o._inputAndAddon=o._inputAndAddon.add(o._spinButtonsContainer)),o._addon&&(o._inputAndAddon=o._inputAndAddon.add(o._addon))),o.removeHandlers(),this.addHandlers(),this.rtl&&this.host.addClass(this.toThemeProperty("jqx-rtl")),this.host.attr("role","textbox"),u.jqx.aria(this,"aria-autocomplete","both"),u.jqx.aria(this,"aria-disabled",this.disabled),u.jqx.aria(this,"aria-readonly",!1),u.jqx.aria(this,"aria-multiline",!1),u.jqx.aria(this,"aria-haspopup",!0),""!==o.value&&null!==o.value?(!0===o.upperCase?o.host.addClass(o.toThemeProperty("jqx-formatted-input-upper-case")):o.host.addClass(o.toThemeProperty("jqx-formatted-input-lower-case")),10===o._radixNumber&&"exponential"===o.decimalNotation?o.element.value=o._getDecimalNotation("exponential"):o.element.value=o.value):o._spinButtonsContainer&&o._spinButtonsContainer.addClass(o.toThemeProperty("jqx-fill-state-disabled")),10!==o._radixNumber&&"-9223372036854775808"===o.min.toString()?o._minLong=new o.longObj.math.Long.fromNumber(o.min):o._setMinMax("min"),10!==o._radixNumber&&"9223372036854775807"===o.max.toString()?o._maxLong=new o.longObj.math.Long.fromNumber(o.max):o._setMinMax("max"),this._addBarAndLabel(this.baseHost&&u(this.baseHost.children()[this.baseHost.children.length-1])||this.host),o.isMaterialized()&&setTimeout(function(){if(o.hint&&(o.label[0].innerHTML=o.placeHolder),!o.baseHost)return 0===o.element.value.length?o.element.removeAttribute("hint"):o.element.setAttribute("hint",!0),void o.bar.css("top","");0===o.element.value.length?o.baseHost[0].removeAttribute("hint"):o.baseHost[0].setAttribute("hint",!0)})},_refreshClasses:function(t){var e=t?"addClass":"removeClass";this.host[e](this.toThemeProperty("jqx-widget-content")),this.host[e](this.toThemeProperty("jqx-input")),this.host[e](this.toThemeProperty("jqx-formatted-input")),this.host[e](this.toThemeProperty("jqx-widget")),this.$popup[e](this.toThemeProperty("jqx-popup")),u.jqx.browser.msie&&this.$popup[e](this.toThemeProperty("jqx-noshadow")),this.$popup[e](this.toThemeProperty("jqx-input-popup")),this.$popup[e](this.toThemeProperty("jqx-menu")),this.$popup[e](this.toThemeProperty("jqx-menu-vertical")),this.$popup[e](this.toThemeProperty("jqx-menu-dropdown")),this.$popup[e](this.toThemeProperty("jqx-widget")),this.$popup[e](this.toThemeProperty("jqx-widget-content")),this.roundedCorners?(this.host[e](this.toThemeProperty("jqx-rc-all")),this.$popup[e](this.toThemeProperty("jqx-rc-all")),this.baseHost&&(this.baseHost[e](this.toThemeProperty("jqx-rc-all")),!1===this.rtl?(this.host[e](this.toThemeProperty("jqx-rc-l")),this._addon&&this._addon[e](this.toThemeProperty("jqx-rc-r"))):(this.host[e](this.toThemeProperty("jqx-rc-r")),this._addon&&this._addon[e](this.toThemeProperty("jqx-rc-l"))))):(this.host.removeClass(this.toThemeProperty("jqx-rc-all")),this.$popup.removeClass(this.toThemeProperty("jqx-rc-all")),this.baseHost&&(this.baseHost.removeClass(this.toThemeProperty("jqx-rc-all")),!1===this.rtl?(this.host.removeClass(this.toThemeProperty("jqx-rc-l")),this.dropDown?this._addon.removeClass(this.toThemeProperty("jqx-rc-r")):this.spinButtons&&this._spinButtonsContainer.removeClass(this.toThemeProperty("jqx-rc-r"))):(this.host.removeClass(this.toThemeProperty("jqx-rc-r")),this.dropDown?this._addon.removeClass(this.toThemeProperty("jqx-rc-l")):this.spinButtons&&this._spinButtonsContainer.removeClass(this.toThemeProperty("jqx-rc-l"))))),this.disabled?(this.host[e](this.toThemeProperty("jqx-fill-state-disabled")),this.baseHost&&(this._spinButtonsContainer&&this._spinButtonsContainer[e](this.toThemeProperty("jqx-fill-state-disabled")),this._addon&&this._addon[e](this.toThemeProperty("jqx-fill-state-disabled")))):(this.host.removeClass(this.toThemeProperty("jqx-fill-state-disabled")),this.baseHost&&""!==this.value&&null!==this.value&&(this._spinButtonsContainer&&this._spinButtonsContainer.removeClass(this.toThemeProperty("jqx-fill-state-disabled")),this._addon&&this._addon.removeClass(this.toThemeProperty("jqx-fill-state-disabled"))))},selectAll:function(){var e=this.host;setTimeout(function(){var t;"selectionStart"in e[0]?(e[0].focus(),e[0].setSelectionRange(0,e[0].value.length)):((t=e[0].createTextRange()).collapse(!0),t.moveEnd("character",e[0].value.length),t.moveStart("character",0),t.select())},10)},selectLast:function(){var t=this.host;this.selectStart(t[0].value.length)},selectFirst:function(){this.selectStart(0)},selectStart:function(e){var o=this.host;setTimeout(function(){var t;"selectionStart"in o[0]?(o[0].focus(),o[0].setSelectionRange(e,e)):((t=o[0].createTextRange()).collapse(!0),t.moveEnd("character",e),t.moveStart("character",e),t.select())},10)},focus:function(){try{this.host.focus();var t=this;setTimeout(function(){t.host.focus()},25)}catch(t){}},refresh:function(){var t,e,o,s,r,n,i,a,h=this;this._refreshClasses(!1),this._refreshClasses(!0),this.baseHost?(this.width&&this.baseHost.width(this.width),this.height&&(this.baseHost.height(this.height),t=0,e=this.baseHost.height()-2,u.jqx.browser.msie&&u.jqx.browser.version<8&&this.baseHost.css("display","inline-block"),u.each(this.baseHost.children(),function(){return 0<=this.className.indexOf("jqx-input-bar")||(0<=this.className.indexOf("jqx-input-label")||(u(this).css("height","100%"),u.jqx.browser.msie&&u.jqx.browser.version<8&&u(this).css("height",e+"px"),void(this!==h.element&&(t+=u(this).outerWidth()))))}),o="string"==typeof h.width&&"%"===h.width.charAt(h.width.length-1)?1:0,this.host.css("width",this.baseHost.width()-t-o+"px"),u.jqx.browser.msie&&u.jqx.browser.version<9&&(h._spinButtonsContainer&&(!1===h.rtl||!0===h.rtl&&h._addon)&&h._spinButtonsContainer.css("border-left-width","0"),h._addon&&(!1===h.rtl?h._addon.css("border-left-width","0"):h._spinButtonsContainer||h._addon.css("border-right-width","0")),s=0,u.jqx.browser.version<8&&(r=0,n=parseInt(h.host.css("border-left-width"),10)+parseInt(h.host.css("border-right-width"),10),i=parseInt(h.host.css("padding-left"),10)+parseInt(h.host.css("padding-right"),10),h._spinButtonsContainer&&(n+=parseInt(h._spinButtonsContainer.css("border-left-width"),10)+parseInt(h._spinButtonsContainer.css("border-right-width"),10),i+=parseInt(h._spinButtonsContainer.css("padding-left"),10)+parseInt(h._spinButtonsContainer.css("padding-right"),10),h._addon||(r=2)),h._addon&&(n+=parseInt(h._addon.css("border-left-width"),10)+parseInt(h._addon.css("border-right-width"),10),i+=parseInt(h._addon.css("padding-left"),10)+parseInt(h._addon.css("padding-right"),10),h._spinButtonsContainer||(r=2)),h.host.width(h.host.width()-(i+n)-r),s=6),h.host.height(h.baseHost.height()-(parseInt(h.host.css("border-top-width"),10)+parseInt(h.host.css("border-bottom-width"),10)+parseInt(h.host.css("padding-top"),10)+parseInt(h.host.css("padding-bottom"),10)+s)),a=h.host.height()+"px",h.host.css("min-height",a),h.host.css("line-height",a))),h.baseHost&&h.bar&&h.bar.css("top",1+h.host.outerHeight())):(this.width&&this.host.width(this.width),this.height&&this.host.height(this.height)),this.host.attr("disabled",this.disabled),this.host.attr("placeholder")||this._refreshPlaceHolder()},_refreshPlaceHolder:function(){var t=this;this.isMaterialized()&&this.hint?this.label[0].innerHTML=this.placeHolder:"placeholder"in this.element?this.host.attr("placeHolder",this.placeHolder):""===(t=this).element.value&&(this.element.value=this.placeHolder,this.host.focus(function(){t.element.value===t.placeHolder&&(t.element.value="")}),this.host.blur(function(){""!==t.element.value&&t.element.value!==t.placeHolder||(t.element.value=t.placeHolder)}))},destroy:function(){this.removeHandlers(),this.baseHost?(u.jqx.utilities.resize(this.baseHost,null,!0),this.baseHost.remove()):(u.jqx.utilities.resize(this.host,null,!0),this.host.remove()),this.$popup&&this.$popup.remove()},propertyChangedHandler:function(a,t,e,o){if("placeHolder"!==t)if("template"==t&&a.template&&(a._upbutton.removeClass(a.toThemeProperty("jqx-"+e)),a._downbutton.removeClass(a.toThemeProperty("jqx-"+e)),a._addon.removeClass(a.toThemeProperty("jqx-"+e)),a._upbutton.addClass(a.toThemeProperty("jqx-"+a.template)),a._downbutton.addClass(a.toThemeProperty("jqx-"+a.template)),a._addon.addClass(a.toThemeProperty("jqx-"+a.template))),"theme"!==t)if("disabled"===t&&u.jqx.aria(a,"aria-disabled",a.disabled),"value"!==t||e.toString().toUpperCase()===o.toString().toUpperCase())if(e===o||"radix"!==t){if(e!==o&&"decimalNotation"===t&&10===a._radixNumber&&(a.element.value="exponential"===o?a._getDecimalNotation("exponential"):a._number.toString(10)),e!==o&&("min"===t||"max"===t))return a._setMinMax(t),a._validateValue(a.value,!0),void(a.value=a.element.value);if(e===o||"upperCase"!==t||""===a.element.value){if("spinButtons"===t)return e!==o?void(a._spinButtonsContainer?s(a._spinButtonsContainer,o):r("spinButtons",o)):void 0;if(e!==o&&"spinButtonsStep"===t&&(a._spinButtonsStepLong=new a.longObj.math.Long.fromNumber(o)),"dropDown"===t)return e!==o?void(a._addon?s(a._addon,o):r("dropDown",o)):void 0;a.refresh()}else!0===o?(a.host.removeClass(a.toThemeProperty("jqx-formatted-input-lower-case")),a.host.addClass(a.toThemeProperty("jqx-formatted-input-upper-case"))):(a.host.removeClass(a.toThemeProperty("jqx-formatted-input-upper-case")),a.host.addClass(a.toThemeProperty("jqx-formatted-input-lower-case")))}else a._changeRadix(o);else a.val(o);else u.jqx.utilities.setTheme(e,o,a.host);else a._refreshPlaceHolder();function s(t,e){var o=a.host.width(),s=t.outerWidth();!1===e?(a.host.width(o+s),t.hide(),!0===a.rtl&&(!0===a.spinButtons&&a._spinButtonsContainer.addClass(a.toThemeProperty("jqx-formatted-input-spin-buttons-container-rtl-border")),!0===a.dropDown&&a._addon.removeClass(a.toThemeProperty("jqx-formatted-input-addon-rtl")))):(a.host.width(o-s),t.show(),!0===a.rtl&&!0===a.spinButtons&&!0===a.dropDown&&(a._spinButtonsContainer.removeClass(a.toThemeProperty("jqx-formatted-input-spin-buttons-container-rtl-border")),a._addon.addClass(a.toThemeProperty("jqx-formatted-input-addon-rtl"))))}function r(t,e){var o,s,r,n,i;!0===e&&(o=u(""),a.baseHost?(s=a.baseHost.children("div"),!1===a.rtl&&"spinButtons"===t||!0===a.rtl&&"dropDown"===t?s.before(o):s.after(o),a.render(),a.host.width(a.host.width()-o.outerWidth())):(r=a.element.id,a.host.removeAttr("id"),a.host.wrap(''),n=u("#"+r),!1===a.rtl?n.append(o):n.prepend(o),(i=a.host.data()).jqxFormattedInput.host=n,i.jqxFormattedInput.element=n[0],a.baseHost=n,a.baseHost.data(i),a.render(),a.refresh()))}},select:function(t,e,o){o=o||this.$popup.find(".jqx-fill-state-pressed").attr("data-value"),this._changeRadix(parseInt(o,10)),this._setMaxLength(!0),this.close()},val:function(t){var e=this;if(!t&&""!==t||"object"==typeof t&&!0===u.isEmptyObject(t)||"binary"===t||"octal"===t||"decimal"===t||"exponential"===t||"scientific"===t||"engineering"===t||"hexadecimal"===t){if(!t||"object"==typeof t&&!0===u.isEmptyObject(t))return e.element.value;if("exponential"===t||"scientific"===t||"engineering"===t)return e._getDecimalNotation(t);var o=e._getRadix(t);return e._number.toString(o)}if((t=t.toString()).toUpperCase()===e.element.value.toString().toUpperCase())return t;var s=e.element.value;!0===e.upperCase&&(t=t.toUpperCase());for(var r=t.split(""),n=0;n(BIN)"),t._popupOptions.push(t._number.toString(8)+" (OCT)"),t._popupOptions.push(t._number.toString(10)+" (DEC)"),t._popupOptions.push(t._number.toString(16)+" (HEX)")):(t._popupOptions.push("BIN"),t._popupOptions.push("OCT"),t._popupOptions.push("DEC"),t._popupOptions.push("HEX"))},_validateValue:function(t,e){var o=this;if(""===t)return!e||(o.element.value="",t);var s=new o.longObj.math.Long.fromString(t.toString(),o._radixNumber);if(s.lessThan(o._minLong)){if(e){o._number=o._minLong;var r=o._minLong.toString(o._radixNumber);return 16===o._radixNumber&&!0===o.upperCase&&(r=r.toUpperCase()),o.element.value=r}return!1}if(s.greaterThan(o._maxLong)){if(e){o._number=o._maxLong;var n=o._maxLong.toString(o._radixNumber);return 16===o._radixNumber&&!0===o.upperCase&&(n=n.toUpperCase()),o.element.value=n}return!1}return!e||(o._number=s,o.element.value=t)},_getNegativeDecimal:function(t,e){var o=t;if(8===e){for(var s=new Array,r=0;r<11;r++){for(var n=parseInt(t.charAt(r),8).toString(2);3!==n.length;)n="0"+n;s.push(n)}"0"===(o=s.join("")).charAt(0)&&(o=o.slice(1))}else if(16===e){for(var i=new Array,a=0;a<8;a++){for(var h=parseInt(t.charAt(a),16).toString(2);4!==h.length;)h="0"+h;i.push(h)}o=i.join("")}for(var d="",p=0;p=m.math.Long.TWO_PWR_63_DBL_?m.math.Long.MAX_VALUE:t<0?m.math.Long.fromNumber(-t).negate():new m.math.Long(t%m.math.Long.TWO_PWR_32_DBL_|0,t/m.math.Long.TWO_PWR_32_DBL_|0)},m.math.Long.fromBits=function(t,e){return new m.math.Long(t,e)},m.math.Long.fromString=function(t,e){if(0===t.length)throw new Error("number format error: empty string");var o=e||10;if(o<2||36>>16,o=65535&this.highBits,s=this.lowBits>>>16,r=65535&this.lowBits,n=t.highBits>>>16,i=65535&t.highBits,a=t.lowBits>>>16,h=0,d=0,p=0,l=0;return p+=(l+=r+(65535&t.lowBits))>>>16,l&=65535,d+=(p+=s+a)>>>16,p&=65535,h+=(d+=o+i)>>>16,d&=65535,h+=e+n,h&=65535,m.math.Long.fromBits(p<<16|l,h<<16|d)},m.math.Long.prototype.subtract=function(t){return this.add(t.negate())},m.math.Long.prototype.multiply=function(t){if(this.isZero())return m.math.Long.ZERO;if(t.isZero())return m.math.Long.ZERO;if(this.equals(m.math.Long.MIN_VALUE))return t.isOdd()?m.math.Long.MIN_VALUE:m.math.Long.ZERO;if(t.equals(m.math.Long.MIN_VALUE))return this.isOdd()?m.math.Long.MIN_VALUE:m.math.Long.ZERO;if(this.isNegative())return t.isNegative()?this.negate().multiply(t.negate()):this.negate().multiply(t).negate();if(t.isNegative())return this.multiply(t.negate()).negate();if(this.lessThan(m.math.Long.TWO_PWR_24_)&&t.lessThan(m.math.Long.TWO_PWR_24_))return m.math.Long.fromNumber(this.toNumber()*t.toNumber());var e=this.highBits>>>16,o=65535&this.highBits,s=this.lowBits>>>16,r=65535&this.lowBits,n=t.highBits>>>16,i=65535&t.highBits,a=t.lowBits>>>16,h=65535&t.lowBits,d=0,p=0,l=0,u=0;return l+=(u+=r*h)>>>16,u&=65535,p+=(l+=s*h)>>>16,l&=65535,p+=(l+=r*a)>>>16,l&=65535,d+=(p+=o*h)>>>16,p&=65535,d+=(p+=s*a)>>>16,p&=65535,d+=(p+=r*i)>>>16,p&=65535,d+=e*h+o*a+s*i+r*n,d&=65535,m.math.Long.fromBits(l<<16|u,d<<16|p)},m.math.Long.prototype.div=function(t){if(t.isZero())throw new Error("division by zero");if(this.isZero())return m.math.Long.ZERO;var e;if(this.equals(m.math.Long.MIN_VALUE)){if(t.equals(m.math.Long.ONE)||t.equals(m.math.Long.NEG_ONE))return m.math.Long.MIN_VALUE;if(t.equals(m.math.Long.MIN_VALUE))return m.math.Long.ONE;if((e=this.shiftRight(1).div(t).shiftLeft(1)).equals(m.math.Long.ZERO))return t.isNegative()?m.math.Long.ONE:m.math.Long.NEG_ONE;var o=this.subtract(t.multiply(e));return e.add(o.div(t))}if(t.equals(m.math.Long.MIN_VALUE))return m.math.Long.ZERO;if(this.isNegative())return t.isNegative()?this.negate().div(t.negate()):this.negate().div(t).negate();if(t.isNegative())return this.div(t.negate()).negate();var s=m.math.Long.ZERO;for(o=this;o.greaterThanOrEqual(t);){e=Math.max(1,Math.floor(o.toNumber()/t.toNumber()));for(var r=Math.ceil(Math.log(e)/Math.LN2),n=r<=48?1:Math.pow(2,r-48),i=m.math.Long.fromNumber(e),a=i.multiply(t);a.isNegative()||a.greaterThan(o);)e-=n,a=(i=m.math.Long.fromNumber(e)).multiply(t);i.isZero()&&(i=m.math.Long.ONE),s=s.add(i),o=o.subtract(a)}return s},m.math.Long.prototype.modulo=function(t){return this.subtract(this.div(t).multiply(t))},m.math.Long.prototype.not=function(){return m.math.Long.fromBits(~this.lowBits,~this.highBits)},m.math.Long.prototype.and=function(t){return m.math.Long.fromBits(this.lowBits&t.lowBits,this.highBits&t.highBits)},m.math.Long.prototype.or=function(t){return m.math.Long.fromBits(this.lowBits|t.lowBits,this.highBits|t.highBits)},m.math.Long.prototype.xor=function(t){return m.math.Long.fromBits(this.lowBits^t.lowBits,this.highBits^t.highBits)},m.math.Long.prototype.shiftLeft=function(t){if(0===(t&=63))return this;var e=this.lowBits;if(t<32){var o=this.highBits;return m.math.Long.fromBits(e<>>32-t)}return m.math.Long.fromBits(0,e<>>t|e<<32-t,e>>t)}return m.math.Long.fromBits(e>>t-32,0<=e?0:-1)},m.math.Long.prototype.shiftRightUnsigned=function(t){if(0===(t&=63))return this;var e=this.highBits;if(t<32){var o=this.lowBits;return m.math.Long.fromBits(o>>>t|e<<32-t,e>>>t)}return 32===t?m.math.Long.fromBits(e,0):m.math.Long.fromBits(e>>>t-32,0)}}})}(jqxBaseFramework);