PageSourceSearch

https://app.finimpulse.com/chunk-5AQBXZ77.js

js finimpulse.com collected 2026-10-04 21:46:52 UTC 5,315 bytes, 1 lines download raw bytes

1import{a as u,d as P,e as A}from"./chunk-4HGNWMUF.js";import{b as I}from"./chunk-M45BUSZV.js";import{A as n,D as M,E as y,F as R,G as O,H as F,ca as U,ha as _,ia as V,ja as j}from"./chunk-OQWTGWQI.js";import{R as T,U as C,Vc as w,Y as L,aa as m,c as g,ic as v,jc as b,kc as D,z as S}from"./chunk-Q47N5KYY.js";import{a as i,b as l}from"./chunk-DE4CES4T.js";var B={chartData:u()};var H={tableData:u(),tableParams:{limit:10,offset:0,filters:void 0,sort_by:void 0},tableSearch:""};var K=(()=>{class t{configService=m(I);http=m(w);getApiErrorChartData(e){return this.http.post(this.configService.getApiEndpoint("api/api-errors/chart"),e)}getApiErrorTableData(e){return this.http.post(this.configService.getApiEndpoint("api/api-errors/table"),e)}static \u0275fac=function(s){return new(s||t)};static \u0275prov=L({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function $(t,r){return P(g(S(e=>e!==null),C(()=>{n(t,e=>({chart:l(i({},e.chart),{chartData:l(i({},e.chart.chartData),{isLoading:!0,error:null})})}))}),T(()=>{let{startDate:e,endDate:s}=t;return r.getApiErrorChartData({startDate:e(),endDate:s()}).pipe(A({next:o=>{n(t,a=>({chart:l(i({},a.chart),{chartData:l(i({},a.chart.chartData),{isLoading:!1,error:null,data:o})})}))},error:o=>{console.error("Get chart data failed:",o),n(t,a=>({chart:l(i({},a.chart),{chartData:l(i({},a.chart.chartData),{isLoading:!1,error:o.error?.transformedMessage||"Failed to load chart data"})})}))}}))})))}function k(t,r){return P(g(S(e=>e!==null),C(()=>{n(t,e=>({table:l(i({},e.table),{tableData:l(i({},e.table.tableData),{isLoading:!0,error:null})})}))}),T(()=>{let{startDate:e,endDate:s}=t,{tableParams:o}=t.table;return r.getApiErrorTableData(l(i({},o()),{startDate:e(),endDate:s()})).pipe(A({next:a=>{n(t,c=>({table:l(i({},c.table),{tableData:{isLoading:!1,error:null,data:a}})}))},error:a=>{console.error("Get table data failed:",a),n(t,c=>({table:l(i({},c.table),{tableData:l(i({},c.table.tableData),{isLoading:!1,error:a.error?.transformedMessage||"Failed to load table data"})})}))}}))})))}var G=(t,r)=>()=>({startDate:t,endDate:r}),J=t=>r=>({table:l(i({},r.table),{tableParams:i(i({},r.table.tableParams),t)}
1)}),N=(t,r)=>e=>({table:l(i({},e.table),{tableParams:l(i({},e.table.tableParams),{limit:t,offset:r})})}),Y=()=>t=>({table:l(i({},t.table),{tableParams:l(i({},t.table.tableParams),{offset:0})})}),q=t=>r=>({table:l(i({},r.table),{tableSearch:t})}),z=(t,r)=>e=>(console.log("[ApiErrors Updater] setTableFilters called",{filters:t,primeNgFilters:r}),{table:l(i({},e.table),{tableParams:l(i({},e.table.tableParams),{filters:t,offset:0})}),primeNgFilters:r}),Q=t=>r=>({table:l(i({},r.table),{tableParams:l(i({},r.table.tableParams),{sort_by:t,offset:0})})}),W=(t,r)=>()=>({startDate:t,endDate:r});var x=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#14b8a6","#f97316","#06b6d4","#84cc16"];function tt(t,r){let e=[],s=new Date(t),o=new Date(r),a=new Date(s);for(;a<=o;){let c=a.getFullYear(),p=String(a.getMonth()+1).padStart(2,"0"),f=String(a.getDate()).padStart(2,"0");e.push(`${c}-${p}-${f}`),a.setDate(a.getDate()+1)}return e}function Z(t,r,e){let s=tt(r,e);if(!t||!t.day_graph||t.day_graph.length===0)return{series:[X(s.map(d=>[d,0]))],seriesKeys:[],totalErrors:0};let{day_graph:o,day_graph_e:a,day_graph_total:c}=t,p=a||[];if(p.length===0){let d=o.map(h=>[h.date,h.total]);return{series:[X(d)],seriesKeys:[],totalErrors:c?.total||0}}return{series:p.map((d,h)=>({name:d,type:"line",data:o.map(E=>[E.date,E[d]||0]),color:x[h%x.length],lineStyle:{width:2},smooth:!0})),seriesKeys:p,totalErrors:c?.total||0}}function X(t){return{name:"Total Errors",type:"line",data:t,color:x[0],lineStyle:{width:2},smooth:!0}}var Ot=M(F(l(i({},U("month")),{chart:B,table:H,primeNgFilters:void 0,visibleColumns:[]})),y(t=>({chartData:b(()=>t.chart.chartData().data),isChartLoading:b(()=>t.chart.chartData().isLoading),chartError:b(()=>t.chart.chartData().error),tableData:b(()=>t.table.tableData().data),isTableLoading:b(()=>t.table.tableData().isLoading),tableError:b(()=>t.table.tableData().error),totalCount:b(()=>t.table.tableData().data?.meta?.total||0),itemsCount:b(()=>t.table.tableData().data?.data?.length||0)})),y(t=>({chartVm:b(()=>Z(t.chartData(),t.startDate(),t.endDate()))})),O((t,r=m(K))=>{let e=$(t,r),s=k(t,r);return{getChartData:e,getTableData:s,setDateParams(o,a){n(t,G(o,a))},setTableParams(o){n(t,J(o))},setTableLimitAndOffset(o,a){n(t,N(o,a))},resetTableOffset(){n(t,Y())},setTableSearch(o){n(t,q(o))},setTableFilters(o,a){n(t,z(o,a))},setTableSortBy(o){n(t,Q(o))},setVisibleColumns(o){n(t,{visibleColumns:o})},setDateRange(o,a){n(t,W(o,a))}}}),_("API Errors Store"),R({onInit(t){let r=m(j),e=m(V).getCurrentRoute,s=r.isApiMode,o=localStorage.getItem("finimpulse-api-errors-visible-columns");if(o)try{let a=JSON.parse(o);Array.isArray(a)&&n(t,{visibleColumns:a})}catch(a){console.error("Failed to parse saved visible columns:",a)}D(()=>{let a=t.visibleColumns();a.length>0&&localStorage.setItem("finimpulse-api-errors-visible-columns",JSON.stringify(a))}),D(()=>{let a=e(),c=s(),p=t.startDate(),f=t.endDate();a.includes("/developer/errors")&&c&&v(()=>{t.getChartData()})}),D(()=>{let a=e(),c=s(),p=t.startDate(),f=t.endDate(),d=t.table.tableParams();a.includes("/developer/errors")&&c&&v(()=>{t.getTableData()})})}}));export{Ot as a};

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.