{"version":3,"file":"ej2.upload.min.js","sources":["../../../../node_modules/@syncfusion/ej2-base/src/util.js","../../../../node_modules/@syncfusion/ej2-base/src/dom.js","../../../../node_modules/@syncfusion/ej2-base/src/notify-property-change.js","../../../../node_modules/@syncfusion/ej2-base/src/animation.js","../../../../node_modules/@syncfusion/ej2-base/src/template.js","../../../../node_modules/@syncfusion/ej2-base/src/template-engine.js","../../../../node_modules/@syncfusion/ej2-popups/src/common/position.js","../../../../node_modules/@syncfusion/ej2-popups/src/common/collision.js","../../../../node_modules/@syncfusion/ej2-popups/src/popup/popup.js","../../../../node_modules/@syncfusion/ej2-buttons/src/common/common.js","../../../../node_modules/@syncfusion/ej2-popups/src/common/resize.js","../../../../node_modules/@syncfusion/ej2-popups/src/spinner/spinner.js","../../../../node_modules/@syncfusion/ej2-base/src/ajax.js","../../../../node_modules/@syncfusion/ej2-base/src/event-handler.js","../../../../node_modules/@syncfusion/ej2-base/src/observer.js","../../../../node_modules/@syncfusion/ej2-base/src/base.js","../../../../node_modules/@syncfusion/ej2-base/src/browser.js","../../../../node_modules/@syncfusion/ej2-base/src/intl/intl-base.js","../../../../node_modules/@syncfusion/ej2-base/src/module-loader.js","../../../../node_modules/@syncfusion/ej2-base/src/child-property.js","../../../../node_modules/@syncfusion/ej2-base/src/intl/parser-base.js","../../../../node_modules/@syncfusion/ej2-base/src/intl/number-formatter.js","../../../../node_modules/@syncfusion/ej2-base/src/hijri-parser.js","../../../../node_modules/@syncfusion/ej2-base/src/intl/date-formatter.js","../../../../node_modules/@syncfusion/ej2-base/src/component.js","../../../../node_modules/@syncfusion/ej2-base/src/intl/date-parser.js","../../../../node_modules/@syncfusion/ej2-base/src/intl/number-parser.js","../../../../node_modules/@syncfusion/ej2-base/src/internationalization.js","../../../../node_modules/@syncfusion/ej2-base/src/draggable.js","../../../../node_modules/@syncfusion/ej2-popups/src/dialog/dialog.js","../../../../node_modules/@syncfusion/ej2-base/src/droppable.js","../../../../node_modules/@syncfusion/ej2-base/src/keyboard.js","../../../../node_modules/@syncfusion/ej2-base/src/l10n.js","../../../../node_modules/@syncfusion/ej2-base/src/touch.js","../../../../node_modules/@syncfusion/ej2-buttons/src/button/button.js","../../../../node_modules/@syncfusion/ej2-buttons/src/check-box/check-box.js","../../../../node_modules/@syncfusion/ej2-buttons/src/radio-button/radio-button.js","../../../../node_modules/@syncfusion/ej2-buttons/src/switch/switch.js","../../../../node_modules/@syncfusion/ej2-buttons/src/chips/chip-list.js","../../../../node_modules/@syncfusion/ej2-popups/src/tooltip/tooltip.js","../../../../node_modules/@syncfusion/ej2-inputs/src/uploader/uploader.js","../../../src/ej2-1557059166900/script.js","../../../../node_modules/@syncfusion/ej2-inputs/uploader.js"],"sourcesContent":["var instances = 'ej2_instances';\nvar uid = 0;\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 || {};\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 if (deep && (isObject(copy) || Array.isArray(copy))) {\n if (isObject(copy)) {\n clone = src ? src : {};\n result[key] = extend({}, clone, copy, deep);\n }\n else {\n clone = 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('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 === 'auto' || result.indexOf('%') !== -1 || result.indexOf('px') !== -1) {\n return result;\n }\n return result + 'px';\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 * Functions related to dom operations.\n */\nimport { EventHandler } from './event-handler';\nimport { isNullOrUndefined } from './util';\nvar SVG_REG = /^svg|^path|^g/;\n/**\n * Function to create Html element.\n * @param tagName - Name of the tag, id and class names.\n * @param properties - Object to set properties in the element.\n * @param properties.id - To set the id to the created element.\n * @param properties.className - To add classes to the element.\n * @param properties.innerHTML - To set the innerHTML to element.\n * @param properties.styles - To set the some custom styles to element.\n * @param properties.attrs - To set the attributes to element.\n * @private\n */\nexport function createElement(tagName, properties) {\n //tslint:disable-next-line\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 * @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 * @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 (!ele.classList.contains(className)) {\n ele.classList.add(className);\n }\n }\n }\n return elements;\n}\n/**\n * The function used to add the classes to array of elements\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 * @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 if (ele.className !== '') {\n for (var _b = 0, classList_2 = classList; _b < classList_2.length; _b++) {\n var className = classList_2[_b];\n ele.classList.remove(className);\n }\n }\n }\n return elements;\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 * @param {Element|Node} element - An element the need to check visibility\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 * @param {Element[]|NodeList} fromElements - An array of elements that need to prepend.\n * @param {Element} toElement - An element that is going to prepend.\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 * @param {Element[]|NodeList} fromElements - An array of elements that need to append.\n * @param {Element} toElement - An element that is going to prepend.\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 * @param ele - An element is going to evaluate the script\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 the\n * @param {Element|Node|HTMLElement} element - An element that is going to detach from the Dom\n * @private\n */\nexport function detach(element) {\n var parentNode = element.parentNode;\n return parentNode.removeChild(element);\n}\n/**\n * The function used to remove the element from Dom also clear the bounded events\n * @param {Element|Node|HTMLElement} element - An element remove from the Dom\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 * @param {Element|Node} element - An element that need to set attributes.\n * @param {{[key:string]:string}} attributes - JSON Object that is going to as attributes.\n * @private\n */\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 ele.setAttribute(key, attributes[key]);\n }\n return ele;\n}\n/**\n * The function selects the element from giving context.\n * @param {string} selector - Selector string need fetch element from the\n * @param {Document|Element=document} context - It is an optional type, That specifies a Dom context.\n * @private\n */\nexport function select(selector, context) {\n if (context === void 0) { context = document; }\n return context.querySelector(selector);\n}\n/**\n * The function selects an array of element from the given context.\n * @param {string} selector - Selector string need fetch element from the\n * @param {Document|Element=document} context - It is an optional type, That specifies a Dom context.\n * @private\n */\nexport function selectAll(selector, context) {\n if (context === void 0) { context = document; }\n var nodeList = context.querySelectorAll(selector);\n return nodeList;\n}\n/**\n * Returns single closest parent element based on class selector.\n * @param {Element} element - An element that need to find the closest element.\n * @param {string} selector - A classSelector of closest 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 * @param {Element|Node} element - An element that need to get siblings.\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 * @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 * @private\n */\nexport function getAttributeOrDefault(element, property, value) {\n var attrVal = element.getAttribute(property);\n if (isNullOrUndefined(attrVal)) {\n element.setAttribute(property, value.toString());\n attrVal = value;\n }\n return attrVal;\n}\n/**\n * Set the style attributes to Html element.\n * @param {HTMLElement} element - Element which we want to set attributes\n * @param {any} attrs - Set the given attributes to element\n * @return {void}\n * @private\n */\nexport function setStyleAttribute(element, attrs) {\n if (attrs !== undefined) {\n Object.keys(attrs).forEach(function (key) {\n // tslint:disable-next-line:no-any\n element.style[key] = attrs[key];\n });\n }\n}\n/**\n * Method for add and remove classes to a dom element.\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 * @return {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 * @param {Element} element - Element to compare with the selector.\n * @param {string} selector - String selector which element will satisfy.\n * @return {void}\n * @private\n */\nexport function matches(element, selector) {\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","import { createInstance, isUndefined, merge, extend, getValue } from './util';\n/**\n * Returns the Class Object\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 */\nfunction getObject(instance, curKey, defaultValue, type) {\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 * @param {ClassObject} instance\n * @param {string} curKey\n * @param {Object[]} defaultValue\n * @param type\n * @param {boolean} isSetter\n * @returns {Object[]}\n */\nfunction getObjectArray(instance, curKey, defaultValue, type, isSetter, isFactory) {\n var result = [];\n var len = defaultValue.length;\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], true]));\n }\n }\n return result;\n}\n/**\n * Returns the properties of the object\n * @param {Object} defaultValue\n * @param {string} curKey\n */\nfunction propertyGetter(defaultValue, curKey) {\n return function () {\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 * @param {Object} defaultValue\n * @param {string} curKey\n */\nfunction propertySetter(defaultValue, curKey) {\n return function (newValue) {\n if (this.properties[curKey] !== newValue) {\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 */\nfunction complexGetter(defaultValue, curKey, type) {\n return function () {\n return getObject(this, curKey, defaultValue, type);\n };\n}\n/**\n * Sets complex objects\n */\nfunction complexSetter(defaultValue, curKey, type) {\n return function (newValue) {\n getObject(this, curKey, defaultValue, type).setProperties(newValue);\n };\n}\nfunction complexFactoryGetter(defaultValue, curKey, type) {\n return function () {\n var curType = type({});\n if (this.properties.hasOwnProperty(curKey)) {\n return this.properties[curKey];\n }\n else {\n return getObject(this, curKey, defaultValue, curType);\n }\n };\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}\nfunction complexArrayGetter(defaultValue, curKey, type) {\n return function () {\n if (!this.properties.hasOwnProperty(curKey)) {\n var defCollection = getObjectArray(this, curKey, defaultValue, type, false);\n this.properties[curKey] = defCollection;\n }\n return this.properties[curKey];\n };\n}\nfunction complexArraySetter(defaultValue, curKey, type) {\n return function (newValue) {\n var oldValueCollection = getObjectArray(this, curKey, defaultValue, type, false);\n var newValCollection = getObjectArray(this, curKey, newValue, type, true);\n this.saveChanges(curKey, newValCollection, oldValueCollection);\n this.properties[curKey] = newValCollection;\n };\n}\nfunction complexArrayFactorySetter(defaultValue, curKey, type) {\n return function (newValue) {\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}\nfunction complexArrayFactoryGetter(defaultValue, curKey, type) {\n return function () {\n var curType = type({});\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 * Method used to create property. General syntax below.\n * @param {T} defaultValue? - Specifies the default value of property.\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 * @param {T} defaultValue - Specifies the default value of property.\n * @param {Function} type - Specifies the class type of complex object.\n * ```\n * @Complex