@progress/telerik-angular-report-viewer 30.26.615 → 31.26.812
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 +1 -1
- package/dist/cjs/telerik-report-viewer.component.d.ts +2 -1
- package/dist/cjs/telerik-report-viewer.component.js +5 -2
- package/dist/cjs/telerik-report-viewer.component.js.map +1 -1
- package/dist/dependencies/telerikReportViewer.d.ts +1 -0
- package/dist/dependencies/telerikReportViewer.js +1777 -934
- package/dist/dependencies/telerikReportViewer.kendo.min.js +201 -17
- package/dist/dependencies/telerikReportViewerTemplate.html +4 -4
- package/dist/es/telerik-report-viewer.component.d.ts +2 -1
- package/dist/es/telerik-report-viewer.component.js +5 -2
- package/dist/es/telerik-report-viewer.component.js.map +1 -1
- package/package.json +10 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var $ = require("jquery");
|
|
2
2
|
/*
|
|
3
|
-
* TelerikReporting v20.
|
|
3
|
+
* TelerikReporting v20.2.26.812 (https://www.telerik.com/products/reporting.aspx)
|
|
4
4
|
* Copyright 2026 Progress Software EAD. All rights reserved.
|
|
5
5
|
*
|
|
6
6
|
* Telerik Reporting commercial licenses may be obtained at
|
|
@@ -14,7 +14,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
14
14
|
|
|
15
15
|
var dist = {exports: {}};
|
|
16
16
|
|
|
17
|
-
/*! @license DOMPurify 3.4.
|
|
17
|
+
/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */
|
|
18
18
|
|
|
19
19
|
var purify_cjs;
|
|
20
20
|
var hasRequiredPurify_cjs;
|
|
@@ -23,22 +23,63 @@ var telerikReportViewer = (function (exports) {
|
|
|
23
23
|
if (hasRequiredPurify_cjs) return purify_cjs;
|
|
24
24
|
hasRequiredPurify_cjs = 1;
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
26
|
+
function _arrayLikeToArray(r, a) {
|
|
27
|
+
(null == a || a > r.length) && (a = r.length);
|
|
28
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
29
|
+
return n;
|
|
30
|
+
}
|
|
31
|
+
function _arrayWithHoles(r) {
|
|
32
|
+
if (Array.isArray(r)) return r;
|
|
33
|
+
}
|
|
34
|
+
function _iterableToArrayLimit(r, l) {
|
|
35
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
36
|
+
if (null != t) {
|
|
37
|
+
var e,
|
|
38
|
+
n,
|
|
39
|
+
i,
|
|
40
|
+
u,
|
|
41
|
+
a = [],
|
|
42
|
+
f = true,
|
|
43
|
+
o = false;
|
|
44
|
+
try {
|
|
45
|
+
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
46
|
+
} catch (r) {
|
|
47
|
+
o = true, n = r;
|
|
48
|
+
} finally {
|
|
49
|
+
try {
|
|
50
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
51
|
+
} finally {
|
|
52
|
+
if (o) throw n;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return a;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function _nonIterableRest() {
|
|
59
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
60
|
+
}
|
|
61
|
+
function _slicedToArray(r, e) {
|
|
62
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
63
|
+
}
|
|
64
|
+
function _unsupportedIterableToArray(r, a) {
|
|
65
|
+
if (r) {
|
|
66
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
67
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
68
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const entries = Object.entries,
|
|
73
|
+
setPrototypeOf = Object.setPrototypeOf,
|
|
74
|
+
isFrozen = Object.isFrozen,
|
|
75
|
+
getPrototypeOf = Object.getPrototypeOf,
|
|
76
|
+
getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
77
|
+
let freeze = Object.freeze,
|
|
78
|
+
seal = Object.seal,
|
|
79
|
+
create = Object.create; // eslint-disable-line import/no-mutable-exports
|
|
80
|
+
let _ref = typeof Reflect !== 'undefined' && Reflect,
|
|
81
|
+
apply = _ref.apply,
|
|
82
|
+
construct = _ref.construct;
|
|
42
83
|
if (!freeze) {
|
|
43
84
|
freeze = function freeze(x) {
|
|
44
85
|
return x;
|
|
@@ -175,7 +216,10 @@ var telerikReportViewer = (function (exports) {
|
|
|
175
216
|
*/
|
|
176
217
|
function clone(object) {
|
|
177
218
|
const newObject = create(null);
|
|
178
|
-
for (const
|
|
219
|
+
for (const _ref2 of entries(object)) {
|
|
220
|
+
var _ref3 = _slicedToArray(_ref2, 2);
|
|
221
|
+
const property = _ref3[0];
|
|
222
|
+
const value = _ref3[1];
|
|
179
223
|
const isPropertyExist = objectHasOwnProperty(object, property);
|
|
180
224
|
if (isPropertyExist) {
|
|
181
225
|
if (arrayIsArray(value)) {
|
|
@@ -289,15 +333,14 @@ var telerikReportViewer = (function (exports) {
|
|
|
289
333
|
const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
|
290
334
|
const text = freeze(['#text']);
|
|
291
335
|
|
|
292
|
-
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', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', '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', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns']);
|
|
293
|
-
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', 'mask-type', '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']);
|
|
336
|
+
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'command', 'commandfor', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', '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', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns']);
|
|
337
|
+
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', 'dominant-baseline', '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', 'mask-type', '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-orientation', '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']);
|
|
294
338
|
const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnalign', 'columnlines', 'columnspacing', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lquote', 'lspace', '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']);
|
|
295
339
|
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
|
296
340
|
|
|
297
|
-
|
|
298
|
-
const
|
|
299
|
-
const
|
|
300
|
-
const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
|
|
341
|
+
const MUSTACHE_EXPR = seal(/{{[\w\W]*|^[\w\W]*}}/g);
|
|
342
|
+
const ERB_EXPR = seal(/<%[\w\W]*|^[\w\W]*%>/g);
|
|
343
|
+
const TMPLIT_EXPR = seal(/\${[\w\W]*/g);
|
|
301
344
|
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
|
|
302
345
|
const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
|
303
346
|
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
|
|
@@ -307,30 +350,31 @@ var telerikReportViewer = (function (exports) {
|
|
|
307
350
|
);
|
|
308
351
|
const DOCTYPE_NAME = seal(/^html$/i);
|
|
309
352
|
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
353
|
+
// Markup-significant character probes used by _sanitizeElements.
|
|
354
|
+
// Shared module-level instances are safe despite the sticky /g flags:
|
|
355
|
+
// unapply() resets lastIndex for RegExp receivers before every call.
|
|
356
|
+
const ELEMENT_MARKUP_PROBE = seal(/<[/\w!]/g);
|
|
357
|
+
const COMMENT_MARKUP_PROBE = seal(/<[/\w]/g);
|
|
358
|
+
const FALLBACK_TAG_CLOSE = seal(/<\/no(script|embed|frames)/i);
|
|
359
|
+
const SELF_CLOSING_TAG = seal(/\/>/i);
|
|
310
360
|
|
|
311
|
-
var EXPRESSIONS = /*#__PURE__*/Object.freeze({
|
|
312
|
-
__proto__: null,
|
|
313
|
-
ARIA_ATTR: ARIA_ATTR,
|
|
314
|
-
ATTR_WHITESPACE: ATTR_WHITESPACE,
|
|
315
|
-
CUSTOM_ELEMENT: CUSTOM_ELEMENT,
|
|
316
|
-
DATA_ATTR: DATA_ATTR,
|
|
317
|
-
DOCTYPE_NAME: DOCTYPE_NAME,
|
|
318
|
-
ERB_EXPR: ERB_EXPR,
|
|
319
|
-
IS_ALLOWED_URI: IS_ALLOWED_URI,
|
|
320
|
-
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
|
|
321
|
-
MUSTACHE_EXPR: MUSTACHE_EXPR,
|
|
322
|
-
TMPLIT_EXPR: TMPLIT_EXPR
|
|
323
|
-
});
|
|
324
|
-
|
|
325
|
-
/* eslint-disable @typescript-eslint/indent */
|
|
326
361
|
// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
|
|
327
362
|
const NODE_TYPE = {
|
|
328
363
|
element: 1,
|
|
364
|
+
attribute: 2,
|
|
329
365
|
text: 3,
|
|
366
|
+
cdataSection: 4,
|
|
367
|
+
entityReference: 5,
|
|
368
|
+
// Deprecated
|
|
369
|
+
entityNode: 6,
|
|
330
370
|
// Deprecated
|
|
331
|
-
|
|
371
|
+
processingInstruction: 7,
|
|
332
372
|
comment: 8,
|
|
333
|
-
document: 9
|
|
373
|
+
document: 9,
|
|
374
|
+
documentType: 10,
|
|
375
|
+
documentFragment: 11,
|
|
376
|
+
notation: 12 // Deprecated
|
|
377
|
+
};
|
|
334
378
|
const getGlobal = function getGlobal() {
|
|
335
379
|
return typeof window === 'undefined' ? null : window;
|
|
336
380
|
};
|
|
@@ -385,10 +429,25 @@ var telerikReportViewer = (function (exports) {
|
|
|
385
429
|
uponSanitizeShadowNode: []
|
|
386
430
|
};
|
|
387
431
|
};
|
|
432
|
+
/**
|
|
433
|
+
* Resolve a set-valued configuration option: a fresh set built from
|
|
434
|
+
* cfg[key] when it is an own array property (seeded with a clone of
|
|
435
|
+
* options.base when given, case-normalized via options.transform),
|
|
436
|
+
* the fallback set otherwise.
|
|
437
|
+
*
|
|
438
|
+
* @param cfg the cloned, prototype-free configuration object
|
|
439
|
+
* @param key the configuration property to read
|
|
440
|
+
* @param fallback the set to use when the option is absent or not an array
|
|
441
|
+
* @param options transform and optional base set to merge into
|
|
442
|
+
* @returns the resolved set
|
|
443
|
+
*/
|
|
444
|
+
const _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {
|
|
445
|
+
return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;
|
|
446
|
+
};
|
|
388
447
|
function createDOMPurify() {
|
|
389
448
|
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
390
449
|
const DOMPurify = root => createDOMPurify(root);
|
|
391
|
-
DOMPurify.version = '3.4.
|
|
450
|
+
DOMPurify.version = '3.4.12';
|
|
392
451
|
DOMPurify.removed = [];
|
|
393
452
|
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
394
453
|
// Not running in a browser, provide a factory function
|
|
@@ -396,28 +455,29 @@ var telerikReportViewer = (function (exports) {
|
|
|
396
455
|
DOMPurify.isSupported = false;
|
|
397
456
|
return DOMPurify;
|
|
398
457
|
}
|
|
399
|
-
let
|
|
400
|
-
document
|
|
401
|
-
} = window;
|
|
458
|
+
let document = window.document;
|
|
402
459
|
const originalDocument = document;
|
|
403
460
|
const currentScript = originalDocument.currentScript;
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
NamedNodeMap
|
|
411
|
-
HTMLFormElement
|
|
412
|
-
DOMParser,
|
|
413
|
-
trustedTypes
|
|
414
|
-
} = window;
|
|
461
|
+
window.DocumentFragment;
|
|
462
|
+
const HTMLTemplateElement = window.HTMLTemplateElement,
|
|
463
|
+
Node = window.Node,
|
|
464
|
+
Element = window.Element,
|
|
465
|
+
NodeFilter = window.NodeFilter,
|
|
466
|
+
_window$NamedNodeMap = window.NamedNodeMap;
|
|
467
|
+
_window$NamedNodeMap === void 0 ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap;
|
|
468
|
+
window.HTMLFormElement;
|
|
469
|
+
const DOMParser = window.DOMParser,
|
|
470
|
+
trustedTypes = window.trustedTypes;
|
|
415
471
|
const ElementPrototype = Element.prototype;
|
|
416
472
|
const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
|
|
417
473
|
const remove = lookupGetter(ElementPrototype, 'remove');
|
|
418
474
|
const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
|
419
475
|
const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
|
420
476
|
const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
|
|
477
|
+
const getShadowRoot = lookupGetter(ElementPrototype, 'shadowRoot');
|
|
478
|
+
const getAttributes = lookupGetter(ElementPrototype, 'attributes');
|
|
479
|
+
const getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeType') : null;
|
|
480
|
+
const getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeName') : null;
|
|
421
481
|
// As per issue #47, the web-components registry is inherited by a
|
|
422
482
|
// new document created via createHTMLDocument. As per the spec
|
|
423
483
|
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
|
@@ -432,33 +492,74 @@ var telerikReportViewer = (function (exports) {
|
|
|
432
492
|
}
|
|
433
493
|
let trustedTypesPolicy;
|
|
434
494
|
let emptyHTML = '';
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
495
|
+
// The instance's own internal Trusted Types policy. Unlike a caller-supplied
|
|
496
|
+
// `TRUSTED_TYPES_POLICY`, this is created at most once — Trusted Types throws
|
|
497
|
+
// on duplicate policy names — and is the only policy allowed to persist
|
|
498
|
+
// across configurations and survive `clearConfig()`.
|
|
499
|
+
let defaultTrustedTypesPolicy;
|
|
500
|
+
let defaultTrustedTypesPolicyResolved = false;
|
|
501
|
+
// Tracks whether we are already inside a call to the configured Trusted Types
|
|
502
|
+
// policy (`createHTML` or `createScriptURL`). If a supplied policy callback
|
|
503
|
+
// itself calls `DOMPurify.sanitize` (the cause of #1422), `sanitize` would
|
|
504
|
+
// re-enter the policy and recurse until the stack overflows. We detect that
|
|
505
|
+
// re-entry and throw a clear, actionable error instead. The guard is shared
|
|
506
|
+
// across both callbacks, because either one re-entering `sanitize` triggers
|
|
507
|
+
// the same unbounded recursion.
|
|
508
|
+
let IN_TRUSTED_TYPES_POLICY = 0;
|
|
509
|
+
const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {
|
|
510
|
+
if (IN_TRUSTED_TYPES_POLICY > 0) {
|
|
511
|
+
throw typeErrorCreate('A configured TRUSTED_TYPES_POLICY callback (createHTML or ' + 'createScriptURL) must not call DOMPurify.sanitize, as that causes ' + 'infinite recursion. Do not pass a policy whose callbacks wrap ' + 'DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted ' + 'Types" section of the README.');
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
const _createTrustedHTML = function _createTrustedHTML(html) {
|
|
515
|
+
_assertNotInTrustedTypesPolicy();
|
|
516
|
+
IN_TRUSTED_TYPES_POLICY++;
|
|
517
|
+
try {
|
|
518
|
+
return trustedTypesPolicy.createHTML(html);
|
|
519
|
+
} finally {
|
|
520
|
+
IN_TRUSTED_TYPES_POLICY--;
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
const _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {
|
|
524
|
+
_assertNotInTrustedTypesPolicy();
|
|
525
|
+
IN_TRUSTED_TYPES_POLICY++;
|
|
526
|
+
try {
|
|
527
|
+
return trustedTypesPolicy.createScriptURL(scriptUrl);
|
|
528
|
+
} finally {
|
|
529
|
+
IN_TRUSTED_TYPES_POLICY--;
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
// Lazily resolve (and cache) the instance's internal default policy.
|
|
533
|
+
// Resolution is attempted at most once: a successful `createPolicy` cannot be
|
|
534
|
+
// repeated (Trusted Types throws on duplicate names), and a failed or
|
|
535
|
+
// unsupported attempt must not be retried on every parse.
|
|
536
|
+
const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {
|
|
537
|
+
if (!defaultTrustedTypesPolicyResolved) {
|
|
538
|
+
defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
|
539
|
+
defaultTrustedTypesPolicyResolved = true;
|
|
540
|
+
}
|
|
541
|
+
return defaultTrustedTypesPolicy;
|
|
542
|
+
};
|
|
543
|
+
const _document = document,
|
|
544
|
+
implementation = _document.implementation,
|
|
545
|
+
createNodeIterator = _document.createNodeIterator,
|
|
546
|
+
createDocumentFragment = _document.createDocumentFragment,
|
|
547
|
+
getElementsByTagName = _document.getElementsByTagName;
|
|
548
|
+
const importNode = originalDocument.importNode;
|
|
444
549
|
let hooks = _createHooksMap();
|
|
445
550
|
/**
|
|
446
551
|
* Expose whether this browser supports running the full DOMPurify.
|
|
447
552
|
*/
|
|
448
553
|
DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
} = EXPRESSIONS;
|
|
459
|
-
let {
|
|
460
|
-
IS_ALLOWED_URI: IS_ALLOWED_URI$1
|
|
461
|
-
} = EXPRESSIONS;
|
|
554
|
+
const MUSTACHE_EXPR$1 = MUSTACHE_EXPR,
|
|
555
|
+
ERB_EXPR$1 = ERB_EXPR,
|
|
556
|
+
TMPLIT_EXPR$1 = TMPLIT_EXPR,
|
|
557
|
+
DATA_ATTR$1 = DATA_ATTR,
|
|
558
|
+
ARIA_ATTR$1 = ARIA_ATTR,
|
|
559
|
+
IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA,
|
|
560
|
+
ATTR_WHITESPACE$1 = ATTR_WHITESPACE,
|
|
561
|
+
CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;
|
|
562
|
+
let IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
|
|
462
563
|
/**
|
|
463
564
|
* We consider the elements and attributes below to be safe. Ideally
|
|
464
565
|
* don't add any new ones but feel free to remove unwanted ones.
|
|
@@ -535,6 +636,13 @@ var telerikReportViewer = (function (exports) {
|
|
|
535
636
|
let WHOLE_DOCUMENT = false;
|
|
536
637
|
/* Track whether config is already set on this instance of DOMPurify. */
|
|
537
638
|
let SET_CONFIG = false;
|
|
639
|
+
/* Pristine allowlist bindings captured at setConfig() time. On the
|
|
640
|
+
* persistent-config path sanitize() restores the sets from these before
|
|
641
|
+
* the per-walk hook clone-guard, so a hook's in-call widening cannot
|
|
642
|
+
* carry across calls. Null until setConfig() is called; reset by
|
|
643
|
+
* clearConfig(). */
|
|
644
|
+
let SET_CONFIG_ALLOWED_TAGS = null;
|
|
645
|
+
let SET_CONFIG_ALLOWED_ATTR = null;
|
|
538
646
|
/* Decide if all elements (e.g. style, script) must be children of
|
|
539
647
|
* document.body. By default, browsers might move them to document.head */
|
|
540
648
|
let FORCE_BODY = false;
|
|
@@ -577,7 +685,17 @@ var telerikReportViewer = (function (exports) {
|
|
|
577
685
|
let USE_PROFILES = {};
|
|
578
686
|
/* Tags to ignore content of when KEEP_CONTENT is true */
|
|
579
687
|
let FORBID_CONTENTS = null;
|
|
580
|
-
const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script',
|
|
688
|
+
const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script',
|
|
689
|
+
// <selectedcontent> mirrors the selected <option>'s subtree, cloned by
|
|
690
|
+
// the UA (customizable <select>) — including any on* handlers — and the
|
|
691
|
+
// engine re-mirrors synchronously whenever a removal changes which
|
|
692
|
+
// option/selectedcontent is current, even inside DOMPurify's inert
|
|
693
|
+
// DOMParser document. Hoisting its children on removal re-inserts a fresh
|
|
694
|
+
// mirror target ahead of the walk, which the engine refills, looping
|
|
695
|
+
// forever (DoS) and amplifying output. Dropping its content on removal
|
|
696
|
+
// (rather than hoisting) breaks that cascade; the content is a duplicate
|
|
697
|
+
// of the option, which is sanitized on its own. See campaign-3 F1/F6.
|
|
698
|
+
'selectedcontent', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
|
|
581
699
|
/* Tags that are safe for data: URIs */
|
|
582
700
|
let DATA_URI_TAGS = null;
|
|
583
701
|
const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
|
@@ -593,8 +711,10 @@ var telerikReportViewer = (function (exports) {
|
|
|
593
711
|
/* Allowed XHTML+XML namespaces */
|
|
594
712
|
let ALLOWED_NAMESPACES = null;
|
|
595
713
|
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
|
596
|
-
|
|
597
|
-
let
|
|
714
|
+
const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze(['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
715
|
+
let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);
|
|
716
|
+
const DEFAULT_HTML_INTEGRATION_POINTS = freeze(['annotation-xml']);
|
|
717
|
+
let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);
|
|
598
718
|
// Certain elements are allowed in both SVG and HTML
|
|
599
719
|
// namespace. We need to specify them explicitly
|
|
600
720
|
// so that they don't get erroneously deleted from
|
|
@@ -636,14 +756,32 @@ var telerikReportViewer = (function (exports) {
|
|
|
636
756
|
// HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
|
|
637
757
|
transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
|
|
638
758
|
/* Set configuration parameters */
|
|
639
|
-
ALLOWED_TAGS =
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
759
|
+
ALLOWED_TAGS = _resolveSetOption(cfg, 'ALLOWED_TAGS', DEFAULT_ALLOWED_TAGS, {
|
|
760
|
+
transform: transformCaseFunc
|
|
761
|
+
});
|
|
762
|
+
ALLOWED_ATTR = _resolveSetOption(cfg, 'ALLOWED_ATTR', DEFAULT_ALLOWED_ATTR, {
|
|
763
|
+
transform: transformCaseFunc
|
|
764
|
+
});
|
|
765
|
+
ALLOWED_NAMESPACES = _resolveSetOption(cfg, 'ALLOWED_NAMESPACES', DEFAULT_ALLOWED_NAMESPACES, {
|
|
766
|
+
transform: stringToString
|
|
767
|
+
});
|
|
768
|
+
URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, 'ADD_URI_SAFE_ATTR', DEFAULT_URI_SAFE_ATTRIBUTES, {
|
|
769
|
+
transform: transformCaseFunc,
|
|
770
|
+
base: DEFAULT_URI_SAFE_ATTRIBUTES
|
|
771
|
+
});
|
|
772
|
+
DATA_URI_TAGS = _resolveSetOption(cfg, 'ADD_DATA_URI_TAGS', DEFAULT_DATA_URI_TAGS, {
|
|
773
|
+
transform: transformCaseFunc,
|
|
774
|
+
base: DEFAULT_DATA_URI_TAGS
|
|
775
|
+
});
|
|
776
|
+
FORBID_CONTENTS = _resolveSetOption(cfg, 'FORBID_CONTENTS', DEFAULT_FORBID_CONTENTS, {
|
|
777
|
+
transform: transformCaseFunc
|
|
778
|
+
});
|
|
779
|
+
FORBID_TAGS = _resolveSetOption(cfg, 'FORBID_TAGS', clone({}), {
|
|
780
|
+
transform: transformCaseFunc
|
|
781
|
+
});
|
|
782
|
+
FORBID_ATTR = _resolveSetOption(cfg, 'FORBID_ATTR', clone({}), {
|
|
783
|
+
transform: transformCaseFunc
|
|
784
|
+
});
|
|
647
785
|
USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === 'object' ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
|
|
648
786
|
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
|
|
649
787
|
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
|
|
@@ -662,8 +800,8 @@ var telerikReportViewer = (function (exports) {
|
|
|
662
800
|
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
|
663
801
|
IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI; // Default regexp
|
|
664
802
|
NAMESPACE = typeof cfg.NAMESPACE === 'string' ? cfg.NAMESPACE : HTML_NAMESPACE; // Default HTML namespace
|
|
665
|
-
MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'MATHML_TEXT_INTEGRATION_POINTS') && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === 'object' ? clone(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({},
|
|
666
|
-
HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'HTML_INTEGRATION_POINTS') && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === 'object' ? clone(cfg.HTML_INTEGRATION_POINTS) : addToSet({},
|
|
803
|
+
MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'MATHML_TEXT_INTEGRATION_POINTS') && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === 'object' ? clone(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS); // Default built-in map
|
|
804
|
+
HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'HTML_INTEGRATION_POINTS') && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === 'object' ? clone(cfg.HTML_INTEGRATION_POINTS) : addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS); // Default built-in map
|
|
667
805
|
const customElementHandling = objectHasOwnProperty(cfg, 'CUSTOM_ELEMENT_HANDLING') && cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING === 'object' ? clone(cfg.CUSTOM_ELEMENT_HANDLING) : create(null);
|
|
668
806
|
CUSTOM_ELEMENT_HANDLING = create(null);
|
|
669
807
|
if (objectHasOwnProperty(customElementHandling, 'tagNameCheck') && isRegexOrFunction(customElementHandling.tagNameCheck)) {
|
|
@@ -675,6 +813,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
675
813
|
if (objectHasOwnProperty(customElementHandling, 'allowCustomizedBuiltInElements') && typeof customElementHandling.allowCustomizedBuiltInElements === 'boolean') {
|
|
676
814
|
CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements; // Default undefined
|
|
677
815
|
}
|
|
816
|
+
seal(CUSTOM_ELEMENT_HANDLING);
|
|
678
817
|
if (SAFE_FOR_TEMPLATES) {
|
|
679
818
|
ALLOW_DATA_ATTR = false;
|
|
680
819
|
}
|
|
@@ -758,6 +897,13 @@ var telerikReportViewer = (function (exports) {
|
|
|
758
897
|
addToSet(ALLOWED_TAGS, ['tbody']);
|
|
759
898
|
delete FORBID_TAGS.tbody;
|
|
760
899
|
}
|
|
900
|
+
// Re-derive the active Trusted Types policy from this configuration on
|
|
901
|
+
// every parse. The active policy must never be sticky closure state that
|
|
902
|
+
// outlives the config that set it: a caller-supplied policy left in place
|
|
903
|
+
// after `clearConfig()` — or after a later call that supplied none, or
|
|
904
|
+
// `TRUSTED_TYPES_POLICY: null` — could sign a subsequent "default"
|
|
905
|
+
// `RETURN_TRUSTED_TYPE` result with a foreign, possibly unsafe policy.
|
|
906
|
+
// See GHSA-vxr8-fq34-vvx9.
|
|
761
907
|
if (cfg.TRUSTED_TYPES_POLICY) {
|
|
762
908
|
if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
|
|
763
909
|
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
@@ -765,18 +911,45 @@ var telerikReportViewer = (function (exports) {
|
|
|
765
911
|
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
|
|
766
912
|
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
767
913
|
}
|
|
768
|
-
//
|
|
914
|
+
// A caller-supplied policy applies to this configuration only.
|
|
915
|
+
const previousTrustedTypesPolicy = trustedTypesPolicy;
|
|
769
916
|
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
|
770
|
-
// Sign local variables required by `sanitize`.
|
|
771
|
-
|
|
917
|
+
// Sign local variables required by `sanitize`. If the supplied policy's
|
|
918
|
+
// `createHTML` is circular (i.e. it calls `DOMPurify.sanitize`), this
|
|
919
|
+
// throws via the re-entrancy guard. Restore the previous policy first so
|
|
920
|
+
// the instance is not left in a poisoned state. See #1422.
|
|
921
|
+
try {
|
|
922
|
+
emptyHTML = _createTrustedHTML('');
|
|
923
|
+
} catch (error) {
|
|
924
|
+
trustedTypesPolicy = previousTrustedTypesPolicy;
|
|
925
|
+
throw error;
|
|
926
|
+
}
|
|
927
|
+
} else if (cfg.TRUSTED_TYPES_POLICY === null) {
|
|
928
|
+
// Explicit opt-out for this call: perform no Trusted Types signing and
|
|
929
|
+
// create nothing (so a strict `trusted-types` CSP that disallows a
|
|
930
|
+
// `dompurify` policy can still call `sanitize` from inside its own
|
|
931
|
+
// policy — see #1422). Resetting to `undefined` rather than a sticky
|
|
932
|
+
// `null` also drops any previously retained caller policy, so it cannot
|
|
933
|
+
// resurface on a later call, while still allowing the next config-less
|
|
934
|
+
// call to restore the internal default policy. See GHSA-vxr8-fq34-vvx9.
|
|
935
|
+
trustedTypesPolicy = undefined;
|
|
936
|
+
emptyHTML = '';
|
|
772
937
|
} else {
|
|
773
|
-
//
|
|
938
|
+
// No policy supplied: keep the currently active policy if one is set — a
|
|
939
|
+
// previously supplied policy is intentionally sticky across config-less
|
|
940
|
+
// calls — otherwise fall back to the instance's own internal policy,
|
|
941
|
+
// created at most once. (A policy supplied for a *single* call still
|
|
942
|
+
// lingers by design; what must not linger is a policy whose configuration
|
|
943
|
+
// has been torn down via `clearConfig()`, which restores the default.)
|
|
774
944
|
if (trustedTypesPolicy === undefined) {
|
|
775
|
-
trustedTypesPolicy =
|
|
945
|
+
trustedTypesPolicy = _getDefaultTrustedTypesPolicy();
|
|
776
946
|
}
|
|
777
|
-
//
|
|
778
|
-
|
|
779
|
-
|
|
947
|
+
// Sign internal variables only when a policy is active. A falsy policy
|
|
948
|
+
// (Trusted Types unsupported, creation failed, or an explicit opt-out)
|
|
949
|
+
// leaves `emptyHTML` as a plain string, so we never call `.createHTML` on
|
|
950
|
+
// a non-policy and throw. See #1422.
|
|
951
|
+
if (trustedTypesPolicy && typeof emptyHTML === 'string') {
|
|
952
|
+
emptyHTML = _createTrustedHTML('');
|
|
780
953
|
}
|
|
781
954
|
}
|
|
782
955
|
// Prevent further manipulation of configuration.
|
|
@@ -791,6 +964,77 @@ var telerikReportViewer = (function (exports) {
|
|
|
791
964
|
* correctly. */
|
|
792
965
|
const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
|
|
793
966
|
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
|
|
967
|
+
/**
|
|
968
|
+
* Namespace rules for an element in the SVG namespace.
|
|
969
|
+
*
|
|
970
|
+
* @param tagName the element's lowercase tag name
|
|
971
|
+
* @param parent the (possibly simulated) parent node
|
|
972
|
+
* @param parentTagName the parent's lowercase tag name
|
|
973
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
974
|
+
*/
|
|
975
|
+
const _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {
|
|
976
|
+
// The only way to switch from HTML namespace to SVG
|
|
977
|
+
// is via <svg>. If it happens via any other tag, then
|
|
978
|
+
// it should be killed.
|
|
979
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
980
|
+
return tagName === 'svg';
|
|
981
|
+
}
|
|
982
|
+
// The only way to switch from MathML to SVG is via <svg>
|
|
983
|
+
// if the parent is either <annotation-xml> or a MathML
|
|
984
|
+
// text integration point.
|
|
985
|
+
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
986
|
+
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
987
|
+
}
|
|
988
|
+
// We only allow elements that are defined in SVG
|
|
989
|
+
// spec. All others are disallowed in SVG namespace.
|
|
990
|
+
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
991
|
+
};
|
|
992
|
+
/**
|
|
993
|
+
* Namespace rules for an element in the MathML namespace.
|
|
994
|
+
*
|
|
995
|
+
* @param tagName the element's lowercase tag name
|
|
996
|
+
* @param parent the (possibly simulated) parent node
|
|
997
|
+
* @param parentTagName the parent's lowercase tag name
|
|
998
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
999
|
+
*/
|
|
1000
|
+
const _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {
|
|
1001
|
+
// The only way to switch from HTML namespace to MathML
|
|
1002
|
+
// is via <math>. If it happens via any other tag, then
|
|
1003
|
+
// it should be killed.
|
|
1004
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
1005
|
+
return tagName === 'math';
|
|
1006
|
+
}
|
|
1007
|
+
// The only way to switch from SVG to MathML is via
|
|
1008
|
+
// <math> and HTML integration points
|
|
1009
|
+
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
1010
|
+
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
|
1011
|
+
}
|
|
1012
|
+
// We only allow elements that are defined in MathML
|
|
1013
|
+
// spec. All others are disallowed in MathML namespace.
|
|
1014
|
+
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
1015
|
+
};
|
|
1016
|
+
/**
|
|
1017
|
+
* Namespace rules for an element in the HTML namespace.
|
|
1018
|
+
*
|
|
1019
|
+
* @param tagName the element's lowercase tag name
|
|
1020
|
+
* @param parent the (possibly simulated) parent node
|
|
1021
|
+
* @param parentTagName the parent's lowercase tag name
|
|
1022
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
1023
|
+
*/
|
|
1024
|
+
const _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {
|
|
1025
|
+
// The only way to switch from SVG to HTML is via
|
|
1026
|
+
// HTML integration points, and from MathML to HTML
|
|
1027
|
+
// is via MathML text integration points
|
|
1028
|
+
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
|
1029
|
+
return false;
|
|
1030
|
+
}
|
|
1031
|
+
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
1032
|
+
return false;
|
|
1033
|
+
}
|
|
1034
|
+
// We disallow tags that are specific for MathML
|
|
1035
|
+
// or SVG and should never appear in HTML namespace
|
|
1036
|
+
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
1037
|
+
};
|
|
794
1038
|
/**
|
|
795
1039
|
* @param element a DOM element whose namespace is being checked
|
|
796
1040
|
* @returns Return false if the element has a
|
|
@@ -813,51 +1057,13 @@ var telerikReportViewer = (function (exports) {
|
|
|
813
1057
|
return false;
|
|
814
1058
|
}
|
|
815
1059
|
if (element.namespaceURI === SVG_NAMESPACE) {
|
|
816
|
-
|
|
817
|
-
// is via <svg>. If it happens via any other tag, then
|
|
818
|
-
// it should be killed.
|
|
819
|
-
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
820
|
-
return tagName === 'svg';
|
|
821
|
-
}
|
|
822
|
-
// The only way to switch from MathML to SVG is via`
|
|
823
|
-
// svg if parent is either <annotation-xml> or MathML
|
|
824
|
-
// text integration points.
|
|
825
|
-
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
826
|
-
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
827
|
-
}
|
|
828
|
-
// We only allow elements that are defined in SVG
|
|
829
|
-
// spec. All others are disallowed in SVG namespace.
|
|
830
|
-
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
1060
|
+
return _checkSvgNamespace(tagName, parent, parentTagName);
|
|
831
1061
|
}
|
|
832
1062
|
if (element.namespaceURI === MATHML_NAMESPACE) {
|
|
833
|
-
|
|
834
|
-
// is via <math>. If it happens via any other tag, then
|
|
835
|
-
// it should be killed.
|
|
836
|
-
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
837
|
-
return tagName === 'math';
|
|
838
|
-
}
|
|
839
|
-
// The only way to switch from SVG to MathML is via
|
|
840
|
-
// <math> and HTML integration points
|
|
841
|
-
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
842
|
-
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
|
843
|
-
}
|
|
844
|
-
// We only allow elements that are defined in MathML
|
|
845
|
-
// spec. All others are disallowed in MathML namespace.
|
|
846
|
-
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
1063
|
+
return _checkMathMlNamespace(tagName, parent, parentTagName);
|
|
847
1064
|
}
|
|
848
1065
|
if (element.namespaceURI === HTML_NAMESPACE) {
|
|
849
|
-
|
|
850
|
-
// HTML integration points, and from MathML to HTML
|
|
851
|
-
// is via MathML text integration points
|
|
852
|
-
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
|
853
|
-
return false;
|
|
854
|
-
}
|
|
855
|
-
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
856
|
-
return false;
|
|
857
|
-
}
|
|
858
|
-
// We disallow tags that are specific for MathML
|
|
859
|
-
// or SVG and should never appear in HTML namespace
|
|
860
|
-
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
1066
|
+
return _checkHtmlNamespace(tagName, parent, parentTagName);
|
|
861
1067
|
}
|
|
862
1068
|
// For XHTML and XML documents that support custom namespaces
|
|
863
1069
|
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
|
|
@@ -882,7 +1088,81 @@ var telerikReportViewer = (function (exports) {
|
|
|
882
1088
|
// eslint-disable-next-line unicorn/prefer-dom-node-remove
|
|
883
1089
|
getParentNode(node).removeChild(node);
|
|
884
1090
|
} catch (_) {
|
|
1091
|
+
/* The normal detach failed — this is reached for a parentless node
|
|
1092
|
+
(getParentNode() is null, so .removeChild throws). Element.prototype
|
|
1093
|
+
.remove() is itself a spec no-op on a parentless node, so a recorded
|
|
1094
|
+
"removal" would otherwise hand the caller back an intact,
|
|
1095
|
+
payload-bearing node (e.g. a detached IN_PLACE root the mXSS canary or
|
|
1096
|
+
the style-with-element-child rule decided to kill). Fail closed by
|
|
1097
|
+
throwing — exactly as a clobbered root does at the IN_PLACE entry —
|
|
1098
|
+
rather than trying to "neutralize" the node via its own methods.
|
|
1099
|
+
Neutralizing would mean calling getAttributeNames()/removeAttribute()
|
|
1100
|
+
on the node, both of which a <form> root can clobber via a named child
|
|
1101
|
+
(and _isClobbered does not even probe getAttributeNames), so the
|
|
1102
|
+
neutralize step could itself be silently defeated, leaving the payload
|
|
1103
|
+
intact. A throw touches only the cached, clobber-safe remove() and
|
|
1104
|
+
getParentNode(). Generalizes GHSA-r47g-fvhr-h676 (clobbered-form root)
|
|
1105
|
+
to every root-kill reason. REPORT-3.
|
|
1106
|
+
This lives inside the catch, so it never fires for a normally-removed
|
|
1107
|
+
in-tree node: those have a parent, removeChild() succeeds, and the
|
|
1108
|
+
catch is not entered. Only a kept (parentless) root reaches here. */
|
|
885
1109
|
remove(node);
|
|
1110
|
+
if (!getParentNode(node)) {
|
|
1111
|
+
throw typeErrorCreate('a node selected for removal could not be detached from its tree ' + 'and cannot be safely returned; refusing to sanitize in place');
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
};
|
|
1115
|
+
/**
|
|
1116
|
+
* _neutralizeRoot
|
|
1117
|
+
*
|
|
1118
|
+
* Fail-closed teardown of an in-place root after the sanitize walk aborts
|
|
1119
|
+
* (campaign-3 F2). An internal throw mid-walk — e.g. a page-registered
|
|
1120
|
+
* custom element's reaction detaches a node so `_forceRemove`'s deliberate
|
|
1121
|
+
* parentless guard throws, or any other re-entrant engine mutation — would
|
|
1122
|
+
* otherwise leave the caller's *live* tree half-sanitized, with everything
|
|
1123
|
+
* after the abort point still carrying its handlers. There is no safe way
|
|
1124
|
+
* to resume the walk (the tree mutated under us), so we strip the root bare:
|
|
1125
|
+
* remove every child and every attribute, then let the caller's catch see
|
|
1126
|
+
* the original error. Clobber-safe (cached `remove`/`childNodes`/`attributes`
|
|
1127
|
+
* getters; the root was already clobber-pre-flighted at the IN_PLACE entry).
|
|
1128
|
+
*
|
|
1129
|
+
* @param root the in-place root to empty
|
|
1130
|
+
*/
|
|
1131
|
+
const _neutralizeRoot = function _neutralizeRoot(root) {
|
|
1132
|
+
/* Strip every disallowed attribute (on* handlers included) off the whole
|
|
1133
|
+
subtree BEFORE detaching anything. Detaching first would hand back
|
|
1134
|
+
handler-bearing originals (e.g. an already-loading `<img onerror>`)
|
|
1135
|
+
whose queued resource event still fires in page scope after we throw.
|
|
1136
|
+
Clobber-safe reads; a doomed clobbered node's own attributes are
|
|
1137
|
+
irrelevant while its non-clobbered descendants are reached and scrubbed. */
|
|
1138
|
+
_neutralizeSubtree(root);
|
|
1139
|
+
const childNodes = getChildNodes(root);
|
|
1140
|
+
if (childNodes) {
|
|
1141
|
+
const snapshot = [];
|
|
1142
|
+
arrayForEach(childNodes, child => {
|
|
1143
|
+
arrayPush(snapshot, child);
|
|
1144
|
+
});
|
|
1145
|
+
arrayForEach(snapshot, child => {
|
|
1146
|
+
try {
|
|
1147
|
+
remove(child);
|
|
1148
|
+
} catch (_) {
|
|
1149
|
+
/* Best-effort teardown; a still-attached child is handled below */
|
|
1150
|
+
}
|
|
1151
|
+
});
|
|
1152
|
+
}
|
|
1153
|
+
const attributes = getAttributes(root);
|
|
1154
|
+
if (attributes) {
|
|
1155
|
+
for (let i = attributes.length - 1; i >= 0; --i) {
|
|
1156
|
+
const attribute = attributes[i];
|
|
1157
|
+
const name = attribute && attribute.name;
|
|
1158
|
+
if (typeof name === 'string') {
|
|
1159
|
+
try {
|
|
1160
|
+
root.removeAttribute(name);
|
|
1161
|
+
} catch (_) {
|
|
1162
|
+
/* Clobbered removeAttribute — ignore (fail-closed best effort) */
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
886
1166
|
}
|
|
887
1167
|
};
|
|
888
1168
|
/**
|
|
@@ -917,6 +1197,148 @@ var telerikReportViewer = (function (exports) {
|
|
|
917
1197
|
}
|
|
918
1198
|
}
|
|
919
1199
|
};
|
|
1200
|
+
/**
|
|
1201
|
+
* _stripDisallowedAttributes
|
|
1202
|
+
*
|
|
1203
|
+
* Removes every attribute the active configuration does not allow from a
|
|
1204
|
+
* single element, using the same allowlist as the main attribute pass (so
|
|
1205
|
+
* `on*` handlers go, but no `/^on/` blocklist is introduced). Used only to
|
|
1206
|
+
* neutralise nodes that are being discarded from an in-place tree.
|
|
1207
|
+
*
|
|
1208
|
+
* @param element the element to strip
|
|
1209
|
+
*/
|
|
1210
|
+
const _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {
|
|
1211
|
+
const attributes = getAttributes(element);
|
|
1212
|
+
if (!attributes) {
|
|
1213
|
+
return;
|
|
1214
|
+
}
|
|
1215
|
+
for (let i = attributes.length - 1; i >= 0; --i) {
|
|
1216
|
+
const attribute = attributes[i];
|
|
1217
|
+
const name = attribute && attribute.name;
|
|
1218
|
+
if (typeof name !== 'string' || ALLOWED_ATTR[transformCaseFunc(name)]) {
|
|
1219
|
+
continue;
|
|
1220
|
+
}
|
|
1221
|
+
try {
|
|
1222
|
+
element.removeAttribute(name);
|
|
1223
|
+
} catch (_) {
|
|
1224
|
+
/* Clobbered removeAttribute on a doomed node — ignore */
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
};
|
|
1228
|
+
/**
|
|
1229
|
+
* _neutralizeSubtree
|
|
1230
|
+
*
|
|
1231
|
+
* Completes the audit-5 F1 fix across every removal path. The KEEP_CONTENT
|
|
1232
|
+
* move-hoist neutralises only disallowed-tag removals; clobber, mXSS-canary,
|
|
1233
|
+
* namespace, comment, processing-instruction and KEEP_CONTENT:false removals
|
|
1234
|
+
* all drop their subtree wholesale via `_forceRemove`. On the IN_PLACE path
|
|
1235
|
+
* those dropped nodes are detached from the caller's LIVE tree but a
|
|
1236
|
+
* handler-bearing original among them (an `<img onerror>`/`<video>` that was
|
|
1237
|
+
* loading) keeps its queued resource event, which fires in page scope after
|
|
1238
|
+
* sanitize returns. This walks a removed subtree and strips every attribute
|
|
1239
|
+
* the active configuration does not allow — so `on*` handlers are cancelled
|
|
1240
|
+
* through the SAME allowlist that governs kept nodes, not a separate `/^on/`
|
|
1241
|
+
* blocklist. Run synchronously before sanitize returns, i.e. before any
|
|
1242
|
+
* queued event can fire. Hook-free by design: these nodes leave the output,
|
|
1243
|
+
* so firing attribute hooks for them would be surprising. Clobber-safe reads;
|
|
1244
|
+
* a doomed clobbered node may shadow `removeAttribute` (its own attributes are
|
|
1245
|
+
* irrelevant — it is discarded — while its non-clobbered descendants, e.g.
|
|
1246
|
+
* the `<img>`, are reached and scrubbed).
|
|
1247
|
+
*
|
|
1248
|
+
* @param root the root of a removed subtree to neutralise
|
|
1249
|
+
*/
|
|
1250
|
+
const _neutralizeSubtree = function _neutralizeSubtree(root) {
|
|
1251
|
+
const stack = [root];
|
|
1252
|
+
while (stack.length > 0) {
|
|
1253
|
+
const node = stack.pop();
|
|
1254
|
+
const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
|
|
1255
|
+
if (nodeType === NODE_TYPE.element) {
|
|
1256
|
+
_stripDisallowedAttributes(node);
|
|
1257
|
+
}
|
|
1258
|
+
const childNodes = getChildNodes(node);
|
|
1259
|
+
if (childNodes) {
|
|
1260
|
+
for (let i = childNodes.length - 1; i >= 0; --i) {
|
|
1261
|
+
stack.push(childNodes[i]);
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
};
|
|
1266
|
+
/**
|
|
1267
|
+
* _neutralizePatchLinkage
|
|
1268
|
+
*
|
|
1269
|
+
* IN_PLACE entry pre-pass (declarative-partial-updates / streaming
|
|
1270
|
+
* hardening, https://github.com/WICG/declarative-partial-updates).
|
|
1271
|
+
*
|
|
1272
|
+
* The main walk strips patch linkage (`for`/`patchsrc`) and removes range
|
|
1273
|
+
* markers (PIs / markup comments) node-by-node, in document order, AS it
|
|
1274
|
+
* reaches each node. On a live in-place root that leaves a window: from the
|
|
1275
|
+
* moment the root is connected until the walk arrives at a given node, that
|
|
1276
|
+
* node's linkage is live. A patch applied on connection/stream can fire as
|
|
1277
|
+
* a microtask during the walk and inject or teleport an unsanitized DOM
|
|
1278
|
+
* range into a region the iterator has already passed and will not revisit,
|
|
1279
|
+
* so the post-return "tree is sanitized" contract is violated. Sweep the
|
|
1280
|
+
* whole tree once up front and sever every linkage before the walk begins,
|
|
1281
|
+
* closing that window.
|
|
1282
|
+
*
|
|
1283
|
+
* This CANNOT undo a patch that already fired before sanitize ran — that is
|
|
1284
|
+
* the irreducible "do not IN_PLACE a live-connected attacker tree" caveat —
|
|
1285
|
+
* but it closes everything from sanitize-start onward. Gated on SAFE_FOR_XML
|
|
1286
|
+
* to group with the rest of the declarative-partial-updates handling and
|
|
1287
|
+
* stay overridable, consistent with the codebase.
|
|
1288
|
+
*
|
|
1289
|
+
* Clobber-safe traversal (cached childNodes getter); per-node try/catch so a
|
|
1290
|
+
* clobbered root cannot defeat the sweep of its non-clobbered descendants.
|
|
1291
|
+
*
|
|
1292
|
+
* NOTE (pending real-Chrome confirmation, see test/declarative-patch-probe
|
|
1293
|
+
* .html Q1): this mirrors the existing policy of keeping `for` on
|
|
1294
|
+
* <label>/<output>. If the shipping feature can drive a patch through a
|
|
1295
|
+
* surviving `for`-on-label/output + `id` pair, this pre-pass and the
|
|
1296
|
+
* attribute check at _isBasicCustomElement's caller must additionally drop
|
|
1297
|
+
* that pair on the IN_PLACE path. Left as-is until the taxonomy is verified.
|
|
1298
|
+
*
|
|
1299
|
+
* @param root the in-place root to sweep
|
|
1300
|
+
*/
|
|
1301
|
+
const _neutralizePatchLinkage = function _neutralizePatchLinkage(root) {
|
|
1302
|
+
if (!SAFE_FOR_XML) {
|
|
1303
|
+
return;
|
|
1304
|
+
}
|
|
1305
|
+
const stack = [root];
|
|
1306
|
+
while (stack.length > 0) {
|
|
1307
|
+
const node = stack.pop();
|
|
1308
|
+
const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
|
|
1309
|
+
/* Remove range markers (the target side of a patch linkage): every
|
|
1310
|
+
processing instruction, and any markup-bearing comment. */
|
|
1311
|
+
if (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {
|
|
1312
|
+
try {
|
|
1313
|
+
remove(node);
|
|
1314
|
+
} catch (_) {
|
|
1315
|
+
/* Best-effort */
|
|
1316
|
+
}
|
|
1317
|
+
continue;
|
|
1318
|
+
}
|
|
1319
|
+
/* Strip patch-source attributes (the source side) off elements. */
|
|
1320
|
+
if (nodeType === NODE_TYPE.element) {
|
|
1321
|
+
const element = node;
|
|
1322
|
+
const lcTag = transformCaseFunc(getNodeName ? getNodeName(node) : node.nodeName);
|
|
1323
|
+
try {
|
|
1324
|
+
if (element.hasAttribute && element.hasAttribute('patchsrc')) {
|
|
1325
|
+
element.removeAttribute('patchsrc');
|
|
1326
|
+
}
|
|
1327
|
+
if (element.hasAttribute && element.hasAttribute('for') && lcTag !== 'label' && lcTag !== 'output') {
|
|
1328
|
+
element.removeAttribute('for');
|
|
1329
|
+
}
|
|
1330
|
+
} catch (_) {
|
|
1331
|
+
/* Clobbered removeAttribute/hasAttribute on a doomed node — ignore */
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
const childNodes = getChildNodes(node);
|
|
1335
|
+
if (childNodes) {
|
|
1336
|
+
for (let i = childNodes.length - 1; i >= 0; --i) {
|
|
1337
|
+
stack.push(childNodes[i]);
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
};
|
|
920
1342
|
/**
|
|
921
1343
|
* _initDocument
|
|
922
1344
|
*
|
|
@@ -938,7 +1360,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
938
1360
|
// Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
|
|
939
1361
|
dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
|
|
940
1362
|
}
|
|
941
|
-
const dirtyPayload = trustedTypesPolicy ?
|
|
1363
|
+
const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;
|
|
942
1364
|
/*
|
|
943
1365
|
* Use the DOMParser API by default, fallback later if needs be
|
|
944
1366
|
* DOMParser not work for svg when has multiple root element.
|
|
@@ -978,29 +1400,260 @@ var telerikReportViewer = (function (exports) {
|
|
|
978
1400
|
// eslint-disable-next-line no-bitwise
|
|
979
1401
|
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
|
|
980
1402
|
};
|
|
1403
|
+
/**
|
|
1404
|
+
* Replace template expression syntax (mustache, ERB, template
|
|
1405
|
+
* literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub
|
|
1406
|
+
* sites. Order matters: mustache, then ERB, then template literal.
|
|
1407
|
+
*
|
|
1408
|
+
* @param value the string to scrub
|
|
1409
|
+
* @returns the scrubbed string
|
|
1410
|
+
*/
|
|
1411
|
+
const _stripTemplateExpressions = function _stripTemplateExpressions(value) {
|
|
1412
|
+
value = stringReplace(value, MUSTACHE_EXPR$1, ' ');
|
|
1413
|
+
value = stringReplace(value, ERB_EXPR$1, ' ');
|
|
1414
|
+
value = stringReplace(value, TMPLIT_EXPR$1, ' ');
|
|
1415
|
+
return value;
|
|
1416
|
+
};
|
|
1417
|
+
/**
|
|
1418
|
+
* Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the
|
|
1419
|
+
* character data of an element subtree. Used as the final safety net for
|
|
1420
|
+
* SAFE_FOR_TEMPLATES on every DOM-returning code path so that expressions
|
|
1421
|
+
* which only form after text-node normalization (e.g. fragments split across
|
|
1422
|
+
* stripped elements) cannot survive into a template-evaluating framework.
|
|
1423
|
+
*
|
|
1424
|
+
* Walks text/comment/CDATA/processing-instruction nodes and mutates `.data`
|
|
1425
|
+
* in place rather than round-tripping through innerHTML. This preserves
|
|
1426
|
+
* descendant node references (important for IN_PLACE callers), avoids a
|
|
1427
|
+
* serialize/reparse cycle, and reads literal character data — which means
|
|
1428
|
+
* `<%...%>` in text content matches the ERB regex against its real bytes
|
|
1429
|
+
* instead of the HTML-entity-escaped form innerHTML would produce.
|
|
1430
|
+
*
|
|
1431
|
+
* Attribute values are not visited here; SAFE_FOR_TEMPLATES handling for
|
|
1432
|
+
* attributes is performed during the per-node `_sanitizeAttributes` pass.
|
|
1433
|
+
*
|
|
1434
|
+
* @param node The root element whose character data should be scrubbed.
|
|
1435
|
+
*/
|
|
1436
|
+
const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {
|
|
1437
|
+
var _node$querySelectorAl;
|
|
1438
|
+
node.normalize();
|
|
1439
|
+
const walker = createNodeIterator.call(node.ownerDocument || node, node,
|
|
1440
|
+
// eslint-disable-next-line no-bitwise
|
|
1441
|
+
NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
|
|
1442
|
+
let currentNode = walker.nextNode();
|
|
1443
|
+
while (currentNode) {
|
|
1444
|
+
currentNode.data = _stripTemplateExpressions(currentNode.data);
|
|
1445
|
+
currentNode = walker.nextNode();
|
|
1446
|
+
}
|
|
1447
|
+
// NodeIterator does not descend into <template>.content per the DOM spec,
|
|
1448
|
+
// so we must explicitly recurse into each template's content fragment,
|
|
1449
|
+
// mirroring the approach used by _sanitizeShadowDOM.
|
|
1450
|
+
const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, 'template');
|
|
1451
|
+
if (templates) {
|
|
1452
|
+
arrayForEach(templates, tmpl => {
|
|
1453
|
+
if (_isDocumentFragment(tmpl.content)) {
|
|
1454
|
+
_scrubTemplateExpressions2(tmpl.content);
|
|
1455
|
+
}
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1458
|
+
};
|
|
981
1459
|
/**
|
|
982
1460
|
* _isClobbered
|
|
983
1461
|
*
|
|
1462
|
+
* Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML
|
|
1463
|
+
* interface with [LegacyOverrideBuiltIns]; a descendant element with a
|
|
1464
|
+
* `name` attribute matching a prototype property shadows that property
|
|
1465
|
+
* on direct reads. We use this check at the IN_PLACE entry-point and
|
|
1466
|
+
* during attribute sanitization to refuse clobbered forms.
|
|
1467
|
+
*
|
|
984
1468
|
* @param element element to check for clobbering attacks
|
|
985
1469
|
* @return true if clobbered, false if safe
|
|
986
1470
|
*/
|
|
987
1471
|
const _isClobbered = function _isClobbered(element) {
|
|
988
|
-
|
|
1472
|
+
// Realm-independent tag-name probe. If we can't determine the tag
|
|
1473
|
+
// name at all, we can't reason about clobbering — return false
|
|
1474
|
+
// (the caller's other defences still apply).
|
|
1475
|
+
const realTagName = getNodeName ? getNodeName(element) : null;
|
|
1476
|
+
if (typeof realTagName !== 'string') {
|
|
1477
|
+
return false;
|
|
1478
|
+
}
|
|
1479
|
+
if (transformCaseFunc(realTagName) !== 'form') {
|
|
1480
|
+
return false;
|
|
1481
|
+
}
|
|
1482
|
+
return typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' ||
|
|
1483
|
+
// Realm-safe NamedNodeMap detection: equality against the cached
|
|
1484
|
+
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
1485
|
+
// makes the direct read diverge from the cached read; a clean form
|
|
1486
|
+
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
1487
|
+
// canonical NamedNodeMap.
|
|
1488
|
+
element.attributes !== getAttributes(element) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function' ||
|
|
1489
|
+
// NodeType clobbering probe. Cached Node.prototype.nodeType getter
|
|
1490
|
+
// returns the integer 1 for any Element regardless of realm; direct
|
|
1491
|
+
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
1492
|
+
// the named child element. Cheap addition — nodeType is read from
|
|
1493
|
+
// an internal slot, no serialization cost — and removes a residual
|
|
1494
|
+
// clobbering surface used by several mXSS / PI / comment branches
|
|
1495
|
+
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
1496
|
+
element.nodeType !== getNodeType(element) ||
|
|
1497
|
+
// HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
1498
|
+
// "childNodes" shadows the prototype getter. Direct reads of
|
|
1499
|
+
// form.childNodes from a clobbered form return the named child
|
|
1500
|
+
// instead of the real NodeList, so any walk that reads it directly
|
|
1501
|
+
// skips the form's real children. Compare the direct read to the
|
|
1502
|
+
// cached Node.prototype getter — when the form's named-property
|
|
1503
|
+
// getter intercepts the read, the two values differ and we flag
|
|
1504
|
+
// the form. This catches every clobbering child type (input,
|
|
1505
|
+
// select, etc.) regardless of whether the named child happens to
|
|
1506
|
+
// carry a numeric .length, which a typeof-based probe would miss
|
|
1507
|
+
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
1508
|
+
element.childNodes !== getChildNodes(element);
|
|
989
1509
|
};
|
|
990
1510
|
/**
|
|
991
|
-
* Checks whether the given
|
|
1511
|
+
* Checks whether the given value is a DocumentFragment from any realm.
|
|
1512
|
+
*
|
|
1513
|
+
* The realm-independent replacement reads `nodeType` through the cached
|
|
1514
|
+
* Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE
|
|
1515
|
+
* constant (11). nodeType is a numeric value resolved from the node's
|
|
1516
|
+
* internal slot, identical across realms for the same kind of node.
|
|
1517
|
+
*
|
|
1518
|
+
* @param value object to check
|
|
1519
|
+
* @return true if value is a DocumentFragment-shaped node from any realm
|
|
1520
|
+
*/
|
|
1521
|
+
const _isDocumentFragment = function _isDocumentFragment(value) {
|
|
1522
|
+
if (!getNodeType || typeof value !== 'object' || value === null) {
|
|
1523
|
+
return false;
|
|
1524
|
+
}
|
|
1525
|
+
try {
|
|
1526
|
+
return getNodeType(value) === NODE_TYPE.documentFragment;
|
|
1527
|
+
} catch (_) {
|
|
1528
|
+
return false;
|
|
1529
|
+
}
|
|
1530
|
+
};
|
|
1531
|
+
/**
|
|
1532
|
+
* Checks whether the given object is a DOM node, including nodes that
|
|
1533
|
+
* originate from a different window/realm (e.g. an iframe's
|
|
1534
|
+
* contentDocument). The previous `value instanceof Node` check was
|
|
1535
|
+
* realm-bound: nodes from a different window failed it, causing
|
|
1536
|
+
* sanitize() to silently stringify them and reset IN_PLACE to false,
|
|
1537
|
+
* returning the original node unsanitized. See GHSA-4w3q-35jp-p934.
|
|
992
1538
|
*
|
|
993
1539
|
* @param value object to check whether it's a DOM node
|
|
994
|
-
* @return true
|
|
1540
|
+
* @return true if value is a DOM node from any realm
|
|
995
1541
|
*/
|
|
996
1542
|
const _isNode = function _isNode(value) {
|
|
997
|
-
|
|
1543
|
+
if (!getNodeType || typeof value !== 'object' || value === null) {
|
|
1544
|
+
return false;
|
|
1545
|
+
}
|
|
1546
|
+
try {
|
|
1547
|
+
return typeof getNodeType(value) === 'number';
|
|
1548
|
+
} catch (_) {
|
|
1549
|
+
return false;
|
|
1550
|
+
}
|
|
998
1551
|
};
|
|
999
1552
|
function _executeHooks(hooks, currentNode, data) {
|
|
1553
|
+
if (hooks.length === 0) {
|
|
1554
|
+
return;
|
|
1555
|
+
}
|
|
1000
1556
|
arrayForEach(hooks, hook => {
|
|
1001
1557
|
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
1002
1558
|
});
|
|
1003
1559
|
}
|
|
1560
|
+
/**
|
|
1561
|
+
* Structural-threat checks that condemn a node regardless of the
|
|
1562
|
+
* allowlists: mXSS via namespace confusion, risky CSS construction,
|
|
1563
|
+
* processing instructions, markup-bearing comments. Pure predicate;
|
|
1564
|
+
* the caller removes. Check order is load-bearing.
|
|
1565
|
+
*
|
|
1566
|
+
* @param currentNode the node to inspect
|
|
1567
|
+
* @param tagName the node's transformCaseFunc'd tag name
|
|
1568
|
+
* @return true if the node must be removed
|
|
1569
|
+
*/
|
|
1570
|
+
const _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {
|
|
1571
|
+
/* Detect mXSS attempts abusing namespace confusion */
|
|
1572
|
+
if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) {
|
|
1573
|
+
return true;
|
|
1574
|
+
}
|
|
1575
|
+
/* Remove risky CSS construction leading to mXSS */
|
|
1576
|
+
if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === 'style' && _isNode(currentNode.firstElementChild)) {
|
|
1577
|
+
return true;
|
|
1578
|
+
}
|
|
1579
|
+
/* Remove any occurrence of processing instructions */
|
|
1580
|
+
if (currentNode.nodeType === NODE_TYPE.processingInstruction) {
|
|
1581
|
+
return true;
|
|
1582
|
+
}
|
|
1583
|
+
/* Remove any kind of possibly harmful comments */
|
|
1584
|
+
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) {
|
|
1585
|
+
return true;
|
|
1586
|
+
}
|
|
1587
|
+
return false;
|
|
1588
|
+
};
|
|
1589
|
+
/**
|
|
1590
|
+
* Handle a node whose tag is forbidden or not allowlisted: keep
|
|
1591
|
+
* allowed custom elements (false return exits _sanitizeElements
|
|
1592
|
+
* early - the namespace and fallback-tag removal checks are
|
|
1593
|
+
* intentionally skipped for kept custom elements), else hoist
|
|
1594
|
+
* content per KEEP_CONTENT and remove.
|
|
1595
|
+
*
|
|
1596
|
+
* A kept custom element is the ONLY case in which this function
|
|
1597
|
+
* returns false, so the caller uses that return value to run the
|
|
1598
|
+
* afterSanitizeElements hook on the kept element and keep the
|
|
1599
|
+
* element-hook lifecycle consistent with normal allowlisted
|
|
1600
|
+
* elements (GHSA-c2j3-45gr-mqc4).
|
|
1601
|
+
*
|
|
1602
|
+
* @param currentNode the disallowed node
|
|
1603
|
+
* @param tagName the node's transformCaseFunc'd tag name
|
|
1604
|
+
* @return true if the node was removed, false if kept
|
|
1605
|
+
*/
|
|
1606
|
+
const _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName) {
|
|
1607
|
+
/* Check if we have a custom element to handle */
|
|
1608
|
+
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
|
1609
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
|
1610
|
+
return false;
|
|
1611
|
+
}
|
|
1612
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
|
|
1613
|
+
return false;
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
/* Keep content except for bad-listed elements.
|
|
1617
|
+
Use the cached prototype getters exclusively — the previous code
|
|
1618
|
+
had `|| currentNode.parentNode` / `|| currentNode.childNodes`
|
|
1619
|
+
fallbacks, but the cached getters always return the canonical
|
|
1620
|
+
value (or null for a real parent-less node), so the fallback
|
|
1621
|
+
path was dead in safe cases and a clobbering surface in unsafe
|
|
1622
|
+
ones. Falsy cached results stay falsy; the `if (childNodes &&
|
|
1623
|
+
parentNode)` check already gates correctly. */
|
|
1624
|
+
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
1625
|
+
const parentNode = getParentNode(currentNode);
|
|
1626
|
+
const childNodes = getChildNodes(currentNode);
|
|
1627
|
+
if (childNodes && parentNode) {
|
|
1628
|
+
const childCount = childNodes.length;
|
|
1629
|
+
/* In-place: hoist the *original* children so the iterator visits
|
|
1630
|
+
and sanitises them through the same allowlist pass as every other
|
|
1631
|
+
node. The caller built the tree in the live document, so the
|
|
1632
|
+
originals carry already-queued resource events (`<img onerror>`,
|
|
1633
|
+
`<video>`/`<audio>` error, lazy/`onload`, …); cloning would leave
|
|
1634
|
+
those originals detached but still armed, firing in page scope
|
|
1635
|
+
while the returned tree looked clean. Moving is safe in-place: the
|
|
1636
|
+
root is pre-validated as an allowed tag and so is never the node
|
|
1637
|
+
being removed, which keeps `parentNode` inside the iterator root
|
|
1638
|
+
and the relocated child inside the serialised tree.
|
|
1639
|
+
Otherwise (string / DOM-copy paths): clone. The iterator is rooted
|
|
1640
|
+
at — and the result serialised from — `body`, so a restrictive
|
|
1641
|
+
ALLOWED_TAGS that removes `body` itself must leave its content in
|
|
1642
|
+
place, which only cloning does; and those paths parse into an
|
|
1643
|
+
inert document, so their discarded originals never had a queued
|
|
1644
|
+
event to neutralise.
|
|
1645
|
+
`childNodes` is live; a tail-to-head walk keeps `childNodes[i]`
|
|
1646
|
+
valid whether we move (drops the trailing entry) or clone (leaves
|
|
1647
|
+
the list intact). */
|
|
1648
|
+
for (let i = childCount - 1; i >= 0; --i) {
|
|
1649
|
+
const hoisted = IN_PLACE ? childNodes[i] : cloneNode(childNodes[i], true);
|
|
1650
|
+
parentNode.insertBefore(hoisted, getNextSibling(currentNode));
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
_forceRemove(currentNode);
|
|
1655
|
+
return true;
|
|
1656
|
+
};
|
|
1004
1657
|
/**
|
|
1005
1658
|
* _sanitizeElements
|
|
1006
1659
|
*
|
|
@@ -1010,85 +1663,89 @@ var telerikReportViewer = (function (exports) {
|
|
|
1010
1663
|
* @param currentNode to check for permission to exist
|
|
1011
1664
|
* @return true if node was killed, false if left alive
|
|
1012
1665
|
*/
|
|
1013
|
-
|
|
1014
|
-
|
|
1666
|
+
// eslint-disable-next-line complexity
|
|
1667
|
+
const _sanitizeElements = function _sanitizeElements(currentNode, root) {
|
|
1015
1668
|
/* Execute a hook if present */
|
|
1016
1669
|
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
|
1670
|
+
/* A hook may have detached the node — treat it as removed (see the
|
|
1671
|
+
detached-node comment after the uponSanitizeElement hook below). */
|
|
1672
|
+
if (currentNode !== root && getParentNode(currentNode) === null) {
|
|
1673
|
+
return true;
|
|
1674
|
+
}
|
|
1017
1675
|
/* Check if element is clobbered or can clobber */
|
|
1018
1676
|
if (_isClobbered(currentNode)) {
|
|
1019
1677
|
_forceRemove(currentNode);
|
|
1020
1678
|
return true;
|
|
1021
1679
|
}
|
|
1022
1680
|
/* Now let's check the element's type and name */
|
|
1023
|
-
const tagName = transformCaseFunc(currentNode.nodeName);
|
|
1681
|
+
const tagName = transformCaseFunc(getNodeName ? getNodeName(currentNode) : currentNode.nodeName);
|
|
1024
1682
|
/* Execute a hook if present */
|
|
1025
1683
|
_executeHooks(hooks.uponSanitizeElement, currentNode, {
|
|
1026
1684
|
tagName,
|
|
1027
1685
|
allowedTags: ALLOWED_TAGS
|
|
1028
1686
|
});
|
|
1029
|
-
/*
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1687
|
+
/* A hook may have detached the node from the tree — a long-standing
|
|
1688
|
+
user pattern (issue #469; draw.io-style foreignObject filtering).
|
|
1689
|
+
Per the cached, unclobberable parentNode getter the node is
|
|
1690
|
+
genuinely out of the tree, so it can reach neither the serialized
|
|
1691
|
+
output nor an IN_PLACE live tree; treat it as removed and stop
|
|
1692
|
+
processing it. Without this guard, the unsafe-node / namespace
|
|
1693
|
+
checks below would call _forceRemove on a parentless node and hit
|
|
1694
|
+
the REPORT-3 fail-closed throw — which exists for nodes DOMPurify
|
|
1695
|
+
wants gone but *cannot* detach (clobbered / parentless roots), the
|
|
1696
|
+
opposite of a node that is already safely gone. The walk root is
|
|
1697
|
+
exempt: a detached IN_PLACE root is legitimate input and must still
|
|
1698
|
+
be fully sanitized, and a kill-decision on it must keep hitting the
|
|
1699
|
+
REPORT-3 throw. Nodes detached by hooks are the hook's
|
|
1700
|
+
responsibility: they are not recorded in DOMPurify.removed and are
|
|
1701
|
+
not neutralized by the post-walk IN_PLACE pass. */
|
|
1702
|
+
if (currentNode !== root && getParentNode(currentNode) === null) {
|
|
1037
1703
|
return true;
|
|
1038
1704
|
}
|
|
1039
|
-
/* Remove
|
|
1040
|
-
if (currentNode
|
|
1041
|
-
_forceRemove(currentNode);
|
|
1042
|
-
return true;
|
|
1043
|
-
}
|
|
1044
|
-
/* Remove any kind of possibly harmful comments */
|
|
1045
|
-
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
|
|
1705
|
+
/* Remove mXSS vectors, processing instructions and risky comments */
|
|
1706
|
+
if (_isUnsafeNode(currentNode, tagName)) {
|
|
1046
1707
|
_forceRemove(currentNode);
|
|
1047
1708
|
return true;
|
|
1048
1709
|
}
|
|
1049
1710
|
/* Remove element if anything forbids its presence */
|
|
1050
1711
|
if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1712
|
+
const removed = _sanitizeDisallowedNode(currentNode, tagName);
|
|
1713
|
+
/* A false return means the node is a custom element kept via
|
|
1714
|
+
CUSTOM_ELEMENT_HANDLING - the only keep path through
|
|
1715
|
+
_sanitizeDisallowedNode. Run afterSanitizeElements on it so the
|
|
1716
|
+
element-hook lifecycle matches normal allowlisted elements: a
|
|
1717
|
+
security policy applied in this hook (e.g. stripping an attribute
|
|
1718
|
+
from every surviving element) must not silently skip kept custom
|
|
1719
|
+
elements (GHSA-c2j3-45gr-mqc4). This mirrors the normal-element
|
|
1720
|
+
tail below - the hook runs, then the walker's subsequent
|
|
1721
|
+
_sanitizeAttributes pass sanitizes the element's attributes. The
|
|
1722
|
+
deliberately skipped namespace and fallback-tag removal checks stay
|
|
1723
|
+
skipped; they are removal decisions, not the hook contract. */
|
|
1724
|
+
if (removed === false) {
|
|
1725
|
+
_executeHooks(hooks.afterSanitizeElements, currentNode, null);
|
|
1059
1726
|
}
|
|
1060
|
-
|
|
1061
|
-
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
1062
|
-
const parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
|
1063
|
-
const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
|
|
1064
|
-
if (childNodes && parentNode) {
|
|
1065
|
-
const childCount = childNodes.length;
|
|
1066
|
-
for (let i = childCount - 1; i >= 0; --i) {
|
|
1067
|
-
const childClone = cloneNode(childNodes[i], true);
|
|
1068
|
-
parentNode.insertBefore(childClone, getNextSibling(currentNode));
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
_forceRemove(currentNode);
|
|
1073
|
-
return true;
|
|
1727
|
+
return removed;
|
|
1074
1728
|
}
|
|
1075
|
-
/* Check whether element has a valid namespace
|
|
1076
|
-
|
|
1729
|
+
/* Check whether element has a valid namespace.
|
|
1730
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): use the cached Node.prototype
|
|
1731
|
+
nodeType getter rather than `instanceof Element`, which is realm-
|
|
1732
|
+
bound and short-circuits to false for any node minted in a different
|
|
1733
|
+
realm — letting a foreign-realm element with a forbidden namespace
|
|
1734
|
+
slip past the namespace check entirely. */
|
|
1735
|
+
const nt = getNodeType ? getNodeType(currentNode) : currentNode.nodeType;
|
|
1736
|
+
if (nt === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {
|
|
1077
1737
|
_forceRemove(currentNode);
|
|
1078
1738
|
return true;
|
|
1079
1739
|
}
|
|
1080
1740
|
/* Make sure that older browsers don't get fallback-tag mXSS */
|
|
1081
|
-
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(
|
|
1741
|
+
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {
|
|
1082
1742
|
_forceRemove(currentNode);
|
|
1083
1743
|
return true;
|
|
1084
1744
|
}
|
|
1085
1745
|
/* Sanitize element content to be template-safe */
|
|
1086
1746
|
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
|
|
1087
1747
|
/* Get the element's text content */
|
|
1088
|
-
content = currentNode.textContent;
|
|
1089
|
-
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
|
1090
|
-
content = stringReplace(content, expr, ' ');
|
|
1091
|
-
});
|
|
1748
|
+
const content = _stripTemplateExpressions(currentNode.textContent);
|
|
1092
1749
|
if (currentNode.textContent !== content) {
|
|
1093
1750
|
arrayPush(DOMPurify.removed, {
|
|
1094
1751
|
element: currentNode.cloneNode()
|
|
@@ -1114,6 +1771,33 @@ var telerikReportViewer = (function (exports) {
|
|
|
1114
1771
|
if (FORBID_ATTR[lcName]) {
|
|
1115
1772
|
return false;
|
|
1116
1773
|
}
|
|
1774
|
+
/* Reject declarative-partial-updates patch-linkage attributes
|
|
1775
|
+
(https://github.com/WICG/declarative-partial-updates).
|
|
1776
|
+
Empirical note (Chrome 150, verified — see
|
|
1777
|
+
test/declarative-patch-probe-v3.html): expansion is NOT applied after
|
|
1778
|
+
sanitization. For the string path it fires during sanitize()'s own
|
|
1779
|
+
parse, so the walk sees and sanitizes the fully materialized expanded
|
|
1780
|
+
tree — teleports into MathML/SVG integration points included; a
|
|
1781
|
+
weaponized `<template for>`->`<img onerror>` comes back with the handler
|
|
1782
|
+
stripped. For the IN_PLACE path it fires on connection, before the walk.
|
|
1783
|
+
Either way DOMPurify is NOT blind to the patch.
|
|
1784
|
+
This removal is therefore defense-in-depth rather than the sole barrier:
|
|
1785
|
+
it prevents live linkage from surviving into the OUTPUT and re-expanding
|
|
1786
|
+
in the caller's context, and keeps behaviour deterministic if a future
|
|
1787
|
+
engine defers expansion. `for` is legitimate only on <label>/<output>;
|
|
1788
|
+
anywhere else (notably <template for>) it links the element to a patch
|
|
1789
|
+
target and teleports or removes an arbitrary DOM range by id/marker name.
|
|
1790
|
+
`patchsrc` fetches remote markup and is treated as a script-loading
|
|
1791
|
+
mechanism (CSP). Gated on SAFE_FOR_XML so the removal groups with the
|
|
1792
|
+
other structural-threat checks and stays overridable, consistent with
|
|
1793
|
+
the rest of the codebase. PI range markers are already removed by
|
|
1794
|
+
_isUnsafeNode. */
|
|
1795
|
+
if (SAFE_FOR_XML && lcName === 'patchsrc') {
|
|
1796
|
+
return false;
|
|
1797
|
+
}
|
|
1798
|
+
if (SAFE_FOR_XML && lcName === 'for' && lcTag !== 'label' && lcTag !== 'output') {
|
|
1799
|
+
return false;
|
|
1800
|
+
}
|
|
1117
1801
|
/* Make sure attribute cannot clobber */
|
|
1118
1802
|
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
|
|
1119
1803
|
return false;
|
|
@@ -1123,7 +1807,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
1123
1807
|
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
|
1124
1808
|
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
|
1125
1809
|
We don't need to check the value; it's always URI safe. */
|
|
1126
|
-
if (ALLOW_DATA_ATTR &&
|
|
1810
|
+
if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) ; else if (!nameIsPermitted) {
|
|
1127
1811
|
if (
|
|
1128
1812
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
1129
1813
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
@@ -1135,7 +1819,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
1135
1819
|
return false;
|
|
1136
1820
|
}
|
|
1137
1821
|
/* Check value is safe. First, is attr inert? If so, is safe */
|
|
1138
|
-
} 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) {
|
|
1822
|
+
} else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, ''))) ; 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$1, stringReplace(value, ATTR_WHITESPACE$1, ''))) ; else if (value) {
|
|
1139
1823
|
return false;
|
|
1140
1824
|
} else ;
|
|
1141
1825
|
return true;
|
|
@@ -1153,7 +1837,64 @@ var telerikReportViewer = (function (exports) {
|
|
|
1153
1837
|
* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
|
|
1154
1838
|
*/
|
|
1155
1839
|
const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
|
|
1156
|
-
return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT, tagName);
|
|
1840
|
+
return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);
|
|
1841
|
+
};
|
|
1842
|
+
/**
|
|
1843
|
+
* Wrap an attribute value in the matching Trusted Types object when
|
|
1844
|
+
* the active policy requires it. Namespaced attributes pass through
|
|
1845
|
+
* unchanged (no TT support yet, see
|
|
1846
|
+
* https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).
|
|
1847
|
+
*
|
|
1848
|
+
* @param lcTag lowercase tag name of the containing element
|
|
1849
|
+
* @param lcName lowercase attribute name
|
|
1850
|
+
* @param namespaceURI the attribute's namespace, if any
|
|
1851
|
+
* @param value the attribute value to wrap
|
|
1852
|
+
* @return the value, wrapped when Trusted Types demand it
|
|
1853
|
+
*/
|
|
1854
|
+
const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {
|
|
1855
|
+
if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function' && !namespaceURI) {
|
|
1856
|
+
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
1857
|
+
case 'TrustedHTML':
|
|
1858
|
+
{
|
|
1859
|
+
return _createTrustedHTML(value);
|
|
1860
|
+
}
|
|
1861
|
+
case 'TrustedScriptURL':
|
|
1862
|
+
{
|
|
1863
|
+
return _createTrustedScriptURL(value);
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
return value;
|
|
1868
|
+
};
|
|
1869
|
+
/**
|
|
1870
|
+
* Write a modified attribute value back onto the element. On
|
|
1871
|
+
* success, re-probe for clobbering introduced by the new value and
|
|
1872
|
+
* remove the element when found; otherwise pop the removal entry
|
|
1873
|
+
* recorded by the earlier _removeAttribute (long-standing pairing
|
|
1874
|
+
* with the SANITIZE_NAMED_PROPS path - do not "fix" casually). On
|
|
1875
|
+
* failure, remove the attribute instead.
|
|
1876
|
+
*
|
|
1877
|
+
* @param currentNode the element carrying the attribute
|
|
1878
|
+
* @param name the attribute name as present on the element
|
|
1879
|
+
* @param namespaceURI the attribute's namespace, if any
|
|
1880
|
+
* @param value the new attribute value
|
|
1881
|
+
*/
|
|
1882
|
+
const _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {
|
|
1883
|
+
try {
|
|
1884
|
+
if (namespaceURI) {
|
|
1885
|
+
currentNode.setAttributeNS(namespaceURI, name, value);
|
|
1886
|
+
} else {
|
|
1887
|
+
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
|
1888
|
+
currentNode.setAttribute(name, value);
|
|
1889
|
+
}
|
|
1890
|
+
if (_isClobbered(currentNode)) {
|
|
1891
|
+
_forceRemove(currentNode);
|
|
1892
|
+
} else {
|
|
1893
|
+
arrayPop(DOMPurify.removed);
|
|
1894
|
+
}
|
|
1895
|
+
} catch (_) {
|
|
1896
|
+
_removeAttribute(name, currentNode);
|
|
1897
|
+
}
|
|
1157
1898
|
};
|
|
1158
1899
|
/**
|
|
1159
1900
|
* _sanitizeAttributes
|
|
@@ -1168,9 +1909,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
1168
1909
|
const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
|
|
1169
1910
|
/* Execute a hook if present */
|
|
1170
1911
|
_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
|
|
1171
|
-
const
|
|
1172
|
-
attributes
|
|
1173
|
-
} = currentNode;
|
|
1912
|
+
const attributes = currentNode.attributes;
|
|
1174
1913
|
/* Check if we have attributes; if not we might have a text node */
|
|
1175
1914
|
if (!attributes || _isClobbered(currentNode)) {
|
|
1176
1915
|
return;
|
|
@@ -1183,14 +1922,13 @@ var telerikReportViewer = (function (exports) {
|
|
|
1183
1922
|
forceKeepAttr: undefined
|
|
1184
1923
|
};
|
|
1185
1924
|
let l = attributes.length;
|
|
1925
|
+
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
1186
1926
|
/* Go backwards over all attributes; safely remove bad ones */
|
|
1187
1927
|
while (l--) {
|
|
1188
1928
|
const attr = attributes[l];
|
|
1189
|
-
const
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
value: attrValue
|
|
1193
|
-
} = attr;
|
|
1929
|
+
const name = attr.name,
|
|
1930
|
+
namespaceURI = attr.namespaceURI,
|
|
1931
|
+
attrValue = attr.value;
|
|
1194
1932
|
const lcName = transformCaseFunc(name);
|
|
1195
1933
|
const initValue = attrValue;
|
|
1196
1934
|
let value = name === 'value' ? initValue : stringTrim(initValue);
|
|
@@ -1222,7 +1960,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
1222
1960
|
_removeAttribute(name, currentNode);
|
|
1223
1961
|
continue;
|
|
1224
1962
|
}
|
|
1225
|
-
/* Did the hooks
|
|
1963
|
+
/* Did the hooks force-keep the attribute? */
|
|
1226
1964
|
if (hookEvent.forceKeepAttr) {
|
|
1227
1965
|
continue;
|
|
1228
1966
|
}
|
|
@@ -1232,56 +1970,24 @@ var telerikReportViewer = (function (exports) {
|
|
|
1232
1970
|
continue;
|
|
1233
1971
|
}
|
|
1234
1972
|
/* Work around a security issue in jQuery 3.0 */
|
|
1235
|
-
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(
|
|
1973
|
+
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {
|
|
1236
1974
|
_removeAttribute(name, currentNode);
|
|
1237
1975
|
continue;
|
|
1238
1976
|
}
|
|
1239
1977
|
/* Sanitize attribute content to be template-safe */
|
|
1240
1978
|
if (SAFE_FOR_TEMPLATES) {
|
|
1241
|
-
|
|
1242
|
-
value = stringReplace(value, expr, ' ');
|
|
1243
|
-
});
|
|
1979
|
+
value = _stripTemplateExpressions(value);
|
|
1244
1980
|
}
|
|
1245
1981
|
/* Is `value` valid for this attribute? */
|
|
1246
|
-
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
1247
1982
|
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
1248
1983
|
_removeAttribute(name, currentNode);
|
|
1249
1984
|
continue;
|
|
1250
1985
|
}
|
|
1251
1986
|
/* Handle attributes that require Trusted Types */
|
|
1252
|
-
|
|
1253
|
-
if (namespaceURI) ; else {
|
|
1254
|
-
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
1255
|
-
case 'TrustedHTML':
|
|
1256
|
-
{
|
|
1257
|
-
value = trustedTypesPolicy.createHTML(value);
|
|
1258
|
-
break;
|
|
1259
|
-
}
|
|
1260
|
-
case 'TrustedScriptURL':
|
|
1261
|
-
{
|
|
1262
|
-
value = trustedTypesPolicy.createScriptURL(value);
|
|
1263
|
-
break;
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1987
|
+
value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
|
|
1268
1988
|
/* Handle invalid data-* attribute set by try-catching it */
|
|
1269
1989
|
if (value !== initValue) {
|
|
1270
|
-
|
|
1271
|
-
if (namespaceURI) {
|
|
1272
|
-
currentNode.setAttributeNS(namespaceURI, name, value);
|
|
1273
|
-
} else {
|
|
1274
|
-
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
|
1275
|
-
currentNode.setAttribute(name, value);
|
|
1276
|
-
}
|
|
1277
|
-
if (_isClobbered(currentNode)) {
|
|
1278
|
-
_forceRemove(currentNode);
|
|
1279
|
-
} else {
|
|
1280
|
-
arrayPop(DOMPurify.removed);
|
|
1281
|
-
}
|
|
1282
|
-
} catch (_) {
|
|
1283
|
-
_removeAttribute(name, currentNode);
|
|
1284
|
-
}
|
|
1990
|
+
_setAttributeValue(currentNode, name, namespaceURI, value);
|
|
1285
1991
|
}
|
|
1286
1992
|
}
|
|
1287
1993
|
/* Execute a hook if present */
|
|
@@ -1301,17 +2007,136 @@ var telerikReportViewer = (function (exports) {
|
|
|
1301
2007
|
/* Execute a hook if present */
|
|
1302
2008
|
_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
|
|
1303
2009
|
/* Sanitize tags and elements */
|
|
1304
|
-
_sanitizeElements(shadowNode);
|
|
2010
|
+
_sanitizeElements(shadowNode, fragment);
|
|
1305
2011
|
/* Check attributes next */
|
|
1306
2012
|
_sanitizeAttributes(shadowNode);
|
|
1307
|
-
/* Deep shadow DOM detected
|
|
1308
|
-
|
|
2013
|
+
/* Deep shadow DOM detected.
|
|
2014
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): use nodeType against the
|
|
2015
|
+
DOCUMENT_FRAGMENT_NODE constant rather than instanceof, so we
|
|
2016
|
+
recurse into <template>.content from foreign realms too. */
|
|
2017
|
+
if (_isDocumentFragment(shadowNode.content)) {
|
|
1309
2018
|
_sanitizeShadowDOM2(shadowNode.content);
|
|
1310
2019
|
}
|
|
2020
|
+
/* An element iterated here may itself host an attached
|
|
2021
|
+
shadow root. The default NodeIterator does not enter shadow
|
|
2022
|
+
trees, so a shadow root nested inside template.content was
|
|
2023
|
+
previously reached by no walk at all (the pre-pass at
|
|
2024
|
+
_sanitizeAttachedShadowRoots descends via childNodes, which
|
|
2025
|
+
doesn't enter template.content; the template-content recursion
|
|
2026
|
+
above iterates the content but never inspected shadowRoot).
|
|
2027
|
+
Walk it explicitly. The nodeType guard avoids reading
|
|
2028
|
+
shadowRoot off text / comment / CDATA / PI nodes that the
|
|
2029
|
+
iterator also surfaces. */
|
|
2030
|
+
const shadowNodeType = getNodeType ? getNodeType(shadowNode) : shadowNode.nodeType;
|
|
2031
|
+
if (shadowNodeType === NODE_TYPE.element) {
|
|
2032
|
+
const innerSr = getShadowRoot(shadowNode);
|
|
2033
|
+
if (_isDocumentFragment(innerSr)) {
|
|
2034
|
+
_sanitizeAttachedShadowRoots(innerSr);
|
|
2035
|
+
_sanitizeShadowDOM2(innerSr);
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
1311
2038
|
}
|
|
1312
2039
|
/* Execute a hook if present */
|
|
1313
2040
|
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
|
1314
2041
|
};
|
|
2042
|
+
/**
|
|
2043
|
+
* _sanitizeAttachedShadowRoots
|
|
2044
|
+
*
|
|
2045
|
+
* Walks `root` and feeds every attached shadow root we encounter into
|
|
2046
|
+
* the existing _sanitizeShadowDOM pipeline. The default node iterator
|
|
2047
|
+
* does not descend into shadow trees, so nodes inside an attached
|
|
2048
|
+
* shadow root would otherwise be skipped entirely.
|
|
2049
|
+
*
|
|
2050
|
+
* Two real input paths put attached shadow roots in front of us:
|
|
2051
|
+
* 1. IN_PLACE on a DOM node that already has shadow roots attached.
|
|
2052
|
+
* 2. DOM-node input where importNode(dirty, true) deep-clones the
|
|
2053
|
+
* shadow root because it was created with `clonable: true`.
|
|
2054
|
+
*
|
|
2055
|
+
* This pass runs once, up front, so the main iteration loop (and the
|
|
2056
|
+
* existing _sanitizeShadowDOM template-content recursion) stay
|
|
2057
|
+
* untouched — string-input paths are not affected.
|
|
2058
|
+
*
|
|
2059
|
+
* @param root the subtree root to walk for attached shadow roots
|
|
2060
|
+
*/
|
|
2061
|
+
const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {
|
|
2062
|
+
/* Iterative (explicit stack) rather than per-child recursion. DOM APIs
|
|
2063
|
+
impose no depth cap, so an attacker-shaped tree (JSON/CRDT/editor data
|
|
2064
|
+
built straight into the DOM — the IN_PLACE surface) deeper than the JS
|
|
2065
|
+
call-stack budget would otherwise overflow native recursion here and
|
|
2066
|
+
throw at the IN_PLACE entry pre-pass, before a single node is
|
|
2067
|
+
sanitized, leaving the caller's live tree untouched (fail-open). See
|
|
2068
|
+
campaign-3 F4. A heap stack keeps depth off the call stack.
|
|
2069
|
+
Each work item is either a node to descend into, or a deferred
|
|
2070
|
+
`_sanitizeShadowDOM` for an already-walked shadow root. The deferred
|
|
2071
|
+
form preserves the original post-order discipline: a shadow root's
|
|
2072
|
+
nested shadow roots are discovered before the outer shadow is
|
|
2073
|
+
sanitized (which may remove hosts). Pushes are in reverse of the
|
|
2074
|
+
desired processing order (LIFO): template content, then children, then
|
|
2075
|
+
the shadow-sanitize, then the shadow walk — so the order matches the
|
|
2076
|
+
previous recursion exactly. */
|
|
2077
|
+
const stack = [{
|
|
2078
|
+
node: root,
|
|
2079
|
+
shadow: null
|
|
2080
|
+
}];
|
|
2081
|
+
while (stack.length > 0) {
|
|
2082
|
+
const item = stack.pop();
|
|
2083
|
+
/* Deferred shadow-DOM sanitisation: runs after its subtree was walked. */
|
|
2084
|
+
if (item.shadow) {
|
|
2085
|
+
_sanitizeShadowDOM2(item.shadow);
|
|
2086
|
+
continue;
|
|
2087
|
+
}
|
|
2088
|
+
const node = item.node;
|
|
2089
|
+
const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
|
|
2090
|
+
const isElement = nodeType === NODE_TYPE.element;
|
|
2091
|
+
/* (pushed last → processed first) Children, snapshotted in reverse so
|
|
2092
|
+
the first child is processed first. Snapshotting matters because a
|
|
2093
|
+
hook may detach siblings mid-walk. */
|
|
2094
|
+
const childNodes = getChildNodes(node);
|
|
2095
|
+
if (childNodes) {
|
|
2096
|
+
for (let i = childNodes.length - 1; i >= 0; --i) {
|
|
2097
|
+
stack.push({
|
|
2098
|
+
node: childNodes[i],
|
|
2099
|
+
shadow: null
|
|
2100
|
+
});
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
/* (pushed before children → processed after them, matching the old
|
|
2104
|
+
"template content last" order) When the node is a <template>,
|
|
2105
|
+
descend into its content. */
|
|
2106
|
+
if (isElement) {
|
|
2107
|
+
const rootName = getNodeName ? getNodeName(node) : null;
|
|
2108
|
+
if (typeof rootName === 'string' && transformCaseFunc(rootName) === 'template') {
|
|
2109
|
+
const content = node.content;
|
|
2110
|
+
if (_isDocumentFragment(content)) {
|
|
2111
|
+
stack.push({
|
|
2112
|
+
node: content,
|
|
2113
|
+
shadow: null
|
|
2114
|
+
});
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
/* Shadow root (processed first): walk its subtree, then sanitise it.
|
|
2119
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection
|
|
2120
|
+
rather than `instanceof DocumentFragment`, which is realm-bound and
|
|
2121
|
+
silently skipped foreign-realm shadow roots (e.g.
|
|
2122
|
+
iframe.contentDocument attachShadow). */
|
|
2123
|
+
if (isElement) {
|
|
2124
|
+
const sr = getShadowRoot(node);
|
|
2125
|
+
if (_isDocumentFragment(sr)) {
|
|
2126
|
+
/* Push the deferred sanitise first so it pops after the shadow
|
|
2127
|
+
walk we push next, i.e. nested shadow roots are discovered
|
|
2128
|
+
before this one is sanitised. */
|
|
2129
|
+
stack.push({
|
|
2130
|
+
node: null,
|
|
2131
|
+
shadow: sr
|
|
2132
|
+
}, {
|
|
2133
|
+
node: sr,
|
|
2134
|
+
shadow: null
|
|
2135
|
+
});
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
};
|
|
1315
2140
|
// eslint-disable-next-line complexity
|
|
1316
2141
|
DOMPurify.sanitize = function (dirty) {
|
|
1317
2142
|
let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -1338,25 +2163,90 @@ var telerikReportViewer = (function (exports) {
|
|
|
1338
2163
|
return dirty;
|
|
1339
2164
|
}
|
|
1340
2165
|
/* Assign config vars */
|
|
1341
|
-
if (
|
|
2166
|
+
if (SET_CONFIG) {
|
|
2167
|
+
/* Persistent setConfig() path: _parseConfig is skipped, so the sets are
|
|
2168
|
+
* not re-derived per call. Restore them from the pristine bindings
|
|
2169
|
+
* captured at setConfig() time so a previous call's hook clone (mutated
|
|
2170
|
+
* below) does not carry over. */
|
|
2171
|
+
ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;
|
|
2172
|
+
ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;
|
|
2173
|
+
} else {
|
|
1342
2174
|
_parseConfig(cfg);
|
|
1343
2175
|
}
|
|
2176
|
+
/* Clone the hook-mutable allowlists before the walk whenever an
|
|
2177
|
+
* uponSanitize* hook is registered. The hook event exposes ALLOWED_TAGS
|
|
2178
|
+
* and ALLOWED_ATTR by reference (as allowedTags / allowedAttributes), so
|
|
2179
|
+
* a hook that widens them would otherwise mutate the shared set
|
|
2180
|
+
* permanently: across later calls and across every element. Cloning per
|
|
2181
|
+
* walk keeps documented in-call widening working while scoping it to the
|
|
2182
|
+
* call. A single guard for both config paths - the per-call path rebinds
|
|
2183
|
+
* the sets in _parseConfig each call, the persistent path restores them
|
|
2184
|
+
* from the captured bindings just above - so the two cannot diverge. */
|
|
2185
|
+
if (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) {
|
|
2186
|
+
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
2187
|
+
}
|
|
2188
|
+
if (hooks.uponSanitizeAttribute.length > 0) {
|
|
2189
|
+
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
2190
|
+
}
|
|
1344
2191
|
/* Clean up removed elements */
|
|
1345
2192
|
DOMPurify.removed = [];
|
|
1346
|
-
/*
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
2193
|
+
/* Resolve IN_PLACE for this call without mutating persistent config.
|
|
2194
|
+
Writing the IN_PLACE closure variable here leaks under setConfig(),
|
|
2195
|
+
where _parseConfig is skipped on later calls: a single string call would
|
|
2196
|
+
disable in-place mode for every subsequent node call, returning a
|
|
2197
|
+
sanitized copy while leaving the caller's node — which in-place callers
|
|
2198
|
+
keep using and whose return value they ignore — unsanitized. REPORT-2. */
|
|
2199
|
+
const inPlace = IN_PLACE && typeof dirty !== 'string' && _isNode(dirty);
|
|
2200
|
+
if (inPlace) {
|
|
2201
|
+
/* Declarative-partial-updates / streaming pre-pass: sever every patch
|
|
2202
|
+
linkage across the live tree BEFORE the walk, so no patch can fire
|
|
2203
|
+
mid-walk and inject into an already-processed region. Runs first, so
|
|
2204
|
+
it also covers the forbidden/clobbered roots that throw below. */
|
|
2205
|
+
_neutralizePatchLinkage(dirty);
|
|
2206
|
+
/* Do some early pre-sanitization to avoid unsafe root nodes.
|
|
2207
|
+
Read nodeName through the cached prototype getter — a clobbering
|
|
2208
|
+
child named "nodeName" on the form root would otherwise shadow
|
|
2209
|
+
the property and let this check skip the root-allowlist
|
|
2210
|
+
validation entirely. */
|
|
2211
|
+
const nn = getNodeName ? getNodeName(dirty) : dirty.nodeName;
|
|
1353
2212
|
if (typeof nn === 'string') {
|
|
1354
2213
|
const tagName = transformCaseFunc(nn);
|
|
1355
2214
|
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
2215
|
+
/* Fail closed on a live root: neutralize handlers/children before
|
|
2216
|
+
throwing, exactly as the mid-walk abort path does. */
|
|
2217
|
+
_neutralizeRoot(dirty);
|
|
1356
2218
|
throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
|
|
1357
2219
|
}
|
|
1358
2220
|
}
|
|
1359
|
-
|
|
2221
|
+
/* Pre-flight the root through _isClobbered. The iterator-driven
|
|
2222
|
+
removal path can not detach a parent-less root: _forceRemove
|
|
2223
|
+
falls through to Element.prototype.remove(), which per spec
|
|
2224
|
+
is a no-op on a node with no parent. A clobbered root would
|
|
2225
|
+
then survive the main loop with its attributes uninspected,
|
|
2226
|
+
because _sanitizeAttributes early-returns on _isClobbered. The
|
|
2227
|
+
result would be an attacker-controlled form, complete with any
|
|
2228
|
+
event-handler attributes the caller passed in, handed back to
|
|
2229
|
+
the application unsanitized. Refuse to sanitize such a root
|
|
2230
|
+
the same way we refuse a forbidden tag. GHSA-r47g-fvhr-h676. */
|
|
2231
|
+
if (_isClobbered(dirty)) {
|
|
2232
|
+
/* Fail closed on a live clobbered root before throwing.
|
|
2233
|
+
_neutralizeRoot's reads are clobber-safe (cached getters); the
|
|
2234
|
+
form's non-clobbered descendants, e.g. an armed <img>, are scrubbed. */
|
|
2235
|
+
_neutralizeRoot(dirty);
|
|
2236
|
+
throw typeErrorCreate('root node is clobbered and cannot be sanitized in-place');
|
|
2237
|
+
}
|
|
2238
|
+
/* Sanitize attached shadow roots before the main iterator runs.
|
|
2239
|
+
The iterator does not descend into shadow trees. Same fail-closed
|
|
2240
|
+
barrier as the main walk (campaign-3 F2): a custom-element reaction
|
|
2241
|
+
inside a shadow root could abort this pre-pass before the walk runs,
|
|
2242
|
+
which would otherwise leave the entire live tree unsanitized. */
|
|
2243
|
+
try {
|
|
2244
|
+
_sanitizeAttachedShadowRoots(dirty);
|
|
2245
|
+
} catch (error) {
|
|
2246
|
+
_neutralizeRoot(dirty);
|
|
2247
|
+
throw error;
|
|
2248
|
+
}
|
|
2249
|
+
} else if (_isNode(dirty)) {
|
|
1360
2250
|
/* If dirty is a DOM element, append to an empty document to avoid
|
|
1361
2251
|
elements being stripped by the parser */
|
|
1362
2252
|
body = _initDocument('<!---->');
|
|
@@ -1370,12 +2260,18 @@ var telerikReportViewer = (function (exports) {
|
|
|
1370
2260
|
// eslint-disable-next-line unicorn/prefer-dom-node-append
|
|
1371
2261
|
body.appendChild(importedNode);
|
|
1372
2262
|
}
|
|
2263
|
+
/* Clonable shadow roots are deep-cloned by importNode(); sanitize
|
|
2264
|
+
them before the main iterator runs, since the iterator does not
|
|
2265
|
+
descend into shadow trees. The walk routes every read through a
|
|
2266
|
+
cached prototype getter so clobbering descendants on a form root
|
|
2267
|
+
cannot hide a shadow host from this pass. */
|
|
2268
|
+
_sanitizeAttachedShadowRoots(importedNode);
|
|
1373
2269
|
} else {
|
|
1374
2270
|
/* Exit directly if we have nothing to do */
|
|
1375
2271
|
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
|
|
1376
2272
|
// eslint-disable-next-line unicorn/prefer-includes
|
|
1377
2273
|
dirty.indexOf('<') === -1) {
|
|
1378
|
-
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ?
|
|
2274
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;
|
|
1379
2275
|
}
|
|
1380
2276
|
/* Initialize the document to work on */
|
|
1381
2277
|
body = _initDocument(dirty);
|
|
@@ -1389,31 +2285,68 @@ var telerikReportViewer = (function (exports) {
|
|
|
1389
2285
|
_forceRemove(body.firstChild);
|
|
1390
2286
|
}
|
|
1391
2287
|
/* Get node iterator */
|
|
1392
|
-
const
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
2288
|
+
const walkRoot = inPlace ? dirty : body;
|
|
2289
|
+
const nodeIterator = _createNodeIterator(walkRoot);
|
|
2290
|
+
/* Now start iterating over the created document.
|
|
2291
|
+
The walk runs inside an exception barrier (campaign-3 F2): a re-entrant
|
|
2292
|
+
engine/custom-element mutation can detach a node mid-walk so
|
|
2293
|
+
`_forceRemove`'s parentless guard throws, aborting the loop. Without the
|
|
2294
|
+
barrier the caller's in-place tree would be left half-sanitized with the
|
|
2295
|
+
unvisited tail still armed. On any throw we fail closed — strip the
|
|
2296
|
+
in-place root bare — then rethrow so the existing throw contract is
|
|
2297
|
+
preserved. (String/DOM-copy paths never return the partial body, so the
|
|
2298
|
+
propagating throw is already fail-closed there.) */
|
|
2299
|
+
try {
|
|
2300
|
+
while (currentNode = nodeIterator.nextNode()) {
|
|
2301
|
+
/* Sanitize tags and elements */
|
|
2302
|
+
_sanitizeElements(currentNode, walkRoot);
|
|
2303
|
+
/* Check attributes next */
|
|
2304
|
+
_sanitizeAttributes(currentNode);
|
|
2305
|
+
/* Shadow DOM detected, sanitize it.
|
|
2306
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection
|
|
2307
|
+
instead of instanceof, so foreign-realm <template>.content is
|
|
2308
|
+
walked correctly. */
|
|
2309
|
+
if (_isDocumentFragment(currentNode.content)) {
|
|
2310
|
+
_sanitizeShadowDOM2(currentNode.content);
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
} catch (error) {
|
|
2314
|
+
if (inPlace) {
|
|
2315
|
+
_neutralizeRoot(dirty);
|
|
2316
|
+
/* Nodes _forceRemove'd earlier in the aborted walk are already
|
|
2317
|
+
detached from the root, so _neutralizeRoot's subtree pass does not
|
|
2318
|
+
reach them. Defuse them too, mirroring the success-path loop below. */
|
|
2319
|
+
arrayForEach(DOMPurify.removed, entry => {
|
|
2320
|
+
if (entry.element) {
|
|
2321
|
+
_neutralizeSubtree(entry.element);
|
|
2322
|
+
}
|
|
2323
|
+
});
|
|
1402
2324
|
}
|
|
2325
|
+
throw error;
|
|
1403
2326
|
}
|
|
1404
2327
|
/* If we sanitized `dirty` in-place, return it. */
|
|
1405
|
-
if (
|
|
2328
|
+
if (inPlace) {
|
|
2329
|
+
/* Fail-closed completion of the audit-5 F1 fix: every node removed from
|
|
2330
|
+
the caller's live tree is detached but may still hold a queued
|
|
2331
|
+
resource-event handler that fires in page scope after we return. The
|
|
2332
|
+
move-hoist covers only disallowed-tag KEEP_CONTENT removals; strip the
|
|
2333
|
+
non-allow-listed attributes off every other removed subtree (clobber,
|
|
2334
|
+
mXSS, namespace, comments, KEEP_CONTENT:false, …) so those handlers are
|
|
2335
|
+
cancelled before any event can fire. Runs synchronously, pre-return. */
|
|
2336
|
+
arrayForEach(DOMPurify.removed, entry => {
|
|
2337
|
+
if (entry.element) {
|
|
2338
|
+
_neutralizeSubtree(entry.element);
|
|
2339
|
+
}
|
|
2340
|
+
});
|
|
2341
|
+
if (SAFE_FOR_TEMPLATES) {
|
|
2342
|
+
_scrubTemplateExpressions2(dirty);
|
|
2343
|
+
}
|
|
1406
2344
|
return dirty;
|
|
1407
2345
|
}
|
|
1408
2346
|
/* Return sanitized string or DOM */
|
|
1409
2347
|
if (RETURN_DOM) {
|
|
1410
2348
|
if (SAFE_FOR_TEMPLATES) {
|
|
1411
|
-
body
|
|
1412
|
-
let html = body.innerHTML;
|
|
1413
|
-
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
|
1414
|
-
html = stringReplace(html, expr, ' ');
|
|
1415
|
-
});
|
|
1416
|
-
body.innerHTML = html;
|
|
2349
|
+
_scrubTemplateExpressions2(body);
|
|
1417
2350
|
}
|
|
1418
2351
|
if (RETURN_DOM_FRAGMENT) {
|
|
1419
2352
|
returnNode = createDocumentFragment.call(body.ownerDocument);
|
|
@@ -1443,20 +2376,28 @@ var telerikReportViewer = (function (exports) {
|
|
|
1443
2376
|
}
|
|
1444
2377
|
/* Sanitize final string template-safe */
|
|
1445
2378
|
if (SAFE_FOR_TEMPLATES) {
|
|
1446
|
-
|
|
1447
|
-
serializedHTML = stringReplace(serializedHTML, expr, ' ');
|
|
1448
|
-
});
|
|
2379
|
+
serializedHTML = _stripTemplateExpressions(serializedHTML);
|
|
1449
2380
|
}
|
|
1450
|
-
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ?
|
|
2381
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;
|
|
1451
2382
|
};
|
|
1452
2383
|
DOMPurify.setConfig = function () {
|
|
1453
2384
|
let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1454
2385
|
_parseConfig(cfg);
|
|
1455
2386
|
SET_CONFIG = true;
|
|
2387
|
+
SET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;
|
|
2388
|
+
SET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;
|
|
1456
2389
|
};
|
|
1457
2390
|
DOMPurify.clearConfig = function () {
|
|
1458
2391
|
CONFIG = null;
|
|
1459
2392
|
SET_CONFIG = false;
|
|
2393
|
+
SET_CONFIG_ALLOWED_TAGS = null;
|
|
2394
|
+
SET_CONFIG_ALLOWED_ATTR = null;
|
|
2395
|
+
// Drop any caller-supplied Trusted Types policy so it cannot poison later
|
|
2396
|
+
// `RETURN_TRUSTED_TYPE` output. The internal default policy (cached, and
|
|
2397
|
+
// never recreated — Trusted Types throws on duplicate names) is restored by
|
|
2398
|
+
// the next `_parseConfig`. See GHSA-vxr8-fq34-vvx9.
|
|
2399
|
+
trustedTypesPolicy = defaultTrustedTypesPolicy;
|
|
2400
|
+
emptyHTML = '';
|
|
1460
2401
|
};
|
|
1461
2402
|
DOMPurify.isValidAttribute = function (tag, attr, value) {
|
|
1462
2403
|
/* Initialize shared config vars if necessary. */
|
|
@@ -1471,9 +2412,19 @@ var telerikReportViewer = (function (exports) {
|
|
|
1471
2412
|
if (typeof hookFunction !== 'function') {
|
|
1472
2413
|
return;
|
|
1473
2414
|
}
|
|
2415
|
+
/* Reject unknown entry points. Without this, a non-hook key (e.g.
|
|
2416
|
+
* '__proto__') indexes off the prototype chain rather than a real
|
|
2417
|
+
* hook array, and arrayPush then writes to Object.prototype. Guard
|
|
2418
|
+
* with an own-property check against the known hook names. */
|
|
2419
|
+
if (!objectHasOwnProperty(hooks, entryPoint)) {
|
|
2420
|
+
return;
|
|
2421
|
+
}
|
|
1474
2422
|
arrayPush(hooks[entryPoint], hookFunction);
|
|
1475
2423
|
};
|
|
1476
2424
|
DOMPurify.removeHook = function (entryPoint, hookFunction) {
|
|
2425
|
+
if (!objectHasOwnProperty(hooks, entryPoint)) {
|
|
2426
|
+
return undefined;
|
|
2427
|
+
}
|
|
1477
2428
|
if (hookFunction !== undefined) {
|
|
1478
2429
|
const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
|
|
1479
2430
|
return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
|
|
@@ -1481,6 +2432,9 @@ var telerikReportViewer = (function (exports) {
|
|
|
1481
2432
|
return arrayPop(hooks[entryPoint]);
|
|
1482
2433
|
};
|
|
1483
2434
|
DOMPurify.removeHooks = function (entryPoint) {
|
|
2435
|
+
if (!objectHasOwnProperty(hooks, entryPoint)) {
|
|
2436
|
+
return;
|
|
2437
|
+
}
|
|
1484
2438
|
hooks[entryPoint] = [];
|
|
1485
2439
|
};
|
|
1486
2440
|
DOMPurify.removeAllHooks = function () {
|
|
@@ -1495,11 +2449,16 @@ var telerikReportViewer = (function (exports) {
|
|
|
1495
2449
|
return purify_cjs;
|
|
1496
2450
|
}
|
|
1497
2451
|
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
2452
|
+
dist.exports;
|
|
2453
|
+
(function(module, exports) {
|
|
2454
|
+
!(function(e, t) {
|
|
2455
|
+
t(exports, requirePurify_cjs()) ;
|
|
2456
|
+
})(commonjsGlobal, function(e, t) {
|
|
2457
|
+
function i(e2) {
|
|
2458
|
+
return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
|
|
2459
|
+
}
|
|
2460
|
+
var n, r = i(t);
|
|
2461
|
+
function s(e2, t2, i2, n2) {
|
|
1503
2462
|
return new (i2 || (i2 = Promise))(function(r2, s2) {
|
|
1504
2463
|
function o2(e3) {
|
|
1505
2464
|
try {
|
|
@@ -1525,72 +2484,72 @@ var telerikReportViewer = (function (exports) {
|
|
|
1525
2484
|
});
|
|
1526
2485
|
}
|
|
1527
2486
|
"function" == typeof SuppressedError && SuppressedError;
|
|
1528
|
-
class
|
|
2487
|
+
class o {
|
|
1529
2488
|
constructor() {
|
|
1530
2489
|
this.BasePath = "", this.ImmediatePrint = false, this.ContentOnly = false, this.UseSVG = false, this.enableSearch = false, this.enableAccessibility = false, this.contentTabIndex = 0;
|
|
1531
2490
|
}
|
|
1532
2491
|
}
|
|
1533
|
-
class
|
|
2492
|
+
class a {
|
|
1534
2493
|
constructor() {
|
|
1535
2494
|
this.from = "", this.to = "", this.cc = "", this.subject = "", this.format = "", this.body = "";
|
|
1536
2495
|
}
|
|
1537
2496
|
}
|
|
1538
|
-
class
|
|
2497
|
+
class l {
|
|
1539
2498
|
constructor(e2, t2) {
|
|
1540
2499
|
this.cancel = false, this.element = e2, this.action = t2;
|
|
1541
2500
|
}
|
|
1542
2501
|
}
|
|
1543
|
-
class
|
|
2502
|
+
class h {
|
|
1544
2503
|
constructor(e2, t2) {
|
|
1545
2504
|
this.id = "", this.type = "", this.id = e2, this.type = t2;
|
|
1546
2505
|
}
|
|
1547
2506
|
}
|
|
1548
|
-
class
|
|
2507
|
+
class c {
|
|
1549
2508
|
constructor(e2, t2) {
|
|
1550
2509
|
this.isCancelled = false, this.format = "", this.deviceInfo = e2, this.format = t2;
|
|
1551
2510
|
}
|
|
1552
2511
|
}
|
|
1553
|
-
class
|
|
2512
|
+
class d {
|
|
1554
2513
|
constructor(e2, t2) {
|
|
1555
2514
|
this.handled = false, this.deviceInfo = e2, this.format = t2;
|
|
1556
2515
|
}
|
|
1557
2516
|
}
|
|
1558
|
-
class
|
|
2517
|
+
class u {
|
|
1559
2518
|
constructor(e2, t2, i2) {
|
|
1560
2519
|
this.handled = false, this.url = e2, this.format = t2, this.windowOpenTarget = i2;
|
|
1561
2520
|
}
|
|
1562
2521
|
}
|
|
1563
|
-
class
|
|
2522
|
+
class p {
|
|
1564
2523
|
constructor(e2) {
|
|
1565
2524
|
this.handled = false, this.deviceInfo = e2;
|
|
1566
2525
|
}
|
|
1567
2526
|
}
|
|
1568
|
-
class
|
|
2527
|
+
class g {
|
|
1569
2528
|
constructor(e2) {
|
|
1570
2529
|
this.handled = false, this.url = e2;
|
|
1571
2530
|
}
|
|
1572
2531
|
}
|
|
1573
|
-
class
|
|
2532
|
+
class f {
|
|
1574
2533
|
constructor(e2, t2) {
|
|
1575
2534
|
this.handled = false, this.deviceInfo = e2, this.format = t2;
|
|
1576
2535
|
}
|
|
1577
2536
|
}
|
|
1578
|
-
class
|
|
2537
|
+
class m extends a {
|
|
1579
2538
|
constructor(e2, t2, i2) {
|
|
1580
2539
|
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;
|
|
1581
2540
|
}
|
|
1582
2541
|
}
|
|
1583
|
-
class
|
|
2542
|
+
class v {
|
|
1584
2543
|
constructor(e2, t2) {
|
|
1585
2544
|
this.page = e2, this.reportDocumentId = t2;
|
|
1586
2545
|
}
|
|
1587
2546
|
}
|
|
1588
|
-
class
|
|
2547
|
+
class P {
|
|
1589
2548
|
constructor(e2, t2, i2, n2 = null) {
|
|
1590
2549
|
this.element = e2, this.text = t2, this.title = i2, this.eventArgs = n2;
|
|
1591
2550
|
}
|
|
1592
2551
|
}
|
|
1593
|
-
class
|
|
2552
|
+
class C {
|
|
1594
2553
|
constructor(e2, t2) {
|
|
1595
2554
|
this._responseText = e2, this._error = t2;
|
|
1596
2555
|
try {
|
|
@@ -1613,30 +2572,29 @@ var telerikReportViewer = (function (exports) {
|
|
|
1613
2572
|
return (null === (e2 = this.responseJSON) || void 0 === e2 ? void 0 : e2.exceptionMessage) || (null === (t2 = this.responseJSON) || void 0 === t2 ? void 0 : t2.ExceptionMessage);
|
|
1614
2573
|
}
|
|
1615
2574
|
}
|
|
1616
|
-
function
|
|
2575
|
+
function y(e2, t2 = false, i2 = false) {
|
|
1617
2576
|
let n2 = { Accept: "application/json, text/javascript, */*; q=0.01" };
|
|
1618
2577
|
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;
|
|
1619
2578
|
}
|
|
1620
|
-
function
|
|
1621
|
-
return
|
|
2579
|
+
function S(e2) {
|
|
2580
|
+
return s(this, void 0, void 0, function* () {
|
|
1622
2581
|
if (!e2.ok) {
|
|
1623
|
-
let t2 = yield e2.text(), i2 = new
|
|
2582
|
+
let t2 = yield e2.text(), i2 = new C(t2, e2.statusText);
|
|
1624
2583
|
return Promise.reject(i2);
|
|
1625
2584
|
}
|
|
1626
|
-
if (204 == e2.status)
|
|
1627
|
-
return Promise.resolve();
|
|
2585
|
+
if (204 == e2.status) return Promise.resolve();
|
|
1628
2586
|
return (e2.headers.get("content-type") || "").includes("application/json") ? e2.json() : e2.text();
|
|
1629
2587
|
});
|
|
1630
2588
|
}
|
|
1631
|
-
function
|
|
1632
|
-
return fetch(e2, { method: "POST", headers:
|
|
2589
|
+
function I(e2, t2 = {}, i2 = "", n2 = false) {
|
|
2590
|
+
return fetch(e2, { method: "POST", headers: y(i2, true, n2), body: n2 ? t2 : JSON.stringify(t2) }).then(S);
|
|
1633
2591
|
}
|
|
1634
|
-
class
|
|
2592
|
+
class b {
|
|
1635
2593
|
authenticatePromise() {
|
|
1636
2594
|
return Promise.resolve("");
|
|
1637
2595
|
}
|
|
1638
2596
|
}
|
|
1639
|
-
class
|
|
2597
|
+
class w {
|
|
1640
2598
|
constructor(e2) {
|
|
1641
2599
|
this.connectionConfig = e2;
|
|
1642
2600
|
}
|
|
@@ -1644,69 +2602,66 @@ var telerikReportViewer = (function (exports) {
|
|
|
1644
2602
|
var e2, t2;
|
|
1645
2603
|
if (this.connectionConfig && this.connectionConfig.tokenUrl && (this.connectionConfig.username || this.connectionConfig.password)) {
|
|
1646
2604
|
let i2 = `grant_type=password&username=${encodeURIComponent((null === (e2 = this.connectionConfig) || void 0 === e2 ? void 0 : e2.username) || "")}&password=${encodeURIComponent((null === (t2 = this.connectionConfig) || void 0 === t2 ? void 0 : t2.password) || "")}`;
|
|
1647
|
-
return
|
|
2605
|
+
return I(this.connectionConfig.tokenUrl, i2, "", true).then((e3) => (e3.expiresAt = Date.now() + 1e3 * e3.expiresIn, e3));
|
|
1648
2606
|
}
|
|
1649
2607
|
return Promise.reject("Failed to connect to Report Server with user credentials. Are you missing the reportServer.url, reportServer.username or reportServer.password values?");
|
|
1650
2608
|
}
|
|
1651
2609
|
}
|
|
1652
|
-
class
|
|
2610
|
+
class L {
|
|
1653
2611
|
constructor(e2) {
|
|
1654
2612
|
this.connectionConfig = e2;
|
|
1655
2613
|
}
|
|
1656
2614
|
authenticatePromise(e2, t2) {
|
|
1657
|
-
return e2 ?
|
|
2615
|
+
return e2 ? I(this.connectionConfig.refreshTokenUrl, { RefreshToken: t2 }).then((e3) => (e3.expiresAt = Date.now() + 1e3 * e3.expiresIn, e3)) : this.connectionConfig && this.connectionConfig.personalTokenUrl && this.connectionConfig.getPersonalAccessToken ? this.connectionConfig.getPersonalAccessToken().then((e3) => I(this.connectionConfig.personalTokenUrl, e3).then((e4) => (e4.expiresAt = Date.now() + 1e3 * e4.expiresIn, e4))) : Promise.reject("Failed to connect to Report Server with personal access token. Are you missing the reportServer.url or reportServer.getPersonalAccessToken values?");
|
|
1658
2616
|
}
|
|
1659
2617
|
}
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
class L {
|
|
2618
|
+
e.AuthType = void 0, (n = e.AuthType || (e.AuthType = {}))[n.None = 0] = "None", n[n.Basic = 1] = "Basic", n[n.PersonalToken = 2] = "PersonalToken";
|
|
2619
|
+
class T {
|
|
1663
2620
|
constructor(e2) {
|
|
1664
2621
|
this.baseUrl = null == e2 ? void 0 : e2.replace(/\/$/, "");
|
|
1665
2622
|
}
|
|
1666
2623
|
}
|
|
1667
|
-
class
|
|
2624
|
+
class R extends T {
|
|
1668
2625
|
constructor(t2) {
|
|
1669
2626
|
super(t2), this.authType = e.AuthType.None, this.serviceUrl = this.baseUrl;
|
|
1670
2627
|
}
|
|
1671
2628
|
}
|
|
1672
|
-
class A extends
|
|
2629
|
+
class A extends T {
|
|
1673
2630
|
constructor(t2) {
|
|
1674
2631
|
super(t2), this.authType = e.AuthType.None, this.serviceUrl = this.baseUrl + "/api/reports";
|
|
1675
2632
|
}
|
|
1676
2633
|
}
|
|
1677
|
-
class
|
|
2634
|
+
class E extends A {
|
|
1678
2635
|
constructor(t2, i2, n2) {
|
|
1679
2636
|
super(t2), this.authType = e.AuthType.Basic, this.username = i2, this.password = n2, this.tokenUrl = this.baseUrl + "/Token";
|
|
1680
2637
|
}
|
|
1681
2638
|
}
|
|
1682
|
-
class
|
|
2639
|
+
class M extends A {
|
|
1683
2640
|
constructor(t2, i2) {
|
|
1684
2641
|
super(t2), this.authType = e.AuthType.PersonalToken, this.getPersonalAccessToken = i2, this.personalTokenUrl = this.baseUrl + "/PersonalToken", this.refreshTokenUrl = this.baseUrl + "/refresh";
|
|
1685
2642
|
}
|
|
1686
2643
|
}
|
|
1687
|
-
function M() {
|
|
1688
|
-
}
|
|
1689
2644
|
function k() {
|
|
1690
|
-
k.init.call(this);
|
|
1691
2645
|
}
|
|
1692
|
-
function x(
|
|
1693
|
-
|
|
2646
|
+
function x() {
|
|
2647
|
+
x.init.call(this);
|
|
1694
2648
|
}
|
|
1695
|
-
function N(e2
|
|
2649
|
+
function N(e2) {
|
|
2650
|
+
return void 0 === e2._maxListeners ? x.defaultMaxListeners : e2._maxListeners;
|
|
2651
|
+
}
|
|
2652
|
+
function D(e2, t2, i2, n2) {
|
|
1696
2653
|
var r2, s2, o2, a2;
|
|
1697
|
-
if ("function" != typeof i2)
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
if ("function" == typeof o2 ? o2 = s2[t2] = n2 ? [i2, o2] : [o2, i2] : n2 ? o2.unshift(i2) : o2.push(i2), !o2.warned && (r2 = x(e2)) && r2 > 0 && o2.length > r2) {
|
|
2654
|
+
if ("function" != typeof i2) throw new TypeError('"listener" argument must be a function');
|
|
2655
|
+
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 k(), e2._eventsCount = 0), o2) {
|
|
2656
|
+
if ("function" == typeof o2 ? o2 = s2[t2] = n2 ? [i2, o2] : [o2, i2] : n2 ? o2.unshift(i2) : o2.push(i2), !o2.warned && (r2 = N(e2)) && r2 > 0 && o2.length > r2) {
|
|
1701
2657
|
o2.warned = true;
|
|
1702
2658
|
var l2 = new Error("Possible EventEmitter memory leak detected. " + o2.length + " " + t2 + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
1703
2659
|
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);
|
|
1704
2660
|
}
|
|
1705
|
-
} else
|
|
1706
|
-
o2 = s2[t2] = i2, ++e2._eventsCount;
|
|
2661
|
+
} else o2 = s2[t2] = i2, ++e2._eventsCount;
|
|
1707
2662
|
return e2;
|
|
1708
2663
|
}
|
|
1709
|
-
function
|
|
2664
|
+
function V(e2, t2, i2) {
|
|
1710
2665
|
var n2 = false;
|
|
1711
2666
|
function r2() {
|
|
1712
2667
|
e2.removeListener(t2, r2), n2 || (n2 = true, i2.apply(e2, arguments));
|
|
@@ -1717,184 +2672,141 @@ var telerikReportViewer = (function (exports) {
|
|
|
1717
2672
|
var t2 = this._events;
|
|
1718
2673
|
if (t2) {
|
|
1719
2674
|
var i2 = t2[e2];
|
|
1720
|
-
if ("function" == typeof i2)
|
|
1721
|
-
|
|
1722
|
-
if (i2)
|
|
1723
|
-
return i2.length;
|
|
2675
|
+
if ("function" == typeof i2) return 1;
|
|
2676
|
+
if (i2) return i2.length;
|
|
1724
2677
|
}
|
|
1725
2678
|
return 0;
|
|
1726
2679
|
}
|
|
1727
|
-
function
|
|
1728
|
-
for (var i2 = new Array(t2); t2--; )
|
|
1729
|
-
i2[t2] = e2[t2];
|
|
2680
|
+
function O(e2, t2) {
|
|
2681
|
+
for (var i2 = new Array(t2); t2--; ) i2[t2] = e2[t2];
|
|
1730
2682
|
return i2;
|
|
1731
2683
|
}
|
|
1732
|
-
|
|
1733
|
-
this.domain = null,
|
|
1734
|
-
},
|
|
1735
|
-
if ("number" != typeof e2 || e2 < 0 || isNaN(e2))
|
|
1736
|
-
throw new TypeError('"n" argument must be a positive number');
|
|
2684
|
+
k.prototype = /* @__PURE__ */ Object.create(null), x.EventEmitter = x, x.usingDomains = false, x.prototype.domain = void 0, x.prototype._events = void 0, x.prototype._maxListeners = void 0, x.defaultMaxListeners = 10, x.init = function() {
|
|
2685
|
+
this.domain = null, x.usingDomains && (void 0).active, this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = new k(), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
2686
|
+
}, x.prototype.setMaxListeners = function(e2) {
|
|
2687
|
+
if ("number" != typeof e2 || e2 < 0 || isNaN(e2)) throw new TypeError('"n" argument must be a positive number');
|
|
1737
2688
|
return this._maxListeners = e2, this;
|
|
1738
|
-
},
|
|
1739
|
-
return
|
|
1740
|
-
},
|
|
2689
|
+
}, x.prototype.getMaxListeners = function() {
|
|
2690
|
+
return N(this);
|
|
2691
|
+
}, x.prototype.emit = function(e2) {
|
|
1741
2692
|
var t2, i2, n2, r2, s2, o2, a2, l2 = "error" === e2;
|
|
1742
|
-
if (o2 = this._events)
|
|
1743
|
-
|
|
1744
|
-
else if (!l2)
|
|
1745
|
-
return false;
|
|
2693
|
+
if (o2 = this._events) l2 = l2 && null == o2.error;
|
|
2694
|
+
else if (!l2) return false;
|
|
1746
2695
|
if (a2 = this.domain, l2) {
|
|
1747
2696
|
if (t2 = arguments[1], !a2) {
|
|
1748
|
-
if (t2 instanceof Error)
|
|
1749
|
-
throw t2;
|
|
2697
|
+
if (t2 instanceof Error) throw t2;
|
|
1750
2698
|
var h2 = new Error('Uncaught, unspecified "error" event. (' + t2 + ")");
|
|
1751
2699
|
throw h2.context = t2, h2;
|
|
1752
2700
|
}
|
|
1753
2701
|
return t2 || (t2 = new Error('Uncaught, unspecified "error" event')), t2.domainEmitter = this, t2.domain = a2, t2.domainThrown = false, a2.emit("error", t2), false;
|
|
1754
2702
|
}
|
|
1755
|
-
if (!(i2 = o2[e2]))
|
|
1756
|
-
return false;
|
|
2703
|
+
if (!(i2 = o2[e2])) return false;
|
|
1757
2704
|
var c2 = "function" == typeof i2;
|
|
1758
2705
|
switch (n2 = arguments.length) {
|
|
1759
2706
|
case 1:
|
|
1760
|
-
!function(e3, t3, i3) {
|
|
1761
|
-
if (t3)
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
for (var n3 = e3.length, r3 = V(e3, n3), s3 = 0; s3 < n3; ++s3)
|
|
1765
|
-
r3[s3].call(i3);
|
|
1766
|
-
}(i2, c2, this);
|
|
2707
|
+
!(function(e3, t3, i3) {
|
|
2708
|
+
if (t3) e3.call(i3);
|
|
2709
|
+
else for (var n3 = e3.length, r3 = O(e3, n3), s3 = 0; s3 < n3; ++s3) r3[s3].call(i3);
|
|
2710
|
+
})(i2, c2, this);
|
|
1767
2711
|
break;
|
|
1768
2712
|
case 2:
|
|
1769
|
-
!function(e3, t3, i3, n3) {
|
|
1770
|
-
if (t3)
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
for (var r3 = e3.length, s3 = V(e3, r3), o3 = 0; o3 < r3; ++o3)
|
|
1774
|
-
s3[o3].call(i3, n3);
|
|
1775
|
-
}(i2, c2, this, arguments[1]);
|
|
2713
|
+
!(function(e3, t3, i3, n3) {
|
|
2714
|
+
if (t3) e3.call(i3, n3);
|
|
2715
|
+
else for (var r3 = e3.length, s3 = O(e3, r3), o3 = 0; o3 < r3; ++o3) s3[o3].call(i3, n3);
|
|
2716
|
+
})(i2, c2, this, arguments[1]);
|
|
1776
2717
|
break;
|
|
1777
2718
|
case 3:
|
|
1778
|
-
!function(e3, t3, i3, n3, r3) {
|
|
1779
|
-
if (t3)
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
for (var s3 = e3.length, o3 = V(e3, s3), a3 = 0; a3 < s3; ++a3)
|
|
1783
|
-
o3[a3].call(i3, n3, r3);
|
|
1784
|
-
}(i2, c2, this, arguments[1], arguments[2]);
|
|
2719
|
+
!(function(e3, t3, i3, n3, r3) {
|
|
2720
|
+
if (t3) e3.call(i3, n3, r3);
|
|
2721
|
+
else for (var s3 = e3.length, o3 = O(e3, s3), a3 = 0; a3 < s3; ++a3) o3[a3].call(i3, n3, r3);
|
|
2722
|
+
})(i2, c2, this, arguments[1], arguments[2]);
|
|
1785
2723
|
break;
|
|
1786
2724
|
case 4:
|
|
1787
|
-
!function(e3, t3, i3, n3, r3, s3) {
|
|
1788
|
-
if (t3)
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
for (var o3 = e3.length, a3 = V(e3, o3), l3 = 0; l3 < o3; ++l3)
|
|
1792
|
-
a3[l3].call(i3, n3, r3, s3);
|
|
1793
|
-
}(i2, c2, this, arguments[1], arguments[2], arguments[3]);
|
|
2725
|
+
!(function(e3, t3, i3, n3, r3, s3) {
|
|
2726
|
+
if (t3) e3.call(i3, n3, r3, s3);
|
|
2727
|
+
else for (var o3 = e3.length, a3 = O(e3, o3), l3 = 0; l3 < o3; ++l3) a3[l3].call(i3, n3, r3, s3);
|
|
2728
|
+
})(i2, c2, this, arguments[1], arguments[2], arguments[3]);
|
|
1794
2729
|
break;
|
|
1795
2730
|
default:
|
|
1796
|
-
for (r2 = new Array(n2 - 1), s2 = 1; s2 < n2; s2++)
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
else
|
|
1802
|
-
for (var r3 = e3.length, s3 = V(e3, r3), o3 = 0; o3 < r3; ++o3)
|
|
1803
|
-
s3[o3].apply(i3, n3);
|
|
1804
|
-
}(i2, c2, this, r2);
|
|
2731
|
+
for (r2 = new Array(n2 - 1), s2 = 1; s2 < n2; s2++) r2[s2 - 1] = arguments[s2];
|
|
2732
|
+
!(function(e3, t3, i3, n3) {
|
|
2733
|
+
if (t3) e3.apply(i3, n3);
|
|
2734
|
+
else for (var r3 = e3.length, s3 = O(e3, r3), o3 = 0; o3 < r3; ++o3) s3[o3].apply(i3, n3);
|
|
2735
|
+
})(i2, c2, this, r2);
|
|
1805
2736
|
}
|
|
1806
2737
|
return true;
|
|
1807
|
-
},
|
|
1808
|
-
return
|
|
1809
|
-
},
|
|
1810
|
-
return
|
|
1811
|
-
},
|
|
1812
|
-
if ("function" != typeof t2)
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
return this.prependListener(e2, D(this, e2, t2)), this;
|
|
1819
|
-
}, k.prototype.removeListener = function(e2, t2) {
|
|
2738
|
+
}, x.prototype.addListener = function(e2, t2) {
|
|
2739
|
+
return D(this, e2, t2, false);
|
|
2740
|
+
}, x.prototype.on = x.prototype.addListener, x.prototype.prependListener = function(e2, t2) {
|
|
2741
|
+
return D(this, e2, t2, true);
|
|
2742
|
+
}, x.prototype.once = function(e2, t2) {
|
|
2743
|
+
if ("function" != typeof t2) throw new TypeError('"listener" argument must be a function');
|
|
2744
|
+
return this.on(e2, V(this, e2, t2)), this;
|
|
2745
|
+
}, x.prototype.prependOnceListener = function(e2, t2) {
|
|
2746
|
+
if ("function" != typeof t2) throw new TypeError('"listener" argument must be a function');
|
|
2747
|
+
return this.prependListener(e2, V(this, e2, t2)), this;
|
|
2748
|
+
}, x.prototype.removeListener = function(e2, t2) {
|
|
1820
2749
|
var i2, n2, r2, s2, o2;
|
|
1821
|
-
if ("function" != typeof t2)
|
|
1822
|
-
|
|
1823
|
-
if (!(
|
|
1824
|
-
|
|
1825
|
-
if (!(i2 = n2[e2]))
|
|
1826
|
-
return this;
|
|
1827
|
-
if (i2 === t2 || i2.listener && i2.listener === t2)
|
|
1828
|
-
0 === --this._eventsCount ? this._events = new M() : (delete n2[e2], n2.removeListener && this.emit("removeListener", e2, i2.listener || t2));
|
|
2750
|
+
if ("function" != typeof t2) throw new TypeError('"listener" argument must be a function');
|
|
2751
|
+
if (!(n2 = this._events)) return this;
|
|
2752
|
+
if (!(i2 = n2[e2])) return this;
|
|
2753
|
+
if (i2 === t2 || i2.listener && i2.listener === t2) 0 === --this._eventsCount ? this._events = new k() : (delete n2[e2], n2.removeListener && this.emit("removeListener", e2, i2.listener || t2));
|
|
1829
2754
|
else if ("function" != typeof i2) {
|
|
1830
|
-
for (r2 = -1, s2 = i2.length; s2-- > 0; )
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
if (r2 < 0)
|
|
1836
|
-
return this;
|
|
2755
|
+
for (r2 = -1, s2 = i2.length; s2-- > 0; ) if (i2[s2] === t2 || i2[s2].listener && i2[s2].listener === t2) {
|
|
2756
|
+
o2 = i2[s2].listener, r2 = s2;
|
|
2757
|
+
break;
|
|
2758
|
+
}
|
|
2759
|
+
if (r2 < 0) return this;
|
|
1837
2760
|
if (1 === i2.length) {
|
|
1838
|
-
if (i2[0] = void 0, 0 === --this._eventsCount)
|
|
1839
|
-
return this._events = new M(), this;
|
|
2761
|
+
if (i2[0] = void 0, 0 === --this._eventsCount) return this._events = new k(), this;
|
|
1840
2762
|
delete n2[e2];
|
|
1841
|
-
} else
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
e3.pop();
|
|
1846
|
-
}(i2, r2);
|
|
2763
|
+
} else !(function(e3, t3) {
|
|
2764
|
+
for (var i3 = t3, n3 = i3 + 1, r3 = e3.length; n3 < r3; i3 += 1, n3 += 1) e3[i3] = e3[n3];
|
|
2765
|
+
e3.pop();
|
|
2766
|
+
})(i2, r2);
|
|
1847
2767
|
n2.removeListener && this.emit("removeListener", e2, o2 || t2);
|
|
1848
2768
|
}
|
|
1849
2769
|
return this;
|
|
1850
|
-
},
|
|
2770
|
+
}, x.prototype.off = function(e2, t2) {
|
|
1851
2771
|
return this.removeListener(e2, t2);
|
|
1852
|
-
},
|
|
2772
|
+
}, x.prototype.removeAllListeners = function(e2) {
|
|
1853
2773
|
var t2, i2;
|
|
1854
|
-
if (!(i2 = this._events))
|
|
1855
|
-
|
|
1856
|
-
if (!i2.removeListener)
|
|
1857
|
-
return 0 === arguments.length ? (this._events = new M(), this._eventsCount = 0) : i2[e2] && (0 === --this._eventsCount ? this._events = new M() : delete i2[e2]), this;
|
|
2774
|
+
if (!(i2 = this._events)) return this;
|
|
2775
|
+
if (!i2.removeListener) return 0 === arguments.length ? (this._events = new k(), this._eventsCount = 0) : i2[e2] && (0 === --this._eventsCount ? this._events = new k() : delete i2[e2]), this;
|
|
1858
2776
|
if (0 === arguments.length) {
|
|
1859
|
-
for (var n2, r2 = Object.keys(i2), s2 = 0; s2 < r2.length; ++s2)
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
if (
|
|
1864
|
-
this.removeListener(e2, t2);
|
|
1865
|
-
|
|
1866
|
-
do {
|
|
1867
|
-
this.removeListener(e2, t2[t2.length - 1]);
|
|
1868
|
-
} while (t2[0]);
|
|
2777
|
+
for (var n2, r2 = Object.keys(i2), s2 = 0; s2 < r2.length; ++s2) "removeListener" !== (n2 = r2[s2]) && this.removeAllListeners(n2);
|
|
2778
|
+
return this.removeAllListeners("removeListener"), this._events = new k(), this._eventsCount = 0, this;
|
|
2779
|
+
}
|
|
2780
|
+
if ("function" == typeof (t2 = i2[e2])) this.removeListener(e2, t2);
|
|
2781
|
+
else if (t2) do {
|
|
2782
|
+
this.removeListener(e2, t2[t2.length - 1]);
|
|
2783
|
+
} while (t2[0]);
|
|
1869
2784
|
return this;
|
|
1870
|
-
},
|
|
2785
|
+
}, x.prototype.listeners = function(e2) {
|
|
1871
2786
|
var t2, i2 = this._events;
|
|
1872
|
-
return i2 && (t2 = i2[e2]) ? "function" == typeof t2 ? [t2.listener || t2] : function(e3) {
|
|
1873
|
-
for (var t3 = new Array(e3.length), i3 = 0; i3 < t3.length; ++i3)
|
|
1874
|
-
t3[i3] = e3[i3].listener || e3[i3];
|
|
2787
|
+
return i2 && (t2 = i2[e2]) ? "function" == typeof t2 ? [t2.listener || t2] : (function(e3) {
|
|
2788
|
+
for (var t3 = new Array(e3.length), i3 = 0; i3 < t3.length; ++i3) t3[i3] = e3[i3].listener || e3[i3];
|
|
1875
2789
|
return t3;
|
|
1876
|
-
}(t2) : [];
|
|
1877
|
-
},
|
|
2790
|
+
})(t2) : [];
|
|
2791
|
+
}, x.listenerCount = function(e2, t2) {
|
|
1878
2792
|
return "function" == typeof e2.listenerCount ? e2.listenerCount(t2) : F.call(e2, t2);
|
|
1879
|
-
},
|
|
2793
|
+
}, x.prototype.listenerCount = F, x.prototype.eventNames = function() {
|
|
1880
2794
|
return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
|
|
1881
2795
|
};
|
|
1882
|
-
const
|
|
1883
|
-
function z(e2) {
|
|
1884
|
-
if ("string" != typeof e2 && "symbol" != typeof e2)
|
|
1885
|
-
throw new TypeError("type is not type of string or symbol!");
|
|
1886
|
-
}
|
|
2796
|
+
const z = "function" == typeof Symbol ? /* @__PURE__ */ Symbol.for("--[[await-event-emitter]]--") : "--[[await-event-emitter]]--";
|
|
1887
2797
|
function _(e2) {
|
|
1888
|
-
if ("
|
|
1889
|
-
throw new TypeError("fn is not type of Function!");
|
|
2798
|
+
if ("string" != typeof e2 && "symbol" != typeof e2) throw new TypeError("type is not type of string or symbol!");
|
|
1890
2799
|
}
|
|
1891
2800
|
function H(e2) {
|
|
1892
|
-
|
|
2801
|
+
if ("function" != typeof e2) throw new TypeError("fn is not type of Function!");
|
|
1893
2802
|
}
|
|
1894
2803
|
function U(e2) {
|
|
1895
|
-
return { [
|
|
2804
|
+
return { [z]: "always", fn: e2 };
|
|
1896
2805
|
}
|
|
1897
|
-
|
|
2806
|
+
function $(e2) {
|
|
2807
|
+
return { [z]: "once", fn: e2 };
|
|
2808
|
+
}
|
|
2809
|
+
class B {
|
|
1898
2810
|
constructor() {
|
|
1899
2811
|
this._events = {};
|
|
1900
2812
|
}
|
|
@@ -1902,25 +2814,25 @@ var telerikReportViewer = (function (exports) {
|
|
|
1902
2814
|
return this.on(e2, t2);
|
|
1903
2815
|
}
|
|
1904
2816
|
on(e2, t2) {
|
|
1905
|
-
return
|
|
2817
|
+
return _(e2), H(t2), this._events[e2] = this._events[e2] || [], this._events[e2].push(U(t2)), this;
|
|
1906
2818
|
}
|
|
1907
2819
|
prependListener(e2, t2) {
|
|
1908
2820
|
return this.prepend(e2, t2);
|
|
1909
2821
|
}
|
|
1910
2822
|
prepend(e2, t2) {
|
|
1911
|
-
return
|
|
2823
|
+
return _(e2), H(t2), this._events[e2] = this._events[e2] || [], this._events[e2].unshift(U(t2)), this;
|
|
1912
2824
|
}
|
|
1913
2825
|
prependOnceListener(e2, t2) {
|
|
1914
2826
|
return this.prependOnce(e2, t2);
|
|
1915
2827
|
}
|
|
1916
2828
|
prependOnce(e2, t2) {
|
|
1917
|
-
return
|
|
2829
|
+
return _(e2), H(t2), this._events[e2] = this._events[e2] || [], this._events[e2].unshift($(t2)), this;
|
|
1918
2830
|
}
|
|
1919
2831
|
listeners(e2) {
|
|
1920
2832
|
return (this._events[e2] || []).map((e3) => e3.fn);
|
|
1921
2833
|
}
|
|
1922
2834
|
once(e2, t2) {
|
|
1923
|
-
return
|
|
2835
|
+
return _(e2), H(t2), this._events[e2] = this._events[e2] || [], this._events[e2].push($(t2)), this;
|
|
1924
2836
|
}
|
|
1925
2837
|
removeAllListeners() {
|
|
1926
2838
|
this._events = {};
|
|
@@ -1929,24 +2841,23 @@ var telerikReportViewer = (function (exports) {
|
|
|
1929
2841
|
return this.removeListener(e2, t2);
|
|
1930
2842
|
}
|
|
1931
2843
|
removeListener(e2, t2) {
|
|
1932
|
-
|
|
2844
|
+
_(e2);
|
|
1933
2845
|
const i2 = this.listeners(e2);
|
|
1934
2846
|
if ("function" == typeof t2) {
|
|
1935
2847
|
let n2 = -1, r2 = false;
|
|
1936
|
-
for (; (n2 = i2.indexOf(t2)) >= 0; )
|
|
1937
|
-
i2.splice(n2, 1), this._events[e2].splice(n2, 1), r2 = true;
|
|
2848
|
+
for (; (n2 = i2.indexOf(t2)) >= 0; ) i2.splice(n2, 1), this._events[e2].splice(n2, 1), r2 = true;
|
|
1938
2849
|
return r2;
|
|
1939
2850
|
}
|
|
1940
2851
|
return delete this._events[e2];
|
|
1941
2852
|
}
|
|
1942
2853
|
emit(e2, ...t2) {
|
|
1943
|
-
return
|
|
1944
|
-
|
|
2854
|
+
return s(this, void 0, void 0, function* () {
|
|
2855
|
+
_(e2);
|
|
1945
2856
|
const i2 = this.listeners(e2), n2 = [];
|
|
1946
2857
|
if (i2 && i2.length) {
|
|
1947
2858
|
for (let r2 = 0; r2 < i2.length; r2++) {
|
|
1948
2859
|
const s2 = i2[r2], o2 = s2.apply(this, t2);
|
|
1949
|
-
o2 instanceof Promise && (yield o2), this._events[e2] && this._events[e2][r2] && "once" === this._events[e2][r2][
|
|
2860
|
+
o2 instanceof Promise && (yield o2), this._events[e2] && this._events[e2][r2] && "once" === this._events[e2][r2][z] && n2.push(s2);
|
|
1950
2861
|
}
|
|
1951
2862
|
return n2.forEach((t3) => this.removeListener(e2, t3)), true;
|
|
1952
2863
|
}
|
|
@@ -1954,21 +2865,21 @@ var telerikReportViewer = (function (exports) {
|
|
|
1954
2865
|
});
|
|
1955
2866
|
}
|
|
1956
2867
|
emitSync(e2, ...t2) {
|
|
1957
|
-
|
|
2868
|
+
_(e2);
|
|
1958
2869
|
const i2 = this.listeners(e2), n2 = [];
|
|
1959
2870
|
if (i2 && i2.length) {
|
|
1960
2871
|
for (let r2 = 0; r2 < i2.length; r2++) {
|
|
1961
2872
|
const s2 = i2[r2];
|
|
1962
|
-
s2.apply(this, t2), this._events[e2] && this._events[e2][r2] && "once" === this._events[e2][r2][
|
|
2873
|
+
s2.apply(this, t2), this._events[e2] && this._events[e2][r2] && "once" === this._events[e2][r2][z] && n2.push(s2);
|
|
1963
2874
|
}
|
|
1964
2875
|
return n2.forEach((t3) => this.removeListener(e2, t3)), true;
|
|
1965
2876
|
}
|
|
1966
2877
|
return false;
|
|
1967
2878
|
}
|
|
1968
2879
|
}
|
|
1969
|
-
class
|
|
2880
|
+
class q {
|
|
1970
2881
|
constructor() {
|
|
1971
|
-
this.eventEmitter = new
|
|
2882
|
+
this.eventEmitter = new x(), this.awaitEventEmitter = new B();
|
|
1972
2883
|
}
|
|
1973
2884
|
on(e2, t2) {
|
|
1974
2885
|
return this.eventEmitter.on(e2, t2), this;
|
|
@@ -1980,30 +2891,16 @@ var telerikReportViewer = (function (exports) {
|
|
|
1980
2891
|
return this.awaitEventEmitter.on(e2, t2), this;
|
|
1981
2892
|
}
|
|
1982
2893
|
emitAsync(e2, ...t2) {
|
|
1983
|
-
return
|
|
2894
|
+
return s(this, void 0, void 0, function* () {
|
|
1984
2895
|
yield this.awaitEventEmitter.emit(e2, ...t2);
|
|
1985
2896
|
});
|
|
1986
2897
|
}
|
|
1987
2898
|
}
|
|
1988
|
-
class q {
|
|
1989
|
-
hasPdfPlugin() {
|
|
1990
|
-
let e2 = ["AcroPDF.PDF.1", "PDF.PdfCtrl.6", "PDF.PdfCtrl.5"];
|
|
1991
|
-
for (let t2 of e2)
|
|
1992
|
-
try {
|
|
1993
|
-
let e3 = new ActiveXObject(t2);
|
|
1994
|
-
if (e3)
|
|
1995
|
-
return null !== e3;
|
|
1996
|
-
} catch (e3) {
|
|
1997
|
-
}
|
|
1998
|
-
return false;
|
|
1999
|
-
}
|
|
2000
|
-
}
|
|
2001
2899
|
class W {
|
|
2002
2900
|
hasPdfPlugin() {
|
|
2003
2901
|
let e2 = /Firefox[/\s](\d+\.\d+)/.exec(navigator.userAgent);
|
|
2004
2902
|
if (null !== e2 && e2.length > 1) {
|
|
2005
|
-
if (parseFloat(e2[1]) >= 19)
|
|
2006
|
-
return false;
|
|
2903
|
+
if (parseFloat(e2[1]) >= 19) return false;
|
|
2007
2904
|
}
|
|
2008
2905
|
let t2 = navigator.mimeTypes["application/pdf"], i2 = null !== t2 ? t2.enabledPlugin : null;
|
|
2009
2906
|
if (i2) {
|
|
@@ -2018,9 +2915,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2018
2915
|
this.defaultPlugin = e2;
|
|
2019
2916
|
}
|
|
2020
2917
|
hasPdfPlugin() {
|
|
2021
|
-
for (let e2 of navigator.plugins)
|
|
2022
|
-
if (e2.name === this.defaultPlugin || "Adobe Acrobat" === e2.name)
|
|
2023
|
-
return true;
|
|
2918
|
+
for (let e2 of navigator.plugins) if (e2.name === this.defaultPlugin || "Adobe Acrobat" === e2.name) return true;
|
|
2024
2919
|
return false;
|
|
2025
2920
|
}
|
|
2026
2921
|
}
|
|
@@ -2029,68 +2924,68 @@ var telerikReportViewer = (function (exports) {
|
|
|
2029
2924
|
return false;
|
|
2030
2925
|
}
|
|
2031
2926
|
}
|
|
2032
|
-
function J() {
|
|
2033
|
-
return window.navigator && window.navigator.msSaveOrOpenBlob;
|
|
2034
|
-
}
|
|
2035
2927
|
class G {
|
|
2036
2928
|
constructor() {
|
|
2037
|
-
this.hasPdfPlugin = false, this.iframe = null, this.hasPdfPlugin =
|
|
2929
|
+
this.hasPdfPlugin = false, this.iframe = null, this.hasPdfPlugin = this.detectPdfSupport(), this.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
2930
|
+
}
|
|
2931
|
+
detectPdfSupport() {
|
|
2932
|
+
return "boolean" == typeof navigator.pdfViewerEnabled ? navigator.pdfViewerEnabled : (function() {
|
|
2038
2933
|
if (window.navigator) {
|
|
2039
2934
|
let e2 = window.navigator.userAgent.toLowerCase();
|
|
2040
|
-
return e2.indexOf("
|
|
2935
|
+
return e2.indexOf("firefox") > -1 ? new W() : e2.indexOf("edg/") > -1 ? new Z("Microsoft Edge PDF Plugin") : e2.indexOf("chrome") > -1 ? new Z("Chrome PDF Viewer") : e2.indexOf("safari") > -1 ? new Z("WebKit built-in PDF") : new j();
|
|
2041
2936
|
}
|
|
2042
2937
|
return new j();
|
|
2043
|
-
}().hasPdfPlugin()
|
|
2938
|
+
})().hasPdfPlugin();
|
|
2044
2939
|
}
|
|
2045
2940
|
destroy() {
|
|
2046
2941
|
this.iframe = null;
|
|
2047
2942
|
}
|
|
2048
|
-
printDesktop(e2) {
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2943
|
+
printDesktop(e2, t2) {
|
|
2944
|
+
if (!this.hasPdfPlugin) return console.warn("Direct printing is not supported in this browser. The PDF document will be downloaded instead."), void this.printViaDownload(e2, t2);
|
|
2945
|
+
let i2 = null;
|
|
2946
|
+
this.iframe || (this.iframe = document.createElement("iframe"), this.iframe.style.display = "none", this.iframe.onload = () => {
|
|
2947
|
+
var e3, t3;
|
|
2052
2948
|
try {
|
|
2053
|
-
null === (
|
|
2949
|
+
null === (t3 = null === (e3 = this.iframe) || void 0 === e3 ? void 0 : e3.contentDocument) || void 0 === t3 || t3.execCommand("print", true);
|
|
2054
2950
|
} finally {
|
|
2055
|
-
|
|
2951
|
+
i2 && URL.revokeObjectURL(i2);
|
|
2056
2952
|
}
|
|
2057
|
-
})
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2953
|
+
});
|
|
2954
|
+
let n2 = new XMLHttpRequest();
|
|
2955
|
+
n2.open("GET", e2, true), n2.responseType = "arraybuffer", n2.onload = () => {
|
|
2956
|
+
200 === n2.status ? (i2 = URL.createObjectURL(new Blob([n2.response], { type: "application/pdf" })), null != this.iframe && (this.iframe.src = i2, document.body.appendChild(this.iframe))) : console.log("Could not retrieve remote PDF document.");
|
|
2957
|
+
}, n2.send();
|
|
2958
|
+
}
|
|
2959
|
+
printViaDownload(e2, t2) {
|
|
2960
|
+
let i2 = new XMLHttpRequest();
|
|
2961
|
+
i2.open("GET", e2, true), i2.responseType = "arraybuffer", i2.onload = () => {
|
|
2962
|
+
if (200 === i2.status) {
|
|
2963
|
+
let e3 = URL.createObjectURL(new Blob([i2.response], { type: "application/pdf" })), n2 = document.createElement("a");
|
|
2964
|
+
n2.href = e3, n2.download = `${t2}.pdf`, n2.click(), URL.revokeObjectURL(e3);
|
|
2965
|
+
} else console.log("Could not retrieve PDF document for printing.");
|
|
2069
2966
|
}, i2.send();
|
|
2070
2967
|
}
|
|
2071
2968
|
printMobile(e2) {
|
|
2072
2969
|
window.open(e2, "_self");
|
|
2073
2970
|
}
|
|
2074
|
-
print(e2) {
|
|
2075
|
-
this.isMobile ? this.printMobile(e2) : this.printDesktop(e2);
|
|
2971
|
+
print(e2, t2) {
|
|
2972
|
+
this.isMobile ? this.printMobile(e2) : this.printDesktop(e2, t2);
|
|
2076
2973
|
}
|
|
2077
2974
|
getDirectPrintState() {
|
|
2078
2975
|
return this.hasPdfPlugin;
|
|
2079
2976
|
}
|
|
2080
2977
|
}
|
|
2081
|
-
function
|
|
2978
|
+
function J(e2) {
|
|
2082
2979
|
return 1e3 * e2;
|
|
2083
2980
|
}
|
|
2084
|
-
class
|
|
2981
|
+
class K {
|
|
2085
2982
|
constructor(e2, t2, i2) {
|
|
2086
|
-
if (this.pingMilliseconds = 0, !e2)
|
|
2087
|
-
throw "Error";
|
|
2983
|
+
if (this.pingMilliseconds = 0, !e2) throw "Error";
|
|
2088
2984
|
this.serviceClient = e2, this.clientID = t2, this.initSessionTimeout(i2);
|
|
2089
2985
|
}
|
|
2090
2986
|
initSessionTimeout(e2) {
|
|
2091
|
-
if (!isFinite(e2))
|
|
2092
|
-
|
|
2093
|
-
this.pingMilliseconds = e2 <= 120 ? K(e2) / 2 : K(e2 - 60);
|
|
2987
|
+
if (!isFinite(e2)) throw "sessionTimeoutSeconds must be finite";
|
|
2988
|
+
this.pingMilliseconds = e2 <= 120 ? J(e2) / 2 : J(e2 - 60);
|
|
2094
2989
|
}
|
|
2095
2990
|
start() {
|
|
2096
2991
|
this.pingMilliseconds <= 0 || (this.interval = setInterval(() => {
|
|
@@ -2101,66 +2996,60 @@ var telerikReportViewer = (function (exports) {
|
|
|
2101
2996
|
this.interval && (clearInterval(this.interval), this.interval = null);
|
|
2102
2997
|
}
|
|
2103
2998
|
}
|
|
2104
|
-
var Y, Q, ee, te
|
|
2105
|
-
function
|
|
2999
|
+
var X, Y, Q, ee, te;
|
|
3000
|
+
function ie(e2, t2 = "", i2 = "") {
|
|
2106
3001
|
let n2 = document.createElement(e2);
|
|
2107
|
-
return t2 && (n2.id = t2),
|
|
3002
|
+
return t2 && (n2.id = t2), ne(n2, i2), n2;
|
|
2108
3003
|
}
|
|
2109
|
-
function
|
|
2110
|
-
if ("" === t2 || !e2)
|
|
2111
|
-
return;
|
|
3004
|
+
function ne(e2, t2) {
|
|
3005
|
+
if ("" === t2 || !e2) return;
|
|
2112
3006
|
let i2 = t2.trim().split(" ");
|
|
2113
3007
|
i2 = i2.filter((e3) => "" !== e3.trim()), e2.classList.add(...i2);
|
|
2114
3008
|
}
|
|
2115
|
-
function
|
|
2116
|
-
if ("" === t2 || !e2)
|
|
2117
|
-
return;
|
|
3009
|
+
function re(e2, t2) {
|
|
3010
|
+
if ("" === t2 || !e2) return;
|
|
2118
3011
|
let i2 = t2.trim().split(" ");
|
|
2119
3012
|
i2 = i2.filter((e3) => "" !== e3.trim()), e2.classList.remove(...i2);
|
|
2120
3013
|
}
|
|
2121
|
-
function
|
|
3014
|
+
function se(e2, t2) {
|
|
2122
3015
|
return e2.classList.contains(t2);
|
|
2123
3016
|
}
|
|
2124
|
-
function
|
|
3017
|
+
function oe(e2) {
|
|
2125
3018
|
return e2.offsetParent;
|
|
2126
3019
|
}
|
|
2127
|
-
function
|
|
3020
|
+
function ae(e2) {
|
|
2128
3021
|
return parseInt(e2, 10) || 0;
|
|
2129
3022
|
}
|
|
2130
|
-
function
|
|
3023
|
+
function le(e2, t2, i2, n2 = 0, r2 = 0) {
|
|
2131
3024
|
let s2 = `${n2 = n2 || 0} ${r2 = r2 || 0}`;
|
|
2132
|
-
!function(e3, t3) {
|
|
3025
|
+
!(function(e3, t3) {
|
|
2133
3026
|
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);
|
|
2134
|
-
}(e2, `scale(${t2 = t2 || 1}, ${i2 = i2 || 1})`), function(e3, t3) {
|
|
3027
|
+
})(e2, `scale(${t2 = t2 || 1}, ${i2 = i2 || 1})`), (function(e3, t3) {
|
|
2135
3028
|
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);
|
|
2136
|
-
}(e2, s2);
|
|
3029
|
+
})(e2, s2);
|
|
2137
3030
|
}
|
|
2138
|
-
function
|
|
2139
|
-
let t2 =
|
|
3031
|
+
function he(e2) {
|
|
3032
|
+
let t2 = ie("div");
|
|
2140
3033
|
return t2.textContent = e2, t2.innerHTML;
|
|
2141
3034
|
}
|
|
2142
|
-
function
|
|
3035
|
+
function ce(e2) {
|
|
2143
3036
|
if (e2 && e2.length < 6) {
|
|
2144
3037
|
let t3 = 1, i2 = e2.split("");
|
|
2145
|
-
for ("#" !== i2[0] && (t3 = 0); t3 < i2.length; t3++)
|
|
2146
|
-
i2[t3] = i2[t3] + i2[t3];
|
|
3038
|
+
for ("#" !== i2[0] && (t3 = 0); t3 < i2.length; t3++) i2[t3] = i2[t3] + i2[t3];
|
|
2147
3039
|
e2 = i2.join("");
|
|
2148
3040
|
}
|
|
2149
3041
|
let t2 = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e2);
|
|
2150
3042
|
return t2 ? parseInt(t2[1], 16) + ", " + parseInt(t2[2], 16) + ", " + parseInt(t2[3], 16) : null;
|
|
2151
3043
|
}
|
|
2152
|
-
function
|
|
3044
|
+
function de(e2) {
|
|
2153
3045
|
return !!e2 && e2.indexOf(",") > -1;
|
|
2154
3046
|
}
|
|
2155
|
-
function
|
|
2156
|
-
if ("transparent" === e2.toLowerCase())
|
|
2157
|
-
|
|
2158
|
-
if (!ue(e2))
|
|
2159
|
-
return 1;
|
|
3047
|
+
function ue(e2) {
|
|
3048
|
+
if ("transparent" === e2.toLowerCase()) return 0;
|
|
3049
|
+
if (!de(e2)) return 1;
|
|
2160
3050
|
if (-1 !== e2.indexOf("#")) {
|
|
2161
|
-
let t3 =
|
|
2162
|
-
if (null === t3)
|
|
2163
|
-
return 1;
|
|
3051
|
+
let t3 = ce(e2);
|
|
3052
|
+
if (null === t3) return 1;
|
|
2164
3053
|
e2 = t3;
|
|
2165
3054
|
}
|
|
2166
3055
|
let t2 = e2.split(",").map(function(e3) {
|
|
@@ -2168,34 +3057,28 @@ var telerikReportViewer = (function (exports) {
|
|
|
2168
3057
|
});
|
|
2169
3058
|
return 4 === t2.length ? parseFloat((parseFloat(t2[3].replace(/[()]/g, "")) / 255).toFixed(2)) : 1;
|
|
2170
3059
|
}
|
|
3060
|
+
function pe(e2, t2) {
|
|
3061
|
+
let i2 = ie("div");
|
|
3062
|
+
for (i2.innerHTML = t2; i2.childNodes.length; ) e2.appendChild(i2.childNodes[0]);
|
|
3063
|
+
}
|
|
2171
3064
|
function ge(e2, t2) {
|
|
2172
|
-
let i2 =
|
|
2173
|
-
for (i2.innerHTML = t2; i2.childNodes.length; )
|
|
2174
|
-
e2.appendChild(i2.childNodes[0]);
|
|
3065
|
+
let i2 = ie("div");
|
|
3066
|
+
for (i2.innerHTML = t2; i2.childNodes.length; ) e2.prepend(i2.childNodes[i2.childNodes.length - 1]);
|
|
2175
3067
|
}
|
|
2176
3068
|
function fe(e2, t2) {
|
|
2177
|
-
let i2 = ne("div");
|
|
2178
|
-
for (i2.innerHTML = t2; i2.childNodes.length; )
|
|
2179
|
-
e2.prepend(i2.childNodes[i2.childNodes.length - 1]);
|
|
2180
|
-
}
|
|
2181
|
-
function me(e2, t2) {
|
|
2182
3069
|
return e2 ? e2.querySelector(t2) : null;
|
|
2183
3070
|
}
|
|
2184
|
-
function
|
|
2185
|
-
var i2;
|
|
2186
|
-
return e2 && e2.attributes && (null === (i2 = e2.attributes[t2]) || void 0 === i2 ? void 0 : i2.value) || "";
|
|
2187
|
-
}
|
|
2188
|
-
function Pe(e2) {
|
|
3071
|
+
function me(e2) {
|
|
2189
3072
|
let t2 = e2.parentElement;
|
|
2190
|
-
return t2 ? t2.clientHeight != t2.scrollHeight ? t2 :
|
|
3073
|
+
return t2 ? t2.clientHeight != t2.scrollHeight ? t2 : me(t2) : null;
|
|
2191
3074
|
}
|
|
2192
|
-
function
|
|
3075
|
+
function ve(e2, t2 = 300) {
|
|
2193
3076
|
let i2;
|
|
2194
3077
|
return function(...n2) {
|
|
2195
3078
|
clearTimeout(i2), i2 = setTimeout(() => e2.apply(this, n2), t2);
|
|
2196
3079
|
};
|
|
2197
3080
|
}
|
|
2198
|
-
function
|
|
3081
|
+
function Pe(e2, t2) {
|
|
2199
3082
|
let i2 = null;
|
|
2200
3083
|
return function(n2, ...r2) {
|
|
2201
3084
|
i2 || (i2 = setTimeout(function() {
|
|
@@ -2203,70 +3086,62 @@ var telerikReportViewer = (function (exports) {
|
|
|
2203
3086
|
}, t2));
|
|
2204
3087
|
};
|
|
2205
3088
|
}
|
|
2206
|
-
function
|
|
3089
|
+
function Ce(e2, t2) {
|
|
2207
3090
|
return !!e2.responseJSON && e2.responseJSON.exceptionType === t2;
|
|
2208
3091
|
}
|
|
2209
|
-
function
|
|
2210
|
-
return
|
|
3092
|
+
function ye(e2) {
|
|
3093
|
+
return Ce(e2, "Telerik.Reporting.Services.Engine.InvalidClientException");
|
|
2211
3094
|
}
|
|
2212
|
-
function
|
|
2213
|
-
return
|
|
3095
|
+
function Se(e2) {
|
|
3096
|
+
return Ce(e2, "Telerik.Reporting.Services.Engine.InvalidParameterException");
|
|
2214
3097
|
}
|
|
2215
|
-
function
|
|
3098
|
+
function Ie(e2) {
|
|
2216
3099
|
return !!e2 && "internalservererror" === e2.split(" ").join("").toLowerCase();
|
|
2217
3100
|
}
|
|
2218
|
-
function
|
|
3101
|
+
function be(e2, ...t2) {
|
|
2219
3102
|
return e2.replace(/{(\d+)}/g, (e3, i2) => t2[i2] || "");
|
|
2220
3103
|
}
|
|
2221
|
-
function
|
|
3104
|
+
function we(e2, t2) {
|
|
2222
3105
|
let i2, n2;
|
|
2223
|
-
if (
|
|
2224
|
-
|
|
2225
|
-
;
|
|
2226
|
-
else
|
|
2227
|
-
for (n2 in e2)
|
|
2228
|
-
if (false === t2.call(e2[n2], n2, e2[n2]))
|
|
2229
|
-
break;
|
|
3106
|
+
if (Le(e2)) for (i2 = e2.length, n2 = 0; n2 < i2 && false !== t2.call(e2[n2], n2, e2[n2]); n2++) ;
|
|
3107
|
+
else for (n2 in e2) if (false === t2.call(e2[n2], n2, e2[n2])) break;
|
|
2230
3108
|
return e2;
|
|
2231
3109
|
}
|
|
2232
|
-
function
|
|
2233
|
-
if (Array.isArray(e2))
|
|
2234
|
-
return true;
|
|
3110
|
+
function Le(e2) {
|
|
3111
|
+
if (Array.isArray(e2)) return true;
|
|
2235
3112
|
return "number" == typeof (!!e2 && "length" in e2 && e2.length);
|
|
2236
3113
|
}
|
|
2237
|
-
function
|
|
3114
|
+
function Te(e2) {
|
|
2238
3115
|
return /^(\-|\+)?([0-9]+)$/.test(e2) ? Number(e2) : NaN;
|
|
2239
3116
|
}
|
|
2240
|
-
function
|
|
3117
|
+
function Re(e2) {
|
|
2241
3118
|
return /^(\-|\+)?([0-9]+(\.[0-9]+)?)$/.test(e2) ? Number(e2) : NaN;
|
|
2242
3119
|
}
|
|
2243
|
-
function
|
|
3120
|
+
function Ae(e2) {
|
|
2244
3121
|
return e2 instanceof Date ? e2 : (/Z|[\+\-]\d\d:?\d\d/i.test(e2) || (e2 += "Z"), new Date(e2));
|
|
2245
3122
|
}
|
|
2246
|
-
e.PageMode = void 0, (
|
|
2247
|
-
const
|
|
2248
|
-
var
|
|
3123
|
+
e.PageMode = void 0, (X = e.PageMode || (e.PageMode = {}))[X.ContinuousScroll = 0] = "ContinuousScroll", X[X.SinglePage = 1] = "SinglePage", e.PrintMode = void 0, (Y = e.PrintMode || (e.PrintMode = {}))[Y.AutoSelect = 0] = "AutoSelect", Y[Y.ForcePDFPlugin = 1] = "ForcePDFPlugin", Y[Y.ForcePDFFile = 2] = "ForcePDFFile", e.ScaleMode = void 0, (Q = e.ScaleMode || (e.ScaleMode = {}))[Q.FitPageWidth = 0] = "FitPageWidth", Q[Q.FitPage = 1] = "FitPage", Q[Q.Specific = 2] = "Specific", e.ServiceType = void 0, (ee = e.ServiceType || (e.ServiceType = {}))[ee.REST = 0] = "REST", ee[ee.ReportServer = 1] = "ReportServer", e.ViewMode = void 0, (te = e.ViewMode || (e.ViewMode = {}))[te.Interactive = 0] = "Interactive", te[te.PrintPreview = 1] = "PrintPreview";
|
|
3124
|
+
const Ee = "System.Int64", Me = "System.Double", ke = "System.String", xe = "System.DateTime", Ne = "System.Boolean";
|
|
3125
|
+
var De = (function() {
|
|
2249
3126
|
var e2 = {};
|
|
2250
3127
|
function t2(e3, t3, i3, n2) {
|
|
2251
3128
|
var r2 = [].concat(t3).map(function(t4) {
|
|
2252
|
-
return function(e4, t5, i4) {
|
|
3129
|
+
return (function(e4, t5, i4) {
|
|
2253
3130
|
if (e4.availableValues) {
|
|
2254
3131
|
var n3 = false;
|
|
2255
|
-
if (
|
|
3132
|
+
if (we(e4.availableValues, function(e5, r3) {
|
|
2256
3133
|
return !(n3 = i4(t5, r3.value));
|
|
2257
3134
|
}), !n3) {
|
|
2258
|
-
if (e4.allowNull && !t5)
|
|
2259
|
-
return t5;
|
|
3135
|
+
if (e4.allowNull && !t5) return t5;
|
|
2260
3136
|
throw "Please input a valid value.";
|
|
2261
3137
|
}
|
|
2262
3138
|
}
|
|
2263
3139
|
return t5;
|
|
2264
|
-
}(e3, i3(t4), n2);
|
|
3140
|
+
})(e3, i3(t4), n2);
|
|
2265
3141
|
});
|
|
2266
3142
|
if (e3.multivalue) {
|
|
2267
3143
|
if (null == t3 || 0 == t3.length) {
|
|
2268
|
-
if (e3.allowNull)
|
|
2269
|
-
return t3;
|
|
3144
|
+
if (e3.allowNull) return t3;
|
|
2270
3145
|
throw "Please input a valid value.";
|
|
2271
3146
|
}
|
|
2272
3147
|
return r2;
|
|
@@ -2276,76 +3151,66 @@ var telerikReportViewer = (function (exports) {
|
|
|
2276
3151
|
function i2(e3, t3) {
|
|
2277
3152
|
return e3.allowNull && -1 != [null, "", void 0].indexOf(t3);
|
|
2278
3153
|
}
|
|
2279
|
-
return e2[
|
|
3154
|
+
return e2[ke] = { validate: function(e3, i3) {
|
|
2280
3155
|
return t2(e3, i3, function(t3) {
|
|
2281
3156
|
if (!t3) {
|
|
2282
|
-
if (e3.allowNull)
|
|
2283
|
-
|
|
2284
|
-
if (e3.allowBlank)
|
|
2285
|
-
return "";
|
|
3157
|
+
if (e3.allowNull) return null;
|
|
3158
|
+
if (e3.allowBlank) return "";
|
|
2286
3159
|
throw "Parameter value cannot be empty.";
|
|
2287
3160
|
}
|
|
2288
3161
|
return t3;
|
|
2289
3162
|
}, function(e4, t3) {
|
|
2290
3163
|
return e4 == t3;
|
|
2291
3164
|
});
|
|
2292
|
-
} }, e2[
|
|
3165
|
+
} }, e2[Me] = { validate: function(e3, n2) {
|
|
2293
3166
|
return t2(e3, n2, function(t3) {
|
|
2294
|
-
var n3 =
|
|
3167
|
+
var n3 = Re(t3);
|
|
2295
3168
|
if (isNaN(n3)) {
|
|
2296
|
-
if (i2(e3, t3))
|
|
2297
|
-
return null;
|
|
3169
|
+
if (i2(e3, t3)) return null;
|
|
2298
3170
|
throw "Parameter value cannot be empty.";
|
|
2299
3171
|
}
|
|
2300
3172
|
return n3;
|
|
2301
3173
|
}, function(e4, t3) {
|
|
2302
|
-
return
|
|
3174
|
+
return Re(e4) == Re(t3);
|
|
2303
3175
|
});
|
|
2304
|
-
} }, e2[
|
|
3176
|
+
} }, e2[Ee] = { validate: function(e3, n2) {
|
|
2305
3177
|
return t2(e3, n2, function(t3) {
|
|
2306
|
-
var n3 =
|
|
3178
|
+
var n3 = Te(t3);
|
|
2307
3179
|
if (isNaN(n3)) {
|
|
2308
|
-
if (i2(e3, t3))
|
|
2309
|
-
return null;
|
|
3180
|
+
if (i2(e3, t3)) return null;
|
|
2310
3181
|
throw "Parameter value cannot be empty.";
|
|
2311
3182
|
}
|
|
2312
3183
|
return n3;
|
|
2313
3184
|
}, function(e4, t3) {
|
|
2314
|
-
return
|
|
3185
|
+
return Te(e4) == Re(t3);
|
|
2315
3186
|
});
|
|
2316
|
-
} }, e2[
|
|
3187
|
+
} }, e2[xe] = { validate: function(e3, i3) {
|
|
2317
3188
|
return t2(e3, i3, function(t3) {
|
|
2318
|
-
if (e3.allowNull && (null === t3 || "" === t3 || void 0 === t3))
|
|
2319
|
-
|
|
2320
|
-
if (!isNaN(Date.parse(t3)))
|
|
2321
|
-
return e3.availableValues ? t3 : Me(t3);
|
|
3189
|
+
if (e3.allowNull && (null === t3 || "" === t3 || void 0 === t3)) return null;
|
|
3190
|
+
if (!isNaN(Date.parse(t3))) return e3.availableValues ? t3 : Ae(t3);
|
|
2322
3191
|
throw "Please input a valid date.";
|
|
2323
3192
|
}, function(e4, t3) {
|
|
2324
|
-
return e4 =
|
|
3193
|
+
return e4 = Ae(e4), t3 = Ae(t3), e4.getTime() == t3.getTime();
|
|
2325
3194
|
});
|
|
2326
|
-
} }, e2[
|
|
3195
|
+
} }, e2[Ne] = { validate: function(e3, n2) {
|
|
2327
3196
|
return t2(e3, n2, function(t3) {
|
|
2328
|
-
if (-1 != ["true", "false"].indexOf(String(t3).toLowerCase()))
|
|
2329
|
-
|
|
2330
|
-
if (i2(e3, t3))
|
|
2331
|
-
return null;
|
|
3197
|
+
if (-1 != ["true", "false"].indexOf(String(t3).toLowerCase())) return Boolean(t3);
|
|
3198
|
+
if (i2(e3, t3)) return null;
|
|
2332
3199
|
throw "Parameter value cannot be empty.";
|
|
2333
3200
|
}, function(e4, t3) {
|
|
2334
3201
|
return Boolean(e4) == Boolean(t3);
|
|
2335
3202
|
});
|
|
2336
3203
|
} }, { validate: function(t3, i3) {
|
|
2337
3204
|
var n2 = e2[t3.type];
|
|
2338
|
-
if (!n2)
|
|
2339
|
-
throw Le("Cannot validate parameter of type {type}.", t3);
|
|
3205
|
+
if (!n2) throw be("Cannot validate parameter of type {type}.", t3);
|
|
2340
3206
|
return n2.validate(t3, i3);
|
|
2341
3207
|
} };
|
|
2342
|
-
}();
|
|
2343
|
-
function
|
|
3208
|
+
})();
|
|
3209
|
+
function Ve(e2, t2, i2) {
|
|
2344
3210
|
try {
|
|
2345
3211
|
const n2 = e2.availableValues.find((e3) => e3.value === t2);
|
|
2346
3212
|
if (!n2) {
|
|
2347
|
-
if (e2.allowNull && null === t2)
|
|
2348
|
-
return { valueMember: null, displayMember: null };
|
|
3213
|
+
if (e2.allowNull && null === t2) return { valueMember: null, displayMember: null };
|
|
2349
3214
|
throw new Error(`The available values of parameter ${i2} do not contain Value property that equals ${t2}`);
|
|
2350
3215
|
}
|
|
2351
3216
|
return { valueMember: t2, displayMember: n2.name };
|
|
@@ -2353,18 +3218,17 @@ var telerikReportViewer = (function (exports) {
|
|
|
2353
3218
|
return;
|
|
2354
3219
|
}
|
|
2355
3220
|
}
|
|
2356
|
-
function
|
|
3221
|
+
function Fe(e2, t2, i2) {
|
|
2357
3222
|
const n2 = [];
|
|
2358
|
-
for (let r2 in t2)
|
|
2359
|
-
n2.push(Oe(e2, t2[r2], i2));
|
|
3223
|
+
for (let r2 in t2) n2.push(Ve(e2, t2[r2], i2));
|
|
2360
3224
|
return n2;
|
|
2361
3225
|
}
|
|
2362
|
-
class
|
|
3226
|
+
class Oe {
|
|
2363
3227
|
constructor(e2 = "", t2 = {}) {
|
|
2364
3228
|
this.report = e2, this.parameters = t2;
|
|
2365
3229
|
}
|
|
2366
3230
|
}
|
|
2367
|
-
class
|
|
3231
|
+
class ze extends q {
|
|
2368
3232
|
constructor(e2) {
|
|
2369
3233
|
super(), this.resizeObserver = null, this.element = e2, this.initResizeObserver();
|
|
2370
3234
|
}
|
|
@@ -2372,7 +3236,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2372
3236
|
this.destroyResizeObserver();
|
|
2373
3237
|
}
|
|
2374
3238
|
initResizeObserver() {
|
|
2375
|
-
this.debounceResize =
|
|
3239
|
+
this.debounceResize = ve(this.onResize.bind(this), 50), this.resizeObserver = new ResizeObserver(this.debounceResize), this.resizeObserver.observe(this.element);
|
|
2376
3240
|
}
|
|
2377
3241
|
destroyResizeObserver() {
|
|
2378
3242
|
this.resizeObserver && this.resizeObserver.unobserve(this.element), this.resizeObserver = this.debounceResize = null;
|
|
@@ -2381,8 +3245,8 @@ var telerikReportViewer = (function (exports) {
|
|
|
2381
3245
|
e2[0].target === this.element && this.emit("resize");
|
|
2382
3246
|
}
|
|
2383
3247
|
}
|
|
2384
|
-
const
|
|
2385
|
-
class
|
|
3248
|
+
const _e = '<div class="trv-report-page trv-skeleton-page trv-skeleton-{0}" data-page="{0}"><div class="trv-skeleton-wrapper"></div></div>';
|
|
3249
|
+
class He {
|
|
2386
3250
|
constructor(t2, i2, n2) {
|
|
2387
3251
|
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));
|
|
2388
3252
|
}
|
|
@@ -2404,10 +3268,10 @@ var telerikReportViewer = (function (exports) {
|
|
|
2404
3268
|
return this.enabled;
|
|
2405
3269
|
}
|
|
2406
3270
|
enable() {
|
|
2407
|
-
this.enabled = true,
|
|
3271
|
+
this.enabled = true, ne(this.placeholder, "scrollable"), this.initEvents();
|
|
2408
3272
|
}
|
|
2409
3273
|
disable() {
|
|
2410
|
-
this.enabled && (this.lastLoadedPage = null, this.pageWrapper.innerHTML = "", this.enabled = false,
|
|
3274
|
+
this.enabled && (this.lastLoadedPage = null, this.pageWrapper.innerHTML = "", this.enabled = false, re(this.placeholder, "scrollable"), this.unbind());
|
|
2411
3275
|
}
|
|
2412
3276
|
renderPage(e2) {
|
|
2413
3277
|
let t2 = this.controller.getViewMode(), i2 = this.findPageElement(e2.pageNumber);
|
|
@@ -2422,7 +3286,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2422
3286
|
this.enabled && this.currentPageNumber() > 0 && this.keepCurrentPageInToView();
|
|
2423
3287
|
}
|
|
2424
3288
|
setCurrentPage(e2) {
|
|
2425
|
-
e2 !== this.currentPageNumber() && this.controller.setCurrentPageNumber(e2), this.controller.getPageCount() > 1 && (
|
|
3289
|
+
e2 !== this.currentPageNumber() && this.controller.setCurrentPageNumber(e2), this.controller.getPageCount() > 1 && (re(this.findElement(".k-state-default"), "k-state-default"), ne(this.findPageElement(e2), "k-state-default")), this.loadNextPreviousPage(e2);
|
|
2426
3290
|
}
|
|
2427
3291
|
updatePageArea(e2) {
|
|
2428
3292
|
var t2;
|
|
@@ -2447,31 +3311,28 @@ var telerikReportViewer = (function (exports) {
|
|
|
2447
3311
|
return this.controller.getCurrentPageNumber();
|
|
2448
3312
|
}
|
|
2449
3313
|
isSkeletonScreen(e2, t2) {
|
|
2450
|
-
return !(!e2 && !(e2 = this.findPageElement(t2))) &&
|
|
3314
|
+
return !(!e2 && !(e2 = this.findPageElement(t2))) && se(e2, "trv-skeleton-" + t2);
|
|
2451
3315
|
}
|
|
2452
3316
|
addSkeletonScreen(e2, t2) {
|
|
2453
|
-
let i2 =
|
|
2454
|
-
t2 ?
|
|
3317
|
+
let i2 = be(_e, e2);
|
|
3318
|
+
t2 ? ge(this.pageWrapper, i2) : pe(this.pageWrapper, i2);
|
|
2455
3319
|
}
|
|
2456
3320
|
generateSkeletonScreens(e2) {
|
|
2457
3321
|
var t2;
|
|
2458
|
-
let i2 = "", n2 =
|
|
2459
|
-
for (;
|
|
2460
|
-
|
|
2461
|
-
ge(this.pageWrapper, i2);
|
|
3322
|
+
let i2 = "", n2 = null === (t2 = this.findLastElement(".trv-report-page")) || void 0 === t2 ? void 0 : t2.dataset.page, r2 = n2 ? parseInt(n2) + 1 : 1;
|
|
3323
|
+
for (; r2 < e2; r2++) i2 += be(_e, r2);
|
|
3324
|
+
pe(this.pageWrapper, i2);
|
|
2462
3325
|
}
|
|
2463
3326
|
loadMorePages() {
|
|
2464
3327
|
var e2;
|
|
2465
3328
|
let t2 = this.controller.getPageCount(), i2 = this.pageContainer.offsetHeight > this.pageWrapper.offsetHeight;
|
|
2466
|
-
if (t2 > 1)
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
} else
|
|
2474
|
-
this.loadVisiblePages(), this.scrollInProgress = false;
|
|
3329
|
+
if (t2 > 1) if (i2) {
|
|
3330
|
+
this.scrollInProgress = true;
|
|
3331
|
+
let i3 = null === (e2 = this.findLastElement(".trv-report-page")) || void 0 === e2 ? void 0 : e2.dataset.page, n2 = i3 ? parseInt(i3) + 1 : 1;
|
|
3332
|
+
n2 <= t2 && this.getAndRenderPage(n2).then(() => {
|
|
3333
|
+
this.loadMorePages(), this.scrollInProgress = false;
|
|
3334
|
+
});
|
|
3335
|
+
} else this.loadVisiblePages(), this.scrollInProgress = false;
|
|
2475
3336
|
}
|
|
2476
3337
|
loadVisiblePages() {
|
|
2477
3338
|
this.placeholder.querySelectorAll(".trv-report-page").forEach((e2) => {
|
|
@@ -2480,18 +3341,15 @@ var telerikReportViewer = (function (exports) {
|
|
|
2480
3341
|
});
|
|
2481
3342
|
}
|
|
2482
3343
|
scrolledInToView(e2) {
|
|
2483
|
-
if (!e2)
|
|
2484
|
-
return false;
|
|
3344
|
+
if (!e2) return false;
|
|
2485
3345
|
let t2 = e2.getBoundingClientRect(), i2 = e2.closest(".trv-pages-pane");
|
|
2486
|
-
if (!i2)
|
|
2487
|
-
return false;
|
|
3346
|
+
if (!i2) return false;
|
|
2488
3347
|
let n2 = i2.getBoundingClientRect(), r2 = n2.top, s2 = n2.bottom, o2 = t2.top, a2 = t2.bottom, l2 = this.additionalTopOffset + r2;
|
|
2489
3348
|
return o2 > 0 && o2 < s2 || a2 < s2 && a2 > l2;
|
|
2490
3349
|
}
|
|
2491
3350
|
render(e2, t2) {
|
|
2492
3351
|
let i2 = e2.pageNumber, n2 = this.findPageElement(i2);
|
|
2493
|
-
if (!t2 && n2 && !this.isSkeletonScreen(n2, i2))
|
|
2494
|
-
return;
|
|
3352
|
+
if (!t2 && n2 && !this.isSkeletonScreen(n2, i2)) return;
|
|
2495
3353
|
(null == this.lastLoadedPage || this.lastLoadedPage.pageNumber < e2.pageNumber) && (this.lastLoadedPage = e2), this.contentArea.updatePageStyle(this.lastLoadedPage);
|
|
2496
3354
|
let r2 = this.contentArea.renderPageElement(e2);
|
|
2497
3355
|
t2 && (this.pageWrapper.innerHTML = ""), this.pageWrapper.dataset.pageNumber = i2.toString();
|
|
@@ -2509,10 +3367,10 @@ var telerikReportViewer = (function (exports) {
|
|
|
2509
3367
|
}
|
|
2510
3368
|
}
|
|
2511
3369
|
initEvents() {
|
|
2512
|
-
this.onClickHandler = this.clickPage.bind(this), this.debounceScroll =
|
|
3370
|
+
this.onClickHandler = this.clickPage.bind(this), this.debounceScroll = ve(() => {
|
|
2513
3371
|
let e2 = this.placeholder.querySelectorAll(".trv-report-page"), t2 = Math.round(this.pageContainer.scrollTop + this.pageContainer.offsetHeight);
|
|
2514
3372
|
!this.scrollInProgress && e2.length && this.oldScrollTopPosition !== t2 && this.advanceCurrentPage(Array.from(e2));
|
|
2515
|
-
}, 250), this.throttleScroll =
|
|
3373
|
+
}, 250), this.throttleScroll = Pe(() => {
|
|
2516
3374
|
let e2 = this.placeholder.querySelectorAll(".trv-report-page"), t2 = Math.round(this.pageContainer.scrollTop + this.pageContainer.offsetHeight);
|
|
2517
3375
|
this.scrollInProgress || this.oldScrollTopPosition === t2 || (this.oldScrollTopPosition > t2 ? this.scrollUp(Array.from(e2)) : this.scrollDown(Array.from(e2), t2)), this.oldScrollTopPosition = t2;
|
|
2518
3376
|
}, 250), this.pageContainer.addEventListener("click", this.onClickHandler), this.pageContainer.addEventListener("scroll", this.debounceScroll), this.pageContainer.addEventListener("scroll", this.throttleScroll);
|
|
@@ -2523,8 +3381,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2523
3381
|
clickPage(e2) {
|
|
2524
3382
|
var t2;
|
|
2525
3383
|
let i2 = null === (t2 = e2.target) || void 0 === t2 ? void 0 : t2.closest(".trv-report-page");
|
|
2526
|
-
if (!i2)
|
|
2527
|
-
return;
|
|
3384
|
+
if (!i2) return;
|
|
2528
3385
|
let n2 = this.currentPageNumber(), r2 = parseInt(i2.dataset.page || "");
|
|
2529
3386
|
n2 !== r2 && (this.isSkeletonScreen(i2, r2) ? this.getAndRenderPage(r2).then((e3) => {
|
|
2530
3387
|
this.setCurrentPage(e3.pageNumber);
|
|
@@ -2537,8 +3394,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2537
3394
|
i2 === e3 || n2 || (this.isSkeletonScreen(t2, e3) ? this.getAndRenderPage(e3).then((e4) => {
|
|
2538
3395
|
this.setCurrentPage(e4.pageNumber);
|
|
2539
3396
|
}) : this.setCurrentPage(e3));
|
|
2540
|
-
} else
|
|
2541
|
-
console.log("Page not found - ", t2);
|
|
3397
|
+
} else console.log("Page not found - ", t2);
|
|
2542
3398
|
}
|
|
2543
3399
|
findNewCurrentPage(e2) {
|
|
2544
3400
|
let t2 = Math.floor(e2.length / 2), i2 = this.findPageInViewPort(t2, e2);
|
|
@@ -2546,8 +3402,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2546
3402
|
}
|
|
2547
3403
|
findPageInViewPort(e2, t2) {
|
|
2548
3404
|
let i2 = t2[e2], n2 = i2.getBoundingClientRect(), r2 = i2.closest(".trv-pages-pane");
|
|
2549
|
-
if (!r2)
|
|
2550
|
-
return -1;
|
|
3405
|
+
if (!r2) return -1;
|
|
2551
3406
|
let s2 = r2.getBoundingClientRect().top, o2 = n2.top, a2 = n2.bottom, l2 = this.additionalTopOffset + s2;
|
|
2552
3407
|
return o2 <= l2 && l2 < a2 ? 0 : a2 < l2 ? -1 : 1;
|
|
2553
3408
|
}
|
|
@@ -2555,8 +3410,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2555
3410
|
if (t2 >= this.pageContainer.scrollHeight - 5) {
|
|
2556
3411
|
let t3 = parseInt(e2[e2.length - 1].dataset.page || "") + 1;
|
|
2557
3412
|
this.currentPageNumber() < t3 && t3 <= this.controller.getPageCount() && (this.addSkeletonScreen(t3, false), this.getAndRenderPage(t3));
|
|
2558
|
-
} else
|
|
2559
|
-
this.advanceCurrentPage(e2), this.loadVisiblePages();
|
|
3413
|
+
} else this.advanceCurrentPage(e2), this.loadVisiblePages();
|
|
2560
3414
|
}
|
|
2561
3415
|
scrollUp(e2) {
|
|
2562
3416
|
if (0 === this.pageContainer.scrollTop) {
|
|
@@ -2564,13 +3418,11 @@ var telerikReportViewer = (function (exports) {
|
|
|
2564
3418
|
this.currentPageNumber() > t2 && t2 >= 1 && (this.addSkeletonScreen(t2, true), this.getAndRenderPage(t2).then(() => {
|
|
2565
3419
|
this.pageContainer.scrollTop = 3;
|
|
2566
3420
|
}));
|
|
2567
|
-
} else
|
|
2568
|
-
this.advanceCurrentPage(e2), this.loadVisiblePages();
|
|
3421
|
+
} else this.advanceCurrentPage(e2), this.loadVisiblePages();
|
|
2569
3422
|
}
|
|
2570
3423
|
keepCurrentPageInToView() {
|
|
2571
3424
|
let e2 = this.findPageElement(this.currentPageNumber());
|
|
2572
|
-
if (!e2)
|
|
2573
|
-
return;
|
|
3425
|
+
if (!e2) return;
|
|
2574
3426
|
let t2 = e2.offsetTop, i2 = e2.offsetHeight, n2 = this.pageContainer.offsetHeight;
|
|
2575
3427
|
if (this.scrollInProgress = true, i2 < n2) {
|
|
2576
3428
|
t2 -= (n2 - i2) / 2;
|
|
@@ -2607,7 +3459,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2607
3459
|
return i2 && i2.length ? i2[i2.length - 1] : null;
|
|
2608
3460
|
}
|
|
2609
3461
|
}
|
|
2610
|
-
class
|
|
3462
|
+
class Ue {
|
|
2611
3463
|
constructor() {
|
|
2612
3464
|
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;
|
|
2613
3465
|
}
|
|
@@ -2615,7 +3467,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2615
3467
|
this.reset(e2), this.attachToScrollEvent();
|
|
2616
3468
|
}
|
|
2617
3469
|
reset(e2) {
|
|
2618
|
-
this.placeholder = e2, this.scrollableContainer =
|
|
3470
|
+
this.placeholder = e2, this.scrollableContainer = fe(e2, ".trv-page-container"), this.itemsInitialState = {}, this.xFrozenAreasBounds = {}, this.yFrozenAreasBounds = {}, this.currentlyFrozenContainer = { vertical: {}, horizontal: {} };
|
|
2619
3471
|
}
|
|
2620
3472
|
setScaleFactor(e2) {
|
|
2621
3473
|
this.scaleFactor = e2;
|
|
@@ -2638,7 +3490,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2638
3490
|
saveFreezeItemsInitialState(e2) {
|
|
2639
3491
|
var t2, i2, n2;
|
|
2640
3492
|
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;
|
|
2641
|
-
this.itemsInitialState[e2] = {}, this.freezeBGColor[e2] = (null === (n2 =
|
|
3493
|
+
this.itemsInitialState[e2] = {}, this.freezeBGColor[e2] = (null === (n2 = fe(this.placeholder, "[data-id='" + e2 + "']")) || void 0 === n2 ? void 0 : n2.dataset.stickyBgColor) || "", r2.forEach((t3) => {
|
|
2642
3494
|
var i3;
|
|
2643
3495
|
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;
|
|
2644
3496
|
switch (n3) {
|
|
@@ -2660,15 +3512,13 @@ var telerikReportViewer = (function (exports) {
|
|
|
2660
3512
|
}
|
|
2661
3513
|
updateFreezeItemsOnScroll(e2, t2, i2) {
|
|
2662
3514
|
var n2, r2;
|
|
2663
|
-
let s2 =
|
|
2664
|
-
if (!s2)
|
|
2665
|
-
return;
|
|
3515
|
+
let s2 = fe(this.placeholder, "div[data-id='" + e2 + "']");
|
|
3516
|
+
if (!s2) return;
|
|
2666
3517
|
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 + "']");
|
|
2667
3518
|
if (this.isInScrollVisibleArea(s2)) {
|
|
2668
3519
|
let n3 = s2.closest(".trv-report-page"), r3 = getComputedStyle(n3), l2 = parseFloat(r3.marginLeft), h2 = parseFloat(r3.paddingTop), c2 = parseFloat(r3.paddingLeft), d2 = parseFloat(r3.borderTopWidth), u2 = parseFloat(r3.borderLeftWidth), p2 = o2.length > 0, g2 = a2.length > 0, f2 = s2.offsetTop + ((null == n3 ? void 0 : n3.offsetTop) || 0) + l2 + h2 + d2, m2 = s2.offsetLeft + ((null == n3 ? void 0 : n3.offsetLeft) || 0) + c2 + u2, v2 = t2 - f2, P2 = i2 - m2;
|
|
2669
3520
|
g2 && v2 > 0 ? t2 <= s2.offsetHeight * this.scaleFactor + f2 - this.yFrozenAreasBounds[e2] && (this.currentlyFrozenContainer.vertical[e2] = true, this.updateUIElementsPosition(a2, "top", v2 / this.scaleFactor, e2)) : this.currentlyFrozenContainer.vertical[e2] && (delete this.currentlyFrozenContainer.vertical[e2], this.updateUIElementsPosition(a2, "top", -1, e2)), p2 && P2 > 0 ? i2 <= s2.offsetWidth * this.scaleFactor + m2 - this.xFrozenAreasBounds[e2] && (this.currentlyFrozenContainer.horizontal[e2] = true, this.updateUIElementsPosition(o2, "left", P2 / this.scaleFactor, e2)) : this.currentlyFrozenContainer.horizontal[e2] && (delete this.currentlyFrozenContainer.horizontal[e2], this.updateUIElementsPosition(o2, "left", -1, e2));
|
|
2670
|
-
} else
|
|
2671
|
-
(this.currentlyFrozenContainer.horizontal[e2] || this.currentlyFrozenContainer.vertical[e2]) && this.resetToDefaultPosition(e2, o2, a2);
|
|
3521
|
+
} else (this.currentlyFrozenContainer.horizontal[e2] || this.currentlyFrozenContainer.vertical[e2]) && this.resetToDefaultPosition(e2, o2, a2);
|
|
2672
3522
|
}
|
|
2673
3523
|
resetToDefaultPosition(e2, t2, i2) {
|
|
2674
3524
|
this.updateUIElementsPosition(i2, "top", -1, e2), this.updateUIElementsPosition(t2, "left", -1, e2), delete this.currentlyFrozenContainer.horizontal[e2], delete this.currentlyFrozenContainer.vertical[e2];
|
|
@@ -2685,14 +3535,13 @@ var telerikReportViewer = (function (exports) {
|
|
|
2685
3535
|
"IMG" !== e2.tagName && (t2 && this.isFrozen(r2) && !i2 ? e2.style.backgroundColor = this.freezeBGColor[r2] : e2.style.backgroundColor = n2 ? this.freezeBGColor[r2] : "initial");
|
|
2686
3536
|
}
|
|
2687
3537
|
hasSetBgColor(e2) {
|
|
2688
|
-
return
|
|
3538
|
+
return ue(e2) > 0;
|
|
2689
3539
|
}
|
|
2690
3540
|
isFrozen(e2) {
|
|
2691
3541
|
return this.currentlyFrozenContainer.horizontal[e2] || this.currentlyFrozenContainer.vertical[e2];
|
|
2692
3542
|
}
|
|
2693
3543
|
isInScrollVisibleArea(e2) {
|
|
2694
|
-
if (!this.scrollableContainer)
|
|
2695
|
-
return false;
|
|
3544
|
+
if (!this.scrollableContainer) return false;
|
|
2696
3545
|
const t2 = e2.getBoundingClientRect(), i2 = this.scrollableContainer.getBoundingClientRect();
|
|
2697
3546
|
return this.isVisibleVertically(t2, this.scrollableContainer, i2) && this.isVisibleHorizontally(t2, this.scrollableContainer, i2);
|
|
2698
3547
|
}
|
|
@@ -2705,21 +3554,21 @@ var telerikReportViewer = (function (exports) {
|
|
|
2705
3554
|
return e2.top > t2.scrollTop - n2 && e2.top < t2.scrollTop + n2 + i2.height;
|
|
2706
3555
|
}
|
|
2707
3556
|
}
|
|
2708
|
-
const
|
|
2709
|
-
function
|
|
3557
|
+
const $e = /{(\w+?)}/g, Be = "trv-initial-image-styles";
|
|
3558
|
+
function qe(e2, t2) {
|
|
2710
3559
|
let i2 = Array.isArray(t2);
|
|
2711
|
-
return e2 ? e2.replace(
|
|
3560
|
+
return e2 ? e2.replace($e, function(e3, n2) {
|
|
2712
3561
|
return t2[i2 ? parseInt(n2) : n2];
|
|
2713
3562
|
}) : "";
|
|
2714
3563
|
}
|
|
2715
|
-
const
|
|
2716
|
-
e.BasicAuth =
|
|
3564
|
+
const We = "trv-search-dialog-shaded-result", Ze = "trv-search-dialog-highlighted-result";
|
|
3565
|
+
e.BasicAuth = w, e.BookmarkNode = class {
|
|
2717
3566
|
constructor() {
|
|
2718
3567
|
this.id = "", this.text = "", this.page = 0, this.items = null;
|
|
2719
3568
|
}
|
|
2720
|
-
}, e.ConnectionConfig =
|
|
3569
|
+
}, e.ConnectionConfig = T, e.ConnectionConfigNoAuth = R, e.ConnectionConfigServerCredentials = E, e.ConnectionConfigServerNoAuth = A, e.ConnectionConfigServerToken = M, e.ContentArea = class {
|
|
2721
3570
|
constructor(e2, t2, i2, n2 = {}) {
|
|
2722
|
-
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
|
|
3571
|
+
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 He(this.placeholder, this, t2), this.resizeService = new ze(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("printDocumentReady", this.onPrintDocumentReady.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)).on("showNotification", this.onShowNotification.bind(this)), this.messages = i2, this.enableAccessibility = n2.enableAccessibility || false, this.initialPageAreaImageUrl = n2.initialPageAreaImageUrl || "";
|
|
2723
3572
|
}
|
|
2724
3573
|
destroy() {
|
|
2725
3574
|
this.resizeService && this.resizeService.destroy();
|
|
@@ -2746,10 +3595,10 @@ var telerikReportViewer = (function (exports) {
|
|
|
2746
3595
|
this.documentReady = true, this.invalidateCurrentlyLoadedPage();
|
|
2747
3596
|
}
|
|
2748
3597
|
onReportLoadProgress(e2) {
|
|
2749
|
-
this.navigateWhenPageAvailable(this.navigateToPageOnDocReady, e2.pageCount), this.showNotification(
|
|
3598
|
+
this.navigateWhenPageAvailable(this.navigateToPageOnDocReady, e2.pageCount), this.showNotification(qe(this.messages.ReportViewer_LoadingReportPagesInProgress, [e2.pageCount]));
|
|
2750
3599
|
}
|
|
2751
3600
|
onReportLoadComplete(t2) {
|
|
2752
|
-
0 === t2.pageCount ? (this.clearPage(), this.showNotification(this.messages.ReportViewer_NoPageToDisplay)) : (this.navigateOnLoadComplete(this.navigateToPageOnDocReady, t2.pageCount), this.showNotification(
|
|
3601
|
+
0 === t2.pageCount ? (this.clearPage(), this.showNotification(this.messages.ReportViewer_NoPageToDisplay)) : (this.navigateOnLoadComplete(this.navigateToPageOnDocReady, t2.pageCount), this.showNotification(qe(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 Ue(), this.controller.getViewMode() === e.ViewMode.Interactive && this.uiFreezeCoordinator.init(this.placeholder));
|
|
2753
3602
|
}
|
|
2754
3603
|
onReportAutoRunOff() {
|
|
2755
3604
|
this.disableParametersArea(false), this.showNotification(this.messages.ReportViewer_AutoRunDisabled || "Please validate the report parameter values and press Preview to generate the report.");
|
|
@@ -2786,15 +3635,9 @@ var telerikReportViewer = (function (exports) {
|
|
|
2786
3635
|
let t2 = this.controller.getScaleMode();
|
|
2787
3636
|
return t2 === e.ScaleMode.FitPage || t2 === e.ScaleMode.FitPageWidth;
|
|
2788
3637
|
}
|
|
2789
|
-
onPrintStarted(e2) {
|
|
2790
|
-
e2.handled || this.showNotification(this.messages.ReportViewer_PreparingPrint);
|
|
2791
|
-
}
|
|
2792
3638
|
onPrintDocumentReady() {
|
|
2793
3639
|
this.hideNotification();
|
|
2794
3640
|
}
|
|
2795
|
-
onExportStarted(e2) {
|
|
2796
|
-
e2.handled || this.showNotification(this.messages.ReportViewer_PreparingDownload);
|
|
2797
|
-
}
|
|
2798
3641
|
onExportDocumentReady() {
|
|
2799
3642
|
this.hideNotification();
|
|
2800
3643
|
}
|
|
@@ -2811,18 +3654,14 @@ var telerikReportViewer = (function (exports) {
|
|
|
2811
3654
|
}
|
|
2812
3655
|
findPage(t2) {
|
|
2813
3656
|
let i2 = this.pageContainer.querySelectorAll(".trv-report-page");
|
|
2814
|
-
if (this.controller.getPageMode() === e.PageMode.SinglePage)
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
let i3 = e2;
|
|
2823
|
-
if (parseInt((null == i3 ? void 0 : i3.dataset.page) || "-1") === t2)
|
|
2824
|
-
return i3;
|
|
2825
|
-
}
|
|
3657
|
+
if (this.controller.getPageMode() === e.PageMode.SinglePage) for (let e2 of Array.from(i2)) {
|
|
3658
|
+
let i3 = e2;
|
|
3659
|
+
if (this.pageNo(i3) === t2) return i3;
|
|
3660
|
+
}
|
|
3661
|
+
else for (let e2 of Array.from(i2)) {
|
|
3662
|
+
let i3 = e2;
|
|
3663
|
+
if (parseInt((null == i3 ? void 0 : i3.dataset.page) || "-1") === t2) return i3;
|
|
3664
|
+
}
|
|
2826
3665
|
return null;
|
|
2827
3666
|
}
|
|
2828
3667
|
navigateToPage(e2, t2) {
|
|
@@ -2846,28 +3685,26 @@ var telerikReportViewer = (function (exports) {
|
|
|
2846
3685
|
}
|
|
2847
3686
|
let e3 = 0, i3 = 0;
|
|
2848
3687
|
for (; n2 && n2 !== this.pageContainer; ) {
|
|
2849
|
-
if (
|
|
3688
|
+
if (se(n2, "trv-page-wrapper")) {
|
|
2850
3689
|
let t3 = n2.dataset.pageScale;
|
|
2851
3690
|
if ("string" == typeof t3) {
|
|
2852
3691
|
let n3 = parseFloat(t3);
|
|
2853
3692
|
e3 *= n3, i3 *= n3;
|
|
2854
3693
|
}
|
|
2855
3694
|
}
|
|
2856
|
-
e3 += n2.offsetTop, i3 += n2.offsetLeft, n2 =
|
|
3695
|
+
e3 += n2.offsetTop, i3 += n2.offsetLeft, n2 = oe(n2);
|
|
2857
3696
|
}
|
|
2858
3697
|
this.scrollManager.getEnabled() && t2 ? this.scrollManager.navigateToElement(e3, t2) : (this.pageContainer.scrollTop = e3, this.pageContainer.scrollLeft = i3);
|
|
2859
|
-
} else
|
|
2860
|
-
this.scrollManager.getEnabled() && t2 && this.scrollManager.navigateToElement((null === (i2 = this.placeholder) || void 0 === i2 ? void 0 : i2.querySelector('[data-page="' + t2 + '"]')).offsetTop, t2);
|
|
3698
|
+
} else this.scrollManager.getEnabled() && t2 && this.scrollManager.navigateToElement((null === (i2 = this.placeholder) || void 0 === i2 ? void 0 : i2.querySelector('[data-page="' + t2 + '"]')).offsetTop, t2);
|
|
2861
3699
|
}
|
|
2862
3700
|
}
|
|
2863
3701
|
findNextFocusableElement(e2) {
|
|
2864
|
-
if (!e2)
|
|
2865
|
-
return null;
|
|
3702
|
+
if (!e2) return null;
|
|
2866
3703
|
let t2 = e2.tabIndex;
|
|
2867
3704
|
return !isNaN(t2) && t2 > -1 ? e2 : this.findNextFocusableElement(e2.nextElementSibling);
|
|
2868
3705
|
}
|
|
2869
3706
|
disablePagesArea(e2) {
|
|
2870
|
-
e2 ?
|
|
3707
|
+
e2 ? ne(this.placeholder, "trv-loading") : re(this.placeholder, "trv-loading");
|
|
2871
3708
|
}
|
|
2872
3709
|
disableParametersArea(e2) {
|
|
2873
3710
|
var t2, i2;
|
|
@@ -2878,13 +3715,13 @@ var telerikReportViewer = (function (exports) {
|
|
|
2878
3715
|
}
|
|
2879
3716
|
showNotification(e2 = "", t2 = "info") {
|
|
2880
3717
|
let i2 = this.notification.dataset.type;
|
|
2881
|
-
i2 &&
|
|
3718
|
+
i2 && re(this.notification, `k-notification-${i2}`), this.notification.dataset.type = t2;
|
|
2882
3719
|
let n2 = this.notification.querySelector(".k-notification-content, .trv-error-message"), r2 = null == e2 ? void 0 : e2.split(/\r?\n/);
|
|
2883
|
-
n2.innerHTML = r2 && r2.length ? `${r2.join("<br>")}` : "Notification message not found.",
|
|
3720
|
+
n2.innerHTML = r2 && r2.length ? `${r2.join("<br>")}` : "Notification message not found.", ne(this.notification, `k-notification-${t2}`), re(this.notification, "k-hidden");
|
|
2884
3721
|
}
|
|
2885
3722
|
hideNotification() {
|
|
2886
3723
|
let e2 = String(this.notification.dataset.type);
|
|
2887
|
-
delete this.notification.dataset.type,
|
|
3724
|
+
delete this.notification.dataset.type, re(this.notification, `k-notification-${e2}`), ne(this.notification, "k-hidden");
|
|
2888
3725
|
}
|
|
2889
3726
|
pageNo(e2) {
|
|
2890
3727
|
var t2;
|
|
@@ -2898,16 +3735,13 @@ var telerikReportViewer = (function (exports) {
|
|
|
2898
3735
|
}
|
|
2899
3736
|
setPageDimensions(t2, i2 = 0) {
|
|
2900
3737
|
let n2 = i2 ? t2 : t2.querySelector("div.trv-report-page");
|
|
2901
|
-
if (!n2)
|
|
2902
|
-
return;
|
|
3738
|
+
if (!n2) return;
|
|
2903
3739
|
let r2, s2 = n2.querySelector("div.sheet"), o2 = n2.querySelector("div.trv-skeleton-wrapper");
|
|
2904
|
-
if (s2 = s2 || o2, !s2)
|
|
2905
|
-
|
|
2906
|
-
if (n2.dataset.box)
|
|
2907
|
-
r2 = JSON.parse(n2.dataset.box);
|
|
3740
|
+
if (s2 = s2 || o2, !s2) return;
|
|
3741
|
+
if (n2.dataset.box) r2 = JSON.parse(n2.dataset.box);
|
|
2908
3742
|
else {
|
|
2909
3743
|
let e2 = getComputedStyle(n2), i3 = getComputedStyle(t2);
|
|
2910
|
-
r2 = { padLeft:
|
|
3744
|
+
r2 = { padLeft: ae(i3.marginLeft) + ae(e2.borderLeftWidth) + ae(e2.paddingLeft), padRight: ae(i3.marginRight) + ae(e2.borderRightWidth) + ae(e2.paddingRight), padTop: ae(i3.marginTop) + ae(e2.borderTopWidth) + ae(e2.paddingTop), padBottom: ae(i3.marginBottom) + ae(e2.borderBottomWidth) + ae(e2.paddingBottom) }, n2.dataset.box = JSON.stringify(r2);
|
|
2911
3745
|
}
|
|
2912
3746
|
let a2 = s2.offsetWidth, l2 = s2.offsetHeight;
|
|
2913
3747
|
if (0 === a2) {
|
|
@@ -2916,7 +3750,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2916
3750
|
}
|
|
2917
3751
|
const h2 = this.controller.getScaleMode(), c2 = l2 > a2 && h2 === e.ScaleMode.FitPageWidth ? 20 : 0, d2 = (this.pageContainer.clientWidth - c2 - r2.padLeft - r2.padRight) / a2, u2 = (this.pageContainer.clientHeight - 1 - r2.padTop - r2.padBottom) / l2;
|
|
2918
3752
|
let p2 = this.controller.getScale();
|
|
2919
|
-
h2 === e.ScaleMode.FitPageWidth ? p2 = d2 : p2 && h2 !== e.ScaleMode.FitPage || (p2 = Math.min(d2, u2)), null !== this.uiFreezeCoordinator && this.uiFreezeCoordinator.setScaleFactor(p2), t2.dataset.pageScale = p2.toString(), n2.dataset.pageScale = p2.toString(), o2 ||
|
|
3753
|
+
h2 === e.ScaleMode.FitPageWidth ? p2 = d2 : p2 && h2 !== e.ScaleMode.FitPage || (p2 = Math.min(d2, u2)), null !== this.uiFreezeCoordinator && this.uiFreezeCoordinator.setScaleFactor(p2), t2.dataset.pageScale = p2.toString(), n2.dataset.pageScale = p2.toString(), o2 || le(s2, p2, p2), n2.style.height = p2 * l2 + "px", n2.style.width = p2 * a2 + "px", this.controller.setScale(p2, true);
|
|
2920
3754
|
}
|
|
2921
3755
|
enableInteractivity() {
|
|
2922
3756
|
this.disableInteractivity(), 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);
|
|
@@ -2939,24 +3773,24 @@ var telerikReportViewer = (function (exports) {
|
|
|
2939
3773
|
onInteractiveItemClick(e2, t2) {
|
|
2940
3774
|
var i2;
|
|
2941
3775
|
let n2 = (null === (i2 = e2.dataset.reportingAction) || void 0 === i2 ? void 0 : i2.toString()) || "", r2 = this.getAction(n2);
|
|
2942
|
-
r2 && (this.navigateToPageOnDocReady = this.getNavigateToPageOnDocReady(t2, r2.Type), this.controller.executeReportAction(new
|
|
3776
|
+
r2 && (this.navigateToPageOnDocReady = this.getNavigateToPageOnDocReady(t2, r2.Type), this.controller.executeReportAction(new l(e2, r2))), t2.stopPropagation();
|
|
2943
3777
|
}
|
|
2944
3778
|
onInteractiveItemEnter(e2) {
|
|
2945
3779
|
var t2;
|
|
2946
3780
|
let i2 = (null === (t2 = e2.dataset.reportingAction) || void 0 === t2 ? void 0 : t2.toString()) || "", n2 = this.getAction(i2);
|
|
2947
|
-
n2 && this.controller.reportActionEnter(new
|
|
3781
|
+
n2 && this.controller.reportActionEnter(new l(e2, n2));
|
|
2948
3782
|
}
|
|
2949
3783
|
onInteractiveItemLeave(e2) {
|
|
2950
3784
|
var t2;
|
|
2951
3785
|
let i2 = (null === (t2 = e2.dataset.reportingAction) || void 0 === t2 ? void 0 : t2.toString()) || "", n2 = this.getAction(i2);
|
|
2952
|
-
n2 && this.controller.reportActionLeave(new
|
|
3786
|
+
n2 && this.controller.reportActionLeave(new l(e2, n2));
|
|
2953
3787
|
}
|
|
2954
3788
|
onToolTipItemEnter(e2, t2) {
|
|
2955
3789
|
let i2 = e2.dataset.tooltipTitle, n2 = e2.dataset.tooltipText;
|
|
2956
|
-
(i2 || n2) && this.controller.reportTooltipOpening(new
|
|
3790
|
+
(i2 || n2) && this.controller.reportTooltipOpening(new P(e2, n2 || "", i2 || "", t2));
|
|
2957
3791
|
}
|
|
2958
3792
|
onToolTipItemLeave(e2) {
|
|
2959
|
-
this.controller.reportTooltipClosing(new
|
|
3793
|
+
this.controller.reportTooltipClosing(new P(e2, "", "", null));
|
|
2960
3794
|
}
|
|
2961
3795
|
getNavigateToPageOnDocReady(e2, t2) {
|
|
2962
3796
|
var i2;
|
|
@@ -2965,8 +3799,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2965
3799
|
getAction(e2) {
|
|
2966
3800
|
if (this.actions) {
|
|
2967
3801
|
let t2 = this.actions.find((t3) => t3.Id === e2);
|
|
2968
|
-
if (t2)
|
|
2969
|
-
return t2;
|
|
3802
|
+
if (t2) return t2;
|
|
2970
3803
|
}
|
|
2971
3804
|
return null;
|
|
2972
3805
|
}
|
|
@@ -2974,8 +3807,8 @@ var telerikReportViewer = (function (exports) {
|
|
|
2974
3807
|
var t2;
|
|
2975
3808
|
let i2 = "trv-" + this.controller.getClientId() + "-styles";
|
|
2976
3809
|
null === (t2 = document.getElementById(i2)) || void 0 === t2 || t2.remove();
|
|
2977
|
-
let n2 =
|
|
2978
|
-
n2.innerHTML = e2.pageStyles, document.head.appendChild(n2);
|
|
3810
|
+
let n2 = ie("style", i2);
|
|
3811
|
+
this.applyNonce(n2), n2.innerHTML = e2.pageStyles, document.head.appendChild(n2);
|
|
2979
3812
|
}
|
|
2980
3813
|
setPageContent(e2) {
|
|
2981
3814
|
this.actions = e2.pageActions, this.updatePageStyle(e2);
|
|
@@ -2986,26 +3819,30 @@ var telerikReportViewer = (function (exports) {
|
|
|
2986
3819
|
this.actions && this.actions.length ? this.actions = this.actions.concat(t2.pageActions) : this.actions = t2.pageActions, this.applyPlaceholderViewModeClass(), this.setPageDimensions(e2, t2.pageNumber);
|
|
2987
3820
|
}
|
|
2988
3821
|
renderPageElement(e2) {
|
|
2989
|
-
let t2 =
|
|
3822
|
+
let t2 = ie("div");
|
|
2990
3823
|
t2.innerHTML = e2.pageContent;
|
|
2991
3824
|
let i2 = t2.querySelector("div.sheet");
|
|
2992
3825
|
i2.style.margin = "0";
|
|
2993
|
-
let n2 =
|
|
2994
|
-
return n2.dataset.page = e2.pageNumber.toString(), n2.append(i2), n2.append(
|
|
3826
|
+
let n2 = ie("div", "", "trv-report-page");
|
|
3827
|
+
return n2.dataset.page = e2.pageNumber.toString(), n2.append(i2), n2.append(ie("div", "", "k-overlay trv-overlay trv-page-overlay")), n2;
|
|
2995
3828
|
}
|
|
2996
3829
|
applyPlaceholderViewModeClass() {
|
|
2997
|
-
this.controller.getViewMode() === e.ViewMode.Interactive ? (
|
|
3830
|
+
this.controller.getViewMode() === e.ViewMode.Interactive ? (re(this.placeholder, "printpreview"), ne(this.placeholder, "interactive")) : (re(this.placeholder, "interactive"), ne(this.placeholder, "printpreview"));
|
|
3831
|
+
}
|
|
3832
|
+
applyNonce(e2) {
|
|
3833
|
+
const t2 = this.controller.getNonce();
|
|
3834
|
+
t2 && e2.setAttribute("nonce", t2);
|
|
2998
3835
|
}
|
|
2999
3836
|
setPageAreaImage() {
|
|
3000
3837
|
this.clearPageAreaImage();
|
|
3001
|
-
let e2 =
|
|
3002
|
-
e2.innerHTML =
|
|
3838
|
+
let e2 = ie("style", Be);
|
|
3839
|
+
this.applyNonce(e2), e2.innerHTML = qe('.trv-page-container {background: #ffffff url("{0}") no-repeat center 50px}', [this.initialPageAreaImageUrl]), document.head.appendChild(e2), this.showPageAreaImage = true;
|
|
3003
3840
|
}
|
|
3004
3841
|
clearPageAreaImage() {
|
|
3005
3842
|
var e2;
|
|
3006
|
-
null === (e2 = document.getElementById(
|
|
3843
|
+
null === (e2 = document.getElementById(Be)) || void 0 === e2 || e2.remove();
|
|
3007
3844
|
}
|
|
3008
|
-
}, e.CurrentPageChangedEventArgs =
|
|
3845
|
+
}, e.CurrentPageChangedEventArgs = v, e.DeviceInfo = o, e.DocumentInfo = class {
|
|
3009
3846
|
constructor() {
|
|
3010
3847
|
this.documentReady = false, this.documentMapAvailable = false, this.containsFrozenContent = false, this.pageCount = 0, this.documentMapNodes = [], this.bookmarkNodes = [], this.renderingExtensions = [], this.autoRunEnabled = true;
|
|
3011
3848
|
}
|
|
@@ -3013,27 +3850,27 @@ var telerikReportViewer = (function (exports) {
|
|
|
3013
3850
|
constructor() {
|
|
3014
3851
|
this.id = "", this.isExpanded = false, this.label = "", this.text = "", this.page = 0, this.items = [];
|
|
3015
3852
|
}
|
|
3016
|
-
}, e.EmailInfo =
|
|
3853
|
+
}, e.EmailInfo = a, e.ExportDocumentReadyEventArgs = u, e.ExportStartEventArgs = c, e.ExportStartedEventArgs = d, e.KeepClientAliveSentinel = K, e.NoAuth = b, e.PageAction = class {
|
|
3017
3854
|
constructor() {
|
|
3018
3855
|
this.Id = "", this.ReportItemName = "", this.Type = "", this.Value = {};
|
|
3019
3856
|
}
|
|
3020
|
-
}, e.PageActionEventArgs =
|
|
3857
|
+
}, e.PageActionEventArgs = l, e.PageInfo = class {
|
|
3021
3858
|
constructor() {
|
|
3022
3859
|
this.pageNumber = 0, this.pageReady = false, this.pageStyles = "", this.pageContent = "", this.pageActions = [];
|
|
3023
3860
|
}
|
|
3024
|
-
}, e.PageTargetElement =
|
|
3861
|
+
}, e.PageTargetElement = h, e.ParameterInfo = class {
|
|
3025
3862
|
constructor() {
|
|
3026
3863
|
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 = "";
|
|
3027
3864
|
}
|
|
3028
|
-
}, e.ParameterValidators =
|
|
3865
|
+
}, e.ParameterValidators = De, e.ParameterValue = class {
|
|
3029
3866
|
constructor() {
|
|
3030
3867
|
this.name = "", this.value = null;
|
|
3031
3868
|
}
|
|
3032
|
-
}, e.PersonalTokenAuth =
|
|
3869
|
+
}, e.PersonalTokenAuth = L, e.PrintDocumentReadyEventArgs = g, e.PrintStartedEventArgs = p, e.RenderingExtension = class {
|
|
3033
3870
|
constructor() {
|
|
3034
3871
|
this.name = "", this.localizedName = "";
|
|
3035
3872
|
}
|
|
3036
|
-
}, e.ReportController = class extends
|
|
3873
|
+
}, e.ReportController = class extends q {
|
|
3037
3874
|
constructor(e2, t2) {
|
|
3038
3875
|
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 G(), this.serviceClient = e2, t2.authenticationToken && this.serviceClient.setAccessToken(t2.authenticationToken);
|
|
3039
3876
|
}
|
|
@@ -3050,6 +3887,9 @@ var telerikReportViewer = (function (exports) {
|
|
|
3050
3887
|
setAuthenticationToken(e2) {
|
|
3051
3888
|
this.serviceClient.setAccessToken(e2);
|
|
3052
3889
|
}
|
|
3890
|
+
getNonce() {
|
|
3891
|
+
return this.options.nonce;
|
|
3892
|
+
}
|
|
3053
3893
|
init() {
|
|
3054
3894
|
this.refreshReport(true, "");
|
|
3055
3895
|
}
|
|
@@ -3067,8 +3907,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
3067
3907
|
});
|
|
3068
3908
|
}
|
|
3069
3909
|
refreshReport(e2, t2, i2 = false, n2 = false) {
|
|
3070
|
-
if (n2 || this.emit("loadedReportChange"), this.cancelLoad = false, this.respectAutoRun = i2 || this.respectAutoRun, this.clientHasExpired && (this.clientHasExpired = false, this.clearClientId()), "" == this.getReport())
|
|
3071
|
-
return void this.emit("noReport");
|
|
3910
|
+
if (n2 || this.emit("loadedReportChange"), this.cancelLoad = false, this.respectAutoRun = i2 || this.respectAutoRun, this.clientHasExpired && (this.clientHasExpired = false, this.clearClientId()), "" == this.getReport()) return void this.emit("noReport");
|
|
3072
3911
|
let r2 = this.loadParameters();
|
|
3073
3912
|
r2.then((i3) => {
|
|
3074
3913
|
this.emit("parametersLoaded", i3);
|
|
@@ -3077,18 +3916,16 @@ var telerikReportViewer = (function (exports) {
|
|
|
3077
3916
|
}
|
|
3078
3917
|
processParameters(e2) {
|
|
3079
3918
|
let t2 = {}, i2 = [], n2 = false;
|
|
3080
|
-
for (let r2 of e2)
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
}
|
|
3919
|
+
for (let r2 of e2) try {
|
|
3920
|
+
let e3 = De.validate(r2, r2.value);
|
|
3921
|
+
t2[r2.id] = e3;
|
|
3922
|
+
} catch (e3) {
|
|
3923
|
+
n2 = true, i2.push(r2);
|
|
3924
|
+
}
|
|
3087
3925
|
return n2 ? this.missingOrInvalidParameters(i2) : this.setParameters(t2), n2;
|
|
3088
3926
|
}
|
|
3089
3927
|
allParametersAutoRefresh(e2) {
|
|
3090
|
-
if (!e2 || !e2.length)
|
|
3091
|
-
return true;
|
|
3928
|
+
if (!e2 || !e2.length) return true;
|
|
3092
3929
|
return Array.from(e2).every((e3) => !e3.isVisible || e3.autoRefresh);
|
|
3093
3930
|
}
|
|
3094
3931
|
allParametersValidForAutoRefresh(e2, t2) {
|
|
@@ -3100,12 +3937,11 @@ var telerikReportViewer = (function (exports) {
|
|
|
3100
3937
|
return i2;
|
|
3101
3938
|
}
|
|
3102
3939
|
hasInvalidParameter(e2) {
|
|
3103
|
-
for (const t2 of e2)
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
}
|
|
3940
|
+
for (const t2 of e2) try {
|
|
3941
|
+
De.validate(t2, t2.value);
|
|
3942
|
+
} catch (e3) {
|
|
3943
|
+
return true;
|
|
3944
|
+
}
|
|
3109
3945
|
return false;
|
|
3110
3946
|
}
|
|
3111
3947
|
refreshReportCore(e2, t2 = "", i2 = "") {
|
|
@@ -3134,7 +3970,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
3134
3970
|
}
|
|
3135
3971
|
getReportSource() {
|
|
3136
3972
|
var e2;
|
|
3137
|
-
return new
|
|
3973
|
+
return new Oe(null === (e2 = this.options.reportSource) || void 0 === e2 ? void 0 : e2.report, this.parameterValues);
|
|
3138
3974
|
}
|
|
3139
3975
|
setReportSource(e2) {
|
|
3140
3976
|
this.options.reportSource = e2, this.setParameters(this.options.reportSource.parameters), this.emit("reportSourceChanged", e2);
|
|
@@ -3179,7 +4015,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
3179
4015
|
return this.currentPageNumber;
|
|
3180
4016
|
}
|
|
3181
4017
|
setCurrentPageNumber(e2) {
|
|
3182
|
-
this.currentPageNumber !== e2 && (this.currentPageNumber = e2, this.emit("currentPageChanged", new
|
|
4018
|
+
this.currentPageNumber !== e2 && (this.currentPageNumber = e2, this.emit("currentPageChanged", new v(e2, this.documentId)));
|
|
3183
4019
|
}
|
|
3184
4020
|
getPageCount() {
|
|
3185
4021
|
return this.pageCount;
|
|
@@ -3189,29 +4025,25 @@ var telerikReportViewer = (function (exports) {
|
|
|
3189
4025
|
}
|
|
3190
4026
|
executeReportAction(e2) {
|
|
3191
4027
|
let t2 = e2.action;
|
|
3192
|
-
window.setTimeout(() =>
|
|
4028
|
+
window.setTimeout(() => s(this, void 0, void 0, function* () {
|
|
3193
4029
|
try {
|
|
3194
4030
|
yield this.emitAsync("interactiveActionExecuting", e2), this.emit("interactiveActionExecuting", e2);
|
|
3195
4031
|
} catch (e3) {
|
|
3196
4032
|
return void this.raiseError(e3 instanceof Error ? e3.message : String(e3));
|
|
3197
4033
|
}
|
|
3198
|
-
if (!e2.cancel)
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
let e3 = t2.Value;
|
|
3212
|
-
window.open(e3.Url, e3.Target);
|
|
3213
|
-
} else
|
|
3214
|
-
t2.Type;
|
|
4034
|
+
if (!e2.cancel) if ("navigateToReport" === t2.Type) {
|
|
4035
|
+
this.emit("serverActionStarted");
|
|
4036
|
+
let e3 = t2.Value, i2 = this.fixDataContractJsonSerializer(e3.ParameterValues);
|
|
4037
|
+
this.respectAutoRun = true, this.emit("navigateToReport", new Oe(e3.Report, i2));
|
|
4038
|
+
} else if ("navigateToBookmark" === t2.Type) {
|
|
4039
|
+
let e3 = this.getPageForBookmark(this.bookmarkNodes, t2.Value), i2 = new h(t2.Value, "bookmark");
|
|
4040
|
+
this.navigateToPage(e3, i2);
|
|
4041
|
+
} else if ("sorting" === t2.Type) this.execServerAction(t2.Id);
|
|
4042
|
+
else if ("toggleVisibility" === t2.Type) this.execServerAction(t2.Id);
|
|
4043
|
+
else if ("navigateToUrl" === t2.Type) {
|
|
4044
|
+
let e3 = t2.Value;
|
|
4045
|
+
window.open(e3.Url, e3.Target);
|
|
4046
|
+
} else t2.Type;
|
|
3215
4047
|
}), 0);
|
|
3216
4048
|
}
|
|
3217
4049
|
reportActionEnter(e2) {
|
|
@@ -3221,7 +4053,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
3221
4053
|
this.emit("interactiveActionLeave", e2);
|
|
3222
4054
|
}
|
|
3223
4055
|
reportTooltipOpening(e2) {
|
|
3224
|
-
return
|
|
4056
|
+
return s(this, void 0, void 0, function* () {
|
|
3225
4057
|
try {
|
|
3226
4058
|
yield this.emitAsync("toolTipOpening", e2), this.emit("toolTipOpening", e2);
|
|
3227
4059
|
} catch (e3) {
|
|
@@ -3233,41 +4065,40 @@ var telerikReportViewer = (function (exports) {
|
|
|
3233
4065
|
this.emit("toolTipClosing", e2);
|
|
3234
4066
|
}
|
|
3235
4067
|
printReport() {
|
|
3236
|
-
return
|
|
4068
|
+
return s(this, void 0, void 0, function* () {
|
|
3237
4069
|
let e2 = this.createDeviceInfo();
|
|
3238
4070
|
e2.ImmediatePrint = true;
|
|
3239
|
-
let t2 = new
|
|
3240
|
-
yield this.emitAsync("printStarted", t2), this.emit("printStarted", t2), t2.handled || (this.setUIState("PrintInProgress", true), this.exportAsync("PDF", t2.deviceInfo).then((e3) =>
|
|
4071
|
+
let t2 = new p(e2);
|
|
4072
|
+
yield this.emitAsync("printStarted", t2), this.emit("printStarted", t2), t2.handled || (this.showNotification(this.options.messages.ReportViewer_PreparingPrint), this.setUIState("PrintInProgress", true), this.exportAsync("PDF", t2.deviceInfo).then((e3) => s(this, void 0, void 0, function* () {
|
|
3241
4073
|
let t3 = this.serviceClient.getDocumentUrl(this.clientId, this.reportInstanceId, e3);
|
|
3242
4074
|
t3 += `?${"response-content-disposition=" + (this.getCanUsePlugin() ? "inline" : "attachment")}`;
|
|
3243
|
-
let i2 = new
|
|
3244
|
-
yield this.emitAsync("printDocumentReady", i2), this.emit("printDocumentReady", i2), this.setUIState("PrintInProgress", false), i2.handled || this.printManager.print(t3);
|
|
4075
|
+
let i2 = new g(t3);
|
|
4076
|
+
yield this.emitAsync("printDocumentReady", i2), this.emit("printDocumentReady", i2), this.setUIState("PrintInProgress", false), i2.handled || this.printManager.print(t3, this.getReportFileName());
|
|
3245
4077
|
})));
|
|
3246
4078
|
});
|
|
3247
4079
|
}
|
|
3248
4080
|
exportReport(e2) {
|
|
3249
|
-
return
|
|
3250
|
-
let t2 = this.createDeviceInfo(),
|
|
3251
|
-
if (yield this.emitAsync("exportStart",
|
|
3252
|
-
let t3 = new
|
|
3253
|
-
if (yield this.emitAsync("exportStarted", t3), this.emit("exportStarted", t3), t3.handled)
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
yield this.emitAsync("exportEnd", n3), yield this.emitAsync("exportDocumentReady", n3), this.emit("exportDocumentReady", n3), this.setUIState("ExportInProgress", false), n3.handled || window.open(i2, n3.windowOpenTarget);
|
|
4081
|
+
return s(this, void 0, void 0, function* () {
|
|
4082
|
+
let t2 = this.createDeviceInfo(), i2 = new c(t2, e2);
|
|
4083
|
+
if (yield this.emitAsync("exportStart", i2), !i2.isCancelled) {
|
|
4084
|
+
let t3 = new d(i2.deviceInfo, i2.format);
|
|
4085
|
+
if (yield this.emitAsync("exportStarted", t3), this.emit("exportStarted", t3), t3.handled) return;
|
|
4086
|
+
this.showNotification(this.options.messages.ReportViewer_PreparingDownload), this.setUIState("ExportInProgress", true), this.exportAsync(t3.format, t3.deviceInfo).then((t4) => s(this, void 0, void 0, function* () {
|
|
4087
|
+
let i3 = this.serviceClient.getDocumentUrl(this.clientId, this.reportInstanceId, t4);
|
|
4088
|
+
i3 += "?response-content-disposition=attachment";
|
|
4089
|
+
let n2 = new u(i3, e2, "_self");
|
|
4090
|
+
yield this.emitAsync("exportEnd", n2), yield this.emitAsync("exportDocumentReady", n2), this.emit("exportDocumentReady", n2), this.setUIState("ExportInProgress", false), n2.handled || window.open(i3, n2.windowOpenTarget);
|
|
3260
4091
|
}));
|
|
3261
4092
|
}
|
|
3262
4093
|
});
|
|
3263
4094
|
}
|
|
3264
4095
|
sendReport(e2) {
|
|
3265
|
-
return
|
|
3266
|
-
let t2 = this.createDeviceInfo(),
|
|
3267
|
-
yield this.emitAsync("sendEmailStarted",
|
|
3268
|
-
let
|
|
3269
|
-
|
|
3270
|
-
let r2 = new
|
|
4096
|
+
return s(this, void 0, void 0, function* () {
|
|
4097
|
+
let t2 = this.createDeviceInfo(), i2 = new f(t2, e2.format);
|
|
4098
|
+
yield this.emitAsync("sendEmailStarted", i2), this.emit("sendEmailStarted", i2), i2.handled || this.exportAsync(e2.format, i2.deviceInfo).then((t3) => s(this, void 0, void 0, function* () {
|
|
4099
|
+
let n2 = this.serviceClient.getDocumentUrl(this.clientId, this.reportInstanceId, t3);
|
|
4100
|
+
n2 += "?response-content-disposition=attachment";
|
|
4101
|
+
let r2 = new m(e2, i2.deviceInfo, n2);
|
|
3271
4102
|
yield this.emitAsync("sendEmailDocumentReady", r2), this.emit("sendEmailDocumentReady", r2), r2.handled || this.sendDocumentAsync(t3, r2);
|
|
3272
4103
|
}));
|
|
3273
4104
|
});
|
|
@@ -3277,9 +4108,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
3277
4108
|
}
|
|
3278
4109
|
createAIThread() {
|
|
3279
4110
|
return this.serviceClient.createAIThread(this.clientId, this.reportInstanceId, this.getReport(), this.parameterValues).catch((e2) => this.raiseError(e2.exceptionMessage, false)).then((e2) => {
|
|
3280
|
-
if (this.threadId = (null == e2 ? void 0 : e2.threadId) || "", e2.consentMessage && (e2.consentMessage =
|
|
3281
|
-
for (let i2 = 0; i2 < e2.predefinedPrompts.length; i2++)
|
|
3282
|
-
e2.predefinedPrompts[i2] = t.sanitize(e2.predefinedPrompts[i2], { USE_PROFILES: { html: true } }), t.removed && t.removed.length > 0 && console.warn("An AI-Powered Insights predefined prompt was sanitized as it contained potentially malicious HTML elements or attributes.");
|
|
4111
|
+
if (this.threadId = (null == e2 ? void 0 : e2.threadId) || "", e2.consentMessage && (e2.consentMessage = r.default.sanitize(e2.consentMessage, { USE_PROFILES: { html: true } }), r.default.removed && r.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) for (let t2 = 0; t2 < e2.predefinedPrompts.length; t2++) e2.predefinedPrompts[t2] = r.default.sanitize(e2.predefinedPrompts[t2], { USE_PROFILES: { html: true } }), r.default.removed && r.default.removed.length > 0 && console.warn("An AI-Powered Insights predefined prompt was sanitized as it contained potentially malicious HTML elements or attributes.");
|
|
3283
4112
|
return e2;
|
|
3284
4113
|
});
|
|
3285
4114
|
}
|
|
@@ -3287,13 +4116,13 @@ var telerikReportViewer = (function (exports) {
|
|
|
3287
4116
|
return this.serviceClient.getAIResponse(this.clientId, this.reportInstanceId, this.documentId, this.threadId, e2).then((e3) => e3 || "");
|
|
3288
4117
|
}
|
|
3289
4118
|
exportAsync(e2, t2) {
|
|
3290
|
-
return this.initializeClient().then(this.registerInstance.bind(this)).then(() => this.registerDocumentAsync(e2, t2, false, this.documentId)).then((e3) =>
|
|
4119
|
+
return this.initializeClient().then(this.registerInstance.bind(this)).then(() => this.registerDocumentAsync(e2, t2, false, this.documentId)).then((e3) => s(this, void 0, void 0, function* () {
|
|
3291
4120
|
return yield this.getDocumentInfo(false, e3).catch((e4) => this.raiseError(e4)), e3;
|
|
3292
4121
|
}));
|
|
3293
4122
|
}
|
|
3294
4123
|
sendDocumentAsync(e2, t2) {
|
|
3295
4124
|
return this.serviceClient.sendDocument(this.clientId, this.reportInstanceId, e2, t2).catch((e3) => {
|
|
3296
|
-
this.handleRequestError(e3,
|
|
4125
|
+
this.handleRequestError(e3, be(this.options.messages.ReportViewer_ErrorSendingDocument, he(this.getReport())));
|
|
3297
4126
|
});
|
|
3298
4127
|
}
|
|
3299
4128
|
loadParameters(e2 = void 0) {
|
|
@@ -3306,7 +4135,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
3306
4135
|
}
|
|
3307
4136
|
initializeAndStartSentinel() {
|
|
3308
4137
|
this.options.keepClientAlive && this.clientId && this.serviceClient.getClientsSessionTimeoutSeconds().then((e2) => {
|
|
3309
|
-
this.keepClientAliveSentinel = new
|
|
4138
|
+
this.keepClientAliveSentinel = new K(this.serviceClient, this.clientId, e2), this.keepClientAliveSentinel.start();
|
|
3310
4139
|
});
|
|
3311
4140
|
}
|
|
3312
4141
|
stopSentinel() {
|
|
@@ -3331,31 +4160,27 @@ var telerikReportViewer = (function (exports) {
|
|
|
3331
4160
|
this.pageCount = 0, this.currentPageNumber = 0;
|
|
3332
4161
|
}
|
|
3333
4162
|
handleSearchRequestError(e2) {
|
|
3334
|
-
if (!
|
|
3335
|
-
throw this.handleRequestError(e2, "", true), null;
|
|
4163
|
+
if (!Ce(e2, "System.ArgumentException")) throw this.handleRequestError(e2, "", true), null;
|
|
3336
4164
|
this.throwPromiseError(e2);
|
|
3337
4165
|
}
|
|
3338
4166
|
throwPromiseError(e2) {
|
|
3339
4167
|
throw e2.exceptionMessage ? e2.exceptionMessage : this.options.messages.ReportViewer_PromisesChainStopError;
|
|
3340
4168
|
}
|
|
3341
4169
|
handleRequestError(e2, t2 = "", i2 = false) {
|
|
3342
|
-
|
|
3343
|
-
let n2 =
|
|
4170
|
+
ye(e2) && this.onClientExpired();
|
|
4171
|
+
let n2 = Ie(e2.error) ? "" : e2.error, r2 = this.formatRequestError(e2, n2, t2);
|
|
3344
4172
|
this.raiseError(r2), i2 || this.throwPromiseError(e2);
|
|
3345
4173
|
}
|
|
3346
4174
|
formatRequestError(e2, t2, i2) {
|
|
3347
4175
|
let n2 = e2.responseJSON, r2 = "";
|
|
3348
4176
|
if (n2) {
|
|
3349
|
-
if (401 == n2.status || 403 == n2.status)
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
r2 = ce(n2.message);
|
|
3354
|
-
let t3 = ce(n2.exceptionMessage || n2.ExceptionMessage || n2.error_description);
|
|
4177
|
+
if (401 == n2.status || 403 == n2.status) return this.options.messages.ReportViewer_ErrorUnauthorizedOrForbidden || "You don't have permission to access this report document.";
|
|
4178
|
+
if (Se(e2)) return this.options.messages.ReportViewer_MissingOrInvalidParameter;
|
|
4179
|
+
r2 = he(n2.message);
|
|
4180
|
+
let t3 = he(n2.exceptionMessage || n2.ExceptionMessage || n2.error_description);
|
|
3355
4181
|
t3 && (r2 ? r2 += " " + t3 : r2 = t3);
|
|
3356
|
-
} else
|
|
3357
|
-
|
|
3358
|
-
return (i2 || t2) && (r2 && (r2 = " " + r2), r2 = ce(i2 || t2) + r2), Ie(e2) && (r2 += "<br />" + this.options.messages.ReportViewer_ClientExpired), r2;
|
|
4182
|
+
} else r2 = he(e2.responseText);
|
|
4183
|
+
return (i2 || t2) && (r2 && (r2 = " " + r2), r2 = he(i2 || t2) + r2), ye(e2) && (r2 += "<br />" + this.options.messages.ReportViewer_ClientExpired), r2;
|
|
3359
4184
|
}
|
|
3360
4185
|
raiseError(e2, t2 = true) {
|
|
3361
4186
|
this.emit("error", e2, t2);
|
|
@@ -3368,17 +4193,17 @@ var telerikReportViewer = (function (exports) {
|
|
|
3368
4193
|
}
|
|
3369
4194
|
initializeClient() {
|
|
3370
4195
|
return this.registerClientPromise || (this.registerClientPromise = this.serviceClient.registerClient().catch((e2) => {
|
|
3371
|
-
const t2 =
|
|
4196
|
+
const t2 = be(this.options.messages.ReportViewer_ErrorServiceUrl, [this.serviceClient.getServiceUrl()]);
|
|
3372
4197
|
this.handleRequestError(e2, t2);
|
|
3373
4198
|
}).then(this.setClientId.bind(this)).catch(this.clearClientId.bind(this))), this.registerClientPromise;
|
|
3374
4199
|
}
|
|
3375
4200
|
registerInstance() {
|
|
3376
4201
|
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;
|
|
3377
4202
|
}
|
|
3378
|
-
registerDocumentAsync(e2, t2,
|
|
3379
|
-
return
|
|
3380
|
-
return (yield this.serviceClient.createReportDocument(this.clientId, this.reportInstanceId, e3, t3, !
|
|
3381
|
-
this.handleRequestError(t4,
|
|
4203
|
+
registerDocumentAsync(e2, t2, i2) {
|
|
4204
|
+
return s(this, arguments, void 0, function* (e3, t3, i3, n2 = "", r2 = "") {
|
|
4205
|
+
return (yield this.serviceClient.createReportDocument(this.clientId, this.reportInstanceId, e3, t3, !i3, n2, r2).catch((t4) => {
|
|
4206
|
+
this.handleRequestError(t4, be(this.options.messages.ReportViewer_ErrorCreatingReportDocument, he(this.getReport()), he(e3)));
|
|
3382
4207
|
})) || "";
|
|
3383
4208
|
});
|
|
3384
4209
|
}
|
|
@@ -3395,12 +4220,17 @@ var telerikReportViewer = (function (exports) {
|
|
|
3395
4220
|
return this.printManager.getDirectPrintState();
|
|
3396
4221
|
}
|
|
3397
4222
|
}
|
|
4223
|
+
getReportFileName() {
|
|
4224
|
+
var e2, t2, i2, n2;
|
|
4225
|
+
const r2 = (null !== (i2 = (null !== (t2 = null === (e2 = this.options.reportSource) || void 0 === e2 ? void 0 : e2.report) && void 0 !== t2 ? t2 : "").split(",")[0].trim().split(/[/\\]/).pop()) && void 0 !== i2 ? i2 : "").replace(/\.(trdp|trdx|trl)$/i, "");
|
|
4226
|
+
return (r2.includes(".") && null !== (n2 = r2.split(".").pop()) && void 0 !== n2 ? n2 : r2) || "report";
|
|
4227
|
+
}
|
|
3398
4228
|
createPreviewDeviceInfo() {
|
|
3399
4229
|
let e2 = this.createDeviceInfo();
|
|
3400
4230
|
return e2.ContentOnly = true, e2.UseSVG = true, e2;
|
|
3401
4231
|
}
|
|
3402
4232
|
createDeviceInfo() {
|
|
3403
|
-
let e2 = new
|
|
4233
|
+
let e2 = new o();
|
|
3404
4234
|
this.options.enableAccessibility && (e2.enableAccessibility = true, e2.contentTabIndex = this.getContentTabIndex());
|
|
3405
4235
|
let t2 = this.getSearchInitiated(), i2 = this.options.searchMetadataOnDemand;
|
|
3406
4236
|
return e2.enableSearch = !i2 || t2, e2;
|
|
@@ -3411,12 +4241,11 @@ var telerikReportViewer = (function (exports) {
|
|
|
3411
4241
|
});
|
|
3412
4242
|
}
|
|
3413
4243
|
getReportParameters() {
|
|
3414
|
-
if (!this.parameterValues)
|
|
3415
|
-
return {};
|
|
4244
|
+
if (!this.parameterValues) return {};
|
|
3416
4245
|
const e2 = {}, t2 = this.getProcessedParameterValues();
|
|
3417
4246
|
for (let i2 in t2) {
|
|
3418
4247
|
const n2 = t2[i2], r2 = this.parameterValues[i2];
|
|
3419
|
-
n2 && n2.availableValues ? n2.multivalue ? e2[i2] =
|
|
4248
|
+
n2 && n2.availableValues ? n2.multivalue ? e2[i2] = Fe(n2, r2, i2) : e2[i2] = Ve(n2, r2, i2) : e2[i2] = r2;
|
|
3420
4249
|
}
|
|
3421
4250
|
return e2;
|
|
3422
4251
|
}
|
|
@@ -3426,11 +4255,11 @@ var telerikReportViewer = (function (exports) {
|
|
|
3426
4255
|
getProcessedParameterValues() {
|
|
3427
4256
|
return this.processedParameterValues;
|
|
3428
4257
|
}
|
|
3429
|
-
getDocumentInfo(t2,
|
|
3430
|
-
return t2 && this.emit("beginLoadReport"), new Promise((
|
|
3431
|
-
let o2 = () =>
|
|
3432
|
-
this.cancelLoad ?
|
|
3433
|
-
|
|
4258
|
+
getDocumentInfo(t2, i2) {
|
|
4259
|
+
return t2 && this.emit("beginLoadReport"), new Promise((n2, r2) => {
|
|
4260
|
+
let o2 = () => s(this, void 0, void 0, function* () {
|
|
4261
|
+
this.cancelLoad ? r2(this.options.messages.ReportViewer_RenderingCancelled) : (yield this.registerInstancePromise, this.serviceClient.getDocumentInfo(this.clientId, this.reportInstanceId, i2).then((i3) => {
|
|
4262
|
+
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));
|
|
3434
4263
|
}).catch((e2) => {
|
|
3435
4264
|
"InvalidDocumentException" !== e2.responseJSON.exceptionType ? this.handleRequestError(e2, "", true) : console.warn("getDocumentInfo failed or was canceled by the user: " + e2.exceptionMessage);
|
|
3436
4265
|
}));
|
|
@@ -3449,15 +4278,12 @@ var telerikReportViewer = (function (exports) {
|
|
|
3449
4278
|
});
|
|
3450
4279
|
}
|
|
3451
4280
|
getPageForBookmark(e2, t2) {
|
|
3452
|
-
if (e2)
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
if (r2)
|
|
3459
|
-
return r2;
|
|
3460
|
-
}
|
|
4281
|
+
if (e2) for (let i2 = 0, n2 = e2.length; i2 < n2; i2++) {
|
|
4282
|
+
let n3 = e2[i2];
|
|
4283
|
+
if (n3.id === t2) return n3.page;
|
|
4284
|
+
let r2 = this.getPageForBookmark(n3.items, t2);
|
|
4285
|
+
if (r2) return r2;
|
|
4286
|
+
}
|
|
3461
4287
|
return 0;
|
|
3462
4288
|
}
|
|
3463
4289
|
fixDataContractJsonSerializer(e2) {
|
|
@@ -3563,8 +4389,8 @@ ${e3.text} (${e3.id})`;
|
|
|
3563
4389
|
sessionStorage.clear();
|
|
3564
4390
|
}
|
|
3565
4391
|
}, e.ReportControllerOptions = class {
|
|
3566
|
-
constructor(e2, t2, i2, n2, r2, s2, o2, a2, l2, h2 = false,
|
|
3567
|
-
this.keepClientAlive = false, this.keepClientAlive = e2, this.authenticationToken = t2, this.
|
|
4392
|
+
constructor(e2, t2, i2, n2, r2, s2, o2, a2, l2, h2, c2 = false, d2 = false) {
|
|
4393
|
+
this.keepClientAlive = false, this.keepClientAlive = e2, this.authenticationToken = t2, this.nonce = i2, this.reportSource = n2, this.printMode = r2, this.pageMode = s2, this.viewMode = o2, this.scaleMode = a2, this.scale = l2, this.messages = h2, this.enableAccessibility = c2, this.searchMetadataOnDemand = d2;
|
|
3568
4394
|
}
|
|
3569
4395
|
}, e.ReportServerSettings = class {
|
|
3570
4396
|
constructor(e2, t2, i2) {
|
|
@@ -3574,13 +4400,13 @@ ${e3.text} (${e3.id})`;
|
|
|
3574
4400
|
constructor(e2, t2) {
|
|
3575
4401
|
this.url = e2, this.getPersonalAccessToken = t2;
|
|
3576
4402
|
}
|
|
3577
|
-
}, e.ReportSourceOptions =
|
|
4403
|
+
}, e.ReportSourceOptions = Oe, e.RequestError = C, e.SearchInfo = class {
|
|
3578
4404
|
constructor() {
|
|
3579
4405
|
this.searchToken = "", this.matchCase = false, this.matchWholeWord = false, this.useRegularExpressions = false;
|
|
3580
4406
|
}
|
|
3581
|
-
}, e.SearchManager = class extends
|
|
4407
|
+
}, e.SearchManager = class extends q {
|
|
3582
4408
|
constructor(e2, t2) {
|
|
3583
|
-
super(), this.searchResults = [], this.pendingHighlightItem = null, this.highlightedElements = [], this.currentHighlightedElement = null, this.isActive = false, this.controller = t2, this.pageContainer =
|
|
4409
|
+
super(), this.searchResults = [], this.pendingHighlightItem = null, this.highlightedElements = [], this.currentHighlightedElement = null, this.isActive = false, this.controller = t2, this.pageContainer = fe(e2, ".trv-page-container"), this.controller.on("applySearchColors", this.applySearchColors.bind(this)).on("pageReady", this.applySearchColors.bind(this));
|
|
3584
4410
|
}
|
|
3585
4411
|
search(e2) {
|
|
3586
4412
|
this.isActive = true, this.clearColoredItems(), this.searchResults = [], e2.searchToken && "" !== e2.searchToken ? this.controller.getSearchResults(e2).then(this.onSearchComplete.bind(this)) : this.onSearchComplete([]);
|
|
@@ -3589,15 +4415,15 @@ ${e3.text} (${e3.id})`;
|
|
|
3589
4415
|
this.isActive = false, this.clearColoredItems(), this.searchResults = [];
|
|
3590
4416
|
}
|
|
3591
4417
|
highlightSearchItem(t2) {
|
|
3592
|
-
t2 && (this.currentHighlightedElement && (
|
|
4418
|
+
t2 && (this.currentHighlightedElement && (re(this.currentHighlightedElement, Ze), ne(this.currentHighlightedElement, We)), 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));
|
|
3593
4419
|
}
|
|
3594
4420
|
navigateToPage(e2) {
|
|
3595
|
-
this.controller.navigateToPage(e2.page, new
|
|
4421
|
+
this.controller.navigateToPage(e2.page, new h(e2.id, "search"));
|
|
3596
4422
|
}
|
|
3597
4423
|
colorPageElements(e2) {
|
|
3598
4424
|
e2 && 0 !== e2.length && (e2.forEach((e3) => {
|
|
3599
|
-
let t2 =
|
|
3600
|
-
t2 && (
|
|
4425
|
+
let t2 = fe(this.pageContainer, "[data-search-id=" + e3.id + "]");
|
|
4426
|
+
t2 && (ne(t2, We), this.highlightedElements.push(t2));
|
|
3601
4427
|
}), this.highlightItem(this.pendingHighlightItem));
|
|
3602
4428
|
}
|
|
3603
4429
|
highlightItem(e2) {
|
|
@@ -3605,13 +4431,13 @@ ${e3.text} (${e3.id})`;
|
|
|
3605
4431
|
let t2 = this.highlightedElements.find(function(t3) {
|
|
3606
4432
|
return t3.dataset.searchId === e2.id;
|
|
3607
4433
|
});
|
|
3608
|
-
t2 && (this.currentHighlightedElement = t2,
|
|
4434
|
+
t2 && (this.currentHighlightedElement = t2, re(t2, We), ne(t2, Ze));
|
|
3609
4435
|
}
|
|
3610
4436
|
}
|
|
3611
4437
|
clearColoredItems() {
|
|
3612
4438
|
this.highlightedElements && this.highlightedElements.length > 0 && this.highlightedElements.forEach((e2) => {
|
|
3613
|
-
|
|
3614
|
-
}), this.currentHighlightedElement &&
|
|
4439
|
+
re(e2, We);
|
|
4440
|
+
}), this.currentHighlightedElement && re(this.currentHighlightedElement, Ze), this.highlightedElements = [], this.currentHighlightedElement = null;
|
|
3615
4441
|
}
|
|
3616
4442
|
applySearchColors() {
|
|
3617
4443
|
this.isActive && this.colorPageElements(this.searchResults);
|
|
@@ -3623,41 +4449,40 @@ ${e3.text} (${e3.id})`;
|
|
|
3623
4449
|
constructor() {
|
|
3624
4450
|
this.description = "", this.id = "", this.page = 0;
|
|
3625
4451
|
}
|
|
3626
|
-
}, e.SendEmailDocumentReadyEventArgs =
|
|
4452
|
+
}, e.SendEmailDocumentReadyEventArgs = m, e.SendEmailStartedEventArgs = f, e.ServiceClient = class {
|
|
3627
4453
|
constructor(e2) {
|
|
3628
4454
|
this.connectionConfig = this.getConnectionConfig(e2), this.authStrategy = this.getAuthStrategy(this.connectionConfig);
|
|
3629
4455
|
}
|
|
3630
4456
|
getConnectionConfig(e2) {
|
|
3631
|
-
return e2.reportServer && e2.reportServer.url && e2.reportServer.username && e2.reportServer.password ? new
|
|
4457
|
+
return e2.reportServer && e2.reportServer.url && e2.reportServer.username && e2.reportServer.password ? new E(e2.reportServer.url, e2.reportServer.username, e2.reportServer.password) : e2.reportServer && e2.reportServer.url && e2.reportServer.getPersonalAccessToken ? new M(e2.reportServer.url, e2.reportServer.getPersonalAccessToken) : e2.reportServer && e2.reportServer.url ? new A(e2.reportServer.url) : e2.serverPreview && e2.serverShareToken ? new M("", () => Promise.resolve(e2.serverShareToken)) : new R(e2.serviceUrl);
|
|
3632
4458
|
}
|
|
3633
4459
|
getAuthStrategy(t2) {
|
|
3634
4460
|
switch (t2.authType) {
|
|
3635
4461
|
case e.AuthType.None:
|
|
3636
|
-
return new
|
|
4462
|
+
return new b();
|
|
3637
4463
|
case e.AuthType.Basic:
|
|
3638
|
-
return new
|
|
4464
|
+
return new w(t2);
|
|
3639
4465
|
case e.AuthType.PersonalToken:
|
|
3640
|
-
return new
|
|
4466
|
+
return new L(t2);
|
|
3641
4467
|
default:
|
|
3642
|
-
return new
|
|
4468
|
+
return new b();
|
|
3643
4469
|
}
|
|
3644
4470
|
}
|
|
3645
4471
|
validateClientID(e2) {
|
|
3646
|
-
if (!e2)
|
|
3647
|
-
throw "Invalid ClientId";
|
|
4472
|
+
if (!e2) throw "Invalid ClientId";
|
|
3648
4473
|
}
|
|
3649
4474
|
authenticatedGet(e2) {
|
|
3650
|
-
return this.login().then((t2) => (null == t2 ? void 0 : t2.expiresAt) < Date.now() ? (this.loginPromise = this.authStrategy.authenticatePromise(true, t2.refreshToken), this.authenticatedGet(e2)) : function(e3, t3) {
|
|
3651
|
-
return fetch(e3, { headers:
|
|
3652
|
-
}(e2, t2.access_token || t2.accessToken));
|
|
4475
|
+
return this.login().then((t2) => (null == t2 ? void 0 : t2.expiresAt) < Date.now() ? (this.loginPromise = this.authStrategy.authenticatePromise(true, t2.refreshToken), this.authenticatedGet(e2)) : (function(e3, t3) {
|
|
4476
|
+
return fetch(e3, { headers: y(t3) }).then(S);
|
|
4477
|
+
})(e2, t2.access_token || t2.accessToken));
|
|
3653
4478
|
}
|
|
3654
4479
|
authenticatedPost(e2, t2) {
|
|
3655
|
-
return this.login().then((i2) => (null == i2 ? void 0 : i2.expiresAt) < Date.now() ? (this.loginPromise = this.authStrategy.authenticatePromise(true, i2.refreshToken), this.authenticatedPost(e2, t2)) :
|
|
4480
|
+
return this.login().then((i2) => (null == i2 ? void 0 : i2.expiresAt) < Date.now() ? (this.loginPromise = this.authStrategy.authenticatePromise(true, i2.refreshToken), this.authenticatedPost(e2, t2)) : I(e2, t2, i2.access_token || i2.accessToken));
|
|
3656
4481
|
}
|
|
3657
4482
|
authenticatedDelete(e2) {
|
|
3658
|
-
return this.login().then((t2) => t2.expiresAt < Date.now() ? (this.loginPromise = this.authStrategy.authenticatePromise(true, t2.refreshToken), this.authenticatedDelete(e2)) : function(e3, t3) {
|
|
3659
|
-
return fetch(e3, { method: "DELETE", headers:
|
|
3660
|
-
}(e2, t2.access_token || t2.accessToken));
|
|
4483
|
+
return this.login().then((t2) => t2.expiresAt < Date.now() ? (this.loginPromise = this.authStrategy.authenticatePromise(true, t2.refreshToken), this.authenticatedDelete(e2)) : (function(e3, t3) {
|
|
4484
|
+
return fetch(e3, { method: "DELETE", headers: y(t3) }).then(S);
|
|
4485
|
+
})(e2, t2.access_token || t2.accessToken));
|
|
3661
4486
|
}
|
|
3662
4487
|
login() {
|
|
3663
4488
|
return this.loginPromise || (this.loginPromise = this.authStrategy.authenticatePromise(false, null)), this.loginPromise;
|
|
@@ -3740,15 +4565,16 @@ ${e3.text} (${e3.id})`;
|
|
|
3740
4565
|
return e2.clientSessionTimeout;
|
|
3741
4566
|
});
|
|
3742
4567
|
}
|
|
3743
|
-
}, e.TooltipEventArgs =
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
if (!
|
|
3748
|
-
|
|
4568
|
+
}, e.TooltipEventArgs = P, e.addClass = ne, e.appendHtml = pe, e.createElement = ie, e.debounce = ve, e.each = we, e.escapeHtml = he, e.findElement = fe, e.getColorAlphaValue = ue, e.getElementAttributeValue = function(e2, t2) {
|
|
4569
|
+
var i2;
|
|
4570
|
+
return e2 && e2.attributes && (null === (i2 = e2.attributes[t2]) || void 0 === i2 ? void 0 : i2.value) || "";
|
|
4571
|
+
}, e.getElementScrollParent = me, e.getOffsetParent = oe, e.hasClass = se, e.isArray = Le, e.isExceptionOfType = Ce, e.isInternalServerError = Ie, e.isInvalidClientException = ye, e.isInvalidParameterException = Se, e.isRgbColor = de, e.keepElementInView = function(e2) {
|
|
4572
|
+
if (!e2) return;
|
|
4573
|
+
let t2 = me(e2);
|
|
4574
|
+
if (!t2) return;
|
|
3749
4575
|
let i2 = e2.offsetTop, n2 = i2 + e2.offsetHeight, r2 = t2.scrollTop + t2.offsetHeight;
|
|
3750
4576
|
i2 < t2.scrollTop ? t2.scrollTop = i2 : n2 > r2 && (t2.scrollTop += n2 - r2);
|
|
3751
|
-
}, e.parseToLocalDate =
|
|
4577
|
+
}, e.parseToLocalDate = Ae, e.prependHtml = ge, e.removeClass = re, e.reportSourcesAreEqual = function(e2) {
|
|
3752
4578
|
const t2 = e2.firstReportSource, i2 = e2.secondReportSource;
|
|
3753
4579
|
if (t2 && i2 && t2.report === i2.report) {
|
|
3754
4580
|
let e3 = "";
|
|
@@ -3757,7 +4583,7 @@ ${e3.text} (${e3.id})`;
|
|
|
3757
4583
|
return i2.parameters && (n2 = JSON.stringify(i2.parameters)), e3 === n2;
|
|
3758
4584
|
}
|
|
3759
4585
|
return false;
|
|
3760
|
-
}, e.scaleElement =
|
|
4586
|
+
}, e.scaleElement = le, e.stringFormat = be, e.throttle = Pe, e.toPixel = ae, e.toRgbColor = ce, e.tryParseFloat = Re, e.tryParseInt = Te, Object.defineProperty(e, "__esModule", { value: true });
|
|
3761
4587
|
});
|
|
3762
4588
|
})(dist, dist.exports);
|
|
3763
4589
|
var distExports = dist.exports;
|
|
@@ -3996,33 +4822,33 @@ ${e3.text} (${e3.id})`;
|
|
|
3996
4822
|
|
|
3997
4823
|
const utils = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
3998
4824
|
__proto__: null,
|
|
4825
|
+
isSpecialKey,
|
|
4826
|
+
rectangle,
|
|
4827
|
+
generateGuidString,
|
|
4828
|
+
trim,
|
|
4829
|
+
replaceAll,
|
|
4830
|
+
lTrim,
|
|
4831
|
+
rTrim,
|
|
4832
|
+
stringFormat,
|
|
4833
|
+
escapeHtml,
|
|
3999
4834
|
adjustTimezone,
|
|
4835
|
+
unadjustTimezone,
|
|
4000
4836
|
areEqual,
|
|
4001
4837
|
areEqualArrays,
|
|
4002
|
-
escapeHtml,
|
|
4003
|
-
exceptionTypeNamesMatch,
|
|
4004
|
-
filterUniqueLastOccurrence,
|
|
4005
|
-
generateGuidString,
|
|
4006
|
-
getColorAlphaValue,
|
|
4007
|
-
getExceptionInstance,
|
|
4008
4838
|
isApplicationException,
|
|
4009
4839
|
isApplicationExceptionInstance,
|
|
4010
|
-
|
|
4011
|
-
isSpecialKey,
|
|
4012
|
-
lTrim,
|
|
4013
|
-
logError,
|
|
4840
|
+
exceptionTypeNamesMatch,
|
|
4014
4841
|
parseJSON,
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
replaceAll,
|
|
4019
|
-
reportSourcesAreEqual: distExports.reportSourcesAreEqual,
|
|
4020
|
-
stringFormat,
|
|
4842
|
+
getExceptionInstance,
|
|
4843
|
+
filterUniqueLastOccurrence,
|
|
4844
|
+
logError,
|
|
4021
4845
|
toRgbColor,
|
|
4022
|
-
|
|
4023
|
-
|
|
4846
|
+
isRgbColor,
|
|
4847
|
+
getColorAlphaValue,
|
|
4024
4848
|
tryParseInt: distExports.tryParseInt,
|
|
4025
|
-
|
|
4849
|
+
tryParseFloat: distExports.tryParseFloat,
|
|
4850
|
+
parseToLocalDate: distExports.parseToLocalDate,
|
|
4851
|
+
reportSourcesAreEqual: distExports.reportSourcesAreEqual
|
|
4026
4852
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
4027
4853
|
|
|
4028
4854
|
function toPixels(value) {
|
|
@@ -4067,9 +4893,9 @@ ${e3.text} (${e3.id})`;
|
|
|
4067
4893
|
|
|
4068
4894
|
const domUtils = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
4069
4895
|
__proto__: null,
|
|
4070
|
-
getBorderWidth,
|
|
4071
4896
|
getMargins,
|
|
4072
4897
|
getPadding,
|
|
4898
|
+
getBorderWidth,
|
|
4073
4899
|
scale
|
|
4074
4900
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
4075
4901
|
|
|
@@ -4279,8 +5105,8 @@ ${e3.text} (${e3.id})`;
|
|
|
4279
5105
|
if (prefixedDataCommand && reportViewerTarget) {
|
|
4280
5106
|
var dataCommand = prefixedDataCommand.substring("telerik_ReportViewer_".length);
|
|
4281
5107
|
var reportViewer = $(reportViewerTarget).data("telerik_ReportViewer");
|
|
4282
|
-
var cmd = reportViewer.commands[dataCommand];
|
|
4283
|
-
if (cmd.getEnabled()) {
|
|
5108
|
+
var cmd = reportViewer && reportViewer.commands && reportViewer.commands[dataCommand];
|
|
5109
|
+
if (cmd && cmd.getEnabled()) {
|
|
4284
5110
|
cmd.exec($(event.currentTarget).attr("data-command-parameter"));
|
|
4285
5111
|
}
|
|
4286
5112
|
event.preventDefault();
|
|
@@ -4933,7 +5759,7 @@ ${e3.text} (${e3.id})`;
|
|
|
4933
5759
|
return true;
|
|
4934
5760
|
}
|
|
4935
5761
|
};
|
|
4936
|
-
var multivalueUtils = function() {
|
|
5762
|
+
var multivalueUtils = /* @__PURE__ */ (function() {
|
|
4937
5763
|
var lineSeparator = "\n";
|
|
4938
5764
|
return {
|
|
4939
5765
|
formatValue: (value) => {
|
|
@@ -4952,7 +5778,7 @@ ${e3.text} (${e3.id})`;
|
|
|
4952
5778
|
return ("" + text).split(lineSeparator);
|
|
4953
5779
|
}
|
|
4954
5780
|
};
|
|
4955
|
-
}();
|
|
5781
|
+
})();
|
|
4956
5782
|
function integerInputBehavior(input) {
|
|
4957
5783
|
function isValid(newValue) {
|
|
4958
5784
|
return /^(\-|\+)?([0-9]*)$/.test(newValue);
|
|
@@ -5227,7 +6053,7 @@ ${e3.text} (${e3.id})`;
|
|
|
5227
6053
|
parameter = param;
|
|
5228
6054
|
try {
|
|
5229
6055
|
listView = $list.kendoListView({
|
|
5230
|
-
template:
|
|
6056
|
+
template: ({ name }) => `<div class="trv-listviewitem multiselect-template">${kendo.htmlEncode(name)}</div>`,
|
|
5231
6057
|
dataSource: { data: parameter.availableValues },
|
|
5232
6058
|
selectable: "MULTIPLE",
|
|
5233
6059
|
navigatable: navigatableEnabledForList(options.enableAccessibility),
|
|
@@ -5467,7 +6293,7 @@ ${e3.text} (${e3.id})`;
|
|
|
5467
6293
|
parameter = param;
|
|
5468
6294
|
try {
|
|
5469
6295
|
listView = $list.kendoListView({
|
|
5470
|
-
template:
|
|
6296
|
+
template: ({ name }) => `<div class="trv-listviewitem">${kendo.htmlEncode(name)}</div>`,
|
|
5471
6297
|
dataSource: { data: parameter.availableValues },
|
|
5472
6298
|
selectable: true,
|
|
5473
6299
|
navigatable: navigatableEnabledForList(options.enableAccessibility)
|
|
@@ -5564,7 +6390,7 @@ ${e3.text} (${e3.id})`;
|
|
|
5564
6390
|
parameter = param;
|
|
5565
6391
|
try {
|
|
5566
6392
|
editor = $editorDom.kendoComboBox({
|
|
5567
|
-
template:
|
|
6393
|
+
template: ({ name }) => `<div class="trv-editoritem">${kendo.htmlEncode(name)}</div>`,
|
|
5568
6394
|
dataSource: parameter.availableValues,
|
|
5569
6395
|
dataTextField: "name",
|
|
5570
6396
|
dataValueField: "value",
|
|
@@ -5819,7 +6645,7 @@ ${e3.text} (${e3.id})`;
|
|
|
5819
6645
|
}
|
|
5820
6646
|
];
|
|
5821
6647
|
|
|
5822
|
-
var ParameterValidators = function() {
|
|
6648
|
+
var ParameterValidators = (function() {
|
|
5823
6649
|
var validators = {};
|
|
5824
6650
|
function validateParameter(parameter, value, validatorFunc, compareFunc) {
|
|
5825
6651
|
var values = [].concat(value).map((value1) => {
|
|
@@ -5972,7 +6798,7 @@ ${e3.text} (${e3.id})`;
|
|
|
5972
6798
|
return v.validate(parameter, value);
|
|
5973
6799
|
}
|
|
5974
6800
|
};
|
|
5975
|
-
}();
|
|
6801
|
+
})();
|
|
5976
6802
|
|
|
5977
6803
|
function PerspectiveManager(element, controller, notificationService) {
|
|
5978
6804
|
var smallMenu = element.querySelectorAll ? element.querySelectorAll(".trv-menu-small")[0] : false;
|
|
@@ -6409,7 +7235,7 @@ ${e3.text} (${e3.id})`;
|
|
|
6409
7235
|
// #endregion
|
|
6410
7236
|
}
|
|
6411
7237
|
|
|
6412
|
-
|
|
7238
|
+
class EventEmitter$1 extends EventTarget {
|
|
6413
7239
|
_events;
|
|
6414
7240
|
_eventsCount;
|
|
6415
7241
|
constructor() {
|
|
@@ -6527,7 +7353,7 @@ ${e3.text} (${e3.id})`;
|
|
|
6527
7353
|
}
|
|
6528
7354
|
return this.removeListener(type, listener);
|
|
6529
7355
|
}
|
|
6530
|
-
}
|
|
7356
|
+
}
|
|
6531
7357
|
|
|
6532
7358
|
var defaultOptions$3 = {};
|
|
6533
7359
|
var Events = {
|
|
@@ -7729,7 +8555,7 @@ ${e3.text} (${e3.id})`;
|
|
|
7729
8555
|
event.sender.trigger("change");
|
|
7730
8556
|
}
|
|
7731
8557
|
});
|
|
7732
|
-
|
|
8558
|
+
var editorOptions = {
|
|
7733
8559
|
tools: [
|
|
7734
8560
|
"bold",
|
|
7735
8561
|
"italic",
|
|
@@ -7754,7 +8580,12 @@ ${e3.text} (${e3.id})`;
|
|
|
7754
8580
|
"subscript",
|
|
7755
8581
|
"superscript"
|
|
7756
8582
|
]
|
|
7757
|
-
}
|
|
8583
|
+
};
|
|
8584
|
+
if (this.viewerOptions.nonce) {
|
|
8585
|
+
editorOptions.nonce = this.viewerOptions.nonce;
|
|
8586
|
+
editorOptions.unsafeInline = false;
|
|
8587
|
+
}
|
|
8588
|
+
this.bodyEditor = new kendo.ui.Editor(this.element.querySelector(`[name="${prefix}-emailBody"]`), editorOptions);
|
|
7758
8589
|
this.setDefaultValues(this.viewerOptions.sendEmail);
|
|
7759
8590
|
this.kendoValidator = new kendo.ui.Validator(this.element.querySelector(".trv-send-email-fields"), {});
|
|
7760
8591
|
}
|
|
@@ -8074,7 +8905,7 @@ ${e3.text} (${e3.id})`;
|
|
|
8074
8905
|
// #endregion
|
|
8075
8906
|
}
|
|
8076
8907
|
|
|
8077
|
-
const TemplateCache = function() {
|
|
8908
|
+
const TemplateCache = /* @__PURE__ */ (function() {
|
|
8078
8909
|
var cache = {};
|
|
8079
8910
|
return {
|
|
8080
8911
|
load: (url, serviceUrl, client) => {
|
|
@@ -8104,7 +8935,7 @@ ${e3.text} (${e3.id})`;
|
|
|
8104
8935
|
return p;
|
|
8105
8936
|
}
|
|
8106
8937
|
};
|
|
8107
|
-
}();
|
|
8938
|
+
})();
|
|
8108
8939
|
|
|
8109
8940
|
class ReportViewerSettings {
|
|
8110
8941
|
// #region fields
|
|
@@ -8784,7 +9615,8 @@ ${e3.text} (${e3.id})`;
|
|
|
8784
9615
|
_initAiPrompt(promptSuggestions) {
|
|
8785
9616
|
if (this.aiPromptInitialized) {
|
|
8786
9617
|
this.kendoAiPrompt.setOptions({
|
|
8787
|
-
promptSuggestions
|
|
9618
|
+
promptSuggestions,
|
|
9619
|
+
speechToText: this.allowCustomPrompts
|
|
8788
9620
|
});
|
|
8789
9621
|
this.kendoAiPrompt.activeView(this.kendoAiPrompt.activeView());
|
|
8790
9622
|
} else {
|
|
@@ -8816,6 +9648,7 @@ ${e3.text} (${e3.id})`;
|
|
|
8816
9648
|
} }
|
|
8817
9649
|
],
|
|
8818
9650
|
promptSuggestions,
|
|
9651
|
+
speechToText: this.allowCustomPrompts,
|
|
8819
9652
|
views: [
|
|
8820
9653
|
{
|
|
8821
9654
|
type: "prompt",
|
|
@@ -9068,12 +9901,16 @@ ${e3.text} (${e3.id})`;
|
|
|
9068
9901
|
switch (iconId) {
|
|
9069
9902
|
case 0:
|
|
9070
9903
|
return ProductNotLicensedIcon();
|
|
9904
|
+
// Key icon
|
|
9071
9905
|
case 1:
|
|
9072
9906
|
return NoLicenseIcon();
|
|
9907
|
+
// Diamond icon. Currently not possible for reporting?
|
|
9073
9908
|
case 2:
|
|
9074
9909
|
return ExpiredLicenseSubscriptionIcon();
|
|
9910
|
+
// RecurringDollar icon
|
|
9075
9911
|
case 3:
|
|
9076
9912
|
return ExpiredTrialIcon();
|
|
9913
|
+
// TrialTag icon
|
|
9077
9914
|
default:
|
|
9078
9915
|
return ProductNotLicensedIcon();
|
|
9079
9916
|
}
|
|
@@ -9145,6 +9982,7 @@ ${e3.text} (${e3.id})`;
|
|
|
9145
9982
|
reportSource: null,
|
|
9146
9983
|
reportServer: null,
|
|
9147
9984
|
authenticationToken: null,
|
|
9985
|
+
nonce: null,
|
|
9148
9986
|
sendEmail: null,
|
|
9149
9987
|
scale: 1,
|
|
9150
9988
|
scaleMode: ScaleModes.SPECIFIC,
|
|
@@ -9202,7 +10040,7 @@ ${e3.text} (${e3.id})`;
|
|
|
9202
10040
|
if (!validateOptions(options)) {
|
|
9203
10041
|
return;
|
|
9204
10042
|
}
|
|
9205
|
-
var version = "20.
|
|
10043
|
+
var version = "20.2.26.812";
|
|
9206
10044
|
options = $.extend({}, getDefaultOptions(svcApiUrl, version), options);
|
|
9207
10045
|
settings = new ReportViewerSettings(
|
|
9208
10046
|
persistanceKey,
|
|
@@ -9226,6 +10064,7 @@ ${e3.text} (${e3.id})`;
|
|
|
9226
10064
|
controllerOptions = new distExports.ReportControllerOptions(
|
|
9227
10065
|
options.keepClientAlive,
|
|
9228
10066
|
options.authenticationToken,
|
|
10067
|
+
options.nonce,
|
|
9229
10068
|
options.reportSource,
|
|
9230
10069
|
printModeMap[options.printMode],
|
|
9231
10070
|
pageModeMap[options.pageMode],
|
|
@@ -9638,7 +10477,7 @@ ${e3.text} (${e3.id})`;
|
|
|
9638
10477
|
let controllerEventName = viewerAsyncEventsMapping[eventName];
|
|
9639
10478
|
controller.onAsync(controllerEventName, eventProxy(eventName));
|
|
9640
10479
|
}
|
|
9641
|
-
notificationService.on(notificationService.Events.UPDATE_UI, function($viewer2) {
|
|
10480
|
+
notificationService.on(notificationService.Events.UPDATE_UI, /* @__PURE__ */ (function($viewer2) {
|
|
9642
10481
|
return function(e, args) {
|
|
9643
10482
|
$viewer2.trigger(
|
|
9644
10483
|
{
|
|
@@ -9648,7 +10487,7 @@ ${e3.text} (${e3.id})`;
|
|
|
9648
10487
|
args
|
|
9649
10488
|
);
|
|
9650
10489
|
};
|
|
9651
|
-
}($viewer));
|
|
10490
|
+
})($viewer));
|
|
9652
10491
|
}
|
|
9653
10492
|
function attachEventHandlers() {
|
|
9654
10493
|
eventBinder(Events$1.EXPORT_BEGIN, options.exportBegin, true);
|
|
@@ -10069,6 +10908,9 @@ ${e3.text} (${e3.id})`;
|
|
|
10069
10908
|
return response.text();
|
|
10070
10909
|
}).then((kendoScript) => {
|
|
10071
10910
|
const scriptElement = document.createElement("script");
|
|
10911
|
+
if (options.nonce) {
|
|
10912
|
+
scriptElement.setAttribute("nonce", options.nonce);
|
|
10913
|
+
}
|
|
10072
10914
|
scriptElement.textContent = kendoScript;
|
|
10073
10915
|
document.head.appendChild(scriptElement);
|
|
10074
10916
|
}).catch((errorData) => {
|
|
@@ -10110,6 +10952,7 @@ ${e3.text} (${e3.id})`;
|
|
|
10110
10952
|
} else {
|
|
10111
10953
|
throw "The current browser does not support the Promise feature which is required for using the Report Viewer.";
|
|
10112
10954
|
}
|
|
10955
|
+
$placeholder.data(pluginName, viewer);
|
|
10113
10956
|
return viewer;
|
|
10114
10957
|
}
|
|
10115
10958
|
function ReportViewerServiceClient(serviceClientOptions) {
|
|
@@ -10210,7 +11053,7 @@ ${e3.text} (${e3.id})`;
|
|
|
10210
11053
|
exports.parameterEditorsMatch = parameterEditorsMatch;
|
|
10211
11054
|
exports.utils = utils;
|
|
10212
11055
|
|
|
10213
|
-
Object.
|
|
11056
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
10214
11057
|
|
|
10215
11058
|
return exports;
|
|
10216
11059
|
|