@credithub/harlan-components 1.131.1 → 1.131.3

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.
@@ -23,15 +23,15 @@ var ClickableStatusMessage = styled(StatusMessage)(templateObject_3 || (template
23
23
  // Wrapper para o texto clicável dentro do StatusMessage
24
24
  var ClickableText = styled.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n cursor: pointer;\n &:hover {\n opacity: 0.85;\n }\n"], ["\n cursor: pointer;\n &:hover {\n opacity: 0.85;\n }\n"])));
25
25
  var ConsultaSimplesSection = function (_a) {
26
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
27
- var documento = _a.documento, children = _a.children, onClose = _a.onClose, onClickPrint = _a.onClickPrint, isFinancial = _a.isFinancial, ctime = _a.ctime, printMode = _a.printMode, _1 = _a.tags, tags = _1 === void 0 ? [] : _1, extensionInstalled = _a.extensionInstalled, rest = __rest(_a, ["documento", "children", "onClose", "onClickPrint", "isFinancial", "ctime", "printMode", "tags", "extensionInstalled"]);
26
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
27
+ var documento = _a.documento, children = _a.children, onClose = _a.onClose, onClickPrint = _a.onClickPrint, isFinancial = _a.isFinancial, ctime = _a.ctime, printMode = _a.printMode, _x = _a.tags, tags = _x === void 0 ? [] : _x, extensionInstalled = _a.extensionInstalled, rest = __rest(_a, ["documento", "children", "onClose", "onClickPrint", "isFinancial", "ctime", "printMode", "tags", "extensionInstalled"]);
28
28
  var ctx = useContext(Queries.Finder);
29
29
  var data = useGlobalData().data;
30
30
  var posthog = usePostHog().posthog;
31
31
  var hasProtestos = ((_c = (_b = data === null || data === void 0 ? void 0 : data.protestosData) === null || _b === void 0 ? void 0 : _b.totalProtestos) !== null && _c !== void 0 ? _c : 0) > 0 &&
32
32
  ((_d = data === null || data === void 0 ? void 0 : data.protestosData) === null || _d === void 0 ? void 0 : _d.isLoaded) === true;
33
33
  // Hook para observar mutações no DOM e chamar callback quando estável
34
- var _2 = usePrintWhenStable({
34
+ var _y = usePrintWhenStable({
35
35
  debounceTime: 500,
36
36
  maxWaitTime: 30000,
37
37
  onStart: function () {
@@ -42,7 +42,7 @@ var ConsultaSimplesSection = function (_a) {
42
42
  // Chama o callback externo (Harlan decide como imprimir)
43
43
  onClickPrint === null || onClickPrint === void 0 ? void 0 : onClickPrint();
44
44
  }
45
- }), printWhenStable = _2.printWhenStable, isWaiting = _2.isWaiting;
45
+ }), printWhenStable = _y.printWhenStable, isWaiting = _y.isWaiting;
46
46
  // Handler que usa o observer ao invés de imprimir diretamente
47
47
  var handlePrint = function () {
48
48
  printWhenStable();
@@ -108,17 +108,22 @@ var ConsultaSimplesSection = function (_a) {
108
108
  ? 'Processo Jurídico'
109
109
  : 'Processos Jurídicos')
110
110
  : '', (_r = data.processosJuridicosData) === null || _r === void 0 ? void 0 : _r.error),
111
- makeItem('Liminar', (_s = data.liminar) === null || _s === void 0 ? void 0 : _s.isLoaded, ((_t = data.liminar) === null || _t === void 0 ? void 0 : _t.message) === 'Encontrado'
112
- ? 'Indício de Liminar'
113
- : '', (_u = data.liminar) === null || _u === void 0 ? void 0 : _u.error),
114
- makeItem('Potenciais Protestos Entrantes', true, ((_v = data.editalData) === null || _v === void 0 ? void 0 : _v.recentesCount)
111
+ // Liminar desabilitada (sem provider LIMINAR na consulta simples)
112
+ // makeItem(
113
+ // 'Liminar',
114
+ // data.liminar?.isLoaded,
115
+ // data.liminar?.message === 'Encontrado'
116
+ // ? 'Indício de Liminar'
117
+ // : '',
118
+ // data.liminar?.error
119
+ // ),
120
+ makeItem('Potenciais Protestos Entrantes', true, ((_s = data.editalData) === null || _s === void 0 ? void 0 : _s.recentesCount)
115
121
  ? "".concat(data.editalData.recentesCount === 1 ? '1 Potencial Protesto Entrante' : "".concat(data.editalData.recentesCount, " Potenciais Protestos Entrantes"))
116
122
  : ''
117
123
  // Não exibe erro de edital - deve falhar silenciosamente
118
124
  )
119
125
  ].filter(function (e) {
120
- if (e.label === 'Liminar')
121
- return isFinancial;
126
+ // if (e.label === 'Liminar') return isFinancial;
122
127
  if (e.label === 'Potenciais Protestos Futuros')
123
128
  return hasOneOfTags(tags, ['diamante', 'diamante-new']);
124
129
  return true;
@@ -130,8 +135,8 @@ var ConsultaSimplesSection = function (_a) {
130
135
  data.dividasPublicas ||
131
136
  data.processosJuridicos ||
132
137
  receitaStatus ||
133
- ((_w = data.liminar) === null || _w === void 0 ? void 0 : _w.message) === 'Encontrado' ||
134
- (((_x = data.editalData) === null || _x === void 0 ? void 0 : _x.recentesCount) &&
138
+ // data.liminar?.message === 'Encontrado' ||
139
+ (((_t = data.editalData) === null || _t === void 0 ? void 0 : _t.recentesCount) &&
135
140
  hasOneOfTags(tags, ['diamante', 'diamante-new']));
136
141
  var statusType = isError ? 'warning' : hasPendencias ? 'error' : 'success';
137
142
  useEffect(function () {
@@ -259,13 +264,13 @@ var ConsultaSimplesSection = function (_a) {
259
264
  }
260
265
  return item.text ? (item.label === 'Potenciais Protestos Entrantes' ? (React.createElement(ClickableStatusMessage, { key: item.label, type: "error", onClick: scrollToEditais, title: "Clique para ver detalhes" }, item.text)) : (React.createElement(StatusMessage, { key: item.label, type: "error" }, item.text))) : null;
261
266
  }),
262
- ((_y = data.editalData) === null || _y === void 0 ? void 0 : _y.isLoaded) &&
263
- !!((_z = data.editalData) === null || _z === void 0 ? void 0 : _z.vencidosCount) &&
267
+ ((_u = data.editalData) === null || _u === void 0 ? void 0 : _u.isLoaded) &&
268
+ !!((_v = data.editalData) === null || _v === void 0 ? void 0 : _v.vencidosCount) &&
264
269
  data.editalData.vencidosCount > 0 &&
265
270
  hasOneOfTags(tags, ['diamante', 'diamante-new']) && (React.createElement(StatusMessage, { type: "error" },
266
271
  React.createElement(ClickableText, { onClick: scrollToEditais, title: "Clique para ver detalhes" },
267
272
  "Cart\u00F3rio com dificuldade para intimar",
268
- ((_0 = data.editalData) === null || _0 === void 0 ? void 0 : _0.dataEditalMaisAntigo) &&
273
+ ((_w = data.editalData) === null || _w === void 0 ? void 0 : _w.dataEditalMaisAntigo) &&
269
274
  " desde o: ".concat(data.editalData.dataEditalMaisAntigo))))), onClose: onClose, icon: ConsultaSimplesIcon, variant: isLoading ? 'loading' : 'default', ctx: ctx, loadingProps: {
270
275
  percentage: (ctx === null || ctx === void 0 ? void 0 : ctx.progress) || 0,
271
276
  hidden: !isLoading
@@ -128,7 +128,7 @@ export var selectRelevantData = function (data) {
128
128
  var processosPassivos = (_c = processar('Passivo')) !== null && _c !== void 0 ? _c : [];
129
129
  var ProcessosJuridicos = __spreadArray(__spreadArray([], processosAtivos, true), processosPassivos, true);
130
130
  // ────────────────────────────────────────────────
131
- // 3. Liminar
131
+ // 3. Liminar (opcional — fluxo desabilitado em consultaSimples; IA não espera isLoaded)
132
132
  // ────────────────────────────────────────────────
133
133
  var liminarInfo = (liminar === null || liminar === void 0 ? void 0 : liminar.descricaoLiminar) || ((_e = (_d = liminar === null || liminar === void 0 ? void 0 : liminar.origensLiminar) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0)
134
134
  ? { descricao: liminar.descricaoLiminar, origens: liminar.origensLiminar }
@@ -35,10 +35,12 @@ var GenerativeAI = function (_a) {
35
35
  var lastQueryRef = useRef(null);
36
36
  var lastUserMessageRef = useRef(null);
37
37
  var messageHistoryRef = useRef(null);
38
+ // Financeiro: mesmo limiar que demais clientes (documentHistory). Não aguarda liminar
39
+ // enquanto LIMINAR.* estiver desabilitado em consultaSimples — ver isGlobalReady.ts.
38
40
  var isGlobalDataReady = useMemo(function () {
39
41
  return isFinancial
40
- ? isGlobalReady(globalData) // clientes financeiros
41
- : isDocumentHistoryReady(globalData); // demais clientes
42
+ ? isGlobalReady(globalData)
43
+ : isDocumentHistoryReady(globalData);
42
44
  }, [globalData, isFinancial]);
43
45
  // Atualiza o payload serializado sempre que os dados globais mudarem
44
46
  useEffect(function () {
@@ -6,30 +6,30 @@ import Addresses from './components/adresses/addresses';
6
6
  import BankAccounts from './components/bank-accounts/bank-accounts';
7
7
  import CCF from './components/ccf/ccf';
8
8
  import ChartSystem from './components/chart/chartSystem';
9
- import Contacts from './components/contacts/contacts';
10
- import DividasPublicas from './components/dividasPublicas/dividasPublicas';
11
- import Dossie from './components/dossie/dossie';
12
- import Falencia from './components/falencia/falencia';
13
- import Partners from './components/partners/partners';
14
- import ProcessosJuridicos from './components/processos-juridicos/processosJuridicos';
15
- import Protestos from './components/protestos/protestos';
16
- import RefinBoaVista from './components/refinBoaVista/refinBoaVista';
17
- import RefinSerasa from './components/refinSerasa/refinSerasa';
18
- import Veiculos from './components/veiculos/veiculos';
19
- import { Queries, useQuery, WebServiceProvider } from './components/webservice';
20
9
  import Modal from './components/common/modal';
21
10
  import { ConsultaRfbProvider } from './components/consultaRfb';
22
11
  import ConsultaSimplesSection from './components/consultaSimplesSection/consultaSimplesSection';
23
12
  import { ConsultasComplementaresProvider } from './components/consultasComplementares';
13
+ import Contacts from './components/contacts/contacts';
14
+ import DividasPublicas from './components/dividasPublicas/dividasPublicas';
24
15
  import Dominios from './components/dominios/dominios';
16
+ import Dossie from './components/dossie/dossie';
25
17
  import Edital from './components/edital/edital';
18
+ import Falencia from './components/falencia/falencia';
26
19
  import ConsultaImoveis from './components/imoveis/imoveisService';
27
- import Liminar from './components/liminar/liminar';
20
+ // import Liminar from './components/liminar/liminar';
21
+ import Partners from './components/partners/partners';
22
+ import ProcessosJuridicos from './components/processos-juridicos/processosJuridicos';
23
+ import Protestos from './components/protestos/protestos';
28
24
  import ProtestosSP from './components/protestos/protestosSp';
29
25
  import ProtestosPagosBaixados from './components/protestosPagosBaixados';
26
+ import RefinBoaVista from './components/refinBoaVista/refinBoaVista';
27
+ import RefinSerasa from './components/refinSerasa/refinSerasa';
30
28
  import ConsultaScore from './components/score/scoreService';
31
29
  import ConsultaScoreSerasa from './components/scoreSerasa/scoreSerasa';
32
30
  import ConsultaSCR from './components/scr/scr';
31
+ import Veiculos from './components/veiculos/veiculos';
32
+ import { Queries, useQuery, WebServiceProvider } from './components/webservice';
33
33
  import { PostHogProvider } from './contexts/PostHogContext';
34
34
  import { ErrorModalProvider } from './contexts/errorModalContext';
35
35
  import { GlobalDataProvider } from './contexts/globalDataContext';
@@ -111,37 +111,34 @@ var ConsultaSimples = function (_a) {
111
111
  React.createElement(Queries.Finder.Request, { data: { documento: documento } },
112
112
  React.createElement(FinderDependency, { documento: documento },
113
113
  React.createElement(Queries.ProcessosJuridicos.Request, { data: { documento: documento } },
114
- React.createElement(Queries.Liminar.Request, { data: { documento: documento } },
115
- React.createElement(Queries.LiminarCenprot.Request, { data: { documento: documento } },
116
- React.createElement(EditalQueryWrapper, { hasDiamanteAccess: hasDiamanteAccess, documento: documento },
117
- React.createElement(Wrapper, null,
118
- React.createElement(GlobalDataProvider, null,
119
- React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose, onClickPrint: onClickPrint, isFinancial: isFinancial, ctime: ctimeProp, printMode: printMode, tags: tags, extensionInstalled: extensionInstalled },
120
- React.createElement(ConsultaRfbProvider, { documento: documento },
121
- React.createElement(Dossie, { documento: documento, printMode: printMode, isFinancial: isFinancial }),
122
- React.createElement(Liminar, { isFinancial: isFinancial, hasCredits: hasCredits, tags: tags }),
123
- React.createElement(Falencia, { documento: documento }),
124
- React.createElement(Addresses, { apiKey: apiKey }),
125
- React.createElement(Contacts, null),
126
- React.createElement(Partners, { onClickQSA: onClickQSA })),
127
- React.createElement(Dominios, null),
128
- React.createElement(BankAccounts, null),
129
- React.createElement(GraficosAnaliticosDependency, { documento: documento },
130
- React.createElement(ChartSystem, { documento: documento }),
131
- React.createElement(ConsultaSCR, { documento: documento }),
132
- React.createElement(RefinBoaVista, { documento: documento }),
133
- React.createElement(RefinSerasa, { documento: documento }),
134
- React.createElement(ConsultaScore, { documento: documento }),
135
- React.createElement(ConsultaScoreSerasa, { documento: documento }),
136
- React.createElement(ConsultaImoveis, { documento: documento }),
137
- React.createElement(Veiculos, { documento: documento })),
138
- React.createElement(ProtestosSP, null),
139
- React.createElement(Protestos, { tags: tags, extensionInstalled: extensionInstalled }),
140
- React.createElement(Edital, { isFinancial: isFinancial, tags: tags }),
141
- React.createElement(ProtestosPagosBaixados, { isFinancial: isFinancial }),
142
- React.createElement(CCF, null),
143
- React.createElement(DividasPublicas, null),
144
- React.createElement(ProcessosJuridicos, { onClickConsultarProcessoJuridico: onClickConsultarProcessoJuridico })))))))))))))))))),
114
+ React.createElement(EditalQueryWrapper, { hasDiamanteAccess: hasDiamanteAccess, documento: documento },
115
+ React.createElement(Wrapper, null,
116
+ React.createElement(GlobalDataProvider, null,
117
+ React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose, onClickPrint: onClickPrint, isFinancial: isFinancial, ctime: ctimeProp, printMode: printMode, tags: tags, extensionInstalled: extensionInstalled },
118
+ React.createElement(ConsultaRfbProvider, { documento: documento },
119
+ React.createElement(Dossie, { documento: documento, printMode: printMode, isFinancial: isFinancial }),
120
+ React.createElement(Falencia, { documento: documento }),
121
+ React.createElement(Addresses, { apiKey: apiKey }),
122
+ React.createElement(Contacts, null),
123
+ React.createElement(Partners, { onClickQSA: onClickQSA })),
124
+ React.createElement(Dominios, null),
125
+ React.createElement(BankAccounts, null),
126
+ React.createElement(GraficosAnaliticosDependency, { documento: documento },
127
+ React.createElement(ChartSystem, { documento: documento }),
128
+ React.createElement(ConsultaSCR, { documento: documento }),
129
+ React.createElement(RefinBoaVista, { documento: documento }),
130
+ React.createElement(RefinSerasa, { documento: documento }),
131
+ React.createElement(ConsultaScore, { documento: documento }),
132
+ React.createElement(ConsultaScoreSerasa, { documento: documento }),
133
+ React.createElement(ConsultaImoveis, { documento: documento }),
134
+ React.createElement(Veiculos, { documento: documento })),
135
+ React.createElement(ProtestosSP, null),
136
+ React.createElement(Protestos, { tags: tags, extensionInstalled: extensionInstalled }),
137
+ React.createElement(Edital, { isFinancial: isFinancial, tags: tags }),
138
+ React.createElement(ProtestosPagosBaixados, { isFinancial: isFinancial }),
139
+ React.createElement(CCF, null),
140
+ React.createElement(DividasPublicas, null),
141
+ React.createElement(ProcessosJuridicos, { onClickConsultarProcessoJuridico: onClickConsultarProcessoJuridico })))))))))))))))),
145
142
  React.createElement(GlobalStyle, null)));
146
143
  };
147
144
  export default ConsultaSimples;
@@ -1,4 +1,11 @@
1
1
  import { GlobalState } from '@/types/globalState.d';
2
- export declare const isGlobalReady: (g: GlobalState) => boolean | undefined;
2
+ /**
3
+ * Pronto para IA / resumo agregado no fluxo financeiro.
4
+ *
5
+ * Liminar fora do gate: em consultaSimples os providers LIMINAR.* e o componente
6
+ * Liminar estão desabilitados; `liminar.isLoaded` nunca fica true e bloqueava o
7
+ * GenerativeAI indefinidamente. Reativar a linha abaixo ao religar o fluxo.
8
+ */
9
+ export declare const isGlobalReady: (g: GlobalState) => boolean;
3
10
  export declare const areModulesLoaded: (g: GlobalState) => boolean | undefined;
4
11
  export declare const isDocumentHistoryReady: (g: GlobalState) => boolean;
@@ -1,8 +1,14 @@
1
+ /**
2
+ * Pronto para IA / resumo agregado no fluxo financeiro.
3
+ *
4
+ * Liminar fora do gate: em consultaSimples os providers LIMINAR.* e o componente
5
+ * Liminar estão desabilitados; `liminar.isLoaded` nunca fica true e bloqueava o
6
+ * GenerativeAI indefinidamente. Reativar a linha abaixo ao religar o fluxo.
7
+ */
1
8
  export var isGlobalReady = function (g) {
2
- var _a;
3
- return !!g.documentHistory && // veio do dossiê
4
- ((_a = g.liminar) === null || _a === void 0 ? void 0 : _a.isLoaded);
9
+ return !!g.documentHistory;
5
10
  };
11
+ // && g.liminar?.isLoaded;
6
12
  export var areModulesLoaded = function (g) {
7
13
  var _a, _b, _c, _d;
8
14
  return ((_a = g.processosJuridicosData) === null || _a === void 0 ? void 0 : _a.isLoaded) &&