PageSourceSearch

https://stockcrypto-logs.vercel.app/assets/KeyStatisticsPage-dpSngEJm.js

js stockcrypto-logs.vercel.app collected 2026-10-03 07:48:45 UTC 15,672 bytes, 1 lines download raw bytes

1import{u as _,r as m,j as e}from"./react-vendor-D-BREiNx.js";import{a as P,a7 as D}from"./index-nfApfjmn.js";import{a as $,f as b}from"./indicatorFormat-BZyHbM3V.js";import{R as G,g as I,a as F,X as W,Y,T as U,d as H,L as z}from"./recharts-DGKwn2dW.js";import"./i18n-locales-DVRROYHT.js";import"./lucide-icons-CsRGyagB.js";const B=[{rank:1,keywords:["시장금리","국고채","콜금리","CD금리","CP금리"]},{rank:2,keywords:["여수신","수신금리","대출금리","예금은행 가중평균금리"]},{rank:3,keywords:["예금","대출금"]},{rank:4,keywords:["통화량","M1","M2","유동성"]},{rank:5,keywords:["채권"]},{rank:6,keywords:["수출입물가","수출물가","수입물가"]},{rank:7,keywords:["부동산","주택매매","주택전세","아파트"]},{rank:8,keywords:["국제 원자재","원자재","WTI","브렌트","두바이유","금(국제)","은(국제)"]},{rank:9,keywords:["통관","수출","수입"]},{rank:10,keywords:["국제수지","경상수지","서비스수지","본원소득수지","이전소득수지"]},{rank:11,keywords:["고용","실업","취업","경제활동인구"]}],V=[{rank:1,keywords:["시장금리","콜금리","기준금리","KORIBOR","CD수익률","통안증권수익률","국고채수익률","회사채수익률"]},{rank:2,keywords:["여수신","수신금리","대출금리","예금은행 가중평균금리"]},{rank:3,keywords:["통화량","M1","M2","Lf","유동성"]}],A=["시장금리","여수신금리","통화량","예금/대출금","고용","소비자/생산자 물가","수출입 물가","통관수출입","국제수지"],N=["#0284c7","#0f766e","#7c3aed","#ea580c","#be123c","#4f46e5","#15803d","#b45309","#334155"],X=d=>{const s=`${d.className} ${d.name}`;for(const i of B)if(i.keywords.some(c=>s.includes(c)))return i.rank;return 999},K=d=>{const s=`${d.className} ${d.name}`;for(const i of V)if(i.keywords.some(c=>s.includes(c)))return i.rank;return 999},q=d=>{switch(d){case 1:return"marketRates";case 2:return"bankRates";case 3:return"depositsLoans";case 4:return"moneySupply";case 5:return"bonds";case 6:return"exportImportPrices";case 7:return"realEstate";case 8:return"commodities";case 9:return"customsTrade";case 10:return"balanceOfPayments";case 11:return"employment";default:return"other"}},J=d=>{if(!d)return N[0];const s=Array.from(d).reduce((i,c)=>i+c.charCodeAt(0),0);return N[s%N.length]},Q=d=>{if(d.length===0)return null;const s=d.map(i=>i.value);return{latest:s[s.length-1],min:Math.min(...s),max:Math.max(...s)}},Z=({active:d,payload:s,label:i,unit:c})=>{var k;if(!d||!s||s.length===0)return null;const n=(k=s[0])==null?void 0:k.value;return e.jsxs("div",{className:"rounded-xl border border-slate-200 dark:border-slate-700 bg-white/95 dark:bg-slate-900/95 px-3 py-2 shadow-lg",children:[e.jsx("p",{className:"text-[11px] text-slate-500",children:i}),e.jsxs("p",{className:"mt-1 text-sm font-semibold text-slate-900 dark:text-slate-100",children:[b(n)," ",c]})]})},oe=({economicIndicators:d})=>{var R,T,E;const{t:s}=_(void 0,{i18n:P}),i=(d==null?void 0:d.keyStatistics100)??[],c=d===null,[n,k]=m.useState(null),[u,S]=m.useState({}),[w,v]=m.useState({}),C=m.useRef({}),p=m.useMemo(()=>i.map((t,a)=>{const r=X(t);return{row:t,index:a,priority:r,label:s(`keyStatistics.priorityLabels.${q(r)}`)}}).sort((t,a)=>t.priority!==a.priority?t.priority-a.priority:t.index-a.index),[i,s]),h=m.useMemo(()=>p.filter(t=>t.row.chartSupported).sort((t,a)=>{const r=K(t.row),l=K(a.row);return r!==l?r-l:t.priority!==a.priority?t.priority-a.priority:t.index-a.index}).slice(0,9),[p]),o=m.useMemo(()=>h.find(t=>t.row.name===n)??null,[h,n]),f=m.useMemo(()=>{const t=new Map;for(const r of p){const l=r.row.className||s("keyStatisticsExtras.other"),x=t.get(l)??[];x.push(r),t.set(l,x)}const a=r=>{const l=A.indexOf(r);return l===-1?A.length+1:l};return Array.from(t.entries()).map(([r,l])=>({groupName:r,items:l})).sort((r,l)=>{const x=a(r.groupName),L=a(l.groupName);return x!==L?x-L:r.groupName.localeCompare(l.groupName,"ko")})},[p,s]),g=m.useMemo(()=>{var a,r;return o?(((r=(a=u[o.row.name])==null?void 0:a.data)==null?void 0:r.points)??[]).map(l
1=>({date:$(l.date),value:l.value})):[]},[u,o]),y=m.useMemo(()=>Q(g),[g]),j=m.useMemo(()=>o?J(o.row.name):N[0],[o]);m.useEffect(()=>{v(t=>{const a={},r=Object.keys(t).length>0;return f.forEach((l,x)=>{if(r&&t[l.groupName]!==void 0){a[l.groupName]=t[l.groupName];return}a[l.groupName]=x<3}),a})},[f]),m.useEffect(()=>{if(!n)return;h.some(a=>a.row.name===n)||k(null)},[h,n]),m.useEffect(()=>{if(!n||!(o!=null&&o.row.chartSupported))return;const t=u[n];if(t!=null&&t.isLoading||t!=null&&t.data||t!=null&&t.error)return;(async()=>{S(l=>{var x;return{...l,[n]:{isLoading:!0,error:null,data:((x=l[n])==null?void 0:x.data)??null}}});const r=await D(n);S(l=>({...l,[n]:{isLoading:!1,error:r?null:s("keyStatistics.timeSeriesError"),data:r??null}}))})()},[u,o,n,s]);const M=t=>{v(a=>({...a,[t]:!a[t]}))},O=t=>{v(r=>({...r,[t]:!0}));const a=C.current[t];a&&a.scrollIntoView({behavior:"smooth",block:"start"})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-2xl border border-slate-200 dark:border-slate-800 bg-gradient-to-br from-slate-950 via-slate-900 to-slate-700 text-white p-5 sm:p-6",children:[e.jsx("h1",{className:"text-xl font-bold",children:s("keyStatistics.title")}),e.jsx("p",{className:"text-sm text-slate-200 mt-2",children:s("keyStatistics.subtitle")})]}),e.jsxs("section",{className:"rounded-2xl border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 p-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-slate-900 dark:text-slate-100",children:s("keyStatistics.featuredTitle")}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:s("keyStatistics.featuredSubtitle")})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[c?Array.from({length:6}).map((t,a)=>e.jsx("div",{className:"h-8 w-28 rounded-full bg-slate-200 dark:bg-slate-700 animate-pulse"},`featured-chip-skeleton-${a}`)):h.map(t=>e.jsx("button",{type:"button",onClick:()=>k(t.row.name),className:`rounded-full border px-3 py-1.5 text-xs font-medium transition-colors ${n===t.row.name?"border-sky-500 bg-sky-50 text-sky-700 dark:bg-sky-900/20 dark:text-sky-300":"border-slate-300 text-slate-600 dark:border-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-800"}`,children:t.row.name},`featured-${t.row.className}-${t.row.name}`)),!c&&h.length===0&&e.jsx("div",{className:"rounded-lg border border-slate-200 dark:border-slate-700 px-3 py-2 text-xs text-slate-500",children:s("keyStatistics.noChartSupported")})]}),c&&e.jsx("article",{className:"mt-4 rounded-xl border border-slate-200 dark:border-slate-700 p-4 bg-slate-50/60 dark:bg-slate-800/30",children:e.jsxs("div",{className:"flex items-center justify-center h-[300px] gap-3 text-slate-500",children:[e.jsx("span",{className:"inline-block h-5 w-5 rounded-full border-2 border-slate-300 border-t-sky-500 animate-spin"}),e.jsx("span",{className:"text-sm",children:s("keyStatistics.chartLoading")})]})}),!c&&!o&&e.jsx("article",{className:"mt-4 rounded-xl border border-dashed border-slate-300 dark:border-slate-700 p-4 bg-slate-50/60 dark:bg-slate-800/30",children:e.jsx("div",{className:"h-[300px] flex items-center justify-center text-sm text-slate-500",children:s("keyStatistics.selectChip")})}),o&&e.jsxs("article",{className:"mt-4 rounded-2xl border border-slate-200 dark:border-slate-700 p-4 bg-gradient-to-br from-white via-slate-50 to-cyan-50/70 dark:from-slate-900 dark:via-slate-900 dark:to-cyan-950/20 shadow-sm",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-slate-900 dark:text-slate-100",children:s("keyStatistics.featuredTrend",{name:o.row.name})}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:s("keyStatistics.latestValue",{value:o.row.value===null?"N/A":`${b(o.row.value)} ${o.row.unit}`})})]}),e.jsx("span",{className:"inline-flex rounded-full px-2 py-1 text-[11px] font-semibold bg-slate-200 text-slate-700 dark:bg-slate-700 dark:text-slate-200",children:o.label})]}),y&&e.jsxs("div",{className:"mt-3 grid grid-cols-3 gap-2",children:[e.jsxs("div",{className:"rounded-xl border border-slate-200/80 dark:border-slate-700 px-3 py-2 bg-white/70 dark:bg-slate-900/60",children:[e.jsx("p",{className:"text-[11px] text-slate-500",children:s("keyStatistics.latest")}),e.jsx("p",{className:"mt-1 text-sm font-semibold text-slate-900 dark:text-slate-100",children:b(y.latest)})]}),e.jsxs("div",{className:"rounded-xl border border-slate-200/80 dark:border-slate-700 px-3 py-2 bg-white/70 dark:bg-slate-900/60",children:[e.jsx("p",{className:"text-[11px] text-slate-500",children:s("keyStatistics.min")}),e.jsx("p",{className:"mt-1 text-sm font-semibold text-slate-900 dark:text-slate-100",children:b(y.min)})]}),e.jsxs("div",{className:"rounded-xl border border-slate-200/80 dark:border-slate-700 px-3 py-2 bg-white/70 dark:bg-slate-900/60",children:[e.jsx("p",{className:"text-[11px] text-slate-500",children:s("keyStatistics.max")}
1),e.jsx("p",{className:"mt-1 text-sm font-semibold text-slate-900 dark:text-slate-100",children:b(y.max)})]})]}),e.jsx("div",{className:"mt-4 h-[300px]",children:(R=u[o.row.name])!=null&&R.isLoading?e.jsxs("div",{className:"h-full rounded-xl border border-slate-200 dark:border-slate-700 bg-slate-100 dark:bg-slate-800/60 flex items-center justify-center gap-3",children:[e.jsx("span",{className:"inline-block h-5 w-5 rounded-full border-2 border-slate-300 border-t-sky-500 animate-spin"}),e.jsx("span",{className:"text-sm text-slate-500",children:s("keyStatistics.loading")})]}):(T=u[o.row.name])!=null&&T.error?e.jsx("div",{className:"h-full flex items-center justify-center text-sm text-rose-600 dark:text-rose-300",children:(E=u[o.row.name])==null?void 0:E.error}):g.length>0?e.jsx(G,{width:"100%",height:"100%",children:e.jsxs(I,{data:g,margin:{top:10,right:24,left:4,bottom:4},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"featuredKeyStatAreaGradientModern",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:j,stopOpacity:.18}),e.jsx("stop",{offset:"100%",stopColor:j,stopOpacity:.01})]})}),e.jsx(F,{strokeDasharray:"3 3",stroke:"#94a3b833",vertical:!1}),e.jsx(W,{dataKey:"date",tick:{fontSize:11,fill:"#64748b"},minTickGap:24,axisLine:!1,tickLine:!1}),e.jsx(Y,{tick:{fontSize:11,fill:"#64748b"},axisLine:!1,tickLine:!1,domain:["auto","auto"],tickFormatter:t=>b(t),width:64}),e.jsx(U,{content:e.jsx(Z,{unit:o.row.unit})}),e.jsx(H,{type:"monotone",dataKey:"value",fill:"url(#featuredKeyStatAreaGradientModern)",strokeOpacity:0}),e.jsx(z,{type:"monotone",dataKey:"value",stroke:j,strokeWidth:3,dot:!1,activeDot:{r:4,strokeWidth:0,fill:j}})]})}):e.jsx("div",{className:"h-full flex items-center justify-center text-sm text-slate-500",children:s("keyStatistics.noTimeSeries")})})]})]}),e.jsxs("section",{className:"rounded-2xl border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-slate-900 dark:text-slate-100",children:s("keyStatistics.widgetTitle")}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:s("keyStatistics.widgetSummary",{count:p.length})})]}),e.jsx("a",{href:"https://ecos.bok.or.kr/#/StatisticsByTheme/KoreanStat100",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center rounded-lg border border-slate-300 dark:border-slate-600 px-3 py-1.5 text-xs font-medium text-slate-700 dark:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-800",children:s("keyStatistics.ecosOriginal")})]}),f.length>0&&e.jsx("div",{className:"mt-3 sticky top-2 z-10 rounded-xl border border-slate-200 dark:border-slate-700 bg-white/90 dark:bg-slate-900/90 backdrop-blur p-2 sm:p-3",children:e.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden sm:flex-wrap sm:overflow-visible sm:pb-0",children:f.map(t=>e.jsx("button",{type:"button",onClick:()=>O(t.groupName),className:"shrink-0 rounded-full border border-slate-300 dark:border-slate-700 px-3.5 py-2 text-sm sm:text-xs text-slate-700 dark:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800",children:t.groupName},`group-chip-${t.groupName}`))})}),e.jsxs("div",{className:"mt-4 space-y-4",children:[c&&e.jsx(e.Fragment,{children:Array.from({length:3}).map((t,a)=>e.jsxs("section",{className:"rounded-xl border border-slate-200 dark:border-slate-700 p-3 bg-slate-50/50 dark:bg-slate-800/30",children:[e.jsx("div",{className:"h-5 w-28 rounded bg-slate-200 dark:bg-slate-700 animate-pulse"}),e.jsx("div",{className:"mt-3 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:Array.from({length:3}).map((r,l)=>e.jsxs("article",{className:"rounded-xl border p-3 border-slate-200 dark:border-slate-700 bg-white/80 dark:bg-slate-900/40",children:[e.jsx("div",{className:"h-3 w-16 rounded bg-slate-200 dark:bg-slate-700 animate-pulse"}),e.jsx("div",{className:"mt-2 h-4 w-2/3 rounded bg-slate-200 dark:bg-slate-700 animate-pulse"}
1),e.jsx("div",{className:"mt-2 h-5 w-1/2 rounded bg-slate-200 dark:bg-slate-700 animate-pulse"}),e.jsx("div",{className:"mt-2 h-3 w-1/3 rounded bg-slate-200 dark:bg-slate-700 animate-pulse"})]},`card-skeleton-${a}-${l}`))})]},`group-skeleton-${a}`))}),f.map(t=>e.jsxs("section",{ref:a=>{C.current[t.groupName]=a},className:"rounded-xl border border-slate-200 dark:border-slate-700 p-3 bg-slate-50/50 dark:bg-slate-800/30",children:[e.jsxs("button",{type:"button",onClick:()=>M(t.groupName),"aria-expanded":w[t.groupName]??!1,className:"w-full flex items-center justify-between px-1 py-1 text-left",children:[e.jsx("h3",{className:"text-sm font-semibold text-slate-800 dark:text-slate-100",children:t.groupName}),e.jsx("span",{className:"text-xs text-slate-500",children:s("keyStatistics.groupCount",{count:t.items.length,state:w[t.groupName]??!1?"▲":"▼"})})]}),(w[t.groupName]??!1)&&e.jsx("div",{className:"mt-3 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:t.items.map(a=>{const r=a.row;return e.jsxs("article",{className:"text-left rounded-xl border p-3 border-slate-200 dark:border-slate-700 bg-white/80 dark:bg-slate-900/40",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("span",{className:"inline-flex rounded-full px-2 py-1 text-[11px] font-semibold bg-slate-200 text-slate-700 dark:bg-slate-700 dark:text-slate-200",children:a.label}),e.jsx("span",{className:`inline-flex rounded-full px-2 py-1 text-[11px] font-medium ${r.stale?"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300":"bg-emerald-100 text-emerald-600 dark:bg-emerald-900/30 dark:text-emerald-400"}`,children:r.stale?s("indicatorsPage.delayed"):s("indicatorsPage.normal")})]}),e.jsx("p",{className:"mt-2 text-sm font-semibold text-slate-900 dark:text-slate-100",children:r.name}),e.jsxs("p",{className:"mt-1 text-base font-bold text-slate-800 dark:text-slate-200",children:[r.value===null?"N/A":b(r.value),r.unit?e.jsx("span",{className:"ml-1 text-xs font-medium text-slate-500",children:r.unit}):null]}),e.jsx("p",{className:"mt-1 text-xs text-slate-500",children:$(r.cycle)})]},`widget-${r.className}-${r.name}`)})})]},`group-${t.groupName}`)),!c&&p.length===0&&e.jsx("div",{className:"rounded-xl border border-slate-200 dark:border-slate-700 p-4 text-sm text-slate-500",children:s("keyStatistics.missingData")})]})]})]})};export{oe 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.