UNPKG

@progress/telerik-jquery-report-viewer

Version:

Progress® Telerik® Report Viewer for jQuery

1,275 lines (1,274 loc) 2.37 MB
'use strict'; /*! * Copyright 2023 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ (function(factory) { typeof define === "function" && define.amd ? define(["jquery"], factory) : factory(); })(function() { var packageMetadata = { name: "@progress/kendo-ui", productName: "Kendo UI", productCodes: ["KENDOUICOMPLETE", "KENDOUI", "KENDOUI", "KENDOUICOMPLETE"], publishDate: 0, version: "2022.3.2112".replace(/^\s+|\s+$/g, ""), licensingDocsUrl: "https://docs.telerik.com/kendo-ui/intro/installation/using-license-code" }; (function($2, window2, undefined$1) { var kendo2 = window2.kendo = window2.kendo || { cultures: {} }, extend = $2.extend, each = $2.each, isArray = Array.isArray, noop = $2.noop, math = Math, Template, JSON2 = window2.JSON || {}, support2 = {}, percentRegExp = /%/, formatRegExp = /\{(\d+)(:[^\}]+)?\}/g, boxShadowRegExp = /(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+)?/i, numberRegExp = /^(\+|-?)\d+(\.?)\d*$/, FUNCTION = "function", STRING = "string", NUMBER = "number", OBJECT = "object", NULL = "null", BOOLEAN = "boolean", UNDEFINED = "undefined", PREFIX = "prefix", ARIA_LABELLEDBY = "aria-labelledby", ARIA_LABEL = "aria-label", LABELIDPART = "_label", getterCache = {}, setterCache = {}, slice = [].slice, cssPropertiesNames = ["themeColor", "fillMode", "shape", "size", "rounded", "positionMode"], noDepricateExtend = function() { var arguments$1 = arguments; var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; if (typeof target === "boolean") { deep = target; target = arguments[i] || {}; i++; } if (typeof target !== "object" && typeof target !== "function") { target = {}; } if (i === length) { target = this; i--; } for (; i < length; i++) { if ((options = arguments$1[i]) != null) { for (name in options) { if (name == "filters" || name == "concat" || name == ":") { continue; } src = target[name]; copy = options[name]; if (target === copy) { continue; } if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) { if (copyIsArray) { copyIsArray = false; clone = src && Array.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } target[name] = noDepricateExtend(deep, clone, copy); } else if (copy !== undefined$1) { target[name] = copy; } } } } return target; }; kendo2.version = "2022.3.2112".replace(/^\s+|\s+$/g, ""); function Class2() { } Class2.extend = function(proto) { var base = function() { }, member, that = this, subclass = proto && proto.init ? proto.init : function() { that.apply(this, arguments); }, fn; base.prototype = that.prototype; fn = subclass.fn = subclass.prototype = new base(); for (member in proto) { if (proto[member] != null && proto[member].constructor === Object) { fn[member] = extend(true, {}, base.prototype[member], proto[member]); } else { fn[member] = proto[member]; } } fn.constructor = subclass; subclass.extend = that.extend; return subclass; }; Class2.prototype._initOptions = function(options) { this.options = deepExtend({}, this.options, options); }; var isFunction2 = kendo2.isFunction = function(fn) { return typeof fn === "function"; }; var preventDefault = function() { this._defaultPrevented = true; }; var isDefaultPrevented = function() { return this._defaultPrevented === true; }; var Observable = Class2.extend({ init: function() { this._events = {}; }, bind: function(eventName, handlers, one) { var that = this, idx, eventNames = typeof eventName === STRING ? [eventName] : eventName, length, original, handler, handlersIsFunction = typeof handlers === FUNCTION, events; if (handlers === undefined$1) { for (idx in eventName) { that.bind(idx, eventName[idx]); } return that; } for (idx = 0, length = eventNames.length; idx < length; idx++) { eventName = eventNames[idx]; handler = handlersIsFunction ? handlers : handlers[eventName]; if (handler) { if (one) { original = handler; handler = function() { that.unbind(eventName, handler); original.apply(that, arguments); }; handler.original = original; } events = that._events[eventName] = that._events[eventName] || []; events.push(handler); } } return that; }, one: function(eventNames, handlers) { return this.bind(eventNames, handlers, true); }, first: function(eventName, handlers) { var that = this, idx, eventNames = typeof eventName === STRING ? [eventName] : eventName, length, handler, handlersIsFunction = typeof handlers === FUNCTION, events; for (idx = 0, length = eventNames.length; idx < length; idx++) { eventName = eventNames[idx]; handler = handlersIsFunction ? handlers : handlers[eventName]; if (handler) { events = that._events[eventName] = that._events[eventName] || []; events.unshift(handler); } } return that; }, trigger: function(eventName, e) { var that = this, events = that._events[eventName], idx, length; if (events) { e = e || {}; e.sender = that; e._defaultPrevented = false; e.preventDefault = preventDefault; e.isDefaultPrevented = isDefaultPrevented; events = events.slice(); for (idx = 0, length = events.length; idx < length; idx++) { events[idx].call(that, e); } return e._defaultPrevented === true; } return false; }, unbind: function(eventName, handler) { var that = this, events = that._events[eventName], idx; if (eventName === undefined$1) { that._events = {}; } else if (events) { if (handler) { for (idx = events.length - 1; idx >= 0; idx--) { if (events[idx] === handler || events[idx].original === handler) { events.splice(idx, 1); } } } else { that._events[eventName] = []; } } return that; } }); function compilePart(part, stringPart) { if (stringPart) { return "'" + part.split("'").join("\\'").split('\\"').join('\\\\\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t") + "'"; } else { var first = part.charAt(0), rest = part.substring(1); if (first === "=") { return "+(" + rest + ")+"; } else if (first === ":") { return "+$kendoHtmlEncode(" + rest + ")+"; } else { return ";" + part + ";$kendoOutput+="; } } } var argumentNameRegExp = /^\w+/, encodeRegExp = /\$\{([^}]*)\}/g, escapedCurlyRegExp = /\\\}/g, curlyRegExp = /__CURLY__/g, escapedSharpRegExp = /\\#/g, sharpRegExp = /__SHARP__/g, zeros = ["", "0", "00", "000", "0000"]; Template = { paramName: "data", // name of the parameter of the generated template useWithBlock: true, // whether to wrap the template in a with() block render: function(template, data) { var idx, length, html = ""; for (idx = 0, length = data.length; idx < length; idx++) { html += template(data[idx]); } return html; }, compile: function(template, options) { var settings = extend({}, this, options), paramName = settings.paramName, argumentName = paramName.match(argumentNameRegExp)[0], useWithBlock = settings.useWithBlock, functionBody = "var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;", fn, parts, idx; if (isFunction2(template)) { return template; } functionBody += useWithBlock ? "with(" + paramName + "){" : ""; functionBody += "$kendoOutput="; parts = template.replace(escapedCurlyRegExp, "__CURLY__").replace(encodeRegExp, "#=$kendoHtmlEncode($1)#").replace(curlyRegExp, "}").replace(escapedSharpRegExp, "__SHARP__").split("#"); for (idx = 0; idx < parts.length; idx++) { functionBody += compilePart(parts[idx], idx % 2 === 0); } functionBody += useWithBlock ? ";}" : ";"; functionBody += "return $kendoOutput;"; functionBody = functionBody.replace(sharpRegExp, "#"); try { fn = new Function(argumentName, functionBody); fn._slotCount = Math.floor(parts.length / 2); return fn; } catch (e) { throw new Error(kendo2.format("Invalid template:'{0}' Generated code:'{1}'", template, functionBody)); } } }; function pad(number, digits, end) { number = number + ""; digits = digits || 2; end = digits - number.length; if (end) { return zeros[digits].substring(0, end) + number; } return number; } (function() { var escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = { "\b": "\\b", " ": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" }, rep, toString = {}.toString; if (typeof Date.prototype.toJSON !== FUNCTION) { Date.prototype.toJSON = function() { var that = this; return isFinite(that.valueOf()) ? pad(that.getUTCFullYear(), 4) + "-" + pad(that.getUTCMonth() + 1) + "-" + pad(that.getUTCDate()) + "T" + pad(that.getUTCHours()) + ":" + pad(that.getUTCMinutes()) + ":" + pad(that.getUTCSeconds()) + "Z" : null; }; String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() { return this.valueOf(); }; } function quote(string) { escapable.lastIndex = 0; return escapable.test(string) ? '"' + string.replace(escapable, function(a) { var c = meta[a]; return typeof c === STRING ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4); }) + '"' : '"' + string + '"'; } function str(key, holder) { var i, k, v, length, mind = gap, partial, value = holder[key], type; if (value && typeof value === OBJECT && typeof value.toJSON === FUNCTION) { value = value.toJSON(key); } if (typeof rep === FUNCTION) { value = rep.call(holder, key, value); } type = typeof value; if (type === STRING) { return quote(value); } else if (type === NUMBER) { return isFinite(value) ? String(value) : NULL; } else if (type === BOOLEAN || type === NULL) { return String(value); } else if (type === OBJECT) { if (!value) { return NULL; } gap += indent; partial = []; if (toString.apply(value) === "[object Array]") { length = value.length; for (i = 0; i < length; i++) { partial[i] = str(i, value) || NULL; } v = partial.length === 0 ? "[]" : gap ? "[\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial.join(",") + "]"; gap = mind; return v; } if (rep && typeof rep === OBJECT) { length = rep.length; for (i = 0; i < length; i++) { if (typeof rep[i] === STRING) { k = rep[i]; v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ": " : ":") + v); } } } } else { for (k in value) { if (Object.hasOwnProperty.call(value, k)) { v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ": " : ":") + v); } } } } v = partial.length === 0 ? "{}" : gap ? "{\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "}" : "{" + partial.join(",") + "}"; gap = mind; return v; } } if (typeof JSON2.stringify !== FUNCTION) { JSON2.stringify = function(value, replacer, space) { var i; gap = ""; indent = ""; if (typeof space === NUMBER) { for (i = 0; i < space; i += 1) { indent += " "; } } else if (typeof space === STRING) { indent = space; } rep = replacer; if (replacer && typeof replacer !== FUNCTION && (typeof replacer !== OBJECT || typeof replacer.length !== NUMBER)) { throw new Error("JSON.stringify"); } return str("", { "": value }); }; } })(); (function() { var dateFormatRegExp = /dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|HH|H|hh|h|mm|m|fff|ff|f|tt|ss|s|zzz|zz|z|"[^"]*"|'[^']*'/g, standardFormatRegExp = /^(n|c|p|e)(\d*)$/i, literalRegExp = /(\\.)|(['][^']*[']?)|(["][^"]*["]?)/g, commaRegExp = /\,/g, EMPTY = "", POINT = ".", COMMA = ",", SHARP = "#", ZERO = "0", PLACEHOLDER = "??", EN = "en-US", objectToString = {}.toString; kendo2.cultures["en-US"] = { name: EN, numberFormat: { pattern: ["-n"], decimals: 2, ",": ",", ".": ".", groupSize: [3], percent: { pattern: ["-n %", "n %"], decimals: 2, ",": ",", ".": ".", groupSize: [3], symbol: "%" }, currency: { name: "US Dollar", abbr: "USD", pattern: ["($n)", "$n"], decimals: 2, ",": ",", ".": ".", groupSize: [3], symbol: "$" } }, calendars: { standard: { days: { names: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], namesAbbr: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], namesShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] }, months: { names: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], namesAbbr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] }, AM: ["AM", "am", "AM"], PM: ["PM", "pm", "PM"], patterns: { d: "M/d/yyyy", D: "dddd, MMMM dd, yyyy", F: "dddd, MMMM dd, yyyy h:mm:ss tt", g: "M/d/yyyy h:mm tt", G: "M/d/yyyy h:mm:ss tt", m: "MMMM dd", M: "MMMM dd", s: "yyyy'-'MM'-'ddTHH':'mm':'ss", t: "h:mm tt", T: "h:mm:ss tt", u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'", y: "MMMM, yyyy", Y: "MMMM, yyyy" }, "/": "/", ":": ":", firstDay: 0, twoDigitYearMax: 2029 } } }; function findCulture(culture) { if (culture) { if (culture.numberFormat) { return culture; } if (typeof culture === STRING) { var cultures = kendo2.cultures; return cultures[culture] || cultures[culture.split("-")[0]] || null; } return null; } return null; } function getCulture(culture) { if (culture) { culture = findCulture(culture); } return culture || kendo2.cultures.current; } kendo2.culture = function(cultureName) { var cultures = kendo2.cultures, culture; if (cultureName !== undefined$1) { culture = findCulture(cultureName) || cultures[EN]; culture.calendar = culture.calendars.standard; cultures.current = culture; } else { return cultures.current; } }; kendo2.findCulture = findCulture; kendo2.getCulture = getCulture; kendo2.culture(EN); function formatDate(date, format, culture) { culture = getCulture(culture); var calendar = culture.calendars.standard, days = calendar.days, months = calendar.months; format = calendar.patterns[format] || format; return format.replace(dateFormatRegExp, function(match) { var minutes; var result; var sign; if (match === "d") { result = date.getDate(); } else if (match === "dd") { result = pad(date.getDate()); } else if (match === "ddd") { result = days.namesAbbr[date.getDay()]; } else if (match === "dddd") { result = days.names[date.getDay()]; } else if (match === "M") { result = date.getMonth() + 1; } else if (match === "MM") { result = pad(date.getMonth() + 1); } else if (match === "MMM") { result = months.namesAbbr[date.getMonth()]; } else if (match === "MMMM") { result = months.names[date.getMonth()]; } else if (match === "yy") { result = pad(date.getFullYear() % 100); } else if (match === "yyyy") { result = pad(date.getFullYear(), 4); } else if (match === "h") { result = date.getHours() % 12 || 12; } else if (match === "hh") { result = pad(date.getHours() % 12 || 12); } else if (match === "H") { result = date.getHours(); } else if (match === "HH") { result = pad(date.getHours()); } else if (match === "m") { result = date.getMinutes(); } else if (match === "mm") { result = pad(date.getMinutes()); } else if (match === "s") { result = date.getSeconds(); } else if (match === "ss") { result = pad(date.getSeconds()); } else if (match === "f") { result = math.floor(date.getMilliseconds() / 100); } else if (match === "ff") { result = date.getMilliseconds(); if (result > 99) { result = math.floor(result / 10); } result = pad(result); } else if (match === "fff") { result = pad(date.getMilliseconds(), 3); } else if (match === "tt") { result = date.getHours() < 12 ? calendar.AM[0] : calendar.PM[0]; } else if (match === "zzz") { minutes = date.getTimezoneOffset(); sign = minutes < 0; result = math.abs(minutes / 60).toString().split(".")[0]; minutes = math.abs(minutes) - result * 60; result = (sign ? "+" : "-") + pad(result); result += ":" + pad(minutes); } else if (match === "zz" || match === "z") { result = date.getTimezoneOffset() / 60; sign = result < 0; result = math.abs(result).toString().split(".")[0]; result = (sign ? "+" : "-") + (match === "zz" ? pad(result) : result); } return result !== undefined$1 ? result : match.slice(1, match.length - 1); }); } function formatNumber(number, format, culture) { culture = getCulture(culture); var numberFormat = culture.numberFormat, decimal = numberFormat[POINT], precision = numberFormat.decimals, pattern = numberFormat.pattern[0], literals = [], symbol, isCurrency, isPercent, customPrecision, formatAndPrecision, negative = number < 0, integer, fraction, integerLength, replacement = EMPTY, value = EMPTY, idx, length, ch, hasGroup, hasNegativeFormat, decimalIndex, sharpIndex, zeroIndex, hasZero, hasSharp, percentIndex, currencyIndex, start = -1, end; if (number === undefined$1) { return EMPTY; } if (!isFinite(number)) { return number; } if (!format) { return culture.name.length ? number.toLocaleString() : number.toString(); } formatAndPrecision = standardFormatRegExp.exec(format); if (formatAndPrecision) { format = formatAndPrecision[1].toLowerCase(); isCurrency = format === "c"; isPercent = format === "p"; if (isCurrency || isPercent) { numberFormat = isCurrency ? numberFormat.currency : numberFormat.percent; decimal = numberFormat[POINT]; precision = numberFormat.decimals; symbol = numberFormat.symbol; pattern = numberFormat.pattern[negative ? 0 : 1]; } customPrecision = formatAndPrecision[2]; if (customPrecision) { precision = +customPrecision; } if (format === "e") { var exp = customPrecision ? number.toExponential(precision) : number.toExponential(); return exp.replace(POINT, numberFormat[POINT]); } if (isPercent) { number *= 100; } number = round(number, precision); negative = number < 0; number = number.split(POINT); integer = number[0]; fraction = number[1]; if (negative) { integer = integer.substring(1); } value = groupInteger(integer, 0, integer.length, numberFormat); if (fraction) { value += decimal + fraction; } if (format === "n" && !negative) { return value; } number = EMPTY; for (idx = 0, length = pattern.length; idx < length; idx++) { ch = pattern.charAt(idx); if (ch === "n") { number += value; } else if (ch === "$" || ch === "%") { number += symbol; } else { number += ch; } } return number; } if (format.indexOf("'") > -1 || format.indexOf('"') > -1 || format.indexOf("\\") > -1) { format = format.replace(literalRegExp, function(match) { var quoteChar = match.charAt(0).replace("\\", ""), literal = match.slice(1).replace(quoteChar, ""); literals.push(literal); return PLACEHOLDER; }); } format = format.split(";"); if (negative && format[1]) { format = format[1]; hasNegativeFormat = true; } else if (number === 0 && format[2]) { format = format[2]; if (format.indexOf(SHARP) == -1 && format.indexOf(ZERO) == -1) { return format; } } else { format = format[0]; } percentIndex = format.indexOf("%"); currencyIndex = format.indexOf("$"); isPercent = percentIndex != -1; isCurrency = currencyIndex != -1; if (isPercent) { number *= 100; } if (isCurrency && format[currencyIndex - 1] === "\\") { format = format.split("\\").join(""); isCurrency = false; } if (isCurrency || isPercent) { numberFormat = isCurrency ? numberFormat.currency : numberFormat.percent; decimal = numberFormat[POINT]; precision = numberFormat.decimals; symbol = numberFormat.symbol; } hasGroup = format.indexOf(COMMA) > -1; if (hasGroup) { format = format.replace(commaRegExp, EMPTY); } decimalIndex = format.indexOf(POINT); length = format.length; if (decimalIndex != -1) { fraction = number.toString().split("e"); if (fraction[1]) { fraction = round(number, Math.abs(fraction[1])); } else { fraction = fraction[0]; } fraction = fraction.split(POINT)[1] || EMPTY; zeroIndex = format.lastIndexOf(ZERO) - decimalIndex; sharpIndex = format.lastIndexOf(SHARP) - decimalIndex; hasZero = zeroIndex > -1; hasSharp = sharpIndex > -1; idx = fraction.length; if (!hasZero && !hasSharp) { format = format.substring(0, decimalIndex) + format.substring(decimalIndex + 1); length = format.length; decimalIndex = -1; idx = 0; } if (hasZero && zeroIndex > sharpIndex) { idx = zeroIndex; } else if (sharpIndex > zeroIndex) { if (hasSharp && idx > sharpIndex) { var rounded = round(number, sharpIndex, negative); while (rounded.charAt(rounded.length - 1) === ZERO && sharpIndex > 0 && sharpIndex > zeroIndex) { sharpIndex--; rounded = round(number, sharpIndex, negative); } idx = sharpIndex; } else if (hasZero && idx < zeroIndex) { idx = zeroIndex; } } } number = round(number, idx, negative); sharpIndex = format.indexOf(SHARP); zeroIndex = format.indexOf(ZERO); if (sharpIndex == -1 && zeroIndex != -1) { start = zeroIndex; } else if (sharpIndex != -1 && zeroIndex == -1) { start = sharpIndex; } else { start = sharpIndex > zeroIndex ? zeroIndex : sharpIndex; } sharpIndex = format.lastIndexOf(SHARP); zeroIndex = format.lastIndexOf(ZERO); if (sharpIndex == -1 && zeroIndex != -1) { end = zeroIndex; } else if (sharpIndex != -1 && zeroIndex == -1) { end = sharpIndex; } else { end = sharpIndex > zeroIndex ? sharpIndex : zeroIndex; } if (start == length) { end = start; } if (start != -1) { value = number.toString().split(POINT); integer = value[0]; fraction = value[1] || EMPTY; integerLength = integer.length; fraction.length; if (negative && number * -1 >= 0) { negative = false; } number = format.substring(0, start); if (negative && !hasNegativeFormat) { number += "-"; } for (idx = start; idx < length; idx++) { ch = format.charAt(idx); if (decimalIndex == -1) { if (end - idx < integerLength) { number += integer; break; } } else { if (zeroIndex != -1 && zeroIndex < idx) { replacement = EMPTY; } if (decimalIndex - idx <= integerLength && decimalIndex - idx > -1) { number += integer; idx = decimalIndex; } if (decimalIndex === idx) { number += (fraction ? decimal : EMPTY) + fraction; idx += end - decimalIndex + 1; continue; } } if (ch === ZERO) { number += ch; replacement = ch; } else if (ch === SHARP) { number += replacement; } } if (hasGroup) { number = groupInteger(number, start + (negative && !hasNegativeFormat ? 1 : 0), Math.max(end, integerLength + start), numberFormat); } if (end >= start) { number += format.substring(end + 1); } if (isCurrency || isPercent) { value = EMPTY; for (idx = 0, length = number.length; idx < length; idx++) { ch = number.charAt(idx); value += ch === "$" || ch === "%" ? symbol : ch; } number = value; } length = literals.length; if (length) { for (idx = 0; idx < length; idx++) { number = number.replace(PLACEHOLDER, literals[idx]); } } } return number; } var groupInteger = function(number, start, end, numberFormat) { var decimalIndex = number.indexOf(numberFormat[POINT]); var groupSizes = numberFormat.groupSize.slice(); var groupSize = groupSizes.shift(); var integer, integerLength; var idx, parts, value; var newGroupSize; end = decimalIndex !== -1 ? decimalIndex : end + 1; integer = number.substring(start, end); integerLength = integer.length; if (integerLength >= groupSize) { idx = integerLength; parts = []; while (idx > -1) { value = integer.substring(idx - groupSize, idx); if (value) { parts.push(value); } idx -= groupSize; newGroupSize = groupSizes.shift(); groupSize = newGroupSize !== undefined$1 ? newGroupSize : groupSize; if (groupSize === 0) { if (idx > 0) { parts.push(integer.substring(0, idx)); } break; } } integer = parts.reverse().join(numberFormat[COMMA]); number = number.substring(0, start) + integer + number.substring(end); } return number; }; var round = function(value, precision, negative) { precision = precision || 0; value = value.toString().split("e"); value = Math.round(+(value[0] + "e" + (value[1] ? +value[1] + precision : precision))); if (negative) { value = -value; } value = value.toString().split("e"); value = +(value[0] + "e" + (value[1] ? +value[1] - precision : -precision)); return value.toFixed(Math.min(precision, 20)); }; var toString = function(value, fmt, culture) { if (fmt) { if (objectToString.call(value) === "[object Date]") { return formatDate(value, fmt, culture); } else if (typeof value === NUMBER) { return formatNumber(value, fmt, culture); } } return value !== undefined$1 ? value : ""; }; kendo2.format = function(fmt) { var values = arguments; return fmt.replace(formatRegExp, function(match, index, placeholderFormat) { var value = values[parseInt(index, 10) + 1]; return toString(value, placeholderFormat ? placeholderFormat.substring(1) : ""); }); }; kendo2._extractFormat = function(format) { if (format.slice(0, 3) === "{0:") { format = format.slice(3, format.length - 1); } return format; }; kendo2._activeElement = function() { try { return document.activeElement; } catch (e) { return document.documentElement.activeElement; } }; kendo2._round = round; kendo2._outerWidth = function(element, includeMargin) { return $2(element).outerWidth(includeMargin || false) || 0; }; kendo2._outerHeight = function(element, includeMargin) { return $2(element).outerHeight(includeMargin || false) || 0; }; kendo2.toString = toString; })(); (function() { var nonBreakingSpaceRegExp = /\u00A0/g, spaceRegExp = /\s/g, exponentRegExp = /[eE][\-+]?[0-9]+/, shortTimeZoneRegExp = /[+|\-]\d{1,2}/, longTimeZoneRegExp = /[+|\-]\d{1,2}:?\d{2}/, dateRegExp = /^\/Date\((.*?)\)\/$/, offsetRegExp = /[+-]\d*/, FORMATS_SEQUENCE = [[], ["G", "g", "F"], ["D", "d", "y", "m", "T", "t"]], STANDARD_FORMATS = [ [ "yyyy-MM-ddTHH:mm:ss.fffffffzzz", "yyyy-MM-ddTHH:mm:ss.fffffff", "yyyy-MM-ddTHH:mm:ss.fffzzz", "yyyy-MM-ddTHH:mm:ss.fff", "ddd MMM dd yyyy HH:mm:ss", "yyyy-MM-ddTHH:mm:sszzz", "yyyy-MM-ddTHH:mmzzz", "yyyy-MM-ddTHH:mmzz", "yyyy-MM-ddTHH:mm:ss", "yyyy-MM-dd HH:mm:ss", "yyyy/MM/dd HH:mm:ss" ], [ "yyyy-MM-ddTHH:mm", "yyyy-MM-dd HH:mm", "yyyy/MM/dd HH:mm" ], [ "yyyy/MM/dd", "yyyy-MM-dd", "HH:mm:ss", "HH:mm" ] ], numberRegExp2 = { 2: /^\d{1,2}/, 3: /^\d{1,3}/, 4: /^\d{4}/ }, objectToString = {}.toString; function outOfRange(value, start, end) { return !(value >= start && value <= end); } function designatorPredicate(designator) { return designator.charAt(0); } function mapDesignators(designators) { return $2.map(designators, designatorPredicate); } function adjustDST(date, hours) { if (!hours && date.getHours() === 23) { date.setHours(date.getHours() + 2); } } function lowerArray(data) { var idx = 0, length = data.length, array = []; for (; idx < length; idx++) { array[idx] = (data[idx] + "").toLowerCase(); } return array; } function lowerLocalInfo(localInfo) { var newLocalInfo = {}, property; for (property in localInfo) { newLocalInfo[property] = lowerArray(localInfo[property]); } return newLocalInfo; } function parseExact(value, format, culture, strict) { if (!value) { return null; } var lookAhead = function(match2) { var i = 0; while (format[idx] === match2) { i++; idx++; } if (i > 0) { idx -= 1; } return i; }, getNumber = function(size2) { var rg = numberRegExp2[size2] || new RegExp("^\\d{1," + size2 + "}"), match2 = value.substr(valueIdx, size2).match(rg); if (match2) { match2 = match2[0]; valueIdx += match2.length; return parseInt(match2, 10); } return null; }, getIndexByName = function(names, lower) { var i = 0, length2 = names.length, name, nameLength, matchLength = 0, matchIdx = 0, subValue; for (; i < length2; i++) { name = names[i]; nameLength = name.length; subValue = value.substr(valueIdx, nameLength); if (lower) { subValue = subValue.toLowerCase(); } if (subValue == name && nameLength > matchLength) { matchLength = nameLength; matchIdx = i; } } if (matchLength) { valueIdx += matchLength; return matchIdx + 1; } return null; }, checkLiteral = function() { var result = false; if (value.charAt(valueIdx) === format[idx]) { valueIdx++; result = true; } return result; }, calendar = culture.calendars.standard, year = null, month = null, day = null, hours = null, minutes = null, seconds = null, milliseconds = null, idx = 0, valueIdx = 0, literal = false, date = /* @__PURE__ */ new Date(), twoDigitYearMax = calendar.twoDigitYearMax || 2029, defaultYear = date.getFullYear(), ch, count, length, pattern, pmHour, UTC, matches, amDesignators, pmDesignators, hoursOffset, minutesOffset, hasTime, match; if (!format) { format = "d"; } pattern = calendar.patterns[format]; if (pattern) { format = pattern; } format = format.split(""); length = format.length; for (; idx < length; idx++) { ch = format[idx]; if (literal) { if (ch === "'") { literal = false; } else { checkLiteral(); } } else { if (ch === "d") { count = lookAhead("d"); if (!calendar._lowerDays) { calendar._lowerDays = lowerLocalInfo(calendar.days); } if (day !== null && count > 2) { continue; } day = count < 3 ? getNumber(2) : getIndexByName(calendar._lowerDays[count == 3 ? "namesAbbr" : "names"], true); if (day === null || outOfRange(day, 1, 31)) { return null; } } else if (ch === "M") { count = lookAhead("M"); if (!calendar._lowerMonths) { calendar._lowerMonths = lowerLocalInfo(calendar.months); } month = count < 3 ? getNumber(2) : getIndexByName(calendar._lowerMonths[count == 3 ? "namesAbbr" : "names"], true); if (month === null || outOfRange(month, 1, 12)) { return null; } month -= 1; } else if (ch === "y") { count = lookAhead("y"); year = getNumber(count); if (year === null) { return null; } if (count == 2) { if (typeof twoDigitYearMax === "string") { twoDigitYearMax = defaultYear + parseInt(twoDigitYearMax, 10); } year = defaultYear - defaultYear % 100 + year; if (year > twoDigitYearMax) { year -= 100; } } } else if (ch === "h") { lookAhead("h"); hours = getNumber(2); if (hours == 12) { hours = 0; } if (hours === null || outOfRange(hours, 0, 11)) { return null; } } else if (ch === "H") { lookAhead("H"); hours = getNumber(2); if (hours === null || outOfRange(hours, 0, 23)) { return null; } } else if (ch === "m") { lookAhead("m"); minutes = getNumber(2); if (minutes === null || outOfRange(minutes, 0, 59)) { return null; } } else if (ch === "s") { lookAhead("s"); seconds = getNumber(2); if (seconds === null || outOfRange(seconds, 0, 59)) { return null; } } else if (ch === "f") { count = lookAhead("f"); match = value.substr(valueIdx, count).match(numberRegExp2[3]); milliseconds = getNumber(count); if (milliseconds !== null) { milliseconds = parseFloat("0." + match[0], 10); milliseconds = kendo2._round(milliseconds, 3); milliseconds *= 1e3; } if (milliseconds === null || outOfRange(milliseconds, 0, 999)) { return null; } } else if (ch === "t") { count = lookAhead("t"); amDesignators = calendar.AM; pmDesignators = calendar.PM; if (count === 1) { amDesignators = mapDesignators(amDesignators); pmDesignators = mapDesignators(pmDesignators); } pmHour = getIndexByName(pmDesignators); if (!pmHour && !getIndexByName(amDesignators)) { return null; } } else if (ch === "z") { UTC = true; count = lookAhead("z"); if (value.substr(valueIdx, 1) === "Z") { checkLiteral(); continue; } matches = value.substr(valueIdx, 6).match(count > 2 ? longTimeZoneRegExp : shortTimeZoneRegExp); if (!matches) { return null; } matches = matches[0].split(":"); hoursOffset = matches[0]; minutesOffset = matches[1]; if (!minutesOffset && hoursOffset.length > 3) { valueIdx = hoursOffset.length - 2; minutesOffset = hoursOffset.substring(valueIdx); hoursOffset = hoursOffset.substring(0, valueIdx); } hoursOffset = parseInt(hoursOffset, 10); if (outOfRange(hoursOffset, -12, 13)) { return null; } if (count > 2) { minutesOffset = matches[0][0] + minutesOffset; minutesOffset = parseInt(minutesOffset, 10); if (isNaN(minutesOffset) || outOfRange(minutesOffset, -59, 59)) { return null; } } } else if (ch === "'") { literal = true; checkLiteral(); } else if (!checkLiteral()) { return null; } } } if (strict && !/^\s*$/.test(value.substr(valueIdx))) { return null; } hasTime = hours !== null || minutes !== null || seconds || null; if (year === null && month === null && day === null && hasTime) { year = defaultYear; month = date.getMonth(); day = date.getDate(); } else { if (year === null) { year = defaultYear; } if (day === null) { day = 1; } } if (pmHour && hours < 12) { hours += 12; } if (UTC) { if (hoursOffset) { hours += -hoursOffset; } if (minutesOffset) { minutes += -minutesOffset; } value = new Date(Date.UTC(year, month, day, hours, minutes, seconds, milliseconds)); } else { value = new Date(year, month, day, hours, minutes, seconds, milliseconds); adjustDST(value, hours); } if (year < 100) { value.setFullYear(year); } if (value.getDate() !== day && UTC === undefined$1) { return null; } return value; } function parseMicrosoftFormatOffset(offset) { var sign = offset.substr(0, 1) === "-" ? -1 : 1; offset = offset.substring(1); offset = parseInt(offset.substr(0, 2), 10) * 60 + parseInt(offset.substring(2), 10); return sign * offset; } function getDefaultFormats(culture) { var length = math.max(FORMATS_SEQUENCE.length, STANDARD_FORMATS.length); var calendar = culture.calendar || culture.calendars.standard; var patterns = calendar.patterns; var cultureFormats, formatIdx, idx; var formats = []; for (idx = 0; idx < length; idx++) { cultureFormats = FORMATS_SEQUENCE[idx]; for (formatIdx = 0; formatIdx < cultureFormats.length; formatIdx++) { formats.push(patterns[cultureFormats[formatIdx]]); } formats = formats.concat(STANDARD_FORMATS[idx]); } return formats; } function internalParseDate(value, formats, culture, strict) { if (objectToString.call(value) === "[object Date]") { return value; } var idx = 0; var date = null; var length; var tzoffset; if (value && value.indexOf("/D") === 0) { date = dateRegExp.exec(value); if (date) { date = date[1]; tzoffset = offsetRegExp.exec(date.substring(1)); date = new Date(parseInt(date, 10)); if (tzoffset) { tzoffset = parseMicrosoftFormatOffset(tzoffset[0]); date = kendo2.timezone.apply(date, 0); date = kendo2.timezone.convert(date, 0, -1 * tzoffset); } return date; } } culture = kendo2.getCulture(culture); if (!formats) { formats = getDefaultFormats(culture); } formats = isArray(formats) ? formats : [formats]; length = formats.length; for (; idx < length; idx++) { date = parseExact(value, formats[idx], culture, strict); if (date) { return date; } } return date; } kendo2.parseDate = function(value, formats, culture) { return internalParseDate(value, formats, culture, false); }; kendo2.parseExactDate = function(value, formats, culture) { return internalParseDate(value, formats, culture, true); }; kendo2.parseInt = function(value, culture) { var result = kendo2.parseFloat(value, culture); if (result) { result = result | 0; } return result; }; kendo2.parseFloat = function(value, culture, format) { if (!value && value !== 0) { return null; } if (typeof value === NUMBER) { return value; } value = value.toString(); culture = kendo2.getCulture(culture); var number = culture.numberFormat, percent = number.percent, currency = number.currency, symbol = currency.symbol, percentSymbol = percent.symbol, negative = value.indexOf("-"), parts, isPercent; if (exponentRegExp.test(value)) { value = parseFloat(value.replace(number["."], ".")); if (isNaN(value)) { value = null; } return value; } if (negative > 0) { return null; } else { negative = negative > -1; } if (value.indexOf(symbol) > -1 || format && format.toLowerCase().indexOf("c") > -1) { number = currency; parts = number.pattern[0].replace("$", symbol).split("n"); if (value.indexOf(parts[0]) > -1 && value.indexOf(parts[1]) > -1) { value = value.replace(parts[0], "").replace(parts[1], ""); negative = true; } } else if (value.indexOf(percentSymbol) > -1) { isPercent = true; number = percent; symbol = percentSymbol; } value = value.replace("-", "").replace(symbol, "").replace(nonBreakingSpaceRegExp, " ").split(number[","].replace(nonBreakingSpaceRegExp, " ")).join("").replace(spaceRegExp, "").replace(number["."], "."); value = parseFloat(value); if (isNaN(value)) { value = null; } else if (negative) { value *= -1; } if (value && isPercent) { value /= 100; } return value; }; })(); function getShadows(element) { var shadow = element.css(kendo2.support.transitions.css + "box-shadow") || element.css("box-shadow"), radius = shadow ? shadow.match(boxShadowRegExp) || [0, 0, 0, 0, 0] : [0, 0, 0, 0, 0], blur = math.max(+radius[3], +(radius[4] || 0)); return { left: -radius[1] + blur, right: +radius[1] + blur, bottom: +radius[2] + blur }; } function wrap(element, autosize) { var percentage, outerWidth = kendo2._outerWidth, outerHeight = kendo2._outerHeight, parent = element.parent(), windowOuterWidth = outerWidth(window2); parent.removeClass("k-animation-container-sm"); if (!parent.hasClass("k-animation-container")) { var width = element[0].style.width, height = element[0].style.height, percentWidth = percentRegExp.test(width), percentHeight = percentRegExp.test(height), forceWidth = element.hasClass("k-tooltip") || element.is(".k-menu-horizontal.k-context-menu"); percentage = percentWidth || percentHeight; if (!percentWidth && (!autosize || autosize && width || forceWidth)) { width = autosize ? outerWidth(element) + 1 : outerWidth(element); } if (!percentHeight && (!autosize || autosize && height) || element.is(".k-menu-horizontal.k-context-menu")) { height = outerHeight(element); } element.wrap( $2("<div/>").addClass("k-animation-container").attr("role", "region").css({ width, height }) ); parent = element.parent(); if (percentage) { element.css({ width: "100%", height: "100%", boxSizing: "border-box", mozBoxSizing: "border-box", webkitBoxSizing: "border-box" }); } } else { wrapResize(element, autosize); } if (windowOuterWidth < outerWidth(parent)) { parent.addClass("k-animation-container-sm"); wrapResize(element, autosize); } return parent; } function wrapResize(element, autosize) { var percentage, outerWidth = kendo2._outerWidth, outerHeight = kendo2._outerHeight, wrapper = element