1import{j as e,hy as ie,kZ as ce,o as O,fm as de,m as A,fr as se,at as _e,a8 as v,ad as Te,df as Pe,ck as ue,a7 as Me,L as y,bH as $e,ai as u,r as p,ce as E,lz as Re,l5 as Be,lA as qe,ap as k,a4 as F,gF as Fe,W as He,a as Ue,lB as Qe,dE as Ve,hq as We,lC as Ge,lD as Ke,q as S,T as L,y as h,fd as Ye,lE as ae,lF as Je,ac as R,ly as Ze,lG as Xe,lH as et,cD as ne,aq as z,d3 as tt,lI as st,lJ as at,kI as nt,kJ as lt,bK as le,kK as ot,kL as rt,lK as oe,ff as H,hA as it,lL as ct,a9 as _,bf as B,l2 as dt,c$ as xe,bn as ut,bh as xt,f5 as mt,aB as pt,B as ft,bc as gt}from"./index-DvgDC9ud.js";import{E as ht}from"./ExplainLink-D6N1I5_c.js";import{C as bt,E as jt}from"./ExplainNumberModal-CsgGbPU9.js";import{G as Nt,H as $}from"./GradientHero-B5t2VxSh.js";import{S as vt}from"./Sparkline-nSXzMBTS.js";import{H as yt}from"./HolderDot-CfBN5uGv.js";import{P as wt}from"./PageHeader-BhbR1AXU.js";import{g as me,f as pe,L as q,l as fe,a as Ct,s as It}from"./loans-Dcg9mK8w.js";import{R as kt,A as U}from"./RenameAccountModal-B4mVkTtI.js";import{u as At,b as Q,f as Dt}from"./-overview-Cd54G6vz.js";import"./bill-cycle-status-w5bI0hTQ.js";try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="548429a1-7ac1-4bb9-8fef-a6346ef1f8f4",t._sentryDebugIdIdentifier="sentry-dbid-548429a1-7ac1-4bb9-8fef-a6346ef1f8f4")}catch{}function ge({account:t,size:o}){return t?e.jsx(ie,{name:t.connectorName??t.title,imageUrl:t.pluggyImageUrl,size:o}):e.jsx("span",{className:"flex flex-none items-center justify-center rounded-[9px] border border-border bg-surface-sunken text-foreground-muted",style:{width:o,height:o},children:e.jsx(ce,{size:Math.round(o/2)})})}function zt({loan:t,account:o,onOpenChange:i}){const{moneyVisibility:c}=O(),r=g=>A(g,c),l=t?me(t):null,n=(t==null?void 0:t.nextInstallmentDueDate)!=null?new Date(Number(t.nextInstallmentDueDate)):null,s=(t==null?void 0:t.dueDate)!=null?new Date(Number(t.dueDate)):null,d=(t==null?void 0:t.contractDate)!=null?new Date(Number(t.contractDate)):null,x=(t==null?void 0:t.lastPaymentDate)!=null?new Date(Number(t.lastPaymentDate)):null,b=(t==null?void 0:t.contractAmount)!=null&&t.outstandingBalance!=null?Math.max(0,t.contractAmount-t.outstandingBalance):null,f=t?[s?{label:"Termina em",value:de(s)}:null,t.cet!=null?{label:"CET",value:pe(t.cet)}:null,b!=null?{label:"Já pago",value:r(b)}:null,t.contractAmount!=null?{label:"Contratado",value:r(t.contractAmount)}:null].filter(g=>g!==null):[],C=t?[d?`contratado em ${se(d)}`:null,x?`última parcela paga em ${se(x)}`:null].filter(Boolean):[];return e.jsx(_e,{open:t!==null,onOpenChange:i,title:(t==null?void 0:t.productName)??q,width:440,showCloseButton:!0,children:t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ge,{account:o,size:34}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[e.jsxs("span",{className:"text-[11px] text-foreground-subtle",children:[[o==null?void 0:o.connectorName,fe(t.kind)].filter(Boolean).join(" · ")," · ","Open Finance"]}),t.outstandingBalance!=null?e.jsx(v,{value:-t.outstandingBalance,size:26,direction:"out",showSign:!0}):null,e.jsx("span",{className:"text-[11px] text-foreground-muted",children:"saldo devedor"})]}),l?e.jsx(Te,{progress:l.ratio,size:52,radius:21,strokeWidth:6,center:e.jsxs("span",{className:"dz-money text-[10.5px] font-bold",children:[l.paid,"/",l.total]}),"aria-label":"Parcelas pagas"}):null]}),t.nextInstallmentAmount!=null||n?e.jsxs("div",{className:"flex items-center gap-3 rounded-lg bg-surface-sunken px-4 py-3",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-foreground-muted",children:["Próxima parcela",(t.pastDueInstallments??0)>0?e.jsx(Pe,{variant:"destructive",className:"flex-none",children:"em atraso"}):null]}),e.jsxs("span",{className:"text-[12.5px] font-semibold",children:[l?Ct(l):null,l&&n?" · ":null,n?`vence ${ue(n)}`:null]})]}),t.nextInstallmentAmount!=null?e.jsx(v,{value:t.nextInstallmentAmount,size:18,direction:"out",icon:!0,className:"flex-none"}):null]}):null,f.length>0?e.jsx("div",{className:"grid grid-cols-2 gap-2",children:f.map(g=>e.jsx(Me,{value:e.jsx("span",{className:"text-[15px]",children:g.value}),label:g.label},g.label))}):null,C.length>0?e.jsx("span",{className:"text-[11.5px] leading-snug text-foreground-subtle",children:C.join(" · ")}):null,e.jsx(bt,{label:"Como isso aparece no seu mês",body:"Cada parcela entra no extrato quando o banco debita da conta, como qualquer outro lançamento. O saldo devedor fica só aqui: ele não entra em âQuanto você temâ, nem no saldo previsto, nem nos relatórios."}),e.jsxs(y,{to:"/transactions",search:{description:t.productName??""},onClick:()=>{u("tick"),i(!1)},className:"inline-flex h-11 w-full cursor-pointer items-center justify-center gap-2 rounded-[11px] border border-border bg-surface-card text-[13.5px] font-bold transition-colors hover:bg-surface-sunken",children:["Ver parcelas no extrato",e.jsx($e,{size:15})]})]}):null})}function St({targets:t,className:o}){const[i,c]=p.useState(!1),{guardWrite:r}=E();if(t.length===0)return null;const l=r(async()=>{var x;if(i)return;c(!0);let n=0,s=0,d=null;try{for(const b of t)if(!(b.lastSyncAt!==null&&Date.now()-b.lastSyncAt<Re))try{await Be.RefreshItem(b.itemId),n+=1}catch(f){if(((x=f==null?void 0:f.response)==null?void 0:x.status)===409){n+=1;continue}s+=1,d??(d=qe(f))}}finally{c(!1)}s===0?n>0?k.success("Atualização iniciada",{description:"Seus dados serão atualizados em instantes."}):k.info("Tudo sincronizado há pouco",{description:"Os bancos limitam a frequência â tente de novo mais tarde."}):k.error(n>0?"Algumas conexões não atualizaram":"Não foi possÃvel atualizar",{description:d??"Tente novamente em alguns minutos."})});return e.jsxs("button",{type:"button",disabled:i,onPointerDown:()=>u("press"),onPointerUp:()=>u("release"),onClick:()=>void l(),className:F("inline-flex cursor-pointer items-center gap-1.5 text-[11.5px] font-semibold text-foreground-subtle transition-colors hover:text-foreground disabled:cursor-default disabled:opacity-60",o),children:[e.jsx(Fe,{size:12,className:i?"animate-spin motion-reduce:animate-none":void 0}),i?"Sincronizando...":"Sincronizar tudo"]})}const re="flex h-[34px] w-full cursor-pointer select-none items-center gap-2.5 rounded-lg px-2.5 text-[13px] font-semibold text-foreground outline-none transition-colors data-[highlighted]:bg-surface-sunken";function Lt(t){if(t===0)return"vence hoje";if(t>0)return`vence em ${t} ${t===1?"dia":"dias"}`;const o=Math.abs(t);return`venceu há ${o} ${o===1?"dia":"dias"}`}const he="arquivadas";function Ot({open:t,onOpenChange:o}){const{guardWrite:i}=E(),[c,r]=p.useState(null),l=S({tableName:L.ACCOUNT,query:[h.Q.where("is_archived",h.Q.eq(!0)),h.Q.sortBy("title",h.Q.asc)]});if(l.length===0)return null;const n=async s=>{r(s.id);try{await s.toggleArchived(!1),k.success(s.type===ft.CREDIT?"Cartão restaurado":"Conta restaurada",{description:`${s.title} voltou para as suas contas.`})}catch(d){gt(d),k.error("Não foi possÃvel restaurar agora")}finally{r(null)}};return e.jsxs("div",{id:he,className:"flex flex-col gap-1.5 pt-1",children:[e.jsxs("button",{type:"button","aria-expanded":t,onClick:()=>{u("toggle"),o(!t)},className:"flex w-fit cursor-pointer items-center gap-1.5 px-1 text-[11px] font-semibold text-foreground-subtle transition-colors hover:text-foreground",children:[e.jsx(xt,{size:12,className:F("transition-transform",t&&"rotate-180")}
1),l.length===1?"1 conta arquivada":`${l.length} contas arquivadas`]}),t&&l.map(s=>e.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg border border-border bg-surface-sunken px-3.5 py-2.5",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-[12.5px] font-semibold text-foreground-muted",children:s.title}),e.jsxs("button",{type:"button",disabled:c===s.id,onPointerDown:()=>u("press"),onPointerUp:()=>u("release"),onClick:i(()=>void n(s)),className:"inline-flex cursor-pointer items-center gap-1 text-[11.5px] font-bold text-primary-soft-foreground hover:underline disabled:opacity-50",children:[e.jsx(mt,{size:12}),"restaurar"]})]},s.id))]})}function be({paused:t}){return e.jsxs("span",{className:"inline-flex flex-none items-center gap-1 rounded-full bg-surface-sunken px-2 py-[3px] text-[10.5px] font-bold text-foreground-muted",children:[e.jsx(pt,{size:10,className:"flex-none"}),"parou de atualizar",t.autoUpdateUntil?` ${Dt(new Date(t.autoUpdateUntil))}`:""]})}function Et({entry:t,paused:o,bankAccountCount:i,onRename:c}){const{guardWrite:r}=E(),{account:l,balance:n}=t,s=Q(l),d=l.subType?`conta ${ct(l.subType).toLowerCase()}`:"conta";return e.jsxs(_,{interactive:!0,className:"group relative flex flex-col gap-2.5 px-[18px] py-4",children:[e.jsx(y,{to:"/accounts/$accountId",params:{accountId:l.id}
1,"aria-label":`${l.title} â ver detalhes da conta`,onClick:()=>u("tick"),className:"absolute inset-0 rounded-lg"}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(ie,{name:l.connectorName??l.title,imageUrl:l.pluggyImageUrl,size:34}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsx("span",{className:"truncate text-[13.5px] font-bold",children:l.title}),e.jsx("span",{className:"text-[11px] text-foreground-subtle",children:d})]}),e.jsx(U,{account:l,onRename:c,bankAccountCount:i,className:"relative transition-opacity focus-visible:opacity-100 max-md:opacity-100 md:opacity-0 md:group-hover:opacity-100"}),o?e.jsx(be,{paused:o}):s.stale?e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-accent-gold-soft px-2 py-[3px] text-[10.5px] font-bold text-warning",children:[e.jsx(B,{size:10}),s.label]}):e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10.5px] font-bold text-success",children:[e.jsx("span",{className:"size-1.5 rounded-full bg-success"}),s.label]})]}),e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx(v,{value:n,size:20,direction:n<0?"out":"plain",showSign:n<0,className:F(s.stale&&n>=0&&"text-foreground-muted")}),o?e.jsx(y,{to:"/plans",onClick:()=>u("tick"),className:"relative cursor-pointer text-[11.5px] font-bold text-primary-soft-foreground hover:underline",children:"ver planos â"}):s.stale&&l.pluggyItemId?e.jsx("button",{type:"button",onPointerDown:()=>u("press"),onPointerUp:()=>u("release"),onClick:x=>{x.stopPropagation(),r(()=>void dt(l.pluggyItemId))()},className:"relative cursor-pointer text-[11.5px] font-bold text-primary-soft-foreground hover:underline",children:"reconectar â"}):null]})]})}function _t({loan:t,account:o,paused:i}){const{moneyVisibility:c}=O(),r=o?Q(o):null,l=me(t),n=[o==null?void 0:o.connectorName,fe(t.kind),t.cet!=null?`CET ${pe(t.cet)}`:null].filter(Boolean),s=t.nextInstallmentDueDate!=null?new Date(Number(t.nextInstallmentDueDate)):null,d=t.dueDate!=null?new Date(Number(t.dueDate)):null;return e.jsxs(_,{interactive:!0,className:"group relative flex flex-col gap-2.5 px-[18px] py-4",children:[e.jsx(y,{to:"/accounts",search:x=>({...x,loan:t.id}),replace:!0,"aria-label":`${t.productName??q} â ver detalhes`,onClick:()=>u("tick"),className:"absolute inset-0 rounded-lg"}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(ge,{account:o,size:34}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsx("span",{className:"truncate text-[13.5px] font-bold",children:t.productName??q}),e.jsx("span",{className:"truncate text-[11px] text-foreground-subtle",children:n.join(" · ")})]}),(t.pastDueInstallments??0)>0?e.jsxs("span",{className:"inline-flex flex-none items-center gap-1 rounded-full bg-destructive-soft px-2 py-[3px] text-[10.5px] font-bold text-destructive",children:[e.jsx(B,{size:10,className:"flex-none"}),"em atraso"]}):i?e.jsx(be,{paused:i}):r?r.stale?e.jsxs("span",{className:"inline-flex flex-none items-center gap-1 rounded-full bg-accent-gold-soft px-2 py-[3px] text-[10.5px] font-bold text-warning",children:[e.jsx(B,{size:10,className:"flex-none"}),r.label]}):e.jsxs("span",{className:"inline-flex flex-none items-center gap-1 text-[10.5px] font-bold text-success",children:[e.jsx("span",{className:"size-1.5 rounded-full bg-success"}),r.label]}):null]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.outstandingBalance!=null?e.jsx(v,{value:-t.outstandingBalance,size:20,direction:"out",showSign:!0}):e.jsx("span",{}),t.nextInstallmentAmount!=null?e.jsxs("span",{className:"dz-money text-[11.5px] font-bold text-primary-soft-foreground",children:["próxima ",A(t.nextInstallmentAmount,c),s?` · ${ue(s)}`:""]}):null]}),l?e.jsxs("div",{className:"flex flex-col gap-[5px]",children:[e.jsx(xe,{progress:l.ratio,height:4,"aria-label":"Parcelas pagas"}),e.jsxs("span",{className:"text-[11.5px] text-foreground-muted",children:[e.jsx("b",{className:"dz-money",children:l.paid})," de ",l.total," ","parcelas pagas",d?` · termina ${de(d)}`:""]})]}):null]})}function Tt({card:t,iconById:o,bankAccountCount:i,onRename:c}
1){const{moneyVisibility:r}=O(),{account:l}=t,n=l.creditLimit??0;return e.jsxs(_,{interactive:!0,className:"group relative flex flex-col gap-3 px-5 py-4",children:[e.jsx(y,{to:"/accounts/cards/$cardId",params:{cardId:l.id},"aria-label":`${l.title} â ver fatura`,onClick:()=>u("tick"),className:"absolute inset-0 rounded-lg"}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(H,{account:l,iconById:o,size:34}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsx("span",{className:"truncate text-[13.5px] font-bold",children:l.title}),e.jsxs("span",{className:"truncate text-[11px] text-foreground-subtle",children:["fatura ",t.isClosed?"fechada":"aberta"," · vence"," ",t.dueLabel," · ",Lt(t.dueInDays)]})]}),e.jsx(U,{account:l,onRename:c,bankAccountCount:i,className:"relative transition-opacity focus-visible:opacity-100 max-md:opacity-100 md:opacity-0 md:group-hover:opacity-100"}),e.jsx(v,{value:t.billBalance,size:19,direction:"out",approx:t.billIsEstimate})]}),n>0&&e.jsxs("div",{className:"flex flex-col gap-[5px]",children:[e.jsxs("div",{className:"flex justify-between text-[11.5px] text-foreground-muted",children:[e.jsx("span",{children:"Limite usado"}),e.jsxs("span",{className:"dz-money",children:[e.jsx("b",{children:r?R(t.usedLimit):"R$ â¢â¢â¢â¢â¢"})," ","de"," ",r?A(n):"R$ â¢â¢â¢â¢â¢"]})]}),e.jsx(xe,{progress:Math.min(1,t.usedLimit/n),height:4,"aria-label":"Limite usado"})]}),t.holderTotals.length>0&&e.jsx("div",{className:"flex flex-wrap gap-x-3.5 gap-y-1",children:t.holderTotals.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11.5px] leading-[15px] font-bold",children:[e.jsx(yt,{holder:s.holder,namedHolders:t.namedHolders}),ut(s.holder),e.jsx("span",{className:"dz-money text-foreground-muted",children:r?A(s.total):"R$ â¢â¢â¢â¢â¢"})]},s.holder))}),e.jsx("span",{className:"text-[12px] font-bold text-primary-soft-foreground",children:"ver fatura e entenda o valor â"})]})}function Pt({account:t,balance:o,iconById:i,bankAccountCount:c,onRename:r}){return e.jsxs(_,{interactive:!0,className:"group relative flex items-center gap-2.5 px-[18px] py-3.5",children:[e.jsx(y,{to:"/accounts/$accountId",params:{accountId:t.id},"aria-label":`${t.title} â ver detalhes da conta`,onClick:()=>u("tick"),className:"absolute inset-0 rounded-lg"}),e.jsx(H,{account:t,iconById:i,size:32}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] font-bold",children:t.title}),e.jsx(v,{value:o,size:15,direction:o<0?"out":"plain",showSign:o<0}),e.jsx(U,{account:t,onRename:r,bankAccountCount:c,className:"relative transition-opacity focus-visible:opacity-100 max-md:opacity-100 md:opacity-0 md:group-hover:opacity-100"})]})}const Gt=function(){const{connectBank:o}=He(),i=Ue(),{loan:c}=Qe.useSearch(),{moneyVisibility:r}=O(),{has:l}=Ve(),n=At(),{status:s,loading:d}=We(),x=!l.premium&&!l.ultra,b=x&&!!s&&Ge(s)&&s.used===0,f=x?Ke(s):null,[C,g]=p.useState(!1),[je,D]=p.useState(null),[Ne,V]=p.useState(!1),[W,ve]=p.useState("conta"),[ye,G]=p.useState(!1),{guardWrite:we}=E(),K=we(a=>{ve(a),V(!0)}),Y=S({tableName:L.ICON}),T=p.useMemo(()=>new Map(Y.map(a=>[a.id,a])),[Y]),w=n.bankAccounts.filter(a=>a.isOpenFinance),Ce=n.bankAccounts.filter(a=>!a.isOpenFinance),I=S({tableName:L.PLUGGY_LOAN,query:[h.Q.sortBy("outstanding_balance",h.Q.desc)]}),J=p.useMemo(()=>Ye([...n.bankAccounts.map(a=>a.account),...n.creditCards.map(a=>a.account)]),[n.bankAccounts,n.creditCards]),Ie=It(I),P=c?I.find(a=>a.id===c)??null:null,ke=()=>void i({to:"/accounts",search:a=>({...a,loan:void 0}),replace:!0}),Ae=S({tableName:L.ACCOUNT,query:[h.Q.where("is_archived",h.Q.eq(!0)),h.Q.where("pluggy_item_id",h.Q.notEq(null))]}),De=w.length===0&&(((s==null?void 0:s.used)??0)>0||((s==null?void 0:s.connections.length)??0)>0),ze=()=>{var a;g(!0),(a=document.getElementById(he))==null||a.scrollIntoView({behavior:"smooth",block:"center"})},M=n.bankAccounts.length,N=p.useMemo(()=>{if(s&&s.connections.length>0){let j=0,X=0,ee=0;for(const Ee of s.connections){const te=ae(Ee,s.bankHealth);te==="ok"?j+=1:te==="paused"?ee+=1:X+=1}return{ok:j,attention:X,paused:ee}}const a=new Set,m=new Set;for(const{account:j}of w)j.pluggyItemId&&(Q(j).stale?a.add(j.pluggyItemId):m.add(j.pluggyItemId));for(const j of a)m.delete(j);return{ok:m.size,attention:a.size,paused:0}},[s,w]),Z=p.useMemo(()=>{const a=new Map;for(const m of(s==null?void 0:s.connections)??[])ae(m,(s==null?void 0:s.bankHealth)??[])==="paused"&&a.set(m.itemId,m);return a},[s]),Se=w.length>0||((s==null?void 0:s.connections.length)??0)>0,Le=p.useMemo(()=>Je(s==null?void 0:s.connections,[...n.bankAccounts.map(a=>a.account),...n.creditCards.map(a=>a.account)]),[s,n.bankAccounts,n.creditCards]),Oe=r?`${n.monthDelta<0?"â ":"+ "}${R(Math.abs(n.monthDelta))}`:"R$ â¢â¢â¢â¢â¢";return n.loading?e.jsx(Ze,{}):e.jsxs(e.Fragment,{children:[e.jsx(wt,{}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-4",children:[e.jsxs(Nt,{className:"flex flex-none flex-col gap-5 rounded-xl px-[26px] py-5 md:flex-row md:items-center md:gap-6",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[e.jsx("span",{className:"dz-eyebrow text-white/75",children:"Quanto você tem · hoje"}),e.jsx(v,{value:n.netWorth,size:42,direction:"plain",showSign:n.netWorth<0,className:n.netWorth<0?"text-red-300 [text-shadow:0_1px_2px_rgba(9,9,11,0.28),0_6px_18px_rgba(9,9,11,0.22)]":"text-white"}),e.jsxs("span",{className:"text-[12.5px] text-white/85",children:[e.jsx("b",{children:Oe})," desde ",n.monthStartLabel]}),e.jsx(ht,{onBrand:!0,onClick:()=>G(!0),className:"self-start text-[11.5px]"})]}),n.netWorthSeries.length>1&&e.jsx("div",{className:"hidden w-[220px] flex-none lg:block",children:e.jsx(vt,{points:n.netWorthSeries,height:64,stroke:"rgba(255,255,255,.85)",strokeWidth:2.5,endDot:!0,tooltipVariant:"brand",formatValue:a=>r?R(a):"R$ â¢â¢â¢â¢â¢",label:"Evolução de quanto você tem nos últimos 30 dias"})}),e.jsxs("div",{className:"flex w-full flex-none flex-col gap-2 md:w-[210px]",children:[e.jsxs("div",{className:"flex min-h-[51px] flex-col justify-center gap-[5px] rounded-[13px] bg-white/14 px-3.5 py-[11px]",children:[e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"text-[11.5px] text-white/80",children:"Conexões"}),s?s.used>0?e.jsx("span",{className:"dz-money text-[12.5px] font-bold",children:Xe(s)}):e.jsx("span",{className:"text-[12.5px] font-bold",children:b?"já usada":"nenhuma ainda"}
1):d?e.jsx("span",{"aria-hidden":!0,className:"h-[13px] w-[92px] animate-pulse rounded-full bg-white/30 motion-reduce:animate-none"}):e.jsx("span",{className:"dz-money text-[12.5px] font-bold",children:"â"})]}),s&&!s.ultra&&s.total>0&&s.used>0?e.jsx("div",{role:"progressbar","aria-label":"Conexões em uso","aria-valuenow":s.used,"aria-valuemax":s.total,className:"h-[5px] overflow-hidden rounded-full bg-white/25",children:e.jsx("div",{className:"h-full rounded-full bg-white",style:{width:`${Math.min(100,s.used/s.total*100)}%`}})}):d?e.jsx("div",{"aria-hidden":!0,className:"h-[5px] animate-pulse rounded-full bg-white/25 motion-reduce:animate-none"}):null,f&&e.jsx("span",{className:"text-[11px] leading-[1.4] text-white/80",children:f})]}),I.length>0?e.jsxs("div",{className:"flex flex-col gap-[3px] rounded-[13px] bg-white/14 px-3.5 py-[9px]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[11.5px] leading-none text-white/80",children:[e.jsx(ce,{size:13,className:"flex-none"}),"Empréstimos"]}),e.jsxs("span",{className:"dz-money text-[12.5px] font-bold",children:["â ",A(Ie,r)]})]}),e.jsx("span",{className:"text-[11px] leading-[1.4] text-white/70",children:"não entram no total acima"})]}):null,b?e.jsx($,{variant:"white",className:"h-[38px]",onClick:()=>void i({to:"/plans",search:{redirected:"1",plan:"PREMIUM"}}),children:"Ver planos"}):x&&((s==null?void 0:s.used)??0)>0?e.jsxs($,{variant:"white",className:"h-[38px]",onClick:o,children:[e.jsx(ne,{size:15}),et]}):e.jsxs($,{variant:"white",className:"h-[38px]",onClick:o,children:[e.jsx(z,{size:15}),"Conectar banco · ~2 min"]})]})]}),e.jsxs("section",{className:"flex flex-none flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:"dz-eyebrow text-foreground-subtle",children:"Conectadas · Open Finance"}),e.jsx("div",{className:"flex-1"}),e.jsx(St,{targets:Le})]}),w.length>0?e.jsx("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2 xl:grid-cols-3",children:w.map(a=>e.jsx(Et,{entry:a,paused:Z.get(a.account.pluggyItemId??""),bankAccountCount:M,onRename:D},a.account.id))}):De?e.jsx("div",{className:"flex items-center gap-2.5 rounded-lg border border-border bg-surface-sunken px-[18px] py-3.5 text-[12.5px] font-semibold text-foreground-muted",children:Ae.length>0?e.jsxs(e.Fragment,{children:[e.jsx(tt,{size:14,className:"flex-none"}),e.jsxs("span",{children:[st.replace(/Arquivadas\.$/,""),e.jsx("button",{type:"button",onClick:ze,className:"cursor-pointer font-semibold text-primary hover:underline",children:"Arquivadas"}),"."]})]}):e.jsxs(e.Fragment,{children:[e.jsx(z,{size:14,className:"flex-none"}),at]})}):e.jsxs("button",{type:"button",onClick:o,className:"flex cursor-pointer items-center gap-2.5 rounded-lg border-[1.5px] border-dashed border-border-strong px-[18px] py-3.5 text-[12.5px] font-semibold text-foreground-muted transition-colors hover:bg-surface-sunken",children:[e.jsx(z,{size:14}),"Nenhum banco conectado ainda â conectar banco · ~2 min"]})]}),I.length>0?e.jsxs("section",{className:"flex flex-none flex-col gap-2",children:[e.jsx("span",{className:"dz-eyebrow text-foreground-subtle",children:"Empréstimos e financiamentos · Open Finance"}),e.jsx("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2 xl:grid-cols-3",children:I.map(a=>e.jsx(_t,{loan:a,account:J.get(a.pluggyItemId),paused:Z.get(a.pluggyItemId)},a.id))}),e.jsx("span",{className:"px-1 text-[11px] leading-[1.45] text-foreground-subtle",children:"Cheque especial já usado aparece no saldo da conta e não é somado de novo aqui. O saldo devedor não entra em âQuanto você temâ."})]}):null,e.jsxs("div",{className:"grid flex-1 grid-cols-1 content-start gap-3.5 lg:grid-cols-[1.5fr_1fr]",children:[e.jsxs("section",{className:"flex min-w-0 flex-col gap-2",children:[e.jsx("span",{className:"dz-eyebrow text-foreground-subtle",children:"Cartões de crédito"}),n.creditCards.length>0?n.creditCards.map(a=>e.jsx(Tt,{card:a,iconById:T,bankAccountCount:M,onRename:D},a.account.id)):e.jsxs(nt,{children:[e.jsx(lt,{asChild:!0,children:e.jsxs("button",{type:"button",className:"flex cursor-pointer items-center gap-2.5 rounded-lg border-[1.5px] border-dashed border-border-strong px-[18px] py-3.5 text-[12.5px] font-semibold text-foreground-muted transition-colors hover:bg-surface-sunken",children:[e.jsx(le,{size:14}),"Nenhum cartão ainda â conecte seu banco ou crie um cartão manual"]})}),e.jsx(ot,{children:e.jsxs(rt,{align:"start",sideOffset:8,className:"z-50 min-w-[220px] rounded-lg border border-border bg-surface-elevated p-1.5 shadow-[0_16px_48px_rgba(9,9,11,0.18)]",children:[e.jsxs(oe,{className:re,onSelect:o,children:[e.jsx(z,{size:16,className:"text-primary"}),e.jsx("span",{className:"flex-1",children:"Conectar banco"})]}),e.jsxs(oe,{className:re,onSelect:()=>K("cartao"),children:[e.jsx(le,{size:16,className:"text-foreground-muted"}),e.jsx("span",{className:"flex-1",children:"Cartão manual"})]})]})})]})]}),e.jsxs("section",{className:"flex min-w-0 flex-col gap-2",children:[e.jsx("span",{className:"dz-eyebrow text-foreground-subtle",children:"Manuais"}),Ce.map(({account:a,balance:m})=>e.jsx(Pt,{account:a,balance:m,iconById:T,bankAccountCount:M,onRename:D},a.id)),e.jsxs("button",{type:"button",onClick:()=>K("conta"),className:"flex cursor-pointer items-center gap-2 rounded-lg border-[1.5px] border-dashed border-border-strong px-[18px] py-[13px] text-[12.5px] font-semibold text-foreground-muted transition-colors hover:bg-surface-sunken",children:[e.jsx(ne,{size:14}),"Nova conta manual"]}),Se&&e.jsxs("span",{className:"px-1 text-[11px] leading-[1.45] text-foreground-subtle",children:["Saúde das conexões: ",N.ok," ok",N.attention>0&&e.jsxs(e.Fragment,{children:[" ","· ",N.attention," ",N.attention===1?"desatualizada":"desatualizadas"]}),N.paused>0&&e.jsxs(e.Fragment,{children:[" ","· ",N.paused," ",N.paused===1?"paus
1ada":"pausadas"]})," ","â"," ",e.jsx(y,{to:"/accounts/health",onClick:()=>u("tick"),className:"cursor-pointer font-semibold text-primary hover:underline",children:"ver status"})]}),e.jsx(Ot,{open:C,onOpenChange:g})]})]}),e.jsx(jt,{open:ye,onOpenChange:G,intro:"A soma exata das suas contas, banco a banco:",rows:n.bankAccounts.map(({account:a,balance:m})=>({label:a.title,icon:e.jsx(H,{account:a,iconById:T,size:26}),value:m,direction:m<0?"out":"plain"})),totalLabel:"= Quanto você tem",totalValue:n.netWorth,totalDirection:n.netWorth<0?"out":"plain",footnote:{label:"Onde entram os cartões",body:"As faturas dos cartões moram no card ao lado â uma compra no cartão só mexe neste número quando você paga a fatura, nunca duas vezes."}}),e.jsx(zt,{loan:P,account:P?J.get(P.pluggyItemId):void 0,onOpenChange:a=>{a||ke()}}),e.jsx(kt,{account:je,onOpenChange:a=>{a||D(null)}}),e.jsx(it,{open:Ne,onOpenChange:V,initialKind:W},W)]})]})};export{Gt as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.