@turquoisehealth/pit-viper 2.264.2-dev.0 → 2.265.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_site/assets/css/pit-viper-a11y-v3.css +0 -5
- package/_site/assets/css/pit-viper-a11y.css +0 -5
- package/_site/assets/css/pit-viper-consumer.css +0 -5
- package/_site/assets/css/pit-viper-v2-scoped.css +0 -4
- package/_site/assets/css/pit-viper-v2.css +0 -5
- package/_site/assets/css/pit-viper-v3.css +0 -5
- package/_site/assets/css/pit-viper.css +0 -5
- package/_site/manifest.json +2556 -0
- package/package.json +7 -2
- package/pv-components/dist/stats/vue/ai/stats.html +1 -1
- package/pv-components/dist/stats/vue/base/stats.html +1 -1
- package/pv-components/dist/stats/vue/visualizations/stats.html +1 -1
- package/pv-components/dist/stats/web/pv-filter-panel-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-prompt-input-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-question-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-suggestion-tag-stats.html +1 -1
- package/pv-components/dist/vue/ai/components/ai/PvPromptInput/PvPromptInput.vue.d.ts +0 -4
- package/pv-components/dist/vue/ai/components/ai/PvPromptInput/types.d.ts +0 -12
- package/pv-components/dist/vue/ai/components/ai/PvQuestion/types.d.ts +0 -4
- package/pv-components/dist/vue/ai/components/base/PvPopoverV2/PvPopoverV2.vue.d.ts +1 -1
- package/pv-components/dist/vue/ai/components/base/PvRange/PvRange.vue.d.ts +2 -2
- package/pv-components/dist/vue/ai/components/base/PvSuggestionTag/PvSuggestionTag.vue.d.ts +0 -5
- package/pv-components/dist/vue/ai/components/base/PvTooltip/PvTooltip.vue.d.ts +1 -1
- package/pv-components/dist/vue/ai/components/base/PvTooltipV2/PvTooltipV2.vue.d.ts +1 -1
- package/pv-components/dist/vue/ai/pv-components-ai.mjs +325 -486
- package/pv-components/dist/vue/ai/pv-components-ai.mjs.map +1 -1
- package/pv-components/dist/vue/base/components/base/PvSuggestionTag/PvSuggestionTag.vue.d.ts +0 -5
- package/pv-components/dist/vue/base/pv-components-base.mjs +1096 -1102
- package/pv-components/dist/vue/base/pv-components-base.mjs.map +1 -1
- package/pv-components/dist/vue/visualizations/components/base/PvSuggestionTag/PvSuggestionTag.vue.d.ts +0 -5
- package/pv-components/dist/vue/visualizations/pv-components-visualizations.mjs +593 -599
- package/pv-components/dist/vue/visualizations/pv-components-visualizations.mjs.map +1 -1
- package/pv-components/dist/web/components/pv-filter-panel/pv-filter-panel.js +869 -875
- package/pv-components/dist/web/components/pv-prompt-input/pv-prompt-input.js +572 -826
- package/pv-components/dist/web/components/pv-question/pv-question.js +373 -387
- package/pv-components/dist/web/components/pv-suggestion-tag/pv-suggestion-tag.js +376 -382
- package/pv-components/dist/web/pv-components.iife.js +36 -36
- package/pv-components/dist/web/pv-components.iife.js.map +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.pv-badge-md[data-v-3def68cb]{--inset-size:2px 2px;min-width:20px;min-height:20px;max-height:20px;font-weight:500}.pv-badge-sm[data-v-3def68cb]{--inset-size:0 2px;min-width:16px;min-height:16px;max-height:16px;font-weight:500}.pv-rounded[data-v-3def68cb]{border-radius:50%}.input-icon-position{pointer-events:none;position:absolute;top:8px;left:12px}summary[data-v-dfa0b416]{background-image:none;padding-right:2px}
|
|
2
|
-
/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();import { Comment as e, Fragment as t, Text as n, TransitionGroup as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, getCurrentInstance as f,
|
|
2
|
+
/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();import { Comment as e, Fragment as t, Text as n, TransitionGroup as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, getCurrentInstance as f, mergeModels as p, mergeProps as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onBeforeUpdate as y, onMounted as b, onScopeDispose as x, openBlock as S, ref as C, renderList as w, renderSlot as T, toDisplayString as E, toHandlers as D, unref as O, useId as k, useModel as A, useSlots as j, vModelDynamic as M, vModelText as N, watch as P, withCtx as F, withDirectives as I, withKeys as L, withModifiers as R } from "vue";
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region src/components/base/PvSpinner/PvSpinner.vue
|
|
5
|
-
var
|
|
5
|
+
var z = /* @__PURE__ */ d({
|
|
6
6
|
__name: "PvSpinner",
|
|
7
7
|
props: {
|
|
8
8
|
size: { default: "lg" },
|
|
@@ -20,26 +20,26 @@ var te = /* @__PURE__ */ d({
|
|
|
20
20
|
dark: "pv-spinner-dark",
|
|
21
21
|
white: "pv-spinner-light"
|
|
22
22
|
};
|
|
23
|
-
return (r, i) => (
|
|
23
|
+
return (r, i) => (S(), s("div", {
|
|
24
24
|
"data-testid": "pv-spinner",
|
|
25
|
-
class:
|
|
26
|
-
style:
|
|
25
|
+
class: g(n[e.variant]),
|
|
26
|
+
style: _({ "--size": t[e.size] })
|
|
27
27
|
}, null, 6));
|
|
28
28
|
}
|
|
29
|
-
}),
|
|
29
|
+
}), B = ["ghost"], V = {
|
|
30
30
|
md: "pv-button-small",
|
|
31
31
|
lg: void 0,
|
|
32
32
|
xl: "pv-button-large"
|
|
33
|
-
},
|
|
33
|
+
}, H = (e) => e == null || !V.hasOwnProperty(e) ? null : V[e] || null;
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/web-components/utils.ts
|
|
36
36
|
function U() {
|
|
37
|
-
let e =
|
|
37
|
+
let e = C(!1), t = f()?.root || {};
|
|
38
38
|
return "isCE" in t && t.isCE === !0 && (e.value = !0), e;
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/components/base/baseProps.ts
|
|
42
|
-
var
|
|
42
|
+
var ee = [
|
|
43
43
|
void 0,
|
|
44
44
|
10,
|
|
45
45
|
12,
|
|
@@ -48,24 +48,24 @@ var ie = [
|
|
|
48
48
|
24,
|
|
49
49
|
32,
|
|
50
50
|
64
|
|
51
|
-
],
|
|
51
|
+
], te = ["xlink:href"], W = /* @__PURE__ */ d({
|
|
52
52
|
__name: "PvIcon",
|
|
53
53
|
props: {
|
|
54
54
|
name: {},
|
|
55
55
|
size: {}
|
|
56
56
|
},
|
|
57
57
|
setup(e) {
|
|
58
|
-
let t = e, n = U(), r =
|
|
58
|
+
let t = e, n = U(), r = C(null), a = i(() => ({
|
|
59
59
|
"pv-icon": !0,
|
|
60
|
-
[`pv-icon-${t.size}`]: t.size != null &&
|
|
60
|
+
[`pv-icon-${t.size}`]: t.size != null && ee.includes(t.size)
|
|
61
61
|
})), o = i(() => n.value && r.value ? `${r.value}#${t.name}` : `#${t.name}`);
|
|
62
|
-
return globalThis.__PV_GLOBAL_SPRITE_PATH__ && (r.value = globalThis.__PV_GLOBAL_SPRITE_PATH__), (e, t) => (
|
|
62
|
+
return globalThis.__PV_GLOBAL_SPRITE_PATH__ && (r.value = globalThis.__PV_GLOBAL_SPRITE_PATH__), (e, t) => (S(), s("svg", {
|
|
63
63
|
"data-testid": "pv-icon",
|
|
64
64
|
"aria-hidden": "true",
|
|
65
|
-
class:
|
|
66
|
-
}, [c("use", { "xlink:href": o.value }, null, 8,
|
|
65
|
+
class: g(a.value)
|
|
66
|
+
}, [c("use", { "xlink:href": o.value }, null, 8, te)], 2));
|
|
67
67
|
}
|
|
68
|
-
}),
|
|
68
|
+
}), ne = /* @__PURE__ */ d({
|
|
69
69
|
__name: "PvCounterBadge",
|
|
70
70
|
props: {
|
|
71
71
|
maxValue: { default: 99 },
|
|
@@ -87,19 +87,19 @@ var ie = [
|
|
|
87
87
|
"pv-surface": t.variant == "ghost",
|
|
88
88
|
"pv-rounded": t.rounded
|
|
89
89
|
}));
|
|
90
|
-
return (e, t) => (
|
|
91
|
-
class:
|
|
90
|
+
return (e, t) => (S(), s("div", {
|
|
91
|
+
class: g(r.value),
|
|
92
92
|
"data-testid": "pv-counter-badge"
|
|
93
|
-
},
|
|
93
|
+
}, E(n.value), 3));
|
|
94
94
|
}
|
|
95
95
|
}), G = (e, t) => {
|
|
96
96
|
let n = e.__vccOpts || e;
|
|
97
97
|
for (let [e, r] of t) n[e] = r;
|
|
98
98
|
return n;
|
|
99
|
-
}, K = /* @__PURE__ */ G(
|
|
99
|
+
}, K = /* @__PURE__ */ G(ne, [["__scopeId", "data-v-3def68cb"]]), re = ["disabled", "aria-label"], ie = {
|
|
100
100
|
key: 2,
|
|
101
101
|
"data-testid": "pv-button-label"
|
|
102
|
-
},
|
|
102
|
+
}, q = /* @__PURE__ */ d({
|
|
103
103
|
__name: "PvButton",
|
|
104
104
|
props: {
|
|
105
105
|
variant: { default: "primary" },
|
|
@@ -126,57 +126,57 @@ var ie = [
|
|
|
126
126
|
setup(e) {
|
|
127
127
|
let n = e, r = i(() => !n.label || n.loading ? n.label || n.ariaLabel : void 0), c = i(() => {
|
|
128
128
|
let e = [];
|
|
129
|
-
n.inverse &&
|
|
130
|
-
let t =
|
|
129
|
+
n.inverse && B.includes(n.variant) ? e.push(`pv-button-${n.variant}-inverse`) : e.push(`pv-button-${n.variant}`);
|
|
130
|
+
let t = H(n.size);
|
|
131
131
|
return t && e.push(t), e;
|
|
132
132
|
});
|
|
133
|
-
return (n, i) => (
|
|
133
|
+
return (n, i) => (S(), s("button", {
|
|
134
134
|
type: "button",
|
|
135
|
-
class:
|
|
135
|
+
class: g(c.value),
|
|
136
136
|
disabled: e.disabled,
|
|
137
137
|
"aria-label": r.value,
|
|
138
138
|
"data-testid": "pv-button"
|
|
139
|
-
}, [e.loading ? (
|
|
139
|
+
}, [e.loading ? (S(), a(z, {
|
|
140
140
|
key: 0,
|
|
141
141
|
size: "sm"
|
|
142
|
-
})) : (
|
|
143
|
-
e.leftCounterBadge ? (
|
|
142
|
+
})) : (S(), s(t, { key: 1 }, [
|
|
143
|
+
e.leftCounterBadge ? (S(), a(K, {
|
|
144
144
|
key: 0,
|
|
145
145
|
value: e.leftCounterBadge,
|
|
146
146
|
variant: "tertiary"
|
|
147
147
|
}, null, 8, ["value"])) : o("", !0),
|
|
148
|
-
e.leftIcon ? (
|
|
148
|
+
e.leftIcon ? (S(), a(W, {
|
|
149
149
|
key: 1,
|
|
150
150
|
name: e.leftIcon,
|
|
151
151
|
"data-testid": "pv-button-left-icon"
|
|
152
152
|
}, null, 8, ["name"])) : o("", !0),
|
|
153
|
-
e.label ? (
|
|
154
|
-
e.rightCounterBadge ? (
|
|
153
|
+
e.label ? (S(), s("span", ie, E(e.label), 1)) : o("", !0),
|
|
154
|
+
e.rightCounterBadge ? (S(), a(K, {
|
|
155
155
|
key: 3,
|
|
156
156
|
value: e.rightCounterBadge,
|
|
157
157
|
variant: "tertiary"
|
|
158
158
|
}, null, 8, ["value"])) : o("", !0),
|
|
159
|
-
e.rightIcon ? (
|
|
159
|
+
e.rightIcon ? (S(), a(W, {
|
|
160
160
|
key: 4,
|
|
161
161
|
name: e.rightIcon,
|
|
162
162
|
"data-testid": "pv-button-right-icon"
|
|
163
163
|
}, null, 8, ["name"])) : o("", !0)
|
|
164
|
-
], 64))], 10,
|
|
164
|
+
], 64))], 10, re));
|
|
165
165
|
}
|
|
166
|
-
}),
|
|
166
|
+
}), J = ["for"], Y = {
|
|
167
167
|
key: 0,
|
|
168
168
|
class: "pv-surface-accent pv-inset-square pv-text-body-md pv-radius pv-bordered",
|
|
169
169
|
style: { "--inset-size": "6px 10px" }
|
|
170
|
-
},
|
|
170
|
+
}, ae = { class: "pv-relative pv-flex-item" }, oe = [
|
|
171
171
|
"disabled",
|
|
172
172
|
"type",
|
|
173
173
|
"placeholder",
|
|
174
174
|
"id",
|
|
175
175
|
"data-invalid",
|
|
176
176
|
"step"
|
|
177
|
-
],
|
|
177
|
+
], se = /* @__PURE__ */ d({
|
|
178
178
|
__name: "PvInput",
|
|
179
|
-
props: /* @__PURE__ */
|
|
179
|
+
props: /* @__PURE__ */ p({
|
|
180
180
|
showLabel: { type: Boolean },
|
|
181
181
|
error: { type: Boolean },
|
|
182
182
|
disabled: { type: Boolean },
|
|
@@ -194,19 +194,19 @@ var ie = [
|
|
|
194
194
|
}),
|
|
195
195
|
emits: ["update:modelValue"],
|
|
196
196
|
setup(e) {
|
|
197
|
-
let n = e, r =
|
|
198
|
-
return (n, i) => (
|
|
199
|
-
n.$slots.label || e.showLabel ? (
|
|
197
|
+
let n = e, r = A(e, "modelValue"), l = i(() => n.inputIcon ? { "--inset-size": "8px 12px 6px 36px" } : {});
|
|
198
|
+
return (n, i) => (S(), s(t, null, [
|
|
199
|
+
n.$slots.label || e.showLabel ? (S(), s("label", {
|
|
200
200
|
key: 0,
|
|
201
201
|
"data-testid": "pv-input-label",
|
|
202
202
|
class: "pv-label pv-stack-8",
|
|
203
203
|
for: e.id
|
|
204
|
-
}, [
|
|
205
|
-
c("div", { class:
|
|
204
|
+
}, [T(n.$slots, "label")], 8, J)) : o("", !0),
|
|
205
|
+
c("div", { class: g(["pv-flex pv-flex-item", { "pv-stack-8": e.lowerLabel }]) }, [e.prefixLabel ? (S(), s("div", Y, E(e.prefixLabel), 1)) : o("", !0), c("div", ae, [e.inputIcon ? (S(), a(W, {
|
|
206
206
|
key: 0,
|
|
207
207
|
class: "pv-absolute input-icon-position",
|
|
208
208
|
name: e.inputIcon
|
|
209
|
-
}, null, 8, ["name"])) : o("", !0),
|
|
209
|
+
}, null, 8, ["name"])) : o("", !0), I(c("input", m(n.$attrs, {
|
|
210
210
|
"onUpdate:modelValue": i[0] ||= (e) => r.value = e,
|
|
211
211
|
"data-testid": "pv-input",
|
|
212
212
|
class: ["pv-input-text", {
|
|
@@ -220,70 +220,57 @@ var ie = [
|
|
|
220
220
|
id: e.id,
|
|
221
221
|
"data-invalid": e.error ? !0 : void 0,
|
|
222
222
|
step: e.step
|
|
223
|
-
}), null, 16,
|
|
224
|
-
e.lowerLabel ? (
|
|
223
|
+
}), null, 16, oe), [[M, r.value]])])], 2),
|
|
224
|
+
e.lowerLabel ? (S(), s("p", {
|
|
225
225
|
key: 1,
|
|
226
226
|
"data-testid": "pv-input-lower-label",
|
|
227
227
|
style: { "margin-left": "12px" },
|
|
228
|
-
class:
|
|
228
|
+
class: g(["pv-text-body-xs", {
|
|
229
229
|
"pv-text-red": e.error,
|
|
230
230
|
"pv-text-subdued": !e.error
|
|
231
231
|
}])
|
|
232
|
-
},
|
|
232
|
+
}, E(e.lowerLabel), 3)) : o("", !0)
|
|
233
233
|
], 64));
|
|
234
234
|
}
|
|
235
|
-
}),
|
|
235
|
+
}), ce = ["onKeydown"], le = { class: "pv-question-header pv-inset-square-16 pv-space-between" }, ue = {
|
|
236
236
|
class: "pv-question-header-copy pv-flex-vertical pv-flex-item",
|
|
237
237
|
style: {
|
|
238
238
|
"--flex-align": "flex-start",
|
|
239
239
|
"--flex-gap": "4px",
|
|
240
240
|
"min-width": "0"
|
|
241
241
|
}
|
|
242
|
-
},
|
|
242
|
+
}, de = {
|
|
243
243
|
key: 0,
|
|
244
244
|
class: "pv-text-body-md pv-text-tertiary"
|
|
245
|
-
},
|
|
245
|
+
}, fe = { class: "pv-question-header-actions pv-flex" }, pe = {
|
|
246
246
|
key: 0,
|
|
247
247
|
class: "pv-text-body-xs pv-text-tertiary",
|
|
248
248
|
role: "status",
|
|
249
249
|
"aria-live": "polite"
|
|
250
|
-
},
|
|
250
|
+
}, me = {
|
|
251
251
|
class: "pv-question-body pv-border-bottom",
|
|
252
252
|
style: { "padding-bottom": "2px" }
|
|
253
|
-
},
|
|
253
|
+
}, he = {
|
|
254
254
|
class: "pv-question-options pv-flex-vertical pv-inset-inline-16",
|
|
255
255
|
style: {
|
|
256
256
|
"--flex-align": "stretch",
|
|
257
257
|
"--flex-gap": "2px"
|
|
258
258
|
}
|
|
259
|
-
},
|
|
259
|
+
}, ge = ["aria-activedescendant"], _e = [
|
|
260
260
|
"id",
|
|
261
261
|
"aria-selected",
|
|
262
262
|
"data-active",
|
|
263
263
|
"onClick",
|
|
264
264
|
"onMouseenter"
|
|
265
|
-
],
|
|
266
|
-
key: 0,
|
|
267
|
-
class: "pv-flex-item pv-flex-vertical",
|
|
268
|
-
style: {
|
|
269
|
-
"--flex-align": "flex-start",
|
|
270
|
-
"--flex-gap": "2px",
|
|
271
|
-
"min-width": "0"
|
|
272
|
-
}
|
|
273
|
-
}, we = { class: "pv-question-answer-text pv-text-title-md" }, Te = { class: "pv-question-description pv-text-body-sm pv-text-tertiary" }, Ee = {
|
|
274
|
-
key: 1,
|
|
265
|
+
], ve = {
|
|
275
266
|
class: "pv-question-answer-text pv-flex-item pv-text-title-md",
|
|
276
267
|
style: { "min-width": "0" }
|
|
277
|
-
},
|
|
278
|
-
key: 2,
|
|
279
|
-
class: "pv-question-tag pv-tag-highlight",
|
|
280
|
-
"data-style": "rounded"
|
|
281
|
-
}, Oe = ["title"], ke = { class: "pv-visually-hidden" }, Ae = ["data-active"], je = { class: "pv-question-chat-badge pv-flex pv-radius pv-text-subdued" }, Me = {
|
|
268
|
+
}, ye = ["title"], be = { class: "pv-visually-hidden" }, xe = ["data-active"], Se = { class: "pv-question-chat-badge pv-flex pv-radius pv-text-subdued" }, Ce = {
|
|
282
269
|
class: "pv-question-chat-input pv-flex-item",
|
|
283
270
|
style: { "min-width": "0" }
|
|
284
|
-
},
|
|
271
|
+
}, we = { class: "pv-question-footer pv-inset-squish-12 pv-space-between" }, Te = /* @__PURE__ */ d({
|
|
285
272
|
__name: "PvQuestion",
|
|
286
|
-
props: /* @__PURE__ */
|
|
273
|
+
props: /* @__PURE__ */ p({
|
|
287
274
|
chatInputLabel: { default: "Other answer" },
|
|
288
275
|
chatInputPlaceholder: { default: "Something else..." },
|
|
289
276
|
currentQuestion: { default: 1 },
|
|
@@ -297,18 +284,18 @@ var ie = [
|
|
|
297
284
|
chatInput: { default: "" },
|
|
298
285
|
chatInputModifiers: {}
|
|
299
286
|
}),
|
|
300
|
-
emits: /* @__PURE__ */
|
|
287
|
+
emits: /* @__PURE__ */ p([
|
|
301
288
|
"close",
|
|
302
289
|
"select",
|
|
303
290
|
"skip",
|
|
304
291
|
"submit"
|
|
305
292
|
], ["update:modelValue", "update:chatInput"]),
|
|
306
293
|
setup(e, { emit: n }) {
|
|
307
|
-
let r = e, l = n, d =
|
|
308
|
-
|
|
294
|
+
let r = e, l = n, d = A(e, "modelValue"), f = A(e, "chatInput"), p = k(), m = `${p}-heading`, g = `${p}-keyboard-hint`, _ = C(), v = C(), y = r.options.findIndex((e) => e.id === d.value), b = C(Math.max(y, 0)), x = i(() => r.totalQuestions > 1), T = i(() => b.value < r.options.length ? D(b.value) : void 0);
|
|
295
|
+
P(d, (e) => {
|
|
309
296
|
let t = r.options.findIndex((t) => t.id === e);
|
|
310
297
|
t >= 0 && (b.value = t);
|
|
311
|
-
}),
|
|
298
|
+
}), P(() => r.options.map((e) => e.id), (e, t) => {
|
|
312
299
|
let n = e.findIndex((e) => e === d.value);
|
|
313
300
|
if (n >= 0) {
|
|
314
301
|
b.value = n;
|
|
@@ -321,34 +308,34 @@ var ie = [
|
|
|
321
308
|
let r = t[b.value], i = e.indexOf(r);
|
|
322
309
|
b.value = i >= 0 ? i : Math.min(b.value, Math.max(e.length - 1, 0));
|
|
323
310
|
});
|
|
324
|
-
function
|
|
311
|
+
function D(e) {
|
|
325
312
|
return `${p}-option-${e}`;
|
|
326
313
|
}
|
|
327
|
-
function
|
|
328
|
-
r.options.length && (b.value = e,
|
|
314
|
+
function O(e) {
|
|
315
|
+
r.options.length && (b.value = e, h(() => _.value?.focus()));
|
|
329
316
|
}
|
|
330
|
-
function
|
|
331
|
-
b.value = r.options.length,
|
|
317
|
+
function j() {
|
|
318
|
+
b.value = r.options.length, h(() => v.value?.querySelector("input")?.focus());
|
|
332
319
|
}
|
|
333
|
-
function
|
|
320
|
+
function M(e, t) {
|
|
334
321
|
b.value = t, d.value = e.id, l("select", e);
|
|
335
322
|
}
|
|
336
323
|
function N(e, t) {
|
|
337
|
-
|
|
324
|
+
M(e, t), h(() => _.value?.focus());
|
|
338
325
|
}
|
|
339
|
-
function
|
|
326
|
+
function F() {
|
|
340
327
|
b.value >= r.options.length && (b.value = 0);
|
|
341
328
|
}
|
|
342
|
-
function
|
|
343
|
-
e.key === "ArrowDown" ? (e.preventDefault(), b.value >= r.options.length - 1 ?
|
|
329
|
+
function I(e) {
|
|
330
|
+
e.key === "ArrowDown" ? (e.preventDefault(), b.value >= r.options.length - 1 ? j() : b.value += 1) : e.key === "ArrowUp" ? (e.preventDefault(), b.value <= 0 ? j() : --b.value) : e.key === "Enter" && r.options[b.value] && (e.preventDefault(), M(r.options[b.value], b.value));
|
|
344
331
|
}
|
|
345
|
-
function
|
|
332
|
+
function z() {
|
|
346
333
|
b.value = r.options.length, d.value = void 0;
|
|
347
334
|
}
|
|
348
|
-
function
|
|
335
|
+
function B(e) {
|
|
349
336
|
if (!(!r.options.length && (e.key === "ArrowDown" || e.key === "ArrowUp"))) {
|
|
350
|
-
if (e.key === "ArrowDown") e.preventDefault(),
|
|
351
|
-
else if (e.key === "ArrowUp") e.preventDefault(),
|
|
337
|
+
if (e.key === "ArrowDown") e.preventDefault(), O(0);
|
|
338
|
+
else if (e.key === "ArrowUp") e.preventDefault(), O(r.options.length - 1);
|
|
352
339
|
else if (e.key === "Enter" && !e.isComposing) {
|
|
353
340
|
e.preventDefault();
|
|
354
341
|
let t = f.value.trim();
|
|
@@ -356,29 +343,29 @@ var ie = [
|
|
|
356
343
|
}
|
|
357
344
|
}
|
|
358
345
|
}
|
|
359
|
-
function
|
|
346
|
+
function V() {
|
|
360
347
|
l("close");
|
|
361
348
|
}
|
|
362
|
-
function
|
|
349
|
+
function H() {
|
|
363
350
|
l("skip");
|
|
364
351
|
}
|
|
365
|
-
return (n, r) => (
|
|
352
|
+
return (n, r) => (S(), s("section", {
|
|
366
353
|
class: "pv-question pv-card pv-surface pv-full-width",
|
|
367
354
|
"data-testid": "pv-question",
|
|
368
355
|
"aria-labelledby": m,
|
|
369
|
-
onKeydown:
|
|
356
|
+
onKeydown: L(R(H, ["stop", "prevent"]), ["esc"])
|
|
370
357
|
}, [
|
|
371
|
-
c("header",
|
|
358
|
+
c("header", le, [c("div", ue, [c("h3", {
|
|
372
359
|
id: m,
|
|
373
360
|
class: "pv-heading-3"
|
|
374
|
-
},
|
|
361
|
+
}, E(e.headerLabel), 1), e.subheader ? (S(), s("p", de, E(e.subheader), 1)) : o("", !0)]), c("div", fe, [x.value ? (S(), s("span", pe, E(e.currentQuestion) + " of " + E(e.totalQuestions), 1)) : o("", !0), u(q, {
|
|
375
362
|
ariaLabel: "Close",
|
|
376
363
|
leftIcon: "close",
|
|
377
364
|
size: "md",
|
|
378
365
|
variant: "ghost",
|
|
379
|
-
onClick:
|
|
366
|
+
onClick: V
|
|
380
367
|
})])]),
|
|
381
|
-
c("div",
|
|
368
|
+
c("div", me, [c("div", he, [c("div", {
|
|
382
369
|
ref_key: "listboxRef",
|
|
383
370
|
ref: _,
|
|
384
371
|
class: "pv-question-listbox pv-flex-vertical",
|
|
@@ -389,13 +376,13 @@ var ie = [
|
|
|
389
376
|
"data-testid": "pv-question-listbox",
|
|
390
377
|
role: "listbox",
|
|
391
378
|
tabindex: "0",
|
|
392
|
-
"aria-activedescendant":
|
|
393
|
-
"aria-describedby":
|
|
379
|
+
"aria-activedescendant": T.value,
|
|
380
|
+
"aria-describedby": g,
|
|
394
381
|
"aria-labelledby": m,
|
|
395
|
-
onFocus:
|
|
396
|
-
onKeydown:
|
|
397
|
-
}, [(
|
|
398
|
-
id:
|
|
382
|
+
onFocus: F,
|
|
383
|
+
onKeydown: I
|
|
384
|
+
}, [(S(!0), s(t, null, w(e.options, (e, t) => (S(), s("div", {
|
|
385
|
+
id: D(t),
|
|
399
386
|
key: e.id,
|
|
400
387
|
class: "pv-question-option pv-flex pv-inset-squish-12 pv-radius-lg",
|
|
401
388
|
"data-testid": "pv-question-option",
|
|
@@ -410,10 +397,9 @@ var ie = [
|
|
|
410
397
|
size: "sm",
|
|
411
398
|
variant: "tertiary"
|
|
412
399
|
}, null, 8, ["value"]),
|
|
413
|
-
|
|
414
|
-
e.
|
|
415
|
-
|
|
416
|
-
key: 3,
|
|
400
|
+
c("span", ve, E(e.label), 1),
|
|
401
|
+
e.helpText ? (S(), s("span", {
|
|
402
|
+
key: 0,
|
|
417
403
|
class: "pv-question-help pv-flex",
|
|
418
404
|
style: { "--flex-gap": "0" },
|
|
419
405
|
title: e.helpText
|
|
@@ -421,9 +407,9 @@ var ie = [
|
|
|
421
407
|
class: "pv-text-tertiary",
|
|
422
408
|
name: "info-circle",
|
|
423
409
|
size: 12
|
|
424
|
-
}), c("span",
|
|
425
|
-
d.value === e.id ? (
|
|
426
|
-
key:
|
|
410
|
+
}), c("span", be, E(e.helpText), 1)], 8, ye)) : o("", !0),
|
|
411
|
+
d.value === e.id ? (S(), a(W, {
|
|
412
|
+
key: 1,
|
|
427
413
|
class: "pv-question-check pv-text-brand",
|
|
428
414
|
name: "check"
|
|
429
415
|
})) : o("", !0),
|
|
@@ -431,26 +417,26 @@ var ie = [
|
|
|
431
417
|
class: "pv-question-chevron pv-text-tertiary",
|
|
432
418
|
name: "chevron-right"
|
|
433
419
|
})
|
|
434
|
-
], 40,
|
|
420
|
+
], 40, _e))), 128))], 40, ge), c("div", {
|
|
435
421
|
ref_key: "chatInputWrapperRef",
|
|
436
422
|
ref: v,
|
|
437
423
|
class: "pv-question-chat pv-flex pv-inset-squish-12 pv-radius-lg",
|
|
438
424
|
"data-testid": "pv-question-chat",
|
|
439
425
|
"data-active": b.value === e.options.length || void 0,
|
|
440
|
-
onClick:
|
|
426
|
+
onClick: j,
|
|
441
427
|
onMouseenter: r[1] ||= (t) => b.value = e.options.length
|
|
442
428
|
}, [
|
|
443
|
-
c("span",
|
|
429
|
+
c("span", Se, [u(W, {
|
|
444
430
|
name: "text-search",
|
|
445
431
|
size: 12
|
|
446
432
|
})]),
|
|
447
|
-
c("div",
|
|
433
|
+
c("div", Ce, [u(se, {
|
|
448
434
|
modelValue: f.value,
|
|
449
435
|
"onUpdate:modelValue": r[0] ||= (e) => f.value = e,
|
|
450
436
|
"aria-label": e.chatInputLabel,
|
|
451
437
|
placeholder: e.chatInputPlaceholder,
|
|
452
|
-
onFocus:
|
|
453
|
-
onKeydown:
|
|
438
|
+
onFocus: z,
|
|
439
|
+
onKeydown: B
|
|
454
440
|
}, null, 8, [
|
|
455
441
|
"modelValue",
|
|
456
442
|
"aria-label",
|
|
@@ -460,36 +446,36 @@ var ie = [
|
|
|
460
446
|
class: "pv-question-chevron pv-text-tertiary",
|
|
461
447
|
name: "chevron-right"
|
|
462
448
|
})
|
|
463
|
-
], 40,
|
|
464
|
-
c("footer",
|
|
465
|
-
id:
|
|
449
|
+
], 40, xe)])]),
|
|
450
|
+
c("footer", we, [c("span", {
|
|
451
|
+
id: g,
|
|
466
452
|
class: "pv-text-body-xs pv-text-tertiary"
|
|
467
|
-
}, "↑↓ to navigate • Enter to select • Esc to skip"), u(
|
|
453
|
+
}, "↑↓ to navigate • Enter to select • Esc to skip"), u(q, {
|
|
468
454
|
class: "pv-question-skip",
|
|
469
455
|
label: "Skip",
|
|
470
456
|
size: "lg",
|
|
471
457
|
variant: "secondary",
|
|
472
|
-
onClick:
|
|
458
|
+
onClick: H
|
|
473
459
|
})])
|
|
474
|
-
], 40,
|
|
460
|
+
], 40, ce));
|
|
475
461
|
}
|
|
476
|
-
}),
|
|
462
|
+
}), Ee = {
|
|
477
463
|
key: 0,
|
|
478
464
|
class: "pv-confirmation pv-bordered pv-radius pv-inset-square-16 pv-flow-16",
|
|
479
465
|
"data-testid": "pv-confirmation",
|
|
480
466
|
"aria-label": "Tool approval"
|
|
481
|
-
},
|
|
467
|
+
}, De = { class: "pv-text-body-sm" }, Oe = {
|
|
482
468
|
class: "pv-flex",
|
|
483
469
|
style: { "--flex-justify": "flex-end" }
|
|
484
|
-
},
|
|
470
|
+
}, ke = {
|
|
485
471
|
key: 1,
|
|
486
472
|
class: "pv-flex pv-text-body-sm pv-text-success",
|
|
487
473
|
role: "status"
|
|
488
|
-
},
|
|
474
|
+
}, Ae = {
|
|
489
475
|
key: 2,
|
|
490
476
|
class: "pv-flex pv-text-body-sm pv-text-critical",
|
|
491
477
|
role: "status"
|
|
492
|
-
},
|
|
478
|
+
}, je = /* @__PURE__ */ d({
|
|
493
479
|
__name: "PvConfirmation",
|
|
494
480
|
props: {
|
|
495
481
|
approval: {},
|
|
@@ -511,223 +497,37 @@ var ie = [
|
|
|
511
497
|
approved: e
|
|
512
498
|
});
|
|
513
499
|
}
|
|
514
|
-
return (n, r) => d.value || f.value || p.value ? (
|
|
500
|
+
return (n, r) => d.value || f.value || p.value ? (S(), s("section", Ee, [d.value ? (S(), s(t, { key: 0 }, [c("div", De, [T(n.$slots, "default", {}, () => [l(E(e.message), 1)])]), c("div", Oe, [u(q, {
|
|
515
501
|
variant: "secondary",
|
|
516
502
|
size: "md",
|
|
517
503
|
label: e.rejectLabel,
|
|
518
504
|
disabled: e.disabled,
|
|
519
505
|
onClick: r[0] ||= (e) => m(!1)
|
|
520
|
-
}, null, 8, ["label", "disabled"]), u(
|
|
506
|
+
}, null, 8, ["label", "disabled"]), u(q, {
|
|
521
507
|
size: "md",
|
|
522
508
|
label: e.approveLabel,
|
|
523
509
|
disabled: e.disabled,
|
|
524
510
|
onClick: r[1] ||= (e) => m(!0)
|
|
525
|
-
}, null, 8, ["label", "disabled"])])], 64)) : f.value ? (
|
|
511
|
+
}, null, 8, ["label", "disabled"])])], 64)) : f.value ? (S(), s("p", ke, [u(W, {
|
|
526
512
|
name: "check-circle",
|
|
527
513
|
size: 20
|
|
528
|
-
}),
|
|
514
|
+
}), T(n.$slots, "accepted", {}, () => [r[2] ||= l("You approved this tool execution.", -1)])])) : (S(), s("p", Ae, [u(W, {
|
|
529
515
|
name: "close-circle",
|
|
530
516
|
size: 20
|
|
531
|
-
}),
|
|
532
|
-
}
|
|
533
|
-
});
|
|
534
|
-
//#endregion
|
|
535
|
-
//#region src/composables/useSlotPresence.ts
|
|
536
|
-
function Y(e, t) {
|
|
537
|
-
if (e.nodeType !== Node.TEXT_NODE) return !1;
|
|
538
|
-
let n = e.textContent ?? "";
|
|
539
|
-
return t ? n.length > 0 : n.trim().length > 0;
|
|
540
|
-
}
|
|
541
|
-
function Ve(e, t, n) {
|
|
542
|
-
let r = t === "default" ? "" : t, i = Array.from(e.childNodes);
|
|
543
|
-
return r === "" ? i.some((e) => e.nodeType === Node.ELEMENT_NODE ? !e.hasAttribute("slot") : Y(e, n)) : i.some((e) => e.nodeType === Node.ELEMENT_NODE ? e.getAttribute("slot") === r : !1);
|
|
544
|
-
}
|
|
545
|
-
function He(e) {
|
|
546
|
-
if (e.shadowRoot) return null;
|
|
547
|
-
let t = e._slots;
|
|
548
|
-
return !t || typeof t != "object" ? null : t;
|
|
549
|
-
}
|
|
550
|
-
function Ue(e, t, n) {
|
|
551
|
-
let r = e[t === "" ? "default" : t];
|
|
552
|
-
return r ? r.some((e) => e.nodeType === Node.ELEMENT_NODE ? !0 : Y(e, n)) : !1;
|
|
553
|
-
}
|
|
554
|
-
function We(e, t) {
|
|
555
|
-
let n = e.shadowRoot;
|
|
556
|
-
return n ? t === "default" || t === "" ? n.querySelector("slot:not([name])") : n.querySelector(`slot[name="${CSS.escape(t)}"]`) : null;
|
|
557
|
-
}
|
|
558
|
-
function Ge(e, t, { useShadowSlot: n = !0, countWhitespaceTextInDefaultSlot: r = !1 } = {}) {
|
|
559
|
-
let i = n ? We(e, t) : null;
|
|
560
|
-
if (i) return i.assignedNodes({ flatten: !0 }).some((e) => e.nodeType === Node.ELEMENT_NODE ? !0 : Y(e, r));
|
|
561
|
-
let a = He(e);
|
|
562
|
-
return a ? Ue(a, t, r) : Ve(e, t, r);
|
|
563
|
-
}
|
|
564
|
-
function X(e, t = {}) {
|
|
565
|
-
let { host: n, vueSlots: r, observe: a = !0, listenSlotChange: o = !0, countWhitespaceTextInDefaultSlot: s = !1 } = t, c = U(), l = r ?? N(), u = e === "default" || e === "" ? "default" : e, d = () => !!l && !!l[u], f = T(d());
|
|
566
|
-
x(() => {
|
|
567
|
-
f.value = d();
|
|
568
|
-
});
|
|
569
|
-
let p = T(!1), m = null, h = null, g = () => {
|
|
570
|
-
m &&= (m.disconnect(), null), h &&= (h.removeEventListener("slotchange", _), null);
|
|
571
|
-
}, _ = () => {
|
|
572
|
-
if (!c.value) {
|
|
573
|
-
p.value = !1;
|
|
574
|
-
return;
|
|
575
|
-
}
|
|
576
|
-
let t = A(n);
|
|
577
|
-
if (!t) {
|
|
578
|
-
p.value = !1;
|
|
579
|
-
return;
|
|
580
|
-
}
|
|
581
|
-
p.value = Ge(t, e, {
|
|
582
|
-
useShadowSlot: o,
|
|
583
|
-
countWhitespaceTextInDefaultSlot: s
|
|
584
|
-
});
|
|
585
|
-
}, v = () => {
|
|
586
|
-
if (!c.value) return;
|
|
587
|
-
g();
|
|
588
|
-
let e = A(n);
|
|
589
|
-
if (!e) {
|
|
590
|
-
p.value = !1;
|
|
591
|
-
return;
|
|
592
|
-
}
|
|
593
|
-
_(), o && (h = e.shadowRoot, h?.addEventListener("slotchange", _)), a && (m = new MutationObserver(() => _()), m.observe(e, {
|
|
594
|
-
childList: !0,
|
|
595
|
-
subtree: !1,
|
|
596
|
-
attributes: !0,
|
|
597
|
-
attributeFilter: ["slot"],
|
|
598
|
-
characterData: !0
|
|
599
|
-
}));
|
|
600
|
-
};
|
|
601
|
-
return S(v), b(g), R(() => A(n), () => {
|
|
602
|
-
c.value && v();
|
|
603
|
-
}), {
|
|
604
|
-
present: i(() => c.value ? p.value : f.value),
|
|
605
|
-
hasVueSlot: f,
|
|
606
|
-
hasNativeSlot: p,
|
|
607
|
-
refresh: _
|
|
608
|
-
};
|
|
609
|
-
}
|
|
610
|
-
//#endregion
|
|
611
|
-
//#region src/components/base/PvTooltip/PvTooltip.vue?vue&type=script&setup=true&lang.ts
|
|
612
|
-
var Ke = [
|
|
613
|
-
"data-position",
|
|
614
|
-
"data-style",
|
|
615
|
-
"data-static",
|
|
616
|
-
"aria-labelledby"
|
|
617
|
-
], qe = ["id"], Je = /* @__PURE__ */ d({
|
|
618
|
-
__name: "PvTooltip",
|
|
619
|
-
props: {
|
|
620
|
-
variant: { default: "white" },
|
|
621
|
-
tooltipPosition: { default: "top-right" },
|
|
622
|
-
ariaLabelledBy: { default: "ariaLabelledById" },
|
|
623
|
-
size: { default: "md" },
|
|
624
|
-
disableInteractive: {
|
|
625
|
-
type: Boolean,
|
|
626
|
-
default: !1
|
|
627
|
-
},
|
|
628
|
-
delay: { default: 0 }
|
|
629
|
-
},
|
|
630
|
-
setup(e) {
|
|
631
|
-
let t = e, n = P("rootRef"), { present: r } = X("tooltip-content", { host: i(() => {
|
|
632
|
-
let e = n.value?.getRootNode();
|
|
633
|
-
return e instanceof ShadowRoot ? e.host : null;
|
|
634
|
-
}) }), a = i(() => t.delay > 0), c = T(!1), l = T(!1), u, d = () => {
|
|
635
|
-
u && clearTimeout(u), u = void 0;
|
|
636
|
-
}, f = i(() => !a.value || c.value || l.value), p = () => {
|
|
637
|
-
a.value && (d(), u = setTimeout(() => {
|
|
638
|
-
u = void 0, l.value = !0;
|
|
639
|
-
}, t.delay));
|
|
640
|
-
}, m = () => {
|
|
641
|
-
a.value && (d(), l.value = !1);
|
|
642
|
-
}, h = () => {
|
|
643
|
-
a.value && (c.value = !0);
|
|
644
|
-
}, g = () => {
|
|
645
|
-
a.value && (c.value = !1);
|
|
646
|
-
};
|
|
647
|
-
return b(d), (t, i) => (w(), s("div", {
|
|
648
|
-
ref_key: "rootRef",
|
|
649
|
-
ref: n,
|
|
650
|
-
"data-testid": "pv-tooltip",
|
|
651
|
-
class: _([{
|
|
652
|
-
"pv-tooltip": A(r),
|
|
653
|
-
"pv-tooltip-small": A(r) && e.size === "sm"
|
|
654
|
-
}]),
|
|
655
|
-
"data-position": e.tooltipPosition,
|
|
656
|
-
"data-style": e.variant === "white" ? "white" : "dark",
|
|
657
|
-
"data-static": e.disableInteractive ? !0 : void 0,
|
|
658
|
-
"aria-labelledby": A(r) ? e.ariaLabelledBy : void 0,
|
|
659
|
-
onMouseenter: p,
|
|
660
|
-
onMouseleave: m,
|
|
661
|
-
onFocusin: h,
|
|
662
|
-
onFocusout: g
|
|
663
|
-
}, [D(t.$slots, "label"), A(r) ? B((w(), s("div", {
|
|
664
|
-
key: 0,
|
|
665
|
-
role: "tooltip",
|
|
666
|
-
id: e.ariaLabelledBy,
|
|
667
|
-
"data-testid": "pv-tooltip-content"
|
|
668
|
-
}, [D(t.$slots, "tooltip-content")], 8, qe)), [[L, f.value]]) : o("", !0)], 42, Ke));
|
|
517
|
+
}), T(n.$slots, "rejected", {}, () => [r[3] ||= l("You rejected this tool execution.", -1)])]))])) : o("", !0);
|
|
669
518
|
}
|
|
670
|
-
}),
|
|
671
|
-
__name: "PvButtonWithTooltip",
|
|
672
|
-
props: {
|
|
673
|
-
tooltipText: {},
|
|
674
|
-
tooltipVariant: { default: "dark" },
|
|
675
|
-
tooltipPosition: {},
|
|
676
|
-
delay: { default: 500 },
|
|
677
|
-
variant: {},
|
|
678
|
-
disabled: { type: Boolean },
|
|
679
|
-
size: {},
|
|
680
|
-
loading: { type: Boolean },
|
|
681
|
-
label: {},
|
|
682
|
-
leftIcon: {},
|
|
683
|
-
rightIcon: {},
|
|
684
|
-
inverse: { type: Boolean },
|
|
685
|
-
leftCounterBadge: {},
|
|
686
|
-
rightCounterBadge: {},
|
|
687
|
-
ariaLabel: {}
|
|
688
|
-
},
|
|
689
|
-
setup(e) {
|
|
690
|
-
let t = e, n = i(() => t.size === "md" ? "sm" : "md"), r = i(() => ({
|
|
691
|
-
variant: t.variant,
|
|
692
|
-
disabled: t.disabled,
|
|
693
|
-
size: t.size,
|
|
694
|
-
loading: t.loading,
|
|
695
|
-
label: t.label,
|
|
696
|
-
leftIcon: t.leftIcon,
|
|
697
|
-
rightIcon: t.rightIcon,
|
|
698
|
-
inverse: t.inverse,
|
|
699
|
-
leftCounterBadge: t.leftCounterBadge,
|
|
700
|
-
rightCounterBadge: t.rightCounterBadge,
|
|
701
|
-
ariaLabel: t.ariaLabel
|
|
702
|
-
}));
|
|
703
|
-
return (t, i) => (w(), a(Je, {
|
|
704
|
-
variant: e.tooltipVariant,
|
|
705
|
-
"tooltip-position": e.tooltipPosition,
|
|
706
|
-
delay: e.delay,
|
|
707
|
-
size: n.value
|
|
708
|
-
}, {
|
|
709
|
-
"tooltip-content": z(() => [c("p", Ye, O(e.tooltipText), 1)]),
|
|
710
|
-
label: z(() => [u(J, v(p(r.value)), null, 16)]),
|
|
711
|
-
_: 1
|
|
712
|
-
}, 8, [
|
|
713
|
-
"variant",
|
|
714
|
-
"tooltip-position",
|
|
715
|
-
"delay",
|
|
716
|
-
"size"
|
|
717
|
-
]));
|
|
718
|
-
}
|
|
719
|
-
}), Ze = {
|
|
519
|
+
}), Me = {
|
|
720
520
|
class: "pv-flex-vertical",
|
|
721
521
|
style: { "--flex-align": "flex-start" }
|
|
722
|
-
},
|
|
522
|
+
}, Ne = ["for"], Pe = [
|
|
723
523
|
"rows",
|
|
724
524
|
"disabled",
|
|
725
525
|
"placeholder",
|
|
726
526
|
"id",
|
|
727
527
|
"data-invalid"
|
|
728
|
-
],
|
|
528
|
+
], Fe = /* @__PURE__ */ d({
|
|
729
529
|
__name: "PvTextArea",
|
|
730
|
-
props: /* @__PURE__ */
|
|
530
|
+
props: /* @__PURE__ */ p({
|
|
731
531
|
error: { type: Boolean },
|
|
732
532
|
disabled: { type: Boolean },
|
|
733
533
|
placeholder: {},
|
|
@@ -741,14 +541,14 @@ var Ke = [
|
|
|
741
541
|
}),
|
|
742
542
|
emits: ["update:modelValue"],
|
|
743
543
|
setup(e) {
|
|
744
|
-
let t =
|
|
745
|
-
return (n, r) => (
|
|
746
|
-
n.$slots.label ? (
|
|
544
|
+
let t = A(e, "modelValue");
|
|
545
|
+
return (n, r) => (S(), s("div", Me, [
|
|
546
|
+
n.$slots.label ? (S(), s("label", {
|
|
747
547
|
key: 0,
|
|
748
548
|
class: "pv-label",
|
|
749
549
|
for: e.id
|
|
750
|
-
}, [
|
|
751
|
-
|
|
550
|
+
}, [T(n.$slots, "label")], 8, Ne)) : o("", !0),
|
|
551
|
+
I(c("textarea", m(n.$attrs, {
|
|
752
552
|
"onUpdate:modelValue": r[0] ||= (e) => t.value = e,
|
|
753
553
|
class: ["pv-textarea", { "pv-surface-accent": e.variant === "grey" }],
|
|
754
554
|
rows: e.rows,
|
|
@@ -756,93 +556,78 @@ var Ke = [
|
|
|
756
556
|
placeholder: e.placeholder,
|
|
757
557
|
id: e.id,
|
|
758
558
|
"data-invalid": e.error ? !0 : void 0
|
|
759
|
-
}), null, 16,
|
|
760
|
-
e.lowerLabel ? (
|
|
559
|
+
}), null, 16, Pe), [[N, t.value]]),
|
|
560
|
+
e.lowerLabel ? (S(), s("p", {
|
|
761
561
|
key: 1,
|
|
762
562
|
style: { "margin-left": "12px" },
|
|
763
|
-
class:
|
|
563
|
+
class: g(["pv-text-body-xs", {
|
|
764
564
|
"pv-text-red": e.error,
|
|
765
565
|
"pv-text-subdued": !e.error
|
|
766
566
|
}])
|
|
767
|
-
},
|
|
567
|
+
}, E(e.lowerLabel), 3)) : o("", !0)
|
|
768
568
|
]));
|
|
769
569
|
}
|
|
770
|
-
}),
|
|
570
|
+
}), Ie = ["aria-busy"], Le = {
|
|
771
571
|
key: 0,
|
|
772
572
|
class: "pv-full-width pv-flow-8"
|
|
773
|
-
},
|
|
573
|
+
}, Re = { class: "pv-prompt-input-footer pv-flex pv-full-width" }, ze = { class: "pv-prompt-input-actions pv-flex pv-flex-item" }, Be = {
|
|
774
574
|
class: "pv-visually-hidden",
|
|
775
575
|
"aria-live": "polite"
|
|
776
|
-
},
|
|
576
|
+
}, Ve = /* @__PURE__ */ d({
|
|
777
577
|
__name: "PvPromptInput",
|
|
778
|
-
props: /* @__PURE__ */
|
|
578
|
+
props: /* @__PURE__ */ p({
|
|
779
579
|
ariaLabel: { default: "Message" },
|
|
780
580
|
disabled: {
|
|
781
581
|
type: Boolean,
|
|
782
582
|
default: !1
|
|
783
583
|
},
|
|
784
|
-
ignoreModifiedEnter: {
|
|
785
|
-
type: Boolean,
|
|
786
|
-
default: !1
|
|
787
|
-
},
|
|
788
584
|
maxHeight: { default: "200px" },
|
|
789
585
|
maxLength: {},
|
|
790
586
|
placeholder: { default: "Ask anything..." },
|
|
791
|
-
roundedButton: {
|
|
792
|
-
type: Boolean,
|
|
793
|
-
default: !1
|
|
794
|
-
},
|
|
795
587
|
rows: { default: 1 },
|
|
796
588
|
status: { default: "ready" },
|
|
797
589
|
stopLabel: { default: "Stop generating" },
|
|
798
|
-
|
|
799
|
-
submitIcon: { default: "send" },
|
|
800
|
-
submitLabel: { default: "Send message" },
|
|
801
|
-
submitPending: {
|
|
802
|
-
type: Boolean,
|
|
803
|
-
default: !1
|
|
804
|
-
},
|
|
805
|
-
submitPendingLabel: {}
|
|
590
|
+
submitLabel: { default: "Send message" }
|
|
806
591
|
}, {
|
|
807
592
|
modelValue: { default: "" },
|
|
808
593
|
modelModifiers: {}
|
|
809
594
|
}),
|
|
810
|
-
emits: /* @__PURE__ */
|
|
595
|
+
emits: /* @__PURE__ */ p(["submit", "stop"], ["update:modelValue"]),
|
|
811
596
|
setup(e, { expose: n, emit: r }) {
|
|
812
|
-
let
|
|
813
|
-
function
|
|
814
|
-
|
|
597
|
+
let a = e, d = r, f = A(e, "modelValue"), p = C(), m = i(() => a.status === "submitted" || a.status === "streaming"), h = i(() => !a.disabled && !m.value && f.value.trim().length > 0);
|
|
598
|
+
function g() {
|
|
599
|
+
h.value && d("submit", f.value.trim());
|
|
815
600
|
}
|
|
816
|
-
function
|
|
817
|
-
|
|
601
|
+
function v() {
|
|
602
|
+
p.value?.querySelector("textarea")?.focus();
|
|
818
603
|
}
|
|
819
|
-
function
|
|
820
|
-
|
|
604
|
+
function y(e) {
|
|
605
|
+
a.disabled || e.target?.closest("button, a, input, textarea, select, [tabindex]") || v();
|
|
821
606
|
}
|
|
822
|
-
function
|
|
823
|
-
e.key !== "Enter" || e.shiftKey || e.isComposing ||
|
|
607
|
+
function b(e) {
|
|
608
|
+
e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(), e.stopPropagation(), g());
|
|
824
609
|
}
|
|
825
|
-
return n({ focus:
|
|
610
|
+
return n({ focus: v }), (n, r) => (S(), s("form", {
|
|
826
611
|
ref_key: "formRef",
|
|
827
|
-
ref:
|
|
612
|
+
ref: p,
|
|
828
613
|
class: "pv-prompt-input pv-bordered pv-radius pv-inset-square-8 pv-flex-vertical",
|
|
829
614
|
"data-testid": "pv-prompt-input",
|
|
830
|
-
"aria-busy":
|
|
831
|
-
onSubmit:
|
|
832
|
-
onClick:
|
|
615
|
+
"aria-busy": m.value,
|
|
616
|
+
onSubmit: R(g, ["prevent"]),
|
|
617
|
+
onClick: y
|
|
833
618
|
}, [
|
|
834
|
-
n.$slots.header ? (
|
|
835
|
-
u(
|
|
836
|
-
modelValue:
|
|
837
|
-
"onUpdate:modelValue": r[0] ||= (e) =>
|
|
619
|
+
n.$slots.header ? (S(), s("div", Le, [T(n.$slots, "header")])) : o("", !0),
|
|
620
|
+
u(Fe, {
|
|
621
|
+
modelValue: f.value,
|
|
622
|
+
"onUpdate:modelValue": r[0] ||= (e) => f.value = e,
|
|
838
623
|
class: "pv-prompt-input-textarea",
|
|
839
|
-
style:
|
|
624
|
+
style: _({ "--prompt-input-max-height": e.maxHeight }),
|
|
840
625
|
rows: e.rows,
|
|
841
626
|
maxlength: e.maxLength,
|
|
842
627
|
placeholder: e.placeholder,
|
|
843
628
|
disabled: e.disabled,
|
|
844
629
|
"aria-label": e.ariaLabel,
|
|
845
|
-
onKeydown:
|
|
630
|
+
onKeydown: b
|
|
846
631
|
}, null, 8, [
|
|
847
632
|
"modelValue",
|
|
848
633
|
"style",
|
|
@@ -852,57 +637,32 @@ var Ke = [
|
|
|
852
637
|
"disabled",
|
|
853
638
|
"aria-label"
|
|
854
639
|
]),
|
|
855
|
-
c("div",
|
|
856
|
-
|
|
857
|
-
"
|
|
858
|
-
delay: 0,
|
|
859
|
-
variant: h.value ? "secondary" : "primary",
|
|
640
|
+
c("div", Re, [c("div", ze, [T(n.$slots, "actions")]), u(q, {
|
|
641
|
+
type: m.value ? "button" : "submit",
|
|
642
|
+
variant: m.value ? "secondary" : "primary",
|
|
860
643
|
size: "md",
|
|
861
|
-
"left-icon":
|
|
862
|
-
"aria-label":
|
|
863
|
-
disabled: e.disabled || !
|
|
864
|
-
|
|
865
|
-
style: y(b.value),
|
|
866
|
-
onClick: r[1] ||= (e) => h.value && f("stop")
|
|
867
|
-
}, null, 8, [
|
|
868
|
-
"tooltip-text",
|
|
869
|
-
"variant",
|
|
870
|
-
"left-icon",
|
|
871
|
-
"aria-label",
|
|
872
|
-
"disabled",
|
|
873
|
-
"loading",
|
|
874
|
-
"style"
|
|
875
|
-
])) : (w(), a(J, {
|
|
876
|
-
key: 1,
|
|
877
|
-
type: h.value ? "button" : "submit",
|
|
878
|
-
variant: h.value ? "secondary" : "primary",
|
|
879
|
-
size: "md",
|
|
880
|
-
"left-icon": h.value ? "stop" : e.submitIcon,
|
|
881
|
-
"aria-label": h.value ? e.stopLabel : e.submitLabel,
|
|
882
|
-
disabled: e.disabled || !h.value && !_.value,
|
|
883
|
-
loading: g.value,
|
|
884
|
-
style: y(b.value),
|
|
885
|
-
onClick: r[2] ||= (e) => h.value && f("stop")
|
|
644
|
+
"left-icon": m.value ? "stop" : "send",
|
|
645
|
+
"aria-label": m.value ? e.stopLabel : e.submitLabel,
|
|
646
|
+
disabled: e.disabled || !m.value && !h.value,
|
|
647
|
+
onClick: r[1] ||= (e) => m.value && d("stop")
|
|
886
648
|
}, null, 8, [
|
|
887
649
|
"type",
|
|
888
650
|
"variant",
|
|
889
651
|
"left-icon",
|
|
890
652
|
"aria-label",
|
|
891
|
-
"disabled"
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
c("p", at, [e.status === "submitted" ? (w(), s(t, { key: 0 }, [l("Message submitted.")], 64)) : e.status === "streaming" ? (w(), s(t, { key: 1 }, [l("Response is streaming.")], 64)) : e.status === "error" ? (w(), s(t, { key: 2 }, [l("The message could not be sent.")], 64)) : o("", !0)])
|
|
896
|
-
], 40, tt));
|
|
653
|
+
"disabled"
|
|
654
|
+
])]),
|
|
655
|
+
c("p", Be, [e.status === "submitted" ? (S(), s(t, { key: 0 }, [l("Message submitted.")], 64)) : e.status === "streaming" ? (S(), s(t, { key: 1 }, [l("Response is streaming.")], 64)) : e.status === "error" ? (S(), s(t, { key: 2 }, [l("The message could not be sent.")], 64)) : o("", !0)])
|
|
656
|
+
], 40, Ie));
|
|
897
657
|
}
|
|
898
|
-
}),
|
|
658
|
+
}), He = [
|
|
899
659
|
"ready",
|
|
900
660
|
"submitted",
|
|
901
661
|
"streaming",
|
|
902
662
|
"error"
|
|
903
|
-
],
|
|
663
|
+
], Ue = ["open"], X = /* @__PURE__ */ G(/* @__PURE__ */ d({
|
|
904
664
|
__name: "PvAccordion",
|
|
905
|
-
props: /* @__PURE__ */
|
|
665
|
+
props: /* @__PURE__ */ p({
|
|
906
666
|
chevronPosition: { default: "right" },
|
|
907
667
|
chevronVariant: { default: "vertical" },
|
|
908
668
|
defaultOpen: { type: Boolean },
|
|
@@ -928,69 +688,148 @@ var Ke = [
|
|
|
928
688
|
modelValue: { type: Boolean },
|
|
929
689
|
modelModifiers: {}
|
|
930
690
|
}),
|
|
931
|
-
emits: /* @__PURE__ */
|
|
691
|
+
emits: /* @__PURE__ */ p([
|
|
932
692
|
"summary-mouseenter",
|
|
933
693
|
"summary-mouseleave",
|
|
934
694
|
"summary-click"
|
|
935
695
|
], ["update:modelValue"]),
|
|
936
696
|
setup(e, { emit: n }) {
|
|
937
|
-
let r = e, l =
|
|
697
|
+
let r = e, l = A(e, "modelValue"), u = n;
|
|
938
698
|
r.defaultOpen !== void 0 && (l.value = r.defaultOpen);
|
|
939
699
|
let d = (e) => {
|
|
940
700
|
l.value = e.target.open;
|
|
941
701
|
}, f = (e) => {
|
|
942
702
|
e.detail !== 0 && (e.target?.closest("[data-pv-accordion-chevron]") || e.defaultPrevented || (e.preventDefault(), u("summary-click", e)));
|
|
943
|
-
}, p = i(() => r.toggleOnChevronOnly ? { click: f } : {}),
|
|
944
|
-
return (n, r) => (
|
|
703
|
+
}, p = i(() => r.toggleOnChevronOnly ? { click: f } : {}), h = { width: r.enableTriggerFullWidth ? "100%" : "fit-content" }, g = i(() => r.chevronVariant === "horizontal" ? r.chevronPosition === "left" ? l.value ? "chevron-down" : "chevron-right" : l.value ? "chevron-down" : "chevron-left" : l.value ? "chevron-up" : "chevron-down");
|
|
704
|
+
return (n, r) => (S(), s("details", {
|
|
945
705
|
"data-testid": "pv-accordion",
|
|
946
706
|
class: "pv-accordion",
|
|
947
707
|
open: l.value,
|
|
948
708
|
onToggle: d
|
|
949
|
-
}, [c("summary",
|
|
709
|
+
}, [c("summary", m(e.summaryAttrs, {
|
|
950
710
|
class: ["pv-flex pv-space-between pv-relative", e.summaryClasses],
|
|
951
711
|
style: {
|
|
952
|
-
...
|
|
712
|
+
...h,
|
|
953
713
|
...e.summaryStyles
|
|
954
714
|
},
|
|
955
715
|
onMouseenter: r[0] ||= (e) => n.$emit("summary-mouseenter"),
|
|
956
716
|
onMouseleave: r[1] ||= (e) => n.$emit("summary-mouseleave")
|
|
957
|
-
},
|
|
958
|
-
|
|
959
|
-
e.chevronPosition === "left" ? (
|
|
717
|
+
}, D(p.value, !0)), [
|
|
718
|
+
T(n.$slots, "leading", {}, void 0, !0),
|
|
719
|
+
e.chevronPosition === "left" ? (S(), a(W, {
|
|
960
720
|
key: 0,
|
|
961
721
|
name: g.value,
|
|
962
722
|
"data-pv-accordion-chevron": ""
|
|
963
723
|
}, null, 8, ["name"])) : o("", !0),
|
|
964
|
-
e.enableTriggerSlot ?
|
|
724
|
+
e.enableTriggerSlot ? T(n.$slots, "trigger", { key: 1 }, void 0, !0) : (S(), s(t, { key: 2 }, [c("span", null, E(e.header), 1), e.counter ? (S(), a(K, {
|
|
965
725
|
key: 0,
|
|
966
726
|
value: e.counter,
|
|
967
727
|
variant: "secondary",
|
|
968
728
|
size: "sm"
|
|
969
729
|
}, null, 8, ["value"])) : o("", !0)], 64)),
|
|
970
|
-
e.chevronPosition === "right" ? (
|
|
730
|
+
e.chevronPosition === "right" ? (S(), a(W, {
|
|
971
731
|
key: 3,
|
|
972
732
|
name: g.value,
|
|
973
733
|
"data-pv-accordion-chevron": ""
|
|
974
734
|
}, null, 8, ["name"])) : o("", !0)
|
|
975
|
-
], 16), c("div", { style:
|
|
735
|
+
], 16), c("div", { style: _(e.contentStyles) }, [T(n.$slots, "default", {}, void 0, !0)], 4)], 40, Ue));
|
|
976
736
|
}
|
|
977
|
-
}), [["__scopeId", "data-v-dfa0b416"]])
|
|
737
|
+
}), [["__scopeId", "data-v-dfa0b416"]]);
|
|
738
|
+
//#endregion
|
|
739
|
+
//#region src/composables/useSlotPresence.ts
|
|
740
|
+
function Z(e, t) {
|
|
741
|
+
if (e.nodeType !== Node.TEXT_NODE) return !1;
|
|
742
|
+
let n = e.textContent ?? "";
|
|
743
|
+
return t ? n.length > 0 : n.trim().length > 0;
|
|
744
|
+
}
|
|
745
|
+
function We(e, t, n) {
|
|
746
|
+
let r = t === "default" ? "" : t, i = Array.from(e.childNodes);
|
|
747
|
+
return r === "" ? i.some((e) => e.nodeType === Node.ELEMENT_NODE ? !e.hasAttribute("slot") : Z(e, n)) : i.some((e) => e.nodeType === Node.ELEMENT_NODE ? e.getAttribute("slot") === r : !1);
|
|
748
|
+
}
|
|
749
|
+
function Ge(e) {
|
|
750
|
+
if (e.shadowRoot) return null;
|
|
751
|
+
let t = e._slots;
|
|
752
|
+
return !t || typeof t != "object" ? null : t;
|
|
753
|
+
}
|
|
754
|
+
function Ke(e, t, n) {
|
|
755
|
+
let r = e[t === "" ? "default" : t];
|
|
756
|
+
return r ? r.some((e) => e.nodeType === Node.ELEMENT_NODE ? !0 : Z(e, n)) : !1;
|
|
757
|
+
}
|
|
758
|
+
function qe(e, t) {
|
|
759
|
+
let n = e.shadowRoot;
|
|
760
|
+
return n ? t === "default" || t === "" ? n.querySelector("slot:not([name])") : n.querySelector(`slot[name="${CSS.escape(t)}"]`) : null;
|
|
761
|
+
}
|
|
762
|
+
function Je(e, t, { useShadowSlot: n = !0, countWhitespaceTextInDefaultSlot: r = !1 } = {}) {
|
|
763
|
+
let i = n ? qe(e, t) : null;
|
|
764
|
+
if (i) return i.assignedNodes({ flatten: !0 }).some((e) => e.nodeType === Node.ELEMENT_NODE ? !0 : Z(e, r));
|
|
765
|
+
let a = Ge(e);
|
|
766
|
+
return a ? Ke(a, t, r) : We(e, t, r);
|
|
767
|
+
}
|
|
768
|
+
function Ye(e, t = {}) {
|
|
769
|
+
let { host: n, vueSlots: r, observe: a = !0, listenSlotChange: o = !0, countWhitespaceTextInDefaultSlot: s = !1 } = t, c = U(), l = r ?? j(), u = e === "default" || e === "" ? "default" : e, d = () => !!l && !!l[u], f = C(d());
|
|
770
|
+
y(() => {
|
|
771
|
+
f.value = d();
|
|
772
|
+
});
|
|
773
|
+
let p = C(!1), m = null, h = null, g = () => {
|
|
774
|
+
m &&= (m.disconnect(), null), h &&= (h.removeEventListener("slotchange", _), null);
|
|
775
|
+
}, _ = () => {
|
|
776
|
+
if (!c.value) {
|
|
777
|
+
p.value = !1;
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
780
|
+
let t = O(n);
|
|
781
|
+
if (!t) {
|
|
782
|
+
p.value = !1;
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
p.value = Je(t, e, {
|
|
786
|
+
useShadowSlot: o,
|
|
787
|
+
countWhitespaceTextInDefaultSlot: s
|
|
788
|
+
});
|
|
789
|
+
}, x = () => {
|
|
790
|
+
if (!c.value) return;
|
|
791
|
+
g();
|
|
792
|
+
let e = O(n);
|
|
793
|
+
if (!e) {
|
|
794
|
+
p.value = !1;
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
_(), o && (h = e.shadowRoot, h?.addEventListener("slotchange", _)), a && (m = new MutationObserver(() => _()), m.observe(e, {
|
|
798
|
+
childList: !0,
|
|
799
|
+
subtree: !1,
|
|
800
|
+
attributes: !0,
|
|
801
|
+
attributeFilter: ["slot"],
|
|
802
|
+
characterData: !0
|
|
803
|
+
}));
|
|
804
|
+
};
|
|
805
|
+
return b(x), v(g), P(() => O(n), () => {
|
|
806
|
+
c.value && x();
|
|
807
|
+
}), {
|
|
808
|
+
present: i(() => c.value ? p.value : f.value),
|
|
809
|
+
hasVueSlot: f,
|
|
810
|
+
hasNativeSlot: p,
|
|
811
|
+
refresh: _
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
//#endregion
|
|
815
|
+
//#region src/components/ai/PvStepList/PvStepList.vue?vue&type=script&setup=true&lang.ts
|
|
816
|
+
var Xe = ["data-status"], Ze = {
|
|
978
817
|
key: 0,
|
|
979
818
|
class: "pv-step-marker",
|
|
980
819
|
"aria-hidden": "true"
|
|
981
|
-
},
|
|
820
|
+
}, Qe = {
|
|
982
821
|
key: 1,
|
|
983
822
|
class: "pv-step-dot"
|
|
984
|
-
},
|
|
823
|
+
}, $e = { class: "pv-step-body pv-flow-8" }, et = {
|
|
985
824
|
key: 0,
|
|
986
825
|
class: "pv-step-aside pv-text-body-md pv-text-tertiary"
|
|
987
|
-
},
|
|
826
|
+
}, tt = {
|
|
988
827
|
key: 0,
|
|
989
828
|
class: "pv-tag-highlight"
|
|
990
|
-
},
|
|
829
|
+
}, nt = {
|
|
991
830
|
key: 0,
|
|
992
831
|
class: "pv-text-body-md pv-text-tertiary"
|
|
993
|
-
},
|
|
832
|
+
}, rt = {
|
|
994
833
|
key: 1,
|
|
995
834
|
class: "pv-flex",
|
|
996
835
|
role: "list",
|
|
@@ -998,7 +837,7 @@ var Ke = [
|
|
|
998
837
|
"--flex-wrap": "wrap",
|
|
999
838
|
"--flex-gap": "4px"
|
|
1000
839
|
}
|
|
1001
|
-
},
|
|
840
|
+
}, it = {
|
|
1002
841
|
key: 2,
|
|
1003
842
|
class: "pv-text-body-md pv-text-medium pv-text-brand"
|
|
1004
843
|
}, Q = /* @__PURE__ */ d({
|
|
@@ -1021,46 +860,46 @@ var Ke = [
|
|
|
1021
860
|
function d(e, t) {
|
|
1022
861
|
return u(e, t) === "active" ? "pv-text-medium pv-text-default" : "pv-text-quaternary";
|
|
1023
862
|
}
|
|
1024
|
-
return (n, i) => (
|
|
863
|
+
return (n, i) => (S(), a(r, {
|
|
1025
864
|
tag: "ol",
|
|
1026
865
|
name: "pv-step",
|
|
1027
866
|
class: "pv-step-list",
|
|
1028
867
|
role: "list"
|
|
1029
868
|
}, {
|
|
1030
|
-
default:
|
|
869
|
+
default: F(() => [(S(!0), s(t, null, w(e.steps, (e, n) => (S(), s("li", {
|
|
1031
870
|
key: e.id ?? n,
|
|
1032
871
|
class: "pv-step",
|
|
1033
872
|
"data-status": u(e, n)
|
|
1034
|
-
}, [e.variant === "aside" ? o("", !0) : (
|
|
873
|
+
}, [e.variant === "aside" ? o("", !0) : (S(), s("span", Ze, [e.icon ? (S(), a(W, {
|
|
1035
874
|
key: 0,
|
|
1036
875
|
name: e.icon,
|
|
1037
876
|
size: 12
|
|
1038
|
-
}, null, 8, ["name"])) : (
|
|
877
|
+
}, null, 8, ["name"])) : (S(), s("span", Qe))])), c("div", $e, [e.variant === "aside" ? (S(), s("p", et, [c("em", null, E(e.label), 1)])) : (S(), s(t, { key: 1 }, [
|
|
1039
878
|
c("p", {
|
|
1040
|
-
class:
|
|
879
|
+
class: g(["pv-flex pv-text-body-md", d(e, n)]),
|
|
1041
880
|
style: { "--flex-wrap": "wrap" }
|
|
1042
|
-
}, [c("span", { class:
|
|
1043
|
-
e.note ? (
|
|
1044
|
-
e.tags && e.tags.length > 0 ? (
|
|
881
|
+
}, [c("span", { class: g({ "pv-shimmer": u(e, n) === "active" }) }, E(e.label), 3), e.artifact ? (S(), s("span", tt, E(e.artifact), 1)) : o("", !0)], 2),
|
|
882
|
+
e.note ? (S(), s("p", nt, E(e.note), 1)) : o("", !0),
|
|
883
|
+
e.tags && e.tags.length > 0 ? (S(), s("ul", rt, [(S(!0), s(t, null, w(e.tags, (e, t) => (S(), s("li", {
|
|
1045
884
|
key: t,
|
|
1046
|
-
class:
|
|
885
|
+
class: g(["pv-tag-secondary", { "pv-text-quaternary": e.variant === "muted" }]),
|
|
1047
886
|
"data-style": "rounded"
|
|
1048
|
-
},
|
|
1049
|
-
e.outcome ? (
|
|
1050
|
-
], 64))])], 8,
|
|
887
|
+
}, E(e.label), 3))), 128))])) : o("", !0),
|
|
888
|
+
e.outcome ? (S(), s("p", it, " →\xA0" + E(e.outcome), 1)) : o("", !0)
|
|
889
|
+
], 64))])], 8, Xe))), 128))]),
|
|
1051
890
|
_: 1
|
|
1052
891
|
}));
|
|
1053
892
|
}
|
|
1054
|
-
}),
|
|
893
|
+
}), at = {
|
|
1055
894
|
class: "pv-reasoning-trigger pv-flex pv-text-body-md pv-text-medium",
|
|
1056
895
|
"aria-live": "polite"
|
|
1057
|
-
},
|
|
896
|
+
}, ot = { class: "pv-reasoning-content pv-text-body-md pv-text-tertiary" }, st = {
|
|
1058
897
|
key: 1,
|
|
1059
898
|
class: "pv-reasoning-trigger pv-reasoning-standalone pv-flex pv-text-body-md pv-text-medium pv-text-tertiary",
|
|
1060
899
|
"aria-live": "polite"
|
|
1061
|
-
},
|
|
900
|
+
}, ct = /* @__PURE__ */ d({
|
|
1062
901
|
__name: "PvReasoning",
|
|
1063
|
-
props: /* @__PURE__ */
|
|
902
|
+
props: /* @__PURE__ */ p({
|
|
1064
903
|
autoCloseDelay: { default: 1e3 },
|
|
1065
904
|
completedLabel: { default: "Reasoning" },
|
|
1066
905
|
defaultOpen: {
|
|
@@ -1083,36 +922,36 @@ var Ke = [
|
|
|
1083
922
|
}),
|
|
1084
923
|
emits: ["update:open"],
|
|
1085
924
|
setup(r) {
|
|
1086
|
-
let l = r, d =
|
|
925
|
+
let l = r, d = A(r, "open"), p = C(), m = C(), h = C(!1), _;
|
|
1087
926
|
(l.defaultOpen || l.isStreaming) && (d.value = !0), l.isStreaming && (m.value = Date.now());
|
|
1088
|
-
let
|
|
927
|
+
let y = i(() => l.duration ?? p.value), b = i(() => {
|
|
1089
928
|
if (l.isStreaming) return l.streamingLabel;
|
|
1090
|
-
if (
|
|
1091
|
-
let e = Math.max(1, Math.round(
|
|
929
|
+
if (y.value === void 0) return l.completedLabel;
|
|
930
|
+
let e = Math.max(1, Math.round(y.value));
|
|
1092
931
|
return `Thought for ${e} ${e === 1 ? "second" : "seconds"}`;
|
|
1093
|
-
}), x =
|
|
1094
|
-
function
|
|
1095
|
-
return r.some((r) => r.type === e ? !1 : r.type === n ? String(r.children ?? "").trim().length > 0 : r.type === t ? Array.isArray(r.children) &&
|
|
932
|
+
}), x = j(), w = f(), D = U(), O = i(() => D.value ? w?.ce : null), { hasNativeSlot: k } = Ye("default", { host: O });
|
|
933
|
+
function M(r) {
|
|
934
|
+
return r.some((r) => r.type === e ? !1 : r.type === n ? String(r.children ?? "").trim().length > 0 : r.type === t ? Array.isArray(r.children) && M(r.children) : !0);
|
|
1096
935
|
}
|
|
1097
|
-
function
|
|
1098
|
-
return l.steps.length > 0 || k.value ? !0 :
|
|
936
|
+
function N() {
|
|
937
|
+
return l.steps.length > 0 || k.value ? !0 : O.value ? !1 : M(x.default?.({}) ?? []);
|
|
1099
938
|
}
|
|
1100
|
-
function
|
|
1101
|
-
|
|
939
|
+
function I() {
|
|
940
|
+
_ !== void 0 && (clearTimeout(_), _ = void 0);
|
|
1102
941
|
}
|
|
1103
|
-
function
|
|
942
|
+
function L(e) {
|
|
1104
943
|
let t = e.target?.closest?.("summary");
|
|
1105
|
-
!t || t.parentElement !== e.currentTarget || (h.value = !0,
|
|
944
|
+
!t || t.parentElement !== e.currentTarget || (h.value = !0, I());
|
|
1106
945
|
}
|
|
1107
|
-
return
|
|
1108
|
-
if (
|
|
946
|
+
return P(() => l.isStreaming, (e, t) => {
|
|
947
|
+
if (I(), e) {
|
|
1109
948
|
m.value = Date.now(), p.value = void 0, h.value = !1, d.value = !0;
|
|
1110
949
|
return;
|
|
1111
950
|
}
|
|
1112
|
-
t && (m.value !== void 0 && (p.value = (Date.now() - m.value) / 1e3), h.value || (
|
|
951
|
+
t && (m.value !== void 0 && (p.value = (Date.now() - m.value) / 1e3), h.value || (_ = setTimeout(() => {
|
|
1113
952
|
h.value || (d.value = !1);
|
|
1114
953
|
}, l.autoCloseDelay)));
|
|
1115
|
-
}),
|
|
954
|
+
}), v(I), (e, t) => N() ? (S(), a(X, {
|
|
1116
955
|
key: 0,
|
|
1117
956
|
modelValue: d.value,
|
|
1118
957
|
"onUpdate:modelValue": t[0] ||= (e) => d.value = e,
|
|
@@ -1124,31 +963,31 @@ var Ke = [
|
|
|
1124
963
|
"enable-trigger-slot": "",
|
|
1125
964
|
"summary-classes": { "pv-text-tertiary": !0 },
|
|
1126
965
|
"summary-styles": { justifyContent: "flex-start" },
|
|
1127
|
-
onClick:
|
|
966
|
+
onClick: L
|
|
1128
967
|
}, {
|
|
1129
|
-
trigger:
|
|
1130
|
-
default:
|
|
968
|
+
trigger: F(() => [c("span", at, [T(e.$slots, "trigger", {}, () => [u(W, { name: "brain" }), c("span", { class: g(["pv-text-subdued", { "pv-shimmer": r.isStreaming }]) }, E(b.value), 3)])])]),
|
|
969
|
+
default: F(() => [c("div", ot, [r.steps.length > 0 ? (S(), a(Q, {
|
|
1131
970
|
key: 0,
|
|
1132
971
|
steps: r.steps,
|
|
1133
972
|
"in-progress": r.isStreaming
|
|
1134
|
-
}, null, 8, ["steps", "in-progress"])) : o("", !0),
|
|
973
|
+
}, null, 8, ["steps", "in-progress"])) : o("", !0), T(e.$slots, "default")])]),
|
|
1135
974
|
_: 3
|
|
1136
|
-
}, 8, ["modelValue", "default-open"])) : (
|
|
975
|
+
}, 8, ["modelValue", "default-open"])) : (S(), s("span", st, [T(e.$slots, "trigger", {}, () => [u(W, { name: "brain" }), c("span", { class: g(["pv-text-subdued", { "pv-shimmer": r.isStreaming }]) }, E(b.value), 3)])]));
|
|
1137
976
|
}
|
|
1138
|
-
}),
|
|
977
|
+
}), lt = { class: "pv-tool-heading pv-flex pv-flex-item" }, ut = { class: "pv-text-title-sm pv-truncate" }, dt = { class: "pv-tool-disclosure-content" }, ft = { class: "pv-flow-16 pv-border-top pv-tool-content" }, $ = {
|
|
1139
978
|
key: 0,
|
|
1140
979
|
class: "pv-flow-8"
|
|
1141
|
-
},
|
|
980
|
+
}, pt = { class: "pv-surface-accent pv-inset-square-12 pv-radius-sm pv-text-body-xs" }, mt = {
|
|
1142
981
|
key: 1,
|
|
1143
982
|
class: "pv-flow-8",
|
|
1144
983
|
role: "alert",
|
|
1145
984
|
"aria-label": "Tool error"
|
|
1146
|
-
},
|
|
985
|
+
}, ht = { class: "pv-surface-critical pv-inset-square-12 pv-radius-sm pv-text-body-xs pv-text-critical" }, gt = {
|
|
1147
986
|
key: 2,
|
|
1148
987
|
class: "pv-flow-8"
|
|
1149
|
-
},
|
|
988
|
+
}, _t = { class: "pv-surface-accent pv-inset-square-12 pv-radius-sm pv-text-body-xs" }, vt = /* @__PURE__ */ d({
|
|
1150
989
|
__name: "PvTool",
|
|
1151
|
-
props: /* @__PURE__ */
|
|
990
|
+
props: /* @__PURE__ */ p({
|
|
1152
991
|
defaultOpen: {
|
|
1153
992
|
type: Boolean,
|
|
1154
993
|
default: !1
|
|
@@ -1181,7 +1020,7 @@ var Ke = [
|
|
|
1181
1020
|
}),
|
|
1182
1021
|
emits: ["update:open"],
|
|
1183
1022
|
setup(e) {
|
|
1184
|
-
let t = e, n =
|
|
1023
|
+
let t = e, n = A(e, "open"), r = ["output-available", "output-error"];
|
|
1185
1024
|
(t.defaultOpen || r.includes(t.state)) && (n.value = !0);
|
|
1186
1025
|
let l = i(() => ({
|
|
1187
1026
|
"input-streaming": {
|
|
@@ -1221,9 +1060,9 @@ var Ke = [
|
|
|
1221
1060
|
return String(e);
|
|
1222
1061
|
}
|
|
1223
1062
|
}
|
|
1224
|
-
return
|
|
1063
|
+
return P(() => t.state, (e, t) => {
|
|
1225
1064
|
e !== t && r.includes(e) && (n.value = !0);
|
|
1226
|
-
}), (t, r) => (
|
|
1065
|
+
}), (t, r) => (S(), a(X, {
|
|
1227
1066
|
modelValue: n.value,
|
|
1228
1067
|
"onUpdate:modelValue": r[0] ||= (e) => n.value = e,
|
|
1229
1068
|
"default-open": n.value,
|
|
@@ -1234,22 +1073,22 @@ var Ke = [
|
|
|
1234
1073
|
"enable-trigger-slot": "",
|
|
1235
1074
|
"summary-classes": { "pv-inset-square-12": !0 }
|
|
1236
1075
|
}, {
|
|
1237
|
-
trigger:
|
|
1076
|
+
trigger: F(() => [c("span", lt, [
|
|
1238
1077
|
u(W, {
|
|
1239
1078
|
name: "settings",
|
|
1240
1079
|
size: 20
|
|
1241
1080
|
}),
|
|
1242
|
-
c("span",
|
|
1081
|
+
c("span", ut, E(e.toolName), 1),
|
|
1243
1082
|
c("span", {
|
|
1244
|
-
class:
|
|
1083
|
+
class: g([l.value.className, "pv-tag-sm"]),
|
|
1245
1084
|
role: "status"
|
|
1246
|
-
},
|
|
1085
|
+
}, E(l.value.label), 3)
|
|
1247
1086
|
])]),
|
|
1248
|
-
default:
|
|
1087
|
+
default: F(() => [c("div", dt, [c("div", ft, [t.$slots.input || e.input !== void 0 ? (S(), s("section", $, [r[1] ||= c("h3", { class: "pv-text-title-xs" }, "Parameters", -1), T(t.$slots, "input", { input: e.input }, () => [c("pre", pt, [c("code", null, E(d(e.input)), 1)])])])) : o("", !0), e.errorText ? (S(), s("section", mt, [r[2] ||= c("h3", { class: "pv-text-title-xs pv-text-critical" }, "Error", -1), c("pre", ht, E(e.errorText), 1)])) : t.$slots.output || e.output !== void 0 ? (S(), s("section", gt, [r[3] ||= c("h3", { class: "pv-text-title-xs" }, "Result", -1), T(t.$slots, "output", { output: e.output }, () => [c("pre", _t, [c("code", null, E(d(e.output)), 1)])])])) : o("", !0)])])]),
|
|
1249
1088
|
_: 3
|
|
1250
1089
|
}, 8, ["modelValue", "default-open"]));
|
|
1251
1090
|
}
|
|
1252
|
-
}),
|
|
1091
|
+
}), yt = [
|
|
1253
1092
|
"input-streaming",
|
|
1254
1093
|
"input-available",
|
|
1255
1094
|
"approval-requested",
|
|
@@ -1260,8 +1099,8 @@ var Ke = [
|
|
|
1260
1099
|
];
|
|
1261
1100
|
//#endregion
|
|
1262
1101
|
//#region src/components/ai/useStickToBottom.ts
|
|
1263
|
-
function
|
|
1264
|
-
let n = t.threshold ?? 32, r =
|
|
1102
|
+
function bt(e, t = {}) {
|
|
1103
|
+
let n = t.threshold ?? 32, r = C(!0);
|
|
1265
1104
|
function i() {
|
|
1266
1105
|
let t = e.value;
|
|
1267
1106
|
t && (r.value = t.scrollHeight - t.scrollTop - t.clientHeight <= n);
|
|
@@ -1292,14 +1131,14 @@ function Nt(e, t = {}) {
|
|
|
1292
1131
|
e.removeEventListener("scroll", t), s.forEach((e) => e.disconnect());
|
|
1293
1132
|
};
|
|
1294
1133
|
}
|
|
1295
|
-
return
|
|
1134
|
+
return P(e, (e) => {
|
|
1296
1135
|
o?.(), o = void 0, e && s(e);
|
|
1297
|
-
}, { immediate: !0 }),
|
|
1136
|
+
}, { immediate: !0 }), x(() => o?.()), {
|
|
1298
1137
|
isAtBottom: r,
|
|
1299
1138
|
scrollToBottom: a
|
|
1300
1139
|
};
|
|
1301
1140
|
}
|
|
1302
1141
|
//#endregion
|
|
1303
|
-
export {
|
|
1142
|
+
export { je as PvConfirmation, Ve as PvPromptInput, Te as PvQuestion, ct as PvReasoning, Q as PvStepList, vt as PvTool, He as promptInputStatuses, yt as toolLifecycleStates, bt as useStickToBottom };
|
|
1304
1143
|
|
|
1305
1144
|
//# sourceMappingURL=pv-components-ai.mjs.map
|