@appbaseio/reactivesearch-vue 3.0.0-rc.1 → 3.0.0-rc.10
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 +12245 -1576
- 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/{Button-d4da7470.js → Button-f96a0570.js} +14 -7
- package/dist/cjs/{ComponentWrapper-9146d811.js → ComponentWrapper-0334c14b.js} +4 -1
- package/dist/cjs/{DropDown-b16418e9.js → DropDown-eb2aeafa.js} +19 -8
- package/dist/cjs/DynamicRangeSlider.js +6 -4
- package/dist/cjs/Input-18e425fb.js +97 -0
- package/dist/cjs/MultiDropdownList.js +8 -7
- package/dist/cjs/MultiList.js +5 -5
- package/dist/cjs/MultiRange.js +4 -4
- package/dist/cjs/{Pagination-b953a80a.js → Pagination-c44adce0.js} +2 -2
- package/dist/cjs/{PreferencesConsumer-85dee673.js → PreferencesConsumer-7bee3c57.js} +1 -1
- package/dist/cjs/RangeInput.js +7 -5
- package/dist/cjs/RangeSlider.js +7 -5
- package/dist/cjs/ReactiveBase.js +16 -18
- package/dist/cjs/ReactiveComponent.js +4 -4
- package/dist/cjs/ReactiveGoogleMap.js +7 -6
- package/dist/cjs/ReactiveList.js +6 -6
- package/dist/cjs/ResultCard.js +1 -1
- package/dist/cjs/ResultList.js +1 -1
- package/dist/cjs/SelectedFilters.js +4 -3
- package/dist/cjs/SingleDropdownList.js +8 -7
- package/dist/cjs/SingleList.js +5 -5
- package/dist/cjs/SingleRange.js +4 -4
- package/dist/cjs/StateProvider.js +1 -1
- package/dist/cjs/ToggleButton.js +6 -5
- package/dist/cjs/{index-779ed366.js → index-1f41363f.js} +7 -3
- package/dist/cjs/index.js +15 -9
- package/dist/cjs/{install-7cdf6798.js → install-0e8729aa.js} +1688 -284
- package/dist/cjs/install.js +14 -9
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-1bf00978.js → vueTypes-0dba0df2.js} +18 -0
- package/dist/components/ReactiveBase/ReactiveBase.d.ts +33 -0
- package/dist/components/basic/ReactiveComponent.d.ts +30 -0
- package/dist/components/basic/ReactiveComponentPrivate.d.ts +10 -0
- package/dist/components/basic/SelectedFilters.d.ts +24 -0
- package/dist/components/basic/StateProvider.d.ts +12 -0
- package/dist/components/list/MultiDropdownList.d.ts +49 -0
- package/dist/components/list/MultiList.d.ts +47 -0
- package/dist/components/list/SingleDropdownList.d.ts +47 -0
- package/dist/components/list/SingleList.d.ts +47 -0
- package/dist/components/list/ToggleButton.d.ts +33 -0
- package/dist/components/list/TreeList.d.ts +48 -0
- package/dist/components/range/DynamicRangeSlider.d.ts +38 -0
- package/dist/components/range/MultiRange.d.ts +30 -0
- package/dist/components/range/RangeInput.d.ts +30 -0
- package/dist/components/range/RangeSlider.d.ts +40 -0
- package/dist/components/range/SingleRange.d.ts +28 -0
- package/dist/components/result/ReactiveList.d.ts +55 -0
- package/dist/components/result/ResultCard.d.ts +10 -0
- package/dist/components/result/ResultList.d.ts +11 -0
- package/dist/components/search/AIAnswer.d.ts +39 -0
- package/dist/components/search/SearchBox.d.ts +106 -0
- package/dist/es/{Button-fd869491.js → Button-5c2cf399.js} +14 -7
- package/dist/es/{ComponentWrapper-8a3c388d.js → ComponentWrapper-46d04344.js} +4 -1
- package/dist/es/{DropDown-fc1fef02.js → DropDown-4a7b4864.js} +19 -9
- package/dist/es/DynamicRangeSlider.js +7 -5
- package/dist/es/Input-26360449.js +89 -0
- package/dist/es/MultiDropdownList.js +8 -7
- package/dist/es/MultiList.js +5 -5
- package/dist/es/MultiRange.js +4 -4
- package/dist/es/{Pagination-c2745bec.js → Pagination-aae4e95f.js} +2 -2
- package/dist/es/{PreferencesConsumer-b058d14e.js → PreferencesConsumer-0856ed43.js} +1 -1
- package/dist/es/RangeInput.js +7 -5
- package/dist/es/RangeSlider.js +8 -6
- package/dist/es/ReactiveBase.js +16 -18
- package/dist/es/ReactiveComponent.js +4 -4
- package/dist/es/ReactiveGoogleMap.js +7 -6
- package/dist/es/ReactiveList.js +6 -6
- package/dist/es/ResultCard.js +1 -1
- package/dist/es/ResultList.js +1 -1
- package/dist/es/SelectedFilters.js +4 -3
- package/dist/es/SingleDropdownList.js +8 -7
- package/dist/es/SingleList.js +5 -5
- package/dist/es/SingleRange.js +4 -4
- package/dist/es/StateProvider.js +1 -1
- package/dist/es/ToggleButton.js +6 -5
- package/dist/es/{index-882489e1.js → index-104f1dfb.js} +7 -3
- package/dist/es/index.js +15 -10
- package/dist/es/{install-0c7962bc.js → install-78ac6225.js} +1651 -248
- package/dist/es/install.js +14 -9
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-f1923c72.js → vueTypes-409296a9.js} +18 -0
- package/dist/index.d.ts +39 -0
- package/dist/types.ts +224 -0
- package/package.json +8 -4
- package/dist/cjs/Input-497be42a.js +0 -74
- package/dist/es/Input-f7499ef8.js +0 -69
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
import { helper, Actions, causes } from '@appbaseio/reactivecore';
|
|
2
|
-
import { SEARCH_COMPONENTS_MODES, componentTypes, TREELIST_VALUES_PATH_SEPARATOR } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
2
|
+
import { SEARCH_COMPONENTS_MODES, componentTypes, AI_LOCAL_CACHE_KEY, AI_ROLES, TREELIST_VALUES_PATH_SEPARATOR } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
3
3
|
import _transformOn from '@vue/babel-helper-vue-transform-on';
|
|
4
|
-
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
5
|
-
import { createVNode, createTextVNode, defineComponent, isVNode, mergeProps, h } from 'vue';
|
|
4
|
+
import { _ as _taggedTemplateLiteralLoose, a as _extends, b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-ded08042.js';
|
|
5
|
+
import { createVNode, createTextVNode, defineComponent, ref, watch, isVNode, mergeProps, h } from 'vue';
|
|
6
6
|
import VueTypes from 'vue-types';
|
|
7
|
-
import { getQueryOptions, suggestionTypes,
|
|
8
|
-
import { styled
|
|
9
|
-
import { css } from '@emotion/css';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { getQueryOptions, featuredSuggestionsActionTypes, suggestionTypes, getObjectFromLocalStorage, getClassName as getClassName$2, setObjectInLocalStorage, recLookup, updateCustomQuery as updateCustomQuery$1, updateDefaultQuery as updateDefaultQuery$1, transformTreeListLocalStateIntoQueryComptaibleFormat, isEqual as isEqual$1, transformRawTreeListData, setDeep, getComponent as getComponent$1, getOptionsFromQuery, checkValueChange as checkValueChange$1, getAggsQuery, updateInternalQuery, isFunction as isFunction$1 } from '@appbaseio/reactivecore/lib/utils/helper';
|
|
8
|
+
import { styled } from '@appbaseio/vue-emotion';
|
|
9
|
+
import { css, keyframes } from '@emotion/css';
|
|
10
|
+
import { lighten } from 'polished';
|
|
11
|
+
import { B as Button } from './Button-5c2cf399.js';
|
|
12
|
+
import { t as types } from './vueTypes-409296a9.js';
|
|
12
13
|
import { RLConnected as ReactiveList } from './ReactiveList.js';
|
|
13
14
|
import { getInternalComponentID } from '@appbaseio/reactivecore/lib/utils/transform';
|
|
14
|
-
import { g as getComponent, h as hasCustomRenderer, f as decodeHtml, i as isQueryIdentical, u as updateDefaultQuery, j as updateCustomQuery, a as isFunction, k as isEmpty, p as parseFocusShortcuts, l as extractModifierKeysFromFocusShortcuts, c as connect } from './index-
|
|
15
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
16
|
-
import { P as PreferencesConsumer } from './PreferencesConsumer-
|
|
15
|
+
import { g as getComponent, h as hasCustomRenderer, f as decodeHtml, i as isQueryIdentical, u as updateDefaultQuery, j as updateCustomQuery, a as isFunction, k as isEmpty, p as parseFocusShortcuts, l as extractModifierKeysFromFocusShortcuts, c as connect } from './index-104f1dfb.js';
|
|
16
|
+
import { C as ComponentWrapper } from './ComponentWrapper-46d04344.js';
|
|
17
|
+
import { P as PreferencesConsumer } from './PreferencesConsumer-0856ed43.js';
|
|
17
18
|
import { T as Title } from './Title-863dfa42.js';
|
|
18
19
|
import { L as ListItem } from './ListItem-e3c6acf4.js';
|
|
19
20
|
import { F as Flex } from './Flex-25792bc3.js';
|
|
21
|
+
import { recordAISessionUsefulness } from '@appbaseio/reactivecore/lib/actions/analytics';
|
|
20
22
|
import ReactiveBase from './ReactiveBase.js';
|
|
21
23
|
import hotkeys from 'hotkeys-js';
|
|
22
|
-
import {
|
|
23
|
-
import
|
|
24
|
+
import { Remarkable } from 'remarkable';
|
|
25
|
+
import xss from 'xss';
|
|
26
|
+
import { I as IconWrapper, C as CancelSvg, a as IconGroup, B as ButtonIconWrapper, D as Downshift, b as InputWrapper } from './DropDown-4a7b4864.js';
|
|
27
|
+
import { n as noSuggestions, T as TextArea, I as Input, s as suggestionsContainer, A as Actions$1, a as suggestions, b as searchboxSuggestions } from './Input-26360449.js';
|
|
24
28
|
import { C as Container } from './Container-d00219f7.js';
|
|
25
29
|
import Highlight from 'vue-highlight-words';
|
|
30
|
+
import { fetchAIResponse, createAISession } from '@appbaseio/reactivecore/lib/actions/query';
|
|
26
31
|
import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
27
32
|
import { C as Checkbox, R as Radio } from './FormControlList-fe6eaee4.js';
|
|
28
33
|
import { s as sanitizeObject } from './utils-d7dd4f4e.js';
|
|
@@ -44,7 +49,13 @@ import ResultList from './ResultList.js';
|
|
|
44
49
|
import StateProvider from './StateProvider.js';
|
|
45
50
|
|
|
46
51
|
var _templateObject;
|
|
47
|
-
var InputGroup = styled('div')(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n
|
|
52
|
+
var InputGroup = styled('div')(_templateObject || (_templateObject = _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\t", "\n\t};\n"])), function (_ref) {
|
|
53
|
+
var theme = _ref.theme,
|
|
54
|
+
searchBox = _ref.searchBox;
|
|
55
|
+
return searchBox && "background-color: " + (theme.colors.backgroundColor || '#fafafa') + ";\n\t\tcolor: " + (theme.colors.textColor || '#fff') + ";\n\n\t\t&:focus-within {\n\t\t\tbackground-color: " + (theme.colors.backgroundColor || '#fff') + ";\n\t\t}";
|
|
56
|
+
}, function (props) {
|
|
57
|
+
return props.isOpen && "box-shadow: rgb(0 0 0 / 20%) 0px 0px 15px;\n\t\tborder-bottom-left-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;";
|
|
58
|
+
});
|
|
48
59
|
InputGroup.defaultProps = {
|
|
49
60
|
className: 'input-group'
|
|
50
61
|
};
|
|
@@ -189,10 +200,34 @@ var SearchSvg = {
|
|
|
189
200
|
}
|
|
190
201
|
};
|
|
191
202
|
|
|
192
|
-
|
|
203
|
+
function styleInject(css, ref) {
|
|
204
|
+
if (ref === void 0) ref = {};
|
|
205
|
+
var insertAt = ref.insertAt;
|
|
206
|
+
if (!css || typeof document === 'undefined') {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
210
|
+
var style = document.createElement('style');
|
|
211
|
+
style.type = 'text/css';
|
|
212
|
+
if (insertAt === 'top') {
|
|
213
|
+
if (head.firstChild) {
|
|
214
|
+
head.insertBefore(style, head.firstChild);
|
|
215
|
+
} else {
|
|
216
|
+
head.appendChild(style);
|
|
217
|
+
}
|
|
218
|
+
} else {
|
|
219
|
+
head.appendChild(style);
|
|
220
|
+
}
|
|
221
|
+
if (style.styleSheet) {
|
|
222
|
+
style.styleSheet.cssText = css;
|
|
223
|
+
} else {
|
|
224
|
+
style.appendChild(document.createTextNode(css));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
var css_248z = "#el_TvxDfTAtKp {\n stroke: none;\n stroke-width: 1;\n fill: none;\n}\n#el_D93PK3GbmJ {\n -webkit-transform: translate(163px, 131px);\n transform: translate(163px, 131px);\n fill: #d8d8d8;\n}\n";
|
|
229
|
+
styleInject(css_248z);
|
|
193
230
|
|
|
194
|
-
// eslint-disable-next-line
|
|
195
|
-
createGlobalStyle(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteralLoose(["\n\t#el_TvxDfTAtKp {\n\t\tstroke: none;\n\t\tstroke-width: 1;\n\t\tfill: none;\n\t}\n\t#el_D93PK3GbmJ {\n\t\t-webkit-transform: translate(163px, 131px);\n\t\ttransform: translate(163px, 131px);\n\t\tfill: #d8d8d8;\n\t}\n"])));
|
|
196
231
|
var MicSvg = {
|
|
197
232
|
name: 'MicSvg',
|
|
198
233
|
props: ['className'],
|
|
@@ -226,10 +261,9 @@ var MicSvg = {
|
|
|
226
261
|
}
|
|
227
262
|
};
|
|
228
263
|
|
|
229
|
-
var
|
|
264
|
+
var css_248z$1 = "#el_X81iT9kZYo {\n stroke: none;\n stroke-width: 1;\n fill: none;\n}\n#el_gMpyalCphp {\n -webkit-transform: translate(163px, 131px);\n transform: translate(163px, 131px);\n}\n#el_c7H-3u-D4l {\n fill: #d8d8d8;\n}\n#el_qhFcdAAFwo {\n fill: #d8d8d8;\n}\n#el_M8X8g37WOI {\n stroke: #e83137;\n stroke-width: 21;\n}\n";
|
|
265
|
+
styleInject(css_248z$1);
|
|
230
266
|
|
|
231
|
-
// eslint-disable-next-line
|
|
232
|
-
createGlobalStyle(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteralLoose(["\n\t#el_X81iT9kZYo {\n\t\tstroke: none;\n\t\tstroke-width: 1;\n\t\tfill: none;\n\t}\n\t#el_gMpyalCphp {\n\t\t-webkit-transform: translate(163px, 131px);\n\t\ttransform: translate(163px, 131px);\n\t}\n\t#el_c7H-3u-D4l {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_qhFcdAAFwo {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_M8X8g37WOI {\n\t\tstroke: #e83137;\n\t\tstroke-width: 21;\n\t}\n"])));
|
|
233
267
|
var MuteSvg = {
|
|
234
268
|
name: 'MuteSvg',
|
|
235
269
|
props: ['className'],
|
|
@@ -272,10 +306,9 @@ var MuteSvg = {
|
|
|
272
306
|
}
|
|
273
307
|
};
|
|
274
308
|
|
|
275
|
-
var
|
|
309
|
+
var css_248z$2 = "@-webkit-keyframes kf_el_6WKby7wXqV_an_qqO-rxbNc {\n 0% {\n opacity: 0;\n }\n 13.89% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes kf_el_6WKby7wXqV_an_qqO-rxbNc {\n 0% {\n opacity: 0;\n }\n 13.89% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes kf_el_Wi-my975tM_an_XhXP1epXB {\n 0% {\n opacity: 0;\n }\n 27.78% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes kf_el_Wi-my975tM_an_XhXP1epXB {\n 0% {\n opacity: 0;\n }\n 27.78% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes kf_el_DkfFFTaFxy8_an_T2XxzvIaA {\n 0% {\n opacity: 0;\n }\n 41.67% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes kf_el_DkfFFTaFxy8_an_T2XxzvIaA {\n 0% {\n opacity: 0;\n }\n 41.67% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes kf_el_34IgwiMB5rf_an_TPom3H2LI {\n 0% {\n opacity: 0;\n }\n 55.56% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes kf_el_34IgwiMB5rf_an_TPom3H2LI {\n 0% {\n opacity: 0;\n }\n 55.56% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes kf_el_DeebuCsPTGA_an_aYTRBE7Na {\n 0% {\n opacity: 0;\n }\n 69.44% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes kf_el_DeebuCsPTGA_an_aYTRBE7Na {\n 0% {\n opacity: 0;\n }\n 69.44% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes kf_el_ZOjjrPTvyrv_an_l_BjBNzXw {\n 0% {\n opacity: 0;\n }\n 83.33% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes kf_el_ZOjjrPTvyrv_an_l_BjBNzXw {\n 0% {\n opacity: 0;\n }\n 83.33% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes kf_el_2FATegVmf0K_an_wLg4ofuFx {\n 0% {\n opacity: 0;\n }\n 97.22% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes kf_el_2FATegVmf0K_an_wLg4ofuFx {\n 0% {\n opacity: 0;\n }\n 97.22% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n#el_hiibMG0x- * {\n -webkit-animation-duration: 1.2s;\n animation-duration: 1.2s;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-timing-function: cubic-bezier(0, 0, 1, 1);\n animation-timing-function: cubic-bezier(0, 0, 1, 1);\n}\n#el_QJeJ_2CDw5 {\n stroke: none;\n stroke-width: 1;\n fill: none;\n}\n#el_UYYCfubTRf {\n -webkit-transform: translate(163px, 123px);\n transform: translate(163px, 123px);\n}\n#el_uzZNtK32Zi {\n fill: #d8d8d8;\n}\n#el_EYKQ2N9Kgy {\n fill: #d8d8d8;\n}\n#el_6SDP2LAgKC {\n -webkit-transform: translate(37.846924px, 0px);\n transform: translate(37.846924px, 0px);\n}\n#el_-Vm65Ltfy7 {\n fill: #0B6AFF;\n}\n#el_q04iZcSim4 {\n fill: #d8d8d8;\n}\n#el_6WKby7wXqV {\n -webkit-transform: translate(37.846924px, 0px);\n transform: translate(37.846924px, 0px);\n -webkit-animation-fill-mode: backwards;\n animation-fill-mode: backwards;\n opacity: 0;\n -webkit-animation-name: kf_el_6WKby7wXqV_an_qqO-rxbNc;\n animation-name: kf_el_6WKby7wXqV_an_qqO-rxbNc;\n -webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n}\n#el_9bggsfQOtU {\n fill: #0B6AFF;\n}\n#el_NKxqi9eIym {\n fill: #d8d8d8;\n}\n#el_Wi-my975tM {\n -webkit-transform: translate(37.846924px, 0px);\n transform: translate(37.846924px, 0px);\n -webkit-animation-fill-mode: backwards;\n animation-fill-mode: backwards;\n opacity: 0;\n -webkit-animation-name: kf_el_Wi-my975tM_an_XhXP1epXB;\n animation-name: kf_el_Wi-my975tM_an_XhXP1epXB;\n -webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n}\n#el_zclQ34fvf7 {\n fill: #0B6AFF;\n}\n#el_1OsvRT8HkeZ {\n fill: #d8d8d8;\n}\n#el_DkfFFTaFxy8 {\n -webkit-transform: translate(37.846924px, 0px);\n transform: translate(37.846924px, 0px);\n -webkit-animation-fill-mode: backwards;\n animation-fill-mode: backwards;\n opacity: 0;\n -webkit-animation-name: kf_el_DkfFFTaFxy8_an_T2XxzvIaA;\n animation-name: kf_el_DkfFFTaFxy8_an_T2XxzvIaA;\n -webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n}\n#el_aa9sjx4H0vA {\n fill: #0B6AFF;\n}\n#el_tea114vWg0J {\n fill: #d8d8d8;\n}\n#el_34IgwiMB5rf {\n -webkit-transform: translate(37.846924px, 0px);\n transform: translate(37.846924px, 0px);\n -webkit-animation-fill-mode: backwards;\n animation-fill-mode: backwards;\n opacity: 0;\n -webkit-animation-name: kf_el_34IgwiMB5rf_an_TPom3H2LI;\n animation-name: kf_el_34IgwiMB5rf_an_TPom3H2LI;\n -webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n}\n#el_z5u6RAFhx7d {\n fill: #0B6AFF;\n}\n#el_7nfuWmA5Uhy {\n fill: #d8d8d8;\n}\n#el_DeebuCsPTGA {\n -webkit-transform: translate(37.846924px, 0px);\n transform: translate(37.846924px, 0px);\n -webkit-animation-fill-mode: backwards;\n animation-fill-mode: backwards;\n opacity: 0;\n -webkit-animation-name: kf_el_DeebuCsPTGA_an_aYTRBE7Na;\n animation-name: kf_el_DeebuCsPTGA_an_aYTRBE7Na;\n -webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n}\n#el__ZcqlS20zcw {\n fill: #0B6AFF;\n}\n#el_8DnEQnD7VWV {\n fill: #d8d8d8;\n}\n#el_ZOjjrPTvyrv {\n -webkit-transform: translate(37.846924px, 0px);\n transform: translate(37.846924px, 0px);\n -webkit-animation-fill-mode: backwards;\n animation-fill-mode: backwards;\n opacity: 0;\n -webkit-animation-name: kf_el_ZOjjrPTvyrv_an_l_BjBNzXw;\n animation-name: kf_el_ZOjjrPTvyrv_an_l_BjBNzXw;\n -webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n}\n#el_FYYKCI_u24e {\n fill: #0B6AFF;\n}\n#el_XZty4MnTp5Y {\n fill: #d8d8d8;\n}\n#el_2FATegVmf0K {\n -webkit-transform: translate(37.846924px, 0px);\n transform: translate(37.846924px, 0px);\n -webkit-animation-fill-mode: backwards;\n animation-fill-mode: backwards;\n opacity: 0;\n -webkit-animation-name: kf_el_2FATegVmf0K_an_wLg4ofuFx;\n animation-name: kf_el_2FATegVmf0K_an_wLg4ofuFx;\n -webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n}\n#el_RMT1KUfbdF8 {\n fill: #0B6AFF;\n}\n#el_RgLcovvFiO1 {\n fill: #d8d8d8;\n}\n";
|
|
310
|
+
styleInject(css_248z$2);
|
|
276
311
|
|
|
277
|
-
// eslint-disable-next-line
|
|
278
|
-
createGlobalStyle(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["\n\t@-webkit-keyframes kf_el_6WKby7wXqV_an_qqO-rxbNc {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t13.89% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_6WKby7wXqV_an_qqO-rxbNc {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t13.89% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_Wi-my975tM_an_XhXP1epXB {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t27.78% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_Wi-my975tM_an_XhXP1epXB {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t27.78% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_DkfFFTaFxy8_an_T2XxzvIaA {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t41.67% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_DkfFFTaFxy8_an_T2XxzvIaA {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t41.67% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_34IgwiMB5rf_an_TPom3H2LI {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t55.56% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_34IgwiMB5rf_an_TPom3H2LI {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t55.56% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_DeebuCsPTGA_an_aYTRBE7Na {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t69.44% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_DeebuCsPTGA_an_aYTRBE7Na {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t69.44% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_ZOjjrPTvyrv_an_l_BjBNzXw {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t83.33% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_ZOjjrPTvyrv_an_l_BjBNzXw {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t83.33% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_2FATegVmf0K_an_wLg4ofuFx {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t97.22% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_2FATegVmf0K_an_wLg4ofuFx {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t97.22% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t#el_hiibMG0x- * {\n\t\t-webkit-animation-duration: 1.2s;\n\t\tanimation-duration: 1.2s;\n\t\t-webkit-animation-iteration-count: infinite;\n\t\tanimation-iteration-count: infinite;\n\t\t-webkit-animation-timing-function: cubic-bezier(0, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0, 0, 1, 1);\n\t}\n\t#el_QJeJ_2CDw5 {\n\t\tstroke: none;\n\t\tstroke-width: 1;\n\t\tfill: none;\n\t}\n\t#el_UYYCfubTRf {\n\t\t-webkit-transform: translate(163px, 123px);\n\t\ttransform: translate(163px, 123px);\n\t}\n\t#el_uzZNtK32Zi {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_EYKQ2N9Kgy {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_6SDP2LAgKC {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t}\n\t#el_-Vm65Ltfy7 {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_q04iZcSim4 {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_6WKby7wXqV {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_6WKby7wXqV_an_qqO-rxbNc;\n\t\tanimation-name: kf_el_6WKby7wXqV_an_qqO-rxbNc;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_9bggsfQOtU {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_NKxqi9eIym {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_Wi-my975tM {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_Wi-my975tM_an_XhXP1epXB;\n\t\tanimation-name: kf_el_Wi-my975tM_an_XhXP1epXB;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_zclQ34fvf7 {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_1OsvRT8HkeZ {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_DkfFFTaFxy8 {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_DkfFFTaFxy8_an_T2XxzvIaA;\n\t\tanimation-name: kf_el_DkfFFTaFxy8_an_T2XxzvIaA;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_aa9sjx4H0vA {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_tea114vWg0J {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_34IgwiMB5rf {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_34IgwiMB5rf_an_TPom3H2LI;\n\t\tanimation-name: kf_el_34IgwiMB5rf_an_TPom3H2LI;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_z5u6RAFhx7d {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_7nfuWmA5Uhy {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_DeebuCsPTGA {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_DeebuCsPTGA_an_aYTRBE7Na;\n\t\tanimation-name: kf_el_DeebuCsPTGA_an_aYTRBE7Na;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el__ZcqlS20zcw {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_8DnEQnD7VWV {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_ZOjjrPTvyrv {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_ZOjjrPTvyrv_an_l_BjBNzXw;\n\t\tanimation-name: kf_el_ZOjjrPTvyrv_an_l_BjBNzXw;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_FYYKCI_u24e {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_XZty4MnTp5Y {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_2FATegVmf0K {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_2FATegVmf0K_an_wLg4ofuFx;\n\t\tanimation-name: kf_el_2FATegVmf0K_an_wLg4ofuFx;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_RMT1KUfbdF8 {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_RgLcovvFiO1 {\n\t\tfill: #d8d8d8;\n\t}\n"])));
|
|
279
312
|
var ListenSvg = {
|
|
280
313
|
name: 'ListenSvg',
|
|
281
314
|
props: ['className'],
|
|
@@ -540,7 +573,7 @@ var Mic = {
|
|
|
540
573
|
}
|
|
541
574
|
this.instance = new SpeechRecognition();
|
|
542
575
|
this.instance.continuous = true;
|
|
543
|
-
this.instance.interimResults =
|
|
576
|
+
this.instance.interimResults = false;
|
|
544
577
|
this.instance.lang = lang;
|
|
545
578
|
if (getInstance) {
|
|
546
579
|
getInstance(this.instance);
|
|
@@ -600,18 +633,18 @@ var Mic = {
|
|
|
600
633
|
case STATUS.active:
|
|
601
634
|
return createVNode(ListenSvg, {
|
|
602
635
|
"className": className,
|
|
603
|
-
"
|
|
636
|
+
"onClick": this.handleClick
|
|
604
637
|
}, null);
|
|
605
638
|
case STATUS.stopped:
|
|
606
639
|
case STATUS.denied:
|
|
607
640
|
return createVNode(MuteSvg, {
|
|
608
641
|
"className": className,
|
|
609
|
-
"
|
|
642
|
+
"onClick": this.handleClick
|
|
610
643
|
}, null);
|
|
611
644
|
default:
|
|
612
645
|
return createVNode(MicSvg, {
|
|
613
646
|
"className": className,
|
|
614
|
-
"
|
|
647
|
+
"onClick": this.handleClick
|
|
615
648
|
}, null);
|
|
616
649
|
}
|
|
617
650
|
}
|
|
@@ -723,8 +756,8 @@ var CustomSvg = {
|
|
|
723
756
|
}
|
|
724
757
|
};
|
|
725
758
|
|
|
726
|
-
var _templateObject$
|
|
727
|
-
var AutofillSvgIcon = styled('button')(_templateObject$
|
|
759
|
+
var _templateObject$3;
|
|
760
|
+
var AutofillSvgIcon = styled('button')(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tmargin-left: auto;\n\tposition: relative;\n\tright: -3px;\n\tborder: none;\n\toutline: none;\n\tbackground: transparent;\n\tpadding: 0;\n\tz-index: 111000;\n\n\tsvg {\n\t\tcursor: pointer;\n\t\tfill: #707070;\n\t\theight: 20px;\n\t}\n\n\t&:hover {\n\t\tsvg {\n\t\t\tfill: #1c1a1a;\n\t\t}\n\t}\n"])));
|
|
728
761
|
var AutoFillSvg = {
|
|
729
762
|
name: 'AutoFillSvg',
|
|
730
763
|
render: function render() {
|
|
@@ -748,13 +781,313 @@ var AutoFillSvg = {
|
|
|
748
781
|
}
|
|
749
782
|
};
|
|
750
783
|
|
|
751
|
-
var _templateObject$
|
|
752
|
-
var TagsContainer = styled('div')(_templateObject$
|
|
784
|
+
var _templateObject$4, _templateObject2;
|
|
785
|
+
var TagsContainer = styled('div')(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin-top: 10px;\n\twidth: 100%;\n"])));
|
|
753
786
|
var TagItem = styled('span')(_templateObject2 || (_templateObject2 = _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"])));
|
|
754
787
|
|
|
788
|
+
var _templateObject$5;
|
|
789
|
+
var AutosuggestFooterContainer = styled('div')(_templateObject$5 || (_templateObject$5 = _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"])));
|
|
790
|
+
|
|
791
|
+
var _templateObject$6, _templateObject2$1, _templateObject3;
|
|
792
|
+
var skeletonAnimation = keyframes(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteralLoose(["\n 0% {\n background-position: 100% 0;\n }\n 100% {\n background-position: -200% 0;\n }\n"])));
|
|
793
|
+
var SkeletonLoader = styled('div')(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n"])));
|
|
794
|
+
var SkeletonLine = styled('div')(_templateObject3 || (_templateObject3 = _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);
|
|
795
|
+
var HorizontalSkeletonLoader = defineComponent({
|
|
796
|
+
name: 'HorizontalSkeletonLoader',
|
|
797
|
+
render: function render() {
|
|
798
|
+
return createVNode(SkeletonLoader, null, {
|
|
799
|
+
"default": function _default() {
|
|
800
|
+
return [createVNode(SkeletonLine, null, null), createVNode(SkeletonLine, null, null), createVNode(SkeletonLine, null, null), createVNode(SkeletonLine, null, null)];
|
|
801
|
+
}
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
});
|
|
805
|
+
|
|
806
|
+
var _templateObject$7, _templateObject2$2, _templateObject3$1, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
807
|
+
var Chatbox = styled('div')(_templateObject$7 || (_templateObject$7 = _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) {
|
|
808
|
+
return props.theme && props.theme.colors ? props.theme.colors.backgroundColor : '#fff';
|
|
809
|
+
});
|
|
810
|
+
var ChatContainer = styled('div')(_templateObject2$2 || (_templateObject2$2 = _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) {
|
|
811
|
+
return props.showInput ? 'bottom: 48px;' : '';
|
|
812
|
+
}, function (props) {
|
|
813
|
+
return props.theme && props.theme.colors && props.theme.colors.backgroundColor ? props.theme.colors.backgroundColor : '#fff';
|
|
814
|
+
}, function (props) {
|
|
815
|
+
return props.theme && props.theme.colors && props.theme.colors.backgroundColor ? props.theme.colors.backgroundColor : '#fff';
|
|
816
|
+
}, function (props) {
|
|
817
|
+
return props.showInput ? ".--ai-answer-feedback-container {\n\t\tmargin-top: 15px;\n\t\tmargin-bottom: -10px;\n\t}" : ".--ai-answer-feedback-container {\n\t\tmargin-top: 4px;\n\t}";
|
|
818
|
+
});
|
|
819
|
+
var MessagesContainer = styled('div')(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteralLoose(["\n\tmax-height: 400px;\n overflow-y: auto;\n\tpadding: 10px;\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-height: 200px;\n\n}};\n"])));
|
|
820
|
+
var typingDots = keyframes(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n 0% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-70%);\n }\n 100% {\n transform: translateY(0);\n }\n"])));
|
|
821
|
+
var TypingIndicator = styled('div')(_templateObject5 || (_templateObject5 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin: 5px !important;\n"])));
|
|
822
|
+
var TypingDot = styled('div')(_templateObject6 || (_templateObject6 = _taggedTemplateLiteralLoose(["\n\twidth: 6px;\n\theight: 6px;\n\tbackground-color: ", ";\n\tborder-radius: 50%;\n\tmargin: 0 2px !important;\n\tanimation: ", " 1s infinite;\n\t&:nth-child(2) {\n\t\tanimation-delay: 0.2s;\n\t}\n\t&:nth-child(3) {\n\t\tanimation-delay: 0.4s;\n\t}\n"])), function (props) {
|
|
823
|
+
var finalColor;
|
|
824
|
+
if (props.isSender) {
|
|
825
|
+
finalColor = props.themePreset !== 'dark' ? props.theme.colors.primaryTextColor : props.theme.colors.textColor;
|
|
826
|
+
} else {
|
|
827
|
+
finalColor = props.themePreset !== 'dark' ? props.theme.colors.borderColor : props.theme.colors.textColor;
|
|
828
|
+
}
|
|
829
|
+
return finalColor;
|
|
830
|
+
}, typingDots);
|
|
831
|
+
var resetCSS = function resetCSS(props) {
|
|
832
|
+
return "\n\thtml,\n\tbody,\n\tdiv,\n\tspan,\n\tapplet,\n\tobject,\n\tiframe,\n\th1,\n\th2,\n\th3,\n\th4,\n\th5,\n\th6,\n\tp,\n\tblockquote,\n\tpre,\n\ta,\n\tabbr,\n\tacronym,\n\taddress,\n\tbig,\n\tcite,\n\tcode,\n\tdel,\n\tdfn,\n\tem,\n\timg,\n\tins,\n\tkbd,\n\tq,\n\ts,\n\tsamp,\n\tsmall,\n\tstrike,\n\tstrong,\n\tsub,\n\tsup,\n\ttt,\n\tvar,\n\tb,\n\tu,\n\ti,\n\tcenter,\n\tdl,\n\tdt,\n\tdd,\n\tol,\n\tul,\n\tli,\n\tfieldset,\n\tform,\n\tlabel,\n\tlegend,\n\ttable,\n\tcaption,\n\ttbody,\n\ttfoot,\n\tthead,\n\ttr,\n\tth,\n\ttd,\n\tarticle,\n\taside,\n\tcanvas,\n\tdetails,\n\tembed,\n\tfigure,\n\tfigcaption,\n\tfooter,\n\theader,\n\thgroup,\n\tmenu,\n\tnav,\n\toutput,\n\truby,\n\tsection,\n\tsummary,\n\ttime,\n\tmark,\n\taudio,\n\tvideo {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tborder: 0;\n\t\tfont-size: 100%;\n\t\tfont: inherit;\n\t\tvertical-align: baseline;\n\t\toverflow-wrap: anywhere;\n\t}\n\tpre {\n\t\tmargin: 10px auto;\n\t}\n\ttable {\n\t\tmargin: 10px auto;\n\t\tborder-collapse: collapse;\n\t\tborder-spacing: 0;\n\t}\n\ttr {\n\t\tborder-bottom: 1px solid #ccc;\n\t}\n\tth,\n\ttd {\n\t\ttext-align: left;\n\t\tpadding: 4px;\n\t\tborder: 1px solid;\n\t\tborder-collapse: collapse;\n\t}\n\tpre,\n\tcode {\n\t\tpadding: 0.6em 0.4em;\n\t\tbackground: " + (
|
|
833
|
+
// eslint-disable-next-line no-nested-ternary
|
|
834
|
+
props.isSender ? props.themePreset !== 'dark' ? props.theme.colors.primaryColor : props.theme.colors.borderColor : props.theme.colors.borderColor) + ";\n\t}\n\n\tcode {\n\t\tline-height: normal;\n\n\t\tcolor: " + (
|
|
835
|
+
// eslint-disable-next-line no-nested-ternary
|
|
836
|
+
props.isSender ? props.themePreset !== 'dark' ? props.theme.colors.primaryTextColor : props.theme.colors.textColor : props.theme.colors.primaryTextColor) + ";\n\t\tborder-radius: 3px;\n\t\tfont-size: 85%;\n\t\tpadding: 0.2em 0.4em;\n\t\tmargin-top: 5px;\n\t\tdisplay: inline-block;\n\t\toverflow: auto;\n\t\twidth: fit-content;\n\t\tmax-width: 100%;\n\t}\n\tul,\n\tol {\n\t\tlist-style-position: inside;\n\t\tpadding-left: 10px;\n\n\t}\n\n\tli{\n\t\tdisplay: list-item;\n\t\tcursor: default;\n\t\tpadding: initial;\n\n\t\t&:hover{\n\t\t\tbackground-color: initial;\n\t\t}\n\t}\n\tp {\n\t\tmargin: inherit;\n\t}\n";
|
|
837
|
+
};
|
|
838
|
+
var messageBGColor = function messageBGColor(props) {
|
|
839
|
+
var finalBGColor;
|
|
840
|
+
if (props.isSender) {
|
|
841
|
+
finalBGColor = props.themePreset !== 'dark' ? props.theme.colors.primaryColor : props.theme.colors.borderColor;
|
|
842
|
+
} else {
|
|
843
|
+
finalBGColor = props.themePreset !== 'dark' ? lighten(0.53, props.theme.colors.borderColor) : props.theme.colors.backgroundColor;
|
|
844
|
+
}
|
|
845
|
+
return finalBGColor;
|
|
846
|
+
};
|
|
847
|
+
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) {
|
|
848
|
+
return messageBGColor(props);
|
|
849
|
+
}, function (props) {
|
|
850
|
+
var finalColor;
|
|
851
|
+
if (props.isSender) {
|
|
852
|
+
finalColor = props.themePreset !== 'dark' ? props.theme.colors.primaryTextColor : props.theme.colors.textColor;
|
|
853
|
+
} else {
|
|
854
|
+
finalColor = props.themePreset !== 'dark' ? props.theme.colors.borderColor : props.theme.colors.textColor;
|
|
855
|
+
}
|
|
856
|
+
return finalColor;
|
|
857
|
+
}, function (props) {
|
|
858
|
+
return props.themePreset === 'dark' ? 'currentColor' : messageBGColor(props);
|
|
859
|
+
}, function (props) {
|
|
860
|
+
return props.isSender ? 'flex-end' : 'flex-start';
|
|
861
|
+
}, function (props) {
|
|
862
|
+
return resetCSS(props);
|
|
863
|
+
});
|
|
864
|
+
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"])));
|
|
865
|
+
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) {
|
|
866
|
+
return props.themePreset === 'dark' ? props.theme.colors.borderColor : '#fff';
|
|
867
|
+
}, function (props) {
|
|
868
|
+
return props.themePreset === 'dark' ? props.theme.colors.titleColor : props.theme.colors.textColor;
|
|
869
|
+
}, function (props) {
|
|
870
|
+
return props.theme.colors.textColor;
|
|
871
|
+
}, function (props) {
|
|
872
|
+
return props.theme.colors.textColor;
|
|
873
|
+
}, function (props) {
|
|
874
|
+
return props.theme.colors.textColor;
|
|
875
|
+
}, function (_ref) {
|
|
876
|
+
var enterButton = _ref.enterButton;
|
|
877
|
+
return enterButton && "\n\t\t border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\t";
|
|
878
|
+
});
|
|
879
|
+
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"])));
|
|
880
|
+
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"])));
|
|
881
|
+
|
|
882
|
+
var _templateObject$8, _templateObject2$3, _templateObject3$2, _templateObject4$1, _templateObject5$1, _templateObject6$1, _templateObject7$1;
|
|
883
|
+
var fadeInFromBottom = keyframes(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteralLoose(["\n 0% {\n opacity: 0;\n transform: translateY(20px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])));
|
|
884
|
+
var fadeInFromTop = keyframes(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteralLoose(["\n 0% {\n opacity: 0;\n transform: translateY(-20px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])));
|
|
885
|
+
var SearchBoxAISection = styled('div')(_templateObject3$2 || (_templateObject3$2 = _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) {
|
|
886
|
+
var themePreset = _ref.themePreset,
|
|
887
|
+
theme = _ref.theme;
|
|
888
|
+
return themePreset === 'dark' ? '#424242' : theme.colors.backgroundColor;
|
|
889
|
+
}, function (_ref2) {
|
|
890
|
+
var theme = _ref2.theme;
|
|
891
|
+
return theme.colors.textColor;
|
|
892
|
+
});
|
|
893
|
+
var Question = styled('div')(_templateObject4$1 || (_templateObject4$1 = _taggedTemplateLiteralLoose(["\n\tfont-weight: bold;\n\tmargin-bottom: 5px;\n\tanimation: ", " 0.5s ease-out;\n"])), fadeInFromTop);
|
|
894
|
+
var Answer = styled('div')(_templateObject5$1 || (_templateObject5$1 = _taggedTemplateLiteralLoose(["\n\t", "\n\tposition: relative;\n\tmargin-bottom: 5px;\n\tmin-height: 100px;\n\toverflow: auto;\n\twhite-space: pre-wrap;\n\tpre {\n\t\twhite-space: pre-wrap;\n\t}\n\tcode,\n\tpre {\n\t\tdisplay: revert;\n\t}\n"])), function (props) {
|
|
895
|
+
return resetCSS(props);
|
|
896
|
+
});
|
|
897
|
+
var Footer = styled('div')(_templateObject6$1 || (_templateObject6$1 = _taggedTemplateLiteralLoose(["\n\tcolor: #777;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 1rem;\n\tflex-wrap: wrap;\n\tanimation: ", " 0.5s ease-out;\n\tpadding: 10px 0;\n\tbackground: white;\n\tbackground-color: ", ";\n\tcolor: ", ";\n"])), fadeInFromBottom, function (_ref3) {
|
|
898
|
+
var themePreset = _ref3.themePreset,
|
|
899
|
+
theme = _ref3.theme;
|
|
900
|
+
return themePreset === 'dark' ? '#424242' : theme.colors.backgroundColor;
|
|
901
|
+
}, function (_ref4) {
|
|
902
|
+
var theme = _ref4.theme;
|
|
903
|
+
return theme.colors.textColor;
|
|
904
|
+
});
|
|
905
|
+
var SourceTags = styled('div')(_templateObject7$1 || (_templateObject7$1 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tgap: 8px;\n\tflex-wrap: wrap;\n\t.--ai-source-tag {\n\t\tdisplay: inline-block;\n\t\tmax-width: 200px;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n"])));
|
|
906
|
+
|
|
907
|
+
var ThumbsUpSvg = {
|
|
908
|
+
name: 'ThumbsUpSvg',
|
|
909
|
+
props: ['clickHandler', 'className'],
|
|
910
|
+
render: function render() {
|
|
911
|
+
return createVNode("svg", {
|
|
912
|
+
"stroke": "currentColor",
|
|
913
|
+
"fill": "none",
|
|
914
|
+
"strokeWidth": "2",
|
|
915
|
+
"viewBox": "0 0 24 24",
|
|
916
|
+
"strokeLinecap": "round",
|
|
917
|
+
"strokeLinejoin": "round",
|
|
918
|
+
"class": this.$props.className,
|
|
919
|
+
"height": "1em",
|
|
920
|
+
"width": "1em",
|
|
921
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
922
|
+
"onClick": this.$props.clickHandler
|
|
923
|
+
}, [createVNode("path", {
|
|
924
|
+
"d": "M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"
|
|
925
|
+
}, null)]);
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
var ThumbsDownSvg = {
|
|
930
|
+
name: 'ThumbsDownSvg',
|
|
931
|
+
props: ['clickHandler', 'className'],
|
|
932
|
+
render: function render() {
|
|
933
|
+
return createVNode("svg", {
|
|
934
|
+
"stroke": "currentColor",
|
|
935
|
+
"fill": "none",
|
|
936
|
+
"strokeWidth": "2",
|
|
937
|
+
"viewBox": "0 0 24 24",
|
|
938
|
+
"strokeLinecap": "round",
|
|
939
|
+
"strokeLinejoin": "round",
|
|
940
|
+
"class": this.$props.className,
|
|
941
|
+
"height": "1em",
|
|
942
|
+
"width": "1em",
|
|
943
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
944
|
+
"onClick": this.$props.clickHandler
|
|
945
|
+
}, [createVNode("path", {
|
|
946
|
+
"d": "M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"
|
|
947
|
+
}, null), ' ']);
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
|
|
951
|
+
var AIFeedback = defineComponent({
|
|
952
|
+
name: 'FeedbackComponent',
|
|
953
|
+
props: {
|
|
954
|
+
onFeedbackSubmit: {
|
|
955
|
+
type: Function,
|
|
956
|
+
"default": function _default() {}
|
|
957
|
+
},
|
|
958
|
+
hideUI: {
|
|
959
|
+
type: Boolean,
|
|
960
|
+
"default": false
|
|
961
|
+
},
|
|
962
|
+
overrideState: {
|
|
963
|
+
type: Object,
|
|
964
|
+
"default": function _default() {
|
|
965
|
+
return {};
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
},
|
|
969
|
+
setup: function setup(props, _ref) {
|
|
970
|
+
var emit = _ref.emit;
|
|
971
|
+
var showInput = ref(false);
|
|
972
|
+
var feedbackType = ref(null);
|
|
973
|
+
var feedbackText = ref('');
|
|
974
|
+
var feedbackRecorded = ref(false);
|
|
975
|
+
var handleButtonClick = function handleButtonClick(type) {
|
|
976
|
+
if (feedbackType.value === type) {
|
|
977
|
+
feedbackType.value = null;
|
|
978
|
+
showInput.value = false;
|
|
979
|
+
} else {
|
|
980
|
+
feedbackType.value = type;
|
|
981
|
+
showInput.value = true;
|
|
982
|
+
}
|
|
983
|
+
};
|
|
984
|
+
var handleInputChange = function handleInputChange(e) {
|
|
985
|
+
feedbackText.value = e.target.value;
|
|
986
|
+
};
|
|
987
|
+
var handleSubmit = function handleSubmit() {
|
|
988
|
+
emit('feedback-submit', feedbackType.value === 'positive', feedbackText.value);
|
|
989
|
+
feedbackText.value = '';
|
|
990
|
+
showInput.value = false;
|
|
991
|
+
feedbackRecorded.value = true;
|
|
992
|
+
};
|
|
993
|
+
var handleCancel = function handleCancel() {
|
|
994
|
+
feedbackType.value = null;
|
|
995
|
+
feedbackText.value = '';
|
|
996
|
+
showInput.value = false;
|
|
997
|
+
};
|
|
998
|
+
watch(function () {
|
|
999
|
+
return props.overrideState;
|
|
1000
|
+
}, function (newValue) {
|
|
1001
|
+
if (newValue && newValue.isRecorded) {
|
|
1002
|
+
feedbackRecorded.value = true;
|
|
1003
|
+
feedbackType.value = newValue.feedbackType || 'positive';
|
|
1004
|
+
}
|
|
1005
|
+
});
|
|
1006
|
+
if (props.overrideState && props.overrideState.isRecorded) {
|
|
1007
|
+
feedbackRecorded.value = true;
|
|
1008
|
+
feedbackType.value = props.overrideState.feedbackType || 'positive';
|
|
1009
|
+
}
|
|
1010
|
+
return {
|
|
1011
|
+
showInput: showInput,
|
|
1012
|
+
feedbackType: feedbackType,
|
|
1013
|
+
feedbackText: feedbackText,
|
|
1014
|
+
feedbackRecorded: feedbackRecorded,
|
|
1015
|
+
handleButtonClick: handleButtonClick,
|
|
1016
|
+
handleInputChange: handleInputChange,
|
|
1017
|
+
handleSubmit: handleSubmit,
|
|
1018
|
+
handleCancel: handleCancel
|
|
1019
|
+
};
|
|
1020
|
+
},
|
|
1021
|
+
render: function render() {
|
|
1022
|
+
var _this = this;
|
|
1023
|
+
if (this.$props.hideUI) {
|
|
1024
|
+
return null;
|
|
1025
|
+
}
|
|
1026
|
+
if (this.feedbackRecorded) {
|
|
1027
|
+
return createVNode(AIFeedbackContainer, null, {
|
|
1028
|
+
"default": function _default() {
|
|
1029
|
+
return [createVNode("div", {
|
|
1030
|
+
"class": "--feedback-svgs-wrapper"
|
|
1031
|
+
}, [_this.feedbackType === 'positive' ? createVNode(ThumbsUpSvg, {
|
|
1032
|
+
"class": "selected"
|
|
1033
|
+
}, null) : createVNode(ThumbsDownSvg, {
|
|
1034
|
+
"class": "selected"
|
|
1035
|
+
}, null)])];
|
|
1036
|
+
}
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
return createVNode(AIFeedbackContainer, null, {
|
|
1040
|
+
"default": function _default() {
|
|
1041
|
+
return [!_this.showInput && createVNode("div", {
|
|
1042
|
+
"class": "--feedback-svgs-wrapper"
|
|
1043
|
+
}, [createVNode(ThumbsUpSvg, {
|
|
1044
|
+
"class": _this.feedbackType === 'positive' ? 'selected' : '',
|
|
1045
|
+
"onClick": function onClick() {
|
|
1046
|
+
return _this.handleButtonClick('positive');
|
|
1047
|
+
}
|
|
1048
|
+
}, null), createVNode(ThumbsDownSvg, {
|
|
1049
|
+
"class": _this.feedbackType === 'negative' ? 'selected' : '',
|
|
1050
|
+
"onClick": function onClick() {
|
|
1051
|
+
return _this.handleButtonClick('negative');
|
|
1052
|
+
}
|
|
1053
|
+
}, null)]), _this.showInput && createVNode("div", {
|
|
1054
|
+
"class": "--feedback-input-wrapper"
|
|
1055
|
+
}, [createVNode(Input, {
|
|
1056
|
+
"show": _this.showInput,
|
|
1057
|
+
"placeholder": _this.feedbackType === 'positive' ? 'What do you like about the response?' : 'What was the issue with the response? How can it be improved?',
|
|
1058
|
+
"value": _this.feedbackText,
|
|
1059
|
+
"onInput": _this.handleInputChange
|
|
1060
|
+
}, null), createVNode(Button, {
|
|
1061
|
+
"primary": true,
|
|
1062
|
+
"onClick": _this.handleSubmit
|
|
1063
|
+
}, {
|
|
1064
|
+
"default": function _default() {
|
|
1065
|
+
return [createTextVNode("Submit")];
|
|
1066
|
+
}
|
|
1067
|
+
}), createVNode(Button, {
|
|
1068
|
+
"onClick": _this.handleCancel
|
|
1069
|
+
}, {
|
|
1070
|
+
"default": function _default() {
|
|
1071
|
+
return [createTextVNode("Cancel")];
|
|
1072
|
+
}
|
|
1073
|
+
})])];
|
|
1074
|
+
}
|
|
1075
|
+
});
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
1078
|
+
|
|
1079
|
+
var _excluded = ["_source"];
|
|
755
1080
|
function _isSlot(s) {
|
|
756
1081
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
757
1082
|
}
|
|
1083
|
+
var md = new Remarkable();
|
|
1084
|
+
md.set({
|
|
1085
|
+
html: true,
|
|
1086
|
+
breaks: true,
|
|
1087
|
+
xhtmlOut: true
|
|
1088
|
+
});
|
|
1089
|
+
var _dropdownULRef = 'dropdownULRef';
|
|
1090
|
+
var _inputGroupRef = 'inputGroupRef';
|
|
758
1091
|
var updateQuery = Actions.updateQuery,
|
|
759
1092
|
setCustomQuery = Actions.setCustomQuery,
|
|
760
1093
|
setDefaultQuery = Actions.setDefaultQuery,
|
|
@@ -775,7 +1108,11 @@ var SearchBox = defineComponent({
|
|
|
775
1108
|
currentValue: '',
|
|
776
1109
|
selectedTags: [],
|
|
777
1110
|
isOpen: false,
|
|
778
|
-
normalizedSuggestions: []
|
|
1111
|
+
normalizedSuggestions: [],
|
|
1112
|
+
showAIScreen: false,
|
|
1113
|
+
showAIScreenFooter: false,
|
|
1114
|
+
showFeedbackComponent: false,
|
|
1115
|
+
feedbackState: null
|
|
779
1116
|
};
|
|
780
1117
|
this.internalComponent = props.componentId + "__internal";
|
|
781
1118
|
return this.__state;
|
|
@@ -816,6 +1153,26 @@ var SearchBox = defineComponent({
|
|
|
816
1153
|
},
|
|
817
1154
|
stats: function stats() {
|
|
818
1155
|
return getResultStats(this);
|
|
1156
|
+
},
|
|
1157
|
+
parsedSuggestions: function parsedSuggestions() {
|
|
1158
|
+
var suggestionsArray = [];
|
|
1159
|
+
if (Array.isArray(this.suggestions) && this.suggestions.length) {
|
|
1160
|
+
suggestionsArray = [].concat(withClickIds(this.suggestions));
|
|
1161
|
+
}
|
|
1162
|
+
var sectionsAccumulated = [];
|
|
1163
|
+
var sectionisedSuggestions = suggestionsArray.reduce(function (acc, d, currentIndex) {
|
|
1164
|
+
if (sectionsAccumulated.includes(d.sectionId)) return acc;
|
|
1165
|
+
if (d.sectionId) {
|
|
1166
|
+
acc[currentIndex] = suggestionsArray.filter(function (g) {
|
|
1167
|
+
return g.sectionId === d.sectionId;
|
|
1168
|
+
});
|
|
1169
|
+
sectionsAccumulated.push(d.sectionId);
|
|
1170
|
+
} else {
|
|
1171
|
+
acc[currentIndex] = d;
|
|
1172
|
+
}
|
|
1173
|
+
return acc;
|
|
1174
|
+
}, {});
|
|
1175
|
+
return Object.values(sectionisedSuggestions);
|
|
819
1176
|
}
|
|
820
1177
|
},
|
|
821
1178
|
props: {
|
|
@@ -882,12 +1239,20 @@ var SearchBox = defineComponent({
|
|
|
882
1239
|
distinctFieldConfig: types.props,
|
|
883
1240
|
//
|
|
884
1241
|
focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
|
|
1242
|
+
showFocusShortcutsIcon: VueTypes.bool.def(true),
|
|
885
1243
|
addonBefore: VueTypes.any,
|
|
886
1244
|
addonAfter: VueTypes.any,
|
|
1245
|
+
showSuggestionsFooter: VueTypes.bool.def(true),
|
|
887
1246
|
expandSuggestionsContainer: VueTypes.bool.def(true),
|
|
1247
|
+
renderSuggestionsFooter: VueTypes.func,
|
|
888
1248
|
index: VueTypes.string,
|
|
889
1249
|
popularSuggestionsConfig: VueTypes.object,
|
|
890
1250
|
recentSuggestionsConfig: VueTypes.object,
|
|
1251
|
+
featuredSuggestionsConfig: VueTypes.shape({
|
|
1252
|
+
maxSuggestionsPerSection: VueTypes.number,
|
|
1253
|
+
sectionsOrder: VueTypes.arrayOf(VueTypes.string)
|
|
1254
|
+
}),
|
|
1255
|
+
customEvents: VueTypes.object,
|
|
891
1256
|
applyStopwords: VueTypes.bool,
|
|
892
1257
|
customStopwords: types.stringArray,
|
|
893
1258
|
onData: types.func,
|
|
@@ -897,7 +1262,10 @@ var SearchBox = defineComponent({
|
|
|
897
1262
|
mode: VueTypes.oneOf(['select', 'tag']).def('select'),
|
|
898
1263
|
renderSelectedTags: VueTypes.any,
|
|
899
1264
|
searchboxId: VueTypes.string,
|
|
900
|
-
endpoint: types.endpointConfig
|
|
1265
|
+
endpoint: types.endpointConfig,
|
|
1266
|
+
enableAI: VueTypes.bool.def(false),
|
|
1267
|
+
AIConfig: types.AIConfig,
|
|
1268
|
+
AIUIConfig: types.AIUIConfig
|
|
901
1269
|
},
|
|
902
1270
|
mounted: function mounted() {
|
|
903
1271
|
this.listenForFocusShortcuts();
|
|
@@ -943,6 +1311,7 @@ var SearchBox = defineComponent({
|
|
|
943
1311
|
suggestionsList = [].concat(withClickIds(this.$props.defaultSuggestions));
|
|
944
1312
|
}
|
|
945
1313
|
this.normalizedSuggestions = suggestionsList;
|
|
1314
|
+
this.handleTextAreaHeightChange();
|
|
946
1315
|
},
|
|
947
1316
|
selectedValue: function selectedValue(newVal, oldVal) {
|
|
948
1317
|
if (!isEqual(newVal, oldVal) && (this.$options.isTagsMode ? !isEqual(this.$data.selectedTags, newVal) : this.$data.currentValue !== newVal)) {
|
|
@@ -1004,6 +1373,45 @@ var SearchBox = defineComponent({
|
|
|
1004
1373
|
if (!isEqual(newVal, oldVal)) {
|
|
1005
1374
|
this.handleTextChange = _debounce(this.handleText, newVal);
|
|
1006
1375
|
}
|
|
1376
|
+
},
|
|
1377
|
+
isAITyping: function isAITyping(newVal, oldVal) {
|
|
1378
|
+
var _this = this;
|
|
1379
|
+
var scrollAIContainer = function scrollAIContainer() {
|
|
1380
|
+
var dropdownEle = _this.$refs[_dropdownULRef];
|
|
1381
|
+
if (dropdownEle) {
|
|
1382
|
+
dropdownEle.scrollTo({
|
|
1383
|
+
top: dropdownEle.scrollHeight,
|
|
1384
|
+
behavior: 'smooth'
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1387
|
+
};
|
|
1388
|
+
if (!newVal && oldVal) {
|
|
1389
|
+
this.showAIScreenFooter = true;
|
|
1390
|
+
if (this.$props.AIUIConfig && typeof this.$props.AIUIConfig.showFeedback === 'boolean' ? this.$props.AIUIConfig.showFeedback : true) {
|
|
1391
|
+
this.showFeedbackComponent = true;
|
|
1392
|
+
}
|
|
1393
|
+
setTimeout(function () {
|
|
1394
|
+
scrollAIContainer();
|
|
1395
|
+
}, 500);
|
|
1396
|
+
} else if (newVal) {
|
|
1397
|
+
this.scrollTimerRef = setTimeout(function () {
|
|
1398
|
+
scrollAIContainer();
|
|
1399
|
+
}, 2000);
|
|
1400
|
+
}
|
|
1401
|
+
},
|
|
1402
|
+
showAIScreen: function showAIScreen(newVal) {
|
|
1403
|
+
if (newVal) {
|
|
1404
|
+
var _this$$refs;
|
|
1405
|
+
if ((_this$$refs = this.$refs) != null && _this$$refs[this.$props.innerRef] && this.$refs[this.$props.innerRef].$el) {
|
|
1406
|
+
this.$refs[this.$props.innerRef].$el.blur();
|
|
1407
|
+
}
|
|
1408
|
+
} else {
|
|
1409
|
+
this.feedbackState = null;
|
|
1410
|
+
this.showFeedbackComponent = false;
|
|
1411
|
+
}
|
|
1412
|
+
},
|
|
1413
|
+
currentValue: function currentValue() {
|
|
1414
|
+
this.handleTextAreaHeightChange();
|
|
1007
1415
|
}
|
|
1008
1416
|
},
|
|
1009
1417
|
methods: {
|
|
@@ -1029,9 +1437,20 @@ var SearchBox = defineComponent({
|
|
|
1029
1437
|
data: this.normalizedSuggestions,
|
|
1030
1438
|
rawData: this.rawData,
|
|
1031
1439
|
value: currentValue,
|
|
1032
|
-
resultStats: this.stats
|
|
1440
|
+
resultStats: this.stats,
|
|
1441
|
+
AIData: {
|
|
1442
|
+
question: this.AIResponse && this.AIResponse.response && this.AIResponse.response.question,
|
|
1443
|
+
answer: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text,
|
|
1444
|
+
documentIds: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [],
|
|
1445
|
+
showAIScreen: this.showAIScreen,
|
|
1446
|
+
sources: this.getAISourceObjects(),
|
|
1447
|
+
isAILoading: this.isAIResponseLoading,
|
|
1448
|
+
AIError: this.AIResponseError
|
|
1449
|
+
}
|
|
1033
1450
|
};
|
|
1034
|
-
return
|
|
1451
|
+
return createVNode("div", {
|
|
1452
|
+
"ref": _dropdownULRef
|
|
1453
|
+
}, [getComponent(data, this)]);
|
|
1035
1454
|
},
|
|
1036
1455
|
// returns size and aggs property
|
|
1037
1456
|
getBasicQueryOptions: function getBasicQueryOptions() {
|
|
@@ -1053,7 +1472,7 @@ var SearchBox = defineComponent({
|
|
|
1053
1472
|
}
|
|
1054
1473
|
},
|
|
1055
1474
|
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue) {
|
|
1056
|
-
var
|
|
1475
|
+
var _this2 = this;
|
|
1057
1476
|
if (isDefaultValue === void 0) {
|
|
1058
1477
|
isDefaultValue = false;
|
|
1059
1478
|
}
|
|
@@ -1067,60 +1486,65 @@ var SearchBox = defineComponent({
|
|
|
1067
1486
|
categoryValue = undefined;
|
|
1068
1487
|
}
|
|
1069
1488
|
var performUpdate = function performUpdate() {
|
|
1070
|
-
if (
|
|
1489
|
+
if (_this2.$options.isTagsMode && isEqual(value, _this2.selectedTags)) {
|
|
1071
1490
|
return;
|
|
1072
1491
|
}
|
|
1073
|
-
if (
|
|
1074
|
-
if (Array.isArray(
|
|
1492
|
+
if (_this2.$options.isTagsMode && cause === causes.SUGGESTION_SELECT) {
|
|
1493
|
+
if (Array.isArray(_this2.selectedTags) && _this2.selectedTags.length) {
|
|
1075
1494
|
// check if value already present in selectedTags
|
|
1076
|
-
if (typeof value === 'string' &&
|
|
1077
|
-
|
|
1495
|
+
if (typeof value === 'string' && _this2.selectedTags.includes(value)) {
|
|
1496
|
+
_this2.isOpen = false;
|
|
1078
1497
|
return;
|
|
1079
1498
|
}
|
|
1080
|
-
|
|
1499
|
+
_this2.selectedTags = [].concat(_this2.selectedTags);
|
|
1081
1500
|
if (typeof value === 'string' && !!value) {
|
|
1082
|
-
|
|
1083
|
-
} else if (Array.isArray(value) && !isEqual(
|
|
1084
|
-
|
|
1501
|
+
_this2.selectedTags.push(value);
|
|
1502
|
+
} else if (Array.isArray(value) && !isEqual(_this2.selectedTags, value)) {
|
|
1503
|
+
_this2.selectedTags = value;
|
|
1085
1504
|
}
|
|
1086
1505
|
} else if (value) {
|
|
1087
|
-
|
|
1506
|
+
_this2.selectedTags = typeof value !== 'string' ? value : [].concat(value);
|
|
1088
1507
|
}
|
|
1089
|
-
|
|
1508
|
+
_this2.currentValue = '';
|
|
1090
1509
|
} else {
|
|
1091
|
-
|
|
1510
|
+
_this2.currentValue = decodeHtml(value);
|
|
1092
1511
|
}
|
|
1093
1512
|
var queryHandlerValue = value;
|
|
1094
|
-
if (
|
|
1095
|
-
queryHandlerValue = Array.isArray(
|
|
1513
|
+
if (_this2.$options.isTagsMode && cause === causes.SUGGESTION_SELECT) {
|
|
1514
|
+
queryHandlerValue = Array.isArray(_this2.selectedTags) && _this2.selectedTags.length ? _this2.selectedTags : undefined;
|
|
1096
1515
|
}
|
|
1097
1516
|
if (isDefaultValue) {
|
|
1098
|
-
if (
|
|
1517
|
+
if (_this2.$props.autosuggest) {
|
|
1099
1518
|
if (toggleIsOpen) {
|
|
1100
|
-
|
|
1519
|
+
_this2.isOpen = false;
|
|
1101
1520
|
}
|
|
1102
|
-
if (typeof
|
|
1521
|
+
if (typeof _this2.currentValue === 'string') _this2.triggerDefaultQuery(_this2.currentValue, props.enableAI ? {
|
|
1522
|
+
enableAI: true
|
|
1523
|
+
} : {});
|
|
1103
1524
|
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
1104
1525
|
// to set the query otherwise the value should reset
|
|
1105
1526
|
if (props.strictSelection) {
|
|
1106
|
-
if (cause === causes.SUGGESTION_SELECT || (
|
|
1107
|
-
|
|
1527
|
+
if (cause === causes.SUGGESTION_SELECT || (_this2.$options.isTagsMode ? _this2.selectedTags.length === 0 : value === '')) {
|
|
1528
|
+
_this2.triggerCustomQuery(queryHandlerValue, _this2.$options.isTagsMode ? undefined : categoryValue);
|
|
1108
1529
|
} else {
|
|
1109
|
-
|
|
1530
|
+
_this2.setValue('', true);
|
|
1110
1531
|
}
|
|
1111
1532
|
} else if (props.value === undefined || cause === causes.SUGGESTION_SELECT || cause === causes.CLEAR_VALUE) {
|
|
1112
|
-
|
|
1533
|
+
_this2.triggerCustomQuery(queryHandlerValue, _this2.$options.isTagsMode ? undefined : categoryValue);
|
|
1113
1534
|
}
|
|
1114
1535
|
} else {
|
|
1115
1536
|
// debounce for handling text while typing
|
|
1116
|
-
|
|
1537
|
+
_this2.handleTextChange(value, cause);
|
|
1117
1538
|
}
|
|
1118
|
-
|
|
1119
|
-
|
|
1539
|
+
_this2.$emit('valueChange', value);
|
|
1540
|
+
_this2.$emit('value-change', value);
|
|
1120
1541
|
};
|
|
1121
1542
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
1122
1543
|
},
|
|
1123
|
-
triggerDefaultQuery: function triggerDefaultQuery(paramValue) {
|
|
1544
|
+
triggerDefaultQuery: function triggerDefaultQuery(paramValue, meta) {
|
|
1545
|
+
if (meta === void 0) {
|
|
1546
|
+
meta = {};
|
|
1547
|
+
}
|
|
1124
1548
|
if (!this.$props.autosuggest) {
|
|
1125
1549
|
return;
|
|
1126
1550
|
}
|
|
@@ -1139,7 +1563,8 @@ var SearchBox = defineComponent({
|
|
|
1139
1563
|
componentId: this.internalComponent,
|
|
1140
1564
|
query: query,
|
|
1141
1565
|
value: value,
|
|
1142
|
-
componentType: componentTypes.searchBox
|
|
1566
|
+
componentType: componentTypes.searchBox,
|
|
1567
|
+
meta: meta
|
|
1143
1568
|
});
|
|
1144
1569
|
},
|
|
1145
1570
|
triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue) {
|
|
@@ -1223,8 +1648,8 @@ var SearchBox = defineComponent({
|
|
|
1223
1648
|
this.recordSuggestionClick(searchPosition, docId);
|
|
1224
1649
|
},
|
|
1225
1650
|
clearValue: function clearValue() {
|
|
1226
|
-
this.setValue('', false, this.$props, causes.CLEAR_VALUE, false);
|
|
1227
|
-
this.onValueSelectedHandler('', causes.CLEAR_VALUE);
|
|
1651
|
+
this.setValue('', false, this.$props, !this.$options.isTagsMode ? causes.CLEAR_VALUE : undefined, false);
|
|
1652
|
+
this.onValueSelectedHandler('', !this.$options.isTagsMode ? causes.CLEAR_VALUE : undefined);
|
|
1228
1653
|
},
|
|
1229
1654
|
handleKeyDown: function handleKeyDown(event, highlightedIndex) {
|
|
1230
1655
|
if (highlightedIndex === void 0) {
|
|
@@ -1235,9 +1660,12 @@ var SearchBox = defineComponent({
|
|
|
1235
1660
|
if (this.$props.autosuggest === false) {
|
|
1236
1661
|
this.enterButtonOnClick();
|
|
1237
1662
|
} else if (highlightedIndex === null) {
|
|
1238
|
-
this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined
|
|
1239
|
-
|
|
1240
|
-
|
|
1663
|
+
this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? causes.SUGGESTION_SELECT : undefined,
|
|
1664
|
+
// to handle tags
|
|
1665
|
+
!this.$props.enableAI);
|
|
1666
|
+
if (this.$props.enableAI && !this.showAIScreen) {
|
|
1667
|
+
this.showAIScreen = true;
|
|
1668
|
+
}
|
|
1241
1669
|
this.onValueSelectedHandler(event.target.value, causes.ENTER_PRESS);
|
|
1242
1670
|
}
|
|
1243
1671
|
}
|
|
@@ -1247,18 +1675,21 @@ var SearchBox = defineComponent({
|
|
|
1247
1675
|
this.$emit('key-down', event, this.triggerQuery);
|
|
1248
1676
|
},
|
|
1249
1677
|
onInputChange: function onInputChange(e) {
|
|
1250
|
-
var
|
|
1678
|
+
var _this3 = this;
|
|
1251
1679
|
var inputValue = e.target.value;
|
|
1252
1680
|
if (!this.$data.isOpen && this.$props.autosuggest) {
|
|
1253
1681
|
this.isOpen = true;
|
|
1254
1682
|
}
|
|
1683
|
+
if (this.showAIScreen) {
|
|
1684
|
+
this.showAIScreen = false;
|
|
1685
|
+
}
|
|
1255
1686
|
var value = this.$props.value;
|
|
1256
1687
|
if (value === undefined) {
|
|
1257
|
-
this.setValue(inputValue, false, this.$props,
|
|
1688
|
+
this.setValue(inputValue, false, this.$props, undefined);
|
|
1258
1689
|
} else {
|
|
1259
1690
|
this.$emit('change', inputValue, function (_ref3) {
|
|
1260
1691
|
var isOpen = _ref3.isOpen;
|
|
1261
|
-
return
|
|
1692
|
+
return _this3.triggerQuery({
|
|
1262
1693
|
defaultQuery: true,
|
|
1263
1694
|
customQuery: true,
|
|
1264
1695
|
value: inputValue,
|
|
@@ -1267,10 +1698,52 @@ var SearchBox = defineComponent({
|
|
|
1267
1698
|
}, e);
|
|
1268
1699
|
}
|
|
1269
1700
|
},
|
|
1701
|
+
handleFeaturedSuggestionClicked: function handleFeaturedSuggestionClicked(suggestion) {
|
|
1702
|
+
try {
|
|
1703
|
+
var _this$$refs2, _this$$refs2$this$$pr;
|
|
1704
|
+
if (suggestion.action === featuredSuggestionsActionTypes.NAVIGATE) {
|
|
1705
|
+
var _JSON$parse = JSON.parse(suggestion.subAction),
|
|
1706
|
+
_JSON$parse$target = _JSON$parse.target,
|
|
1707
|
+
target = _JSON$parse$target === void 0 ? '_self' : _JSON$parse$target,
|
|
1708
|
+
_JSON$parse$link = _JSON$parse.link,
|
|
1709
|
+
link = _JSON$parse$link === void 0 ? '/' : _JSON$parse$link;
|
|
1710
|
+
if (typeof window !== 'undefined') {
|
|
1711
|
+
window.open(link, target);
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1714
|
+
if (suggestion.action === featuredSuggestionsActionTypes.FUNCTION) {
|
|
1715
|
+
var matchedValues = suggestion.subAction.match(/function\s*\(.*\)(.|\n)*/);
|
|
1716
|
+
var functionStr = matchedValues && matchedValues[0];
|
|
1717
|
+
// eslint-disable-next-line no-new-func
|
|
1718
|
+
var func = new Function("return " + functionStr)();
|
|
1719
|
+
func(suggestion, this.$data.currentValue, this.$props.customEvents);
|
|
1720
|
+
}
|
|
1721
|
+
if (suggestion.action === featuredSuggestionsActionTypes.SELECT) {
|
|
1722
|
+
this.setValue(suggestion.value, true, this.$props, this.$options.isTagsMode.current ? causes.SUGGESTION_SELECT : causes.ENTER_PRESS);
|
|
1723
|
+
this.onValueSelectedHandler(suggestion.value, causes.SUGGESTION_SELECT);
|
|
1724
|
+
}
|
|
1725
|
+
// blur is important to close the dropdown
|
|
1726
|
+
// on selecting one of featured suggestions
|
|
1727
|
+
// else Downshift probably is focusing the dropdown
|
|
1728
|
+
// and not letting it close
|
|
1729
|
+
// eslint-disable-next-line no-unused-expressions
|
|
1730
|
+
(_this$$refs2 = this.$refs) == null ? void 0 : (_this$$refs2$this$$pr = _this$$refs2[this.$props.innerRef]) == null ? void 0 : _this$$refs2$this$$pr.blur();
|
|
1731
|
+
} catch (e) {
|
|
1732
|
+
console.error("Error: There was an error parsing the subAction for the featured suggestion with label, \"" + suggestion.label + "\"", e);
|
|
1733
|
+
}
|
|
1734
|
+
},
|
|
1270
1735
|
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
1271
|
-
var
|
|
1272
|
-
this.isOpen = false;
|
|
1736
|
+
var _this4 = this;
|
|
1737
|
+
if (!this.$props.enableAI) this.isOpen = false;else {
|
|
1738
|
+
this.showAIScreen = true;
|
|
1739
|
+
}
|
|
1273
1740
|
var value = this.$props.value;
|
|
1741
|
+
|
|
1742
|
+
// handle featured suggestions click event
|
|
1743
|
+
if (suggestion._suggestion_type === suggestionTypes.Featured) {
|
|
1744
|
+
this.handleFeaturedSuggestionClicked(suggestion);
|
|
1745
|
+
return;
|
|
1746
|
+
}
|
|
1274
1747
|
// Record analytics for selected suggestions
|
|
1275
1748
|
this.triggerClickAnalytics(suggestion._click_id);
|
|
1276
1749
|
if (value === undefined) {
|
|
@@ -1289,10 +1762,10 @@ var SearchBox = defineComponent({
|
|
|
1289
1762
|
this.setValue(emitValue, true, this.$props, causes.SUGGESTION_SELECT, false, suggestion._category);
|
|
1290
1763
|
this.$emit('change', emitValue, function (_ref4) {
|
|
1291
1764
|
var isOpen = _ref4.isOpen;
|
|
1292
|
-
return
|
|
1765
|
+
return _this4.triggerQuery(_extends({
|
|
1293
1766
|
isOpen: isOpen,
|
|
1294
1767
|
value: emitValue
|
|
1295
|
-
}, !
|
|
1768
|
+
}, !_this4.$options.isTagsMode && {
|
|
1296
1769
|
categoryValue: suggestion._category
|
|
1297
1770
|
}));
|
|
1298
1771
|
});
|
|
@@ -1326,9 +1799,26 @@ var SearchBox = defineComponent({
|
|
|
1326
1799
|
}
|
|
1327
1800
|
return null;
|
|
1328
1801
|
},
|
|
1329
|
-
renderErrorComponent: function renderErrorComponent() {
|
|
1330
|
-
var
|
|
1802
|
+
renderErrorComponent: function renderErrorComponent(isAIError) {
|
|
1803
|
+
var _this5 = this;
|
|
1804
|
+
if (isAIError === void 0) {
|
|
1805
|
+
isAIError = false;
|
|
1806
|
+
}
|
|
1331
1807
|
var renderError = this.$slots.renderError || this.$props.renderError;
|
|
1808
|
+
if (isAIError) {
|
|
1809
|
+
if (this.showAIScreen && this.AIResponseError && !this.isAIResponseLoading) {
|
|
1810
|
+
if (renderError) {
|
|
1811
|
+
return createVNode("div", {
|
|
1812
|
+
"class": "--ai-answer-error-container " + (getClassName$1(this.$props.innerClass, 'ai-error') || '')
|
|
1813
|
+
}, [renderError(this.AIResponseError)]);
|
|
1814
|
+
}
|
|
1815
|
+
return createVNode("div", {
|
|
1816
|
+
"class": "--ai-answer-error-container " + (getClassName$1(this.$props.innerClass, 'ai-error') || '')
|
|
1817
|
+
}, [createVNode("div", {
|
|
1818
|
+
"class": "--default-error-element"
|
|
1819
|
+
}, [createVNode("span", null, [typeof this.AIResponseError === 'string' ? this.AIResponseError : this.AIResponseError.message ? this.AIResponseError.message : 'There was an error in generating the response.', this.AIResponseError.code ? "Code:\n\t\t\t\t\t\t\t" + this.AIResponseError.code : ''])])]);
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1332
1822
|
if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
|
|
1333
1823
|
return createVNode(SuggestionWrapper, {
|
|
1334
1824
|
"innerClass": this.$props.innerClass,
|
|
@@ -1337,7 +1827,7 @@ var SearchBox = defineComponent({
|
|
|
1337
1827
|
"themePreset": this.themePreset
|
|
1338
1828
|
}, {
|
|
1339
1829
|
"default": function _default() {
|
|
1340
|
-
return [isFunction(renderError) ? renderError(
|
|
1830
|
+
return [isFunction(renderError) ? renderError(_this5.error) : renderError];
|
|
1341
1831
|
}
|
|
1342
1832
|
});
|
|
1343
1833
|
}
|
|
@@ -1402,14 +1892,22 @@ var SearchBox = defineComponent({
|
|
|
1402
1892
|
return null;
|
|
1403
1893
|
},
|
|
1404
1894
|
enterButtonOnClick: function enterButtonOnClick() {
|
|
1895
|
+
this.showAIScreen = false;
|
|
1405
1896
|
this.triggerQuery({
|
|
1406
1897
|
isOpen: false,
|
|
1407
1898
|
value: this.currentValue,
|
|
1408
1899
|
customQuery: true
|
|
1409
1900
|
});
|
|
1410
1901
|
},
|
|
1902
|
+
suggestionsFooter: function suggestionsFooter() {
|
|
1903
|
+
return typeof renderSuggestionsFooter === 'function' ? this.$props.renderSuggestionsFooter() : createVNode(AutosuggestFooterContainer, null, {
|
|
1904
|
+
"default": function _default() {
|
|
1905
|
+
return [createVNode("div", null, [createTextVNode("\u2191\u2193 Navigate")]), createVNode("div", null, [createTextVNode("\u21A9 Go")])];
|
|
1906
|
+
}
|
|
1907
|
+
});
|
|
1908
|
+
},
|
|
1411
1909
|
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
1412
|
-
var
|
|
1910
|
+
var _this6 = this;
|
|
1413
1911
|
var _this$$props2 = this.$props,
|
|
1414
1912
|
enterButton = _this$$props2.enterButton,
|
|
1415
1913
|
innerClass = _this$$props2.innerClass;
|
|
@@ -1417,12 +1915,12 @@ var SearchBox = defineComponent({
|
|
|
1417
1915
|
if (enterButton) {
|
|
1418
1916
|
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
1419
1917
|
if (renderEnterButton) {
|
|
1420
|
-
return renderEnterButton(
|
|
1918
|
+
return renderEnterButton(_this6.enterButtonOnClick);
|
|
1421
1919
|
}
|
|
1422
1920
|
return createVNode(Button, {
|
|
1423
1921
|
"class": "enter-btn " + getClassName$1(innerClass, 'enter-button'),
|
|
1424
1922
|
"primary": true,
|
|
1425
|
-
"onClick":
|
|
1923
|
+
"onClick": _this6.enterButtonOnClick
|
|
1426
1924
|
}, {
|
|
1427
1925
|
"default": function _default() {
|
|
1428
1926
|
return [createTextVNode("Search")];
|
|
@@ -1435,71 +1933,98 @@ var SearchBox = defineComponent({
|
|
|
1435
1933
|
}
|
|
1436
1934
|
return null;
|
|
1437
1935
|
},
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1936
|
+
renderShortcut: function renderShortcut() {
|
|
1937
|
+
if (this.$props.focusShortcuts && this.$props.focusShortcuts.length) {
|
|
1938
|
+
var shortcut = this.$props.focusShortcuts[0];
|
|
1939
|
+
shortcut = shortcut.toLowerCase();
|
|
1940
|
+
shortcut = shortcut.replace('shift', '⬆️');
|
|
1941
|
+
shortcut = shortcut.replace('command', 'cmd');
|
|
1942
|
+
shortcut = shortcut.replace('control', 'ctrl');
|
|
1943
|
+
shortcut = shortcut.replace('option', 'alt');
|
|
1944
|
+
return shortcut.toUpperCase();
|
|
1945
|
+
}
|
|
1946
|
+
return '/';
|
|
1947
|
+
},
|
|
1948
|
+
renderLeftIcons: function renderLeftIcons() {
|
|
1949
|
+
var _this7 = this;
|
|
1950
|
+
var _slot3;
|
|
1441
1951
|
var _this$$props3 = this.$props,
|
|
1442
1952
|
iconPosition = _this$$props3.iconPosition,
|
|
1443
|
-
showClear = _this$$props3.showClear,
|
|
1444
|
-
innerClass = _this$$props3.innerClass,
|
|
1445
|
-
getMicInstance = _this$$props3.getMicInstance,
|
|
1446
|
-
showVoiceSearch = _this$$props3.showVoiceSearch,
|
|
1447
1953
|
showIcon = _this$$props3.showIcon;
|
|
1954
|
+
return createVNode("div", null, [createVNode(IconGroup, {
|
|
1955
|
+
"groupPosition": "left"
|
|
1956
|
+
}, {
|
|
1957
|
+
"default": function _default() {
|
|
1958
|
+
return [iconPosition === 'left' && showIcon && createVNode(IconWrapper, {
|
|
1959
|
+
"onClick": _this7.handleSearchIconClick
|
|
1960
|
+
}, _isSlot(_slot3 = _this7.renderIcon()) ? _slot3 : {
|
|
1961
|
+
"default": function _default() {
|
|
1962
|
+
return [_slot3];
|
|
1963
|
+
}
|
|
1964
|
+
})];
|
|
1965
|
+
}
|
|
1966
|
+
})]);
|
|
1967
|
+
},
|
|
1968
|
+
renderRightIcons: function renderRightIcons() {
|
|
1969
|
+
var _this8 = this;
|
|
1970
|
+
var _slot4, _slot5, _slot6;
|
|
1971
|
+
var _this$$props4 = this.$props,
|
|
1972
|
+
iconPosition = _this$$props4.iconPosition,
|
|
1973
|
+
showClear = _this$$props4.showClear,
|
|
1974
|
+
innerClass = _this$$props4.innerClass,
|
|
1975
|
+
getMicInstance = _this$$props4.getMicInstance,
|
|
1976
|
+
showVoiceSearch = _this$$props4.showVoiceSearch,
|
|
1977
|
+
showIcon = _this$$props4.showIcon,
|
|
1978
|
+
showFocusShortcutsIcon = _this$$props4.showFocusShortcutsIcon;
|
|
1448
1979
|
var renderMic = this.$slots.renderMic || this.$props.renderMic;
|
|
1449
1980
|
var currentValue = this.$data.currentValue;
|
|
1450
1981
|
return createVNode("div", null, [createVNode(IconGroup, {
|
|
1451
|
-
"groupPosition": "right"
|
|
1452
|
-
"positionType": "absolute"
|
|
1982
|
+
"groupPosition": "right"
|
|
1453
1983
|
}, {
|
|
1454
1984
|
"default": function _default() {
|
|
1455
1985
|
return [currentValue && showClear && createVNode(IconWrapper, {
|
|
1456
|
-
"onClick":
|
|
1986
|
+
"onClick": _this8.clearValue,
|
|
1457
1987
|
"showIcon": showIcon,
|
|
1458
1988
|
"isClearIcon": true
|
|
1459
|
-
}, _isSlot(
|
|
1989
|
+
}, _isSlot(_slot4 = _this8.renderCancelIcon()) ? _slot4 : {
|
|
1460
1990
|
"default": function _default() {
|
|
1461
|
-
return [
|
|
1991
|
+
return [_slot4];
|
|
1992
|
+
}
|
|
1993
|
+
}), showFocusShortcutsIcon && createVNode(ButtonIconWrapper, {
|
|
1994
|
+
"onClick": function onClick(e) {
|
|
1995
|
+
return _this8.focusSearchBox(e);
|
|
1996
|
+
}
|
|
1997
|
+
}, _isSlot(_slot5 = _this8.renderShortcut()) ? _slot5 : {
|
|
1998
|
+
"default": function _default() {
|
|
1999
|
+
return [_slot5];
|
|
1462
2000
|
}
|
|
1463
2001
|
}), showVoiceSearch && createVNode(Mic, {
|
|
1464
2002
|
"getInstance": getMicInstance,
|
|
1465
2003
|
"render": renderMic,
|
|
1466
|
-
"handleResult":
|
|
2004
|
+
"handleResult": _this8.handleVoiceResults,
|
|
1467
2005
|
"className": getClassName$1(innerClass, 'mic') || null
|
|
1468
2006
|
}, null), iconPosition === 'right' && showIcon && createVNode(IconWrapper, {
|
|
1469
|
-
"onClick":
|
|
1470
|
-
}, _isSlot(
|
|
1471
|
-
"default": function _default() {
|
|
1472
|
-
return [_slot4];
|
|
1473
|
-
}
|
|
1474
|
-
})];
|
|
1475
|
-
}
|
|
1476
|
-
}), createVNode(IconGroup, {
|
|
1477
|
-
"groupPosition": "left",
|
|
1478
|
-
"positionType": "absolute"
|
|
1479
|
-
}, {
|
|
1480
|
-
"default": function _default() {
|
|
1481
|
-
return [iconPosition === 'left' && showIcon && createVNode(IconWrapper, {
|
|
1482
|
-
"onClick": _this6.handleSearchIconClick
|
|
1483
|
-
}, _isSlot(_slot5 = _this6.renderIcon()) ? _slot5 : {
|
|
2007
|
+
"onClick": _this8.handleSearchIconClick
|
|
2008
|
+
}, _isSlot(_slot6 = _this8.renderIcon()) ? _slot6 : {
|
|
1484
2009
|
"default": function _default() {
|
|
1485
|
-
return [
|
|
2010
|
+
return [_slot6];
|
|
1486
2011
|
}
|
|
1487
2012
|
})];
|
|
1488
2013
|
}
|
|
1489
2014
|
})]);
|
|
1490
2015
|
},
|
|
1491
2016
|
focusSearchBox: function focusSearchBox(event) {
|
|
1492
|
-
var _this$$
|
|
2017
|
+
var _this$$refs3, _this$$refs3$this$$pr, _this$$refs3$this$$pr2;
|
|
1493
2018
|
var elt = event.target || event.srcElement;
|
|
1494
2019
|
var tagName = elt.tagName;
|
|
1495
2020
|
if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
|
|
1496
2021
|
// already in an input
|
|
1497
2022
|
return;
|
|
1498
2023
|
}
|
|
1499
|
-
(_this$$
|
|
2024
|
+
(_this$$refs3 = this.$refs) == null ? void 0 : (_this$$refs3$this$$pr = _this$$refs3[this.$props.innerRef]) == null ? void 0 : (_this$$refs3$this$$pr2 = _this$$refs3$this$$pr.$el) == null ? void 0 : _this$$refs3$this$$pr2.focus(); // eslint-disable-line
|
|
1500
2025
|
},
|
|
1501
2026
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
1502
|
-
var
|
|
2027
|
+
var _this9 = this;
|
|
1503
2028
|
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
1504
2029
|
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
1505
2030
|
if (isEmpty(focusShortcuts)) {
|
|
@@ -1514,7 +2039,7 @@ var SearchBox = defineComponent({
|
|
|
1514
2039
|
function (event, handler) {
|
|
1515
2040
|
// Prevent the default refresh event under WINDOWS system
|
|
1516
2041
|
event.preventDefault();
|
|
1517
|
-
|
|
2042
|
+
_this9.focusSearchBox(event);
|
|
1518
2043
|
});
|
|
1519
2044
|
|
|
1520
2045
|
// if one of modifier keys are used, they are handled below
|
|
@@ -1524,7 +2049,7 @@ var SearchBox = defineComponent({
|
|
|
1524
2049
|
for (var index = 0; index < modifierKeys.length; index += 1) {
|
|
1525
2050
|
var element = modifierKeys[index];
|
|
1526
2051
|
if (hotkeys[element]) {
|
|
1527
|
-
|
|
2052
|
+
_this9.focusSearchBox(event);
|
|
1528
2053
|
break;
|
|
1529
2054
|
}
|
|
1530
2055
|
}
|
|
@@ -1536,19 +2061,34 @@ var SearchBox = defineComponent({
|
|
|
1536
2061
|
this.currentValue = decodeHtml(value);
|
|
1537
2062
|
this.triggerDefaultQuery(value);
|
|
1538
2063
|
},
|
|
1539
|
-
|
|
1540
|
-
var
|
|
2064
|
+
renderActionIcon: function renderActionIcon(suggestion) {
|
|
2065
|
+
var _this10 = this;
|
|
1541
2066
|
var handleAutoFillClick = function handleAutoFillClick(e) {
|
|
1542
2067
|
e.stopPropagation();
|
|
1543
|
-
|
|
2068
|
+
_this10.onAutofillClick(suggestion);
|
|
1544
2069
|
};
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
2070
|
+
if (suggestion._suggestion_type === suggestionTypes.Featured) {
|
|
2071
|
+
if (suggestion.action === featuredSuggestionsActionTypes.FUNCTION) {
|
|
2072
|
+
return createVNode(AutoFillSvg, {
|
|
2073
|
+
"style": {
|
|
2074
|
+
transform: 'rotate(135deg)',
|
|
2075
|
+
pointerEvents: 'none'
|
|
2076
|
+
}
|
|
2077
|
+
}, null);
|
|
2078
|
+
}
|
|
2079
|
+
return null;
|
|
2080
|
+
}
|
|
2081
|
+
if (!suggestion._category) {
|
|
2082
|
+
/* 👇 avoid showing autofill for category suggestions👇 */
|
|
2083
|
+
|
|
2084
|
+
return createVNode(AutoFillSvg, {
|
|
2085
|
+
"onClick": handleAutoFillClick
|
|
2086
|
+
}, null);
|
|
2087
|
+
}
|
|
2088
|
+
return null;
|
|
1549
2089
|
},
|
|
1550
2090
|
renderTag: function renderTag(item) {
|
|
1551
|
-
var
|
|
2091
|
+
var _this11 = this;
|
|
1552
2092
|
var innerClass = this.$props.innerClass;
|
|
1553
2093
|
return createVNode(TagItem, {
|
|
1554
2094
|
"class": getClassName$1(innerClass, 'selected-tag') || ''
|
|
@@ -1559,7 +2099,7 @@ var SearchBox = defineComponent({
|
|
|
1559
2099
|
"aria-label": "delete-tag",
|
|
1560
2100
|
"class": "close-icon",
|
|
1561
2101
|
"onClick": function onClick() {
|
|
1562
|
-
return
|
|
2102
|
+
return _this11.clearTag(item);
|
|
1563
2103
|
}
|
|
1564
2104
|
}, [createVNode(CancelSvg, null, null)])];
|
|
1565
2105
|
}
|
|
@@ -1582,7 +2122,7 @@ var SearchBox = defineComponent({
|
|
|
1582
2122
|
}
|
|
1583
2123
|
},
|
|
1584
2124
|
renderTags: function renderTags() {
|
|
1585
|
-
var
|
|
2125
|
+
var _this12 = this;
|
|
1586
2126
|
if (!Array.isArray(this.selectedTags)) {
|
|
1587
2127
|
return null;
|
|
1588
2128
|
}
|
|
@@ -1596,25 +2136,200 @@ var SearchBox = defineComponent({
|
|
|
1596
2136
|
}) : createVNode(TagsContainer, null, {
|
|
1597
2137
|
"default": function _default() {
|
|
1598
2138
|
return [tagsList.map(function (item) {
|
|
1599
|
-
return
|
|
2139
|
+
return _this12.renderTag(item);
|
|
1600
2140
|
}), shouldRenderClearAllTag && createVNode(TagItem, {
|
|
1601
|
-
"class": getClassName$1(
|
|
2141
|
+
"class": getClassName$1(_this12.$props.innerClass, 'selected-tag') || ''
|
|
1602
2142
|
}, {
|
|
1603
2143
|
"default": function _default() {
|
|
1604
2144
|
return [createVNode("span", null, [createTextVNode("Clear All")]), createVNode("span", {
|
|
1605
2145
|
"role": "img",
|
|
1606
2146
|
"aria-label": "delete-tag",
|
|
1607
2147
|
"class": "close-icon",
|
|
1608
|
-
"onClick":
|
|
2148
|
+
"onClick": _this12.clearAllTags
|
|
1609
2149
|
}, [createVNode(CancelSvg, null, null)])];
|
|
1610
2150
|
}
|
|
1611
2151
|
})];
|
|
1612
2152
|
}
|
|
1613
2153
|
});
|
|
2154
|
+
},
|
|
2155
|
+
getAISourceObjects: function getAISourceObjects() {
|
|
2156
|
+
var localCache = getObjectFromLocalStorage(AI_LOCAL_CACHE_KEY) && getObjectFromLocalStorage(AI_LOCAL_CACHE_KEY)[this.componentId];
|
|
2157
|
+
var sourceObjects = [];
|
|
2158
|
+
if (!this.AIResponse) return sourceObjects;
|
|
2159
|
+
var docIds = this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [];
|
|
2160
|
+
if (localCache && localCache.meta && localCache.meta.hits && localCache.meta.hits.hits) {
|
|
2161
|
+
docIds.forEach(function (id) {
|
|
2162
|
+
var foundSourceObj = localCache.meta.hits.hits.find(function (hit) {
|
|
2163
|
+
return hit._id === id;
|
|
2164
|
+
}) || {};
|
|
2165
|
+
if (foundSourceObj) {
|
|
2166
|
+
var _foundSourceObj$_sour = foundSourceObj._source,
|
|
2167
|
+
_source = _foundSourceObj$_sour === void 0 ? {} : _foundSourceObj$_sour,
|
|
2168
|
+
rest = _objectWithoutPropertiesLoose(foundSourceObj, _excluded);
|
|
2169
|
+
sourceObjects.push(_extends({}, rest, _source));
|
|
2170
|
+
}
|
|
2171
|
+
});
|
|
2172
|
+
} else {
|
|
2173
|
+
sourceObjects.push.apply(sourceObjects, docIds.map(function (id) {
|
|
2174
|
+
return {
|
|
2175
|
+
_id: id
|
|
2176
|
+
};
|
|
2177
|
+
}));
|
|
2178
|
+
}
|
|
2179
|
+
return sourceObjects;
|
|
2180
|
+
},
|
|
2181
|
+
renderAIScreenLoader: function renderAIScreenLoader() {
|
|
2182
|
+
var _this$$props$AIUIConf = this.$props.AIUIConfig,
|
|
2183
|
+
AIUIConfig = _this$$props$AIUIConf === void 0 ? {} : _this$$props$AIUIConf;
|
|
2184
|
+
var _ref5 = AIUIConfig || {},
|
|
2185
|
+
loaderMessage = _ref5.loaderMessage;
|
|
2186
|
+
if (loaderMessage) {
|
|
2187
|
+
return loaderMessage;
|
|
2188
|
+
}
|
|
2189
|
+
if (this.$slots.AILoaderMessage) {
|
|
2190
|
+
return this.$slots.AILoaderMessage();
|
|
2191
|
+
}
|
|
2192
|
+
return createVNode(HorizontalSkeletonLoader, null, null);
|
|
2193
|
+
},
|
|
2194
|
+
renderAIScreenFooter: function renderAIScreenFooter() {
|
|
2195
|
+
var _slot8;
|
|
2196
|
+
var _this13 = this;
|
|
2197
|
+
var _this$$props$AIUIConf2 = this.$props.AIUIConfig,
|
|
2198
|
+
AIUIConfig = _this$$props$AIUIConf2 === void 0 ? {} : _this$$props$AIUIConf2;
|
|
2199
|
+
var _ref6 = AIUIConfig || {},
|
|
2200
|
+
_ref6$showSourceDocum = _ref6.showSourceDocuments,
|
|
2201
|
+
showSourceDocuments = _ref6$showSourceDocum === void 0 ? true : _ref6$showSourceDocum,
|
|
2202
|
+
_ref6$onSourceClick = _ref6.onSourceClick,
|
|
2203
|
+
onSourceClick = _ref6$onSourceClick === void 0 ? function () {} : _ref6$onSourceClick;
|
|
2204
|
+
var renderSourceDocumentLabel = function renderSourceDocumentLabel(sourceObj) {
|
|
2205
|
+
if (_this13.$props.AIUIConfig && _this13.$props.AIUIConfig.renderSourceDocument) {
|
|
2206
|
+
return _this13.$props.AIUIConfig.renderSourceDocument(sourceObj);
|
|
2207
|
+
}
|
|
2208
|
+
if (_this13.$slots.renderSourceDocument) {
|
|
2209
|
+
return _this13.$slots.renderSourceDocument(sourceObj);
|
|
2210
|
+
}
|
|
2211
|
+
return sourceObj._id;
|
|
2212
|
+
};
|
|
2213
|
+
return showSourceDocuments && this.showAIScreenFooter && this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds ? createVNode(Footer, {
|
|
2214
|
+
"themePreset": this.$props.themePreset
|
|
2215
|
+
}, {
|
|
2216
|
+
"default": function _default() {
|
|
2217
|
+
return [createTextVNode("Summary generated using the following sources:"), ' ', createVNode(SourceTags, null, _isSlot(_slot8 = _this13.getAISourceObjects().map(function (el) {
|
|
2218
|
+
var _slot7;
|
|
2219
|
+
return createVNode(Button, {
|
|
2220
|
+
"class": "--ai-source-tag " + (getClassName$1(_this13.$props.innerClass, 'ai-source-tag') || ''),
|
|
2221
|
+
"info": true,
|
|
2222
|
+
"onClick": function onClick() {
|
|
2223
|
+
return onSourceClick && onSourceClick(el);
|
|
2224
|
+
}
|
|
2225
|
+
}, _isSlot(_slot7 = renderSourceDocumentLabel(el)) ? _slot7 : {
|
|
2226
|
+
"default": function _default() {
|
|
2227
|
+
return [_slot7];
|
|
2228
|
+
}
|
|
2229
|
+
});
|
|
2230
|
+
})) ? _slot8 : {
|
|
2231
|
+
"default": function _default() {
|
|
2232
|
+
return [_slot8];
|
|
2233
|
+
}
|
|
2234
|
+
})];
|
|
2235
|
+
}
|
|
2236
|
+
}) : null;
|
|
2237
|
+
},
|
|
2238
|
+
renderAIScreen: function renderAIScreen() {
|
|
2239
|
+
var _this14 = this;
|
|
2240
|
+
var customAIRenderer = this.$props.renderAIAnswer || this.$slots.renderAIAnswer;
|
|
2241
|
+
if (customAIRenderer) {
|
|
2242
|
+
return customAIRenderer({
|
|
2243
|
+
question: this.AIResponse && this.AIResponse.response && this.AIResponse.response.question,
|
|
2244
|
+
answer: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text,
|
|
2245
|
+
documentIds: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [],
|
|
2246
|
+
loading: this.isAIResponseLoading || this.isLoading,
|
|
2247
|
+
sources: this.getAISourceObjects(),
|
|
2248
|
+
error: this.AIResponseError
|
|
2249
|
+
});
|
|
2250
|
+
}
|
|
2251
|
+
if (this.isAIResponseLoading || this.isLoading) {
|
|
2252
|
+
return this.renderAIScreenLoader();
|
|
2253
|
+
}
|
|
2254
|
+
return createVNode("div", null, [createVNode(Answer, {
|
|
2255
|
+
"innerHTML": md.render(this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text)
|
|
2256
|
+
}, null), this.renderAIScreenFooter(), this.showFeedbackComponent && createVNode("div", {
|
|
2257
|
+
"class": "" + (getClassName$1(this.$props.innerClass, 'ai-feedback') || '')
|
|
2258
|
+
}, [createVNode(AIFeedback, {
|
|
2259
|
+
"overrideState": this.feedbackState,
|
|
2260
|
+
"hideUI": this.isAIResponseLoading || this.isLoading || !this.sessionIdFromStore,
|
|
2261
|
+
"key": this.sessionIdFromStore,
|
|
2262
|
+
"onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
|
|
2263
|
+
_this14.feedbackState = {
|
|
2264
|
+
isRecorded: true,
|
|
2265
|
+
feedbackType: useful ? 'positive' : 'negative'
|
|
2266
|
+
};
|
|
2267
|
+
_this14.recordAISessionUsefulness(_this14.sessionIdFromStore, {
|
|
2268
|
+
useful: useful,
|
|
2269
|
+
reason: reason
|
|
2270
|
+
});
|
|
2271
|
+
}
|
|
2272
|
+
}, null)])]);
|
|
2273
|
+
},
|
|
2274
|
+
handleTextAreaHeightChange: function handleTextAreaHeightChange() {
|
|
2275
|
+
var _this$$refs$this$$pro, _this$$refs$_inputGro;
|
|
2276
|
+
var textArea = (_this$$refs$this$$pro = this.$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs$this$$pro.$el;
|
|
2277
|
+
var inputGroupEle = (_this$$refs$_inputGro = this.$refs[_inputGroupRef]) == null ? void 0 : _this$$refs$_inputGro.$el;
|
|
2278
|
+
if (textArea) {
|
|
2279
|
+
textArea.style.height = '42px';
|
|
2280
|
+
var lineHeight = parseInt(getComputedStyle(textArea).lineHeight, 10);
|
|
2281
|
+
var maxHeight = lineHeight * 4; // max height for 3 lines
|
|
2282
|
+
var height = Math.min(textArea.scrollHeight, maxHeight);
|
|
2283
|
+
textArea.style.height = height + "px";
|
|
2284
|
+
textArea.style.overflowY = height === maxHeight ? 'auto' : 'hidden';
|
|
2285
|
+
var dropdownEle = this.$refs[_dropdownULRef];
|
|
2286
|
+
if (dropdownEle) {
|
|
2287
|
+
dropdownEle.style.top = "" + textArea.style.height;
|
|
2288
|
+
}
|
|
2289
|
+
if (inputGroupEle) {
|
|
2290
|
+
inputGroupEle.style.height = "" + textArea.style.height;
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
},
|
|
2294
|
+
askButtonOnClick: function askButtonOnClick() {
|
|
2295
|
+
this.showAIScreen = true;
|
|
2296
|
+
this.isOpen = true;
|
|
2297
|
+
this.triggerDefaultQuery(this.currentValue, {
|
|
2298
|
+
enableAI: true
|
|
2299
|
+
});
|
|
2300
|
+
},
|
|
2301
|
+
renderAskButtonElement: function renderAskButtonElement() {
|
|
2302
|
+
var _this15 = this;
|
|
2303
|
+
var _this$$props5 = this.$props,
|
|
2304
|
+
AIUIConfig = _this$$props5.AIUIConfig,
|
|
2305
|
+
innerClass = _this$$props5.innerClass;
|
|
2306
|
+
var _ref7 = AIUIConfig || {},
|
|
2307
|
+
askButton = _ref7.askButton;
|
|
2308
|
+
var renderAskButton = this.$slots.renderAskButton;
|
|
2309
|
+
if (askButton) {
|
|
2310
|
+
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
2311
|
+
if (renderAskButton) {
|
|
2312
|
+
return renderAskButton(_this15.askButtonOnClick);
|
|
2313
|
+
}
|
|
2314
|
+
return createVNode(Button, {
|
|
2315
|
+
"class": "enter-btn " + getClassName$1(innerClass, 'ask-button'),
|
|
2316
|
+
"info": true,
|
|
2317
|
+
"onClick": _this15.askButtonOnClick
|
|
2318
|
+
}, {
|
|
2319
|
+
"default": function _default() {
|
|
2320
|
+
return [createTextVNode("Ask")];
|
|
2321
|
+
}
|
|
2322
|
+
});
|
|
2323
|
+
};
|
|
2324
|
+
return createVNode("div", {
|
|
2325
|
+
"class": "enter-button-wrapper"
|
|
2326
|
+
}, [getEnterButtonMarkup()]);
|
|
2327
|
+
}
|
|
2328
|
+
return null;
|
|
1614
2329
|
}
|
|
1615
2330
|
},
|
|
1616
2331
|
render: function render() {
|
|
1617
|
-
var
|
|
2332
|
+
var _this16 = this;
|
|
1618
2333
|
var expandSuggestionsContainer = this.$props.expandSuggestionsContainer;
|
|
1619
2334
|
var _this$$slots = this.$slots,
|
|
1620
2335
|
recentSearchesIcon = _this$$slots.recentSearchesIcon,
|
|
@@ -1625,164 +2340,247 @@ var SearchBox = defineComponent({
|
|
|
1625
2340
|
"class": this.$props.className
|
|
1626
2341
|
}, {
|
|
1627
2342
|
"default": function _default() {
|
|
1628
|
-
return [
|
|
1629
|
-
"class": getClassName$1(
|
|
2343
|
+
return [_this16.$props.title && createVNode(Title, {
|
|
2344
|
+
"class": getClassName$1(_this16.$props.innerClass, 'title') || ''
|
|
1630
2345
|
}, {
|
|
1631
2346
|
"default": function _default() {
|
|
1632
|
-
return [
|
|
2347
|
+
return [_this16.$props.title];
|
|
1633
2348
|
}
|
|
1634
|
-
}),
|
|
1635
|
-
"id":
|
|
1636
|
-
"handleChange":
|
|
1637
|
-
"handleMouseup":
|
|
1638
|
-
"isOpen":
|
|
2349
|
+
}), _this16.$props.autosuggest ? createVNode(Downshift, {
|
|
2350
|
+
"id": _this16.$props.componentId + "-downshift",
|
|
2351
|
+
"handleChange": _this16.onSuggestionSelected,
|
|
2352
|
+
"handleMouseup": _this16.handleStateChange,
|
|
2353
|
+
"isOpen": _this16.$data.isOpen
|
|
1639
2354
|
}, {
|
|
1640
|
-
"default": function _default(
|
|
1641
|
-
var getInputEvents =
|
|
1642
|
-
getInputProps =
|
|
1643
|
-
getItemProps =
|
|
1644
|
-
getItemEvents =
|
|
1645
|
-
isOpen =
|
|
1646
|
-
highlightedIndex =
|
|
1647
|
-
setHighlightedIndex =
|
|
2355
|
+
"default": function _default(_ref8) {
|
|
2356
|
+
var getInputEvents = _ref8.getInputEvents,
|
|
2357
|
+
getInputProps = _ref8.getInputProps,
|
|
2358
|
+
getItemProps = _ref8.getItemProps,
|
|
2359
|
+
getItemEvents = _ref8.getItemEvents,
|
|
2360
|
+
isOpen = _ref8.isOpen,
|
|
2361
|
+
highlightedIndex = _ref8.highlightedIndex,
|
|
2362
|
+
setHighlightedIndex = _ref8.setHighlightedIndex;
|
|
1648
2363
|
var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
|
|
1649
|
-
var getIcon = function getIcon(iconType) {
|
|
2364
|
+
var getIcon = function getIcon(iconType, item, leaveSpaceForIcon) {
|
|
1650
2365
|
switch (iconType) {
|
|
1651
2366
|
case suggestionTypes.Recent:
|
|
1652
2367
|
return recentSearchesIcon;
|
|
1653
2368
|
case suggestionTypes.Popular:
|
|
1654
2369
|
return popularSearchesIcon;
|
|
2370
|
+
case suggestionTypes.Featured:
|
|
2371
|
+
if (item.icon) {
|
|
2372
|
+
return function () {
|
|
2373
|
+
return createVNode("div", {
|
|
2374
|
+
"style": {
|
|
2375
|
+
display: 'flex'
|
|
2376
|
+
},
|
|
2377
|
+
"innerHTML": xss(item.icon)
|
|
2378
|
+
}, null);
|
|
2379
|
+
};
|
|
2380
|
+
}
|
|
2381
|
+
if (item.iconURL) {
|
|
2382
|
+
return function () {
|
|
2383
|
+
return (// When you change below also change the empty icon below
|
|
2384
|
+
createVNode("img", {
|
|
2385
|
+
"style": {
|
|
2386
|
+
maxHeight: '25px'
|
|
2387
|
+
},
|
|
2388
|
+
"src": xss(item.iconURL),
|
|
2389
|
+
"alt": item.value
|
|
2390
|
+
}, null)
|
|
2391
|
+
);
|
|
2392
|
+
};
|
|
2393
|
+
}
|
|
2394
|
+
// Render an empty icon when no icon is provided from the dashboard
|
|
2395
|
+
return function () {
|
|
2396
|
+
return createVNode("span", {
|
|
2397
|
+
"style": {
|
|
2398
|
+
display: 'inline-block',
|
|
2399
|
+
height: '25px',
|
|
2400
|
+
width: leaveSpaceForIcon ? '25px' : 0
|
|
2401
|
+
}
|
|
2402
|
+
}, null);
|
|
2403
|
+
};
|
|
1655
2404
|
default:
|
|
1656
2405
|
return null;
|
|
1657
2406
|
}
|
|
1658
2407
|
};
|
|
1659
|
-
|
|
2408
|
+
var indexOffset = 0;
|
|
2409
|
+
return createVNode("div", null, [_this16.hasCustomRenderer && _this16.getComponent({
|
|
1660
2410
|
isOpen: isOpen,
|
|
1661
2411
|
getItemProps: getItemProps,
|
|
1662
2412
|
getItemEvents: getItemEvents,
|
|
1663
2413
|
highlightedIndex: highlightedIndex
|
|
1664
|
-
}),
|
|
1665
|
-
"class": suggestions(
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
"
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
2414
|
+
}), _this16.renderErrorComponent(), !_this16.hasCustomRenderer && isOpen && hasSuggestions ? createVNode("ul", {
|
|
2415
|
+
"class": suggestions(_this16.themePreset, _this16.theme) + " " + getClassName$1(_this16.$props.innerClass, 'list') + " " + searchboxSuggestions(_this16.themePreset, _this16.theme) + "\n\t\t\t\t\t\t\t\t\t\t\t\t\t",
|
|
2416
|
+
"ref": _dropdownULRef
|
|
2417
|
+
}, [_this16.showAIScreen && createVNode(SearchBoxAISection, {
|
|
2418
|
+
"themePreset": _this16.$props.themePreset
|
|
2419
|
+
}, {
|
|
2420
|
+
"default": function _default() {
|
|
2421
|
+
return [_this16.renderAIScreen(), ' ', _this16.renderErrorComponent(true)];
|
|
2422
|
+
}
|
|
2423
|
+
}), !_this16.showAIScreen && _this16.parsedSuggestions.map(function (item, itemIndex) {
|
|
2424
|
+
var index = indexOffset + itemIndex;
|
|
2425
|
+
if (Array.isArray(item)) {
|
|
2426
|
+
var sectionHtml = xss(item[0].sectionLabel);
|
|
2427
|
+
indexOffset += item.length - 1;
|
|
2428
|
+
return createVNode("div", {
|
|
2429
|
+
"class": "section-container"
|
|
2430
|
+
}, [sectionHtml ? createVNode("div", {
|
|
2431
|
+
"class": "section-header " + getClassName$1(_this16.$props.innerClass, 'section-label'),
|
|
2432
|
+
"key": "" + item[0].sectionId,
|
|
2433
|
+
"innerHTML": sectionHtml
|
|
2434
|
+
}, null) : null, createVNode("ul", {
|
|
2435
|
+
"class": "section-list"
|
|
2436
|
+
}, [item.map(function (sectionItem, sectionIndex) {
|
|
2437
|
+
var suggestionsHaveIcon = item.some(function (s) {
|
|
2438
|
+
return s.icon || s.iconURL;
|
|
2439
|
+
});
|
|
2440
|
+
return renderItem ? createVNode("li", mergeProps(getItemProps({
|
|
2441
|
+
item: sectionItem
|
|
2442
|
+
}), _transformOn(getItemEvents({
|
|
2443
|
+
item: sectionItem
|
|
2444
|
+
})), {
|
|
2445
|
+
"key": index + sectionIndex,
|
|
2446
|
+
"style": {
|
|
2447
|
+
justifyContent: 'flex-start',
|
|
2448
|
+
alignItems: 'center'
|
|
2449
|
+
},
|
|
2450
|
+
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this16.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this16.$props.innerClass, 'suggestion-item'))
|
|
2451
|
+
}), [renderItem(sectionItem)]) : createVNode("li", mergeProps(getItemProps({
|
|
2452
|
+
item: sectionItem
|
|
2453
|
+
}), _transformOn(getItemEvents({
|
|
2454
|
+
item: sectionItem
|
|
2455
|
+
})), {
|
|
2456
|
+
"key": index + sectionIndex,
|
|
2457
|
+
"style": {
|
|
2458
|
+
justifyContent: 'flex-start',
|
|
2459
|
+
alignItems: 'center'
|
|
2460
|
+
},
|
|
2461
|
+
"class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this16.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this16.$props.innerClass, 'suggestion-item'))
|
|
2462
|
+
}), [createVNode("div", {
|
|
2463
|
+
"style": {
|
|
2464
|
+
padding: '0 10px 0 0',
|
|
2465
|
+
display: 'flex'
|
|
2466
|
+
}
|
|
2467
|
+
}, [createVNode(CustomSvg, {
|
|
2468
|
+
"className": getClassName$1(_this16.$props.innerClass, sectionItem._suggestion_type + "-search-icon") || null,
|
|
2469
|
+
"icon": getIcon(sectionItem._suggestion_type, sectionItem, suggestionsHaveIcon),
|
|
2470
|
+
"type": sectionItem._suggestion_type + "-search-icon"
|
|
2471
|
+
}, null)]), createVNode(SuggestionItem, {
|
|
2472
|
+
"currentValue": _this16.currentValue,
|
|
2473
|
+
"suggestion": sectionItem
|
|
2474
|
+
}, null), _this16.renderActionIcon(sectionItem)]);
|
|
2475
|
+
})])]);
|
|
2476
|
+
}
|
|
2477
|
+
return createVNode("div", null, [createTextVNode("No suggestions")]);
|
|
2478
|
+
}), !_this16.showAIScreen && _this16.parsedSuggestions.length && _this16.$props.showSuggestionsFooter ? _this16.suggestionsFooter() : null]) : _this16.renderNoSuggestions(_this16.normalizedSuggestions)]);
|
|
2479
|
+
};
|
|
2480
|
+
return createVNode("div", {
|
|
2481
|
+
"class": suggestionsContainer
|
|
2482
|
+
}, [createVNode(InputGroup, {
|
|
2483
|
+
"searchBox": true,
|
|
2484
|
+
"ref": _inputGroupRef,
|
|
2485
|
+
"isOpen": _this16.$data.isOpen
|
|
2486
|
+
}, {
|
|
1707
2487
|
"default": function _default() {
|
|
1708
|
-
return [
|
|
2488
|
+
return [createVNode(Actions$1, null, {
|
|
2489
|
+
"default": function _default() {
|
|
2490
|
+
return [_this16.renderInputAddonBefore(), _this16.renderLeftIcons()];
|
|
2491
|
+
}
|
|
2492
|
+
}), createVNode(InputWrapper, null, {
|
|
1709
2493
|
"default": function _default() {
|
|
1710
|
-
return [createVNode(
|
|
1711
|
-
onInput:
|
|
2494
|
+
return [createVNode(TextArea, mergeProps(_transformOn(getInputEvents({
|
|
2495
|
+
onInput: _this16.onInputChange,
|
|
1712
2496
|
onBlur: function onBlur(e) {
|
|
1713
|
-
|
|
2497
|
+
_this16.$emit('blur', e, _this16.triggerQuery);
|
|
1714
2498
|
},
|
|
1715
|
-
onFocus:
|
|
2499
|
+
onFocus: _this16.handleFocus,
|
|
1716
2500
|
onKeyPress: function onKeyPress(e) {
|
|
1717
|
-
|
|
1718
|
-
|
|
2501
|
+
_this16.$emit('keyPress', e, _this16.triggerQuery);
|
|
2502
|
+
_this16.$emit('key-press', e, _this16.triggerQuery);
|
|
1719
2503
|
},
|
|
1720
2504
|
onKeyDown: function onKeyDown(e) {
|
|
1721
|
-
return
|
|
2505
|
+
return _this16.handleKeyDown(e, highlightedIndex);
|
|
1722
2506
|
},
|
|
1723
2507
|
onKeyUp: function onKeyUp(e) {
|
|
1724
|
-
|
|
1725
|
-
|
|
2508
|
+
_this16.$emit('keyUp', e, _this16.triggerQuery);
|
|
2509
|
+
_this16.$emit('key-up', e, _this16.triggerQuery);
|
|
1726
2510
|
},
|
|
1727
2511
|
onClick: function onClick() {
|
|
1728
2512
|
setHighlightedIndex(null);
|
|
1729
2513
|
}
|
|
1730
2514
|
})), {
|
|
1731
|
-
"
|
|
1732
|
-
"
|
|
1733
|
-
"
|
|
1734
|
-
"
|
|
1735
|
-
"
|
|
1736
|
-
"
|
|
1737
|
-
"
|
|
1738
|
-
"autoFocus": _this11.$props.autoFocus
|
|
2515
|
+
"isOpen": _this16.$data.isOpen,
|
|
2516
|
+
"id": _this16.$props.componentId + "-input",
|
|
2517
|
+
"ref": _this16.$props.innerRef,
|
|
2518
|
+
"class": getClassName$1(_this16.$props.innerClass, 'input'),
|
|
2519
|
+
"placeholder": _this16.$props.placeholder,
|
|
2520
|
+
"autoFocus": _this16.$props.autoFocus,
|
|
2521
|
+
"searchBox": true
|
|
1739
2522
|
}, getInputProps({
|
|
1740
|
-
value:
|
|
2523
|
+
value: _this16.$data.currentValue === null ? '' : _this16.$data.currentValue
|
|
1741
2524
|
}), {
|
|
1742
|
-
"themePreset":
|
|
2525
|
+
"themePreset": _this16.themePreset,
|
|
1743
2526
|
"autocomplete": "off"
|
|
1744
|
-
}), null),
|
|
2527
|
+
}), null), !expandSuggestionsContainer && renderSuggestionsDropdown()];
|
|
2528
|
+
}
|
|
2529
|
+
}), createVNode(Actions$1, null, {
|
|
2530
|
+
"default": function _default() {
|
|
2531
|
+
return [_this16.renderRightIcons(), _this16.renderInputAddonAfter(), _this16.renderAskButtonElement(), _this16.renderEnterButtonElement()];
|
|
1745
2532
|
}
|
|
1746
|
-
})
|
|
2533
|
+
})];
|
|
1747
2534
|
}
|
|
1748
|
-
}), expandSuggestionsContainer && renderSuggestionsDropdown(),
|
|
2535
|
+
}), expandSuggestionsContainer && renderSuggestionsDropdown(), _this16.renderTags()]);
|
|
1749
2536
|
}
|
|
1750
2537
|
}) : createVNode("div", {
|
|
1751
2538
|
"class": suggestionsContainer
|
|
1752
|
-
}, [createVNode(InputGroup,
|
|
2539
|
+
}, [createVNode(InputGroup, {
|
|
2540
|
+
"searchBox": true,
|
|
2541
|
+
"ref": _inputGroupRef
|
|
2542
|
+
}, {
|
|
1753
2543
|
"default": function _default() {
|
|
1754
|
-
return [
|
|
2544
|
+
return [createVNode(Actions$1, null, {
|
|
1755
2545
|
"default": function _default() {
|
|
1756
|
-
return [
|
|
2546
|
+
return [_this16.renderInputAddonBefore(), _this16.renderLeftIcons()];
|
|
2547
|
+
}
|
|
2548
|
+
}), createVNode(InputWrapper, null, {
|
|
2549
|
+
"default": function _default() {
|
|
2550
|
+
return [createVNode(TextArea, mergeProps(_transformOn({
|
|
1757
2551
|
blur: function blur(e) {
|
|
1758
|
-
|
|
2552
|
+
_this16.$emit('blur', e, _this16.triggerQuery);
|
|
1759
2553
|
},
|
|
1760
2554
|
keypress: function keypress(e) {
|
|
1761
|
-
|
|
1762
|
-
|
|
2555
|
+
_this16.$emit('keyPress', e, _this16.triggerQuery);
|
|
2556
|
+
_this16.$emit('key-press', e, _this16.triggerQuery);
|
|
1763
2557
|
},
|
|
1764
|
-
input:
|
|
2558
|
+
input: _this16.onInputChange,
|
|
1765
2559
|
focus: function focus(e) {
|
|
1766
|
-
|
|
2560
|
+
_this16.$emit('focus', e, _this16.triggerQuery);
|
|
1767
2561
|
},
|
|
1768
|
-
keydown:
|
|
2562
|
+
keydown: _this16.handleKeyDown,
|
|
1769
2563
|
keyup: function keyup(e) {
|
|
1770
|
-
|
|
1771
|
-
|
|
2564
|
+
_this16.$emit('keyUp', e, _this16.triggerQuery);
|
|
2565
|
+
_this16.$emit('key-up', e, _this16.triggerQuery);
|
|
1772
2566
|
}
|
|
1773
2567
|
}), {
|
|
1774
|
-
"class": getClassName$1(
|
|
1775
|
-
"placeholder":
|
|
1776
|
-
"autofocus":
|
|
1777
|
-
"value":
|
|
1778
|
-
"iconPosition":
|
|
1779
|
-
"showIcon":
|
|
1780
|
-
"showClear":
|
|
1781
|
-
"ref":
|
|
1782
|
-
"themePreset":
|
|
1783
|
-
}), null)
|
|
2568
|
+
"class": getClassName$1(_this16.$props.innerClass, 'input') || '',
|
|
2569
|
+
"placeholder": _this16.$props.placeholder,
|
|
2570
|
+
"autofocus": _this16.$props.autoFocus,
|
|
2571
|
+
"value": _this16.$data.currentValue ? _this16.$data.currentValue : '',
|
|
2572
|
+
"iconPosition": _this16.$props.iconPosition,
|
|
2573
|
+
"showIcon": _this16.$props.showIcon,
|
|
2574
|
+
"showClear": _this16.$props.showClear,
|
|
2575
|
+
"ref": _this16.$props.innerRef,
|
|
2576
|
+
"themePreset": _this16.themePreset
|
|
2577
|
+
}), null)];
|
|
1784
2578
|
}
|
|
1785
|
-
}),
|
|
2579
|
+
}), createVNode(Actions$1, null, {
|
|
2580
|
+
"default": function _default() {
|
|
2581
|
+
return [_this16.renderRightIcons(), _this16.renderInputAddonAfter(), _this16.renderEnterButtonElement()];
|
|
2582
|
+
}
|
|
2583
|
+
})];
|
|
1786
2584
|
}
|
|
1787
2585
|
})])];
|
|
1788
2586
|
}
|
|
@@ -1835,18 +2633,24 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
1835
2633
|
rawData: state.rawData[props.componentId],
|
|
1836
2634
|
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
1837
2635
|
themePreset: state.config.themePreset,
|
|
1838
|
-
isLoading: !!state.isLoading[props.componentId
|
|
2636
|
+
isLoading: !!state.isLoading["" + props.componentId],
|
|
1839
2637
|
error: state.error[props.componentId],
|
|
1840
2638
|
time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
|
|
1841
2639
|
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
1842
|
-
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden
|
|
2640
|
+
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
|
|
2641
|
+
AIResponse: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response || null,
|
|
2642
|
+
isAIResponseLoading: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].isLoading,
|
|
2643
|
+
AIResponseError: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].error,
|
|
2644
|
+
sessionIdFromStore: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.sessionId || '',
|
|
2645
|
+
isAITyping: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.isTyping || false
|
|
1843
2646
|
};
|
|
1844
2647
|
};
|
|
1845
2648
|
var mapDispatchToProps = {
|
|
1846
2649
|
updateQuery: updateQuery,
|
|
1847
2650
|
setCustomQuery: setCustomQuery,
|
|
1848
2651
|
setDefaultQuery: setDefaultQuery,
|
|
1849
|
-
recordSuggestionClick: recordSuggestionClick
|
|
2652
|
+
recordSuggestionClick: recordSuggestionClick,
|
|
2653
|
+
recordAISessionUsefulness: recordAISessionUsefulness
|
|
1850
2654
|
};
|
|
1851
2655
|
var SBConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps, mapDispatchToProps)(SearchBox), {
|
|
1852
2656
|
componentType: componentTypes.searchBox,
|
|
@@ -1862,9 +2666,608 @@ SBConnected.install = function (Vue) {
|
|
|
1862
2666
|
// Add componentType for SSR
|
|
1863
2667
|
SBConnected.componentType = componentTypes.searchBox;
|
|
1864
2668
|
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
2669
|
+
function _isSlot$1(s) {
|
|
2670
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
2671
|
+
}
|
|
2672
|
+
var md$1 = new Remarkable();
|
|
2673
|
+
md$1.set({
|
|
2674
|
+
html: true,
|
|
2675
|
+
breaks: true,
|
|
2676
|
+
xhtmlOut: true
|
|
2677
|
+
});
|
|
2678
|
+
var _inputWrapperRef = 'inputWrapperRef';
|
|
2679
|
+
var _inputRef = 'inputRef';
|
|
2680
|
+
var _errorContainerRef = 'errorContainerRef';
|
|
2681
|
+
var AIAnswer = defineComponent({
|
|
2682
|
+
name: 'AIAnswer',
|
|
2683
|
+
data: function data() {
|
|
2684
|
+
var props = this.$props;
|
|
2685
|
+
this.__state = {
|
|
2686
|
+
messages: [],
|
|
2687
|
+
inputMessage: '',
|
|
2688
|
+
AISessionId: '',
|
|
2689
|
+
error: null
|
|
2690
|
+
};
|
|
2691
|
+
this.internalComponent = props.componentId + "__internal";
|
|
2692
|
+
return this.__state;
|
|
2693
|
+
},
|
|
2694
|
+
inject: {
|
|
2695
|
+
theme: {
|
|
2696
|
+
from: 'theme_reactivesearch'
|
|
2697
|
+
}
|
|
2698
|
+
},
|
|
2699
|
+
created: function created() {},
|
|
2700
|
+
computed: {
|
|
2701
|
+
hasCustomRenderer: function hasCustomRenderer$1() {
|
|
2702
|
+
return hasCustomRenderer(this);
|
|
2703
|
+
},
|
|
2704
|
+
isLoadingState: function isLoadingState() {
|
|
2705
|
+
return this.isAIResponseLoading || this.isLoading;
|
|
2706
|
+
},
|
|
2707
|
+
shouldShowComponent: function shouldShowComponent() {
|
|
2708
|
+
return this.showComponent;
|
|
2709
|
+
},
|
|
2710
|
+
errorMessageForMissingSessionId: function errorMessageForMissingSessionId() {
|
|
2711
|
+
return "AISessionId for " + this.$props.componentId + " is missing! AIAnswer component requires an AISessionId to function. Try reloading the App.";
|
|
2712
|
+
}
|
|
2713
|
+
},
|
|
2714
|
+
props: {
|
|
2715
|
+
componentId: types.string.isRequired,
|
|
2716
|
+
showVoiceInput: VueTypes.bool.def(false),
|
|
2717
|
+
showFeedback: VueTypes.bool.def(true),
|
|
2718
|
+
showIcon: VueTypes.bool.def(true),
|
|
2719
|
+
onData: types.func,
|
|
2720
|
+
innerRef: VueTypes.string.def('AISearchInputField'),
|
|
2721
|
+
react: types.react,
|
|
2722
|
+
enableAI: VueTypes.bool.def(true),
|
|
2723
|
+
AIConfig: types.AIConfig,
|
|
2724
|
+
iconPosition: types.iconPosition.def('left'),
|
|
2725
|
+
themePreset: types.themePreset,
|
|
2726
|
+
theme: types.style,
|
|
2727
|
+
icon: types.children,
|
|
2728
|
+
iconURL: VueTypes.string.def(''),
|
|
2729
|
+
renderMic: types.func,
|
|
2730
|
+
getMicInstance: types.func,
|
|
2731
|
+
innerClass: types.style,
|
|
2732
|
+
placeholder: VueTypes.string.def('Ask a question'),
|
|
2733
|
+
title: types.title,
|
|
2734
|
+
AIResponse: types.componentObject,
|
|
2735
|
+
isAIResponseLoading: VueTypes.bool.def(false),
|
|
2736
|
+
AIResponseError: types.componentObject,
|
|
2737
|
+
getAIResponse: types.func.isRequired,
|
|
2738
|
+
enterButton: types.bool,
|
|
2739
|
+
renderEnterButton: types.title,
|
|
2740
|
+
showInput: VueTypes.bool.def(true),
|
|
2741
|
+
clearSessionOnDestroy: VueTypes.bool.def(true),
|
|
2742
|
+
rawData: types.rawData,
|
|
2743
|
+
render: types.func,
|
|
2744
|
+
onError: types.func,
|
|
2745
|
+
renderError: types.title,
|
|
2746
|
+
isLoading: types.boolRequired,
|
|
2747
|
+
sessionIdFromStore: VueTypes.string,
|
|
2748
|
+
showComponent: types.boolRequired,
|
|
2749
|
+
componentError: types.componentObject,
|
|
2750
|
+
style: types.style
|
|
2751
|
+
},
|
|
2752
|
+
mounted: function mounted() {},
|
|
2753
|
+
watch: {
|
|
2754
|
+
AIResponse: function AIResponse(newVal) {
|
|
2755
|
+
if (newVal) {
|
|
2756
|
+
this.AISessionId = ((getObjectFromLocalStorage(AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).sessionId || null;
|
|
2757
|
+
var messagesHistory = newVal.messages,
|
|
2758
|
+
response = newVal.response;
|
|
2759
|
+
var finalMessages = [];
|
|
2760
|
+
if (response && response.error) {
|
|
2761
|
+
this.error = {
|
|
2762
|
+
message: response.error
|
|
2763
|
+
};
|
|
2764
|
+
}
|
|
2765
|
+
|
|
2766
|
+
// pushing message history so far
|
|
2767
|
+
if (messagesHistory && messagesHistory && Array.isArray(messagesHistory)) {
|
|
2768
|
+
finalMessages.push.apply(finalMessages, messagesHistory.filter(function (msg) {
|
|
2769
|
+
return msg.role !== AI_ROLES.SYSTEM;
|
|
2770
|
+
}));
|
|
2771
|
+
} else if (response && response.answer && response.answer.text) {
|
|
2772
|
+
finalMessages.push({
|
|
2773
|
+
role: AI_ROLES.ASSISTANT,
|
|
2774
|
+
content: response.answer.text
|
|
2775
|
+
});
|
|
2776
|
+
if (!this.AISessionId) this.error = {
|
|
2777
|
+
message: this.errorMessageForMissingSessionId
|
|
2778
|
+
};
|
|
2779
|
+
}
|
|
2780
|
+
this.messages = finalMessages;
|
|
2781
|
+
} else if (!newVal && !this.error) {
|
|
2782
|
+
this.messages = [];
|
|
2783
|
+
}
|
|
2784
|
+
},
|
|
2785
|
+
rawData: function rawData(newVal) {
|
|
2786
|
+
this.$emit('on-data', {
|
|
2787
|
+
data: this.messages,
|
|
2788
|
+
rawData: newVal,
|
|
2789
|
+
loading: this.$props.isAIResponseLoading || this.$props.isLoading,
|
|
2790
|
+
error: this.$props.AIResponseError
|
|
2791
|
+
});
|
|
2792
|
+
},
|
|
2793
|
+
isAIResponseLoading: function isAIResponseLoading(newVal) {
|
|
2794
|
+
this.$emit('on-data', {
|
|
2795
|
+
data: this.messages,
|
|
2796
|
+
rawData: this.$props.rawData,
|
|
2797
|
+
loading: newVal || this.isLoading,
|
|
2798
|
+
error: this.$props.AIResponseError
|
|
2799
|
+
});
|
|
2800
|
+
},
|
|
2801
|
+
isLoading: function isLoading(newVal) {
|
|
2802
|
+
this.$emit('on-data', {
|
|
2803
|
+
data: this.messages,
|
|
2804
|
+
rawData: this.$props.rawData,
|
|
2805
|
+
loading: newVal || this.isAIResponseLoading,
|
|
2806
|
+
error: this.$props.AIResponseError
|
|
2807
|
+
});
|
|
2808
|
+
},
|
|
2809
|
+
sessionIdFromStore: function sessionIdFromStore(newVal) {
|
|
2810
|
+
if (newVal) {
|
|
2811
|
+
this.sessionId = newVal;
|
|
2812
|
+
}
|
|
2813
|
+
},
|
|
2814
|
+
AIResponseError: function AIResponseError(newVal) {
|
|
2815
|
+
this.error = newVal;
|
|
2816
|
+
this.AISessionId = ((getObjectFromLocalStorage(AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).sessionId || null;
|
|
2817
|
+
if (this.error && !this.AISessionId) {
|
|
2818
|
+
var errorMessage = this.errorMessageForMissingSessionId;
|
|
2819
|
+
this.error = {
|
|
2820
|
+
message: errorMessage
|
|
2821
|
+
};
|
|
2822
|
+
console.error(errorMessage);
|
|
2823
|
+
}
|
|
2824
|
+
this.$emit('on-data', {
|
|
2825
|
+
data: this.messages,
|
|
2826
|
+
rawData: this.$props.rawData,
|
|
2827
|
+
loading: this.isAIResponseLoading || this.isLoading,
|
|
2828
|
+
error: newVal
|
|
2829
|
+
});
|
|
2830
|
+
},
|
|
2831
|
+
messages: function messages() {
|
|
2832
|
+
this.scrollToBottom();
|
|
2833
|
+
},
|
|
2834
|
+
componentError: function componentError(newVal) {
|
|
2835
|
+
var _this = this;
|
|
2836
|
+
if (newVal && newVal._bodyBlob) {
|
|
2837
|
+
this.AISessionId = ((getObjectFromLocalStorage(AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).sessionId || null;
|
|
2838
|
+
if (!this.AISessionId) {
|
|
2839
|
+
this.generateNewSessionId();
|
|
2840
|
+
}
|
|
2841
|
+
newVal._bodyBlob.text().then(function (textData) {
|
|
2842
|
+
try {
|
|
2843
|
+
var parsedErrorRes = JSON.parse(textData);
|
|
2844
|
+
if (parsedErrorRes.error) {
|
|
2845
|
+
_this.error = parsedErrorRes.error;
|
|
2846
|
+
_this.$emit('on-data', {
|
|
2847
|
+
data: _this.messages,
|
|
2848
|
+
rawData: _this.$props.rawData,
|
|
2849
|
+
loading: _this.$props.isAIResponseLoading || _this.$props.isLoading,
|
|
2850
|
+
error: parsedErrorRes.error
|
|
2851
|
+
});
|
|
2852
|
+
}
|
|
2853
|
+
} catch (error) {
|
|
2854
|
+
console.error('Error parsing component error JSON:', error);
|
|
2855
|
+
}
|
|
2856
|
+
})["catch"](function (error) {
|
|
2857
|
+
console.error('Error reading component error text data:', error);
|
|
2858
|
+
});
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
},
|
|
2862
|
+
methods: {
|
|
2863
|
+
generateNewSessionId: function generateNewSessionId() {
|
|
2864
|
+
var _this2 = this;
|
|
2865
|
+
var newSessionPromise = this.createAISession();
|
|
2866
|
+
newSessionPromise.then(function (res) {
|
|
2867
|
+
_this2.AISessionId = res.AIsessionId;
|
|
2868
|
+
})["catch"](function (e) {
|
|
2869
|
+
console.error(e);
|
|
2870
|
+
});
|
|
2871
|
+
},
|
|
2872
|
+
scrollToBottom: function scrollToBottom() {
|
|
2873
|
+
var _this3 = this;
|
|
2874
|
+
this.$nextTick(function () {
|
|
2875
|
+
var _this3$$refs;
|
|
2876
|
+
var messageContainer = (_this3$$refs = _this3.$refs) == null ? void 0 : _this3$$refs[_this3.$props.innerRef];
|
|
2877
|
+
if (messageContainer && messageContainer.$el) {
|
|
2878
|
+
messageContainer.$el.scrollTo({
|
|
2879
|
+
top: messageContainer.$el.scrollHeight,
|
|
2880
|
+
behavior: 'smooth'
|
|
2881
|
+
});
|
|
2882
|
+
}
|
|
2883
|
+
});
|
|
2884
|
+
},
|
|
2885
|
+
handleMessageInputChange: function handleMessageInputChange(e) {
|
|
2886
|
+
this.inputMessage = e.target.value;
|
|
2887
|
+
this.handleTextAreaHeightChange();
|
|
2888
|
+
},
|
|
2889
|
+
handleSendMessage: function handleSendMessage(e, isRetry, text) {
|
|
2890
|
+
if (isRetry === void 0) {
|
|
2891
|
+
isRetry = false;
|
|
2892
|
+
}
|
|
2893
|
+
if (text === void 0) {
|
|
2894
|
+
text = this.inputMessage;
|
|
2895
|
+
}
|
|
2896
|
+
if (typeof e === 'object' && e !== null) e.preventDefault();
|
|
2897
|
+
if (text.trim()) {
|
|
2898
|
+
if (this.isLoadingState) {
|
|
2899
|
+
return;
|
|
2900
|
+
}
|
|
2901
|
+
if (this.AISessionId) {
|
|
2902
|
+
if (!isRetry) this.messages = [].concat(this.messages, [{
|
|
2903
|
+
content: text,
|
|
2904
|
+
role: AI_ROLES.USER
|
|
2905
|
+
}]);
|
|
2906
|
+
this.getAIResponse(this.AISessionId, this.componentId, text);
|
|
2907
|
+
} else {
|
|
2908
|
+
console.error(this.errorMessageForMissingSessionId);
|
|
2909
|
+
this.error = {
|
|
2910
|
+
message: "AISessionId for " + this.$props.componentId + " is missing! AIAnswer component requires an AISessionId to function. Trying reloading the App."
|
|
2911
|
+
};
|
|
2912
|
+
}
|
|
2913
|
+
this.inputMessage = '';
|
|
2914
|
+
}
|
|
2915
|
+
},
|
|
2916
|
+
handleRetryRequest: function handleRetryRequest() {
|
|
2917
|
+
if (this.messages && !this.isLoadingState) {
|
|
2918
|
+
var _this$messages;
|
|
2919
|
+
var lastUserRequestMessage = (_this$messages = this.messages[this.messages.length - 1]) == null ? void 0 : _this$messages.content;
|
|
2920
|
+
if (this.AISessionId) {
|
|
2921
|
+
this.getAIResponse(this.AISessionId, this.componentId, lastUserRequestMessage);
|
|
2922
|
+
this.inputMessage = '';
|
|
2923
|
+
} else {
|
|
2924
|
+
console.error("AISessionId for " + this.componentId + " is missing! AIAnswer component requires an AISessionId to function. Try reloading the App.");
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
},
|
|
2928
|
+
renderErrorComponent: function renderErrorComponent() {
|
|
2929
|
+
var renderError = this.$slots.renderError || this.$props.renderError;
|
|
2930
|
+
if (this.error && !this.isLoadingState) {
|
|
2931
|
+
var _this$error, _this$error2;
|
|
2932
|
+
if (renderError) {
|
|
2933
|
+
return createVNode("div", {
|
|
2934
|
+
"ref": _errorContainerRef,
|
|
2935
|
+
"class": "--ai-answer-error-container " + (getClassName$2(this.$props.innerClass, 'ai-error') || '')
|
|
2936
|
+
}, [isFunction(renderError) ? renderError(this.error, this.handleRetryRequest) : renderError]);
|
|
2937
|
+
}
|
|
2938
|
+
return createVNode("div", {
|
|
2939
|
+
"ref": _errorContainerRef,
|
|
2940
|
+
"class": "--ai-answer-error-container " + (getClassName$2(this.$props.innerClass, 'ai-error') || '')
|
|
2941
|
+
}, [createVNode("div", {
|
|
2942
|
+
"class": "--default-error-element"
|
|
2943
|
+
}, [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 && createVNode(Button, {
|
|
2944
|
+
"primary": true,
|
|
2945
|
+
"onClick": this.handleRetryRequest
|
|
2946
|
+
}, {
|
|
2947
|
+
"default": function _default() {
|
|
2948
|
+
return [createTextVNode("Try again")];
|
|
2949
|
+
}
|
|
2950
|
+
})])]);
|
|
2951
|
+
}
|
|
2952
|
+
return null;
|
|
2953
|
+
},
|
|
2954
|
+
handleKeyPress: function handleKeyPress(e) {
|
|
2955
|
+
window.console.log('e', e);
|
|
2956
|
+
if (e.key === 'Enter') {
|
|
2957
|
+
this.handleSendMessage(e);
|
|
2958
|
+
this.inputMessage = '';
|
|
2959
|
+
}
|
|
2960
|
+
},
|
|
2961
|
+
renderIcon: function renderIcon() {
|
|
2962
|
+
if (this.$props.showIcon) {
|
|
2963
|
+
if (this.$props.icon) {
|
|
2964
|
+
return this.$props.icon;
|
|
2965
|
+
}
|
|
2966
|
+
if (this.$slots.icon) {
|
|
2967
|
+
return this.$slots.icon();
|
|
2968
|
+
}
|
|
2969
|
+
if (this.$props.iconURL) {
|
|
2970
|
+
return createVNode("img", {
|
|
2971
|
+
"style": {
|
|
2972
|
+
maxHeight: '25px'
|
|
2973
|
+
},
|
|
2974
|
+
"src": this.$props.iconURL,
|
|
2975
|
+
"alt": "search-icon"
|
|
2976
|
+
}, null);
|
|
2977
|
+
}
|
|
2978
|
+
return createVNode(SearchSvg, null, null);
|
|
2979
|
+
}
|
|
2980
|
+
return null;
|
|
2981
|
+
},
|
|
2982
|
+
shouldMicRender: function shouldMicRender(showVoiceSearch) {
|
|
2983
|
+
// checks for SSR
|
|
2984
|
+
if (typeof window === 'undefined') return false;
|
|
2985
|
+
return showVoiceSearch && (window.webkitSpeechRecognition || window.SpeechRecognition);
|
|
2986
|
+
},
|
|
2987
|
+
handleVoiceResults: function handleVoiceResults(_ref) {
|
|
2988
|
+
var results = _ref.results;
|
|
2989
|
+
if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
|
|
2990
|
+
this.handleSendMessage(null, false, results[0][0].transcript.trim());
|
|
2991
|
+
}
|
|
2992
|
+
},
|
|
2993
|
+
renderIcons: function renderIcons() {
|
|
2994
|
+
var _this4 = this;
|
|
2995
|
+
var _slot, _slot2;
|
|
2996
|
+
var _this$$props = this.$props,
|
|
2997
|
+
getMicInstance = _this$$props.getMicInstance,
|
|
2998
|
+
showVoiceInput = _this$$props.showVoiceInput,
|
|
2999
|
+
iconPosition = _this$$props.iconPosition,
|
|
3000
|
+
innerClass = _this$$props.innerClass;
|
|
3001
|
+
var renderMic = this.$slots.renderMic || this.$props.renderMic;
|
|
3002
|
+
return createVNode("div", null, [createVNode(IconGroup, {
|
|
3003
|
+
"enableAI": true,
|
|
3004
|
+
"groupPosition": "right",
|
|
3005
|
+
"positionType": "absolute"
|
|
3006
|
+
}, {
|
|
3007
|
+
"default": function _default() {
|
|
3008
|
+
return [!_this4.isLoadingState && _this4.AISessionId && _this4.shouldMicRender(showVoiceInput) && createVNode(Mic, {
|
|
3009
|
+
"getInstance": getMicInstance,
|
|
3010
|
+
"render": renderMic,
|
|
3011
|
+
"handleResult": _this4.handleVoiceResults,
|
|
3012
|
+
"class": getClassName$2(innerClass, 'ai-search-mic') || null
|
|
3013
|
+
}, null), iconPosition === 'right' && createVNode(IconWrapper, null, _isSlot$1(_slot = _this4.renderIcon()) ? _slot : {
|
|
3014
|
+
"default": function _default() {
|
|
3015
|
+
return [_slot];
|
|
3016
|
+
}
|
|
3017
|
+
})];
|
|
3018
|
+
}
|
|
3019
|
+
}), createVNode(IconGroup, {
|
|
3020
|
+
"enableAI": true,
|
|
3021
|
+
"groupPosition": "left",
|
|
3022
|
+
"positionType": "absolute"
|
|
3023
|
+
}, {
|
|
3024
|
+
"default": function _default() {
|
|
3025
|
+
return [iconPosition === 'left' && createVNode(IconWrapper, null, _isSlot$1(_slot2 = _this4.renderIcon()) ? _slot2 : {
|
|
3026
|
+
"default": function _default() {
|
|
3027
|
+
return [_slot2];
|
|
3028
|
+
}
|
|
3029
|
+
})];
|
|
3030
|
+
}
|
|
3031
|
+
})]);
|
|
3032
|
+
},
|
|
3033
|
+
enterButtonOnClick: function enterButtonOnClick(e) {
|
|
3034
|
+
this.handleSendMessage(e);
|
|
3035
|
+
},
|
|
3036
|
+
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
3037
|
+
var _this5 = this;
|
|
3038
|
+
var _this$$props2 = this.$props,
|
|
3039
|
+
enterButton = _this$$props2.enterButton,
|
|
3040
|
+
innerClass = _this$$props2.innerClass;
|
|
3041
|
+
var renderEnterButton = this.$slots.renderEnterButton;
|
|
3042
|
+
if (enterButton) {
|
|
3043
|
+
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
3044
|
+
if (renderEnterButton) {
|
|
3045
|
+
return renderEnterButton(_this5.enterButtonOnClick);
|
|
3046
|
+
}
|
|
3047
|
+
return createVNode(SendButton, {
|
|
3048
|
+
"primary": true,
|
|
3049
|
+
"type": "submit",
|
|
3050
|
+
"tabIndex": 0,
|
|
3051
|
+
"onClick": _this5.handleSendMessage,
|
|
3052
|
+
"onKeyPress": _this5.handleKeyPress,
|
|
3053
|
+
"class": "ask-btn " + getClassName$2(innerClass, 'ai-enter-button'),
|
|
3054
|
+
"disabled": _this5.isLoadingState || !_this5.AISessionId
|
|
3055
|
+
}, {
|
|
3056
|
+
"default": function _default() {
|
|
3057
|
+
return [createTextVNode("Send")];
|
|
3058
|
+
}
|
|
3059
|
+
});
|
|
3060
|
+
};
|
|
3061
|
+
return createVNode("div", {
|
|
3062
|
+
"class": "ai-enter-button-wrapper"
|
|
3063
|
+
}, [getEnterButtonMarkup()]);
|
|
3064
|
+
}
|
|
3065
|
+
return null;
|
|
3066
|
+
},
|
|
3067
|
+
getComponent: function getComponent$1() {
|
|
3068
|
+
var data = {
|
|
3069
|
+
error: this.AIResponseError,
|
|
3070
|
+
loading: this.isAIResponseLoading,
|
|
3071
|
+
data: this.messages,
|
|
3072
|
+
rawData: this.rawData
|
|
3073
|
+
};
|
|
3074
|
+
return getComponent(data, this);
|
|
3075
|
+
},
|
|
3076
|
+
handleTextAreaHeightChange: function handleTextAreaHeightChange() {
|
|
3077
|
+
var _this$$refs, _this$$refs$_inputRef, _this$$refs2, _this$$refs2$_inputWr, _this$$refs3;
|
|
3078
|
+
var textArea = (_this$$refs = this.$refs) == null ? void 0 : (_this$$refs$_inputRef = _this$$refs[_inputRef]) == null ? void 0 : _this$$refs$_inputRef.$el;
|
|
3079
|
+
var inputWrapper = (_this$$refs2 = this.$refs) == null ? void 0 : (_this$$refs2$_inputWr = _this$$refs2[_inputWrapperRef]) == null ? void 0 : _this$$refs2$_inputWr.$el;
|
|
3080
|
+
var errorContainer = (_this$$refs3 = this.$refs) == null ? void 0 : _this$$refs3[_errorContainerRef];
|
|
3081
|
+
if (textArea) {
|
|
3082
|
+
textArea.style.height = '42px';
|
|
3083
|
+
var lineHeight = parseInt(getComputedStyle(textArea).lineHeight, 10);
|
|
3084
|
+
var maxHeight = lineHeight * 11; // max height for 10 lines
|
|
3085
|
+
var height = Math.min(textArea.scrollHeight, maxHeight);
|
|
3086
|
+
textArea.style.height = height + "px";
|
|
3087
|
+
textArea.style.overflowY = height === maxHeight ? 'auto' : 'hidden';
|
|
3088
|
+
// wrapper around input/ textarea
|
|
3089
|
+
inputWrapper.style.height = height + "px";
|
|
3090
|
+
// adjust error-container
|
|
3091
|
+
|
|
3092
|
+
if (errorContainer) {
|
|
3093
|
+
errorContainer.style.bottom = height + "px";
|
|
3094
|
+
}
|
|
3095
|
+
this.$forceUpdate();
|
|
3096
|
+
}
|
|
3097
|
+
}
|
|
3098
|
+
},
|
|
3099
|
+
beforeUnmount: function beforeUnmount() {
|
|
3100
|
+
if (this.$props.clearSessionOnDestroy) {
|
|
3101
|
+
// cleanup logic
|
|
3102
|
+
// final Object to store in local storage cache
|
|
3103
|
+
var finalCacheObj = getObjectFromLocalStorage(AI_LOCAL_CACHE_KEY) || {};
|
|
3104
|
+
// delete current component's cache
|
|
3105
|
+
delete finalCacheObj[this.$props.componentId];
|
|
3106
|
+
// update local cache
|
|
3107
|
+
setObjectInLocalStorage(AI_LOCAL_CACHE_KEY, finalCacheObj);
|
|
3108
|
+
}
|
|
3109
|
+
},
|
|
3110
|
+
render: function render() {
|
|
3111
|
+
var _slot3;
|
|
3112
|
+
var _this6 = this;
|
|
3113
|
+
var props = this.$props;
|
|
3114
|
+
if (!this.shouldShowComponent) {
|
|
3115
|
+
return null;
|
|
3116
|
+
}
|
|
3117
|
+
return createVNode(Chatbox, {
|
|
3118
|
+
"style": props.style || {}
|
|
3119
|
+
}, {
|
|
3120
|
+
"default": function _default() {
|
|
3121
|
+
return [_this6.$props.title && createVNode(Title, {
|
|
3122
|
+
"class": getClassName$2(_this6.$props.innerClass, 'title') || ''
|
|
3123
|
+
}, {
|
|
3124
|
+
"default": function _default() {
|
|
3125
|
+
return [_this6.$props.title];
|
|
3126
|
+
}
|
|
3127
|
+
}), createVNode(ChatContainer, {
|
|
3128
|
+
"class": "--ai-chat-container",
|
|
3129
|
+
"theme": props.theme,
|
|
3130
|
+
"showInput": props.showInput
|
|
3131
|
+
}, {
|
|
3132
|
+
"default": function _default() {
|
|
3133
|
+
return [_this6.hasCustomRenderer && createVNode(MessagesContainer, {
|
|
3134
|
+
"themePreset": _this6.themePreset,
|
|
3135
|
+
"theme": props.theme,
|
|
3136
|
+
"ref": _this6.$props.innerRef,
|
|
3137
|
+
"class": "--ai-message-container " + (getClassName$2(props.innerClass, 'ai-message-container') || '')
|
|
3138
|
+
}, _isSlot$1(_slot3 = _this6.getComponent()) ? _slot3 : {
|
|
3139
|
+
"default": function _default() {
|
|
3140
|
+
return [_slot3];
|
|
3141
|
+
}
|
|
3142
|
+
}), !_this6.hasCustomRenderer && createVNode(MessagesContainer, {
|
|
3143
|
+
"themePreset": _this6.themePreset,
|
|
3144
|
+
"theme": props.theme,
|
|
3145
|
+
"ref": _this6.$props.innerRef,
|
|
3146
|
+
"class": "--ai-message-container " + (getClassName$2(props.innerClass, 'ai-message-container') || '')
|
|
3147
|
+
}, {
|
|
3148
|
+
"default": function _default() {
|
|
3149
|
+
return [_this6.messages.map(function (message, index) {
|
|
3150
|
+
return createVNode(Message, {
|
|
3151
|
+
"key": index,
|
|
3152
|
+
"isSender": message.role === AI_ROLES.USER,
|
|
3153
|
+
"innerHTML": md$1.render(message.content),
|
|
3154
|
+
"themePreset": _this6.themePreset,
|
|
3155
|
+
"theme": props.theme,
|
|
3156
|
+
"class": "--ai-answer-message " + (getClassName$2(props.innerClass, 'ai-message') || '')
|
|
3157
|
+
}, null);
|
|
3158
|
+
}), _this6.isLoadingState && createVNode(Message, {
|
|
3159
|
+
"themePreset": _this6.themePreset,
|
|
3160
|
+
"theme": props.theme,
|
|
3161
|
+
"isSender": false,
|
|
3162
|
+
"class": "--ai-answer-message " + (getClassName$2(props.innerClass, 'ai-message') || null)
|
|
3163
|
+
}, {
|
|
3164
|
+
"default": function _default() {
|
|
3165
|
+
return [createVNode(TypingIndicator, null, {
|
|
3166
|
+
"default": function _default() {
|
|
3167
|
+
return [createVNode(TypingDot, {
|
|
3168
|
+
"themePreset": _this6.themePreset
|
|
3169
|
+
}, null), createVNode(TypingDot, {
|
|
3170
|
+
"themePreset": _this6.themePreset
|
|
3171
|
+
}, null), createVNode(TypingDot, {
|
|
3172
|
+
"themePreset": _this6.themePreset
|
|
3173
|
+
}, null)];
|
|
3174
|
+
}
|
|
3175
|
+
})];
|
|
3176
|
+
}
|
|
3177
|
+
})];
|
|
3178
|
+
}
|
|
3179
|
+
}), _this6.renderErrorComponent(), ' ', props.showFeedback && createVNode("div", {
|
|
3180
|
+
"class": "--ai-answer-feedback-container " + (getClassName$2(props.innerClass, 'ai-feedback') || '')
|
|
3181
|
+
}, [createVNode(AIFeedback, {
|
|
3182
|
+
"hideUI": _this6.isLoadingState || !_this6.sessionId,
|
|
3183
|
+
"key": _this6.sessionId,
|
|
3184
|
+
"onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
|
|
3185
|
+
_this6.trackUsefullness(_this6.sessionId, {
|
|
3186
|
+
useful: useful,
|
|
3187
|
+
reason: reason
|
|
3188
|
+
});
|
|
3189
|
+
}
|
|
3190
|
+
}, null)]), props.showInput && createVNode(MessageInputContainer, {
|
|
3191
|
+
"class": "--ai-input-container",
|
|
3192
|
+
"onSubmit": _this6.handleSendMessage
|
|
3193
|
+
}, {
|
|
3194
|
+
"default": function _default() {
|
|
3195
|
+
return [createVNode(InputGroup, {
|
|
3196
|
+
"enableAI": true,
|
|
3197
|
+
"isOpen": false
|
|
3198
|
+
}, {
|
|
3199
|
+
"default": function _default() {
|
|
3200
|
+
return [createVNode(InputWrapper, {
|
|
3201
|
+
"ref": _inputWrapperRef
|
|
3202
|
+
}, {
|
|
3203
|
+
"default": function _default() {
|
|
3204
|
+
return [createVNode(MessageInput, {
|
|
3205
|
+
"ref": _inputRef,
|
|
3206
|
+
"placeholder": props.placeholder,
|
|
3207
|
+
"enterButton": props.enterButton,
|
|
3208
|
+
"value": _this6.inputMessage,
|
|
3209
|
+
"onInput": _this6.handleMessageInputChange,
|
|
3210
|
+
"id": props.componentId + "-ai-input",
|
|
3211
|
+
"showIcon": props.showIcon,
|
|
3212
|
+
"iconPosition": props.iconPosition,
|
|
3213
|
+
"themePreset": _this6.themePreset,
|
|
3214
|
+
"disabled": _this6.isLoadingState || !_this6.AISessionId,
|
|
3215
|
+
"class": getClassName$2(props.innerClass, 'ai-input') || null
|
|
3216
|
+
}, null), ' ', _this6.renderIcons()];
|
|
3217
|
+
}
|
|
3218
|
+
})];
|
|
3219
|
+
}
|
|
3220
|
+
}), _this6.renderEnterButtonElement()];
|
|
3221
|
+
}
|
|
3222
|
+
}), ' '];
|
|
3223
|
+
}
|
|
3224
|
+
})];
|
|
3225
|
+
}
|
|
3226
|
+
});
|
|
3227
|
+
}
|
|
3228
|
+
});
|
|
3229
|
+
AIAnswer.hasInternalComponent = function () {
|
|
3230
|
+
return true;
|
|
3231
|
+
};
|
|
3232
|
+
var mapStateToProps$1 = function mapStateToProps(state, props) {
|
|
3233
|
+
var dependencyComponent = Object.values(props.react)[0];
|
|
3234
|
+
if (Array.isArray(dependencyComponent)) {
|
|
3235
|
+
// eslint-disable-next-line prefer-destructuring
|
|
3236
|
+
dependencyComponent = dependencyComponent[0];
|
|
3237
|
+
}
|
|
3238
|
+
var showComponent = state.selectedValues[dependencyComponent] && state.selectedValues[dependencyComponent].value;
|
|
3239
|
+
return {
|
|
3240
|
+
showComponent: showComponent,
|
|
3241
|
+
AIResponse: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response,
|
|
3242
|
+
isAIResponseLoading: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].isLoading,
|
|
3243
|
+
AIResponseError: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].error,
|
|
3244
|
+
rawData: state.rawData[props.componentId],
|
|
3245
|
+
themePreset: state.config.themePreset,
|
|
3246
|
+
isLoading: state.isLoading[props.componentId] || false,
|
|
3247
|
+
sessionIdFromStore: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.sessionId || '',
|
|
3248
|
+
componentError: state.error[props.componentId]
|
|
3249
|
+
};
|
|
3250
|
+
};
|
|
3251
|
+
var mapDispatchToProps$1 = {
|
|
3252
|
+
getAIResponse: fetchAIResponse,
|
|
3253
|
+
trackUsefullness: recordAISessionUsefulness,
|
|
3254
|
+
createAISession: createAISession
|
|
3255
|
+
};
|
|
3256
|
+
var AIConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps$1, mapDispatchToProps$1)(AIAnswer), {
|
|
3257
|
+
componentType: componentTypes.AIAnswer,
|
|
3258
|
+
internalComponent: true
|
|
3259
|
+
}));
|
|
3260
|
+
AIConnected.name = AIAnswer.name;
|
|
3261
|
+
AIConnected.hasInternalComponent = AIAnswer.hasInternalComponent;
|
|
3262
|
+
AIConnected.install = function (Vue) {
|
|
3263
|
+
Vue.component(AIConnected.name, AIConnected);
|
|
3264
|
+
};
|
|
3265
|
+
// Add componentType for SSR
|
|
3266
|
+
AIConnected.componentType = componentTypes.AIAnswer;
|
|
3267
|
+
|
|
3268
|
+
var _templateObject$9, _templateObject2$4;
|
|
3269
|
+
var HierarchicalMenuList = styled('ul')(_templateObject$9 || (_templateObject$9 = _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"])));
|
|
3270
|
+
var HierarchicalMenuListItem = styled('li')(_templateObject2$4 || (_templateObject2$4 = _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) {
|
|
1868
3271
|
return !props.showLine && "\n\t\t\t\t\tdisplay: none;\n\t\t\t\t";
|
|
1869
3272
|
});
|
|
1870
3273
|
|
|
@@ -2077,7 +3480,7 @@ var HierarchicalMenuListItemComponent = {
|
|
|
2077
3480
|
}
|
|
2078
3481
|
};
|
|
2079
3482
|
|
|
2080
|
-
function _isSlot$
|
|
3483
|
+
function _isSlot$2(s) {
|
|
2081
3484
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
2082
3485
|
}
|
|
2083
3486
|
var HierarchicalMenuComponent = {
|
|
@@ -2102,7 +3505,7 @@ var HierarchicalMenuComponent = {
|
|
|
2102
3505
|
return createVNode(HierarchicalMenuList, {
|
|
2103
3506
|
"class": "" + (isExpanded ? '--open' : ''),
|
|
2104
3507
|
"isSelected": isExpanded
|
|
2105
|
-
}, _isSlot$
|
|
3508
|
+
}, _isSlot$2(_slot = listArray.map(function (listItem) {
|
|
2106
3509
|
return createVNode(HierarchicalMenuListItemComponent, mergeProps({
|
|
2107
3510
|
"key": parentPath + "__" + JSON.stringify(listItem),
|
|
2108
3511
|
"parentPath": parentPath,
|
|
@@ -2116,7 +3519,7 @@ var HierarchicalMenuComponent = {
|
|
|
2116
3519
|
}
|
|
2117
3520
|
};
|
|
2118
3521
|
|
|
2119
|
-
function _isSlot$
|
|
3522
|
+
function _isSlot$3(s) {
|
|
2120
3523
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
2121
3524
|
}
|
|
2122
3525
|
var updateQueryAction = Actions.updateQuery,
|
|
@@ -2566,7 +3969,7 @@ var TreeList = {
|
|
|
2566
3969
|
"default": function _default() {
|
|
2567
3970
|
return [props.title && createVNode(Title, {
|
|
2568
3971
|
"class": getClassName$2(innerClass, 'title') || null
|
|
2569
|
-
}, _isSlot$
|
|
3972
|
+
}, _isSlot$3(title) ? title : {
|
|
2570
3973
|
"default": function _default() {
|
|
2571
3974
|
return [title];
|
|
2572
3975
|
}
|
|
@@ -2595,7 +3998,7 @@ var TreeList = {
|
|
|
2595
3998
|
});
|
|
2596
3999
|
}
|
|
2597
4000
|
};
|
|
2598
|
-
var mapStateToProps$
|
|
4001
|
+
var mapStateToProps$2 = function mapStateToProps(state, props) {
|
|
2599
4002
|
return {
|
|
2600
4003
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
2601
4004
|
rawData: state.rawData[props.componentId] || {},
|
|
@@ -2613,7 +4016,7 @@ var mapDispatchtoProps = {
|
|
|
2613
4016
|
TreeList.hasInternalComponent = function () {
|
|
2614
4017
|
return true;
|
|
2615
4018
|
};
|
|
2616
|
-
var TreeListConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps$
|
|
4019
|
+
var TreeListConnected = PreferencesConsumer(ComponentWrapper(connect(mapStateToProps$2, mapDispatchtoProps)(TreeList), {
|
|
2617
4020
|
componentType: componentTypes.treeList,
|
|
2618
4021
|
internalComponent: TreeList.hasInternalComponent()
|
|
2619
4022
|
}));
|
|
@@ -2681,7 +4084,7 @@ RcConnected.install = function (Vue) {
|
|
|
2681
4084
|
Vue.component(RcConnected.name, RcConnected);
|
|
2682
4085
|
};
|
|
2683
4086
|
|
|
2684
|
-
var components = [ReactiveList, ResultCard, ResultList, ReactiveBase, SBConnected, SingleList, MultiList, SingleRange, MultiRange, RangeSlider, DynamicRangeSlider, ReactiveComponent, RcConnected, SelectedFilters, ToggleButton, SingleDropdownList, MultiDropdownList, StateProvider, RangeInput, TreeListConnected];
|
|
4087
|
+
var components = [ReactiveList, ResultCard, ResultList, ReactiveBase, SBConnected, SingleList, MultiList, SingleRange, MultiRange, RangeSlider, DynamicRangeSlider, ReactiveComponent, RcConnected, SelectedFilters, ToggleButton, SingleDropdownList, MultiDropdownList, StateProvider, RangeInput, TreeListConnected, AIConnected];
|
|
2685
4088
|
function install (Vue) {
|
|
2686
4089
|
components.map(function (component) {
|
|
2687
4090
|
Vue.use(component);
|
|
@@ -2689,4 +4092,4 @@ function install (Vue) {
|
|
|
2689
4092
|
});
|
|
2690
4093
|
}
|
|
2691
4094
|
|
|
2692
|
-
export { RcConnected as R, SBConnected as S, TreeListConnected as T, install as i };
|
|
4095
|
+
export { AIConnected as A, RcConnected as R, SBConnected as S, TreeListConnected as T, install as i };
|