@credithub/harlan-components 1.103.2 → 1.104.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.
@@ -19,3 +19,4 @@ export type { PefinRefinSerasaResponse, RefinSerasaState } from '@/@types/domain
19
19
  export type { ScoreResponse, ScoreSerasaState, ScoreState } from '@/@types/domain/scoreTypes';
20
20
  export type { SCRState } from '@/@types/domain/scrTypes';
21
21
  export type { RegistroVeiculo, VeiculosState } from '@/@types/domain/veiculosTypes';
22
+ export type { EditalItem, EditalEletronico, EditalResponse } from '@/@types/domain/editalTypes';
@@ -0,0 +1,4 @@
1
+ import { IconProps } from '@/@types/icon';
2
+ import React from 'react';
3
+ declare const EditalIcon: React.FC<IconProps>;
4
+ export default EditalIcon;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { useTheme } from 'styled-components';
3
+ var EditalIcon = function (_a) {
4
+ var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.size, size = _c === void 0 ? 30 : _c, circleFill = _a.circleFill;
5
+ var theme = useTheme();
6
+ var fill = circleFill || theme.colors.azulCredithub;
7
+ return (React.createElement("svg", { width: size, height: size, viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className },
8
+ React.createElement("circle", { cx: "15", cy: "15", r: "15", fill: fill }),
9
+ React.createElement("mask", { id: "mask0_edital", style: { maskType: 'alpha' }, maskUnits: "userSpaceOnUse", x: "3", y: "3", width: "24", height: "24" },
10
+ React.createElement("rect", { x: "3", y: "3", width: "24", height: "24", fill: "#D9D9D9" })),
11
+ React.createElement("g", { mask: "url(#mask0_edital)" },
12
+ React.createElement("path", { d: "M9 25C8.45 25 7.979 24.804 7.587 24.412C7.195 24.02 6.99933 23.5493 7 23V7C7 6.45 7.196 5.979 7.588 5.587C7.98 5.195 8.45067 4.99933 9 5H17L23 11V23C23 23.55 22.804 24.021 22.412 24.413C22.02 24.805 21.5493 25.0007 21 25H9ZM16 12V7H9V23H21V12H16ZM11 20H19V18H11V20ZM11 16H19V14H11V16ZM11 12H16V10H11V12Z", fill: "white" }))));
13
+ };
14
+ export default EditalIcon;
@@ -4,5 +4,6 @@ declare const ConsultaSimplesSection: React.FC<SectionProps & {
4
4
  documento: string;
5
5
  isFinancial: boolean;
6
6
  ctime?: string;
7
+ tags?: (string | RegExp)[];
7
8
  }>;
8
9
  export default ConsultaSimplesSection;
@@ -31,6 +31,7 @@ import usePrintWhenStable from '../../hooks/usePrintWhenStable';
31
31
  import theme from '../../styles/theme';
32
32
  import { formatMoney } from '../../utils/number';
33
33
  import { formatDocument } from '../../utils/string';
34
+ import { hasOneOfTags } from '../../utils/tags';
34
35
  import { format } from 'date-fns';
35
36
  import { WarningCircle } from 'phosphor-react';
36
37
  import React, { useContext, useEffect } from 'react';
@@ -43,13 +44,13 @@ var spin = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObjec
43
44
  // Componente Spinner sutil
44
45
  var Spinner = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-left-color: #222;\n border-radius: 50%;\n width: 9px;\n height: 9px;\n animation: ", " 1s linear infinite;\n margin-right: 8px;\n display: inline-block;\n vertical-align: middle;\n"], ["\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-left-color: #222;\n border-radius: 50%;\n width: 9px;\n height: 9px;\n animation: ", " 1s linear infinite;\n margin-right: 8px;\n display: inline-block;\n vertical-align: middle;\n"])), spin);
45
46
  var ConsultaSimplesSection = function (_a) {
46
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
47
- var documento = _a.documento, children = _a.children, onClose = _a.onClose, onClickPrint = _a.onClickPrint, isFinancial = _a.isFinancial, ctime = _a.ctime, printMode = _a.printMode, rest = __rest(_a, ["documento", "children", "onClose", "onClickPrint", "isFinancial", "ctime", "printMode"]);
47
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
48
+ var documento = _a.documento, children = _a.children, onClose = _a.onClose, onClickPrint = _a.onClickPrint, isFinancial = _a.isFinancial, ctime = _a.ctime, printMode = _a.printMode, _w = _a.tags, tags = _w === void 0 ? [] : _w, rest = __rest(_a, ["documento", "children", "onClose", "onClickPrint", "isFinancial", "ctime", "printMode", "tags"]);
48
49
  var ctx = useContext(Queries.Finder);
49
50
  var data = useGlobalData().data;
50
51
  var posthog = usePostHog().posthog;
51
52
  // Hook para observar mutações no DOM e chamar callback quando estável
52
- var _s = usePrintWhenStable({
53
+ var _x = usePrintWhenStable({
53
54
  debounceTime: 500,
54
55
  maxWaitTime: 30000,
55
56
  onStart: function () {
@@ -60,7 +61,7 @@ var ConsultaSimplesSection = function (_a) {
60
61
  // Chama o callback externo (Harlan decide como imprimir)
61
62
  onClickPrint === null || onClickPrint === void 0 ? void 0 : onClickPrint();
62
63
  }
63
- }), printWhenStable = _s.printWhenStable, isWaiting = _s.isWaiting;
64
+ }), printWhenStable = _x.printWhenStable, isWaiting = _x.isWaiting;
64
65
  // Handler que usa o observer ao invés de imprimir diretamente
65
66
  var handlePrint = function () {
66
67
  printWhenStable();
@@ -130,8 +131,17 @@ var ConsultaSimplesSection = function (_a) {
130
131
  (data.liminar.totalProtestos === 'NADA CONSTA' ||
131
132
  data.liminar.message === 'Encontrado')
132
133
  ? 'Indício de Liminar'
133
- : '', (_q = data.liminar) === null || _q === void 0 ? void 0 : _q.error)
134
- ].filter(function (e) { return (e.label === 'Liminar' ? isFinancial : e); });
134
+ : '', (_q = data.liminar) === null || _q === void 0 ? void 0 : _q.error),
135
+ makeItem('Potenciais Protestos Futuros', (_r = data.editalData) === null || _r === void 0 ? void 0 : _r.isLoaded, ((_s = data.editalData) === null || _s === void 0 ? void 0 : _s.totalEditais)
136
+ ? "".concat(data.editalData.totalEditais === 1 ? '1 Potencial Protesto Futuro' : "".concat(data.editalData.totalEditais, " Potenciais Protestos Futuros"))
137
+ : '', (_t = data.editalData) === null || _t === void 0 ? void 0 : _t.error)
138
+ ].filter(function (e) {
139
+ if (e.label === 'Liminar')
140
+ return isFinancial;
141
+ if (e.label === 'Potenciais Protestos Futuros')
142
+ return hasOneOfTags(tags, ['diamante', 'diamante-new']);
143
+ return true;
144
+ });
135
145
  var isError = (ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Error;
136
146
  var isLoading = (ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Loading;
137
147
  var hasPendencias = data.ccf ||
@@ -139,7 +149,8 @@ var ConsultaSimplesSection = function (_a) {
139
149
  data.dividasPublicas ||
140
150
  data.processosJuridicos ||
141
151
  receitaStatus ||
142
- ((_r = data.liminar) === null || _r === void 0 ? void 0 : _r.message) === 'Encontrado';
152
+ ((_u = data.liminar) === null || _u === void 0 ? void 0 : _u.message) === 'Encontrado' ||
153
+ ((_v = data.editalData) === null || _v === void 0 ? void 0 : _v.totalEditais);
143
154
  var statusType = isError ? 'warning' : hasPendencias ? 'error' : 'success';
144
155
  useEffect(function () {
145
156
  if (posthog && pendencias.every(function (pendencia) { return pendencia.loaded; }))
@@ -106,12 +106,12 @@ function deepCleanData(data) {
106
106
  // Main normaliser --------------------------------------------------------------
107
107
  // -----------------------------------------------------------------------------
108
108
  export var selectRelevantData = function (data) {
109
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
110
- var _m = data || {}, protestosNumero = _m.protestos, ccfNumero = _m.ccf, dividasPublicas = _m.dividasPublicas, contasBancarias = _m.bankAccounts, ccfData = _m.ccfData, dividas = _m.divida, _o = _m.dossie, dossie = _o === void 0 ? {} : _o, liminar = _m.liminar, socios = _m.partners, dadosPessoasExpostasPoliticamente = _m.pepData, detalhesProcessosJuridicos = _m.processosJuridicosData, dadosReclameAqui = _m.reclameAqui, refinBoaVista = _m.refinBoaVista, refinSerasa = _m.refinSerasa, dadosScore = _m.scoreData, _p = _m.scr, scr = _p === void 0 ? { isLoaded: false } : _p, _q = _m.veiculos, veiculos = _q === void 0 ? [] : _q, ResumoDosDados = _m.documentHistory, insolvencia = _m.insolvencia, consulta = _m.protestosPagosBaixados;
109
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
110
+ var _o = data || {}, protestosNumero = _o.protestos, ccfNumero = _o.ccf, dividasPublicas = _o.dividasPublicas, contasBancarias = _o.bankAccounts, ccfData = _o.ccfData, dividas = _o.divida, _p = _o.dossie, dossie = _p === void 0 ? {} : _p, _q = _o.editalData, editalData = _q === void 0 ? { isLoaded: false } : _q, liminar = _o.liminar, socios = _o.partners, dadosPessoasExpostasPoliticamente = _o.pepData, detalhesProcessosJuridicos = _o.processosJuridicosData, dadosReclameAqui = _o.reclameAqui, refinBoaVista = _o.refinBoaVista, refinSerasa = _o.refinSerasa, dadosScore = _o.scoreData, _r = _o.scr, scr = _r === void 0 ? { isLoaded: false } : _r, _s = _o.veiculos, veiculos = _s === void 0 ? [] : _s, ResumoDosDados = _o.documentHistory, insolvencia = _o.insolvencia, consulta = _o.protestosPagosBaixados;
111
111
  // ────────────────────────────────────────────────
112
112
  // 1. Protestos – somente a entrada mais recente
113
113
  // ────────────────────────────────────────────────
114
- var _r = ResumoDosDados !== null && ResumoDosDados !== void 0 ? ResumoDosDados : {}, _omit = _r.protestoLiminar, ResumoSafe = __rest(_r, ["protestoLiminar"]);
114
+ var _t = ResumoDosDados !== null && ResumoDosDados !== void 0 ? ResumoDosDados : {}, _omit = _t.protestoLiminar, ResumoSafe = __rest(_t, ["protestoLiminar"]);
115
115
  var protestosData = [];
116
116
  var ultimaOcorrenciaProtestos = ResumoSafe === null || ResumoSafe === void 0 ? void 0 : ResumoSafe.ultimaOcorrenciaProtestos;
117
117
  if (Array.isArray(ResumoSafe === null || ResumoSafe === void 0 ? void 0 : ResumoSafe.protestoHistory) &&
@@ -205,12 +205,43 @@ export var selectRelevantData = function (data) {
205
205
  })()
206
206
  : undefined;
207
207
  // ────────────────────────────────────────────────
208
- // 6. Construção final
208
+ // 6. Intimações por Edital Eletrônico
209
+ // ────────────────────────────────────────────────
210
+ var editalResumo = ((_k = editalData === null || editalData === void 0 ? void 0 : editalData.editais) === null || _k === void 0 ? void 0 : _k.length)
211
+ ? (function () {
212
+ var qtd = editalData.editais.length;
213
+ var cartorios = Array.from(new Set(editalData.editais.map(function (e) { return e.nome_cartorio; })));
214
+ var titulos = editalData.editais.reduce(function (acc, e) { var _a, _b; return acc + (((_b = (_a = e.editalf) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.length) || 0); }, 0);
215
+ return {
216
+ quantidade: qtd,
217
+ cartorios: cartorios,
218
+ totalTitulos: titulos,
219
+ detalhes: editalData.editais.map(function (e) {
220
+ var _a, _b;
221
+ return ({
222
+ cartorio: e.nome_cartorio,
223
+ endereco: "".concat(e.endereco, ", ").concat(e.endereco_numero, " - ").concat(e.cidadec, "/").concat(e.uf),
224
+ protocolo: e.protocolo,
225
+ dataApresentacao: e.dataApresentacao,
226
+ dataCadastro: e.dt_hr_cadastro,
227
+ devedor: e.nomeDevedor,
228
+ titulosRelacionados: ((_b = (_a = e.editalf) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.map(function (t) { return ({
229
+ protocolo: t.protocolo,
230
+ especie: t.especiedoTitulo,
231
+ dataApresentacao: t.dataApresentacao
232
+ }); })) || []
233
+ });
234
+ })
235
+ };
236
+ })()
237
+ : undefined;
238
+ // ────────────────────────────────────────────────
239
+ // 7. Construção final
209
240
  // ────────────────────────────────────────────────
210
241
  var dadosOrganizados = {
211
242
  protestosData: protestosData,
212
- quantidadeProtestos: (_k = ResumoSafe === null || ResumoSafe === void 0 ? void 0 : ResumoSafe.quantidadeProtestos) !== null && _k !== void 0 ? _k : protestosData.length,
213
- ccf: (_l = ccfNumero !== null && ccfNumero !== void 0 ? ccfNumero : ResumoSafe === null || ResumoSafe === void 0 ? void 0 : ResumoSafe.quantidadeChequesSemFundos) !== null && _l !== void 0 ? _l : 0,
243
+ quantidadeProtestos: (_l = ResumoSafe === null || ResumoSafe === void 0 ? void 0 : ResumoSafe.quantidadeProtestos) !== null && _l !== void 0 ? _l : protestosData.length,
244
+ ccf: (_m = ccfNumero !== null && ccfNumero !== void 0 ? ccfNumero : ResumoSafe === null || ResumoSafe === void 0 ? void 0 : ResumoSafe.quantidadeChequesSemFundos) !== null && _m !== void 0 ? _m : 0,
214
245
  ccfData: ccfData !== null && ccfData !== void 0 ? ccfData : {},
215
246
  dividasPublicas: dividasPublicas,
216
247
  liminar: liminarInfo,
@@ -229,7 +260,8 @@ export var selectRelevantData = function (data) {
229
260
  ResumoDosDados: ResumoSafe,
230
261
  tipoPessoa: tipoPessoa,
231
262
  insolvencia: insolvenciaInfo,
232
- protestosPagosBaixados: protestosPagosBaixadosResumo
263
+ protestosPagosBaixados: protestosPagosBaixadosResumo,
264
+ edital: editalResumo
233
265
  };
234
266
  var dadosFiltrados = deepCleanData(dadosOrganizados);
235
267
  return { dadosFiltrados: dadosFiltrados };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface EditalProps {
3
+ isFinancial?: boolean;
4
+ tags?: (string | RegExp)[];
5
+ }
6
+ declare const _default: React.NamedExoticComponent<EditalProps>;
7
+ export default _default;
@@ -0,0 +1,84 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import EditalIcon from '../../assets/icones/edital';
13
+ import { useGlobalData } from '../../contexts/globalDataContext';
14
+ import { hasOneOfTags } from '../../utils/tags';
15
+ import React, { useContext, useEffect, useMemo, useState } from 'react';
16
+ import StatusMessage from '../interface/statusMessage';
17
+ import Section from '../section';
18
+ import { Queries, RequestStatus } from '../webservice';
19
+ import EditalList from './editalList';
20
+ var Edital = function (_a) {
21
+ var _b = _a.isFinancial, isFinancial = _b === void 0 ? false : _b, _c = _a.tags, tags = _c === void 0 ? [] : _c;
22
+ var ctx = useContext(Queries.Edital);
23
+ var _d = useGlobalData(), globalData = _d.data, setData = _d.setData;
24
+ var _e = useState(false), dataUpdated = _e[0], setDataUpdated = _e[1];
25
+ // Verificar se o usuário tem acesso ao plano diamante
26
+ var hasAccess = useMemo(function () {
27
+ return hasOneOfTags(tags, ['diamante', 'diamante-new']);
28
+ }, [tags]);
29
+ var EDITAL_ERROR_SUMMARY = 'Falha ao consultar intimações por edital eletrônico.';
30
+ // Atualiza globalData quando há erro
31
+ useEffect(function () {
32
+ if ((ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Error) {
33
+ setData(function (prevState) { return (__assign(__assign({}, prevState), { editalData: {
34
+ isLoaded: true,
35
+ error: { summary: EDITAL_ERROR_SUMMARY }
36
+ } })); });
37
+ return;
38
+ }
39
+ if ((ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Empty) {
40
+ setData(function (prevState) { return (__assign(__assign({}, prevState), { editalData: { isLoaded: true } })); });
41
+ return;
42
+ }
43
+ }, [ctx.type, setData]);
44
+ // Atualiza globalData com os dados do edital
45
+ useEffect(function () {
46
+ if (dataUpdated || !ctx.document)
47
+ return;
48
+ var response = ctx.document;
49
+ var editais = (response === null || response === void 0 ? void 0 : response.editalEletronico) || [];
50
+ var total = editais.length;
51
+ setData(function (prevState) { return (__assign(__assign({}, prevState), { editalData: {
52
+ isLoaded: true,
53
+ totalEditais: total,
54
+ editais: editais
55
+ } })); });
56
+ setDataUpdated(true);
57
+ }, [ctx.document, dataUpdated, setData]);
58
+ // Marca como carregando quando inicia requisição
59
+ useEffect(function () {
60
+ if ((ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Loading) {
61
+ setData(function (prevState) { return (__assign(__assign({}, prevState), { editalData: __assign(__assign({}, (prevState.editalData || {})), { isLoaded: false }) })); });
62
+ }
63
+ }, [ctx.type, setData]);
64
+ var handleSuccess = function (response) {
65
+ var editais = (response === null || response === void 0 ? void 0 : response.editalEletronico) || [];
66
+ var total = editais.length;
67
+ var variant = total > 0 ? 'error' : 'default';
68
+ return {
69
+ children: total > 0 ? React.createElement(EditalList, { editais: editais }) : null,
70
+ variant: variant,
71
+ description: (React.createElement(StatusMessage, { type: total > 0 ? 'error' : 'default' }, total > 0
72
+ ? total === 1
73
+ ? 'Encontrada 1 intimação por edital eletrônico'
74
+ : "Encontradas ".concat(total, " intima\u00E7\u00F5es por edital eletr\u00F4nico")
75
+ : 'Não há intimações por edital eletrônico'))
76
+ };
77
+ };
78
+ // Se não tiver acesso, não renderiza nada
79
+ if (!hasAccess) {
80
+ return null;
81
+ }
82
+ return (React.createElement(Section, { ctx: ctx, title: "Intima\u00E7\u00F5es por Edital Eletr\u00F4nico", subtitle: "Consulta de intima\u00E7\u00F5es por edital eletr\u00F4nico para aceite, pagamento ou apresenta\u00E7\u00E3o de raz\u00F5es.", icon: EditalIcon, onSuccess: handleSuccess }));
83
+ };
84
+ export default React.memo(Edital);
@@ -0,0 +1,7 @@
1
+ import { EditalEletronico } from '../../@types/domain';
2
+ import React from 'react';
3
+ interface EditalListProps {
4
+ editais: EditalEletronico[];
5
+ }
6
+ declare const EditalList: React.FC<EditalListProps>;
7
+ export default EditalList;
@@ -0,0 +1,86 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import { formatDocument } from '../../utils/string';
6
+ import React from 'react';
7
+ import styled from 'styled-components';
8
+ import AddItemField from '../common/addItem';
9
+ import { ResultContent } from '../interface/result';
10
+ var EditalContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 30px;\n margin-top: 20px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 30px;\n margin-top: 20px;\n"])));
11
+ var EditalCard = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: #f8f9fa;\n border-radius: 8px;\n padding: 20px;\n border-left: 4px solid #dc3545;\n"], ["\n background: #f8f9fa;\n border-radius: 8px;\n padding: 20px;\n border-left: 4px solid #dc3545;\n"])));
12
+ var EditalHeader = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin-bottom: 15px;\n padding-bottom: 15px;\n border-bottom: 1px solid #dee2e6;\n"], ["\n margin-bottom: 15px;\n padding-bottom: 15px;\n border-bottom: 1px solid #dee2e6;\n"])));
13
+ var EditalTitle = styled.h4(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin: 0 0 10px 0;\n color: #212529;\n font-size: 16px;\n font-weight: 600;\n"], ["\n margin: 0 0 10px 0;\n color: #212529;\n font-size: 16px;\n font-weight: 600;\n"])));
14
+ var EditalText = styled.p(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin: 10px 0;\n padding: 15px;\n background: white;\n border-radius: 4px;\n font-size: 14px;\n line-height: 1.6;\n color: #495057;\n border-left: 3px solid #ffc107;\n"], ["\n margin: 10px 0;\n padding: 15px;\n background: white;\n border-radius: 4px;\n font-size: 14px;\n line-height: 1.6;\n color: #495057;\n border-left: 3px solid #ffc107;\n"])));
15
+ var TitulosSection = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n margin-top: 20px;\n"], ["\n margin-top: 20px;\n"])));
16
+ var TitulosSectionTitle = styled.h5(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin: 0 0 15px 0;\n color: #495057;\n font-size: 14px;\n font-weight: 600;\n text-transform: uppercase;\n"], ["\n margin: 0 0 15px 0;\n color: #495057;\n font-size: 14px;\n font-weight: 600;\n text-transform: uppercase;\n"])));
17
+ var TituloCard = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background: white;\n border-radius: 6px;\n padding: 15px;\n margin-bottom: 15px;\n border: 1px solid #dee2e6;\n\n &:last-child {\n margin-bottom: 0;\n }\n"], ["\n background: white;\n border-radius: 6px;\n padding: 15px;\n margin-bottom: 15px;\n border: 1px solid #dee2e6;\n\n &:last-child {\n margin-bottom: 0;\n }\n"])));
18
+ var formatDate = function (dateStr) {
19
+ if (!dateStr)
20
+ return '-';
21
+ // Se já está no formato dd/mm/yyyy, retorna
22
+ if (/^\d{2}\/\d{2}\/\d{4}$/.test(dateStr)) {
23
+ return dateStr;
24
+ }
25
+ // Se está no formato "Oct 10 2025 12:00:00:AM", converte
26
+ if (dateStr.includes(' ')) {
27
+ var date = new Date(dateStr);
28
+ if (!isNaN(date.getTime())) {
29
+ var day = String(date.getDate()).padStart(2, '0');
30
+ var month = String(date.getMonth() + 1).padStart(2, '0');
31
+ var year = date.getFullYear();
32
+ return "".concat(day, "/").concat(month, "/").concat(year);
33
+ }
34
+ }
35
+ // Se está no formato yyyy-mm-dd hh:mm:ss, converte
36
+ if (/^\d{4}-\d{2}-\d{2}/.test(dateStr)) {
37
+ var datePart = dateStr.split(' ')[0];
38
+ var _a = datePart.split('-'), year = _a[0], month = _a[1], day = _a[2];
39
+ return "".concat(day, "/").concat(month, "/").concat(year);
40
+ }
41
+ return dateStr;
42
+ };
43
+ var EditalList = function (_a) {
44
+ var editais = _a.editais;
45
+ return (React.createElement(EditalContainer, null, editais.map(function (edital, index) {
46
+ var _a;
47
+ // Agrupa os títulos únicos (remove duplicatas baseadas em protocolo e data)
48
+ var titulosUnicos = ((_a = edital.editalf) === null || _a === void 0 ? void 0 : _a[0]) || [];
49
+ return (React.createElement(EditalCard, { key: index },
50
+ React.createElement(EditalHeader, null,
51
+ React.createElement(EditalTitle, null,
52
+ "Edital #",
53
+ edital.cd_arquivo_editalEletronico,
54
+ " - ",
55
+ edital.nome_cartorio),
56
+ React.createElement(ResultContent, { print: "repeat(3, 1fr)", desktop: "repeat(3, 1fr)", tablet: "repeat(2, 1fr)", mobile: "1fr" },
57
+ React.createElement(AddItemField, { name: "Cart\u00F3rio", value: edital.nome_cartorio }),
58
+ React.createElement(AddItemField, { name: "Endere\u00E7o", value: "".concat(edital.endereco, ", ").concat(edital.endereco_numero, " - ").concat(edital.bairroc, ", ").concat(edital.cidadec, "/").concat(edital.uf) }),
59
+ React.createElement(AddItemField, { name: "Telefone", value: edital.telefone })),
60
+ React.createElement(ResultContent, { print: "repeat(3, 1fr)", desktop: "repeat(3, 1fr)", tablet: "repeat(2, 1fr)", mobile: "1fr" },
61
+ React.createElement(AddItemField, { name: "Email", value: edital.email }),
62
+ React.createElement(AddItemField, { name: "Hor\u00E1rio de Funcionamento", value: edital.hora_funcionamento }),
63
+ React.createElement(AddItemField, { name: "Data de Cadastro", value: formatDate(edital.dt_hr_cadastro) }))),
64
+ React.createElement(EditalText, null,
65
+ React.createElement("strong", null, "Texto da Intima\u00E7\u00E3o:"),
66
+ React.createElement("br", null),
67
+ edital.texto_edital),
68
+ React.createElement(ResultContent, { print: "repeat(3, 1fr)", desktop: "repeat(3, 1fr)", tablet: "repeat(2, 1fr)", mobile: "1fr" },
69
+ React.createElement(AddItemField, { name: "Devedor", value: edital.nomeDevedor }),
70
+ React.createElement(AddItemField, { name: "CPF/CNPJ Devedor", value: formatDocument(edital.doc_devedor) }),
71
+ React.createElement(AddItemField, { name: "Endere\u00E7o Devedor", value: "".concat(edital.bairroDevedor).concat(edital.bairroDevedor && edital.cidadeDevedor ? ', ' : '').concat(edital.cidadeDevedor) })),
72
+ titulosUnicos.length > 0 && (React.createElement(TitulosSection, null,
73
+ React.createElement(TitulosSectionTitle, null,
74
+ "T\u00EDtulos Relacionados (",
75
+ titulosUnicos.length,
76
+ ")"),
77
+ titulosUnicos.map(function (titulo, tituloIndex) { return (React.createElement(TituloCard, { key: tituloIndex },
78
+ React.createElement(ResultContent, { print: "repeat(4, 1fr)", desktop: "repeat(4, 1fr)", tablet: "repeat(2, 1fr)", mobile: "1fr" },
79
+ React.createElement(AddItemField, { name: "Protocolo", value: titulo.protocolo }),
80
+ React.createElement(AddItemField, { name: "Esp\u00E9cie do T\u00EDtulo", value: titulo.especiedoTitulo }),
81
+ React.createElement(AddItemField, { name: "Data de Apresenta\u00E7\u00E3o", value: formatDate(titulo.dataApresentacao) }),
82
+ titulo.dataVencimento && (React.createElement(AddItemField, { name: "Data de Vencimento", value: formatDate(titulo.dataVencimento) }))))); })))));
83
+ })));
84
+ };
85
+ export default EditalList;
86
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
@@ -0,0 +1,2 @@
1
+ export { default } from './edital';
2
+ export { default as EditalList } from './editalList';
@@ -0,0 +1,2 @@
1
+ export { default } from './edital';
2
+ export { default as EditalList } from './editalList';
@@ -1,4 +1,4 @@
1
- import { LiminarResponse, ProcessosJuridicosState } from '../@types/domain';
1
+ import { EditalResponse, LiminarResponse, ProcessosJuridicosState } from '../@types/domain';
2
2
  import { Client } from '@credithub/webservice';
3
3
  import React, { ComponentProps, ComponentType, Context, FC, PropsWithChildren, ReactNode } from 'react';
4
4
  import Header from './interface/header';
@@ -175,5 +175,14 @@ export declare const Queries: {
175
175
  urlData?: Client.Form;
176
176
  }>>;
177
177
  };
178
+ Edital: React.Context<RequestContext<EditalResponse>> & {
179
+ Request: React.FC<React.PropsWithChildren<{
180
+ data?: {
181
+ documento: string;
182
+ } | undefined;
183
+ depends?: RequestContext<unknown>[];
184
+ urlData?: Client.Form;
185
+ }>>;
186
+ };
178
187
  };
179
188
  export {};
@@ -394,5 +394,6 @@ export var Queries = {
394
394
  ReclameAqui: query("SELECT FROM 'RECLAMEAQUI'.'CONSULTA'"),
395
395
  Dominios: query("SELECT FROM 'DOMINIOS'.'CONSULTA'"),
396
396
  GraficosAnaliticos: query("SELECT FROM 'DOCUMENTHISTORY'.'BASICHISTORY'"),
397
- Falencia: query("SELECT FROM 'ValorEconomico'.'Falencia'")
397
+ Falencia: query("SELECT FROM 'ValorEconomico'.'Falencia'"),
398
+ Edital: query("SELECT FROM 'APICENPROT'.'EDITAL'")
398
399
  };
@@ -11,6 +11,7 @@ import { ConsultaRfbProvider } from './components/consultaRfb';
11
11
  import ConsultaSimplesSection from './components/consultaSimplesSection/consultaSimplesSection';
12
12
  import { ConsultasComplementaresProvider } from './components/consultasComplementares';
13
13
  import Dominios from './components/dominios/dominios';
14
+ import Edital from './components/edital/edital';
14
15
  import ConsultaImoveis from './components/imoveis/imoveisService';
15
16
  import Liminar from './components/liminar/liminar';
16
17
  import ProtestosSP from './components/protestos/protestosSp';
@@ -78,33 +79,35 @@ var ConsultaSimples = function (_a) {
78
79
  React.createElement(Queries.ProcessosJuridicos.Request, { data: { documento: documento } },
79
80
  React.createElement(Queries.Liminar.Request, { data: { documento: documento } },
80
81
  React.createElement(Queries.LiminarCenprot.Request, { data: { documento: documento } },
81
- React.createElement(Wrapper, null,
82
- React.createElement(GlobalDataProvider, null,
83
- React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose, onClickPrint: onClickPrint, isFinancial: isFinancial, ctime: ctimeProp, printMode: printMode },
84
- React.createElement(ConsultaRfbProvider, { documento: documento },
85
- React.createElement(Dossie, { documento: documento, printMode: printMode, isFinancial: isFinancial }),
86
- React.createElement(Liminar, { isFinancial: isFinancial, hasCredits: hasCredits, tags: tags }),
87
- React.createElement(Falencia, { documento: documento }),
88
- React.createElement(Addresses, { apiKey: apiKey }),
89
- React.createElement(Contacts, null),
90
- React.createElement(Partners, { onClickQSA: onClickQSA })),
91
- React.createElement(Dominios, null),
92
- React.createElement(BankAccounts, null),
93
- React.createElement(GraficosAnaliticosDependency, { documento: documento },
94
- React.createElement(ChartSystem, { documento: documento }),
95
- React.createElement(ConsultaSCR, { documento: documento }),
96
- React.createElement(RefinBoaVista, { documento: documento }),
97
- React.createElement(RefinSerasa, { documento: documento }),
98
- React.createElement(ConsultaScore, { documento: documento }),
99
- React.createElement(ConsultaScoreSerasa, { documento: documento }),
100
- React.createElement(ConsultaImoveis, { documento: documento }),
101
- React.createElement(Veiculos, { documento: documento })),
102
- React.createElement(ProtestosSP, null),
103
- React.createElement(Protestos, null),
104
- React.createElement(ProtestosPagosBaixados, { isFinancial: isFinancial }),
105
- React.createElement(CCF, null),
106
- React.createElement(DividasPublicas, null),
107
- React.createElement(ProcessosJuridicos, { onClickConsultarProcessoJuridico: onClickConsultarProcessoJuridico })))))))))))))))),
82
+ React.createElement(Queries.Edital.Request, { data: { documento: documento } },
83
+ React.createElement(Wrapper, null,
84
+ React.createElement(GlobalDataProvider, null,
85
+ React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose, onClickPrint: onClickPrint, isFinancial: isFinancial, ctime: ctimeProp, printMode: printMode, tags: tags },
86
+ React.createElement(ConsultaRfbProvider, { documento: documento },
87
+ React.createElement(Dossie, { documento: documento, printMode: printMode, isFinancial: isFinancial }),
88
+ React.createElement(Liminar, { isFinancial: isFinancial, hasCredits: hasCredits, tags: tags }),
89
+ React.createElement(Falencia, { documento: documento }),
90
+ React.createElement(Addresses, { apiKey: apiKey }),
91
+ React.createElement(Contacts, null),
92
+ React.createElement(Partners, { onClickQSA: onClickQSA })),
93
+ React.createElement(Dominios, null),
94
+ React.createElement(BankAccounts, null),
95
+ React.createElement(GraficosAnaliticosDependency, { documento: documento },
96
+ React.createElement(ChartSystem, { documento: documento }),
97
+ React.createElement(ConsultaSCR, { documento: documento }),
98
+ React.createElement(RefinBoaVista, { documento: documento }),
99
+ React.createElement(RefinSerasa, { documento: documento }),
100
+ React.createElement(ConsultaScore, { documento: documento }),
101
+ React.createElement(ConsultaScoreSerasa, { documento: documento }),
102
+ React.createElement(ConsultaImoveis, { documento: documento }),
103
+ React.createElement(Veiculos, { documento: documento })),
104
+ React.createElement(ProtestosSP, null),
105
+ React.createElement(Protestos, null),
106
+ React.createElement(Edital, { isFinancial: isFinancial, tags: tags }),
107
+ React.createElement(ProtestosPagosBaixados, { isFinancial: isFinancial }),
108
+ React.createElement(CCF, null),
109
+ React.createElement(DividasPublicas, null),
110
+ React.createElement(ProcessosJuridicos, { onClickConsultarProcessoJuridico: onClickConsultarProcessoJuridico }))))))))))))))))),
108
111
  React.createElement(GlobalStyle, null)));
109
112
  };
110
113
  export default ConsultaSimples;
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export { default as Tooltip } from './components/common/tooltip';
8
8
  export { default as Contacts } from './components/contacts/contacts';
9
9
  export { default as DividasPublicas } from './components/dividasPublicas/dividasPublicas';
10
10
  export { default as Dossie } from './components/dossie/dossie';
11
+ export { default as Edital } from './components/edital/edital';
11
12
  export { default as Falencia } from './components/falencia/falencia';
12
13
  export { default as Header } from './components/interface/header';
13
14
  export { default as Loading } from './components/interface/loading';
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ export { default as Tooltip } from './components/common/tooltip';
8
8
  export { default as Contacts } from './components/contacts/contacts';
9
9
  export { default as DividasPublicas } from './components/dividasPublicas/dividasPublicas';
10
10
  export { default as Dossie } from './components/dossie/dossie';
11
+ export { default as Edital } from './components/edital/edital';
11
12
  export { default as Falencia } from './components/falencia/falencia';
12
13
  export { default as Header } from './components/interface/header';
13
14
  export { default as Loading } from './components/interface/loading';