@mescius/wijmo.input 5.20251.41-nightly.d20250814.t181729 → 5.20251.41-nightly.d20250815.t181715
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es2015-commonjs.js +2 -2
- package/es2015-esm.js +2 -2
- package/es5-esm.js +2 -2
- package/index.d.ts +4 -1
- package/index.js +2 -2
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* Wijmo Library 5.20251.41-nightly.
|
|
3
|
+
* Wijmo Library 5.20251.41-nightly.d20250815.t181715
|
|
4
4
|
* https://developer.mescius.com/wijmo
|
|
5
5
|
*
|
|
6
6
|
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
"use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};return function(t,e){extendStatics(t,e);function __(){this.constructor=t}t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}(),__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++){e=arguments[i];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t}).apply(this,arguments)},__importStar=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);e.default=t;return e};Object.defineProperty(exports,"__esModule",{value:!0});var wijmo_1=require("@mescius/wijmo"),selfModule=__importStar(require("@mescius/wijmo.input"));exports.AutoCompleteClsNames={hostElement:"wj-autocomplete"};exports.CalendarClsNames={buttonsOutside:"wj-btns-outside",calendarHeader:"wj-calendar-header",calendarMonth:"wj-calendar-month",calendarMultiMonth:"wj-calendar-multimonth",calendarOuter:"wj-calendar-outer",calendarYear:"wj-calendar-year",dayOtherMonth:"wj-day-othermonth",dayToday:"wj-day-today",dayWeekend:"wj-day-weekend",header:"wj-header",hostElement:"wj-calendar",monthSelect:"wj-month-select",weekAfter:"wj-week-after",weekBefore:"wj-week-before",yearPicker:"wj-yearpicker",focused:"wj-state-focus",selectedYear:"wj-select-year",confirmationButtonContainer:"wj-calendar-confirmation-button-container",button:"wj-calendar-button"};exports.CollectionViewNavigatorClsNames={hostElement:"wj-collectionview-navigator",pager:"wj-pager"};exports.ColorPickerClsNames={colorBox:"wj-colorbox",hostElement:"wj-colorpicker"};exports.ComboBoxClsNames={hostElement:"wj-combobox",stateMatch:"wj-state-match"};exports.DropDownClsNames={dropDownPanel:"wj-dropdown-panel",hostElement:"wj-dropdown"};exports.InputClsNames={input:"wj-input",inputBtnVisible:"wj-input-btn-visible",inputGroup:"wj-input-group",inputGroupBtn:"wj-input-group-btn"};exports.InputColorClsNames={hostElement:"wj-inputcolor",inputColorBox:"wj-inputcolorbox"};exports.InputDateClsNames={hostElement:"wj-inputdate",inputDateDropDown:"wj-inputdate-dropdown"};exports.InputDateRangeClsNames={hostElement:"wj-inputdaterange"};exports.InputDateTimeClsNames={hostElement:"wj-inputdatetime",showDropDownButton:"wj-show-dropdown-button"};exports.InputMaskClsNames={hostElement:"wj-inputmask"};exports.InputNumberClsNames={hostElement:"wj-inputnumber",numeric:"wj-numeric",showSpinner:"wj-input-show-spinner"};exports.InputTimeClsNames={hostElement:"wj-inputtime"};exports.ListBoxClsNames={header:"wj-header",hostElement:"wj-listbox",listBoxItem:"wj-listbox-item"};exports.MenuClsNames={hostElement:"wj-menu",menuItems:"wj-menu-items",subItems:"wj-subitems"};exports.MultiAutoCompleteClsNames={hostElement:"wj-multi-autocomplete",token:"wj-token",tokenActive:"wj-token-active",tokenClose:"wj-token-close",tokenHelper:"wj-token-helper",tokenLabel:"wj-token-label"};exports.MultiSelectClsNames={hostElement:"wj-multiselect"};exports.MultiSelectListBoxClsNames={header:"wj-header",hostElement:"wj-multiselectlistbox",selectAll:"wj-select-all"};exports.PopupClsNames={dialogHeader:"wj-dialog-header",hostElement:"wj-popup",popupBackDrop:"wj-popup-backdrop",dialogBody:"wj-dialog-body",dialogFooter:"wj-dialog-footer"};wijmo_1._addCultureInfo("InputNumber",{ariaLabels:{incVal:"Increase Value",decVal:"Decrease Value",inputNumberInput:"InputNumber Input",inputNumber:"Input Number"}});var InputNumber=function(t){__extends(InputNumber,t);function InputNumber(e,i){var o=t.call(this,e)||this;o._value=null;o._min=null;o._max=null;o._format="";o._step=null;o._showBtn=!0;o._readOnly=!1;o._handleWheel=!0;o._oldText="";o._fromKb=!0;o._inputElementAriaLabel=wijmo_1.culture.InputNumber.ariaLabels.inputNumberInput;o._ariaLabelledby=null;o.textChanged=new wijmo_1.Event;o.valueChanged=new wijmo_1.Event;var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.InputNumberClsNames.hostElement,n,{_tbx:"input",_btnUp:"btn-inc",_btnDn:"btn-dec"},"input");var s=o.inputElement;o.hostElement;wijmo_1.setAttribute(s,"role","spinbutton",!0);o._updateInputAriaLabel();var r=wijmo_1.culture.InputNumber.ariaLabels;wijmo_1.setAriaLabel(o._btnUp.querySelector("button"),r.incVal);wijmo_1.setAriaLabel(o._btnDn.querySelector("button"),r.decVal);o._tbx.type.match(/number/i)&&(o.inputType="");var a=o._tbx;a.autocomplete="off";a.spellcheck=!1;o._updateSymbols();var l=o.addEventListener.bind(o);l(a,"keypress",o._keypress.bind(o));l(a,"keydown",o._keydown.bind(o));l(a,"input",o._input.bind(o));l(a,"blur",(function(){o.text!=o._oldText&&o._setText(o.text)}));l(a,"paste",(function(){o._fromKb=!1}));l(a,"compositionstart",(function(){o._composing=!0}));l(a,"compositionend",(function(){o._composing=!1;setTimeout((function(){var t=o.text,e=o._oldText,i=o._chrPct;e&&e.indexOf(i)>-1&&t.indexOf(i)<0&&(t+=i);o._setText(t)}))}));var h=o._clickSpinner.bind(o);l(o._btnUp,"click",h);l(o._btnDn,"click",h);o._rptUp=new wijmo_1._ClickRepeater(o._btnUp.querySelector("button"));o._rptDn=new wijmo_1._ClickRepeater(o._btnDn.querySelector("button"));l(a,"wheel",(function(t){if(o.handleWheel&&!t.defaultPrevented&&!t.ctrlKey&&o._isEditable()&&o.containsFocus()){var e=wijmo_1.clamp(-t.deltaY,-1,1);o._increment((o.step||1)*e);setTimeout((function(){return o.selectAll()}));t.preventDefault()}}));o.value=0;o.isRequired=!0;o.initialize(i);return o}Object.defineProperty(InputNumber,"controlTemplate",{get:function(){InputNumber._ctrlTemplate||(InputNumber._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+'"><div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+'"><span wj-part="btn-dec" class="'+exports.InputClsNames.inputGroupBtn+'" tabindex="-1"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1">-</button></span><input type="tel" inputmode="numeric" wj-part="input" class="'+wijmo_1.InputFormElementsClsNames.formControl+" "+exports.InputNumberClsNames.numeric+'"/><span wj-part="btn-inc" class="'+exports.InputClsNames.inputGroupBtn+'" tabindex="-1"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1">+</button></span></div></div></div>');return InputNumber._ctrlTemplate},set:function(t){InputNumber._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"inputType",{get:function(){return this._tbx.type},set:function(t){this._tbx.type=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"value",{get:function(){return this._value},set:function(t){if(t!=this._value)if(null==(t=wijmo_1.asNumber(t,!this.isRequired||null==t&&null==this._value)))this._setText("");else if(!isNaN(t)){var e=wijmo_1.Globalize.format(t,this.format);this._setText(e)}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"isRequired",{get:function(){return this._tbx.required},set:function(t){this._tbx.required=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"isReadOnly",{get:function(){return this._readOnly},set:function(t){this._readOnly=wijmo_1.asBoolean(t);this.inputElement.readOnly=this._readOnly;wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(t){this._handleWheel=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"min",{get:function(){return this._min},set:function(t){if(t!=this._min){this._min=wijmo_1.asNumber(t,!0);this._updateAria()}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"max",{get:function(){return this._max},set:function(t){if(t!=this._max){this._max=wijmo_1.asNumber(t,!0);this._updateAria()}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"step",{get:function(){return this._step},set:function(t){this._step=wijmo_1.asNumber(t,!0);this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"format",{get:function(){return this._format},set:function(t){if(t!=this.format){this._format=wijmo_1.asString(t);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"text",{get:function(){return this._tbx.value},set:function(t){if(t!=this.text){this._oldText=this.text;this._setText(t)}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"placeholder",{get:function(){return this._tbx.placeholder},set:function(t){this._tbx.placeholder=t},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"showSpinner",{get:function(){return this._showBtn},set:function(t){this._showBtn=wijmo_1.asBoolean(t);this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"repeatButtons",{get:function(){return!this._rptUp.disabled},set:function(t){this._rptUp.disabled=this._rptDn.disabled=!wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(t){wijmo_1._setAriaLabelBy(this,this._tbx,t,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});InputNumber.prototype.selectAll=function(){var t=this._tbx;wijmo_1.setSelectionRange(t,0,t.value.length)};InputNumber.prototype.clamp=function(t){return wijmo_1.clamp(t,this.min,this.max)};InputNumber.prototype.onTextChanged=function(t){this.textChanged.raise(this,t);this._updateState()};InputNumber.prototype.onValueChanged=function(t){this._updateAria();this.valueChanged.raise(this,t)};InputNumber.prototype.dispose=function(){this._rptUp.element=null;this._rptDn.element=null;t.prototype.dispose.call(this)};InputNumber.prototype.onGotFocus=function(e){this._oldValue=this.value;if(!this.isTouching){this._tbx.focus();this.selectAll()}t.prototype.onGotFocus.call(this,e)};InputNumber.prototype.onLostFocus=function(e){if(this._composing){this._composing=!1;this._setText(this.text)}if(this._isEditable()){var i=this.clamp(this.value);if(i==this.value||this.onInvalidInput(new wijmo_1.CancelEventArgs)){var o=wijmo_1.Globalize.format(i,this.format);this._setText(o)}}t.prototype.onLostFocus.call(this,e)};InputNumber.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);if(this.hostElement){this._updateSymbols();var i=wijmo_1.Globalize.format(this.value,this.format);this._setText(i)}};InputNumber.prototype._isEditable=function(){return!this.isReadOnly&&!this.isDisabled};InputNumber.prototype._updateSymbols=function(){var t=wijmo_1.culture.Globalize.numberFormat,e=wijmo_1.Globalize._parseNumericFormat(this.format);this._chrDec=t["."]||".";this._chrTho=t[","]||",";this._chrNeg=t["-"]||"-";this._chrPls=t["+"]||"+";this._chrPct=t["%"]||"%";this._chrCur=e.curr||t.currency.symbol||"$";this._fmtSpc=e.spec;this._fmtPrc=e.prec;this._rxSym=new RegExp("^[%+\\-() \\"+this._chrDec+"\\"+this._chrCur+"\\"+this._chrNeg+"\\"+this._chrPls+"\\"+this._chrPct+"]*$");this._rxNeg=new RegExp("^\\s*(\\-|\\"+this._chrNeg+")|([^e](\\-|\\"+this._chrNeg+")|\\()")};InputNumber.prototype._isNumeric=function(t,e){var i=t==this._chrDec||t>="0"&&t<="9",o="x"==this._fmtSpc;!i&&o&&(i=t>="a"&&t<="f"||t>="A"&&t<="F");i||e||o||(i=t==this._chrPls||t==this._chrNeg||"("==t||")"==t);return i};InputNumber.prototype._getInputRange=function(t){for(var e=[0,0],i=this.text,o=!1,n=0;n<i.length;n++)if(this._isNumeric(i[n],t)){if(!o){e[0]=n;o=!0}e[1]=n+1}return e};InputNumber.prototype._flipSign=function(){var t=this._getSelStartDigits();this.value*=-1;this._setSelStartDigits(t)};InputNumber.prototype._getSelStartDigits=function(){for(var t=0,e=this._tbx.selectionStart,i=this._tbx.value,o=0;o<i.length&&o<e;o++)this._isNumeric(i[o],!0)&&t++;return t};InputNumber.prototype._setSelStartDigits=function(t){for(var e=this._tbx.value,i=0;i<e.length&&t>=0;i++)if(this._isNumeric(e[i],!0)){if(!t){wijmo_1.setSelectionRange(this._tbx,i);break}t--}else if(!t){wijmo_1.setSelectionRange(this._tbx,i);break}};InputNumber.prototype._increment=function(t){if(t){var e=this.clamp(wijmo_1.isNumber(this.value)?this.value+t:0),i=wijmo_1.Globalize.format(e,this.format,!1,!1);this._setText(i)}};InputNumber.prototype._updateBtn=function(){var t=this.showSpinner&&!!this.step,e=t;wijmo_1.setCss([this._btnUp,this._btnDn],{display:t?"":"none"});wijmo_1.toggleClass(this.hostElement,exports.InputNumberClsNames.showSpinner,t);wijmo_1.enable(this._btnUp,e);wijmo_1.enable(this._btnDn,e);this._updateAria()};InputNumber.prototype._setText=function(t,e,i){void 0===e&&(e=!1);void 0===i&&(i=!1);if(!this._composing){var o=this._tbx,n=this._chrDec,s=this._rxNeg.test(t),r=this._delKey,a=this.containsFocus();t&&this._rxSym.test(t)&&a&&(t=this.isRequired||!r?(s?"-0":"0")+(t.indexOf(n)>-1?n:""):"");this._delKey=!1;r&&0==this.value&&!this.isRequired&&(t="");if(!t){if(!this.isRequired||i){o.value="";if(this._oldText){this._oldText=t;this.onTextChanged()}if(null!=this._value){this._value=null;this.onValueChanged()}this._updateBtn();return}t="0"}var l=t.indexOf(n),h=this._format||(l>-1?"n2":"n0"),u=wijmo_1.Globalize.parseFloat(t,h);isFinite(u)||(u=this.clamp(u));if(isNaN(u))if(this.onInvalidInput(new wijmo_1.CancelEventArgs))o.value=this._oldText;else{o.value=t;this.focus()}else{var c=a&&l>-1?2:null,p=wijmo_1.Globalize.format(u,h,!1,e,c);s&&u>=0&&!r&&(p=this._chrNeg+p);a&&l>-1&&"g"==this._fmtSpc&&0!=this._fmtPrc&&(p=t).indexOf(n)<0&&(p+=n);if(o.value!=p){o.value=p;u=wijmo_1.Globalize.parseFloat(p,h)}if(this.text!=this._oldText){this._oldText=this.text;this.onTextChanged()}if(u!=this._value){this._value=u;this.onValueChanged()}this._updateBtn();this._updateState()}}};InputNumber.prototype._keypress=function(t){if(!t.defaultPrevented&&!this._composing&&this._isEditable()&&t.charCode&&!t.ctrlKey&&!t.metaKey&&t.keyCode!=wijmo_1.Key.Enter){var e=this._tbx,i=String.fromCharCode(t.charCode);if(this._isNumeric(i,!1)){var o=e.maxLength;if(o>-1&&e.value.length>=o&&e.selectionEnd==e.selectionStart){t.preventDefault();return}var n=this._getInputRange(!0),s=e.selectionStart,r=e.selectionEnd;if(s<n[0]&&r<e.value.length){r=Math.max(r,n[0]);wijmo_1.setSelectionRange(e,n[0],r)}if(s>=n[1]){var a=null!=this._fmtPrc?this._fmtPrc:2,l=e.value.indexOf(this._chrDec);l>-1&&s-l>a&&t.preventDefault()}}else t.preventDefault();switch(i){case"-":case this._chrNeg:if(this.clamp(-1)>=0)this.value<0&&this._flipSign();else if(this.value&&e.selectionStart==e.selectionEnd)this._flipSign();else if(this.clamp(-1)<0){e.value=this._chrNeg;wijmo_1.setSelectionRange(e,1)}t.preventDefault();break;case"+":case this._chrPls:this.value<0&&this._flipSign();t.preventDefault();break;case".":case this._chrDec:if(0==this._fmtPrc)t.preventDefault();else{var h=e.value.indexOf(this._chrDec);if(h>-1){e.selectionStart<=h&&h++;wijmo_1.setSelectionRange(e,h);t.preventDefault()}}}if(!t.defaultPrevented&&wijmo_1.isIE()){var u=e.value;if((s=e.selectionStart)==(r=e.selectionEnd)){e.value=u.substr(0,s)+i+u.substr(r);wijmo_1.setSelectionRange(e,s+1);t.preventDefault();this._input()}}}};InputNumber.prototype._keydown=function(t){var e=this;this._delKey=!1;if(!t.defaultPrevented&&!this._composing){var i=wijmo_1.hasClass(this._tbx,"wj-grid-ime");if(!i||t.keyCode==wijmo_1.Key.Back||t.keyCode==wijmo_1.Key.Delete){var o=this._tbx,n=o.value,s=o.selectionStart,r=o.selectionEnd;switch(t.keyCode){case 65:if(t.ctrlKey){setTimeout((function(){e.selectAll()}));t.preventDefault()}break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(this.step&&this._isEditable()){this._increment(this.step*(t.keyCode==wijmo_1.Key.Up?1:-1));setTimeout((function(){e.selectAll()}));t.preventDefault()}break;case wijmo_1.Key.Back:this._delKey=!0;if(r-s<2&&this._isEditable()){var a=n[r-1];if(a==this._chrDec||a==this._chrPct||a==this._chrTho||")"==a){setTimeout((function(){r=a==e._chrPct?e._getInputRange(!0)[1]:r-1;wijmo_1.setSelectionRange(o,r)}));t.preventDefault()}}break;case wijmo_1.Key.Delete:this._delKey=!0;if(r-s<2&&this._isEditable())if("0"==n&&1==s)wijmo_1.setSelectionRange(o,0);else{var l=n[s];if(l==this._chrDec||l==this._chrPct){setTimeout((function(){wijmo_1.setSelectionRange(o,s+1)}));t.preventDefault()}}break;case wijmo_1.Key.Escape:this.value=this._oldValue;this.selectAll()}i&&this._delKey&&this._isEditable()&&this._setText(null,!1,!0)}}};InputNumber.prototype._input=function(){var t=this;this._composing?this._fromKb=!0:setTimeout((function(){var e=t._tbx,i=e.value,o=i.indexOf(t._chrDec),n=e.selectionStart,s=t._getSelStartDigits();"p"==t._fmtSpc&&i.length&&i.indexOf(t._chrPct)<0&&(i+=t._chrPct);t._setText(i,t._fromKb);t._fromKb=!0;if(t.containsFocus()){var r=e.value,a=r.indexOf(t._chrDec),l=t._getInputRange(!0);if(i==t._chrNeg+t._chrDec&&a>-1){wijmo_1.setSelectionRange(e,a+1);return}if(i[0]==t._chrNeg&&r[0]!=t._chrNeg){if(1==r.length)wijmo_1.setSelectionRange(e,1);else{"c"===t._fmtSpc&&t._isNegativeCurrencyByParenthesis(i)&&(s-=1);t._setSelStartDigits(s)}return}i?i==t._chrDec&&a>-1?n=a+1:n<=o&&a>-1||o<0&&a<0?n+=r.length-i.length:o<0&&a>-1&&(n=a):n=a>-1?a:l[1];n=wijmo_1.clamp(n,l[0],l[1]);wijmo_1.setSelectionRange(e,n)}}))};InputNumber.prototype._isNegativeCurrencyByParenthesis=function(t){return t.length>1&&t[1]===this._chrCur};InputNumber.prototype._clickSpinner=function(t){var e=this;if(!t.defaultPrevented&&this._isEditable()&&this.step){this._increment(this.step*(wijmo_1.contains(this._btnUp,t.target)?1:-1));if(!this.isTouching){wijmo_1.Control.sharedState.InvalidScroll=wijmo_1.isEdge();setTimeout((function(){return e.selectAll()}))}}};InputNumber.prototype._updateAria=function(){var t=this.inputElement;if(this.hostElement){wijmo_1.setAttribute(t,"aria-valuemin",this.min);wijmo_1.setAttribute(t,"aria-valuemax",this.max);wijmo_1.setAttribute(t,"aria-valuenow",this.value);wijmo_1.setAttribute(t,"aria-valuetext",this.text);wijmo_1.setAttribute(t,"step",this.step);wijmo_1.enable(this._btnDn,null==this.min||this.value>this.min);wijmo_1.enable(this._btnUp,null==this.max||this.value<this.max)}};InputNumber.prototype._updateInputAriaLabel=function(){var t=this.inputElement;!t||t.id||this._ariaLabelledby?wijmo_1.setAttribute(t,"aria-label",null):wijmo_1.setAttribute(t,"aria-label",this._inputElementAriaLabel)};InputNumber.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputNumber.ariaLabels.inputNumber};InputNumber._ctrlTemplate="";return InputNumber}(wijmo_1.Control);exports.InputNumber=InputNumber;wijmo_1._addCultureInfo("InputMask",{ariaLabels:{inputMaskInput:"Input Mask Input",inputMask:"Input Mask"}});var ColorPickerTabKeyAction,InputMask=function(t){__extends(InputMask,t);function InputMask(e,i){var o=t.call(this,e)||this;o._fullEdit=!1;o._inputElementAriaLabel=wijmo_1.culture.InputMask.ariaLabels.inputMaskInput;o._ariaLabelledby=null;o.valueChanged=new wijmo_1.Event;var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.InputMaskClsNames.hostElement,n,{_tbx:"input"},"input");if("INPUT"==o._orgTag){var s=o._tbx.getAttribute("value");s&&(o.value=s)}o._msk=new wijmo_1._MaskProvider(o._tbx);o.isRequired=!0;o.initialize(i);o.addEventListener(o._tbx,"input",(function(){o.onValueChanged()}));o.addEventListener(o._tbx,"blur",o._commitText.bind(o));o.addEventListener(o._tbx,"keydown",(function(t){t.keyCode==wijmo_1.Key.Enter&&o._commitText()}));o._updateInputAriaLabel();return o}Object.defineProperty(InputMask,"controlTemplate",{get:function(){InputMask._ctrlTemplate||(InputMask._ctrlTemplate='<div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+'"><input wj-part="input" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"/></div></div>');return InputMask._ctrlTemplate},set:function(t){InputMask._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"inputType",{get:function(){return this._tbx.type},set:function(t){this._tbx.type=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"value",{get:function(){return this._tbx.value},set:function(t){if(t!=this.value){this._tbx.value=wijmo_1.asString(t);t=this._msk._applyMask();this._tbx.value=t;this.onValueChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"rawValue",{get:function(){return this._msk.getRawValue()},set:function(t){t!=this.rawValue&&(this.value=wijmo_1.asString(t))},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"mask",{get:function(){return this._msk.mask||""},set:function(t){var e=this.value;this._msk.mask=wijmo_1.asString(t);this.value!=e&&this.onValueChanged()},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"promptChar",{get:function(){return this._msk.promptChar},set:function(t){var e=this.value;this._msk.promptChar=t;this.value!=e&&this.onValueChanged()},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"overwriteMode",{get:function(){return this._msk.overwriteMode},set:function(t){this._msk.overwriteMode=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"placeholder",{get:function(){return this._tbx.placeholder},set:function(t){this._tbx.placeholder=t},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"maskFull",{get:function(){return this._msk.maskFull},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"isRequired",{get:function(){return this._tbx.required},set:function(t){this._tbx.required=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"isReadOnly",{get:function(){return this._tbx.readOnly},set:function(t){this._tbx.readOnly=wijmo_1.asBoolean(t);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly)},enumerable:!0,configurable:!0});InputMask.prototype.selectAll=function(){var t=this._msk.getMaskRange();wijmo_1.setSelectionRange(this._tbx,t[0],t[1]+1)};InputMask.prototype.onValueChanged=function(t){if(this.value!=this._oldValue){this._oldValue=this.value;this.valueChanged.raise(this,t)}this._updateState()};InputMask.prototype._commitText=function(){(this.rawValue||this.isRequired)&&(this.maskFull||this.onInvalidInput(new wijmo_1.CancelEventArgs));this._updateState()};InputMask.prototype.dispose=function(){this._msk.input=null;t.prototype.dispose.call(this)};InputMask.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);this.hostElement&&this._msk.refresh()};InputMask.prototype.onGotFocus=function(e){this.selectAll();t.prototype.onGotFocus.call(this,e)};Object.defineProperty(InputMask.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(t){wijmo_1._setAriaLabelBy(this,this._tbx,t,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});InputMask.prototype._updateInputAriaLabel=function(){var t=this.inputElement;!t||t.id||this._ariaLabelledby?wijmo_1.setAttribute(t,"aria-label",null):wijmo_1.setAttribute(t,"aria-label",this._inputElementAriaLabel)};InputMask.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputMask.ariaLabels.inputMask};InputMask._ctrlTemplate="";return InputMask}(wijmo_1.Control);exports.InputMask=InputMask;wijmo_1._addCultureInfo("ColorPicker",{ariaLabels:{colorPicker:"Color Picker",satAndBrightnessPanel:"Color saturation and brightness panel",huePanel:"Color hue panel",opacityPanel:"Color opacity panel",palettePanel:"Color palette panel",saturation:"Saturation:",hue:"Hue:",opacity:"Opacity:",degrees:"degrees",brightness:"Brightness:"}});!function(t){t[t.None=0]="None";t[t.All=1]="All"}(ColorPickerTabKeyAction=exports.ColorPickerTabKeyAction||(exports.ColorPickerTabKeyAction={}));var ColorPicker=function(t){__extends(ColorPicker,t);function ColorPicker(e,i){var o=t.call(this,e)||this;o._hsb=[.5,1,1];o._alpha=1;o._ariaLabel=wijmo_1.culture.ColorPicker.ariaLabels.colorPicker;o.valueChanged=new wijmo_1.Event;o.hostElement.setAttribute("role","application");o.hostElement.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.colorPicker);var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.ColorPickerClsNames.hostElement,n,{_eSB:"div-sb",_eHue:"div-hue",_eAlpha:"div-alpha",_ePreview:"div-pv",_ePal:"div-pal",_eText:"div-text"});o._palette="#FFF,#000,#F00,#FFC000,#FFFF00,#92D050,#00B050,#00B0F0,#0070C0,#7030A0".split(",");o._updatePalette();o._eHue.style.backgroundImage="url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAD4CAIAAACi6hsPAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuM4zml1AAAAGvSURBVDhPXdBPaM9xHMfxz4pWaxcmtoOhpdXSVpiyHWxqmVpDjaU5rK34XfypjTJ/p+ZPay6jhsOsRrKwaJElf9IQq03WIkv4FeMwMq221tfje1ByeFzfvd7PEKWGEKWTQRZLySWfVRRTQjmVbKWGOhLsZT+HaeY0bbTTQSfdXOcWffTzmAFeMcwoYyT5ygS/mA5hNgphip98J8kHRnnNSwZ4yH1uc4OrdHGR87RximYO0cgedlLLdqqoYAPrWMtKVrCcJSxiPmnMJUQp/Bsyk2xyyKOAQooopYwKtlDNDur5G7SBJo7RQiv/B+2hl3s84CkvGGKEOOYnxolj/mYmhBmDJ5ngCx95xxsGecYj4pB3iENeoZMO2mmlhaMcpIE4ZII6aqhmM3HMMkooopB88sghm0wySCeVlCjMCVFIYx4LWUwOeRSwhmLWU84mqqihll3sppEmjnOSs5zjEl1c4yZ99POE5wwxwns+840fTDFLFKaZZIJxkozxlmEGGSC+GF++Sy89dHOZC8Rr4lVnOMERDrCPBPXEX22jko2UEn+/mnxyWUYWC0gnNUQh/AEc0HJs6cex0gAAAABJRU5ErkJggg==)";o._eHue.style.backgroundSize="contain";if(navigator.appVersion.indexOf("MSIE 9")>-1){o._eSB.children[0].style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffffff,endColorstr=#00ffffff,GradientType=1)";o._eSB.children[1].style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000,endColorstr=#ff000000,GradientType=0)"}n=ColorPicker._tplCursor;o._cSB=wijmo_1.createElement(n);o._cHue=wijmo_1.createElement(n);o._cHue.style.width="100%";o._cAlpha=wijmo_1.createElement(n);o._cAlpha.style.height="100%";o._eSB.appendChild(o._cSB);o._eHue.appendChild(o._cHue);o._eAlpha.appendChild(o._cAlpha);o._keyActionTab=ColorPickerTabKeyAction.None;var s=o.addEventListener.bind(o),r=o.removeEventListener.bind(o),a=document;s(o.hostElement,"mousedown",(function(t){s(a,"mousemove",mouseMove);s(a,"mouseup",mouseUp);o._mouseDown(t)}));s(o.hostElement,"touchstart",(function(t){s(a,"touchmove",mouseMove);s(a,"touchend",mouseUp);o._mouseDown(t)}));var mouseMove=function(t){o._mouseMove(t)},mouseUp=function(t){r(a,"mousemove",mouseMove);r(a,"mouseup",mouseUp);r(a,"touchmove",mouseMove);r(a,"touchend",mouseUp);o._mouseUp(t)};s(o.hostElement,"click",(function(t){if(!o.isDisabled){var e=t.target;if(e&&"DIV"==e.tagName&&wijmo_1.contains(o._ePal,e)){var i=e.style.backgroundColor;i&&(o.value=new wijmo_1.Color(i).toString());e.focus()}}}));s(o.hostElement,"keydown",(function(t){o.isDisabled||o._keydown(t)}));o.value="#ffffff";o.initialize(i);o._updatePanels();o._eSB.setAttribute("role","slider");o._eSB.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.satAndBrightnessPanel);o._eSB.setAttribute("aria-valuemin","0");o._eSB.setAttribute("aria-valuemax","100");o._eHue.setAttribute("role","slider");o._eHue.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.huePanel);o._eHue.setAttribute("aria-valuemin","0");o._eHue.setAttribute("aria-valuemax","360");o._eAlpha.setAttribute("role","slider");o._eAlpha.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.opacityPanel);o._eAlpha.setAttribute("aria-valuemin","0");o._eAlpha.setAttribute("aria-valuemax","100");o._ePal.setAttribute("role","grid");o._ePal.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.palettePanel);o._updateTabIndex();return o}Object.defineProperty(ColorPicker,"controlTemplate",{get:function(){ColorPicker._ctrlTemplate||(ColorPicker._ctrlTemplate='<div style="position:relative;width:100%;height:100%"><div style="float:left;width:50%;height:100%;box-sizing:border-box;padding:2px"><div wj-part="div-pal"><div style="float:left;width:10%;box-sizing:border-box;padding:2px"><div style="background-color:black;width:100%"> </div><div style="height:6px"></div></div></div><div wj-part="div-text" style="position:absolute;bottom:0px;display:none"></div></div><div style="float:left;width:50%;height:100%;box-sizing:border-box;padding:2px"><div wj-part="div-sb" class="'+exports.ColorPickerClsNames.colorBox+'" style="float:left;width:89%;height:89%"><div style="position:absolute;width:100%;height:100%;background:linear-gradient(to right, white 0%,transparent 100%)"></div><div style="position:absolute;width:100%;height:100%;background:linear-gradient(to top, black 0%,transparent 100%)"></div></div><div style="float:left;width:1%;height:89%"></div><div style="float:left;width:10%;height:89%"><div wj-part="div-hue" class="'+exports.ColorPickerClsNames.colorBox+'"></div></div><div style="float:left;width:89%;height:1%"></div><div style="float:left;width:89%;height:10%"><div style="width:100%;height:100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuM4zml1AAAAAcSURBVBhXY/iPBBYgAWpKQGkwgMqDAdUk/v8HAM7Mm6GatDUYAAAAAElFTkSuQmCC)"><div wj-part="div-alpha" class="'+exports.ColorPickerClsNames.colorBox+'"></div></div></div><div style="float:left;width:1%;height:10%"></div><div style="float:left;width:10%;height:10%"><div wj-part="div-pv" class="'+exports.ColorPickerClsNames.colorBox+'" style="position:static"></div></div></div></div>');return ColorPicker._ctrlTemplate},set:function(t){ColorPicker._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"showAlphaChannel",{get:function(){return"none"!=this._eAlpha.parentElement.style.display},set:function(t){this._eAlpha.parentElement.style.display=wijmo_1.asBoolean(t)?"":"none"},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"showColorString",{get:function(){return"none"!=this._eText.style.display},set:function(t){this._eText.style.display=wijmo_1.asBoolean(t)?"":"none";if(wijmo_1.asBoolean(t)){this._eText.setAttribute("role","status");this._eText.setAttribute("aria-live","polite")}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"value",{get:function(){return this._value},set:function(t){if(t!=this.value){t=(t=wijmo_1.asString(t)).trim();var e=wijmo_1.Color.fromString(t);if(e){this._value=t;this._eText.innerText=t;var i=e.getHsb();if(this._hsb[0]!=i[0]||this._hsb[1]!=i[1]||this._hsb[2]!=i[2]||this._alpha!=e.a){if(0==i[2]){i[0]=this._hsb[0];i[1]=this._hsb[1]}else 0==i[1]&&(i[0]=this._hsb[0]);this._hsb=i;this._alpha=e.a;this.onValueChanged()}}}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"palette",{get:function(){return this._palette},set:function(t){if((t=(t=wijmo_1.asArray(t)).slice(0,10)).every((function(t){return null!=wijmo_1.Color.fromString(t)}))){this._palette=t;this._updatePalette()}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"ariaLabel",{get:function(){return this._ariaLabel},set:function(t){if(t!=this._ariaLabel){this._ariaLabel=t;wijmo_1.setAttribute(this.hostElement,"aria-label",this._ariaLabel)}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(t){this._keyActionTab=t;if(t==ColorPickerTabKeyAction.All){this.tabOrder=0;this.hostElement.setAttribute("tabindex","-1")}this._updateTabIndex()},enumerable:!0,configurable:!0});ColorPicker.prototype._setTabOrder=function(e){t.prototype._setTabOrder.call(this,e);this.isDisabled||this._updateTabIndex()};ColorPicker.prototype.onValueChanged=function(t){this._refreshSelection();this.valueChanged.raise(this,t)};ColorPicker.prototype._mouseDown=function(t){this._htDown=this._getTargetPanel(t);if(this._htDown){t.preventDefault();this._htDown.focus();this._mouseMove(t)}};ColorPicker.prototype._mouseMove=function(t){if(!this.isDisabled){var e=t.touches?t.touches[0]:t,i=this._htDown;if(i){var o=i.getBoundingClientRect(),n=this._hsb;if(i==this._eHue)n[0]=wijmo_1.clamp((e.clientY-o.top)/o.height,0,.99);else if(i==this._eSB){n[1]=wijmo_1.clamp((e.clientX-o.left)/o.width,0,1);n[2]=wijmo_1.clamp(1-(e.clientY-o.top)/o.height,0,1)}else i==this._eAlpha&&(this._alpha=wijmo_1.clamp((e.clientX-o.left)/o.width,0,1));this._updateColor()}}};ColorPicker.prototype._mouseUp=function(t){this._htDown=null};ColorPicker.prototype._updateColor=function(){var t=wijmo_1.Color.fromHsb(this._hsb[0],this._hsb[1],this._hsb[2],this._alpha);this.value=t.toString();this._refreshSelection()};ColorPicker.prototype._updatePalette=function(){var t=this,e=new wijmo_1.Color("#fff"),i=new wijmo_1.Color("#000");this._ePal.innerHTML="";this._ePal.className="palette-grid";for(var o=Array.from({length:6},(function(){var t=document.createElement("div");t.className="palette-row";t.setAttribute("role","row");return t})),n=this.getActualTabIndex(),s=0;s<this._palette.length;s++){var r=new wijmo_1.Color(this._palette[s]),a=r.getHsb(),l=this._makePalEntry(r,4);l.setAttribute("role","columnheader");l.setAttribute("aria-label",""+r.toString());if(0===s){this._ePalMainFirst=l;this._ePalMainFirst.setAttribute("tabindex",n)}else l.setAttribute("tabindex","-1");o[0].appendChild(l);for(var h=0;h<5;h++){var u=0===a[1]?wijmo_1.Color.interpolate(e,i,.1*h+(a[2]>.5?.05:.55)):wijmo_1.Color.fromHsb(a[0],.1+.2*h,1-.1*h),c=this._makePalEntry(u,0);c.setAttribute("role","gridcell");c.setAttribute("aria-label",""+u.toString());if(0===s&&0===h){this._ePalShadeFirst=c;this._ePalShadeFirst.setAttribute("tabindex",n)}else wijmo_1.setAttribute(c,"tabindex","-1");o[h+1].appendChild(c)}}o.forEach((function(e){return t._ePal.appendChild(e)}))};ColorPicker.prototype._makePalEntry=function(t,e){var i=document.createElement("div");i.className="palette-gridcell";wijmo_1.setCss(i,{backgroundColor:t.toString(),marginBottom:e||""});i.innerHTML=" ";return i};ColorPicker.prototype._updatePanels=function(){var t=wijmo_1.Color.fromHsb(this._hsb[0],1,1,1),e=wijmo_1.Color.fromHsb(this._hsb[0],this._hsb[1],this._hsb[2],1);this._eSB.style.backgroundColor=t.toString();this._eAlpha.style.background="linear-gradient(to right, transparent 0%, "+e.toString()+" 100%)";navigator.appVersion.indexOf("MSIE 9")>-1&&(this._eAlpha.style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000,endColorstr="+e.toString()+", GradientType = 1)");this._ePreview.style.backgroundColor=this.value;this._cHue.style.top=(100*this._hsb[0]).toFixed(0)+"%";this._cSB.style.left=(100*this._hsb[1]).toFixed(0)+"%";this._cSB.style.top=(100-100*this._hsb[2]).toFixed(0)+"%";this._cAlpha.style.left=(100*this._alpha).toFixed(0)+"%";var i=this.getColorsDiv(),o=wijmo_1.getActiveElement();if(this.keyActionTab===ColorPickerTabKeyAction.All&&!this.hostElement.contains(o)){if(this.isDisabled)return;for(var n=!1,s=0;s<i.length;s++){var r=i[s].style.backgroundColor;if(wijmo_1.Color.fromString(this.value).equals(wijmo_1.Color.fromString(r))){i[s].focus();n=!0;break}}n||i[0].focus()}};ColorPicker.prototype.getColorsDiv=function(){var t=Array.from(this._ePal.querySelectorAll('[role="columnheader"]')),e=Array.from(this._ePal.querySelectorAll('[role="gridcell"]'));return t.concat(e)};ColorPicker.prototype._getTargetPanel=function(t){var e=t.target;return wijmo_1.contains(this._eSB,e)?this._eSB:wijmo_1.contains(this._eHue,e)?this._eHue:wijmo_1.contains(this._eAlpha,e)?this._eAlpha:null};ColorPicker.prototype.getActualTabIndex=function(){var t=this.tabOrder.toString();return this.keyActionTab===ColorPickerTabKeyAction.All&&!0!==this.isDisabled?t:"-1"};ColorPicker.prototype._updateTabIndex=function(){var t=this.getActualTabIndex();this._eSB.setAttribute("tabindex",t);this._eHue.setAttribute("tabindex",t);this._eAlpha.setAttribute("tabindex",t);this._ePalMainFirst.setAttribute("tabindex",t);this._ePalShadeFirst.setAttribute("tabindex",t)};ColorPicker.prototype._setIsDisabled=function(e){t.prototype._setIsDisabled.call(this,e);this._updateTabIndex()};ColorPicker.prototype._updateAriaValues=function(){var t=this._hsb;this._eSB.setAttribute("aria-valuenow",(100*t[1]).toString());this._eSB.setAttribute("aria-valuetext",wijmo_1.culture.ColorPicker.ariaLabels.saturation+" "+Math.round(100*t[1])+"%, "+wijmo_1.culture.ColorPicker.ariaLabels.brightness+" "+Math.round(100*t[2])+"%");this._eHue.setAttribute("aria-valuenow",(360*t[0]).toString());this._eHue.setAttribute("aria-valuetext",wijmo_1.culture.ColorPicker.ariaLabels.hue+" "+Math.round(360*t[0])+" "+wijmo_1.culture.ColorPicker.ariaLabels.degrees);this._eAlpha.setAttribute("aria-valuenow",(100*this._alpha).toString());this._eAlpha.setAttribute("aria-valuetext",wijmo_1.culture.ColorPicker.ariaLabels.opacity+" "+Math.round(100*this._alpha)+"%")};ColorPicker.prototype._keydown=function(t){var e=t.target;this._isInColorPalette(e)?this._handleColorNavigation(t,e):e!==this._eSB?e!==this._eHue?e!==this._eAlpha||this._handleAlphaNavigation(t):this._handleHSBNavigation(t,"hue"):this._handleHSBNavigation(t,"sb")};ColorPicker.prototype._isInColorPalette=function(t){return t&&"DIV"===t.tagName&&wijmo_1.contains(this._ePal,t)};ColorPicker.prototype._handleColorNavigation=function(t,e){var i=this.getColorsDiv(),o=this.palette.length,n=i.findIndex((function(t){return t===e})),s=null;switch(t.key){case"ArrowDown":n<i.length-1&&(s=i[n+o]);break;case"ArrowUp":n>0&&(s=i[n-o]);break;case"ArrowRight":var r=n+1;r<i.length&&(s=i[r]);break;case"ArrowLeft":var a=n-1;a>=0&&(s=i[a])}if(s){var l=s.style.backgroundColor;l&&(this.value=new wijmo_1.Color(l).toString());s.focus();t.preventDefault()}};ColorPicker.prototype._handleHSBNavigation=function(t,e){var i=this;this._hsb=this._hsb.map((function(t){return wijmo_1.roundTo(t,2)}));var adjust=function(t,e,o){var n=Math.round(100*i._hsb[t]);i._hsb[t]=wijmo_1.clamp((n+e)/100,0,o)};switch(t.key){case"ArrowLeft":"sb"===e&&adjust(1,-1,1);break;case"ArrowRight":"sb"===e&&adjust(1,1,1);break;case"ArrowUp":"sb"===e?adjust(2,1,1):adjust(0,-1,.99);break;case"ArrowDown":"sb"===e?adjust(2,-1,1):adjust(0,1,.99)}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){this._updateColor();t.preventDefault()}};ColorPicker.prototype._refreshSelection=function(){this._updatePanels();this._updateAriaValues()};ColorPicker.prototype._handleAlphaNavigation=function(t){switch(t.key){case"ArrowLeft":this._alpha=wijmo_1.clamp(this._alpha-.01,0,1);break;case"ArrowRight":this._alpha=wijmo_1.clamp(this._alpha+.01,0,1);break;default:return}this._updateColor();t.preventDefault()};ColorPicker._ctrlTemplate="";ColorPicker._tplCursor='<div class="wj-colorpicker-cursor"></div>';return ColorPicker}(wijmo_1.Control);exports.ColorPicker=ColorPicker;wijmo_1._addCultureInfo("CollectionViewNavigator",{ariaLabels:{byPage:{btnFirst:"Navigate to first page",btnPrev:"Navigate to previous page",btnNext:"Navigate to next page",btnLast:"Navigate to last page"},byItem:{btnFirst:"Navigate to first item",btnPrev:"Navigate to previous item",btnNext:"Navigate to next item",btnLast:"Navigate to last item"}}});var CollectionViewNavigator=function(t){__extends(CollectionViewNavigator,t);function CollectionViewNavigator(e,i){var o=t.call(this,e)||this;o._view=null;o._byPage=!1;o._fmt="{current:n0} / {count:n0}";o._liveRegionON=!1;o._ariaLabel="";var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.CollectionViewNavigatorClsNames.pager+" "+exports.CollectionViewNavigatorClsNames.hostElement,n,{_btnFirst:"btn-first",_btnPrev:"btn-prev",_txtCurr:"txt-curr",_btnNext:"btn-next",_btnLast:"btn-last"},"input");o.hostElement.tabIndex=-1;o._updateAriaLabels();var s=wijmo_1.uidGenerator();o._txtCurr.id=s;[o._btnFirst,o._btnPrev,o._btnNext,o._btnLast].forEach((function(t){wijmo_1.setAttribute(t.firstElementChild,"aria-controls",o._txtCurr.id)}));wijmo_1.setAttribute(o.hostElement.firstElementChild,"role","group");wijmo_1.setAttribute(o._txtCurr,"role","status");o._rptNext=new wijmo_1._ClickRepeater(o._btnNext.querySelector("button"));o._rptPrev=new wijmo_1._ClickRepeater(o._btnPrev.querySelector("button"));o.addEventListener(o.hostElement,"click",o._click.bind(o));o.addEventListener(o.hostElement,"keydown",o._keydown.bind(o));wijmo_1.setAttribute(o.hostElement,"role","navigation");o._addA11yRelatedHandlers();o.initialize(i);o._update();return o}Object.defineProperty(CollectionViewNavigator,"controlTemplate",{get:function(){CollectionViewNavigator._ctrlTemplate||(CollectionViewNavigator._ctrlTemplate='<div class="'+exports.InputClsNames.inputGroup+'"><span wj-part="btn-first" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.stepBackward+'"></span></button></span><span wj-part="btn-prev" class="'+exports.InputClsNames.inputGroupBtn+'"> <button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.left+'"></span> </button></span><span wj-part="txt-curr" tabIndex="0"></span><span wj-part="btn-next" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.right+'"></span></button></span><span wj-part="btn-last" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.stepForward+'"></span></button></span></div>');return CollectionViewNavigator._ctrlTemplate},set:function(t){CollectionViewNavigator._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"cv",{get:function(){return this._view},set:function(t){if(t!=this._view){var e=this._view;if(e){e.collectionChanged.removeHandler(this._collectionChanged);e.currentChanged.removeHandler(this._currentChanged)}e=this._view=wijmo_1.asType(t,"ICollectionView",!0);this._update();if(e){e.collectionChanged.addHandler(this._collectionChanged,this);e.currentChanged.addHandler(this._currentChanged,this)}}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"byPage",{get:function(){return this._byPage},set:function(t){if(t!=this._byPage){this._byPage=wijmo_1.asBoolean(t);this._update();this._updateAriaLabels()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"headerFormat",{get:function(){return this._fmt},set:function(t){if(t!=this._fmt){this._fmt=wijmo_1.asString(t);this._update()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"repeatButtons",{get:function(){return!this._rptNext.disabled},set:function(t){this._rptNext.disabled=this._rptPrev.disabled=!wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"ariaLabel",{get:function(){if(this.hostElement){var t=this.hostElement.getAttribute("aria-label");if(t)return t}return this._ariaLabel},set:function(t){if(this.ariaLabel!==t){this._ariaLabel=t;this.hostElement&&wijmo_1.setAttribute(this.hostElement,"aria-label",t)}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"isDisabled",{get:function(){return this._isDisabled},set:function(t){this._setIsDisabled(t)},enumerable:!0,configurable:!0});CollectionViewNavigator.prototype.focus=function(){var t=this._e;t&&t.offsetHeight&&(this.isDisabled||wijmo_1.moveFocus(t,0)||this._txtCurr.tabIndex>=0&&this._txtCurr.focus())};CollectionViewNavigator.prototype._update=function(){var t=this,e=this._view,i=this._byPage,o=e?i?e.pageIndex:e.currentPosition:0,n=e?i?e.pageCount:e.itemCount:0;if(!this.isDisabled){wijmo_1.enable(this._btnFirst,e&&o>0);wijmo_1.enable(this._btnPrev,e&&o>0);wijmo_1.enable(this._txtCurr,null!=e);wijmo_1.enable(this._btnNext,e&&o<n-1);wijmo_1.enable(this._btnLast,e&&o<n-1)}[this._btnFirst,this._btnPrev,this._btnNext,this._btnLast].forEach((function(e){e.firstElementChild.disabled?e.firstElementChild.setAttribute("tabindex","-1"):e.firstElementChild.setAttribute("tabindex",t._orgTabIndex.toString())}));this._txtCurr.textContent=wijmo_1.format(this._fmt,{current:e?o+1:0,count:e?n:0,currentItem:e?e.currentPosition+1:0,itemCount:e?e.itemCount:0,currentPage:e?e.pageIndex+1:0,pageCount:e?e.pageCount:0})};CollectionViewNavigator.prototype._currentChanged=function(){this._update()};CollectionViewNavigator.prototype._collectionChanged=function(){this._update()};CollectionViewNavigator.prototype._click=function(t){var e=t.target,i=this._view,o=this._byPage;if(i){wijmo_1.contains(this._btnFirst,e)?o?i.moveToFirstPage():i.moveCurrentToFirst():wijmo_1.contains(this._btnPrev,e)?o?i.moveToPreviousPage():i.moveCurrentToPrevious():wijmo_1.contains(this._btnNext,e)?o?i.moveToNextPage():i.moveCurrentToNext():wijmo_1.contains(this._btnLast,e)&&(o?i.moveToLastPage():i.moveCurrentToLast());(this.byPage?i.pageIndex>=i.pageCount-1||i.pageIndex<=0:i.currentPosition>=i.itemCount-1||i.currentPosition<=0)&&!this.isDisabled&&this._txtCurr.tabIndex>=0&&this._txtCurr.focus();t.preventDefault()}};CollectionViewNavigator.prototype._updateAriaLabels=function(){var t=wijmo_1.culture.CollectionViewNavigator.ariaLabels[this._byPage?"byPage":"byItem"];wijmo_1.setAttribute(this._btnFirst.firstElementChild,"aria-label",t.btnFirst);wijmo_1.setAttribute(this._btnPrev.firstElementChild,"aria-label",t.btnPrev);wijmo_1.setAttribute(this._btnNext.firstElementChild,"aria-label",t.btnNext);wijmo_1.setAttribute(this._btnLast.firstElementChild,"aria-label",t.btnLast)};CollectionViewNavigator.prototype._addA11yRelatedHandlers=function(){var t=this;this.addEventListener(this._txtCurr,"focus",(function(e){if(t._txtCurr===document.activeElement){wijmo_1.setAttribute(t._txtCurr,"aria-live","off");wijmo_1.setAttribute(t._txtCurr,"aria-label",t._txtCurr.textContent);t._liveRegionON=!1}}));this.addEventListener(this._txtCurr,"blur",(function(e){t._txtCurr!==document.activeElement&&t._txtCurr.removeAttribute("aria-label")}));[this._btnFirst.firstElementChild,this._btnPrev.firstElementChild,this._btnNext.firstElementChild,this._btnLast.firstElementChild].forEach((function(e){t.addEventListener(e,"focus",(function(e){setTimeout((function(){if(!t._liveRegionON){var e=wijmo_1._isMacOS()?"polite":"assertive";wijmo_1.setAttribute(t._txtCurr,"aria-live",e);t._liveRegionON=!0}}))}))}))};CollectionViewNavigator.prototype._setTabOrder=function(t){var e=this._e,i=null!=this._txtCurr.getAttribute("disabled");this._orgTabIndex=t;if(this.isDisabled||i){e.tabIndex=-1;this._txtCurr.tabIndex=-1}else i||(this._txtCurr.tabIndex=this._orgTabIndex)};CollectionViewNavigator.prototype._keydown=function(t){if(wijmo_1.contains(this._txtCurr,t.target)&&(t.ctrlKey||t.metaKey)&&("A"===t.key||"a"===t.key)){t.preventDefault();var e=document.createRange();e.selectNodeContents(this._txtCurr);var i=window.getSelection();i.removeAllRanges();i.addRange(e)}};CollectionViewNavigator.prototype._setIsDisabled=function(t){var e=this;if((t=!!wijmo_1.asBoolean(t,!0))!=this.isDisabled){var i=this._e;if(i){this._isDisabled=t;wijmo_1.toggleClass(i,wijmo_1.ControlStateClsNames.disabled,t);[this._btnFirst,this._btnPrev,this._btnNext,this._btnLast].forEach((function(i){if(t){i.firstElementChild.setAttribute("disabled","");i.firstElementChild.setAttribute("tabindex","-1")}else{i.firstElementChild.removeAttribute("disabled");i.firstElementChild.setAttribute("tabindex",e._orgTabIndex.toString())}wijmo_1.toggleClass(i,wijmo_1.ControlStateClsNames.disabled,t)}));this._txtCurr.tabIndex=t?-1:this._orgTabIndex;wijmo_1.toggleClass(this._txtCurr,wijmo_1.ControlStateClsNames.disabled,t)}}};CollectionViewNavigator._ctrlTemplate="";return CollectionViewNavigator}(wijmo_1.Control);exports.CollectionViewNavigator=CollectionViewNavigator;wijmo_1._addCultureInfo("Listbox",{ariaLabels:{listBox:"list box"}});var ListBox=function(t){__extends(ListBox,t);function ListBox(e,i){var o=t.call(this,e,null,!0)||this;o._cv=null;o._itemFormatter=null;o._pathDisplay=new wijmo_1.Binding("");o._pathValue=new wijmo_1.Binding("");o._pathChecked=new wijmo_1.Binding("");o._html=!1;o._shGroups=!1;o._checkedItems=[];o._itemRole="option";o._caseSensitive=!1;o._addMode=!1;o._isShiftDown=!1;o._shouldClearOnShift=!0;o._vThreshold=ListBox._VTHRESH;o._isVirtual=!1;o._children=[];o._ignoreItemFormatterTextArray=[];o._itemFormatterHelper=document.createElement("div");o._clientHeight=-1;o._itemHeight=30;o._itemsAbove=-1;o._itemsBelow=-1;o._eSizer=document.createElement("div");o._ePadTop=document.createElement("div");o._ePadBot=document.createElement("div");o._checking=!1;o._ignoredItemChangedEvents=!1;o._search="";o._fmtItemHandlers=0;o._itemCount=0;o._oldSel=null;o._container=null;o._oldSelectedIndex=-1;o._ariaLabel=wijmo_1.culture.Listbox.ariaLabels.listBox;o.selectedIndexChanged=new wijmo_1.Event;o.itemsChanged=new wijmo_1.Event;o.loadingItems=new wijmo_1.Event;o.loadedItems=new wijmo_1.Event;o.itemChecked=new wijmo_1.Event;o.checkedItemsChanged=new wijmo_1.Event;o.formatItem=new wijmo_1.Event((function(){o.invalidate()}));o._handleKeyUp=function(t){if("Shift"===t.key){o._isShiftDown=!1;o._shouldClearOnShift=!0}};o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.ListBoxClsNames.hostElement,null,null);var n=o.hostElement;wijmo_1.setAttribute(n,"role","listbox",!0);o._updateAriaLabel();"SELECT"==o._orgTag&&o._initFromSelect(o.hostElement);o.addEventListener(n,"click",o._click.bind(o));o.addEventListener(n,"keydown",o._keydown.bind(o));o.addEventListener(n,"keypress",o._keypress.bind(o));o.addEventListener(n,"keyup",o._handleKeyUp.bind(o));o.addEventListener(n,"wheel",(function(t){if(n.scrollHeight>n.offsetHeight&&(t.deltaY<0&&0==n.scrollTop||t.deltaY>0&&n.scrollTop+n.offsetHeight>=n.scrollHeight)){t.preventDefault();t.stopPropagation();t.stopImmediatePropagation()}}));[o._eSizer,o._ePadTop,o._ePadBot].forEach((function(t){t.tabIndex=-1;wijmo_1.setAttribute(t,"aria-hidden",!0);wijmo_1.setCss(t,{pointerEvents:"none",opacity:"0"})}));o.initialize(i);o._updateViewRange();o.addEventListener(o.hostElement,"scroll",(function(t){o._updateViewRange()}));return o}Object.defineProperty(ListBox.prototype,"ariaLabelledBy",{get:function(){return this.hostElement.getAttribute("aria-labelledby")},set:function(t){wijmo_1._setAriaLabelBy(this,this.hostElement,t,this._updateAriaLabel.bind(this))},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"itemsSource",{get:function(){return this._items},set:function(t){if(this._items!=t){if(this._cv){this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv=null}this._items=t;this._cv=wijmo_1.asCollectionView(t);if(null!=this._cv){this._cv.currentChanged.addHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.addHandler(this._cvCollectionChanged,this)}this._populateList();this.onItemsChanged();this.onSelectedIndexChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"collectionView",{get:function(){return this._cv},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"virtualizationThreshold",{get:function(){return this._vThreshold},set:function(t){if(t!=this._vThreshold){var e=this._getVirtual();this._vThreshold=wijmo_1.asNumber(t,!1,!0);e!=this._getVirtual()&&this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"showGroups",{get:function(){return this._shGroups},set:function(t){if(t!=this._shGroups){this._shGroups=wijmo_1.asBoolean(t);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"isContentHtml",{get:function(){return this._html},set:function(t){if(t!=this._html){this._html=wijmo_1.asBoolean(t);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"itemFormatter",{get:function(){return this._itemFormatter},set:function(t){if(t!=this._itemFormatter){this._itemFormatter=wijmo_1.asFunction(t);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"displayMemberPath",{get:function(){return this._pathDisplay.path},set:function(t){if(t!=this.displayMemberPath){this._pathDisplay.path=wijmo_1.asString(t);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"selectedValuePath",{get:function(){return this._pathValue.path},set:function(t){this._pathValue.path=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"checkedMemberPath",{get:function(){return this._pathChecked.path},set:function(t){if(t!=this.checkedMemberPath){this._pathChecked.path=wijmo_1.asString(t);wijmo_1.setAttribute(this.hostElement,"aria-multiselectable",""!==this.checkedMemberPath?"true":"false");this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"caseSensitiveSearch",{get:function(){return this._caseSensitive},set:function(t){this._caseSensitive=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"itemRole",{get:function(){return this._itemRole},set:function(t){if(t!=this.itemRole){this._itemRole=wijmo_1.asString(t);this._populateList()}},enumerable:!0,configurable:!0});ListBox.prototype.getDisplayValue=function(t,e){var i=null;if(t>-1&&wijmo_1.hasItems(this._cv)){i=this._cv.items[t];this.displayMemberPath&&(i=this._pathDisplay.getValue(i))}var o=null!=i?i.toString():"";this._itemFormatter&&!e&&(o=this._itemFormatter(t,o));return o};ListBox.prototype.getDisplayText=function(t){return this._getDisplayText(t)};ListBox.prototype._getDisplayText=function(t,e){if(e&&this._ignoreItemFormatterTextArray[t])return this._ignoreItemFormatterTextArray[t];var i=this._getChild(t);return null!=i?i.textContent:""};ListBox.prototype.isItemEnabled=function(t){var e=this._getChild(t);return null!=e&&!e.hasAttribute("disabled")&&!wijmo_1.hasClass(e,wijmo_1.ControlStateClsNames.disabled)&&!wijmo_1.hasClass(e,wijmo_1.UtilitesClsNames.separator)};Object.defineProperty(ListBox.prototype,"selectedIndex",{get:function(){return this._cv?this._cv.currentPosition:-1},set:function(t){if(this._cv){this._oldSelectedIndex=this._cv.currentPosition;this._cv.moveCurrentToPosition(wijmo_1.asNumber(t))}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"selectedItem",{get:function(){return this._cv?this._cv.currentItem:null},set:function(t){this._cv&&this._cv.moveCurrentTo(t)},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"selectedValue",{get:function(){var t=this.selectedItem;t&&this.selectedValuePath&&(t=this._pathValue.getValue(t));return t},set:function(t){var e=this._cv,i=e?e.items:null,o=this.selectedValuePath,n=-1;if(i){for(var s=0;s<i.length;s++){var r=i[s],a=o?this._pathValue.getValue(r):r;if(a===t||wijmo_1.DateTime.equals(a,t)){n=s;break}if(this.isContentHtml&&wijmo_1.isString(a)&&a.indexOf("<")>-1&&wijmo_1.toPlainText(a)===t){n=s;break}}this.selectedIndex=n}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"maxHeight",{get:function(){var t=this.hostElement,e=t?parseFloat(t.style.maxHeight):null;return isNaN(e)?null:e},set:function(t){var e=this.hostElement;if(e){t=wijmo_1.asNumber(t,!0);e.style.maxHeight=null==t?"":t+"px"}},enumerable:!0,configurable:!0});ListBox.prototype.showSelection=function(t){void 0===t&&(t=this.containsFocus());var e=this.hostElement,i=this._children,o=this._getSelectedElement(!1),n=new wijmo_1.Rect(0,0,0,0);if(o!=this._oldSel){this._updateItemAttributes(o,!0);this._updateItemAttributes(this._oldSel,!1);this._oldSel=o}o instanceof HTMLElement?n=this._getBoundingClientRect(o):this._children.length>0&&(n=this._getBoundingClientRect(this._getChild(0)));var s=this._getBoundingClientRect(e),r=0;if(this._shGroups){r=this._itemHeight;if(!this._isVirtual){var a=i[0];a&&a.offsetHeight&&wijmo_1.hasClass(a,exports.ListBoxClsNames.header)&&(r=a.offsetHeight)}}n.bottom>s.bottom?e.scrollTop+=n.bottom-s.bottom:n.top<s.top+r&&(e.scrollTop-=s.top+r-n.top);this._updateViewRange();o=this._getSelectedElement(!0);wijmo_1.setAttribute(e,"aria-activedescendant",o?o.id:null);if(t){(o&&!wijmo_1.contains(o,wijmo_1.getActiveElement())?o:e).focus()}e.tabIndex=o?-1:this._orgTabIndex};ListBox.prototype.loadList=function(){this._populateList()};ListBox.prototype.getItemChecked=function(t){var e=this._cv.items[t],i=this._pathChecked;return wijmo_1.isObject(e)&&i.path?i.getValue(e):this._getCheckboxState(t)};ListBox.prototype.setItemChecked=function(t,e){this._setItemChecked(t,e,!0)};ListBox.prototype.toggleItemChecked=function(t){this.setItemChecked(t,!this.getItemChecked(t))};Object.defineProperty(ListBox.prototype,"checkedItems",{get:function(){return this._checkedItems},set:function(t){t=Array.from(new Set(t));var e=wijmo_1.asArray(t,!1);if(!this._arrayEquals(e,this._checkedItems)){this._updateCheckedList(e);if(!this._arrayEquals(e,this._checkedItems)){this._checkedItems=e;this.onCheckedItemsChanged()}}},enumerable:!0,configurable:!0});ListBox.prototype.indexOf=function(t){return(t=wijmo_1.closest(t,"."+exports.ListBoxClsNames.listBoxItem))?t[ListBox._DIDX_KEY]:-1};ListBox.prototype.onSelectedIndexChanged=function(t){this.selectedIndexChanged.raise(this,t)};ListBox.prototype.onItemsChanged=function(t){this.itemsChanged.raise(this,t)};ListBox.prototype.onLoadingItems=function(t){this.loadingItems.raise(this,t)};ListBox.prototype.onLoadedItems=function(t){this.loadedItems.raise(this,t)};ListBox.prototype.onItemChecked=function(t){this.itemChecked.raise(this,t)};ListBox.prototype.onCheckedItemsChanged=function(t){this.checkedItemsChanged.raise(this,t)};ListBox.prototype.onFormatItem=function(t){this.formatItem.raise(this,t)};ListBox.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);if(this.hostElement){var i=this._cv?this._cv.items.length:0,o=this.formatItem.handlerCount;if(i!=this._itemCount||o!=this._fmtItemHandlers){this._fmtItemHandlers=o;this._populateList()}else this._updateViewRange()}};ListBox.prototype._updateAriaLabel=function(){this.hostElement&&(this.ariaLabelledBy?wijmo_1.setAriaLabel(this.hostElement,null):wijmo_1.setAriaLabel(this.hostElement,this._ariaLabel))};ListBox.prototype._updateCheckedList=function(t){var e=this,i=this._cv,o=this._pathChecked,n=new Map;if(o&&i){var s=i.sourceCollection;if(s&&s.length){wijmo_1.isObject(s[0])||(o=null);t.forEach((function(t){return n.set(t,!0)}));this._checking=!0;var r=[];s.forEach((function(t){var e=n.has(t);e&&r.push(t);o&&o.setValue(t,e)}));this._checking=!1;t=r}i.items.forEach((function(t,i){e._setItemChecked(i,n.has(t),!1)}))}};ListBox.prototype._getBoundingClientRect=function(t){if(!t.offsetHeight){var e=this.indexOf(t),i=this.hostElement;if(e>-1&&i){e=this._getElementIndex(e);var o=i.getBoundingClientRect();return new wijmo_1.Rect(0,o.top-i.scrollTop+e*this._itemHeight,o.width,this._itemHeight)}}return wijmo_1.Rect.fromBoundingRect(t.getBoundingClientRect())};ListBox.prototype._updateItemAttributes=function(t,e){if(t){var i=this.checkedMemberPath?"true"===t.getAttribute("aria-selected"):null;wijmo_1.toggleClass(t,wijmo_1.ControlStateClsNames.selected,e);this._isMenuItem()||wijmo_1.setAttribute(t,"aria-selected",this._getAriaSelected(e,i));t.tabIndex=e?this._orgTabIndex:-1}};ListBox.prototype._getCheckedItems=function(){var t=this,e=this._cv,i=this._pathChecked,o=[];e&&i&&i.path&&(o=e.sourceCollection.filter((function(o,n){if(e.filter&&!e.filter(o))return!!t._addMode&&i.getValue(o);if(wijmo_1.isObject(o))return i.getValue(o);var s=e.items[n]==o?n:e.items.indexOf(o);return t.getItemChecked(s)})));return o};ListBox.prototype._arrayEquals=function(t,e){if(t==e)return!0;if(!t||!e||t.length!=e.length)return!1;for(var i=0;i<t.length;i++)if(!this._isEqual(t[i],e[i]))return!1;return!0};ListBox.prototype._getChild=function(t){t=this._getElementIndex(t);return this._children[t]};ListBox.prototype._getElementIndex=function(t){if(this._shGroups)for(var e=this._children,i=0;i<=t&&i<e.length;i++){var o=e[i];wijmo_1.hasClass(o,exports.ListBoxClsNames.header)&&t++}return t};ListBox.prototype._setItemChecked=function(t,e,i){void 0===i&&(i=!0);var o=this._cv.items[t],n=this._pathChecked,s=!1,r=this.selectedIndex,a=this._checking;if(wijmo_1.isObject(o)&&n.path){if(!!n.getValue(o)!=e){var l=wijmo_1.tryCast(this._cv,"IEditableCollectionView");s=!0;this._checking=!0;if(l){l.editItem(o);n.setValue(o,e);l.commitEdit()}else{n.setValue(o,e);l.refresh()}this._checking=a}}else if(i){var h=this._findArrayItem(this._checkedItems,o);(e&&h<0||!e&&h>=0)&&(s=!0)}this._setCheckboxState(t,e);if(i){if(s){this._checkedItems=this._checkedItemsUpdate(o,e);this.onItemChecked();this.onCheckedItemsChanged()}r!=this.selectedIndex&&this.onSelectedIndexChanged()}return s};ListBox.prototype._checkedItemsUpdate=function(t,e){var i=this._cv.sourceCollection,o=this._checkedItems,n=0;if(e){for(var s=0;s<i.length;s++){var r=i[s];if(n<o.length&&this._isEqual(r,o[n]))n++;else if(this._isEqual(r,t))return o.slice(0,n).concat([t]).concat(o.slice(n))}return o}var a=this._findArrayItem(o,t);return o.slice(0,a).concat(o.slice(a+1))};ListBox.prototype._isEqual=function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)};ListBox.prototype._findArrayItem=function(t,e){if(!Number.isNaN(e))return t.indexOf(e);for(var i=0;i<t.length;i++)if(Number.isNaN(t[i]))return i;return-1};ListBox.prototype._cvCollectionChanged=function(){if(!this._checking){this._populateList();this.onItemsChanged()}};ListBox.prototype._cvCurrentChanged=function(){if(!this._checking){this.showSelection();this._ignoredItemChangedEvents||this.onSelectedIndexChanged()}};ListBox.prototype._populateList=function(){var t=this.hostElement,e=this._cv;this._itemCount=e?e.items.length:0;this._isVirtual=this._getVirtual();this._oldSel=null;this._itemsAbove=-1;this._itemsBelow=-1;if(t){var i=this.containsFocus(),o=void 0;this.onLoadingItems();var n=this._children=[];t.textContent="";if(e){var s=0,r=void 0,a=[];this._ignoreItemFormatterTextArray=[];if(this._shGroups&&e.groups&&e.groups.length){o={};for(var l=0;l<e.groups.length;l++){var h=e.groups[l];o[s]=h;r=this._createHeaderItem(h,l);a.push(r);for(var u=0;u<h.items.length;u++,s++){r=this._createItem(s,l);a.push(r)}}}else for(u=0;u<e.items.length;u++,s++){r=this._createItem(s);a.push(r)}var c=this._isVirtual?document.createElement("div"):t,p=0;c.innerHTML=a.join("");for(u=0;u<c.children.length;u++){var d=c.children[u];p==e.currentPosition&&(this._oldSel=d);d[ListBox._DIDX_KEY]=d.className.indexOf(exports.ListBoxClsNames.header)<0?p++:-1;n.push(d)}}if(this.formatItem.hasHandlers&&e){s=0;var m=e.items;for(d=new FormatItemEventArgs(0,null,null),u=0;u<n.length;u++){d._item=n[u];if(this._shGroups&&wijmo_1.hasClass(d._item,exports.ListBoxClsNames.header)){d._index=-1;d._data=o[s]}else{d._index=s;d._data=m[s++]}this.onFormatItem(d)}}if(this._isVirtual){var _=this._getCanvasContext(),f=null,b=0;for(u=0;u<n.length;u++){r=n[u];var g=_.measureText(r.textContent);if(g.width>b){f=r;b=g.width}}if(f){var w=!1,y=t.style.display,v=t.style.position;if(!t.parentElement){w=!0;(this._container||document.body).appendChild(t);wijmo_1.setCss(t,{display:"",position:"absolute"})}t.appendChild(f);var x=f.style.whiteSpace;f.style.whiteSpace="nowrap";this._ePadTop.style.width=f.offsetWidth+"px";this._itemHeight=f.offsetHeight||this._itemHeight;f.style.whiteSpace=x;this._eSizer.style.height=n.length*this._itemHeight+"px";t.appendChild(this._eSizer);this._clientHeight=t.clientHeight;wijmo_1.removeChild(this._eSizer);if(w){wijmo_1.removeChild(t);wijmo_1.setCss(t,{display:y,position:v})}wijmo_1.removeChild(f)}else this._ePadTop.style.width="";this._updateViewRange()}this.checkedItems=this._getCheckedItems();var C=this._getSelectedElement(!0);if(i){(C||t).focus()}else C&&this.showSelection();t.tabIndex=C?-1:this._orgTabIndex;this.onLoadedItems()}};ListBox.prototype._getCanvasContext=function(){var t=document.createElement("canvas").getContext("2d"),e=getComputedStyle(this.hostElement);e.fontSize&&e.fontFamily&&(t.font=e.fontSize+" "+e.fontFamily.split(",")[0]);return t};ListBox.prototype._getVirtual=function(){if(this._itemCount<=this._vThreshold)return!1;var t=this.hostElement;if(t){var e=getComputedStyle(t);if(parseInt(e.columnCount)>1||e.display.indexOf("flex")>-1||e.display.indexOf("grid")>-1)return!1}return!0};ListBox.prototype._getMaxSupportedCssHeight=function(){var t=265e5;wijmo_1.isIE()?t=15e5:wijmo_1.isFirefox()&&(t=175e5);return t};ListBox.prototype._updateViewRange=function(){var t=this.hostElement,e=this._itemHeight,i=this._children;if(!(t&&t.parentElement&&this._isVirtual&&i))return!1;var o=t.scrollTop;wijmo_1.assert(e*i.length<this._getMaxSupportedCssHeight(),"The number of items ("+i.length+") exceeds the maximum number of items ("+Math.floor(this._getMaxSupportedCssHeight()/e)+") allowed for this browser.");var n=Math.max(t.clientHeight,this._clientHeight),s=Math.floor(o/e),r=Math.min(i.length,Math.ceil((o+n)/e)-s),a=Math.max(0,i.length-s-r);if(s==this._itemsAbove&&a==this._itemsBelow)return!1;this._itemsAbove=s;this._itemsBelow=a;var l=document.createDocumentFragment(),h=this.containsFocus();this._ePadTop.style.height=s*e+"px";l.appendChild(this._ePadTop);if(this.showGroups&&!wijmo_1.hasClass(i[s],exports.ListBoxClsNames.header))for(var u=s;u>=0;u--)if(wijmo_1.hasClass(i[u],exports.ListBoxClsNames.header)){l.appendChild(i[u]);break}for(u=s;u<=s+r&&u<i.length;u++)l.appendChild(i[u]);this._ePadBot.style.height=a*e+"px";l.appendChild(this._ePadBot);t.textContent="";t.appendChild(l);var c=(s+r+a)*e-t.scrollHeight;this._ePadBot.style.height=this._ePadBot.offsetHeight-c+"px";var p=this._getSelectedElement(!0);if(h){(p||t).focus({preventScroll:!0})}t.tabIndex=p?-1:this._orgTabIndex;return!0};ListBox.prototype._getSelectedElement=function(t){var e=this.selectedIndex,i=this._getElementIndex(e),o=i>-1?this._children[i]:null;t&&o&&!o.offsetHeight&&(o=null);return o};ListBox.prototype._handleResize=function(){this._updateViewRange()};ListBox.prototype._createItem=function(t,e){var i=this._cv.items[t],o=t==this._cv.currentPosition,n=this.getDisplayValue(t),s=this.getDisplayValue(t,void 0!==this.itemFormatter);if(1!=this._html){n=wijmo_1.escapeHtml(n);s=wijmo_1.escapeHtml(s)}this._itemFormatterHelper.innerHTML=s;s=this._itemFormatterHelper.textContent;this._ignoreItemFormatterTextArray.push(s);var r=null;if(this.checkedMemberPath){r=!1;wijmo_1.isObject(i)?r=!!this._pathChecked.getValue(i):this._checkedItems&&(r=this._checkedItems.indexOf(i)>-1);n='\n <label class="wj-checklist-item">\n <span class="wj-checklist-base" role="checkbox" aria-hidden="true">\n <span class="wj-checklist-mark" style="display: '+(r?"block":"none")+'"></span>\n </span>\n <span class="wj-checklist-caption">'+n+"</span>\n </label>"}var a=exports.ListBoxClsNames.listBoxItem;o&&(a+=" "+wijmo_1.ControlStateClsNames.selected);r&&(a+=" "+wijmo_1.ControlStateClsNames.checked);if(this._html){var l=[wijmo_1.UtilitesClsNames.separator,wijmo_1.ControlStateClsNames.disabled];if(n.indexOf(l[0])>-1||n.indexOf(l[1])>-1){var h=wijmo_1.createElement(n);l.forEach((function(t){wijmo_1.hasClass(h,t)&&(a+=" "+t)}))}}var u="aria-describedby = listGroup-"+e;return'<div id="'+("listitem-"+t)+'" class="'+a+'" \n role="'+this.itemRole+'" \n '+(void 0!==e?u:"")+"\n "+(this._getAriaSelected(o,r)&&!this._isMenuItem()?'aria-selected="true"':"")+' \n tabindex="'+(o&&!this.isDisabled?this._orgTabIndex:-1)+'">'+n+"</div>"};ListBox.prototype._getAriaSelected=function(t,e){return!!(null!=e?e:t)||null};ListBox.prototype._createHeaderItem=function(t,e){var i=wijmo_1.escapeHtml(t.name);return'<div id="listGroup-'+e+'" class="'+exports.ListBoxClsNames.listBoxItem+" "+exports.ListBoxClsNames.header+" "+wijmo_1.ControlStateClsNames.disabled+'" role="group" tabindex="-1">'+i+"</div>"};ListBox.prototype._click=function(t){if(0==t.button&&!t.defaultPrevented){var e=this.indexOf(t.target);if(e>-1){this.selectedIndex=e;if(this.checkedMemberPath){var i=this._children[this._getElementIndex(e)];if(i){i.focus({preventScroll:!0});this.setItemChecked(e,"true"!==i.getAttribute("aria-selected"))}}else{wijmo_1.closest(t.target,"."+exports.ListBoxClsNames.listBoxItem).focus({preventScroll:!0})}}}};ListBox.prototype._keydown=function(t){var e=this.selectedIndex;if(!t.defaultPrevented){if(65==t.keyCode&&(t.ctrlKey||t.metaKey)){var i=this.collectionView;if(this.checkedMemberPath&&wijmo_1.hasItems(i)){for(var o=this._children,n=[],s=!0,r=0;r<o.length;r++)if(!wijmo_1.hasClass(o[r],wijmo_1._CLS_STATE_DISABLED)){var a=i.items[r];n.push(a);s&&!this.checkedItems.includes(a)&&(s=!1)}n.length!==i.items.length?this.checkedItems=s?this.checkedItems.filter((function(t){return!n.includes(t)})):this.checkedItems.concat(n):this.checkedItems=this.checkedItems.length!=i.items.length?i.items:[];t.preventDefault();return}}if(!t.altKey&&!t.metaKey){t.shiftKey&&(this._isShiftDown=!0);switch(t.keyCode){case wijmo_1.Key.Down:t.preventDefault();this._selectNext(t.shiftKey);break;case wijmo_1.Key.Up:t.preventDefault();this._selectPrev(t.shiftKey);break;case wijmo_1.Key.Home:t.preventDefault();t.ctrlKey&&t.shiftKey?this._selectRange(0):this._selectFirst();break;case wijmo_1.Key.End:t.preventDefault();t.ctrlKey&&t.shiftKey?this._selectRange(this._children.length-1):this._selectLast();break;case wijmo_1.Key.PageDown:t.preventDefault();this._selectNextPage();break;case wijmo_1.Key.PageUp:t.preventDefault();this._selectPrevPage();break;case wijmo_1.Key.Space:if(this.checkedMemberPath&&e>-1){var l=this._children[this._getElementIndex(e)];if(l&&this.isItemEnabled(e)&&!l.hasAttribute("disabled")){var h="true"===l.getAttribute("aria-selected");this.setItemChecked(e,!h);t.preventDefault()}}}}}};ListBox.prototype._getCheckboxState=function(t){var e=this._children[this._getElementIndex(t)];if(e)return"true"===e.getAttribute("aria-selected")};ListBox.prototype._setCheckboxState=function(t,e){var i=this._getElementIndex(t),o=this._children[i];if(o){var n=o.querySelector(".wj-checklist-mark");if(n){o.setAttribute("aria-selected",e.toString());wijmo_1.toggleClass(o,wijmo_1.ControlStateClsNames.checked,e);n.style.display=e?"block":"none"}else{var s=this._getCheckbox(i);if(s){s.checked=e;var r=wijmo_1.closest(s,"."+exports.ListBoxClsNames.listBoxItem);if(r){wijmo_1.toggleClass(r,wijmo_1.ControlStateClsNames.checked,e);wijmo_1.setAttribute(r,"aria-selected",!!e||null)}}}}};ListBox.prototype._getCheckbox=function(t){var e=this._children;return this.hostElement&&t>-1&&t<e.length?e[t].querySelector("input[type=checkbox]"):null};ListBox.prototype._keypress=function(t){var e=this;if(!t.defaultPrevented&&!(t.target instanceof HTMLInputElement)&&(t.charCode>32||32==t.charCode&&this._search)){t.preventDefault();this._search+=String.fromCharCode(t.charCode);this._toSearch&&clearTimeout(this._toSearch);this._toSearch=setTimeout((function(){e._toSearch=null;e._search=""}),wijmo_1.Control._SEARCH_DELAY);var i=this._findNext();if(i<0&&this._search.length>1){this._search=this._search[this._search.length-1];i=this._findNext()}i>-1&&(this.selectedIndex=i)}};ListBox.prototype._selectNext=function(t){void 0===t&&(t=!1);var e=this.selectedIndex,i=this._findNextEnabled(e+1);if(i>-1){t&&this._selectRange(i);this.selectedIndex=i}return i>-1};ListBox.prototype._selectPrev=function(t){void 0===t&&(t=!1);var e=this.selectedIndex,i=this._findPrevEnabled(e-1);if(i>-1){t&&this._selectRange(i);this.selectedIndex=i}return i>-1};ListBox.prototype._findNextEnabled=function(t){for(var e=t;e<this._children.length;e++)if(this.isItemEnabled(e))return e;return-1};ListBox.prototype._findPrevEnabled=function(t){for(var e=t;e>=0;e--)if(this.isItemEnabled(e))return e;return-1};ListBox.prototype._selectFirst=function(){for(var t=0;t<this._children.length;t++)if(this.isItemEnabled(t)){this.selectedIndex=t;return!0}return!1};ListBox.prototype._selectLast=function(){for(var t=this._children.length-1;t>=0;t--)if(this.isItemEnabled(t)){this.selectedIndex=t;return!0}return!1};ListBox.prototype._selectNextPage=function(){var t=this.hostElement.offsetHeight,e=this._children,i=this._cv?this._cv.items.length:0,o=0;if(t>0)for(var n=this.selectedIndex+1;n<i;n++){var s=e[n].scrollHeight||this._itemHeight;if(o+s>t&&this.isItemEnabled(n)){this.selectedIndex=n;return!0}o+=s}return this._selectLast()};ListBox.prototype._selectPrevPage=function(){var t=this.hostElement.offsetHeight,e=this._children,i=0;if(t>0)for(var o=this.selectedIndex-1;o>0;o--){var n=e[o].scrollHeight||this._itemHeight;if(i+n>t&&this.isItemEnabled(o)){this.selectedIndex=o;return!0}i+=n}return this._selectFirst()};ListBox.prototype._findNext=function(){if(this.hostElement){var t=this._children.length,e=this.selectedIndex;(e<0||1==this._search.length)&&e++;var i=this._search,o=this.caseSensitiveSearch;o||(i=i.toLowerCase());for(var n=0;n<t;n++){var s=(e+n)%t;if(this.isItemEnabled(s)){var r=this.getDisplayText(s).trim();o||(r=r.toLowerCase());if(0==r.indexOf(i))return s}}}return-1};ListBox.prototype._initFromSelect=function(t){for(var e=t.children,i=[],o=-1,n=0;n<e.length;n++){var s=e[n];if("OPTION"==s.tagName){s.hasAttribute("selected")&&(o=i.length);s.innerHTML?i.push({hdr:s.innerHTML,val:s.getAttribute("value"),cmdParam:s.getAttribute("cmd-param")}):i.push({hdr:'<div class="'+wijmo_1.UtilitesClsNames.separator+'"></div>'});t.removeChild(s);n--}}if(i){this.displayMemberPath="hdr";this.selectedValuePath="val";this.itemsSource=i;this.selectedIndex=o}};ListBox.prototype._setIsDisabled=function(e){t.prototype._setIsDisabled.call(this,e);this._updateTabIndex()};ListBox.prototype._setTabOrder=function(e){t.prototype._setTabOrder.call(this,e);this.isDisabled||this._updateTabIndex()};ListBox.prototype._isMenuItem=function(){return"menuitem"===this.itemRole||"menuitemcheckbox"===this.itemRole||"menuitemradio"===this.itemRole};ListBox.prototype._updateTabIndex=function(){var t=this.hostElement,e=this._getSelectedElement(!0);if(e){e.tabIndex=this.isDisabled?-1:this._orgTabIndex;t.tabIndex=-1}else t.tabIndex=this.isDisabled?-1:this._orgTabIndex};ListBox.prototype._selectRange=function(t){if(-1!==this.selectedIndex){if(this._shouldClearOnShift&&this._isShiftDown){this.checkedItems=[];this._shouldClearOnShift=!1}var e=Math.min(this.selectedIndex,t),i=Math.max(this.selectedIndex,t),o=this.collectionView.items.slice(e,i+1);this.checkedItems=Array.from(new Set(this.checkedItems.concat(o)))}};ListBox.prototype.dispose=function(){if(this._cv){this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this);this._cv=null}this._items=null;if(this._toSearch){clearTimeout(this._toSearch);this._toSearch=null}this._children=null;this._eSizer=null;this._ePadTop=null;this._ePadBot=null;this._itemFormatterHelper=null;this._ignoreItemFormatterTextArray=null;this._checkedItems=null;t.prototype.dispose.call(this)};ListBox._DIDX_KEY="$WJ-DIDX";ListBox._VTHRESH=Number.MAX_VALUE/2;return ListBox}(wijmo_1.Control);exports.ListBox=ListBox;var FormatItemEventArgs=function(t){__extends(FormatItemEventArgs,t);function FormatItemEventArgs(e,i,o){var n=t.call(this)||this;n._index=wijmo_1.asNumber(e);n._data=i;n._item=wijmo_1.asType(o,HTMLElement,!0);return n}Object.defineProperty(FormatItemEventArgs.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0});Object.defineProperty(FormatItemEventArgs.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0});Object.defineProperty(FormatItemEventArgs.prototype,"item",{get:function(){return this._item},enumerable:!0,configurable:!0});return FormatItemEventArgs}(wijmo_1.EventArgs);exports.FormatItemEventArgs=FormatItemEventArgs;wijmo_1._addCultureInfo("MultiSelectListBox",{filterPlaceholder:"Filter",selectAll:"Select All",ariaLabels:{multiSelectListBox:"Multi select list box"}});var DateSelectionMode,ShowMonthPicker,CalendarTabKeyAction,MultiSelectListBox=function(t){__extends(MultiSelectListBox,t);function MultiSelectListBox(e,i){var o=t.call(this,e)||this;o._ariaLabel=wijmo_1.culture.MultiSelectListBox.ariaLabels.multiSelectListBox;o._selectAllLabel=null;o._filterPlaceholder=null;o._filterText="";o._checkOnFilter=!0;o._delay=wijmo_1.Control._SEARCH_DELAY;o.checkedItemsChanged=new wijmo_1.Event;o.selectedIndexChanged=new wijmo_1.Event;var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.MultiSelectListBoxClsNames.hostElement,n,{_selectAll:"select-all",_filter:"filter",_lbHost:"list-box"});o._selectAll.style.display="none";o._filter.style.display="none";o._lbx=new ListBox(o._lbHost,{checkedMemberPath:MultiSelectListBox._DEF_CHECKED_PATH,loadedItems:function(){return o._updateCheckAllCheckbox()},checkedItemsChanged:function(t){return o.onCheckedItemsChanged(t)},selectedIndexChanged:function(){return o.onSelectedIndexChanged()}});o._cbSelectAll=o._selectAll.querySelector("input[type=checkbox]");o._spSelectAll=o._selectAll.querySelector("label>span");var s=wijmo_1.culture.MultiSelectListBox;wijmo_1.setText(o._spSelectAll,s.selectAll);o._filter.placeholder=s.filterPlaceholder;o.initialize(i);o.addEventListener(o._filter,"input",(function(){if(o._filter.value!=o._filterText){o._filterText=o._filter.value;o._toSearch&&clearTimeout(o._toSearch);o._toSearch=setTimeout((function(){o._toSearch=null;o._applyFilter()}),o.delay)}}));o.addEventListener(o._cbSelectAll,"click",(function(t){var e=o._lbx.collectionView;wijmo_1.hasItems(e)&&(o.checkedItems=t.target.checked?e.items:[])}));o.addEventListener(o.hostElement,"keydown",(function(t){var e=o.showFilterInput?o._filter:null,i=o._lbx;if(e&&t.keyCode==wijmo_1.Key.F3){wijmo_1.setSelectionRange(e,0,e.value.length);t.preventDefault()}if(wijmo_1.getActiveElement()==e){var n=!t.altKey;switch(t.keyCode){case wijmo_1.Key.Escape:case wijmo_1.Key.F4:n=!1}n&&t.stopPropagation()}if(!i.containsFocus())switch(t.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:o._lbx.focus();if(!t.altKey){var s=i.selectedIndex+(t.keyCode==wijmo_1.Key.Up?-1:1);i.selectedIndex=Math.max(0,s)}t.preventDefault()}}),!0);o.hostElement.tabIndex=-1;o._lbx.tabOrder=o._orgTabIndex;o._updateAriaLabel();return o}Object.defineProperty(MultiSelectListBox,"controlTemplate",{get:function(){MultiSelectListBox._ctrlTemplate||(MultiSelectListBox._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+" "+exports.ListBoxClsNames.hostElement+'"><input wj-part="filter" class="'+wijmo_1.InputFormElementsClsNames.formControl+'" tabindex="-1"><div wj-part="select-all" class="'+exports.MultiSelectListBoxClsNames.header+" "+exports.MultiSelectListBoxClsNames.selectAll+" "+exports.ListBoxClsNames.listBoxItem+'"><label><input type="checkbox" tabindex="-1"> <span></span></label></div><div wj-part="list-box"/></div>');return MultiSelectListBox._ctrlTemplate},set:function(t){MultiSelectListBox._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"itemsSource",{get:function(){return this._lbx.itemsSource},set:function(t){this._lbx.itemsSource=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"collectionView",{get:function(){return this._lbx.collectionView},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"virtualizationThreshold",{get:function(){return this._lbx.virtualizationThreshold},set:function(t){this._lbx.virtualizationThreshold=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"displayMemberPath",{get:function(){return this._lbx.displayMemberPath},set:function(t){this._lbx.displayMemberPath=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"isContentHtml",{get:function(){return this._lbx.isContentHtml},set:function(t){this._lbx.isContentHtml=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"caseSensitiveSearch",{get:function(){return this._lbx.caseSensitiveSearch},set:function(t){this._lbx.caseSensitiveSearch=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"delay",{get:function(){return this._delay},set:function(t){this._delay=wijmo_1.asNumber(t,!1,!0)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"showGroups",{get:function(){return this._lbx.showGroups},set:function(t){this._lbx.showGroups=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"checkOnFilter",{get:function(){return this._checkOnFilter},set:function(t){if(t!=this.checkOnFilter){this._checkOnFilter=wijmo_1.asBoolean(t);this.checkedItems=[]}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"selectedIndex",{get:function(){return this._lbx.selectedIndex},set:function(t){this._lbx.selectedIndex=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"listBox",{get:function(){return this._lbx},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"showFilterInput",{get:function(){return""==this._filter.style.display},set:function(t){if(t!=this.showFilterInput){this._filter.style.display=wijmo_1.asBoolean(t)?"":"none";if(!this.showFilterInput){this._filter.value="";this._applyFilter()}}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"filterInputPlaceholder",{get:function(){return this._filterPlaceholder},set:function(t){if(t!=this._filterPlaceholder){this._filterPlaceholder=wijmo_1.asString(t);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"showSelectAllCheckbox",{get:function(){return""==this._selectAll.style.display},set:function(t){this._selectAll.style.display=wijmo_1.asBoolean(t)?"":"none"},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"selectAllLabel",{get:function(){return this._selectAllLabel},set:function(t){if(t!=this._selectAllLabel){this._selectAllLabel=wijmo_1.asString(t);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"checkedMemberPath",{get:function(){var t=this.listBox.checkedMemberPath;return t!=MultiSelectListBox._DEF_CHECKED_PATH?t:null},set:function(t){t=wijmo_1.asString(t);this.listBox.checkedMemberPath=t||MultiSelectListBox._DEF_CHECKED_PATH},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"checkedItems",{get:function(){return this.listBox.checkedItems},set:function(t){this.listBox.checkedItems=wijmo_1.asArray(t)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"ariaLabelledBy",{get:function(){return this.hostElement.getAttribute("aria-labelledby")},set:function(t){wijmo_1._setAriaLabelBy(this,this.hostElement,t,this._updateAriaLabel.bind(this))},enumerable:!0,configurable:!0});MultiSelectListBox.prototype._updateAriaLabel=function(){var t=wijmo_1.culture.MultiSelectListBox;wijmo_1.setAriaLabel(this._selectAll,t.selectAll);wijmo_1.setAriaLabel(this._filter,t.filterPlaceholder);this.hostElement&&(this.ariaLabelledBy?wijmo_1.setAriaLabel(this.hostElement,null):wijmo_1.setAriaLabel(this.hostElement,this._ariaLabel))};MultiSelectListBox.prototype.onCheckedItemsChanged=function(t){var e=this;this._updateCheckAllCheckbox();this.checkedItemsChanged.raise(this,t);t._items&&"object"==typeof t._items[0]&&(this.checkedMemberPath||MultiSelectListBox._DEF_CHECKED_PATH)in t._items[0]&&setTimeout((function(){e._lbx._updateCheckedList(e.checkedItems)}),0)};MultiSelectListBox.prototype.onSelectedIndexChanged=function(t){this.selectedIndexChanged.raise(this,t)};MultiSelectListBox.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);if(this.hostElement){var i=wijmo_1.culture.MultiSelectListBox;this._filter.placeholder=null!=this._filterPlaceholder?this._filterPlaceholder:i.filterPlaceholder;this._spSelectAll&&wijmo_1.setText(this._spSelectAll,null!=this._selectAllLabel?this._selectAllLabel:i.selectAll);this._updateCheckAllCheckbox()}};MultiSelectListBox.prototype.dispose=function(){this.listBox.dispose();t.prototype.dispose.call(this)};MultiSelectListBox.prototype._applyFilter=function(){var t=this,e=this._lbx,i=e.collectionView,o=this._filter.value,n=o?new RegExp(wijmo_1.escapeRegExp(o),e.caseSensitiveSearch?"":"i"):null,s=this.displayMemberPath,r=s?new wijmo_1.Binding(s):null,a=this.checkOnFilter?null:this.checkedItems;i.filter=function(e){if(null!=n){if(a&&a.indexOf(e)>-1)return!0;r&&(e=r.getValue(e));t.isContentHtml&&(e=wijmo_1.toPlainText(e));return null!=e&&n.test(e.toString())}return!0};e.selectedIndex=Math.max(0,e.selectedIndex);this._checkOnFilter&&(this.checkedItems=n?i.items:[])};MultiSelectListBox.prototype._updateCheckAllCheckbox=function(){var t=this._lbx.collectionView,e=this._cbSelectAll;if(wijmo_1.hasItems(t)){var i=t.items.length,o=this.checkedItems.length;wijmo_1.setChecked(e,o==i||0!=o&&null);e.disabled=!1}else{wijmo_1.setChecked(e,!1);e.checked=!1;e.disabled=!0}};MultiSelectListBox.prototype._setIsDisabled=function(e){t.prototype._setIsDisabled.call(this,e);this.hostElement.tabIndex=-1;this.isDisabled?this._lbx.tabOrder=-1:this._lbx.tabOrder=this._orgTabIndex};MultiSelectListBox.prototype._setTabOrder=function(t){this._orgTabIndex=t;this._lbx.tabOrder=t};MultiSelectListBox.prototype.tryForceClearDelayAndFilter=function(){var t=this;if(this._toSearch){var e=this._delay;this._filterText=this._filter.value;this._toSearch&&clearTimeout(this._toSearch);this._toSearch=setTimeout((function(){t._toSearch=null;t._applyFilter()}),0);this._delay=e}};MultiSelectListBox.prototype.onLostFocus=function(){this.tryForceClearDelayAndFilter();t.prototype.onLostFocus.call(this)};MultiSelectListBox._DEF_CHECKED_PATH="$checked";MultiSelectListBox._ctrlTemplate="";return MultiSelectListBox}(wijmo_1.Control);exports.MultiSelectListBox=MultiSelectListBox;wijmo_1._addCultureInfo("Calendar",{ariaLabels:{calendar:"Calendar",chooseDate:"Choose Date",chooseMonth:"Choose Month",monthView:"Month View",yearView:"Year View",selectYear:"Select Year",prvMo:"Previous Month",today:"Select Today",nxtMo:"Next Month",prvYr:"Previous Year",currMo:"Current Month",nxtYr:"Next Year"},buttons:{ok:"OK",cancel:"Cancel"}});!function(t){t[t.None=0]="None";t[t.Day=1]="Day";t[t.Month=2]="Month";t[t.Range=3]="Range"}(DateSelectionMode=exports.DateSelectionMode||(exports.DateSelectionMode={}));!function(t){t[t.None=0]="None";t[t.FirstMonth=1]="FirstMonth";t[t.LastMonth=2]="LastMonth";t[t.FirstAndLastMonths=3]="FirstAndLastMonths";t[t.AllMonths=4]="AllMonths";t[t.Outside=5]="Outside"}(ShowMonthPicker=exports.ShowMonthPicker||(exports.ShowMonthPicker={}));!function(t){t[t.None=0]="None";t[t.All=1]="All"}(CalendarTabKeyAction=exports.CalendarTabKeyAction||(exports.CalendarTabKeyAction={}));var ClickAction,KeyAction,TabKeyAction,Calendar=function(t){__extends(Calendar,t);function Calendar(e,i){var o=t.call(this,e)||this;o._yrPicker=!0;o._mtPicker=ShowMonthPicker.FirstMonth;o._wksBefore=0;o._wksAfter=0;o._rngMin=0;o._rngMax=0;o._min=null;o._max=null;o._readOnly=!1;o._handleWheel=!0;o._fdw=null;o._selMode=DateSelectionMode.Day;o._ariaLabel=wijmo_1.culture.Calendar.ariaLabels.calendar;o._tmYrHidden=0;o._fmtYrMo="y";o._fmtYr="yyyy";o._fmtDayHdr="ddd";o._fmtDay="d ";o._fmtMonths="MMM";o._fmtDayTitle="dddd";o.valueChanged=new wijmo_1.Event;o.rangeEndChanged=new wijmo_1.Event;o.rangeChanged=new wijmo_1.Event;o.displayMonthChanged=new wijmo_1.Event;o.formatItem=new wijmo_1.Event((function(){o.invalidate()}));o._updateCellFocus=function(t,e){wijmo_1.toggleClass(t,exports.CalendarClsNames.focused,e);wijmo_1.setAttribute(t,"tabIndex",e?"0":"-1");e&&o.containsFocus()&&t.focus()};o.cancelButtonClicked=new wijmo_1.Event;o.OKButtonClicked=new wijmo_1.Event;o._enterKeyDownToSetValue=new wijmo_1.Event;o._value=o._rngEnd=wijmo_1.DateTime.newDate();o._month=o._getMonth(o._value);o._cals=[o];o._createChildren();o._createYearPicker();var n=o.hostElement,s=o.addEventListener.bind(o);s(n,"keydown",o._keydown.bind(o));s(n,"click",o._click.bind(o));s(o._btnCancel,"click",o.oneCancelButtonClick.bind(o));s(o._btnOK,"click",o.onOkButtonClick.bind(o));o._focusValue=wijmo_1.DateTime.newDate();wijmo_1.setAttribute(n,"role","application");wijmo_1.setAttribute(o.hostElement,"aria-label",o._ariaLabel);var r=wijmo_1.culture.Calendar.buttons;wijmo_1.setText(o._btnOK,r.ok);wijmo_1.setText(o._btnCancel,r.cancel);o._keyActionTab=CalendarTabKeyAction.None;o._rptUp=new wijmo_1._ClickRepeater(o._btnPrv);o._rptDn=new wijmo_1._ClickRepeater(o._btnNxt);o.addEventListener(n,"wheel",(function(t){if(o.handleWheel&&!t.defaultPrevented&&!o.isReadOnly&&o.containsFocus()){t.deltaY<0?o._btnPrv.click():o._btnNxt.click();t.preventDefault()}}));o.initialize(i);o.refresh(!0);return o}Object.defineProperty(Calendar,"controlTemplate",{get:function(){Calendar._ctrlTemplate||(Calendar._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.content+" "+exports.CalendarClsNames.calendarOuter+'"><div wj-part="tbl-header" class='+exports.CalendarClsNames.calendarHeader+'><div wj-part="btn-month" class='+exports.CalendarClsNames.monthSelect+' role="button" aria-live="polite"><span wj-part="span-month"></span> <span class='+wijmo_1.GlyphClsNames.down+'></span></div><div class="'+wijmo_1.InputFormElementsClsNames.btnGroup+'"><button wj-part="btn-prev" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.left+'></span></button><button wj-part="btn-today" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.circle+'></span></button><button wj-part="btn-next" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.right+'></span></button></div></div><table wj-part="tbl-month" class='+exports.CalendarClsNames.calendarMonth+' role="grid"></table><table wj-part="tbl-year" class='+exports.CalendarClsNames.calendarYear+' role="grid"></table><div wj-part="confirmation-button-container" class="'+exports.CalendarClsNames.confirmationButtonContainer+'"><button wj-part="btn-ok" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+exports.CalendarClsNames.button+'"></button><button wj-part="btn-cancel" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+exports.CalendarClsNames.button+'"></button></div>');return Calendar._ctrlTemplate},set:function(t){Calendar._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"value",{get:function(){return this._value},set:function(t){if(!wijmo_1.DateTime.sameDate(t,this._value)||!wijmo_1.DateTime.sameTime(t,this._value)){this._clearingRangeEnd=!wijmo_1.DateTime.equals(this._value,t);this.rangeEnd=null;this._clearingRangeEnd=!1;t=wijmo_1.asDate(t,!0);t=this._clamp(t);if(this._valid(t)||null==t){this.ensureVisible(t||new Date);if(!wijmo_1.DateTime.equals(this._value,t)){this._value=t;this.focusMode&&(this._focusValue=t);this.invalidate(!1);this.onValueChanged()}}if(!this.value){var e=this.min,i=this.max,o=this.displayMonth;i&&i<o?this.ensureVisible(i):e&&e>o&&this.ensureVisible(e)}}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"focusValue",{get:function(){return this._focusValue},set:function(t){t=wijmo_1.asDate(t,!0);t=this._clamp(t);if(this._valid(t)||null==t){this.ensureVisible(t||new Date);this._focusValue=t;this.invalidate(!1)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"rangeEnd",{get:function(){return this._rngEnd},set:function(t){t=wijmo_1.asDate(t,!0);if((t=this._clamp(t))&&this._value&&this._rngMode()){t<this._value&&(t=this._value);var e=this._rngMin,i=this._rngMax;if(e&&e>0||i&&i>0){var o=this._value,n=Math.ceil((t.getTime()-o.getTime())/864e5)+1;e&&e>0&&n<e&&(t=wijmo_1.DateTime.addDays(o,e-1));i&&i>0&&n>i&&(t=wijmo_1.DateTime.addDays(o,i-1))}}if((this._valid(t)||null==t)&&!wijmo_1.DateTime.equals(this._rngEnd,t)){this._rngEnd=t;this.ensureVisible(t);this.invalidate(!1);this._clearingRangeEnd||this.onRangeEndChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"rangeMin",{get:function(){return this._rngMin},set:function(t){if((t=wijmo_1.asNumber(t,!0,!0))!=this._rngMin){this._rngMin=t;this._syncProp(this,"rangeMin");this._rngMode()&&this._rngEnd&&(this.rangeEnd=this._rngEnd)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"rangeMax",{get:function(){return this._rngMax},set:function(t){if((t=wijmo_1.asNumber(t,!0,!0))!=this._rngMax){this._rngMax=t;this._syncProp(this,"rangeMax");this._rngMode()&&this._rngEnd&&(this.rangeEnd=this._rngEnd)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"min",{get:function(){return this._min},set:function(t){if((t=wijmo_1.asDate(t,!0))!=this.min){this._min=t;this._syncProp(this,"min");this.refresh();!this.value&&t&&t>this.displayMonth&&this.ensureVisible(t)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"max",{get:function(){return this._max},set:function(t){if((t=wijmo_1.asDate(t,!0))!=this.max){this._max=t;this._syncProp(this,"max");this.refresh();!this.value&&t&&t<this.displayMonth&&this.ensureVisible(t)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"selectionMode",{get:function(){return this._selMode},set:function(t){var e=DateSelectionMode;if((t=wijmo_1.asEnum(t,e))!=this._selMode){this._selMode=t;this._mthMode()&&(this.monthView=!1);this._rngEnd=t==e.Range?this._value:null;this.refresh();this._syncProp(this,"selectionMode")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"isReadOnly",{get:function(){return this._readOnly},set:function(t){this._readOnly=wijmo_1.asBoolean(t);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly);this._syncProp(this,"isReadOnly")},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(t){if(this._handleWheel!=t){this._handleWheel=wijmo_1.asBoolean(t);this._syncProp(this,"handleWheel")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"repeatButtons",{get:function(){return!this._rptUp.disabled},set:function(t){this._rptUp.disabled=this._rptDn.disabled=!wijmo_1.asBoolean(t);this._syncProp(this,"repeatButtons")},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"showYearPicker",{get:function(){return this._yrPicker},set:function(t){if(t!=this._yrPicker){this._yrPicker=wijmo_1.asBoolean(t);this._syncProp(this,"showYearPicker")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"showMonthPicker",{get:function(){return this._mtPicker},set:function(t){if(t!=this._mtPicker){var e=ShowMonthPicker;wijmo_1.isBoolean(t)&&(t=t?e.FirstMonth:e.None);this._mtPicker=wijmo_1.asEnum(t,e);wijmo_1.toggleClass(this.hostElement,wijmo_1.InputFormElementsClsNames.btnsOutside,this._getShowMonthPicker()==e.Outside);this.refresh();this._syncProp(this,"showMonthPicker")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"firstDayOfWeek",{get:function(){return this._fdw},set:function(t){if(t!=this._fdw){if((t=wijmo_1.asNumber(t,!0))&&(t>6||t<0))throw"firstDayOfWeek must be between 0 and 6 (Sunday to Saturday).";this._fdw=t;this.refresh();this._syncProp(this,"firstDayOfWeek")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"displayMonth",{get:function(){return this._month},set:function(t){t=wijmo_1.asDate(t);t=this._getMonth(t);var e=this._getDisplayMonthRange();e.to&&t>e.to&&(t=e.to);e.from&&t<e.from&&(t=e.from);if(!wijmo_1.DateTime.equals(this.displayMonth,t)){this._month=t;this.invalidate(!0);this.onDisplayMonthChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"monthCount",{get:function(){var t=this.hostElement;return t?t.querySelectorAll("."+exports.CalendarClsNames.hostElement).length+1:0},set:function(t){var e=this,i=this.hostElement;if(t!=this.monthCount&&i){var o=i.querySelectorAll("."+exports.CalendarClsNames.hostElement);t=wijmo_1.asInt(t,!1);wijmo_1.assert(t>0,"monthCount must be >= 1.");wijmo_1.assert(1==t||!wijmo_1.closest(i.parentElement,"."+exports.CalendarClsNames.hostElement),"Only top-level calendars can set monthCount.");for(var n=0;n<o.length;n++){var s=o[n];wijmo_1.removeChild(s);this._getCalendar(s).dispose()}this._cals=[this];for(n=1;n<t;n++){(s=new Calendar(document.createElement("div"),{itemFormatter:this.itemFormatter,itemValidator:this.itemValidator,formatItem:function(t,i){return e.onFormatItem(i)}}))._selMode=this._selMode;s._value=this._value;s._rngEnd=this._rngEnd;for(var r in this)if(!/^(_.*|constructor|displayMonth|monthCount|hostElement|rightToLeft|isUpdating|isTouching)$/.test(r)){var a=this[r];wijmo_1.isFunction(a)||a instanceof wijmo_1.Event||(s[r]=a)}this._cals.push(s);i.appendChild(s.hostElement)}this.updateCalendarsTabindex();wijmo_1.toggleClass(i,exports.CalendarClsNames.calendarMultiMonth,t>1);this._syncProp(this,"displayMonth")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatYearMonth",{get:function(){return this._fmtYrMo},set:function(t){if(t!=this._fmtYrMo){this._fmtYrMo=wijmo_1.asString(t);this._syncProp(this,"formatYearMonth");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatDayHeaders",{get:function(){return this._fmtDayHdr},set:function(t){if(t!=this._fmtDayHdr){this._fmtDayHdr=wijmo_1.asString(t);this._syncProp(this,"formatDayHeaders");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatDays",{get:function(){return this._fmtDay},set:function(t){if(t!=this._fmtDay){this._fmtDay=wijmo_1.asString(t);this._syncProp(this,"formatDays");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatYear",{get:function(){return this._fmtYr},set:function(t){if(t!=this._fmtYr){this._fmtYr=wijmo_1.asString(t);this._syncProp(this,"formatYear");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatMonths",{get:function(){return this._fmtMonths},set:function(t){if(t!=this._fmtMonths){this._fmtMonths=wijmo_1.asString(t);this._syncProp(this,"formatMonths");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"showHeader",{get:function(){return"none"!=this._tbHdr.style.display},set:function(t){if(t!=this.showHeader){this._tbHdr.style.display=wijmo_1.asBoolean(t)?"":"none";this._syncProp(this,"showHeader")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"monthView",{get:function(){return"none"!=this._tbMth.style.display},set:function(t){if(t!=this.monthView){this._tbMth.style.display=t?"":"none";this._tbYr.style.display=t?"none":"";this.refresh();var e=wijmo_1.culture.Calendar.ariaLabels;wijmo_1.setAriaLabel(this._btnPrv,t?e.prvMo:e.prvYr);wijmo_1.setAriaLabel(this._btnTdy,t?e.today:e.currMo);wijmo_1.setAriaLabel(this._btnNxt,t?e.nxtMo:e.nxtYr);wijmo_1.setAriaLabel(this._btnMth,t?e.monthView:e.yearView);this._updateMonthButtonAria();this._syncProp(this,"monthView")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"weeksBefore",{get:function(){return this._wksBefore},set:function(t){if(t!=this._wksBefore){this._wksBefore=Math.floor(wijmo_1.asNumber(t,!1,!0));this._syncProp(this,"weeksBefore");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"weeksAfter",{get:function(){return this._wksAfter},set:function(t){if(t!=this._wksAfter){this._wksAfter=Math.floor(wijmo_1.asNumber(t,!1,!0));this._syncProp(this,"weeksAfter");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"itemFormatter",{get:function(){return this._itemFormatter},set:function(t){if(t!=this._itemFormatter){this._itemFormatter=wijmo_1.asFunction(t);this._syncProp(this,"itemFormatter");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"itemValidator",{get:function(){return this._itemValidator},set:function(t){if(t!=this._itemValidator){this._itemValidator=wijmo_1.asFunction(t);this._syncProp(this,"itemValidator");this.invalidate()}},enumerable:!0,configurable:!0});Calendar.prototype.hitTest=function(t){var e=t instanceof MouseEvent?t.target:t instanceof Element?t:null;wijmo_1.assert(null!=e,"MouseEvent or Element expected");return e?e[Calendar._DATE_KEY]:null};Calendar.prototype.ensureVisible=function(t){if(null!=t){var e=this._getCalendars(),i=e.indexOf(this),o=e[0],n=e[e.length-1];t<o.displayMonth?this.displayMonth=wijmo_1.DateTime.addMonths(this._getMonth(t),i):t>n.displayMonth&&(this.displayMonth=wijmo_1.DateTime.addMonths(this._getMonth(t),i-e.length+1))}};Calendar.prototype.onValueChanged=function(t){this.valueChanged.raise(this,t);this._syncProp(this,"value")};Calendar.prototype.onRangeEndChanged=function(t){this.rangeEndChanged.raise(this,t);this._syncProp(this,"rangeEnd");this._value&&this._rngEnd&&this.onRangeChanged(t)};Calendar.prototype.onRangeChanged=function(t){this.rangeChanged.raise(this,t)};Calendar.prototype.onDisplayMonthChanged=function(t){this.displayMonthChanged.raise(this,t);this._syncProp(this,"displayMonth")};Calendar.prototype.onFormatItem=function(t){this.formatItem.raise(this,t)};Calendar.prototype._containsFocusImpl=function(e){return t.prototype._containsFocusImpl.call(this,e)||this._lbYears._containsFocusImpl(e)};Calendar.prototype.dispose=function(){this._rptUp.element=null;this._rptDn.element=null;this._lbYears.dispose();t.prototype.dispose.call(this)};Calendar.prototype.refresh=function(e){void 0===e&&(e=!0);var i=this.hostElement,o=this.containsFocus();if(i){t.prototype.refresh.call(this,e);e&&this._updateContent();this._updateSelection();var n=this._getDisplayMonthRange(),s=this.displayMonth,r=null==n.from||s>n.from,a=null==n.to||s<n.to;wijmo_1.enable(this._btnPrv,r);wijmo_1.enable(this._btnNxt,a);r&&a||this.containsFocus()||this.focus();var l=!0,h=wijmo_1.DateTime.newDate(),u=this._min&&this._min>h,c=this._max&&this._max<h;(u||c)&&(l=!1);wijmo_1.enable(this._btnTdy,l);if(o&&!this._isButtonFocused()){var p=(this.monthView?this._tbMth:this._tbYr).querySelector("td."+wijmo_1.ControlStateClsNames.selected)||i;p&&!this.focusMode&&p.focus()}var d=this._getCalendars();d.length>1&&this==d[0]&&d.forEach((function(t,i){i>0&&t.refresh(e)}))}};Calendar.prototype._getShowMonthPicker=function(){var t=ShowMonthPicker,e=this._getCalendars(),i=e.indexOf(this),o=this.showMonthPicker;switch(o){case t.FirstMonth:case t.Outside:return 0==i?o:0;case t.LastMonth:return i==e.length-1?o:0;case t.FirstAndLastMonths:return 0==i||i==e.length-1?o:0;case t.AllMonths:return o}return 0};Calendar.prototype._getDisplayMonthRange=function(){var t={from:null,to:null};if(this.min||this.max){var e=this._getCalendars(),i=e.indexOf(this),o=this._mthMode()?wijmo_1.DateTime.addYears:wijmo_1.DateTime.addMonths;this.min&&(t.from=o(this._getMonth(this.min),i));this.max&&(t.to=o(this._getMonth(this.max),i-e.length+1))}return t};Calendar.prototype._getCalendar=function(t){return wijmo_1.Control.getControl(t)};Calendar.prototype._getCalendars=function(){var t=wijmo_1.closest(this.hostElement,"."+exports.CalendarClsNames.calendarMultiMonth);return(t?this._getCalendar(t):this)._cals};Calendar.prototype._syncProp=function(t,e){var i=this;if(!this._syncing){var o=this._getCalendars();if(o&&o.length>1){var n=t[e],s=this._mthMode()?wijmo_1.DateTime.addYears:wijmo_1.DateTime.addMonths;"displayMonth"==e&&(n=s(n,-o.indexOf(t)));o[0].deferUpdate((function(){i._syncing=!0;o.forEach((function(o,r){if(o!=t){var a=o.displayMonth;o[e]="displayMonth"==e?s(n,r):n;if("value"==e){o.displayMonth=a;i._rngMode()&&(o.rangeEnd=null)}}}));i._syncing=!1}))}}};Calendar.prototype._updateContent=function(){var t=this.displayMonth,e=wijmo_1.Globalize.format,i=wijmo_1.DateTime,o=this._getShowMonthPicker();wijmo_1.setText(this._spMth,e(t,this._fmtYrMo));var n=this._btnMth.querySelector("."+wijmo_1.GlyphClsNames.down);n&&(n.style.display=this._mthMode()||!o?"none":"");var s=wijmo_1.closest(this._btnTdy,"."+wijmo_1.InputFormElementsClsNames.btnGroup);s&&(s.style.display=o?"":"none");var r=null!=this._fdw?this._fdw:wijmo_1.Globalize.getFirstDayOfWeek(),a=i.addDays(t,-(t.getDay()-r+7)%7),l=i.monthLast(t),h=this._tbMth.querySelectorAll("th");this._updateMonthButtonAria();for(var u=0;u<7&&u<h.length;u++){var c=i.addDays(a,u);wijmo_1.setText(h[u],e(c,this._fmtDayHdr));wijmo_1.setAttribute(h[u],"tabIndex","-1");wijmo_1.setAttribute(h[u],"abbr",e(c,this._fmtDayTitle))}var p=!1;this._dateViewContainsFocus()&&(p=!0);var d=this._tbMth.querySelectorAll("tr");for(u=1;u<d.length;u++)wijmo_1.removeChild(d[u]);p&&this.focus();var m=i.addDays(a,-7*this._wksBefore);for(u=0;u<this._wksBefore;u++)m=this._addWeek(m,exports.CalendarClsNames.weekBefore);for(;m<=l;)m=this._addWeek(m);for(u=0;u<this._wksAfter;u++)m=this._addWeek(m,exports.CalendarClsNames.weekAfter);h=this._tbYr.querySelectorAll("td");var _=this._tbYr.querySelectorAll("th");_.length&&wijmo_1.setText(_[0],e(t,this._fmtYr));for(u=0;u<h.length;u++){m=i.newDate(t.getFullYear(),u,1);var f=h[u],b=!this._monthInValidRange(m);f[Calendar._DATE_KEY]=m;var g=wijmo_1.Globalize.format(m,"MMMM yyyy");wijmo_1.setText(f,e(m,this._fmtMonths));wijmo_1.toggleClass(f,wijmo_1.ControlStateClsNames.disabled,b);wijmo_1.setAriaLabel(f,g);wijmo_1.setAttribute(f,"tabIndex","-1");wijmo_1.setAttribute(f,"abbr",g)}this._confirmationButtonContainer.style.display=this.showConfirmationButtons?"":"none";this._updateButtonTabIndex()};Calendar.prototype._updateSelection=function(){for(var t=Calendar._DATE_KEY,e=wijmo_1.DateTime,i=this._tbMth.querySelectorAll("td"),o=0;o<i.length;o++){var n=(u=i[o])[t],s=this.value,r=this.rangeEnd,a=this._selMode&&null!=s&&e.sameDate(n,s),l=this._selMode&&null!=s&&e.sameDate(n,r),h=this._selMode&&null!=s&&n>s&&null!=r&&n<=r;wijmo_1.toggleClass(u,wijmo_1.ControlStateClsNames.selected,a);wijmo_1.toggleClass(u,wijmo_1.ControlStateClsNames.multiSelected,h);wijmo_1.toggleClass(u,wijmo_1.ControlStateClsNames.lastSelected,l);wijmo_1.setAttribute(u,"aria-selected",!!a||null);this._customizeCell(o,n,u)}i=this._tbYr.querySelectorAll("td");for(o=0;o<i.length;o++){var u;n=(u=i[o])[t],a=this._sameMonth(n,this.value);wijmo_1.toggleClass(u,wijmo_1.ControlStateClsNames.selected,a);wijmo_1.setAttribute(u,"aria-selected",!!a||null)}this.focusMode&&!0!==this.isDisabled&&-1!==this.tabOrder&&this._updateFocusInAccessibilityMode()};Calendar.prototype._updateFocusInAccessibilityMode=function(){for(var t,e=Calendar._DATE_KEY,i=wijmo_1.DateTime,o=this._tbMth.querySelectorAll("td"),n=0;n<o.length;n++){var s=(l=o[n])[e],r=this._selMode&&null!=this.focusValue&&i.sameDate(s,this.focusValue)&&this._isSameDay(this.focusValue,s);void 0===t&&!l.classList.contains(exports.CalendarClsNames.dayOtherMonth)&&this._isDayValid(s)&&(t=l);this._isSameDay(this.focusValue,s)&&this._isDayValid(s)&&(t=l);this._updateCellFocus(l,r)}if(0===this._tbMth.querySelectorAll('[tabindex="0"]').length&&this.monthView&&t){wijmo_1.setAttribute(t,"tabIndex","0");wijmo_1.toggleClass(t,exports.CalendarClsNames.focused,!0);this._focusValue=t[e]}var a=(o=this._tbYr.querySelectorAll("td"))[0];for(n=0;n<o.length;n++){var l;s=(l=o[n])[e],r=this._sameMonth(s,this.focusValue);this._isSameMonth(this.value,s)&&(a=l);this._updateCellFocus(l,r)}if(0===this._tbYr.querySelectorAll('td[tabindex="0"]').length&&!this.monthView){wijmo_1.setAttribute(a,"tabIndex","0");wijmo_1.toggleClass(a,exports.CalendarClsNames.focused,!0);this._focusValue=a[e]}};Calendar.prototype._addWeek=function(t,e){for(var i=this._createElement("tr",this._tbMth,e),o=wijmo_1.DateTime,n=0;n<7;n++){var s=this._createElement("td",i),r=o.addDays(t,n);s[Calendar._DATE_KEY]=r;wijmo_1.setText(s,wijmo_1.Globalize.format(r,this._fmtDay));wijmo_1.setAriaLabel(s,wijmo_1.Globalize.format(r,"D"));var a=!this._valid(r),l=r.getDay(),h=r.getMonth()!=this.displayMonth.getMonth();wijmo_1.toggleClass(s,exports.CalendarClsNames.dayToday,o.sameDate(r,o.newDate()));wijmo_1.toggleClass(s,exports.CalendarClsNames.dayWeekend,0==l||6==l);wijmo_1.toggleClass(s,exports.CalendarClsNames.dayOtherMonth,h);wijmo_1.toggleClass(s,wijmo_1.ControlStateClsNames.invalid,a||!this._inValidRange(r));wijmo_1.setAttribute(s,"aria-disabled",a||!this._inValidRange(r))}return o.addDays(t,7)};Calendar.prototype._customizeCell=function(t,e,i){wijmo_1.isFunction(this.itemFormatter)&&this.itemFormatter(e,i);if(this.formatItem.hasHandlers){var o=new FormatItemEventArgs(t,e,i);this.onFormatItem(o)}};Calendar.prototype._canChangeValue=function(){return!this._readOnly&&this._selMode!=DateSelectionMode.None};Calendar.prototype._valid=function(t){return!(!wijmo_1.isDate(t)||!wijmo_1.DateTime.sameDate(t,this._clamp(t)))&&(!wijmo_1.isFunction(this.itemValidator)||this.itemValidator(t))};Calendar.prototype._inValidRange=function(t){var e=wijmo_1.DateTime.fromDateTime;return!(this.min&&t<e(this.min,t))&&!(this.max&&t>e(this.max,t))};Calendar.prototype._monthInValidRange=function(t){if(this.min||this.max){var e=t.getFullYear(),i=t.getMonth(),o=wijmo_1.DateTime,n=o.newDate(e,i,1),s=o.newDate(e,i+1,0);if(this.min&&this.min>s)return!1;if(this.max&&this.max<n)return!1}return!0};Calendar.prototype._sameMonth=function(t,e){return wijmo_1.isDate(t)&&wijmo_1.isDate(e)&&t.getMonth()==e.getMonth()&&t.getFullYear()==e.getFullYear()};Calendar.prototype._getValidDate=function(t,e){if(wijmo_1.isDate(t))for(var i=t.getFullYear(),o=t.getMonth()+(e?0:1),n=e?1:0,s=wijmo_1.DateTime,r=s.newDate(i,o,n),a=e?1:-1,l=0;l<31;l++){if(this._valid(r))return r;r=s.addDays(r,a)}return null};Calendar.prototype._clamp=function(t){if(t){var e=wijmo_1.DateTime.fromDateTime;if(this.min){var i=e(this.min,t);t<i&&(t=i)}if(this.max){var o=e(this.max,t);t>o&&(t=o)}}return t};Calendar.prototype._createChildren=function(){var t=this.getTemplate();this.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+exports.CalendarClsNames.hostElement,t,{_tbHdr:"tbl-header",_btnMth:"btn-month",_spMth:"span-month",_btnPrv:"btn-prev",_btnTdy:"btn-today",_btnNxt:"btn-next",_tbMth:"tbl-month",_tbYr:"tbl-year",_confirmationButtonContainer:"confirmation-button-container",_btnOK:"btn-ok",_btnCancel:"btn-cancel"});this._tbYr.style.display="none";var e=wijmo_1.culture.Calendar.ariaLabels;wijmo_1.setAriaLabel(this._tbMth,e.chooseDate);wijmo_1.setAriaLabel(this._tbYr,e.chooseMonth);wijmo_1.setAriaLabel(this._btnPrv,e.calendar);wijmo_1.setAriaLabel(this._btnMth,e.monthView);wijmo_1.setAriaLabel(this._btnPrv,e.prvMo);wijmo_1.setAriaLabel(this._btnTdy,e.today);wijmo_1.setAriaLabel(this._btnNxt,e.nxtMo);for(var i=this._createElement("tr",this._tbMth,exports.CalendarClsNames.header),o=0;o<7;o++){this._createElement("th",i).setAttribute("scope","col")}i=this._createElement("tr",this._tbYr,exports.CalendarClsNames.header);this._showYearListBoxButton=this._createElement("th",i);this._showYearListBoxButton.setAttribute("colspan","4");this._showYearListBoxButton.setAttribute("scope","col");wijmo_1.setAriaLabel(this._showYearListBoxButton,e.selectYear);wijmo_1.toggleClass(this._showYearListBoxButton,exports.CalendarClsNames.selectedYear);this._showYearListBoxButton.setAttribute("role","button");this._showYearListBoxButton.setAttribute("tabIndex","-1");for(var n=0;n<3;n++){i=this._createElement("tr",this._tbYr);for(var s=0;s<4;s++)this._createElement("td",i)}};Calendar.prototype._createYearPicker=function(){var t=this,e=this.hostElement,i=this._createElement("div",null,exports.DropDownClsNames.dropDownPanel+" "+exports.CalendarClsNames.yearPicker);i.tabIndex=this._orgTabIndex;this._lbYears=new ListBox(i,{lostFocus:function(e){wijmo_1.hidePopup(i);t._tmYrHidden=Date.now();t.removeEventListener(window,"touchstart");if(e.selectedIndex>-1){var o=wijmo_1.DateTime.clone(t.displayMonth);o.setFullYear(e.selectedIndex+e.itemsSource[0]);t.displayMonth=o}t.keyActionTab===CalendarTabKeyAction.All&&t._showYearListBoxButton.focus()}});wijmo_1.setAriaLabel(this._lbYears.hostElement,wijmo_1.culture.Calendar.ariaLabels.selectYear);this.addEventListener(i,"keydown",(function(i){switch(i.keyCode){case wijmo_1.Key.Enter:e.focus();break;case wijmo_1.Key.Space:e.focus();i.preventDefault();break;case wijmo_1.Key.Escape:t._lbYears.selectedIndex=-1;e.focus()}i.defaultPrevented&&i.stopPropagation()}));this.addEventListener(i,"click",(function(t){e.focus()}))};Calendar.prototype._createElement=function(t,e,i){var o=document.createElement(t);i&&wijmo_1.addClass(o,i);e&&e.appendChild(o);return o};Calendar.prototype._click=function(t){if(!t.defaultPrevented&&0==t.button){var e=!1,i=t.target;if(wijmo_1.contains(this._btnMth,i)&&!this._mthMode()&&this._getShowMonthPicker()){this.monthView=!this.monthView;e=!0}else if(wijmo_1.contains(this._btnPrv,i)){this._navigate(-1);e=!0}else if(wijmo_1.contains(this._btnNxt,i)){this._navigate(1);e=!0}else if(wijmo_1.contains(this._btnTdy,i)){this._navigate(0);e=!0}if(i&&!e&&this._yrPicker&&wijmo_1.contains(this._tbYr,i)&&wijmo_1.closest(i,"."+exports.CalendarClsNames.header)){this._showYearPickerAction(t);return}if(i&&!e){var o=wijmo_1.closest(i,"td");if(o){var n=this.hitTest(o),s=wijmo_1.DateTime.fromDateTime;if(this.monthView){if(n&&this._canChangeValue()){var r=s(n,this._value);this._inValidRange(r)&&this._valid(r)&&(this._rngMode()&&this.value&&!this.rangeEnd&&r>=this.value?this.rangeEnd=r:this.value=r);e=!0}}else if(n){this.displayMonth=n;if(this._mthMode()){if(this._canChangeValue()){r=s(this.displayMonth,this.value);this._inValidRange(r)&&(this.value=r)}}else this.monthView=!0;e=!0}}}if(e){t.preventDefault();this.focusMode||0===t.detail||this.focus()}}};Calendar.prototype._keydown=function(t){if(!t.defaultPrevented){if(t.altKey)switch(t.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:return;case wijmo_1.Key.End:this._navigate(0);t.preventDefault();return}var e=t.target;if(!(t.ctrlKey||t.metaKey||t.shiftKey&&!this._rngMode())){if(("Enter"===t.key||"Space"===t.code)&&e&&this.keyActionTab===CalendarTabKeyAction.All){if(wijmo_1.contains(this._btnMth,e)&&!this._mthMode()&&this._getShowMonthPicker()){this.monthView=!this.monthView;"Space"===t.code&&t.preventDefault();return}if(this._yrPicker&&wijmo_1.contains(this._tbYr,e)&&wijmo_1.closest(e,"."+exports.CalendarClsNames.header)){this._showYearPickerAction(t);return}}if(this.focusMode){if(("Enter"===t.key||"Space"===t.code)&&e.classList.contains(exports.CalendarClsNames.focused)){var i=wijmo_1.closest(e,"td");if(i){var o=this.hitTest(i);this.setFocusModeValue(o,t)}"Space"===t.code&&t.preventDefault();return}if(!wijmo_1.contains(this._tbMth,t.target)&&(!wijmo_1.contains(this._tbYr,t.target)||wijmo_1.contains(this._tbYr.firstElementChild,t.target)))return}var n=this._getKeyCode(t),s=0,r=0,a=!0;if(this.monthView)switch(n){case wijmo_1.Key.Left:s=-1;break;case wijmo_1.Key.Right:s=1;break;case wijmo_1.Key.Up:s=-7;break;case wijmo_1.Key.Down:s=7;break;case wijmo_1.Key.PageDown:r=t.altKey?12:1;break;case wijmo_1.Key.PageUp:r=t.altKey?-12:-1;break;case wijmo_1.Key.Home:case wijmo_1.Key.End:if(this._canChangeValue()&&!t.shiftKey){var l=this.value||this.displayMonth;if(u=this._getValidDate(l,n==wijmo_1.Key.Home)){this.value=wijmo_1.DateTime.fromDateTime(u,this.value);this._rngEnd=null}}break;default:a=!1}else switch(n){case wijmo_1.Key.Left:r=-1;break;case wijmo_1.Key.Right:r=1;break;case wijmo_1.Key.Up:r=-4;break;case wijmo_1.Key.Down:r=4;break;case wijmo_1.Key.PageDown:r=t.altKey?120:12;break;case wijmo_1.Key.PageUp:r=t.altKey?-120:-12;break;case wijmo_1.Key.Home:r=this.value?-this.value.getMonth():0;break;case wijmo_1.Key.End:r=this.value?11-this.value.getMonth():0;break;case wijmo_1.Key.Enter:this._mthMode()?a=!1:this.monthView=!0;break;default:a=!1}if(this._canChangeValue()&&(s||r)){var h=t.shiftKey&&null!=this.rangeEnd?this.rangeEnd:this.focusMode?this.focusValue:this.value,u=wijmo_1.DateTime;if(h){h=u.addDays(h,s);h=u.addMonths(h,r)}else h=this._getValidDate(new Date,!0);if(r&&!this._valid(h)){l=h.getMonth();for(var c=1;c<31&&!this._valid(h);c++){var p=u.addDays(h,+c),d=u.addDays(h,-c);this._valid(p)&&p.getMonth()==l?h=p:this._valid(d)&&d.getMonth()==l&&(h=d)}}for(c=0;c<31&&!this._valid(h);c++)h=u.addDays(h,s>0||r>0?1:-1);t.shiftKey&&this._rngMode()&&h>this.value?this.rangeEnd=h:this.focusMode?this.focusValue=h:this.value=h}a&&t.preventDefault()}}};Calendar.prototype._getMonth=function(t){var e=wijmo_1.DateTime;t=t||e.newDate();return e.newDate(t.getFullYear(),t.getMonth(),1)};Calendar.prototype._mthMode=function(){return this.selectionMode==DateSelectionMode.Month};Calendar.prototype._rngMode=function(){return this.selectionMode==DateSelectionMode.Range};Calendar.prototype._navigate=function(t){var e=this.monthView,i=this.displayMonth,o=wijmo_1.DateTime;switch(t){case 0:var n=o.newDate();this._canChangeValue()&&(this.value=e?o.fromDateTime(n,this.value):this._getMonth(n));i=this._getMonth(n);break;case 1:i=o.addMonths(i,e?1:12);break;case-1:i=o.addMonths(i,e?-1:-12)}this.displayMonth=i};Calendar.prototype._setTabOrder=function(e){t.prototype._setTabOrder.call(this,e);this._lbYears.tabOrder=this._orgTabIndex;this._getCalendars().forEach((function(t){t.tabOrder!=e&&(t.tabOrder=e)}));this.updateCalendarsTabindex()};Calendar.prototype._showYearPickerAction=function(t){var e=this,i=t.target;if(Date.now()-this._tmYrHidden<600)t.preventDefault();else{for(var o=this.displayMonth.getFullYear(),n=this.min?this.min.getFullYear():o-100,s=this.max?this.max.getFullYear():o+100,r=[],a=n;a<=s;a++)r.push(a);var l=this._lbYears,h=l.hostElement,u=wijmo_1.closest(i,"."+exports.CalendarClsNames.header),c=this.hostElement,p=wijmo_1.closest(c,"."+exports.InputDateClsNames.inputDateDropDown)||c;l.itemsSource=r;l.selectedIndex=o-r[0];wijmo_1.setAttribute(h,"dir",this.rightToLeft?"rtl":null);wijmo_1.setCss(h,{minWidth:"",width:u.offsetWidth});wijmo_1.showPopup(h,u,!1,!1,p);requestAnimationFrame((function(){l.showSelection(!0)}));this.addEventListener(window,"touchstart",(function(t){if(!wijmo_1.contains(h,t.target)){wijmo_1.hidePopup(h);e._tmYrHidden=Date.now();e.removeEventListener(window,"touchstart")}}));t.preventDefault()}};Object.defineProperty(Calendar.prototype,"focusMode",{get:function(){return this._focusMode},set:function(t){this._focusMode=t;this._getCalendars().forEach((function(e){e.focusMode!==t&&(e.focusMode=t)}));this.updateCalendarsTabindex();this.invalidate()},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(t){this._keyActionTab=t;this._updateButtonTabIndex()},enumerable:!0,configurable:!0});Calendar.prototype._isButtonFocused=function(){var t=wijmo_1.getActiveElement();if(!t)return!1;var e=t.getAttribute("role"),i=t.type;return e&&"button"===e.toLowerCase()||i&&"button"===i.toLowerCase()};Calendar.prototype._isSameDay=function(t,e){return!(e.getMonth()!=this.displayMonth.getMonth())&&t.getDate()===e.getDate()};Calendar.prototype._isSameMonth=function(t,e){return t.getMonth()===e.getMonth()};Calendar.prototype._dateViewContainsFocus=function(){var t=this._tbYr.querySelectorAll("td"),e=Array.from(t).find((function(t){return t===wijmo_1.getActiveElement()}));return this._tbMth.contains(wijmo_1.getActiveElement())||void 0!==e};Calendar.prototype._updateMonthButtonAria=function(){var t=wijmo_1.culture.Calendar.ariaLabels,e=this.monthView?t.monthView:t.yearView;wijmo_1.setAriaLabel(this._btnMth,e+", "+wijmo_1.Globalize.format(this.displayMonth,this._fmtYrMo))};Calendar.prototype._isDayValid=function(t){return this._valid(t)&&this._inValidRange(t)};Calendar.prototype.cancelButtonClick=function(t){this.cancelButtonClicked.raise(this,t)};Calendar.prototype.oneCancelButtonClick=function(t){this.cancelButtonClick(t)};Calendar.prototype.OKButtonClick=function(t){this.OKButtonClicked.raise(this,t)};Calendar.prototype.onOkButtonClick=function(t){this.OKButtonClick(t);this.setFocusModeValue(this.focusValue)};Object.defineProperty(Calendar.prototype,"ariaLabel",{get:function(){return this._ariaLabel},set:function(t){if(this.ariaLabel!==t&&this.hostElement){this._ariaLabel=t;wijmo_1.setAttribute(this.hostElement,"aria-label",t)}},enumerable:!0,configurable:!0});Calendar.prototype._updateButtonTabIndex=function(){var t=this.tabOrder.toString();if(this.keyActionTab===CalendarTabKeyAction.All&&!0!==this.isDisabled){wijmo_1.setAttribute(this._btnMth,"tabindex",t);wijmo_1.setAttribute(this._btnPrv,"tabindex",t);wijmo_1.setAttribute(this._btnTdy,"tabindex",t);wijmo_1.setAttribute(this._btnNxt,"tabindex",t);wijmo_1.setAttribute(this._showYearListBoxButton,"tabindex",t)}else{wijmo_1.setAttribute(this._btnMth,"tabindex","-1");wijmo_1.setAttribute(this._btnPrv,"tabindex","-1");wijmo_1.setAttribute(this._btnTdy,"tabindex","-1");wijmo_1.setAttribute(this._btnNxt,"tabindex","-1");wijmo_1.setAttribute(this._showYearListBoxButton,"tabindex","-1")}wijmo_1.setAttribute(this._btnOK,"tabindex",t);wijmo_1.setAttribute(this._btnCancel,"tabindex",t)};Calendar.prototype._onEnterKeyDownToSetValue=function(t){this._enterKeyDownToSetValue.raise(this,t)};Object.defineProperty(Calendar.prototype,"showConfirmationButtons",{get:function(){return this._showConfirmationButtons},set:function(t){this._showConfirmationButtons=t},enumerable:!0,configurable:!0});Calendar.prototype._setIsDisabled=function(e){t.prototype._setIsDisabled.call(this,e);this._updateButtonTabIndex()};Calendar.prototype.updateCalendarsTabindex=function(){var t=this.focusMode||-1===this.tabOrder?-1:0;this._getCalendarsHostElements().forEach((function(e){e.tabIndex=t}))};Calendar.prototype.setFocusModeValue=function(t,e){var i=wijmo_1.DateTime.fromDateTime;if(this.monthView){if(t&&this._canChangeValue()){var o=i(t,this._value);if(this._inValidRange(o)&&this._valid(o))if(this._rngMode()&&this.value&&!this.rangeEnd&&o>=this.value)this.rangeEnd=o;else{e&&this._enterKeyDownToSetValue.raise(this,e);this.value=o}}}else if(t){this.displayMonth=t;if(this._mthMode()){if(this._canChangeValue()){o=i(this.displayMonth,this.value);this._inValidRange(o)&&(this.value=o)}}else this.monthView=!0}};Calendar.prototype._getCalendarsHostElements=function(){return this._getCalendars().filter((function(t,e){return e>0})).map((function(t){return t.hostElement}))};Calendar._DATE_KEY="$WJ-DATE";Calendar._ctrlTemplate="";return Calendar}(wijmo_1.Control);exports.Calendar=Calendar;wijmo_1._addCultureInfo("DropDown",{ariaLabels:{tgl:"Toggle Dropdown"}});!function(t){t[t.Select=0]="Select";t[t.Open=1]="Open";t[t.Toggle=2]="Toggle"}(ClickAction=exports.ClickAction||(exports.ClickAction={}));!function(t){t[t.ChangeSelectionOnly=0]="ChangeSelectionOnly";t[t.OpenDropdown=1]="OpenDropdown"}(KeyAction=exports.KeyAction||(exports.KeyAction={}));!function(t){t[t.CloseAndKeepFocus=0]="CloseAndKeepFocus";t[t.CloseAndMoveFocus=1]="CloseAndMoveFocus"}(TabKeyAction=exports.TabKeyAction||(exports.TabKeyAction={}));var PopupTrigger,_Edges,DropDown=function(t){__extends(DropDown,t);function DropDown(e,i){var o=t.call(this,e)||this;o._clickAction=ClickAction.Select;o._showBtn=!0;o._autoExpand=!0;o._animate=!1;o._internalSettingText=!1;o._oldText="";o._keyActionDownArrow=KeyAction.ChangeSelectionOnly;o._keyActionUpArrow=KeyAction.ChangeSelectionOnly;o._keyActionTab=TabKeyAction.CloseAndMoveFocus;o._isDropdownOpened=!1;o.textChanged=new wijmo_1.Event;o.isDroppedDownChanging=new wijmo_1.Event;o.isDroppedDownChanged=new wijmo_1.Event;var n,s=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.DropDownClsNames.hostElement,s,{_tbx:"input",_btn:"btn",_dropDown:"dropdown"},"input");o.hostElement&&o.hostElement.id&&(n=o.hostElement.id);n&&o._dropDown&&o._dropDown.setAttribute("dropdown-id",n);o._dropDown.style.display="none";var r=wijmo_1.culture.DropDown.ariaLabels;wijmo_1.setAriaLabel(o._btn.querySelector("button"),r.tgl);var a=o._elRef=o._tbx;wijmo_1.disableAutoComplete(a);o._createDropDown();o._updateTbxAriaHaspopup();o._updateBtn();o._updateTbx();var l=o.hostElement;wijmo_1.addClass(l,wijmo_1.ControlStateClsNames.collapsed);o.addEventListener(window,"resize",(function(){o.isDroppedDown&&o.invalidate()}));var h=o.dropDown,u=o.addEventListener.bind(o),c=o._updateFocusState.bind(o);u(h,"blur",c,!0);u(h,"focus",c);var p=o._keydown.bind(o);u(l,"keydown",p);u(h,"keydown",p);var d=o._keypress.bind(o);u(l,"keypress",d,!0);u(h,"keypress",d,!0);u(a,"input",o._input.bind(o));u(a,"beforeinput",(function(t){"historyUndo"!==t.inputType&&"historyRedo"!==t.inputType||t.preventDefault()}));u(a,"blur",(function(){o._commitText(!0,!1)}),!0);u(a,"click",(function(){o._autoExpand&&o._expandSelection()}));u(a,"mousedown",(function(t){switch(o._clickAction){case ClickAction.Open:if(!o.isDroppedDown){t.preventDefault();o.focus();o.isDroppedDown=!0}break;case ClickAction.Toggle:t.preventDefault();o.focus();o.isDroppedDown=!o.isDroppedDown}}));u(o._btn,"mousedown",(function(t){o._btnclick(t)}));wijmo_1.removeChild(h);wijmo_1.isIE()&&o._elRef==o._tbx&&u(l,"mouseup",(function(t){if(!t.defaultPrevented&&0==t.button&&wijmo_1.hasClass(t.target,wijmo_1.InputFormElementsClsNames.btn)){var e=wijmo_1.getActiveElement();e&&e!=t.target&&setTimeout((function(){e.focus()}))}}));wijmo_1.isIE9()&&u(a,"keyup",(function(){o._setText(o.text,!1)}));u(h,"click",o._dropDownClick.bind(o));return o}Object.defineProperty(DropDown,"controlTemplate",{get:function(){DropDown._ctrlTemplate||(DropDown._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+'"><div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+" "+exports.InputClsNames.inputBtnVisible+'"><input wj-part="input" type="text" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"><span wj-part="btn" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.down+'></span></button></span></div></div><div wj-part="dropdown" class="'+wijmo_1.ControlClsNames.content+" "+exports.DropDownClsNames.dropDownPanel+'"></div></div>');return DropDown._ctrlTemplate},set:function(t){DropDown._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"text",{get:function(){return this._tbx.value},set:function(t){if(t!=this.text){this._setText(t,!0);this._commitText()}},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"inputType",{get:function(){return this._tbx.type},set:function(t){this._tbx.type=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"isReadOnly",{get:function(){return this._tbx.readOnly},set:function(t){this._tbx.readOnly=wijmo_1.asBoolean(t);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly);this.isReadOnly&&this._toggleDropDown(!1)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"isRequired",{get:function(){return this._tbx.required},set:function(t){this._tbx.required=wijmo_1.asBoolean("boolean"==typeof t?t:this.isRequired)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"placeholder",{get:function(){return this._tbx.placeholder},set:function(t){this._tbx.placeholder=t},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"clickAction",{get:function(){return this._clickAction},set:function(t){this._clickAction=wijmo_1.asEnum(t,ClickAction)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"isDroppedDown",{get:function(){var t=this._dropDown;return t&&"none"!=t.style.display},set:function(t){var e=this.hostElement,i=this._dropDown,o=this.containsFocus(),n=new Set(["InputDateTime","WjInputDateTime"]);if(e&&i){var s=!this.isReadOnly;this.isTouching&&(s=!0);t=wijmo_1.asBoolean(t)&&!this.isDisabled&&s&&e.offsetWidth>0;this.isDroppedDown&&!t&&this.isDisabled&&(t=this.isDroppedDown);if(t||"INPUT"!=wijmo_1.getActiveElement().tagName||this.inputElement===wijmo_1.getActiveElement()||!this._isInvalidInputCancelled){if(t!=this.isDroppedDown&&(n.has(this.constructor.name)||!this._isInvalidInputCancelled||!this.isDroppedDown&&this._isInvalidInputCancelled)&&this.onIsDroppedDownChanging(new wijmo_1.CancelEventArgs)){this._toggleDropDown(t);o&&(this.isTouching&&this.showDropDownButton?e.focus():this.selectAll());this._updateFocusState();this._updateBtn();this._updateTbx();wijmo_1.toggleClass(e,wijmo_1.ControlStateClsNames.collapsed,!this.isDroppedDown);this.onIsDroppedDownChanged()}}else{this._isDropdownOpened=this.isDroppedDown;this._toggleDropDown(t)}}},enumerable:!0,configurable:!0});DropDown.prototype._toggleDropDown=function(t){var e=this,i=this.hostElement,o=this._dropDown;if(t){this._minWidthDropdown=o.style.minWidth;o.style.display="";this._updateDropDown();this.addEventListener(window,"touchstart",(function(t){for(var o=wijmo_1.Control._touching,n=t.target;n;){if(n==i)return;n=n[wijmo_1.Control._OWNR_KEY]||n.parentNode}wijmo_1.Control._touching=!0;e.isDroppedDown=!1;wijmo_1.Control._touching=o}))}else{this.removeEventListener(window,"touchstart");wijmo_1.hidePopup(o);o.style.minWidth=this._minWidthDropdown}};Object.defineProperty(DropDown.prototype,"dropDown",{get:function(){return this._dropDown},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"dropDownCssClass",{get:function(){return this._cssClass},set:function(t){if(t!=this._cssClass){wijmo_1.removeClass(this._dropDown,this._cssClass);this._cssClass=wijmo_1.asString(t);wijmo_1.addClass(this._dropDown,this._cssClass)}},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"showDropDownButton",{get:function(){return this._showBtn},set:function(t){this._showBtn=wijmo_1.asBoolean(t);this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"autoExpandSelection",{get:function(){return this._autoExpand},set:function(t){this._autoExpand=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"isAnimated",{get:function(){return this._animate},set:function(t){this._animate=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"keyActionDownArrow",{get:function(){return this._keyActionDownArrow},set:function(t){this._keyActionDownArrow=wijmo_1.asEnum(t,KeyAction)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"keyActionUpArrow",{get:function(){return this._keyActionUpArrow},set:function(t){this._keyActionUpArrow=wijmo_1.asEnum(t,KeyAction)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(t){this._keyActionTab=wijmo_1.asEnum(t,TabKeyAction)},enumerable:!0,configurable:!0});DropDown.prototype.selectAll=function(){var t=this._tbx;this._elRef==t&&wijmo_1.setSelectionRange(t,0,this.text.length);this.containsFocus()||this.focus()};DropDown.prototype.onTextChanged=function(t){this.textChanged.raise(this,t);this._updateState()};DropDown.prototype.onIsDroppedDownChanging=function(t){this.isDroppedDownChanging.raise(this,t);return!t.cancel};DropDown.prototype.onIsDroppedDownChanged=function(t){this.isDroppedDownChanged.raise(this,t)};DropDown.prototype.onGotFocus=function(e){this.isTouching||wijmo_1.contains(this._dropDown,wijmo_1.getActiveElement())||this.selectAll();t.prototype.onGotFocus.call(this,e)};DropDown.prototype.onLostFocus=function(e){this._commitText();this.isDroppedDown=!1;t.prototype.onLostFocus.call(this,e)};DropDown.prototype._containsFocusImpl=function(e){return t.prototype._containsFocusImpl.call(this,e)||this.isDroppedDown&&wijmo_1.contains(this._dropDown,e)};DropDown.prototype.dispose=function(){this.isDroppedDown=!1;var e=this._dropDown;if(e){this._dropDown=null;wijmo_1.removeChild(e);var i=wijmo_1.Control.getControl(e);i&&i.dispose()}t.prototype.dispose.call(this)};DropDown.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);var i=this.hostElement;if(i&&i.offsetHeight&&this.isDroppedDown){var o=wijmo_1.getActiveElement();this.isAnimated&&""!=this._dropDown.style.opacity||wijmo_1.showPopup(this._dropDown,i,!1,!1,null==this.dropDownCssClass);o instanceof HTMLElement&&o!=wijmo_1.getActiveElement()&&o.focus()}};DropDown.prototype._handleResize=function(){this.isDroppedDown&&this.refresh()};DropDown.prototype._dropDownClick=function(t){t.stopPropagation()};DropDown.prototype._expandSelection=function(){var t=this._tbx,e=t.value,i=t.selectionStart,o=t.selectionEnd;if(e&&i==o){var n=this._getCharType(e,i);if(n>-1){for(;o<e.length&&this._getCharType(e,o)==n;o++);for(;i>0&&this._getCharType(e,i-1)==n;i--);i!=o&&wijmo_1.setSelectionRange(t,i,o)}}};DropDown.prototype._getCharType=function(t,e){var i=t[e];return i>="0"&&i<="9"?0:i>="a"&&i<="z"||i>="A"&&i<="Z"?1:-1};DropDown.prototype._keydown=function(t){if(!t.defaultPrevented&&!this._isHiddenEditor()){switch(t.keyCode){case wijmo_1.Key.Escape:case wijmo_1.Key.Enter:if(this.isDroppedDown){this.isDroppedDown=!1;this.containsFocus()||this.focus();t.preventDefault()}break;case wijmo_1.Key.F4:this.toggleDropDown(t);break;case wijmo_1.Key.Up:this.handleUpArrowKey(t);break;case wijmo_1.Key.Down:this.handleDownArrowKey(t)}if(!t.defaultPrevented&&t.keyCode==wijmo_1.Key.Escape&&wijmo_1.isIE()){var e=this._tbx;if(t.target==e){var i=e.value;e.value=i+" ";e.value=i}}}};DropDown.prototype.toggleDropDown=function(t){if(this.isHostVisible()){this.isDroppedDown=!this.isDroppedDown;t.preventDefault()}};DropDown.prototype.handleUpArrowKey=function(t){t.altKey?this.toggleDropDown(t):this.keyActionUpArrow!==KeyAction.OpenDropdown||this.isDroppedDown||this.openDropDown(t)};DropDown.prototype.handleDownArrowKey=function(t){if(t.altKey)this.toggleDropDown(t);else if(this.keyActionDownArrow===KeyAction.OpenDropdown&&!this.isDroppedDown){this.openDropDown(t);this._afterOpenDropdownByDownArrow()}};DropDown.prototype._afterOpenDropdownByDownArrow=function(){};DropDown.prototype.openDropDown=function(t){if(this.isHostVisible()){this.isDroppedDown=!0;t.preventDefault()}};DropDown.prototype.isHostVisible=function(){var t=this.hostElement;return!(!t||!t.offsetHeight)};DropDown.prototype._isHiddenEditor=function(){return wijmo_1.hasClass(this._tbx,"wj-grid-ime")};DropDown.prototype._keypress=function(t){"AltLeft"!=t.code&&"AltRight"!=t.code||t.preventDefault()};DropDown.prototype._input=function(t){this._setText(this.text,!1)};DropDown.prototype._btnclick=function(t){var e=this;if(!t.defaultPrevented&&0==t.button){this._isInvalidInputCancelled=!1;t.preventDefault();if(this.isTouching){this.isReadOnly=!0;this.isDroppedDown=!this.isDroppedDown;this.focus();setTimeout((function(){e.isReadOnly=!1}),0)}else{this.focus();this.isDroppedDown=!this.isDroppedDown}}};DropDown.prototype._setText=function(t,e,i,o){var n=!1;if((t=(t||"").toString())!=this._tbx.value){this._tbx.value=t;if(i||!t){this.onTextChanged();n=!0}}if(t!=this._oldText){this._oldText=t;this._internalSettingText||n||this.onTextChanged()}o&&(this._tbx.value=this._tbx.value.trim());this._updateState()};DropDown.prototype._updateBtn=function(){this._btn.style.display=this._showBtn?"":"none";this._updateBtnAria()};DropDown.prototype._updateBtnAria=function(){var t=this._btn.querySelector("button"),e=this.isDroppedDown,i=this.dropDown?this.dropDown.id:null;wijmo_1.setAttribute(t,"aria-expanded",!!e);wijmo_1.setAttribute(t,"aria-controls",e?i:null)};DropDown.prototype._updateTbx=function(){this._updateTbxAria()};DropDown.prototype._updateTbxAria=function(){var t=this._tbx,e=this.isDroppedDown,i=this.dropDown?this.dropDown.id:null;wijmo_1.setAttribute(t,"aria-controls",e?i:null);wijmo_1.setAttribute(t,"aria-expanded",e)};DropDown.prototype._updateTbxAriaHaspopup=function(){var t=this._tbx,e=this.dropDown&&this.dropDown.getAttribute("role");wijmo_1.setAttribute(t,"aria-haspopup",e)};DropDown.prototype._createDropDown=function(){};DropDown.prototype._commitText=function(t,e){};DropDown.prototype._updateDropDown=function(){if(this.isDroppedDown){this._commitText();var t=this.dropDown;wijmo_1.setAttribute(t,"dir",this.rightToLeft?"rtl":null);wijmo_1.showPopup(t,this.hostElement,!1,this._animate,null==this.dropDownCssClass)}};DropDown.prototype._shouldRaiseInvalidInput=function(t){return wijmo_1.isNullOrUndefined(t)?!this._containsFocus():t};DropDown._ctrlTemplate="";return DropDown}(wijmo_1.Control);exports.DropDown=DropDown;wijmo_1._addCultureInfo("Popup",{ariaLabels:{close:"close",backdrop:"backdrop",isDraggable:"draggable",isResizable:"resizable",popupVisible:"visible",popupHide:"hidden",popup:"popup"}});!function(t){t[t.None=0]="None";t[t.ClickOwner=1]="ClickOwner";t[t.ClickPopup=2]="ClickPopup";t[t.Click=3]="Click";t[t.BlurOwner=4]="BlurOwner";t[t.BlurPopup=8]="BlurPopup";t[t.Blur=12]="Blur";t[t.ClickOrBlur=15]="ClickOrBlur";t[t.DownOwner=16]="DownOwner";t[t.DownPopup=32]="DownPopup";t[t.Down=48]="Down";t[t.EnterOwner=64]="EnterOwner";t[t.EnterPopup=128]="EnterPopup";t[t.Enter=192]="Enter";t[t.LeaveOwner=256]="LeaveOwner";t[t.LeavePopup=512]="LeavePopup";t[t.Leave=768]="Leave"}(PopupTrigger=exports.PopupTrigger||(exports.PopupTrigger={}));!function(t){t[t.None=0]="None";t[t.Left=1]="Left";t[t.Top=2]="Top";t[t.Right=4]="Right";t[t.Bottom=8]="Bottom";t[t.LeftTop=3]="LeftTop";t[t.RightTop=6]="RightTop";t[t.RightBottom=12]="RightBottom";t[t.LeftBottom=9]="LeftBottom"}(_Edges||(_Edges={}));var Popup=function(t){__extends(Popup,t);function Popup(e,i){var o=t.call(this,e)||this;o._owner=null;o._ariaLabel=wijmo_1.culture.Popup.ariaLabels.popup;o._modal=!1;o._position=wijmo_1.PopupPosition.BelowLeft;o._showTrigger=PopupTrigger.ClickOwner;o._hideTrigger=PopupTrigger.Blur;o._hideAnim=[];o._fadeIn=!0;o._fadeOut=!0;o._removeOnHide=!0;o._draggable=!1;o._resizable=!1;o._result=null;o._resultEnter=null;o._resultSubmit=null;o._callback=null;o._visible=!1;o._ownerClickBnd=o._ownerClick.bind(o);o._ownerDownBnd=o._ownerDown.bind(o);o._ownerBlurBnd=o._ownerBlur.bind(o);o._ownerEnterBnd=o._ownerEnter.bind(o);o._ownerLeaveBnd=o._ownerLeave.bind(o);o._mousedownBnd=o._mousedown.bind(o);o._mousemoveBnd=o._mousemove.bind(o);o._mousedragBnd=o._mousedrag.bind(o);o._mouseupBnd=o._mouseup.bind(o);o._hideBnd=o.hide.bind(o);o._lastShow=0;o._initialOwner=null;o._activeEdge=_Edges.None;o.showing=new wijmo_1.Event;o.shown=new wijmo_1.Event;o.hiding=new wijmo_1.Event;o.hidden=new wijmo_1.Event;o.resizing=new wijmo_1.Event;o.resized=new wijmo_1.Event;o.dragging=new wijmo_1.Event;o.dragged=new wijmo_1.Event;o.sizeChanging=new wijmo_1.Event;o.sizeChanged=new wijmo_1.Event;o.positionChanging=new wijmo_1.Event;o.positionChanged=new wijmo_1.Event;var n=o.hostElement;Popup._PopupInstanceCount++;wijmo_1.addClass(n,wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.PopupClsNames.hostElement);if(o.hostElement){o._initialOwner=o.hostElement.parentElement;wijmo_1.setAttribute(o.hostElement,"role","dialog")}n.getAttribute("tabindex")||(n.tabIndex=0);wijmo_1.hidePopup(n,!1);var s=o.addEventListener.bind(o);s(n,"compositionstart",(function(){o._composing=!0}));s(n,"compositionend",(function(){o._composing=!1}));s(window,"resize",(function(){!o.isVisible||o._dragged||o.isTouching||o.invalidate()}));s(n,"keydown",(function(t){if(!t.defaultPrevented){var e=t.ctrlKey&&t.altKey&&!t.shiftKey,i=t.ctrlKey&&t.shiftKey&&!t.altKey;if(e||i){var s=o.hostElement.getBoundingClientRect(),r=wijmo_1.Rect.fromBoundingRect(s);if(e&&o.isDraggable){t.preventDefault();switch(t.keyCode){case wijmo_1.Key.Left:r.left=Math.max(0,r.left-10);break;case wijmo_1.Key.Right:r.left=Math.min(window.innerWidth-r.width,r.left+10);break;case wijmo_1.Key.Up:r.top=Math.max(0,r.top-10);break;case wijmo_1.Key.Down:r.top=Math.min(window.innerHeight-r.height,r.top+10)}var a=new PopupBoundsChangingEventArgs(r);if(o.onPositionChanging(a)){wijmo_1.setCss(o.hostElement,{left:r.left+window.scrollX,top:r.top+window.scrollY,transform:"none"});o.onPositionChanged()}}else if(i&&o.isResizable){t.preventDefault();var l=window.getComputedStyle(o.hostElement),h=Math.max(parseInt(l.minWidth)||0,Popup._SZ_MIN),u=Math.max(parseInt(l.minHeight)||0,Popup._SZ_MIN);if(o._activeEdge===_Edges.None)switch(t.keyCode){case wijmo_1.Key.Up:o._activeEdge=_Edges.Top;break;case wijmo_1.Key.Down:o._activeEdge=_Edges.Bottom;break;case wijmo_1.Key.Left:o._activeEdge=_Edges.Left;break;case wijmo_1.Key.Right:o._activeEdge=_Edges.Right}var c=o._activeEdge===_Edges.Top||o._activeEdge===_Edges.Bottom,p=o._activeEdge===_Edges.Left||o._activeEdge===_Edges.Right;if(c&&![wijmo_1.Key.Up,wijmo_1.Key.Down].includes(t.keyCode)||p&&![wijmo_1.Key.Left,wijmo_1.Key.Right].includes(t.keyCode))return;if(o._activeEdge!==_Edges.None){var d=0;switch(t.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Left:d=-10;break;case wijmo_1.Key.Down:case wijmo_1.Key.Right:d=10}switch(o._activeEdge){case _Edges.Top:var m=Math.min(Math.max(r.top+d,0),r.bottom-u);r.height=r.bottom-m;r.top=m;break;case _Edges.Bottom:var _=Math.min(Math.max(r.bottom+d,r.top+u),window.innerHeight);r.height=_-r.top;break;case _Edges.Left:var f=Math.min(Math.max(r.left+d,0),r.right-h);r.width=r.right-f;r.left=f;break;case _Edges.Right:var b=Math.min(Math.max(r.right+d,r.left+h),window.innerWidth);r.width=b-r.left}r.left=Math.max(0,Math.min(r.left,window.innerWidth-r.width));r.top=Math.max(0,Math.min(r.top,window.innerHeight-r.height));var g=new PopupBoundsChangingEventArgs(r);if(o.onSizeChanging(g)){wijmo_1.setCss(o.hostElement,{left:r.left+window.scrollX,top:r.top+window.scrollY,width:r.width,height:r.height,transform:"none"});o.onSizeChanged()}}}}if(t.keyCode==wijmo_1.Key.Escape&&!o._composing){t.preventDefault();o.hide()}if(t.keyCode==wijmo_1.Key.Enter&&!o._composing){var w=o.dialogResultEnter;if(w){t.preventDefault();o._validateAndHide(w)}}if(t.keyCode==wijmo_1.Key.Tab&&o.modal){t.preventDefault();wijmo_1.moveFocus(n,t.shiftKey?-1:1)}}}));s(document,"keyup",(function(t){t.ctrlKey||t.shiftKey||o._activeEdge===_Edges.None||(o._activeEdge=_Edges.None)}));s(n,"click",(function(t){var e=t.target;if(e instanceof HTMLElement){if(e instanceof HTMLButtonElement&&"submit"==e.type){var i=o.hostElement,n=o.dialogResultSubmit;if(i instanceof HTMLFormElement&&n&&i.reportValidity()){t.preventDefault();o.hide(n)}}var s=e.className.match(/\bwj-hide[\S]*\b/);if(s&&s.length>0){t.preventDefault();t.stopPropagation();o.hide(s[0])}}}));var r=o._toggle.bind(o),a=PopupTrigger;o.addEventListener(n,"click",(function(t){o._ignoreClick||r(t,a.ClickPopup)}),!0);o.addEventListener(n,"mousedown",(function(t){o._ignoreClick=!1;r(t,a.DownPopup)}),!0);o.addEventListener(n,"mouseenter",(function(t){t.target==n&&r(t,a.EnterPopup)}),!0);o.addEventListener(n,"mouseleave",(function(t){t.target==n&&r(t,a.LeavePopup)}),!0);o.addEventListener(n,"blur",(function(t){o.containsFocus()||r(t,a.BlurPopup)}),!0);s(document,"wheel",(function(t){if(o.isVisible&&o._modal){for(var e=t.target;e&&e!=document.body;e=e.parentElement)if(e.scrollHeight>e.clientHeight)return;t.preventDefault()}}));o.initialize(i);o._updateAriaLabel();return o}Object.defineProperty(Popup.prototype,"ariaLabelledBy",{get:function(){return this.hostElement.getAttribute("aria-labelledby")},set:function(t){wijmo_1._setAriaLabelBy(this,this.hostElement,t,this._updateAriaLabel.bind(this))},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"owner",{get:function(){return this._owner},set:function(t){var e=this._owner;if(e){this.removeEventListener(e,"click");this.removeEventListener(e,"mousedown");this.removeEventListener(e,"mouseenter");this.removeEventListener(e,"mouseleave");this.removeEventListener(e,"blur")}if(e=this._owner=null!=t?wijmo_1.getElement(t):null){this.addEventListener(e,"click",this._ownerClickBnd,!0);this.addEventListener(e,"mousedown",this._ownerDownBnd,!0);this.addEventListener(e,"mouseenter",this._ownerEnterBnd,!0);this.addEventListener(e,"mouseleave",this._ownerLeaveBnd,!0);this.addEventListener(e,"blur",this._ownerBlurBnd,!0)}},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"position",{get:function(){return this._position},set:function(t){this._position=wijmo_1.asEnum(t,wijmo_1.PopupPosition)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"content",{get:function(){return this.hostElement.firstElementChild},set:function(t){if(t!=this.content){this.hostElement.innerHTML="";t instanceof HTMLElement&&this.hostElement.appendChild(t)}},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"showTrigger",{get:function(){return this._showTrigger},set:function(t){this._showTrigger=wijmo_1.asEnum(t,PopupTrigger)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"hideTrigger",{get:function(){return this._hideTrigger},set:function(t){this._hideTrigger=wijmo_1.asEnum(t,PopupTrigger)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"fadeIn",{get:function(){return this._fadeIn},set:function(t){this._fadeIn=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"fadeOut",{get:function(){return this._fadeOut},set:function(t){this._fadeOut=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"removeOnHide",{get:function(){return this._removeOnHide},set:function(t){if((t=wijmo_1.asBoolean(t))!=this.removeOnHide){this._removeOnHide=t;if(!this.isVisible){var e=this.hostElement;if(t)wijmo_1.removeChild(e);else if(e&&document.body){e.style.display="none";document.body.appendChild(e)}}}},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"modal",{get:function(){return this._modal},set:function(t){this._modal=wijmo_1.asBoolean(t);wijmo_1.setAttribute(this.hostElement,"aria-modal",t?"true":null)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"isDraggable",{get:function(){return this._draggable},set:function(t){this._draggable=wijmo_1.asBoolean(t);this._updateAriaLabel()},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"isResizable",{get:function(){return this._resizable},set:function(t){this._resizable=wijmo_1.asBoolean(t);this._updateAriaLabel()},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"dialogResult",{get:function(){return this._result},set:function(t){this._result=t},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"dialogResultEnter",{get:function(){return this._resultEnter},set:function(t){this._resultEnter=t},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"dialogResultSubmit",{get:function(){return this._resultSubmit},set:function(t){this._resultSubmit=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"isVisible",{get:function(){var t=this.hostElement;return this._visible&&null!=t&&t.offsetHeight>0},enumerable:!0,configurable:!0});Popup.prototype.show=function(t,e){var i=this;this._lastShow=Date.now();if(!this.isVisible){var o=this.hostElement;this.dialogResult=null;this._callback=null;this._oldFocus=null;this._myFocus=null;this._hideAnim.forEach((function(t){clearInterval(t)}));if(this._hideAnim.length>0){this._hideAnim.length=0;if(this._bkDrop){wijmo_1.hidePopup(this._bkDrop,this.removeOnHide);this._bkDrop.style.opacity=""}wijmo_1.hidePopup(o,this.removeOnHide);o.style.opacity=""}var n=new wijmo_1.CancelEventArgs;if(this.onShowing(n)){null!=t&&(this.modal=wijmo_1.asBoolean(t));null!=e&&(this._callback=wijmo_1.asFunction(e));this._oldFocus=wijmo_1.getActiveElement();wijmo_1.showPopup(o,this._owner,this._position,this._fadeIn,!1,this._hideBnd);this._modal&&this._showBackdrop();wijmo_1.setAttribute(this._oldFocus,"aria-expanded","true");this._composing=!1;this._visible=!0;this.onShown(n);this._updateAriaLabel();this._clearTimeouts();if(this.modal){this.addEventListener(window,"focus",(function(){if(!i.containsFocus()){var t=i._myFocus;t&&t.offsetHeight?t.focus():wijmo_1.moveFocus(o,0)}}));this.addEventListener(o,"focusin",(function(){var t=wijmo_1.getActiveElement();t&&wijmo_1.contains(o,t)&&(t.tabIndex>-1||!i._myFocus)&&(i._myFocus=t)}))}this._resized=this._dragged=this._ignoreClick=!1;this._handleDragResize(!0);this.addEventListener(window,"touchstart",(function(t){i._hideTrigger&PopupTrigger.Blur&&!wijmo_1.contains(o,t.target,!0)&&i.hide()}));this._toHidePopupTimer=setTimeout((function(){i.addEventListener(window,"click",(function(t){i._hideTrigger&PopupTrigger.BlurPopup&&i.isDisabled&&!wijmo_1.contains(o,t.target,!0)&&i.hide()}))}));this._toGetFocusTimer=setTimeout((function(){if(!i.isDisabled&&!i.containsFocus()&&!i.isTouching){var t=o.querySelector("[autofocus]");if(t&&t.clientHeight>0&&!t.disabled&&t.tabIndex>-1&&!wijmo_1.closest(t,"[disabled],."+wijmo_1.ControlStateClsNames.disabled)){t.focus();wijmo_1.isFunction(t.select)&&t.select()}else wijmo_1.moveFocus(o,0)}if(!i.isDisabled&&!i.containsFocus()){o.tabIndex=0;o.focus()}}),100)}}};Popup.prototype.hide=function(t){var e=this;this.removeEventListener(window,"touchstart");this.removeEventListener(window,"click");if(this.isVisible){wijmo_1.isUndefined(t)||(this.dialogResult=t);var i=new wijmo_1.CancelEventArgs,o=this.hostElement;if(this.onHiding(i)){this._handleDragResize(!1);for(var n=this.containsFocus()?this._oldFocus:null,s=o.querySelectorAll("."+wijmo_1.ControlClsNames.hostElement+"."+exports.DropDownClsNames.hostElement),r=0;r<s.length;r++){var a=wijmo_1.Control.getControl(s[r]);a instanceof DropDown&&(a.isDroppedDown=!1)}var l=this.removeOnHide,h=this.fadeOut;this._hideTimer=setTimeout((function(){e._updateState();e.onHidden(i);e._callback&&e._callback(e);if(e.hideTrigger&PopupTrigger.LeavePopup){var t=wijmo_1.Control.getControl(wijmo_1.closest(e.owner,"."+exports.PopupClsNames.hostElement));if(t instanceof Popup&&0!=(t.hideTrigger&PopupTrigger.Leave)){var o=Popup._evtHover,n=o?document.elementFromPoint(o.clientX,o.clientY):null,s=wijmo_1.Control.getControl(wijmo_1.closest(n,"."+exports.PopupClsNames.hostElement));s instanceof Popup&&!s.isVisible&&(n=null);n&&wijmo_1.contains(t.hostElement,n,!0)||t.hide()}}}),wijmo_1.Control._FOCUS_INTERVAL+50);this._bkDrop&&this._hideAnim.push(wijmo_1.hidePopup(this._bkDrop,l,h));this._hideAnim.push(wijmo_1.hidePopup(o,l,h));wijmo_1.setAttribute(this._oldFocus,"aria-expanded","false");this._visible=!1;this._oldFocus=null;this._myFocus=null;this._updateAriaLabel();this.removeEventListener(window,"focus");this.removeEventListener(o,"focusin");this.containsFocus()&&wijmo_1.getActiveElement().blur();this._clearTimeouts();!this.isVisible&&n&&n.offsetHeight&&n.focus()}}};Popup.prototype.onShowing=function(t){this.showing.raise(this,t);return!t.cancel};Popup.prototype.onShown=function(t){this.shown.raise(this,t)};Popup.prototype.onHiding=function(t){this.hiding.raise(this,t);return!t.cancel};Popup.prototype.onHidden=function(t){this._wasVisible=!1;this.hidden.raise(this,t)};Popup.prototype.onResizing=function(t){this.resizing.raise(this,t);return!t.cancel};Popup.prototype.onResized=function(t){this.resized.raise(this,t)};Popup.prototype.onDragging=function(t){this.dragging.raise(this,t);return!t.cancel};Popup.prototype.onDragged=function(t){this.dragged.raise(this,t)};Popup.prototype.onSizeChanging=function(t){this.sizeChanging.raise(this,t);return!t.cancel};Popup.prototype.onSizeChanged=function(t){this.sizeChanged.raise(this,t)};Popup.prototype.onPositionChanging=function(t){this.positionChanging.raise(this,t);return!t.cancel};Popup.prototype.onPositionChanged=function(t){this.positionChanged.raise(this,t)};Popup.prototype.onLostFocus=function(e){t.prototype.onLostFocus.call(this,e);if(this._hideTrigger&PopupTrigger.BlurPopup&&!this.containsFocus()){var i=document.createEvent("Event");i.initEvent("blur",!0,!0);this._toggle(i,PopupTrigger.BlurPopup)}};Popup.prototype.refresh=function(e){void 0===e&&(e=!0);var i=this.hostElement;t.prototype.refresh.call(this,e);if(this.isVisible&&!this._refreshing&&i){this._refreshing=!0;for(var o=wijmo_1.getActiveElement(),n=this._owner?this._owner.getBoundingClientRect():null,s=[],r=i.querySelectorAll("."+exports.DropDownClsNames.hostElement),a=0;a<r.length;a++){var l=wijmo_1.Control.getControl(r[a]);if(l instanceof DropDown&&l.isDroppedDown){s.push(l);l.dropDown.style.display="none"}}wijmo_1.showPopup(i,n,this._position);s.forEach((function(t){t.dropDown.style.display="";t._updateDropDown()}));this._modal&&o instanceof HTMLElement&&o!=wijmo_1.getActiveElement()&&o.focus();this._refreshing=!1}};Popup.prototype._clearTimeouts=function(){if(this._toShow){clearTimeout(this._toShow);this._toShow=null}if(this._toHideLeave){clearTimeout(this._toHideLeave);this._toHideLeave=null}if(this._toHideBlur){clearTimeout(this._toHideBlur);this._toHideBlur=null}};Popup.prototype._handleDragResize=function(t){var e=this.hostElement,i=this._draggable?this._getHeaderElement():null,o=this.addEventListener.bind(this),n=this.removeEventListener.bind(this),s=this._mousemoveBnd,r=this._mousedownBnd;if(t){o(e,"mousemove",s);o(e,"mousedown",r);o(e,"touchstart",r);i&&(i.style.touchAction="none")}else{this._mousedownEvt=null;this._rcBounds=null;n(e,"mousemove",s);n(e,"mousedown",r);n(e,"touchstart",r);n(document,"mousemove",this._mousedragBnd);n(document,"mouseup",this._mouseupBnd);i&&(i.style.touchAction="")}};Popup.prototype._mousemove=function(t){if(!this._mousedownEvt){var e=this.hostElement,i=this._getEdges(e,t),o="",n=_Edges;this._edges=i;this._resizable&&(i==n.LeftTop||i==n.RightBottom?o="nwse-resize":i==n.LeftBottom||i==n.RightTop?o="nesw-resize":i==n.Left||i==n.Right?o="ew-resize":i!=n.Top&&i!=n.Bottom||(o="ns-resize"));this._draggable&&!o&&this._getClosestHeader(t.target)&&(o="move");e.style.cursor=o}};Popup.prototype._mousedown=function(t){if(!t.defaultPrevented){var e=t.touches&&t.touches.length>0?t.touches[0]:t;this._edges=this._getEdges(this.hostElement,e);if(this._edges||this._draggable&&this._getClosestHeader(t.target)){var i=new wijmo_1.CancelEventArgs;if(this._edges?this.onResizing(i):this.onDragging(i)){this._mousedownEvt=e;this._rcBounds=this.hostElement.getBoundingClientRect();var o=this.addEventListener.bind(this),n=document,s=this._mousedragBnd,r=this._mouseupBnd;o(n,"mousemove",s);o(n,"touchmove",s);o(n,"mouseup",r);o(n,"touchend",r)}}this._ignoreClick=!1}};Popup.prototype._mouseup=function(){this._mousedownEvt=null;this._rcBounds=null;this._activeEdge=_Edges.None;var t=this.removeEventListener.bind(this),e=document,i=this._mousedragBnd,o=this._mouseupBnd;t(e,"mousemove",i);t(e,"touchmove",i);t(e,"mouseup",o);t(e,"touchend",o);this._resized?this.onResized():this._dragged&&this.onDragged();this._resized=this._dragged=this._ignoreClick=!1};Popup.prototype._mousedrag=function(t){if(!t.defaultPrevented){var e=this.hostElement,i=this._mousedownEvt,o=t.touches&&t.touches.length>0?t.touches[0]:t,n=o.clientX-i.clientX,s=o.clientY-i.clientY,r=this._rcBounds,a=this._edges,l=Popup._SZ_MIN,h=wijmo_1.Rect.fromBoundingRect(r);if(a){var u=window.getComputedStyle(e),c=parseInt(u.getPropertyValue("min-width"))||l,p=parseInt(u.getPropertyValue("min-height"))||l;if(a&_Edges.Left){var d=h.right-c;h.left=Math.min(h.left+n,d);h.width=Math.max(h.width-n,c)}else a&_Edges.Right&&(h.width=Math.max(h.width+n,c));if(a&_Edges.Top){var m=h.bottom-p;h.top=Math.min(h.top+s,m);h.height=Math.max(h.height-s,p)}else a&_Edges.Bottom&&(h.height=Math.max(h.height+s,p));if(this.onSizeChanging(new PopupBoundsChangingEventArgs(h))){wijmo_1.setCss(e,{left:h.left+window.scrollX,top:h.top+window.scrollY,width:h.width,height:h.height,transform:"none"});this._resized=this._dragged=this._ignoreClick=!0;this.onSizeChanged()}if(!window.ResizeObserver)for(var _=this.hostElement.children,f=0;f<_.length;f++)wijmo_1.Control.invalidateAll(_[f])}else if(this._draggable&&(this._dragged||Math.abs(n)+Math.abs(s)>Popup._DRAG_THRESHOLD)){h.left=Math.max(r.left+n+(o.pageX-o.clientX),50-r.width);h.top=Math.max(r.top+s+(o.pageY-o.clientY),0);if(this.onPositionChanging(new PopupBoundsChangingEventArgs(h))){wijmo_1.setCss(e,{left:h.left,top:h.top,width:h.width,height:h.height,transform:"none"});this._dragged=this._ignoreClick=!0;this.onPositionChanged()}}}};Popup.prototype._getEdges=function(t,e){var i=0;if(this._resizable){var o=t.getBoundingClientRect(),n=Popup._SZ_EDGE;e.clientX-o.left<n&&(i|=_Edges.Left);e.clientY-o.top<n&&(i|=_Edges.Top);o.right-e.clientX<n&&(i|=_Edges.Right);o.bottom-e.clientY<n&&(i|=_Edges.Bottom)}return i};Popup.prototype._ownerClick=function(t){this._toggle(t,PopupTrigger.ClickOwner)};Popup.prototype._ownerDown=function(t){this._wasVisible=this.isVisible;this._toggle(t,PopupTrigger.DownOwner)};Popup.prototype._ownerBlur=function(t){wijmo_1.contains(this._owner,wijmo_1.getActiveElement())||this._toggle(t,PopupTrigger.BlurOwner)};Popup.prototype._ownerEnter=function(t){t.target==this._owner&&this._toggle(t,PopupTrigger.EnterOwner)};Popup.prototype._ownerLeave=function(t){t.target==this._owner&&this._toggle(t,PopupTrigger.LeaveOwner)};Popup.prototype._toggle=function(t,e){var i=this;t instanceof MouseEvent&&(Popup._evtHover=t);if(!("mouseenter"==t.type&&Date.now()-this._lastShow<300||t.defaultPrevented)){var o=0!=(this._hideTrigger&e),n=0!=(this._showTrigger&e),s=PopupTrigger;(o||n)&&this._clearTimeouts();o&&this.isVisible&&(e&s.Leave?this._toHideLeave=setTimeout((function(){var t=Popup._evtHover,e=t?document.elementFromPoint(t.clientX,t.clientY):null;e&&wijmo_1.contains(i.hostElement,e,!0)||i.hide()}),wijmo_1.Control._LEAVE_DELAY):e&s.Blur?this._toHideBlur=setTimeout((function(){i.containsFocus()||wijmo_1.contains(i._owner,wijmo_1.getActiveElement())||i.hide()}),wijmo_1.Control._FOCUS_INTERVAL+50):this.hide());n&&e!=s.ClickPopup&&(this._wasVisible||(e&s.Enter?this._toShow=setTimeout((function(){i.show()}),wijmo_1.Control._HOVER_DELAY):this.show()))}};Popup.prototype._getHeaderElement=function(){var t=this.hostElement;return t.querySelector("."+exports.PopupClsNames.dialogHeader)||t.querySelector(".modal-header")};Popup.prototype._getClosestHeader=function(t){return wijmo_1.closest(t,"."+exports.PopupClsNames.dialogHeader)||wijmo_1.closest(t,".modal-header")};Popup.prototype._showBackdrop=function(){var t=this;if(!this._bkDrop){this._bkDrop=document.createElement("div");this._bkDrop.tabIndex=-1;wijmo_1.setAttribute(this._bkDrop,"role","presentation");wijmo_1.setAttribute(this._bkDrop,"aria-hidden","true");wijmo_1.setAttribute(this._bkDrop,"aria-label",wijmo_1.culture.Popup.ariaLabels.backdrop);wijmo_1.addClass(this._bkDrop,exports.PopupClsNames.popupBackDrop);this.addEventListener(this._bkDrop,"mousedown",(function(e){e.preventDefault();e.stopPropagation();t.hostElement.focus();t.hideTrigger&PopupTrigger.Blur&&t.hide()}))}wijmo_1.setCss(this._bkDrop,{zIndex:wijmo_1.Control._POPUP_ZINDEX,display:""});var e=this.hostElement;e.parentElement.insertBefore(this._bkDrop,e)};Popup.prototype._validateAndHide=function(t){var e=this.hostElement;if(e instanceof HTMLFormElement)e.reportValidity()&&this.hide(t);else{var i=this.hostElement.querySelector(":invalid");i?i.focus():this.hide(t)}};Popup.prototype._updateAriaLabel=function(){this.hostElement&&(this.ariaLabelledBy?this._updateAriaLabelImp(""):this._updateAriaLabelImp(this._ariaLabel))};Popup.prototype._updateAriaLabelImp=function(t){var e=[];this.isDraggable&&e.push(wijmo_1.culture.Popup.ariaLabels.isDraggable);this.isResizable&&e.push(wijmo_1.culture.Popup.ariaLabels.isResizable);this.isVisible?e.push(wijmo_1.culture.Popup.ariaLabels.popupVisible):e.push(wijmo_1.culture.Popup.ariaLabels.popupHide);var i=e.join(",");wijmo_1.setAttribute(this.hostElement,"aria-label",t?t+" "+i:i)};Popup.prototype.dispose=function(){Popup._PopupInstanceCount--;0===Popup._PopupInstanceCount&&Popup._evtHover&&(Popup._evtHover=null);this._clearTimeouts();if(this._toHidePopupTimer){clearTimeout(this._toHidePopupTimer);this._toHidePopupTimer=null}if(this._toGetFocusTimer){clearTimeout(this._toGetFocusTimer);this._toGetFocusTimer=null}if(this._hideTimer){clearTimeout(this._hideTimer);this._hideTimer=null}this._hideAnim.forEach((function(t){return clearInterval(t)}));this._hideAnim=[];var e=this.hostElement;if(e)for(var i=e.querySelectorAll("."+exports.DropDownClsNames.hostElement),o=0;o<i.length;o++){var n=wijmo_1.Control.getControl(i[o]);n&&n instanceof DropDown&&n.dispose()}this._initialOwner.appendChild(this.hostElement);this._initialOwner=null;this.owner=null;if(this._bkDrop){this._bkDrop.remove();this._bkDrop=null}this._callback=null;t.prototype.dispose.call(this)};Popup._DRAG_THRESHOLD=6;Popup._SZ_EDGE=10;Popup._SZ_MIN=40;Popup._PopupInstanceCount=0;return Popup}(wijmo_1.Control);exports.Popup=Popup;var PopupBoundsChangingEventArgs=function(t){__extends(PopupBoundsChangingEventArgs,t);function PopupBoundsChangingEventArgs(e){var i=t.call(this)||this;i._rc=e;return i}Object.defineProperty(PopupBoundsChangingEventArgs.prototype,"bounds",{get:function(){return this._rc},enumerable:!0,configurable:!0});return PopupBoundsChangingEventArgs}(wijmo_1.CancelEventArgs);exports.PopupBoundsChangingEventArgs=PopupBoundsChangingEventArgs;wijmo_1._addCultureInfo("InputDate",{ariaLabels:{inputDateInput:"InputDate Input",inputDate:"Input Date",button:"Choose Date",dialog:"Calendar"}});var InputDateEventArgs=function(t){__extends(InputDateEventArgs,t);function InputDateEventArgs(e){var i=t.call(this)||this;i._isUserInput=e;return i}Object.defineProperty(InputDateEventArgs.prototype,"isUserInput",{get:function(){return this._isUserInput},enumerable:!0,configurable:!0});return InputDateEventArgs}(wijmo_1.CancelEventArgs);exports.InputDateEventArgs=InputDateEventArgs;var InputDate=function(t){__extends(InputDate,t);function InputDate(e,i){var o=t.call(this,e)||this;o._fmt="d";o._sep=" - ";o._rngs=null;o._showCal=!1;o._clsOnSel=!0;o._handleWheel=!0;o._preserveCalendarNavigation=!0;o._isTriggered=!1;o._rangeChanged=!1;o._textInitialized=!1;o._previousText="";o._keepInvalidText=!1;o._inputAriaLabel=wijmo_1.culture.InputDate.ariaLabels.inputDateInput;o._currentInput="";o._ariaLabelledby=null;o.valueChanged=new wijmo_1.Event;o.rangeEndChanged=new wijmo_1.Event;o.rangeChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.InputDateClsNames.hostElement);var n=wijmo_1.culture.InputDate.ariaLabels;wijmo_1.setAttribute(o._btn.querySelector("button"),"aria-haspopup","dialog");wijmo_1.setAttribute(o._dropDown,"role","dialog");wijmo_1.setAriaLabel(o._dropDown,n.dialog);wijmo_1.setAttribute(o._dropDown,"aria-modal",!0);wijmo_1.setAttribute(o._tbx,"role","combobox");wijmo_1.setAttribute(o._tbx,"aria-haspopup","dialog");wijmo_1.setAriaLabel(o._btn.querySelector("button"),n.button);o.dropDown.id=wijmo_1.getUniqueId(o.hostElement.id+"_dropdown");o._msk=new wijmo_1._MaskProvider(o._tbx);var s=o.addEventListener.bind(o);wijmo_1.isIE9()||(o.inputType="tel");o._tbx.type.match(/^(tel|text|)$/i)||(o.inputType="text");var r=o._mouseWheel.bind(o);s(o.hostElement,"wheel",r);var a=o._lbx=new ListBox(document.createElement("div"),{displayMemberPath:"name",selectedIndexChanged:function(t){var e=t.selectedItem,i=wijmo_1.DateTime.fromDateTime,n=wijmo_1.DateTime.sameDate;if(e&&e.from&&e.to){if(!n(e.from,o.value)||!n(e.to,o.rangeEnd)){var s=o.value;o.value=i(e.from,s);o.rangeEnd=i(e.to,s)}o._selectAll()}else o._cal.hostElement.style.display=""}}),l=o._cal=new Calendar(document.createElement("div")),h=o._dropDown;wijmo_1.addClass(h,exports.InputDateClsNames.inputDateDropDown);h.appendChild(a.hostElement);h.appendChild(l.hostElement);o.addEventListener(h,"click",(function(){o._isTriggered=!0;setTimeout((function(){o._isTriggered=!1}),50)}),!0);o.addEventListener(h,"keydown",(function(t){if("Enter"===t.key){o._isTriggered=!0;setTimeout((function(){o._isTriggered=!1}),50)}}),!0);if("INPUT"==o._orgTag){var u=o._tbx.getAttribute("value");u&&(l.value=l.rangeEnd=wijmo_1.Globalize.parseDate(u,"yyyy-MM-dd"))}o.isRequired=!0;o._tbx.value=o._oldText=o._getText();o.initialize(i);var c=wijmo_1.isNullOrUndefined(o.tabOrder)?0:o.tabOrder;l.tabOrder=-1!==c&&o.showConfirmationButtons?c:-1;a.tabOrder=c;if(o._textInitialized||o._tbx.value!==o._oldText){o._oldText=o._tbx.value;o._currentInput="text";o._textInitialized=!0;o._commitText();o.onTextChanged()}o._updateState();l.valueChanged.addHandler((function(t,e){o._refreshText();o.onValueChanged(e)}));l.rangeEndChanged.addHandler((function(t,e){if(l._rngMode()){o.onRangeEndChanged(e);o._closeOnChange();l._clearingRangeEnd||o._refreshText()}}));l.cancelButtonClicked.addHandler((function(t,e){o.isDroppedDown=!1}));l.OKButtonClicked.addHandler((function(t,e){o._closeOnChange();o._refreshText()}));l._enterKeyDownToSetValue.addHandler((function(t,e){o._closeOnChange()}));l.addEventListener(l.hostElement,"click",(function(t){if(l.selectionMode&&!l._rngMode()){var e=t.target,i=l.hitTest(e);if(wijmo_1.DateTime.sameDate(o.value,i)||wijmo_1.closest(e,"[wj-part=btn-today]")){o._closeOnChange();o._refreshText()}}}));o._updateInputAriaLabel();return o}Object.defineProperty(InputDate,"controlTemplate",{get:function(){InputDate._ctrlTemplate||(InputDate._ctrlTemplate=DropDown.controlTemplate);return InputDate._ctrlTemplate},set:function(t){InputDate._ctrlTemplate=t},enumerable:!0,configurable:!0});InputDate.prototype._mouseWheel=function(t){if(this.handleWheel&&!t.defaultPrevented&&!this.isDroppedDown&&this.containsFocus()&&null!=this.value&&this._canChangeValue()){var e=this._tbx,i=e.selectionStart,o=e.selectionEnd,n=wijmo_1.clamp(-t.deltaY,-1,1),s=this.value,r=wijmo_1.Globalize.getFullFormat(this.format);null==r&&(r=this.format);var a=r.match(wijmo_1.getSpecialCharsRegex());if(o-i===e.value.length&&null!=a||this.selectionMode==DateSelectionMode.Range){for(var l=1;;l++){s=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,l*n):wijmo_1.DateTime.addDays(this.value,l*n);if(this._isValidDate(s)||!(null===this.max||s<this.max)||!(null===this.min||s>this.min))break}this.value=s;var h=this._getText();wijmo_1.setSelectionRange(e,0,h.length)}else this._updateDateTimeValue(n,a,r);t.preventDefault()}};Object.defineProperty(InputDate.prototype,"value",{get:function(){return this._cal.value},set:function(t){this._cal.value=t;(this.text||this.isRequired)&&this._refreshText()},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"rangeEnd",{get:function(){return this._cal.rangeEnd},set:function(t){this._cal.rangeEnd=t;(this.text||this.isRequired)&&this._refreshText()},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"rangeMin",{get:function(){return this._cal.rangeMin},set:function(t){this._cal.rangeMin=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"rangeMax",{get:function(){return this._cal.rangeMax},set:function(t){this._cal.rangeMax=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"keepInvalidText",{get:function(){return this._keepInvalidText},set:function(t){if(new Set(["InputDateTime","WjInputDateTime"]).has(this.constructor.name)){this._keepInvalidText=!1;throw"keepInvalidText property cannot be used with InputDateTime control"}this._keepInvalidText=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"text",{get:function(){return this._tbx.value},set:function(t){var e=(t||"").toString();if(e!=this.text){e!=this._tbx.value&&(this._tbx.value=e);if(e!=this._oldText){this._oldText=e;this._previousText=e}if(wijmo_1.isEmpty(this._currentInput)){this._textInitialized=!0;this._currentInput="text";this._commitText()}this.onTextChanged();this._currentInput=""}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"format",{get:function(){return this._fmt},set:function(t){if(t!=this.format){this._fmt=wijmo_1.asString(t);this._refreshText()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"separator",{get:function(){return this._sep},set:function(t){if(t!=this._sep){this._sep=wijmo_1.asString(t,!1);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"mask",{get:function(){return this._msk.mask},set:function(t){this._msk.mask=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"closeOnSelection",{get:function(){return this._clsOnSel},set:function(t){this._clsOnSel=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(t){t=wijmo_1.asBoolean(t);this._handleWheel=t;t||(this.calendar.handleWheel=t)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"predefinedRanges",{get:function(){return this._rngs},set:function(t){if(this._rngs!=t){wijmo_1.assert(null==t||wijmo_1.isObject(t),"Object expected");this._rngs=t;this._lbx.itemsSource=this._getRanges(t);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"alwaysShowCalendar",{get:function(){return this._showCal},set:function(t){this._showCal=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"min",{get:function(){return this._cal.min},set:function(t){this._cal.min=wijmo_1.asDate(t,!0)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"max",{get:function(){return this._cal.max},set:function(t){this._cal.max=wijmo_1.asDate(t,!0)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"repeatButtons",{get:function(){return this._cal.repeatButtons},set:function(t){this._cal.repeatButtons=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"showYearPicker",{get:function(){return this._cal.showYearPicker},set:function(t){this._cal.showYearPicker=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"showMonthPicker",{get:function(){return this._cal.showMonthPicker},set:function(t){this._cal.showMonthPicker=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"showHeader",{get:function(){return this._cal.showHeader},set:function(t){this._cal.showHeader=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"weeksBefore",{get:function(){return this._cal.weeksBefore},set:function(t){this._cal.weeksBefore=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"weeksAfter",{get:function(){return this._cal.weeksAfter},set:function(t){this._cal.weeksAfter=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"selectionMode",{get:function(){return this._cal.selectionMode},set:function(t){if(t!=this.selectionMode){this._cal.selectionMode=t;this._refreshText()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"monthCount",{get:function(){return this._cal.monthCount},set:function(t){this._cal.monthCount=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"calendar",{get:function(){return this._cal},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"inputType",{get:function(){return this._tbx.type},set:function(t){t.match(/^(tel|text|)$/i)?this._tbx.type=wijmo_1.asString(t):console.warn("invalid input type '"+t+"', don't use any input types other than 'tel' or 'text'")},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"preserveCalendarNavigation",{get:function(){return this._preserveCalendarNavigation},set:function(t){this._preserveCalendarNavigation=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"itemValidator",{get:function(){return this._cal.itemValidator},set:function(t){if(t!=this.itemValidator){this._cal.itemValidator=wijmo_1.asFunction(t);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"itemFormatter",{get:function(){return this._cal.itemFormatter},set:function(t){this._cal.itemFormatter=wijmo_1.asFunction(t)},enumerable:!0,configurable:!0});InputDate.prototype.onValueChanged=function(t){this.valueChanged.raise(this,t)};InputDate.prototype.onRangeEndChanged=function(t){this.rangeEndChanged.raise(this,t);this.rangeEnd&&(this.isDroppedDown?this._rangeChanged=!0:this.onRangeChanged(t))};InputDate.prototype.onRangeChanged=function(t){this._rangeChanged=!1;this.rangeChanged.raise(this,t)};InputDate.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);if(this.hostElement){this._msk&&this._msk.refresh();this._cal&&this._cal.refresh();this._refreshText()}};InputDate.prototype.onIsDroppedDownChanging=function(e){if(this.isDroppedDown);else{var i=this._lbx,o=this._cal,n=i.collectionView,s=i.hostElement.style,r=o.hostElement.style;if(o._rngMode()&&wijmo_1.hasItems(n)){var a=this._updateRangeSelection();s.display="";r.display=!this._showCal&&a&&a.from&&n.items.some((function(t){return!t.to}))?"none":""}else{s.display="none";r.display=""}o._mthMode()||(o.monthView=!0);o.value&&!this.preserveCalendarNavigation&&(o.displayMonth=o.value)}return t.prototype.onIsDroppedDownChanging.call(this,e)};InputDate.prototype.onIsDroppedDownChanged=function(e){t.prototype.onIsDroppedDownChanged.call(this,e);var i=this.containsFocus();if(this.isDroppedDown){i&&(this._tryFocus(this._cal)||this._tryFocus(this._lbx)||this.dropDown.focus());this._lbx.showSelection();this._cal.refresh()}else{this._commitText();this._rangeChanged&&this.onRangeChanged()}};InputDate.prototype._updateDropDown=function(){this._commitText();var e=getComputedStyle(this.hostElement);this._dropDown.style.minWidth=18*parseFloat(e.fontSize)+"px";this._cal.refresh();t.prototype._updateDropDown.call(this)};InputDate.prototype.onGotFocus=function(t){var e=this._tbx;this._elRef==e&&(this.isDroppedDown?this.dropDown.focus():this.selectAll());this.containsFocus()||this.focus();this.gotFocus.raise(this,t)};InputDate.prototype._keydown=function(e){if(!(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)){this._isInvalidInputCancelled=!1;if(this._isHiddenEditor())return;var i=wijmo_1.getActiveElement();switch(e.keyCode){case wijmo_1.Key.Enter:if(this.showConfirmationButtons&&i!==this._tbx)return;this._currentInput="user";this._textInitialized=!1;this._commitText(!1,!0);break;case wijmo_1.Key.Escape:this.text=this._getText();this.selectAll();break;case wijmo_1.Key.Tab:if(this.showConfirmationButtons&&i!==this._tbx){var o=wijmo_1._getFocusableElements(this._dropDown).filter((function(t){return!(t.classList.contains("wj-control")&&t.classList.contains("wj-calendar"))})),n=o[0],s=o[o.length-1];if(e.shiftKey){if(i===n){e.preventDefault();s.focus()}}else if(i===s){e.preventDefault();n.focus()}}else if(this.isDroppedDown){this.isDroppedDown=!1;this.containsFocus()||this.focus();this.keyActionTab===TabKeyAction.CloseAndKeepFocus&&e.preventDefault()}this._currentInput="user";this._textInitialized=!1;this._commitText(!0);break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(e.keyCode===wijmo_1.Key.Up&&this.keyActionUpArrow===KeyAction.OpenDropdown||e.keyCode===wijmo_1.Key.Down&&this.keyActionDownArrow===KeyAction.OpenDropdown)break;if(!this.isDroppedDown&&this.value&&this._canChangeValue()){this._currentInput="user";this._textInitialized=!1;var r=this._tbx,a=r.selectionStart,l=r.selectionEnd,h=(r.value,e.keyCode==wijmo_1.Key.Up?1:-1),u=this.value,c=wijmo_1.Globalize.getFullFormat(this.format);if("g"==this.format&&c.includes("г")){c=c.replace(/\"г.\" /,"")}null==c&&(c=this.format);var p=c.match(wijmo_1.getSpecialCharsRegex());if(l-a===r.value.length&&null!=p||this.selectionMode==DateSelectionMode.Range){for(var d=1;;d++){u=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,d*h):wijmo_1.DateTime.addDays(this.value,d*h);if(this._isValidDate(u)||!(null===this.max||u<this.max)||!(null===this.min||u>this.min))break}this.value=u;var m=this._getText();wijmo_1.setSelectionRange(r,0,m.length)}else this._updateDateTimeValue(h,p,c);e.preventDefault()}}}t.prototype._keydown.call(this,e)};InputDate.prototype._expandSelection=function(){if(this._cal._rngMode()){var e=this._tbx,i=e.value,o=e.selectionStart,n=e.selectionEnd,s=this._sep,r=i.indexOf(s);r>-1&&o==n&&(n<=r?wijmo_1.setSelectionRange(e,0,r):o>=r+s.length&&wijmo_1.setSelectionRange(e,r+s.length,e.value.length))}else t.prototype._expandSelection.call(this)};InputDate.prototype._updateDateTimeValue=function(t,e,i){var o=this._tbx,n=o.selectionStart,s=o.value,r=this.value,a={},l={},h=0,u=0,c=0,p=[],d=[],m=o.value.match(wijmo_1.getSpecialCharsRegex());if(null==e||null==m){p=[this.format];d=["0"];e=[""]}else{e.forEach((function(t,o){var n=t.replaceAll('"',""),r=i.substring(h),c=s.substring(u),p=r.indexOf(t),d=c.indexOf(n);if(-1==d){var _=m[o];d=c.indexOf(_)}var f=r.substring(0,p);if(""!=f){a[f]=h;l[f]=u}h=h+p+t.length;u=u+d+n.length;if(o==e.length-1){f=i.substring(h);a[f]=h;l[f]=u}}));p=Object.keys(a);d=Object.values(l)}var _=d.filter((function(t){return n>=parseInt(t.toString())}));_.length>0&&(c=_.length-1);for(var f=p[c],b=1;;b++){-1!=f.indexOf("d")?r=wijmo_1.DateTime.addDays(this.value,b*t):-1!=f.indexOf("M")?r=wijmo_1.DateTime.addMonths(this.value,b*t):-1!=f.indexOf("y")&&(r=wijmo_1.DateTime.addYears(this.value,b*t));if(this._isValidDate(r)||!(null===this.max||r<this.max)||!(null===this.min||r>this.min))break}this.value=r;this._reselectText(e,c)};InputDate.prototype._reselectText=function(t,e){var i=this._getText(),o=this._tbx,n=0,s=-1,r=-1;if(1==t.length&&""==t[0]){s=0;r=i.length}else{var a=o.value.match(wijmo_1.getSpecialCharsRegex());t.forEach((function(t,o){var l=t.replaceAll('"',""),h=i.substring(n);if(h.startsWith("г.")){h=h.replace("г. ","");n+="г. ".length}var u=h.indexOf(l);0==u&&e++;if(-1==u){var c=a[o];u=h.indexOf(c)}var p=-1===u?h:h.substring(0,u);o==e&&-1==s&&(r=(s=n)+p.length);n=n+u+l.length}))}if(-1==s){s=n;r=o.value.length}wijmo_1.setSelectionRange(o,s,r)};InputDate.prototype._refreshText=function(){var t=this._getText();if(t!=this.text||t!==this._oldText){this._tbx.value=this._oldText=this._previousText=t;this.onTextChanged()}};InputDate.prototype._selectAll=function(){this.isDroppedDown||!this.containsFocus()||this.isTouching||this.selectAll()};InputDate.prototype._closeOnChange=function(){var t=this;if(this._clsOnSel&&this._isTriggered){var e=this._cal;(!e._rngMode()||e.value&&e.rangeEnd)&&setTimeout((function(){t._isInvalidInputCancelled=!1;t.isDroppedDown=!1}))}};InputDate.prototype._tryFocus=function(t){var e=t.hostElement;if(e&&e.offsetHeight){e.focus();return!0}return!1};InputDate.prototype._clamp=function(t){return this._cal._clamp(t)};InputDate.prototype._getText=function(){var t=wijmo_1.Globalize.format,e=this._fmt,i=t(this.value,e);this._cal._rngMode()&&i&&(this.rightToLeft?i=t(this.rangeEnd,e)+this._sep+i:i+=this._sep+t(this.rangeEnd,e));return i};InputDate.prototype._commitText=function(t,e){var i=this._tbx.value;this._isInvalidInputCancelled=!1;if(wijmo_1.isEmpty(this._currentInput)){this._textInitialized=!1;this._currentInput="user"}var o=!1,n=this._fmt,s=this._cal,r=wijmo_1.Globalize.parseDate,a=new InputDateEventArgs(!this._textInitialized);if(i)if(s._rngMode()){var l=i.split(this._sep),h=this.rightToLeft?l[1]:l[0];if(2==l.length&&h){if(c=r(h,n,this.value)){var u=r(this.rightToLeft?l[0]:l[1],n,this.value);if(wijmo_1.DateTime.sameDate(c,this._clamp(c)))o=!0;else if(this._shouldRaiseInvalidInput(e)&&this.onInvalidInput(a))this._textInitialized&&this._keepInvalidText||(o=!0);else{this._selectAll();o=!1}if(o)if(u){s.value=this._fromDateTime(c);if(wijmo_1.DateTime.sameDate(u,this._clamp(u))){s.rangeEnd=u&&u>=c?this._fromDateTime(u):c;this.text=this._getText()}else this._triggerInvalidInputEvent(a,c,u,e)}else if(this._shouldRaiseInvalidInput(e)&&this.onInvalidInput(a)){if(!this._textInitialized||!this._keepInvalidText){s.value=this._fromDateTime(c);s.rangeEnd=c;this.text=this._getText()}}else{this._isInvalidInputCancelled=!0;this._selectAll()}}else this._nullValueInvalidInput(a,e)}else this._nullValueInvalidInput(a,e)}else{(c=r(i,n,this.value))?wijmo_1.DateTime.sameDate(c,this._clamp(c))?this.value=this._fromDateTime(c):this._triggerInvalidInputEvent(a,c,null,e):this._nullValueInvalidInput(a,e)}else if(this.isRequired){var c;(c=r(i,n,this.value))?this.value=this._fromDateTime(c):this.containsFocus()||(this.text=this._getText())}else this.value=this.rangeEnd=null;this._currentInput="";t||this._selectAll()};InputDate.prototype._triggerInvalidInputEvent=function(t,e,i,o){if(this._shouldRaiseInvalidInput(o)&&this.onInvalidInput(t)){if(!this._textInitialized||!this._keepInvalidText){this.value=this._fromDateTime(e);this.calendar._rngMode()&&(this.calendar.rangeEnd=i&&i>=e?this._fromDateTime(i):e)}}else{this.isDroppedDown||!this.containsFocus()||this.isTouching||this.focus();this._isInvalidInputCancelled=!0;this._selectAll()}};InputDate.prototype._nullValueInvalidInput=function(t,e){if(this._shouldRaiseInvalidInput(e)&&this.onInvalidInput(t))this._textInitialized&&this._keepInvalidText||(this.text=this._getText());else{this.isDroppedDown||!this.containsFocus()||this.isTouching||this.focus();this._isInvalidInputCancelled=!0;this._selectAll()}};InputDate.prototype._fromDateTime=function(t){return wijmo_1.DateTime.fromDateTime(t,this.value)};InputDate.prototype._canChangeValue=function(){return!this.isReadOnly&&!this.isDisabled&&this.selectionMode!=DateSelectionMode.None};InputDate.prototype._isValidDate=function(t){if(t){if(this._clamp(t)!=t)return!1;if(this.itemValidator&&!this.itemValidator(t))return!1}return!0};InputDate.prototype._getRanges=function(t){var e=[];if(wijmo_1.isObject(t))for(var i in t){var o=t[i];e.push({name:i,from:o?o[0]:null,to:o?o[1]:null})}return new wijmo_1.CollectionView(e,{currentItem:null})};InputDate.prototype._updateRangeSelection=function(){var t=this._lbx,e=-1;if(wijmo_1.hasItems(t.collectionView))for(var i=this._lbx.collectionView.items,o=wijmo_1.DateTime.sameDate,n=0;n<i.length;n++){var s=i[n];if(s.from){if(o(s.from,this.value)&&o(s.to,this.rangeEnd)){e=n;break}}else e=n}t.selectedIndex=e;return t.selectedItem};InputDate.prototype._copy=function(t,e){if("text"===t){var i=(e||"").toString();if(i!==this.text){this._tbx.value=i;this._textInitialized=!0}return!0}return!1};Object.defineProperty(InputDate.prototype,"showConfirmationButtons",{get:function(){return this._showConfirmationButtons},set:function(t){this._showConfirmationButtons=t;this._cal.focusMode=t;this._cal.showConfirmationButtons=t;var e=wijmo_1.isNullOrUndefined(this.tabOrder)?0:this.tabOrder;this._cal.tabOrder=t?e:-1;this._cal.keyActionTab=t?CalendarTabKeyAction.All:CalendarTabKeyAction.None},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(t){wijmo_1._setAriaLabelBy(this,this._tbx,t,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});InputDate.prototype._updateInputAriaLabel=function(){this._tbx&&(this._tbx.id||this.ariaLabelledBy?wijmo_1.setAriaLabel(this._tbx,null):wijmo_1.setAriaLabel(this._tbx,this._inputAriaLabel))};InputDate.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputDate.ariaLabels.inputDate};InputDate._ctrlTemplate="";return InputDate}(DropDown);exports.InputDate=InputDate;wijmo_1._addCultureInfo("InputDateRange",{ariaLabels:{inputDateRangeInput:"InputDateRange Input"}});var InputDateRange=function(t){__extends(InputDateRange,t);function InputDateRange(e,i){var o=t.call(this,e,__assign({selectionMode:DateSelectionMode.Range,showMonthPicker:"Outside",monthCount:2},i&&!wijmo_1.isNullOrUndefined(i.tabOrder)?{tabOrder:i.tabOrder}:{}))||this;o._inputAriaLabel=wijmo_1.culture.InputDateRange.ariaLabels.inputDateRangeInput;wijmo_1.addClass(o.hostElement,exports.InputDateRangeClsNames.hostElement);o._tbx.value=o._oldText=o._getText();o.initialize(i);if(o._tbx.value!==o._oldText){o._oldText=o._tbx.value;o._currentInput="text";o._commitText()}o._updateInputAriaLabel();return o}Object.defineProperty(InputDateRange,"controlTemplate",{get:function(){InputDateRange._ctrlTemplate||(InputDateRange._ctrlTemplate=InputDate.controlTemplate);return InputDateRange._ctrlTemplate},set:function(t){InputDateRange._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDateRange.prototype,"selectionMode",{get:function(){return this.calendar.selectionMode},set:function(t){t=wijmo_1.asEnum(t,DateSelectionMode);wijmo_1.assert(t==DateSelectionMode.Range,'InputDateRange.selectionMode must be "Range"');this.calendar.selectionMode=t},enumerable:!0,configurable:!0});InputDateRange.prototype._mouseWheel=function(t){if(!t.defaultPrevented&&!this.isDroppedDown&&this.containsFocus()&&null!=this.value&&this._canChangeValue()){var e=wijmo_1.clamp(-t.deltaY,-1,1),i=this.value;this.value=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(i,e):wijmo_1.DateTime.addDays(i,e);this.selectAll();t.preventDefault()}};InputDateRange.prototype.onGotFocus=function(t){var e=this._tbx;this._elRef!=e||this.isDroppedDown||this.selectAll();this.containsFocus()||this.focus();this.gotFocus.raise(this,t)};InputDateRange.prototype._keydown=function(e){if(!(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)){this._isInvalidInputCancelled=!1;if(this._isHiddenEditor())return;switch(e.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(e.keyCode===wijmo_1.Key.Up&&this.keyActionUpArrow===KeyAction.OpenDropdown||e.keyCode===wijmo_1.Key.Down&&this.keyActionDownArrow===KeyAction.OpenDropdown)break;if(!this.isDroppedDown&&this.value&&this._canChangeValue()){var i=e.keyCode==wijmo_1.Key.Up?1:-1,o=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,i):wijmo_1.DateTime.addDays(this.value,i);this.value=this._fromDateTime(o);this.selectAll();e.preventDefault()}}}t.prototype._keydown.call(this,e)};InputDateRange._ctrlTemplate="";return InputDateRange}(InputDate);exports.InputDateRange=InputDateRange;wijmo_1._addCultureInfo("InputColor",{ariaLabels:{inputColor:"Input Color",inputColorInput:"InputColor Input",button:"Choose Color",dialog:"ColorPicker"}});var InputColor=function(t){__extends(InputColor,t);function InputColor(e,i){var o=t.call(this,e)||this;o._textInitialized=!1;o._ariaLabelledby=null;o._inputAriaLabel=wijmo_1.culture.InputColor.ariaLabels.inputColorInput;o.valueChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.InputColorClsNames.hostElement);wijmo_1.setAttribute(o._dropDown,"role","dialog");wijmo_1.setAriaLabel(o._dropDown,wijmo_1.culture.InputColor.ariaLabels.dialog);wijmo_1.setAttribute(o._dropDown,"aria-modal",!0);wijmo_1.setAttribute(o._tbx,"role","combobox");wijmo_1.setAttribute(o._tbx,"aria-haspopup","dialog");wijmo_1.setAttribute(o._btn.querySelector("button"),"aria-haspopup","dialog");wijmo_1.setAriaLabel(o._btn.querySelector("button"),wijmo_1.culture.InputColor.ariaLabels.button);o.dropDown.id=wijmo_1.getUniqueId(o.hostElement.id+"_dropdown");var n='<div class="'+exports.InputColorClsNames.inputColorBox+'"></div>';o._ePreview=wijmo_1.createElement(n,o.hostElement.firstElementChild);if("INPUT"==o._orgTag){o._tbx.type="";o._commitText()}o.value="#ffffff";o.isRequired=!0;o._tbx.value=o._oldText=o.value;o.initialize(i);if(o._textInitialized&&o._tbx.value!==o._oldText){o._oldText=o._tbx.value;o.onTextChanged();o._commitText();o._textInitialized=!1}o.addEventListener(o._colorPicker.hostElement,"click",(function(t){var e=t.target;if(e&&"DIV"==e.tagName&&(wijmo_1.closest(e,'[wj-part="div-pal"]')||wijmo_1.closest(e,'[wj-part="div-pv"]'))){e.style.backgroundColor&&(o.isDroppedDown=!1)}}));var s=!i||-1!==i.tabOrder&&i.colorPickerKeyActionTab!==ColorPickerTabKeyAction.None?0:-1;o._colorPicker.tabOrder=s;o._updateInputAriaLabel();return o}Object.defineProperty(InputColor,"controlTemplate",{get:function(){InputColor._ctrlTemplate||(InputColor._ctrlTemplate=DropDown.controlTemplate);return InputColor._ctrlTemplate},set:function(t){InputColor._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"value",{get:function(){return this._value},set:function(t){this.text=t},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"text",{get:function(){return this._tbx.value},set:function(t){if((t=wijmo_1.asString(t))!=this.text&&(t||!this.isRequired)&&(!t||wijmo_1.Color.fromString(t.replace(/\s+/g,"")))){this._setText(t,!0);this._commitText()}},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"inputType",{get:function(){return this._tbx.type},set:function(t){t.match(/^(tel|text|)$/i)?this._tbx.type=wijmo_1.asString(t):console.warn("invalid input type '"+t+"', don't use any input types other than 'tel' or 'text'")},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"showAlphaChannel",{get:function(){return this._colorPicker.showAlphaChannel},set:function(t){this._colorPicker.showAlphaChannel=t},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"showColorString",{get:function(){return this._colorPicker.showColorString},set:function(t){this._colorPicker.showColorString=t},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"palette",{get:function(){return this._colorPicker.palette},set:function(t){this._colorPicker.palette=t},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"colorPicker",{get:function(){return this._colorPicker},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(t){wijmo_1._setAriaLabelBy(this,this._tbx,t,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"colorPickerKeyActionTab",{get:function(){return this.colorPicker.keyActionTab},set:function(t){this.colorPicker.keyActionTab=t},enumerable:!0,configurable:!0});InputColor.prototype.onValueChanged=function(t){this.valueChanged.raise(this,t)};InputColor.prototype.onIsDroppedDownChanged=function(e){t.prototype.onIsDroppedDownChanged.call(this,e);if(this.isDroppedDown&&!this.isTouching){this.colorPicker._refreshSelection();var i=this._tbx;this._elRef==i&&wijmo_1.setSelectionRange(i,0,this.text.length,!1);this.containsFocus()||this.focus()}};InputColor.prototype._createDropDown=function(){var t=this;this._colorPicker=new ColorPicker(this._dropDown);wijmo_1.setCss(this._dropDown,{minWidth:420,minHeight:200});this._colorPicker.valueChanged.addHandler((function(){t.value=t._colorPicker.value}))};InputColor.prototype._keydown=function(e){if(!e.defaultPrevented)switch(e.keyCode){case wijmo_1.Key.Enter:this._commitText();this.selectAll();break;case wijmo_1.Key.Escape:this.text=this.value;this.selectAll();break;case wijmo_1.Key.Tab:var i=wijmo_1.getActiveElement();if(this.colorPicker.keyActionTab===ColorPickerTabKeyAction.All&&i!==this._tbx){var o=wijmo_1._getFocusableElements(this.colorPicker.hostElement),n=o[0],s=o[o.length-1];if(e.shiftKey){if(i===n){e.preventDefault();s.focus()}}else if(i===s){e.preventDefault();n.focus()}}else if(this.isDroppedDown){this.isDroppedDown=!1;this.containsFocus()||this.focus();this.keyActionTab===TabKeyAction.CloseAndKeepFocus&&e.preventDefault()}}t.prototype._keydown.call(this,e)};InputColor.prototype._commitText=function(){if(this._value!=this.text){var t=!this.text||!this.text.trim();if(!this.isRequired&&t){this._value="";this._ePreview.style.backgroundColor="";this.onValueChanged();return}if(wijmo_1.Color.fromString(this.text.replace(/\s+/g,""))){if(this.text&&this.text!==this.text.replace(/\s+/g,"")){this.text=this.text.replace(/\s+/g,"");return}var e=this._colorPicker;e.value=this.text;this._value=e.value;this._ePreview.style.backgroundColor=this.value;this.onValueChanged()}else this.onInvalidInput(new wijmo_1.CancelEventArgs)&&(this.text=this._value?this._value:"")}};InputColor.prototype._copy=function(t,e){if("text"===t){var i=(e||"").toString();if(i!==this.text){this._tbx.value=i;this._textInitialized=!0}return!0}return!1};InputColor.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputColor.ariaLabels.inputColor};InputColor.prototype._updateInputAriaLabel=function(){this._tbx&&(this._tbx.id||this.ariaLabelledBy?wijmo_1.setAriaLabel(this._tbx,null):wijmo_1.setAriaLabel(this._tbx,this._inputAriaLabel))};InputColor._ctrlTemplate="";return InputColor}(DropDown);exports.InputColor=InputColor;wijmo_1._addCultureInfo("ComboBox",{ariaLabels:{comboBoxInput:"ComboBox Input",comboBox:"Combo Box"}});var ComboBox=function(t){__extends(ComboBox,t);function ComboBox(e,i){var o=t.call(this,e)||this;o._editable=!1;o._trimText=!0;o._handleWheel=!0;o._delKey=0;o._draggingText=!1;o._textIsComposing="";o._pathHdr=new wijmo_1.Binding(null);o._bsCollapse=!0;o._fmtItemHandlers=0;o._emptyValueAction=!1;o._oldIndexToBeRestoredOnBlur=null;o._restoreComboboxTbxVal=!1;o._isWheel=!1;o._selItems=null;o._oldFilter=null;o._keyActionPrintCharacters=KeyAction.OpenDropdown;o._inputElementAriaLabel=wijmo_1.culture.ComboBox.ariaLabels.comboBoxInput;o._ariaLabelledby=null;o.itemsSourceChanged=new wijmo_1.Event;o.selectedIndexChanged=new wijmo_1.Event;var n=o.hostElement;wijmo_1.addClass(n,exports.ComboBoxClsNames.hostElement);o.dropDown.id=wijmo_1.getUniqueId(n.id+"_dropdown");o.autoExpandSelection=!1;var s=o._tbx;o.addEventListener(s,"compositionstart",(function(){o._composing=!0}));o.addEventListener(s,"compositionend",(function(){o._textIsComposing=o.text;o._composing=!1;o._setText(o._textIsComposing,!0);if(!o._textIsComposing&&o.isRequired){o._oldText="";o._oldIndexToBeRestoredOnBlur=null}setTimeout((function(){o._textIsComposing=""}))}));o.addEventListener(s,"drag",(function(){o._draggingText=!0}));o.addEventListener(n,"wheel",o._wheel.bind(o));"SELECT"==o._orgTag&&o._lbx._initFromSelect(n);var r=o._lbx;r.loadedItems.addHandler((function(t){o.selectedIndex>-1&&(o.selectedIndex=r.selectedIndex)}));r.tabOrder=-1;o.isRequired=!0;o.initialize(i);o._updateTbxAriaHaspopup();o._updateInputAriaLabel();return o}Object.defineProperty(ComboBox,"controlTemplate",{get:function(){ComboBox._ctrlTemplate||(ComboBox._ctrlTemplate=DropDown.controlTemplate);return ComboBox._ctrlTemplate},set:function(t){ComboBox._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"itemsSource",{get:function(){return this._lbx.itemsSource},set:function(t){if(this._lbx.itemsSource!=t){this._lbx.itemsSource=t;this.onItemsSourceChanged()}this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"collectionView",{get:function(){return this._lbx.collectionView},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"virtualizationThreshold",{get:function(){return this._lbx.virtualizationThreshold},set:function(t){this._lbx.virtualizationThreshold=t},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"showGroups",{get:function(){return this._lbx.showGroups},set:function(t){this._lbx.showGroups=t},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"displayMemberPath",{get:function(){return this._lbx.displayMemberPath},set:function(t){if(this.displayMemberPath!==t){this._lbx.displayMemberPath=t;var e=this._getDisplayText(void 0,void 0,!0);this.text!=e&&this._setText(e,!0)}},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"headerPath",{get:function(){return this._pathHdr.path},set:function(t){this._pathHdr.path=wijmo_1.asString(t);var e=this._getDisplayText(void 0,void 0,!0);this.text!=e&&this._setText(e,!0)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"selectedValuePath",{get:function(){return this._lbx.selectedValuePath},set:function(t){this._lbx.selectedValuePath=t},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"isContentHtml",{get:function(){return this._lbx.isContentHtml},set:function(t){if(t!=this.isContentHtml){this._lbx.isContentHtml=wijmo_1.asBoolean(t);var e=this._getDisplayText(void 0,void 0,!0);this.text!=e&&this._setText(e,!0)}},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"caseSensitiveSearch",{get:function(){return this._lbx.caseSensitiveSearch},set:function(t){this._lbx.caseSensitiveSearch=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"trimText",{get:function(){return this._trimText},set:function(t){if(t!=this._trimText){this._trimText=wijmo_1.asBoolean(t);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"itemFormatter",{get:function(){return this._lbx.itemFormatter},set:function(t){this._lbx.itemFormatter=wijmo_1.asFunction(t);this.selectedIndex=this._lbx.selectedIndex},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"formatItem",{get:function(){return this._lbx.formatItem},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"selectedIndex",{get:function(){return this._lbx.selectedIndex},set:function(t){t!=this.selectedIndex&&wijmo_1.isNumber(t)&&(this._lbx.selectedIndex=t);var e=this._lbx._oldSelectedIndex!=this.selectedIndex;t=this.selectedIndex;var i=this._getDisplayText(t,void 0,!0);if(this.text!=i||e){var o=this._internalSettingText;this._internalSettingText=this._lbx._ignoredItemChangedEvents;this._setText(i,!0);""!=this.text&&(this._emptyValueAction=!1);this._internalSettingText=o}},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"selectedItem",{get:function(){return this._lbx.selectedItem},set:function(t){this._lbx.selectedItem=t},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"selectedValue",{get:function(){return this.collectionView?this._lbx.selectedValue:this.text},set:function(t){this.collectionView?this._lbx.selectedValue=t:null!=t&&(this.text=t.toString())},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"isEditable",{get:function(){return this._editable},set:function(t){this._editable=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(t){this._handleWheel=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"maxDropDownHeight",{get:function(){return this._lbx.maxHeight},set:function(t){this._lbx.maxHeight=t},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"maxDropDownWidth",{get:function(){var t=this._dropDown,e=t?parseInt(t.style.maxWidth):null;return isNaN(e)?null:e},set:function(t){var e=this._dropDown.style;t=wijmo_1.asNumber(t,!0);e.maxWidth=null==t?"":t+"px";e.minWidth=""},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"keyActionPrintCharacters",{get:function(){return this._keyActionPrintCharacters},set:function(t){this._keyActionPrintCharacters=wijmo_1.asEnum(t,KeyAction)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(t){wijmo_1._setAriaLabelBy(this,this._tbx,t,this._updateInputAndListBoxAriaLabel.bind(this))},enumerable:!0,configurable:!0});ComboBox.prototype._updateInputAndListBoxAriaLabel=function(){this._updateInputAriaLabel()};ComboBox.prototype.getDisplayText=function(t,e){void 0===t&&(t=this.selectedIndex);void 0===e&&(e=this._trimText);return this._getDisplayText(t,e)};ComboBox.prototype._getDisplayText=function(t,e,i){void 0===t&&(t=this.selectedIndex);void 0===e&&(e=this._trimText);var o,n=this.collectionView;if(this.headerPath&&t>-1&&wijmo_1.hasItems(n)){var s=n.items[t];o=null!=(o=s?this._pathHdr.getValue(s):null)?o.toString():"";this.isContentHtml&&(o=wijmo_1.toPlainText(o))}else o=this._lbx._getDisplayText(t,i&&void 0!==this.itemFormatter&&!this._hasCustomFormatItem());return e?o.trim():o};ComboBox.prototype._hasCustomFormatItem=function(){return this.formatItem.hasHandlers};ComboBox.prototype.indexOf=function(t,e,i){void 0===i&&(i=!1);var o=this.collectionView,n=this.caseSensitiveSearch;if(wijmo_1.hasItems(o)&&null!=t){t=t.toString();n||(t=t.toLowerCase());if(this._trimText&&!i){-1!==this.indexOf(t,!1,!0)||(t=t.trim())}var s=this.selectedIndex,r=this._getDisplayText(s,void 0,!0);if(e){n||(r=r.toLowerCase());if(t==r)return s}else if(!t&&""==r)return s;for(var a=0;a<o.items.length;a++)if(this._lbx.isItemEnabled(a)){r=this._getDisplayText(a,void 0,!0);this.trimText&&(r=r.trim());n||(r=r.toLowerCase());if(e){if(r==t&&!1===this._emptyValueAction)return a}else if(t&&0==r.indexOf(t)||!t&&""==r&&!1===this._emptyValueAction)return a}}return-1};Object.defineProperty(ComboBox.prototype,"listBox",{get:function(){return this._lbx},enumerable:!0,configurable:!0});ComboBox.prototype.onItemsSourceChanged=function(t){this.itemsSourceChanged.raise(this,t)};ComboBox.prototype.onSelectedIndexChanged=function(t){this._updateBtn();this.selectedIndexChanged.raise(this,t)};ComboBox.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);if(this.hostElement&&wijmo_1.hasItems(this.collectionView)){this._lbx.refresh();this.selectedIndex>-1&&(this.selectedIndex=this._lbx.selectedIndex)}};ComboBox.prototype.onLostFocus=function(e,i,o){this._trimText&&(this.text=this.text.trim());if(this._composing){this._composing=!1;if(!this.text&&this.isRequired){this._oldText="";this._oldIndexToBeRestoredOnBlur=null}this._setText(this.text,!0)}if((!this.text&&this.isRequired&&!(Array.isArray(this._selItems)&&this._selItems.length>0)||o)&&wijmo_1.hasItems(this.collectionView)&&!(this.isRequired&&!this.isEditable&&this.text&&this.indexOf(this.text,!1)>-1&&this.indexOf(this.text,!0)<0)){void 0!==i&&(this.selectedIndex=-1!==i?i:0);null!==this._oldIndexToBeRestoredOnBlur?this.selectedIndex=-1!==this._oldIndexToBeRestoredOnBlur?this._oldIndexToBeRestoredOnBlur:0:null==this.collectionView.currentItem&&(this.selectedIndex=0)}var n=this.text,s=this.collectionView?this.collectionView.items.length:0,r=this.selectedIndex;t.prototype.onLostFocus.call(this,e);var a=this.collectionView?this.collectionView.items.length:0,l=this.selectedIndex,h=this.text;if(r===l&&n===h){if(this._oldFilter){this.collectionView.filter=this._oldFilter;this._oldFilter=null}this._trySelectionUpdateOnItemsSourceChanged(a!==s,n)}};ComboBox.prototype.onIsDroppedDownChanging=function(e){if(!this.isDroppedDown&&!this._hasItems()){e.cancel=!0;return!1}return t.prototype.onIsDroppedDownChanging.call(this,e)};ComboBox.prototype.onIsDroppedDownChanged=function(e){t.prototype.onIsDroppedDownChanged.call(this,e);if(this.isDroppedDown){this._fmtItemHandlers=this.formatItem.handlerCount;this._lbx.showSelection()}this._updateTbxAria()};ComboBox.prototype._trySelectionUpdateOnItemsSourceChanged=function(t,e){if(t&&e){var i=this.indexOf(e,!0);i<0&&(i=this.indexOf(e,!1));this.selectedIndex=i}};ComboBox.prototype._setIsDisabled=function(e){t.prototype._setIsDisabled.call(this,e);this._updateBtn()};ComboBox.prototype._updateBtn=function(){var e=this.collectionView,i=this._tbx,o=this._hasItems();t.prototype._updateBtn.call(this);this._btn.style.display=this._showBtn&&null!=e?"":"none";wijmo_1.enable(this._btn,o&&!this.isDisabled);wijmo_1.setAttribute(i,"role",o?"combobox":null);wijmo_1.setAttribute(i,"aria-autocomplete",o?"both":null);this._updateTbxAria()};ComboBox.prototype._hasItems=function(){return wijmo_1.hasItems(this.collectionView)};ComboBox.prototype._updateTbxAria=function(){t.prototype._updateTbxAria.call(this);var e=this._tbx,i=this.isDroppedDown,o=this.dropDown?this.dropDown.id:null,n=o&&wijmo_1.hasItems(this.collectionView),s=this._lbx,r=s.selectedIndex,a=s.hostElement?s.hostElement.children:null,l=r>-1&&r<a.length?a[r].id:null;wijmo_1.setAttribute(e,"aria-controls",n&&i?o:null);wijmo_1.setAttribute(e,"aria-expanded",n?i:null);wijmo_1.setAttribute(e,"aria-activedescendant",this.isDroppedDown&&l&&l.length?l:null)};ComboBox.prototype._updateInputAriaLabel=function(){var t=this._tbx;t&&(t.id||this._ariaLabelledby?wijmo_1.setAttribute(t,"aria-label",null):wijmo_1.setAttribute(t,"aria-label",this._inputElementAriaLabel))};ComboBox.prototype._createDropDown=function(){var t=this;if(!this._lbx){this._lbx=new ListBox(this._dropDown);this._lbx._container=this.hostElement}this._lbx.maxHeight=200;this._lbx.selectedIndexChanged.addHandler((function(){t._updateBtn();var e=t._lbx.selectedIndex;t.selectedIndex=e;t.onSelectedIndexChanged()}));this._lbx.itemsChanged.addHandler((function(){t._updateBtn()}))};ComboBox.prototype._wheel=function(t){this._isWheel=!0;if(this.handleWheel&&!t.defaultPrevented&&!this.isDroppedDown&&!this.isReadOnly&&this.containsFocus()&&this.selectedIndex>-1){var e=this._findNext("",t.deltaY>0?1:-1);e>-1&&(this.selectedIndex=e);t.preventDefault()}this._isWheel=!1};ComboBox.prototype._dropDownClick=function(e){e.defaultPrevented||e.target!=this._dropDown&&(this.isDroppedDown=!1);this._restoreComboboxTbxVal&&(this._tbx.value=this._getDisplayText(this.selectedIndex,void 0,!0));t.prototype._dropDownClick.call(this,e)};ComboBox.prototype._setText=function(e,i,o){void 0===o&&(o=!1);if(!this._composing&&!this._settingText){this._settingText=!0;if(this.containsFocus()){var n=this.formatItem.handlerCount;if(this._fmtItemHandlers!=n){this._fmtItemHandlers=n;this._lbx.loadList()}}e=[null,void 0,NaN].includes(e)?"":e.toString();var s=this.selectedIndex,r=this.collectionView,a=this._getSelStart(),l=-1,h=!0;if(this.isEditable&&(this._delKey||this._getSelEnd()<e.length||!this.containsFocus())){i=!0;h=!1}s=this.indexOf(e,i);if(h){s<0&&i&&(s=this.indexOf(e,!1));s<0&&a>0&&!o&&(s=this.indexOf(e.substr(0,a),!1));if(!i){var u=this.indexOf(e,!0);u>-1&&s>-1&&u!=s&&(s=u)}}s<0&&this._delKey&&(s=this.indexOf(e,i));if(s<0&&!this.isEditable&&wijmo_1.hasItems(r)&&(e&&this.isRequired||this.containsFocus()&&(e||this.isRequired))){var c=this._oldText||"";s=Math.max(0,this.indexOf(c,!1));a=0;for(var p=0;p<e.length&&p<c.length;p++)if(e[p]!=c[p]){a=p;break}}if((!this._delKey||!this.isEditable||this._delKey&&this.isEditable&&e==this._getDisplayText(s,void 0,!0))&&(!this._pristine||this._pristine&&!this.isEditable)||this._isWheel||this._delKey&&""==e&&s>-1){if(s>-1){l=a;e=this._getDisplayText(s,void 0,!0)}var d=this._tbx;e!=d.value&&(d.value=e);l>-1&&this.containsFocus()&&!this.isTouching&&this._updateInputSelection(l)}if(r){if(!e||this.trimText&&""==e.trim()&&!this.containsFocus()&&this.isEditable)if(s>-1)this._oldIndexToBeRestoredOnBlur=s;else{this._oldIndexToBeRestoredOnBlur=this.indexOf(this._oldText,!0);this._oldIndexToBeRestoredOnBlur=this._oldIndexToBeRestoredOnBlur<0?this.indexOf(this._oldText,!1):this._oldIndexToBeRestoredOnBlur}this._restoreComboboxTbxVal=e&&s>-1;r.moveCurrentToPosition(s)}this.containsFocus()||this.isEditable||this.isRequired||e!=e.trim()||!this.trimText||(this._tbx.value=this._getDisplayText(s,this.trimText,!0));!this.containsFocus()&&s>-1&&this.isEditable&&(e=this._getDisplayText(s,this.trimText,!0));!this.containsFocus()&&this._hasItems()&&s<0&&!this.isEditable&&!this.isRequired&&(e="");var m=!1;!e&&s<0&&this.isRequired&&!this.containsFocus()&&(m=!0);this.trimText&&!this.containsFocus()&&this.isEditable&&(this.isRequired&&""==e.trim()?m=!0:e=e.trim());if(m){this.selectedIndex=this._oldIndexToBeRestoredOnBlur;this.selectedIndex<0&&(this.selectedIndex=0)}var _=!this.containsFocus()&&!this.isEditable&&this.trimText;_&&(this._tbx.value=this._getDisplayText(s,!0,!0));this._delKey=0;this._settingText=!1;t.prototype._setText.call(this,m?this._getDisplayText(this.selectedIndex,void 0,!0):e,i,m,_)}};ComboBox.prototype._findNext=function(t,e,i){void 0===i&&(i=this.selectedIndex);var o=this.collectionView,n=o?o.items.length:0,s=this._lbx,r=this.caseSensitiveSearch;if(o&&n&&e){r||(t=t.toLowerCase());this.trimText&&(t=t.trim());for(var a=i+e;a>-1&&a<n;a+=e){var l=this._getDisplayText(a,void 0,!0);r||(l=l.toLowerCase());if(0==l.indexOf(t)){if(!this.dropDown.children[a]||s.isItemEnabled(a))return a}}}return i};ComboBox.prototype._findNextWhenIsEditableFalse=function(t,e,i){void 0===i&&(i=this.selectedIndex);var o=this._findNext(t,e,i);return o!==i?o:-1};ComboBox.prototype._keydown=function(e){t.prototype._keydown.call(this,e);if(!e.defaultPrevented&&!this.isReadOnly&&!e.altKey&&wijmo_1.hasItems(this.collectionView)&&this._elRef==this._tbx&&!this._isHiddenEditor()){this._delKey=0;var i=this._getSelStart(),o=this._getSelEnd();switch(e.keyCode){case wijmo_1.Key.Tab:if(this.isDroppedDown){this.isDroppedDown=!1;this.keyActionTab===TabKeyAction.CloseAndKeepFocus&&e.preventDefault()}break;case wijmo_1.Key.Back:case wijmo_1.Key.Delete:case 88:if(!e.ctrlKey&&!e.metaKey&&88==e.keyCode)break;if(this._bsCollapse&&!this.isEditable&&i>0&&o==this._tbx.value.length&&wijmo_1.hasItems(this.collectionView)){this._setSelRange(i-1,o);i-=1}this._delKey=e.keyCode;break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:i==this.text.length&&(i=0);this.selectedIndex=this._findNext(this.text.substr(0,i),e.keyCode==wijmo_1.Key.Up?-1:1);this._setSelRange(i,this.text.length);e.preventDefault();break;case wijmo_1.Key.PageUp:this._lbx._selectPrevPage();this.selectAll();e.preventDefault();break;case wijmo_1.Key.PageDown:this._lbx._selectNextPage();this.selectAll();e.preventDefault();break;case wijmo_1.Key.Home:case wijmo_1.Key.End:var n=this._tbx;wijmo_1.setAttribute(n,"aria-activedescendant",null)}this.text.length>0&&["Backspace","Delete","x"].includes(e.key)&&0===i&&o===this.text.length||this._delKey&&1===this.text.length?this._emptyValueAction=!0:this._composing||(this._emptyValueAction=!1)}};ComboBox.prototype._afterOpenDropdownByDownArrow=function(){if(-1===this.selectedIndex){this.selectedIndex=0;this.selectAll()}};ComboBox.prototype._input=function(t){this._handleDragTextState();this._updateDropDownWhenInput();this._updateComponentText();this._updateEmptyValueFlag();this._resetDragState()};ComboBox.prototype._handleDragTextState=function(){this._draggingText&&(this._emptyValueAction=""===this.text)};ComboBox.prototype._handleComposingState=function(){this._composing&&(this._composing=!1)};ComboBox.prototype._shouldOpenDropdown=function(){return this.keyActionPrintCharacters===KeyAction.OpenDropdown};ComboBox.prototype._handleIsEditableFalseInput=function(){var t=this.text,e=this.text.length,i=this._findNextWhenIsEditableFalse(t,1,this.selectedIndex-1);if(-1===i&&-1===(i=this._findNextWhenIsEditableFalse(t,1,-1))){var o=t[t.length-1];e=1;-1===(i=this._findNextWhenIsEditableFalse(o,1))&&(i=this._findNextWhenIsEditableFalse(o,1,-1))}-1!==i?this._updateSelection(i,e):this._updateComponentText()};ComboBox.prototype._updateSelection=function(t,e){this._tbx.value=this._getDisplayText(t,void 0,!0);this._updateInputSelection(e);var i=this.collectionView;i&&i.moveCurrentToPosition(t)};ComboBox.prototype._updateComponentText=function(){var t=this._textIsComposing||this.text;this._setText(t,!1)};ComboBox.prototype._updateEmptyValueFlag=function(){this.text&&(this._emptyValueAction=!1)};ComboBox.prototype._controlDropdownVisibility=function(){this.text&&!this.isDroppedDown&&(this.isDroppedDown=!0)};ComboBox.prototype._resetDragState=function(){this._draggingText=!1};ComboBox.prototype._updateInputSelection=function(t){var e=this._tbx;this._elRef==e&&this._setSelRange(t,e.value.length)};ComboBox.prototype._getSelStart=function(){var t=this._tbx;return t&&t.value?t.selectionStart:0};ComboBox.prototype._getSelEnd=function(){var t=this._tbx;return t&&t.value?t.selectionEnd:0};ComboBox.prototype._setSelRange=function(t,e){var i=this._tbx;this._elRef!=i||i.readOnly||wijmo_1.setSelectionRange(i,t,e)};ComboBox.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.ComboBox.ariaLabels.comboBox};ComboBox.prototype._updateDropDownWhenInput=function(){if(this._shouldOpenDropdown()){var t=this._getSelStart(),e=this._getSelEnd(),i=this._delKey,o=this.text;this._controlDropdownVisibility();this._tbx.value=o;this._setSelRange(t,e);this._delKey=i}};ComboBox._ctrlTemplate="";return ComboBox}(DropDown);exports.ComboBox=ComboBox;wijmo_1._addCultureInfo("MultiSelect",{itemsSelected:"{count:n0} items selected",selectAll:"Select All",ariaLabels:{multiSelectInput:"MultiSelect Input",multiSelect:"Multi Select"}});var MultiSelect=function(t){__extends(MultiSelect,t);function MultiSelect(e,i){var o=t.call(this,e)||this;o._maxHdrItems=2;o._readOnly=!1;o._hdrFmt=null;o._inputElementAriaLabel=wijmo_1.culture.MultiSelect.ariaLabels.multiSelectInput;o.checkedItemsChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.MultiSelectClsNames.hostElement);o._tbx.readOnly=!0;o.checkedMemberPath=null;o.removeEventListener(o.dropDown,"click");o._lbx.itemsChanged.addHandler((function(){o._updateHeader(!1)}));o._lbx.checkedItemsChanged.addHandler((function(){o._updateHeader(!1);o.onCheckedItemsChanged()}));o.clickAction=ClickAction.Toggle;o.initialize(i);o._updateInputAriaLabel();return o}Object.defineProperty(MultiSelect,"controlTemplate",{get:function(){MultiSelect._ctrlTemplate||(MultiSelect._ctrlTemplate=ComboBox.controlTemplate);return MultiSelect._ctrlTemplate},set:function(t){MultiSelect._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"showSelectAllCheckbox",{get:function(){return this._msLbx.showSelectAllCheckbox},set:function(t){this._msLbx.showSelectAllCheckbox=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"showFilterInput",{get:function(){return this._msLbx.showFilterInput},set:function(t){this._msLbx.showFilterInput=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"delay",{get:function(){return this._msLbx.delay},set:function(t){this._msLbx.delay=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"caseSensitiveSearch",{get:function(){return this._msLbx.caseSensitiveSearch},set:function(t){this._msLbx.caseSensitiveSearch=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"filterInputPlaceholder",{get:function(){return this._msLbx.filterInputPlaceholder},set:function(t){this._msLbx.filterInputPlaceholder=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"checkOnFilter",{get:function(){return this._msLbx.checkOnFilter},set:function(t){if(t!=this.checkOnFilter){this._msLbx.checkOnFilter=wijmo_1.asBoolean(t);this.checkedItems=[]}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"selectAllLabel",{get:function(){return this._msLbx.selectAllLabel},set:function(t){this._msLbx.selectAllLabel=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"checkedMemberPath",{get:function(){return this._msLbx.checkedMemberPath},set:function(t){this._msLbx.checkedMemberPath=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"maxHeaderItems",{get:function(){return this._maxHdrItems},set:function(t){if(this._maxHdrItems!=t){this._maxHdrItems=wijmo_1.asNumber(t);this._updateHeader()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"headerFormat",{get:function(){return this._hdrFmt},set:function(t){if(t!=this._hdrFmt){this._hdrFmt=wijmo_1.asString(t);this._updateHeader()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"headerFormatter",{get:function(){return this._hdrFormatter},set:function(t){if(t!=this._hdrFormatter){this._hdrFormatter=wijmo_1.asFunction(t);this._updateHeader()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"checkedItems",{get:function(){return this._msLbx.checkedItems},set:function(t){this._msLbx.checkedItems=null==t?[]:wijmo_1.asArray(t);this._updateHeader()},enumerable:!0,configurable:!0});MultiSelect.prototype.onCheckedItemsChanged=function(t){this.checkedItemsChanged.raise(this,t)};MultiSelect.prototype.dispose=function(){this._lbx.dispose();t.prototype.dispose.call(this)};MultiSelect.prototype.onIsDroppedDownChanged=function(e){var i=this;t.prototype.onIsDroppedDownChanged.call(this,e);setTimeout((function(){if(i.isDroppedDown&&i.containsFocus())if(i.showFilterInput&&!i.isTouching)i._msLbx._filter.focus();else{var t=i.listBox;if(t.selectedIndex<0){var e=0,o=t.checkedItems;o.length&&(e=t.collectionView.items.indexOf(o[0]));t.selectedIndex=Math.max(0,e)}t.showSelection(!0);t.focus()}}))};MultiSelect.prototype.onLostFocus=function(){this._msLbx.onLostFocus();this.isDroppedDown=!1;t.prototype.onLostFocus.call(this)};MultiSelect.prototype._createDropDown=function(){var e=this,i=wijmo_1.createElement("<div></div>",this._dropDown);this._msLbx=new MultiSelectListBox(i);this._lbx=this._msLbx.listBox;var o=this.hostElement;this._lbx.hostElement.id=wijmo_1.getUniqueId(o.id+"_listbox");this._lbx.itemsChanged.addHandler((function(){e.isDroppedDown&&e.refresh()}));t.prototype._createDropDown.call(this)};MultiSelect.prototype._updateBtnAria=function(){var t=this._btn.querySelector("button"),e=this.isDroppedDown,i=this._lbx?this._lbx.hostElement:null,o=i?i.id:null;wijmo_1.setAttribute(t,"aria-expanded",e);wijmo_1.setAttribute(t,"aria-controls",e?o:null)};MultiSelect.prototype._updateTbxAria=function(){var t=this._tbx,e=this.isDroppedDown,i=this._lbx?this._lbx.hostElement:null,o=i?i.id:null;wijmo_1.setAttribute(t,"aria-expanded",e);wijmo_1.setAttribute(t,"aria-controls",e?o:null)};Object.defineProperty(MultiSelect.prototype,"isReadOnly",{get:function(){return this._readOnly},set:function(t){this._readOnly=wijmo_1.asBoolean(t);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly)},enumerable:!0,configurable:!0});MultiSelect.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);this.hostElement&&this._updateHeader()};MultiSelect.prototype._setText=function(t,e){};MultiSelect.prototype._keydown=function(e){var i=e.altKey&&(38===e.keyCode||40===e.keyCode);if(this.isDroppedDown&&i&&this.showFilterInput){this.isDroppedDown=!1;e.preventDefault()}else{t.prototype._keydown.call(this,e);wijmo_1.hasClass(this._tbx,"wj-grid-ime")||!e.defaultPrevented&&wijmo_1.hasItems(this.collectionView)&&e.keyCode>32&&123!==e.keyCode&&(this.isDroppedDown=!0)}};MultiSelect.prototype._hasItems=function(){var t=this.collectionView,e=t?t.sourceCollection:null;return wijmo_1.hasItems(t)||e&&e.length&&this.showFilterInput};MultiSelect.prototype._updateHeader=function(t,e){void 0===t&&(t=!0);void 0===e&&(e=!0);var i="";if(wijmo_1.isFunction(this._hdrFormatter))i=this._hdrFormatter(this);else{var o=this.checkedItems,n=[];if(this.displayMemberPath){var s=new wijmo_1.Binding(this.displayMemberPath);n=o.reduce((function(t,e){(e.binding?t.find((function(t){return t.binding===e.binding})):t.find((function(t){return s.getValue(t)===s.getValue(e)})))||t.push(e);return t}),[]);o=n}if(o.length>0)if(o.length<=this._maxHdrItems){if(this.headerPath){var r=new wijmo_1.Binding(this.headerPath);o=o.map((function(t){return r.getValue(t)}))}else if(this.displayMemberPath){var a=new wijmo_1.Binding(this.displayMemberPath);o=o.map((function(t){return a.getValue(t)}))}this.isContentHtml&&(o=o.map((function(t){return wijmo_1.toPlainText(t)})));this.trimText&&(o=o.map((function(t){return t?t.toString().trim():""})));i=o.join(", ")}else i=wijmo_1.format(this.headerFormat||wijmo_1.culture.MultiSelect.itemsSelected,{count:o.length})}var l=this.inputElement;if(i!=l.value){l.value=i;this.onTextChanged()}t&&this._lbx._updateCheckedList(this.checkedItems);this._updateState()};MultiSelect.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.MultiSelect.ariaLabels.multiSelect};MultiSelect._DEF_CHECKED_PATH="$checked";MultiSelect._ctrlTemplate="";return MultiSelect}(ComboBox);exports.MultiSelect=MultiSelect;wijmo_1._addCultureInfo("Menu",{ariaLabels:{menuButton:"Menu"}});var Menu=function(t){__extends(Menu,t);function Menu(e,i){var o=t.call(this,e)||this;o._closing=!1;o._cmd=null;o._cmdPath=null;o._cmdParamPath=null;o._subPath=null;o._owner=null;o._isButton=!1;o._openOnHover=!1;o._closeOnLeave=!0;o._subMenu=null;o._hoverEnterBnd=o._hoverEnter.bind(o);o._hoverLeaveBnd=o._hoverLeave.bind(o);o._hoverOverBnd=o._hoverOver.bind(o);o._ariaLabel=wijmo_1.culture.Menu.ariaLabels.menuButton;o._aFEnabledItem=!1;o.itemClicked=new wijmo_1.Event;Menu._MenuInstanceCount++;var n=o.hostElement,s=o._tbx,r=o._lbx,a=o.dropDown;wijmo_1.addClass(n,exports.MenuClsNames.hostElement);s.style.display="none";var l='<div wj-part="header" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"/>';o._hdr=o._elRef=wijmo_1.createElement(l);s.parentElement.insertBefore(o._hdr,s);wijmo_1.removeChild(s);o.isRequired=!1;if("SELECT"==o._orgTag){o.header=n.getAttribute("header");o._lbx.itemsSource&&(o.commandParameterPath="cmdParam")}o.isContentHtml=!0;o.maxDropDownHeight=500;o.addEventListener(o._hdr,"click",(function(t){if(!t.defaultPrevented){o._clearHover(t);if(o._isButton){o.isDroppedDown=!1;o._raiseCommand()}else o.isDroppedDown=!o.isDroppedDown}}));o.addEventListener(o._hdr,"mousedown",(function(t){t.defaultPrevented||o._clearHover(t)}));r.lostFocus.addHandler((function(){o.containsFocus()||(o.isDroppedDown=!1)}));wijmo_1.addClass(a,exports.MenuClsNames.menuItems);r.formatItem.addHandler(o._formatMenuItem.bind(o));o.initialize(i);wijmo_1.setAttribute(a,"role","menu");o._updateBtnAria();o._updateHdrAria();r.tabOrder=0;o._updateLbxAria();return o}Object.defineProperty(Menu,"controlTemplate",{get:function(){Menu._ctrlTemplate||(Menu._ctrlTemplate=ComboBox.controlTemplate);return Menu._ctrlTemplate},set:function(t){Menu._ctrlTemplate=t},enumerable:!0,configurable:!0});Menu.prototype._updateBtnAria=function(){var t=this._btn.querySelector("button"),e=this.dropDown;wijmo_1.setAttribute(t,"aria-expanded",this.isDroppedDown);wijmo_1.setAttribute(t,"aria-haspopup","menu");wijmo_1.setAttribute(t,"aria-owns",e.id);wijmo_1.setAttribute(t,"aria-controls",e.id)};Menu.prototype._updateHdrAria=function(){var t=this.dropDown,e=this.isDisabled?-1:this._orgTabIndex;wijmo_1.setAttribute(this._hdr,"role","button");wijmo_1.setAttribute(this._hdr,"tabindex",e);wijmo_1.setAttribute(this._hdr,"aria-label",this._ariaLabel);if(this.isButton){wijmo_1.setAttribute(this._hdr,"aria-expanded");wijmo_1.setAttribute(this._hdr,"aria-haspopup");wijmo_1.setAttribute(this._hdr,"aria-owns");wijmo_1.setAttribute(this._hdr,"aria-controls")}else{wijmo_1.setAttribute(this._hdr,"aria-expanded",this.isDroppedDown);wijmo_1.setAttribute(this._hdr,"aria-haspopup","menu");wijmo_1.setAttribute(this._hdr,"aria-owns",t.id);wijmo_1.setAttribute(this._hdr,"aria-controls",t.id)}};Menu.prototype._updateLbxAria=function(){var t=this._lbx,e=this.isDisabled?-1:t.tabOrder;t.itemRole="menuitem";t.tabOrder=e};Object.defineProperty(Menu.prototype,"ariaLabel",{get:function(){return this._ariaLabel},set:function(t){if(t!=this._ariaLabel){this._ariaLabel=t;wijmo_1.setAttribute(this._hdr,"aria-label",this._ariaLabel)}},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"autoSelectOnFocus",{get:function(){return this._aFEnabledItem},set:function(t){this._aFEnabledItem=t},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"header",{get:function(){return this._hdr.innerHTML},set:function(t){this._hdr.innerHTML=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"command",{get:function(){return this._cmd},set:function(t){this._cmd=t},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"commandPath",{get:function(){return this._cmdPath},set:function(t){this._cmdPath=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"commandParameterPath",{get:function(){return this._cmdParamPath},set:function(t){this._cmdParamPath=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"subItemsPath",{get:function(){return this._subPath},set:function(t){if(t!=this._subPath){this._subPath=t;this.refresh(!0)}},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"openOnHover",{get:function(){return this._openOnHover},set:function(t){this._openOnHover=wijmo_1.asBoolean(t);this._updateHoverEvents()},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"closeOnLeave",{get:function(){return this._closeOnLeave},set:function(t){this._closeOnLeave=wijmo_1.asBoolean(t);this._updateHoverEvents()},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"isButton",{get:function(){return this._isButton},set:function(t){this._isButton=wijmo_1.asBoolean(t);this._updateHdrAria()},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"owner",{get:function(){return this._owner},set:function(t){this._owner=wijmo_1.asType(t,HTMLElement,!0);this._enableDisableItems()},enumerable:!0,configurable:!0});Menu.prototype.show=function(t){if(!this.isDroppedDown){var e=this._lbx._ignoredItemChangedEvents;this._lbx._ignoredItemChangedEvents=!0;this.selectedIndex=-1;this._lbx._ignoredItemChangedEvents=e;if(this.onIsDroppedDownChanging(new wijmo_1.CancelEventArgs)){var i=this.dropDown,o=this.owner;!o&&t instanceof MouseEvent&&(o=t.target);o instanceof HTMLElement&&(i[wijmo_1.Control._OWNR_KEY]=o);if(t instanceof MouseEvent&&this.openOnHover&&this.closeOnLeave){t=new wijmo_1.Point(t.pageX-pageXOffset-2,t.pageY-pageYOffset-2)}wijmo_1.showPopup(i,t,!1,this.isAnimated);this.onIsDroppedDownChanged()}}};Menu.prototype.hide=function(){if(this.isDroppedDown&&this.onIsDroppedDownChanging(new wijmo_1.CancelEventArgs)){wijmo_1.hidePopup(this.dropDown);this.onIsDroppedDownChanged()}};Menu.prototype.onItemClicked=function(t){this.itemClicked.raise(this,t)};Menu.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);this.hostElement&&this._enableDisableItems()};Menu.prototype.onIsDroppedDownChanged=function(e){t.prototype.onIsDroppedDownChanged.call(this,e);this._updateBtnAria();this._updateHdrAria();if(this.isDroppedDown){this._closing=!0;var i=this._lbx._ignoredItemChangedEvents;this._lbx._ignoredItemChangedEvents=!0;this._defaultItem=this.selectedItem;this.isRequired=!1;this.selectedIndex=-1;this._enableDisableItems();this._closing=!1;this._lbx._ignoredItemChangedEvents=i;if(this._aFEnabledItem){for(var o=this.dropDown.children,n=0;n<o.length;n++)if(!o[n].classList.contains(wijmo_1.ControlStateClsNames.disabled)){this.selectedIndex=n;o[n].focus();break}}else this.dropDown.focus()}else{if(!this.selectedItem){var s=this._lbx._checking;this._lbx._checking=!0;this.selectedItem=this._defaultItem;this._lbx._checking=s}var r=this._subMenu;r&&(r.isDroppedDown=!1)}};Menu.prototype._updateHoverEvents=function(){var t=this.hostElement,e=this.dropDown,i=this.addEventListener.bind(this),o=this.removeEventListener.bind(this),n="mouseleave";o(t,"mouseenter",this._hoverEnterBnd);o(t,n,this._hoverLeaveBnd);o(e,"mouseover",this._hoverOverBnd);o(e,n,this._hoverLeaveBnd);if(this._openOnHover){i(t,"mouseenter",this._hoverEnterBnd);i(e,"mouseover",this._hoverOverBnd);if(this._closeOnLeave){i(t,n,this._hoverLeaveBnd);i(e,n,this._hoverLeaveBnd)}}};Menu.prototype._getSubItems=function(t){var e=this.subItemsPath,i=t&&e?t[e]:null;return wijmo_1.isArray(i)&&i.length?i:null};Menu.prototype._formatMenuItem=function(t,e){var i=e.item;if(this._getSubItems(e.data)){wijmo_1.addClass(i,exports.MenuClsNames.subItems);wijmo_1.setAttribute(i,"aria-expanded",!1)}else if("-"==i.innerHTML){i.innerHTML="";wijmo_1.addClass(i,wijmo_1.UtilitesClsNames.separator);wijmo_1.setAttribute(i,"role","separator");wijmo_1.setAttribute(i,"tabindex")}};Menu.prototype._keydown=function(e){if(!e.defaultPrevented){var i=this._getKeyCode(e);if(this.isDroppedDown)switch(i){case wijmo_1.Key.Tab:this.isDroppedDown=!1;this.keyActionTab===TabKeyAction.CloseAndKeepFocus&&e.preventDefault();break;case wijmo_1.Key.Enter:case wijmo_1.Key.Right:if(this._showSubMenu()){e.preventDefault();return}break;case wijmo_1.Key.Left:var o=wijmo_1.Control.getControl(this.owner);if(o instanceof Menu){var n=o.dropDown,s=o.selectedIndex,r=s>-1?n.children[s]:n;wijmo_1.setAttribute(r,"aria-expanded",!1);wijmo_1.setAttribute(r,"aria-owns");r.focus();e.preventDefault();return}}if(i==wijmo_1.Key.Enter){if(this._isButton){this._raiseCommand();e.preventDefault();return}if(this.isDroppedDown)this.selectedIndex>-1&&this._raiseCommand();else{this.isDroppedDown=!0;e.preventDefault()}}}t.prototype._keydown.call(this,e)};Menu.prototype._dropDownClick=function(e){if(!e.defaultPrevented&&e.target!=this.dropDown){this._clearHover(e);if(this._showSubMenu()){e.preventDefault();return}this.selectedIndex>-1&&this._raiseCommand()}t.prototype._dropDownClick.call(this,e)};Menu.prototype._showSubMenu=function(){var t=this,e=this._getSubItems(this.selectedItem);if(!e)return null;var i=this.dropDown.children[this.selectedIndex],o=i.getBoundingClientRect(),n=new wijmo_1.Point(o.right,o.top);if(0==o.height)return null;var s=this.rightToLeft||"rtl"==this.dropDown.getAttribute("dir");s&&(n.x=o.left);var r=this._subMenu;r&&(r.isDroppedDown=!1);r=new Menu(document.createElement("div"),{owner:this.hostElement,itemsSource:e,autoSelectOnFocus:this._aFEnabledItem,itemClicked:function(e,i){t.itemClicked.raise(e,i)},formatItem:function(e,i){t.formatItem.raise(e,i)}});if(i){wijmo_1.setAttribute(i,"aria-expanded",!0);wijmo_1.setAttribute(i,"aria-owns",r.dropDown.id)}var a=this.collectionView,l=r.collectionView;a&&a.filter&&l&&!l.filter&&(l.filter=a.filter);"displayMemberPath,selectedValuePath,isContentHtml,command,commandPath,commandParameterPath,maxDropDownWidth,maxDropDownHeight,dropDownCssClass,isAnimated,subItemsPath,openOnHover,closeOnLeave".split(",").forEach((function(e){r[e]=t[e]}));var h=r.dropDown;wijmo_1.setAttribute(h,"dir",s?"rtl":null);r.show(n);h[wijmo_1.Control._OWNR_KEY]=this.dropDown;return r};Menu.prototype._raiseCommand=function(t){var e=this.selectedItem,i=this._getSubItems(e),o=this._getCommand(e);if(o&&!i){var n=this._getCommandParm(e);if(!this._canExecuteCommand(o,n))return;this._executeCommand(o,n)}var s=this.headerPath;if(s){var r=new wijmo_1.Binding(s).getValue(e);r=null==r?"":r.toString();this.header=this.isContentHtml?r:wijmo_1.escapeHtml(r)}this.onItemClicked(t);if(this.containsFocus()){for(var a=this;a&&a.owner;){var l=wijmo_1.Control.getControl(a.owner);if(!(l instanceof Menu))break;a=l}var h=a.owner;!h&&a.dropDown&&(h=a.dropDown[wijmo_1.Control._OWNR_KEY]);a.isDroppedDown=!1;a.focus();if(!a.containsFocus()&&h instanceof HTMLElement&&h.offsetHeight)if(wijmo_1.isIE){var u=document.documentElement,c=u.scrollLeft,p=u.scrollTop;h.focus();u.scrollLeft=c,u.scrollTop=p}else h.focus()}};Menu.prototype._getCommand=function(t){var e=t&&this._cmdPath?t[this._cmdPath]:null;return e||this._cmd};Menu.prototype._getCommandParm=function(t){var e=this._cmdParamPath;return t&&e?t[e]:t};Menu.prototype._executeCommand=function(t,e){t&&!wijmo_1.isFunction(t)&&(t=t.executeCommand);wijmo_1.isFunction(t)&&t(e)};Menu.prototype._canExecuteCommand=function(t,e){if(t){var i=t.canExecuteCommand;if(wijmo_1.isFunction(i))return i(e)}return!0};Menu.prototype._enableDisableItems=function(){if(this.collectionView&&(this._cmd||this._cmdPath))for(var t=this.collectionView.items,e=0;e<t.length;e++){var i=t[e],o=this._getCommand(i);if(o){var n=this._lbx.hostElement.children[e],s=this._getCommandParm(i);wijmo_1.toggleClass(n,wijmo_1.ControlStateClsNames.disabled,!this._canExecuteCommand(o,s))}}};Menu.prototype._clearHover=function(t){this._toHover&&clearTimeout(this._toHover);this._toHover=null;Menu._evtHover=t};Menu.prototype._isTargetDisabled=function(t){return wijmo_1.hasClass(t.target,wijmo_1.ControlStateClsNames.disabled)};Menu.prototype._hoverEnter=function(t){var e=this;this._clearHover(t);this._toHover=setTimeout((function(){e._toHover=null;e.isDroppedDown=!0}),wijmo_1.Control._HOVER_DELAY)};Menu.prototype._hoverOver=function(t){var e=this;this._clearHover(t);this._toHover=setTimeout((function(){e._toHover=null;var i=e.listBox.indexOf(t.target);if(i>-1&&!wijmo_1.hasClass(t.target,wijmo_1.ControlStateClsNames.disabled)){e.selectedIndex=i;e._subMenu=e._showSubMenu()}}),wijmo_1.Control._HOVER_DELAY)};Menu.prototype._hoverLeave=function(t){var e=this;this._clearHover(t);this.isDroppedDown&&(this._toHover=setTimeout((function(){var i=(t=Menu._evtHover)?document.elementFromPoint(t.clientX,t.clientY):null,o=wijmo_1.closest(i,"."+exports.ListBoxClsNames.hostElement+"."+exports.MenuClsNames.menuItems),n=e._subMenu;if(!o&&!wijmo_1.contains(e.hostElement,i,!0)){e.isDroppedDown=!1;n&&(n.isDroppedDown=!1)}}),wijmo_1.Control._LEAVE_DELAY))};Menu.prototype._setIsDisabled=function(e){t.prototype._setIsDisabled.call(this,e);wijmo_1.setAttribute(this.hostElement,"tabindex",-1);this._updateHdrAria();this._updateLbxAria()};Menu.prototype._setTabOrder=function(e){t.prototype._setTabOrder.call(this,e);wijmo_1.setAttribute(this.hostElement,"tabindex",-1);this._updateHdrAria();this._updateLbxAria()};Menu.prototype.dispose=function(){var e=this;if(this._subMenu){this._subMenu.dispose();this._subMenu=null}Menu._MenuInstanceCount--;0===Menu._MenuInstanceCount&&Menu._evtHover&&(Menu._evtHover=null);var i=this._lbx;if(i){i.lostFocus.removeHandler((function(){e.containsFocus()||(e.isDroppedDown=!1)}));i.formatItem&&i.formatItem.removeHandler(this._formatMenuItem)}if(this._toHover){clearTimeout(this._toHover);this._toHover=null}this._cmd=null;this._owner=null;this._defaultItem=null;this._hoverEnterBnd=null;this._hoverLeaveBnd=null;this._hoverOverBnd=null;t.prototype.dispose.call(this)};Menu._MenuInstanceCount=0;Menu._ctrlTemplate="";return Menu}(ComboBox);exports.Menu=Menu;wijmo_1._addCultureInfo("InputTime",{ariaLabels:{inputTime:"Input Time",inputTimeInput:"InputTime Input"}});var InputTime=function(t){__extends(InputTime,t);function InputTime(e,i){var o=t.call(this,e)||this;o._format="t";o._inputElementAriaLabel=wijmo_1.culture.InputTime.ariaLabels.inputTimeInput;o.valueChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.InputTimeClsNames.hostElement);o.isEditable=!0;o._value=wijmo_1.DateTime.newDate();o._min=o._max=null;o._msk=new wijmo_1._MaskProvider(o._tbx);wijmo_1.isIE9()||(o._tbx.type="tel");if("INPUT"==o._orgTag){var n=o._tbx.getAttribute("value");n&&(o.value=wijmo_1.Globalize.parseDate(n,"HH:mm:ss"))}o.step=15;o.autoExpandSelection=!0;o.initialize(i);o._commitText();o._updateInputAriaLabel();return o}Object.defineProperty(InputTime,"controlTemplate",{get:function(){InputTime._ctrlTemplate||(InputTime._ctrlTemplate=ComboBox.controlTemplate);return InputTime._ctrlTemplate},set:function(t){InputTime._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"inputType",{get:function(){return this._tbx.type},set:function(t){this._tbx.type=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"value",{get:function(){return this._value},set:function(t){(t=wijmo_1.asDate(t,!this.isRequired))&&(t=this._clamp(t));this._setText(t?wijmo_1.Globalize.format(t,this.format):"",!0,!0);this.selectedItem&&this.selectedItem.value&&(t=wijmo_1.DateTime.fromDateTime(t,this.selectedItem.value));if(t!=this._value&&!wijmo_1.DateTime.equals(t,this._value)){this._value=t;this.onValueChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"text",{get:function(){return this._tbx.value},set:function(t){if(t!=this.text&&(this.text||!this.isRequired)){this._setText(t,!0);this._commitText()}!this.text&&this.isRequired&&(this.selectedIndex=this._oldIndexToBeRestoredOnBlur<0?0:this._oldIndexToBeRestoredOnBlur)},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"min",{get:function(){return this._min},set:function(t){this._min=wijmo_1.asDate(t,!0);this.isDroppedDown=!1;this._updateItems()},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"max",{get:function(){return this._max},set:function(t){this._max=wijmo_1.asDate(t,!0);this.isDroppedDown=!1;this._updateItems()},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"step",{get:function(){return this._step},set:function(t){if(t!=this.step){this._step=wijmo_1.asNumber(t,!0);this.isDroppedDown=!1;this._updateItems()}},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"format",{get:function(){return this._format},set:function(t){if(t!=this.format){this._format=wijmo_1.asString(t);this._tbx.value=wijmo_1.Globalize.format(this.value,this.format);wijmo_1.hasItems(this.collectionView)&&this._updateItems()}},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"mask",{get:function(){return this._msk.mask},set:function(t){this._msk.mask=wijmo_1.asString(t)},enumerable:!0,configurable:!0});InputTime.prototype.onLostFocus=function(){t.prototype.onLostFocus.call(this)};InputTime.prototype.onValueChanged=function(t){this.valueChanged.raise(this,t)};InputTime.prototype.onItemsSourceChanged=function(e){t.prototype.onItemsSourceChanged.call(this,e);this._hasCustomItems=null!=this.itemsSource};InputTime.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);if(this.hostElement){this._msk.refresh();this._tbx.value=wijmo_1.Globalize.format(this.value,this.format);this._updateItems()}};InputTime.prototype.onSelectedIndexChanged=function(e){if(this.selectedIndex>-1&&!this._settingText){var i=this.value?this.value:wijmo_1.DateTime.newDate(),o=null!=this.selectedItem.value?this.selectedItem.value:wijmo_1.Globalize.parseDate(this.text,this.format,this.value);this.value=wijmo_1.DateTime.fromDateTime(i,o)}t.prototype.onSelectedIndexChanged.call(this,e)};InputTime.prototype._clamp=function(t){null!=this._min&&this._getTime(t)<this._getTime(this._min)&&(t=wijmo_1.DateTime.fromDateTime(t,this._min));null!=this._max&&this._getTime(t)>this._getTime(this._max)&&(t=wijmo_1.DateTime.fromDateTime(t,this._max));return t};InputTime.prototype._wheel=function(e){if(this.handleWheel&&!e.defaultPrevented&&!this.isDroppedDown&&this.value&&this._canChangeValue()&&this.containsFocus()&&this.isEditable){var i=this._tbx,o=i.selectionStart,n=i.selectionEnd,s=wijmo_1.clamp(-e.deltaY,-1,1),r=(this.value,wijmo_1.culture.Globalize.calendar.patterns[this.format]);null==r&&(r=this.format);var a=r.match(wijmo_1.getSpecialCharsRegex());if(n-o===i.value.length&&wijmo_1.isNumber(this.step)&&this.step>0){var l=wijmo_1.DateTime.addMinutes(this.value,this.step*-s);l=this._clamp(l);this.value=l;this.selectAll()}else this._updateTimeValue(s,a,r);e.preventDefault()}t.prototype._wheel.call(this,e)};InputTime.prototype._updateInputSelection=function(e){if(this._delKey)t.prototype._updateInputSelection.call(this,e);else{for(var i=this._tbx.value;e<i.length&&!i[e].match(/[a-z0-9]/i);)e++;wijmo_1.setSelectionRange(this._tbx,e,this._tbx.value.length)}};InputTime.prototype._updateItems=function(){if(!this._hasCustomItems){var t=[],e=new Date,i=new Date(e.getFullYear(),e.getMonth(),e.getDate()),o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59),n=this.step;this.min&&i.setHours(this.min.getHours(),this.min.getMinutes(),this.min.getSeconds());this.max&&o.setHours(this.max.getHours(),this.max.getMinutes(),this.max.getSeconds());if(wijmo_1.isNumber(n)&&n>=1)for(var s=i;s<=o;s=wijmo_1.DateTime.addMinutes(s,n))t.push({value:s,text:wijmo_1.Globalize.format(s,this.format)});var r=this.value;this._settingText=!0;this.displayMemberPath="text";this.selectedValuePath="text";this.itemsSource=t;this._hasCustomItems=!1;this._settingText=!1;!r&&this.isRequired||(this.value=r)}};InputTime.prototype._getTime=function(t){return 3600*t.getHours()+60*t.getMinutes()+t.getSeconds()};InputTime.prototype._getText=function(){var t=wijmo_1.Globalize.format,e=this._format;return t(this.value,e)};InputTime.prototype._canChangeValue=function(){return!this.isReadOnly&&!this.isDisabled};InputTime.prototype.getSeconds=function(t){return 3600*t.getHours()+60*t.getMinutes()+t.getSeconds()};InputTime.prototype._keydown=function(e){if(!(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)){if(this._isHiddenEditor())return;switch(e.keyCode){case wijmo_1.Key.Enter:this._commitText(void 0,!0);this.selectAll();break;case wijmo_1.Key.Escape:this.text=wijmo_1.Globalize.format(this.value,this.format);this.selectAll();break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(!this.isDroppedDown&&this.value&&this._canChangeValue()&&this.isEditable){var i=this._tbx,o=i.selectionStart,n=i.selectionEnd,s=e.keyCode==wijmo_1.Key.Up?1:-1,r=wijmo_1.culture.Globalize.calendar.patterns[this.format];null==r&&(r=this.format);var a=r.match(wijmo_1.getSpecialCharsRegex());if(n-o==i.value.length)t.prototype._keydown.call(this,e);else{if(!(1==s&&(null===this.max||this.getSeconds(this.value)<this.getSeconds(this.max))||-1==s&&(null===this.min||this.getSeconds(this.value)>this.getSeconds(this.min))))return;this._updateTimeValue(s,a,r)}e.preventDefault()}}}t.prototype._keydown.call(this,e)};InputTime.prototype._updateTimeValue=function(t,e,i){var o=this._tbx,n=o.selectionStart,s=o.value,r=this.value,a={},l={},h=0,u=0,c=0,p=[],d=[],m=o.value.match(wijmo_1.getSpecialCharsRegex());if(null==e||null==m){p=[this.format];d=["0"];e=[""]}else{e.forEach((function(t,o){var n=t.replaceAll('"',""),r=i.substring(h),c=s.substring(u),p=r.indexOf(t),d=c.indexOf(n),m=r.substring(0,p);a[m]=h;l[m]=u;h=h+p+t.length;u=u+d+n.length;if(o==e.length-1&&-1!=d){m=i.substring(h);a[m]=h;l[m]=u}}));p=Object.keys(a);d=Object.values(l)}var _=d.filter((function(t){return n>=parseInt(t.toString())}));_.length>0&&(c=_.length-1);var f=p[c];-1!=f.indexOf("h")||-1!=f.indexOf("H")?r=wijmo_1.DateTime.addHours(this.value,t):-1!=f.indexOf("m")?r=wijmo_1.DateTime.addMinutes(this.value,t):-1!=f.indexOf("s")?r=wijmo_1.DateTime.addSeconds(this.value,t):-1!=f.indexOf("t")&&(r=this.value.getHours()>=12?wijmo_1.DateTime.addHours(this.value,-12):wijmo_1.DateTime.addHours(this.value,12));r.getDate()!=(new Date).getDate()&&(r=wijmo_1.DateTime.fromDateTime(new Date,r));this.value=r;this._reselectText(e,c)};InputTime.prototype._reselectText=function(t,e){var i=this._getText(),o=this._tbx,n=0,s=-1,r=-1;t.forEach((function(t,o){var a=t.replaceAll('"',""),l=i.substring(n),h=l.indexOf(a),u=l.substring(0,h),c=""==u?l.length:u.length;o==e&&-1==s&&(r=(s=n)+c);n=n+h+a.length}));if(-1==s){s=n;r=o.value.length}wijmo_1.setSelectionRange(o,s,r)};InputTime.prototype._commitText=function(t,e){if(this.text||this.isRequired){var i=this.value?wijmo_1.Globalize.format(this.value,this.format):"";if(this.text!=i){var o=this.selectedItem&&this.selectedItem.value?this.selectedItem.value:wijmo_1.Globalize.parseDate(this.text,this.format,this.value),n=this._shouldRaiseInvalidInput(e);if(o){!wijmo_1.DateTime.sameTime(o,this._clamp(o))?n&&this.onInvalidInput(new wijmo_1.CancelEventArgs)&&(this.value=wijmo_1.DateTime.fromDateTime(this.value,o)):this.value=wijmo_1.DateTime.fromDateTime(this.value,o)}else n&&this.onInvalidInput(new wijmo_1.CancelEventArgs)&&(this.text=i)}}else this.value=null};InputTime.prototype._copy=function(t,e){if("text"===t){(e||"").toString()!==this.text&&this._setText(e,!0);return!0}return!1};InputTime.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputTime.ariaLabels.inputTime};InputTime.prototype._input=function(t){this._draggingText&&(""===this.text?this._emptyValueAction=!0:this._emptyValueAction=!1);this._composing&&(this._composing=!1);this._setText(""!=this._textIsComposing?this._textIsComposing:this.text,!1);""!=this.text&&(this._emptyValueAction=!1);this._draggingText=!1;this._updateDropDownWhenInput()};InputTime._ctrlTemplate="";return InputTime}(ComboBox);exports.InputTime=InputTime;wijmo_1._addCultureInfo("InputDateTime",{ariaLabels:{inputDateTimeInput:"InputDateTime Input",tglDate:"Toggle Calendar",tglTime:"Toggle Time List"}});var InputDateTime=function(t){__extends(InputDateTime,t);function InputDateTime(e,i){var o=t.call(this,e)||this;o._inputAriaLabel=wijmo_1.culture.InputDateTime.ariaLabels.inputDateTimeInput;wijmo_1.addClass(o.hostElement,exports.InputDateTimeClsNames.hostElement);var n=wijmo_1.culture.InputDateTime.ariaLabels;wijmo_1.setAriaLabel(o._btn,n.tglDate);wijmo_1.setAttribute(o._btn,"aria-haspopup","dialog");wijmo_1.setAttribute(o._btn,"aria-expanded",!1);o._updateInputAriaLabel();o.value=new Date;o.format="g";o.isDroppedDownChanged.addHandler(o.inputDateTimeIsDroppedDownChanged,o);o._inputTime=new InputTime(document.createElement("div"),{valueChanged:function(t){var e=o.rangeEnd;o.value=wijmo_1.DateTime.fromDateTime(o.value,t.value);o.calendar._rngMode()&&e&&(o.rangeEnd=wijmo_1.DateTime.fromDateTime(e,t.value))},isDroppedDownChanged:function(t){t.listBox.containsFocus()&&o.inputElement.focus();o._selectAll();o._updateTbxAria();o.inputDateTimeIsDroppedDownChanged()},keyActionPrintCharacters:0,keyActionTab:0});o._inputTime.dropDown.id=wijmo_1.getUniqueId(o.hostElement.id+"_dropdown");var s=o.addEventListener.bind(o);o._btnTm=o.hostElement.querySelector('[wj-part="btn-tm"]');s(o._btnTm,"mousedown",(function(t){o._btnclick(t)}));wijmo_1.setAriaLabel(o._btnTm,n.tglTime);wijmo_1.setAttribute(o._btnTm,"aria-haspopup","listbox");wijmo_1.setAttribute(o._btnTm,"aria-expanded",!1);o._ddDate=o._dropDown;var r=o._ddTime=o._inputTime.dropDown;s(r,"keydown",o._keydown.bind(o),!0);s(r,"blur",(function(){o._updateFocusState()}),!0);s(r,"click",(function(t){t.defaultPrevented||t.target!=r&&o.hostElement.focus()}),!0);o.initialize(i);o._tbx.value!==o._oldText&&o._commitText();return o}Object.defineProperty(InputDateTime,"controlTemplate",{get:function(){InputDateTime._ctrlTemplate||(InputDateTime._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+'"><div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+" "+exports.InputClsNames.inputBtnVisible+'"><input wj-part="input" type="text" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"/><span class="'+exports.InputClsNames.inputGroupBtn+'"><button wj-part="btn" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.calendar+'></span></button><button wj-part="btn-tm" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.clock+'></span></button></span></div></div><div wj-part="dropdown" class="'+wijmo_1.ControlClsNames.content+" "+exports.DropDownClsNames.dropDownPanel+'"></div></div>');return InputDateTime._ctrlTemplate},set:function(t){InputDateTime._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"timeMin",{get:function(){return this._inputTime.min},set:function(t){this._inputTime.min=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"timeMax",{get:function(){return this._inputTime.max},set:function(t){this._inputTime.max=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"timeFormat",{get:function(){return this._inputTime.format},set:function(t){this._inputTime.format=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"timeStep",{get:function(){return this._inputTime.step},set:function(t){this._inputTime.step=t;this._btnTm.style.display=wijmo_1.isNumber(t)&&t>0?"":"none"},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"inputTime",{get:function(){return this._inputTime},enumerable:!0,configurable:!0});InputDateTime.prototype._fromDateTime=function(t){return t};InputDateTime.prototype._btnclick=function(e){this._setDropDownByEvent(e);t.prototype._btnclick.call(this,e)};InputDateTime.prototype.dispose=function(){this._setDropdown(this._ddDate);t.prototype.dispose.call(this);this._inputTime.dispose()};InputDateTime.prototype.refresh=function(e){void 0===e&&(e=!0);this._inputTime.refresh();t.prototype.refresh.call(this,e)};InputDateTime.prototype._updateBtn=function(){t.prototype._updateBtn.call(this);if(this._btnTm){this._btnTm.tabIndex=this._btn.tabIndex;this._btnTm.parentElement.style.display=this._btn.style.display}};InputDateTime.prototype._setDropdown=function(t){if(this._dropDown==t)return!1;this.isDroppedDown&&(this.isDroppedDown=!1);var e=this.dropDownCssClass;this.dropDownCssClass="";this._dropDown=t;this.dropDownCssClass=e;return!0};InputDateTime.prototype._updateDropDown=function(){var e=this._inputTime;if(this._dropDown==e.dropDown){this._commitText();t.prototype._updateDropDown.call(this);e.isRequired=this.isRequired&&null!=this.value;e.value=this.value;this.isDroppedDown&&e.listBox.showSelection()}else t.prototype._updateDropDown.call(this)};InputDateTime.prototype._mouseWheel=function(t){if(this.handleWheel&&!t.defaultPrevented&&!this.isDroppedDown&&this.containsFocus()&&null!=this.value&&this._canChangeValue()){var e=this._tbx,i=e.selectionStart,o=e.selectionEnd,n=wijmo_1.clamp(-t.deltaY,-1,1),s=this.value,r=wijmo_1.Globalize.getFullFormat(this.format);null==r&&(r=this.format);var a=r.match(wijmo_1.getSpecialCharsRegex());if(o-i===e.value.length&&null!=a||this.selectionMode==DateSelectionMode.Range){s=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,n):wijmo_1.DateTime.addDays(this.value,n);this.value=s;var l=this._getText();wijmo_1.setSelectionRange(e,0,l.length)}else(1==n&&(null===this.max||this.value<this.max)||-1==n&&(null===this.min||this.value>this.min))&&this._updateDateTimeValue(n,a,r);t.preventDefault()}};InputDateTime.prototype._keydown=function(e){if(!(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)){if(this._isHiddenEditor())return;switch(e.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(e.keyCode===wijmo_1.Key.Up&&this.keyActionUpArrow===KeyAction.OpenDropdown||e.keyCode===wijmo_1.Key.Down&&this.keyActionDownArrow===KeyAction.OpenDropdown)break;if(!this.isDroppedDown&&this.value&&this._canChangeValue()){var i=this._tbx,o=i.selectionStart,n=i.selectionEnd,s=(i.value,e.keyCode==wijmo_1.Key.Up?1:-1),r=this.value,a=wijmo_1.Globalize.getFullFormat(this.format);if("g"==this.format&&a.includes("г")){a=a.replace(/\"г.\" /,"")}null==a&&(a=this.format);var l=a.match(wijmo_1.getSpecialCharsRegex());if(n-o===i.value.length&&null!=l||this.selectionMode==DateSelectionMode.Range){r=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,s):wijmo_1.DateTime.addDays(this.value,s);this.value=r;var h=this._getText();wijmo_1.setSelectionRange(i,0,h.length)}else(1==s&&(null===this.max||this.value<this.max)||-1==s&&(null===this.min||this.value>this.min))&&this._updateDateTimeValue(s,l,a);e.preventDefault()}break;case wijmo_1.Key.Enter:case wijmo_1.Key.Space:var u=e.target;if(u===this._btn||u===this._btnTm){this._setDropDownByEvent(e);this.isDroppedDown=!0;e.preventDefault()}}}if(!e.defaultPrevented&&e.altKey&&this.isDroppedDown&&("ArrowUp"===e.key||"ArrowDown"===e.key)){var c=this.dropDown===this._ddDate?this._ddTime:this._ddDate;this._setDropdown(c);this.isDroppedDown=!0;e.preventDefault()}t.prototype._keydown.call(this,e)};InputDateTime.prototype._updateDateTimeValue=function(t,e,i){var o=this._tbx,n=o.selectionStart,s=o.value,r=this.value,a={},l={},h=0,u=0,c=0,p=[],d=[],m=o.value.match(wijmo_1.getSpecialCharsRegex());if(null==e||null==m){p=[this.format];d=["0"];e=[""]}else{e.forEach((function(t,o){var n=t.replaceAll('"',""),r=i.substring(h),c=s.substring(u);if(c.startsWith("г.")){c=c.replace("г. ","");u+="г. ".length}var p=r.indexOf(t),d=c.indexOf(n);if(-1==d){var _=m[o];d=c.indexOf(_)}var f=r.substring(0,p);if(""!=f){a[f]=h;l[f]=u}h=h+p+t.length;u=u+d+n.length;if(o==e.length-1&&-1!==d){f=i.substring(h);a[f]=h;l[f]=u}}));p=Object.keys(a);d=Object.values(l)}var _=d.filter((function(t){return n>=parseInt(t.toString())}));_.length>0&&(c=_.length-1);var f=new Date,b=new Date;null!==this.timeMax&&(f=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),this.timeMax.getHours(),this.timeMax.getMinutes(),this.timeMax.getSeconds()));null!==this.timeMin&&(b=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),this.timeMin.getHours(),this.timeMin.getMinutes(),this.timeMin.getSeconds()));var g=p[c];if(-1!=g.indexOf("d"))r=wijmo_1.DateTime.addDays(this.value,t);else if(-1!=g.indexOf("M"))r=wijmo_1.DateTime.addMonths(this.value,t);else if(-1!=g.indexOf("y"))r=wijmo_1.DateTime.addYears(this.value,t);else if(1==t&&(null===this.timeMax||this.value<f)||-1==t&&(null===this.timeMin||this.value>b)){-1!=g.indexOf("h")||-1!=g.indexOf("H")?r=wijmo_1.DateTime.addHours(this.value,t):-1!=g.indexOf("m")?r=wijmo_1.DateTime.addMinutes(this.value,t):-1!=g.indexOf("s")?r=wijmo_1.DateTime.addSeconds(this.value,t):-1!=g.indexOf("t")&&(r=this.value.getHours()>=12?wijmo_1.DateTime.addHours(this.value,-12):wijmo_1.DateTime.addHours(this.value,12));(this.timeMax&&r>f||this.timeMin&&r<b)&&(r=this.value)}this.value=r;this._reselectText(e,c)};InputDateTime.prototype._commitText=function(e,i){var o=this._tbx.value,n=wijmo_1.Globalize.parseDate(o,this.format,this.value),s=new Date,r=new Date;if(n){null!==this.timeMax&&(s=new Date(n.getFullYear(),n.getMonth(),n.getDate(),this.timeMax.getHours(),this.timeMax.getMinutes(),this.timeMax.getSeconds()));null!==this.timeMin&&(r=new Date(n.getFullYear(),n.getMonth(),n.getDate(),this.timeMin.getHours(),this.timeMin.getMinutes(),this.timeMin.getSeconds()));(this.timeMax&&n>s||this.timeMin&&n<r)&&(this.value=wijmo_1.DateTime.fromDateTime(n,this.value));t.prototype._commitText.call(this,e,i)}else t.prototype._commitText.call(this,e,i)};InputDateTime.prototype._updateTbxAria=function(){t.prototype._updateTbxAria.call(this);if(this._inputTime){var e=this._tbx,i=this._inputTime._lbx,o=i.selectedIndex,n=i.hostElement?i.hostElement.children:null,s=o>-1&&o<n.length?n[o].id:null;wijmo_1.setAttribute(e,"aria-activedescendant",this.isDroppedDown&&this.dropDown===this._ddTime&&s&&s.length?s:null);wijmo_1.setAttribute(e,"aria-haspopup",this.inputTime.isDroppedDown?"listbox":"dialog")}};Object.defineProperty(InputDateTime.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(t){var e=wijmo_1.asEnum(t,TabKeyAction);this._keyActionTab=e;this.inputTime.keyActionTab=e},enumerable:!0,configurable:!0});InputDateTime.prototype._setDropDownByEvent=function(t){var e=wijmo_1.closest(t.target,"button")==this._btn?this._ddDate:this._ddTime;this._setDropdown(e)};InputDateTime.prototype._updateBtnAria=function(){var t=this._btn,e=this.isDroppedDown,i=this.dropDown?this.dropDown.id:null,o=this._btnTm,n=e&&this.dropDown===this._ddDate,s=e&&this.dropDown===this._ddTime;wijmo_1.setAttribute(t,"aria-expanded",!!n);wijmo_1.setAttribute(t,"aria-controls",n?i:null);wijmo_1.setAttribute(o,"aria-expanded",!!s);wijmo_1.setAttribute(o,"aria-controls",s?i:null)};InputDateTime.prototype.inputDateTimeIsDroppedDownChanged=function(){var t=this.dropDown===this._ddDate?this._btn:this._btnTm;wijmo_1.toggleClass(t,exports.InputDateTimeClsNames.showDropDownButton,this.isDroppedDown)};InputDateTime._ctrlTemplate="";return InputDateTime}(InputDate);exports.InputDateTime=InputDateTime;wijmo_1._addCultureInfo("AutoComplete",{ariaLabels:{autoCompleteInput:"AutoComplete Input",autoComplete:"Auto Complete"}});var AutoComplete=function(t){__extends(AutoComplete,t);function AutoComplete(e,i){var o=t.call(this,e)||this;o._cssMatch=exports.ComboBoxClsNames.stateMatch;o._minLength=2;o._maxItems=6;o._itemCount=0;o._beginsWith=!1;o._delay=wijmo_1.Control._SEARCH_DELAY;o._selItems=null;o._query="";o._inCallback=!1;o._srchProps=[];o._oldSelectedIndex=-1;o._inputElementAriaLabel=wijmo_1.culture.AutoComplete.ariaLabels.autoCompleteInput;o._isBlurInput=!1;wijmo_1.addClass(o.hostElement,exports.AutoCompleteClsNames.hostElement);o._bsCollapse=!1;o.isEditable=!0;o.isRequired=!1;o.listBox.formatItem.addHandler(o._formatListItem,o);o._itemsSourceFnCallbackBnd=o._itemSourceFunctionCallback.bind(o);o.initialize(i);o._updateInputAriaLabel();return o}Object.defineProperty(AutoComplete,"controlTemplate",{get:function(){AutoComplete._ctrlTemplate||(AutoComplete._ctrlTemplate=ComboBox.controlTemplate);return AutoComplete._ctrlTemplate},set:function(t){AutoComplete._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"minLength",{get:function(){return this._minLength},set:function(t){this._minLength=wijmo_1.asNumber(t,!1,!0)},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"beginsWithSearch",{get:function(){return this._beginsWith},set:function(t){this._beginsWith=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"maxItems",{get:function(){return this._maxItems},set:function(t){this._maxItems=wijmo_1.asNumber(t,!1,!0)},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"delay",{get:function(){return this._delay},set:function(t){this._delay=wijmo_1.asNumber(t,!1,!0)},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"searchMemberPath",{get:function(){return this._srchProp},set:function(t){this._srchProp=wijmo_1.asString(t);this._srchProps=t?t.trim().split(/\s*,\s*/):[]},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"itemsSourceFunction",{get:function(){return this._itemsSourceFn},set:function(t){if(this._itemsSourceFn!==t){this._itemsSourceFn=wijmo_1.asFunction(t);wijmo_1.isFunction(this._itemsSourceFn)&&this.itemsSourceFunction(this.text,this.maxItems,this._itemsSourceFnCallbackBnd)}},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"cssMatch",{get:function(){return this._cssMatch},set:function(t){this._cssMatch=wijmo_1.asString(t)},enumerable:!0,configurable:!0});AutoComplete.prototype.onSelectedIndexChanged=function(e){this._settingText||t.prototype.onSelectedIndexChanged.call(this,e)};AutoComplete.prototype._updateTbxAria=function(){t.prototype._updateTbxAria.call(this);var e=this._tbx;wijmo_1.setAttribute(e,"aria-autocomplete","list")};AutoComplete.prototype._keydown=function(e){if(!this._isHiddenEditor()){if(!e.defaultPrevented&&this.isDroppedDown)switch(e.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:this.selectAll()}t.prototype._keydown.call(this,e)}};AutoComplete.prototype._input=function(t){this._handleDragTextState();this._handleComposingState();this._updateComponentText();this._updateEmptyValueFlag();this._resetDragState()};AutoComplete.prototype._commitText=function(t){var e=this;if(t&&this._composing&&this.isDroppedDown&&!wijmo_1.isFirefox()&&!wijmo_1.isSafari()&&""==this._textIsComposing){this._isBlurInput=!0;this.isDroppedDown=!1;setTimeout((function(){e.onLostFocus()}),this.delay+1)}t&&!this._composing&&(wijmo_1.isFirefox()||wijmo_1.isSafari())&&wijmo_1.getActiveElement()==this.inputElement&&this.onLostFocus()};AutoComplete.prototype._setText=function(t){var e=this;if(this._isBlurInput&&0==this.text.length){this._tbx.value=t;this._isBlurInput=!1}this.trimText&&!this.containsFocus()&&"string"==typeof t&&(t=t.trim());if(this._composing&&t!=this._oldText){this._oldText=t;this.onTextChanged()}if(!(this._inCallback||this._settingText||(wijmo_1.isFirefox()||wijmo_1.isSafari())&&this._composing)){this._toSearch||(this._oldSelectedIndex=this.selectedIndex);if(this.selectedIndex>-1&&this._getDisplayText(void 0,void 0,!0)!=t){this._settingText=!0;this.selectedIndex=-1;this._settingText=!1}this._toSearch&&clearTimeout(this._toSearch);if(t!=this._oldText||t!=this.text){"string"!=typeof t&&(t="");var i=this._tbx,o=this._tbx.selectionStart;i.value!=t&&(i.value=t);this._isWheel&&this.containsFocus()&&this._updateInputSelection(o);this._oldText=t;this.onTextChanged();var n=this.collectionView;if(!t&&n){(this._query||this.selectedIndex<0)&&(this.isDroppedDown=!1);this._query=this._rxHighlight=null;n.filter=null;var s=this.itemsSourceFunction;if(wijmo_1.isFunction(s)){this.isDroppedDown=!1;s(this._query,this.maxItems,this._itemsSourceFnCallbackBnd)}if(this.isRequired&&!this.containsFocus()&&!Array.isArray(this._selItems)){var r=this._oldSelectedIndex>-1?this._oldSelectedIndex:0;this.selectedIndex=r}-1==this.selectedIndex&&-1!=this._oldSelectedIndex&&this.onSelectedIndexChanged();return}}if(t!=this._getDisplayText(void 0,void 0,!0)){if(!this.containsFocus()&&this.trimText)if(this.isRequired&&!this.text.trim().length){r=this._oldSelectedIndex>-1?this._oldSelectedIndex:0;this.selectedIndex=r}else this._tbx.value=this._tbx.value.trim();var a=!this.containsFocus()&&t.length<this.minLength;this.collectionView&&!this.containsFocus()&&(this.collectionView.filter=null);var l=this.indexOf(t,!0),h=this.indexOf(t,!1);if(a)return;if(!this.containsFocus()&&(!t||this.trimText&&!this.text.trim().length||null!=this.collectionView&&l<0&&h<0)&&this.isRequired&&!this.isEditable){(r=this._oldSelectedIndex>-1?this._oldSelectedIndex:wijmo_1.hasItems(this.collectionView)?0:-1)!=this.selectedIndex&&(this.selectedIndex=r)}else if((Array.isArray(this.itemsSource)||"function"==typeof this.itemsSourceFunction)&&!this.containsFocus()&&t&&l<0&&(h<0||h!=l)&&!this.isRequired&&!this.isEditable){this._tbx.value="";this.selectedIndex=-1;this.onSelectedIndexChanged()}else{var u=this._delay>0?setTimeout:function(t,e){return t()};this._pendingSearchFn=function(){e._toSearch=null;var i=e.text;if(!e._composing&&i.trim().length>=e._minLength&&i!=e._query){e._query=i.trim();i=wijmo_1.escapeRegExp(i);var o=wijmo_1.escapeHtml(i.trim()),n=e.caseSensitiveSearch?"":"i";e._beginsWith||(n+="g");e._rxSrch=e._beginsWith?new RegExp("^"+i+".*",n):new RegExp("(?=.*"+i.replace(/ /g,")(?=.*")+")",n);e._rxHighlight=e._beginsWith?new RegExp("^"+i,n):new RegExp("("+o.replace(/\s+/g,"|")+")",n);var s=e.itemsSourceFunction;wijmo_1.isFunction(s)?s(e._query,e.maxItems,e._itemsSourceFnCallbackBnd):e._updateItems()}!t.trim().length&&!e.isEditable&&e.indexOf(t,!0)<0&&(e.selectedIndex=-1);-1==e.selectedIndex&&-1!=e._oldSelectedIndex&&e.onSelectedIndexChanged()};this._toSearch=u(this._pendingSearchFn,this._delay)}}else""===this._tbx.value&&t&&(this._tbx.value=t)}};AutoComplete.prototype.onLostFocus=function(e){var i=!1;if(this.isRequired&&!this.isEditable&&this.text&&this.text.length>=this.minLength){i=!0;var o=this.indexOf(this.text,!0);o<0&&(o=this.indexOf(this.text,!1));o>-1&&(this._oldSelectedIndex=o);o<0&&(this._oldSelectedIndex=0)}if(this._toSearch){clearTimeout(this._toSearch);this.text!==this._getDisplayText(void 0,void 0,!0)&&this._pendingSearchFn&&this._pendingSearchFn();i=!1}var n=this.collectionView;if(n&&0===n.items.length){this._oldFilter=n.filter;n.filter=null}t.prototype.onLostFocus.call(this,e,this._oldSelectedIndex,i)};AutoComplete.prototype.onGotFocus=function(e){this._toSearch||(this._oldSelectedIndex=this.selectedIndex);t.prototype.onGotFocus.call(this,e)};AutoComplete.prototype.reset=function(){this._oldSelectedIndex=-1};AutoComplete.prototype._itemSourceFunctionCallback=function(t){this._inCallback=!0;var e=wijmo_1.asCollectionView(t||[]);e.moveCurrentToPosition(-1);this.itemsSource=e;this._inCallback=!1;if(this.containsFocus()){var i=this._tbx,o=i.selectionStart,n=i.selectionEnd,s=this.collectionView;this.isDroppedDown=null!=s&&s.items.length>0;wijmo_1.setSelectionRange(i,o,n);this.refresh()}};AutoComplete.prototype.onIsDroppedDownChanged=function(e){t.prototype.onIsDroppedDownChanged.call(this,e);if(this.containsFocus()&&!this.isTouching){var i=this.collectionView;if(this.selectedIndex<0&&i){var o=i.items,n=this.text;1==o.length&&o[0]==n?this.selectedIndex=0:wijmo_1.setSelectionRange(this._tbx,n.length)}}this._query=""};AutoComplete.prototype._updateItems=function(){var t=this.collectionView;if(t){this._inCallback=!0;t.beginUpdate();this._itemCount=0;t.filter=this._filter.bind(this);t.moveCurrentToPosition(-1);t.endUpdate();this._inCallback=!1;var e=t.items.length,i=this._tbx,o=i.selectionStart,n=i.selectionEnd;this.text.trim()||(e=0);this.isDroppedDown=e>0&&this.containsFocus();e||this.isEditable||(this.selectedIndex=-1);if(1==e&&this.selectedIndex<0){var s=this._getItemText(t.items[0],!1),r=i.value;if(!this.caseSensitiveSearch){s=s.toLowerCase();r=r.toLowerCase()}(s==r||this.trimText&&s.trim()==r)&&(this.selectedIndex=0)}this.isDroppedDown&&wijmo_1.setSelectionRange(i,o,n);this.refresh()}};AutoComplete.prototype._filter=function(t){if(this._itemCount>=this._maxItems&&this._query)return!1;var e=[this._getItemText(t,!1)];this._srchProps&&this._srchProps.forEach((function(i){var o=t[i];null!=o&&e.push(o)}));this.isContentHtml&&(e=e.map((function(t){return t.replace(/(<[^>]*>|&[^;]*;)/g,"")})));for(var i=0;i<e.length;i++)if(this._rxSrch.test(e[i])){this._itemCount++;return!0}return!1};AutoComplete.prototype._getItemText=function(t,e){var i=t?t.toString():"",o=e&&this.headerPath?this._pathHdr:this._lbx._pathDisplay;o&&(i=null!=(i=o.getValue(t))?i.toString():"");return i};AutoComplete.prototype._formatListItem=function(t,e){var i=this;this._cssMatch&&this._rxHighlight&&this._query&&(e.item.innerHTML=e.item.innerHTML.replace(this._rxHighlight,(function(t,e,o,n){return i._enclosed(n,o,"<",">")||i._enclosed(n,o,"&",";")?t:'<span class="'+i._cssMatch+'">'+t+"</span>"})))};AutoComplete.prototype._enclosed=function(t,e,i,o){for(var n=e;n>=0&&t[n]!=o;n--)if(t[n]==i)for(var s=e;s<t.length&&t[s]!=i;s++)if(t[s]==o)return!0;return!1};AutoComplete.prototype._wheel=function(e){t.prototype._wheel.call(this,e)};AutoComplete.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.AutoComplete.ariaLabels.autoComplete};AutoComplete.prototype._hasCustomFormatItem=function(){return this.formatItem.getHandler.length>1};AutoComplete._ctrlTemplate="";return AutoComplete}(ComboBox);exports.AutoComplete=AutoComplete;wijmo_1._addCultureInfo("MultiAutoComplete",{ariaLabels:{multiAutoCompleteInput:"MultiAutoComplete Input",multiAutoComplete:"MultiAutoComplete",multiAutoCompleteHelperInput:"MultiAutoComplete Helper Input"}});var MultiAutoComplete=function(t){__extends(MultiAutoComplete,t);function MultiAutoComplete(e,i){var o=t.call(this,e)||this;o._maxSelItems=null;o._lastInputValue="";o._selPath=new wijmo_1.Binding(null);o._notAddItm=!1;o._inputElementAriaLabel=wijmo_1.culture.MultiAutoComplete.ariaLabels.multiAutoCompleteInput;o._helperInputElementAriaLabel=wijmo_1.culture.MultiAutoComplete.ariaLabels.multiAutoCompleteHelperInput;o._ariaLabelledby=null;o.selectedItemsChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.MultiAutoCompleteClsNames.hostElement);o._wjTpl=o.hostElement.querySelector("."+wijmo_1.ControlClsNames.template);o._wjInput=o.hostElement.querySelector("."+exports.InputClsNames.input);o.showDropDownButton=!1;o._selItems=[];o.initialize(i);o.addEventListener(o.hostElement,"keyup",o._keyup.bind(o),!0);o.addEventListener(window,"resize",o._adjustInputWidth.bind(o));o.addEventListener(o._tbx,"focus",(function(){o._itemOff()}));o._addHelperInput();o._initSeltems();o.listBox.itemsChanged.addHandler((function(){if(-1!==o.selectedIndex){var t=o.collectionView;(t&&("CollectionView"==t.constructor.name||"ODataVirtualCollectionView"==t.constructor.name)||t.virtualization)&&(o.selectedIndex=-1)}}));o._refreshHeader();o._updateTabIndex();o._updateInputAriaLabel();return o}Object.defineProperty(MultiAutoComplete,"controlTemplate",{get:function(){MultiAutoComplete._ctrlTemplate||(MultiAutoComplete._ctrlTemplate=AutoComplete.controlTemplate);return MultiAutoComplete._ctrlTemplate},set:function(t){MultiAutoComplete._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"showDropDownButton",{set:function(t){this._showBtn=!1},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"maxSelectedItems",{get:function(){return this._maxSelItems},set:function(t){if(this._maxSelItems!=t){this._maxSelItems=wijmo_1.asNumber(t,!0);this._updateMaxItems();this._refreshHeader();this._clearSelIndex()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"selectedMemberPath",{get:function(){return this._selPath.path},set:function(t){if((t=wijmo_1.asString(t))!==this.selectedMemberPath){this._selPath.path=t;this._initSeltems();this._refreshHeader();this.onSelectedItemsChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"selectedItems",{get:function(){return this._selItems},set:function(t){t=Array.from(new Set(t));var e=this._selItems===t;e||null==this._selItems||null==t||this._selItems.length!==t.length||(e=this._selItems.every((function(e,i){return e===t[i]})));this._selItems=wijmo_1.asArray(t);if(!e){if(this.selectedMemberPath&&""!==this.selectedMemberPath&&this._selItems)for(var i=0;i<this._selItems.length;i++){var o=this._selItems[i];this._setSelItem(o,!1)}this._updateMaxItems();this.onSelectedItemsChanged();this._refreshHeader();this._clearSelIndex()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(t){wijmo_1._setAriaLabelBy(this,this._tbx,t,this._updateInputAndListBoxAriaLabel.bind(this))},enumerable:!0,configurable:!0});MultiAutoComplete.prototype.onSelectedItemsChanged=function(t){this.selectedItemsChanged.raise(this,t)};MultiAutoComplete.prototype.onIsDroppedDownChanged=function(e){!this.isDroppedDown&&this.selectedIndex>-1&&!this._notAddItm&&this._addItem(!0);this._notAddItm=!1;t.prototype.onIsDroppedDownChanged.call(this,e)};MultiAutoComplete.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);if(this.hostElement){this._initSeltems();this.isDroppedDown||this._refreshHeader()}};MultiAutoComplete.prototype._keydown=function(e){if(!this.isReadOnly){if(!e.defaultPrevented)switch(e.keyCode){case wijmo_1.Key.Back:this._lastInputValue=this._tbx.value;break;case wijmo_1.Key.Enter:this._itemOff();this._addItem(!0);wijmo_1.isIE()&&wijmo_1.setSelectionRange(this._tbx,this._tbx.textContent.length,this._tbx.textContent.length);break;case wijmo_1.Key.Tab:if(this.isDroppedDown){this._addItem(!1);this._tbx.value="";this._lbx.selectedIndex=-1;this.isDroppedDown=!1;this.containsFocus()||this.focus();e.preventDefault()}else this._updateFocus();break;case wijmo_1.Key.Space:if(""!==this._tbx.value)return;if(!this.isDroppedDown&&!this._tbx.disabled){this.isDroppedDown=!0;this._clearSelIndex()}break;case wijmo_1.Key.Escape:this.isDroppedDown&&(this._notAddItm=!0);break;case wijmo_1.Key.Left:this._itemOn(!this.rightToLeft);break;case wijmo_1.Key.Right:this._itemOn(!!this.rightToLeft);break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:var i=wijmo_1.getActiveElement();if(e.altKey){if(this._tbx==i){this.isDroppedDown=!this.isDroppedDown;this.isDroppedDown||this._tbx.focus();e.preventDefault();return}}else if(this._tbx!==i)return;default:if(e.keyCode===wijmo_1.Key.Back||e.keyCode===wijmo_1.Key.Delete)return;this._itemOff();null!=this._maxSelItems&&this._selItems.length>=this._maxSelItems&&e.preventDefault()}this._tbx.disabled||t.prototype._keydown.call(this,e)}};MultiAutoComplete.prototype._updateState=function(){t.prototype._updateState.call(this);this._wjTpl&&(wijmo_1.hasClass(this.hostElement,wijmo_1.ControlStateClsNames.focused)||this._itemOff())};MultiAutoComplete.prototype._keyup=function(t){if(!this.isReadOnly&&!t.defaultPrevented)switch(t.keyCode){case wijmo_1.Key.Back:0===this._tbx.value.length&&0===this._lastInputValue.length&&this._delItem(!1);break;case wijmo_1.Key.Delete:this._delItem(!0)}};MultiAutoComplete.prototype._addHelperInput=function(){var t=document.createElement("input");t.type="text";t.tabIndex=-1;t.className=exports.MultiAutoCompleteClsNames.tokenHelper;t.readOnly=!0;wijmo_1.setAttribute(t,"aria-label",this._helperInputElementAriaLabel);this._wjTpl.insertBefore(t,this._wjInput);this._helperInput=t};MultiAutoComplete.prototype._refreshHeader=function(){for(var t=this.hostElement.querySelectorAll("."+exports.MultiAutoCompleteClsNames.token),e=0;e<t.length;e++)this._wjTpl.removeChild(t[e]);var i=this.selectedItems;if(i&&0!==i.length){for(e=0;e<i.length;e++)this._insertToken(i[e]);this._wjInput.style.cssFloat=this.rightToLeft?"right":"left";this._adjustInputWidth()}else{this._wjInput.style.cssFloat=this.rightToLeft?"right":"left";this._adjustInputWidth()}};MultiAutoComplete.prototype._insertToken=function(t){var e=this._getItemText(t,!0);this.isContentHtml||(e=wijmo_1.escapeHtml(e));this._wjTpl.insertBefore(this._createItem(e),this._wjInput)};MultiAutoComplete.prototype._updateMaxItems=function(){null!=this._maxSelItems&&this._selItems&&this._selItems.length>this._maxSelItems&&(this._selItems=this._selItems.slice(0,this._maxSelItems))};MultiAutoComplete.prototype._updateFocus=function(){var t=this,e=this._wjTpl.querySelector("."+MultiAutoComplete._clsActive);if(e){wijmo_1.removeClass(e,MultiAutoComplete._clsActive);setTimeout((function(){t._tbx.focus()}))}else this._clearSelIndex()};MultiAutoComplete.prototype._addItem=function(t){if(this.selectedItems.indexOf(this.selectedItem)>-1)this._clearSelIndex();else if(this.selectedIndex>-1){this._updateSelItems(this.selectedItem,!0);this._refreshHeader();t&&this._clearSelIndex();this._disableInput(!0)}};MultiAutoComplete.prototype._delItem=function(t){var e,i,o=this._wjTpl.querySelector("."+MultiAutoComplete._clsActive),n=!1;if(!t||o){if(o){if((i=this._getItemIndex(o))>-1){e=this._selItems[i];n=!0}}else if(this._selItems.length>0){e=this._selItems[this._selItems.length-1];n=!0}if(n){this._updateSelItems(e,!1);this._refreshHeader();this._clearSelIndex();this._disableInput(!1)}this._tbx.focus()}};MultiAutoComplete.prototype._updateSelItems=function(t,e){if(e){this._selItems&&0!==this._selItems.length||(this._selItems=[]);if(null!=this._maxSelItems&&this._selItems.length>=this._maxSelItems)return;this._selItems.push(t)}else{var i=this._selItems.indexOf(t);this._selItems.splice(i,1)}this._hasSelectedMemeberPath()&&this._setSelItem(t,e);this.onSelectedItemsChanged()};MultiAutoComplete.prototype._createItem=function(t){var e=this,i=document.createElement("div"),o=document.createElement("span"),n=document.createElement("a");i.appendChild(o);i.appendChild(n);i.className=exports.MultiAutoCompleteClsNames.token;o.className=exports.MultiAutoCompleteClsNames.tokenLabel;o.innerHTML=t;n.className=exports.MultiAutoCompleteClsNames.tokenClose;n.href="#";n.tabIndex=-1;n.text="×";i.style.cssFloat=this.rightToLeft?"right":"left";this.addEventListener(i,"click",(function(t){e._helperInput.focus();var o=e._wjTpl.querySelector("."+MultiAutoComplete._clsActive);o&&wijmo_1.removeClass(o,MultiAutoComplete._clsActive);wijmo_1.addClass(i,MultiAutoComplete._clsActive);t.stopPropagation();t.preventDefault()}));this.addEventListener(n,"click",(function(t){if(!e.isReadOnly){var o=e._getItemIndex(i);if(o>-1){var n=e._selItems[o];e._updateSelItems(n,!1)}e._wjTpl.removeChild(i);e._adjustInputWidth();e._disableInput(!1);e._tbx.focus();t.stopPropagation();t.preventDefault()}}));return i};MultiAutoComplete.prototype._itemOn=function(t){var e,i,o,n=wijmo_1.getActiveElement();if((this._tbx!=n||0===this._tbx.value.length)&&0!==(e=this._wjTpl.querySelectorAll("."+exports.MultiAutoCompleteClsNames.token)).length){i=this._wjTpl.querySelector("."+MultiAutoComplete._clsActive);o=this._getItemIndex(i);if(t){if(0===o)return;if(-1===o){wijmo_1.addClass(e[e.length-1],MultiAutoComplete._clsActive);this._helperInput.focus()}else{wijmo_1.removeClass(i,MultiAutoComplete._clsActive);wijmo_1.addClass(e[o-1],MultiAutoComplete._clsActive);this._helperInput.focus()}}else if(!t){if(-1===o)return;if(o!==e.length-1){wijmo_1.removeClass(i,MultiAutoComplete._clsActive);wijmo_1.addClass(e[o+1],MultiAutoComplete._clsActive);this._helperInput.focus()}else{wijmo_1.removeClass(i,MultiAutoComplete._clsActive);this._tbx.focus()}}}};MultiAutoComplete.prototype._itemOff=function(){var t=this._wjTpl.querySelector("."+MultiAutoComplete._clsActive);t&&wijmo_1.removeClass(t,MultiAutoComplete._clsActive)};MultiAutoComplete.prototype._initSeltems=function(){if(this.selectedMemberPath){this._selItems.splice(0,this._selItems.length);var t=this.collectionView;if(t)for(var e=0;e<t.sourceCollection.length;e++)this._getSelItem(e)&&this._selItems.push(t.sourceCollection[e])}};MultiAutoComplete.prototype._getSelItem=function(t){var e=this.collectionView,i=e?e.sourceCollection[t]:null;return!(!wijmo_1.isObject(i)||!this.selectedMemberPath)&&this._selPath.getValue(i)};MultiAutoComplete.prototype._setSelItem=function(t,e){this.itemsSource;wijmo_1.isObject(t)&&this._selPath.getValue(t)!=e&&this._selPath.setValue(t,e)};MultiAutoComplete.prototype._clearSelIndex=function(){this.selectedIndex=-1};MultiAutoComplete.prototype._hasSelectedMemeberPath=function(){return this.selectedMemberPath&&""!==this.selectedMemberPath};MultiAutoComplete.prototype._disableInput=function(t){if(null!=this._maxSelItems)if(this._selItems.length<this._maxSelItems){this._tbx.disabled=!1;this._tbx.focus()}else{this._tbx.disabled=!0;this.hostElement.focus()}};MultiAutoComplete.prototype._adjustInputWidth=function(){this._tbx.style.width="60px";var t,e=wijmo_1.getElementRect(this.hostElement),i=wijmo_1.getElementRect(this._tbx),o=getComputedStyle(this._tbx),n=parseInt(o.paddingLeft,10),s=parseInt(o.paddingRight,10);t=this.rightToLeft?i.left+i.width-e.left-n-s-8:e.left+e.width-i.left-n-s-8;this._tbx.style.width=t+"px"};MultiAutoComplete.prototype._getItemIndex=function(t){for(var e=this.hostElement.querySelectorAll("."+exports.MultiAutoCompleteClsNames.token),i=0;i<e.length;i++)if(t===e[i])return i;return-1};MultiAutoComplete.prototype._setIsDisabled=function(e){t.prototype._setIsDisabled.call(this,e);this._updateTabIndex()};MultiAutoComplete.prototype._setTabOrder=function(t){this._orgTabIndex=t;this._updateTabIndex()};MultiAutoComplete.prototype._updateTabIndex=function(){var t=this.hostElement;this._tbx.tabIndex=this.isDisabled?-1:this._orgTabIndex;t.tabIndex=-1};MultiAutoComplete._clsActive=exports.MultiAutoCompleteClsNames.tokenActive;MultiAutoComplete._ctrlTemplate="";return MultiAutoComplete}(AutoComplete);exports.MultiAutoComplete=MultiAutoComplete;wijmo_1._registerModule("wijmo.input",selfModule);
|
|
14
|
+
"use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};return function(t,e){extendStatics(t,e);function __(){this.constructor=t}t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}(),__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++){e=arguments[i];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t}).apply(this,arguments)},__importStar=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);e.default=t;return e};Object.defineProperty(exports,"__esModule",{value:!0});var wijmo_1=require("@mescius/wijmo"),selfModule=__importStar(require("@mescius/wijmo.input"));exports.AutoCompleteClsNames={hostElement:"wj-autocomplete"};exports.CalendarClsNames={buttonsOutside:"wj-btns-outside",calendarHeader:"wj-calendar-header",calendarMonth:"wj-calendar-month",calendarMultiMonth:"wj-calendar-multimonth",calendarOuter:"wj-calendar-outer",calendarYear:"wj-calendar-year",dayOtherMonth:"wj-day-othermonth",dayToday:"wj-day-today",dayWeekend:"wj-day-weekend",header:"wj-header",hostElement:"wj-calendar",monthSelect:"wj-month-select",weekAfter:"wj-week-after",weekBefore:"wj-week-before",yearPicker:"wj-yearpicker",focused:"wj-state-focus",selectedYear:"wj-select-year",confirmationButtonContainer:"wj-calendar-confirmation-button-container",button:"wj-calendar-button"};exports.CollectionViewNavigatorClsNames={hostElement:"wj-collectionview-navigator",pager:"wj-pager"};exports.ColorPickerClsNames={colorBox:"wj-colorbox",hostElement:"wj-colorpicker"};exports.ComboBoxClsNames={hostElement:"wj-combobox",stateMatch:"wj-state-match"};exports.DropDownClsNames={dropDownPanel:"wj-dropdown-panel",hostElement:"wj-dropdown"};exports.InputClsNames={input:"wj-input",inputBtnVisible:"wj-input-btn-visible",inputGroup:"wj-input-group",inputGroupBtn:"wj-input-group-btn"};exports.InputColorClsNames={hostElement:"wj-inputcolor",inputColorBox:"wj-inputcolorbox"};exports.InputDateClsNames={hostElement:"wj-inputdate",inputDateDropDown:"wj-inputdate-dropdown"};exports.InputDateRangeClsNames={hostElement:"wj-inputdaterange"};exports.InputDateTimeClsNames={hostElement:"wj-inputdatetime",showDropDownButton:"wj-show-dropdown-button"};exports.InputMaskClsNames={hostElement:"wj-inputmask"};exports.InputNumberClsNames={hostElement:"wj-inputnumber",numeric:"wj-numeric",showSpinner:"wj-input-show-spinner"};exports.InputTimeClsNames={hostElement:"wj-inputtime"};exports.ListBoxClsNames={header:"wj-header",hostElement:"wj-listbox",listBoxItem:"wj-listbox-item"};exports.MenuClsNames={hostElement:"wj-menu",menuItems:"wj-menu-items",subItems:"wj-subitems"};exports.MultiAutoCompleteClsNames={hostElement:"wj-multi-autocomplete",token:"wj-token",tokenActive:"wj-token-active",tokenClose:"wj-token-close",tokenHelper:"wj-token-helper",tokenLabel:"wj-token-label",screenReaderOnly:"wj-sr-only"};exports.MultiSelectClsNames={hostElement:"wj-multiselect"};exports.MultiSelectListBoxClsNames={header:"wj-header",hostElement:"wj-multiselectlistbox",selectAll:"wj-select-all"};exports.PopupClsNames={dialogHeader:"wj-dialog-header",hostElement:"wj-popup",popupBackDrop:"wj-popup-backdrop",dialogBody:"wj-dialog-body",dialogFooter:"wj-dialog-footer"};wijmo_1._addCultureInfo("InputNumber",{ariaLabels:{incVal:"Increase Value",decVal:"Decrease Value",inputNumberInput:"InputNumber Input",inputNumber:"Input Number"}});var InputNumber=function(t){__extends(InputNumber,t);function InputNumber(e,i){var o=t.call(this,e)||this;o._value=null;o._min=null;o._max=null;o._format="";o._step=null;o._showBtn=!0;o._readOnly=!1;o._handleWheel=!0;o._oldText="";o._fromKb=!0;o._inputElementAriaLabel=wijmo_1.culture.InputNumber.ariaLabels.inputNumberInput;o._ariaLabelledby=null;o.textChanged=new wijmo_1.Event;o.valueChanged=new wijmo_1.Event;var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.InputNumberClsNames.hostElement,n,{_tbx:"input",_btnUp:"btn-inc",_btnDn:"btn-dec"},"input");var s=o.inputElement;o.hostElement;wijmo_1.setAttribute(s,"role","spinbutton",!0);o._updateInputAriaLabel();var r=wijmo_1.culture.InputNumber.ariaLabels;wijmo_1.setAriaLabel(o._btnUp.querySelector("button"),r.incVal);wijmo_1.setAriaLabel(o._btnDn.querySelector("button"),r.decVal);o._tbx.type.match(/number/i)&&(o.inputType="");var a=o._tbx;a.autocomplete="off";a.spellcheck=!1;o._updateSymbols();var l=o.addEventListener.bind(o);l(a,"keypress",o._keypress.bind(o));l(a,"keydown",o._keydown.bind(o));l(a,"input",o._input.bind(o));l(a,"blur",(function(){o.text!=o._oldText&&o._setText(o.text)}));l(a,"paste",(function(){o._fromKb=!1}));l(a,"compositionstart",(function(){o._composing=!0}));l(a,"compositionend",(function(){o._composing=!1;setTimeout((function(){var t=o.text,e=o._oldText,i=o._chrPct;e&&e.indexOf(i)>-1&&t.indexOf(i)<0&&(t+=i);o._setText(t)}))}));var h=o._clickSpinner.bind(o);l(o._btnUp,"click",h);l(o._btnDn,"click",h);o._rptUp=new wijmo_1._ClickRepeater(o._btnUp.querySelector("button"));o._rptDn=new wijmo_1._ClickRepeater(o._btnDn.querySelector("button"));l(a,"wheel",(function(t){if(o.handleWheel&&!t.defaultPrevented&&!t.ctrlKey&&o._isEditable()&&o.containsFocus()){var e=wijmo_1.clamp(-t.deltaY,-1,1);o._increment((o.step||1)*e);setTimeout((function(){return o.selectAll()}));t.preventDefault()}}));o.value=0;o.isRequired=!0;o.initialize(i);return o}Object.defineProperty(InputNumber,"controlTemplate",{get:function(){InputNumber._ctrlTemplate||(InputNumber._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+'"><div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+'"><span wj-part="btn-dec" class="'+exports.InputClsNames.inputGroupBtn+'" tabindex="-1"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1">-</button></span><input type="tel" inputmode="numeric" wj-part="input" class="'+wijmo_1.InputFormElementsClsNames.formControl+" "+exports.InputNumberClsNames.numeric+'"/><span wj-part="btn-inc" class="'+exports.InputClsNames.inputGroupBtn+'" tabindex="-1"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1">+</button></span></div></div></div>');return InputNumber._ctrlTemplate},set:function(t){InputNumber._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"inputType",{get:function(){return this._tbx.type},set:function(t){this._tbx.type=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"value",{get:function(){return this._value},set:function(t){if(t!=this._value)if(null==(t=wijmo_1.asNumber(t,!this.isRequired||null==t&&null==this._value)))this._setText("");else if(!isNaN(t)){var e=wijmo_1.Globalize.format(t,this.format);this._setText(e)}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"isRequired",{get:function(){return this._tbx.required},set:function(t){this._tbx.required=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"isReadOnly",{get:function(){return this._readOnly},set:function(t){this._readOnly=wijmo_1.asBoolean(t);this.inputElement.readOnly=this._readOnly;wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(t){this._handleWheel=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"min",{get:function(){return this._min},set:function(t){if(t!=this._min){this._min=wijmo_1.asNumber(t,!0);this._updateAria()}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"max",{get:function(){return this._max},set:function(t){if(t!=this._max){this._max=wijmo_1.asNumber(t,!0);this._updateAria()}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"step",{get:function(){return this._step},set:function(t){this._step=wijmo_1.asNumber(t,!0);this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"format",{get:function(){return this._format},set:function(t){if(t!=this.format){this._format=wijmo_1.asString(t);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"text",{get:function(){return this._tbx.value},set:function(t){if(t!=this.text){this._oldText=this.text;this._setText(t)}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"placeholder",{get:function(){return this._tbx.placeholder},set:function(t){this._tbx.placeholder=t},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"showSpinner",{get:function(){return this._showBtn},set:function(t){this._showBtn=wijmo_1.asBoolean(t);this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"repeatButtons",{get:function(){return!this._rptUp.disabled},set:function(t){this._rptUp.disabled=this._rptDn.disabled=!wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(t){wijmo_1._setAriaLabelBy(this,this._tbx,t,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});InputNumber.prototype.selectAll=function(){var t=this._tbx;wijmo_1.setSelectionRange(t,0,t.value.length)};InputNumber.prototype.clamp=function(t){return wijmo_1.clamp(t,this.min,this.max)};InputNumber.prototype.onTextChanged=function(t){this.textChanged.raise(this,t);this._updateState()};InputNumber.prototype.onValueChanged=function(t){this._updateAria();this.valueChanged.raise(this,t)};InputNumber.prototype.dispose=function(){this._rptUp.element=null;this._rptDn.element=null;t.prototype.dispose.call(this)};InputNumber.prototype.onGotFocus=function(e){this._oldValue=this.value;if(!this.isTouching){this._tbx.focus();this.selectAll()}t.prototype.onGotFocus.call(this,e)};InputNumber.prototype.onLostFocus=function(e){if(this._composing){this._composing=!1;this._setText(this.text)}if(this._isEditable()){var i=this.clamp(this.value);if(i==this.value||this.onInvalidInput(new wijmo_1.CancelEventArgs)){var o=wijmo_1.Globalize.format(i,this.format);this._setText(o)}}t.prototype.onLostFocus.call(this,e)};InputNumber.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);if(this.hostElement){this._updateSymbols();var i=wijmo_1.Globalize.format(this.value,this.format);this._setText(i)}};InputNumber.prototype._isEditable=function(){return!this.isReadOnly&&!this.isDisabled};InputNumber.prototype._updateSymbols=function(){var t=wijmo_1.culture.Globalize.numberFormat,e=wijmo_1.Globalize._parseNumericFormat(this.format);this._chrDec=t["."]||".";this._chrTho=t[","]||",";this._chrNeg=t["-"]||"-";this._chrPls=t["+"]||"+";this._chrPct=t["%"]||"%";this._chrCur=e.curr||t.currency.symbol||"$";this._fmtSpc=e.spec;this._fmtPrc=e.prec;this._rxSym=new RegExp("^[%+\\-() \\"+this._chrDec+"\\"+this._chrCur+"\\"+this._chrNeg+"\\"+this._chrPls+"\\"+this._chrPct+"]*$");this._rxNeg=new RegExp("^\\s*(\\-|\\"+this._chrNeg+")|([^e](\\-|\\"+this._chrNeg+")|\\()")};InputNumber.prototype._isNumeric=function(t,e){var i=t==this._chrDec||t>="0"&&t<="9",o="x"==this._fmtSpc;!i&&o&&(i=t>="a"&&t<="f"||t>="A"&&t<="F");i||e||o||(i=t==this._chrPls||t==this._chrNeg||"("==t||")"==t);return i};InputNumber.prototype._getInputRange=function(t){for(var e=[0,0],i=this.text,o=!1,n=0;n<i.length;n++)if(this._isNumeric(i[n],t)){if(!o){e[0]=n;o=!0}e[1]=n+1}return e};InputNumber.prototype._flipSign=function(){var t=this._getSelStartDigits();this.value*=-1;this._setSelStartDigits(t)};InputNumber.prototype._getSelStartDigits=function(){for(var t=0,e=this._tbx.selectionStart,i=this._tbx.value,o=0;o<i.length&&o<e;o++)this._isNumeric(i[o],!0)&&t++;return t};InputNumber.prototype._setSelStartDigits=function(t){for(var e=this._tbx.value,i=0;i<e.length&&t>=0;i++)if(this._isNumeric(e[i],!0)){if(!t){wijmo_1.setSelectionRange(this._tbx,i);break}t--}else if(!t){wijmo_1.setSelectionRange(this._tbx,i);break}};InputNumber.prototype._increment=function(t){if(t){var e=this.clamp(wijmo_1.isNumber(this.value)?this.value+t:0),i=wijmo_1.Globalize.format(e,this.format,!1,!1);this._setText(i)}};InputNumber.prototype._updateBtn=function(){var t=this.showSpinner&&!!this.step,e=t;wijmo_1.setCss([this._btnUp,this._btnDn],{display:t?"":"none"});wijmo_1.toggleClass(this.hostElement,exports.InputNumberClsNames.showSpinner,t);wijmo_1.enable(this._btnUp,e);wijmo_1.enable(this._btnDn,e);this._updateAria()};InputNumber.prototype._setText=function(t,e,i){void 0===e&&(e=!1);void 0===i&&(i=!1);if(!this._composing){var o=this._tbx,n=this._chrDec,s=this._rxNeg.test(t),r=this._delKey,a=this.containsFocus();t&&this._rxSym.test(t)&&a&&(t=this.isRequired||!r?(s?"-0":"0")+(t.indexOf(n)>-1?n:""):"");this._delKey=!1;r&&0==this.value&&!this.isRequired&&(t="");if(!t){if(!this.isRequired||i){o.value="";if(this._oldText){this._oldText=t;this.onTextChanged()}if(null!=this._value){this._value=null;this.onValueChanged()}this._updateBtn();return}t="0"}var l=t.indexOf(n),h=this._format||(l>-1?"n2":"n0"),u=wijmo_1.Globalize.parseFloat(t,h);isFinite(u)||(u=this.clamp(u));if(isNaN(u))if(this.onInvalidInput(new wijmo_1.CancelEventArgs))o.value=this._oldText;else{o.value=t;this.focus()}else{var c=a&&l>-1?2:null,p=wijmo_1.Globalize.format(u,h,!1,e,c);s&&u>=0&&!r&&(p=this._chrNeg+p);a&&l>-1&&"g"==this._fmtSpc&&0!=this._fmtPrc&&(p=t).indexOf(n)<0&&(p+=n);if(o.value!=p){o.value=p;u=wijmo_1.Globalize.parseFloat(p,h)}if(this.text!=this._oldText){this._oldText=this.text;this.onTextChanged()}if(u!=this._value){this._value=u;this.onValueChanged()}this._updateBtn();this._updateState()}}};InputNumber.prototype._keypress=function(t){if(!t.defaultPrevented&&!this._composing&&this._isEditable()&&t.charCode&&!t.ctrlKey&&!t.metaKey&&t.keyCode!=wijmo_1.Key.Enter){var e=this._tbx,i=String.fromCharCode(t.charCode);if(this._isNumeric(i,!1)){var o=e.maxLength;if(o>-1&&e.value.length>=o&&e.selectionEnd==e.selectionStart){t.preventDefault();return}var n=this._getInputRange(!0),s=e.selectionStart,r=e.selectionEnd;if(s<n[0]&&r<e.value.length){r=Math.max(r,n[0]);wijmo_1.setSelectionRange(e,n[0],r)}if(s>=n[1]){var a=null!=this._fmtPrc?this._fmtPrc:2,l=e.value.indexOf(this._chrDec);l>-1&&s-l>a&&t.preventDefault()}}else t.preventDefault();switch(i){case"-":case this._chrNeg:if(this.clamp(-1)>=0)this.value<0&&this._flipSign();else if(this.value&&e.selectionStart==e.selectionEnd)this._flipSign();else if(this.clamp(-1)<0){e.value=this._chrNeg;wijmo_1.setSelectionRange(e,1)}t.preventDefault();break;case"+":case this._chrPls:this.value<0&&this._flipSign();t.preventDefault();break;case".":case this._chrDec:if(0==this._fmtPrc)t.preventDefault();else{var h=e.value.indexOf(this._chrDec);if(h>-1){e.selectionStart<=h&&h++;wijmo_1.setSelectionRange(e,h);t.preventDefault()}}}if(!t.defaultPrevented&&wijmo_1.isIE()){var u=e.value;if((s=e.selectionStart)==(r=e.selectionEnd)){e.value=u.substr(0,s)+i+u.substr(r);wijmo_1.setSelectionRange(e,s+1);t.preventDefault();this._input()}}}};InputNumber.prototype._keydown=function(t){var e=this;this._delKey=!1;if(!t.defaultPrevented&&!this._composing){var i=wijmo_1.hasClass(this._tbx,"wj-grid-ime");if(!i||t.keyCode==wijmo_1.Key.Back||t.keyCode==wijmo_1.Key.Delete){var o=this._tbx,n=o.value,s=o.selectionStart,r=o.selectionEnd;switch(t.keyCode){case 65:if(t.ctrlKey){setTimeout((function(){e.selectAll()}));t.preventDefault()}break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(this.step&&this._isEditable()){this._increment(this.step*(t.keyCode==wijmo_1.Key.Up?1:-1));setTimeout((function(){e.selectAll()}));t.preventDefault()}break;case wijmo_1.Key.Back:this._delKey=!0;if(r-s<2&&this._isEditable()){var a=n[r-1];if(a==this._chrDec||a==this._chrPct||a==this._chrTho||")"==a){setTimeout((function(){r=a==e._chrPct?e._getInputRange(!0)[1]:r-1;wijmo_1.setSelectionRange(o,r)}));t.preventDefault()}}break;case wijmo_1.Key.Delete:this._delKey=!0;if(r-s<2&&this._isEditable())if("0"==n&&1==s)wijmo_1.setSelectionRange(o,0);else{var l=n[s];if(l==this._chrDec||l==this._chrPct){setTimeout((function(){wijmo_1.setSelectionRange(o,s+1)}));t.preventDefault()}}break;case wijmo_1.Key.Escape:this.value=this._oldValue;this.selectAll()}i&&this._delKey&&this._isEditable()&&this._setText(null,!1,!0)}}};InputNumber.prototype._input=function(){var t=this;this._composing?this._fromKb=!0:setTimeout((function(){var e=t._tbx,i=e.value,o=i.indexOf(t._chrDec),n=e.selectionStart,s=t._getSelStartDigits();"p"==t._fmtSpc&&i.length&&i.indexOf(t._chrPct)<0&&(i+=t._chrPct);t._setText(i,t._fromKb);t._fromKb=!0;if(t.containsFocus()){var r=e.value,a=r.indexOf(t._chrDec),l=t._getInputRange(!0);if(i==t._chrNeg+t._chrDec&&a>-1){wijmo_1.setSelectionRange(e,a+1);return}if(i[0]==t._chrNeg&&r[0]!=t._chrNeg){if(1==r.length)wijmo_1.setSelectionRange(e,1);else{"c"===t._fmtSpc&&t._isNegativeCurrencyByParenthesis(i)&&(s-=1);t._setSelStartDigits(s)}return}i?i==t._chrDec&&a>-1?n=a+1:n<=o&&a>-1||o<0&&a<0?n+=r.length-i.length:o<0&&a>-1&&(n=a):n=a>-1?a:l[1];n=wijmo_1.clamp(n,l[0],l[1]);wijmo_1.setSelectionRange(e,n)}}))};InputNumber.prototype._isNegativeCurrencyByParenthesis=function(t){return t.length>1&&t[1]===this._chrCur};InputNumber.prototype._clickSpinner=function(t){var e=this;if(!t.defaultPrevented&&this._isEditable()&&this.step){this._increment(this.step*(wijmo_1.contains(this._btnUp,t.target)?1:-1));if(!this.isTouching){wijmo_1.Control.sharedState.InvalidScroll=wijmo_1.isEdge();setTimeout((function(){return e.selectAll()}))}}};InputNumber.prototype._updateAria=function(){var t=this.inputElement;if(this.hostElement){wijmo_1.setAttribute(t,"aria-valuemin",this.min);wijmo_1.setAttribute(t,"aria-valuemax",this.max);wijmo_1.setAttribute(t,"aria-valuenow",this.value);wijmo_1.setAttribute(t,"aria-valuetext",this.text);wijmo_1.setAttribute(t,"step",this.step);wijmo_1.enable(this._btnDn,null==this.min||this.value>this.min);wijmo_1.enable(this._btnUp,null==this.max||this.value<this.max)}};InputNumber.prototype._updateInputAriaLabel=function(){var t=this.inputElement;!t||t.id||this._ariaLabelledby?wijmo_1.setAttribute(t,"aria-label",null):wijmo_1.setAttribute(t,"aria-label",this._inputElementAriaLabel)};InputNumber.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputNumber.ariaLabels.inputNumber};InputNumber._ctrlTemplate="";return InputNumber}(wijmo_1.Control);exports.InputNumber=InputNumber;wijmo_1._addCultureInfo("InputMask",{ariaLabels:{inputMaskInput:"Input Mask Input",inputMask:"Input Mask"}});var ColorPickerTabKeyAction,InputMask=function(t){__extends(InputMask,t);function InputMask(e,i){var o=t.call(this,e)||this;o._fullEdit=!1;o._inputElementAriaLabel=wijmo_1.culture.InputMask.ariaLabels.inputMaskInput;o._ariaLabelledby=null;o.valueChanged=new wijmo_1.Event;var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.InputMaskClsNames.hostElement,n,{_tbx:"input"},"input");if("INPUT"==o._orgTag){var s=o._tbx.getAttribute("value");s&&(o.value=s)}o._msk=new wijmo_1._MaskProvider(o._tbx);o.isRequired=!0;o.initialize(i);o.addEventListener(o._tbx,"input",(function(){o.onValueChanged()}));o.addEventListener(o._tbx,"blur",o._commitText.bind(o));o.addEventListener(o._tbx,"keydown",(function(t){t.keyCode==wijmo_1.Key.Enter&&o._commitText()}));o._updateInputAriaLabel();return o}Object.defineProperty(InputMask,"controlTemplate",{get:function(){InputMask._ctrlTemplate||(InputMask._ctrlTemplate='<div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+'"><input wj-part="input" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"/></div></div>');return InputMask._ctrlTemplate},set:function(t){InputMask._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"inputType",{get:function(){return this._tbx.type},set:function(t){this._tbx.type=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"value",{get:function(){return this._tbx.value},set:function(t){if(t!=this.value){this._tbx.value=wijmo_1.asString(t);t=this._msk._applyMask();this._tbx.value=t;this.onValueChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"rawValue",{get:function(){return this._msk.getRawValue()},set:function(t){t!=this.rawValue&&(this.value=wijmo_1.asString(t))},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"mask",{get:function(){return this._msk.mask||""},set:function(t){var e=this.value;this._msk.mask=wijmo_1.asString(t);this.value!=e&&this.onValueChanged()},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"promptChar",{get:function(){return this._msk.promptChar},set:function(t){var e=this.value;this._msk.promptChar=t;this.value!=e&&this.onValueChanged()},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"overwriteMode",{get:function(){return this._msk.overwriteMode},set:function(t){this._msk.overwriteMode=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"placeholder",{get:function(){return this._tbx.placeholder},set:function(t){this._tbx.placeholder=t},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"maskFull",{get:function(){return this._msk.maskFull},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"isRequired",{get:function(){return this._tbx.required},set:function(t){this._tbx.required=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"isReadOnly",{get:function(){return this._tbx.readOnly},set:function(t){this._tbx.readOnly=wijmo_1.asBoolean(t);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly)},enumerable:!0,configurable:!0});InputMask.prototype.selectAll=function(){var t=this._msk.getMaskRange();wijmo_1.setSelectionRange(this._tbx,t[0],t[1]+1)};InputMask.prototype.onValueChanged=function(t){if(this.value!=this._oldValue){this._oldValue=this.value;this.valueChanged.raise(this,t)}this._updateState()};InputMask.prototype._commitText=function(){(this.rawValue||this.isRequired)&&(this.maskFull||this.onInvalidInput(new wijmo_1.CancelEventArgs));this._updateState()};InputMask.prototype.dispose=function(){this._msk.input=null;t.prototype.dispose.call(this)};InputMask.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);this.hostElement&&this._msk.refresh()};InputMask.prototype.onGotFocus=function(e){this.selectAll();t.prototype.onGotFocus.call(this,e)};Object.defineProperty(InputMask.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(t){wijmo_1._setAriaLabelBy(this,this._tbx,t,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});InputMask.prototype._updateInputAriaLabel=function(){var t=this.inputElement;!t||t.id||this._ariaLabelledby?wijmo_1.setAttribute(t,"aria-label",null):wijmo_1.setAttribute(t,"aria-label",this._inputElementAriaLabel)};InputMask.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputMask.ariaLabels.inputMask};InputMask._ctrlTemplate="";return InputMask}(wijmo_1.Control);exports.InputMask=InputMask;wijmo_1._addCultureInfo("ColorPicker",{ariaLabels:{colorPicker:"Color Picker",satAndBrightnessPanel:"Color saturation and brightness panel",huePanel:"Color hue panel",opacityPanel:"Color opacity panel",palettePanel:"Color palette panel",saturation:"Saturation:",hue:"Hue:",opacity:"Opacity:",degrees:"degrees",brightness:"Brightness:"}});!function(t){t[t.None=0]="None";t[t.All=1]="All"}(ColorPickerTabKeyAction=exports.ColorPickerTabKeyAction||(exports.ColorPickerTabKeyAction={}));var ColorPicker=function(t){__extends(ColorPicker,t);function ColorPicker(e,i){var o=t.call(this,e)||this;o._hsb=[.5,1,1];o._alpha=1;o._ariaLabel=wijmo_1.culture.ColorPicker.ariaLabels.colorPicker;o.valueChanged=new wijmo_1.Event;o.hostElement.setAttribute("role","application");o.hostElement.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.colorPicker);var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.ColorPickerClsNames.hostElement,n,{_eSB:"div-sb",_eHue:"div-hue",_eAlpha:"div-alpha",_ePreview:"div-pv",_ePal:"div-pal",_eText:"div-text"});o._palette="#FFF,#000,#F00,#FFC000,#FFFF00,#92D050,#00B050,#00B0F0,#0070C0,#7030A0".split(",");o._updatePalette();o._eHue.style.backgroundImage="url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAD4CAIAAACi6hsPAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuM4zml1AAAAGvSURBVDhPXdBPaM9xHMfxz4pWaxcmtoOhpdXSVpiyHWxqmVpDjaU5rK34XfypjTJ/p+ZPay6jhsOsRrKwaJElf9IQq03WIkv4FeMwMq221tfje1ByeFzfvd7PEKWGEKWTQRZLySWfVRRTQjmVbKWGOhLsZT+HaeY0bbTTQSfdXOcWffTzmAFeMcwoYyT5ygS/mA5hNgphip98J8kHRnnNSwZ4yH1uc4OrdHGR87RximYO0cgedlLLdqqoYAPrWMtKVrCcJSxiPmnMJUQp/Bsyk2xyyKOAQooopYwKtlDNDur5G7SBJo7RQiv/B+2hl3s84CkvGGKEOOYnxolj/mYmhBmDJ5ngCx95xxsGecYj4pB3iENeoZMO2mmlhaMcpIE4ZII6aqhmM3HMMkooopB88sghm0wySCeVlCjMCVFIYx4LWUwOeRSwhmLWU84mqqihll3sppEmjnOSs5zjEl1c4yZ99POE5wwxwns+840fTDFLFKaZZIJxkozxlmEGGSC+GF++Sy89dHOZC8Rr4lVnOMERDrCPBPXEX22jko2UEn+/mnxyWUYWC0gnNUQh/AEc0HJs6cex0gAAAABJRU5ErkJggg==)";o._eHue.style.backgroundSize="contain";if(navigator.appVersion.indexOf("MSIE 9")>-1){o._eSB.children[0].style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffffff,endColorstr=#00ffffff,GradientType=1)";o._eSB.children[1].style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000,endColorstr=#ff000000,GradientType=0)"}n=ColorPicker._tplCursor;o._cSB=wijmo_1.createElement(n);o._cHue=wijmo_1.createElement(n);o._cHue.style.width="100%";o._cAlpha=wijmo_1.createElement(n);o._cAlpha.style.height="100%";o._eSB.appendChild(o._cSB);o._eHue.appendChild(o._cHue);o._eAlpha.appendChild(o._cAlpha);o._keyActionTab=ColorPickerTabKeyAction.None;var s=o.addEventListener.bind(o),r=o.removeEventListener.bind(o),a=document;s(o.hostElement,"mousedown",(function(t){s(a,"mousemove",mouseMove);s(a,"mouseup",mouseUp);o._mouseDown(t)}));s(o.hostElement,"touchstart",(function(t){s(a,"touchmove",mouseMove);s(a,"touchend",mouseUp);o._mouseDown(t)}));var mouseMove=function(t){o._mouseMove(t)},mouseUp=function(t){r(a,"mousemove",mouseMove);r(a,"mouseup",mouseUp);r(a,"touchmove",mouseMove);r(a,"touchend",mouseUp);o._mouseUp(t)};s(o.hostElement,"click",(function(t){if(!o.isDisabled){var e=t.target;if(e&&"DIV"==e.tagName&&wijmo_1.contains(o._ePal,e)){var i=e.style.backgroundColor;i&&(o.value=new wijmo_1.Color(i).toString());e.focus()}}}));s(o.hostElement,"keydown",(function(t){o.isDisabled||o._keydown(t)}));o.value="#ffffff";o.initialize(i);o._updatePanels();o._eSB.setAttribute("role","slider");o._eSB.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.satAndBrightnessPanel);o._eSB.setAttribute("aria-valuemin","0");o._eSB.setAttribute("aria-valuemax","100");o._eHue.setAttribute("role","slider");o._eHue.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.huePanel);o._eHue.setAttribute("aria-valuemin","0");o._eHue.setAttribute("aria-valuemax","360");o._eAlpha.setAttribute("role","slider");o._eAlpha.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.opacityPanel);o._eAlpha.setAttribute("aria-valuemin","0");o._eAlpha.setAttribute("aria-valuemax","100");o._ePal.setAttribute("role","grid");o._ePal.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.palettePanel);o._updateTabIndex();return o}Object.defineProperty(ColorPicker,"controlTemplate",{get:function(){ColorPicker._ctrlTemplate||(ColorPicker._ctrlTemplate='<div style="position:relative;width:100%;height:100%"><div style="float:left;width:50%;height:100%;box-sizing:border-box;padding:2px"><div wj-part="div-pal"><div style="float:left;width:10%;box-sizing:border-box;padding:2px"><div style="background-color:black;width:100%"> </div><div style="height:6px"></div></div></div><div wj-part="div-text" style="position:absolute;bottom:0px;display:none"></div></div><div style="float:left;width:50%;height:100%;box-sizing:border-box;padding:2px"><div wj-part="div-sb" class="'+exports.ColorPickerClsNames.colorBox+'" style="float:left;width:89%;height:89%"><div style="position:absolute;width:100%;height:100%;background:linear-gradient(to right, white 0%,transparent 100%)"></div><div style="position:absolute;width:100%;height:100%;background:linear-gradient(to top, black 0%,transparent 100%)"></div></div><div style="float:left;width:1%;height:89%"></div><div style="float:left;width:10%;height:89%"><div wj-part="div-hue" class="'+exports.ColorPickerClsNames.colorBox+'"></div></div><div style="float:left;width:89%;height:1%"></div><div style="float:left;width:89%;height:10%"><div style="width:100%;height:100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuM4zml1AAAAAcSURBVBhXY/iPBBYgAWpKQGkwgMqDAdUk/v8HAM7Mm6GatDUYAAAAAElFTkSuQmCC)"><div wj-part="div-alpha" class="'+exports.ColorPickerClsNames.colorBox+'"></div></div></div><div style="float:left;width:1%;height:10%"></div><div style="float:left;width:10%;height:10%"><div wj-part="div-pv" class="'+exports.ColorPickerClsNames.colorBox+'" style="position:static"></div></div></div></div>');return ColorPicker._ctrlTemplate},set:function(t){ColorPicker._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"showAlphaChannel",{get:function(){return"none"!=this._eAlpha.parentElement.style.display},set:function(t){this._eAlpha.parentElement.style.display=wijmo_1.asBoolean(t)?"":"none"},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"showColorString",{get:function(){return"none"!=this._eText.style.display},set:function(t){this._eText.style.display=wijmo_1.asBoolean(t)?"":"none";if(wijmo_1.asBoolean(t)){this._eText.setAttribute("role","status");this._eText.setAttribute("aria-live","polite")}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"value",{get:function(){return this._value},set:function(t){if(t!=this.value){t=(t=wijmo_1.asString(t)).trim();var e=wijmo_1.Color.fromString(t);if(e){this._value=t;this._eText.innerText=t;var i=e.getHsb();if(this._hsb[0]!=i[0]||this._hsb[1]!=i[1]||this._hsb[2]!=i[2]||this._alpha!=e.a){if(0==i[2]){i[0]=this._hsb[0];i[1]=this._hsb[1]}else 0==i[1]&&(i[0]=this._hsb[0]);this._hsb=i;this._alpha=e.a;this.onValueChanged()}}}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"palette",{get:function(){return this._palette},set:function(t){if((t=(t=wijmo_1.asArray(t)).slice(0,10)).every((function(t){return null!=wijmo_1.Color.fromString(t)}))){this._palette=t;this._updatePalette()}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"ariaLabel",{get:function(){return this._ariaLabel},set:function(t){if(t!=this._ariaLabel){this._ariaLabel=t;wijmo_1.setAttribute(this.hostElement,"aria-label",this._ariaLabel)}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(t){this._keyActionTab=t;if(t==ColorPickerTabKeyAction.All){this.tabOrder=0;this.hostElement.setAttribute("tabindex","-1")}this._updateTabIndex()},enumerable:!0,configurable:!0});ColorPicker.prototype._setTabOrder=function(e){t.prototype._setTabOrder.call(this,e);this.isDisabled||this._updateTabIndex()};ColorPicker.prototype.onValueChanged=function(t){this._refreshSelection();this.valueChanged.raise(this,t)};ColorPicker.prototype._mouseDown=function(t){this._htDown=this._getTargetPanel(t);if(this._htDown){t.preventDefault();this._htDown.focus();this._mouseMove(t)}};ColorPicker.prototype._mouseMove=function(t){if(!this.isDisabled){var e=t.touches?t.touches[0]:t,i=this._htDown;if(i){var o=i.getBoundingClientRect(),n=this._hsb;if(i==this._eHue)n[0]=wijmo_1.clamp((e.clientY-o.top)/o.height,0,.99);else if(i==this._eSB){n[1]=wijmo_1.clamp((e.clientX-o.left)/o.width,0,1);n[2]=wijmo_1.clamp(1-(e.clientY-o.top)/o.height,0,1)}else i==this._eAlpha&&(this._alpha=wijmo_1.clamp((e.clientX-o.left)/o.width,0,1));this._updateColor()}}};ColorPicker.prototype._mouseUp=function(t){this._htDown=null};ColorPicker.prototype._updateColor=function(){var t=wijmo_1.Color.fromHsb(this._hsb[0],this._hsb[1],this._hsb[2],this._alpha);this.value=t.toString();this._refreshSelection()};ColorPicker.prototype._updatePalette=function(){var t=this,e=new wijmo_1.Color("#fff"),i=new wijmo_1.Color("#000");this._ePal.innerHTML="";this._ePal.className="palette-grid";for(var o=Array.from({length:6},(function(){var t=document.createElement("div");t.className="palette-row";t.setAttribute("role","row");return t})),n=this.getActualTabIndex(),s=0;s<this._palette.length;s++){var r=new wijmo_1.Color(this._palette[s]),a=r.getHsb(),l=this._makePalEntry(r);l.setAttribute("role","columnheader");l.setAttribute("aria-label",""+r.toString());if(0===s){this._ePalMainFirst=l;this._ePalMainFirst.setAttribute("tabindex",n)}else l.setAttribute("tabindex","-1");o[0].appendChild(l);for(var h=0;h<5;h++){var u=0===a[1]?wijmo_1.Color.interpolate(e,i,.1*h+(a[2]>.5?.05:.55)):wijmo_1.Color.fromHsb(a[0],.1+.2*h,1-.1*h),c=this._makePalEntry(u);c.setAttribute("role","gridcell");c.setAttribute("aria-label",""+u.toString());if(0===s&&0===h){this._ePalShadeFirst=c;this._ePalShadeFirst.setAttribute("tabindex",n)}else wijmo_1.setAttribute(c,"tabindex","-1");o[h+1].appendChild(c)}}o.forEach((function(e){return t._ePal.appendChild(e)}))};ColorPicker.prototype._makePalEntry=function(t){var e=document.createElement("div");e.className="palette-gridcell";wijmo_1.setCss(e,{backgroundColor:t.toString()});e.innerHTML=" ";return e};ColorPicker.prototype._updatePanels=function(){var t=wijmo_1.Color.fromHsb(this._hsb[0],1,1,1),e=wijmo_1.Color.fromHsb(this._hsb[0],this._hsb[1],this._hsb[2],1);this._eSB.style.backgroundColor=t.toString();this._eAlpha.style.background="linear-gradient(to right, transparent 0%, "+e.toString()+" 100%)";navigator.appVersion.indexOf("MSIE 9")>-1&&(this._eAlpha.style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000,endColorstr="+e.toString()+", GradientType = 1)");this._ePreview.style.backgroundColor=this.value;this._cHue.style.top=(100*this._hsb[0]).toFixed(0)+"%";this._cSB.style.left=(100*this._hsb[1]).toFixed(0)+"%";this._cSB.style.top=(100-100*this._hsb[2]).toFixed(0)+"%";this._cAlpha.style.left=(100*this._alpha).toFixed(0)+"%";var i=this.getColorsDiv(),o=wijmo_1.getActiveElement();if(this.keyActionTab===ColorPickerTabKeyAction.All&&!this.hostElement.contains(o)){if(this.isDisabled)return;for(var n=!1,s=0;s<i.length;s++){var r=i[s].style.backgroundColor;if(wijmo_1.Color.fromString(this.value).equals(wijmo_1.Color.fromString(r))){i[s].focus();n=!0;break}}n||i[0].focus()}};ColorPicker.prototype.getColorsDiv=function(){var t=Array.from(this._ePal.querySelectorAll('[role="columnheader"]')),e=Array.from(this._ePal.querySelectorAll('[role="gridcell"]'));return t.concat(e)};ColorPicker.prototype._getTargetPanel=function(t){var e=t.target;return wijmo_1.contains(this._eSB,e)?this._eSB:wijmo_1.contains(this._eHue,e)?this._eHue:wijmo_1.contains(this._eAlpha,e)?this._eAlpha:null};ColorPicker.prototype.getActualTabIndex=function(){var t=this.tabOrder.toString();return this.keyActionTab===ColorPickerTabKeyAction.All&&!0!==this.isDisabled?t:"-1"};ColorPicker.prototype._updateTabIndex=function(){var t=this.getActualTabIndex();this._eSB.setAttribute("tabindex",t);this._eHue.setAttribute("tabindex",t);this._eAlpha.setAttribute("tabindex",t);this._ePalMainFirst.setAttribute("tabindex",t);this._ePalShadeFirst.setAttribute("tabindex",t)};ColorPicker.prototype._setIsDisabled=function(e){t.prototype._setIsDisabled.call(this,e);this._updateTabIndex()};ColorPicker.prototype._updateAriaValues=function(){var t=this._hsb;this._eSB.setAttribute("aria-valuenow",(100*t[1]).toString());this._eSB.setAttribute("aria-valuetext",wijmo_1.culture.ColorPicker.ariaLabels.saturation+" "+Math.round(100*t[1])+"%, "+wijmo_1.culture.ColorPicker.ariaLabels.brightness+" "+Math.round(100*t[2])+"%");this._eHue.setAttribute("aria-valuenow",(360*t[0]).toString());this._eHue.setAttribute("aria-valuetext",wijmo_1.culture.ColorPicker.ariaLabels.hue+" "+Math.round(360*t[0])+" "+wijmo_1.culture.ColorPicker.ariaLabels.degrees);this._eAlpha.setAttribute("aria-valuenow",(100*this._alpha).toString());this._eAlpha.setAttribute("aria-valuetext",wijmo_1.culture.ColorPicker.ariaLabels.opacity+" "+Math.round(100*this._alpha)+"%")};ColorPicker.prototype._keydown=function(t){var e=t.target;this._isInColorPalette(e)?this._handleColorNavigation(t,e):e!==this._eSB?e!==this._eHue?e!==this._eAlpha||this._handleAlphaNavigation(t):this._handleHSBNavigation(t,"hue"):this._handleHSBNavigation(t,"sb")};ColorPicker.prototype._isInColorPalette=function(t){return t&&"DIV"===t.tagName&&wijmo_1.contains(this._ePal,t)};ColorPicker.prototype._handleColorNavigation=function(t,e){var i=this.getColorsDiv(),o=this.palette.length,n=i.findIndex((function(t){return t===e})),s=null;switch(t.key){case"ArrowDown":n<i.length-1&&(s=i[n+o]);break;case"ArrowUp":n>0&&(s=i[n-o]);break;case"ArrowRight":var r=n+1;r<i.length&&(s=i[r]);break;case"ArrowLeft":var a=n-1;a>=0&&(s=i[a])}if(s){var l=s.style.backgroundColor;l&&(this.value=new wijmo_1.Color(l).toString());s.focus();t.preventDefault()}};ColorPicker.prototype._handleHSBNavigation=function(t,e){var i=this;this._hsb=this._hsb.map((function(t){return wijmo_1.roundTo(t,2)}));var adjust=function(t,e,o){var n=Math.round(100*i._hsb[t]);i._hsb[t]=wijmo_1.clamp((n+e)/100,0,o)};switch(t.key){case"ArrowLeft":"sb"===e&&adjust(1,-1,1);break;case"ArrowRight":"sb"===e&&adjust(1,1,1);break;case"ArrowUp":"sb"===e?adjust(2,1,1):adjust(0,-1,.99);break;case"ArrowDown":"sb"===e?adjust(2,-1,1):adjust(0,1,.99)}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){this._updateColor();t.preventDefault()}};ColorPicker.prototype._refreshSelection=function(){this._updatePanels();this._updateAriaValues()};ColorPicker.prototype._handleAlphaNavigation=function(t){switch(t.key){case"ArrowLeft":this._alpha=wijmo_1.clamp(this._alpha-.01,0,1);break;case"ArrowRight":this._alpha=wijmo_1.clamp(this._alpha+.01,0,1);break;default:return}this._updateColor();t.preventDefault()};ColorPicker._ctrlTemplate="";ColorPicker._tplCursor='<div class="wj-colorpicker-cursor"></div>';return ColorPicker}(wijmo_1.Control);exports.ColorPicker=ColorPicker;wijmo_1._addCultureInfo("CollectionViewNavigator",{ariaLabels:{byPage:{btnFirst:"Navigate to first page",btnPrev:"Navigate to previous page",btnNext:"Navigate to next page",btnLast:"Navigate to last page"},byItem:{btnFirst:"Navigate to first item",btnPrev:"Navigate to previous item",btnNext:"Navigate to next item",btnLast:"Navigate to last item"}}});var CollectionViewNavigator=function(t){__extends(CollectionViewNavigator,t);function CollectionViewNavigator(e,i){var o=t.call(this,e)||this;o._view=null;o._byPage=!1;o._fmt="{current:n0} / {count:n0}";o._liveRegionON=!1;o._ariaLabel="";var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.CollectionViewNavigatorClsNames.pager+" "+exports.CollectionViewNavigatorClsNames.hostElement,n,{_btnFirst:"btn-first",_btnPrev:"btn-prev",_txtCurr:"txt-curr",_btnNext:"btn-next",_btnLast:"btn-last"},"input");o.hostElement.tabIndex=-1;o._updateAriaLabels();var s=wijmo_1.uidGenerator();o._txtCurr.id=s;[o._btnFirst,o._btnPrev,o._btnNext,o._btnLast].forEach((function(t){wijmo_1.setAttribute(t.firstElementChild,"aria-controls",o._txtCurr.id)}));wijmo_1.setAttribute(o.hostElement.firstElementChild,"role","group");wijmo_1.setAttribute(o._txtCurr,"role","status");o._rptNext=new wijmo_1._ClickRepeater(o._btnNext.querySelector("button"));o._rptPrev=new wijmo_1._ClickRepeater(o._btnPrev.querySelector("button"));o.addEventListener(o.hostElement,"click",o._click.bind(o));o.addEventListener(o.hostElement,"keydown",o._keydown.bind(o));wijmo_1.setAttribute(o.hostElement,"role","navigation");o._addA11yRelatedHandlers();o.initialize(i);o._update();return o}Object.defineProperty(CollectionViewNavigator,"controlTemplate",{get:function(){CollectionViewNavigator._ctrlTemplate||(CollectionViewNavigator._ctrlTemplate='<div class="'+exports.InputClsNames.inputGroup+'"><span wj-part="btn-first" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.stepBackward+'"></span></button></span><span wj-part="btn-prev" class="'+exports.InputClsNames.inputGroupBtn+'"> <button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.left+'"></span> </button></span><span wj-part="txt-curr" tabIndex="0"></span><span wj-part="btn-next" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.right+'"></span></button></span><span wj-part="btn-last" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.stepForward+'"></span></button></span></div>');return CollectionViewNavigator._ctrlTemplate},set:function(t){CollectionViewNavigator._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"cv",{get:function(){return this._view},set:function(t){if(t!=this._view){var e=this._view;if(e){e.collectionChanged.removeHandler(this._collectionChanged);e.currentChanged.removeHandler(this._currentChanged)}e=this._view=wijmo_1.asType(t,"ICollectionView",!0);this._update();if(e){e.collectionChanged.addHandler(this._collectionChanged,this);e.currentChanged.addHandler(this._currentChanged,this)}}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"byPage",{get:function(){return this._byPage},set:function(t){if(t!=this._byPage){this._byPage=wijmo_1.asBoolean(t);this._update();this._updateAriaLabels()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"headerFormat",{get:function(){return this._fmt},set:function(t){if(t!=this._fmt){this._fmt=wijmo_1.asString(t);this._update()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"repeatButtons",{get:function(){return!this._rptNext.disabled},set:function(t){this._rptNext.disabled=this._rptPrev.disabled=!wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"ariaLabel",{get:function(){if(this.hostElement){var t=this.hostElement.getAttribute("aria-label");if(t)return t}return this._ariaLabel},set:function(t){if(this.ariaLabel!==t){this._ariaLabel=t;this.hostElement&&wijmo_1.setAttribute(this.hostElement,"aria-label",t)}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"isDisabled",{get:function(){return this._isDisabled},set:function(t){this._setIsDisabled(t)},enumerable:!0,configurable:!0});CollectionViewNavigator.prototype.focus=function(){var t=this._e;t&&t.offsetHeight&&(this.isDisabled||wijmo_1.moveFocus(t,0)||this._txtCurr.tabIndex>=0&&this._txtCurr.focus())};CollectionViewNavigator.prototype._update=function(){var t=this,e=this._view,i=this._byPage,o=e?i?e.pageIndex:e.currentPosition:0,n=e?i?e.pageCount:e.itemCount:0;if(!this.isDisabled){wijmo_1.enable(this._btnFirst,e&&o>0);wijmo_1.enable(this._btnPrev,e&&o>0);wijmo_1.enable(this._txtCurr,null!=e);wijmo_1.enable(this._btnNext,e&&o<n-1);wijmo_1.enable(this._btnLast,e&&o<n-1)}[this._btnFirst,this._btnPrev,this._btnNext,this._btnLast].forEach((function(e){e.firstElementChild.disabled?e.firstElementChild.setAttribute("tabindex","-1"):e.firstElementChild.setAttribute("tabindex",t._orgTabIndex.toString())}));this._txtCurr.textContent=wijmo_1.format(this._fmt,{current:e?o+1:0,count:e?n:0,currentItem:e?e.currentPosition+1:0,itemCount:e?e.itemCount:0,currentPage:e?e.pageIndex+1:0,pageCount:e?e.pageCount:0})};CollectionViewNavigator.prototype._currentChanged=function(){this._update()};CollectionViewNavigator.prototype._collectionChanged=function(){this._update()};CollectionViewNavigator.prototype._click=function(t){var e=t.target,i=this._view,o=this._byPage;if(i){wijmo_1.contains(this._btnFirst,e)?o?i.moveToFirstPage():i.moveCurrentToFirst():wijmo_1.contains(this._btnPrev,e)?o?i.moveToPreviousPage():i.moveCurrentToPrevious():wijmo_1.contains(this._btnNext,e)?o?i.moveToNextPage():i.moveCurrentToNext():wijmo_1.contains(this._btnLast,e)&&(o?i.moveToLastPage():i.moveCurrentToLast());(this.byPage?i.pageIndex>=i.pageCount-1||i.pageIndex<=0:i.currentPosition>=i.itemCount-1||i.currentPosition<=0)&&!this.isDisabled&&this._txtCurr.tabIndex>=0&&this._txtCurr.focus();t.preventDefault()}};CollectionViewNavigator.prototype._updateAriaLabels=function(){var t=wijmo_1.culture.CollectionViewNavigator.ariaLabels[this._byPage?"byPage":"byItem"];wijmo_1.setAttribute(this._btnFirst.firstElementChild,"aria-label",t.btnFirst);wijmo_1.setAttribute(this._btnPrev.firstElementChild,"aria-label",t.btnPrev);wijmo_1.setAttribute(this._btnNext.firstElementChild,"aria-label",t.btnNext);wijmo_1.setAttribute(this._btnLast.firstElementChild,"aria-label",t.btnLast)};CollectionViewNavigator.prototype._addA11yRelatedHandlers=function(){var t=this;this.addEventListener(this._txtCurr,"focus",(function(e){if(t._txtCurr===document.activeElement){wijmo_1.setAttribute(t._txtCurr,"aria-live","off");wijmo_1.setAttribute(t._txtCurr,"aria-label",t._txtCurr.textContent);t._liveRegionON=!1}}));this.addEventListener(this._txtCurr,"blur",(function(e){t._txtCurr!==document.activeElement&&t._txtCurr.removeAttribute("aria-label")}));[this._btnFirst.firstElementChild,this._btnPrev.firstElementChild,this._btnNext.firstElementChild,this._btnLast.firstElementChild].forEach((function(e){t.addEventListener(e,"focus",(function(e){setTimeout((function(){if(!t._liveRegionON){var e=wijmo_1._isMacOS()?"polite":"assertive";wijmo_1.setAttribute(t._txtCurr,"aria-live",e);t._liveRegionON=!0}}))}))}))};CollectionViewNavigator.prototype._setTabOrder=function(t){var e=this._e,i=null!=this._txtCurr.getAttribute("disabled");this._orgTabIndex=t;if(this.isDisabled||i){e.tabIndex=-1;this._txtCurr.tabIndex=-1}else i||(this._txtCurr.tabIndex=this._orgTabIndex)};CollectionViewNavigator.prototype._keydown=function(t){if(wijmo_1.contains(this._txtCurr,t.target)&&(t.ctrlKey||t.metaKey)&&("A"===t.key||"a"===t.key)){t.preventDefault();var e=document.createRange();e.selectNodeContents(this._txtCurr);var i=window.getSelection();i.removeAllRanges();i.addRange(e)}};CollectionViewNavigator.prototype._setIsDisabled=function(t){var e=this;if((t=!!wijmo_1.asBoolean(t,!0))!=this.isDisabled){var i=this._e;if(i){this._isDisabled=t;wijmo_1.toggleClass(i,wijmo_1.ControlStateClsNames.disabled,t);[this._btnFirst,this._btnPrev,this._btnNext,this._btnLast].forEach((function(i){if(t){i.firstElementChild.setAttribute("disabled","");i.firstElementChild.setAttribute("tabindex","-1")}else{i.firstElementChild.removeAttribute("disabled");i.firstElementChild.setAttribute("tabindex",e._orgTabIndex.toString())}wijmo_1.toggleClass(i,wijmo_1.ControlStateClsNames.disabled,t)}));this._txtCurr.tabIndex=t?-1:this._orgTabIndex;wijmo_1.toggleClass(this._txtCurr,wijmo_1.ControlStateClsNames.disabled,t)}}};CollectionViewNavigator._ctrlTemplate="";return CollectionViewNavigator}(wijmo_1.Control);exports.CollectionViewNavigator=CollectionViewNavigator;wijmo_1._addCultureInfo("Listbox",{ariaLabels:{listBox:"list box"}});var ListBox=function(t){__extends(ListBox,t);function ListBox(e,i){var o=t.call(this,e,null,!0)||this;o._cv=null;o._itemFormatter=null;o._pathDisplay=new wijmo_1.Binding("");o._pathValue=new wijmo_1.Binding("");o._pathChecked=new wijmo_1.Binding("");o._html=!1;o._shGroups=!1;o._checkedItems=[];o._itemRole="option";o._caseSensitive=!1;o._addMode=!1;o._isShiftDown=!1;o._shouldClearOnShift=!0;o._vThreshold=ListBox._VTHRESH;o._isVirtual=!1;o._children=[];o._ignoreItemFormatterTextArray=[];o._itemFormatterHelper=document.createElement("div");o._clientHeight=-1;o._itemHeight=30;o._itemsAbove=-1;o._itemsBelow=-1;o._eSizer=document.createElement("div");o._ePadTop=document.createElement("div");o._ePadBot=document.createElement("div");o._checking=!1;o._ignoredItemChangedEvents=!1;o._search="";o._fmtItemHandlers=0;o._itemCount=0;o._oldSel=null;o._container=null;o._oldSelectedIndex=-1;o._ariaLabel=wijmo_1.culture.Listbox.ariaLabels.listBox;o.selectedIndexChanged=new wijmo_1.Event;o.itemsChanged=new wijmo_1.Event;o.loadingItems=new wijmo_1.Event;o.loadedItems=new wijmo_1.Event;o.itemChecked=new wijmo_1.Event;o.checkedItemsChanged=new wijmo_1.Event;o.formatItem=new wijmo_1.Event((function(){o.invalidate()}));o._handleKeyUp=function(t){if("Shift"===t.key){o._isShiftDown=!1;o._shouldClearOnShift=!0}};o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.ListBoxClsNames.hostElement,null,null);var n=o.hostElement;wijmo_1.setAttribute(n,"role","listbox",!0);o._updateAriaLabel();"SELECT"==o._orgTag&&o._initFromSelect(o.hostElement);o.addEventListener(n,"click",o._click.bind(o));o.addEventListener(n,"keydown",o._keydown.bind(o));o.addEventListener(n,"keypress",o._keypress.bind(o));o.addEventListener(n,"keyup",o._handleKeyUp.bind(o));o.addEventListener(n,"wheel",(function(t){if(n.scrollHeight>n.offsetHeight&&(t.deltaY<0&&0==n.scrollTop||t.deltaY>0&&n.scrollTop+n.offsetHeight>=n.scrollHeight)){t.preventDefault();t.stopPropagation();t.stopImmediatePropagation()}}));[o._eSizer,o._ePadTop,o._ePadBot].forEach((function(t){t.tabIndex=-1;wijmo_1.setAttribute(t,"aria-hidden",!0);wijmo_1.setCss(t,{pointerEvents:"none",opacity:"0"})}));o.initialize(i);o._updateViewRange();o.addEventListener(o.hostElement,"scroll",(function(t){o._updateViewRange()}));return o}Object.defineProperty(ListBox.prototype,"ariaLabelledBy",{get:function(){return this.hostElement.getAttribute("aria-labelledby")},set:function(t){wijmo_1._setAriaLabelBy(this,this.hostElement,t,this._updateAriaLabel.bind(this))},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"itemsSource",{get:function(){return this._items},set:function(t){if(this._items!=t){if(this._cv){this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv=null}this._items=t;this._cv=wijmo_1.asCollectionView(t);if(null!=this._cv){this._cv.currentChanged.addHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.addHandler(this._cvCollectionChanged,this)}this._populateList();this.onItemsChanged();this.onSelectedIndexChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"collectionView",{get:function(){return this._cv},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"virtualizationThreshold",{get:function(){return this._vThreshold},set:function(t){if(t!=this._vThreshold){var e=this._getVirtual();this._vThreshold=wijmo_1.asNumber(t,!1,!0);e!=this._getVirtual()&&this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"showGroups",{get:function(){return this._shGroups},set:function(t){if(t!=this._shGroups){this._shGroups=wijmo_1.asBoolean(t);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"isContentHtml",{get:function(){return this._html},set:function(t){if(t!=this._html){this._html=wijmo_1.asBoolean(t);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"itemFormatter",{get:function(){return this._itemFormatter},set:function(t){if(t!=this._itemFormatter){this._itemFormatter=wijmo_1.asFunction(t);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"displayMemberPath",{get:function(){return this._pathDisplay.path},set:function(t){if(t!=this.displayMemberPath){this._pathDisplay.path=wijmo_1.asString(t);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"selectedValuePath",{get:function(){return this._pathValue.path},set:function(t){this._pathValue.path=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"checkedMemberPath",{get:function(){return this._pathChecked.path},set:function(t){if(t!=this.checkedMemberPath){this._pathChecked.path=wijmo_1.asString(t);wijmo_1.setAttribute(this.hostElement,"aria-multiselectable",""!==this.checkedMemberPath?"true":"false");this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"caseSensitiveSearch",{get:function(){return this._caseSensitive},set:function(t){this._caseSensitive=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"itemRole",{get:function(){return this._itemRole},set:function(t){if(t!=this.itemRole){this._itemRole=wijmo_1.asString(t);this._populateList()}},enumerable:!0,configurable:!0});ListBox.prototype.getDisplayValue=function(t,e){var i=null;if(t>-1&&wijmo_1.hasItems(this._cv)){i=this._cv.items[t];this.displayMemberPath&&(i=this._pathDisplay.getValue(i))}var o=null!=i?i.toString():"";this._itemFormatter&&!e&&(o=this._itemFormatter(t,o));return o};ListBox.prototype.getDisplayText=function(t){return this._getDisplayText(t)};ListBox.prototype._getDisplayText=function(t,e){if(e&&this._ignoreItemFormatterTextArray[t])return this._ignoreItemFormatterTextArray[t];var i=this._getChild(t);return null!=i?i.textContent:""};ListBox.prototype.isItemEnabled=function(t){var e=this._getChild(t);return null!=e&&!e.hasAttribute("disabled")&&!wijmo_1.hasClass(e,wijmo_1.ControlStateClsNames.disabled)&&!wijmo_1.hasClass(e,wijmo_1.UtilitesClsNames.separator)};Object.defineProperty(ListBox.prototype,"selectedIndex",{get:function(){return this._cv?this._cv.currentPosition:-1},set:function(t){if(this._cv){this._oldSelectedIndex=this._cv.currentPosition;this._cv.moveCurrentToPosition(wijmo_1.asNumber(t))}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"selectedItem",{get:function(){return this._cv?this._cv.currentItem:null},set:function(t){this._cv&&this._cv.moveCurrentTo(t)},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"selectedValue",{get:function(){var t=this.selectedItem;t&&this.selectedValuePath&&(t=this._pathValue.getValue(t));return t},set:function(t){var e=this._cv,i=e?e.items:null,o=this.selectedValuePath,n=-1;if(i){for(var s=0;s<i.length;s++){var r=i[s],a=o?this._pathValue.getValue(r):r;if(a===t||wijmo_1.DateTime.equals(a,t)){n=s;break}if(this.isContentHtml&&wijmo_1.isString(a)&&a.indexOf("<")>-1&&wijmo_1.toPlainText(a)===t){n=s;break}}this.selectedIndex=n}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"maxHeight",{get:function(){var t=this.hostElement,e=t?parseFloat(t.style.maxHeight):null;return isNaN(e)?null:e},set:function(t){var e=this.hostElement;if(e){t=wijmo_1.asNumber(t,!0);e.style.maxHeight=null==t?"":t+"px"}},enumerable:!0,configurable:!0});ListBox.prototype.showSelection=function(t){void 0===t&&(t=this.containsFocus());var e=this.hostElement,i=this._children,o=this._getSelectedElement(!1),n=new wijmo_1.Rect(0,0,0,0);if(o!=this._oldSel){this._updateItemAttributes(o,!0);this._updateItemAttributes(this._oldSel,!1);this._oldSel=o}o instanceof HTMLElement?n=this._getBoundingClientRect(o):this._children.length>0&&(n=this._getBoundingClientRect(this._getChild(0)));var s=this._getBoundingClientRect(e),r=0;if(this._shGroups){r=this._itemHeight;if(!this._isVirtual){var a=i[0];a&&a.offsetHeight&&wijmo_1.hasClass(a,exports.ListBoxClsNames.header)&&(r=a.offsetHeight)}}n.bottom>s.bottom?e.scrollTop+=n.bottom-s.bottom:n.top<s.top+r&&(e.scrollTop-=s.top+r-n.top);this._updateViewRange();o=this._getSelectedElement(!0);wijmo_1.setAttribute(e,"aria-activedescendant",o?o.id:null);if(t){(o&&!wijmo_1.contains(o,wijmo_1.getActiveElement())?o:e).focus()}e.tabIndex=o?-1:this._orgTabIndex};ListBox.prototype.loadList=function(){this._populateList()};ListBox.prototype.getItemChecked=function(t){var e=this._cv.items[t],i=this._pathChecked;return wijmo_1.isObject(e)&&i.path?i.getValue(e):this._getCheckboxState(t)};ListBox.prototype.setItemChecked=function(t,e){this._setItemChecked(t,e,!0)};ListBox.prototype.toggleItemChecked=function(t){this.setItemChecked(t,!this.getItemChecked(t))};Object.defineProperty(ListBox.prototype,"checkedItems",{get:function(){return this._checkedItems},set:function(t){t=Array.from(new Set(t));var e=wijmo_1.asArray(t,!1);if(!this._arrayEquals(e,this._checkedItems)){this._updateCheckedList(e);if(!this._arrayEquals(e,this._checkedItems)){this._checkedItems=e;this.onCheckedItemsChanged()}}},enumerable:!0,configurable:!0});ListBox.prototype.indexOf=function(t){return(t=wijmo_1.closest(t,"."+exports.ListBoxClsNames.listBoxItem))?t[ListBox._DIDX_KEY]:-1};ListBox.prototype.onSelectedIndexChanged=function(t){this.selectedIndexChanged.raise(this,t)};ListBox.prototype.onItemsChanged=function(t){this.itemsChanged.raise(this,t)};ListBox.prototype.onLoadingItems=function(t){this.loadingItems.raise(this,t)};ListBox.prototype.onLoadedItems=function(t){this.loadedItems.raise(this,t)};ListBox.prototype.onItemChecked=function(t){this.itemChecked.raise(this,t)};ListBox.prototype.onCheckedItemsChanged=function(t){this.checkedItemsChanged.raise(this,t)};ListBox.prototype.onFormatItem=function(t){this.formatItem.raise(this,t)};ListBox.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);if(this.hostElement){var i=this._cv?this._cv.items.length:0,o=this.formatItem.handlerCount;if(i!=this._itemCount||o!=this._fmtItemHandlers){this._fmtItemHandlers=o;this._populateList()}else this._updateViewRange()}};ListBox.prototype._updateAriaLabel=function(){this.hostElement&&(this.ariaLabelledBy?wijmo_1.setAriaLabel(this.hostElement,null):wijmo_1.setAriaLabel(this.hostElement,this._ariaLabel))};ListBox.prototype._updateCheckedList=function(t){var e=this,i=this._cv,o=this._pathChecked,n=new Map;if(o&&i){var s=i.sourceCollection;if(s&&s.length){wijmo_1.isObject(s[0])||(o=null);t.forEach((function(t){return n.set(t,!0)}));this._checking=!0;var r=[];s.forEach((function(t){var e=n.has(t);e&&r.push(t);o&&o.setValue(t,e)}));this._checking=!1;t=r}i.items.forEach((function(t,i){e._setItemChecked(i,n.has(t),!1)}))}};ListBox.prototype._getBoundingClientRect=function(t){if(!t.offsetHeight){var e=this.indexOf(t),i=this.hostElement;if(e>-1&&i){e=this._getElementIndex(e);var o=i.getBoundingClientRect();return new wijmo_1.Rect(0,o.top-i.scrollTop+e*this._itemHeight,o.width,this._itemHeight)}}return wijmo_1.Rect.fromBoundingRect(t.getBoundingClientRect())};ListBox.prototype._updateItemAttributes=function(t,e){if(t){var i=this.checkedMemberPath?"true"===t.getAttribute("aria-selected"):null;wijmo_1.toggleClass(t,wijmo_1.ControlStateClsNames.selected,e);this._isMenuItem()||wijmo_1.setAttribute(t,"aria-selected",this._getAriaSelected(e,i));t.tabIndex=e?this._orgTabIndex:-1}};ListBox.prototype._getCheckedItems=function(){var t=this,e=this._cv,i=this._pathChecked,o=[];e&&i&&i.path&&(o=e.sourceCollection.filter((function(o,n){if(e.filter&&!e.filter(o))return!!t._addMode&&i.getValue(o);if(wijmo_1.isObject(o))return i.getValue(o);var s=e.items[n]==o?n:e.items.indexOf(o);return t.getItemChecked(s)})));return o};ListBox.prototype._arrayEquals=function(t,e){if(t==e)return!0;if(!t||!e||t.length!=e.length)return!1;for(var i=0;i<t.length;i++)if(!this._isEqual(t[i],e[i]))return!1;return!0};ListBox.prototype._getChild=function(t){t=this._getElementIndex(t);return this._children[t]};ListBox.prototype._getElementIndex=function(t){if(this._shGroups)for(var e=this._children,i=0;i<=t&&i<e.length;i++){var o=e[i];wijmo_1.hasClass(o,exports.ListBoxClsNames.header)&&t++}return t};ListBox.prototype._setItemChecked=function(t,e,i){void 0===i&&(i=!0);var o=this._cv.items[t],n=this._pathChecked,s=!1,r=this.selectedIndex,a=this._checking;if(wijmo_1.isObject(o)&&n.path){if(!!n.getValue(o)!=e){var l=wijmo_1.tryCast(this._cv,"IEditableCollectionView");s=!0;this._checking=!0;if(l){l.editItem(o);n.setValue(o,e);l.commitEdit()}else{n.setValue(o,e);l.refresh()}this._checking=a}}else if(i){var h=this._findArrayItem(this._checkedItems,o);(e&&h<0||!e&&h>=0)&&(s=!0)}this._setCheckboxState(t,e);if(i){if(s){this._checkedItems=this._checkedItemsUpdate(o,e);this.onItemChecked();this.onCheckedItemsChanged()}r!=this.selectedIndex&&this.onSelectedIndexChanged()}return s};ListBox.prototype._checkedItemsUpdate=function(t,e){var i=this._cv.sourceCollection,o=this._checkedItems,n=0;if(e){for(var s=0;s<i.length;s++){var r=i[s];if(n<o.length&&this._isEqual(r,o[n]))n++;else if(this._isEqual(r,t))return o.slice(0,n).concat([t]).concat(o.slice(n))}return o}var a=this._findArrayItem(o,t);return o.slice(0,a).concat(o.slice(a+1))};ListBox.prototype._isEqual=function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)};ListBox.prototype._findArrayItem=function(t,e){if(!Number.isNaN(e))return t.indexOf(e);for(var i=0;i<t.length;i++)if(Number.isNaN(t[i]))return i;return-1};ListBox.prototype._cvCollectionChanged=function(){if(!this._checking){this._populateList();this.onItemsChanged()}};ListBox.prototype._cvCurrentChanged=function(){if(!this._checking){this.showSelection();this._ignoredItemChangedEvents||this.onSelectedIndexChanged()}};ListBox.prototype._populateList=function(){var t=this.hostElement,e=this._cv;this._itemCount=e?e.items.length:0;this._isVirtual=this._getVirtual();this._oldSel=null;this._itemsAbove=-1;this._itemsBelow=-1;if(t){var i=this.containsFocus(),o=void 0;this.onLoadingItems();var n=this._children=[];t.textContent="";if(e){var s=0,r=void 0,a=[];this._ignoreItemFormatterTextArray=[];if(this._shGroups&&e.groups&&e.groups.length){o={};for(var l=0;l<e.groups.length;l++){var h=e.groups[l];o[s]=h;r=this._createHeaderItem(h,l);a.push(r);for(var u=0;u<h.items.length;u++,s++){r=this._createItem(s,l);a.push(r)}}}else for(u=0;u<e.items.length;u++,s++){r=this._createItem(s);a.push(r)}var c=this._isVirtual?document.createElement("div"):t,p=0;c.innerHTML=a.join("");for(u=0;u<c.children.length;u++){var d=c.children[u];p==e.currentPosition&&(this._oldSel=d);d[ListBox._DIDX_KEY]=d.className.indexOf(exports.ListBoxClsNames.header)<0?p++:-1;n.push(d)}}if(this.formatItem.hasHandlers&&e){s=0;var m=e.items;for(d=new FormatItemEventArgs(0,null,null),u=0;u<n.length;u++){d._item=n[u];if(this._shGroups&&wijmo_1.hasClass(d._item,exports.ListBoxClsNames.header)){d._index=-1;d._data=o[s]}else{d._index=s;d._data=m[s++]}this.onFormatItem(d)}}if(this._isVirtual){var _=this._getCanvasContext(),f=null,b=0;for(u=0;u<n.length;u++){r=n[u];var g=_.measureText(r.textContent);if(g.width>b){f=r;b=g.width}}if(f){var w=!1,y=t.style.display,v=t.style.position;if(!t.parentElement){w=!0;(this._container||document.body).appendChild(t);wijmo_1.setCss(t,{display:"",position:"absolute"})}t.appendChild(f);var x=f.style.whiteSpace;f.style.whiteSpace="nowrap";this._ePadTop.style.width=f.offsetWidth+"px";this._itemHeight=f.offsetHeight||this._itemHeight;f.style.whiteSpace=x;this._eSizer.style.height=n.length*this._itemHeight+"px";t.appendChild(this._eSizer);this._clientHeight=t.clientHeight;wijmo_1.removeChild(this._eSizer);if(w){wijmo_1.removeChild(t);wijmo_1.setCss(t,{display:y,position:v})}wijmo_1.removeChild(f)}else this._ePadTop.style.width="";this._updateViewRange()}this.checkedItems=this._getCheckedItems();var C=this._getSelectedElement(!0);if(i){(C||t).focus()}else C&&this.showSelection();t.tabIndex=C?-1:this._orgTabIndex;this.onLoadedItems()}};ListBox.prototype._getCanvasContext=function(){var t=document.createElement("canvas").getContext("2d"),e=getComputedStyle(this.hostElement);e.fontSize&&e.fontFamily&&(t.font=e.fontSize+" "+e.fontFamily.split(",")[0]);return t};ListBox.prototype._getVirtual=function(){if(this._itemCount<=this._vThreshold)return!1;var t=this.hostElement;if(t){var e=getComputedStyle(t);if(parseInt(e.columnCount)>1||e.display.indexOf("flex")>-1||e.display.indexOf("grid")>-1)return!1}return!0};ListBox.prototype._getMaxSupportedCssHeight=function(){var t=265e5;wijmo_1.isIE()?t=15e5:wijmo_1.isFirefox()&&(t=175e5);return t};ListBox.prototype._updateViewRange=function(){var t=this.hostElement,e=this._itemHeight,i=this._children;if(!(t&&t.parentElement&&this._isVirtual&&i))return!1;var o=t.scrollTop;wijmo_1.assert(e*i.length<this._getMaxSupportedCssHeight(),"The number of items ("+i.length+") exceeds the maximum number of items ("+Math.floor(this._getMaxSupportedCssHeight()/e)+") allowed for this browser.");var n=Math.max(t.clientHeight,this._clientHeight),s=Math.floor(o/e),r=Math.min(i.length,Math.ceil((o+n)/e)-s),a=Math.max(0,i.length-s-r);if(s==this._itemsAbove&&a==this._itemsBelow)return!1;this._itemsAbove=s;this._itemsBelow=a;var l=document.createDocumentFragment(),h=this.containsFocus();this._ePadTop.style.height=s*e+"px";l.appendChild(this._ePadTop);if(this.showGroups&&!wijmo_1.hasClass(i[s],exports.ListBoxClsNames.header))for(var u=s;u>=0;u--)if(wijmo_1.hasClass(i[u],exports.ListBoxClsNames.header)){l.appendChild(i[u]);break}for(u=s;u<=s+r&&u<i.length;u++)l.appendChild(i[u]);this._ePadBot.style.height=a*e+"px";l.appendChild(this._ePadBot);t.textContent="";t.appendChild(l);var c=(s+r+a)*e-t.scrollHeight;this._ePadBot.style.height=this._ePadBot.offsetHeight-c+"px";var p=this._getSelectedElement(!0);if(h){(p||t).focus({preventScroll:!0})}t.tabIndex=p?-1:this._orgTabIndex;return!0};ListBox.prototype._getSelectedElement=function(t){var e=this.selectedIndex,i=this._getElementIndex(e),o=i>-1?this._children[i]:null;t&&o&&!o.offsetHeight&&(o=null);return o};ListBox.prototype._handleResize=function(){this._updateViewRange()};ListBox.prototype._createItem=function(t,e){var i=this._cv.items[t],o=t==this._cv.currentPosition,n=this.getDisplayValue(t),s=this.getDisplayValue(t,void 0!==this.itemFormatter);if(1!=this._html){n=wijmo_1.escapeHtml(n);s=wijmo_1.escapeHtml(s)}this._itemFormatterHelper.innerHTML=s;s=this._itemFormatterHelper.textContent;this._ignoreItemFormatterTextArray.push(s);var r=null;if(this.checkedMemberPath){r=!1;wijmo_1.isObject(i)?r=!!this._pathChecked.getValue(i):this._checkedItems&&(r=this._checkedItems.indexOf(i)>-1);n='\n <label class="wj-checklist-item">\n <span class="wj-checklist-base" role="checkbox" aria-hidden="true">\n <span class="wj-checklist-mark" style="display: '+(r?"block":"none")+'"></span>\n </span>\n <span class="wj-checklist-caption">'+n+"</span>\n </label>"}var a=exports.ListBoxClsNames.listBoxItem;o&&(a+=" "+wijmo_1.ControlStateClsNames.selected);r&&(a+=" "+wijmo_1.ControlStateClsNames.checked);if(this._html){var l=[wijmo_1.UtilitesClsNames.separator,wijmo_1.ControlStateClsNames.disabled];if(n.indexOf(l[0])>-1||n.indexOf(l[1])>-1){var h=wijmo_1.createElement(n);l.forEach((function(t){wijmo_1.hasClass(h,t)&&(a+=" "+t)}))}}var u="aria-describedby = listGroup-"+e;return'<div id="'+("listitem-"+t)+'" class="'+a+'" \n role="'+this.itemRole+'" \n '+(void 0!==e?u:"")+"\n "+(this._getAriaSelected(o,r)&&!this._isMenuItem()?'aria-selected="true"':"")+' \n tabindex="'+(o&&!this.isDisabled?this._orgTabIndex:-1)+'">'+n+"</div>"};ListBox.prototype._getAriaSelected=function(t,e){return!!(null!=e?e:t)||null};ListBox.prototype._createHeaderItem=function(t,e){var i=wijmo_1.escapeHtml(t.name);return'<div id="listGroup-'+e+'" class="'+exports.ListBoxClsNames.listBoxItem+" "+exports.ListBoxClsNames.header+" "+wijmo_1.ControlStateClsNames.disabled+'" role="group" tabindex="-1">'+i+"</div>"};ListBox.prototype._click=function(t){if(0==t.button&&!t.defaultPrevented){var e=this.indexOf(t.target);if(e>-1){this.selectedIndex=e;if(this.checkedMemberPath){var i=this._children[this._getElementIndex(e)];if(i){i.focus({preventScroll:!0});this.setItemChecked(e,"true"!==i.getAttribute("aria-selected"))}}else{wijmo_1.closest(t.target,"."+exports.ListBoxClsNames.listBoxItem).focus({preventScroll:!0})}}}};ListBox.prototype._keydown=function(t){var e=this.selectedIndex;if(!t.defaultPrevented){if(65==t.keyCode&&(t.ctrlKey||t.metaKey)){var i=this.collectionView;if(this.checkedMemberPath&&wijmo_1.hasItems(i)){for(var o=this._children,n=[],s=!0,r=0;r<o.length;r++)if(!wijmo_1.hasClass(o[r],wijmo_1._CLS_STATE_DISABLED)){var a=i.items[r];n.push(a);s&&!this.checkedItems.includes(a)&&(s=!1)}n.length!==i.items.length?this.checkedItems=s?this.checkedItems.filter((function(t){return!n.includes(t)})):this.checkedItems.concat(n):this.checkedItems=this.checkedItems.length!=i.items.length?i.items:[];t.preventDefault();return}}if(!t.altKey&&!t.metaKey){t.shiftKey&&(this._isShiftDown=!0);switch(t.keyCode){case wijmo_1.Key.Down:t.preventDefault();this._selectNext(t.shiftKey);break;case wijmo_1.Key.Up:t.preventDefault();this._selectPrev(t.shiftKey);break;case wijmo_1.Key.Home:t.preventDefault();t.ctrlKey&&t.shiftKey?this._selectRange(0):this._selectFirst();break;case wijmo_1.Key.End:t.preventDefault();t.ctrlKey&&t.shiftKey?this._selectRange(this._children.length-1):this._selectLast();break;case wijmo_1.Key.PageDown:t.preventDefault();this._selectNextPage();break;case wijmo_1.Key.PageUp:t.preventDefault();this._selectPrevPage();break;case wijmo_1.Key.Space:if(this.checkedMemberPath&&e>-1){var l=this._children[this._getElementIndex(e)];if(l&&this.isItemEnabled(e)&&!l.hasAttribute("disabled")){var h="true"===l.getAttribute("aria-selected");this.setItemChecked(e,!h);t.preventDefault()}}}}}};ListBox.prototype._getCheckboxState=function(t){var e=this._children[this._getElementIndex(t)];if(e)return"true"===e.getAttribute("aria-selected")};ListBox.prototype._setCheckboxState=function(t,e){var i=this._getElementIndex(t),o=this._children[i];if(o){var n=o.querySelector(".wj-checklist-mark");if(n){o.setAttribute("aria-selected",e.toString());wijmo_1.toggleClass(o,wijmo_1.ControlStateClsNames.checked,e);n.style.display=e?"block":"none"}else{var s=this._getCheckbox(i);if(s){s.checked=e;var r=wijmo_1.closest(s,"."+exports.ListBoxClsNames.listBoxItem);if(r){wijmo_1.toggleClass(r,wijmo_1.ControlStateClsNames.checked,e);wijmo_1.setAttribute(r,"aria-selected",!!e||null)}}}}};ListBox.prototype._getCheckbox=function(t){var e=this._children;return this.hostElement&&t>-1&&t<e.length?e[t].querySelector("input[type=checkbox]"):null};ListBox.prototype._keypress=function(t){var e=this;if(!t.defaultPrevented&&!(t.target instanceof HTMLInputElement)&&(t.charCode>32||32==t.charCode&&this._search)){t.preventDefault();this._search+=String.fromCharCode(t.charCode);this._toSearch&&clearTimeout(this._toSearch);this._toSearch=setTimeout((function(){e._toSearch=null;e._search=""}),wijmo_1.Control._SEARCH_DELAY);var i=this._findNext();if(i<0&&this._search.length>1){this._search=this._search[this._search.length-1];i=this._findNext()}i>-1&&(this.selectedIndex=i)}};ListBox.prototype._selectNext=function(t){void 0===t&&(t=!1);var e=this.selectedIndex,i=this._findNextEnabled(e+1);if(i>-1){t&&this._selectRange(i);this.selectedIndex=i}return i>-1};ListBox.prototype._selectPrev=function(t){void 0===t&&(t=!1);var e=this.selectedIndex,i=this._findPrevEnabled(e-1);if(i>-1){t&&this._selectRange(i);this.selectedIndex=i}return i>-1};ListBox.prototype._findNextEnabled=function(t){for(var e=t;e<this._children.length;e++)if(this.isItemEnabled(e))return e;return-1};ListBox.prototype._findPrevEnabled=function(t){for(var e=t;e>=0;e--)if(this.isItemEnabled(e))return e;return-1};ListBox.prototype._selectFirst=function(){for(var t=0;t<this._children.length;t++)if(this.isItemEnabled(t)){this.selectedIndex=t;return!0}return!1};ListBox.prototype._selectLast=function(){for(var t=this._children.length-1;t>=0;t--)if(this.isItemEnabled(t)){this.selectedIndex=t;return!0}return!1};ListBox.prototype._selectNextPage=function(){var t=this.hostElement.offsetHeight,e=this._children,i=this._cv?this._cv.items.length:0,o=0;if(t>0)for(var n=this.selectedIndex+1;n<i;n++){var s=e[n].scrollHeight||this._itemHeight;if(o+s>t&&this.isItemEnabled(n)){this.selectedIndex=n;return!0}o+=s}return this._selectLast()};ListBox.prototype._selectPrevPage=function(){var t=this.hostElement.offsetHeight,e=this._children,i=0;if(t>0)for(var o=this.selectedIndex-1;o>0;o--){var n=e[o].scrollHeight||this._itemHeight;if(i+n>t&&this.isItemEnabled(o)){this.selectedIndex=o;return!0}i+=n}return this._selectFirst()};ListBox.prototype._findNext=function(){if(this.hostElement){var t=this._children.length,e=this.selectedIndex;(e<0||1==this._search.length)&&e++;var i=this._search,o=this.caseSensitiveSearch;o||(i=i.toLowerCase());for(var n=0;n<t;n++){var s=(e+n)%t;if(this.isItemEnabled(s)){var r=this.getDisplayText(s).trim();o||(r=r.toLowerCase());if(0==r.indexOf(i))return s}}}return-1};ListBox.prototype._initFromSelect=function(t){for(var e=t.children,i=[],o=-1,n=0;n<e.length;n++){var s=e[n];if("OPTION"==s.tagName){s.hasAttribute("selected")&&(o=i.length);s.innerHTML?i.push({hdr:s.innerHTML,val:s.getAttribute("value"),cmdParam:s.getAttribute("cmd-param")}):i.push({hdr:'<div class="'+wijmo_1.UtilitesClsNames.separator+'"></div>'});t.removeChild(s);n--}}if(i){this.displayMemberPath="hdr";this.selectedValuePath="val";this.itemsSource=i;this.selectedIndex=o}};ListBox.prototype._setIsDisabled=function(e){t.prototype._setIsDisabled.call(this,e);this._updateTabIndex()};ListBox.prototype._setTabOrder=function(e){t.prototype._setTabOrder.call(this,e);this.isDisabled||this._updateTabIndex()};ListBox.prototype._isMenuItem=function(){return"menuitem"===this.itemRole||"menuitemcheckbox"===this.itemRole||"menuitemradio"===this.itemRole};ListBox.prototype._updateTabIndex=function(){var t=this.hostElement,e=this._getSelectedElement(!0);if(e){e.tabIndex=this.isDisabled?-1:this._orgTabIndex;t.tabIndex=-1}else t.tabIndex=this.isDisabled?-1:this._orgTabIndex};ListBox.prototype._selectRange=function(t){if(-1!==this.selectedIndex){if(this._shouldClearOnShift&&this._isShiftDown){this.checkedItems=[];this._shouldClearOnShift=!1}var e=Math.min(this.selectedIndex,t),i=Math.max(this.selectedIndex,t),o=this.collectionView.items.slice(e,i+1);this.checkedItems=Array.from(new Set(this.checkedItems.concat(o)))}};ListBox.prototype.dispose=function(){if(this._cv){this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this);this._cv=null}this._items=null;if(this._toSearch){clearTimeout(this._toSearch);this._toSearch=null}this._children=null;this._eSizer=null;this._ePadTop=null;this._ePadBot=null;this._itemFormatterHelper=null;this._ignoreItemFormatterTextArray=null;this._checkedItems=null;t.prototype.dispose.call(this)};ListBox._DIDX_KEY="$WJ-DIDX";ListBox._VTHRESH=Number.MAX_VALUE/2;return ListBox}(wijmo_1.Control);exports.ListBox=ListBox;var FormatItemEventArgs=function(t){__extends(FormatItemEventArgs,t);function FormatItemEventArgs(e,i,o){var n=t.call(this)||this;n._index=wijmo_1.asNumber(e);n._data=i;n._item=wijmo_1.asType(o,HTMLElement,!0);return n}Object.defineProperty(FormatItemEventArgs.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0});Object.defineProperty(FormatItemEventArgs.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0});Object.defineProperty(FormatItemEventArgs.prototype,"item",{get:function(){return this._item},enumerable:!0,configurable:!0});return FormatItemEventArgs}(wijmo_1.EventArgs);exports.FormatItemEventArgs=FormatItemEventArgs;wijmo_1._addCultureInfo("MultiSelectListBox",{filterPlaceholder:"Filter",selectAll:"Select All",ariaLabels:{multiSelectListBox:"Multi select list box"}});var DateSelectionMode,ShowMonthPicker,CalendarTabKeyAction,MultiSelectListBox=function(t){__extends(MultiSelectListBox,t);function MultiSelectListBox(e,i){var o=t.call(this,e)||this;o._ariaLabel=wijmo_1.culture.MultiSelectListBox.ariaLabels.multiSelectListBox;o._selectAllLabel=null;o._filterPlaceholder=null;o._filterText="";o._checkOnFilter=!0;o._delay=wijmo_1.Control._SEARCH_DELAY;o.checkedItemsChanged=new wijmo_1.Event;o.selectedIndexChanged=new wijmo_1.Event;var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.MultiSelectListBoxClsNames.hostElement,n,{_selectAll:"select-all",_filter:"filter",_lbHost:"list-box"});o._selectAll.style.display="none";o._filter.style.display="none";o._lbx=new ListBox(o._lbHost,{checkedMemberPath:MultiSelectListBox._DEF_CHECKED_PATH,loadedItems:function(){return o._updateCheckAllCheckbox()},checkedItemsChanged:function(t){return o.onCheckedItemsChanged(t)},selectedIndexChanged:function(){return o.onSelectedIndexChanged()}});o._cbSelectAll=o._selectAll.querySelector("input[type=checkbox]");o._spSelectAll=o._selectAll.querySelector("label>span");var s=wijmo_1.culture.MultiSelectListBox;wijmo_1.setText(o._spSelectAll,s.selectAll);o._filter.placeholder=s.filterPlaceholder;o.initialize(i);o.addEventListener(o._filter,"input",(function(){if(o._filter.value!=o._filterText){o._filterText=o._filter.value;o._toSearch&&clearTimeout(o._toSearch);o._toSearch=setTimeout((function(){o._toSearch=null;o._applyFilter()}),o.delay)}}));o.addEventListener(o._cbSelectAll,"click",(function(t){var e=o._lbx.collectionView;wijmo_1.hasItems(e)&&(o.checkedItems=t.target.checked?e.items:[])}));o.addEventListener(o.hostElement,"keydown",(function(t){var e=o.showFilterInput?o._filter:null,i=o._lbx;if(e&&t.keyCode==wijmo_1.Key.F3){wijmo_1.setSelectionRange(e,0,e.value.length);t.preventDefault()}if(wijmo_1.getActiveElement()==e){var n=!t.altKey;switch(t.keyCode){case wijmo_1.Key.Escape:case wijmo_1.Key.F4:n=!1}n&&t.stopPropagation()}if(!i.containsFocus())switch(t.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:o._lbx.focus();if(!t.altKey){var s=i.selectedIndex+(t.keyCode==wijmo_1.Key.Up?-1:1);i.selectedIndex=Math.max(0,s)}t.preventDefault()}}),!0);o.hostElement.tabIndex=-1;o._lbx.tabOrder=o._orgTabIndex;o._updateAriaLabel();return o}Object.defineProperty(MultiSelectListBox,"controlTemplate",{get:function(){MultiSelectListBox._ctrlTemplate||(MultiSelectListBox._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+" "+exports.ListBoxClsNames.hostElement+'"><input wj-part="filter" class="'+wijmo_1.InputFormElementsClsNames.formControl+'" tabindex="-1"><div wj-part="select-all" class="'+exports.MultiSelectListBoxClsNames.header+" "+exports.MultiSelectListBoxClsNames.selectAll+" "+exports.ListBoxClsNames.listBoxItem+'"><label><input type="checkbox" tabindex="-1"> <span></span></label></div><div wj-part="list-box"/></div>');return MultiSelectListBox._ctrlTemplate},set:function(t){MultiSelectListBox._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"itemsSource",{get:function(){return this._lbx.itemsSource},set:function(t){this._lbx.itemsSource=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"collectionView",{get:function(){return this._lbx.collectionView},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"virtualizationThreshold",{get:function(){return this._lbx.virtualizationThreshold},set:function(t){this._lbx.virtualizationThreshold=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"displayMemberPath",{get:function(){return this._lbx.displayMemberPath},set:function(t){this._lbx.displayMemberPath=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"isContentHtml",{get:function(){return this._lbx.isContentHtml},set:function(t){this._lbx.isContentHtml=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"caseSensitiveSearch",{get:function(){return this._lbx.caseSensitiveSearch},set:function(t){this._lbx.caseSensitiveSearch=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"delay",{get:function(){return this._delay},set:function(t){this._delay=wijmo_1.asNumber(t,!1,!0)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"showGroups",{get:function(){return this._lbx.showGroups},set:function(t){this._lbx.showGroups=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"checkOnFilter",{get:function(){return this._checkOnFilter},set:function(t){if(t!=this.checkOnFilter){this._checkOnFilter=wijmo_1.asBoolean(t);this.checkedItems=[]}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"selectedIndex",{get:function(){return this._lbx.selectedIndex},set:function(t){this._lbx.selectedIndex=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"listBox",{get:function(){return this._lbx},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"showFilterInput",{get:function(){return""==this._filter.style.display},set:function(t){if(t!=this.showFilterInput){this._filter.style.display=wijmo_1.asBoolean(t)?"":"none";if(!this.showFilterInput){this._filter.value="";this._applyFilter()}}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"filterInputPlaceholder",{get:function(){return this._filterPlaceholder},set:function(t){if(t!=this._filterPlaceholder){this._filterPlaceholder=wijmo_1.asString(t);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"showSelectAllCheckbox",{get:function(){return""==this._selectAll.style.display},set:function(t){this._selectAll.style.display=wijmo_1.asBoolean(t)?"":"none"},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"selectAllLabel",{get:function(){return this._selectAllLabel},set:function(t){if(t!=this._selectAllLabel){this._selectAllLabel=wijmo_1.asString(t);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"checkedMemberPath",{get:function(){var t=this.listBox.checkedMemberPath;return t!=MultiSelectListBox._DEF_CHECKED_PATH?t:null},set:function(t){t=wijmo_1.asString(t);this.listBox.checkedMemberPath=t||MultiSelectListBox._DEF_CHECKED_PATH},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"checkedItems",{get:function(){return this.listBox.checkedItems},set:function(t){this.listBox.checkedItems=wijmo_1.asArray(t)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelectListBox.prototype,"ariaLabelledBy",{get:function(){return this.hostElement.getAttribute("aria-labelledby")},set:function(t){wijmo_1._setAriaLabelBy(this,this.hostElement,t,this._updateAriaLabel.bind(this))},enumerable:!0,configurable:!0});MultiSelectListBox.prototype._updateAriaLabel=function(){var t=wijmo_1.culture.MultiSelectListBox;wijmo_1.setAriaLabel(this._selectAll,t.selectAll);wijmo_1.setAriaLabel(this._filter,t.filterPlaceholder);this.hostElement&&(this.ariaLabelledBy?wijmo_1.setAriaLabel(this.hostElement,null):wijmo_1.setAriaLabel(this.hostElement,this._ariaLabel))};MultiSelectListBox.prototype.onCheckedItemsChanged=function(t){var e=this;this._updateCheckAllCheckbox();this.checkedItemsChanged.raise(this,t);t._items&&"object"==typeof t._items[0]&&(this.checkedMemberPath||MultiSelectListBox._DEF_CHECKED_PATH)in t._items[0]&&setTimeout((function(){e._lbx._updateCheckedList(e.checkedItems)}),0)};MultiSelectListBox.prototype.onSelectedIndexChanged=function(t){this.selectedIndexChanged.raise(this,t)};MultiSelectListBox.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);if(this.hostElement){var i=wijmo_1.culture.MultiSelectListBox;this._filter.placeholder=null!=this._filterPlaceholder?this._filterPlaceholder:i.filterPlaceholder;this._spSelectAll&&wijmo_1.setText(this._spSelectAll,null!=this._selectAllLabel?this._selectAllLabel:i.selectAll);this._updateCheckAllCheckbox()}};MultiSelectListBox.prototype.dispose=function(){this.listBox.dispose();t.prototype.dispose.call(this)};MultiSelectListBox.prototype._applyFilter=function(){var t=this,e=this._lbx,i=e.collectionView,o=this._filter.value,n=o?new RegExp(wijmo_1.escapeRegExp(o),e.caseSensitiveSearch?"":"i"):null,s=this.displayMemberPath,r=s?new wijmo_1.Binding(s):null,a=this.checkOnFilter?null:this.checkedItems;i.filter=function(e){if(null!=n){if(a&&a.indexOf(e)>-1)return!0;r&&(e=r.getValue(e));t.isContentHtml&&(e=wijmo_1.toPlainText(e));return null!=e&&n.test(e.toString())}return!0};e.selectedIndex=Math.max(0,e.selectedIndex);this._checkOnFilter&&(this.checkedItems=n?i.items:[])};MultiSelectListBox.prototype._updateCheckAllCheckbox=function(){var t=this._lbx.collectionView,e=this._cbSelectAll;if(wijmo_1.hasItems(t)){var i=t.items.length,o=this.checkedItems.length;wijmo_1.setChecked(e,o==i||0!=o&&null);e.disabled=!1}else{wijmo_1.setChecked(e,!1);e.checked=!1;e.disabled=!0}};MultiSelectListBox.prototype._setIsDisabled=function(e){t.prototype._setIsDisabled.call(this,e);this.hostElement.tabIndex=-1;this.isDisabled?this._lbx.tabOrder=-1:this._lbx.tabOrder=this._orgTabIndex};MultiSelectListBox.prototype._setTabOrder=function(t){this._orgTabIndex=t;this._lbx.tabOrder=t};MultiSelectListBox.prototype.tryForceClearDelayAndFilter=function(){var t=this;if(this._toSearch){var e=this._delay;this._filterText=this._filter.value;this._toSearch&&clearTimeout(this._toSearch);this._toSearch=setTimeout((function(){t._toSearch=null;t._applyFilter()}),0);this._delay=e}};MultiSelectListBox.prototype.onLostFocus=function(){this.tryForceClearDelayAndFilter();t.prototype.onLostFocus.call(this)};MultiSelectListBox._DEF_CHECKED_PATH="$checked";MultiSelectListBox._ctrlTemplate="";return MultiSelectListBox}(wijmo_1.Control);exports.MultiSelectListBox=MultiSelectListBox;wijmo_1._addCultureInfo("Calendar",{ariaLabels:{calendar:"Calendar",chooseDate:"Choose Date",chooseMonth:"Choose Month",monthView:"Month View",yearView:"Year View",selectYear:"Select Year",prvMo:"Previous Month",today:"Select Today",nxtMo:"Next Month",prvYr:"Previous Year",currMo:"Current Month",nxtYr:"Next Year"},buttons:{ok:"OK",cancel:"Cancel"}});!function(t){t[t.None=0]="None";t[t.Day=1]="Day";t[t.Month=2]="Month";t[t.Range=3]="Range"}(DateSelectionMode=exports.DateSelectionMode||(exports.DateSelectionMode={}));!function(t){t[t.None=0]="None";t[t.FirstMonth=1]="FirstMonth";t[t.LastMonth=2]="LastMonth";t[t.FirstAndLastMonths=3]="FirstAndLastMonths";t[t.AllMonths=4]="AllMonths";t[t.Outside=5]="Outside"}(ShowMonthPicker=exports.ShowMonthPicker||(exports.ShowMonthPicker={}));!function(t){t[t.None=0]="None";t[t.All=1]="All"}(CalendarTabKeyAction=exports.CalendarTabKeyAction||(exports.CalendarTabKeyAction={}));var ClickAction,KeyAction,TabKeyAction,Calendar=function(t){__extends(Calendar,t);function Calendar(e,i){var o=t.call(this,e)||this;o._yrPicker=!0;o._mtPicker=ShowMonthPicker.FirstMonth;o._wksBefore=0;o._wksAfter=0;o._rngMin=0;o._rngMax=0;o._min=null;o._max=null;o._readOnly=!1;o._handleWheel=!0;o._fdw=null;o._selMode=DateSelectionMode.Day;o._ariaLabel=wijmo_1.culture.Calendar.ariaLabels.calendar;o._tmYrHidden=0;o._fmtYrMo="y";o._fmtYr="yyyy";o._fmtDayHdr="ddd";o._fmtDay="d ";o._fmtMonths="MMM";o._fmtDayTitle="dddd";o.valueChanged=new wijmo_1.Event;o.rangeEndChanged=new wijmo_1.Event;o.rangeChanged=new wijmo_1.Event;o.displayMonthChanged=new wijmo_1.Event;o.formatItem=new wijmo_1.Event((function(){o.invalidate()}));o._updateCellFocus=function(t,e){wijmo_1.toggleClass(t,exports.CalendarClsNames.focused,e);wijmo_1.setAttribute(t,"tabIndex",e?"0":"-1");e&&o.containsFocus()&&t.focus()};o.cancelButtonClicked=new wijmo_1.Event;o.OKButtonClicked=new wijmo_1.Event;o._enterKeyDownToSetValue=new wijmo_1.Event;o._value=o._rngEnd=wijmo_1.DateTime.newDate();o._month=o._getMonth(o._value);o._cals=[o];o._createChildren();o._createYearPicker();var n=o.hostElement,s=o.addEventListener.bind(o);s(n,"keydown",o._keydown.bind(o));s(n,"click",o._click.bind(o));s(o._btnCancel,"click",o.oneCancelButtonClick.bind(o));s(o._btnOK,"click",o.onOkButtonClick.bind(o));o._focusValue=wijmo_1.DateTime.newDate();wijmo_1.setAttribute(n,"role","application");wijmo_1.setAttribute(o.hostElement,"aria-label",o._ariaLabel);var r=wijmo_1.culture.Calendar.buttons;wijmo_1.setText(o._btnOK,r.ok);wijmo_1.setText(o._btnCancel,r.cancel);o._keyActionTab=CalendarTabKeyAction.None;o._rptUp=new wijmo_1._ClickRepeater(o._btnPrv);o._rptDn=new wijmo_1._ClickRepeater(o._btnNxt);o.addEventListener(n,"wheel",(function(t){if(o.handleWheel&&!t.defaultPrevented&&!o.isReadOnly&&o.containsFocus()){t.deltaY<0?o._btnPrv.click():o._btnNxt.click();t.preventDefault()}}));o.initialize(i);o.refresh(!0);return o}Object.defineProperty(Calendar,"controlTemplate",{get:function(){Calendar._ctrlTemplate||(Calendar._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.content+" "+exports.CalendarClsNames.calendarOuter+'"><div wj-part="tbl-header" class='+exports.CalendarClsNames.calendarHeader+'><div wj-part="btn-month" class='+exports.CalendarClsNames.monthSelect+' role="button" aria-live="polite"><span wj-part="span-month"></span> <span class='+wijmo_1.GlyphClsNames.down+'></span></div><div class="'+wijmo_1.InputFormElementsClsNames.btnGroup+'"><button wj-part="btn-prev" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.left+'></span></button><button wj-part="btn-today" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.circle+'></span></button><button wj-part="btn-next" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.right+'></span></button></div></div><table wj-part="tbl-month" class='+exports.CalendarClsNames.calendarMonth+' role="grid"></table><table wj-part="tbl-year" class='+exports.CalendarClsNames.calendarYear+' role="grid"></table><div wj-part="confirmation-button-container" class="'+exports.CalendarClsNames.confirmationButtonContainer+'"><button wj-part="btn-ok" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+exports.CalendarClsNames.button+'"></button><button wj-part="btn-cancel" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+exports.CalendarClsNames.button+'"></button></div>');return Calendar._ctrlTemplate},set:function(t){Calendar._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"value",{get:function(){return this._value},set:function(t){if(!wijmo_1.DateTime.sameDate(t,this._value)||!wijmo_1.DateTime.sameTime(t,this._value)){this._clearingRangeEnd=!wijmo_1.DateTime.equals(this._value,t);this.rangeEnd=null;this._clearingRangeEnd=!1;t=wijmo_1.asDate(t,!0);t=this._clamp(t);if(this._valid(t)||null==t){this.ensureVisible(t||new Date);if(!wijmo_1.DateTime.equals(this._value,t)){this._value=t;this.focusMode&&(this._focusValue=t);this.invalidate(!1);this.onValueChanged()}}if(!this.value){var e=this.min,i=this.max,o=this.displayMonth;i&&i<o?this.ensureVisible(i):e&&e>o&&this.ensureVisible(e)}}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"focusValue",{get:function(){return this._focusValue},set:function(t){t=wijmo_1.asDate(t,!0);t=this._clamp(t);if(this._valid(t)||null==t){this.ensureVisible(t||new Date);this._focusValue=t;this.invalidate(!1)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"rangeEnd",{get:function(){return this._rngEnd},set:function(t){t=wijmo_1.asDate(t,!0);if((t=this._clamp(t))&&this._value&&this._rngMode()){t<this._value&&(t=this._value);var e=this._rngMin,i=this._rngMax;if(e&&e>0||i&&i>0){var o=this._value,n=Math.ceil((t.getTime()-o.getTime())/864e5)+1;e&&e>0&&n<e&&(t=wijmo_1.DateTime.addDays(o,e-1));i&&i>0&&n>i&&(t=wijmo_1.DateTime.addDays(o,i-1))}}if((this._valid(t)||null==t)&&!wijmo_1.DateTime.equals(this._rngEnd,t)){this._rngEnd=t;this.ensureVisible(t);this.invalidate(!1);this._clearingRangeEnd||this.onRangeEndChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"rangeMin",{get:function(){return this._rngMin},set:function(t){if((t=wijmo_1.asNumber(t,!0,!0))!=this._rngMin){this._rngMin=t;this._syncProp(this,"rangeMin");this._rngMode()&&this._rngEnd&&(this.rangeEnd=this._rngEnd)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"rangeMax",{get:function(){return this._rngMax},set:function(t){if((t=wijmo_1.asNumber(t,!0,!0))!=this._rngMax){this._rngMax=t;this._syncProp(this,"rangeMax");this._rngMode()&&this._rngEnd&&(this.rangeEnd=this._rngEnd)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"min",{get:function(){return this._min},set:function(t){if((t=wijmo_1.asDate(t,!0))!=this.min){this._min=t;this._syncProp(this,"min");this.refresh();!this.value&&t&&t>this.displayMonth&&this.ensureVisible(t)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"max",{get:function(){return this._max},set:function(t){if((t=wijmo_1.asDate(t,!0))!=this.max){this._max=t;this._syncProp(this,"max");this.refresh();!this.value&&t&&t<this.displayMonth&&this.ensureVisible(t)}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"selectionMode",{get:function(){return this._selMode},set:function(t){var e=DateSelectionMode;if((t=wijmo_1.asEnum(t,e))!=this._selMode){this._selMode=t;this._mthMode()&&(this.monthView=!1);this._rngEnd=t==e.Range?this._value:null;this.refresh();this._syncProp(this,"selectionMode")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"isReadOnly",{get:function(){return this._readOnly},set:function(t){this._readOnly=wijmo_1.asBoolean(t);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly);this._syncProp(this,"isReadOnly")},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(t){if(this._handleWheel!=t){this._handleWheel=wijmo_1.asBoolean(t);this._syncProp(this,"handleWheel")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"repeatButtons",{get:function(){return!this._rptUp.disabled},set:function(t){this._rptUp.disabled=this._rptDn.disabled=!wijmo_1.asBoolean(t);this._syncProp(this,"repeatButtons")},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"showYearPicker",{get:function(){return this._yrPicker},set:function(t){if(t!=this._yrPicker){this._yrPicker=wijmo_1.asBoolean(t);this._syncProp(this,"showYearPicker")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"showMonthPicker",{get:function(){return this._mtPicker},set:function(t){if(t!=this._mtPicker){var e=ShowMonthPicker;wijmo_1.isBoolean(t)&&(t=t?e.FirstMonth:e.None);this._mtPicker=wijmo_1.asEnum(t,e);wijmo_1.toggleClass(this.hostElement,wijmo_1.InputFormElementsClsNames.btnsOutside,this._getShowMonthPicker()==e.Outside);this.refresh();this._syncProp(this,"showMonthPicker")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"firstDayOfWeek",{get:function(){return this._fdw},set:function(t){if(t!=this._fdw){if((t=wijmo_1.asNumber(t,!0))&&(t>6||t<0))throw"firstDayOfWeek must be between 0 and 6 (Sunday to Saturday).";this._fdw=t;this.refresh();this._syncProp(this,"firstDayOfWeek")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"displayMonth",{get:function(){return this._month},set:function(t){t=wijmo_1.asDate(t);t=this._getMonth(t);var e=this._getDisplayMonthRange();e.to&&t>e.to&&(t=e.to);e.from&&t<e.from&&(t=e.from);if(!wijmo_1.DateTime.equals(this.displayMonth,t)){this._month=t;this.invalidate(!0);this.onDisplayMonthChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"monthCount",{get:function(){var t=this.hostElement;return t?t.querySelectorAll("."+exports.CalendarClsNames.hostElement).length+1:0},set:function(t){var e=this,i=this.hostElement;if(t!=this.monthCount&&i){var o=i.querySelectorAll("."+exports.CalendarClsNames.hostElement);t=wijmo_1.asInt(t,!1);wijmo_1.assert(t>0,"monthCount must be >= 1.");wijmo_1.assert(1==t||!wijmo_1.closest(i.parentElement,"."+exports.CalendarClsNames.hostElement),"Only top-level calendars can set monthCount.");for(var n=0;n<o.length;n++){var s=o[n];wijmo_1.removeChild(s);this._getCalendar(s).dispose()}this._cals=[this];for(n=1;n<t;n++){(s=new Calendar(document.createElement("div"),{itemFormatter:this.itemFormatter,itemValidator:this.itemValidator,formatItem:function(t,i){return e.onFormatItem(i)}}))._selMode=this._selMode;s._value=this._value;s._rngEnd=this._rngEnd;for(var r in this)if(!/^(_.*|constructor|displayMonth|monthCount|hostElement|rightToLeft|isUpdating|isTouching)$/.test(r)){var a=this[r];wijmo_1.isFunction(a)||a instanceof wijmo_1.Event||(s[r]=a)}this._cals.push(s);i.appendChild(s.hostElement)}this.updateCalendarsTabindex();wijmo_1.toggleClass(i,exports.CalendarClsNames.calendarMultiMonth,t>1);this._syncProp(this,"displayMonth")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatYearMonth",{get:function(){return this._fmtYrMo},set:function(t){if(t!=this._fmtYrMo){this._fmtYrMo=wijmo_1.asString(t);this._syncProp(this,"formatYearMonth");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatDayHeaders",{get:function(){return this._fmtDayHdr},set:function(t){if(t!=this._fmtDayHdr){this._fmtDayHdr=wijmo_1.asString(t);this._syncProp(this,"formatDayHeaders");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatDays",{get:function(){return this._fmtDay},set:function(t){if(t!=this._fmtDay){this._fmtDay=wijmo_1.asString(t);this._syncProp(this,"formatDays");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatYear",{get:function(){return this._fmtYr},set:function(t){if(t!=this._fmtYr){this._fmtYr=wijmo_1.asString(t);this._syncProp(this,"formatYear");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"formatMonths",{get:function(){return this._fmtMonths},set:function(t){if(t!=this._fmtMonths){this._fmtMonths=wijmo_1.asString(t);this._syncProp(this,"formatMonths");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"showHeader",{get:function(){return"none"!=this._tbHdr.style.display},set:function(t){if(t!=this.showHeader){this._tbHdr.style.display=wijmo_1.asBoolean(t)?"":"none";this._syncProp(this,"showHeader")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"monthView",{get:function(){return"none"!=this._tbMth.style.display},set:function(t){if(t!=this.monthView){this._tbMth.style.display=t?"":"none";this._tbYr.style.display=t?"none":"";this.refresh();var e=wijmo_1.culture.Calendar.ariaLabels;wijmo_1.setAriaLabel(this._btnPrv,t?e.prvMo:e.prvYr);wijmo_1.setAriaLabel(this._btnTdy,t?e.today:e.currMo);wijmo_1.setAriaLabel(this._btnNxt,t?e.nxtMo:e.nxtYr);wijmo_1.setAriaLabel(this._btnMth,t?e.monthView:e.yearView);this._updateMonthButtonAria();this._syncProp(this,"monthView")}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"weeksBefore",{get:function(){return this._wksBefore},set:function(t){if(t!=this._wksBefore){this._wksBefore=Math.floor(wijmo_1.asNumber(t,!1,!0));this._syncProp(this,"weeksBefore");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"weeksAfter",{get:function(){return this._wksAfter},set:function(t){if(t!=this._wksAfter){this._wksAfter=Math.floor(wijmo_1.asNumber(t,!1,!0));this._syncProp(this,"weeksAfter");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"itemFormatter",{get:function(){return this._itemFormatter},set:function(t){if(t!=this._itemFormatter){this._itemFormatter=wijmo_1.asFunction(t);this._syncProp(this,"itemFormatter");this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"itemValidator",{get:function(){return this._itemValidator},set:function(t){if(t!=this._itemValidator){this._itemValidator=wijmo_1.asFunction(t);this._syncProp(this,"itemValidator");this.invalidate()}},enumerable:!0,configurable:!0});Calendar.prototype.hitTest=function(t){var e=t instanceof MouseEvent?t.target:t instanceof Element?t:null;wijmo_1.assert(null!=e,"MouseEvent or Element expected");return e?e[Calendar._DATE_KEY]:null};Calendar.prototype.ensureVisible=function(t){if(null!=t){var e=this._getCalendars(),i=e.indexOf(this),o=e[0],n=e[e.length-1];t<o.displayMonth?this.displayMonth=wijmo_1.DateTime.addMonths(this._getMonth(t),i):t>n.displayMonth&&(this.displayMonth=wijmo_1.DateTime.addMonths(this._getMonth(t),i-e.length+1))}};Calendar.prototype.onValueChanged=function(t){this.valueChanged.raise(this,t);this._syncProp(this,"value")};Calendar.prototype.onRangeEndChanged=function(t){this.rangeEndChanged.raise(this,t);this._syncProp(this,"rangeEnd");this._value&&this._rngEnd&&this.onRangeChanged(t)};Calendar.prototype.onRangeChanged=function(t){this.rangeChanged.raise(this,t)};Calendar.prototype.onDisplayMonthChanged=function(t){this.displayMonthChanged.raise(this,t);this._syncProp(this,"displayMonth")};Calendar.prototype.onFormatItem=function(t){this.formatItem.raise(this,t)};Calendar.prototype._containsFocusImpl=function(e){return t.prototype._containsFocusImpl.call(this,e)||this._lbYears._containsFocusImpl(e)};Calendar.prototype.dispose=function(){this._rptUp.element=null;this._rptDn.element=null;this._lbYears.dispose();t.prototype.dispose.call(this)};Calendar.prototype.refresh=function(e){void 0===e&&(e=!0);var i=this.hostElement,o=this.containsFocus();if(i){t.prototype.refresh.call(this,e);e&&this._updateContent();this._updateSelection();var n=this._getDisplayMonthRange(),s=this.displayMonth,r=null==n.from||s>n.from,a=null==n.to||s<n.to;wijmo_1.enable(this._btnPrv,r);wijmo_1.enable(this._btnNxt,a);r&&a||this.containsFocus()||this.focus();var l=!0,h=wijmo_1.DateTime.newDate(),u=this._min&&this._min>h,c=this._max&&this._max<h;(u||c)&&(l=!1);wijmo_1.enable(this._btnTdy,l);if(o&&!this._isButtonFocused()){var p=(this.monthView?this._tbMth:this._tbYr).querySelector("td."+wijmo_1.ControlStateClsNames.selected)||i;p&&!this.focusMode&&p.focus()}var d=this._getCalendars();d.length>1&&this==d[0]&&d.forEach((function(t,i){i>0&&t.refresh(e)}))}};Calendar.prototype._getShowMonthPicker=function(){var t=ShowMonthPicker,e=this._getCalendars(),i=e.indexOf(this),o=this.showMonthPicker;switch(o){case t.FirstMonth:case t.Outside:return 0==i?o:0;case t.LastMonth:return i==e.length-1?o:0;case t.FirstAndLastMonths:return 0==i||i==e.length-1?o:0;case t.AllMonths:return o}return 0};Calendar.prototype._getDisplayMonthRange=function(){var t={from:null,to:null};if(this.min||this.max){var e=this._getCalendars(),i=e.indexOf(this),o=this._mthMode()?wijmo_1.DateTime.addYears:wijmo_1.DateTime.addMonths;this.min&&(t.from=o(this._getMonth(this.min),i));this.max&&(t.to=o(this._getMonth(this.max),i-e.length+1))}return t};Calendar.prototype._getCalendar=function(t){return wijmo_1.Control.getControl(t)};Calendar.prototype._getCalendars=function(){var t=wijmo_1.closest(this.hostElement,"."+exports.CalendarClsNames.calendarMultiMonth);return(t?this._getCalendar(t):this)._cals};Calendar.prototype._syncProp=function(t,e){var i=this;if(!this._syncing){var o=this._getCalendars();if(o&&o.length>1){var n=t[e],s=this._mthMode()?wijmo_1.DateTime.addYears:wijmo_1.DateTime.addMonths;"displayMonth"==e&&(n=s(n,-o.indexOf(t)));o[0].deferUpdate((function(){i._syncing=!0;o.forEach((function(o,r){if(o!=t){var a=o.displayMonth;o[e]="displayMonth"==e?s(n,r):n;if("value"==e){o.displayMonth=a;i._rngMode()&&(o.rangeEnd=null)}}}));i._syncing=!1}))}}};Calendar.prototype._updateContent=function(){var t=this.displayMonth,e=wijmo_1.Globalize.format,i=wijmo_1.DateTime,o=this._getShowMonthPicker();wijmo_1.setText(this._spMth,e(t,this._fmtYrMo));var n=this._btnMth.querySelector("."+wijmo_1.GlyphClsNames.down);n&&(n.style.display=this._mthMode()||!o?"none":"");var s=wijmo_1.closest(this._btnTdy,"."+wijmo_1.InputFormElementsClsNames.btnGroup);s&&(s.style.display=o?"":"none");var r=null!=this._fdw?this._fdw:wijmo_1.Globalize.getFirstDayOfWeek(),a=i.addDays(t,-(t.getDay()-r+7)%7),l=i.monthLast(t),h=this._tbMth.querySelectorAll("th");this._updateMonthButtonAria();for(var u=0;u<7&&u<h.length;u++){var c=i.addDays(a,u);wijmo_1.setText(h[u],e(c,this._fmtDayHdr));wijmo_1.setAttribute(h[u],"tabIndex","-1");wijmo_1.setAttribute(h[u],"abbr",e(c,this._fmtDayTitle))}var p=!1;this._dateViewContainsFocus()&&(p=!0);var d=this._tbMth.querySelectorAll("tr");for(u=1;u<d.length;u++)wijmo_1.removeChild(d[u]);p&&this.focus();var m=i.addDays(a,-7*this._wksBefore);for(u=0;u<this._wksBefore;u++)m=this._addWeek(m,exports.CalendarClsNames.weekBefore);for(;m<=l;)m=this._addWeek(m);for(u=0;u<this._wksAfter;u++)m=this._addWeek(m,exports.CalendarClsNames.weekAfter);h=this._tbYr.querySelectorAll("td");var _=this._tbYr.querySelectorAll("th");_.length&&wijmo_1.setText(_[0],e(t,this._fmtYr));for(u=0;u<h.length;u++){m=i.newDate(t.getFullYear(),u,1);var f=h[u],b=!this._monthInValidRange(m);f[Calendar._DATE_KEY]=m;var g=wijmo_1.Globalize.format(m,"MMMM yyyy");wijmo_1.setText(f,e(m,this._fmtMonths));wijmo_1.toggleClass(f,wijmo_1.ControlStateClsNames.disabled,b);wijmo_1.setAriaLabel(f,g);wijmo_1.setAttribute(f,"tabIndex","-1");wijmo_1.setAttribute(f,"abbr",g)}this._confirmationButtonContainer.style.display=this.showConfirmationButtons?"":"none";this._updateButtonTabIndex()};Calendar.prototype._updateSelection=function(){for(var t=Calendar._DATE_KEY,e=wijmo_1.DateTime,i=this._tbMth.querySelectorAll("td"),o=0;o<i.length;o++){var n=(u=i[o])[t],s=this.value,r=this.rangeEnd,a=this._selMode&&null!=s&&e.sameDate(n,s),l=this._selMode&&null!=s&&e.sameDate(n,r),h=this._selMode&&null!=s&&n>s&&null!=r&&n<=r;wijmo_1.toggleClass(u,wijmo_1.ControlStateClsNames.selected,a);wijmo_1.toggleClass(u,wijmo_1.ControlStateClsNames.multiSelected,h);wijmo_1.toggleClass(u,wijmo_1.ControlStateClsNames.lastSelected,l);wijmo_1.setAttribute(u,"aria-selected",!!a||null);this._customizeCell(o,n,u)}i=this._tbYr.querySelectorAll("td");for(o=0;o<i.length;o++){var u;n=(u=i[o])[t],a=this._sameMonth(n,this.value);wijmo_1.toggleClass(u,wijmo_1.ControlStateClsNames.selected,a);wijmo_1.setAttribute(u,"aria-selected",!!a||null)}this.focusMode&&!0!==this.isDisabled&&-1!==this.tabOrder&&this._updateFocusInAccessibilityMode()};Calendar.prototype._updateFocusInAccessibilityMode=function(){for(var t,e=Calendar._DATE_KEY,i=wijmo_1.DateTime,o=this._tbMth.querySelectorAll("td"),n=0;n<o.length;n++){var s=(l=o[n])[e],r=this._selMode&&null!=this.focusValue&&i.sameDate(s,this.focusValue)&&this._isSameDay(this.focusValue,s);void 0===t&&!l.classList.contains(exports.CalendarClsNames.dayOtherMonth)&&this._isDayValid(s)&&(t=l);this._isSameDay(this.focusValue,s)&&this._isDayValid(s)&&(t=l);this._updateCellFocus(l,r)}if(0===this._tbMth.querySelectorAll('[tabindex="0"]').length&&this.monthView&&t){wijmo_1.setAttribute(t,"tabIndex","0");wijmo_1.toggleClass(t,exports.CalendarClsNames.focused,!0);this._focusValue=t[e]}var a=(o=this._tbYr.querySelectorAll("td"))[0];for(n=0;n<o.length;n++){var l;s=(l=o[n])[e],r=this._sameMonth(s,this.focusValue);this._isSameMonth(this.value,s)&&(a=l);this._updateCellFocus(l,r)}if(0===this._tbYr.querySelectorAll('td[tabindex="0"]').length&&!this.monthView){wijmo_1.setAttribute(a,"tabIndex","0");wijmo_1.toggleClass(a,exports.CalendarClsNames.focused,!0);this._focusValue=a[e]}};Calendar.prototype._addWeek=function(t,e){for(var i=this._createElement("tr",this._tbMth,e),o=wijmo_1.DateTime,n=0;n<7;n++){var s=this._createElement("td",i),r=o.addDays(t,n);s[Calendar._DATE_KEY]=r;wijmo_1.setText(s,wijmo_1.Globalize.format(r,this._fmtDay));wijmo_1.setAriaLabel(s,wijmo_1.Globalize.format(r,"D"));var a=!this._valid(r),l=r.getDay(),h=r.getMonth()!=this.displayMonth.getMonth();wijmo_1.toggleClass(s,exports.CalendarClsNames.dayToday,o.sameDate(r,o.newDate()));wijmo_1.toggleClass(s,exports.CalendarClsNames.dayWeekend,0==l||6==l);wijmo_1.toggleClass(s,exports.CalendarClsNames.dayOtherMonth,h);wijmo_1.toggleClass(s,wijmo_1.ControlStateClsNames.invalid,a||!this._inValidRange(r));wijmo_1.setAttribute(s,"aria-disabled",a||!this._inValidRange(r))}return o.addDays(t,7)};Calendar.prototype._customizeCell=function(t,e,i){wijmo_1.isFunction(this.itemFormatter)&&this.itemFormatter(e,i);if(this.formatItem.hasHandlers){var o=new FormatItemEventArgs(t,e,i);this.onFormatItem(o)}};Calendar.prototype._canChangeValue=function(){return!this._readOnly&&this._selMode!=DateSelectionMode.None};Calendar.prototype._valid=function(t){return!(!wijmo_1.isDate(t)||!wijmo_1.DateTime.sameDate(t,this._clamp(t)))&&(!wijmo_1.isFunction(this.itemValidator)||this.itemValidator(t))};Calendar.prototype._inValidRange=function(t){var e=wijmo_1.DateTime.fromDateTime;return!(this.min&&t<e(this.min,t))&&!(this.max&&t>e(this.max,t))};Calendar.prototype._monthInValidRange=function(t){if(this.min||this.max){var e=t.getFullYear(),i=t.getMonth(),o=wijmo_1.DateTime,n=o.newDate(e,i,1),s=o.newDate(e,i+1,0);if(this.min&&this.min>s)return!1;if(this.max&&this.max<n)return!1}return!0};Calendar.prototype._sameMonth=function(t,e){return wijmo_1.isDate(t)&&wijmo_1.isDate(e)&&t.getMonth()==e.getMonth()&&t.getFullYear()==e.getFullYear()};Calendar.prototype._getValidDate=function(t,e){if(wijmo_1.isDate(t))for(var i=t.getFullYear(),o=t.getMonth()+(e?0:1),n=e?1:0,s=wijmo_1.DateTime,r=s.newDate(i,o,n),a=e?1:-1,l=0;l<31;l++){if(this._valid(r))return r;r=s.addDays(r,a)}return null};Calendar.prototype._clamp=function(t){if(t){var e=wijmo_1.DateTime.fromDateTime;if(this.min){var i=e(this.min,t);t<i&&(t=i)}if(this.max){var o=e(this.max,t);t>o&&(t=o)}}return t};Calendar.prototype._createChildren=function(){var t=this.getTemplate();this.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+exports.CalendarClsNames.hostElement,t,{_tbHdr:"tbl-header",_btnMth:"btn-month",_spMth:"span-month",_btnPrv:"btn-prev",_btnTdy:"btn-today",_btnNxt:"btn-next",_tbMth:"tbl-month",_tbYr:"tbl-year",_confirmationButtonContainer:"confirmation-button-container",_btnOK:"btn-ok",_btnCancel:"btn-cancel"});this._tbYr.style.display="none";var e=wijmo_1.culture.Calendar.ariaLabels;wijmo_1.setAriaLabel(this._tbMth,e.chooseDate);wijmo_1.setAriaLabel(this._tbYr,e.chooseMonth);wijmo_1.setAriaLabel(this._btnPrv,e.calendar);wijmo_1.setAriaLabel(this._btnMth,e.monthView);wijmo_1.setAriaLabel(this._btnPrv,e.prvMo);wijmo_1.setAriaLabel(this._btnTdy,e.today);wijmo_1.setAriaLabel(this._btnNxt,e.nxtMo);for(var i=this._createElement("tr",this._tbMth,exports.CalendarClsNames.header),o=0;o<7;o++){this._createElement("th",i).setAttribute("scope","col")}i=this._createElement("tr",this._tbYr,exports.CalendarClsNames.header);this._showYearListBoxButton=this._createElement("th",i);this._showYearListBoxButton.setAttribute("colspan","4");this._showYearListBoxButton.setAttribute("scope","col");wijmo_1.setAriaLabel(this._showYearListBoxButton,e.selectYear);wijmo_1.toggleClass(this._showYearListBoxButton,exports.CalendarClsNames.selectedYear);this._showYearListBoxButton.setAttribute("role","button");this._showYearListBoxButton.setAttribute("tabIndex","-1");for(var n=0;n<3;n++){i=this._createElement("tr",this._tbYr);for(var s=0;s<4;s++)this._createElement("td",i)}};Calendar.prototype._createYearPicker=function(){var t=this,e=this.hostElement,i=this._createElement("div",null,exports.DropDownClsNames.dropDownPanel+" "+exports.CalendarClsNames.yearPicker);i.tabIndex=this._orgTabIndex;this._lbYears=new ListBox(i,{lostFocus:function(e){wijmo_1.hidePopup(i);t._tmYrHidden=Date.now();t.removeEventListener(window,"touchstart");if(e.selectedIndex>-1){var o=wijmo_1.DateTime.clone(t.displayMonth);o.setFullYear(e.selectedIndex+e.itemsSource[0]);t.displayMonth=o}t.keyActionTab===CalendarTabKeyAction.All&&t._showYearListBoxButton.focus()}});wijmo_1.setAriaLabel(this._lbYears.hostElement,wijmo_1.culture.Calendar.ariaLabels.selectYear);this.addEventListener(i,"keydown",(function(i){switch(i.keyCode){case wijmo_1.Key.Enter:e.focus();break;case wijmo_1.Key.Space:e.focus();i.preventDefault();break;case wijmo_1.Key.Escape:t._lbYears.selectedIndex=-1;e.focus()}i.defaultPrevented&&i.stopPropagation()}));this.addEventListener(i,"click",(function(t){e.focus()}))};Calendar.prototype._createElement=function(t,e,i){var o=document.createElement(t);i&&wijmo_1.addClass(o,i);e&&e.appendChild(o);return o};Calendar.prototype._click=function(t){if(!t.defaultPrevented&&0==t.button){var e=!1,i=t.target;if(wijmo_1.contains(this._btnMth,i)&&!this._mthMode()&&this._getShowMonthPicker()){this.monthView=!this.monthView;e=!0}else if(wijmo_1.contains(this._btnPrv,i)){this._navigate(-1);e=!0}else if(wijmo_1.contains(this._btnNxt,i)){this._navigate(1);e=!0}else if(wijmo_1.contains(this._btnTdy,i)){this._navigate(0);e=!0}if(i&&!e&&this._yrPicker&&wijmo_1.contains(this._tbYr,i)&&wijmo_1.closest(i,"."+exports.CalendarClsNames.header)){this._showYearPickerAction(t);return}if(i&&!e){var o=wijmo_1.closest(i,"td");if(o){var n=this.hitTest(o),s=wijmo_1.DateTime.fromDateTime;if(this.monthView){if(n&&this._canChangeValue()){var r=s(n,this._value);this._inValidRange(r)&&this._valid(r)&&(this._rngMode()&&this.value&&!this.rangeEnd&&r>=this.value?this.rangeEnd=r:this.value=r);e=!0}}else if(n){this.displayMonth=n;if(this._mthMode()){if(this._canChangeValue()){r=s(this.displayMonth,this.value);this._inValidRange(r)&&(this.value=r)}}else this.monthView=!0;e=!0}}}if(e){t.preventDefault();this.focusMode||0===t.detail||this.focus()}}};Calendar.prototype._keydown=function(t){if(!t.defaultPrevented){if(t.altKey)switch(t.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:return;case wijmo_1.Key.End:this._navigate(0);t.preventDefault();return}var e=t.target;if(!(t.ctrlKey||t.metaKey||t.shiftKey&&!this._rngMode())){if(("Enter"===t.key||"Space"===t.code)&&e&&this.keyActionTab===CalendarTabKeyAction.All){if(wijmo_1.contains(this._btnMth,e)&&!this._mthMode()&&this._getShowMonthPicker()){this.monthView=!this.monthView;"Space"===t.code&&t.preventDefault();return}if(this._yrPicker&&wijmo_1.contains(this._tbYr,e)&&wijmo_1.closest(e,"."+exports.CalendarClsNames.header)){this._showYearPickerAction(t);return}}if(this.focusMode){if(("Enter"===t.key||"Space"===t.code)&&e.classList.contains(exports.CalendarClsNames.focused)){var i=wijmo_1.closest(e,"td");if(i){var o=this.hitTest(i);this.setFocusModeValue(o,t)}"Space"===t.code&&t.preventDefault();return}if(!wijmo_1.contains(this._tbMth,t.target)&&(!wijmo_1.contains(this._tbYr,t.target)||wijmo_1.contains(this._tbYr.firstElementChild,t.target)))return}var n=this._getKeyCode(t),s=0,r=0,a=!0;if(this.monthView)switch(n){case wijmo_1.Key.Left:s=-1;break;case wijmo_1.Key.Right:s=1;break;case wijmo_1.Key.Up:s=-7;break;case wijmo_1.Key.Down:s=7;break;case wijmo_1.Key.PageDown:r=t.altKey?12:1;break;case wijmo_1.Key.PageUp:r=t.altKey?-12:-1;break;case wijmo_1.Key.Home:case wijmo_1.Key.End:if(this._canChangeValue()&&!t.shiftKey){var l=this.value||this.displayMonth;if(u=this._getValidDate(l,n==wijmo_1.Key.Home)){this.value=wijmo_1.DateTime.fromDateTime(u,this.value);this._rngEnd=null}}break;default:a=!1}else switch(n){case wijmo_1.Key.Left:r=-1;break;case wijmo_1.Key.Right:r=1;break;case wijmo_1.Key.Up:r=-4;break;case wijmo_1.Key.Down:r=4;break;case wijmo_1.Key.PageDown:r=t.altKey?120:12;break;case wijmo_1.Key.PageUp:r=t.altKey?-120:-12;break;case wijmo_1.Key.Home:r=this.value?-this.value.getMonth():0;break;case wijmo_1.Key.End:r=this.value?11-this.value.getMonth():0;break;case wijmo_1.Key.Enter:this._mthMode()?a=!1:this.monthView=!0;break;default:a=!1}if(this._canChangeValue()&&(s||r)){var h=t.shiftKey&&null!=this.rangeEnd?this.rangeEnd:this.focusMode?this.focusValue:this.value,u=wijmo_1.DateTime;if(h){h=u.addDays(h,s);h=u.addMonths(h,r)}else h=this._getValidDate(new Date,!0);if(r&&!this._valid(h)){l=h.getMonth();for(var c=1;c<31&&!this._valid(h);c++){var p=u.addDays(h,+c),d=u.addDays(h,-c);this._valid(p)&&p.getMonth()==l?h=p:this._valid(d)&&d.getMonth()==l&&(h=d)}}for(c=0;c<31&&!this._valid(h);c++)h=u.addDays(h,s>0||r>0?1:-1);t.shiftKey&&this._rngMode()&&h>this.value?this.rangeEnd=h:this.focusMode?this.focusValue=h:this.value=h}a&&t.preventDefault()}}};Calendar.prototype._getMonth=function(t){var e=wijmo_1.DateTime;t=t||e.newDate();return e.newDate(t.getFullYear(),t.getMonth(),1)};Calendar.prototype._mthMode=function(){return this.selectionMode==DateSelectionMode.Month};Calendar.prototype._rngMode=function(){return this.selectionMode==DateSelectionMode.Range};Calendar.prototype._navigate=function(t){var e=this.monthView,i=this.displayMonth,o=wijmo_1.DateTime;switch(t){case 0:var n=o.newDate();this._canChangeValue()&&(this.value=e?o.fromDateTime(n,this.value):this._getMonth(n));i=this._getMonth(n);break;case 1:i=o.addMonths(i,e?1:12);break;case-1:i=o.addMonths(i,e?-1:-12)}this.displayMonth=i};Calendar.prototype._setTabOrder=function(e){t.prototype._setTabOrder.call(this,e);this._lbYears.tabOrder=this._orgTabIndex;this._getCalendars().forEach((function(t){t.tabOrder!=e&&(t.tabOrder=e)}));this.updateCalendarsTabindex()};Calendar.prototype._showYearPickerAction=function(t){var e=this,i=t.target;if(Date.now()-this._tmYrHidden<600)t.preventDefault();else{for(var o=this.displayMonth.getFullYear(),n=this.min?this.min.getFullYear():o-100,s=this.max?this.max.getFullYear():o+100,r=[],a=n;a<=s;a++)r.push(a);var l=this._lbYears,h=l.hostElement,u=wijmo_1.closest(i,"."+exports.CalendarClsNames.header),c=this.hostElement,p=wijmo_1.closest(c,"."+exports.InputDateClsNames.inputDateDropDown)||c;l.itemsSource=r;l.selectedIndex=o-r[0];wijmo_1.setAttribute(h,"dir",this.rightToLeft?"rtl":null);wijmo_1.setCss(h,{minWidth:"",width:u.offsetWidth});wijmo_1.showPopup(h,u,!1,!1,p);requestAnimationFrame((function(){l.showSelection(!0)}));this.addEventListener(window,"touchstart",(function(t){if(!wijmo_1.contains(h,t.target)){wijmo_1.hidePopup(h);e._tmYrHidden=Date.now();e.removeEventListener(window,"touchstart")}}));t.preventDefault()}};Object.defineProperty(Calendar.prototype,"focusMode",{get:function(){return this._focusMode},set:function(t){this._focusMode=t;this._getCalendars().forEach((function(e){e.focusMode!==t&&(e.focusMode=t)}));this.updateCalendarsTabindex();this.invalidate()},enumerable:!0,configurable:!0});Object.defineProperty(Calendar.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(t){this._keyActionTab=t;this._updateButtonTabIndex()},enumerable:!0,configurable:!0});Calendar.prototype._isButtonFocused=function(){var t=wijmo_1.getActiveElement();if(!t)return!1;var e=t.getAttribute("role"),i=t.type;return e&&"button"===e.toLowerCase()||i&&"button"===i.toLowerCase()};Calendar.prototype._isSameDay=function(t,e){return!(e.getMonth()!=this.displayMonth.getMonth())&&t.getDate()===e.getDate()};Calendar.prototype._isSameMonth=function(t,e){return t.getMonth()===e.getMonth()};Calendar.prototype._dateViewContainsFocus=function(){var t=this._tbYr.querySelectorAll("td"),e=Array.from(t).find((function(t){return t===wijmo_1.getActiveElement()}));return this._tbMth.contains(wijmo_1.getActiveElement())||void 0!==e};Calendar.prototype._updateMonthButtonAria=function(){var t=wijmo_1.culture.Calendar.ariaLabels,e=this.monthView?t.monthView:t.yearView;wijmo_1.setAriaLabel(this._btnMth,e+", "+wijmo_1.Globalize.format(this.displayMonth,this._fmtYrMo))};Calendar.prototype._isDayValid=function(t){return this._valid(t)&&this._inValidRange(t)};Calendar.prototype.cancelButtonClick=function(t){this.cancelButtonClicked.raise(this,t)};Calendar.prototype.oneCancelButtonClick=function(t){this.cancelButtonClick(t)};Calendar.prototype.OKButtonClick=function(t){this.OKButtonClicked.raise(this,t)};Calendar.prototype.onOkButtonClick=function(t){this.OKButtonClick(t);this.setFocusModeValue(this.focusValue)};Object.defineProperty(Calendar.prototype,"ariaLabel",{get:function(){return this._ariaLabel},set:function(t){if(this.ariaLabel!==t&&this.hostElement){this._ariaLabel=t;wijmo_1.setAttribute(this.hostElement,"aria-label",t)}},enumerable:!0,configurable:!0});Calendar.prototype._updateButtonTabIndex=function(){var t=this.tabOrder.toString();if(this.keyActionTab===CalendarTabKeyAction.All&&!0!==this.isDisabled){wijmo_1.setAttribute(this._btnMth,"tabindex",t);wijmo_1.setAttribute(this._btnPrv,"tabindex",t);wijmo_1.setAttribute(this._btnTdy,"tabindex",t);wijmo_1.setAttribute(this._btnNxt,"tabindex",t);wijmo_1.setAttribute(this._showYearListBoxButton,"tabindex",t)}else{wijmo_1.setAttribute(this._btnMth,"tabindex","-1");wijmo_1.setAttribute(this._btnPrv,"tabindex","-1");wijmo_1.setAttribute(this._btnTdy,"tabindex","-1");wijmo_1.setAttribute(this._btnNxt,"tabindex","-1");wijmo_1.setAttribute(this._showYearListBoxButton,"tabindex","-1")}wijmo_1.setAttribute(this._btnOK,"tabindex",t);wijmo_1.setAttribute(this._btnCancel,"tabindex",t)};Calendar.prototype._onEnterKeyDownToSetValue=function(t){this._enterKeyDownToSetValue.raise(this,t)};Object.defineProperty(Calendar.prototype,"showConfirmationButtons",{get:function(){return this._showConfirmationButtons},set:function(t){this._showConfirmationButtons=t},enumerable:!0,configurable:!0});Calendar.prototype._setIsDisabled=function(e){t.prototype._setIsDisabled.call(this,e);this._updateButtonTabIndex()};Calendar.prototype.updateCalendarsTabindex=function(){var t=this.focusMode||-1===this.tabOrder?-1:0;this._getCalendarsHostElements().forEach((function(e){e.tabIndex=t}))};Calendar.prototype.setFocusModeValue=function(t,e){var i=wijmo_1.DateTime.fromDateTime;if(this.monthView){if(t&&this._canChangeValue()){var o=i(t,this._value);if(this._inValidRange(o)&&this._valid(o))if(this._rngMode()&&this.value&&!this.rangeEnd&&o>=this.value)this.rangeEnd=o;else{e&&this._enterKeyDownToSetValue.raise(this,e);this.value=o}}}else if(t){this.displayMonth=t;if(this._mthMode()){if(this._canChangeValue()){o=i(this.displayMonth,this.value);this._inValidRange(o)&&(this.value=o)}}else this.monthView=!0}};Calendar.prototype._getCalendarsHostElements=function(){return this._getCalendars().filter((function(t,e){return e>0})).map((function(t){return t.hostElement}))};Calendar._DATE_KEY="$WJ-DATE";Calendar._ctrlTemplate="";return Calendar}(wijmo_1.Control);exports.Calendar=Calendar;wijmo_1._addCultureInfo("DropDown",{ariaLabels:{tgl:"Toggle Dropdown"}});!function(t){t[t.Select=0]="Select";t[t.Open=1]="Open";t[t.Toggle=2]="Toggle"}(ClickAction=exports.ClickAction||(exports.ClickAction={}));!function(t){t[t.ChangeSelectionOnly=0]="ChangeSelectionOnly";t[t.OpenDropdown=1]="OpenDropdown"}(KeyAction=exports.KeyAction||(exports.KeyAction={}));!function(t){t[t.CloseAndKeepFocus=0]="CloseAndKeepFocus";t[t.CloseAndMoveFocus=1]="CloseAndMoveFocus"}(TabKeyAction=exports.TabKeyAction||(exports.TabKeyAction={}));var PopupTrigger,_Edges,DropDown=function(t){__extends(DropDown,t);function DropDown(e,i){var o=t.call(this,e)||this;o._clickAction=ClickAction.Select;o._showBtn=!0;o._autoExpand=!0;o._animate=!1;o._internalSettingText=!1;o._oldText="";o._keyActionDownArrow=KeyAction.ChangeSelectionOnly;o._keyActionUpArrow=KeyAction.ChangeSelectionOnly;o._keyActionTab=TabKeyAction.CloseAndMoveFocus;o._isDropdownOpened=!1;o.textChanged=new wijmo_1.Event;o.isDroppedDownChanging=new wijmo_1.Event;o.isDroppedDownChanged=new wijmo_1.Event;var n,s=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.DropDownClsNames.hostElement,s,{_tbx:"input",_btn:"btn",_dropDown:"dropdown"},"input");o.hostElement&&o.hostElement.id&&(n=o.hostElement.id);n&&o._dropDown&&o._dropDown.setAttribute("dropdown-id",n);o._dropDown.style.display="none";var r=wijmo_1.culture.DropDown.ariaLabels;wijmo_1.setAriaLabel(o._btn.querySelector("button"),r.tgl);var a=o._elRef=o._tbx;wijmo_1.disableAutoComplete(a);o._createDropDown();o._updateTbxAriaHaspopup();o._updateBtn();o._updateTbx();var l=o.hostElement;wijmo_1.addClass(l,wijmo_1.ControlStateClsNames.collapsed);o.addEventListener(window,"resize",(function(){o.isDroppedDown&&o.invalidate()}));var h=o.dropDown,u=o.addEventListener.bind(o),c=o._updateFocusState.bind(o);u(h,"blur",c,!0);u(h,"focus",c);var p=o._keydown.bind(o);u(l,"keydown",p);u(h,"keydown",p);var d=o._keypress.bind(o);u(l,"keypress",d,!0);u(h,"keypress",d,!0);u(a,"input",o._input.bind(o));u(a,"beforeinput",(function(t){"historyUndo"!==t.inputType&&"historyRedo"!==t.inputType||t.preventDefault()}));u(a,"blur",(function(){o._commitText(!0,!1)}),!0);u(a,"click",(function(){o._autoExpand&&o._expandSelection()}));u(a,"mousedown",(function(t){switch(o._clickAction){case ClickAction.Open:if(!o.isDroppedDown){t.preventDefault();o.focus();o.isDroppedDown=!0}break;case ClickAction.Toggle:t.preventDefault();o.focus();o.isDroppedDown=!o.isDroppedDown}}));u(o._btn,"mousedown",(function(t){o._btnclick(t)}));wijmo_1.removeChild(h);wijmo_1.isIE()&&o._elRef==o._tbx&&u(l,"mouseup",(function(t){if(!t.defaultPrevented&&0==t.button&&wijmo_1.hasClass(t.target,wijmo_1.InputFormElementsClsNames.btn)){var e=wijmo_1.getActiveElement();e&&e!=t.target&&setTimeout((function(){e.focus()}))}}));wijmo_1.isIE9()&&u(a,"keyup",(function(){o._setText(o.text,!1)}));u(h,"click",o._dropDownClick.bind(o));return o}Object.defineProperty(DropDown,"controlTemplate",{get:function(){DropDown._ctrlTemplate||(DropDown._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+'"><div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+" "+exports.InputClsNames.inputBtnVisible+'"><input wj-part="input" type="text" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"><span wj-part="btn" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.down+'></span></button></span></div></div><div wj-part="dropdown" class="'+wijmo_1.ControlClsNames.content+" "+exports.DropDownClsNames.dropDownPanel+'"></div></div>');return DropDown._ctrlTemplate},set:function(t){DropDown._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"text",{get:function(){return this._tbx.value},set:function(t){if(t!=this.text){this._setText(t,!0);this._commitText()}},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"inputType",{get:function(){return this._tbx.type},set:function(t){this._tbx.type=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"isReadOnly",{get:function(){return this._tbx.readOnly},set:function(t){this._tbx.readOnly=wijmo_1.asBoolean(t);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly);this.isReadOnly&&this._toggleDropDown(!1)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"isRequired",{get:function(){return this._tbx.required},set:function(t){this._tbx.required=wijmo_1.asBoolean("boolean"==typeof t?t:this.isRequired)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"placeholder",{get:function(){return this._tbx.placeholder},set:function(t){this._tbx.placeholder=t},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"clickAction",{get:function(){return this._clickAction},set:function(t){this._clickAction=wijmo_1.asEnum(t,ClickAction)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"isDroppedDown",{get:function(){var t=this._dropDown;return t&&"none"!=t.style.display},set:function(t){var e=this.hostElement,i=this._dropDown,o=this.containsFocus(),n=new Set(["InputDateTime","WjInputDateTime"]);if(e&&i){var s=!this.isReadOnly;this.isTouching&&(s=!0);t=wijmo_1.asBoolean(t)&&!this.isDisabled&&s&&e.offsetWidth>0;this.isDroppedDown&&!t&&this.isDisabled&&(t=this.isDroppedDown);if(t||"INPUT"!=wijmo_1.getActiveElement().tagName||this.inputElement===wijmo_1.getActiveElement()||!this._isInvalidInputCancelled){if(t!=this.isDroppedDown&&(n.has(this.constructor.name)||!this._isInvalidInputCancelled||!this.isDroppedDown&&this._isInvalidInputCancelled)&&this.onIsDroppedDownChanging(new wijmo_1.CancelEventArgs)){this._toggleDropDown(t);o&&(this.isTouching&&this.showDropDownButton?e.focus():this.selectAll());this._updateFocusState();this._updateBtn();this._updateTbx();wijmo_1.toggleClass(e,wijmo_1.ControlStateClsNames.collapsed,!this.isDroppedDown);this.onIsDroppedDownChanged()}}else{this._isDropdownOpened=this.isDroppedDown;this._toggleDropDown(t)}}},enumerable:!0,configurable:!0});DropDown.prototype._toggleDropDown=function(t){var e=this,i=this.hostElement,o=this._dropDown;if(t){this._minWidthDropdown=o.style.minWidth;o.style.display="";this._updateDropDown();this.addEventListener(window,"touchstart",(function(t){for(var o=wijmo_1.Control._touching,n=t.target;n;){if(n==i)return;n=n[wijmo_1.Control._OWNR_KEY]||n.parentNode}wijmo_1.Control._touching=!0;e.isDroppedDown=!1;wijmo_1.Control._touching=o}))}else{this.removeEventListener(window,"touchstart");wijmo_1.hidePopup(o);o.style.minWidth=this._minWidthDropdown}};Object.defineProperty(DropDown.prototype,"dropDown",{get:function(){return this._dropDown},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"dropDownCssClass",{get:function(){return this._cssClass},set:function(t){if(t!=this._cssClass){wijmo_1.removeClass(this._dropDown,this._cssClass);this._cssClass=wijmo_1.asString(t);wijmo_1.addClass(this._dropDown,this._cssClass)}},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"showDropDownButton",{get:function(){return this._showBtn},set:function(t){this._showBtn=wijmo_1.asBoolean(t);this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"autoExpandSelection",{get:function(){return this._autoExpand},set:function(t){this._autoExpand=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"isAnimated",{get:function(){return this._animate},set:function(t){this._animate=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"keyActionDownArrow",{get:function(){return this._keyActionDownArrow},set:function(t){this._keyActionDownArrow=wijmo_1.asEnum(t,KeyAction)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"keyActionUpArrow",{get:function(){return this._keyActionUpArrow},set:function(t){this._keyActionUpArrow=wijmo_1.asEnum(t,KeyAction)},enumerable:!0,configurable:!0});Object.defineProperty(DropDown.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(t){this._keyActionTab=wijmo_1.asEnum(t,TabKeyAction)},enumerable:!0,configurable:!0});DropDown.prototype.selectAll=function(){var t=this._tbx;this._elRef==t&&wijmo_1.setSelectionRange(t,0,this.text.length);this.containsFocus()||this.focus()};DropDown.prototype.onTextChanged=function(t){this.textChanged.raise(this,t);this._updateState()};DropDown.prototype.onIsDroppedDownChanging=function(t){this.isDroppedDownChanging.raise(this,t);return!t.cancel};DropDown.prototype.onIsDroppedDownChanged=function(t){this.isDroppedDownChanged.raise(this,t)};DropDown.prototype.onGotFocus=function(e){this.isTouching||wijmo_1.contains(this._dropDown,wijmo_1.getActiveElement())||this.selectAll();t.prototype.onGotFocus.call(this,e)};DropDown.prototype.onLostFocus=function(e){this._commitText();this.isDroppedDown=!1;t.prototype.onLostFocus.call(this,e)};DropDown.prototype._containsFocusImpl=function(e){return t.prototype._containsFocusImpl.call(this,e)||this.isDroppedDown&&wijmo_1.contains(this._dropDown,e)};DropDown.prototype.dispose=function(){this.isDroppedDown=!1;var e=this._dropDown;if(e){this._dropDown=null;wijmo_1.removeChild(e);var i=wijmo_1.Control.getControl(e);i&&i.dispose()}t.prototype.dispose.call(this)};DropDown.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);var i=this.hostElement;if(i&&i.offsetHeight&&this.isDroppedDown){var o=wijmo_1.getActiveElement();this.isAnimated&&""!=this._dropDown.style.opacity||wijmo_1.showPopup(this._dropDown,i,!1,!1,null==this.dropDownCssClass);o instanceof HTMLElement&&o!=wijmo_1.getActiveElement()&&o.focus()}};DropDown.prototype._handleResize=function(){this.isDroppedDown&&this.refresh()};DropDown.prototype._dropDownClick=function(t){t.stopPropagation()};DropDown.prototype._expandSelection=function(){var t=this._tbx,e=t.value,i=t.selectionStart,o=t.selectionEnd;if(e&&i==o){var n=this._getCharType(e,i);if(n>-1){for(;o<e.length&&this._getCharType(e,o)==n;o++);for(;i>0&&this._getCharType(e,i-1)==n;i--);i!=o&&wijmo_1.setSelectionRange(t,i,o)}}};DropDown.prototype._getCharType=function(t,e){var i=t[e];return i>="0"&&i<="9"?0:i>="a"&&i<="z"||i>="A"&&i<="Z"?1:-1};DropDown.prototype._keydown=function(t){if(!t.defaultPrevented&&!this._isHiddenEditor()){switch(t.keyCode){case wijmo_1.Key.Escape:case wijmo_1.Key.Enter:if(this.isDroppedDown){this.isDroppedDown=!1;this.containsFocus()||this.focus();t.preventDefault()}break;case wijmo_1.Key.F4:this.toggleDropDown(t);break;case wijmo_1.Key.Up:this.handleUpArrowKey(t);break;case wijmo_1.Key.Down:this.handleDownArrowKey(t)}if(!t.defaultPrevented&&t.keyCode==wijmo_1.Key.Escape&&wijmo_1.isIE()){var e=this._tbx;if(t.target==e){var i=e.value;e.value=i+" ";e.value=i}}}};DropDown.prototype.toggleDropDown=function(t){if(this.isHostVisible()){this.isDroppedDown=!this.isDroppedDown;t.preventDefault()}};DropDown.prototype.handleUpArrowKey=function(t){t.altKey?this.toggleDropDown(t):this.keyActionUpArrow!==KeyAction.OpenDropdown||this.isDroppedDown||this.openDropDown(t)};DropDown.prototype.handleDownArrowKey=function(t){if(t.altKey)this.toggleDropDown(t);else if(this.keyActionDownArrow===KeyAction.OpenDropdown&&!this.isDroppedDown){this.openDropDown(t);this._afterOpenDropdownByDownArrow()}};DropDown.prototype._afterOpenDropdownByDownArrow=function(){};DropDown.prototype.openDropDown=function(t){if(this.isHostVisible()){this.isDroppedDown=!0;t.preventDefault()}};DropDown.prototype.isHostVisible=function(){var t=this.hostElement;return!(!t||!t.offsetHeight)};DropDown.prototype._isHiddenEditor=function(){return wijmo_1.hasClass(this._tbx,"wj-grid-ime")};DropDown.prototype._keypress=function(t){"AltLeft"!=t.code&&"AltRight"!=t.code||t.preventDefault()};DropDown.prototype._input=function(t){this._setText(this.text,!1)};DropDown.prototype._btnclick=function(t){var e=this;if(!t.defaultPrevented&&0==t.button){this._isInvalidInputCancelled=!1;t.preventDefault();if(this.isTouching){this.isReadOnly=!0;this.isDroppedDown=!this.isDroppedDown;this.focus();setTimeout((function(){e.isReadOnly=!1}),0)}else{this.focus();this.isDroppedDown=!this.isDroppedDown}}};DropDown.prototype._setText=function(t,e,i,o){var n=!1;if((t=(t||"").toString())!=this._tbx.value){this._tbx.value=t;if(i||!t){this.onTextChanged();n=!0}}if(t!=this._oldText){this._oldText=t;this._internalSettingText||n||this.onTextChanged()}o&&(this._tbx.value=this._tbx.value.trim());this._updateState()};DropDown.prototype._updateBtn=function(){this._btn.style.display=this._showBtn?"":"none";this._updateBtnAria()};DropDown.prototype._updateBtnAria=function(){var t=this._btn.querySelector("button"),e=this.isDroppedDown,i=this.dropDown?this.dropDown.id:null;wijmo_1.setAttribute(t,"aria-expanded",!!e);wijmo_1.setAttribute(t,"aria-controls",e?i:null)};DropDown.prototype._updateTbx=function(){this._updateTbxAria()};DropDown.prototype._updateTbxAria=function(){var t=this._tbx,e=this.isDroppedDown,i=this.dropDown?this.dropDown.id:null;wijmo_1.setAttribute(t,"aria-controls",e?i:null);wijmo_1.setAttribute(t,"aria-expanded",e)};DropDown.prototype._updateTbxAriaHaspopup=function(){var t=this._tbx,e=this.dropDown&&this.dropDown.getAttribute("role");wijmo_1.setAttribute(t,"aria-haspopup",e)};DropDown.prototype._createDropDown=function(){};DropDown.prototype._commitText=function(t,e){};DropDown.prototype._updateDropDown=function(){if(this.isDroppedDown){this._commitText();var t=this.dropDown;wijmo_1.setAttribute(t,"dir",this.rightToLeft?"rtl":null);wijmo_1.showPopup(t,this.hostElement,!1,this._animate,null==this.dropDownCssClass)}};DropDown.prototype._shouldRaiseInvalidInput=function(t){return wijmo_1.isNullOrUndefined(t)?!this._containsFocus():t};DropDown._ctrlTemplate="";return DropDown}(wijmo_1.Control);exports.DropDown=DropDown;wijmo_1._addCultureInfo("Popup",{ariaLabels:{close:"close",backdrop:"backdrop",isDraggable:"draggable",isResizable:"resizable",popupVisible:"visible",popupHide:"hidden",popup:"popup"}});!function(t){t[t.None=0]="None";t[t.ClickOwner=1]="ClickOwner";t[t.ClickPopup=2]="ClickPopup";t[t.Click=3]="Click";t[t.BlurOwner=4]="BlurOwner";t[t.BlurPopup=8]="BlurPopup";t[t.Blur=12]="Blur";t[t.ClickOrBlur=15]="ClickOrBlur";t[t.DownOwner=16]="DownOwner";t[t.DownPopup=32]="DownPopup";t[t.Down=48]="Down";t[t.EnterOwner=64]="EnterOwner";t[t.EnterPopup=128]="EnterPopup";t[t.Enter=192]="Enter";t[t.LeaveOwner=256]="LeaveOwner";t[t.LeavePopup=512]="LeavePopup";t[t.Leave=768]="Leave"}(PopupTrigger=exports.PopupTrigger||(exports.PopupTrigger={}));!function(t){t[t.None=0]="None";t[t.Left=1]="Left";t[t.Top=2]="Top";t[t.Right=4]="Right";t[t.Bottom=8]="Bottom";t[t.LeftTop=3]="LeftTop";t[t.RightTop=6]="RightTop";t[t.RightBottom=12]="RightBottom";t[t.LeftBottom=9]="LeftBottom"}(_Edges||(_Edges={}));var Popup=function(t){__extends(Popup,t);function Popup(e,i){var o=t.call(this,e)||this;o._owner=null;o._ariaLabel=wijmo_1.culture.Popup.ariaLabels.popup;o._modal=!1;o._position=wijmo_1.PopupPosition.BelowLeft;o._showTrigger=PopupTrigger.ClickOwner;o._hideTrigger=PopupTrigger.Blur;o._hideAnim=[];o._fadeIn=!0;o._fadeOut=!0;o._removeOnHide=!0;o._draggable=!1;o._resizable=!1;o._result=null;o._resultEnter=null;o._resultSubmit=null;o._callback=null;o._visible=!1;o._ownerClickBnd=o._ownerClick.bind(o);o._ownerDownBnd=o._ownerDown.bind(o);o._ownerBlurBnd=o._ownerBlur.bind(o);o._ownerEnterBnd=o._ownerEnter.bind(o);o._ownerLeaveBnd=o._ownerLeave.bind(o);o._mousedownBnd=o._mousedown.bind(o);o._mousemoveBnd=o._mousemove.bind(o);o._mousedragBnd=o._mousedrag.bind(o);o._mouseupBnd=o._mouseup.bind(o);o._hideBnd=o.hide.bind(o);o._lastShow=0;o._initialOwner=null;o._activeEdge=_Edges.None;o.showing=new wijmo_1.Event;o.shown=new wijmo_1.Event;o.hiding=new wijmo_1.Event;o.hidden=new wijmo_1.Event;o.resizing=new wijmo_1.Event;o.resized=new wijmo_1.Event;o.dragging=new wijmo_1.Event;o.dragged=new wijmo_1.Event;o.sizeChanging=new wijmo_1.Event;o.sizeChanged=new wijmo_1.Event;o.positionChanging=new wijmo_1.Event;o.positionChanged=new wijmo_1.Event;var n=o.hostElement;Popup._PopupInstanceCount++;wijmo_1.addClass(n,wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.PopupClsNames.hostElement);if(o.hostElement){o._initialOwner=o.hostElement.parentElement;wijmo_1.setAttribute(o.hostElement,"role","dialog")}n.getAttribute("tabindex")||(n.tabIndex=0);wijmo_1.hidePopup(n,!1);var s=o.addEventListener.bind(o);s(n,"compositionstart",(function(){o._composing=!0}));s(n,"compositionend",(function(){o._composing=!1}));s(window,"resize",(function(){!o.isVisible||o._dragged||o.isTouching||o.invalidate()}));s(n,"keydown",(function(t){if(!t.defaultPrevented){var e=t.ctrlKey&&t.altKey&&!t.shiftKey,i=t.ctrlKey&&t.shiftKey&&!t.altKey;if(e||i){var s=o.hostElement.getBoundingClientRect(),r=wijmo_1.Rect.fromBoundingRect(s);if(e&&o.isDraggable){t.preventDefault();switch(t.keyCode){case wijmo_1.Key.Left:r.left=Math.max(0,r.left-10);break;case wijmo_1.Key.Right:r.left=Math.min(window.innerWidth-r.width,r.left+10);break;case wijmo_1.Key.Up:r.top=Math.max(0,r.top-10);break;case wijmo_1.Key.Down:r.top=Math.min(window.innerHeight-r.height,r.top+10)}var a=new PopupBoundsChangingEventArgs(r);if(o.onPositionChanging(a)){wijmo_1.setCss(o.hostElement,{left:r.left+window.scrollX,top:r.top+window.scrollY,transform:"none"});o.onPositionChanged()}}else if(i&&o.isResizable){t.preventDefault();var l=window.getComputedStyle(o.hostElement),h=Math.max(parseInt(l.minWidth)||0,Popup._SZ_MIN),u=Math.max(parseInt(l.minHeight)||0,Popup._SZ_MIN);if(o._activeEdge===_Edges.None)switch(t.keyCode){case wijmo_1.Key.Up:o._activeEdge=_Edges.Top;break;case wijmo_1.Key.Down:o._activeEdge=_Edges.Bottom;break;case wijmo_1.Key.Left:o._activeEdge=_Edges.Left;break;case wijmo_1.Key.Right:o._activeEdge=_Edges.Right}var c=o._activeEdge===_Edges.Top||o._activeEdge===_Edges.Bottom,p=o._activeEdge===_Edges.Left||o._activeEdge===_Edges.Right;if(c&&![wijmo_1.Key.Up,wijmo_1.Key.Down].includes(t.keyCode)||p&&![wijmo_1.Key.Left,wijmo_1.Key.Right].includes(t.keyCode))return;if(o._activeEdge!==_Edges.None){var d=0;switch(t.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Left:d=-10;break;case wijmo_1.Key.Down:case wijmo_1.Key.Right:d=10}switch(o._activeEdge){case _Edges.Top:var m=Math.min(Math.max(r.top+d,0),r.bottom-u);r.height=r.bottom-m;r.top=m;break;case _Edges.Bottom:var _=Math.min(Math.max(r.bottom+d,r.top+u),window.innerHeight);r.height=_-r.top;break;case _Edges.Left:var f=Math.min(Math.max(r.left+d,0),r.right-h);r.width=r.right-f;r.left=f;break;case _Edges.Right:var b=Math.min(Math.max(r.right+d,r.left+h),window.innerWidth);r.width=b-r.left}r.left=Math.max(0,Math.min(r.left,window.innerWidth-r.width));r.top=Math.max(0,Math.min(r.top,window.innerHeight-r.height));var g=new PopupBoundsChangingEventArgs(r);if(o.onSizeChanging(g)){wijmo_1.setCss(o.hostElement,{left:r.left+window.scrollX,top:r.top+window.scrollY,width:r.width,height:r.height,transform:"none"});o.onSizeChanged()}}}}if(t.keyCode==wijmo_1.Key.Escape&&!o._composing){t.preventDefault();o.hide()}if(t.keyCode==wijmo_1.Key.Enter&&!o._composing){var w=o.dialogResultEnter;if(w){t.preventDefault();o._validateAndHide(w)}}if(t.keyCode==wijmo_1.Key.Tab&&o.modal){t.preventDefault();wijmo_1.moveFocus(n,t.shiftKey?-1:1)}}}));s(document,"keyup",(function(t){t.ctrlKey||t.shiftKey||o._activeEdge===_Edges.None||(o._activeEdge=_Edges.None)}));s(n,"click",(function(t){var e=t.target;if(e instanceof HTMLElement){if(e instanceof HTMLButtonElement&&"submit"==e.type){var i=o.hostElement,n=o.dialogResultSubmit;if(i instanceof HTMLFormElement&&n&&i.reportValidity()){t.preventDefault();o.hide(n)}}var s=e.className.match(/\bwj-hide[\S]*\b/);if(s&&s.length>0){t.preventDefault();t.stopPropagation();o.hide(s[0])}}}));var r=o._toggle.bind(o),a=PopupTrigger;o.addEventListener(n,"click",(function(t){o._ignoreClick||r(t,a.ClickPopup)}),!0);o.addEventListener(n,"mousedown",(function(t){o._ignoreClick=!1;r(t,a.DownPopup)}),!0);o.addEventListener(n,"mouseenter",(function(t){t.target==n&&r(t,a.EnterPopup)}),!0);o.addEventListener(n,"mouseleave",(function(t){t.target==n&&r(t,a.LeavePopup)}),!0);o.addEventListener(n,"blur",(function(t){o.containsFocus()||r(t,a.BlurPopup)}),!0);s(document,"wheel",(function(t){if(o.isVisible&&o._modal){for(var e=t.target;e&&e!=document.body;e=e.parentElement)if(e.scrollHeight>e.clientHeight)return;t.preventDefault()}}));o.initialize(i);o._updateAriaLabel();return o}Object.defineProperty(Popup.prototype,"ariaLabelledBy",{get:function(){return this.hostElement.getAttribute("aria-labelledby")},set:function(t){wijmo_1._setAriaLabelBy(this,this.hostElement,t,this._updateAriaLabel.bind(this))},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"owner",{get:function(){return this._owner},set:function(t){var e=this._owner;if(e){this.removeEventListener(e,"click");this.removeEventListener(e,"mousedown");this.removeEventListener(e,"mouseenter");this.removeEventListener(e,"mouseleave");this.removeEventListener(e,"blur")}if(e=this._owner=null!=t?wijmo_1.getElement(t):null){this.addEventListener(e,"click",this._ownerClickBnd,!0);this.addEventListener(e,"mousedown",this._ownerDownBnd,!0);this.addEventListener(e,"mouseenter",this._ownerEnterBnd,!0);this.addEventListener(e,"mouseleave",this._ownerLeaveBnd,!0);this.addEventListener(e,"blur",this._ownerBlurBnd,!0)}},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"position",{get:function(){return this._position},set:function(t){this._position=wijmo_1.asEnum(t,wijmo_1.PopupPosition)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"content",{get:function(){return this.hostElement.firstElementChild},set:function(t){if(t!=this.content){this.hostElement.innerHTML="";t instanceof HTMLElement&&this.hostElement.appendChild(t)}},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"showTrigger",{get:function(){return this._showTrigger},set:function(t){this._showTrigger=wijmo_1.asEnum(t,PopupTrigger)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"hideTrigger",{get:function(){return this._hideTrigger},set:function(t){this._hideTrigger=wijmo_1.asEnum(t,PopupTrigger)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"fadeIn",{get:function(){return this._fadeIn},set:function(t){this._fadeIn=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"fadeOut",{get:function(){return this._fadeOut},set:function(t){this._fadeOut=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"removeOnHide",{get:function(){return this._removeOnHide},set:function(t){if((t=wijmo_1.asBoolean(t))!=this.removeOnHide){this._removeOnHide=t;if(!this.isVisible){var e=this.hostElement;if(t)wijmo_1.removeChild(e);else if(e&&document.body){e.style.display="none";document.body.appendChild(e)}}}},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"modal",{get:function(){return this._modal},set:function(t){this._modal=wijmo_1.asBoolean(t);wijmo_1.setAttribute(this.hostElement,"aria-modal",t?"true":null)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"isDraggable",{get:function(){return this._draggable},set:function(t){this._draggable=wijmo_1.asBoolean(t);this._updateAriaLabel()},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"isResizable",{get:function(){return this._resizable},set:function(t){this._resizable=wijmo_1.asBoolean(t);this._updateAriaLabel()},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"dialogResult",{get:function(){return this._result},set:function(t){this._result=t},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"dialogResultEnter",{get:function(){return this._resultEnter},set:function(t){this._resultEnter=t},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"dialogResultSubmit",{get:function(){return this._resultSubmit},set:function(t){this._resultSubmit=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(Popup.prototype,"isVisible",{get:function(){var t=this.hostElement;return this._visible&&null!=t&&t.offsetHeight>0},enumerable:!0,configurable:!0});Popup.prototype.show=function(t,e){var i=this;this._lastShow=Date.now();if(!this.isVisible){var o=this.hostElement;this.dialogResult=null;this._callback=null;this._oldFocus=null;this._myFocus=null;this._hideAnim.forEach((function(t){clearInterval(t)}));if(this._hideAnim.length>0){this._hideAnim.length=0;if(this._bkDrop){wijmo_1.hidePopup(this._bkDrop,this.removeOnHide);this._bkDrop.style.opacity=""}wijmo_1.hidePopup(o,this.removeOnHide);o.style.opacity=""}var n=new wijmo_1.CancelEventArgs;if(this.onShowing(n)){null!=t&&(this.modal=wijmo_1.asBoolean(t));null!=e&&(this._callback=wijmo_1.asFunction(e));this._oldFocus=wijmo_1.getActiveElement();wijmo_1.showPopup(o,this._owner,this._position,this._fadeIn,!1,this._hideBnd);this._modal&&this._showBackdrop();wijmo_1.setAttribute(this._oldFocus,"aria-expanded","true");this._composing=!1;this._visible=!0;this.onShown(n);this._updateAriaLabel();this._clearTimeouts();if(this.modal){this.addEventListener(window,"focus",(function(){if(!i.containsFocus()){var t=i._myFocus;t&&t.offsetHeight?t.focus():wijmo_1.moveFocus(o,0)}}));this.addEventListener(o,"focusin",(function(){var t=wijmo_1.getActiveElement();t&&wijmo_1.contains(o,t)&&(t.tabIndex>-1||!i._myFocus)&&(i._myFocus=t)}))}this._resized=this._dragged=this._ignoreClick=!1;this._handleDragResize(!0);this.addEventListener(window,"touchstart",(function(t){i._hideTrigger&PopupTrigger.Blur&&!wijmo_1.contains(o,t.target,!0)&&i.hide()}));this._toHidePopupTimer=setTimeout((function(){i.addEventListener(window,"click",(function(t){i._hideTrigger&PopupTrigger.BlurPopup&&i.isDisabled&&!wijmo_1.contains(o,t.target,!0)&&i.hide()}))}));this._toGetFocusTimer=setTimeout((function(){if(!i.isDisabled&&!i.containsFocus()&&!i.isTouching){var t=o.querySelector("[autofocus]");if(t&&t.clientHeight>0&&!t.disabled&&t.tabIndex>-1&&!wijmo_1.closest(t,"[disabled],."+wijmo_1.ControlStateClsNames.disabled)){t.focus();wijmo_1.isFunction(t.select)&&t.select()}else wijmo_1.moveFocus(o,0)}if(!i.isDisabled&&!i.containsFocus()){o.tabIndex=0;o.focus()}}),100)}}};Popup.prototype.hide=function(t){var e=this;this.removeEventListener(window,"touchstart");this.removeEventListener(window,"click");if(this.isVisible){wijmo_1.isUndefined(t)||(this.dialogResult=t);var i=new wijmo_1.CancelEventArgs,o=this.hostElement;if(this.onHiding(i)){this._handleDragResize(!1);for(var n=this.containsFocus()?this._oldFocus:null,s=o.querySelectorAll("."+wijmo_1.ControlClsNames.hostElement+"."+exports.DropDownClsNames.hostElement),r=0;r<s.length;r++){var a=wijmo_1.Control.getControl(s[r]);a instanceof DropDown&&(a.isDroppedDown=!1)}var l=this.removeOnHide,h=this.fadeOut;this._hideTimer=setTimeout((function(){e._updateState();e.onHidden(i);e._callback&&e._callback(e);if(e.hideTrigger&PopupTrigger.LeavePopup){var t=wijmo_1.Control.getControl(wijmo_1.closest(e.owner,"."+exports.PopupClsNames.hostElement));if(t instanceof Popup&&0!=(t.hideTrigger&PopupTrigger.Leave)){var o=Popup._evtHover,n=o?document.elementFromPoint(o.clientX,o.clientY):null,s=wijmo_1.Control.getControl(wijmo_1.closest(n,"."+exports.PopupClsNames.hostElement));s instanceof Popup&&!s.isVisible&&(n=null);n&&wijmo_1.contains(t.hostElement,n,!0)||t.hide()}}}),wijmo_1.Control._FOCUS_INTERVAL+50);this._bkDrop&&this._hideAnim.push(wijmo_1.hidePopup(this._bkDrop,l,h));this._hideAnim.push(wijmo_1.hidePopup(o,l,h));wijmo_1.setAttribute(this._oldFocus,"aria-expanded","false");this._visible=!1;this._oldFocus=null;this._myFocus=null;this._updateAriaLabel();this.removeEventListener(window,"focus");this.removeEventListener(o,"focusin");this.containsFocus()&&wijmo_1.getActiveElement().blur();this._clearTimeouts();!this.isVisible&&n&&n.offsetHeight&&n.focus()}}};Popup.prototype.onShowing=function(t){this.showing.raise(this,t);return!t.cancel};Popup.prototype.onShown=function(t){this.shown.raise(this,t)};Popup.prototype.onHiding=function(t){this.hiding.raise(this,t);return!t.cancel};Popup.prototype.onHidden=function(t){this._wasVisible=!1;this.hidden.raise(this,t)};Popup.prototype.onResizing=function(t){this.resizing.raise(this,t);return!t.cancel};Popup.prototype.onResized=function(t){this.resized.raise(this,t)};Popup.prototype.onDragging=function(t){this.dragging.raise(this,t);return!t.cancel};Popup.prototype.onDragged=function(t){this.dragged.raise(this,t)};Popup.prototype.onSizeChanging=function(t){this.sizeChanging.raise(this,t);return!t.cancel};Popup.prototype.onSizeChanged=function(t){this.sizeChanged.raise(this,t)};Popup.prototype.onPositionChanging=function(t){this.positionChanging.raise(this,t);return!t.cancel};Popup.prototype.onPositionChanged=function(t){this.positionChanged.raise(this,t)};Popup.prototype.onLostFocus=function(e){t.prototype.onLostFocus.call(this,e);if(this._hideTrigger&PopupTrigger.BlurPopup&&!this.containsFocus()){var i=document.createEvent("Event");i.initEvent("blur",!0,!0);this._toggle(i,PopupTrigger.BlurPopup)}};Popup.prototype.refresh=function(e){void 0===e&&(e=!0);var i=this.hostElement;t.prototype.refresh.call(this,e);if(this.isVisible&&!this._refreshing&&i){this._refreshing=!0;for(var o=wijmo_1.getActiveElement(),n=this._owner?this._owner.getBoundingClientRect():null,s=[],r=i.querySelectorAll("."+exports.DropDownClsNames.hostElement),a=0;a<r.length;a++){var l=wijmo_1.Control.getControl(r[a]);if(l instanceof DropDown&&l.isDroppedDown){s.push(l);l.dropDown.style.display="none"}}wijmo_1.showPopup(i,n,this._position);s.forEach((function(t){t.dropDown.style.display="";t._updateDropDown()}));this._modal&&o instanceof HTMLElement&&o!=wijmo_1.getActiveElement()&&o.focus();this._refreshing=!1}};Popup.prototype._clearTimeouts=function(){if(this._toShow){clearTimeout(this._toShow);this._toShow=null}if(this._toHideLeave){clearTimeout(this._toHideLeave);this._toHideLeave=null}if(this._toHideBlur){clearTimeout(this._toHideBlur);this._toHideBlur=null}};Popup.prototype._handleDragResize=function(t){var e=this.hostElement,i=this._draggable?this._getHeaderElement():null,o=this.addEventListener.bind(this),n=this.removeEventListener.bind(this),s=this._mousemoveBnd,r=this._mousedownBnd;if(t){o(e,"mousemove",s);o(e,"mousedown",r);o(e,"touchstart",r);i&&(i.style.touchAction="none")}else{this._mousedownEvt=null;this._rcBounds=null;n(e,"mousemove",s);n(e,"mousedown",r);n(e,"touchstart",r);n(document,"mousemove",this._mousedragBnd);n(document,"mouseup",this._mouseupBnd);i&&(i.style.touchAction="")}};Popup.prototype._mousemove=function(t){if(!this._mousedownEvt){var e=this.hostElement,i=this._getEdges(e,t),o="",n=_Edges;this._edges=i;this._resizable&&(i==n.LeftTop||i==n.RightBottom?o="nwse-resize":i==n.LeftBottom||i==n.RightTop?o="nesw-resize":i==n.Left||i==n.Right?o="ew-resize":i!=n.Top&&i!=n.Bottom||(o="ns-resize"));this._draggable&&!o&&this._getClosestHeader(t.target)&&(o="move");e.style.cursor=o}};Popup.prototype._mousedown=function(t){if(!t.defaultPrevented){var e=t.touches&&t.touches.length>0?t.touches[0]:t;this._edges=this._getEdges(this.hostElement,e);if(this._edges||this._draggable&&this._getClosestHeader(t.target)){var i=new wijmo_1.CancelEventArgs;if(this._edges?this.onResizing(i):this.onDragging(i)){this._mousedownEvt=e;this._rcBounds=this.hostElement.getBoundingClientRect();var o=this.addEventListener.bind(this),n=document,s=this._mousedragBnd,r=this._mouseupBnd;o(n,"mousemove",s);o(n,"touchmove",s);o(n,"mouseup",r);o(n,"touchend",r)}}this._ignoreClick=!1}};Popup.prototype._mouseup=function(){this._mousedownEvt=null;this._rcBounds=null;this._activeEdge=_Edges.None;var t=this.removeEventListener.bind(this),e=document,i=this._mousedragBnd,o=this._mouseupBnd;t(e,"mousemove",i);t(e,"touchmove",i);t(e,"mouseup",o);t(e,"touchend",o);this._resized?this.onResized():this._dragged&&this.onDragged();this._resized=this._dragged=this._ignoreClick=!1};Popup.prototype._mousedrag=function(t){if(!t.defaultPrevented){var e=this.hostElement,i=this._mousedownEvt,o=t.touches&&t.touches.length>0?t.touches[0]:t,n=o.clientX-i.clientX,s=o.clientY-i.clientY,r=this._rcBounds,a=this._edges,l=Popup._SZ_MIN,h=wijmo_1.Rect.fromBoundingRect(r);if(a){var u=window.getComputedStyle(e),c=parseInt(u.getPropertyValue("min-width"))||l,p=parseInt(u.getPropertyValue("min-height"))||l;if(a&_Edges.Left){var d=h.right-c;h.left=Math.min(h.left+n,d);h.width=Math.max(h.width-n,c)}else a&_Edges.Right&&(h.width=Math.max(h.width+n,c));if(a&_Edges.Top){var m=h.bottom-p;h.top=Math.min(h.top+s,m);h.height=Math.max(h.height-s,p)}else a&_Edges.Bottom&&(h.height=Math.max(h.height+s,p));if(this.onSizeChanging(new PopupBoundsChangingEventArgs(h))){wijmo_1.setCss(e,{left:h.left+window.scrollX,top:h.top+window.scrollY,width:h.width,height:h.height,transform:"none"});this._resized=this._dragged=this._ignoreClick=!0;this.onSizeChanged()}if(!window.ResizeObserver)for(var _=this.hostElement.children,f=0;f<_.length;f++)wijmo_1.Control.invalidateAll(_[f])}else if(this._draggable&&(this._dragged||Math.abs(n)+Math.abs(s)>Popup._DRAG_THRESHOLD)){h.left=Math.max(r.left+n+(o.pageX-o.clientX),50-r.width);h.top=Math.max(r.top+s+(o.pageY-o.clientY),0);if(this.onPositionChanging(new PopupBoundsChangingEventArgs(h))){wijmo_1.setCss(e,{left:h.left,top:h.top,width:h.width,height:h.height,transform:"none"});this._dragged=this._ignoreClick=!0;this.onPositionChanged()}}}};Popup.prototype._getEdges=function(t,e){var i=0;if(this._resizable){var o=t.getBoundingClientRect(),n=Popup._SZ_EDGE;e.clientX-o.left<n&&(i|=_Edges.Left);e.clientY-o.top<n&&(i|=_Edges.Top);o.right-e.clientX<n&&(i|=_Edges.Right);o.bottom-e.clientY<n&&(i|=_Edges.Bottom)}return i};Popup.prototype._ownerClick=function(t){this._toggle(t,PopupTrigger.ClickOwner)};Popup.prototype._ownerDown=function(t){this._wasVisible=this.isVisible;this._toggle(t,PopupTrigger.DownOwner)};Popup.prototype._ownerBlur=function(t){wijmo_1.contains(this._owner,wijmo_1.getActiveElement())||this._toggle(t,PopupTrigger.BlurOwner)};Popup.prototype._ownerEnter=function(t){t.target==this._owner&&this._toggle(t,PopupTrigger.EnterOwner)};Popup.prototype._ownerLeave=function(t){t.target==this._owner&&this._toggle(t,PopupTrigger.LeaveOwner)};Popup.prototype._toggle=function(t,e){var i=this;t instanceof MouseEvent&&(Popup._evtHover=t);if(!("mouseenter"==t.type&&Date.now()-this._lastShow<300||t.defaultPrevented)){var o=0!=(this._hideTrigger&e),n=0!=(this._showTrigger&e),s=PopupTrigger;(o||n)&&this._clearTimeouts();o&&this.isVisible&&(e&s.Leave?this._toHideLeave=setTimeout((function(){var t=Popup._evtHover,e=t?document.elementFromPoint(t.clientX,t.clientY):null;e&&wijmo_1.contains(i.hostElement,e,!0)||i.hide()}),wijmo_1.Control._LEAVE_DELAY):e&s.Blur?this._toHideBlur=setTimeout((function(){i.containsFocus()||wijmo_1.contains(i._owner,wijmo_1.getActiveElement())||i.hide()}),wijmo_1.Control._FOCUS_INTERVAL+50):this.hide());n&&e!=s.ClickPopup&&(this._wasVisible||(e&s.Enter?this._toShow=setTimeout((function(){i.show()}),wijmo_1.Control._HOVER_DELAY):this.show()))}};Popup.prototype._getHeaderElement=function(){var t=this.hostElement;return t.querySelector("."+exports.PopupClsNames.dialogHeader)||t.querySelector(".modal-header")};Popup.prototype._getClosestHeader=function(t){return wijmo_1.closest(t,"."+exports.PopupClsNames.dialogHeader)||wijmo_1.closest(t,".modal-header")};Popup.prototype._showBackdrop=function(){var t=this;if(!this._bkDrop){this._bkDrop=document.createElement("div");this._bkDrop.tabIndex=-1;wijmo_1.setAttribute(this._bkDrop,"role","presentation");wijmo_1.setAttribute(this._bkDrop,"aria-hidden","true");wijmo_1.setAttribute(this._bkDrop,"aria-label",wijmo_1.culture.Popup.ariaLabels.backdrop);wijmo_1.addClass(this._bkDrop,exports.PopupClsNames.popupBackDrop);this.addEventListener(this._bkDrop,"mousedown",(function(e){e.preventDefault();e.stopPropagation();t.hostElement.focus();t.hideTrigger&PopupTrigger.Blur&&t.hide()}))}wijmo_1.setCss(this._bkDrop,{zIndex:wijmo_1.Control._POPUP_ZINDEX,display:""});var e=this.hostElement;e.parentElement.insertBefore(this._bkDrop,e)};Popup.prototype._validateAndHide=function(t){var e=this.hostElement;if(e instanceof HTMLFormElement)e.reportValidity()&&this.hide(t);else{var i=this.hostElement.querySelector(":invalid");i?i.focus():this.hide(t)}};Popup.prototype._updateAriaLabel=function(){this.hostElement&&(this.ariaLabelledBy?this._updateAriaLabelImp(""):this._updateAriaLabelImp(this._ariaLabel))};Popup.prototype._updateAriaLabelImp=function(t){var e=[];this.isDraggable&&e.push(wijmo_1.culture.Popup.ariaLabels.isDraggable);this.isResizable&&e.push(wijmo_1.culture.Popup.ariaLabels.isResizable);this.isVisible?e.push(wijmo_1.culture.Popup.ariaLabels.popupVisible):e.push(wijmo_1.culture.Popup.ariaLabels.popupHide);var i=e.join(",");wijmo_1.setAttribute(this.hostElement,"aria-label",t?t+" "+i:i)};Popup.prototype.dispose=function(){Popup._PopupInstanceCount--;0===Popup._PopupInstanceCount&&Popup._evtHover&&(Popup._evtHover=null);this._clearTimeouts();if(this._toHidePopupTimer){clearTimeout(this._toHidePopupTimer);this._toHidePopupTimer=null}if(this._toGetFocusTimer){clearTimeout(this._toGetFocusTimer);this._toGetFocusTimer=null}if(this._hideTimer){clearTimeout(this._hideTimer);this._hideTimer=null}this._hideAnim.forEach((function(t){return clearInterval(t)}));this._hideAnim=[];var e=this.hostElement;if(e)for(var i=e.querySelectorAll("."+exports.DropDownClsNames.hostElement),o=0;o<i.length;o++){var n=wijmo_1.Control.getControl(i[o]);n&&n instanceof DropDown&&n.dispose()}this._initialOwner.appendChild(this.hostElement);this._initialOwner=null;this.owner=null;if(this._bkDrop){this._bkDrop.remove();this._bkDrop=null}this._callback=null;t.prototype.dispose.call(this)};Popup._DRAG_THRESHOLD=6;Popup._SZ_EDGE=10;Popup._SZ_MIN=40;Popup._PopupInstanceCount=0;return Popup}(wijmo_1.Control);exports.Popup=Popup;var PopupBoundsChangingEventArgs=function(t){__extends(PopupBoundsChangingEventArgs,t);function PopupBoundsChangingEventArgs(e){var i=t.call(this)||this;i._rc=e;return i}Object.defineProperty(PopupBoundsChangingEventArgs.prototype,"bounds",{get:function(){return this._rc},enumerable:!0,configurable:!0});return PopupBoundsChangingEventArgs}(wijmo_1.CancelEventArgs);exports.PopupBoundsChangingEventArgs=PopupBoundsChangingEventArgs;wijmo_1._addCultureInfo("InputDate",{ariaLabels:{inputDateInput:"InputDate Input",inputDate:"Input Date",button:"Choose Date",dialog:"Calendar"}});var InputDateEventArgs=function(t){__extends(InputDateEventArgs,t);function InputDateEventArgs(e){var i=t.call(this)||this;i._isUserInput=e;return i}Object.defineProperty(InputDateEventArgs.prototype,"isUserInput",{get:function(){return this._isUserInput},enumerable:!0,configurable:!0});return InputDateEventArgs}(wijmo_1.CancelEventArgs);exports.InputDateEventArgs=InputDateEventArgs;var InputDate=function(t){__extends(InputDate,t);function InputDate(e,i){var o=t.call(this,e)||this;o._fmt="d";o._sep=" - ";o._rngs=null;o._showCal=!1;o._clsOnSel=!0;o._handleWheel=!0;o._preserveCalendarNavigation=!0;o._isTriggered=!1;o._rangeChanged=!1;o._textInitialized=!1;o._previousText="";o._keepInvalidText=!1;o._inputAriaLabel=wijmo_1.culture.InputDate.ariaLabels.inputDateInput;o._currentInput="";o._ariaLabelledby=null;o.valueChanged=new wijmo_1.Event;o.rangeEndChanged=new wijmo_1.Event;o.rangeChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.InputDateClsNames.hostElement);var n=wijmo_1.culture.InputDate.ariaLabels;wijmo_1.setAttribute(o._btn.querySelector("button"),"aria-haspopup","dialog");wijmo_1.setAttribute(o._dropDown,"role","dialog");wijmo_1.setAriaLabel(o._dropDown,n.dialog);wijmo_1.setAttribute(o._dropDown,"aria-modal",!0);wijmo_1.setAttribute(o._tbx,"role","combobox");wijmo_1.setAttribute(o._tbx,"aria-haspopup","dialog");wijmo_1.setAriaLabel(o._btn.querySelector("button"),n.button);o.dropDown.id=wijmo_1.getUniqueId(o.hostElement.id+"_dropdown");o._msk=new wijmo_1._MaskProvider(o._tbx);var s=o.addEventListener.bind(o);wijmo_1.isIE9()||(o.inputType="tel");o._tbx.type.match(/^(tel|text|)$/i)||(o.inputType="text");var r=o._mouseWheel.bind(o);s(o.hostElement,"wheel",r);var a=o._lbx=new ListBox(document.createElement("div"),{displayMemberPath:"name",selectedIndexChanged:function(t){var e=t.selectedItem,i=wijmo_1.DateTime.fromDateTime,n=wijmo_1.DateTime.sameDate;if(e&&e.from&&e.to){if(!n(e.from,o.value)||!n(e.to,o.rangeEnd)){var s=o.value;o.value=i(e.from,s);o.rangeEnd=i(e.to,s)}o._selectAll()}else o._cal.hostElement.style.display=""}}),l=o._cal=new Calendar(document.createElement("div")),h=o._dropDown;wijmo_1.addClass(h,exports.InputDateClsNames.inputDateDropDown);h.appendChild(a.hostElement);h.appendChild(l.hostElement);o.addEventListener(h,"click",(function(){o._isTriggered=!0;setTimeout((function(){o._isTriggered=!1}),50)}),!0);o.addEventListener(h,"keydown",(function(t){if("Enter"===t.key){o._isTriggered=!0;setTimeout((function(){o._isTriggered=!1}),50)}}),!0);if("INPUT"==o._orgTag){var u=o._tbx.getAttribute("value");u&&(l.value=l.rangeEnd=wijmo_1.Globalize.parseDate(u,"yyyy-MM-dd"))}o.isRequired=!0;o._tbx.value=o._oldText=o._getText();o.initialize(i);var c=wijmo_1.isNullOrUndefined(o.tabOrder)?0:o.tabOrder;l.tabOrder=-1!==c&&o.showConfirmationButtons?c:-1;a.tabOrder=c;if(o._textInitialized||o._tbx.value!==o._oldText){o._oldText=o._tbx.value;o._currentInput="text";o._textInitialized=!0;o._commitText();o.onTextChanged()}o._updateState();l.valueChanged.addHandler((function(t,e){o._refreshText();o.onValueChanged(e)}));l.rangeEndChanged.addHandler((function(t,e){if(l._rngMode()){o.onRangeEndChanged(e);o._closeOnChange();l._clearingRangeEnd||o._refreshText()}}));l.cancelButtonClicked.addHandler((function(t,e){o.isDroppedDown=!1}));l.OKButtonClicked.addHandler((function(t,e){o._closeOnChange();o._refreshText()}));l._enterKeyDownToSetValue.addHandler((function(t,e){o._closeOnChange()}));l.addEventListener(l.hostElement,"click",(function(t){if(l.selectionMode&&!l._rngMode()){var e=t.target,i=l.hitTest(e);if(wijmo_1.DateTime.sameDate(o.value,i)||wijmo_1.closest(e,"[wj-part=btn-today]")){o._closeOnChange();o._refreshText()}}}));o._updateInputAriaLabel();return o}Object.defineProperty(InputDate,"controlTemplate",{get:function(){InputDate._ctrlTemplate||(InputDate._ctrlTemplate=DropDown.controlTemplate);return InputDate._ctrlTemplate},set:function(t){InputDate._ctrlTemplate=t},enumerable:!0,configurable:!0});InputDate.prototype._mouseWheel=function(t){if(this.handleWheel&&!t.defaultPrevented&&!this.isDroppedDown&&this.containsFocus()&&null!=this.value&&this._canChangeValue()){var e=this._tbx,i=e.selectionStart,o=e.selectionEnd,n=wijmo_1.clamp(-t.deltaY,-1,1),s=this.value,r=wijmo_1.Globalize.getFullFormat(this.format);null==r&&(r=this.format);var a=r.match(wijmo_1.getSpecialCharsRegex());if(o-i===e.value.length&&null!=a||this.selectionMode==DateSelectionMode.Range){for(var l=1;;l++){s=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,l*n):wijmo_1.DateTime.addDays(this.value,l*n);if(this._isValidDate(s)||!(null===this.max||s<this.max)||!(null===this.min||s>this.min))break}this.value=s;var h=this._getText();wijmo_1.setSelectionRange(e,0,h.length)}else this._updateDateTimeValue(n,a,r);t.preventDefault()}};Object.defineProperty(InputDate.prototype,"value",{get:function(){return this._cal.value},set:function(t){this._cal.value=t;(this.text||this.isRequired)&&this._refreshText()},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"rangeEnd",{get:function(){return this._cal.rangeEnd},set:function(t){this._cal.rangeEnd=t;(this.text||this.isRequired)&&this._refreshText()},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"rangeMin",{get:function(){return this._cal.rangeMin},set:function(t){this._cal.rangeMin=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"rangeMax",{get:function(){return this._cal.rangeMax},set:function(t){this._cal.rangeMax=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"keepInvalidText",{get:function(){return this._keepInvalidText},set:function(t){if(new Set(["InputDateTime","WjInputDateTime"]).has(this.constructor.name)){this._keepInvalidText=!1;throw"keepInvalidText property cannot be used with InputDateTime control"}this._keepInvalidText=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"text",{get:function(){return this._tbx.value},set:function(t){var e=(t||"").toString();if(e!=this.text){e!=this._tbx.value&&(this._tbx.value=e);if(e!=this._oldText){this._oldText=e;this._previousText=e}if(wijmo_1.isEmpty(this._currentInput)){this._textInitialized=!0;this._currentInput="text";this._commitText()}this.onTextChanged();this._currentInput=""}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"format",{get:function(){return this._fmt},set:function(t){if(t!=this.format){this._fmt=wijmo_1.asString(t);this._refreshText()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"separator",{get:function(){return this._sep},set:function(t){if(t!=this._sep){this._sep=wijmo_1.asString(t,!1);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"mask",{get:function(){return this._msk.mask},set:function(t){this._msk.mask=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"closeOnSelection",{get:function(){return this._clsOnSel},set:function(t){this._clsOnSel=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(t){t=wijmo_1.asBoolean(t);this._handleWheel=t;t||(this.calendar.handleWheel=t)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"predefinedRanges",{get:function(){return this._rngs},set:function(t){if(this._rngs!=t){wijmo_1.assert(null==t||wijmo_1.isObject(t),"Object expected");this._rngs=t;this._lbx.itemsSource=this._getRanges(t);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"alwaysShowCalendar",{get:function(){return this._showCal},set:function(t){this._showCal=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"min",{get:function(){return this._cal.min},set:function(t){this._cal.min=wijmo_1.asDate(t,!0)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"max",{get:function(){return this._cal.max},set:function(t){this._cal.max=wijmo_1.asDate(t,!0)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"repeatButtons",{get:function(){return this._cal.repeatButtons},set:function(t){this._cal.repeatButtons=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"showYearPicker",{get:function(){return this._cal.showYearPicker},set:function(t){this._cal.showYearPicker=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"showMonthPicker",{get:function(){return this._cal.showMonthPicker},set:function(t){this._cal.showMonthPicker=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"showHeader",{get:function(){return this._cal.showHeader},set:function(t){this._cal.showHeader=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"weeksBefore",{get:function(){return this._cal.weeksBefore},set:function(t){this._cal.weeksBefore=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"weeksAfter",{get:function(){return this._cal.weeksAfter},set:function(t){this._cal.weeksAfter=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"selectionMode",{get:function(){return this._cal.selectionMode},set:function(t){if(t!=this.selectionMode){this._cal.selectionMode=t;this._refreshText()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"monthCount",{get:function(){return this._cal.monthCount},set:function(t){this._cal.monthCount=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"calendar",{get:function(){return this._cal},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"inputType",{get:function(){return this._tbx.type},set:function(t){t.match(/^(tel|text|)$/i)?this._tbx.type=wijmo_1.asString(t):console.warn("invalid input type '"+t+"', don't use any input types other than 'tel' or 'text'")},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"preserveCalendarNavigation",{get:function(){return this._preserveCalendarNavigation},set:function(t){this._preserveCalendarNavigation=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"itemValidator",{get:function(){return this._cal.itemValidator},set:function(t){if(t!=this.itemValidator){this._cal.itemValidator=wijmo_1.asFunction(t);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"itemFormatter",{get:function(){return this._cal.itemFormatter},set:function(t){this._cal.itemFormatter=wijmo_1.asFunction(t)},enumerable:!0,configurable:!0});InputDate.prototype.onValueChanged=function(t){this.valueChanged.raise(this,t)};InputDate.prototype.onRangeEndChanged=function(t){this.rangeEndChanged.raise(this,t);this.rangeEnd&&(this.isDroppedDown?this._rangeChanged=!0:this.onRangeChanged(t))};InputDate.prototype.onRangeChanged=function(t){this._rangeChanged=!1;this.rangeChanged.raise(this,t)};InputDate.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);if(this.hostElement){this._msk&&this._msk.refresh();this._cal&&this._cal.refresh();this._refreshText()}};InputDate.prototype.onIsDroppedDownChanging=function(e){if(this.isDroppedDown);else{var i=this._lbx,o=this._cal,n=i.collectionView,s=i.hostElement.style,r=o.hostElement.style;if(o._rngMode()&&wijmo_1.hasItems(n)){var a=this._updateRangeSelection();s.display="";r.display=!this._showCal&&a&&a.from&&n.items.some((function(t){return!t.to}))?"none":""}else{s.display="none";r.display=""}o._mthMode()||(o.monthView=!0);o.value&&!this.preserveCalendarNavigation&&(o.displayMonth=o.value)}return t.prototype.onIsDroppedDownChanging.call(this,e)};InputDate.prototype.onIsDroppedDownChanged=function(e){t.prototype.onIsDroppedDownChanged.call(this,e);var i=this.containsFocus();if(this.isDroppedDown){i&&(this._tryFocus(this._cal)||this._tryFocus(this._lbx)||this.dropDown.focus());this._lbx.showSelection();this._cal.refresh()}else{this._commitText();this._rangeChanged&&this.onRangeChanged()}};InputDate.prototype._updateDropDown=function(){this._commitText();var e=getComputedStyle(this.hostElement);this._dropDown.style.minWidth=18*parseFloat(e.fontSize)+"px";this._cal.refresh();t.prototype._updateDropDown.call(this)};InputDate.prototype.onGotFocus=function(t){var e=this._tbx;this._elRef==e&&(this.isDroppedDown?this.dropDown.focus():this.selectAll());this.containsFocus()||this.focus();this.gotFocus.raise(this,t)};InputDate.prototype._keydown=function(e){if(!(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)){this._isInvalidInputCancelled=!1;if(this._isHiddenEditor())return;var i=wijmo_1.getActiveElement();switch(e.keyCode){case wijmo_1.Key.Enter:if(this.showConfirmationButtons&&i!==this._tbx)return;this._currentInput="user";this._textInitialized=!1;this._commitText(!1,!0);break;case wijmo_1.Key.Escape:this.text=this._getText();this.selectAll();break;case wijmo_1.Key.Tab:if(this.showConfirmationButtons&&i!==this._tbx){var o=wijmo_1._getFocusableElements(this._dropDown).filter((function(t){return!(t.classList.contains("wj-control")&&t.classList.contains("wj-calendar"))})),n=o[0],s=o[o.length-1];if(e.shiftKey){if(i===n){e.preventDefault();s.focus()}}else if(i===s){e.preventDefault();n.focus()}}else if(this.isDroppedDown){this.isDroppedDown=!1;this.containsFocus()||this.focus();this.keyActionTab===TabKeyAction.CloseAndKeepFocus&&e.preventDefault()}this._currentInput="user";this._textInitialized=!1;this._commitText(!0);break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(e.keyCode===wijmo_1.Key.Up&&this.keyActionUpArrow===KeyAction.OpenDropdown||e.keyCode===wijmo_1.Key.Down&&this.keyActionDownArrow===KeyAction.OpenDropdown)break;if(!this.isDroppedDown&&this.value&&this._canChangeValue()){this._currentInput="user";this._textInitialized=!1;var r=this._tbx,a=r.selectionStart,l=r.selectionEnd,h=(r.value,e.keyCode==wijmo_1.Key.Up?1:-1),u=this.value,c=wijmo_1.Globalize.getFullFormat(this.format);if("g"==this.format&&c.includes("г")){c=c.replace(/\"г.\" /,"")}null==c&&(c=this.format);var p=c.match(wijmo_1.getSpecialCharsRegex());if(l-a===r.value.length&&null!=p||this.selectionMode==DateSelectionMode.Range){for(var d=1;;d++){u=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,d*h):wijmo_1.DateTime.addDays(this.value,d*h);if(this._isValidDate(u)||!(null===this.max||u<this.max)||!(null===this.min||u>this.min))break}this.value=u;var m=this._getText();wijmo_1.setSelectionRange(r,0,m.length)}else this._updateDateTimeValue(h,p,c);e.preventDefault()}}}t.prototype._keydown.call(this,e)};InputDate.prototype._expandSelection=function(){if(this._cal._rngMode()){var e=this._tbx,i=e.value,o=e.selectionStart,n=e.selectionEnd,s=this._sep,r=i.indexOf(s);r>-1&&o==n&&(n<=r?wijmo_1.setSelectionRange(e,0,r):o>=r+s.length&&wijmo_1.setSelectionRange(e,r+s.length,e.value.length))}else t.prototype._expandSelection.call(this)};InputDate.prototype._updateDateTimeValue=function(t,e,i){var o=this._tbx,n=o.selectionStart,s=o.value,r=this.value,a={},l={},h=0,u=0,c=0,p=[],d=[],m=o.value.match(wijmo_1.getSpecialCharsRegex());if(null==e||null==m){p=[this.format];d=["0"];e=[""]}else{e.forEach((function(t,o){var n=t.replaceAll('"',""),r=i.substring(h),c=s.substring(u),p=r.indexOf(t),d=c.indexOf(n);if(-1==d){var _=m[o];d=c.indexOf(_)}var f=r.substring(0,p);if(""!=f){a[f]=h;l[f]=u}h=h+p+t.length;u=u+d+n.length;if(o==e.length-1){f=i.substring(h);a[f]=h;l[f]=u}}));p=Object.keys(a);d=Object.values(l)}var _=d.filter((function(t){return n>=parseInt(t.toString())}));_.length>0&&(c=_.length-1);for(var f=p[c],b=1;;b++){-1!=f.indexOf("d")?r=wijmo_1.DateTime.addDays(this.value,b*t):-1!=f.indexOf("M")?r=wijmo_1.DateTime.addMonths(this.value,b*t):-1!=f.indexOf("y")&&(r=wijmo_1.DateTime.addYears(this.value,b*t));if(this._isValidDate(r)||!(null===this.max||r<this.max)||!(null===this.min||r>this.min))break}this.value=r;this._reselectText(e,c)};InputDate.prototype._reselectText=function(t,e){var i=this._getText(),o=this._tbx,n=0,s=-1,r=-1;if(1==t.length&&""==t[0]){s=0;r=i.length}else{var a=o.value.match(wijmo_1.getSpecialCharsRegex());t.forEach((function(t,o){var l=t.replaceAll('"',""),h=i.substring(n);if(h.startsWith("г.")){h=h.replace("г. ","");n+="г. ".length}var u=h.indexOf(l);0==u&&e++;if(-1==u){var c=a[o];u=h.indexOf(c)}var p=-1===u?h:h.substring(0,u);o==e&&-1==s&&(r=(s=n)+p.length);n=n+u+l.length}))}if(-1==s){s=n;r=o.value.length}wijmo_1.setSelectionRange(o,s,r)};InputDate.prototype._refreshText=function(){var t=this._getText();if(t!=this.text||t!==this._oldText){this._tbx.value=this._oldText=this._previousText=t;this.onTextChanged()}};InputDate.prototype._selectAll=function(){this.isDroppedDown||!this.containsFocus()||this.isTouching||this.selectAll()};InputDate.prototype._closeOnChange=function(){var t=this;if(this._clsOnSel&&this._isTriggered){var e=this._cal;(!e._rngMode()||e.value&&e.rangeEnd)&&setTimeout((function(){t._isInvalidInputCancelled=!1;t.isDroppedDown=!1}))}};InputDate.prototype._tryFocus=function(t){var e=t.hostElement;if(e&&e.offsetHeight){e.focus();return!0}return!1};InputDate.prototype._clamp=function(t){return this._cal._clamp(t)};InputDate.prototype._getText=function(){var t=wijmo_1.Globalize.format,e=this._fmt,i=t(this.value,e);this._cal._rngMode()&&i&&(this.rightToLeft?i=t(this.rangeEnd,e)+this._sep+i:i+=this._sep+t(this.rangeEnd,e));return i};InputDate.prototype._commitText=function(t,e){var i=this._tbx.value;this._isInvalidInputCancelled=!1;if(wijmo_1.isEmpty(this._currentInput)){this._textInitialized=!1;this._currentInput="user"}var o=!1,n=this._fmt,s=this._cal,r=wijmo_1.Globalize.parseDate,a=new InputDateEventArgs(!this._textInitialized);if(i)if(s._rngMode()){var l=i.split(this._sep),h=this.rightToLeft?l[1]:l[0];if(2==l.length&&h){if(c=r(h,n,this.value)){var u=r(this.rightToLeft?l[0]:l[1],n,this.value);if(wijmo_1.DateTime.sameDate(c,this._clamp(c)))o=!0;else if(this._shouldRaiseInvalidInput(e)&&this.onInvalidInput(a))this._textInitialized&&this._keepInvalidText||(o=!0);else{this._selectAll();o=!1}if(o)if(u){s.value=this._fromDateTime(c);if(wijmo_1.DateTime.sameDate(u,this._clamp(u))){s.rangeEnd=u&&u>=c?this._fromDateTime(u):c;this.text=this._getText()}else this._triggerInvalidInputEvent(a,c,u,e)}else if(this._shouldRaiseInvalidInput(e)&&this.onInvalidInput(a)){if(!this._textInitialized||!this._keepInvalidText){s.value=this._fromDateTime(c);s.rangeEnd=c;this.text=this._getText()}}else{this._isInvalidInputCancelled=!0;this._selectAll()}}else this._nullValueInvalidInput(a,e)}else this._nullValueInvalidInput(a,e)}else{(c=r(i,n,this.value))?wijmo_1.DateTime.sameDate(c,this._clamp(c))?this.value=this._fromDateTime(c):this._triggerInvalidInputEvent(a,c,null,e):this._nullValueInvalidInput(a,e)}else if(this.isRequired){var c;(c=r(i,n,this.value))?this.value=this._fromDateTime(c):this.containsFocus()||(this.text=this._getText())}else this.value=this.rangeEnd=null;this._currentInput="";t||this._selectAll()};InputDate.prototype._triggerInvalidInputEvent=function(t,e,i,o){if(this._shouldRaiseInvalidInput(o)&&this.onInvalidInput(t)){if(!this._textInitialized||!this._keepInvalidText){this.value=this._fromDateTime(e);this.calendar._rngMode()&&(this.calendar.rangeEnd=i&&i>=e?this._fromDateTime(i):e)}}else{this.isDroppedDown||!this.containsFocus()||this.isTouching||this.focus();this._isInvalidInputCancelled=!0;this._selectAll()}};InputDate.prototype._nullValueInvalidInput=function(t,e){if(this._shouldRaiseInvalidInput(e)&&this.onInvalidInput(t))this._textInitialized&&this._keepInvalidText||(this.text=this._getText());else{this.isDroppedDown||!this.containsFocus()||this.isTouching||this.focus();this._isInvalidInputCancelled=!0;this._selectAll()}};InputDate.prototype._fromDateTime=function(t){return wijmo_1.DateTime.fromDateTime(t,this.value)};InputDate.prototype._canChangeValue=function(){return!this.isReadOnly&&!this.isDisabled&&this.selectionMode!=DateSelectionMode.None};InputDate.prototype._isValidDate=function(t){if(t){if(this._clamp(t)!=t)return!1;if(this.itemValidator&&!this.itemValidator(t))return!1}return!0};InputDate.prototype._getRanges=function(t){var e=[];if(wijmo_1.isObject(t))for(var i in t){var o=t[i];e.push({name:i,from:o?o[0]:null,to:o?o[1]:null})}return new wijmo_1.CollectionView(e,{currentItem:null})};InputDate.prototype._updateRangeSelection=function(){var t=this._lbx,e=-1;if(wijmo_1.hasItems(t.collectionView))for(var i=this._lbx.collectionView.items,o=wijmo_1.DateTime.sameDate,n=0;n<i.length;n++){var s=i[n];if(s.from){if(o(s.from,this.value)&&o(s.to,this.rangeEnd)){e=n;break}}else e=n}t.selectedIndex=e;return t.selectedItem};InputDate.prototype._copy=function(t,e){if("text"===t){var i=(e||"").toString();if(i!==this.text){this._tbx.value=i;this._textInitialized=!0}return!0}return!1};Object.defineProperty(InputDate.prototype,"showConfirmationButtons",{get:function(){return this._showConfirmationButtons},set:function(t){this._showConfirmationButtons=t;this._cal.focusMode=t;this._cal.showConfirmationButtons=t;var e=wijmo_1.isNullOrUndefined(this.tabOrder)?0:this.tabOrder;this._cal.tabOrder=t?e:-1;this._cal.keyActionTab=t?CalendarTabKeyAction.All:CalendarTabKeyAction.None},enumerable:!0,configurable:!0});Object.defineProperty(InputDate.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(t){wijmo_1._setAriaLabelBy(this,this._tbx,t,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});InputDate.prototype._updateInputAriaLabel=function(){this._tbx&&(this._tbx.id||this.ariaLabelledBy?wijmo_1.setAriaLabel(this._tbx,null):wijmo_1.setAriaLabel(this._tbx,this._inputAriaLabel))};InputDate.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputDate.ariaLabels.inputDate};InputDate._ctrlTemplate="";return InputDate}(DropDown);exports.InputDate=InputDate;wijmo_1._addCultureInfo("InputDateRange",{ariaLabels:{inputDateRangeInput:"InputDateRange Input"}});var InputDateRange=function(t){__extends(InputDateRange,t);function InputDateRange(e,i){var o=t.call(this,e,__assign({selectionMode:DateSelectionMode.Range,showMonthPicker:"Outside",monthCount:2},i&&!wijmo_1.isNullOrUndefined(i.tabOrder)?{tabOrder:i.tabOrder}:{}))||this;o._inputAriaLabel=wijmo_1.culture.InputDateRange.ariaLabels.inputDateRangeInput;wijmo_1.addClass(o.hostElement,exports.InputDateRangeClsNames.hostElement);o._tbx.value=o._oldText=o._getText();o.initialize(i);if(o._tbx.value!==o._oldText){o._oldText=o._tbx.value;o._currentInput="text";o._commitText()}o._updateInputAriaLabel();return o}Object.defineProperty(InputDateRange,"controlTemplate",{get:function(){InputDateRange._ctrlTemplate||(InputDateRange._ctrlTemplate=InputDate.controlTemplate);return InputDateRange._ctrlTemplate},set:function(t){InputDateRange._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDateRange.prototype,"selectionMode",{get:function(){return this.calendar.selectionMode},set:function(t){t=wijmo_1.asEnum(t,DateSelectionMode);wijmo_1.assert(t==DateSelectionMode.Range,'InputDateRange.selectionMode must be "Range"');this.calendar.selectionMode=t},enumerable:!0,configurable:!0});InputDateRange.prototype._mouseWheel=function(t){if(!t.defaultPrevented&&!this.isDroppedDown&&this.containsFocus()&&null!=this.value&&this._canChangeValue()){var e=wijmo_1.clamp(-t.deltaY,-1,1),i=this.value;this.value=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(i,e):wijmo_1.DateTime.addDays(i,e);this.selectAll();t.preventDefault()}};InputDateRange.prototype.onGotFocus=function(t){var e=this._tbx;this._elRef!=e||this.isDroppedDown||this.selectAll();this.containsFocus()||this.focus();this.gotFocus.raise(this,t)};InputDateRange.prototype._keydown=function(e){if(!(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)){this._isInvalidInputCancelled=!1;if(this._isHiddenEditor())return;switch(e.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(e.keyCode===wijmo_1.Key.Up&&this.keyActionUpArrow===KeyAction.OpenDropdown||e.keyCode===wijmo_1.Key.Down&&this.keyActionDownArrow===KeyAction.OpenDropdown)break;if(!this.isDroppedDown&&this.value&&this._canChangeValue()){var i=e.keyCode==wijmo_1.Key.Up?1:-1,o=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,i):wijmo_1.DateTime.addDays(this.value,i);this.value=this._fromDateTime(o);this.selectAll();e.preventDefault()}}}t.prototype._keydown.call(this,e)};InputDateRange._ctrlTemplate="";return InputDateRange}(InputDate);exports.InputDateRange=InputDateRange;wijmo_1._addCultureInfo("InputColor",{ariaLabels:{inputColor:"Input Color",inputColorInput:"InputColor Input",button:"Choose Color",dialog:"ColorPicker"}});var InputColor=function(t){__extends(InputColor,t);function InputColor(e,i){var o=t.call(this,e)||this;o._textInitialized=!1;o._ariaLabelledby=null;o._inputAriaLabel=wijmo_1.culture.InputColor.ariaLabels.inputColorInput;o.valueChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.InputColorClsNames.hostElement);wijmo_1.setAttribute(o._dropDown,"role","dialog");wijmo_1.setAriaLabel(o._dropDown,wijmo_1.culture.InputColor.ariaLabels.dialog);wijmo_1.setAttribute(o._dropDown,"aria-modal",!0);wijmo_1.setAttribute(o._tbx,"role","combobox");wijmo_1.setAttribute(o._tbx,"aria-haspopup","dialog");wijmo_1.setAttribute(o._btn.querySelector("button"),"aria-haspopup","dialog");wijmo_1.setAriaLabel(o._btn.querySelector("button"),wijmo_1.culture.InputColor.ariaLabels.button);o.dropDown.id=wijmo_1.getUniqueId(o.hostElement.id+"_dropdown");var n='<div class="'+exports.InputColorClsNames.inputColorBox+'"></div>';o._ePreview=wijmo_1.createElement(n,o.hostElement.firstElementChild);if("INPUT"==o._orgTag){o._tbx.type="";o._commitText()}o.value="#ffffff";o.isRequired=!0;o._tbx.value=o._oldText=o.value;o.initialize(i);if(o._textInitialized&&o._tbx.value!==o._oldText){o._oldText=o._tbx.value;o.onTextChanged();o._commitText();o._textInitialized=!1}o.addEventListener(o._colorPicker.hostElement,"click",(function(t){var e=t.target;if(e&&"DIV"==e.tagName&&(wijmo_1.closest(e,'[wj-part="div-pal"]')||wijmo_1.closest(e,'[wj-part="div-pv"]'))){e.style.backgroundColor&&(o.isDroppedDown=!1)}}));var s=!i||-1!==i.tabOrder&&i.colorPickerKeyActionTab!==ColorPickerTabKeyAction.None?0:-1;o._colorPicker.tabOrder=s;o._updateInputAriaLabel();return o}Object.defineProperty(InputColor,"controlTemplate",{get:function(){InputColor._ctrlTemplate||(InputColor._ctrlTemplate=DropDown.controlTemplate);return InputColor._ctrlTemplate},set:function(t){InputColor._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"value",{get:function(){return this._value},set:function(t){this.text=t},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"text",{get:function(){return this._tbx.value},set:function(t){if((t=wijmo_1.asString(t))!=this.text&&(t||!this.isRequired)&&(!t||wijmo_1.Color.fromString(t.replace(/\s+/g,"")))){this._setText(t,!0);this._commitText()}},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"inputType",{get:function(){return this._tbx.type},set:function(t){t.match(/^(tel|text|)$/i)?this._tbx.type=wijmo_1.asString(t):console.warn("invalid input type '"+t+"', don't use any input types other than 'tel' or 'text'")},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"showAlphaChannel",{get:function(){return this._colorPicker.showAlphaChannel},set:function(t){this._colorPicker.showAlphaChannel=t},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"showColorString",{get:function(){return this._colorPicker.showColorString},set:function(t){this._colorPicker.showColorString=t},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"palette",{get:function(){return this._colorPicker.palette},set:function(t){this._colorPicker.palette=t},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"colorPicker",{get:function(){return this._colorPicker},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(t){wijmo_1._setAriaLabelBy(this,this._tbx,t,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});Object.defineProperty(InputColor.prototype,"colorPickerKeyActionTab",{get:function(){return this.colorPicker.keyActionTab},set:function(t){this.colorPicker.keyActionTab=t},enumerable:!0,configurable:!0});InputColor.prototype.onValueChanged=function(t){this.valueChanged.raise(this,t)};InputColor.prototype.onIsDroppedDownChanged=function(e){t.prototype.onIsDroppedDownChanged.call(this,e);if(this.isDroppedDown&&!this.isTouching){this.colorPicker._refreshSelection();var i=this._tbx;this._elRef==i&&wijmo_1.setSelectionRange(i,0,this.text.length,!1);this.containsFocus()||this.focus()}};InputColor.prototype._createDropDown=function(){var t=this;this._colorPicker=new ColorPicker(this._dropDown);wijmo_1.setCss(this._dropDown,{minWidth:420,minHeight:200});this._colorPicker.valueChanged.addHandler((function(){t.value=t._colorPicker.value}))};InputColor.prototype._keydown=function(e){if(!e.defaultPrevented)switch(e.keyCode){case wijmo_1.Key.Enter:this._commitText();this.selectAll();break;case wijmo_1.Key.Escape:this.text=this.value;this.selectAll();break;case wijmo_1.Key.Tab:var i=wijmo_1.getActiveElement();if(this.colorPicker.keyActionTab===ColorPickerTabKeyAction.All&&i!==this._tbx){var o=wijmo_1._getFocusableElements(this.colorPicker.hostElement),n=o[0],s=o[o.length-1];if(e.shiftKey){if(i===n){e.preventDefault();s.focus()}}else if(i===s){e.preventDefault();n.focus()}}else if(this.isDroppedDown){this.isDroppedDown=!1;this.containsFocus()||this.focus();this.keyActionTab===TabKeyAction.CloseAndKeepFocus&&e.preventDefault()}}t.prototype._keydown.call(this,e)};InputColor.prototype._commitText=function(){if(this._value!=this.text){var t=!this.text||!this.text.trim();if(!this.isRequired&&t){this._value="";this._ePreview.style.backgroundColor="";this.onValueChanged();return}if(wijmo_1.Color.fromString(this.text.replace(/\s+/g,""))){if(this.text&&this.text!==this.text.replace(/\s+/g,"")){this.text=this.text.replace(/\s+/g,"");return}var e=this._colorPicker;e.value=this.text;this._value=e.value;this._ePreview.style.backgroundColor=this.value;this.onValueChanged()}else this.onInvalidInput(new wijmo_1.CancelEventArgs)&&(this.text=this._value?this._value:"")}};InputColor.prototype._copy=function(t,e){if("text"===t){var i=(e||"").toString();if(i!==this.text){this._tbx.value=i;this._textInitialized=!0}return!0}return!1};InputColor.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputColor.ariaLabels.inputColor};InputColor.prototype._updateInputAriaLabel=function(){this._tbx&&(this._tbx.id||this.ariaLabelledBy?wijmo_1.setAriaLabel(this._tbx,null):wijmo_1.setAriaLabel(this._tbx,this._inputAriaLabel))};InputColor._ctrlTemplate="";return InputColor}(DropDown);exports.InputColor=InputColor;wijmo_1._addCultureInfo("ComboBox",{ariaLabels:{comboBoxInput:"ComboBox Input",comboBox:"Combo Box"}});var ComboBox=function(t){__extends(ComboBox,t);function ComboBox(e,i){var o=t.call(this,e)||this;o._editable=!1;o._trimText=!0;o._handleWheel=!0;o._delKey=0;o._draggingText=!1;o._textIsComposing="";o._pathHdr=new wijmo_1.Binding(null);o._bsCollapse=!0;o._fmtItemHandlers=0;o._emptyValueAction=!1;o._oldIndexToBeRestoredOnBlur=null;o._restoreComboboxTbxVal=!1;o._isWheel=!1;o._selItems=null;o._oldFilter=null;o._keyActionPrintCharacters=KeyAction.OpenDropdown;o._inputElementAriaLabel=wijmo_1.culture.ComboBox.ariaLabels.comboBoxInput;o._ariaLabelledby=null;o.itemsSourceChanged=new wijmo_1.Event;o.selectedIndexChanged=new wijmo_1.Event;var n=o.hostElement;wijmo_1.addClass(n,exports.ComboBoxClsNames.hostElement);o.dropDown.id=wijmo_1.getUniqueId(n.id+"_dropdown");o.autoExpandSelection=!1;var s=o._tbx;o.addEventListener(s,"compositionstart",(function(){o._composing=!0}));o.addEventListener(s,"compositionend",(function(){o._textIsComposing=o.text;o._composing=!1;o._setText(o._textIsComposing,!0);if(!o._textIsComposing&&o.isRequired){o._oldText="";o._oldIndexToBeRestoredOnBlur=null}setTimeout((function(){o._textIsComposing=""}))}));o.addEventListener(s,"drag",(function(){o._draggingText=!0}));o.addEventListener(n,"wheel",o._wheel.bind(o));"SELECT"==o._orgTag&&o._lbx._initFromSelect(n);var r=o._lbx;r.loadedItems.addHandler((function(t){o.selectedIndex>-1&&(o.selectedIndex=r.selectedIndex)}));r.tabOrder=-1;o.isRequired=!0;o.initialize(i);o._updateTbxAriaHaspopup();o._updateInputAriaLabel();return o}Object.defineProperty(ComboBox,"controlTemplate",{get:function(){ComboBox._ctrlTemplate||(ComboBox._ctrlTemplate=DropDown.controlTemplate);return ComboBox._ctrlTemplate},set:function(t){ComboBox._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"itemsSource",{get:function(){return this._lbx.itemsSource},set:function(t){if(this._lbx.itemsSource!=t){this._lbx.itemsSource=t;this.onItemsSourceChanged()}this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"collectionView",{get:function(){return this._lbx.collectionView},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"virtualizationThreshold",{get:function(){return this._lbx.virtualizationThreshold},set:function(t){this._lbx.virtualizationThreshold=t},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"showGroups",{get:function(){return this._lbx.showGroups},set:function(t){this._lbx.showGroups=t},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"displayMemberPath",{get:function(){return this._lbx.displayMemberPath},set:function(t){if(this.displayMemberPath!==t){this._lbx.displayMemberPath=t;var e=this._getDisplayText(void 0,void 0,!0);this.text!=e&&this._setText(e,!0)}},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"headerPath",{get:function(){return this._pathHdr.path},set:function(t){this._pathHdr.path=wijmo_1.asString(t);var e=this._getDisplayText(void 0,void 0,!0);this.text!=e&&this._setText(e,!0)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"selectedValuePath",{get:function(){return this._lbx.selectedValuePath},set:function(t){this._lbx.selectedValuePath=t},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"isContentHtml",{get:function(){return this._lbx.isContentHtml},set:function(t){if(t!=this.isContentHtml){this._lbx.isContentHtml=wijmo_1.asBoolean(t);var e=this._getDisplayText(void 0,void 0,!0);this.text!=e&&this._setText(e,!0)}},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"caseSensitiveSearch",{get:function(){return this._lbx.caseSensitiveSearch},set:function(t){this._lbx.caseSensitiveSearch=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"trimText",{get:function(){return this._trimText},set:function(t){if(t!=this._trimText){this._trimText=wijmo_1.asBoolean(t);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"itemFormatter",{get:function(){return this._lbx.itemFormatter},set:function(t){this._lbx.itemFormatter=wijmo_1.asFunction(t);this.selectedIndex=this._lbx.selectedIndex},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"formatItem",{get:function(){return this._lbx.formatItem},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"selectedIndex",{get:function(){return this._lbx.selectedIndex},set:function(t){t!=this.selectedIndex&&wijmo_1.isNumber(t)&&(this._lbx.selectedIndex=t);var e=this._lbx._oldSelectedIndex!=this.selectedIndex;t=this.selectedIndex;var i=this._getDisplayText(t,void 0,!0);if(this.text!=i||e){var o=this._internalSettingText;this._internalSettingText=this._lbx._ignoredItemChangedEvents;this._setText(i,!0);""!=this.text&&(this._emptyValueAction=!1);this._internalSettingText=o}},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"selectedItem",{get:function(){return this._lbx.selectedItem},set:function(t){this._lbx.selectedItem=t},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"selectedValue",{get:function(){return this.collectionView?this._lbx.selectedValue:this.text},set:function(t){this.collectionView?this._lbx.selectedValue=t:null!=t&&(this.text=t.toString())},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"isEditable",{get:function(){return this._editable},set:function(t){this._editable=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(t){this._handleWheel=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"maxDropDownHeight",{get:function(){return this._lbx.maxHeight},set:function(t){this._lbx.maxHeight=t},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"maxDropDownWidth",{get:function(){var t=this._dropDown,e=t?parseInt(t.style.maxWidth):null;return isNaN(e)?null:e},set:function(t){var e=this._dropDown.style;t=wijmo_1.asNumber(t,!0);e.maxWidth=null==t?"":t+"px";e.minWidth=""},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"keyActionPrintCharacters",{get:function(){return this._keyActionPrintCharacters},set:function(t){this._keyActionPrintCharacters=wijmo_1.asEnum(t,KeyAction)},enumerable:!0,configurable:!0});Object.defineProperty(ComboBox.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(t){wijmo_1._setAriaLabelBy(this,this._tbx,t,this._updateInputAndListBoxAriaLabel.bind(this))},enumerable:!0,configurable:!0});ComboBox.prototype._updateInputAndListBoxAriaLabel=function(){this._updateInputAriaLabel()};ComboBox.prototype.getDisplayText=function(t,e){void 0===t&&(t=this.selectedIndex);void 0===e&&(e=this._trimText);return this._getDisplayText(t,e)};ComboBox.prototype._getDisplayText=function(t,e,i){void 0===t&&(t=this.selectedIndex);void 0===e&&(e=this._trimText);var o,n=this.collectionView;if(this.headerPath&&t>-1&&wijmo_1.hasItems(n)){var s=n.items[t];o=null!=(o=s?this._pathHdr.getValue(s):null)?o.toString():"";this.isContentHtml&&(o=wijmo_1.toPlainText(o))}else o=this._lbx._getDisplayText(t,i&&void 0!==this.itemFormatter&&!this._hasCustomFormatItem());return e?o.trim():o};ComboBox.prototype._hasCustomFormatItem=function(){return this.formatItem.hasHandlers};ComboBox.prototype.indexOf=function(t,e,i){void 0===i&&(i=!1);var o=this.collectionView,n=this.caseSensitiveSearch;if(wijmo_1.hasItems(o)&&null!=t){t=t.toString();n||(t=t.toLowerCase());if(this._trimText&&!i){-1!==this.indexOf(t,!1,!0)||(t=t.trim())}var s=this.selectedIndex,r=this._getDisplayText(s,void 0,!0);if(e){n||(r=r.toLowerCase());if(t==r)return s}else if(!t&&""==r)return s;for(var a=0;a<o.items.length;a++)if(this._lbx.isItemEnabled(a)){r=this._getDisplayText(a,void 0,!0);this.trimText&&(r=r.trim());n||(r=r.toLowerCase());if(e){if(r==t&&!1===this._emptyValueAction)return a}else if(t&&0==r.indexOf(t)||!t&&""==r&&!1===this._emptyValueAction)return a}}return-1};Object.defineProperty(ComboBox.prototype,"listBox",{get:function(){return this._lbx},enumerable:!0,configurable:!0});ComboBox.prototype.onItemsSourceChanged=function(t){this.itemsSourceChanged.raise(this,t)};ComboBox.prototype.onSelectedIndexChanged=function(t){this._updateBtn();this.selectedIndexChanged.raise(this,t)};ComboBox.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);if(this.hostElement&&wijmo_1.hasItems(this.collectionView)){this._lbx.refresh();this.selectedIndex>-1&&(this.selectedIndex=this._lbx.selectedIndex)}};ComboBox.prototype.onLostFocus=function(e,i,o){this._trimText&&(this.text=this.text.trim());if(this._composing){this._composing=!1;if(!this.text&&this.isRequired){this._oldText="";this._oldIndexToBeRestoredOnBlur=null}this._setText(this.text,!0)}if((!this.text&&this.isRequired&&!(Array.isArray(this._selItems)&&this._selItems.length>0)||o)&&wijmo_1.hasItems(this.collectionView)&&!(this.isRequired&&!this.isEditable&&this.text&&this.indexOf(this.text,!1)>-1&&this.indexOf(this.text,!0)<0)){void 0!==i&&(this.selectedIndex=-1!==i?i:0);null!==this._oldIndexToBeRestoredOnBlur?this.selectedIndex=-1!==this._oldIndexToBeRestoredOnBlur?this._oldIndexToBeRestoredOnBlur:0:null==this.collectionView.currentItem&&(this.selectedIndex=0)}var n=this.text,s=this.collectionView?this.collectionView.items.length:0,r=this.selectedIndex;t.prototype.onLostFocus.call(this,e);var a=this.collectionView?this.collectionView.items.length:0,l=this.selectedIndex,h=this.text;if(r===l&&n===h){if(this._oldFilter){this.collectionView.filter=this._oldFilter;this._oldFilter=null}this._trySelectionUpdateOnItemsSourceChanged(a!==s,n)}};ComboBox.prototype.onIsDroppedDownChanging=function(e){if(!this.isDroppedDown&&!this._hasItems()){e.cancel=!0;return!1}return t.prototype.onIsDroppedDownChanging.call(this,e)};ComboBox.prototype.onIsDroppedDownChanged=function(e){t.prototype.onIsDroppedDownChanged.call(this,e);if(this.isDroppedDown){this._fmtItemHandlers=this.formatItem.handlerCount;this._lbx.showSelection()}this._updateTbxAria()};ComboBox.prototype._trySelectionUpdateOnItemsSourceChanged=function(t,e){if(t&&e){var i=this.indexOf(e,!0);i<0&&(i=this.indexOf(e,!1));this.selectedIndex=i}};ComboBox.prototype._setIsDisabled=function(e){t.prototype._setIsDisabled.call(this,e);this._updateBtn()};ComboBox.prototype._updateBtn=function(){var e=this.collectionView,i=this._tbx,o=this._hasItems();t.prototype._updateBtn.call(this);this._btn.style.display=this._showBtn&&null!=e?"":"none";wijmo_1.enable(this._btn,o&&!this.isDisabled);wijmo_1.setAttribute(i,"role",o?"combobox":null);wijmo_1.setAttribute(i,"aria-autocomplete",o?"both":null);this._updateTbxAria()};ComboBox.prototype._hasItems=function(){return wijmo_1.hasItems(this.collectionView)};ComboBox.prototype._updateTbxAria=function(){t.prototype._updateTbxAria.call(this);var e=this._tbx,i=this.isDroppedDown,o=this.dropDown?this.dropDown.id:null,n=o&&wijmo_1.hasItems(this.collectionView),s=this._lbx,r=s.selectedIndex,a=s.hostElement?s.hostElement.children:null,l=r>-1&&r<a.length?a[r].id:null;wijmo_1.setAttribute(e,"aria-controls",n&&i?o:null);wijmo_1.setAttribute(e,"aria-expanded",n?i:null);wijmo_1.setAttribute(e,"aria-activedescendant",this.isDroppedDown&&l&&l.length?l:null)};ComboBox.prototype._updateInputAriaLabel=function(){var t=this._tbx;t&&(t.id||this._ariaLabelledby?wijmo_1.setAttribute(t,"aria-label",null):wijmo_1.setAttribute(t,"aria-label",this._inputElementAriaLabel))};ComboBox.prototype._createDropDown=function(){var t=this;if(!this._lbx){this._lbx=new ListBox(this._dropDown);this._lbx._container=this.hostElement}this._lbx.maxHeight=200;this._lbx.selectedIndexChanged.addHandler((function(){t._updateBtn();var e=t._lbx.selectedIndex;t.selectedIndex=e;t.onSelectedIndexChanged()}));this._lbx.itemsChanged.addHandler((function(){t._updateBtn()}))};ComboBox.prototype._wheel=function(t){this._isWheel=!0;if(this.handleWheel&&!t.defaultPrevented&&!this.isDroppedDown&&!this.isReadOnly&&this.containsFocus()&&this.selectedIndex>-1){var e=this._findNext("",t.deltaY>0?1:-1);e>-1&&(this.selectedIndex=e);t.preventDefault()}this._isWheel=!1};ComboBox.prototype._dropDownClick=function(e){e.defaultPrevented||e.target!=this._dropDown&&(this.isDroppedDown=!1);this._restoreComboboxTbxVal&&(this._tbx.value=this._getDisplayText(this.selectedIndex,void 0,!0));t.prototype._dropDownClick.call(this,e)};ComboBox.prototype._setText=function(e,i,o){void 0===o&&(o=!1);if(!this._composing&&!this._settingText){this._settingText=!0;if(this.containsFocus()){var n=this.formatItem.handlerCount;if(this._fmtItemHandlers!=n){this._fmtItemHandlers=n;this._lbx.loadList()}}e=[null,void 0,NaN].includes(e)?"":e.toString();var s=this.selectedIndex,r=this.collectionView,a=this._getSelStart(),l=-1,h=!0;if(this.isEditable&&(this._delKey||this._getSelEnd()<e.length||!this.containsFocus())){i=!0;h=!1}s=this.indexOf(e,i);if(h){s<0&&i&&(s=this.indexOf(e,!1));s<0&&a>0&&!o&&(s=this.indexOf(e.substr(0,a),!1));if(!i){var u=this.indexOf(e,!0);u>-1&&s>-1&&u!=s&&(s=u)}}s<0&&this._delKey&&(s=this.indexOf(e,i));if(s<0&&!this.isEditable&&wijmo_1.hasItems(r)&&(e&&this.isRequired||this.containsFocus()&&(e||this.isRequired))){var c=this._oldText||"";s=Math.max(0,this.indexOf(c,!1));a=0;for(var p=0;p<e.length&&p<c.length;p++)if(e[p]!=c[p]){a=p;break}}if((!this._delKey||!this.isEditable||this._delKey&&this.isEditable&&e==this._getDisplayText(s,void 0,!0))&&(!this._pristine||this._pristine&&!this.isEditable)||this._isWheel||this._delKey&&""==e&&s>-1){if(s>-1){l=a;e=this._getDisplayText(s,void 0,!0)}var d=this._tbx;e!=d.value&&(d.value=e);l>-1&&this.containsFocus()&&!this.isTouching&&this._updateInputSelection(l)}if(r){if(!e||this.trimText&&""==e.trim()&&!this.containsFocus()&&this.isEditable)if(s>-1)this._oldIndexToBeRestoredOnBlur=s;else{this._oldIndexToBeRestoredOnBlur=this.indexOf(this._oldText,!0);this._oldIndexToBeRestoredOnBlur=this._oldIndexToBeRestoredOnBlur<0?this.indexOf(this._oldText,!1):this._oldIndexToBeRestoredOnBlur}this._restoreComboboxTbxVal=e&&s>-1;r.moveCurrentToPosition(s)}this.containsFocus()||this.isEditable||this.isRequired||e!=e.trim()||!this.trimText||(this._tbx.value=this._getDisplayText(s,this.trimText,!0));!this.containsFocus()&&s>-1&&this.isEditable&&(e=this._getDisplayText(s,this.trimText,!0));!this.containsFocus()&&this._hasItems()&&s<0&&!this.isEditable&&!this.isRequired&&(e="");var m=!1;!e&&s<0&&this.isRequired&&!this.containsFocus()&&(m=!0);this.trimText&&!this.containsFocus()&&this.isEditable&&(this.isRequired&&""==e.trim()?m=!0:e=e.trim());if(m){this.selectedIndex=this._oldIndexToBeRestoredOnBlur;this.selectedIndex<0&&(this.selectedIndex=0)}var _=!this.containsFocus()&&!this.isEditable&&this.trimText;_&&(this._tbx.value=this._getDisplayText(s,!0,!0));this._delKey=0;this._settingText=!1;t.prototype._setText.call(this,m?this._getDisplayText(this.selectedIndex,void 0,!0):e,i,m,_)}};ComboBox.prototype._findNext=function(t,e,i){void 0===i&&(i=this.selectedIndex);var o=this.collectionView,n=o?o.items.length:0,s=this._lbx,r=this.caseSensitiveSearch;if(o&&n&&e){r||(t=t.toLowerCase());this.trimText&&(t=t.trim());for(var a=i+e;a>-1&&a<n;a+=e){var l=this._getDisplayText(a,void 0,!0);r||(l=l.toLowerCase());if(0==l.indexOf(t)){if(!this.dropDown.children[a]||s.isItemEnabled(a))return a}}}return i};ComboBox.prototype._findNextWhenIsEditableFalse=function(t,e,i){void 0===i&&(i=this.selectedIndex);var o=this._findNext(t,e,i);return o!==i?o:-1};ComboBox.prototype._keydown=function(e){t.prototype._keydown.call(this,e);if(!e.defaultPrevented&&!this.isReadOnly&&!e.altKey&&wijmo_1.hasItems(this.collectionView)&&this._elRef==this._tbx&&!this._isHiddenEditor()){this._delKey=0;var i=this._getSelStart(),o=this._getSelEnd();switch(e.keyCode){case wijmo_1.Key.Tab:if(this.isDroppedDown){this.isDroppedDown=!1;this.keyActionTab===TabKeyAction.CloseAndKeepFocus&&e.preventDefault()}break;case wijmo_1.Key.Back:case wijmo_1.Key.Delete:case 88:if(!e.ctrlKey&&!e.metaKey&&88==e.keyCode)break;if(this._bsCollapse&&!this.isEditable&&i>0&&o==this._tbx.value.length&&wijmo_1.hasItems(this.collectionView)){this._setSelRange(i-1,o);i-=1}this._delKey=e.keyCode;break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:i==this.text.length&&(i=0);this.selectedIndex=this._findNext(this.text.substr(0,i),e.keyCode==wijmo_1.Key.Up?-1:1);this._setSelRange(i,this.text.length);e.preventDefault();break;case wijmo_1.Key.PageUp:this._lbx._selectPrevPage();this.selectAll();e.preventDefault();break;case wijmo_1.Key.PageDown:this._lbx._selectNextPage();this.selectAll();e.preventDefault();break;case wijmo_1.Key.Home:case wijmo_1.Key.End:var n=this._tbx;wijmo_1.setAttribute(n,"aria-activedescendant",null)}this.text.length>0&&["Backspace","Delete","x"].includes(e.key)&&0===i&&o===this.text.length||this._delKey&&1===this.text.length?this._emptyValueAction=!0:this._composing||(this._emptyValueAction=!1)}};ComboBox.prototype._afterOpenDropdownByDownArrow=function(){if(-1===this.selectedIndex){this.selectedIndex=0;this.selectAll()}};ComboBox.prototype._input=function(t){this._handleDragTextState();this._updateDropDownWhenInput();this._updateComponentText();this._updateEmptyValueFlag();this._resetDragState()};ComboBox.prototype._handleDragTextState=function(){this._draggingText&&(this._emptyValueAction=""===this.text)};ComboBox.prototype._handleComposingState=function(){this._composing&&(this._composing=!1)};ComboBox.prototype._shouldOpenDropdown=function(){return this.keyActionPrintCharacters===KeyAction.OpenDropdown};ComboBox.prototype._handleIsEditableFalseInput=function(){var t=this.text,e=this.text.length,i=this._findNextWhenIsEditableFalse(t,1,this.selectedIndex-1);if(-1===i&&-1===(i=this._findNextWhenIsEditableFalse(t,1,-1))){var o=t[t.length-1];e=1;-1===(i=this._findNextWhenIsEditableFalse(o,1))&&(i=this._findNextWhenIsEditableFalse(o,1,-1))}-1!==i?this._updateSelection(i,e):this._updateComponentText()};ComboBox.prototype._updateSelection=function(t,e){this._tbx.value=this._getDisplayText(t,void 0,!0);this._updateInputSelection(e);var i=this.collectionView;i&&i.moveCurrentToPosition(t)};ComboBox.prototype._updateComponentText=function(){var t=this._textIsComposing||this.text;this._setText(t,!1)};ComboBox.prototype._updateEmptyValueFlag=function(){this.text&&(this._emptyValueAction=!1)};ComboBox.prototype._controlDropdownVisibility=function(){this.text&&!this.isDroppedDown&&(this.isDroppedDown=!0)};ComboBox.prototype._resetDragState=function(){this._draggingText=!1};ComboBox.prototype._updateInputSelection=function(t){var e=this._tbx;this._elRef==e&&this._setSelRange(t,e.value.length)};ComboBox.prototype._getSelStart=function(){var t=this._tbx;return t&&t.value?t.selectionStart:0};ComboBox.prototype._getSelEnd=function(){var t=this._tbx;return t&&t.value?t.selectionEnd:0};ComboBox.prototype._setSelRange=function(t,e){var i=this._tbx;this._elRef!=i||i.readOnly||wijmo_1.setSelectionRange(i,t,e)};ComboBox.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.ComboBox.ariaLabels.comboBox};ComboBox.prototype._updateDropDownWhenInput=function(){if(this._shouldOpenDropdown()){var t=this._getSelStart(),e=this._getSelEnd(),i=this._delKey,o=this.text;this._controlDropdownVisibility();this._tbx.value=o;this._setSelRange(t,e);this._delKey=i}};ComboBox._ctrlTemplate="";return ComboBox}(DropDown);exports.ComboBox=ComboBox;wijmo_1._addCultureInfo("MultiSelect",{itemsSelected:"{count:n0} items selected",selectAll:"Select All",ariaLabels:{multiSelectInput:"MultiSelect Input",multiSelect:"Multi Select"}});var MultiSelect=function(t){__extends(MultiSelect,t);function MultiSelect(e,i){var o=t.call(this,e)||this;o._maxHdrItems=2;o._readOnly=!1;o._hdrFmt=null;o._inputElementAriaLabel=wijmo_1.culture.MultiSelect.ariaLabels.multiSelectInput;o.checkedItemsChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.MultiSelectClsNames.hostElement);o._tbx.readOnly=!0;o.checkedMemberPath=null;o.removeEventListener(o.dropDown,"click");o._lbx.itemsChanged.addHandler((function(){o._updateHeader(!1)}));o._lbx.checkedItemsChanged.addHandler((function(){o._updateHeader(!1);o.onCheckedItemsChanged()}));o.clickAction=ClickAction.Toggle;o.initialize(i);o._updateInputAriaLabel();return o}Object.defineProperty(MultiSelect,"controlTemplate",{get:function(){MultiSelect._ctrlTemplate||(MultiSelect._ctrlTemplate=ComboBox.controlTemplate);return MultiSelect._ctrlTemplate},set:function(t){MultiSelect._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"showSelectAllCheckbox",{get:function(){return this._msLbx.showSelectAllCheckbox},set:function(t){this._msLbx.showSelectAllCheckbox=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"showFilterInput",{get:function(){return this._msLbx.showFilterInput},set:function(t){this._msLbx.showFilterInput=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"delay",{get:function(){return this._msLbx.delay},set:function(t){this._msLbx.delay=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"caseSensitiveSearch",{get:function(){return this._msLbx.caseSensitiveSearch},set:function(t){this._msLbx.caseSensitiveSearch=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"filterInputPlaceholder",{get:function(){return this._msLbx.filterInputPlaceholder},set:function(t){this._msLbx.filterInputPlaceholder=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"checkOnFilter",{get:function(){return this._msLbx.checkOnFilter},set:function(t){if(t!=this.checkOnFilter){this._msLbx.checkOnFilter=wijmo_1.asBoolean(t);this.checkedItems=[]}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"selectAllLabel",{get:function(){return this._msLbx.selectAllLabel},set:function(t){this._msLbx.selectAllLabel=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"checkedMemberPath",{get:function(){return this._msLbx.checkedMemberPath},set:function(t){this._msLbx.checkedMemberPath=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"maxHeaderItems",{get:function(){return this._maxHdrItems},set:function(t){if(this._maxHdrItems!=t){this._maxHdrItems=wijmo_1.asNumber(t);this._updateHeader()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"headerFormat",{get:function(){return this._hdrFmt},set:function(t){if(t!=this._hdrFmt){this._hdrFmt=wijmo_1.asString(t);this._updateHeader()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"headerFormatter",{get:function(){return this._hdrFormatter},set:function(t){if(t!=this._hdrFormatter){this._hdrFormatter=wijmo_1.asFunction(t);this._updateHeader()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiSelect.prototype,"checkedItems",{get:function(){return this._msLbx.checkedItems},set:function(t){this._msLbx.checkedItems=null==t?[]:wijmo_1.asArray(t);this._updateHeader()},enumerable:!0,configurable:!0});MultiSelect.prototype.onCheckedItemsChanged=function(t){this.checkedItemsChanged.raise(this,t)};MultiSelect.prototype.dispose=function(){this._lbx.dispose();t.prototype.dispose.call(this)};MultiSelect.prototype.onIsDroppedDownChanged=function(e){var i=this;t.prototype.onIsDroppedDownChanged.call(this,e);setTimeout((function(){if(i.isDroppedDown&&i.containsFocus())if(i.showFilterInput&&!i.isTouching)i._msLbx._filter.focus();else{var t=i.listBox;if(t.selectedIndex<0){var e=0,o=t.checkedItems;o.length&&(e=t.collectionView.items.indexOf(o[0]));t.selectedIndex=Math.max(0,e)}t.showSelection(!0);t.focus()}}))};MultiSelect.prototype.onLostFocus=function(){this._msLbx.onLostFocus();this.isDroppedDown=!1;t.prototype.onLostFocus.call(this)};MultiSelect.prototype._createDropDown=function(){var e=this,i=wijmo_1.createElement("<div></div>",this._dropDown);this._msLbx=new MultiSelectListBox(i);this._lbx=this._msLbx.listBox;var o=this.hostElement;this._lbx.hostElement.id=wijmo_1.getUniqueId(o.id+"_listbox");this._lbx.itemsChanged.addHandler((function(){e.isDroppedDown&&e.refresh()}));t.prototype._createDropDown.call(this)};MultiSelect.prototype._updateBtnAria=function(){var t=this._btn.querySelector("button"),e=this.isDroppedDown,i=this._lbx?this._lbx.hostElement:null,o=i?i.id:null;wijmo_1.setAttribute(t,"aria-expanded",e);wijmo_1.setAttribute(t,"aria-controls",e?o:null)};MultiSelect.prototype._updateTbxAria=function(){var t=this._tbx,e=this.isDroppedDown,i=this._lbx?this._lbx.hostElement:null,o=i?i.id:null;wijmo_1.setAttribute(t,"aria-expanded",e);wijmo_1.setAttribute(t,"aria-controls",e?o:null)};Object.defineProperty(MultiSelect.prototype,"isReadOnly",{get:function(){return this._readOnly},set:function(t){this._readOnly=wijmo_1.asBoolean(t);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly)},enumerable:!0,configurable:!0});MultiSelect.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);this.hostElement&&this._updateHeader()};MultiSelect.prototype._setText=function(t,e){};MultiSelect.prototype._keydown=function(e){var i=e.altKey&&(38===e.keyCode||40===e.keyCode);if(this.isDroppedDown&&i&&this.showFilterInput){this.isDroppedDown=!1;e.preventDefault()}else{t.prototype._keydown.call(this,e);wijmo_1.hasClass(this._tbx,"wj-grid-ime")||!e.defaultPrevented&&wijmo_1.hasItems(this.collectionView)&&e.keyCode>32&&123!==e.keyCode&&(this.isDroppedDown=!0)}};MultiSelect.prototype._hasItems=function(){var t=this.collectionView,e=t?t.sourceCollection:null;return wijmo_1.hasItems(t)||e&&e.length&&this.showFilterInput};MultiSelect.prototype._updateHeader=function(t,e){void 0===t&&(t=!0);void 0===e&&(e=!0);var i="";if(wijmo_1.isFunction(this._hdrFormatter))i=this._hdrFormatter(this);else{var o=this.checkedItems,n=[];if(this.displayMemberPath){var s=new wijmo_1.Binding(this.displayMemberPath);n=o.reduce((function(t,e){(e.binding?t.find((function(t){return t.binding===e.binding})):t.find((function(t){return s.getValue(t)===s.getValue(e)})))||t.push(e);return t}),[]);o=n}if(o.length>0)if(o.length<=this._maxHdrItems){if(this.headerPath){var r=new wijmo_1.Binding(this.headerPath);o=o.map((function(t){return r.getValue(t)}))}else if(this.displayMemberPath){var a=new wijmo_1.Binding(this.displayMemberPath);o=o.map((function(t){return a.getValue(t)}))}this.isContentHtml&&(o=o.map((function(t){return wijmo_1.toPlainText(t)})));this.trimText&&(o=o.map((function(t){return t?t.toString().trim():""})));i=o.join(", ")}else i=wijmo_1.format(this.headerFormat||wijmo_1.culture.MultiSelect.itemsSelected,{count:o.length})}var l=this.inputElement;if(i!=l.value){l.value=i;this.onTextChanged()}t&&this._lbx._updateCheckedList(this.checkedItems);this._updateState()};MultiSelect.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.MultiSelect.ariaLabels.multiSelect};MultiSelect._DEF_CHECKED_PATH="$checked";MultiSelect._ctrlTemplate="";return MultiSelect}(ComboBox);exports.MultiSelect=MultiSelect;wijmo_1._addCultureInfo("Menu",{ariaLabels:{menuButton:"Menu"}});var Menu=function(t){__extends(Menu,t);function Menu(e,i){var o=t.call(this,e)||this;o._closing=!1;o._cmd=null;o._cmdPath=null;o._cmdParamPath=null;o._subPath=null;o._owner=null;o._isButton=!1;o._openOnHover=!1;o._closeOnLeave=!0;o._subMenu=null;o._hoverEnterBnd=o._hoverEnter.bind(o);o._hoverLeaveBnd=o._hoverLeave.bind(o);o._hoverOverBnd=o._hoverOver.bind(o);o._ariaLabel=wijmo_1.culture.Menu.ariaLabels.menuButton;o._aFEnabledItem=!1;o.itemClicked=new wijmo_1.Event;Menu._MenuInstanceCount++;var n=o.hostElement,s=o._tbx,r=o._lbx,a=o.dropDown;wijmo_1.addClass(n,exports.MenuClsNames.hostElement);s.style.display="none";var l='<div wj-part="header" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"/>';o._hdr=o._elRef=wijmo_1.createElement(l);s.parentElement.insertBefore(o._hdr,s);wijmo_1.removeChild(s);o.isRequired=!1;if("SELECT"==o._orgTag){o.header=n.getAttribute("header");o._lbx.itemsSource&&(o.commandParameterPath="cmdParam")}o.isContentHtml=!0;o.maxDropDownHeight=500;o.addEventListener(o._hdr,"click",(function(t){if(!t.defaultPrevented){o._clearHover(t);if(o._isButton){o.isDroppedDown=!1;o._raiseCommand()}else o.isDroppedDown=!o.isDroppedDown}}));o.addEventListener(o._hdr,"mousedown",(function(t){t.defaultPrevented||o._clearHover(t)}));r.lostFocus.addHandler((function(){o.containsFocus()||(o.isDroppedDown=!1)}));wijmo_1.addClass(a,exports.MenuClsNames.menuItems);r.formatItem.addHandler(o._formatMenuItem.bind(o));o.initialize(i);wijmo_1.setAttribute(a,"role","menu");o._updateBtnAria();o._updateHdrAria();r.tabOrder=0;o._updateLbxAria();return o}Object.defineProperty(Menu,"controlTemplate",{get:function(){Menu._ctrlTemplate||(Menu._ctrlTemplate=ComboBox.controlTemplate);return Menu._ctrlTemplate},set:function(t){Menu._ctrlTemplate=t},enumerable:!0,configurable:!0});Menu.prototype._updateBtnAria=function(){var t=this._btn.querySelector("button"),e=this.dropDown;wijmo_1.setAttribute(t,"aria-expanded",this.isDroppedDown);wijmo_1.setAttribute(t,"aria-haspopup","menu");wijmo_1.setAttribute(t,"aria-owns",e.id);wijmo_1.setAttribute(t,"aria-controls",e.id)};Menu.prototype._updateHdrAria=function(){var t=this.dropDown,e=this.isDisabled?-1:this._orgTabIndex;wijmo_1.setAttribute(this._hdr,"role","button");wijmo_1.setAttribute(this._hdr,"tabindex",e);wijmo_1.setAttribute(this._hdr,"aria-label",this._ariaLabel);if(this.isButton){wijmo_1.setAttribute(this._hdr,"aria-expanded");wijmo_1.setAttribute(this._hdr,"aria-haspopup");wijmo_1.setAttribute(this._hdr,"aria-owns");wijmo_1.setAttribute(this._hdr,"aria-controls")}else{wijmo_1.setAttribute(this._hdr,"aria-expanded",this.isDroppedDown);wijmo_1.setAttribute(this._hdr,"aria-haspopup","menu");wijmo_1.setAttribute(this._hdr,"aria-owns",t.id);wijmo_1.setAttribute(this._hdr,"aria-controls",t.id)}};Menu.prototype._updateLbxAria=function(){var t=this._lbx,e=this.isDisabled?-1:t.tabOrder;t.itemRole="menuitem";t.tabOrder=e};Object.defineProperty(Menu.prototype,"ariaLabel",{get:function(){return this._ariaLabel},set:function(t){if(t!=this._ariaLabel){this._ariaLabel=t;wijmo_1.setAttribute(this._hdr,"aria-label",this._ariaLabel)}},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"autoSelectOnFocus",{get:function(){return this._aFEnabledItem},set:function(t){this._aFEnabledItem=t},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"header",{get:function(){return this._hdr.innerHTML},set:function(t){this._hdr.innerHTML=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"command",{get:function(){return this._cmd},set:function(t){this._cmd=t},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"commandPath",{get:function(){return this._cmdPath},set:function(t){this._cmdPath=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"commandParameterPath",{get:function(){return this._cmdParamPath},set:function(t){this._cmdParamPath=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"subItemsPath",{get:function(){return this._subPath},set:function(t){if(t!=this._subPath){this._subPath=t;this.refresh(!0)}},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"openOnHover",{get:function(){return this._openOnHover},set:function(t){this._openOnHover=wijmo_1.asBoolean(t);this._updateHoverEvents()},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"closeOnLeave",{get:function(){return this._closeOnLeave},set:function(t){this._closeOnLeave=wijmo_1.asBoolean(t);this._updateHoverEvents()},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"isButton",{get:function(){return this._isButton},set:function(t){this._isButton=wijmo_1.asBoolean(t);this._updateHdrAria()},enumerable:!0,configurable:!0});Object.defineProperty(Menu.prototype,"owner",{get:function(){return this._owner},set:function(t){this._owner=wijmo_1.asType(t,HTMLElement,!0);this._enableDisableItems()},enumerable:!0,configurable:!0});Menu.prototype.show=function(t){if(!this.isDroppedDown){var e=this._lbx._ignoredItemChangedEvents;this._lbx._ignoredItemChangedEvents=!0;this.selectedIndex=-1;this._lbx._ignoredItemChangedEvents=e;if(this.onIsDroppedDownChanging(new wijmo_1.CancelEventArgs)){var i=this.dropDown,o=this.owner;!o&&t instanceof MouseEvent&&(o=t.target);o instanceof HTMLElement&&(i[wijmo_1.Control._OWNR_KEY]=o);if(t instanceof MouseEvent&&this.openOnHover&&this.closeOnLeave){t=new wijmo_1.Point(t.pageX-pageXOffset-2,t.pageY-pageYOffset-2)}wijmo_1.showPopup(i,t,!1,this.isAnimated);this.onIsDroppedDownChanged()}}};Menu.prototype.hide=function(){if(this.isDroppedDown&&this.onIsDroppedDownChanging(new wijmo_1.CancelEventArgs)){wijmo_1.hidePopup(this.dropDown);this.onIsDroppedDownChanged()}};Menu.prototype.onItemClicked=function(t){this.itemClicked.raise(this,t)};Menu.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);this.hostElement&&this._enableDisableItems()};Menu.prototype.onIsDroppedDownChanged=function(e){t.prototype.onIsDroppedDownChanged.call(this,e);this._updateBtnAria();this._updateHdrAria();if(this.isDroppedDown){this._closing=!0;var i=this._lbx._ignoredItemChangedEvents;this._lbx._ignoredItemChangedEvents=!0;this._defaultItem=this.selectedItem;this.isRequired=!1;this.selectedIndex=-1;this._enableDisableItems();this._closing=!1;this._lbx._ignoredItemChangedEvents=i;if(this._aFEnabledItem){for(var o=this.dropDown.children,n=0;n<o.length;n++)if(!o[n].classList.contains(wijmo_1.ControlStateClsNames.disabled)){this.selectedIndex=n;o[n].focus();break}}else this.dropDown.focus()}else{if(!this.selectedItem){var s=this._lbx._checking;this._lbx._checking=!0;this.selectedItem=this._defaultItem;this._lbx._checking=s}var r=this._subMenu;r&&(r.isDroppedDown=!1)}};Menu.prototype._updateHoverEvents=function(){var t=this.hostElement,e=this.dropDown,i=this.addEventListener.bind(this),o=this.removeEventListener.bind(this),n="mouseleave";o(t,"mouseenter",this._hoverEnterBnd);o(t,n,this._hoverLeaveBnd);o(e,"mouseover",this._hoverOverBnd);o(e,n,this._hoverLeaveBnd);if(this._openOnHover){i(t,"mouseenter",this._hoverEnterBnd);i(e,"mouseover",this._hoverOverBnd);if(this._closeOnLeave){i(t,n,this._hoverLeaveBnd);i(e,n,this._hoverLeaveBnd)}}};Menu.prototype._getSubItems=function(t){var e=this.subItemsPath,i=t&&e?t[e]:null;return wijmo_1.isArray(i)&&i.length?i:null};Menu.prototype._formatMenuItem=function(t,e){var i=e.item;if(this._getSubItems(e.data)){wijmo_1.addClass(i,exports.MenuClsNames.subItems);wijmo_1.setAttribute(i,"aria-expanded",!1)}else if("-"==i.innerHTML){i.innerHTML="";wijmo_1.addClass(i,wijmo_1.UtilitesClsNames.separator);wijmo_1.setAttribute(i,"role","separator");wijmo_1.setAttribute(i,"tabindex")}};Menu.prototype._keydown=function(e){if(!e.defaultPrevented){var i=this._getKeyCode(e);if(this.isDroppedDown)switch(i){case wijmo_1.Key.Tab:this.isDroppedDown=!1;this.keyActionTab===TabKeyAction.CloseAndKeepFocus&&e.preventDefault();break;case wijmo_1.Key.Enter:case wijmo_1.Key.Right:if(this._showSubMenu()){e.preventDefault();return}break;case wijmo_1.Key.Left:var o=wijmo_1.Control.getControl(this.owner);if(o instanceof Menu){var n=o.dropDown,s=o.selectedIndex,r=s>-1?n.children[s]:n;wijmo_1.setAttribute(r,"aria-expanded",!1);wijmo_1.setAttribute(r,"aria-owns");r.focus();e.preventDefault();return}}if(i==wijmo_1.Key.Enter){if(this._isButton){this._raiseCommand();e.preventDefault();return}if(this.isDroppedDown)this.selectedIndex>-1&&this._raiseCommand();else{this.isDroppedDown=!0;e.preventDefault()}}}t.prototype._keydown.call(this,e)};Menu.prototype._dropDownClick=function(e){if(!e.defaultPrevented&&e.target!=this.dropDown){this._clearHover(e);if(this._showSubMenu()){e.preventDefault();return}this.selectedIndex>-1&&this._raiseCommand()}t.prototype._dropDownClick.call(this,e)};Menu.prototype._showSubMenu=function(){var t=this,e=this._getSubItems(this.selectedItem);if(!e)return null;var i=this.dropDown.children[this.selectedIndex],o=i.getBoundingClientRect(),n=new wijmo_1.Point(o.right,o.top);if(0==o.height)return null;var s=this.rightToLeft||"rtl"==this.dropDown.getAttribute("dir");s&&(n.x=o.left);var r=this._subMenu;r&&(r.isDroppedDown=!1);r=new Menu(document.createElement("div"),{owner:this.hostElement,itemsSource:e,autoSelectOnFocus:this._aFEnabledItem,itemClicked:function(e,i){t.itemClicked.raise(e,i)},formatItem:function(e,i){t.formatItem.raise(e,i)}});if(i){wijmo_1.setAttribute(i,"aria-expanded",!0);wijmo_1.setAttribute(i,"aria-owns",r.dropDown.id)}var a=this.collectionView,l=r.collectionView;a&&a.filter&&l&&!l.filter&&(l.filter=a.filter);"displayMemberPath,selectedValuePath,isContentHtml,command,commandPath,commandParameterPath,maxDropDownWidth,maxDropDownHeight,dropDownCssClass,isAnimated,subItemsPath,openOnHover,closeOnLeave".split(",").forEach((function(e){r[e]=t[e]}));var h=r.dropDown;wijmo_1.setAttribute(h,"dir",s?"rtl":null);r.show(n);h[wijmo_1.Control._OWNR_KEY]=this.dropDown;return r};Menu.prototype._raiseCommand=function(t){var e=this.selectedItem,i=this._getSubItems(e),o=this._getCommand(e);if(o&&!i){var n=this._getCommandParm(e);if(!this._canExecuteCommand(o,n))return;this._executeCommand(o,n)}var s=this.headerPath;if(s){var r=new wijmo_1.Binding(s).getValue(e);r=null==r?"":r.toString();this.header=this.isContentHtml?r:wijmo_1.escapeHtml(r)}this.onItemClicked(t);if(this.containsFocus()){for(var a=this;a&&a.owner;){var l=wijmo_1.Control.getControl(a.owner);if(!(l instanceof Menu))break;a=l}var h=a.owner;!h&&a.dropDown&&(h=a.dropDown[wijmo_1.Control._OWNR_KEY]);a.isDroppedDown=!1;a.focus();if(!a.containsFocus()&&h instanceof HTMLElement&&h.offsetHeight)if(wijmo_1.isIE){var u=document.documentElement,c=u.scrollLeft,p=u.scrollTop;h.focus();u.scrollLeft=c,u.scrollTop=p}else h.focus()}};Menu.prototype._getCommand=function(t){var e=t&&this._cmdPath?t[this._cmdPath]:null;return e||this._cmd};Menu.prototype._getCommandParm=function(t){var e=this._cmdParamPath;return t&&e?t[e]:t};Menu.prototype._executeCommand=function(t,e){t&&!wijmo_1.isFunction(t)&&(t=t.executeCommand);wijmo_1.isFunction(t)&&t(e)};Menu.prototype._canExecuteCommand=function(t,e){if(t){var i=t.canExecuteCommand;if(wijmo_1.isFunction(i))return i(e)}return!0};Menu.prototype._enableDisableItems=function(){if(this.collectionView&&(this._cmd||this._cmdPath))for(var t=this.collectionView.items,e=0;e<t.length;e++){var i=t[e],o=this._getCommand(i);if(o){var n=this._lbx.hostElement.children[e],s=this._getCommandParm(i);wijmo_1.toggleClass(n,wijmo_1.ControlStateClsNames.disabled,!this._canExecuteCommand(o,s))}}};Menu.prototype._clearHover=function(t){this._toHover&&clearTimeout(this._toHover);this._toHover=null;Menu._evtHover=t};Menu.prototype._isTargetDisabled=function(t){return wijmo_1.hasClass(t.target,wijmo_1.ControlStateClsNames.disabled)};Menu.prototype._hoverEnter=function(t){var e=this;this._clearHover(t);this._toHover=setTimeout((function(){e._toHover=null;e.isDroppedDown=!0}),wijmo_1.Control._HOVER_DELAY)};Menu.prototype._hoverOver=function(t){var e=this;this._clearHover(t);this._toHover=setTimeout((function(){e._toHover=null;var i=e.listBox.indexOf(t.target);if(i>-1&&!wijmo_1.hasClass(t.target,wijmo_1.ControlStateClsNames.disabled)){e.selectedIndex=i;e._subMenu=e._showSubMenu()}}),wijmo_1.Control._HOVER_DELAY)};Menu.prototype._hoverLeave=function(t){var e=this;this._clearHover(t);this.isDroppedDown&&(this._toHover=setTimeout((function(){var i=(t=Menu._evtHover)?document.elementFromPoint(t.clientX,t.clientY):null,o=wijmo_1.closest(i,"."+exports.ListBoxClsNames.hostElement+"."+exports.MenuClsNames.menuItems),n=e._subMenu;if(!o&&!wijmo_1.contains(e.hostElement,i,!0)){e.isDroppedDown=!1;n&&(n.isDroppedDown=!1)}}),wijmo_1.Control._LEAVE_DELAY))};Menu.prototype._setIsDisabled=function(e){t.prototype._setIsDisabled.call(this,e);wijmo_1.setAttribute(this.hostElement,"tabindex",-1);this._updateHdrAria();this._updateLbxAria()};Menu.prototype._setTabOrder=function(e){t.prototype._setTabOrder.call(this,e);wijmo_1.setAttribute(this.hostElement,"tabindex",-1);this._updateHdrAria();this._updateLbxAria()};Menu.prototype.dispose=function(){var e=this;if(this._subMenu){this._subMenu.dispose();this._subMenu=null}Menu._MenuInstanceCount--;0===Menu._MenuInstanceCount&&Menu._evtHover&&(Menu._evtHover=null);var i=this._lbx;if(i){i.lostFocus.removeHandler((function(){e.containsFocus()||(e.isDroppedDown=!1)}));i.formatItem&&i.formatItem.removeHandler(this._formatMenuItem)}if(this._toHover){clearTimeout(this._toHover);this._toHover=null}this._cmd=null;this._owner=null;this._defaultItem=null;this._hoverEnterBnd=null;this._hoverLeaveBnd=null;this._hoverOverBnd=null;t.prototype.dispose.call(this)};Menu._MenuInstanceCount=0;Menu._ctrlTemplate="";return Menu}(ComboBox);exports.Menu=Menu;wijmo_1._addCultureInfo("InputTime",{ariaLabels:{inputTime:"Input Time",inputTimeInput:"InputTime Input"}});var InputTime=function(t){__extends(InputTime,t);function InputTime(e,i){var o=t.call(this,e)||this;o._format="t";o._inputElementAriaLabel=wijmo_1.culture.InputTime.ariaLabels.inputTimeInput;o.valueChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.InputTimeClsNames.hostElement);o.isEditable=!0;o._value=wijmo_1.DateTime.newDate();o._min=o._max=null;o._msk=new wijmo_1._MaskProvider(o._tbx);wijmo_1.isIE9()||(o._tbx.type="tel");if("INPUT"==o._orgTag){var n=o._tbx.getAttribute("value");n&&(o.value=wijmo_1.Globalize.parseDate(n,"HH:mm:ss"))}o.step=15;o.autoExpandSelection=!0;o.initialize(i);o._commitText();o._updateInputAriaLabel();return o}Object.defineProperty(InputTime,"controlTemplate",{get:function(){InputTime._ctrlTemplate||(InputTime._ctrlTemplate=ComboBox.controlTemplate);return InputTime._ctrlTemplate},set:function(t){InputTime._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"inputType",{get:function(){return this._tbx.type},set:function(t){this._tbx.type=wijmo_1.asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"value",{get:function(){return this._value},set:function(t){(t=wijmo_1.asDate(t,!this.isRequired))&&(t=this._clamp(t));this._setText(t?wijmo_1.Globalize.format(t,this.format):"",!0,!0);this.selectedItem&&this.selectedItem.value&&(t=wijmo_1.DateTime.fromDateTime(t,this.selectedItem.value));if(t!=this._value&&!wijmo_1.DateTime.equals(t,this._value)){this._value=t;this.onValueChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"text",{get:function(){return this._tbx.value},set:function(t){if(t!=this.text&&(this.text||!this.isRequired)){this._setText(t,!0);this._commitText()}!this.text&&this.isRequired&&(this.selectedIndex=this._oldIndexToBeRestoredOnBlur<0?0:this._oldIndexToBeRestoredOnBlur)},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"min",{get:function(){return this._min},set:function(t){this._min=wijmo_1.asDate(t,!0);this.isDroppedDown=!1;this._updateItems()},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"max",{get:function(){return this._max},set:function(t){this._max=wijmo_1.asDate(t,!0);this.isDroppedDown=!1;this._updateItems()},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"step",{get:function(){return this._step},set:function(t){if(t!=this.step){this._step=wijmo_1.asNumber(t,!0);this.isDroppedDown=!1;this._updateItems()}},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"format",{get:function(){return this._format},set:function(t){if(t!=this.format){this._format=wijmo_1.asString(t);this._tbx.value=wijmo_1.Globalize.format(this.value,this.format);wijmo_1.hasItems(this.collectionView)&&this._updateItems()}},enumerable:!0,configurable:!0});Object.defineProperty(InputTime.prototype,"mask",{get:function(){return this._msk.mask},set:function(t){this._msk.mask=wijmo_1.asString(t)},enumerable:!0,configurable:!0});InputTime.prototype.onLostFocus=function(){t.prototype.onLostFocus.call(this)};InputTime.prototype.onValueChanged=function(t){this.valueChanged.raise(this,t)};InputTime.prototype.onItemsSourceChanged=function(e){t.prototype.onItemsSourceChanged.call(this,e);this._hasCustomItems=null!=this.itemsSource};InputTime.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);if(this.hostElement){this._msk.refresh();this._tbx.value=wijmo_1.Globalize.format(this.value,this.format);this._updateItems()}};InputTime.prototype.onSelectedIndexChanged=function(e){if(this.selectedIndex>-1&&!this._settingText){var i=this.value?this.value:wijmo_1.DateTime.newDate(),o=null!=this.selectedItem.value?this.selectedItem.value:wijmo_1.Globalize.parseDate(this.text,this.format,this.value);this.value=wijmo_1.DateTime.fromDateTime(i,o)}t.prototype.onSelectedIndexChanged.call(this,e)};InputTime.prototype._clamp=function(t){null!=this._min&&this._getTime(t)<this._getTime(this._min)&&(t=wijmo_1.DateTime.fromDateTime(t,this._min));null!=this._max&&this._getTime(t)>this._getTime(this._max)&&(t=wijmo_1.DateTime.fromDateTime(t,this._max));return t};InputTime.prototype._wheel=function(e){if(this.handleWheel&&!e.defaultPrevented&&!this.isDroppedDown&&this.value&&this._canChangeValue()&&this.containsFocus()&&this.isEditable){var i=this._tbx,o=i.selectionStart,n=i.selectionEnd,s=wijmo_1.clamp(-e.deltaY,-1,1),r=(this.value,wijmo_1.culture.Globalize.calendar.patterns[this.format]);null==r&&(r=this.format);var a=r.match(wijmo_1.getSpecialCharsRegex());if(n-o===i.value.length&&wijmo_1.isNumber(this.step)&&this.step>0){var l=wijmo_1.DateTime.addMinutes(this.value,this.step*-s);l=this._clamp(l);this.value=l;this.selectAll()}else this._updateTimeValue(s,a,r);e.preventDefault()}t.prototype._wheel.call(this,e)};InputTime.prototype._updateInputSelection=function(e){if(this._delKey)t.prototype._updateInputSelection.call(this,e);else{for(var i=this._tbx.value;e<i.length&&!i[e].match(/[a-z0-9]/i);)e++;wijmo_1.setSelectionRange(this._tbx,e,this._tbx.value.length)}};InputTime.prototype._updateItems=function(){if(!this._hasCustomItems){var t=[],e=new Date,i=new Date(e.getFullYear(),e.getMonth(),e.getDate()),o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59),n=this.step;this.min&&i.setHours(this.min.getHours(),this.min.getMinutes(),this.min.getSeconds());this.max&&o.setHours(this.max.getHours(),this.max.getMinutes(),this.max.getSeconds());if(wijmo_1.isNumber(n)&&n>=1)for(var s=i;s<=o;s=wijmo_1.DateTime.addMinutes(s,n))t.push({value:s,text:wijmo_1.Globalize.format(s,this.format)});var r=this.value;this._settingText=!0;this.displayMemberPath="text";this.selectedValuePath="text";this.itemsSource=t;this._hasCustomItems=!1;this._settingText=!1;!r&&this.isRequired||(this.value=r)}};InputTime.prototype._getTime=function(t){return 3600*t.getHours()+60*t.getMinutes()+t.getSeconds()};InputTime.prototype._getText=function(){var t=wijmo_1.Globalize.format,e=this._format;return t(this.value,e)};InputTime.prototype._canChangeValue=function(){return!this.isReadOnly&&!this.isDisabled};InputTime.prototype.getSeconds=function(t){return 3600*t.getHours()+60*t.getMinutes()+t.getSeconds()};InputTime.prototype._keydown=function(e){if(!(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)){if(this._isHiddenEditor())return;switch(e.keyCode){case wijmo_1.Key.Enter:this._commitText(void 0,!0);this.selectAll();break;case wijmo_1.Key.Escape:this.text=wijmo_1.Globalize.format(this.value,this.format);this.selectAll();break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(!this.isDroppedDown&&this.value&&this._canChangeValue()&&this.isEditable){var i=this._tbx,o=i.selectionStart,n=i.selectionEnd,s=e.keyCode==wijmo_1.Key.Up?1:-1,r=wijmo_1.culture.Globalize.calendar.patterns[this.format];null==r&&(r=this.format);var a=r.match(wijmo_1.getSpecialCharsRegex());if(n-o==i.value.length)t.prototype._keydown.call(this,e);else{if(!(1==s&&(null===this.max||this.getSeconds(this.value)<this.getSeconds(this.max))||-1==s&&(null===this.min||this.getSeconds(this.value)>this.getSeconds(this.min))))return;this._updateTimeValue(s,a,r)}e.preventDefault()}}}t.prototype._keydown.call(this,e)};InputTime.prototype._updateTimeValue=function(t,e,i){var o=this._tbx,n=o.selectionStart,s=o.value,r=this.value,a={},l={},h=0,u=0,c=0,p=[],d=[],m=o.value.match(wijmo_1.getSpecialCharsRegex());if(null==e||null==m){p=[this.format];d=["0"];e=[""]}else{e.forEach((function(t,o){var n=t.replaceAll('"',""),r=i.substring(h),c=s.substring(u),p=r.indexOf(t),d=c.indexOf(n),m=r.substring(0,p);a[m]=h;l[m]=u;h=h+p+t.length;u=u+d+n.length;if(o==e.length-1&&-1!=d){m=i.substring(h);a[m]=h;l[m]=u}}));p=Object.keys(a);d=Object.values(l)}var _=d.filter((function(t){return n>=parseInt(t.toString())}));_.length>0&&(c=_.length-1);var f=p[c];-1!=f.indexOf("h")||-1!=f.indexOf("H")?r=wijmo_1.DateTime.addHours(this.value,t):-1!=f.indexOf("m")?r=wijmo_1.DateTime.addMinutes(this.value,t):-1!=f.indexOf("s")?r=wijmo_1.DateTime.addSeconds(this.value,t):-1!=f.indexOf("t")&&(r=this.value.getHours()>=12?wijmo_1.DateTime.addHours(this.value,-12):wijmo_1.DateTime.addHours(this.value,12));r.getDate()!=(new Date).getDate()&&(r=wijmo_1.DateTime.fromDateTime(new Date,r));this.value=r;this._reselectText(e,c)};InputTime.prototype._reselectText=function(t,e){var i=this._getText(),o=this._tbx,n=0,s=-1,r=-1;t.forEach((function(t,o){var a=t.replaceAll('"',""),l=i.substring(n),h=l.indexOf(a),u=l.substring(0,h),c=""==u?l.length:u.length;o==e&&-1==s&&(r=(s=n)+c);n=n+h+a.length}));if(-1==s){s=n;r=o.value.length}wijmo_1.setSelectionRange(o,s,r)};InputTime.prototype._commitText=function(t,e){if(this.text||this.isRequired){var i=this.value?wijmo_1.Globalize.format(this.value,this.format):"";if(this.text!=i){var o=this.selectedItem&&this.selectedItem.value?this.selectedItem.value:wijmo_1.Globalize.parseDate(this.text,this.format,this.value),n=this._shouldRaiseInvalidInput(e);if(o){!wijmo_1.DateTime.sameTime(o,this._clamp(o))?n&&this.onInvalidInput(new wijmo_1.CancelEventArgs)&&(this.value=wijmo_1.DateTime.fromDateTime(this.value,o)):this.value=wijmo_1.DateTime.fromDateTime(this.value,o)}else n&&this.onInvalidInput(new wijmo_1.CancelEventArgs)&&(this.text=i)}}else this.value=null};InputTime.prototype._copy=function(t,e){if("text"===t){(e||"").toString()!==this.text&&this._setText(e,!0);return!0}return!1};InputTime.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputTime.ariaLabels.inputTime};InputTime.prototype._input=function(t){this._draggingText&&(""===this.text?this._emptyValueAction=!0:this._emptyValueAction=!1);this._composing&&(this._composing=!1);this._setText(""!=this._textIsComposing?this._textIsComposing:this.text,!1);""!=this.text&&(this._emptyValueAction=!1);this._draggingText=!1;this._updateDropDownWhenInput()};InputTime._ctrlTemplate="";return InputTime}(ComboBox);exports.InputTime=InputTime;wijmo_1._addCultureInfo("InputDateTime",{ariaLabels:{inputDateTimeInput:"InputDateTime Input",tglDate:"Toggle Calendar",tglTime:"Toggle Time List"}});var InputDateTime=function(t){__extends(InputDateTime,t);function InputDateTime(e,i){var o=t.call(this,e)||this;o._inputAriaLabel=wijmo_1.culture.InputDateTime.ariaLabels.inputDateTimeInput;wijmo_1.addClass(o.hostElement,exports.InputDateTimeClsNames.hostElement);var n=wijmo_1.culture.InputDateTime.ariaLabels;wijmo_1.setAriaLabel(o._btn,n.tglDate);wijmo_1.setAttribute(o._btn,"aria-haspopup","dialog");wijmo_1.setAttribute(o._btn,"aria-expanded",!1);o._updateInputAriaLabel();o.value=new Date;o.format="g";o.isDroppedDownChanged.addHandler(o.inputDateTimeIsDroppedDownChanged,o);o._inputTime=new InputTime(document.createElement("div"),{valueChanged:function(t){var e=o.rangeEnd;o.value=wijmo_1.DateTime.fromDateTime(o.value,t.value);o.calendar._rngMode()&&e&&(o.rangeEnd=wijmo_1.DateTime.fromDateTime(e,t.value))},isDroppedDownChanged:function(t){t.listBox.containsFocus()&&o.inputElement.focus();o._selectAll();o._updateTbxAria();o.inputDateTimeIsDroppedDownChanged()},keyActionPrintCharacters:0,keyActionTab:0});o._inputTime.dropDown.id=wijmo_1.getUniqueId(o.hostElement.id+"_dropdown");var s=o.addEventListener.bind(o);o._btnTm=o.hostElement.querySelector('[wj-part="btn-tm"]');s(o._btnTm,"mousedown",(function(t){o._btnclick(t)}));wijmo_1.setAriaLabel(o._btnTm,n.tglTime);wijmo_1.setAttribute(o._btnTm,"aria-haspopup","listbox");wijmo_1.setAttribute(o._btnTm,"aria-expanded",!1);o._ddDate=o._dropDown;var r=o._ddTime=o._inputTime.dropDown;s(r,"keydown",o._keydown.bind(o),!0);s(r,"blur",(function(){o._updateFocusState()}),!0);s(r,"click",(function(t){t.defaultPrevented||t.target!=r&&o.hostElement.focus()}),!0);o.initialize(i);o._tbx.value!==o._oldText&&o._commitText();return o}Object.defineProperty(InputDateTime,"controlTemplate",{get:function(){InputDateTime._ctrlTemplate||(InputDateTime._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+'"><div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+" "+exports.InputClsNames.inputBtnVisible+'"><input wj-part="input" type="text" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"/><span class="'+exports.InputClsNames.inputGroupBtn+'"><button wj-part="btn" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.calendar+'></span></button><button wj-part="btn-tm" class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1"><span class='+wijmo_1.GlyphClsNames.clock+'></span></button></span></div></div><div wj-part="dropdown" class="'+wijmo_1.ControlClsNames.content+" "+exports.DropDownClsNames.dropDownPanel+'"></div></div>');return InputDateTime._ctrlTemplate},set:function(t){InputDateTime._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"timeMin",{get:function(){return this._inputTime.min},set:function(t){this._inputTime.min=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"timeMax",{get:function(){return this._inputTime.max},set:function(t){this._inputTime.max=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"timeFormat",{get:function(){return this._inputTime.format},set:function(t){this._inputTime.format=t},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"timeStep",{get:function(){return this._inputTime.step},set:function(t){this._inputTime.step=t;this._btnTm.style.display=wijmo_1.isNumber(t)&&t>0?"":"none"},enumerable:!0,configurable:!0});Object.defineProperty(InputDateTime.prototype,"inputTime",{get:function(){return this._inputTime},enumerable:!0,configurable:!0});InputDateTime.prototype._fromDateTime=function(t){return t};InputDateTime.prototype._btnclick=function(e){this._setDropDownByEvent(e);t.prototype._btnclick.call(this,e)};InputDateTime.prototype.dispose=function(){this._setDropdown(this._ddDate);t.prototype.dispose.call(this);this._inputTime.dispose()};InputDateTime.prototype.refresh=function(e){void 0===e&&(e=!0);this._inputTime.refresh();t.prototype.refresh.call(this,e)};InputDateTime.prototype._updateBtn=function(){t.prototype._updateBtn.call(this);if(this._btnTm){this._btnTm.tabIndex=this._btn.tabIndex;this._btnTm.parentElement.style.display=this._btn.style.display}};InputDateTime.prototype._setDropdown=function(t){if(this._dropDown==t)return!1;this.isDroppedDown&&(this.isDroppedDown=!1);var e=this.dropDownCssClass;this.dropDownCssClass="";this._dropDown=t;this.dropDownCssClass=e;return!0};InputDateTime.prototype._updateDropDown=function(){var e=this._inputTime;if(this._dropDown==e.dropDown){this._commitText();t.prototype._updateDropDown.call(this);e.isRequired=this.isRequired&&null!=this.value;e.value=this.value;this.isDroppedDown&&e.listBox.showSelection()}else t.prototype._updateDropDown.call(this)};InputDateTime.prototype._mouseWheel=function(t){if(this.handleWheel&&!t.defaultPrevented&&!this.isDroppedDown&&this.containsFocus()&&null!=this.value&&this._canChangeValue()){var e=this._tbx,i=e.selectionStart,o=e.selectionEnd,n=wijmo_1.clamp(-t.deltaY,-1,1),s=this.value,r=wijmo_1.Globalize.getFullFormat(this.format);null==r&&(r=this.format);var a=r.match(wijmo_1.getSpecialCharsRegex());if(o-i===e.value.length&&null!=a||this.selectionMode==DateSelectionMode.Range){s=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,n):wijmo_1.DateTime.addDays(this.value,n);this.value=s;var l=this._getText();wijmo_1.setSelectionRange(e,0,l.length)}else(1==n&&(null===this.max||this.value<this.max)||-1==n&&(null===this.min||this.value>this.min))&&this._updateDateTimeValue(n,a,r);t.preventDefault()}};InputDateTime.prototype._keydown=function(e){if(!(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)){if(this._isHiddenEditor())return;switch(e.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(e.keyCode===wijmo_1.Key.Up&&this.keyActionUpArrow===KeyAction.OpenDropdown||e.keyCode===wijmo_1.Key.Down&&this.keyActionDownArrow===KeyAction.OpenDropdown)break;if(!this.isDroppedDown&&this.value&&this._canChangeValue()){var i=this._tbx,o=i.selectionStart,n=i.selectionEnd,s=(i.value,e.keyCode==wijmo_1.Key.Up?1:-1),r=this.value,a=wijmo_1.Globalize.getFullFormat(this.format);if("g"==this.format&&a.includes("г")){a=a.replace(/\"г.\" /,"")}null==a&&(a=this.format);var l=a.match(wijmo_1.getSpecialCharsRegex());if(n-o===i.value.length&&null!=l||this.selectionMode==DateSelectionMode.Range){r=this.selectionMode==DateSelectionMode.Month?wijmo_1.DateTime.addMonths(this.value,s):wijmo_1.DateTime.addDays(this.value,s);this.value=r;var h=this._getText();wijmo_1.setSelectionRange(i,0,h.length)}else(1==s&&(null===this.max||this.value<this.max)||-1==s&&(null===this.min||this.value>this.min))&&this._updateDateTimeValue(s,l,a);e.preventDefault()}break;case wijmo_1.Key.Enter:case wijmo_1.Key.Space:var u=e.target;if(u===this._btn||u===this._btnTm){this._setDropDownByEvent(e);this.isDroppedDown=!0;e.preventDefault()}}}if(!e.defaultPrevented&&e.altKey&&this.isDroppedDown&&("ArrowUp"===e.key||"ArrowDown"===e.key)){var c=this.dropDown===this._ddDate?this._ddTime:this._ddDate;this._setDropdown(c);this.isDroppedDown=!0;e.preventDefault()}t.prototype._keydown.call(this,e)};InputDateTime.prototype._updateDateTimeValue=function(t,e,i){var o=this._tbx,n=o.selectionStart,s=o.value,r=this.value,a={},l={},h=0,u=0,c=0,p=[],d=[],m=o.value.match(wijmo_1.getSpecialCharsRegex());if(null==e||null==m){p=[this.format];d=["0"];e=[""]}else{e.forEach((function(t,o){var n=t.replaceAll('"',""),r=i.substring(h),c=s.substring(u);if(c.startsWith("г.")){c=c.replace("г. ","");u+="г. ".length}var p=r.indexOf(t),d=c.indexOf(n);if(-1==d){var _=m[o];d=c.indexOf(_)}var f=r.substring(0,p);if(""!=f){a[f]=h;l[f]=u}h=h+p+t.length;u=u+d+n.length;if(o==e.length-1&&-1!==d){f=i.substring(h);a[f]=h;l[f]=u}}));p=Object.keys(a);d=Object.values(l)}var _=d.filter((function(t){return n>=parseInt(t.toString())}));_.length>0&&(c=_.length-1);var f=new Date,b=new Date;null!==this.timeMax&&(f=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),this.timeMax.getHours(),this.timeMax.getMinutes(),this.timeMax.getSeconds()));null!==this.timeMin&&(b=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),this.timeMin.getHours(),this.timeMin.getMinutes(),this.timeMin.getSeconds()));var g=p[c];if(-1!=g.indexOf("d"))r=wijmo_1.DateTime.addDays(this.value,t);else if(-1!=g.indexOf("M"))r=wijmo_1.DateTime.addMonths(this.value,t);else if(-1!=g.indexOf("y"))r=wijmo_1.DateTime.addYears(this.value,t);else if(1==t&&(null===this.timeMax||this.value<f)||-1==t&&(null===this.timeMin||this.value>b)){-1!=g.indexOf("h")||-1!=g.indexOf("H")?r=wijmo_1.DateTime.addHours(this.value,t):-1!=g.indexOf("m")?r=wijmo_1.DateTime.addMinutes(this.value,t):-1!=g.indexOf("s")?r=wijmo_1.DateTime.addSeconds(this.value,t):-1!=g.indexOf("t")&&(r=this.value.getHours()>=12?wijmo_1.DateTime.addHours(this.value,-12):wijmo_1.DateTime.addHours(this.value,12));(this.timeMax&&r>f||this.timeMin&&r<b)&&(r=this.value)}this.value=r;this._reselectText(e,c)};InputDateTime.prototype._commitText=function(e,i){var o=this._tbx.value,n=wijmo_1.Globalize.parseDate(o,this.format,this.value),s=new Date,r=new Date;if(n){null!==this.timeMax&&(s=new Date(n.getFullYear(),n.getMonth(),n.getDate(),this.timeMax.getHours(),this.timeMax.getMinutes(),this.timeMax.getSeconds()));null!==this.timeMin&&(r=new Date(n.getFullYear(),n.getMonth(),n.getDate(),this.timeMin.getHours(),this.timeMin.getMinutes(),this.timeMin.getSeconds()));(this.timeMax&&n>s||this.timeMin&&n<r)&&(this.value=wijmo_1.DateTime.fromDateTime(n,this.value));t.prototype._commitText.call(this,e,i)}else t.prototype._commitText.call(this,e,i)};InputDateTime.prototype._updateTbxAria=function(){t.prototype._updateTbxAria.call(this);if(this._inputTime){var e=this._tbx,i=this._inputTime._lbx,o=i.selectedIndex,n=i.hostElement?i.hostElement.children:null,s=o>-1&&o<n.length?n[o].id:null;wijmo_1.setAttribute(e,"aria-activedescendant",this.isDroppedDown&&this.dropDown===this._ddTime&&s&&s.length?s:null);wijmo_1.setAttribute(e,"aria-haspopup",this.inputTime.isDroppedDown?"listbox":"dialog")}};Object.defineProperty(InputDateTime.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(t){var e=wijmo_1.asEnum(t,TabKeyAction);this._keyActionTab=e;this.inputTime.keyActionTab=e},enumerable:!0,configurable:!0});InputDateTime.prototype._setDropDownByEvent=function(t){var e=wijmo_1.closest(t.target,"button")==this._btn?this._ddDate:this._ddTime;this._setDropdown(e)};InputDateTime.prototype._updateBtnAria=function(){var t=this._btn,e=this.isDroppedDown,i=this.dropDown?this.dropDown.id:null,o=this._btnTm,n=e&&this.dropDown===this._ddDate,s=e&&this.dropDown===this._ddTime;wijmo_1.setAttribute(t,"aria-expanded",!!n);wijmo_1.setAttribute(t,"aria-controls",n?i:null);wijmo_1.setAttribute(o,"aria-expanded",!!s);wijmo_1.setAttribute(o,"aria-controls",s?i:null)};InputDateTime.prototype.inputDateTimeIsDroppedDownChanged=function(){var t=this.dropDown===this._ddDate?this._btn:this._btnTm;wijmo_1.toggleClass(t,exports.InputDateTimeClsNames.showDropDownButton,this.isDroppedDown)};InputDateTime._ctrlTemplate="";return InputDateTime}(InputDate);exports.InputDateTime=InputDateTime;wijmo_1._addCultureInfo("AutoComplete",{ariaLabels:{autoCompleteInput:"AutoComplete Input",autoComplete:"Auto Complete"}});var AutoComplete=function(t){__extends(AutoComplete,t);function AutoComplete(e,i){var o=t.call(this,e)||this;o._cssMatch=exports.ComboBoxClsNames.stateMatch;o._minLength=2;o._maxItems=6;o._itemCount=0;o._beginsWith=!1;o._delay=wijmo_1.Control._SEARCH_DELAY;o._selItems=null;o._query="";o._inCallback=!1;o._srchProps=[];o._oldSelectedIndex=-1;o._inputElementAriaLabel=wijmo_1.culture.AutoComplete.ariaLabels.autoCompleteInput;o._isBlurInput=!1;wijmo_1.addClass(o.hostElement,exports.AutoCompleteClsNames.hostElement);o._bsCollapse=!1;o.isEditable=!0;o.isRequired=!1;o.listBox.formatItem.addHandler(o._formatListItem,o);o._itemsSourceFnCallbackBnd=o._itemSourceFunctionCallback.bind(o);o.initialize(i);o._updateInputAriaLabel();return o}Object.defineProperty(AutoComplete,"controlTemplate",{get:function(){AutoComplete._ctrlTemplate||(AutoComplete._ctrlTemplate=ComboBox.controlTemplate);return AutoComplete._ctrlTemplate},set:function(t){AutoComplete._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"minLength",{get:function(){return this._minLength},set:function(t){this._minLength=wijmo_1.asNumber(t,!1,!0)},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"beginsWithSearch",{get:function(){return this._beginsWith},set:function(t){this._beginsWith=wijmo_1.asBoolean(t)},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"maxItems",{get:function(){return this._maxItems},set:function(t){this._maxItems=wijmo_1.asNumber(t,!1,!0)},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"delay",{get:function(){return this._delay},set:function(t){this._delay=wijmo_1.asNumber(t,!1,!0)},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"searchMemberPath",{get:function(){return this._srchProp},set:function(t){this._srchProp=wijmo_1.asString(t);this._srchProps=t?t.trim().split(/\s*,\s*/):[]},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"itemsSourceFunction",{get:function(){return this._itemsSourceFn},set:function(t){if(this._itemsSourceFn!==t){this._itemsSourceFn=wijmo_1.asFunction(t);wijmo_1.isFunction(this._itemsSourceFn)&&this.itemsSourceFunction(this.text,this.maxItems,this._itemsSourceFnCallbackBnd)}},enumerable:!0,configurable:!0});Object.defineProperty(AutoComplete.prototype,"cssMatch",{get:function(){return this._cssMatch},set:function(t){this._cssMatch=wijmo_1.asString(t)},enumerable:!0,configurable:!0});AutoComplete.prototype.onSelectedIndexChanged=function(e){this._settingText||t.prototype.onSelectedIndexChanged.call(this,e)};AutoComplete.prototype._updateTbxAria=function(){t.prototype._updateTbxAria.call(this);var e=this._tbx;wijmo_1.setAttribute(e,"aria-autocomplete","list")};AutoComplete.prototype._keydown=function(e){if(!this._isHiddenEditor()){if(!e.defaultPrevented&&this.isDroppedDown)switch(e.keyCode){case wijmo_1.Key.Up:case wijmo_1.Key.Down:this.selectAll()}t.prototype._keydown.call(this,e)}};AutoComplete.prototype._input=function(t){this._handleDragTextState();this._handleComposingState();this._updateComponentText();this._updateEmptyValueFlag();this._resetDragState()};AutoComplete.prototype._commitText=function(t){var e=this;if(t&&this._composing&&this.isDroppedDown&&!wijmo_1.isFirefox()&&!wijmo_1.isSafari()&&""==this._textIsComposing){this._isBlurInput=!0;this.isDroppedDown=!1;setTimeout((function(){e.onLostFocus()}),this.delay+1)}t&&!this._composing&&(wijmo_1.isFirefox()||wijmo_1.isSafari())&&wijmo_1.getActiveElement()==this.inputElement&&this.onLostFocus()};AutoComplete.prototype._setText=function(t){var e=this;if(this._isBlurInput&&0==this.text.length){this._tbx.value=t;this._isBlurInput=!1}this.trimText&&!this.containsFocus()&&"string"==typeof t&&(t=t.trim());if(this._composing&&t!=this._oldText){this._oldText=t;this.onTextChanged()}if(!(this._inCallback||this._settingText||(wijmo_1.isFirefox()||wijmo_1.isSafari())&&this._composing)){this._toSearch||(this._oldSelectedIndex=this.selectedIndex);if(this.selectedIndex>-1&&this._getDisplayText(void 0,void 0,!0)!=t){this._settingText=!0;this.selectedIndex=-1;this._settingText=!1}this._toSearch&&clearTimeout(this._toSearch);if(t!=this._oldText||t!=this.text){"string"!=typeof t&&(t="");var i=this._tbx,o=this._tbx.selectionStart;i.value!=t&&(i.value=t);this._isWheel&&this.containsFocus()&&this._updateInputSelection(o);this._oldText=t;this.onTextChanged();var n=this.collectionView;if(!t&&n){(this._query||this.selectedIndex<0)&&(this.isDroppedDown=!1);this._query=this._rxHighlight=null;n.filter=null;var s=this.itemsSourceFunction;if(wijmo_1.isFunction(s)){this.isDroppedDown=!1;s(this._query,this.maxItems,this._itemsSourceFnCallbackBnd)}if(this.isRequired&&!this.containsFocus()&&!Array.isArray(this._selItems)){var r=this._oldSelectedIndex>-1?this._oldSelectedIndex:0;this.selectedIndex=r}-1==this.selectedIndex&&-1!=this._oldSelectedIndex&&this.onSelectedIndexChanged();return}}if(t!=this._getDisplayText(void 0,void 0,!0)){if(!this.containsFocus()&&this.trimText)if(this.isRequired&&!this.text.trim().length){r=this._oldSelectedIndex>-1?this._oldSelectedIndex:0;this.selectedIndex=r}else this._tbx.value=this._tbx.value.trim();var a=!this.containsFocus()&&t.length<this.minLength;this.collectionView&&!this.containsFocus()&&(this.collectionView.filter=null);var l=this.indexOf(t,!0),h=this.indexOf(t,!1);if(a)return;if(!this.containsFocus()&&(!t||this.trimText&&!this.text.trim().length||null!=this.collectionView&&l<0&&h<0)&&this.isRequired&&!this.isEditable){(r=this._oldSelectedIndex>-1?this._oldSelectedIndex:wijmo_1.hasItems(this.collectionView)?0:-1)!=this.selectedIndex&&(this.selectedIndex=r)}else if((Array.isArray(this.itemsSource)||"function"==typeof this.itemsSourceFunction)&&!this.containsFocus()&&t&&l<0&&(h<0||h!=l)&&!this.isRequired&&!this.isEditable){this._tbx.value="";this.selectedIndex=-1;this.onSelectedIndexChanged()}else{var u=this._delay>0?setTimeout:function(t,e){return t()};this._pendingSearchFn=function(){e._toSearch=null;var i=e.text;if(!e._composing&&i.trim().length>=e._minLength&&i!=e._query){e._query=i.trim();i=wijmo_1.escapeRegExp(i);var o=wijmo_1.escapeHtml(i.trim()),n=e.caseSensitiveSearch?"":"i";e._beginsWith||(n+="g");e._rxSrch=e._beginsWith?new RegExp("^"+i+".*",n):new RegExp("(?=.*"+i.replace(/ /g,")(?=.*")+")",n);e._rxHighlight=e._beginsWith?new RegExp("^"+i,n):new RegExp("("+o.replace(/\s+/g,"|")+")",n);var s=e.itemsSourceFunction;wijmo_1.isFunction(s)?s(e._query,e.maxItems,e._itemsSourceFnCallbackBnd):e._updateItems()}!t.trim().length&&!e.isEditable&&e.indexOf(t,!0)<0&&(e.selectedIndex=-1);-1==e.selectedIndex&&-1!=e._oldSelectedIndex&&e.onSelectedIndexChanged()};this._toSearch=u(this._pendingSearchFn,this._delay)}}else""===this._tbx.value&&t&&(this._tbx.value=t)}};AutoComplete.prototype.onLostFocus=function(e){var i=!1;if(this.isRequired&&!this.isEditable&&this.text&&this.text.length>=this.minLength){i=!0;var o=this.indexOf(this.text,!0);o<0&&(o=this.indexOf(this.text,!1));o>-1&&(this._oldSelectedIndex=o);o<0&&(this._oldSelectedIndex=0)}if(this._toSearch){clearTimeout(this._toSearch);this.text!==this._getDisplayText(void 0,void 0,!0)&&this._pendingSearchFn&&this._pendingSearchFn();i=!1}var n=this.collectionView;if(n&&0===n.items.length){this._oldFilter=n.filter;n.filter=null}t.prototype.onLostFocus.call(this,e,this._oldSelectedIndex,i)};AutoComplete.prototype.onGotFocus=function(e){this._toSearch||(this._oldSelectedIndex=this.selectedIndex);t.prototype.onGotFocus.call(this,e)};AutoComplete.prototype.reset=function(){this._oldSelectedIndex=-1};AutoComplete.prototype._itemSourceFunctionCallback=function(t){this._inCallback=!0;var e=wijmo_1.asCollectionView(t||[]);e.moveCurrentToPosition(-1);this.itemsSource=e;this._inCallback=!1;if(this.containsFocus()){var i=this._tbx,o=i.selectionStart,n=i.selectionEnd,s=this.collectionView;this.isDroppedDown=null!=s&&s.items.length>0;wijmo_1.setSelectionRange(i,o,n);this.refresh()}};AutoComplete.prototype.onIsDroppedDownChanged=function(e){t.prototype.onIsDroppedDownChanged.call(this,e);if(this.containsFocus()&&!this.isTouching){var i=this.collectionView;if(this.selectedIndex<0&&i){var o=i.items,n=this.text;1==o.length&&o[0]==n?this.selectedIndex=0:wijmo_1.setSelectionRange(this._tbx,n.length)}}this._query=""};AutoComplete.prototype._updateItems=function(){var t=this.collectionView;if(t){this._inCallback=!0;t.beginUpdate();this._itemCount=0;t.filter=this._filter.bind(this);t.moveCurrentToPosition(-1);t.endUpdate();this._inCallback=!1;var e=t.items.length,i=this._tbx,o=i.selectionStart,n=i.selectionEnd;this.text.trim()||(e=0);this.isDroppedDown=e>0&&this.containsFocus();e||this.isEditable||(this.selectedIndex=-1);if(1==e&&this.selectedIndex<0){var s=this._getItemText(t.items[0],!1),r=i.value;if(!this.caseSensitiveSearch){s=s.toLowerCase();r=r.toLowerCase()}(s==r||this.trimText&&s.trim()==r)&&(this.selectedIndex=0)}this.isDroppedDown&&wijmo_1.setSelectionRange(i,o,n);this.refresh()}};AutoComplete.prototype._filter=function(t){if(this._itemCount>=this._maxItems&&this._query)return!1;var e=[this._getItemText(t,!1)];this._srchProps&&this._srchProps.forEach((function(i){var o=t[i];null!=o&&e.push(o)}));this.isContentHtml&&(e=e.map((function(t){return t.replace(/(<[^>]*>|&[^;]*;)/g,"")})));for(var i=0;i<e.length;i++)if(this._rxSrch.test(e[i])){this._itemCount++;return!0}return!1};AutoComplete.prototype._getItemText=function(t,e){var i=t?t.toString():"",o=e&&this.headerPath?this._pathHdr:this._lbx._pathDisplay;o&&(i=null!=(i=o.getValue(t))?i.toString():"");return i};AutoComplete.prototype._formatListItem=function(t,e){var i=this;this._cssMatch&&this._rxHighlight&&this._query&&(e.item.innerHTML=e.item.innerHTML.replace(this._rxHighlight,(function(t,e,o,n){return i._enclosed(n,o,"<",">")||i._enclosed(n,o,"&",";")?t:'<span class="'+i._cssMatch+'">'+t+"</span>"})))};AutoComplete.prototype._enclosed=function(t,e,i,o){for(var n=e;n>=0&&t[n]!=o;n--)if(t[n]==i)for(var s=e;s<t.length&&t[s]!=i;s++)if(t[s]==o)return!0;return!1};AutoComplete.prototype._wheel=function(e){t.prototype._wheel.call(this,e)};AutoComplete.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.AutoComplete.ariaLabels.autoComplete};AutoComplete.prototype._hasCustomFormatItem=function(){return this.formatItem.getHandler.length>1};AutoComplete._ctrlTemplate="";return AutoComplete}(ComboBox);exports.AutoComplete=AutoComplete;wijmo_1._addCultureInfo("MultiAutoComplete",{ariaLabels:{multiAutoCompleteInput:"MultiAutoComplete Input",multiAutoComplete:"MultiAutoComplete",multiAutoCompleteHelperInput:"MultiAutoComplete Helper Input",remove:"Remove"}});var MultiAutoComplete=function(t){__extends(MultiAutoComplete,t);function MultiAutoComplete(e,i){var o=t.call(this,e)||this;o._maxSelItems=null;o._lastInputValue="";o._selPath=new wijmo_1.Binding(null);o._notAddItm=!1;o._inputElementAriaLabel=wijmo_1.culture.MultiAutoComplete.ariaLabels.multiAutoCompleteInput;o._helperInputElementAriaLabel=wijmo_1.culture.MultiAutoComplete.ariaLabels.multiAutoCompleteHelperInput;o._ariaLabelledby=null;o.selectedItemsChanged=new wijmo_1.Event;wijmo_1.addClass(o.hostElement,exports.MultiAutoCompleteClsNames.hostElement);o._wjTpl=o.hostElement.querySelector("."+wijmo_1.ControlClsNames.template);o._wjInput=o.hostElement.querySelector("."+exports.InputClsNames.input);o.showDropDownButton=!1;o._selItems=[];o.initialize(i);o.addEventListener(o.hostElement,"keyup",o._keyup.bind(o),!0);o.addEventListener(window,"resize",o._adjustInputWidth.bind(o));o.addEventListener(o._tbx,"focus",(function(){o._itemOff()}));o._addHelperInput();o._addScreenReaderHelper();o._initSeltems();o.listBox.itemsChanged.addHandler((function(){if(-1!==o.selectedIndex){var t=o.collectionView;(t&&("CollectionView"==t.constructor.name||"ODataVirtualCollectionView"==t.constructor.name)||t.virtualization)&&(o.selectedIndex=-1)}}));o._refreshHeader();o._updateTabIndex();o._updateInputAriaLabel();return o}Object.defineProperty(MultiAutoComplete,"controlTemplate",{get:function(){MultiAutoComplete._ctrlTemplate||(MultiAutoComplete._ctrlTemplate=AutoComplete.controlTemplate);return MultiAutoComplete._ctrlTemplate},set:function(t){MultiAutoComplete._ctrlTemplate=t},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"showDropDownButton",{set:function(t){this._showBtn=!1},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"maxSelectedItems",{get:function(){return this._maxSelItems},set:function(t){if(this._maxSelItems!=t){this._maxSelItems=wijmo_1.asNumber(t,!0);this._updateMaxItems();this._refreshHeader();this._clearSelIndex()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"selectedMemberPath",{get:function(){return this._selPath.path},set:function(t){if((t=wijmo_1.asString(t))!==this.selectedMemberPath){this._selPath.path=t;this._initSeltems();this._refreshHeader();this.onSelectedItemsChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"selectedItems",{get:function(){return this._selItems},set:function(t){t=Array.from(new Set(t));var e=this._selItems===t;e||null==this._selItems||null==t||this._selItems.length!==t.length||(e=this._selItems.every((function(e,i){return e===t[i]})));this._selItems=wijmo_1.asArray(t);if(!e){if(this.selectedMemberPath&&""!==this.selectedMemberPath&&this._selItems)for(var i=0;i<this._selItems.length;i++){var o=this._selItems[i];this._setSelItem(o,!1)}this._updateMaxItems();this.onSelectedItemsChanged();this._refreshHeader();this._clearSelIndex()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiAutoComplete.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(t){wijmo_1._setAriaLabelBy(this,this._tbx,t,this._updateInputAndListBoxAriaLabel.bind(this))},enumerable:!0,configurable:!0});MultiAutoComplete.prototype.onSelectedItemsChanged=function(t){this.selectedItemsChanged.raise(this,t)};MultiAutoComplete.prototype.onIsDroppedDownChanged=function(e){!this.isDroppedDown&&this.selectedIndex>-1&&!this._notAddItm&&this._addItem(!0);this._notAddItm=!1;t.prototype.onIsDroppedDownChanged.call(this,e)};MultiAutoComplete.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);if(this.hostElement){this._initSeltems();this.isDroppedDown||this._refreshHeader()}};MultiAutoComplete.prototype._keydown=function(e){if(!this.isReadOnly){if(!e.defaultPrevented)switch(e.keyCode){case wijmo_1.Key.Back:this._lastInputValue=this._tbx.value;break;case wijmo_1.Key.Enter:this._itemOff();this._addItem(!0);wijmo_1.isIE()&&wijmo_1.setSelectionRange(this._tbx,this._tbx.textContent.length,this._tbx.textContent.length);break;case wijmo_1.Key.Tab:if(this.isDroppedDown){this._addItem(!1);this._tbx.value="";this._lbx.selectedIndex=-1;this.isDroppedDown=!1;this.containsFocus()||this.focus();e.preventDefault()}else this._updateFocus();break;case wijmo_1.Key.Space:if(""!==this._tbx.value)return;if(!this.isDroppedDown&&!this._tbx.disabled){this.isDroppedDown=!0;this._clearSelIndex()}break;case wijmo_1.Key.Escape:this.isDroppedDown&&(this._notAddItm=!0);break;case wijmo_1.Key.Left:this._itemOn(!this.rightToLeft);break;case wijmo_1.Key.Right:this._itemOn(!!this.rightToLeft);break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:var i=wijmo_1.getActiveElement();if(e.altKey){if(this._tbx==i){this.isDroppedDown=!this.isDroppedDown;this.isDroppedDown||this._tbx.focus();e.preventDefault();return}}else if(this._tbx!==i)return;default:if(e.keyCode===wijmo_1.Key.Back||e.keyCode===wijmo_1.Key.Delete)return;this._itemOff();null!=this._maxSelItems&&this._selItems.length>=this._maxSelItems&&e.preventDefault()}this._tbx.disabled||t.prototype._keydown.call(this,e)}};MultiAutoComplete.prototype._updateState=function(){t.prototype._updateState.call(this);this._wjTpl&&(wijmo_1.hasClass(this.hostElement,wijmo_1.ControlStateClsNames.focused)||this._itemOff())};MultiAutoComplete.prototype._keyup=function(t){if(!this.isReadOnly&&!t.defaultPrevented)switch(t.keyCode){case wijmo_1.Key.Back:0===this._tbx.value.length&&0===this._lastInputValue.length&&this._delItem(!1);break;case wijmo_1.Key.Delete:this._delItem(!0)}};MultiAutoComplete.prototype._addHelperInput=function(){var t=document.createElement("input");t.type="text";t.tabIndex=-1;t.className=exports.MultiAutoCompleteClsNames.tokenHelper;t.readOnly=!0;wijmo_1.setAttribute(t,"aria-label",this._helperInputElementAriaLabel);this._wjTpl.insertBefore(t,this._wjInput);this._helperInput=t};MultiAutoComplete.prototype._addScreenReaderHelper=function(){var t=document.createElement("div");t.tabIndex=-1;t.className=exports.MultiAutoCompleteClsNames.screenReaderOnly;wijmo_1.setAttribute(t,"aria-live","polite");this._wjTpl.insertBefore(t,this._wjInput);this._screenReaderHelper=t};MultiAutoComplete.prototype._refreshHeader=function(){for(var t=this.hostElement.querySelectorAll("."+exports.MultiAutoCompleteClsNames.token),e=0;e<t.length;e++)this._wjTpl.removeChild(t[e]);var i=this.selectedItems;if(i&&0!==i.length){for(e=0;e<i.length;e++)this._insertToken(i[e]);this._wjInput.style.cssFloat=this.rightToLeft?"right":"left";this._adjustInputWidth()}else{this._wjInput.style.cssFloat=this.rightToLeft?"right":"left";this._adjustInputWidth()}};MultiAutoComplete.prototype._insertToken=function(t){var e=this._getItemText(t,!0);this.isContentHtml||(e=wijmo_1.escapeHtml(e));this._wjTpl.insertBefore(this._createItem(e),this._wjInput)};MultiAutoComplete.prototype._updateMaxItems=function(){null!=this._maxSelItems&&this._selItems&&this._selItems.length>this._maxSelItems&&(this._selItems=this._selItems.slice(0,this._maxSelItems))};MultiAutoComplete.prototype._updateFocus=function(){var t=this,e=this._wjTpl.querySelector("."+MultiAutoComplete._clsActive);if(e){wijmo_1.removeClass(e,MultiAutoComplete._clsActive);setTimeout((function(){t._tbx.focus()}))}else this._clearSelIndex()};MultiAutoComplete.prototype._addItem=function(t){if(this.selectedItems.indexOf(this.selectedItem)>-1)this._clearSelIndex();else if(this.selectedIndex>-1){this._updateSelItems(this.selectedItem,!0);this._refreshHeader();t&&this._clearSelIndex();this._disableInput(!0)}};MultiAutoComplete.prototype._delItem=function(t){var e,i,o=this._wjTpl.querySelector("."+MultiAutoComplete._clsActive),n=!1;if(!t||o){if(o){if((i=this._getItemIndex(o))>-1){e=this._selItems[i];n=!0}}else if(this._selItems.length>0){e=this._selItems[this._selItems.length-1];n=!0}var s=this._getItemText(e,!0),r=wijmo_1.culture.MultiAutoComplete.ariaLabels.remove;this._screenReaderHelper.textContent=r+" "+s;if(n){this._updateSelItems(e,!1);this._refreshHeader();this._clearSelIndex();this._disableInput(!1)}this._tbx.focus()}};MultiAutoComplete.prototype._updateSelItems=function(t,e){if(e){this._selItems&&0!==this._selItems.length||(this._selItems=[]);if(null!=this._maxSelItems&&this._selItems.length>=this._maxSelItems)return;this._selItems.push(t)}else{var i=this._selItems.indexOf(t);this._selItems.splice(i,1)}this._hasSelectedMemeberPath()&&this._setSelItem(t,e);this.onSelectedItemsChanged()};MultiAutoComplete.prototype._createItem=function(t){var e=this,i=document.createElement("div"),o=document.createElement("span"),n=document.createElement("a");i.appendChild(o);i.appendChild(n);i.className=exports.MultiAutoCompleteClsNames.token;o.className=exports.MultiAutoCompleteClsNames.tokenLabel;o.innerHTML=t;n.className=exports.MultiAutoCompleteClsNames.tokenClose;n.href="#";n.tabIndex=-1;n.text="×";i.style.cssFloat=this.rightToLeft?"right":"left";this.addEventListener(i,"click",(function(t){e._helperInput.focus();var o=e._wjTpl.querySelector("."+MultiAutoComplete._clsActive);o&&wijmo_1.removeClass(o,MultiAutoComplete._clsActive);wijmo_1.addClass(i,MultiAutoComplete._clsActive);t.stopPropagation();t.preventDefault()}));this.addEventListener(n,"click",(function(t){if(!e.isReadOnly){var o=e._getItemIndex(i);if(o>-1){var n=e._selItems[o];e._updateSelItems(n,!1)}e._wjTpl.removeChild(i);e._adjustInputWidth();e._disableInput(!1);e._tbx.focus();t.stopPropagation();t.preventDefault()}}));return i};MultiAutoComplete.prototype._itemOn=function(t){var e,i,o,n=wijmo_1.getActiveElement();if((this._tbx!=n||0===this._tbx.value.length)&&0!==(e=this._wjTpl.querySelectorAll("."+exports.MultiAutoCompleteClsNames.token)).length){i=this._wjTpl.querySelector("."+MultiAutoComplete._clsActive);o=this._getItemIndex(i);if(t){if(0===o)return;if(-1===o){wijmo_1.addClass(e[e.length-1],MultiAutoComplete._clsActive);this._helperInput.focus()}else{wijmo_1.removeClass(i,MultiAutoComplete._clsActive);wijmo_1.addClass(e[o-1],MultiAutoComplete._clsActive);this._helperInput.focus()}}else if(!t){if(-1===o)return;if(o!==e.length-1){wijmo_1.removeClass(i,MultiAutoComplete._clsActive);wijmo_1.addClass(e[o+1],MultiAutoComplete._clsActive);this._helperInput.focus()}else{wijmo_1.removeClass(i,MultiAutoComplete._clsActive);this._tbx.focus()}}}};MultiAutoComplete.prototype._itemOff=function(){var t=this._wjTpl.querySelector("."+MultiAutoComplete._clsActive);t&&wijmo_1.removeClass(t,MultiAutoComplete._clsActive)};MultiAutoComplete.prototype._initSeltems=function(){if(this.selectedMemberPath){this._selItems.splice(0,this._selItems.length);var t=this.collectionView;if(t)for(var e=0;e<t.sourceCollection.length;e++)this._getSelItem(e)&&this._selItems.push(t.sourceCollection[e])}};MultiAutoComplete.prototype._getSelItem=function(t){var e=this.collectionView,i=e?e.sourceCollection[t]:null;return!(!wijmo_1.isObject(i)||!this.selectedMemberPath)&&this._selPath.getValue(i)};MultiAutoComplete.prototype._setSelItem=function(t,e){this.itemsSource;wijmo_1.isObject(t)&&this._selPath.getValue(t)!=e&&this._selPath.setValue(t,e)};MultiAutoComplete.prototype._clearSelIndex=function(){this.selectedIndex=-1};MultiAutoComplete.prototype._hasSelectedMemeberPath=function(){return this.selectedMemberPath&&""!==this.selectedMemberPath};MultiAutoComplete.prototype._disableInput=function(t){if(null!=this._maxSelItems)if(this._selItems.length<this._maxSelItems){this._tbx.disabled=!1;this._tbx.focus()}else{this._tbx.disabled=!0;this.hostElement.focus()}};MultiAutoComplete.prototype._adjustInputWidth=function(){this._tbx.style.width="60px";var t,e=wijmo_1.getElementRect(this.hostElement),i=wijmo_1.getElementRect(this._tbx),o=getComputedStyle(this._tbx),n=parseInt(o.paddingLeft,10),s=parseInt(o.paddingRight,10);t=this.rightToLeft?i.left+i.width-e.left-n-s-8:e.left+e.width-i.left-n-s-8;this._tbx.style.width=t+"px"};MultiAutoComplete.prototype._getItemIndex=function(t){for(var e=this.hostElement.querySelectorAll("."+exports.MultiAutoCompleteClsNames.token),i=0;i<e.length;i++)if(t===e[i])return i;return-1};MultiAutoComplete.prototype._setIsDisabled=function(e){t.prototype._setIsDisabled.call(this,e);this._updateTabIndex()};MultiAutoComplete.prototype._setTabOrder=function(t){this._orgTabIndex=t;this._updateTabIndex()};MultiAutoComplete.prototype._updateTabIndex=function(){var t=this.hostElement;this._tbx.tabIndex=this.isDisabled?-1:this._orgTabIndex;t.tabIndex=-1};MultiAutoComplete._clsActive=exports.MultiAutoCompleteClsNames.tokenActive;MultiAutoComplete._ctrlTemplate="";return MultiAutoComplete}(AutoComplete);exports.MultiAutoComplete=MultiAutoComplete;wijmo_1._registerModule("wijmo.input",selfModule);
|