yc-agent-ui 1.2.3 → 1.2.5

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 (156) hide show
  1. package/es/components/descriptions/index.d.ts +3 -3
  2. package/es/components/descriptions/src/index.vue.d.ts +1 -1
  3. package/es/components/dialog/index.d.ts +6 -6
  4. package/es/components/dialog/src/index.vue.d.ts +2 -2
  5. package/es/components/dialog-form/index.d.ts +4 -4
  6. package/es/components/dialog-form/src/index.vue.d.ts +4 -4
  7. package/es/components/display-item/index.d.ts +15 -15
  8. package/es/components/display-item/src/index.vue.d.ts +13 -13
  9. package/es/components/drawer-form/index.d.ts +22 -22
  10. package/es/components/drawer-form/src/index.vue.d.ts +10 -10
  11. package/es/components/form/index.d.ts +43 -43
  12. package/es/components/form/src/form-content.vue.d.ts +15 -15
  13. package/es/components/form/src/index.vue.d.ts +21 -21
  14. package/es/components/form-item/index.d.ts +61 -61
  15. package/es/components/form-item/src/index.vue.d.ts +24 -24
  16. package/es/components/index.d.ts +1 -0
  17. package/es/components/page/index.d.ts +936 -936
  18. package/es/components/page/src/index.vue.d.ts +316 -316
  19. package/es/components/popover/index.d.ts +9 -9
  20. package/es/components/popover/src/index.vue.d.ts +3 -3
  21. package/es/components/search/index.d.ts +282 -282
  22. package/es/components/search/src/index.vue.d.ts +98 -98
  23. package/es/components/table/index.d.ts +9 -9
  24. package/es/components/table/src/index.vue.d.ts +1 -1
  25. package/es/components/table/src/table-column.vue.d.ts +34 -34
  26. package/es/components/utils/index.d.ts +1 -1
  27. package/es/components/yc-ai-chat/index.d.ts +2 -1
  28. package/es/components/yc-ai-chat/src/question-card.vue.d.ts +17 -0
  29. package/es/components/yc-ai-chat/src/question-validation.d.ts +5 -0
  30. package/es/components/yc-ai-chat/src/type.d.ts +51 -0
  31. package/es/components/yc-date-picker/src/date-picker.vue.d.ts +1 -1
  32. package/es/components/yc-display-cards/capability.d.ts +4 -0
  33. package/es/components/yc-display-cards/index.d.ts +24 -0
  34. package/es/components/yc-display-cards/src/detail-card.vue.d.ts +10 -0
  35. package/es/components/yc-display-cards/src/metrics-card.vue.d.ts +8 -0
  36. package/es/components/yc-display-cards/src/table-card.vue.d.ts +12 -0
  37. package/es/components/yc-display-cards/src/types.d.ts +47 -0
  38. package/es/components/yc-input/src/input.vue.d.ts +1 -1
  39. package/es/components/yc-input/src/money-input.vue.d.ts +1 -1
  40. package/es/components/yc-plus-page/src/index.vue.d.ts +946 -946
  41. package/es/components/yc-plus-tree/src/index.vue.d.ts +1 -1
  42. package/es/components/yc-questionnaire/src/index.vue.d.ts +1 -1
  43. package/es/components/yc-status-dialog/src/index.vue.d.ts +1 -1
  44. package/es/hooks/usePlusFormReset.d.ts +132 -132
  45. package/es/index.css +11 -8
  46. package/es/index.mjs +2 -0
  47. package/es/packages/components/index.mjs +2 -0
  48. package/es/packages/components/yc-ai-chat/index.mjs +1 -0
  49. package/es/packages/components/yc-ai-chat/src/question-card.vue.mjs +5 -0
  50. package/es/packages/components/yc-ai-chat/src/question-card2.vue.mjs +613 -0
  51. package/es/packages/components/yc-ai-chat/src/question-validation.mjs +77 -0
  52. package/es/packages/components/yc-display-cards/capability.mjs +75 -0
  53. package/es/packages/components/yc-display-cards/index.mjs +10 -0
  54. package/es/packages/components/yc-display-cards/src/detail-card.vue.mjs +6 -0
  55. package/es/packages/components/yc-display-cards/src/detail-card2.vue.mjs +118 -0
  56. package/es/packages/components/yc-display-cards/src/metrics-card.vue.mjs +6 -0
  57. package/es/packages/components/yc-display-cards/src/metrics-card2.vue.mjs +132 -0
  58. package/es/packages/components/yc-display-cards/src/table-card.vue.mjs +6 -0
  59. package/es/packages/components/yc-display-cards/src/table-card2.vue.mjs +199 -0
  60. package/es/packages/components/yc-display-cards/src/types.mjs +1 -0
  61. package/es/packages/registry/load.mjs +9 -8
  62. package/es/version.d.ts +1 -1
  63. package/es/version.mjs +1 -1
  64. package/index.css +4 -1
  65. package/index.js +2546 -1335
  66. package/index.min.css +3 -0
  67. package/index.min.js +23 -23
  68. package/index.min.mjs +23 -23
  69. package/index.mjs +2535 -1328
  70. package/lib/components/descriptions/index.d.ts +3 -3
  71. package/lib/components/descriptions/src/index.vue.d.ts +1 -1
  72. package/lib/components/dialog/index.d.ts +6 -6
  73. package/lib/components/dialog/src/index.vue.d.ts +2 -2
  74. package/lib/components/dialog-form/index.d.ts +4 -4
  75. package/lib/components/dialog-form/src/index.vue.d.ts +4 -4
  76. package/lib/components/display-item/index.d.ts +15 -15
  77. package/lib/components/display-item/src/index.vue.d.ts +13 -13
  78. package/lib/components/drawer-form/index.d.ts +22 -22
  79. package/lib/components/drawer-form/src/index.vue.d.ts +10 -10
  80. package/lib/components/form/index.d.ts +43 -43
  81. package/lib/components/form/src/form-content.vue.d.ts +15 -15
  82. package/lib/components/form/src/index.vue.d.ts +21 -21
  83. package/lib/components/form-item/index.d.ts +61 -61
  84. package/lib/components/form-item/src/index.vue.d.ts +24 -24
  85. package/lib/components/index.d.ts +1 -0
  86. package/lib/components/page/index.d.ts +936 -936
  87. package/lib/components/page/src/index.vue.d.ts +316 -316
  88. package/lib/components/popover/index.d.ts +9 -9
  89. package/lib/components/popover/src/index.vue.d.ts +3 -3
  90. package/lib/components/search/index.d.ts +282 -282
  91. package/lib/components/search/src/index.vue.d.ts +98 -98
  92. package/lib/components/table/index.d.ts +9 -9
  93. package/lib/components/table/src/index.vue.d.ts +1 -1
  94. package/lib/components/table/src/table-column.vue.d.ts +34 -34
  95. package/lib/components/utils/index.d.ts +1 -1
  96. package/lib/components/yc-ai-chat/index.d.ts +2 -1
  97. package/lib/components/yc-ai-chat/src/question-card.vue.d.ts +17 -0
  98. package/lib/components/yc-ai-chat/src/question-validation.d.ts +5 -0
  99. package/lib/components/yc-ai-chat/src/type.d.ts +51 -0
  100. package/lib/components/yc-date-picker/src/date-picker.vue.d.ts +1 -1
  101. package/lib/components/yc-display-cards/capability.d.ts +4 -0
  102. package/lib/components/yc-display-cards/index.d.ts +24 -0
  103. package/lib/components/yc-display-cards/src/detail-card.vue.d.ts +10 -0
  104. package/lib/components/yc-display-cards/src/metrics-card.vue.d.ts +8 -0
  105. package/lib/components/yc-display-cards/src/table-card.vue.d.ts +12 -0
  106. package/lib/components/yc-display-cards/src/types.d.ts +47 -0
  107. package/lib/components/yc-input/src/input.vue.d.ts +1 -1
  108. package/lib/components/yc-input/src/money-input.vue.d.ts +1 -1
  109. package/lib/components/yc-plus-page/src/index.vue.d.ts +946 -946
  110. package/lib/components/yc-plus-tree/src/index.vue.d.ts +1 -1
  111. package/lib/components/yc-questionnaire/src/index.vue.d.ts +1 -1
  112. package/lib/components/yc-status-dialog/src/index.vue.d.ts +1 -1
  113. package/lib/hooks/usePlusFormReset.d.ts +132 -132
  114. package/lib/index.css +11 -8
  115. package/lib/index.js +12 -6
  116. package/lib/packages/components/index.js +12 -6
  117. package/lib/packages/components/yc-ai-chat/index.js +2 -0
  118. package/lib/packages/components/yc-ai-chat/src/question-card.vue.js +9 -0
  119. package/lib/packages/components/yc-ai-chat/src/question-card2.vue.js +617 -0
  120. package/lib/packages/components/yc-ai-chat/src/question-validation.js +81 -0
  121. package/lib/packages/components/yc-display-cards/capability.js +79 -0
  122. package/lib/packages/components/yc-display-cards/index.js +14 -0
  123. package/lib/packages/components/yc-display-cards/src/detail-card.vue.js +10 -0
  124. package/lib/packages/components/yc-display-cards/src/detail-card2.vue.js +122 -0
  125. package/lib/packages/components/yc-display-cards/src/metrics-card.vue.js +10 -0
  126. package/lib/packages/components/yc-display-cards/src/metrics-card2.vue.js +136 -0
  127. package/lib/packages/components/yc-display-cards/src/table-card.vue.js +10 -0
  128. package/lib/packages/components/yc-display-cards/src/table-card2.vue.js +203 -0
  129. package/lib/packages/components/yc-display-cards/src/types.js +2 -0
  130. package/lib/packages/registry/load.js +9 -8
  131. package/lib/version.d.ts +1 -1
  132. package/lib/version.js +1 -1
  133. package/locale/en.js +1 -1
  134. package/locale/en.min.js +1 -1
  135. package/locale/en.min.mjs +1 -1
  136. package/locale/en.mjs +1 -1
  137. package/locale/ja.js +1 -1
  138. package/locale/ja.min.js +1 -1
  139. package/locale/ja.min.mjs +1 -1
  140. package/locale/ja.mjs +1 -1
  141. package/locale/ko.js +1 -1
  142. package/locale/ko.min.js +1 -1
  143. package/locale/ko.min.mjs +1 -1
  144. package/locale/ko.mjs +1 -1
  145. package/locale/zh-cn.js +1 -1
  146. package/locale/zh-cn.min.js +1 -1
  147. package/locale/zh-cn.min.mjs +1 -1
  148. package/locale/zh-cn.mjs +1 -1
  149. package/locale/zh-tw.js +1 -1
  150. package/locale/zh-tw.min.js +1 -1
  151. package/locale/zh-tw.min.mjs +1 -1
  152. package/locale/zh-tw.mjs +1 -1
  153. package/package.json +1 -1
  154. package/theme-chalk/index.css +4 -1
  155. package/theme-chalk/plus-yc-ai-chat.css +1 -1
  156. package/theme-chalk/src/yc-ai-chat.scss +498 -0
@@ -0,0 +1,617 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ var questionValidation = require('./question-validation.js');
7
+
8
+ const _hoisted_1 = ["data-state", "data-testid"];
9
+ const _hoisted_2 = { class: "yc-chat-question-card__header question-card__header" };
10
+ const _hoisted_3 = { class: "yc-chat-question-card__title-wrap" };
11
+ const _hoisted_4 = {
12
+ key: 0,
13
+ viewBox: "0 0 18 18",
14
+ fill: "none"
15
+ };
16
+ const _hoisted_5 = {
17
+ key: 1,
18
+ viewBox: "0 0 18 18",
19
+ fill: "none"
20
+ };
21
+ const _hoisted_6 = { class: "yc-chat-question-card__title" };
22
+ const _hoisted_7 = { class: "yc-chat-question-card__header-meta" };
23
+ const _hoisted_8 = {
24
+ key: 0,
25
+ class: "yc-chat-question-card__summary",
26
+ "data-testid": "question-card-summary"
27
+ };
28
+ const _hoisted_9 = { class: "yc-chat-question-card__summary-question" };
29
+ const _hoisted_10 = {
30
+ key: 0,
31
+ class: "yc-chat-question-card__answer-chips"
32
+ };
33
+ const _hoisted_11 = {
34
+ key: 0,
35
+ class: "yc-chat-question-card__answer-chip is-other"
36
+ };
37
+ const _hoisted_12 = {
38
+ key: 1,
39
+ class: "yc-chat-question-card__summary-empty"
40
+ };
41
+ const _hoisted_13 = {
42
+ key: 1,
43
+ class: "yc-chat-question-card__questions"
44
+ };
45
+ const _hoisted_14 = ["disabled"];
46
+ const _hoisted_15 = { class: "yc-chat-question-card__legend" };
47
+ const _hoisted_16 = {
48
+ key: 0,
49
+ class: "yc-chat-question-card__mode-tag"
50
+ };
51
+ const _hoisted_17 = { class: "yc-chat-question-card__options" };
52
+ const _hoisted_18 = ["data-testid", "type", "name", "checked", "onChange"];
53
+ const _hoisted_19 = {
54
+ key: 0,
55
+ viewBox: "0 0 12 12",
56
+ fill: "none"
57
+ };
58
+ const _hoisted_20 = { class: "yc-chat-question-card__option-body" };
59
+ const _hoisted_21 = { class: "yc-chat-question-card__option-label" };
60
+ const _hoisted_22 = {
61
+ key: 0,
62
+ class: "yc-chat-question-card__option-desc"
63
+ };
64
+ const _hoisted_23 = {
65
+ key: 1,
66
+ class: "yc-chat-question-card__event question-card__event"
67
+ };
68
+ const _hoisted_24 = ["data-testid", "type", "name", "checked", "onChange"];
69
+ const _hoisted_25 = {
70
+ key: 0,
71
+ viewBox: "0 0 12 12",
72
+ fill: "none"
73
+ };
74
+ const _hoisted_26 = { class: "yc-chat-question-card__option-body" };
75
+ const _hoisted_27 = { class: "yc-chat-question-card__option-label" };
76
+ const _hoisted_28 = {
77
+ key: 0,
78
+ class: "yc-chat-question-card__textarea-box"
79
+ };
80
+ const _hoisted_29 = ["onUpdate:modelValue", "data-testid"];
81
+ const _hoisted_30 = {
82
+ key: 2,
83
+ class: "yc-chat-question-card__notice question-card__notice"
84
+ };
85
+ const _hoisted_31 = {
86
+ key: 3,
87
+ class: "yc-chat-question-card__notice question-card__notice"
88
+ };
89
+ const _hoisted_32 = {
90
+ key: 4,
91
+ class: "yc-chat-question-card__notice question-card__notice",
92
+ "data-testid": "client-event-not-executed"
93
+ };
94
+ const _hoisted_33 = {
95
+ key: 5,
96
+ class: "yc-chat-question-card__actions question-card__actions"
97
+ };
98
+ const _hoisted_34 = ["disabled"];
99
+ const _hoisted_35 = ["disabled"];
100
+ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
101
+ ...{
102
+ name: "YcChatQuestionCard"
103
+ },
104
+ __name: "question-card",
105
+ props: {
106
+ interaction: {},
107
+ submitting: { type: Boolean, default: false },
108
+ answerEnabled: { type: Boolean, default: true },
109
+ unavailableReason: { default: "" },
110
+ title: { default: "\u9700\u8981\u4F60\u7684\u56DE\u7B54" },
111
+ compact: { type: Boolean, default: false }
112
+ },
113
+ emits: ["answer", "cancel"],
114
+ setup(__props, { emit: __emit }) {
115
+ const props = __props;
116
+ const emit = __emit;
117
+ const selected = vue.reactive({});
118
+ const otherActive = vue.reactive({});
119
+ const otherText = vue.reactive({});
120
+ const showDetails = vue.ref(false);
121
+ const statusLabels = {
122
+ preparing: "\u51C6\u5907\u4E2D",
123
+ pending: "\u5F85\u56DE\u7B54",
124
+ answered: "\u5DF2\u56DE\u7B54",
125
+ invalidated: "\u5DF2\u5931\u6548",
126
+ expired: "\u5DF2\u8FC7\u671F",
127
+ cancelled: "\u5DF2\u53D6\u6D88",
128
+ superseded: "\u5DF2\u88AB\u65B0\u6D88\u606F\u66FF\u4EE3"
129
+ };
130
+ vue.watch(
131
+ () => [props.interaction.request.request_id, props.interaction.state],
132
+ () => {
133
+ showDetails.value = false;
134
+ }
135
+ );
136
+ vue.watch(
137
+ () => [props.interaction.request.request_id, props.interaction.answers],
138
+ () => {
139
+ var _a, _b;
140
+ for (const question of props.interaction.request.questions) {
141
+ const answer = props.interaction.answers.find(
142
+ (item) => item.question_id === question.id
143
+ );
144
+ selected[question.id] = [...(_a = answer == null ? void 0 : answer.selected_option_ids) != null ? _a : []];
145
+ otherActive[question.id] = (answer == null ? void 0 : answer.other_text) != null;
146
+ otherText[question.id] = (_b = answer == null ? void 0 : answer.other_text) != null ? _b : "";
147
+ }
148
+ },
149
+ { immediate: true, deep: true }
150
+ );
151
+ const requestIsValid = vue.computed(
152
+ () => questionValidation.validChatQuestionRequest(props.interaction.request)
153
+ );
154
+ const isPending = vue.computed(() => props.interaction.state === "pending");
155
+ const showForm = vue.computed(() => isPending.value || showDetails.value);
156
+ const answerSummaries = vue.computed(
157
+ () => props.interaction.request.questions.map((question) => {
158
+ var _a, _b, _c, _d;
159
+ const answer = props.interaction.answers.find(
160
+ (item) => item.question_id === question.id
161
+ );
162
+ const optionIds = (_b = (_a = answer == null ? void 0 : answer.selected_option_ids) != null ? _a : selected[question.id]) != null ? _b : [];
163
+ const labels = optionIds.map(
164
+ (id) => {
165
+ var _a2, _b2;
166
+ return (_b2 = (_a2 = question.options.find((option) => option.id === id)) == null ? void 0 : _a2.label) != null ? _b2 : id;
167
+ }
168
+ );
169
+ const customText = ((_d = (_c = answer == null ? void 0 : answer.other_text) != null ? _c : otherActive[question.id] ? otherText[question.id] : "") != null ? _d : "").trim();
170
+ return {
171
+ id: question.id,
172
+ title: question.title,
173
+ labels,
174
+ customText
175
+ };
176
+ })
177
+ );
178
+ const canAnswer = vue.computed(
179
+ () => props.answerEnabled && props.interaction.state === "pending" && requestIsValid.value
180
+ );
181
+ const complete = vue.computed(
182
+ () => props.interaction.request.questions.every((question) => {
183
+ var _a, _b, _c;
184
+ if (otherActive[question.id]) {
185
+ return questionValidation.validChatOtherText((_a = otherText[question.id]) != null ? _a : "");
186
+ }
187
+ return ((_c = (_b = selected[question.id]) == null ? void 0 : _b.length) != null ? _c : 0) > 0;
188
+ })
189
+ );
190
+ function optionChecked(question, optionId) {
191
+ var _a, _b;
192
+ return (_b = (_a = selected[question.id]) == null ? void 0 : _a.includes(optionId)) != null ? _b : false;
193
+ }
194
+ function selectOption(question, optionId) {
195
+ var _a;
196
+ if (!canAnswer.value) return;
197
+ otherActive[question.id] = false;
198
+ otherText[question.id] = "";
199
+ if (question.selection_mode === "single") {
200
+ selected[question.id] = [optionId];
201
+ return;
202
+ }
203
+ const current = (_a = selected[question.id]) != null ? _a : [];
204
+ selected[question.id] = current.includes(optionId) ? current.filter((id) => id !== optionId) : [...current, optionId];
205
+ }
206
+ function selectOther(question, enabled) {
207
+ if (!canAnswer.value) return;
208
+ otherActive[question.id] = enabled;
209
+ if (enabled) selected[question.id] = [];
210
+ }
211
+ function eventSummary(option) {
212
+ if (!option.event) return "";
213
+ const text = JSON.stringify(option.event.payload);
214
+ return text.length > 160 ? `${text.slice(0, 157)}...` : text;
215
+ }
216
+ function submit() {
217
+ if (!canAnswer.value || !complete.value || props.submitting) return;
218
+ const answers = props.interaction.request.questions.map((question) => {
219
+ var _a, _b;
220
+ return {
221
+ question_id: question.id,
222
+ selected_option_ids: otherActive[question.id] ? [] : [...(_a = selected[question.id]) != null ? _a : []].sort(),
223
+ other_text: otherActive[question.id] ? ((_b = otherText[question.id]) == null ? void 0 : _b.trim()) || null : null
224
+ };
225
+ });
226
+ if (questionValidation.validChatAnswersForRequest(props.interaction.request, answers)) {
227
+ emit("answer", answers);
228
+ }
229
+ }
230
+ return (_ctx, _cache) => {
231
+ var _a;
232
+ return vue.openBlock(), vue.createElementBlock("section", {
233
+ class: vue.normalizeClass(["yc-chat-question-card question-card", {
234
+ "is-compact": __props.compact,
235
+ "is-readonly": !canAnswer.value,
236
+ "is-summary": !showForm.value
237
+ }]),
238
+ "data-state": __props.interaction.state,
239
+ "data-testid": `question-card-${__props.interaction.request.request_id}`
240
+ }, [
241
+ vue.createElementVNode("header", _hoisted_2, [
242
+ vue.createElementVNode("div", _hoisted_3, [
243
+ vue.createElementVNode(
244
+ "span",
245
+ {
246
+ class: vue.normalizeClass(["yc-chat-question-card__badge-icon", { "is-answered": __props.interaction.state === "answered" }]),
247
+ "aria-hidden": "true"
248
+ },
249
+ [
250
+ __props.interaction.state === "answered" ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_4, [..._cache[2] || (_cache[2] = [
251
+ vue.createElementVNode(
252
+ "path",
253
+ {
254
+ d: "M4.2 9.4L7.4 12.6L13.8 5.8",
255
+ stroke: "currentColor",
256
+ "stroke-width": "2",
257
+ "stroke-linecap": "round",
258
+ "stroke-linejoin": "round"
259
+ },
260
+ null,
261
+ -1
262
+ /* CACHED */
263
+ )
264
+ ])])) : (vue.openBlock(), vue.createElementBlock("svg", _hoisted_5, [..._cache[3] || (_cache[3] = [
265
+ vue.createElementVNode(
266
+ "path",
267
+ {
268
+ d: "M9 2.25C9.42 5.45 10.75 6.78 13.95 7.2C10.75 7.62 9.42 8.95 9 12.15C8.58 8.95 7.25 7.62 4.05 7.2C7.25 6.78 8.58 5.45 9 2.25Z",
269
+ fill: "currentColor"
270
+ },
271
+ null,
272
+ -1
273
+ /* CACHED */
274
+ ),
275
+ vue.createElementVNode(
276
+ "circle",
277
+ {
278
+ cx: "14.2",
279
+ cy: "13.2",
280
+ r: "1.35",
281
+ fill: "currentColor",
282
+ opacity: "0.7"
283
+ },
284
+ null,
285
+ -1
286
+ /* CACHED */
287
+ )
288
+ ])]))
289
+ ],
290
+ 2
291
+ /* CLASS */
292
+ ),
293
+ vue.createElementVNode(
294
+ "strong",
295
+ _hoisted_6,
296
+ vue.toDisplayString(__props.title),
297
+ 1
298
+ /* TEXT */
299
+ )
300
+ ]),
301
+ vue.createElementVNode("div", _hoisted_7, [
302
+ !isPending.value ? (vue.openBlock(), vue.createElementBlock(
303
+ "button",
304
+ {
305
+ key: 0,
306
+ type: "button",
307
+ class: "yc-chat-question-card__toggle-btn",
308
+ "data-testid": "toggle-question-details",
309
+ onClick: _cache[0] || (_cache[0] = ($event) => showDetails.value = !showDetails.value)
310
+ },
311
+ vue.toDisplayString(showDetails.value ? "\u6536\u8D77\u9009\u9879" : "\u67E5\u770B\u9009\u9879"),
312
+ 1
313
+ /* TEXT */
314
+ )) : vue.createCommentVNode("v-if", true),
315
+ vue.createElementVNode(
316
+ "span",
317
+ {
318
+ class: vue.normalizeClass(["yc-chat-question-card__status question-card__status", `is-${__props.interaction.state}`])
319
+ },
320
+ vue.toDisplayString(statusLabels[__props.interaction.state]),
321
+ 3
322
+ /* TEXT, CLASS */
323
+ )
324
+ ])
325
+ ]),
326
+ !showForm.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
327
+ (vue.openBlock(true), vue.createElementBlock(
328
+ vue.Fragment,
329
+ null,
330
+ vue.renderList(answerSummaries.value, (item) => {
331
+ return vue.openBlock(), vue.createElementBlock("div", {
332
+ key: item.id,
333
+ class: "yc-chat-question-card__summary-item"
334
+ }, [
335
+ vue.createElementVNode(
336
+ "p",
337
+ _hoisted_9,
338
+ vue.toDisplayString(item.title),
339
+ 1
340
+ /* TEXT */
341
+ ),
342
+ __props.interaction.state === "answered" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
343
+ (vue.openBlock(true), vue.createElementBlock(
344
+ vue.Fragment,
345
+ null,
346
+ vue.renderList(item.labels, (label, idx) => {
347
+ return vue.openBlock(), vue.createElementBlock(
348
+ "span",
349
+ {
350
+ key: `${item.id}-opt-${idx}`,
351
+ class: "yc-chat-question-card__answer-chip"
352
+ },
353
+ vue.toDisplayString(label),
354
+ 1
355
+ /* TEXT */
356
+ );
357
+ }),
358
+ 128
359
+ /* KEYED_FRAGMENT */
360
+ )),
361
+ item.customText ? (vue.openBlock(), vue.createElementBlock(
362
+ "span",
363
+ _hoisted_11,
364
+ vue.toDisplayString(item.customText),
365
+ 1
366
+ /* TEXT */
367
+ )) : vue.createCommentVNode("v-if", true),
368
+ item.labels.length === 0 && !item.customText ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_12, " \u5DF2\u63D0\u4EA4\u56DE\u7B54 ")) : vue.createCommentVNode("v-if", true)
369
+ ])) : vue.createCommentVNode("v-if", true)
370
+ ]);
371
+ }),
372
+ 128
373
+ /* KEYED_FRAGMENT */
374
+ ))
375
+ ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, [
376
+ (vue.openBlock(true), vue.createElementBlock(
377
+ vue.Fragment,
378
+ null,
379
+ vue.renderList(__props.interaction.request.questions, (question) => {
380
+ return vue.openBlock(), vue.createElementBlock("fieldset", {
381
+ key: question.id,
382
+ class: "yc-chat-question-card__question question-card__question",
383
+ disabled: !canAnswer.value
384
+ }, [
385
+ vue.createElementVNode("legend", _hoisted_15, [
386
+ vue.createElementVNode(
387
+ "span",
388
+ null,
389
+ vue.toDisplayString(question.title),
390
+ 1
391
+ /* TEXT */
392
+ ),
393
+ question.selection_mode === "multiple" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_16, " \u53EF\u591A\u9009 ")) : vue.createCommentVNode("v-if", true)
394
+ ]),
395
+ vue.createElementVNode("div", _hoisted_17, [
396
+ (vue.openBlock(true), vue.createElementBlock(
397
+ vue.Fragment,
398
+ null,
399
+ vue.renderList(question.options, (option) => {
400
+ return vue.openBlock(), vue.createElementBlock(
401
+ "label",
402
+ {
403
+ key: option.id,
404
+ class: vue.normalizeClass(["yc-chat-question-card__option question-card__option", {
405
+ "is-selected": optionChecked(question, option.id),
406
+ "is-disabled": !canAnswer.value
407
+ }])
408
+ },
409
+ [
410
+ vue.createElementVNode("input", {
411
+ class: "yc-chat-question-card__native-input",
412
+ "data-testid": `option-${question.id}-${option.id}`,
413
+ type: question.selection_mode === "single" ? "radio" : "checkbox",
414
+ name: `question-${__props.interaction.request.request_id}-${question.id}`,
415
+ checked: optionChecked(question, option.id),
416
+ onChange: ($event) => selectOption(question, option.id)
417
+ }, null, 40, _hoisted_18),
418
+ vue.createElementVNode(
419
+ "span",
420
+ {
421
+ class: vue.normalizeClass(["yc-chat-question-card__control", [
422
+ `is-${question.selection_mode}`,
423
+ { "is-checked": optionChecked(question, option.id) }
424
+ ]]),
425
+ "aria-hidden": "true"
426
+ },
427
+ [
428
+ question.selection_mode === "multiple" && optionChecked(question, option.id) ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_19, [..._cache[4] || (_cache[4] = [
429
+ vue.createElementVNode(
430
+ "path",
431
+ {
432
+ d: "M2.5 6.2L4.9 8.6L9.5 3.6",
433
+ stroke: "currentColor",
434
+ "stroke-width": "1.7",
435
+ "stroke-linecap": "round",
436
+ "stroke-linejoin": "round"
437
+ },
438
+ null,
439
+ -1
440
+ /* CACHED */
441
+ )
442
+ ])])) : vue.createCommentVNode("v-if", true)
443
+ ],
444
+ 2
445
+ /* CLASS */
446
+ ),
447
+ vue.createElementVNode("span", _hoisted_20, [
448
+ vue.createElementVNode(
449
+ "strong",
450
+ _hoisted_21,
451
+ vue.toDisplayString(option.label),
452
+ 1
453
+ /* TEXT */
454
+ ),
455
+ option.description ? (vue.openBlock(), vue.createElementBlock(
456
+ "small",
457
+ _hoisted_22,
458
+ vue.toDisplayString(option.description),
459
+ 1
460
+ /* TEXT */
461
+ )) : vue.createCommentVNode("v-if", true),
462
+ option.event ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_23, [
463
+ vue.createElementVNode(
464
+ "span",
465
+ null,
466
+ vue.toDisplayString(option.event.type) + " \xB7 v" + vue.toDisplayString(option.event.version) + " \xB7 \u53C2\u6570",
467
+ 1
468
+ /* TEXT */
469
+ ),
470
+ vue.createElementVNode(
471
+ "code",
472
+ null,
473
+ vue.toDisplayString(eventSummary(option)),
474
+ 1
475
+ /* TEXT */
476
+ ),
477
+ _cache[5] || (_cache[5] = vue.createElementVNode(
478
+ "em",
479
+ null,
480
+ "Admin \u4E0D\u652F\u6301\u6267\u884C\u5BA2\u6237\u7AEF\u4E8B\u4EF6",
481
+ -1
482
+ /* CACHED */
483
+ ))
484
+ ])) : vue.createCommentVNode("v-if", true)
485
+ ])
486
+ ],
487
+ 2
488
+ /* CLASS */
489
+ );
490
+ }),
491
+ 128
492
+ /* KEYED_FRAGMENT */
493
+ )),
494
+ vue.createElementVNode(
495
+ "div",
496
+ {
497
+ class: vue.normalizeClass(["yc-chat-question-card__other-wrap", { "is-selected": otherActive[question.id] }])
498
+ },
499
+ [
500
+ vue.createElementVNode(
501
+ "label",
502
+ {
503
+ class: vue.normalizeClass(["yc-chat-question-card__option yc-chat-question-card__other question-card__option question-card__other", {
504
+ "is-selected": otherActive[question.id],
505
+ "is-disabled": !canAnswer.value
506
+ }])
507
+ },
508
+ [
509
+ vue.createElementVNode("input", {
510
+ class: "yc-chat-question-card__native-input",
511
+ "data-testid": `other-${question.id}`,
512
+ type: question.selection_mode === "single" ? "radio" : "checkbox",
513
+ name: `question-${__props.interaction.request.request_id}-${question.id}`,
514
+ checked: otherActive[question.id],
515
+ onChange: ($event) => selectOther(question, $event.target.checked)
516
+ }, null, 40, _hoisted_24),
517
+ vue.createElementVNode(
518
+ "span",
519
+ {
520
+ class: vue.normalizeClass(["yc-chat-question-card__control", [
521
+ `is-${question.selection_mode}`,
522
+ { "is-checked": otherActive[question.id] }
523
+ ]]),
524
+ "aria-hidden": "true"
525
+ },
526
+ [
527
+ question.selection_mode === "multiple" && otherActive[question.id] ? (vue.openBlock(), vue.createElementBlock("svg", _hoisted_25, [..._cache[6] || (_cache[6] = [
528
+ vue.createElementVNode(
529
+ "path",
530
+ {
531
+ d: "M2.5 6.2L4.9 8.6L9.5 3.6",
532
+ stroke: "currentColor",
533
+ "stroke-width": "1.7",
534
+ "stroke-linecap": "round",
535
+ "stroke-linejoin": "round"
536
+ },
537
+ null,
538
+ -1
539
+ /* CACHED */
540
+ )
541
+ ])])) : vue.createCommentVNode("v-if", true)
542
+ ],
543
+ 2
544
+ /* CLASS */
545
+ ),
546
+ vue.createElementVNode("span", _hoisted_26, [
547
+ vue.createElementVNode(
548
+ "strong",
549
+ _hoisted_27,
550
+ vue.toDisplayString(question.other.label),
551
+ 1
552
+ /* TEXT */
553
+ )
554
+ ])
555
+ ],
556
+ 2
557
+ /* CLASS */
558
+ ),
559
+ otherActive[question.id] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_28, [
560
+ vue.withDirectives(vue.createElementVNode("textarea", {
561
+ "onUpdate:modelValue": ($event) => otherText[question.id] = $event,
562
+ class: "yc-chat-question-card__textarea",
563
+ "data-testid": `other-text-${question.id}`,
564
+ rows: "2",
565
+ placeholder: "\u8BF7\u8F93\u5165\u4F60\u7684\u8865\u5145\u8BF4\u660E\u6216\u81EA\u5B9A\u4E49\u7B54\u6848\u2026"
566
+ }, null, 8, _hoisted_29), [
567
+ [vue.vModelText, otherText[question.id]]
568
+ ])
569
+ ])) : vue.createCommentVNode("v-if", true)
570
+ ],
571
+ 2
572
+ /* CLASS */
573
+ )
574
+ ])
575
+ ], 8, _hoisted_14);
576
+ }),
577
+ 128
578
+ /* KEYED_FRAGMENT */
579
+ ))
580
+ ])),
581
+ !requestIsValid.value ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_30, " \u4EA4\u4E92\u8BF7\u6C42\u4E0D\u7B26\u5408\u5BA2\u6237\u7AEF\u4E8B\u4EF6\u7EA6\u675F\uFF0C\u65E0\u6CD5\u63D0\u4EA4\u56DE\u7B54\u3002 ")) : vue.createCommentVNode("v-if", true),
582
+ !__props.answerEnabled && __props.interaction.state === "pending" ? (vue.openBlock(), vue.createElementBlock(
583
+ "p",
584
+ _hoisted_31,
585
+ vue.toDisplayString(__props.unavailableReason || "\u5F53\u524D\u754C\u9762\u6682\u4E0D\u652F\u6301\u63D0\u4EA4\u56DE\u7B54"),
586
+ 1
587
+ /* TEXT */
588
+ )) : vue.createCommentVNode("v-if", true),
589
+ ((_a = __props.interaction.receipt) == null ? void 0 : _a.clientEvent) ? (vue.openBlock(), vue.createElementBlock(
590
+ "p",
591
+ _hoisted_32,
592
+ " \u5BA2\u6237\u7AEF\u4E8B\u4EF6 " + vue.toDisplayString(__props.interaction.receipt.clientEvent.type) + " \u672A\u5728 Admin \u6267\u884C\u3002 ",
593
+ 1
594
+ /* TEXT */
595
+ )) : vue.createCommentVNode("v-if", true),
596
+ __props.interaction.state === "pending" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_33, [
597
+ vue.createElementVNode("button", {
598
+ type: "button",
599
+ class: "yc-chat-question-card__btn yc-chat-question-card__btn--cancel question-card__cancel",
600
+ "data-testid": "cancel-interaction",
601
+ disabled: !__props.answerEnabled || __props.submitting,
602
+ onClick: _cache[1] || (_cache[1] = ($event) => emit("cancel"))
603
+ }, " \u53D6\u6D88 ", 8, _hoisted_34),
604
+ vue.createElementVNode("button", {
605
+ type: "button",
606
+ class: "yc-chat-question-card__btn yc-chat-question-card__btn--submit",
607
+ "data-testid": "submit-answers",
608
+ disabled: !canAnswer.value || !complete.value || __props.submitting,
609
+ onClick: submit
610
+ }, vue.toDisplayString(__props.submitting ? "\u63D0\u4EA4\u4E2D\u2026" : "\u63D0\u4EA4\u56DE\u7B54"), 9, _hoisted_35)
611
+ ])) : vue.createCommentVNode("v-if", true)
612
+ ], 10, _hoisted_1);
613
+ };
614
+ }
615
+ });
616
+
617
+ exports.default = _sfc_main;