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?"¶ms=".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.