@mindlogic-ai/logician-ui 2.0.0-alpha.0 → 2.0.0-alpha.2

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 (70) hide show
  1. package/dist/Markdown-AZTXUJV3.js +16 -0
  2. package/dist/{Markdown-2D5K42BY.js.map → Markdown-AZTXUJV3.js.map} +1 -1
  3. package/dist/Markdown-N4OLOBIR.mjs +3 -0
  4. package/dist/{Markdown-RJJEQN4R.mjs.map → Markdown-N4OLOBIR.mjs.map} +1 -1
  5. package/dist/chunk-C5KQ6T3M.mjs +1772 -0
  6. package/dist/chunk-C5KQ6T3M.mjs.map +1 -0
  7. package/dist/chunk-JUTI2M3P.js +1814 -0
  8. package/dist/chunk-JUTI2M3P.js.map +1 -0
  9. package/dist/index.d.mts +7 -4
  10. package/dist/index.d.ts +7 -4
  11. package/dist/index.js +213 -188
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +34 -9
  14. package/dist/index.mjs.map +1 -1
  15. package/package.json +2 -1
  16. package/src/components/Icon/IconMap.ts +16 -0
  17. package/src/components/Icon/icons/amount-usage.svg +7 -0
  18. package/src/components/Icon/icons/dashboard.svg +3 -0
  19. package/src/components/Icon/icons/faq.svg +4 -0
  20. package/src/components/Icon/icons/filled-amount-usage.svg +3 -0
  21. package/src/components/Icon/icons/filled-faq.svg +3 -0
  22. package/src/components/Icon/icons/filled-members.svg +6 -0
  23. package/src/components/Icon/icons/members.svg +4 -0
  24. package/src/components/Icon/icons/window.svg +4 -0
  25. package/src/components/LineGraph/LineGraph.tsx +8 -5
  26. package/src/components/LineGraph/LineGraph.types.ts +1 -0
  27. package/src/components/{MonthRangePicker → MonthPicker}/MonthButton/MonthButton.tsx +1 -1
  28. package/src/components/{MonthRangePicker → MonthPicker}/MonthButton/MonthButton.types.ts +1 -1
  29. package/src/components/{MonthRangePicker/MonthRangePicker.stories.tsx → MonthPicker/MonthPicker.stories.tsx} +6 -6
  30. package/src/components/{MonthRangePicker/MonthRangePicker.tsx → MonthPicker/MonthPicker.tsx} +30 -5
  31. package/src/components/{MonthRangePicker/MonthRangePicker.types.ts → MonthPicker/MonthPicker.types.ts} +4 -1
  32. package/src/components/{MonthRangePicker → MonthPicker}/_utils/isMonthInRange.ts +1 -1
  33. package/src/components/{MonthRangePicker → MonthPicker}/_utils/isMonthSelected.ts +1 -1
  34. package/src/components/MonthPicker/index.ts +2 -0
  35. package/src/index.ts +1 -1
  36. package/dist/Markdown-2D5K42BY.js +0 -16
  37. package/dist/Markdown-RJJEQN4R.mjs +0 -3
  38. package/dist/analytics-GNSHP7X3.svg +0 -1
  39. package/dist/bulb-24SQINQB.svg +0 -1
  40. package/dist/chat-TLRFEUAS.svg +0 -1
  41. package/dist/chunk-5FHXD7KR.js +0 -1735
  42. package/dist/chunk-5FHXD7KR.js.map +0 -1
  43. package/dist/chunk-WSOHBA2C.mjs +0 -1693
  44. package/dist/chunk-WSOHBA2C.mjs.map +0 -1
  45. package/dist/edit-RWL72JNM.svg +0 -1
  46. package/dist/face-55KPDCH4.svg +0 -1
  47. package/dist/filled-analytics-RBC7KWND.svg +0 -1
  48. package/dist/filled-bulb-RC7E2WSM.svg +0 -1
  49. package/dist/filled-chat-A6J44Q7A.svg +0 -1
  50. package/dist/filled-edit-NKKWFSTW.svg +0 -1
  51. package/dist/filled-face-UML5C3LB.svg +0 -1
  52. package/dist/filled-layout-HBVCSDFO.svg +0 -1
  53. package/dist/language-VBJ24OPV.svg +0 -1
  54. package/dist/layout-NDDSWNNV.svg +0 -1
  55. package/dist/pending-NF7NSBYO.svg +0 -1
  56. package/dist/receipt-MNLQIFCO.svg +0 -1
  57. package/dist/sparkles-EOEGVL6G.svg +0 -1
  58. package/dist/store-3RQPBJWG.svg +0 -1
  59. package/dist/store_active-SAOAGVKC.svg +0 -1
  60. package/dist/studio-LYPUIEFA.svg +0 -1
  61. package/dist/studio_active-BC6O66OI.svg +0 -1
  62. package/dist/vertical-ellipsis-3G4WEOCW.svg +0 -1
  63. package/src/components/MonthRangePicker/index.ts +0 -2
  64. /package/src/components/{MonthRangePicker → MonthPicker}/MonthButton/index.ts +0 -0
  65. /package/src/components/{MonthRangePicker → MonthPicker}/_utils/hasEnabledMonthsInYear.ts +0 -0
  66. /package/src/components/{MonthRangePicker → MonthPicker}/_utils/index.ts +0 -0
  67. /package/src/components/{MonthRangePicker → MonthPicker}/_utils/isMonthDisabled.ts +0 -0
  68. /package/src/components/{MonthRangePicker → MonthPicker}/_utils/isMonthInPreviewRange.ts +0 -0
  69. /package/src/components/{MonthRangePicker → MonthPicker}/_utils/isSelectionStart.ts +0 -0
  70. /package/src/components/{MonthRangePicker → MonthPicker}/constants.ts +0 -0
@@ -1,1735 +0,0 @@
1
- 'use strict';
2
-
3
- var ReactMarkdown = require('react-markdown');
4
- var react = require('@chakra-ui/react');
5
- var rehypeKatex = require('rehype-katex');
6
- var rehypeRaw = require('rehype-raw');
7
- var remarkBreaks = require('remark-breaks');
8
- var remarkFlexibleMarkers = require('remark-flexible-markers');
9
- var remarkGfm = require('remark-gfm');
10
- var remarkMath = require('remark-math');
11
- require('katex/dist/katex.min.css');
12
- var react$1 = require('react');
13
- var reactSyntaxHighlighter = require('react-syntax-highlighter');
14
- var prism = require('react-syntax-highlighter/dist/esm/styles/prism');
15
- var jsxRuntime = require('react/jsx-runtime');
16
- var framerMotion = require('framer-motion');
17
- var polished = require('polished');
18
- var bi = require('react-icons/bi');
19
- var bs = require('react-icons/bs');
20
- var ci = require('react-icons/ci');
21
- var fa = require('react-icons/fa');
22
- var fa6 = require('react-icons/fa6');
23
- var gi = require('react-icons/gi');
24
- var go = require('react-icons/go');
25
- var gr = require('react-icons/gr');
26
- var hi = require('react-icons/hi');
27
- var io = require('react-icons/io');
28
- var io5 = require('react-icons/io5');
29
- var lia = require('react-icons/lia');
30
- var lu = require('react-icons/lu');
31
- var md = require('react-icons/md');
32
- var pi = require('react-icons/pi');
33
- var rx = require('react-icons/rx');
34
- var sl = require('react-icons/sl');
35
- var tb = require('react-icons/tb');
36
-
37
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
38
-
39
- var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
40
- var rehypeKatex__default = /*#__PURE__*/_interopDefault(rehypeKatex);
41
- var rehypeRaw__default = /*#__PURE__*/_interopDefault(rehypeRaw);
42
- var remarkBreaks__default = /*#__PURE__*/_interopDefault(remarkBreaks);
43
- var remarkFlexibleMarkers__default = /*#__PURE__*/_interopDefault(remarkFlexibleMarkers);
44
- var remarkGfm__default = /*#__PURE__*/_interopDefault(remarkGfm);
45
- var remarkMath__default = /*#__PURE__*/_interopDefault(remarkMath);
46
-
47
- var __create = Object.create;
48
- var __defProp = Object.defineProperty;
49
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
50
- var __getOwnPropNames = Object.getOwnPropertyNames;
51
- var __getProtoOf = Object.getPrototypeOf;
52
- var __hasOwnProp = Object.prototype.hasOwnProperty;
53
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
54
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
55
- }) : x)(function(x) {
56
- if (typeof require !== "undefined") return require.apply(this, arguments);
57
- throw Error('Dynamic require of "' + x + '" is not supported');
58
- });
59
- var __commonJS = (cb, mod) => function __require2() {
60
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
61
- };
62
- var __copyProps = (to, from, except, desc) => {
63
- if (from && typeof from === "object" || typeof from === "function") {
64
- for (let key of __getOwnPropNames(from))
65
- if (!__hasOwnProp.call(to, key) && key !== except)
66
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
67
- }
68
- return to;
69
- };
70
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
71
- // If the importer is in node compatibility mode or this is not an ESM
72
- // file that has been converted to a CommonJS file using a Babel-
73
- // compatible transform (i.e. "__esModule" has not been set), then set
74
- // "default" to the CommonJS "module.exports" for node compatibility.
75
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
76
- mod
77
- ));
78
-
79
- // src/utils/formatTextForMarkdown.ts
80
- var formatForMarkdown = (text) => {
81
- return text?.replace(/\\n/g, " \n");
82
- };
83
-
84
- // src/translations/Defaults.translations.json
85
- var Defaults_translations_default = {
86
- get_started: {
87
- ko: "\uC2DC\uC791\uD558\uAE30",
88
- en: "Get Started",
89
- zh: "\u5F00\u59CB",
90
- ja: "\u59CB\u3081\u308B",
91
- es: "Comenzar"
92
- },
93
- next: {
94
- ko: "\uB2E4\uC74C",
95
- en: "Next",
96
- zh: "\u4E0B\u4E00\u4E2A",
97
- ja: "\u6B21",
98
- es: "Siguiente"
99
- },
100
- copy: {
101
- ko: "\uBCF5\uC0AC",
102
- en: "Copy",
103
- zh: "\u590D\u5236",
104
- ja: "\u30B3\u30D4\u30FC",
105
- es: "Copiar"
106
- },
107
- copied: {
108
- ko: "\uBCF5\uC0AC \uC644\uB8CC",
109
- en: "Copy completed",
110
- zh: "\u590D\u5236\u5B8C\u6210",
111
- ja: "\u30B3\u30D4\u30FC\u5B8C\u4E86",
112
- es: "Copia completada"
113
- },
114
- see_more: {
115
- ko: "\uB354\uBCF4\uAE30",
116
- en: "See more",
117
- zh: "\u67E5\u770B\u66F4\u591A",
118
- ja: "\u3082\u3063\u3068\u898B\u308B",
119
- es: "Ver m\xE1s"
120
- },
121
- previous: {
122
- ko: "\uC774\uC804",
123
- en: "Previous",
124
- zh: "\u4EE5\u524D",
125
- ja: "\u524D",
126
- es: "Anterior"
127
- },
128
- go_next_page_button: {
129
- ko: "\uB2E4\uC74C",
130
- en: "Next",
131
- zh: "\u4E0B\u4E00\u4E2A",
132
- ja: "\u6B21",
133
- es: "Siguiente"
134
- },
135
- pagination_range_text: {
136
- ko: "{num_total_items}\uAC1C \uC911 {range_start} - {range_end} \uD45C\uC2DC \uC911",
137
- en: "Displaying {range_start} - {range_end} of {num_total_items}",
138
- zh: "\u663E\u793A\u7B2C {range_start} - {range_end} \u9879\uFF0C\u5171 {num_total_items} \u9879",
139
- ja: "{num_total_items} \u4EF6\u4E2D {range_start} - {range_end} \u3092\u8868\u793A\u4E2D",
140
- es: "Mostrando {range_start} - {range_end} de {num_total_items}"
141
- },
142
- pagination_items_per_page: {
143
- ko: "\uD56D\uBAA9 \uC218",
144
- en: "items per page",
145
- zh: "\u6BCF\u9875\u9879\u76EE\u6570",
146
- ja: "\u30DA\u30FC\u30B8\u3054\u3068\u306E\u9805\u76EE\u6570",
147
- es: "elementos por p\xE1gina"
148
- },
149
- code_markdown_raw: {
150
- ko: "\uC6D0\uBB38",
151
- en: "Raw",
152
- zh: "\u539F\u6587",
153
- ja: "\u539F\u6587",
154
- es: "Crudo"
155
- },
156
- code_markdown_preview: {
157
- ko: "\uBBF8\uB9AC\uBCF4\uAE30",
158
- en: "Preview",
159
- zh: "\u9884\u89C8",
160
- ja: "\u30D7\u30EC\u30D3\u30E5\u30FC",
161
- es: "Vista previa"
162
- },
163
- month_range_placeholder: {
164
- ko: "\uC6D4 \uBC94\uC704 \uC120\uD0DD",
165
- en: "Select month range",
166
- zh: "\u9009\u62E9\u6708\u4EFD\u8303\u56F4",
167
- ja: "\u6708\u7BC4\u56F2\u3092\u9078\u629E",
168
- es: "Seleccionar rango de meses"
169
- },
170
- clear: {
171
- ko: "\uC9C0\uC6B0\uAE30",
172
- en: "Clear",
173
- zh: "\u6E05\u9664",
174
- ja: "\u30AF\u30EA\u30A2",
175
- es: "Borrar"
176
- },
177
- upload_your_file: {
178
- ko: "\uD30C\uC77C \uC5C5\uB85C\uB4DC",
179
- en: "Upload file",
180
- zh: "\u6587\u4EF6\u4E0A\u4F20",
181
- ja: "\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",
182
- es: "Subir archivo"
183
- }
184
- };
185
- var replaceVariables = (text, variables) => {
186
- if (!variables) return formatForMarkdown(text);
187
- const regex = /({(.*?)})/gi;
188
- const potentialKeys = text.match(regex) ?? [];
189
- const textParts = [];
190
- let lastIndex = 0;
191
- potentialKeys.forEach((potentialKey) => {
192
- const keyIndex = text.indexOf(potentialKey);
193
- textParts.push(text.slice(lastIndex, keyIndex));
194
- textParts.push(text.slice(keyIndex, keyIndex + potentialKey.length));
195
- lastIndex = keyIndex + potentialKey.length;
196
- });
197
- textParts.push(text.slice(lastIndex));
198
- const parts = textParts.map(
199
- (partText) => (
200
- // Slice to remove { and }
201
- variables[partText.slice(1, partText.length - 1)] ?? formatForMarkdown(partText)
202
- )
203
- );
204
- return parts.every((part) => typeof part === "string") ? parts.join("") : parts;
205
- };
206
- var getLanguage = () => {
207
- return "ko";
208
- };
209
- var useTranslate = (translations = {}) => {
210
- const userLanguage = getLanguage();
211
- return react$1.useCallback(
212
- (key, variables) => {
213
- const locale = userLanguage;
214
- const translation = { ...Defaults_translations_default, ...translations }[key]?.[locale] ?? key;
215
- const finalRes = replaceVariables(translation, variables);
216
- return finalRes;
217
- },
218
- [userLanguage, translations]
219
- );
220
- };
221
-
222
- // src/theme/colors.ts
223
- var colors = {
224
- primary: {
225
- lighter: "blue.50",
226
- light: "blue.300",
227
- main: "blue.900",
228
- dark: "blue.1000"
229
- },
230
- secondary: {
231
- lighter: "purple.50",
232
- light: "purple.300",
233
- main: "purple.500",
234
- dark: "purple.700"
235
- },
236
- danger: {
237
- lighter: "red.50",
238
- light: "#FFC9C9",
239
- main: "red.500",
240
- dark: "#961616"
241
- },
242
- success: {
243
- lighter: "#EBFBF1",
244
- light: "#C1F4D4",
245
- main: "#019939",
246
- dark: "#016626"
247
- },
248
- warning: {
249
- lighter: "#FFF6E7",
250
- light: "#FFE9BA",
251
- main: "yellow.400",
252
- dark: "#9D6508"
253
- },
254
- gray: {
255
- 50: "#F4F5F6",
256
- 100: "#EAECEF",
257
- 200: "#E5E7EB",
258
- 300: "#EBF0FB",
259
- 400: "#D1D4DA",
260
- 500: "#C7CAD1",
261
- 600: "#BDC1C9",
262
- 700: "#AEB2BC",
263
- 800: "#9499A5",
264
- 900: "#7F8493",
265
- 1e3: "#6B7180",
266
- 1100: "#595E6A",
267
- 1200: "#474B55",
268
- 1300: "#363840",
269
- 1400: "#24262B",
270
- 1500: "#121315"
271
- },
272
- blue: {
273
- 100: "#FDFDFF",
274
- 200: "#FAFBFE",
275
- 300: "#EFF4FF",
276
- 400: "#D6E0F7",
277
- 500: "#94b0ec",
278
- 600: "#3182ce",
279
- 700: "#6c92e4",
280
- 800: "#4272dd",
281
- 900: "#1751D0",
282
- 1e3: "#113B98"
283
- },
284
- white: "#FFFFFF",
285
- black: "#121212"
286
- };
287
-
288
- // src/theme/font.ts
289
- var inter = {
290
- style: {
291
- fontFamily: '"Inter", sans-serif'
292
- }};
293
- var noto = {
294
- style: {
295
- fontFamily: '"Noto Sans", sans-serif'
296
- }};
297
- var pretendard = {
298
- style: {
299
- fontFamily: '"Pretendard Variable", sans-serif'
300
- }};
301
-
302
- // src/theme/global.ts
303
- var global = {
304
- ":root": {
305
- "--chakra-colors-chakra-body-text": "#121315",
306
- // gray.1500 hex value
307
- "--chakra-colors-chakra-body-bg": "#FFFFFF"
308
- },
309
- html: {
310
- height: "var(--chakra-vh)",
311
- fontSize: 14,
312
- fontFamily: [
313
- pretendard.style.fontFamily,
314
- inter.style.fontFamily,
315
- noto.style.fontFamily
316
- ].join(","),
317
- overflow: "auto"
318
- },
319
- "html, body": {
320
- color: "gray.1500"
321
- // Set the default body color
322
- },
323
- "#__next": {
324
- height: "var(--chakra-vh)"
325
- },
326
- "body[data-lang='es']": {
327
- fontFamily: inter.style.fontFamily
328
- }
329
- };
330
-
331
- // src/theme/index.ts
332
- var theme = react.extendTheme({
333
- colors,
334
- semanticTokens: {
335
- colors: {
336
- ...colors,
337
- "chakra-body-text": "gray.1500",
338
- "chakra-body-bg": "white",
339
- "chakra-body-text-secondary": "gray.1200"
340
- }
341
- },
342
- styles: {
343
- global
344
- },
345
- fonts: {
346
- body: '"Pretendard Variable", "Inter", "Noto Sans", sans-serif',
347
- heading: '"Pretendard Variable", "Inter", "Noto Sans", sans-serif'
348
- },
349
- // 반응형 폰트 사이즈 - 모바일에서는 더 작은 폰트 크기, 데스크톱에서는 기존 크기 유지
350
- fontSizes: {
351
- // 커스텀 폰트 크기 토큰 (em 단위 사용)
352
- // xs: { base: '0.7em', md: '0.7em' },
353
- subtitle: { base: "0.8em", md: "0.92em" },
354
- subtext: { base: "0.8em", md: "0.92em" },
355
- p: { base: "0.9em", md: "1em" },
356
- h5: { base: "1.1em", md: "1.2em" },
357
- h4: { base: "1.25em", md: "1.44em" },
358
- h3: { base: "1.5em", md: "1.75em" },
359
- h2: { base: "2em", md: "2.5em" },
360
- h1: { base: "2.4em", md: "3em" }
361
- },
362
- radii: {
363
- none: "0",
364
- sm: "6px",
365
- md: "8px",
366
- lg: "12px",
367
- xl: "32px",
368
- full: "9999px"
369
- }
370
- });
371
- var theme_default = theme;
372
-
373
- // src/components/Card/Card.styles.ts
374
- ({
375
- bgColor: theme_default.colors.white,
376
- color: theme_default.colors.black,
377
- borderColor: theme_default.colors.gray[100]
378
- });
379
- var clickableStyles = {
380
- cursor: "pointer",
381
- _hover: {
382
- boxShadow: "lg",
383
- [".card-image"]: {
384
- // TODO: define in theme
385
- transition: "0.3s all",
386
- transform: "scale(1.05)",
387
- backgroundSize: "105%"
388
- }
389
- }
390
- };
391
- var variantStyles = {
392
- default: {},
393
- gradient: {
394
- bg: `linear-gradient(180deg, #F5F8FD 0%, #FFFFFF 100%)`,
395
- border: `1px solid`,
396
- borderColor: "blue.600"
397
- }
398
- };
399
- var Card = react$1.forwardRef(
400
- ({ clickable, variant = "default", ...rest }, ref) => {
401
- return /* @__PURE__ */ jsxRuntime.jsx(
402
- react.Card,
403
- {
404
- ref,
405
- position: "relative",
406
- bgColor: "inherit",
407
- color: "inherit",
408
- boxShadow: "none",
409
- border: "1px solid",
410
- borderColor: "gray.300",
411
- borderRadius: "lg",
412
- transition: "0.3s all",
413
- p: 8,
414
- ...clickable ? clickableStyles : {},
415
- ...variantStyles[variant],
416
- ...rest
417
- }
418
- );
419
- }
420
- );
421
- Card.displayName = "Card";
422
- var InlineCode = ({ children, ...rest }) => {
423
- return /* @__PURE__ */ jsxRuntime.jsx(
424
- react.Code,
425
- {
426
- bg: "gray.50",
427
- color: "primary.dark",
428
- borderRadius: "sm",
429
- fontSize: "p",
430
- ...rest,
431
- children
432
- }
433
- );
434
- };
435
-
436
- // src/components/SegmentedControl/SegmentedControl.styles.ts
437
- var OptionStyles = {
438
- xs: {
439
- minW: 6,
440
- paddingInlineStart: 2,
441
- paddingInlineEnd: 2,
442
- h: 6
443
- },
444
- sm: {
445
- minW: 10,
446
- paddingInlineStart: 6,
447
- paddingInlineEnd: 6,
448
- h: 8
449
- },
450
- md: {
451
- paddingInlineStart: 6,
452
- paddingInlineEnd: 6,
453
- minW: 10,
454
- h: 10
455
- },
456
- lg: {},
457
- xl: {}
458
- };
459
- var SegmentedControl = ({
460
- options,
461
- value,
462
- onSelect,
463
- borderRadius = "md",
464
- size,
465
- ...rest
466
- }) => {
467
- const [internalValue, setInternalValue] = react$1.useState(options[0].value);
468
- const theme2 = react.useTheme();
469
- const activeValue = value !== void 0 ? value : internalValue;
470
- const activeIndex = options.findIndex(
471
- (option) => option.value === activeValue
472
- );
473
- const getControlPadding = (size2 = "md") => {
474
- const paddings = {
475
- xs: theme2.space[1],
476
- sm: theme2.space[1],
477
- md: theme2.space[1],
478
- lg: {},
479
- xl: {}
480
- };
481
- return paddings[size2];
482
- };
483
- const handleSelect = (selectedValue) => {
484
- if (value === void 0) {
485
- setInternalValue(selectedValue);
486
- }
487
- if (onSelect) onSelect(selectedValue);
488
- };
489
- return /* @__PURE__ */ jsxRuntime.jsxs(
490
- react.Flex,
491
- {
492
- position: "relative",
493
- borderRadius,
494
- bg: "gray.50",
495
- ...rest,
496
- children: [
497
- /* @__PURE__ */ jsxRuntime.jsx(
498
- framerMotion.motion.div,
499
- {
500
- initial: false,
501
- animate: {
502
- x: `calc(${100 * activeIndex}% + ${getControlPadding(size)})`
503
- },
504
- transition: { type: "spring", stiffness: 300, damping: 30 },
505
- style: {
506
- position: "absolute",
507
- // @ts-expect-error - Chakra UI responsive values in Framer Motion styles
508
- top: getControlPadding(size),
509
- // @ts-expect-error - Chakra UI responsive values in Framer Motion styles
510
- bottom: getControlPadding(size),
511
- left: `calc(${activeIndex * 2} * ${getControlPadding(size)})`,
512
- width: `calc(${100 / options.length}% - 2 * ${getControlPadding(size)})`,
513
- borderRadius: theme2.radii[borderRadius],
514
- background: theme2.colors.white,
515
- boxShadow: theme2.shadows.md
516
- }
517
- }
518
- ),
519
- options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
520
- react.Button,
521
- {
522
- flex: 1,
523
- variant: "ghost",
524
- color: activeValue === option.value ? "gray.1200" : "gray.600",
525
- onClick: () => handleSelect(option.value),
526
- _hover: { bg: "transparent" },
527
- fontSize: size,
528
- ...OptionStyles[size ?? "md"],
529
- children: option.label
530
- },
531
- option.value
532
- ))
533
- ]
534
- }
535
- );
536
- };
537
- var H1 = react$1.forwardRef((props, ref) => {
538
- const theme2 = react.useTheme();
539
- return /* @__PURE__ */ jsxRuntime.jsx(
540
- react.Heading,
541
- {
542
- ref,
543
- as: "h1",
544
- fontSize: theme2.fontSizes.h1,
545
- fontWeight: "bold",
546
- ...props
547
- }
548
- );
549
- });
550
- H1.displayName = "H1";
551
- var H2 = react$1.forwardRef((props, ref) => {
552
- const theme2 = react.useTheme();
553
- return /* @__PURE__ */ jsxRuntime.jsx(
554
- react.Heading,
555
- {
556
- ref,
557
- as: "h2",
558
- fontSize: theme2.fontSizes.h2,
559
- fontWeight: "semibold",
560
- ...props
561
- }
562
- );
563
- });
564
- H2.displayName = "H2";
565
- var H3 = react$1.forwardRef((props, ref) => {
566
- const theme2 = react.useTheme();
567
- return /* @__PURE__ */ jsxRuntime.jsx(
568
- react.Heading,
569
- {
570
- ref,
571
- as: "h3",
572
- fontSize: theme2.fontSizes.h3,
573
- fontWeight: "semibold",
574
- ...props
575
- }
576
- );
577
- });
578
- H3.displayName = "H3";
579
- var H4 = react$1.forwardRef((props, ref) => {
580
- const theme2 = react.useTheme();
581
- return /* @__PURE__ */ jsxRuntime.jsx(
582
- react.Heading,
583
- {
584
- ref,
585
- as: "h4",
586
- fontSize: theme2.fontSizes.h4,
587
- fontWeight: "semibold",
588
- ...props
589
- }
590
- );
591
- });
592
- H4.displayName = "H4";
593
- var H5 = react$1.forwardRef((props, ref) => {
594
- const theme2 = react.useTheme();
595
- return /* @__PURE__ */ jsxRuntime.jsx(
596
- react.Heading,
597
- {
598
- ref,
599
- as: "h5",
600
- fontSize: theme2.fontSizes.h5,
601
- fontWeight: "bold",
602
- ...props
603
- }
604
- );
605
- });
606
- H5.displayName = "H5";
607
- var Link = react$1.forwardRef(
608
- ({ color, variant, ...rest }, ref) => {
609
- const theme2 = react.useTheme();
610
- const defaultColor = theme2.semanticTokens.colors.primary.main;
611
- const errorColor = theme2.semanticTokens.colors.danger.main;
612
- const linkColor = react.useToken(
613
- "colors",
614
- variant === "error" ? errorColor : color || defaultColor
615
- ) ?? color;
616
- const getHoverColor = () => {
617
- let hoverColor;
618
- try {
619
- hoverColor = polished.darken(0.1, linkColor);
620
- } catch (e) {
621
- hoverColor = "inherit";
622
- }
623
- return hoverColor;
624
- };
625
- return /* @__PURE__ */ jsxRuntime.jsx(
626
- react.Link,
627
- {
628
- ref,
629
- fontWeight: "semibold",
630
- color: linkColor,
631
- _hover: {
632
- color: getHoverColor()
633
- },
634
- ...rest
635
- }
636
- );
637
- }
638
- );
639
- Link.displayName = "Link";
640
- var Subtext = react$1.forwardRef((props, ref) => {
641
- const theme2 = react.useTheme();
642
- return /* @__PURE__ */ jsxRuntime.jsx(
643
- react.Text,
644
- {
645
- ref,
646
- fontSize: theme2.fontSizes.subtext,
647
- fontWeight: "regular",
648
- ...props
649
- }
650
- );
651
- });
652
- Subtext.displayName = "Subtext";
653
- var Subtitle = react$1.forwardRef((props, ref) => {
654
- const theme2 = react.useTheme();
655
- return /* @__PURE__ */ jsxRuntime.jsx(
656
- react.Text,
657
- {
658
- ref,
659
- as: "h6",
660
- fontSize: theme2.fontSizes.p,
661
- fontWeight: "medium",
662
- color: "gray.1000",
663
- ...props
664
- }
665
- );
666
- });
667
- Subtitle.displayName = "Subtitle";
668
- var Text3 = react$1.forwardRef(
669
- (props, ref) => {
670
- const theme2 = react.useTheme();
671
- return /* @__PURE__ */ jsxRuntime.jsx(
672
- react.Text,
673
- {
674
- ref,
675
- as: "p",
676
- fontSize: theme2.fontSizes.p,
677
- lineHeight: "1.5",
678
- fontWeight: "medium",
679
- color: "gray.1200",
680
- ...props
681
- }
682
- );
683
- }
684
- );
685
- Text3.displayName = "Text";
686
-
687
- // src/components/Icon/Icon.styles.ts
688
- var iconStyles = {
689
- color: theme_default.colors.black
690
- };
691
-
692
- // src/components/Icon/icons/analytics.svg
693
- var analytics_default = "./analytics-GNSHP7X3.svg";
694
-
695
- // src/components/Icon/icons/bulb.svg
696
- var bulb_default = "./bulb-24SQINQB.svg";
697
-
698
- // src/components/Icon/icons/chat.svg
699
- var chat_default = "./chat-TLRFEUAS.svg";
700
-
701
- // src/components/Icon/icons/edit.svg
702
- var edit_default = "./edit-RWL72JNM.svg";
703
-
704
- // src/components/Icon/icons/face.svg
705
- var face_default = "./face-55KPDCH4.svg";
706
-
707
- // src/components/Icon/icons/filled-analytics.svg
708
- var filled_analytics_default = "./filled-analytics-RBC7KWND.svg";
709
-
710
- // src/components/Icon/icons/filled-bulb.svg
711
- var filled_bulb_default = "./filled-bulb-RC7E2WSM.svg";
712
-
713
- // src/components/Icon/icons/filled-chat.svg
714
- var filled_chat_default = "./filled-chat-A6J44Q7A.svg";
715
-
716
- // src/components/Icon/icons/filled-edit.svg
717
- var filled_edit_default = "./filled-edit-NKKWFSTW.svg";
718
-
719
- // src/components/Icon/icons/filled-face.svg
720
- var filled_face_default = "./filled-face-UML5C3LB.svg";
721
-
722
- // src/components/Icon/icons/filled-layout.svg
723
- var filled_layout_default = "./filled-layout-HBVCSDFO.svg";
724
-
725
- // src/components/Icon/icons/language.svg
726
- var language_default = "./language-VBJ24OPV.svg";
727
-
728
- // src/components/Icon/icons/layout.svg
729
- var layout_default = "./layout-NDDSWNNV.svg";
730
-
731
- // src/components/Icon/icons/pending.svg
732
- var pending_default = "./pending-NF7NSBYO.svg";
733
-
734
- // src/components/Icon/icons/receipt.svg
735
- var receipt_default = "./receipt-MNLQIFCO.svg";
736
-
737
- // src/components/Icon/icons/sparkles.svg
738
- var sparkles_default = "./sparkles-EOEGVL6G.svg";
739
-
740
- // src/components/Icon/icons/store.svg
741
- var store_default = "./store-3RQPBJWG.svg";
742
-
743
- // src/components/Icon/icons/store_active.svg
744
- var store_active_default = "./store_active-SAOAGVKC.svg";
745
-
746
- // src/components/Icon/icons/studio.svg
747
- var studio_default = "./studio-LYPUIEFA.svg";
748
-
749
- // src/components/Icon/icons/studio_active.svg
750
- var studio_active_default = "./studio_active-BC6O66OI.svg";
751
-
752
- // src/components/Icon/icons/vertical-ellipsis.svg
753
- var vertical_ellipsis_default = "./vertical-ellipsis-3G4WEOCW.svg";
754
-
755
- // src/components/Icon/IconMap.ts
756
- var REACT_ICONS_MAP = {
757
- BiDetail: bi.BiDetail,
758
- BiExpandAlt: bi.BiExpandAlt,
759
- BsTranslate: bs.BsTranslate,
760
- CiFileOn: ci.CiFileOn,
761
- FaArchive: fa.FaArchive,
762
- FaBeer: fa.FaBeer,
763
- FaChartPie: fa.FaChartPie,
764
- FaCheck: fa6.FaCheck,
765
- FaCode: fa6.FaCode,
766
- FaGraduationCap: fa.FaGraduationCap,
767
- FaImage: fa.FaImage,
768
- FaLock: fa6.FaLock,
769
- FaMoneyBillWave: fa.FaMoneyBillWave,
770
- FaPersonChalkboard: fa6.FaPersonChalkboard,
771
- FaPrint: fa.FaPrint,
772
- FaRegQuestionCircle: fa.FaRegQuestionCircle,
773
- FaRegCopy: fa6.FaRegCopy,
774
- FaRegTrashAlt: fa.FaRegTrashAlt,
775
- FaRegUserCircle: fa.FaRegUserCircle,
776
- FaRegEye: fa.FaRegEye,
777
- FaRegEyeSlash: fa.FaRegEyeSlash,
778
- FaRotateRight: fa6.FaRotateRight,
779
- FaPlay: fa.FaPlay,
780
- FaSortAlphaDown: fa.FaSortAlphaDown,
781
- FaSortAlphaUp: fa.FaSortAlphaUp,
782
- FaSortNumericDown: fa.FaSortNumericDown,
783
- FaSortNumericUp: fa.FaSortNumericUp,
784
- FaUniversity: fa.FaUniversity,
785
- FaUserCheck: fa.FaUserCheck,
786
- FaUserClock: fa6.FaUserClock,
787
- FaUserPlus: fa.FaUserPlus,
788
- FaUsers: fa.FaUsers,
789
- GiTwoCoins: gi.GiTwoCoins,
790
- GoArrowUpRight: go.GoArrowUpRight,
791
- GoArrowDownRight: go.GoArrowDownRight,
792
- IoIosArrowForward: io.IoIosArrowForward,
793
- GrUserAdmin: gr.GrUserAdmin,
794
- HiLightningBolt: hi.HiLightningBolt,
795
- HiRefresh: hi.HiRefresh,
796
- IoAddCircleOutline: io5.IoAddCircleOutline,
797
- IoAddOutline: io5.IoAddOutline,
798
- IoCall: io5.IoCall,
799
- IoChatbubbleEllipses: io5.IoChatbubbleEllipses,
800
- IoChevronDownOutline: io5.IoChevronDownOutline,
801
- IoChevronForward: io5.IoChevronForward,
802
- IoCodeSlash: io5.IoCodeSlash,
803
- IoClose: io5.IoClose,
804
- IoCloseOutline: io5.IoCloseOutline,
805
- IoDocumentTextSharp: io5.IoDocumentTextSharp,
806
- IoIosList: io.IoIosList,
807
- IoMdLink: io.IoMdLink,
808
- IoMdSave: io.IoMdSave,
809
- IoMdThumbsUp: io.IoMdThumbsUp,
810
- IoMdThumbsDown: io.IoMdThumbsDown,
811
- IoEyeOutline: io5.IoEyeOutline,
812
- IoEyeOffOutline: io5.IoEyeOffOutline,
813
- IoFilter: io5.IoFilter,
814
- IoHome: io5.IoHome,
815
- IoIosArrowBack: io.IoIosArrowBack,
816
- IoIosAttach: io.IoIosAttach,
817
- IoIosCheckmarkCircle: io.IoIosCheckmarkCircle,
818
- IoIosAddCircleOutline: io.IoIosAddCircleOutline,
819
- IoIosMail: io.IoIosMail,
820
- IoIosShareAlt: io.IoIosShareAlt,
821
- IoMdSettings: io.IoMdSettings,
822
- IoWarningOutline: io5.IoWarningOutline,
823
- IoSearch: io5.IoSearch,
824
- IoWarning: io5.IoWarning,
825
- LuExternalLink: lu.LuExternalLink,
826
- LuDownload: lu.LuDownload,
827
- LiaNewspaper: lia.LiaNewspaper,
828
- LuBookOpenText: lu.LuBookOpenText,
829
- LuGraduationCap: lu.LuGraduationCap,
830
- LuInfo: lu.LuInfo,
831
- LuMenu: lu.LuMenu,
832
- LuReceipt: lu.LuReceipt,
833
- LuSendHorizontal: lu.LuSendHorizontal,
834
- LuUpload: lu.LuUpload,
835
- MdAnnouncement: md.MdAnnouncement,
836
- MdCardMembership: md.MdCardMembership,
837
- MdError: md.MdError,
838
- MdFilterList: md.MdFilterList,
839
- MdLogout: md.MdLogout,
840
- MdOutlineCalendarToday: md.MdOutlineCalendarToday,
841
- MdOutlinePersonPin: md.MdOutlinePersonPin,
842
- MdOutlineSpaceDashboard: md.MdOutlineSpaceDashboard,
843
- HiX: hi.HiX,
844
- MdPreview: md.MdPreview,
845
- MdSpaceDashboard: md.MdSpaceDashboard,
846
- MdThumbsUpDown: md.MdThumbsUpDown,
847
- PiChatSlashBold: pi.PiChatSlashBold,
848
- PiExam: pi.PiExam,
849
- PiGlobe: pi.PiGlobe,
850
- PiGlobeX: pi.PiGlobeX,
851
- RxDotsHorizontal: rx.RxDotsHorizontal,
852
- SlSettings: sl.SlSettings,
853
- TbAppWindowFilled: tb.TbAppWindowFilled,
854
- TbInfinity: tb.TbInfinity,
855
- TbLayoutNavbar: tb.TbLayoutNavbar,
856
- TbLockCog: tb.TbLockCog,
857
- TbMessageChatbotFilled: tb.TbMessageChatbotFilled,
858
- TbSum: tb.TbSum,
859
- TbWorldSearch: tb.TbWorldSearch
860
- };
861
- var CUSTOM_ICON_MAP = {
862
- Analytics: analytics_default,
863
- Bulb: bulb_default,
864
- Chat: chat_default,
865
- Edit: edit_default,
866
- Face: face_default,
867
- Language: language_default,
868
- Layout: layout_default,
869
- FilledAnalytics: filled_analytics_default,
870
- FilledBulb: filled_bulb_default,
871
- FilledChat: filled_chat_default,
872
- FilledEdit: filled_edit_default,
873
- FilledFace: filled_face_default,
874
- FilledLayout: filled_layout_default,
875
- Pending: pending_default,
876
- Sparkles: sparkles_default,
877
- Studio: studio_default,
878
- StudioActive: studio_active_default,
879
- Store: store_default,
880
- StoreActive: store_active_default,
881
- Receipt: receipt_default,
882
- VerticalEllipsis: vertical_ellipsis_default
883
- };
884
- var IconTypes = Object.keys({
885
- ...CUSTOM_ICON_MAP,
886
- ...REACT_ICONS_MAP
887
- }).reduce(
888
- (prevVal, currVal) => {
889
- prevVal[currVal] = currVal;
890
- return prevVal;
891
- },
892
- {}
893
- );
894
- var Icon = react$1.forwardRef(
895
- ({
896
- icon,
897
- color,
898
- boxSize = "md",
899
- // Default to 'md' size
900
- ...rest
901
- }, ref) => {
902
- const sizeMapping = {
903
- xs: "4",
904
- sm: "5",
905
- md: "6",
906
- lg: "8",
907
- xl: "10"
908
- };
909
- const mappedBoxSize = sizeMapping[boxSize] || boxSize;
910
- const [resolvedBoxSize] = react.useToken("sizes", [
911
- mappedBoxSize
912
- ]);
913
- const [resolvedColor] = react.useToken("colors", [color || ""]);
914
- if (icon in REACT_ICONS_MAP) {
915
- const IconComponent2 = react.chakra(REACT_ICONS_MAP[icon]);
916
- return /* @__PURE__ */ jsxRuntime.jsx(
917
- IconComponent2,
918
- {
919
- size: resolvedBoxSize,
920
- color: resolvedColor || color,
921
- ref,
922
- ...rest
923
- }
924
- );
925
- }
926
- let IconComponent = CUSTOM_ICON_MAP[icon];
927
- if (!IconComponent) {
928
- console.warn(
929
- `No icon component found for ${icon}. Rendering fallback icon.`
930
- );
931
- IconComponent = CUSTOM_ICON_MAP["VerticalEllipsis"];
932
- }
933
- const ChakraIcon = react.chakra(IconComponent);
934
- return /* @__PURE__ */ jsxRuntime.jsx(
935
- ChakraIcon,
936
- {
937
- ...iconStyles,
938
- color: resolvedColor,
939
- boxSize: resolvedBoxSize,
940
- ref,
941
- ...rest
942
- }
943
- );
944
- }
945
- );
946
- Icon.displayName = "Icon";
947
-
948
- // src/components/IconButton/IconButton.styles.ts
949
- var variantStyles2 = {
950
- primary: {
951
- borderColor: "primary.main",
952
- bgColor: "primary.main",
953
- color: "white",
954
- _hover: {
955
- borderColor: "blue.800",
956
- bgColor: "blue.800"
957
- }
958
- },
959
- secondary: {
960
- borderColor: "primary.light",
961
- bgColor: "primary.light",
962
- color: "primary.main",
963
- _hover: {
964
- borderColor: "blue.200",
965
- bgColor: "blue.200"
966
- }
967
- },
968
- tertiary: {
969
- borderColor: "gray.400",
970
- bgColor: "white",
971
- color: "gray.1200",
972
- _hover: {
973
- bgColor: "gray.50"
974
- }
975
- },
976
- danger: {
977
- borderColor: "danger.main",
978
- bgColor: "danger.main",
979
- color: "white",
980
- _hover: {
981
- bgColor: "red.600"
982
- }
983
- },
984
- link: {
985
- borderColor: "transparent",
986
- bgColor: "transparent",
987
- borderRadius: "none",
988
- _hover: {
989
- bgColor: "transparent"
990
- }
991
- }
992
- };
993
- var IconButton = react$1.forwardRef(
994
- ({ variant = "link", sx, ...rest }, ref) => {
995
- return /* @__PURE__ */ jsxRuntime.jsx(
996
- react.IconButton,
997
- {
998
- border: "1px solid",
999
- borderRadius: "full",
1000
- background: "transparent",
1001
- ...variantStyles2[variant],
1002
- ...rest,
1003
- ref,
1004
- sx: {
1005
- ...sx,
1006
- "& svg": {
1007
- pointerEvents: "none",
1008
- ...sx?.["& svg"]
1009
- },
1010
- "& svg *": {
1011
- pointerEvents: "none",
1012
- ...sx?.["& svg *"]
1013
- }
1014
- }
1015
- }
1016
- );
1017
- }
1018
- );
1019
- IconButton.displayName = "IconButton";
1020
- var Tooltip = react$1.forwardRef(
1021
- ({ ...rest }, ref) => {
1022
- const theme2 = react.useTheme();
1023
- return /* @__PURE__ */ jsxRuntime.jsx(
1024
- react.Tooltip,
1025
- {
1026
- bgColor: "gray.1200",
1027
- placement: "top",
1028
- fontSize: theme2.fontSizes.p,
1029
- closeOnScroll: true,
1030
- ...rest,
1031
- ref
1032
- }
1033
- );
1034
- }
1035
- );
1036
- Tooltip.displayName = "Tooltip";
1037
- var CopyButton = ({
1038
- onClick,
1039
- ...rest
1040
- }) => {
1041
- const translate = useTranslate();
1042
- const [labelText, setLabelText] = react$1.useState(
1043
- translate("copy")
1044
- );
1045
- const [isTooltipOpen, setIsTooltipOpen] = react$1.useState(
1046
- void 0
1047
- );
1048
- const handleClick = (e) => {
1049
- setLabelText(translate("copied"));
1050
- onClick?.(e);
1051
- setIsTooltipOpen(true);
1052
- const t = setTimeout(() => {
1053
- setLabelText(translate("copy"));
1054
- setIsTooltipOpen(void 0);
1055
- clearTimeout(t);
1056
- }, 3e3);
1057
- };
1058
- return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { label: labelText, isOpen: isTooltipOpen, placement: "top", children: /* @__PURE__ */ jsxRuntime.jsx(
1059
- IconButton,
1060
- {
1061
- "aria-label": "Copy code",
1062
- icon: /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: "FaRegCopy", boxSize: "sm" }),
1063
- onClick: handleClick,
1064
- p: 0,
1065
- ...rest
1066
- }
1067
- ) });
1068
- };
1069
- var Markdown = react$1.lazy(
1070
- () => import('./Markdown-2D5K42BY.js').then((module) => ({ default: module.Markdown }))
1071
- );
1072
- var Code = ({
1073
- children,
1074
- language: languageProp,
1075
- onCopy,
1076
- style = prism.a11yDark,
1077
- customStyle,
1078
- hideHeader = false,
1079
- containerProps,
1080
- ...rest
1081
- }) => {
1082
- const language = languageProp === "js" ? "javascript" : languageProp;
1083
- const translate = useTranslate();
1084
- const [isMarkdownPreviewMode, setIsMarkdownPreviewMode] = react$1.useState(false);
1085
- const handleCopyClick = () => {
1086
- onCopy?.(children);
1087
- };
1088
- const handleMarkdownModeChange = (selectedValue) => {
1089
- setIsMarkdownPreviewMode(selectedValue === "preview");
1090
- };
1091
- const handleSyntaxHighlighterClick = (e) => {
1092
- if (e.detail > 1 || window.getSelection()?.toString() !== "") {
1093
- return;
1094
- }
1095
- try {
1096
- const codeElement = e.currentTarget.querySelector("code");
1097
- if (codeElement) {
1098
- const range = document.createRange();
1099
- range.selectNodeContents(codeElement);
1100
- const selection = window.getSelection();
1101
- if (selection) {
1102
- selection.removeAllRanges();
1103
- selection.addRange(range);
1104
- }
1105
- }
1106
- } catch (error) {
1107
- console.error("Error selecting code content:", error);
1108
- }
1109
- };
1110
- return /* @__PURE__ */ jsxRuntime.jsxs(
1111
- Card,
1112
- {
1113
- p: 0,
1114
- borderRadius: "none",
1115
- ...containerProps,
1116
- className: ["ml-code", containerProps?.className].join(" "),
1117
- children: [
1118
- !hideHeader && language && /* @__PURE__ */ jsxRuntime.jsxs(
1119
- react.Flex,
1120
- {
1121
- className: "ml-code-header",
1122
- justify: "space-between",
1123
- align: "center",
1124
- px: 4,
1125
- py: 2,
1126
- bgColor: "white",
1127
- borderBottom: "1px solid",
1128
- borderColor: "primary.light",
1129
- width: "100%",
1130
- zIndex: 2,
1131
- children: [
1132
- /* @__PURE__ */ jsxRuntime.jsx(Subtext, { fontWeight: "bold", color: "gray.1200", children: /* @__PURE__ */ jsxRuntime.jsx("pre", { children: language }) }),
1133
- /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { align: "center", justify: "flex-end", gap: 2, children: [
1134
- language === "markdown" && /* @__PURE__ */ jsxRuntime.jsx(
1135
- SegmentedControl,
1136
- {
1137
- size: "sm",
1138
- options: [
1139
- {
1140
- label: translate("code_markdown_raw"),
1141
- value: "raw"
1142
- },
1143
- {
1144
- label: translate("code_markdown_preview"),
1145
- value: "preview"
1146
- }
1147
- ],
1148
- onSelect: handleMarkdownModeChange
1149
- }
1150
- ),
1151
- onCopy && /* @__PURE__ */ jsxRuntime.jsx(CopyButton, { onClick: handleCopyClick })
1152
- ] })
1153
- ]
1154
- }
1155
- ),
1156
- /* @__PURE__ */ jsxRuntime.jsx(react.Box, { overflow: "hidden", children: /* @__PURE__ */ jsxRuntime.jsx(react.Box, { position: "relative", overflowY: "scroll", h: "fit-content", p: 0, children: isMarkdownPreviewMode ? /* @__PURE__ */ jsxRuntime.jsx(react.Box, { p: 2, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(react.Spinner, {}), children: /* @__PURE__ */ jsxRuntime.jsx(
1157
- Markdown,
1158
- {
1159
- components: {
1160
- code: ({ className, ...rest2 }) => {
1161
- if (!className) {
1162
- return /* @__PURE__ */ jsxRuntime.jsx(InlineCode, { ...rest2 });
1163
- }
1164
- }
1165
- },
1166
- children
1167
- }
1168
- ) }) }) : (
1169
- // @ts-expect-error - SyntaxHighlighter type issues with React 18
1170
- /* @__PURE__ */ jsxRuntime.jsx(
1171
- reactSyntaxHighlighter.Prism,
1172
- {
1173
- language,
1174
- style,
1175
- wrapLines: true,
1176
- wrapLongLines: true,
1177
- ...rest,
1178
- customStyle: {
1179
- maxWidth: "100%",
1180
- margin: 0,
1181
- borderRadius: 0,
1182
- ...customStyle
1183
- },
1184
- onClick: handleSyntaxHighlighterClick,
1185
- children
1186
- }
1187
- )
1188
- ) }) })
1189
- ]
1190
- }
1191
- );
1192
- };
1193
-
1194
- // src/components/Table/Table.styles.ts
1195
- var getStickyStyles = (isSticky, stickyDirection = "left", scrollState, stickyOffset = 0, isLastSticky = false) => {
1196
- if (!isSticky || !scrollState) return {};
1197
- const { isScrollStart, isScrollEnd, isScrolling } = scrollState;
1198
- const isBothSticky = stickyDirection === "left" && isScrollEnd || stickyDirection === "right" && isScrollStart;
1199
- const isSingleSticky = isScrolling;
1200
- const shouldShowShadow = isLastSticky && (isSingleSticky || isBothSticky);
1201
- return {
1202
- position: "sticky",
1203
- overflow: "visible",
1204
- [stickyDirection]: `${stickyOffset}px`,
1205
- zIndex: 2,
1206
- backgroundColor: "white",
1207
- ...shouldShowShadow && {
1208
- _after: {
1209
- content: '""',
1210
- position: "absolute",
1211
- top: 0,
1212
- bottom: "-1px",
1213
- width: "32px",
1214
- insetInlineEnd: stickyDirection === "left" ? 0 : "100%",
1215
- translate: stickyDirection === "left" ? "100%" : "-8",
1216
- boxShadow: stickyDirection === "left" ? "rgba(0, 0, 0, 0.16) 8px 0px 8px -8px inset" : "rgba(0, 0, 0, 0.16) -8px 0px 8px -8px inset"
1217
- }
1218
- }
1219
- };
1220
- };
1221
- var TableContext = react$1.createContext(null);
1222
- var useTableContext = () => {
1223
- const context = react$1.useContext(TableContext);
1224
- if (!context) {
1225
- console.error("useTableContext must be used within a TableProvider");
1226
- }
1227
- return context;
1228
- };
1229
- var TableProvider = ({ children }) => {
1230
- const containerRef = react$1.useRef(null);
1231
- const [scrollState, setScrollState] = react$1.useState({
1232
- isScrollStart: true,
1233
- isScrollEnd: false,
1234
- isScrolling: false
1235
- });
1236
- const stickyColumnsRef = react$1.useRef({
1237
- leftColumnWidths: /* @__PURE__ */ new Map(),
1238
- rightColumnWidths: /* @__PURE__ */ new Map()
1239
- });
1240
- const updateScrollState = react$1.useCallback(() => {
1241
- const container = containerRef.current;
1242
- if (!container) return;
1243
- const { scrollLeft, scrollWidth, clientWidth } = container;
1244
- const isScrollStart = scrollLeft <= 1;
1245
- const isScrollEnd = Math.abs(scrollWidth - clientWidth - scrollLeft) <= 1;
1246
- setScrollState((prevState) => {
1247
- if (prevState.isScrollStart !== isScrollStart || prevState.isScrollEnd !== isScrollEnd || prevState.isScrolling !== (!isScrollStart && !isScrollEnd)) {
1248
- return {
1249
- isScrollStart,
1250
- isScrollEnd,
1251
- isScrolling: !isScrollStart && !isScrollEnd
1252
- };
1253
- }
1254
- return prevState;
1255
- });
1256
- }, []);
1257
- const setContainerRef = react$1.useCallback(
1258
- (node) => {
1259
- containerRef.current = node;
1260
- if (node) {
1261
- updateScrollState();
1262
- }
1263
- },
1264
- [updateScrollState]
1265
- );
1266
- const registerStickyColumn = react$1.useCallback(
1267
- (direction, index, width) => {
1268
- if (direction === "left") {
1269
- stickyColumnsRef.current.leftColumnWidths.set(index, width);
1270
- } else {
1271
- stickyColumnsRef.current.rightColumnWidths.set(index, width);
1272
- }
1273
- },
1274
- []
1275
- );
1276
- const getStickyOffset = react$1.useCallback(
1277
- (direction, index) => {
1278
- if (index === 0) return 0;
1279
- const widthsMap = direction === "left" ? stickyColumnsRef.current.leftColumnWidths : stickyColumnsRef.current.rightColumnWidths;
1280
- let offset = 0;
1281
- for (let i = 0; i < index; i++) {
1282
- offset += widthsMap.get(i) || 0;
1283
- }
1284
- return offset;
1285
- },
1286
- []
1287
- );
1288
- const isLastStickyColumn = react$1.useCallback(
1289
- (direction, index) => {
1290
- const widthsMap = direction === "left" ? stickyColumnsRef.current.leftColumnWidths : stickyColumnsRef.current.rightColumnWidths;
1291
- let maxIndex = -1;
1292
- for (const idx of widthsMap.keys()) {
1293
- if (idx > maxIndex) maxIndex = idx;
1294
- }
1295
- return index === maxIndex;
1296
- },
1297
- []
1298
- );
1299
- react$1.useEffect(() => {
1300
- const container = containerRef.current;
1301
- if (!container) return;
1302
- const handleScroll = () => updateScrollState();
1303
- const handleResize = () => updateScrollState();
1304
- container.addEventListener("scroll", handleScroll);
1305
- window.addEventListener("resize", handleResize);
1306
- updateScrollState();
1307
- return () => {
1308
- container.removeEventListener("scroll", handleScroll);
1309
- window.removeEventListener("resize", handleResize);
1310
- };
1311
- }, [updateScrollState]);
1312
- return /* @__PURE__ */ jsxRuntime.jsx(
1313
- TableContext.Provider,
1314
- {
1315
- value: {
1316
- ...scrollState,
1317
- setContainerRef,
1318
- registerStickyColumn,
1319
- getStickyOffset,
1320
- isLastStickyColumn
1321
- },
1322
- children
1323
- }
1324
- );
1325
- };
1326
- var Td = ({
1327
- wrap,
1328
- isSticky = false,
1329
- stickyDirection = "left",
1330
- stickyIndex = 0,
1331
- _first,
1332
- style,
1333
- className,
1334
- children,
1335
- onClick,
1336
- onMouseEnter,
1337
- onMouseLeave,
1338
- ...rest
1339
- }) => {
1340
- const cellRef = react$1.useRef(null);
1341
- const tableContext = useTableContext();
1342
- const grayColor = react.useToken("colors", "gray.300");
1343
- const paddingToken = react.useToken("space", "3");
1344
- const fontSizeToken = react.useToken("fontSizes", "p");
1345
- const spacingToken = react.useToken("space", "4");
1346
- if (!tableContext) {
1347
- const htmlProps = {
1348
- className,
1349
- onClick,
1350
- onMouseEnter,
1351
- onMouseLeave
1352
- // Add other standard HTML props as needed
1353
- };
1354
- return /* @__PURE__ */ jsxRuntime.jsx(
1355
- "td",
1356
- {
1357
- ref: cellRef,
1358
- style: {
1359
- border: 0,
1360
- borderTop: "1px solid",
1361
- borderTopColor: grayColor,
1362
- color: "inherit",
1363
- fontSize: fontSizeToken,
1364
- paddingTop: paddingToken,
1365
- paddingBottom: paddingToken,
1366
- overflow: "hidden",
1367
- textOverflow: "ellipsis",
1368
- paddingInlineStart: _first ? spacingToken : void 0,
1369
- ...wrap ? {
1370
- whiteSpace: "normal",
1371
- wordWrap: "break-word",
1372
- overflowWrap: "break-word"
1373
- } : {},
1374
- ...style
1375
- },
1376
- ...htmlProps,
1377
- children
1378
- }
1379
- );
1380
- }
1381
- const {
1382
- registerStickyColumn,
1383
- getStickyOffset,
1384
- isLastStickyColumn,
1385
- ...scrollState
1386
- } = tableContext;
1387
- react$1.useEffect(() => {
1388
- if (isSticky && cellRef.current) {
1389
- const width = cellRef.current.getBoundingClientRect().width;
1390
- registerStickyColumn(stickyDirection, stickyIndex, width);
1391
- }
1392
- }, [isSticky, registerStickyColumn, stickyDirection, stickyIndex]);
1393
- const stickyOffset = isSticky ? getStickyOffset(stickyDirection, stickyIndex) : 0;
1394
- const isLastSticky = isSticky && isLastStickyColumn(stickyDirection, stickyIndex);
1395
- const stickyStyles = getStickyStyles(
1396
- isSticky,
1397
- stickyDirection,
1398
- scrollState,
1399
- stickyOffset,
1400
- isLastSticky
1401
- );
1402
- return /* @__PURE__ */ jsxRuntime.jsx(
1403
- react.Td,
1404
- {
1405
- border: 0,
1406
- borderTop: "1px solid",
1407
- borderTopColor: "gray.300",
1408
- color: "inherit",
1409
- fontSize: "p",
1410
- py: 3,
1411
- overflow: "hidden",
1412
- textOverflow: "ellipsis",
1413
- ref: cellRef,
1414
- style,
1415
- _first: {
1416
- "&:not(:last-child)": {
1417
- paddingInlineStart: 4
1418
- },
1419
- ..._first
1420
- },
1421
- ...wrap ? {
1422
- whiteSpace: "normal",
1423
- wordWrap: "break-word",
1424
- overflowWrap: "break-word"
1425
- } : {},
1426
- ...stickyStyles,
1427
- ...rest,
1428
- children
1429
- }
1430
- );
1431
- };
1432
- Td.displayName = "Td";
1433
- var Tr = ({ ...rest }) => {
1434
- return /* @__PURE__ */ jsxRuntime.jsx(react.Tr, { h: 12, ...rest });
1435
- };
1436
- var ExpandingTr = ({
1437
- children,
1438
- expandedContent,
1439
- isExpanded,
1440
- onExpandChange,
1441
- expandedRowProps,
1442
- ...rest
1443
- }) => {
1444
- const childrenArray = react$1.Children.toArray(children);
1445
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1446
- /* @__PURE__ */ jsxRuntime.jsx(Tr, { ...rest, children }),
1447
- /* @__PURE__ */ jsxRuntime.jsx(Tr, { h: isExpanded ? void 0 : 0, ...expandedRowProps, children: /* @__PURE__ */ jsxRuntime.jsx(Td, { colSpan: childrenArray.length, p: 0, children: /* @__PURE__ */ jsxRuntime.jsx(react.Collapse, { in: isExpanded, children: expandedContent }) }) })
1448
- ] });
1449
- };
1450
- var Table = ({ ...rest }) => {
1451
- return /* @__PURE__ */ jsxRuntime.jsx(react.Table, { ...rest });
1452
- };
1453
- var TableContainerInner = react$1.forwardRef(
1454
- ({ children, ...rest }, ref) => {
1455
- const { setContainerRef } = useTableContext();
1456
- const handleRef = react$1.useCallback(
1457
- (node) => {
1458
- if (typeof ref === "function") {
1459
- ref(node);
1460
- } else if (ref) {
1461
- ref.current = node;
1462
- }
1463
- setContainerRef(node);
1464
- },
1465
- [ref, setContainerRef]
1466
- );
1467
- return /* @__PURE__ */ jsxRuntime.jsx(
1468
- react.TableContainer,
1469
- {
1470
- border: "1px solid",
1471
- borderRadius: "md",
1472
- borderColor: "gray.300",
1473
- ref: handleRef,
1474
- ...rest,
1475
- children
1476
- }
1477
- );
1478
- }
1479
- );
1480
- TableContainerInner.displayName = "TableContainerInner";
1481
- var TableContainer = react$1.forwardRef(
1482
- (props, ref) => {
1483
- return /* @__PURE__ */ jsxRuntime.jsx(TableProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(TableContainerInner, { ...props, ref }) });
1484
- }
1485
- );
1486
- TableContainer.displayName = "TableContainer";
1487
- var Tbody = react$1.forwardRef(
1488
- (props, ref) => {
1489
- return /* @__PURE__ */ jsxRuntime.jsx(react.Tbody, { ref, color: "gray.1500", fontWeight: "medium", ...props });
1490
- }
1491
- );
1492
- Tbody.displayName = "Tbody";
1493
- var Th = react$1.forwardRef(
1494
- ({
1495
- isSticky = false,
1496
- stickyDirection = "left",
1497
- stickyIndex = 0,
1498
- style,
1499
- className,
1500
- children,
1501
- onClick,
1502
- onMouseEnter,
1503
- onMouseLeave,
1504
- ...rest
1505
- }, forwardedRef) => {
1506
- const tableContext = useTableContext();
1507
- const measureNodeRef = react$1.useRef(null);
1508
- const fontSizeToken = react.useToken("fontSizes", "subtitle");
1509
- const spacingToken = react.useToken("space", "4");
1510
- if (!tableContext) {
1511
- const htmlProps = {
1512
- className,
1513
- onClick,
1514
- onMouseEnter,
1515
- onMouseLeave
1516
- // Add other standard HTML props as needed
1517
- };
1518
- const setRefsForRegularTh = react$1.useCallback(
1519
- (node) => {
1520
- measureNodeRef.current = node;
1521
- if (typeof forwardedRef === "function") {
1522
- forwardedRef(node);
1523
- } else if (forwardedRef) {
1524
- forwardedRef.current = node;
1525
- }
1526
- },
1527
- [forwardedRef]
1528
- );
1529
- return /* @__PURE__ */ jsxRuntime.jsx(
1530
- "th",
1531
- {
1532
- ref: setRefsForRegularTh,
1533
- style: {
1534
- color: "inherit",
1535
- fontWeight: "inherit",
1536
- fontSize: fontSizeToken,
1537
- overflow: "hidden",
1538
- textOverflow: "ellipsis",
1539
- paddingInlineStart: spacingToken,
1540
- ...style
1541
- },
1542
- ...htmlProps,
1543
- children
1544
- }
1545
- );
1546
- }
1547
- const {
1548
- registerStickyColumn,
1549
- getStickyOffset,
1550
- isLastStickyColumn,
1551
- ...scrollState
1552
- } = tableContext;
1553
- react$1.useEffect(() => {
1554
- if (isSticky && measureNodeRef.current) {
1555
- const width = measureNodeRef.current.getBoundingClientRect().width;
1556
- registerStickyColumn(stickyDirection, stickyIndex, width);
1557
- }
1558
- }, [isSticky, registerStickyColumn, stickyDirection, stickyIndex]);
1559
- const setRefs = react$1.useCallback(
1560
- (node) => {
1561
- measureNodeRef.current = node;
1562
- if (typeof forwardedRef === "function") {
1563
- forwardedRef(node);
1564
- } else if (forwardedRef) {
1565
- forwardedRef.current = node;
1566
- }
1567
- },
1568
- [forwardedRef]
1569
- );
1570
- const stickyOffset = isSticky ? getStickyOffset(stickyDirection, stickyIndex) : 0;
1571
- const isLastSticky = isSticky && isLastStickyColumn(stickyDirection, stickyIndex);
1572
- const stickyStyles = getStickyStyles(
1573
- isSticky,
1574
- stickyDirection,
1575
- scrollState,
1576
- stickyOffset,
1577
- isLastSticky
1578
- );
1579
- return /* @__PURE__ */ jsxRuntime.jsx(
1580
- react.Th,
1581
- {
1582
- color: "inherit",
1583
- fontWeight: "inherit",
1584
- fontSize: "subtitle",
1585
- overflow: "hidden",
1586
- textOverflow: "ellipsis",
1587
- ref: setRefs,
1588
- style,
1589
- _first: {
1590
- "&:not(:last-child)": {
1591
- paddingInlineStart: 4
1592
- }
1593
- },
1594
- ...stickyStyles,
1595
- ...rest,
1596
- children
1597
- }
1598
- );
1599
- }
1600
- );
1601
- Th.displayName = "Th";
1602
- var Thead = ({ ...rest }) => {
1603
- return /* @__PURE__ */ jsxRuntime.jsx(react.Thead, { color: "gray.800", fontWeight: "medium", ...rest });
1604
- };
1605
-
1606
- // src/components/Markdown/Markdown.module.css
1607
- var Markdown_default = {};
1608
- var H1Wrapper = (props) => /* @__PURE__ */ jsxRuntime.jsx(H1, { ...props });
1609
- var H2Wrapper = (props) => /* @__PURE__ */ jsxRuntime.jsx(H2, { ...props });
1610
- var H3Wrapper = (props) => /* @__PURE__ */ jsxRuntime.jsx(H3, { ...props });
1611
- var H4Wrapper = (props) => /* @__PURE__ */ jsxRuntime.jsx(H4, { ...props });
1612
- var H5Wrapper = (props) => /* @__PURE__ */ jsxRuntime.jsx(H5, { ...props });
1613
- var SubtitleWrapper = (props) => /* @__PURE__ */ jsxRuntime.jsx(Subtitle, { ...props });
1614
- var TheadWrapper = (props) => /* @__PURE__ */ jsxRuntime.jsx(Thead, { ...props });
1615
- var TbodyWrapper = (props) => /* @__PURE__ */ jsxRuntime.jsx(Tbody, { ...props });
1616
- var TrWrapper = (props) => /* @__PURE__ */ jsxRuntime.jsx(Tr, { ...props });
1617
- var TdWrapper = (props) => /* @__PURE__ */ jsxRuntime.jsx(Td, { ...props });
1618
- var ThWrapper = (props) => /* @__PURE__ */ jsxRuntime.jsx(Th, { ...props });
1619
- var baseMarkdownComponents = {
1620
- h1: H1Wrapper,
1621
- h2: H2Wrapper,
1622
- h3: H3Wrapper,
1623
- h4: H4Wrapper,
1624
- h5: H5Wrapper,
1625
- h6: SubtitleWrapper,
1626
- // The key fix: instead of trying to unwrap pre/code combinations,
1627
- // we customize just the code element to detect if it's a code block
1628
- code: ({ inline, className, children, ...props }) => {
1629
- if (inline || !className) {
1630
- return /* @__PURE__ */ jsxRuntime.jsx(InlineCode, { ...props, children });
1631
- }
1632
- const language = className.match(/language-(.*)/)?.[1];
1633
- return /* @__PURE__ */ jsxRuntime.jsx(
1634
- Code,
1635
- {
1636
- language,
1637
- onCopy: (textToCopy) => {
1638
- navigator.clipboard.writeText(textToCopy).then(() => {
1639
- console.log("Text copied to clipboard");
1640
- }).catch((err) => {
1641
- console.error("Could not copy text to clipboard:", err);
1642
- });
1643
- },
1644
- containerProps: { mb: 4, className },
1645
- ...props,
1646
- children
1647
- }
1648
- );
1649
- },
1650
- // Make the pre tag a no-op that just renders children
1651
- pre: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children }),
1652
- p: (props) => /* @__PURE__ */ jsxRuntime.jsx(Text3, { color: "inherit", ...props }),
1653
- a: ({ style, ...rest }) => (
1654
- // `children` should be inside ...rest
1655
- /* @__PURE__ */ jsxRuntime.jsx(Link, { target: "_blank", ...rest })
1656
- ),
1657
- ol: ({ style, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
1658
- "ol",
1659
- {
1660
- style: { paddingInlineStart: "22px", color: "inherit", ...style },
1661
- ...rest
1662
- }
1663
- ),
1664
- ul: ({ style, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
1665
- "ul",
1666
- {
1667
- style: { paddingInlineStart: "22px", color: "inherit", ...style },
1668
- ...rest
1669
- }
1670
- ),
1671
- img: ({ style, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("img", { style: { maxWidth: "100%", ...style }, alt: "chat-image", ...rest }),
1672
- table: (props) => /* @__PURE__ */ jsxRuntime.jsx(TableContainer, { mt: 4, children: /* @__PURE__ */ jsxRuntime.jsx(Table, { ...props }) }),
1673
- thead: TheadWrapper,
1674
- tbody: TbodyWrapper,
1675
- tr: TrWrapper,
1676
- td: TdWrapper,
1677
- th: ThWrapper
1678
- };
1679
- var Markdown2 = ({
1680
- className,
1681
- components,
1682
- children,
1683
- ...rest
1684
- }) => {
1685
- const allComponents = { ...baseMarkdownComponents, ...components };
1686
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: [Markdown_default.markdownStyles, className].join(" "), children: /* @__PURE__ */ jsxRuntime.jsx(
1687
- ReactMarkdown__default.default,
1688
- {
1689
- remarkPlugins: [
1690
- remarkGfm__default.default,
1691
- remarkFlexibleMarkers__default.default,
1692
- remarkBreaks__default.default,
1693
- remarkMath__default.default
1694
- ],
1695
- rehypePlugins: [rehypeRaw__default.default, rehypeKatex__default.default],
1696
- components: allComponents,
1697
- ...rest,
1698
- children: formatForMarkdown(children ?? "")
1699
- }
1700
- ) });
1701
- };
1702
-
1703
- exports.Card = Card;
1704
- exports.Code = Code;
1705
- exports.ExpandingTr = ExpandingTr;
1706
- exports.H1 = H1;
1707
- exports.H2 = H2;
1708
- exports.H3 = H3;
1709
- exports.H4 = H4;
1710
- exports.H5 = H5;
1711
- exports.Icon = Icon;
1712
- exports.IconButton = IconButton;
1713
- exports.IconTypes = IconTypes;
1714
- exports.InlineCode = InlineCode;
1715
- exports.Markdown = Markdown2;
1716
- exports.SegmentedControl = SegmentedControl;
1717
- exports.Subtext = Subtext;
1718
- exports.Subtitle = Subtitle;
1719
- exports.Table = Table;
1720
- exports.TableContainer = TableContainer;
1721
- exports.Tbody = Tbody;
1722
- exports.Td = Td;
1723
- exports.Text = Text3;
1724
- exports.Th = Th;
1725
- exports.Thead = Thead;
1726
- exports.Tooltip = Tooltip;
1727
- exports.Tr = Tr;
1728
- exports.__commonJS = __commonJS;
1729
- exports.__require = __require;
1730
- exports.__toESM = __toESM;
1731
- exports.baseMarkdownComponents = baseMarkdownComponents;
1732
- exports.theme_default = theme_default;
1733
- exports.useTranslate = useTranslate;
1734
- //# sourceMappingURL=chunk-5FHXD7KR.js.map
1735
- //# sourceMappingURL=chunk-5FHXD7KR.js.map