@appbaseio/reactivesearch-vue 3.0.0-rc.6.4 → 3.0.0-rc.6.6
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 +2080 -197
- 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-aef75c14.js → DropDown-dcdaf54f.js} +12 -4
- package/dist/cjs/{Input-56eba499.js → Input-df30e5fc.js} +23 -16
- 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 +4 -3
- package/dist/cjs/{install-65eec53a.js → install-3821345b.js} +371 -125
- package/dist/cjs/install.js +4 -3
- package/dist/cjs/version.js +1 -1
- package/dist/es/{DropDown-39fedff8.js → DropDown-bede2a41.js} +12 -5
- package/dist/es/{Input-11d211d2.js → Input-4376ac1f.js} +23 -17
- 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 +5 -4
- package/dist/es/{install-cb6c5753.js → install-af4c53c4.js} +373 -127
- package/dist/es/install.js +4 -3
- package/dist/es/version.js +1 -1
- package/package.json +90 -89
|
@@ -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', 'enablePredictiveSuggestions', 'applyStopwords', 'customStopwords', 'enableIndexSuggestions', 'enableFeaturedSuggestions', 'searchboxId', 'endpoint', 'enableEndpointSuggestions', 'enableAI', 'AIConfig'];
|
|
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', 'FAQSuggestionsConfig', 'enablePredictiveSuggestions', 'applyStopwords', 'customStopwords', 'enableIndexSuggestions', 'enableFeaturedSuggestions', 'enableFAQSuggestions', 'searchboxId', 'endpoint', 'enableEndpointSuggestions', 'enableAI', 'AIConfig'];
|
|
1193
1193
|
var CLEAR_ALL = exports.CLEAR_ALL = {
|
|
1194
1194
|
NEVER: 'never',
|
|
1195
1195
|
ALWAYS: 'always',
|
|
@@ -5249,7 +5249,8 @@
|
|
|
5249
5249
|
Index: 'index',
|
|
5250
5250
|
Recent: 'recent',
|
|
5251
5251
|
Promoted: 'promoted',
|
|
5252
|
-
Featured: 'featured'
|
|
5252
|
+
Featured: 'featured',
|
|
5253
|
+
FAQ: 'faq'
|
|
5253
5254
|
};
|
|
5254
5255
|
var featuredSuggestionsActionTypes = exports.featuredSuggestionsActionTypes = {
|
|
5255
5256
|
NAVIGATE: 'navigate',
|
|
@@ -6244,6 +6245,8 @@
|
|
|
6244
6245
|
featuredSuggestionsConfig: props.featuredSuggestionsConfig,
|
|
6245
6246
|
indexSuggestionsConfig: props.indexSuggestionsConfig,
|
|
6246
6247
|
enableFeaturedSuggestions: props.enableFeaturedSuggestions,
|
|
6248
|
+
enableFAQSuggestions: props.enableFAQSuggestions,
|
|
6249
|
+
FAQSuggestionsConfig: props.FAQSuggestionsConfig,
|
|
6247
6250
|
enableIndexSuggestions: props.enableIndexSuggestions
|
|
6248
6251
|
}, props.searchboxId ? {
|
|
6249
6252
|
searchboxId: props.searchboxId
|
|
@@ -7681,6 +7684,7 @@
|
|
|
7681
7684
|
exports.loadMore = loadMore;
|
|
7682
7685
|
exports.loadDataToExport = loadDataToExport;
|
|
7683
7686
|
exports.fetchAIResponse = fetchAIResponse;
|
|
7687
|
+
exports.createAISession = createAISession;
|
|
7684
7688
|
function _objectWithoutProperties(obj, keys) {
|
|
7685
7689
|
var target = {};
|
|
7686
7690
|
for (var i in obj) {
|
|
@@ -8372,6 +8376,46 @@
|
|
|
8372
8376
|
doFetch();
|
|
8373
8377
|
};
|
|
8374
8378
|
}
|
|
8379
|
+
function createAISession() {
|
|
8380
|
+
var question = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Reactivesearch';
|
|
8381
|
+
return function (dispatch, getState) {
|
|
8382
|
+
var _getState7 = getState(),
|
|
8383
|
+
_getState7$config = _getState7.config,
|
|
8384
|
+
url = _getState7$config.url,
|
|
8385
|
+
configCredentials = _getState7$config.credentials,
|
|
8386
|
+
endpoint = _getState7$config.endpoint;
|
|
8387
|
+
var regex = /https:\/\/[^/]+/;
|
|
8388
|
+
var urlObj = new URL(url.match(regex)[0]);
|
|
8389
|
+
var credentials = configCredentials;
|
|
8390
|
+
if (urlObj.username && urlObj.password) {
|
|
8391
|
+
credentials = urlObj.username + ':' + urlObj.password;
|
|
8392
|
+
urlObj.username = '';
|
|
8393
|
+
urlObj.password = '';
|
|
8394
|
+
}
|
|
8395
|
+
var fetchUrl = urlObj.toString() + '_ai';
|
|
8396
|
+
var headers = new Headers();
|
|
8397
|
+
if (credentials) {
|
|
8398
|
+
var encodedCredentials = btoa(credentials);
|
|
8399
|
+
headers.append('Authorization', 'Basic ' + encodedCredentials);
|
|
8400
|
+
} else if (endpoint && endpoint.headers && endpoint.headers.Authorization) {
|
|
8401
|
+
headers.append('Authorization', endpoint.headers.Authorization);
|
|
8402
|
+
}
|
|
8403
|
+
var requestOptions = {
|
|
8404
|
+
headers: headers,
|
|
8405
|
+
method: 'POST',
|
|
8406
|
+
body: JSON.stringify({
|
|
8407
|
+
question: question
|
|
8408
|
+
})
|
|
8409
|
+
};
|
|
8410
|
+
return fetch(fetchUrl, _extends({}, requestOptions)).then(function (res) {
|
|
8411
|
+
return res.json();
|
|
8412
|
+
}).then(function (parsedRes) {
|
|
8413
|
+
return parsedRes;
|
|
8414
|
+
})["catch"](function (e) {
|
|
8415
|
+
console.error('Error creating an AI session: ', e);
|
|
8416
|
+
});
|
|
8417
|
+
};
|
|
8418
|
+
}
|
|
8375
8419
|
});
|
|
8376
8420
|
unwrapExports(query);
|
|
8377
8421
|
var query_1 = query.loadPopularSuggestions;
|
|
@@ -8381,6 +8425,7 @@
|
|
|
8381
8425
|
var query_5 = query.loadMore;
|
|
8382
8426
|
var query_6 = query.loadDataToExport;
|
|
8383
8427
|
var query_7 = query.fetchAIResponse;
|
|
8428
|
+
var query_8 = query.createAISession;
|
|
8384
8429
|
|
|
8385
8430
|
var component = createCommonjsModule(function (module, exports) {
|
|
8386
8431
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -18119,6 +18164,1586 @@
|
|
|
18119
18164
|
window.hotkeys = hotkeys;
|
|
18120
18165
|
}
|
|
18121
18166
|
|
|
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
|
+
|
|
18122
19747
|
var textarea;
|
|
18123
19748
|
function decodeEntity(name) {
|
|
18124
19749
|
textarea = textarea || document.createElement('textarea');
|
|
@@ -18237,7 +19862,7 @@
|
|
|
18237
19862
|
function replaceUnsafeChar(ch) {
|
|
18238
19863
|
return HTML_REPLACEMENTS[ch];
|
|
18239
19864
|
}
|
|
18240
|
-
function escapeHtml(str) {
|
|
19865
|
+
function escapeHtml$1(str) {
|
|
18241
19866
|
if (HTML_ESCAPE_TEST_RE.test(str)) {
|
|
18242
19867
|
return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
|
|
18243
19868
|
}
|
|
@@ -18268,9 +19893,9 @@
|
|
|
18268
19893
|
|
|
18269
19894
|
rules.code = function (tokens, idx /*, options, env */) {
|
|
18270
19895
|
if (tokens[idx].block) {
|
|
18271
|
-
return '<pre><code>' + escapeHtml(tokens[idx].content) + '</code></pre>' + getBreak(tokens, idx);
|
|
19896
|
+
return '<pre><code>' + escapeHtml$1(tokens[idx].content) + '</code></pre>' + getBreak(tokens, idx);
|
|
18272
19897
|
}
|
|
18273
|
-
return '<code>' + escapeHtml(tokens[idx].content) + '</code>';
|
|
19898
|
+
return '<code>' + escapeHtml$1(tokens[idx].content) + '</code>';
|
|
18274
19899
|
};
|
|
18275
19900
|
|
|
18276
19901
|
/**
|
|
@@ -18298,13 +19923,13 @@
|
|
|
18298
19923
|
if (has(instance.rules.fence_custom, fences[0])) {
|
|
18299
19924
|
return instance.rules.fence_custom[fences[0]](tokens, idx, options, env, instance);
|
|
18300
19925
|
}
|
|
18301
|
-
langName = escapeHtml(replaceEntities(unescapeMd(fenceName)));
|
|
19926
|
+
langName = escapeHtml$1(replaceEntities(unescapeMd(fenceName)));
|
|
18302
19927
|
langClass = ' class="' + langPrefix + langName + '"';
|
|
18303
19928
|
}
|
|
18304
19929
|
if (options.highlight) {
|
|
18305
|
-
highlighted = options.highlight.apply(options.highlight, [token.content].concat(fences)) || escapeHtml(token.content);
|
|
19930
|
+
highlighted = options.highlight.apply(options.highlight, [token.content].concat(fences)) || escapeHtml$1(token.content);
|
|
18306
19931
|
} else {
|
|
18307
|
-
highlighted = escapeHtml(token.content);
|
|
19932
|
+
highlighted = escapeHtml$1(token.content);
|
|
18308
19933
|
}
|
|
18309
19934
|
return '<pre><code' + langClass + '>' + highlighted + '</code></pre>' + getBreak(tokens, idx);
|
|
18310
19935
|
};
|
|
@@ -18384,9 +20009,9 @@
|
|
|
18384
20009
|
*/
|
|
18385
20010
|
|
|
18386
20011
|
rules.link_open = function (tokens, idx, options /* env */) {
|
|
18387
|
-
var title = tokens[idx].title ? ' title="' + escapeHtml(replaceEntities(tokens[idx].title)) + '"' : '';
|
|
20012
|
+
var title = tokens[idx].title ? ' title="' + escapeHtml$1(replaceEntities(tokens[idx].title)) + '"' : '';
|
|
18388
20013
|
var target = options.linkTarget ? ' target="' + options.linkTarget + '"' : '';
|
|
18389
|
-
return '<a href="' + escapeHtml(tokens[idx].href) + '"' + title + target + '>';
|
|
20014
|
+
return '<a href="' + escapeHtml$1(tokens[idx].href) + '"' + title + target + '>';
|
|
18390
20015
|
};
|
|
18391
20016
|
rules.link_close = function /* tokens, idx, options, env */
|
|
18392
20017
|
() {
|
|
@@ -18398,9 +20023,9 @@
|
|
|
18398
20023
|
*/
|
|
18399
20024
|
|
|
18400
20025
|
rules.image = function (tokens, idx, options /*, env */) {
|
|
18401
|
-
var src = ' src="' + escapeHtml(tokens[idx].src) + '"';
|
|
18402
|
-
var title = tokens[idx].title ? ' title="' + escapeHtml(replaceEntities(tokens[idx].title)) + '"' : '';
|
|
18403
|
-
var alt = ' alt="' + (tokens[idx].alt ? escapeHtml(replaceEntities(unescapeMd(tokens[idx].alt))) : '') + '"';
|
|
20026
|
+
var src = ' src="' + escapeHtml$1(tokens[idx].src) + '"';
|
|
20027
|
+
var title = tokens[idx].title ? ' title="' + escapeHtml$1(replaceEntities(tokens[idx].title)) + '"' : '';
|
|
20028
|
+
var alt = ' alt="' + (tokens[idx].alt ? escapeHtml$1(replaceEntities(unescapeMd(tokens[idx].alt))) : '') + '"';
|
|
18404
20029
|
var suffix = options.xhtmlOut ? ' /' : '';
|
|
18405
20030
|
return '<img' + src + alt + title + suffix + '>';
|
|
18406
20031
|
};
|
|
@@ -18528,10 +20153,10 @@
|
|
|
18528
20153
|
*/
|
|
18529
20154
|
|
|
18530
20155
|
rules.sub = function (tokens, idx /*, options, env */) {
|
|
18531
|
-
return '<sub>' + escapeHtml(tokens[idx].content) + '</sub>';
|
|
20156
|
+
return '<sub>' + escapeHtml$1(tokens[idx].content) + '</sub>';
|
|
18532
20157
|
};
|
|
18533
20158
|
rules.sup = function (tokens, idx /*, options, env */) {
|
|
18534
|
-
return '<sup>' + escapeHtml(tokens[idx].content) + '</sup>';
|
|
20159
|
+
return '<sup>' + escapeHtml$1(tokens[idx].content) + '</sup>';
|
|
18535
20160
|
};
|
|
18536
20161
|
|
|
18537
20162
|
/**
|
|
@@ -18550,7 +20175,7 @@
|
|
|
18550
20175
|
*/
|
|
18551
20176
|
|
|
18552
20177
|
rules.text = function (tokens, idx /*, options, env */) {
|
|
18553
|
-
return escapeHtml(tokens[idx].content);
|
|
20178
|
+
return escapeHtml$1(tokens[idx].content);
|
|
18554
20179
|
};
|
|
18555
20180
|
|
|
18556
20181
|
/**
|
|
@@ -18569,7 +20194,7 @@
|
|
|
18569
20194
|
*/
|
|
18570
20195
|
|
|
18571
20196
|
rules.abbr_open = function (tokens, idx /*, options, env */) {
|
|
18572
|
-
return '<abbr title="' + escapeHtml(replaceEntities(tokens[idx].title)) + '">';
|
|
20197
|
+
return '<abbr title="' + escapeHtml$1(replaceEntities(tokens[idx].title)) + '">';
|
|
18573
20198
|
};
|
|
18574
20199
|
rules.abbr_close = function /* tokens, idx, options, env */
|
|
18575
20200
|
() {
|
|
@@ -23078,7 +24703,9 @@
|
|
|
23078
24703
|
};
|
|
23079
24704
|
|
|
23080
24705
|
var _templateObject$8;
|
|
23081
|
-
var InputGroup = styled('div')(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\talign-items: stretch;\n\twidth: 100%;\n"])))
|
|
24706
|
+
var InputGroup = styled('div')(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\talign-items: stretch;\n\twidth: 100%;\n\tbox-shadow: rgb(0 0 0 / 20%) 0px 0px 6px;\n\tborder-radius: 6px;\n\n\t", "\n};\n"])), function (props) {
|
|
24707
|
+
return props.isOpen && 'box-shadow: rgb(0 0 0 / 20%) 0px 0px 15px;';
|
|
24708
|
+
});
|
|
23082
24709
|
InputGroup.defaultProps = {
|
|
23083
24710
|
className: 'input-group'
|
|
23084
24711
|
};
|
|
@@ -23092,12 +24719,14 @@
|
|
|
23092
24719
|
className: 'input-addon'
|
|
23093
24720
|
};
|
|
23094
24721
|
|
|
23095
|
-
var _templateObject$b, _templateObject2$4, _templateObject3$3, _templateObject4$1, _templateObject5$1, _templateObject6;
|
|
24722
|
+
var _templateObject$b, _templateObject2$4, _templateObject3$3, _templateObject4$1, _templateObject5$1, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
23096
24723
|
var alertBorder = function alertBorder(_ref) {
|
|
23097
24724
|
var theme = _ref.theme;
|
|
23098
24725
|
return "\n\tborder: 1px solid " + theme.colors.alertColor + ";\n";
|
|
23099
24726
|
};
|
|
23100
|
-
var input =
|
|
24727
|
+
var input = function input(searchBox) {
|
|
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
|
+
};
|
|
23101
24730
|
var dark$1 = function dark(theme) {
|
|
23102
24731
|
return "\n\tborder-color: " + theme.colors.borderColor + ";\n";
|
|
23103
24732
|
};
|
|
@@ -23105,12 +24734,11 @@
|
|
|
23105
24734
|
var theme = _ref2.theme;
|
|
23106
24735
|
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";
|
|
23107
24736
|
};
|
|
23108
|
-
var Input = styled('input')(_templateObject$b || (_templateObject$b = _taggedTemplateLiteralLoose(["\n\t", ";\n\
|
|
23109
|
-
|
|
23110
|
-
|
|
23111
|
-
|
|
23112
|
-
|
|
23113
|
-
});
|
|
24737
|
+
var Input = styled('input')(_templateObject$b || (_templateObject$b = _taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t", ";\n\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n\n\t", ";\n\n\t&[type='search']::-webkit-search-decoration,\n\t&[type='search']::-webkit-search-cancel-button,\n\t&[type='search']::-webkit-search-results-button,\n\t&[type='search']::-webkit-search-results-decoration {\n\t\tdisplay: none;\n\t}\n"])), function (props) {
|
|
24738
|
+
return input(props.searchBox);
|
|
24739
|
+
}, function (_ref3) {
|
|
24740
|
+
var themePreset = _ref3.themePreset;
|
|
24741
|
+
return themePreset === 'dark' && darkInput;
|
|
23114
24742
|
}, function (props) {
|
|
23115
24743
|
return props.showIcon && props.iconPosition === 'left' && "\n\t\t\tpadding-left: 36px;\n\t\t";
|
|
23116
24744
|
}, function (props) {
|
|
@@ -23132,13 +24760,13 @@
|
|
|
23132
24760
|
);
|
|
23133
24761
|
}, function (props) {
|
|
23134
24762
|
return (
|
|
23135
|
-
// for voice search icon with
|
|
23136
|
-
props.showVoiceSearch && props.showIcon &&
|
|
24763
|
+
// for voice search icon with clear icon
|
|
24764
|
+
props.showVoiceSearch && props.showIcon && "\n\t\t\tpadding-right: 66px;\n\t\t"
|
|
23137
24765
|
);
|
|
23138
24766
|
}, function (props) {
|
|
23139
24767
|
return (
|
|
23140
|
-
// for voice search icon with
|
|
23141
|
-
props.showVoiceSearch && props.showIcon && "\n\t\t\tpadding-right: 66px;\n\t\t"
|
|
24768
|
+
// for voice search icon with search icon
|
|
24769
|
+
props.showVoiceSearch && props.showIcon && props.iconPosition === 'right' && "\n\t\t\tpadding-right: 66px;\n\t\t"
|
|
23142
24770
|
);
|
|
23143
24771
|
}, function (props) {
|
|
23144
24772
|
return (
|
|
@@ -23147,15 +24775,20 @@
|
|
|
23147
24775
|
);
|
|
23148
24776
|
}, function (props) {
|
|
23149
24777
|
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";
|
|
23150
24780
|
});
|
|
23151
24781
|
var suggestions$1 = function suggestions(themePreset, theme) {
|
|
23152
24782
|
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));
|
|
23153
24783
|
};
|
|
23154
|
-
var
|
|
24784
|
+
var searchboxSuggestions = function searchboxSuggestions(themePreset, theme) {
|
|
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"])));
|
|
23155
24788
|
var noSuggestions = function noSuggestions(themePreset, theme) {
|
|
23156
|
-
return css(
|
|
24789
|
+
return css(_templateObject7 || (_templateObject7 = _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));
|
|
23157
24790
|
};
|
|
23158
|
-
var TextArea = styled('textarea')(
|
|
24791
|
+
var TextArea = styled('textarea')(_templateObject8 || (_templateObject8 = _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) {
|
|
23159
24792
|
var themePreset = _ref4.themePreset,
|
|
23160
24793
|
theme = _ref4.theme;
|
|
23161
24794
|
return themePreset === 'dark' && darkInput({
|
|
@@ -23222,7 +24855,7 @@
|
|
|
23222
24855
|
}, function (props) {
|
|
23223
24856
|
return props.alert && alertBorder;
|
|
23224
24857
|
}, function (props) {
|
|
23225
|
-
return props.isOpen && css(
|
|
24858
|
+
return props.isOpen && css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteralLoose(["\n\t\t\tborder-bottom-left-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t"])));
|
|
23226
24859
|
});
|
|
23227
24860
|
|
|
23228
24861
|
var _templateObject$c;
|
|
@@ -23240,7 +24873,7 @@
|
|
|
23240
24873
|
return enableAI ? "\n\t\ttop: 0%;\n\t transform: translateY(0);\n \theight: 42px;\n\t" : '';
|
|
23241
24874
|
});
|
|
23242
24875
|
|
|
23243
|
-
var _templateObject$d;
|
|
24876
|
+
var _templateObject$d, _templateObject2$5;
|
|
23244
24877
|
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) {
|
|
23245
24878
|
var _ref$theme = _ref.theme,
|
|
23246
24879
|
theme = _ref$theme === void 0 ? {} : _ref$theme;
|
|
@@ -23250,6 +24883,13 @@
|
|
|
23250
24883
|
theme = _ref2$theme === void 0 ? {} : _ref2$theme;
|
|
23251
24884
|
return theme.colors ? theme.colors.borderColor : '#000';
|
|
23252
24885
|
});
|
|
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
|
+
});
|
|
23253
24893
|
|
|
23254
24894
|
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};
|
|
23255
24895
|
|
|
@@ -24732,13 +26372,13 @@
|
|
|
24732
26372
|
}
|
|
24733
26373
|
};
|
|
24734
26374
|
|
|
24735
|
-
var _templateObject$h, _templateObject2$
|
|
26375
|
+
var _templateObject$h, _templateObject2$6;
|
|
24736
26376
|
var TagsContainer = styled('div')(_templateObject$h || (_templateObject$h = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin-top: 10px;\n\twidth: 100%;\n"])));
|
|
24737
|
-
var TagItem = styled('span')(_templateObject2$
|
|
26377
|
+
var TagItem = styled('span')(_templateObject2$6 || (_templateObject2$6 = _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"])));
|
|
24738
26378
|
|
|
24739
|
-
var _templateObject$i, _templateObject2$
|
|
26379
|
+
var _templateObject$i, _templateObject2$7, _templateObject3$4;
|
|
24740
26380
|
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"])));
|
|
24741
|
-
var SkeletonLoader = styled('div')(_templateObject2$
|
|
26381
|
+
var SkeletonLoader = styled('div')(_templateObject2$7 || (_templateObject2$7 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n"])));
|
|
24742
26382
|
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);
|
|
24743
26383
|
var HorizontalSkeletonLoader = vue.defineComponent({
|
|
24744
26384
|
name: 'HorizontalSkeletonLoader',
|
|
@@ -24751,11 +26391,11 @@
|
|
|
24751
26391
|
}
|
|
24752
26392
|
});
|
|
24753
26393
|
|
|
24754
|
-
var _templateObject$j, _templateObject2$
|
|
26394
|
+
var _templateObject$j, _templateObject2$8, _templateObject3$5, _templateObject4$2, _templateObject5$2, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject10, _templateObject11;
|
|
24755
26395
|
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) {
|
|
24756
26396
|
return props.theme && props.theme.colors ? props.theme.colors.backgroundColor : '#fff';
|
|
24757
26397
|
});
|
|
24758
|
-
var ChatContainer = styled('div')(_templateObject2$
|
|
26398
|
+
var ChatContainer = styled('div')(_templateObject2$8 || (_templateObject2$8 = _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) {
|
|
24759
26399
|
return props.showInput ? 'bottom: 48px;' : '';
|
|
24760
26400
|
}, function (props) {
|
|
24761
26401
|
return props.theme && props.theme.colors && props.theme.colors.backgroundColor ? props.theme.colors.backgroundColor : '#fff';
|
|
@@ -24792,7 +26432,7 @@
|
|
|
24792
26432
|
}
|
|
24793
26433
|
return finalBGColor;
|
|
24794
26434
|
};
|
|
24795
|
-
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) {
|
|
26435
|
+
var Message = styled('div')(_templateObject7$1 || (_templateObject7$1 = _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) {
|
|
24796
26436
|
return messageBGColor(props);
|
|
24797
26437
|
}, function (props) {
|
|
24798
26438
|
var finalColor;
|
|
@@ -24809,8 +26449,8 @@
|
|
|
24809
26449
|
}, function (props) {
|
|
24810
26450
|
return resetCSS(props);
|
|
24811
26451
|
});
|
|
24812
|
-
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"])));
|
|
24813
|
-
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) {
|
|
26452
|
+
var MessageInputContainer = styled('form')(_templateObject8$1 || (_templateObject8$1 = _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"])));
|
|
26453
|
+
var MessageInput = styled(TextArea)(_templateObject9$1 || (_templateObject9$1 = _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) {
|
|
24814
26454
|
return props.themePreset === 'dark' ? props.theme.colors.borderColor : '#fff';
|
|
24815
26455
|
}, function (props) {
|
|
24816
26456
|
return props.themePreset === 'dark' ? props.theme.colors.titleColor : props.theme.colors.textColor;
|
|
@@ -24827,9 +26467,9 @@
|
|
|
24827
26467
|
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"])));
|
|
24828
26468
|
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"])));
|
|
24829
26469
|
|
|
24830
|
-
var _templateObject$k, _templateObject2$
|
|
26470
|
+
var _templateObject$k, _templateObject2$9, _templateObject3$6, _templateObject4$3, _templateObject5$3, _templateObject6$2, _templateObject7$2;
|
|
24831
26471
|
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"])));
|
|
24832
|
-
var fadeInFromTop = keyframes(_templateObject2$
|
|
26472
|
+
var fadeInFromTop = keyframes(_templateObject2$9 || (_templateObject2$9 = _taggedTemplateLiteralLoose(["\n 0% {\n opacity: 0;\n transform: translateY(-20px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])));
|
|
24833
26473
|
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) {
|
|
24834
26474
|
var themePreset = _ref.themePreset,
|
|
24835
26475
|
theme = _ref.theme;
|
|
@@ -24850,7 +26490,7 @@
|
|
|
24850
26490
|
var theme = _ref4.theme;
|
|
24851
26491
|
return theme.colors.textColor;
|
|
24852
26492
|
});
|
|
24853
|
-
var SourceTags = styled('div')(_templateObject7$
|
|
26493
|
+
var SourceTags = styled('div')(_templateObject7$2 || (_templateObject7$2 = _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"])));
|
|
24854
26494
|
|
|
24855
26495
|
var ThumbsUpSvg = {
|
|
24856
26496
|
name: 'ThumbsUpSvg',
|
|
@@ -25024,6 +26664,9 @@
|
|
|
25024
26664
|
}
|
|
25025
26665
|
});
|
|
25026
26666
|
|
|
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
|
+
|
|
25027
26670
|
var _excluded$1 = ["_source"];
|
|
25028
26671
|
function _isSlot$5(s) {
|
|
25029
26672
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
@@ -25060,7 +26703,8 @@
|
|
|
25060
26703
|
showAIScreen: false,
|
|
25061
26704
|
showAIScreenFooter: false,
|
|
25062
26705
|
showFeedbackComponent: false,
|
|
25063
|
-
feedbackState: null
|
|
26706
|
+
feedbackState: null,
|
|
26707
|
+
prefilledAIAnswer: ''
|
|
25064
26708
|
};
|
|
25065
26709
|
this.internalComponent = props.componentId + "__internal";
|
|
25066
26710
|
return this.__state;
|
|
@@ -25101,6 +26745,37 @@
|
|
|
25101
26745
|
},
|
|
25102
26746
|
stats: function stats() {
|
|
25103
26747
|
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);
|
|
25104
26779
|
}
|
|
25105
26780
|
},
|
|
25106
26781
|
props: {
|
|
@@ -25132,6 +26807,11 @@
|
|
|
25132
26807
|
enableQuerySuggestions: Q.bool.def(false),
|
|
25133
26808
|
enablePopularSuggestions: Q.bool.def(false),
|
|
25134
26809
|
enableRecentSuggestions: Q.bool.def(false),
|
|
26810
|
+
enableFAQSuggestions: Q.bool.def(false),
|
|
26811
|
+
FAQSuggestionsConfig: Q.shape({
|
|
26812
|
+
sectionLabel: Q.string,
|
|
26813
|
+
size: Q.number
|
|
26814
|
+
}),
|
|
25135
26815
|
fieldWeights: types.fieldWeights,
|
|
25136
26816
|
filterLabel: types.string,
|
|
25137
26817
|
fuzziness: types.fuzziness,
|
|
@@ -25167,12 +26847,20 @@
|
|
|
25167
26847
|
distinctFieldConfig: types.props,
|
|
25168
26848
|
//
|
|
25169
26849
|
focusShortcuts: Q.arrayOf(Q.oneOfType([Q.string, Q.number])).def(['/']),
|
|
26850
|
+
showFocusShortcutsIcon: Q.bool.def(true),
|
|
25170
26851
|
addonBefore: Q.any,
|
|
25171
26852
|
addonAfter: Q.any,
|
|
26853
|
+
showSuggestionsFooter: Q.bool.def(true),
|
|
25172
26854
|
expandSuggestionsContainer: Q.bool.def(true),
|
|
26855
|
+
renderSuggestionsFooter: Q.func,
|
|
25173
26856
|
index: Q.string,
|
|
25174
26857
|
popularSuggestionsConfig: Q.object,
|
|
25175
26858
|
recentSuggestionsConfig: Q.object,
|
|
26859
|
+
featuredSuggestionsConfig: Q.shape({
|
|
26860
|
+
maxSuggestionsPerSection: Q.number,
|
|
26861
|
+
sectionsOrder: Q.arrayOf(Q.string)
|
|
26862
|
+
}),
|
|
26863
|
+
customEvents: Q.object,
|
|
25176
26864
|
applyStopwords: Q.bool,
|
|
25177
26865
|
customStopwords: types.stringArray,
|
|
25178
26866
|
onData: types.func,
|
|
@@ -25360,7 +27048,7 @@
|
|
|
25360
27048
|
resultStats: this.stats,
|
|
25361
27049
|
AIData: {
|
|
25362
27050
|
question: this.AIResponse && this.AIResponse.response && this.AIResponse.response.question,
|
|
25363
|
-
answer: this.
|
|
27051
|
+
answer: this.mergedAIAnswerc,
|
|
25364
27052
|
documentIds: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [],
|
|
25365
27053
|
showAIScreen: this.showAIScreen,
|
|
25366
27054
|
sources: this.getAISourceObjects(),
|
|
@@ -25391,7 +27079,7 @@
|
|
|
25391
27079
|
this.onValueSelectedHandler(currentValue, lib_7.SEARCH_ICON_CLICK);
|
|
25392
27080
|
}
|
|
25393
27081
|
},
|
|
25394
|
-
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue) {
|
|
27082
|
+
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue, shouldExecuteQuery) {
|
|
25395
27083
|
var _this2 = this;
|
|
25396
27084
|
if (isDefaultValue === void 0) {
|
|
25397
27085
|
isDefaultValue = false;
|
|
@@ -25405,6 +27093,9 @@
|
|
|
25405
27093
|
if (categoryValue === void 0) {
|
|
25406
27094
|
categoryValue = undefined;
|
|
25407
27095
|
}
|
|
27096
|
+
if (shouldExecuteQuery === void 0) {
|
|
27097
|
+
shouldExecuteQuery = true;
|
|
27098
|
+
}
|
|
25408
27099
|
var performUpdate = function performUpdate() {
|
|
25409
27100
|
if (_this2.$options.isTagsMode && isEqual$4(value, _this2.selectedTags)) {
|
|
25410
27101
|
return;
|
|
@@ -25440,17 +27131,18 @@
|
|
|
25440
27131
|
}
|
|
25441
27132
|
if (typeof _this2.currentValue === 'string') _this2.triggerDefaultQuery(_this2.currentValue, props.enableAI ? {
|
|
25442
27133
|
enableAI: true
|
|
25443
|
-
} : {});
|
|
27134
|
+
} : {}, shouldExecuteQuery);
|
|
25444
27135
|
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
25445
27136
|
// to set the query otherwise the value should reset
|
|
25446
27137
|
if (props.strictSelection) {
|
|
25447
27138
|
if (cause === lib_7.SUGGESTION_SELECT || (_this2.$options.isTagsMode ? _this2.selectedTags.length === 0 : value === '')) {
|
|
25448
|
-
_this2.triggerCustomQuery(queryHandlerValue, _this2.$options.isTagsMode ? undefined : categoryValue);
|
|
27139
|
+
_this2.triggerCustomQuery(queryHandlerValue, _this2.$options.isTagsMode ? undefined : categoryValue, shouldExecuteQuery);
|
|
25449
27140
|
} else {
|
|
25450
27141
|
_this2.setValue('', true);
|
|
25451
27142
|
}
|
|
25452
27143
|
} else if (props.value === undefined || cause === lib_7.SUGGESTION_SELECT || cause === lib_7.CLEAR_VALUE) {
|
|
25453
|
-
_this2.
|
|
27144
|
+
_this2.showAIScreen = false;
|
|
27145
|
+
_this2.triggerCustomQuery(queryHandlerValue, _this2.$options.isTagsMode ? undefined : categoryValue, shouldExecuteQuery);
|
|
25454
27146
|
}
|
|
25455
27147
|
} else {
|
|
25456
27148
|
// debounce for handling text while typing
|
|
@@ -25461,10 +27153,13 @@
|
|
|
25461
27153
|
};
|
|
25462
27154
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
25463
27155
|
},
|
|
25464
|
-
triggerDefaultQuery: function triggerDefaultQuery(paramValue, meta) {
|
|
27156
|
+
triggerDefaultQuery: function triggerDefaultQuery(paramValue, meta, shouldExecuteQuery) {
|
|
25465
27157
|
if (meta === void 0) {
|
|
25466
27158
|
meta = {};
|
|
25467
27159
|
}
|
|
27160
|
+
if (shouldExecuteQuery === void 0) {
|
|
27161
|
+
shouldExecuteQuery = true;
|
|
27162
|
+
}
|
|
25468
27163
|
if (!this.$props.autosuggest) {
|
|
25469
27164
|
return;
|
|
25470
27165
|
}
|
|
@@ -25485,12 +27180,15 @@
|
|
|
25485
27180
|
value: value,
|
|
25486
27181
|
componentType: constants_1$1.searchBox,
|
|
25487
27182
|
meta: meta
|
|
25488
|
-
});
|
|
27183
|
+
}, shouldExecuteQuery);
|
|
25489
27184
|
},
|
|
25490
|
-
triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue) {
|
|
27185
|
+
triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue, shouldExecuteQuery) {
|
|
25491
27186
|
if (categoryValue === void 0) {
|
|
25492
27187
|
categoryValue = undefined;
|
|
25493
27188
|
}
|
|
27189
|
+
if (shouldExecuteQuery === void 0) {
|
|
27190
|
+
shouldExecuteQuery = true;
|
|
27191
|
+
}
|
|
25494
27192
|
var _this$$props = this.$props,
|
|
25495
27193
|
customQuery = _this$$props.customQuery,
|
|
25496
27194
|
filterLabel = _this$$props.filterLabel,
|
|
@@ -25519,7 +27217,7 @@
|
|
|
25519
27217
|
URLParams: URLParams,
|
|
25520
27218
|
componentType: constants_1$1.searchBox,
|
|
25521
27219
|
category: categoryValue
|
|
25522
|
-
});
|
|
27220
|
+
}, shouldExecuteQuery);
|
|
25523
27221
|
},
|
|
25524
27222
|
handleFocus: function handleFocus(event) {
|
|
25525
27223
|
if (this.$props.autosuggest) {
|
|
@@ -25618,12 +27316,60 @@
|
|
|
25618
27316
|
}, e);
|
|
25619
27317
|
}
|
|
25620
27318
|
},
|
|
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
|
+
},
|
|
25621
27353
|
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
25622
27354
|
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
|
+
}
|
|
25623
27363
|
if (!this.$props.enableAI) this.isOpen = false;else {
|
|
25624
27364
|
this.showAIScreen = true;
|
|
25625
27365
|
}
|
|
25626
27366
|
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
|
+
}
|
|
25627
27373
|
// Record analytics for selected suggestions
|
|
25628
27374
|
this.triggerClickAnalytics(suggestion._click_id);
|
|
25629
27375
|
if (value === undefined) {
|
|
@@ -25779,6 +27525,13 @@
|
|
|
25779
27525
|
customQuery: true
|
|
25780
27526
|
});
|
|
25781
27527
|
},
|
|
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
|
+
},
|
|
25782
27535
|
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
25783
27536
|
var _this6 = this;
|
|
25784
27537
|
var _this$$props2 = this.$props,
|
|
@@ -25806,16 +27559,29 @@
|
|
|
25806
27559
|
}
|
|
25807
27560
|
return null;
|
|
25808
27561
|
},
|
|
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
|
+
},
|
|
25809
27574
|
renderIcons: function renderIcons() {
|
|
25810
27575
|
var _this7 = this;
|
|
25811
|
-
var _slot3, _slot4, _slot5;
|
|
27576
|
+
var _slot3, _slot4, _slot5, _slot6;
|
|
25812
27577
|
var _this$$props3 = this.$props,
|
|
25813
27578
|
iconPosition = _this$$props3.iconPosition,
|
|
25814
27579
|
showClear = _this$$props3.showClear,
|
|
25815
27580
|
innerClass = _this$$props3.innerClass,
|
|
25816
27581
|
getMicInstance = _this$$props3.getMicInstance,
|
|
25817
27582
|
showVoiceSearch = _this$$props3.showVoiceSearch,
|
|
25818
|
-
showIcon = _this$$props3.showIcon
|
|
27583
|
+
showIcon = _this$$props3.showIcon,
|
|
27584
|
+
showFocusShortcutsIcon = _this$$props3.showFocusShortcutsIcon;
|
|
25819
27585
|
var renderMic = this.$slots.renderMic || this.$props.renderMic;
|
|
25820
27586
|
var currentValue = this.$data.currentValue;
|
|
25821
27587
|
return vue.createVNode("div", null, [vue.createVNode(IconGroup, {
|
|
@@ -25831,6 +27597,14 @@
|
|
|
25831
27597
|
"default": function _default() {
|
|
25832
27598
|
return [_slot3];
|
|
25833
27599
|
}
|
|
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
|
+
}
|
|
25834
27608
|
}), showVoiceSearch && vue.createVNode(Mic, {
|
|
25835
27609
|
"getInstance": getMicInstance,
|
|
25836
27610
|
"render": renderMic,
|
|
@@ -25838,9 +27612,9 @@
|
|
|
25838
27612
|
"className": getClassName$3(innerClass, 'mic') || null
|
|
25839
27613
|
}, null), iconPosition === 'right' && showIcon && vue.createVNode(IconWrapper, {
|
|
25840
27614
|
"onClick": _this7.handleSearchIconClick
|
|
25841
|
-
}, _isSlot$5(
|
|
27615
|
+
}, _isSlot$5(_slot5 = _this7.renderIcon()) ? _slot5 : {
|
|
25842
27616
|
"default": function _default() {
|
|
25843
|
-
return [
|
|
27617
|
+
return [_slot5];
|
|
25844
27618
|
}
|
|
25845
27619
|
})];
|
|
25846
27620
|
}
|
|
@@ -25851,23 +27625,23 @@
|
|
|
25851
27625
|
"default": function _default() {
|
|
25852
27626
|
return [iconPosition === 'left' && showIcon && vue.createVNode(IconWrapper, {
|
|
25853
27627
|
"onClick": _this7.handleSearchIconClick
|
|
25854
|
-
}, _isSlot$5(
|
|
27628
|
+
}, _isSlot$5(_slot6 = _this7.renderIcon()) ? _slot6 : {
|
|
25855
27629
|
"default": function _default() {
|
|
25856
|
-
return [
|
|
27630
|
+
return [_slot6];
|
|
25857
27631
|
}
|
|
25858
27632
|
})];
|
|
25859
27633
|
}
|
|
25860
27634
|
})]);
|
|
25861
27635
|
},
|
|
25862
27636
|
focusSearchBox: function focusSearchBox(event) {
|
|
25863
|
-
var _this$$
|
|
27637
|
+
var _this$$refs3, _this$$refs3$this$$pr;
|
|
25864
27638
|
var elt = event.target || event.srcElement;
|
|
25865
27639
|
var tagName = elt.tagName;
|
|
25866
27640
|
if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
|
|
25867
27641
|
// already in an input
|
|
25868
27642
|
return;
|
|
25869
27643
|
}
|
|
25870
|
-
(_this$$
|
|
27644
|
+
(_this$$refs3 = this.$refs) == null ? void 0 : (_this$$refs3$this$$pr = _this$$refs3[this.$props.innerRef]) == null ? void 0 : _this$$refs3$this$$pr.focus(); // eslint-disable-line
|
|
25871
27645
|
},
|
|
25872
27646
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
25873
27647
|
var _this8 = this;
|
|
@@ -25907,16 +27681,31 @@
|
|
|
25907
27681
|
this.currentValue = decodeHtml(value);
|
|
25908
27682
|
this.triggerDefaultQuery(value);
|
|
25909
27683
|
},
|
|
25910
|
-
|
|
27684
|
+
renderActionIcon: function renderActionIcon(suggestion) {
|
|
25911
27685
|
var _this9 = this;
|
|
25912
27686
|
var handleAutoFillClick = function handleAutoFillClick(e) {
|
|
25913
27687
|
e.stopPropagation();
|
|
25914
27688
|
_this9.onAutofillClick(suggestion);
|
|
25915
27689
|
};
|
|
25916
|
-
|
|
25917
|
-
|
|
25918
|
-
|
|
25919
|
-
|
|
27690
|
+
if (suggestion._suggestion_type === helper_16.Featured) {
|
|
27691
|
+
if (suggestion.action === helper_15.FUNCTION) {
|
|
27692
|
+
return vue.createVNode(AutoFillSvg, {
|
|
27693
|
+
"style": {
|
|
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;
|
|
25920
27709
|
},
|
|
25921
27710
|
renderTag: function renderTag(item) {
|
|
25922
27711
|
var _this10 = this;
|
|
@@ -26023,7 +27812,7 @@
|
|
|
26023
27812
|
return vue.createVNode(HorizontalSkeletonLoader, null, null);
|
|
26024
27813
|
},
|
|
26025
27814
|
renderAIScreenFooter: function renderAIScreenFooter() {
|
|
26026
|
-
var
|
|
27815
|
+
var _slot7;
|
|
26027
27816
|
var _this12 = this;
|
|
26028
27817
|
var _this$$props$AIUIConf2 = this.$props.AIUIConfig,
|
|
26029
27818
|
AIUIConfig = _this$$props$AIUIConf2 === void 0 ? {} : _this$$props$AIUIConf2;
|
|
@@ -26038,7 +27827,7 @@
|
|
|
26038
27827
|
"themePreset": this.$props.themePreset
|
|
26039
27828
|
}, {
|
|
26040
27829
|
"default": function _default() {
|
|
26041
|
-
return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot$5(
|
|
27830
|
+
return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot$5(_slot7 = _this12.getAISourceObjects().map(function (el) {
|
|
26042
27831
|
return vue.createVNode(Button, {
|
|
26043
27832
|
"class": "--ai-source-tag " + (getClassName$3(_this12.$props.innerClass, 'ai-source-tag') || ''),
|
|
26044
27833
|
"title": el[sourceDocumentLabel],
|
|
@@ -26051,9 +27840,9 @@
|
|
|
26051
27840
|
return [el[sourceDocumentLabel]];
|
|
26052
27841
|
}
|
|
26053
27842
|
});
|
|
26054
|
-
})) ?
|
|
27843
|
+
})) ? _slot7 : {
|
|
26055
27844
|
"default": function _default() {
|
|
26056
|
-
return [
|
|
27845
|
+
return [_slot7];
|
|
26057
27846
|
}
|
|
26058
27847
|
})];
|
|
26059
27848
|
}
|
|
@@ -26065,7 +27854,7 @@
|
|
|
26065
27854
|
if (customAIRenderer) {
|
|
26066
27855
|
return customAIRenderer({
|
|
26067
27856
|
question: this.AIResponse && this.AIResponse.response && this.AIResponse.response.question,
|
|
26068
|
-
answer: this.
|
|
27857
|
+
answer: this.mergedAIAnswer,
|
|
26069
27858
|
documentIds: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [],
|
|
26070
27859
|
loading: this.isAIResponseLoading || this.isLoading,
|
|
26071
27860
|
sources: this.getAISourceObjects(),
|
|
@@ -26076,7 +27865,7 @@
|
|
|
26076
27865
|
return this.renderAIScreenLoader();
|
|
26077
27866
|
}
|
|
26078
27867
|
return vue.createVNode("div", null, [vue.createVNode(Answer, {
|
|
26079
|
-
"innerHTML": md.render(this.
|
|
27868
|
+
"innerHTML": md.render(this.mergedAIAnswer)
|
|
26080
27869
|
}, null), this.renderAIScreenFooter(), this.showFeedbackComponent && vue.createVNode("div", {
|
|
26081
27870
|
"class": "" + (getClassName$3(this.$props.innerClass, 'ai-feedback') || '')
|
|
26082
27871
|
}, [vue.createVNode(AIFeedback, {
|
|
@@ -26185,23 +27974,58 @@
|
|
|
26185
27974
|
highlightedIndex = _ref8.highlightedIndex,
|
|
26186
27975
|
setHighlightedIndex = _ref8.setHighlightedIndex;
|
|
26187
27976
|
var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
|
|
26188
|
-
var getIcon = function getIcon(iconType) {
|
|
27977
|
+
var getIcon = function getIcon(iconType, item, leaveSpaceForIcon) {
|
|
26189
27978
|
switch (iconType) {
|
|
26190
27979
|
case helper_16.Recent:
|
|
26191
27980
|
return recentSearchesIcon;
|
|
26192
27981
|
case helper_16.Popular:
|
|
26193
27982
|
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
|
+
};
|
|
26194
28017
|
default:
|
|
26195
28018
|
return null;
|
|
26196
28019
|
}
|
|
26197
28020
|
};
|
|
28021
|
+
var indexOffset = 0;
|
|
26198
28022
|
return vue.createVNode("div", null, [_this15.hasCustomRenderer && _this15.getComponent({
|
|
26199
28023
|
isOpen: isOpen,
|
|
26200
28024
|
getItemProps: getItemProps,
|
|
26201
28025
|
getItemEvents: getItemEvents,
|
|
26202
28026
|
highlightedIndex: highlightedIndex
|
|
26203
28027
|
}), _this15.renderErrorComponent(), !_this15.hasCustomRenderer && isOpen && hasSuggestions ? vue.createVNode("ul", {
|
|
26204
|
-
"class": suggestions$1(_this15.themePreset, _this15.theme) + " " + getClassName$3(_this15.$props.innerClass, 'list'),
|
|
28028
|
+
"class": suggestions$1(_this15.themePreset, _this15.theme) + " " + getClassName$3(_this15.$props.innerClass, 'list') + " " + searchboxSuggestions(_this15.themePreset, _this15.theme) + "\n\t\t\t\t\t\t\t\t\t\t\t\t\t",
|
|
26205
28029
|
"ref": _dropdownULRef
|
|
26206
28030
|
}, [_this15.showAIScreen && vue.createVNode(SearchBoxAISection, {
|
|
26207
28031
|
"themePreset": _this15.$props.themePreset
|
|
@@ -26209,43 +28033,63 @@
|
|
|
26209
28033
|
"default": function _default() {
|
|
26210
28034
|
return [_this15.renderAIScreen(), ' ', _this15.renderErrorComponent(true)];
|
|
26211
28035
|
}
|
|
26212
|
-
}), !_this15.showAIScreen && _this15.
|
|
26213
|
-
|
|
26214
|
-
|
|
26215
|
-
|
|
26216
|
-
item
|
|
26217
|
-
|
|
26218
|
-
|
|
26219
|
-
"
|
|
26220
|
-
|
|
26221
|
-
|
|
26222
|
-
|
|
26223
|
-
}
|
|
26224
|
-
|
|
26225
|
-
item
|
|
26226
|
-
|
|
26227
|
-
|
|
26228
|
-
|
|
26229
|
-
|
|
26230
|
-
|
|
26231
|
-
|
|
26232
|
-
|
|
26233
|
-
|
|
26234
|
-
|
|
26235
|
-
|
|
26236
|
-
|
|
26237
|
-
|
|
26238
|
-
|
|
26239
|
-
|
|
26240
|
-
|
|
26241
|
-
|
|
26242
|
-
|
|
26243
|
-
|
|
26244
|
-
|
|
26245
|
-
|
|
26246
|
-
|
|
26247
|
-
|
|
26248
|
-
|
|
28036
|
+
}), !_this15.showAIScreen && _this15.parsedSuggestions.map(function (item, itemIndex) {
|
|
28037
|
+
var index = indexOffset + itemIndex;
|
|
28038
|
+
if (Array.isArray(item)) {
|
|
28039
|
+
var sectionHtml = lib$2(item[0].sectionLabel);
|
|
28040
|
+
indexOffset += item.length - 1;
|
|
28041
|
+
return vue.createVNode("div", {
|
|
28042
|
+
"class": "section-container"
|
|
28043
|
+
}, [sectionHtml ? vue.createVNode("div", {
|
|
28044
|
+
"class": "section-header " + getClassName$3(_this15.$props.innerClass, 'section-label'),
|
|
28045
|
+
"key": "" + item[0].sectionId,
|
|
28046
|
+
"innerHTML": sectionHtml
|
|
28047
|
+
}, null) : null, vue.createVNode("ul", {
|
|
28048
|
+
"class": "section-list"
|
|
28049
|
+
}, [item.map(function (sectionItem, sectionIndex) {
|
|
28050
|
+
var suggestionsHaveIcon = item.some(function (s) {
|
|
28051
|
+
return s.icon || s.iconURL;
|
|
28052
|
+
});
|
|
28053
|
+
return renderItem ? vue.createVNode("li", vue.mergeProps(getItemProps({
|
|
28054
|
+
item: sectionItem
|
|
28055
|
+
}), babelHelperVueTransformOn(getItemEvents({
|
|
28056
|
+
item: sectionItem
|
|
28057
|
+
})), {
|
|
28058
|
+
"key": index + sectionIndex,
|
|
28059
|
+
"style": {
|
|
28060
|
+
justifyContent: 'flex-start',
|
|
28061
|
+
alignItems: 'center'
|
|
28062
|
+
},
|
|
28063
|
+
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$3(_this15.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$3(_this15.$props.innerClass, 'suggestion-item'))
|
|
28064
|
+
}), [renderItem(sectionItem)]) : vue.createVNode("li", vue.mergeProps(getItemProps({
|
|
28065
|
+
item: sectionItem
|
|
28066
|
+
}), babelHelperVueTransformOn(getItemEvents({
|
|
28067
|
+
item: sectionItem
|
|
28068
|
+
})), {
|
|
28069
|
+
"key": index + sectionIndex,
|
|
28070
|
+
"style": {
|
|
28071
|
+
justifyContent: 'flex-start',
|
|
28072
|
+
alignItems: 'center'
|
|
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)]);
|
|
26249
28093
|
};
|
|
26250
28094
|
return vue.createVNode("div", {
|
|
26251
28095
|
"class": suggestionsContainer
|
|
@@ -26285,7 +28129,8 @@
|
|
|
26285
28129
|
"placeholder": _this15.$props.placeholder,
|
|
26286
28130
|
"autoFocus": _this15.$props.autoFocus,
|
|
26287
28131
|
"showFocusShortcutsIcon": _this15.$props.showFocusShortcutsIcon,
|
|
26288
|
-
"showVoiceSearch": _this15.$props.showVoiceSearch
|
|
28132
|
+
"showVoiceSearch": _this15.$props.showVoiceSearch,
|
|
28133
|
+
"searchBox": true
|
|
26289
28134
|
}, getInputProps({
|
|
26290
28135
|
value: _this15.$data.currentValue === null ? '' : _this15.$data.currentValue
|
|
26291
28136
|
}), {
|
|
@@ -26500,6 +28345,7 @@
|
|
|
26500
28345
|
isLoading: types.boolRequired,
|
|
26501
28346
|
sessionIdFromStore: Q.string,
|
|
26502
28347
|
showComponent: types.boolRequired,
|
|
28348
|
+
componentError: types.componentObject,
|
|
26503
28349
|
style: types.style
|
|
26504
28350
|
},
|
|
26505
28351
|
mounted: function mounted() {},
|
|
@@ -26583,14 +28429,50 @@
|
|
|
26583
28429
|
},
|
|
26584
28430
|
messages: function messages() {
|
|
26585
28431
|
this.scrollToBottom();
|
|
28432
|
+
},
|
|
28433
|
+
componentError: function componentError(newVal) {
|
|
28434
|
+
var _this = this;
|
|
28435
|
+
if (newVal && newVal._bodyBlob) {
|
|
28436
|
+
this.AISessionId = ((helper_2(constants_8$1) || {})[this.$props.componentId] || {}).sessionId || null;
|
|
28437
|
+
if (!this.AISessionId) {
|
|
28438
|
+
this.generateNewSessionId();
|
|
28439
|
+
}
|
|
28440
|
+
newVal._bodyBlob.text().then(function (textData) {
|
|
28441
|
+
try {
|
|
28442
|
+
var parsedErrorRes = JSON.parse(textData);
|
|
28443
|
+
if (parsedErrorRes.error) {
|
|
28444
|
+
_this.error = parsedErrorRes.error;
|
|
28445
|
+
_this.$emit('on-data', {
|
|
28446
|
+
data: _this.messages,
|
|
28447
|
+
rawData: _this.$props.rawData,
|
|
28448
|
+
loading: _this.$props.isAIResponseLoading || _this.$props.isLoading,
|
|
28449
|
+
error: parsedErrorRes.error
|
|
28450
|
+
});
|
|
28451
|
+
}
|
|
28452
|
+
} catch (error) {
|
|
28453
|
+
console.error('Error parsing component error JSON:', error);
|
|
28454
|
+
}
|
|
28455
|
+
})["catch"](function (error) {
|
|
28456
|
+
console.error('Error reading component error text data:', error);
|
|
28457
|
+
});
|
|
28458
|
+
}
|
|
26586
28459
|
}
|
|
26587
28460
|
},
|
|
26588
28461
|
methods: {
|
|
28462
|
+
generateNewSessionId: function generateNewSessionId() {
|
|
28463
|
+
var _this2 = this;
|
|
28464
|
+
var newSessionPromise = this.createAISession();
|
|
28465
|
+
newSessionPromise.then(function (res) {
|
|
28466
|
+
_this2.AISessionId = res.AIsessionId;
|
|
28467
|
+
})["catch"](function (e) {
|
|
28468
|
+
console.error(e);
|
|
28469
|
+
});
|
|
28470
|
+
},
|
|
26589
28471
|
scrollToBottom: function scrollToBottom() {
|
|
26590
|
-
var
|
|
28472
|
+
var _this3 = this;
|
|
26591
28473
|
this.$nextTick(function () {
|
|
26592
|
-
var
|
|
26593
|
-
var messageContainer = (
|
|
28474
|
+
var _this3$$refs;
|
|
28475
|
+
var messageContainer = (_this3$$refs = _this3.$refs) == null ? void 0 : _this3$$refs[_this3.$props.innerRef];
|
|
26594
28476
|
if (messageContainer && messageContainer.$el) {
|
|
26595
28477
|
messageContainer.$el.scrollTo({
|
|
26596
28478
|
top: messageContainer.$el.scrollHeight,
|
|
@@ -26657,7 +28539,7 @@
|
|
|
26657
28539
|
"class": "--ai-answer-error-container " + (helper_31(this.$props.innerClass, 'ai-error') || '')
|
|
26658
28540
|
}, [vue.createVNode("div", {
|
|
26659
28541
|
"class": "--default-error-element"
|
|
26660
|
-
}, [vue.createVNode("span", null, [(_this$error = this.error) != null && _this$error.message ? this.error.message : 'There was an error in generating the response.', ' ', (_this$error2 = this.error) != null && _this$error2.code ? "Code:\n\t\t\t\t\t\t\t" + this.error.code : '']), this.AISessionId && vue.createVNode(Button, {
|
|
28542
|
+
}, [vue.createVNode("span", null, [(_this$error = this.error) != null && _this$error.message ? this.error.message : 'There was an error in generating the response.', ' ', (_this$error2 = this.error) != null && _this$error2.code ? ", Code:\n\t\t\t\t\t\t\t" + this.error.code : '']), this.AISessionId && vue.createVNode(Button, {
|
|
26661
28543
|
"primary": true,
|
|
26662
28544
|
"onClick": this.handleRetryRequest
|
|
26663
28545
|
}, {
|
|
@@ -26708,7 +28590,7 @@
|
|
|
26708
28590
|
}
|
|
26709
28591
|
},
|
|
26710
28592
|
renderIcons: function renderIcons() {
|
|
26711
|
-
var
|
|
28593
|
+
var _this4 = this;
|
|
26712
28594
|
var _slot, _slot2;
|
|
26713
28595
|
var _this$$props = this.$props,
|
|
26714
28596
|
getMicInstance = _this$$props.getMicInstance,
|
|
@@ -26722,12 +28604,12 @@
|
|
|
26722
28604
|
"positionType": "absolute"
|
|
26723
28605
|
}, {
|
|
26724
28606
|
"default": function _default() {
|
|
26725
|
-
return [!
|
|
28607
|
+
return [!_this4.isLoadingState && _this4.AISessionId && _this4.shouldMicRender(showVoiceInput) && vue.createVNode(Mic, {
|
|
26726
28608
|
"getInstance": getMicInstance,
|
|
26727
28609
|
"render": renderMic,
|
|
26728
|
-
"handleResult":
|
|
28610
|
+
"handleResult": _this4.handleVoiceResults,
|
|
26729
28611
|
"class": helper_31(innerClass, 'ai-search-mic') || null
|
|
26730
|
-
}, null), iconPosition === 'right' && vue.createVNode(IconWrapper, null, _isSlot$6(_slot =
|
|
28612
|
+
}, null), iconPosition === 'right' && vue.createVNode(IconWrapper, null, _isSlot$6(_slot = _this4.renderIcon()) ? _slot : {
|
|
26731
28613
|
"default": function _default() {
|
|
26732
28614
|
return [_slot];
|
|
26733
28615
|
}
|
|
@@ -26739,7 +28621,7 @@
|
|
|
26739
28621
|
"positionType": "absolute"
|
|
26740
28622
|
}, {
|
|
26741
28623
|
"default": function _default() {
|
|
26742
|
-
return [iconPosition === 'left' && vue.createVNode(IconWrapper, null, _isSlot$6(_slot2 =
|
|
28624
|
+
return [iconPosition === 'left' && vue.createVNode(IconWrapper, null, _isSlot$6(_slot2 = _this4.renderIcon()) ? _slot2 : {
|
|
26743
28625
|
"default": function _default() {
|
|
26744
28626
|
return [_slot2];
|
|
26745
28627
|
}
|
|
@@ -26751,7 +28633,7 @@
|
|
|
26751
28633
|
this.handleSendMessage(e);
|
|
26752
28634
|
},
|
|
26753
28635
|
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
26754
|
-
var
|
|
28636
|
+
var _this5 = this;
|
|
26755
28637
|
var _this$$props2 = this.$props,
|
|
26756
28638
|
enterButton = _this$$props2.enterButton,
|
|
26757
28639
|
innerClass = _this$$props2.innerClass;
|
|
@@ -26759,16 +28641,16 @@
|
|
|
26759
28641
|
if (enterButton) {
|
|
26760
28642
|
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
26761
28643
|
if (renderEnterButton) {
|
|
26762
|
-
return renderEnterButton(
|
|
28644
|
+
return renderEnterButton(_this5.enterButtonOnClick);
|
|
26763
28645
|
}
|
|
26764
28646
|
return vue.createVNode(SendButton, {
|
|
26765
28647
|
"primary": true,
|
|
26766
28648
|
"type": "submit",
|
|
26767
28649
|
"tabIndex": 0,
|
|
26768
|
-
"onClick":
|
|
26769
|
-
"onKeyPress":
|
|
28650
|
+
"onClick": _this5.handleSendMessage,
|
|
28651
|
+
"onKeyPress": _this5.handleKeyPress,
|
|
26770
28652
|
"class": "ask-btn " + helper_31(innerClass, 'ai-enter-button'),
|
|
26771
|
-
"disabled":
|
|
28653
|
+
"disabled": _this5.isLoadingState || !_this5.AISessionId
|
|
26772
28654
|
}, {
|
|
26773
28655
|
"default": function _default() {
|
|
26774
28656
|
return [vue.createTextVNode("Send")];
|
|
@@ -26791,10 +28673,10 @@
|
|
|
26791
28673
|
return getComponent(data, this);
|
|
26792
28674
|
},
|
|
26793
28675
|
handleTextAreaHeightChange: function handleTextAreaHeightChange() {
|
|
26794
|
-
var _this$$
|
|
26795
|
-
var textArea = (_this$$
|
|
26796
|
-
var inputWrapper = (_this$$
|
|
26797
|
-
var errorContainer = (_this$$
|
|
28676
|
+
var _this$$refs, _this$$refs$_inputRef, _this$$refs2, _this$$refs2$_inputWr, _this$$refs3;
|
|
28677
|
+
var textArea = (_this$$refs = this.$refs) == null ? void 0 : (_this$$refs$_inputRef = _this$$refs[_inputRef]) == null ? void 0 : _this$$refs$_inputRef.$el;
|
|
28678
|
+
var inputWrapper = (_this$$refs2 = this.$refs) == null ? void 0 : (_this$$refs2$_inputWr = _this$$refs2[_inputWrapperRef]) == null ? void 0 : _this$$refs2$_inputWr.$el;
|
|
28679
|
+
var errorContainer = (_this$$refs3 = this.$refs) == null ? void 0 : _this$$refs3[_errorContainerRef];
|
|
26798
28680
|
if (textArea) {
|
|
26799
28681
|
textArea.style.height = '42px';
|
|
26800
28682
|
var lineHeight = parseInt(getComputedStyle(textArea).lineHeight, 10);
|
|
@@ -26826,21 +28708,20 @@
|
|
|
26826
28708
|
},
|
|
26827
28709
|
render: function render() {
|
|
26828
28710
|
var _slot3;
|
|
26829
|
-
var
|
|
28711
|
+
var _this6 = this;
|
|
26830
28712
|
var props = this.$props;
|
|
26831
28713
|
if (!this.shouldShowComponent) {
|
|
26832
28714
|
return null;
|
|
26833
28715
|
}
|
|
26834
28716
|
return vue.createVNode(Chatbox, {
|
|
26835
|
-
"style": props.style
|
|
26836
|
-
"class": "--ai-chat-box-wrapper"
|
|
28717
|
+
"style": props.style || {}
|
|
26837
28718
|
}, {
|
|
26838
28719
|
"default": function _default() {
|
|
26839
|
-
return [
|
|
26840
|
-
"class": helper_31(
|
|
28720
|
+
return [_this6.$props.title && vue.createVNode(Title, {
|
|
28721
|
+
"class": helper_31(_this6.$props.innerClass, 'title') || ''
|
|
26841
28722
|
}, {
|
|
26842
28723
|
"default": function _default() {
|
|
26843
|
-
return [
|
|
28724
|
+
return [_this6.$props.title];
|
|
26844
28725
|
}
|
|
26845
28726
|
}), vue.createVNode(ChatContainer, {
|
|
26846
28727
|
"class": "--ai-chat-container",
|
|
@@ -26848,33 +28729,33 @@
|
|
|
26848
28729
|
"showInput": props.showInput
|
|
26849
28730
|
}, {
|
|
26850
28731
|
"default": function _default() {
|
|
26851
|
-
return [
|
|
26852
|
-
"themePreset":
|
|
28732
|
+
return [_this6.hasCustomRenderer && vue.createVNode(MessagesContainer, {
|
|
28733
|
+
"themePreset": _this6.themePreset,
|
|
26853
28734
|
"theme": props.theme,
|
|
26854
|
-
"ref":
|
|
28735
|
+
"ref": _this6.$props.innerRef,
|
|
26855
28736
|
"class": "--ai-message-container " + (helper_31(props.innerClass, 'ai-message-container') || '')
|
|
26856
|
-
}, _isSlot$6(_slot3 =
|
|
28737
|
+
}, _isSlot$6(_slot3 = _this6.getComponent()) ? _slot3 : {
|
|
26857
28738
|
"default": function _default() {
|
|
26858
28739
|
return [_slot3];
|
|
26859
28740
|
}
|
|
26860
|
-
}), !
|
|
26861
|
-
"themePreset":
|
|
28741
|
+
}), !_this6.hasCustomRenderer && vue.createVNode(MessagesContainer, {
|
|
28742
|
+
"themePreset": _this6.themePreset,
|
|
26862
28743
|
"theme": props.theme,
|
|
26863
|
-
"ref":
|
|
28744
|
+
"ref": _this6.$props.innerRef,
|
|
26864
28745
|
"class": "--ai-message-container " + (helper_31(props.innerClass, 'ai-message-container') || '')
|
|
26865
28746
|
}, {
|
|
26866
28747
|
"default": function _default() {
|
|
26867
|
-
return [
|
|
28748
|
+
return [_this6.messages.map(function (message, index) {
|
|
26868
28749
|
return vue.createVNode(Message, {
|
|
26869
28750
|
"key": index,
|
|
26870
28751
|
"isSender": message.role === constants_7$1.USER,
|
|
26871
28752
|
"innerHTML": md$1.render(message.content),
|
|
26872
|
-
"themePreset":
|
|
28753
|
+
"themePreset": _this6.themePreset,
|
|
26873
28754
|
"theme": props.theme,
|
|
26874
28755
|
"class": "--ai-answer-message " + (helper_31(props.innerClass, 'ai-message') || '')
|
|
26875
28756
|
}, null);
|
|
26876
|
-
}),
|
|
26877
|
-
"themePreset":
|
|
28757
|
+
}), _this6.isLoadingState && vue.createVNode(Message, {
|
|
28758
|
+
"themePreset": _this6.themePreset,
|
|
26878
28759
|
"theme": props.theme,
|
|
26879
28760
|
"isSender": false,
|
|
26880
28761
|
"class": "--ai-answer-message " + (helper_31(props.innerClass, 'ai-message') || null)
|
|
@@ -26883,31 +28764,31 @@
|
|
|
26883
28764
|
return [vue.createVNode(TypingIndicator, null, {
|
|
26884
28765
|
"default": function _default() {
|
|
26885
28766
|
return [vue.createVNode(TypingDot, {
|
|
26886
|
-
"themePreset":
|
|
28767
|
+
"themePreset": _this6.themePreset
|
|
26887
28768
|
}, null), vue.createVNode(TypingDot, {
|
|
26888
|
-
"themePreset":
|
|
28769
|
+
"themePreset": _this6.themePreset
|
|
26889
28770
|
}, null), vue.createVNode(TypingDot, {
|
|
26890
|
-
"themePreset":
|
|
28771
|
+
"themePreset": _this6.themePreset
|
|
26891
28772
|
}, null)];
|
|
26892
28773
|
}
|
|
26893
28774
|
})];
|
|
26894
28775
|
}
|
|
26895
28776
|
})];
|
|
26896
28777
|
}
|
|
26897
|
-
}),
|
|
28778
|
+
}), _this6.renderErrorComponent(), ' ', props.showFeedback && vue.createVNode("div", {
|
|
26898
28779
|
"class": "--ai-answer-feedback-container " + (helper_31(props.innerClass, 'ai-feedback') || '')
|
|
26899
28780
|
}, [vue.createVNode(AIFeedback, {
|
|
26900
|
-
"hideUI":
|
|
26901
|
-
"key":
|
|
28781
|
+
"hideUI": _this6.isLoadingState || !_this6.sessionId,
|
|
28782
|
+
"key": _this6.sessionId,
|
|
26902
28783
|
"onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
|
|
26903
|
-
|
|
28784
|
+
_this6.trackUsefullness(_this6.sessionId, {
|
|
26904
28785
|
useful: useful,
|
|
26905
28786
|
reason: reason
|
|
26906
28787
|
});
|
|
26907
28788
|
}
|
|
26908
28789
|
}, null)]), props.showInput && vue.createVNode(MessageInputContainer, {
|
|
26909
28790
|
"class": "--ai-input-container",
|
|
26910
|
-
"onSubmit":
|
|
28791
|
+
"onSubmit": _this6.handleSendMessage
|
|
26911
28792
|
}, {
|
|
26912
28793
|
"default": function _default() {
|
|
26913
28794
|
return [vue.createVNode(InputGroup, {
|
|
@@ -26923,19 +28804,19 @@
|
|
|
26923
28804
|
"ref": _inputRef,
|
|
26924
28805
|
"placeholder": props.placeholder,
|
|
26925
28806
|
"enterButton": props.enterButton,
|
|
26926
|
-
"value":
|
|
26927
|
-
"onInput":
|
|
28807
|
+
"value": _this6.inputMessage,
|
|
28808
|
+
"onInput": _this6.handleMessageInputChange,
|
|
26928
28809
|
"id": props.componentId + "-ai-input",
|
|
26929
28810
|
"showIcon": props.showIcon,
|
|
26930
28811
|
"iconPosition": props.iconPosition,
|
|
26931
|
-
"themePreset":
|
|
26932
|
-
"disabled":
|
|
28812
|
+
"themePreset": _this6.themePreset,
|
|
28813
|
+
"disabled": _this6.isLoadingState || !_this6.AISessionId,
|
|
26933
28814
|
"class": helper_31(props.innerClass, 'ai-input') || null
|
|
26934
|
-
}, null), ' ',
|
|
28815
|
+
}, null), ' ', _this6.renderIcons()];
|
|
26935
28816
|
}
|
|
26936
28817
|
})];
|
|
26937
28818
|
}
|
|
26938
|
-
}),
|
|
28819
|
+
}), _this6.renderEnterButtonElement()];
|
|
26939
28820
|
}
|
|
26940
28821
|
}), ' '];
|
|
26941
28822
|
}
|
|
@@ -26962,12 +28843,14 @@
|
|
|
26962
28843
|
rawData: state.rawData[props.componentId],
|
|
26963
28844
|
themePreset: state.config.themePreset,
|
|
26964
28845
|
isLoading: state.isLoading[props.componentId] || false,
|
|
26965
|
-
sessionIdFromStore: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.sessionId || ''
|
|
28846
|
+
sessionIdFromStore: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.sessionId || '',
|
|
28847
|
+
componentError: state.error[props.componentId]
|
|
26966
28848
|
};
|
|
26967
28849
|
};
|
|
26968
28850
|
var mapDispatchToProps$3 = {
|
|
26969
28851
|
getAIResponse: query_7,
|
|
26970
|
-
trackUsefullness: analytics_8
|
|
28852
|
+
trackUsefullness: analytics_8,
|
|
28853
|
+
createAISession: query_8
|
|
26971
28854
|
};
|
|
26972
28855
|
var AIConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$4, mapDispatchToProps$3)(AIAnswer), {
|
|
26973
28856
|
componentType: constants_1$1.AIAnswer,
|
|
@@ -26981,7 +28864,7 @@
|
|
|
26981
28864
|
// Add componentType for SSR
|
|
26982
28865
|
AIConnected.componentType = constants_1$1.AIAnswer;
|
|
26983
28866
|
|
|
26984
|
-
var _templateObject$
|
|
28867
|
+
var _templateObject$m, _templateObject2$a, _templateObject3$7;
|
|
26985
28868
|
var item = {
|
|
26986
28869
|
width: '15px',
|
|
26987
28870
|
height: '15px',
|
|
@@ -26994,7 +28877,7 @@
|
|
|
26994
28877
|
theme = _ref$theme === void 0 ? {} : _ref$theme;
|
|
26995
28878
|
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";
|
|
26996
28879
|
};
|
|
26997
|
-
var Radio = styled('input')(_templateObject$
|
|
28880
|
+
var Radio = styled('input')(_templateObject$m || (_templateObject$m = _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) {
|
|
26998
28881
|
return props.show ? null : hideInputControl;
|
|
26999
28882
|
}, function (_ref2) {
|
|
27000
28883
|
var theme = _ref2.theme;
|
|
@@ -27003,7 +28886,7 @@
|
|
|
27003
28886
|
var theme = _ref3.theme;
|
|
27004
28887
|
return theme.colors.primaryColor;
|
|
27005
28888
|
});
|
|
27006
|
-
var Checkbox = styled('input')(_templateObject2$
|
|
28889
|
+
var Checkbox = styled('input')(_templateObject2$a || (_templateObject2$a = _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) {
|
|
27007
28890
|
return props.show ? null : hideInputControl;
|
|
27008
28891
|
}, item.width, item.width, item.width, item.height, function (_ref4) {
|
|
27009
28892
|
var theme = _ref4.theme;
|
|
@@ -28992,9 +30875,9 @@
|
|
|
28992
30875
|
});
|
|
28993
30876
|
var types$1 = unwrapExports(types_1);
|
|
28994
30877
|
|
|
28995
|
-
var _templateObject$
|
|
28996
|
-
var HierarchicalMenuList = styled('ul')(_templateObject$
|
|
28997
|
-
var HierarchicalMenuListItem = styled('li')(_templateObject2$
|
|
30878
|
+
var _templateObject$n, _templateObject2$b;
|
|
30879
|
+
var HierarchicalMenuList = styled('ul')(_templateObject$n || (_templateObject$n = _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"])));
|
|
30880
|
+
var HierarchicalMenuListItem = styled('li')(_templateObject2$b || (_templateObject2$b = _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) {
|
|
28998
30881
|
return !props.showLine && "\n\t\t\t\t\tdisplay: none;\n\t\t\t\t";
|
|
28999
30882
|
});
|
|
29000
30883
|
|
|
@@ -29755,26 +31638,26 @@
|
|
|
29755
31638
|
// Add componentType for SSR
|
|
29756
31639
|
TreeListConnected.componentType = constants_1$1.treeList;
|
|
29757
31640
|
|
|
29758
|
-
var _templateObject$
|
|
31641
|
+
var _templateObject$o, _templateObject2$c;
|
|
29759
31642
|
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";
|
|
29760
31643
|
var dark$2 = function dark(_ref) {
|
|
29761
31644
|
var theme = _ref.theme;
|
|
29762
31645
|
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";
|
|
29763
31646
|
};
|
|
29764
|
-
var Select = styled('button')(_templateObject$
|
|
31647
|
+
var Select = styled('button')(_templateObject$o || (_templateObject$o = _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) {
|
|
29765
31648
|
return props.small ? small : null;
|
|
29766
31649
|
}, function (_ref2) {
|
|
29767
31650
|
var themePreset = _ref2.themePreset;
|
|
29768
31651
|
return themePreset === 'dark' && dark$2;
|
|
29769
31652
|
});
|
|
29770
|
-
var Tick = styled('span')(_templateObject2$
|
|
31653
|
+
var Tick = styled('span')(_templateObject2$c || (_templateObject2$c = _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) {
|
|
29771
31654
|
var theme = _ref3.theme;
|
|
29772
31655
|
return theme.colors.primaryColor;
|
|
29773
31656
|
});
|
|
29774
31657
|
|
|
29775
|
-
var _templateObject$
|
|
31658
|
+
var _templateObject$p;
|
|
29776
31659
|
var open = "\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n";
|
|
29777
|
-
var Chevron = styled('span')(_templateObject$
|
|
31660
|
+
var Chevron = styled('span')(_templateObject$p || (_templateObject$p = _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) {
|
|
29778
31661
|
return props.open ? open : null;
|
|
29779
31662
|
});
|
|
29780
31663
|
|
|
@@ -31488,8 +33371,8 @@
|
|
|
31488
33371
|
}
|
|
31489
33372
|
});
|
|
31490
33373
|
|
|
31491
|
-
var _templateObject$
|
|
31492
|
-
var Slider = styled('div')(_templateObject$
|
|
33374
|
+
var _templateObject$q;
|
|
33375
|
+
var Slider = styled('div')(_templateObject$q || (_templateObject$q = _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"])));
|
|
31493
33376
|
|
|
31494
33377
|
var global$1 = typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
|
|
31495
33378
|
|
|
@@ -32609,12 +34492,12 @@
|
|
|
32609
34492
|
// Add componentType for SSR
|
|
32610
34493
|
RangeConnected$3.componentType = constants_1$1.rangeSlider;
|
|
32611
34494
|
|
|
32612
|
-
var _templateObject$
|
|
34495
|
+
var _templateObject$r;
|
|
32613
34496
|
var alert = function alert(_ref) {
|
|
32614
34497
|
var theme = _ref.theme;
|
|
32615
34498
|
return "\n\tcolor: " + theme.colors.alertColor + ";\n";
|
|
32616
34499
|
};
|
|
32617
|
-
var Content = styled('div')(_templateObject$
|
|
34500
|
+
var Content = styled('div')(_templateObject$r || (_templateObject$r = _taggedTemplateLiteralLoose(["\n\t", ";\n\tfont-size: 13px;\n\tmargin: 8px;\n"])), function (props) {
|
|
32618
34501
|
return props.alert && alert;
|
|
32619
34502
|
});
|
|
32620
34503
|
|
|
@@ -38438,9 +40321,9 @@
|
|
|
38438
40321
|
}
|
|
38439
40322
|
};
|
|
38440
40323
|
|
|
38441
|
-
var _templateObject$
|
|
38442
|
-
var MapPin = styled('div')(_templateObject$
|
|
38443
|
-
var MapPinArrow = styled('div')(_templateObject2$
|
|
40324
|
+
var _templateObject$s, _templateObject2$d, _templateObject3$8;
|
|
40325
|
+
var MapPin = styled('div')(_templateObject$s || (_templateObject$s = _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"])));
|
|
40326
|
+
var MapPinArrow = styled('div')(_templateObject2$d || (_templateObject2$d = _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"])));
|
|
38444
40327
|
var mapPinWrapper = css(_templateObject3$8 || (_templateObject3$8 = _taggedTemplateLiteralLoose(["\n\t&:hover,\n\t&:focus {\n\t\tz-index: 200;\n\t}\n"])));
|
|
38445
40328
|
|
|
38446
40329
|
var recordResultClick$3 = lib_5.recordResultClick;
|
|
@@ -38769,7 +40652,7 @@
|
|
|
38769
40652
|
}
|
|
38770
40653
|
};
|
|
38771
40654
|
|
|
38772
|
-
var _templateObject$
|
|
40655
|
+
var _templateObject$t;
|
|
38773
40656
|
var ReactiveGoogleMap = {
|
|
38774
40657
|
name: 'ReactiveGoogleMap',
|
|
38775
40658
|
props: {
|
|
@@ -38844,7 +40727,7 @@
|
|
|
38844
40727
|
"style": {
|
|
38845
40728
|
height: '100%'
|
|
38846
40729
|
},
|
|
38847
|
-
"class": css(_templateObject$
|
|
40730
|
+
"class": css(_templateObject$t || (_templateObject$t = _taggedTemplateLiteralLoose(["\n\t\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\t"]))),
|
|
38848
40731
|
"options": {
|
|
38849
40732
|
zoomControl: true
|
|
38850
40733
|
},
|
|
@@ -39103,7 +40986,7 @@
|
|
|
39103
40986
|
httpEquiv: "http-equiv"
|
|
39104
40987
|
};
|
|
39105
40988
|
var escapeRE = /["'&<>]/;
|
|
39106
|
-
function escapeHtml$
|
|
40989
|
+
function escapeHtml$2(string) {
|
|
39107
40990
|
var str = "" + string;
|
|
39108
40991
|
var match = escapeRE.exec(str);
|
|
39109
40992
|
if (!match) {
|
|
@@ -39173,7 +41056,7 @@
|
|
|
39173
41056
|
if (isBooleanAttr(attrKey)) {
|
|
39174
41057
|
return includeBooleanAttr(value) ? " " + attrKey : "";
|
|
39175
41058
|
} else if (isSSRSafeAttrName(attrKey)) {
|
|
39176
|
-
return value === "" ? " " + attrKey : " " + attrKey + "=\"" + escapeHtml$
|
|
41059
|
+
return value === "" ? " " + attrKey : " " + attrKey + "=\"" + escapeHtml$2(value) + "\"";
|
|
39177
41060
|
} else {
|
|
39178
41061
|
console.warn("[@vue/server-renderer] Skipped rendering unsafe attribute name: " + attrKey);
|
|
39179
41062
|
return "";
|
|
@@ -39187,17 +41070,17 @@
|
|
|
39187
41070
|
return type === "string" || type === "number" || type === "boolean";
|
|
39188
41071
|
}
|
|
39189
41072
|
function ssrRenderClass(raw) {
|
|
39190
|
-
return escapeHtml$
|
|
41073
|
+
return escapeHtml$2(normalizeClass(raw));
|
|
39191
41074
|
}
|
|
39192
41075
|
function ssrRenderStyle(raw) {
|
|
39193
41076
|
if (!raw) {
|
|
39194
41077
|
return "";
|
|
39195
41078
|
}
|
|
39196
41079
|
if (isString(raw)) {
|
|
39197
|
-
return escapeHtml$
|
|
41080
|
+
return escapeHtml$2(raw);
|
|
39198
41081
|
}
|
|
39199
41082
|
var styles = normalizeStyle(raw);
|
|
39200
|
-
return escapeHtml$
|
|
41083
|
+
return escapeHtml$2(stringifyStyle(styles));
|
|
39201
41084
|
}
|
|
39202
41085
|
function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) {
|
|
39203
41086
|
parentPush("<!--teleport start-->");
|
|
@@ -39360,7 +41243,7 @@
|
|
|
39360
41243
|
children = vnode.children;
|
|
39361
41244
|
switch (type) {
|
|
39362
41245
|
case vue.Text:
|
|
39363
|
-
push(escapeHtml$
|
|
41246
|
+
push(escapeHtml$2(children));
|
|
39364
41247
|
break;
|
|
39365
41248
|
case vue.Comment:
|
|
39366
41249
|
push(children ? "<!--" + escapeHtmlComment(children) + "-->" : "<!---->");
|
|
@@ -39433,15 +41316,15 @@
|
|
|
39433
41316
|
push(props.innerHTML);
|
|
39434
41317
|
} else if (props.textContent) {
|
|
39435
41318
|
hasChildrenOverride = true;
|
|
39436
|
-
push(escapeHtml$
|
|
41319
|
+
push(escapeHtml$2(props.textContent));
|
|
39437
41320
|
} else if (tag === "textarea" && props.value) {
|
|
39438
41321
|
hasChildrenOverride = true;
|
|
39439
|
-
push(escapeHtml$
|
|
41322
|
+
push(escapeHtml$2(props.value));
|
|
39440
41323
|
}
|
|
39441
41324
|
}
|
|
39442
41325
|
if (!hasChildrenOverride) {
|
|
39443
41326
|
if (shapeFlag & 8) {
|
|
39444
|
-
push(escapeHtml$
|
|
41327
|
+
push(escapeHtml$2(children));
|
|
39445
41328
|
} else if (shapeFlag & 16) {
|
|
39446
41329
|
renderVNodeChildren(push, children, parentComponent, slotScopeId);
|
|
39447
41330
|
}
|
|
@@ -39948,7 +41831,7 @@
|
|
|
39948
41831
|
}, queryString, renderFunction);
|
|
39949
41832
|
}
|
|
39950
41833
|
|
|
39951
|
-
var version = "3.0.0-rc.6.
|
|
41834
|
+
var version = "3.0.0-rc.6.6";
|
|
39952
41835
|
|
|
39953
41836
|
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];
|
|
39954
41837
|
function install$1 (Vue) {
|