PageSourceSearch

https://xynergy.ai/_next/static/chunks/969.1e6bc9e393b23e08.js

js xynergy.ai collected 2026-10-05 16:02:02 UTC 4,101 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[969],{70969:(e,r,t)=>{t.r(r),t.d(r,{PremiumProjectionChart:()=>j});var l=t(85047),s=t(31615),a=t(60996),n=t(87884),o=t(99922),i=t(91595),c=t(82520),d=t(21582),u=t(73521),h=t(21016),x=t(54306);let m=[10,20,30],p=[{value:"productCode",label:"依商品代碼"},{value:"company",label:"依公司"},{value:"category",label:"依大分類"}];function j(){let{auth:e}=(0,u.A)(),{theme:r}=(0,o.D)(),t=(0,i.py)(),j=(0,i.OY)(),[y,b]=(0,s.useState)(20),[g,f]=(0,s.useState)("productCode"),[v,C]=(0,s.useState)([]),[N,S]=(0,s.useState)(!0),[k,w]=(0,s.useState)(null);(0,s.useEffect)(()=>{if(!e?.currentUser){S(!1),C([]);return}S(!0),w(null),e.currentUser.getIdToken().then(e=>fetch(`/api/insurance/premium-projections?years=${y}&excludeProperty=1`,{headers:{Authorization:`Bearer ${e}`}})).then(e=>e.ok?e.json():e.json().then(e=>{throw Error(e.error||"載入失敗")})).then(e=>{C(Array.isArray(e.projections)?e.projections:[])}).catch(e=>{w(e instanceof Error?e.message:"載入失敗"),C([])}).finally(()=>S(!1))},[e?.currentUser,y]);let F=(0,s.useMemo)(()=>{if(0===v.length)return null;let e=v.map(e=>String(e.year)),r="company"===g?"byCompany":"category"===g?"byCategory":"byProductCode",l=new Set;v.forEach(e=>Object.keys(e[r]||{}).forEach(e=>l.add(e)));let s=Array.from(l).sort().map((e,t)=>({name:e,data:v.map(t=>{let l=(t[r]??{})[e]??0;return{y:l,custom:{formattedPremium:l>=1e6?`${(l/1e6).toFixed(1)}百萬`:l>=1e4?`${Math.round(l/1e4)}萬`:Math.round(l).toLocaleString()}}}),color:j[t%j.length]}));return s.some(e=>e.data.some(e=>e.y>0))?(0,i.dt)("line",{chart:{type:"line",backgroundColor:"transparent",height:400},title:{text:"未來保費走勢",style:{color:t.text,fontSize:"18px",fontWeight:"bold"}},xAxis:{categories:e,title:{text:"年度",style:{color:t.mutedForeground}},labels:{style:{color:t.text,fontSize:"12px"}}},yAxis:{title:{text:"年繳保費(元)",style:{color:t.mutedForeground}},labels:{format:"{value:,.0f}",style:{color:t.mutedForeground,fontSize:"11px"}}},plotOptions:{line:{marker:{enabled:!1},lineWidth:2,dataLabels:{enabled:!1}}},tooltip:{shared:!0,useHTML:!0,headerFormat:"",pointFormat:'<span style="color:{series.color}">●</span> {series.name}: <b>{point.custom.formattedPremium}</b><br/>',backgroundColor:t.background,borderColor:t.border,style:{color:t.text}},series:s,credits:{enabled:!1}}):null},[v,g,t,j]),A=!N&&!k&&v.length>0&&!F,P=!N&&!k&&v.length>0&&v.every(e=>0===e.totalPremium);return(0,l.jsxs)(c.Zp,{children:[(0,l.jsx)(c.aR,{children:(0,l.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(c.ZB,{children:"未來保費走勢"}),(0,l.jsx)(c.BT,{children:"僅顯示要保人為本人的保單,預估至被保險人 90 歲為止"})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsxs)(d.l6,{value:String(y),onValueChange:e=>b(Number(e)),children:[(0,l.jsx)(d.bq,{className:"w-[100px]",children:(0,l.jsx)(d.yv,{})}),(0,l.jsx)(d.gC,{children:m.map(e=>(0,l.jsxs)(d.eb,{value:String(e),children:[e," 年"]},e))})]}),(0,l.jsxs)(d.l6,{value:g,onValueChange:e=>f(e),children:[(0,l.jsx)(d.bq,{className:"w-[120px]",children:(0,l.jsx)(d.yv,{})}),(0,l.jsx)(d.gC,{children:p.map(e=>(0,l.jsx)(d.eb,{value:e.value,children:e.label},e.value))})]})]})]})}),(0,l.jsxs)(c.Wu,{children:[k&&(0,l.jsx)(h.Fc,{variant:"destructive",children:(0,l.jsx)(h.TN,{children:k})}),N&&(0,l.jsx)(x.default,{className:"h-[320px]",size:64}),!N&&!k&&0===v.length&&(0,l.jsx)(h.Fc,{children:(0,l.jsx)(h.TN,{children:"尚無要保人為本人的保單,或無可預估保費的保單。"})}),P&&(0,l.jsx)(h.Fc,{children:(0,l.jsx)(h.TN,{children:"目前無可預估的未來保費(請確認保單已連結商品且商品有費率表)。"})}),A&&!P&&(0,l.jsx)(h.Fc,{children:(0,l.jsx)(h.TN,{children:"此區間內無保費資料。"})}),F&&!N&&!k&&(0,l.jsx)("div",{className:"w-full",children:(0,l.jsx)(a.A,{highcharts:n.A,options:F,containerProps:{style:{width:"100%",height:"400px"}}})})]})]})}}}]);

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.