@turquoisehealth/pit-viper 2.264.2-dev.1 → 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 -6
- package/_site/assets/css/pit-viper-a11y.css +0 -6
- package/_site/assets/css/pit-viper-consumer.css +0 -6
- package/_site/assets/css/pit-viper-v2-scoped.css +0 -5
- package/_site/assets/css/pit-viper-v2.css +0 -6
- package/_site/assets/css/pit-viper-v3.css +0 -6
- package/_site/assets/css/pit-viper.css +0 -6
- 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 -489
- 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 -829
- 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));
|
|
669
|
-
}
|
|
670
|
-
}), Ye = { class: "pv-text-body-sm" }, Xe = /* @__PURE__ */ d({
|
|
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
|
-
]));
|
|
517
|
+
}), T(n.$slots, "rejected", {}, () => [r[3] ||= l("You rejected this tool execution.", -1)])]))])) : o("", !0);
|
|
718
518
|
}
|
|
719
|
-
}),
|
|
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,96 +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:
|
|
840
|
-
"--prompt-input-max-height": e.maxHeight,
|
|
841
|
-
"--prompt-input-rows": e.rows
|
|
842
|
-
}),
|
|
624
|
+
style: _({ "--prompt-input-max-height": e.maxHeight }),
|
|
843
625
|
rows: e.rows,
|
|
844
626
|
maxlength: e.maxLength,
|
|
845
627
|
placeholder: e.placeholder,
|
|
846
628
|
disabled: e.disabled,
|
|
847
629
|
"aria-label": e.ariaLabel,
|
|
848
|
-
onKeydown:
|
|
630
|
+
onKeydown: b
|
|
849
631
|
}, null, 8, [
|
|
850
632
|
"modelValue",
|
|
851
633
|
"style",
|
|
@@ -855,57 +637,32 @@ var Ke = [
|
|
|
855
637
|
"disabled",
|
|
856
638
|
"aria-label"
|
|
857
639
|
]),
|
|
858
|
-
c("div",
|
|
859
|
-
|
|
860
|
-
"
|
|
861
|
-
delay: 0,
|
|
862
|
-
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",
|
|
863
643
|
size: "md",
|
|
864
|
-
"left-icon":
|
|
865
|
-
"aria-label":
|
|
866
|
-
disabled: e.disabled || !
|
|
867
|
-
|
|
868
|
-
style: y(b.value),
|
|
869
|
-
onClick: r[1] ||= (e) => h.value && f("stop")
|
|
870
|
-
}, null, 8, [
|
|
871
|
-
"tooltip-text",
|
|
872
|
-
"variant",
|
|
873
|
-
"left-icon",
|
|
874
|
-
"aria-label",
|
|
875
|
-
"disabled",
|
|
876
|
-
"loading",
|
|
877
|
-
"style"
|
|
878
|
-
])) : (w(), a(J, {
|
|
879
|
-
key: 1,
|
|
880
|
-
type: h.value ? "button" : "submit",
|
|
881
|
-
variant: h.value ? "secondary" : "primary",
|
|
882
|
-
size: "md",
|
|
883
|
-
"left-icon": h.value ? "stop" : e.submitIcon,
|
|
884
|
-
"aria-label": h.value ? e.stopLabel : e.submitLabel,
|
|
885
|
-
disabled: e.disabled || !h.value && !_.value,
|
|
886
|
-
loading: g.value,
|
|
887
|
-
style: y(b.value),
|
|
888
|
-
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")
|
|
889
648
|
}, null, 8, [
|
|
890
649
|
"type",
|
|
891
650
|
"variant",
|
|
892
651
|
"left-icon",
|
|
893
652
|
"aria-label",
|
|
894
|
-
"disabled"
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
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)])
|
|
899
|
-
], 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));
|
|
900
657
|
}
|
|
901
|
-
}),
|
|
658
|
+
}), He = [
|
|
902
659
|
"ready",
|
|
903
660
|
"submitted",
|
|
904
661
|
"streaming",
|
|
905
662
|
"error"
|
|
906
|
-
],
|
|
663
|
+
], Ue = ["open"], X = /* @__PURE__ */ G(/* @__PURE__ */ d({
|
|
907
664
|
__name: "PvAccordion",
|
|
908
|
-
props: /* @__PURE__ */
|
|
665
|
+
props: /* @__PURE__ */ p({
|
|
909
666
|
chevronPosition: { default: "right" },
|
|
910
667
|
chevronVariant: { default: "vertical" },
|
|
911
668
|
defaultOpen: { type: Boolean },
|
|
@@ -931,69 +688,148 @@ var Ke = [
|
|
|
931
688
|
modelValue: { type: Boolean },
|
|
932
689
|
modelModifiers: {}
|
|
933
690
|
}),
|
|
934
|
-
emits: /* @__PURE__ */
|
|
691
|
+
emits: /* @__PURE__ */ p([
|
|
935
692
|
"summary-mouseenter",
|
|
936
693
|
"summary-mouseleave",
|
|
937
694
|
"summary-click"
|
|
938
695
|
], ["update:modelValue"]),
|
|
939
696
|
setup(e, { emit: n }) {
|
|
940
|
-
let r = e, l =
|
|
697
|
+
let r = e, l = A(e, "modelValue"), u = n;
|
|
941
698
|
r.defaultOpen !== void 0 && (l.value = r.defaultOpen);
|
|
942
699
|
let d = (e) => {
|
|
943
700
|
l.value = e.target.open;
|
|
944
701
|
}, f = (e) => {
|
|
945
702
|
e.detail !== 0 && (e.target?.closest("[data-pv-accordion-chevron]") || e.defaultPrevented || (e.preventDefault(), u("summary-click", e)));
|
|
946
|
-
}, p = i(() => r.toggleOnChevronOnly ? { click: f } : {}),
|
|
947
|
-
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", {
|
|
948
705
|
"data-testid": "pv-accordion",
|
|
949
706
|
class: "pv-accordion",
|
|
950
707
|
open: l.value,
|
|
951
708
|
onToggle: d
|
|
952
|
-
}, [c("summary",
|
|
709
|
+
}, [c("summary", m(e.summaryAttrs, {
|
|
953
710
|
class: ["pv-flex pv-space-between pv-relative", e.summaryClasses],
|
|
954
711
|
style: {
|
|
955
|
-
...
|
|
712
|
+
...h,
|
|
956
713
|
...e.summaryStyles
|
|
957
714
|
},
|
|
958
715
|
onMouseenter: r[0] ||= (e) => n.$emit("summary-mouseenter"),
|
|
959
716
|
onMouseleave: r[1] ||= (e) => n.$emit("summary-mouseleave")
|
|
960
|
-
},
|
|
961
|
-
|
|
962
|
-
e.chevronPosition === "left" ? (
|
|
717
|
+
}, D(p.value, !0)), [
|
|
718
|
+
T(n.$slots, "leading", {}, void 0, !0),
|
|
719
|
+
e.chevronPosition === "left" ? (S(), a(W, {
|
|
963
720
|
key: 0,
|
|
964
721
|
name: g.value,
|
|
965
722
|
"data-pv-accordion-chevron": ""
|
|
966
723
|
}, null, 8, ["name"])) : o("", !0),
|
|
967
|
-
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, {
|
|
968
725
|
key: 0,
|
|
969
726
|
value: e.counter,
|
|
970
727
|
variant: "secondary",
|
|
971
728
|
size: "sm"
|
|
972
729
|
}, null, 8, ["value"])) : o("", !0)], 64)),
|
|
973
|
-
e.chevronPosition === "right" ? (
|
|
730
|
+
e.chevronPosition === "right" ? (S(), a(W, {
|
|
974
731
|
key: 3,
|
|
975
732
|
name: g.value,
|
|
976
733
|
"data-pv-accordion-chevron": ""
|
|
977
734
|
}, null, 8, ["name"])) : o("", !0)
|
|
978
|
-
], 16), c("div", { style:
|
|
735
|
+
], 16), c("div", { style: _(e.contentStyles) }, [T(n.$slots, "default", {}, void 0, !0)], 4)], 40, Ue));
|
|
979
736
|
}
|
|
980
|
-
}), [["__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 = {
|
|
981
817
|
key: 0,
|
|
982
818
|
class: "pv-step-marker",
|
|
983
819
|
"aria-hidden": "true"
|
|
984
|
-
},
|
|
820
|
+
}, Qe = {
|
|
985
821
|
key: 1,
|
|
986
822
|
class: "pv-step-dot"
|
|
987
|
-
},
|
|
823
|
+
}, $e = { class: "pv-step-body pv-flow-8" }, et = {
|
|
988
824
|
key: 0,
|
|
989
825
|
class: "pv-step-aside pv-text-body-md pv-text-tertiary"
|
|
990
|
-
},
|
|
826
|
+
}, tt = {
|
|
991
827
|
key: 0,
|
|
992
828
|
class: "pv-tag-highlight"
|
|
993
|
-
},
|
|
829
|
+
}, nt = {
|
|
994
830
|
key: 0,
|
|
995
831
|
class: "pv-text-body-md pv-text-tertiary"
|
|
996
|
-
},
|
|
832
|
+
}, rt = {
|
|
997
833
|
key: 1,
|
|
998
834
|
class: "pv-flex",
|
|
999
835
|
role: "list",
|
|
@@ -1001,7 +837,7 @@ var Ke = [
|
|
|
1001
837
|
"--flex-wrap": "wrap",
|
|
1002
838
|
"--flex-gap": "4px"
|
|
1003
839
|
}
|
|
1004
|
-
},
|
|
840
|
+
}, it = {
|
|
1005
841
|
key: 2,
|
|
1006
842
|
class: "pv-text-body-md pv-text-medium pv-text-brand"
|
|
1007
843
|
}, Q = /* @__PURE__ */ d({
|
|
@@ -1024,46 +860,46 @@ var Ke = [
|
|
|
1024
860
|
function d(e, t) {
|
|
1025
861
|
return u(e, t) === "active" ? "pv-text-medium pv-text-default" : "pv-text-quaternary";
|
|
1026
862
|
}
|
|
1027
|
-
return (n, i) => (
|
|
863
|
+
return (n, i) => (S(), a(r, {
|
|
1028
864
|
tag: "ol",
|
|
1029
865
|
name: "pv-step",
|
|
1030
866
|
class: "pv-step-list",
|
|
1031
867
|
role: "list"
|
|
1032
868
|
}, {
|
|
1033
|
-
default:
|
|
869
|
+
default: F(() => [(S(!0), s(t, null, w(e.steps, (e, n) => (S(), s("li", {
|
|
1034
870
|
key: e.id ?? n,
|
|
1035
871
|
class: "pv-step",
|
|
1036
872
|
"data-status": u(e, n)
|
|
1037
|
-
}, [e.variant === "aside" ? o("", !0) : (
|
|
873
|
+
}, [e.variant === "aside" ? o("", !0) : (S(), s("span", Ze, [e.icon ? (S(), a(W, {
|
|
1038
874
|
key: 0,
|
|
1039
875
|
name: e.icon,
|
|
1040
876
|
size: 12
|
|
1041
|
-
}, 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 }, [
|
|
1042
878
|
c("p", {
|
|
1043
|
-
class:
|
|
879
|
+
class: g(["pv-flex pv-text-body-md", d(e, n)]),
|
|
1044
880
|
style: { "--flex-wrap": "wrap" }
|
|
1045
|
-
}, [c("span", { class:
|
|
1046
|
-
e.note ? (
|
|
1047
|
-
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", {
|
|
1048
884
|
key: t,
|
|
1049
|
-
class:
|
|
885
|
+
class: g(["pv-tag-secondary", { "pv-text-quaternary": e.variant === "muted" }]),
|
|
1050
886
|
"data-style": "rounded"
|
|
1051
|
-
},
|
|
1052
|
-
e.outcome ? (
|
|
1053
|
-
], 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))]),
|
|
1054
890
|
_: 1
|
|
1055
891
|
}));
|
|
1056
892
|
}
|
|
1057
|
-
}),
|
|
893
|
+
}), at = {
|
|
1058
894
|
class: "pv-reasoning-trigger pv-flex pv-text-body-md pv-text-medium",
|
|
1059
895
|
"aria-live": "polite"
|
|
1060
|
-
},
|
|
896
|
+
}, ot = { class: "pv-reasoning-content pv-text-body-md pv-text-tertiary" }, st = {
|
|
1061
897
|
key: 1,
|
|
1062
898
|
class: "pv-reasoning-trigger pv-reasoning-standalone pv-flex pv-text-body-md pv-text-medium pv-text-tertiary",
|
|
1063
899
|
"aria-live": "polite"
|
|
1064
|
-
},
|
|
900
|
+
}, ct = /* @__PURE__ */ d({
|
|
1065
901
|
__name: "PvReasoning",
|
|
1066
|
-
props: /* @__PURE__ */
|
|
902
|
+
props: /* @__PURE__ */ p({
|
|
1067
903
|
autoCloseDelay: { default: 1e3 },
|
|
1068
904
|
completedLabel: { default: "Reasoning" },
|
|
1069
905
|
defaultOpen: {
|
|
@@ -1086,36 +922,36 @@ var Ke = [
|
|
|
1086
922
|
}),
|
|
1087
923
|
emits: ["update:open"],
|
|
1088
924
|
setup(r) {
|
|
1089
|
-
let l = r, d =
|
|
925
|
+
let l = r, d = A(r, "open"), p = C(), m = C(), h = C(!1), _;
|
|
1090
926
|
(l.defaultOpen || l.isStreaming) && (d.value = !0), l.isStreaming && (m.value = Date.now());
|
|
1091
|
-
let
|
|
927
|
+
let y = i(() => l.duration ?? p.value), b = i(() => {
|
|
1092
928
|
if (l.isStreaming) return l.streamingLabel;
|
|
1093
|
-
if (
|
|
1094
|
-
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));
|
|
1095
931
|
return `Thought for ${e} ${e === 1 ? "second" : "seconds"}`;
|
|
1096
|
-
}), x =
|
|
1097
|
-
function
|
|
1098
|
-
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);
|
|
1099
935
|
}
|
|
1100
|
-
function
|
|
1101
|
-
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?.({}) ?? []);
|
|
1102
938
|
}
|
|
1103
|
-
function
|
|
1104
|
-
|
|
939
|
+
function I() {
|
|
940
|
+
_ !== void 0 && (clearTimeout(_), _ = void 0);
|
|
1105
941
|
}
|
|
1106
|
-
function
|
|
942
|
+
function L(e) {
|
|
1107
943
|
let t = e.target?.closest?.("summary");
|
|
1108
|
-
!t || t.parentElement !== e.currentTarget || (h.value = !0,
|
|
944
|
+
!t || t.parentElement !== e.currentTarget || (h.value = !0, I());
|
|
1109
945
|
}
|
|
1110
|
-
return
|
|
1111
|
-
if (
|
|
946
|
+
return P(() => l.isStreaming, (e, t) => {
|
|
947
|
+
if (I(), e) {
|
|
1112
948
|
m.value = Date.now(), p.value = void 0, h.value = !1, d.value = !0;
|
|
1113
949
|
return;
|
|
1114
950
|
}
|
|
1115
|
-
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(() => {
|
|
1116
952
|
h.value || (d.value = !1);
|
|
1117
953
|
}, l.autoCloseDelay)));
|
|
1118
|
-
}),
|
|
954
|
+
}), v(I), (e, t) => N() ? (S(), a(X, {
|
|
1119
955
|
key: 0,
|
|
1120
956
|
modelValue: d.value,
|
|
1121
957
|
"onUpdate:modelValue": t[0] ||= (e) => d.value = e,
|
|
@@ -1127,31 +963,31 @@ var Ke = [
|
|
|
1127
963
|
"enable-trigger-slot": "",
|
|
1128
964
|
"summary-classes": { "pv-text-tertiary": !0 },
|
|
1129
965
|
"summary-styles": { justifyContent: "flex-start" },
|
|
1130
|
-
onClick:
|
|
966
|
+
onClick: L
|
|
1131
967
|
}, {
|
|
1132
|
-
trigger:
|
|
1133
|
-
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, {
|
|
1134
970
|
key: 0,
|
|
1135
971
|
steps: r.steps,
|
|
1136
972
|
"in-progress": r.isStreaming
|
|
1137
|
-
}, null, 8, ["steps", "in-progress"])) : o("", !0),
|
|
973
|
+
}, null, 8, ["steps", "in-progress"])) : o("", !0), T(e.$slots, "default")])]),
|
|
1138
974
|
_: 3
|
|
1139
|
-
}, 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)])]));
|
|
1140
976
|
}
|
|
1141
|
-
}),
|
|
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" }, $ = {
|
|
1142
978
|
key: 0,
|
|
1143
979
|
class: "pv-flow-8"
|
|
1144
|
-
},
|
|
980
|
+
}, pt = { class: "pv-surface-accent pv-inset-square-12 pv-radius-sm pv-text-body-xs" }, mt = {
|
|
1145
981
|
key: 1,
|
|
1146
982
|
class: "pv-flow-8",
|
|
1147
983
|
role: "alert",
|
|
1148
984
|
"aria-label": "Tool error"
|
|
1149
|
-
},
|
|
985
|
+
}, ht = { class: "pv-surface-critical pv-inset-square-12 pv-radius-sm pv-text-body-xs pv-text-critical" }, gt = {
|
|
1150
986
|
key: 2,
|
|
1151
987
|
class: "pv-flow-8"
|
|
1152
|
-
},
|
|
988
|
+
}, _t = { class: "pv-surface-accent pv-inset-square-12 pv-radius-sm pv-text-body-xs" }, vt = /* @__PURE__ */ d({
|
|
1153
989
|
__name: "PvTool",
|
|
1154
|
-
props: /* @__PURE__ */
|
|
990
|
+
props: /* @__PURE__ */ p({
|
|
1155
991
|
defaultOpen: {
|
|
1156
992
|
type: Boolean,
|
|
1157
993
|
default: !1
|
|
@@ -1184,7 +1020,7 @@ var Ke = [
|
|
|
1184
1020
|
}),
|
|
1185
1021
|
emits: ["update:open"],
|
|
1186
1022
|
setup(e) {
|
|
1187
|
-
let t = e, n =
|
|
1023
|
+
let t = e, n = A(e, "open"), r = ["output-available", "output-error"];
|
|
1188
1024
|
(t.defaultOpen || r.includes(t.state)) && (n.value = !0);
|
|
1189
1025
|
let l = i(() => ({
|
|
1190
1026
|
"input-streaming": {
|
|
@@ -1224,9 +1060,9 @@ var Ke = [
|
|
|
1224
1060
|
return String(e);
|
|
1225
1061
|
}
|
|
1226
1062
|
}
|
|
1227
|
-
return
|
|
1063
|
+
return P(() => t.state, (e, t) => {
|
|
1228
1064
|
e !== t && r.includes(e) && (n.value = !0);
|
|
1229
|
-
}), (t, r) => (
|
|
1065
|
+
}), (t, r) => (S(), a(X, {
|
|
1230
1066
|
modelValue: n.value,
|
|
1231
1067
|
"onUpdate:modelValue": r[0] ||= (e) => n.value = e,
|
|
1232
1068
|
"default-open": n.value,
|
|
@@ -1237,22 +1073,22 @@ var Ke = [
|
|
|
1237
1073
|
"enable-trigger-slot": "",
|
|
1238
1074
|
"summary-classes": { "pv-inset-square-12": !0 }
|
|
1239
1075
|
}, {
|
|
1240
|
-
trigger:
|
|
1076
|
+
trigger: F(() => [c("span", lt, [
|
|
1241
1077
|
u(W, {
|
|
1242
1078
|
name: "settings",
|
|
1243
1079
|
size: 20
|
|
1244
1080
|
}),
|
|
1245
|
-
c("span",
|
|
1081
|
+
c("span", ut, E(e.toolName), 1),
|
|
1246
1082
|
c("span", {
|
|
1247
|
-
class:
|
|
1083
|
+
class: g([l.value.className, "pv-tag-sm"]),
|
|
1248
1084
|
role: "status"
|
|
1249
|
-
},
|
|
1085
|
+
}, E(l.value.label), 3)
|
|
1250
1086
|
])]),
|
|
1251
|
-
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)])])]),
|
|
1252
1088
|
_: 3
|
|
1253
1089
|
}, 8, ["modelValue", "default-open"]));
|
|
1254
1090
|
}
|
|
1255
|
-
}),
|
|
1091
|
+
}), yt = [
|
|
1256
1092
|
"input-streaming",
|
|
1257
1093
|
"input-available",
|
|
1258
1094
|
"approval-requested",
|
|
@@ -1263,8 +1099,8 @@ var Ke = [
|
|
|
1263
1099
|
];
|
|
1264
1100
|
//#endregion
|
|
1265
1101
|
//#region src/components/ai/useStickToBottom.ts
|
|
1266
|
-
function
|
|
1267
|
-
let n = t.threshold ?? 32, r =
|
|
1102
|
+
function bt(e, t = {}) {
|
|
1103
|
+
let n = t.threshold ?? 32, r = C(!0);
|
|
1268
1104
|
function i() {
|
|
1269
1105
|
let t = e.value;
|
|
1270
1106
|
t && (r.value = t.scrollHeight - t.scrollTop - t.clientHeight <= n);
|
|
@@ -1295,14 +1131,14 @@ function Nt(e, t = {}) {
|
|
|
1295
1131
|
e.removeEventListener("scroll", t), s.forEach((e) => e.disconnect());
|
|
1296
1132
|
};
|
|
1297
1133
|
}
|
|
1298
|
-
return
|
|
1134
|
+
return P(e, (e) => {
|
|
1299
1135
|
o?.(), o = void 0, e && s(e);
|
|
1300
|
-
}, { immediate: !0 }),
|
|
1136
|
+
}, { immediate: !0 }), x(() => o?.()), {
|
|
1301
1137
|
isAtBottom: r,
|
|
1302
1138
|
scrollToBottom: a
|
|
1303
1139
|
};
|
|
1304
1140
|
}
|
|
1305
1141
|
//#endregion
|
|
1306
|
-
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 };
|
|
1307
1143
|
|
|
1308
1144
|
//# sourceMappingURL=pv-components-ai.mjs.map
|