{"version":3,"file":"index-DMjP59-n.js","sources":["../../../app/javascript/entrypoints/pages/StockPage/CashFlowTable/index.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { CashFlow } from '../../../output/models';\n\nimport { CashFlowRow } from './CashFlowRow';\nimport { TableHeader } from './TableHeader';\n\ninterface Props {\n cashFlows: CashFlow[];\n quarter?: number;\n}\n\nexport const CashFlowTable: React.FC = ({ cashFlows, quarter }) => {\n return (\n \n \n \n {cashFlows\n .filter((cashFlow) => (quarter ? quarter === cashFlow.quarter : true))\n .map((cashFlow, index) => (\n \n ))}\n \n
\n );\n};\n\nconst showAccountingPeriod = (cashFlows: CashFlow[], index: number): boolean => {\n if (index === 0) {\n return true;\n } else {\n const year = cashFlows[index].year;\n const month = cashFlows[index].month;\n const nextYear = cashFlows[index - 1].year;\n const nextMonth = cashFlows[index - 1].month;\n\n return year != nextYear || (year == nextYear && month != nextMonth);\n }\n};\n"],"names":["CashFlowTable","cashFlows","quarter","jsxs","jsx","TableHeader","cashFlow","index","CashFlowRow","showAccountingPeriod","year","month","nextYear","nextMonth"],"mappings":"uWAYO,MAAMA,EAAiC,CAAC,CAAE,UAAAC,EAAW,QAAAC,KAExDC,EAAA,KAAC,QAAM,CAAA,UAAU,qBACf,SAAA,CAAAC,EAAA,IAACC,EAAY,EAAA,EACZD,EAAA,IAAA,QAAA,CACE,SACEH,EAAA,OAAQK,GAAcJ,EAAUA,IAAYI,EAAS,QAAU,EAAK,EACpE,IAAI,CAACA,EAAUC,IACdH,EAAA,IAACI,EAAA,CACC,SAAAF,EACA,qBAAsBJ,EAAU,GAAOO,EAAqBR,EAAWM,CAAK,CAAA,EACvEA,CAER,CAAA,EACL,CACF,CAAA,CAAA,EAIEE,EAAuB,CAACR,EAAuBM,IAA2B,CAC9E,GAAIA,IAAU,EACL,MAAA,GACF,CACC,MAAAG,EAAOT,EAAUM,CAAK,EAAE,KACxBI,EAAQV,EAAUM,CAAK,EAAE,MACzBK,EAAWX,EAAUM,EAAQ,CAAC,EAAE,KAChCM,EAAYZ,EAAUM,EAAQ,CAAC,EAAE,MAEvC,OAAOG,GAAQE,GAAaF,GAAQE,GAAYD,GAASE,CAC3D,CACF"}