{"version":3,"file":"ej2-base.min.js","sources":["../../src/util.js","../../src/intl/parser-base.js","../../src/internationalization.js","../../src/dom.js","../../src/base.js","../../src/notify-property-change.js","../../src/animation.js","../../src/component.js","../../src/template.js","../../src/template-engine.js","../../src/hijri-parser.js","../../src/intl/date-formatter.js","../../src/intl/number-formatter.js","../../src/intl/date-parser.js","../../src/intl/number-parser.js","../../src/observer.js","../../src/intl/intl-base.js","../../src/ajax.js","../../src/browser.js","../../src/event-handler.js","../../src/module-loader.js","../../src/child-property.js","../../src/draggable.js","../../src/droppable.js","../../src/keyboard.js","../../src/l10n.js","../../src/touch.js","../../src/sanitize-helper.js"],"sourcesContent":["var instances = 'ej2_instances';\nvar uid = 0;\nvar isBlazorPlatform = false;\n/**\n * Function to check whether the platform is blazor or not.\n *\n * @returns {void} result\n * @private\n */\nexport function disableBlazorMode() {\n isBlazorPlatform = false;\n}\n/**\n * Create Instance from constructor function with desired parameters.\n *\n * @param {Function} classFunction - Class function to which need to create instance\n * @param {any[]} params - Parameters need to passed while creating instance\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function createInstance(classFunction, params) {\n var arrayParam = params;\n arrayParam.unshift(undefined);\n return new (Function.prototype.bind.apply(classFunction, arrayParam));\n}\n/**\n * To run a callback function immediately after the browser has completed other operations.\n *\n * @param {Function} handler - callback function to be triggered.\n * @returns {Function} ?\n * @private\n */\nexport function setImmediate(handler) {\n var unbind;\n // eslint-disable-next-line\n var num = new Uint16Array(5);\n var intCrypto = window.msCrypto || window.crypto;\n intCrypto.getRandomValues(num);\n var secret = 'ej2' + combineArray(num);\n // eslint-disable-next-line\n var messageHandler = function (event) {\n if (event.source === window && typeof event.data === 'string' && event.data.length <= 32 && event.data === secret) {\n handler();\n unbind();\n }\n };\n window.addEventListener('message', messageHandler, false);\n window.postMessage(secret, '*');\n return unbind = function () {\n window.removeEventListener('message', messageHandler);\n handler = messageHandler = secret = undefined;\n };\n}\n/**\n * To get nameSpace value from the desired object.\n *\n * @param {string} nameSpace - String value to the get the inner object\n * @param {any} obj - Object to get the inner object value.\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function getValue(nameSpace, obj) {\n // eslint-disable-next-line\n var value = obj;\n var splits = nameSpace.replace(/\\[/g, '.').replace(/\\]/g, '').split('.');\n for (var i = 0; i < splits.length && !isUndefined(value); i++) {\n value = value[splits[i]];\n }\n return value;\n}\n/**\n * To set value for the nameSpace in desired object.\n *\n * @param {string} nameSpace - String value to the get the inner object\n * @param {any} value - Value that you need to set.\n * @param {any} obj - Object to get the inner object value.\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function setValue(nameSpace, value, obj) {\n var keys = nameSpace.replace(/\\[/g, '.').replace(/\\]/g, '').split('.');\n // eslint-disable-next-line\n var start = obj || {};\n // eslint-disable-next-line\n var fromObj = start;\n var i;\n var length = keys.length;\n var key;\n for (i = 0; i < length; i++) {\n key = keys[i];\n if (i + 1 === length) {\n fromObj[key] = value === undefined ? {} : value;\n }\n else if (isNullOrUndefined(fromObj[key])) {\n fromObj[key] = {};\n }\n fromObj = fromObj[key];\n }\n return start;\n}\n/**\n * Delete an item from Object\n *\n * @param {any} obj - Object in which we need to delete an item.\n * @param {string} key - String value to the get the inner object\n * @returns {void} ?\n * @private\n */\n// eslint-disable-next-line\nexport function deleteObject(obj, key) {\n delete obj[key];\n}\n/**\n * Check weather the given argument is only object.\n *\n * @param {any} obj - Object which is need to check.\n * @returns {boolean} ?\n * @private\n */\n// eslint-disable-next-line\nexport function isObject(obj) {\n var objCon = {};\n return (!isNullOrUndefined(obj) && obj.constructor === objCon.constructor);\n}\n/**\n * To get enum value by giving the string.\n *\n * @param {any} enumObject - Enum object.\n * @param {string} enumValue - Enum value to be searched\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function getEnumValue(enumObject, enumValue) {\n // eslint-disable-next-line\n return enumObject[enumValue];\n}\n/**\n * Merge the source object into destination object.\n *\n * @param {any} source - source object which is going to merge with destination object\n * @param {any} destination - object need to be merged\n * @returns {void} ?\n * @private\n */\nexport function merge(source, destination) {\n if (!isNullOrUndefined(destination)) {\n var temrObj = source;\n var tempProp = destination;\n var keys = Object.keys(destination);\n var deepmerge = 'deepMerge';\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (!isNullOrUndefined(temrObj[deepmerge]) && (temrObj[deepmerge].indexOf(key) !== -1) &&\n (isObject(tempProp[key]) || Array.isArray(tempProp[key]))) {\n extend(temrObj[key], temrObj[key], tempProp[key], true);\n }\n else {\n temrObj[key] = tempProp[key];\n }\n }\n }\n}\n/**\n * Extend the two object with newer one.\n *\n * @param {any} copied - Resultant object after merged\n * @param {Object} first - First object need to merge\n * @param {Object} second - Second object need to merge\n * @param {boolean} deep ?\n * @returns {Object} ?\n * @private\n */\nexport function extend(copied, first, second, deep) {\n var result = copied && typeof copied === 'object' ? copied : {};\n var length = arguments.length;\n if (deep) {\n length = length - 1;\n }\n var _loop_1 = function (i) {\n // eslint-disable-next-line\n if (!arguments_1[i]) {\n return \"continue\";\n }\n // eslint-disable-next-line\n var obj1 = arguments_1[i];\n Object.keys(obj1).forEach(function (key) {\n var src = result[key];\n var copy = obj1[key];\n var clone;\n var isArrayChanged = Array.isArray(copy) && Array.isArray(src) && (copy.length !== src.length);\n // eslint-disable-next-line\n var blazorEventExtend = isBlazor() ? (!(src instanceof Event) && !isArrayChanged) : true;\n if (deep && blazorEventExtend && (isObject(copy) || Array.isArray(copy))) {\n if (isObject(copy)) {\n clone = src ? src : {};\n // eslint-disable-next-line\n if (Array.isArray(clone) && clone.hasOwnProperty('isComplexArray')) {\n extend(clone, {}, copy, deep);\n }\n else {\n result[key] = extend(clone, {}, copy, deep);\n }\n }\n else {\n /* istanbul ignore next */\n clone = isBlazor() ? src && Object.keys(copy).length : src ? src : [];\n result[key] = extend([], clone, copy, deep);\n }\n }\n else {\n result[key] = copy;\n }\n });\n };\n var arguments_1 = arguments;\n for (var i = 1; i < length; i++) {\n _loop_1(i);\n }\n return result;\n}\n/**\n * To check whether the object is null or undefined.\n *\n * @param {Object} value - To check the object is null or undefined\n * @returns {boolean} ?\n * @private\n */\nexport function isNullOrUndefined(value) {\n return value === undefined || value === null;\n}\n/**\n * To check whether the object is undefined.\n *\n * @param {Object} value - To check the object is undefined\n * @returns {boolean} ?\n * @private\n */\nexport function isUndefined(value) {\n return ('undefined' === typeof value);\n}\n/**\n * To return the generated unique name\n *\n * @param {string} definedName - To concatenate the unique id to provided name\n * @returns {string} ?\n * @private\n */\nexport function getUniqueID(definedName) {\n return definedName + '_' + uid++;\n}\n/**\n * It limits the rate at which a function can fire. The function will fire only once every provided second instead of as quickly.\n *\n * @param {Function} eventFunction - Specifies the function to run when the event occurs\n * @param {number} delay - A number that specifies the milliseconds for function delay call option\n * @returns {Function} ?\n * @private\n */\nexport function debounce(eventFunction, delay) {\n // eslint-disable-next-line\n var out;\n return function () {\n var _this = this;\n // eslint-disable-next-line\n var args = arguments;\n var later = function () {\n out = null;\n return eventFunction.apply(_this, args);\n };\n clearTimeout(out);\n out = setTimeout(later, delay);\n };\n}\n/**\n * To convert the object to string for query url\n *\n * @param {Object} data ?\n * @returns {string} ?\n * @private\n */\n// eslint-disable-next-line\nexport function queryParams(data) {\n var array = [];\n var keys = Object.keys(data);\n for (var _i = 0, keys_2 = keys; _i < keys_2.length; _i++) {\n var key = keys_2[_i];\n array.push(encodeURIComponent(key) + '=' + encodeURIComponent('' + data[key]));\n }\n return array.join('&');\n}\n/**\n * To check whether the given array contains object.\n *\n * @param {any} value - Specifies the T type array to be checked.\n * @returns {boolean} ?\n * @private\n */\nexport function isObjectArray(value) {\n var parser = Object.prototype.toString;\n if (parser.call(value) === '[object Array]') {\n if (parser.call(value[0]) === '[object Object]') {\n return true;\n }\n }\n return false;\n}\n/**\n * To check whether the child element is descendant to parent element or parent and child are same element.\n *\n * @param {Element} child - Specifies the child element to compare with parent.\n * @param {Element} parent - Specifies the parent element.\n * @returns {boolean} ?\n * @private\n */\nexport function compareElementParent(child, parent) {\n var node = child;\n if (node === parent) {\n return true;\n }\n else if (node === document || !node) {\n return false;\n }\n else {\n return compareElementParent(node.parentNode, parent);\n }\n}\n/**\n * To throw custom error message.\n *\n * @param {string} message - Specifies the error message to be thrown.\n * @returns {void} ?\n * @private\n */\nexport function throwError(message) {\n try {\n throw new Error(message);\n }\n catch (e) {\n // eslint-disable-next-line\n throw e.message + '\\n' + e.stack;\n }\n}\n/**\n * This function is used to print given element\n *\n * @param {Element} element - Specifies the print content element.\n * @param {Window} printWindow - Specifies the print window.\n * @returns {Window} ?\n * @private\n */\nexport function print(element, printWindow) {\n var div = document.createElement('div');\n var links = [].slice.call(document.getElementsByTagName('head')[0].querySelectorAll('base, link, style'));\n var blinks = [].slice.call(document.getElementsByTagName('body')[0].querySelectorAll('link, style'));\n if (blinks.length) {\n for (var l = 0, len = blinks.length; l < len; l++) {\n links.push(blinks[l]);\n }\n }\n var reference = '';\n if (isNullOrUndefined(printWindow)) {\n printWindow = window.open('', 'print', 'height=452,width=1024,tabbar=no');\n }\n div.appendChild(element.cloneNode(true));\n for (var i = 0, len = links.length; i < len; i++) {\n reference += links[i].outerHTML;\n }\n printWindow.document.write('
' + reference + '' + div.innerHTML +\n '' + '');\n printWindow.document.close();\n printWindow.focus();\n // eslint-disable-next-line\n var interval = setInterval(function () {\n if (printWindow.ready) {\n printWindow.print();\n printWindow.close();\n clearInterval(interval);\n }\n }, 500);\n return printWindow;\n}\n/**\n * Function to normalize the units applied to the element.\n *\n * @param {number|string} value ?\n * @returns {string} result\n * @private\n */\nexport function formatUnit(value) {\n var result = value + '';\n if (result.match(/auto|cm|mm|in|px|pt|pc|%|em|ex|ch|rem|vw|vh|vmin|vmax/)) {\n return result;\n }\n return result + 'px';\n}\n/**\n * Function to check whether the platform is blazor or not.\n *\n * @returns {void} result\n * @private\n */\nexport function enableBlazorMode() {\n isBlazorPlatform = true;\n}\n/**\n * Function to check whether the platform is blazor or not.\n *\n * @returns {boolean} result\n * @private\n */\nexport function isBlazor() {\n return isBlazorPlatform;\n}\n/**\n * Function to convert xPath to DOM element in blazor platform\n *\n * @returns {HTMLElement} result\n * @param {HTMLElement | object} element ?\n * @private\n */\nexport function getElement(element) {\n var xPath = 'xPath';\n if (!(element instanceof Node) && isBlazor() && !isNullOrUndefined(element[xPath])) {\n return document.evaluate(element[xPath], document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\n }\n return element;\n}\n/**\n * Function to fetch the Instances of a HTML element for the given component.\n *\n * @param {string | HTMLElement} element ?\n * @param {any} component ?\n * @returns {Object} ?\n * @private\n */\n// eslint-disable-next-line\nexport function getInstance(element, component) {\n // eslint-disable-next-line\n var elem = (typeof (element) === 'string') ? document.querySelector(element) : element;\n if (elem[instances]) {\n for (var _i = 0, _a = elem[instances]; _i < _a.length; _i++) {\n var inst = _a[_i];\n if (inst instanceof component) {\n return inst;\n }\n }\n }\n return null;\n}\n/**\n * Function to add instances for the given element.\n *\n * @param {string | HTMLElement} element ?\n * @param {Object} instance ?\n * @returns {void} ?\n * @private\n */\nexport function addInstance(element, instance) {\n // eslint-disable-next-line\n var elem = (typeof (element) === 'string') ? document.querySelector(element) : element;\n if (elem[instances]) {\n elem[instances].push(instance);\n }\n else {\n elem[instances] = [instance];\n }\n}\n/**\n * Function to generate the unique id.\n *\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function uniqueID() {\n if ((typeof window) === 'undefined') {\n return;\n }\n // eslint-disable-next-line\n var num = new Uint16Array(5);\n var intCrypto = window.msCrypto || window.crypto;\n return intCrypto.getRandomValues(num);\n}\n/**\n *\n * @param {Int16Array} num ?\n * @returns {string} ?\n */\nfunction combineArray(num) {\n var ret = '';\n for (var i = 0; i < 5; i++) {\n ret += (i ? ',' : '') + num[i];\n }\n return ret;\n}\n","/**\n * Parser\n */\nvar defaultNumberingSystem = {\n 'latn': {\n '_digits': '0123456789',\n '_type': 'numeric'\n }\n};\nimport { isUndefined, getValue, isBlazor } from '../util';\nvar defaultNumberSymbols = {\n 'decimal': '.',\n 'group': ',',\n 'percentSign': '%',\n 'plusSign': '+',\n 'minusSign': '-',\n 'infinity': '∞',\n 'nan': 'NaN',\n 'exponential': 'E'\n};\nvar latnNumberSystem = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];\n/**\n * Interface for parser base\n *\n * @private\n */\nvar ParserBase = /** @class */ (function () {\n function ParserBase() {\n }\n /**\n * Returns the cldr object for the culture specifies\n *\n * @param {Object} obj - Specifies the object from which culture object to be acquired.\n * @param {string} cName - Specifies the culture name.\n * @returns {Object} ?\n */\n ParserBase.getMainObject = function (obj, cName) {\n var value = isBlazor() ? cName : 'main.' + cName;\n return getValue(value, obj);\n };\n /**\n * Returns the numbering system object from given cldr data.\n *\n * @param {Object} obj - Specifies the object from which number system is acquired.\n * @returns {Object} ?\n */\n ParserBase.getNumberingSystem = function (obj) {\n return getValue('supplemental.numberingSystems', obj) || this.numberingSystems;\n };\n /**\n * Returns the reverse of given object keys or keys specified.\n *\n * @param {Object} prop - Specifies the object to be reversed.\n * @param {number[]} keys - Optional parameter specifies the custom keyList for reversal.\n * @returns {Object} ?\n */\n ParserBase.reverseObject = function (prop, keys) {\n var propKeys = keys || Object.keys(prop);\n var res = {};\n for (var _i = 0, propKeys_1 = propKeys; _i < propKeys_1.length; _i++) {\n var key = propKeys_1[_i];\n // eslint-disable-next-line\n if (!res.hasOwnProperty(prop[key])) {\n // eslint-disable-next-line\n res[prop[key]] = key;\n }\n }\n return res;\n };\n /**\n * Returns the symbol regex by skipping the escape sequence.\n *\n * @param {string[]} props - Specifies the array values to be skipped.\n * @returns {RegExp} ?\n */\n ParserBase.getSymbolRegex = function (props) {\n var regexStr = props.map(function (str) {\n return str.replace(/([.*+?^=!:${}()|[\\]/\\\\])/g, '\\\\$1');\n }).join('|');\n return new RegExp(regexStr, 'g');\n };\n /**\n *\n * @param {Object} prop ?\n * @returns {Object} ?\n */\n ParserBase.getSymbolMatch = function (prop) {\n var matchKeys = Object.keys(defaultNumberSymbols);\n var ret = {};\n for (var _i = 0, matchKeys_1 = matchKeys; _i < matchKeys_1.length; _i++) {\n var key = matchKeys_1[_i];\n // eslint-disable-next-line\n ret[prop[key]] = defaultNumberSymbols[key];\n }\n return ret;\n };\n /**\n * Returns regex string for provided value\n *\n * @param {string} val ?\n * @returns {string} ?\n */\n ParserBase.constructRegex = function (val) {\n var len = val.length;\n var ret = '';\n for (var i = 0; i < len; i++) {\n if (i !== len - 1) {\n ret += val[i] + '|';\n }\n else {\n ret += val[i];\n }\n }\n return ret;\n };\n /**\n * Returns the replaced value of matching regex and obj mapper.\n *\n * @param {string} value - Specifies the values to be replaced.\n * @param {RegExp} regex - Specifies the regex to search.\n * @param {Object} obj - Specifies the object matcher to be replace value parts.\n * @returns {string} ?\n */\n ParserBase.convertValueParts = function (value, regex, obj) {\n return value.replace(regex, function (str) {\n // eslint-disable-next-line\n return obj[str];\n });\n };\n /**\n * Returns default numbering system object for formatting from cldr data\n *\n * @param {Object} obj ?\n * @returns {NumericObject} ?\n */\n ParserBase.getDefaultNumberingSystem = function (obj) {\n var ret = {};\n ret.obj = getValue('numbers', obj);\n ret.nSystem = getValue('defaultNumberingSystem', ret.obj);\n return ret;\n };\n /**\n * Returns the replaced value of matching regex and obj mapper.\n *\n * @param {Object} curObj ?\n * @param {Object} numberSystem ?\n * @param {boolean} needSymbols ?\n * @param {boolean} blazorMode ?\n * @returns {Object} ?\n */\n ParserBase.getCurrentNumericOptions = function (curObj, numberSystem, needSymbols, blazorMode) {\n var ret = {};\n var cur = this.getDefaultNumberingSystem(curObj);\n if (!isUndefined(cur.nSystem) || blazorMode) {\n var digits = blazorMode ? getValue('obj.mapperDigits', cur) : getValue(cur.nSystem + '._digits', numberSystem);\n if (!isUndefined(digits)) {\n ret.numericPair = this.reverseObject(digits, latnNumberSystem);\n ret.numberParseRegex = new RegExp(this.constructRegex(digits), 'g');\n ret.numericRegex = '[' + digits[0] + '-' + digits[9] + ']';\n if (needSymbols) {\n ret.numericRegex = digits[0] + '-' + digits[9];\n ret.symbolNumberSystem = getValue(blazorMode ? 'numberSymbols' : 'symbols-numberSystem-' + cur.nSystem, cur.obj);\n ret.symbolMatch = this.getSymbolMatch(ret.symbolNumberSystem);\n ret.numberSystem = cur.nSystem;\n }\n }\n }\n return ret;\n };\n /**\n * Returns number mapper object for the provided cldr data\n *\n * @param {Object} curObj ?\n * @param {Object} numberSystem ?\n * @param {boolean} isNumber ?\n * @returns {NumberMapper} ?\n */\n // eslint-disable-next-line\n ParserBase.getNumberMapper = function (curObj, numberSystem, isNumber) {\n var ret = { mapper: {} };\n var cur = this.getDefaultNumberingSystem(curObj);\n if (!isUndefined(cur.nSystem)) {\n ret.numberSystem = cur.nSystem;\n ret.numberSymbols = getValue('symbols-numberSystem-' + cur.nSystem, cur.obj);\n ret.timeSeparator = getValue('timeSeparator', ret.numberSymbols);\n var digits = getValue(cur.nSystem + '._digits', numberSystem);\n if (!isUndefined(digits)) {\n for (var _i = 0, latnNumberSystem_1 = latnNumberSystem; _i < latnNumberSystem_1.length; _i++) {\n var i = latnNumberSystem_1[_i];\n // eslint-disable-next-line\n ret.mapper[i] = digits[i];\n }\n }\n }\n return ret;\n };\n ParserBase.nPair = 'numericPair';\n ParserBase.nRegex = 'numericRegex';\n ParserBase.numberingSystems = defaultNumberingSystem;\n return ParserBase;\n}());\nexport { ParserBase };\n/**\n * @private\n */\nvar blazorCurrencyData = {\n 'DJF': 'Fdj',\n 'ERN': 'Nfk',\n 'ETB': 'Br',\n 'NAD': '$',\n 'ZAR': 'R',\n 'XAF': 'FCFA',\n 'GHS': 'GH₵',\n 'XDR': 'XDR',\n 'AED': 'د.إ.',\n 'BHD': 'د.ب.',\n 'DZD': 'د.ج.',\n 'EGP': 'ج.م.',\n 'ILS': '₪',\n 'IQD': 'د.ع.',\n 'JOD': 'د.ا.',\n 'KMF': 'CF',\n 'KWD': 'د.ك.',\n 'LBP': 'ل.ل.',\n 'LYD': 'د.ل.',\n 'MAD': 'د.م.',\n 'MRU': 'أ.م.',\n 'OMR': 'ر.ع.',\n 'QAR': 'ر.ق.',\n 'SAR': 'ر.س.',\n 'SDG': 'ج.س.',\n 'SOS': 'S',\n 'SSP': '£',\n 'SYP': 'ل.س.',\n 'TND': 'د.ت.',\n 'YER': 'ر.ي.',\n 'CLP': '$',\n 'INR': '₹',\n 'TZS': 'TSh',\n 'EUR': '€',\n 'AZN': '₼',\n 'RUB': '₽',\n 'BYN': 'Br',\n 'ZMW': 'K',\n 'BGN': 'лв.',\n 'NGN': '₦',\n 'XOF': 'CFA',\n 'BDT': '৳',\n 'CNY': '¥',\n 'BAM': 'КМ',\n 'UGX': 'USh',\n 'USD': '$',\n 'CZK': 'Kč',\n 'GBP': '£',\n 'DKK': 'kr.',\n 'KES': 'Ksh',\n 'CHF': 'CHF',\n 'MVR': 'ރ.',\n 'BTN': 'Nu.',\n 'XCD': 'EC$',\n 'AUD': '$',\n 'BBD': '$',\n 'BIF': 'FBu',\n 'BMD': '$',\n 'BSD': '$',\n 'BWP': 'P',\n 'BZD': '$',\n 'CAD': '$',\n 'NZD': '$',\n 'FJD': '$',\n 'FKP': '£',\n 'GIP': '£',\n 'GMD': 'D',\n 'GYD': '$',\n 'HKD': '$',\n 'IDR': 'Rp',\n 'JMD': '$',\n 'KYD': '$',\n 'LRD': '$',\n 'MGA': 'Ar',\n 'MOP': 'MOP$',\n 'MUR': 'Rs',\n 'MWK': 'MK',\n 'MYR': 'RM',\n 'PGK': 'K',\n 'PHP': '₱',\n 'PKR': 'Rs',\n 'RWF': 'RF',\n 'SBD': '$',\n 'SCR': 'SR',\n 'SEK': 'kr',\n 'SGD': '$',\n 'SHP': '£',\n 'SLL': 'Le',\n 'ANG': 'NAf.',\n 'SZL': 'E',\n 'TOP': 'T$',\n 'TTD': '$',\n 'VUV': 'VT',\n 'WST': 'WS$',\n 'ARS': '$',\n 'BOB': 'Bs',\n 'BRL': 'R$',\n 'COP': '$',\n 'CRC': '₡',\n 'CUP': '$',\n 'DOP': '$',\n 'GTQ': 'Q',\n 'HNL': 'L',\n 'MXN': '$',\n 'NIO': 'C$',\n 'PAB': 'B/.',\n 'PEN': 'S/',\n 'PYG': '₲',\n 'UYU': '$',\n 'VES': 'Bs.S',\n 'IRR': 'ريال',\n 'GNF': 'FG',\n 'CDF': 'FC',\n 'HTG': 'G',\n 'XPF': 'FCFP',\n 'HRK': 'kn',\n 'HUF': 'Ft',\n 'AMD': '֏',\n 'ISK': 'kr',\n 'JPY': '¥',\n 'GEL': '₾',\n 'CVE': '',\n 'KZT': '₸',\n 'KHR': '៛',\n 'KPW': '₩',\n 'KRW': '₩',\n 'KGS': 'сом',\n 'AOA': 'Kz',\n 'LAK': '₭',\n 'MZN': 'MTn',\n 'MKD': 'ден',\n 'MNT': '₮',\n 'BND': '$',\n 'MMK': 'K',\n 'NOK': 'kr',\n 'NPR': 'रु',\n 'AWG': 'Afl.',\n 'SRD': '$',\n 'PLN': 'zł',\n 'AFN': '؋',\n 'STN': 'Db',\n 'MDL': 'L',\n 'RON': 'lei',\n 'UAH': '₴',\n 'LKR': 'රු.',\n 'ALL': 'Lekë',\n 'RSD': 'дин.',\n 'TJS': 'смн',\n 'THB': '฿',\n 'TMT': 'm.',\n 'TRY': '₺',\n 'UZS': 'сўм',\n 'VND': '₫',\n 'TWD': 'NT$'\n};\n/**\n *\n * @param {string} currencyCode ?\n * @returns {string} ?\n */\nexport function getBlazorCurrencySymbol(currencyCode) {\n return getValue(currencyCode || '', blazorCurrencyData);\n}\n","import { DateFormat } from './intl/date-formatter';\nimport { NumberFormat } from './intl/number-formatter';\nimport { DateParser } from './intl/date-parser';\nimport { NumberParser } from './intl/number-parser';\nimport { IntlBase } from './intl/intl-base';\nimport { extend, getValue, isBlazor } from './util';\nimport { Observer } from './observer';\n/**\n * Specifies the observer used for external change detection.\n */\nexport var onIntlChange = new Observer();\n/**\n * Specifies the default rtl status for EJ2 components.\n */\nexport var rightToLeft = false;\n/**\n * Specifies the CLDR data loaded for internationalization functionalities.\n *\n * @private\n */\nexport var cldrData = {};\n/**\n * Specifies the default culture value to be considered.\n *\n * @private\n */\nexport var defaultCulture = 'en-US';\n/**\n * Specifies default currency code to be considered\n *\n * @private\n */\nexport var defaultCurrencyCode = 'USD';\nvar mapper = ['numericObject', 'dateObject'];\n/**\n * Internationalization class provides support to parse and format the number and date object to the desired format.\n * ```typescript\n * // To set the culture globally\n * setCulture('en-GB');\n *\n * // To set currency code globally\n * setCurrencyCode('EUR');\n *\n * //Load cldr data\n * loadCldr(gregorainData);\n * loadCldr(timeZoneData);\n * loadCldr(numbersData);\n * loadCldr(numberSystemData);\n *\n * // To use formatter in component side\n * let Intl:Internationalization = new Internationalization();\n *\n * // Date formatting\n * let dateFormatter: Function = Intl.getDateFormat({skeleton:'long',type:'dateTime'});\n * dateFormatter(new Date('11/2/2016'));\n * dateFormatter(new Date('25/2/2030'));\n * Intl.formatDate(new Date(),{skeleton:'E'});\n *\n * //Number formatting\n * let numberFormatter: Function = Intl.getNumberFormat({skeleton:'C5'})\n * numberFormatter(24563334);\n * Intl.formatNumber(123123,{skeleton:'p2'});\n *\n * // Date parser\n * let dateParser: Function = Intl.getDateParser({skeleton:'short',type:'time'});\n * dateParser('10:30 PM');\n * Intl.parseDate('10',{skeleton:'H'});\n * ```\n */\nvar Internationalization = /** @class */ (function () {\n function Internationalization(cultureName) {\n if (cultureName) {\n this.culture = cultureName;\n }\n }\n /**\n * Returns the format function for given options.\n *\n * @param {DateFormatOptions} options - Specifies the format options in which the format function will return.\n * @returns {Function} ?\n */\n Internationalization.prototype.getDateFormat = function (options) {\n return DateFormat.dateFormat(this.getCulture(), options || { type: 'date', skeleton: 'short' }, cldrData);\n };\n /**\n * Returns the format function for given options.\n *\n * @param {NumberFormatOptions} options - Specifies the format options in which the format function will return.\n * @returns {Function} ?\n */\n Internationalization.prototype.getNumberFormat = function (options) {\n if (options && !options.currency) {\n options.currency = defaultCurrencyCode;\n }\n if (isBlazor() && options && !options.format) {\n options.minimumFractionDigits = 0;\n }\n return NumberFormat.numberFormatter(this.getCulture(), options || {}, cldrData);\n };\n /**\n * Returns the parser function for given options.\n *\n * @param {DateFormatOptions} options - Specifies the format options in which the parser function will return.\n * @returns {Function} ?\n */\n Internationalization.prototype.getDateParser = function (options) {\n return DateParser.dateParser(this.getCulture(), options || { skeleton: 'short', type: 'date' }, cldrData);\n };\n /**\n * Returns the parser function for given options.\n *\n * @param {NumberFormatOptions} options - Specifies the format options in which the parser function will return.\n * @returns {Function} ?\n */\n Internationalization.prototype.getNumberParser = function (options) {\n if (isBlazor() && options && !options.format) {\n options.minimumFractionDigits = 0;\n }\n return NumberParser.numberParser(this.getCulture(), options || { format: 'N' }, cldrData);\n };\n /**\n * Returns the formatted string based on format options.\n *\n * @param {number} value - Specifies the number to format.\n * @param {NumberFormatOptions} option - Specifies the format options in which the number will be formatted.\n * @returns {string} ?\n */\n Internationalization.prototype.formatNumber = function (value, option) {\n return this.getNumberFormat(option)(value);\n };\n /**\n * Returns the formatted date string based on format options.\n *\n * @param {Date} value - Specifies the number to format.\n * @param {DateFormatOptions} option - Specifies the format options in which the number will be formatted.\n * @returns {string} ?\n */\n Internationalization.prototype.formatDate = function (value, option) {\n return this.getDateFormat(option)(value);\n };\n /**\n * Returns the date object for given date string and options.\n *\n * @param {string} value - Specifies the string to parse.\n * @param {DateFormatOptions} option - Specifies the parse options in which the date string will be parsed.\n * @returns {Date} ?\n */\n Internationalization.prototype.parseDate = function (value, option) {\n return this.getDateParser(option)(value);\n };\n /**\n * Returns the number object from the given string value and options.\n *\n * @param {string} value - Specifies the string to parse.\n * @param {NumberFormatOptions} option - Specifies the parse options in which the string number will be parsed.\n * @returns {number} ?\n */\n Internationalization.prototype.parseNumber = function (value, option) {\n return this.getNumberParser(option)(value);\n };\n /**\n * Returns Native Date Time Pattern\n *\n * @param {DateFormatOptions} option - Specifies the parse options for resultant date time pattern.\n * @param {boolean} isExcelFormat - Specifies format value to be converted to excel pattern.\n * @returns {string} ?\n * @private\n */\n Internationalization.prototype.getDatePattern = function (option, isExcelFormat) {\n return IntlBase.getActualDateTimeFormat(this.getCulture(), option, cldrData, isExcelFormat);\n };\n /**\n * Returns Native Number Pattern\n *\n * @param {NumberFormatOptions} option - Specifies the parse options for resultant number pattern.\n * @param {boolean} isExcel ?\n * @returns {string} ?\n * @private\n */\n Internationalization.prototype.getNumberPattern = function (option, isExcel) {\n return IntlBase.getActualNumberFormat(this.getCulture(), option, cldrData, isExcel);\n };\n /**\n * Returns the First Day of the Week\n *\n * @returns {number} ?\n */\n Internationalization.prototype.getFirstDayOfWeek = function () {\n return IntlBase.getWeekData(this.getCulture(), cldrData);\n };\n /**\n * Returns the culture\n *\n * @returns {string} ?\n */\n Internationalization.prototype.getCulture = function () {\n return this.culture || defaultCulture;\n };\n return Internationalization;\n}());\nexport { Internationalization };\n/**\n * Set the default culture to all EJ2 components\n *\n * @param {string} cultureName - Specifies the culture name to be set as default culture.\n * @returns {void} ?\n */\nexport function setCulture(cultureName) {\n defaultCulture = cultureName;\n onIntlChange.notify('notifyExternalChange', { 'locale': defaultCulture });\n}\n/**\n * Set the default currency code to all EJ2 components\n *\n * @param {string} currencyCode Specifies the culture name to be set as default culture.\n * @returns {void} ?\n */\nexport function setCurrencyCode(currencyCode) {\n defaultCurrencyCode = currencyCode;\n onIntlChange.notify('notifyExternalChange', { 'currencyCode': defaultCurrencyCode });\n}\n/**\n * Load the CLDR data into context\n *\n * @param {Object[]} data Specifies the CLDR data's to be used for formatting and parser.\n * @returns {void} ?\n */\nexport function loadCldr() {\n var data = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n data[_i] = arguments[_i];\n }\n for (var _a = 0, data_1 = data; _a < data_1.length; _a++) {\n var obj = data_1[_a];\n extend(cldrData, obj, {}, true);\n }\n}\n/**\n * To enable or disable RTL functionality for all components globally.\n *\n * @param {boolean} status - Optional argument Specifies the status value to enable or disable rtl option.\n * @returns {void} ?\n */\nexport function enableRtl(status) {\n if (status === void 0) { status = true; }\n rightToLeft = status;\n onIntlChange.notify('notifyExternalChange', { enableRtl: rightToLeft });\n}\n/**\n * To get the numeric CLDR object for given culture\n *\n * @param {string} locale - Specifies the locale for which numericObject to be returned.\n * @param {string} type ?\n * @returns {Object} ?\n * @ignore\n * @private\n */\nexport function getNumericObject(locale, type) {\n // eslint-disable-next-line\n var numObject = IntlBase.getDependables(cldrData, locale, '', true)[mapper[0]];\n // eslint-disable-next-line\n var dateObject = IntlBase.getDependables(cldrData, locale, '')[mapper[1]];\n var numSystem = getValue('defaultNumberingSystem', numObject);\n var symbPattern = isBlazor() ? getValue('numberSymbols', numObject) : getValue('symbols-numberSystem-' + numSystem, numObject);\n var pattern = IntlBase.getSymbolPattern(type || 'decimal', numSystem, numObject, false);\n return extend(symbPattern, IntlBase.getFormatData(pattern, true, '', true), { 'dateSeparator': IntlBase.getDateSeparator(dateObject) });\n}\n/**\n * To get the numeric CLDR number base object for given culture\n *\n * @param {string} locale - Specifies the locale for which numericObject to be returned.\n * @param {string} currency - Specifies the currency for which numericObject to be returned.\n * @returns {string} ?\n * @ignore\n * @private\n */\nexport function getNumberDependable(locale, currency) {\n // eslint-disable-next-line\n var numObject = IntlBase.getDependables(cldrData, locale, '', true);\n // eslint-disable-next-line\n return IntlBase.getCurrencySymbol(numObject.numericObject, currency);\n}\n/**\n * To get the default date CLDR object.\n *\n * @param {string} mode ?\n * @returns {Object} ?\n * @ignore\n * @private\n */\nexport function getDefaultDateObject(mode) {\n // eslint-disable-next-line\n return IntlBase.getDependables(cldrData, '', mode, false)[mapper[1]];\n}\n","/**\n * Functions related to dom operations.\n */\nimport { EventHandler } from './event-handler';\nimport { isNullOrUndefined, getValue, setValue, isObject, extend } from './util';\nvar SVG_REG = /^svg|^path|^g/;\n/**\n * Function to create Html element.\n *\n * @param {string} tagName - Name of the tag, id and class names.\n * @param {ElementProperties} properties - Object to set properties in the element.\n * @param {ElementProperties} properties.id - To set the id to the created element.\n * @param {ElementProperties} properties.className - To add classes to the element.\n * @param {ElementProperties} properties.innerHTML - To set the innerHTML to element.\n * @param {ElementProperties} properties.styles - To set the some custom styles to element.\n * @param {ElementProperties} properties.attrs - To set the attributes to element.\n * @returns {any} ?\n * @private\n */\nexport function createElement(tagName, properties) {\n var element = (SVG_REG.test(tagName) ? document.createElementNS('http://www.w3.org/2000/svg', tagName) : document.createElement(tagName));\n if (typeof (properties) === 'undefined') {\n return element;\n }\n element.innerHTML = (properties.innerHTML ? properties.innerHTML : '');\n if (properties.className !== undefined) {\n element.className = properties.className;\n }\n if (properties.id !== undefined) {\n element.id = properties.id;\n }\n if (properties.styles !== undefined) {\n element.setAttribute('style', properties.styles);\n }\n if (properties.attrs !== undefined) {\n attributes(element, properties.attrs);\n }\n return element;\n}\n/**\n * The function used to add the classes to array of elements\n *\n * @param {Element[]|NodeList} elements - An array of elements that need to add a list of classes\n * @param {string|string[]} classes - String or array of string that need to add an individual element as a class\n * @returns {any} .\n * @private\n */\nexport function addClass(elements, classes) {\n var classList = getClassList(classes);\n for (var _i = 0, _a = elements; _i < _a.length; _i++) {\n var ele = _a[_i];\n for (var _b = 0, classList_1 = classList; _b < classList_1.length; _b++) {\n var className = classList_1[_b];\n if (isObject(ele)) {\n var curClass = getValue('attributes.className', ele);\n if (isNullOrUndefined(curClass)) {\n setValue('attributes.className', className, ele);\n }\n else if (!new RegExp('\\\\b' + className + '\\\\b', 'i').test(curClass)) {\n setValue('attributes.className', curClass + ' ' + className, ele);\n }\n }\n else {\n if (!ele.classList.contains(className)) {\n ele.classList.add(className);\n }\n }\n }\n }\n return elements;\n}\n/**\n * The function used to add the classes to array of elements\n *\n * @param {Element[]|NodeList} elements - An array of elements that need to remove a list of classes\n * @param {string|string[]} classes - String or array of string that need to add an individual element as a class\n * @returns {any} .\n * @private\n */\nexport function removeClass(elements, classes) {\n var classList = getClassList(classes);\n for (var _i = 0, _a = elements; _i < _a.length; _i++) {\n var ele = _a[_i];\n var flag = isObject(ele);\n var canRemove = flag ? getValue('attributes.className', ele) : ele.className !== '';\n if (canRemove) {\n for (var _b = 0, classList_2 = classList; _b < classList_2.length; _b++) {\n var className = classList_2[_b];\n if (flag) {\n var classes_1 = getValue('attributes.className', ele);\n var classArr = classes_1.split(' ');\n var index = classArr.indexOf(className);\n if (index !== -1) {\n classArr.splice(index, 1);\n }\n setValue('attributes.className', classArr.join(' '), ele);\n }\n else {\n ele.classList.remove(className);\n }\n }\n }\n }\n return elements;\n}\n/**\n * The function used to get classlist.\n *\n * @param {string | string[]} classes - An element the need to check visibility\n * @returns {string[]} ?\n * @private\n */\nfunction getClassList(classes) {\n var classList = [];\n if (typeof classes === 'string') {\n classList.push(classes);\n }\n else {\n classList = classes;\n }\n return classList;\n}\n/**\n * The function used to check element is visible or not.\n *\n * @param {Element|Node} element - An element the need to check visibility\n * @returns {boolean} ?\n * @private\n */\nexport function isVisible(element) {\n var ele = element;\n return (ele.style.visibility === '' && ele.offsetWidth > 0);\n}\n/**\n * The function used to insert an array of elements into a first of the element.\n *\n * @param {Element[]|NodeList} fromElements - An array of elements that need to prepend.\n * @param {Element} toElement - An element that is going to prepend.\n * @param {boolean} isEval - ?\n * @returns {Element[] | NodeList} ?\n * @private\n */\nexport function prepend(fromElements, toElement, isEval) {\n var docFrag = document.createDocumentFragment();\n for (var _i = 0, _a = fromElements; _i < _a.length; _i++) {\n var ele = _a[_i];\n docFrag.appendChild(ele);\n }\n toElement.insertBefore(docFrag, toElement.firstElementChild);\n if (isEval) {\n executeScript(toElement);\n }\n return fromElements;\n}\n/**\n * The function used to insert an array of elements into last of the element.\n *\n * @param {Element[]|NodeList} fromElements - An array of elements that need to append.\n * @param {Element} toElement - An element that is going to prepend.\n * @param {boolean} isEval - ?\n * @returns {Element[] | NodeList} ?\n * @private\n */\nexport function append(fromElements, toElement, isEval) {\n var docFrag = document.createDocumentFragment();\n for (var _i = 0, _a = fromElements; _i < _a.length; _i++) {\n var ele = _a[_i];\n docFrag.appendChild(ele);\n }\n toElement.appendChild(docFrag);\n if (isEval) {\n executeScript(toElement);\n }\n return fromElements;\n}\n/**\n * The function is used to evaluate script from Ajax request\n *\n * @param {Element} ele - An element is going to evaluate the script\n * @returns {void} ?\n */\nfunction executeScript(ele) {\n var eleArray = ele.querySelectorAll('script');\n eleArray.forEach(function (element) {\n var script = document.createElement('script');\n script.text = element.innerHTML;\n document.head.appendChild(script);\n detach(script);\n });\n}\n/**\n * The function used to remove the element from parentnode\n *\n * @param {Element|Node|HTMLElement} element - An element that is going to detach from the Dom\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function detach(element) {\n var parentNode = element.parentNode;\n if (parentNode) {\n return parentNode.removeChild(element);\n }\n}\n/**\n * The function used to remove the element from Dom also clear the bounded events\n *\n * @param {Element|Node|HTMLElement} element - An element remove from the Dom\n * @returns {void} ?\n * @private\n */\nexport function remove(element) {\n var parentNode = element.parentNode;\n EventHandler.clearEvents(element);\n parentNode.removeChild(element);\n}\n/**\n * The function helps to set multiple attributes to an element\n *\n * @param {Element|Node} element - An element that need to set attributes.\n * @param {string} attributes - JSON Object that is going to as attributes.\n * @returns {Element} ?\n * @private\n */\n// eslint-disable-next-line\nexport function attributes(element, attributes) {\n var keys = Object.keys(attributes);\n var ele = element;\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (isObject(ele)) {\n var iKey = key;\n if (key === 'tabindex') {\n iKey = 'tabIndex';\n }\n ele.attributes[iKey] = attributes[key];\n }\n else {\n ele.setAttribute(key, attributes[key]);\n }\n }\n return ele;\n}\n/**\n * The function selects the element from giving context.\n *\n * @param {string} selector - Selector string need fetch element\n * @param {Document|Element} context - It is an optional type, That specifies a Dom context.\n * @param {boolean} needsVDOM ?\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function select(selector, context, needsVDOM) {\n if (context === void 0) { context = document; }\n selector = querySelectId(selector);\n return context.querySelector(selector);\n}\n/**\n * The function selects an array of element from the given context.\n *\n * @param {string} selector - Selector string need fetch element\n * @param {Document|Element} context - It is an optional type, That specifies a Dom context.\n * @param {boolean} needsVDOM ?\n * @returns {HTMLElement[]} ?\n * @private\n */\n// eslint-disable-next-line\nexport function selectAll(selector, context, needsVDOM) {\n if (context === void 0) { context = document; }\n selector = querySelectId(selector);\n var nodeList = context.querySelectorAll(selector);\n return nodeList;\n}\n/**\n * The function selects an id of element from the given context.\n *\n * @param {string} selector - Selector string need fetch element\n * @returns {string} ?\n * @private\n */\nfunction querySelectId(selector) {\n var charRegex = /(!|\"|\\$|%|&|'|\\(|\\)|\\*|\\/|:|;|<|=|\\?|@|\\]|\\^|`|{|}|\\||\\+|~)/g;\n if (selector.match(/#[0-9]/g) || selector.match(charRegex)) {\n var idList = selector.split(',');\n for (var i = 0; i < idList.length; i++) {\n var list = idList[i].split(' ');\n for (var j = 0; j < list.length; j++) {\n if (list[j].indexOf('#') > -1) {\n if (!list[j].match(/\\[.*\\]/)) {\n var splitId = list[j].split('#');\n if (splitId[1].match(/^\\d/) || splitId[1].match(charRegex)) {\n var setId = list[j].split('.');\n setId[0] = setId[0].replace(/#/, '[id=\\'') + '\\']';\n list[j] = setId.join('.');\n }\n }\n }\n }\n idList[i] = list.join(' ');\n }\n return idList.join(',');\n }\n return selector;\n}\n/**\n * Returns single closest parent element based on class selector.\n *\n * @param {Element} element - An element that need to find the closest element.\n * @param {string} selector - A classSelector of closest element.\n * @returns {Element} ?\n * @private\n */\nexport function closest(element, selector) {\n var el = element;\n if (typeof el.closest === 'function') {\n return el.closest(selector);\n }\n while (el && el.nodeType === 1) {\n if (matches(el, selector)) {\n return el;\n }\n el = el.parentNode;\n }\n return null;\n}\n/**\n * Returns all sibling elements of the given element.\n *\n * @param {Element|Node} element - An element that need to get siblings.\n * @returns {Element[]} ?\n * @private\n */\nexport function siblings(element) {\n var siblings = [];\n var childNodes = Array.prototype.slice.call(element.parentNode.childNodes);\n for (var _i = 0, childNodes_1 = childNodes; _i < childNodes_1.length; _i++) {\n var curNode = childNodes_1[_i];\n if (curNode.nodeType === Node.ELEMENT_NODE && element !== curNode) {\n siblings.push(curNode);\n }\n }\n return siblings;\n}\n/**\n * set the value if not exist. Otherwise set the existing value\n *\n * @param {HTMLElement} element - An element to which we need to set value.\n * @param {string} property - Property need to get or set.\n * @param {string} value - value need to set.\n * @returns {string} ?\n * @private\n */\nexport function getAttributeOrDefault(element, property, value) {\n var attrVal;\n var isObj = isObject(element);\n if (isObj) {\n attrVal = getValue('attributes.' + property, element);\n }\n else {\n attrVal = element.getAttribute(property);\n }\n if (isNullOrUndefined(attrVal) && value) {\n if (!isObj) {\n element.setAttribute(property, value.toString());\n }\n else {\n element.attributes[property] = value;\n }\n attrVal = value;\n }\n return attrVal;\n}\n/**\n * Set the style attributes to Html element.\n *\n * @param {HTMLElement} element - Element which we want to set attributes\n * @param {any} attrs - Set the given attributes to element\n * @returns {void} ?\n * @private\n */\nexport function setStyleAttribute(element, attrs) {\n if (attrs !== undefined) {\n Object.keys(attrs).forEach(function (key) {\n // eslint-disable-next-line\n element.style[key] = attrs[key];\n });\n }\n}\n/**\n * Method for add and remove classes to a dom element.\n *\n * @param {Element} element - Element for add and remove classes\n * @param {string[]} addClasses - List of classes need to be add to the element\n * @param {string[]} removeClasses - List of classes need to be remove from the element\n * @returns {void} ?\n * @private\n */\nexport function classList(element, addClasses, removeClasses) {\n addClass([element], addClasses);\n removeClass([element], removeClasses);\n}\n/**\n * Method to check whether the element matches the given selector.\n *\n * @param {Element} element - Element to compare with the selector.\n * @param {string} selector - String selector which element will satisfy.\n * @returns {void} ?\n * @private\n */\nexport function matches(element, selector) {\n // eslint-disable-next-line\n var matches = element.matches || element.msMatchesSelector || element.webkitMatchesSelector;\n if (matches) {\n return matches.call(element, selector);\n }\n else {\n return [].indexOf.call(document.querySelectorAll(selector), element) !== -1;\n }\n}\n/**\n * Method to get the html text from DOM.\n *\n * @param {HTMLElement} ele - Element to compare with the selector.\n * @param {string} innerHTML - String selector which element will satisfy.\n * @returns {void} ?\n * @private\n */\nexport function includeInnerHTML(ele, innerHTML) {\n ele.innerHTML = innerHTML;\n}\n/**\n * Method to get the containsclass.\n *\n * @param {HTMLElement} ele - Element to compare with the selector.\n * @param {string} className - String selector which element will satisfy.\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function containsClass(ele, className) {\n if (isObject(ele)) {\n // eslint-disable-next-line\n return new RegExp('\\\\b' + className + '\\\\b', 'i').test(ele.attributes.className);\n }\n else {\n return ele.classList.contains(className);\n }\n}\n/**\n * Method to check whether the element matches the given selector.\n *\n * @param {Object} element - Element to compare with the selector.\n * @param {boolean} deep ?\n * @returns {any} ?\n * @private\n */\n// eslint-disable-next-line\nexport function cloneNode(element, deep) {\n if (isObject(element)) {\n if (deep) {\n return extend({}, {}, element, true);\n }\n }\n else {\n return element.cloneNode(deep);\n }\n}\n","import { isUndefined, isNullOrUndefined, merge, setImmediate, setValue, isBlazor, getValue, extend } from './util';\nimport { addClass, removeClass } from './dom';\nimport { Observer } from './observer';\nvar isColEName = new RegExp(']');\n/* tslint:enable:no-any */\n/**\n * Base library module is common module for Framework modules like touch,keyboard and etc.,\n *\n * @private\n */\nvar Base = /** @class */ (function () {\n /**\n * Base constructor accept options and element\n *\n * @param {Object} options ?\n * @param {string} element ?\n */\n function Base(options, element) {\n this.isRendered = false;\n this.isComplexArraySetter = false;\n this.isServerRendered = false;\n this.allowServerDataBinding = true;\n this.isProtectedOnChange = true;\n this.properties = {};\n this.changedProperties = {};\n this.oldProperties = {};\n this.bulkChanges = {};\n this.refreshing = false;\n this.ignoreCollectionWatch = false;\n // eslint-disable-next-line\n this.finalUpdate = function () { };\n this.childChangedProperties = {};\n this.modelObserver = new Observer(this);\n if (!isUndefined(element)) {\n if ('string' === typeof (element)) {\n this.element = document.querySelector(element);\n }\n else {\n this.element = element;\n }\n if (!isNullOrUndefined(this.element)) {\n this.isProtectedOnChange = false;\n this.addInstance();\n }\n }\n if (!isUndefined(options)) {\n this.setProperties(options, true);\n }\n this.isDestroyed = false;\n }\n /** Property base section */\n /**\n * Function used to set bunch of property at a time.\n *\n * @private\n * @param {Object} prop - JSON object which holds components properties.\n * @param {boolean} muteOnChange ? - Specifies to true when we set properties.\n * @returns {void} ?\n */\n Base.prototype.setProperties = function (prop, muteOnChange) {\n var prevDetection = this.isProtectedOnChange;\n this.isProtectedOnChange = !!muteOnChange;\n merge(this, prop);\n if (muteOnChange !== true) {\n merge(this.changedProperties, prop);\n this.dataBind();\n }\n else if (isBlazor() && this.isRendered) {\n this.serverDataBind(prop);\n }\n this.finalUpdate();\n this.changedProperties = {};\n this.oldProperties = {};\n this.isProtectedOnChange = prevDetection;\n };\n /**\n * Calls for child element data bind\n *\n * @param {Object} obj ?\n * @param {Object} parent ?\n * @returns {void} ?\n */\n // tslint:disable-next-line:no-any\n Base.callChildDataBind = function (obj, parent) {\n var keys = Object.keys(obj);\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (parent[key] instanceof Array) {\n for (var _a = 0, _b = parent[key]; _a < _b.length; _a++) {\n var obj_1 = _b[_a];\n if (obj_1.dataBind !== undefined) {\n obj_1.dataBind();\n }\n }\n }\n else {\n parent[key].dataBind();\n }\n }\n };\n Base.prototype.clearChanges = function () {\n this.finalUpdate();\n this.changedProperties = {};\n this.oldProperties = {};\n this.childChangedProperties = {};\n };\n /**\n * Bind property changes immediately to components\n *\n * @returns {void} ?\n */\n Base.prototype.dataBind = function () {\n Base.callChildDataBind(this.childChangedProperties, this);\n if (Object.getOwnPropertyNames(this.changedProperties).length) {\n var prevDetection = this.isProtectedOnChange;\n var newChanges = this.changedProperties;\n var oldChanges = this.oldProperties;\n this.clearChanges();\n this.isProtectedOnChange = true;\n this.onPropertyChanged(newChanges, oldChanges);\n this.isProtectedOnChange = prevDetection;\n }\n };\n /* tslint:disable:no-any */\n Base.prototype.serverDataBind = function (newChanges) {\n if (!isBlazor()) {\n return;\n }\n newChanges = newChanges ? newChanges : {};\n extend(this.bulkChanges, {}, newChanges, true);\n var sfBlazor = 'sfBlazor';\n if (this.allowServerDataBinding && window[sfBlazor].updateModel) {\n window[sfBlazor].updateModel(this);\n this.bulkChanges = {};\n }\n };\n /* tslint:enable:no-any */\n Base.prototype.saveChanges = function (key, newValue, oldValue) {\n if (isBlazor()) {\n // tslint:disable-next-line:no-any\n var newChanges = {};\n newChanges[key] = newValue;\n this.serverDataBind(newChanges);\n }\n if (this.isProtectedOnChange) {\n return;\n }\n this.oldProperties[key] = oldValue;\n this.changedProperties[key] = newValue;\n this.finalUpdate();\n this.finalUpdate = setImmediate(this.dataBind.bind(this));\n };\n /** Event Base Section */\n /**\n * Adds the handler to the given event listener.\n *\n * @param {string} eventName - A String that specifies the name of the event\n * @param {Function} handler - Specifies the call to run when the event occurs.\n * @returns {void} ?\n */\n Base.prototype.addEventListener = function (eventName, handler) {\n this.modelObserver.on(eventName, handler);\n };\n /**\n * Removes the handler from the given event listener.\n *\n * @param {string} eventName - A String that specifies the name of the event to remove\n * @param {Function} handler - Specifies the function to remove\n * @returns {void} ?\n */\n Base.prototype.removeEventListener = function (eventName, handler) {\n this.modelObserver.off(eventName, handler);\n };\n /**\n * Triggers the handlers in the specified event.\n *\n * @private\n * @param {string} eventName - Specifies the event to trigger for the specified component properties.\n * Can be a custom event, or any of the standard events.\n * @param {Event} eventProp - Additional parameters to pass on to the event properties\n * @param {Function} successHandler - this function will invoke after event successfully triggered\n * @param {Function} errorHandler - this function will invoke after event if it failured to call.\n * @returns {void} ?\n */\n Base.prototype.trigger = function (eventName, eventProp, successHandler, errorHandler) {\n var _this = this;\n if (this.isDestroyed !== true) {\n var prevDetection = this.isProtectedOnChange;\n this.isProtectedOnChange = false;\n var data = this.modelObserver.notify(eventName, eventProp, successHandler, errorHandler);\n if (isColEName.test(eventName)) {\n var handler = getValue(eventName, this);\n if (handler) {\n var blazor = 'Blazor';\n if (window[blazor]) {\n var promise = handler.call(this, eventProp);\n if (promise && typeof promise.then === 'function') {\n if (!successHandler) {\n data = promise;\n }\n else {\n promise.then(function (data) {\n if (successHandler) {\n data = typeof data === 'string' && _this.modelObserver.isJson(data) ?\n JSON.parse(data) : data;\n successHandler.call(_this, data);\n }\n }).catch(function (data) {\n if (errorHandler) {\n data = typeof data === 'string' && _this.modelObserver.isJson(data) ? JSON.parse(data) : data;\n errorHandler.call(_this, data);\n }\n });\n }\n }\n else if (successHandler) {\n successHandler.call(this, eventProp);\n }\n }\n else {\n handler.call(this, eventProp);\n if (successHandler) {\n successHandler.call(this, eventProp);\n }\n }\n }\n else if (successHandler) {\n successHandler.call(this, eventProp);\n }\n }\n this.isProtectedOnChange = prevDetection;\n return data;\n }\n };\n /**\n * To maintain instance in base class\n *\n * @returns {void} ?\n */\n Base.prototype.addInstance = function () {\n // Add module class to the root element\n var moduleClass = 'e-' + this.getModuleName().toLowerCase();\n addClass([this.element], ['e-lib', moduleClass]);\n if (!isNullOrUndefined(this.element.ej2_instances)) {\n this.element.ej2_instances.push(this);\n }\n else {\n setValue('ej2_instances', [this], this.element);\n }\n };\n /**\n * To remove the instance from the element\n *\n * @returns {void} ?\n */\n Base.prototype.destroy = function () {\n var _this = this;\n // eslint-disable-next-line\n this.element.ej2_instances =\n this.element.ej2_instances.filter(function (i) { return i !== _this; });\n removeClass([this.element], ['e-' + this.getModuleName()]);\n if (this.element.ej2_instances.length === 0) {\n // Remove module class from the root element\n removeClass([this.element], ['e-lib']);\n }\n this.clearChanges();\n this.modelObserver.destroy();\n this.isDestroyed = true;\n };\n return Base;\n}());\nexport { Base };\n/**\n * Global function to get the component instance from the rendered element.\n *\n * @param {HTMLElement} elem Specifies the HTMLElement or element id string.\n * @param {string} comp Specifies the component module name or Component.\n * @returns {any} ?\n */\n// tslint:disable-next-line:no-any\nexport function getComponent(elem, comp) {\n var instance;\n var i;\n var ele = typeof elem === 'string' ? document.getElementById(elem) : elem;\n for (i = 0; i < ele.ej2_instances.length; i++) {\n instance = ele.ej2_instances[i];\n if (typeof comp === 'string') {\n var compName = instance.getModuleName();\n if (comp === compName) {\n return instance;\n }\n }\n else {\n // tslint:disable-next-line:no-any\n if (instance instanceof comp) {\n return instance;\n }\n }\n }\n return undefined;\n}\n/**\n * Function to remove the child instances.\n *\n * @param {HTMLElement} element ?\n * @return {void}\n * @private\n */\n// tslint:disable-next-line:no-any\nexport function removeChildInstance(element) {\n // tslint:disable-next-line:no-any\n var childEle = [].slice.call(element.getElementsByClassName('e-control'));\n for (var i = 0; i < childEle.length; i++) {\n var compName = childEle[i].classList[1].split('e-')[1];\n // tslint:disable-next-line:no-any\n var compInstance = getComponent(childEle[i], compName);\n if (!isUndefined(compInstance)) {\n compInstance.destroy();\n }\n }\n}\n","import { createInstance, isUndefined, merge, extend, getValue } from './util';\n/**\n * Returns the Class Object\n *\n * @param {ClassObject} instance - instance of ClassObject\n * @param {string} curKey - key of the current instance\n * @param {Object} defaultValue - default Value\n * @param {Object[]} type ?\n * @returns {ClassObject} ?\n */\n// eslint-disable-next-line\nfunction getObject(instance, curKey, defaultValue, type) {\n // eslint-disable-next-line\n if (!instance.properties.hasOwnProperty(curKey) || !(instance.properties[curKey] instanceof type)) {\n instance.properties[curKey] = createInstance(type, [instance, curKey, defaultValue]);\n }\n return instance.properties[curKey];\n}\n/**\n * Returns object array\n *\n * @param {ClassObject} instance ?\n * @param {string} curKey ?\n * @param {Object[]} defaultValue ?\n * @param {Object} type ?\n * @param {boolean} isSetter ?\n * @param {boolean} isFactory ?\n * @returns {Object[]} ?\n */\n// eslint-disable-next-line\nfunction getObjectArray(instance, curKey, defaultValue, type, isSetter, isFactory) {\n var result = [];\n var len = defaultValue ? defaultValue.length : 0;\n for (var i = 0; i < len; i++) {\n var curType = type;\n if (isFactory) {\n curType = type(defaultValue[i], instance);\n }\n if (isSetter) {\n var inst = createInstance(curType, [instance, curKey, {}, true]);\n inst.setProperties(defaultValue[i], true);\n result.push(inst);\n }\n else {\n result.push(createInstance(curType, [instance, curKey, defaultValue[i], false]));\n }\n }\n return result;\n}\n/**\n * Returns the properties of the object\n *\n * @param {Object} defaultValue ?\n * @param {string} curKey ?\n * @returns {void} ?\n */\nfunction propertyGetter(defaultValue, curKey) {\n return function () {\n // eslint-disable-next-line\n if (!this.properties.hasOwnProperty(curKey)) {\n this.properties[curKey] = defaultValue;\n }\n return this.properties[curKey];\n };\n}\n/**\n * Set the properties for the object\n *\n * @param {Object} defaultValue ?\n * @param {string} curKey ?\n * @returns {void} ?\n */\nfunction propertySetter(defaultValue, curKey) {\n return function (newValue) {\n if (this.properties[curKey] !== newValue) {\n // eslint-disable-next-line\n var oldVal = this.properties.hasOwnProperty(curKey) ? this.properties[curKey] : defaultValue;\n this.saveChanges(curKey, newValue, oldVal);\n this.properties[curKey] = newValue;\n }\n };\n}\n/**\n * Returns complex objects\n *\n * @param {Object} defaultValue ?\n * @param {string} curKey ?\n * @param {Object[]} type ?\n * @returns {void} ?\n */\n// eslint-disable-next-line\nfunction complexGetter(defaultValue, curKey, type) {\n return function () {\n return getObject(this, curKey, defaultValue, type);\n };\n}\n/**\n * Sets complex objects\n *\n * @param {Object} defaultValue ?\n * @param {string} curKey ?\n * @param {Object[]} type ?\n * @returns {void} ?\n */\nfunction complexSetter(defaultValue, curKey, type) {\n return function (newValue) {\n getObject(this, curKey, defaultValue, type).setProperties(newValue);\n };\n}\n/**\n *\n * @param {Object} defaultValue ?\n * @param {string} curKey ?\n * @param {FunctionConstructor} type ?\n * @returns {void} ?\n */\n// eslint-disable-next-line\nfunction complexFactoryGetter(defaultValue, curKey, type) {\n return function () {\n var curType = type({});\n // eslint-disable-next-line\n if (this.properties.hasOwnProperty(curKey)) {\n return this.properties[curKey];\n }\n else {\n return getObject(this, curKey, defaultValue, curType);\n }\n };\n}\n/**\n *\n * @param {Object} defaultValue ?\n * @param {string} curKey ?\n * @param {Object[]} type ?\n * @returns {void} ?\n */\nfunction complexFactorySetter(defaultValue, curKey, type) {\n return function (newValue) {\n var curType = type(newValue, this);\n getObject(this, curKey, defaultValue, curType).setProperties(newValue);\n };\n}\n/**\n *\n * @param {Object[]} defaultValue ?\n * @param {string} curKey ?\n * @param {Object[]} type ?\n * @returns {void} ?\n */\nfunction complexArrayGetter(defaultValue, curKey, type) {\n return function () {\n var _this = this;\n // eslint-disable-next-line\n if (!this.properties.hasOwnProperty(curKey)) {\n var defCollection = getObjectArray(this, curKey, defaultValue, type, false);\n this.properties[curKey] = defCollection;\n }\n var ignore = ((this.controlParent !== undefined && this.controlParent.ignoreCollectionWatch)\n || this.ignoreCollectionWatch);\n // eslint-disable-next-line\n if (!this.properties[curKey].hasOwnProperty('push') && !ignore) {\n ['push', 'pop'].forEach(function (extendFunc) {\n var descriptor = {\n value: complexArrayDefinedCallback(extendFunc, curKey, type, _this.properties[curKey]).bind(_this),\n configurable: true\n };\n Object.defineProperty(_this.properties[curKey], extendFunc, descriptor);\n });\n }\n // eslint-disable-next-line\n if (!this.properties[curKey].hasOwnProperty('isComplexArray')) {\n Object.defineProperty(this.properties[curKey], 'isComplexArray', { value: true });\n }\n return this.properties[curKey];\n };\n}\n/**\n *\n * @param {Object[]} defaultValue ?\n * @param {string} curKey ?\n * @param {Object[]} type ?\n * @returns {void} ?\n */\nfunction complexArraySetter(defaultValue, curKey, type) {\n return function (newValue) {\n this.isComplexArraySetter = true;\n var oldValueCollection = getObjectArray(this, curKey, defaultValue, type, false);\n var newValCollection = getObjectArray(this, curKey, newValue, type, true);\n this.isComplexArraySetter = false;\n this.saveChanges(curKey, newValCollection, oldValueCollection);\n this.properties[curKey] = newValCollection;\n };\n}\n/**\n *\n * @param {Object[]} defaultValue ?\n * @param {string} curKey ?\n * @param {Object[]} type ?\n * @returns {void} ?\n */\nfunction complexArrayFactorySetter(defaultValue, curKey, type) {\n return function (newValue) {\n // eslint-disable-next-line\n var oldValueCollection = this.properties.hasOwnProperty(curKey) ? this.properties[curKey] : defaultValue;\n var newValCollection = getObjectArray(this, curKey, newValue, type, true, true);\n this.saveChanges(curKey, newValCollection, oldValueCollection);\n this.properties[curKey] = newValCollection;\n };\n}\n/**\n *\n * @param {Object[]} defaultValue ?\n * @param {string} curKey ?\n * @param {FunctionConstructor} type ?\n * @returns {void} ?\n */\nfunction complexArrayFactoryGetter(defaultValue, curKey, type) {\n return function () {\n var curType = type({});\n // eslint-disable-next-line\n if (!this.properties.hasOwnProperty(curKey)) {\n var defCollection = getObjectArray(this, curKey, defaultValue, curType, false);\n this.properties[curKey] = defCollection;\n }\n return this.properties[curKey];\n };\n}\n/**\n *\n * @param {string} dFunc ?\n * @param {string} curKey ?\n * @param {Object} type ?\n * @param {Object} prop ?\n * @returns {Object} ?\n */\nfunction complexArrayDefinedCallback(dFunc, curKey, type, prop) {\n /* tslint:disable no-function-expression */\n return function () {\n var newValue = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n newValue[_i] = arguments[_i];\n }\n var keyString = this.propName ? this.getParentKey() + '.' + curKey + '-' : curKey + '-';\n switch (dFunc) {\n case 'push':\n for (var i = 0; i < newValue.length; i++) {\n Array.prototype[dFunc].apply(prop, [newValue[i]]);\n var model_1 = getArrayModel(keyString + (prop.length - 1), newValue[i], !this.controlParent, dFunc);\n this.serverDataBind(model_1, newValue[i], false, dFunc);\n }\n break;\n case 'pop':\n Array.prototype[dFunc].apply(prop);\n // eslint-disable-next-line\n var model = getArrayModel(keyString + prop.length, null, !this.controlParent, dFunc);\n this.serverDataBind(model, { ejsAction: 'pop' }, false, dFunc);\n break;\n }\n return prop;\n };\n}\n/**\n *\n * @param {string} keyString ?\n * @param {Object} value ?\n * @param {boolean} isControlParent ?\n * @param {string} arrayFunction ?\n * @returns {Object} ?\n */\nfunction getArrayModel(keyString, value, isControlParent, arrayFunction) {\n var modelObject = keyString;\n if (isControlParent) {\n modelObject = {};\n modelObject[keyString] = value;\n if (value && typeof value === 'object') {\n var action = 'ejsAction';\n modelObject[keyString][action] = arrayFunction;\n }\n }\n return modelObject;\n}\n// eslint-disable-next-line\n/**\n * Method used to create property. General syntax below.\n *\n * @param {Object} defaultValue - Specifies the default value of property.\n * @returns {PropertyDecorator} ?\n * ```\n * @Property('TypeScript')\n * propertyName: Type;\n * ```\n * @private\n */\nexport function Property(defaultValue) {\n return function (target, key) {\n var propertyDescriptor = {\n set: propertySetter(defaultValue, key),\n get: propertyGetter(defaultValue, key),\n enumerable: true,\n configurable: true\n };\n //new property creation\n Object.defineProperty(target, key, propertyDescriptor);\n addPropertyCollection(target, key, 'prop', defaultValue);\n };\n}\n/**\n * Method used to create complex property. General syntax below.\n *\n * @param {any} defaultValue - Specifies the default value of property.\n * @param {Function} type - Specifies the class type of complex object.\n * @returns {PropertyDecorator} ?\n * ```\n * @Complex