@appbaseio/reactivesearch-vue 2.0.0-alpha.3 → 3.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +17405 -25231
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +6 -15
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/Button-ad042719.js +59 -0
  6. package/dist/cjs/Card-f5ab024a.js +27 -0
  7. package/dist/cjs/{ComponentWrapper-ad3dad02.js → ComponentWrapper-75f88599.js} +42 -56
  8. package/dist/cjs/Container-29f049b2.js +12 -0
  9. package/dist/cjs/DropDown-6cf84c47.js +698 -0
  10. package/dist/cjs/DynamicRangeSlider.js +103 -155
  11. package/dist/cjs/Flex-d5675ea6.js +48 -0
  12. package/dist/cjs/FormControlList-fadd792f.js +42 -0
  13. package/dist/cjs/Input-4b434436.js +74 -0
  14. package/dist/cjs/ListItem-d57d648d.js +42 -0
  15. package/dist/cjs/MultiDropdownList.js +124 -240
  16. package/dist/cjs/MultiList.js +123 -261
  17. package/dist/cjs/MultiRange.js +87 -133
  18. package/dist/cjs/{Pagination-71e85fa9.js → Pagination-b5ddc906.js} +70 -83
  19. package/dist/cjs/PreferencesConsumer-eb265924.js +75 -0
  20. package/dist/cjs/RangeInput.js +163 -171
  21. package/dist/cjs/RangeSlider.js +81 -109
  22. package/dist/cjs/ReactiveBase.js +139 -157
  23. package/dist/cjs/ReactiveComponent-eb8db4c1.js +2189 -0
  24. package/dist/cjs/ReactiveComponent.js +46 -340
  25. package/dist/cjs/ReactiveGoogleMap.js +445 -655
  26. package/dist/cjs/ReactiveList.js +179 -304
  27. package/dist/cjs/ResultCard.js +36 -36
  28. package/dist/cjs/ResultList.js +48 -56
  29. package/dist/cjs/SelectedFilters.js +62 -69
  30. package/dist/cjs/SingleDropdownList.js +117 -177
  31. package/dist/cjs/SingleList.js +121 -205
  32. package/dist/cjs/SingleRange.js +78 -105
  33. package/dist/cjs/StateProvider.js +74 -47
  34. package/dist/cjs/Title-8802a218.js +12 -0
  35. package/dist/cjs/ToggleButton.js +72 -119
  36. package/dist/cjs/{_rollupPluginBabelHelpers-c705cbe6.js → _rollupPluginBabelHelpers-f8b843f8.js} +0 -15
  37. package/dist/cjs/{index-6a167fe0.js → index-d8d8f291.js} +38 -108
  38. package/dist/cjs/index.js +44 -41
  39. package/dist/cjs/initReactivesearch.js +69 -152
  40. package/dist/cjs/install.js +47 -43
  41. package/dist/cjs/ssr-6907ada3.js +66 -0
  42. package/dist/cjs/{utils-d6a52588.js → utils-83fd01e9.js} +7 -16
  43. package/dist/cjs/version.js +1 -1
  44. package/dist/cjs/{vueTypes-727b7c63.js → vueTypes-1bf00978.js} +8 -19
  45. package/dist/es/Button-474510e3.js +53 -0
  46. package/dist/es/{Card-450683f1.js → Card-38cbe652.js} +3 -3
  47. package/dist/es/{ComponentWrapper-424e86fd.js → ComponentWrapper-5166c76a.js} +42 -56
  48. package/dist/es/{Container-ba826e96.js → Container-d00219f7.js} +2 -2
  49. package/dist/es/DropDown-8764360c.js +688 -0
  50. package/dist/es/DynamicRangeSlider.js +103 -155
  51. package/dist/es/Flex-a08e22d7.js +46 -0
  52. package/dist/es/FormControlList-fe6eaee4.js +38 -0
  53. package/dist/es/Input-4a8ef1f3.js +69 -0
  54. package/dist/es/{ListItem-cad14c5e.js → ListItem-16756c02.js} +7 -8
  55. package/dist/es/MultiDropdownList.js +124 -240
  56. package/dist/es/MultiList.js +123 -261
  57. package/dist/es/MultiRange.js +87 -133
  58. package/dist/es/{Pagination-784bf143.js → Pagination-72bd1d9e.js} +70 -83
  59. package/dist/es/PreferencesConsumer-c276709c.js +73 -0
  60. package/dist/es/RangeInput.js +163 -170
  61. package/dist/es/RangeSlider.js +81 -109
  62. package/dist/es/ReactiveBase.js +138 -155
  63. package/dist/es/ReactiveComponent-f9fa5780.js +2183 -0
  64. package/dist/es/ReactiveComponent.js +42 -337
  65. package/dist/es/ReactiveGoogleMap.js +440 -649
  66. package/dist/es/ReactiveList.js +177 -301
  67. package/dist/es/ResultCard.js +36 -36
  68. package/dist/es/ResultList.js +48 -56
  69. package/dist/es/SelectedFilters.js +62 -69
  70. package/dist/es/SingleDropdownList.js +117 -177
  71. package/dist/es/SingleList.js +121 -205
  72. package/dist/es/SingleRange.js +78 -105
  73. package/dist/es/StateProvider.js +75 -48
  74. package/dist/es/{Title-3342664a.js → Title-863dfa42.js} +2 -2
  75. package/dist/es/ToggleButton.js +72 -119
  76. package/dist/es/{_rollupPluginBabelHelpers-76660dab.js → _rollupPluginBabelHelpers-ded08042.js} +0 -15
  77. package/dist/es/{index-7788a843.js → index-4520a598.js} +39 -107
  78. package/dist/es/index.js +30 -32
  79. package/dist/es/initReactivesearch.js +69 -152
  80. package/dist/es/install.js +49 -41
  81. package/dist/es/{ssr-b2c0b401.js → ssr-af398f0c.js} +36 -7
  82. package/dist/es/{utils-9e68acee.js → utils-9e5a16a1.js} +7 -16
  83. package/dist/es/version.js +1 -1
  84. package/dist/es/{vueTypes-b8146772.js → vueTypes-f1923c72.js} +8 -19
  85. package/package.json +10 -9
  86. package/dist/cjs/Button-446f819e.js +0 -68
  87. package/dist/cjs/CancelSvg-9f258f4f.js +0 -449
  88. package/dist/cjs/Card-642547a8.js +0 -30
  89. package/dist/cjs/Container-daf30918.js +0 -15
  90. package/dist/cjs/DataSearch-6cf29cf0.js +0 -2323
  91. package/dist/cjs/DataSearch.js +0 -30
  92. package/dist/cjs/DropDown-c479bbb0.js +0 -328
  93. package/dist/cjs/Flex-aa517a13.js +0 -52
  94. package/dist/cjs/FormControlList-c195a592.js +0 -47
  95. package/dist/cjs/Input-e6603a7e.js +0 -79
  96. package/dist/cjs/ListItem-8c9e0d68.js +0 -46
  97. package/dist/cjs/Title-1de7d0f4.js +0 -15
  98. package/dist/cjs/install-42ba1d44.js +0 -1409
  99. package/dist/cjs/ssr-3027b848.js +0 -39
  100. package/dist/es/Button-d8bc15ea.js +0 -59
  101. package/dist/es/CancelSvg-4cfae5fd.js +0 -440
  102. package/dist/es/DataSearch-4888aa43.js +0 -2308
  103. package/dist/es/DataSearch.js +0 -22
  104. package/dist/es/DropDown-05a644a5.js +0 -322
  105. package/dist/es/Flex-1f0795c3.js +0 -47
  106. package/dist/es/FormControlList-c22d64f6.js +0 -40
  107. package/dist/es/Input-7a2a9fac.js +0 -71
  108. package/dist/es/install-80bc2764.js +0 -1402
@@ -0,0 +1,2189 @@
1
+ 'use strict';
2
+
3
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
+
5
+ var configureStore = require('@appbaseio/reactivecore');
6
+ var configureStore__default = _interopDefault(configureStore);
7
+ var constants = require('@appbaseio/reactivecore/lib/utils/constants');
8
+ var _transformOn = _interopDefault(require('@vue/babel-helper-vue-transform-on'));
9
+ var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f8b843f8.js');
10
+ var vue = require('vue');
11
+ var VueTypes = _interopDefault(require('vue-types'));
12
+ var helper = require('@appbaseio/reactivecore/lib/utils/helper');
13
+ var vueEmotion = require('@appbaseio/vue-emotion');
14
+ var emotion = require('emotion');
15
+ var Button = require('./Button-ad042719.js');
16
+ var vueTypes = require('./vueTypes-1bf00978.js');
17
+ var ReactiveList = require('./ReactiveList.js');
18
+ var index = require('./index-d8d8f291.js');
19
+ var ComponentWrapper = require('./ComponentWrapper-75f88599.js');
20
+ var PreferencesConsumer = require('./PreferencesConsumer-eb265924.js');
21
+ var Title = require('./Title-8802a218.js');
22
+ var Flex = require('./Flex-d5675ea6.js');
23
+ var hotkeys = _interopDefault(require('hotkeys-js'));
24
+ var DropDown = require('./DropDown-6cf84c47.js');
25
+ var Input = require('./Input-4b434436.js');
26
+ var Container = require('./Container-29f049b2.js');
27
+ var Highlight = _interopDefault(require('vue-highlight-words'));
28
+ var SingleList = require('./SingleList.js');
29
+ var MultiList = require('./MultiList.js');
30
+ var SingleDropdownList = require('./SingleDropdownList.js');
31
+ var MultiDropdownList = require('./MultiDropdownList.js');
32
+ var ToggleButton = require('./ToggleButton.js');
33
+ var DynamicRangeSlider = require('./DynamicRangeSlider.js');
34
+ var SingleRange = require('./SingleRange.js');
35
+ var MultiRange = require('./MultiRange.js');
36
+ var RangeSlider = require('./RangeSlider.js');
37
+ var RangeInput = require('./RangeInput.js');
38
+
39
+ var _templateObject;
40
+ var InputGroup = vueEmotion.styled('div')(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n display: flex;\n align-items: stretch;\n width: 100%;\n"])));
41
+ InputGroup.defaultProps = {
42
+ className: 'input-group'
43
+ };
44
+
45
+ var _templateObject$1;
46
+ var InputAddon = vueEmotion.styled('span')(_templateObject$1 || (_templateObject$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #fafafa;\n border: 1px solid #ccc;\n border-radius: 2px;\n color: rgba(0, 0, 0, 0.85);\n font-size: 14px;\n font-weight: 400;\n padding: 0 11px;\n position: relative;\n transition: all 0.3s;\n box-sizing: border-box;\n overflow: hidden;\n\n &:first-of-type {\n border-right: none;\n }\n &:last-of-type {\n border-left: none;\n }\n"])));
47
+ InputAddon.defaultProps = {
48
+ className: 'input-addon'
49
+ };
50
+
51
+ var getClassName = configureStore.helper.getClassName;
52
+ var SuggestionWrapper = {
53
+ name: 'SuggestionWrapper',
54
+ props: {
55
+ innerClassName: vueTypes.types.string,
56
+ themePreset: vueTypes.types.themePreset,
57
+ innerClass: vueTypes.types.style
58
+ },
59
+ render: function render() {
60
+ var _this$$props = this.$props,
61
+ themePreset = _this$$props.themePreset,
62
+ innerClass = _this$$props.innerClass,
63
+ innerClassName = _this$$props.innerClassName;
64
+ return vue.createVNode("div", {
65
+ "class": Input.noSuggestions(themePreset) + " " + getClassName(innerClass, innerClassName || '')
66
+ }, [vue.createVNode("li", null, [this.$slots["default"]()])]);
67
+ }
68
+ };
69
+
70
+ var _templateObject$2;
71
+ var highlightStyle = {
72
+ fontWeight: 600,
73
+ padding: 0,
74
+ backgroundColor: 'transparent',
75
+ color: 'inherit'
76
+ };
77
+ var PredictiveSuggestion = vueEmotion.styled('span')(_templateObject$2 || (_templateObject$2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t.highlight {\n\t\tbackground: transparent;\n\t\tcolor: inherit;\n\t\tfont-weight: 600;\n\t\tpadding: 0;\n\t}\n"])));
78
+ var SuggestionItem = {
79
+ name: 'SuggestionItem',
80
+ props: {
81
+ currentValue: vueTypes.types.string,
82
+ suggestion: vueTypes.types.any
83
+ },
84
+ render: function render() {
85
+ var _this = this;
86
+ var _this$suggestion = this.suggestion,
87
+ label = _this$suggestion.label,
88
+ value = _this$suggestion.value,
89
+ title = _this$suggestion.title,
90
+ description = _this$suggestion.description,
91
+ image = _this$suggestion.image,
92
+ isPredictiveSuggestion = _this$suggestion.isPredictiveSuggestion,
93
+ _suggestion_type = _this$suggestion._suggestion_type,
94
+ _category = _this$suggestion._category;
95
+ if (label) {
96
+ // label has highest precedence
97
+ return typeof label === 'string' ? vue.createVNode("div", {
98
+ "class": "trim"
99
+ }, [(_category ? false : isPredictiveSuggestion
100
+ // eslint-disable-next-line
101
+ || !!_suggestion_type) ? vue.createVNode(PredictiveSuggestion, {
102
+ "innerHTML": label
103
+ }, null) : vue.createVNode(Highlight, {
104
+ "searchWords": _category ? [_category] : this.currentValue.split(' '),
105
+ "textToHighlight": label,
106
+ "autoEscape": true,
107
+ "highlightStyle": highlightStyle
108
+ }, null)]) : label;
109
+ }
110
+ if (title || image || description) {
111
+ return vue.createVNode(Flex.Flex, {
112
+ "alignItems": "center",
113
+ "css": {
114
+ width: '100%'
115
+ }
116
+ }, {
117
+ "default": function _default() {
118
+ return [image && vue.createVNode("div", {
119
+ "css": {
120
+ margin: 'auto',
121
+ marginRight: 10
122
+ }
123
+ }, [vue.createVNode("img", {
124
+ "src": image,
125
+ "alt": " ",
126
+ "height": "50px",
127
+ "width": "50px",
128
+ "css": {
129
+ objectFit: 'contain'
130
+ }
131
+ }, null)]), vue.createVNode(Flex.Flex, {
132
+ "direction": "column",
133
+ "css": {
134
+ width: image ? 'calc(100% - 60px)' : '100%'
135
+ }
136
+ }, {
137
+ "default": function _default() {
138
+ return [title && vue.createVNode("div", {
139
+ "class": "trim"
140
+ }, [vue.createVNode(Highlight, {
141
+ "searchWords": _this.currentValue.split(' '),
142
+ "textToHighlight": title,
143
+ "highlightStyle": highlightStyle,
144
+ "class": emotion.css({
145
+ fontSize: '1rem'
146
+ })
147
+ }, null)]), description && vue.createVNode("div", {
148
+ "class": emotion.cx('trim', emotion.css({
149
+ marginTop: 3
150
+ }))
151
+ }, [vue.createVNode(Highlight, {
152
+ "searchWords": _this.currentValue.split(' '),
153
+ "textToHighlight": description,
154
+ "highlightStyle": highlightStyle
155
+ }, null)])];
156
+ }
157
+ })];
158
+ }
159
+ });
160
+ }
161
+ return value;
162
+ }
163
+ };
164
+
165
+ var SearchSvg = {
166
+ name: 'SearchSvg',
167
+ props: ['styles'],
168
+ render: function render() {
169
+ return vue.createVNode("svg", {
170
+ "alt": "Search",
171
+ "class": "search-icon",
172
+ "height": "12",
173
+ "xmlns": "http://www.w3.org/2000/svg",
174
+ "viewBox": "0 0 15 15",
175
+ "style": _rollupPluginBabelHelpers._extends({
176
+ transform: 'scale(1.35)',
177
+ position: 'relative'
178
+ }, this.$props.styles ? this.$props.styles : {})
179
+ }, [vue.createVNode("title", null, [vue.createTextVNode("Search")]), vue.createVNode("path", {
180
+ "d": 'M6.02945,10.20327a4.17382,4.17382,0,1,1,4.17382-4.17382A4.15609,4.15609,0,0,1,6.02945,10.20327Zm9.69195,4.2199L10.8989,9.59979A5.88021,5.88021,0,0,0,12.058,6.02856,6.00467,6.00467,0,1,0,9.59979,10.8989l4.82338,4.82338a.89729.89729,0,0,0,1.29912,0,.89749.89749,0,0,0-.00087-1.29909Z'
181
+ }, null)]);
182
+ }
183
+ };
184
+
185
+ var _templateObject$3;
186
+
187
+ // eslint-disable-next-line
188
+ vueEmotion.createGlobalStyle(_templateObject$3 || (_templateObject$3 = _rollupPluginBabelHelpers._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"])));
189
+ var MicSvg = {
190
+ name: 'MicSvg',
191
+ props: ['className'],
192
+ render: function render() {
193
+ return vue.createVNode("svg", {
194
+ "viewBox": "0 0 480 480",
195
+ "xmlns": "http://www.w3.org/2000/svg",
196
+ "id": "el_xS0FRzQjJ",
197
+ "width": 28,
198
+ "height": 28,
199
+ "className": this.$props.className,
200
+ "style": {
201
+ transform: 'scale(1.5)'
202
+ }
203
+ }, [vue.createVNode("g", {
204
+ "id": "el_TvxDfTAtKp",
205
+ "fillRule": "evenodd"
206
+ }, [vue.createVNode("g", {
207
+ "id": "el_D93PK3GbmJ",
208
+ "fillRule": "nonzero",
209
+ "style": {
210
+ fill: '#595959'
211
+ }
212
+ }, [vue.createVNode("path", {
213
+ "d": "M142.731204,111 C137.280427,111 132.719573,114.852 131.82965,120.095 C127.268796,145.24 104.464526,164.5 76.9881611,164.5 C49.5117965,164.5 26.7075263,145.24 22.1466723,120.095 C21.2567496,114.852 16.6958955,111 11.2451187,111 C4.45945784,111 -0.880078594,116.778 0.121084488,123.198 C5.57186127,155.298 32.2695435,180.443 65.8641269,185.044 L65.8641269,207.3 C65.8641269,213.185 70.8699423,218 76.9881611,218 C83.10638,218 88.1121954,213.185 88.1121954,207.3 L88.1121954,185.044 C121.706779,180.443 148.404461,155.298 153.855238,123.198 C154.967641,116.778 149.516864,111 142.731204,111 Z",
214
+ "id": "el_uly3EwA2O3"
215
+ }, null), vue.createVNode("path", {
216
+ "d": "M76.9864699,147.789474 C98.090352,147.789474 115.126016,131.286316 115.126016,110.842105 L115.126016,36.9473684 C115.126016,16.5031579 98.090352,-2.84217094e-14 76.9864699,-2.84217094e-14 C55.8825877,-2.84217094e-14 38.8469239,16.5031579 38.8469239,36.9473684 L38.8469239,110.842105 C38.8469239,131.286316 55.8825877,147.789474 76.9864699,147.789474 Z",
217
+ "id": "el_tnDbR4ytu4"
218
+ }, null)])])]);
219
+ }
220
+ };
221
+
222
+ var _templateObject$4;
223
+
224
+ // eslint-disable-next-line
225
+ vueEmotion.createGlobalStyle(_templateObject$4 || (_templateObject$4 = _rollupPluginBabelHelpers._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"])));
226
+ var MuteSvg = {
227
+ name: 'MuteSvg',
228
+ props: ['className'],
229
+ render: function render() {
230
+ return vue.createVNode("svg", {
231
+ "style": {
232
+ transform: 'scale(1.5)'
233
+ },
234
+ "viewBox": "0 0 480 480",
235
+ "xmlns": "http://www.w3.org/2000/svg",
236
+ "id": "el_D1rEpH2zj",
237
+ "width": 28,
238
+ "height": 28,
239
+ "className": this.$props.className
240
+ }, [vue.createVNode("g", {
241
+ "id": "el_X81iT9kZYo",
242
+ "fillRule": "evenodd"
243
+ }, [vue.createVNode("g", {
244
+ "id": "el_gMpyalCphp"
245
+ }, [vue.createVNode("path", {
246
+ "d": "M142.731204,111 C137.280427,111 132.719573,114.852 131.82965,120.095 C127.268796,145.24 104.464526,164.5 76.9881611,164.5 C49.5117965,164.5 26.7075263,145.24 22.1466723,120.095 C21.2567496,114.852 16.6958955,111 11.2451187,111 C4.45945784,111 -0.880078594,116.778 0.121084488,123.198 C5.57186127,155.298 32.2695435,180.443 65.8641269,185.044 L65.8641269,207.3 C65.8641269,213.185 70.8699423,218 76.9881611,218 C83.10638,218 88.1121954,213.185 88.1121954,207.3 L88.1121954,185.044 C121.706779,180.443 148.404461,155.298 153.855238,123.198 C154.967641,116.778 149.516864,111 142.731204,111 Z",
247
+ "id": "el_c7H-3u-D4l",
248
+ "fillRule": "nonzero",
249
+ "style": {
250
+ fill: '#595959'
251
+ }
252
+ }, null), vue.createVNode("path", {
253
+ "d": "M76.9864699,147.789474 C98.090352,147.789474 115.126016,131.286316 115.126016,110.842105 L115.126016,36.9473684 C115.126016,16.5031579 98.090352,-2.84217094e-14 76.9864699,-2.84217094e-14 C55.8825877,-2.84217094e-14 38.8469239,16.5031579 38.8469239,36.9473684 L38.8469239,110.842105 C38.8469239,131.286316 55.8825877,147.789474 76.9864699,147.789474 Z",
254
+ "id": "el_qhFcdAAFwo",
255
+ "fillRule": "nonzero",
256
+ "style": {
257
+ fill: '#595959'
258
+ }
259
+ }, null), vue.createVNode("path", {
260
+ "d": "M11.5,206.5 L142.5,12.5",
261
+ "id": "el_M8X8g37WOI",
262
+ "strokeLinecap": "round",
263
+ "strokeLinejoin": "round"
264
+ }, null)])])]);
265
+ }
266
+ };
267
+
268
+ var _templateObject$5;
269
+
270
+ // eslint-disable-next-line
271
+ vueEmotion.createGlobalStyle(_templateObject$5 || (_templateObject$5 = _rollupPluginBabelHelpers._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"])));
272
+ var ListenSvg = {
273
+ name: 'ListenSvg',
274
+ props: ['className'],
275
+ render: function render() {
276
+ return vue.createVNode("svg", {
277
+ "viewBox": "0 0 480 480",
278
+ "xmlns": "http://www.w3.org/2000/svg",
279
+ "xmlnsXlink": "http://www.w3.org/1999/xlink",
280
+ "id": "el_hiibMG0x-",
281
+ "width": 28,
282
+ "height": 29,
283
+ "className": this.$props.className,
284
+ "style": {
285
+ transform: 'scale(1.5)'
286
+ }
287
+ }, [vue.createVNode("defs", null, [vue.createVNode("path", {
288
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
289
+ "id": "path-1"
290
+ }, null), vue.createVNode("path", {
291
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
292
+ "id": "path-3"
293
+ }, null), vue.createVNode("path", {
294
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
295
+ "id": "path-5"
296
+ }, null), vue.createVNode("path", {
297
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
298
+ "id": "path-7"
299
+ }, null), vue.createVNode("path", {
300
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
301
+ "id": "path-9"
302
+ }, null), vue.createVNode("path", {
303
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
304
+ "id": "path-11"
305
+ }, null), vue.createVNode("path", {
306
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
307
+ "id": "path-13"
308
+ }, null), vue.createVNode("path", {
309
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
310
+ "id": "path-15"
311
+ }, null)]), vue.createVNode("g", {
312
+ "id": "el_QJeJ_2CDw5",
313
+ "fillRule": "evenodd"
314
+ }, [vue.createVNode("g", {
315
+ "id": "el_UYYCfubTRf"
316
+ }, [vue.createVNode("path", {
317
+ "d": "M142.731204,111 C137.280427,111 132.719573,114.852 131.82965,120.095 C127.268796,145.24 104.464526,164.5 76.9881611,164.5 C49.5117965,164.5 26.7075263,145.24 22.1466723,120.095 C21.2567496,114.852 16.6958955,111 11.2451187,111 C4.45945784,111 -0.880078594,116.778 0.121084488,123.198 C5.57186127,155.298 32.2695435,180.443 65.8641269,185.044 L65.8641269,207.3 C65.8641269,213.185 70.8699423,218 76.9881611,218 C83.10638,218 88.1121954,213.185 88.1121954,207.3 L88.1121954,185.044 C121.706779,180.443 148.404461,155.298 153.855238,123.198 C154.967641,116.778 149.516864,111 142.731204,111 Z",
318
+ "id": "el_uzZNtK32Zi",
319
+ "fillRule": "nonzero",
320
+ "style": {
321
+ fill: '#0B6AFF'
322
+ }
323
+ }, null), vue.createVNode("path", {
324
+ "d": "M76.9864699,147.789474 C98.090352,147.789474 115.126016,131.286316 115.126016,110.842105 L115.126016,36.9473684 C115.126016,16.5031579 98.090352,0 76.9864699,0 C55.8825877,0 38.8469239,16.5031579 38.8469239,36.9473684 L38.8469239,110.842105 C38.8469239,131.286316 55.8825877,147.789474 76.9864699,147.789474 Z",
325
+ "id": "el_EYKQ2N9Kgy",
326
+ "fillRule": "nonzero"
327
+ }, null), vue.createVNode("g", {
328
+ "id": "el_6SDP2LAgKC"
329
+ }, [vue.createVNode("mask", {
330
+ "id": "mask-2",
331
+ "fill": "#fff"
332
+ }, [vue.createVNode("use", {
333
+ "xlink:href": "#path-1"
334
+ }, null)]), vue.createVNode("path", {
335
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
336
+ "id": "el_-Vm65Ltfy7",
337
+ "fillRule": "nonzero",
338
+ "mask": "url(#mask-2)"
339
+ }, null), vue.createVNode("rect", {
340
+ "id": "el_q04iZcSim4",
341
+ "mask": "url(#mask-2)",
342
+ "x": "0.279",
343
+ "width": "77",
344
+ "height": "130"
345
+ }, null)]), vue.createVNode("g", {
346
+ "id": "el_6WKby7wXqV"
347
+ }, [vue.createVNode("mask", {
348
+ "id": "mask-4",
349
+ "fill": "#fff"
350
+ }, [vue.createVNode("use", {
351
+ "xlink:href": "#path-3"
352
+ }, null)]), vue.createVNode("path", {
353
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
354
+ "id": "el_9bggsfQOtU",
355
+ "fillRule": "nonzero",
356
+ "mask": "url(#mask-4)"
357
+ }, null), vue.createVNode("rect", {
358
+ "id": "el_NKxqi9eIym",
359
+ "mask": "url(#mask-4)",
360
+ "x": "0.279",
361
+ "width": "77",
362
+ "height": "115"
363
+ }, null)]), vue.createVNode("g", {
364
+ "id": "el_Wi-my975tM"
365
+ }, [vue.createVNode("mask", {
366
+ "id": "mask-6",
367
+ "fill": "#fff"
368
+ }, [vue.createVNode("use", {
369
+ "xlink:href": "#path-5"
370
+ }, null)]), vue.createVNode("path", {
371
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
372
+ "id": "el_zclQ34fvf7",
373
+ "fillRule": "nonzero",
374
+ "mask": "url(#mask-6)"
375
+ }, null), vue.createVNode("rect", {
376
+ "id": "el_1OsvRT8HkeZ",
377
+ "mask": "url(#mask-6)",
378
+ "x": "0.279",
379
+ "width": "77",
380
+ "height": "100"
381
+ }, null)]), vue.createVNode("g", {
382
+ "id": "el_DkfFFTaFxy8"
383
+ }, [vue.createVNode("mask", {
384
+ "id": "mask-8",
385
+ "fill": "#fff"
386
+ }, [vue.createVNode("use", {
387
+ "xlink:href": "#path-7"
388
+ }, null)]), vue.createVNode("path", {
389
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
390
+ "id": "el_aa9sjx4H0vA",
391
+ "fillRule": "nonzero",
392
+ "mask": "url(#mask-8)"
393
+ }, null), vue.createVNode("rect", {
394
+ "id": "el_tea114vWg0J",
395
+ "mask": "url(#mask-8)",
396
+ "x": "0.279",
397
+ "width": "77",
398
+ "height": "85"
399
+ }, null)]), vue.createVNode("g", {
400
+ "id": "el_34IgwiMB5rf"
401
+ }, [vue.createVNode("mask", {
402
+ "id": "mask-10",
403
+ "fill": "#fff"
404
+ }, [vue.createVNode("use", {
405
+ "xlink:href": "#path-9"
406
+ }, null)]), vue.createVNode("path", {
407
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
408
+ "id": "el_z5u6RAFhx7d",
409
+ "fillRule": "nonzero",
410
+ "mask": "url(#mask-10)"
411
+ }, null), vue.createVNode("rect", {
412
+ "id": "el_7nfuWmA5Uhy",
413
+ "mask": "url(#mask-10)",
414
+ "x": "0.279",
415
+ "width": "77",
416
+ "height": "70"
417
+ }, null)]), vue.createVNode("g", {
418
+ "id": "el_DeebuCsPTGA"
419
+ }, [vue.createVNode("mask", {
420
+ "id": "mask-12",
421
+ "fill": "#fff"
422
+ }, [vue.createVNode("use", {
423
+ "xlink:href": "#path-11"
424
+ }, null)]), vue.createVNode("path", {
425
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
426
+ "id": "el__ZcqlS20zcw",
427
+ "fillRule": "nonzero",
428
+ "mask": "url(#mask-12)"
429
+ }, null), vue.createVNode("rect", {
430
+ "id": "el_8DnEQnD7VWV",
431
+ "mask": "url(#mask-12)",
432
+ "x": "0.279",
433
+ "width": "77",
434
+ "height": "55"
435
+ }, null)]), vue.createVNode("g", {
436
+ "id": "el_ZOjjrPTvyrv"
437
+ }, [vue.createVNode("mask", {
438
+ "id": "mask-14",
439
+ "fill": "#fff"
440
+ }, [vue.createVNode("use", {
441
+ "xlink:href": "#path-13"
442
+ }, null)]), vue.createVNode("path", {
443
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
444
+ "id": "el_FYYKCI_u24e",
445
+ "fillRule": "nonzero",
446
+ "mask": "url(#mask-14)"
447
+ }, null), vue.createVNode("rect", {
448
+ "id": "el_XZty4MnTp5Y",
449
+ "mask": "url(#mask-14)",
450
+ "x": "0.279",
451
+ "width": "77",
452
+ "height": "40"
453
+ }, null)]), vue.createVNode("g", {
454
+ "id": "el_2FATegVmf0K"
455
+ }, [vue.createVNode("mask", {
456
+ "id": "mask-16",
457
+ "fill": "#fff"
458
+ }, [vue.createVNode("use", {
459
+ "xlink:href": "#path-15"
460
+ }, null)]), vue.createVNode("path", {
461
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
462
+ "id": "el_RMT1KUfbdF8",
463
+ "fillRule": "nonzero",
464
+ "mask": "url(#mask-16)"
465
+ }, null), vue.createVNode("rect", {
466
+ "id": "el_RgLcovvFiO1",
467
+ "mask": "url(#mask-16)",
468
+ "x": "0.279",
469
+ "width": "77",
470
+ "height": "25"
471
+ }, null)])])])]);
472
+ }
473
+ };
474
+
475
+ var STATUS = {
476
+ inactive: 'INACTIVE',
477
+ stopped: 'STOPPED',
478
+ active: 'ACTIVE',
479
+ denied: 'DENIED'
480
+ };
481
+ var Mic = {
482
+ name: 'Mic',
483
+ props: {
484
+ children: vueTypes.types.title,
485
+ lang: VueTypes.string.def('en-US'),
486
+ iconPosition: VueTypes.string.def('left'),
487
+ handleResult: vueTypes.types.func,
488
+ onNoMatch: vueTypes.types.func,
489
+ onError: vueTypes.types.func,
490
+ getInstance: vueTypes.types.func,
491
+ render: vueTypes.types.func,
492
+ className: vueTypes.types.string,
493
+ applyClearStyle: VueTypes.bool,
494
+ showIcon: VueTypes.bool
495
+ },
496
+ methods: {
497
+ getComponent: function getComponent() {
498
+ var status = this.$data.status;
499
+ var data = {
500
+ handleClick: this.handleClick,
501
+ status: status
502
+ };
503
+ return index.getComponent(data, this);
504
+ },
505
+ stopMic: function stopMic() {
506
+ if (this.instance) {
507
+ this.status = STATUS.inactive;
508
+ this.instance.stop();
509
+ this.instance = null;
510
+ }
511
+ },
512
+ handleClick: function handleClick() {
513
+ var _this = this;
514
+ this.results = [];
515
+ if (window && window.SpeechRecognition) {
516
+ var status = this.$data.status;
517
+ if (status === STATUS.active) {
518
+ this.status = STATUS.inactive;
519
+ }
520
+ var _this$$props = this.$props,
521
+ handleResult = _this$$props.handleResult,
522
+ onNoMatch = _this$$props.onNoMatch,
523
+ onError = _this$$props.onError,
524
+ lang = _this$$props.lang,
525
+ getInstance = _this$$props.getInstance;
526
+ var _window = window,
527
+ SpeechRecognition = _window.SpeechRecognition;
528
+ if (this.instance && this.status !== STATUS.denied) {
529
+ this.status = STATUS.inactive;
530
+ this.instance.stop();
531
+ this.instance = null;
532
+ return;
533
+ }
534
+ this.instance = new SpeechRecognition();
535
+ this.instance.continuous = true;
536
+ this.instance.interimResults = true;
537
+ this.instance.lang = lang;
538
+ if (getInstance) {
539
+ getInstance(this.instance);
540
+ }
541
+ this.instance.start();
542
+ this.instance.onstart = function () {
543
+ _this.status = STATUS.active;
544
+ };
545
+ this.instance.onresult = function (_ref) {
546
+ var results = _ref.results,
547
+ timeStamp = _ref.timeStamp;
548
+ _this.stopMic();
549
+ if (handleResult) {
550
+ handleResult({
551
+ results: results,
552
+ timeStamp: timeStamp
553
+ });
554
+ }
555
+ _this.results.push({
556
+ results: results,
557
+ timeStamp: timeStamp
558
+ });
559
+ };
560
+ this.instance.onnomatch = function (e) {
561
+ return onNoMatch ? onNoMatch(e) : console.warn(e);
562
+ };
563
+ this.instance.onerror = function (e) {
564
+ if (e.error === 'no-speech' || e.error === 'audio-capture') {
565
+ _this.status = STATUS.inactive;
566
+ } else if (e.error === 'not-allowed') {
567
+ _this.status = STATUS.denied;
568
+ }
569
+ console.error(e);
570
+ if (onError) {
571
+ onError(e);
572
+ }
573
+ };
574
+
575
+ /* Below Two methods run when Continuous is False */
576
+ this.instance.onspeechend = function () {
577
+ _this.status = STATUS.inactive;
578
+ };
579
+ this.instance.onaudioend = function () {
580
+ _this.status = STATUS.inactive;
581
+ };
582
+ }
583
+ }
584
+ },
585
+ computed: {
586
+ hasCustomRenderer: function hasCustomRenderer() {
587
+ return index.hasCustomRenderer(this);
588
+ },
589
+ Icon: function Icon() {
590
+ var status = this.$data.status;
591
+ var className = this.$props.className;
592
+ switch (status) {
593
+ case STATUS.active:
594
+ return vue.createVNode(ListenSvg, {
595
+ "className": className,
596
+ "nativeOnClick": this.handleClick
597
+ }, null);
598
+ case STATUS.stopped:
599
+ case STATUS.denied:
600
+ return vue.createVNode(MuteSvg, {
601
+ "className": className,
602
+ "nativeOnClick": this.handleClick
603
+ }, null);
604
+ default:
605
+ return vue.createVNode(MicSvg, {
606
+ "className": className,
607
+ "nativeOnClick": this.handleClick
608
+ }, null);
609
+ }
610
+ }
611
+ },
612
+ data: function data() {
613
+ return {
614
+ status: STATUS.inactive
615
+ };
616
+ },
617
+ created: function created() {
618
+ this.results = [];
619
+ if (typeof window !== 'undefined') {
620
+ window.SpeechRecognition = window.webkitSpeechRecognition || window.SpeechRecognition || null;
621
+ if (!window.SpeechRecognition) {
622
+ console.error('SpeechRecognition is not supported in this browser. Please check the browser compatibility at https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition#Browser_compatibility.');
623
+ }
624
+ }
625
+ },
626
+ render: function render() {
627
+ var _this2 = this;
628
+ if (this.hasCustomRenderer) {
629
+ return this.getComponent();
630
+ }
631
+ return vue.createVNode(DropDown.IconWrapper, null, {
632
+ "default": function _default() {
633
+ return [_this2.Icon];
634
+ }
635
+ });
636
+ }
637
+ };
638
+
639
+ var CustomSvg = {
640
+ name: 'CustomSvg',
641
+ props: {
642
+ className: String,
643
+ icon: Function,
644
+ type: String
645
+ },
646
+ data: function data() {
647
+ return {
648
+ customIcon: this.$props.icon && typeof this.$props.icon === 'function' ? this.$props.icon() : null
649
+ };
650
+ },
651
+ render: function render() {
652
+ if (this.customIcon) {
653
+ return vue.createVNode("div", {
654
+ "class": this.$props.className
655
+ }, [this.customIcon]);
656
+ }
657
+ if (this.$props.type === 'recent-search-icon') {
658
+ return vue.createVNode("svg", {
659
+ "xmlns": "http://www.w3.org/2000/svg",
660
+ "alt": "Recent Search",
661
+ "height": "20",
662
+ "width": "20",
663
+ "viewBox": "0 0 24 24",
664
+ "style": {
665
+ fill: '#707070'
666
+ },
667
+ "class": this.$props.className
668
+ }, [vue.createVNode("path", {
669
+ "d": "M0 0h24v24H0z",
670
+ "fill": "none"
671
+ }, null), vue.createVNode("path", {
672
+ "d": "M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"
673
+ }, null)]);
674
+ }
675
+ if (this.$props.type === 'promoted-search-icon') {
676
+ return vue.createVNode("svg", {
677
+ "xmlns": "http://www.w3.org/2000/svg",
678
+ "width": "20",
679
+ "alt": "promoted search",
680
+ "height": "20",
681
+ "viewBox": "0 0 24 24",
682
+ "class": this.$props.className,
683
+ "style": {
684
+ fill: '#707070'
685
+ }
686
+ }, [vue.createVNode("path", {
687
+ "d": "M12 .587l3.668 7.568 8.332 1.151-6.064 5.828 1.48 8.279-7.416-3.967-7.417 3.967 1.481-8.279-6.064-5.828 8.332-1.151z"
688
+ }, null)]);
689
+ }
690
+ if (this.$props.type === 'popular-search-icon') {
691
+ return vue.createVNode("svg", {
692
+ "xmlns": "http://www.w3.org/2000/svg",
693
+ "alt": "Popular Search",
694
+ "height": "20",
695
+ "width": "20",
696
+ "viewBox": "0 0 24 24",
697
+ "style": {
698
+ fill: '#707070'
699
+ },
700
+ "class": this.$props.className
701
+ }, [vue.createVNode("path", {
702
+ "d": "M0 0h24v24H0z",
703
+ "fill": "none"
704
+ }, null), vue.createVNode("path", {
705
+ "d": "M16 6l2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"
706
+ }, null)]);
707
+ }
708
+ return vue.createVNode(SearchSvg, {
709
+ "styles": {
710
+ position: 'relative',
711
+ fill: '#707070',
712
+ left: '3px',
713
+ marginRight: '8px'
714
+ }
715
+ }, null);
716
+ }
717
+ };
718
+
719
+ var _templateObject$6;
720
+ var AutofillSvgIcon = vueEmotion.styled('button')(_templateObject$6 || (_templateObject$6 = _rollupPluginBabelHelpers._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"])));
721
+ var AutoFillSvg = {
722
+ name: 'AutoFillSvg',
723
+ render: function render() {
724
+ return vue.createVNode(AutofillSvgIcon, {
725
+ "onClick": this.$attrs.click
726
+ }, {
727
+ "default": function _default() {
728
+ return [vue.createVNode("svg", {
729
+ "viewBox": "0 0 24 24"
730
+ }, [vue.createVNode("path", {
731
+ "d": "M8 17v-7.586l8.293 8.293c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414l-8.293-8.293h7.586c0.552 0 1-0.448 1-1s-0.448-1-1-1h-10c-0.552 0-1 0.448-1 1v10c0 0.552 0.448 1 1 1s1-0.448 1-1z"
732
+ }, null)])];
733
+ }
734
+ });
735
+ },
736
+ methods: {
737
+ clicked: function clicked(e) {
738
+ e.stopPropagation();
739
+ window.console.log('hey', e);
740
+ }
741
+ }
742
+ };
743
+
744
+ var _templateObject$7, _templateObject2;
745
+ var TagsContainer = vueEmotion.styled('div')(_templateObject$7 || (_templateObject$7 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin-top: 10px;\n\twidth: 100%;\n"])));
746
+ var TagItem = vueEmotion.styled('span')(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers._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"])));
747
+
748
+ function _isSlot(s) {
749
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
750
+ }
751
+ var updateQuery = configureStore.Actions.updateQuery,
752
+ setCustomQuery = configureStore.Actions.setCustomQuery,
753
+ setDefaultQuery = configureStore.Actions.setDefaultQuery,
754
+ recordSuggestionClick = configureStore.Actions.recordSuggestionClick;
755
+ var _debounce = configureStore.helper.debounce,
756
+ checkValueChange = configureStore.helper.checkValueChange,
757
+ getClassName$1 = configureStore.helper.getClassName,
758
+ isEqual = configureStore.helper.isEqual,
759
+ getCompositeAggsQuery = configureStore.helper.getCompositeAggsQuery,
760
+ withClickIds = configureStore.helper.withClickIds,
761
+ getResultStats = configureStore.helper.getResultStats;
762
+ var SearchBox = vue.defineComponent({
763
+ name: 'SearchBox',
764
+ isTagsMode: false,
765
+ data: function data() {
766
+ var props = this.$props;
767
+ this.__state = {
768
+ currentValue: '',
769
+ selectedTags: [],
770
+ isOpen: false,
771
+ normalizedSuggestions: []
772
+ };
773
+ this.internalComponent = props.componentId + "__internal";
774
+ return this.__state;
775
+ },
776
+ inject: {
777
+ theme: {
778
+ from: 'theme_reactivesearch'
779
+ }
780
+ },
781
+ created: function created() {
782
+ var mode = this.$props.mode;
783
+ if (mode === constants.SEARCH_COMPONENTS_MODES.TAG) {
784
+ this.$options.isTagsMode = true;
785
+ }
786
+ if (this.$options.isTagsMode) {
787
+ console.warn('Warning(ReactiveSearch): The `categoryField` prop is not supported when `mode` prop is set to `tag`');
788
+ }
789
+ this.currentValue = index.decodeHtml(this.selectedValue || this.value || this.defaultValue || '');
790
+ if (this.$options.isTagsMode) {
791
+ this.currentValue = '';
792
+ }
793
+ this.handleTextChange = _debounce(this.handleText, this.$props.debounce);
794
+
795
+ // Set custom and default queries in store
796
+ this.triggerCustomQuery(this.currentValue, this.selectedCategory);
797
+ this.triggerDefaultQuery(this.currentValue);
798
+ },
799
+ computed: {
800
+ hasCustomRenderer: function hasCustomRenderer() {
801
+ return index.hasCustomRenderer(this);
802
+ },
803
+ stats: function stats() {
804
+ return getResultStats(this);
805
+ }
806
+ },
807
+ props: {
808
+ autoFocus: VueTypes.bool,
809
+ autosuggest: VueTypes.bool.def(true),
810
+ beforeValueChange: vueTypes.types.func,
811
+ className: VueTypes.string.def(''),
812
+ clearIcon: vueTypes.types.children,
813
+ componentId: vueTypes.types.stringRequired,
814
+ customHighlight: vueTypes.types.func,
815
+ customQuery: vueTypes.types.func,
816
+ defaultQuery: vueTypes.types.func,
817
+ dataField: VueTypes.oneOfType([VueTypes.string, VueTypes.shape({
818
+ field: VueTypes.string,
819
+ weight: VueTypes.number
820
+ }), VueTypes.arrayOf(VueTypes.string), VueTypes.arrayOf({
821
+ field: VueTypes.string,
822
+ weight: VueTypes.number
823
+ })]),
824
+ aggregationField: vueTypes.types.string,
825
+ aggregationSize: VueTypes.number,
826
+ size: VueTypes.number,
827
+ debounce: VueTypes.number.def(0),
828
+ defaultValue: vueTypes.types.string,
829
+ excludeFields: vueTypes.types.excludeFields,
830
+ value: VueTypes.oneOfType([VueTypes.arrayOf(VueTypes.string), vueTypes.types.value]),
831
+ defaultSuggestions: vueTypes.types.suggestions,
832
+ enableSynonyms: VueTypes.bool.def(true),
833
+ enableQuerySuggestions: VueTypes.bool.def(false),
834
+ enablePopularSuggestions: VueTypes.bool.def(false),
835
+ enableRecentSuggestions: VueTypes.bool.def(false),
836
+ fieldWeights: vueTypes.types.fieldWeights,
837
+ filterLabel: vueTypes.types.string,
838
+ fuzziness: vueTypes.types.fuzziness,
839
+ highlight: VueTypes.bool,
840
+ highlightField: vueTypes.types.stringOrArray,
841
+ icon: vueTypes.types.children,
842
+ iconPosition: VueTypes.oneOf(['left', 'right']).def('left'),
843
+ includeFields: vueTypes.types.includeFields,
844
+ innerClass: vueTypes.types.style,
845
+ innerRef: VueTypes.string.def('searchInputField'),
846
+ render: vueTypes.types.func,
847
+ renderNoSuggestion: vueTypes.types.title,
848
+ renderError: vueTypes.types.title,
849
+ placeholder: VueTypes.string.def('Search'),
850
+ queryFormat: VueTypes.oneOf(['and', 'or']).def('or'),
851
+ react: vueTypes.types.react,
852
+ showClear: VueTypes.bool.def(true),
853
+ showDistinctSuggestions: VueTypes.bool.def(true),
854
+ showFilter: VueTypes.bool.def(true),
855
+ showIcon: VueTypes.bool.def(true),
856
+ title: vueTypes.types.title,
857
+ theme: vueTypes.types.style,
858
+ URLParams: VueTypes.bool.def(false),
859
+ strictSelection: VueTypes.bool.def(false),
860
+ nestedField: vueTypes.types.string,
861
+ enablePredictiveSuggestions: VueTypes.bool.def(false),
862
+ recentSearchesIcon: VueTypes.any,
863
+ popularSearchesIcon: VueTypes.any,
864
+ // mic props
865
+ showVoiceSearch: VueTypes.bool.def(false),
866
+ getMicInstance: vueTypes.types.func,
867
+ renderMic: vueTypes.types.func,
868
+ distinctField: vueTypes.types.string,
869
+ distinctFieldConfig: vueTypes.types.props,
870
+ //
871
+ focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
872
+ addonBefore: VueTypes.any,
873
+ addonAfter: VueTypes.any,
874
+ expandSuggestionsContainer: VueTypes.bool.def(true),
875
+ index: VueTypes.string,
876
+ popularSuggestionsConfig: VueTypes.object,
877
+ recentSuggestionsConfig: VueTypes.object,
878
+ applyStopwords: VueTypes.bool,
879
+ customStopwords: vueTypes.types.stringArray,
880
+ onData: vueTypes.types.func,
881
+ renderItem: vueTypes.types.func,
882
+ enterButton: VueTypes.bool.def(false),
883
+ renderEnterButton: VueTypes.any,
884
+ mode: VueTypes.oneOf(['select', 'tag']).def('select'),
885
+ renderSelectedTags: VueTypes.any,
886
+ searchboxId: VueTypes.string,
887
+ endpoint: vueTypes.types.endpointConfig
888
+ },
889
+ beforeMount: function beforeMount() {
890
+ if (this.selectedValue) {
891
+ this.setValue(this.selectedValue, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
892
+ } else if (this.$props.value) {
893
+ this.setValue(this.$props.value, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
894
+ } else if (this.$props.defaultValue) {
895
+ this.setValue(this.$props.defaultValue, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
896
+ }
897
+ },
898
+ mounted: function mounted() {
899
+ this.listenForFocusShortcuts();
900
+ },
901
+ watch: {
902
+ dataField: function dataField(newVal, oldVal) {
903
+ if (!isEqual(newVal, oldVal)) {
904
+ this.triggerCustomQuery(this.$data.currentValue);
905
+ }
906
+ },
907
+ fieldWeights: function fieldWeights() {
908
+ this.triggerCustomQuery(this.$data.currentValue);
909
+ },
910
+ fuzziness: function fuzziness() {
911
+ this.triggerCustomQuery(this.$data.currentValue);
912
+ },
913
+ queryFormat: function queryFormat() {
914
+ this.triggerCustomQuery(this.$data.currentValue);
915
+ },
916
+ defaultValue: function defaultValue(newVal) {
917
+ this.setValue(newVal, true, this.$props);
918
+ },
919
+ value: function value(newVal, oldVal) {
920
+ if (!isEqual(newVal, oldVal)) {
921
+ this.setValue(newVal, true, this.$props, newVal === '' ? configureStore.causes.CLEAR_VALUE : undefined, false);
922
+ }
923
+ },
924
+ defaultQuery: function defaultQuery(newVal, oldVal) {
925
+ if (!index.isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
926
+ this.triggerDefaultQuery(this.$data.currentValue);
927
+ }
928
+ },
929
+ customQuery: function customQuery(newVal, oldVal) {
930
+ if (!index.isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
931
+ this.triggerCustomQuery(this.$data.currentValue);
932
+ }
933
+ },
934
+ suggestions: function suggestions(newVal) {
935
+ var suggestionsList = [];
936
+ if (Array.isArray(newVal) && newVal.length) {
937
+ suggestionsList = [].concat(withClickIds(newVal));
938
+ } else if (Array.isArray(this.$props.defaultSuggestions) && this.$props.defaultSuggestions.length) {
939
+ suggestionsList = [].concat(withClickIds(this.$props.defaultSuggestions));
940
+ }
941
+ this.normalizedSuggestions = suggestionsList;
942
+ },
943
+ selectedValue: function selectedValue(newVal, oldVal) {
944
+ if (!isEqual(newVal, oldVal) && (this.$options.isTagsMode ? !isEqual(this.$data.selectedTags, newVal) : this.$data.currentValue !== newVal)) {
945
+ if (!newVal && this.$data.currentValue) {
946
+ // selected value is cleared, call onValueSelected
947
+ this.onValueSelectedHandler('', configureStore.causes.CLEAR_VALUE);
948
+ }
949
+ if (this.$options.isTagsMode) {
950
+ // handling reset of tags through SelectedFilters or URL
951
+ this.selectedTags = [];
952
+ }
953
+ var cause = !newVal ? configureStore.causes.CLEAR_VALUE : undefined;
954
+ if (this.$options.isTagsMode) {
955
+ cause = configureStore.causes.SUGGESTION_SELECT;
956
+ }
957
+ this.setValue(newVal || '', true, this.$props, cause);
958
+ }
959
+ },
960
+ focusShortcuts: function focusShortcuts() {
961
+ this.listenForFocusShortcuts();
962
+ },
963
+ rawData: function rawData(newVal) {
964
+ this.$emit('on-data', {
965
+ data: this.normalizedSuggestions,
966
+ rawData: newVal,
967
+ aggregationData: this.aggregationData,
968
+ loading: this.isLoading,
969
+ error: this.isError
970
+ });
971
+ },
972
+ aggregationData: function aggregationData(newVal) {
973
+ this.$emit('on-data', {
974
+ data: this.normalizedSuggestions,
975
+ rawData: this.rawData,
976
+ aggregationData: newVal,
977
+ loading: this.isLoading,
978
+ error: this.isError
979
+ });
980
+ },
981
+ loading: function loading(newVal) {
982
+ this.$emit('on-data', {
983
+ data: this.normalizedSuggestions,
984
+ rawData: this.rawData,
985
+ aggregationData: this.aggregationData,
986
+ loading: newVal,
987
+ error: this.isError
988
+ });
989
+ },
990
+ error: function error(newVal) {
991
+ this.$emit('on-data', {
992
+ data: this.normalizedSuggestions,
993
+ rawData: this.rawData,
994
+ aggregationData: this.aggregationData,
995
+ loading: this.isLoading,
996
+ error: newVal
997
+ });
998
+ },
999
+ debounce: function debounce(newVal, oldVal) {
1000
+ if (!isEqual(newVal, oldVal)) {
1001
+ this.handleTextChange = _debounce(this.handleText, newVal);
1002
+ }
1003
+ }
1004
+ },
1005
+ methods: {
1006
+ handleText: function handleText(value, cause) {
1007
+ if (cause === configureStore.causes.CLEAR_VALUE) {
1008
+ this.triggerCustomQuery(value);
1009
+ this.triggerDefaultQuery(value);
1010
+ } else if (this.$props.autosuggest) {
1011
+ this.triggerDefaultQuery(value);
1012
+ } else if (!this.$props.enterButton) {
1013
+ this.triggerCustomQuery(value);
1014
+ }
1015
+ },
1016
+ getComponent: function getComponent(downshiftProps) {
1017
+ if (downshiftProps === void 0) {
1018
+ downshiftProps = {};
1019
+ }
1020
+ var currentValue = this.$data.currentValue;
1021
+ var data = {
1022
+ error: this.error,
1023
+ loading: this.isLoading,
1024
+ downshiftProps: downshiftProps,
1025
+ data: this.normalizedSuggestions,
1026
+ rawData: this.rawData,
1027
+ value: currentValue,
1028
+ resultStats: this.stats
1029
+ };
1030
+ return index.getComponent(data, this);
1031
+ },
1032
+ // returns size and aggs property
1033
+ getBasicQueryOptions: function getBasicQueryOptions() {
1034
+ var aggregationField = this.$props.aggregationField;
1035
+ var queryOptions = helper.getQueryOptions(this.$props);
1036
+ if (aggregationField) {
1037
+ queryOptions.aggs = getCompositeAggsQuery({
1038
+ props: this.$props,
1039
+ showTopHits: true
1040
+ }).aggs;
1041
+ }
1042
+ return queryOptions;
1043
+ },
1044
+ handleSearchIconClick: function handleSearchIconClick() {
1045
+ var currentValue = this.currentValue;
1046
+ if (currentValue.trim()) {
1047
+ this.setValue(currentValue, true);
1048
+ this.onValueSelectedHandler(currentValue, configureStore.causes.SEARCH_ICON_CLICK);
1049
+ }
1050
+ },
1051
+ setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue) {
1052
+ var _this = this;
1053
+ if (isDefaultValue === void 0) {
1054
+ isDefaultValue = false;
1055
+ }
1056
+ if (props === void 0) {
1057
+ props = this.$props;
1058
+ }
1059
+ if (toggleIsOpen === void 0) {
1060
+ toggleIsOpen = true;
1061
+ }
1062
+ if (categoryValue === void 0) {
1063
+ categoryValue = undefined;
1064
+ }
1065
+ var performUpdate = function performUpdate() {
1066
+ if (_this.$options.isTagsMode && isEqual(value, _this.selectedTags)) {
1067
+ return;
1068
+ }
1069
+ if (_this.$options.isTagsMode && cause === configureStore.causes.SUGGESTION_SELECT) {
1070
+ if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
1071
+ // check if value already present in selectedTags
1072
+ if (typeof value === 'string' && _this.selectedTags.includes(value)) {
1073
+ _this.isOpen = false;
1074
+ return;
1075
+ }
1076
+ _this.selectedTags = [].concat(_this.selectedTags);
1077
+ if (typeof value === 'string' && !!value) {
1078
+ _this.selectedTags.push(value);
1079
+ } else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
1080
+ _this.selectedTags = value;
1081
+ }
1082
+ } else if (value) {
1083
+ _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
1084
+ }
1085
+ _this.currentValue = '';
1086
+ } else {
1087
+ _this.currentValue = index.decodeHtml(value);
1088
+ }
1089
+ var queryHandlerValue = value;
1090
+ if (_this.$options.isTagsMode && cause === configureStore.causes.SUGGESTION_SELECT) {
1091
+ queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
1092
+ }
1093
+ if (isDefaultValue) {
1094
+ if (_this.$props.autosuggest) {
1095
+ if (toggleIsOpen) {
1096
+ _this.isOpen = false;
1097
+ }
1098
+ if (typeof _this.currentValue === 'string') _this.triggerDefaultQuery(_this.currentValue);
1099
+ } // in case of strict selection only SUGGESTION_SELECT should be able
1100
+ // to set the query otherwise the value should reset
1101
+ if (props.strictSelection) {
1102
+ if (cause === configureStore.causes.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
1103
+ _this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
1104
+ } else {
1105
+ _this.setValue('', true);
1106
+ }
1107
+ } else if (props.value === undefined || cause === configureStore.causes.SUGGESTION_SELECT || cause === configureStore.causes.CLEAR_VALUE) {
1108
+ _this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
1109
+ }
1110
+ } else {
1111
+ // debounce for handling text while typing
1112
+ _this.handleTextChange(value, cause);
1113
+ }
1114
+ _this.$emit('valueChange', value);
1115
+ _this.$emit('value-change', value);
1116
+ };
1117
+ checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
1118
+ },
1119
+ triggerDefaultQuery: function triggerDefaultQuery(paramValue) {
1120
+ if (!this.$props.autosuggest) {
1121
+ return;
1122
+ }
1123
+ var value = typeof paramValue !== 'string' ? this.currentValue : paramValue;
1124
+ var query = SearchBox.defaultQuery(value, this.$props);
1125
+ if (this.defaultQuery) {
1126
+ var defaultQueryToBeSet = this.defaultQuery(value, this.$props) || {};
1127
+ if (defaultQueryToBeSet.query) {
1128
+ query = defaultQueryToBeSet.query;
1129
+ }
1130
+
1131
+ // Update calculated default query in store
1132
+ index.updateDefaultQuery(this.$props.componentId, this.setDefaultQuery, this.$props, value);
1133
+ }
1134
+ this.updateQuery({
1135
+ componentId: this.internalComponent,
1136
+ query: query,
1137
+ value: value,
1138
+ componentType: constants.componentTypes.searchBox
1139
+ });
1140
+ },
1141
+ triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue) {
1142
+ if (categoryValue === void 0) {
1143
+ categoryValue = undefined;
1144
+ }
1145
+ var _this$$props = this.$props,
1146
+ customQuery = _this$$props.customQuery,
1147
+ filterLabel = _this$$props.filterLabel,
1148
+ showFilter = _this$$props.showFilter,
1149
+ URLParams = _this$$props.URLParams;
1150
+ var value = typeof paramValue !== 'string' ? this.$data.currentValue : paramValue;
1151
+ if (this.$options.isTagsMode) {
1152
+ value = paramValue;
1153
+ }
1154
+ var defaultQueryTobeSet = SearchBox.defaultQuery("" + value + (categoryValue ? " in " + categoryValue : ''), this.$props);
1155
+ var query = defaultQueryTobeSet;
1156
+ if (customQuery) {
1157
+ var customQueryTobeSet = customQuery(value, this.$props);
1158
+ var queryTobeSet = customQueryTobeSet.query;
1159
+ if (queryTobeSet) {
1160
+ query = queryTobeSet;
1161
+ }
1162
+ index.updateCustomQuery(this.$props.componentId, this.setCustomQuery, this.$props, value);
1163
+ }
1164
+ this.updateQuery({
1165
+ componentId: this.$props.componentId,
1166
+ query: query,
1167
+ value: value,
1168
+ label: filterLabel,
1169
+ showFilter: showFilter,
1170
+ URLParams: URLParams,
1171
+ componentType: constants.componentTypes.searchBox,
1172
+ category: categoryValue
1173
+ });
1174
+ },
1175
+ handleFocus: function handleFocus(event) {
1176
+ if (this.$props.autosuggest) {
1177
+ this.isOpen = true;
1178
+ }
1179
+ this.$emit('focus', event);
1180
+ },
1181
+ handleVoiceResults: function handleVoiceResults(_ref) {
1182
+ var results = _ref.results;
1183
+ if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
1184
+ this.setValue(results[0][0].transcript.trim(), true);
1185
+ }
1186
+ },
1187
+ triggerQuery: function triggerQuery(_ref2) {
1188
+ var _ref2$isOpen = _ref2.isOpen,
1189
+ isOpen = _ref2$isOpen === void 0 ? undefined : _ref2$isOpen,
1190
+ _ref2$customQuery = _ref2.customQuery,
1191
+ customQuery = _ref2$customQuery === void 0 ? true : _ref2$customQuery,
1192
+ _ref2$defaultQuery = _ref2.defaultQuery,
1193
+ defaultQuery = _ref2$defaultQuery === void 0 ? true : _ref2$defaultQuery,
1194
+ _ref2$value = _ref2.value,
1195
+ value = _ref2$value === void 0 ? undefined : _ref2$value,
1196
+ _ref2$categoryValue = _ref2.categoryValue,
1197
+ categoryValue = _ref2$categoryValue === void 0 ? undefined : _ref2$categoryValue;
1198
+ if (typeof isOpen === 'boolean') {
1199
+ this.isOpen = isOpen;
1200
+ }
1201
+ if (customQuery) {
1202
+ this.triggerCustomQuery(value, categoryValue);
1203
+ }
1204
+ if (defaultQuery) {
1205
+ this.triggerDefaultQuery(value);
1206
+ }
1207
+ },
1208
+ triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
1209
+ // click analytics would only work client side and after javascript loads
1210
+ var docId = documentId;
1211
+ if (!docId) {
1212
+ var hitData = this.normalizedSuggestions.find(function (hit) {
1213
+ return hit._click_id === searchPosition;
1214
+ });
1215
+ if (hitData && hitData.source && hitData.source._id) {
1216
+ docId = hitData.source._id;
1217
+ }
1218
+ }
1219
+ this.recordSuggestionClick(searchPosition, docId);
1220
+ },
1221
+ clearValue: function clearValue() {
1222
+ this.setValue('', false, this.$props, configureStore.causes.CLEAR_VALUE, false);
1223
+ this.onValueSelectedHandler('', configureStore.causes.CLEAR_VALUE);
1224
+ },
1225
+ handleKeyDown: function handleKeyDown(event, highlightedIndex) {
1226
+ if (highlightedIndex === void 0) {
1227
+ highlightedIndex = null;
1228
+ }
1229
+ // if a suggestion was selected, delegate the handling to suggestion handler
1230
+ if (event.key === 'Enter') {
1231
+ if (this.$props.autosuggest === false) {
1232
+ this.enterButtonOnClick();
1233
+ } else if (highlightedIndex === null) {
1234
+ this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined // to handle tags
1235
+ );
1236
+
1237
+ this.onValueSelectedHandler(event.target.value, configureStore.causes.ENTER_PRESS);
1238
+ }
1239
+ }
1240
+
1241
+ // Need to review
1242
+ this.$emit('keyDown', event, this.triggerQuery);
1243
+ this.$emit('key-down', event, this.triggerQuery);
1244
+ },
1245
+ onInputChange: function onInputChange(e) {
1246
+ var _this2 = this;
1247
+ var inputValue = e.target.value;
1248
+ if (!this.$data.isOpen && this.$props.autosuggest) {
1249
+ this.isOpen = true;
1250
+ }
1251
+ var value = this.$props.value;
1252
+ if (value === undefined) {
1253
+ this.setValue(inputValue, false, this.$props, inputValue === '' ? configureStore.causes.CLEAR_VALUE : undefined);
1254
+ } else {
1255
+ this.$emit('change', inputValue, function (_ref3) {
1256
+ var isOpen = _ref3.isOpen;
1257
+ return _this2.triggerQuery({
1258
+ defaultQuery: true,
1259
+ customQuery: true,
1260
+ value: inputValue,
1261
+ isOpen: isOpen
1262
+ });
1263
+ }, e);
1264
+ }
1265
+ },
1266
+ onSuggestionSelected: function onSuggestionSelected(suggestion) {
1267
+ var _this3 = this;
1268
+ this.isOpen = false;
1269
+ var value = this.$props.value;
1270
+ // Record analytics for selected suggestions
1271
+ this.triggerClickAnalytics(suggestion._click_id);
1272
+ if (value === undefined) {
1273
+ this.setValue(suggestion.value, true, this.$props, configureStore.causes.SUGGESTION_SELECT, false, suggestion._category);
1274
+ } else {
1275
+ var emitValue = suggestion.value;
1276
+ if (this.$options.isTagsMode) {
1277
+ emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
1278
+ if (this.selectedTags.includes(suggestion.value)) {
1279
+ // avoid duplicates in tags array
1280
+ this.isOpen = false;
1281
+ return;
1282
+ }
1283
+ emitValue.push(suggestion.value);
1284
+ }
1285
+ this.setValue(emitValue, true, this.$props, configureStore.causes.SUGGESTION_SELECT, false, suggestion._category);
1286
+ this.$emit('change', emitValue, function (_ref4) {
1287
+ var isOpen = _ref4.isOpen;
1288
+ return _this3.triggerQuery(_rollupPluginBabelHelpers._extends({
1289
+ isOpen: isOpen,
1290
+ value: emitValue
1291
+ }, !_this3.$options.isTagsMode && {
1292
+ categoryValue: suggestion._category
1293
+ }));
1294
+ });
1295
+ }
1296
+ this.onValueSelectedHandler(suggestion.value, configureStore.causes.SUGGESTION_SELECT, suggestion.source);
1297
+ },
1298
+ onValueSelectedHandler: function onValueSelectedHandler(currentValue) {
1299
+ if (currentValue === void 0) {
1300
+ currentValue = this.$data.currentValue;
1301
+ }
1302
+ for (var _len = arguments.length, cause = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1303
+ cause[_key - 1] = arguments[_key];
1304
+ }
1305
+ this.$emit.apply(this, ['valueSelected', currentValue].concat(cause));
1306
+ this.$emit.apply(this, ['value-selected', currentValue].concat(cause));
1307
+ },
1308
+ handleStateChange: function handleStateChange(changes) {
1309
+ var isOpen = changes.isOpen;
1310
+ this.isOpen = isOpen;
1311
+ },
1312
+ getBackgroundColor: function getBackgroundColor(highlightedIndex, index) {
1313
+ var isDark = this.themePreset === 'dark';
1314
+ if (isDark) {
1315
+ return highlightedIndex === index ? '#555' : '#424242';
1316
+ }
1317
+ return highlightedIndex === index ? '#eee' : '#fff';
1318
+ },
1319
+ renderIcon: function renderIcon() {
1320
+ if (this.$props.showIcon) {
1321
+ return this.$props.icon || vue.createVNode(SearchSvg, null, null);
1322
+ }
1323
+ return null;
1324
+ },
1325
+ renderErrorComponent: function renderErrorComponent() {
1326
+ var _this4 = this;
1327
+ var renderError = this.$slots.renderError || this.$props.renderError;
1328
+ if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
1329
+ return vue.createVNode(SuggestionWrapper, {
1330
+ "innerClass": this.$props.innerClass,
1331
+ "innerClassName": "error",
1332
+ "theme": this.theme,
1333
+ "themePreset": this.themePreset
1334
+ }, {
1335
+ "default": function _default() {
1336
+ return [index.isFunction(renderError) ? renderError(_this4.error) : renderError];
1337
+ }
1338
+ });
1339
+ }
1340
+ return null;
1341
+ },
1342
+ renderCancelIcon: function renderCancelIcon() {
1343
+ if (this.$props.showClear) {
1344
+ return this.$props.clearIcon || vue.createVNode(DropDown.CancelSvg, null, null);
1345
+ }
1346
+ return null;
1347
+ },
1348
+ renderNoSuggestions: function renderNoSuggestions(finalSuggestionsList) {
1349
+ if (finalSuggestionsList === void 0) {
1350
+ finalSuggestionsList = [];
1351
+ }
1352
+ var _this$$props2 = this.$props,
1353
+ theme = _this$$props2.theme,
1354
+ innerClass = _this$$props2.innerClass;
1355
+ var renderNoSuggestion = this.$slots.renderNoSuggestion || this.$props.renderNoSuggestion;
1356
+ var renderError = this.$slots.renderError || this.$props.renderError;
1357
+ var _this$$data = this.$data,
1358
+ isOpen = _this$$data.isOpen,
1359
+ currentValue = _this$$data.currentValue;
1360
+ if (renderNoSuggestion && isOpen && !finalSuggestionsList.length && !this.isLoading && currentValue && !(renderError && this.error)) {
1361
+ return vue.createVNode(SuggestionWrapper, {
1362
+ "innerClass": innerClass,
1363
+ "themePreset": this.themePreset,
1364
+ "theme": theme,
1365
+ "innerClassName": "noSuggestion"
1366
+ }, {
1367
+ "default": function _default() {
1368
+ return typeof renderNoSuggestion === 'function' ? renderNoSuggestion(currentValue) : renderNoSuggestion;
1369
+ }
1370
+ });
1371
+ }
1372
+ return null;
1373
+ },
1374
+ renderInputAddonBefore: function renderInputAddonBefore() {
1375
+ var addonBefore = this.$slots.addonBefore;
1376
+ if (addonBefore) {
1377
+ var _slot;
1378
+ return vue.createVNode(InputAddon, {
1379
+ "class": "addon-before"
1380
+ }, _isSlot(_slot = addonBefore()) ? _slot : {
1381
+ "default": function _default() {
1382
+ return [_slot];
1383
+ }
1384
+ });
1385
+ }
1386
+ return null;
1387
+ },
1388
+ renderInputAddonAfter: function renderInputAddonAfter() {
1389
+ var addonAfter = this.$slots.addonAfter;
1390
+ if (addonAfter) {
1391
+ var _slot2;
1392
+ return vue.createVNode(InputAddon, {
1393
+ "class": "addon-after"
1394
+ }, _isSlot(_slot2 = addonAfter()) ? _slot2 : {
1395
+ "default": function _default() {
1396
+ return [_slot2];
1397
+ }
1398
+ });
1399
+ }
1400
+ return null;
1401
+ },
1402
+ enterButtonOnClick: function enterButtonOnClick() {
1403
+ this.triggerQuery({
1404
+ isOpen: false,
1405
+ value: this.currentValue,
1406
+ customQuery: true
1407
+ });
1408
+ },
1409
+ renderEnterButtonElement: function renderEnterButtonElement() {
1410
+ var _this5 = this;
1411
+ var _this$$props3 = this.$props,
1412
+ enterButton = _this$$props3.enterButton,
1413
+ innerClass = _this$$props3.innerClass;
1414
+ var renderEnterButton = this.$slots.renderEnterButton;
1415
+ if (enterButton) {
1416
+ var getEnterButtonMarkup = function getEnterButtonMarkup() {
1417
+ if (renderEnterButton) {
1418
+ return renderEnterButton(_this5.enterButtonOnClick);
1419
+ }
1420
+ return vue.createVNode(Button.Button, {
1421
+ "class": "enter-btn " + getClassName$1(innerClass, 'enter-button'),
1422
+ "primary": true,
1423
+ "onClick": _this5.enterButtonOnClick
1424
+ }, {
1425
+ "default": function _default() {
1426
+ return [vue.createTextVNode("Search")];
1427
+ }
1428
+ });
1429
+ };
1430
+ return vue.createVNode("div", {
1431
+ "class": "enter-button-wrapper"
1432
+ }, [getEnterButtonMarkup()]);
1433
+ }
1434
+ return null;
1435
+ },
1436
+ renderIcons: function renderIcons() {
1437
+ var _this6 = this;
1438
+ var _slot3, _slot4, _slot5;
1439
+ var _this$$props4 = this.$props,
1440
+ iconPosition = _this$$props4.iconPosition,
1441
+ showClear = _this$$props4.showClear,
1442
+ innerClass = _this$$props4.innerClass,
1443
+ getMicInstance = _this$$props4.getMicInstance,
1444
+ showVoiceSearch = _this$$props4.showVoiceSearch,
1445
+ showIcon = _this$$props4.showIcon;
1446
+ var renderMic = this.$slots.renderMic || this.$props.renderMic;
1447
+ var currentValue = this.$data.currentValue;
1448
+ return vue.createVNode("div", null, [vue.createVNode(DropDown.IconGroup, {
1449
+ "groupPosition": "right",
1450
+ "positionType": "absolute"
1451
+ }, {
1452
+ "default": function _default() {
1453
+ return [currentValue && showClear && vue.createVNode(DropDown.IconWrapper, {
1454
+ "onClick": _this6.clearValue,
1455
+ "showIcon": showIcon,
1456
+ "isClearIcon": true
1457
+ }, _isSlot(_slot3 = _this6.renderCancelIcon()) ? _slot3 : {
1458
+ "default": function _default() {
1459
+ return [_slot3];
1460
+ }
1461
+ }), showVoiceSearch && vue.createVNode(Mic, {
1462
+ "getInstance": getMicInstance,
1463
+ "render": renderMic,
1464
+ "handleResult": _this6.handleVoiceResults,
1465
+ "className": getClassName$1(innerClass, 'mic') || null
1466
+ }, null), iconPosition === 'right' && showIcon && vue.createVNode(DropDown.IconWrapper, {
1467
+ "onClick": _this6.handleSearchIconClick
1468
+ }, _isSlot(_slot4 = _this6.renderIcon()) ? _slot4 : {
1469
+ "default": function _default() {
1470
+ return [_slot4];
1471
+ }
1472
+ })];
1473
+ }
1474
+ }), vue.createVNode(DropDown.IconGroup, {
1475
+ "groupPosition": "left",
1476
+ "positionType": "absolute"
1477
+ }, {
1478
+ "default": function _default() {
1479
+ return [iconPosition === 'left' && showIcon && vue.createVNode(DropDown.IconWrapper, {
1480
+ "onClick": _this6.handleSearchIconClick
1481
+ }, _isSlot(_slot5 = _this6.renderIcon()) ? _slot5 : {
1482
+ "default": function _default() {
1483
+ return [_slot5];
1484
+ }
1485
+ })];
1486
+ }
1487
+ })]);
1488
+ },
1489
+ focusSearchBox: function focusSearchBox(event) {
1490
+ var _this$$refs, _this$$refs$this$$pro;
1491
+ var elt = event.target || event.srcElement;
1492
+ var tagName = elt.tagName;
1493
+ if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
1494
+ // already in an input
1495
+ return;
1496
+ }
1497
+ (_this$$refs = this.$refs) == null ? void 0 : (_this$$refs$this$$pro = _this$$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs$this$$pro.focus(); // eslint-disable-line
1498
+ },
1499
+ listenForFocusShortcuts: function listenForFocusShortcuts() {
1500
+ var _this7 = this;
1501
+ var _this$$props$focusSho = this.$props.focusShortcuts,
1502
+ focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
1503
+ if (index.isEmpty(focusShortcuts)) {
1504
+ return;
1505
+ }
1506
+ var shortcutsString = index.parseFocusShortcuts(focusShortcuts).join(',');
1507
+
1508
+ // handler for alphabets and other key combinations
1509
+ hotkeys(shortcutsString,
1510
+ // eslint-disable-next-line no-unused-vars
1511
+ /* eslint-disable no-shadow */
1512
+ function (event, handler) {
1513
+ // Prevent the default refresh event under WINDOWS system
1514
+ event.preventDefault();
1515
+ _this7.focusSearchBox(event);
1516
+ });
1517
+
1518
+ // if one of modifier keys are used, they are handled below
1519
+ hotkeys('*', function (event) {
1520
+ var modifierKeys = index.extractModifierKeysFromFocusShortcuts(focusShortcuts);
1521
+ if (modifierKeys.length === 0) return;
1522
+ for (var index$1 = 0; index$1 < modifierKeys.length; index$1 += 1) {
1523
+ var element = modifierKeys[index$1];
1524
+ if (hotkeys[element]) {
1525
+ _this7.focusSearchBox(event);
1526
+ break;
1527
+ }
1528
+ }
1529
+ });
1530
+ },
1531
+ onAutofillClick: function onAutofillClick(suggestion) {
1532
+ var value = suggestion.value;
1533
+ this.isOpen = true;
1534
+ this.currentValue = index.decodeHtml(value);
1535
+ this.triggerDefaultQuery(value);
1536
+ },
1537
+ renderAutoFill: function renderAutoFill(suggestion) {
1538
+ var _this8 = this;
1539
+ var handleAutoFillClick = function handleAutoFillClick(e) {
1540
+ e.stopPropagation();
1541
+ _this8.onAutofillClick(suggestion);
1542
+ };
1543
+ /* 👇 avoid showing autofill for category suggestions👇 */
1544
+ return suggestion._category ? null : vue.createVNode(AutoFillSvg, {
1545
+ "onClick": handleAutoFillClick
1546
+ }, null);
1547
+ },
1548
+ renderTag: function renderTag(item) {
1549
+ var _this9 = this;
1550
+ var innerClass = this.$props.innerClass;
1551
+ return vue.createVNode(TagItem, {
1552
+ "class": getClassName$1(innerClass, 'selected-tag') || ''
1553
+ }, {
1554
+ "default": function _default() {
1555
+ return [vue.createVNode("span", null, [item]), vue.createVNode("span", {
1556
+ "role": "img",
1557
+ "aria-label": "delete-tag",
1558
+ "class": "close-icon",
1559
+ "onClick": function onClick() {
1560
+ return _this9.clearTag(item);
1561
+ }
1562
+ }, [vue.createVNode(DropDown.CancelSvg, null, null)])];
1563
+ }
1564
+ });
1565
+ },
1566
+ clearAllTags: function clearAllTags() {
1567
+ this.selectedTags = [];
1568
+ this.setValue('', true, this.$props, configureStore.causes.SUGGESTION_SELECT);
1569
+ if (this.$props.value !== undefined) {
1570
+ this.$emit('change', this.selectedTags, this.triggerQuery);
1571
+ }
1572
+ },
1573
+ clearTag: function clearTag(tagValue) {
1574
+ this.selectedTags = [].concat(this.selectedTags.filter(function (tag) {
1575
+ return tag !== tagValue;
1576
+ }));
1577
+ this.setValue('', true, this.$props, configureStore.causes.SUGGESTION_SELECT);
1578
+ if (this.$props.value !== undefined) {
1579
+ this.$emit('change', this.selectedTags, this.triggerQuery);
1580
+ }
1581
+ },
1582
+ renderTags: function renderTags() {
1583
+ var _this10 = this;
1584
+ if (!Array.isArray(this.selectedTags)) {
1585
+ return null;
1586
+ }
1587
+ var tagsList = [].concat(this.selectedTags);
1588
+ var shouldRenderClearAllTag = tagsList.length > 1;
1589
+ var renderSelectedTags = this.$slots.renderSelectedTags || this.$props.renderSelectedTags;
1590
+ return renderSelectedTags ? renderSelectedTags({
1591
+ values: this.selectedTags,
1592
+ handleClear: this.clearTag,
1593
+ handleClearAll: this.clearAllTags
1594
+ }) : vue.createVNode(TagsContainer, null, {
1595
+ "default": function _default() {
1596
+ return [tagsList.map(function (item) {
1597
+ return _this10.renderTag(item);
1598
+ }), shouldRenderClearAllTag && vue.createVNode(TagItem, {
1599
+ "class": getClassName$1(_this10.$props.innerClass, 'selected-tag') || ''
1600
+ }, {
1601
+ "default": function _default() {
1602
+ return [vue.createVNode("span", null, [vue.createTextVNode("Clear All")]), vue.createVNode("span", {
1603
+ "role": "img",
1604
+ "aria-label": "delete-tag",
1605
+ "class": "close-icon",
1606
+ "onClick": _this10.clearAllTags
1607
+ }, [vue.createVNode(DropDown.CancelSvg, null, null)])];
1608
+ }
1609
+ })];
1610
+ }
1611
+ });
1612
+ }
1613
+ },
1614
+ render: function render() {
1615
+ var _this11 = this;
1616
+ var _this$$props5 = this.$props,
1617
+ theme = _this$$props5.theme,
1618
+ expandSuggestionsContainer = _this$$props5.expandSuggestionsContainer;
1619
+ var _this$$slots = this.$slots,
1620
+ recentSearchesIcon = _this$$slots.recentSearchesIcon,
1621
+ popularSearchesIcon = _this$$slots.popularSearchesIcon;
1622
+ var hasSuggestions = Array.isArray(this.normalizedSuggestions) && this.normalizedSuggestions.length;
1623
+ var renderItem = this.$slots.renderItem || this.$props.renderItem;
1624
+ return vue.createVNode(Container.Container, {
1625
+ "class": this.$props.className
1626
+ }, {
1627
+ "default": function _default() {
1628
+ return [_this11.$props.title && vue.createVNode(Title.Title, {
1629
+ "class": getClassName$1(_this11.$props.innerClass, 'title') || ''
1630
+ }, {
1631
+ "default": function _default() {
1632
+ return [_this11.$props.title];
1633
+ }
1634
+ }), _this11.$props.autosuggest ? vue.createVNode(DropDown.Downshift, {
1635
+ "id": _this11.$props.componentId + "-downshift",
1636
+ "handleChange": _this11.onSuggestionSelected,
1637
+ "handleMouseup": _this11.handleStateChange,
1638
+ "isOpen": _this11.$data.isOpen
1639
+ }, {
1640
+ "default": function _default(_ref5) {
1641
+ var getInputEvents = _ref5.getInputEvents,
1642
+ getInputProps = _ref5.getInputProps,
1643
+ getItemProps = _ref5.getItemProps,
1644
+ getItemEvents = _ref5.getItemEvents,
1645
+ isOpen = _ref5.isOpen,
1646
+ highlightedIndex = _ref5.highlightedIndex,
1647
+ setHighlightedIndex = _ref5.setHighlightedIndex;
1648
+ var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
1649
+ var getIcon = function getIcon(iconType) {
1650
+ switch (iconType) {
1651
+ case helper.suggestionTypes.Recent:
1652
+ return recentSearchesIcon;
1653
+ case helper.suggestionTypes.Popular:
1654
+ return popularSearchesIcon;
1655
+ default:
1656
+ return null;
1657
+ }
1658
+ };
1659
+ return vue.createVNode("div", null, [_this11.hasCustomRenderer && _this11.getComponent({
1660
+ isOpen: isOpen,
1661
+ getItemProps: getItemProps,
1662
+ getItemEvents: getItemEvents,
1663
+ highlightedIndex: highlightedIndex
1664
+ }), _this11.renderErrorComponent(), !_this11.hasCustomRenderer && isOpen && hasSuggestions ? vue.createVNode("ul", {
1665
+ "class": Input.suggestions(_this11.themePreset, theme) + " " + getClassName$1(_this11.$props.innerClass, 'list')
1666
+ }, [_this11.normalizedSuggestions.map(function (item, index) {
1667
+ return renderItem ? vue.createVNode("li", vue.mergeProps(getItemProps({
1668
+ item: item
1669
+ }), getItemEvents({
1670
+ item: item
1671
+ }), {
1672
+ "key": index + 1 + "-" + item.value,
1673
+ "style": {
1674
+ backgroundColor: _this11.getBackgroundColor(highlightedIndex, index),
1675
+ justifyContent: 'flex-start',
1676
+ alignItems: 'center'
1677
+ }
1678
+ }), [renderItem(item)]) : vue.createVNode("li", vue.mergeProps(getItemProps({
1679
+ item: item
1680
+ }), _transformOn(getItemEvents({
1681
+ item: item
1682
+ })), {
1683
+ "key": index + 1 + "-" + item.value,
1684
+ "style": {
1685
+ backgroundColor: _this11.getBackgroundColor(highlightedIndex, index),
1686
+ justifyContent: 'flex-start',
1687
+ alignItems: 'center'
1688
+ }
1689
+ }), [vue.createVNode("div", {
1690
+ "style": {
1691
+ padding: '0 10px 0 0',
1692
+ display: 'flex'
1693
+ }
1694
+ }, [vue.createVNode(CustomSvg, {
1695
+ "className": getClassName$1(_this11.$props.innerClass, item._suggestion_type + "-search-icon") || null,
1696
+ "icon": getIcon(item._suggestion_type),
1697
+ "type": item._suggestion_type + "-search-icon"
1698
+ }, null)]), vue.createVNode(SuggestionItem, {
1699
+ "currentValue": _this11.currentValue,
1700
+ "suggestion": item
1701
+ }, null), _this11.renderAutoFill(item)]);
1702
+ })]) : _this11.renderNoSuggestions(_this11.normalizedSuggestions)]);
1703
+ };
1704
+ return vue.createVNode("div", {
1705
+ "class": Input.suggestionsContainer
1706
+ }, [vue.createVNode(InputGroup, null, {
1707
+ "default": function _default() {
1708
+ return [_this11.renderInputAddonBefore(), vue.createVNode(DropDown.InputWrapper, null, {
1709
+ "default": function _default() {
1710
+ return [vue.createVNode(Input.Input, vue.mergeProps(_transformOn(getInputEvents({
1711
+ onInput: _this11.onInputChange,
1712
+ onBlur: function onBlur(e) {
1713
+ _this11.$emit('blur', e, _this11.triggerQuery);
1714
+ },
1715
+ onFocus: _this11.handleFocus,
1716
+ onKeyPress: function onKeyPress(e) {
1717
+ _this11.$emit('keyPress', e, _this11.triggerQuery);
1718
+ _this11.$emit('key-press', e, _this11.triggerQuery);
1719
+ },
1720
+ onKeyDown: function onKeyDown(e) {
1721
+ return _this11.handleKeyDown(e, highlightedIndex);
1722
+ },
1723
+ onKeyUp: function onKeyUp(e) {
1724
+ _this11.$emit('keyUp', e, _this11.triggerQuery);
1725
+ _this11.$emit('key-up', e, _this11.triggerQuery);
1726
+ },
1727
+ onClick: function onClick() {
1728
+ setHighlightedIndex(null);
1729
+ }
1730
+ })), {
1731
+ "id": _this11.$props.componentId + "-input",
1732
+ "showIcon": _this11.$props.showIcon,
1733
+ "showClear": _this11.$props.showClear,
1734
+ "iconPosition": _this11.$props.iconPosition,
1735
+ "ref": _this11.$props.innerRef,
1736
+ "class": getClassName$1(_this11.$props.innerClass, 'input'),
1737
+ "placeholder": _this11.$props.placeholder,
1738
+ "autoFocus": _this11.$props.autoFocus
1739
+ }, getInputProps({
1740
+ value: _this11.$data.currentValue === null ? '' : _this11.$data.currentValue
1741
+ }), {
1742
+ "themePreset": _this11.themePreset,
1743
+ "autocomplete": "off"
1744
+ }), null), _this11.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()];
1745
+ }
1746
+ }), _this11.renderInputAddonAfter(), _this11.renderEnterButtonElement()];
1747
+ }
1748
+ }), expandSuggestionsContainer && renderSuggestionsDropdown(), _this11.renderTags()]);
1749
+ }
1750
+ }) : vue.createVNode("div", {
1751
+ "class": Input.suggestionsContainer
1752
+ }, [vue.createVNode(InputGroup, null, {
1753
+ "default": function _default() {
1754
+ return [_this11.renderInputAddonBefore(), vue.createVNode(DropDown.InputWrapper, null, {
1755
+ "default": function _default() {
1756
+ return [vue.createVNode(Input.Input, vue.mergeProps(_transformOn({
1757
+ blur: function blur(e) {
1758
+ _this11.$emit('blur', e, _this11.triggerQuery);
1759
+ },
1760
+ keypress: function keypress(e) {
1761
+ _this11.$emit('keyPress', e, _this11.triggerQuery);
1762
+ _this11.$emit('key-press', e, _this11.triggerQuery);
1763
+ },
1764
+ input: _this11.onInputChange,
1765
+ focus: function focus(e) {
1766
+ _this11.$emit('focus', e, _this11.triggerQuery);
1767
+ },
1768
+ keydown: _this11.handleKeyDown,
1769
+ keyup: function keyup(e) {
1770
+ _this11.$emit('keyUp', e, _this11.triggerQuery);
1771
+ _this11.$emit('key-up', e, _this11.triggerQuery);
1772
+ }
1773
+ }), {
1774
+ "class": getClassName$1(_this11.$props.innerClass, 'input') || '',
1775
+ "placeholder": _this11.$props.placeholder,
1776
+ "autofocus": _this11.$props.autoFocus,
1777
+ "value": _this11.$data.currentValue ? _this11.$data.currentValue : '',
1778
+ "iconPosition": _this11.$props.iconPosition,
1779
+ "showIcon": _this11.$props.showIcon,
1780
+ "showClear": _this11.$props.showClear,
1781
+ "ref": _this11.$props.innerRef,
1782
+ "themePreset": _this11.themePreset
1783
+ }), null), _this11.renderIcons()];
1784
+ }
1785
+ }), _this11.renderInputAddonAfter(), _this11.renderEnterButtonElement()];
1786
+ }
1787
+ })])];
1788
+ }
1789
+ });
1790
+ },
1791
+ destroyed: function destroyed() {
1792
+ document.removeEventListener('keydown', this.onKeyDown);
1793
+ }
1794
+ });
1795
+ SearchBox.defaultQuery = function (value, props) {
1796
+ var finalQuery = null;
1797
+ finalQuery = {
1798
+ bool: {
1799
+ should: SearchBox.shouldQuery(value, props),
1800
+ minimum_should_match: '1'
1801
+ }
1802
+ };
1803
+ if (finalQuery && props.nestedField) {
1804
+ return {
1805
+ query: {
1806
+ nested: {
1807
+ path: props.nestedField,
1808
+ query: finalQuery
1809
+ }
1810
+ }
1811
+ };
1812
+ }
1813
+ return finalQuery;
1814
+ };
1815
+ SearchBox.shouldQuery = function (value, props) {
1816
+ return {
1817
+ query: {
1818
+ queryFormat: props.queryFormat,
1819
+ dataField: props.dataField,
1820
+ value: value,
1821
+ nestedField: props.nestedField,
1822
+ queryString: props.queryString,
1823
+ searchOperators: props.searchOperators
1824
+ }
1825
+ };
1826
+ };
1827
+ var mapStateToProps = function mapStateToProps(state, props) {
1828
+ return {
1829
+ selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
1830
+ selectedCategory: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].category || null,
1831
+ suggestions: state.hits[props.componentId] && state.hits[props.componentId].hits,
1832
+ rawData: state.rawData[props.componentId],
1833
+ aggregationData: state.compositeAggregations[props.componentId] || [],
1834
+ themePreset: state.config.themePreset,
1835
+ isLoading: !!state.isLoading[props.componentId + "_active"],
1836
+ error: state.error[props.componentId],
1837
+ time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
1838
+ total: state.hits[props.componentId] && state.hits[props.componentId].total,
1839
+ hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden
1840
+ };
1841
+ };
1842
+ var mapDispatchToProps = {
1843
+ updateQuery: updateQuery,
1844
+ setCustomQuery: setCustomQuery,
1845
+ setDefaultQuery: setDefaultQuery,
1846
+ recordSuggestionClick: recordSuggestionClick
1847
+ };
1848
+ var SBConnected = PreferencesConsumer.PreferencesConsumer(ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps, mapDispatchToProps)(SearchBox), {
1849
+ componentType: constants.componentTypes.searchBox,
1850
+ internalComponent: true
1851
+ }));
1852
+ SBConnected.name = SearchBox.name;
1853
+ SBConnected.install = function (Vue) {
1854
+ Vue.component(SBConnected.name, SBConnected);
1855
+ };
1856
+ // Add componentType for SSR
1857
+ SBConnected.componentType = constants.componentTypes.searchBox;
1858
+
1859
+ var _excluded = ["options"];
1860
+ var updateQuery$1 = configureStore.Actions.updateQuery,
1861
+ setQueryOptions = configureStore.Actions.setQueryOptions,
1862
+ setCustomQuery$1 = configureStore.Actions.setCustomQuery,
1863
+ setDefaultQuery$1 = configureStore.Actions.setDefaultQuery;
1864
+ var parseHits = configureStore.helper.parseHits,
1865
+ isEqual$1 = configureStore.helper.isEqual,
1866
+ getCompositeAggsQuery$1 = configureStore.helper.getCompositeAggsQuery,
1867
+ getResultStats$1 = configureStore.helper.getResultStats,
1868
+ extractQueryFromCustomQuery = configureStore.helper.extractQueryFromCustomQuery,
1869
+ getOptionsForCustomQuery = configureStore.helper.getOptionsForCustomQuery;
1870
+ var ReactiveComponent = {
1871
+ name: 'ReactiveComponent',
1872
+ props: {
1873
+ componentId: vueTypes.types.stringRequired,
1874
+ aggregationField: vueTypes.types.string,
1875
+ aggregationSize: VueTypes.number,
1876
+ size: VueTypes.number,
1877
+ defaultQuery: vueTypes.types.func,
1878
+ customQuery: vueTypes.types.func,
1879
+ filterLabel: vueTypes.types.string,
1880
+ react: vueTypes.types.react,
1881
+ showFilter: VueTypes.bool.def(true),
1882
+ URLParams: VueTypes.bool.def(false),
1883
+ distinctField: vueTypes.types.string,
1884
+ distinctFieldConfig: vueTypes.types.props,
1885
+ index: VueTypes.string,
1886
+ endpoint: vueTypes.types.endpointConfig
1887
+ },
1888
+ created: function created() {
1889
+ var _this = this;
1890
+ var props = this.$props;
1891
+ this.internalComponent = null;
1892
+ this.$defaultQuery = null;
1893
+ // Set custom query in store
1894
+ index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
1895
+ var customQuery = props.customQuery,
1896
+ componentId = props.componentId,
1897
+ filterLabel = props.filterLabel,
1898
+ showFilter = props.showFilter,
1899
+ URLParams = props.URLParams;
1900
+ if (customQuery) {
1901
+ var calcCustomQuery = customQuery(this.selectedValue, props);
1902
+ var query = extractQueryFromCustomQuery(calcCustomQuery);
1903
+ var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery(calcCustomQuery) : null;
1904
+ if (customQueryOptions) {
1905
+ this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, customQueryOptions, this.getAggsQuery()), false);
1906
+ } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
1907
+ this.updateQuery({
1908
+ componentId: componentId,
1909
+ query: query,
1910
+ value: this.selectedValue || null,
1911
+ label: filterLabel,
1912
+ showFilter: showFilter,
1913
+ URLParams: URLParams
1914
+ });
1915
+ }
1916
+ this.setQuery = function (_ref) {
1917
+ var options = _ref.options,
1918
+ obj = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref, _excluded);
1919
+ var queryToBeSet = obj.query;
1920
+
1921
+ // when enableAppbase is true, Backend throws error because of repeated query in request body
1922
+ if (queryToBeSet && queryToBeSet.query) {
1923
+ queryToBeSet = queryToBeSet.query;
1924
+ }
1925
+ var customQueryCalc = _rollupPluginBabelHelpers._extends({}, options, {
1926
+ query: queryToBeSet
1927
+ });
1928
+ var rsAPIQuery = customQueryCalc;
1929
+ // handle stored queries
1930
+ if (queryToBeSet && queryToBeSet.id) {
1931
+ rsAPIQuery = queryToBeSet;
1932
+ }
1933
+ // Update customQuery field for RS API
1934
+ _this.setCustomQuery(props.componentId, rsAPIQuery);
1935
+ if (options) {
1936
+ _this.setQueryOptions(props.componentId, _rollupPluginBabelHelpers._extends({}, _this.getAggsQuery(), options), false);
1937
+ }
1938
+ _this.updateQuery(_rollupPluginBabelHelpers._extends({}, obj, {
1939
+ query: customQueryCalc.query,
1940
+ componentId: props.componentId,
1941
+ label: props.filterLabel,
1942
+ showFilter: props.showFilter,
1943
+ URLParams: props.URLParams
1944
+ }));
1945
+ };
1946
+ if (props.defaultQuery) {
1947
+ this.internalComponent = props.componentId + "__internal";
1948
+ }
1949
+ if (this.internalComponent && this.$props.defaultQuery) {
1950
+ index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
1951
+ this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
1952
+ var _query = extractQueryFromCustomQuery(this.$defaultQuery);
1953
+ var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
1954
+ if (queryOptions) {
1955
+ this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
1956
+ } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
1957
+ this.updateQuery({
1958
+ componentId: this.internalComponent,
1959
+ query: _query
1960
+ });
1961
+ }
1962
+ },
1963
+ watch: {
1964
+ hits: function hits(newVal, oldVal) {
1965
+ if (!isEqual$1(newVal, oldVal)) {
1966
+ this.$emit('data', this.getData());
1967
+ }
1968
+ },
1969
+ rawData: function rawData(newVal, oldVal) {
1970
+ if (!isEqual$1(newVal, oldVal)) {
1971
+ this.$emit('data', this.getData());
1972
+ }
1973
+ },
1974
+ aggregations: function aggregations(newVal, oldVal) {
1975
+ if (!isEqual$1(newVal, oldVal)) {
1976
+ this.$emit('data', this.getData());
1977
+ }
1978
+ },
1979
+ aggregationData: function aggregationData(newVal, oldVal) {
1980
+ if (!isEqual$1(newVal, oldVal)) {
1981
+ this.$emit('data', this.getData());
1982
+ }
1983
+ },
1984
+ promotedResults: function promotedResults(newVal, oldVal) {
1985
+ if (!isEqual$1(newVal, oldVal)) {
1986
+ this.$emit('data', this.getData());
1987
+ }
1988
+ },
1989
+ hidden: function hidden(newVal, oldVal) {
1990
+ if (!isEqual$1(newVal, oldVal)) {
1991
+ this.$emit('data', this.getData());
1992
+ }
1993
+ },
1994
+ total: function total(newVal, oldVal) {
1995
+ if (!isEqual$1(newVal, oldVal)) {
1996
+ this.$emit('data', this.getData());
1997
+ }
1998
+ },
1999
+ time: function time(newVal, oldVal) {
2000
+ if (!isEqual$1(newVal, oldVal)) {
2001
+ this.$emit('data', this.getData());
2002
+ }
2003
+ },
2004
+ defaultQuery: function defaultQuery(newVal, oldVal) {
2005
+ if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
2006
+ this.$defaultQuery = newVal(this.selectedValue, this.$props);
2007
+ var query = extractQueryFromCustomQuery(this.$defaultQuery);
2008
+ var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
2009
+ if (queryOptions) {
2010
+ this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
2011
+ } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
2012
+ // Update default query for RS API
2013
+ index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
2014
+ this.updateQuery({
2015
+ componentId: this.internalComponent,
2016
+ query: query
2017
+ });
2018
+ }
2019
+ },
2020
+ customQuery: function customQuery(newVal, oldVal) {
2021
+ if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
2022
+ var componentId = this.$props.componentId;
2023
+ this.$customQuery = newVal(this.selectedValue, this.$props);
2024
+ var query = extractQueryFromCustomQuery(this.$customQuery);
2025
+ var queryOptions = getOptionsForCustomQuery(this.$customQuery);
2026
+ if (queryOptions) {
2027
+ this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
2028
+ } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
2029
+
2030
+ // Update custom query for RS API
2031
+ index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
2032
+ this.updateQuery({
2033
+ componentId: componentId,
2034
+ query: query
2035
+ });
2036
+ }
2037
+ }
2038
+ },
2039
+ render: function render() {
2040
+ try {
2041
+ var dom = this.$slots["default"];
2042
+ var error = this.error,
2043
+ isLoading = this.isLoading,
2044
+ selectedValue = this.selectedValue;
2045
+ var propsToBePassed = _rollupPluginBabelHelpers._extends({
2046
+ error: error,
2047
+ loading: isLoading
2048
+ }, this.getData(), {
2049
+ value: selectedValue,
2050
+ setQuery: this.setQuery
2051
+ });
2052
+ return vue.createVNode("div", null, [dom(propsToBePassed)]);
2053
+ } catch (e) {
2054
+ return null;
2055
+ }
2056
+ },
2057
+ methods: {
2058
+ getAggsQuery: function getAggsQuery() {
2059
+ if (this.aggregationField) {
2060
+ return {
2061
+ aggs: getCompositeAggsQuery$1({
2062
+ props: this.$props,
2063
+ showTopHits: true,
2064
+ value: this.selectedValue
2065
+ }).aggs
2066
+ };
2067
+ }
2068
+ return {};
2069
+ },
2070
+ getData: function getData() {
2071
+ var hits = this.hits,
2072
+ aggregations = this.aggregations,
2073
+ aggregationData = this.aggregationData,
2074
+ promotedResults = this.promotedResults,
2075
+ rawData = this.rawData;
2076
+ var filteredResults = parseHits(hits);
2077
+ if (promotedResults.length) {
2078
+ var ids = promotedResults.map(function (item) {
2079
+ return item._id;
2080
+ }).filter(Boolean);
2081
+ if (ids) {
2082
+ filteredResults = filteredResults.filter(function (item) {
2083
+ return !ids.includes(item._id);
2084
+ });
2085
+ }
2086
+ filteredResults = [].concat(promotedResults, filteredResults);
2087
+ }
2088
+ return {
2089
+ data: filteredResults,
2090
+ aggregationData: aggregationData,
2091
+ rawData: rawData,
2092
+ aggregations: aggregations,
2093
+ promotedData: promotedResults,
2094
+ resultStats: this.stats
2095
+ };
2096
+ }
2097
+ },
2098
+ computed: {
2099
+ stats: function stats() {
2100
+ return getResultStats$1(this);
2101
+ }
2102
+ }
2103
+ };
2104
+ ReactiveComponent.hasInternalComponent = function (props) {
2105
+ return !!props.defaultQuery;
2106
+ };
2107
+ var mapStateToProps$1 = function mapStateToProps(state, props) {
2108
+ return {
2109
+ aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
2110
+ aggregationData: state.compositeAggregations[props.componentId] || [],
2111
+ hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
2112
+ rawData: state.rawData[props.componentId],
2113
+ error: state.error[props.componentId],
2114
+ isLoading: state.isLoading[props.componentId],
2115
+ selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
2116
+ promotedResults: state.promotedResults[props.componentId] || [],
2117
+ time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
2118
+ total: state.hits[props.componentId] && state.hits[props.componentId].total,
2119
+ hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
2120
+ componentProps: state.props[props.componentId]
2121
+ };
2122
+ };
2123
+ var mapDispatchtoProps = {
2124
+ setQueryOptions: setQueryOptions,
2125
+ updateQuery: updateQuery$1,
2126
+ setCustomQuery: setCustomQuery$1,
2127
+ setDefaultQuery: setDefaultQuery$1
2128
+ };
2129
+ var ConnectedComponent = ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps$1, mapDispatchtoProps)(ReactiveComponent), {
2130
+ componentType: constants.componentTypes.reactiveComponent
2131
+ });
2132
+ var RcConnected = PreferencesConsumer.PreferencesConsumer({
2133
+ name: 'RcConnected',
2134
+ render: function render() {
2135
+ var component = ConnectedComponent;
2136
+ switch (this.$attrs.componentType) {
2137
+ case constants.componentTypes.reactiveList:
2138
+ component = ReactiveList.RLConnected;
2139
+ break;
2140
+ case constants.componentTypes.searchBox:
2141
+ component = SBConnected;
2142
+ break;
2143
+ // list components
2144
+ case constants.componentTypes.singleList:
2145
+ component = SingleList.ListConnected;
2146
+ break;
2147
+ case constants.componentTypes.multiList:
2148
+ component = MultiList.ListConnected;
2149
+ break;
2150
+ case constants.componentTypes.singleDropdownList:
2151
+ component = SingleDropdownList.ListConnected;
2152
+ break;
2153
+ case constants.componentTypes.multiDropdownList:
2154
+ component = MultiDropdownList.ListConnected;
2155
+ break;
2156
+ // basic components
2157
+ case constants.componentTypes.toggleButton:
2158
+ component = ToggleButton.TBConnected;
2159
+ break;
2160
+ // range components
2161
+ case constants.componentTypes.dynamicRangeSlider:
2162
+ component = DynamicRangeSlider.RangeConnected;
2163
+ break;
2164
+ case constants.componentTypes.singleRange:
2165
+ component = SingleRange.RangeConnected;
2166
+ break;
2167
+ case constants.componentTypes.multiRange:
2168
+ component = MultiRange.RangeConnected;
2169
+ break;
2170
+ case constants.componentTypes.rangeSlider:
2171
+ component = RangeSlider.RangeConnected;
2172
+ break;
2173
+ case constants.componentTypes.rangeInput:
2174
+ component = RangeInput.RangeConnected;
2175
+ break;
2176
+ }
2177
+ return vue.h(component, null, this.$slots);
2178
+ }
2179
+ });
2180
+ RcConnected.name = ReactiveComponent.name;
2181
+ RcConnected.install = function (Vue) {
2182
+ Vue.component(RcConnected.name, RcConnected);
2183
+ };
2184
+
2185
+ // Add componentType for SSR
2186
+ RcConnected.componentType = constants.componentTypes.reactiveComponent;
2187
+
2188
+ exports.ReactiveComponent = RcConnected;
2189
+ exports.SearchBox = SBConnected;