PageSourceSearch

https://app.upmetrics.co/chunks/CDgLOcuT.js

js upmetrics.co collected 2026-10-01 11:51:50 UTC 3,419 bytes, 1 lines download raw bytes

1import{r as c,j as s}from"./Dem1e8VV.js";import{u as A,aI as D,cb as L,aL as M,U,au as H,y as V,cc as _,cd as j,ce as x,G as q,a2 as z,a3 as W,a4 as B,a5 as G,a6 as Q}from"../entry/CcVTEBpa.js";import{d as J,u as K,W as X,L as Z}from"./dWhdajSv.js";import"./BnZNklX7.js";import"./phrJN640.js";import{r as $,F as ee}from"./BIO81nk6.js";import{S as se}from"./pfE5ULBJ.js";import"./Dh95b2SR.js";const ae=[{key:"monthly",label:"REPORTS.MONTHLY"},{key:"quarterly",label:"REPORTS.QUARTERLY"},{key:"yearly",label:"REPORTS.YEARLY"}],ue=()=>{var R,y;const m=A(),{businessId:a,projection:n,year:o,reportType:d}=J(),t=K(),N=X(),P=D(),T=L(),[,h]=c.useTransition(),k=M(),f=U(),p=H(),F=k.getFinancialYearRange(a||"").long,g=T.isFinanceForecastPermitted(a||""),b=V(()=>{var e,l,u;return((u=(l=(e=_.findOne({businessId:a}))==null?void 0:e.tax)==null?void 0:l.registration)==null?void 0:u.name)||""},[a]),i=c.useMemo(()=>f.getFinanceReportsList(a,b),[f,a,b]),E=P.getSheetMetaData("YearDataArr",a),r=i==null?void 0:i[parseInt(d)],S=$(r==null?void 0:r.type),v=S?j(a,S.section):null,I=c.useMemo(()=>({projection:n!=null?n:"monthly",year:n==="monthly"?o:""}),[n,o]),O=c.useCallback(e=>{p.updateWorkspacePreference(a,{financeFrequency:e}),h(()=>{t(x(a,e,o,d))})},[t,a,o,d,p]),C=c.useCallback(e=>{h(()=>{t(x(a,n,e,d))})},[t,a,n,d]),w=c.useCallback(e=>{const l=i==null?void 0:i.findIndex(u=>u.type===e.report);l===void 0||l<0||h(()=>{t(x(a,n,o,l),{state:{highlightRowId:e.rowId}})})},[t,a,n,o,i]),Y=c.useCallback(e=>{t(j(a,e))},[t,a]);return s.jsxs("div",{className:"h-full flex flex-col min-h-0",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 bg-surface border-b border-border shrink-0",children:[s.jsxs("div",{className:"flex items-baseline gap-3 min-w-0",children:[s.jsx("h2",{className:"text-sm font-semibold text-foreground truncate",children:(R=r==null?void 0:r.name)!=null?R:""}),g&&v&&s.jsx(Z,{to:v,className:"text-xs text-link hover:underline cursor-pointer shrink-0",children:m("REPORTS.EDIT_ASSUMPTIONS")})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[g&&s.jsxs(s.Fragment,{children:[s.jsx(se,{businessId:a,sheetsCanShowActuals:!0,variant:"ghost",className:"size-8 text-muted-foreground hover:text-foreground"}),s.jsx("div",{className:"w-px h-5 bg-border mx-1"})]}),s.jsx("div",{className:"flex h-8 items-center rounded-md border border-border bg-muted p-0.5 gap-0.5",children:ae.map(e=>s.jsx("button",{onClick:()=>O(e.key),className:q("flex h-full items-center px-3 text-xs font-medium rounded transition-colors cursor-pointer",n===e.key?"bg-surface text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:m(e.label)},e.key))}),n==="monthly"?s.jsxs(z,{value:o,onValueChange:C,children:[s.jsx(W,{size:"sm",className:"w-28 bg-surface text-xs border-border cursor-pointer shadow-none",children:s.jsx(B,{placeholder:m("REPORTS.YEAR")})}),s.jsx(G,{children:E.map(e=>s.jsx(Q,{value:e,className:"cursor-pointer text-xs",children:e},e))})]}):s.jsx("div",{className:"flex h-8 items-center bg-surface rounded-md text-xs border border-border px-3 text-foreground",children:F})]})]}),s.jsx("div",{className:"flex-1 min-h-0 overflow-hidden p-3",children:s.jsx(ee,{businessId:a,reportType:r==null?void 0:r.type,criteria:I,referrer:"FINANCE_REPORTS",onOpenSource:w,onConfigure:Y,highlightRowId:(y=N.state)==null?void 0:y.highlightRowId})})]})};export{ue as default};

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.