PageSourceSearch

https://www.dividendpro.ai/_next/static/chunks/2465-4d6299ee460f0650.js

js dividendpro.ai collected 2026-10-05 12:04:14 UTC 17,418 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2465],{80037:function(e,t,l){l.d(t,{Z:function(){return r}});let r=(0,l(57977).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},40834:function(e,t,l){l.d(t,{Z:function(){return r}});let r=(0,l(57977).Z)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},24670:function(e,t,l){var r=l(3827),s=l(64090),n=l(52235),i=l(70094),a=l(80037),c=l(66651),o=l(63854),d=l(35767),u=l(7633),x=l(47907),m=l(10963);t.Z=e=>{let{isOpen:t,onClose:l,onSelectPortfolio:h,onCreateNewPortfolio:b,selectedStock:f}=e,{user:p}=(0,d.useAuth)(),g=(0,u.T_)("stockScreener.addToPortfolio"),v=(0,u.T_)(),j=e=>v("portfolio.".concat(e)),[N,y]=(0,s.useState)([]),[w,z]=(0,s.useState)(null),[k,P]=(0,s.useState)(!1),[S,C]=(0,s.useState)(null),A=(0,x.useRouter)();(0,s.useEffect)(()=>{(async()=>{if(t&&p)try{P(!0),C(null);let e=await (0,o.PY)();y(e)}catch(e){console.error("포트폴리오 목록 조회 실패:",e),C(g("portfolioLoadError"))}finally{P(!1)}})()},[t,p]);let F=()=>{z(null),C(null),l()},Z=e=>{z(e)},L=async()=>{if(!p){m.default.error(g("loginRequired"));return}try{let{canCreate:e,reason:t,isPremium:l}=await (0,o.KU)(p.id);if(!e){m.default.error((0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)("span",{children:j("limitations.freeUserLimit")}),(0,r.jsx)("button",{onClick:()=>A.push("/pricing"),className:"text-blue-400 hover:text-blue-300 underline text-sm",children:j("limitations.upgradePrompt")})]}),{duration:5e3,style:{background:"#1f2937",color:"#fff",border:"1px solid #374151"}});return}b()}catch(e){console.error("포트폴리오 생성 권한 확인 실패:",e),m.default.error("권한 확인 중 오류가 발생했습니다.")}};return t?(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:F}),(0,r.jsxs)("div",{className:"relative bg-zinc-900 rounded-2xl border border-zinc-800 shadow-2xl w-96 max-w-[90vw] max-h-[80vh] overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex justify-between items-start p-5 border-b border-zinc-800",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold text-white mb-1",children:g("title")}),(0,r.jsx)("p",{className:"text-sm text-zinc-400",children:f?g("selectPortfolio",{symbol:f.symbol}):"선택한 종목을 담을 포트폴리오를 선택해주세요."})]}),(0,r.jsx)("button",{onClick:F,className:"ml-4 p-1 hover:bg-zinc-800 rounded-lg transition-colors",children:(0,r.jsx)(n.Z,{className:"w-5 h-5 text-zinc-400"})})]}),(0,r.jsx)("div",{className:"p-5",children:k?(0,r.jsx)("div",{className:"flex justify-center py-8",children:(0,r.jsx)("div",{className:"w-6 h-6 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"})}):S?(0,r.jsx)("div",{className:"text-center py-8",children:(0,r.jsx)("p",{className:"text-red-400 text-sm",children:S})}):0===N.length?(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"text-center py-8",children:(0,r.jsx)("p",{className:"text-zinc-400 text-sm mb-6",children:g("noPortfolios")})}),(0,r.jsxs)("button",{onClick:L,className:"w-full py-4 px-4 rounded-xl bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 transition-all duration-200 flex items-center justify-center gap-3 shadow-lg hover:shadow-xl",children:[(0,r.jsx)("div",{className:"w-5 h-5 rounded-full bg-white/20 flex items-center justify-center",children:(0,r.jsx)(i.Z,{className:"w-3 h-3 text-white"})}),(0,r.jsx)("span",{className:"text-white font-semibold",children:g("createNewPortfolio")})]})]}):(0,r.jsxs)("div",{className:"space-y-3",children:[N.map(e=>(0,r.jsx)("div",{className:"py-2",children:(0,r.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer group",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:"checkbox",checked:w===e.id,onChange:()=>Z(e.id),className:"sr-only"}),(0,r.jsx)("div",{className:"w-5 h-5 rounded border-2 flex items-center justify-center transition-all ".concat(w===e.id?"border-blue-600 bg-blue-600":"border-zinc-600 group-hover:border-zinc-500"),children:w===e.id&&(0,r.jsx)(a.Z,{className:"w-3 h-3 text-white"})})]}),(0,r.jsx)("div",{className:"flex-1 min-w-0",children:(0,r.jsx)("div",{className:"text-white font-medium group-hover:text-blue-400 transition-colors",children:e.name})})]})},e.id)),(0,r.jsx)("div",{className:"pt-4 border-t border-zinc-800",children:(0,r.jsxs)("button",{onClick:L,className:"w-full py-3 px-4 roun
1ded-xl bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 transition-all duration-200 flex items-center justify-center gap-3 shadow-lg hover:shadow-xl",children:[(0,r.jsx)("div",{className:"w-5 h-5 rounded-full bg-white/20 flex items-center justify-center",children:(0,r.jsx)(i.Z,{className:"w-3 h-3 text-white"})}),(0,r.jsx)("span",{className:"text-white font-semibold",children:g("createNewPortfolio")})]})})]})}),N.length>0&&(0,r.jsxs)("div",{className:"flex justify-end gap-2 p-5 border-t border-zinc-800",children:[(0,r.jsx)(c.z,{variant:"outline",onClick:F,className:"px-7 py-3 border-zinc-700 text-zinc-300 hover:bg-zinc-800",children:g("cancel")}),(0,r.jsx)(c.z,{onClick:()=>{if(!w)return;let e=N.find(e=>e.id===w);e&&h(e)},disabled:!w,className:"px-7 py-3 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",children:g("confirm")})]})]})]}):null}},19785:function(e,t,l){var r=l(3827),s=l(64090),n=l(66651),i=l(48219),a=l(52235),c=l(40834),o=l(27504),d=l(7633);t.Z=e=>{let{isOpen:t,onClose:l,stock:u,editMode:x=!1,initialData:m,onAdd:h}=e,b=(0,d.T_)("portfolio"),f=e=>b("addStock.".concat(e)),[p,g]=(0,s.useState)(""),[v,j]=(0,s.useState)(""),[N,y]=(0,s.useState)(0),[w,z]=(0,s.useState)(0),[k,P]=(0,s.useState)(!1),[S,C]=(0,s.useState)(null);(0,s.useEffect)(()=>{t&&u&&(x&&m?(g(m.shares.toString()),j(m.averagePrice.toString())):(g(""),j("")),y(u.price||0),z(u.dividendYield||0),C(null))},[t,u,x,m]);let A=async()=>{if(u){P(!0),C(null);try{console.log("".concat(u.symbol," 가격 및 배당 정보 조회 시작..."));let e=await (0,o.getCurrentPrice)(u.symbol);null===e.price||(y(e.price),console.log("".concat(u.symbol," 현재가: $").concat(e.price)),v||j(e.price.toFixed(2))),console.log("".concat(u.symbol," 배당 정보 조회 중..."));try{let e=await (0,o.jA)(u.symbol,u.name);e&&e>0?(console.log("".concat(u.symbol," 배당 수익률 발견: ").concat(e,"%")),z(e)):(console.log("".concat(u.symbol," 배당 정보 없음")),z(0))}catch(e){console.error("".concat(u.symbol," 배당 정보 검색 실패:"),e),z(u.dividendYield||0)}}catch(e){console.error("가격/배당 정보 불러오기 오류:",e),C(f("errors.priceLoadError"))}finally{P(!1)}}},F=()=>{g(""),j(""),y(0),C(null),l()};return t&&u?(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",onClick:F,children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black bg-opacity-50"}),(0,r.jsxs)("div",{className:"relative bg-zinc-900 rounded-xl shadow-2xl border border-zinc-800 w-full max-w-md mx-4",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-zinc-800",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-lg bg-blue-500/10 flex items-center justify-center",children:(0,r.jsx)(i.Z,{className:"w-5 h-5 text-blue-400"})}),(0,r.jsx)("h2",{className:"text-xl font-semibold text-white",children:x?"주식 수정":f("title")})]}),(0,r.jsx)("button",{onClick:F,disabled:k,className:"text-zinc-400 hover:text-zinc-100 transition-colors disabled:opacity-50",children:(0,r.jsx)(a.Z,{className:"w-5 h-5"})})]}),(0,r.jsxs)("div",{className:"p-6 space-y-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-zinc-300 mb-2",children:f("assetLabel")}),(0,r.jsxs)("div",{className:"w-full px-4 py-3 bg-zinc-800 border border-zinc-700 rounded-lg",children:[(0,r.jsxs)("div",{className:"text-white font-medium",children:[u.symbol," | ",u.name]}),(0,r.jsxs)("div",{className:"text-sm text-zinc-400 mt-1 flex items-center justify-between",children:[(0,r.jsx)("span",{children:u.exchangeFullName}),w>0&&(0,r.jsxs)("span",{className:"text-green-400",children:["배당 수익률: ",w.toFixed(2),"%"]}),0===w&&(0,r.jsx)("span",{className:"text-zinc-500",children:f("noDividendInfo")})]})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"shares",className:"block text-sm font-medium text-zinc-300 mb-2",children:f("quantityLabel")}),(0,r.jsx)("input",{id:"shares",type:"number",value:p,onChange:e=>g(e.target.value),placeholder:f("quantityPlaceholder"),className:"w-full px-4 py-3 bg-zinc-800 border border-zinc-700 rounded-lg text-white placeholder-zinc-400 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 transition-colors",min:"0",step:"0.01",disabled:k})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsx)("label",{htmlFor:"averagePrice",className:"text-sm font-medium text-zinc-300",children:f("averagePrice
1Label")}),(0,r.jsx)("span",{className:"text-xs text-zinc-500",children:f("currentPriceNote")})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-zinc-400",children:"$"}),(0,r.jsx)("input",{id:"averagePrice",type:"number",value:v,onChange:e=>j(e.target.value),placeholder:f("averagePricePlaceholder"),className:"w-full pl-8 pr-4 py-3 bg-zinc-800 border border-zinc-700 rounded-lg text-white placeholder-zinc-400 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 transition-colors",min:"0",step:"0.01",disabled:k})]}),N>0&&(0,r.jsxs)("div",{className:"mt-2 text-sm text-zinc-400",children:["현재가: $",N.toFixed(2)]})]}),(0,r.jsx)(n.z,{onClick:A,disabled:k,variant:"outline",className:"w-full border-zinc-700 text-zinc-300 hover:bg-zinc-800 hover:text-white",children:k?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"w-4 h-4 border-2 border-zinc-400/20 border-t-zinc-400 rounded-full animate-spin"}),f("loadingPriceButton")]}):(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(c.Z,{className:"w-4 h-4"}),f("loadPriceButton")]})}),S&&(0,r.jsx)("div",{className:"p-3 bg-red-900/20 border border-red-500/20 rounded-lg",children:(0,r.jsx)("p",{className:"text-sm text-red-400",children:S})}),(0,r.jsxs)("div",{className:"flex gap-3 pt-4",children:[(0,r.jsx)(n.z,{type:"button",variant:"outline",onClick:F,disabled:k,className:"flex-1 border-zinc-700 text-zinc-300 hover:bg-zinc-800 hover:text-white",children:f("cancel")}),(0,r.jsx)(n.z,{type:"button",onClick:()=>{if(!u)return;let e=parseFloat(p),t=parseFloat(v);if(!p||!v){C(f("validationErrors.quantityAndPriceRequired"));return}if(isNaN(e)||e<=0){C(f("validationErrors.validQuantityRequired"));return}if(isNaN(t)||t<=0){C(f("validationErrors.validPriceRequired"));return}console.log("종목 추가: ".concat(u.symbol,", 배당수익률: ").concat(w,"%")),h({symbol:u.symbol,name:u.name,shares:e,averagePrice:t,currentPrice:N,dividendYield:w,sector:u.exchange||void 0})},disabled:!p||!v||k,className:"flex-1 bg-blue-600 hover:bg-blue-700 text-white disabled:opacity-50 disabled:cursor-not-allowed",children:x?"수정 완료":f("addAssetButton")})]})]})]})]}):null}},18287:function(e,t,l){l.d(t,{Z:function(){return c}});var r=l(3827),s=l(64090),n=l(66651),i=l(52235),a=l(7633);function c(e){let{isOpen:t,onClose:l,onSubmit:c,isLoading:o=!1}=e,[d,u]=(0,s.useState)(""),[x,m]=(0,s.useState)(""),[h,b]=(0,s.useState)({}),f=(0,a.T_)("portfolio.createPortfolio"),p=()=>{let e={};return d.trim()?d.trim().length<2?e.name=f("portfolioNameMinLength"):d.trim().length>50&&(e.name=f("portfolioNameMaxLength")):e.name=f("portfolioNameRequired"),b(e),0===Object.keys(e).length},g=async e=>{if(e.preventDefault(),p())try{await c(d.trim(),x.trim()||void 0),u(""),m(""),b({}),l()}catch(e){console.error("Portfolio creation error:",e)}},v=()=>{u(""),m(""),b({}),l()};return t?(0,r.jsx)("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:(0,r.jsxs)("div",{className:"bg-zinc-900 rounded-xl border border-zinc-800 shadow-2xl w-full max-w-md",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-zinc-800",children:[(0,r.jsx)("h2",{className:"text-xl font-bold text-white",children:f("title")}),(0,r.jsx)(n.z,{variant:"ghost",size:"sm",onClick:v,className:"text-zinc-400 hover:text-white",children:(0,r.jsx)(i.Z,{className:"w-4 h-4"})})]}),(0,r.jsxs)("form",{onSubmit:g,className:"p-6 space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-zinc-300 mb-2",children:f("portfolioNameLabel")}),(0,r.jsx)("input",{type:"text",value:d,onChange:e=>u(e.target.value),placeholder:f("portfolioNamePlaceholder"),className:"w-full px-3 py-2 bg-zinc-800 border border-zinc-700 rounded-lg text-white placeholder-zinc-400 focus:outline-none focus:border-blue-500",disabled:o}),h.name&&(0,r.jsx)("p",{className:"text-red-400 text-sm mt-1",children:h.name}),d.length>0&&d.length<2&&(0,r.jsx)("p",{className:"text-zinc-500 text-xs mt-1",children:f("portfolioNameMinLengthNote")})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-zinc-300 mb-2",children:f("descriptionLabel")}),(0,r.jsx)("textarea",{value:x,onChange:e=>m(e.target.value),placeholder:f("descriptionPlaceholder"),rows:3,className:"w-full px-3 py-2 bg-zinc-800 border border-zinc-700 rounded-lg text-white placeholder-zinc-400 focus:outline-none focus:border-blue-500 resize-none",disabled:o})]}),(0,r.jsxs)("div",{className:"flex gap-3 pt-4",children:[(0,r.jsx)(n.z,{type:"button",variant:"outline",onClick:v,disabled:o,className:"flex-1",children:f("cancel")}),(0,r.jsx)(n.z,{type:"submit",disabled:o||!d.trim(),className:"flex-1 bg-blue-600 hover:bg-blue-700",children:o?f("creatingButton"):f("title")})]})]})]})}):null}},91633:function(e,t,l){l.d(t,{U:function(){return n},r:function(){return s}});let r={},s=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{if(!e.includes("/api/fmp/cache")){let l=r[e],s=Date.now();if(!t&&l&&s-l.timestamp<144e5)return console.log("[API] 클라이언트 캐시에서 데이터 가져옴: ".concat(e)),l.data}
1console.log("[API] 서버에서 데이터 가져오는 중: ".concat(e));let l=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}});if(!l.ok){if(console.error("[API] 요청 실패: ".concat(e),l.status,l.statusText),404===l.status)return[];throw Error("API 요청 실패: ".concat(l.status," ").concat(l.statusText))}let s=await l.json();if(s.error)throw console.error("[API] 서버 에러: ".concat(e),s.error),Error(s.error);let n=void 0!==s.data?s.data:s;return void 0!==s.cached&&console.log("[API] ".concat(s.cached?"서버 캐시 히트":"새로운 데이터",": ").concat(e.split("?")[0])),e.includes("stock-screener")&&Array.isArray(n)&&n.length>0&&(console.log("[API] 스크리너 응답 데이터 샘플 (상위 5개):"),n.slice(0,5).forEach((e,t)=>{console.log("  ".concat(t+1,". ").concat(e.symbol,": 연간배당금=").concat(e.lastDiv||"N/A",", 시가총액=").concat(e.marketCap?(e.marketCap/1e6).toFixed(2)+"M":"N/A",", 가격=").concat(e.price||"N/A"))}),n[0]&&console.log("[API] 스크리너 응답 구조 확인:",Object.keys(n[0]).join(", "))),console.log("[API] 응답 받음: ".concat(e.split("?")[0]),Array.isArray(n)&&n.length?"(총 ".concat(n.length,"개 항목)"):""),e.includes("/api/fmp/cache")||(r[e]={data:n,timestamp:Date.now()}),n}catch(t){throw console.error("[API] fetchData 에러: ".concat(e),t),t}},n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=Object.keys(t).length>0?"&params=".concat(encodeURIComponent(JSON.stringify(t))):"";return"/api/fmp/cache?endpoint=".concat(e).concat(l)}},44129:function(e,t,l){l.d(t,{Jt:function(){return n},p6:function(){return i},u4:function(){return r},uf:function(){return s}});let r=e=>e>=1e12?"".concat((e/1e12).toFixed(1),"T"):e>=1e9?"".concat((e/1e9).toFixed(1),"B"):e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString(),s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e)return"-";let r=e.toLocaleString(void 0,{minimumFractionDigits:t,maximumFractionDigits:t});return l?"$".concat(r):r},n=e=>{if(!e)return{date:"-",year:"-"};try{let t=new Date(e),l=t.getFullYear().toString(),r=(t.getMonth()+1).toString(),s=t.getDate().toString().padStart(2,"0");return{date:"".concat(r,"월 ").concat(s,"일"),year:l}}catch(e){return{date:"-",year:"-"}}},i=e=>{if(!e)return"-";try{let t=new Date(e),l=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),s=t.getDate().toString().padStart(2,"0");return"".concat(l,".").concat(r,".").concat(s)}catch(t){return e}}}}]);

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.