@appbaseio/reactivesearch-vue 3.3.7-beta.2 → 3.4.0
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/dist/@appbaseio/reactivesearch-vue.umd.js +294 -511
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +13 -6
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/ReactiveList.js +3 -1
- package/dist/cjs/{SearchBox-17eeed1a.js → SearchBox-9278c775.js} +3 -1
- package/dist/cjs/SearchBox.js +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/{install-3b410ce1.js → install-76c077bf.js} +1 -1
- package/dist/cjs/install.js +2 -2
- package/dist/cjs/version.js +1 -1
- package/dist/components/result/ReactiveList.d.ts +2 -0
- package/dist/components/search/SearchBox.d.ts +2 -0
- package/dist/es/ReactiveList.js +3 -1
- package/dist/es/{SearchBox-81bbbe04.js → SearchBox-559e0865.js} +7 -5
- package/dist/es/SearchBox.js +1 -1
- package/dist/es/index.js +3 -3
- package/dist/es/{install-16ae86fa.js → install-6b4e5b04.js} +1 -1
- package/dist/es/install.js +2 -2
- package/dist/es/version.js +1 -1
- package/package.json +3 -3
|
@@ -933,7 +933,7 @@
|
|
|
933
933
|
// common
|
|
934
934
|
'type', 'componentType', 'aggregationField', 'aggregationSize', 'distinctField', 'distinctFieldConfig', 'index', 'aggregations', 'compoundClause',
|
|
935
935
|
// Specific to ReactiveList
|
|
936
|
-
'dataField', 'includeFields', 'excludeFields', 'size', 'from', 'sortBy', 'sortOptions', 'pagination',
|
|
936
|
+
'dataField', 'includeFields', 'excludeFields', 'size', 'candidates', 'from', 'sortBy', 'sortOptions', 'pagination',
|
|
937
937
|
// Specific to DataSearch
|
|
938
938
|
'autoFocus', 'autosuggest', 'debounce', 'defaultValue', 'defaultSuggestions', 'fieldWeights', 'filterLabel', 'fuzziness', 'highlight', 'highlightConfig', 'highlightField', 'nestedField', 'placeholder', 'queryFormat', 'searchOperators', 'enableSynonyms', 'enableQuerySuggestions', 'queryString', 'vectorDataField', 'imageValue',
|
|
939
939
|
// Specific to Category Search
|
|
@@ -4919,7 +4919,7 @@
|
|
|
4919
4919
|
// dataField is a required field for components other than search
|
|
4920
4920
|
// TODO: Revisit this logic based on the Appbase version
|
|
4921
4921
|
// dataField is no longer a required field in RS API
|
|
4922
|
-
if (props.componentType !== componentTypes.AIAnswer && !isSearchComponent(props.componentType) && !props.dataField) {
|
|
4922
|
+
if (props.componentType !== componentTypes.AIAnswer && !isSearchComponent(props.componentType) && !props.dataField && !props.vectorDataField) {
|
|
4923
4923
|
return null;
|
|
4924
4924
|
}
|
|
4925
4925
|
var endpoint;
|
|
@@ -5017,7 +5017,8 @@
|
|
|
5017
5017
|
execute: true
|
|
5018
5018
|
}) : {}), queryType !== queryTypes.suggestion ? {
|
|
5019
5019
|
vectorDataField: props.vectorDataField || undefined,
|
|
5020
|
-
imageValue: props.imageValue || undefined
|
|
5020
|
+
imageValue: props.imageValue || undefined,
|
|
5021
|
+
candidates: props.candidates || props.size || undefined
|
|
5021
5022
|
} : {});
|
|
5022
5023
|
}
|
|
5023
5024
|
return null;
|
|
@@ -7699,7 +7700,7 @@
|
|
|
7699
7700
|
// common
|
|
7700
7701
|
'type', 'componentType', 'aggregationField', 'aggregationSize', 'distinctField', 'distinctFieldConfig', 'index', 'aggregations', 'compoundClause',
|
|
7701
7702
|
// Specific to ReactiveList
|
|
7702
|
-
'dataField', 'includeFields', 'excludeFields', 'size', 'from', 'sortBy', 'sortOptions', 'pagination',
|
|
7703
|
+
'dataField', 'includeFields', 'excludeFields', 'size', 'candidates', 'from', 'sortBy', 'sortOptions', 'pagination',
|
|
7703
7704
|
// Specific to DataSearch
|
|
7704
7705
|
'autoFocus', 'autosuggest', 'debounce', 'defaultValue', 'defaultSuggestions', 'fieldWeights', 'filterLabel', 'fuzziness', 'highlight', 'highlightConfig', 'highlightField', 'nestedField', 'placeholder', 'queryFormat', 'searchOperators', 'enableSynonyms', 'enableQuerySuggestions', 'queryString', 'vectorDataField', 'imageValue',
|
|
7705
7706
|
// Specific to Category Search
|
|
@@ -14305,7 +14306,8 @@
|
|
|
14305
14306
|
className: types.string,
|
|
14306
14307
|
componentId: types.stringRequired,
|
|
14307
14308
|
compoundClause: types.compoundClause,
|
|
14308
|
-
dataField: types.
|
|
14309
|
+
dataField: types.string,
|
|
14310
|
+
vectorDataField: types.string,
|
|
14309
14311
|
aggregationField: types.string,
|
|
14310
14312
|
aggregationSize: Q.number,
|
|
14311
14313
|
defaultQuery: types.func,
|
|
@@ -14328,6 +14330,7 @@
|
|
|
14328
14330
|
showResultStats: Q.bool.def(true),
|
|
14329
14331
|
showEndPage: Q.bool.def(false),
|
|
14330
14332
|
size: Q.number.def(10),
|
|
14333
|
+
candidates: Q.number.def(10),
|
|
14331
14334
|
sortBy: types.sortBy,
|
|
14332
14335
|
sortOptions: types.sortOptions,
|
|
14333
14336
|
URLParams: Q.bool.def(false),
|
|
@@ -18288,7 +18291,7 @@
|
|
|
18288
18291
|
}
|
|
18289
18292
|
|
|
18290
18293
|
var purify = createCommonjsModule(function (module, exports) {
|
|
18291
|
-
/*! @license DOMPurify 3.
|
|
18294
|
+
/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */
|
|
18292
18295
|
|
|
18293
18296
|
(function (global, factory) {
|
|
18294
18297
|
module.exports = factory() ;
|
|
@@ -18326,8 +18329,10 @@
|
|
|
18326
18329
|
};
|
|
18327
18330
|
}
|
|
18328
18331
|
var arrayForEach = unapply(Array.prototype.forEach);
|
|
18332
|
+
var arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
|
|
18329
18333
|
var arrayPop = unapply(Array.prototype.pop);
|
|
18330
18334
|
var arrayPush = unapply(Array.prototype.push);
|
|
18335
|
+
var arraySplice = unapply(Array.prototype.splice);
|
|
18331
18336
|
var stringToLowerCase = unapply(String.prototype.toLowerCase);
|
|
18332
18337
|
var stringToString = unapply(String.prototype.toString);
|
|
18333
18338
|
var stringMatch = unapply(String.prototype.match);
|
|
@@ -18337,12 +18342,11 @@
|
|
|
18337
18342
|
var objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
|
|
18338
18343
|
var regExpTest = unapply(RegExp.prototype.test);
|
|
18339
18344
|
var typeErrorCreate = unconstruct(TypeError);
|
|
18340
|
-
|
|
18341
18345
|
/**
|
|
18342
18346
|
* Creates a new function that calls the given function with a specified thisArg and arguments.
|
|
18343
18347
|
*
|
|
18344
|
-
* @param
|
|
18345
|
-
* @returns
|
|
18348
|
+
* @param func - The function to be wrapped and called.
|
|
18349
|
+
* @returns A new function that calls the given function with a specified thisArg and arguments.
|
|
18346
18350
|
*/
|
|
18347
18351
|
function unapply(func) {
|
|
18348
18352
|
return function (thisArg) {
|
|
@@ -18352,12 +18356,11 @@
|
|
|
18352
18356
|
return apply(func, thisArg, args);
|
|
18353
18357
|
};
|
|
18354
18358
|
}
|
|
18355
|
-
|
|
18356
18359
|
/**
|
|
18357
18360
|
* Creates a new function that constructs an instance of the given constructor function with the provided arguments.
|
|
18358
18361
|
*
|
|
18359
|
-
* @param
|
|
18360
|
-
* @returns
|
|
18362
|
+
* @param func - The constructor function to be wrapped and called.
|
|
18363
|
+
* @returns A new function that constructs an instance of the given constructor function with the provided arguments.
|
|
18361
18364
|
*/
|
|
18362
18365
|
function unconstruct(func) {
|
|
18363
18366
|
return function () {
|
|
@@ -18367,14 +18370,13 @@
|
|
|
18367
18370
|
return construct(func, args);
|
|
18368
18371
|
};
|
|
18369
18372
|
}
|
|
18370
|
-
|
|
18371
18373
|
/**
|
|
18372
18374
|
* Add properties to a lookup table
|
|
18373
18375
|
*
|
|
18374
|
-
* @param
|
|
18375
|
-
* @param
|
|
18376
|
-
* @param
|
|
18377
|
-
* @returns
|
|
18376
|
+
* @param set - The set to which elements will be added.
|
|
18377
|
+
* @param array - The array containing elements to be added to the set.
|
|
18378
|
+
* @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
|
|
18379
|
+
* @returns The modified set with added elements.
|
|
18378
18380
|
*/
|
|
18379
18381
|
function addToSet(set, array) {
|
|
18380
18382
|
var transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
|
|
@@ -18401,12 +18403,11 @@
|
|
|
18401
18403
|
}
|
|
18402
18404
|
return set;
|
|
18403
18405
|
}
|
|
18404
|
-
|
|
18405
18406
|
/**
|
|
18406
18407
|
* Clean up an array to harden against CSPP
|
|
18407
18408
|
*
|
|
18408
|
-
* @param
|
|
18409
|
-
* @returns
|
|
18409
|
+
* @param array - The array to be cleaned.
|
|
18410
|
+
* @returns The cleaned version of the array
|
|
18410
18411
|
*/
|
|
18411
18412
|
function cleanArray(array) {
|
|
18412
18413
|
for (var index = 0; index < array.length; index++) {
|
|
@@ -18417,12 +18418,11 @@
|
|
|
18417
18418
|
}
|
|
18418
18419
|
return array;
|
|
18419
18420
|
}
|
|
18420
|
-
|
|
18421
18421
|
/**
|
|
18422
18422
|
* Shallow clone an object
|
|
18423
18423
|
*
|
|
18424
|
-
* @param
|
|
18425
|
-
* @returns
|
|
18424
|
+
* @param object - The object to be cloned.
|
|
18425
|
+
* @returns A new object that copies the original.
|
|
18426
18426
|
*/
|
|
18427
18427
|
function clone(object) {
|
|
18428
18428
|
var newObject = create(null);
|
|
@@ -18443,13 +18443,12 @@
|
|
|
18443
18443
|
}
|
|
18444
18444
|
return newObject;
|
|
18445
18445
|
}
|
|
18446
|
-
|
|
18447
18446
|
/**
|
|
18448
18447
|
* This method automatically checks if the prop is function or getter and behaves accordingly.
|
|
18449
18448
|
*
|
|
18450
|
-
* @param
|
|
18451
|
-
* @param
|
|
18452
|
-
* @returns
|
|
18449
|
+
* @param object - The object to look up the getter function in its prototype chain.
|
|
18450
|
+
* @param prop - The property name for which to find the getter function.
|
|
18451
|
+
* @returns The getter function found in the prototype chain or a fallback function.
|
|
18453
18452
|
*/
|
|
18454
18453
|
function lookupGetter(object, prop) {
|
|
18455
18454
|
while (object !== null) {
|
|
@@ -18470,32 +18469,28 @@
|
|
|
18470
18469
|
return fallbackValue;
|
|
18471
18470
|
}
|
|
18472
18471
|
var html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
|
18473
|
-
|
|
18474
|
-
// SVG
|
|
18475
18472
|
var svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
|
18476
18473
|
var svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
|
|
18477
|
-
|
|
18478
18474
|
// List of SVG elements that are disallowed by default.
|
|
18479
18475
|
// We still need to know them so that we can do namespace
|
|
18480
18476
|
// checks properly in case one wants to add them to
|
|
18481
18477
|
// allow-list.
|
|
18482
18478
|
var svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
|
|
18483
18479
|
var mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);
|
|
18484
|
-
|
|
18485
18480
|
// Similarly to SVG, we want to know all MathML elements,
|
|
18486
18481
|
// even those that we disallow by default.
|
|
18487
18482
|
var mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
|
18488
18483
|
var text = freeze(['#text']);
|
|
18489
18484
|
var html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
|
|
18490
|
-
var svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', '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', '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', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', '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', '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']);
|
|
18485
|
+
var svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
18491
18486
|
var mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
|
|
18492
18487
|
var xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
|
18493
18488
|
|
|
18494
18489
|
// eslint-disable-next-line unicorn/better-regex
|
|
18495
18490
|
var MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
|
|
18496
18491
|
var ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
|
|
18497
|
-
var TMPLIT_EXPR = seal(
|
|
18498
|
-
var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]
|
|
18492
|
+
var TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
|
|
18493
|
+
var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
|
|
18499
18494
|
var ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
|
18500
18495
|
var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
|
|
18501
18496
|
);
|
|
@@ -18506,18 +18501,19 @@
|
|
|
18506
18501
|
var CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
18507
18502
|
var EXPRESSIONS = /*#__PURE__*/Object.freeze({
|
|
18508
18503
|
__proto__: null,
|
|
18509
|
-
MUSTACHE_EXPR: MUSTACHE_EXPR,
|
|
18510
|
-
ERB_EXPR: ERB_EXPR,
|
|
18511
|
-
TMPLIT_EXPR: TMPLIT_EXPR,
|
|
18512
|
-
DATA_ATTR: DATA_ATTR,
|
|
18513
18504
|
ARIA_ATTR: ARIA_ATTR,
|
|
18514
|
-
IS_ALLOWED_URI: IS_ALLOWED_URI,
|
|
18515
|
-
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
|
|
18516
18505
|
ATTR_WHITESPACE: ATTR_WHITESPACE,
|
|
18506
|
+
CUSTOM_ELEMENT: CUSTOM_ELEMENT,
|
|
18507
|
+
DATA_ATTR: DATA_ATTR,
|
|
18517
18508
|
DOCTYPE_NAME: DOCTYPE_NAME,
|
|
18518
|
-
|
|
18509
|
+
ERB_EXPR: ERB_EXPR,
|
|
18510
|
+
IS_ALLOWED_URI: IS_ALLOWED_URI,
|
|
18511
|
+
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
|
|
18512
|
+
MUSTACHE_EXPR: MUSTACHE_EXPR,
|
|
18513
|
+
TMPLIT_EXPR: TMPLIT_EXPR
|
|
18519
18514
|
});
|
|
18520
18515
|
|
|
18516
|
+
/* eslint-disable @typescript-eslint/indent */
|
|
18521
18517
|
// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
|
|
18522
18518
|
var NODE_TYPE = {
|
|
18523
18519
|
element: 1,
|
|
@@ -18538,20 +18534,18 @@
|
|
|
18538
18534
|
var getGlobal = function getGlobal() {
|
|
18539
18535
|
return typeof window === 'undefined' ? null : window;
|
|
18540
18536
|
};
|
|
18541
|
-
|
|
18542
18537
|
/**
|
|
18543
18538
|
* Creates a no-op policy for internal use only.
|
|
18544
18539
|
* Don't export this function outside this module!
|
|
18545
|
-
* @param
|
|
18546
|
-
* @param
|
|
18547
|
-
* @return
|
|
18540
|
+
* @param trustedTypes The policy factory.
|
|
18541
|
+
* @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
|
|
18542
|
+
* @return The policy created (or null, if Trusted Types
|
|
18548
18543
|
* are not supported or creating the policy failed).
|
|
18549
18544
|
*/
|
|
18550
18545
|
var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
|
|
18551
18546
|
if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
|
|
18552
18547
|
return null;
|
|
18553
18548
|
}
|
|
18554
|
-
|
|
18555
18549
|
// Allow the callers to control the unique policy name
|
|
18556
18550
|
// by adding a data-tt-policy-suffix to the script element with the DOMPurify.
|
|
18557
18551
|
// Policy creation with duplicate names throws in Trusted Types.
|
|
@@ -18578,24 +18572,27 @@
|
|
|
18578
18572
|
return null;
|
|
18579
18573
|
}
|
|
18580
18574
|
};
|
|
18575
|
+
var _createHooksMap = function _createHooksMap() {
|
|
18576
|
+
return {
|
|
18577
|
+
afterSanitizeAttributes: [],
|
|
18578
|
+
afterSanitizeElements: [],
|
|
18579
|
+
afterSanitizeShadowDOM: [],
|
|
18580
|
+
beforeSanitizeAttributes: [],
|
|
18581
|
+
beforeSanitizeElements: [],
|
|
18582
|
+
beforeSanitizeShadowDOM: [],
|
|
18583
|
+
uponSanitizeAttribute: [],
|
|
18584
|
+
uponSanitizeElement: [],
|
|
18585
|
+
uponSanitizeShadowNode: []
|
|
18586
|
+
};
|
|
18587
|
+
};
|
|
18581
18588
|
function createDOMPurify() {
|
|
18582
18589
|
var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
18583
18590
|
var DOMPurify = function DOMPurify(root) {
|
|
18584
18591
|
return createDOMPurify(root);
|
|
18585
18592
|
};
|
|
18586
|
-
|
|
18587
|
-
/**
|
|
18588
|
-
* Version label, exposed for easier checks
|
|
18589
|
-
* if DOMPurify is up to date or not
|
|
18590
|
-
*/
|
|
18591
|
-
DOMPurify.version = '3.1.5';
|
|
18592
|
-
|
|
18593
|
-
/**
|
|
18594
|
-
* Array of elements that DOMPurify removed during sanitation.
|
|
18595
|
-
* Empty if nothing was removed.
|
|
18596
|
-
*/
|
|
18593
|
+
DOMPurify.version = '3.2.4';
|
|
18597
18594
|
DOMPurify.removed = [];
|
|
18598
|
-
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) {
|
|
18595
|
+
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
18599
18596
|
// Not running in a browser, provide a factory function
|
|
18600
18597
|
// so that you can pass your own Window
|
|
18601
18598
|
DOMPurify.isSupported = false;
|
|
@@ -18616,10 +18613,10 @@
|
|
|
18616
18613
|
trustedTypes = window.trustedTypes;
|
|
18617
18614
|
var ElementPrototype = Element.prototype;
|
|
18618
18615
|
var cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
|
|
18616
|
+
var remove = lookupGetter(ElementPrototype, 'remove');
|
|
18619
18617
|
var getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
|
18620
18618
|
var getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
|
18621
18619
|
var getParentNode = lookupGetter(ElementPrototype, 'parentNode');
|
|
18622
|
-
|
|
18623
18620
|
// As per issue #47, the web-components registry is inherited by a
|
|
18624
18621
|
// new document created via createHTMLDocument. As per the spec
|
|
18625
18622
|
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
|
@@ -18640,8 +18637,7 @@
|
|
|
18640
18637
|
createDocumentFragment = _document.createDocumentFragment,
|
|
18641
18638
|
getElementsByTagName = _document.getElementsByTagName;
|
|
18642
18639
|
var importNode = originalDocument.importNode;
|
|
18643
|
-
var hooks =
|
|
18644
|
-
|
|
18640
|
+
var hooks = _createHooksMap();
|
|
18645
18641
|
/**
|
|
18646
18642
|
* Expose whether this browser supports running the full DOMPurify.
|
|
18647
18643
|
*/
|
|
@@ -18655,22 +18651,18 @@
|
|
|
18655
18651
|
ATTR_WHITESPACE = EXPRESSIONS.ATTR_WHITESPACE,
|
|
18656
18652
|
CUSTOM_ELEMENT = EXPRESSIONS.CUSTOM_ELEMENT;
|
|
18657
18653
|
var IS_ALLOWED_URI$1 = EXPRESSIONS.IS_ALLOWED_URI;
|
|
18658
|
-
|
|
18659
18654
|
/**
|
|
18660
18655
|
* We consider the elements and attributes below to be safe. Ideally
|
|
18661
18656
|
* don't add any new ones but feel free to remove unwanted ones.
|
|
18662
18657
|
*/
|
|
18663
|
-
|
|
18664
18658
|
/* allowed element names */
|
|
18665
18659
|
var ALLOWED_TAGS = null;
|
|
18666
18660
|
var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(html$1, svg$1, svgFilters, mathMl$1, text));
|
|
18667
|
-
|
|
18668
18661
|
/* Allowed attribute names */
|
|
18669
18662
|
var ALLOWED_ATTR = null;
|
|
18670
18663
|
var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(html, svg, mathMl, xml));
|
|
18671
|
-
|
|
18672
18664
|
/*
|
|
18673
|
-
* Configure how
|
|
18665
|
+
* Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
|
|
18674
18666
|
* @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
|
|
18675
18667
|
* @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
|
|
18676
18668
|
* @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
|
|
@@ -18695,65 +18687,49 @@
|
|
|
18695
18687
|
value: false
|
|
18696
18688
|
}
|
|
18697
18689
|
}));
|
|
18698
|
-
|
|
18699
18690
|
/* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
|
|
18700
18691
|
var FORBID_TAGS = null;
|
|
18701
|
-
|
|
18702
18692
|
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
|
18703
18693
|
var FORBID_ATTR = null;
|
|
18704
|
-
|
|
18705
18694
|
/* Decide if ARIA attributes are okay */
|
|
18706
18695
|
var ALLOW_ARIA_ATTR = true;
|
|
18707
|
-
|
|
18708
18696
|
/* Decide if custom data attributes are okay */
|
|
18709
18697
|
var ALLOW_DATA_ATTR = true;
|
|
18710
|
-
|
|
18711
18698
|
/* Decide if unknown protocols are okay */
|
|
18712
18699
|
var ALLOW_UNKNOWN_PROTOCOLS = false;
|
|
18713
|
-
|
|
18714
18700
|
/* Decide if self-closing tags in attributes are allowed.
|
|
18715
18701
|
* Usually removed due to a mXSS issue in jQuery 3.0 */
|
|
18716
18702
|
var ALLOW_SELF_CLOSE_IN_ATTR = true;
|
|
18717
|
-
|
|
18718
18703
|
/* Output should be safe for common template engines.
|
|
18719
18704
|
* This means, DOMPurify removes data attributes, mustaches and ERB
|
|
18720
18705
|
*/
|
|
18721
18706
|
var SAFE_FOR_TEMPLATES = false;
|
|
18722
|
-
|
|
18723
18707
|
/* Output should be safe even for XML used within HTML and alike.
|
|
18724
18708
|
* This means, DOMPurify removes comments when containing risky content.
|
|
18725
18709
|
*/
|
|
18726
18710
|
var SAFE_FOR_XML = true;
|
|
18727
|
-
|
|
18728
18711
|
/* Decide if document with <html>... should be returned */
|
|
18729
18712
|
var WHOLE_DOCUMENT = false;
|
|
18730
|
-
|
|
18731
18713
|
/* Track whether config is already set on this instance of DOMPurify. */
|
|
18732
18714
|
var SET_CONFIG = false;
|
|
18733
|
-
|
|
18734
18715
|
/* Decide if all elements (e.g. style, script) must be children of
|
|
18735
18716
|
* document.body. By default, browsers might move them to document.head */
|
|
18736
18717
|
var FORCE_BODY = false;
|
|
18737
|
-
|
|
18738
18718
|
/* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
|
|
18739
18719
|
* string (or a TrustedHTML object if Trusted Types are supported).
|
|
18740
18720
|
* If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
|
|
18741
18721
|
*/
|
|
18742
18722
|
var RETURN_DOM = false;
|
|
18743
|
-
|
|
18744
18723
|
/* Decide if a DOM `DocumentFragment` should be returned, instead of a html
|
|
18745
18724
|
* string (or a TrustedHTML object if Trusted Types are supported) */
|
|
18746
18725
|
var RETURN_DOM_FRAGMENT = false;
|
|
18747
|
-
|
|
18748
18726
|
/* Try to return a Trusted Type object instead of a string, return a string in
|
|
18749
18727
|
* case Trusted Types are not supported */
|
|
18750
18728
|
var RETURN_TRUSTED_TYPE = false;
|
|
18751
|
-
|
|
18752
18729
|
/* Output should be free from DOM clobbering attacks?
|
|
18753
18730
|
* This sanitizes markups named with colliding, clobberable built-in DOM APIs.
|
|
18754
18731
|
*/
|
|
18755
18732
|
var SANITIZE_DOM = true;
|
|
18756
|
-
|
|
18757
18733
|
/* Achieve full DOM Clobbering protection by isolating the namespace of named
|
|
18758
18734
|
* properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
|
|
18759
18735
|
*
|
|
@@ -18769,25 +18745,19 @@
|
|
|
18769
18745
|
*/
|
|
18770
18746
|
var SANITIZE_NAMED_PROPS = false;
|
|
18771
18747
|
var SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
|
|
18772
|
-
|
|
18773
18748
|
/* Keep element content when removing element? */
|
|
18774
18749
|
var KEEP_CONTENT = true;
|
|
18775
|
-
|
|
18776
18750
|
/* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
|
|
18777
18751
|
* of importing it into a new Document and returning a sanitized copy */
|
|
18778
18752
|
var IN_PLACE = false;
|
|
18779
|
-
|
|
18780
18753
|
/* Allow usage of profiles like html, svg and mathMl */
|
|
18781
18754
|
var USE_PROFILES = {};
|
|
18782
|
-
|
|
18783
18755
|
/* Tags to ignore content of when KEEP_CONTENT is true */
|
|
18784
18756
|
var FORBID_CONTENTS = null;
|
|
18785
18757
|
var DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
|
|
18786
|
-
|
|
18787
18758
|
/* Tags that are safe for data: URIs */
|
|
18788
18759
|
var DATA_URI_TAGS = null;
|
|
18789
18760
|
var DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
|
18790
|
-
|
|
18791
18761
|
/* Attributes safe for values like "javascript:" */
|
|
18792
18762
|
var URI_SAFE_ATTRIBUTES = null;
|
|
18793
18763
|
var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
|
|
@@ -18797,32 +18767,33 @@
|
|
|
18797
18767
|
/* Document namespace */
|
|
18798
18768
|
var NAMESPACE = HTML_NAMESPACE;
|
|
18799
18769
|
var IS_EMPTY_INPUT = false;
|
|
18800
|
-
|
|
18801
18770
|
/* Allowed XHTML+XML namespaces */
|
|
18802
18771
|
var ALLOWED_NAMESPACES = null;
|
|
18803
18772
|
var DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
|
18804
|
-
|
|
18773
|
+
var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
18774
|
+
var HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);
|
|
18775
|
+
// Certain elements are allowed in both SVG and HTML
|
|
18776
|
+
// namespace. We need to specify them explicitly
|
|
18777
|
+
// so that they don't get erroneously deleted from
|
|
18778
|
+
// HTML namespace.
|
|
18779
|
+
var COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
|
|
18805
18780
|
/* Parsing of strict XHTML documents */
|
|
18806
18781
|
var PARSER_MEDIA_TYPE = null;
|
|
18807
18782
|
var SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
|
|
18808
18783
|
var DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
|
|
18809
18784
|
var transformCaseFunc = null;
|
|
18810
|
-
|
|
18811
18785
|
/* Keep a reference to config to pass to hooks */
|
|
18812
18786
|
var CONFIG = null;
|
|
18813
|
-
|
|
18814
18787
|
/* Ideally, do not touch anything below this line */
|
|
18815
18788
|
/* ______________________________________________ */
|
|
18816
|
-
|
|
18817
18789
|
var formElement = document.createElement('form');
|
|
18818
18790
|
var isRegexOrFunction = function isRegexOrFunction(testValue) {
|
|
18819
18791
|
return testValue instanceof RegExp || testValue instanceof Function;
|
|
18820
18792
|
};
|
|
18821
|
-
|
|
18822
18793
|
/**
|
|
18823
18794
|
* _parseConfig
|
|
18824
18795
|
*
|
|
18825
|
-
* @param
|
|
18796
|
+
* @param cfg optional config literal
|
|
18826
18797
|
*/
|
|
18827
18798
|
// eslint-disable-next-line complexity
|
|
18828
18799
|
var _parseConfig = function _parseConfig() {
|
|
@@ -18830,39 +18801,23 @@
|
|
|
18830
18801
|
if (CONFIG && CONFIG === cfg) {
|
|
18831
18802
|
return;
|
|
18832
18803
|
}
|
|
18833
|
-
|
|
18834
18804
|
/* Shield configuration object from tampering */
|
|
18835
18805
|
if (!cfg || typeof cfg !== 'object') {
|
|
18836
18806
|
cfg = {};
|
|
18837
18807
|
}
|
|
18838
|
-
|
|
18839
18808
|
/* Shield configuration object from prototype pollution */
|
|
18840
18809
|
cfg = clone(cfg);
|
|
18841
18810
|
PARSER_MEDIA_TYPE =
|
|
18842
18811
|
// eslint-disable-next-line unicorn/prefer-includes
|
|
18843
18812
|
SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
|
|
18844
|
-
|
|
18845
18813
|
// HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
|
|
18846
18814
|
transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
|
|
18847
|
-
|
|
18848
18815
|
/* Set configuration parameters */
|
|
18849
18816
|
ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
|
|
18850
18817
|
ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
|
|
18851
18818
|
ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
|
|
18852
|
-
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),
|
|
18853
|
-
|
|
18854
|
-
cfg.ADD_URI_SAFE_ATTR,
|
|
18855
|
-
// eslint-disable-line indent
|
|
18856
|
-
transformCaseFunc // eslint-disable-line indent
|
|
18857
|
-
) // eslint-disable-line indent
|
|
18858
|
-
: DEFAULT_URI_SAFE_ATTRIBUTES;
|
|
18859
|
-
DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS),
|
|
18860
|
-
// eslint-disable-line indent
|
|
18861
|
-
cfg.ADD_DATA_URI_TAGS,
|
|
18862
|
-
// eslint-disable-line indent
|
|
18863
|
-
transformCaseFunc // eslint-disable-line indent
|
|
18864
|
-
) // eslint-disable-line indent
|
|
18865
|
-
: DEFAULT_DATA_URI_TAGS;
|
|
18819
|
+
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
|
|
18820
|
+
DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
|
|
18866
18821
|
FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
|
|
18867
18822
|
FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
|
|
18868
18823
|
FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
|
|
@@ -18884,6 +18839,8 @@
|
|
|
18884
18839
|
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
|
18885
18840
|
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
|
|
18886
18841
|
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
|
|
18842
|
+
MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
|
|
18843
|
+
HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
|
|
18887
18844
|
CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
|
|
18888
18845
|
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
|
|
18889
18846
|
CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
|
|
@@ -18900,7 +18857,6 @@
|
|
|
18900
18857
|
if (RETURN_DOM_FRAGMENT) {
|
|
18901
18858
|
RETURN_DOM = true;
|
|
18902
18859
|
}
|
|
18903
|
-
|
|
18904
18860
|
/* Parse profile info */
|
|
18905
18861
|
if (USE_PROFILES) {
|
|
18906
18862
|
ALLOWED_TAGS = addToSet({}, text);
|
|
@@ -18925,7 +18881,6 @@
|
|
|
18925
18881
|
addToSet(ALLOWED_ATTR, xml);
|
|
18926
18882
|
}
|
|
18927
18883
|
}
|
|
18928
|
-
|
|
18929
18884
|
/* Merge configuration parameters */
|
|
18930
18885
|
if (cfg.ADD_TAGS) {
|
|
18931
18886
|
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
|
@@ -18948,17 +18903,14 @@
|
|
|
18948
18903
|
}
|
|
18949
18904
|
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
|
|
18950
18905
|
}
|
|
18951
|
-
|
|
18952
18906
|
/* Add #text in case KEEP_CONTENT is set to true */
|
|
18953
18907
|
if (KEEP_CONTENT) {
|
|
18954
18908
|
ALLOWED_TAGS['#text'] = true;
|
|
18955
18909
|
}
|
|
18956
|
-
|
|
18957
18910
|
/* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
|
|
18958
18911
|
if (WHOLE_DOCUMENT) {
|
|
18959
18912
|
addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
|
|
18960
18913
|
}
|
|
18961
|
-
|
|
18962
18914
|
/* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
|
|
18963
18915
|
if (ALLOWED_TAGS.table) {
|
|
18964
18916
|
addToSet(ALLOWED_TAGS, ['tbody']);
|
|
@@ -18971,10 +18923,8 @@
|
|
|
18971
18923
|
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
|
|
18972
18924
|
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
18973
18925
|
}
|
|
18974
|
-
|
|
18975
18926
|
// Overwrite existing TrustedTypes policy.
|
|
18976
18927
|
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
|
18977
|
-
|
|
18978
18928
|
// Sign local variables required by `sanitize`.
|
|
18979
18929
|
emptyHTML = trustedTypesPolicy.createHTML('');
|
|
18980
18930
|
} else {
|
|
@@ -18982,13 +18932,11 @@
|
|
|
18982
18932
|
if (trustedTypesPolicy === undefined) {
|
|
18983
18933
|
trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
|
18984
18934
|
}
|
|
18985
|
-
|
|
18986
18935
|
// If creating the internal policy succeeded sign internal variables.
|
|
18987
18936
|
if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
|
|
18988
18937
|
emptyHTML = trustedTypesPolicy.createHTML('');
|
|
18989
18938
|
}
|
|
18990
18939
|
}
|
|
18991
|
-
|
|
18992
18940
|
// Prevent further manipulation of configuration.
|
|
18993
18941
|
// Not available in IE8, Safari 5, etc.
|
|
18994
18942
|
if (freeze) {
|
|
@@ -18996,30 +18944,19 @@
|
|
|
18996
18944
|
}
|
|
18997
18945
|
CONFIG = cfg;
|
|
18998
18946
|
};
|
|
18999
|
-
var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
19000
|
-
var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'annotation-xml']);
|
|
19001
|
-
|
|
19002
|
-
// Certain elements are allowed in both SVG and HTML
|
|
19003
|
-
// namespace. We need to specify them explicitly
|
|
19004
|
-
// so that they don't get erroneously deleted from
|
|
19005
|
-
// HTML namespace.
|
|
19006
|
-
var COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
|
|
19007
|
-
|
|
19008
18947
|
/* Keep track of all possible SVG and MathML tags
|
|
19009
18948
|
* so that we can perform the namespace checks
|
|
19010
18949
|
* correctly. */
|
|
19011
18950
|
var ALL_SVG_TAGS = addToSet({}, [].concat(svg$1, svgFilters, svgDisallowed));
|
|
19012
18951
|
var ALL_MATHML_TAGS = addToSet({}, [].concat(mathMl$1, mathMlDisallowed));
|
|
19013
|
-
|
|
19014
18952
|
/**
|
|
19015
|
-
* @param
|
|
19016
|
-
* @returns
|
|
18953
|
+
* @param element a DOM element whose namespace is being checked
|
|
18954
|
+
* @returns Return false if the element has a
|
|
19017
18955
|
* namespace that a spec-compliant parser would never
|
|
19018
18956
|
* return. Return true otherwise.
|
|
19019
18957
|
*/
|
|
19020
18958
|
var _checkValidNamespace = function _checkValidNamespace(element) {
|
|
19021
18959
|
var parent = getParentNode(element);
|
|
19022
|
-
|
|
19023
18960
|
// In JSDOM, if we're inside shadow DOM, then parentNode
|
|
19024
18961
|
// can be null. We just simulate parent in this case.
|
|
19025
18962
|
if (!parent || !parent.tagName) {
|
|
@@ -19040,14 +18977,12 @@
|
|
|
19040
18977
|
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
19041
18978
|
return tagName === 'svg';
|
|
19042
18979
|
}
|
|
19043
|
-
|
|
19044
18980
|
// The only way to switch from MathML to SVG is via`
|
|
19045
18981
|
// svg if parent is either <annotation-xml> or MathML
|
|
19046
18982
|
// text integration points.
|
|
19047
18983
|
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
19048
18984
|
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
19049
18985
|
}
|
|
19050
|
-
|
|
19051
18986
|
// We only allow elements that are defined in SVG
|
|
19052
18987
|
// spec. All others are disallowed in SVG namespace.
|
|
19053
18988
|
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
@@ -19059,13 +18994,11 @@
|
|
|
19059
18994
|
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
19060
18995
|
return tagName === 'math';
|
|
19061
18996
|
}
|
|
19062
|
-
|
|
19063
18997
|
// The only way to switch from SVG to MathML is via
|
|
19064
18998
|
// <math> and HTML integration points
|
|
19065
18999
|
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
19066
19000
|
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
|
19067
19001
|
}
|
|
19068
|
-
|
|
19069
19002
|
// We only allow elements that are defined in MathML
|
|
19070
19003
|
// spec. All others are disallowed in MathML namespace.
|
|
19071
19004
|
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
@@ -19080,28 +19013,24 @@
|
|
|
19080
19013
|
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
19081
19014
|
return false;
|
|
19082
19015
|
}
|
|
19083
|
-
|
|
19084
19016
|
// We disallow tags that are specific for MathML
|
|
19085
19017
|
// or SVG and should never appear in HTML namespace
|
|
19086
19018
|
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
19087
19019
|
}
|
|
19088
|
-
|
|
19089
19020
|
// For XHTML and XML documents that support custom namespaces
|
|
19090
19021
|
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
|
|
19091
19022
|
return true;
|
|
19092
19023
|
}
|
|
19093
|
-
|
|
19094
19024
|
// The code should never reach this place (this means
|
|
19095
19025
|
// that the element somehow got namespace that is not
|
|
19096
19026
|
// HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
|
|
19097
19027
|
// Return false just in case.
|
|
19098
19028
|
return false;
|
|
19099
19029
|
};
|
|
19100
|
-
|
|
19101
19030
|
/**
|
|
19102
19031
|
* _forceRemove
|
|
19103
19032
|
*
|
|
19104
|
-
* @param
|
|
19033
|
+
* @param node a DOM node
|
|
19105
19034
|
*/
|
|
19106
19035
|
var _forceRemove = function _forceRemove(node) {
|
|
19107
19036
|
arrayPush(DOMPurify.removed, {
|
|
@@ -19109,51 +19038,48 @@
|
|
|
19109
19038
|
});
|
|
19110
19039
|
try {
|
|
19111
19040
|
// eslint-disable-next-line unicorn/prefer-dom-node-remove
|
|
19112
|
-
node.
|
|
19041
|
+
getParentNode(node).removeChild(node);
|
|
19113
19042
|
} catch (_) {
|
|
19114
|
-
|
|
19043
|
+
remove(node);
|
|
19115
19044
|
}
|
|
19116
19045
|
};
|
|
19117
|
-
|
|
19118
19046
|
/**
|
|
19119
19047
|
* _removeAttribute
|
|
19120
19048
|
*
|
|
19121
|
-
* @param
|
|
19122
|
-
* @param
|
|
19049
|
+
* @param name an Attribute name
|
|
19050
|
+
* @param element a DOM node
|
|
19123
19051
|
*/
|
|
19124
|
-
var _removeAttribute = function _removeAttribute(name,
|
|
19052
|
+
var _removeAttribute = function _removeAttribute(name, element) {
|
|
19125
19053
|
try {
|
|
19126
19054
|
arrayPush(DOMPurify.removed, {
|
|
19127
|
-
attribute:
|
|
19128
|
-
from:
|
|
19055
|
+
attribute: element.getAttributeNode(name),
|
|
19056
|
+
from: element
|
|
19129
19057
|
});
|
|
19130
19058
|
} catch (_) {
|
|
19131
19059
|
arrayPush(DOMPurify.removed, {
|
|
19132
19060
|
attribute: null,
|
|
19133
|
-
from:
|
|
19061
|
+
from: element
|
|
19134
19062
|
});
|
|
19135
19063
|
}
|
|
19136
|
-
|
|
19137
|
-
|
|
19138
|
-
|
|
19139
|
-
if (name === 'is' && !ALLOWED_ATTR[name]) {
|
|
19064
|
+
element.removeAttribute(name);
|
|
19065
|
+
// We void attribute values for unremovable "is" attributes
|
|
19066
|
+
if (name === 'is') {
|
|
19140
19067
|
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
|
|
19141
19068
|
try {
|
|
19142
|
-
_forceRemove(
|
|
19069
|
+
_forceRemove(element);
|
|
19143
19070
|
} catch (_) {}
|
|
19144
19071
|
} else {
|
|
19145
19072
|
try {
|
|
19146
|
-
|
|
19073
|
+
element.setAttribute(name, '');
|
|
19147
19074
|
} catch (_) {}
|
|
19148
19075
|
}
|
|
19149
19076
|
}
|
|
19150
19077
|
};
|
|
19151
|
-
|
|
19152
19078
|
/**
|
|
19153
19079
|
* _initDocument
|
|
19154
19080
|
*
|
|
19155
|
-
* @param
|
|
19156
|
-
* @return
|
|
19081
|
+
* @param dirty - a string of dirty markup
|
|
19082
|
+
* @return a DOM, filled with the dirty markup
|
|
19157
19083
|
*/
|
|
19158
19084
|
var _initDocument = function _initDocument(dirty) {
|
|
19159
19085
|
/* Create a HTML document */
|
|
@@ -19180,7 +19106,6 @@
|
|
|
19180
19106
|
doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
|
|
19181
19107
|
} catch (_) {}
|
|
19182
19108
|
}
|
|
19183
|
-
|
|
19184
19109
|
/* Use createHTMLDocument in case DOMParser is not available */
|
|
19185
19110
|
if (!doc || !doc.documentElement) {
|
|
19186
19111
|
doc = implementation.createDocument(NAMESPACE, 'template', null);
|
|
@@ -19194,112 +19119,86 @@
|
|
|
19194
19119
|
if (dirty && leadingWhitespace) {
|
|
19195
19120
|
body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
|
|
19196
19121
|
}
|
|
19197
|
-
|
|
19198
19122
|
/* Work on whole document or just its body */
|
|
19199
19123
|
if (NAMESPACE === HTML_NAMESPACE) {
|
|
19200
19124
|
return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
|
|
19201
19125
|
}
|
|
19202
19126
|
return WHOLE_DOCUMENT ? doc.documentElement : body;
|
|
19203
19127
|
};
|
|
19204
|
-
|
|
19205
19128
|
/**
|
|
19206
19129
|
* Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
|
|
19207
19130
|
*
|
|
19208
|
-
* @param
|
|
19209
|
-
* @return
|
|
19131
|
+
* @param root The root element or node to start traversing on.
|
|
19132
|
+
* @return The created NodeIterator
|
|
19210
19133
|
*/
|
|
19211
19134
|
var _createNodeIterator = function _createNodeIterator(root) {
|
|
19212
19135
|
return createNodeIterator.call(root.ownerDocument || root, root,
|
|
19213
19136
|
// eslint-disable-next-line no-bitwise
|
|
19214
19137
|
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
|
|
19215
19138
|
};
|
|
19216
|
-
|
|
19217
19139
|
/**
|
|
19218
19140
|
* _isClobbered
|
|
19219
19141
|
*
|
|
19220
|
-
* @param
|
|
19221
|
-
* @return
|
|
19142
|
+
* @param element element to check for clobbering attacks
|
|
19143
|
+
* @return true if clobbered, false if safe
|
|
19222
19144
|
*/
|
|
19223
|
-
var _isClobbered = function _isClobbered(
|
|
19224
|
-
return
|
|
19145
|
+
var _isClobbered = function _isClobbered(element) {
|
|
19146
|
+
return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');
|
|
19225
19147
|
};
|
|
19226
|
-
|
|
19227
19148
|
/**
|
|
19228
19149
|
* Checks whether the given object is a DOM node.
|
|
19229
19150
|
*
|
|
19230
|
-
* @param
|
|
19231
|
-
* @return
|
|
19151
|
+
* @param value object to check whether it's a DOM node
|
|
19152
|
+
* @return true is object is a DOM node
|
|
19232
19153
|
*/
|
|
19233
|
-
var _isNode = function _isNode(
|
|
19234
|
-
return typeof Node === 'function' &&
|
|
19154
|
+
var _isNode = function _isNode(value) {
|
|
19155
|
+
return typeof Node === 'function' && value instanceof Node;
|
|
19235
19156
|
};
|
|
19236
|
-
|
|
19237
|
-
|
|
19238
|
-
* _executeHook
|
|
19239
|
-
* Execute user configurable hooks
|
|
19240
|
-
*
|
|
19241
|
-
* @param {String} entryPoint Name of the hook's entry point
|
|
19242
|
-
* @param {Node} currentNode node to work on with the hook
|
|
19243
|
-
* @param {Object} data additional hook parameters
|
|
19244
|
-
*/
|
|
19245
|
-
var _executeHook = function _executeHook(entryPoint, currentNode, data) {
|
|
19246
|
-
if (!hooks[entryPoint]) {
|
|
19247
|
-
return;
|
|
19248
|
-
}
|
|
19249
|
-
arrayForEach(hooks[entryPoint], function (hook) {
|
|
19157
|
+
function _executeHooks(hooks, currentNode, data) {
|
|
19158
|
+
arrayForEach(hooks, function (hook) {
|
|
19250
19159
|
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
19251
19160
|
});
|
|
19252
|
-
}
|
|
19253
|
-
|
|
19161
|
+
}
|
|
19254
19162
|
/**
|
|
19255
19163
|
* _sanitizeElements
|
|
19256
19164
|
*
|
|
19257
19165
|
* @protect nodeName
|
|
19258
19166
|
* @protect textContent
|
|
19259
19167
|
* @protect removeChild
|
|
19260
|
-
*
|
|
19261
|
-
* @
|
|
19262
|
-
* @return {Boolean} true if node was killed, false if left alive
|
|
19168
|
+
* @param currentNode to check for permission to exist
|
|
19169
|
+
* @return true if node was killed, false if left alive
|
|
19263
19170
|
*/
|
|
19264
19171
|
var _sanitizeElements = function _sanitizeElements(currentNode) {
|
|
19265
19172
|
var content = null;
|
|
19266
|
-
|
|
19267
19173
|
/* Execute a hook if present */
|
|
19268
|
-
|
|
19269
|
-
|
|
19174
|
+
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
|
19270
19175
|
/* Check if element is clobbered or can clobber */
|
|
19271
19176
|
if (_isClobbered(currentNode)) {
|
|
19272
19177
|
_forceRemove(currentNode);
|
|
19273
19178
|
return true;
|
|
19274
19179
|
}
|
|
19275
|
-
|
|
19276
19180
|
/* Now let's check the element's type and name */
|
|
19277
19181
|
var tagName = transformCaseFunc(currentNode.nodeName);
|
|
19278
|
-
|
|
19279
19182
|
/* Execute a hook if present */
|
|
19280
|
-
|
|
19183
|
+
_executeHooks(hooks.uponSanitizeElement, currentNode, {
|
|
19281
19184
|
tagName: tagName,
|
|
19282
19185
|
allowedTags: ALLOWED_TAGS
|
|
19283
19186
|
});
|
|
19284
|
-
|
|
19285
19187
|
/* Detect mXSS attempts abusing namespace confusion */
|
|
19286
19188
|
if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
|
|
19287
19189
|
_forceRemove(currentNode);
|
|
19288
19190
|
return true;
|
|
19289
19191
|
}
|
|
19290
|
-
|
|
19291
|
-
/* Remove any ocurrence of processing instructions */
|
|
19192
|
+
/* Remove any occurrence of processing instructions */
|
|
19292
19193
|
if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
|
|
19293
19194
|
_forceRemove(currentNode);
|
|
19294
19195
|
return true;
|
|
19295
19196
|
}
|
|
19296
|
-
|
|
19297
19197
|
/* Remove any kind of possibly harmful comments */
|
|
19298
19198
|
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
|
|
19299
19199
|
_forceRemove(currentNode);
|
|
19300
19200
|
return true;
|
|
19301
19201
|
}
|
|
19302
|
-
|
|
19303
19202
|
/* Remove element if anything forbids its presence */
|
|
19304
19203
|
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
19305
19204
|
/* Check if we have a custom element to handle */
|
|
@@ -19311,7 +19210,6 @@
|
|
|
19311
19210
|
return false;
|
|
19312
19211
|
}
|
|
19313
19212
|
}
|
|
19314
|
-
|
|
19315
19213
|
/* Keep content except for bad-listed elements */
|
|
19316
19214
|
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
19317
19215
|
var parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
|
@@ -19328,19 +19226,16 @@
|
|
|
19328
19226
|
_forceRemove(currentNode);
|
|
19329
19227
|
return true;
|
|
19330
19228
|
}
|
|
19331
|
-
|
|
19332
19229
|
/* Check whether element has a valid namespace */
|
|
19333
19230
|
if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
|
|
19334
19231
|
_forceRemove(currentNode);
|
|
19335
19232
|
return true;
|
|
19336
19233
|
}
|
|
19337
|
-
|
|
19338
19234
|
/* Make sure that older browsers don't get fallback-tag mXSS */
|
|
19339
19235
|
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
|
|
19340
19236
|
_forceRemove(currentNode);
|
|
19341
19237
|
return true;
|
|
19342
19238
|
}
|
|
19343
|
-
|
|
19344
19239
|
/* Sanitize element content to be template-safe */
|
|
19345
19240
|
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
|
|
19346
19241
|
/* Get the element's text content */
|
|
@@ -19355,19 +19250,17 @@
|
|
|
19355
19250
|
currentNode.textContent = content;
|
|
19356
19251
|
}
|
|
19357
19252
|
}
|
|
19358
|
-
|
|
19359
19253
|
/* Execute a hook if present */
|
|
19360
|
-
|
|
19254
|
+
_executeHooks(hooks.afterSanitizeElements, currentNode, null);
|
|
19361
19255
|
return false;
|
|
19362
19256
|
};
|
|
19363
|
-
|
|
19364
19257
|
/**
|
|
19365
19258
|
* _isValidAttribute
|
|
19366
19259
|
*
|
|
19367
|
-
* @param
|
|
19368
|
-
* @param
|
|
19369
|
-
* @param
|
|
19370
|
-
* @return
|
|
19260
|
+
* @param lcTag Lowercase tag name of containing element.
|
|
19261
|
+
* @param lcName Lowercase attribute name.
|
|
19262
|
+
* @param value Attribute value.
|
|
19263
|
+
* @return Returns true if `value` is valid, otherwise false.
|
|
19371
19264
|
*/
|
|
19372
19265
|
// eslint-disable-next-line complexity
|
|
19373
19266
|
var _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
|
|
@@ -19375,7 +19268,6 @@
|
|
|
19375
19268
|
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
|
|
19376
19269
|
return false;
|
|
19377
19270
|
}
|
|
19378
|
-
|
|
19379
19271
|
/* Allow valid data-* attributes: At least one character after "-"
|
|
19380
19272
|
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
|
19381
19273
|
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
|
@@ -19397,19 +19289,17 @@
|
|
|
19397
19289
|
}
|
|
19398
19290
|
return true;
|
|
19399
19291
|
};
|
|
19400
|
-
|
|
19401
19292
|
/**
|
|
19402
19293
|
* _isBasicCustomElement
|
|
19403
19294
|
* checks if at least one dash is included in tagName, and it's not the first char
|
|
19404
19295
|
* for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
|
|
19405
19296
|
*
|
|
19406
|
-
* @param
|
|
19407
|
-
* @returns
|
|
19297
|
+
* @param tagName name of the tag of the node to sanitize
|
|
19298
|
+
* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
|
|
19408
19299
|
*/
|
|
19409
19300
|
var _isBasicCustomElement = function _isBasicCustomElement(tagName) {
|
|
19410
19301
|
return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
|
|
19411
19302
|
};
|
|
19412
|
-
|
|
19413
19303
|
/**
|
|
19414
19304
|
* _sanitizeAttributes
|
|
19415
19305
|
*
|
|
@@ -19418,25 +19308,24 @@
|
|
|
19418
19308
|
* @protect removeAttribute
|
|
19419
19309
|
* @protect setAttribute
|
|
19420
19310
|
*
|
|
19421
|
-
* @param
|
|
19311
|
+
* @param currentNode to sanitize
|
|
19422
19312
|
*/
|
|
19423
19313
|
var _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
|
|
19424
19314
|
/* Execute a hook if present */
|
|
19425
|
-
|
|
19315
|
+
_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
|
|
19426
19316
|
var attributes = currentNode.attributes;
|
|
19427
|
-
|
|
19428
19317
|
/* Check if we have attributes; if not we might have a text node */
|
|
19429
|
-
if (!attributes) {
|
|
19318
|
+
if (!attributes || _isClobbered(currentNode)) {
|
|
19430
19319
|
return;
|
|
19431
19320
|
}
|
|
19432
19321
|
var hookEvent = {
|
|
19433
19322
|
attrName: '',
|
|
19434
19323
|
attrValue: '',
|
|
19435
19324
|
keepAttr: true,
|
|
19436
|
-
allowedAttributes: ALLOWED_ATTR
|
|
19325
|
+
allowedAttributes: ALLOWED_ATTR,
|
|
19326
|
+
forceKeepAttr: undefined
|
|
19437
19327
|
};
|
|
19438
19328
|
var l = attributes.length;
|
|
19439
|
-
|
|
19440
19329
|
/* Go backwards over all attributes; safely remove bad ones */
|
|
19441
19330
|
var _loop = function _loop() {
|
|
19442
19331
|
var attr = attributes[l];
|
|
@@ -19445,63 +19334,53 @@
|
|
|
19445
19334
|
attrValue = attr.value;
|
|
19446
19335
|
var lcName = transformCaseFunc(name);
|
|
19447
19336
|
var value = name === 'value' ? attrValue : stringTrim(attrValue);
|
|
19448
|
-
|
|
19449
19337
|
/* Execute a hook if present */
|
|
19450
19338
|
hookEvent.attrName = lcName;
|
|
19451
19339
|
hookEvent.attrValue = value;
|
|
19452
19340
|
hookEvent.keepAttr = true;
|
|
19453
19341
|
hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
|
|
19454
|
-
|
|
19342
|
+
_executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
|
|
19455
19343
|
value = hookEvent.attrValue;
|
|
19344
|
+
/* Full DOM Clobbering protection via namespace isolation,
|
|
19345
|
+
* Prefix id and name attributes with `user-content-`
|
|
19346
|
+
*/
|
|
19347
|
+
if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
|
|
19348
|
+
// Remove the attribute with this value
|
|
19349
|
+
_removeAttribute(name, currentNode);
|
|
19350
|
+
// Prefix the value and later re-create the attribute with the sanitized value
|
|
19351
|
+
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
19352
|
+
}
|
|
19353
|
+
/* Work around a security issue with comments inside attributes */
|
|
19354
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
|
19355
|
+
_removeAttribute(name, currentNode);
|
|
19356
|
+
return 0; // continue
|
|
19357
|
+
}
|
|
19456
19358
|
/* Did the hooks approve of the attribute? */
|
|
19457
19359
|
if (hookEvent.forceKeepAttr) {
|
|
19458
19360
|
return 0; // continue
|
|
19459
19361
|
}
|
|
19460
|
-
|
|
19461
19362
|
/* Remove attribute */
|
|
19462
19363
|
_removeAttribute(name, currentNode);
|
|
19463
|
-
|
|
19464
19364
|
/* Did the hooks approve of the attribute? */
|
|
19465
19365
|
if (!hookEvent.keepAttr) {
|
|
19466
19366
|
return 0; // continue
|
|
19467
19367
|
}
|
|
19468
|
-
|
|
19469
19368
|
/* Work around a security issue in jQuery 3.0 */
|
|
19470
19369
|
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
|
|
19471
19370
|
_removeAttribute(name, currentNode);
|
|
19472
19371
|
return 0; // continue
|
|
19473
19372
|
}
|
|
19474
|
-
|
|
19475
|
-
/* Work around a security issue with comments inside attributes */
|
|
19476
|
-
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
|
19477
|
-
_removeAttribute(name, currentNode);
|
|
19478
|
-
return 0; // continue
|
|
19479
|
-
}
|
|
19480
|
-
|
|
19481
19373
|
/* Sanitize attribute content to be template-safe */
|
|
19482
19374
|
if (SAFE_FOR_TEMPLATES) {
|
|
19483
19375
|
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], function (expr) {
|
|
19484
19376
|
value = stringReplace(value, expr, ' ');
|
|
19485
19377
|
});
|
|
19486
19378
|
}
|
|
19487
|
-
|
|
19488
19379
|
/* Is `value` valid for this attribute? */
|
|
19489
19380
|
var lcTag = transformCaseFunc(currentNode.nodeName);
|
|
19490
19381
|
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
19491
19382
|
return 0; // continue
|
|
19492
19383
|
}
|
|
19493
|
-
|
|
19494
|
-
/* Full DOM Clobbering protection via namespace isolation,
|
|
19495
|
-
* Prefix id and name attributes with `user-content-`
|
|
19496
|
-
*/
|
|
19497
|
-
if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
|
|
19498
|
-
// Remove the attribute with this value
|
|
19499
|
-
_removeAttribute(name, currentNode);
|
|
19500
|
-
|
|
19501
|
-
// Prefix the value and later re-create the attribute with the sanitized value
|
|
19502
|
-
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
19503
|
-
}
|
|
19504
|
-
|
|
19505
19384
|
/* Handle attributes that require Trusted Types */
|
|
19506
19385
|
if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
|
|
19507
19386
|
if (namespaceURI) ;else {
|
|
@@ -19519,7 +19398,6 @@
|
|
|
19519
19398
|
}
|
|
19520
19399
|
}
|
|
19521
19400
|
}
|
|
19522
|
-
|
|
19523
19401
|
/* Handle invalid data-* attribute set by try-catching it */
|
|
19524
19402
|
try {
|
|
19525
19403
|
if (namespaceURI) {
|
|
@@ -19540,51 +19418,34 @@
|
|
|
19540
19418
|
_ret = _loop();
|
|
19541
19419
|
if (_ret === 0) continue;
|
|
19542
19420
|
}
|
|
19543
|
-
|
|
19544
19421
|
/* Execute a hook if present */
|
|
19545
|
-
|
|
19422
|
+
_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
|
|
19546
19423
|
};
|
|
19547
|
-
|
|
19548
19424
|
/**
|
|
19549
19425
|
* _sanitizeShadowDOM
|
|
19550
19426
|
*
|
|
19551
|
-
* @param
|
|
19427
|
+
* @param fragment to iterate over recursively
|
|
19552
19428
|
*/
|
|
19553
19429
|
var _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
|
|
19554
19430
|
var shadowNode = null;
|
|
19555
19431
|
var shadowIterator = _createNodeIterator(fragment);
|
|
19556
|
-
|
|
19557
19432
|
/* Execute a hook if present */
|
|
19558
|
-
|
|
19433
|
+
_executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
|
|
19559
19434
|
while (shadowNode = shadowIterator.nextNode()) {
|
|
19560
19435
|
/* Execute a hook if present */
|
|
19561
|
-
|
|
19562
|
-
|
|
19436
|
+
_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
|
|
19563
19437
|
/* Sanitize tags and elements */
|
|
19564
|
-
|
|
19565
|
-
|
|
19566
|
-
|
|
19567
|
-
|
|
19438
|
+
_sanitizeElements(shadowNode);
|
|
19439
|
+
/* Check attributes next */
|
|
19440
|
+
_sanitizeAttributes(shadowNode);
|
|
19568
19441
|
/* Deep shadow DOM detected */
|
|
19569
19442
|
if (shadowNode.content instanceof DocumentFragment) {
|
|
19570
19443
|
_sanitizeShadowDOM(shadowNode.content);
|
|
19571
19444
|
}
|
|
19572
|
-
|
|
19573
|
-
/* Check attributes, sanitize if necessary */
|
|
19574
|
-
_sanitizeAttributes(shadowNode);
|
|
19575
19445
|
}
|
|
19576
|
-
|
|
19577
19446
|
/* Execute a hook if present */
|
|
19578
|
-
|
|
19447
|
+
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
|
19579
19448
|
};
|
|
19580
|
-
|
|
19581
|
-
/**
|
|
19582
|
-
* Sanitize
|
|
19583
|
-
* Public method providing core sanitation functionality
|
|
19584
|
-
*
|
|
19585
|
-
* @param {String|Node} dirty string or DOM node
|
|
19586
|
-
* @param {Object} cfg object
|
|
19587
|
-
*/
|
|
19588
19449
|
// eslint-disable-next-line complexity
|
|
19589
19450
|
DOMPurify.sanitize = function (dirty) {
|
|
19590
19451
|
var cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -19599,7 +19460,6 @@
|
|
|
19599
19460
|
if (IS_EMPTY_INPUT) {
|
|
19600
19461
|
dirty = '<!-->';
|
|
19601
19462
|
}
|
|
19602
|
-
|
|
19603
19463
|
/* Stringify, in case dirty is an object */
|
|
19604
19464
|
if (typeof dirty !== 'string' && !_isNode(dirty)) {
|
|
19605
19465
|
if (typeof dirty.toString === 'function') {
|
|
@@ -19611,20 +19471,16 @@
|
|
|
19611
19471
|
throw typeErrorCreate('toString is not a function');
|
|
19612
19472
|
}
|
|
19613
19473
|
}
|
|
19614
|
-
|
|
19615
19474
|
/* Return dirty HTML if DOMPurify cannot run */
|
|
19616
19475
|
if (!DOMPurify.isSupported) {
|
|
19617
19476
|
return dirty;
|
|
19618
19477
|
}
|
|
19619
|
-
|
|
19620
19478
|
/* Assign config vars */
|
|
19621
19479
|
if (!SET_CONFIG) {
|
|
19622
19480
|
_parseConfig(cfg);
|
|
19623
19481
|
}
|
|
19624
|
-
|
|
19625
19482
|
/* Clean up removed elements */
|
|
19626
19483
|
DOMPurify.removed = [];
|
|
19627
|
-
|
|
19628
19484
|
/* Check if dirty is correctly typed for IN_PLACE */
|
|
19629
19485
|
if (typeof dirty === 'string') {
|
|
19630
19486
|
IN_PLACE = false;
|
|
@@ -19658,45 +19514,34 @@
|
|
|
19658
19514
|
dirty.indexOf('<') === -1) {
|
|
19659
19515
|
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
|
19660
19516
|
}
|
|
19661
|
-
|
|
19662
19517
|
/* Initialize the document to work on */
|
|
19663
19518
|
body = _initDocument(dirty);
|
|
19664
|
-
|
|
19665
19519
|
/* Check we have a DOM node from the data */
|
|
19666
19520
|
if (!body) {
|
|
19667
19521
|
return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
|
|
19668
19522
|
}
|
|
19669
19523
|
}
|
|
19670
|
-
|
|
19671
19524
|
/* Remove first element node (ours) if FORCE_BODY is set */
|
|
19672
19525
|
if (body && FORCE_BODY) {
|
|
19673
19526
|
_forceRemove(body.firstChild);
|
|
19674
19527
|
}
|
|
19675
|
-
|
|
19676
19528
|
/* Get node iterator */
|
|
19677
19529
|
var nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
|
|
19678
|
-
|
|
19679
19530
|
/* Now start iterating over the created document */
|
|
19680
19531
|
while (currentNode = nodeIterator.nextNode()) {
|
|
19681
19532
|
/* Sanitize tags and elements */
|
|
19682
|
-
|
|
19683
|
-
|
|
19684
|
-
|
|
19685
|
-
|
|
19533
|
+
_sanitizeElements(currentNode);
|
|
19534
|
+
/* Check attributes next */
|
|
19535
|
+
_sanitizeAttributes(currentNode);
|
|
19686
19536
|
/* Shadow DOM detected, sanitize it */
|
|
19687
19537
|
if (currentNode.content instanceof DocumentFragment) {
|
|
19688
19538
|
_sanitizeShadowDOM(currentNode.content);
|
|
19689
19539
|
}
|
|
19690
|
-
|
|
19691
|
-
/* Check attributes, sanitize if necessary */
|
|
19692
|
-
_sanitizeAttributes(currentNode);
|
|
19693
19540
|
}
|
|
19694
|
-
|
|
19695
19541
|
/* If we sanitized `dirty` in-place, return it. */
|
|
19696
19542
|
if (IN_PLACE) {
|
|
19697
19543
|
return dirty;
|
|
19698
19544
|
}
|
|
19699
|
-
|
|
19700
19545
|
/* Return sanitized string or DOM */
|
|
19701
19546
|
if (RETURN_DOM) {
|
|
19702
19547
|
if (RETURN_DOM_FRAGMENT) {
|
|
@@ -19721,12 +19566,10 @@
|
|
|
19721
19566
|
return returnNode;
|
|
19722
19567
|
}
|
|
19723
19568
|
var serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
|
|
19724
|
-
|
|
19725
19569
|
/* Serialize doctype if allowed */
|
|
19726
19570
|
if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
|
|
19727
19571
|
serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
|
|
19728
19572
|
}
|
|
19729
|
-
|
|
19730
19573
|
/* Sanitize final string template-safe */
|
|
19731
19574
|
if (SAFE_FOR_TEMPLATES) {
|
|
19732
19575
|
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], function (expr) {
|
|
@@ -19735,39 +19578,15 @@
|
|
|
19735
19578
|
}
|
|
19736
19579
|
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
|
|
19737
19580
|
};
|
|
19738
|
-
|
|
19739
|
-
/**
|
|
19740
|
-
* Public method to set the configuration once
|
|
19741
|
-
* setConfig
|
|
19742
|
-
*
|
|
19743
|
-
* @param {Object} cfg configuration object
|
|
19744
|
-
*/
|
|
19745
19581
|
DOMPurify.setConfig = function () {
|
|
19746
19582
|
var cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
19747
19583
|
_parseConfig(cfg);
|
|
19748
19584
|
SET_CONFIG = true;
|
|
19749
19585
|
};
|
|
19750
|
-
|
|
19751
|
-
/**
|
|
19752
|
-
* Public method to remove the configuration
|
|
19753
|
-
* clearConfig
|
|
19754
|
-
*
|
|
19755
|
-
*/
|
|
19756
19586
|
DOMPurify.clearConfig = function () {
|
|
19757
19587
|
CONFIG = null;
|
|
19758
19588
|
SET_CONFIG = false;
|
|
19759
19589
|
};
|
|
19760
|
-
|
|
19761
|
-
/**
|
|
19762
|
-
* Public method to check if an attribute value is valid.
|
|
19763
|
-
* Uses last set config, if any. Otherwise, uses config defaults.
|
|
19764
|
-
* isValidAttribute
|
|
19765
|
-
*
|
|
19766
|
-
* @param {String} tag Tag name of containing element.
|
|
19767
|
-
* @param {String} attr Attribute name.
|
|
19768
|
-
* @param {String} value Attribute value.
|
|
19769
|
-
* @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.
|
|
19770
|
-
*/
|
|
19771
19590
|
DOMPurify.isValidAttribute = function (tag, attr, value) {
|
|
19772
19591
|
/* Initialize shared config vars if necessary. */
|
|
19773
19592
|
if (!CONFIG) {
|
|
@@ -19777,54 +19596,24 @@
|
|
|
19777
19596
|
var lcName = transformCaseFunc(attr);
|
|
19778
19597
|
return _isValidAttribute(lcTag, lcName, value);
|
|
19779
19598
|
};
|
|
19780
|
-
|
|
19781
|
-
/**
|
|
19782
|
-
* AddHook
|
|
19783
|
-
* Public method to add DOMPurify hooks
|
|
19784
|
-
*
|
|
19785
|
-
* @param {String} entryPoint entry point for the hook to add
|
|
19786
|
-
* @param {Function} hookFunction function to execute
|
|
19787
|
-
*/
|
|
19788
19599
|
DOMPurify.addHook = function (entryPoint, hookFunction) {
|
|
19789
19600
|
if (typeof hookFunction !== 'function') {
|
|
19790
19601
|
return;
|
|
19791
19602
|
}
|
|
19792
|
-
hooks[entryPoint] = hooks[entryPoint] || [];
|
|
19793
19603
|
arrayPush(hooks[entryPoint], hookFunction);
|
|
19794
19604
|
};
|
|
19795
|
-
|
|
19796
|
-
|
|
19797
|
-
|
|
19798
|
-
|
|
19799
|
-
* (pops it from the stack of hooks if more are present)
|
|
19800
|
-
*
|
|
19801
|
-
* @param {String} entryPoint entry point for the hook to remove
|
|
19802
|
-
* @return {Function} removed(popped) hook
|
|
19803
|
-
*/
|
|
19804
|
-
DOMPurify.removeHook = function (entryPoint) {
|
|
19805
|
-
if (hooks[entryPoint]) {
|
|
19806
|
-
return arrayPop(hooks[entryPoint]);
|
|
19605
|
+
DOMPurify.removeHook = function (entryPoint, hookFunction) {
|
|
19606
|
+
if (hookFunction !== undefined) {
|
|
19607
|
+
var index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
|
|
19608
|
+
return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
|
|
19807
19609
|
}
|
|
19610
|
+
return arrayPop(hooks[entryPoint]);
|
|
19808
19611
|
};
|
|
19809
|
-
|
|
19810
|
-
/**
|
|
19811
|
-
* RemoveHooks
|
|
19812
|
-
* Public method to remove all DOMPurify hooks at a given entryPoint
|
|
19813
|
-
*
|
|
19814
|
-
* @param {String} entryPoint entry point for the hooks to remove
|
|
19815
|
-
*/
|
|
19816
19612
|
DOMPurify.removeHooks = function (entryPoint) {
|
|
19817
|
-
|
|
19818
|
-
hooks[entryPoint] = [];
|
|
19819
|
-
}
|
|
19613
|
+
hooks[entryPoint] = [];
|
|
19820
19614
|
};
|
|
19821
|
-
|
|
19822
|
-
/**
|
|
19823
|
-
* RemoveAllHooks
|
|
19824
|
-
* Public method to remove all DOMPurify hooks
|
|
19825
|
-
*/
|
|
19826
19615
|
DOMPurify.removeAllHooks = function () {
|
|
19827
|
-
hooks =
|
|
19616
|
+
hooks = _createHooksMap();
|
|
19828
19617
|
};
|
|
19829
19618
|
return DOMPurify;
|
|
19830
19619
|
}
|
|
@@ -19835,12 +19624,6 @@
|
|
|
19835
19624
|
|
|
19836
19625
|
var browser = window.DOMPurify || (window.DOMPurify = purify["default"] || purify);
|
|
19837
19626
|
|
|
19838
|
-
var DOMPurify = /*#__PURE__*/Object.freeze({
|
|
19839
|
-
__proto__: null,
|
|
19840
|
-
'default': browser,
|
|
19841
|
-
__moduleExports: browser
|
|
19842
|
-
});
|
|
19843
|
-
|
|
19844
19627
|
var textarea;
|
|
19845
19628
|
function decodeEntity(name) {
|
|
19846
19629
|
textarea = textarea || document.createElement('textarea');
|
|
@@ -26886,7 +26669,7 @@
|
|
|
26886
26669
|
if (typeof renderItem === 'function') {
|
|
26887
26670
|
var jsxEl = renderItem(newSuggestion);
|
|
26888
26671
|
var innerValue = innerText(jsxEl);
|
|
26889
|
-
newSuggestion.value =
|
|
26672
|
+
newSuggestion.value = browser.sanitize(innerValue);
|
|
26890
26673
|
}
|
|
26891
26674
|
return newSuggestion;
|
|
26892
26675
|
}
|
|
@@ -26926,9 +26709,11 @@
|
|
|
26926
26709
|
field: Q.string,
|
|
26927
26710
|
weight: Q.number
|
|
26928
26711
|
})]),
|
|
26712
|
+
vectorDataField: Q.string,
|
|
26929
26713
|
aggregationField: types.string,
|
|
26930
26714
|
aggregationSize: Q.number,
|
|
26931
26715
|
size: Q.number,
|
|
26716
|
+
candidates: Q.number,
|
|
26932
26717
|
debounce: Q.number.def(0),
|
|
26933
26718
|
defaultValue: types.string,
|
|
26934
26719
|
excludeFields: types.excludeFields,
|
|
@@ -28226,7 +28011,7 @@
|
|
|
28226
28011
|
"style": {
|
|
28227
28012
|
display: 'flex'
|
|
28228
28013
|
},
|
|
28229
|
-
"innerHTML":
|
|
28014
|
+
"innerHTML": browser.sanitize(item.icon)
|
|
28230
28015
|
}, null);
|
|
28231
28016
|
};
|
|
28232
28017
|
}
|
|
@@ -28237,7 +28022,7 @@
|
|
|
28237
28022
|
"style": {
|
|
28238
28023
|
maxWidth: '30px'
|
|
28239
28024
|
},
|
|
28240
|
-
"src":
|
|
28025
|
+
"src": browser.sanitize(item.iconURL),
|
|
28241
28026
|
"alt": item.value
|
|
28242
28027
|
}, null)
|
|
28243
28028
|
);
|
|
@@ -28275,7 +28060,7 @@
|
|
|
28275
28060
|
}), !_this19.showAIScreen && _this19.parsedSuggestions.map(function (item, itemIndex) {
|
|
28276
28061
|
var index = indexOffset + itemIndex;
|
|
28277
28062
|
if (Array.isArray(item)) {
|
|
28278
|
-
var sectionHtml =
|
|
28063
|
+
var sectionHtml = browser.sanitize(item[0].sectionLabel);
|
|
28279
28064
|
indexOffset += item.length - 1;
|
|
28280
28065
|
return vue.createVNode("div", {
|
|
28281
28066
|
"key": "section-" + itemIndex,
|
|
@@ -44993,12 +44778,21 @@
|
|
|
44993
44778
|
ReactiveGoogleMap.componentType = componentTypes$1.reactiveMap;
|
|
44994
44779
|
|
|
44995
44780
|
var _PatchFlagNames, _slotFlagsText;
|
|
44996
|
-
|
|
44997
|
-
|
|
44998
|
-
|
|
44999
|
-
|
|
45000
|
-
|
|
45001
|
-
|
|
44781
|
+
/**
|
|
44782
|
+
* @vue/shared v3.5.13
|
|
44783
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
44784
|
+
* @license MIT
|
|
44785
|
+
**/
|
|
44786
|
+
/*! #__NO_SIDE_EFFECTS__ */
|
|
44787
|
+
// @__NO_SIDE_EFFECTS__
|
|
44788
|
+
function makeMap(str) {
|
|
44789
|
+
var map = /* @__PURE__ */Object.create(null);
|
|
44790
|
+
for (var _iterator = _createForOfIteratorHelperLoose(str.split(",")), _step; !(_step = _iterator()).done;) {
|
|
44791
|
+
var key = _step.value;
|
|
44792
|
+
map[key] = 1;
|
|
44793
|
+
}
|
|
44794
|
+
return function (val) {
|
|
44795
|
+
return val in map;
|
|
45002
44796
|
};
|
|
45003
44797
|
}
|
|
45004
44798
|
var EMPTY_OBJ = Object.freeze({}) ;
|
|
@@ -45070,14 +44864,13 @@
|
|
|
45070
44864
|
return ret;
|
|
45071
44865
|
}
|
|
45072
44866
|
function stringifyStyle(styles) {
|
|
44867
|
+
if (!styles) return "";
|
|
44868
|
+
if (isString(styles)) return styles;
|
|
45073
44869
|
var ret = "";
|
|
45074
|
-
if (!styles || isString(styles)) {
|
|
45075
|
-
return ret;
|
|
45076
|
-
}
|
|
45077
44870
|
for (var key in styles) {
|
|
45078
44871
|
var value = styles[key];
|
|
45079
|
-
var normalizedKey = key.startsWith("--") ? key : hyphenate(key);
|
|
45080
44872
|
if (isString(value) || typeof value === "number") {
|
|
44873
|
+
var normalizedKey = key.startsWith("--") ? key : hyphenate(key);
|
|
45081
44874
|
ret += normalizedKey + ":" + value + ";";
|
|
45082
44875
|
}
|
|
45083
44876
|
}
|
|
@@ -45130,6 +44923,13 @@
|
|
|
45130
44923
|
htmlFor: "for",
|
|
45131
44924
|
httpEquiv: "http-equiv"
|
|
45132
44925
|
};
|
|
44926
|
+
function isRenderableAttrValue(value) {
|
|
44927
|
+
if (value == null) {
|
|
44928
|
+
return false;
|
|
44929
|
+
}
|
|
44930
|
+
var type = typeof value;
|
|
44931
|
+
return type === "string" || type === "number" || type === "boolean";
|
|
44932
|
+
}
|
|
45133
44933
|
var escapeRE = /["'&<>]/;
|
|
45134
44934
|
function escapeHtml$1(string) {
|
|
45135
44935
|
var str = "" + string;
|
|
@@ -45175,7 +44975,7 @@
|
|
|
45175
44975
|
}
|
|
45176
44976
|
|
|
45177
44977
|
var _ErrorTypeStrings;
|
|
45178
|
-
var shouldIgnoreProp = makeMap(",key,ref,innerHTML,textContent,ref_key,ref_for");
|
|
44978
|
+
var shouldIgnoreProp = /* @__PURE__ */makeMap(",key,ref,innerHTML,textContent,ref_key,ref_for");
|
|
45179
44979
|
function ssrRenderAttrs(props, tag) {
|
|
45180
44980
|
var ret = "";
|
|
45181
44981
|
for (var key in props) {
|
|
@@ -45187,6 +44987,8 @@
|
|
|
45187
44987
|
ret += " class=\"" + ssrRenderClass(value) + "\"";
|
|
45188
44988
|
} else if (key === "style") {
|
|
45189
44989
|
ret += " style=\"" + ssrRenderStyle(value) + "\"";
|
|
44990
|
+
} else if (key === "className") {
|
|
44991
|
+
ret += " class=\"" + String(value) + "\"";
|
|
45190
44992
|
} else {
|
|
45191
44993
|
ret += ssrRenderDynamicAttr(key, value, tag);
|
|
45192
44994
|
}
|
|
@@ -45194,7 +44996,7 @@
|
|
|
45194
44996
|
return ret;
|
|
45195
44997
|
}
|
|
45196
44998
|
function ssrRenderDynamicAttr(key, value, tag) {
|
|
45197
|
-
if (!
|
|
44999
|
+
if (!isRenderableAttrValue(value)) {
|
|
45198
45000
|
return "";
|
|
45199
45001
|
}
|
|
45200
45002
|
var attrKey = tag && (tag.indexOf("-") > 0 || isSVGTag(tag)) ? key : propsToAttrMap[key] || key.toLowerCase();
|
|
@@ -45207,13 +45009,6 @@
|
|
|
45207
45009
|
return "";
|
|
45208
45010
|
}
|
|
45209
45011
|
}
|
|
45210
|
-
function isRenderableValue(value) {
|
|
45211
|
-
if (value == null) {
|
|
45212
|
-
return false;
|
|
45213
|
-
}
|
|
45214
|
-
var type = typeof value;
|
|
45215
|
-
return type === "string" || type === "number" || type === "boolean";
|
|
45216
|
-
}
|
|
45217
45012
|
function ssrRenderClass(raw) {
|
|
45218
45013
|
return escapeHtml$1(normalizeClass(raw));
|
|
45219
45014
|
}
|
|
@@ -45227,6 +45022,7 @@
|
|
|
45227
45022
|
var styles = normalizeStyle(raw);
|
|
45228
45023
|
return escapeHtml$1(stringifyStyle(styles));
|
|
45229
45024
|
}
|
|
45025
|
+
var ensureValidVNode = vue.ssrUtils.ensureValidVNode;
|
|
45230
45026
|
function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) {
|
|
45231
45027
|
parentPush("<!--teleport start-->");
|
|
45232
45028
|
var context = parentComponent.appContext.provides[vue.ssrContextKey];
|
|
@@ -45236,11 +45032,12 @@
|
|
|
45236
45032
|
var teleportContent;
|
|
45237
45033
|
if (disabled) {
|
|
45238
45034
|
contentRenderFn(parentPush);
|
|
45239
|
-
teleportContent = "<!--teleport anchor-->";
|
|
45035
|
+
teleportContent = "<!--teleport start anchor--><!--teleport anchor-->";
|
|
45240
45036
|
} else {
|
|
45241
45037
|
var _createBuffer = createBuffer(),
|
|
45242
45038
|
getBuffer = _createBuffer.getBuffer,
|
|
45243
45039
|
push = _createBuffer.push;
|
|
45040
|
+
push("<!--teleport start anchor-->");
|
|
45244
45041
|
contentRenderFn(push);
|
|
45245
45042
|
push("<!--teleport anchor-->");
|
|
45246
45043
|
teleportContent = getBuffer();
|
|
@@ -45248,7 +45045,7 @@
|
|
|
45248
45045
|
targetBuffer.splice(bufferIndex, 0, teleportContent);
|
|
45249
45046
|
parentPush("<!--teleport end-->");
|
|
45250
45047
|
}
|
|
45251
|
-
var ErrorTypeStrings = (_ErrorTypeStrings = {}, _ErrorTypeStrings["sp"] = "serverPrefetch hook", _ErrorTypeStrings["bc"] = "beforeCreate hook", _ErrorTypeStrings["c"] = "created hook", _ErrorTypeStrings["bm"] = "beforeMount hook", _ErrorTypeStrings["m"] = "mounted hook", _ErrorTypeStrings["bu"] = "beforeUpdate hook", _ErrorTypeStrings["u"] = "updated", _ErrorTypeStrings["bum"] = "beforeUnmount hook", _ErrorTypeStrings["um"] = "unmounted hook", _ErrorTypeStrings["a"] = "activated hook", _ErrorTypeStrings["da"] = "deactivated hook", _ErrorTypeStrings["ec"] = "errorCaptured hook", _ErrorTypeStrings["rtc"] = "renderTracked hook", _ErrorTypeStrings["rtg"] = "renderTriggered hook", _ErrorTypeStrings[0] = "setup function", _ErrorTypeStrings[1] = "render function", _ErrorTypeStrings[2] = "watcher getter", _ErrorTypeStrings[3] = "watcher callback", _ErrorTypeStrings[4] = "watcher cleanup function", _ErrorTypeStrings[5] = "native event handler", _ErrorTypeStrings[6] = "component event handler", _ErrorTypeStrings[7] = "vnode hook", _ErrorTypeStrings[8] = "directive hook", _ErrorTypeStrings[9] = "transition hook", _ErrorTypeStrings[10] = "app errorHandler", _ErrorTypeStrings[11] = "app warnHandler", _ErrorTypeStrings[12] = "ref function", _ErrorTypeStrings[13] = "async component loader", _ErrorTypeStrings[14] = "scheduler flush
|
|
45048
|
+
var ErrorTypeStrings = (_ErrorTypeStrings = {}, _ErrorTypeStrings["sp"] = "serverPrefetch hook", _ErrorTypeStrings["bc"] = "beforeCreate hook", _ErrorTypeStrings["c"] = "created hook", _ErrorTypeStrings["bm"] = "beforeMount hook", _ErrorTypeStrings["m"] = "mounted hook", _ErrorTypeStrings["bu"] = "beforeUpdate hook", _ErrorTypeStrings["u"] = "updated", _ErrorTypeStrings["bum"] = "beforeUnmount hook", _ErrorTypeStrings["um"] = "unmounted hook", _ErrorTypeStrings["a"] = "activated hook", _ErrorTypeStrings["da"] = "deactivated hook", _ErrorTypeStrings["ec"] = "errorCaptured hook", _ErrorTypeStrings["rtc"] = "renderTracked hook", _ErrorTypeStrings["rtg"] = "renderTriggered hook", _ErrorTypeStrings[0] = "setup function", _ErrorTypeStrings[1] = "render function", _ErrorTypeStrings[2] = "watcher getter", _ErrorTypeStrings[3] = "watcher callback", _ErrorTypeStrings[4] = "watcher cleanup function", _ErrorTypeStrings[5] = "native event handler", _ErrorTypeStrings[6] = "component event handler", _ErrorTypeStrings[7] = "vnode hook", _ErrorTypeStrings[8] = "directive hook", _ErrorTypeStrings[9] = "transition hook", _ErrorTypeStrings[10] = "app errorHandler", _ErrorTypeStrings[11] = "app warnHandler", _ErrorTypeStrings[12] = "ref function", _ErrorTypeStrings[13] = "async component loader", _ErrorTypeStrings[14] = "scheduler flush", _ErrorTypeStrings[15] = "component update", _ErrorTypeStrings[16] = "app unmount cleanup function", _ErrorTypeStrings);
|
|
45252
45049
|
{
|
|
45253
45050
|
var g$2 = getGlobalThis();
|
|
45254
45051
|
var registerGlobalSetter = function registerGlobalSetter(key, setter) {
|
|
@@ -45277,7 +45074,9 @@
|
|
|
45277
45074
|
setCurrentRenderingInstance = vue.ssrUtils.setCurrentRenderingInstance,
|
|
45278
45075
|
setupComponent = vue.ssrUtils.setupComponent,
|
|
45279
45076
|
renderComponentRoot = vue.ssrUtils.renderComponentRoot,
|
|
45280
|
-
normalizeVNode = vue.ssrUtils.normalizeVNode
|
|
45077
|
+
normalizeVNode = vue.ssrUtils.normalizeVNode,
|
|
45078
|
+
pushWarningContext = vue.ssrUtils.pushWarningContext,
|
|
45079
|
+
popWarningContext = vue.ssrUtils.popWarningContext;
|
|
45281
45080
|
function createBuffer() {
|
|
45282
45081
|
var appendable = false;
|
|
45283
45082
|
var buffer = [];
|
|
@@ -45289,9 +45088,9 @@
|
|
|
45289
45088
|
var isStringItem = isString(item);
|
|
45290
45089
|
if (appendable && isStringItem) {
|
|
45291
45090
|
buffer[buffer.length - 1] += item;
|
|
45292
|
-
|
|
45293
|
-
buffer.push(item);
|
|
45091
|
+
return;
|
|
45294
45092
|
}
|
|
45093
|
+
buffer.push(item);
|
|
45295
45094
|
appendable = isStringItem;
|
|
45296
45095
|
if (isPromise(item) || isArray(item) && item.hasAsync) {
|
|
45297
45096
|
buffer.hasAsync = true;
|
|
@@ -45303,20 +45102,22 @@
|
|
|
45303
45102
|
if (parentComponent === void 0) {
|
|
45304
45103
|
parentComponent = null;
|
|
45305
45104
|
}
|
|
45306
|
-
var instance = createComponentInstance(vnode, parentComponent, null);
|
|
45105
|
+
var instance = vnode.component = createComponentInstance(vnode, parentComponent, null);
|
|
45106
|
+
pushWarningContext(vnode);
|
|
45307
45107
|
var res = setupComponent(instance, true
|
|
45308
45108
|
/* isSSR */);
|
|
45109
|
+
popWarningContext();
|
|
45309
45110
|
var hasAsyncSetup = isPromise(res);
|
|
45310
45111
|
var prefetches = instance.sp;
|
|
45311
45112
|
if (hasAsyncSetup || prefetches) {
|
|
45312
|
-
var p =
|
|
45313
|
-
|
|
45314
|
-
|
|
45113
|
+
var p = Promise.resolve(res).then(function () {
|
|
45114
|
+
if (hasAsyncSetup) prefetches = instance.sp;
|
|
45115
|
+
if (prefetches) {
|
|
45315
45116
|
return Promise.all(prefetches.map(function (prefetch) {
|
|
45316
45117
|
return prefetch.call(instance.proxy);
|
|
45317
45118
|
}));
|
|
45318
|
-
}
|
|
45319
|
-
}
|
|
45119
|
+
}
|
|
45120
|
+
})["catch"](NOOP);
|
|
45320
45121
|
return p.then(function () {
|
|
45321
45122
|
return renderComponentSubTree(instance, slotScopeId);
|
|
45322
45123
|
});
|
|
@@ -45325,6 +45126,7 @@
|
|
|
45325
45126
|
}
|
|
45326
45127
|
}
|
|
45327
45128
|
function renderComponentSubTree(instance, slotScopeId) {
|
|
45129
|
+
pushWarningContext(instance.vnode);
|
|
45328
45130
|
var comp = instance.type;
|
|
45329
45131
|
var _createBuffer2 = createBuffer(),
|
|
45330
45132
|
getBuffer = _createBuffer2.getBuffer,
|
|
@@ -45343,13 +45145,6 @@
|
|
|
45343
45145
|
if ((!instance.render || instance.render === NOOP) && !instance.ssrRender && !comp.ssrRender && isString(comp.template)) {
|
|
45344
45146
|
comp.ssrRender = ssrCompile(comp.template);
|
|
45345
45147
|
}
|
|
45346
|
-
for (var _iterator = _createForOfIteratorHelperLoose(instance.scope.effects), _step; !(_step = _iterator()).done;) {
|
|
45347
|
-
var e = _step.value;
|
|
45348
|
-
if (e.computed) {
|
|
45349
|
-
e.computed._dirty = true;
|
|
45350
|
-
e.computed._cacheable = true;
|
|
45351
|
-
}
|
|
45352
|
-
}
|
|
45353
45148
|
var ssrRender = instance.ssrRender || comp.ssrRender;
|
|
45354
45149
|
if (ssrRender) {
|
|
45355
45150
|
var attrs = instance.inheritAttrs !== false ? instance.attrs : void 0;
|
|
@@ -45373,7 +45168,10 @@
|
|
|
45373
45168
|
}
|
|
45374
45169
|
if (slotScopeId) {
|
|
45375
45170
|
if (!hasCloned) attrs = _extends({}, attrs);
|
|
45376
|
-
|
|
45171
|
+
var slotScopeIdList = slotScopeId.trim().split(" ");
|
|
45172
|
+
for (var i = 0; i < slotScopeIdList.length; i++) {
|
|
45173
|
+
attrs[slotScopeIdList[i]] = "";
|
|
45174
|
+
}
|
|
45377
45175
|
}
|
|
45378
45176
|
var prev = setCurrentRenderingInstance(instance);
|
|
45379
45177
|
try {
|
|
@@ -45391,12 +45189,18 @@
|
|
|
45391
45189
|
push("<!---->");
|
|
45392
45190
|
}
|
|
45393
45191
|
}
|
|
45192
|
+
popWarningContext();
|
|
45394
45193
|
return getBuffer();
|
|
45395
45194
|
}
|
|
45396
45195
|
function renderVNode(push, vnode, parentComponent, slotScopeId) {
|
|
45397
45196
|
var type = vnode.type,
|
|
45398
45197
|
shapeFlag = vnode.shapeFlag,
|
|
45399
|
-
children = vnode.children
|
|
45198
|
+
children = vnode.children,
|
|
45199
|
+
dirs = vnode.dirs,
|
|
45200
|
+
props = vnode.props;
|
|
45201
|
+
if (dirs) {
|
|
45202
|
+
vnode.props = applySSRDirectives(vnode, props, dirs);
|
|
45203
|
+
}
|
|
45400
45204
|
switch (type) {
|
|
45401
45205
|
case vue.Text:
|
|
45402
45206
|
push(escapeHtml$1(children));
|
|
@@ -45439,12 +45243,8 @@
|
|
|
45439
45243
|
var props = vnode.props,
|
|
45440
45244
|
children = vnode.children,
|
|
45441
45245
|
shapeFlag = vnode.shapeFlag,
|
|
45442
|
-
scopeId = vnode.scopeId
|
|
45443
|
-
dirs = vnode.dirs;
|
|
45246
|
+
scopeId = vnode.scopeId;
|
|
45444
45247
|
var openTag = "<" + tag;
|
|
45445
|
-
if (dirs) {
|
|
45446
|
-
props = applySSRDirectives(vnode, props, dirs);
|
|
45447
|
-
}
|
|
45448
45248
|
if (props) {
|
|
45449
45249
|
openTag += ssrRenderAttrs(props, tag);
|
|
45450
45250
|
}
|
|
@@ -45518,64 +45318,46 @@
|
|
|
45518
45318
|
}, target, disabled || disabled === "", parentComponent);
|
|
45519
45319
|
}
|
|
45520
45320
|
var isVNode$1 = vue.ssrUtils.isVNode;
|
|
45521
|
-
function
|
|
45522
|
-
|
|
45523
|
-
|
|
45524
|
-
|
|
45525
|
-
|
|
45526
|
-
|
|
45527
|
-
|
|
45528
|
-
|
|
45529
|
-
|
|
45530
|
-
|
|
45531
|
-
|
|
45532
|
-
|
|
45533
|
-
|
|
45534
|
-
|
|
45535
|
-
|
|
45536
|
-
|
|
45537
|
-
|
|
45538
|
-
|
|
45539
|
-
break;
|
|
45540
|
-
}
|
|
45541
|
-
item = buffer[i];
|
|
45542
|
-
if (!isPromise(item)) {
|
|
45543
|
-
_context3.next = 9;
|
|
45544
|
-
break;
|
|
45545
|
-
}
|
|
45546
|
-
_context3.next = 8;
|
|
45547
|
-
return item;
|
|
45548
|
-
case 8:
|
|
45549
|
-
item = _context3.sent;
|
|
45550
|
-
case 9:
|
|
45551
|
-
if (!isString(item)) {
|
|
45552
|
-
_context3.next = 13;
|
|
45553
|
-
break;
|
|
45554
|
-
}
|
|
45555
|
-
ret += item;
|
|
45556
|
-
_context3.next = 17;
|
|
45557
|
-
break;
|
|
45558
|
-
case 13:
|
|
45559
|
-
_context3.t0 = ret;
|
|
45560
|
-
_context3.next = 16;
|
|
45561
|
-
return unrollBuffer$1(item);
|
|
45562
|
-
case 16:
|
|
45563
|
-
ret = _context3.t0 += _context3.sent;
|
|
45564
|
-
case 17:
|
|
45565
|
-
i++;
|
|
45566
|
-
_context3.next = 3;
|
|
45567
|
-
break;
|
|
45568
|
-
case 20:
|
|
45569
|
-
return _context3.abrupt("return", ret);
|
|
45570
|
-
case 23:
|
|
45571
|
-
return _context3.abrupt("return", unrollBufferSync$1(buffer));
|
|
45572
|
-
case 24:
|
|
45573
|
-
case "end":
|
|
45574
|
-
return _context3.stop();
|
|
45321
|
+
function nestedUnrollBuffer(buffer, parentRet, startIndex) {
|
|
45322
|
+
if (!buffer.hasAsync) {
|
|
45323
|
+
return parentRet + unrollBufferSync$1(buffer);
|
|
45324
|
+
}
|
|
45325
|
+
var ret = parentRet;
|
|
45326
|
+
var _loop = function _loop(i) {
|
|
45327
|
+
var item = buffer[i];
|
|
45328
|
+
if (isString(item)) {
|
|
45329
|
+
ret += item;
|
|
45330
|
+
return 0; // continue
|
|
45331
|
+
}
|
|
45332
|
+
if (isPromise(item)) {
|
|
45333
|
+
return {
|
|
45334
|
+
v: item.then(function (nestedItem) {
|
|
45335
|
+
buffer[i] = nestedItem;
|
|
45336
|
+
return nestedUnrollBuffer(buffer, ret, i);
|
|
45337
|
+
})
|
|
45338
|
+
};
|
|
45575
45339
|
}
|
|
45576
|
-
|
|
45577
|
-
|
|
45578
|
-
|
|
45340
|
+
var result = nestedUnrollBuffer(item, ret, 0);
|
|
45341
|
+
if (isPromise(result)) {
|
|
45342
|
+
return {
|
|
45343
|
+
v: result.then(function (nestedItem) {
|
|
45344
|
+
buffer[i] = nestedItem;
|
|
45345
|
+
return nestedUnrollBuffer(buffer, "", i);
|
|
45346
|
+
})
|
|
45347
|
+
};
|
|
45348
|
+
}
|
|
45349
|
+
ret = result;
|
|
45350
|
+
},
|
|
45351
|
+
_ret;
|
|
45352
|
+
for (var i = startIndex; i < buffer.length; i += 1) {
|
|
45353
|
+
_ret = _loop(i);
|
|
45354
|
+
if (_ret === 0) continue;
|
|
45355
|
+
if (_ret) return _ret.v;
|
|
45356
|
+
}
|
|
45357
|
+
return ret;
|
|
45358
|
+
}
|
|
45359
|
+
function unrollBuffer$1(buffer) {
|
|
45360
|
+
return nestedUnrollBuffer(buffer, "", 0);
|
|
45579
45361
|
}
|
|
45580
45362
|
function unrollBufferSync$1(buffer) {
|
|
45581
45363
|
var ret = "";
|
|
@@ -45589,23 +45371,23 @@
|
|
|
45589
45371
|
}
|
|
45590
45372
|
return ret;
|
|
45591
45373
|
}
|
|
45592
|
-
function renderToString(
|
|
45374
|
+
function renderToString(_x3, _x4) {
|
|
45593
45375
|
return _renderToString.apply(this, arguments);
|
|
45594
45376
|
}
|
|
45595
45377
|
function _renderToString() {
|
|
45596
|
-
_renderToString = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
45597
|
-
var vnode, buffer, result,
|
|
45598
|
-
return _regeneratorRuntime().wrap(function
|
|
45599
|
-
while (1) switch (
|
|
45378
|
+
_renderToString = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(input, context) {
|
|
45379
|
+
var vnode, buffer, result, _iterator2, _step2, unwatch;
|
|
45380
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
45381
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
45600
45382
|
case 0:
|
|
45601
45383
|
if (context === void 0) {
|
|
45602
45384
|
context = {};
|
|
45603
45385
|
}
|
|
45604
45386
|
if (!isVNode$1(input)) {
|
|
45605
|
-
|
|
45387
|
+
_context3.next = 3;
|
|
45606
45388
|
break;
|
|
45607
45389
|
}
|
|
45608
|
-
return
|
|
45390
|
+
return _context3.abrupt("return", renderToString(vue.createApp({
|
|
45609
45391
|
render: function render() {
|
|
45610
45392
|
return input;
|
|
45611
45393
|
}
|
|
@@ -45614,69 +45396,69 @@
|
|
|
45614
45396
|
vnode = vue.createVNode(input._component, input._props);
|
|
45615
45397
|
vnode.appContext = input._context;
|
|
45616
45398
|
input.provide(vue.ssrContextKey, context);
|
|
45617
|
-
|
|
45399
|
+
_context3.next = 8;
|
|
45618
45400
|
return renderComponentVNode(vnode);
|
|
45619
45401
|
case 8:
|
|
45620
|
-
buffer =
|
|
45621
|
-
|
|
45402
|
+
buffer = _context3.sent;
|
|
45403
|
+
_context3.next = 11;
|
|
45622
45404
|
return unrollBuffer$1(buffer);
|
|
45623
45405
|
case 11:
|
|
45624
|
-
result =
|
|
45625
|
-
|
|
45406
|
+
result = _context3.sent;
|
|
45407
|
+
_context3.next = 14;
|
|
45626
45408
|
return resolveTeleports(context);
|
|
45627
45409
|
case 14:
|
|
45628
45410
|
if (context.__watcherHandles) {
|
|
45629
|
-
for (
|
|
45630
|
-
unwatch =
|
|
45411
|
+
for (_iterator2 = _createForOfIteratorHelperLoose(context.__watcherHandles); !(_step2 = _iterator2()).done;) {
|
|
45412
|
+
unwatch = _step2.value;
|
|
45631
45413
|
unwatch();
|
|
45632
45414
|
}
|
|
45633
45415
|
}
|
|
45634
|
-
return
|
|
45416
|
+
return _context3.abrupt("return", result);
|
|
45635
45417
|
case 16:
|
|
45636
45418
|
case "end":
|
|
45637
|
-
return
|
|
45419
|
+
return _context3.stop();
|
|
45638
45420
|
}
|
|
45639
|
-
},
|
|
45421
|
+
}, _callee3);
|
|
45640
45422
|
}));
|
|
45641
45423
|
return _renderToString.apply(this, arguments);
|
|
45642
45424
|
}
|
|
45643
|
-
function resolveTeleports(
|
|
45425
|
+
function resolveTeleports(_x5) {
|
|
45644
45426
|
return _resolveTeleports.apply(this, arguments);
|
|
45645
45427
|
}
|
|
45646
45428
|
function _resolveTeleports() {
|
|
45647
|
-
_resolveTeleports = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
45429
|
+
_resolveTeleports = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(context) {
|
|
45648
45430
|
var key;
|
|
45649
|
-
return _regeneratorRuntime().wrap(function
|
|
45650
|
-
while (1) switch (
|
|
45431
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
45432
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
45651
45433
|
case 0:
|
|
45652
45434
|
if (!context.__teleportBuffers) {
|
|
45653
|
-
|
|
45435
|
+
_context4.next = 14;
|
|
45654
45436
|
break;
|
|
45655
45437
|
}
|
|
45656
45438
|
context.teleports = context.teleports || {};
|
|
45657
|
-
|
|
45439
|
+
_context4.t0 = _regeneratorRuntime().keys(context.__teleportBuffers);
|
|
45658
45440
|
case 3:
|
|
45659
|
-
if ((
|
|
45660
|
-
|
|
45441
|
+
if ((_context4.t1 = _context4.t0()).done) {
|
|
45442
|
+
_context4.next = 14;
|
|
45661
45443
|
break;
|
|
45662
45444
|
}
|
|
45663
|
-
key =
|
|
45664
|
-
|
|
45665
|
-
|
|
45445
|
+
key = _context4.t1.value;
|
|
45446
|
+
_context4.t2 = unrollBuffer$1;
|
|
45447
|
+
_context4.next = 8;
|
|
45666
45448
|
return Promise.all([context.__teleportBuffers[key]]);
|
|
45667
45449
|
case 8:
|
|
45668
|
-
|
|
45669
|
-
|
|
45670
|
-
return (0,
|
|
45450
|
+
_context4.t3 = _context4.sent;
|
|
45451
|
+
_context4.next = 11;
|
|
45452
|
+
return (0, _context4.t2)(_context4.t3);
|
|
45671
45453
|
case 11:
|
|
45672
|
-
context.teleports[key] =
|
|
45673
|
-
|
|
45454
|
+
context.teleports[key] = _context4.sent;
|
|
45455
|
+
_context4.next = 3;
|
|
45674
45456
|
break;
|
|
45675
45457
|
case 14:
|
|
45676
45458
|
case "end":
|
|
45677
|
-
return
|
|
45459
|
+
return _context4.stop();
|
|
45678
45460
|
}
|
|
45679
|
-
},
|
|
45461
|
+
}, _callee4);
|
|
45680
45462
|
}));
|
|
45681
45463
|
return _resolveTeleports.apply(this, arguments);
|
|
45682
45464
|
}
|
|
@@ -46419,7 +46201,7 @@
|
|
|
46419
46201
|
// dataField is a required field for components other than search
|
|
46420
46202
|
// TODO: Revisit this logic based on the Appbase version
|
|
46421
46203
|
// dataField is no longer a required field in RS API
|
|
46422
|
-
if (props.componentType !== componentTypes$6.AIAnswer && !isSearchComponent$1(props.componentType) && !props.dataField) {
|
|
46204
|
+
if (props.componentType !== componentTypes$6.AIAnswer && !isSearchComponent$1(props.componentType) && !props.dataField && !props.vectorDataField) {
|
|
46423
46205
|
return null;
|
|
46424
46206
|
}
|
|
46425
46207
|
var endpoint;
|
|
@@ -46517,7 +46299,8 @@
|
|
|
46517
46299
|
execute: true
|
|
46518
46300
|
}) : {}), queryType !== queryTypes$3.suggestion ? {
|
|
46519
46301
|
vectorDataField: props.vectorDataField || undefined,
|
|
46520
|
-
imageValue: props.imageValue || undefined
|
|
46302
|
+
imageValue: props.imageValue || undefined,
|
|
46303
|
+
candidates: props.candidates || props.size || undefined
|
|
46521
46304
|
} : {});
|
|
46522
46305
|
}
|
|
46523
46306
|
return null;
|
|
@@ -47262,7 +47045,7 @@
|
|
|
47262
47045
|
}, queryString, renderFunction);
|
|
47263
47046
|
}
|
|
47264
47047
|
|
|
47265
|
-
var version = "3.
|
|
47048
|
+
var version = "3.4.0";
|
|
47266
47049
|
|
|
47267
47050
|
var components = [RLConnected, ResultCard, ResultList, ReactiveBase, SBConnected, ListConnected, ListConnected$1, RangeConnected$1, RangeConnected$2, RangeConnected$3, RangeConnected, RcConnected, RcConnected$1, RcConnected$2, TBConnected, ListConnected$2, ListConnected$3, StateProviderConnected, RangeConnected$4, TreeListConnected, AIConnected];
|
|
47268
47051
|
function install$1 (Vue) {
|