PageSourceSearch

https://app.hellocashflow.com/assets/scenarioCalculatorReportPdfSectionImages-COg181f5.js

js hellocashflow.com collected 2026-10-05 08:51:50 UTC 4,781 bytes, 1 lines download raw bytes

1import{b as u,S as w,a as E,c as B,d as b,e as I,R,f as _}from"./ScenarioCalculatorV2-DgYvlJ3Y.js";import{C as O}from"./ChartToImageRendererWithLogging-C6eT9J8K.js";import{g as T}from"./featureFlowLogging-CqJ70eFU.js";import{a as s}from"./renderApp-u-N8zGrG.js";import{ag as x}from"./mui-CXmN3Oom.js";import"./SyncV2Inline-JfT1VgRg.js";import"./vendor-DQlEDkUw.js";import"./FrontendLoggerFactory-Djn_Sph3.js";import"./PageDataAutoSync-BfNIkBtZ.js";import"./PlusIcon-DUwIWteb.js";import"./useCurrentOrgRole-BrFSdMMo.js";import"./redux-4MybQdK_.js";import"./ScenarioLightbulbIcon-SEQ0frtR.js";import"./sumOfMonths-6Io42S78.js";import"./featureCarouselEvents-DmUmEdHp.js";import"./XCloseIcon-8YMc4VWQ.js";import"./utils-DKoIadZ7.js";import"./muix-DAwokrS4.js";import"./charts-ZLkqu54y.js";import"./cashflow.aggregatedBuckets-DZ8JHgVE.js";import"./loanCalculatorUtils-Brcqky4u.js";import"./useItems-CNwYPqRu.js";import"./aggregatedCashflowUtils-DBv7-T-7.js";import"./index-agen2LFJ.js";import"./pdfShareUtils-QtLTlbwY.js";import"./pdfCaptureModeContext-Rqya3zEO.js";import"./chartSeries-Bm-Lnlok.js";import"./chartGrid-BY3CssFr.js";import"./zeroReferenceLine-BQUdaprs.js";import"./HoverHelp-C-dXLDVI.js";import"./CompactDoughnutChart-CORtpi39.js";import"./pdf-CzpYUqlh.js";const h=({children:e})=>s(x,{sx:{width:`${R}px`},children:e}),k=({data:e,breakEvenData:t,variant:o,breakEvenSnapshot:n,actuals:r})=>{const{profitMonths:a}=u({data:e,breakEvenData:t,variant:o,actuals:r});return s(h,{children:s(I,{profitMonths:a,snapshot:n})})},v=({data:e,breakEvenData:t,variant:o,snapshot:n,actuals:r})=>{const{bankActualsMonths:a}=u({data:e,breakEvenData:t,variant:o,actuals:r});return s(h,{children:s(b,{bankActualsMonths:a,data:e,snapshot:n})})},M=({data:e,breakEvenData:t,variant:o,actuals:n})=>{const{onlySuffix:r,cashCards:a,cashActualsMonths:c}=u({data:e,breakEvenData:t,variant:o,actuals:n});return s(h,{children:s(B,{actualsMonths:c,cards:a,data:e,headingSuffix:r,variant:o})})},P=({data:e,breakEvenData:t,variant:o,actuals:n})=>{const{onlySuffix:r}=u({data:e,breakEvenData:t,variant:o,actuals:n});return s(h,{children:s(E,{data:e,headingSuffix:r,pdfSlice:"charts",variant:o})})},N=({data:e,breakEvenData:t,variant:o,actuals:n})=>{const{onlySuffix:r}=u({data:e,breakEvenData:t,variant:o,actuals:n});return s(h,{children:s(E,{data:e,headingSuffix:r,pdfSlice:"sources",variant:o})})},y=({data:e,breakEvenData:t,variant:o,actuals:n})=>{const{onlySuffix:r,revenueCards:a,revenueActualsMonths:c}=u({data:e,breakEvenData:t,variant:o,actuals:n});return s(h,{children:s(w,{actualsMonths:c,cards:a,data:e,headingSuffix:r,variant:o})})},A={scenarioWithBaseline:["bankBalance","breakEven","cashInOut","cashBreakdown","cashBreakdownSources","revenueExpenses"],scenarioOnly:["breakEven","cashInOut","cashBreakdown","cashBreakdownSources","revenueExpenses"]},H={breakEven:k,bankBalance:v,cashInOut:M,cashBreakdown:P,cashBreakdownSources:N,revenueExpenses:y},W=4e3,L={width:R,height:W,backgroundColor:_,format:"png",skipFonts:!1},F=24,C=6,X=async e=>{const t=new Image;await new Promise((p,l)=>{t.onload=()=>p(),t.onerror=()=>l(new Error("capture image decode failed")),t.src=e});const o=document.createElement("canvas");o.width=t.naturalWidth,o.height=t.naturalHeight;const n=o.getContext("2d");if(!n)return e;n.drawImage(t,0,0);const[r,a,c]=n.getImageData(0,o.height-1,1,1).data;let i=0;for(let p=o.height-1;p>=0;p-=1){const l=n.getImageData(0,p,o.width,1).data;for(let m=0;m<l.length;m+=4)if(Math.abs(l[m]-r)>C||Math.abs(l[m+1]-a)>C||Math.abs(l[m+2]-c)>C){i=p;break}if(i>0)break}if(i===0)return e;const f=F*2,d=Math.min(o.height,i+f);if(d>=o.height)return e;const S=document.createElement("canvas");S.width=o.width,S.height=d;const g=S.getContext("2d");return g?(g.drawImage(o,0,0),S.toDataURL("image/png")):e},D=async({key:e,props:t,logger:o,scenarioId:n})=>{try{const r=await O.renderChartToImage(H[e],t,L);return{key:e,image:await X(r)}}catch(r){const a=T(r);throw o.error("Scenario report PDF section capture failed",r instanceof Error?r:new Error(a.message),{operation:"capture_scenario_report_pdf_section",sectionKey:e,variant:t.variant,scenarioId:n,errorName:a.name,errorMessage:a.message}),r}},Re=async({reportData:e,actuals:t,views:o,logger:n})=>{const r={},a=e.baselineStatus!=="proved"?o.filter(c=>c!=="scenarioWithBaseline"):o;for(const c of a){const i=c==="scenarioWithBaseline",f={data:i?e.scenarioWithBaseline:e.scenarioOnly,variant:i?"baseline":"only",snapshot:i?e.snapshot:e.scenarioOnlySnapsh
1ot,breakEvenData:e.scenarioOnly,breakEvenSnapshot:e.scenarioOnlySnapshot,actuals:t};r[c]=await Promise.all(A[c].map(d=>D({key:d,props:f,logger:n,scenarioId:e.scenarioId})))}return r};export{A as SCENARIO_REPORT_PDF_SECTION_SEQUENCE,Re as resolveScenarioCalculatorReportPdfSectionImages};

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.