@memori.ai/memori-react 8.29.1 → 8.30.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 (142) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +1 -1
  3. package/dist/components/Chat/Chat.css +110 -9
  4. package/dist/components/Chat/Chat.d.ts +1 -0
  5. package/dist/components/Chat/Chat.js +72 -5
  6. package/dist/components/Chat/Chat.js.map +1 -1
  7. package/dist/components/ChatBubble/ChatBubble.d.ts +1 -0
  8. package/dist/components/ChatBubble/ChatBubble.js +2 -2
  9. package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
  10. package/dist/components/ChatInputs/ChatInputs.js +2 -11
  11. package/dist/components/ChatInputs/ChatInputs.js.map +1 -1
  12. package/dist/components/DrawerFooter/DrawerFooter.css +62 -0
  13. package/dist/components/DrawerFooter/DrawerFooter.d.ts +12 -0
  14. package/dist/components/DrawerFooter/DrawerFooter.js +10 -0
  15. package/dist/components/DrawerFooter/DrawerFooter.js.map +1 -0
  16. package/dist/components/MemoriWidget/MemoriWidget.d.ts +2 -1
  17. package/dist/components/MemoriWidget/MemoriWidget.js +13 -3
  18. package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
  19. package/dist/components/UploadButton/UploadButton.js +8 -14
  20. package/dist/components/UploadButton/UploadButton.js.map +1 -1
  21. package/dist/components/UploadButton/UploadDocuments/UploadDocuments.d.ts +0 -1
  22. package/dist/components/UploadButton/UploadDocuments/UploadDocuments.js +1 -20
  23. package/dist/components/UploadButton/UploadDocuments/UploadDocuments.js.map +1 -1
  24. package/dist/components/layouts/fullpage.css +117 -0
  25. package/dist/helpers/constants.d.ts +1 -2
  26. package/dist/helpers/constants.js +2 -3
  27. package/dist/helpers/constants.js.map +1 -1
  28. package/dist/helpers/llmUsage.d.ts +60 -0
  29. package/dist/helpers/llmUsage.js +223 -0
  30. package/dist/helpers/llmUsage.js.map +1 -0
  31. package/dist/helpers/userMessage.d.ts +2 -0
  32. package/dist/helpers/userMessage.js +23 -0
  33. package/dist/helpers/userMessage.js.map +1 -0
  34. package/dist/icons/FacebookIcon.d.ts +3 -0
  35. package/dist/icons/FacebookIcon.js +6 -0
  36. package/dist/icons/FacebookIcon.js.map +1 -0
  37. package/dist/icons/LinkedinIcon.d.ts +3 -0
  38. package/dist/icons/LinkedinIcon.js +6 -0
  39. package/dist/icons/LinkedinIcon.js.map +1 -0
  40. package/dist/icons/TelegramIcon.d.ts +3 -0
  41. package/dist/icons/TelegramIcon.js +6 -0
  42. package/dist/icons/TelegramIcon.js.map +1 -0
  43. package/dist/icons/TwitterIcon.d.ts +3 -0
  44. package/dist/icons/TwitterIcon.js +6 -0
  45. package/dist/icons/TwitterIcon.js.map +1 -0
  46. package/dist/icons/WhatsappIcon.d.ts +3 -0
  47. package/dist/icons/WhatsappIcon.js +6 -0
  48. package/dist/icons/WhatsappIcon.js.map +1 -0
  49. package/dist/index.d.ts +1 -0
  50. package/dist/index.js +3 -1
  51. package/dist/index.js.map +1 -1
  52. package/dist/locales/de.json +22 -0
  53. package/dist/locales/en.json +22 -0
  54. package/dist/locales/es.json +22 -0
  55. package/dist/locales/fr.json +22 -0
  56. package/dist/locales/it.json +22 -0
  57. package/dist/testUtils.d.ts +5 -0
  58. package/dist/testUtils.js +18 -0
  59. package/dist/testUtils.js.map +1 -0
  60. package/dist/version.d.ts +1 -1
  61. package/dist/version.js +1 -1
  62. package/esm/components/Chat/Chat.css +110 -9
  63. package/esm/components/Chat/Chat.d.ts +1 -0
  64. package/esm/components/Chat/Chat.js +74 -7
  65. package/esm/components/Chat/Chat.js.map +1 -1
  66. package/esm/components/ChatBubble/ChatBubble.d.ts +1 -0
  67. package/esm/components/ChatBubble/ChatBubble.js +2 -2
  68. package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
  69. package/esm/components/ChatInputs/ChatInputs.js +2 -11
  70. package/esm/components/ChatInputs/ChatInputs.js.map +1 -1
  71. package/esm/components/DrawerFooter/DrawerFooter.css +62 -0
  72. package/esm/components/DrawerFooter/DrawerFooter.d.ts +12 -0
  73. package/esm/components/DrawerFooter/DrawerFooter.js +8 -0
  74. package/esm/components/DrawerFooter/DrawerFooter.js.map +1 -0
  75. package/esm/components/MemoriWidget/MemoriWidget.d.ts +2 -1
  76. package/esm/components/MemoriWidget/MemoriWidget.js +13 -3
  77. package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
  78. package/esm/components/UploadButton/UploadButton.js +8 -14
  79. package/esm/components/UploadButton/UploadButton.js.map +1 -1
  80. package/esm/components/UploadButton/UploadDocuments/UploadDocuments.d.ts +0 -1
  81. package/esm/components/UploadButton/UploadDocuments/UploadDocuments.js +1 -20
  82. package/esm/components/UploadButton/UploadDocuments/UploadDocuments.js.map +1 -1
  83. package/esm/components/layouts/fullpage.css +117 -0
  84. package/esm/helpers/constants.d.ts +1 -2
  85. package/esm/helpers/constants.js +1 -2
  86. package/esm/helpers/constants.js.map +1 -1
  87. package/esm/helpers/llmUsage.d.ts +60 -0
  88. package/esm/helpers/llmUsage.js +212 -0
  89. package/esm/helpers/llmUsage.js.map +1 -0
  90. package/esm/helpers/userMessage.d.ts +2 -0
  91. package/esm/helpers/userMessage.js +18 -0
  92. package/esm/helpers/userMessage.js.map +1 -0
  93. package/esm/icons/FacebookIcon.d.ts +3 -0
  94. package/esm/icons/FacebookIcon.js +4 -0
  95. package/esm/icons/FacebookIcon.js.map +1 -0
  96. package/esm/icons/LinkedinIcon.d.ts +3 -0
  97. package/esm/icons/LinkedinIcon.js +4 -0
  98. package/esm/icons/LinkedinIcon.js.map +1 -0
  99. package/esm/icons/TelegramIcon.d.ts +3 -0
  100. package/esm/icons/TelegramIcon.js +4 -0
  101. package/esm/icons/TelegramIcon.js.map +1 -0
  102. package/esm/icons/TwitterIcon.d.ts +3 -0
  103. package/esm/icons/TwitterIcon.js +4 -0
  104. package/esm/icons/TwitterIcon.js.map +1 -0
  105. package/esm/icons/WhatsappIcon.d.ts +3 -0
  106. package/esm/icons/WhatsappIcon.js +4 -0
  107. package/esm/icons/WhatsappIcon.js.map +1 -0
  108. package/esm/index.d.ts +1 -0
  109. package/esm/index.js +3 -1
  110. package/esm/index.js.map +1 -1
  111. package/esm/locales/de.json +22 -0
  112. package/esm/locales/en.json +22 -0
  113. package/esm/locales/es.json +22 -0
  114. package/esm/locales/fr.json +22 -0
  115. package/esm/locales/it.json +22 -0
  116. package/esm/testUtils.d.ts +5 -0
  117. package/esm/testUtils.js +15 -0
  118. package/esm/testUtils.js.map +1 -0
  119. package/esm/version.d.ts +1 -1
  120. package/esm/version.js +1 -1
  121. package/package.json +1 -1
  122. package/src/components/Chat/Chat.css +110 -9
  123. package/src/components/Chat/Chat.stories.tsx +42 -0
  124. package/src/components/Chat/Chat.test.tsx +47 -0
  125. package/src/components/Chat/Chat.tsx +238 -5
  126. package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +745 -0
  127. package/src/components/ChatBubble/ChatBubble.tsx +9 -0
  128. package/src/components/ChatInputs/ChatInputs.tsx +4 -15
  129. package/src/components/MemoriWidget/MemoriWidget.tsx +20 -2
  130. package/src/components/UploadButton/UploadButton.stories.tsx +3 -3
  131. package/src/components/UploadButton/UploadButton.tsx +8 -23
  132. package/src/components/UploadButton/UploadDocuments/UploadDocuments.tsx +1 -27
  133. package/src/helpers/constants.ts +1 -2
  134. package/src/helpers/llmUsage.ts +328 -0
  135. package/src/index.stories.tsx +2 -3
  136. package/src/index.tsx +5 -1
  137. package/src/locales/de.json +22 -0
  138. package/src/locales/en.json +22 -0
  139. package/src/locales/es.json +22 -0
  140. package/src/locales/fr.json +22 -0
  141. package/src/locales/it.json +22 -0
  142. package/src/version.ts +1 -1
@@ -0,0 +1,117 @@
1
+ /* FullPage layout – spacing, typography and structure using global design tokens */
2
+
3
+ .memori-widget.memori-layout-fullpage {
4
+ max-width: var(--memori-layout-max-width);
5
+ padding: var(--memori-spacing-md);
6
+ margin-right: auto;
7
+ margin-left: auto;
8
+ }
9
+
10
+ .memori-widget.memori-layout-fullpage > .memori-spin {
11
+ display: flex;
12
+ height: 100%;
13
+ flex-direction: column;
14
+ gap: var(--memori-spacing-lg);
15
+ }
16
+
17
+ /* Header spacing */
18
+ .memori-widget.memori-layout-fullpage .memori-chat-layout--header {
19
+ flex-shrink: 0;
20
+ margin-bottom: var(--memori-spacing-md);
21
+ }
22
+
23
+ /* Grid: main + left column (avatar) */
24
+ .memori-widget.memori-layout-fullpage .memori--grid {
25
+ display: flex;
26
+ height: auto;
27
+ height: 95vh;
28
+ min-height: 0;
29
+ flex: 1 1 auto;
30
+ align-items: stretch;
31
+ justify-content: center;
32
+ gap: var(--memori-spacing-xl);
33
+ }
34
+
35
+ .memori-widget.memori-layout-fullpage .memori--grid-column-left {
36
+ width: 50%;
37
+ max-width: 420px;
38
+ flex-shrink: 0;
39
+ margin-right: 0;
40
+ }
41
+
42
+ .memori-widget.memori-layout-fullpage .memori-chat-layout--main {
43
+ display: flex;
44
+ min-width: 0;
45
+ flex: 1;
46
+ flex-direction: column;
47
+ align-items: center;
48
+ justify-content: center;
49
+ }
50
+
51
+ .memori-widget.memori-layout-fullpage .memori-chat-layout--controls {
52
+ display: flex;
53
+ width: 100%;
54
+ max-width: 720px;
55
+ flex-direction: column;
56
+ align-items: center;
57
+ padding: var(--memori-spacing-md);
58
+ }
59
+
60
+ .memori-widget.memori-layout-fullpage .memori-chat-layout--controls .memori--start-panel,
61
+ .memori-widget.memori-layout-fullpage .memori-chat-layout--controls .memori-chat--wrapper {
62
+ width: 100%;
63
+ max-width: 100%;
64
+ padding: 0 !important;
65
+ margin-right: 0;
66
+ margin-left: 0;
67
+ }
68
+
69
+ /* Typography: title and description in fullpage left column */
70
+ .memori-widget.memori-layout-fullpage .memori--title {
71
+ margin-bottom: var(--memori-spacing-xs);
72
+ color: var(--memori-text-color);
73
+ font-size: var(--memori-text-size-heading-large);
74
+ font-weight: var(--memori-text-weight-semibold);
75
+ line-height: var(--memori-text-line-tight);
76
+ }
77
+
78
+ .memori-widget.memori-layout-fullpage .memori--description,
79
+ .memori-widget.memori-layout-fullpage .memori--needsPosition {
80
+ padding: var(--memori-spacing-lg);
81
+ padding-top: var(--memori-spacing-xs);
82
+ color: var(--memori-text-color);
83
+ font-size: var(--memori-text-size-base);
84
+ line-height: var(--memori-text-line-relaxed);
85
+ }
86
+
87
+ /* Powered-by position in fullpage */
88
+ .memori-widget.memori-layout-fullpage .memori--powered-by {
89
+ flex-shrink: 0;
90
+ padding: var(--memori-spacing-sm) var(--memori-spacing-md);
91
+ border-radius: var(--memori-radius-box);
92
+ font-size: var(--memori-text-size-small);
93
+ }
94
+
95
+ @media (max-width: 870px) {
96
+ .memori-widget.memori-layout-fullpage {
97
+ padding: var(--memori-spacing-sm);
98
+ }
99
+
100
+ .memori-widget.memori-layout-fullpage > .memori-spin {
101
+ gap: var(--memori-spacing-md);
102
+ }
103
+
104
+ .memori-widget.memori-layout-fullpage .memori--grid-column-left {
105
+ display: none;
106
+ }
107
+
108
+ .memori-widget.memori-layout-fullpage .memori-chat-layout--controls {
109
+ padding: var(--memori-spacing-sm);
110
+ }
111
+ }
112
+
113
+ @media (max-width: 480px) {
114
+ .memori-widget.memori-layout-fullpage .memori-chat-layout--controls {
115
+ padding: var(--memori-spacing-xs);
116
+ }
117
+ }
@@ -38,7 +38,6 @@ export declare const boardOfExpertsLoadingSentences: {
38
38
  export declare const MAX_MSG_CHARS = 4000;
39
39
  export declare const MAX_MSG_WORDS = 300;
40
40
  export declare const maxDocumentsPerMessage = 10;
41
- export declare const maxTotalMessagePayloadDefault = 200000;
42
- export declare const maxDocumentContentLength = 200000;
41
+ export declare const maxDocumentContentLength = 300000;
43
42
  export declare const pasteAsCardLineThreshold = 100;
44
43
  export declare const pasteAsCardCharThreshold = 4200;
@@ -185,8 +185,7 @@ export const boardOfExpertsLoadingSentences = {
185
185
  export const MAX_MSG_CHARS = 4000;
186
186
  export const MAX_MSG_WORDS = 300;
187
187
  export const maxDocumentsPerMessage = 10;
188
- export const maxTotalMessagePayloadDefault = 200000;
189
- export const maxDocumentContentLength = 200000;
188
+ export const maxDocumentContentLength = 300000;
190
189
  export const pasteAsCardLineThreshold = 100;
191
190
  export const pasteAsCardCharThreshold = 4200;
192
191
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/helpers/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE;IACjC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE;IACnC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,uBAAuB,EAAE;IAC/C,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE;IAC/B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE;IACjC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE;IAClC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE;IACjC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE;IACjC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE;IACpC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE;IAC/B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE;IAClC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE;IAClC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;IAChC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE;IAClC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE;IAC7B,EAAE,KAAK,EAAE,IAAI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AI,EAAE,2BAA2B;YACjC,UAAU,EAAE,CAAC;SACd;QACD;YACE,IAAI,EAAE,2CAA2C;YACjD,UAAU,EAAE,CAAC;SACd;QACD;YACE,IAAI,EAAE,mCAAmC;YACzC,UAAU,EAAE,CAAC;SACd;QACD;YACE,IAAI,EAAE,mCAAmC;YACzC,UAAU,EAAE,CAAC;SACd;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC;AAEjC,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAC/C,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAC5C,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC"}
@@ -0,0 +1,60 @@
1
+ export interface LlmUsageOnLine {
2
+ provider?: string;
3
+ model?: string;
4
+ totalInputTokens?: number;
5
+ inputCacheReadTokens?: number;
6
+ inputCacheWriteTokens?: number;
7
+ outputTokens?: number;
8
+ durationMs?: number;
9
+ energyImpact?: {
10
+ energy?: number | {
11
+ source?: string;
12
+ parsedValue?: number;
13
+ };
14
+ energyUnit?: string;
15
+ gwp?: number | {
16
+ source?: string;
17
+ parsedValue?: number;
18
+ };
19
+ gwpUnit?: string;
20
+ wcf?: number | {
21
+ source?: string;
22
+ parsedValue?: number;
23
+ };
24
+ wcfUnit?: string;
25
+ };
26
+ }
27
+ export type UsageBadgeType = 'llm' | 'energy' | 'co2' | 'water';
28
+ type NumericMetric = number | {
29
+ source?: string;
30
+ parsedValue?: number;
31
+ };
32
+ type ImpactMetricType = 'energy' | 'co2' | 'water';
33
+ type TranslateFn = (key: string, options?: {
34
+ [key: string]: unknown;
35
+ }) => string;
36
+ export interface LlmUsageLabels {
37
+ llm: string;
38
+ model: string;
39
+ provider: string;
40
+ tokens: string;
41
+ input: string;
42
+ output: string;
43
+ cacheRead: string;
44
+ cacheWrite: string;
45
+ duration: string;
46
+ energy: string;
47
+ co2: string;
48
+ water: string;
49
+ usageBadgesHint: string;
50
+ }
51
+ export declare const BADGE_EMOJI: Record<UsageBadgeType, string>;
52
+ export declare const escapeHtml: (value: string) => string;
53
+ export declare const getMetricValue: (metric?: NumericMetric) => number | undefined;
54
+ export declare const formatIntegerValue: (value: number, locale?: string) => string;
55
+ export declare const formatDuration: (durationMs?: number, locale?: string) => string;
56
+ export declare const formatImpactInReadableUnit: (value: number, metricType: ImpactMetricType, locale?: string) => string;
57
+ export declare const formatImpactWithApiUnit: (value: number, unitFromApi: string | undefined, fallbackUnit: string, metricType: ImpactMetricType, locale?: string) => string;
58
+ export declare const getImpactComparison: (value: number, metricType: ImpactMetricType, locale: string | undefined, t: TranslateFn) => string;
59
+ export declare const buildLlmUsageHtml: (usage: LlmUsageOnLine, labels: LlmUsageLabels, lineIndex: number, locale?: string) => string;
60
+ export {};
@@ -0,0 +1,212 @@
1
+ export const BADGE_EMOJI = {
2
+ llm: '🤖',
3
+ energy: '⚡',
4
+ co2: '🌍',
5
+ water: '💧',
6
+ };
7
+ export const escapeHtml = (value) => value
8
+ .replaceAll('&', '&amp;')
9
+ .replaceAll('<', '&lt;')
10
+ .replaceAll('>', '&gt;')
11
+ .replaceAll('"', '&quot;')
12
+ .replaceAll("'", '&#39;');
13
+ export const getMetricValue = (metric) => {
14
+ if (typeof metric === 'number' && Number.isFinite(metric))
15
+ return metric;
16
+ if (!metric || typeof metric !== 'object')
17
+ return undefined;
18
+ if (typeof metric.parsedValue === 'number' &&
19
+ Number.isFinite(metric.parsedValue)) {
20
+ return metric.parsedValue;
21
+ }
22
+ if (typeof metric.source === 'string') {
23
+ const parsed = Number(metric.source);
24
+ if (Number.isFinite(parsed))
25
+ return parsed;
26
+ }
27
+ return undefined;
28
+ };
29
+ const formatMetricValue = (value, locale = 'it-IT') => {
30
+ if (!Number.isFinite(value))
31
+ return '—';
32
+ if (value === 0)
33
+ return '0';
34
+ const absValue = Math.abs(value);
35
+ return new Intl.NumberFormat(locale, {
36
+ minimumFractionDigits: 0,
37
+ maximumFractionDigits: absValue >= 1 ? 3 : 4,
38
+ }).format(value);
39
+ };
40
+ export const formatIntegerValue = (value, locale = 'it-IT') => {
41
+ if (!Number.isFinite(value))
42
+ return '0';
43
+ return new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(value);
44
+ };
45
+ export const formatDuration = (durationMs, locale = 'it-IT') => {
46
+ if (typeof durationMs !== 'number' || !Number.isFinite(durationMs)) {
47
+ return '—';
48
+ }
49
+ if (durationMs < 1000)
50
+ return `${formatIntegerValue(durationMs, locale)} ms`;
51
+ return `${formatMetricValue(durationMs / 1000, locale)} s`;
52
+ };
53
+ const floorToSingleDecimal = (value) => Math.floor(value * 10) / 10;
54
+ const formatComparisonNumber = (value, locale = 'it-IT') => new Intl.NumberFormat(locale, {
55
+ minimumFractionDigits: 1,
56
+ maximumFractionDigits: 1,
57
+ }).format(floorToSingleDecimal(value));
58
+ const formatReadableDuration = (seconds, locale = 'it-IT') => {
59
+ if (!Number.isFinite(seconds) || seconds <= 0)
60
+ return '0 s';
61
+ if (seconds < 60)
62
+ return `${formatComparisonNumber(seconds, locale)} s`;
63
+ const minutes = seconds / 60;
64
+ if (minutes < 60)
65
+ return `${formatComparisonNumber(minutes, locale)} min`;
66
+ return `${formatComparisonNumber(minutes / 60, locale)} h`;
67
+ };
68
+ const formatReadableDistance = (meters, locale = 'it-IT') => {
69
+ if (!Number.isFinite(meters) || meters <= 0)
70
+ return '0 m';
71
+ if (meters < 1000)
72
+ return `${formatComparisonNumber(meters, locale)} m`;
73
+ return `${formatComparisonNumber(meters / 1000, locale)} km`;
74
+ };
75
+ const getApiUnitToBaseFactor = (unitFromApi, metricType) => {
76
+ const u = (unitFromApi !== null && unitFromApi !== void 0 ? unitFromApi : '').trim().toLowerCase();
77
+ if (metricType === 'energy') {
78
+ if (u === 'kwh')
79
+ return 1;
80
+ if (u === 'wh')
81
+ return 0.001;
82
+ if (u === 'mwh')
83
+ return 0.000001;
84
+ return 1;
85
+ }
86
+ if (metricType === 'co2') {
87
+ if (u === 'kg' || u === 'kgco2eq')
88
+ return 1;
89
+ if (u === 'g')
90
+ return 0.001;
91
+ if (u === 'mg')
92
+ return 0.000001;
93
+ return 1;
94
+ }
95
+ if (u === 'l')
96
+ return 1;
97
+ if (u === 'ml')
98
+ return 0.001;
99
+ if (u === 'μl' || u === 'ul')
100
+ return 0.000001;
101
+ return 1;
102
+ };
103
+ export const formatImpactInReadableUnit = (value, metricType, locale = 'it-IT') => {
104
+ const absValue = Math.abs(value);
105
+ if (metricType === 'energy') {
106
+ if (absValue >= 1)
107
+ return `${formatMetricValue(value, locale)} kWh`;
108
+ const wattHours = value * 1000;
109
+ if (Math.abs(wattHours) >= 1)
110
+ return `${formatMetricValue(wattHours, locale)} Wh`;
111
+ return `${formatMetricValue(wattHours * 1000, locale)} mWh`;
112
+ }
113
+ if (metricType === 'co2') {
114
+ if (absValue >= 1)
115
+ return `${formatMetricValue(value, locale)} kg`;
116
+ const grams = value * 1000;
117
+ if (Math.abs(grams) >= 1)
118
+ return `${formatMetricValue(grams, locale)} g`;
119
+ return `${formatMetricValue(grams * 1000, locale)} mg`;
120
+ }
121
+ if (absValue >= 1)
122
+ return `${formatMetricValue(value, locale)} L`;
123
+ const milliliters = value * 1000;
124
+ if (Math.abs(milliliters) >= 1)
125
+ return `${formatMetricValue(milliliters, locale)} mL`;
126
+ return `${formatMetricValue(milliliters * 1000, locale)} μL`;
127
+ };
128
+ export const formatImpactWithApiUnit = (value, unitFromApi, fallbackUnit, metricType, locale = 'it-IT') => {
129
+ const factor = getApiUnitToBaseFactor(unitFromApi !== null && unitFromApi !== void 0 ? unitFromApi : fallbackUnit, metricType);
130
+ const baseValue = value * factor;
131
+ return formatImpactInReadableUnit(baseValue, metricType, locale);
132
+ };
133
+ export const getImpactComparison = (value, metricType, locale = 'it-IT', t) => {
134
+ if (!Number.isFinite(value) || value <= 0) {
135
+ return t('chatLogs.impactComparisonUnavailable');
136
+ }
137
+ if (metricType === 'energy') {
138
+ const ledSeconds = (value * 1000 * 3600) / 10;
139
+ return t('chatLogs.impactComparisonEnergy', {
140
+ duration: formatReadableDuration(ledSeconds, locale),
141
+ });
142
+ }
143
+ if (metricType === 'co2') {
144
+ const averageCarMeters = (value / 0.12) * 1000;
145
+ return t('chatLogs.impactComparisonCo2', {
146
+ distance: formatReadableDistance(averageCarMeters, locale),
147
+ });
148
+ }
149
+ const drops = (value * 1000) / 0.05;
150
+ return t('chatLogs.impactComparisonWater', {
151
+ count: formatComparisonNumber(drops, locale),
152
+ });
153
+ };
154
+ const buildUsageBadgeHtml = ({ badgeType, badgeClassName, label, value, lineIndex, emoji, }) => {
155
+ const escapedLabel = escapeHtml(label);
156
+ const valueHtml = value
157
+ ? `<span class="memori-chat--usage-badge-value">${value}</span>`
158
+ : '';
159
+ const content = valueHtml ||
160
+ `<span class="memori-chat--usage-badge-label">${escapedLabel}</span>`;
161
+ return `<button type="button" class="memori-chat--usage-badge ${badgeClassName}" data-llm-badge-type="${badgeType}" data-line-index="${lineIndex}" aria-label="${escapedLabel}">${emoji} ${content}</button>`;
162
+ };
163
+ export const buildLlmUsageHtml = (usage, labels, lineIndex, locale = 'it-IT') => {
164
+ var _a, _b, _c, _d, _e, _f;
165
+ const badges = [
166
+ buildUsageBadgeHtml({
167
+ badgeType: 'llm',
168
+ badgeClassName: 'memori-chat--usage-badge-llm',
169
+ label: labels.llm,
170
+ lineIndex,
171
+ emoji: BADGE_EMOJI.llm,
172
+ }),
173
+ ];
174
+ const energy = getMetricValue((_a = usage.energyImpact) === null || _a === void 0 ? void 0 : _a.energy);
175
+ const gwp = getMetricValue((_b = usage.energyImpact) === null || _b === void 0 ? void 0 : _b.gwp);
176
+ const wcf = getMetricValue((_c = usage.energyImpact) === null || _c === void 0 ? void 0 : _c.wcf);
177
+ if (typeof energy === 'number') {
178
+ const energyFormatted = formatImpactWithApiUnit(energy, (_d = usage.energyImpact) === null || _d === void 0 ? void 0 : _d.energyUnit, 'kWh', 'energy', locale);
179
+ badges.push(buildUsageBadgeHtml({
180
+ badgeType: 'energy',
181
+ badgeClassName: 'memori-chat--usage-badge-energy',
182
+ label: `${labels.energy} ${energyFormatted}`,
183
+ value: escapeHtml(energyFormatted),
184
+ lineIndex,
185
+ emoji: BADGE_EMOJI.energy,
186
+ }));
187
+ }
188
+ if (typeof gwp === 'number') {
189
+ const co2Formatted = formatImpactWithApiUnit(gwp, (_e = usage.energyImpact) === null || _e === void 0 ? void 0 : _e.gwpUnit, 'kgCO2eq', 'co2', locale);
190
+ badges.push(buildUsageBadgeHtml({
191
+ badgeType: 'co2',
192
+ badgeClassName: 'memori-chat--usage-badge-co2',
193
+ label: `${labels.co2} ${co2Formatted}`,
194
+ value: escapeHtml(co2Formatted),
195
+ lineIndex,
196
+ emoji: BADGE_EMOJI.co2,
197
+ }));
198
+ }
199
+ if (typeof wcf === 'number') {
200
+ const waterFormatted = formatImpactWithApiUnit(wcf, (_f = usage.energyImpact) === null || _f === void 0 ? void 0 : _f.wcfUnit, 'L', 'water', locale);
201
+ badges.push(buildUsageBadgeHtml({
202
+ badgeType: 'water',
203
+ badgeClassName: 'memori-chat--usage-badge-water',
204
+ label: `${labels.water} ${waterFormatted}`,
205
+ value: escapeHtml(waterFormatted),
206
+ lineIndex,
207
+ emoji: BADGE_EMOJI.water,
208
+ }));
209
+ }
210
+ return `<div class="memori-chat--llm-usage" data-llm-usage><hr class="memori-chat--llm-usage-hr" /><p class="memori-chat--llm-usage-hint">${escapeHtml(labels.usageBadgesHint)}</p><div class="memori-chat--llm-usage-badges">${badges.join('')}</div></div>`;
211
+ };
212
+ //# sourceMappingURL=llmUsage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llmUsage.js","sourceRoot":"","sources":["../../src/helpers/llmUsage.ts"],"names":[],"mappings":"AAuCA,MAAM,CAAC,MAAM,WAAW,GAAmC;IACzD,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G,uBAAuB,CAC1C,GAAG,EACH,MAAA,KAAK,CAAC,YAAY,0CAAE,OAAO,EAC3B,SAAS,EACT,KAAK,EACL,MAAM,CACP,CAAC;QACF,MAAM,CAAC,IAAI,CACT,mBAAmB,CAAC;YAClB,SAAS,EAAE,KAAK;YAChB,cAAc,EAAE,8BAA8B;YAC9C,KAAK,EAAE,GAAG,MAAM,CAAC,GAAG,IAAI,YAAY,EAAE;YACtC,KAAK,EAAE,UAAU,CAAC,YAAY,CAAC;YAC/B,SAAS;YACT,KAAK,EAAE,WAAW,CAAC,GAAG;SACvB,CAAC,CACH,CAAC;KACH;IAED,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,MAAM,cAAc,GAAG,uBAAuB,CAC5C,GAAG,EACH,MAAA,KAAK,CAAC,YAAY,0CAAE,OAAO,EAC3B,GAAG,EACH,OAAO,EACP,MAAM,CACP,CAAC;QACF,MAAM,CAAC,IAAI,CACT,mBAAmB,CAAC;YAClB,SAAS,EAAE,OAAO;YAClB,cAAc,EAAE,gCAAgC;YAChD,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,IAAI,cAAc,EAAE;YAC1C,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC;YACjC,SAAS;YACT,KAAK,EAAE,WAAW,CAAC,KAAK;SACzB,CAAC,CACH,CAAC;KACH;IAED,OAAO,qIAAqI,UAAU,CACpJ,MAAM,CAAC,eAAe,CACvB,kDAAkD,MAAM,CAAC,IAAI,CAC5D,EAAE,CACH,cAAc,CAAC;AAClB,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function sanitizeUserMessageInput(raw: string): string;
2
+ export declare function formatUserBubbleHtml(cleanText: string): string;
@@ -0,0 +1,18 @@
1
+ import DOMPurify from 'dompurify';
2
+ import { escapeHTML } from './utils';
3
+ import { truncateMessagePlain } from './message';
4
+ export function sanitizeUserMessageInput(raw) {
5
+ if (raw == null || typeof raw !== 'string') {
6
+ return '';
7
+ }
8
+ const stripped = DOMPurify.sanitize(raw, {
9
+ ALLOWED_TAGS: [],
10
+ ALLOWED_ATTR: [],
11
+ });
12
+ return stripped.trim();
13
+ }
14
+ export function formatUserBubbleHtml(cleanText) {
15
+ const truncated = truncateMessagePlain(cleanText);
16
+ return escapeHTML(truncated).replace(/\n/g, '<br />');
17
+ }
18
+ //# sourceMappingURL=userMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userMessage.js","sourceRoot":"","sources":["../../src/helpers/userMessage.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAMjD,MAAM,UAAU,wBAAwB,CAAC,GAAW;IAClD,IAAI,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC3C,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE;QACvC,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,EAAE;KACjB,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AACzB,CAAC;AAGD,MAAM,UAAU,oBAAoB,CAAC,SAAiB;IACpD,MAAM,SAAS,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAClD,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACxD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare const FacebookIcon: (props: React.SVGProps<SVGSVGElement>) => JSX.Element;
3
+ export default FacebookIcon;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const FacebookIcon = (props) => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 800, height: 800, fill: "currentColor", viewBox: "0 0 24 24", ...props, children: [_jsx("path", { fill: "currentColor", d: "M17.3 9.6a1 1 0 1 0-1.6-1.2l-2.308 3.078-2.185-2.185A1 1 0 0 0 9.7 9.4l-3 4a1 1 0 0 0 1.6 1.2l2.308-3.078 2.185 2.185A1 1 0 0 0 14.3 13.6l3-4Z" }), _jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M12 23c-1.224 0-1.9-.131-3-.5l-2.106 1.053A2 2 0 0 1 4 21.763V19.5c-2.153-2.008-3-4.323-3-7.5C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11Zm-6-4.37-.636-.593C3.691 16.477 3 14.733 3 12a9 9 0 1 1 9 9c-.986 0-1.448-.089-2.364-.396l-.788-.264L6 21.764V18.63Z", clipRule: "evenodd" })] }));
3
+ export default FacebookIcon;
4
+ //# sourceMappingURL=FacebookIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FacebookIcon.js","sourceRoot":"","sources":["../../src/icons/FacebookIcon.tsx"],"names":[],"mappings":";AACA,MAAM,YAAY,GAAG,CAAC,KAAoC,EAAE,EAAE,CAAC,CAC7D,eACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,GAAG,EACV,MAAM,EAAE,GAAG,EACX,IAAI,EAAC,cAAc,EACnB,OAAO,EAAC,WAAW,KACf,KAAK,aAET,eACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,gJAAgJ,GAClJ,EACF,eACE,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,uQAAuQ,EACzQ,QAAQ,EAAC,SAAS,GAClB,IACE,CACP,CAAA;AACD,eAAe,YAAY,CAAA"}
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare const LinkedinIcon: (props: React.SVGProps<SVGSVGElement>) => JSX.Element;
3
+ export default LinkedinIcon;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const LinkedinIcon = (props) => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 800, height: 800, fill: "currentColor", viewBox: "0 0 24 24", ...props, children: [_jsx("path", { fill: "currentColor", d: "M6.5 8a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM5 10a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-8ZM11 19h1a1 1 0 0 0 1-1v-4.5c0-1.5 3-2.5 3-.5v5a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-6c0-2-1.5-3-3.5-3S13 10.5 13 10.5V10a1 1 0 0 0-1-1h-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1Z" }), _jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M20 1a3 3 0 0 1 3 3v16a3 3 0 0 1-3 3H4a3 3 0 0 1-3-3V4a3 3 0 0 1 3-3h16Zm0 2a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h16Z", clipRule: "evenodd" })] }));
3
+ export default LinkedinIcon;
4
+ //# sourceMappingURL=LinkedinIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkedinIcon.js","sourceRoot":"","sources":["../../src/icons/LinkedinIcon.tsx"],"names":[],"mappings":";AACA,MAAM,YAAY,GAAG,CAAC,KAAoC,EAAE,EAAE,CAAC,CAC7D,eACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,GAAG,EACV,MAAM,EAAE,GAAG,EACX,IAAI,EAAC,cAAc,EACnB,OAAO,EAAC,WAAW,KACf,KAAK,aAET,eACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,sRAAsR,GACxR,EACF,eACE,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,iJAAiJ,EACnJ,QAAQ,EAAC,SAAS,GAClB,IACE,CACP,CAAA;AACD,eAAe,YAAY,CAAA"}
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare const TelegramIcon: (props: React.SVGProps<SVGSVGElement>) => JSX.Element;
3
+ export default TelegramIcon;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const TelegramIcon = (props) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 800, height: 800, fill: "currentColor", viewBox: "0 0 24 24", ...props, children: _jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M23.112 4.494c.318-1.55-1.205-2.837-2.68-2.267L2.342 9.216c-1.647.637-1.72 2.941-.117 3.682l3.94 1.818 1.873 6.559a1 1 0 0 0 1.67.432l2.886-2.887 4.043 3.033a2 2 0 0 0 3.16-1.198l3.315-16.16ZM3.063 11.082l18.09-6.99-3.316 16.161L13.1 16.7a1 1 0 0 0-1.307.093l-1.236 1.236.371-2.043 7.28-7.279a1 1 0 0 0-1.204-1.575L6.95 12.876l-3.888-1.794Zm5.114 3.397.606 2.123.233-1.281a1 1 0 0 1 .277-.528l2.22-2.22-3.336 1.906Z", clipRule: "evenodd" }) }));
3
+ export default TelegramIcon;
4
+ //# sourceMappingURL=TelegramIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TelegramIcon.js","sourceRoot":"","sources":["../../src/icons/TelegramIcon.tsx"],"names":[],"mappings":";AACA,MAAM,YAAY,GAAG,CAAC,KAAoC,EAAE,EAAE,CAAC,CAC7D,cACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,GAAG,EACV,MAAM,EAAE,GAAG,EACX,IAAI,EAAC,cAAc,EACnB,OAAO,EAAC,WAAW,KACf,KAAK,YAET,eACE,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,iaAAia,EACna,QAAQ,EAAC,SAAS,GAClB,GACE,CACP,CAAA;AACD,eAAe,YAAY,CAAA"}
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare const TwitterIcon: (props: React.SVGProps<SVGSVGElement>) => JSX.Element;
3
+ export default TwitterIcon;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const TwitterIcon = (props) => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 800, height: 800, fill: "currentColor", viewBox: "0 0 100 100", ...props, children: [_jsx("path", { fill: "currentColor", d: "M69.7 8.7H30.4C18.7 8.7 9.1 18.2 9.1 30v41.2c0 11.7 9.5 21.3 21.3 21.3h39.4c11.7 0 21.3-9.5 21.3-21.3V29.9C91 18.2 81.5 8.7 69.7 8.7zm7.1 69.6H61.4c-.1 0-.2 0-.2-.1L46.8 57.3h-.1C40.9 64 35.2 70.6 29.6 77.1c-.3.4-.7.7-1 1-.1.1-.2.1-.3.1h-4.2c-.1 0-.2 0-.1-.1l20.5-23.8c.1-.1.1-.2 0-.3L24.1 24.3v-.1h15.5c.1 0 .1 0 .2.1L53.4 44h.1l16.9-19.7c.1-.1.2-.1.3-.1h4.2c.2 0 .2.1.1.2L55.6 46.9c-.1.1-.1.2 0 .3l21.3 31s0 .1-.1.1z" }), _jsx("path", { d: "M37.8 27.8h-6.7c-.1 0-.1.1-.1.2l32.2 46.7H69.9c.1 0 .1-.1.1-.2L37.8 27.8z" })] }));
3
+ export default TwitterIcon;
4
+ //# sourceMappingURL=TwitterIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TwitterIcon.js","sourceRoot":"","sources":["../../src/icons/TwitterIcon.tsx"],"names":[],"mappings":";AACA,MAAM,WAAW,GAAG,CAAC,KAAoC,EAAE,EAAE,CAAC,CAC5D,eAAK,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAC,cAAc,EAAC,OAAO,EAAC,aAAa,KAAK,KAAK,aAClH,eAAM,IAAI,EAAC,cAAc,EAAC,CAAC,EAAC,oaAAoa,GAAG,EACnc,eAAM,CAAC,EAAC,2EAA2E,GAAG,IAClF,CACP,CAAA;AACD,eAAe,WAAW,CAAA"}
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare const WhatsappIcon: (props: React.SVGProps<SVGSVGElement>) => JSX.Element;
3
+ export default WhatsappIcon;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const WhatsappIcon = (props) => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 800, height: 800, fill: "currentColor", viewBox: "0 0 24 24", ...props, children: [_jsx("path", { fill: "currentColor", d: "M6.014 8.006c.114-.904 1.289-2.132 2.22-1.996V6.01c.907.172 1.625 1.734 2.03 2.436.286.509.1 1.025-.167 1.243-.361.29-.926.692-.808 1.095C9.5 11.5 12 14 13.23 14.711c.466.269.804-.44 1.092-.804.21-.28.726-.447 1.234-.171.759.442 1.474.956 2.135 1.534.33.276.408.684.179 1.115-.403.76-1.569 1.76-2.415 1.557C13.976 17.587 8 15.27 6.08 8.558c-.108-.318-.08-.438-.066-.552Z" }), _jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M12 23c-1.224 0-1.9-.131-3-.5l-2.106 1.053A2 2 0 0 1 4 21.763V19.5c-2.153-2.008-3-4.323-3-7.5C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11Zm-6-4.37-.636-.593C3.691 16.477 3 14.733 3 12a9 9 0 1 1 9 9c-.986 0-1.448-.089-2.364-.396l-.788-.264L6 21.764V18.63Z", clipRule: "evenodd" })] }));
3
+ export default WhatsappIcon;
4
+ //# sourceMappingURL=WhatsappIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WhatsappIcon.js","sourceRoot":"","sources":["../../src/icons/WhatsappIcon.tsx"],"names":[],"mappings":";AACA,MAAM,YAAY,GAAG,CAAC,KAAoC,EAAE,EAAE,CAAC,CAC7D,eACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,GAAG,EACV,MAAM,EAAE,GAAG,EACX,IAAI,EAAC,cAAc,EACnB,OAAO,EAAC,WAAW,KACf,KAAK,aAET,eACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,oXAAoX,GACtX,EACF,eACE,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,uQAAuQ,EACzQ,QAAQ,EAAC,SAAS,GAClB,IACE,CACP,CAAA;AACD,eAAe,YAAY,CAAA"}
package/esm/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export interface Props {
20
20
  showInputs?: boolean;
21
21
  showDates?: boolean;
22
22
  showContextPerLine?: boolean;
23
+ showMessageConsumption?: boolean;
23
24
  showSettings?: boolean;
24
25
  __WEBCOMPONENT__?: boolean;
25
26
  showClear?: boolean;
package/esm/index.js CHANGED
@@ -37,7 +37,7 @@ const getParsedContext = (context) => {
37
37
  }, {});
38
38
  return parsedContext;
39
39
  };
40
- const Memori = ({ ownerUserName, ownerUserID, memoriName, memoriID, integration, integrationID, tenantID, secretToken, sessionID, layout, customLayout, showShare, showCopyButton = true, showTranslationOriginal = false, showSettings, showTypingText = false, showClear = false, showOnlyLastMessages, showInputs = true, showDates = false, showContextPerLine = false, showUpload, showLogin, showReasoning, avatar3dHidden, height = '100%', baseURL, apiURL = 'https://backend.memori.ai', engineURL = 'https://engine.memori.ai', tag, pin, context, initialQuestion, showChatHistory = true, uiLang, spokenLang, multilingual, authToken, enableAudio, defaultSpeakerActive = true, disableTextEnteredEvents = false, onStateChange, additionalInfo, customMediaRenderer, additionalSettings, userAvatar, useMathFormatting = false, autoStart, applyVarsToRoot = false, __WEBCOMPONENT__ = false, maxTotalMessagePayload, maxTextareaCharacters, }) => {
40
+ const Memori = ({ ownerUserName, ownerUserID, memoriName, memoriID, integration, integrationID, tenantID, secretToken, sessionID, layout, customLayout, showShare, showCopyButton = true, showTranslationOriginal = false, showSettings, showTypingText = false, showClear = false, showOnlyLastMessages, showInputs = true, showDates = false, showContextPerLine = false, showMessageConsumption = false, showUpload, showLogin, showReasoning, avatar3dHidden, height = '100%', baseURL, apiURL = 'https://backend.memori.ai', engineURL = 'https://engine.memori.ai', tag, pin, context, initialQuestion, showChatHistory = true, uiLang, spokenLang, multilingual, authToken, enableAudio, defaultSpeakerActive = true, disableTextEnteredEvents = false, onStateChange, additionalInfo, customMediaRenderer, additionalSettings, userAvatar, useMathFormatting = false, autoStart, applyVarsToRoot = false, __WEBCOMPONENT__ = false, maxTotalMessagePayload, maxTextareaCharacters, }) => {
41
41
  var _a, _b, _c, _d, _e, _f, _g, _h;
42
42
  const [memori, setMemori] = useState();
43
43
  const [tenant, setTenant] = useState();
@@ -192,6 +192,7 @@ const Memori = ({ ownerUserName, ownerUserID, memoriName, memoriID, integration,
192
192
  showUpload,
193
193
  showReasoning,
194
194
  showContextPerLine,
195
+ showMessageConsumption,
195
196
  initialContextVars: context !== null && context !== void 0 ? context : getParsedContext(layoutIntegrationConfig.contextVars),
196
197
  initialQuestion: initialQuestion !== null && initialQuestion !== void 0 ? initialQuestion : layoutIntegrationConfig.initialQuestion,
197
198
  autoStart: layout === 'WEBSITE_ASSISTANT'
@@ -288,6 +289,7 @@ Memori.propTypes = {
288
289
  showInputs: PropTypes.bool,
289
290
  showDates: PropTypes.bool,
290
291
  showContextPerLine: PropTypes.bool,
292
+ showMessageConsumption: PropTypes.bool,
291
293
  showSettings: PropTypes.bool,
292
294
  showClear: PropTypes.bool,
293
295
  showOnlyLastMessages: PropTypes.bool,