@progress/telerik-jquery-report-viewer 26.25.716 → 27.25.813
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -4
- package/dist/cjs/aiPrompt.js +25 -21
- package/dist/cjs/documentMapArea.js +2 -2
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/parametersArea.js +6 -4
- package/dist/cjs/reportViewer.js +28 -6
- package/dist/cjs/sr.js +6 -3
- package/dist/cjs/toolbar.js +1 -1
- package/dist/cjs/utils.js +0 -25
- package/dist/font/font-icons.css +4 -4
- package/dist/font/font-icons.min.css +3 -3
- package/dist/js/telerikReportViewer.js +1729 -350
- package/dist/js/telerikReportViewer.min.js +1 -1
- package/dist/js/telerikReportViewer.stringResources.js +6 -3
- package/dist/styles/telerikReportViewer.css +3 -3
- package/dist/styles/telerikReportViewer.min.css +3 -3
- package/dist/templates/telerikReportViewerTemplate.html +8 -11
- package/package.json +1 -1
- /package/dist/font/{ReportingIcons-19.1.25.716.ttf → ReportingIcons-19.2.25.813.ttf} +0 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* TelerikReporting v19.
|
2
|
+
* TelerikReporting v19.2.25.813 (https://www.telerik.com/products/reporting.aspx)
|
3
3
|
* Copyright 2025 Progress Software EAD. All rights reserved.
|
4
4
|
*
|
5
5
|
* Telerik Reporting commercial licenses may be obtained at
|
@@ -13,12 +13,1372 @@ var telerikReportViewer = (function (exports) {
|
|
13
13
|
|
14
14
|
var dist = {exports: {}};
|
15
15
|
|
16
|
+
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
|
17
|
+
|
18
|
+
var purify_cjs;
|
19
|
+
var hasRequiredPurify_cjs;
|
20
|
+
|
21
|
+
function requirePurify_cjs () {
|
22
|
+
if (hasRequiredPurify_cjs) return purify_cjs;
|
23
|
+
hasRequiredPurify_cjs = 1;
|
24
|
+
|
25
|
+
const {
|
26
|
+
entries,
|
27
|
+
setPrototypeOf,
|
28
|
+
isFrozen,
|
29
|
+
getPrototypeOf,
|
30
|
+
getOwnPropertyDescriptor
|
31
|
+
} = Object;
|
32
|
+
let {
|
33
|
+
freeze,
|
34
|
+
seal,
|
35
|
+
create
|
36
|
+
} = Object; // eslint-disable-line import/no-mutable-exports
|
37
|
+
let {
|
38
|
+
apply,
|
39
|
+
construct
|
40
|
+
} = typeof Reflect !== 'undefined' && Reflect;
|
41
|
+
if (!freeze) {
|
42
|
+
freeze = function freeze(x) {
|
43
|
+
return x;
|
44
|
+
};
|
45
|
+
}
|
46
|
+
if (!seal) {
|
47
|
+
seal = function seal(x) {
|
48
|
+
return x;
|
49
|
+
};
|
50
|
+
}
|
51
|
+
if (!apply) {
|
52
|
+
apply = function apply(fun, thisValue, args) {
|
53
|
+
return fun.apply(thisValue, args);
|
54
|
+
};
|
55
|
+
}
|
56
|
+
if (!construct) {
|
57
|
+
construct = function construct(Func, args) {
|
58
|
+
return new Func(...args);
|
59
|
+
};
|
60
|
+
}
|
61
|
+
const arrayForEach = unapply(Array.prototype.forEach);
|
62
|
+
const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
|
63
|
+
const arrayPop = unapply(Array.prototype.pop);
|
64
|
+
const arrayPush = unapply(Array.prototype.push);
|
65
|
+
const arraySplice = unapply(Array.prototype.splice);
|
66
|
+
const stringToLowerCase = unapply(String.prototype.toLowerCase);
|
67
|
+
const stringToString = unapply(String.prototype.toString);
|
68
|
+
const stringMatch = unapply(String.prototype.match);
|
69
|
+
const stringReplace = unapply(String.prototype.replace);
|
70
|
+
const stringIndexOf = unapply(String.prototype.indexOf);
|
71
|
+
const stringTrim = unapply(String.prototype.trim);
|
72
|
+
const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
|
73
|
+
const regExpTest = unapply(RegExp.prototype.test);
|
74
|
+
const typeErrorCreate = unconstruct(TypeError);
|
75
|
+
/**
|
76
|
+
* Creates a new function that calls the given function with a specified thisArg and arguments.
|
77
|
+
*
|
78
|
+
* @param func - The function to be wrapped and called.
|
79
|
+
* @returns A new function that calls the given function with a specified thisArg and arguments.
|
80
|
+
*/
|
81
|
+
function unapply(func) {
|
82
|
+
return function (thisArg) {
|
83
|
+
if (thisArg instanceof RegExp) {
|
84
|
+
thisArg.lastIndex = 0;
|
85
|
+
}
|
86
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
87
|
+
args[_key - 1] = arguments[_key];
|
88
|
+
}
|
89
|
+
return apply(func, thisArg, args);
|
90
|
+
};
|
91
|
+
}
|
92
|
+
/**
|
93
|
+
* Creates a new function that constructs an instance of the given constructor function with the provided arguments.
|
94
|
+
*
|
95
|
+
* @param func - The constructor function to be wrapped and called.
|
96
|
+
* @returns A new function that constructs an instance of the given constructor function with the provided arguments.
|
97
|
+
*/
|
98
|
+
function unconstruct(func) {
|
99
|
+
return function () {
|
100
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
101
|
+
args[_key2] = arguments[_key2];
|
102
|
+
}
|
103
|
+
return construct(func, args);
|
104
|
+
};
|
105
|
+
}
|
106
|
+
/**
|
107
|
+
* Add properties to a lookup table
|
108
|
+
*
|
109
|
+
* @param set - The set to which elements will be added.
|
110
|
+
* @param array - The array containing elements to be added to the set.
|
111
|
+
* @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
|
112
|
+
* @returns The modified set with added elements.
|
113
|
+
*/
|
114
|
+
function addToSet(set, array) {
|
115
|
+
let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
|
116
|
+
if (setPrototypeOf) {
|
117
|
+
// Make 'in' and truthy checks like Boolean(set.constructor)
|
118
|
+
// independent of any properties defined on Object.prototype.
|
119
|
+
// Prevent prototype setters from intercepting set as a this value.
|
120
|
+
setPrototypeOf(set, null);
|
121
|
+
}
|
122
|
+
let l = array.length;
|
123
|
+
while (l--) {
|
124
|
+
let element = array[l];
|
125
|
+
if (typeof element === 'string') {
|
126
|
+
const lcElement = transformCaseFunc(element);
|
127
|
+
if (lcElement !== element) {
|
128
|
+
// Config presets (e.g. tags.js, attrs.js) are immutable.
|
129
|
+
if (!isFrozen(array)) {
|
130
|
+
array[l] = lcElement;
|
131
|
+
}
|
132
|
+
element = lcElement;
|
133
|
+
}
|
134
|
+
}
|
135
|
+
set[element] = true;
|
136
|
+
}
|
137
|
+
return set;
|
138
|
+
}
|
139
|
+
/**
|
140
|
+
* Clean up an array to harden against CSPP
|
141
|
+
*
|
142
|
+
* @param array - The array to be cleaned.
|
143
|
+
* @returns The cleaned version of the array
|
144
|
+
*/
|
145
|
+
function cleanArray(array) {
|
146
|
+
for (let index = 0; index < array.length; index++) {
|
147
|
+
const isPropertyExist = objectHasOwnProperty(array, index);
|
148
|
+
if (!isPropertyExist) {
|
149
|
+
array[index] = null;
|
150
|
+
}
|
151
|
+
}
|
152
|
+
return array;
|
153
|
+
}
|
154
|
+
/**
|
155
|
+
* Shallow clone an object
|
156
|
+
*
|
157
|
+
* @param object - The object to be cloned.
|
158
|
+
* @returns A new object that copies the original.
|
159
|
+
*/
|
160
|
+
function clone(object) {
|
161
|
+
const newObject = create(null);
|
162
|
+
for (const [property, value] of entries(object)) {
|
163
|
+
const isPropertyExist = objectHasOwnProperty(object, property);
|
164
|
+
if (isPropertyExist) {
|
165
|
+
if (Array.isArray(value)) {
|
166
|
+
newObject[property] = cleanArray(value);
|
167
|
+
} else if (value && typeof value === 'object' && value.constructor === Object) {
|
168
|
+
newObject[property] = clone(value);
|
169
|
+
} else {
|
170
|
+
newObject[property] = value;
|
171
|
+
}
|
172
|
+
}
|
173
|
+
}
|
174
|
+
return newObject;
|
175
|
+
}
|
176
|
+
/**
|
177
|
+
* This method automatically checks if the prop is function or getter and behaves accordingly.
|
178
|
+
*
|
179
|
+
* @param object - The object to look up the getter function in its prototype chain.
|
180
|
+
* @param prop - The property name for which to find the getter function.
|
181
|
+
* @returns The getter function found in the prototype chain or a fallback function.
|
182
|
+
*/
|
183
|
+
function lookupGetter(object, prop) {
|
184
|
+
while (object !== null) {
|
185
|
+
const desc = getOwnPropertyDescriptor(object, prop);
|
186
|
+
if (desc) {
|
187
|
+
if (desc.get) {
|
188
|
+
return unapply(desc.get);
|
189
|
+
}
|
190
|
+
if (typeof desc.value === 'function') {
|
191
|
+
return unapply(desc.value);
|
192
|
+
}
|
193
|
+
}
|
194
|
+
object = getPrototypeOf(object);
|
195
|
+
}
|
196
|
+
function fallbackValue() {
|
197
|
+
return null;
|
198
|
+
}
|
199
|
+
return fallbackValue;
|
200
|
+
}
|
201
|
+
|
202
|
+
const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
203
|
+
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
204
|
+
const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
|
205
|
+
// List of SVG elements that are disallowed by default.
|
206
|
+
// We still need to know them so that we can do namespace
|
207
|
+
// checks properly in case one wants to add them to
|
208
|
+
// allow-list.
|
209
|
+
const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
|
210
|
+
const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);
|
211
|
+
// Similarly to SVG, we want to know all MathML elements,
|
212
|
+
// even those that we disallow by default.
|
213
|
+
const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
214
|
+
const text = freeze(['#text']);
|
215
|
+
|
216
|
+
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
|
217
|
+
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
218
|
+
const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
|
219
|
+
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
220
|
+
|
221
|
+
// eslint-disable-next-line unicorn/better-regex
|
222
|
+
const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
|
223
|
+
const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
|
224
|
+
const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
|
225
|
+
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
|
226
|
+
const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
227
|
+
const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
|
228
|
+
);
|
229
|
+
const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
|
230
|
+
const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
|
231
|
+
);
|
232
|
+
const DOCTYPE_NAME = seal(/^html$/i);
|
233
|
+
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
234
|
+
|
235
|
+
var EXPRESSIONS = /*#__PURE__*/Object.freeze({
|
236
|
+
__proto__: null,
|
237
|
+
ARIA_ATTR: ARIA_ATTR,
|
238
|
+
ATTR_WHITESPACE: ATTR_WHITESPACE,
|
239
|
+
CUSTOM_ELEMENT: CUSTOM_ELEMENT,
|
240
|
+
DATA_ATTR: DATA_ATTR,
|
241
|
+
DOCTYPE_NAME: DOCTYPE_NAME,
|
242
|
+
ERB_EXPR: ERB_EXPR,
|
243
|
+
IS_ALLOWED_URI: IS_ALLOWED_URI,
|
244
|
+
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
|
245
|
+
MUSTACHE_EXPR: MUSTACHE_EXPR,
|
246
|
+
TMPLIT_EXPR: TMPLIT_EXPR
|
247
|
+
});
|
248
|
+
|
249
|
+
/* eslint-disable @typescript-eslint/indent */
|
250
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
|
251
|
+
const NODE_TYPE = {
|
252
|
+
element: 1,
|
253
|
+
attribute: 2,
|
254
|
+
text: 3,
|
255
|
+
cdataSection: 4,
|
256
|
+
entityReference: 5,
|
257
|
+
// Deprecated
|
258
|
+
entityNode: 6,
|
259
|
+
// Deprecated
|
260
|
+
progressingInstruction: 7,
|
261
|
+
comment: 8,
|
262
|
+
document: 9,
|
263
|
+
documentType: 10,
|
264
|
+
documentFragment: 11,
|
265
|
+
notation: 12 // Deprecated
|
266
|
+
};
|
267
|
+
const getGlobal = function getGlobal() {
|
268
|
+
return typeof window === 'undefined' ? null : window;
|
269
|
+
};
|
270
|
+
/**
|
271
|
+
* Creates a no-op policy for internal use only.
|
272
|
+
* Don't export this function outside this module!
|
273
|
+
* @param trustedTypes The policy factory.
|
274
|
+
* @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
|
275
|
+
* @return The policy created (or null, if Trusted Types
|
276
|
+
* are not supported or creating the policy failed).
|
277
|
+
*/
|
278
|
+
const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
|
279
|
+
if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
|
280
|
+
return null;
|
281
|
+
}
|
282
|
+
// Allow the callers to control the unique policy name
|
283
|
+
// by adding a data-tt-policy-suffix to the script element with the DOMPurify.
|
284
|
+
// Policy creation with duplicate names throws in Trusted Types.
|
285
|
+
let suffix = null;
|
286
|
+
const ATTR_NAME = 'data-tt-policy-suffix';
|
287
|
+
if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
|
288
|
+
suffix = purifyHostElement.getAttribute(ATTR_NAME);
|
289
|
+
}
|
290
|
+
const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
|
291
|
+
try {
|
292
|
+
return trustedTypes.createPolicy(policyName, {
|
293
|
+
createHTML(html) {
|
294
|
+
return html;
|
295
|
+
},
|
296
|
+
createScriptURL(scriptUrl) {
|
297
|
+
return scriptUrl;
|
298
|
+
}
|
299
|
+
});
|
300
|
+
} catch (_) {
|
301
|
+
// Policy creation failed (most likely another DOMPurify script has
|
302
|
+
// already run). Skip creating the policy, as this will only cause errors
|
303
|
+
// if TT are enforced.
|
304
|
+
console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
|
305
|
+
return null;
|
306
|
+
}
|
307
|
+
};
|
308
|
+
const _createHooksMap = function _createHooksMap() {
|
309
|
+
return {
|
310
|
+
afterSanitizeAttributes: [],
|
311
|
+
afterSanitizeElements: [],
|
312
|
+
afterSanitizeShadowDOM: [],
|
313
|
+
beforeSanitizeAttributes: [],
|
314
|
+
beforeSanitizeElements: [],
|
315
|
+
beforeSanitizeShadowDOM: [],
|
316
|
+
uponSanitizeAttribute: [],
|
317
|
+
uponSanitizeElement: [],
|
318
|
+
uponSanitizeShadowNode: []
|
319
|
+
};
|
320
|
+
};
|
321
|
+
function createDOMPurify() {
|
322
|
+
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
323
|
+
const DOMPurify = root => createDOMPurify(root);
|
324
|
+
DOMPurify.version = '3.2.6';
|
325
|
+
DOMPurify.removed = [];
|
326
|
+
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
327
|
+
// Not running in a browser, provide a factory function
|
328
|
+
// so that you can pass your own Window
|
329
|
+
DOMPurify.isSupported = false;
|
330
|
+
return DOMPurify;
|
331
|
+
}
|
332
|
+
let {
|
333
|
+
document
|
334
|
+
} = window;
|
335
|
+
const originalDocument = document;
|
336
|
+
const currentScript = originalDocument.currentScript;
|
337
|
+
const {
|
338
|
+
DocumentFragment,
|
339
|
+
HTMLTemplateElement,
|
340
|
+
Node,
|
341
|
+
Element,
|
342
|
+
NodeFilter,
|
343
|
+
NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
|
344
|
+
HTMLFormElement,
|
345
|
+
DOMParser,
|
346
|
+
trustedTypes
|
347
|
+
} = window;
|
348
|
+
const ElementPrototype = Element.prototype;
|
349
|
+
const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
|
350
|
+
const remove = lookupGetter(ElementPrototype, 'remove');
|
351
|
+
const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
352
|
+
const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
353
|
+
const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
|
354
|
+
// As per issue #47, the web-components registry is inherited by a
|
355
|
+
// new document created via createHTMLDocument. As per the spec
|
356
|
+
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
357
|
+
// a new empty registry is used when creating a template contents owner
|
358
|
+
// document, so we use that as our parent document to ensure nothing
|
359
|
+
// is inherited.
|
360
|
+
if (typeof HTMLTemplateElement === 'function') {
|
361
|
+
const template = document.createElement('template');
|
362
|
+
if (template.content && template.content.ownerDocument) {
|
363
|
+
document = template.content.ownerDocument;
|
364
|
+
}
|
365
|
+
}
|
366
|
+
let trustedTypesPolicy;
|
367
|
+
let emptyHTML = '';
|
368
|
+
const {
|
369
|
+
implementation,
|
370
|
+
createNodeIterator,
|
371
|
+
createDocumentFragment,
|
372
|
+
getElementsByTagName
|
373
|
+
} = document;
|
374
|
+
const {
|
375
|
+
importNode
|
376
|
+
} = originalDocument;
|
377
|
+
let hooks = _createHooksMap();
|
378
|
+
/**
|
379
|
+
* Expose whether this browser supports running the full DOMPurify.
|
380
|
+
*/
|
381
|
+
DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
|
382
|
+
const {
|
383
|
+
MUSTACHE_EXPR,
|
384
|
+
ERB_EXPR,
|
385
|
+
TMPLIT_EXPR,
|
386
|
+
DATA_ATTR,
|
387
|
+
ARIA_ATTR,
|
388
|
+
IS_SCRIPT_OR_DATA,
|
389
|
+
ATTR_WHITESPACE,
|
390
|
+
CUSTOM_ELEMENT
|
391
|
+
} = EXPRESSIONS;
|
392
|
+
let {
|
393
|
+
IS_ALLOWED_URI: IS_ALLOWED_URI$1
|
394
|
+
} = EXPRESSIONS;
|
395
|
+
/**
|
396
|
+
* We consider the elements and attributes below to be safe. Ideally
|
397
|
+
* don't add any new ones but feel free to remove unwanted ones.
|
398
|
+
*/
|
399
|
+
/* allowed element names */
|
400
|
+
let ALLOWED_TAGS = null;
|
401
|
+
const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
|
402
|
+
/* Allowed attribute names */
|
403
|
+
let ALLOWED_ATTR = null;
|
404
|
+
const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
|
405
|
+
/*
|
406
|
+
* Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
|
407
|
+
* @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
|
408
|
+
* @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
|
409
|
+
* @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
|
410
|
+
*/
|
411
|
+
let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
|
412
|
+
tagNameCheck: {
|
413
|
+
writable: true,
|
414
|
+
configurable: false,
|
415
|
+
enumerable: true,
|
416
|
+
value: null
|
417
|
+
},
|
418
|
+
attributeNameCheck: {
|
419
|
+
writable: true,
|
420
|
+
configurable: false,
|
421
|
+
enumerable: true,
|
422
|
+
value: null
|
423
|
+
},
|
424
|
+
allowCustomizedBuiltInElements: {
|
425
|
+
writable: true,
|
426
|
+
configurable: false,
|
427
|
+
enumerable: true,
|
428
|
+
value: false
|
429
|
+
}
|
430
|
+
}));
|
431
|
+
/* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
|
432
|
+
let FORBID_TAGS = null;
|
433
|
+
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
434
|
+
let FORBID_ATTR = null;
|
435
|
+
/* Decide if ARIA attributes are okay */
|
436
|
+
let ALLOW_ARIA_ATTR = true;
|
437
|
+
/* Decide if custom data attributes are okay */
|
438
|
+
let ALLOW_DATA_ATTR = true;
|
439
|
+
/* Decide if unknown protocols are okay */
|
440
|
+
let ALLOW_UNKNOWN_PROTOCOLS = false;
|
441
|
+
/* Decide if self-closing tags in attributes are allowed.
|
442
|
+
* Usually removed due to a mXSS issue in jQuery 3.0 */
|
443
|
+
let ALLOW_SELF_CLOSE_IN_ATTR = true;
|
444
|
+
/* Output should be safe for common template engines.
|
445
|
+
* This means, DOMPurify removes data attributes, mustaches and ERB
|
446
|
+
*/
|
447
|
+
let SAFE_FOR_TEMPLATES = false;
|
448
|
+
/* Output should be safe even for XML used within HTML and alike.
|
449
|
+
* This means, DOMPurify removes comments when containing risky content.
|
450
|
+
*/
|
451
|
+
let SAFE_FOR_XML = true;
|
452
|
+
/* Decide if document with <html>... should be returned */
|
453
|
+
let WHOLE_DOCUMENT = false;
|
454
|
+
/* Track whether config is already set on this instance of DOMPurify. */
|
455
|
+
let SET_CONFIG = false;
|
456
|
+
/* Decide if all elements (e.g. style, script) must be children of
|
457
|
+
* document.body. By default, browsers might move them to document.head */
|
458
|
+
let FORCE_BODY = false;
|
459
|
+
/* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
|
460
|
+
* string (or a TrustedHTML object if Trusted Types are supported).
|
461
|
+
* If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
|
462
|
+
*/
|
463
|
+
let RETURN_DOM = false;
|
464
|
+
/* Decide if a DOM `DocumentFragment` should be returned, instead of a html
|
465
|
+
* string (or a TrustedHTML object if Trusted Types are supported) */
|
466
|
+
let RETURN_DOM_FRAGMENT = false;
|
467
|
+
/* Try to return a Trusted Type object instead of a string, return a string in
|
468
|
+
* case Trusted Types are not supported */
|
469
|
+
let RETURN_TRUSTED_TYPE = false;
|
470
|
+
/* Output should be free from DOM clobbering attacks?
|
471
|
+
* This sanitizes markups named with colliding, clobberable built-in DOM APIs.
|
472
|
+
*/
|
473
|
+
let SANITIZE_DOM = true;
|
474
|
+
/* Achieve full DOM Clobbering protection by isolating the namespace of named
|
475
|
+
* properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
|
476
|
+
*
|
477
|
+
* HTML/DOM spec rules that enable DOM Clobbering:
|
478
|
+
* - Named Access on Window (§7.3.3)
|
479
|
+
* - DOM Tree Accessors (§3.1.5)
|
480
|
+
* - Form Element Parent-Child Relations (§4.10.3)
|
481
|
+
* - Iframe srcdoc / Nested WindowProxies (§4.8.5)
|
482
|
+
* - HTMLCollection (§4.2.10.2)
|
483
|
+
*
|
484
|
+
* Namespace isolation is implemented by prefixing `id` and `name` attributes
|
485
|
+
* with a constant string, i.e., `user-content-`
|
486
|
+
*/
|
487
|
+
let SANITIZE_NAMED_PROPS = false;
|
488
|
+
const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
|
489
|
+
/* Keep element content when removing element? */
|
490
|
+
let KEEP_CONTENT = true;
|
491
|
+
/* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
|
492
|
+
* of importing it into a new Document and returning a sanitized copy */
|
493
|
+
let IN_PLACE = false;
|
494
|
+
/* Allow usage of profiles like html, svg and mathMl */
|
495
|
+
let USE_PROFILES = {};
|
496
|
+
/* Tags to ignore content of when KEEP_CONTENT is true */
|
497
|
+
let FORBID_CONTENTS = null;
|
498
|
+
const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
|
499
|
+
/* Tags that are safe for data: URIs */
|
500
|
+
let DATA_URI_TAGS = null;
|
501
|
+
const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
502
|
+
/* Attributes safe for values like "javascript:" */
|
503
|
+
let URI_SAFE_ATTRIBUTES = null;
|
504
|
+
const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
|
505
|
+
const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
|
506
|
+
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
507
|
+
const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
508
|
+
/* Document namespace */
|
509
|
+
let NAMESPACE = HTML_NAMESPACE;
|
510
|
+
let IS_EMPTY_INPUT = false;
|
511
|
+
/* Allowed XHTML+XML namespaces */
|
512
|
+
let ALLOWED_NAMESPACES = null;
|
513
|
+
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
514
|
+
let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
515
|
+
let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);
|
516
|
+
// Certain elements are allowed in both SVG and HTML
|
517
|
+
// namespace. We need to specify them explicitly
|
518
|
+
// so that they don't get erroneously deleted from
|
519
|
+
// HTML namespace.
|
520
|
+
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
|
521
|
+
/* Parsing of strict XHTML documents */
|
522
|
+
let PARSER_MEDIA_TYPE = null;
|
523
|
+
const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
|
524
|
+
const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
|
525
|
+
let transformCaseFunc = null;
|
526
|
+
/* Keep a reference to config to pass to hooks */
|
527
|
+
let CONFIG = null;
|
528
|
+
/* Ideally, do not touch anything below this line */
|
529
|
+
/* ______________________________________________ */
|
530
|
+
const formElement = document.createElement('form');
|
531
|
+
const isRegexOrFunction = function isRegexOrFunction(testValue) {
|
532
|
+
return testValue instanceof RegExp || testValue instanceof Function;
|
533
|
+
};
|
534
|
+
/**
|
535
|
+
* _parseConfig
|
536
|
+
*
|
537
|
+
* @param cfg optional config literal
|
538
|
+
*/
|
539
|
+
// eslint-disable-next-line complexity
|
540
|
+
const _parseConfig = function _parseConfig() {
|
541
|
+
let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
542
|
+
if (CONFIG && CONFIG === cfg) {
|
543
|
+
return;
|
544
|
+
}
|
545
|
+
/* Shield configuration object from tampering */
|
546
|
+
if (!cfg || typeof cfg !== 'object') {
|
547
|
+
cfg = {};
|
548
|
+
}
|
549
|
+
/* Shield configuration object from prototype pollution */
|
550
|
+
cfg = clone(cfg);
|
551
|
+
PARSER_MEDIA_TYPE =
|
552
|
+
// eslint-disable-next-line unicorn/prefer-includes
|
553
|
+
SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
|
554
|
+
// HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
|
555
|
+
transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
|
556
|
+
/* Set configuration parameters */
|
557
|
+
ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
|
558
|
+
ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
|
559
|
+
ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
|
560
|
+
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
|
561
|
+
DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
|
562
|
+
FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
|
563
|
+
FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
|
564
|
+
FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
|
565
|
+
USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;
|
566
|
+
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
|
567
|
+
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
|
568
|
+
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
|
569
|
+
ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
|
570
|
+
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
|
571
|
+
SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true
|
572
|
+
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
|
573
|
+
RETURN_DOM = cfg.RETURN_DOM || false; // Default false
|
574
|
+
RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
|
575
|
+
RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
|
576
|
+
FORCE_BODY = cfg.FORCE_BODY || false; // Default false
|
577
|
+
SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
|
578
|
+
SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
|
579
|
+
KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
|
580
|
+
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
581
|
+
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
|
582
|
+
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
|
583
|
+
MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
|
584
|
+
HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
|
585
|
+
CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
|
586
|
+
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
|
587
|
+
CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
|
588
|
+
}
|
589
|
+
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
|
590
|
+
CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
|
591
|
+
}
|
592
|
+
if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {
|
593
|
+
CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
|
594
|
+
}
|
595
|
+
if (SAFE_FOR_TEMPLATES) {
|
596
|
+
ALLOW_DATA_ATTR = false;
|
597
|
+
}
|
598
|
+
if (RETURN_DOM_FRAGMENT) {
|
599
|
+
RETURN_DOM = true;
|
600
|
+
}
|
601
|
+
/* Parse profile info */
|
602
|
+
if (USE_PROFILES) {
|
603
|
+
ALLOWED_TAGS = addToSet({}, text);
|
604
|
+
ALLOWED_ATTR = [];
|
605
|
+
if (USE_PROFILES.html === true) {
|
606
|
+
addToSet(ALLOWED_TAGS, html$1);
|
607
|
+
addToSet(ALLOWED_ATTR, html);
|
608
|
+
}
|
609
|
+
if (USE_PROFILES.svg === true) {
|
610
|
+
addToSet(ALLOWED_TAGS, svg$1);
|
611
|
+
addToSet(ALLOWED_ATTR, svg);
|
612
|
+
addToSet(ALLOWED_ATTR, xml);
|
613
|
+
}
|
614
|
+
if (USE_PROFILES.svgFilters === true) {
|
615
|
+
addToSet(ALLOWED_TAGS, svgFilters);
|
616
|
+
addToSet(ALLOWED_ATTR, svg);
|
617
|
+
addToSet(ALLOWED_ATTR, xml);
|
618
|
+
}
|
619
|
+
if (USE_PROFILES.mathMl === true) {
|
620
|
+
addToSet(ALLOWED_TAGS, mathMl$1);
|
621
|
+
addToSet(ALLOWED_ATTR, mathMl);
|
622
|
+
addToSet(ALLOWED_ATTR, xml);
|
623
|
+
}
|
624
|
+
}
|
625
|
+
/* Merge configuration parameters */
|
626
|
+
if (cfg.ADD_TAGS) {
|
627
|
+
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
628
|
+
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
629
|
+
}
|
630
|
+
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
631
|
+
}
|
632
|
+
if (cfg.ADD_ATTR) {
|
633
|
+
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
634
|
+
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
635
|
+
}
|
636
|
+
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
637
|
+
}
|
638
|
+
if (cfg.ADD_URI_SAFE_ATTR) {
|
639
|
+
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
|
640
|
+
}
|
641
|
+
if (cfg.FORBID_CONTENTS) {
|
642
|
+
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
|
643
|
+
FORBID_CONTENTS = clone(FORBID_CONTENTS);
|
644
|
+
}
|
645
|
+
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
|
646
|
+
}
|
647
|
+
/* Add #text in case KEEP_CONTENT is set to true */
|
648
|
+
if (KEEP_CONTENT) {
|
649
|
+
ALLOWED_TAGS['#text'] = true;
|
650
|
+
}
|
651
|
+
/* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
|
652
|
+
if (WHOLE_DOCUMENT) {
|
653
|
+
addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
|
654
|
+
}
|
655
|
+
/* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
|
656
|
+
if (ALLOWED_TAGS.table) {
|
657
|
+
addToSet(ALLOWED_TAGS, ['tbody']);
|
658
|
+
delete FORBID_TAGS.tbody;
|
659
|
+
}
|
660
|
+
if (cfg.TRUSTED_TYPES_POLICY) {
|
661
|
+
if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
|
662
|
+
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
663
|
+
}
|
664
|
+
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
|
665
|
+
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
666
|
+
}
|
667
|
+
// Overwrite existing TrustedTypes policy.
|
668
|
+
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
669
|
+
// Sign local variables required by `sanitize`.
|
670
|
+
emptyHTML = trustedTypesPolicy.createHTML('');
|
671
|
+
} else {
|
672
|
+
// Uninitialized policy, attempt to initialize the internal dompurify policy.
|
673
|
+
if (trustedTypesPolicy === undefined) {
|
674
|
+
trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
675
|
+
}
|
676
|
+
// If creating the internal policy succeeded sign internal variables.
|
677
|
+
if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
|
678
|
+
emptyHTML = trustedTypesPolicy.createHTML('');
|
679
|
+
}
|
680
|
+
}
|
681
|
+
// Prevent further manipulation of configuration.
|
682
|
+
// Not available in IE8, Safari 5, etc.
|
683
|
+
if (freeze) {
|
684
|
+
freeze(cfg);
|
685
|
+
}
|
686
|
+
CONFIG = cfg;
|
687
|
+
};
|
688
|
+
/* Keep track of all possible SVG and MathML tags
|
689
|
+
* so that we can perform the namespace checks
|
690
|
+
* correctly. */
|
691
|
+
const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
|
692
|
+
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
|
693
|
+
/**
|
694
|
+
* @param element a DOM element whose namespace is being checked
|
695
|
+
* @returns Return false if the element has a
|
696
|
+
* namespace that a spec-compliant parser would never
|
697
|
+
* return. Return true otherwise.
|
698
|
+
*/
|
699
|
+
const _checkValidNamespace = function _checkValidNamespace(element) {
|
700
|
+
let parent = getParentNode(element);
|
701
|
+
// In JSDOM, if we're inside shadow DOM, then parentNode
|
702
|
+
// can be null. We just simulate parent in this case.
|
703
|
+
if (!parent || !parent.tagName) {
|
704
|
+
parent = {
|
705
|
+
namespaceURI: NAMESPACE,
|
706
|
+
tagName: 'template'
|
707
|
+
};
|
708
|
+
}
|
709
|
+
const tagName = stringToLowerCase(element.tagName);
|
710
|
+
const parentTagName = stringToLowerCase(parent.tagName);
|
711
|
+
if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
|
712
|
+
return false;
|
713
|
+
}
|
714
|
+
if (element.namespaceURI === SVG_NAMESPACE) {
|
715
|
+
// The only way to switch from HTML namespace to SVG
|
716
|
+
// is via <svg>. If it happens via any other tag, then
|
717
|
+
// it should be killed.
|
718
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
719
|
+
return tagName === 'svg';
|
720
|
+
}
|
721
|
+
// The only way to switch from MathML to SVG is via`
|
722
|
+
// svg if parent is either <annotation-xml> or MathML
|
723
|
+
// text integration points.
|
724
|
+
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
725
|
+
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
726
|
+
}
|
727
|
+
// We only allow elements that are defined in SVG
|
728
|
+
// spec. All others are disallowed in SVG namespace.
|
729
|
+
return Boolean(ALL_SVG_TAGS[tagName]);
|
730
|
+
}
|
731
|
+
if (element.namespaceURI === MATHML_NAMESPACE) {
|
732
|
+
// The only way to switch from HTML namespace to MathML
|
733
|
+
// is via <math>. If it happens via any other tag, then
|
734
|
+
// it should be killed.
|
735
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
736
|
+
return tagName === 'math';
|
737
|
+
}
|
738
|
+
// The only way to switch from SVG to MathML is via
|
739
|
+
// <math> and HTML integration points
|
740
|
+
if (parent.namespaceURI === SVG_NAMESPACE) {
|
741
|
+
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
742
|
+
}
|
743
|
+
// We only allow elements that are defined in MathML
|
744
|
+
// spec. All others are disallowed in MathML namespace.
|
745
|
+
return Boolean(ALL_MATHML_TAGS[tagName]);
|
746
|
+
}
|
747
|
+
if (element.namespaceURI === HTML_NAMESPACE) {
|
748
|
+
// The only way to switch from SVG to HTML is via
|
749
|
+
// HTML integration points, and from MathML to HTML
|
750
|
+
// is via MathML text integration points
|
751
|
+
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
752
|
+
return false;
|
753
|
+
}
|
754
|
+
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
755
|
+
return false;
|
756
|
+
}
|
757
|
+
// We disallow tags that are specific for MathML
|
758
|
+
// or SVG and should never appear in HTML namespace
|
759
|
+
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
760
|
+
}
|
761
|
+
// For XHTML and XML documents that support custom namespaces
|
762
|
+
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
|
763
|
+
return true;
|
764
|
+
}
|
765
|
+
// The code should never reach this place (this means
|
766
|
+
// that the element somehow got namespace that is not
|
767
|
+
// HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
|
768
|
+
// Return false just in case.
|
769
|
+
return false;
|
770
|
+
};
|
771
|
+
/**
|
772
|
+
* _forceRemove
|
773
|
+
*
|
774
|
+
* @param node a DOM node
|
775
|
+
*/
|
776
|
+
const _forceRemove = function _forceRemove(node) {
|
777
|
+
arrayPush(DOMPurify.removed, {
|
778
|
+
element: node
|
779
|
+
});
|
780
|
+
try {
|
781
|
+
// eslint-disable-next-line unicorn/prefer-dom-node-remove
|
782
|
+
getParentNode(node).removeChild(node);
|
783
|
+
} catch (_) {
|
784
|
+
remove(node);
|
785
|
+
}
|
786
|
+
};
|
787
|
+
/**
|
788
|
+
* _removeAttribute
|
789
|
+
*
|
790
|
+
* @param name an Attribute name
|
791
|
+
* @param element a DOM node
|
792
|
+
*/
|
793
|
+
const _removeAttribute = function _removeAttribute(name, element) {
|
794
|
+
try {
|
795
|
+
arrayPush(DOMPurify.removed, {
|
796
|
+
attribute: element.getAttributeNode(name),
|
797
|
+
from: element
|
798
|
+
});
|
799
|
+
} catch (_) {
|
800
|
+
arrayPush(DOMPurify.removed, {
|
801
|
+
attribute: null,
|
802
|
+
from: element
|
803
|
+
});
|
804
|
+
}
|
805
|
+
element.removeAttribute(name);
|
806
|
+
// We void attribute values for unremovable "is" attributes
|
807
|
+
if (name === 'is') {
|
808
|
+
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
|
809
|
+
try {
|
810
|
+
_forceRemove(element);
|
811
|
+
} catch (_) {}
|
812
|
+
} else {
|
813
|
+
try {
|
814
|
+
element.setAttribute(name, '');
|
815
|
+
} catch (_) {}
|
816
|
+
}
|
817
|
+
}
|
818
|
+
};
|
819
|
+
/**
|
820
|
+
* _initDocument
|
821
|
+
*
|
822
|
+
* @param dirty - a string of dirty markup
|
823
|
+
* @return a DOM, filled with the dirty markup
|
824
|
+
*/
|
825
|
+
const _initDocument = function _initDocument(dirty) {
|
826
|
+
/* Create a HTML document */
|
827
|
+
let doc = null;
|
828
|
+
let leadingWhitespace = null;
|
829
|
+
if (FORCE_BODY) {
|
830
|
+
dirty = '<remove></remove>' + dirty;
|
831
|
+
} else {
|
832
|
+
/* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
|
833
|
+
const matches = stringMatch(dirty, /^[\r\n\t ]+/);
|
834
|
+
leadingWhitespace = matches && matches[0];
|
835
|
+
}
|
836
|
+
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
|
837
|
+
// Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
|
838
|
+
dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
|
839
|
+
}
|
840
|
+
const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
841
|
+
/*
|
842
|
+
* Use the DOMParser API by default, fallback later if needs be
|
843
|
+
* DOMParser not work for svg when has multiple root element.
|
844
|
+
*/
|
845
|
+
if (NAMESPACE === HTML_NAMESPACE) {
|
846
|
+
try {
|
847
|
+
doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
|
848
|
+
} catch (_) {}
|
849
|
+
}
|
850
|
+
/* Use createHTMLDocument in case DOMParser is not available */
|
851
|
+
if (!doc || !doc.documentElement) {
|
852
|
+
doc = implementation.createDocument(NAMESPACE, 'template', null);
|
853
|
+
try {
|
854
|
+
doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
|
855
|
+
} catch (_) {
|
856
|
+
// Syntax error if dirtyPayload is invalid xml
|
857
|
+
}
|
858
|
+
}
|
859
|
+
const body = doc.body || doc.documentElement;
|
860
|
+
if (dirty && leadingWhitespace) {
|
861
|
+
body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
|
862
|
+
}
|
863
|
+
/* Work on whole document or just its body */
|
864
|
+
if (NAMESPACE === HTML_NAMESPACE) {
|
865
|
+
return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
|
866
|
+
}
|
867
|
+
return WHOLE_DOCUMENT ? doc.documentElement : body;
|
868
|
+
};
|
869
|
+
/**
|
870
|
+
* Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
|
871
|
+
*
|
872
|
+
* @param root The root element or node to start traversing on.
|
873
|
+
* @return The created NodeIterator
|
874
|
+
*/
|
875
|
+
const _createNodeIterator = function _createNodeIterator(root) {
|
876
|
+
return createNodeIterator.call(root.ownerDocument || root, root,
|
877
|
+
// eslint-disable-next-line no-bitwise
|
878
|
+
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
|
879
|
+
};
|
880
|
+
/**
|
881
|
+
* _isClobbered
|
882
|
+
*
|
883
|
+
* @param element element to check for clobbering attacks
|
884
|
+
* @return true if clobbered, false if safe
|
885
|
+
*/
|
886
|
+
const _isClobbered = function _isClobbered(element) {
|
887
|
+
return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');
|
888
|
+
};
|
889
|
+
/**
|
890
|
+
* Checks whether the given object is a DOM node.
|
891
|
+
*
|
892
|
+
* @param value object to check whether it's a DOM node
|
893
|
+
* @return true is object is a DOM node
|
894
|
+
*/
|
895
|
+
const _isNode = function _isNode(value) {
|
896
|
+
return typeof Node === 'function' && value instanceof Node;
|
897
|
+
};
|
898
|
+
function _executeHooks(hooks, currentNode, data) {
|
899
|
+
arrayForEach(hooks, hook => {
|
900
|
+
hook.call(DOMPurify, currentNode, data, CONFIG);
|
901
|
+
});
|
902
|
+
}
|
903
|
+
/**
|
904
|
+
* _sanitizeElements
|
905
|
+
*
|
906
|
+
* @protect nodeName
|
907
|
+
* @protect textContent
|
908
|
+
* @protect removeChild
|
909
|
+
* @param currentNode to check for permission to exist
|
910
|
+
* @return true if node was killed, false if left alive
|
911
|
+
*/
|
912
|
+
const _sanitizeElements = function _sanitizeElements(currentNode) {
|
913
|
+
let content = null;
|
914
|
+
/* Execute a hook if present */
|
915
|
+
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
916
|
+
/* Check if element is clobbered or can clobber */
|
917
|
+
if (_isClobbered(currentNode)) {
|
918
|
+
_forceRemove(currentNode);
|
919
|
+
return true;
|
920
|
+
}
|
921
|
+
/* Now let's check the element's type and name */
|
922
|
+
const tagName = transformCaseFunc(currentNode.nodeName);
|
923
|
+
/* Execute a hook if present */
|
924
|
+
_executeHooks(hooks.uponSanitizeElement, currentNode, {
|
925
|
+
tagName,
|
926
|
+
allowedTags: ALLOWED_TAGS
|
927
|
+
});
|
928
|
+
/* Detect mXSS attempts abusing namespace confusion */
|
929
|
+
if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
|
930
|
+
_forceRemove(currentNode);
|
931
|
+
return true;
|
932
|
+
}
|
933
|
+
/* Remove any occurrence of processing instructions */
|
934
|
+
if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
|
935
|
+
_forceRemove(currentNode);
|
936
|
+
return true;
|
937
|
+
}
|
938
|
+
/* Remove any kind of possibly harmful comments */
|
939
|
+
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
|
940
|
+
_forceRemove(currentNode);
|
941
|
+
return true;
|
942
|
+
}
|
943
|
+
/* Remove element if anything forbids its presence */
|
944
|
+
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
945
|
+
/* Check if we have a custom element to handle */
|
946
|
+
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
947
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
948
|
+
return false;
|
949
|
+
}
|
950
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
|
951
|
+
return false;
|
952
|
+
}
|
953
|
+
}
|
954
|
+
/* Keep content except for bad-listed elements */
|
955
|
+
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
956
|
+
const parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
957
|
+
const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
|
958
|
+
if (childNodes && parentNode) {
|
959
|
+
const childCount = childNodes.length;
|
960
|
+
for (let i = childCount - 1; i >= 0; --i) {
|
961
|
+
const childClone = cloneNode(childNodes[i], true);
|
962
|
+
childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
|
963
|
+
parentNode.insertBefore(childClone, getNextSibling(currentNode));
|
964
|
+
}
|
965
|
+
}
|
966
|
+
}
|
967
|
+
_forceRemove(currentNode);
|
968
|
+
return true;
|
969
|
+
}
|
970
|
+
/* Check whether element has a valid namespace */
|
971
|
+
if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
|
972
|
+
_forceRemove(currentNode);
|
973
|
+
return true;
|
974
|
+
}
|
975
|
+
/* Make sure that older browsers don't get fallback-tag mXSS */
|
976
|
+
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
|
977
|
+
_forceRemove(currentNode);
|
978
|
+
return true;
|
979
|
+
}
|
980
|
+
/* Sanitize element content to be template-safe */
|
981
|
+
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
|
982
|
+
/* Get the element's text content */
|
983
|
+
content = currentNode.textContent;
|
984
|
+
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
985
|
+
content = stringReplace(content, expr, ' ');
|
986
|
+
});
|
987
|
+
if (currentNode.textContent !== content) {
|
988
|
+
arrayPush(DOMPurify.removed, {
|
989
|
+
element: currentNode.cloneNode()
|
990
|
+
});
|
991
|
+
currentNode.textContent = content;
|
992
|
+
}
|
993
|
+
}
|
994
|
+
/* Execute a hook if present */
|
995
|
+
_executeHooks(hooks.afterSanitizeElements, currentNode, null);
|
996
|
+
return false;
|
997
|
+
};
|
998
|
+
/**
|
999
|
+
* _isValidAttribute
|
1000
|
+
*
|
1001
|
+
* @param lcTag Lowercase tag name of containing element.
|
1002
|
+
* @param lcName Lowercase attribute name.
|
1003
|
+
* @param value Attribute value.
|
1004
|
+
* @return Returns true if `value` is valid, otherwise false.
|
1005
|
+
*/
|
1006
|
+
// eslint-disable-next-line complexity
|
1007
|
+
const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
|
1008
|
+
/* Make sure attribute cannot clobber */
|
1009
|
+
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
|
1010
|
+
return false;
|
1011
|
+
}
|
1012
|
+
/* Allow valid data-* attributes: At least one character after "-"
|
1013
|
+
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
1014
|
+
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
1015
|
+
We don't need to check the value; it's always URI safe. */
|
1016
|
+
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
1017
|
+
if (
|
1018
|
+
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
1019
|
+
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
1020
|
+
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
1021
|
+
_isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||
|
1022
|
+
// Alternative, second condition checks if it's an `is`-attribute, AND
|
1023
|
+
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
1024
|
+
lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {
|
1025
|
+
return false;
|
1026
|
+
}
|
1027
|
+
/* Check value is safe. First, is attr inert? If so, is safe */
|
1028
|
+
} else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {
|
1029
|
+
return false;
|
1030
|
+
} else ;
|
1031
|
+
return true;
|
1032
|
+
};
|
1033
|
+
/**
|
1034
|
+
* _isBasicCustomElement
|
1035
|
+
* checks if at least one dash is included in tagName, and it's not the first char
|
1036
|
+
* for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
|
1037
|
+
*
|
1038
|
+
* @param tagName name of the tag of the node to sanitize
|
1039
|
+
* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
|
1040
|
+
*/
|
1041
|
+
const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
|
1042
|
+
return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
|
1043
|
+
};
|
1044
|
+
/**
|
1045
|
+
* _sanitizeAttributes
|
1046
|
+
*
|
1047
|
+
* @protect attributes
|
1048
|
+
* @protect nodeName
|
1049
|
+
* @protect removeAttribute
|
1050
|
+
* @protect setAttribute
|
1051
|
+
*
|
1052
|
+
* @param currentNode to sanitize
|
1053
|
+
*/
|
1054
|
+
const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
|
1055
|
+
/* Execute a hook if present */
|
1056
|
+
_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
|
1057
|
+
const {
|
1058
|
+
attributes
|
1059
|
+
} = currentNode;
|
1060
|
+
/* Check if we have attributes; if not we might have a text node */
|
1061
|
+
if (!attributes || _isClobbered(currentNode)) {
|
1062
|
+
return;
|
1063
|
+
}
|
1064
|
+
const hookEvent = {
|
1065
|
+
attrName: '',
|
1066
|
+
attrValue: '',
|
1067
|
+
keepAttr: true,
|
1068
|
+
allowedAttributes: ALLOWED_ATTR,
|
1069
|
+
forceKeepAttr: undefined
|
1070
|
+
};
|
1071
|
+
let l = attributes.length;
|
1072
|
+
/* Go backwards over all attributes; safely remove bad ones */
|
1073
|
+
while (l--) {
|
1074
|
+
const attr = attributes[l];
|
1075
|
+
const {
|
1076
|
+
name,
|
1077
|
+
namespaceURI,
|
1078
|
+
value: attrValue
|
1079
|
+
} = attr;
|
1080
|
+
const lcName = transformCaseFunc(name);
|
1081
|
+
const initValue = attrValue;
|
1082
|
+
let value = name === 'value' ? initValue : stringTrim(initValue);
|
1083
|
+
/* Execute a hook if present */
|
1084
|
+
hookEvent.attrName = lcName;
|
1085
|
+
hookEvent.attrValue = value;
|
1086
|
+
hookEvent.keepAttr = true;
|
1087
|
+
hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
|
1088
|
+
_executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
|
1089
|
+
value = hookEvent.attrValue;
|
1090
|
+
/* Full DOM Clobbering protection via namespace isolation,
|
1091
|
+
* Prefix id and name attributes with `user-content-`
|
1092
|
+
*/
|
1093
|
+
if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
|
1094
|
+
// Remove the attribute with this value
|
1095
|
+
_removeAttribute(name, currentNode);
|
1096
|
+
// Prefix the value and later re-create the attribute with the sanitized value
|
1097
|
+
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
1098
|
+
}
|
1099
|
+
/* Work around a security issue with comments inside attributes */
|
1100
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
1101
|
+
_removeAttribute(name, currentNode);
|
1102
|
+
continue;
|
1103
|
+
}
|
1104
|
+
/* Did the hooks approve of the attribute? */
|
1105
|
+
if (hookEvent.forceKeepAttr) {
|
1106
|
+
continue;
|
1107
|
+
}
|
1108
|
+
/* Did the hooks approve of the attribute? */
|
1109
|
+
if (!hookEvent.keepAttr) {
|
1110
|
+
_removeAttribute(name, currentNode);
|
1111
|
+
continue;
|
1112
|
+
}
|
1113
|
+
/* Work around a security issue in jQuery 3.0 */
|
1114
|
+
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
|
1115
|
+
_removeAttribute(name, currentNode);
|
1116
|
+
continue;
|
1117
|
+
}
|
1118
|
+
/* Sanitize attribute content to be template-safe */
|
1119
|
+
if (SAFE_FOR_TEMPLATES) {
|
1120
|
+
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
1121
|
+
value = stringReplace(value, expr, ' ');
|
1122
|
+
});
|
1123
|
+
}
|
1124
|
+
/* Is `value` valid for this attribute? */
|
1125
|
+
const lcTag = transformCaseFunc(currentNode.nodeName);
|
1126
|
+
if (!_isValidAttribute(lcTag, lcName, value)) {
|
1127
|
+
_removeAttribute(name, currentNode);
|
1128
|
+
continue;
|
1129
|
+
}
|
1130
|
+
/* Handle attributes that require Trusted Types */
|
1131
|
+
if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
|
1132
|
+
if (namespaceURI) ; else {
|
1133
|
+
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
1134
|
+
case 'TrustedHTML':
|
1135
|
+
{
|
1136
|
+
value = trustedTypesPolicy.createHTML(value);
|
1137
|
+
break;
|
1138
|
+
}
|
1139
|
+
case 'TrustedScriptURL':
|
1140
|
+
{
|
1141
|
+
value = trustedTypesPolicy.createScriptURL(value);
|
1142
|
+
break;
|
1143
|
+
}
|
1144
|
+
}
|
1145
|
+
}
|
1146
|
+
}
|
1147
|
+
/* Handle invalid data-* attribute set by try-catching it */
|
1148
|
+
if (value !== initValue) {
|
1149
|
+
try {
|
1150
|
+
if (namespaceURI) {
|
1151
|
+
currentNode.setAttributeNS(namespaceURI, name, value);
|
1152
|
+
} else {
|
1153
|
+
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
1154
|
+
currentNode.setAttribute(name, value);
|
1155
|
+
}
|
1156
|
+
if (_isClobbered(currentNode)) {
|
1157
|
+
_forceRemove(currentNode);
|
1158
|
+
} else {
|
1159
|
+
arrayPop(DOMPurify.removed);
|
1160
|
+
}
|
1161
|
+
} catch (_) {
|
1162
|
+
_removeAttribute(name, currentNode);
|
1163
|
+
}
|
1164
|
+
}
|
1165
|
+
}
|
1166
|
+
/* Execute a hook if present */
|
1167
|
+
_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
|
1168
|
+
};
|
1169
|
+
/**
|
1170
|
+
* _sanitizeShadowDOM
|
1171
|
+
*
|
1172
|
+
* @param fragment to iterate over recursively
|
1173
|
+
*/
|
1174
|
+
const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
|
1175
|
+
let shadowNode = null;
|
1176
|
+
const shadowIterator = _createNodeIterator(fragment);
|
1177
|
+
/* Execute a hook if present */
|
1178
|
+
_executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
|
1179
|
+
while (shadowNode = shadowIterator.nextNode()) {
|
1180
|
+
/* Execute a hook if present */
|
1181
|
+
_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
|
1182
|
+
/* Sanitize tags and elements */
|
1183
|
+
_sanitizeElements(shadowNode);
|
1184
|
+
/* Check attributes next */
|
1185
|
+
_sanitizeAttributes(shadowNode);
|
1186
|
+
/* Deep shadow DOM detected */
|
1187
|
+
if (shadowNode.content instanceof DocumentFragment) {
|
1188
|
+
_sanitizeShadowDOM(shadowNode.content);
|
1189
|
+
}
|
1190
|
+
}
|
1191
|
+
/* Execute a hook if present */
|
1192
|
+
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
1193
|
+
};
|
1194
|
+
// eslint-disable-next-line complexity
|
1195
|
+
DOMPurify.sanitize = function (dirty) {
|
1196
|
+
let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1197
|
+
let body = null;
|
1198
|
+
let importedNode = null;
|
1199
|
+
let currentNode = null;
|
1200
|
+
let returnNode = null;
|
1201
|
+
/* Make sure we have a string to sanitize.
|
1202
|
+
DO NOT return early, as this will return the wrong type if
|
1203
|
+
the user has requested a DOM object rather than a string */
|
1204
|
+
IS_EMPTY_INPUT = !dirty;
|
1205
|
+
if (IS_EMPTY_INPUT) {
|
1206
|
+
dirty = '<!-->';
|
1207
|
+
}
|
1208
|
+
/* Stringify, in case dirty is an object */
|
1209
|
+
if (typeof dirty !== 'string' && !_isNode(dirty)) {
|
1210
|
+
if (typeof dirty.toString === 'function') {
|
1211
|
+
dirty = dirty.toString();
|
1212
|
+
if (typeof dirty !== 'string') {
|
1213
|
+
throw typeErrorCreate('dirty is not a string, aborting');
|
1214
|
+
}
|
1215
|
+
} else {
|
1216
|
+
throw typeErrorCreate('toString is not a function');
|
1217
|
+
}
|
1218
|
+
}
|
1219
|
+
/* Return dirty HTML if DOMPurify cannot run */
|
1220
|
+
if (!DOMPurify.isSupported) {
|
1221
|
+
return dirty;
|
1222
|
+
}
|
1223
|
+
/* Assign config vars */
|
1224
|
+
if (!SET_CONFIG) {
|
1225
|
+
_parseConfig(cfg);
|
1226
|
+
}
|
1227
|
+
/* Clean up removed elements */
|
1228
|
+
DOMPurify.removed = [];
|
1229
|
+
/* Check if dirty is correctly typed for IN_PLACE */
|
1230
|
+
if (typeof dirty === 'string') {
|
1231
|
+
IN_PLACE = false;
|
1232
|
+
}
|
1233
|
+
if (IN_PLACE) {
|
1234
|
+
/* Do some early pre-sanitization to avoid unsafe root nodes */
|
1235
|
+
if (dirty.nodeName) {
|
1236
|
+
const tagName = transformCaseFunc(dirty.nodeName);
|
1237
|
+
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
1238
|
+
throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
|
1239
|
+
}
|
1240
|
+
}
|
1241
|
+
} else if (dirty instanceof Node) {
|
1242
|
+
/* If dirty is a DOM element, append to an empty document to avoid
|
1243
|
+
elements being stripped by the parser */
|
1244
|
+
body = _initDocument('<!---->');
|
1245
|
+
importedNode = body.ownerDocument.importNode(dirty, true);
|
1246
|
+
if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {
|
1247
|
+
/* Node is already a body, use as is */
|
1248
|
+
body = importedNode;
|
1249
|
+
} else if (importedNode.nodeName === 'HTML') {
|
1250
|
+
body = importedNode;
|
1251
|
+
} else {
|
1252
|
+
// eslint-disable-next-line unicorn/prefer-dom-node-append
|
1253
|
+
body.appendChild(importedNode);
|
1254
|
+
}
|
1255
|
+
} else {
|
1256
|
+
/* Exit directly if we have nothing to do */
|
1257
|
+
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
|
1258
|
+
// eslint-disable-next-line unicorn/prefer-includes
|
1259
|
+
dirty.indexOf('<') === -1) {
|
1260
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
1261
|
+
}
|
1262
|
+
/* Initialize the document to work on */
|
1263
|
+
body = _initDocument(dirty);
|
1264
|
+
/* Check we have a DOM node from the data */
|
1265
|
+
if (!body) {
|
1266
|
+
return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
|
1267
|
+
}
|
1268
|
+
}
|
1269
|
+
/* Remove first element node (ours) if FORCE_BODY is set */
|
1270
|
+
if (body && FORCE_BODY) {
|
1271
|
+
_forceRemove(body.firstChild);
|
1272
|
+
}
|
1273
|
+
/* Get node iterator */
|
1274
|
+
const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
|
1275
|
+
/* Now start iterating over the created document */
|
1276
|
+
while (currentNode = nodeIterator.nextNode()) {
|
1277
|
+
/* Sanitize tags and elements */
|
1278
|
+
_sanitizeElements(currentNode);
|
1279
|
+
/* Check attributes next */
|
1280
|
+
_sanitizeAttributes(currentNode);
|
1281
|
+
/* Shadow DOM detected, sanitize it */
|
1282
|
+
if (currentNode.content instanceof DocumentFragment) {
|
1283
|
+
_sanitizeShadowDOM(currentNode.content);
|
1284
|
+
}
|
1285
|
+
}
|
1286
|
+
/* If we sanitized `dirty` in-place, return it. */
|
1287
|
+
if (IN_PLACE) {
|
1288
|
+
return dirty;
|
1289
|
+
}
|
1290
|
+
/* Return sanitized string or DOM */
|
1291
|
+
if (RETURN_DOM) {
|
1292
|
+
if (RETURN_DOM_FRAGMENT) {
|
1293
|
+
returnNode = createDocumentFragment.call(body.ownerDocument);
|
1294
|
+
while (body.firstChild) {
|
1295
|
+
// eslint-disable-next-line unicorn/prefer-dom-node-append
|
1296
|
+
returnNode.appendChild(body.firstChild);
|
1297
|
+
}
|
1298
|
+
} else {
|
1299
|
+
returnNode = body;
|
1300
|
+
}
|
1301
|
+
if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
|
1302
|
+
/*
|
1303
|
+
AdoptNode() is not used because internal state is not reset
|
1304
|
+
(e.g. the past names map of a HTMLFormElement), this is safe
|
1305
|
+
in theory but we would rather not risk another attack vector.
|
1306
|
+
The state that is cloned by importNode() is explicitly defined
|
1307
|
+
by the specs.
|
1308
|
+
*/
|
1309
|
+
returnNode = importNode.call(originalDocument, returnNode, true);
|
1310
|
+
}
|
1311
|
+
return returnNode;
|
1312
|
+
}
|
1313
|
+
let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
|
1314
|
+
/* Serialize doctype if allowed */
|
1315
|
+
if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
|
1316
|
+
serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
|
1317
|
+
}
|
1318
|
+
/* Sanitize final string template-safe */
|
1319
|
+
if (SAFE_FOR_TEMPLATES) {
|
1320
|
+
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
1321
|
+
serializedHTML = stringReplace(serializedHTML, expr, ' ');
|
1322
|
+
});
|
1323
|
+
}
|
1324
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
|
1325
|
+
};
|
1326
|
+
DOMPurify.setConfig = function () {
|
1327
|
+
let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
1328
|
+
_parseConfig(cfg);
|
1329
|
+
SET_CONFIG = true;
|
1330
|
+
};
|
1331
|
+
DOMPurify.clearConfig = function () {
|
1332
|
+
CONFIG = null;
|
1333
|
+
SET_CONFIG = false;
|
1334
|
+
};
|
1335
|
+
DOMPurify.isValidAttribute = function (tag, attr, value) {
|
1336
|
+
/* Initialize shared config vars if necessary. */
|
1337
|
+
if (!CONFIG) {
|
1338
|
+
_parseConfig({});
|
1339
|
+
}
|
1340
|
+
const lcTag = transformCaseFunc(tag);
|
1341
|
+
const lcName = transformCaseFunc(attr);
|
1342
|
+
return _isValidAttribute(lcTag, lcName, value);
|
1343
|
+
};
|
1344
|
+
DOMPurify.addHook = function (entryPoint, hookFunction) {
|
1345
|
+
if (typeof hookFunction !== 'function') {
|
1346
|
+
return;
|
1347
|
+
}
|
1348
|
+
arrayPush(hooks[entryPoint], hookFunction);
|
1349
|
+
};
|
1350
|
+
DOMPurify.removeHook = function (entryPoint, hookFunction) {
|
1351
|
+
if (hookFunction !== undefined) {
|
1352
|
+
const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
|
1353
|
+
return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
|
1354
|
+
}
|
1355
|
+
return arrayPop(hooks[entryPoint]);
|
1356
|
+
};
|
1357
|
+
DOMPurify.removeHooks = function (entryPoint) {
|
1358
|
+
hooks[entryPoint] = [];
|
1359
|
+
};
|
1360
|
+
DOMPurify.removeAllHooks = function () {
|
1361
|
+
hooks = _createHooksMap();
|
1362
|
+
};
|
1363
|
+
return DOMPurify;
|
1364
|
+
}
|
1365
|
+
var purify = createDOMPurify();
|
1366
|
+
|
1367
|
+
purify_cjs = purify;
|
1368
|
+
|
1369
|
+
return purify_cjs;
|
1370
|
+
}
|
1371
|
+
|
16
1372
|
dist.exports;
|
17
1373
|
(function(module, exports) {
|
18
1374
|
!function(e, t) {
|
19
|
-
t(exports) ;
|
20
|
-
}(commonjsGlobal, function(e) {
|
21
|
-
function
|
1375
|
+
t(exports, requirePurify_cjs()) ;
|
1376
|
+
}(commonjsGlobal, function(e, t) {
|
1377
|
+
function i(e2) {
|
1378
|
+
return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
|
1379
|
+
}
|
1380
|
+
var n = i(t);
|
1381
|
+
function r(e2, t2, i2, n2) {
|
22
1382
|
return new (i2 || (i2 = Promise))(function(r2, s2) {
|
23
1383
|
function o2(e3) {
|
24
1384
|
try {
|
@@ -43,37 +1403,37 @@ var telerikReportViewer = (function (exports) {
|
|
43
1403
|
l2((n2 = n2.apply(e2, t2 || [])).next());
|
44
1404
|
});
|
45
1405
|
}
|
46
|
-
class
|
1406
|
+
class s {
|
47
1407
|
constructor() {
|
48
1408
|
this.BasePath = "", this.ImmediatePrint = false, this.ContentOnly = false, this.UseSVG = false, this.enableSearch = false, this.enableAccessibility = false, this.contentTabIndex = 0;
|
49
1409
|
}
|
50
1410
|
}
|
51
|
-
class
|
1411
|
+
class o {
|
52
1412
|
constructor() {
|
53
1413
|
this.from = "", this.to = "", this.cc = "", this.subject = "", this.format = "", this.body = "";
|
54
1414
|
}
|
55
1415
|
}
|
56
|
-
class
|
1416
|
+
class a {
|
57
1417
|
constructor(e2, t2) {
|
58
1418
|
this.cancel = false, this.element = e2, this.action = t2;
|
59
1419
|
}
|
60
1420
|
}
|
61
|
-
class
|
1421
|
+
class l {
|
62
1422
|
constructor(e2, t2) {
|
63
1423
|
this.id = "", this.type = "", this.id = e2, this.type = t2;
|
64
1424
|
}
|
65
1425
|
}
|
66
|
-
class
|
1426
|
+
class h {
|
67
1427
|
constructor(e2, t2) {
|
68
1428
|
this.isCancelled = false, this.format = "", this.deviceInfo = e2, this.format = t2;
|
69
1429
|
}
|
70
1430
|
}
|
71
|
-
class
|
1431
|
+
class c {
|
72
1432
|
constructor(e2, t2, i2) {
|
73
1433
|
this.handled = false, this.url = e2, this.format = t2, this.windowOpenTarget = i2;
|
74
1434
|
}
|
75
1435
|
}
|
76
|
-
class
|
1436
|
+
class d {
|
77
1437
|
constructor(e2, t2) {
|
78
1438
|
this._responseText = e2, this._error = t2;
|
79
1439
|
try {
|
@@ -91,15 +1451,19 @@ var telerikReportViewer = (function (exports) {
|
|
91
1451
|
get error() {
|
92
1452
|
return this._error;
|
93
1453
|
}
|
1454
|
+
get exceptionMessage() {
|
1455
|
+
var e2, t2;
|
1456
|
+
return (null === (e2 = this.responseJSON) || void 0 === e2 ? void 0 : e2.exceptionMessage) || (null === (t2 = this.responseJSON) || void 0 === t2 ? void 0 : t2.ExceptionMessage);
|
1457
|
+
}
|
94
1458
|
}
|
95
|
-
function
|
1459
|
+
function u(e2, t2 = false, i2 = false) {
|
96
1460
|
let n2 = { Accept: "application/json, text/javascript, */*; q=0.01" };
|
97
1461
|
return t2 && (n2["Content-Type"] = i2 ? "application/x-www-form-urlencoded; charset=UTF-8" : "application/json; charset=UTF-8"), e2 && (n2.authorization = "Bearer " + e2), n2;
|
98
1462
|
}
|
99
|
-
function
|
100
|
-
return
|
1463
|
+
function p(e2) {
|
1464
|
+
return r(this, void 0, void 0, function* () {
|
101
1465
|
if (!e2.ok) {
|
102
|
-
let t2 = yield e2.text(), i2 = new
|
1466
|
+
let t2 = yield e2.text(), i2 = new d(t2, e2.statusText);
|
103
1467
|
return Promise.reject(i2);
|
104
1468
|
}
|
105
1469
|
if (204 == e2.status)
|
@@ -107,23 +1471,23 @@ var telerikReportViewer = (function (exports) {
|
|
107
1471
|
return (e2.headers.get("content-type") || "").includes("application/json") ? e2.json() : e2.text();
|
108
1472
|
});
|
109
1473
|
}
|
110
|
-
function
|
111
|
-
return fetch(e2, { method: "POST", headers:
|
1474
|
+
function g(e2, t2 = {}, i2 = "", n2 = false) {
|
1475
|
+
return fetch(e2, { method: "POST", headers: u(i2, true, n2), body: n2 ? t2 : JSON.stringify(t2) }).then(p);
|
112
1476
|
}
|
113
|
-
function
|
1477
|
+
function m() {
|
114
1478
|
}
|
115
|
-
function
|
116
|
-
|
1479
|
+
function f() {
|
1480
|
+
f.init.call(this);
|
117
1481
|
}
|
118
|
-
function
|
119
|
-
return void 0 === e2._maxListeners ?
|
1482
|
+
function v(e2) {
|
1483
|
+
return void 0 === e2._maxListeners ? f.defaultMaxListeners : e2._maxListeners;
|
120
1484
|
}
|
121
|
-
function
|
1485
|
+
function P(e2, t2, i2, n2) {
|
122
1486
|
var r2, s2, o2, a2;
|
123
1487
|
if ("function" != typeof i2)
|
124
1488
|
throw new TypeError('"listener" argument must be a function');
|
125
|
-
if ((s2 = e2._events) ? (s2.newListener && (e2.emit("newListener", t2, i2.listener ? i2.listener : i2), s2 = e2._events), o2 = s2[t2]) : (s2 = e2._events = new
|
126
|
-
if ("function" == typeof o2 ? o2 = s2[t2] = n2 ? [i2, o2] : [o2, i2] : n2 ? o2.unshift(i2) : o2.push(i2), !o2.warned && (r2 =
|
1489
|
+
if ((s2 = e2._events) ? (s2.newListener && (e2.emit("newListener", t2, i2.listener ? i2.listener : i2), s2 = e2._events), o2 = s2[t2]) : (s2 = e2._events = new m(), e2._eventsCount = 0), o2) {
|
1490
|
+
if ("function" == typeof o2 ? o2 = s2[t2] = n2 ? [i2, o2] : [o2, i2] : n2 ? o2.unshift(i2) : o2.push(i2), !o2.warned && (r2 = v(e2)) && r2 > 0 && o2.length > r2) {
|
127
1491
|
o2.warned = true;
|
128
1492
|
var l2 = new Error("Possible EventEmitter memory leak detected. " + o2.length + " " + t2 + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
129
1493
|
l2.name = "MaxListenersExceededWarning", l2.emitter = e2, l2.type = t2, l2.count = o2.length, a2 = l2, "function" == typeof console.warn ? console.warn(a2) : console.log(a2);
|
@@ -132,14 +1496,14 @@ var telerikReportViewer = (function (exports) {
|
|
132
1496
|
o2 = s2[t2] = i2, ++e2._eventsCount;
|
133
1497
|
return e2;
|
134
1498
|
}
|
135
|
-
function
|
1499
|
+
function y(e2, t2, i2) {
|
136
1500
|
var n2 = false;
|
137
1501
|
function r2() {
|
138
1502
|
e2.removeListener(t2, r2), n2 || (n2 = true, i2.apply(e2, arguments));
|
139
1503
|
}
|
140
1504
|
return r2.listener = i2, r2;
|
141
1505
|
}
|
142
|
-
function
|
1506
|
+
function I(e2) {
|
143
1507
|
var t2 = this._events;
|
144
1508
|
if (t2) {
|
145
1509
|
var i2 = t2[e2];
|
@@ -150,20 +1514,20 @@ var telerikReportViewer = (function (exports) {
|
|
150
1514
|
}
|
151
1515
|
return 0;
|
152
1516
|
}
|
153
|
-
function
|
1517
|
+
function C(e2, t2) {
|
154
1518
|
for (var i2 = new Array(t2); t2--; )
|
155
1519
|
i2[t2] = e2[t2];
|
156
1520
|
return i2;
|
157
1521
|
}
|
158
|
-
|
159
|
-
this.domain = null,
|
160
|
-
},
|
1522
|
+
m.prototype = /* @__PURE__ */ Object.create(null), f.EventEmitter = f, f.usingDomains = false, f.prototype.domain = void 0, f.prototype._events = void 0, f.prototype._maxListeners = void 0, f.defaultMaxListeners = 10, f.init = function() {
|
1523
|
+
this.domain = null, f.usingDomains && (void 0).active, this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = new m(), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
1524
|
+
}, f.prototype.setMaxListeners = function(e2) {
|
161
1525
|
if ("number" != typeof e2 || e2 < 0 || isNaN(e2))
|
162
1526
|
throw new TypeError('"n" argument must be a positive number');
|
163
1527
|
return this._maxListeners = e2, this;
|
164
|
-
},
|
165
|
-
return
|
166
|
-
},
|
1528
|
+
}, f.prototype.getMaxListeners = function() {
|
1529
|
+
return v(this);
|
1530
|
+
}, f.prototype.emit = function(e2) {
|
167
1531
|
var t2, i2, n2, r2, s2, o2, a2, l2 = "error" === e2;
|
168
1532
|
if (o2 = this._events)
|
169
1533
|
l2 = l2 && null == o2.error;
|
@@ -187,7 +1551,7 @@ var telerikReportViewer = (function (exports) {
|
|
187
1551
|
if (t3)
|
188
1552
|
e3.call(i3);
|
189
1553
|
else
|
190
|
-
for (var n3 = e3.length, r3 =
|
1554
|
+
for (var n3 = e3.length, r3 = C(e3, n3), s3 = 0; s3 < n3; ++s3)
|
191
1555
|
r3[s3].call(i3);
|
192
1556
|
}(i2, c2, this);
|
193
1557
|
break;
|
@@ -196,7 +1560,7 @@ var telerikReportViewer = (function (exports) {
|
|
196
1560
|
if (t3)
|
197
1561
|
e3.call(i3, n3);
|
198
1562
|
else
|
199
|
-
for (var r3 = e3.length, s3 =
|
1563
|
+
for (var r3 = e3.length, s3 = C(e3, r3), o3 = 0; o3 < r3; ++o3)
|
200
1564
|
s3[o3].call(i3, n3);
|
201
1565
|
}(i2, c2, this, arguments[1]);
|
202
1566
|
break;
|
@@ -205,7 +1569,7 @@ var telerikReportViewer = (function (exports) {
|
|
205
1569
|
if (t3)
|
206
1570
|
e3.call(i3, n3, r3);
|
207
1571
|
else
|
208
|
-
for (var s3 = e3.length, o3 =
|
1572
|
+
for (var s3 = e3.length, o3 = C(e3, s3), a3 = 0; a3 < s3; ++a3)
|
209
1573
|
o3[a3].call(i3, n3, r3);
|
210
1574
|
}(i2, c2, this, arguments[1], arguments[2]);
|
211
1575
|
break;
|
@@ -214,7 +1578,7 @@ var telerikReportViewer = (function (exports) {
|
|
214
1578
|
if (t3)
|
215
1579
|
e3.call(i3, n3, r3, s3);
|
216
1580
|
else
|
217
|
-
for (var o3 = e3.length, a3 =
|
1581
|
+
for (var o3 = e3.length, a3 = C(e3, o3), l3 = 0; l3 < o3; ++l3)
|
218
1582
|
a3[l3].call(i3, n3, r3, s3);
|
219
1583
|
}(i2, c2, this, arguments[1], arguments[2], arguments[3]);
|
220
1584
|
break;
|
@@ -225,24 +1589,24 @@ var telerikReportViewer = (function (exports) {
|
|
225
1589
|
if (t3)
|
226
1590
|
e3.apply(i3, n3);
|
227
1591
|
else
|
228
|
-
for (var r3 = e3.length, s3 =
|
1592
|
+
for (var r3 = e3.length, s3 = C(e3, r3), o3 = 0; o3 < r3; ++o3)
|
229
1593
|
s3[o3].apply(i3, n3);
|
230
1594
|
}(i2, c2, this, r2);
|
231
1595
|
}
|
232
1596
|
return true;
|
233
|
-
},
|
234
|
-
return
|
235
|
-
},
|
236
|
-
return
|
237
|
-
},
|
1597
|
+
}, f.prototype.addListener = function(e2, t2) {
|
1598
|
+
return P(this, e2, t2, false);
|
1599
|
+
}, f.prototype.on = f.prototype.addListener, f.prototype.prependListener = function(e2, t2) {
|
1600
|
+
return P(this, e2, t2, true);
|
1601
|
+
}, f.prototype.once = function(e2, t2) {
|
238
1602
|
if ("function" != typeof t2)
|
239
1603
|
throw new TypeError('"listener" argument must be a function');
|
240
|
-
return this.on(e2,
|
241
|
-
},
|
1604
|
+
return this.on(e2, y(this, e2, t2)), this;
|
1605
|
+
}, f.prototype.prependOnceListener = function(e2, t2) {
|
242
1606
|
if ("function" != typeof t2)
|
243
1607
|
throw new TypeError('"listener" argument must be a function');
|
244
|
-
return this.prependListener(e2,
|
245
|
-
},
|
1608
|
+
return this.prependListener(e2, y(this, e2, t2)), this;
|
1609
|
+
}, f.prototype.removeListener = function(e2, t2) {
|
246
1610
|
var i2, n2, r2, s2, o2;
|
247
1611
|
if ("function" != typeof t2)
|
248
1612
|
throw new TypeError('"listener" argument must be a function');
|
@@ -251,7 +1615,7 @@ var telerikReportViewer = (function (exports) {
|
|
251
1615
|
if (!(i2 = n2[e2]))
|
252
1616
|
return this;
|
253
1617
|
if (i2 === t2 || i2.listener && i2.listener === t2)
|
254
|
-
0 == --this._eventsCount ? this._events = new
|
1618
|
+
0 == --this._eventsCount ? this._events = new m() : (delete n2[e2], n2.removeListener && this.emit("removeListener", e2, i2.listener || t2));
|
255
1619
|
else if ("function" != typeof i2) {
|
256
1620
|
for (r2 = -1, s2 = i2.length; s2-- > 0; )
|
257
1621
|
if (i2[s2] === t2 || i2[s2].listener && i2[s2].listener === t2) {
|
@@ -262,7 +1626,7 @@ var telerikReportViewer = (function (exports) {
|
|
262
1626
|
return this;
|
263
1627
|
if (1 === i2.length) {
|
264
1628
|
if (i2[0] = void 0, 0 == --this._eventsCount)
|
265
|
-
return this._events = new
|
1629
|
+
return this._events = new m(), this;
|
266
1630
|
delete n2[e2];
|
267
1631
|
} else
|
268
1632
|
!function(e3, t3) {
|
@@ -273,18 +1637,18 @@ var telerikReportViewer = (function (exports) {
|
|
273
1637
|
n2.removeListener && this.emit("removeListener", e2, o2 || t2);
|
274
1638
|
}
|
275
1639
|
return this;
|
276
|
-
},
|
1640
|
+
}, f.prototype.off = function(e2, t2) {
|
277
1641
|
return this.removeListener(e2, t2);
|
278
|
-
},
|
1642
|
+
}, f.prototype.removeAllListeners = function(e2) {
|
279
1643
|
var t2, i2;
|
280
1644
|
if (!(i2 = this._events))
|
281
1645
|
return this;
|
282
1646
|
if (!i2.removeListener)
|
283
|
-
return 0 === arguments.length ? (this._events = new
|
1647
|
+
return 0 === arguments.length ? (this._events = new m(), this._eventsCount = 0) : i2[e2] && (0 == --this._eventsCount ? this._events = new m() : delete i2[e2]), this;
|
284
1648
|
if (0 === arguments.length) {
|
285
1649
|
for (var n2, r2 = Object.keys(i2), s2 = 0; s2 < r2.length; ++s2)
|
286
1650
|
"removeListener" !== (n2 = r2[s2]) && this.removeAllListeners(n2);
|
287
|
-
return this.removeAllListeners("removeListener"), this._events = new
|
1651
|
+
return this.removeAllListeners("removeListener"), this._events = new m(), this._eventsCount = 0, this;
|
288
1652
|
}
|
289
1653
|
if ("function" == typeof (t2 = i2[e2]))
|
290
1654
|
this.removeListener(e2, t2);
|
@@ -293,34 +1657,34 @@ var telerikReportViewer = (function (exports) {
|
|
293
1657
|
this.removeListener(e2, t2[t2.length - 1]);
|
294
1658
|
} while (t2[0]);
|
295
1659
|
return this;
|
296
|
-
},
|
1660
|
+
}, f.prototype.listeners = function(e2) {
|
297
1661
|
var t2, i2 = this._events;
|
298
1662
|
return i2 && (t2 = i2[e2]) ? "function" == typeof t2 ? [t2.listener || t2] : function(e3) {
|
299
1663
|
for (var t3 = new Array(e3.length), i3 = 0; i3 < t3.length; ++i3)
|
300
1664
|
t3[i3] = e3[i3].listener || e3[i3];
|
301
1665
|
return t3;
|
302
1666
|
}(t2) : [];
|
303
|
-
},
|
304
|
-
return "function" == typeof e2.listenerCount ? e2.listenerCount(t2) :
|
305
|
-
},
|
1667
|
+
}, f.listenerCount = function(e2, t2) {
|
1668
|
+
return "function" == typeof e2.listenerCount ? e2.listenerCount(t2) : I.call(e2, t2);
|
1669
|
+
}, f.prototype.listenerCount = I, f.prototype.eventNames = function() {
|
306
1670
|
return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
|
307
1671
|
};
|
308
|
-
const
|
309
|
-
function
|
1672
|
+
const S = "function" == typeof Symbol ? Symbol.for("--[[await-event-emitter]]--") : "--[[await-event-emitter]]--";
|
1673
|
+
function b(e2) {
|
310
1674
|
if ("string" != typeof e2 && "symbol" != typeof e2)
|
311
1675
|
throw new TypeError("type is not type of string or symbol!");
|
312
1676
|
}
|
313
|
-
function
|
1677
|
+
function w(e2) {
|
314
1678
|
if ("function" != typeof e2)
|
315
1679
|
throw new TypeError("fn is not type of Function!");
|
316
1680
|
}
|
317
|
-
function
|
318
|
-
return { [
|
1681
|
+
function R(e2) {
|
1682
|
+
return { [S]: "always", fn: e2 };
|
319
1683
|
}
|
320
|
-
function
|
321
|
-
return { [
|
1684
|
+
function E(e2) {
|
1685
|
+
return { [S]: "once", fn: e2 };
|
322
1686
|
}
|
323
|
-
class
|
1687
|
+
class T {
|
324
1688
|
constructor() {
|
325
1689
|
this._events = {};
|
326
1690
|
}
|
@@ -328,25 +1692,25 @@ var telerikReportViewer = (function (exports) {
|
|
328
1692
|
return this.on(e2, t2);
|
329
1693
|
}
|
330
1694
|
on(e2, t2) {
|
331
|
-
return
|
1695
|
+
return b(e2), w(t2), this._events[e2] = this._events[e2] || [], this._events[e2].push(R(t2)), this;
|
332
1696
|
}
|
333
1697
|
prependListener(e2, t2) {
|
334
1698
|
return this.prepend(e2, t2);
|
335
1699
|
}
|
336
1700
|
prepend(e2, t2) {
|
337
|
-
return
|
1701
|
+
return b(e2), w(t2), this._events[e2] = this._events[e2] || [], this._events[e2].unshift(R(t2)), this;
|
338
1702
|
}
|
339
1703
|
prependOnceListener(e2, t2) {
|
340
1704
|
return this.prependOnce(e2, t2);
|
341
1705
|
}
|
342
1706
|
prependOnce(e2, t2) {
|
343
|
-
return
|
1707
|
+
return b(e2), w(t2), this._events[e2] = this._events[e2] || [], this._events[e2].unshift(E(t2)), this;
|
344
1708
|
}
|
345
1709
|
listeners(e2) {
|
346
1710
|
return (this._events[e2] || []).map((e3) => e3.fn);
|
347
1711
|
}
|
348
1712
|
once(e2, t2) {
|
349
|
-
return
|
1713
|
+
return b(e2), w(t2), this._events[e2] = this._events[e2] || [], this._events[e2].push(E(t2)), this;
|
350
1714
|
}
|
351
1715
|
removeAllListeners() {
|
352
1716
|
this._events = {};
|
@@ -355,7 +1719,7 @@ var telerikReportViewer = (function (exports) {
|
|
355
1719
|
return this.removeListener(e2, t2);
|
356
1720
|
}
|
357
1721
|
removeListener(e2, t2) {
|
358
|
-
|
1722
|
+
b(e2);
|
359
1723
|
const i2 = this.listeners(e2);
|
360
1724
|
if ("function" == typeof t2) {
|
361
1725
|
let n2 = -1, r2 = false;
|
@@ -365,14 +1729,14 @@ var telerikReportViewer = (function (exports) {
|
|
365
1729
|
}
|
366
1730
|
return delete this._events[e2];
|
367
1731
|
}
|
368
|
-
emit(e2, ...
|
369
|
-
return
|
370
|
-
|
371
|
-
const
|
372
|
-
if (
|
373
|
-
for (let r2 = 0; r2 <
|
374
|
-
const s2 =
|
375
|
-
o2 instanceof Promise && (yield o2), this._events[e2] && this._events[e2][r2] && "once" === this._events[e2][r2][
|
1732
|
+
emit(e2, ...t2) {
|
1733
|
+
return r(this, void 0, void 0, function* () {
|
1734
|
+
b(e2);
|
1735
|
+
const i2 = this.listeners(e2), n2 = [];
|
1736
|
+
if (i2 && i2.length) {
|
1737
|
+
for (let r2 = 0; r2 < i2.length; r2++) {
|
1738
|
+
const s2 = i2[r2], o2 = s2.apply(this, t2);
|
1739
|
+
o2 instanceof Promise && (yield o2), this._events[e2] && this._events[e2][r2] && "once" === this._events[e2][r2][S] && n2.push(s2);
|
376
1740
|
}
|
377
1741
|
return n2.forEach((t3) => this.removeListener(e2, t3)), true;
|
378
1742
|
}
|
@@ -380,21 +1744,21 @@ var telerikReportViewer = (function (exports) {
|
|
380
1744
|
});
|
381
1745
|
}
|
382
1746
|
emitSync(e2, ...t2) {
|
383
|
-
|
1747
|
+
b(e2);
|
384
1748
|
const i2 = this.listeners(e2), n2 = [];
|
385
1749
|
if (i2 && i2.length) {
|
386
1750
|
for (let r2 = 0; r2 < i2.length; r2++) {
|
387
1751
|
const s2 = i2[r2];
|
388
|
-
s2.apply(this, t2), this._events[e2] && this._events[e2][r2] && "once" === this._events[e2][r2][
|
1752
|
+
s2.apply(this, t2), this._events[e2] && this._events[e2][r2] && "once" === this._events[e2][r2][S] && n2.push(s2);
|
389
1753
|
}
|
390
1754
|
return n2.forEach((t3) => this.removeListener(e2, t3)), true;
|
391
1755
|
}
|
392
1756
|
return false;
|
393
1757
|
}
|
394
1758
|
}
|
395
|
-
class
|
1759
|
+
class A {
|
396
1760
|
constructor() {
|
397
|
-
this.eventEmitter = new
|
1761
|
+
this.eventEmitter = new f(), this.awaitEventEmitter = new T();
|
398
1762
|
}
|
399
1763
|
on(e2, t2) {
|
400
1764
|
return this.eventEmitter.on(e2, t2), this;
|
@@ -405,13 +1769,13 @@ var telerikReportViewer = (function (exports) {
|
|
405
1769
|
onAsync(e2, t2) {
|
406
1770
|
return this.awaitEventEmitter.on(e2, t2), this;
|
407
1771
|
}
|
408
|
-
emitAsync(e2, ...
|
409
|
-
return
|
410
|
-
yield this.awaitEventEmitter.emit(e2, ...
|
1772
|
+
emitAsync(e2, ...t2) {
|
1773
|
+
return r(this, void 0, void 0, function* () {
|
1774
|
+
yield this.awaitEventEmitter.emit(e2, ...t2);
|
411
1775
|
});
|
412
1776
|
}
|
413
1777
|
}
|
414
|
-
class
|
1778
|
+
class M {
|
415
1779
|
hasPdfPlugin() {
|
416
1780
|
let e2 = ["AcroPDF.PDF.1", "PDF.PdfCtrl.6", "PDF.PdfCtrl.5"];
|
417
1781
|
for (let t2 of e2)
|
@@ -424,7 +1788,7 @@ var telerikReportViewer = (function (exports) {
|
|
424
1788
|
return false;
|
425
1789
|
}
|
426
1790
|
}
|
427
|
-
class
|
1791
|
+
class L {
|
428
1792
|
hasPdfPlugin() {
|
429
1793
|
let e2 = /Firefox[/\s](\d+\.\d+)/.exec(navigator.userAgent);
|
430
1794
|
if (null !== e2 && e2.length > 1) {
|
@@ -439,7 +1803,7 @@ var telerikReportViewer = (function (exports) {
|
|
439
1803
|
return false;
|
440
1804
|
}
|
441
1805
|
}
|
442
|
-
class
|
1806
|
+
class x {
|
443
1807
|
constructor(e2) {
|
444
1808
|
this.defaultPlugin = e2;
|
445
1809
|
}
|
@@ -450,22 +1814,22 @@ var telerikReportViewer = (function (exports) {
|
|
450
1814
|
return false;
|
451
1815
|
}
|
452
1816
|
}
|
453
|
-
class
|
1817
|
+
class D {
|
454
1818
|
hasPdfPlugin() {
|
455
1819
|
return false;
|
456
1820
|
}
|
457
1821
|
}
|
458
|
-
function
|
1822
|
+
function N() {
|
459
1823
|
return window.navigator && window.navigator.msSaveOrOpenBlob;
|
460
1824
|
}
|
461
|
-
class
|
1825
|
+
class k {
|
462
1826
|
constructor() {
|
463
1827
|
this.hasPdfPlugin = false, this.iframe = null, this.hasPdfPlugin = function() {
|
464
1828
|
if (window.navigator) {
|
465
1829
|
let e2 = window.navigator.userAgent.toLowerCase();
|
466
|
-
return e2.indexOf("msie") > -1 || e2.indexOf("mozilla") > -1 && e2.indexOf("trident") > -1 ? new
|
1830
|
+
return e2.indexOf("msie") > -1 || e2.indexOf("mozilla") > -1 && e2.indexOf("trident") > -1 ? new M() : e2.indexOf("firefox") > -1 ? new L() : e2.indexOf("edg/") > -1 ? new x("Microsoft Edge PDF Plugin") : e2.indexOf("chrome") > -1 ? new x("Chrome PDF Viewer") : e2.indexOf("safari") > -1 ? new x("WebKit built-in PDF") : new D();
|
467
1831
|
}
|
468
|
-
return new
|
1832
|
+
return new D();
|
469
1833
|
}().hasPdfPlugin(), this.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
470
1834
|
}
|
471
1835
|
destroy() {
|
@@ -483,13 +1847,13 @@ var telerikReportViewer = (function (exports) {
|
|
483
1847
|
}), function(e3) {
|
484
1848
|
let t3 = window.location, i3 = document.createElement("a");
|
485
1849
|
return i3.setAttribute("href", e3), "" == i3.host && (i3.href = i3.href), t3.hostname === i3.hostname && t3.protocol === i3.protocol && t3.port === i3.port;
|
486
|
-
}(e2) &&
|
1850
|
+
}(e2) && N())
|
487
1851
|
return this.iframe.src = e2, void document.body.appendChild(this.iframe);
|
488
1852
|
let i2 = new XMLHttpRequest(), n2 = this;
|
489
1853
|
i2.open("GET", e2, true), i2.responseType = "arraybuffer", i2.onload = function() {
|
490
1854
|
if (200 === this.status) {
|
491
1855
|
let e3 = new Blob([this.response], { type: "application/pdf" });
|
492
|
-
|
1856
|
+
N() ? window.navigator.msSaveOrOpenBlob(e3) : (t2 = (window.URL || window.webkitURL).createObjectURL(e3), null != n2.iframe && (n2.iframe.src = t2, document.body.appendChild(n2.iframe)));
|
493
1857
|
} else
|
494
1858
|
console.log("Could not retrieve remote PDF document.");
|
495
1859
|
}, i2.send();
|
@@ -504,10 +1868,10 @@ var telerikReportViewer = (function (exports) {
|
|
504
1868
|
return this.hasPdfPlugin;
|
505
1869
|
}
|
506
1870
|
}
|
507
|
-
function
|
1871
|
+
function F(e2) {
|
508
1872
|
return 1e3 * e2;
|
509
1873
|
}
|
510
|
-
class
|
1874
|
+
class O {
|
511
1875
|
constructor(e2, t2, i2) {
|
512
1876
|
if (this.pingMilliseconds = 0, !e2)
|
513
1877
|
throw "Error";
|
@@ -516,7 +1880,7 @@ var telerikReportViewer = (function (exports) {
|
|
516
1880
|
initSessionTimeout(e2) {
|
517
1881
|
if (!isFinite(e2))
|
518
1882
|
throw "sessionTimeoutSeconds must be finite";
|
519
|
-
this.pingMilliseconds = e2 <= 120 ?
|
1883
|
+
this.pingMilliseconds = e2 <= 120 ? F(e2) / 2 : F(e2 - 60);
|
520
1884
|
}
|
521
1885
|
start() {
|
522
1886
|
this.pingMilliseconds <= 0 || (this.interval = setInterval(() => {
|
@@ -527,33 +1891,33 @@ var telerikReportViewer = (function (exports) {
|
|
527
1891
|
this.interval && (clearInterval(this.interval), this.interval = null);
|
528
1892
|
}
|
529
1893
|
}
|
530
|
-
var
|
531
|
-
function
|
1894
|
+
var V, z, _, $, U;
|
1895
|
+
function H(e2, t2 = "", i2 = "") {
|
532
1896
|
let n2 = document.createElement(e2);
|
533
|
-
return t2 && (n2.id = t2),
|
1897
|
+
return t2 && (n2.id = t2), B(n2, i2), n2;
|
534
1898
|
}
|
535
|
-
function
|
1899
|
+
function B(e2, t2) {
|
536
1900
|
if ("" === t2 || !e2)
|
537
1901
|
return;
|
538
1902
|
let i2 = t2.trim().split(" ");
|
539
1903
|
i2 = i2.filter((e3) => "" !== e3.trim()), e2.classList.add(...i2);
|
540
1904
|
}
|
541
|
-
function
|
1905
|
+
function q(e2, t2) {
|
542
1906
|
if ("" === t2 || !e2)
|
543
1907
|
return;
|
544
1908
|
let i2 = t2.trim().split(" ");
|
545
1909
|
i2 = i2.filter((e3) => "" !== e3.trim()), e2.classList.remove(...i2);
|
546
1910
|
}
|
547
|
-
function
|
1911
|
+
function W(e2, t2) {
|
548
1912
|
return e2.classList.contains(t2);
|
549
1913
|
}
|
550
|
-
function
|
1914
|
+
function j(e2) {
|
551
1915
|
return e2.offsetParent;
|
552
1916
|
}
|
553
|
-
function
|
1917
|
+
function G(e2) {
|
554
1918
|
return parseInt(e2, 10) || 0;
|
555
1919
|
}
|
556
|
-
function
|
1920
|
+
function J(e2, t2, i2, n2 = 0, r2 = 0) {
|
557
1921
|
let s2 = `${n2 = n2 || 0} ${r2 = r2 || 0}`;
|
558
1922
|
!function(e3, t3) {
|
559
1923
|
e3.style.setProperty("transform", t3), e3.style.setProperty("-moz-transform", t3), e3.style.setProperty("-ms-transform", t3), e3.style.setProperty("-webkit-transform", t3), e3.style.setProperty("-o-transform", t3);
|
@@ -561,11 +1925,11 @@ var telerikReportViewer = (function (exports) {
|
|
561
1925
|
e3.style.setProperty("transform-origin", t3), e3.style.setProperty("-moz-transform-origin", t3), e3.style.setProperty("-ms-transform-origin", t3), e3.style.setProperty("-webkit-transform-origin", t3), e3.style.setProperty("-o-transform-origin", t3);
|
562
1926
|
}(e2, s2);
|
563
1927
|
}
|
564
|
-
function
|
565
|
-
let t2 =
|
1928
|
+
function Z(e2) {
|
1929
|
+
let t2 = H("div");
|
566
1930
|
return t2.textContent = e2, t2.innerHTML;
|
567
1931
|
}
|
568
|
-
function
|
1932
|
+
function K(e2) {
|
569
1933
|
if (e2 && e2.length < 6) {
|
570
1934
|
let t3 = 1, i2 = e2.split("");
|
571
1935
|
for ("#" !== i2[0] && (t3 = 0); t3 < i2.length; t3++)
|
@@ -575,16 +1939,16 @@ var telerikReportViewer = (function (exports) {
|
|
575
1939
|
let t2 = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e2);
|
576
1940
|
return t2 ? parseInt(t2[1], 16) + ", " + parseInt(t2[2], 16) + ", " + parseInt(t2[3], 16) : null;
|
577
1941
|
}
|
578
|
-
function
|
1942
|
+
function X(e2) {
|
579
1943
|
return !!e2 && e2.indexOf(",") > -1;
|
580
1944
|
}
|
581
|
-
function
|
1945
|
+
function Q(e2) {
|
582
1946
|
if ("transparent" === e2.toLowerCase())
|
583
1947
|
return 0;
|
584
|
-
if (!
|
1948
|
+
if (!X(e2))
|
585
1949
|
return 1;
|
586
1950
|
if (-1 !== e2.indexOf("#")) {
|
587
|
-
let t3 =
|
1951
|
+
let t3 = K(e2);
|
588
1952
|
if (null === t3)
|
589
1953
|
return 1;
|
590
1954
|
e2 = t3;
|
@@ -594,34 +1958,34 @@ var telerikReportViewer = (function (exports) {
|
|
594
1958
|
});
|
595
1959
|
return 4 === t2.length ? parseFloat((parseFloat(t2[3].replace(/[()]/g, "")) / 255).toFixed(2)) : 1;
|
596
1960
|
}
|
597
|
-
function
|
598
|
-
let i2 =
|
1961
|
+
function Y(e2, t2) {
|
1962
|
+
let i2 = H("div");
|
599
1963
|
for (i2.innerHTML = t2; i2.childNodes.length; )
|
600
1964
|
e2.appendChild(i2.childNodes[0]);
|
601
1965
|
}
|
602
|
-
function
|
603
|
-
let i2 =
|
1966
|
+
function ee(e2, t2) {
|
1967
|
+
let i2 = H("div");
|
604
1968
|
for (i2.innerHTML = t2; i2.childNodes.length; )
|
605
1969
|
e2.prepend(i2.childNodes[i2.childNodes.length - 1]);
|
606
1970
|
}
|
607
|
-
function
|
1971
|
+
function te(e2, t2) {
|
608
1972
|
return null === e2 ? null : e2.querySelector(t2);
|
609
1973
|
}
|
610
|
-
function
|
1974
|
+
function ie(e2, t2) {
|
611
1975
|
var i2;
|
612
1976
|
return e2 && e2.attributes && (null === (i2 = e2.attributes[t2]) || void 0 === i2 ? void 0 : i2.value) || "";
|
613
1977
|
}
|
614
|
-
function
|
1978
|
+
function ne(e2) {
|
615
1979
|
let t2 = e2.parentElement;
|
616
|
-
return t2 ? t2.clientHeight != t2.scrollHeight ? t2 :
|
1980
|
+
return t2 ? t2.clientHeight != t2.scrollHeight ? t2 : ne(t2) : null;
|
617
1981
|
}
|
618
|
-
function
|
1982
|
+
function re(e2, t2 = 300) {
|
619
1983
|
let i2;
|
620
1984
|
return function(...n2) {
|
621
1985
|
clearTimeout(i2), i2 = setTimeout(() => e2.apply(this, n2), t2);
|
622
1986
|
};
|
623
1987
|
}
|
624
|
-
function
|
1988
|
+
function se(e2, t2) {
|
625
1989
|
let i2 = null;
|
626
1990
|
return function(n2, ...r2) {
|
627
1991
|
i2 || (i2 = setTimeout(function() {
|
@@ -629,24 +1993,24 @@ var telerikReportViewer = (function (exports) {
|
|
629
1993
|
}, t2));
|
630
1994
|
};
|
631
1995
|
}
|
632
|
-
function
|
1996
|
+
function oe(e2, t2) {
|
633
1997
|
return !!e2.responseJSON && e2.responseJSON.exceptionType === t2;
|
634
1998
|
}
|
635
|
-
function
|
636
|
-
return
|
1999
|
+
function ae(e2) {
|
2000
|
+
return oe(e2, "Telerik.Reporting.Services.Engine.InvalidClientException");
|
637
2001
|
}
|
638
|
-
function
|
639
|
-
return
|
2002
|
+
function le(e2) {
|
2003
|
+
return oe(e2, "Telerik.Reporting.Services.Engine.InvalidParameterException");
|
640
2004
|
}
|
641
|
-
function
|
2005
|
+
function he(e2) {
|
642
2006
|
return !!e2 && "internalservererror" === e2.split(" ").join("").toLowerCase();
|
643
2007
|
}
|
644
|
-
function
|
2008
|
+
function ce(e2, ...t2) {
|
645
2009
|
return e2.replace(/{(\d+)}/g, (e3, i2) => t2[i2] || "");
|
646
2010
|
}
|
647
|
-
function
|
2011
|
+
function de(e2, t2) {
|
648
2012
|
let i2, n2;
|
649
|
-
if (
|
2013
|
+
if (ue(e2))
|
650
2014
|
for (i2 = e2.length, n2 = 0; n2 < i2 && false !== t2.call(e2[n2], n2, e2[n2]); n2++)
|
651
2015
|
;
|
652
2016
|
else
|
@@ -655,55 +2019,55 @@ var telerikReportViewer = (function (exports) {
|
|
655
2019
|
break;
|
656
2020
|
return e2;
|
657
2021
|
}
|
658
|
-
function
|
2022
|
+
function ue(e2) {
|
659
2023
|
if (Array.isArray(e2))
|
660
2024
|
return true;
|
661
2025
|
return "number" == typeof (!!e2 && "length" in e2 && e2.length);
|
662
2026
|
}
|
663
|
-
function
|
2027
|
+
function pe(e2) {
|
664
2028
|
return /^(\-|\+)?([0-9]+)$/.test(e2) ? Number(e2) : NaN;
|
665
2029
|
}
|
666
|
-
function
|
2030
|
+
function ge(e2) {
|
667
2031
|
return /^(\-|\+)?([0-9]+(\.[0-9]+)?)$/.test(e2) ? Number(e2) : NaN;
|
668
2032
|
}
|
669
|
-
function
|
2033
|
+
function me(e2) {
|
670
2034
|
return e2 instanceof Date ? e2 : (/Z|[\+\-]\d\d:?\d\d/i.test(e2) || (e2 += "Z"), new Date(e2));
|
671
2035
|
}
|
672
|
-
e.PageMode = void 0, (
|
673
|
-
class
|
2036
|
+
e.PageMode = void 0, (V = e.PageMode || (e.PageMode = {}))[V.ContinuousScroll = 0] = "ContinuousScroll", V[V.SinglePage = 1] = "SinglePage", e.PrintMode = void 0, (z = e.PrintMode || (e.PrintMode = {}))[z.AutoSelect = 0] = "AutoSelect", z[z.ForcePDFPlugin = 1] = "ForcePDFPlugin", z[z.ForcePDFFile = 2] = "ForcePDFFile", e.ScaleMode = void 0, (_ = e.ScaleMode || (e.ScaleMode = {}))[_.FitPageWidth = 0] = "FitPageWidth", _[_.FitPage = 1] = "FitPage", _[_.Specific = 2] = "Specific", e.ServiceType = void 0, ($ = e.ServiceType || (e.ServiceType = {}))[$.REST = 0] = "REST", $[$.ReportServer = 1] = "ReportServer", e.ViewMode = void 0, (U = e.ViewMode || (e.ViewMode = {}))[U.Interactive = 0] = "Interactive", U[U.PrintPreview = 1] = "PrintPreview";
|
2037
|
+
class fe {
|
674
2038
|
constructor(e2) {
|
675
2039
|
this.handled = false, this.deviceInfo = e2;
|
676
2040
|
}
|
677
2041
|
}
|
678
|
-
class
|
2042
|
+
class ve {
|
679
2043
|
constructor(e2) {
|
680
2044
|
this.handled = false, this.url = e2;
|
681
2045
|
}
|
682
2046
|
}
|
683
|
-
class
|
2047
|
+
class Pe {
|
684
2048
|
constructor(e2, t2) {
|
685
2049
|
this.handled = false, this.deviceInfo = e2, this.format = t2;
|
686
2050
|
}
|
687
2051
|
}
|
688
|
-
class
|
2052
|
+
class ye {
|
689
2053
|
constructor(e2, t2) {
|
690
2054
|
this.handled = false, this.deviceInfo = e2, this.format = t2;
|
691
2055
|
}
|
692
2056
|
}
|
693
|
-
class
|
2057
|
+
class Ie extends o {
|
694
2058
|
constructor(e2, t2, i2) {
|
695
2059
|
super(), this.handled = false, this.body = e2.body, this.cc = e2.cc, this.format = e2.format, this.from = e2.from, this.subject = e2.subject, this.to = e2.to, this.deviceInfo = t2, this.url = i2;
|
696
2060
|
}
|
697
2061
|
}
|
698
|
-
const
|
699
|
-
var
|
2062
|
+
const Ce = "System.Int64", Se = "System.Double", be = "System.String", we = "System.DateTime", Re = "System.Boolean";
|
2063
|
+
var Ee = function() {
|
700
2064
|
var e2 = {};
|
701
2065
|
function t2(e3, t3, i3, n2) {
|
702
2066
|
var r2 = [].concat(t3).map(function(t4) {
|
703
2067
|
return function(e4, t5, i4) {
|
704
2068
|
if (e4.availableValues) {
|
705
2069
|
var n3 = false;
|
706
|
-
if (
|
2070
|
+
if (de(e4.availableValues, function(e5, r3) {
|
707
2071
|
return !(n3 = i4(t5, r3.value));
|
708
2072
|
}), !n3) {
|
709
2073
|
if (e4.allowNull && !t5)
|
@@ -727,7 +2091,7 @@ var telerikReportViewer = (function (exports) {
|
|
727
2091
|
function i2(e3, t3) {
|
728
2092
|
return e3.allowNull && -1 != [null, "", void 0].indexOf(t3);
|
729
2093
|
}
|
730
|
-
return e2[
|
2094
|
+
return e2[be] = { validate: function(e3, i3) {
|
731
2095
|
return t2(e3, i3, function(t3) {
|
732
2096
|
if (!t3) {
|
733
2097
|
if (e3.allowNull)
|
@@ -740,9 +2104,9 @@ var telerikReportViewer = (function (exports) {
|
|
740
2104
|
}, function(e4, t3) {
|
741
2105
|
return e4 == t3;
|
742
2106
|
});
|
743
|
-
} }, e2[
|
2107
|
+
} }, e2[Se] = { validate: function(e3, n2) {
|
744
2108
|
return t2(e3, n2, function(t3) {
|
745
|
-
var n3 =
|
2109
|
+
var n3 = ge(t3);
|
746
2110
|
if (isNaN(n3)) {
|
747
2111
|
if (i2(e3, t3))
|
748
2112
|
return null;
|
@@ -750,11 +2114,11 @@ var telerikReportViewer = (function (exports) {
|
|
750
2114
|
}
|
751
2115
|
return n3;
|
752
2116
|
}, function(e4, t3) {
|
753
|
-
return
|
2117
|
+
return ge(e4) == ge(t3);
|
754
2118
|
});
|
755
|
-
} }, e2[
|
2119
|
+
} }, e2[Ce] = { validate: function(e3, n2) {
|
756
2120
|
return t2(e3, n2, function(t3) {
|
757
|
-
var n3 =
|
2121
|
+
var n3 = pe(t3);
|
758
2122
|
if (isNaN(n3)) {
|
759
2123
|
if (i2(e3, t3))
|
760
2124
|
return null;
|
@@ -762,19 +2126,19 @@ var telerikReportViewer = (function (exports) {
|
|
762
2126
|
}
|
763
2127
|
return n3;
|
764
2128
|
}, function(e4, t3) {
|
765
|
-
return
|
2129
|
+
return pe(e4) == ge(t3);
|
766
2130
|
});
|
767
|
-
} }, e2[
|
2131
|
+
} }, e2[we] = { validate: function(e3, i3) {
|
768
2132
|
return t2(e3, i3, function(t3) {
|
769
2133
|
if (e3.allowNull && (null === t3 || "" === t3 || void 0 === t3))
|
770
2134
|
return null;
|
771
2135
|
if (!isNaN(Date.parse(t3)))
|
772
|
-
return e3.availableValues ? t3 :
|
2136
|
+
return e3.availableValues ? t3 : me(t3);
|
773
2137
|
throw "Please input a valid date.";
|
774
2138
|
}, function(e4, t3) {
|
775
|
-
return e4 =
|
2139
|
+
return e4 = me(e4), t3 = me(t3), e4.getTime() == t3.getTime();
|
776
2140
|
});
|
777
|
-
} }, e2[
|
2141
|
+
} }, e2[Re] = { validate: function(e3, n2) {
|
778
2142
|
return t2(e3, n2, function(t3) {
|
779
2143
|
if (-1 != ["true", "false"].indexOf(String(t3).toLowerCase()))
|
780
2144
|
return Boolean(t3);
|
@@ -787,11 +2151,11 @@ var telerikReportViewer = (function (exports) {
|
|
787
2151
|
} }, { validate: function(t3, i3) {
|
788
2152
|
var n2 = e2[t3.type];
|
789
2153
|
if (!n2)
|
790
|
-
throw
|
2154
|
+
throw ce("Cannot validate parameter of type {type}.", t3);
|
791
2155
|
return n2.validate(t3, i3);
|
792
2156
|
} };
|
793
2157
|
}();
|
794
|
-
function
|
2158
|
+
function Te(e2, t2, i2) {
|
795
2159
|
try {
|
796
2160
|
const n2 = e2.availableValues.find((e3) => e3.value === t2);
|
797
2161
|
if (!n2)
|
@@ -801,23 +2165,23 @@ var telerikReportViewer = (function (exports) {
|
|
801
2165
|
return;
|
802
2166
|
}
|
803
2167
|
}
|
804
|
-
function
|
2168
|
+
function Ae(e2, t2, i2) {
|
805
2169
|
const n2 = [];
|
806
2170
|
for (let r2 in t2)
|
807
|
-
n2.push(
|
2171
|
+
n2.push(Te(e2, t2[r2], i2));
|
808
2172
|
return n2;
|
809
2173
|
}
|
810
|
-
class
|
2174
|
+
class Me {
|
811
2175
|
constructor(e2 = "", t2 = {}) {
|
812
2176
|
this.report = e2, this.parameters = t2;
|
813
2177
|
}
|
814
2178
|
}
|
815
|
-
class
|
2179
|
+
class Le {
|
816
2180
|
constructor(e2, t2, i2, n2 = null) {
|
817
2181
|
this.element = e2, this.text = t2, this.title = i2, this.eventArgs = n2;
|
818
2182
|
}
|
819
2183
|
}
|
820
|
-
class
|
2184
|
+
class xe extends A {
|
821
2185
|
constructor(e2) {
|
822
2186
|
super(), this.resizeObserver = null, this.element = e2, this.initResizeObserver();
|
823
2187
|
}
|
@@ -825,7 +2189,7 @@ var telerikReportViewer = (function (exports) {
|
|
825
2189
|
this.destroyResizeObserver();
|
826
2190
|
}
|
827
2191
|
initResizeObserver() {
|
828
|
-
this.debounceResize =
|
2192
|
+
this.debounceResize = re(this.onResize.bind(this), 50), this.resizeObserver = new ResizeObserver(this.debounceResize), this.resizeObserver.observe(this.element);
|
829
2193
|
}
|
830
2194
|
destroyResizeObserver() {
|
831
2195
|
this.resizeObserver && this.resizeObserver.unobserve(this.element), this.resizeObserver = this.debounceResize = null;
|
@@ -834,8 +2198,8 @@ var telerikReportViewer = (function (exports) {
|
|
834
2198
|
e2[0].target === this.element && this.emit("resize");
|
835
2199
|
}
|
836
2200
|
}
|
837
|
-
const
|
838
|
-
class
|
2201
|
+
const De = '<div class="trv-report-page trv-skeleton-page trv-skeleton-{0}" style="{1}" data-page="{0}"><div class="trv-skeleton-wrapper" style="{2}"></div></div>';
|
2202
|
+
class Ne {
|
839
2203
|
constructor(t2, i2, n2) {
|
840
2204
|
this.enabled = false, this.viewMode = e.ViewMode.Interactive, this.scrollInProgress = false, this.additionalTopOffset = 130, this.onClickHandler = null, this.debounceScroll = null, this.throttleScroll = null, this.oldScrollTopPosition = 0, this.lastLoadedPage = null, this.placeholder = t2, this.pageContainer = t2.querySelector(".trv-page-container"), this.pageWrapper = t2.querySelector(".trv-page-wrapper"), this.contentArea = i2, this.controller = n2, this.controller.getPageMode() === e.PageMode.ContinuousScroll && this.enable(), this.controller.on("loadedReportChange", this.disable.bind(this)).on("viewModeChanged", this.disable.bind(this)).on("scaleChanged", this.onScaleChanged.bind(this)).on("interactiveActionExecuting", this.onInteractiveActionExecuting.bind(this)).on("pageLoaded", this.onPageLoaded.bind(this));
|
841
2205
|
}
|
@@ -857,10 +2221,10 @@ var telerikReportViewer = (function (exports) {
|
|
857
2221
|
return this.enabled;
|
858
2222
|
}
|
859
2223
|
enable() {
|
860
|
-
this.enabled = true,
|
2224
|
+
this.enabled = true, B(this.placeholder, "scrollable"), this.initEvents();
|
861
2225
|
}
|
862
2226
|
disable() {
|
863
|
-
this.enabled && (this.lastLoadedPage = null, this.pageWrapper.innerHTML = "", this.enabled = false,
|
2227
|
+
this.enabled && (this.lastLoadedPage = null, this.pageWrapper.innerHTML = "", this.enabled = false, q(this.placeholder, "scrollable"), this.unbind());
|
864
2228
|
}
|
865
2229
|
renderPage(e2) {
|
866
2230
|
let t2 = this.controller.getViewMode(), i2 = this.findPageElement(e2.pageNumber);
|
@@ -875,7 +2239,7 @@ var telerikReportViewer = (function (exports) {
|
|
875
2239
|
this.enabled && this.currentPageNumber() > 0 && this.keepCurrentPageInToView();
|
876
2240
|
}
|
877
2241
|
setCurrentPage(e2) {
|
878
|
-
e2 !== this.currentPageNumber() && this.controller.setCurrentPageNumber(e2), this.controller.getPageCount() > 1 && (
|
2242
|
+
e2 !== this.currentPageNumber() && this.controller.setCurrentPageNumber(e2), this.controller.getPageCount() > 1 && (q(this.findElement(".k-state-default"), "k-state-default"), B(this.findPageElement(e2), "k-state-default")), this.loadNextPreviousPage(e2);
|
879
2243
|
}
|
880
2244
|
updatePageArea(e2) {
|
881
2245
|
var t2;
|
@@ -900,18 +2264,18 @@ var telerikReportViewer = (function (exports) {
|
|
900
2264
|
return this.controller.getCurrentPageNumber();
|
901
2265
|
}
|
902
2266
|
isSkeletonScreen(e2, t2) {
|
903
|
-
return !(!e2 && !(e2 = this.findPageElement(t2))) &&
|
2267
|
+
return !(!e2 && !(e2 = this.findPageElement(t2))) && W(e2, "trv-skeleton-" + t2);
|
904
2268
|
}
|
905
2269
|
addSkeletonScreen(e2, t2) {
|
906
|
-
let i2 = e2 + (t2 ? 1 : -1), n2 = this.findPageElement(i2), r2 =
|
907
|
-
t2 ?
|
2270
|
+
let i2 = e2 + (t2 ? 1 : -1), n2 = this.findPageElement(i2), r2 = ie(n2, "style"), s2 = ie(null == n2 ? void 0 : n2.querySelector("sheet"), "style"), o2 = ce(De, e2, r2, s2);
|
2271
|
+
t2 ? ee(this.pageWrapper, o2) : Y(this.pageWrapper, o2);
|
908
2272
|
}
|
909
2273
|
generateSkeletonScreens(e2) {
|
910
2274
|
var t2;
|
911
|
-
let i2 = "", n2 = this.findPageElement(1), r2 =
|
2275
|
+
let i2 = "", n2 = this.findPageElement(1), r2 = ie(n2, "style"), s2 = ie(null == n2 ? void 0 : n2.querySelector("sheet"), "style"), o2 = null === (t2 = this.findLastElement(".trv-report-page")) || void 0 === t2 ? void 0 : t2.dataset.page, a2 = o2 ? parseInt(o2) + 1 : 1;
|
912
2276
|
for (; a2 < e2; a2++)
|
913
|
-
i2 +=
|
914
|
-
|
2277
|
+
i2 += ce(De, a2, r2, s2);
|
2278
|
+
Y(this.pageWrapper, i2);
|
915
2279
|
}
|
916
2280
|
loadMorePages() {
|
917
2281
|
var e2;
|
@@ -962,10 +2326,10 @@ var telerikReportViewer = (function (exports) {
|
|
962
2326
|
}
|
963
2327
|
}
|
964
2328
|
initEvents() {
|
965
|
-
this.onClickHandler = this.clickPage.bind(this), this.debounceScroll =
|
2329
|
+
this.onClickHandler = this.clickPage.bind(this), this.debounceScroll = re(() => {
|
966
2330
|
let e2 = this.placeholder.querySelectorAll(".trv-report-page"), t2 = Math.round(this.pageContainer.scrollTop + this.pageContainer.offsetHeight);
|
967
2331
|
!this.scrollInProgress && e2.length && this.oldScrollTopPosition !== t2 && this.advanceCurrentPage(Array.from(e2));
|
968
|
-
}, 250), this.throttleScroll =
|
2332
|
+
}, 250), this.throttleScroll = se(() => {
|
969
2333
|
let e2 = this.placeholder.querySelectorAll(".trv-report-page"), t2 = Math.round(this.pageContainer.scrollTop + this.pageContainer.offsetHeight);
|
970
2334
|
this.scrollInProgress || this.oldScrollTopPosition === t2 || (this.oldScrollTopPosition > t2 ? this.scrollUp(Array.from(e2)) : this.scrollDown(Array.from(e2), t2)), this.oldScrollTopPosition = t2;
|
971
2335
|
}, 250), this.pageContainer.addEventListener("click", this.onClickHandler), this.pageContainer.addEventListener("scroll", this.debounceScroll), this.pageContainer.addEventListener("scroll", this.throttleScroll);
|
@@ -1060,7 +2424,7 @@ var telerikReportViewer = (function (exports) {
|
|
1060
2424
|
return i2 && i2.length ? i2[i2.length - 1] : null;
|
1061
2425
|
}
|
1062
2426
|
}
|
1063
|
-
class
|
2427
|
+
class ke {
|
1064
2428
|
constructor() {
|
1065
2429
|
this.scaleFactor = 0, this.placeholder = null, this.scrollableContainer = null, this.itemsInitialState = {}, this.xFrozenAreasBounds = {}, this.yFrozenAreasBounds = {}, this.freezeMaxZIndex = {}, this.freezeBGColor = {}, this.currentlyFrozenContainer = { vertical: {}, horizontal: {} }, this.zIndex = 1;
|
1066
2430
|
}
|
@@ -1068,7 +2432,7 @@ var telerikReportViewer = (function (exports) {
|
|
1068
2432
|
this.reset(e2), this.attachToScrollEvent();
|
1069
2433
|
}
|
1070
2434
|
reset(e2) {
|
1071
|
-
this.placeholder = e2, this.scrollableContainer =
|
2435
|
+
this.placeholder = e2, this.scrollableContainer = te(e2, ".trv-page-container"), this.itemsInitialState = {}, this.xFrozenAreasBounds = {}, this.yFrozenAreasBounds = {}, this.currentlyFrozenContainer = { vertical: {}, horizontal: {} };
|
1072
2436
|
}
|
1073
2437
|
setScaleFactor(e2) {
|
1074
2438
|
this.scaleFactor = e2;
|
@@ -1091,7 +2455,7 @@ var telerikReportViewer = (function (exports) {
|
|
1091
2455
|
saveFreezeItemsInitialState(e2) {
|
1092
2456
|
var t2, i2, n2;
|
1093
2457
|
let r2 = null === (t2 = this.placeholder) || void 0 === t2 ? void 0 : t2.querySelectorAll("[data-sticky-direction][data-sticky-id='" + e2 + "']"), s2 = null === (i2 = this.placeholder) || void 0 === i2 ? void 0 : i2.querySelectorAll("[data-reporting-action][data-sticky-id='" + e2 + "']"), o2 = null, a2 = null, l2 = null, h2 = null;
|
1094
|
-
this.itemsInitialState[e2] = {}, this.freezeBGColor[e2] = (null === (n2 =
|
2458
|
+
this.itemsInitialState[e2] = {}, this.freezeBGColor[e2] = (null === (n2 = te(this.placeholder, "[data-id='" + e2 + "']")) || void 0 === n2 ? void 0 : n2.dataset.stickyBgColor) || "", r2.forEach((t3) => {
|
1095
2459
|
var i3;
|
1096
2460
|
let n3 = t3.dataset.stickyDirection, r3 = (null === (i3 = t3.dataset.id) || void 0 === i3 ? void 0 : i3.toString()) || "", s3 = t3.offsetLeft / this.scaleFactor, c2 = t3.offsetLeft + t3.offsetWidth * this.scaleFactor, d2 = t3.offsetTop / this.scaleFactor, u2 = t3.offsetTop + t3.offsetHeight * this.scaleFactor, p2 = (e3, t4) => null === e3 || t4 < e3 ? t4 : e3, g2 = (e3, t4) => null === e3 || t4 > e3 ? t4 : e3;
|
1097
2461
|
switch (n3) {
|
@@ -1113,7 +2477,7 @@ var telerikReportViewer = (function (exports) {
|
|
1113
2477
|
}
|
1114
2478
|
updateFreezeItemsOnScroll(e2, t2, i2) {
|
1115
2479
|
var n2, r2;
|
1116
|
-
let s2 =
|
2480
|
+
let s2 = te(this.placeholder, "div[data-id='" + e2 + "']");
|
1117
2481
|
if (!s2)
|
1118
2482
|
return;
|
1119
2483
|
let o2 = null === (n2 = this.placeholder) || void 0 === n2 ? void 0 : n2.querySelectorAll("[data-sticky-direction*='Horizontal'][data-sticky-id='" + e2 + "']"), a2 = null === (r2 = this.placeholder) || void 0 === r2 ? void 0 : r2.querySelectorAll("[data-sticky-direction*='Vertical'][data-sticky-id='" + e2 + "']");
|
@@ -1138,7 +2502,7 @@ var telerikReportViewer = (function (exports) {
|
|
1138
2502
|
"IMG" !== e2.tagName && (t2 && this.isFrozen(r2) && !i2 ? e2.style.backgroundColor = this.freezeBGColor[r2] : e2.style.backgroundColor = n2 ? this.freezeBGColor[r2] : "initial");
|
1139
2503
|
}
|
1140
2504
|
hasSetBgColor(e2) {
|
1141
|
-
return
|
2505
|
+
return Q(e2) > 0;
|
1142
2506
|
}
|
1143
2507
|
isFrozen(e2) {
|
1144
2508
|
return this.currentlyFrozenContainer.horizontal[e2] || this.currentlyFrozenContainer.vertical[e2];
|
@@ -1158,21 +2522,21 @@ var telerikReportViewer = (function (exports) {
|
|
1158
2522
|
return e2.top > t2.scrollTop - n2 && e2.top < t2.scrollTop + n2 + i2.height;
|
1159
2523
|
}
|
1160
2524
|
}
|
1161
|
-
const
|
1162
|
-
function
|
2525
|
+
const Fe = /{(\w+?)}/g, Oe = "trv-initial-image-styles";
|
2526
|
+
function Ve(e2, t2) {
|
1163
2527
|
let i2 = Array.isArray(t2);
|
1164
|
-
return e2 ? e2.replace(
|
2528
|
+
return e2 ? e2.replace(Fe, function(e3, n2) {
|
1165
2529
|
return t2[i2 ? parseInt(n2) : n2];
|
1166
2530
|
}) : "";
|
1167
2531
|
}
|
1168
|
-
const
|
2532
|
+
const ze = "trv-search-dialog-shaded-result", _e = "trv-search-dialog-highlighted-result";
|
1169
2533
|
e.BookmarkNode = class {
|
1170
2534
|
constructor() {
|
1171
2535
|
this.id = "", this.text = "", this.page = 0, this.items = null;
|
1172
2536
|
}
|
1173
2537
|
}, e.ContentArea = class {
|
1174
2538
|
constructor(e2, t2, i2, n2 = {}) {
|
1175
|
-
this.actions = [], this.pendingElement = null, this.documentReady = true, this.reportPageIsLoaded = false, this.navigateToPageOnDocReady = 0, this.navigateToElementOnDocReady = null, this.onClickHandler = null, this.onMouseEnterHandler = null, this.onMouseLeaveHandler = null, this.isNewReportSource = false, this.uiFreezeCoordinator = null, this.initialPageAreaImageUrl = "", this.showPageAreaImage = false, this.placeholder = e2.querySelector(".trv-pages-pane, .trv-pages-area"), this.pageContainer = e2.querySelector(".trv-page-container"), this.pageWrapper = e2.querySelector(".trv-page-wrapper"), this.parametersContainer = e2.querySelector(".trv-parameters-area"), this.notification = e2.querySelector(".trv-notification, .trv-error-pane"), this.scrollManager = new
|
2539
|
+
this.actions = [], this.pendingElement = null, this.documentReady = true, this.reportPageIsLoaded = false, this.navigateToPageOnDocReady = 0, this.navigateToElementOnDocReady = null, this.onClickHandler = null, this.onMouseEnterHandler = null, this.onMouseLeaveHandler = null, this.isNewReportSource = false, this.uiFreezeCoordinator = null, this.initialPageAreaImageUrl = "", this.showPageAreaImage = false, this.placeholder = e2.querySelector(".trv-pages-pane, .trv-pages-area"), this.pageContainer = e2.querySelector(".trv-page-container"), this.pageWrapper = e2.querySelector(".trv-page-wrapper"), this.parametersContainer = e2.querySelector(".trv-parameters-area"), this.notification = e2.querySelector(".trv-notification, .trv-error-pane"), this.scrollManager = new Ne(this.placeholder, this, t2), this.resizeService = new xe(this.pageContainer), this.resizeService.on("resize", this.onResize.bind(this)), this.controller = t2, this.controller.on("pageReady", this.onPageReady.bind(this)).on("navigateToPage", this.navigateToPage.bind(this)).on("serverActionStarted", this.onServerActionStarted.bind(this)).on("reportSourceChanged", this.onReportSourceChanged.bind(this)).on("scaleChanged", this.updatePageDimensions.bind(this)).on("scaleModeChanged", this.updatePageDimensions.bind(this)).on("printStarted", this.onPrintStarted.bind(this)).on("printDocumentReady", this.onPrintDocumentReady.bind(this)).on("exportStarted", this.onExportStarted.bind(this)).on("exportDocumentReady", this.onExportDocumentReady.bind(this)).onAsync("beforeLoadReport", this.onBeforeLoadReport.bind(this)).on("beginLoadReport", this.onBeginLoadReport.bind(this)).on("reportLoadProgress", this.onReportLoadProgress.bind(this)).onAsync("reportLoadComplete", this.onReportLoadComplete.bind(this)).onAsync("reportAutoRunOff", this.onReportAutoRunOff.bind(this)).on("renderingStopped", this.onRenderingStopped.bind(this)).on("missingOrInvalidParameters", this.onMissingOrInvalidParameters.bind(this)).on("noReport", this.onNoReport.bind(this)).on("error", this.onError.bind(this)), this.messages = i2, this.enableAccessibility = n2.enableAccessibility || false, this.initialPageAreaImageUrl = n2.initialPageAreaImageUrl || "";
|
1176
2540
|
}
|
1177
2541
|
destroy() {
|
1178
2542
|
this.resizeService && this.resizeService.destroy();
|
@@ -1199,10 +2563,10 @@ var telerikReportViewer = (function (exports) {
|
|
1199
2563
|
this.documentReady = true, this.invalidateCurrentlyLoadedPage();
|
1200
2564
|
}
|
1201
2565
|
onReportLoadProgress(e2) {
|
1202
|
-
this.navigateWhenPageAvailable(this.navigateToPageOnDocReady, e2.pageCount), this.showNotification(
|
2566
|
+
this.navigateWhenPageAvailable(this.navigateToPageOnDocReady, e2.pageCount), this.showNotification(Ve(this.messages.ReportViewer_LoadingReportPagesInProgress, [e2.pageCount]));
|
1203
2567
|
}
|
1204
2568
|
onReportLoadComplete(t2) {
|
1205
|
-
0 === t2.pageCount ? (this.clearPage(), this.showNotification(this.messages.ReportViewer_NoPageToDisplay)) : (this.navigateOnLoadComplete(this.navigateToPageOnDocReady, t2.pageCount), this.showNotification(
|
2569
|
+
0 === t2.pageCount ? (this.clearPage(), this.showNotification(this.messages.ReportViewer_NoPageToDisplay)) : (this.navigateOnLoadComplete(this.navigateToPageOnDocReady, t2.pageCount), this.showNotification(Ve(this.messages.ReportViewer_LoadedReportPagesComplete, [t2.pageCount])), this.showNotificationTimeoutId = window.setTimeout(this.hideNotification.bind(this), 2e3), this.disableParametersArea(false), this.enableInteractivity()), t2.containsFrozenContent && null === this.uiFreezeCoordinator && (this.uiFreezeCoordinator = new ke(), this.controller.getViewMode() === e.ViewMode.Interactive && this.uiFreezeCoordinator.init(this.placeholder));
|
1206
2570
|
}
|
1207
2571
|
onReportAutoRunOff() {
|
1208
2572
|
this.disableParametersArea(false), this.showNotification(this.messages.ReportViewer_AutoRunDisabled || "Please validate the report parameter values and press Preview to generate the report.");
|
@@ -1296,14 +2660,14 @@ var telerikReportViewer = (function (exports) {
|
|
1296
2660
|
}
|
1297
2661
|
let e3 = 0, i3 = 0;
|
1298
2662
|
for (; n2 && n2 !== this.pageContainer; ) {
|
1299
|
-
if (
|
2663
|
+
if (W(n2, "trv-page-wrapper")) {
|
1300
2664
|
let t3 = n2.dataset.pageScale;
|
1301
2665
|
if ("string" == typeof t3) {
|
1302
2666
|
let n3 = parseFloat(t3);
|
1303
2667
|
e3 *= n3, i3 *= n3;
|
1304
2668
|
}
|
1305
2669
|
}
|
1306
|
-
e3 += n2.offsetTop, i3 += n2.offsetLeft, n2 =
|
2670
|
+
e3 += n2.offsetTop, i3 += n2.offsetLeft, n2 = j(n2);
|
1307
2671
|
}
|
1308
2672
|
this.scrollManager.getEnabled() && t2 ? this.scrollManager.navigateToElement(e3, t2) : (this.pageContainer.scrollTop = e3, this.pageContainer.scrollLeft = i3);
|
1309
2673
|
} else
|
@@ -1317,7 +2681,7 @@ var telerikReportViewer = (function (exports) {
|
|
1317
2681
|
return !isNaN(t2) && t2 > -1 ? e2 : this.findNextFocusableElement(e2.nextElementSibling);
|
1318
2682
|
}
|
1319
2683
|
disablePagesArea(e2) {
|
1320
|
-
e2 ?
|
2684
|
+
e2 ? B(this.placeholder, "trv-loading") : q(this.placeholder, "trv-loading");
|
1321
2685
|
}
|
1322
2686
|
disableParametersArea(e2) {
|
1323
2687
|
var t2, i2;
|
@@ -1329,11 +2693,11 @@ var telerikReportViewer = (function (exports) {
|
|
1329
2693
|
showNotification(e2 = "", t2 = "info") {
|
1330
2694
|
this.notification.dataset.type = t2 || "info";
|
1331
2695
|
let i2 = this.notification.querySelector(".k-notification-content, .trv-error-message"), n2 = null == e2 ? void 0 : e2.split(/\r?\n/);
|
1332
|
-
i2.innerHTML = n2 && n2.length ? `${n2.join("<br>")}` : "Notification message not found.",
|
2696
|
+
i2.innerHTML = n2 && n2.length ? `${n2.join("<br>")}` : "Notification message not found.", B(this.notification, `k-notification-${t2}`), q(this.notification, "k-hidden");
|
1333
2697
|
}
|
1334
2698
|
hideNotification() {
|
1335
2699
|
let e2 = String(this.notification.dataset.type);
|
1336
|
-
delete this.notification.dataset.type,
|
2700
|
+
delete this.notification.dataset.type, q(this.notification, `k-notification-${e2}`), B(this.notification, "k-hidden");
|
1337
2701
|
}
|
1338
2702
|
pageNo(e2) {
|
1339
2703
|
var t2;
|
@@ -1352,10 +2716,13 @@ var telerikReportViewer = (function (exports) {
|
|
1352
2716
|
let o2 = s2.querySelector("div.sheet"), a2 = s2.querySelector("div.trv-skeleton-wrapper");
|
1353
2717
|
if (o2 = o2 || a2, !o2)
|
1354
2718
|
return;
|
1355
|
-
let l2 = 0, h2 = 0, c2 = getComputedStyle(s2), d2 = getComputedStyle(t2), u2 =
|
1356
|
-
l2 = o2.offsetWidth, h2 = o2.offsetHeight
|
2719
|
+
let l2 = 0, h2 = 0, c2 = getComputedStyle(s2), d2 = getComputedStyle(t2), u2 = G(d2.marginLeft) + G(c2.borderLeftWidth) + G(c2.paddingLeft), p2 = G(d2.marginRight) + G(c2.borderRightWidth) + G(c2.paddingRight), g2 = G(d2.marginTop) + G(c2.borderTopWidth) + G(c2.paddingTop), m2 = G(d2.marginBottom) + G(c2.borderBottomWidth) + G(c2.paddingBottom);
|
2720
|
+
if (l2 = o2.offsetWidth, h2 = o2.offsetHeight, 0 === l2) {
|
2721
|
+
const e2 = getComputedStyle(o2);
|
2722
|
+
l2 = parseInt(e2.width), h2 = parseInt(e2.height);
|
2723
|
+
}
|
1357
2724
|
let f2 = h2 > l2 && n2 === e.ScaleMode.FitPageWidth ? 20 : 0, v2 = (this.pageContainer.clientWidth - f2 - u2 - p2) / l2, P2 = (this.pageContainer.clientHeight - 1 - g2 - m2) / h2;
|
1358
|
-
n2 === e.ScaleMode.FitPageWidth ? r2 = v2 : r2 && n2 !== e.ScaleMode.FitPage || (r2 = Math.min(v2, P2)), null !== this.uiFreezeCoordinator && this.uiFreezeCoordinator.setScaleFactor(r2), t2.dataset.pageScale = r2.toString(), s2.dataset.pageScale = r2.toString(), a2 ||
|
2725
|
+
n2 === e.ScaleMode.FitPageWidth ? r2 = v2 : r2 && n2 !== e.ScaleMode.FitPage || (r2 = Math.min(v2, P2)), null !== this.uiFreezeCoordinator && this.uiFreezeCoordinator.setScaleFactor(r2), t2.dataset.pageScale = r2.toString(), s2.dataset.pageScale = r2.toString(), a2 || J(o2, r2, r2), s2.style.height = r2 * h2 + "px", s2.style.width = r2 * l2 + "px";
|
1359
2726
|
}
|
1360
2727
|
enableInteractivity() {
|
1361
2728
|
this.onClickHandler = this.onClick.bind(this), this.onMouseEnterHandler = this.onMouseEnter.bind(this), this.onMouseLeaveHandler = this.onMouseLeave.bind(this), this.pageContainer.addEventListener("click", this.onClickHandler), this.pageContainer.addEventListener("mouseenter", this.onMouseEnterHandler, true), this.pageContainer.addEventListener("mouseleave", this.onMouseLeaveHandler, true);
|
@@ -1377,25 +2744,25 @@ var telerikReportViewer = (function (exports) {
|
|
1377
2744
|
}
|
1378
2745
|
onInteractiveItemClick(e2, t2) {
|
1379
2746
|
var i2;
|
1380
|
-
let n2 = (null === (i2 = e2.dataset.reportingAction) || void 0 === i2 ? void 0 : i2.toString()) || "",
|
1381
|
-
|
2747
|
+
let n2 = (null === (i2 = e2.dataset.reportingAction) || void 0 === i2 ? void 0 : i2.toString()) || "", r2 = this.getAction(n2);
|
2748
|
+
r2 && (this.navigateToPageOnDocReady = this.getNavigateToPageOnDocReady(t2, r2.Type), this.controller.executeReportAction(new a(e2, r2))), t2.stopPropagation();
|
1382
2749
|
}
|
1383
2750
|
onInteractiveItemEnter(e2) {
|
1384
2751
|
var t2;
|
1385
2752
|
let i2 = (null === (t2 = e2.dataset.reportingAction) || void 0 === t2 ? void 0 : t2.toString()) || "", n2 = this.getAction(i2);
|
1386
|
-
n2 && this.controller.reportActionEnter(new
|
2753
|
+
n2 && this.controller.reportActionEnter(new a(e2, n2));
|
1387
2754
|
}
|
1388
2755
|
onInteractiveItemLeave(e2) {
|
1389
2756
|
var t2;
|
1390
2757
|
let i2 = (null === (t2 = e2.dataset.reportingAction) || void 0 === t2 ? void 0 : t2.toString()) || "", n2 = this.getAction(i2);
|
1391
|
-
n2 && this.controller.reportActionLeave(new
|
2758
|
+
n2 && this.controller.reportActionLeave(new a(e2, n2));
|
1392
2759
|
}
|
1393
2760
|
onToolTipItemEnter(e2, t2) {
|
1394
2761
|
let i2 = e2.dataset.tooltipTitle, n2 = e2.dataset.tooltipText;
|
1395
|
-
(i2 || n2) && this.controller.reportTooltipOpening(new
|
2762
|
+
(i2 || n2) && this.controller.reportTooltipOpening(new Le(e2, n2 || "", i2 || "", t2));
|
1396
2763
|
}
|
1397
2764
|
onToolTipItemLeave(e2) {
|
1398
|
-
this.controller.reportTooltipClosing(new
|
2765
|
+
this.controller.reportTooltipClosing(new Le(e2, "", "", null));
|
1399
2766
|
}
|
1400
2767
|
getNavigateToPageOnDocReady(e2, t2) {
|
1401
2768
|
var i2;
|
@@ -1413,7 +2780,7 @@ var telerikReportViewer = (function (exports) {
|
|
1413
2780
|
var t2;
|
1414
2781
|
let i2 = "trv-" + this.controller.getClientId() + "-styles";
|
1415
2782
|
null === (t2 = document.getElementById(i2)) || void 0 === t2 || t2.remove();
|
1416
|
-
let n2 =
|
2783
|
+
let n2 = H("style", i2);
|
1417
2784
|
n2.innerHTML = e2.pageStyles, document.head.appendChild(n2);
|
1418
2785
|
}
|
1419
2786
|
setPageContent(e2) {
|
@@ -1425,26 +2792,26 @@ var telerikReportViewer = (function (exports) {
|
|
1425
2792
|
this.actions && this.actions.length ? this.actions = this.actions.concat(t2.pageActions) : this.actions = t2.pageActions, this.applyPlaceholderViewModeClass(), this.setPageDimensions(e2, t2.pageNumber);
|
1426
2793
|
}
|
1427
2794
|
renderPageElement(e2) {
|
1428
|
-
let t2 =
|
2795
|
+
let t2 = H("div");
|
1429
2796
|
t2.innerHTML = e2.pageContent;
|
1430
2797
|
let i2 = t2.querySelector("div.sheet");
|
1431
2798
|
i2.style.margin = "0";
|
1432
|
-
let n2 =
|
1433
|
-
return n2.dataset.page = e2.pageNumber.toString(), n2.append(i2), n2.append(
|
2799
|
+
let n2 = H("div", "", "trv-report-page");
|
2800
|
+
return n2.dataset.page = e2.pageNumber.toString(), n2.append(i2), n2.append(H("div", "", "k-overlay trv-overlay trv-page-overlay")), n2;
|
1434
2801
|
}
|
1435
2802
|
applyPlaceholderViewModeClass() {
|
1436
|
-
this.controller.getViewMode() === e.ViewMode.Interactive ? (
|
2803
|
+
this.controller.getViewMode() === e.ViewMode.Interactive ? (q(this.placeholder, "printpreview"), B(this.placeholder, "interactive")) : (q(this.placeholder, "interactive"), B(this.placeholder, "printpreview"));
|
1437
2804
|
}
|
1438
2805
|
setPageAreaImage() {
|
1439
2806
|
this.clearPageAreaImage();
|
1440
|
-
let e2 =
|
1441
|
-
e2.innerHTML =
|
2807
|
+
let e2 = H("style", Oe);
|
2808
|
+
e2.innerHTML = Ve('.trv-page-container {background: #ffffff url("{0}") no-repeat center 50px}', [this.initialPageAreaImageUrl]), document.head.appendChild(e2), this.showPageAreaImage = true;
|
1442
2809
|
}
|
1443
2810
|
clearPageAreaImage() {
|
1444
2811
|
var e2;
|
1445
|
-
null === (e2 = document.getElementById(
|
2812
|
+
null === (e2 = document.getElementById(Oe)) || void 0 === e2 || e2.remove();
|
1446
2813
|
}
|
1447
|
-
}, e.DeviceInfo =
|
2814
|
+
}, e.DeviceInfo = s, e.DocumentInfo = class {
|
1448
2815
|
constructor() {
|
1449
2816
|
this.documentReady = false, this.documentMapAvailable = false, this.containsFrozenContent = false, this.pageCount = 0, this.documentMapNodes = [], this.bookmarkNodes = [], this.renderingExtensions = [], this.autoRunEnabled = true;
|
1450
2817
|
}
|
@@ -1452,19 +2819,19 @@ var telerikReportViewer = (function (exports) {
|
|
1452
2819
|
constructor() {
|
1453
2820
|
this.id = "", this.isExpanded = false, this.label = "", this.text = "", this.page = 0, this.items = [];
|
1454
2821
|
}
|
1455
|
-
}, e.EmailInfo =
|
2822
|
+
}, e.EmailInfo = o, e.ExportDocumentReadyEventArgs = c, e.ExportStartEventArgs = h, e.KeepClientAliveSentinel = O, e.PageAction = class {
|
1456
2823
|
constructor() {
|
1457
2824
|
this.Id = "", this.ReportItemName = "", this.Type = "", this.Value = {};
|
1458
2825
|
}
|
1459
|
-
}, e.PageActionEventArgs =
|
2826
|
+
}, e.PageActionEventArgs = a, e.PageInfo = class {
|
1460
2827
|
constructor() {
|
1461
2828
|
this.pageNumber = 0, this.pageReady = false, this.pageStyles = "", this.pageContent = "", this.pageActions = [];
|
1462
2829
|
}
|
1463
|
-
}, e.PageTargetElement =
|
2830
|
+
}, e.PageTargetElement = l, e.ParameterInfo = class {
|
1464
2831
|
constructor() {
|
1465
2832
|
this.name = "", this.type = "", this.text = "", this.multivalue = false, this.allowNull = false, this.allowBlank = false, this.isVisible = false, this.autoRefresh = false, this.hasChildParameters = false, this.childParameters = [], this.availableValues = [], this.value = "", this.id = "", this.label = "";
|
1466
2833
|
}
|
1467
|
-
}, e.ParameterValidators =
|
2834
|
+
}, e.ParameterValidators = Ee, e.ParameterValue = class {
|
1468
2835
|
constructor() {
|
1469
2836
|
this.name = "", this.value = null;
|
1470
2837
|
}
|
@@ -1472,9 +2839,9 @@ var telerikReportViewer = (function (exports) {
|
|
1472
2839
|
constructor() {
|
1473
2840
|
this.name = "", this.localizedName = "";
|
1474
2841
|
}
|
1475
|
-
}, e.ReportController = class extends
|
2842
|
+
}, e.ReportController = class extends A {
|
1476
2843
|
constructor(e2, t2) {
|
1477
|
-
super(), this.configurationInfo = null, this.keepClientAliveSentinel = null, this.registerClientPromise = null, this.registerInstancePromise = null, this.documentFormatsPromise = null, this.clientId = "", this.reportInstanceId = "", this.documentId = "", this.threadId = "", this.parameterValues = {}, this.bookmarkNodes = [], this.renderingExtensions = null, this.pageCount = 0, this.currentPageNumber = 0, this.clientHasExpired = false, this.cancelLoad = false, this.searchInitiated = false, this.aiPromptInitiated = false, this.contentTabIndex = 0, this.respectAutoRun = true, this.processedParameterValues = {}, this.options = t2, t2.reportSource && this.setParameters(t2.reportSource.parameters), this.printManager = new
|
2844
|
+
super(), this.configurationInfo = null, this.keepClientAliveSentinel = null, this.registerClientPromise = null, this.registerInstancePromise = null, this.documentFormatsPromise = null, this.clientId = "", this.reportInstanceId = "", this.documentId = "", this.threadId = "", this.parameterValues = {}, this.bookmarkNodes = [], this.renderingExtensions = null, this.pageCount = 0, this.currentPageNumber = 0, this.clientHasExpired = false, this.cancelLoad = false, this.searchInitiated = false, this.aiPromptInitiated = false, this.contentTabIndex = 0, this.respectAutoRun = true, this.processedParameterValues = {}, this.options = t2, t2.reportSource && this.setParameters(t2.reportSource.parameters), this.printManager = new k(), this.serviceClient = e2, t2.authenticationToken && this.serviceClient.setAccessToken(t2.authenticationToken);
|
1478
2845
|
}
|
1479
2846
|
get autoRunEnabled() {
|
1480
2847
|
var e2 = !this.parameterValues || !("trv_AutoRun" in this.parameterValues) || this.parameterValues.trv_AutoRun;
|
@@ -1517,7 +2884,7 @@ var telerikReportViewer = (function (exports) {
|
|
1517
2884
|
let n2 = {}, r2 = [], s2 = false;
|
1518
2885
|
for (let t3 of e2)
|
1519
2886
|
try {
|
1520
|
-
let e3 =
|
2887
|
+
let e3 = Ee.validate(t3, t3.value);
|
1521
2888
|
n2[t3.id] = e3;
|
1522
2889
|
} catch (e3) {
|
1523
2890
|
s2 = true, r2.push(t3);
|
@@ -1527,7 +2894,7 @@ var telerikReportViewer = (function (exports) {
|
|
1527
2894
|
hasInvalidParameter(e2) {
|
1528
2895
|
for (const t2 of e2)
|
1529
2896
|
try {
|
1530
|
-
|
2897
|
+
Ee.validate(t2, t2.value);
|
1531
2898
|
} catch (e3) {
|
1532
2899
|
return true;
|
1533
2900
|
}
|
@@ -1559,7 +2926,7 @@ var telerikReportViewer = (function (exports) {
|
|
1559
2926
|
}
|
1560
2927
|
getReportSource() {
|
1561
2928
|
var e2;
|
1562
|
-
return new
|
2929
|
+
return new Me(null === (e2 = this.options.reportSource) || void 0 === e2 ? void 0 : e2.report, this.parameterValues);
|
1563
2930
|
}
|
1564
2931
|
setReportSource(e2) {
|
1565
2932
|
this.options.reportSource = e2, this.setParameters(this.options.reportSource.parameters), this.emit("reportSourceChanged", e2);
|
@@ -1621,7 +2988,7 @@ var telerikReportViewer = (function (exports) {
|
|
1621
2988
|
let e3 = t2.Value, i2 = this.fixDataContractJsonSerializer(e3.ParameterValues);
|
1622
2989
|
this.respectAutoRun = true, this.emit("navigateToReport", { Report: e3.Report, Parameters: i2 });
|
1623
2990
|
} else if ("navigateToBookmark" === t2.Type) {
|
1624
|
-
let e3 = this.getPageForBookmark(this.bookmarkNodes, t2.Value), i2 = new
|
2991
|
+
let e3 = this.getPageForBookmark(this.bookmarkNodes, t2.Value), i2 = new l(t2.Value, "bookmark");
|
1625
2992
|
this.navigateToPage(e3, i2);
|
1626
2993
|
} else if ("sorting" === t2.Type)
|
1627
2994
|
this.execServerAction(t2.Id);
|
@@ -1647,40 +3014,40 @@ var telerikReportViewer = (function (exports) {
|
|
1647
3014
|
this.emit("toolTipClosing", e2);
|
1648
3015
|
}
|
1649
3016
|
printReport() {
|
1650
|
-
return
|
3017
|
+
return r(this, void 0, void 0, function* () {
|
1651
3018
|
let e2 = this.createDeviceInfo();
|
1652
3019
|
e2.ImmediatePrint = true;
|
1653
|
-
let t2 = new
|
3020
|
+
let t2 = new fe(e2);
|
1654
3021
|
this.emit("printStarted", t2), t2.handled || (this.setUIState("PrintInProgress", true), this.exportAsync("PDF", e2).then((e3) => {
|
1655
3022
|
let t3 = this.serviceClient.getDocumentUrl(this.clientId, this.reportInstanceId, e3);
|
1656
3023
|
t3 += `?${"response-content-disposition=" + (this.getCanUsePlugin() ? "inline" : "attachment")}`;
|
1657
|
-
let i2 = new
|
3024
|
+
let i2 = new ve(t3);
|
1658
3025
|
this.emit("printDocumentReady", i2), this.setUIState("PrintInProgress", false), i2.handled || this.printManager.print(t3);
|
1659
3026
|
}));
|
1660
3027
|
});
|
1661
3028
|
}
|
1662
3029
|
exportReport(e2) {
|
1663
|
-
return
|
1664
|
-
let
|
1665
|
-
if (yield this.emitAsync("exportStart",
|
1666
|
-
let
|
1667
|
-
if (this.emit("exportStarted",
|
3030
|
+
return r(this, void 0, void 0, function* () {
|
3031
|
+
let t2 = this.createDeviceInfo(), i2 = new h(t2, e2);
|
3032
|
+
if (yield this.emitAsync("exportStart", i2), !i2.isCancelled) {
|
3033
|
+
let n2 = new Pe(t2, e2);
|
3034
|
+
if (this.emit("exportStarted", n2), n2.handled)
|
1668
3035
|
return;
|
1669
|
-
this.setUIState("ExportInProgress", true), this.exportAsync(e2,
|
1670
|
-
let
|
1671
|
-
|
1672
|
-
let n3 = new
|
1673
|
-
yield this.emitAsync("exportEnd", n3), this.emit("exportDocumentReady", n3), this.setUIState("ExportInProgress", false), n3.handled || window.open(
|
3036
|
+
this.setUIState("ExportInProgress", true), this.exportAsync(e2, i2.deviceInfo).then((t3) => r(this, void 0, void 0, function* () {
|
3037
|
+
let i3 = this.serviceClient.getDocumentUrl(this.clientId, this.reportInstanceId, t3);
|
3038
|
+
i3 += "?response-content-disposition=attachment";
|
3039
|
+
let n3 = new c(i3, e2, "_self");
|
3040
|
+
yield this.emitAsync("exportEnd", n3), this.emit("exportDocumentReady", n3), this.setUIState("ExportInProgress", false), n3.handled || window.open(i3, n3.windowOpenTarget);
|
1674
3041
|
}));
|
1675
3042
|
}
|
1676
3043
|
});
|
1677
3044
|
}
|
1678
3045
|
sendReport(e2) {
|
1679
|
-
let t2 = this.createDeviceInfo(), i2 = new
|
3046
|
+
let t2 = this.createDeviceInfo(), i2 = new ye(t2, e2.format);
|
1680
3047
|
this.emit("sendEmailStarted", i2), i2.handled || this.exportAsync(e2.format, t2).then((i3) => {
|
1681
3048
|
let n2 = this.serviceClient.getDocumentUrl(this.clientId, this.reportInstanceId, i3);
|
1682
3049
|
n2 += "?response-content-disposition=attachment";
|
1683
|
-
let r2 = new
|
3050
|
+
let r2 = new Ie(e2, t2, n2);
|
1684
3051
|
this.emit("sendEmailDocumentReady", r2), r2.handled || this.sendDocumentAsync(i3, e2);
|
1685
3052
|
});
|
1686
3053
|
}
|
@@ -1688,19 +3055,24 @@ var telerikReportViewer = (function (exports) {
|
|
1688
3055
|
return this.serviceClient.getSearchResults(this.clientId, this.reportInstanceId, this.documentId, e2).catch(this.handleSearchRequestError.bind(this)).then((e3) => e3 || []);
|
1689
3056
|
}
|
1690
3057
|
createAIThread() {
|
1691
|
-
return this.serviceClient.createAIThread(this.clientId, this.reportInstanceId, this.getReport(), this.parameterValues).catch((e2) => this.raiseError(e2.
|
3058
|
+
return this.serviceClient.createAIThread(this.clientId, this.reportInstanceId, this.getReport(), this.parameterValues).catch((e2) => this.raiseError(e2.exceptionMessage, false)).then((e2) => {
|
3059
|
+
if (this.threadId = (null == e2 ? void 0 : e2.threadId) || "", e2.consentMessage && (e2.consentMessage = n.default.sanitize(e2.consentMessage, { USE_PROFILES: { html: true } }), n.default.removed && n.default.removed.length > 0 && console.warn("The AI-Powered Insights consent message was sanitized as it contained potentially malicious HTML elements or attributes.")), e2.predefinedPrompts)
|
3060
|
+
for (let t2 = 0; t2 < e2.predefinedPrompts.length; t2++)
|
3061
|
+
e2.predefinedPrompts[t2] = n.default.sanitize(e2.predefinedPrompts[t2], { USE_PROFILES: { html: true } }), n.default.removed && n.default.removed.length > 0 && console.warn("An AI-Powered Insights predefined prompt was sanitized as it contained potentially malicious HTML elements or attributes.");
|
3062
|
+
return e2;
|
3063
|
+
});
|
1692
3064
|
}
|
1693
3065
|
getAIResponse(e2) {
|
1694
3066
|
return this.serviceClient.getAIResponse(this.clientId, this.reportInstanceId, this.documentId, this.threadId, e2).then((e3) => e3 || "");
|
1695
3067
|
}
|
1696
|
-
exportAsync(e2,
|
1697
|
-
return this.initializeClient().then(this.registerInstance.bind(this)).then(() => this.registerDocumentAsync(e2,
|
3068
|
+
exportAsync(e2, t2) {
|
3069
|
+
return this.initializeClient().then(this.registerInstance.bind(this)).then(() => this.registerDocumentAsync(e2, t2, false, this.documentId)).then((e3) => r(this, void 0, void 0, function* () {
|
1698
3070
|
return yield this.getDocumentInfo(false, e3).catch((e4) => this.raiseError(e4)), e3;
|
1699
3071
|
}));
|
1700
3072
|
}
|
1701
3073
|
sendDocumentAsync(e2, t2) {
|
1702
3074
|
return this.serviceClient.sendDocument(this.clientId, this.reportInstanceId, e2, t2).catch((e3) => {
|
1703
|
-
this.handleRequestError(e3,
|
3075
|
+
this.handleRequestError(e3, ce(this.options.messages.ReportViewer_ErrorSendingDocument, Z(this.getReport())));
|
1704
3076
|
});
|
1705
3077
|
}
|
1706
3078
|
loadParameters(e2 = void 0) {
|
@@ -1713,7 +3085,7 @@ var telerikReportViewer = (function (exports) {
|
|
1713
3085
|
}
|
1714
3086
|
initializeAndStartSentinel() {
|
1715
3087
|
this.options.keepClientAlive && this.clientId && this.serviceClient.getClientsSessionTimeoutSeconds().then((e2) => {
|
1716
|
-
this.keepClientAliveSentinel = new
|
3088
|
+
this.keepClientAliveSentinel = new O(this.serviceClient, this.clientId, e2), this.keepClientAliveSentinel.start();
|
1717
3089
|
});
|
1718
3090
|
}
|
1719
3091
|
stopSentinel() {
|
@@ -1738,29 +3110,29 @@ var telerikReportViewer = (function (exports) {
|
|
1738
3110
|
this.pageCount = 0, this.currentPageNumber = 0;
|
1739
3111
|
}
|
1740
3112
|
handleSearchRequestError(e2) {
|
1741
|
-
if (!
|
3113
|
+
if (!oe(e2, "System.ArgumentException"))
|
1742
3114
|
throw this.handleRequestError(e2, "", true), null;
|
1743
3115
|
this.throwPromiseError(e2);
|
1744
3116
|
}
|
1745
3117
|
throwPromiseError(e2) {
|
1746
|
-
throw e2.
|
3118
|
+
throw e2.exceptionMessage ? e2.exceptionMessage : this.options.messages.ReportViewer_PromisesChainStopError;
|
1747
3119
|
}
|
1748
3120
|
handleRequestError(e2, t2 = "", i2 = false) {
|
1749
|
-
|
1750
|
-
let n2 =
|
3121
|
+
ae(e2) && this.onClientExpired();
|
3122
|
+
let n2 = he(e2.error) ? "" : e2.error, r2 = this.formatRequestError(e2, n2, t2);
|
1751
3123
|
this.raiseError(r2), i2 || this.throwPromiseError(e2);
|
1752
3124
|
}
|
1753
3125
|
formatRequestError(e2, t2, i2) {
|
1754
3126
|
let n2 = e2.responseJSON, r2 = "";
|
1755
3127
|
if (n2) {
|
1756
|
-
if (
|
3128
|
+
if (le(e2))
|
1757
3129
|
return this.options.messages.ReportViewer_MissingOrInvalidParameter;
|
1758
|
-
r2 =
|
1759
|
-
let t3 =
|
3130
|
+
r2 = Z(n2.message);
|
3131
|
+
let t3 = Z(n2.exceptionMessage || n2.ExceptionMessage || n2.error_description);
|
1760
3132
|
t3 && (r2 ? r2 += " " + t3 : r2 = t3);
|
1761
3133
|
} else
|
1762
|
-
r2 =
|
1763
|
-
return (i2 || t2) && (r2 && (r2 = " " + r2), r2 =
|
3134
|
+
r2 = Z(e2.responseText);
|
3135
|
+
return (i2 || t2) && (r2 && (r2 = " " + r2), r2 = Z(i2 || t2) + r2), ae(e2) && (r2 += "<br />" + this.options.messages.ReportViewer_ClientExpired), r2;
|
1764
3136
|
}
|
1765
3137
|
raiseError(e2, t2 = true) {
|
1766
3138
|
this.emit("error", e2, t2);
|
@@ -1770,17 +3142,17 @@ var telerikReportViewer = (function (exports) {
|
|
1770
3142
|
}
|
1771
3143
|
initializeClient() {
|
1772
3144
|
return this.registerClientPromise || (this.registerClientPromise = this.serviceClient.registerClient().catch((e2) => {
|
1773
|
-
const t2 =
|
3145
|
+
const t2 = ce(this.options.messages.ReportViewer_ErrorServiceUrl, [this.serviceClient.getServiceUrl()]);
|
1774
3146
|
this.handleRequestError(e2, t2);
|
1775
3147
|
}).then(this.setClientId.bind(this)).catch(this.clearClientId.bind(this))), this.registerClientPromise;
|
1776
3148
|
}
|
1777
3149
|
registerInstance() {
|
1778
3150
|
return this.registerInstancePromise || (this.registerInstancePromise = this.serviceClient.createReportInstance(this.clientId, this.getReport(), this.parameterValues).then(this.setReportInstanceId.bind(this)).catch(this.clearReportInstanceId.bind(this))), this.registerInstancePromise;
|
1779
3151
|
}
|
1780
|
-
registerDocumentAsync(e2, i2, n2
|
1781
|
-
return
|
1782
|
-
return (yield this.serviceClient.createReportDocument(this.clientId, this.reportInstanceId, e2,
|
1783
|
-
this.handleRequestError(
|
3152
|
+
registerDocumentAsync(e2, t2, i2, n2 = "", s2 = "") {
|
3153
|
+
return r(this, void 0, void 0, function* () {
|
3154
|
+
return (yield this.serviceClient.createReportDocument(this.clientId, this.reportInstanceId, e2, t2, !i2, n2, s2).catch((t3) => {
|
3155
|
+
this.handleRequestError(t3, ce(this.options.messages.ReportViewer_ErrorCreatingReportDocument, Z(this.getReport()), Z(e2)));
|
1784
3156
|
})) || "";
|
1785
3157
|
});
|
1786
3158
|
}
|
@@ -1802,10 +3174,10 @@ var telerikReportViewer = (function (exports) {
|
|
1802
3174
|
return e2.ContentOnly = true, e2.UseSVG = true, e2;
|
1803
3175
|
}
|
1804
3176
|
createDeviceInfo() {
|
1805
|
-
let e2 = new
|
3177
|
+
let e2 = new s();
|
1806
3178
|
this.options.enableAccessibility && (e2.enableAccessibility = true, e2.contentTabIndex = this.getContentTabIndex());
|
1807
|
-
let t2 = this.getSearchInitiated(),
|
1808
|
-
return e2.enableSearch = !
|
3179
|
+
let t2 = this.getSearchInitiated(), i2 = this.options.searchMetadataOnDemand;
|
3180
|
+
return e2.enableSearch = !i2 || t2, e2;
|
1809
3181
|
}
|
1810
3182
|
getParameters(e2) {
|
1811
3183
|
return this.serviceClient.getParameters(this.clientId, this.getReport(), e2 || this.parameterValues).catch((e3) => {
|
@@ -1816,7 +3188,7 @@ var telerikReportViewer = (function (exports) {
|
|
1816
3188
|
const e2 = {}, t2 = this.getProcessedParameterValues();
|
1817
3189
|
for (let i2 in t2) {
|
1818
3190
|
const n2 = t2[i2], r2 = this.parameterValues[i2];
|
1819
|
-
n2 && n2.availableValues ? n2.multivalue ? e2[i2] =
|
3191
|
+
n2 && n2.availableValues ? n2.multivalue ? e2[i2] = Ae(n2, r2, i2) : e2[i2] = Te(n2, r2, i2) : e2[i2] = r2;
|
1820
3192
|
}
|
1821
3193
|
return e2;
|
1822
3194
|
}
|
@@ -1826,13 +3198,13 @@ var telerikReportViewer = (function (exports) {
|
|
1826
3198
|
getProcessedParameterValues() {
|
1827
3199
|
return this.processedParameterValues;
|
1828
3200
|
}
|
1829
|
-
getDocumentInfo(
|
1830
|
-
return
|
1831
|
-
let o2 = () =>
|
1832
|
-
this.cancelLoad ? s2(this.options.messages.ReportViewer_RenderingCancelled) : (yield this.registerInstancePromise, this.serviceClient.getDocumentInfo(this.clientId, this.reportInstanceId,
|
1833
|
-
|
3201
|
+
getDocumentInfo(t2, i2) {
|
3202
|
+
return t2 && this.emit("beginLoadReport"), new Promise((n2, s2) => {
|
3203
|
+
let o2 = () => r(this, void 0, void 0, function* () {
|
3204
|
+
this.cancelLoad ? s2(this.options.messages.ReportViewer_RenderingCancelled) : (yield this.registerInstancePromise, this.serviceClient.getDocumentInfo(this.clientId, this.reportInstanceId, i2).then((i3) => {
|
3205
|
+
i3 && i3.documentReady ? n2(i3) : (t2 && (this.getPageMode() === e.PageMode.ContinuousScroll && i3.pageCount > this.pageCount && this.emit("pageLoaded"), this.pageCount = i3.pageCount, this.emit("reportLoadProgress", i3)), window.setTimeout(o2, 500));
|
1834
3206
|
}).catch((e2) => {
|
1835
|
-
"InvalidDocumentException" !== e2.responseJSON.exceptionType ? this.handleRequestError(e2, "", true) : console.warn("getDocumentInfo failed or was canceled by the user: " + e2.
|
3207
|
+
"InvalidDocumentException" !== e2.responseJSON.exceptionType ? this.handleRequestError(e2, "", true) : console.warn("getDocumentInfo failed or was canceled by the user: " + e2.exceptionMessage);
|
1836
3208
|
}));
|
1837
3209
|
});
|
1838
3210
|
o2();
|
@@ -1921,8 +3293,9 @@ ${e3.text} (${e3.id})`;
|
|
1921
3293
|
setConfigurationInfo(e2) {
|
1922
3294
|
this.configurationInfo = e2;
|
1923
3295
|
}
|
1924
|
-
|
1925
|
-
|
3296
|
+
isAiInsightsEnabled() {
|
3297
|
+
var e2, t2;
|
3298
|
+
return null !== (t2 = null === (e2 = this.configurationInfo.options.find((e3) => "ai-insights" === e3.name)) || void 0 === e2 ? void 0 : e2.isAvailable) && void 0 !== t2 && t2;
|
1926
3299
|
}
|
1927
3300
|
shouldShowLicenseBanner() {
|
1928
3301
|
var e2;
|
@@ -1953,13 +3326,13 @@ ${e3.text} (${e3.id})`;
|
|
1953
3326
|
constructor(e2, t2, i2) {
|
1954
3327
|
this.url = e2, this.username = t2, this.password = i2;
|
1955
3328
|
}
|
1956
|
-
}, e.ReportSourceOptions =
|
3329
|
+
}, e.ReportSourceOptions = Me, e.RequestError = d, e.SearchInfo = class {
|
1957
3330
|
constructor() {
|
1958
3331
|
this.searchToken = "", this.matchCase = false, this.matchWholeWord = false, this.useRegularExpressions = false;
|
1959
3332
|
}
|
1960
|
-
}, e.SearchManager = class extends
|
3333
|
+
}, e.SearchManager = class extends A {
|
1961
3334
|
constructor(e2, t2) {
|
1962
|
-
super(), this.searchResults = [], this.pendingHighlightItem = null, this.highlightedElements = [], this.currentHighlightedElement = null, this.isActive = false, this.controller = t2, this.pageContainer =
|
3335
|
+
super(), this.searchResults = [], this.pendingHighlightItem = null, this.highlightedElements = [], this.currentHighlightedElement = null, this.isActive = false, this.controller = t2, this.pageContainer = te(e2, ".trv-page-container"), this.controller.on("applySearchColors", this.applySearchColors.bind(this)).on("pageReady", this.applySearchColors.bind(this));
|
1963
3336
|
}
|
1964
3337
|
search(e2) {
|
1965
3338
|
this.isActive = true, this.clearColoredItems(), this.searchResults = [], e2.searchToken && "" !== e2.searchToken ? this.controller.getSearchResults(e2).then(this.onSearchComplete.bind(this)) : this.onSearchComplete([]);
|
@@ -1968,15 +3341,15 @@ ${e3.text} (${e3.id})`;
|
|
1968
3341
|
this.isActive = false, this.clearColoredItems(), this.searchResults = [];
|
1969
3342
|
}
|
1970
3343
|
highlightSearchItem(t2) {
|
1971
|
-
t2 && (this.currentHighlightedElement && (
|
3344
|
+
t2 && (this.currentHighlightedElement && (q(this.currentHighlightedElement, _e), B(this.currentHighlightedElement, ze)), t2.page === this.controller.getCurrentPageNumber() ? this.highlightItem(t2) : this.controller.getPageMode() === e.PageMode.SinglePage ? this.clearColoredItems() : this.highlightItem(t2), this.pendingHighlightItem = t2, this.navigateToPage(t2));
|
1972
3345
|
}
|
1973
3346
|
navigateToPage(e2) {
|
1974
|
-
this.controller.navigateToPage(e2.page, new
|
3347
|
+
this.controller.navigateToPage(e2.page, new l(e2.id, "search"));
|
1975
3348
|
}
|
1976
3349
|
colorPageElements(e2) {
|
1977
3350
|
e2 && 0 !== e2.length && (e2.forEach((e3) => {
|
1978
|
-
let t2 =
|
1979
|
-
t2 && (
|
3351
|
+
let t2 = te(this.pageContainer, "[data-search-id=" + e3.id + "]");
|
3352
|
+
t2 && (B(t2, ze), this.highlightedElements.push(t2));
|
1980
3353
|
}), this.highlightItem(this.pendingHighlightItem));
|
1981
3354
|
}
|
1982
3355
|
highlightItem(e2) {
|
@@ -1984,13 +3357,13 @@ ${e3.text} (${e3.id})`;
|
|
1984
3357
|
let t2 = this.highlightedElements.find(function(t3) {
|
1985
3358
|
return t3.dataset.searchId === e2.id;
|
1986
3359
|
});
|
1987
|
-
t2 && (this.currentHighlightedElement = t2,
|
3360
|
+
t2 && (this.currentHighlightedElement = t2, q(t2, ze), B(t2, _e));
|
1988
3361
|
}
|
1989
3362
|
}
|
1990
3363
|
clearColoredItems() {
|
1991
3364
|
this.highlightedElements && this.highlightedElements.length > 0 && this.highlightedElements.forEach((e2) => {
|
1992
|
-
|
1993
|
-
}), this.currentHighlightedElement &&
|
3365
|
+
q(e2, ze);
|
3366
|
+
}), this.currentHighlightedElement && q(this.currentHighlightedElement, _e), this.highlightedElements = [], this.currentHighlightedElement = null;
|
1994
3367
|
}
|
1995
3368
|
applySearchColors() {
|
1996
3369
|
this.isActive && this.colorPageElements(this.searchResults);
|
@@ -2013,19 +3386,19 @@ ${e3.text} (${e3.id})`;
|
|
2013
3386
|
authenticatedGet(e2) {
|
2014
3387
|
return this.login().then(function(t2) {
|
2015
3388
|
return function(e3, t3) {
|
2016
|
-
return fetch(e3, { headers:
|
3389
|
+
return fetch(e3, { headers: u(t3) }).then(p);
|
2017
3390
|
}(e2, t2);
|
2018
3391
|
});
|
2019
3392
|
}
|
2020
3393
|
authenticatedPost(e2, t2) {
|
2021
3394
|
return this.login().then(function(i2) {
|
2022
|
-
return
|
3395
|
+
return g(e2, t2, i2);
|
2023
3396
|
});
|
2024
3397
|
}
|
2025
3398
|
authenticatedDelete(e2) {
|
2026
3399
|
return this.login().then(function(t2) {
|
2027
3400
|
return function(e3, t3) {
|
2028
|
-
return fetch(e3, { method: "DELETE", headers:
|
3401
|
+
return fetch(e3, { method: "DELETE", headers: u(t3) }).then(p);
|
2029
3402
|
}(e2, t2);
|
2030
3403
|
});
|
2031
3404
|
}
|
@@ -2036,7 +3409,7 @@ ${e3.text} (${e3.id})`;
|
|
2036
3409
|
let e2 = this.options.loginInfo;
|
2037
3410
|
if (e2 && e2.url && (e2.username || e2.password)) {
|
2038
3411
|
let t2 = `grant_type=password&username=${encodeURIComponent((null == e2 ? void 0 : e2.username) || "")}&password=${encodeURIComponent((null == e2 ? void 0 : e2.password) || "")}`;
|
2039
|
-
return
|
3412
|
+
return g(e2.url, t2, "", true).then((e3) => e3.access_token);
|
2040
3413
|
}
|
2041
3414
|
return Promise.resolve("");
|
2042
3415
|
}
|
@@ -2126,15 +3499,15 @@ ${e3.text} (${e3.id})`;
|
|
2126
3499
|
constructor(e2, t2 = null) {
|
2127
3500
|
this.serviceUrl = "", this.serviceUrl = e2.replace(/\/+$/, ""), this.loginInfo = t2;
|
2128
3501
|
}
|
2129
|
-
}, e.addClass =
|
3502
|
+
}, e.addClass = B, e.appendHtml = Y, e.createElement = H, e.debounce = re, e.each = de, e.escapeHtml = Z, e.findElement = te, e.getColorAlphaValue = Q, e.getElementAttributeValue = ie, e.getElementScrollParent = ne, e.getOffsetParent = j, e.hasClass = W, e.isArray = ue, e.isExceptionOfType = oe, e.isInternalServerError = he, e.isInvalidClientException = ae, e.isInvalidParameterException = le, e.isRgbColor = X, e.keepElementInView = function(e2) {
|
2130
3503
|
if (!e2)
|
2131
3504
|
return;
|
2132
|
-
let t2 =
|
3505
|
+
let t2 = ne(e2);
|
2133
3506
|
if (!t2)
|
2134
3507
|
return;
|
2135
3508
|
let i2 = e2.offsetTop, n2 = i2 + e2.offsetHeight, r2 = t2.scrollTop + t2.offsetHeight;
|
2136
3509
|
i2 < t2.scrollTop ? t2.scrollTop = i2 : n2 > r2 && (t2.scrollTop += n2 - r2);
|
2137
|
-
}, e.parseToLocalDate =
|
3510
|
+
}, e.parseToLocalDate = me, e.prependHtml = ee, e.removeClass = q, e.reportSourcesAreEqual = function(e2) {
|
2138
3511
|
const t2 = e2.firstReportSource, i2 = e2.secondReportSource;
|
2139
3512
|
if (t2 && i2 && t2.report === i2.report) {
|
2140
3513
|
let e3 = "";
|
@@ -2143,7 +3516,7 @@ ${e3.text} (${e3.id})`;
|
|
2143
3516
|
return i2.parameters && (n2 = JSON.stringify(i2.parameters)), e3 === n2;
|
2144
3517
|
}
|
2145
3518
|
return false;
|
2146
|
-
}, e.scaleElement =
|
3519
|
+
}, e.scaleElement = J, e.stringFormat = ce, e.throttle = se, e.toPixel = G, e.toRgbColor = K, e.tryParseFloat = ge, e.tryParseInt = pe, Object.defineProperty(e, "__esModule", { value: true });
|
2147
3520
|
});
|
2148
3521
|
})(dist, dist.exports);
|
2149
3522
|
var distExports = dist.exports;
|
@@ -2178,13 +3551,6 @@ ${e3.text} (${e3.id})`;
|
|
2178
3551
|
return false;
|
2179
3552
|
};
|
2180
3553
|
}
|
2181
|
-
function toXhrErrorData(xhr, status, error) {
|
2182
|
-
return {
|
2183
|
-
xhr,
|
2184
|
-
status,
|
2185
|
-
error
|
2186
|
-
};
|
2187
|
-
}
|
2188
3554
|
function rectangle(left, top, width, height) {
|
2189
3555
|
return {
|
2190
3556
|
left,
|
@@ -2337,13 +3703,6 @@ ${e3.text} (${e3.id})`;
|
|
2337
3703
|
}
|
2338
3704
|
return parseJSON(xhr.responseText);
|
2339
3705
|
}
|
2340
|
-
function loadScript(url) {
|
2341
|
-
var ajaxOptions = {
|
2342
|
-
dataType: "script",
|
2343
|
-
cache: true
|
2344
|
-
};
|
2345
|
-
return $ajax(url, ajaxOptions);
|
2346
|
-
}
|
2347
3706
|
function filterUniqueLastOccurrence(array) {
|
2348
3707
|
function onlyLastUnique(value, index, self) {
|
2349
3708
|
return self.lastIndexOf(value) === index;
|
@@ -2393,15 +3752,6 @@ ${e3.text} (${e3.id})`;
|
|
2393
3752
|
var alpha = colorComponents.length === 4 ? parseFloat((parseFloat(colorComponents[3].replace(/[()]/g, "")) / 255).toFixed(2)) : 1;
|
2394
3753
|
return alpha;
|
2395
3754
|
}
|
2396
|
-
function $ajax(url, ajaxSettings) {
|
2397
|
-
return new Promise(function(resolve, reject) {
|
2398
|
-
$.ajax(url, ajaxSettings).done(function(data) {
|
2399
|
-
return resolve(data);
|
2400
|
-
}).fail(function(xhr, status, error) {
|
2401
|
-
reject(toXhrErrorData(xhr, status, error));
|
2402
|
-
});
|
2403
|
-
});
|
2404
|
-
}
|
2405
3755
|
|
2406
3756
|
const utils = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
2407
3757
|
__proto__: null,
|
@@ -2423,13 +3773,11 @@ ${e3.text} (${e3.id})`;
|
|
2423
3773
|
exceptionTypeNamesMatch,
|
2424
3774
|
parseJSON,
|
2425
3775
|
getExceptionInstance,
|
2426
|
-
loadScript,
|
2427
3776
|
filterUniqueLastOccurrence,
|
2428
3777
|
logError,
|
2429
3778
|
toRgbColor,
|
2430
3779
|
isRgbColor,
|
2431
3780
|
getColorAlphaValue,
|
2432
|
-
$ajax,
|
2433
3781
|
tryParseInt: distExports.tryParseInt,
|
2434
3782
|
tryParseFloat: distExports.tryParseFloat,
|
2435
3783
|
parseToLocalDate: distExports.parseToLocalDate,
|
@@ -3281,9 +4629,12 @@ ${e3.text} (${e3.id})`;
|
|
3281
4629
|
sendEmailValidationSingleEmail: "The field accepts a single email address only",
|
3282
4630
|
sendEmailValidationFormatRequired: "Format field is required",
|
3283
4631
|
errorSendingDocument: "Error sending report document (Report = '{0}').",
|
3284
|
-
|
3285
|
-
|
3286
|
-
|
4632
|
+
aiPromptDialogConsentTitle: "Before you start with AI",
|
4633
|
+
aiPromptDialogConsentAccept: "Consent",
|
4634
|
+
aiPromptDialogConsentReject: "Cancel",
|
4635
|
+
aiPromptDialogTextAreaPlaceholder: "Enter your prompt",
|
4636
|
+
aiPromptDialogNoPredefinedAndCustomPromptsPlaceholder: "Custom prompts are disabled and there are no predefined prompts configured. Please allow custom prompts or add predefined prompts to use the AI feature.",
|
4637
|
+
aiPromptDialogNoCustomPromptsPlaceholder: "Custom prompts are disabled, please select one of the predefined suggestions below"
|
3287
4638
|
};
|
3288
4639
|
window.telerikReportViewer ||= {};
|
3289
4640
|
window.telerikReportViewer.sr ||= sr$1;
|
@@ -4762,9 +6113,9 @@ ${e3.text} (${e3.id})`;
|
|
4762
6113
|
}
|
4763
6114
|
showDocumentMap(show) {
|
4764
6115
|
var splitter = $("#" + this.options.viewerSelector + "-document-map-splitter").getKendoSplitter();
|
4765
|
-
var sibling = this.$element.next();
|
6116
|
+
var sibling = this.$element.next(".k-splitbar");
|
4766
6117
|
if (this.options.documentMapAreaPosition === DocumentMapAreaPositions.RIGHT) {
|
4767
|
-
sibling = this.$element.prev();
|
6118
|
+
sibling = this.$element.prev(".k-splitbar");
|
4768
6119
|
}
|
4769
6120
|
if (splitter) {
|
4770
6121
|
(this.documentMapNecessary ? $.fn.removeClass : $.fn.addClass).call(sibling, "k-hidden");
|
@@ -5368,9 +6719,9 @@ ${e3.text} (${e3.id})`;
|
|
5368
6719
|
if (!splitter) {
|
5369
6720
|
return;
|
5370
6721
|
}
|
5371
|
-
var sibling = this.$element.prev();
|
6722
|
+
var sibling = this.$element.prev(".k-splitbar");
|
5372
6723
|
if (this.options.parametersAreaPosition === ParametersAreaPositions.TOP || this.options.parametersAreaPosition === ParametersAreaPositions.LEFT) {
|
5373
|
-
sibling = this.$element.next();
|
6724
|
+
sibling = this.$element.next(".k-splitbar");
|
5374
6725
|
}
|
5375
6726
|
(this.parametersAreaNecessary ? $.fn.removeClass : $.fn.addClass).call(sibling, "k-hidden");
|
5376
6727
|
splitter.toggle(".trv-parameters-area", show);
|
@@ -5387,8 +6738,10 @@ ${e3.text} (${e3.id})`;
|
|
5387
6738
|
_attachEvents() {
|
5388
6739
|
this.controller.on("reloadParameters", (controllerLoadParametersPromise) => {
|
5389
6740
|
this.showError();
|
5390
|
-
|
5391
|
-
|
6741
|
+
if (this._parametersWrapper) {
|
6742
|
+
kendo.destroy(this._parametersWrapper);
|
6743
|
+
this._parametersWrapper.innerHTML = "";
|
6744
|
+
}
|
5392
6745
|
this.acceptParameters(controllerLoadParametersPromise, this.onLoadParametersSuccess.bind(this));
|
5393
6746
|
}).onAsync("beforeLoadReport", async () => {
|
5394
6747
|
this.loadingCount = 0;
|
@@ -6922,7 +8275,7 @@ ${e3.text} (${e3.id})`;
|
|
6922
8275
|
}
|
6923
8276
|
createToolbarItem(elementData) {
|
6924
8277
|
const cmdName = (elementData.dataset?.command || "").replace("telerik_ReportViewer_", "");
|
6925
|
-
if (cmdName === "toggleAiPromptDialog" && !this._options.controller.
|
8278
|
+
if (cmdName === "toggleAiPromptDialog" && !this._options.controller.isAiInsightsEnabled()) {
|
6926
8279
|
return;
|
6927
8280
|
}
|
6928
8281
|
const id = elementData.id;
|
@@ -7096,9 +8449,9 @@ ${e3.text} (${e3.id})`;
|
|
7096
8449
|
this.pagesAreaContainer = this.reportViewerWrapper.find('[data-id="trv-pages-area"]');
|
7097
8450
|
this.aiPromptDialogInitialized = false;
|
7098
8451
|
this.aiPromptInitialized = false;
|
7099
|
-
|
7100
|
-
this.
|
7101
|
-
this.
|
8452
|
+
this.requireConsent = false;
|
8453
|
+
this.allowCustomPrompts = true;
|
8454
|
+
this.predefinedPrompts = [];
|
7102
8455
|
this.init();
|
7103
8456
|
}
|
7104
8457
|
init() {
|
@@ -7106,10 +8459,8 @@ ${e3.text} (${e3.id})`;
|
|
7106
8459
|
return;
|
7107
8460
|
}
|
7108
8461
|
replaceStringResources(this.$element);
|
7109
|
-
|
7110
|
-
|
7111
|
-
this._attachAiConsentDialogCommands();
|
7112
|
-
}
|
8462
|
+
this._initAiConsentDialog();
|
8463
|
+
this._attachAiConsentDialogCommands();
|
7113
8464
|
this._initAiPromptDialog();
|
7114
8465
|
this._attachEvents();
|
7115
8466
|
this.aiPromptDialogInitialized = true;
|
@@ -7142,7 +8493,10 @@ ${e3.text} (${e3.id})`;
|
|
7142
8493
|
this.kendoAiConsentDialog.close();
|
7143
8494
|
this.controller.saveToSessionStorage("trvAiConsent", "true");
|
7144
8495
|
this.controller.setAiPromptInitiated(true);
|
7145
|
-
this.
|
8496
|
+
if (this.kendoAiPromptDialog) {
|
8497
|
+
this._initAiPrompt(this.predefinedPrompts);
|
8498
|
+
this.kendoAiPromptDialog.open();
|
8499
|
+
}
|
7146
8500
|
})
|
7147
8501
|
};
|
7148
8502
|
Binder.attachCommands(this.kendoAiConsentDialog.element.find(".trv-ai-consent-actions"), optionsCommandSet, this.viewerOptions);
|
@@ -7154,7 +8508,7 @@ ${e3.text} (${e3.id})`;
|
|
7154
8508
|
return;
|
7155
8509
|
}
|
7156
8510
|
this.kendoAiConsentDialog = new kendo.ui.Window(aiConsentDialogElement, {
|
7157
|
-
title: "
|
8511
|
+
title: stringResources["aiPromptDialogConsentTitle"] || "",
|
7158
8512
|
width: 500,
|
7159
8513
|
minWidth: 400,
|
7160
8514
|
minHeight: 106,
|
@@ -7256,14 +8610,14 @@ ${e3.text} (${e3.id})`;
|
|
7256
8610
|
if (this.allowCustomPrompts) {
|
7257
8611
|
return;
|
7258
8612
|
}
|
7259
|
-
let aiPromptTextAreaPlaceholder = "
|
8613
|
+
let aiPromptTextAreaPlaceholder = stringResources["aiPromptDialogTextAreaPlaceholder"];
|
7260
8614
|
const aiPromptTextArea = this.kendoAiPrompt.element.find(".k-prompt-content .k-prompt-view textarea");
|
7261
8615
|
if (!hasPromptSuggestions) {
|
7262
8616
|
const aiPromptGenerateButton = this.kendoAiPrompt.element.find(".k-prompt-footer .k-actions");
|
7263
8617
|
aiPromptGenerateButton && aiPromptGenerateButton.addClass("k-disabled");
|
7264
|
-
aiPromptTextAreaPlaceholder = "
|
8618
|
+
aiPromptTextAreaPlaceholder = stringResources["aiPromptDialogNoPredefinedAndCustomPromptsPlaceholder"] || "";
|
7265
8619
|
} else {
|
7266
|
-
aiPromptTextAreaPlaceholder = "
|
8620
|
+
aiPromptTextAreaPlaceholder = stringResources["aiPromptDialogNoCustomPromptsPlaceholder"] || "";
|
7267
8621
|
}
|
7268
8622
|
aiPromptTextArea && aiPromptTextArea.attr("placeholder", aiPromptTextAreaPlaceholder) && aiPromptTextArea.addClass("k-disabled");
|
7269
8623
|
}
|
@@ -7315,17 +8669,20 @@ ${e3.text} (${e3.id})`;
|
|
7315
8669
|
}
|
7316
8670
|
}
|
7317
8671
|
open() {
|
7318
|
-
|
7319
|
-
this.
|
7320
|
-
|
7321
|
-
|
7322
|
-
|
7323
|
-
|
8672
|
+
this.controller.createAIThread().then((data) => {
|
8673
|
+
this.predefinedPrompts = data?.predefinedPrompts;
|
8674
|
+
this.allowCustomPrompts = data?.allowCustomPrompts;
|
8675
|
+
if (this.kendoAiConsentDialog && data.requireConsent && this.controller.loadFromSessionStorage("trvAiConsent") !== "true") {
|
8676
|
+
$(".trv-ai-consent-content").html(data?.consentMessage);
|
8677
|
+
this.kendoAiConsentDialog.open();
|
8678
|
+
return;
|
8679
|
+
}
|
8680
|
+
if (this.kendoAiPromptDialog) {
|
7324
8681
|
this.controller.setAiPromptInitiated(true);
|
7325
|
-
this._initAiPrompt(
|
8682
|
+
this._initAiPrompt(this.predefinedPrompts);
|
7326
8683
|
this.kendoAiPromptDialog.open();
|
7327
|
-
}
|
7328
|
-
}
|
8684
|
+
}
|
8685
|
+
});
|
7329
8686
|
}
|
7330
8687
|
close() {
|
7331
8688
|
this.controller.setAiPromptInitiated(false);
|
@@ -7423,7 +8780,8 @@ ${e3.text} (${e3.id})`;
|
|
7423
8780
|
searchMetadataOnDemand: false,
|
7424
8781
|
initialPageAreaImageUrl: null,
|
7425
8782
|
keepClientAlive: true,
|
7426
|
-
webDesignerPreview: false
|
8783
|
+
webDesignerPreview: false,
|
8784
|
+
serverPreview: false
|
7427
8785
|
};
|
7428
8786
|
}
|
7429
8787
|
function ReportViewer(dom, options) {
|
@@ -7452,7 +8810,7 @@ ${e3.text} (${e3.id})`;
|
|
7452
8810
|
if (!validateOptions(options)) {
|
7453
8811
|
return;
|
7454
8812
|
}
|
7455
|
-
var version = "19.
|
8813
|
+
var version = "19.2.25.813";
|
7456
8814
|
options = $.extend({}, getDefaultOptions(svcApiUrl, version), options);
|
7457
8815
|
settings = new ReportViewerSettings(
|
7458
8816
|
persistanceKey,
|
@@ -7467,7 +8825,8 @@ ${e3.text} (${e3.id})`;
|
|
7467
8825
|
parametersAreaPosition: options.parametersAreaPosition,
|
7468
8826
|
documentMapAreaPosition: options.documentMapAreaPosition,
|
7469
8827
|
keepClientAlive: options.keepClientAlive,
|
7470
|
-
webDesignerPreview: options.webDesignerPreview
|
8828
|
+
webDesignerPreview: options.webDesignerPreview,
|
8829
|
+
serverPreview: options.serverPreview
|
7471
8830
|
}
|
7472
8831
|
);
|
7473
8832
|
notificationService = new NotificationService();
|
@@ -7945,7 +9304,7 @@ ${e3.text} (${e3.id})`;
|
|
7945
9304
|
function start() {
|
7946
9305
|
var pendingRefresh = false;
|
7947
9306
|
init();
|
7948
|
-
if (!options.webDesignerPreview) {
|
9307
|
+
if (!(options.webDesignerPreview || options.serverPreview)) {
|
7949
9308
|
if (controller.shouldShowLicenseBanner()) {
|
7950
9309
|
$(".trv-content-wrapper")?.prepend('<span class="trv-license-banner"></span>');
|
7951
9310
|
const licenseBanner = $(".trv-license-banner").kendoNotification({
|
@@ -8115,13 +9474,21 @@ ${e3.text} (${e3.id})`;
|
|
8115
9474
|
return Promise.resolve();
|
8116
9475
|
}
|
8117
9476
|
var kendoUrl = rTrim(svcApiUrl, "\\/") + "/resources/js/telerikReportViewer.kendo-" + version2 + ".min.js/";
|
8118
|
-
return
|
9477
|
+
return fetch(kendoUrl).then((response) => {
|
9478
|
+
if (!response.ok) {
|
9479
|
+
return Promise.reject({ error: "Failed to fetch data - status code " + response.status });
|
9480
|
+
}
|
9481
|
+
return response.text();
|
9482
|
+
}).then((kendoScript) => {
|
9483
|
+
const scriptElement = document.createElement("script");
|
9484
|
+
scriptElement.textContent = kendoScript;
|
9485
|
+
document.head.appendChild(scriptElement);
|
9486
|
+
}).catch((errorData) => {
|
8119
9487
|
logError("Kendo could not be loaded automatically. Make sure 'options.serviceUrl' / 'options.reportServer.url' is correct and accessible. The error is: " + errorData.error);
|
8120
9488
|
});
|
8121
9489
|
}
|
8122
9490
|
function main(version2) {
|
8123
9491
|
ensureKendo(version2).then(() => {
|
8124
|
-
}).then(() => {
|
8125
9492
|
viewer.authenticationToken(options.authenticationToken);
|
8126
9493
|
controller.getServiceConfiguration().catch((ex) => {
|
8127
9494
|
var errorOutput = isApplicationExceptionInstance(ex) ? ex.exceptionMessage : stringFormat(stringResources.errorServiceUrl, [escapeHtml(svcApiUrl)]);
|
@@ -8157,6 +9524,15 @@ ${e3.text} (${e3.id})`;
|
|
8157
9524
|
}
|
8158
9525
|
return viewer;
|
8159
9526
|
}
|
9527
|
+
function ReportViewerServiceClient(serviceClientOptions) {
|
9528
|
+
return new distExports.ServiceClient(serviceClientOptions);
|
9529
|
+
}
|
9530
|
+
function ReportViewerController(controllerOptions) {
|
9531
|
+
return new distExports.ReportController(controllerOptions?.serviceClient, controllerOptions?.settings);
|
9532
|
+
}
|
9533
|
+
function ReportViewerNotificationService() {
|
9534
|
+
return new NotificationService();
|
9535
|
+
}
|
8160
9536
|
var pluginName = "telerik_ReportViewer";
|
8161
9537
|
$.fn[pluginName] = function(options) {
|
8162
9538
|
if (this.selector && !options.selector) {
|
@@ -8234,6 +9610,9 @@ ${e3.text} (${e3.id})`;
|
|
8234
9610
|
exports.PerspectiveManager = PerspectiveManager;
|
8235
9611
|
exports.PrintModes = PrintModes;
|
8236
9612
|
exports.ReportViewer = ReportViewer;
|
9613
|
+
exports.ReportViewerController = ReportViewerController;
|
9614
|
+
exports.ReportViewerNotificationService = ReportViewerNotificationService;
|
9615
|
+
exports.ReportViewerServiceClient = ReportViewerServiceClient;
|
8237
9616
|
exports.ReportViewerSettings = ReportViewerSettings;
|
8238
9617
|
exports.ScaleModes = ScaleModes;
|
8239
9618
|
exports.TouchBehavior = TouchBehavior;
|