UNPKG

@grapecity/wijmo

Version:

UI library for pure JS, Angular, React, Vue and more...

14 lines (13 loc) • 150 kB
/*! * * Wijmo Library 5.20251.40 * https://developer.mescius.com/wijmo * * Copyright(c) MESCIUS inc. All rights reserved. * * Licensed under the End-User License Agreement For MESCIUS Wijmo Software. * us.sales@mescius.com * https://developer.mescius.com/wijmo/licensing * */ var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}(),__makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t;return e};import*as selfModule from"@grapecity/wijmo";var Binding=function(){function Binding(e){this.path=e}Object.defineProperty(Binding.prototype,"path",{get:function(){return this._path},set:function(e){this._path=e;this._parts=e?e.split("."):[];for(var t=0;t<this._parts.length;t++){var n=this._parts[t],r=n.indexOf("[");if(r>-1){this._parts[t]=n.substr(0,r);this._parts.splice(++t,0,parseInt(n.substr(r+1)))}}this._key=1==this._parts.length?this._parts[0]:null},enumerable:!0,configurable:!0});Binding.prototype.getValue=function(e){if(e){if(this._key)return e[this._key];if(this._path&&this._path in e)return e[this._path];for(var t=0;t<this._parts.length&&e;t++)e=e[this._parts[t]]}return e};Binding.prototype.setValue=function(e,t){if(e)try{var n=this._path;if(n in e){e[n]=t;return e[n]==t}for(var r=0;r<this._parts.length-1;r++)if(null==(e=e[this._parts[r]]))return!1;e[n=this._parts[this._parts.length-1]]=t;return e[n]==t}catch(e){return!1}return!1};return Binding}();export{Binding};var EventHandler=function EventHandler(e,t){this.handler=e;this.self=t},Event=function(){function Event(e){this._handlers=[];this._handlersChanged=e}Event.prototype.addHandler=function(e,t){e=asFunction(e);this._handlers.push(new EventHandler(e,t));isFunction(this._handlersChanged)&&this._handlersChanged()};Event.prototype.getHandler=function(e){void 0===e&&(e=0);var t=this._handlers[e];if(t)return t.handler};Event.prototype.removeHandler=function(e,t){var n=!1;e=asFunction(e);for(var r=0;r<this._handlers.length;r++){var i=this._handlers[r];if(!(i.handler!=e&&null!=e||i.self!=t&&null!=t)){this._handlers.splice(r--,1);n=!0;if(e&&t)break}}n&&isFunction(this._handlersChanged)&&this._handlersChanged()};Event.prototype.removeAllHandlers=function(){var e=this._handlers.length>0;this._handlers.length=0;e&&isFunction(this._handlersChanged)&&this._handlersChanged()};Event.prototype.raise=function(e,t){void 0===t&&(t=EventArgs.empty);for(var n=this._handlers,r=0;r<n.length;r++){var i=n[r];i.handler.call(i.self,e,t);n[r]!==i&&r--}};Object.defineProperty(Event.prototype,"hasHandlers",{get:function(){return this._handlers.length>0},enumerable:!0,configurable:!0});Object.defineProperty(Event.prototype,"handlerCount",{get:function(){return this._handlers.length},enumerable:!0,configurable:!0});return Event}();export{Event};var EventArgs=function(){function EventArgs(){}EventArgs.empty=new EventArgs;return EventArgs}();export{EventArgs};var CancelEventArgs=function(e){__extends(CancelEventArgs,e);function CancelEventArgs(){var t=null!==e&&e.apply(this,arguments)||this;t.cancel=!1;return t}return CancelEventArgs}(EventArgs);export{CancelEventArgs};var PropertyChangedEventArgs=function(e){__extends(PropertyChangedEventArgs,e);function PropertyChangedEventArgs(t,n,r){var i=e.call(this)||this;i._name=t;i._oldVal=n;i._newVal=r;return i}Object.defineProperty(PropertyChangedEventArgs.prototype,"propertyName",{get:function(){return this._name},enumerable:!0,configurable:!0});Object.defineProperty(PropertyChangedEventArgs.prototype,"oldValue",{get:function(){return this._oldVal},enumerable:!0,configurable:!0});Object.defineProperty(PropertyChangedEventArgs.prototype,"newValue",{get:function(){return this._newVal},enumerable:!0,configurable:!0});return PropertyChangedEventArgs}(EventArgs);export{PropertyChangedEventArgs};var RequestErrorEventArgs=function(e){__extends(RequestErrorEventArgs,e);function RequestErrorEventArgs(t,n){var r=e.call(this)||this;r._xhr=t;r._msg=n;return r}Object.defineProperty(RequestErrorEventArgs.prototype,"request",{get:function(){return this._xhr},enumerable:!0,configurable:!0});Object.defineProperty(RequestErrorEventArgs.prototype,"message",{get:function(){return this._msg},set:function(e){this._msg=e},enumerable:!0,configurable:!0});return RequestErrorEventArgs}(CancelEventArgs);export{RequestErrorEventArgs};export var NotifyCollectionChangedAction;!function(e){e[e.Add=0]="Add";e[e.Remove=1]="Remove";e[e.Change=2]="Change";e[e.Reset=3]="Reset"}(NotifyCollectionChangedAction||(NotifyCollectionChangedAction={}));var NotifyCollectionChangedEventArgs=function(e){__extends(NotifyCollectionChangedEventArgs,e);function NotifyCollectionChangedEventArgs(t,n,r){void 0===t&&(t=NotifyCollectionChangedAction.Reset);void 0===n&&(n=null);void 0===r&&(r=-1);var i=e.call(this)||this;i.action=t;i.item=n;i.index=r;return i}NotifyCollectionChangedEventArgs.reset=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset);return NotifyCollectionChangedEventArgs}(EventArgs);export{NotifyCollectionChangedEventArgs};var SortDescription=function(){function SortDescription(e,t){this._bnd=new Binding(e);this._asc=t}Object.defineProperty(SortDescription.prototype,"property",{get:function(){return this._bnd.path},enumerable:!0,configurable:!0});Object.defineProperty(SortDescription.prototype,"ascending",{get:function(){return this._asc},enumerable:!0,configurable:!0});return SortDescription}();export{SortDescription};var PageChangingEventArgs=function(e){__extends(PageChangingEventArgs,e);function PageChangingEventArgs(t){var n=e.call(this)||this;n.newPageIndex=t;return n}return PageChangingEventArgs}(CancelEventArgs);export{PageChangingEventArgs};var GroupDescription=function(){function GroupDescription(){}GroupDescription.prototype.groupNameFromItem=function(e,t){return""};GroupDescription.prototype.namesMatch=function(e,t){return e===t};return GroupDescription}();export{GroupDescription};var PropertyGroupDescription=function(e){__extends(PropertyGroupDescription,e);function PropertyGroupDescription(t,n){var r=e.call(this)||this;r._bnd=new Binding(t);r._converter=n;return r}Object.defineProperty(PropertyGroupDescription.prototype,"propertyName",{get:function(){return this._bnd.path},enumerable:!0,configurable:!0});PropertyGroupDescription.prototype.groupNameFromItem=function(e,t){return this._converter?this._converter(e,this.propertyName):this._bnd.getValue(e)};PropertyGroupDescription.prototype.namesMatch=function(e,t){return e===t};return PropertyGroupDescription}(GroupDescription);export{PropertyGroupDescription};export var empty={};export var ClipboardClsNames={clipboard:"wj-clipboard"};export var ControlClsNames={content:"wj-content",hostElement:"wj-control",template:"wj-template"};export var ControlStateClsNames={active:"wj-state-active",checked:"wj-state-checked",collapsed:"wj-state-collapsed",collapsing:"wj-state-collapsing",disabled:"wj-state-disabled",dragSrc:"wj-state-dragsrc",empty:"wj-state-empty",focus:"wj-state-focus",focused:"wj-state-focused",invalid:"wj-state-invalid",lastSelected:"wj-state-last-selected",loading:"wj-state-loading",match:"wj-state-match",measuring:"wj-state-measuring",multiSelected:"wj-state-multi-selected",pinned:"wj-state-pinned",readOnly:"wj-state-readonly",selected:"wj-state-selected",sticky:"wj-state-sticky",updating:"wj-state-updating"};export var GlyphClsNames={backward:"wj-glyph-backward",btnGlyph:"wj-btn-glyph",calendar:"wj-glyph-calendar",circle:"wj-glyph-circle",clock:"wj-glyph-clock",down:"wj-glyph-down",downLeft:"wj-glyph-down-left",drag:"wj-glyph-drag",file:"wj-glyph-file",filter:"wj-glyph-filter",forward:"wj-glyph-forward",glyph:"wj-glyph",left:"wj-glyph-left",minus:"wj-glyph-minus",plus:"wj-glyph-plus",right:"wj-glyph-right",stepBackward:"wj-glyph-step-backward",stepForward:"wj-glyph-step-forward",up:"wj-glyph-up"};export var InputFormElementsClsNames={btn:"wj-btn",btnDefault:"wj-btn-default",btnGroup:"wj-btn-group",btnGroupVertical:"wj-btn-group-vertical",btnsOutside:"wj-btns-outside",formControl:"wj-form-control",svgBtn:"wj-svg-btn"};export var PrintDocumentClsNames={printDocument:"wj-printdocument"};export var TooltipClsNames={hostElement:"wj-tooltip"};export var UtilitesClsNames={align:"wj-align",alignVCenter:"wj-align-vcenter",animated:"wj-animated",centerVert:"wj-center-vert",close:"wj-close",hide:"wj-hide",hideOk:"wj-hide-ok",remove:"wj-remove",right:"wj-right",rtl:"wj-rtl",separator:"wj-separator"};export var ForeignClsNames={InputClsNames:{input:"wj-input",inputBtnVisible:"wj-input-btn-visible",inputGroup:"wj-input-group",inputGroupBtn:"wj-input-group-btn"},SelectorClsNames:{columnSelector:"wj-column-selector",columnSelectorGroup:"wj-column-selector-group"}};var _agent="undefined"!=typeof navigator?navigator.userAgent:"",_isMobile=null!=_agent.match(/iPad|iPhone|iPod|Android|webOS|BlackBerry|Windows Phone/i);export function isMobile(){return _isMobile}var _isiOS=null!=_agent.match(/iPad|iPhone|iPod/i);export function isiOS(){return _isiOS}var _isFF=null!=_agent.match(/Firefox\//);export function isFirefox(){return _isFF}var _isSafari=null!=_agent.match(/^((?!Chrome|Android).)*safari/i);export function isSafari(){return _isSafari}var _isEdge=null!=_agent.match(/Edge\/|Edg\//);export function isEdge(){return _isEdge}var _isIE=null!=_agent.match(/MSIE |Trident\/|Edge\//);export function isIE(){return _isIE}var _isIE9=!1;export function isIE9(){return _isIE9}var _isIE10=!1;export function isIE10(){return _isIE10}var _isChromiumBased=null;export function isChromiumBased(){if(null!=_isChromiumBased)return _isChromiumBased;_isChromiumBased=!1;var e="undefined"!=typeof navigator?navigator.userAgentData:null;if(e&&e.brands)for(var t=0,n=e.brands;t<n.length;t++){if("Chromium"==n[t].brand){_isChromiumBased=!0;break}}return _isChromiumBased}var _supportsPassive=!1;"undefined"!=typeof document&&document.addEventListener("test",(function(e){}),{get passive(){_supportsPassive=!0;return!0}});export function getEventOptions(e,t){return _supportsPassive?{capture:e,passive:t}:e}var _supportsFocusOptions=!1;"undefined"!=typeof document&&document.createElement("div").focus({get preventScroll(){_supportsFocusOptions=!0;return!0}});export function supportsFocusOptions(){return _supportsFocusOptions}export function _startDrag(e,t){e.effectAllowed=t;isFirefox()&&e.setData("text","")}if("undefined"!=typeof document&&document.doctype){navigator.appVersion.indexOf("MSIE 10")>-1&&(_isIE10=!0);if(navigator.appVersion.indexOf("MSIE 9")>-1){_isIE9=!0;document.addEventListener("mousemove",(function(e){if(1==e.which){var t=closest(e.target,"."+ControlClsNames.hostElement);if(t&&!t.style.cursor)for(var n=e.target;n;n=n.parentElement)if(n.attributes&&n.attributes.draggable){n.dragDrop();return!1}}}))}}if("undefined"!=typeof window){var raf="requestAnimationFrame",caf="cancelAnimationFrame";if(!window[raf]){var expectedTime_1=0;window[raf]=function(e){var t=Date.now(),n=16-(t-expectedTime_1),r=n>0?n:0;expectedTime_1=t+r;return setTimeout((function(){e(expectedTime_1)}),r)};window[caf]=clearTimeout}if(!window.atob){var keys_1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",keysRe_1=new RegExp("[^"+keys_1+"]");window.atob=function(e){var t,n,r,i,o=[],s=0,a=e.length;if(keysRe_1.test(e)||/=/.test(e)&&(/=[^=]/.test(e)||/={3}/.test(e)))throw new Error("Invalid base64 data");a%4>0&&(a=(e+=Array(4-a%4+1).join("=")).length);for(;s<a;){for(n=[],i=s;s<i+4;)n.push(keys_1.indexOf(e.charAt(s++)));r=[((t=(n[0]<<18)+(n[1]<<12)+((63&n[2])<<6)+(63&n[3]))&255<<16)>>16,64===n[2]?-1:(65280&t)>>8,64===n[3]?-1:255&t];for(i=0;i<3;++i)(r[i]>=0||0===i)&&o.push(String.fromCharCode(r[i]))}return o.join("")};window.btoa=function(e){for(var t,n,r=[],i=0,o=e.length;i<o;){t=((n=[e.charCodeAt(i++),e.charCodeAt(i++),e.charCodeAt(i++)])[0]<<16)+((n[1]||0)<<8)+(n[2]||0);r.push(keys_1.charAt((t&63<<18)>>18),keys_1.charAt((258048&t)>>12),keys_1.charAt(isNaN(n[1])?64:(4032&t)>>6),keys_1.charAt(isNaN(n[2])?64:63&t))}return r.join("")}}}var _FocusService=function(){function _FocusService(){this._hasDoc="undefined"!=typeof Document;this._ae=this._nativeAe();var e=window,t=this._onBlur.bind(this),n=this._onFocus.bind(this);e.addEventListener("focusout",t,!0);e.addEventListener("focusin",n,!0);if(!isIE()){e.addEventListener("blur",t,!0);e.addEventListener("focus",n,!0)}}Object.defineProperty(_FocusService.prototype,"activeElement",{get:function(){var e=this._ae,t=this._nativeAe();e===_FocusService._noAe?e=this._ae=t:e!=t&&(this._isSpecialRoot(e)||document.body.contains(e)||(e=this._ae=t));return e!==_FocusService._noAe?e:null},enumerable:!0,configurable:!0});_FocusService.prototype._onBlur=function(e){if(e.isTrusted){var t=e.relatedTarget;this._ae=this._isSpecialRoot(t)?this._nativeAe():t}};_FocusService.prototype._onFocus=function(e){e.isTrusted&&(this._ae=this._nativeAe())};_FocusService.prototype._isSpecialRoot=function(e){return null==e||e===document.body||this._hasDoc&&e instanceof Document};_FocusService.prototype._nativeAe=function(){var e;try{e="unknown"!=typeof document.activeElement?document.activeElement:_FocusService._noAe}catch(t){e=_FocusService._noAe}return e};_FocusService.prototype.dispose=function(){if(!isIE()){window.removeEventListener("blur",this._onBlur,!0);window.removeEventListener("focus",this._onFocus,!0)}window.removeEventListener("focusout",this._onBlur,!0);window.removeEventListener("focusin",this._onFocus,!0)};_FocusService._noAe={};return _FocusService}();export{_FocusService};var _getProxyTarget="undefined"!=typeof window&&window.Symbol?Symbol("_getProxyTarget"):"\t_get\tProxy\tTarget\t";export function _getCalculatedArray(e,t,n){var r=new WeakMap;if(!n){var i={};if(e.length){var o=e[0];for(var s in o){var a=typeof o[s];i[s]="string"==a?"":"number"==a?0:null}n=i}}return new Proxy(e,{get:function(e,i){if(i===_getProxyTarget)return e;if("string"==typeof i||"number"==typeof i){if("indexOf"==i)return function(t,n){var r=e.indexOf(t,n);r<0&&t&&(t=t[_getProxyTarget])&&(r=e.indexOf(t,n));return r};var o=parseInt(i);if(!isNaN(o)){var s=e[o];if(s&&!s[_getProxyTarget]){var a=r.get(s);if(!a){a=_createItemProxy(s,t,n);r.set(s,a)}s=a}return s}}return Reflect.get(e,i)}})}function _createItemProxy(e,t,n){if(!e[_getProxyTarget]){if(isIE())for(var r in t)e[r]=null;var i={get:function(e,r,i){if(r===_getProxyTarget)return e;if("constructor"===r)return function(){return Object.assign({},n||{})};var o=t[r];if(o)switch(typeof o){case"function":return o(i);case"string":return _eval(o,i)}return e[r]}};if(!isIE()){i.ownKeys=function(e){return Object.keys(e).concat(Object.keys(t))};i.getOwnPropertyDescriptor=function(e,n){return n in t?{enumerable:!0,configurable:!0,writable:!1}:Reflect.getOwnPropertyDescriptor(e,n)}}e=new Proxy(e,i)}return e}export function _getTargetObject(e){return(e?e[_getProxyTarget]:null)||e}function _eval(e,t){var n=[t];return(new(Function.bind.apply(Function,[void 0].concat(["$"],["return "+e])))).apply(void 0,n)}var _VERSION="5.20251.40";export var _CLS_STATE_DISABLED=ControlStateClsNames.disabled;export function getVersion(){return _VERSION}export function setLicenseKey(e){Control._licKey=e}export var Key;!function(e){e[e.Back=8]="Back";e[e.Tab=9]="Tab";e[e.Enter=13]="Enter";e[e.Escape=27]="Escape";e[e.Space=32]="Space";e[e.PageUp=33]="PageUp";e[e.PageDown=34]="PageDown";e[e.End=35]="End";e[e.Home=36]="Home";e[e.Left=37]="Left";e[e.Up=38]="Up";e[e.Right=39]="Right";e[e.Down=40]="Down";e[e.Delete=46]="Delete";e[e.X=88]="X";e[e.F1=112]="F1";e[e.F2=113]="F2";e[e.F3=114]="F3";e[e.F4=115]="F4";e[e.F5=116]="F5";e[e.F6=117]="F6";e[e.F7=118]="F7";e[e.F8=119]="F8";e[e.F9=120]="F9";e[e.F10=121]="F10";e[e.F11=122]="F11";e[e.F12=123]="F12";e[e.PlusKey=107]="PlusKey";e[e.EqualPlusKey=187]="EqualPlusKey";e[e.MinusKey=109]="MinusKey";e[e.HyphenMinusKey=189]="HyphenMinusKey";e[e.S=83]="S";e[e.P=80]="P";e[e.F=70]="F"}(Key||(Key={}));export var DataType;!function(e){e[e.Object=0]="Object";e[e.String=1]="String";e[e.Number=2]="Number";e[e.Boolean=3]="Boolean";e[e.Date=4]="Date";e[e.Array=5]="Array"}(DataType||(DataType={}));export function tryCast(e,t){return null==e?null:isString(t)?isFunction(e.implementsInterface)&&e.implementsInterface(t)?e:null:e instanceof t?e:null}export function isPrimitive(e){return isString(e)||isNumber(e)||isBoolean(e)||isDate(e)}export function isString(e){return"string"==typeof e}export function isNullOrWhiteSpace(e){return!e||!/\S/.test(e)}export function isNumber(e){return"number"==typeof e}export function isInt(e){return isNumber(e)&&e==Math.round(e)}export function isBoolean(e){return"boolean"==typeof e}export function isFunction(e){return"function"==typeof e}export function isUndefined(e){return void 0===e}export function isNullOrUndefined(e){return null==e}export function isDate(e){return(e instanceof Date||"[object Date]"===Object.prototype.toString.call(e))&&!isNaN(e.getTime())}export function isArray(e){return e instanceof Array||Array.isArray(e)||"[object Array]"===Object.prototype.toString.call(e)}export function _isPlainArray(e){return Array.isArray(e)}export function isObject(e){return null!=e&&"object"==typeof e&&!isDate(e)&&!isArray(e)}export function isEmpty(e){for(var t in e)return!1;return!0}export function _areObjectsEqual(e,t){var n=Object.entries(e),r=Object.entries(t);if(n.length!==r.length)return!1;for(var i=0,o=n;i<o.length;i++){var s=o[i],a=s[0],l=s[1];if(!t.hasOwnProperty(a)||t[a]!==l)return!1}return!0}export function getUniqueId(e){for(var t=e,n=0;null!=document.getElementById(t);n++)t=e+n;return t}export function uidGenerator(){for(var e="",t="0123456789abcdef".split(""),n=0;n<32;n++){var r=Math.floor(16*Math.random());switch(n){case 8:e+="-";break;case 12:r=4;e+="-";break;case 16:r=3&r|8;e+="-";break;case 20:e+="-"}e+=t[r]}return e}export function mouseToPage(e){if(e instanceof Point)return e;e&&e.touches&&e.touches.length>0&&(e=e.touches[0]);if(isNumber(e.clientX)&&isNumber(e.clientY))return new Point(e.clientX+pageXOffset,e.clientY+pageYOffset);throw"Mouse or touch event expected."}export function getType(e){return isNumber(e)?DataType.Number:isBoolean(e)?DataType.Boolean:isDate(e)?DataType.Date:isString(e)?DataType.String:isArray(e)?DataType.Array:DataType.Object}export function getTypes(e,t){void 0===t&&(t=1e3);if(!e)return[];var n=e.length;(t<=0||n<t)&&(t=n);var r=[];if(t){for(var i=Object.keys(e[0]),o={},s=i.slice(),a=0;a<t;a++){for(var l=e[a],u=s.length-1;u>=0;u--){var c=s[u],h=l[c];if(isPrimitive(h)){var p=Object.getOwnPropertyDescriptor(e[a],c);o[c]={binding:c,dataType:getType(h),isReadOnly:p&&!p.writable&&!p.set};s.splice(u,1)}}if(!s.length)break}for(a=0;a<i.length;a++){var f=o[i[a]];f&&r.push(f)}}return r}export function changeType(e,t,n,r){if(null!=e){var i=DataType;if(isString(e))switch(t){case i.Number:var o=Globalize.parseFloat(e,n);return isNaN(o)?e:o;case i.Date:var s=Globalize.parseDate(e,n,isDate(r)?r:null);s||n||!e||(s=new Date(e));return s&&isFinite(s.getTime())?s:e;case i.Boolean:switch(e.toLowerCase()){case"true":return!0;case"false":return!1}return e;case i.Array:try{var a=e.split(",").map((function(e){return(e=e.trim()).match(/^(\+|\-)?\d+\.?\d*$/)?e:'"'+e+'"'}));return JSON.parse("["+a.join(",")+"]")}catch(e){}}if(t==DataType.String)return Globalize.format(e,n)}return e}export function toFixed(e,t,n){if(n){var r=e.toString(),i=r.indexOf("e"),o=r.indexOf(".");if(i>-1){if("-"===r[i+1]){var s=parseFloat(r.substr(i+2)),a=r.substr(0,i);o>-1&&(a=a.substr(0,o)+a.substr(o+1));r="0."+(Array(s).join("0")+a).substr(0,t);e=parseFloat(r)}}else if(o>-1){r=r.substr(0,o+1+t);e=parseFloat(r)}}else{var l=Math.pow(10,t);e=Math.round(e*l)/l}return e}export function format(e,t,n){if((e=asString(e)).match(/\{.*"count".*:.*"when".*:.*\}/))try{var r=JSON.parse(e);if(isString(r.count)){var i=t[r.count],o=r.when;if(isNumber(i)&&isObject(o)){var s=o[i]||o.other;isString(s)&&(e=s)}}}catch(e){}return e.replace(/\{(.*?)(:(.*?))?\}/g,(function(e,r,i,o){var s=e;if(r&&"{"!=r[0]&&t){s=new Binding(r).getValue(t);o&&(s=Globalize.format(s,o));n&&(s=n(t,r,o,s))}return null==s?"":s}))}export function glbz(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[],r=-1;e[0].forEach((function(t,i){if(i>0&&i!=r){var o=e[i],s=t.match(/^:([a-z][0-9]*\b)/i)||t.match(/^:'(.+?)'/)||t.match(/^:"(.+?)"/);if(s){o=Globalize.format(o,s[1]);t=t.substr(s[0].length)}else if(":"==t&&i<e.length-1&&(isNumber(o)||isDate(o))){o=Globalize.format(o,e[i+1]);t="";r=i+1}n.push(o)}t&&n.push(t)}));return n.join("")}export function evalTemplate(e,t){if(isIE()){return(e=e.replace(/:\${([^}]*)}/g,(function(e,n){return":"+_evalExpression(n,t)}))).replace(/\${([^}]*)}(:(([A-Za-z]\d*)|"([^"]+)"|'([^']+)'))?/g,(function(e,n,r,i,o,s,a){var l=_evalExpression(n,t);return i?Globalize.format(l,o||s||a):l}))}return _evalExpression(e,t)}function _evalExpression(e,t){(t=t||{}).glbz=glbz;var n=parseTpl(e,t);return isIE()?n:glbz(templateObject_1||(templateObject_1=__makeTemplateObject(["",""],["",""])),n)}function get(e,t,n){void 0===n&&(n="${"+e+"}");return e.split(".").reduce((function(e,t){return null!=e&&null!=e[t]?e[t]:n}),t)}function parseTpl(e,t,n){return e.replace(/\$\{.+?}/g,(function(e){return get(e.substr(2,e.length-3).trim(),t,n)}))}export function clamp(e,t,n){if(null!=e){null!=n&&e>n&&(e=n);null!=t&&e<t&&(e=t)}return e}export function copy(e,t,n,r){void 0===n&&(n=!0);void 0===r&&(r=!1);if(t)for(var i in t)if("_"!=i[0]){assert(i in e,'Unknown property "'+i+'".');var o=t[i];if(!e._copy||!e._copy(i,o)){var s=e[i];e[i]instanceof Event?isFunction(o)&&e[i].addHandler(o):!n||!isObject(o)||"undefined"!=typeof Element&&o instanceof Element||!s||!isObject(s)||Object.getPrototypeOf(s).constructor==Object.prototype.constructor&&isWritable(e,i)||"itemsSource"==i?r&&isObject(o)&&Object.getPrototypeOf(o).isPrototypeOf(Object)&&isObject(s)&&!Object.getPrototypeOf(s).isPrototypeOf(Object)?copy(s,o):e[i]=o:copy(s,o)}}return e}export function _isPlainObject(e){return isObject(e)&&Object.getPrototypeOf(e).isPrototypeOf(Object)}export function isWritable(e,t){var n=Object.getOwnPropertyDescriptor(e,t)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||{};return!!n.writable||isFunction(n.set)}export function deepClone(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e)){return e.map((function(e){return deepClone(e)}))}var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=deepClone(e[n]));return t}export function assert(e,t,n){void 0===n&&(n=!0);if(!e){t="** Assertion failed in Wijmo: "+t;var r=new Error;isString(r.stack)&&n&&(t+=" "+r.stack);throw t}}export function _deprecated(e,t){console.error('** WARNING: "'+e+'" has been deprecated; please use "'+t+'" instead.')}export function _warning(e){console.error('** WARNING: "'+e)}export function asString(e,t){void 0===t&&(t=!0);isUndefined(e)&&(e=null);assert(t&&null==e||isString(e),"String expected.");return e}export function asNumber(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!1);assert(t&&null==e||isNumber(e),"Number expected.");if(n&&e&&e<0)throw"Positive number expected.";return e}export function asInt(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!1);assert(t&&null==e||isInt(e),"Integer expected.");if(n&&e&&e<0)throw"Positive integer expected.";return e}export function asBoolean(e,t){void 0===t&&(t=!1);assert(t&&null==e||isBoolean(e),"Boolean expected.");return e}export function asDate(e,t){void 0===t&&(t=!1);if(isString(e)){var n=changeType(e,DataType.Date,"r");isDate(n)&&(e=n)}assert(t&&null==e||isDate(e),"Date expected.");return e}export function asFunction(e,t){void 0===t&&(t=!0);assert(t&&null==e||isFunction(e),"Function expected.");return e}export function asArray(e,t){void 0===t&&(t=!0);assert(t&&null==e||isArray(e),"Array expected.");return e}export function asType(e,t,n){void 0===n&&(n=!1);e=tryCast(e,t);assert(n||null!=e,t+" expected.");return e}export function asEnum(e,t,n){void 0===n&&(n=!1);if(null==e&&n)return null;var r=isString(e)?t[e]:e;assert(null!=r,'Invalid enum value: "'+e+'"');return isNumber(r)?r:e}export function asCollectionView(e,t){void 0===t&&(t=!0);if(null==e&&t)return null;var n=tryCast(e,"ICollectionView");if(null!=n)return n;isArray(e)||assert(!1,"Array or ICollectionView expected.");return new CollectionView(e)}export function hasItems(e){return null!=e&&null!=e.items&&e.items.length>0}export function toHeaderCase(e){return e&&e.length?e[0].toUpperCase()+e.substr(1).replace(/([a-z])([A-Z])/g,"$1 $2"):""}export function escapeHtml(e){e&&isString(e)&&(e=e.replace(/[&<>]/g,(function(e){return _ENTITYMAP[e]})));return null!=e?e.toString():""}var _plainText,_ENTITYMAP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},_specialCharsRegex=/"(.*?)"|[^\w]|_/g;export function getSpecialCharsRegex(){return _specialCharsRegex}export function escapeRegExp(e){return e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}export function toPlainText(e){var t=asString(e);if(isString(t)&&t.indexOf("<")>-1){_plainText||(_plainText=document.createElement("div"));_plainText.innerHTML=t;t=_plainText.textContent}return t}export function hasClass(e,t){if(e&&t){if(e instanceof HTMLElement&&e.classList&&!isIE9())return e.classList.contains(t);if(e.getAttribute){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");return e&&n.test(e.getAttribute("class"))}}return!1}export function addClass(e,t){if(e&&t){if(e instanceof HTMLElement&&e.classList&&!isIE9()){t.indexOf(" ")<0?e.classList.add(t):t.split(" ").forEach((function(t){e.classList.add(t)}));return}e.setAttribute&&t.split(" ").forEach((function(t){if(!hasClass(e,t)){var n=e.getAttribute("class");e.setAttribute("class",n?n+" "+t:t)}}))}}export function removeClass(e,t){if(e&&t){if(e instanceof HTMLElement&&e.classList&&!isIE9()){t.indexOf(" ")<0?e.classList.remove(t):t.split(" ").forEach((function(t){e.classList.remove(t)}));0===e.classList.length&&e.removeAttribute("class");return}e.setAttribute&&t.split(" ").forEach((function(t){if(hasClass(e,t)){var n=new RegExp("((\\s|^)"+t+"(\\s|$))","g"),r=e.getAttribute("class");(r=r.replace(n," ").replace(/ +/g," ").trim())?e.setAttribute("class",r):e.removeAttribute("class")}}))}}export function toggleClass(e,t,n){null==n&&(n=!hasClass(e,t));n?addClass(e,t):removeClass(e,t)}export function setAttribute(e,t,n,r){e&&(null!=n?r&&e.getAttribute(t)||e.setAttribute(t,n.toString()):e.removeAttribute(t))}export function setChecked(e,t){var n=null==t;e.checked=isIE()?t||n:t;e.indeterminate=n}export function setAriaLabel(e,t){setAttribute(e,"aria-label",t)}export function setSelectionRange(e,t,n,r){void 0===n&&(n=t);void 0===r&&(r=!0);assert(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement,"INPUT or TEXTAREA element expected");if(contains(document.body,e)&&!e.disabled&&e.offsetHeight){try{e.setSelectionRange(t,n,"backward")}catch(e){}if(r)try{e.focus();return!0}catch(e){}}return!1}export function disableAutoComplete(e){var t="autocomplete",n=e.getAttribute(t);n&&"on"!=n||e.setAttribute(t,"off");"autocorrect,autocapitalize,spellcheck".split(",").forEach((function(t){e.setAttribute(t,"spellcheck"==t?"false":"off")}))}export function removeChild(e){return e&&e.parentNode?e.parentNode.removeChild(e):null}export function getActiveElement(){var e=document.activeElement;if(e){var t=e.shadowRoot;t&&t.activeElement&&(e=t.activeElement)}return e}export function _getActiveElement(e){var t=e;if(t){var n=t.shadowRoot;n&&n.activeElement&&(t=n.activeElement)}return t}export function moveFocus(e,t){var n=_getFocusableElements(e,t<0),r=0;if(t){var i=n.indexOf(getActiveElement());i>-1&&(r=(i+t+n.length)%n.length)}if(r<n.length){var setFocusToEl_1=function(){var e=n[r];e.focus();e instanceof HTMLInputElement&&e.select()};isFirefox()?requestAnimationFrame((function(){setFocusToEl_1()})):setFocusToEl_1();return!0}return!1}export function _getFocusableElements(e,t){void 0===t&&(t=!1);var n=[],r=Array.prototype.slice.call(e.querySelectorAll("input,select,textarea,button,a,div,label,[tabindex]")),i={};r=r.filter((function(e){return-1!==e.tabIndex}));var isRb=function(e){return e instanceof HTMLInputElement&&"radio"===e.type};r.forEach((function(e){isRb(e)&&e.checked&&(i[e.name||""]=!0)}));(r=r.filter((function(e){return!isRb(e)||e.checked||!i[e.name||""]}))).sort((function(e,t){return e.tabIndex===t.tabIndex?0:0===e.tabIndex?1:0===t.tabIndex?-1:e.tabIndex-t.tabIndex}));for(var o=0;o<r.length;o++){var s=r[o];if(s.offsetHeight>0&&s.tabIndex>-1&&!s.disabled&&"hidden"!==window.getComputedStyle(s).visibility&&!closest(s,"[disabled],."+ControlStateClsNames.disabled)){if(s instanceof HTMLAnchorElement&&!s.hasAttribute("href"))continue;if(isIE()&&!s.hasAttribute("tabindex")){if(s instanceof HTMLDivElement)continue;var a=Control.getControl(closest(s,".wj-flexgrid"));if(a&&0==a.keyActionTab)continue}if("radio"===s.type&&!s.checked&&n.length>0){var l=n[n.length-1],u=getActiveElement();if("radio"===l.type&&l.name===s.name){t&&l!=u&&(n[n.length-1]=s);continue}}(Control.getControl(s)||!_getFocusableElements(s).length||s.classList.contains("wj-detail"))&&n.push(s)}}return n}export function saveFile(e,t,n){void 0===n&&(n="text/plain");var r=e instanceof Blob;r||!n.match(/\bcsv\b/i)&&!t.match(/\.csv$/i)||(e="\ufeff"+e);var i=r?e:new Blob([e],{type:n}),o=navigator;if(isFunction(o.msSaveOrOpenBlob))o.msSaveOrOpenBlob(i,t);else{var s=document.createElement("a"),click=function(e){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null);e.dispatchEvent(t)};if("download"in s){var a=window.URL||window.webkitURL,l=a.createObjectURL(i);s.href=l;s.target="_blank";s.download=t;click(s);s=null;window.setTimeout((function(){a.revokeObjectURL(l)}),3e4)}else{var u=new FileReader;u.onloadend=function(){s.href=u.result;s.download=t;click(s);s=null};u.readAsDataURL(i)}}}export function getElement(e){if(e instanceof Element||e&&e.appendChild&&e.appendChild instanceof Function)return e;if(isString(e))try{return document.querySelector(e)}catch(e){}return e&&e.jquery?e[0]:null}function processStyleProperty(e){var t=(e=e.replace(";base64,","_wj_")).split(";"),n=[];t.forEach((function(e){var t=[];e.indexOf("_wj_")>-1?2==(t=(e=e.replace("_wj_",";base64,").replace("data:image","_wjimg_")).split(":")).length&&(t[1]=t[1].replace("_wjimg_","data:image")):t=e.split(":");n.push(t)}));return n}export function createElement(e,t,n){e=e.replace(/\bstyle\s*=\s*"/g,'_wj-style="');var r=document.createElement("div");r.innerHTML=e;if(e.indexOf("_wj-style")>-1)for(var i=r.querySelectorAll("[_wj-style]"),_loop_1=function(e){var t=i[e],n=t.getAttribute("_wj-style"),r=[];if(n.indexOf(";base64,")>-1)r=processStyleProperty(n);else{n.split(";").forEach((function(e){r.push(e.split(":"))}))}r.forEach((function(e){2==e.length&&(t.style[e[0].trim()]=e[1].trim())}));t.removeAttribute("_wj-style")},o=0;o<i.length;o++)_loop_1(o);1==r.children.length&&(r=r.children[0]);n&&setCss(r,n);t&&(t=getElement(t)).appendChild(r);return r}export function setText(e,t){e.textContent=t||""}export function contains(e,t,n){for(var r=t;r&&e;){if(r===e)return!0;r=(n?r[Control._OWNR_KEY]:null)||r.parentNode||r.host}return!1}export function closest(e,t){if(e){if(isFunction(e.closest))return e.closest(t);var n=e.matches||e.webkitMatchesSelector||e.msMatchesSelector||e.mozMatchesSelector;if(n)for(;e&&1===e.nodeType;e=e.parentElement||e.parentNode)if(n.call(e,t))return e}return null}export function closestClass(e,t){return closest(e,"."+t)}export function enable(e,t){var n=!t,r="disabled";toggleClass(e,ControlStateClsNames.disabled,n);setAttribute(e,r,n?r:null);for(var i=e.querySelectorAll("input,button"),o=0;o<i.length;o++)setAttribute(i[o],r,n?r:null)}export function getElementRect(e){var t=e.getBoundingClientRect();return new Rect(t.left+pageXOffset,t.top+pageYOffset,t.width,t.height)}export function setCss(e,t){assert(isObject(t),"css parameter should be an object");if(e instanceof Array)for(var n=0;n<e.length;n++)setCss(e[n],t);else if(e&&e.style){var r=e.style;for(var i in t){var o=t[i];"number"==typeof o&&i.match(/width|height|left|top|right|bottom|size|padding|margin'/i)&&(o+="px");r[i]!==o&&(r[i]=o)}}}export function animate(e,t,n){null==t&&(t=Control._ANIM_DEF_DURATION);null==n&&(n=Control._ANIM_DEF_STEP);e=asFunction(e);t=asNumber(t,!1,!0);n=asNumber(n,!1,!0);var r,i=Date.now(),o=setInterval((function(){var n=Math.min(1,(Date.now()-i)/t);n=Math.sin(n*Math.PI/2);n*=n;r&&cancelAnimationFrame(r);r=requestAnimationFrame((function(){r=null;e(n)}));n>=1&&clearInterval(o)}),n);return o}var Point=function(){function Point(e,t){void 0===e&&(e=0);void 0===t&&(t=0);this.x=asNumber(e);this.y=asNumber(t)}Point.prototype.equals=function(e,t,n){void 0===t&&(t=0);void 0===n&&(n=0);return e instanceof Point&&Math.abs(this.x-e.x)<=t&&Math.abs(this.y-e.y)<=n};Point.prototype.clone=function(){return new Point(this.x,this.y)};return Point}();export{Point};var Size=function(){function Size(e,t){void 0===e&&(e=0);void 0===t&&(t=0);this.width=asNumber(e);this.height=asNumber(t)}Size.prototype.equals=function(e){return e instanceof Size&&this.width==e.width&&this.height==e.height};Size.prototype.clone=function(){return new Size(this.width,this.height)};return Size}();export{Size};var Rect=function(){function Rect(e,t,n,r){this.left=asNumber(e);this.top=asNumber(t);this.width=asNumber(n);this.height=asNumber(r)}Object.defineProperty(Rect.prototype,"right",{get:function(){return this.left+this.width},enumerable:!0,configurable:!0});Object.defineProperty(Rect.prototype,"bottom",{get:function(){return this.top+this.height},enumerable:!0,configurable:!0});Rect.prototype.equals=function(e){return e instanceof Rect&&this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height};Rect.prototype.clone=function(){return new Rect(this.left,this.top,this.width,this.height)};Rect.fromBoundingRect=function(e){if(null!=e.left)return new Rect(e.left,e.top,e.width,e.height);if(null!=e.x)return new Rect(e.x,e.y,e.width,e.height);assert(!1,"Invalid source rectangle.")};Rect.union=function(e,t){var n=Math.min(e.left,t.left),r=Math.min(e.top,t.top);return new Rect(n,r,Math.max(e.right,t.right)-n,Math.max(e.bottom,t.bottom)-r)};Rect.intersection=function(e,t){var n=Math.max(e.left,t.left),r=Math.max(e.top,t.top);return new Rect(n,r,Math.min(e.right,t.right)-n,Math.min(e.bottom,t.bottom)-r)};Rect.prototype.contains=function(e){if(e instanceof Point)return e.x>=this.left&&e.x<=this.right&&e.y>=this.top&&e.y<=this.bottom;if(e instanceof Rect){var t=e;return t.left>=this.left&&t.right<=this.right&&t.top>=this.top&&t.bottom<=this.bottom}assert(!1,"Point or Rect expected.")};Rect.prototype.inflate=function(e,t,n,r){return null!=n&&null!=r?new Rect(this.left-e,this.top-t,this.width+e+n,this.height+t+r):new Rect(this.left-e,this.top-t,this.width+2*e,this.height+2*t)};return Rect}();export{Rect};var DateTime=function(){function DateTime(){}DateTime.addDays=function(e,t){(e=new Date(e.getTime())).setDate(e.getDate()+t);return e};DateTime.addMonths=function(e,t){var n=(e=new Date(e.getTime())).getDate();e.setMonth(e.getMonth()+t);e.getDate()!=n&&e.setDate(0);return e};DateTime.addYears=function(e,t){(e=new Date(e.getTime())).setFullYear(e.getFullYear()+t);return e};DateTime.addHours=function(e,t){(e=new Date(e.getTime())).setHours(e.getHours()+t);return e};DateTime.addMinutes=function(e,t){(e=new Date(e.getTime())).setMinutes(e.getMinutes()+t);return e};DateTime.addSeconds=function(e,t){(e=new Date(e.getTime())).setSeconds(e.getSeconds()+t);return e};DateTime.weekFirst=function(e,t){void 0===t&&(t=Globalize.getFirstDayOfWeek());return DateTime.addDays(e,-(e.getDay()-t))};DateTime.weekLast=function(e,t){void 0===t&&(t=Globalize.getFirstDayOfWeek());e=DateTime.weekFirst(e,t);return DateTime.addDays(e,6)};DateTime.monthFirst=function(e){return DateTime.addDays(e,1-e.getDate())};DateTime.monthLast=function(e){e=DateTime.monthFirst(e);e=DateTime.addMonths(e,1);return DateTime.addDays(e,-1)};DateTime.yearFirst=function(e){return new Date(e.getFullYear(),0,1)};DateTime.yearLast=function(e){return new Date(e.getFullYear(),11,31)};DateTime.sameDate=function(e,t){return isDate(e)&&isDate(t)&&e.getFullYear()==t.getFullYear()&&e.getMonth()==t.getMonth()&&e.getDate()==t.getDate()};DateTime.sameTime=function(e,t){return isDate(e)&&isDate(t)&&e.getHours()==t.getHours()&&e.getMinutes()==t.getMinutes()&&e.getSeconds()==t.getSeconds()&&e.getMilliseconds()==t.getMilliseconds()};DateTime.equals=function(e,t){return null==e&&null==t||isDate(e)&&isDate(t)&&e.getTime()==t.getTime()};DateTime.fromDateTime=function(e,t){if(!e&&!t)return null;e||(e=t);t||(t=e);return DateTime.newDate(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())};DateTime.toFiscal=function(e,t){var n=culture.Globalize.calendar;return isArray(n.fiscalYearOffsets)?DateTime.addMonths(e,-n.fiscalYearOffsets[t?0:1]):e};DateTime.fromFiscal=function(e,t){var n=culture.Globalize.calendar;return isArray(n.fiscalYearOffsets)?DateTime.addMonths(e,+n.fiscalYearOffsets[t?0:1]):e};DateTime.newDate=function(e,t,n,r,i,o,s){if(null==e||null==t||null==n){var a=new Date;null==e&&(e=a.getFullYear());null==t&&(t=a.getMonth());null==n&&(n=a.getDate())}null==r&&(r=0);null==i&&(i=0);null==o&&(o=0);null==s&&(s=0);var l=new Date(e,t,n,r,i,o,s),u=l.getFullYear();e<100&&u>=1900&&l.setFullYear(l.getFullYear()-1900);return l};DateTime.clone=function(e){return DateTime.fromDateTime(e,e)};return DateTime}();export{DateTime};export function httpRequest(e,t){var n=t||{},r=n.method?asString(n.method).toUpperCase():"GET",i=null==n.async||asBoolean(n.async),o=n.data;if(null!=o&&"GET"==r){var s=[];for(var a in o){var l=o[a];isDate(l)&&(l=l.toJSON());s.push(a+"="+encodeURIComponent(l))}if(s.length){var u=e.indexOf("?")<0?"?":"&";e+=u+s.join("&")}o=null}var c=new XMLHttpRequest;c.URL_DEBUG=e;var h=!1;if(null!=o&&!isString(o)){h=isObject(o);o=JSON.stringify(o)}c.onload=function(){if(4==c.readyState){c.status<300?n.success&&asFunction(n.success)(c):n.error&&asFunction(n.error)(c);n.complete&&asFunction(n.complete)(c)}};c.onerror=function(){if(!isFunction(n.error))throw"HttpRequest Error: "+c.status+" "+c.statusText;n.error(c)};c.open(r,e,i,n.user,n.password);n.user&&n.password&&c.setRequestHeader("Authorization","Basic "+btoa(n.user+":"+n.password));h&&function(){for(var e in n.requestHeaders)if("content-type"===e.toLowerCase())return!1;return!0}()&&c.setRequestHeader("Content-Type","application/json");if(n.requestHeaders)for(var p in n.requestHeaders)c.setRequestHeader(p,n.requestHeaders[p]);isNumber(n.timeout)&&(c.timeout=n.timeout);isFunction(n.beforeSend)&&n.beforeSend(c);c.send(o);return c}var _modules={};export function _registerModule(e,t){_modules[e]=t;if("wijmo"===e){var n="undefined"!=typeof window?window:"undefined"!=typeof self?self:null;n&&(n.wijmo=t)}}export function _getModule(e){return _modules[e]}export function focusFirst(e,t){var n=e.querySelectorAll(t||'button, [href], input, [tabindex]:not([tabindex="-1"])'),r=Array.from(n).filter((function(e){return e.offsetWidth>0&&e.offsetHeight>0&&!e.hasAttribute("disabled")&&e.tabIndex>=0}));if(r.length>0){r[0].focus();return!0}return!1}export var cellCoordinateParserRegex=new RegExp(/(\'?\w+\'?\!)?(\$?[A-Za-z]+)(\$?\d+)/,"g");export function getScrollableParent(e){for(var t=document.scrollingElement,n="absolute"==getComputedStyle(e).position?e.offsetParent:e.parentElement;n&&n!=t;){if(n.clientHeight!=n.scrollHeight)return n;e=n="absolute"==getComputedStyle(n).position?n.offsetParent:n.parentElement}return t}export function getOffsetFromAncestor(e,t){for(var n=0,r=0,i=0,o=0;e;){r+=e.offsetLeft;n+=e.offsetTop;e=e.offsetParent}for(;t;){o+=t.offsetLeft;i+=t.offsetTop;t=t.offsetParent}return{top:n-i,left:r-o}}export function _isMacOS(){return-1!==navigator.userAgent.indexOf("Mac")}export function _setAriaLabelBy(e,t,n,r){var i=""===n?null:n;if(i!==e.ariaLabelledBy){e._ariaLabelledby=i;setAttribute(t,"aria-labelledby",i);r&&r()}}var _Map=function(){function _Map(e){void 0===e&&(e=!0);if(e)this._h={};else{var t=_getGlobal(),n=t&&t.Map;this._m=n&&new Map||new _ArrayMap}}Object.defineProperty(_Map.prototype,"isPojoHash",{get:function(){return null!=this._h},enumerable:!0,configurable:!0});Object.defineProperty(_Map.prototype,"size",{get:function(){return this._h&&Object.keys(this._h).length||this._m.size},enumerable:!0,configurable:!0});_Map.prototype.clear=function(){this._h?this._h={}:this._m.clear()};_Map.prototype.delete=function(e){this._h?delete this._h[e]:this._m.delete(e)};_Map.prototype.get=function(e){return this._h?this._h[e]:this._m.get(e)};_Map.prototype.has=function(e){return this._h?e in this._h:this._m.has(e)};_Map.prototype.set=function(e,t){this._h?this._h[e]=t:this._m.set(e,t);return this};return _Map}();export{_Map};var _ArrayMap=function(){function _ArrayMap(){this._d=[]}Object.defineProperty(_ArrayMap.prototype,"size",{get:function(){return this._d.length},enumerable:!0,configurable:!0});_ArrayMap.prototype.clear=function(){this._d=[]};_ArrayMap.prototype.delete=function(e){var t=this._kIdx(e);if(t>-1){this._d.splice(t,1);return!0}return!1};_ArrayMap.prototype.get=function(e){var t=this._kIdx(e);return t>-1?this._d[t].v:void 0};_ArrayMap.prototype.has=function(e){return this._kIdx(e)>-1};_ArrayMap.prototype.set=function(e,t){var n=this._kIdx(e);n>-1?this._d[n].v=t:this._d.push({k:e,v:t});return this};_ArrayMap.prototype._kIdx=function(e){var t=this._d,n=t.length;if(e==e){for(var r=0;r<n;r++)if(t[r].k===e)return r}else for(r=0;r<n;r++){var i=t[r].k;if(i!=i)return r}return-1};return _ArrayMap}();function _getGlobal(){var e=null;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self);return e}var Color=function(){function Color(e){this._r=0;this._g=0;this._b=0;this._a=1;e&&this._parse(e)}Object.defineProperty(Color.prototype,"r",{get:function(){return this._r},set:function(e){this._r=clamp(asNumber(e),0,255)},enumerable:!0,configurable:!0});Object.defineProperty(Color.prototype,"g",{get:function(){return this._g},set:function(e){this._g=clamp(asNumber(e),0,255)},enumerable:!0,configurable:!0});Object.defineProperty(Color.prototype,"b",{get:function(){return this._b},set:function(e){this._b=clamp(asNumber(e),0,255)},enumerable:!0,configurable:!0});Object.defineProperty(Color.prototype,"a",{get:function(){return this._a},set:function(e){this._a=clamp(asNumber(e),0,1)},enumerable:!0,configurable:!0});Color.prototype.equals=function(e){return e instanceof Color&&this.r==e.r&&this.g==e.g&&this.b==e.b&&this.a==e.a};Color.prototype.toString=function(){var e=Math.round(100*this.a);return e>99?"#"+((1<<24)+(this.r<<16)+(this.g<<8)+this.b).toString(16).slice(1):"rgba("+this.r+","+this.g+","+this.b+","+e/100+")"};Color.fromRgba=function(e,t,n,r){void 0===r&&(r=1);var i=new Color(null);i.r=Math.round(clamp(asNumber(e),0,255));i.g=Math.round(clamp(asNumber(t),0,255));i.b=Math.round(clamp(asNumber(n),0,255));i.a=clamp(asNumber(r),0,1);return i};Color.fromHsb=function(e,t,n,r){void 0===r&&(r=1);var i=Color._hsbToRgb(clamp(asNumber(e),0,1),clamp(asNumber(t),0,1),clamp(asNumber(n),0,1));return Color.fromRgba(i[0],i[1],i[2],r)};Color.fromHsl=function(e,t,n,r){void 0===r&&(r=1);var i=Color._hslToRgb(clamp(asNumber(e),0,1),clamp(asNumber(t),0,1),clamp(asNumber(n),0,1));return Color.fromRgba(i[0],i[1],i[2],r)};Color.fromString=function(e){var t=new Color(null);return t._parse(asString(e))?t:null};Color.prototype.getHsb=function(){return Color._rgbToHsb(this.r,this.g,this.b)};Color.prototype.getHsl=function(){return Color._rgbToHsl(this.r,this.g,this.b)};Color.interpolate=function(e,t,n){n=clamp(asNumber(n),0,1);var r=Color._rgbToHsl(e.r,e.g,e.b),i=Color._rgbToHsl(t.r,t.g,t.b),o=1-n,s=e.a*o+t.a*n,a=[r[0]*o+i[0]*n,r[1]*o+i[1]*n,r[2]*o+i[2]*n],l=Color._hslToRgb(a[0],a[1],a[2]);return Color.fromRgba(l[0],l[1],l[2],s)};Color.toOpaque=function(e,t){if(1==(e=isString(e)?Color.fromString(e):asType(e,Color)).a)return e;t=null==t?Color.fromRgba(255,255,255,1):isString(t)?Color.fromString(t):asType(t,Color);var n=e.a,r=1-n;return Color.fromRgba(e.r*n+t.r*r,e.g*n+t.g*r,e.b*n+t.b*r)};Color.prototype._parse=function(e){if("transparent"==(e=e.toLowerCase())){this._r=this._g=this._b=this._a=0;return!0}if(e&&0!=e.indexOf("#")&&0!=e.indexOf("rgb")&&0!=e.indexOf("hsl")){var t=document.createElement("div");t.style.color=e;var n=t.style.color;if(n==e&&!(n=window.getComputedStyle(t).color)){document.body.appendChild(t);n=window.getComputedStyle(t).color;removeChild(t)}e=n.toLowerCase()}if(0==e.indexOf("#")){if(this._isValidHexColor(e)){if(4==e.length){this.r=parseInt(e[1]+e[1],16);this.g=parseInt(e[2]+e[2],16);this.b=parseInt(e[3]+e[3],16);this.a=1;return!0}if(7==e.length){this.r=parseInt(e.substr(1,2),16);this.g=parseInt(e.substr(3,2),16);this.b=parseInt(e.substr(5,2),16);this.a=1;return!0}}return!1}if(0==e.indexOf("rgb")){var r=e.indexOf("("),i=e.indexOf(")");if(r>-1&&i>-1){if((o=e.substr(r+1,i-(r+1)).split(",")).length>2){this.r=parseInt(o[0]);this.g=parseInt(o[1]);this.b=parseInt(o[2]);this.a=o.length>3?parseFloat(o[3]):1;return!0}}}if(0==e.indexOf("hsl")){r=e.indexOf("("),i=e.indexOf(")");if(r>-1&&i>-1){var o;if((o=e.substr(r+1,i-(r+1)).split(",")).length>2){var s=parseInt(o[0])/360,a=parseInt(o[1]),l=parseInt(o[2]);o[1].indexOf("%")>-1&&(a/=100);o[2].indexOf("%")>-1&&(l/=100);var u=Color._hslToRgb(s,a,l);this.r=u[0];this.g=u[1];this.b=u[2];this.a=o.length>3?parseFloat(o[3]):1;return!0}}}return!1};Color.prototype._isValidHexColor=function(e){return/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)};Color._hslToRgb=function(e,t,n){assert(e>=0&&e<=1&&t>=0&&t<=1&&n>=0&&n<=1,"bad HSL values");var r,i,o;if(0==t)r=i=o=n;else{var s=n<.5?n*(1+t):n+t-n*t,a=2*n-s;r=Color._hue2rgb(a,s,e+1/3);i=Color._hue2rgb(a,s,e);o=Color._hue2rgb(a,s,e-1/3)}return[Math.round(255*r),Math.round(255*i),Math.round(255*o)]};Color._hue2rgb=function(e,t,n){n<0&&(n+=1);n>1&&(n-=1);return n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e};Color._rgbToHsl=function(e,t,n){assert(e>=0&&e<=255&&t>=0&&t<=255&&n>=0&&n<=255,"bad RGB values");e/=255,t/=255,n/=255;var r,i,o=Math.max(e,t,n),s=Math.min(e,t,n),a=(o+s)/2;if(o==s)r=i=0;else{var l=o-s;i=a>.5?l/(2-o-s):l/(o+s);switch(o){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return[r,i,a]};Color._rgbToHsb=function(e,t,n){assert(e>=0&&e<=255&&t>=0&&t<=255&&n>=0&&n<=255,"bad RGB values");var r=Color._rgbToHsl(e,t,n);return Color._hslToHsb(r[0],r[1],r[2])};Color._hsbToRgb=function(e,t,n){var r=Color._hsbToHsl(e,t,n);return Color._hslToRgb(r[0],r[1],r[2])};Color._hsbToHsl=function(e,t,n){assert(e>=0&&e<=1&&t>=0&&t<=1&&n>=0&&n<=1,"bad HSB values");var r=clamp(n*(2-t)/2,0,1),i=1-Math.abs(2*r-1),o=clamp(i>0?n*t/i:t,0,1);assert(!isNaN(r)&&!isNaN(o),"bad conversion to HSL");return[e,o,r]};Color._hslToHsb=function(e,t,n){assert(e>=0&&e<=1&&t>=0&&t<=1&&n>=0&&n<=1,"bad HSL values");var r=clamp(1==n?1:(2*n+t*(1-Math.abs(2*n-1)))/2,0,1),i=clamp(r>0?2*(r-n)/r:t,0,1);assert(!isNaN(r)&&!isNaN(i),"bad conversion to HSB");return[e,i,r]};return Color}();export{Color};export var culture="undefined"!=typeof window&&window.wijmo&&window.wijmo.culture||{Globalize:{numberFormat:{".":".",",":",","-":"-","+":"+","%":"%",percent:{pattern:["-n%","n%"]},currency:{decimals:2,symbol:"$",pattern:["($n)","$n"]}},calendar:{"/":"/",":":":",firstDay:0,days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],am:["AM","A"],pm:["PM","P"],eras:["A.D.","B.C."],patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",t:"h:mm tt",T:"h:mm:ss tt",M:"MMMM d",m:"MMMM d",Y:"MMMM, yyyy",y:"MMMM, yyyy",g:"M/d/yyyy h:mm tt",G:"M/d/yyyy h:mm:ss tt",s:'yyyy"-"MM"-"dd"T"HH":"mm":"ss',o:'yyyy"-"MM"-"dd"T"HH":"mm":"ss"."fffffffK',O:'yyyy"-"MM"-"dd"T"HH":"mm":"ss"."fffffffK',U:"dddd, MMMM dd, yyyy h:mm:ss tt"},fiscalYearOffsets:[-3,-3]}}};var Globalize=function(){function Globalize(){}Globalize.format=function(e,t,n,r,i){if(isString(e))return e;if(isNumber(e)){t=t||(e==Math.round(e)?"n0":"n2");return Globalize.formatNumber(e,t,n,r,i)}if(isDate(e)){t=t||"d";return Globalize.formatDate(e,t)}return null!=e?e.toString():""};Globalize.formatNumber=function(e,t,n,r,i){e=asNumber(e);t=asString(t);var o,s=culture.Globalize.numberFormat,a=Globalize._parseNumericFormat(t),l=a.spec,u=a.prec,c=s["."]||".",h=s[","]||",",p=s["-"]||"-",f=Math;null==u&&(u=null!=i?i:"c"==l?s.currency.decimals:"e"==l?6:"r"==l?15:e==f.round(e)?0:2);a.scale&&(e/=f.pow(10,a.scale));if("d"==l||"x"==l){o=(r?f.floor:f.round)(f.abs(e)).toString("d"==l?10:16);for(;o.length<u;)o="0"+o;e<0&&(o=p+o);return"X"==a.specRaw?o.toUpperCase():o}r&&"p"!=l&&"e"!=l&&(e=toFixed(e,u,!0));switch(l){case"e":o=e.toExponential(u);"E"==a.specRaw&&(o=o.replace("e","E"));break;case"c":o=Globalize._toFixedStr(f.abs(e),u);break;case"p":e=Globalize._shiftDecimal(e,2,14);r&&(e=toFixed(e,u,r));o=Globalize._toFixedStr(f.abs(e),u);break;default:"-"!=(o=Globalize._toFixedStr(e,u))[0]||o.match(/[1-9]/)||(o=o.substr(1))}(n||"g"==l||"r"==l)&&o.indexOf(".")>-1&&(o=o.replace(/(\.\d*?)0+$/g,"$1").replace(/\.$/,""));"."!=c&&(o=o.replace(".",c));"-"!=p&&(o=o.replace("-",p));if(h&&("n"==l||"c"==l||"p"==a.specRaw||"F"==a.specRaw||"G"==a.specRaw)){var d=o.indexOf(c),g=/\B(?=(\d\d\d)+(?!\d))/g;o=d>-1?o.substr(0,d).replace(g