@inkeep/cxkit-primitives 0.5.90 → 0.5.92
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/dist/atoms/dialog.cjs +1 -1
- package/dist/atoms/dialog.js +78 -68
- package/dist/atoms/portal.cjs +1 -1
- package/dist/atoms/select.cjs +1 -0
- package/dist/atoms/select.js +787 -0
- package/dist/atoms/shadow/context.cjs +1 -2
- package/dist/atoms/shadow/context.js +16 -17
- package/dist/atoms/shadow/create.cjs +1 -1
- package/dist/components/embedded-chat.cjs +4 -4
- package/dist/components/embedded-chat.js +895 -895
- package/dist/components/intelligent-form.cjs +1 -1
- package/dist/components/intelligent-form.js +282 -282
- package/dist/index.d.cts +266 -3
- package/dist/index.d.ts +266 -3
- package/dist/providers/base-events-provider.cjs +1 -1
- package/dist/providers/base-events-provider.js +1 -1
- package/dist/providers/theme-provider.cjs +3 -1
- package/dist/providers/theme-provider.js +43 -32
- package/package.json +9 -5
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
3
|
import { ikp as t } from "./factory.js";
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import * as
|
|
4
|
+
import { forwardRef as v, useRef as f, useEffect as h } from "react";
|
|
5
|
+
import y from "react-textarea-autosize";
|
|
6
|
+
import { Trigger as A, Icon as L, Content as V, Viewport as H, Item as E, ItemText as D, ItemIndicator as N, Root as q, Value as M } from "../atoms/select.js";
|
|
7
|
+
import * as w from "@radix-ui/react-checkbox";
|
|
8
8
|
import { useIntelligentForm as s } from "./intelligent-form/intelligent-form-provider.js";
|
|
9
|
-
import { IntelligentFormProvider as
|
|
10
|
-
import * as
|
|
11
|
-
import { BuiltInIconRenderer as
|
|
12
|
-
import { maybeRender as
|
|
13
|
-
import { Controller as
|
|
14
|
-
import { IntelligentFormFieldProvider as
|
|
15
|
-
import { CheckboxIcon as
|
|
16
|
-
import { useInkeepConfig as
|
|
17
|
-
import { SourceItemProvider as
|
|
18
|
-
import { LinkWithQueryParams as
|
|
19
|
-
import { Markdown as
|
|
20
|
-
import { useComposedRefs as
|
|
9
|
+
import { IntelligentFormProvider as ji } from "./intelligent-form/intelligent-form-provider.js";
|
|
10
|
+
import * as p from "@radix-ui/react-scroll-area";
|
|
11
|
+
import { BuiltInIconRenderer as g } from "../atoms/icons/built-in-icon-renderer.js";
|
|
12
|
+
import { maybeRender as C, dataAttr as a } from "../utils/misc.js";
|
|
13
|
+
import { Controller as z } from "react-hook-form";
|
|
14
|
+
import { IntelligentFormFieldProvider as O, useIntelligentFormField as u } from "../providers/intelligent-form-field-provider.js";
|
|
15
|
+
import { CheckboxIcon as U } from "../atoms/icons/checkbox-icon.js";
|
|
16
|
+
import { useInkeepConfig as R } from "../providers/config-provider.js";
|
|
17
|
+
import { SourceItemProvider as j, useSourceItem as x } from "../providers/source-item-provider.js";
|
|
18
|
+
import { LinkWithQueryParams as Q } from "../atoms/link.js";
|
|
19
|
+
import { Markdown as W } from "../atoms/markdown/index.js";
|
|
20
|
+
import { useComposedRefs as I } from "../utils/compose-refs.js";
|
|
21
21
|
import { composeEventHandlers as F } from "../utils/compose-event-handlers.js";
|
|
22
|
-
import { transformInkeepSource as
|
|
23
|
-
const
|
|
22
|
+
import { transformInkeepSource as $ } from "../utils/transform-source/index.js";
|
|
23
|
+
const G = t("form", {
|
|
24
24
|
_id: "intelligentForm__Root"
|
|
25
|
-
}),
|
|
25
|
+
}), Ue = (i) => {
|
|
26
26
|
const { onSubmit: e, ...n } = i, { handleSubmit: r } = s();
|
|
27
|
-
return /* @__PURE__ */ o(
|
|
28
|
-
},
|
|
27
|
+
return /* @__PURE__ */ o(G, { onSubmit: F(e, r), ...n });
|
|
28
|
+
}, je = t("h2", {
|
|
29
29
|
_id: "intelligentForm__Heading",
|
|
30
30
|
children: "Contact Support"
|
|
31
|
-
}),
|
|
31
|
+
}), Qe = t("div", {
|
|
32
32
|
_id: "intelligentForm__Content"
|
|
33
|
-
}),
|
|
33
|
+
}), We = t(p.Root, {
|
|
34
34
|
_id: "intelligentForm__Content__ScrollArea"
|
|
35
|
-
}),
|
|
35
|
+
}), J = t(p.Viewport, {
|
|
36
36
|
_id: "intelligentForm__Content__ScrollAreaViewport"
|
|
37
|
-
}),
|
|
37
|
+
}), $e = (i) => {
|
|
38
38
|
const { children: e, ...n } = i;
|
|
39
39
|
return /* @__PURE__ */ o(
|
|
40
|
-
|
|
40
|
+
J,
|
|
41
41
|
{
|
|
42
42
|
children: (
|
|
43
43
|
/* added this to fix an overflow issue see https://github.com/radix-ui/primitives/issues/926 */
|
|
@@ -46,86 +46,86 @@ const M = t("form", {
|
|
|
46
46
|
...n
|
|
47
47
|
}
|
|
48
48
|
);
|
|
49
|
-
},
|
|
50
|
-
|
|
49
|
+
}, Ge = t(
|
|
50
|
+
p.ScrollAreaScrollbar,
|
|
51
51
|
{
|
|
52
52
|
_id: "intelligentForm__Content__ScrollAreaScrollbar"
|
|
53
53
|
}
|
|
54
|
-
),
|
|
55
|
-
|
|
54
|
+
), Je = t(
|
|
55
|
+
p.ScrollAreaThumb,
|
|
56
56
|
{
|
|
57
57
|
_id: "intelligentForm__Content__ScrollAreaThumb"
|
|
58
58
|
}
|
|
59
|
-
),
|
|
59
|
+
), Ke = t(p.Corner, {
|
|
60
60
|
_id: "intelligentForm__Content__ScrollAreaCorner"
|
|
61
|
-
}),
|
|
61
|
+
}), K = t("div", {
|
|
62
62
|
_id: "intelligentForm__Success"
|
|
63
|
-
}),
|
|
63
|
+
}), Xe = (i) => {
|
|
64
64
|
const { children: e, ...n } = i, { isSubmitSuccessful: r } = s();
|
|
65
|
-
return r ? /* @__PURE__ */ o(
|
|
66
|
-
},
|
|
65
|
+
return r ? /* @__PURE__ */ o(K, { ...n, children: e }) : null;
|
|
66
|
+
}, X = t(g, {
|
|
67
67
|
_id: "intelligentForm__SuccessIcon"
|
|
68
|
-
}),
|
|
68
|
+
}), Ye = (i) => {
|
|
69
69
|
const {
|
|
70
70
|
formSettings: { successView: e }
|
|
71
71
|
} = s();
|
|
72
72
|
return /* @__PURE__ */ o(
|
|
73
|
-
|
|
73
|
+
X,
|
|
74
74
|
{
|
|
75
75
|
iconSettings: e.icon ?? { builtIn: "LuCircleCheck" },
|
|
76
76
|
...i
|
|
77
77
|
}
|
|
78
78
|
);
|
|
79
|
-
},
|
|
79
|
+
}, Y = t("h2", {
|
|
80
80
|
_id: "intelligentForm__SuccessHeading"
|
|
81
|
-
}),
|
|
81
|
+
}), Ze = (i) => {
|
|
82
82
|
const {
|
|
83
83
|
formSettings: { successView: e }
|
|
84
84
|
} = s();
|
|
85
|
-
return /* @__PURE__ */ o(
|
|
86
|
-
},
|
|
85
|
+
return /* @__PURE__ */ o(Y, { children: e.heading, ...i });
|
|
86
|
+
}, Z = t("p", {
|
|
87
87
|
_id: "intelligentForm__SuccessMessage"
|
|
88
|
-
}),
|
|
88
|
+
}), ei = (i) => {
|
|
89
89
|
const {
|
|
90
90
|
formSettings: { successView: e }
|
|
91
91
|
} = s();
|
|
92
|
-
return /* @__PURE__ */ o(
|
|
93
|
-
},
|
|
92
|
+
return /* @__PURE__ */ o(Z, { children: e.message, ...i });
|
|
93
|
+
}, ii = t("div", {
|
|
94
94
|
_id: "intelligentForm__PrimaryForm"
|
|
95
|
-
}),
|
|
95
|
+
}), ee = t("div", {
|
|
96
96
|
_id: "intelligentForm__PrimaryFormFields"
|
|
97
|
-
}),
|
|
97
|
+
}), ie = t("p", {
|
|
98
98
|
_id: "intelligentForm__PrimaryForm__Description"
|
|
99
|
-
}),
|
|
99
|
+
}), ti = (i) => {
|
|
100
100
|
const {
|
|
101
101
|
formSettings: { primary: e }
|
|
102
102
|
} = s();
|
|
103
|
-
return e.description ? /* @__PURE__ */ o(
|
|
104
|
-
},
|
|
103
|
+
return e.description ? /* @__PURE__ */ o(ie, { children: e.description, ...i }) : null;
|
|
104
|
+
}, ni = (i) => {
|
|
105
105
|
const { children: e, ...n } = i, {
|
|
106
106
|
formSettings: { primary: r }
|
|
107
107
|
} = s();
|
|
108
|
-
return /* @__PURE__ */ o(
|
|
109
|
-
},
|
|
108
|
+
return /* @__PURE__ */ o(ee, { children: C(e, r.fields), ...n });
|
|
109
|
+
}, te = t("button", {
|
|
110
110
|
_id: "intelligentForm__PrimaryFormSubmit",
|
|
111
111
|
type: "button",
|
|
112
112
|
children: "Next"
|
|
113
|
-
}),
|
|
113
|
+
}), ri = (i) => {
|
|
114
114
|
const { onClick: e, ...n } = i, { submittedPrimaryForm: r, handleSubmitPrimaryForm: l } = s();
|
|
115
115
|
return /* @__PURE__ */ o(
|
|
116
|
-
|
|
116
|
+
te,
|
|
117
117
|
{
|
|
118
118
|
"data-submitted": a(r),
|
|
119
119
|
onClick: F(e, l),
|
|
120
120
|
...n
|
|
121
121
|
}
|
|
122
122
|
);
|
|
123
|
-
},
|
|
123
|
+
}, ne = t("div", {
|
|
124
124
|
_id: "intelligentForm__Field"
|
|
125
|
-
}),
|
|
125
|
+
}), oi = (i) => {
|
|
126
126
|
const { field: e, autoFocus: n, ...r } = i, { control: l, errors: c } = s();
|
|
127
127
|
return /* @__PURE__ */ o(
|
|
128
|
-
|
|
128
|
+
z,
|
|
129
129
|
{
|
|
130
130
|
name: e.name,
|
|
131
131
|
control: l,
|
|
@@ -135,14 +135,14 @@ const M = t("form", {
|
|
|
135
135
|
render: ({ field: m }) => {
|
|
136
136
|
const d = m.value !== void 0 || e.inputType === "file";
|
|
137
137
|
return /* @__PURE__ */ o(
|
|
138
|
-
|
|
138
|
+
O,
|
|
139
139
|
{
|
|
140
140
|
"data-invalid": a(!!c[e.name]),
|
|
141
141
|
field: e,
|
|
142
142
|
fieldProps: m,
|
|
143
143
|
autoFocus: n,
|
|
144
144
|
children: d && /* @__PURE__ */ o(
|
|
145
|
-
|
|
145
|
+
ne,
|
|
146
146
|
{
|
|
147
147
|
"data-input-type": e.inputType,
|
|
148
148
|
"data-hidden": a(e.isHidden),
|
|
@@ -154,12 +154,12 @@ const M = t("form", {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
);
|
|
157
|
-
},
|
|
157
|
+
}, re = t("label", {
|
|
158
158
|
_id: "intelligentForm__FieldLabel"
|
|
159
|
-
}),
|
|
160
|
-
const { field: e } =
|
|
159
|
+
}), li = (i) => {
|
|
160
|
+
const { field: e } = u();
|
|
161
161
|
return /* @__PURE__ */ o(
|
|
162
|
-
|
|
162
|
+
re,
|
|
163
163
|
{
|
|
164
164
|
"data-required": a(e.isRequired),
|
|
165
165
|
htmlFor: e.name,
|
|
@@ -167,10 +167,10 @@ const M = t("form", {
|
|
|
167
167
|
...i
|
|
168
168
|
}
|
|
169
169
|
);
|
|
170
|
-
},
|
|
170
|
+
}, oe = t("input", {
|
|
171
171
|
_id: "intelligentForm__FieldText",
|
|
172
172
|
type: "text"
|
|
173
|
-
}),
|
|
173
|
+
}), T = v((i, e) => {
|
|
174
174
|
const {
|
|
175
175
|
field: n,
|
|
176
176
|
error: r,
|
|
@@ -180,71 +180,71 @@ const M = t("form", {
|
|
|
180
180
|
ref: m,
|
|
181
181
|
...d
|
|
182
182
|
},
|
|
183
|
-
autoFocus:
|
|
184
|
-
} =
|
|
183
|
+
autoFocus: S
|
|
184
|
+
} = u(), _ = I(
|
|
185
185
|
e,
|
|
186
186
|
m
|
|
187
187
|
);
|
|
188
188
|
return /* @__PURE__ */ o(
|
|
189
|
-
|
|
189
|
+
oe,
|
|
190
190
|
{
|
|
191
191
|
asChild: n.inputType === "textarea",
|
|
192
|
-
ref:
|
|
192
|
+
ref: _,
|
|
193
193
|
id: n.name,
|
|
194
|
-
autoFocus:
|
|
194
|
+
autoFocus: S,
|
|
195
195
|
placeholder: "placeholder" in n ? n.placeholder : void 0,
|
|
196
196
|
"data-invalid": a(!!r),
|
|
197
197
|
onChange: F(i.onChange, l),
|
|
198
198
|
onBlur: F(i.onBlur, c),
|
|
199
199
|
...d,
|
|
200
200
|
...i,
|
|
201
|
-
children: n.inputType === "textarea" ? /* @__PURE__ */ o(
|
|
201
|
+
children: n.inputType === "textarea" ? /* @__PURE__ */ o(y, { minRows: 3, maxRows: 10 }) : null
|
|
202
202
|
}
|
|
203
203
|
);
|
|
204
|
-
}),
|
|
204
|
+
}), si = t(T, {
|
|
205
205
|
_id: "intelligentForm__FieldEmail",
|
|
206
206
|
type: "email"
|
|
207
|
-
}),
|
|
207
|
+
}), le = t("input", {
|
|
208
208
|
_id: "intelligentForm__FieldFile",
|
|
209
209
|
type: "file",
|
|
210
210
|
multiple: !0
|
|
211
|
-
}),
|
|
211
|
+
}), ci = (i) => {
|
|
212
212
|
const {
|
|
213
213
|
field: e,
|
|
214
214
|
error: n,
|
|
215
215
|
fieldProps: { value: r, onChange: l, onBlur: c, ...m },
|
|
216
216
|
autoFocus: d
|
|
217
|
-
} =
|
|
218
|
-
const
|
|
219
|
-
l(
|
|
217
|
+
} = u(), { onChange: S, onBlur: _, ...b } = i, P = (k) => {
|
|
218
|
+
const B = k.target.files;
|
|
219
|
+
l(B);
|
|
220
220
|
};
|
|
221
221
|
return /* @__PURE__ */ o(
|
|
222
|
-
|
|
222
|
+
le,
|
|
223
223
|
{
|
|
224
224
|
id: e.name,
|
|
225
225
|
autoFocus: d,
|
|
226
226
|
"data-value": r,
|
|
227
227
|
"data-invalid": a(!!n),
|
|
228
|
-
...
|
|
228
|
+
...b,
|
|
229
229
|
...m,
|
|
230
|
-
onChange: F(
|
|
231
|
-
onBlur: F(
|
|
230
|
+
onChange: F(S, P),
|
|
231
|
+
onBlur: F(_, c)
|
|
232
232
|
}
|
|
233
233
|
);
|
|
234
|
-
},
|
|
235
|
-
|
|
234
|
+
}, mi = t(
|
|
235
|
+
T,
|
|
236
236
|
{
|
|
237
237
|
_id: "intelligentForm__FieldTextArea",
|
|
238
238
|
type: "textarea",
|
|
239
239
|
asChild: !0,
|
|
240
|
-
children: /* @__PURE__ */ o(
|
|
240
|
+
children: /* @__PURE__ */ o(y, { rows: 1, maxRows: 8 })
|
|
241
241
|
}
|
|
242
|
-
),
|
|
242
|
+
), se = t(w.Root, {
|
|
243
243
|
_id: "intelligentForm__FieldCheckbox"
|
|
244
|
-
}),
|
|
245
|
-
const { field: e, error: n, fieldProps: r, autoFocus: l } =
|
|
244
|
+
}), di = (i) => {
|
|
245
|
+
const { field: e, error: n, fieldProps: r, autoFocus: l } = u(), { onCheckedChange: c, ...m } = i;
|
|
246
246
|
return /* @__PURE__ */ o(
|
|
247
|
-
|
|
247
|
+
se,
|
|
248
248
|
{
|
|
249
249
|
id: e.name,
|
|
250
250
|
name: e.name,
|
|
@@ -255,15 +255,15 @@ const M = t("form", {
|
|
|
255
255
|
...m
|
|
256
256
|
}
|
|
257
257
|
);
|
|
258
|
-
},
|
|
258
|
+
}, ai = t(w.Indicator, {
|
|
259
259
|
_id: "intelligentForm__FieldCheckboxIndicator",
|
|
260
|
-
children: /* @__PURE__ */ o(
|
|
261
|
-
}),
|
|
260
|
+
children: /* @__PURE__ */ o(U, {})
|
|
261
|
+
}), ce = t(q, {
|
|
262
262
|
_id: "intelligentForm__FieldSelect"
|
|
263
|
-
}),
|
|
264
|
-
const { field: e, error: n, fieldProps: r } =
|
|
263
|
+
}), Fi = (i) => {
|
|
264
|
+
const { field: e, error: n, fieldProps: r } = u(), { onValueChange: l, ...c } = i;
|
|
265
265
|
return /* @__PURE__ */ o(
|
|
266
|
-
|
|
266
|
+
ce,
|
|
267
267
|
{
|
|
268
268
|
name: e.name,
|
|
269
269
|
"data-invalid": a(!!n),
|
|
@@ -272,118 +272,118 @@ const M = t("form", {
|
|
|
272
272
|
...c
|
|
273
273
|
}
|
|
274
274
|
);
|
|
275
|
-
},
|
|
275
|
+
}, ui = t(A, {
|
|
276
276
|
_id: "intelligentForm__FieldSelect__Trigger"
|
|
277
|
-
}),
|
|
277
|
+
}), me = t(M, {
|
|
278
278
|
_id: "intelligentForm__FieldSelect__Value"
|
|
279
|
-
}),
|
|
280
|
-
const { field: e } =
|
|
279
|
+
}), _i = (i) => {
|
|
280
|
+
const { field: e } = u();
|
|
281
281
|
return /* @__PURE__ */ o(
|
|
282
|
-
|
|
282
|
+
me,
|
|
283
283
|
{
|
|
284
284
|
placeholder: "placeholder" in e ? e.placeholder : void 0,
|
|
285
285
|
...i
|
|
286
286
|
}
|
|
287
287
|
);
|
|
288
|
-
},
|
|
288
|
+
}, gi = t(L, {
|
|
289
289
|
_id: "intelligentForm__FieldSelect__Icon",
|
|
290
290
|
asChild: !0,
|
|
291
|
-
children: /* @__PURE__ */ o(
|
|
292
|
-
}),
|
|
291
|
+
children: /* @__PURE__ */ o(g, { iconSettings: { builtIn: "LuChevronDown" } })
|
|
292
|
+
}), Si = t(V, {
|
|
293
293
|
_id: "intelligentForm__FieldSelect__Content",
|
|
294
294
|
position: "popper"
|
|
295
|
-
}),
|
|
295
|
+
}), pi = t(H, {
|
|
296
296
|
_id: "intelligentForm__FieldSelect__Viewport"
|
|
297
|
-
}),
|
|
297
|
+
}), vi = t(E, {
|
|
298
298
|
_id: "intelligentForm__FieldSelect__Item"
|
|
299
|
-
}),
|
|
299
|
+
}), Ii = t(D, {
|
|
300
300
|
_id: "intelligentForm__FieldSelect__ItemText"
|
|
301
|
-
}),
|
|
302
|
-
|
|
301
|
+
}), Pi = t(
|
|
302
|
+
N,
|
|
303
303
|
{
|
|
304
304
|
_id: "intelligentForm__FieldSelect__ItemIndicator",
|
|
305
305
|
asChild: !0,
|
|
306
|
-
children: /* @__PURE__ */ o(
|
|
306
|
+
children: /* @__PURE__ */ o(g, { iconSettings: { builtIn: "LuCheck" } })
|
|
307
307
|
}
|
|
308
|
-
),
|
|
308
|
+
), de = t("span", {
|
|
309
309
|
_id: "intelligentForm__FieldError"
|
|
310
|
-
}),
|
|
311
|
-
const { error: e } =
|
|
312
|
-
return e ? /* @__PURE__ */ o(
|
|
313
|
-
},
|
|
310
|
+
}), fi = (i) => {
|
|
311
|
+
const { error: e } = u();
|
|
312
|
+
return e ? /* @__PURE__ */ o(de, { children: e.message?.toString(), ...i }) : null;
|
|
313
|
+
}, hi = t("div", {
|
|
314
314
|
_id: "intelligentForm__BotHeading"
|
|
315
|
-
}),
|
|
315
|
+
}), Ci = t(g, {
|
|
316
316
|
_id: "intelligentForm__BotHeading__Icon",
|
|
317
317
|
iconSettings: { builtIn: "LuSparkles" }
|
|
318
|
-
}),
|
|
318
|
+
}), ae = t("div", {
|
|
319
319
|
_id: "intelligentForm__BotHeading__Name"
|
|
320
|
-
}),
|
|
321
|
-
const { baseSettings: e } =
|
|
320
|
+
}), bi = (i) => {
|
|
321
|
+
const { baseSettings: e } = R(), { organizationDisplayName: n } = e ?? {}, {
|
|
322
322
|
formSettings: { aiAssistantName: r }
|
|
323
323
|
} = s();
|
|
324
|
-
return /* @__PURE__ */ o(
|
|
325
|
-
},
|
|
324
|
+
return /* @__PURE__ */ o(ae, { children: r ?? n, ...i });
|
|
325
|
+
}, Fe = t("div", {
|
|
326
326
|
_id: "intelligentForm__Loading"
|
|
327
|
-
}),
|
|
328
|
-
const { loading: n } = s(), r =
|
|
329
|
-
return
|
|
327
|
+
}), yi = v(({ ...i }, e) => {
|
|
328
|
+
const { loading: n } = s(), r = f(null), l = I(e, r);
|
|
329
|
+
return h(() => {
|
|
330
330
|
n && r.current && r.current.scrollIntoView({
|
|
331
331
|
behavior: "smooth",
|
|
332
332
|
block: "nearest",
|
|
333
333
|
inline: "nearest"
|
|
334
334
|
});
|
|
335
|
-
}, [n]), n ? /* @__PURE__ */ o(
|
|
336
|
-
}),
|
|
335
|
+
}, [n]), n ? /* @__PURE__ */ o(Fe, { ref: l, ...i }) : null;
|
|
336
|
+
}), ue = t("div", {
|
|
337
337
|
_id: "intelligentForm__ConfidentResponse"
|
|
338
|
-
}),
|
|
339
|
-
const { aiResponse: n, loading: r } = s(), l =
|
|
340
|
-
return
|
|
338
|
+
}), wi = v(({ ...i }, e) => {
|
|
339
|
+
const { aiResponse: n, loading: r } = s(), l = f(null), c = I(e, l);
|
|
340
|
+
return h(() => {
|
|
341
341
|
!r && n.answerConfidence && l.current && l.current.scrollIntoView({
|
|
342
342
|
behavior: "smooth",
|
|
343
343
|
block: "nearest",
|
|
344
344
|
inline: "nearest"
|
|
345
345
|
});
|
|
346
|
-
}, [r, n.answerConfidence]), n.answerConfidence ? /* @__PURE__ */ o(
|
|
347
|
-
}),
|
|
346
|
+
}, [r, n.answerConfidence]), n.answerConfidence ? /* @__PURE__ */ o(ue, { ref: c, ...i }) : null;
|
|
347
|
+
}), _e = t(W, {
|
|
348
348
|
_id: "intelligentForm__ConfidentAnswer"
|
|
349
|
-
}),
|
|
349
|
+
}), Ri = (i) => {
|
|
350
350
|
const { aiResponse: e } = s();
|
|
351
|
-
return /* @__PURE__ */ o(
|
|
352
|
-
},
|
|
351
|
+
return /* @__PURE__ */ o(_e, { shouldOpenLinksInNewTab: !0, children: e.answer, ...i });
|
|
352
|
+
}, ge = t("button", {
|
|
353
353
|
_id: "intelligentForm__ConfidentResponseButton",
|
|
354
354
|
type: "button"
|
|
355
|
-
}),
|
|
355
|
+
}), xi = (i) => {
|
|
356
356
|
const { onClick: e, ...n } = i, { showSecondaryFields: r, setShowSecondaryFields: l } = s(), c = () => {
|
|
357
357
|
l(!0);
|
|
358
358
|
};
|
|
359
359
|
return /* @__PURE__ */ o(
|
|
360
|
-
|
|
360
|
+
ge,
|
|
361
361
|
{
|
|
362
362
|
"data-escalated": a(r),
|
|
363
363
|
onClick: F(e, c),
|
|
364
364
|
...n
|
|
365
365
|
}
|
|
366
366
|
);
|
|
367
|
-
},
|
|
367
|
+
}, Ti = t(g, {
|
|
368
368
|
_id: "intelligentForm__ConfidentResponseButton__Icon",
|
|
369
369
|
iconSettings: { builtIn: "LuUser" }
|
|
370
|
-
}),
|
|
370
|
+
}), ki = t("span", {
|
|
371
371
|
_id: "intelligentForm__ConfidentResponseButton__Label",
|
|
372
372
|
children: "Escalate to human"
|
|
373
|
-
}),
|
|
373
|
+
}), Se = t("div", {
|
|
374
374
|
_id: "intelligentForm__SecondaryForm"
|
|
375
|
-
}),
|
|
376
|
-
const { showSecondaryFields: n } = s(), r =
|
|
377
|
-
return
|
|
375
|
+
}), Bi = v(({ ...i }, e) => {
|
|
376
|
+
const { showSecondaryFields: n } = s(), r = f(null), l = I(e, r);
|
|
377
|
+
return h(() => {
|
|
378
378
|
n && r.current && r.current.scrollIntoView({
|
|
379
379
|
behavior: "smooth",
|
|
380
380
|
block: "nearest",
|
|
381
381
|
inline: "nearest"
|
|
382
382
|
});
|
|
383
|
-
}, [n]), n ? /* @__PURE__ */ o(
|
|
384
|
-
}),
|
|
383
|
+
}, [n]), n ? /* @__PURE__ */ o(Se, { ref: l, ...i }) : null;
|
|
384
|
+
}), pe = t("p", {
|
|
385
385
|
_id: "intelligentForm__SecondaryForm__Description"
|
|
386
|
-
}),
|
|
386
|
+
}), Ai = (i) => {
|
|
387
387
|
const {
|
|
388
388
|
formSettings: { secondary: e },
|
|
389
389
|
aiResponse: { answerConfidence: n }
|
|
@@ -393,54 +393,54 @@ const M = t("form", {
|
|
|
393
393
|
// If description is an object, use the confident description if the answer is confident
|
|
394
394
|
n ? e.description.confident : e.description.default
|
|
395
395
|
);
|
|
396
|
-
return /* @__PURE__ */ o(
|
|
397
|
-
},
|
|
396
|
+
return /* @__PURE__ */ o(pe, { children: r, ...i });
|
|
397
|
+
}, ve = t("div", {
|
|
398
398
|
_id: "intelligentForm__SecondaryFormFields"
|
|
399
|
-
}),
|
|
399
|
+
}), Li = (i) => {
|
|
400
400
|
const { children: e, ...n } = i, {
|
|
401
401
|
formSettings: { secondary: r }
|
|
402
402
|
} = s();
|
|
403
|
-
return /* @__PURE__ */ o(
|
|
404
|
-
},
|
|
403
|
+
return /* @__PURE__ */ o(ve, { children: C(e, r.fields), ...n });
|
|
404
|
+
}, Ie = t("button", {
|
|
405
405
|
_id: "intelligentForm__SecondaryFormSubmit",
|
|
406
406
|
type: "submit",
|
|
407
407
|
children: "Submit"
|
|
408
|
-
}),
|
|
408
|
+
}), Vi = (i) => {
|
|
409
409
|
const { formSettings: e } = s(), { label: n } = e.buttons.submit;
|
|
410
|
-
return /* @__PURE__ */ o(
|
|
411
|
-
},
|
|
410
|
+
return /* @__PURE__ */ o(Ie, { children: n ?? "Submit", ...i });
|
|
411
|
+
}, Pe = t("span", {
|
|
412
412
|
_id: "intelligentForm__Error"
|
|
413
|
-
}),
|
|
413
|
+
}), Hi = (i) => {
|
|
414
414
|
const { formError: e } = s();
|
|
415
|
-
return e ? /* @__PURE__ */ o(
|
|
416
|
-
},
|
|
415
|
+
return e ? /* @__PURE__ */ o(Pe, { children: e.message, ...i }) : null;
|
|
416
|
+
}, Ei = t("div", {
|
|
417
417
|
_id: "intelligentForm__Sources"
|
|
418
|
-
}),
|
|
418
|
+
}), Di = t("p", {
|
|
419
419
|
_id: "intelligentForm__SourcesCaption",
|
|
420
420
|
children: "Here are the sources I considered:"
|
|
421
|
-
}),
|
|
421
|
+
}), fe = t("div", {
|
|
422
422
|
_id: "intelligentForm__SourcesList"
|
|
423
|
-
}),
|
|
423
|
+
}), Ni = (i) => {
|
|
424
424
|
const { children: e, ...n } = i, {
|
|
425
425
|
baseSettings: { transformSource: r, organizationDisplayName: l }
|
|
426
|
-
} =
|
|
426
|
+
} = R(), {
|
|
427
427
|
aiResponse: { recordsConsidered: c }
|
|
428
428
|
} = s();
|
|
429
429
|
if (!c) return null;
|
|
430
|
-
const m = c.reduce((d,
|
|
431
|
-
const
|
|
430
|
+
const m = c.reduce((d, S) => {
|
|
431
|
+
const _ = $(S, "intelligentFormSource", {
|
|
432
432
|
organizationDisplayName: l,
|
|
433
433
|
transformSource: r
|
|
434
434
|
});
|
|
435
|
-
return d.some((
|
|
435
|
+
return d.some((P) => P.url === _.url) || d.push(_), d;
|
|
436
436
|
}, []);
|
|
437
|
-
return /* @__PURE__ */ o(
|
|
438
|
-
},
|
|
437
|
+
return /* @__PURE__ */ o(fe, { children: C(e, m), ...n });
|
|
438
|
+
}, he = t(Q, {
|
|
439
439
|
_id: "intelligentForm__Source"
|
|
440
|
-
}),
|
|
440
|
+
}), qi = (i) => {
|
|
441
441
|
const { source: e, ...n } = i;
|
|
442
|
-
return /* @__PURE__ */ o(
|
|
443
|
-
|
|
442
|
+
return /* @__PURE__ */ o(j, { source: { ...e, isExternal: !!e.shouldOpenInNewTab }, children: /* @__PURE__ */ o(
|
|
443
|
+
he,
|
|
444
444
|
{
|
|
445
445
|
"data-type": e.type,
|
|
446
446
|
appendToUrl: e.appendToUrl,
|
|
@@ -449,125 +449,125 @@ const M = t("form", {
|
|
|
449
449
|
...n
|
|
450
450
|
}
|
|
451
451
|
) });
|
|
452
|
-
},
|
|
452
|
+
}, Ce = t(g, {
|
|
453
453
|
_id: "intelligentForm__SourceIcon"
|
|
454
|
-
}),
|
|
455
|
-
const { source: e } =
|
|
456
|
-
return /* @__PURE__ */ o(
|
|
457
|
-
},
|
|
454
|
+
}), Mi = (i) => {
|
|
455
|
+
const { source: e } = x();
|
|
456
|
+
return /* @__PURE__ */ o(Ce, { iconSettings: e.icon, "data-type": e.type, ...i });
|
|
457
|
+
}, be = t("span", {
|
|
458
458
|
_id: "intelligentForm__SourceTitle"
|
|
459
|
-
}),
|
|
460
|
-
const { source: e } =
|
|
461
|
-
return /* @__PURE__ */ o(
|
|
459
|
+
}), zi = (i) => {
|
|
460
|
+
const { source: e } = x();
|
|
461
|
+
return /* @__PURE__ */ o(be, { "data-type": e.type, children: e.title, ...i });
|
|
462
462
|
};
|
|
463
463
|
export {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
464
|
+
hi as BotHeading,
|
|
465
|
+
Ci as BotHeadingIcon,
|
|
466
|
+
bi as BotHeadingName,
|
|
467
|
+
Ri as ConfidentAnswer,
|
|
468
|
+
wi as ConfidentResponse,
|
|
469
|
+
xi as ConfidentResponseButton,
|
|
470
|
+
Ti as ConfidentResponseButtonIcon,
|
|
471
|
+
ki as ConfidentResponseButtonLabel,
|
|
472
|
+
Qe as Content,
|
|
473
|
+
We as ContentScrollArea,
|
|
474
|
+
Ke as ContentScrollAreaCorner,
|
|
475
|
+
Ge as ContentScrollAreaScrollbar,
|
|
476
|
+
Je as ContentScrollAreaThumb,
|
|
477
|
+
$e as ContentScrollAreaViewport,
|
|
478
|
+
Hi as Error,
|
|
479
|
+
oi as FormField,
|
|
480
|
+
di as FormFieldCheckbox,
|
|
481
|
+
ai as FormFieldCheckboxIndicator,
|
|
482
|
+
si as FormFieldEmail,
|
|
483
|
+
fi as FormFieldError,
|
|
484
|
+
ci as FormFieldFile,
|
|
485
|
+
li as FormFieldLabel,
|
|
486
|
+
Fi as FormFieldSelect,
|
|
487
|
+
Si as FormFieldSelectContent,
|
|
488
|
+
gi as FormFieldSelectIcon,
|
|
489
|
+
vi as FormFieldSelectItem,
|
|
490
|
+
Pi as FormFieldSelectItemIndicator,
|
|
491
|
+
Ii as FormFieldSelectItemText,
|
|
492
|
+
ui as FormFieldSelectTrigger,
|
|
493
|
+
_i as FormFieldSelectValue,
|
|
494
|
+
pi as FormFieldSelectViewport,
|
|
495
|
+
T as FormFieldText,
|
|
496
|
+
mi as FormFieldTextArea,
|
|
497
|
+
je as Heading,
|
|
498
|
+
hi as IntelligentFormPrimitiveBotHeading,
|
|
499
|
+
Ci as IntelligentFormPrimitiveBotHeadingIcon,
|
|
500
|
+
bi as IntelligentFormPrimitiveBotHeadingName,
|
|
501
|
+
Ri as IntelligentFormPrimitiveConfidentAnswer,
|
|
502
|
+
wi as IntelligentFormPrimitiveConfidentResponse,
|
|
503
|
+
xi as IntelligentFormPrimitiveConfidentResponseButton,
|
|
504
|
+
Ti as IntelligentFormPrimitiveConfidentResponseButtonIcon,
|
|
505
|
+
ki as IntelligentFormPrimitiveConfidentResponseButtonLabel,
|
|
506
|
+
Qe as IntelligentFormPrimitiveContent,
|
|
507
|
+
We as IntelligentFormPrimitiveContentScrollArea,
|
|
508
|
+
Ke as IntelligentFormPrimitiveContentScrollAreaCorner,
|
|
509
|
+
Ge as IntelligentFormPrimitiveContentScrollAreaScrollbar,
|
|
510
|
+
Je as IntelligentFormPrimitiveContentScrollAreaThumb,
|
|
511
|
+
$e as IntelligentFormPrimitiveContentScrollAreaViewport,
|
|
512
|
+
Hi as IntelligentFormPrimitiveFormError,
|
|
513
|
+
oi as IntelligentFormPrimitiveFormField,
|
|
514
|
+
di as IntelligentFormPrimitiveFormFieldCheckbox,
|
|
515
|
+
ai as IntelligentFormPrimitiveFormFieldCheckboxIndicator,
|
|
516
|
+
si as IntelligentFormPrimitiveFormFieldEmail,
|
|
517
|
+
fi as IntelligentFormPrimitiveFormFieldError,
|
|
518
|
+
ci as IntelligentFormPrimitiveFormFieldFile,
|
|
519
|
+
li as IntelligentFormPrimitiveFormFieldLabel,
|
|
520
|
+
Fi as IntelligentFormPrimitiveFormFieldSelect,
|
|
521
|
+
Si as IntelligentFormPrimitiveFormFieldSelectContent,
|
|
522
|
+
gi as IntelligentFormPrimitiveFormFieldSelectIcon,
|
|
523
|
+
vi as IntelligentFormPrimitiveFormFieldSelectItem,
|
|
524
|
+
Pi as IntelligentFormPrimitiveFormFieldSelectItemIndicator,
|
|
525
|
+
Ii as IntelligentFormPrimitiveFormFieldSelectItemText,
|
|
526
|
+
ui as IntelligentFormPrimitiveFormFieldSelectTrigger,
|
|
527
|
+
_i as IntelligentFormPrimitiveFormFieldSelectValue,
|
|
528
|
+
pi as IntelligentFormPrimitiveFormFieldSelectViewport,
|
|
529
|
+
T as IntelligentFormPrimitiveFormFieldText,
|
|
530
|
+
mi as IntelligentFormPrimitiveFormFieldTextArea,
|
|
531
|
+
je as IntelligentFormPrimitiveHeading,
|
|
532
|
+
yi as IntelligentFormPrimitiveLoading,
|
|
533
|
+
ii as IntelligentFormPrimitivePrimaryForm,
|
|
534
|
+
ti as IntelligentFormPrimitivePrimaryFormDescription,
|
|
535
|
+
ni as IntelligentFormPrimitivePrimaryFormFields,
|
|
536
|
+
ri as IntelligentFormPrimitivePrimaryFormSubmit,
|
|
537
|
+
Ue as IntelligentFormPrimitiveRoot,
|
|
538
|
+
Bi as IntelligentFormPrimitiveSecondaryForm,
|
|
539
|
+
Ai as IntelligentFormPrimitiveSecondaryFormDescription,
|
|
540
|
+
Li as IntelligentFormPrimitiveSecondaryFormFields,
|
|
541
|
+
Vi as IntelligentFormPrimitiveSecondaryFormSubmit,
|
|
542
|
+
qi as IntelligentFormPrimitiveSource,
|
|
543
|
+
Mi as IntelligentFormPrimitiveSourceIcon,
|
|
544
|
+
zi as IntelligentFormPrimitiveSourceTitle,
|
|
545
|
+
Ei as IntelligentFormPrimitiveSources,
|
|
546
|
+
Di as IntelligentFormPrimitiveSourcesCaption,
|
|
547
|
+
Ni as IntelligentFormPrimitiveSourcesList,
|
|
548
|
+
Xe as IntelligentFormPrimitiveSuccess,
|
|
549
|
+
Ze as IntelligentFormPrimitiveSuccessHeading,
|
|
550
|
+
Ye as IntelligentFormPrimitiveSuccessIcon,
|
|
551
|
+
ei as IntelligentFormPrimitiveSuccessMessage,
|
|
552
|
+
yi as Loading,
|
|
553
|
+
ii as PrimaryForm,
|
|
554
|
+
ti as PrimaryFormDescription,
|
|
555
|
+
ni as PrimaryFormFields,
|
|
556
|
+
ri as PrimaryFormSubmit,
|
|
557
|
+
ji as Provider,
|
|
558
|
+
Ue as Root,
|
|
559
|
+
Bi as SecondaryForm,
|
|
560
|
+
Ai as SecondaryFormDescription,
|
|
561
|
+
Li as SecondaryFormFields,
|
|
562
|
+
Vi as SecondaryFormSubmit,
|
|
563
|
+
qi as Source,
|
|
564
|
+
Mi as SourceIcon,
|
|
565
|
+
zi as SourceTitle,
|
|
566
|
+
Ei as Sources,
|
|
567
|
+
Di as SourcesCaption,
|
|
568
|
+
Ni as SourcesList,
|
|
569
|
+
Xe as Success,
|
|
570
|
+
Ze as SuccessHeading,
|
|
571
|
+
Ye as SuccessIcon,
|
|
572
|
+
ei as SuccessMessage
|
|
573
573
|
};
|