@orbe-agro/client-core 5.6.200 → 5.6.202

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 (92) hide show
  1. package/dist/@ecme/assets/styles/app.css +82 -5
  2. package/dist/@ecme/assets/styles/tailwind/index.css +89 -6
  3. package/dist/@ecme/components/layouts/PostLoginLayout/PostLoginLayout.js +3 -0
  4. package/dist/@ecme/components/layouts/PostLoginLayout/PostLoginLayout.js.map +1 -1
  5. package/dist/@ecme/components/template/Footer.js +1 -1
  6. package/dist/@ecme/components/template/OrbeAiWidget/OrbeAiWidget.js +100 -0
  7. package/dist/@ecme/components/template/OrbeAiWidget/OrbeAiWidget.js.map +1 -0
  8. package/dist/@ecme/components/template/OrbeAiWidget/ResizeHandles.js +37 -0
  9. package/dist/@ecme/components/template/OrbeAiWidget/ResizeHandles.js.map +1 -0
  10. package/dist/@ecme/components/template/OrbeAiWidget/index.js +5 -0
  11. package/dist/@ecme/components/template/OrbeAiWidget/index.js.map +1 -0
  12. package/dist/@ecme/components/template/OrbeAiWidget/useResizablePanel.js +77 -0
  13. package/dist/@ecme/components/template/OrbeAiWidget/useResizablePanel.js.map +1 -0
  14. package/dist/@ecme/components/view/ChatBox/ChatBox.js +7 -1
  15. package/dist/@ecme/components/view/ChatBox/ChatBox.js.map +1 -1
  16. package/dist/@ecme/components/view/ChatBox/components/MessageList.js +7 -4
  17. package/dist/@ecme/components/view/ChatBox/components/MessageList.js.map +1 -1
  18. package/dist/@ecme/configs/navigation.config/concepts.navigation.config.js +0 -16
  19. package/dist/@ecme/configs/navigation.config/concepts.navigation.config.js.map +1 -1
  20. package/dist/@ecme/configs/routes.config/conceptsRoute.js +0 -9
  21. package/dist/@ecme/configs/routes.config/conceptsRoute.js.map +1 -1
  22. package/dist/@ecme/index.js +3 -1
  23. package/dist/@ecme/services/AiService.js +24 -4
  24. package/dist/@ecme/services/AiService.js.map +1 -1
  25. package/dist/@ecme/services/axios/AxiosBase.js +30 -24
  26. package/dist/@ecme/services/axios/AxiosBase.js.map +1 -1
  27. package/dist/@ecme/services/index.js +3 -1
  28. package/dist/@ecme/views/concepts/ai/Chat/components/AiThinkingIndicator.js +23 -0
  29. package/dist/@ecme/views/concepts/ai/Chat/components/AiThinkingIndicator.js.map +1 -0
  30. package/dist/@ecme/views/concepts/ai/Chat/components/ChatLandingView.js +16 -16
  31. package/dist/@ecme/views/concepts/ai/Chat/components/ChatLandingView.js.map +1 -1
  32. package/dist/@ecme/views/concepts/ai/Chat/components/ChatView.js +7 -4
  33. package/dist/@ecme/views/concepts/ai/Chat/components/ChatView.js.map +1 -1
  34. package/dist/@ecme/views/concepts/ai/Chat/components/ModelSelect.js +48 -0
  35. package/dist/@ecme/views/concepts/ai/Chat/components/ModelSelect.js.map +1 -0
  36. package/dist/@ecme/views/concepts/ai/Chat/hooks/useChatSend.js +6 -3
  37. package/dist/@ecme/views/concepts/ai/Chat/hooks/useChatSend.js.map +1 -1
  38. package/dist/@ecme/views/concepts/ai/Chat/store/aiModelStore.js +15 -0
  39. package/dist/@ecme/views/concepts/ai/Chat/store/aiModelStore.js.map +1 -0
  40. package/dist/@types/@ecme/components/layouts/PostLoginLayout/PostLoginLayout.d.ts.map +1 -1
  41. package/dist/@types/@ecme/components/template/OrbeAiWidget/OrbeAiWidget.d.ts +3 -0
  42. package/dist/@types/@ecme/components/template/OrbeAiWidget/OrbeAiWidget.d.ts.map +1 -0
  43. package/dist/@types/@ecme/components/template/OrbeAiWidget/ResizeHandles.d.ts +9 -0
  44. package/dist/@types/@ecme/components/template/OrbeAiWidget/ResizeHandles.d.ts.map +1 -0
  45. package/dist/@types/@ecme/components/template/OrbeAiWidget/index.d.ts +2 -0
  46. package/dist/@types/@ecme/components/template/OrbeAiWidget/index.d.ts.map +1 -0
  47. package/dist/@types/@ecme/components/template/OrbeAiWidget/useResizablePanel.d.ts +19 -0
  48. package/dist/@types/@ecme/components/template/OrbeAiWidget/useResizablePanel.d.ts.map +1 -0
  49. package/dist/@types/@ecme/components/view/ChatBox/ChatBox.d.ts.map +1 -1
  50. package/dist/@types/@ecme/components/view/ChatBox/components/MessageList.d.ts +3 -0
  51. package/dist/@types/@ecme/components/view/ChatBox/components/MessageList.d.ts.map +1 -1
  52. package/dist/@types/@ecme/configs/navigation.config/concepts.navigation.config.d.ts.map +1 -1
  53. package/dist/@types/@ecme/configs/routes.config/conceptsRoute.d.ts.map +1 -1
  54. package/dist/@types/@ecme/services/AiService.d.ts +12 -0
  55. package/dist/@types/@ecme/services/AiService.d.ts.map +1 -1
  56. package/dist/@types/@ecme/services/axios/AxiosBase.d.ts +12 -0
  57. package/dist/@types/@ecme/services/axios/AxiosBase.d.ts.map +1 -1
  58. package/dist/@types/@ecme/views/concepts/ai/Chat/components/AiThinkingIndicator.d.ts +7 -0
  59. package/dist/@types/@ecme/views/concepts/ai/Chat/components/AiThinkingIndicator.d.ts.map +1 -0
  60. package/dist/@types/@ecme/views/concepts/ai/Chat/components/ChatView.d.ts.map +1 -1
  61. package/dist/@types/@ecme/views/concepts/ai/Chat/components/ModelSelect.d.ts +8 -0
  62. package/dist/@types/@ecme/views/concepts/ai/Chat/components/ModelSelect.d.ts.map +1 -0
  63. package/dist/@types/@ecme/views/concepts/ai/Chat/hooks/useChatSend.d.ts.map +1 -1
  64. package/dist/@types/@ecme/views/concepts/ai/Chat/store/aiModelStore.d.ts +25 -0
  65. package/dist/@types/@ecme/views/concepts/ai/Chat/store/aiModelStore.d.ts.map +1 -0
  66. package/dist/@types/base/components/forms/GenericForms/GenericArrayFormSection.d.ts +2 -2
  67. package/dist/@types/base/components/forms/GenericForms/GenericArrayFormSection.d.ts.map +1 -1
  68. package/dist/@types/base/configs/navigation.config/submenu/ticket/cadastros.submenu.d.ts.map +1 -1
  69. package/dist/base/assets/styles/init.css +88 -5
  70. package/dist/base/components/forms/GenericForms/GenericArrayFormSection.js.map +1 -1
  71. package/dist/base/configs/navigation.config/submenu/ticket/cadastros.submenu.js +3 -1
  72. package/dist/base/configs/navigation.config/submenu/ticket/cadastros.submenu.js.map +1 -1
  73. package/lib/@ecme/components/layouts/PostLoginLayout/PostLoginLayout.tsx +2 -1
  74. package/lib/@ecme/components/template/OrbeAiWidget/OrbeAiWidget.tsx +125 -0
  75. package/lib/@ecme/components/template/OrbeAiWidget/ResizeHandles.tsx +47 -0
  76. package/lib/@ecme/components/template/OrbeAiWidget/index.ts +1 -0
  77. package/lib/@ecme/components/template/OrbeAiWidget/useResizablePanel.ts +108 -0
  78. package/lib/@ecme/components/view/ChatBox/ChatBox.tsx +6 -0
  79. package/lib/@ecme/components/view/ChatBox/components/MessageList.tsx +21 -7
  80. package/lib/@ecme/configs/navigation.config/concepts.navigation.config.ts +0 -16
  81. package/lib/@ecme/configs/routes.config/conceptsRoute.ts +0 -9
  82. package/lib/@ecme/services/AiService.ts +40 -0
  83. package/lib/@ecme/services/axios/AxiosBase.ts +45 -24
  84. package/lib/@ecme/views/concepts/ai/Chat/components/AiThinkingIndicator.tsx +24 -0
  85. package/lib/@ecme/views/concepts/ai/Chat/components/ChatLandingView.tsx +17 -17
  86. package/lib/@ecme/views/concepts/ai/Chat/components/ChatView.tsx +11 -4
  87. package/lib/@ecme/views/concepts/ai/Chat/components/ModelSelect.tsx +66 -0
  88. package/lib/@ecme/views/concepts/ai/Chat/hooks/useChatSend.ts +5 -3
  89. package/lib/@ecme/views/concepts/ai/Chat/store/aiModelStore.ts +23 -0
  90. package/lib/base/components/forms/GenericForms/GenericArrayFormSection.tsx +1 -1
  91. package/lib/base/configs/navigation.config/submenu/ticket/cadastros.submenu.ts +2 -0
  92. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"AiService.js","sources":["../../../lib/@ecme/services/AiService.ts"],"sourcesContent":["import ApiService from './ApiService'\n\nexport async function apiPostChat<T>(data: {\n prompt: string\n attachments?: File[]\n}) {\n return ApiService.fetchDataWithAxios<T>({\n url: '/ai/chat',\n method: 'post',\n data,\n })\n}\n\nexport async function apiGetChatHistory<T>() {\n return ApiService.fetchDataWithAxios<T>({\n url: '/ai/chat/history',\n method: 'get',\n })\n}\n\nexport async function apiGetImages<T, U extends Record<string, unknown>>(\n params: U,\n) {\n return ApiService.fetchDataWithAxios<T>({\n url: '/ai/images',\n method: 'get',\n params,\n })\n}\n\nexport async function apiPostImages<T, U extends Record<string, unknown>>(\n data: U,\n) {\n return ApiService.fetchDataWithAxios<T>({\n url: '/ai/images',\n method: 'post',\n data,\n })\n}\n"],"names":[],"mappings":";AAEA,eAAsB,YAAe,MAGlC;AACC,SAAO,WAAW,mBAAsB;AAAA,IACpC,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,EAAA,CACH;AACL;AAEA,eAAsB,oBAAuB;AACzC,SAAO,WAAW,mBAAsB;AAAA,IACpC,KAAK;AAAA,IACL,QAAQ;AAAA,EAAA,CACX;AACL;AAEA,eAAsB,aAClB,QACF;AACE,SAAO,WAAW,mBAAsB;AAAA,IACpC,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,EAAA,CACH;AACL;AAEA,eAAsB,cAClB,MACF;AACE,SAAO,WAAW,mBAAsB;AAAA,IACpC,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,EAAA,CACH;AACL;"}
1
+ {"version":3,"file":"AiService.js","sources":["../../../lib/@ecme/services/AiService.ts"],"sourcesContent":["import ApiService from './ApiService'\nimport { useAiModelStore } from '@/views/concepts/ai/Chat/store/aiModelStore'\n\n/** Informa ao backend qual modelo usar. Sem o header, ele aplica o default. */\nexport const AI_MODEL_HEADER = 'X-Ai-Model'\n\nexport type AiModel = {\n id: string\n label: string\n default: boolean\n cloud: boolean\n}\n\nexport type GetAiModelsResponse = {\n models: AiModel[]\n}\n\n/**\n * Header do modelo escolhido, montado por chamada.\n *\n * Deliberadamente NAO e um interceptor global do AxiosBase: o chat vive no\n * layout de todos os MFEs, e um interceptor faria toda requisicao de todo\n * modulo passar por essa checagem so para servir ao /ai/*.\n */\nconst aiModelHeader = () => {\n const selectedModel = useAiModelStore.getState().selectedModel\n return selectedModel ? { [AI_MODEL_HEADER]: selectedModel } : undefined\n}\n\nexport async function apiPostChat<T>(data: {\n prompt: string\n attachments?: File[]\n}) {\n return ApiService.fetchDataWithAxios<T>({\n url: '/ai/chat',\n method: 'post',\n data,\n headers: aiModelHeader(),\n skipGlobalLoading: true,\n })\n}\n\nexport async function apiGetChatHistory<T>() {\n return ApiService.fetchDataWithAxios<T>({\n url: '/ai/chat/history',\n method: 'get',\n skipGlobalLoading: true,\n })\n}\n\nexport async function apiGetAiModels<T>() {\n return ApiService.fetchDataWithAxios<T>({\n url: '/ai/models',\n method: 'get',\n skipGlobalLoading: true,\n })\n}\n\nexport async function apiGetImages<T, U extends Record<string, unknown>>(\n params: U,\n) {\n return ApiService.fetchDataWithAxios<T>({\n url: '/ai/images',\n method: 'get',\n params,\n skipGlobalLoading: true,\n })\n}\n\nexport async function apiPostImages<T, U extends Record<string, unknown>>(\n data: U,\n) {\n return ApiService.fetchDataWithAxios<T>({\n url: '/ai/images',\n method: 'post',\n data,\n skipGlobalLoading: true,\n })\n}\n"],"names":[],"mappings":";;AAIO,MAAM,kBAAkB;AAoB/B,MAAM,gBAAgB,MAAM;AACxB,QAAM,gBAAgB,gBAAgB,SAAA,EAAW;AACjD,SAAO,gBAAgB,EAAE,CAAC,eAAe,GAAG,kBAAkB;AAClE;AAEA,eAAsB,YAAe,MAGlC;AACC,SAAO,WAAW,mBAAsB;AAAA,IACpC,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA,SAAS,cAAA;AAAA,IACT,mBAAmB;AAAA,EAAA,CACtB;AACL;AAEA,eAAsB,oBAAuB;AACzC,SAAO,WAAW,mBAAsB;AAAA,IACpC,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,mBAAmB;AAAA,EAAA,CACtB;AACL;AAEA,eAAsB,iBAAoB;AACtC,SAAO,WAAW,mBAAsB;AAAA,IACpC,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,mBAAmB;AAAA,EAAA,CACtB;AACL;AAEA,eAAsB,aAClB,QACF;AACE,SAAO,WAAW,mBAAsB;AAAA,IACpC,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA,mBAAmB;AAAA,EAAA,CACtB;AACL;AAEA,eAAsB,cAClB,MACF;AACE,SAAO,WAAW,mBAAsB;AAAA,IACpC,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA,mBAAmB;AAAA,EAAA,CACtB;AACL;"}
@@ -11,25 +11,35 @@ const AxiosBase = axios.create({
11
11
  baseURL: API_URL
12
12
  });
13
13
  let activeRequests = 0;
14
+ const startGlobalLoading = () => {
15
+ const microfrontendId = getCurrentMicrofrontendId();
16
+ const loadingConfig = useLoadingConfigStore.getState();
17
+ if (loadingConfig.getGlobalLoadingEnabled(microfrontendId)) {
18
+ useThemeStore.getState().setLoading(true);
19
+ }
20
+ };
21
+ const stopGlobalLoading = () => {
22
+ const microfrontendId = getCurrentMicrofrontendId();
23
+ const loadingConfig = useLoadingConfigStore.getState();
24
+ if (loadingConfig.getGlobalLoadingEnabled(microfrontendId)) {
25
+ useThemeStore.getState().setLoading(false);
26
+ }
27
+ };
14
28
  AxiosBase.interceptors.request.use(
15
29
  (config) => {
16
- activeRequests++;
17
- if (activeRequests === 1) {
18
- const microfrontendId = getCurrentMicrofrontendId();
19
- const loadingConfig = useLoadingConfigStore.getState();
20
- if (loadingConfig.getGlobalLoadingEnabled(microfrontendId)) {
21
- useThemeStore.getState().setLoading(true);
30
+ if (!config.skipGlobalLoading) {
31
+ activeRequests++;
32
+ if (activeRequests === 1) {
33
+ startGlobalLoading();
22
34
  }
23
35
  }
24
36
  return AxiosRequestIntrceptorConfigCallback(config);
25
37
  },
26
38
  (error) => {
27
- activeRequests = Math.max(0, activeRequests - 1);
28
- if (activeRequests === 0) {
29
- const microfrontendId = getCurrentMicrofrontendId();
30
- const loadingConfig = useLoadingConfigStore.getState();
31
- if (loadingConfig.getGlobalLoadingEnabled(microfrontendId)) {
32
- useThemeStore.getState().setLoading(false);
39
+ if (!error?.config?.skipGlobalLoading) {
40
+ activeRequests = Math.max(0, activeRequests - 1);
41
+ if (activeRequests === 0) {
42
+ stopGlobalLoading();
33
43
  }
34
44
  }
35
45
  return Promise.reject(error);
@@ -37,23 +47,19 @@ AxiosBase.interceptors.request.use(
37
47
  );
38
48
  AxiosBase.interceptors.response.use(
39
49
  (response) => {
40
- activeRequests = Math.max(0, activeRequests - 1);
41
- if (activeRequests === 0) {
42
- const microfrontendId = getCurrentMicrofrontendId();
43
- const loadingConfig = useLoadingConfigStore.getState();
44
- if (loadingConfig.getGlobalLoadingEnabled(microfrontendId)) {
45
- useThemeStore.getState().setLoading(false);
50
+ if (!response.config?.skipGlobalLoading) {
51
+ activeRequests = Math.max(0, activeRequests - 1);
52
+ if (activeRequests === 0) {
53
+ stopGlobalLoading();
46
54
  }
47
55
  }
48
56
  return response;
49
57
  },
50
58
  (error) => {
51
- activeRequests = Math.max(0, activeRequests - 1);
52
- if (activeRequests === 0) {
53
- const microfrontendId = getCurrentMicrofrontendId();
54
- const loadingConfig = useLoadingConfigStore.getState();
55
- if (loadingConfig.getGlobalLoadingEnabled(microfrontendId)) {
56
- useThemeStore.getState().setLoading(false);
59
+ if (!error.config?.skipGlobalLoading) {
60
+ activeRequests = Math.max(0, activeRequests - 1);
61
+ if (activeRequests === 0) {
62
+ stopGlobalLoading();
57
63
  }
58
64
  }
59
65
  AxiosResponseIntrceptorErrorCallback(error);
@@ -1 +1 @@
1
- {"version":3,"file":"AxiosBase.js","sources":["../../../../lib/@ecme/services/axios/AxiosBase.ts"],"sourcesContent":["import type { AxiosError } from \"axios\";\nimport axios from \"axios\";\nimport { API_URL } from \"~/base/configs/api.config\";\nimport { useThemeStore } from \"@/store\";\nimport { useLoadingConfigStore, getCurrentMicrofrontendId } from \"@base/store\";\nimport AxiosRequestIntrceptorConfigCallback from \"./AxiosRequestIntrceptorConfigCallback\";\nimport AxiosResponseIntrceptorErrorCallback from \"./AxiosResponseIntrceptorErrorCallback\";\n\nconst AxiosBase = axios.create({\n timeout: 600000,\n baseURL: API_URL,\n});\n\nlet activeRequests = 0;\n\nAxiosBase.interceptors.request.use(\n (config) => {\n activeRequests++;\n if (activeRequests === 1) {\n const microfrontendId = getCurrentMicrofrontendId();\n const loadingConfig = useLoadingConfigStore.getState();\n if (loadingConfig.getGlobalLoadingEnabled(microfrontendId)) {\n useThemeStore.getState().setLoading(true);\n }\n }\n return AxiosRequestIntrceptorConfigCallback(config);\n },\n (error) => {\n activeRequests = Math.max(0, activeRequests - 1);\n if (activeRequests === 0) {\n const microfrontendId = getCurrentMicrofrontendId();\n const loadingConfig = useLoadingConfigStore.getState();\n if (loadingConfig.getGlobalLoadingEnabled(microfrontendId)) {\n useThemeStore.getState().setLoading(false);\n }\n }\n return Promise.reject(error);\n }\n);\n\nAxiosBase.interceptors.response.use(\n (response) => {\n activeRequests = Math.max(0, activeRequests - 1);\n if (activeRequests === 0) {\n const microfrontendId = getCurrentMicrofrontendId();\n const loadingConfig = useLoadingConfigStore.getState();\n if (loadingConfig.getGlobalLoadingEnabled(microfrontendId)) {\n useThemeStore.getState().setLoading(false);\n }\n }\n return response;\n },\n (error: AxiosError) => {\n activeRequests = Math.max(0, activeRequests - 1);\n if (activeRequests === 0) {\n const microfrontendId = getCurrentMicrofrontendId();\n const loadingConfig = useLoadingConfigStore.getState();\n if (loadingConfig.getGlobalLoadingEnabled(microfrontendId)) {\n useThemeStore.getState().setLoading(false);\n }\n }\n AxiosResponseIntrceptorErrorCallback(error);\n return Promise.reject(error);\n }\n);\n\nexport default AxiosBase;\n"],"names":[],"mappings":";;;;;;;;AAQA,MAAM,YAAY,MAAM,OAAO;AAAA,EAC7B,SAAS;AAAA,EACT,SAAS;AACX,CAAC;AAED,IAAI,iBAAiB;AAErB,UAAU,aAAa,QAAQ;AAAA,EAC7B,CAAC,WAAW;AACV;AACA,QAAI,mBAAmB,GAAG;AACxB,YAA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iosError } from \"axios\";\nimport axios from \"axios\";\nimport { API_URL } from \"~/base/configs/api.config\";\nimport { useThemeStore } from \"@/store\";\nimport { useLoadingConfigStore, getCurrentMicrofrontendId } from \"@base/store\";\nimport AxiosRequestIntrceptorConfigCallback from \"./AxiosRequestIntrceptorConfigCallback\";\nimport AxiosResponseIntrceptorErrorCallback from \"./AxiosResponseIntrceptorErrorCallback\";\n\n/**\n * Permite que uma requisição específica seja excluída do loading global\n * (overlay de tela cheia). Útil para chamadas que exibem seu próprio\n * indicador de carregamento — ex.: o chat de IA, que mostra o balãozinho\n * de \"digitando\". Comportamento padrão inalterado: só afeta requisições\n * que marcarem explicitamente `skipGlobalLoading: true`.\n */\ndeclare module \"axios\" {\n interface AxiosRequestConfig {\n skipGlobalLoading?: boolean;\n }\n}\n\nconst AxiosBase = axios.create({\n timeout: 600000,\n baseURL: API_URL,\n});\n\nlet activeRequests = 0;\n\nconst startGlobalLoading = () => {\n const microfrontendId = getCurrentMicrofrontendId();\n const loadingConfig = useLoadingConfigStore.getState();\n if (loadingConfig.getGlobalLoadingEnabled(microfrontendId)) {\n useThemeStore.getState().setLoading(true);\n }\n};\n\nconst stopGlobalLoading = () => {\n const microfrontendId = getCurrentMicrofrontendId();\n const loadingConfig = useLoadingConfigStore.getState();\n if (loadingConfig.getGlobalLoadingEnabled(microfrontendId)) {\n useThemeStore.getState().setLoading(false);\n }\n};\n\nAxiosBase.interceptors.request.use(\n (config) => {\n if (!config.skipGlobalLoading) {\n activeRequests++;\n if (activeRequests === 1) {\n startGlobalLoading();\n }\n }\n return AxiosRequestIntrceptorConfigCallback(config);\n },\n (error) => {\n if (!error?.config?.skipGlobalLoading) {\n activeRequests = Math.max(0, activeRequests - 1);\n if (activeRequests === 0) {\n stopGlobalLoading();\n }\n }\n return Promise.reject(error);\n }\n);\n\nAxiosBase.interceptors.response.use(\n (response) => {\n if (!response.config?.skipGlobalLoading) {\n activeRequests = Math.max(0, activeRequests - 1);\n if (activeRequests === 0) {\n stopGlobalLoading();\n }\n }\n return response;\n },\n (error: AxiosError) => {\n if (!error.config?.skipGlobalLoading) {\n activeRequests = Math.max(0, activeRequests - 1);\n if (activeRequests === 0) {\n stopGlobalLoading();\n }\n }\n AxiosResponseIntrceptorErrorCallback(error);\n return Promise.reject(error);\n }\n);\n\nexport default AxiosBase;\n"],"names":[],"mappings":";;;;;;;;AAqBA,MAAM,YAAY,MAAM,OAAO;AAAA,EAC7B,SAAS;AAAA,EACT,SAAS;AACX,CAAC;AAED,IAAI,iBAAiB;AAErB,MAAM,qBAAqB,MAAM;AAC/B,QAAM,kBAAkB,0BAAA;AACxB,QAAM,gBAAgB,sBAAsB,SAAA;AAC5C,MAAI,cAAc,wBAAwB,eAAe,GAAG;AAC1D,kBAAc,SAAA,EAAW,WAAW,IAAI;AAAA,EAC1C;AACF;AAEA,MAAM,oBAAoB,MAAM;AAC9B,QAAM,kBAAkB,0BAAA;AACxB,QAAM,gBAAgB,sBAAsB,SAAA;AAC5C,MAAI,cAAc,wBAAwB,eAAe,GAAG;AAC1D,kBAAc,SAAA,EAAW,WAAW,KAAK;AAAA,EAC3C;AACF;AAEA,UAAU,aAAa,QAAQ;AAAA,EAC7B,CAAC,WAAW;AACV,QAAI,CAAC,OAAO,mBAAmB;AAC7B;AACA,UAAI,mBAAmB,GAAG;AACxB,2BAAA;AAAA,MACF;AAAA,IACF;AACA,WAAO,qCAAqC,MAAM;AAAA,EACpD;AAAA,EACA,CAAC,UAAU;AACT,QAAI,CAAC,OAAO,QAAQ,mBAAmB;AACrC,uBAAiB,KAAK,IAAI,GAAG,iBAAiB,CAAC;AAC/C,UAAI,mBAAmB,GAAG;AACxB,0BAAA;AAAA,MACF;AAAA,IACF;AACA,WAAO,QAAQ,OAAO,KAAK;AAAA,EAC7B;AACF;AAEA,UAAU,aAAa,SAAS;AAAA,EAC9B,CAAC,aAAa;AACZ,QAAI,CAAC,SAAS,QAAQ,mBAAmB;AACvC,uBAAiB,KAAK,IAAI,GAAG,iBAAiB,CAAC;AAC/C,UAAI,mBAAmB,GAAG;AACxB,0BAAA;AAAA,MACF;AAAA,IACF;AACA,WAAO;AAAA,EACT;AAAA,EACA,CAAC,UAAsB;AACrB,QAAI,CAAC,MAAM,QAAQ,mBAAmB;AACpC,uBAAiB,KAAK,IAAI,GAAG,iBAAiB,CAAC;AAC/C,UAAI,mBAAmB,GAAG;AACxB,0BAAA;AAAA,MACF;AAAA,IACF;AACA,yCAAqC,KAAK;AAC1C,WAAO,QAAQ,OAAO,KAAK;AAAA,EAC7B;AACF;"}
@@ -1,6 +1,6 @@
1
1
  import { default as default2 } from "./ApiService.js";
2
2
  import { apiGetPricingPlans, apiGetRolesPermissionsRoles, apiGetRolesPermissionsUsers, apiGetSettingsBilling, apiGetSettingsIntergration, apiGetSettingsNotification, apiGetSettingsProfile } from "./AccontsService.js";
3
- import { apiGetChatHistory, apiGetImages, apiPostChat, apiPostImages } from "./AiService.js";
3
+ import { AI_MODEL_HEADER, apiGetAiModels, apiGetChatHistory, apiGetImages, apiPostChat, apiPostImages } from "./AiService.js";
4
4
  import { apiForgotPassword, apiResetPassword, apiSignIn, apiSignOut, apiSignUp } from "./AuthService.js";
5
5
  import { apiGetCalendar } from "./CalendarService.js";
6
6
  import { apiGetChats, apiGetContactDetails, apiGetContacts, apiGetConversation } from "./ChatService.js";
@@ -16,8 +16,10 @@ import { apiGetOrder, apiGetOrderList } from "./OrderService.js";
16
16
  import { apiGetProduct, apiGetProductList } from "./ProductService.js";
17
17
  import { apiGetProject, apiGetProjectMembers, apiGetProjectTask, apiGetProjectTasks, apiGetProjects, apiGetScrumBoards, apiPostProject } from "./ProjectService.js";
18
18
  export {
19
+ AI_MODEL_HEADER,
19
20
  default2 as ApiService,
20
21
  apiForgotPassword,
22
+ apiGetAiModels,
21
23
  apiGetAnalyticDashboard,
22
24
  apiGetArticleList,
23
25
  apiGetCalendar,
@@ -0,0 +1,23 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { TbSparkles } from "react-icons/tb";
3
+ const AiThinkingIndicator = () => {
4
+ return /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-gray-500 dark:text-gray-400", children: [
5
+ /* @__PURE__ */ jsx(
6
+ TbSparkles,
7
+ {
8
+ size: 18,
9
+ className: "text-primary motion-safe:animate-pulse"
10
+ }
11
+ ),
12
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: "Orbe AI está pensando" }),
13
+ /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1", children: [
14
+ /* @__PURE__ */ jsx("span", { className: "size-1.5 rounded-full bg-primary motion-safe:animate-bounce [animation-delay:-0.3s]" }),
15
+ /* @__PURE__ */ jsx("span", { className: "size-1.5 rounded-full bg-primary motion-safe:animate-bounce [animation-delay:-0.15s]" }),
16
+ /* @__PURE__ */ jsx("span", { className: "size-1.5 rounded-full bg-primary motion-safe:animate-bounce" })
17
+ ] })
18
+ ] });
19
+ };
20
+ export {
21
+ AiThinkingIndicator as default
22
+ };
23
+ //# sourceMappingURL=AiThinkingIndicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiThinkingIndicator.js","sources":["../../../../../../../lib/@ecme/views/concepts/ai/Chat/components/AiThinkingIndicator.tsx"],"sourcesContent":["import { TbSparkles } from 'react-icons/tb'\n\n/**\n * Indicador de \"pensando\" do agente Orbe AI — loader profissional exibido\n * enquanto a resposta está sendo gerada (estado isTyping do chat).\n */\nconst AiThinkingIndicator = () => {\n return (\n <span className=\"flex items-center gap-2 text-gray-500 dark:text-gray-400\">\n <TbSparkles\n size={18}\n className=\"text-primary motion-safe:animate-pulse\"\n />\n <span className=\"text-sm\">Orbe AI está pensando</span>\n <span className=\"inline-flex items-center gap-1\">\n <span className=\"size-1.5 rounded-full bg-primary motion-safe:animate-bounce [animation-delay:-0.3s]\" />\n <span className=\"size-1.5 rounded-full bg-primary motion-safe:animate-bounce [animation-delay:-0.15s]\" />\n <span className=\"size-1.5 rounded-full bg-primary motion-safe:animate-bounce\" />\n </span>\n </span>\n )\n}\n\nexport default AiThinkingIndicator\n"],"names":[],"mappings":";;AAMA,MAAM,sBAAsB,MAAM;AAC9B,SACI,qBAAC,QAAA,EAAK,WAAU,4DACZ,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,MAAM;AAAA,QACN,WAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEd,oBAAC,QAAA,EAAK,WAAU,WAAU,UAAA,yBAAqB;AAAA,IAC/C,qBAAC,QAAA,EAAK,WAAU,kCACZ,UAAA;AAAA,MAAA,oBAAC,QAAA,EAAK,WAAU,sFAAA,CAAsF;AAAA,MACtG,oBAAC,QAAA,EAAK,WAAU,uFAAA,CAAuF;AAAA,MACvG,oBAAC,QAAA,EAAK,WAAU,8DAAA,CAA8D;AAAA,IAAA,EAAA,CAClF;AAAA,EAAA,GACJ;AAER;"}
@@ -9,38 +9,38 @@ const suggeustionIcon = {
9
9
  };
10
10
  const promptSuggestion = [
11
11
  {
12
- title: "Help me sound like an expert for an upcoming trip",
13
- prompt: `I'm going whale watching this weekend and want to appear knowledgeable about killer whales. Tell me a few unique and interesting facts I can share.`,
12
+ title: "Como consultar um pedido de venda?",
13
+ prompt: "Como faço para consultar um pedido de venda no Orbe Agro?",
14
14
  type: "guide"
15
15
  },
16
16
  {
17
- title: "Outline an logical sales pitch for a new product",
18
- prompt: `Structure a sales pitch for a hair dryer that's also a microphone. Be concise and organize the sales pitch logically. `,
19
- type: "writing"
17
+ title: "Para que serve o módulo de Trade?",
18
+ prompt: "Explique para que serve o módulo de Trade no Orbe Agro.",
19
+ type: "idea"
20
20
  },
21
21
  {
22
- title: "Help me get organized with a list of 10 tips",
23
- prompt: `Give me 10 tips for room organization. `,
24
- type: "idea"
22
+ title: "Como abrir um processo de armazenagem?",
23
+ prompt: "Quais são os passos para abrir um processo de armazenagem de grãos no Orbe Agro?",
24
+ type: "writing"
25
25
  },
26
26
  {
27
- title: "Write code for a specific task, including edge cases",
28
- prompt: `Write a Java function that takes a path as an input and creates a file storing the current system date. Consider edge cases.`,
27
+ title: "Onde vejo o limite de crédito de um cliente?",
28
+ prompt: "Onde encontro o limite de crédito de um cliente no Orbe Agro?",
29
29
  type: "coding"
30
30
  }
31
31
  ];
32
32
  const ChatLandingView = () => {
33
33
  const { handleSend } = useChatSend();
34
- return /* @__PURE__ */ jsx("div", { className: "max-w-[900px] w-full mx-auto mt-20", children: /* @__PURE__ */ jsxs("div", { children: [
35
- /* @__PURE__ */ jsxs("div", { className: "heading-text text-4xl leading-snug", children: [
36
- /* @__PURE__ */ jsx("span", { className: "font-semibold bg-gradient-to-r from-indigo-500 to-red-400 bg-clip-text text-transparent text-5xl", children: "Hello, there" }),
34
+ return /* @__PURE__ */ jsx("div", { className: "max-w-[900px] w-full mx-auto mt-6", children: /* @__PURE__ */ jsxs("div", { children: [
35
+ /* @__PURE__ */ jsxs("div", { className: "heading-text text-2xl leading-snug", children: [
36
+ /* @__PURE__ */ jsx("span", { className: "font-semibold bg-gradient-to-r from-indigo-500 to-red-400 bg-clip-text text-transparent text-3xl", children: "Olá!" }),
37
37
  /* @__PURE__ */ jsx("br", {}),
38
- /* @__PURE__ */ jsx("span", { children: "How can I help you today?" })
38
+ /* @__PURE__ */ jsx("span", { children: "Como posso te ajudar hoje?" })
39
39
  ] }),
40
- /* @__PURE__ */ jsx("div", { className: "mt-8 grid grid-cols-2 xl:grid-cols-4 gap-4", children: promptSuggestion.map((suggestion) => /* @__PURE__ */ jsxs(
40
+ /* @__PURE__ */ jsx("div", { className: "mt-6 grid grid-cols-1 sm:grid-cols-2 gap-3", children: promptSuggestion.map((suggestion) => /* @__PURE__ */ jsxs(
41
41
  "div",
42
42
  {
43
- className: "flex flex-col gap-4 justify-between rounded-xl bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 p-5 min-h-40 2xl:min-h-60 cursor-pointer",
43
+ className: "flex flex-col gap-3 justify-between rounded-xl bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 p-4 min-h-28 cursor-pointer",
44
44
  role: "button",
45
45
  onClick: () => handleSend(suggestion.title),
46
46
  children: [
@@ -1 +1 @@
1
- {"version":3,"file":"ChatLandingView.js","sources":["../../../../../../../lib/@ecme/views/concepts/ai/Chat/components/ChatLandingView.tsx"],"sourcesContent":["import useChatSend from '../hooks/useChatSend'\nimport {\n PiLightbulbDuotone,\n PiBookOpenTextDuotone,\n PiCompassDuotone,\n PiCodeDuotone,\n} from 'react-icons/pi'\nimport type { ReactNode } from 'react'\n\ntype PromptType = 'idea' | 'guide' | 'writing' | 'coding'\n\nconst suggeustionIcon: Record<PromptType, ReactNode> = {\n idea: <PiLightbulbDuotone className=\"text-blue-500\" />,\n guide: <PiCompassDuotone className=\"text-emerald-500\" />,\n writing: <PiBookOpenTextDuotone className=\"text-amber-500\" />,\n coding: <PiCodeDuotone className=\"text-indigo-500\" />,\n}\n\nconst promptSuggestion: {\n title: string\n prompt: string\n type: PromptType\n}[] = [\n {\n title: 'Help me sound like an expert for an upcoming trip',\n prompt: `I'm going whale watching this weekend and want to appear knowledgeable about killer whales. Tell me a few unique and interesting facts I can share.`,\n type: 'guide',\n },\n {\n title: 'Outline an logical sales pitch for a new product',\n prompt: `Structure a sales pitch for a hair dryer that's also a microphone. Be concise and organize the sales pitch logically. `,\n type: 'writing',\n },\n {\n title: 'Help me get organized with a list of 10 tips',\n prompt: `Give me 10 tips for room organization. `,\n type: 'idea',\n },\n {\n title: 'Write code for a specific task, including edge cases',\n prompt: `Write a Java function that takes a path as an input and creates a file storing the current system date. Consider edge cases.`,\n type: 'coding',\n },\n]\n\nconst ChatLandingView = () => {\n const { handleSend } = useChatSend()\n\n return (\n <div className=\"max-w-[900px] w-full mx-auto mt-20\">\n <div>\n <div className=\"heading-text text-4xl leading-snug\">\n <span className=\"font-semibold bg-gradient-to-r from-indigo-500 to-red-400 bg-clip-text text-transparent text-5xl\">\n Hello, there\n </span>\n <br />\n <span>How can I help you today?</span>\n </div>\n <div className=\"mt-8 grid grid-cols-2 xl:grid-cols-4 gap-4\">\n {promptSuggestion.map((suggestion) => (\n <div\n key={suggestion.title}\n className=\"flex flex-col gap-4 justify-between rounded-xl bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 p-5 min-h-40 2xl:min-h-60 cursor-pointer\"\n role=\"button\"\n onClick={() => handleSend(suggestion.title)}\n >\n <h6 className=\"font-normal\">{suggestion.title}</h6>\n <div>\n <div className=\"bg-white dark:bg-gray-800 rounded-full p-2 inline-flex\">\n <span className=\"text-2xl\">\n {suggeustionIcon[suggestion.type]}\n </span>\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n )\n}\n\nexport default ChatLandingView\n"],"names":[],"mappings":";;;AAWA,MAAM,kBAAiD;AAAA,EACnD,MAAM,oBAAC,oBAAA,EAAmB,WAAU,gBAAA,CAAgB;AAAA,EACpD,OAAO,oBAAC,kBAAA,EAAiB,WAAU,mBAAA,CAAmB;AAAA,EACtD,SAAS,oBAAC,uBAAA,EAAsB,WAAU,iBAAA,CAAiB;AAAA,EAC3D,QAAQ,oBAAC,eAAA,EAAc,WAAU,kBAAA,CAAkB;AACvD;AAEA,MAAM,mBAIA;AAAA,EACF;AAAA,IACI,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,EAAA;AAAA,EAEV;AAAA,IACI,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,EAAA;AAAA,EAEV;AAAA,IACI,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,EAAA;AAAA,EAEV;AAAA,IACI,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,EAAA;AAEd;AAEA,MAAM,kBAAkB,MAAM;AAC1B,QAAM,EAAE,WAAA,IAAe,YAAA;AAEvB,SACI,oBAAC,OAAA,EAAI,WAAU,sCACX,+BAAC,OAAA,EACG,UAAA;AAAA,IAAA,qBAAC,OAAA,EAAI,WAAU,sCACX,UAAA;AAAA,MAAA,oBAAC,QAAA,EAAK,WAAU,oGAAmG,UAAA,gBAEnH;AAAA,0BACC,MAAA,EAAG;AAAA,MACJ,oBAAC,UAAK,UAAA,4BAAA,CAAyB;AAAA,IAAA,GACnC;AAAA,wBACC,OAAA,EAAI,WAAU,8CACV,UAAA,iBAAiB,IAAI,CAAC,eACnB;AAAA,MAAC;AAAA,MAAA;AAAA,QAEG,WAAU;AAAA,QACV,MAAK;AAAA,QACL,SAAS,MAAM,WAAW,WAAW,KAAK;AAAA,QAE1C,UAAA;AAAA,UAAA,oBAAC,MAAA,EAAG,WAAU,eAAe,UAAA,WAAW,OAAM;AAAA,UAC9C,oBAAC,OAAA,EACG,UAAA,oBAAC,OAAA,EAAI,WAAU,0DACX,UAAA,oBAAC,QAAA,EAAK,WAAU,YACX,UAAA,gBAAgB,WAAW,IAAI,GACpC,GACJ,EAAA,CACJ;AAAA,QAAA;AAAA,MAAA;AAAA,MAZK,WAAW;AAAA,IAAA,CAcvB,EAAA,CACL;AAAA,EAAA,EAAA,CACJ,EAAA,CACJ;AAER;"}
1
+ {"version":3,"file":"ChatLandingView.js","sources":["../../../../../../../lib/@ecme/views/concepts/ai/Chat/components/ChatLandingView.tsx"],"sourcesContent":["import useChatSend from '../hooks/useChatSend'\nimport {\n PiLightbulbDuotone,\n PiBookOpenTextDuotone,\n PiCompassDuotone,\n PiCodeDuotone,\n} from 'react-icons/pi'\nimport type { ReactNode } from 'react'\n\ntype PromptType = 'idea' | 'guide' | 'writing' | 'coding'\n\nconst suggeustionIcon: Record<PromptType, ReactNode> = {\n idea: <PiLightbulbDuotone className=\"text-blue-500\" />,\n guide: <PiCompassDuotone className=\"text-emerald-500\" />,\n writing: <PiBookOpenTextDuotone className=\"text-amber-500\" />,\n coding: <PiCodeDuotone className=\"text-indigo-500\" />,\n}\n\nconst promptSuggestion: {\n title: string\n prompt: string\n type: PromptType\n}[] = [\n {\n title: 'Como consultar um pedido de venda?',\n prompt: 'Como faço para consultar um pedido de venda no Orbe Agro?',\n type: 'guide',\n },\n {\n title: 'Para que serve o módulo de Trade?',\n prompt: 'Explique para que serve o módulo de Trade no Orbe Agro.',\n type: 'idea',\n },\n {\n title: 'Como abrir um processo de armazenagem?',\n prompt: 'Quais são os passos para abrir um processo de armazenagem de grãos no Orbe Agro?',\n type: 'writing',\n },\n {\n title: 'Onde vejo o limite de crédito de um cliente?',\n prompt: 'Onde encontro o limite de crédito de um cliente no Orbe Agro?',\n type: 'coding',\n },\n]\n\nconst ChatLandingView = () => {\n const { handleSend } = useChatSend()\n\n return (\n <div className=\"max-w-[900px] w-full mx-auto mt-6\">\n <div>\n <div className=\"heading-text text-2xl leading-snug\">\n <span className=\"font-semibold bg-gradient-to-r from-indigo-500 to-red-400 bg-clip-text text-transparent text-3xl\">\n Olá!\n </span>\n <br />\n <span>Como posso te ajudar hoje?</span>\n </div>\n <div className=\"mt-6 grid grid-cols-1 sm:grid-cols-2 gap-3\">\n {promptSuggestion.map((suggestion) => (\n <div\n key={suggestion.title}\n className=\"flex flex-col gap-3 justify-between rounded-xl bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 p-4 min-h-28 cursor-pointer\"\n role=\"button\"\n onClick={() => handleSend(suggestion.title)}\n >\n <h6 className=\"font-normal\">{suggestion.title}</h6>\n <div>\n <div className=\"bg-white dark:bg-gray-800 rounded-full p-2 inline-flex\">\n <span className=\"text-2xl\">\n {suggeustionIcon[suggestion.type]}\n </span>\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n )\n}\n\nexport default ChatLandingView\n"],"names":[],"mappings":";;;AAWA,MAAM,kBAAiD;AAAA,EACnD,MAAM,oBAAC,oBAAA,EAAmB,WAAU,gBAAA,CAAgB;AAAA,EACpD,OAAO,oBAAC,kBAAA,EAAiB,WAAU,mBAAA,CAAmB;AAAA,EACtD,SAAS,oBAAC,uBAAA,EAAsB,WAAU,iBAAA,CAAiB;AAAA,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"}
@@ -6,6 +6,7 @@ import ChatLandingView from "./ChatLandingView.js";
6
6
  import ChatMobileNav from "./ChatMobileNav.js";
7
7
  import ChatCustomContent from "./ChatCustomContent.js";
8
8
  import ChatCustomAction from "./ChatCustomAction.js";
9
+ import AiThinkingIndicator from "./AiThinkingIndicator.js";
9
10
  import { usGenerativeChatStore } from "../store/generativeChatStore.js";
10
11
  import useChatSend from "../hooks/useChatSend.js";
11
12
  import Card from "../../../../../components/ui/Card/Card.js";
@@ -47,10 +48,12 @@ const ChatView = () => {
47
48
  {
48
49
  ref: scrollRef,
49
50
  messageList,
50
- placeholder: "Enter a prompt here",
51
+ placeholder: "Pergunte algo sobre o Orbe Agro…",
51
52
  showMessageList: Boolean(selectedConversation),
52
- showAvatar: true,
53
- avatarGap: true,
53
+ showAvatar: false,
54
+ avatarGap: false,
55
+ myBubbleClass: "bg-primary text-white",
56
+ renderTyping: () => /* @__PURE__ */ jsx(AiThinkingIndicator, {}),
54
57
  containerClass: "h-[calc(100%-30px)] xl:h-full",
55
58
  messageListClass: "h-[calc(100%-100px)] xl:h-[calc(100%-70px)]",
56
59
  typing: isTyping ? {
@@ -83,7 +86,7 @@ const ChatView = () => {
83
86
  return null;
84
87
  },
85
88
  onInputChange: handleInputChange,
86
- children: !selectedConversation && /* @__PURE__ */ jsx(ChatLandingView, {})
89
+ children: !selectedConversation && /* @__PURE__ */ jsx("div", { className: "flex-1 min-h-0 overflow-y-auto", children: /* @__PURE__ */ jsx(ChatLandingView, {}) })
87
90
  }
88
91
  )
89
92
  ] });
@@ -1 +1 @@
1
- {"version":3,"file":"ChatView.js","sources":["../../../../../../../lib/@ecme/views/concepts/ai/Chat/components/ChatView.tsx"],"sourcesContent":["import { useRef, useEffect, useMemo } from 'react'\nimport Card from '@/components/ui/Card'\nimport ChatBox from '@/components/view/ChatBox'\nimport ChatLandingView from './ChatLandingView'\nimport ChatMobileNav from './ChatMobileNav'\nimport ChatCustomContent from './ChatCustomContent'\nimport ChatCustomAction from './ChatCustomAction'\nimport { usGenerativeChatStore } from '../store/generativeChatStore'\nimport useChatSend from '../hooks/useChatSend'\nimport type { ScrollBarRef } from '@/components/ui/ScrollBar'\n\nconst ChatView = () => {\n const scrollRef = useRef<ScrollBarRef>(null)\n const { selectedConversation, chatHistory, isTyping, disabledChatFresh } =\n usGenerativeChatStore()\n const { handleSend } = useChatSend()\n\n const scrollToBottom = () => {\n if (scrollRef.current?.getScrollElement) {\n const scrollElement = scrollRef.current.getScrollElement()\n if (scrollElement) {\n scrollElement.scrollTop = scrollElement.scrollHeight\n }\n }\n }\n\n useEffect(() => {\n scrollToBottom()\n }, [selectedConversation, chatHistory])\n\n const messageList = useMemo(() => {\n const chat = chatHistory.find(\n (chat) => chat.id === selectedConversation,\n )\n return chat?.conversation || []\n }, [selectedConversation, chatHistory])\n\n const handleInputChange = async ({\n value,\n }: {\n value: string\n attachments?: File[]\n }) => {\n await handleSend(value)\n }\n\n const handleFinish = (id: string) => {\n disabledChatFresh(id)\n scrollToBottom()\n }\n\n return (\n <Card className=\"flex-1 h-full\" bodyClass=\"h-full\">\n <ChatMobileNav />\n <ChatBox\n ref={scrollRef}\n messageList={messageList}\n placeholder=\"Enter a prompt here\"\n showMessageList={Boolean(selectedConversation)}\n showAvatar={true}\n avatarGap={true}\n containerClass=\"h-[calc(100%-30px)] xl:h-full\"\n messageListClass=\"h-[calc(100%-100px)] xl:h-[calc(100%-70px)]\"\n typing={\n isTyping\n ? {\n id: 'ai',\n name: 'Chat AI',\n avatarImageUrl: '/img/thumbs/ai.jpg',\n }\n : false\n }\n customRenderer={(message) => {\n if (message.sender.id === 'ai') {\n return (\n <ChatCustomContent\n content={message.content as string}\n triggerTyping={\n message.fresh ? message.fresh : false\n }\n onFinish={() => handleFinish(message.id)}\n />\n )\n }\n\n return message.content\n }}\n customAction={(message) => {\n if (message.sender.id === 'ai') {\n return (\n <ChatCustomAction\n content={message.content as string}\n />\n )\n }\n\n return null\n }}\n onInputChange={handleInputChange}\n >\n {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EpB;AAAA,QAEV,gBAAgB,CAAC,YAAY;AACzB,cAAI,QAAQ,OAAO,OAAO,MAAM;AAC5B,mBACI;AAAA,cAAC;AAAA,cAAA;AAAA,gBACG,SAAS,QAAQ;AAAA,gBACjB,eACI,QAAQ,QAAQ,QAAQ,QAAQ;AAAA,gBAEpC,UAAU,MAAM,aAAa,QAAQ,EAAE;AAAA,cAAA;AAAA,YAAA;AAAA,UAGnD;AAEA,iBAAO,QAAQ;AAAA,QACnB;AAAA,QACA,cAAc,CAAC,YAAY;AACvB,cAAI,QAAQ,OAAO,OAAO,MAAM;AAC5B,mBACI;AAAA,cAAC;AAAA,cAAA;AAAA,gBACG,SAAS,QAAQ;AAAA,cAAA;AAAA,YAAA;AAAA,UAG7B;AAEA,iBAAO;AAAA,QACX;AAAA,QACA,eAAe;AAAA,QAEd,UAAA,CAAC,wBAAwB,oBAAC,iBAAA,CAAA,CAAgB;AAAA,MAAA;AAAA,IAAA;AAAA,EAC/C,GACJ;AAER;"}
1
+ {"version":3,"file":"ChatView.js","sources":["../../../../../../../lib/@ecme/views/concepts/ai/Chat/components/ChatView.tsx"],"sourcesContent":["import { useRef, useEffect, useMemo } from 'react'\nimport Card from '@/components/ui/Card'\nimport ChatBox from '@/components/view/ChatBox'\nimport ChatLandingView from './ChatLandingView'\nimport ChatMobileNav from './ChatMobileNav'\nimport ChatCustomContent from './ChatCustomContent'\nimport ChatCustomAction from './ChatCustomAction'\nimport AiThinkingIndicator from './AiThinkingIndicator'\nimport { usGenerativeChatStore } from '../store/generativeChatStore'\nimport useChatSend from '../hooks/useChatSend'\nimport type { ScrollBarRef } from '@/components/ui/ScrollBar'\n\nconst ChatView = () => {\n const scrollRef = useRef<ScrollBarRef>(null)\n const { selectedConversation, chatHistory, isTyping, disabledChatFresh } =\n usGenerativeChatStore()\n const { handleSend } = useChatSend()\n\n const scrollToBottom = () => {\n if (scrollRef.current?.getScrollElement) {\n const scrollElement = scrollRef.current.getScrollElement()\n if (scrollElement) {\n scrollElement.scrollTop = scrollElement.scrollHeight\n }\n }\n }\n\n useEffect(() => {\n scrollToBottom()\n }, [selectedConversation, chatHistory])\n\n const messageList = useMemo(() => {\n const chat = chatHistory.find(\n (chat) => chat.id === selectedConversation,\n )\n return chat?.conversation || []\n }, [selectedConversation, chatHistory])\n\n const handleInputChange = async ({\n value,\n }: {\n value: string\n attachments?: File[]\n }) => {\n await handleSend(value)\n }\n\n const handleFinish = (id: string) => {\n disabledChatFresh(id)\n scrollToBottom()\n }\n\n return (\n <Card className=\"flex-1 h-full\" bodyClass=\"h-full\">\n <ChatMobileNav />\n <ChatBox\n ref={scrollRef}\n messageList={messageList}\n placeholder=\"Pergunte algo sobre o Orbe Agro…\"\n showMessageList={Boolean(selectedConversation)}\n showAvatar={false}\n avatarGap={false}\n myBubbleClass=\"bg-primary text-white\"\n renderTyping={() => <AiThinkingIndicator />}\n containerClass=\"h-[calc(100%-30px)] xl:h-full\"\n messageListClass=\"h-[calc(100%-100px)] xl:h-[calc(100%-70px)]\"\n typing={\n isTyping\n ? {\n id: 'ai',\n name: 'Chat AI',\n avatarImageUrl: '/img/thumbs/ai.jpg',\n }\n : false\n }\n customRenderer={(message) => {\n if (message.sender.id === 'ai') {\n return (\n <ChatCustomContent\n content={message.content as string}\n triggerTyping={\n message.fresh ? message.fresh : false\n }\n onFinish={() => handleFinish(message.id)}\n />\n )\n }\n\n return message.content\n }}\n customAction={(message) => {\n if (message.sender.id === 'ai') {\n return (\n <ChatCustomAction\n content={message.content as string}\n />\n )\n }\n\n return null\n }}\n onInputChange={handleInputChange}\n >\n {!selectedConversation && (\n <div className=\"flex-1 min-h-0 overflow-y-auto\">\n <ChatLandingView />\n </div>\n )}\n </ChatBox>\n </Card>\n )\n}\n\nexport default ChatView\n"],"names":["chat"],"mappings":";;;;;;;;;;;;;AAYA,MAAM,WAAW,MAAM;AACnB,QAAM,YAAY,OAAqB,IAAI;AAC3C,QAAM,EAAE,sBAAsB,aAAa,UAAU,kBAAA,IACjD,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A,gBACjB,eACI,QAAQ,QAAQ,QAAQ,QAAQ;AAAA,gBAEpC,UAAU,MAAM,aAAa,QAAQ,EAAE;AAAA,cAAA;AAAA,YAAA;AAAA,UAGnD;AAEA,iBAAO,QAAQ;AAAA,QACnB;AAAA,QACA,cAAc,CAAC,YAAY;AACvB,cAAI,QAAQ,OAAO,OAAO,MAAM;AAC5B,mBACI;AAAA,cAAC;AAAA,cAAA;AAAA,gBACG,SAAS,QAAQ;AAAA,cAAA;AAAA,YAAA;AAAA,UAG7B;AAEA,iBAAO;AAAA,QACX;AAAA,QACA,eAAe;AAAA,QAEd,UAAA,CAAC,wBACE,oBAAC,OAAA,EAAI,WAAU,kCACX,UAAA,oBAAC,mBAAgB,EAAA,CACrB;AAAA,MAAA;AAAA,IAAA;AAAA,EAER,GACJ;AAER;"}
@@ -0,0 +1,48 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useState, useEffect } from "react";
3
+ import { apiGetAiModels } from "../../../../../services/AiService.js";
4
+ import { useAiModelStore } from "../store/aiModelStore.js";
5
+ const ModelSelect = () => {
6
+ const [models, setModels] = useState([]);
7
+ const selectedModel = useAiModelStore((state) => state.selectedModel);
8
+ const setSelectedModel = useAiModelStore((state) => state.setSelectedModel);
9
+ useEffect(() => {
10
+ let active = true;
11
+ apiGetAiModels().then((resp) => {
12
+ if (!active) {
13
+ return;
14
+ }
15
+ setModels(resp.models);
16
+ const current = useAiModelStore.getState().selectedModel;
17
+ const exists = resp.models.some((model) => model.id === current);
18
+ if (!current || !exists) {
19
+ const fallback = resp.models.find((model) => model.default) ?? resp.models[0];
20
+ if (fallback) {
21
+ useAiModelStore.getState().setSelectedModel(fallback.id);
22
+ }
23
+ }
24
+ }).catch(() => {
25
+ });
26
+ return () => {
27
+ active = false;
28
+ };
29
+ }, []);
30
+ if (models.length === 0) {
31
+ return null;
32
+ }
33
+ return /* @__PURE__ */ jsx(
34
+ "select",
35
+ {
36
+ "aria-label": "Modelo de IA",
37
+ title: "Modelo de IA",
38
+ className: "max-w-[9rem] truncate rounded-lg border border-gray-300 bg-white px-2 py-1 text-xs dark:border-gray-600 dark:bg-gray-800",
39
+ value: selectedModel ?? "",
40
+ onChange: (event) => setSelectedModel(event.target.value),
41
+ children: models.map((model) => /* @__PURE__ */ jsx("option", { value: model.id, children: model.label }, model.id))
42
+ }
43
+ );
44
+ };
45
+ export {
46
+ ModelSelect as default
47
+ };
48
+ //# sourceMappingURL=ModelSelect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelSelect.js","sources":["../../../../../../../lib/@ecme/views/concepts/ai/Chat/components/ModelSelect.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { apiGetAiModels } from '@/services/AiService'\nimport { useAiModelStore } from '../store/aiModelStore'\nimport type { AiModel, GetAiModelsResponse } from '@/services/AiService'\n\n/**\n * Seletor do modelo de IA do chat (GET /ai/models). Se o backend estiver\n * indisponivel ou nao expuser modelos, o seletor nao aparece e o backend usa o\n * modelo default — por isso ele pode ser montado sem medo em qualquer MFE.\n */\nconst ModelSelect = () => {\n const [models, setModels] = useState<AiModel[]>([])\n const selectedModel = useAiModelStore((state) => state.selectedModel)\n const setSelectedModel = useAiModelStore((state) => state.setSelectedModel)\n\n useEffect(() => {\n let active = true\n apiGetAiModels<GetAiModelsResponse>()\n .then((resp) => {\n if (!active) {\n return\n }\n setModels(resp.models)\n const current = useAiModelStore.getState().selectedModel\n const exists = resp.models.some((model) => model.id === current)\n if (!current || !exists) {\n const fallback =\n resp.models.find((model) => model.default) ??\n resp.models[0]\n if (fallback) {\n useAiModelStore\n .getState()\n .setSelectedModel(fallback.id)\n }\n }\n })\n .catch(() => {\n // Sem lista de modelos: o backend responde com o default.\n })\n return () => {\n active = false\n }\n }, [])\n\n if (models.length === 0) {\n return null\n }\n\n return (\n <select\n aria-label=\"Modelo de IA\"\n title=\"Modelo de IA\"\n className=\"max-w-[9rem] truncate rounded-lg border border-gray-300 bg-white px-2 py-1 text-xs dark:border-gray-600 dark:bg-gray-800\"\n value={selectedModel ?? ''}\n onChange={(event) => setSelectedModel(event.target.value)}\n >\n {models.map((model) => (\n <option key={model.id} value={model.id}>\n {model.label}\n </option>\n ))}\n </select>\n )\n}\n\nexport default ModelSelect\n"],"names":[],"mappings":";;;;AAUA,MAAM,cAAc,MAAM;AACtB,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAoB,CAAA,CAAE;AAClD,QAAM,gBAAgB,gBAAgB,CAAC,UAAU,MAAM,aAAa;AACpE,QAAM,mBAAmB,gBAAgB,CAAC,UAAU,MAAM,gBAAgB;AAE1E,YAAU,MAAM;AACZ,QAAI,SAAS;AACb,mBAAA,EACK,KAAK,CAAC,SAAS;AACZ,UAAI,CAAC,QAAQ;AACT;AAAA,MACJ;AACA,gBAAU,KAAK,MAAM;AACrB,YAAM,UAAU,gBAAgB,SAAA,EAAW;AAC3C,YAAM,SAAS,KAAK,OAAO,KAAK,CAAC,UAAU,MAAM,OAAO,OAAO;AAC/D,UAAI,CAAC,WAAW,CAAC,QAAQ;AACrB,cAAM,WACF,KAAK,OAAO,KAAK,CAAC,UAAU,MAAM,OAAO,KACzC,KAAK,OAAO,CAAC;AACjB,YAAI,UAAU;AACV,0BACK,SAAA,EACA,iBAAiB,SAAS,EAAE;AAAA,QACrC;AAAA,MACJ;AAAA,IACJ,CAAC,EACA,MAAM,MAAM;AAAA,IAEb,CAAC;AACL,WAAO,MAAM;AACT,eAAS;AAAA,IACb;AAAA,EACJ,GAAG,CAAA,CAAE;AAEL,MAAI,OAAO,WAAW,GAAG;AACrB,WAAO;AAAA,EACX;AAEA,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,cAAW;AAAA,MACX,OAAM;AAAA,MACN,WAAU;AAAA,MACV,OAAO,iBAAiB;AAAA,MACxB,UAAU,CAAC,UAAU,iBAAiB,MAAM,OAAO,KAAK;AAAA,MAEvD,UAAA,OAAO,IAAI,CAAC,UACT,oBAAC,UAAA,EAAsB,OAAO,MAAM,IAC/B,UAAA,MAAM,MAAA,GADE,MAAM,EAEnB,CACH;AAAA,IAAA;AAAA,EAAA;AAGb;"}
@@ -1,8 +1,11 @@
1
1
  import { usGenerativeChatStore } from "../store/generativeChatStore.js";
2
2
  import { apiPostChat } from "../../../../../services/AiService.js";
3
+ import "../../../../../auth/index.js";
3
4
  import dayjs from "dayjs";
4
5
  import uniqueId from "lodash/uniqueId";
6
+ import useAuth from "../../../../../auth/useAuth.js";
5
7
  const useChatSend = () => {
8
+ const { user } = useAuth();
6
9
  const {
7
10
  selectedConversation,
8
11
  setSelectedConversation,
@@ -14,9 +17,9 @@ const useChatSend = () => {
14
17
  pushConversation(id, {
15
18
  id: uniqueId("ai-conversation-"),
16
19
  sender: {
17
- id: "1",
18
- name: "Angelina Gotelli",
19
- avatarImageUrl: "/img/avatars/thumb-1.jpg"
20
+ id: user.userId ?? "me",
21
+ name: user.userName ?? "Você",
22
+ avatarImageUrl: user.avatar ?? void 0
20
23
  },
21
24
  content: prompt,
22
25
  timestamp: dayjs().toDate(),
@@ -1 +1 @@
1
- {"version":3,"file":"useChatSend.js","sources":["../../../../../../../lib/@ecme/views/concepts/ai/Chat/hooks/useChatSend.ts"],"sourcesContent":["import { usGenerativeChatStore } from '../store/generativeChatStore'\nimport { apiPostChat } from '@/services/AiService'\nimport dayjs from 'dayjs'\nimport uniqueId from 'lodash/uniqueId'\nimport type { PostAiChatResponse } from '../types'\n\nconst useChatSend = () => {\n const {\n selectedConversation,\n setSelectedConversation,\n pushChatHistory,\n pushConversation,\n setIsTyping,\n } = usGenerativeChatStore()\n\n const creteMyMessage = (id: string, prompt: string) => {\n pushConversation(id, {\n id: uniqueId('ai-conversation-'),\n sender: {\n id: '1',\n name: 'Angelina Gotelli',\n avatarImageUrl: '/img/avatars/thumb-1.jpg',\n },\n content: prompt,\n timestamp: dayjs().toDate(),\n type: 'regular',\n isMyMessage: true,\n })\n }\n\n const sendMessage = async (\n id: string,\n prompt: string,\n attachments?: File[],\n ) => {\n const resp = await apiPostChat<PostAiChatResponse>({\n prompt,\n attachments,\n })\n pushConversation(id, {\n id: uniqueId('ai-conversation-'),\n sender: {\n id: 'ai',\n name: 'Chat AI',\n avatarImageUrl: '/img/thumbs/ai.jpg',\n },\n content: resp.choices[0].message.content || '',\n timestamp: dayjs().toDate(),\n type: 'regular',\n isMyMessage: false,\n fresh: true,\n })\n setIsTyping(false)\n }\n\n const createConversation = async (\n id: string,\n prompt: string,\n attachments?: File[],\n ) => {\n setSelectedConversation(id)\n await sendMessage(id, prompt, attachments)\n }\n\n const handleSend = async (prompt: string, attachments?: File[]) => {\n setIsTyping(true)\n if (selectedConversation) {\n creteMyMessage(selectedConversation, prompt)\n await sendMessage(selectedConversation, prompt)\n } else {\n const newId = uniqueId('ai-chat-')\n pushChatHistory({\n id: newId,\n title: prompt,\n lastConversation: '',\n createdTime: dayjs().unix(),\n updatedTime: dayjs().unix(),\n enable: false,\n })\n creteMyMessage(newId, prompt)\n await createConversation(newId, prompt, attachments)\n }\n }\n\n return {\n handleSend,\n }\n}\n\nexport default useChatSend\n"],"names":[],"mappings":";;;;AAMA,MAAM,cAAc,MAAM;AACtB,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACA,sBAAA;AAEJ,QAAM,iBAAiB,CAAC,IAAY,WAAmB;AACnD,qBAAiB,IAAI;AAAA,MACjB,IAAI,SAAS,kBAAkB;AAAA,MAC/B,QAAQ;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,gBAAgB;AAAA,MAAA;AAAA,MAEpB,SAAS;AAAA,MACT,WAAW,MAAA,EAAQ,OAAA;AAAA,MACnB,MAAM;AAAA,MACN,aAAa;AAAA,IAAA,CAChB;AAAA,EACL;AAEA,QAAM,cAAc,OAChB,IACA,QACA,gBACC;AACD,UAAM,OAAO,MAAM,YAAgC;AAAA,MAC/C;AAAA,MACA;AAAA,IAAA,CACH;AACD,qBAAiB,IAAI;AAAA,MACjB,IAAI,SAAS,kBAAkB;AAAA,MAC/B,QAAQ;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,gBAAgB;AAAA,MAAA;AAAA,MAEpB,SAAS,KAAK,QAAQ,CAAC,EAAE,QAAQ,WAAW;AAAA,MAC5C,WAAW,MAAA,EAAQ,OAAA;AAAA,MACnB,MAAM;AAAA,MACN,aAAa;AAAA,MACb,OAAO;AAAA,IAAA,CACV;AACD,gBAAY,KAAK;AAAA,EACrB;AAEA,QAAM,qBAAqB,OACvB,IACA,QACA,gBACC;AACD,4BAAwB,EAAE;AAC1B,UAAM,YAAY,IAAI,QAAQ,WAAW;AAAA,EAC7C;AAEA,QAAM,aAAa,OAAO,QAAgB,gBAAyB;AAC/D,gBAAY,IAAI;AAChB,QAAI,sBAAsB;AACtB,qBAAe,sBAAsB,MAAM;AAC3C,YAAM,YAAY,sBAAsB,MAAM;AAAA,IAClD,OAAO;AACH,YAAM,QAAQ,SAAS,UAAU;AACjC,sBAAgB;AAAA,QACZ,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,kBAAkB;AAAA,QAClB,aAAa,MAAA,EAAQ,KAAA;AAAA,QACrB,aAAa,MAAA,EAAQ,KAAA;AAAA,QACrB,QAAQ;AAAA,MAAA,CACX;AACD,qBAAe,OAAO,MAAM;AAC5B,YAAM,mBAAmB,OAAO,QAAQ,WAAW;AAAA,IACvD;AAAA,EACJ;AAEA,SAAO;AAAA,IACH;AAAA,EAAA;AAER;"}
1
+ {"version":3,"file":"useChatSend.js","sources":["../../../../../../../lib/@ecme/views/concepts/ai/Chat/hooks/useChatSend.ts"],"sourcesContent":["import { usGenerativeChatStore } from '../store/generativeChatStore'\nimport { apiPostChat } from '@/services/AiService'\nimport { useAuth } from '@/auth'\nimport dayjs from 'dayjs'\nimport uniqueId from 'lodash/uniqueId'\nimport type { PostAiChatResponse } from '../types'\n\nconst useChatSend = () => {\n const { user } = useAuth()\n const {\n selectedConversation,\n setSelectedConversation,\n pushChatHistory,\n pushConversation,\n setIsTyping,\n } = usGenerativeChatStore()\n\n const creteMyMessage = (id: string, prompt: string) => {\n pushConversation(id, {\n id: uniqueId('ai-conversation-'),\n sender: {\n id: user.userId ?? 'me',\n name: user.userName ?? 'Você',\n avatarImageUrl: user.avatar ?? undefined,\n },\n content: prompt,\n timestamp: dayjs().toDate(),\n type: 'regular',\n isMyMessage: true,\n })\n }\n\n const sendMessage = async (\n id: string,\n prompt: string,\n attachments?: File[],\n ) => {\n const resp = await apiPostChat<PostAiChatResponse>({\n prompt,\n attachments,\n })\n pushConversation(id, {\n id: uniqueId('ai-conversation-'),\n sender: {\n id: 'ai',\n name: 'Chat AI',\n avatarImageUrl: '/img/thumbs/ai.jpg',\n },\n content: resp.choices[0].message.content || '',\n timestamp: dayjs().toDate(),\n type: 'regular',\n isMyMessage: false,\n fresh: true,\n })\n setIsTyping(false)\n }\n\n const createConversation = async (\n id: string,\n prompt: string,\n attachments?: File[],\n ) => {\n setSelectedConversation(id)\n await sendMessage(id, prompt, attachments)\n }\n\n const handleSend = async (prompt: string, attachments?: File[]) => {\n setIsTyping(true)\n if (selectedConversation) {\n creteMyMessage(selectedConversation, prompt)\n await sendMessage(selectedConversation, prompt)\n } else {\n const newId = uniqueId('ai-chat-')\n pushChatHistory({\n id: newId,\n title: prompt,\n lastConversation: '',\n createdTime: dayjs().unix(),\n updatedTime: dayjs().unix(),\n enable: false,\n })\n creteMyMessage(newId, prompt)\n await createConversation(newId, prompt, attachments)\n }\n }\n\n return {\n handleSend,\n }\n}\n\nexport default useChatSend\n"],"names":[],"mappings":";;;;;;AAOA,MAAM,cAAc,MAAM;AACtB,QAAM,EAAE,KAAA,IAAS,QAAA;AACjB,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACA,sBAAA;AAEJ,QAAM,iBAAiB,CAAC,IAAY,WAAmB;AACnD,qBAAiB,IAAI;AAAA,MACjB,IAAI,SAAS,kBAAk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,WAAW;AAAA,IACvD;AAAA,EACJ;AAEA,SAAO;AAAA,IACH;AAAA,EAAA;AAER;"}
@@ -0,0 +1,15 @@
1
+ import { create } from "zustand";
2
+ import { persist } from "zustand/middleware";
3
+ const useAiModelStore = create()(
4
+ persist(
5
+ (set) => ({
6
+ selectedModel: null,
7
+ setSelectedModel: (model) => set({ selectedModel: model })
8
+ }),
9
+ { name: "orbe-ai-model" }
10
+ )
11
+ );
12
+ export {
13
+ useAiModelStore
14
+ };
15
+ //# sourceMappingURL=aiModelStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aiModelStore.js","sources":["../../../../../../../lib/@ecme/views/concepts/ai/Chat/store/aiModelStore.ts"],"sourcesContent":["import { create } from 'zustand'\nimport { persist } from 'zustand/middleware'\n\ntype AiModelState = {\n selectedModel: string | null\n setSelectedModel: (model: string) => void\n}\n\n/**\n * Modelo de IA escolhido pelo usuario para o chat do Orbe AI.\n *\n * Persistido em localStorage: como todos os MFEs vivem na mesma origem, a\n * escolha acompanha o usuario entre os modulos e entre sessoes.\n */\nexport const useAiModelStore = create<AiModelState>()(\n persist(\n (set) => ({\n selectedModel: null,\n setSelectedModel: (model) => set({ selectedModel: model }),\n }),\n { name: 'orbe-ai-model' },\n ),\n)\n"],"names":[],"mappings":";;AAcO,MAAM,kBAAkB,OAAA;AAAA,EAC3B;AAAA,IACI,CAAC,SAAS;AAAA,MACN,eAAe;AAAA,MACf,kBAAkB,CAAC,UAAU,IAAI,EAAE,eAAe,OAAO;AAAA,IAAA;AAAA,IAE7D,EAAE,MAAM,gBAAA;AAAA,EAAgB;AAEhC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PostLoginLayout.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/components/layouts/PostLoginLayout/PostLoginLayout.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAY1C,UAAU,oBAAqB,SAAQ,WAAW;IAChD,UAAU,EAAE,UAAU,CAAC;IACvB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsBD,QAAA,MAAM,eAAe,GAAI,oDAKtB,oBAAoB,4CA2BtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"PostLoginLayout.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/components/layouts/PostLoginLayout/PostLoginLayout.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAY1C,UAAU,oBAAqB,SAAQ,WAAW;IAChD,UAAU,EAAE,UAAU,CAAC;IACvB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsBD,QAAA,MAAM,eAAe,GAAI,oDAKtB,oBAAoB,4CA4BtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const OrbeAiWidget: () => import("react/jsx-runtime").JSX.Element;
2
+ export default OrbeAiWidget;
3
+ //# sourceMappingURL=OrbeAiWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrbeAiWidget.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/components/template/OrbeAiWidget/OrbeAiWidget.tsx"],"names":[],"mappings":"AAiBA,QAAA,MAAM,YAAY,+CAyGjB,CAAA;AAED,eAAe,YAAY,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { PointerEvent as ReactPointerEvent } from 'react';
2
+ import type { ResizeDirection } from './useResizablePanel';
3
+ type ResizeHandlesProps = {
4
+ onResizeStart: (event: ReactPointerEvent, direction: ResizeDirection) => void;
5
+ };
6
+ /** Alças transparentes de redimensionamento nas 4 bordas + 4 cantos do painel. */
7
+ declare const ResizeHandles: ({ onResizeStart }: ResizeHandlesProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default ResizeHandles;
9
+ //# sourceMappingURL=ResizeHandles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResizeHandles.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/components/template/OrbeAiWidget/ResizeHandles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAE1D,KAAK,kBAAkB,GAAG;IACtB,aAAa,EAAE,CACX,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,eAAe,KACzB,IAAI,CAAA;CACZ,CAAA;AAgBD,kFAAkF;AAClF,QAAA,MAAM,aAAa,GAAI,mBAAmB,kBAAkB,4CAmB3D,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { default } from './OrbeAiWidget';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/components/template/OrbeAiWidget/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,19 @@
1
+ import type { PointerEvent as ReactPointerEvent } from 'react';
2
+ export type Rect = {
3
+ top: number;
4
+ left: number;
5
+ width: number;
6
+ height: number;
7
+ };
8
+ export type ResizeDirection = 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
9
+ /**
10
+ * Painel redimensionável por qualquer borda/canto. O painel é posicionado
11
+ * livremente (`fixed` com top/left/width/height); cada direção move sua borda
12
+ * mantendo a borda oposta fixa, com limites de mínimo e do viewport.
13
+ */
14
+ declare const useResizablePanel: () => {
15
+ rect: Rect;
16
+ startResize: (event: ReactPointerEvent, direction: ResizeDirection) => void;
17
+ };
18
+ export default useResizablePanel;
19
+ //# sourceMappingURL=useResizablePanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResizablePanel.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/components/template/OrbeAiWidget/useResizablePanel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAE9D,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAE/E,MAAM,MAAM,eAAe,GACrB,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,CAAA;AAsBpB;;;;GAIG;AACH,QAAA,MAAM,iBAAiB;;yBAIP,iBAAiB,aAAa,eAAe;CA6D5D,CAAA;AAED,eAAe,iBAAiB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChatBox.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/components/view/ChatBox/ChatBox.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,MAAM,WAAW,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;AAElD,MAAM,MAAM,YAAY,GAAG;IACvB,WAAW,EAAE,WAAW,CAAA;IACxB,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAA;IACrC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;CAC1B,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,GAC9B,cAAc,CAAA;AAElB,QAAA,MAAM,OAAO,wIA4CX,CAAA;AAIF,eAAe,OAAO,CAAA"}
1
+ {"version":3,"file":"ChatBox.d.ts","sourceRoot":"","sources":["../../../../../../lib/@ecme/components/view/ChatBox/ChatBox.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,MAAM,WAAW,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;AAElD,MAAM,MAAM,YAAY,GAAG;IACvB,WAAW,EAAE,WAAW,CAAA;IACxB,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAA;IACrC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;CAC1B,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,GAC9B,cAAc,CAAA;AAElB,QAAA,MAAM,OAAO,wIAkDX,CAAA;AAIF,eAAe,OAAO,CAAA"}
@@ -15,6 +15,9 @@ export type MessageListProps = {
15
15
  customRenderer?: (message: List, index: number) => string | ReactNode;
16
16
  customAction?: (message: List, index: number) => string | ReactNode;
17
17
  bubbleClass?: string;
18
+ myBubbleClass?: string;
19
+ botBubbleClass?: string;
20
+ renderTyping?: () => ReactNode;
18
21
  messageListClass?: string;
19
22
  };
20
23
  declare const MessageList: import("react").ForwardRefExoticComponent<MessageListProps & import("react").RefAttributes<import("simplebar-core").default>>;
@@ -1 +1 @@
1
- {"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../../../../../../lib/@ecme/components/view/ChatBox/components/MessageList.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C,KAAK,IAAI,GAAG,YAAY,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAE9C,MAAM,MAAM,gBAAgB,GAAG;IAC3B,IAAI,EAAE,IAAI,EAAE,CAAA;IACZ,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EACD;QACI,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;QACZ,cAAc,CAAC,EAAE,MAAM,CAAA;KAC1B,GACD,KAAK,CAAA;IACX,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAA;IACrE,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAA;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED,QAAA,MAAM,WAAW,+HA6Df,CAAA;AAIF,eAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../../../../../../lib/@ecme/components/view/ChatBox/components/MessageList.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C,KAAK,IAAI,GAAG,YAAY,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAE9C,MAAM,MAAM,gBAAgB,GAAG;IAC3B,IAAI,EAAE,IAAI,EAAE,CAAA;IACZ,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EACD;QACI,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;QACZ,cAAc,CAAC,EAAE,MAAM,CAAA;KAC1B,GACD,KAAK,CAAA;IACX,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAA;IACrE,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAA;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,SAAS,CAAA;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED,QAAA,MAAM,WAAW,+HAwEf,CAAA;AAIF,eAAe,WAAW,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"concepts.navigation.config.d.ts","sourceRoot":"","sources":["../../../../../lib/@ecme/configs/navigation.config/concepts.navigation.config.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,QAAA,MAAM,wBAAwB,EAAE,cAAc,EAgoB7C,CAAA;AAED,eAAe,wBAAwB,CAAA"}
1
+ {"version":3,"file":"concepts.navigation.config.d.ts","sourceRoot":"","sources":["../../../../../lib/@ecme/configs/navigation.config/concepts.navigation.config.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,QAAA,MAAM,wBAAwB,EAAE,cAAc,EAgnB7C,CAAA;AAED,eAAe,wBAAwB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"conceptsRoute.d.ts","sourceRoot":"","sources":["../../../../../lib/@ecme/configs/routes.config/conceptsRoute.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C,QAAA,MAAM,aAAa,EAAE,MA4VpB,CAAA;AAED,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"conceptsRoute.d.ts","sourceRoot":"","sources":["../../../../../lib/@ecme/configs/routes.config/conceptsRoute.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C,QAAA,MAAM,aAAa,EAAE,MAmVpB,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -1,8 +1,20 @@
1
+ /** Informa ao backend qual modelo usar. Sem o header, ele aplica o default. */
2
+ export declare const AI_MODEL_HEADER = "X-Ai-Model";
3
+ export type AiModel = {
4
+ id: string;
5
+ label: string;
6
+ default: boolean;
7
+ cloud: boolean;
8
+ };
9
+ export type GetAiModelsResponse = {
10
+ models: AiModel[];
11
+ };
1
12
  export declare function apiPostChat<T>(data: {
2
13
  prompt: string;
3
14
  attachments?: File[];
4
15
  }): Promise<T>;
5
16
  export declare function apiGetChatHistory<T>(): Promise<T>;
17
+ export declare function apiGetAiModels<T>(): Promise<T>;
6
18
  export declare function apiGetImages<T, U extends Record<string, unknown>>(params: U): Promise<T>;
7
19
  export declare function apiPostImages<T, U extends Record<string, unknown>>(data: U): Promise<T>;
8
20
  //# sourceMappingURL=AiService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AiService.d.ts","sourceRoot":"","sources":["../../../../lib/@ecme/services/AiService.ts"],"names":[],"mappings":"AAEA,wBAAsB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE;IACvC,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,IAAI,EAAE,CAAA;CACvB,cAMA;AAED,wBAAsB,iBAAiB,CAAC,CAAC,gBAKxC;AAED,wBAAsB,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnE,MAAM,EAAE,CAAC,cAOZ;AAED,wBAAsB,aAAa,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpE,IAAI,EAAE,CAAC,cAOV"}
1
+ {"version":3,"file":"AiService.d.ts","sourceRoot":"","sources":["../../../../lib/@ecme/services/AiService.ts"],"names":[],"mappings":"AAGA,+EAA+E;AAC/E,eAAO,MAAM,eAAe,eAAe,CAAA;AAE3C,MAAM,MAAM,OAAO,GAAG;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B,MAAM,EAAE,OAAO,EAAE,CAAA;CACpB,CAAA;AAcD,wBAAsB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE;IACvC,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,IAAI,EAAE,CAAA;CACvB,cAQA;AAED,wBAAsB,iBAAiB,CAAC,CAAC,gBAMxC;AAED,wBAAsB,cAAc,CAAC,CAAC,gBAMrC;AAED,wBAAsB,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnE,MAAM,EAAE,CAAC,cAQZ;AAED,wBAAsB,aAAa,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,C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