@aleph-alpha/chat-kit 1.17.3 → 2.0.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.
Files changed (41) hide show
  1. package/dist/{CkInput.vue_vue_type_script_setup_true_lang-DYBCJPBn.js → CkInput.vue_vue_type_script_setup_true_lang-DPZedAQS.js} +219 -104
  2. package/dist/chat-kit.css +5 -5
  3. package/dist/components/base/CkFeedbackDialog/CkFeedbackDialog.stories.d.ts +1 -1
  4. package/dist/components/base/CkFeedbackDialog/CkFeedbackDialog.vue.d.ts.map +1 -1
  5. package/dist/components/base/CkFeedbackDialog/types.d.ts +14 -9
  6. package/dist/components/base/CkFeedbackDialog/types.d.ts.map +1 -1
  7. package/dist/components/base/CkModelSelector/CkModelSelector.stories.d.ts +20 -0
  8. package/dist/components/base/CkModelSelector/CkModelSelector.stories.d.ts.map +1 -0
  9. package/dist/components/base/CkModelSelector/CkModelSelector.vue.d.ts +16 -0
  10. package/dist/components/base/CkModelSelector/CkModelSelector.vue.d.ts.map +1 -0
  11. package/dist/components/base/CkModelSelector/index.d.ts +3 -0
  12. package/dist/components/base/CkModelSelector/index.d.ts.map +1 -0
  13. package/dist/components/base/CkModelSelector/types.d.ts +54 -0
  14. package/dist/components/base/CkModelSelector/types.d.ts.map +1 -0
  15. package/dist/components/base/index.d.ts +2 -0
  16. package/dist/components/base/index.d.ts.map +1 -1
  17. package/dist/components/index.d.ts +2 -2
  18. package/dist/components/index.d.ts.map +1 -1
  19. package/dist/components/index.js +9 -8
  20. package/dist/handlers/index.js +1 -1
  21. package/dist/handlers/useChatKitLabels.d.ts +6 -0
  22. package/dist/handlers/useChatKitLabels.d.ts.map +1 -1
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +11 -10
  26. package/dist/{useChatKitLabels-BC6ItJc6.js → useChatKitLabels-ZutacPad.js} +3 -0
  27. package/package.json +1 -1
  28. package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.spec.ts +53 -10
  29. package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.stories.ts +1 -1
  30. package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.vue +10 -6
  31. package/src/components/base/CkFeedbackDialog/types.ts +14 -9
  32. package/src/components/base/CkModelSelector/CkModelSelector.spec.ts +60 -0
  33. package/src/components/base/CkModelSelector/CkModelSelector.stories.ts +101 -0
  34. package/src/components/base/CkModelSelector/CkModelSelector.vue +109 -0
  35. package/src/components/base/CkModelSelector/index.ts +6 -0
  36. package/src/components/base/CkModelSelector/types.ts +55 -0
  37. package/src/components/base/index.ts +6 -0
  38. package/src/components/index.ts +4 -0
  39. package/src/handlers/useChatKitLabels.spec.ts +5 -28
  40. package/src/handlers/useChatKitLabels.ts +9 -0
  41. package/src/index.ts +4 -0
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createCommentVNode, ref, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, createBlock, unref, mergeProps, withCtx, createVNode, Transition, toDisplayString, computed, normalizeClass, toRefs, h, useId, createTextVNode, useAttrs, useSlots, withModifiers, resolveDynamicComponent, useTemplateRef, onBeforeUnmount, createSlots, normalizeProps, guardReactiveProps } from "vue";
2
- import { u as useChatKitLabels, d as defaultChatKitLabels, a as useMarkdownParser } from "./useChatKitLabels-BC6ItJc6.js";
2
+ import { u as useChatKitLabels, d as defaultChatKitLabels, a as useMarkdownParser } from "./useChatKitLabels-ZutacPad.js";
3
3
  import { UiButton, UiTooltip, UiIcon, UiDialog, UiDialogContent, UiDialogDescription, UiFieldLabel, UiToggleGroup, UiToggleGroupItem, UiField, UiTextarea, UiFileItem, UiPopover, UiPopoverTrigger, UiFileType, UiPopoverContent, Primitive, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback, UiSidebarPopoverMenu, UiSidebarPopoverMenuItem } from "@aleph-alpha/ui-library";
4
4
  const MINUTE = 60;
5
5
  const HOUR = 60 * MINUTE;
@@ -36,7 +36,7 @@ function formatRelativeTime(unixSeconds, nowSeconds = Math.floor(Date.now() / 1e
36
36
  const years = Math.floor(delta / YEAR);
37
37
  return years === 1 ? "1 year ago" : `${years} years ago`;
38
38
  }
39
- const _hoisted_1$b = {
39
+ const _hoisted_1$c = {
40
40
  xmlns: "http://www.w3.org/2000/svg",
41
41
  width: "16",
42
42
  height: "16",
@@ -47,31 +47,31 @@ const _hoisted_1$b = {
47
47
  "stroke-linecap": "round",
48
48
  "stroke-linejoin": "round"
49
49
  };
50
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
50
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
51
51
  ...{ name: "CkSendIcon" },
52
52
  __name: "CkSendIcon",
53
53
  setup(__props) {
54
54
  return (_ctx, _cache) => {
55
- return openBlock(), createElementBlock("svg", _hoisted_1$b, [..._cache[0] || (_cache[0] = [
55
+ return openBlock(), createElementBlock("svg", _hoisted_1$c, [..._cache[0] || (_cache[0] = [
56
56
  createElementVNode("path", { d: "M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z" }, null, -1),
57
57
  createElementVNode("path", { d: "M6 12h16" }, null, -1)
58
58
  ])]);
59
59
  };
60
60
  }
61
61
  });
62
- const _hoisted_1$a = {
62
+ const _hoisted_1$b = {
63
63
  xmlns: "http://www.w3.org/2000/svg",
64
64
  width: "16",
65
65
  height: "16",
66
66
  viewBox: "0 0 16 16",
67
67
  fill: "none"
68
68
  };
69
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
69
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
70
70
  ...{ name: "CkStopIcon" },
71
71
  __name: "CkStopIcon",
72
72
  setup(__props) {
73
73
  return (_ctx, _cache) => {
74
- return openBlock(), createElementBlock("svg", _hoisted_1$a, [..._cache[0] || (_cache[0] = [
74
+ return openBlock(), createElementBlock("svg", _hoisted_1$b, [..._cache[0] || (_cache[0] = [
75
75
  createElementVNode("path", {
76
76
  d: "M13.3335 3.33301C13.3335 2.96482 13.035 2.66634 12.6668 2.66634H3.3335C2.96531 2.66634 2.66683 2.96482 2.66683 3.33301V12.6663C2.66683 13.0345 2.96531 13.333 3.3335 13.333H12.6668C13.035 13.333 13.3335 13.0345 13.3335 12.6663V3.33301ZM14.6668 12.6663C14.6668 13.7709 13.7714 14.6663 12.6668 14.6663H3.3335C2.22893 14.6663 1.3335 13.7709 1.3335 12.6663V3.33301C1.3335 2.22844 2.22893 1.33301 3.3335 1.33301H12.6668C13.7714 1.33301 14.6668 2.22844 14.6668 3.33301V12.6663Z",
77
77
  fill: "#1D1D1B"
@@ -80,41 +80,41 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
80
80
  };
81
81
  }
82
82
  });
83
- const _hoisted_1$9 = { class: "flex w-full flex-col gap-6 pb-6" };
84
- const _hoisted_2$6 = {
83
+ const _hoisted_1$a = { class: "flex w-full flex-col gap-6 pb-6" };
84
+ const _hoisted_2$7 = {
85
85
  key: 0,
86
86
  class: "flex items-start gap-3"
87
87
  };
88
- const _hoisted_3$5 = {
88
+ const _hoisted_3$6 = {
89
89
  key: 0,
90
90
  "data-testid": "ck-agent-message-icon",
91
91
  class: "flex flex-shrink-0 justify-center"
92
92
  };
93
- const _hoisted_4$4 = {
93
+ const _hoisted_4$5 = {
94
94
  key: 1,
95
95
  "data-testid": "ck-agent-message-header",
96
96
  class: "body-14-regular text-content-on-surface-muted min-w-0 flex-1 [word-break:break-word]"
97
97
  };
98
- const _hoisted_5$3 = { class: "text-content-on-surface-primary text-base leading-7" };
98
+ const _hoisted_5$4 = { class: "text-content-on-surface-primary text-base leading-7" };
99
99
  const _hoisted_6$2 = {
100
100
  key: 1,
101
101
  class: "flex items-center gap-4"
102
102
  };
103
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
103
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
104
104
  ...{ name: "CkAgentMessage" },
105
105
  __name: "CkAgentMessage",
106
106
  setup(__props) {
107
107
  return (_ctx, _cache) => {
108
- return openBlock(), createElementBlock("div", _hoisted_1$9, [
109
- _ctx.$slots.icon || _ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
110
- _ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_3$5, [
108
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [
109
+ _ctx.$slots.icon || _ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_2$7, [
110
+ _ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_3$6, [
111
111
  renderSlot(_ctx.$slots, "icon")
112
112
  ])) : createCommentVNode("", true),
113
- _ctx.$slots.header ? (openBlock(), createElementBlock("span", _hoisted_4$4, [
113
+ _ctx.$slots.header ? (openBlock(), createElementBlock("span", _hoisted_4$5, [
114
114
  renderSlot(_ctx.$slots, "header")
115
115
  ])) : createCommentVNode("", true)
116
116
  ])) : createCommentVNode("", true),
117
- createElementVNode("div", _hoisted_5$3, [
117
+ createElementVNode("div", _hoisted_5$4, [
118
118
  renderSlot(_ctx.$slots, "default")
119
119
  ]),
120
120
  _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
@@ -124,16 +124,16 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
124
124
  };
125
125
  }
126
126
  });
127
- const _hoisted_1$8 = ["data-message-row"];
128
- const _hoisted_2$5 = {
127
+ const _hoisted_1$9 = ["data-message-row"];
128
+ const _hoisted_2$6 = {
129
129
  key: 0,
130
130
  class: "flex justify-end"
131
131
  };
132
- const _hoisted_3$4 = {
132
+ const _hoisted_3$5 = {
133
133
  key: 1,
134
134
  class: "flex justify-start"
135
135
  };
136
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
136
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
137
137
  ...{ name: "CkConversationLayout" },
138
138
  __name: "CkConversationLayout",
139
139
  props: {
@@ -273,12 +273,12 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
273
273
  key: message.id,
274
274
  "data-message-row": message.role
275
275
  }, [
276
- message.role === "user" ? (openBlock(), createElementBlock("div", _hoisted_2$5, [
276
+ message.role === "user" ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
277
277
  renderSlot(_ctx.$slots, "user-message", { message })
278
- ])) : (openBlock(), createElementBlock("div", _hoisted_3$4, [
278
+ ])) : (openBlock(), createElementBlock("div", _hoisted_3$5, [
279
279
  renderSlot(_ctx.$slots, "agent-message", { message })
280
280
  ]))
281
- ], 8, _hoisted_1$8);
281
+ ], 8, _hoisted_1$9);
282
282
  }), 128)),
283
283
  hasBottomSpacer.value ? (openBlock(), createElementBlock("div", {
284
284
  key: 0,
@@ -289,7 +289,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
289
289
  };
290
290
  }
291
291
  });
292
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
292
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
293
293
  ...{
294
294
  name: "CkMessageActionButton"
295
295
  },
@@ -313,11 +313,11 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
313
313
  };
314
314
  }
315
315
  });
316
- const _hoisted_1$7 = {
316
+ const _hoisted_1$8 = {
317
317
  class: "sr-only",
318
318
  "aria-live": "polite"
319
319
  };
320
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
320
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
321
321
  ...{
322
322
  name: "CkCopyMessageActionButton"
323
323
  },
@@ -374,7 +374,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
374
374
  "delay-duration": 0
375
375
  }, {
376
376
  default: withCtx(() => [
377
- createVNode(unref(_sfc_main$g), mergeProps({ ariaLabel: copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy }, {
377
+ createVNode(unref(_sfc_main$h), mergeProps({ ariaLabel: copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy }, {
378
378
  disabled: __props.disabled,
379
379
  onClick: handleClick
380
380
  }), {
@@ -401,7 +401,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
401
401
  ]),
402
402
  _: 1
403
403
  }, 16, ["disabled"]),
404
- createElementVNode("span", _hoisted_1$7, toDisplayString(copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy), 1)
404
+ createElementVNode("span", _hoisted_1$8, toDisplayString(copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy), 1)
405
405
  ]),
406
406
  _: 1
407
407
  }, 8, ["open", "content"]);
@@ -415,9 +415,9 @@ const _export_sfc = (sfc, props) => {
415
415
  }
416
416
  return target;
417
417
  };
418
- const CkCopyMessageActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-f77a1193"]]);
419
- const _hoisted_1$6 = ["aria-label"];
420
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
418
+ const CkCopyMessageActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-f77a1193"]]);
419
+ const _hoisted_1$7 = ["aria-label"];
420
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
421
421
  ...{
422
422
  name: "CkFeedbackButton"
423
423
  },
@@ -472,7 +472,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
472
472
  "delay-duration": 0
473
473
  }, {
474
474
  default: withCtx(() => [
475
- createVNode(unref(_sfc_main$g), mergeProps({ ariaLabel: thumbsUpLabel.value }, {
475
+ createVNode(unref(_sfc_main$h), mergeProps({ ariaLabel: thumbsUpLabel.value }, {
476
476
  "aria-pressed": isUpSelected.value,
477
477
  "aria-disabled": __props.locked || void 0,
478
478
  disabled: isUpDisabled.value,
@@ -502,7 +502,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
502
502
  "delay-duration": 0
503
503
  }, {
504
504
  default: withCtx(() => [
505
- createVNode(unref(_sfc_main$g), mergeProps({ ariaLabel: thumbsDownLabel.value }, {
505
+ createVNode(unref(_sfc_main$h), mergeProps({ ariaLabel: thumbsDownLabel.value }, {
506
506
  "aria-pressed": isDownSelected.value,
507
507
  "aria-disabled": __props.locked || void 0,
508
508
  disabled: isDownDisabled.value,
@@ -525,11 +525,11 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
525
525
  ]),
526
526
  _: 1
527
527
  }, 8, ["content"])
528
- ], 8, _hoisted_1$6);
528
+ ], 8, _hoisted_1$7);
529
529
  };
530
530
  }
531
531
  });
532
- const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-245705b8"]]);
532
+ const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-245705b8"]]);
533
533
  const defaultMarkdownClasses = {
534
534
  p: "my-1 leading-7",
535
535
  a: "underline underline-offset-4",
@@ -571,7 +571,7 @@ function domToVNode(node, slots, classes) {
571
571
  }
572
572
  return h(tag, attrs, children);
573
573
  }
574
- const _sfc_main$d = defineComponent({
574
+ const _sfc_main$e = defineComponent({
575
575
  name: "CkMarkdownRenderer",
576
576
  props: {
577
577
  content: { type: String, required: true },
@@ -601,17 +601,17 @@ const _sfc_main$d = defineComponent({
601
601
  };
602
602
  }
603
603
  });
604
- const _hoisted_1$5 = {
604
+ const _hoisted_1$6 = {
605
605
  key: 0,
606
606
  class: "flex min-h-0 flex-col gap-2"
607
607
  };
608
- const _hoisted_2$4 = { class: "ck-feedback-dialog__response min-h-0 flex-1 overflow-y-auto rounded-md border border-input bg-background-input-default px-3 py-2 shadow-xs" };
609
- const _hoisted_3$3 = { class: "flex min-h-0 flex-col gap-4" };
610
- const _hoisted_4$3 = {
608
+ const _hoisted_2$5 = { class: "ck-feedback-dialog__response min-h-0 flex-1 overflow-y-auto rounded-md border border-input bg-background-input-default px-3 py-2 shadow-xs" };
609
+ const _hoisted_3$4 = { class: "flex min-h-0 flex-col gap-4" };
610
+ const _hoisted_4$4 = {
611
611
  class: "self-end text-sm text-content-on-surface-muted tabular-nums",
612
612
  "aria-live": "polite"
613
613
  };
614
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
614
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
615
615
  ...{
616
616
  name: "CkFeedbackDialog"
617
617
  },
@@ -665,14 +665,14 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
665
665
  const submitLabel = computed(
666
666
  () => __props.submitLabel ?? labels.value.feedbackDialogSubmitLabel ?? defaultChatKitLabels.feedbackDialogSubmitLabel
667
667
  );
668
- const selectedReason = ref("");
668
+ const selectedReasons = ref([]);
669
669
  const freeText = ref("");
670
670
  const freeTextId = useId();
671
671
  watch(
672
672
  () => __props.open,
673
673
  (isOpen, wasOpen) => {
674
674
  if (isOpen && !wasOpen) {
675
- selectedReason.value = "";
675
+ selectedReasons.value = [];
676
676
  freeText.value = "";
677
677
  }
678
678
  }
@@ -682,7 +682,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
682
682
  );
683
683
  const characterCount = computed(() => freeText.value.length);
684
684
  const canSubmit = computed(
685
- () => !__props.disabled && !__props.submitting && (selectedReason.value !== "" || freeText.value.trim() !== "")
685
+ () => !__props.disabled && !__props.submitting && (selectedReasons.value.length > 0 || freeText.value.trim() !== "")
686
686
  );
687
687
  function handleOpenChange(next) {
688
688
  if (!next && (__props.submitting || __props.disabled)) {
@@ -706,7 +706,9 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
706
706
  }
707
707
  emit("submit", {
708
708
  sentiment: __props.sentiment,
709
- reason: selectedReason.value === "" ? null : selectedReason.value,
709
+ // Copy so the host can't mutate our internal reactive array, and so the
710
+ // payload is a plain snapshot at submit time.
711
+ reasons: [...selectedReasons.value],
710
712
  reasonText: freeText.value.trim()
711
713
  });
712
714
  }
@@ -762,22 +764,22 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
762
764
  showResponseColumn.value ? "grid-cols-2" : "grid-cols-1"
763
765
  ])
764
766
  }, [
765
- showResponseColumn.value ? (openBlock(), createElementBlock("section", _hoisted_1$5, [
767
+ showResponseColumn.value ? (openBlock(), createElementBlock("section", _hoisted_1$6, [
766
768
  createVNode(unref(UiFieldLabel), null, {
767
769
  default: withCtx(() => [
768
770
  createTextVNode(toDisplayString(responseHeading.value), 1)
769
771
  ]),
770
772
  _: 1
771
773
  }),
772
- createElementVNode("div", _hoisted_2$4, [
773
- createVNode(unref(_sfc_main$d), { content: __props.responseText }, null, 8, ["content"])
774
+ createElementVNode("div", _hoisted_2$5, [
775
+ createVNode(unref(_sfc_main$e), { content: __props.responseText }, null, 8, ["content"])
774
776
  ])
775
777
  ])) : createCommentVNode("", true),
776
- createElementVNode("section", _hoisted_3$3, [
778
+ createElementVNode("section", _hoisted_3$4, [
777
779
  createVNode(unref(UiToggleGroup), {
778
- modelValue: selectedReason.value,
779
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedReason.value = $event),
780
- type: "single",
780
+ modelValue: selectedReasons.value,
781
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedReasons.value = $event),
782
+ type: "multiple",
781
783
  variant: "outline",
782
784
  disabled: __props.disabled || __props.submitting,
783
785
  class: "grid grid-cols-2 gap-4",
@@ -820,7 +822,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
820
822
  maxlength: __props.maxFreeTextLength,
821
823
  rows: "3"
822
824
  }, null, 8, ["id", "modelValue", "placeholder", "disabled", "maxlength"]),
823
- createElementVNode("div", _hoisted_4$3, toDisplayString(characterCount.value) + "/" + toDisplayString(__props.maxFreeTextLength), 1)
825
+ createElementVNode("div", _hoisted_4$4, toDisplayString(characterCount.value) + "/" + toDisplayString(__props.maxFreeTextLength), 1)
824
826
  ]),
825
827
  _: 1
826
828
  })
@@ -835,8 +837,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
835
837
  };
836
838
  }
837
839
  });
838
- const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-181a7aa9"]]);
839
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
840
+ const CkFeedbackDialog = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-4d1d9c59"]]);
841
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
840
842
  ...{
841
843
  name: "CkFileItemRow",
842
844
  inheritAttrs: false
@@ -879,12 +881,12 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
879
881
  };
880
882
  }
881
883
  });
882
- const _hoisted_1$4 = ["aria-label"];
883
- const _hoisted_2$3 = ["onClick"];
884
- const _hoisted_3$2 = ["disabled", "aria-label"];
885
- const _hoisted_4$2 = ["aria-label"];
886
- const _hoisted_5$2 = ["onClick"];
887
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
884
+ const _hoisted_1$5 = ["aria-label"];
885
+ const _hoisted_2$4 = ["onClick"];
886
+ const _hoisted_3$3 = ["disabled", "aria-label"];
887
+ const _hoisted_4$3 = ["aria-label"];
888
+ const _hoisted_5$3 = ["onClick"];
889
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
888
890
  ...{
889
891
  name: "CkFileItemsList"
890
892
  },
@@ -941,7 +943,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
941
943
  class: "min-w-0 max-w-64 flex-1 basis-0",
942
944
  onClick: ($event) => handleRowClick(file, $event)
943
945
  }, [
944
- createVNode(_sfc_main$b, {
946
+ createVNode(_sfc_main$c, {
945
947
  file,
946
948
  size: __props.size,
947
949
  "is-removable": __props.isRemovable,
@@ -954,9 +956,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
954
956
  ]),
955
957
  _: 3
956
958
  }, 8, ["file", "size", "is-removable", "remove-label", "disabled", "onRemove"])
957
- ], 8, _hoisted_2$3);
959
+ ], 8, _hoisted_2$4);
958
960
  }), 128))
959
- ], 8, _hoisted_1$4)) : (openBlock(), createBlock(unref(UiPopover), {
961
+ ], 8, _hoisted_1$5)) : (openBlock(), createBlock(unref(UiPopover), {
960
962
  key: 1,
961
963
  open: isOpen.value,
962
964
  "onUpdate:open": _cache[0] || (_cache[0] = ($event) => isOpen.value = $event)
@@ -984,7 +986,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
984
986
  "aria-hidden": "true",
985
987
  class: normalizeClass(["shrink-0 text-content-on-surface-muted transition-transform", isOpen.value && "rotate-180"])
986
988
  }, null, 8, ["class"])
987
- ], 10, _hoisted_3$2)
989
+ ], 10, _hoisted_3$3)
988
990
  ]),
989
991
  _: 1
990
992
  }),
@@ -1005,7 +1007,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1005
1007
  class: "min-w-0 max-w-64",
1006
1008
  onClick: ($event) => handleRowClick(file, $event)
1007
1009
  }, [
1008
- createVNode(_sfc_main$b, {
1010
+ createVNode(_sfc_main$c, {
1009
1011
  file,
1010
1012
  size: __props.size,
1011
1013
  "is-removable": __props.isRemovable,
@@ -1018,9 +1020,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1018
1020
  ]),
1019
1021
  _: 3
1020
1022
  }, 8, ["file", "size", "is-removable", "remove-label", "disabled", "onRemove"])
1021
- ], 8, _hoisted_5$2);
1023
+ ], 8, _hoisted_5$3);
1022
1024
  }), 128))
1023
- ], 8, _hoisted_4$2)
1025
+ ], 8, _hoisted_4$3)
1024
1026
  ]),
1025
1027
  _: 3
1026
1028
  }, 8, ["class"])
@@ -1031,14 +1033,14 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1031
1033
  }
1032
1034
  });
1033
1035
  const CHAT_HISTORY_ACTIVE_INDICATOR_CLASS = "ui-active-indicator";
1034
- const _hoisted_1$3 = ["data-active"];
1035
- const _hoisted_2$2 = { class: "min-w-0 flex-1" };
1036
- const _hoisted_3$1 = { class: "truncate body-14-regular text-content-on-surface-primary" };
1037
- const _hoisted_4$1 = {
1036
+ const _hoisted_1$4 = ["data-active"];
1037
+ const _hoisted_2$3 = { class: "min-w-0 flex-1" };
1038
+ const _hoisted_3$2 = { class: "truncate body-14-regular text-content-on-surface-primary" };
1039
+ const _hoisted_4$2 = {
1038
1040
  key: 0,
1039
1041
  class: "mt-0.5 flex min-w-0 items-center gap-1 label-12-medium text-content-on-surface-muted"
1040
1042
  };
1041
- const _hoisted_5$1 = {
1043
+ const _hoisted_5$2 = {
1042
1044
  key: 0,
1043
1045
  class: "truncate"
1044
1046
  };
@@ -1053,7 +1055,7 @@ const _hoisted_7$1 = {
1053
1055
  const _hoisted_8 = ["aria-label"];
1054
1056
  const _hoisted_9 = ["aria-label"];
1055
1057
  const _hoisted_10 = ["aria-label"];
1056
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1058
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1057
1059
  ...{
1058
1060
  name: "CkHistoryItem",
1059
1061
  inheritAttrs: false
@@ -1182,11 +1184,11 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1182
1184
  class: itemClass.value
1183
1185
  }), {
1184
1186
  default: withCtx(() => [
1185
- createElementVNode("div", _hoisted_2$2, [
1186
- createElementVNode("div", _hoisted_3$1, toDisplayString(props.title), 1),
1187
- props.metaStart || props.metaEnd || _ctx.$slots.meta ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
1187
+ createElementVNode("div", _hoisted_2$3, [
1188
+ createElementVNode("div", _hoisted_3$2, toDisplayString(props.title), 1),
1189
+ props.metaStart || props.metaEnd || _ctx.$slots.meta ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
1188
1190
  renderSlot(_ctx.$slots, "meta", {}, () => [
1189
- props.metaStart ? (openBlock(), createElementBlock("span", _hoisted_5$1, toDisplayString(props.metaStart), 1)) : createCommentVNode("", true),
1191
+ props.metaStart ? (openBlock(), createElementBlock("span", _hoisted_5$2, toDisplayString(props.metaStart), 1)) : createCommentVNode("", true),
1190
1192
  props.metaStart && props.metaEnd ? (openBlock(), createElementBlock("span", _hoisted_6$1, "|")) : createCommentVNode("", true),
1191
1193
  props.metaEnd ? (openBlock(), createElementBlock("span", _hoisted_7$1, toDisplayString(props.metaEnd), 1)) : createCommentVNode("", true)
1192
1194
  ])
@@ -1289,12 +1291,12 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1289
1291
  }))
1290
1292
  ], 42, _hoisted_10))
1291
1293
  ], 34)) : createCommentVNode("", true)
1292
- ], 10, _hoisted_1$3);
1294
+ ], 10, _hoisted_1$4);
1293
1295
  };
1294
1296
  }
1295
1297
  });
1296
1298
  const baseClass = "flex w-full min-w-0 flex-col p-2";
1297
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1299
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1298
1300
  ...{
1299
1301
  name: "CkHistoryWrapper",
1300
1302
  inheritAttrs: false
@@ -1324,6 +1326,118 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1324
1326
  };
1325
1327
  }
1326
1328
  });
1329
+ const _hoisted_1$3 = ["disabled", "aria-expanded", "aria-label"];
1330
+ const _hoisted_2$2 = { class: "max-w-[10rem] truncate" };
1331
+ const _hoisted_3$1 = ["aria-label"];
1332
+ const _hoisted_4$1 = ["aria-selected", "onClick"];
1333
+ const _hoisted_5$1 = { class: "min-w-0 flex-1 truncate" };
1334
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1335
+ ...{ name: "CkModelSelector" },
1336
+ __name: "CkModelSelector",
1337
+ props: {
1338
+ models: { default: () => [] },
1339
+ selectedModelId: { default: null },
1340
+ disabled: { type: Boolean, default: false },
1341
+ side: { default: "top" },
1342
+ align: { default: "end" },
1343
+ sideOffset: { default: 8 }
1344
+ },
1345
+ emits: ["update:selectedModelId"],
1346
+ setup(__props, { emit: __emit }) {
1347
+ const props = __props;
1348
+ const emit = __emit;
1349
+ const labels = useChatKitLabels();
1350
+ const triggerAriaLabel = computed(
1351
+ () => labels.value.modelSelectorAriaLabel ?? defaultChatKitLabels.modelSelectorAriaLabel
1352
+ );
1353
+ const listAriaLabel = computed(
1354
+ () => labels.value.modelSelectorListAriaLabel ?? defaultChatKitLabels.modelSelectorListAriaLabel
1355
+ );
1356
+ const placeholderLabel = computed(
1357
+ () => labels.value.modelSelectorPlaceholder ?? defaultChatKitLabels.modelSelectorPlaceholder
1358
+ );
1359
+ const open = ref(false);
1360
+ const selectedLabel = computed(() => {
1361
+ const match = props.models.find((m) => m.id === props.selectedModelId);
1362
+ return match?.label ?? placeholderLabel.value;
1363
+ });
1364
+ function select(id) {
1365
+ open.value = false;
1366
+ if (id !== props.selectedModelId) emit("update:selectedModelId", id);
1367
+ }
1368
+ return (_ctx, _cache) => {
1369
+ return openBlock(), createBlock(unref(UiPopover), {
1370
+ open: open.value,
1371
+ "onUpdate:open": _cache[1] || (_cache[1] = ($event) => open.value = $event)
1372
+ }, {
1373
+ default: withCtx(() => [
1374
+ createVNode(unref(UiPopoverTrigger), { "as-child": "" }, {
1375
+ default: withCtx(() => [
1376
+ createElementVNode("button", {
1377
+ type: "button",
1378
+ class: "ck-model-selector__trigger inline-flex h-9 shrink-0 items-center gap-1 rounded-3xl px-3 label-14-medium text-content-on-surface-primary outline-none transition-colors hover:bg-background-surface-muted focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
1379
+ disabled: __props.disabled,
1380
+ "aria-haspopup": "listbox",
1381
+ "aria-expanded": open.value,
1382
+ "aria-label": triggerAriaLabel.value
1383
+ }, [
1384
+ createElementVNode("span", _hoisted_2$2, toDisplayString(selectedLabel.value), 1),
1385
+ createVNode(unref(UiIcon), {
1386
+ name: "chevron-down",
1387
+ size: 16,
1388
+ "aria-hidden": "true"
1389
+ })
1390
+ ], 8, _hoisted_1$3)
1391
+ ]),
1392
+ _: 1
1393
+ }),
1394
+ createVNode(unref(UiPopoverContent), {
1395
+ side: __props.side,
1396
+ align: __props.align,
1397
+ "side-offset": __props.sideOffset,
1398
+ class: "max-h-72 w-56 overflow-y-auto rounded-xl border border-border-surface-default bg-background-surface-floating p-2 text-content-on-surface-primary shadow-md",
1399
+ onOpenAutoFocus: _cache[0] || (_cache[0] = withModifiers(() => {
1400
+ }, ["prevent"]))
1401
+ }, {
1402
+ default: withCtx(() => [
1403
+ createElementVNode("ul", {
1404
+ class: "flex flex-col gap-1",
1405
+ role: "listbox",
1406
+ "aria-label": listAriaLabel.value
1407
+ }, [
1408
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.models, (model) => {
1409
+ return openBlock(), createElementBlock("li", {
1410
+ key: model.id,
1411
+ role: "presentation"
1412
+ }, [
1413
+ createElementVNode("button", {
1414
+ type: "button",
1415
+ role: "option",
1416
+ "aria-selected": model.id === __props.selectedModelId,
1417
+ class: "relative flex w-full items-center gap-2 rounded-sm py-2 pr-8 pl-3 text-left body-14-regular text-content-on-surface-primary outline-none hover:bg-background-surface-muted-subtle focus-visible:ring-2 focus-visible:ring-ring",
1418
+ onClick: ($event) => select(model.id)
1419
+ }, [
1420
+ createElementVNode("span", _hoisted_5$1, toDisplayString(model.label), 1),
1421
+ model.id === __props.selectedModelId ? (openBlock(), createBlock(unref(UiIcon), {
1422
+ key: 0,
1423
+ name: "check",
1424
+ size: 16,
1425
+ class: "absolute right-2 text-content-on-surface-primary",
1426
+ "aria-hidden": "true"
1427
+ })) : createCommentVNode("", true)
1428
+ ], 8, _hoisted_4$1)
1429
+ ]);
1430
+ }), 128))
1431
+ ], 8, _hoisted_3$1)
1432
+ ]),
1433
+ _: 1
1434
+ }, 8, ["side", "align", "side-offset"])
1435
+ ]),
1436
+ _: 1
1437
+ }, 8, ["open"]);
1438
+ };
1439
+ }
1440
+ });
1327
1441
  const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1328
1442
  ...{ name: "CkPromptActionButton" },
1329
1443
  __name: "CkPromptActionButton",
@@ -1588,7 +1702,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1588
1702
  return message.content.filter((c) => c.type === "text").map((c) => c.text).join("");
1589
1703
  }
1590
1704
  return (_ctx, _cache) => {
1591
- return openBlock(), createBlock(_sfc_main$h, { messages: __props.messages }, {
1705
+ return openBlock(), createBlock(_sfc_main$i, { messages: __props.messages }, {
1592
1706
  "user-message": withCtx(({ message }) => [
1593
1707
  createElementVNode("div", {
1594
1708
  class: normalizeClass({ "ml-8": hasIcon.value })
@@ -1607,7 +1721,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1607
1721
  ]),
1608
1722
  "agent-message": withCtx(({ message }) => [
1609
1723
  renderSlot(_ctx.$slots, "agent-message", { message }, () => [
1610
- createVNode(_sfc_main$i, null, createSlots({
1724
+ createVNode(_sfc_main$j, null, createSlots({
1611
1725
  footer: withCtx(() => [
1612
1726
  renderSlot(_ctx.$slots, "agent-message-footer", { message }, () => [
1613
1727
  getMessageText(message) && !isLoading(message) ? (openBlock(), createBlock(CkCopyMessageActionButton, {
@@ -1620,7 +1734,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1620
1734
  ]),
1621
1735
  default: withCtx(() => [
1622
1736
  renderSlot(_ctx.$slots, "agent-message-content", { message }, () => [
1623
- createVNode(_sfc_main$d, {
1737
+ createVNode(_sfc_main$e, {
1624
1738
  content: getMessageText(message),
1625
1739
  classes: __props.agentMarkdownClasses
1626
1740
  }, createSlots({ _: 2 }, [
@@ -1746,7 +1860,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1746
1860
  }
1747
1861
  return (_ctx, _cache) => {
1748
1862
  return openBlock(), createElementBlock("div", null, [
1749
- createVNode(_sfc_main$8, {
1863
+ createVNode(_sfc_main$9, {
1750
1864
  class: normalizeClass(isExpanded.value && props.maxHeight ? "overflow-y-auto" : void 0),
1751
1865
  style: normalizeStyle(
1752
1866
  isExpanded.value && props.maxHeight ? { maxHeight: props.maxHeight } : void 0
@@ -1765,7 +1879,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1765
1879
  edit: () => emit("edit", conversation),
1766
1880
  delete: () => emit("delete", conversation)
1767
1881
  }, () => [
1768
- createVNode(_sfc_main$9, {
1882
+ createVNode(_sfc_main$a, {
1769
1883
  as: "a",
1770
1884
  href: hrefFor(conversation),
1771
1885
  "is-active": conversation.id === props.activeId,
@@ -1888,7 +2002,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1888
2002
  }, {
1889
2003
  default: withCtx(() => [
1890
2004
  renderSlot(_ctx.$slots, "stop-icon", {}, () => [
1891
- createVNode(_sfc_main$j)
2005
+ createVNode(_sfc_main$k)
1892
2006
  ])
1893
2007
  ]),
1894
2008
  _: 3
@@ -1898,7 +2012,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1898
2012
  }), {
1899
2013
  default: withCtx(() => [
1900
2014
  renderSlot(_ctx.$slots, "send-icon", {}, () => [
1901
- createVNode(_sfc_main$k)
2015
+ createVNode(_sfc_main$l)
1902
2016
  ])
1903
2017
  ]),
1904
2018
  _: 3
@@ -1928,24 +2042,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1928
2042
  });
1929
2043
  export {
1930
2044
  CkCopyMessageActionButton as C,
1931
- _sfc_main$i as _,
2045
+ _sfc_main$j as _,
1932
2046
  _sfc_main$2 as a,
1933
- _sfc_main$h as b,
2047
+ _sfc_main$i as b,
1934
2048
  CkFeedbackButton as c,
1935
2049
  CkFeedbackDialog as d,
1936
- _sfc_main$a as e,
2050
+ _sfc_main$b as e,
1937
2051
  _sfc_main$1 as f,
1938
- _sfc_main$9 as g,
1939
- _sfc_main$8 as h,
2052
+ _sfc_main$a as g,
2053
+ _sfc_main$9 as h,
1940
2054
  _sfc_main as i,
1941
- _sfc_main$d as j,
1942
- _sfc_main$g as k,
1943
- _sfc_main$7 as l,
1944
- _sfc_main$5 as m,
1945
- _sfc_main$4 as n,
1946
- _sfc_main$6 as o,
1947
- _sfc_main$k as p,
1948
- _sfc_main$j as q,
1949
- CkUserMessage as r,
1950
- formatRelativeTime as s
2055
+ _sfc_main$e as j,
2056
+ _sfc_main$h as k,
2057
+ _sfc_main$8 as l,
2058
+ _sfc_main$7 as m,
2059
+ _sfc_main$5 as n,
2060
+ _sfc_main$4 as o,
2061
+ _sfc_main$6 as p,
2062
+ _sfc_main$l as q,
2063
+ _sfc_main$k as r,
2064
+ CkUserMessage as s,
2065
+ formatRelativeTime as t
1951
2066
  };