@liujitcn/kratos-admin-bi 0.0.0-stage → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/README.md +43 -2
  2. package/dist/package/declarations/index.d.ts +1 -0
  3. package/dist/package/declarations/src/api/bi/admin/v1/bi_card.d.ts +18 -0
  4. package/dist/package/declarations/src/api/bi/admin/v1/bi_card.js +46 -0
  5. package/dist/package/declarations/src/api/bi/admin/v1/bi_dashboard.d.ts +17 -0
  6. package/dist/package/declarations/src/api/bi/admin/v1/bi_dashboard.js +30 -0
  7. package/dist/package/declarations/src/api/bi/admin/v1/bi_query.d.ts +11 -0
  8. package/dist/package/declarations/src/api/bi/admin/v1/bi_query.js +41 -0
  9. package/dist/package/declarations/src/api/bi/admin/v1/bi_query_record.d.ts +10 -0
  10. package/dist/package/declarations/src/api/bi/admin/v1/bi_query_record.js +14 -0
  11. package/dist/package/declarations/src/api/bi/admin/v1/bi_source.d.ts +26 -0
  12. package/dist/package/declarations/src/api/bi/admin/v1/bi_source.js +46 -0
  13. package/dist/package/declarations/src/bi-core.d.ts +17 -0
  14. package/dist/package/declarations/src/bi-core.js +22 -0
  15. package/dist/package/declarations/src/bi-dashboard-schema.d.ts +31 -0
  16. package/dist/package/declarations/src/bi-dashboard-schema.js +39 -0
  17. package/dist/package/declarations/src/bi-messages.d.ts +247 -0
  18. package/dist/package/declarations/src/bi-messages.js +247 -0
  19. package/dist/package/declarations/src/bi-response.d.ts +10 -0
  20. package/dist/package/declarations/src/bi-response.js +33 -0
  21. package/dist/package/declarations/src/bi-vue.d.ts +10 -0
  22. package/dist/package/declarations/src/bi-vue.js +10 -0
  23. package/dist/package/declarations/src/card-schema.d.ts +30 -0
  24. package/dist/package/declarations/src/card-schema.js +87 -0
  25. package/dist/package/declarations/src/components/BiCardChartEditor.vue.d.ts +17 -0
  26. package/dist/package/declarations/src/components/BiCardChartEditor.vue.js +527 -0
  27. package/dist/package/declarations/src/components/BiCardFormDialog.vue.d.ts +20 -0
  28. package/dist/package/declarations/src/components/BiCardFormDialog.vue.js +495 -0
  29. package/dist/package/declarations/src/components/BiCardLibrary.vue.d.ts +3 -0
  30. package/dist/package/declarations/src/components/BiCardLibrary.vue.js +807 -0
  31. package/dist/package/declarations/src/components/BiCardVisualization.vue.d.ts +10 -0
  32. package/dist/package/declarations/src/components/BiCardVisualization.vue.js +97 -0
  33. package/dist/package/declarations/src/components/BiChart.vue.d.ts +20 -0
  34. package/dist/package/declarations/src/components/BiChart.vue.js +112 -0
  35. package/dist/package/declarations/src/components/BiDashboard.vue.d.ts +9 -0
  36. package/dist/package/declarations/src/components/BiDashboard.vue.js +81 -0
  37. package/dist/package/declarations/src/components/BiDashboardMenuDialog.vue.d.ts +12 -0
  38. package/dist/package/declarations/src/components/BiDashboardMenuDialog.vue.js +252 -0
  39. package/dist/package/declarations/src/components/BiDataCard.vue.d.ts +36 -0
  40. package/dist/package/declarations/src/components/BiDataCard.vue.js +372 -0
  41. package/dist/package/declarations/src/components/BiDesigner.vue.d.ts +17 -0
  42. package/dist/package/declarations/src/components/BiDesigner.vue.js +666 -0
  43. package/dist/package/declarations/src/components/BiSourceModelDialog.vue.d.ts +17 -0
  44. package/dist/package/declarations/src/components/BiSourceModelDialog.vue.js +2118 -0
  45. package/dist/package/declarations/src/components/BiWorkbenchPreview.vue.d.ts +7 -0
  46. package/dist/package/declarations/src/components/BiWorkbenchPreview.vue.js +176 -0
  47. package/dist/package/declarations/src/components/source-model-layout.d.ts +3 -0
  48. package/dist/package/declarations/src/components/source-model-layout.js +66 -0
  49. package/dist/package/declarations/src/dataset/index.d.ts +7 -0
  50. package/dist/package/declarations/src/dataset/index.js +25 -0
  51. package/dist/package/declarations/src/dataset/labels.d.ts +2 -0
  52. package/dist/package/declarations/src/dataset/labels.js +21 -0
  53. package/dist/package/declarations/src/dataset/transform.d.ts +20 -0
  54. package/dist/package/declarations/src/dataset/transform.js +173 -0
  55. package/dist/package/declarations/src/engine/chart-types.d.ts +14 -0
  56. package/dist/package/declarations/src/engine/chart-types.js +37 -0
  57. package/dist/package/declarations/src/engine/echarts.d.ts +16 -0
  58. package/dist/package/declarations/src/engine/echarts.js +491 -0
  59. package/dist/package/declarations/src/engine/types.d.ts +36 -0
  60. package/dist/package/declarations/src/engine/types.js +20 -0
  61. package/dist/package/declarations/src/env.d.ts +17 -0
  62. package/dist/package/declarations/src/env.js +67 -0
  63. package/dist/package/declarations/src/index.d.ts +1 -0
  64. package/dist/package/declarations/src/index.js +1 -0
  65. package/dist/package/declarations/src/locales/en-US.json +254 -0
  66. package/dist/package/declarations/src/locales/generated.d.ts +1021 -0
  67. package/dist/package/declarations/src/locales/generated.js +13 -0
  68. package/dist/package/declarations/src/locales/ja-JP.json +254 -0
  69. package/dist/package/declarations/src/locales/zh-CN.json +254 -0
  70. package/dist/package/declarations/src/locales/zh-TW.json +254 -0
  71. package/dist/package/declarations/src/module.d.ts +2 -0
  72. package/dist/package/declarations/src/module.js +9 -0
  73. package/dist/package/declarations/src/rpc/bi/admin/v1/bi_card.d.ts +145 -0
  74. package/dist/package/declarations/src/rpc/bi/admin/v1/bi_card.js +6 -0
  75. package/dist/package/declarations/src/rpc/bi/admin/v1/bi_dashboard.d.ts +107 -0
  76. package/dist/package/declarations/src/rpc/bi/admin/v1/bi_dashboard.js +6 -0
  77. package/dist/package/declarations/src/rpc/bi/admin/v1/bi_query.d.ts +157 -0
  78. package/dist/package/declarations/src/rpc/bi/admin/v1/bi_query.js +6 -0
  79. package/dist/package/declarations/src/rpc/bi/admin/v1/bi_query_record.d.ts +83 -0
  80. package/dist/package/declarations/src/rpc/bi/admin/v1/bi_query_record.js +15 -0
  81. package/dist/package/declarations/src/rpc/bi/admin/v1/bi_source.d.ts +301 -0
  82. package/dist/package/declarations/src/rpc/bi/admin/v1/bi_source.js +6 -0
  83. package/dist/package/declarations/src/rpc/common/v1/types.d.ts +60 -0
  84. package/dist/package/declarations/src/rpc/common/v1/types.js +6 -0
  85. package/dist/package/declarations/src/schema/layout.d.ts +7 -0
  86. package/dist/package/declarations/src/schema/layout.js +52 -0
  87. package/dist/package/declarations/src/schema/types.d.ts +83 -0
  88. package/dist/package/declarations/src/schema/types.js +1 -0
  89. package/dist/package/declarations/src/theme/index.d.ts +29 -0
  90. package/dist/package/declarations/src/theme/index.js +83 -0
  91. package/dist/package/declarations/src/theme/palettes.d.ts +7 -0
  92. package/dist/package/declarations/src/theme/palettes.js +28 -0
  93. package/dist/package/declarations/src/theme/presets.d.ts +73 -0
  94. package/dist/package/declarations/src/theme/presets.js +235 -0
  95. package/dist/package/declarations/src/views/card/index.vue.d.ts +3 -0
  96. package/dist/package/declarations/src/views/card/index.vue.js +18 -0
  97. package/dist/package/declarations/src/views/dashboard/index.vue.d.ts +3 -0
  98. package/dist/package/declarations/src/views/dashboard/index.vue.js +107 -0
  99. package/dist/package/declarations/src/views/designer/index.vue.d.ts +3 -0
  100. package/dist/package/declarations/src/views/designer/index.vue.js +332 -0
  101. package/dist/package/declarations/src/views/manage/index.vue.d.ts +3 -0
  102. package/dist/package/declarations/src/views/manage/index.vue.js +325 -0
  103. package/dist/package/declarations/src/views/query/index.vue.d.ts +3 -0
  104. package/dist/package/declarations/src/views/query/index.vue.js +876 -0
  105. package/dist/package/declarations/src/views/source/index.vue.d.ts +3 -0
  106. package/dist/package/declarations/src/views/source/index.vue.js +343 -0
  107. package/dist/package/declarations/src/views/workbench/index.vue.d.ts +3 -0
  108. package/dist/package/declarations/src/views/workbench/index.vue.js +362 -0
  109. package/dist/package/src/api/bi/admin/v1/bi_card.ts +67 -0
  110. package/dist/package/src/api/bi/admin/v1/bi_dashboard.ts +51 -0
  111. package/dist/package/src/api/bi/admin/v1/bi_query.ts +55 -0
  112. package/dist/package/src/api/bi/admin/v1/bi_query_record.ts +25 -0
  113. package/dist/package/src/api/bi/admin/v1/bi_source.ts +80 -0
  114. package/dist/package/src/bi-core.ts +43 -0
  115. package/dist/package/src/bi-dashboard-schema.ts +69 -0
  116. package/dist/package/src/bi-messages.ts +249 -0
  117. package/dist/package/src/bi-response.ts +39 -0
  118. package/dist/package/src/bi-vue.ts +13 -0
  119. package/dist/package/src/card-schema.ts +111 -0
  120. package/dist/package/src/components/BiCardChartEditor.vue +139 -0
  121. package/dist/package/src/components/BiCardFormDialog.vue +289 -0
  122. package/dist/package/src/components/BiCardLibrary.vue +310 -0
  123. package/dist/package/src/components/BiCardVisualization.vue +95 -0
  124. package/dist/package/src/components/BiChart.vue +134 -0
  125. package/dist/package/src/components/BiDashboard.vue +53 -0
  126. package/dist/package/src/components/BiDashboardMenuDialog.vue +177 -0
  127. package/dist/package/src/components/BiDataCard.vue +231 -0
  128. package/dist/package/src/components/BiDesigner.vue +287 -0
  129. package/dist/package/src/components/BiSourceModelDialog.vue +846 -0
  130. package/dist/package/src/components/BiWorkbenchPreview.vue +131 -0
  131. package/dist/package/src/components/source-model-layout.ts +62 -0
  132. package/dist/package/src/dataset/index.ts +28 -0
  133. package/dist/package/src/dataset/labels.ts +19 -0
  134. package/dist/package/src/dataset/transform.ts +189 -0
  135. package/dist/package/src/engine/chart-types.ts +44 -0
  136. package/dist/package/src/engine/echarts.ts +568 -0
  137. package/dist/package/src/engine/types.ts +60 -0
  138. package/dist/package/src/env.ts +82 -0
  139. package/dist/package/src/index.ts +1 -0
  140. package/dist/package/src/locales/en-US.json +254 -0
  141. package/dist/package/src/locales/generated.ts +16 -0
  142. package/dist/package/src/locales/ja-JP.json +254 -0
  143. package/dist/package/src/locales/zh-CN.json +254 -0
  144. package/dist/package/src/locales/zh-TW.json +254 -0
  145. package/dist/package/src/module.ts +12 -0
  146. package/dist/package/src/rpc/bi/admin/v1/bi_card.ts +169 -0
  147. package/dist/package/src/rpc/bi/admin/v1/bi_dashboard.ts +126 -0
  148. package/dist/package/src/rpc/bi/admin/v1/bi_query.ts +187 -0
  149. package/dist/package/src/rpc/bi/admin/v1/bi_query_record.ts +98 -0
  150. package/dist/package/src/rpc/bi/admin/v1/bi_source.ts +338 -0
  151. package/dist/package/src/rpc/common/v1/types.ts +77 -0
  152. package/dist/package/src/schema/layout.ts +54 -0
  153. package/dist/package/src/schema/types.ts +103 -0
  154. package/dist/package/src/styles.scss +1 -0
  155. package/dist/package/src/theme/index.ts +108 -0
  156. package/dist/package/src/theme/palettes.ts +34 -0
  157. package/dist/package/src/theme/presets.ts +278 -0
  158. package/dist/package/src/views/card/index.vue +5 -0
  159. package/dist/package/src/views/dashboard/index.vue +58 -0
  160. package/dist/package/src/views/designer/index.vue +164 -0
  161. package/dist/package/src/views/manage/index.vue +276 -0
  162. package/dist/package/src/views/query/index.vue +593 -0
  163. package/dist/package/src/views/source/index.vue +214 -0
  164. package/dist/package/src/views/workbench/index.vue +208 -0
  165. package/package.json +67 -3
  166. package/tsconfig.json +12 -0
@@ -0,0 +1,876 @@
1
+ /// <reference types="../../../../../../node_modules/.pnpm/@vue+language-core@3.3.13/node_modules/@vue/language-core/types/template-helpers.d.ts" />
2
+ /// <reference types="../../../../../../node_modules/.pnpm/@vue+language-core@3.3.13/node_modules/@vue/language-core/types/props-fallback.d.ts" />
3
+ import { computed, onBeforeUnmount, onDeactivated, onMounted, ref, watch } from "vue";
4
+ import { useRoute, useRouter } from "vue-router";
5
+ import { t, useSpeechRecognition } from "@liujitcn/kratos-admin-core";
6
+ import AiModelSelector from "@liujitcn/kratos-admin-system/components/AiModelSelector/index.vue";
7
+ import { resolveModelSelection, saveModelSelection } from "@liujitcn/kratos-admin-system/components/AiModelSelector/modelSelection";
8
+ import { defAiModelService } from "@liujitcn/kratos-admin-system/api/base/v1/ai_provider";
9
+ import SessionPanel from "@liujitcn/kratos-admin-system/components/AiSessionPanel/index.vue";
10
+ import BiDataCard from "../../components/BiDataCard.vue";
11
+ import BiCardFormDialog from "../../components/BiCardFormDialog.vue";
12
+ import { normalizeBiQueryResult, normalizeBiQuerySpec } from "../../bi-response";
13
+ import { defBiQueryService } from "../../api/bi/admin/v1/bi_query";
14
+ import { defBiQueryRecordService } from "../../api/bi/admin/v1/bi_query_record";
15
+ const { defineOptions, } = {};
16
+ defineOptions({ name: "BiQuery", inheritAttrs: false });
17
+ const route = useRoute(), router = useRouter();
18
+ const icons = { Promotion, Microphone, Loading };
19
+ const question = ref(""), submittedQuestion = ref(""), loading = ref(false), error = ref(""), sources = ref([]), response = ref(), records = ref([]), keyword = ref(""), activeRecord = ref(""), historyCollapsed = ref(false), cardDialog = ref(false), showTable = ref(false);
20
+ const modelProviders = ref([]), selectedModel = ref({ provider_id: 0, model_name: "" }), loadingModels = ref(true);
21
+ let request = 0, historyRequest = 0, voiceBaseText = "";
22
+ let searchTimer;
23
+ const sessions = computed(() => records.value.map(item => ({
24
+ id: String(item.id),
25
+ title: item.question,
26
+ summary: `${sources.value.find(source => source.code === item.source_code)?.name || item.source_code || ""} · ${item.created_at || ""}`
27
+ })));
28
+ const { loading: recording, start: startRecord, stop: stopRecord } = useSpeechRecognition({
29
+ onStart: () => {
30
+ voiceBaseText = question.value;
31
+ },
32
+ onResult: text => {
33
+ question.value = [voiceBaseText, text].filter(Boolean).join(" ");
34
+ },
35
+ onError: cause => {
36
+ const key = cause.code === -1
37
+ ? "bi.query.voice_unsupported"
38
+ : ["not-allowed", "service-not-allowed", "permission-denied"].includes(cause.error ?? "")
39
+ ? "bi.query.microphone_denied"
40
+ : "bi.query.voice_failed";
41
+ ElMessage.warning(t(key));
42
+ }
43
+ });
44
+ const previewCard = computed(() => ({
45
+ id: 0,
46
+ tenant_id: 0,
47
+ project_id: 0,
48
+ owner_id: 0,
49
+ name: response.value?.title || "BI",
50
+ source_code: response.value?.query?.source_code || "",
51
+ query: response.value?.query,
52
+ chart_type: response.value?.query?.dimensions.length ? response.value.chart_type || "bar" : "metric",
53
+ chart_json: "",
54
+ query_record_id: response.value?.result?.query_record_id || 0,
55
+ refresh_seconds: 0,
56
+ is_shared: false,
57
+ updated_at: "",
58
+ category: "mine",
59
+ can_edit: true
60
+ }));
61
+ const tableRows = computed(() => (response.value?.result?.rows || []).map(row => Object.fromEntries(row.values.map((value, index) => [String(index), value]))));
62
+ /** Enter发送、Shift+Enter换行,输入法选字不提交。 */
63
+ function handleInputEnter(event) {
64
+ if (event.shiftKey || event.isComposing || event.keyCode === 229)
65
+ return;
66
+ event.preventDefault();
67
+ void ask();
68
+ }
69
+ /** 发起真实语义问数并关联服务端生成的结果记录。 */
70
+ async function ask() {
71
+ if (!question.value.trim() || loading.value || loadingModels.value || recording.value)
72
+ return;
73
+ const current = ++request;
74
+ submittedQuestion.value = question.value;
75
+ question.value = "";
76
+ response.value = undefined;
77
+ error.value = "";
78
+ loading.value = true;
79
+ showTable.value = false;
80
+ try {
81
+ const result = await defBiQueryService.AskBiQuery({ question: submittedQuestion.value, ...selectedModel.value });
82
+ if (current !== request)
83
+ return;
84
+ response.value = result;
85
+ activeRecord.value = String(result.result?.query_record_id || "");
86
+ await loadHistory();
87
+ }
88
+ catch (cause) {
89
+ if (current === request)
90
+ error.value = resolveAskError(cause);
91
+ }
92
+ finally {
93
+ if (current === request)
94
+ loading.value = false;
95
+ }
96
+ }
97
+ /** 左侧历史仅展示当前用户的自然语言问数,搜索仍由服务端过滤。 */
98
+ async function loadHistory() {
99
+ const current = ++historyRequest;
100
+ try {
101
+ const result = await defBiQueryRecordService.PageBiQuery({
102
+ question: keyword.value,
103
+ status: undefined,
104
+ source_code: "",
105
+ page_num: 1,
106
+ page_size: 100
107
+ });
108
+ if (current === historyRequest)
109
+ records.value = result.queries || [];
110
+ }
111
+ catch (cause) {
112
+ ElMessage.error(resolveAskError(cause));
113
+ }
114
+ }
115
+ /** 恢复历史问题和完整类型化结果,切换记录时丢弃旧请求。 */
116
+ async function selectRecord(id) {
117
+ if (!Number.isSafeInteger(id) || id <= 0)
118
+ return;
119
+ const current = ++request;
120
+ stopRecord();
121
+ loading.value = true;
122
+ error.value = "";
123
+ response.value = undefined;
124
+ activeRecord.value = String(id);
125
+ showTable.value = false;
126
+ try {
127
+ const item = await defBiQueryRecordService.GetBiQuery({ id });
128
+ if (current !== request)
129
+ return;
130
+ submittedQuestion.value = item.question;
131
+ if (!item.result) {
132
+ error.value = item.error_msg || t("bi.query.error");
133
+ return;
134
+ }
135
+ const spec = normalizeBiQuerySpec(JSON.parse(item.query_json));
136
+ response.value = {
137
+ query: spec,
138
+ result: normalizeBiQueryResult(item.result),
139
+ title: item.question || t("bi.query.result"),
140
+ chart_type: spec.dimensions.length ? "bar" : "metric"
141
+ };
142
+ }
143
+ catch (cause) {
144
+ if (current === request)
145
+ error.value = resolveAskError(cause);
146
+ }
147
+ finally {
148
+ if (current === request)
149
+ loading.value = false;
150
+ }
151
+ }
152
+ /** 新问题只清空当前输入与预览,不删除已有记录。 */
153
+ function newQuestion() {
154
+ request++;
155
+ stopRecord();
156
+ loading.value = false;
157
+ submittedQuestion.value = "";
158
+ question.value = "";
159
+ response.value = undefined;
160
+ activeRecord.value = "";
161
+ error.value = "";
162
+ }
163
+ /** 加载与 AI 助手一致的模型选项,并恢复仍可用的本地选择。 */
164
+ async function loadModels() {
165
+ loadingModels.value = true;
166
+ try {
167
+ const result = await defAiModelService.ListAiProviderModelOptions({});
168
+ modelProviders.value = result.providers ?? [];
169
+ selectedModel.value = resolveModelSelection(modelProviders.value);
170
+ }
171
+ catch (cause) {
172
+ error.value = resolveAskError(cause);
173
+ }
174
+ finally {
175
+ loadingModels.value = false;
176
+ }
177
+ }
178
+ /** 更新本次问数的模型,同时保存为 AI 助手和 BI 共用的本地选择。 */
179
+ function handleModelChange(providerId, modelName) {
180
+ selectedModel.value = { provider_id: providerId, model_name: modelName };
181
+ saveModelSelection(selectedModel.value);
182
+ }
183
+ /** 优先展示服务端返回的业务错误信息,请求失败时回退到通用错误文案。 */
184
+ function resolveAskError(cause) {
185
+ const responseData = cause?.response?.data;
186
+ if (typeof responseData?.message === "string" && responseData.message)
187
+ return responseData.message;
188
+ return cause instanceof Error ? cause.message : t("bi.query.error");
189
+ }
190
+ watch(keyword, () => {
191
+ clearTimeout(searchTimer);
192
+ searchTimer = setTimeout(() => void loadHistory(), 250);
193
+ });
194
+ watch(() => route.query.record_id, value => {
195
+ if (value)
196
+ void selectRecord(Number(value));
197
+ }, { immediate: true });
198
+ onMounted(async () => {
199
+ await Promise.all([loadHistory(), loadModels()]);
200
+ try {
201
+ sources.value = (await defBiQueryService.ListBiSources({})).sources;
202
+ }
203
+ catch (cause) {
204
+ error.value = resolveAskError(cause);
205
+ }
206
+ });
207
+ onDeactivated(() => {
208
+ request++;
209
+ loading.value = false;
210
+ stopRecord();
211
+ });
212
+ onBeforeUnmount(() => {
213
+ request++;
214
+ historyRequest++;
215
+ clearTimeout(searchTimer);
216
+ stopRecord();
217
+ });
218
+ const __VLS_ctx = {};
219
+ let __VLS_components;
220
+ let __VLS_intrinsics;
221
+ let __VLS_directives;
222
+ void __VLS_ctx, __VLS_components, __VLS_intrinsics, __VLS_directives;
223
+ // @ts-ignore
224
+ __VLS_withDotValue(historyCollapsed, {});
225
+ // @ts-ignore
226
+ __VLS_withDotValue(router, {});
227
+ // @ts-ignore
228
+ __VLS_withDotValue(submittedQuestion, {});
229
+ // @ts-ignore
230
+ __VLS_withDotValue(loading, {});
231
+ // @ts-ignore
232
+ __VLS_withDotValue(error, {});
233
+ // @ts-ignore
234
+ __VLS_withDotValue(response, {});
235
+ // @ts-ignore
236
+ __VLS_withDotValue(sources, {});
237
+ // @ts-ignore
238
+ __VLS_withDotValue(showTable, {});
239
+ // @ts-ignore
240
+ __VLS_withDotValue(recording, {});
241
+ // @ts-ignore
242
+ __VLS_withDotValue(selectedModel, {});
243
+ // @ts-ignore
244
+ __VLS_withDotValue(icons, {});
245
+ // @ts-ignore
246
+ __VLS_withDotValue(loadingModels, {});
247
+ // @ts-ignore
248
+ __VLS_withDotValue(question, {});
249
+ // @ts-ignore
250
+ __VLS_withDotValue(previewCard, {});
251
+ // @ts-ignore
252
+ __VLS_withDotValue(cardDialog, {});
253
+ void {};
254
+ /** @type {__VLS_StyleScopedClasses['bi-query-page__header']} */ ;
255
+ /** @type {__VLS_StyleScopedClasses['bi-query-page__header']} */ ;
256
+ /** @type {__VLS_StyleScopedClasses['bi-query-page__header']} */ ;
257
+ /** @type {__VLS_StyleScopedClasses['bi-query-layout']} */ ;
258
+ /** @type {__VLS_StyleScopedClasses['bi-query-messages']} */ ;
259
+ /** @type {__VLS_StyleScopedClasses['bi-query-facts']} */ ;
260
+ /** @type {__VLS_StyleScopedClasses['bi-query-preview']} */ ;
261
+ /** @type {__VLS_StyleScopedClasses['bi-query-compose__input']} */ ;
262
+ /** @type {__VLS_StyleScopedClasses['bi-query-compose__input']} */ ;
263
+ /** @type {__VLS_StyleScopedClasses['bi-query-compose__footer']} */ ;
264
+ /** @type {__VLS_StyleScopedClasses['bi-query-compose__button']} */ ;
265
+ /** @type {__VLS_StyleScopedClasses['bi-query-compose__button']} */ ;
266
+ /** @type {__VLS_StyleScopedClasses['bi-query-compose__button']} */ ;
267
+ /** @type {__VLS_StyleScopedClasses['bi-query-layout']} */ ;
268
+ /** @type {__VLS_StyleScopedClasses['bi-query-layout']} */ ;
269
+ /** @type {__VLS_StyleScopedClasses['is-history-collapsed']} */ ;
270
+ /** @type {__VLS_StyleScopedClasses['bi-query-layout']} */ ;
271
+ /** @type {__VLS_StyleScopedClasses['bi-query-chat']} */ ;
272
+ /** @type {__VLS_StyleScopedClasses['bi-query-preview']} */ ;
273
+ /** @type {__VLS_StyleScopedClasses['bi-query-page']} */ ;
274
+ /** @type {__VLS_StyleScopedClasses['bi-query-layout']} */ ;
275
+ /** @type {__VLS_StyleScopedClasses['bi-query-layout']} */ ;
276
+ /** @type {__VLS_StyleScopedClasses['agent-session-panel']} */ ;
277
+ /** @type {__VLS_StyleScopedClasses['bi-query-chat']} */ ;
278
+ /** @type {__VLS_StyleScopedClasses['bi-query-compose__actions']} */ ;
279
+ /** @type {__VLS_StyleScopedClasses['bi-query-compose__button']} */ ;
280
+ __VLS_asFunctionalElement1(__VLS_intrinsics.main, __VLS_intrinsics.main)({
281
+ ...{ class: "bi-query-page" },
282
+ });
283
+ /** @type {__VLS_StyleScopedClasses['bi-query-page']} */ ;
284
+ __VLS_asFunctionalElement1(__VLS_intrinsics.header, __VLS_intrinsics.header)({
285
+ ...{ class: "bi-query-page__header" },
286
+ });
287
+ /** @type {__VLS_StyleScopedClasses['bi-query-page__header']} */ ;
288
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({});
289
+ __VLS_asFunctionalElement1(__VLS_intrinsics.h2, __VLS_intrinsics.h2)({});
290
+ (__VLS_unwrap(t, {})("bi.query.subtitle"));
291
+ __VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({});
292
+ (__VLS_unwrap(t, {})("bi.query.guide"));
293
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({});
294
+ if (historyCollapsed.value) {
295
+ let __VLS_0;
296
+ /** @ts-ignore @type { | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button'] | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button']} */
297
+ elButton;
298
+ // @ts-ignore
299
+ const __VLS_1 = __VLS_asFunctionalComponent1(__VLS_0, new __VLS_0({
300
+ // @ts-ignore
301
+ ...{ 'onClick': {} },
302
+ }));
303
+ const __VLS_2 = __VLS_1({
304
+ ...{ 'onClick': {} },
305
+ }, ...__VLS_functionalComponentArgsRest(__VLS_1));
306
+ let __VLS_5;
307
+ const __VLS_6 = {
308
+ /** @type {typeof __VLS_5.click} */
309
+ onClick: // @ts-ignore
310
+ (...[$event]) => {
311
+ void $event;
312
+ if (!(historyCollapsed.value))
313
+ throw 0;
314
+ return (historyCollapsed.value = false);
315
+ // @ts-ignore
316
+ [t, t, historyCollapsed, historyCollapsed,];
317
+ },
318
+ };
319
+ void __VLS_6;
320
+ const { default: __VLS_7 } = __VLS_nonNull(__VLS_3.slots);
321
+ (__VLS_unwrap(t, {})("bi.query.history"));
322
+ // @ts-ignore
323
+ [t,];
324
+ var __VLS_3;
325
+ var __VLS_4;
326
+ }
327
+ let __VLS_8;
328
+ /** @ts-ignore @type { | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button'] | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button']} */
329
+ elButton;
330
+ // @ts-ignore
331
+ const __VLS_9 = __VLS_asFunctionalComponent1(__VLS_8, new __VLS_8({
332
+ // @ts-ignore
333
+ ...{ 'onClick': {} },
334
+ }));
335
+ const __VLS_10 = __VLS_9({
336
+ ...{ 'onClick': {} },
337
+ }, ...__VLS_functionalComponentArgsRest(__VLS_9));
338
+ let __VLS_13;
339
+ const __VLS_14 = {
340
+ /** @type {typeof __VLS_13.click} */
341
+ onClick: // @ts-ignore
342
+ (...[$event]) => {
343
+ void $event;
344
+ return (router.value.push('/bi/card'));
345
+ // @ts-ignore
346
+ [router,];
347
+ },
348
+ };
349
+ void __VLS_14;
350
+ const { default: __VLS_15 } = __VLS_nonNull(__VLS_11.slots);
351
+ (__VLS_unwrap(t, {})("bi.card.library"));
352
+ // @ts-ignore
353
+ [t,];
354
+ var __VLS_11;
355
+ var __VLS_12;
356
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
357
+ ...{ class: "bi-query-layout" },
358
+ ...{ class: ({ 'is-history-collapsed': historyCollapsed.value }) },
359
+ });
360
+ /** @type {__VLS_StyleScopedClasses['bi-query-layout']} */ ;
361
+ /** @type {__VLS_StyleScopedClasses['is-history-collapsed']} */ ;
362
+ if (!historyCollapsed.value) {
363
+ const __VLS_16 = SessionPanel;
364
+ // @ts-ignore
365
+ const __VLS_17 = __VLS_asFunctionalComponent1(__VLS_16, new __VLS_16({
366
+ // @ts-ignore
367
+ ...{ 'onChange': {} }, ...{ 'onCreate': {} }, ...{ 'onToggleCollapse': {} }, keyword: (__VLS_unwrap(keyword, {})), active: (__VLS_unwrap(activeRecord, {})), sessions: (__VLS_unwrap(sessions, {})), editable: (false), title: (__VLS_unwrap(t, {})('bi.query.history')), searchPlaceholder: (__VLS_unwrap(t, {})('bi.query.search_history')),
368
+ }));
369
+ const __VLS_18 = __VLS_17({
370
+ ...{ 'onChange': {} },
371
+ ...{ 'onCreate': {} },
372
+ ...{ 'onToggleCollapse': {} },
373
+ keyword: (__VLS_unwrap(keyword, {})),
374
+ active: (__VLS_unwrap(activeRecord, {})),
375
+ sessions: (__VLS_unwrap(sessions, {})),
376
+ editable: (false),
377
+ title: (__VLS_unwrap(t, {})('bi.query.history')),
378
+ searchPlaceholder: (__VLS_unwrap(t, {})('bi.query.search_history')),
379
+ }, ...__VLS_functionalComponentArgsRest(__VLS_17));
380
+ let __VLS_21;
381
+ const __VLS_22 = {
382
+ /** @type {typeof __VLS_21.change} */
383
+ onChange: (item => selectRecord(Number(item.id))),
384
+ };
385
+ void __VLS_22;
386
+ const __VLS_23 = {
387
+ /** @type {typeof __VLS_21.create} */
388
+ onCreate: (newQuestion),
389
+ };
390
+ void __VLS_23;
391
+ const __VLS_24 = {
392
+ /** @type {typeof __VLS_21.toggleCollapse} */
393
+ onToggleCollapse: // @ts-ignore
394
+ (...[$event]) => {
395
+ void $event;
396
+ if (!(!historyCollapsed.value))
397
+ throw 0;
398
+ return (historyCollapsed.value = true);
399
+ // @ts-ignore
400
+ [t, t, historyCollapsed, historyCollapsed, historyCollapsed, keyword, activeRecord, sessions,];
401
+ },
402
+ };
403
+ void __VLS_24;
404
+ var __VLS_19;
405
+ var __VLS_20;
406
+ }
407
+ __VLS_asFunctionalElement1(__VLS_intrinsics.section, __VLS_intrinsics.section)({
408
+ ...{ class: "bi-query-chat" },
409
+ 'aria-label': (__VLS_unwrap(t, {})('bi.query.title')),
410
+ });
411
+ /** @type {__VLS_StyleScopedClasses['bi-query-chat']} */ ;
412
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
413
+ ...{ class: "bi-query-messages" },
414
+ 'aria-live': "polite",
415
+ });
416
+ /** @type {__VLS_StyleScopedClasses['bi-query-messages']} */ ;
417
+ if (submittedQuestion.value) {
418
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
419
+ ...{ class: "bi-query-bubble" },
420
+ });
421
+ /** @type {__VLS_StyleScopedClasses['bi-query-bubble']} */ ;
422
+ (submittedQuestion.value);
423
+ }
424
+ if (loading.value) {
425
+ let __VLS_25;
426
+ /** @ts-ignore @type { | typeof __VLS_components.elSkeleton | typeof __VLS_components.ElSkeleton | typeof __VLS_components['el-skeleton']} */
427
+ elSkeleton;
428
+ // @ts-ignore
429
+ const __VLS_26 = __VLS_asFunctionalComponent1(__VLS_25, new __VLS_25({
430
+ // @ts-ignore
431
+ rows: (5), animated: true,
432
+ }));
433
+ const __VLS_27 = __VLS_26({
434
+ rows: (5),
435
+ animated: true,
436
+ }, ...__VLS_functionalComponentArgsRest(__VLS_26));
437
+ }
438
+ else if (error.value) {
439
+ let __VLS_30;
440
+ /** @ts-ignore @type { | typeof __VLS_components.elAlert | typeof __VLS_components.ElAlert | typeof __VLS_components['el-alert']} */
441
+ elAlert;
442
+ // @ts-ignore
443
+ const __VLS_31 = __VLS_asFunctionalComponent1(__VLS_30, new __VLS_30({
444
+ // @ts-ignore
445
+ title: (error.value), type: "error", showIcon: true, closable: (false),
446
+ }));
447
+ const __VLS_32 = __VLS_31({
448
+ title: (error.value),
449
+ type: "error",
450
+ showIcon: true,
451
+ closable: (false),
452
+ }, ...__VLS_functionalComponentArgsRest(__VLS_31));
453
+ }
454
+ else if (response.value) {
455
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
456
+ ...{ class: "bi-query-assistant" },
457
+ });
458
+ /** @type {__VLS_StyleScopedClasses['bi-query-assistant']} */ ;
459
+ (__VLS_unwrap(t, {})("bi.query.assistant"));
460
+ __VLS_asFunctionalElement1(__VLS_intrinsics.h3, __VLS_intrinsics.h3)({});
461
+ (response.value.title);
462
+ __VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({});
463
+ (__VLS_unwrap(t, {})("bi.query.result_ready"));
464
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
465
+ ...{ class: "bi-query-facts" },
466
+ });
467
+ /** @type {__VLS_StyleScopedClasses['bi-query-facts']} */ ;
468
+ __VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({});
469
+ (__VLS_unwrap(t, {})("bi.card.source"));
470
+ (sources.value.find(item => item.code === response.value?.query?.source_code)?.name || response.value.query?.source_code);
471
+ __VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({});
472
+ (__VLS_unwrap(t, {})("bi.card.dimensions"));
473
+ (response.value.query?.dimensions.join("、") || __VLS_unwrap(t, {})("bi.card.ungrouped"));
474
+ __VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({});
475
+ (__VLS_unwrap(t, {})("bi.card.measure"));
476
+ (response.value.query?.measures.map(item => item.code).join("、"));
477
+ let __VLS_35;
478
+ /** @ts-ignore @type { | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button'] | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button']} */
479
+ elButton;
480
+ // @ts-ignore
481
+ const __VLS_36 = __VLS_asFunctionalComponent1(__VLS_35, new __VLS_35({
482
+ // @ts-ignore
483
+ ...{ 'onClick': {} }, link: true, type: "primary",
484
+ }));
485
+ const __VLS_37 = __VLS_36({
486
+ ...{ 'onClick': {} },
487
+ link: true,
488
+ type: "primary",
489
+ }, ...__VLS_functionalComponentArgsRest(__VLS_36));
490
+ let __VLS_40;
491
+ const __VLS_41 = {
492
+ /** @type {typeof __VLS_40.click} */
493
+ onClick: // @ts-ignore
494
+ (...[$event]) => {
495
+ void $event;
496
+ if (!!(loading.value))
497
+ throw 0;
498
+ if (!!(error.value))
499
+ throw 0;
500
+ if (!(response.value))
501
+ throw 0;
502
+ return (showTable.value = !showTable.value);
503
+ // @ts-ignore
504
+ [t, t, t, t, t, t, t, submittedQuestion, submittedQuestion, loading, error, error, response, response, response, response, response, response, sources, showTable, showTable,];
505
+ },
506
+ };
507
+ void __VLS_41;
508
+ const { default: __VLS_42 } = __VLS_nonNull(__VLS_38.slots);
509
+ (__VLS_unwrap(t, {})(showTable.value ? "bi.query.hide_details" : "bi.card.table_tab"));
510
+ // @ts-ignore
511
+ [t, showTable,];
512
+ var __VLS_38;
513
+ var __VLS_39;
514
+ if (showTable.value) {
515
+ let __VLS_43;
516
+ /** @ts-ignore @type { | typeof __VLS_components.elTable | typeof __VLS_components.ElTable | typeof __VLS_components['el-table'] | typeof __VLS_components.elTable | typeof __VLS_components.ElTable | typeof __VLS_components['el-table']} */
517
+ elTable;
518
+ // @ts-ignore
519
+ const __VLS_44 = __VLS_asFunctionalComponent1(__VLS_43, new __VLS_43({
520
+ // @ts-ignore
521
+ data: (__VLS_unwrap(tableRows, {})), border: true, stripe: true,
522
+ }));
523
+ const __VLS_45 = __VLS_44({
524
+ data: (__VLS_unwrap(tableRows, {})),
525
+ border: true,
526
+ stripe: true,
527
+ }, ...__VLS_functionalComponentArgsRest(__VLS_44));
528
+ const { default: __VLS_48 } = __VLS_nonNull(__VLS_46.slots);
529
+ const __VLS_49 = __VLS_tryAsConstant((response.value.result?.columns || []));
530
+ for (const [column, index] of __VLS_vFor(__VLS_nonNull(__VLS_49))) {
531
+ let __VLS_50;
532
+ /** @ts-ignore @type { | typeof __VLS_components.elTableColumn | typeof __VLS_components.ElTableColumn | typeof __VLS_components['el-table-column']} */
533
+ elTableColumn;
534
+ // @ts-ignore
535
+ const __VLS_51 = __VLS_asFunctionalComponent1(__VLS_50, new __VLS_50({
536
+ // @ts-ignore
537
+ key: (column.code), prop: (String(index)), label: (column.name), minWidth: "120",
538
+ }));
539
+ const __VLS_52 = __VLS_51({
540
+ key: (column.code),
541
+ prop: (String(index)),
542
+ label: (column.name),
543
+ minWidth: "120",
544
+ }, ...__VLS_functionalComponentArgsRest(__VLS_51));
545
+ // @ts-ignore
546
+ [response, showTable, tableRows,];
547
+ }
548
+ // @ts-ignore
549
+ [];
550
+ var __VLS_46;
551
+ }
552
+ }
553
+ else {
554
+ let __VLS_55;
555
+ /** @ts-ignore @type { | typeof __VLS_components.elEmpty | typeof __VLS_components.ElEmpty | typeof __VLS_components['el-empty']} */
556
+ elEmpty;
557
+ // @ts-ignore
558
+ const __VLS_56 = __VLS_asFunctionalComponent1(__VLS_55, new __VLS_55({
559
+ // @ts-ignore
560
+ description: (__VLS_unwrap(t, {})('bi.query.empty')),
561
+ }));
562
+ const __VLS_57 = __VLS_56({
563
+ description: (__VLS_unwrap(t, {})('bi.query.empty')),
564
+ }, ...__VLS_functionalComponentArgsRest(__VLS_56));
565
+ }
566
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
567
+ ...{ class: "bi-query-compose" },
568
+ });
569
+ /** @type {__VLS_StyleScopedClasses['bi-query-compose']} */ ;
570
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
571
+ ...{ class: "bi-query-compose__input" },
572
+ });
573
+ /** @type {__VLS_StyleScopedClasses['bi-query-compose__input']} */ ;
574
+ let __VLS_60;
575
+ /** @ts-ignore @type { | typeof __VLS_components.elInput | typeof __VLS_components.ElInput | typeof __VLS_components['el-input']} */
576
+ elInput;
577
+ // @ts-ignore
578
+ const __VLS_61 = __VLS_asFunctionalComponent1(__VLS_60, new __VLS_60({
579
+ // @ts-ignore
580
+ ...{ 'onKeydown': {} }, modelValue: (question.value), type: "textarea", autosize: ({ minRows: 2, maxRows: 5 }), placeholder: (__VLS_unwrap(t, {})('bi.query.placeholder')), 'aria-label': (__VLS_unwrap(t, {})('bi.query.placeholder')), disabled: (loading.value), readonly: (recording.value),
581
+ }));
582
+ const __VLS_62 = __VLS_61({
583
+ ...{ 'onKeydown': {} },
584
+ modelValue: (question.value),
585
+ type: "textarea",
586
+ autosize: ({ minRows: 2, maxRows: 5 }),
587
+ placeholder: (__VLS_unwrap(t, {})('bi.query.placeholder')),
588
+ 'aria-label': (__VLS_unwrap(t, {})('bi.query.placeholder')),
589
+ disabled: (loading.value),
590
+ readonly: (recording.value),
591
+ }, ...__VLS_functionalComponentArgsRest(__VLS_61));
592
+ let __VLS_65;
593
+ const __VLS_66 = {
594
+ /** @type {typeof __VLS_65.keydown} */
595
+ onKeydown: // @ts-ignore
596
+ (...[$event]) => {
597
+ void $event;
598
+ return (handleInputEnter($event));
599
+ // @ts-ignore
600
+ [t, t, t, loading, question, recording,];
601
+ },
602
+ };
603
+ void __VLS_66;
604
+ var __VLS_63;
605
+ var __VLS_64;
606
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
607
+ ...{ class: "bi-query-compose__footer" },
608
+ });
609
+ /** @type {__VLS_StyleScopedClasses['bi-query-compose__footer']} */ ;
610
+ __VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
611
+ role: "status",
612
+ });
613
+ (recording.value
614
+ ? __VLS_unwrap(t, {})("bi.query.recognizing_voice")
615
+ : sources.value.find(source => source.code === response.value?.query?.source_code)?.name);
616
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
617
+ ...{ class: "bi-query-compose__actions" },
618
+ });
619
+ /** @type {__VLS_StyleScopedClasses['bi-query-compose__actions']} */ ;
620
+ const __VLS_67 = AiModelSelector;
621
+ // @ts-ignore
622
+ const __VLS_68 = __VLS_asFunctionalComponent1(__VLS_67, new __VLS_67({
623
+ // @ts-ignore
624
+ ...{ 'onChange': {} }, modelProviders: (__VLS_unwrap(modelProviders, {})), providerId: (selectedModel.value.provider_id), modelName: (selectedModel.value.model_name), disabled: (loading.value || loadingModels.value),
625
+ }));
626
+ const __VLS_69 = __VLS_68({
627
+ ...{ 'onChange': {} },
628
+ modelProviders: (__VLS_unwrap(modelProviders, {})),
629
+ providerId: (selectedModel.value.provider_id),
630
+ modelName: (selectedModel.value.model_name),
631
+ disabled: (loading.value || loadingModels.value),
632
+ }, ...__VLS_functionalComponentArgsRest(__VLS_68));
633
+ let __VLS_72;
634
+ const __VLS_73 = {
635
+ /** @type {typeof __VLS_72.change} */
636
+ onChange: (handleModelChange),
637
+ };
638
+ void __VLS_73;
639
+ var __VLS_70;
640
+ var __VLS_71;
641
+ let __VLS_74;
642
+ /** @ts-ignore @type { | typeof __VLS_components.elTooltip | typeof __VLS_components.ElTooltip | typeof __VLS_components['el-tooltip'] | typeof __VLS_components.elTooltip | typeof __VLS_components.ElTooltip | typeof __VLS_components['el-tooltip']} */
643
+ elTooltip;
644
+ // @ts-ignore
645
+ const __VLS_75 = __VLS_asFunctionalComponent1(__VLS_74, new __VLS_74({
646
+ // @ts-ignore
647
+ content: (__VLS_unwrap(t, {})(recording.value ? 'bi.query.stop_voice_input' : 'bi.query.voice_input')), placement: "top",
648
+ }));
649
+ const __VLS_76 = __VLS_75({
650
+ content: (__VLS_unwrap(t, {})(recording.value ? 'bi.query.stop_voice_input' : 'bi.query.voice_input')),
651
+ placement: "top",
652
+ }, ...__VLS_functionalComponentArgsRest(__VLS_75));
653
+ const { default: __VLS_79 } = __VLS_nonNull(__VLS_77.slots);
654
+ __VLS_asFunctionalElement1(__VLS_intrinsics.button, __VLS_intrinsics.button)({
655
+ ...{ onClick: // @ts-ignore
656
+ (...[$event]) => {
657
+ void $event;
658
+ return (recording.value ? __VLS_unwrap(stopRecord, {})() : __VLS_unwrap(startRecord, {})());
659
+ // @ts-ignore
660
+ [t, t, loading, response, sources, recording, recording, recording, modelProviders, selectedModel, selectedModel, loadingModels, stopRecord, startRecord,];
661
+ } },
662
+ ...{ class: "bi-query-compose__button" },
663
+ ...{ class: ({ 'is-active': recording.value }) },
664
+ type: "button",
665
+ disabled: (loading.value),
666
+ 'aria-pressed': (recording.value),
667
+ 'aria-label': (__VLS_unwrap(t, {})(recording.value ? 'bi.query.stop_voice_input' : 'bi.query.voice_input')),
668
+ });
669
+ /** @type {__VLS_StyleScopedClasses['bi-query-compose__button']} */ ;
670
+ /** @type {__VLS_StyleScopedClasses['is-active']} */ ;
671
+ let __VLS_80;
672
+ /** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
673
+ elIcon;
674
+ // @ts-ignore
675
+ const __VLS_81 = __VLS_asFunctionalComponent1(__VLS_80, new __VLS_80({
676
+ // @ts-ignore
677
+ ...{ class: ({ 'is-loading': recording.value }) },
678
+ }));
679
+ const __VLS_82 = __VLS_81({
680
+ ...{ class: ({ 'is-loading': recording.value }) },
681
+ }, ...__VLS_functionalComponentArgsRest(__VLS_81));
682
+ /** @type {__VLS_StyleScopedClasses['is-loading']} */ ;
683
+ const { default: __VLS_85 } = __VLS_nonNull(__VLS_83.slots);
684
+ const __VLS_86 = (recording.value ? icons.value.Loading : icons.value.Microphone);
685
+ // @ts-ignore
686
+ const __VLS_87 = __VLS_asFunctionalComponent1(__VLS_86, new __VLS_86({
687
+ // @ts-ignore
688
+ }));
689
+ const __VLS_88 = __VLS_87({}, ...__VLS_functionalComponentArgsRest(__VLS_87));
690
+ // @ts-ignore
691
+ [t, loading, recording, recording, recording, recording, recording, icons, icons,];
692
+ var __VLS_83;
693
+ // @ts-ignore
694
+ [];
695
+ var __VLS_77;
696
+ let __VLS_91;
697
+ /** @ts-ignore @type { | typeof __VLS_components.elTooltip | typeof __VLS_components.ElTooltip | typeof __VLS_components['el-tooltip'] | typeof __VLS_components.elTooltip | typeof __VLS_components.ElTooltip | typeof __VLS_components['el-tooltip']} */
698
+ elTooltip;
699
+ // @ts-ignore
700
+ const __VLS_92 = __VLS_asFunctionalComponent1(__VLS_91, new __VLS_91({
701
+ // @ts-ignore
702
+ content: (__VLS_unwrap(t, {})('bi.query.ask')), placement: "top",
703
+ }));
704
+ const __VLS_93 = __VLS_92({
705
+ content: (__VLS_unwrap(t, {})('bi.query.ask')),
706
+ placement: "top",
707
+ }, ...__VLS_functionalComponentArgsRest(__VLS_92));
708
+ const { default: __VLS_96 } = __VLS_nonNull(__VLS_94.slots);
709
+ __VLS_asFunctionalElement1(__VLS_intrinsics.button, __VLS_intrinsics.button)({
710
+ ...{ onClick: (ask) },
711
+ ...{ class: "bi-query-compose__button bi-query-compose__button--send" },
712
+ type: "button",
713
+ disabled: (loading.value || loadingModels.value || recording.value || !question.value.trim()),
714
+ 'aria-label': (__VLS_unwrap(t, {})('bi.query.ask')),
715
+ });
716
+ /** @type {__VLS_StyleScopedClasses['bi-query-compose__button']} */ ;
717
+ /** @type {__VLS_StyleScopedClasses['bi-query-compose__button--send']} */ ;
718
+ let __VLS_97;
719
+ /** @ts-ignore @type { | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon'] | typeof __VLS_components.elIcon | typeof __VLS_components.ElIcon | typeof __VLS_components['el-icon']} */
720
+ elIcon;
721
+ // @ts-ignore
722
+ const __VLS_98 = __VLS_asFunctionalComponent1(__VLS_97, new __VLS_97({
723
+ // @ts-ignore
724
+ ...{ class: ({ 'is-loading': loading.value }) },
725
+ }));
726
+ const __VLS_99 = __VLS_98({
727
+ ...{ class: ({ 'is-loading': loading.value }) },
728
+ }, ...__VLS_functionalComponentArgsRest(__VLS_98));
729
+ /** @type {__VLS_StyleScopedClasses['is-loading']} */ ;
730
+ const { default: __VLS_102 } = __VLS_nonNull(__VLS_100.slots);
731
+ const __VLS_103 = (loading.value ? icons.value.Loading : icons.value.Promotion);
732
+ // @ts-ignore
733
+ const __VLS_104 = __VLS_asFunctionalComponent1(__VLS_103, new __VLS_103({
734
+ // @ts-ignore
735
+ }));
736
+ const __VLS_105 = __VLS_104({}, ...__VLS_functionalComponentArgsRest(__VLS_104));
737
+ // @ts-ignore
738
+ [t, t, loading, loading, loading, question, recording, loadingModels, icons, icons,];
739
+ var __VLS_100;
740
+ // @ts-ignore
741
+ [];
742
+ var __VLS_94;
743
+ __VLS_asFunctionalElement1(__VLS_intrinsics.aside, __VLS_intrinsics.aside)({
744
+ ...{ class: "bi-query-preview" },
745
+ });
746
+ /** @type {__VLS_StyleScopedClasses['bi-query-preview']} */ ;
747
+ __VLS_asFunctionalElement1(__VLS_intrinsics.header, __VLS_intrinsics.header)({});
748
+ __VLS_asFunctionalElement1(__VLS_intrinsics.h3, __VLS_intrinsics.h3)({});
749
+ (__VLS_unwrap(t, {})("bi.card.preview"));
750
+ if (response.value?.result && response.value.query) {
751
+ const __VLS_108 = BiDataCard || BiDataCard;
752
+ // @ts-ignore
753
+ const __VLS_109 = __VLS_asFunctionalComponent1(__VLS_108, new __VLS_108({
754
+ // @ts-ignore
755
+ card: (previewCard.value), previewResult: (response.value.result), sourceName: (sources.value.find(item => item.code === previewCard.value.source_code)?.name || previewCard.value.source_code),
756
+ }));
757
+ const __VLS_110 = __VLS_109({
758
+ card: (previewCard.value),
759
+ previewResult: (response.value.result),
760
+ sourceName: (sources.value.find(item => item.code === previewCard.value.source_code)?.name || previewCard.value.source_code),
761
+ }, ...__VLS_functionalComponentArgsRest(__VLS_109));
762
+ const { default: __VLS_113 } = __VLS_nonNull(__VLS_111.slots);
763
+ {
764
+ const { footer: __VLS_114 } = __VLS_nonNull(__VLS_111.slots);
765
+ let __VLS_115;
766
+ /** @ts-ignore @type { | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button'] | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button']} */
767
+ elButton;
768
+ // @ts-ignore
769
+ const __VLS_116 = __VLS_asFunctionalComponent1(__VLS_115, new __VLS_115({
770
+ // @ts-ignore
771
+ ...{ 'onClick': {} }, link: true, type: "primary",
772
+ }));
773
+ const __VLS_117 = __VLS_116({
774
+ ...{ 'onClick': {} },
775
+ link: true,
776
+ type: "primary",
777
+ }, ...__VLS_functionalComponentArgsRest(__VLS_116));
778
+ let __VLS_120;
779
+ const __VLS_121 = {
780
+ /** @type {typeof __VLS_120.click} */
781
+ onClick: // @ts-ignore
782
+ (...[$event]) => {
783
+ void $event;
784
+ if (!(response.value?.result && response.value.query))
785
+ throw 0;
786
+ return (cardDialog.value = true);
787
+ // @ts-ignore
788
+ [t, response, response, response, sources, previewCard, previewCard, previewCard, cardDialog,];
789
+ },
790
+ };
791
+ void __VLS_121;
792
+ const { default: __VLS_122 } = __VLS_nonNull(__VLS_118.slots);
793
+ (__VLS_unwrap(t, {})("bi.card.edit"));
794
+ // @ts-ignore
795
+ [t,];
796
+ var __VLS_118;
797
+ var __VLS_119;
798
+ let __VLS_123;
799
+ /** @ts-ignore @type { | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button'] | typeof __VLS_components.elButton | typeof __VLS_components.ElButton | typeof __VLS_components['el-button']} */
800
+ elButton;
801
+ // @ts-ignore
802
+ const __VLS_124 = __VLS_asFunctionalComponent1(__VLS_123, new __VLS_123({
803
+ // @ts-ignore
804
+ ...{ 'onClick': {} }, type: "primary",
805
+ }));
806
+ const __VLS_125 = __VLS_124({
807
+ ...{ 'onClick': {} },
808
+ type: "primary",
809
+ }, ...__VLS_functionalComponentArgsRest(__VLS_124));
810
+ let __VLS_128;
811
+ const __VLS_129 = {
812
+ /** @type {typeof __VLS_128.click} */
813
+ onClick: // @ts-ignore
814
+ (...[$event]) => {
815
+ void $event;
816
+ if (!(response.value?.result && response.value.query))
817
+ throw 0;
818
+ return (cardDialog.value = true);
819
+ // @ts-ignore
820
+ [cardDialog,];
821
+ },
822
+ };
823
+ void __VLS_129;
824
+ const { default: __VLS_130 } = __VLS_nonNull(__VLS_126.slots);
825
+ (__VLS_unwrap(t, {})("bi.card.save_result"));
826
+ // @ts-ignore
827
+ [t,];
828
+ var __VLS_126;
829
+ var __VLS_127;
830
+ // @ts-ignore
831
+ [];
832
+ }
833
+ // @ts-ignore
834
+ [];
835
+ var __VLS_111;
836
+ }
837
+ else {
838
+ let __VLS_131;
839
+ /** @ts-ignore @type { | typeof __VLS_components.elEmpty | typeof __VLS_components.ElEmpty | typeof __VLS_components['el-empty']} */
840
+ elEmpty;
841
+ // @ts-ignore
842
+ const __VLS_132 = __VLS_asFunctionalComponent1(__VLS_131, new __VLS_131({
843
+ // @ts-ignore
844
+ description: (__VLS_unwrap(t, {})('bi.card.preview_empty')),
845
+ }));
846
+ const __VLS_133 = __VLS_132({
847
+ description: (__VLS_unwrap(t, {})('bi.card.preview_empty')),
848
+ }, ...__VLS_functionalComponentArgsRest(__VLS_132));
849
+ }
850
+ const __VLS_136 = BiCardFormDialog;
851
+ // @ts-ignore
852
+ const __VLS_137 = __VLS_asFunctionalComponent1(__VLS_136, new __VLS_136({
853
+ // @ts-ignore
854
+ ...{ 'onSaved': {} }, modelValue: (cardDialog.value), sources: (sources.value), initialQuery: (response.value?.query), initialResult: (response.value?.result), initialTitle: (response.value?.title), initialChartType: (previewCard.value.chart_type),
855
+ }));
856
+ const __VLS_138 = __VLS_137({
857
+ ...{ 'onSaved': {} },
858
+ modelValue: (cardDialog.value),
859
+ sources: (sources.value),
860
+ initialQuery: (response.value?.query),
861
+ initialResult: (response.value?.result),
862
+ initialTitle: (response.value?.title),
863
+ initialChartType: (previewCard.value.chart_type),
864
+ }, ...__VLS_functionalComponentArgsRest(__VLS_137));
865
+ let __VLS_141;
866
+ const __VLS_142 = {
867
+ /** @type {typeof __VLS_141.saved} */
868
+ onSaved: (loadHistory),
869
+ };
870
+ void __VLS_142;
871
+ var __VLS_139;
872
+ var __VLS_140;
873
+ // @ts-ignore
874
+ [t, response, response, response, sources, previewCard, cardDialog,];
875
+ const __VLS_export = (await import('vue')).defineComponent({});
876
+ export default {};