@empathyco/x-components 6.0.0-alpha.149 → 6.0.0-alpha.150
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/docs/API-reference/api/x-components.aimutations.md +1 -0
- package/docs/API-reference/api/x-components.aimutations.setisnoresults.md +13 -0
- package/docs/API-reference/api/x-components.aioverview.md +2 -0
- package/docs/API-reference/api/x-components.aistate.isnoresults.md +13 -0
- package/docs/API-reference/api/x-components.aistate.md +1 -0
- package/js/x-modules/ai/components/ai-overview.vue.js +214 -206
- package/js/x-modules/ai/components/ai-overview.vue.js.map +1 -1
- package/js/x-modules/ai/components/ai-overview.vue2.js +3 -1
- package/js/x-modules/ai/components/ai-overview.vue2.js.map +1 -1
- package/js/x-modules/ai/store/actions/fetch-and-save-ai-suggestions.action.js +4 -3
- package/js/x-modules/ai/store/actions/fetch-and-save-ai-suggestions.action.js.map +1 -1
- package/js/x-modules/ai/store/module.js +4 -0
- package/js/x-modules/ai/store/module.js.map +1 -1
- package/package.json +2 -2
- package/report/x-components.api.json +83 -2
- package/report/x-components.api.md +4 -0
- package/types/x-modules/ai/components/ai-overview.vue.d.ts +2 -0
- package/types/x-modules/ai/components/ai-overview.vue.d.ts.map +1 -1
- package/types/x-modules/ai/store/module.d.ts.map +1 -1
- package/types/x-modules/ai/store/types.d.ts +8 -0
- package/types/x-modules/ai/store/types.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.0.0-alpha.150 (2025-09-22)
|
|
7
|
+
|
|
8
|
+
* feat(AiOverview): handle new noResult chunk in AiOverview (#1886) ([2c41469](https://github.com/empathyco/x/commit/2c41469)), closes [#1886](https://github.com/empathyco/x/issues/1886)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## 6.0.0-alpha.149 (2025-09-22)
|
|
7
15
|
|
|
8
16
|
* style(ai-overview): fade animation to show results (#1880) ([84ee675](https://github.com/empathyco/x/commit/84ee675)), closes [#1880](https://github.com/empathyco/x/issues/1880)
|
|
@@ -19,6 +19,7 @@ export interface AiMutations extends ConfigMutations<AiState>, QueryMutations
|
|
|
19
19
|
| --- | --- | --- | --- |
|
|
20
20
|
| [resetAiState](./x-components.aimutations.resetaistate.md) | | () => void | Resets the ai state. |
|
|
21
21
|
| [setAiRelatedTags](./x-components.aimutations.setairelatedtags.md) | | (relatedTags: RelatedTag\[\]) => void | Sets the related tags of the module. |
|
|
22
|
+
| [setIsNoResults](./x-components.aimutations.setisnoresults.md) | | (isNoResults: boolean) => void | Sets the no results flag of the module. |
|
|
22
23
|
| [setParams](./x-components.aimutations.setparams.md) | | (params: Dictionary<unknown>) => void | Sets the extra params of the module. |
|
|
23
24
|
| [setQueries](./x-components.aimutations.setqueries.md) | | (queries: AiSuggestionQuery\[\]) => void | Sets the queries from the streamed response. |
|
|
24
25
|
| [setResponseText](./x-components.aimutations.setresponsetext.md) | | (responseText: string) => void | Sets the responseText from the streamed response. |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [AiMutations](./x-components.aimutations.md) > [setIsNoResults](./x-components.aimutations.setisnoresults.md)
|
|
4
|
+
|
|
5
|
+
## AiMutations.setIsNoResults property
|
|
6
|
+
|
|
7
|
+
Sets the no results flag of the module.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
setIsNoResults: (isNoResults: boolean) => void;
|
|
13
|
+
```
|
|
@@ -44,6 +44,8 @@ _default: import("vue").DefineComponent<{
|
|
|
44
44
|
shouldAnimateSuggestion: import("vue").Ref<boolean>;
|
|
45
45
|
query: import("vue").ComputedRef<string>;
|
|
46
46
|
tagging: import("vue").ComputedRef<import("@empathyco/x-types").AiSuggestionTagging | undefined>;
|
|
47
|
+
isNoResults: import("vue").ComputedRef<boolean>;
|
|
48
|
+
queries: import("vue").ComputedRef<import("@empathyco/x-types").AiSuggestionQuery[]>;
|
|
47
49
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
48
50
|
title: {
|
|
49
51
|
type: PropType<string>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [AiState](./x-components.aistate.md) > [isNoResults](./x-components.aistate.isnoresults.md)
|
|
4
|
+
|
|
5
|
+
## AiState.isNoResults property
|
|
6
|
+
|
|
7
|
+
Flag to indicate that the AI response has no results
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
isNoResults: boolean;
|
|
13
|
+
```
|
|
@@ -18,6 +18,7 @@ export interface AiState extends QueryState
|
|
|
18
18
|
| Property | Modifiers | Type | Description |
|
|
19
19
|
| --- | --- | --- | --- |
|
|
20
20
|
| [config](./x-components.aistate.config.md) | | [AiConfig](./x-components.aiconfig.md) | |
|
|
21
|
+
| [isNoResults](./x-components.aistate.isnoresults.md) | | boolean | Flag to indicate that the AI response has no results |
|
|
21
22
|
| [params](./x-components.aistate.params.md) | | Dictionary<unknown> | The extra params property of the state. |
|
|
22
23
|
| [queries](./x-components.aistate.queries.md) | | AiSuggestionQuery\[\] | |
|
|
23
24
|
| [relatedTags](./x-components.aistate.relatedtags.md) | | RelatedTag\[\] | The list of the related tags, related to the <code>query</code> property of the state. |
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import _sfc_main from './ai-overview.vue2.js';
|
|
2
|
-
import { resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode,
|
|
2
|
+
import { resolveComponent, openBlock, createBlock, withCtx, createElementBlock, createElementVNode, createVNode, toDisplayString, createTextVNode, createCommentVNode, normalizeStyle, withDirectives, Fragment, renderList, normalizeClass, renderSlot, vShow, withModifiers } from 'vue';
|
|
3
3
|
import './ai-overview.vue3.js';
|
|
4
4
|
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
|
|
5
5
|
|
|
6
|
-
const _hoisted_1 = {
|
|
6
|
+
const _hoisted_1 = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "x-ai-overview",
|
|
9
|
+
"data-test": "ai-overview-wrapper"
|
|
10
|
+
};
|
|
7
11
|
const _hoisted_2 = { class: "x-ai-overview-main" };
|
|
8
12
|
const _hoisted_3 = {
|
|
9
13
|
key: 0,
|
|
@@ -40,10 +44,7 @@ const _hoisted_11 = {
|
|
|
40
44
|
class: "x-ai-overview-gradient",
|
|
41
45
|
"data-test": "ai-overview-gradient"
|
|
42
46
|
};
|
|
43
|
-
const _hoisted_12 = {
|
|
44
|
-
class: "x-ai-overview-toggle-wrapper",
|
|
45
|
-
"data-test": "ai-overview-toggle-button-wrapper"
|
|
46
|
-
};
|
|
47
|
+
const _hoisted_12 = { class: "x-ai-overview-toggle-wrapper" };
|
|
47
48
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
48
49
|
const _component_AIStarIcon = resolveComponent("AIStarIcon");
|
|
49
50
|
const _component_DisplayEmitter = resolveComponent("DisplayEmitter");
|
|
@@ -55,33 +56,61 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
55
56
|
const _component_SlidingPanel = resolveComponent("SlidingPanel");
|
|
56
57
|
const _component_CollapseHeight = resolveComponent("CollapseHeight");
|
|
57
58
|
const _component_ChevronDownIcon = resolveComponent("ChevronDownIcon");
|
|
58
|
-
return openBlock(),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
_hoisted_4,
|
|
64
|
-
createElementVNode(
|
|
65
|
-
"span",
|
|
66
|
-
_hoisted_5,
|
|
67
|
-
toDisplayString(_ctx.titleLoading),
|
|
68
|
-
1
|
|
69
|
-
/* TEXT */
|
|
70
|
-
)
|
|
71
|
-
])) : (openBlock(), createBlock(_component_DisplayEmitter, {
|
|
72
|
-
key: 1,
|
|
73
|
-
payload: _ctx.tagging?.toolingDisplay ?? { url: "", params: {} },
|
|
74
|
-
"event-metadata": {
|
|
75
|
-
feature: "overview",
|
|
76
|
-
displayOriginalQuery: _ctx.query,
|
|
77
|
-
replaceable: false
|
|
78
|
-
}
|
|
79
|
-
}, {
|
|
59
|
+
return openBlock(), createBlock(_component_CollapseHeight, null, {
|
|
60
|
+
default: withCtx(() => [
|
|
61
|
+
!_ctx.isNoResults ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
62
|
+
createElementVNode("div", _hoisted_2, [
|
|
63
|
+
createVNode(_component_Fade, { mode: "out-in" }, {
|
|
80
64
|
default: withCtx(() => [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
65
|
+
_ctx.suggestionsLoading ? (openBlock(), createElementBlock("span", _hoisted_3, [
|
|
66
|
+
_hoisted_4,
|
|
67
|
+
createElementVNode(
|
|
68
|
+
"span",
|
|
69
|
+
_hoisted_5,
|
|
70
|
+
toDisplayString(_ctx.titleLoading),
|
|
71
|
+
1
|
|
72
|
+
/* TEXT */
|
|
73
|
+
)
|
|
74
|
+
])) : (openBlock(), createBlock(_component_DisplayEmitter, {
|
|
75
|
+
key: 1,
|
|
76
|
+
payload: _ctx.tagging?.toolingDisplay ?? { url: "", params: {} },
|
|
77
|
+
"event-metadata": {
|
|
78
|
+
feature: "overview",
|
|
79
|
+
displayOriginalQuery: _ctx.query,
|
|
80
|
+
replaceable: false
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
default: withCtx(() => [
|
|
84
|
+
createElementVNode("span", _hoisted_6, [
|
|
85
|
+
createVNode(_component_AIStarIcon, { class: "x-ai-overview-title-icon" }),
|
|
86
|
+
createTextVNode(
|
|
87
|
+
toDisplayString(!!_ctx.title ? _ctx.title : _ctx.suggestionText),
|
|
88
|
+
1
|
|
89
|
+
/* TEXT */
|
|
90
|
+
)
|
|
91
|
+
])
|
|
92
|
+
]),
|
|
93
|
+
_: 1
|
|
94
|
+
/* STABLE */
|
|
95
|
+
}, 8, ["payload", "event-metadata"]))
|
|
96
|
+
]),
|
|
97
|
+
_: 1
|
|
98
|
+
/* STABLE */
|
|
99
|
+
}),
|
|
100
|
+
createVNode(_component_ChangeHeight, null, {
|
|
101
|
+
default: withCtx(() => [
|
|
102
|
+
createElementVNode("div", _hoisted_7, [
|
|
103
|
+
_ctx.title ? (openBlock(), createElementBlock(
|
|
104
|
+
"span",
|
|
105
|
+
_hoisted_8,
|
|
106
|
+
toDisplayString(_ctx.suggestionText),
|
|
107
|
+
1
|
|
108
|
+
/* TEXT */
|
|
109
|
+
)) : createCommentVNode("v-if", true),
|
|
110
|
+
createElementVNode(
|
|
111
|
+
"p",
|
|
112
|
+
null,
|
|
113
|
+
toDisplayString(_ctx.responseText),
|
|
85
114
|
1
|
|
86
115
|
/* TEXT */
|
|
87
116
|
)
|
|
@@ -89,185 +118,164 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
89
118
|
]),
|
|
90
119
|
_: 1
|
|
91
120
|
/* STABLE */
|
|
92
|
-
}
|
|
121
|
+
})
|
|
93
122
|
]),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
toDisplayString(_ctx.suggestionText),
|
|
104
|
-
1
|
|
105
|
-
/* TEXT */
|
|
106
|
-
)) : createCommentVNode("v-if", true),
|
|
107
|
-
createElementVNode(
|
|
108
|
-
"p",
|
|
123
|
+
createVNode(_component_CollapseHeight, {
|
|
124
|
+
style: normalizeStyle({
|
|
125
|
+
"--x-collapse-height-transition-duration": `${300 * _ctx.suggestionsSearch.length}ms`
|
|
126
|
+
}),
|
|
127
|
+
"data-test": "ai-overview-collapse-height-suggestions"
|
|
128
|
+
}, {
|
|
129
|
+
default: withCtx(() => [
|
|
130
|
+
withDirectives(createElementVNode(
|
|
131
|
+
"div",
|
|
109
132
|
null,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
133
|
+
[
|
|
134
|
+
!_ctx.suggestionsSearch.length ? (openBlock(), createBlock(_component_SpinnerIcon, {
|
|
135
|
+
key: 0,
|
|
136
|
+
class: "x-ai-overview-suggestions-loading",
|
|
137
|
+
"data-test": "ai-overview-suggestions-loading"
|
|
138
|
+
})) : (openBlock(), createElementBlock("div", _hoisted_9, [
|
|
139
|
+
(openBlock(true), createElementBlock(
|
|
140
|
+
Fragment,
|
|
141
|
+
null,
|
|
142
|
+
renderList(_ctx.suggestionsSearch, ({ query: suggestionQuery, results: queriesResults }, suggestionIndex) => {
|
|
143
|
+
return openBlock(), createElementBlock(
|
|
144
|
+
"div",
|
|
145
|
+
{
|
|
146
|
+
key: suggestionQuery,
|
|
147
|
+
class: normalizeClass(["x-ai-overview-suggestion", {
|
|
148
|
+
"x-ai-overview-result-animation": _ctx.shouldAnimateSuggestion
|
|
149
|
+
}]),
|
|
150
|
+
"data-test": "ai-overview-suggestion",
|
|
151
|
+
style: normalizeStyle({ animationDelay: `${suggestionIndex * 300}ms` })
|
|
152
|
+
},
|
|
153
|
+
[
|
|
154
|
+
createVNode(_component_BaseEventButton, {
|
|
155
|
+
class: "x-ai-overview-suggestion-query-btn",
|
|
156
|
+
events: { UserAcceptedAQuery: suggestionQuery }
|
|
157
|
+
}, {
|
|
158
|
+
default: withCtx(() => [
|
|
159
|
+
createTextVNode(
|
|
160
|
+
toDisplayString(suggestionQuery) + " ",
|
|
161
|
+
1
|
|
162
|
+
/* TEXT */
|
|
163
|
+
),
|
|
164
|
+
createVNode(_component_ArrowRightIcon, { class: "x-ai-overview-suggestion-query-btn-icon" })
|
|
165
|
+
]),
|
|
166
|
+
_: 2
|
|
167
|
+
/* DYNAMIC */
|
|
168
|
+
}, 1032, ["events"]),
|
|
169
|
+
renderSlot(_ctx.$slots, "sliding-panel", { results: queriesResults }, () => [
|
|
170
|
+
createVNode(_component_SlidingPanel, {
|
|
171
|
+
class: normalizeClass(_ctx.slidingPanelsClasses),
|
|
172
|
+
"scroll-container-class": _ctx.slidingPanelContainersClasses,
|
|
173
|
+
"button-class": _ctx.slidingPanelButtonsClasses,
|
|
174
|
+
"reset-on-content-change": false
|
|
175
|
+
}, {
|
|
176
|
+
"sliding-panel-addons": withCtx(({ arrivedState }) => [
|
|
177
|
+
renderSlot(_ctx.$slots, "sliding-panels-addons", { arrivedState })
|
|
178
|
+
]),
|
|
179
|
+
"sliding-panel-left-button": withCtx(() => [
|
|
180
|
+
renderSlot(_ctx.$slots, "sliding-panels-left-button")
|
|
181
|
+
]),
|
|
182
|
+
"sliding-panel-right-button": withCtx(() => [
|
|
183
|
+
renderSlot(_ctx.$slots, "sliding-panels-right-button")
|
|
184
|
+
]),
|
|
185
|
+
default: withCtx(() => [
|
|
186
|
+
createElementVNode("ul", _hoisted_10, [
|
|
187
|
+
(openBlock(true), createElementBlock(
|
|
188
|
+
Fragment,
|
|
189
|
+
null,
|
|
190
|
+
renderList(queriesResults, (result, resultIndex) => {
|
|
191
|
+
return openBlock(), createElementBlock(
|
|
192
|
+
"li",
|
|
193
|
+
{
|
|
194
|
+
key: result.id,
|
|
195
|
+
"data-test": "ai-overview-suggestion-result",
|
|
196
|
+
class: normalizeClass({
|
|
197
|
+
"x-ai-overview-result-animation": _ctx.shouldAnimateSuggestion
|
|
198
|
+
}),
|
|
199
|
+
style: normalizeStyle({ animationDelay: `${suggestionIndex * 300 + resultIndex * 300}ms` })
|
|
200
|
+
},
|
|
201
|
+
[
|
|
202
|
+
renderSlot(_ctx.$slots, "result", { result })
|
|
203
|
+
],
|
|
204
|
+
6
|
|
205
|
+
/* CLASS, STYLE */
|
|
206
|
+
);
|
|
207
|
+
}),
|
|
208
|
+
128
|
|
209
|
+
/* KEYED_FRAGMENT */
|
|
210
|
+
))
|
|
211
|
+
])
|
|
212
|
+
]),
|
|
213
|
+
_: 2
|
|
214
|
+
/* DYNAMIC */
|
|
215
|
+
}, 1032, ["class", "scroll-container-class", "button-class"])
|
|
216
|
+
])
|
|
217
|
+
],
|
|
218
|
+
6
|
|
219
|
+
/* CLASS, STYLE */
|
|
220
|
+
);
|
|
221
|
+
}),
|
|
222
|
+
128
|
|
223
|
+
/* KEYED_FRAGMENT */
|
|
224
|
+
))
|
|
225
|
+
]))
|
|
226
|
+
],
|
|
227
|
+
512
|
|
228
|
+
/* NEED_PATCH */
|
|
229
|
+
), [
|
|
230
|
+
[vShow, _ctx.expanded]
|
|
231
|
+
])
|
|
232
|
+
]),
|
|
233
|
+
_: 3
|
|
234
|
+
/* FORWARDED */
|
|
235
|
+
}, 8, ["style"]),
|
|
236
|
+
createVNode(_component_Fade, null, {
|
|
237
|
+
default: withCtx(() => [
|
|
238
|
+
_ctx.queries.length ? (openBlock(), createElementBlock("div", {
|
|
132
239
|
key: 0,
|
|
133
|
-
class: "x-
|
|
134
|
-
"data-test": "ai-overview-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
240
|
+
class: "x-cursor-pointer",
|
|
241
|
+
"data-test": "ai-overview-toggle-button-wrapper",
|
|
242
|
+
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.onExpandButtonClick(!_ctx.expanded))
|
|
243
|
+
}, [
|
|
244
|
+
withDirectives(createElementVNode(
|
|
245
|
+
"div",
|
|
246
|
+
_hoisted_11,
|
|
138
247
|
null,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
createVNode(_component_ArrowRightIcon, { class: "x-ai-overview-suggestion-query-btn-icon" })
|
|
162
|
-
]),
|
|
163
|
-
_: 2
|
|
164
|
-
/* DYNAMIC */
|
|
165
|
-
}, 1032, ["events"]),
|
|
166
|
-
renderSlot(_ctx.$slots, "sliding-panel", { results: queriesResults }, () => [
|
|
167
|
-
createVNode(_component_SlidingPanel, {
|
|
168
|
-
class: normalizeClass(_ctx.slidingPanelsClasses),
|
|
169
|
-
"scroll-container-class": _ctx.slidingPanelContainersClasses,
|
|
170
|
-
"button-class": _ctx.slidingPanelButtonsClasses,
|
|
171
|
-
"reset-on-content-change": false
|
|
172
|
-
}, {
|
|
173
|
-
"sliding-panel-addons": withCtx(({ arrivedState }) => [
|
|
174
|
-
renderSlot(_ctx.$slots, "sliding-panels-addons", { arrivedState })
|
|
175
|
-
]),
|
|
176
|
-
"sliding-panel-left-button": withCtx(() => [
|
|
177
|
-
renderSlot(_ctx.$slots, "sliding-panels-left-button")
|
|
178
|
-
]),
|
|
179
|
-
"sliding-panel-right-button": withCtx(() => [
|
|
180
|
-
renderSlot(_ctx.$slots, "sliding-panels-right-button")
|
|
181
|
-
]),
|
|
182
|
-
default: withCtx(() => [
|
|
183
|
-
createElementVNode("ul", _hoisted_10, [
|
|
184
|
-
(openBlock(true), createElementBlock(
|
|
185
|
-
Fragment,
|
|
186
|
-
null,
|
|
187
|
-
renderList(queriesResults, (result, resultIndex) => {
|
|
188
|
-
return openBlock(), createElementBlock(
|
|
189
|
-
"li",
|
|
190
|
-
{
|
|
191
|
-
key: result.id,
|
|
192
|
-
"data-test": "ai-overview-suggestion-result",
|
|
193
|
-
class: normalizeClass({
|
|
194
|
-
"x-ai-overview-result-animation": _ctx.shouldAnimateSuggestion
|
|
195
|
-
}),
|
|
196
|
-
style: normalizeStyle({ animationDelay: `${suggestionIndex * 300 + resultIndex * 300}ms` })
|
|
197
|
-
},
|
|
198
|
-
[
|
|
199
|
-
renderSlot(_ctx.$slots, "result", { result })
|
|
200
|
-
],
|
|
201
|
-
6
|
|
202
|
-
/* CLASS, STYLE */
|
|
203
|
-
);
|
|
204
|
-
}),
|
|
205
|
-
128
|
|
206
|
-
/* KEYED_FRAGMENT */
|
|
207
|
-
))
|
|
208
|
-
])
|
|
209
|
-
]),
|
|
210
|
-
_: 2
|
|
211
|
-
/* DYNAMIC */
|
|
212
|
-
}, 1032, ["class", "scroll-container-class", "button-class"])
|
|
213
|
-
])
|
|
214
|
-
],
|
|
215
|
-
6
|
|
216
|
-
/* CLASS, STYLE */
|
|
217
|
-
);
|
|
218
|
-
}),
|
|
219
|
-
128
|
|
220
|
-
/* KEYED_FRAGMENT */
|
|
221
|
-
))
|
|
222
|
-
]))
|
|
223
|
-
],
|
|
224
|
-
512
|
|
225
|
-
/* NEED_PATCH */
|
|
226
|
-
), [
|
|
227
|
-
[vShow, _ctx.expanded]
|
|
228
|
-
])
|
|
229
|
-
]),
|
|
230
|
-
_: 3
|
|
231
|
-
/* FORWARDED */
|
|
232
|
-
}, 8, ["style"]),
|
|
233
|
-
createVNode(_component_Fade, null, {
|
|
234
|
-
default: withCtx(() => [
|
|
235
|
-
_ctx.responseText ? (openBlock(), createElementBlock("div", {
|
|
236
|
-
key: 0,
|
|
237
|
-
class: "x-cursor-pointer",
|
|
238
|
-
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.onExpandButtonClick(!_ctx.expanded))
|
|
239
|
-
}, [
|
|
240
|
-
withDirectives(createElementVNode(
|
|
241
|
-
"div",
|
|
242
|
-
_hoisted_11,
|
|
243
|
-
null,
|
|
244
|
-
512
|
|
245
|
-
/* NEED_PATCH */
|
|
246
|
-
), [
|
|
247
|
-
[vShow, !_ctx.expanded]
|
|
248
|
+
512
|
|
249
|
+
/* NEED_PATCH */
|
|
250
|
+
), [
|
|
251
|
+
[vShow, !_ctx.expanded]
|
|
252
|
+
]),
|
|
253
|
+
createElementVNode("div", _hoisted_12, [
|
|
254
|
+
createElementVNode("button", {
|
|
255
|
+
class: "x-ai-overview-toggle-btn",
|
|
256
|
+
"data-test": "ai-overview-toggle-button",
|
|
257
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.onExpandButtonClick(!_ctx.expanded), ["stop"]))
|
|
258
|
+
}, [
|
|
259
|
+
createTextVNode(
|
|
260
|
+
toDisplayString(_ctx.buttonText) + " ",
|
|
261
|
+
1
|
|
262
|
+
/* TEXT */
|
|
263
|
+
),
|
|
264
|
+
createVNode(_component_ChevronDownIcon, {
|
|
265
|
+
class: normalizeClass(["x-ai-overview-toggle-btn-icon", { "x-ai-overview-toggle-btn-icon-expanded": _ctx.expanded }])
|
|
266
|
+
}, null, 8, ["class"])
|
|
267
|
+
])
|
|
268
|
+
])
|
|
269
|
+
])) : createCommentVNode("v-if", true)
|
|
248
270
|
]),
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
1
|
|
258
|
-
/* TEXT */
|
|
259
|
-
),
|
|
260
|
-
createVNode(_component_ChevronDownIcon, {
|
|
261
|
-
class: normalizeClass(["x-ai-overview-toggle-btn-icon", { "x-ai-overview-toggle-btn-icon-expanded": _ctx.expanded }])
|
|
262
|
-
}, null, 8, ["class"])
|
|
263
|
-
])
|
|
264
|
-
])
|
|
265
|
-
])) : createCommentVNode("v-if", true)
|
|
266
|
-
]),
|
|
267
|
-
_: 1
|
|
268
|
-
/* STABLE */
|
|
269
|
-
})
|
|
270
|
-
]);
|
|
271
|
+
_: 1
|
|
272
|
+
/* STABLE */
|
|
273
|
+
})
|
|
274
|
+
])) : createCommentVNode("v-if", true)
|
|
275
|
+
]),
|
|
276
|
+
_: 3
|
|
277
|
+
/* FORWARDED */
|
|
278
|
+
});
|
|
271
279
|
}
|
|
272
280
|
var aiOverview = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
273
281
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-overview.vue.js","sources":["../../../../../src/x-modules/ai/components/ai-overview.vue"],"sourcesContent":["<template>\n <div class=\"x-ai-overview\">\n <div class=\"x-ai-overview-main\">\n <Fade mode=\"out-in\">\n <span\n v-if=\"suggestionsLoading\"\n class=\"x-ai-overview-title-loading\"\n data-test=\"ai-overview-title-loading\"\n >\n <span class=\"x-ai-overview-title-loading-indicator\" />\n <span class=\"x-ai-overview-title-loading-text\" data-test=\"ai-overview-title-loading-text\">\n {{ titleLoading }}\n </span>\n </span>\n <DisplayEmitter\n v-else\n :payload=\"tagging?.toolingDisplay ?? { url: '', params: {} }\"\n :event-metadata=\"{\n feature: 'overview',\n displayOriginalQuery: query,\n replaceable: false,\n }\"\n >\n <span class=\"x-ai-overview-title\" data-test=\"ai-overview-title\">\n <AIStarIcon class=\"x-ai-overview-title-icon\" />{{ !!title ? title : suggestionText }}\n </span>\n </DisplayEmitter>\n </Fade>\n <ChangeHeight>\n <div class=\"x-ai-overview-content\" data-test=\"ai-overview-content\">\n <span v-if=\"title\">{{ suggestionText }}</span>\n <p>{{ responseText }}</p>\n </div>\n </ChangeHeight>\n </div>\n <CollapseHeight\n :style=\"{\n '--x-collapse-height-transition-duration': `${300 * suggestionsSearch.length}ms`,\n }\"\n data-test=\"ai-overview-collapse-height-suggestions\"\n >\n <div v-show=\"expanded\">\n <SpinnerIcon\n v-if=\"!suggestionsSearch.length\"\n class=\"x-ai-overview-suggestions-loading\"\n data-test=\"ai-overview-suggestions-loading\"\n />\n <div v-else class=\"x-ai-overview-suggestions\" data-test=\"ai-overview-suggestions-container\">\n <div\n v-for=\"(\n { query: suggestionQuery, results: queriesResults }, suggestionIndex\n ) in suggestionsSearch\"\n :key=\"suggestionQuery\"\n class=\"x-ai-overview-suggestion\"\n data-test=\"ai-overview-suggestion\"\n :class=\"{\n 'x-ai-overview-result-animation': shouldAnimateSuggestion,\n }\"\n :style=\"{ animationDelay: `${suggestionIndex * 300}ms` }\"\n >\n <BaseEventButton\n class=\"x-ai-overview-suggestion-query-btn\"\n :events=\"{ UserAcceptedAQuery: suggestionQuery }\"\n >\n {{ suggestionQuery }}\n <ArrowRightIcon class=\"x-ai-overview-suggestion-query-btn-icon\" />\n </BaseEventButton>\n\n <slot name=\"sliding-panel\" :results=\"queriesResults\">\n <SlidingPanel\n :class=\"slidingPanelsClasses\"\n :scroll-container-class=\"slidingPanelContainersClasses\"\n :button-class=\"slidingPanelButtonsClasses\"\n :reset-on-content-change=\"false\"\n >\n <template #sliding-panel-addons=\"{ arrivedState }\">\n <slot name=\"sliding-panels-addons\" :arrived-state=\"arrivedState\" />\n </template>\n <template #sliding-panel-left-button>\n <slot name=\"sliding-panels-left-button\" />\n </template>\n <template #sliding-panel-right-button>\n <slot name=\"sliding-panels-right-button\" />\n </template>\n <ul class=\"x-ai-overview-suggestion-results\">\n <li\n v-for=\"(result, resultIndex) in queriesResults\"\n :key=\"result.id\"\n data-test=\"ai-overview-suggestion-result\"\n :class=\"{\n 'x-ai-overview-result-animation': shouldAnimateSuggestion,\n }\"\n :style=\"{ animationDelay: `${suggestionIndex * 300 + resultIndex * 300}ms` }\"\n >\n <!-- @slot (required) result card -->\n <slot name=\"result\" :result=\"result\" />\n </li>\n </ul>\n </SlidingPanel>\n </slot>\n </div>\n </div>\n </div>\n </CollapseHeight>\n\n <Fade>\n <div v-if=\"responseText\" class=\"x-cursor-pointer\" @click=\"onExpandButtonClick(!expanded)\">\n <div v-show=\"!expanded\" class=\"x-ai-overview-gradient\" data-test=\"ai-overview-gradient\" />\n\n <div class=\"x-ai-overview-toggle-wrapper\" data-test=\"ai-overview-toggle-button-wrapper\">\n <button\n class=\"x-ai-overview-toggle-btn\"\n data-test=\"ai-overview-toggle-button\"\n @click.stop=\"onExpandButtonClick(!expanded)\"\n >\n {{ buttonText }}\n <ChevronDownIcon\n class=\"x-ai-overview-toggle-btn-icon\"\n :class=\"{ 'x-ai-overview-toggle-btn-icon-expanded': expanded }\"\n />\n </button>\n </div>\n </div>\n </Fade>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue'\nimport { computed, defineComponent, ref, watch } from 'vue'\nimport {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChangeHeight,\n ChevronDownIcon,\n CollapseHeight,\n Fade,\n SlidingPanel,\n SpinnerIcon,\n} from '../../../components'\nimport DisplayEmitter from '../../../components/display-emitter.vue'\nimport { use$x, useGetter, useState } from '../../../composables'\nimport { typing } from '../../../directives'\nimport { aiXModule } from '../x-module'\n\nexport default defineComponent({\n directives: {\n typing,\n },\n xModule: aiXModule.name,\n components: {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChevronDownIcon,\n CollapseHeight,\n ChangeHeight,\n Fade,\n SlidingPanel,\n SpinnerIcon,\n DisplayEmitter,\n },\n props: {\n /**\n * The text displayed when the question ended loading\n *\n * @public\n */\n title: {\n type: String as PropType<string>,\n },\n /**\n * The text displayed when the question is loading.\n *\n * @public\n */\n titleLoading: {\n type: String as PropType<string>,\n default: 'Generating with Empathy AI',\n },\n /**\n * The text displayed on the toggle button when collapsed.\n *\n * @public\n */\n expandText: {\n type: String as PropType<string>,\n default: 'Show more',\n },\n /**\n * The text displayed on the toggle button when expanded.\n *\n * @public\n */\n collapseText: {\n type: String as PropType<string>,\n default: 'Show less',\n },\n\n /**\n * The classes added to each sliding panel for each query.\n *\n * @public\n */\n slidingPanelsClasses: {\n type: String as PropType<string>,\n },\n /**\n * The classes added to each sliding panel container of each query.\n *\n * @public\n */\n slidingPanelContainersClasses: {\n type: String as PropType<string>,\n },\n /**\n * The classes added to each sliding panel buttons of each query.\n *\n * @public\n */\n slidingPanelButtonsClasses: {\n type: String as PropType<string>,\n },\n },\n setup(props) {\n const $x = use$x()\n const { query } = useGetter('ai')\n const { suggestionText, responseText, suggestionsSearch, suggestionsLoading, tagging } =\n useState('ai')\n\n const expanded = ref(false)\n const shouldAnimateSuggestion = ref(true)\n\n const buttonText = computed(() => (expanded.value ? props.collapseText : props.expandText))\n\n function onExpandButtonClick(newValue: boolean) {\n $x.emit('UserClickedAiOverviewExpandButton', expanded.value, {\n suggestionText: suggestionText.value,\n toolingDisplayClick: tagging.value?.toolingDisplayClick,\n })\n setExpanded(newValue)\n }\n\n function setExpanded(newValue: boolean) {\n expanded.value = newValue\n !expanded.value && (shouldAnimateSuggestion.value = false)\n }\n\n watch(query, () => {\n expanded.value = false\n shouldAnimateSuggestion.value = true\n })\n\n return {\n buttonText,\n expanded,\n responseText,\n suggestionsLoading,\n suggestionsSearch,\n suggestionText,\n setExpanded,\n onExpandButtonClick,\n shouldAnimateSuggestion,\n query,\n tagging,\n }\n },\n})\n</script>\n\n<style lang=\"css\">\n.x-ai-overview {\n --color: var(--x-ai-overview-color, #bbc9cf);\n --color-lighter: var(--x-ai-overview-color-lighter, color-mix(in srgb, var(--color) 25%, white));\n\n @apply x-relative x-rounded-3xl x-bg-[var(--color-lighter)];\n}\n\n.x-ai-overview-main {\n @apply x-p-16 x-rounded-lg;\n}\n\n.x-ai-overview-title-loading {\n @apply x-flex x-items-center x-gap-1.5 x-mb-8;\n}\n.x-ai-overview-title-loading-indicator {\n @apply x-size-3 x-animate-pulse x-rounded-full x-bg-[var(--color)];\n}\n.x-ai-overview-title-loading-text {\n @apply x-animate-pulse x-text-xs;\n}\n\n.x-ai-overview-title {\n @apply x-flex x-text-sm x-font-bold x-gap-4 x-items-center x-mb-8;\n}\n.x-ai-overview-title-icon {\n @apply x-icon x-text-[var(--color)];\n}\n\n.x-ai-overview-content {\n @apply x-flex x-flex-col x-text-left x-leading-5 x-gap-2;\n}\n.x-ai-overview-content span {\n @apply x-font-medium;\n}\n\n.x-ai-overview-gradient {\n @apply x-cursor-pointer x-content-none x-absolute x-w-full x-h-80 x-bottom-5 x-bg-gradient-to-b x-from-0% x-from-transparent x-to-100% x-to-[var(--color-lighter)];\n}\n\n.x-ai-overview-toggle-wrapper {\n @apply x-flex x-relative x-z-[1];\n}\n.x-ai-overview-toggle-btn {\n @apply x-button x-button-outlined x-rounded-full x-w-full x-mx-auto sm:x-transition-all sm:x-duration-500 sm:x-translate-y-1/2 sm:x-w-[var(--expand-button-width,200px)];\n}\n.x-ai-overview-toggle-btn-icon {\n @apply x-rotate-0 x-icon x-transition-all x-duration-300;\n}\n.x-ai-overview-toggle-btn-icon-expanded {\n @apply x-rotate-180;\n}\n\n.x-ai-overview-suggestion-query-btn {\n @apply x-button-tight x-mx-16 x-font-bold x-text-gray-900 x-w-fit x-min-h-fit x-flex x-gap-16 x-items-center;\n}\n.x-ai-overview-suggestion-query-btn-icon {\n @apply x-icon-md;\n}\n.x-ai-overview-suggestions {\n @apply x-flex x-flex-col x-gap-16 x-pb-16;\n}\n.x-ai-overview-suggestion {\n @apply x-flex x-flex-col x-gap-8;\n}\n.x-ai-overview-suggestion-results {\n @apply x-flex x-gap-16 x-px-16;\n}\n\n.x-ai-overview-suggestions-loading {\n width: 2.5rem /* 40px */;\n height: 2.5rem /* 40px */;\n margin: auto;\n animation: x-spin 1s linear infinite;\n\n @keyframes x-spin {\n to {\n transform: rotate(360deg);\n }\n }\n}\n\n.x-ai-overview-result-animation {\n opacity: 0;\n animation: x-fade 0.3s ease-in-out forwards;\n\n @keyframes x-fade {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n</style>\n"],"names":["_createElementVNode","_openBlock","_createElementBlock","_createVNode","_toDisplayString","_createBlock","_withCtx","_createTextVNode","_createCommentVNode","_normalizeStyle","_withDirectives","_Fragment","_renderList","_normalizeClass","_renderSlot","_vShow","_withModifiers"],"mappings":";;;;;AACO,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,eAAe,EAAA,CAAA;AACnB,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,oBAAoB,EAAA,CAAA;;AAFnC,EAAA,GAAA,EAAA,CAAA;AAAA,EAMU,KAAM,EAAA,6BAAA;AAAA,EACN,WAAU,EAAA,2BAAA;;AAEV,MAAA,UAAA,mBAAAA,kBAAA;AAAA,EAAsD,MAAA;AAAA,EAAA,EAAhD,OAAM,uCAAuC,EAAA;AAAA,EAAA,IAAA;AAAA,EAAA,CAAA,CAAA;AAAA;AAAA,CAAA,CAAA;;EAC7C,KAAM,EAAA,kCAAA;AAAA,EAAmC,WAAU,EAAA,gCAAA;;;EAanD,KAAM,EAAA,qBAAA;AAAA,EAAsB,WAAU,EAAA,mBAAA;;;EAMzC,KAAM,EAAA,uBAAA;AAAA,EAAwB,WAAU,EAAA,qBAAA;;AA7BrD,MAAA,UAAA,GAAA,EAAA,GAAA,EAAA,CAAA,EAAA,CAAA;;AAAA,EAAA,GAAA,EAAA,CAAA;AAAA,EA+CoB,KAAM,EAAA,2BAAA;AAAA,EAA4B,WAAU,EAAA,mCAAA;;AAqC5C,MAAA,WAAA,GAAA,EAAA,KAAA,EAAM,kCAAkC,EAAA,CAAA;;EAuB5B,KAAM,EAAA,wBAAA;AAAA,EAAyB,WAAU,EAAA,sBAAA;;;EAE5D,KAAM,EAAA,8BAAA;AAAA,EAA+B,WAAU,EAAA,mCAAA;;;;;;;;;;;;;AA5G1D,EAAA,OAAAC,SAAA,EAAA,EAAAC,kBAAA,CA2HM,OA3HN,UA2HM,EAAA;AAAA,IA1HJF,kBAAA,CAgCM,OAhCN,UAgCM,EAAA;AAAA,MA/BJG,WAAA,CAwBO,eAxBD,EAAA,EAAA,IAAA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AAAA,aAAA,EAAA;AAjHtD,cAAAT,eAAA;AAAA,gBAAAH,eAAA,CAmHe,eAAU,CAAG,GAAA,GAAA;AAAA,gBAChB,CAAA;AAAA;AAAA,eAAA;AAAA,cAGED,WAAA,CAAA,0BAAA,EAAA;AAAA,gBAFA,KArHd,EAAAU,cAAA,CAAA,CAqHoB,+BAA+B,EAAA,EAAA,wCAAA,EACe,IAAQ,CAAA,QAAA,EAAA,CAAA,CAAA;AAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,OAAA,CAAA,CAAA;;;AAtH1E,SAAA,CAAA,IAAAL,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA;AAAA,OAAA,CAAA;AAAA,MAAA,CAAA,EAAA,CAAA;AAAA;AAAA,KAAA,CAAA;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ai-overview.vue.js","sources":["../../../../../src/x-modules/ai/components/ai-overview.vue"],"sourcesContent":["<template>\n <CollapseHeight>\n <div v-if=\"!isNoResults\" class=\"x-ai-overview\" data-test=\"ai-overview-wrapper\">\n <div class=\"x-ai-overview-main\">\n <Fade mode=\"out-in\">\n <span\n v-if=\"suggestionsLoading\"\n class=\"x-ai-overview-title-loading\"\n data-test=\"ai-overview-title-loading\"\n >\n <span class=\"x-ai-overview-title-loading-indicator\" />\n <span\n class=\"x-ai-overview-title-loading-text\"\n data-test=\"ai-overview-title-loading-text\"\n >\n {{ titleLoading }}\n </span>\n </span>\n <DisplayEmitter\n v-else\n :payload=\"tagging?.toolingDisplay ?? { url: '', params: {} }\"\n :event-metadata=\"{\n feature: 'overview',\n displayOriginalQuery: query,\n replaceable: false,\n }\"\n >\n <span class=\"x-ai-overview-title\" data-test=\"ai-overview-title\">\n <AIStarIcon class=\"x-ai-overview-title-icon\" />{{ !!title ? title : suggestionText }}\n </span>\n </DisplayEmitter>\n </Fade>\n <ChangeHeight>\n <div class=\"x-ai-overview-content\" data-test=\"ai-overview-content\">\n <span v-if=\"title\">{{ suggestionText }}</span>\n <p>{{ responseText }}</p>\n </div>\n </ChangeHeight>\n </div>\n <CollapseHeight\n :style=\"{\n '--x-collapse-height-transition-duration': `${300 * suggestionsSearch.length}ms`,\n }\"\n data-test=\"ai-overview-collapse-height-suggestions\"\n >\n <div v-show=\"expanded\">\n <SpinnerIcon\n v-if=\"!suggestionsSearch.length\"\n class=\"x-ai-overview-suggestions-loading\"\n data-test=\"ai-overview-suggestions-loading\"\n />\n <div\n v-else\n class=\"x-ai-overview-suggestions\"\n data-test=\"ai-overview-suggestions-container\"\n >\n <div\n v-for=\"(\n { query: suggestionQuery, results: queriesResults }, suggestionIndex\n ) in suggestionsSearch\"\n :key=\"suggestionQuery\"\n class=\"x-ai-overview-suggestion\"\n data-test=\"ai-overview-suggestion\"\n :class=\"{\n 'x-ai-overview-result-animation': shouldAnimateSuggestion,\n }\"\n :style=\"{ animationDelay: `${suggestionIndex * 300}ms` }\"\n >\n <BaseEventButton\n class=\"x-ai-overview-suggestion-query-btn\"\n :events=\"{ UserAcceptedAQuery: suggestionQuery }\"\n >\n {{ suggestionQuery }}\n <ArrowRightIcon class=\"x-ai-overview-suggestion-query-btn-icon\" />\n </BaseEventButton>\n\n <slot name=\"sliding-panel\" :results=\"queriesResults\">\n <SlidingPanel\n :class=\"slidingPanelsClasses\"\n :scroll-container-class=\"slidingPanelContainersClasses\"\n :button-class=\"slidingPanelButtonsClasses\"\n :reset-on-content-change=\"false\"\n >\n <template #sliding-panel-addons=\"{ arrivedState }\">\n <slot name=\"sliding-panels-addons\" :arrived-state=\"arrivedState\" />\n </template>\n <template #sliding-panel-left-button>\n <slot name=\"sliding-panels-left-button\" />\n </template>\n <template #sliding-panel-right-button>\n <slot name=\"sliding-panels-right-button\" />\n </template>\n <ul class=\"x-ai-overview-suggestion-results\">\n <li\n v-for=\"(result, resultIndex) in queriesResults\"\n :key=\"result.id\"\n data-test=\"ai-overview-suggestion-result\"\n :class=\"{\n 'x-ai-overview-result-animation': shouldAnimateSuggestion,\n }\"\n :style=\"{ animationDelay: `${suggestionIndex * 300 + resultIndex * 300}ms` }\"\n >\n <!-- @slot (required) result card -->\n <slot name=\"result\" :result=\"result\" />\n </li>\n </ul>\n </SlidingPanel>\n </slot>\n </div>\n </div>\n </div>\n </CollapseHeight>\n\n <Fade>\n <div\n v-if=\"queries.length\"\n class=\"x-cursor-pointer\"\n data-test=\"ai-overview-toggle-button-wrapper\"\n @click=\"onExpandButtonClick(!expanded)\"\n >\n <div v-show=\"!expanded\" class=\"x-ai-overview-gradient\" data-test=\"ai-overview-gradient\" />\n <div class=\"x-ai-overview-toggle-wrapper\">\n <button\n class=\"x-ai-overview-toggle-btn\"\n data-test=\"ai-overview-toggle-button\"\n @click.stop=\"onExpandButtonClick(!expanded)\"\n >\n {{ buttonText }}\n <ChevronDownIcon\n class=\"x-ai-overview-toggle-btn-icon\"\n :class=\"{ 'x-ai-overview-toggle-btn-icon-expanded': expanded }\"\n />\n </button>\n </div>\n </div>\n </Fade>\n </div>\n </CollapseHeight>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue'\nimport { computed, defineComponent, ref, watch } from 'vue'\nimport {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChangeHeight,\n ChevronDownIcon,\n CollapseHeight,\n Fade,\n SlidingPanel,\n SpinnerIcon,\n} from '../../../components'\nimport DisplayEmitter from '../../../components/display-emitter.vue'\nimport { use$x, useGetter, useState } from '../../../composables'\nimport { typing } from '../../../directives'\nimport { aiXModule } from '../x-module'\n\nexport default defineComponent({\n directives: {\n typing,\n },\n xModule: aiXModule.name,\n components: {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChevronDownIcon,\n CollapseHeight,\n ChangeHeight,\n Fade,\n SlidingPanel,\n SpinnerIcon,\n DisplayEmitter,\n },\n props: {\n /**\n * The text displayed when the question ended loading\n *\n * @public\n */\n title: {\n type: String as PropType<string>,\n },\n /**\n * The text displayed when the question is loading.\n *\n * @public\n */\n titleLoading: {\n type: String as PropType<string>,\n default: 'Generating with Empathy AI',\n },\n /**\n * The text displayed on the toggle button when collapsed.\n *\n * @public\n */\n expandText: {\n type: String as PropType<string>,\n default: 'Show more',\n },\n /**\n * The text displayed on the toggle button when expanded.\n *\n * @public\n */\n collapseText: {\n type: String as PropType<string>,\n default: 'Show less',\n },\n\n /**\n * The classes added to each sliding panel for each query.\n *\n * @public\n */\n slidingPanelsClasses: {\n type: String as PropType<string>,\n },\n /**\n * The classes added to each sliding panel container of each query.\n *\n * @public\n */\n slidingPanelContainersClasses: {\n type: String as PropType<string>,\n },\n /**\n * The classes added to each sliding panel buttons of each query.\n *\n * @public\n */\n slidingPanelButtonsClasses: {\n type: String as PropType<string>,\n },\n },\n setup(props) {\n const $x = use$x()\n const { query } = useGetter('ai')\n const {\n suggestionText,\n responseText,\n suggestionsSearch,\n suggestionsLoading,\n tagging,\n isNoResults,\n queries,\n } = useState('ai')\n\n const expanded = ref(false)\n const shouldAnimateSuggestion = ref(true)\n\n const buttonText = computed(() => (expanded.value ? props.collapseText : props.expandText))\n\n function onExpandButtonClick(newValue: boolean) {\n $x.emit('UserClickedAiOverviewExpandButton', expanded.value, {\n suggestionText: suggestionText.value,\n toolingDisplayClick: tagging.value?.toolingDisplayClick,\n })\n setExpanded(newValue)\n }\n\n function setExpanded(newValue: boolean) {\n expanded.value = newValue\n !expanded.value && (shouldAnimateSuggestion.value = false)\n }\n\n watch(query, () => {\n expanded.value = false\n shouldAnimateSuggestion.value = true\n })\n\n return {\n buttonText,\n expanded,\n responseText,\n suggestionsLoading,\n suggestionsSearch,\n suggestionText,\n setExpanded,\n onExpandButtonClick,\n shouldAnimateSuggestion,\n query,\n tagging,\n isNoResults,\n queries,\n }\n },\n})\n</script>\n\n<style lang=\"css\">\n.x-ai-overview {\n --color: var(--x-ai-overview-color, #bbc9cf);\n --color-lighter: var(--x-ai-overview-color-lighter, color-mix(in srgb, var(--color) 25%, white));\n\n @apply x-relative x-rounded-3xl x-bg-[var(--color-lighter)];\n}\n\n.x-ai-overview-main {\n @apply x-p-16 x-rounded-lg;\n}\n\n.x-ai-overview-title-loading {\n @apply x-flex x-items-center x-gap-1.5 x-mb-8;\n}\n.x-ai-overview-title-loading-indicator {\n @apply x-size-3 x-animate-pulse x-rounded-full x-bg-[var(--color)];\n}\n.x-ai-overview-title-loading-text {\n @apply x-animate-pulse x-text-xs;\n}\n\n.x-ai-overview-title {\n @apply x-flex x-text-sm x-font-bold x-gap-4 x-items-center x-mb-8;\n}\n.x-ai-overview-title-icon {\n @apply x-icon x-text-[var(--color)];\n}\n\n.x-ai-overview-content {\n @apply x-flex x-flex-col x-text-left x-leading-5 x-gap-2;\n}\n.x-ai-overview-content span {\n @apply x-font-medium;\n}\n\n.x-ai-overview-gradient {\n @apply x-cursor-pointer x-content-none x-absolute x-w-full x-h-80 x-bottom-5 x-bg-gradient-to-b x-from-0% x-from-transparent x-to-100% x-to-[var(--color-lighter)];\n}\n\n.x-ai-overview-toggle-wrapper {\n @apply x-flex x-relative x-z-[1];\n}\n.x-ai-overview-toggle-btn {\n @apply x-button x-button-outlined x-rounded-full x-w-full x-mx-auto sm:x-transition-all sm:x-duration-500 sm:x-translate-y-1/2 sm:x-w-[var(--expand-button-width,200px)];\n}\n.x-ai-overview-toggle-btn-icon {\n @apply x-rotate-0 x-icon x-transition-all x-duration-300;\n}\n.x-ai-overview-toggle-btn-icon-expanded {\n @apply x-rotate-180;\n}\n\n.x-ai-overview-suggestion-query-btn {\n @apply x-button-tight x-mx-16 x-font-bold x-text-gray-900 x-w-fit x-min-h-fit x-flex x-gap-16 x-items-center;\n}\n.x-ai-overview-suggestion-query-btn-icon {\n @apply x-icon-md;\n}\n.x-ai-overview-suggestions {\n @apply x-flex x-flex-col x-gap-16 x-pb-16;\n}\n.x-ai-overview-suggestion {\n @apply x-flex x-flex-col x-gap-8;\n}\n.x-ai-overview-suggestion-results {\n @apply x-flex x-gap-16 x-px-16;\n}\n\n.x-ai-overview-suggestions-loading {\n width: 2.5rem /* 40px */;\n height: 2.5rem /* 40px */;\n margin: auto;\n animation: x-spin 1s linear infinite;\n\n @keyframes x-spin {\n to {\n transform: rotate(360deg);\n }\n }\n}\n\n.x-ai-overview-result-animation {\n opacity: 0;\n animation: x-fade 0.3s ease-in-out forwards;\n\n @keyframes x-fade {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n</style>\n"],"names":["_createElementVNode","_createBlock","_openBlock","_createElementBlock","_createVNode","_toDisplayString","_withCtx","_createTextVNode","_createCommentVNode","_normalizeStyle","_withDirectives","_Fragment","_renderList","_normalizeClass","_renderSlot","_vShow","_withModifiers"],"mappings":";;;;;;AAAA,EAAA,GAAA,EAAA,CAAA;AAAA,EAE6B,KAAM,EAAA,eAAA;AAAA,EAAgB,WAAU,EAAA,qBAAA;;AAClD,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,oBAAoB,EAAA,CAAA;;AAHrC,EAAA,GAAA,EAAA,CAAA;AAAA,EAOY,KAAM,EAAA,6BAAA;AAAA,EACN,WAAU,EAAA,2BAAA;;AAEV,MAAA,UAAA,mBAAAA,kBAAA;AAAA,EAAsD,MAAA;AAAA,EAAA,EAAhD,OAAM,uCAAuC,EAAA;AAAA,EAAA,IAAA;AAAA,EAAA,CAAA,CAAA;AAAA;AAAA,CAAA,CAAA;;EAEjD,KAAM,EAAA,kCAAA;AAAA,EACN,WAAU,EAAA,gCAAA;;;EAcN,KAAM,EAAA,qBAAA;AAAA,EAAsB,WAAU,EAAA,mBAAA;;;EAMzC,KAAM,EAAA,uBAAA;AAAA,EAAwB,WAAU,EAAA,qBAAA;;AAjCvD,MAAA,UAAA,GAAA,EAAA,GAAA,EAAA,CAAA,EAAA,CAAA;;AAAA,EAAA,GAAA,EAAA,CAAA;AAAA,EAqDY,KAAM,EAAA,2BAAA;AAAA,EACN,WAAU,EAAA,mCAAA;;AAsCA,MAAA,WAAA,GAAA,EAAA,KAAA,EAAM,kCAAkC,EAAA,CAAA;;EA4B5B,KA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{
|
|
193
193
|
const $x = use$x();
|
|
194
194
|
const { query } = useGetter('ai');
|
|
195
|
-
const { suggestionText, responseText, suggestionsSearch, suggestionsLoading, tagging } = useState('ai');
|
|
195
|
+
const { suggestionText, responseText, suggestionsSearch, suggestionsLoading, tagging, isNoResults, queries, } = useState('ai');
|
|
196
196
|
const expanded = ref(false);
|
|
197
197
|
const shouldAnimateSuggestion = ref(true);
|
|
198
198
|
const buttonText = computed(() => (expanded.value ? props.collapseText : props.expandText));
|
|
@@ -223,6 +223,8 @@ var _sfc_main = defineComponent({
|
|
|
223
223
|
shouldAnimateSuggestion,
|
|
224
224
|
query,
|
|
225
225
|
tagging,
|
|
226
|
+
isNoResults,
|
|
227
|
+
queries,
|
|
226
228
|
};
|
|
227
229
|
},
|
|
228
230
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-overview.vue2.js","sources":["../../../../../src/x-modules/ai/components/ai-overview.vue"],"sourcesContent":["<template>\n <div class=\"x-ai-overview\">\n <div class=\"x-ai-overview-main\">\n <Fade mode=\"out-in\">\n <span\n v-if=\"suggestionsLoading\"\n class=\"x-ai-overview-title-loading\"\n data-test=\"ai-overview-title-loading\"\n >\n <span class=\"x-ai-overview-title-loading-indicator\" />\n <span class=\"x-ai-overview-title-loading-text\" data-test=\"ai-overview-title-loading-text\">\n {{ titleLoading }}\n </span>\n </span>\n <DisplayEmitter\n v-else\n :payload=\"tagging?.toolingDisplay ?? { url: '', params: {} }\"\n :event-metadata=\"{\n feature: 'overview',\n displayOriginalQuery: query,\n replaceable: false,\n }\"\n >\n <span class=\"x-ai-overview-title\" data-test=\"ai-overview-title\">\n <AIStarIcon class=\"x-ai-overview-title-icon\" />{{ !!title ? title : suggestionText }}\n </span>\n </DisplayEmitter>\n </Fade>\n <ChangeHeight>\n <div class=\"x-ai-overview-content\" data-test=\"ai-overview-content\">\n <span v-if=\"title\">{{ suggestionText }}</span>\n <p>{{ responseText }}</p>\n </div>\n </ChangeHeight>\n </div>\n <CollapseHeight\n :style=\"{\n '--x-collapse-height-transition-duration': `${300 * suggestionsSearch.length}ms`,\n }\"\n data-test=\"ai-overview-collapse-height-suggestions\"\n >\n <div v-show=\"expanded\">\n <SpinnerIcon\n v-if=\"!suggestionsSearch.length\"\n class=\"x-ai-overview-suggestions-loading\"\n data-test=\"ai-overview-suggestions-loading\"\n />\n <div v-else class=\"x-ai-overview-suggestions\" data-test=\"ai-overview-suggestions-container\">\n <div\n v-for=\"(\n { query: suggestionQuery, results: queriesResults }, suggestionIndex\n ) in suggestionsSearch\"\n :key=\"suggestionQuery\"\n class=\"x-ai-overview-suggestion\"\n data-test=\"ai-overview-suggestion\"\n :class=\"{\n 'x-ai-overview-result-animation': shouldAnimateSuggestion,\n }\"\n :style=\"{ animationDelay: `${suggestionIndex * 300}ms` }\"\n >\n <BaseEventButton\n class=\"x-ai-overview-suggestion-query-btn\"\n :events=\"{ UserAcceptedAQuery: suggestionQuery }\"\n >\n {{ suggestionQuery }}\n <ArrowRightIcon class=\"x-ai-overview-suggestion-query-btn-icon\" />\n </BaseEventButton>\n\n <slot name=\"sliding-panel\" :results=\"queriesResults\">\n <SlidingPanel\n :class=\"slidingPanelsClasses\"\n :scroll-container-class=\"slidingPanelContainersClasses\"\n :button-class=\"slidingPanelButtonsClasses\"\n :reset-on-content-change=\"false\"\n >\n <template #sliding-panel-addons=\"{ arrivedState }\">\n <slot name=\"sliding-panels-addons\" :arrived-state=\"arrivedState\" />\n </template>\n <template #sliding-panel-left-button>\n <slot name=\"sliding-panels-left-button\" />\n </template>\n <template #sliding-panel-right-button>\n <slot name=\"sliding-panels-right-button\" />\n </template>\n <ul class=\"x-ai-overview-suggestion-results\">\n <li\n v-for=\"(result, resultIndex) in queriesResults\"\n :key=\"result.id\"\n data-test=\"ai-overview-suggestion-result\"\n :class=\"{\n 'x-ai-overview-result-animation': shouldAnimateSuggestion,\n }\"\n :style=\"{ animationDelay: `${suggestionIndex * 300 + resultIndex * 300}ms` }\"\n >\n <!-- @slot (required) result card -->\n <slot name=\"result\" :result=\"result\" />\n </li>\n </ul>\n </SlidingPanel>\n </slot>\n </div>\n </div>\n </div>\n </CollapseHeight>\n\n <Fade>\n <div v-if=\"responseText\" class=\"x-cursor-pointer\" @click=\"onExpandButtonClick(!expanded)\">\n <div v-show=\"!expanded\" class=\"x-ai-overview-gradient\" data-test=\"ai-overview-gradient\" />\n\n <div class=\"x-ai-overview-toggle-wrapper\" data-test=\"ai-overview-toggle-button-wrapper\">\n <button\n class=\"x-ai-overview-toggle-btn\"\n data-test=\"ai-overview-toggle-button\"\n @click.stop=\"onExpandButtonClick(!expanded)\"\n >\n {{ buttonText }}\n <ChevronDownIcon\n class=\"x-ai-overview-toggle-btn-icon\"\n :class=\"{ 'x-ai-overview-toggle-btn-icon-expanded': expanded }\"\n />\n </button>\n </div>\n </div>\n </Fade>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue'\nimport { computed, defineComponent, ref, watch } from 'vue'\nimport {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChangeHeight,\n ChevronDownIcon,\n CollapseHeight,\n Fade,\n SlidingPanel,\n SpinnerIcon,\n} from '../../../components'\nimport DisplayEmitter from '../../../components/display-emitter.vue'\nimport { use$x, useGetter, useState } from '../../../composables'\nimport { typing } from '../../../directives'\nimport { aiXModule } from '../x-module'\n\nexport default defineComponent({\n directives: {\n typing,\n },\n xModule: aiXModule.name,\n components: {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChevronDownIcon,\n CollapseHeight,\n ChangeHeight,\n Fade,\n SlidingPanel,\n SpinnerIcon,\n DisplayEmitter,\n },\n props: {\n /**\n * The text displayed when the question ended loading\n *\n * @public\n */\n title: {\n type: String as PropType<string>,\n },\n /**\n * The text displayed when the question is loading.\n *\n * @public\n */\n titleLoading: {\n type: String as PropType<string>,\n default: 'Generating with Empathy AI',\n },\n /**\n * The text displayed on the toggle button when collapsed.\n *\n * @public\n */\n expandText: {\n type: String as PropType<string>,\n default: 'Show more',\n },\n /**\n * The text displayed on the toggle button when expanded.\n *\n * @public\n */\n collapseText: {\n type: String as PropType<string>,\n default: 'Show less',\n },\n\n /**\n * The classes added to each sliding panel for each query.\n *\n * @public\n */\n slidingPanelsClasses: {\n type: String as PropType<string>,\n },\n /**\n * The classes added to each sliding panel container of each query.\n *\n * @public\n */\n slidingPanelContainersClasses: {\n type: String as PropType<string>,\n },\n /**\n * The classes added to each sliding panel buttons of each query.\n *\n * @public\n */\n slidingPanelButtonsClasses: {\n type: String as PropType<string>,\n },\n },\n setup(props) {\n const $x = use$x()\n const { query } = useGetter('ai')\n const { suggestionText, responseText, suggestionsSearch, suggestionsLoading, tagging } =\n useState('ai')\n\n const expanded = ref(false)\n const shouldAnimateSuggestion = ref(true)\n\n const buttonText = computed(() => (expanded.value ? props.collapseText : props.expandText))\n\n function onExpandButtonClick(newValue: boolean) {\n $x.emit('UserClickedAiOverviewExpandButton', expanded.value, {\n suggestionText: suggestionText.value,\n toolingDisplayClick: tagging.value?.toolingDisplayClick,\n })\n setExpanded(newValue)\n }\n\n function setExpanded(newValue: boolean) {\n expanded.value = newValue\n !expanded.value && (shouldAnimateSuggestion.value = false)\n }\n\n watch(query, () => {\n expanded.value = false\n shouldAnimateSuggestion.value = true\n })\n\n return {\n buttonText,\n expanded,\n responseText,\n suggestionsLoading,\n suggestionsSearch,\n suggestionText,\n setExpanded,\n onExpandButtonClick,\n shouldAnimateSuggestion,\n query,\n tagging,\n }\n },\n})\n</script>\n\n<style lang=\"css\">\n.x-ai-overview {\n --color: var(--x-ai-overview-color, #bbc9cf);\n --color-lighter: var(--x-ai-overview-color-lighter, color-mix(in srgb, var(--color) 25%, white));\n\n @apply x-relative x-rounded-3xl x-bg-[var(--color-lighter)];\n}\n\n.x-ai-overview-main {\n @apply x-p-16 x-rounded-lg;\n}\n\n.x-ai-overview-title-loading {\n @apply x-flex x-items-center x-gap-1.5 x-mb-8;\n}\n.x-ai-overview-title-loading-indicator {\n @apply x-size-3 x-animate-pulse x-rounded-full x-bg-[var(--color)];\n}\n.x-ai-overview-title-loading-text {\n @apply x-animate-pulse x-text-xs;\n}\n\n.x-ai-overview-title {\n @apply x-flex x-text-sm x-font-bold x-gap-4 x-items-center x-mb-8;\n}\n.x-ai-overview-title-icon {\n @apply x-icon x-text-[var(--color)];\n}\n\n.x-ai-overview-content {\n @apply x-flex x-flex-col x-text-left x-leading-5 x-gap-2;\n}\n.x-ai-overview-content span {\n @apply x-font-medium;\n}\n\n.x-ai-overview-gradient {\n @apply x-cursor-pointer x-content-none x-absolute x-w-full x-h-80 x-bottom-5 x-bg-gradient-to-b x-from-0% x-from-transparent x-to-100% x-to-[var(--color-lighter)];\n}\n\n.x-ai-overview-toggle-wrapper {\n @apply x-flex x-relative x-z-[1];\n}\n.x-ai-overview-toggle-btn {\n @apply x-button x-button-outlined x-rounded-full x-w-full x-mx-auto sm:x-transition-all sm:x-duration-500 sm:x-translate-y-1/2 sm:x-w-[var(--expand-button-width,200px)];\n}\n.x-ai-overview-toggle-btn-icon {\n @apply x-rotate-0 x-icon x-transition-all x-duration-300;\n}\n.x-ai-overview-toggle-btn-icon-expanded {\n @apply x-rotate-180;\n}\n\n.x-ai-overview-suggestion-query-btn {\n @apply x-button-tight x-mx-16 x-font-bold x-text-gray-900 x-w-fit x-min-h-fit x-flex x-gap-16 x-items-center;\n}\n.x-ai-overview-suggestion-query-btn-icon {\n @apply x-icon-md;\n}\n.x-ai-overview-suggestions {\n @apply x-flex x-flex-col x-gap-16 x-pb-16;\n}\n.x-ai-overview-suggestion {\n @apply x-flex x-flex-col x-gap-8;\n}\n.x-ai-overview-suggestion-results {\n @apply x-flex x-gap-16 x-px-16;\n}\n\n.x-ai-overview-suggestions-loading {\n width: 2.5rem /* 40px */;\n height: 2.5rem /* 40px */;\n margin: auto;\n animation: x-spin 1s linear infinite;\n\n @keyframes x-spin {\n to {\n transform: rotate(360deg);\n }\n }\n}\n\n.x-ai-overview-result-animation {\n opacity: 0;\n animation: x-fade 0.3s ease-in-out forwards;\n\n @keyframes x-fade {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n</style>\n"],"names":["DisplayEmitter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkJA,gBAAe,eAAe,CAAC;AAC7B,IAAA,UAAU,EAAE;QACV,MAAM;AACP,KAAA;IACD,OAAO,EAAE,SAAS,CAAC,IAAI;AACvB,IAAA,UAAU,EAAE;QACV,UAAU;QACV,cAAc;QACd,eAAe;QACf,eAAe;QACf,cAAc;QACd,YAAY;QACZ,IAAI;QACJ,YAAY;QACZ,WAAW;wBACXA,WAAc;AACf,KAAA;AACD,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAA0B;AACjC,SAAA;AACD;;;;AAIE;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,OAAO,EAAE,4BAA4B;AACtC,SAAA;AACD;;;;AAIE;AACF,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,OAAO,EAAE,WAAW;AACrB,SAAA;AACD;;;;AAIE;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,OAAO,EAAE,WAAW;AACrB,SAAA;AAED;;;;AAIE;AACF,QAAA,oBAAoB,EAAE;AACpB,YAAA,IAAI,EAAE,MAA0B;AACjC,SAAA;AACD;;;;AAIE;AACF,QAAA,6BAA6B,EAAE;AAC7B,YAAA,IAAI,EAAE,MAA0B;AACjC,SAAA;AACD;;;;AAIE;AACF,QAAA,0BAA0B,EAAE;AAC1B,YAAA,IAAI,EAAE,MAA0B;AACjC,SAAA;AACF,KAAA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AAW;YACX,mBAAmB;YACnB,uBAAuB;YACvB,KAAK;YACL,OAAO;SACT,CAAA;KACD;AACF,CAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"ai-overview.vue2.js","sources":["../../../../../src/x-modules/ai/components/ai-overview.vue"],"sourcesContent":["<template>\n <CollapseHeight>\n <div v-if=\"!isNoResults\" class=\"x-ai-overview\" data-test=\"ai-overview-wrapper\">\n <div class=\"x-ai-overview-main\">\n <Fade mode=\"out-in\">\n <span\n v-if=\"suggestionsLoading\"\n class=\"x-ai-overview-title-loading\"\n data-test=\"ai-overview-title-loading\"\n >\n <span class=\"x-ai-overview-title-loading-indicator\" />\n <span\n class=\"x-ai-overview-title-loading-text\"\n data-test=\"ai-overview-title-loading-text\"\n >\n {{ titleLoading }}\n </span>\n </span>\n <DisplayEmitter\n v-else\n :payload=\"tagging?.toolingDisplay ?? { url: '', params: {} }\"\n :event-metadata=\"{\n feature: 'overview',\n displayOriginalQuery: query,\n replaceable: false,\n }\"\n >\n <span class=\"x-ai-overview-title\" data-test=\"ai-overview-title\">\n <AIStarIcon class=\"x-ai-overview-title-icon\" />{{ !!title ? title : suggestionText }}\n </span>\n </DisplayEmitter>\n </Fade>\n <ChangeHeight>\n <div class=\"x-ai-overview-content\" data-test=\"ai-overview-content\">\n <span v-if=\"title\">{{ suggestionText }}</span>\n <p>{{ responseText }}</p>\n </div>\n </ChangeHeight>\n </div>\n <CollapseHeight\n :style=\"{\n '--x-collapse-height-transition-duration': `${300 * suggestionsSearch.length}ms`,\n }\"\n data-test=\"ai-overview-collapse-height-suggestions\"\n >\n <div v-show=\"expanded\">\n <SpinnerIcon\n v-if=\"!suggestionsSearch.length\"\n class=\"x-ai-overview-suggestions-loading\"\n data-test=\"ai-overview-suggestions-loading\"\n />\n <div\n v-else\n class=\"x-ai-overview-suggestions\"\n data-test=\"ai-overview-suggestions-container\"\n >\n <div\n v-for=\"(\n { query: suggestionQuery, results: queriesResults }, suggestionIndex\n ) in suggestionsSearch\"\n :key=\"suggestionQuery\"\n class=\"x-ai-overview-suggestion\"\n data-test=\"ai-overview-suggestion\"\n :class=\"{\n 'x-ai-overview-result-animation': shouldAnimateSuggestion,\n }\"\n :style=\"{ animationDelay: `${suggestionIndex * 300}ms` }\"\n >\n <BaseEventButton\n class=\"x-ai-overview-suggestion-query-btn\"\n :events=\"{ UserAcceptedAQuery: suggestionQuery }\"\n >\n {{ suggestionQuery }}\n <ArrowRightIcon class=\"x-ai-overview-suggestion-query-btn-icon\" />\n </BaseEventButton>\n\n <slot name=\"sliding-panel\" :results=\"queriesResults\">\n <SlidingPanel\n :class=\"slidingPanelsClasses\"\n :scroll-container-class=\"slidingPanelContainersClasses\"\n :button-class=\"slidingPanelButtonsClasses\"\n :reset-on-content-change=\"false\"\n >\n <template #sliding-panel-addons=\"{ arrivedState }\">\n <slot name=\"sliding-panels-addons\" :arrived-state=\"arrivedState\" />\n </template>\n <template #sliding-panel-left-button>\n <slot name=\"sliding-panels-left-button\" />\n </template>\n <template #sliding-panel-right-button>\n <slot name=\"sliding-panels-right-button\" />\n </template>\n <ul class=\"x-ai-overview-suggestion-results\">\n <li\n v-for=\"(result, resultIndex) in queriesResults\"\n :key=\"result.id\"\n data-test=\"ai-overview-suggestion-result\"\n :class=\"{\n 'x-ai-overview-result-animation': shouldAnimateSuggestion,\n }\"\n :style=\"{ animationDelay: `${suggestionIndex * 300 + resultIndex * 300}ms` }\"\n >\n <!-- @slot (required) result card -->\n <slot name=\"result\" :result=\"result\" />\n </li>\n </ul>\n </SlidingPanel>\n </slot>\n </div>\n </div>\n </div>\n </CollapseHeight>\n\n <Fade>\n <div\n v-if=\"queries.length\"\n class=\"x-cursor-pointer\"\n data-test=\"ai-overview-toggle-button-wrapper\"\n @click=\"onExpandButtonClick(!expanded)\"\n >\n <div v-show=\"!expanded\" class=\"x-ai-overview-gradient\" data-test=\"ai-overview-gradient\" />\n <div class=\"x-ai-overview-toggle-wrapper\">\n <button\n class=\"x-ai-overview-toggle-btn\"\n data-test=\"ai-overview-toggle-button\"\n @click.stop=\"onExpandButtonClick(!expanded)\"\n >\n {{ buttonText }}\n <ChevronDownIcon\n class=\"x-ai-overview-toggle-btn-icon\"\n :class=\"{ 'x-ai-overview-toggle-btn-icon-expanded': expanded }\"\n />\n </button>\n </div>\n </div>\n </Fade>\n </div>\n </CollapseHeight>\n</template>\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue'\nimport { computed, defineComponent, ref, watch } from 'vue'\nimport {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChangeHeight,\n ChevronDownIcon,\n CollapseHeight,\n Fade,\n SlidingPanel,\n SpinnerIcon,\n} from '../../../components'\nimport DisplayEmitter from '../../../components/display-emitter.vue'\nimport { use$x, useGetter, useState } from '../../../composables'\nimport { typing } from '../../../directives'\nimport { aiXModule } from '../x-module'\n\nexport default defineComponent({\n directives: {\n typing,\n },\n xModule: aiXModule.name,\n components: {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChevronDownIcon,\n CollapseHeight,\n ChangeHeight,\n Fade,\n SlidingPanel,\n SpinnerIcon,\n DisplayEmitter,\n },\n props: {\n /**\n * The text displayed when the question ended loading\n *\n * @public\n */\n title: {\n type: String as PropType<string>,\n },\n /**\n * The text displayed when the question is loading.\n *\n * @public\n */\n titleLoading: {\n type: String as PropType<string>,\n default: 'Generating with Empathy AI',\n },\n /**\n * The text displayed on the toggle button when collapsed.\n *\n * @public\n */\n expandText: {\n type: String as PropType<string>,\n default: 'Show more',\n },\n /**\n * The text displayed on the toggle button when expanded.\n *\n * @public\n */\n collapseText: {\n type: String as PropType<string>,\n default: 'Show less',\n },\n\n /**\n * The classes added to each sliding panel for each query.\n *\n * @public\n */\n slidingPanelsClasses: {\n type: String as PropType<string>,\n },\n /**\n * The classes added to each sliding panel container of each query.\n *\n * @public\n */\n slidingPanelContainersClasses: {\n type: String as PropType<string>,\n },\n /**\n * The classes added to each sliding panel buttons of each query.\n *\n * @public\n */\n slidingPanelButtonsClasses: {\n type: String as PropType<string>,\n },\n },\n setup(props) {\n const $x = use$x()\n const { query } = useGetter('ai')\n const {\n suggestionText,\n responseText,\n suggestionsSearch,\n suggestionsLoading,\n tagging,\n isNoResults,\n queries,\n } = useState('ai')\n\n const expanded = ref(false)\n const shouldAnimateSuggestion = ref(true)\n\n const buttonText = computed(() => (expanded.value ? props.collapseText : props.expandText))\n\n function onExpandButtonClick(newValue: boolean) {\n $x.emit('UserClickedAiOverviewExpandButton', expanded.value, {\n suggestionText: suggestionText.value,\n toolingDisplayClick: tagging.value?.toolingDisplayClick,\n })\n setExpanded(newValue)\n }\n\n function setExpanded(newValue: boolean) {\n expanded.value = newValue\n !expanded.value && (shouldAnimateSuggestion.value = false)\n }\n\n watch(query, () => {\n expanded.value = false\n shouldAnimateSuggestion.value = true\n })\n\n return {\n buttonText,\n expanded,\n responseText,\n suggestionsLoading,\n suggestionsSearch,\n suggestionText,\n setExpanded,\n onExpandButtonClick,\n shouldAnimateSuggestion,\n query,\n tagging,\n isNoResults,\n queries,\n }\n },\n})\n</script>\n\n<style lang=\"css\">\n.x-ai-overview {\n --color: var(--x-ai-overview-color, #bbc9cf);\n --color-lighter: var(--x-ai-overview-color-lighter, color-mix(in srgb, var(--color) 25%, white));\n\n @apply x-relative x-rounded-3xl x-bg-[var(--color-lighter)];\n}\n\n.x-ai-overview-main {\n @apply x-p-16 x-rounded-lg;\n}\n\n.x-ai-overview-title-loading {\n @apply x-flex x-items-center x-gap-1.5 x-mb-8;\n}\n.x-ai-overview-title-loading-indicator {\n @apply x-size-3 x-animate-pulse x-rounded-full x-bg-[var(--color)];\n}\n.x-ai-overview-title-loading-text {\n @apply x-animate-pulse x-text-xs;\n}\n\n.x-ai-overview-title {\n @apply x-flex x-text-sm x-font-bold x-gap-4 x-items-center x-mb-8;\n}\n.x-ai-overview-title-icon {\n @apply x-icon x-text-[var(--color)];\n}\n\n.x-ai-overview-content {\n @apply x-flex x-flex-col x-text-left x-leading-5 x-gap-2;\n}\n.x-ai-overview-content span {\n @apply x-font-medium;\n}\n\n.x-ai-overview-gradient {\n @apply x-cursor-pointer x-content-none x-absolute x-w-full x-h-80 x-bottom-5 x-bg-gradient-to-b x-from-0% x-from-transparent x-to-100% x-to-[var(--color-lighter)];\n}\n\n.x-ai-overview-toggle-wrapper {\n @apply x-flex x-relative x-z-[1];\n}\n.x-ai-overview-toggle-btn {\n @apply x-button x-button-outlined x-rounded-full x-w-full x-mx-auto sm:x-transition-all sm:x-duration-500 sm:x-translate-y-1/2 sm:x-w-[var(--expand-button-width,200px)];\n}\n.x-ai-overview-toggle-btn-icon {\n @apply x-rotate-0 x-icon x-transition-all x-duration-300;\n}\n.x-ai-overview-toggle-btn-icon-expanded {\n @apply x-rotate-180;\n}\n\n.x-ai-overview-suggestion-query-btn {\n @apply x-button-tight x-mx-16 x-font-bold x-text-gray-900 x-w-fit x-min-h-fit x-flex x-gap-16 x-items-center;\n}\n.x-ai-overview-suggestion-query-btn-icon {\n @apply x-icon-md;\n}\n.x-ai-overview-suggestions {\n @apply x-flex x-flex-col x-gap-16 x-pb-16;\n}\n.x-ai-overview-suggestion {\n @apply x-flex x-flex-col x-gap-8;\n}\n.x-ai-overview-suggestion-results {\n @apply x-flex x-gap-16 x-px-16;\n}\n\n.x-ai-overview-suggestions-loading {\n width: 2.5rem /* 40px */;\n height: 2.5rem /* 40px */;\n margin: auto;\n animation: x-spin 1s linear infinite;\n\n @keyframes x-spin {\n to {\n transform: rotate(360deg);\n }\n }\n}\n\n.x-ai-overview-result-animation {\n opacity: 0;\n animation: x-fade 0.3s ease-in-out forwards;\n\n @keyframes x-fade {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n}\n</style>\n"],"names":["DisplayEmitter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA,CAAA;AAEjB,QAAA,MAAM,QAAS,GAAE,GAAG,CAAC,KAAK,CAAA,CAAA;AAC1B,QAAA,MAAM,uBAAsB,GAAI,GAAG,CAAC,IAAI,CAAA,CAAA;QAExC,MAAM,UAAW,GAAE,QAAQ,CAAC,OAAO,QAAQ,CAAC,KAAM,GAAE,KAAK,CAAC,YAAW,GAAI,KAAK,CAAC,UAAU,CAAC,CAAA,CAAA;QAE1F,SAAS,mBAAmB,CAAC,QAAiB,EAAA;YAC5C,EAAE,CAAC,IAAI,CAAC,mCAAmC,EAAE,QAAQ,CAAC,KAAK,EAAE;gBAC3D,cAAc,EAAE,cAAc,CAAC,KAAK;AACpC,gBAAA,mBAAmB,EAAE,OAAO,CAAC,KAAK,EAAE,mBAAmB;AACxD,aAAA,CAAA,CAAA;YACD,WAAW,CAAC,QAAQ,CAAA,CAAA;SACtB;QAEA,SAAS,WAAW,CAAC,QAAiB,EAAA;AACpC,YAAA,QAAQ,CAAC,KAAI,GAAI,QAAO,CAAA;YACxB,CAAC,QAAQ,CAAC,KAAI,KAAM,uBAAuB,CAAC,KAAI,GAAI,KAAK,CAAA,CAAA;SAC3D;AAEA,QAAA,KAAK,CAAC,KAAK,EAAE,MAAM;AACjB,YAAA,QAAQ,CAAC,KAAI,GAAI,KAAI,CAAA;AACrB,YAAA,uBAAuB,CAAC,KAAI,GAAI,IAAG,CAAA;AACrC,SAAC,CAAA,CAAA;QAED,OAAO;YACL,UAAU;YACV,QAAQ;YACR,YAAY;YACZ,kBAAkB;YAClB,iBAAiB;YACjB,cAAc;YACd,WAAW;YACX,mBAAmB;YACnB,uBAAuB;YACvB,KAAK;YACL,OAAO;YACP,WAAW;YACX,OAAO;SACT,CAAA;KACD;AACF,CAAA,CAAA;;;;"}
|
|
@@ -49,12 +49,13 @@ function readAnswer(reader, commit) {
|
|
|
49
49
|
// line.length check to avoid empty data chunks
|
|
50
50
|
if (line.startsWith('data:') && line.length > 5) {
|
|
51
51
|
data = JSON.parse(line.slice(5).trim());
|
|
52
|
-
if ('responseText' in data) {
|
|
53
|
-
commit('setResponseText', data.responseText);
|
|
54
|
-
}
|
|
55
52
|
if ('suggestionText' in data) {
|
|
53
|
+
commit('setIsNoResults', false);
|
|
56
54
|
commit('setSuggestionText', data.suggestionText);
|
|
57
55
|
}
|
|
56
|
+
if ('responseText' in data) {
|
|
57
|
+
commit('setResponseText', data.responseText);
|
|
58
|
+
}
|
|
58
59
|
if ('queries' in data) {
|
|
59
60
|
commit('setQueries', data.queries);
|
|
60
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-and-save-ai-suggestions.action.js","sources":["../../../../../../src/x-modules/ai/store/actions/fetch-and-save-ai-suggestions.action.ts"],"sourcesContent":["import type { AiSuggestionQuery } from '@empathyco/x-types'\nimport type { AiActionContext, AiXStoreModule } from '../types'\nimport { getTaggingInfoFromUrl } from '@empathyco/x-adapter-platform'\nimport { XPlugin } from '../../../../plugins'\n\ntype AnswerChunk =\n | { responseText: string }\n | { suggestionText: string }\n | { queries: AiSuggestionQuery[] }\n | {\n taggings: {\n toolingDisplay: string\n toolingDisplayClick: string\n }[]\n }\n/**\n * Default implementation for the {@link AiActions.fetchAndSaveAiSuggestions}.\n *\n * @param _ - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param request - The AI request to make.\n * @returns The AI response.\n *\n * @public\n */\nexport const fetchAndSaveAiSuggestions: AiXStoreModule['actions']['fetchAndSaveAiSuggestions'] =\n async ({ commit }, request) => {\n if (!request) {\n return\n }\n commit('setSuggestionsLoading', true)\n return XPlugin.adapter.aiSuggestions(request).then(({ body, status }) => {\n if (status !== 200) {\n return\n }\n if (body) {\n const reader = body.getReader()\n readAnswer(reader, commit)\n }\n })\n }\n\nfunction readAnswer(\n reader: ReadableStreamDefaultReader<Uint8Array>,\n commit: AiActionContext['commit'],\n): void {\n reader\n .read()\n .then(({ value, done }) => {\n if (done) {\n return\n }\n const result = new TextDecoder().decode(value, { stream: true })\n const parts = result.split('\\n\\n')\n for (const part of parts) {\n const lines = part.split('\\n')\n let data: AnswerChunk\n\n for (const line of lines) {\n // line.length check to avoid empty data chunks\n if (line.startsWith('data:') && line.length > 5) {\n data = JSON.parse(line.slice(5).trim()) as AnswerChunk\n if ('
|
|
1
|
+
{"version":3,"file":"fetch-and-save-ai-suggestions.action.js","sources":["../../../../../../src/x-modules/ai/store/actions/fetch-and-save-ai-suggestions.action.ts"],"sourcesContent":["import type { AiSuggestionQuery } from '@empathyco/x-types'\nimport type { AiActionContext, AiXStoreModule } from '../types'\nimport { getTaggingInfoFromUrl } from '@empathyco/x-adapter-platform'\nimport { XPlugin } from '../../../../plugins'\n\ntype AnswerChunk =\n | { responseText: string }\n | { suggestionText: string }\n | { queries: AiSuggestionQuery[] }\n | {\n taggings: {\n toolingDisplay: string\n toolingDisplayClick: string\n }[]\n }\n/**\n * Default implementation for the {@link AiActions.fetchAndSaveAiSuggestions}.\n *\n * @param _ - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param request - The AI request to make.\n * @returns The AI response.\n *\n * @public\n */\nexport const fetchAndSaveAiSuggestions: AiXStoreModule['actions']['fetchAndSaveAiSuggestions'] =\n async ({ commit }, request) => {\n if (!request) {\n return\n }\n commit('setSuggestionsLoading', true)\n return XPlugin.adapter.aiSuggestions(request).then(({ body, status }) => {\n if (status !== 200) {\n return\n }\n if (body) {\n const reader = body.getReader()\n readAnswer(reader, commit)\n }\n })\n }\n\nfunction readAnswer(\n reader: ReadableStreamDefaultReader<Uint8Array>,\n commit: AiActionContext['commit'],\n): void {\n reader\n .read()\n .then(({ value, done }) => {\n if (done) {\n return\n }\n const result = new TextDecoder().decode(value, { stream: true })\n const parts = result.split('\\n\\n')\n for (const part of parts) {\n const lines = part.split('\\n')\n let data: AnswerChunk\n\n for (const line of lines) {\n // line.length check to avoid empty data chunks\n if (line.startsWith('data:') && line.length > 5) {\n data = JSON.parse(line.slice(5).trim()) as AnswerChunk\n if ('suggestionText' in data) {\n commit('setIsNoResults', false)\n commit('setSuggestionText', data.suggestionText)\n }\n if ('responseText' in data) {\n commit('setResponseText', data.responseText)\n }\n if ('queries' in data) {\n commit('setQueries', data.queries)\n }\n if ('taggings' in data) {\n const { toolingDisplay, toolingDisplayClick } = data.taggings[0]\n const tagging = {\n toolingDisplay: getTaggingInfoFromUrl(toolingDisplay),\n toolingDisplayClick: getTaggingInfoFromUrl(toolingDisplayClick),\n }\n\n commit('setTagging', tagging)\n }\n }\n }\n }\n readAnswer(reader, commit)\n })\n .catch((error: { code: number }) => {\n // AbortError code === 20\n if (error.code !== 20) {\n console.error(error)\n }\n })\n .finally(() => {\n commit('setSuggestionsLoading', false)\n })\n}\n"],"names":[],"mappings":";;;;;;;;;;AAeA;;;;;;;;;AASG;AACI,MAAM,yBAAyB,GACpC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,KAAI;IAC5B,IAAI,CAAC,OAAO,EAAE;QACZ,OAAM;KACP;AACD,IAAA,MAAM,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAA;AACrC,IAAA,OAAO,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAI;AACtE,QAAA,IAAI,MAAM,KAAK,GAAG,EAAE;YAClB,OAAM;SACP;QACD,IAAI,IAAI,EAAE;AACR,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAA;AAC/B,YAAA,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;SAC3B;AACH,KAAC,CAAC,CAAA;AACJ,EAAC;AAEH,SAAS,UAAU,CACjB,MAA+C,EAC/C,MAAiC,EAAA;IAEjC,MAAM;AACH,SAAA,IAAI,EAAE;SACN,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAI;QACxB,IAAI,IAAI,EAAE;YACR,OAA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CAAC,cAAc,CAAC;AACrD,4BAAA,mBAAmB,EAAE,qBAAqB,CAAC,mBAAmB,CAAC;yBAChE,CAAA;AAED,wBAAA,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;qBAC9B;iBACF;aACF;SACF;AACD,QAAA,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAC5B,KAAC,CAAC;AACD,SAAA,KAAK,CAAC,CAAC,KAAuB,KAAI;;AAEjC,QAAA,IAAI,KAAK,CAAC,IAAI,KAAK,EAAE,EAAE;AACrB,YAAA,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;SACrB;AACH,KAAC,CAAC;SACD,OAAO,CAAC,MAAK;AACZ,QAAA,MAAM,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAA;AACxC,KAAC,CAAC,CAAA;AACN;;;;"}
|
|
@@ -62,6 +62,9 @@ const aiXStoreModule = {
|
|
|
62
62
|
setAiRelatedTags(state, relatedTags) {
|
|
63
63
|
state.relatedTags = relatedTags;
|
|
64
64
|
},
|
|
65
|
+
setIsNoResults(state, isNoResults) {
|
|
66
|
+
state.isNoResults = isNoResults;
|
|
67
|
+
},
|
|
65
68
|
},
|
|
66
69
|
actions: {
|
|
67
70
|
fetchAndSaveAiSuggestions,
|
|
@@ -86,6 +89,7 @@ function resettableAiState() {
|
|
|
86
89
|
suggestionsSearch: [],
|
|
87
90
|
suggestionsLoading: false,
|
|
88
91
|
suggestionsSearchLoading: false,
|
|
92
|
+
isNoResults: true,
|
|
89
93
|
};
|
|
90
94
|
}
|
|
91
95
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/ai/store/module.ts"],"sourcesContent":["import type { AiSuggestionQuery, AiSuggestionSearch } from '@empathyco/x-types'\nimport type { QueryState } from '../../../store'\nimport type { AiXStoreModule } from './types'\nimport { mergeConfig, setConfig } from '../../../store/utils/config-store.utils'\nimport { fetchAndSaveAiSuggestionsSearch } from './actions/fetch-and-save-ai-suggestions-search.action'\nimport { fetchAndSaveAiSuggestions } from './actions/fetch-and-save-ai-suggestions.action'\nimport { setUrlParams } from './actions/set-url-params.action'\nimport {\n aiQuery as query,\n aiSuggestionsRequest as suggestionsRequest,\n aiSuggestionsSearchRequest as suggestionsSearchRequest,\n} from './getters'\n/**\n * {@link XStoreModule} For the ai module.\n *\n * @internal\n */\nexport const aiXStoreModule: AiXStoreModule = {\n state: () => ({\n ...resettableAiState(),\n query: '',\n config: {},\n params: {},\n relatedTags: [],\n }),\n getters: {\n suggestionsRequest,\n suggestionsSearchRequest,\n query,\n },\n mutations: {\n /* Streamed fields */\n setResponseText: (state, responseText: string) => {\n state.responseText = responseText\n },\n setSuggestionText: (state, suggestionText: string) => {\n state.suggestionText = suggestionText\n },\n setQueries: (state, queries: AiSuggestionQuery[]) => {\n state.queries = queries\n },\n setTagging: (state, tagging) => {\n state.tagging = tagging\n },\n /* END Streamed fields */\n setSuggestionsSearch: (state, suggestionsSearch: AiSuggestionSearch[]) => {\n state.suggestionsSearch = suggestionsSearch\n },\n setSuggestionsLoading: (state, value) => {\n state.suggestionsLoading = value\n },\n setSuggestionsSearchLoading: (state, value) => {\n state.suggestionsSearchLoading = value\n },\n setConfig,\n mergeConfig,\n setQuery: (state: QueryState, query: string) => {\n state.query = query\n },\n setParams(state, params) {\n state.params = params\n },\n resetAiState(state) {\n Object.assign(state, resettableAiState())\n },\n setAiRelatedTags(state, relatedTags) {\n state.relatedTags = relatedTags\n },\n },\n actions: {\n fetchAndSaveAiSuggestions,\n fetchAndSaveAiSuggestionsSearch,\n setUrlParams,\n },\n}\n\n/**\n * Function to return the \"resettable\" part of the state. This will be used in the `resetState`\n * mutation to reset to the initial state.\n *\n * @returns The \"resettable\" part of the {@link AiState}.\n *\n * @internal\n */\nfunction resettableAiState() {\n return {\n responseText: '',\n suggestionText: '',\n queries: [],\n tagging: undefined,\n suggestionsSearch: [],\n suggestionsLoading: false,\n suggestionsSearchLoading: false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AA,KAAK,CAAC,KAAK,GAAG,KAAK,CAAA;SACpB;QACD,SAAS,CAAC,KAAK,EAAE,MAAM,EAAA;AACrB,YAAA,KAAK,CAAC,MAAM,GAAG,MAAM,CAAA;SACtB;AACD,QAAA,YAAY,CAAC,KAAK,EAAA;YAChB,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,iBAAiB,EAAE,CAAC,CAAA;SAC1C;QACD,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAA;AACjC,YAAA,KAAK,CAAC,WAAW,GAAG,WAAW,CAAA;SAChC;AACF,KAAA;AACD,IAAA,OAAO,EAAE;QACP,yBAAyB;QACzB,+BAA+B;QAC/B,YAAY;AACb,KAAA;EACF;AAED;;;;;;;AAOG;AACH,SAAS,iBAAiB,GAAA;IACxB,OAAO;AACL,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,cAAc,EAAE,EAAE;AAClB,QAAA,OAAO,EAAE,EAAE;AACX,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,iBAAiB,EAAE,EAAE;AACrB,QAAA,kBAAkB,EAAE,KAAK;AACzB,QAAA,wBAAwB,EAAE,KAAK;
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/ai/store/module.ts"],"sourcesContent":["import type { AiSuggestionQuery, AiSuggestionSearch } from '@empathyco/x-types'\nimport type { QueryState } from '../../../store'\nimport type { AiXStoreModule } from './types'\nimport { mergeConfig, setConfig } from '../../../store/utils/config-store.utils'\nimport { fetchAndSaveAiSuggestionsSearch } from './actions/fetch-and-save-ai-suggestions-search.action'\nimport { fetchAndSaveAiSuggestions } from './actions/fetch-and-save-ai-suggestions.action'\nimport { setUrlParams } from './actions/set-url-params.action'\nimport {\n aiQuery as query,\n aiSuggestionsRequest as suggestionsRequest,\n aiSuggestionsSearchRequest as suggestionsSearchRequest,\n} from './getters'\n/**\n * {@link XStoreModule} For the ai module.\n *\n * @internal\n */\nexport const aiXStoreModule: AiXStoreModule = {\n state: () => ({\n ...resettableAiState(),\n query: '',\n config: {},\n params: {},\n relatedTags: [],\n }),\n getters: {\n suggestionsRequest,\n suggestionsSearchRequest,\n query,\n },\n mutations: {\n /* Streamed fields */\n setResponseText: (state, responseText: string) => {\n state.responseText = responseText\n },\n setSuggestionText: (state, suggestionText: string) => {\n state.suggestionText = suggestionText\n },\n setQueries: (state, queries: AiSuggestionQuery[]) => {\n state.queries = queries\n },\n setTagging: (state, tagging) => {\n state.tagging = tagging\n },\n /* END Streamed fields */\n setSuggestionsSearch: (state, suggestionsSearch: AiSuggestionSearch[]) => {\n state.suggestionsSearch = suggestionsSearch\n },\n setSuggestionsLoading: (state, value) => {\n state.suggestionsLoading = value\n },\n setSuggestionsSearchLoading: (state, value) => {\n state.suggestionsSearchLoading = value\n },\n setConfig,\n mergeConfig,\n setQuery: (state: QueryState, query: string) => {\n state.query = query\n },\n setParams(state, params) {\n state.params = params\n },\n resetAiState(state) {\n Object.assign(state, resettableAiState())\n },\n setAiRelatedTags(state, relatedTags) {\n state.relatedTags = relatedTags\n },\n setIsNoResults(state, isNoResults: boolean) {\n state.isNoResults = isNoResults\n },\n },\n actions: {\n fetchAndSaveAiSuggestions,\n fetchAndSaveAiSuggestionsSearch,\n setUrlParams,\n },\n}\n\n/**\n * Function to return the \"resettable\" part of the state. This will be used in the `resetState`\n * mutation to reset to the initial state.\n *\n * @returns The \"resettable\" part of the {@link AiState}.\n *\n * @internal\n */\nfunction resettableAiState() {\n return {\n responseText: '',\n suggestionText: '',\n queries: [],\n tagging: undefined,\n suggestionsSearch: [],\n suggestionsLoading: false,\n suggestionsSearchLoading: false,\n isNoResults: true,\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAYA;;;;AAIG;AACU,MAAA,cAAc,GAAmB;AAC5C,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,GAAG,iBAAiB,EAAE;AACtB,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,MAAM,EAAE,EAAE;AAC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AE,CAAC,CAAA;SAC1C;QACD,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAA;AACjC,YAAA,KAAK,CAAC,WAAW,GAAG,WAAW,CAAA;SAChC;QACD,cAAc,CAAC,KAAK,EAAE,WAAoB,EAAA;AACxC,YAAA,KAAK,CAAC,WAAW,GAAG,WAAW,CAAA;SAChC;AACF,KAAA;AACD,IAAA,OAAO,EAAE;QACP,yBAAyB;QACzB,+BAA+B;QAC/B,YAAY;AACb,KAAA;EACF;AAED;;;;;;;AAOG;AACH,SAAS,iBAAiB,GAAA;IACxB,OAAO;AACL,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,cAAc,EAAE,EAAE;AAClB,QAAA,OAAO,EAAE,EAAE;AACX,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,iBAAiB,EAAE,EAAE;AACrB,QAAA,kBAAkB,EAAE,KAAK;AACzB,QAAA,wBAAwB,EAAE,KAAK;AAC/B,QAAA,WAAW,EAAE,IAAI;KAClB,CAAA;AACH;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-components",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.150",
|
|
4
4
|
"description": "Empathy X Components",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"access": "public",
|
|
143
143
|
"directory": "dist"
|
|
144
144
|
},
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "d272f45b60457c0f8a2ccd4f380c9648e6000bf7"
|
|
146
146
|
}
|
|
@@ -1199,6 +1199,33 @@
|
|
|
1199
1199
|
"endIndex": 4
|
|
1200
1200
|
}
|
|
1201
1201
|
},
|
|
1202
|
+
{
|
|
1203
|
+
"kind": "PropertySignature",
|
|
1204
|
+
"canonicalReference": "@empathyco/x-components!AiMutations#setIsNoResults:member",
|
|
1205
|
+
"docComment": "/**\n * Sets the no results flag of the module.\n *\n * @param isNoResults - The new no results value.\n */\n",
|
|
1206
|
+
"excerptTokens": [
|
|
1207
|
+
{
|
|
1208
|
+
"kind": "Content",
|
|
1209
|
+
"text": "setIsNoResults: "
|
|
1210
|
+
},
|
|
1211
|
+
{
|
|
1212
|
+
"kind": "Content",
|
|
1213
|
+
"text": "(isNoResults: boolean) => void"
|
|
1214
|
+
},
|
|
1215
|
+
{
|
|
1216
|
+
"kind": "Content",
|
|
1217
|
+
"text": ";"
|
|
1218
|
+
}
|
|
1219
|
+
],
|
|
1220
|
+
"isReadonly": false,
|
|
1221
|
+
"isOptional": false,
|
|
1222
|
+
"releaseTag": "Public",
|
|
1223
|
+
"name": "setIsNoResults",
|
|
1224
|
+
"propertyTypeTokenRange": {
|
|
1225
|
+
"startIndex": 1,
|
|
1226
|
+
"endIndex": 2
|
|
1227
|
+
}
|
|
1228
|
+
},
|
|
1202
1229
|
{
|
|
1203
1230
|
"kind": "PropertySignature",
|
|
1204
1231
|
"canonicalReference": "@empathyco/x-components!AiMutations#setParams:member",
|
|
@@ -1645,7 +1672,34 @@
|
|
|
1645
1672
|
},
|
|
1646
1673
|
{
|
|
1647
1674
|
"kind": "Content",
|
|
1648
|
-
"text": " | undefined>;\n
|
|
1675
|
+
"text": " | undefined>;\n isNoResults: import(\"vue\")."
|
|
1676
|
+
},
|
|
1677
|
+
{
|
|
1678
|
+
"kind": "Reference",
|
|
1679
|
+
"text": "ComputedRef",
|
|
1680
|
+
"canonicalReference": "@vue/reactivity!ComputedRef:interface"
|
|
1681
|
+
},
|
|
1682
|
+
{
|
|
1683
|
+
"kind": "Content",
|
|
1684
|
+
"text": "<boolean>;\n queries: import(\"vue\")."
|
|
1685
|
+
},
|
|
1686
|
+
{
|
|
1687
|
+
"kind": "Reference",
|
|
1688
|
+
"text": "ComputedRef",
|
|
1689
|
+
"canonicalReference": "@vue/reactivity!ComputedRef:interface"
|
|
1690
|
+
},
|
|
1691
|
+
{
|
|
1692
|
+
"kind": "Content",
|
|
1693
|
+
"text": "<import(\"@empathyco/x-types\")."
|
|
1694
|
+
},
|
|
1695
|
+
{
|
|
1696
|
+
"kind": "Reference",
|
|
1697
|
+
"text": "AiSuggestionQuery",
|
|
1698
|
+
"canonicalReference": "@empathyco/x-components!AiSuggestionQuery:interface"
|
|
1699
|
+
},
|
|
1700
|
+
{
|
|
1701
|
+
"kind": "Content",
|
|
1702
|
+
"text": "[]>;\n}, unknown, {}, {}, import(\"vue\")."
|
|
1649
1703
|
},
|
|
1650
1704
|
{
|
|
1651
1705
|
"kind": "Reference",
|
|
@@ -1762,7 +1816,7 @@
|
|
|
1762
1816
|
"name": "AiOverview",
|
|
1763
1817
|
"variableTypeTokenRange": {
|
|
1764
1818
|
"startIndex": 1,
|
|
1765
|
-
"endIndex":
|
|
1819
|
+
"endIndex": 70
|
|
1766
1820
|
}
|
|
1767
1821
|
},
|
|
1768
1822
|
{
|
|
@@ -1817,6 +1871,33 @@
|
|
|
1817
1871
|
"endIndex": 2
|
|
1818
1872
|
}
|
|
1819
1873
|
},
|
|
1874
|
+
{
|
|
1875
|
+
"kind": "PropertySignature",
|
|
1876
|
+
"canonicalReference": "@empathyco/x-components!AiState#isNoResults:member",
|
|
1877
|
+
"docComment": "/**\n * Flag to indicate that the AI response has no results\n */\n",
|
|
1878
|
+
"excerptTokens": [
|
|
1879
|
+
{
|
|
1880
|
+
"kind": "Content",
|
|
1881
|
+
"text": "isNoResults: "
|
|
1882
|
+
},
|
|
1883
|
+
{
|
|
1884
|
+
"kind": "Content",
|
|
1885
|
+
"text": "boolean"
|
|
1886
|
+
},
|
|
1887
|
+
{
|
|
1888
|
+
"kind": "Content",
|
|
1889
|
+
"text": ";"
|
|
1890
|
+
}
|
|
1891
|
+
],
|
|
1892
|
+
"isReadonly": false,
|
|
1893
|
+
"isOptional": false,
|
|
1894
|
+
"releaseTag": "Public",
|
|
1895
|
+
"name": "isNoResults",
|
|
1896
|
+
"propertyTypeTokenRange": {
|
|
1897
|
+
"startIndex": 1,
|
|
1898
|
+
"endIndex": 2
|
|
1899
|
+
}
|
|
1900
|
+
},
|
|
1820
1901
|
{
|
|
1821
1902
|
"kind": "PropertySignature",
|
|
1822
1903
|
"canonicalReference": "@empathyco/x-components!AiState#params:member",
|
|
@@ -204,6 +204,7 @@ export interface AiMutations extends ConfigMutations<AiState>, QueryMutations {
|
|
|
204
204
|
resetAiState: () => void;
|
|
205
205
|
// Warning: (ae-forgotten-export) The symbol "RelatedTag_2" needs to be exported by the entry point index.d.ts
|
|
206
206
|
setAiRelatedTags: (relatedTags: RelatedTag_2[]) => void;
|
|
207
|
+
setIsNoResults: (isNoResults: boolean) => void;
|
|
207
208
|
setParams: (params: Dictionary<unknown>) => void;
|
|
208
209
|
// Warning: (ae-forgotten-export) The symbol "AiSuggestionQuery" needs to be exported by the entry point index.d.ts
|
|
209
210
|
setQueries: (queries: AiSuggestionQuery[]) => void;
|
|
@@ -255,6 +256,8 @@ onExpandButtonClick: (newValue: boolean) => void;
|
|
|
255
256
|
shouldAnimateSuggestion: Ref<boolean>;
|
|
256
257
|
query: ComputedRef<string>;
|
|
257
258
|
tagging: ComputedRef<AiSuggestionTagging | undefined>;
|
|
259
|
+
isNoResults: ComputedRef<boolean>;
|
|
260
|
+
queries: ComputedRef<AiSuggestionQuery[]>;
|
|
258
261
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
|
|
259
262
|
title: {
|
|
260
263
|
type: PropType<string>;
|
|
@@ -292,6 +295,7 @@ export { AIStarIcon }
|
|
|
292
295
|
export interface AiState extends QueryState {
|
|
293
296
|
// (undocumented)
|
|
294
297
|
config: AiConfig;
|
|
298
|
+
isNoResults: boolean;
|
|
295
299
|
params: Dictionary<unknown>;
|
|
296
300
|
// (undocumented)
|
|
297
301
|
queries: AiSuggestionQuery[];
|
|
@@ -71,6 +71,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
71
71
|
shouldAnimateSuggestion: import("vue").Ref<boolean>;
|
|
72
72
|
query: import("vue").ComputedRef<string>;
|
|
73
73
|
tagging: import("vue").ComputedRef<import("@empathyco/x-types").AiSuggestionTagging | undefined>;
|
|
74
|
+
isNoResults: import("vue").ComputedRef<boolean>;
|
|
75
|
+
queries: import("vue").ComputedRef<import("@empathyco/x-types").AiSuggestionQuery[]>;
|
|
74
76
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
75
77
|
/**
|
|
76
78
|
* The text displayed when the question ended loading
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-overview.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/ai/components/ai-overview.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;;IAoC/B;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;IAElC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAGlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAGlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAIlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;IAElC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;IAElC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ai-overview.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/ai/components/ai-overview.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;;IAoC/B;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;IAElC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAGlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAGlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAIlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;IAElC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;IAElC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;;;;;;;4BA6BH,OAAO;oCARC,OAAO;;;;;;;IA/E9C;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;IAElC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAGlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAGlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAIlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;IAElC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;IAElC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;;;;;AA5EtC,wBAmIE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/ai/store/module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAU7C;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/ai/store/module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAU7C;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,cA4D5B,CAAA"}
|
|
@@ -25,6 +25,8 @@ export interface AiState extends QueryState {
|
|
|
25
25
|
params: Dictionary<unknown>;
|
|
26
26
|
/** The list of the related tags, related to the `query` property of the state. */
|
|
27
27
|
relatedTags: RelatedTag[];
|
|
28
|
+
/** Flag to indicate that the AI response has no results */
|
|
29
|
+
isNoResults: boolean;
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
30
32
|
* Ai module getters.
|
|
@@ -108,6 +110,12 @@ export interface AiMutations extends ConfigMutations<AiState>, QueryMutations {
|
|
|
108
110
|
* @param relatedTags - The new related tags to save to the state.
|
|
109
111
|
*/
|
|
110
112
|
setAiRelatedTags: (relatedTags: RelatedTag[]) => void;
|
|
113
|
+
/**
|
|
114
|
+
* Sets the no results flag of the module.
|
|
115
|
+
*
|
|
116
|
+
* @param isNoResults - The new no results value.
|
|
117
|
+
*/
|
|
118
|
+
setIsNoResults: (isNoResults: boolean) => void;
|
|
111
119
|
}
|
|
112
120
|
/**
|
|
113
121
|
* Ai module actions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/ai/store/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,UAAU,EACX,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,EACb,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE/C;;;;GAIG;AACH,MAAM,WAAW,OAAQ,SAAQ,UAAU;IACzC,kDAAkD;IAClD,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE,iBAAiB,EAAE,CAAA;IAC5B,OAAO,EAAE,mBAAmB,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