@iblai/iblai-js 2.76.1 → 2.78.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 (308) hide show
  1. package/dist/data-layer/playwright/evaluation-tab-helpers.d.ts +181 -68
  2. package/dist/playwright/index.cjs +414 -164
  3. package/dist/playwright/index.cjs.map +1 -1
  4. package/dist/playwright/index.d.ts +181 -69
  5. package/dist/playwright/index.esm.js +407 -165
  6. package/dist/playwright/index.esm.js.map +1 -1
  7. package/dist/playwright/playwright/evaluation-tab-helpers.d.ts +181 -68
  8. package/dist/security/playwright/evaluation-tab-helpers.d.ts +181 -68
  9. package/dist/web-containers/playwright/evaluation-tab-helpers.d.ts +181 -68
  10. package/dist/web-containers/source/_virtual/index4.js +2 -2
  11. package/dist/web-containers/source/_virtual/index5.js +2 -2
  12. package/dist/web-containers/source/activity-empty-state.js +2 -2
  13. package/dist/web-containers/source/activity-empty-state.js.map +1 -1
  14. package/dist/web-containers/source/activity-tab/activity-empty-state.js +2 -2
  15. package/dist/web-containers/source/activity-tab/activity-empty-state.js.map +1 -1
  16. package/dist/web-containers/source/add-items-modal.js +26 -91
  17. package/dist/web-containers/source/add-items-modal.js.map +1 -1
  18. package/dist/web-containers/source/benchmark-combobox.js +2 -2
  19. package/dist/web-containers/source/benchmark-combobox.js.map +1 -1
  20. package/dist/web-containers/source/benchmark-items-modal.js +28 -7
  21. package/dist/web-containers/source/benchmark-items-modal.js.map +1 -1
  22. package/dist/web-containers/source/benchmarks/add-items-modal.js +26 -91
  23. package/dist/web-containers/source/benchmarks/add-items-modal.js.map +1 -1
  24. package/dist/web-containers/source/benchmarks/benchmark-items-modal.js +28 -7
  25. package/dist/web-containers/source/benchmarks/benchmark-items-modal.js.map +1 -1
  26. package/dist/web-containers/source/benchmarks/create-benchmark-modal.js +166 -20
  27. package/dist/web-containers/source/benchmarks/create-benchmark-modal.js.map +1 -1
  28. package/dist/web-containers/source/benchmarks/delete-item-confirm.js +10 -9
  29. package/dist/web-containers/source/benchmarks/delete-item-confirm.js.map +1 -1
  30. package/dist/web-containers/source/benchmarks/evals-ui.js +39 -0
  31. package/dist/web-containers/source/benchmarks/evals-ui.js.map +1 -0
  32. package/dist/web-containers/source/benchmarks/index.js +30 -11
  33. package/dist/web-containers/source/benchmarks/index.js.map +1 -1
  34. package/dist/web-containers/source/benchmarks/qa-form.js +233 -0
  35. package/dist/web-containers/source/benchmarks/qa-form.js.map +1 -0
  36. package/dist/web-containers/source/canvas/canvas-rich-text-editor.js +4 -0
  37. package/dist/web-containers/source/canvas/canvas-rich-text-editor.js.map +1 -1
  38. package/dist/web-containers/source/canvas-rich-text-editor.js +4 -0
  39. package/dist/web-containers/source/canvas-rich-text-editor.js.map +1 -1
  40. package/dist/web-containers/source/components/activity-tab/activity-empty-state.js +2 -2
  41. package/dist/web-containers/source/components/activity-tab/activity-empty-state.js.map +1 -1
  42. package/dist/web-containers/source/components/canvas/canvas-rich-text-editor.js +4 -0
  43. package/dist/web-containers/source/components/canvas/canvas-rich-text-editor.js.map +1 -1
  44. package/dist/web-containers/source/components/modals/create-agent-modal/create-agent-basic-fields.js +97 -0
  45. package/dist/web-containers/source/components/modals/create-agent-modal/create-agent-basic-fields.js.map +1 -0
  46. package/dist/web-containers/source/components/modals/create-agent-modal/create-agent-form.js +5 -65
  47. package/dist/web-containers/source/components/modals/create-agent-modal/create-agent-form.js.map +1 -1
  48. package/dist/web-containers/source/components/modals/create-agent-modal/defaults.js +4 -9
  49. package/dist/web-containers/source/components/modals/create-agent-modal/defaults.js.map +1 -1
  50. package/dist/web-containers/source/components/modals/create-agent-modal/labels.js +4 -0
  51. package/dist/web-containers/source/components/modals/create-agent-modal/labels.js.map +1 -1
  52. package/dist/web-containers/source/components/modals/create-agent-modal/use-create-agent-form.js +11 -10
  53. package/dist/web-containers/source/components/modals/create-agent-modal/use-create-agent-form.js.map +1 -1
  54. package/dist/web-containers/source/components/modals/create-agent-wizard/create-agent-wizard-tab-step.js +18 -0
  55. package/dist/web-containers/source/components/modals/create-agent-wizard/create-agent-wizard-tab-step.js.map +1 -0
  56. package/dist/web-containers/source/components/modals/create-agent-wizard/create-agent-wizard.js +67 -0
  57. package/dist/web-containers/source/components/modals/create-agent-wizard/create-agent-wizard.js.map +1 -0
  58. package/dist/web-containers/source/components/modals/create-agent-wizard/use-wizard-steps.js +32 -0
  59. package/dist/web-containers/source/components/modals/create-agent-wizard/use-wizard-steps.js.map +1 -0
  60. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/datasets-tab/resource-modal/resource-dialog-layout.js +4 -4
  61. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/datasets-tab/resource-modal/resource-dialog-layout.js.map +1 -1
  62. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js +2 -2
  63. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js.map +1 -1
  64. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js +6 -6
  65. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js.map +1 -1
  66. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js +7 -6
  67. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js.map +1 -1
  68. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js +51 -43
  69. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js.map +1 -1
  70. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/index.js +68 -37
  71. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/index.js.map +1 -1
  72. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/labels.js +68 -46
  73. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/labels.js.map +1 -1
  74. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js +13 -6
  75. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js.map +1 -1
  76. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js +16 -7
  77. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js.map +1 -1
  78. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/utils.js +14 -1
  79. package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/utils.js.map +1 -1
  80. package/dist/web-containers/source/components/onboarding/onboarding-shell.js +4 -1
  81. package/dist/web-containers/source/components/onboarding/onboarding-shell.js.map +1 -1
  82. package/dist/web-containers/source/components/platform-sidebar/index.js +2 -0
  83. package/dist/web-containers/source/components/platform-sidebar/index.js.map +1 -1
  84. package/dist/web-containers/source/components/profile/benchmarks/add-items-modal.js +26 -91
  85. package/dist/web-containers/source/components/profile/benchmarks/add-items-modal.js.map +1 -1
  86. package/dist/web-containers/source/components/profile/benchmarks/benchmark-items-modal.js +28 -7
  87. package/dist/web-containers/source/components/profile/benchmarks/benchmark-items-modal.js.map +1 -1
  88. package/dist/web-containers/source/components/profile/benchmarks/create-benchmark-modal.js +166 -20
  89. package/dist/web-containers/source/components/profile/benchmarks/create-benchmark-modal.js.map +1 -1
  90. package/dist/web-containers/source/components/profile/benchmarks/delete-item-confirm.js +10 -9
  91. package/dist/web-containers/source/components/profile/benchmarks/delete-item-confirm.js.map +1 -1
  92. package/dist/web-containers/source/components/profile/benchmarks/evals-ui.js +39 -0
  93. package/dist/web-containers/source/components/profile/benchmarks/evals-ui.js.map +1 -0
  94. package/dist/web-containers/source/components/profile/benchmarks/index.js +30 -11
  95. package/dist/web-containers/source/components/profile/benchmarks/index.js.map +1 -1
  96. package/dist/web-containers/source/components/profile/benchmarks/qa-form.js +233 -0
  97. package/dist/web-containers/source/components/profile/benchmarks/qa-form.js.map +1 -0
  98. package/dist/web-containers/source/components/rich-text-editor.js +26 -3
  99. package/dist/web-containers/source/components/rich-text-editor.js.map +1 -1
  100. package/dist/web-containers/source/components/user-profile-dropdown/index.js +1 -1
  101. package/dist/web-containers/source/components/user-profile-dropdown/index.js.map +1 -1
  102. package/dist/web-containers/source/create-agent-basic-fields.js +97 -0
  103. package/dist/web-containers/source/create-agent-basic-fields.js.map +1 -0
  104. package/dist/web-containers/source/create-agent-form.js +5 -65
  105. package/dist/web-containers/source/create-agent-form.js.map +1 -1
  106. package/dist/web-containers/source/create-agent-modal/create-agent-basic-fields.js +97 -0
  107. package/dist/web-containers/source/create-agent-modal/create-agent-basic-fields.js.map +1 -0
  108. package/dist/web-containers/source/create-agent-modal/create-agent-form.js +5 -65
  109. package/dist/web-containers/source/create-agent-modal/create-agent-form.js.map +1 -1
  110. package/dist/web-containers/source/create-agent-modal/defaults.js +4 -9
  111. package/dist/web-containers/source/create-agent-modal/defaults.js.map +1 -1
  112. package/dist/web-containers/source/create-agent-modal/labels.js +4 -0
  113. package/dist/web-containers/source/create-agent-modal/labels.js.map +1 -1
  114. package/dist/web-containers/source/create-agent-modal/use-create-agent-form.js +11 -10
  115. package/dist/web-containers/source/create-agent-modal/use-create-agent-form.js.map +1 -1
  116. package/dist/web-containers/source/create-agent-wizard/create-agent-wizard-tab-step.js +18 -0
  117. package/dist/web-containers/source/create-agent-wizard/create-agent-wizard-tab-step.js.map +1 -0
  118. package/dist/web-containers/source/create-agent-wizard/create-agent-wizard.js +67 -0
  119. package/dist/web-containers/source/create-agent-wizard/create-agent-wizard.js.map +1 -0
  120. package/dist/web-containers/source/create-agent-wizard/use-wizard-steps.js +32 -0
  121. package/dist/web-containers/source/create-agent-wizard/use-wizard-steps.js.map +1 -0
  122. package/dist/web-containers/source/create-agent-wizard-tab-step.js +18 -0
  123. package/dist/web-containers/source/create-agent-wizard-tab-step.js.map +1 -0
  124. package/dist/web-containers/source/create-agent-wizard.js +67 -0
  125. package/dist/web-containers/source/create-agent-wizard.js.map +1 -0
  126. package/dist/web-containers/source/create-benchmark-modal.js +166 -20
  127. package/dist/web-containers/source/create-benchmark-modal.js.map +1 -1
  128. package/dist/web-containers/source/datasets-tab/resource-modal/resource-dialog-layout.js +4 -4
  129. package/dist/web-containers/source/datasets-tab/resource-modal/resource-dialog-layout.js.map +1 -1
  130. package/dist/web-containers/source/defaults.js +4 -9
  131. package/dist/web-containers/source/defaults.js.map +1 -1
  132. package/dist/web-containers/source/delete-experiment-modal.js +6 -6
  133. package/dist/web-containers/source/delete-experiment-modal.js.map +1 -1
  134. package/dist/web-containers/source/delete-item-confirm.js +10 -9
  135. package/dist/web-containers/source/delete-item-confirm.js.map +1 -1
  136. package/dist/web-containers/source/edit-mentor-modal/tabs/datasets-tab/resource-modal/resource-dialog-layout.js +4 -4
  137. package/dist/web-containers/source/edit-mentor-modal/tabs/datasets-tab/resource-modal/resource-dialog-layout.js.map +1 -1
  138. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js +2 -2
  139. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js.map +1 -1
  140. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js +6 -6
  141. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js.map +1 -1
  142. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js +7 -6
  143. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js.map +1 -1
  144. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js +51 -43
  145. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js.map +1 -1
  146. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/index.js +68 -37
  147. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/index.js.map +1 -1
  148. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/labels.js +68 -46
  149. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/labels.js.map +1 -1
  150. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js +13 -6
  151. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js.map +1 -1
  152. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js +16 -7
  153. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js.map +1 -1
  154. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/utils.js +14 -1
  155. package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/utils.js.map +1 -1
  156. package/dist/web-containers/source/en.json.js +120 -78
  157. package/dist/web-containers/source/en.json.js.map +1 -1
  158. package/dist/web-containers/source/es.json.js +101 -59
  159. package/dist/web-containers/source/es.json.js.map +1 -1
  160. package/dist/web-containers/source/evals-ui.js +39 -0
  161. package/dist/web-containers/source/evals-ui.js.map +1 -0
  162. package/dist/web-containers/source/evaluate-llm-picker.js +7 -6
  163. package/dist/web-containers/source/evaluate-llm-picker.js.map +1 -1
  164. package/dist/web-containers/source/evaluation-tab/benchmark-combobox.js +2 -2
  165. package/dist/web-containers/source/evaluation-tab/benchmark-combobox.js.map +1 -1
  166. package/dist/web-containers/source/evaluation-tab/delete-experiment-modal.js +6 -6
  167. package/dist/web-containers/source/evaluation-tab/delete-experiment-modal.js.map +1 -1
  168. package/dist/web-containers/source/evaluation-tab/evaluate-llm-picker.js +7 -6
  169. package/dist/web-containers/source/evaluation-tab/evaluate-llm-picker.js.map +1 -1
  170. package/dist/web-containers/source/evaluation-tab/experiment-detail-modal.js +51 -43
  171. package/dist/web-containers/source/evaluation-tab/experiment-detail-modal.js.map +1 -1
  172. package/dist/web-containers/source/evaluation-tab/index.js +68 -37
  173. package/dist/web-containers/source/evaluation-tab/index.js.map +1 -1
  174. package/dist/web-containers/source/evaluation-tab/labels.js +68 -46
  175. package/dist/web-containers/source/evaluation-tab/labels.js.map +1 -1
  176. package/dist/web-containers/source/evaluation-tab/llm-judge-modal.js +13 -6
  177. package/dist/web-containers/source/evaluation-tab/llm-judge-modal.js.map +1 -1
  178. package/dist/web-containers/source/evaluation-tab/start-experiment-modal.js +16 -7
  179. package/dist/web-containers/source/evaluation-tab/start-experiment-modal.js.map +1 -1
  180. package/dist/web-containers/source/evaluation-tab/utils.js +14 -1
  181. package/dist/web-containers/source/evaluation-tab/utils.js.map +1 -1
  182. package/dist/web-containers/source/experiment-detail-modal.js +51 -43
  183. package/dist/web-containers/source/experiment-detail-modal.js.map +1 -1
  184. package/dist/web-containers/source/fr.json.js +102 -60
  185. package/dist/web-containers/source/fr.json.js.map +1 -1
  186. package/dist/web-containers/source/i18n/messages/en.json.js +120 -78
  187. package/dist/web-containers/source/i18n/messages/en.json.js.map +1 -1
  188. package/dist/web-containers/source/i18n/messages/es.json.js +101 -59
  189. package/dist/web-containers/source/i18n/messages/es.json.js.map +1 -1
  190. package/dist/web-containers/source/i18n/messages/fr.json.js +102 -60
  191. package/dist/web-containers/source/i18n/messages/fr.json.js.map +1 -1
  192. package/dist/web-containers/source/i18n/messages/zh.json.js +91 -49
  193. package/dist/web-containers/source/i18n/messages/zh.json.js.map +1 -1
  194. package/dist/web-containers/source/index4.js +2 -2
  195. package/dist/web-containers/source/index5.js +2 -2
  196. package/dist/web-containers/source/llm-judge-modal.js +13 -6
  197. package/dist/web-containers/source/llm-judge-modal.js.map +1 -1
  198. package/dist/web-containers/source/messages/en.json.js +120 -78
  199. package/dist/web-containers/source/messages/en.json.js.map +1 -1
  200. package/dist/web-containers/source/messages/es.json.js +101 -59
  201. package/dist/web-containers/source/messages/es.json.js.map +1 -1
  202. package/dist/web-containers/source/messages/fr.json.js +102 -60
  203. package/dist/web-containers/source/messages/fr.json.js.map +1 -1
  204. package/dist/web-containers/source/messages/zh.json.js +91 -49
  205. package/dist/web-containers/source/messages/zh.json.js.map +1 -1
  206. package/dist/web-containers/source/modals/create-agent-modal/create-agent-basic-fields.js +97 -0
  207. package/dist/web-containers/source/modals/create-agent-modal/create-agent-basic-fields.js.map +1 -0
  208. package/dist/web-containers/source/modals/create-agent-modal/create-agent-form.js +5 -65
  209. package/dist/web-containers/source/modals/create-agent-modal/create-agent-form.js.map +1 -1
  210. package/dist/web-containers/source/modals/create-agent-modal/defaults.js +4 -9
  211. package/dist/web-containers/source/modals/create-agent-modal/defaults.js.map +1 -1
  212. package/dist/web-containers/source/modals/create-agent-modal/labels.js +4 -0
  213. package/dist/web-containers/source/modals/create-agent-modal/labels.js.map +1 -1
  214. package/dist/web-containers/source/modals/create-agent-modal/use-create-agent-form.js +11 -10
  215. package/dist/web-containers/source/modals/create-agent-modal/use-create-agent-form.js.map +1 -1
  216. package/dist/web-containers/source/modals/create-agent-wizard/create-agent-wizard-tab-step.js +18 -0
  217. package/dist/web-containers/source/modals/create-agent-wizard/create-agent-wizard-tab-step.js.map +1 -0
  218. package/dist/web-containers/source/modals/create-agent-wizard/create-agent-wizard.js +67 -0
  219. package/dist/web-containers/source/modals/create-agent-wizard/create-agent-wizard.js.map +1 -0
  220. package/dist/web-containers/source/modals/create-agent-wizard/use-wizard-steps.js +32 -0
  221. package/dist/web-containers/source/modals/create-agent-wizard/use-wizard-steps.js.map +1 -0
  222. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/datasets-tab/resource-modal/resource-dialog-layout.js +4 -4
  223. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/datasets-tab/resource-modal/resource-dialog-layout.js.map +1 -1
  224. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js +2 -2
  225. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js.map +1 -1
  226. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js +6 -6
  227. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js.map +1 -1
  228. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js +7 -6
  229. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js.map +1 -1
  230. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js +51 -43
  231. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js.map +1 -1
  232. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/index.js +68 -37
  233. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/index.js.map +1 -1
  234. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/labels.js +68 -46
  235. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/labels.js.map +1 -1
  236. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js +13 -6
  237. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js.map +1 -1
  238. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js +16 -7
  239. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js.map +1 -1
  240. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/utils.js +14 -1
  241. package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/utils.js.map +1 -1
  242. package/dist/web-containers/source/next/index.js +1 -0
  243. package/dist/web-containers/source/next/index.js.map +1 -1
  244. package/dist/web-containers/source/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +1 -1
  245. package/dist/web-containers/source/node_modules/.pnpm/style-to-js@1.1.21/node_modules/style-to-js/cjs/index.js +1 -1
  246. package/dist/web-containers/source/node_modules/.pnpm/style-to-object@1.0.14/node_modules/style-to-object/cjs/index.js +1 -1
  247. package/dist/web-containers/source/onboarding/onboarding-shell.js +4 -1
  248. package/dist/web-containers/source/onboarding/onboarding-shell.js.map +1 -1
  249. package/dist/web-containers/source/onboarding-shell.js +4 -1
  250. package/dist/web-containers/source/onboarding-shell.js.map +1 -1
  251. package/dist/web-containers/source/platform-sidebar/index.js +2 -0
  252. package/dist/web-containers/source/platform-sidebar/index.js.map +1 -1
  253. package/dist/web-containers/source/profile/benchmarks/add-items-modal.js +26 -91
  254. package/dist/web-containers/source/profile/benchmarks/add-items-modal.js.map +1 -1
  255. package/dist/web-containers/source/profile/benchmarks/benchmark-items-modal.js +28 -7
  256. package/dist/web-containers/source/profile/benchmarks/benchmark-items-modal.js.map +1 -1
  257. package/dist/web-containers/source/profile/benchmarks/create-benchmark-modal.js +166 -20
  258. package/dist/web-containers/source/profile/benchmarks/create-benchmark-modal.js.map +1 -1
  259. package/dist/web-containers/source/profile/benchmarks/delete-item-confirm.js +10 -9
  260. package/dist/web-containers/source/profile/benchmarks/delete-item-confirm.js.map +1 -1
  261. package/dist/web-containers/source/profile/benchmarks/evals-ui.js +39 -0
  262. package/dist/web-containers/source/profile/benchmarks/evals-ui.js.map +1 -0
  263. package/dist/web-containers/source/profile/benchmarks/index.js +30 -11
  264. package/dist/web-containers/source/profile/benchmarks/index.js.map +1 -1
  265. package/dist/web-containers/source/profile/benchmarks/qa-form.js +233 -0
  266. package/dist/web-containers/source/profile/benchmarks/qa-form.js.map +1 -0
  267. package/dist/web-containers/source/qa-form.js +233 -0
  268. package/dist/web-containers/source/qa-form.js.map +1 -0
  269. package/dist/web-containers/source/resource-dialog-layout.js +4 -4
  270. package/dist/web-containers/source/resource-dialog-layout.js.map +1 -1
  271. package/dist/web-containers/source/resource-modal/resource-dialog-layout.js +4 -4
  272. package/dist/web-containers/source/resource-modal/resource-dialog-layout.js.map +1 -1
  273. package/dist/web-containers/source/rich-text-editor.js +26 -3
  274. package/dist/web-containers/source/rich-text-editor.js.map +1 -1
  275. package/dist/web-containers/source/start-experiment-modal.js +16 -7
  276. package/dist/web-containers/source/start-experiment-modal.js.map +1 -1
  277. package/dist/web-containers/source/tabs/datasets-tab/resource-modal/resource-dialog-layout.js +4 -4
  278. package/dist/web-containers/source/tabs/datasets-tab/resource-modal/resource-dialog-layout.js.map +1 -1
  279. package/dist/web-containers/source/tabs/evaluation-tab/benchmark-combobox.js +2 -2
  280. package/dist/web-containers/source/tabs/evaluation-tab/benchmark-combobox.js.map +1 -1
  281. package/dist/web-containers/source/tabs/evaluation-tab/delete-experiment-modal.js +6 -6
  282. package/dist/web-containers/source/tabs/evaluation-tab/delete-experiment-modal.js.map +1 -1
  283. package/dist/web-containers/source/tabs/evaluation-tab/evaluate-llm-picker.js +7 -6
  284. package/dist/web-containers/source/tabs/evaluation-tab/evaluate-llm-picker.js.map +1 -1
  285. package/dist/web-containers/source/tabs/evaluation-tab/experiment-detail-modal.js +51 -43
  286. package/dist/web-containers/source/tabs/evaluation-tab/experiment-detail-modal.js.map +1 -1
  287. package/dist/web-containers/source/tabs/evaluation-tab/index.js +68 -37
  288. package/dist/web-containers/source/tabs/evaluation-tab/index.js.map +1 -1
  289. package/dist/web-containers/source/tabs/evaluation-tab/labels.js +68 -46
  290. package/dist/web-containers/source/tabs/evaluation-tab/labels.js.map +1 -1
  291. package/dist/web-containers/source/tabs/evaluation-tab/llm-judge-modal.js +13 -6
  292. package/dist/web-containers/source/tabs/evaluation-tab/llm-judge-modal.js.map +1 -1
  293. package/dist/web-containers/source/tabs/evaluation-tab/start-experiment-modal.js +16 -7
  294. package/dist/web-containers/source/tabs/evaluation-tab/start-experiment-modal.js.map +1 -1
  295. package/dist/web-containers/source/tabs/evaluation-tab/utils.js +14 -1
  296. package/dist/web-containers/source/tabs/evaluation-tab/utils.js.map +1 -1
  297. package/dist/web-containers/source/tsconfig.build.tsbuildinfo +1 -1
  298. package/dist/web-containers/source/use-create-agent-form.js +11 -10
  299. package/dist/web-containers/source/use-create-agent-form.js.map +1 -1
  300. package/dist/web-containers/source/use-wizard-steps.js +32 -0
  301. package/dist/web-containers/source/use-wizard-steps.js.map +1 -0
  302. package/dist/web-containers/source/user-profile-dropdown/index.js +1 -1
  303. package/dist/web-containers/source/user-profile-dropdown/index.js.map +1 -1
  304. package/dist/web-containers/source/web-containers/tsconfig.build.tsbuildinfo +1 -1
  305. package/dist/web-containers/source/zh.json.js +91 -49
  306. package/dist/web-containers/source/zh.json.js.map +1 -1
  307. package/dist/web-utils/playwright/evaluation-tab-helpers.d.ts +181 -68
  308. package/package.json +5 -5
@@ -1,24 +1,36 @@
1
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { useState } from 'react';
3
3
  import { useListEvalDatasetsQuery, evalTotalPages } from '@iblai/data-layer';
4
- import { Input } from '../../ui/input.js';
4
+ import { Table, TableHeader, TableRow, TableHead, TableBody, TableCell } from '../../ui/table.js';
5
5
  import { Button } from '../../ui/button.js';
6
6
  import { Spinner } from '../../spinner/index.js';
7
7
  import { AdvancedPagination } from '../../advance-pagination.js';
8
+ import { ActivityControlRow, ActivitySearchBox, ActivityControlActions, ACTIVITY_CONTROL } from '../../activity-tab/activity-layout.js';
9
+ import { ActivityEmptyState } from '../../activity-tab/activity-empty-state.js';
10
+ import '../../activity-tab/activity-phone.js';
11
+ import '../../ui/pagination.js';
8
12
  import { formatDistanceToNow } from 'date-fns';
13
+ import 'rehype-parse';
14
+ import 'rehype-remark';
15
+ import 'remark-stringify';
16
+ import 'remark-html';
17
+ import 'remark';
18
+ import '../../../node_modules/.pnpm/dompurify@3.4.18/node_modules/dompurify/dist/purify.es.js';
9
19
  import { useT } from '../../../i18n/context.js';
10
20
  import '../../../packages/i18n/dist/index.esm.js';
21
+ import { useDateFnsLocale } from '../../../i18n/date-fns-locale.js';
11
22
  import { parseEvalDate } from '../../modals/edit-mentor-modal/tabs/evaluation-tab/utils.js';
12
23
  import { CreateBenchmarkModal } from './create-benchmark-modal.js';
13
24
  import { BenchmarkItemsModal } from './benchmark-items-modal.js';
14
- import Search from '../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/search.js';
25
+ import { EVALS_DIALOG, EVALS_TABLE, IconAction } from './evals-ui.js';
15
26
  import Plus from '../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/plus.js';
16
27
  import Eye from '../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/eye.js';
17
28
 
18
29
  const PAGE_SIZE = 10;
19
- function BenchmarksTab({ tenantKey, username, }) {
30
+ function BenchmarksTab({ tenantKey, username, onBenchmarkCreated, }) {
20
31
  var _a;
21
32
  const t = useT();
33
+ const dateLocale = useDateFnsLocale();
22
34
  const [page, setPage] = useState(1);
23
35
  const [searchQuery, setSearchQuery] = useState('');
24
36
  const [showCreate, setShowCreate] = useState(false);
@@ -30,16 +42,23 @@ function BenchmarksTab({ tenantKey, username, }) {
30
42
  limit: PAGE_SIZE,
31
43
  });
32
44
  const benchmarks = (_a = data === null || data === void 0 ? void 0 : data.results) !== null && _a !== void 0 ? _a : [];
33
- const filtered = searchQuery.trim()
45
+ const isSearching = searchQuery.trim().length > 0;
46
+ const filtered = isSearching
34
47
  ? benchmarks.filter((benchmark) => benchmark.name.toLowerCase().includes(searchQuery.toLowerCase()))
35
48
  : benchmarks;
36
49
  const totalPages = evalTotalPages(data === null || data === void 0 ? void 0 : data.count, PAGE_SIZE);
37
- return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: "flex justify-between items-center gap-1 flex-wrap", children: [jsxs("div", { className: "relative mb-6 max-w-sm w-full sm:w-auto", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { type: "text", value: searchQuery, onChange: (event) => setSearchQuery(event.target.value), placeholder: t('benchmarksIndex.searchPlaceholder'), className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]", "aria-label": t('benchmarksIndex.searchAriaLabel') })] }), jsx("div", { className: "mb-6", children: jsxs(Button, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", onClick: () => setShowCreate(true), children: [jsx(Plus, { className: "h-4 w-4 mr-1" }), t('benchmarksIndex.newBenchmark')] }) })] }), isLoading ? (jsx("div", { className: "flex justify-center items-center h-64", children: jsx(Spinner, {}) })) : (jsxs(Fragment, { children: [jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[28%]", children: t('benchmarksIndex.nameColumn') }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[36%]", children: t('benchmarksIndex.descriptionColumn') }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400 w-[20%]", children: t('benchmarksIndex.createdColumn') }), jsx("th", { className: "px-6 py-3 text-right font-medium text-gray-500 dark:text-gray-400 w-[16%]", children: t('benchmarksIndex.actionsColumn') })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [filtered.map((benchmark) => (jsxs("tr", { children: [jsx("td", { className: "px-6 py-4 text-gray-900 dark:text-gray-100 max-w-0", children: jsx("div", { className: "truncate font-medium", children: benchmark.name }) }), jsx("td", { className: "px-6 py-4 text-gray-600 dark:text-gray-300 max-w-0", children: jsx("div", { className: "truncate", children: benchmark.description || '—' }) }), jsx("td", { className: "px-6 py-4 text-gray-600 dark:text-gray-300 whitespace-nowrap", children: (() => {
38
- const created = parseEvalDate(benchmark.created_at);
39
- return created ? formatDistanceToNow(created, { addSuffix: true }) : '—';
40
- })() }), jsx("td", { className: "px-6 py-4", children: jsx("div", { className: "flex justify-end gap-2", children: jsx(Button, { variant: "ghost", size: "sm", "aria-label": t('benchmarksIndex.viewItemsAriaLabel', {
41
- name: benchmark.name,
42
- }), onClick: () => setViewBenchmark(benchmark.name), children: jsx(Eye, { className: "h-4 w-4" }) }) }) })] }, benchmark.name))), filtered.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: 4, className: "px-6 py-8 text-center text-gray-500 dark:text-gray-400", children: isFetching ? t('benchmarksIndex.loading') : t('benchmarksIndex.empty') }) }))] })] }) }), totalPages > 1 && (jsx("div", { className: "mt-6", children: jsx(AdvancedPagination, { totalPages: totalPages, currentPage: page, onPageChange: setPage }) }))] })), jsx(CreateBenchmarkModal, { isOpen: showCreate, onClose: () => setShowCreate(false), tenantKey: tenantKey, username: username }), viewBenchmark && (jsx(BenchmarkItemsModal, { isOpen: !!viewBenchmark, onClose: () => setViewBenchmark(null), tenantKey: tenantKey, username: username, datasetName: viewBenchmark }))] }));
50
+ const isWaiting = isLoading || (filtered.length === 0 && isFetching);
51
+ const createdOf = (value) => {
52
+ const created = parseEvalDate(value);
53
+ return created ? formatDistanceToNow(created, { addSuffix: true, locale: dateLocale }) : '—';
54
+ };
55
+ // A new benchmark is listed first, so show the page and the filter it is on.
56
+ const handleCreated = (name) => {
57
+ setPage(1);
58
+ setSearchQuery('');
59
+ onBenchmarkCreated === null || onBenchmarkCreated === void 0 ? void 0 : onBenchmarkCreated(name);
60
+ };
61
+ return (jsxs("div", { className: "flex min-w-0 flex-col gap-4", children: [jsxs(ActivityControlRow, { children: [jsx(ActivitySearchBox, { type: "text", value: searchQuery, onChange: (event) => setSearchQuery(event.target.value), placeholder: t('benchmarksIndex.searchPlaceholder'), "aria-label": t('benchmarksIndex.searchAriaLabel') }), jsx(ActivityControlActions, { children: jsxs(Button, { type: "button", onClick: () => setShowCreate(true), className: `cursor-pointer max-md:flex-1 ${ACTIVITY_CONTROL.primaryButton}`, children: [jsx(Plus, { className: "h-4 w-4" }), t('benchmarksIndex.newBenchmark')] }) })] }), isWaiting && (jsx("div", { className: EVALS_DIALOG.loading, children: jsx(Spinner, {}) })), !isWaiting && filtered.length === 0 && (jsx(ActivityEmptyState, { className: EVALS_DIALOG.empty, children: isSearching ? t('benchmarksIndex.empty') : t('benchmarksIndex.emptyNone') })), !isWaiting && filtered.length > 0 && (jsx("div", { className: EVALS_TABLE.frame, children: jsxs(Table, { className: "table-fixed", children: [jsx(TableHeader, { children: jsxs(TableRow, { className: EVALS_TABLE.headerRow, children: [jsx(TableHead, { className: EVALS_TABLE.head, children: t('benchmarksIndex.nameColumn') }), jsx(TableHead, { className: `hidden md:table-cell ${EVALS_TABLE.head}`, children: t('benchmarksIndex.descriptionColumn') }), jsx(TableHead, { className: `hidden w-[140px] sm:table-cell ${EVALS_TABLE.head}`, children: t('benchmarksIndex.createdColumn') }), jsx(TableHead, { className: EVALS_TABLE.actionsHead, children: t('benchmarksIndex.actionsColumn') })] }) }), jsx(TableBody, { children: filtered.map((benchmark) => (jsxs(TableRow, { className: EVALS_TABLE.row, children: [jsx(TableCell, { className: `font-medium break-words ${EVALS_TABLE.cell}`, children: benchmark.name }), jsx(TableCell, { className: `hidden md:table-cell ${EVALS_TABLE.cell}`, children: jsx("div", { className: "line-clamp-2 break-words", children: benchmark.description || '—' }) }), jsx(TableCell, { className: `hidden truncate sm:table-cell ${EVALS_TABLE.cell}`, children: createdOf(benchmark.created_at) }), jsx(TableCell, { className: EVALS_TABLE.actionsCell, children: jsx(IconAction, { label: t('benchmarksIndex.viewItemsAriaLabel', { name: benchmark.name }), tooltip: t('benchmarksIndex.viewItems'), icon: Eye, onClick: () => setViewBenchmark(benchmark.name), className: EVALS_TABLE.rowAction }) })] }, benchmark.name))) })] }) })), totalPages > 1 && (jsx(AdvancedPagination, { totalPages: totalPages, currentPage: page, onPageChange: setPage })), jsx(CreateBenchmarkModal, { isOpen: showCreate, onClose: () => setShowCreate(false), tenantKey: tenantKey, username: username, onCreated: handleCreated }), viewBenchmark && (jsx(BenchmarkItemsModal, { isOpen: !!viewBenchmark, onClose: () => setViewBenchmark(null), tenantKey: tenantKey, username: username, datasetName: viewBenchmark }))] }));
43
62
  }
44
63
 
45
64
  export { BenchmarksTab as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../../src/components/profile/benchmarks/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;AAeA,MAAM,SAAS,GAAG,EAAE;AAEN,SAAU,aAAa,CAAC,EACpC,SAAS,EACT,QAAQ,GAIT,EAAA;;AACC,IAAA,MAAM,CAAC,GAAG,IAAI,EAAE;IAChB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;IACnC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC;IAClD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;IACnD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC;IAEvE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,wBAAwB,CAAC;AAC/D,QAAA,GAAG,EAAE,SAAS;AACd,QAAA,MAAM,EAAE,QAAQ;QAChB,IAAI;AACJ,QAAA,KAAK,EAAE,SAAS;AACjB,KAAA,CAAC;AAEF,IAAA,MAAM,UAAU,GAAG,CAAA,EAAA,GAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAE,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,EAAE;AACtC,IAAA,MAAM,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wD,EAAA,QAAA,EAEjE,UAAU,GAAG,CAAC,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,uBAAuB,CAAC,EAAA,CACpE,EAAA,CACF,CACN,CAAA,EAAA,CACK,IACF,EAAA,CACJ,EAEL,UAAU,GAAG,CAAC,KACbA,aAAK,SAAS,EAAC,MAAM,EAAA,QAAA,EACnBA,GAAA,CAAC,kBAAkB,EAAA,EACjB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,IAAI,EACjB,YAAY,EAAE,OAAO,EAAA,CACrB,EAAA,CACE,CACP,CAAA,EAAA,CACA,CACJ,EAEDA,GAAA,CAAC,oBAAoB,EAAA,EACnB,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,MAAM,aAAa,CAAC,KAAK,CAAC,EACnC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAAA,CAClB,EAED,aAAa,KACZA,GAAA,CAAC,mBAAmB,EAAA,EAClB,MAAM,EAAE,CAAC,CAAC,aAAa,EACvB,OAAO,EAAE,MAAM,gBAAgB,CAAC,IAAI,CAAC,EACrC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,aAAa,GAC1B,CACH,CAAA,EAAA,CACG;AAEV;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../src/components/profile/benchmarks/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,SAAS,GAAG,EAAE;AAEN,SAAU,aAAa,CAAC,EACpC,SAAS,EACT,QAAQ,EACR,kBAAkB,GAKnB,EAAA;;AACC,IAAA,MAAM,CAAC,GAAG,IAAI,EAAE;AAChB,IAAA,MAAM,UAAU,GAAG,gBAAgB,EAAE;IACrC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;IACnC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC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AAI,CACzF,EAEDA,GAAA,CAAC,oBAAoB,EAAA,EACnB,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,MAAM,aAAa,CAAC,KAAK,CAAC,EACnC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,aAAa,EAAA,CACxB,EAED,aAAa,KACZA,GAAA,CAAC,mBAAmB,EAAA,EAClB,MAAM,EAAE,CAAC,CAAC,aAAa,EACvB,OAAO,EAAE,MAAM,gBAAgB,CAAC,IAAI,CAAC,EACrC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,aAAa,EAAA,CAC1B,CACH,CAAA,EAAA,CACG;AAEV;;;;"}
@@ -0,0 +1,233 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useState, useRef, useEffect } from 'react';
3
+ import { useAddEvalDatasetItemsMutation, useUploadEvalDatasetCsvMutation } from '@iblai/data-layer';
4
+ import { Tabs, TabsList, TabsTrigger, TabsContent } from '../../ui/tabs.js';
5
+ import { Button } from '../../ui/button.js';
6
+ import { Input } from '../../ui/input.js';
7
+ import { Textarea } from '../../ui/textarea.js';
8
+ import { Label } from '../../ui/label.js';
9
+ import { FieldInfo } from '../../field-info.js';
10
+ import { useT } from '../../../i18n/context.js';
11
+ import '../../../packages/i18n/dist/index.esm.js';
12
+ import { cn } from '../../../lib/utils.js';
13
+ import { IconAction, EVALS_DIALOG } from './evals-ui.js';
14
+ import Trash2 from '../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/trash-2.js';
15
+ import Plus from '../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/plus.js';
16
+
17
+ const MAX_CSV_BYTES = 10 * 1024 * 1024;
18
+ const CSV_HEADER_BYTES = 64 * 1024;
19
+ const CSV_SAMPLE = `input,expected_output
20
+ What is the capital of France?,Paris
21
+ Who wrote 1984?,George Orwell
22
+ Explain photosynthesis in one sentence.,`;
23
+ let rowSequence = 0;
24
+ const blankRow = () => ({ key: rowSequence++, input: '', expected_output: '' });
25
+ function csvCells(line) {
26
+ const cells = [];
27
+ let cell = '';
28
+ let quoted = false;
29
+ for (let index = 0; index < line.length; index += 1) {
30
+ const char = line[index];
31
+ if (quoted) {
32
+ if (char === '"' && line[index + 1] === '"') {
33
+ cell += '"';
34
+ index += 1;
35
+ }
36
+ else if (char === '"') {
37
+ quoted = false;
38
+ }
39
+ else {
40
+ cell += char;
41
+ }
42
+ }
43
+ else if (char === '"' && cell === '') {
44
+ quoted = true;
45
+ }
46
+ else if (char === ',') {
47
+ cells.push(cell);
48
+ cell = '';
49
+ }
50
+ else {
51
+ cell += char;
52
+ }
53
+ }
54
+ cells.push(cell);
55
+ return cells;
56
+ }
57
+ /** The column names of a CSV file, or null when they cannot be read here. */
58
+ function readCsvColumns(file) {
59
+ return new Promise((resolve) => {
60
+ const reader = new FileReader();
61
+ reader.onerror = () => resolve(null);
62
+ reader.onload = () => {
63
+ if (typeof reader.result !== 'string') {
64
+ resolve(null);
65
+ return;
66
+ }
67
+ const text = reader.result.replace(/^\uFEFF/, '');
68
+ const lineEnd = text.search(/\r|\n/);
69
+ if (lineEnd === -1 && file.size > CSV_HEADER_BYTES) {
70
+ resolve(null);
71
+ return;
72
+ }
73
+ resolve(csvCells(lineEnd === -1 ? text : text.slice(0, lineEnd)));
74
+ };
75
+ reader.readAsText(file.slice(0, CSV_HEADER_BYTES));
76
+ });
77
+ }
78
+ function downloadSampleCsv() {
79
+ const blob = new Blob([CSV_SAMPLE], { type: 'text/csv;charset=utf-8;' });
80
+ const url = URL.createObjectURL(blob);
81
+ const link = document.createElement('a');
82
+ link.href = url;
83
+ link.download = 'benchmark_items_sample.csv';
84
+ document.body.appendChild(link);
85
+ link.click();
86
+ document.body.removeChild(link);
87
+ URL.revokeObjectURL(url);
88
+ }
89
+ /**
90
+ * State of the Q&A form the Add Q&A and New Benchmark dialogs share. The
91
+ * dialog owns the footer, so it reads `canSubmit` and calls `save`.
92
+ */
93
+ function useQaForm({ tenantKey, username }) {
94
+ const [mode, setMode] = useState('manual');
95
+ const [rows, setRows] = useState(() => [blankRow()]);
96
+ const [csvFile, setCsvFile] = useState(null);
97
+ const [csvProblem, setCsvProblem] = useState(null);
98
+ const [fileInputKey, setFileInputKey] = useState(0);
99
+ const latestFile = useRef(null);
100
+ const [addItems, { isLoading: isAdding }] = useAddEvalDatasetItemsMutation();
101
+ const [uploadCsv, { isLoading: isUploading }] = useUploadEvalDatasetCsvMutation();
102
+ const items = rows
103
+ .map((row) => ({
104
+ input: row.input.trim(),
105
+ expected_output: row.expected_output.trim() || undefined,
106
+ }))
107
+ .filter((item) => item.input.length > 0);
108
+ const canSubmit = mode === 'csv' ? !!csvFile && !csvProblem : items.length > 0;
109
+ // What a save would send: the showing tab first, so nothing typed or chosen
110
+ // on the other tab is lost when the showing one was left blank.
111
+ const source = mode === 'csv'
112
+ ? csvFile
113
+ ? 'csv'
114
+ : items.length > 0
115
+ ? 'manual'
116
+ : null
117
+ : items.length > 0
118
+ ? 'manual'
119
+ : csvFile && !csvProblem
120
+ ? 'csv'
121
+ : null;
122
+ const isEmpty = source === null;
123
+ const hasProblem = source === 'csv' && !!csvProblem;
124
+ // The backend refuses these two after the upload; checking here names the
125
+ // reason under the field instead of a failed save.
126
+ const chooseCsv = (file) => {
127
+ latestFile.current = file;
128
+ setCsvFile(file);
129
+ if (!file) {
130
+ setCsvProblem(null);
131
+ return;
132
+ }
133
+ if (file.size > MAX_CSV_BYTES) {
134
+ setCsvProblem('tooLarge');
135
+ return;
136
+ }
137
+ setCsvProblem(null);
138
+ void readCsvColumns(file).then((columns) => {
139
+ if (latestFile.current === file && columns && !columns.includes('input')) {
140
+ setCsvProblem('noInputColumn');
141
+ }
142
+ });
143
+ };
144
+ const updateRow = (key, change) => setRows((current) => current.map((row) => (row.key === key ? { ...row, ...change } : row)));
145
+ const removeRow = (key) => setRows((current) => (current.length > 1 ? current.filter((row) => row.key !== key) : current));
146
+ const addRow = () => setRows((current) => [...current, blankRow()]);
147
+ const reset = () => {
148
+ setMode('manual');
149
+ setRows([blankRow()]);
150
+ chooseCsv(null);
151
+ setFileInputKey((current) => current + 1);
152
+ };
153
+ /** Saves the Q&A to the benchmark and resolves to how many pairs were saved. */
154
+ const save = async (datasetName) => {
155
+ if (source === 'csv' && csvFile) {
156
+ const formData = new FormData();
157
+ formData.append('file', csvFile);
158
+ const result = await uploadCsv({
159
+ org: tenantKey,
160
+ userId: username,
161
+ datasetName,
162
+ formData,
163
+ }).unwrap();
164
+ return result.created;
165
+ }
166
+ const result = await addItems({
167
+ org: tenantKey,
168
+ userId: username,
169
+ datasetName,
170
+ body: { items },
171
+ }).unwrap();
172
+ return result.created;
173
+ };
174
+ return {
175
+ mode,
176
+ setMode,
177
+ rows,
178
+ updateRow,
179
+ removeRow,
180
+ addRow,
181
+ csvFile,
182
+ csvProblem,
183
+ chooseCsv,
184
+ fileInputKey,
185
+ canSubmit,
186
+ isEmpty,
187
+ hasProblem,
188
+ isSaving: isAdding || isUploading,
189
+ reset,
190
+ save,
191
+ };
192
+ }
193
+ const LABEL_ROW = 'flex h-4 items-center gap-2';
194
+ function QaForm({ form, disabled = false, idPrefix = '' }) {
195
+ const t = useT();
196
+ const locked = disabled || form.isSaving;
197
+ const rowCount = form.rows.length;
198
+ const removable = rowCount > 1;
199
+ // A new row lands below the fold of a long list: bring it and the button
200
+ // into view and put the cursor in its question.
201
+ const addRowButtonRef = useRef(null);
202
+ const focusNewRow = useRef(false);
203
+ useEffect(() => {
204
+ var _a, _b, _c;
205
+ if (!focusNewRow.current)
206
+ return;
207
+ focusNewRow.current = false;
208
+ (_b = (_a = addRowButtonRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView) === null || _b === void 0 ? void 0 : _b.call(_a, { block: 'nearest' });
209
+ (_c = document.getElementById(`${idPrefix}item-input-${rowCount - 1}`)) === null || _c === void 0 ? void 0 : _c.focus();
210
+ }, [rowCount, idPrefix]);
211
+ const questionLabel = t('benchmarksAddItemsModal.questionLabel');
212
+ const answerLabel = t('benchmarksAddItemsModal.answerLabel');
213
+ const csvFileLabel = t('benchmarksAddItemsModal.csvFileLabel');
214
+ const removeRowLabel = t('benchmarksAddItemsModal.removeRowAriaLabel');
215
+ const csvFileId = `${idPrefix}csv-file`;
216
+ const csvProblemId = `${csvFileId}-error`;
217
+ return (jsxs(Tabs, { value: form.mode, onValueChange: (next) => form.setMode(next), className: "grid min-w-0 gap-4", children: [jsxs(TabsList, { className: "justify-self-start", children: [jsx(TabsTrigger, { value: "manual", disabled: locked, children: t('benchmarksAddItemsModal.manualTab') }), jsx(TabsTrigger, { value: "csv", disabled: locked, children: t('benchmarksAddItemsModal.csvTab') })] }), jsxs(TabsContent, { value: "manual", className: "mt-0 grid gap-4", children: [jsx("div", { className: "grid gap-3", children: form.rows.map((row, index) => {
218
+ const questionId = `${idPrefix}item-input-${index}`;
219
+ const answerId = `${idPrefix}item-expected-${index}`;
220
+ return (jsxs("div", { className: cn('grid gap-x-2 gap-y-1.5 rounded-md border border-gray-200 p-3', removable
221
+ ? 'grid-cols-[minmax(0,1fr)_auto] sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]'
222
+ : 'grid-cols-1 sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]'), children: [jsxs("div", { className: cn(LABEL_ROW, 'col-start-1 row-start-1'), children: [jsx(Label, { htmlFor: questionId, children: questionLabel }), index === 0 && (jsx(FieldInfo, { label: questionLabel, text: t('benchmarksAddItemsModal.questionInfo') }))] }), jsx(Textarea, { id: questionId, value: row.input, onChange: (event) => form.updateRow(row.key, { input: event.target.value }), placeholder: t('benchmarksAddItemsModal.questionPlaceholder'), rows: 2, disabled: locked, className: "col-start-1 row-start-2" }), jsxs("div", { className: cn(LABEL_ROW, 'col-start-1 row-start-3 max-sm:mt-2 sm:col-start-2 sm:row-start-1'), children: [jsx(Label, { htmlFor: answerId, children: answerLabel }), index === 0 && (jsx(FieldInfo, { label: answerLabel, text: t('benchmarksAddItemsModal.answerInfo') }))] }), jsx(Textarea, { id: answerId, value: row.expected_output, onChange: (event) => form.updateRow(row.key, { expected_output: event.target.value }), placeholder: t('benchmarksAddItemsModal.answerPlaceholder'), rows: 2, disabled: locked, className: "col-start-1 row-start-4 sm:col-start-2 sm:row-start-2" }), removable && (jsx(IconAction, { label: removeRowLabel, icon: Trash2, destructive: true, disabled: locked, onClick: () => form.removeRow(row.key), className: "col-start-2 row-start-2 self-center sm:col-start-3" }))] }, row.key));
223
+ }) }), jsxs(Button, { type: "button", variant: "outline", size: "sm", ref: addRowButtonRef, disabled: locked, onClick: () => {
224
+ focusNewRow.current = true;
225
+ form.addRow();
226
+ }, className: "justify-self-start", children: [jsx(Plus, { className: "h-4 w-4" }), t('benchmarksAddItemsModal.addRow')] })] }), jsxs(TabsContent, { value: "csv", forceMount: true, hidden: form.mode !== 'csv', className: "mt-0 grid gap-4 data-[state=inactive]:hidden", children: [jsxs("div", { className: "rounded-md border border-gray-200 bg-gray-50 p-3 text-xs text-gray-600", children: [jsx("p", { className: "mb-1 text-sm font-medium text-gray-700", children: t('benchmarksAddItemsModal.csvFormatTitle') }), jsxs("ul", { className: "list-disc space-y-0.5 pl-5", children: [jsx("li", { children: t('benchmarksAddItemsModal.csvRuleEncoding') }), jsxs("li", { children: [t('benchmarksAddItemsModal.csvRuleRequiredPrefix'), ' ', jsx("code", { className: "rounded bg-white px-1", children: "input" }), ' ', t('benchmarksAddItemsModal.csvRuleRequiredSuffix')] }), jsxs("li", { children: [t('benchmarksAddItemsModal.csvRuleOptionalPrefix'), ' ', jsx("code", { className: "rounded bg-white px-1", children: "expected_output" }), ' ', t('benchmarksAddItemsModal.csvRuleOptionalSuffix')] }), jsx("li", { children: t('benchmarksAddItemsModal.csvRuleMaxSize') }), jsx("li", { children: t('benchmarksAddItemsModal.csvRuleBlankSkipped') })] }), jsx(Button, { type: "button", variant: "link", className: "mt-1 h-auto p-0 text-xs text-blue-600", onClick: downloadSampleCsv, children: t('benchmarksAddItemsModal.downloadSample') })] }), jsxs("div", { className: "grid gap-1.5", children: [jsxs("div", { className: LABEL_ROW, children: [jsx(Label, { htmlFor: csvFileId, children: csvFileLabel }), jsx(FieldInfo, { label: csvFileLabel, text: t('benchmarksAddItemsModal.csvFileInfo') })] }), jsx(Input, { id: csvFileId, type: "file", accept: ".csv,text/csv", onChange: (event) => { var _a, _b; return form.chooseCsv((_b = (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : null); }, disabled: locked, "aria-invalid": form.csvProblem ? true : undefined, "aria-describedby": form.csvProblem ? csvProblemId : undefined, className: form.csvProblem ? 'border-red-500' : undefined }, form.fileInputKey), form.csvProblem === 'tooLarge' && (jsx("p", { id: csvProblemId, role: "alert", className: EVALS_DIALOG.fieldError, children: t('benchmarksAddItemsModal.csvTooLarge') })), form.csvProblem === 'noInputColumn' && (jsx("p", { id: csvProblemId, role: "alert", className: EVALS_DIALOG.fieldError, children: t('benchmarksAddItemsModal.csvNoInputColumn') })), form.csvFile && !form.csvProblem && (jsx("p", { className: "min-w-0 text-xs wrap-anywhere text-gray-600", children: t('benchmarksAddItemsModal.selectedFile', {
227
+ name: form.csvFile.name,
228
+ size: Math.round(form.csvFile.size / 1024),
229
+ }) }))] })] })] }));
230
+ }
231
+
232
+ export { QaForm, useQaForm };
233
+ //# sourceMappingURL=qa-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qa-form.js","sources":["../../../../../../../../src/components/profile/benchmarks/qa-form.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;AAsBA,MAAM,aAAa,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI;AACtC,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI;AAElC,MAAM,UAAU,GAAG,CAAA;;;yCAGsB;AAEzC,IAAI,WAAW,GAAG,CAAC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AO,IAAI,CAAC,IAAI,CAAC,UAAU,KAC/BA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,6CAA6C,YACvD,CAAC,CAAC,sCAAsC,EAAE;AACzC,oCAAA,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;AACvB,oCAAA,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AAC3C,iCAAA,CAAC,GACA,CACL,CAAA,EAAA,CACG,CAAA,EAAA,CACM,CAAA,EAAA,CACT;AAEX;;;;"}
@@ -0,0 +1,233 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useState, useRef, useEffect } from 'react';
3
+ import { useAddEvalDatasetItemsMutation, useUploadEvalDatasetCsvMutation } from '@iblai/data-layer';
4
+ import { Tabs, TabsList, TabsTrigger, TabsContent } from '../../ui/tabs.js';
5
+ import { Button } from '../../ui/button.js';
6
+ import { Input } from '../../ui/input.js';
7
+ import { Textarea } from '../../ui/textarea.js';
8
+ import { Label } from '../../ui/label.js';
9
+ import { FieldInfo } from '../../field-info.js';
10
+ import { useT } from '../../../i18n/context.js';
11
+ import '../../../packages/i18n/dist/index.esm.js';
12
+ import { cn } from '../../../lib/utils.js';
13
+ import { IconAction, EVALS_DIALOG } from './evals-ui.js';
14
+ import Trash2 from '../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/trash-2.js';
15
+ import Plus from '../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/plus.js';
16
+
17
+ const MAX_CSV_BYTES = 10 * 1024 * 1024;
18
+ const CSV_HEADER_BYTES = 64 * 1024;
19
+ const CSV_SAMPLE = `input,expected_output
20
+ What is the capital of France?,Paris
21
+ Who wrote 1984?,George Orwell
22
+ Explain photosynthesis in one sentence.,`;
23
+ let rowSequence = 0;
24
+ const blankRow = () => ({ key: rowSequence++, input: '', expected_output: '' });
25
+ function csvCells(line) {
26
+ const cells = [];
27
+ let cell = '';
28
+ let quoted = false;
29
+ for (let index = 0; index < line.length; index += 1) {
30
+ const char = line[index];
31
+ if (quoted) {
32
+ if (char === '"' && line[index + 1] === '"') {
33
+ cell += '"';
34
+ index += 1;
35
+ }
36
+ else if (char === '"') {
37
+ quoted = false;
38
+ }
39
+ else {
40
+ cell += char;
41
+ }
42
+ }
43
+ else if (char === '"' && cell === '') {
44
+ quoted = true;
45
+ }
46
+ else if (char === ',') {
47
+ cells.push(cell);
48
+ cell = '';
49
+ }
50
+ else {
51
+ cell += char;
52
+ }
53
+ }
54
+ cells.push(cell);
55
+ return cells;
56
+ }
57
+ /** The column names of a CSV file, or null when they cannot be read here. */
58
+ function readCsvColumns(file) {
59
+ return new Promise((resolve) => {
60
+ const reader = new FileReader();
61
+ reader.onerror = () => resolve(null);
62
+ reader.onload = () => {
63
+ if (typeof reader.result !== 'string') {
64
+ resolve(null);
65
+ return;
66
+ }
67
+ const text = reader.result.replace(/^\uFEFF/, '');
68
+ const lineEnd = text.search(/\r|\n/);
69
+ if (lineEnd === -1 && file.size > CSV_HEADER_BYTES) {
70
+ resolve(null);
71
+ return;
72
+ }
73
+ resolve(csvCells(lineEnd === -1 ? text : text.slice(0, lineEnd)));
74
+ };
75
+ reader.readAsText(file.slice(0, CSV_HEADER_BYTES));
76
+ });
77
+ }
78
+ function downloadSampleCsv() {
79
+ const blob = new Blob([CSV_SAMPLE], { type: 'text/csv;charset=utf-8;' });
80
+ const url = URL.createObjectURL(blob);
81
+ const link = document.createElement('a');
82
+ link.href = url;
83
+ link.download = 'benchmark_items_sample.csv';
84
+ document.body.appendChild(link);
85
+ link.click();
86
+ document.body.removeChild(link);
87
+ URL.revokeObjectURL(url);
88
+ }
89
+ /**
90
+ * State of the Q&A form the Add Q&A and New Benchmark dialogs share. The
91
+ * dialog owns the footer, so it reads `canSubmit` and calls `save`.
92
+ */
93
+ function useQaForm({ tenantKey, username }) {
94
+ const [mode, setMode] = useState('manual');
95
+ const [rows, setRows] = useState(() => [blankRow()]);
96
+ const [csvFile, setCsvFile] = useState(null);
97
+ const [csvProblem, setCsvProblem] = useState(null);
98
+ const [fileInputKey, setFileInputKey] = useState(0);
99
+ const latestFile = useRef(null);
100
+ const [addItems, { isLoading: isAdding }] = useAddEvalDatasetItemsMutation();
101
+ const [uploadCsv, { isLoading: isUploading }] = useUploadEvalDatasetCsvMutation();
102
+ const items = rows
103
+ .map((row) => ({
104
+ input: row.input.trim(),
105
+ expected_output: row.expected_output.trim() || undefined,
106
+ }))
107
+ .filter((item) => item.input.length > 0);
108
+ const canSubmit = mode === 'csv' ? !!csvFile && !csvProblem : items.length > 0;
109
+ // What a save would send: the showing tab first, so nothing typed or chosen
110
+ // on the other tab is lost when the showing one was left blank.
111
+ const source = mode === 'csv'
112
+ ? csvFile
113
+ ? 'csv'
114
+ : items.length > 0
115
+ ? 'manual'
116
+ : null
117
+ : items.length > 0
118
+ ? 'manual'
119
+ : csvFile && !csvProblem
120
+ ? 'csv'
121
+ : null;
122
+ const isEmpty = source === null;
123
+ const hasProblem = source === 'csv' && !!csvProblem;
124
+ // The backend refuses these two after the upload; checking here names the
125
+ // reason under the field instead of a failed save.
126
+ const chooseCsv = (file) => {
127
+ latestFile.current = file;
128
+ setCsvFile(file);
129
+ if (!file) {
130
+ setCsvProblem(null);
131
+ return;
132
+ }
133
+ if (file.size > MAX_CSV_BYTES) {
134
+ setCsvProblem('tooLarge');
135
+ return;
136
+ }
137
+ setCsvProblem(null);
138
+ void readCsvColumns(file).then((columns) => {
139
+ if (latestFile.current === file && columns && !columns.includes('input')) {
140
+ setCsvProblem('noInputColumn');
141
+ }
142
+ });
143
+ };
144
+ const updateRow = (key, change) => setRows((current) => current.map((row) => (row.key === key ? { ...row, ...change } : row)));
145
+ const removeRow = (key) => setRows((current) => (current.length > 1 ? current.filter((row) => row.key !== key) : current));
146
+ const addRow = () => setRows((current) => [...current, blankRow()]);
147
+ const reset = () => {
148
+ setMode('manual');
149
+ setRows([blankRow()]);
150
+ chooseCsv(null);
151
+ setFileInputKey((current) => current + 1);
152
+ };
153
+ /** Saves the Q&A to the benchmark and resolves to how many pairs were saved. */
154
+ const save = async (datasetName) => {
155
+ if (source === 'csv' && csvFile) {
156
+ const formData = new FormData();
157
+ formData.append('file', csvFile);
158
+ const result = await uploadCsv({
159
+ org: tenantKey,
160
+ userId: username,
161
+ datasetName,
162
+ formData,
163
+ }).unwrap();
164
+ return result.created;
165
+ }
166
+ const result = await addItems({
167
+ org: tenantKey,
168
+ userId: username,
169
+ datasetName,
170
+ body: { items },
171
+ }).unwrap();
172
+ return result.created;
173
+ };
174
+ return {
175
+ mode,
176
+ setMode,
177
+ rows,
178
+ updateRow,
179
+ removeRow,
180
+ addRow,
181
+ csvFile,
182
+ csvProblem,
183
+ chooseCsv,
184
+ fileInputKey,
185
+ canSubmit,
186
+ isEmpty,
187
+ hasProblem,
188
+ isSaving: isAdding || isUploading,
189
+ reset,
190
+ save,
191
+ };
192
+ }
193
+ const LABEL_ROW = 'flex h-4 items-center gap-2';
194
+ function QaForm({ form, disabled = false, idPrefix = '' }) {
195
+ const t = useT();
196
+ const locked = disabled || form.isSaving;
197
+ const rowCount = form.rows.length;
198
+ const removable = rowCount > 1;
199
+ // A new row lands below the fold of a long list: bring it and the button
200
+ // into view and put the cursor in its question.
201
+ const addRowButtonRef = useRef(null);
202
+ const focusNewRow = useRef(false);
203
+ useEffect(() => {
204
+ var _a, _b, _c;
205
+ if (!focusNewRow.current)
206
+ return;
207
+ focusNewRow.current = false;
208
+ (_b = (_a = addRowButtonRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView) === null || _b === void 0 ? void 0 : _b.call(_a, { block: 'nearest' });
209
+ (_c = document.getElementById(`${idPrefix}item-input-${rowCount - 1}`)) === null || _c === void 0 ? void 0 : _c.focus();
210
+ }, [rowCount, idPrefix]);
211
+ const questionLabel = t('benchmarksAddItemsModal.questionLabel');
212
+ const answerLabel = t('benchmarksAddItemsModal.answerLabel');
213
+ const csvFileLabel = t('benchmarksAddItemsModal.csvFileLabel');
214
+ const removeRowLabel = t('benchmarksAddItemsModal.removeRowAriaLabel');
215
+ const csvFileId = `${idPrefix}csv-file`;
216
+ const csvProblemId = `${csvFileId}-error`;
217
+ return (jsxs(Tabs, { value: form.mode, onValueChange: (next) => form.setMode(next), className: "grid min-w-0 gap-4", children: [jsxs(TabsList, { className: "justify-self-start", children: [jsx(TabsTrigger, { value: "manual", disabled: locked, children: t('benchmarksAddItemsModal.manualTab') }), jsx(TabsTrigger, { value: "csv", disabled: locked, children: t('benchmarksAddItemsModal.csvTab') })] }), jsxs(TabsContent, { value: "manual", className: "mt-0 grid gap-4", children: [jsx("div", { className: "grid gap-3", children: form.rows.map((row, index) => {
218
+ const questionId = `${idPrefix}item-input-${index}`;
219
+ const answerId = `${idPrefix}item-expected-${index}`;
220
+ return (jsxs("div", { className: cn('grid gap-x-2 gap-y-1.5 rounded-md border border-gray-200 p-3', removable
221
+ ? 'grid-cols-[minmax(0,1fr)_auto] sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]'
222
+ : 'grid-cols-1 sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]'), children: [jsxs("div", { className: cn(LABEL_ROW, 'col-start-1 row-start-1'), children: [jsx(Label, { htmlFor: questionId, children: questionLabel }), index === 0 && (jsx(FieldInfo, { label: questionLabel, text: t('benchmarksAddItemsModal.questionInfo') }))] }), jsx(Textarea, { id: questionId, value: row.input, onChange: (event) => form.updateRow(row.key, { input: event.target.value }), placeholder: t('benchmarksAddItemsModal.questionPlaceholder'), rows: 2, disabled: locked, className: "col-start-1 row-start-2" }), jsxs("div", { className: cn(LABEL_ROW, 'col-start-1 row-start-3 max-sm:mt-2 sm:col-start-2 sm:row-start-1'), children: [jsx(Label, { htmlFor: answerId, children: answerLabel }), index === 0 && (jsx(FieldInfo, { label: answerLabel, text: t('benchmarksAddItemsModal.answerInfo') }))] }), jsx(Textarea, { id: answerId, value: row.expected_output, onChange: (event) => form.updateRow(row.key, { expected_output: event.target.value }), placeholder: t('benchmarksAddItemsModal.answerPlaceholder'), rows: 2, disabled: locked, className: "col-start-1 row-start-4 sm:col-start-2 sm:row-start-2" }), removable && (jsx(IconAction, { label: removeRowLabel, icon: Trash2, destructive: true, disabled: locked, onClick: () => form.removeRow(row.key), className: "col-start-2 row-start-2 self-center sm:col-start-3" }))] }, row.key));
223
+ }) }), jsxs(Button, { type: "button", variant: "outline", size: "sm", ref: addRowButtonRef, disabled: locked, onClick: () => {
224
+ focusNewRow.current = true;
225
+ form.addRow();
226
+ }, className: "justify-self-start", children: [jsx(Plus, { className: "h-4 w-4" }), t('benchmarksAddItemsModal.addRow')] })] }), jsxs(TabsContent, { value: "csv", forceMount: true, hidden: form.mode !== 'csv', className: "mt-0 grid gap-4 data-[state=inactive]:hidden", children: [jsxs("div", { className: "rounded-md border border-gray-200 bg-gray-50 p-3 text-xs text-gray-600", children: [jsx("p", { className: "mb-1 text-sm font-medium text-gray-700", children: t('benchmarksAddItemsModal.csvFormatTitle') }), jsxs("ul", { className: "list-disc space-y-0.5 pl-5", children: [jsx("li", { children: t('benchmarksAddItemsModal.csvRuleEncoding') }), jsxs("li", { children: [t('benchmarksAddItemsModal.csvRuleRequiredPrefix'), ' ', jsx("code", { className: "rounded bg-white px-1", children: "input" }), ' ', t('benchmarksAddItemsModal.csvRuleRequiredSuffix')] }), jsxs("li", { children: [t('benchmarksAddItemsModal.csvRuleOptionalPrefix'), ' ', jsx("code", { className: "rounded bg-white px-1", children: "expected_output" }), ' ', t('benchmarksAddItemsModal.csvRuleOptionalSuffix')] }), jsx("li", { children: t('benchmarksAddItemsModal.csvRuleMaxSize') }), jsx("li", { children: t('benchmarksAddItemsModal.csvRuleBlankSkipped') })] }), jsx(Button, { type: "button", variant: "link", className: "mt-1 h-auto p-0 text-xs text-blue-600", onClick: downloadSampleCsv, children: t('benchmarksAddItemsModal.downloadSample') })] }), jsxs("div", { className: "grid gap-1.5", children: [jsxs("div", { className: LABEL_ROW, children: [jsx(Label, { htmlFor: csvFileId, children: csvFileLabel }), jsx(FieldInfo, { label: csvFileLabel, text: t('benchmarksAddItemsModal.csvFileInfo') })] }), jsx(Input, { id: csvFileId, type: "file", accept: ".csv,text/csv", onChange: (event) => { var _a, _b; return form.chooseCsv((_b = (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : null); }, disabled: locked, "aria-invalid": form.csvProblem ? true : undefined, "aria-describedby": form.csvProblem ? csvProblemId : undefined, className: form.csvProblem ? 'border-red-500' : undefined }, form.fileInputKey), form.csvProblem === 'tooLarge' && (jsx("p", { id: csvProblemId, role: "alert", className: EVALS_DIALOG.fieldError, children: t('benchmarksAddItemsModal.csvTooLarge') })), form.csvProblem === 'noInputColumn' && (jsx("p", { id: csvProblemId, role: "alert", className: EVALS_DIALOG.fieldError, children: t('benchmarksAddItemsModal.csvNoInputColumn') })), form.csvFile && !form.csvProblem && (jsx("p", { className: "min-w-0 text-xs wrap-anywhere text-gray-600", children: t('benchmarksAddItemsModal.selectedFile', {
227
+ name: form.csvFile.name,
228
+ size: Math.round(form.csvFile.size / 1024),
229
+ }) }))] })] })] }));
230
+ }
231
+
232
+ export { QaForm, useQaForm };
233
+ //# sourceMappingURL=qa-form.js.map