1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{92457:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/** 2 * @license lucide-react v0.294.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */let a=(0,s(62898).Z)("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]])},84247:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/** 7 * @license lucide-react v0.294.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */let a=(0,s(62898).Z)("Battery",[["rect",{width:"16",height:"10",x:"2",y:"7",rx:"2",ry:"2",key:"1w10f2"}],["line",{x1:"22",x2:"22",y1:"11",y2:"13",key:"4dh1rd"}]])},83523:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/** 12 * @license lucide-react v0.294.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */let a=(0,s(62898).Z)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},17158:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/** 17 * @license lucide-react v0.294.0 - ISC 18 * 19 * This source code is licensed under the ISC license. 20 * See the LICENSE file in the root directory of this source tree. 21 */let a=(0,s(62898).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},6141:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/** 22 * @license lucide-react v0.294.0 - ISC 23 * 24 * This source code is licensed under the ISC license. 25 * See the LICENSE file in the root directory of this source tree. 26 */let a=(0,s(62898).Z)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},97332:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/** 27 * @license lucide-react v0.294.0 - ISC 28 * 29 * This source code is licensed under the ISC license. 30 * See the LICENSE file in the root directory of this source tree. 31 */let a=(0,s(62898).Z)("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},49036:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/** 32 * @license lucide-react v0.294.0 - ISC 33 * 34 * This source code is licensed under the ISC license. 35 * See the LICENSE file in the root directory of this source tree. 36 */let a=(0,s(62898).Z)("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]])},94878:function(e,t,s){Promise.resolve().then(s.bind(s,9505))},9505:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return q}});var a=s(57437),l=s(92457),r=s(52369),n=s(85790),i=s(90998),o=s(84247),d=s(6141),c=s(17158),m=s(74056),x=s(49036);/** 37 * @license lucide-react v0.294.0 - ISC 38 * 39 * This source code is licensed under the ISC license. 40 * See the LICENSE file in the root directory of this source tree. 41 */let p=(0,s(62898).Z)("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);var u=s(53711),h=s(61396),f=s.n(h);let g={LIVE_API:{bg:"bg-emerald-500/15",text:"text-emerald-300",ring:"ring-emerald-500/30",help:"Number is fetched live from the API right now."},HISTORICAL:{bg:"bg-blue-500/15",text:"text-blue-300",ring:"ring-blue-500/30",help:"Computed from historical Romanian market data."},SIMULATED:{bg:"bg-purple-500/15",text:"text-purple-300",ring:"ring-purple-500/30",help:"Output of a simulation model â not real settlement."},FALLBACK:{bg:"bg-amber-500/15",text:"text-amber-300",ring:"ring-amber-500/30",help:"Backend simulation failed; shown value is a fallback estimate."},NOT_VERIFIED:{bg:"bg-slate-500/15",text:"text-slate-300",ring:"ring-slate-500/30",help:"Needs counsel/operator confirmation before use."},ILLUSTRATIVE:{bg:"bg-blue-500/15",text:"text-blue-300",ring:"ring-blue-500/30",help:"Hardcoded example value, not from the API."},DEMO:{bg:"bg-slate-500/15",text:"text-slate-300",ring:"ring-slate-500/30",help:"Demo mode â not connected to live trading."}};var b=function(e){let{kind:t,label:s,className:l=""}=e,r=g[t];return(0,a.jsx)("span",{title:r.help,className:"inline-flex items-center rounded px-2 py-0.5 text-[10px] font-mono font-medium uppercase tracking-wide ring-1 ".concat(r.bg," ").concat(r.text," ").concat(r.ring," ").concat(l),children:null!=s?s:t})},j=s(2265),y=s(10826);async function v(e){try{let t=await fetch("".concat(y.CT,"/api/health"),{signal:e});if(!t.ok)return"down";let s=await t.json();return(null==s?void 0:s.status)==="healthy"?"connected":"down"}catch(e){return"down"}}var N=function(e){let{className:t=""}
41=e,[s,l]=(0,j.useState)("connecting");(0,j.useEffect)(()=>{let e=new AbortController,t=!1,s=async()=>{let s=await v(e.signal);t||l(s)};s();let a=setInterval(s,6e4);return()=>{t=!0,e.abort(),clearInterval(a)}},[]);let r={connected:{dot:"bg-emerald-500",text:"text-emerald-300",label:"API CONNECTED"},connecting:{dot:"bg-slate-500 animate-pulse",text:"text-slate-300",label:"API CHECKING"},down:{dot:"bg-red-500",text:"text-red-300",label:"API DOWN"}}[s];return(0,a.jsxs)("span",{title:"Backend health probe: ".concat(s),className:"inline-flex items-center gap-1.5 rounded bg-slate-800/50 px-2 py-1 ring-1 ring-slate-700 ".concat(t),children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full ".concat(r.dot)}),(0,a.jsx)("span",{className:"text-[10px] font-mono uppercase ".concat(r.text),children:r.label})]})},w=s(97332);let k={opcom_pzu:"OPCOM PZU",damas_clean:"DAMAS aFRR"};var S=function(e){var t;let{className:s=""}=e,[l,r]=(0,j.useState)({kind:"loading"});if((0,j.useEffect)(()=>{let e=!1;return y.Bl.getManifest().then(t=>{e||r({kind:"ready",manifest:t.data})}).catch(t=>{var s;e||r({kind:"error",message:null!==(s=null==t?void 0:t.message)&&void 0!==s?s:"unknown error"})}),()=>{e=!0}},[]),"loading"===l.kind)return(0,a.jsxs)("div",{className:"rounded-lg border border-slate-700 bg-slate-900/50 p-3 sm:p-4 ".concat(s),"aria-busy":"true",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)(w.Z,{className:"w-4 h-4 text-slate-400"}),(0,a.jsx)("span",{className:"text-[10px] sm:text-xs uppercase tracking-wider text-slate-400",children:"Market Data"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"h-3 w-3/4 rounded bg-slate-800 animate-pulse"}),(0,a.jsx)("div",{className:"h-3 w-2/3 rounded bg-slate-800 animate-pulse"})]})]});if("error"===l.kind)return(0,a.jsxs)("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-3 sm:p-4 ".concat(s),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)(w.Z,{className:"w-4 h-4 text-amber-400"}),(0,a.jsx)("span",{className:"text-[10px] sm:text-xs uppercase tracking-wider text-amber-400",children:"Market Data Unavailable"})]}),(0,a.jsx)("p",{className:"text-[11px] text-slate-400",children:"Could not reach data manifest. Backend may be sleeping or offline."})]});let n=null!==(t=l.manifest.datasets)&&void 0!==t?t:[],i=new Date().toISOString().slice(0,10);return(0,a.jsxs)("div",{className:"rounded-lg border border-slate-700 bg-slate-900/50 p-3 sm:p-4 ".concat(s),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2 sm:mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(w.Z,{className:"w-4 h-4 text-[#00ffd1]"}),(0,a.jsx)("span",{className:"text-[10px] sm:text-xs uppercase tracking-wider text-slate-400",children:"Market Data Backing"})]}),(0,a.jsx)("span",{className:"text-[10px] font-mono text-slate-400 hidden sm:inline",children:"/api/v1/data/manifest"})]}),0===n.length?(0,a.jsx)("p",{className:"text-[11px] text-slate-400",children:"No datasets registered."}):(0,a.jsx)("ul",{className:"space-y-2",children:n.map(e=>{var t,s;let l=null!==(t=e.dataset_id)&&void 0!==t?t:"dataset",r=e.max_delivery_date,n=e.min_delivery_date,o=r?Math.round(Math.abs(new Date(i).getTime()-new Date(r).getTime())/864e5):null;return(0,a.jsxs)("li",{className:"flex flex-col gap-0.5 sm:flex-row sm:items-center sm:justify-between text-[11px] sm:text-xs",children:[(0,a.jsx)("span",{className:"text-slate-200 font-medium",children:null!==(s=k[l])&&void 0!==s?s:l}),(0,a.jsxs)("span",{className:"font-mono text-slate-400 flex items-center gap-1.5",children:[(0,a.jsx)(d.Z,{className:"w-3 h-3 opacity-60"}),null!=n?n:"â"," â ",null!=r?r:"â",null!==o&&(0,a.jsx)("span",{className:"ml-1 rounded px-1 py-0.5 text-[10px] ".concat(null!==o&&o>60?"bg-amber-500/15 text-amber-300":"bg-emerald-500/15 text-emerald-300"),children:0===o?"today":"".concat(o,"d ago")})]})]},l)})})]})},_=s(83523);let M=e=>(0,a.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full ".concat(e?"bg-emerald-500":"bg-red-500")}),R=e=>
41null==e?"â":"number"==typeof e?e.toLocaleString():e;var C=function(){var e,t,s,l,r,n;let[i,o]=(0,j.useState)(!1),[d,m]=(0,j.useState)(null),[x,p]=(0,j.useState)(null);(0,j.useEffect)(()=>{if(!i||d||x)return;let e=!1;return y.wK.getDetailed().then(t=>{e||m(t.data)}).catch(t=>{var s;e||p(null!==(s=null==t?void 0:t.message)&&void 0!==s?s:"failed to load diagnostics")}),()=>{e=!0}},[i,d,x]);let u=d?[{name:"PZU dataset",ok:d.pzu.available&&(null!==(e=d.pzu.days_stale)&&void 0!==e?e:99)<=7,detail:"".concat(R(d.pzu.row_count)," rows ⢠").concat(R(d.pzu.min_date)," â ").concat(R(d.pzu.max_date)," ⢠stale ").concat(R(d.pzu.days_stale),"d")},{name:"DAMAS dataset",ok:d.damas.available&&(null!==(t=d.damas.days_stale)&&void 0!==t?t:99)<=7,detail:"".concat(R(d.damas.row_count)," rows ⢠pre ").concat(R(d.damas.regime_pre_count)," / post ").concat(R(d.damas.regime_post_count)," ⢠FCR ").concat(R(d.damas.fcr_activated_total_mwh)," MWh")},{name:"PZU simulator",ok:d.simulator_pzu_smoke.ok,detail:d.simulator_pzu_smoke.ok?"60-day smoke profit â¬".concat(R(Math.round(null!==(s=d.simulator_pzu_smoke.total_profit_eur)&&void 0!==s?s:0))):null!==(l=d.simulator_pzu_smoke.error)&&void 0!==l?l:"failed"},{name:"FR simulator",ok:d.simulator_fr_smoke.ok,detail:d.simulator_fr_smoke.ok?"60-day smoke profit â¬".concat(R(Math.round(null!==(r=d.simulator_fr_smoke.total_profit_eur)&&void 0!==r?r:0))):null!==(n=d.simulator_fr_smoke.error)&&void 0!==n?n:"failed"},{name:"Manifest",ok:d.manifest_present,detail:d.manifest_present?"present":"missing â run pipeline"}]:[];return(0,a.jsxs)("div",{className:"rounded border border-slate-800/50 bg-slate-900/30",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>o(e=>!e),className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs font-mono uppercase tracking-wider text-slate-400 hover:text-slate-200",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-2",children:[i?(0,a.jsx)(_.Z,{className:"h-3 w-3"}):(0,a.jsx)(c.Z,{className:"h-3 w-3"}),"System diagnostics"]}),d&&(0,a.jsxs)("span",{className:"text-[10px] text-slate-400",children:["v",d.app_version," ⢠as of ",d.as_of]})]}),i&&(0,a.jsxs)("div",{className:"border-t border-slate-800/50 px-3 py-2",children:[!d&&!x&&(0,a.jsx)("div",{className:"text-xs text-slate-400",children:"Loadingâ¦"}),x&&(0,a.jsxs)("div",{className:"text-xs text-red-400",children:["Error: ",x]}),d&&(0,a.jsx)("table",{className:"w-full text-left text-xs",children:(0,a.jsx)("tbody",{children:u.map(e=>(0,a.jsxs)("tr",{className:"border-b border-slate-800/30 last:border-b-0",children:[(0,a.jsx)("td",{className:"py-1.5 pr-2 align-top",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-2 text-slate-300",children:[M(e.ok),e.name]})}),(0,a.jsx)("td",{className:"py-1.5 text-right font-mono text-slate-400",children:e.detail})]},e.name))})})]})]})},Z=s(45253),P=s(74542),A=s(16573),z=s(24235),I=s(50039),D=s(86812),E=s(79857),L=s(51125),F=s(19223);let T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var B=function(e){let{className:t=""}
41=e,[s,l]=(0,j.useState)({kind:"loading",phase:"initial"});(0,j.useEffect)(()=>{let e=!1,t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date,s=[],a=t.getFullYear(),l=t.getMonth();for(let e=11;e>=0;e--){let t=new Date(a,l-e,1),r=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0");s.push("".concat(r,"-").concat(n))}return s}(12,new Date),s=async function(){var a,r,n,i,o,d;let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;c>0&&l({kind:"loading",phase:"cold-start-retry"});let[m,x]=await Promise.allSettled([y.L9.getMonthlySummary({power_mw:10,capacity_mwh:20,efficiency:.97}),y.gD.getMonthlyBreakdown({product:"aFRR+"})]);if(e)return;let p="fulfilled"===m.status&&null!==(n=null===(a=m.value.data)||void 0===a?void 0:a.monthly_results)&&void 0!==n?n:[],u="fulfilled"===x.status&&null!==(i=null===(r=x.value.data)||void 0===r?void 0:r.monthly_results)&&void 0!==i?i:[];if(0===p.length&&0===u.length){if(c<1)return await new Promise(e=>setTimeout(e,2e3)),s(c+1);let e="rejected"===m.status?null===(o=m.reason)||void 0===o?void 0:o.message:"empty",t="rejected"===x.status?null===(d=x.reason)||void 0===d?void 0:d.message:"empty";return void l({kind:"error",message:"PZU: ".concat(e," \xb7 FR: ").concat(t)})}let h={};for(let e of p)h[e.month]=e;let f={};for(let e of u)f[e.month]=e;let g=t.map(e=>{var t;let s=h[e],a=f[e],l=Number(e.slice(5,7))-1;return{month:e,monthShort:null!==(t=T[l])&&void 0!==t?t:e,pzu:s?Number(s.net_profit_eur)/1e3:0,afrr:a?Number(a.total_revenue_eur)/1e3:0,price:s?Number(s.avg_sell_price_eur_mwh):0}}),b=g.reduce((e,t)=>({pzu:e.pzu+t.pzu,afrr:e.afrr+t.afrr,combined:e.combined+t.pzu+t.afrr,priceSum:e.priceSum+(t.price>0?t.price:0),priceCount:e.priceCount+(t.price>0?1:0)}),{pzu:0,afrr:0,combined:0,priceSum:0,priceCount:0});l({kind:"ready",rows:g,totals:{pzu:b.pzu,afrr:b.afrr,combined:b.combined,avgPrice:b.priceCount>0?b.priceSum/b.priceCount:0},partial:0===p.length||0===u.length})};return s().catch(t=>{var s;e||l({kind:"error",message:null!==(s=null==t?void 0:t.message)&&void 0!==s?s:"unknown error"})}),()=>{e=!0}},[]);let r=e=>e>=1e3?"â¬".concat((e/1e3).toFixed(2),"M"):"â¬".concat(e.toFixed(0),"K");return(0,a.jsxs)("div",{className:"bg-gradient-to-br from-slate-900 to-slate-900/50 border border-slate-700 rounded-lg sm:rounded-xl overflow-hidden ".concat(t),children:[(0,a.jsxs)("div",{className:"px-3 sm:px-5 py-3 sm:py-4 border-b border-slate-700 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3",children:[(0,a.jsx)("div",{className:"p-1.5 sm:p-2 rounded-lg",style:{background:"linear-gradient(135deg, #00ffd1 0%, #00d4aa 100%)"},children:(0,a.jsx)(n.Z,{className:"w-4 h-4 sm:w-5 sm:h-5 text-slate-900"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm sm:text-lg font-semibold text-white",children:"Last 12 months â Real Market Backtest"}),(0,a.jsx)("p",{className:"text-[10px] sm:text-xs text-slate-400",children:"10 MW / 20 MWh BESS \xb7 OPCOM PZU + DAMAS aFRR \xb7 live API"})]})]}),(0,a.jsx)(b,{kind:"HISTORICAL",label:"LIVE BACKTEST"})]}),(0,a.jsxs)("div",{className:"p-3 sm:p-5",children:[(0,a.jsxs)("div",{className:"h-56 sm:h-80",children:["loading"===s.kind&&(0,a.jsxs)("div",{className:"h-full flex flex-col gap-3 justify-center px-4","aria-busy":"true",children:[(0,a.jsx)("div",{className:"h-3 bg-slate-800 rounded animate-pulse w-2/3"}),(0,a.jsx)("div",{className:"h-3 bg-slate-800 rounded animate-pulse w-1/2"}),(0,a.jsx)("div",{className:"h-32 bg-slate-800/50 rounded animate-pulse"}),(0,a.jsx)("p",{className:"text-xs text-slate-400 text-center",children:"cold-start-retry"===s.phase?"Backend was sleeping â retrying⦠(Render free tier wakes in ~30s)":"Loading 12-month backtestâ¦"})]}),"error"===s.kind&&(0,a.jsxs)("div",{className:"h-full flex flex-col items-center justify-center gap-2 px-4",children:[(0,a.jsx)("div",{className:"text-sm text-amber-300",children:"Live data unavailable."}),(0,a.jsxs)("div",{className:"text-[11px] text-slate-400 text-center max-w-md",children:["Backend not responding after retry. ",s.message]})]}),"ready"===s.kind&&(0,a.jsx)(Z.h,{width:"100%",height:"100%",children:(0,a.jsxs)(P.c,{data:s.rows,margin:{top:20,right:30,left:2
410,bottom:5},children:[(0,a.jsxs)("defs",{children:[(0,a.jsxs)("linearGradient",{id:"afrrGradientLive",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"5%",stopColor:"#00ffd1",stopOpacity:.8}),(0,a.jsx)("stop",{offset:"95%",stopColor:"#00ffd1",stopOpacity:.1})]}),(0,a.jsxs)("linearGradient",{id:"pzuGradientLive",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"5%",stopColor:"#2563eb",stopOpacity:.8}),(0,a.jsx)("stop",{offset:"95%",stopColor:"#2563eb",stopOpacity:.1})]})]}),(0,a.jsx)(A.q,{strokeDasharray:"3 3",stroke:"#334155",vertical:!1}),(0,a.jsx)(z.K,{dataKey:"monthShort",tick:{fill:"#64748b",fontSize:11},axisLine:{stroke:"#334155"}}),(0,a.jsx)(I.B,{yAxisId:"left",tick:{fill:"#64748b",fontSize:11},axisLine:{stroke:"#334155"},tickFormatter:e=>"â¬".concat(e.toFixed(0),"K"),label:{value:"Revenue (â¬K)",angle:-90,position:"insideLeft",fill:"#64748b",fontSize:10}}),(0,a.jsx)(I.B,{yAxisId:"right",orientation:"right",tick:{fill:"#f59e0b",fontSize:11},axisLine:{stroke:"#f59e0b",strokeOpacity:.5},tickFormatter:e=>"".concat(e,"â¬"),label:{value:"PZU sell â¬/MWh",angle:90,position:"insideRight",fill:"#f59e0b",fontSize:10}}),(0,a.jsx)(D.u,{contentStyle:{backgroundColor:"#0f172a",border:"1px solid #334155",borderRadius:"8px",boxShadow:"0 10px 40px rgba(0,0,0,0.5)"},labelStyle:{color:"#e2e8f0",fontWeight:"bold",marginBottom:"8px"},itemStyle:{color:"#94a3b8",fontSize:"12px"},formatter:(e,t)=>"afrr"===t?["â¬".concat(e.toFixed(0),"K"),"aFRR+ Revenue"]:"pzu"===t?["â¬".concat(e.toFixed(0),"K"),"PZU Net Profit"]:"price"===t?["".concat(e.toFixed(0)," â¬/MWh"),"PZU avg sell price"]:[e,t]}),(0,a.jsx)(E.D,{wrapperStyle:{paddingTop:"20px"}}),(0,a.jsx)(L.u,{yAxisId:"left",type:"monotone",dataKey:"afrr",stroke:"#00ffd1",strokeWidth:2,fill:"url(#afrrGradientLive)",name:"afrr"}),(0,a.jsx)(L.u,{yAxisId:"left",type:"monotone",dataKey:"pzu",stroke:"#2563eb",strokeWidth:2,fill:"url(#pzuGradientLive)",name:"pzu"}),(0,a.jsx)(F.x,{yAxisId:"right",type:"monotone",dataKey:"price",stroke:"#f59e0b",strokeWidth:2.5,dot:{fill:"#f59e0b",strokeWidth:2,r:3},name:"price"})]})})]}),"ready"===s.kind&&(0,a.jsxs)("div",{className:"mt-3 sm:mt-4 pt-3 sm:pt-4 border-t border-slate-700",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[s.partial?(0,a.jsx)("span",{className:"px-2 py-1 rounded bg-amber-500/10 border border-amber-500/30 text-amber-400 text-[10px] font-mono",title:"One of the two endpoints returned no data â chart shows the available series only.",children:"Partial data â one endpoint unavailable"}):(0,a.jsx)("span",{}),(0,a.jsx)(b,{kind:"LIVE_API",label:"LIVE 12-MO BACKTEST"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 sm:gap-4",children:[(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("p",{className:"text-[9px] sm:text-[10px] uppercase tracking-wider text-slate-400",children:"12-mo aFRR"}),(0,a.jsx)("p",{className:"text-base sm:text-lg font-bold text-[#00ffd1] font-mono",children:r(s.totals.afrr)})]}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("p",{className:"text-[9px] sm:text-[10px] uppercase tracking-wider text-slate-400",children:"12-mo PZU"}),(0,a.jsx)("p",{className:"text-base sm:text-lg font-bold text-blue-400 font-mono",children:r(s.totals.pzu)})]}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("p",{className:"text-[9px] sm:text-[10px] uppercase tracking-wider text-slate-400",children:"Combined"}),(0,a.jsx)("p",{className:"text-base sm:text-lg font-bold text-emerald-400 font-mono",children:r(s.totals.combined)})]}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("p",{className:"text-[9px] sm:text-[10px] uppercase tracking-wider text-slate-400",children:"Avg sell â¬/MWh"}),(0,a.jsxs)("p",{className:"text-base sm:text-lg font-bold text-amber-400 font-mono",children:[s.totals.avgPrice.toFixed(0),"â¬"]})]})]}),(0,a.jsxs)("p",{className:"text-[10px] text-slate-400 mt-2 text-center",children:["From real OPCOM + DAMAS data \xb7 ",s.rows.length," months \xb7 10 MW / 20 MWh canonical sizing"]})]})]})]})};let O={backdrop:{position:"absolute",inset:0,background:"rgba(2, 6, 23, 0.65)",backdropFilter:"blur(2px)"},cardBase:{position:"absolute",width:360,maxWidth:"calc(100vw - 32px)",background:"linear-gradient(135deg, #0e152d 0%, #0a1124 100%)",border:"1px solid rgba(0, 255, 209, 0.4)",borderRadius:12,boxShadow:"0 20px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,255,209,0.1)",padding:20,color:"#e2e8f0",zIndex:9999},header:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:10},badge:{fontSize:11,letterSpacing:1,textTransform:"uppercase",color:"#00ffd1",fontFamily:"monospace"},skip:{background:"transparent",border:"none",color:"#94a3b8",curs
41or:"pointer",fontSize:12,padding:"2px 6px"},title:{margin:0,marginBottom:8,fontSize:18,fontWeight:700,color:"#ffffff"},desc:{margin:0,marginBottom:16,fontSize:14,lineHeight:1.5,color:"#cbd5e1"},actions:{display:"flex",justifyContent:"space-between",gap:8},next:{padding:"8px 16px",borderRadius:8,background:"linear-gradient(135deg, #00ffd1 0%, #00d4aa 100%)",border:"none",color:"#0f172a",fontWeight:600,cursor:"pointer",fontSize:13}};function U(e){let{steps:t,currentStep:s,onNext:l,onPrev:r,onDismiss:n,className:i}=e,o=Math.max(0,Math.min(s,t.length-1)),d=t[o],c=o===t.length-1,m=0===o,[x,p]=(0,j.useState)({top:0,left:0}),u=(0,j.useCallback)(()=>p(function(e){var t;let s=window.innerWidth,a=window.innerHeight,l=(null==e?void 0:e.target)?document.querySelector(e.target):null;if(!e||!l)return{top:Math.max(16,a/2-100),left:Math.max(16,s/2-180)};let r=l.getBoundingClientRect(),n=0,i=0;switch(null!==(t=e.placement)&&void 0!==t?t:"bottom"){case"top":n=r.top-200-12,i=r.left+r.width/2-180;break;case"left":n=r.top+r.height/2-100,i=r.left-360-12;break;case"right":n=r.top+r.height/2-100,i=r.right+12;break;default:n=r.bottom+12,i=r.left+r.width/2-180}return{top:n=Math.max(16,Math.min(n,a-200-16)),left:i=Math.max(16,Math.min(i,s-360-16))}}(d)),[d]);return((0,j.useEffect)(()=>{u();let e=()=>u();window.addEventListener("resize",e),window.addEventListener("scroll",e,!0);let t=window.setTimeout(u,50);return()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.clearTimeout(t)}},[u]),(0,j.useEffect)(()=>{let e=e=>{"Escape"===e.key?(e.preventDefault(),n()):"ArrowRight"===e.key||"Enter"===e.key?(e.preventDefault(),l()):"ArrowLeft"===e.key&&(e.preventDefault(),r())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l,r,n]),d)?(0,a.jsxs)("div",{className:i,role:"dialog","aria-modal":"true","aria-labelledby":"onboarding-tour-title",style:{position:"fixed",inset:0,zIndex:9998},children:[(0,a.jsx)("div",{onClick:n,"aria-hidden":"true",style:O.backdrop}),(0,a.jsxs)("div",{style:{...O.cardBase,top:x.top,left:x.left},children:[(0,a.jsxs)("div",{style:O.header,children:[(0,a.jsxs)("span",{style:O.badge,children:["Step ",o+1," of ",t.length]}),(0,a.jsx)("button",{type:"button",onClick:n,style:O.skip,"aria-label":"Skip tour",children:"Skip tour"})]}),(0,a.jsx)("h3",{id:"onboarding-tour-title",style:O.title,children:d.title}),(0,a.jsx)("p",{style:O.desc,children:d.description}),(0,a.jsxs)("div",{style:O.actions,children:[(0,a.jsx)("button",{type:"button",onClick:r,disabled:m,style:{padding:"8px 14px",borderRadius:8,background:"rgba(148, 163, 184, 0.1)",border:"1px solid rgba(148, 163, 184, 0.3)",color:m?"#475569":"#cbd5e1",cursor:m?"not-allowed":"pointer",fontSize:13},children:"â Back"}),(0,a.jsx)("button",{type:"button",onClick:l,style:O.next,children:c?"Done â":"Next â"})]})]})]}):null}let W="bess_onboarding_dismissed_v1",K=[{title:"Welcome",description:"Welcome to eBattery Analytics. This tool models Romanian BESS revenue using real OPCOM PZU + DAMAS aFRR data. Click Next to learn the key sections."},{title:"Market data backing",description:"The badge above reads /api/v1/data/manifest and shows the delivery-date range and freshness lag for the OPCOM PZU + DAMAS aFRR datasets feeding the simulators. The two summary cards above it are tagged ILLUSTRATIVE â for real numbers, run a simulator.",target:'[data-tour="step-2"]',placement:"bottom"},{title:"Live backtest",description:"This 12-month backtest is computed live from API. Replaces the previous illustrative chart.",target:'[data-tour="step-3"]',placement:"top"},{title:"Try the simulators",description:"Run PZU arbitrage, FR simulator, or Investment analysis. Saved reports persist locally.",target:'[data-tour="step-4"]',placement:"top"}],V=[{name:"PZU Analysis",description:"Day-Ahead Market arbitrage simulation",href:"/pzu",icon:l.Z},{name:"FR Simulator",description:"Frequency Regulation revenue simulation",href:"/fr-simulator",icon:r.Z},{name:"Investment Analysis",description:"Financial modeling and ROI comparison",href:"/investment",icon:n.Z}];function q(){let e=function(){let e=arguments.length>
410&&void 0!==arguments[0]?arguments[0]:4,[t,s]=(0,j.useState)(!1),[a,l]=(0,j.useState)(!0),[r,n]=(0,j.useState)(0),i=(0,j.useRef)(!1);(0,j.useEffect)(()=>{i.current=function(){try{let e="__bess_tour_probe__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}(),l(function(){try{return"1"===window.localStorage.getItem(W)}catch(e){return!1}}()),s(!0)},[]);let o=(0,j.useCallback)(e=>{if(i.current)try{e?window.localStorage.setItem(W,"1"):window.localStorage.removeItem(W)}catch(e){}},[]),d=(0,j.useCallback)(()=>{l(!0),o(!0)},[o]);return{shouldShow:t&&!a,currentStep:r,next:(0,j.useCallback)(()=>{n(t=>t>=e-1?(l(!0),o(!0),t):t+1)},[e,o]),prev:(0,j.useCallback)(()=>{n(e=>e>0?e-1:0)},[]),dismiss:d,restart:(0,j.useCallback)(()=>{n(0),l(!1),o(!1)},[o])}}(K.length);return(0,a.jsxs)("div",{className:"space-y-4 sm:space-y-6 max-w-[1600px] mx-auto",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sm:gap-4 border-b border-slate-800 pb-4",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3",children:[(0,a.jsx)("div",{className:"p-1.5 sm:p-2 rounded-lg",style:{background:"linear-gradient(135deg, #00ffd1 0%, #00d4aa 100%)"},children:(0,a.jsx)(i.Z,{className:"w-5 h-5 sm:w-6 sm:h-6 text-slate-900"})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h1",{className:"text-lg sm:text-xl md:text-2xl font-bold text-white flex items-center gap-1 sm:gap-2",children:[(0,a.jsx)("span",{className:"gradient-text",children:"eBattery"}),(0,a.jsx)("span",{className:"text-white",children:"Analytics"})]}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-slate-400",children:"Romanian Energy Market ⢠BESS Revenue Platform"})]})]})}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:gap-4",children:[(0,a.jsx)(N,{}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 sm:gap-2 px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg",style:{background:"rgba(0, 255, 209, 0.1)",border:"1px solid rgba(0, 255, 209, 0.2)"},children:[(0,a.jsx)(o.Z,{className:"w-3 h-3 sm:w-4 sm:h-4",style:{color:"#00ffd1"}}),(0,a.jsx)("span",{className:"text-slate-300 text-xs sm:text-sm font-mono",children:"10MW/20MWh"})]}),(0,a.jsx)("div",{className:"px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg bg-[#00ffd1]/10 border border-[#00ffd1]/30",children:(0,a.jsx)("span",{className:"text-xs sm:text-sm text-[#00ffd1] font-mono",children:"RO-BESS"})})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2 sm:gap-4",children:[(0,a.jsxs)("div",{className:"bg-gradient-to-br from-slate-900 to-slate-900/50 border border-slate-700 rounded-lg sm:rounded-xl p-3 sm:p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-1.5 sm:gap-2 mb-1.5 sm:mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(r.Z,{className:"w-3 h-3 sm:w-4 sm:h-4 text-[#00ffd1]"}),(0,a.jsx)("span",{className:"text-[9px] sm:text-xs text-slate-400 uppercase tracking-wider",children:"aFRR Revenue"})]}),(0,a.jsx)(b,{kind:"ILLUSTRATIVE"})]}),(0,a.jsx)("p",{className:"text-lg sm:text-2xl font-bold text-[#00ffd1] font-mono",children:"â¬4.3M"}),(0,a.jsx)("p",{className:"text-[10px] sm:text-xs text-slate-400 mt-0.5 sm:mt-1",children:"Projected annual (10 MW)"}),(0,a.jsx)("p",{className:"text-[10px] text-slate-400 mt-0.5",children:"Source: DAMAS aFRR history 2024-2025 \xb7 Run FR Simulator for real number"})]}),(0,a.jsxs)("div",{className:"bg-gradient-to-br from-slate-900 to-slate-900/50 border border-slate-700 rounded-lg sm:rounded-xl p-3 sm:p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-1.5 sm:gap-2 mb-1.5 sm:mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(l.Z,{className:"w-3 h-3 sm:w-4 sm:h-4 text-blue-400"}),(0,a.jsx)("span",{className:"text-[9px] sm:text-xs text-slate-400 uppercase tracking-wider",children:"PZU Revenue"})]}),(0,a.jsx)(b,{kind:"ILLUSTRATIVE"})]}),(0,a.jsx)("p",{className:"text-lg sm:text-2xl font-bold text-blue-400 font-mono",children:"â¬1.8M"}),(0,a.jsx)("p",{className:"text-[10px] sm:text-xs text-slate-400 mt-0.5 sm:mt-1",children:"Projected annual (20 MWh)"}),(0,a.jsx)("p",{className:"text-[10px] text-slate-400 mt-0.5",children:"Source: OPCOM PZU history 2022-2025 \xb7 Run PZU page for real number"})]})]}),(0,a.jsx)("div",{"data-tour":"step-2",children:(0,a.jsx)(S,{})}),(0,a.jsx)("div",{"data-tour":"step-3",children:(0,a.jsx)(B,{})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 sm:gap-6",children:[(0,a.jsxs)("div",{className:"rounded-lg sm:rounded-xl p-4 sm:p-6 card-hover",style:{background:"linear-gradient(135deg, rgba(0, 255, 209, 0.1) 0%, rgba(14, 21, 45, 0.9) 100%)",border:"1px solid rgba(0, 255, 209, 0.3)"},children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3 mb-3 sm:mb-4",children:[(0,a.jsx)("div",{className:"rounded-lg p-2 sm:p-2.5",style:{background:"linear-gradient(135deg, #00ffd1 0%, #00d4aa 100%)"},children:(0,a.jsx)(l.Z,{className:"w-5 h-5 sm:w-6 sm:h-6 text-slate-900"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-base sm:text-xl font-bold text-white",children:"PZU - Day-Ahead Market"}),(0,a.jsx)("p",{style:{color:"#00ffd1"},className:"text-xs sm:text-sm",children:"Energy Arbitrage Strategy"})]})]}),(0,a.jsxs)("div",{className:"space-y-4 text-slate-300",children:[(0,a.jsxs)("p",{className:"text-sm leading-relaxed",children:["The ",(0,a.jsx)("span",{style:{color:"#00ffd1"},className:"font-semibold",children:"Day-Ahead Market (PZU/DAM)"})," operated by OPCOM enables battery storage to profit from daily price spreads through buy-low/sell-high arbitrage."]}),(0,a.jsxs)("div",{className:"rounded-lg p-4 space-y-3",style:{background:"rgba(14, 21, 45, 0.6)"},children:[(0,a.jsxs)("h3",{className:"text-white font-semibold flex items-center gap-2",children:[(0,a.jsx)(d.Z,{className:"w-4 h-4",style:{color:"#00ffd1"}}),"How It Works"]}),(0,a.jsxs)("ul",{className:"text-sm space-y-2 text-slate-400",children:[(0,a.jsxs)("li",{className:"flex items-start gap-2",children:[(0,a.jsx)(c.Z,{className:"w-4 h-4 mt-0.5 flex-shrink-0",style:{color:"#00ffd1"}}),(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{className:"text-slate-300",children:"Charge"})," during low-price hours (typically night: 00:00-06:00)"]})]}),(0,a.jsxs)("li",{className:"flex items-start gap-2",children:[(0,a.jsx)(c.Z,{className:"w-4 h-4 mt-0.5 flex-shrink-0",style:{color:"#00ffd1"}}),(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{className:"text-slate-300",children:"Discharge"})," during peak-price hours (typically evening: 17:00-21:00)"]})]}),(0,a.jsxs)("li",{className:"flex items-start gap-2",children:[(0,a.jsx)(c.Z,{className:"w-4 h-4 mt-0.5 flex-shrink-0",style:{color:"#00ffd1"}}),(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{className:"text-slate-300",children:"Profit"})," = (Sell Price \xd7 Discharge) - (Buy Price \xd7 Charge) \xd7 Efficiency"]})]})]})]}),(0,a.jsxs)("div",{className:"rounded-lg p-3 sm:p-4",style:{background:"rgba(14, 21, 45, 0.6)"},children:[(0,a.jsxs)("h3",{className:"text-white font-semibold mb-2 flex items-center gap-2 text-sm sm:text-base",children:[(0,a.jsx)(m.Z,{className:"w-3 h-3 sm:w-4 sm:h-4",style:{color:"#00ffd1"}}),"Key Metrics"]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2 sm:gap-3 text-xs sm:text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-slate-400 text-[10px] sm:text-xs",children:"Typical Daily Spread"}),(0,a.jsx)("p",{style:{color:"#00ffd1"},className:"font-mono font-bold text-xs sm:text-sm",children:"50-150 â¬/MWh"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-slate-400 text-[10px] sm:text-xs",children:"Cycles per Day"}),(0,a.jsx)("p",{style:{color:"#00ffd1"},className:"font-mono font-bold text-xs sm:text-sm",children:"1-2 cycles"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-slate-400 text-[10px] sm:text-xs",children:"Market Hours"}),(0,a.jsx)("p",{style:{color:"#00ffd1"},className:"font-mono font-bold text-xs sm:text-sm",children:"24h ahead"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-slate-400 text-[10px] sm:text-xs",children:"Settlement"}),(0,a.jsx)("p",{style:{color:"#00ffd1"},className:"font-mono font-bold text-xs sm:text-sm",children:"Hourly"})]})]})]})]}),(0,a.jsxs)(f(),{href:"/pzu",className:"mt-3 sm:mt-4 inline-flex items-center gap-2 px-3 sm:px-4 py-2 text-slate-900 rounded-lg transition-all font-medium btn-primary text-sm",children:[(0,a.jsx)(l.Z,{className:"w-4 h-4"}),"Run PZU Simulation"]})]}),(0,a.jsxs)("div",{className:"rounded-lg sm:rounded-xl p-4 sm:p-6 card-hover",style:{background:"linear-gradient(135deg, rgba(0, 255, 209, 0.1) 0%, rgba(14, 21, 45, 0.9) 100%)",border:"1px solid rgba(0, 255, 209, 0.3)"},children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3 mb-3 sm:mb-4",children:[(0,a.jsx)("div",{className:"rounded-lg p-2 sm:p-2.5",style:{background:"linear-gradient(135deg, #00ffd1 0%, #00d4aa 100%)"},children:(0,a.jsx)(r.Z,{className:"w-5 h-5 sm:w-6 sm:h-6 text-slate-900"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-base sm:text-xl font-bold text-white",children:"aFRR - Balancing Reserve"}),(0,a.jsx)("p",{style:{color:"#00ffd1"},className:"text-xs sm:text-sm",children:"Automatic Frequency Restoration"})]})]}),(0,a.jsxs)("div",{className:"space-y-4 text-slate-300",children:[(0,a.jsxs)("p",{className:"text-sm leading-relaxed",children:[(0,a.jsx)("span",{style:{color:"#00ffd1"},className:"font-semibold",children:"aFRR (Automatic Frequency Restoration Reserve)"})," is an ancillary service where batteries provide grid balancing capacity to Transelectrica TSO."]}),(0,a.jsxs)("div",{className:"rounded-lg p-4 space-y-3",style:{background:"rgba(14, 21, 45, 0.6)"},children:[(0,a.jsxs)("h3",{className:"text-white font-semibold flex items-center gap-2",children:[(0,a.jsx)(x.Z,{className:"w-4 h-4",style:{color:"#00ffd1"}}),"Revenue Streams"]}
41),(0,a.jsxs)("ul",{className:"text-sm space-y-2 text-slate-400",children:[(0,a.jsxs)("li",{className:"flex items-start gap-2",children:[(0,a.jsx)(c.Z,{className:"w-4 h-4 mt-0.5 flex-shrink-0",style:{color:"#00ffd1"}}),(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{className:"text-slate-300",children:"Capacity Payment"})," - Paid for being available (â¬/MW/h)"]})]}),(0,a.jsxs)("li",{className:"flex items-start gap-2",children:[(0,a.jsx)(c.Z,{className:"w-4 h-4 mt-0.5 flex-shrink-0",style:{color:"#00ffd1"}}),(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{className:"text-slate-300",children:"Activation Payment"})," - Paid when energy is delivered (â¬/MWh)"]})]}),(0,a.jsxs)("li",{className:"flex items-start gap-2",children:[(0,a.jsx)(c.Z,{className:"w-4 h-4 mt-0.5 flex-shrink-0",style:{color:"#00ffd1"}}),(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{className:"text-slate-300",children:"aFRR+"})," (upward) - Discharge to grid when frequency low"]})]}),(0,a.jsxs)("li",{className:"flex items-start gap-2",children:[(0,a.jsx)(c.Z,{className:"w-4 h-4 mt-0.5 flex-shrink-0",style:{color:"#00ffd1"}}),(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{className:"text-slate-300",children:"aFRR-"})," (downward) - Charge from grid when frequency high"]})]})]})]}),(0,a.jsxs)("div",{className:"rounded-lg p-3 sm:p-4",style:{background:"rgba(14, 21, 45, 0.6)"},children:[(0,a.jsxs)("h3",{className:"text-white font-semibold mb-2 flex items-center gap-2 text-sm sm:text-base",children:[(0,a.jsx)(p,{className:"w-3 h-3 sm:w-4 sm:h-4",style:{color:"#00ffd1"}}),"Market Parameters"]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2 sm:gap-3 text-xs sm:text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-slate-400 text-[10px] sm:text-xs",children:"Capacity Price"}),(0,a.jsx)("p",{style:{color:"#00ffd1"},className:"font-mono font-bold text-xs sm:text-sm",children:"10-20 â¬/MW/h"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-slate-400 text-[10px] sm:text-xs",children:"Activation Rate"}),(0,a.jsx)("p",{style:{color:"#00ffd1"},className:"font-mono font-bold text-xs sm:text-sm",children:"5-15%"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-slate-400 text-[10px] sm:text-xs",children:"Contract Period"}),(0,a.jsx)("p",{style:{color:"#00ffd1"},className:"font-mono font-bold text-xs sm:text-sm",children:"4h blocks"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-slate-400 text-[10px] sm:text-xs",children:"Response Time"}),(0,a.jsx)("p",{style:{color:"#00ffd1"},className:"font-mono font-bold text-xs sm:text-sm",children:"< 5 min"})]})]})]})]}),(0,a.jsxs)(f(),{href:"/fr-simulator",className:"mt-3 sm:mt-4 inline-flex items-center gap-2 px-3 sm:px-4 py-2 text-slate-900 rounded-lg transition-all font-medium btn-primary text-sm",children:[(0,a.jsx)(r.Z,{className:"w-4 h-4"}),"Run FR Simulation"]})]})]}),(0,a.jsxs)("div",{className:"rounded-lg sm:rounded-xl p-4 sm:p-6",style:{background:"linear-gradient(135deg, rgba(0, 255, 209, 0.05) 0%, rgba(37, 99, 235, 0.05) 50%, rgba(14, 21, 45, 0.9) 100%)",border:"1px solid rgba(0, 255, 209, 0.2)"},children:[(0,a.jsxs)("h2",{className:"text-base sm:text-lg font-semibold text-white mb-2 sm:mb-3 flex items-center gap-2",children:[(0,a.jsx)(n.Z,{className:"w-4 h-4 sm:w-5 sm:h-5",style:{color:"#00ffd1"}}),"Revenue Stacking Strategy"]}),(0,a.jsxs)("p",{className:"text-slate-400 text-xs sm:text-sm leading-relaxed",children:["Modern BESS projects in Romania combine multiple revenue streams for optimal returns.",(0,a.jsx)("span",{style:{color:"#00ffd1"},className:"font-semibold",children:" aFRR typically provides 70-80% of revenue"})," through guaranteed capacity payments, while ",(0,a.jsx)("span",{className:"text-blue-400 font-semibold",children:"PZU arbitrage adds 20-30%"})," during off-contract hours."]}),(0,a.jsxs)(f(),{href:"/investment",className:"mt-3 sm:mt-4 inline-flex items-center gap-2 px-3 sm:px-4 py-2 text-slate-900 rounded-lg transition-all font-medium btn-primary text-sm",children:[(0,a.jsx)(n.Z,{className:"w-4 h-4"}),"Investment Analysis"]})]}),(0,a.jsxs)("div",{"data-tour":"step-4",children:[(0,a.jsxs)("h2",{className:"text-base sm:text-lg font-semibold text-white mb-3 sm:mb-4 flex items-center gap-2",children:[(0,a.jsx)(i.Z,{className:"w-4 h-4 sm:w-5 sm:h-5",style:{color:"#00ffd1"}}),"Analytics Modules"]}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:V.map(e=>(0,a.jsx)(f(),{href:e.href,className:"group stat-card card-hover",children:(0,a.jsxs)("div",{className:"flex items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"rounded-lg p-2.5 sm:p-3 text-slate-900 group-hover:scale-110 transition-transform",style:{background:"linear-gradient(135deg, #00ffd1 0%, #00d4aa 100%)"},children:(0,a.jsx)(e.icon,{className:"h-5 w-5 sm:h-6 sm:w-6"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-base sm:text-lg font-semibold text-white group-hover:text-[#00ffd1] transition-colors",children:e.name}),(0,a.jsx)("p",{className:"text-xs sm:text-sm text-slate-400",children:e.description})]})]})},e.name))})]}),(0,a.jsxs)("div",{className:"pt-4 sm:pt-6 border-t border-slate-800/50 space-y-3",children:[(0,a.jsx)(C,{}),(0,a.jsx)("div",{className:"text-center",children:(0,a.jsxs)("a",{href:"https://ebattery.energy",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 sm:gap-2 text-xs sm:text-sm text-slate-400 hover:text-[#00ffd1] transition-colors",children:[(0,a.jsx)("span",{children:"Powered by"}),(0,a.jsx)("span",{style:{color:"#00ffd1"},className:"font-semibold",children:"eBattery.energy"}),(0,a.jsx)(u.Z,{className:"w-3 h-3"})]})})]}),e.shouldShow&&(0,a.jsx)(U,{steps:K,currentStep:e.currentStep,onNext:e.next,onPrev:e.prev,onDismiss:e.dismiss})]})}},10826:function(e,t,s){"use strict";s.d(t,{Bl:function(){return d},CT:function(){return l},L9:function(){return i},gD:function(){return o},r:function(){return m},wK:function(){return c}});var a=s(54829);let l=s(62601).env.NEXT_PUBLIC_API_URL||"https://ebattery-api.onrender.com",r=a.Z.create({baseURL:"".concat(l,"/api/v1"),timeout:6e4,headers:{"Content-Type":"application/json"}}),n=[1500,3e3,6e3];r.interceptors.response.use(e=>e,async e=>{var t,s,a,l;let i=e.config;if(!i||(i.__retryCount=null!==(s=i.__retryCount)&&void 0!==s?s:0,i.__retryCount>=3))return Promise.reject(e);let o=null===(t=e.response)||void 0===t?void 0:t.status,d=!e.response,c="get"===(null!==(a=i.method)&&void 0!==a?a:"get").toLowerCase();if(!(d&&i.__retryCount<3||503===o&&c))return Promise.reject(e);let m=null!==(l=n[i.__retryCount])&&void 0!==l?l:6e3;return i.__retryCount+=1,await new Promise(e=>setTimeout(e,m)),r(i)});let i={getHistory:e=>r.get("/pzu/history",{params:e}),simulate:e=>r.post("/pzu/simulate",e),getMonthlySummary:e=>r.get("/pzu/monthly-summary",{params:e}),getStats:()=>r.get("/pzu/stats")},o={getProducts:()=>r.get("/fr/products"),getData:e=>r.get("/fr/data",{params:e}),simulate:e=>r.post("/fr/simulate",e),getMonthlyBreakdown:e=>r.get("/fr/monthly-breakdown",{params:e}),getStats:()=>r.get("/fr/stats"),getProductCatalog:()=>r.get("/fr/product-catalog"),multiProduct:e=>r.post("/fr/multi-product",e)},d={getManifest:()=>r.get("/data/manifest"),getStatus:()=>r.get("/data/status")},c={getDetailed:()=>r.get("/data/health-detailed")},m={analyze:e=>r.post("/investment/analyze",e),calculateFinancing:e=>r.post("/investment/financing",e),getDefaults:()=>r.get("/investment/defaults"),sensitivity:e=>r.post("/investment/sensitivity",e),scenarios:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.post("/investment/scenarios",e)},scenarioDefaults:()=>r.get("/investment/scenarios/defaults")}}},function(e){e.O(0,[123,563,396,971,938,744],function(){return e(e.s=94878)}),_N_E=e.O()}]);
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.