{"version":3,"file":"ej2-base.min.js","sources":["../../src/util.js","../../src/intl/parser-base.js","../../src/internationalization.js","../../src/template.js","../../src/template-engine.js","../../src/dom.js","../../src/base.js","../../src/notify-property-change.js","../../src/animation.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/virtual-dom.js","../../src/event-handler.js","../../src/module-loader.js","../../src/component.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 * @return {boolean} result\n * @private\n */\nexport function disableBlazorMode() {\n isBlazorPlatform = false;\n}\n/**\n * Create Instance from constructor function with desired parameters.\n * @param {Function} classFunction - Class function to which need to create instance\n * @param {any[]} params - Parameters need to passed while creating instance\n * @return {any}\n * @private\n */\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 * @param {Function} handler - callback function to be triggered.\n * @return {Function}\n * @private\n */\nexport function setImmediate(handler) {\n var unbind;\n var num = new Uint16Array(5);\n var intCrypto = window.msCrypto || window.crypto;\n intCrypto.getRandomValues(num);\n var secret = 'ej2' + combineArray(num);\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 * @param {string} nameSpace - String value to the get the inner object\n * @param {any} obj - Object to get the inner object value.\n * @return {any}\n * @private\n */\nexport function getValue(nameSpace, obj) {\n /* tslint:disable no-any */\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 * @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 * @return {void}\n * @private\n */\nexport function setValue(nameSpace, value, obj) {\n var keys = nameSpace.replace(/\\[/g, '.').replace(/\\]/g, '').split('.');\n var start = obj || {};\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 * @param {any} obj - Object in which we need to delete an item.\n * @param {string} params - String value to the get the inner object\n * @return {void}\n * @private\n */\nexport function deleteObject(obj, key) {\n delete obj[key];\n}\n/**\n * Check weather the given argument is only object.\n * @param {any} obj - Object which is need to check.\n * @return {boolean}\n * @private\n */\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 * @param {any} enumObject - Enum object.\n * @param {string} enumValue - Enum value to be searched\n * @return {any}\n * @private\n */\nexport function getEnumValue(enumObject, enumValue) {\n return enumObject[enumValue];\n}\n/**\n * Merge the source object into destination object.\n * @param {any} source - source object which is going to merge with destination object\n * @param {any} destination - object need to be merged\n * @return {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 * @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 * @return {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 if (!arguments_1[i]) {\n return \"continue\";\n }\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 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 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 * @param {Object} value - To check the object is null or undefined\n * @return {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 * @param {Object} value - To check the object is undefined\n * @return {boolean}\n * @private\n */\nexport function isUndefined(value) {\n return ('undefined' === typeof value);\n}\n/**\n * To return the generated unique name\n * @param {string} definedName - To concatenate the unique id to provided name\n * @return {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 * @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 * @return {Function}\n * @private\n */\nexport function debounce(eventFunction, delay) {\n var out;\n // tslint:disable-next-line\n return function () {\n var _this = this;\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// Added since lint ignored after added '//tslint:disable-next-line' \n/* tslint:disable:no-any */\n/**\n * To convert the object to string for query url\n * @param {Object} data\n * @returns string\n * @private\n */\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 * @param {T[]} value- Specifies the T type array to be checked.\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 * @param{Element} - Specifies the child element to compare with parent.\n * @param{Element} - Specifies the parent element.\n * @return 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 * @param{string} - Specifies the error message to be thrown.\n * @private\n */\nexport function throwError(message) {\n try {\n throw new Error(message);\n }\n catch (e) {\n throw e.message + '\\n' + e.stack;\n }\n}\n/**\n * This function is used to print given element\n * @param{Element} element - Specifies the print content element.\n * @param{Window} printWindow - Specifies the print 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 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 // tslint: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 * @param {number|string} value\n * @return {string} result\n * @private\n */\nexport function formatUnit(value) {\n var result = value + '';\n if (result.match(/auto|%|px|vh|vm|vmax|vmin|em/)) {\n return result;\n }\n return result + 'px';\n}\n/**\n * Function to check whether the platform is blazor or not.\n * @return {boolean} result\n * @private\n */\nexport function enableBlazorMode() {\n isBlazorPlatform = true;\n}\n/**\n * Function to check whether the platform is blazor or not.\n * @return {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 * @return {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 * @param {string | HTMLElement} element\n * @param {any} component\n * @return {Object} inst\n * @private\n */\n// tslint:disable-next-line\nexport function getInstance(element, component) {\n // tslint:disable-next-line:no-any\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 * @param {string | HTMLElement} element\n * @param {Object} instance\n * @return {void}\n * @private\n */\nexport function addInstance(element, instance) {\n // tslint:disable-next-line:no-any\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 * @return {any}\n * @private\n */\n// tslint:disable-next-line:no-any\nexport function uniqueID() {\n // tslint:disable-next-line:no-any\n if ((typeof window) === 'undefined') {\n return;\n }\n // tslint:disable-next-line:no-any\n var num = new Uint16Array(5);\n var intCrypto = window.msCrypto || window.crypto;\n return intCrypto.getRandomValues(num);\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 latnRegex = /^[0-9]*$/;\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 * @private\n */\nvar ParserBase = /** @class */ (function () {\n function ParserBase() {\n }\n /**\n * Returns the cldr object for the culture specifies\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 * @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 * @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 /* tslint:disable no-any */\n if (!res.hasOwnProperty(prop[key])) {\n res[prop[key]] = key;\n }\n }\n return res;\n };\n /**\n * Returns the symbol regex by skipping the escape sequence.\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 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 ret[prop[key]] = defaultNumberSymbols[key];\n }\n return ret;\n };\n /**\n * Returns regex string for provided value\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 * @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 return obj[str];\n });\n };\n /**\n * Returns default numbering system object for formatting from cldr data\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 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 * @param {Object} curObj\n * @param {Object} numberSystem\n * @param {boolean} isNumber\n * @returns {NumberMapper}\n */\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 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};\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 * @private\n */\nexport var cldrData = {};\n/**\n * Specifies the default culture value to be considered.\n * @private\n */\nexport var defaultCulture = 'en-US';\n/**\n * Specifies default currency code to be considered\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 * @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 * @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 * @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 * @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 * @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 * @param {Number} 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 * @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 * @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 * @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 * @param {NumberFormatOptions} option - Specifies the parse options for resultant number pattern.\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 * @returns {number}\n */\n Internationalization.prototype.getFirstDayOfWeek = function () {\n return IntlBase.getWeekData(this.getCulture(), cldrData);\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 * @param {string} cultureName - Specifies the culture name to be set as default culture.\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 * @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 * @param {Object[]} obj 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 * @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 * @param {string} locale - Specifies the locale for which numericObject to be returned.\n * @ignore\n * @private\n */\nexport function getNumericObject(locale, type) {\n /* tslint:disable no-any */\n var numObject = IntlBase.getDependables(cldrData, locale, '', true)[mapper[0]];\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 * @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 * @ignore\n * @private\n */\nexport function getNumberDependable(locale, currency) {\n var numObject = IntlBase.getDependables(cldrData, locale, '', true);\n return IntlBase.getCurrencySymbol(numObject.numericObject, currency);\n}\n/**\n * To get the default date CLDR object.\n * @ignore\n * @private\n */\nexport function getDefaultDateObject(mode) {\n return IntlBase.getDependables(cldrData, '', mode, false)[mapper[1]];\n}\n","/**\n * Template Engine\n */\nvar LINES = new RegExp('\\\\n|\\\\r|\\\\s\\\\s+', 'g');\nvar QUOTES = new RegExp(/'|\"/g);\nvar IF_STMT = new RegExp('if ?\\\\(');\nvar ELSEIF_STMT = new RegExp('else if ?\\\\(');\nvar ELSE_STMT = new RegExp('else');\nvar FOR_STMT = new RegExp('for ?\\\\(');\nvar IF_OR_FOR = new RegExp('(\\/if|\\/for)');\nvar CALL_FUNCTION = new RegExp('\\\\((.*)\\\\)', '');\nvar NOT_NUMBER = new RegExp('^[0-9]+$', 'g');\nvar WORD = new RegExp('[\\\\w\"\\'.\\\\s+]+', 'g');\nvar DBL_QUOTED_STR = new RegExp('\"(.*?)\"', 'g');\nvar WORDIF = new RegExp('[\\\\w\"\\'@#$.\\\\s+]+', 'g');\nvar exp = new RegExp('\\\\${([^}]*)}', 'g');\n// let cachedTemplate: Object = {};\nvar ARR_OBJ = /^\\..*/gm;\nvar SINGLE_SLASH = /\\\\/gi;\nvar DOUBLE_SLASH = /\\\\\\\\/gi;\nvar WORDFUNC = new RegExp('[\\\\w\"\\'@#$.\\\\s+]+', 'g');\nvar WINDOWFUNC = /\\window\\./gm;\n/**\n * The function to set regular expression for template expression string.\n * @param {RegExp} value - Value expression.\n * @private\n */\nexport function expression(value) {\n if (value) {\n exp = value;\n }\n return exp;\n}\n// /**\n// * To render the template string from the given data.\n// * @param {string} template - String Template.\n// * @param {Object[]|JSON} data - DataSource for the template.\n// * @param {Object} helper? - custom helper object.\n// */\n// export function template(template: string, data: JSON, helper?: Object): string {\n// let hash: string = hashCode(template);\n// let tmpl: Function;\n// if (!cachedTemplate[hash]) {\n// tmpl = cachedTemplate[hash] = compile(template, helper);\n// } else {\n// tmpl = cachedTemplate[hash];\n// }\n// return tmpl(data);\n// }\n/**\n * Compile the template string into template function.\n * @param {string} template - The template string which is going to convert.\n * @param {Object} helper? - Helper functions as an object.\n * @private\n */\nexport function compile(template, helper) {\n var argName = 'data';\n var evalExpResult = evalExp(template, argName, helper);\n var fnCode = \"var str=\\\"\" + evalExpResult + \"\\\"; return str;\";\n // tslint:disable-next-line:no-function-constructor-with-string-args\n var fn = new Function(argName, fnCode);\n return fn.bind(helper);\n}\n// function used to evaluate the function expression\nfunction evalExp(str, nameSpace, helper) {\n var varCOunt = 0;\n /**\n * Variable containing Local Keys\n */\n var localKeys = [];\n var isClass = str.match(/class=\"([^\\\"]+|)\\s{2}/g);\n var singleSpace = '';\n if (isClass) {\n isClass.forEach(function (value) {\n singleSpace = value.replace(/\\s\\s+/g, ' ');\n str = str.replace(value, singleSpace);\n });\n }\n return str.replace(LINES, '').replace(DBL_QUOTED_STR, '\\'$1\\'').replace(exp, function (match, cnt, offset, matchStr) {\n var SPECIAL_CHAR = /\\@|\\#|\\$/gm;\n var matches = cnt.match(CALL_FUNCTION);\n // matches to detect any function calls\n if (matches) {\n var rlStr = matches[1];\n if (ELSEIF_STMT.test(cnt)) {\n //handling else-if condition\n cnt = '\";} ' + cnt.replace(matches[1], rlStr.replace(WORD, function (str) {\n str = str.trim();\n return addNameSpace(str, !(QUOTES.test(str)) && (localKeys.indexOf(str) === -1), nameSpace, localKeys);\n })) + '{ \\n str = str + \"';\n }\n else if (IF_STMT.test(cnt)) {\n //handling if condition\n cnt = '\"; ' + cnt.replace(matches[1], rlStr.replace(WORDIF, function (strs) {\n return HandleSpecialCharArrObj(strs, nameSpace, localKeys);\n })) + '{ \\n str = str + \"';\n }\n else if (FOR_STMT.test(cnt)) {\n //handling for condition\n var rlStr_1 = matches[1].split(' of ');\n // replace for each into actual JavaScript\n cnt = '\"; ' + cnt.replace(matches[1], function (mtc) {\n localKeys.push(rlStr_1[0]);\n localKeys.push(rlStr_1[0] + 'Index');\n varCOunt = varCOunt + 1;\n // tslint:disable-next-line\n return 'var i' + varCOunt + '=0; i' + varCOunt + ' < ' + addNameSpace(rlStr_1[1], true, nameSpace, localKeys) + '.length; i' + varCOunt + '++';\n }) + '{ \\n ' + rlStr_1[0] + '= ' + addNameSpace(rlStr_1[1], true, nameSpace, localKeys)\n + '[i' + varCOunt + ']; \\n var ' + rlStr_1[0] + 'Index=i' + varCOunt + '; \\n str = str + \"';\n }\n else {\n //helper function handling\n var fnStr = cnt.split('(');\n var fNameSpace = (helper && helper.hasOwnProperty(fnStr[0]) ? 'this.' : 'global');\n fNameSpace = (/\\./.test(fnStr[0]) ? '' : fNameSpace);\n var ftArray = matches[1].split(',');\n if (matches[1].length !== 0 && !(/data/).test(ftArray[0]) && !(/window./).test(ftArray[0])) {\n matches[1] = (fNameSpace === 'global' ? nameSpace + '.' + matches[1] : matches[1]);\n }\n var splRegexp = /\\@|\\$|\\#/gm;\n var arrObj = /\\]\\./gm;\n if (WINDOWFUNC.test(cnt) && arrObj.test(cnt) || splRegexp.test(cnt)) {\n var splArrRegexp = /\\@|\\$|\\#|\\]\\./gm;\n if (splArrRegexp.test(cnt)) {\n // tslint:disable-next-line\n cnt = '\"+ ' + (fNameSpace === 'global' ? '' : fNameSpace) + cnt.replace(matches[1], rlStr.replace(WORDFUNC, function (strs) {\n return HandleSpecialCharArrObj(strs, nameSpace, localKeys);\n })) + '+ \"';\n }\n }\n else {\n cnt = '\" + ' + (fNameSpace === 'global' ? '' : fNameSpace) +\n cnt.replace(rlStr, addNameSpace(matches[1].replace(/,( |)data.|,/gi, ',' + nameSpace + '.').replace(/,( |)data.window/gi, ',window'), (fNameSpace === 'global' ? false : true), nameSpace, localKeys)) +\n '+\"';\n }\n }\n }\n else if (ELSE_STMT.test(cnt)) {\n // handling else condition\n cnt = '\"; ' + cnt.replace(ELSE_STMT, '} else { \\n str = str + \"');\n }\n else if (!!cnt.match(IF_OR_FOR)) {\n // close condition \n cnt = cnt.replace(IF_OR_FOR, '\"; \\n } \\n str = str + \"');\n }\n else if (SPECIAL_CHAR.test(cnt)) {\n // template string with double slash with special character\n if (cnt.match(SINGLE_SLASH)) {\n cnt = SlashReplace(cnt);\n }\n cnt = '\"+' + NameSpaceForspecialChar(cnt, (localKeys.indexOf(cnt) === -1), nameSpace, localKeys) + '\"]+\"';\n }\n else {\n // template string with double slash\n if (cnt.match(SINGLE_SLASH)) {\n cnt = SlashReplace(cnt);\n cnt = '\"+' + NameSpaceForspecialChar(cnt, (localKeys.indexOf(cnt) === -1), nameSpace, localKeys) + '\"]+\"';\n }\n else {\n // evaluate normal expression\n cnt = '\"+' + addNameSpace(cnt.replace(/\\,/gi, '+' + nameSpace + '.'), (localKeys.indexOf(cnt) === -1), nameSpace, localKeys) + '+\"';\n }\n }\n return cnt;\n });\n}\nfunction addNameSpace(str, addNS, nameSpace, ignoreList) {\n return ((addNS && !(NOT_NUMBER.test(str)) && ignoreList.indexOf(str.split('.')[0]) === -1) ? nameSpace + '.' + str : str);\n}\nfunction NameSpaceArrObj(str, addNS, nameSpace, ignoreList) {\n var arrObjReg = /^\\..*/gm;\n return ((addNS && !(NOT_NUMBER.test(str)) &&\n ignoreList.indexOf(str.split('.')[0]) === -1 && !(arrObjReg.test(str))) ? nameSpace + '.' + str : str);\n}\n// // Create hashCode for template string to storeCached function\n// function hashCode(str: string): string {\n// return str.split('').reduce((a: number, b: string) => { a = ((a << 5) - a) + b.charCodeAt(0); return a & a; }, 0).toString();\n// }\nfunction NameSpaceForspecialChar(str, addNS, nameSpace, ignoreList) {\n return ((addNS && !(NOT_NUMBER.test(str)) && ignoreList.indexOf(str.split('.')[0]) === -1) ? nameSpace + '[\"' + str : str);\n}\n// tslint:disable-next-line\nfunction SlashReplace(tempStr) {\n // tslint:disable-next-line\n var double = \"\\\\\\\\\";\n if (tempStr.match(DOUBLE_SLASH)) {\n tempStr = tempStr;\n }\n else {\n tempStr = tempStr.replace(SINGLE_SLASH, double);\n }\n return tempStr;\n}\nfunction HandleSpecialCharArrObj(str, nameSpaceNew, keys) {\n str = str.trim();\n var windowFunc = /\\window\\./gm;\n if (!windowFunc.test(str)) {\n var quotes = /'|\"/gm;\n var splRegexp = /\\@|\\$|\\#/gm;\n if (splRegexp.test(str)) {\n str = NameSpaceForspecialChar(str, (keys.indexOf(str) === -1), nameSpaceNew, keys) + '\"]';\n }\n if (ARR_OBJ.test(str)) {\n return NameSpaceArrObj(str, !(quotes.test(str)) && (keys.indexOf(str) === -1), nameSpaceNew, keys);\n }\n else {\n return addNameSpace(str, !(quotes.test(str)) && (keys.indexOf(str) === -1), nameSpaceNew, keys);\n }\n }\n else {\n return str;\n }\n}\n","/**\n * Template Engine Bridge\n */\nimport { compile as render } from './template';\nimport { createElement } from './dom';\nimport { isNullOrUndefined, isBlazor } from './util';\nvar HAS_ROW = /^[\\n\\r.]+\\