@appbaseio/reactivesearch-vue 3.0.0-rc.7.1 → 3.0.0-rc.9
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 +175 -2002
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{DropDown-dcdaf54f.js → DropDown-aef75c14.js} +4 -12
- package/dist/cjs/{Input-df30e5fc.js → Input-56eba499.js} +16 -23
- package/dist/cjs/MultiDropdownList.js +2 -2
- package/dist/cjs/MultiList.js +1 -1
- package/dist/cjs/RangeInput.js +1 -1
- package/dist/cjs/SingleDropdownList.js +2 -2
- package/dist/cjs/SingleList.js +1 -1
- package/dist/cjs/index.js +3 -4
- package/dist/cjs/{install-3821345b.js → install-e8141489.js} +74 -282
- package/dist/cjs/install.js +3 -4
- package/dist/cjs/version.js +1 -1
- package/dist/es/{DropDown-bede2a41.js → DropDown-39fedff8.js} +5 -12
- package/dist/es/{Input-4376ac1f.js → Input-11d211d2.js} +17 -23
- package/dist/es/MultiDropdownList.js +2 -2
- package/dist/es/MultiList.js +1 -1
- package/dist/es/RangeInput.js +1 -1
- package/dist/es/SingleDropdownList.js +2 -2
- package/dist/es/SingleList.js +1 -1
- package/dist/es/index.js +4 -5
- package/dist/es/{install-af4c53c4.js → install-b785dd55.js} +75 -283
- package/dist/es/install.js +3 -4
- package/dist/es/version.js +1 -1
- package/package.json +4 -5
|
@@ -1189,7 +1189,7 @@
|
|
|
1189
1189
|
geo: 'geo',
|
|
1190
1190
|
suggestion: 'suggestion'
|
|
1191
1191
|
};
|
|
1192
|
-
var validProps = exports.validProps = ['type', 'componentType', 'aggregationField', 'aggregationSize', 'distinctField', 'distinctFieldConfig', 'index', 'aggregations', 'dataField', 'includeFields', 'excludeFields', 'size', 'from', 'sortBy', 'sortOptions', 'pagination', 'autoFocus', 'autosuggest', 'debounce', 'defaultValue', 'defaultSuggestions', 'fieldWeights', 'filterLabel', 'fuzziness', 'highlight', 'highlightConfig', 'highlightField', 'nestedField', 'placeholder', 'queryFormat', 'searchOperators', 'enableSynonyms', 'enableQuerySuggestions', 'queryString', 'categoryField', 'strictSelection', 'selectAllLabel', 'showCheckbox', 'showFilter', 'showSearch', 'showCount', 'showLoadMore', 'loadMoreLabel', 'showMissing', 'missingLabel', 'data', 'showRadio', 'multiSelect', 'includeNullValues', 'interval', 'showHistogram', 'snap', 'stepValue', 'range', 'showSlider', 'parseDate', 'calendarInterval', 'unit', 'enablePopularSuggestions', 'enableRecentSuggestions', 'popularSuggestionsConfig', 'recentSuggestionsConfig', 'indexSuggestionsConfig', 'featuredSuggestionsConfig', '
|
|
1192
|
+
var validProps = exports.validProps = ['type', 'componentType', 'aggregationField', 'aggregationSize', 'distinctField', 'distinctFieldConfig', 'index', 'aggregations', 'dataField', 'includeFields', 'excludeFields', 'size', 'from', 'sortBy', 'sortOptions', 'pagination', 'autoFocus', 'autosuggest', 'debounce', 'defaultValue', 'defaultSuggestions', 'fieldWeights', 'filterLabel', 'fuzziness', 'highlight', 'highlightConfig', 'highlightField', 'nestedField', 'placeholder', 'queryFormat', 'searchOperators', 'enableSynonyms', 'enableQuerySuggestions', 'queryString', 'categoryField', 'strictSelection', 'selectAllLabel', 'showCheckbox', 'showFilter', 'showSearch', 'showCount', 'showLoadMore', 'loadMoreLabel', 'showMissing', 'missingLabel', 'data', 'showRadio', 'multiSelect', 'includeNullValues', 'interval', 'showHistogram', 'snap', 'stepValue', 'range', 'showSlider', 'parseDate', 'calendarInterval', 'unit', 'enablePopularSuggestions', 'enableRecentSuggestions', 'popularSuggestionsConfig', 'recentSuggestionsConfig', 'indexSuggestionsConfig', 'featuredSuggestionsConfig', 'enablePredictiveSuggestions', 'applyStopwords', 'customStopwords', 'enableIndexSuggestions', 'enableFeaturedSuggestions', 'searchboxId', 'endpoint', 'enableEndpointSuggestions', 'enableAI', 'AIConfig'];
|
|
1193
1193
|
var CLEAR_ALL = exports.CLEAR_ALL = {
|
|
1194
1194
|
NEVER: 'never',
|
|
1195
1195
|
ALWAYS: 'always',
|
|
@@ -5249,8 +5249,7 @@
|
|
|
5249
5249
|
Index: 'index',
|
|
5250
5250
|
Recent: 'recent',
|
|
5251
5251
|
Promoted: 'promoted',
|
|
5252
|
-
Featured: 'featured'
|
|
5253
|
-
FAQ: 'faq'
|
|
5252
|
+
Featured: 'featured'
|
|
5254
5253
|
};
|
|
5255
5254
|
var featuredSuggestionsActionTypes = exports.featuredSuggestionsActionTypes = {
|
|
5256
5255
|
NAVIGATE: 'navigate',
|
|
@@ -6245,8 +6244,6 @@
|
|
|
6245
6244
|
featuredSuggestionsConfig: props.featuredSuggestionsConfig,
|
|
6246
6245
|
indexSuggestionsConfig: props.indexSuggestionsConfig,
|
|
6247
6246
|
enableFeaturedSuggestions: props.enableFeaturedSuggestions,
|
|
6248
|
-
enableFAQSuggestions: props.enableFAQSuggestions,
|
|
6249
|
-
FAQSuggestionsConfig: props.FAQSuggestionsConfig,
|
|
6250
6247
|
enableIndexSuggestions: props.enableIndexSuggestions
|
|
6251
6248
|
}, props.searchboxId ? {
|
|
6252
6249
|
searchboxId: props.searchboxId
|
|
@@ -8250,14 +8247,14 @@
|
|
|
8250
8247
|
var chunk = decoder.decode(value, {
|
|
8251
8248
|
stream: true
|
|
8252
8249
|
});
|
|
8253
|
-
var regex = /\n\n(?=data
|
|
8250
|
+
var regex = /\n\n(?=data:|$)/;
|
|
8254
8251
|
var lines = chunk.split(regex);
|
|
8255
8252
|
var shouldStop = false;
|
|
8256
8253
|
for (var i = 0; i < lines.length; i++) {
|
|
8257
8254
|
var line = lines[i];
|
|
8258
8255
|
if (line.startsWith('data: ')) {
|
|
8259
8256
|
var content = line.slice(6);
|
|
8260
|
-
if (content === '[DONE]
|
|
8257
|
+
if (content === '[DONE]') {
|
|
8261
8258
|
shouldStop = true;
|
|
8262
8259
|
if (Promise.resolve(metaInfoPromise) === metaInfoPromise) {
|
|
8263
8260
|
metaInfoPromise.then(function (resMeta) {
|
|
@@ -8803,7 +8800,27 @@
|
|
|
8803
8800
|
analyticsInstance.saveSessionUsefulness(sessionId, _extends({}, otherInfo, {
|
|
8804
8801
|
userID: userID
|
|
8805
8802
|
}), function (err, res) {
|
|
8806
|
-
|
|
8803
|
+
res._bodyBlob.text().then(function (textData) {
|
|
8804
|
+
try {
|
|
8805
|
+
var parsedErrorRes = JSON.parse(textData);
|
|
8806
|
+
if (parsedErrorRes.error) {
|
|
8807
|
+
var errorCode = parsedErrorRes.error.code;
|
|
8808
|
+
var errorMessage = parsedErrorRes.error.message;
|
|
8809
|
+
var finalErrorMessage = 'There was an error recording the usefulness of the session. \n\n';
|
|
8810
|
+
if (errorCode) {
|
|
8811
|
+
finalErrorMessage += errorCode;
|
|
8812
|
+
}
|
|
8813
|
+
if (errorMessage) {
|
|
8814
|
+
finalErrorMessage += '' + (errorCode ? ': ' : '') + errorMessage;
|
|
8815
|
+
}
|
|
8816
|
+
console.error(finalErrorMessage);
|
|
8817
|
+
}
|
|
8818
|
+
} catch (error) {
|
|
8819
|
+
console.error('There was an error recording the usefulness of the session. \n\n');
|
|
8820
|
+
}
|
|
8821
|
+
})["catch"](function (error) {
|
|
8822
|
+
console.error('Error reading component error text data:', error);
|
|
8823
|
+
});
|
|
8807
8824
|
});
|
|
8808
8825
|
};
|
|
8809
8826
|
}
|
|
@@ -18164,1586 +18181,6 @@
|
|
|
18164
18181
|
window.hotkeys = hotkeys;
|
|
18165
18182
|
}
|
|
18166
18183
|
|
|
18167
|
-
/**
|
|
18168
|
-
* cssfilter
|
|
18169
|
-
*
|
|
18170
|
-
* @author 老雷<leizongmin@gmail.com>
|
|
18171
|
-
*/
|
|
18172
|
-
|
|
18173
|
-
function getDefaultWhiteList() {
|
|
18174
|
-
// 白名单值说明:
|
|
18175
|
-
// true: 允许该属性
|
|
18176
|
-
// Function: function (val) { } 返回true表示允许该属性,其他值均表示不允许
|
|
18177
|
-
// RegExp: regexp.test(val) 返回true表示允许该属性,其他值均表示不允许
|
|
18178
|
-
// 除上面列出的值外均表示不允许
|
|
18179
|
-
var whiteList = {};
|
|
18180
|
-
whiteList['align-content'] = false; // default: auto
|
|
18181
|
-
whiteList['align-items'] = false; // default: auto
|
|
18182
|
-
whiteList['align-self'] = false; // default: auto
|
|
18183
|
-
whiteList['alignment-adjust'] = false; // default: auto
|
|
18184
|
-
whiteList['alignment-baseline'] = false; // default: baseline
|
|
18185
|
-
whiteList['all'] = false; // default: depending on individual properties
|
|
18186
|
-
whiteList['anchor-point'] = false; // default: none
|
|
18187
|
-
whiteList['animation'] = false; // default: depending on individual properties
|
|
18188
|
-
whiteList['animation-delay'] = false; // default: 0
|
|
18189
|
-
whiteList['animation-direction'] = false; // default: normal
|
|
18190
|
-
whiteList['animation-duration'] = false; // default: 0
|
|
18191
|
-
whiteList['animation-fill-mode'] = false; // default: none
|
|
18192
|
-
whiteList['animation-iteration-count'] = false; // default: 1
|
|
18193
|
-
whiteList['animation-name'] = false; // default: none
|
|
18194
|
-
whiteList['animation-play-state'] = false; // default: running
|
|
18195
|
-
whiteList['animation-timing-function'] = false; // default: ease
|
|
18196
|
-
whiteList['azimuth'] = false; // default: center
|
|
18197
|
-
whiteList['backface-visibility'] = false; // default: visible
|
|
18198
|
-
whiteList['background'] = true; // default: depending on individual properties
|
|
18199
|
-
whiteList['background-attachment'] = true; // default: scroll
|
|
18200
|
-
whiteList['background-clip'] = true; // default: border-box
|
|
18201
|
-
whiteList['background-color'] = true; // default: transparent
|
|
18202
|
-
whiteList['background-image'] = true; // default: none
|
|
18203
|
-
whiteList['background-origin'] = true; // default: padding-box
|
|
18204
|
-
whiteList['background-position'] = true; // default: 0% 0%
|
|
18205
|
-
whiteList['background-repeat'] = true; // default: repeat
|
|
18206
|
-
whiteList['background-size'] = true; // default: auto
|
|
18207
|
-
whiteList['baseline-shift'] = false; // default: baseline
|
|
18208
|
-
whiteList['binding'] = false; // default: none
|
|
18209
|
-
whiteList['bleed'] = false; // default: 6pt
|
|
18210
|
-
whiteList['bookmark-label'] = false; // default: content()
|
|
18211
|
-
whiteList['bookmark-level'] = false; // default: none
|
|
18212
|
-
whiteList['bookmark-state'] = false; // default: open
|
|
18213
|
-
whiteList['border'] = true; // default: depending on individual properties
|
|
18214
|
-
whiteList['border-bottom'] = true; // default: depending on individual properties
|
|
18215
|
-
whiteList['border-bottom-color'] = true; // default: current color
|
|
18216
|
-
whiteList['border-bottom-left-radius'] = true; // default: 0
|
|
18217
|
-
whiteList['border-bottom-right-radius'] = true; // default: 0
|
|
18218
|
-
whiteList['border-bottom-style'] = true; // default: none
|
|
18219
|
-
whiteList['border-bottom-width'] = true; // default: medium
|
|
18220
|
-
whiteList['border-collapse'] = true; // default: separate
|
|
18221
|
-
whiteList['border-color'] = true; // default: depending on individual properties
|
|
18222
|
-
whiteList['border-image'] = true; // default: none
|
|
18223
|
-
whiteList['border-image-outset'] = true; // default: 0
|
|
18224
|
-
whiteList['border-image-repeat'] = true; // default: stretch
|
|
18225
|
-
whiteList['border-image-slice'] = true; // default: 100%
|
|
18226
|
-
whiteList['border-image-source'] = true; // default: none
|
|
18227
|
-
whiteList['border-image-width'] = true; // default: 1
|
|
18228
|
-
whiteList['border-left'] = true; // default: depending on individual properties
|
|
18229
|
-
whiteList['border-left-color'] = true; // default: current color
|
|
18230
|
-
whiteList['border-left-style'] = true; // default: none
|
|
18231
|
-
whiteList['border-left-width'] = true; // default: medium
|
|
18232
|
-
whiteList['border-radius'] = true; // default: 0
|
|
18233
|
-
whiteList['border-right'] = true; // default: depending on individual properties
|
|
18234
|
-
whiteList['border-right-color'] = true; // default: current color
|
|
18235
|
-
whiteList['border-right-style'] = true; // default: none
|
|
18236
|
-
whiteList['border-right-width'] = true; // default: medium
|
|
18237
|
-
whiteList['border-spacing'] = true; // default: 0
|
|
18238
|
-
whiteList['border-style'] = true; // default: depending on individual properties
|
|
18239
|
-
whiteList['border-top'] = true; // default: depending on individual properties
|
|
18240
|
-
whiteList['border-top-color'] = true; // default: current color
|
|
18241
|
-
whiteList['border-top-left-radius'] = true; // default: 0
|
|
18242
|
-
whiteList['border-top-right-radius'] = true; // default: 0
|
|
18243
|
-
whiteList['border-top-style'] = true; // default: none
|
|
18244
|
-
whiteList['border-top-width'] = true; // default: medium
|
|
18245
|
-
whiteList['border-width'] = true; // default: depending on individual properties
|
|
18246
|
-
whiteList['bottom'] = false; // default: auto
|
|
18247
|
-
whiteList['box-decoration-break'] = true; // default: slice
|
|
18248
|
-
whiteList['box-shadow'] = true; // default: none
|
|
18249
|
-
whiteList['box-sizing'] = true; // default: content-box
|
|
18250
|
-
whiteList['box-snap'] = true; // default: none
|
|
18251
|
-
whiteList['box-suppress'] = true; // default: show
|
|
18252
|
-
whiteList['break-after'] = true; // default: auto
|
|
18253
|
-
whiteList['break-before'] = true; // default: auto
|
|
18254
|
-
whiteList['break-inside'] = true; // default: auto
|
|
18255
|
-
whiteList['caption-side'] = false; // default: top
|
|
18256
|
-
whiteList['chains'] = false; // default: none
|
|
18257
|
-
whiteList['clear'] = true; // default: none
|
|
18258
|
-
whiteList['clip'] = false; // default: auto
|
|
18259
|
-
whiteList['clip-path'] = false; // default: none
|
|
18260
|
-
whiteList['clip-rule'] = false; // default: nonzero
|
|
18261
|
-
whiteList['color'] = true; // default: implementation dependent
|
|
18262
|
-
whiteList['color-interpolation-filters'] = true; // default: auto
|
|
18263
|
-
whiteList['column-count'] = false; // default: auto
|
|
18264
|
-
whiteList['column-fill'] = false; // default: balance
|
|
18265
|
-
whiteList['column-gap'] = false; // default: normal
|
|
18266
|
-
whiteList['column-rule'] = false; // default: depending on individual properties
|
|
18267
|
-
whiteList['column-rule-color'] = false; // default: current color
|
|
18268
|
-
whiteList['column-rule-style'] = false; // default: medium
|
|
18269
|
-
whiteList['column-rule-width'] = false; // default: medium
|
|
18270
|
-
whiteList['column-span'] = false; // default: none
|
|
18271
|
-
whiteList['column-width'] = false; // default: auto
|
|
18272
|
-
whiteList['columns'] = false; // default: depending on individual properties
|
|
18273
|
-
whiteList['contain'] = false; // default: none
|
|
18274
|
-
whiteList['content'] = false; // default: normal
|
|
18275
|
-
whiteList['counter-increment'] = false; // default: none
|
|
18276
|
-
whiteList['counter-reset'] = false; // default: none
|
|
18277
|
-
whiteList['counter-set'] = false; // default: none
|
|
18278
|
-
whiteList['crop'] = false; // default: auto
|
|
18279
|
-
whiteList['cue'] = false; // default: depending on individual properties
|
|
18280
|
-
whiteList['cue-after'] = false; // default: none
|
|
18281
|
-
whiteList['cue-before'] = false; // default: none
|
|
18282
|
-
whiteList['cursor'] = false; // default: auto
|
|
18283
|
-
whiteList['direction'] = false; // default: ltr
|
|
18284
|
-
whiteList['display'] = true; // default: depending on individual properties
|
|
18285
|
-
whiteList['display-inside'] = true; // default: auto
|
|
18286
|
-
whiteList['display-list'] = true; // default: none
|
|
18287
|
-
whiteList['display-outside'] = true; // default: inline-level
|
|
18288
|
-
whiteList['dominant-baseline'] = false; // default: auto
|
|
18289
|
-
whiteList['elevation'] = false; // default: level
|
|
18290
|
-
whiteList['empty-cells'] = false; // default: show
|
|
18291
|
-
whiteList['filter'] = false; // default: none
|
|
18292
|
-
whiteList['flex'] = false; // default: depending on individual properties
|
|
18293
|
-
whiteList['flex-basis'] = false; // default: auto
|
|
18294
|
-
whiteList['flex-direction'] = false; // default: row
|
|
18295
|
-
whiteList['flex-flow'] = false; // default: depending on individual properties
|
|
18296
|
-
whiteList['flex-grow'] = false; // default: 0
|
|
18297
|
-
whiteList['flex-shrink'] = false; // default: 1
|
|
18298
|
-
whiteList['flex-wrap'] = false; // default: nowrap
|
|
18299
|
-
whiteList['float'] = false; // default: none
|
|
18300
|
-
whiteList['float-offset'] = false; // default: 0 0
|
|
18301
|
-
whiteList['flood-color'] = false; // default: black
|
|
18302
|
-
whiteList['flood-opacity'] = false; // default: 1
|
|
18303
|
-
whiteList['flow-from'] = false; // default: none
|
|
18304
|
-
whiteList['flow-into'] = false; // default: none
|
|
18305
|
-
whiteList['font'] = true; // default: depending on individual properties
|
|
18306
|
-
whiteList['font-family'] = true; // default: implementation dependent
|
|
18307
|
-
whiteList['font-feature-settings'] = true; // default: normal
|
|
18308
|
-
whiteList['font-kerning'] = true; // default: auto
|
|
18309
|
-
whiteList['font-language-override'] = true; // default: normal
|
|
18310
|
-
whiteList['font-size'] = true; // default: medium
|
|
18311
|
-
whiteList['font-size-adjust'] = true; // default: none
|
|
18312
|
-
whiteList['font-stretch'] = true; // default: normal
|
|
18313
|
-
whiteList['font-style'] = true; // default: normal
|
|
18314
|
-
whiteList['font-synthesis'] = true; // default: weight style
|
|
18315
|
-
whiteList['font-variant'] = true; // default: normal
|
|
18316
|
-
whiteList['font-variant-alternates'] = true; // default: normal
|
|
18317
|
-
whiteList['font-variant-caps'] = true; // default: normal
|
|
18318
|
-
whiteList['font-variant-east-asian'] = true; // default: normal
|
|
18319
|
-
whiteList['font-variant-ligatures'] = true; // default: normal
|
|
18320
|
-
whiteList['font-variant-numeric'] = true; // default: normal
|
|
18321
|
-
whiteList['font-variant-position'] = true; // default: normal
|
|
18322
|
-
whiteList['font-weight'] = true; // default: normal
|
|
18323
|
-
whiteList['grid'] = false; // default: depending on individual properties
|
|
18324
|
-
whiteList['grid-area'] = false; // default: depending on individual properties
|
|
18325
|
-
whiteList['grid-auto-columns'] = false; // default: auto
|
|
18326
|
-
whiteList['grid-auto-flow'] = false; // default: none
|
|
18327
|
-
whiteList['grid-auto-rows'] = false; // default: auto
|
|
18328
|
-
whiteList['grid-column'] = false; // default: depending on individual properties
|
|
18329
|
-
whiteList['grid-column-end'] = false; // default: auto
|
|
18330
|
-
whiteList['grid-column-start'] = false; // default: auto
|
|
18331
|
-
whiteList['grid-row'] = false; // default: depending on individual properties
|
|
18332
|
-
whiteList['grid-row-end'] = false; // default: auto
|
|
18333
|
-
whiteList['grid-row-start'] = false; // default: auto
|
|
18334
|
-
whiteList['grid-template'] = false; // default: depending on individual properties
|
|
18335
|
-
whiteList['grid-template-areas'] = false; // default: none
|
|
18336
|
-
whiteList['grid-template-columns'] = false; // default: none
|
|
18337
|
-
whiteList['grid-template-rows'] = false; // default: none
|
|
18338
|
-
whiteList['hanging-punctuation'] = false; // default: none
|
|
18339
|
-
whiteList['height'] = true; // default: auto
|
|
18340
|
-
whiteList['hyphens'] = false; // default: manual
|
|
18341
|
-
whiteList['icon'] = false; // default: auto
|
|
18342
|
-
whiteList['image-orientation'] = false; // default: auto
|
|
18343
|
-
whiteList['image-resolution'] = false; // default: normal
|
|
18344
|
-
whiteList['ime-mode'] = false; // default: auto
|
|
18345
|
-
whiteList['initial-letters'] = false; // default: normal
|
|
18346
|
-
whiteList['inline-box-align'] = false; // default: last
|
|
18347
|
-
whiteList['justify-content'] = false; // default: auto
|
|
18348
|
-
whiteList['justify-items'] = false; // default: auto
|
|
18349
|
-
whiteList['justify-self'] = false; // default: auto
|
|
18350
|
-
whiteList['left'] = false; // default: auto
|
|
18351
|
-
whiteList['letter-spacing'] = true; // default: normal
|
|
18352
|
-
whiteList['lighting-color'] = true; // default: white
|
|
18353
|
-
whiteList['line-box-contain'] = false; // default: block inline replaced
|
|
18354
|
-
whiteList['line-break'] = false; // default: auto
|
|
18355
|
-
whiteList['line-grid'] = false; // default: match-parent
|
|
18356
|
-
whiteList['line-height'] = false; // default: normal
|
|
18357
|
-
whiteList['line-snap'] = false; // default: none
|
|
18358
|
-
whiteList['line-stacking'] = false; // default: depending on individual properties
|
|
18359
|
-
whiteList['line-stacking-ruby'] = false; // default: exclude-ruby
|
|
18360
|
-
whiteList['line-stacking-shift'] = false; // default: consider-shifts
|
|
18361
|
-
whiteList['line-stacking-strategy'] = false; // default: inline-line-height
|
|
18362
|
-
whiteList['list-style'] = true; // default: depending on individual properties
|
|
18363
|
-
whiteList['list-style-image'] = true; // default: none
|
|
18364
|
-
whiteList['list-style-position'] = true; // default: outside
|
|
18365
|
-
whiteList['list-style-type'] = true; // default: disc
|
|
18366
|
-
whiteList['margin'] = true; // default: depending on individual properties
|
|
18367
|
-
whiteList['margin-bottom'] = true; // default: 0
|
|
18368
|
-
whiteList['margin-left'] = true; // default: 0
|
|
18369
|
-
whiteList['margin-right'] = true; // default: 0
|
|
18370
|
-
whiteList['margin-top'] = true; // default: 0
|
|
18371
|
-
whiteList['marker-offset'] = false; // default: auto
|
|
18372
|
-
whiteList['marker-side'] = false; // default: list-item
|
|
18373
|
-
whiteList['marks'] = false; // default: none
|
|
18374
|
-
whiteList['mask'] = false; // default: border-box
|
|
18375
|
-
whiteList['mask-box'] = false; // default: see individual properties
|
|
18376
|
-
whiteList['mask-box-outset'] = false; // default: 0
|
|
18377
|
-
whiteList['mask-box-repeat'] = false; // default: stretch
|
|
18378
|
-
whiteList['mask-box-slice'] = false; // default: 0 fill
|
|
18379
|
-
whiteList['mask-box-source'] = false; // default: none
|
|
18380
|
-
whiteList['mask-box-width'] = false; // default: auto
|
|
18381
|
-
whiteList['mask-clip'] = false; // default: border-box
|
|
18382
|
-
whiteList['mask-image'] = false; // default: none
|
|
18383
|
-
whiteList['mask-origin'] = false; // default: border-box
|
|
18384
|
-
whiteList['mask-position'] = false; // default: center
|
|
18385
|
-
whiteList['mask-repeat'] = false; // default: no-repeat
|
|
18386
|
-
whiteList['mask-size'] = false; // default: border-box
|
|
18387
|
-
whiteList['mask-source-type'] = false; // default: auto
|
|
18388
|
-
whiteList['mask-type'] = false; // default: luminance
|
|
18389
|
-
whiteList['max-height'] = true; // default: none
|
|
18390
|
-
whiteList['max-lines'] = false; // default: none
|
|
18391
|
-
whiteList['max-width'] = true; // default: none
|
|
18392
|
-
whiteList['min-height'] = true; // default: 0
|
|
18393
|
-
whiteList['min-width'] = true; // default: 0
|
|
18394
|
-
whiteList['move-to'] = false; // default: normal
|
|
18395
|
-
whiteList['nav-down'] = false; // default: auto
|
|
18396
|
-
whiteList['nav-index'] = false; // default: auto
|
|
18397
|
-
whiteList['nav-left'] = false; // default: auto
|
|
18398
|
-
whiteList['nav-right'] = false; // default: auto
|
|
18399
|
-
whiteList['nav-up'] = false; // default: auto
|
|
18400
|
-
whiteList['object-fit'] = false; // default: fill
|
|
18401
|
-
whiteList['object-position'] = false; // default: 50% 50%
|
|
18402
|
-
whiteList['opacity'] = false; // default: 1
|
|
18403
|
-
whiteList['order'] = false; // default: 0
|
|
18404
|
-
whiteList['orphans'] = false; // default: 2
|
|
18405
|
-
whiteList['outline'] = false; // default: depending on individual properties
|
|
18406
|
-
whiteList['outline-color'] = false; // default: invert
|
|
18407
|
-
whiteList['outline-offset'] = false; // default: 0
|
|
18408
|
-
whiteList['outline-style'] = false; // default: none
|
|
18409
|
-
whiteList['outline-width'] = false; // default: medium
|
|
18410
|
-
whiteList['overflow'] = false; // default: depending on individual properties
|
|
18411
|
-
whiteList['overflow-wrap'] = false; // default: normal
|
|
18412
|
-
whiteList['overflow-x'] = false; // default: visible
|
|
18413
|
-
whiteList['overflow-y'] = false; // default: visible
|
|
18414
|
-
whiteList['padding'] = true; // default: depending on individual properties
|
|
18415
|
-
whiteList['padding-bottom'] = true; // default: 0
|
|
18416
|
-
whiteList['padding-left'] = true; // default: 0
|
|
18417
|
-
whiteList['padding-right'] = true; // default: 0
|
|
18418
|
-
whiteList['padding-top'] = true; // default: 0
|
|
18419
|
-
whiteList['page'] = false; // default: auto
|
|
18420
|
-
whiteList['page-break-after'] = false; // default: auto
|
|
18421
|
-
whiteList['page-break-before'] = false; // default: auto
|
|
18422
|
-
whiteList['page-break-inside'] = false; // default: auto
|
|
18423
|
-
whiteList['page-policy'] = false; // default: start
|
|
18424
|
-
whiteList['pause'] = false; // default: implementation dependent
|
|
18425
|
-
whiteList['pause-after'] = false; // default: implementation dependent
|
|
18426
|
-
whiteList['pause-before'] = false; // default: implementation dependent
|
|
18427
|
-
whiteList['perspective'] = false; // default: none
|
|
18428
|
-
whiteList['perspective-origin'] = false; // default: 50% 50%
|
|
18429
|
-
whiteList['pitch'] = false; // default: medium
|
|
18430
|
-
whiteList['pitch-range'] = false; // default: 50
|
|
18431
|
-
whiteList['play-during'] = false; // default: auto
|
|
18432
|
-
whiteList['position'] = false; // default: static
|
|
18433
|
-
whiteList['presentation-level'] = false; // default: 0
|
|
18434
|
-
whiteList['quotes'] = false; // default: text
|
|
18435
|
-
whiteList['region-fragment'] = false; // default: auto
|
|
18436
|
-
whiteList['resize'] = false; // default: none
|
|
18437
|
-
whiteList['rest'] = false; // default: depending on individual properties
|
|
18438
|
-
whiteList['rest-after'] = false; // default: none
|
|
18439
|
-
whiteList['rest-before'] = false; // default: none
|
|
18440
|
-
whiteList['richness'] = false; // default: 50
|
|
18441
|
-
whiteList['right'] = false; // default: auto
|
|
18442
|
-
whiteList['rotation'] = false; // default: 0
|
|
18443
|
-
whiteList['rotation-point'] = false; // default: 50% 50%
|
|
18444
|
-
whiteList['ruby-align'] = false; // default: auto
|
|
18445
|
-
whiteList['ruby-merge'] = false; // default: separate
|
|
18446
|
-
whiteList['ruby-position'] = false; // default: before
|
|
18447
|
-
whiteList['shape-image-threshold'] = false; // default: 0.0
|
|
18448
|
-
whiteList['shape-outside'] = false; // default: none
|
|
18449
|
-
whiteList['shape-margin'] = false; // default: 0
|
|
18450
|
-
whiteList['size'] = false; // default: auto
|
|
18451
|
-
whiteList['speak'] = false; // default: auto
|
|
18452
|
-
whiteList['speak-as'] = false; // default: normal
|
|
18453
|
-
whiteList['speak-header'] = false; // default: once
|
|
18454
|
-
whiteList['speak-numeral'] = false; // default: continuous
|
|
18455
|
-
whiteList['speak-punctuation'] = false; // default: none
|
|
18456
|
-
whiteList['speech-rate'] = false; // default: medium
|
|
18457
|
-
whiteList['stress'] = false; // default: 50
|
|
18458
|
-
whiteList['string-set'] = false; // default: none
|
|
18459
|
-
whiteList['tab-size'] = false; // default: 8
|
|
18460
|
-
whiteList['table-layout'] = false; // default: auto
|
|
18461
|
-
whiteList['text-align'] = true; // default: start
|
|
18462
|
-
whiteList['text-align-last'] = true; // default: auto
|
|
18463
|
-
whiteList['text-combine-upright'] = true; // default: none
|
|
18464
|
-
whiteList['text-decoration'] = true; // default: none
|
|
18465
|
-
whiteList['text-decoration-color'] = true; // default: currentColor
|
|
18466
|
-
whiteList['text-decoration-line'] = true; // default: none
|
|
18467
|
-
whiteList['text-decoration-skip'] = true; // default: objects
|
|
18468
|
-
whiteList['text-decoration-style'] = true; // default: solid
|
|
18469
|
-
whiteList['text-emphasis'] = true; // default: depending on individual properties
|
|
18470
|
-
whiteList['text-emphasis-color'] = true; // default: currentColor
|
|
18471
|
-
whiteList['text-emphasis-position'] = true; // default: over right
|
|
18472
|
-
whiteList['text-emphasis-style'] = true; // default: none
|
|
18473
|
-
whiteList['text-height'] = true; // default: auto
|
|
18474
|
-
whiteList['text-indent'] = true; // default: 0
|
|
18475
|
-
whiteList['text-justify'] = true; // default: auto
|
|
18476
|
-
whiteList['text-orientation'] = true; // default: mixed
|
|
18477
|
-
whiteList['text-overflow'] = true; // default: clip
|
|
18478
|
-
whiteList['text-shadow'] = true; // default: none
|
|
18479
|
-
whiteList['text-space-collapse'] = true; // default: collapse
|
|
18480
|
-
whiteList['text-transform'] = true; // default: none
|
|
18481
|
-
whiteList['text-underline-position'] = true; // default: auto
|
|
18482
|
-
whiteList['text-wrap'] = true; // default: normal
|
|
18483
|
-
whiteList['top'] = false; // default: auto
|
|
18484
|
-
whiteList['transform'] = false; // default: none
|
|
18485
|
-
whiteList['transform-origin'] = false; // default: 50% 50% 0
|
|
18486
|
-
whiteList['transform-style'] = false; // default: flat
|
|
18487
|
-
whiteList['transition'] = false; // default: depending on individual properties
|
|
18488
|
-
whiteList['transition-delay'] = false; // default: 0s
|
|
18489
|
-
whiteList['transition-duration'] = false; // default: 0s
|
|
18490
|
-
whiteList['transition-property'] = false; // default: all
|
|
18491
|
-
whiteList['transition-timing-function'] = false; // default: ease
|
|
18492
|
-
whiteList['unicode-bidi'] = false; // default: normal
|
|
18493
|
-
whiteList['vertical-align'] = false; // default: baseline
|
|
18494
|
-
whiteList['visibility'] = false; // default: visible
|
|
18495
|
-
whiteList['voice-balance'] = false; // default: center
|
|
18496
|
-
whiteList['voice-duration'] = false; // default: auto
|
|
18497
|
-
whiteList['voice-family'] = false; // default: implementation dependent
|
|
18498
|
-
whiteList['voice-pitch'] = false; // default: medium
|
|
18499
|
-
whiteList['voice-range'] = false; // default: medium
|
|
18500
|
-
whiteList['voice-rate'] = false; // default: normal
|
|
18501
|
-
whiteList['voice-stress'] = false; // default: normal
|
|
18502
|
-
whiteList['voice-volume'] = false; // default: medium
|
|
18503
|
-
whiteList['volume'] = false; // default: medium
|
|
18504
|
-
whiteList['white-space'] = false; // default: normal
|
|
18505
|
-
whiteList['widows'] = false; // default: 2
|
|
18506
|
-
whiteList['width'] = true; // default: auto
|
|
18507
|
-
whiteList['will-change'] = false; // default: auto
|
|
18508
|
-
whiteList['word-break'] = true; // default: normal
|
|
18509
|
-
whiteList['word-spacing'] = true; // default: normal
|
|
18510
|
-
whiteList['word-wrap'] = true; // default: normal
|
|
18511
|
-
whiteList['wrap-flow'] = false; // default: auto
|
|
18512
|
-
whiteList['wrap-through'] = false; // default: wrap
|
|
18513
|
-
whiteList['writing-mode'] = false; // default: horizontal-tb
|
|
18514
|
-
whiteList['z-index'] = false; // default: auto
|
|
18515
|
-
|
|
18516
|
-
return whiteList;
|
|
18517
|
-
}
|
|
18518
|
-
|
|
18519
|
-
/**
|
|
18520
|
-
* 匹配到白名单上的一个属性时
|
|
18521
|
-
*
|
|
18522
|
-
* @param {String} name
|
|
18523
|
-
* @param {String} value
|
|
18524
|
-
* @param {Object} options
|
|
18525
|
-
* @return {String}
|
|
18526
|
-
*/
|
|
18527
|
-
function onAttr(name, value, options) {
|
|
18528
|
-
// do nothing
|
|
18529
|
-
}
|
|
18530
|
-
|
|
18531
|
-
/**
|
|
18532
|
-
* 匹配到不在白名单上的一个属性时
|
|
18533
|
-
*
|
|
18534
|
-
* @param {String} name
|
|
18535
|
-
* @param {String} value
|
|
18536
|
-
* @param {Object} options
|
|
18537
|
-
* @return {String}
|
|
18538
|
-
*/
|
|
18539
|
-
function onIgnoreAttr(name, value, options) {
|
|
18540
|
-
// do nothing
|
|
18541
|
-
}
|
|
18542
|
-
var REGEXP_URL_JAVASCRIPT = /javascript\s*\:/img;
|
|
18543
|
-
|
|
18544
|
-
/**
|
|
18545
|
-
* 过滤属性值
|
|
18546
|
-
*
|
|
18547
|
-
* @param {String} name
|
|
18548
|
-
* @param {String} value
|
|
18549
|
-
* @return {String}
|
|
18550
|
-
*/
|
|
18551
|
-
function safeAttrValue(name, value) {
|
|
18552
|
-
if (REGEXP_URL_JAVASCRIPT.test(value)) return '';
|
|
18553
|
-
return value;
|
|
18554
|
-
}
|
|
18555
|
-
var whiteList = getDefaultWhiteList();
|
|
18556
|
-
var getDefaultWhiteList_1 = getDefaultWhiteList;
|
|
18557
|
-
var onAttr_1 = onAttr;
|
|
18558
|
-
var onIgnoreAttr_1 = onIgnoreAttr;
|
|
18559
|
-
var safeAttrValue_1 = safeAttrValue;
|
|
18560
|
-
var _default = {
|
|
18561
|
-
whiteList: whiteList,
|
|
18562
|
-
getDefaultWhiteList: getDefaultWhiteList_1,
|
|
18563
|
-
onAttr: onAttr_1,
|
|
18564
|
-
onIgnoreAttr: onIgnoreAttr_1,
|
|
18565
|
-
safeAttrValue: safeAttrValue_1
|
|
18566
|
-
};
|
|
18567
|
-
|
|
18568
|
-
var util = {
|
|
18569
|
-
indexOf: function indexOf(arr, item) {
|
|
18570
|
-
var i, j;
|
|
18571
|
-
if (Array.prototype.indexOf) {
|
|
18572
|
-
return arr.indexOf(item);
|
|
18573
|
-
}
|
|
18574
|
-
for (i = 0, j = arr.length; i < j; i++) {
|
|
18575
|
-
if (arr[i] === item) {
|
|
18576
|
-
return i;
|
|
18577
|
-
}
|
|
18578
|
-
}
|
|
18579
|
-
return -1;
|
|
18580
|
-
},
|
|
18581
|
-
forEach: function forEach(arr, fn, scope) {
|
|
18582
|
-
var i, j;
|
|
18583
|
-
if (Array.prototype.forEach) {
|
|
18584
|
-
return arr.forEach(fn, scope);
|
|
18585
|
-
}
|
|
18586
|
-
for (i = 0, j = arr.length; i < j; i++) {
|
|
18587
|
-
fn.call(scope, arr[i], i, arr);
|
|
18588
|
-
}
|
|
18589
|
-
},
|
|
18590
|
-
trim: function trim(str) {
|
|
18591
|
-
if (String.prototype.trim) {
|
|
18592
|
-
return str.trim();
|
|
18593
|
-
}
|
|
18594
|
-
return str.replace(/(^\s*)|(\s*$)/g, '');
|
|
18595
|
-
},
|
|
18596
|
-
trimRight: function trimRight(str) {
|
|
18597
|
-
if (String.prototype.trimRight) {
|
|
18598
|
-
return str.trimRight();
|
|
18599
|
-
}
|
|
18600
|
-
return str.replace(/(\s*$)/g, '');
|
|
18601
|
-
}
|
|
18602
|
-
};
|
|
18603
|
-
|
|
18604
|
-
/**
|
|
18605
|
-
* cssfilter
|
|
18606
|
-
*
|
|
18607
|
-
* @author 老雷<leizongmin@gmail.com>
|
|
18608
|
-
*/
|
|
18609
|
-
|
|
18610
|
-
/**
|
|
18611
|
-
* 解析style
|
|
18612
|
-
*
|
|
18613
|
-
* @param {String} css
|
|
18614
|
-
* @param {Function} onAttr 处理属性的函数
|
|
18615
|
-
* 参数格式: function (sourcePosition, position, name, value, source)
|
|
18616
|
-
* @return {String}
|
|
18617
|
-
*/
|
|
18618
|
-
function parseStyle(css, onAttr) {
|
|
18619
|
-
css = util.trimRight(css);
|
|
18620
|
-
if (css[css.length - 1] !== ';') css += ';';
|
|
18621
|
-
var cssLength = css.length;
|
|
18622
|
-
var isParenthesisOpen = false;
|
|
18623
|
-
var lastPos = 0;
|
|
18624
|
-
var i = 0;
|
|
18625
|
-
var retCSS = '';
|
|
18626
|
-
function addNewAttr() {
|
|
18627
|
-
// 如果没有正常的闭合圆括号,则直接忽略当前属性
|
|
18628
|
-
if (!isParenthesisOpen) {
|
|
18629
|
-
var source = util.trim(css.slice(lastPos, i));
|
|
18630
|
-
var j = source.indexOf(':');
|
|
18631
|
-
if (j !== -1) {
|
|
18632
|
-
var name = util.trim(source.slice(0, j));
|
|
18633
|
-
var value = util.trim(source.slice(j + 1));
|
|
18634
|
-
// 必须有属性名称
|
|
18635
|
-
if (name) {
|
|
18636
|
-
var ret = onAttr(lastPos, retCSS.length, name, value, source);
|
|
18637
|
-
if (ret) retCSS += ret + '; ';
|
|
18638
|
-
}
|
|
18639
|
-
}
|
|
18640
|
-
}
|
|
18641
|
-
lastPos = i + 1;
|
|
18642
|
-
}
|
|
18643
|
-
for (; i < cssLength; i++) {
|
|
18644
|
-
var c = css[i];
|
|
18645
|
-
if (c === '/' && css[i + 1] === '*') {
|
|
18646
|
-
// 备注开始
|
|
18647
|
-
var j = css.indexOf('*/', i + 2);
|
|
18648
|
-
// 如果没有正常的备注结束,则后面的部分全部跳过
|
|
18649
|
-
if (j === -1) break;
|
|
18650
|
-
// 直接将当前位置调到备注结尾,并且初始化状态
|
|
18651
|
-
i = j + 1;
|
|
18652
|
-
lastPos = i + 1;
|
|
18653
|
-
isParenthesisOpen = false;
|
|
18654
|
-
} else if (c === '(') {
|
|
18655
|
-
isParenthesisOpen = true;
|
|
18656
|
-
} else if (c === ')') {
|
|
18657
|
-
isParenthesisOpen = false;
|
|
18658
|
-
} else if (c === ';') {
|
|
18659
|
-
if (isParenthesisOpen) ; else {
|
|
18660
|
-
addNewAttr();
|
|
18661
|
-
}
|
|
18662
|
-
} else if (c === '\n') {
|
|
18663
|
-
addNewAttr();
|
|
18664
|
-
}
|
|
18665
|
-
}
|
|
18666
|
-
return util.trim(retCSS);
|
|
18667
|
-
}
|
|
18668
|
-
var parser = parseStyle;
|
|
18669
|
-
|
|
18670
|
-
/**
|
|
18671
|
-
* cssfilter
|
|
18672
|
-
*
|
|
18673
|
-
* @author 老雷<leizongmin@gmail.com>
|
|
18674
|
-
*/
|
|
18675
|
-
|
|
18676
|
-
/**
|
|
18677
|
-
* 返回值是否为空
|
|
18678
|
-
*
|
|
18679
|
-
* @param {Object} obj
|
|
18680
|
-
* @return {Boolean}
|
|
18681
|
-
*/
|
|
18682
|
-
function isNull(obj) {
|
|
18683
|
-
return obj === undefined || obj === null;
|
|
18684
|
-
}
|
|
18685
|
-
|
|
18686
|
-
/**
|
|
18687
|
-
* 浅拷贝对象
|
|
18688
|
-
*
|
|
18689
|
-
* @param {Object} obj
|
|
18690
|
-
* @return {Object}
|
|
18691
|
-
*/
|
|
18692
|
-
function shallowCopyObject(obj) {
|
|
18693
|
-
var ret = {};
|
|
18694
|
-
for (var i in obj) {
|
|
18695
|
-
ret[i] = obj[i];
|
|
18696
|
-
}
|
|
18697
|
-
return ret;
|
|
18698
|
-
}
|
|
18699
|
-
|
|
18700
|
-
/**
|
|
18701
|
-
* 创建CSS过滤器
|
|
18702
|
-
*
|
|
18703
|
-
* @param {Object} options
|
|
18704
|
-
* - {Object} whiteList
|
|
18705
|
-
* - {Function} onAttr
|
|
18706
|
-
* - {Function} onIgnoreAttr
|
|
18707
|
-
* - {Function} safeAttrValue
|
|
18708
|
-
*/
|
|
18709
|
-
function FilterCSS(options) {
|
|
18710
|
-
options = shallowCopyObject(options || {});
|
|
18711
|
-
options.whiteList = options.whiteList || _default.whiteList;
|
|
18712
|
-
options.onAttr = options.onAttr || _default.onAttr;
|
|
18713
|
-
options.onIgnoreAttr = options.onIgnoreAttr || _default.onIgnoreAttr;
|
|
18714
|
-
options.safeAttrValue = options.safeAttrValue || _default.safeAttrValue;
|
|
18715
|
-
this.options = options;
|
|
18716
|
-
}
|
|
18717
|
-
FilterCSS.prototype.process = function (css) {
|
|
18718
|
-
// 兼容各种奇葩输入
|
|
18719
|
-
css = css || '';
|
|
18720
|
-
css = css.toString();
|
|
18721
|
-
if (!css) return '';
|
|
18722
|
-
var me = this;
|
|
18723
|
-
var options = me.options;
|
|
18724
|
-
var whiteList = options.whiteList;
|
|
18725
|
-
var onAttr = options.onAttr;
|
|
18726
|
-
var onIgnoreAttr = options.onIgnoreAttr;
|
|
18727
|
-
var safeAttrValue = options.safeAttrValue;
|
|
18728
|
-
var retCSS = parser(css, function (sourcePosition, position, name, value, source) {
|
|
18729
|
-
var check = whiteList[name];
|
|
18730
|
-
var isWhite = false;
|
|
18731
|
-
if (check === true) isWhite = check;else if (typeof check === 'function') isWhite = check(value);else if (check instanceof RegExp) isWhite = check.test(value);
|
|
18732
|
-
if (isWhite !== true) isWhite = false;
|
|
18733
|
-
|
|
18734
|
-
// 如果过滤后 value 为空则直接忽略
|
|
18735
|
-
value = safeAttrValue(name, value);
|
|
18736
|
-
if (!value) return;
|
|
18737
|
-
var opts = {
|
|
18738
|
-
position: position,
|
|
18739
|
-
sourcePosition: sourcePosition,
|
|
18740
|
-
source: source,
|
|
18741
|
-
isWhite: isWhite
|
|
18742
|
-
};
|
|
18743
|
-
if (isWhite) {
|
|
18744
|
-
var ret = onAttr(name, value, opts);
|
|
18745
|
-
if (isNull(ret)) {
|
|
18746
|
-
return name + ':' + value;
|
|
18747
|
-
} else {
|
|
18748
|
-
return ret;
|
|
18749
|
-
}
|
|
18750
|
-
} else {
|
|
18751
|
-
var ret = onIgnoreAttr(name, value, opts);
|
|
18752
|
-
if (!isNull(ret)) {
|
|
18753
|
-
return ret;
|
|
18754
|
-
}
|
|
18755
|
-
}
|
|
18756
|
-
});
|
|
18757
|
-
return retCSS;
|
|
18758
|
-
};
|
|
18759
|
-
var css$1 = FilterCSS;
|
|
18760
|
-
|
|
18761
|
-
var lib$1 = createCommonjsModule(function (module, exports) {
|
|
18762
|
-
/**
|
|
18763
|
-
* cssfilter
|
|
18764
|
-
*
|
|
18765
|
-
* @author 老雷<leizongmin@gmail.com>
|
|
18766
|
-
*/
|
|
18767
|
-
|
|
18768
|
-
/**
|
|
18769
|
-
* XSS过滤
|
|
18770
|
-
*
|
|
18771
|
-
* @param {String} css 要过滤的CSS代码
|
|
18772
|
-
* @param {Object} options 选项:whiteList, onAttr, onIgnoreAttr
|
|
18773
|
-
* @return {String}
|
|
18774
|
-
*/
|
|
18775
|
-
function filterCSS(html, options) {
|
|
18776
|
-
var xss = new css$1(options);
|
|
18777
|
-
return xss.process(html);
|
|
18778
|
-
}
|
|
18779
|
-
|
|
18780
|
-
// 输出
|
|
18781
|
-
exports = module.exports = filterCSS;
|
|
18782
|
-
exports.FilterCSS = css$1;
|
|
18783
|
-
for (var i in _default) exports[i] = _default[i];
|
|
18784
|
-
|
|
18785
|
-
// 在浏览器端使用
|
|
18786
|
-
if (typeof window !== 'undefined') {
|
|
18787
|
-
window.filterCSS = module.exports;
|
|
18788
|
-
}
|
|
18789
|
-
});
|
|
18790
|
-
var lib_1$1 = lib$1.FilterCSS;
|
|
18791
|
-
|
|
18792
|
-
var util$1 = {
|
|
18793
|
-
indexOf: function indexOf(arr, item) {
|
|
18794
|
-
var i, j;
|
|
18795
|
-
if (Array.prototype.indexOf) {
|
|
18796
|
-
return arr.indexOf(item);
|
|
18797
|
-
}
|
|
18798
|
-
for (i = 0, j = arr.length; i < j; i++) {
|
|
18799
|
-
if (arr[i] === item) {
|
|
18800
|
-
return i;
|
|
18801
|
-
}
|
|
18802
|
-
}
|
|
18803
|
-
return -1;
|
|
18804
|
-
},
|
|
18805
|
-
forEach: function forEach(arr, fn, scope) {
|
|
18806
|
-
var i, j;
|
|
18807
|
-
if (Array.prototype.forEach) {
|
|
18808
|
-
return arr.forEach(fn, scope);
|
|
18809
|
-
}
|
|
18810
|
-
for (i = 0, j = arr.length; i < j; i++) {
|
|
18811
|
-
fn.call(scope, arr[i], i, arr);
|
|
18812
|
-
}
|
|
18813
|
-
},
|
|
18814
|
-
trim: function trim(str) {
|
|
18815
|
-
if (String.prototype.trim) {
|
|
18816
|
-
return str.trim();
|
|
18817
|
-
}
|
|
18818
|
-
return str.replace(/(^\s*)|(\s*$)/g, "");
|
|
18819
|
-
},
|
|
18820
|
-
spaceIndex: function spaceIndex(str) {
|
|
18821
|
-
var reg = /\s|\n|\t/;
|
|
18822
|
-
var match = reg.exec(str);
|
|
18823
|
-
return match ? match.index : -1;
|
|
18824
|
-
}
|
|
18825
|
-
};
|
|
18826
|
-
|
|
18827
|
-
/**
|
|
18828
|
-
* default settings
|
|
18829
|
-
*
|
|
18830
|
-
* @author Zongmin Lei<leizongmin@gmail.com>
|
|
18831
|
-
*/
|
|
18832
|
-
|
|
18833
|
-
var FilterCSS$1 = lib$1.FilterCSS;
|
|
18834
|
-
var getDefaultCSSWhiteList = lib$1.getDefaultWhiteList;
|
|
18835
|
-
function getDefaultWhiteList$1() {
|
|
18836
|
-
return {
|
|
18837
|
-
a: ["target", "href", "title"],
|
|
18838
|
-
abbr: ["title"],
|
|
18839
|
-
address: [],
|
|
18840
|
-
area: ["shape", "coords", "href", "alt"],
|
|
18841
|
-
article: [],
|
|
18842
|
-
aside: [],
|
|
18843
|
-
audio: ["autoplay", "controls", "crossorigin", "loop", "muted", "preload", "src"],
|
|
18844
|
-
b: [],
|
|
18845
|
-
bdi: ["dir"],
|
|
18846
|
-
bdo: ["dir"],
|
|
18847
|
-
big: [],
|
|
18848
|
-
blockquote: ["cite"],
|
|
18849
|
-
br: [],
|
|
18850
|
-
caption: [],
|
|
18851
|
-
center: [],
|
|
18852
|
-
cite: [],
|
|
18853
|
-
code: [],
|
|
18854
|
-
col: ["align", "valign", "span", "width"],
|
|
18855
|
-
colgroup: ["align", "valign", "span", "width"],
|
|
18856
|
-
dd: [],
|
|
18857
|
-
del: ["datetime"],
|
|
18858
|
-
details: ["open"],
|
|
18859
|
-
div: [],
|
|
18860
|
-
dl: [],
|
|
18861
|
-
dt: [],
|
|
18862
|
-
em: [],
|
|
18863
|
-
figcaption: [],
|
|
18864
|
-
figure: [],
|
|
18865
|
-
font: ["color", "size", "face"],
|
|
18866
|
-
footer: [],
|
|
18867
|
-
h1: [],
|
|
18868
|
-
h2: [],
|
|
18869
|
-
h3: [],
|
|
18870
|
-
h4: [],
|
|
18871
|
-
h5: [],
|
|
18872
|
-
h6: [],
|
|
18873
|
-
header: [],
|
|
18874
|
-
hr: [],
|
|
18875
|
-
i: [],
|
|
18876
|
-
img: ["src", "alt", "title", "width", "height"],
|
|
18877
|
-
ins: ["datetime"],
|
|
18878
|
-
li: [],
|
|
18879
|
-
mark: [],
|
|
18880
|
-
nav: [],
|
|
18881
|
-
ol: [],
|
|
18882
|
-
p: [],
|
|
18883
|
-
pre: [],
|
|
18884
|
-
s: [],
|
|
18885
|
-
section: [],
|
|
18886
|
-
small: [],
|
|
18887
|
-
span: [],
|
|
18888
|
-
sub: [],
|
|
18889
|
-
summary: [],
|
|
18890
|
-
sup: [],
|
|
18891
|
-
strong: [],
|
|
18892
|
-
strike: [],
|
|
18893
|
-
table: ["width", "border", "align", "valign"],
|
|
18894
|
-
tbody: ["align", "valign"],
|
|
18895
|
-
td: ["width", "rowspan", "colspan", "align", "valign"],
|
|
18896
|
-
tfoot: ["align", "valign"],
|
|
18897
|
-
th: ["width", "rowspan", "colspan", "align", "valign"],
|
|
18898
|
-
thead: ["align", "valign"],
|
|
18899
|
-
tr: ["rowspan", "align", "valign"],
|
|
18900
|
-
tt: [],
|
|
18901
|
-
u: [],
|
|
18902
|
-
ul: [],
|
|
18903
|
-
video: ["autoplay", "controls", "crossorigin", "loop", "muted", "playsinline", "poster", "preload", "src", "height", "width"]
|
|
18904
|
-
};
|
|
18905
|
-
}
|
|
18906
|
-
var defaultCSSFilter = new FilterCSS$1();
|
|
18907
|
-
|
|
18908
|
-
/**
|
|
18909
|
-
* default onTag function
|
|
18910
|
-
*
|
|
18911
|
-
* @param {String} tag
|
|
18912
|
-
* @param {String} html
|
|
18913
|
-
* @param {Object} options
|
|
18914
|
-
* @return {String}
|
|
18915
|
-
*/
|
|
18916
|
-
function onTag(tag, html, options) {
|
|
18917
|
-
// do nothing
|
|
18918
|
-
}
|
|
18919
|
-
|
|
18920
|
-
/**
|
|
18921
|
-
* default onIgnoreTag function
|
|
18922
|
-
*
|
|
18923
|
-
* @param {String} tag
|
|
18924
|
-
* @param {String} html
|
|
18925
|
-
* @param {Object} options
|
|
18926
|
-
* @return {String}
|
|
18927
|
-
*/
|
|
18928
|
-
function onIgnoreTag(tag, html, options) {
|
|
18929
|
-
// do nothing
|
|
18930
|
-
}
|
|
18931
|
-
|
|
18932
|
-
/**
|
|
18933
|
-
* default onTagAttr function
|
|
18934
|
-
*
|
|
18935
|
-
* @param {String} tag
|
|
18936
|
-
* @param {String} name
|
|
18937
|
-
* @param {String} value
|
|
18938
|
-
* @return {String}
|
|
18939
|
-
*/
|
|
18940
|
-
function onTagAttr(tag, name, value) {
|
|
18941
|
-
// do nothing
|
|
18942
|
-
}
|
|
18943
|
-
|
|
18944
|
-
/**
|
|
18945
|
-
* default onIgnoreTagAttr function
|
|
18946
|
-
*
|
|
18947
|
-
* @param {String} tag
|
|
18948
|
-
* @param {String} name
|
|
18949
|
-
* @param {String} value
|
|
18950
|
-
* @return {String}
|
|
18951
|
-
*/
|
|
18952
|
-
function onIgnoreTagAttr(tag, name, value) {
|
|
18953
|
-
// do nothing
|
|
18954
|
-
}
|
|
18955
|
-
|
|
18956
|
-
/**
|
|
18957
|
-
* default escapeHtml function
|
|
18958
|
-
*
|
|
18959
|
-
* @param {String} html
|
|
18960
|
-
*/
|
|
18961
|
-
function escapeHtml(html) {
|
|
18962
|
-
return html.replace(REGEXP_LT, "<").replace(REGEXP_GT, ">");
|
|
18963
|
-
}
|
|
18964
|
-
|
|
18965
|
-
/**
|
|
18966
|
-
* default safeAttrValue function
|
|
18967
|
-
*
|
|
18968
|
-
* @param {String} tag
|
|
18969
|
-
* @param {String} name
|
|
18970
|
-
* @param {String} value
|
|
18971
|
-
* @param {Object} cssFilter
|
|
18972
|
-
* @return {String}
|
|
18973
|
-
*/
|
|
18974
|
-
function safeAttrValue$1(tag, name, value, cssFilter) {
|
|
18975
|
-
// unescape attribute value firstly
|
|
18976
|
-
value = friendlyAttrValue(value);
|
|
18977
|
-
if (name === "href" || name === "src") {
|
|
18978
|
-
// filter `href` and `src` attribute
|
|
18979
|
-
// only allow the value that starts with `http://` | `https://` | `mailto:` | `/` | `#`
|
|
18980
|
-
value = util$1.trim(value);
|
|
18981
|
-
if (value === "#") return "#";
|
|
18982
|
-
if (!(value.substr(0, 7) === "http://" || value.substr(0, 8) === "https://" || value.substr(0, 7) === "mailto:" || value.substr(0, 4) === "tel:" || value.substr(0, 11) === "data:image/" || value.substr(0, 6) === "ftp://" || value.substr(0, 2) === "./" || value.substr(0, 3) === "../" || value[0] === "#" || value[0] === "/")) {
|
|
18983
|
-
return "";
|
|
18984
|
-
}
|
|
18985
|
-
} else if (name === "background") {
|
|
18986
|
-
// filter `background` attribute (maybe no use)
|
|
18987
|
-
// `javascript:`
|
|
18988
|
-
REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;
|
|
18989
|
-
if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) {
|
|
18990
|
-
return "";
|
|
18991
|
-
}
|
|
18992
|
-
} else if (name === "style") {
|
|
18993
|
-
// `expression()`
|
|
18994
|
-
REGEXP_DEFAULT_ON_TAG_ATTR_7.lastIndex = 0;
|
|
18995
|
-
if (REGEXP_DEFAULT_ON_TAG_ATTR_7.test(value)) {
|
|
18996
|
-
return "";
|
|
18997
|
-
}
|
|
18998
|
-
// `url()`
|
|
18999
|
-
REGEXP_DEFAULT_ON_TAG_ATTR_8.lastIndex = 0;
|
|
19000
|
-
if (REGEXP_DEFAULT_ON_TAG_ATTR_8.test(value)) {
|
|
19001
|
-
REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;
|
|
19002
|
-
if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) {
|
|
19003
|
-
return "";
|
|
19004
|
-
}
|
|
19005
|
-
}
|
|
19006
|
-
if (cssFilter !== false) {
|
|
19007
|
-
cssFilter = cssFilter || defaultCSSFilter;
|
|
19008
|
-
value = cssFilter.process(value);
|
|
19009
|
-
}
|
|
19010
|
-
}
|
|
19011
|
-
|
|
19012
|
-
// escape `<>"` before returns
|
|
19013
|
-
value = escapeAttrValue(value);
|
|
19014
|
-
return value;
|
|
19015
|
-
}
|
|
19016
|
-
|
|
19017
|
-
// RegExp list
|
|
19018
|
-
var REGEXP_LT = /</g;
|
|
19019
|
-
var REGEXP_GT = />/g;
|
|
19020
|
-
var REGEXP_QUOTE = /"/g;
|
|
19021
|
-
var REGEXP_QUOTE_2 = /"/g;
|
|
19022
|
-
var REGEXP_ATTR_VALUE_1 = /&#([a-zA-Z0-9]*);?/gim;
|
|
19023
|
-
var REGEXP_ATTR_VALUE_COLON = /:?/gim;
|
|
19024
|
-
var REGEXP_ATTR_VALUE_NEWLINE = /&newline;?/gim;
|
|
19025
|
-
// var REGEXP_DEFAULT_ON_TAG_ATTR_3 = /\/\*|\*\//gm;
|
|
19026
|
-
var REGEXP_DEFAULT_ON_TAG_ATTR_4 = /((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi;
|
|
19027
|
-
// var REGEXP_DEFAULT_ON_TAG_ATTR_5 = /^[\s"'`]*(d\s*a\s*t\s*a\s*)\:/gi;
|
|
19028
|
-
// var REGEXP_DEFAULT_ON_TAG_ATTR_6 = /^[\s"'`]*(d\s*a\s*t\s*a\s*)\:\s*image\//gi;
|
|
19029
|
-
var REGEXP_DEFAULT_ON_TAG_ATTR_7 = /e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi;
|
|
19030
|
-
var REGEXP_DEFAULT_ON_TAG_ATTR_8 = /u\s*r\s*l\s*\(.*/gi;
|
|
19031
|
-
|
|
19032
|
-
/**
|
|
19033
|
-
* escape double quote
|
|
19034
|
-
*
|
|
19035
|
-
* @param {String} str
|
|
19036
|
-
* @return {String} str
|
|
19037
|
-
*/
|
|
19038
|
-
function escapeQuote(str) {
|
|
19039
|
-
return str.replace(REGEXP_QUOTE, """);
|
|
19040
|
-
}
|
|
19041
|
-
|
|
19042
|
-
/**
|
|
19043
|
-
* unescape double quote
|
|
19044
|
-
*
|
|
19045
|
-
* @param {String} str
|
|
19046
|
-
* @return {String} str
|
|
19047
|
-
*/
|
|
19048
|
-
function unescapeQuote(str) {
|
|
19049
|
-
return str.replace(REGEXP_QUOTE_2, '"');
|
|
19050
|
-
}
|
|
19051
|
-
|
|
19052
|
-
/**
|
|
19053
|
-
* escape html entities
|
|
19054
|
-
*
|
|
19055
|
-
* @param {String} str
|
|
19056
|
-
* @return {String}
|
|
19057
|
-
*/
|
|
19058
|
-
function escapeHtmlEntities(str) {
|
|
19059
|
-
return str.replace(REGEXP_ATTR_VALUE_1, function replaceUnicode(str, code) {
|
|
19060
|
-
return code[0] === "x" || code[0] === "X" ? String.fromCharCode(parseInt(code.substr(1), 16)) : String.fromCharCode(parseInt(code, 10));
|
|
19061
|
-
});
|
|
19062
|
-
}
|
|
19063
|
-
|
|
19064
|
-
/**
|
|
19065
|
-
* escape html5 new danger entities
|
|
19066
|
-
*
|
|
19067
|
-
* @param {String} str
|
|
19068
|
-
* @return {String}
|
|
19069
|
-
*/
|
|
19070
|
-
function escapeDangerHtml5Entities(str) {
|
|
19071
|
-
return str.replace(REGEXP_ATTR_VALUE_COLON, ":").replace(REGEXP_ATTR_VALUE_NEWLINE, " ");
|
|
19072
|
-
}
|
|
19073
|
-
|
|
19074
|
-
/**
|
|
19075
|
-
* clear nonprintable characters
|
|
19076
|
-
*
|
|
19077
|
-
* @param {String} str
|
|
19078
|
-
* @return {String}
|
|
19079
|
-
*/
|
|
19080
|
-
function clearNonPrintableCharacter(str) {
|
|
19081
|
-
var str2 = "";
|
|
19082
|
-
for (var i = 0, len = str.length; i < len; i++) {
|
|
19083
|
-
str2 += str.charCodeAt(i) < 32 ? " " : str.charAt(i);
|
|
19084
|
-
}
|
|
19085
|
-
return util$1.trim(str2);
|
|
19086
|
-
}
|
|
19087
|
-
|
|
19088
|
-
/**
|
|
19089
|
-
* get friendly attribute value
|
|
19090
|
-
*
|
|
19091
|
-
* @param {String} str
|
|
19092
|
-
* @return {String}
|
|
19093
|
-
*/
|
|
19094
|
-
function friendlyAttrValue(str) {
|
|
19095
|
-
str = unescapeQuote(str);
|
|
19096
|
-
str = escapeHtmlEntities(str);
|
|
19097
|
-
str = escapeDangerHtml5Entities(str);
|
|
19098
|
-
str = clearNonPrintableCharacter(str);
|
|
19099
|
-
return str;
|
|
19100
|
-
}
|
|
19101
|
-
|
|
19102
|
-
/**
|
|
19103
|
-
* unescape attribute value
|
|
19104
|
-
*
|
|
19105
|
-
* @param {String} str
|
|
19106
|
-
* @return {String}
|
|
19107
|
-
*/
|
|
19108
|
-
function escapeAttrValue(str) {
|
|
19109
|
-
str = escapeQuote(str);
|
|
19110
|
-
str = escapeHtml(str);
|
|
19111
|
-
return str;
|
|
19112
|
-
}
|
|
19113
|
-
|
|
19114
|
-
/**
|
|
19115
|
-
* `onIgnoreTag` function for removing all the tags that are not in whitelist
|
|
19116
|
-
*/
|
|
19117
|
-
function onIgnoreTagStripAll() {
|
|
19118
|
-
return "";
|
|
19119
|
-
}
|
|
19120
|
-
|
|
19121
|
-
/**
|
|
19122
|
-
* remove tag body
|
|
19123
|
-
* specify a `tags` list, if the tag is not in the `tags` list then process by the specify function (optional)
|
|
19124
|
-
*
|
|
19125
|
-
* @param {array} tags
|
|
19126
|
-
* @param {function} next
|
|
19127
|
-
*/
|
|
19128
|
-
function StripTagBody(tags, next) {
|
|
19129
|
-
if (typeof next !== "function") {
|
|
19130
|
-
next = function next() {};
|
|
19131
|
-
}
|
|
19132
|
-
var isRemoveAllTag = !Array.isArray(tags);
|
|
19133
|
-
function isRemoveTag(tag) {
|
|
19134
|
-
if (isRemoveAllTag) return true;
|
|
19135
|
-
return util$1.indexOf(tags, tag) !== -1;
|
|
19136
|
-
}
|
|
19137
|
-
var removeList = [];
|
|
19138
|
-
var posStart = false;
|
|
19139
|
-
return {
|
|
19140
|
-
onIgnoreTag: function onIgnoreTag(tag, html, options) {
|
|
19141
|
-
if (isRemoveTag(tag)) {
|
|
19142
|
-
if (options.isClosing) {
|
|
19143
|
-
var ret = "[/removed]";
|
|
19144
|
-
var end = options.position + ret.length;
|
|
19145
|
-
removeList.push([posStart !== false ? posStart : options.position, end]);
|
|
19146
|
-
posStart = false;
|
|
19147
|
-
return ret;
|
|
19148
|
-
} else {
|
|
19149
|
-
if (!posStart) {
|
|
19150
|
-
posStart = options.position;
|
|
19151
|
-
}
|
|
19152
|
-
return "[removed]";
|
|
19153
|
-
}
|
|
19154
|
-
} else {
|
|
19155
|
-
return next(tag, html, options);
|
|
19156
|
-
}
|
|
19157
|
-
},
|
|
19158
|
-
remove: function remove(html) {
|
|
19159
|
-
var rethtml = "";
|
|
19160
|
-
var lastPos = 0;
|
|
19161
|
-
util$1.forEach(removeList, function (pos) {
|
|
19162
|
-
rethtml += html.slice(lastPos, pos[0]);
|
|
19163
|
-
lastPos = pos[1];
|
|
19164
|
-
});
|
|
19165
|
-
rethtml += html.slice(lastPos);
|
|
19166
|
-
return rethtml;
|
|
19167
|
-
}
|
|
19168
|
-
};
|
|
19169
|
-
}
|
|
19170
|
-
|
|
19171
|
-
/**
|
|
19172
|
-
* remove html comments
|
|
19173
|
-
*
|
|
19174
|
-
* @param {String} html
|
|
19175
|
-
* @return {String}
|
|
19176
|
-
*/
|
|
19177
|
-
function stripCommentTag(html) {
|
|
19178
|
-
var retHtml = "";
|
|
19179
|
-
var lastPos = 0;
|
|
19180
|
-
while (lastPos < html.length) {
|
|
19181
|
-
var i = html.indexOf("<!--", lastPos);
|
|
19182
|
-
if (i === -1) {
|
|
19183
|
-
retHtml += html.slice(lastPos);
|
|
19184
|
-
break;
|
|
19185
|
-
}
|
|
19186
|
-
retHtml += html.slice(lastPos, i);
|
|
19187
|
-
var j = html.indexOf("-->", i);
|
|
19188
|
-
if (j === -1) {
|
|
19189
|
-
break;
|
|
19190
|
-
}
|
|
19191
|
-
lastPos = j + 3;
|
|
19192
|
-
}
|
|
19193
|
-
return retHtml;
|
|
19194
|
-
}
|
|
19195
|
-
|
|
19196
|
-
/**
|
|
19197
|
-
* remove invisible characters
|
|
19198
|
-
*
|
|
19199
|
-
* @param {String} html
|
|
19200
|
-
* @return {String}
|
|
19201
|
-
*/
|
|
19202
|
-
function stripBlankChar(html) {
|
|
19203
|
-
var chars = html.split("");
|
|
19204
|
-
chars = chars.filter(function (_char) {
|
|
19205
|
-
var c = _char.charCodeAt(0);
|
|
19206
|
-
if (c === 127) return false;
|
|
19207
|
-
if (c <= 31) {
|
|
19208
|
-
if (c === 10 || c === 13) return true;
|
|
19209
|
-
return false;
|
|
19210
|
-
}
|
|
19211
|
-
return true;
|
|
19212
|
-
});
|
|
19213
|
-
return chars.join("");
|
|
19214
|
-
}
|
|
19215
|
-
var whiteList$1 = getDefaultWhiteList$1();
|
|
19216
|
-
var getDefaultWhiteList_1$1 = getDefaultWhiteList$1;
|
|
19217
|
-
var onTag_1 = onTag;
|
|
19218
|
-
var onIgnoreTag_1 = onIgnoreTag;
|
|
19219
|
-
var onTagAttr_1 = onTagAttr;
|
|
19220
|
-
var onIgnoreTagAttr_1 = onIgnoreTagAttr;
|
|
19221
|
-
var safeAttrValue_1$1 = safeAttrValue$1;
|
|
19222
|
-
var escapeHtml_1 = escapeHtml;
|
|
19223
|
-
var escapeQuote_1 = escapeQuote;
|
|
19224
|
-
var unescapeQuote_1 = unescapeQuote;
|
|
19225
|
-
var escapeHtmlEntities_1 = escapeHtmlEntities;
|
|
19226
|
-
var escapeDangerHtml5Entities_1 = escapeDangerHtml5Entities;
|
|
19227
|
-
var clearNonPrintableCharacter_1 = clearNonPrintableCharacter;
|
|
19228
|
-
var friendlyAttrValue_1 = friendlyAttrValue;
|
|
19229
|
-
var escapeAttrValue_1 = escapeAttrValue;
|
|
19230
|
-
var onIgnoreTagStripAll_1 = onIgnoreTagStripAll;
|
|
19231
|
-
var StripTagBody_1 = StripTagBody;
|
|
19232
|
-
var stripCommentTag_1 = stripCommentTag;
|
|
19233
|
-
var stripBlankChar_1 = stripBlankChar;
|
|
19234
|
-
var cssFilter = defaultCSSFilter;
|
|
19235
|
-
var getDefaultCSSWhiteList_1 = getDefaultCSSWhiteList;
|
|
19236
|
-
var _default$1 = {
|
|
19237
|
-
whiteList: whiteList$1,
|
|
19238
|
-
getDefaultWhiteList: getDefaultWhiteList_1$1,
|
|
19239
|
-
onTag: onTag_1,
|
|
19240
|
-
onIgnoreTag: onIgnoreTag_1,
|
|
19241
|
-
onTagAttr: onTagAttr_1,
|
|
19242
|
-
onIgnoreTagAttr: onIgnoreTagAttr_1,
|
|
19243
|
-
safeAttrValue: safeAttrValue_1$1,
|
|
19244
|
-
escapeHtml: escapeHtml_1,
|
|
19245
|
-
escapeQuote: escapeQuote_1,
|
|
19246
|
-
unescapeQuote: unescapeQuote_1,
|
|
19247
|
-
escapeHtmlEntities: escapeHtmlEntities_1,
|
|
19248
|
-
escapeDangerHtml5Entities: escapeDangerHtml5Entities_1,
|
|
19249
|
-
clearNonPrintableCharacter: clearNonPrintableCharacter_1,
|
|
19250
|
-
friendlyAttrValue: friendlyAttrValue_1,
|
|
19251
|
-
escapeAttrValue: escapeAttrValue_1,
|
|
19252
|
-
onIgnoreTagStripAll: onIgnoreTagStripAll_1,
|
|
19253
|
-
StripTagBody: StripTagBody_1,
|
|
19254
|
-
stripCommentTag: stripCommentTag_1,
|
|
19255
|
-
stripBlankChar: stripBlankChar_1,
|
|
19256
|
-
cssFilter: cssFilter,
|
|
19257
|
-
getDefaultCSSWhiteList: getDefaultCSSWhiteList_1
|
|
19258
|
-
};
|
|
19259
|
-
|
|
19260
|
-
/**
|
|
19261
|
-
* Simple HTML Parser
|
|
19262
|
-
*
|
|
19263
|
-
* @author Zongmin Lei<leizongmin@gmail.com>
|
|
19264
|
-
*/
|
|
19265
|
-
|
|
19266
|
-
/**
|
|
19267
|
-
* get tag name
|
|
19268
|
-
*
|
|
19269
|
-
* @param {String} html e.g. '<a hef="#">'
|
|
19270
|
-
* @return {String}
|
|
19271
|
-
*/
|
|
19272
|
-
function getTagName(html) {
|
|
19273
|
-
var i = util$1.spaceIndex(html);
|
|
19274
|
-
var tagName;
|
|
19275
|
-
if (i === -1) {
|
|
19276
|
-
tagName = html.slice(1, -1);
|
|
19277
|
-
} else {
|
|
19278
|
-
tagName = html.slice(1, i + 1);
|
|
19279
|
-
}
|
|
19280
|
-
tagName = util$1.trim(tagName).toLowerCase();
|
|
19281
|
-
if (tagName.slice(0, 1) === "/") tagName = tagName.slice(1);
|
|
19282
|
-
if (tagName.slice(-1) === "/") tagName = tagName.slice(0, -1);
|
|
19283
|
-
return tagName;
|
|
19284
|
-
}
|
|
19285
|
-
|
|
19286
|
-
/**
|
|
19287
|
-
* is close tag?
|
|
19288
|
-
*
|
|
19289
|
-
* @param {String} html 如:'<a hef="#">'
|
|
19290
|
-
* @return {Boolean}
|
|
19291
|
-
*/
|
|
19292
|
-
function isClosing(html) {
|
|
19293
|
-
return html.slice(0, 2) === "</";
|
|
19294
|
-
}
|
|
19295
|
-
|
|
19296
|
-
/**
|
|
19297
|
-
* parse input html and returns processed html
|
|
19298
|
-
*
|
|
19299
|
-
* @param {String} html
|
|
19300
|
-
* @param {Function} onTag e.g. function (sourcePosition, position, tag, html, isClosing)
|
|
19301
|
-
* @param {Function} escapeHtml
|
|
19302
|
-
* @return {String}
|
|
19303
|
-
*/
|
|
19304
|
-
function parseTag(html, onTag, escapeHtml) {
|
|
19305
|
-
|
|
19306
|
-
var rethtml = "";
|
|
19307
|
-
var lastPos = 0;
|
|
19308
|
-
var tagStart = false;
|
|
19309
|
-
var quoteStart = false;
|
|
19310
|
-
var currentPos = 0;
|
|
19311
|
-
var len = html.length;
|
|
19312
|
-
var currentTagName = "";
|
|
19313
|
-
var currentHtml = "";
|
|
19314
|
-
chariterator: for (currentPos = 0; currentPos < len; currentPos++) {
|
|
19315
|
-
var c = html.charAt(currentPos);
|
|
19316
|
-
if (tagStart === false) {
|
|
19317
|
-
if (c === "<") {
|
|
19318
|
-
tagStart = currentPos;
|
|
19319
|
-
continue;
|
|
19320
|
-
}
|
|
19321
|
-
} else {
|
|
19322
|
-
if (quoteStart === false) {
|
|
19323
|
-
if (c === "<") {
|
|
19324
|
-
rethtml += escapeHtml(html.slice(lastPos, currentPos));
|
|
19325
|
-
tagStart = currentPos;
|
|
19326
|
-
lastPos = currentPos;
|
|
19327
|
-
continue;
|
|
19328
|
-
}
|
|
19329
|
-
if (c === ">" || currentPos === len - 1) {
|
|
19330
|
-
rethtml += escapeHtml(html.slice(lastPos, tagStart));
|
|
19331
|
-
currentHtml = html.slice(tagStart, currentPos + 1);
|
|
19332
|
-
currentTagName = getTagName(currentHtml);
|
|
19333
|
-
rethtml += onTag(tagStart, rethtml.length, currentTagName, currentHtml, isClosing(currentHtml));
|
|
19334
|
-
lastPos = currentPos + 1;
|
|
19335
|
-
tagStart = false;
|
|
19336
|
-
continue;
|
|
19337
|
-
}
|
|
19338
|
-
if (c === '"' || c === "'") {
|
|
19339
|
-
var i = 1;
|
|
19340
|
-
var ic = html.charAt(currentPos - i);
|
|
19341
|
-
while (ic.trim() === "" || ic === "=") {
|
|
19342
|
-
if (ic === "=") {
|
|
19343
|
-
quoteStart = c;
|
|
19344
|
-
continue chariterator;
|
|
19345
|
-
}
|
|
19346
|
-
ic = html.charAt(currentPos - ++i);
|
|
19347
|
-
}
|
|
19348
|
-
}
|
|
19349
|
-
} else {
|
|
19350
|
-
if (c === quoteStart) {
|
|
19351
|
-
quoteStart = false;
|
|
19352
|
-
continue;
|
|
19353
|
-
}
|
|
19354
|
-
}
|
|
19355
|
-
}
|
|
19356
|
-
}
|
|
19357
|
-
if (lastPos < len) {
|
|
19358
|
-
rethtml += escapeHtml(html.substr(lastPos));
|
|
19359
|
-
}
|
|
19360
|
-
return rethtml;
|
|
19361
|
-
}
|
|
19362
|
-
var REGEXP_ILLEGAL_ATTR_NAME = /[^a-zA-Z0-9\\_:.-]/gim;
|
|
19363
|
-
|
|
19364
|
-
/**
|
|
19365
|
-
* parse input attributes and returns processed attributes
|
|
19366
|
-
*
|
|
19367
|
-
* @param {String} html e.g. `href="#" target="_blank"`
|
|
19368
|
-
* @param {Function} onAttr e.g. `function (name, value)`
|
|
19369
|
-
* @return {String}
|
|
19370
|
-
*/
|
|
19371
|
-
function parseAttr(html, onAttr) {
|
|
19372
|
-
|
|
19373
|
-
var lastPos = 0;
|
|
19374
|
-
var lastMarkPos = 0;
|
|
19375
|
-
var retAttrs = [];
|
|
19376
|
-
var tmpName = false;
|
|
19377
|
-
var len = html.length;
|
|
19378
|
-
function addAttr(name, value) {
|
|
19379
|
-
name = util$1.trim(name);
|
|
19380
|
-
name = name.replace(REGEXP_ILLEGAL_ATTR_NAME, "").toLowerCase();
|
|
19381
|
-
if (name.length < 1) return;
|
|
19382
|
-
var ret = onAttr(name, value || "");
|
|
19383
|
-
if (ret) retAttrs.push(ret);
|
|
19384
|
-
}
|
|
19385
|
-
|
|
19386
|
-
// 逐个分析字符
|
|
19387
|
-
for (var i = 0; i < len; i++) {
|
|
19388
|
-
var c = html.charAt(i);
|
|
19389
|
-
var v, j;
|
|
19390
|
-
if (tmpName === false && c === "=") {
|
|
19391
|
-
tmpName = html.slice(lastPos, i);
|
|
19392
|
-
lastPos = i + 1;
|
|
19393
|
-
lastMarkPos = html.charAt(lastPos) === '"' || html.charAt(lastPos) === "'" ? lastPos : findNextQuotationMark(html, i + 1);
|
|
19394
|
-
continue;
|
|
19395
|
-
}
|
|
19396
|
-
if (tmpName !== false) {
|
|
19397
|
-
if (i === lastMarkPos) {
|
|
19398
|
-
j = html.indexOf(c, i + 1);
|
|
19399
|
-
if (j === -1) {
|
|
19400
|
-
break;
|
|
19401
|
-
} else {
|
|
19402
|
-
v = util$1.trim(html.slice(lastMarkPos + 1, j));
|
|
19403
|
-
addAttr(tmpName, v);
|
|
19404
|
-
tmpName = false;
|
|
19405
|
-
i = j;
|
|
19406
|
-
lastPos = i + 1;
|
|
19407
|
-
continue;
|
|
19408
|
-
}
|
|
19409
|
-
}
|
|
19410
|
-
}
|
|
19411
|
-
if (/\s|\n|\t/.test(c)) {
|
|
19412
|
-
html = html.replace(/\s|\n|\t/g, " ");
|
|
19413
|
-
if (tmpName === false) {
|
|
19414
|
-
j = findNextEqual(html, i);
|
|
19415
|
-
if (j === -1) {
|
|
19416
|
-
v = util$1.trim(html.slice(lastPos, i));
|
|
19417
|
-
addAttr(v);
|
|
19418
|
-
tmpName = false;
|
|
19419
|
-
lastPos = i + 1;
|
|
19420
|
-
continue;
|
|
19421
|
-
} else {
|
|
19422
|
-
i = j - 1;
|
|
19423
|
-
continue;
|
|
19424
|
-
}
|
|
19425
|
-
} else {
|
|
19426
|
-
j = findBeforeEqual(html, i - 1);
|
|
19427
|
-
if (j === -1) {
|
|
19428
|
-
v = util$1.trim(html.slice(lastPos, i));
|
|
19429
|
-
v = stripQuoteWrap(v);
|
|
19430
|
-
addAttr(tmpName, v);
|
|
19431
|
-
tmpName = false;
|
|
19432
|
-
lastPos = i + 1;
|
|
19433
|
-
continue;
|
|
19434
|
-
} else {
|
|
19435
|
-
continue;
|
|
19436
|
-
}
|
|
19437
|
-
}
|
|
19438
|
-
}
|
|
19439
|
-
}
|
|
19440
|
-
if (lastPos < html.length) {
|
|
19441
|
-
if (tmpName === false) {
|
|
19442
|
-
addAttr(html.slice(lastPos));
|
|
19443
|
-
} else {
|
|
19444
|
-
addAttr(tmpName, stripQuoteWrap(util$1.trim(html.slice(lastPos))));
|
|
19445
|
-
}
|
|
19446
|
-
}
|
|
19447
|
-
return util$1.trim(retAttrs.join(" "));
|
|
19448
|
-
}
|
|
19449
|
-
function findNextEqual(str, i) {
|
|
19450
|
-
for (; i < str.length; i++) {
|
|
19451
|
-
var c = str[i];
|
|
19452
|
-
if (c === " ") continue;
|
|
19453
|
-
if (c === "=") return i;
|
|
19454
|
-
return -1;
|
|
19455
|
-
}
|
|
19456
|
-
}
|
|
19457
|
-
function findNextQuotationMark(str, i) {
|
|
19458
|
-
for (; i < str.length; i++) {
|
|
19459
|
-
var c = str[i];
|
|
19460
|
-
if (c === " ") continue;
|
|
19461
|
-
if (c === "'" || c === '"') return i;
|
|
19462
|
-
return -1;
|
|
19463
|
-
}
|
|
19464
|
-
}
|
|
19465
|
-
function findBeforeEqual(str, i) {
|
|
19466
|
-
for (; i > 0; i--) {
|
|
19467
|
-
var c = str[i];
|
|
19468
|
-
if (c === " ") continue;
|
|
19469
|
-
if (c === "=") return i;
|
|
19470
|
-
return -1;
|
|
19471
|
-
}
|
|
19472
|
-
}
|
|
19473
|
-
function isQuoteWrapString(text) {
|
|
19474
|
-
if (text[0] === '"' && text[text.length - 1] === '"' || text[0] === "'" && text[text.length - 1] === "'") {
|
|
19475
|
-
return true;
|
|
19476
|
-
} else {
|
|
19477
|
-
return false;
|
|
19478
|
-
}
|
|
19479
|
-
}
|
|
19480
|
-
function stripQuoteWrap(text) {
|
|
19481
|
-
if (isQuoteWrapString(text)) {
|
|
19482
|
-
return text.substr(1, text.length - 2);
|
|
19483
|
-
} else {
|
|
19484
|
-
return text;
|
|
19485
|
-
}
|
|
19486
|
-
}
|
|
19487
|
-
var parseTag_1 = parseTag;
|
|
19488
|
-
var parseAttr_1 = parseAttr;
|
|
19489
|
-
var parser$1 = {
|
|
19490
|
-
parseTag: parseTag_1,
|
|
19491
|
-
parseAttr: parseAttr_1
|
|
19492
|
-
};
|
|
19493
|
-
|
|
19494
|
-
/**
|
|
19495
|
-
* filter xss
|
|
19496
|
-
*
|
|
19497
|
-
* @author Zongmin Lei<leizongmin@gmail.com>
|
|
19498
|
-
*/
|
|
19499
|
-
|
|
19500
|
-
var FilterCSS$2 = lib$1.FilterCSS;
|
|
19501
|
-
var parseTag$1 = parser$1.parseTag;
|
|
19502
|
-
var parseAttr$1 = parser$1.parseAttr;
|
|
19503
|
-
|
|
19504
|
-
/**
|
|
19505
|
-
* returns `true` if the input value is `undefined` or `null`
|
|
19506
|
-
*
|
|
19507
|
-
* @param {Object} obj
|
|
19508
|
-
* @return {Boolean}
|
|
19509
|
-
*/
|
|
19510
|
-
function isNull$1(obj) {
|
|
19511
|
-
return obj === undefined || obj === null;
|
|
19512
|
-
}
|
|
19513
|
-
|
|
19514
|
-
/**
|
|
19515
|
-
* get attributes for a tag
|
|
19516
|
-
*
|
|
19517
|
-
* @param {String} html
|
|
19518
|
-
* @return {Object}
|
|
19519
|
-
* - {String} html
|
|
19520
|
-
* - {Boolean} closing
|
|
19521
|
-
*/
|
|
19522
|
-
function getAttrs(html) {
|
|
19523
|
-
var i = util$1.spaceIndex(html);
|
|
19524
|
-
if (i === -1) {
|
|
19525
|
-
return {
|
|
19526
|
-
html: "",
|
|
19527
|
-
closing: html[html.length - 2] === "/"
|
|
19528
|
-
};
|
|
19529
|
-
}
|
|
19530
|
-
html = util$1.trim(html.slice(i + 1, -1));
|
|
19531
|
-
var isClosing = html[html.length - 1] === "/";
|
|
19532
|
-
if (isClosing) html = util$1.trim(html.slice(0, -1));
|
|
19533
|
-
return {
|
|
19534
|
-
html: html,
|
|
19535
|
-
closing: isClosing
|
|
19536
|
-
};
|
|
19537
|
-
}
|
|
19538
|
-
|
|
19539
|
-
/**
|
|
19540
|
-
* shallow copy
|
|
19541
|
-
*
|
|
19542
|
-
* @param {Object} obj
|
|
19543
|
-
* @return {Object}
|
|
19544
|
-
*/
|
|
19545
|
-
function shallowCopyObject$1(obj) {
|
|
19546
|
-
var ret = {};
|
|
19547
|
-
for (var i in obj) {
|
|
19548
|
-
ret[i] = obj[i];
|
|
19549
|
-
}
|
|
19550
|
-
return ret;
|
|
19551
|
-
}
|
|
19552
|
-
function keysToLowerCase(obj) {
|
|
19553
|
-
var ret = {};
|
|
19554
|
-
for (var i in obj) {
|
|
19555
|
-
if (Array.isArray(obj[i])) {
|
|
19556
|
-
ret[i.toLowerCase()] = obj[i].map(function (item) {
|
|
19557
|
-
return item.toLowerCase();
|
|
19558
|
-
});
|
|
19559
|
-
} else {
|
|
19560
|
-
ret[i.toLowerCase()] = obj[i];
|
|
19561
|
-
}
|
|
19562
|
-
}
|
|
19563
|
-
return ret;
|
|
19564
|
-
}
|
|
19565
|
-
|
|
19566
|
-
/**
|
|
19567
|
-
* FilterXSS class
|
|
19568
|
-
*
|
|
19569
|
-
* @param {Object} options
|
|
19570
|
-
* whiteList (or allowList), onTag, onTagAttr, onIgnoreTag,
|
|
19571
|
-
* onIgnoreTagAttr, safeAttrValue, escapeHtml
|
|
19572
|
-
* stripIgnoreTagBody, allowCommentTag, stripBlankChar
|
|
19573
|
-
* css{whiteList, onAttr, onIgnoreAttr} `css=false` means don't use `cssfilter`
|
|
19574
|
-
*/
|
|
19575
|
-
function FilterXSS(options) {
|
|
19576
|
-
options = shallowCopyObject$1(options || {});
|
|
19577
|
-
if (options.stripIgnoreTag) {
|
|
19578
|
-
if (options.onIgnoreTag) {
|
|
19579
|
-
console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time');
|
|
19580
|
-
}
|
|
19581
|
-
options.onIgnoreTag = _default$1.onIgnoreTagStripAll;
|
|
19582
|
-
}
|
|
19583
|
-
if (options.whiteList || options.allowList) {
|
|
19584
|
-
options.whiteList = keysToLowerCase(options.whiteList || options.allowList);
|
|
19585
|
-
} else {
|
|
19586
|
-
options.whiteList = _default$1.whiteList;
|
|
19587
|
-
}
|
|
19588
|
-
options.onTag = options.onTag || _default$1.onTag;
|
|
19589
|
-
options.onTagAttr = options.onTagAttr || _default$1.onTagAttr;
|
|
19590
|
-
options.onIgnoreTag = options.onIgnoreTag || _default$1.onIgnoreTag;
|
|
19591
|
-
options.onIgnoreTagAttr = options.onIgnoreTagAttr || _default$1.onIgnoreTagAttr;
|
|
19592
|
-
options.safeAttrValue = options.safeAttrValue || _default$1.safeAttrValue;
|
|
19593
|
-
options.escapeHtml = options.escapeHtml || _default$1.escapeHtml;
|
|
19594
|
-
this.options = options;
|
|
19595
|
-
if (options.css === false) {
|
|
19596
|
-
this.cssFilter = false;
|
|
19597
|
-
} else {
|
|
19598
|
-
options.css = options.css || {};
|
|
19599
|
-
this.cssFilter = new FilterCSS$2(options.css);
|
|
19600
|
-
}
|
|
19601
|
-
}
|
|
19602
|
-
|
|
19603
|
-
/**
|
|
19604
|
-
* start process and returns result
|
|
19605
|
-
*
|
|
19606
|
-
* @param {String} html
|
|
19607
|
-
* @return {String}
|
|
19608
|
-
*/
|
|
19609
|
-
FilterXSS.prototype.process = function (html) {
|
|
19610
|
-
// compatible with the input
|
|
19611
|
-
html = html || "";
|
|
19612
|
-
html = html.toString();
|
|
19613
|
-
if (!html) return "";
|
|
19614
|
-
var me = this;
|
|
19615
|
-
var options = me.options;
|
|
19616
|
-
var whiteList = options.whiteList;
|
|
19617
|
-
var onTag = options.onTag;
|
|
19618
|
-
var onIgnoreTag = options.onIgnoreTag;
|
|
19619
|
-
var onTagAttr = options.onTagAttr;
|
|
19620
|
-
var onIgnoreTagAttr = options.onIgnoreTagAttr;
|
|
19621
|
-
var safeAttrValue = options.safeAttrValue;
|
|
19622
|
-
var escapeHtml = options.escapeHtml;
|
|
19623
|
-
var cssFilter = me.cssFilter;
|
|
19624
|
-
|
|
19625
|
-
// remove invisible characters
|
|
19626
|
-
if (options.stripBlankChar) {
|
|
19627
|
-
html = _default$1.stripBlankChar(html);
|
|
19628
|
-
}
|
|
19629
|
-
|
|
19630
|
-
// remove html comments
|
|
19631
|
-
if (!options.allowCommentTag) {
|
|
19632
|
-
html = _default$1.stripCommentTag(html);
|
|
19633
|
-
}
|
|
19634
|
-
|
|
19635
|
-
// if enable stripIgnoreTagBody
|
|
19636
|
-
var stripIgnoreTagBody = false;
|
|
19637
|
-
if (options.stripIgnoreTagBody) {
|
|
19638
|
-
stripIgnoreTagBody = _default$1.StripTagBody(options.stripIgnoreTagBody, onIgnoreTag);
|
|
19639
|
-
onIgnoreTag = stripIgnoreTagBody.onIgnoreTag;
|
|
19640
|
-
}
|
|
19641
|
-
var retHtml = parseTag$1(html, function (sourcePosition, position, tag, html, isClosing) {
|
|
19642
|
-
var info = {
|
|
19643
|
-
sourcePosition: sourcePosition,
|
|
19644
|
-
position: position,
|
|
19645
|
-
isClosing: isClosing,
|
|
19646
|
-
isWhite: Object.prototype.hasOwnProperty.call(whiteList, tag)
|
|
19647
|
-
};
|
|
19648
|
-
|
|
19649
|
-
// call `onTag()`
|
|
19650
|
-
var ret = onTag(tag, html, info);
|
|
19651
|
-
if (!isNull$1(ret)) return ret;
|
|
19652
|
-
if (info.isWhite) {
|
|
19653
|
-
if (info.isClosing) {
|
|
19654
|
-
return "</" + tag + ">";
|
|
19655
|
-
}
|
|
19656
|
-
var attrs = getAttrs(html);
|
|
19657
|
-
var whiteAttrList = whiteList[tag];
|
|
19658
|
-
var attrsHtml = parseAttr$1(attrs.html, function (name, value) {
|
|
19659
|
-
// call `onTagAttr()`
|
|
19660
|
-
var isWhiteAttr = util$1.indexOf(whiteAttrList, name) !== -1;
|
|
19661
|
-
var ret = onTagAttr(tag, name, value, isWhiteAttr);
|
|
19662
|
-
if (!isNull$1(ret)) return ret;
|
|
19663
|
-
if (isWhiteAttr) {
|
|
19664
|
-
// call `safeAttrValue()`
|
|
19665
|
-
value = safeAttrValue(tag, name, value, cssFilter);
|
|
19666
|
-
if (value) {
|
|
19667
|
-
return name + '="' + value + '"';
|
|
19668
|
-
} else {
|
|
19669
|
-
return name;
|
|
19670
|
-
}
|
|
19671
|
-
} else {
|
|
19672
|
-
// call `onIgnoreTagAttr()`
|
|
19673
|
-
ret = onIgnoreTagAttr(tag, name, value, isWhiteAttr);
|
|
19674
|
-
if (!isNull$1(ret)) return ret;
|
|
19675
|
-
return;
|
|
19676
|
-
}
|
|
19677
|
-
});
|
|
19678
|
-
|
|
19679
|
-
// build new tag html
|
|
19680
|
-
html = "<" + tag;
|
|
19681
|
-
if (attrsHtml) html += " " + attrsHtml;
|
|
19682
|
-
if (attrs.closing) html += " /";
|
|
19683
|
-
html += ">";
|
|
19684
|
-
return html;
|
|
19685
|
-
} else {
|
|
19686
|
-
// call `onIgnoreTag()`
|
|
19687
|
-
ret = onIgnoreTag(tag, html, info);
|
|
19688
|
-
if (!isNull$1(ret)) return ret;
|
|
19689
|
-
return escapeHtml(html);
|
|
19690
|
-
}
|
|
19691
|
-
}, escapeHtml);
|
|
19692
|
-
|
|
19693
|
-
// if enable stripIgnoreTagBody
|
|
19694
|
-
if (stripIgnoreTagBody) {
|
|
19695
|
-
retHtml = stripIgnoreTagBody.remove(retHtml);
|
|
19696
|
-
}
|
|
19697
|
-
return retHtml;
|
|
19698
|
-
};
|
|
19699
|
-
var xss = FilterXSS;
|
|
19700
|
-
|
|
19701
|
-
var lib$2 = createCommonjsModule(function (module, exports) {
|
|
19702
|
-
/**
|
|
19703
|
-
* xss
|
|
19704
|
-
*
|
|
19705
|
-
* @author Zongmin Lei<leizongmin@gmail.com>
|
|
19706
|
-
*/
|
|
19707
|
-
|
|
19708
|
-
/**
|
|
19709
|
-
* filter xss function
|
|
19710
|
-
*
|
|
19711
|
-
* @param {String} html
|
|
19712
|
-
* @param {Object} options { whiteList, onTag, onTagAttr, onIgnoreTag, onIgnoreTagAttr, safeAttrValue, escapeHtml }
|
|
19713
|
-
* @return {String}
|
|
19714
|
-
*/
|
|
19715
|
-
function filterXSS(html, options) {
|
|
19716
|
-
var xss$1 = new xss(options);
|
|
19717
|
-
return xss$1.process(html);
|
|
19718
|
-
}
|
|
19719
|
-
exports = module.exports = filterXSS;
|
|
19720
|
-
exports.filterXSS = filterXSS;
|
|
19721
|
-
exports.FilterXSS = xss;
|
|
19722
|
-
(function () {
|
|
19723
|
-
for (var i in _default$1) {
|
|
19724
|
-
exports[i] = _default$1[i];
|
|
19725
|
-
}
|
|
19726
|
-
for (var j in parser$1) {
|
|
19727
|
-
exports[j] = parser$1[j];
|
|
19728
|
-
}
|
|
19729
|
-
})();
|
|
19730
|
-
|
|
19731
|
-
// using `xss` on the browser, output `filterXSS` to the globals
|
|
19732
|
-
if (typeof window !== "undefined") {
|
|
19733
|
-
window.filterXSS = module.exports;
|
|
19734
|
-
}
|
|
19735
|
-
|
|
19736
|
-
// using `xss` on the WebWorker, output `filterXSS` to the globals
|
|
19737
|
-
function isWorkerEnv() {
|
|
19738
|
-
return typeof self !== "undefined" && typeof DedicatedWorkerGlobalScope !== "undefined" && self instanceof DedicatedWorkerGlobalScope;
|
|
19739
|
-
}
|
|
19740
|
-
if (isWorkerEnv()) {
|
|
19741
|
-
self.filterXSS = module.exports;
|
|
19742
|
-
}
|
|
19743
|
-
});
|
|
19744
|
-
var lib_1$2 = lib$2.filterXSS;
|
|
19745
|
-
var lib_2$1 = lib$2.FilterXSS;
|
|
19746
|
-
|
|
19747
18184
|
var textarea;
|
|
19748
18185
|
function decodeEntity(name) {
|
|
19749
18186
|
textarea = textarea || document.createElement('textarea');
|
|
@@ -19862,7 +18299,7 @@
|
|
|
19862
18299
|
function replaceUnsafeChar(ch) {
|
|
19863
18300
|
return HTML_REPLACEMENTS[ch];
|
|
19864
18301
|
}
|
|
19865
|
-
function escapeHtml
|
|
18302
|
+
function escapeHtml(str) {
|
|
19866
18303
|
if (HTML_ESCAPE_TEST_RE.test(str)) {
|
|
19867
18304
|
return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
|
|
19868
18305
|
}
|
|
@@ -19893,9 +18330,9 @@
|
|
|
19893
18330
|
|
|
19894
18331
|
rules.code = function (tokens, idx /*, options, env */) {
|
|
19895
18332
|
if (tokens[idx].block) {
|
|
19896
|
-
return '<pre><code>' + escapeHtml
|
|
18333
|
+
return '<pre><code>' + escapeHtml(tokens[idx].content) + '</code></pre>' + getBreak(tokens, idx);
|
|
19897
18334
|
}
|
|
19898
|
-
return '<code>' + escapeHtml
|
|
18335
|
+
return '<code>' + escapeHtml(tokens[idx].content) + '</code>';
|
|
19899
18336
|
};
|
|
19900
18337
|
|
|
19901
18338
|
/**
|
|
@@ -19923,13 +18360,13 @@
|
|
|
19923
18360
|
if (has(instance.rules.fence_custom, fences[0])) {
|
|
19924
18361
|
return instance.rules.fence_custom[fences[0]](tokens, idx, options, env, instance);
|
|
19925
18362
|
}
|
|
19926
|
-
langName = escapeHtml
|
|
18363
|
+
langName = escapeHtml(replaceEntities(unescapeMd(fenceName)));
|
|
19927
18364
|
langClass = ' class="' + langPrefix + langName + '"';
|
|
19928
18365
|
}
|
|
19929
18366
|
if (options.highlight) {
|
|
19930
|
-
highlighted = options.highlight.apply(options.highlight, [token.content].concat(fences)) || escapeHtml
|
|
18367
|
+
highlighted = options.highlight.apply(options.highlight, [token.content].concat(fences)) || escapeHtml(token.content);
|
|
19931
18368
|
} else {
|
|
19932
|
-
highlighted = escapeHtml
|
|
18369
|
+
highlighted = escapeHtml(token.content);
|
|
19933
18370
|
}
|
|
19934
18371
|
return '<pre><code' + langClass + '>' + highlighted + '</code></pre>' + getBreak(tokens, idx);
|
|
19935
18372
|
};
|
|
@@ -20009,9 +18446,9 @@
|
|
|
20009
18446
|
*/
|
|
20010
18447
|
|
|
20011
18448
|
rules.link_open = function (tokens, idx, options /* env */) {
|
|
20012
|
-
var title = tokens[idx].title ? ' title="' + escapeHtml
|
|
18449
|
+
var title = tokens[idx].title ? ' title="' + escapeHtml(replaceEntities(tokens[idx].title)) + '"' : '';
|
|
20013
18450
|
var target = options.linkTarget ? ' target="' + options.linkTarget + '"' : '';
|
|
20014
|
-
return '<a href="' + escapeHtml
|
|
18451
|
+
return '<a href="' + escapeHtml(tokens[idx].href) + '"' + title + target + '>';
|
|
20015
18452
|
};
|
|
20016
18453
|
rules.link_close = function /* tokens, idx, options, env */
|
|
20017
18454
|
() {
|
|
@@ -20023,9 +18460,9 @@
|
|
|
20023
18460
|
*/
|
|
20024
18461
|
|
|
20025
18462
|
rules.image = function (tokens, idx, options /*, env */) {
|
|
20026
|
-
var src = ' src="' + escapeHtml
|
|
20027
|
-
var title = tokens[idx].title ? ' title="' + escapeHtml
|
|
20028
|
-
var alt = ' alt="' + (tokens[idx].alt ? escapeHtml
|
|
18463
|
+
var src = ' src="' + escapeHtml(tokens[idx].src) + '"';
|
|
18464
|
+
var title = tokens[idx].title ? ' title="' + escapeHtml(replaceEntities(tokens[idx].title)) + '"' : '';
|
|
18465
|
+
var alt = ' alt="' + (tokens[idx].alt ? escapeHtml(replaceEntities(unescapeMd(tokens[idx].alt))) : '') + '"';
|
|
20029
18466
|
var suffix = options.xhtmlOut ? ' /' : '';
|
|
20030
18467
|
return '<img' + src + alt + title + suffix + '>';
|
|
20031
18468
|
};
|
|
@@ -20153,10 +18590,10 @@
|
|
|
20153
18590
|
*/
|
|
20154
18591
|
|
|
20155
18592
|
rules.sub = function (tokens, idx /*, options, env */) {
|
|
20156
|
-
return '<sub>' + escapeHtml
|
|
18593
|
+
return '<sub>' + escapeHtml(tokens[idx].content) + '</sub>';
|
|
20157
18594
|
};
|
|
20158
18595
|
rules.sup = function (tokens, idx /*, options, env */) {
|
|
20159
|
-
return '<sup>' + escapeHtml
|
|
18596
|
+
return '<sup>' + escapeHtml(tokens[idx].content) + '</sup>';
|
|
20160
18597
|
};
|
|
20161
18598
|
|
|
20162
18599
|
/**
|
|
@@ -20175,7 +18612,7 @@
|
|
|
20175
18612
|
*/
|
|
20176
18613
|
|
|
20177
18614
|
rules.text = function (tokens, idx /*, options, env */) {
|
|
20178
|
-
return escapeHtml
|
|
18615
|
+
return escapeHtml(tokens[idx].content);
|
|
20179
18616
|
};
|
|
20180
18617
|
|
|
20181
18618
|
/**
|
|
@@ -20194,7 +18631,7 @@
|
|
|
20194
18631
|
*/
|
|
20195
18632
|
|
|
20196
18633
|
rules.abbr_open = function (tokens, idx /*, options, env */) {
|
|
20197
|
-
return '<abbr title="' + escapeHtml
|
|
18634
|
+
return '<abbr title="' + escapeHtml(replaceEntities(tokens[idx].title)) + '">';
|
|
20198
18635
|
};
|
|
20199
18636
|
rules.abbr_close = function /* tokens, idx, options, env */
|
|
20200
18637
|
() {
|
|
@@ -24703,9 +23140,7 @@
|
|
|
24703
23140
|
};
|
|
24704
23141
|
|
|
24705
23142
|
var _templateObject$8;
|
|
24706
|
-
var InputGroup = styled('div')(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\talign-items: stretch;\n\twidth: 100%;\n
|
|
24707
|
-
return props.isOpen && 'box-shadow: rgb(0 0 0 / 20%) 0px 0px 15px;';
|
|
24708
|
-
});
|
|
23143
|
+
var InputGroup = styled('div')(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\talign-items: stretch;\n\twidth: 100%;\n"])));
|
|
24709
23144
|
InputGroup.defaultProps = {
|
|
24710
23145
|
className: 'input-group'
|
|
24711
23146
|
};
|
|
@@ -24719,14 +23154,12 @@
|
|
|
24719
23154
|
className: 'input-addon'
|
|
24720
23155
|
};
|
|
24721
23156
|
|
|
24722
|
-
var _templateObject$b, _templateObject2$4, _templateObject3$3, _templateObject4$1, _templateObject5$1, _templateObject6
|
|
23157
|
+
var _templateObject$b, _templateObject2$4, _templateObject3$3, _templateObject4$1, _templateObject5$1, _templateObject6;
|
|
24723
23158
|
var alertBorder = function alertBorder(_ref) {
|
|
24724
23159
|
var theme = _ref.theme;
|
|
24725
23160
|
return "\n\tborder: 1px solid " + theme.colors.alertColor + ";\n";
|
|
24726
23161
|
};
|
|
24727
|
-
var input =
|
|
24728
|
-
return "\nwidth: 100%;\nline-height: 1.5;\nmin-height: 42px;\npadding: 8px 12px;\nborder: 1px solid #ccc;\nbackground-color: #fafafa;\nfont-size: 0.9rem;\noutline: none;\n&:focus {\n\tbackground-color: #fff;\n}\n" + (searchBox && "\n\tpadding: 8px 12px 9px;\n\tborder: 1px solid transparent;\n\tborder-radius: 6px;\n") + ";\n";
|
|
24729
|
-
};
|
|
23162
|
+
var input = "\n\twidth: 100%;\n\tline-height: 1.5;\n\tmin-height: 42px;\n\tpadding: 8px 12px;\n\tborder: 1px solid #ccc;\n\tbackground-color: #fafafa;\n\tfont-size: 0.9rem;\n\toutline: none;\n\theight: 100%;\n\n\t&:focus {\n\t\tbackground-color: #fff;\n\t}\n";
|
|
24730
23163
|
var dark$1 = function dark(theme) {
|
|
24731
23164
|
return "\n\tborder-color: " + theme.colors.borderColor + ";\n";
|
|
24732
23165
|
};
|
|
@@ -24734,11 +23167,12 @@
|
|
|
24734
23167
|
var theme = _ref2.theme;
|
|
24735
23168
|
return "\n\tbackground-color: " + theme.colors.backgroundColor + ";\n\tcolor: " + theme.colors.textColor + ";\n\t" + dark$1(theme) + ";\n\n\t&:focus {\n\t\tbackground-color: " + theme.colors.backgroundColor + ";\n\t}\n";
|
|
24736
23169
|
};
|
|
24737
|
-
var Input = styled('input')(_templateObject$b || (_templateObject$b = _taggedTemplateLiteralLoose(["\n\t", ";\n\t
|
|
24738
|
-
|
|
24739
|
-
|
|
24740
|
-
|
|
24741
|
-
|
|
23170
|
+
var Input = styled('input')(_templateObject$b || (_templateObject$b = _taggedTemplateLiteralLoose(["\n\t", ";\n\n\t&:focus {\n\t\tbackground-color: #fff;\n\t}\n\t", ";\n\n\t", ";\n\n\t", ";\n\n\t", ";\n\t", ";\n\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n"])), input, function (_ref3) {
|
|
23171
|
+
var themePreset = _ref3.themePreset,
|
|
23172
|
+
theme = _ref3.theme;
|
|
23173
|
+
return themePreset === 'dark' && darkInput({
|
|
23174
|
+
theme: theme
|
|
23175
|
+
});
|
|
24742
23176
|
}, function (props) {
|
|
24743
23177
|
return props.showIcon && props.iconPosition === 'left' && "\n\t\t\tpadding-left: 36px;\n\t\t";
|
|
24744
23178
|
}, function (props) {
|
|
@@ -24760,13 +23194,13 @@
|
|
|
24760
23194
|
);
|
|
24761
23195
|
}, function (props) {
|
|
24762
23196
|
return (
|
|
24763
|
-
// for voice search icon with
|
|
24764
|
-
props.showVoiceSearch && props.showIcon && "\n\t\t\tpadding-right: 66px;\n\t\t"
|
|
23197
|
+
// for voice search icon with search icon
|
|
23198
|
+
props.showVoiceSearch && props.showIcon && props.iconPosition === 'right' && "\n\t\t\tpadding-right: 66px;\n\t\t"
|
|
24765
23199
|
);
|
|
24766
23200
|
}, function (props) {
|
|
24767
23201
|
return (
|
|
24768
|
-
// for voice search icon with
|
|
24769
|
-
props.showVoiceSearch && props.showIcon &&
|
|
23202
|
+
// for voice search icon with clear icon
|
|
23203
|
+
props.showVoiceSearch && props.showIcon && "\n\t\t\tpadding-right: 66px;\n\t\t"
|
|
24770
23204
|
);
|
|
24771
23205
|
}, function (props) {
|
|
24772
23206
|
return (
|
|
@@ -24775,20 +23209,15 @@
|
|
|
24775
23209
|
);
|
|
24776
23210
|
}, function (props) {
|
|
24777
23211
|
return props.alert && alertBorder;
|
|
24778
|
-
}, function (props) {
|
|
24779
|
-
return props.isOpen && "\n\t\t\tborder-bottom-left-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t";
|
|
24780
23212
|
});
|
|
24781
23213
|
var suggestions$1 = function suggestions(themePreset, theme) {
|
|
24782
23214
|
return css(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteralLoose(["\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid #ccc;\n\tborder-top: none;\n\tbackground-color: #fff;\n\tfont-size: 0.9rem;\n\tz-index: 3;\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tmax-height: min(100vh, 402px);\n\toverflow-y: auto;\n\n\t&.small {\n\t\ttop: 30px;\n\t}\n\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tcursor: pointer;\n\t\tpadding: 10px;\n\t\tuser-select: none;\n\n\t\t& > .trim {\n\t\t\tdisplay: -webkit-box;\n\t\t\tdisplay: flex;\n\t\t\twidth: 100%;\n\t\t\tmax-height: 2.3rem;\n\t\t\tline-height: 1.2rem;\n\t\t\t-webkit-line-clamp: 2;\n\t\t\t-webkit-box-orient: vertical;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: #eee;\n\t\t}\n\t}\n\n\t", ";\n"])), themePreset === 'dark' && theme && dark$1(theme));
|
|
24783
23215
|
};
|
|
24784
|
-
var
|
|
24785
|
-
return css(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteralLoose(["\n\t", ";\n\n\tmax-height: min(100vh, 401px);\n\tborder: none;\n\tborder-radius: 6px;\n\tborder-top-left-radius: 0;\n\tborder-top-right-radius: 0;\n\tbox-shadow: rgb(0 0 0 / 20%) 0px 10px 15px;\n\tborder-top: 1px solid #f2f0f0;\n\tli {\n\t\ttransition: all 0.3s ease-in;\n\t\tposition: relative;\n\t\t&:hover,\n\t\t&:focus {\n\t\t\tbackground-color: unset;\n\t\t}\n\t\t.trim {\n\t\t\tline-height: 20px;\n\t\t}\n\t\t&.li-item {\n\t\t\tbackground-color: ", ";\n\n\t\t\t", "\n\t\t}\n\t\t&.active-li-item {\n\t\t\tbackground-color: ", ";\n\t\t\tcolor: #fff;\n\t\t\tsvg {\n\t\t\t\ttransition: fill 0.3s ease-in;\n\t\t\t\tfill: #fff !important;\n\t\t\t}\n\t\t}\n\t}\n\n\t.section-container {\n\t\tpadding-bottom: 5px;\n\t\tborder-bottom: 1px solid #f2f0f0;\n\t\t", ";\n\t\t.section-header {\n\t\t\tpadding: 10px;\n\t\t\tfont-size: 12px;\n\t\t\tcolor: #7f7c7c;\n\t\t\tbackground: #f9f9f9;\n\t\t\t", ";\n\t\t}\n\n\t\t.section-list {\n\t\t\tpadding-left: 0;\n\t\t}\n\t\t.section-list-item {\n\t\t\t&__label,\n\t\t\t&__description {\n\t\t\t\toverflow: hidden;\n\t\t\t\ttext-overflow: ellipsis;\n\t\t\t\twhite-space: nowrap;\n\n\t\t\t\t* {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t\tpadding: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&__label {\n\t\t\t}\n\t\t\t&__description {\n\t\t\t\tmargin-top: 5px;\n\t\t\t\topacity: 0.7;\n\t\t\t\tfont-size: 12px;\n\t\t\t}\n\t\t}\n\t}\n"])), suggestions$1(themePreset, theme), themePreset === 'dark' ? '#424242' : '#fff', themePreset && theme && "svg {\n\t\t\t\tfill: " + (theme.colors ? theme.colors.primaryColor : '#707070') + ";\n\t\t\t}", themePreset === 'dark' ? '#555' : '#2d84f6', themePreset === 'dark' && css(_templateObject4$1 || (_templateObject4$1 = _taggedTemplateLiteralLoose(["\n\t\t\tbackground: #161616;\n\t\t"]))), themePreset === 'dark' && css(_templateObject5$1 || (_templateObject5$1 = _taggedTemplateLiteralLoose(["\n\t\t\t\tcolor: #218fe7;\n\t\t\t\tbackground: #161616;\n\t\t\t"]))));
|
|
24786
|
-
};
|
|
24787
|
-
var suggestionsContainer = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteralLoose(["\n\tposition: relative;\n\t.cancel-icon {\n\t\tcursor: pointer;\n\t}\n"])));
|
|
23216
|
+
var suggestionsContainer = css(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteralLoose(["\n\tposition: relative;\n\t.cancel-icon {\n\t\tcursor: pointer;\n\t}\n"])));
|
|
24788
23217
|
var noSuggestions = function noSuggestions(themePreset, theme) {
|
|
24789
|
-
return css(
|
|
23218
|
+
return css(_templateObject4$1 || (_templateObject4$1 = _taggedTemplateLiteralLoose(["\n\tdisplay: block;\n\twidth: 100%;\n\tborder: 1px solid #ccc;\n\tborder-top: none;\n\tbackground-color: #fff;\n\tfont-size: 0.9rem;\n\tz-index: 3;\n\tposition: absolute;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n\tmax-height: 260px;\n\toverflow-y: auto;\n\n\t&.small {\n\t\ttop: 30px;\n\t}\n\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tpadding: 10px;\n\t\tuser-select: none;\n\n\t\t& > .trim {\n\t\t\tdisplay: -webkit-box;\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-height: 2.3rem;\n\t\t\tline-height: 1.2rem;\n\t\t\t-webkit-line-clamp: 2;\n\t\t\t-webkit-box-orient: vertical;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t}\n\n\t", "\n"])), themePreset === 'dark' && theme && dark$1(theme));
|
|
24790
23219
|
};
|
|
24791
|
-
var TextArea = styled('textarea')(
|
|
23220
|
+
var TextArea = styled('textarea')(_templateObject5$1 || (_templateObject5$1 = _taggedTemplateLiteralLoose(["\n\t", ";\n\n\t&:focus {\n\t\tbackground-color: #fff;\n\t}\n\t", ";\n\n\t", ";\n\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\t&::-webkit-search-decoration,\n\t&::-webkit-search-cancel-button,\n\t&::-webkit-search-results-button,\n\t&::-webkit-search-results-decoration {\n\t\tdisplay: none;\n\t}\n\tresize: none;\n\toverflow: hidden;\n\theight: 42px;\n"])), input, function (_ref4) {
|
|
24792
23221
|
var themePreset = _ref4.themePreset,
|
|
24793
23222
|
theme = _ref4.theme;
|
|
24794
23223
|
return themePreset === 'dark' && darkInput({
|
|
@@ -24855,7 +23284,7 @@
|
|
|
24855
23284
|
}, function (props) {
|
|
24856
23285
|
return props.alert && alertBorder;
|
|
24857
23286
|
}, function (props) {
|
|
24858
|
-
return props.isOpen && css(
|
|
23287
|
+
return props.isOpen && css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteralLoose(["\n\t\t\tborder-bottom-left-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t"])));
|
|
24859
23288
|
});
|
|
24860
23289
|
|
|
24861
23290
|
var _templateObject$c;
|
|
@@ -24873,7 +23302,7 @@
|
|
|
24873
23302
|
return enableAI ? "\n\t\ttop: 0%;\n\t transform: translateY(0);\n \theight: 42px;\n\t" : '';
|
|
24874
23303
|
});
|
|
24875
23304
|
|
|
24876
|
-
var _templateObject$d
|
|
23305
|
+
var _templateObject$d;
|
|
24877
23306
|
var IconWrapper = styled('div')(_templateObject$d || (_templateObject$d = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmax-width: 23px;\n\twidth: max-content;\n\tcursor: pointer;\n\theight: 100%;\n\tmin-width: 20px;\n\n\tsvg.search-icon {\n\t\tfill: ", ";\n\t\ttransform: scale(1.5);\n\t}\n\n\tsvg.cancel-icon {\n\t\tfill: ", ";\n\t}\n"])), function (_ref) {
|
|
24878
23307
|
var _ref$theme = _ref.theme,
|
|
24879
23308
|
theme = _ref$theme === void 0 ? {} : _ref$theme;
|
|
@@ -24883,13 +23312,6 @@
|
|
|
24883
23312
|
theme = _ref2$theme === void 0 ? {} : _ref2$theme;
|
|
24884
23313
|
return theme.colors ? theme.colors.borderColor : '#000';
|
|
24885
23314
|
});
|
|
24886
|
-
var ButtonIconWrapper = styled(IconWrapper)(_templateObject2$5 || (_templateObject2$5 = _taggedTemplateLiteralLoose(["\n\tborder-radius: 4px;\n\tvertical-align: middle;\n\theight: 25px;\n\tfont-size: 12px;\n\tborder: 1px solid ", ";\n\tcolor: ", ";\n\tmax-width: unset;\n\tpadding: 5px;\n"])), function (_ref3) {
|
|
24887
|
-
var theme = _ref3.theme;
|
|
24888
|
-
return theme.colors ? theme.colors.primaryColor : '#000';
|
|
24889
|
-
}, function (_ref4) {
|
|
24890
|
-
var theme = _ref4.theme;
|
|
24891
|
-
return theme.colors ? theme.colors.primaryColor : '#000';
|
|
24892
|
-
});
|
|
24893
23315
|
|
|
24894
23316
|
function t$1(t){return "object"==typeof t&&null!=t&&1===t.nodeType}function e$1(t,e){return (!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function n$2(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return e$1(r.overflowY,n)||e$1(r.overflowX,n)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}}(t);return !!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)}(t)}return !1}function r$2(t,e,n,r,i,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-r:l>e&&d<n||o<t&&d>n?l-e+i:0}var i$3=function(e,i){var o=window,l=i.scrollMode,d=i.block,f=i.inline,h=i.boundary,u=i.skipOverflowHiddenElements,s="function"==typeof h?h:function(t){return t!==h};if(!t$1(e))throw new TypeError("Invalid target");for(var a,c,g=document.scrollingElement||document.documentElement,p=[],m=e;t$1(m)&&s(m);){if((m=null==(c=(a=m).parentElement)?a.getRootNode().host||null:c)===g){p.push(m);break}null!=m&&m===document.body&&n$2(m)&&!n$2(document.documentElement)||null!=m&&n$2(m,u)&&p.push(m);}for(var w=o.visualViewport?o.visualViewport.width:innerWidth,v=o.visualViewport?o.visualViewport.height:innerHeight,W=window.scrollX||pageXOffset,H=window.scrollY||pageYOffset,b=e.getBoundingClientRect(),y=b.height,E=b.width,M=b.top,V=b.right,x=b.bottom,I=b.left,C="start"===d||"nearest"===d?M:"end"===d?x:M+y/2,R="center"===f?I+E/2:"end"===f?V:I,T=[],k=0;k<p.length;k++){var B=p[k],D=B.getBoundingClientRect(),O=D.height,X=D.width,Y=D.top,L=D.right,S=D.bottom,j=D.left;if("if-needed"===l&&M>=0&&I>=0&&x<=v&&V<=w&&M>=Y&&x<=S&&I>=j&&V<=L)return T;var N=getComputedStyle(B),q=parseInt(N.borderLeftWidth,10),z=parseInt(N.borderTopWidth,10),A=parseInt(N.borderRightWidth,10),F=parseInt(N.borderBottomWidth,10),G=0,J=0,K="offsetWidth"in B?B.offsetWidth-B.clientWidth-q-A:0,P="offsetHeight"in B?B.offsetHeight-B.clientHeight-z-F:0,Q="offsetWidth"in B?0===B.offsetWidth?0:X/B.offsetWidth:0,U="offsetHeight"in B?0===B.offsetHeight?0:O/B.offsetHeight:0;if(g===B)G="start"===d?C:"end"===d?C-v:"nearest"===d?r$2(H,H+v,v,z,F,H+C,H+C+y,y):C-v/2,J="start"===f?R:"center"===f?R-w/2:"end"===f?R-w:r$2(W,W+w,w,q,A,W+R,W+R+E,E),G=Math.max(0,G+H),J=Math.max(0,J+W);else {G="start"===d?C-Y-z:"end"===d?C-S+F+P:"nearest"===d?r$2(Y,S,O,z,F+P,C,C+y,y):C-(Y+O/2)+P/2,J="start"===f?R-j-q:"center"===f?R-(j+X/2)+K/2:"end"===f?R-L+A+K:r$2(j,L,X,q,A+K,R,R+E,E);var Z=B.scrollLeft,$=B.scrollTop;C+=$-(G=Math.max(0,Math.min($+G/U,B.scrollHeight-O/U+P))),R+=Z-(J=Math.max(0,Math.min(Z+J/Q,B.scrollWidth-X/Q+K)));}T.push({el:B,top:G,left:J});}return T};
|
|
24895
23317
|
|
|
@@ -26372,13 +24794,13 @@
|
|
|
26372
24794
|
}
|
|
26373
24795
|
};
|
|
26374
24796
|
|
|
26375
|
-
var _templateObject$h, _templateObject2$
|
|
24797
|
+
var _templateObject$h, _templateObject2$5;
|
|
26376
24798
|
var TagsContainer = styled('div')(_templateObject$h || (_templateObject$h = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin-top: 10px;\n\twidth: 100%;\n"])));
|
|
26377
|
-
var TagItem = styled('span')(_templateObject2$
|
|
24799
|
+
var TagItem = styled('span')(_templateObject2$5 || (_templateObject2$5 = _taggedTemplateLiteralLoose(["\n\tcursor: default;\n\tbox-sizing: border-box;\n\tmargin: 0 4px 4px 0;\n\tcolor: #000000d9;\n\tfont-size: 14px;\n\tfont-variant: tabular-nums;\n\tline-height: 1.5715;\n\tlist-style: none;\n\tfont-feature-settings: 'tnum';\n\tdisplay: inline-block;\n\theight: auto;\n\tpadding: 0 2px 0 7px;\n\tfont-size: 12px;\n\tline-height: 22px;\n\twhite-space: nowrap;\n\tbackground: #fafafa;\n\tborder: 1px solid #d9d9d9;\n\tborder-radius: 2px;\n\topacity: 1;\n\ttransition: all 0.3s;\n\n\tspan.close-icon {\n\t\tsvg {\n\t\t\tcursor: pointer;\n\t\t\theight: 15px;\n\t\t\tposition: relative;\n\t\t\ttop: 4px;\n\t\t\tfill: #262626;\n\t\t}\n\t}\n"])));
|
|
26378
24800
|
|
|
26379
|
-
var _templateObject$i, _templateObject2$
|
|
24801
|
+
var _templateObject$i, _templateObject2$6, _templateObject3$4;
|
|
26380
24802
|
var skeletonAnimation = keyframes(_templateObject$i || (_templateObject$i = _taggedTemplateLiteralLoose(["\n 0% {\n background-position: 100% 0;\n }\n 100% {\n background-position: -200% 0;\n }\n"])));
|
|
26381
|
-
var SkeletonLoader = styled('div')(_templateObject2$
|
|
24803
|
+
var SkeletonLoader = styled('div')(_templateObject2$6 || (_templateObject2$6 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n"])));
|
|
26382
24804
|
var SkeletonLine = styled('div')(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\theight: 20px;\n\tbackground: linear-gradient(\n\t\t90deg,\n\t\trgba(220, 220, 220, 0.5) 25%,\n\t\trgba(240, 240, 240, 0.9) 50%,\n\t\trgba(220, 220, 220, 0.5) 75%\n\t);\n\tbackground-size: 200% 100%;\n\tanimation: ", " 1.5s infinite;\n"])), skeletonAnimation);
|
|
26383
24805
|
var HorizontalSkeletonLoader = vue.defineComponent({
|
|
26384
24806
|
name: 'HorizontalSkeletonLoader',
|
|
@@ -26391,11 +24813,11 @@
|
|
|
26391
24813
|
}
|
|
26392
24814
|
});
|
|
26393
24815
|
|
|
26394
|
-
var _templateObject$j, _templateObject2$
|
|
24816
|
+
var _templateObject$j, _templateObject2$7, _templateObject3$5, _templateObject4$2, _templateObject5$2, _templateObject6$1, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
26395
24817
|
var Chatbox = styled('div')(_templateObject$j || (_templateObject$j = _taggedTemplateLiteralLoose(["\n\tposition: relative;\n\tmargin: 0 auto;\n\tpadding: 10px;\n\tbackground-color: #fafafa;\n\twidth: 100%;\n\tbox-shadow: rgb(0 0 0 / 20%) 0px 0px 6px;\n\tborder-radius: 6px;\n\tmargin-bottom: 20px;\n\tbackground-color: ", ";\n"])), function (props) {
|
|
26396
24818
|
return props.theme && props.theme.colors ? props.theme.colors.backgroundColor : '#fff';
|
|
26397
24819
|
});
|
|
26398
|
-
var ChatContainer = styled('div')(_templateObject2$
|
|
24820
|
+
var ChatContainer = styled('div')(_templateObject2$7 || (_templateObject2$7 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\tposition: relative;\n\t.--ai-answer-error-container {\n\t\ttext-align: center;\n\t\tposition: absolute;\n\t\tbottom: 0px;\n\t\t", ";\n\t\tz-index: 1;\n\t\tleft: 50%;\n\t\ttransform: translateX(-50%);\n\t\twidth: 100%;\n\n\t\t.--default-error-element {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tpadding: 10px;\n\t\t\tbackground-color: ", ";\n\t\t\tbox-shadow: 0 -5px 5px -2px\n\t\t\t\t", ";\n\n\t\t\tspan {\n\t\t\t\tmargin-bottom: 5px;\n\t\t\t}\n\n\t\t\tbutton {\n\t\t\t}\n\t\t}\n\t}\n\n\t", ";\n"])), function (props) {
|
|
26399
24821
|
return props.showInput ? 'bottom: 48px;' : '';
|
|
26400
24822
|
}, function (props) {
|
|
26401
24823
|
return props.theme && props.theme.colors && props.theme.colors.backgroundColor ? props.theme.colors.backgroundColor : '#fff';
|
|
@@ -26432,7 +24854,7 @@
|
|
|
26432
24854
|
}
|
|
26433
24855
|
return finalBGColor;
|
|
26434
24856
|
};
|
|
26435
|
-
var Message = styled('div')(_templateObject7
|
|
24857
|
+
var Message = styled('div')(_templateObject7 || (_templateObject7 = _taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tcolor: ", ";\n\tborder: 1px solid\n\t\t", ";\n\tpadding: 10px;\n\tborder-radius: 7px;\n\tmargin-bottom: 10px;\n\tmax-width: 80%;\n\talign-self: ", ";\n\tdisplay: inline-block;\n\tposition: relative;\n\toverflow-wrap: anywhere;\n\t", "\n"])), function (props) {
|
|
26436
24858
|
return messageBGColor(props);
|
|
26437
24859
|
}, function (props) {
|
|
26438
24860
|
var finalColor;
|
|
@@ -26449,8 +24871,8 @@
|
|
|
26449
24871
|
}, function (props) {
|
|
26450
24872
|
return resetCSS(props);
|
|
26451
24873
|
});
|
|
26452
|
-
var MessageInputContainer = styled('form')(_templateObject8
|
|
26453
|
-
var MessageInput = styled(TextArea)(_templateObject9
|
|
24874
|
+
var MessageInputContainer = styled('form')(_templateObject8 || (_templateObject8 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tpadding-top: 12px;\n\talign-items: stretch;\n\tmargin-top: 10px;\n\t.ai-enter-button-wrapper {\n\t\talign-self: baseline;\n\t\theight: 41px;\n\t}\n"])));
|
|
24875
|
+
var MessageInput = styled(TextArea)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tborder-radius: 5px;\n\tborder: 1px solid #ccc;\n\tbackground-color: ", ";\n\tcolor: ", ";\n\n\t::placeholder {\n\t\tcolor: ", ";\n\t}\n\n\t:-ms-input-placeholder {\n\t\tcolor: ", ";\n\t}\n\n\t::-ms-input-placeholder {\n\t\tcolor: ", ";\n\t}\n\t", "\n"])), function (props) {
|
|
26454
24876
|
return props.themePreset === 'dark' ? props.theme.colors.borderColor : '#fff';
|
|
26455
24877
|
}, function (props) {
|
|
26456
24878
|
return props.themePreset === 'dark' ? props.theme.colors.titleColor : props.theme.colors.textColor;
|
|
@@ -26467,9 +24889,9 @@
|
|
|
26467
24889
|
var SendButton = styled(Button)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteralLoose(["\n\tborder: none;\n\tcolor: #ffffff;\n\tcursor: pointer;\n\tfont-size: 16px;\n\tmargin-left: 8px;\n\toutline: none;\n\tpadding: 10px;\n\ttext-align: center;\n\n\t&:disabled {\n\t\tcursor: not-allowed;\n\t}\n"])));
|
|
26468
24890
|
var AIFeedbackContainer = styled('div')(_templateObject11 || (_templateObject11 = _taggedTemplateLiteralLoose(["\n\t.--feedback-svgs-wrapper {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: flex-end;\n\t\tgap: 5px;\n\n\t\tsvg {\n\t\t\tcursor: pointer;\n\t\t\ttransition: all ease-in 0.1s;\n\t\t\t&.selected {\n\t\t\t\ttransform: scale(1.1);\n\t\t\t\tcursor: default;\n\t\t\t}\n\n\t\t\t&:hover {\n\t\t\t\ttransform: scale(1.1);\n\t\t\t}\n\t\t}\n\t}\n\n\t.--feedback-input-wrapper {\n\t\tdisplay: flex;\n\t\tgap: 7px;\n\t}\n"])));
|
|
26469
24891
|
|
|
26470
|
-
var _templateObject$k, _templateObject2$
|
|
24892
|
+
var _templateObject$k, _templateObject2$8, _templateObject3$6, _templateObject4$3, _templateObject5$3, _templateObject6$2, _templateObject7$1;
|
|
26471
24893
|
var fadeInFromBottom = keyframes(_templateObject$k || (_templateObject$k = _taggedTemplateLiteralLoose(["\n 0% {\n opacity: 0;\n transform: translateY(20px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])));
|
|
26472
|
-
var fadeInFromTop = keyframes(_templateObject2$
|
|
24894
|
+
var fadeInFromTop = keyframes(_templateObject2$8 || (_templateObject2$8 = _taggedTemplateLiteralLoose(["\n 0% {\n opacity: 0;\n transform: translateY(-20px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])));
|
|
26473
24895
|
var SearchBoxAISection = styled('div')(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteralLoose(["\n\tpadding: 10px;\n\tborder-radius: 4px;\n\tmin-height: 200px;\n\tpadding-top: 20px;\n\tposition: relative;\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\tbackground-color: ", ";\n\tcolor: ", ";\n\t.--ai-answer-error-container {\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -50%);\n\t\t.--default-error-element {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tgap: 10px;\n\t\t}\n\t}\n"])), function (_ref) {
|
|
26474
24896
|
var themePreset = _ref.themePreset,
|
|
26475
24897
|
theme = _ref.theme;
|
|
@@ -26490,7 +24912,7 @@
|
|
|
26490
24912
|
var theme = _ref4.theme;
|
|
26491
24913
|
return theme.colors.textColor;
|
|
26492
24914
|
});
|
|
26493
|
-
var SourceTags = styled('div')(_templateObject7$
|
|
24915
|
+
var SourceTags = styled('div')(_templateObject7$1 || (_templateObject7$1 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tgap: 8px;\n\tflex-wrap: wrap;\n\t.--ai-source-tag {\n\t\tdisplay: inline-block;\n\t\tmax-width: 200px;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n"])));
|
|
26494
24916
|
|
|
26495
24917
|
var ThumbsUpSvg = {
|
|
26496
24918
|
name: 'ThumbsUpSvg',
|
|
@@ -26664,9 +25086,6 @@
|
|
|
26664
25086
|
}
|
|
26665
25087
|
});
|
|
26666
25088
|
|
|
26667
|
-
var _templateObject$l;
|
|
26668
|
-
var AutosuggestFooterContainer = styled('div')(_templateObject$l || (_templateObject$l = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tcolor: #8792a2;\n\tbackground: #f7fafc;\n\tpadding: 10px;\n\theight: 40px;\n"])));
|
|
26669
|
-
|
|
26670
25089
|
var _excluded$1 = ["_source"];
|
|
26671
25090
|
function _isSlot$5(s) {
|
|
26672
25091
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
@@ -26703,8 +25122,7 @@
|
|
|
26703
25122
|
showAIScreen: false,
|
|
26704
25123
|
showAIScreenFooter: false,
|
|
26705
25124
|
showFeedbackComponent: false,
|
|
26706
|
-
feedbackState: null
|
|
26707
|
-
prefilledAIAnswer: ''
|
|
25125
|
+
feedbackState: null
|
|
26708
25126
|
};
|
|
26709
25127
|
this.internalComponent = props.componentId + "__internal";
|
|
26710
25128
|
return this.__state;
|
|
@@ -26745,37 +25163,6 @@
|
|
|
26745
25163
|
},
|
|
26746
25164
|
stats: function stats() {
|
|
26747
25165
|
return getResultStats$1(this);
|
|
26748
|
-
},
|
|
26749
|
-
mergedAIAnswer: function mergedAIAnswer() {
|
|
26750
|
-
return this.prefilledAIAnswer || this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text;
|
|
26751
|
-
},
|
|
26752
|
-
parsedSuggestions: function parsedSuggestions() {
|
|
26753
|
-
var suggestionsArray = [];
|
|
26754
|
-
if (Array.isArray(this.suggestions) && this.suggestions.length) {
|
|
26755
|
-
suggestionsArray = [].concat(withClickIds(this.suggestions));
|
|
26756
|
-
}
|
|
26757
|
-
suggestionsArray = suggestionsArray.map(function (s) {
|
|
26758
|
-
if (s.sectionId) {
|
|
26759
|
-
return s;
|
|
26760
|
-
}
|
|
26761
|
-
return _extends({}, s, {
|
|
26762
|
-
sectionId: s._suggestion_type
|
|
26763
|
-
});
|
|
26764
|
-
});
|
|
26765
|
-
var sectionsAccumulated = [];
|
|
26766
|
-
var sectionisedSuggestions = suggestionsArray.reduce(function (acc, d, currentIndex) {
|
|
26767
|
-
if (sectionsAccumulated.includes(d.sectionId)) return acc;
|
|
26768
|
-
if (d.sectionId) {
|
|
26769
|
-
acc[currentIndex] = suggestionsArray.filter(function (g) {
|
|
26770
|
-
return g.sectionId === d.sectionId;
|
|
26771
|
-
});
|
|
26772
|
-
sectionsAccumulated.push(d.sectionId);
|
|
26773
|
-
} else {
|
|
26774
|
-
acc[currentIndex] = d;
|
|
26775
|
-
}
|
|
26776
|
-
return acc;
|
|
26777
|
-
}, {});
|
|
26778
|
-
return Object.values(sectionisedSuggestions);
|
|
26779
25166
|
}
|
|
26780
25167
|
},
|
|
26781
25168
|
props: {
|
|
@@ -26807,11 +25194,6 @@
|
|
|
26807
25194
|
enableQuerySuggestions: Q.bool.def(false),
|
|
26808
25195
|
enablePopularSuggestions: Q.bool.def(false),
|
|
26809
25196
|
enableRecentSuggestions: Q.bool.def(false),
|
|
26810
|
-
enableFAQSuggestions: Q.bool.def(false),
|
|
26811
|
-
FAQSuggestionsConfig: Q.shape({
|
|
26812
|
-
sectionLabel: Q.string,
|
|
26813
|
-
size: Q.number
|
|
26814
|
-
}),
|
|
26815
25197
|
fieldWeights: types.fieldWeights,
|
|
26816
25198
|
filterLabel: types.string,
|
|
26817
25199
|
fuzziness: types.fuzziness,
|
|
@@ -26847,20 +25229,12 @@
|
|
|
26847
25229
|
distinctFieldConfig: types.props,
|
|
26848
25230
|
//
|
|
26849
25231
|
focusShortcuts: Q.arrayOf(Q.oneOfType([Q.string, Q.number])).def(['/']),
|
|
26850
|
-
showFocusShortcutsIcon: Q.bool.def(true),
|
|
26851
25232
|
addonBefore: Q.any,
|
|
26852
25233
|
addonAfter: Q.any,
|
|
26853
|
-
showSuggestionsFooter: Q.bool.def(true),
|
|
26854
25234
|
expandSuggestionsContainer: Q.bool.def(true),
|
|
26855
|
-
renderSuggestionsFooter: Q.func,
|
|
26856
25235
|
index: Q.string,
|
|
26857
25236
|
popularSuggestionsConfig: Q.object,
|
|
26858
25237
|
recentSuggestionsConfig: Q.object,
|
|
26859
|
-
featuredSuggestionsConfig: Q.shape({
|
|
26860
|
-
maxSuggestionsPerSection: Q.number,
|
|
26861
|
-
sectionsOrder: Q.arrayOf(Q.string)
|
|
26862
|
-
}),
|
|
26863
|
-
customEvents: Q.object,
|
|
26864
25238
|
applyStopwords: Q.bool,
|
|
26865
25239
|
customStopwords: types.stringArray,
|
|
26866
25240
|
onData: types.func,
|
|
@@ -27048,7 +25422,7 @@
|
|
|
27048
25422
|
resultStats: this.stats,
|
|
27049
25423
|
AIData: {
|
|
27050
25424
|
question: this.AIResponse && this.AIResponse.response && this.AIResponse.response.question,
|
|
27051
|
-
answer: this.
|
|
25425
|
+
answer: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text,
|
|
27052
25426
|
documentIds: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [],
|
|
27053
25427
|
showAIScreen: this.showAIScreen,
|
|
27054
25428
|
sources: this.getAISourceObjects(),
|
|
@@ -27079,7 +25453,7 @@
|
|
|
27079
25453
|
this.onValueSelectedHandler(currentValue, lib_7.SEARCH_ICON_CLICK);
|
|
27080
25454
|
}
|
|
27081
25455
|
},
|
|
27082
|
-
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue
|
|
25456
|
+
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue) {
|
|
27083
25457
|
var _this2 = this;
|
|
27084
25458
|
if (isDefaultValue === void 0) {
|
|
27085
25459
|
isDefaultValue = false;
|
|
@@ -27093,9 +25467,6 @@
|
|
|
27093
25467
|
if (categoryValue === void 0) {
|
|
27094
25468
|
categoryValue = undefined;
|
|
27095
25469
|
}
|
|
27096
|
-
if (shouldExecuteQuery === void 0) {
|
|
27097
|
-
shouldExecuteQuery = true;
|
|
27098
|
-
}
|
|
27099
25470
|
var performUpdate = function performUpdate() {
|
|
27100
25471
|
if (_this2.$options.isTagsMode && isEqual$4(value, _this2.selectedTags)) {
|
|
27101
25472
|
return;
|
|
@@ -27131,18 +25502,17 @@
|
|
|
27131
25502
|
}
|
|
27132
25503
|
if (typeof _this2.currentValue === 'string') _this2.triggerDefaultQuery(_this2.currentValue, props.enableAI ? {
|
|
27133
25504
|
enableAI: true
|
|
27134
|
-
} : {}
|
|
25505
|
+
} : {});
|
|
27135
25506
|
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
27136
25507
|
// to set the query otherwise the value should reset
|
|
27137
25508
|
if (props.strictSelection) {
|
|
27138
25509
|
if (cause === lib_7.SUGGESTION_SELECT || (_this2.$options.isTagsMode ? _this2.selectedTags.length === 0 : value === '')) {
|
|
27139
|
-
_this2.triggerCustomQuery(queryHandlerValue, _this2.$options.isTagsMode ? undefined : categoryValue
|
|
25510
|
+
_this2.triggerCustomQuery(queryHandlerValue, _this2.$options.isTagsMode ? undefined : categoryValue);
|
|
27140
25511
|
} else {
|
|
27141
25512
|
_this2.setValue('', true);
|
|
27142
25513
|
}
|
|
27143
25514
|
} else if (props.value === undefined || cause === lib_7.SUGGESTION_SELECT || cause === lib_7.CLEAR_VALUE) {
|
|
27144
|
-
_this2.
|
|
27145
|
-
_this2.triggerCustomQuery(queryHandlerValue, _this2.$options.isTagsMode ? undefined : categoryValue, shouldExecuteQuery);
|
|
25515
|
+
_this2.triggerCustomQuery(queryHandlerValue, _this2.$options.isTagsMode ? undefined : categoryValue);
|
|
27146
25516
|
}
|
|
27147
25517
|
} else {
|
|
27148
25518
|
// debounce for handling text while typing
|
|
@@ -27153,13 +25523,10 @@
|
|
|
27153
25523
|
};
|
|
27154
25524
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
27155
25525
|
},
|
|
27156
|
-
triggerDefaultQuery: function triggerDefaultQuery(paramValue, meta
|
|
25526
|
+
triggerDefaultQuery: function triggerDefaultQuery(paramValue, meta) {
|
|
27157
25527
|
if (meta === void 0) {
|
|
27158
25528
|
meta = {};
|
|
27159
25529
|
}
|
|
27160
|
-
if (shouldExecuteQuery === void 0) {
|
|
27161
|
-
shouldExecuteQuery = true;
|
|
27162
|
-
}
|
|
27163
25530
|
if (!this.$props.autosuggest) {
|
|
27164
25531
|
return;
|
|
27165
25532
|
}
|
|
@@ -27180,15 +25547,12 @@
|
|
|
27180
25547
|
value: value,
|
|
27181
25548
|
componentType: constants_1$1.searchBox,
|
|
27182
25549
|
meta: meta
|
|
27183
|
-
}
|
|
25550
|
+
});
|
|
27184
25551
|
},
|
|
27185
|
-
triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue
|
|
25552
|
+
triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue) {
|
|
27186
25553
|
if (categoryValue === void 0) {
|
|
27187
25554
|
categoryValue = undefined;
|
|
27188
25555
|
}
|
|
27189
|
-
if (shouldExecuteQuery === void 0) {
|
|
27190
|
-
shouldExecuteQuery = true;
|
|
27191
|
-
}
|
|
27192
25556
|
var _this$$props = this.$props,
|
|
27193
25557
|
customQuery = _this$$props.customQuery,
|
|
27194
25558
|
filterLabel = _this$$props.filterLabel,
|
|
@@ -27217,7 +25581,7 @@
|
|
|
27217
25581
|
URLParams: URLParams,
|
|
27218
25582
|
componentType: constants_1$1.searchBox,
|
|
27219
25583
|
category: categoryValue
|
|
27220
|
-
}
|
|
25584
|
+
});
|
|
27221
25585
|
},
|
|
27222
25586
|
handleFocus: function handleFocus(event) {
|
|
27223
25587
|
if (this.$props.autosuggest) {
|
|
@@ -27316,60 +25680,12 @@
|
|
|
27316
25680
|
}, e);
|
|
27317
25681
|
}
|
|
27318
25682
|
},
|
|
27319
|
-
handleFeaturedSuggestionClicked: function handleFeaturedSuggestionClicked(suggestion) {
|
|
27320
|
-
try {
|
|
27321
|
-
var _this$$refs2, _this$$refs2$this$$pr;
|
|
27322
|
-
if (suggestion.action === helper_15.NAVIGATE) {
|
|
27323
|
-
var _JSON$parse = JSON.parse(suggestion.subAction),
|
|
27324
|
-
_JSON$parse$target = _JSON$parse.target,
|
|
27325
|
-
target = _JSON$parse$target === void 0 ? '_self' : _JSON$parse$target,
|
|
27326
|
-
_JSON$parse$link = _JSON$parse.link,
|
|
27327
|
-
link = _JSON$parse$link === void 0 ? '/' : _JSON$parse$link;
|
|
27328
|
-
if (typeof window !== 'undefined') {
|
|
27329
|
-
window.open(link, target);
|
|
27330
|
-
}
|
|
27331
|
-
}
|
|
27332
|
-
if (suggestion.action === helper_15.FUNCTION) {
|
|
27333
|
-
var matchedValues = suggestion.subAction.match(/function\s*\(.*\)(.|\n)*/);
|
|
27334
|
-
var functionStr = matchedValues && matchedValues[0];
|
|
27335
|
-
// eslint-disable-next-line no-new-func
|
|
27336
|
-
var func = new Function("return " + functionStr)();
|
|
27337
|
-
func(suggestion, this.$data.currentValue, this.$props.customEvents);
|
|
27338
|
-
}
|
|
27339
|
-
if (suggestion.action === helper_15.SELECT) {
|
|
27340
|
-
this.setValue(suggestion.value, true, this.$props, this.$options.isTagsMode.current ? lib_7.SUGGESTION_SELECT : lib_7.ENTER_PRESS);
|
|
27341
|
-
this.onValueSelectedHandler(suggestion.value, lib_7.SUGGESTION_SELECT);
|
|
27342
|
-
}
|
|
27343
|
-
// blur is important to close the dropdown
|
|
27344
|
-
// on selecting one of featured suggestions
|
|
27345
|
-
// else Downshift probably is focusing the dropdown
|
|
27346
|
-
// and not letting it close
|
|
27347
|
-
// eslint-disable-next-line no-unused-expressions
|
|
27348
|
-
(_this$$refs2 = this.$refs) == null ? void 0 : (_this$$refs2$this$$pr = _this$$refs2[this.$props.innerRef]) == null ? void 0 : _this$$refs2$this$$pr.blur();
|
|
27349
|
-
} catch (e) {
|
|
27350
|
-
console.error("Error: There was an error parsing the subAction for the featured suggestion with label, \"" + suggestion.label + "\"", e);
|
|
27351
|
-
}
|
|
27352
|
-
},
|
|
27353
25683
|
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
27354
25684
|
var _this4 = this;
|
|
27355
|
-
// handle when FAQ suggestion is clicked
|
|
27356
|
-
if (suggestion && suggestion._suggestion_type === helper_16.FAQ) {
|
|
27357
|
-
this.prefilledAIAnswer = suggestion._answer;
|
|
27358
|
-
this.setValue(suggestion.value, true, this.$props, lib_7.SUGGESTION_SELECT, true, false, suggestion._category, false);
|
|
27359
|
-
this.isOpen = true;
|
|
27360
|
-
this.showAIScreen = true;
|
|
27361
|
-
return;
|
|
27362
|
-
}
|
|
27363
25685
|
if (!this.$props.enableAI) this.isOpen = false;else {
|
|
27364
25686
|
this.showAIScreen = true;
|
|
27365
25687
|
}
|
|
27366
25688
|
var value = this.$props.value;
|
|
27367
|
-
|
|
27368
|
-
// handle featured suggestions click event
|
|
27369
|
-
if (suggestion._suggestion_type === helper_16.Featured) {
|
|
27370
|
-
this.handleFeaturedSuggestionClicked(suggestion);
|
|
27371
|
-
return;
|
|
27372
|
-
}
|
|
27373
25689
|
// Record analytics for selected suggestions
|
|
27374
25690
|
this.triggerClickAnalytics(suggestion._click_id);
|
|
27375
25691
|
if (value === undefined) {
|
|
@@ -27525,13 +25841,6 @@
|
|
|
27525
25841
|
customQuery: true
|
|
27526
25842
|
});
|
|
27527
25843
|
},
|
|
27528
|
-
suggestionsFooter: function suggestionsFooter() {
|
|
27529
|
-
return typeof renderSuggestionsFooter === 'function' ? this.$props.renderSuggestionsFooter() : vue.createVNode(AutosuggestFooterContainer, null, {
|
|
27530
|
-
"default": function _default() {
|
|
27531
|
-
return [vue.createVNode("div", null, [vue.createTextVNode("\u2191\u2193 Navigate")]), vue.createVNode("div", null, [vue.createTextVNode("\u21A9 Go")])];
|
|
27532
|
-
}
|
|
27533
|
-
});
|
|
27534
|
-
},
|
|
27535
25844
|
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
27536
25845
|
var _this6 = this;
|
|
27537
25846
|
var _this$$props2 = this.$props,
|
|
@@ -27559,29 +25868,16 @@
|
|
|
27559
25868
|
}
|
|
27560
25869
|
return null;
|
|
27561
25870
|
},
|
|
27562
|
-
renderShortcut: function renderShortcut() {
|
|
27563
|
-
if (this.$props.focusShortcuts && this.$props.focusShortcuts.length) {
|
|
27564
|
-
var shortcut = this.$props.focusShortcuts[0];
|
|
27565
|
-
shortcut = shortcut.toLowerCase();
|
|
27566
|
-
shortcut = shortcut.replace('shift', '⬆️');
|
|
27567
|
-
shortcut = shortcut.replace('command', 'cmd');
|
|
27568
|
-
shortcut = shortcut.replace('control', 'ctrl');
|
|
27569
|
-
shortcut = shortcut.replace('option', 'alt');
|
|
27570
|
-
return shortcut.toUpperCase();
|
|
27571
|
-
}
|
|
27572
|
-
return '/';
|
|
27573
|
-
},
|
|
27574
25871
|
renderIcons: function renderIcons() {
|
|
27575
25872
|
var _this7 = this;
|
|
27576
|
-
var _slot3, _slot4, _slot5
|
|
25873
|
+
var _slot3, _slot4, _slot5;
|
|
27577
25874
|
var _this$$props3 = this.$props,
|
|
27578
25875
|
iconPosition = _this$$props3.iconPosition,
|
|
27579
25876
|
showClear = _this$$props3.showClear,
|
|
27580
25877
|
innerClass = _this$$props3.innerClass,
|
|
27581
25878
|
getMicInstance = _this$$props3.getMicInstance,
|
|
27582
25879
|
showVoiceSearch = _this$$props3.showVoiceSearch,
|
|
27583
|
-
showIcon = _this$$props3.showIcon
|
|
27584
|
-
showFocusShortcutsIcon = _this$$props3.showFocusShortcutsIcon;
|
|
25880
|
+
showIcon = _this$$props3.showIcon;
|
|
27585
25881
|
var renderMic = this.$slots.renderMic || this.$props.renderMic;
|
|
27586
25882
|
var currentValue = this.$data.currentValue;
|
|
27587
25883
|
return vue.createVNode("div", null, [vue.createVNode(IconGroup, {
|
|
@@ -27597,14 +25893,6 @@
|
|
|
27597
25893
|
"default": function _default() {
|
|
27598
25894
|
return [_slot3];
|
|
27599
25895
|
}
|
|
27600
|
-
}), showFocusShortcutsIcon && vue.createVNode(ButtonIconWrapper, {
|
|
27601
|
-
"onClick": function onClick(e) {
|
|
27602
|
-
return _this7.focusSearchBox(e);
|
|
27603
|
-
}
|
|
27604
|
-
}, _isSlot$5(_slot4 = _this7.renderShortcut()) ? _slot4 : {
|
|
27605
|
-
"default": function _default() {
|
|
27606
|
-
return [_slot4];
|
|
27607
|
-
}
|
|
27608
25896
|
}), showVoiceSearch && vue.createVNode(Mic, {
|
|
27609
25897
|
"getInstance": getMicInstance,
|
|
27610
25898
|
"render": renderMic,
|
|
@@ -27612,9 +25900,9 @@
|
|
|
27612
25900
|
"className": getClassName$3(innerClass, 'mic') || null
|
|
27613
25901
|
}, null), iconPosition === 'right' && showIcon && vue.createVNode(IconWrapper, {
|
|
27614
25902
|
"onClick": _this7.handleSearchIconClick
|
|
27615
|
-
}, _isSlot$5(
|
|
25903
|
+
}, _isSlot$5(_slot4 = _this7.renderIcon()) ? _slot4 : {
|
|
27616
25904
|
"default": function _default() {
|
|
27617
|
-
return [
|
|
25905
|
+
return [_slot4];
|
|
27618
25906
|
}
|
|
27619
25907
|
})];
|
|
27620
25908
|
}
|
|
@@ -27625,23 +25913,23 @@
|
|
|
27625
25913
|
"default": function _default() {
|
|
27626
25914
|
return [iconPosition === 'left' && showIcon && vue.createVNode(IconWrapper, {
|
|
27627
25915
|
"onClick": _this7.handleSearchIconClick
|
|
27628
|
-
}, _isSlot$5(
|
|
25916
|
+
}, _isSlot$5(_slot5 = _this7.renderIcon()) ? _slot5 : {
|
|
27629
25917
|
"default": function _default() {
|
|
27630
|
-
return [
|
|
25918
|
+
return [_slot5];
|
|
27631
25919
|
}
|
|
27632
25920
|
})];
|
|
27633
25921
|
}
|
|
27634
25922
|
})]);
|
|
27635
25923
|
},
|
|
27636
25924
|
focusSearchBox: function focusSearchBox(event) {
|
|
27637
|
-
var _this$$
|
|
25925
|
+
var _this$$refs2, _this$$refs2$this$$pr;
|
|
27638
25926
|
var elt = event.target || event.srcElement;
|
|
27639
25927
|
var tagName = elt.tagName;
|
|
27640
25928
|
if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
|
|
27641
25929
|
// already in an input
|
|
27642
25930
|
return;
|
|
27643
25931
|
}
|
|
27644
|
-
(_this$$
|
|
25932
|
+
(_this$$refs2 = this.$refs) == null ? void 0 : (_this$$refs2$this$$pr = _this$$refs2[this.$props.innerRef]) == null ? void 0 : _this$$refs2$this$$pr.focus(); // eslint-disable-line
|
|
27645
25933
|
},
|
|
27646
25934
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
27647
25935
|
var _this8 = this;
|
|
@@ -27681,31 +25969,16 @@
|
|
|
27681
25969
|
this.currentValue = decodeHtml(value);
|
|
27682
25970
|
this.triggerDefaultQuery(value);
|
|
27683
25971
|
},
|
|
27684
|
-
|
|
25972
|
+
renderAutoFill: function renderAutoFill(suggestion) {
|
|
27685
25973
|
var _this9 = this;
|
|
27686
25974
|
var handleAutoFillClick = function handleAutoFillClick(e) {
|
|
27687
25975
|
e.stopPropagation();
|
|
27688
25976
|
_this9.onAutofillClick(suggestion);
|
|
27689
25977
|
};
|
|
27690
|
-
|
|
27691
|
-
|
|
27692
|
-
|
|
27693
|
-
|
|
27694
|
-
transform: 'rotate(135deg)',
|
|
27695
|
-
pointerEvents: 'none'
|
|
27696
|
-
}
|
|
27697
|
-
}, null);
|
|
27698
|
-
}
|
|
27699
|
-
return null;
|
|
27700
|
-
}
|
|
27701
|
-
if (!suggestion._category) {
|
|
27702
|
-
/* 👇 avoid showing autofill for category suggestions👇 */
|
|
27703
|
-
|
|
27704
|
-
return vue.createVNode(AutoFillSvg, {
|
|
27705
|
-
"onClick": handleAutoFillClick
|
|
27706
|
-
}, null);
|
|
27707
|
-
}
|
|
27708
|
-
return null;
|
|
25978
|
+
/* 👇 avoid showing autofill for category suggestions👇 */
|
|
25979
|
+
return suggestion._category ? null : vue.createVNode(AutoFillSvg, {
|
|
25980
|
+
"onClick": handleAutoFillClick
|
|
25981
|
+
}, null);
|
|
27709
25982
|
},
|
|
27710
25983
|
renderTag: function renderTag(item) {
|
|
27711
25984
|
var _this10 = this;
|
|
@@ -27812,7 +26085,7 @@
|
|
|
27812
26085
|
return vue.createVNode(HorizontalSkeletonLoader, null, null);
|
|
27813
26086
|
},
|
|
27814
26087
|
renderAIScreenFooter: function renderAIScreenFooter() {
|
|
27815
|
-
var
|
|
26088
|
+
var _slot6;
|
|
27816
26089
|
var _this12 = this;
|
|
27817
26090
|
var _this$$props$AIUIConf2 = this.$props.AIUIConfig,
|
|
27818
26091
|
AIUIConfig = _this$$props$AIUIConf2 === void 0 ? {} : _this$$props$AIUIConf2;
|
|
@@ -27827,7 +26100,7 @@
|
|
|
27827
26100
|
"themePreset": this.$props.themePreset
|
|
27828
26101
|
}, {
|
|
27829
26102
|
"default": function _default() {
|
|
27830
|
-
return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot$5(
|
|
26103
|
+
return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot$5(_slot6 = _this12.getAISourceObjects().map(function (el) {
|
|
27831
26104
|
return vue.createVNode(Button, {
|
|
27832
26105
|
"class": "--ai-source-tag " + (getClassName$3(_this12.$props.innerClass, 'ai-source-tag') || ''),
|
|
27833
26106
|
"title": el[sourceDocumentLabel],
|
|
@@ -27840,9 +26113,9 @@
|
|
|
27840
26113
|
return [el[sourceDocumentLabel]];
|
|
27841
26114
|
}
|
|
27842
26115
|
});
|
|
27843
|
-
})) ?
|
|
26116
|
+
})) ? _slot6 : {
|
|
27844
26117
|
"default": function _default() {
|
|
27845
|
-
return [
|
|
26118
|
+
return [_slot6];
|
|
27846
26119
|
}
|
|
27847
26120
|
})];
|
|
27848
26121
|
}
|
|
@@ -27854,7 +26127,7 @@
|
|
|
27854
26127
|
if (customAIRenderer) {
|
|
27855
26128
|
return customAIRenderer({
|
|
27856
26129
|
question: this.AIResponse && this.AIResponse.response && this.AIResponse.response.question,
|
|
27857
|
-
answer: this.
|
|
26130
|
+
answer: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text,
|
|
27858
26131
|
documentIds: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [],
|
|
27859
26132
|
loading: this.isAIResponseLoading || this.isLoading,
|
|
27860
26133
|
sources: this.getAISourceObjects(),
|
|
@@ -27865,7 +26138,7 @@
|
|
|
27865
26138
|
return this.renderAIScreenLoader();
|
|
27866
26139
|
}
|
|
27867
26140
|
return vue.createVNode("div", null, [vue.createVNode(Answer, {
|
|
27868
|
-
"innerHTML": md.render(this.
|
|
26141
|
+
"innerHTML": md.render(this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text)
|
|
27869
26142
|
}, null), this.renderAIScreenFooter(), this.showFeedbackComponent && vue.createVNode("div", {
|
|
27870
26143
|
"class": "" + (getClassName$3(this.$props.innerClass, 'ai-feedback') || '')
|
|
27871
26144
|
}, [vue.createVNode(AIFeedback, {
|
|
@@ -27974,58 +26247,23 @@
|
|
|
27974
26247
|
highlightedIndex = _ref8.highlightedIndex,
|
|
27975
26248
|
setHighlightedIndex = _ref8.setHighlightedIndex;
|
|
27976
26249
|
var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
|
|
27977
|
-
var getIcon = function getIcon(iconType
|
|
26250
|
+
var getIcon = function getIcon(iconType) {
|
|
27978
26251
|
switch (iconType) {
|
|
27979
26252
|
case helper_16.Recent:
|
|
27980
26253
|
return recentSearchesIcon;
|
|
27981
26254
|
case helper_16.Popular:
|
|
27982
26255
|
return popularSearchesIcon;
|
|
27983
|
-
case helper_16.Featured:
|
|
27984
|
-
if (item.icon) {
|
|
27985
|
-
return function () {
|
|
27986
|
-
return vue.createVNode("div", {
|
|
27987
|
-
"style": {
|
|
27988
|
-
display: 'flex'
|
|
27989
|
-
},
|
|
27990
|
-
"innerHTML": lib$2(item.icon)
|
|
27991
|
-
}, null);
|
|
27992
|
-
};
|
|
27993
|
-
}
|
|
27994
|
-
if (item.iconURL) {
|
|
27995
|
-
return function () {
|
|
27996
|
-
return (// When you change below also change the empty icon below
|
|
27997
|
-
vue.createVNode("img", {
|
|
27998
|
-
"style": {
|
|
27999
|
-
maxHeight: '25px'
|
|
28000
|
-
},
|
|
28001
|
-
"src": lib$2(item.iconURL),
|
|
28002
|
-
"alt": item.value
|
|
28003
|
-
}, null)
|
|
28004
|
-
);
|
|
28005
|
-
};
|
|
28006
|
-
}
|
|
28007
|
-
// Render an empty icon when no icon is provided from the dashboard
|
|
28008
|
-
return function () {
|
|
28009
|
-
return vue.createVNode("span", {
|
|
28010
|
-
"style": {
|
|
28011
|
-
display: 'inline-block',
|
|
28012
|
-
height: '25px',
|
|
28013
|
-
width: leaveSpaceForIcon ? '25px' : 0
|
|
28014
|
-
}
|
|
28015
|
-
}, null);
|
|
28016
|
-
};
|
|
28017
26256
|
default:
|
|
28018
26257
|
return null;
|
|
28019
26258
|
}
|
|
28020
26259
|
};
|
|
28021
|
-
var indexOffset = 0;
|
|
28022
26260
|
return vue.createVNode("div", null, [_this15.hasCustomRenderer && _this15.getComponent({
|
|
28023
26261
|
isOpen: isOpen,
|
|
28024
26262
|
getItemProps: getItemProps,
|
|
28025
26263
|
getItemEvents: getItemEvents,
|
|
28026
26264
|
highlightedIndex: highlightedIndex
|
|
28027
26265
|
}), _this15.renderErrorComponent(), !_this15.hasCustomRenderer && isOpen && hasSuggestions ? vue.createVNode("ul", {
|
|
28028
|
-
"class": suggestions$1(_this15.themePreset, _this15.theme) + " " + getClassName$3(_this15.$props.innerClass, 'list')
|
|
26266
|
+
"class": suggestions$1(_this15.themePreset, _this15.theme) + " " + getClassName$3(_this15.$props.innerClass, 'list'),
|
|
28029
26267
|
"ref": _dropdownULRef
|
|
28030
26268
|
}, [_this15.showAIScreen && vue.createVNode(SearchBoxAISection, {
|
|
28031
26269
|
"themePreset": _this15.$props.themePreset
|
|
@@ -28033,63 +26271,43 @@
|
|
|
28033
26271
|
"default": function _default() {
|
|
28034
26272
|
return [_this15.renderAIScreen(), ' ', _this15.renderErrorComponent(true)];
|
|
28035
26273
|
}
|
|
28036
|
-
}), !_this15.showAIScreen && _this15.
|
|
28037
|
-
|
|
28038
|
-
|
|
28039
|
-
|
|
28040
|
-
|
|
28041
|
-
|
|
28042
|
-
|
|
28043
|
-
|
|
28044
|
-
|
|
28045
|
-
|
|
28046
|
-
|
|
28047
|
-
}
|
|
28048
|
-
|
|
28049
|
-
|
|
28050
|
-
|
|
28051
|
-
|
|
28052
|
-
|
|
28053
|
-
|
|
28054
|
-
|
|
28055
|
-
|
|
28056
|
-
|
|
28057
|
-
|
|
28058
|
-
|
|
28059
|
-
|
|
28060
|
-
|
|
28061
|
-
|
|
28062
|
-
|
|
28063
|
-
|
|
28064
|
-
|
|
28065
|
-
|
|
28066
|
-
|
|
28067
|
-
|
|
28068
|
-
|
|
28069
|
-
|
|
28070
|
-
|
|
28071
|
-
|
|
28072
|
-
|
|
28073
|
-
},
|
|
28074
|
-
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$3(_this15.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$3(_this15.$props.innerClass, 'suggestion-item'))
|
|
28075
|
-
}), [vue.createVNode("div", {
|
|
28076
|
-
"style": {
|
|
28077
|
-
padding: '0 10px 0 0',
|
|
28078
|
-
display: 'flex'
|
|
28079
|
-
}
|
|
28080
|
-
}, [vue.createVNode(CustomSvg, {
|
|
28081
|
-
"key": sectionItem._suggestion_type + "-" + sectionIndex,
|
|
28082
|
-
"className": getClassName$3(_this15.$props.innerClass, sectionItem._suggestion_type + "-search-icon") || null,
|
|
28083
|
-
"icon": getIcon(sectionItem._suggestion_type, sectionItem, suggestionsHaveIcon),
|
|
28084
|
-
"type": sectionItem._suggestion_type + "-search-icon"
|
|
28085
|
-
}, null)]), vue.createVNode(SuggestionItem, {
|
|
28086
|
-
"currentValue": _this15.currentValue,
|
|
28087
|
-
"suggestion": sectionItem
|
|
28088
|
-
}, null), _this15.renderActionIcon(sectionItem)]);
|
|
28089
|
-
})])]);
|
|
28090
|
-
}
|
|
28091
|
-
return vue.createVNode("div", null, [vue.createTextVNode("No suggestions")]);
|
|
28092
|
-
}), _this15.$props.showSuggestionsFooter ? _this15.suggestionsFooter() : null]) : _this15.renderNoSuggestions(_this15.normalizedSuggestions)]);
|
|
26274
|
+
}), !_this15.showAIScreen && _this15.normalizedSuggestions.map(function (item, index) {
|
|
26275
|
+
return renderItem ? vue.createVNode("li", vue.mergeProps(getItemProps({
|
|
26276
|
+
item: item
|
|
26277
|
+
}), getItemEvents({
|
|
26278
|
+
item: item
|
|
26279
|
+
}), {
|
|
26280
|
+
"key": index + 1 + "-" + item.value,
|
|
26281
|
+
"style": {
|
|
26282
|
+
backgroundColor: _this15.getBackgroundColor(highlightedIndex, index),
|
|
26283
|
+
justifyContent: 'flex-start',
|
|
26284
|
+
alignItems: 'center'
|
|
26285
|
+
}
|
|
26286
|
+
}), [renderItem(item)]) : vue.createVNode("li", vue.mergeProps(getItemProps({
|
|
26287
|
+
item: item
|
|
26288
|
+
}), babelHelperVueTransformOn(getItemEvents({
|
|
26289
|
+
item: item
|
|
26290
|
+
})), {
|
|
26291
|
+
"key": index + 1 + "-" + item.value,
|
|
26292
|
+
"style": {
|
|
26293
|
+
backgroundColor: _this15.getBackgroundColor(highlightedIndex, index),
|
|
26294
|
+
justifyContent: 'flex-start',
|
|
26295
|
+
alignItems: 'center'
|
|
26296
|
+
}
|
|
26297
|
+
}), [vue.createVNode("div", {
|
|
26298
|
+
"style": {
|
|
26299
|
+
padding: '0 10px 0 0',
|
|
26300
|
+
display: 'flex'
|
|
26301
|
+
}
|
|
26302
|
+
}, [vue.createVNode(CustomSvg, {
|
|
26303
|
+
"className": getClassName$3(_this15.$props.innerClass, item._suggestion_type + "-search-icon") || null,
|
|
26304
|
+
"icon": getIcon(item._suggestion_type),
|
|
26305
|
+
"type": item._suggestion_type + "-search-icon"
|
|
26306
|
+
}, null)]), vue.createVNode(SuggestionItem, {
|
|
26307
|
+
"currentValue": _this15.currentValue,
|
|
26308
|
+
"suggestion": item
|
|
26309
|
+
}, null), _this15.renderAutoFill(item)]);
|
|
26310
|
+
})]) : _this15.renderNoSuggestions(_this15.normalizedSuggestions)]);
|
|
28093
26311
|
};
|
|
28094
26312
|
return vue.createVNode("div", {
|
|
28095
26313
|
"class": suggestionsContainer
|
|
@@ -28129,8 +26347,7 @@
|
|
|
28129
26347
|
"placeholder": _this15.$props.placeholder,
|
|
28130
26348
|
"autoFocus": _this15.$props.autoFocus,
|
|
28131
26349
|
"showFocusShortcutsIcon": _this15.$props.showFocusShortcutsIcon,
|
|
28132
|
-
"showVoiceSearch": _this15.$props.showVoiceSearch
|
|
28133
|
-
"searchBox": true
|
|
26350
|
+
"showVoiceSearch": _this15.$props.showVoiceSearch
|
|
28134
26351
|
}, getInputProps({
|
|
28135
26352
|
value: _this15.$data.currentValue === null ? '' : _this15.$data.currentValue
|
|
28136
26353
|
}), {
|
|
@@ -28864,7 +27081,7 @@
|
|
|
28864
27081
|
// Add componentType for SSR
|
|
28865
27082
|
AIConnected.componentType = constants_1$1.AIAnswer;
|
|
28866
27083
|
|
|
28867
|
-
var _templateObject$
|
|
27084
|
+
var _templateObject$l, _templateObject2$9, _templateObject3$7;
|
|
28868
27085
|
var item = {
|
|
28869
27086
|
width: '15px',
|
|
28870
27087
|
height: '15px',
|
|
@@ -28877,7 +27094,7 @@
|
|
|
28877
27094
|
theme = _ref$theme === void 0 ? {} : _ref$theme;
|
|
28878
27095
|
return "\n\t" + vh + ";\n\n\t&:focus {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tbox-shadow: 0 0 0 2px " + curriedLighten(0.4, theme.colors.primaryColor) + ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:hover {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: " + theme.colors.primaryColor + ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:active {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\ttransition-duration: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t+ label {\n\t\tposition: relative;\n\t\tuser-select: none;\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\talign-items: center;\n\t\tcursor: pointer;\n\n\t\t&::before {\n\t\t\tbackground-color: #fff;\n\t\t\tborder: 1px solid " + (theme.colors.borderColor || curriedLighten(0.1, theme.colors.textColor)) + ";\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tcolor: " + theme.colors.primaryColor + ";\n\t\t\tmargin-right: calc(" + item.width + " * 0.5);\n\t\t\ttop: 50%;\n\t\t\tleft: 0;\n\t\t\twidth: " + item.width + ";\n\t\t\theight: " + item.height + ";\n\t\t\tdisplay: inline-block;\n\t\t\tvertical-align: middle;\n\t\t}\n\n\t\t&::after {\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tbackground-color: " + theme.colors.primaryColor + ";\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + " + item.scale + " / 2);\n\t\t\twidth: calc(" + item.width + " - " + item.scale + ");\n\t\t\theight: calc(" + item.height + " - " + item.scale + ");\n\t\t\tmargin-top: calc(" + item.height + " / -2 - " + item.scale + " / -2);\n\t\t\ttransform: scale(0);\n\t\t\ttransform-origin: 50%;\n\t\t\ttransition: transform 200ms ease-out;\n\t\t}\n\t}\n";
|
|
28879
27096
|
};
|
|
28880
|
-
var Radio = styled('input')(_templateObject$
|
|
27097
|
+
var Radio = styled('input')(_templateObject$l || (_templateObject$l = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 50%;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t&:active,\n\t\t&:focus {\n\t\t\t+ label {\n\t\t\t\tcolor: ", ";\n\n\t\t\t\t&::before {\n\t\t\t\t\tanimation: none;\n\t\t\t\t\tfilter: none;\n\t\t\t\t\ttransition: none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tanimation: none;\n\t\t\t\tbackground-color: #fff;\n\t\t\t\tborder-color: ", ";\n\t\t}\n\n\t\t&::after {\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n"])), formItem, function (props) {
|
|
28881
27098
|
return props.show ? null : hideInputControl;
|
|
28882
27099
|
}, function (_ref2) {
|
|
28883
27100
|
var theme = _ref2.theme;
|
|
@@ -28886,7 +27103,7 @@
|
|
|
28886
27103
|
var theme = _ref3.theme;
|
|
28887
27104
|
return theme.colors.primaryColor;
|
|
28888
27105
|
});
|
|
28889
|
-
var Checkbox = styled('input')(_templateObject2$
|
|
27106
|
+
var Checkbox = styled('input')(_templateObject2$9 || (_templateObject2$9 = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 0;\n\t\t}\n\n\t\t&::after {\n\t\t\tbackground-color: transparent;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 5);\n\t\t\twidth: calc(", " / 2);\n\t\t\theight: calc(", " / 5);\n\t\t\tmargin-top: calc(", " / -2 / 2 * 0.8);\n\t\t\tborder-style: solid;\n\t\t\tborder-color: ", ";\n\t\t\tborder-width: 0 0 2px 2px;\n\t\t\tborder-radius: 0;\n\t\t\tborder-image: none;\n\t\t\ttransform: rotate(-45deg) scale(0);\n\t\t\ttransition: none;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\n\t\t\t&::after {\n\t\t\t\tcontent: '';\n\t\t\t\ttransform: rotate(-45deg) scale(1);\n\t\t\t\ttransition: transform 200ms ease-out;\n\t\t\t}\n\t\t}\n\t}\n"])), formItem, function (props) {
|
|
28890
27107
|
return props.show ? null : hideInputControl;
|
|
28891
27108
|
}, item.width, item.width, item.width, item.height, function (_ref4) {
|
|
28892
27109
|
var theme = _ref4.theme;
|
|
@@ -30875,9 +29092,9 @@
|
|
|
30875
29092
|
});
|
|
30876
29093
|
var types$1 = unwrapExports(types_1);
|
|
30877
29094
|
|
|
30878
|
-
var _templateObject$
|
|
30879
|
-
var HierarchicalMenuList = styled('ul')(_templateObject$
|
|
30880
|
-
var HierarchicalMenuListItem = styled('li')(_templateObject2$
|
|
29095
|
+
var _templateObject$m, _templateObject2$a;
|
|
29096
|
+
var HierarchicalMenuList = styled('ul')(_templateObject$m || (_templateObject$m = _taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 0;\n\toverflow: hidden;\n\n\t&.--open {\n\t\tmax-height: 100%;\n\t}\n"])));
|
|
29097
|
+
var HierarchicalMenuListItem = styled('li')(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteralLoose(["\n\tfont-weight: 400;\n\tline-height: 1.5;\n\tbox-sizing: border-box;\n\n\ta {\n\t\tcolor: #424242;\n\t\ttext-decoration: none;\n\t\tgap: 5px;\n\t\t.--leaf-icon,\n\t\t.--folder-icon {\n\t\t\tline-height: 15px;\n\t\t\tsvg {\n\t\t\t\theight: 15px;\n\t\t\t}\n\t\t}\n\n\t\tinput {\n\t\t\tmargin: 0;\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n\n\t.--switcher-icon {\n\t\ttransition: all 0.2s ease-in;\n\t\tmargin-right: 2px;\n\t}\n\t.--list-child {\n\t\tpadding-left: 1rem;\n\t\tposition: relative;\n\t\t&:before {\n\t\t\theight: 100%;\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\tborder-left: 1px solid #787878;\n\t\t\twidth: 0;\n\t\t\tleft: 19px;\n\t\t\t", ";\n\t\t}\n\n\t\t&.--show-switcher-icon {\n\t\t\tpadding-left: 36px;\n\t\t}\n\t}\n\t.--list-item-label {\n\t\tline-height: 100%;\n\t}\n\t.--list-item-count {\n\t\tmargin-left: 10px;\n\t\tpadding: 0.1rem 0.4rem;\n\t\tfont-size: 0.8rem;\n\t\tcolor: #424242;\n\t\tbackground-color: #dee1e6;\n\t\tborder-radius: 8px;\n\t}\n\t&.-selected-item {\n\t\tfont-weight: 700 !important;\n\t}\n\t&.-expanded-item {\n\t\t& > a {\n\t\t\t& div > .--switcher-icon {\n\t\t\t\ttransform: rotate(90deg);\n\t\t\t}\n\t\t}\n\t}\n\t.--list-item-label-count-wrapper {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\t&:hover {\n\t\t\t.--list-item-count,\n\t\t\t.--list-item-label {\n\t\t\t\tfont-weight: 700;\n\t\t\t}\n\t\t}\n\t}\n"])), function (props) {
|
|
30881
29098
|
return !props.showLine && "\n\t\t\t\t\tdisplay: none;\n\t\t\t\t";
|
|
30882
29099
|
});
|
|
30883
29100
|
|
|
@@ -31638,26 +29855,26 @@
|
|
|
31638
29855
|
// Add componentType for SSR
|
|
31639
29856
|
TreeListConnected.componentType = constants_1$1.treeList;
|
|
31640
29857
|
|
|
31641
|
-
var _templateObject$
|
|
29858
|
+
var _templateObject$n, _templateObject2$b;
|
|
31642
29859
|
var small = "\n\tmin-height: 0;\n\theight: 30px;\n\tborder: 0;\n\tbox-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;\n\tborder-radius: 2px;\n";
|
|
31643
29860
|
var dark$2 = function dark(_ref) {
|
|
31644
29861
|
var theme = _ref.theme;
|
|
31645
29862
|
return "\n\tbackground-color: " + (theme.colors ? theme.colors.backgroundColor : '') + ";\n\tborder-color: " + (theme.colors ? theme.colors.borderColor : '') + ";\n\tcolor: " + (theme.colors ? theme.colors.textColor : '') + ";\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: " + (theme.colors ? theme.colors.backgroundColor : '') + ";\n\t}\n";
|
|
31646
29863
|
};
|
|
31647
|
-
var Select = styled('button')(_templateObject$
|
|
29864
|
+
var Select = styled('button')(_templateObject$n || (_templateObject$n = _taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tmin-height: 42px;\n\tborder-radius: 0;\n\toutline: none;\n\tpadding: 5px 12px;\n\tfont-size: 0.9rem;\n\tline-height: 1.2rem;\n\tbackground-color: #fff;\n\tborder: 1px solid #ccc;\n\tcolor: #424242;\n\tcursor: pointer;\n\tuser-select: none;\n\ttransition: all 0.3s ease;\n\n\t", ";\n\n\t& > div {\n\t\twidth: calc(100% - 24px);\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\ttext-align: left;\n\t}\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: #fcfcfc;\n\t}\n\n\t", ";\n"])), function (props) {
|
|
31648
29865
|
return props.small ? small : null;
|
|
31649
29866
|
}, function (_ref2) {
|
|
31650
29867
|
var themePreset = _ref2.themePreset;
|
|
31651
29868
|
return themePreset === 'dark' && dark$2;
|
|
31652
29869
|
});
|
|
31653
|
-
var Tick = styled('span')(_templateObject2$
|
|
29870
|
+
var Tick = styled('span')(_templateObject2$b || (_templateObject2$b = _taggedTemplateLiteralLoose(["\n\twidth: 16px;\n\theight: 16px;\n\tdisplay: inline-block;\n\tposition: relative;\n\tuser-select: none;\n\talign-items: center;\n\n\t&::after {\n\t\tbox-sizing: content-box;\n\t\tcontent: '';\n\t\tposition: absolute;\n\t\tbackground-color: transparent;\n\t\ttop: 50%;\n\t\tleft: 0;\n\t\twidth: 8px;\n\t\theight: 4px;\n\t\tmargin-top: -4px;\n\t\tborder-style: solid;\n\t\tborder-color: ", ";\n\t\tborder-width: 0 0 2px 2px;\n\t\tborder-radius: 0;\n\t\tborder-image: none;\n\t\ttransform: rotate(-45deg) scale(1);\n\t\ttransition: all 200ms ease-out;\n\t}\n"])), function (_ref3) {
|
|
31654
29871
|
var theme = _ref3.theme;
|
|
31655
29872
|
return theme.colors.primaryColor;
|
|
31656
29873
|
});
|
|
31657
29874
|
|
|
31658
|
-
var _templateObject$
|
|
29875
|
+
var _templateObject$o;
|
|
31659
29876
|
var open = "\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n";
|
|
31660
|
-
var Chevron = styled('span')(_templateObject$
|
|
29877
|
+
var Chevron = styled('span')(_templateObject$o || (_templateObject$o = _taggedTemplateLiteralLoose(["\n\t&::before {\n\t\tcontent: '';\n\t\tborder-style: solid;\n\t\tborder-width: 0.15em 0.15em 0 0;\n\t\tdisplay: inline-block;\n\t\theight: 0.45em;\n\t\tposition: relative;\n\t\ttop: 0.35em;\n\t\tleft: 0;\n\t\ttransform: rotate(135deg);\n\t\tvertical-align: top;\n\t\twidth: 0.45em;\n\n\t\t", ";\n\t}\n"])), function (props) {
|
|
31661
29878
|
return props.open ? open : null;
|
|
31662
29879
|
});
|
|
31663
29880
|
|
|
@@ -33371,8 +31588,8 @@
|
|
|
33371
31588
|
}
|
|
33372
31589
|
});
|
|
33373
31590
|
|
|
33374
|
-
var _templateObject$
|
|
33375
|
-
var Slider = styled('div')(_templateObject$
|
|
31591
|
+
var _templateObject$p;
|
|
31592
|
+
var Slider = styled('div')(_templateObject$p || (_templateObject$p = _taggedTemplateLiteralLoose(["\n\tmargin-top: 30px;\n\tpadding: 10px;\n\n\t/* component style */\n\t.vue-slider-disabled {\n\t\topacity: 0.5;\n\t\tcursor: not-allowed;\n\t}\n\n\t/* rail style */\n\t.vue-slider-rail {\n\t\tbackground-color: #ccc;\n\t\tborder-radius: 15px;\n\t\theight: 4px;\n\t}\n\n\t/* process style */\n\t.vue-slider-process {\n\t\tbackground-color: #0b6aff;\n\t\tborder-radius: 15px;\n\t}\n\n\t/* mark style */\n\t.vue-slider-mark {\n\t\tz-index: 4;\n\t}\n\n\t.vue-slider-mark:first-child .vue-slider-mark-step,\n\t.vue-slider-mark:last-child .vue-slider-mark-step {\n\t\tdisplay: none;\n\t}\n\n\t.vue-slider-mark-step {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: rgba(0, 0, 0, 0.16);\n\t}\n\n\t.vue-slider-mark-label {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t}\n\n\t/* dot style */\n\t.vue-slider-dot {\n\t\tz-index: 2;\n\t}\n\n\t.vue-slider-dot-handle {\n\t\tcursor: pointer;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: #fff;\n\t\tbox-sizing: border-box;\n\t\tborder: 1px solid #9a9a9a;\n\t\tz-index: 2;\n\t\tbox-shadow: 0.5px 0.5px 2px 1px rgb(0 0 0 / 32%);\n\t}\n\n\t.vue-slider-dot-handle-disabled {\n\t\tcursor: not-allowed;\n\t\tbackground-color: #ccc;\n\t}\n\n\t.vue-slider-dot-tooltip-inner {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t\tpadding: 2px 5px;\n\t\tmin-width: 20px;\n\t\ttext-align: center;\n\t\tcolor: #fff;\n\t\tborder-radius: 5px;\n\t\tborder: 1px solid #3498db;\n\t\tbackground-color: #3498db;\n\t\tbox-sizing: content-box;\n\t}\n\n\t.vue-slider-dot-tooltip-inner::after {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-top::after {\n\t\ttop: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-top-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-bottom::after {\n\t\tbottom: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-bottom-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-left::after {\n\t\tleft: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-left-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-right::after {\n\t\tright: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-right-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-wrapper {\n\t\topacity: 0;\n\t\ttransition: all 0.3s;\n\t}\n\t.vue-slider-dot-tooltip-wrapper-show {\n\t\topacity: 1;\n\t}\n\n\t.label-container {\n\t\tmargin: 10px 0;\n\t\twidth: 100%;\n\t}\n\n\t.range-label-right {\n\t\tfloat: right;\n\t}\n"])));
|
|
33376
31593
|
|
|
33377
31594
|
var global$1 = typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
|
|
33378
31595
|
|
|
@@ -34492,12 +32709,12 @@
|
|
|
34492
32709
|
// Add componentType for SSR
|
|
34493
32710
|
RangeConnected$3.componentType = constants_1$1.rangeSlider;
|
|
34494
32711
|
|
|
34495
|
-
var _templateObject$
|
|
32712
|
+
var _templateObject$q;
|
|
34496
32713
|
var alert = function alert(_ref) {
|
|
34497
32714
|
var theme = _ref.theme;
|
|
34498
32715
|
return "\n\tcolor: " + theme.colors.alertColor + ";\n";
|
|
34499
32716
|
};
|
|
34500
|
-
var Content = styled('div')(_templateObject$
|
|
32717
|
+
var Content = styled('div')(_templateObject$q || (_templateObject$q = _taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"])), function (props) {
|
|
34501
32718
|
return props.alert && alert;
|
|
34502
32719
|
});
|
|
34503
32720
|
|
|
@@ -35873,15 +34090,9 @@
|
|
|
35873
34090
|
ctr: function ctr() {
|
|
35874
34091
|
return google.maps.Polyline;
|
|
35875
34092
|
},
|
|
35876
|
-
|
|
35877
|
-
afterCreate: function afterCreate(inst) {
|
|
34093
|
+
afterCreate: function afterCreate() {
|
|
35878
34094
|
var _this = this;
|
|
35879
34095
|
var clearEvents = function clearEvents() {};
|
|
35880
|
-
events.forEach(function (event) {
|
|
35881
|
-
inst.addListener(event, function (payload) {
|
|
35882
|
-
_this.$emit(event, payload);
|
|
35883
|
-
});
|
|
35884
|
-
});
|
|
35885
34096
|
this.$watch('path', function (path) {
|
|
35886
34097
|
if (path) {
|
|
35887
34098
|
clearEvents();
|
|
@@ -35931,7 +34142,7 @@
|
|
|
35931
34142
|
noBind: true
|
|
35932
34143
|
}
|
|
35933
34144
|
};
|
|
35934
|
-
var events$1 = ['click', 'dblclick', 'drag', 'dragend', 'dragstart', 'mousedown', 'mousemove', 'mouseout', 'mouseover', 'mouseup', 'rightclick'
|
|
34145
|
+
var events$1 = ['click', 'dblclick', 'drag', 'dragend', 'dragstart', 'mousedown', 'mousemove', 'mouseout', 'mouseover', 'mouseup', 'rightclick'];
|
|
35935
34146
|
var Polygon = buildComponent({
|
|
35936
34147
|
props: {
|
|
35937
34148
|
deepWatch: {
|
|
@@ -35945,7 +34156,6 @@
|
|
|
35945
34156
|
ctr: function ctr() {
|
|
35946
34157
|
return google.maps.Polygon;
|
|
35947
34158
|
},
|
|
35948
|
-
emits: events$1,
|
|
35949
34159
|
beforeCreate: function beforeCreate(options) {
|
|
35950
34160
|
if (!options.path) delete options.path;
|
|
35951
34161
|
if (!options.paths) delete options.paths;
|
|
@@ -35953,11 +34163,6 @@
|
|
|
35953
34163
|
afterCreate: function afterCreate(inst) {
|
|
35954
34164
|
var _this = this;
|
|
35955
34165
|
var clearEvents = function clearEvents() {};
|
|
35956
|
-
events$1.forEach(function (event) {
|
|
35957
|
-
inst.addListener(event, function (payload) {
|
|
35958
|
-
_this.$emit(event, payload);
|
|
35959
|
-
});
|
|
35960
|
-
});
|
|
35961
34166
|
|
|
35962
34167
|
// Watch paths, on our own, because we do not want to set either when it is
|
|
35963
34168
|
// empty
|
|
@@ -36050,16 +34255,7 @@
|
|
|
36050
34255
|
ctr: function ctr() {
|
|
36051
34256
|
return google.maps.Circle;
|
|
36052
34257
|
},
|
|
36053
|
-
events: events$2
|
|
36054
|
-
emits: events$2,
|
|
36055
|
-
afterCreate: function afterCreate(inst) {
|
|
36056
|
-
var _this = this;
|
|
36057
|
-
events$2.forEach(function (event) {
|
|
36058
|
-
inst.addListener(event, function (payload) {
|
|
36059
|
-
_this.$emit(event, payload);
|
|
36060
|
-
});
|
|
36061
|
-
});
|
|
36062
|
-
}
|
|
34258
|
+
events: events$2
|
|
36063
34259
|
});
|
|
36064
34260
|
|
|
36065
34261
|
var props$4 = {
|
|
@@ -36087,16 +34283,7 @@
|
|
|
36087
34283
|
ctr: function ctr() {
|
|
36088
34284
|
return google.maps.Rectangle;
|
|
36089
34285
|
},
|
|
36090
|
-
events: events$3
|
|
36091
|
-
emits: events$3,
|
|
36092
|
-
afterCreate: function afterCreate(inst) {
|
|
36093
|
-
var _this = this;
|
|
36094
|
-
events$3.forEach(function (event) {
|
|
36095
|
-
inst.addListener(event, function (payload) {
|
|
36096
|
-
_this.$emit(event, payload);
|
|
36097
|
-
});
|
|
36098
|
-
});
|
|
36099
|
-
}
|
|
34286
|
+
events: events$3
|
|
36100
34287
|
});
|
|
36101
34288
|
|
|
36102
34289
|
var props$5 = {
|
|
@@ -37758,16 +35945,14 @@
|
|
|
37758
35945
|
this.$infoWindowObject.close();
|
|
37759
35946
|
if (this.opened) {
|
|
37760
35947
|
this.$infoWindowObject.open(this.$map, this.$markerObject);
|
|
35948
|
+
} else {
|
|
35949
|
+
this.$emit('closeclick');
|
|
37761
35950
|
}
|
|
37762
35951
|
}
|
|
37763
35952
|
},
|
|
37764
35953
|
afterCreate: function afterCreate() {
|
|
37765
35954
|
var _this2 = this;
|
|
37766
35955
|
this._openInfoWindow();
|
|
37767
|
-
this.$infoWindowObject.addListener('closeclick', function () {
|
|
37768
|
-
_this2.$emit('closeclick');
|
|
37769
|
-
_this2.$infoWindowObject.open(_this2.$map, _this2.$markerObject);
|
|
37770
|
-
});
|
|
37771
35956
|
this.$watch('opened', function () {
|
|
37772
35957
|
_this2._openInfoWindow();
|
|
37773
35958
|
});
|
|
@@ -37905,18 +36090,6 @@
|
|
|
37905
36090
|
type: Number,
|
|
37906
36091
|
noBind: true
|
|
37907
36092
|
},
|
|
37908
|
-
maxZoom: {
|
|
37909
|
-
required: false,
|
|
37910
|
-
twoWay: true,
|
|
37911
|
-
type: Number,
|
|
37912
|
-
noBind: true
|
|
37913
|
-
},
|
|
37914
|
-
minZoom: {
|
|
37915
|
-
required: false,
|
|
37916
|
-
twoWay: true,
|
|
37917
|
-
type: Number,
|
|
37918
|
-
noBind: true
|
|
37919
|
-
},
|
|
37920
36093
|
heading: {
|
|
37921
36094
|
type: Number,
|
|
37922
36095
|
twoWay: true
|
|
@@ -40365,9 +38538,9 @@
|
|
|
40365
38538
|
}
|
|
40366
38539
|
};
|
|
40367
38540
|
|
|
40368
|
-
var _templateObject$
|
|
40369
|
-
var MapPin = styled('div')(_templateObject$
|
|
40370
|
-
var MapPinArrow = styled('div')(_templateObject2$
|
|
38541
|
+
var _templateObject$r, _templateObject2$c, _templateObject3$8;
|
|
38542
|
+
var MapPin = styled('div')(_templateObject$r || (_templateObject$r = _taggedTemplateLiteralLoose(["\n\theight: 24px;\n\twidth: auto;\n\tbackground-color: #fff;\n\tborder-radius: 2px;\n\tcolor: #222;\n\tbox-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.15);\n\tpadding: 3px 6px;\n\tfont-size: 15px;\n"])));
|
|
38543
|
+
var MapPinArrow = styled('div')(_templateObject2$c || (_templateObject2$c = _taggedTemplateLiteralLoose(["\n\tborder-color: rgba(0, 0, 0, 0.2);\n\tborder-style: solid;\n\tborder-width: 0 1px 1px 0;\n\tmargin-left: -6px;\n\tbackground-color: #fff;\n\tmargin-top: -6px;\n\twidth: 12px;\n\theight: 12px;\n\t-webkit-transform: rotate(45deg);\n\t-ms-transform: rotate(45deg);\n\ttransform: rotate(45deg);\n"])));
|
|
40371
38544
|
var mapPinWrapper = css(_templateObject3$8 || (_templateObject3$8 = _taggedTemplateLiteralLoose(["\n\t&:hover,\n\t&:focus {\n\t\tz-index: 200;\n\t}\n"])));
|
|
40372
38545
|
|
|
40373
38546
|
var recordResultClick$3 = lib_5.recordResultClick;
|
|
@@ -40696,7 +38869,7 @@
|
|
|
40696
38869
|
}
|
|
40697
38870
|
};
|
|
40698
38871
|
|
|
40699
|
-
var _templateObject$
|
|
38872
|
+
var _templateObject$s;
|
|
40700
38873
|
var ReactiveGoogleMap = {
|
|
40701
38874
|
name: 'ReactiveGoogleMap',
|
|
40702
38875
|
props: {
|
|
@@ -40771,7 +38944,7 @@
|
|
|
40771
38944
|
"style": {
|
|
40772
38945
|
height: '100%'
|
|
40773
38946
|
},
|
|
40774
|
-
"class": css(_templateObject$
|
|
38947
|
+
"class": css(_templateObject$s || (_templateObject$s = _taggedTemplateLiteralLoose(["\n\t\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\t"]))),
|
|
40775
38948
|
"options": {
|
|
40776
38949
|
zoomControl: true
|
|
40777
38950
|
},
|
|
@@ -41030,7 +39203,7 @@
|
|
|
41030
39203
|
httpEquiv: "http-equiv"
|
|
41031
39204
|
};
|
|
41032
39205
|
var escapeRE = /["'&<>]/;
|
|
41033
|
-
function escapeHtml$
|
|
39206
|
+
function escapeHtml$1(string) {
|
|
41034
39207
|
var str = "" + string;
|
|
41035
39208
|
var match = escapeRE.exec(str);
|
|
41036
39209
|
if (!match) {
|
|
@@ -41100,7 +39273,7 @@
|
|
|
41100
39273
|
if (isBooleanAttr(attrKey)) {
|
|
41101
39274
|
return includeBooleanAttr(value) ? " " + attrKey : "";
|
|
41102
39275
|
} else if (isSSRSafeAttrName(attrKey)) {
|
|
41103
|
-
return value === "" ? " " + attrKey : " " + attrKey + "=\"" + escapeHtml$
|
|
39276
|
+
return value === "" ? " " + attrKey : " " + attrKey + "=\"" + escapeHtml$1(value) + "\"";
|
|
41104
39277
|
} else {
|
|
41105
39278
|
console.warn("[@vue/server-renderer] Skipped rendering unsafe attribute name: " + attrKey);
|
|
41106
39279
|
return "";
|
|
@@ -41114,17 +39287,17 @@
|
|
|
41114
39287
|
return type === "string" || type === "number" || type === "boolean";
|
|
41115
39288
|
}
|
|
41116
39289
|
function ssrRenderClass(raw) {
|
|
41117
|
-
return escapeHtml$
|
|
39290
|
+
return escapeHtml$1(normalizeClass(raw));
|
|
41118
39291
|
}
|
|
41119
39292
|
function ssrRenderStyle(raw) {
|
|
41120
39293
|
if (!raw) {
|
|
41121
39294
|
return "";
|
|
41122
39295
|
}
|
|
41123
39296
|
if (isString(raw)) {
|
|
41124
|
-
return escapeHtml$
|
|
39297
|
+
return escapeHtml$1(raw);
|
|
41125
39298
|
}
|
|
41126
39299
|
var styles = normalizeStyle(raw);
|
|
41127
|
-
return escapeHtml$
|
|
39300
|
+
return escapeHtml$1(stringifyStyle(styles));
|
|
41128
39301
|
}
|
|
41129
39302
|
function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) {
|
|
41130
39303
|
parentPush("<!--teleport start-->");
|
|
@@ -41287,7 +39460,7 @@
|
|
|
41287
39460
|
children = vnode.children;
|
|
41288
39461
|
switch (type) {
|
|
41289
39462
|
case vue.Text:
|
|
41290
|
-
push(escapeHtml$
|
|
39463
|
+
push(escapeHtml$1(children));
|
|
41291
39464
|
break;
|
|
41292
39465
|
case vue.Comment:
|
|
41293
39466
|
push(children ? "<!--" + escapeHtmlComment(children) + "-->" : "<!---->");
|
|
@@ -41360,15 +39533,15 @@
|
|
|
41360
39533
|
push(props.innerHTML);
|
|
41361
39534
|
} else if (props.textContent) {
|
|
41362
39535
|
hasChildrenOverride = true;
|
|
41363
|
-
push(escapeHtml$
|
|
39536
|
+
push(escapeHtml$1(props.textContent));
|
|
41364
39537
|
} else if (tag === "textarea" && props.value) {
|
|
41365
39538
|
hasChildrenOverride = true;
|
|
41366
|
-
push(escapeHtml$
|
|
39539
|
+
push(escapeHtml$1(props.value));
|
|
41367
39540
|
}
|
|
41368
39541
|
}
|
|
41369
39542
|
if (!hasChildrenOverride) {
|
|
41370
39543
|
if (shapeFlag & 8) {
|
|
41371
|
-
push(escapeHtml$
|
|
39544
|
+
push(escapeHtml$1(children));
|
|
41372
39545
|
} else if (shapeFlag & 16) {
|
|
41373
39546
|
renderVNodeChildren(push, children, parentComponent, slotScopeId);
|
|
41374
39547
|
}
|
|
@@ -41875,7 +40048,7 @@
|
|
|
41875
40048
|
}, queryString, renderFunction);
|
|
41876
40049
|
}
|
|
41877
40050
|
|
|
41878
|
-
var version = "3.0.0-rc.
|
|
40051
|
+
var version = "3.0.0-rc.9";
|
|
41879
40052
|
|
|
41880
40053
|
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];
|
|
41881
40054
|
function install$1 (Vue) {
|