ocearo-ui 0.1.21 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/404.html +1 -1
- package/README.fr.md +123 -133
- package/README.md +120 -134
- package/__next.__PAGE__.txt +19 -5
- package/__next._full.txt +11 -11
- package/__next._tree.txt +2 -2
- package/_next/static/chunks/0-c2-u5p6bxzo.js +1 -0
- package/_next/static/chunks/01atsfq_4opab.js +1 -0
- package/_next/static/chunks/0cx639tthxlz4.js +1 -0
- package/_next/static/chunks/0h2qsuyze9ds1.js +1 -0
- package/_next/static/chunks/0iqdztntvxh3c.js +119 -0
- package/_next/static/chunks/0iztd835j5p1n.js +700 -0
- package/_next/static/chunks/{2nxsyowmuwpjy.js → 0jfox92up1jvy.js} +1 -1
- package/_next/static/chunks/0jpa5m78l0ib0.js +1 -0
- package/_next/static/chunks/0kpstejrka-7k.js +1 -0
- package/_next/static/chunks/0n95joti2n2py.js +3 -0
- package/_next/static/chunks/0oaqe70syw_b5.js +1 -0
- package/_next/static/chunks/0ohleay4roayh.js +353 -0
- package/_next/static/chunks/0on1skx9l54-9.js +1 -0
- package/_next/static/chunks/0w_skktmh3e48.js +1 -0
- package/_next/static/chunks/0y-dctk-kmqss.js +1 -0
- package/_next/static/chunks/0yiqocv54ogoq.js +1 -0
- package/_next/static/chunks/0zlk2mlkvbtj1.js +1 -0
- package/_next/static/chunks/0zwc9m4qgtwle.js +1 -0
- package/_next/static/chunks/11awvgcou7v4r.js +1 -0
- package/_next/static/chunks/144mjqdrx42lq.js +1 -0
- package/_next/static/chunks/1d81m3g9jqkob.js +1 -0
- package/_next/static/chunks/1ed7ayfg19cjb.js +1 -0
- package/_next/static/chunks/1epya-yh2wvj2.js +1 -0
- package/_next/static/chunks/1exvcc71cgr4t.js +446 -0
- package/_next/static/chunks/1fzzb4jtgv5gg.js +9 -0
- package/_next/static/chunks/1g8fbzv0hu0i2.js +1 -0
- package/_next/static/chunks/1gaiqhzy_0d7s.js +1 -0
- package/_next/static/chunks/1gq4t2dyr7rq3.js +1 -0
- package/_next/static/chunks/1l-jew0-1-3eq.js +30 -0
- package/_next/static/chunks/1ptj3mv8b_tzs.js +1 -0
- package/_next/static/chunks/1w1xks0hp_tlr.js +346 -0
- package/_next/static/chunks/1xekc18cyi4sx.js +1 -0
- package/_next/static/chunks/1y35unwvy8p98.js +1 -0
- package/_next/static/chunks/2aq8orcir5h03.js +1 -0
- package/_next/static/chunks/2fdpvhx4oo81h.js +1 -0
- package/_next/static/chunks/2g-xpe7xnropn.js +409 -0
- package/_next/static/chunks/2kmptoy43h0mx.js +1 -0
- package/_next/static/chunks/2n86yq1wz1yx7.js +1 -0
- package/_next/static/chunks/2r_h93rt76vka.js +1 -0
- package/_next/static/chunks/2rebcvig176xk.js +564 -0
- package/_next/static/chunks/2w71oj1brox5z.js +1 -0
- package/_next/static/chunks/2wayx8t5r5fi9.js +1 -0
- package/_next/static/chunks/2y3d8zopa8r5r.css +3 -0
- package/_next/static/chunks/3--qzv1u6c7_7.js +1 -0
- package/_next/static/chunks/31lugryguappr.js +1 -0
- package/_next/static/chunks/32j_j396qs7be.js +1 -0
- package/_next/static/chunks/32yn_fc-es66m.js +22 -0
- package/_next/static/chunks/34_oyzp8_pi_m.js +1 -0
- package/_next/static/chunks/34wvn5zw0a69w.js +1 -0
- package/_next/static/chunks/37t6vg8fb1-z8.js +1 -0
- package/_next/static/chunks/3k5itcabq5oqs.js +9 -0
- package/_next/static/chunks/3ktj0iemsr1m-.js +1 -0
- package/_next/static/chunks/3nm7o0eq5abhg.js +1 -0
- package/_next/static/chunks/3s6nzrbk-8mnv.js +31 -0
- package/_next/static/chunks/3td9mnhvcj9cq.js +1 -0
- package/_next/static/chunks/3xjnsskh0tayo.js +1 -0
- package/_next/static/chunks/3zqx8h9yg5-ch.js +1 -0
- package/_next/static/chunks/turbopack-1h111qg8l92rw.js +1 -0
- package/_not-found/__next._full.txt +12 -12
- package/_not-found/__next._not-found.__PAGE__.txt +19 -2
- package/_not-found/__next._tree.txt +2 -2
- package/_not-found.html +1 -1
- package/_not-found.txt +12 -12
- package/boats/boats.json +40 -5
- package/index.html +1 -1
- package/index.txt +11 -11
- package/package.json +14 -14
- package/settings/__next._full.txt +14 -14
- package/settings/__next._tree.txt +2 -2
- package/settings/__next.settings.__PAGE__.txt +22 -5
- package/settings.html +1 -1
- package/settings.txt +14 -14
- package/__next._head.txt +0 -6
- package/__next._index.txt +0 -5
- package/_next/static/chunks/009rlietvsaq2.js +0 -1
- package/_next/static/chunks/070stlm97b9a2.js +0 -1
- package/_next/static/chunks/08gn5_gd6amkq.js +0 -1
- package/_next/static/chunks/0abo2oxxw3hpi.js +0 -1
- package/_next/static/chunks/0jzbiie0nzar2.js +0 -1
- package/_next/static/chunks/0l9s4rhr00adq.js +0 -1
- package/_next/static/chunks/0ri_um14-5x7u.js +0 -1
- package/_next/static/chunks/0utifqhyv2cuc.js +0 -1
- package/_next/static/chunks/0uvr7xkt_5uno.js +0 -1
- package/_next/static/chunks/0wzr1__so6xme.js +0 -1
- package/_next/static/chunks/0zjxnzbxh76mt.js +0 -1
- package/_next/static/chunks/11ln9lzzbo35q.js +0 -1
- package/_next/static/chunks/1bz0tcmhjmjgh.js +0 -1
- package/_next/static/chunks/1d4h-sglyo8ft.js +0 -1
- package/_next/static/chunks/1gizigk3w6q7j.js +0 -31
- package/_next/static/chunks/1porlo35ga4zu.js +0 -1
- package/_next/static/chunks/1ptwltjb3h6jf.js +0 -4
- package/_next/static/chunks/1sq_733weprvs.js +0 -1
- package/_next/static/chunks/1w1ua0-p5lk1e.js +0 -38
- package/_next/static/chunks/1wv5e5qomv-7g.css +0 -3
- package/_next/static/chunks/27hn45pv56pv7.js +0 -393
- package/_next/static/chunks/28y-j215vt42m.js +0 -1
- package/_next/static/chunks/29-ag86gvlc40.js +0 -9
- package/_next/static/chunks/2a0yjir_3mk1m.js +0 -1
- package/_next/static/chunks/2atijj_pkc4uc.js +0 -2
- package/_next/static/chunks/2baz6j1q913qw.js +0 -1
- package/_next/static/chunks/2ccpehidlaq88.js +0 -1
- package/_next/static/chunks/2lez3uww9j4t0.js +0 -135
- package/_next/static/chunks/2lvvt2f1l5sfu.js +0 -1
- package/_next/static/chunks/2nd5amcst4lhp.js +0 -1
- package/_next/static/chunks/2pwmb4pkqygy_.js +0 -1
- package/_next/static/chunks/2rsdqsatgq9ta.js +0 -1
- package/_next/static/chunks/2uao1hfsz-oy8.js +0 -1
- package/_next/static/chunks/2urimbxg5bqv3.js +0 -1
- package/_next/static/chunks/2yghvponatk1x.js +0 -135
- package/_next/static/chunks/31i14-jemhnic.js +0 -863
- package/_next/static/chunks/32cbrrsp-x35l.js +0 -1
- package/_next/static/chunks/36ra6xjie0dsv.js +0 -9
- package/_next/static/chunks/3dt63tw_9r0jt.js +0 -38
- package/_next/static/chunks/3iuz3f0429awx.js +0 -1
- package/_next/static/chunks/3jh1u-s3k0bkk.js +0 -1
- package/_next/static/chunks/3jupxlga7r_do.js +0 -1
- package/_next/static/chunks/3m57lnggu30tr.js +0 -243
- package/_next/static/chunks/3rhgquok36e79.js +0 -1
- package/_next/static/chunks/3sgrkzk20mxs6.js +0 -54
- package/_next/static/chunks/42dfiu6iby3fq.js +0 -1
- package/_next/static/chunks/43ps2cu5ahf8n.js +0 -3
- package/_next/static/chunks/turbopack-0pirmko-w-775.js +0 -1
- package/_not-found/__next._head.txt +0 -6
- package/_not-found/__next._index.txt +0 -5
- package/_not-found/__next._not-found.txt +0 -5
- package/boats/ais/ais-30.glb +0 -0
- package/boats/ais/ais-31.glb +0 -0
- package/boats/ais/ais-35.glb +0 -0
- package/boats/ais/ais-36.glb +0 -0
- package/boats/ais/ais-37.glb +0 -0
- package/boats/ais/ais-40.glb +0 -0
- package/boats/ais/ais-50.glb +0 -0
- package/boats/ais/ais-60.glb +0 -0
- package/boats/ais/ais-70.glb +0 -0
- package/boats/ais/ais-80.glb +0 -0
- package/settings/__next._head.txt +0 -6
- package/settings/__next._index.txt +0 -5
- package/settings/__next.settings.txt +0 -5
- /package/_next/static/{hlKDicTyNGfd7dmHqo5m5 → baa0rBM5TIECz8JV_tLT6}/_buildManifest.js +0 -0
- /package/_next/static/{hlKDicTyNGfd7dmHqo5m5 → baa0rBM5TIECz8JV_tLT6}/_clientMiddlewareManifest.js +0 -0
- /package/_next/static/{hlKDicTyNGfd7dmHqo5m5 → baa0rBM5TIECz8JV_tLT6}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,98922,e=>{"use strict";var t=e.i(43476),a=e.i(71645),i=e.i(67561),s=e.i(85709);e.s(["default",0,()=>{let{nightMode:e}=(0,i.useOcearoContext)(),n=(0,s.useSignalKPath)("navigation.position"),[r,l]=(0,a.useState)(new Date);(0,a.useEffect)(()=>{let e=setInterval(()=>{l(new Date)},1e4);return()=>clearInterval(e)},[]);let c=(e,t)=>{if(null==e)return"--";let a=Math.abs(e),i=Math.floor(a),s=((a-i)*60).toFixed(3);return`${i}\xb0${s}'${t?e>=0?"N":"S":e>=0?"E":"W"}`},o=()=>{try{let e=navigator.language||"en-US";return r.toLocaleString(e,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}catch(e){return console.warn("Error formatting date with user locale, falling back to en-US",e),r.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0})}},d=e?"text-oNight":"text-hud-main";return n?(0,t.jsxs)("div",{className:"mt-6 ml-2 group p-4 transition-all duration-300 select-none",children:[(0,t.jsxs)("div",{className:`text-2xl font-black flex gap-4 ${d} tracking-tighter drop-shadow-lg mb-3`,children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:`text-xs font-black uppercase tracking-[0.2em] mb-1 ${e?"text-oNight/40":"text-hud-dim"}`,children:"LAT"}),(0,t.jsx)("span",{children:c(n.latitude,!0)})]}),(0,t.jsx)("div",{className:"w-[1px] bg-hud-border self-stretch my-1"}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:`text-xs font-black uppercase tracking-[0.2em] mb-1 ${e?"text-oNight/40":"text-hud-dim"}`,children:"LON"}),(0,t.jsx)("span",{children:c(n.longitude,!1)})]})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("div",{className:"h-[2px] w-4 bg-oBlue/40 rounded-full"}),(0,t.jsx)("div",{className:`text-xs font-black uppercase tracking-[0.3em] ${e?"text-oNight/60":"text-hud-secondary"}`,children:o()})]})]}):(0,t.jsxs)("div",{className:"mt-6 ml-2 p-3 transition-all duration-300",children:[(0,t.jsxs)("div",{className:`text-2xl font-black flex gap-4 ${d} opacity-10 tracking-tighter mb-2`,children:[(0,t.jsx)("span",{children:"--°--'--"}),(0,t.jsx)("span",{children:"--°--'--"})]}),(0,t.jsx)("div",{className:`text-xs font-black uppercase tracking-[0.2em] opacity-40 ${e?"text-oNight":"text-hud-main"}`,children:o()})]})}])},39554,e=>{e.n(e.i(98922))}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,4875,e=>{"use strict";var t=e.i(43476),a=e.i(67561),i=e.i(46991),s=e.i(71645),l=e.i(85709);e.i(85269);var n=e.i(22831);let r={SOG:"navigation.speedOverGround",VMG:"performance.velocityMadeGood",STW:"navigation.speedThroughWater",POL:"performance.polarSpeedRatio"};e.s(["default",0,()=>{let{t:e}=(0,n.useTranslation)(),{nightMode:c}=(0,a.useOcearoContext)(),[o,d]=(0,s.useState)("SOG"),u=(0,s.useMemo)(()=>Object.values(r),[]),x=(0,l.useSignalKPaths)(u),h=(0,s.useMemo)(()=>{let e={};for(let[t,a]of Object.entries(r)){let s=x[a];null!=s&&(e[t]="POL"===t?100*s:(0,i.convertSpeedUnit)(s))}return e},[x]),m=Object.keys(h),p=void 0!==h[o]?o:m[0],g=h[p],v=(0,s.useCallback)(()=>{if(0===m.length)return;let e=(m.indexOf(p)+1)%m.length;d(m[e])},[m,p]);return 0===m.length?(0,t.jsxs)("div",{className:"mt-6 ml-2",children:[(0,t.jsx)("div",{className:"text-7xl font-black text-hud-dim tracking-tighter",children:"--"}),(0,t.jsx)("div",{className:"text-xs font-black uppercase tracking-[0.2em] text-hud-muted ml-1",children:e("common.na")})]}):(0,t.jsxs)("div",{className:"mt-6 ml-2 select-none group",children:[(0,t.jsx)("div",{className:`text-7xl font-black cursor-pointer tracking-tighter drop-shadow-2xl transition-all duration-300 group-hover:scale-105 active:scale-95 ${c?"text-oNight":"text-hud-main"}`,onClick:v,role:"button",tabIndex:0,"aria-label":`Current speed: ${g} ${p}. Click to change speed type.`,children:Number.isFinite(g)?g.toFixed(1):"--"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2 ml-1",children:[(0,t.jsx)("div",{className:`text-xs font-black uppercase tracking-[0.3em] ${c?"text-oNight":"text-hud-secondary"}`,children:p}),(0,t.jsx)("div",{className:"h-[2px] w-4 bg-oBlue/40 rounded-full"}),(0,t.jsx)("div",{className:`text-xs font-bold uppercase tracking-widest ${c?"text-oNight/60":"text-hud-muted"}`,children:"POL"===p?"%":(0,i.getSpeedUnitLabel)()})]})]})}])},56665,e=>{e.n(e.i(4875))}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,70829,e=>{"use strict";var t=e.i(43476),r=e.i(71645),l=e.i(49721),o=e.i(68757);e.s(["default",0,({path:e})=>{let[s,i]=(0,r.useState)([]),[n,a]=(0,r.useState)(null),c=(0,r.useRef)(null);return(0,r.useEffect)(()=>{(async()=>{try{let t=await fetch(`${e}/index.json`);if(!t.ok)throw Error("Network response was not ok");let r=await t.json();i(r),r.length>0&&a(r[0])}catch(e){console.error("Error fetching PDF files:",e)}})()},[e]),(0,t.jsxs)("div",{className:"flex flex-col h-full bg-rightPaneBg overflow-hidden",ref:c,children:[(0,t.jsx)("div",{className:"flex border-b border-hud bg-hud-bg overflow-x-auto scrollbar-hide",children:s.map((e,r)=>(0,t.jsxs)("button",{onClick:()=>a(e),className:`flex-1 py-3 px-2 text-xs font-black uppercase flex items-center justify-center transition-all duration-500 whitespace-nowrap ${n?.file===e.file?"text-oGreen border-b-2 border-oGreen bg-hud-bg":"text-hud-secondary hover:text-hud-main tesla-hover"}`,children:[(0,t.jsx)(l.FontAwesomeIcon,{icon:o.faFileAlt,className:"mr-2"}),e.title]},r))}),(0,t.jsx)("div",{className:"flex-grow bg-hud-bg text-hud-main flex items-center justify-center",children:n&&(0,t.jsx)("iframe",{src:`${e}/${n.file}`,title:"PDF Viewer",width:"100%",height:"100%",style:{border:"none"}})})]})}])},92094,e=>{e.n(e.i(70829))}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,73064,e=>{"use strict";var t=e.i(43476),l=e.i(71645),s=e.i(88653),a=e.i(46932);e.i(67561);var r=e.i(85709),n=e.i(83402),i=e.i(49721),o=e.i(68757);let d=e=>null==e?null:(e/1e5).toFixed(1),c=e=>null==e?null:Math.round(100*e);var u=e.i(46991);let m=({label:e,value:l,unit:s,min:a=0,max:r=100,icon:n,warningThreshold:o,criticalThreshold:d,size:c=120,showValue:u=!0,reversed:m=!1})=>{let x=null==l||isNaN(l)?"N/A":l,h="N/A"!==x,p=h?Math.min(100,Math.max(0,(l-a)/(r-a)*100)):0,g=h&&void 0!==d&&(m?l<=d:l>=d),f=h&&void 0!==o&&(m?l<=o:l>=o);return(0,t.jsxs)("div",{className:"tesla-card p-2 tesla-hover flex flex-col items-center justify-center",children:[(0,t.jsxs)("div",{className:"relative",style:{width:c,height:c},children:[(0,t.jsxs)("svg",{style:{width:c,height:c},className:"transform -rotate-90",viewBox:"0 0 100 100",children:[(0,t.jsx)("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:"var(--hud-border)",strokeWidth:"6"}),(0,t.jsx)("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:h?g?"var(--color-oRed)":f?"var(--color-oYellow)":"var(--color-oGreen)":"var(--color-oGray)",strokeWidth:"6",strokeLinecap:"round",strokeDasharray:`${2*Math.PI*40}`,strokeDashoffset:`${h?2*Math.PI*40*(1-p/100):2*Math.PI*40}`,className:"transition-all duration-1000"})]}),(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[n&&(0,t.jsx)(i.FontAwesomeIcon,{icon:n,className:"text-hud-muted text-sm mb-1"}),u&&(0,t.jsx)("div",{className:`text-2xl font-black tracking-tighter gliding-value ${h?"text-hud-main":"text-hud-muted"} ${g||!m&&p>=90?"animate-soft-pulse":""}`,children:x}),u&&h&&s&&(0,t.jsx)("div",{className:"text-xs font-black text-hud-secondary uppercase tracking-widest",children:s})]})]}),(0,t.jsx)("div",{className:"text-hud-muted text-xs font-black mt-1 text-center uppercase tracking-widest",children:e})]})},x=({label:e,value:l,unit:s,min:a=0,max:r=100,icon:n,warningThreshold:o,criticalThreshold:d,showMinMax:c=!1,reversed:u=!1})=>{let m=null==l||isNaN(l)?"N/A":`${l}${s?` ${s}`:""}`,x="N/A"!==m,h=x?Math.min(100,Math.max(0,(l-a)/(r-a)*100)):0,p=x&&void 0!==d&&(u?l<=d:l>=d),g=x&&void 0!==o&&(u?l<=o:l>=o);return(0,t.jsxs)("div",{className:"tesla-card p-3 tesla-hover",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center text-hud-muted text-xs font-black uppercase tracking-widest",children:[n&&(0,t.jsx)(i.FontAwesomeIcon,{icon:n,className:"mr-2 fa-fw opacity-50"}),e]}),(0,t.jsx)("div",{className:`font-black text-lg gliding-value ${x?"text-hud-main":"text-hud-dim"} ${p||!u&&h>=90?"animate-soft-pulse":""}`,children:m})]}),(0,t.jsx)("div",{className:"relative w-full bg-hud-elevated rounded-full h-1.5 overflow-hidden",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all duration-1000 ${!x?"bg-hud-elevated":p?"bg-oRed":g?"bg-oYellow":"bg-oGreen"}`,style:{width:`${h}%`}})}),c&&(0,t.jsxs)("div",{className:"flex justify-between text-xs font-black text-hud-dim mt-2 uppercase tracking-tighter",children:[(0,t.jsx)("span",{children:a}),(0,t.jsx)("span",{children:r})]})]})},h=({label:e,value:l,unit:s,icon:a,warningThreshold:r,criticalThreshold:n,reversed:o=!1})=>{let d=null==l||"number"==typeof l&&Number.isNaN(l)?"N/A":l,c="N/A"!==d;return(0,t.jsxs)("div",{className:"tesla-card p-3 tesla-hover flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center text-hud-muted text-xs font-black uppercase tracking-widest",children:[a&&(0,t.jsx)(i.FontAwesomeIcon,{icon:a,className:"mr-2 fa-fw opacity-50"}),e]}),(0,t.jsx)("div",{className:`font-black text-lg gliding-value ${(()=>{if(!c)return"text-hud-dim";if(o){if(void 0!==n&&l<=n)return"text-oRed";if(void 0!==r&&l<=r)return"text-oYellow"}else{if(void 0!==n&&l>=n)return"text-oRed";if(void 0!==r&&l>=r)return"text-oYellow"}return"text-oGreen"})()} ${n&&(o?l<=n:l>=n)?"animate-soft-pulse":""}`,children:"N/A"!==d?`${d}${s?` ${s}`:""}`:"N/A"})]})},p=({label:e,value:l,unit:s,icon:a,max:r=100,warningThreshold:n,criticalThreshold:o,reversed:d=!1})=>{let c=null==l||isNaN(l)?"N/A":Math.round(l),u="N/A"!==c,m=u&&void 0!==o&&(d?l<=o:l>=o),x=u&&void 0!==n&&(d?l<=n:l>=n),h=u?Math.min(100,l/r*100):0;return(0,t.jsxs)("div",{className:"tesla-card p-4 text-center tesla-hover",children:[a&&(0,t.jsx)(i.FontAwesomeIcon,{icon:a,className:"text-lg text-hud-muted mb-2 opacity-50"}),(0,t.jsx)("div",{className:`text-4xl font-black mb-1 tracking-tighter gliding-value ${!u?"text-hud-muted":m?"text-oRed":x?"text-oYellow":"text-oGreen"} ${m||!d&&h>=90?"animate-soft-pulse":""}`,children:c}),u&&s&&(0,t.jsx)("div",{className:"text-hud-secondary text-xs font-black uppercase tracking-widest mb-2",children:s}),(0,t.jsx)("div",{className:"text-hud-muted text-xs font-black uppercase tracking-widest mb-3",children:e}),(0,t.jsx)("div",{className:"w-full bg-hud-elevated rounded-full h-1 overflow-hidden shadow-inner",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all duration-1000 ${u?m?"bg-oRed":x?"bg-oYellow":"bg-oGreen":"bg-hud-elevated"}`,style:{width:`${h}%`}})})]})};e.i(85269);var g=e.i(22831);let f=({isOpen:e,onClose:s,onSave:a,currentEngineHours:r=null,lastRefillEngineHours:n=null,loading:d=!1})=>{let{t:c}=(0,g.useTranslation)(),[u,m]=(0,l.useState)({liters:"",cost:"",additive:!1,engineHours:"",hoursSinceLastRefill:""}),[x,h]=(0,l.useState)({});(0,l.useEffect)(()=>{if(e){let e=null!==r?Math.round(10*r)/10:"",t="";null!==r&&null!==n&&(t=Math.round((r-n)*10)/10),m({liters:"",cost:"",additive:!1,engineHours:e,hoursSinceLastRefill:t}),h({})}},[e,r,n]);let p=(e,t)=>{m(l=>({...l,[e]:t})),x[e]&&h(t=>({...t,[e]:null}))};return e?(0,t.jsx)("div",{className:"fixed inset-0 bg-hud-bg/60 backdrop-blur-sm flex items-center justify-center z-50",onClick:s,children:(0,t.jsxs)("div",{className:"bg-hud-bg backdrop-blur-xl rounded-3xl p-6 sm:p-8 max-w-md w-full mx-4 shadow-2xl border border-hud max-h-[90vh] overflow-y-auto",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-8",children:[(0,t.jsxs)("h3",{className:"text-xl font-black text-hud-main flex items-center tracking-tight",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faGasPump,className:"mr-3 text-oYellow"}),c("fuelLog.logFuelRefill")]}),(0,t.jsx)("button",{onClick:s,className:"w-10 h-10 rounded-full flex items-center justify-center text-hud-secondary hover:text-hud-main hover:bg-hud-elevated transition-all duration-300",disabled:d,children:(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faTimes,size:"lg"})})]}),(0,t.jsxs)("form",{onSubmit:e=>{let t;if(e.preventDefault(),t={},(!u.liters||0>=parseFloat(u.liters))&&(t.liters=c("fuelLog.errorLiters")),""!==u.cost&&0>parseFloat(u.cost)&&(t.cost=c("fuelLog.errorCost")),(!u.engineHours||0>parseFloat(u.engineHours))&&(t.engineHours=c("fuelLog.errorEngineHours")),h(t),0!==Object.keys(t).length)return;let l=""!==u.cost?parseFloat(u.cost):null;a({liters:parseFloat(u.liters),cost:l,additive:u.additive,engineHours:parseFloat(u.engineHours),hoursSinceLastRefill:u.hoursSinceLastRefill?parseFloat(u.hoursSinceLastRefill):null,previousEngineHours:n})},className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-xs font-black uppercase tracking-widest text-hud-secondary mb-2 flex items-center",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faGasPump,className:"mr-2 text-oBlue"}),c("fuelLog.litersAdded")]}),(0,t.jsx)("input",{type:"number",step:"0.1",min:"0",value:u.liters,onChange:e=>p("liters",e.target.value),className:`w-full bg-hud-elevated text-hud-main px-4 py-3 rounded-xl border ${x.liters?"border-oRed":"border-hud"} focus:border-oBlue focus:outline-none transition-all duration-300`,placeholder:"Ex: 50",disabled:d}),x.liters&&(0,t.jsx)("p",{className:"text-oRed text-xs mt-2 font-medium",children:x.liters})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-xs font-black uppercase tracking-widest text-hud-secondary mb-2 flex items-center",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faEuroSign,className:"mr-2 text-oGreen"}),c("fuelLog.cost")," ",(0,t.jsxs)("span",{className:"text-hud-dim font-normal normal-case ml-1",children:["(",c("fuelLog.optional"),")"]})]}),(0,t.jsx)("input",{type:"number",step:"0.01",min:"0",value:u.cost,onChange:e=>p("cost",e.target.value),className:`w-full bg-hud-elevated text-hud-main px-4 py-3 rounded-xl border ${x.cost?"border-oRed":"border-hud"} focus:border-oBlue focus:outline-none transition-all duration-300`,placeholder:"Ex: 85.50",disabled:d}),x.cost&&(0,t.jsx)("p",{className:"text-oRed text-xs mt-2 font-medium",children:x.cost})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-xs font-black uppercase tracking-widest text-hud-secondary mb-2 flex items-center",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faClock,className:"mr-2 text-oYellow"}),c("fuelLog.currentEngineHours")]}),(0,t.jsx)("input",{type:"number",step:"0.1",min:"0",value:u.engineHours,onChange:e=>(e=>{let t=parseFloat(e),l=u.hoursSinceLastRefill;if(!isNaN(t)&&null!==n){let e=Math.round((t-n)*10)/10;e>=0&&(l=e)}m(t=>({...t,engineHours:e,hoursSinceLastRefill:l})),x.engineHours&&h(e=>({...e,engineHours:null}))})(e.target.value),className:`w-full bg-hud-elevated text-hud-main px-4 py-3 rounded-xl border ${x.engineHours?"border-oRed":"border-hud"} focus:border-oBlue focus:outline-none transition-all duration-300`,placeholder:"Ex: 245.5",disabled:d}),x.engineHours&&(0,t.jsx)("p",{className:"text-oRed text-xs mt-2 font-medium",children:x.engineHours}),null!==r&&(0,t.jsxs)("p",{className:"text-hud-dim text-xs mt-2 font-medium",children:[c("fuelLog.signalkValue")," ",Math.round(10*r)/10," h"]}),null===r&&(0,t.jsx)("p",{className:"text-hud-dim text-xs mt-2 font-medium",children:c("fuelLog.noSignalkHours")})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-xs font-black uppercase tracking-widest text-hud-secondary mb-2 flex items-center",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faClock,className:"mr-2 text-hud-dim"}),c("fuelLog.hoursSinceLastRefill")]}),(0,t.jsx)("input",{type:"number",step:"0.1",min:"0",value:u.hoursSinceLastRefill,onChange:e=>p("hoursSinceLastRefill",e.target.value),className:"w-full bg-hud-elevated text-hud-main px-4 py-3 rounded-xl border border-hud focus:border-oBlue focus:outline-none transition-all duration-300 disabled:opacity-60",placeholder:"Ex: 25.5",disabled:d||null!==n&&""!==u.hoursSinceLastRefill}),null!==n&&(0,t.jsxs)("p",{className:"text-hud-dim text-xs mt-2 font-medium",children:[c("fuelLog.lastRefillAt")," ",Math.round(10*n)/10," h"]})]}),(0,t.jsxs)("div",{className:"flex items-center p-1",children:[(0,t.jsx)("input",{type:"checkbox",id:"additive",checked:u.additive,onChange:e=>p("additive",e.target.checked),className:"w-5 h-5 rounded border-hud bg-hud-elevated text-oBlue focus:ring-oBlue transition-all duration-300",disabled:d}),(0,t.jsxs)("label",{htmlFor:"additive",className:"ml-3 text-sm font-bold text-hud-secondary flex items-center cursor-pointer hover:text-hud-main transition-colors duration-300",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faFlask,className:"mr-2 text-oBlue opacity-70"}),c("fuelLog.additiveAdded")]})]}),(0,t.jsxs)("div",{className:"flex justify-end space-x-4 pt-6 border-t border-hud",children:[(0,t.jsx)("button",{type:"button",onClick:s,className:"px-6 py-3 bg-hud-elevated hover:bg-hud-bg text-hud-main font-bold rounded-xl transition-all duration-300",disabled:d,children:c("fuelLog.cancel")}),(0,t.jsx)("button",{type:"submit",className:"px-8 py-3 bg-oBlue hover:bg-oBlue/80 text-hud-main font-bold rounded-xl transition-all duration-300 flex items-center disabled:opacity-50 shadow-lg shadow-oBlue/20",disabled:d,children:d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"animate-spin mr-3 font-normal",children:"⏳"}),c("fuelLog.saving")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faSave,className:"mr-2"}),c("fuelLog.save")]})})]})]})]})}):null},v=[{id:"oilChange",intervalHours:200,intervalMonths:12},{id:"oilFilter",intervalHours:200,intervalMonths:12},{id:"fuelFilter",intervalHours:400,intervalMonths:12},{id:"fuelPreFilter",intervalHours:400,intervalMonths:12},{id:"impeller",intervalHours:400,intervalMonths:12},{id:"driveBelt",intervalHours:500,intervalMonths:12},{id:"airFilter",intervalHours:500,intervalMonths:24},{id:"valveClearance",intervalHours:500,intervalMonths:null},{id:"coolant",intervalHours:1e3,intervalMonths:24},{id:"anodes",intervalHours:null,intervalMonths:12},{id:"saildriveOil",intervalHours:200,intervalMonths:12},{id:"saildriveDiaphragm",intervalHours:null,intervalMonths:84},{id:"engineMounts",intervalHours:null,intervalMonths:12}],b=[{id:"oilChange",intervalHours:100,intervalMonths:12},{id:"oilFilter",intervalHours:200,intervalMonths:12},{id:"fuelFilter",intervalHours:200,intervalMonths:12},{id:"fuelPreFilter",intervalHours:200,intervalMonths:12},{id:"impeller",intervalHours:500,intervalMonths:12},{id:"driveBelt",intervalHours:250,intervalMonths:12},{id:"airFilter",intervalHours:500,intervalMonths:24},{id:"valveClearance",intervalHours:500,intervalMonths:null},{id:"coolant",intervalHours:1e3,intervalMonths:24},{id:"anodes",intervalHours:null,intervalMonths:12},{id:"saildriveOil",intervalHours:250,intervalMonths:12},{id:"engineMounts",intervalHours:null,intervalMonths:12}],j={"volvo-d1-20":{name:"Volvo Penta D1-20",items:v},"volvo-d1-30":{name:"Volvo Penta D1-13/30",items:v},"volvo-d2-40":{name:"Volvo Penta D2-40/50",items:v},"yanmar-2ym15":{name:"Yanmar 2YM15",items:b},"yanmar-3ym30":{name:"Yanmar 3YM20/30",items:b},"generic-diesel":{name:"Generic diesel",items:[{id:"oilChange",intervalHours:150,intervalMonths:12},{id:"oilFilter",intervalHours:150,intervalMonths:12},{id:"fuelFilter",intervalHours:300,intervalMonths:12},{id:"fuelPreFilter",intervalHours:300,intervalMonths:12},{id:"impeller",intervalHours:400,intervalMonths:12},{id:"driveBelt",intervalHours:400,intervalMonths:12},{id:"coolant",intervalHours:1e3,intervalMonths:24},{id:"anodes",intervalHours:null,intervalMonths:12},{id:"engineMounts",intervalHours:null,intervalMonths:12}]}},N="volvo-d1-20",k="ocearo_maintenance",w={hours:525,date:"2026-06-15"},y={engineModel:N,lastDone:{...Object.fromEntries(["oilChange","oilFilter","fuelFilter","fuelPreFilter","impeller","driveBelt","airFilter","anodes","saildriveOil","engineMounts"].map(e=>[e,{...w}])),saildriveDiaphragm:{hours:null,date:"2023-07-03"}}},M={overdue:{dot:"bg-oRed",text:"text-oRed"},due:{dot:"bg-oYellow",text:"text-oYellow"},ok:{dot:"bg-oGreen",text:"text-oGreen"},unknown:{dot:"bg-hud-muted",text:"text-hud-muted"}},T=()=>new Date().toISOString().slice(0,10),R=({currentEngineHours:e})=>{let{t:s}=(0,g.useTranslation)(),[a,r]=(0,l.useState)(()=>(()=>{try{let e=localStorage.getItem(k);if(e)return JSON.parse(e)}catch(e){}return y})()),[n,d]=(0,l.useState)(null),[c,u]=(0,l.useState)(""),[m,x]=(0,l.useState)(T()),h=j[a.engineModel]||j[N],p=(0,l.useCallback)(e=>{r(t=>{let l=e(t);try{localStorage.setItem(k,JSON.stringify(l))}catch(e){}return l})},[]),f=()=>{let e=parseFloat(c);p(t=>({...t,lastDone:{...t.lastDone,[n]:{hours:Number.isFinite(e)?e:null,date:m||T()}}})),d(null)},v=(0,l.useMemo)(()=>h.items.map(t=>({item:t,lastDone:a.lastDone[t.id]||null,...((e,t,l)=>{if(!t||null==t.hours&&!t.date)return{status:"unknown",hoursLeft:null,daysLeft:null,dueHours:null,dueDate:null};let s=null,a=null;null!=e.intervalHours&&null!=t.hours&&null!=l&&(s=Math.round(((a=t.hours+e.intervalHours)-l)*10)/10);let r=null,n=null;if(null!=e.intervalMonths&&t.date){let l=new Date(t.date);l.setMonth(l.getMonth()+e.intervalMonths),n=l,r=Math.floor((l.getTime()-Date.now())/864e5)}let i="ok";return null!=s&&s<0||null!=r&&r<0?i="overdue":(null!=s&&s<=25||null!=r&&r<=30)&&(i="due"),{status:i,hoursLeft:s,daysLeft:r,dueHours:a,dueDate:n}})(t,a.lastDone[t.id],e)})),[h,a.lastDone,e]),b=v.filter(e=>"overdue"===e.status).length,w=v.filter(e=>"due"===e.status).length;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,t.jsxs)("h3",{className:"text-sm font-black text-hud-main uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-2 h-2 rounded-full bg-oBlue mr-3 animate-soft-pulse"}),s("maintenance.title")]}),(0,t.jsx)("select",{value:a.engineModel,onChange:e=>{p(t=>({...t,engineModel:e.target.value}))},className:"bg-hud-elevated px-4 py-1.5 rounded-sm text-hud-main text-xs font-black uppercase border border-hud focus:outline-none tesla-hover transition-all duration-500 shadow-soft",children:Object.entries(j).map(([e,l])=>(0,t.jsx)("option",{value:e,className:"bg-leftPaneBg text-hud-main",children:l.name},e))})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,t.jsxs)("div",{className:"tesla-card p-3 text-center bg-hud-bg border border-hud",children:[(0,t.jsx)("div",{className:"text-2xl font-black text-hud-main gliding-value",children:null!=e?e.toFixed(1):s("common.na")}),(0,t.jsx)("div",{className:"text-hud-secondary text-xs font-black uppercase tracking-widest mt-1",children:s("motor.currentEngineHours")})]}),(0,t.jsxs)("div",{className:`tesla-card p-3 text-center border ${b>0?"bg-oRed/10 border-oRed/30":"bg-hud-bg border-hud"}`,children:[(0,t.jsx)("div",{className:`text-2xl font-black gliding-value ${b>0?"text-oRed":"text-hud-main"}`,children:b}),(0,t.jsx)("div",{className:"text-hud-secondary text-xs font-black uppercase tracking-widest mt-1",children:s("maintenance.overdue")})]}),(0,t.jsxs)("div",{className:`tesla-card p-3 text-center border ${w>0?"bg-oYellow/10 border-oYellow/30":"bg-hud-bg border-hud"}`,children:[(0,t.jsx)("div",{className:`text-2xl font-black gliding-value ${w>0?"text-oYellow":"text-hud-main"}`,children:w}),(0,t.jsx)("div",{className:"text-hud-secondary text-xs font-black uppercase tracking-widest mt-1",children:s("maintenance.dueSoon")})]})]}),(0,t.jsx)("div",{className:"space-y-2",children:v.map(({item:l,lastDone:r,status:h,hoursLeft:p,daysLeft:g,dueHours:v,dueDate:b})=>{let j=M[h],N=n===l.id;return(0,t.jsxs)("div",{className:"tesla-card p-3 bg-hud-bg border border-hud tesla-hover",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center min-w-0",children:[(0,t.jsx)("span",{className:`w-2 h-2 rounded-full mr-3 flex-shrink-0 ${j.dot} ${"overdue"===h?"animate-soft-pulse":""}`}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-xs font-black text-hud-main uppercase tracking-widest truncate",children:s(`maintenance.items.${l.id}`)}),(0,t.jsx)("div",{className:"text-xs text-hud-muted font-black uppercase tracking-tight mt-0.5",children:[null!=l.intervalHours?`${l.intervalHours} h`:null,null!=l.intervalMonths?s("maintenance.everyMonths",{count:l.intervalMonths}):null].filter(Boolean).join(" / ")})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 flex-shrink-0",children:[(0,t.jsx)("div",{className:"text-right",children:"unknown"===h?(0,t.jsx)("div",{className:"text-xs font-black text-hud-muted uppercase tracking-widest",children:s("maintenance.neverDone")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:`text-xs font-black uppercase tracking-widest ${j.text}`,children:"overdue"===h?s("maintenance.overdueLabel"):[null!=p?`${p.toFixed(0)} h`:null,null!=g?s("maintenance.inDays",{count:g}):null].filter(Boolean).join(" · ")}),(0,t.jsx)("div",{className:"text-xs text-hud-muted font-black tracking-tight mt-0.5",children:[null!=v?`→ ${v.toFixed(0)} h`:null,b?`→ ${b.toLocaleDateString("fr-FR")}`:null].filter(Boolean).join(" · ")})]})}),(0,t.jsx)("button",{onClick:()=>{let t;return N?d(null):(t=a.lastDone[l.id],void(d(l.id),u(t?.hours!=null?String(t.hours):null!=e?e.toFixed(1):""),x(t?.date||T())))},className:"px-3 py-1.5 text-xs bg-hud-elevated text-hud-secondary rounded-sm font-black uppercase tracking-widest tesla-hover border border-hud transition-all duration-500",children:(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faWrench,className:"text-xs"})})]})]}),N&&(0,t.jsxs)("div",{className:"mt-3 pt-3 border-t border-hud flex flex-wrap items-end gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-xs text-hud-muted font-black uppercase tracking-widest mb-1",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faClock,className:"mr-1 text-xs"}),s("maintenance.doneAtHours")]}),(0,t.jsx)("input",{type:"number",step:"0.1",value:c,onChange:e=>u(e.target.value),className:"bg-hud-elevated px-3 py-1.5 rounded-sm text-hud-main text-xs font-black border border-hud focus:outline-none w-28"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-xs text-hud-muted font-black uppercase tracking-widest mb-1",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faCalendarDays,className:"mr-1 text-xs"}),s("maintenance.doneOnDate")]}),(0,t.jsx)("input",{type:"date",value:m,onChange:e=>x(e.target.value),className:"bg-hud-elevated px-3 py-1.5 rounded-sm text-hud-main text-xs font-black border border-hud focus:outline-none"})]}),(0,t.jsxs)("button",{onClick:f,className:"bg-oGreen/80 hover:bg-oGreen text-black px-4 py-1.5 rounded-sm text-xs font-black uppercase tracking-widest transition-all duration-500",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faCheckCircle,className:"mr-2 text-xs"}),s("maintenance.markDone")]}),r&&(0,t.jsxs)("div",{className:"text-xs text-hud-muted font-black uppercase tracking-tight ml-auto",children:[s("maintenance.lastDone"),": ",null!=r.hours?`${r.hours} h`:"—"," · ",r.date?new Date(r.date).toLocaleDateString("fr-FR"):"—"]})]})]},l.id)})}),(0,t.jsxs)("div",{className:"text-xs text-hud-muted font-black uppercase tracking-tight flex items-center",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faExclamationTriangle,className:"mr-2 text-xs opacity-50"}),s("maintenance.disclaimer")]})]})};var F=e.i(48390);let L=["chargeIndicator","checkEngine","commError","eGRSystem","emergencyStopMode","highBoostPressure","lowCoolantLevel","lowFuelPressure","lowOilLevel","lowOilPressure","lowSystemVoltage","maintenanceNeeded","neutralStartProtect","overTemperature","powerReduction","preheatIndicator","revLimitExceeded","shuttingDown","subOrSecondaryThrottle","throttlePositionSensor","warningLevel1","warningLevel2","waterFlow","waterInFuel","transmission.overTemperature","transmission.lowOilPressure","temperature","exhaustTemperature"],C=["notifications.environment.inside.engineRoom.temperature"],H=["alarm","emergency"],$=["alert","warn","warning","caution"];e.s(["default",0,()=>{let{t:e}=(0,g.useTranslation)(),v=n.default.get("debugMode"),[b,j]=(0,l.useState)("0"),[N,k]=(0,l.useState)("engine"),[w,y]=(0,l.useState)([]),[M,T]=(0,l.useState)(!1),S=(0,l.useMemo)(()=>{let e=[],t=["revolutions","runTime","coolantTemperature","temperature","exhaustTemperature","coolantPressure","boostPressure","oilPressure","oilTemperature","fuel.rate","fuel.pressure","load","torque","intakeManifoldTemperature","tilt","state","transmission.gear","transmission.oilPressure","transmission.oilTemperature"];return["0","1","port","main","starboard"].forEach(l=>{t.forEach(t=>{e.push(`propulsion.${l}.${t}`)}),L.forEach(t=>{e.push(`notifications.propulsion.${l}.${t}`)})}),e.push("environment.inside.engineRoom.temperature",...C),e.push("electrical.batteries.0.voltage","electrical.batteries.0.current","electrical.batteries.1.voltage","electrical.batteries.1.current","electrical.alternators.0.voltage","electrical.alternators.1.voltage","electrical.alternators.0.current","electrical.alternators.1.current","tanks.fuel.0.currentLevel","tanks.fuel.0.capacity"),e},[]),A=(0,r.useSignalKPaths)(S),P=(0,r.useSignalKPath)("navigation.position"),E=(0,l.useCallback)(e=>A[e]??null,[A]),B=(0,l.useCallback)(()=>{let t=[];for(let l=0;l<=1;l++){let s=E(`propulsion.${l}.revolutions`),a=E(`propulsion.${l}.runTime`);0===l&&null===s&&null===a?(s=E("propulsion.port.revolutions")??E("propulsion.main.revolutions"),a=E("propulsion.port.runTime")??E("propulsion.main.runTime")):1===l&&null===s&&null===a&&(s=E("propulsion.starboard.revolutions"),a=E("propulsion.starboard.runTime")),(null!==s||null!==a||v)&&t.push({id:l.toString(),name:0===l?e("motor.portMainEngine"):e("motor.starboardEngine"),hasData:null!==s||null!==a})}return t.length>0?t:[{id:"0",name:e("motor.mainEngine"),hasData:!1}]},[E,v]);(0,l.useEffect)(()=>{y(B())},[B]);let D=(0,l.useCallback)(e=>{let t=E(`propulsion.${b}.${e}`);return null===t&&"0"===b?t=E(`propulsion.port.${e}`)??E(`propulsion.main.${e}`):null===t&&"1"===b&&(t=E(`propulsion.starboard.${e}`)),t},[b,E]),I=(0,l.useMemo)(()=>{var e,t;let l=D("coolantTemperature")??D("temperature")??E("propulsion.port.temperature"),s=D("exhaustTemperature")??E("propulsion.main.exhaustTemperature");return{rpm:null==(e=D("revolutions"))?null:60*e,runTime:(e=>{if(null==e)return null;let t=(e/3600).toFixed(1);return`${t} h`})(D("runTime")),coolantTemp:u.kelvinToCelsius(l),coolantPressure:d(D("coolantPressure")),boostPressure:d(D("boostPressure")),oilPressure:d(D("oilPressure")),oilTemp:u.kelvinToCelsius(D("oilTemperature")),fuelRate:null==(t=D("fuel.rate"))?null:Math.round(1e3*t*3600),fuelPressure:d(D("fuel.pressure")),load:c(D("load")),torque:c(D("torque")),exhaustTemp:u.kelvinToCelsius(s),engineRoomTemp:u.kelvinToCelsius(E("environment.inside.engineRoom.temperature")),intakeTemp:u.kelvinToCelsius(D("intakeManifoldTemperature")),tilt:u.radiansToDegrees(D("tilt")),state:D("state"),gear:D("transmission.gear"),transOilPressure:d(D("transmission.oilPressure")),transOilTemp:u.kelvinToCelsius(D("transmission.oilTemperature")),batteryVoltage:E("electrical.batteries.0.voltage"),batteryCurrent:E("electrical.batteries.0.current"),alternatorVoltage:E(`electrical.alternators.${b}.voltage`)??E("propulsion.port.alternatorVoltage"),alternatorCurrent:E(`electrical.alternators.${b}.current`)??E("propulsion.port.alternatorCurrent"),fuelLevel:c(E("tanks.fuel.0.currentLevel")),fuelCapacity:E("tanks.fuel.0.capacity")}},[b,D,E]),G=(0,l.useMemo)(()=>{let e=[];return L.forEach(t=>{let l=E(`notifications.propulsion.${b}.${t}`);l||"0"!==b?l||"1"!==b||(l=E(`notifications.propulsion.starboard.${t}`)):l=E(`notifications.propulsion.port.${t}`)??E(`notifications.propulsion.main.${t}`),l&&"object"==typeof l&&e.push({type:t,...l})}),C.forEach(t=>{let l=E(t);l&&"object"==typeof l&&e.push({type:"engineRoomTemperature",...l})}),e},[b,E]),O=(0,l.useMemo)(()=>G.filter(e=>e.state&&"normal"!==e.state&&"nominal"!==e.state),[G]),Y=O.some(e=>H.includes(e.state)),V=O.some(e=>$.includes(e.state)),z=E("electrical.batteries.1.current"),W="number"==typeof z?Math.round(10*z)/10:z,U=D("runTime"),_=null!==U?U/3600:null;(0,l.useEffect)(()=>{if(null!==_)try{localStorage.setItem("ocearo_lastEngineHours",String(_))}catch(e){}},[_]);let[q,K]=(0,l.useState)(!1),[Z,J]=(0,l.useState)([]),[Q,X]=(0,l.useState)(null),[ee,et]=(0,l.useState)(!1),[el,es]=(0,l.useState)(null),ea=(0,l.useMemo)(()=>{if(null!==_)return _;try{let e=parseFloat(localStorage.getItem("ocearo_lastEngineHours"));if(Number.isFinite(e))return e}catch(e){}return Q?.lastRefill?.engineHours??null},[_,Q]),er=(0,l.useCallback)(async()=>{et(!0),es(null);try{let e=await (0,F.fetchFuelLogEntries)();J(e);let t=(0,F.calculateFuelStats)(e,I.fuelCapacity);X(t)}catch(e){es((0,F.handleOcearoCoreError)(e,"Fuel log fetch")),J([]),X(null)}finally{et(!1)}},[I.fuelCapacity]);(0,l.useEffect)(()=>{"fuel"===N&&er()},[N,er]);let en=(0,l.useCallback)(async e=>{et(!0),es(null);try{await (0,F.addFuelLogEntry)(e,P),K(!1),await er()}catch(e){es((0,F.handleOcearoCoreError)(e,"Fuel log save"))}finally{et(!1)}},[P,er]),ei=Q?.lastRefill?.engineHours||null,eo=(0,l.useMemo)(()=>(0,F.estimateTankLevel)(Z,ea,I.fuelCapacity,null!==I.fuelLevel?I.fuelLevel/100:null),[Z,ea,I.fuelCapacity,I.fuelLevel]);return(0,t.jsxs)("div",{className:"flex flex-col h-full bg-rightPaneBg overflow-hidden",children:[(0,t.jsx)("div",{className:"flex border-b border-hud bg-hud-bg",children:[{id:"engine",label:e("motor.engine"),icon:o.faCar},{id:"maintenance",label:e("motor.maintenance"),icon:o.faWrench},{id:"electrical",label:e("motor.electrical"),icon:o.faBolt},{id:"fuel",label:e("motor.fuel"),icon:o.faGasPump},{id:"warnings",label:e("motor.warnings"),icon:o.faExclamationTriangle}].map(e=>(0,t.jsxs)("button",{onClick:()=>k(e.id),className:`flex-1 py-3 px-2 text-xs font-black uppercase flex items-center justify-center transition-all duration-500 ${N===e.id?"text-oGreen border-b-2 border-oGreen bg-hud-bg":"text-hud-secondary hover:text-hud-main tesla-hover"}`,children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:e.icon,className:"mr-2"}),e.label,"warnings"===e.id&&(Y||V)&&(0,t.jsx)("span",{className:`ml-2 w-2 h-2 rounded-full animate-soft-pulse ${Y?"bg-oRed":"bg-oYellow"}`})]},e.id))}),O.length>0&&"warnings"!==N&&(0,t.jsxs)("button",{onClick:()=>k("warnings"),className:`w-full text-left px-4 py-2 text-xs font-black uppercase tracking-widest flex items-center border-b ${Y?"bg-oRed/15 border-oRed/30 text-oRed animate-soft-pulse":"bg-oYellow/15 border-oYellow/30 text-oYellow"}`,children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faExclamationTriangle,className:"mr-3"}),(0,t.jsx)("span",{className:"truncate",children:O.map(e=>e.message||e.type.replace(/([A-Z])/g," $1").trim()).join(" — ")})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-auto scrollbar-hide",children:(0,t.jsx)(s.AnimatePresence,{mode:"wait",children:(0,t.jsxs)(a.motion.div,{initial:{opacity:0,x:10},animate:{opacity:1,x:0},exit:{opacity:0,x:-10},transition:{duration:.4,ease:"easeOut"},className:"p-3",children:["engine"===N&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,t.jsxs)("h2",{className:"text-sm font-black text-hud-main uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-2 h-2 rounded-full bg-oBlue mr-3 animate-soft-pulse"}),e("motor.propulsionSystems")]}),(0,t.jsx)("select",{value:b,onChange:e=>j(e.target.value),className:"bg-hud-elevated px-4 py-1.5 rounded-sm text-hud-main text-xs font-black uppercase border border-hud focus:outline-none tesla-hover transition-all duration-500 shadow-soft",children:w.map(e=>(0,t.jsx)("option",{value:e.id,className:"bg-leftPaneBg text-hud-main",children:e.name},e.id))})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2",children:[(0,t.jsx)(p,{label:e("motor.propulsionSpeed"),value:I.rpm,unit:"RPM",icon:o.faTachometerAlt,max:4e3,warningThreshold:3200,criticalThreshold:3600}),(0,t.jsxs)("div",{className:"tesla-card p-4 text-center tesla-hover flex flex-col justify-center bg-hud-bg border border-hud",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faClock,className:"text-lg text-hud-dim mb-2 opacity-50"}),(0,t.jsx)("div",{className:"text-3xl font-black text-hud-main leading-none gliding-value tracking-tighter",children:I.runTime||e("common.na")}),(0,t.jsx)("div",{className:"text-hud-secondary text-xs font-black uppercase mt-2 tracking-[0.2em]",children:e("motor.serviceHours")})]}),(0,t.jsx)(m,{label:e("motor.load"),value:I.load,unit:"%",min:0,max:100,icon:o.faChartLine,warningThreshold:70,criticalThreshold:85,size:100}),(0,t.jsx)(m,{label:e("motor.torque"),value:I.torque,unit:"%",min:0,max:100,icon:o.faRotate,warningThreshold:75,criticalThreshold:90,size:100})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-xs font-black text-hud-main mb-1 uppercase tracking-widest flex items-center",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faTemperatureHalf,className:"mr-2 text-oYellow text-xs"}),e("motor.temperatureSection")]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:[(0,t.jsx)(m,{label:e("motor.coolant"),value:I.coolantTemp,unit:"°C",min:0,max:120,icon:o.faSnowflake,warningThreshold:95,criticalThreshold:100,size:90}),(0,t.jsx)(m,{label:e("motor.oil"),value:I.oilTemp,unit:"°C",min:0,max:150,icon:o.faOilCan,warningThreshold:110,criticalThreshold:130,size:90}),(0,t.jsx)(m,{label:e("motor.engineRoom"),value:I.engineRoomTemp,unit:"°C",min:0,max:120,icon:o.faFire,warningThreshold:55,criticalThreshold:70,size:90}),(0,t.jsx)(m,{label:e("motor.intake"),value:I.intakeTemp,unit:"°C",min:0,max:100,icon:o.faArrowDown,warningThreshold:60,criticalThreshold:80,size:90})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-xs font-black text-hud-main mb-1 uppercase tracking-widest flex items-center",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faGaugeHigh,className:"mr-2 text-oBlue text-xs"}),e("motor.pressures")]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[(0,t.jsx)(x,{label:e("motor.oil"),value:I.oilPressure,unit:"bar",min:0,max:6,icon:o.faOilCan,warningThreshold:1.5,criticalThreshold:1,reversed:!0,showMinMax:!0}),(0,t.jsx)(x,{label:e("motor.coolant"),value:I.coolantPressure,unit:"bar",min:0,max:3,icon:o.faWater,showMinMax:!0}),(0,t.jsx)(x,{label:e("motor.boost"),value:I.boostPressure,unit:"bar",min:0,max:2.5,icon:o.faArrowUp,showMinMax:!0}),(0,t.jsx)(x,{label:e("motor.fuel"),value:I.fuelPressure,unit:"bar",min:0,max:5,icon:o.faGasPump,warningThreshold:2.5,criticalThreshold:2,reversed:!0,showMinMax:!0})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:[(0,t.jsx)(h,{label:e("motor.state"),value:I.state||e("motor.unknown"),icon:o.faCar}),(0,t.jsx)(h,{label:e("motor.alternatorOutput"),value:I.alternatorVoltage?.toFixed?.(1)??I.alternatorVoltage,unit:"V",icon:o.faBolt}),(0,t.jsx)(h,{label:e("motor.tilt"),value:I.tilt,unit:"°",icon:o.faRuler}),(0,t.jsx)(h,{label:e("motor.fuelRate"),value:I.fuelRate,unit:"L/h",icon:o.faGasPump}),(0,t.jsx)(h,{label:e("motor.transmissionGear"),value:-1===I.gear?e("motor.reverse"):0===I.gear?e("motor.neutral"):I.gear?`${e("motor.forward")} ${I.gear}`:null,icon:o.faCogs}),(0,t.jsx)(h,{label:e("motor.transOilPressure"),value:I.transOilPressure,unit:"bar",icon:o.faOilCan}),(0,t.jsx)(h,{label:e("motor.transOilTemp"),value:I.transOilTemp,unit:"°C",icon:o.faTemperatureHalf})]})]}),"maintenance"===N&&(0,t.jsx)(R,{currentEngineHours:ea}),"electrical"===N&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-xs font-black text-hud-main mb-2 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oBlue mr-3"}),e("motor.energyDistribution")]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("h4",{className:"text-xs font-black text-hud-muted uppercase tracking-widest px-1",children:e("motor.ignitionBank")}),(0,t.jsx)(x,{label:e("motor.voltageNode"),value:I.batteryVoltage,unit:"V",min:10,max:15,icon:o.faBatteryFull,warningThreshold:11.8,criticalThreshold:11.5,reversed:!0,showMinMax:!0}),(0,t.jsx)(x,{label:e("motor.amperageLoad"),value:I.batteryCurrent,unit:"A",min:-50,max:50,icon:o.faBolt,showMinMax:!0})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("h4",{className:"text-xs font-black text-hud-muted uppercase tracking-widest px-1",children:e("motor.serviceBank")}),(0,t.jsx)(x,{label:e("motor.voltageNode"),value:E("electrical.batteries.1.voltage"),unit:"V",min:10,max:15,icon:o.faBatteryFull,warningThreshold:11.8,criticalThreshold:11.5,reversed:!0,showMinMax:!0}),(0,t.jsx)(x,{label:e("motor.amperageLoad"),value:W,unit:"A",min:-50,max:50,icon:o.faBolt,showMinMax:!0})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-xs font-black text-hud-main mb-2 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oYellow mr-3"}),e("motor.chargingSystems")]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsx)(m,{label:e("motor.alternatorOutput"),value:I.alternatorVoltage,unit:"V",min:10,max:16,icon:o.faBolt,warningThreshold:15,criticalThreshold:15.5,size:120}),(0,t.jsx)(m,{label:e("motor.chargeIntensity"),value:I.alternatorCurrent,unit:"A",min:0,max:100,icon:o.faBolt,size:120})]})]})]}),"fuel"===N&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,t.jsxs)("h3",{className:"text-sm font-black text-hud-main uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-2 h-2 rounded-full bg-oYellow mr-3 animate-soft-pulse"}),e("motor.resourceManagement")]}),(0,t.jsxs)("button",{onClick:()=>K(!0),className:"bg-oBlue hover:bg-oBlue/80 text-hud-main px-4 py-1.5 rounded-sm text-xs font-black uppercase tracking-widest transition-all duration-500 flex items-center shadow-lg shadow-oBlue/20",disabled:ee,children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faPlus,className:"mr-2 text-xs"}),e("motor.registerRefill")]})]}),el&&(0,t.jsxs)("div",{className:"tesla-card bg-oRed/10 border border-oRed/20 text-oRed p-4 rounded-sm text-xs font-black uppercase tracking-widest animate-soft-pulse",children:[e("motor.nodeError")," ",el]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsx)(m,{label:e("motor.consumptionRate"),value:I.fuelRate,unit:"L/h",min:0,max:50,icon:o.faGasPump,size:100}),(0,t.jsx)(m,{label:e("motor.injectionPressure"),value:I.fuelPressure,unit:"bar",min:0,max:5,icon:o.faGaugeHigh,warningThreshold:2.5,criticalThreshold:2,reversed:!0,size:100}),(0,t.jsx)(m,{label:e("motor.primaryReservoir"),value:I.fuelLevel,unit:"%",min:0,max:100,icon:o.faFlask,warningThreshold:30,criticalThreshold:15,reversed:!0,size:100})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("h3",{className:"text-xs font-black text-hud-main mb-1 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oBlue mr-3"}),e("motor.telemetryDetails")]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsx)(x,{label:e("motor.levelPercentage"),value:I.fuelLevel,unit:"%",min:0,max:100,icon:o.faFlask,warningThreshold:30,criticalThreshold:15,reversed:!0,showMinMax:!0}),(0,t.jsx)(h,{label:e("motor.totalCapacity"),value:I.fuelCapacity?.toFixed(0),unit:"L",icon:o.faFlask}),(0,t.jsx)(h,{label:e("motor.currentEngineHours"),value:ea?.toFixed(1),unit:"h",icon:o.faClock})]}),null!==I.fuelLevel&&null!==I.fuelCapacity&&(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsx)(h,{label:e("motor.currentVolume"),value:(I.fuelLevel/100*I.fuelCapacity).toFixed(0),unit:"L",icon:o.faFlask}),(0,t.jsx)(h,{label:e("motor.enduranceEst"),value:I.fuelRate>0&&null!==I.fuelLevel&&null!==I.fuelCapacity?(I.fuelLevel/100*I.fuelCapacity/I.fuelRate).toFixed(1):"N/A",unit:I.fuelRate>0?"h":"",icon:o.faClock})]})]}),eo&&(0,t.jsxs)("div",{className:"tesla-card p-4 bg-hud-bg border border-hud",children:[(0,t.jsxs)("h3",{className:"text-xs font-black text-hud-main mb-3 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oGreen mr-3"}),e("motor.predictiveAnalysis")]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[null!==eo.estimatedLiters&&(0,t.jsx)(h,{label:e("motor.estimatedVolume"),value:null!==eo.estimatedLitersWorst&&eo.estimatedLitersWorst!==eo.estimatedLiters?`${eo.estimatedLitersWorst.toFixed(0)}–${eo.estimatedLiters.toFixed(0)}`:eo.estimatedLiters,unit:"L",icon:o.faGasPump}),null!==eo.estimatedPercent&&(0,t.jsx)(x,{label:e("motor.computedLevel"),value:eo.estimatedPercentWorst??eo.estimatedPercent,unit:"%",min:0,max:100,icon:o.faFlask,warningThreshold:30,criticalThreshold:15,reversed:!0}),null!==eo.hoursRemaining&&(0,t.jsx)(h,{label:e("motor.timeToExhaustion"),value:null!==eo.hoursRemainingWorst&&eo.hoursRemainingWorst!==eo.hoursRemaining?`${eo.hoursRemainingWorst.toFixed(0)}–${eo.hoursRemaining.toFixed(0)}`:eo.hoursRemaining,unit:"h",icon:o.faClock,warningThreshold:10,criticalThreshold:5,reversed:!0})]})]}),Z.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("h3",{className:"text-xs font-black text-hud-main mb-1 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-hud-muted mr-3"}),e("motor.logHistory")]}),(0,t.jsx)("div",{className:"tesla-card overflow-hidden shadow-soft transition-all duration-500 border border-hud bg-hud-bg",children:(0,t.jsxs)("table",{className:"w-full text-xs font-black uppercase tracking-widest",children:[(0,t.jsx)("thead",{className:"bg-hud-elevated",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.meridianDate")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.liters")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.refillCost")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.hmr")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.avgConsumption")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-left font-black",children:e("motor.hoursSinceRefill")}),(0,t.jsx)("th",{className:"text-hud-muted p-4 text-center font-black",children:e("motor.additive")})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-hud",children:[...Z].reverse().map((e,l)=>{let s=e.fuel||{},a=s.liters&&s.hoursSinceLastRefill&&s.hoursSinceLastRefill>0?Math.round(s.liters/s.hoursSinceLastRefill*10)/10:null,r=s.hoursSinceLastRefill&&s.hoursSinceLastRefill>0?Math.round(10*s.hoursSinceLastRefill)/10:null;return(0,t.jsxs)("tr",{className:"text-hud-main tesla-hover group",children:[(0,t.jsx)("td",{className:"p-4 opacity-60 group-hover:opacity-100 transition-opacity",children:new Date(e.datetime).toLocaleDateString("fr-FR",{day:"2-digit",month:"2-digit",year:"numeric"})}),(0,t.jsxs)("td",{className:"p-4 gliding-value text-oBlue",children:[s.liters," L"]}),(0,t.jsx)("td",{className:"p-4 gliding-value",children:null!=s.cost?`${s.cost} €`:"—"}),(0,t.jsxs)("td",{className:"p-4 gliding-value opacity-60",children:[s.engineHoursAtRefill," h"]}),(0,t.jsx)("td",{className:"p-4 gliding-value text-oYellow",children:null!=a?`${a} L/h`:"—"}),(0,t.jsx)("td",{className:"p-4 gliding-value text-oGreen",children:null!=r?`${r} h`:"—"}),(0,t.jsx)("td",{className:"p-4 text-center",children:s.additive?(0,t.jsx)("span",{className:"text-oBlue animate-soft-pulse",children:(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faFlask,className:"text-xs"})}):(0,t.jsx)("span",{className:"text-hud-dim font-black",children:"—"})})]},e.datetime||l)})})]})})]})]}),"warnings"===N&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"tesla-card p-4 bg-hud-bg border border-hud",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsxs)("h3",{className:"text-sm font-black text-hud-main uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-2 h-2 rounded-full bg-oRed mr-3 animate-soft-pulse"}),e("motor.warningsSummary")]}),(0,t.jsx)("button",{onClick:()=>T(!M),className:"px-4 py-1.5 text-xs bg-hud-elevated text-hud-secondary rounded-sm font-black uppercase tracking-widest tesla-hover border border-hud transition-all duration-500 shadow-soft",children:M?e("motor.showLess"):e("motor.showAll")})]}),0===O.length?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"text-center text-hud-secondary py-8 tesla-card bg-hud-bg border border-hud",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faCheckCircle,className:"text-4xl mb-4 text-oGreen/40 animate-soft-pulse"}),(0,t.jsx)("h4",{className:"text-sm font-black text-hud-main uppercase tracking-[0.2em]",children:e("motor.allSystemsNominal")}),(0,t.jsx)("p",{className:"text-xs font-black mt-2 uppercase text-hud-muted tracking-widest opacity-60",children:e("motor.noActiveWarnings")})]}),M&&G.length>0&&(0,t.jsxs)("div",{className:"tesla-card p-4 bg-oGreen/5 border border-oGreen/10 shadow-soft",children:[(0,t.jsxs)("h4",{className:"text-xs font-black text-oGreen mb-3 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oGreen mr-3"}),e("motor.healthyTelemetryNodes")," (",G.length,")"]}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 text-xs font-black uppercase tracking-tight",children:G.map((e,l)=>(0,t.jsxs)("div",{className:"text-hud-secondary flex items-center bg-hud-elevated p-3 rounded-sm tesla-hover border border-hud",children:[(0,t.jsx)(i.FontAwesomeIcon,{icon:o.faCheckCircle,className:"text-oGreen mr-3 text-xs opacity-40"}),(0,t.jsx)("span",{className:"truncate opacity-60",children:e.type.replace(/([A-Z])/g," $1").trim()})]},l))})]})]}):(0,t.jsxs)("div",{className:"space-y-8",children:[Y&&(0,t.jsxs)("div",{className:"bg-oRed/5 border border-oRed/20 p-6 rounded-sm shadow-soft animate-soft-pulse",children:[(0,t.jsxs)("h4",{className:"text-xs font-black text-oRed mb-6 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oRed mr-3"}),e("motor.criticalNodeAlarms")]}),(0,t.jsx)("div",{className:"space-y-4",children:G.filter(e=>H.includes(e.state)).map((l,s)=>(0,t.jsxs)("div",{className:"text-hud-main text-xs font-black uppercase tracking-widest bg-oRed/10 p-4 rounded-sm tesla-hover border border-oRed/20",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{className:"text-xs",children:l.type.replace(/([A-Z])/g," $1").trim()}),(0,t.jsx)("span",{className:"text-oRed text-xs font-black tracking-tighter",children:e("motor.alertLevel3")})]}),(0,t.jsx)("div",{className:"text-hud-secondary text-xs mt-3 normal-case font-black tracking-normal opacity-80",children:l.message})]},s))})]}),V&&(0,t.jsxs)("div",{className:"bg-oYellow/5 border border-oYellow/20 p-6 rounded-sm shadow-soft",children:[(0,t.jsxs)("h4",{className:"text-xs font-black text-oYellow mb-6 uppercase tracking-[0.2em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oYellow mr-3"}),e("motor.systemAnomalies")]}),(0,t.jsx)("div",{className:"space-y-4",children:G.filter(e=>$.includes(e.state)).map((l,s)=>(0,t.jsxs)("div",{className:"text-hud-main text-xs font-black uppercase tracking-widest bg-oYellow/10 p-4 rounded-sm tesla-hover border border-oYellow/20",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{className:"text-xs",children:l.type.replace(/([A-Z])/g," $1").trim()}),(0,t.jsx)("span",{className:"text-oYellow text-xs font-black tracking-tighter",children:e("motor.warnLevel2")})]}),(0,t.jsx)("div",{className:"text-hud-secondary text-xs mt-3 normal-case font-black tracking-normal opacity-80",children:l.message})]},s))})]})]})]}),v&&(0,t.jsxs)("div",{className:"tesla-card p-8 bg-hud-bg border border-hud",children:[(0,t.jsxs)("h3",{className:"text-xs font-black text-oBlue mb-6 uppercase tracking-[0.3em] flex items-center",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-oBlue mr-3"}),e("motor.internalDebugTelemetry")]}),(0,t.jsx)("div",{className:"space-y-4 text-xs font-black font-mono text-hud-secondary uppercase tracking-widest",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2",children:[(0,t.jsx)("span",{className:"text-hud-muted",children:"PATH.REVOLUTIONS:"}),(0,t.jsxs)("span",{className:"text-oGreen opacity-80",children:["propulsion.",b,".revs"]}),(0,t.jsx)("span",{className:"text-hud-muted",children:"VALUE.REVOLUTIONS:"}),(0,t.jsx)("span",{className:"text-hud-main gliding-value",children:E(`propulsion.${b}.revolutions`)??"NULL"}),(0,t.jsx)("div",{className:"col-span-2 my-4 border-t border-hud"}),(0,t.jsx)("span",{className:"text-hud-muted",children:"PATH.TEMPERATURE:"}),(0,t.jsxs)("span",{className:"text-oGreen opacity-80",children:["propulsion.",b,".temp"]}),(0,t.jsx)("span",{className:"text-hud-muted",children:"VALUE.TEMPERATURE:"}),(0,t.jsx)("span",{className:"text-hud-main gliding-value",children:E(`propulsion.${b}.coolantTemperature`)??"NULL"})]})})]})]})]},N)})}),(0,t.jsx)(f,{isOpen:q,onClose:()=>K(!1),onSave:en,currentEngineHours:ea,lastRefillEngineHours:ei,loading:ee})]})}],73064)},8161,e=>{e.n(e.i(73064))}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,54784,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(46932),l=e.i(88653),n=e.i(49721),i=e.i(68757);e.i(85269);var r=e.i(22831),o=e.i(85709),c=e.i(67561);let d=({title:e,icon:a,iconColorClass:s="text-oBlue",hasData:l=!0,noDataMessage:i="No data available",children:r,className:o=""})=>{let{nightMode:d}=(0,c.useOcearoContext)(),u=d?"text-oNight":"text-hud-main",x=d?"text-oNight":s,h=()=>"function"==typeof a?a():(0,t.jsx)(n.FontAwesomeIcon,{icon:a,className:`${x} text-sm opacity-80`});return l?(0,t.jsxs)("div",{className:`tesla-card p-4 h-full flex flex-col tesla-hover overflow-hidden ${o}`,children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3 mb-3 shrink-0",children:[h(),(0,t.jsx)("span",{className:`${u} text-xs font-black uppercase tracking-widest`,children:e})]}),(0,t.jsx)("div",{className:"flex-1 flex flex-col justify-center min-h-0 overflow-hidden",children:r})]}):(0,t.jsxs)("div",{className:`tesla-card p-4 h-full flex flex-col tesla-hover overflow-hidden ${o}`,children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3 mb-3 shrink-0",children:[h(),(0,t.jsx)("span",{className:`${u} text-xs font-black uppercase tracking-widest`,children:e})]}),(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center min-h-0",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-4xl font-black text-hud-dim mb-2 gliding-value",children:"N/A"}),(0,t.jsx)("div",{className:`text-xs font-black uppercase tracking-tighter ${d?"text-oNight":"text-hud-muted"}`,children:i})]})})]})};var u=e.i(83402);let x="environment.sun.sunrise",h=e=>e||"07:25",m="environment.sun.sunset",g=e=>e||"18:06",p=e=>Math.PI/180*e,f=e=>180/Math.PI*e,v=e=>{let t=e%360;return t<0?t+360:t},b=e=>{let t=e%24;return t<0?t+24:t},w=(e,t,a,s)=>{let l;if(null==e||null==t)return null;let n=(l=Date.UTC(a.getUTCFullYear(),0,1),Math.floor((Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate())-l)/864e5)+1),i=t/15,r=n+((s?6:18)-i)/24,o=.9856*r-3.289,c=v(o+1.916*Math.sin(p(o))+.02*Math.sin(2*p(o))+282.634),d=v(f(Math.atan(.91764*Math.tan(p(c))))),u=90*Math.floor(d/90);d=(d+(90*Math.floor(c/90)-u))/15;let x=.39782*Math.sin(p(c)),h=Math.cos(Math.asin(x)),m=(Math.cos(p(90.833))-x*Math.sin(p(e)))/(h*Math.cos(p(e)));if(m>1||m<-1)return null;let g=s?360-f(Math.acos(m)):f(Math.acos(m)),w=b((g/=15)+d-.06571*r-6.622-i);return b(w+Math.round(t/15))},j=e=>{if(null==e)return null;let t=b(e),a=Math.floor(t),s=Math.round((t-a)*60),l=a;return 60===s&&(s=0,l=(l+1)%24),`${l.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`};function N(){let{t:e}=(0,r.useTranslation)(),s=u.default.get("debugMode"),l=(0,o.useSignalKPaths)([x,m,"navigation.position.latitude","navigation.position.longitude"]),c=l[x],p=l[m],f=l["navigation.position.latitude"],v=l["navigation.position.longitude"],b=(0,a.useMemo)(()=>{let e=null!==c?h(c):null,t=null!==p?g(p):null,a=((e,t,a)=>{if(null==e||null==t)return null;let s=180/Math.PI*e,l=180/Math.PI*t,n=w(s,l,a,!0),i=w(s,l,a,!1),r=null!==n?j(n):null,o=null!==i?j(i):null;return null===r&&null===o?null:{sunrise:r,sunset:o}})(f,v,new Date),l=s?h(null):null,n=s?g(null):null,i=e??(a?a.sunrise:null)??l,r=t??(a?a.sunset:null)??n;return null===i&&null===r?{hasData:!1}:{hasData:!0,sunrise:i,sunset:r}},[c,p,f,v,s]),{hasData:N,sunrise:y,sunset:k}=b;return(0,t.jsx)(d,{title:e("widgets.solarCycle"),icon:i.faSun,hasData:b.hasData,noDataMessage:e("widgets.signalLossCelestial"),children:(0,t.jsxs)("div",{className:"flex-1 flex flex-col justify-center py-4",children:[(0,t.jsx)("div",{className:"relative mb-8 group",children:(0,t.jsxs)("div",{className:"w-full h-16 relative overflow-hidden rounded-sm bg-gradient-to-r from-oYellow/20 via-oYellow/10 to-oYellow/5 shadow-inner border border-hud transition-all duration-700 group-hover:scale-[1.02]",children:[(0,t.jsx)("div",{className:"absolute bottom-4 w-full h-px bg-hud-muted opacity-20 shadow-[0_-4px_10px_var(--hud-text-main)]"}),(0,t.jsx)("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2",children:(0,t.jsx)("div",{className:"w-10 h-10 bg-oYellow rounded-full shadow-[0_0_25px_var(--color-oYellow)] flex items-center justify-center border border-hud animate-soft-pulse",children:(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faSun,className:"text-oYellow text-sm"})})}),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-transparent to-oYellow/5 pointer-events-none"})]})}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"text-center tesla-card bg-hud-bg p-4 tesla-hover border border-hud",children:[(0,t.jsx)("div",{className:"text-hud-muted text-xs uppercase mb-3 font-black tracking-widest",children:e("widgets.solarIngress")}),(0,t.jsx)("div",{className:"text-3xl font-black text-oYellow leading-none gliding-value tracking-tighter",children:null!==y?y:e("common.na")}),(0,t.jsx)("div",{className:"text-hud-muted text-xs uppercase mt-3 font-black tracking-widest opacity-60",children:e("widgets.localMeridian")})]}),(0,t.jsxs)("div",{className:"text-center tesla-card bg-hud-bg p-4 tesla-hover border border-hud",children:[(0,t.jsx)("div",{className:"text-hud-muted text-xs uppercase mb-3 font-black tracking-widest",children:e("widgets.solarEgress")}),(0,t.jsx)("div",{className:"text-3xl font-black text-oYellow leading-none gliding-value tracking-tighter",children:null!==k?k:e("common.na")}),(0,t.jsx)("div",{className:"text-hud-muted text-xs uppercase mt-3 font-black tracking-widest opacity-60",children:e("widgets.localMeridian")})]})]})]})})}function y(){let{t:e}=(0,r.useTranslation)(),s=u.default.get("debugMode"),l=(0,o.useSignalKPath)("environment.outside.uvIndex"),n=(0,a.useMemo)(()=>null!==l||s?{hasData:!0,uvIndex:null!==l?(l||0).toFixed(1):s?4:null}:{hasData:!1},[l,s]),{hasData:c,uvIndex:x}=n,h=t=>{let a=parseFloat(t);return a<=2?{level:e("widgets.uvLow"),color:"text-oGreen",bg:"bg-oGreen/10 border-oGreen/20"}:a<=5?{level:e("widgets.uvModerate"),color:"text-oYellow",bg:"bg-oYellow/10 border-oYellow/20"}:a<=7?{level:e("widgets.uvHigh"),color:"text-oYellow",bg:"bg-oYellow/10 border-oYellow/20"}:a<=10?{level:e("widgets.uvVeryHigh"),color:"text-oRed",bg:"bg-oRed/10 border-oRed/20"}:{level:e("widgets.uvExtreme"),color:"text-oRed",bg:"bg-oRed/10 border-oRed/20"}},m=c?h(x):null;return(0,t.jsx)(d,{title:e("widgets.solarRadiation"),icon:i.faSun,hasData:n.hasData,noDataMessage:e("widgets.signalLossUV"),children:(0,t.jsxs)("div",{className:"flex-1 flex flex-col justify-center py-4 space-y-8",children:[(0,t.jsxs)("div",{className:"text-center group",children:[(0,t.jsx)("div",{className:`text-6xl font-black mb-4 leading-none gliding-value tracking-tighter ${null!==x?h(x).color:"text-hud-muted"} ${parseFloat(x)>=6?"animate-soft-pulse":""}`,children:null!==x?x:e("common.na")}),(0,t.jsx)("div",{className:`text-xs font-black uppercase tracking-[0.3em] mt-4 ${null!==x?h(x).color:"text-hud-muted"}`,children:null!==x?h(x).level:e("widgets.offline")})]}),(0,t.jsx)("div",{className:"text-center",children:(0,t.jsx)("div",{className:`inline-block px-4 py-1.5 rounded-sm uppercase text-xs font-black tracking-[0.2em] shadow-soft ${m?.bg||"bg-hud-bg border-hud"} border border-hud`,children:(0,t.jsxs)("span",{className:m?.color||"text-hud-muted",children:[m?.level||e("widgets.uvUnknown")," ",e("widgets.riskThreshold")]})})}),(0,t.jsxs)("div",{className:"w-full px-2",children:[(0,t.jsxs)("div",{className:"flex h-1 rounded-full overflow-hidden shadow-inner bg-hud-elevated",children:[(0,t.jsx)("div",{className:"flex-1 bg-oGreen/40"}),(0,t.jsx)("div",{className:"flex-1 bg-oYellow/40"}),(0,t.jsx)("div",{className:"flex-1 bg-oYellow/40"}),(0,t.jsx)("div",{className:"flex-1 bg-oRed/40"}),(0,t.jsx)("div",{className:"flex-1 bg-oRed/40"})]}),null!==x&&m&&(0,t.jsx)("div",{className:"relative h-1 w-full",style:{top:"-4px"},children:(0,t.jsx)("div",{className:`absolute w-2 h-2 rounded-full border border-hud-main shadow-soft transition-all duration-1000 ${m.color.replace("text-","bg-")} shadow-[0_0_8px_currentColor]`,style:{left:`${Math.min(100,parseFloat(x)/11*100)}%`,transform:"translateX(-50%)"}})}),(0,t.jsxs)("div",{className:"flex justify-between text-xs font-black text-hud-muted mt-4 uppercase tracking-widest px-0.5",children:[(0,t.jsx)("span",{children:"0"}),(0,t.jsx)("span",{children:"2"}),(0,t.jsx)("span",{children:"5"}),(0,t.jsx)("span",{children:"7"}),(0,t.jsx)("span",{children:"11+"})]})]})]})})}let k="environment.inside.relativeHumidity",M=e=>(100*(e||0)).toFixed(0),S="environment.inside.dewPoint",D=e=>((e||0)-273.15).toFixed(1);function $(){let e,s,{t:l}=(0,r.useTranslation)(),c=u.default.get("debugMode"),x=(0,o.useSignalKPath)(k),h=(0,o.useSignalKPath)(S),m=(0,a.useMemo)(()=>{if(!(null!==x||null!==h||c))return{hasData:!1};let e=null!==x?M(x):c?"65":null;return{hasData:!0,humidity:e,humidityPercentage:e,dewPointCelsius:null!==h?D(h):c?"18.5":null}},[x,h,c]),{humidity:g,humidityPercentage:p,dewPointCelsius:f}=m;return(0,t.jsx)(d,{title:l("widgets.humidityAnalysis"),icon:i.faTint,hasData:m.hasData,noDataMessage:l("widgets.signalLossHygrometer"),children:(0,t.jsxs)("div",{className:"flex-1 flex flex-col justify-center py-4 space-y-8",children:[(0,t.jsxs)("div",{className:"text-center group",children:[(0,t.jsxs)("div",{className:`text-6xl font-black mb-4 leading-none gliding-value tracking-tighter text-hud-main ${parseInt(g)>70||30>parseInt(g)?"animate-soft-pulse":""}`,children:[null!==g?g:l("common.na"),(0,t.jsx)("span",{className:"text-xl text-hud-muted ml-2 uppercase font-black tracking-widest",children:"%"})]}),(0,t.jsx)("div",{className:`text-xs font-black uppercase tracking-[0.3em] mt-4 ${null!==g?(e=parseInt(g))<30||e>70?"text-oYellow":e<40||e>60?"text-oBlue":"text-oGreen":"text-hud-muted"}`,children:l(null!==g?(s=parseInt(g))<30?"widgets.tooDry":s>70?"widgets.tooHumid":s<40||s>60?"widgets.moderate":"widgets.optimal":"widgets.offline")})]}),(0,t.jsxs)("div",{className:"px-2",children:[(0,t.jsx)("div",{className:"w-full bg-hud-elevated rounded-full h-1 overflow-hidden shadow-inner",children:(0,t.jsx)("div",{className:`h-full transition-all duration-1000 ${30>parseInt(g)||parseInt(g)>70?"bg-oYellow":"bg-oBlue shadow-[0_0_8px_var(--color-oBlue)]"}`,style:{width:`${null!==p?p:0}%`}})}),(0,t.jsxs)("div",{className:"flex justify-between text-xs font-black text-hud-muted mt-4 uppercase tracking-widest px-0.5",children:[(0,t.jsx)("span",{children:l("widgets.arid")}),(0,t.jsx)("span",{children:l("widgets.balanced")}),(0,t.jsx)("span",{children:l("widgets.saturated")})]})]}),(0,t.jsx)("div",{className:"tesla-card p-4 bg-hud-bg tesla-hover border border-hud",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faThermometerHalf,className:"text-oBlue text-xs opacity-50"}),(0,t.jsx)("span",{className:"text-hud-secondary text-xs uppercase font-black tracking-widest",children:l("widgets.dewPoint")})]}),(0,t.jsx)("div",{className:"text-hud-main font-black text-lg gliding-value",children:null!==f?`${f}\xb0`:l("common.na")})]})})]})})}var C=e.i(46991);function P(){let{t:e}=(0,r.useTranslation)(),s=u.default.get("debugMode"),l=(0,o.useSignalKPath)("environment.outside.pressure"),n=(0,a.useMemo)(()=>{let e;return null!==l||s?{hasData:!0,pressureMbar:null!==l?(e=l,(0,C.convertPressure)(e||0)):s?1013:null}:{hasData:!1}},[l,s]),{hasData:c,pressureMbar:x}=n;return(0,t.jsx)(d,{title:e("widgets.pressureTelemetry"),icon:i.faGaugeHigh,hasData:n.hasData,noDataMessage:e("widgets.signalLossPressure"),children:(0,t.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center min-h-0",children:[(0,t.jsxs)("div",{className:"relative flex-1 flex items-center justify-center min-h-0 w-full",children:[(0,t.jsxs)("svg",{className:"w-full h-full max-w-[12rem] max-h-[12rem] transform -rotate-90 filter drop-shadow-[0_0_15px_var(--color-oBlue)]",viewBox:"0 0 100 100",children:[(0,t.jsx)("circle",{cx:"50",cy:"50",r:"44",fill:"none",stroke:"var(--hud-border)",strokeWidth:"4",opacity:"0.2"}),(0,t.jsx)("circle",{cx:"50",cy:"50",r:"44",fill:"none",stroke:"var(--color-oBlue)",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:`${2*Math.PI*44}`,strokeDashoffset:`${null!==x?2*Math.PI*44*(1-(Math.min(Math.max(x,950),1050)-950)/100):2*Math.PI*44}`,className:"transition-all duration-1000"})]}),(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[(0,t.jsx)("div",{className:"text-4xl font-black text-hud-main leading-none gliding-value tracking-tighter",children:null!==x?x:e("common.na")}),(0,t.jsx)("div",{className:"text-hud-muted text-xs uppercase font-black mt-1 tracking-[0.2em] opacity-60",children:"mbar"})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between w-full shrink-0",children:[(0,t.jsx)("div",{className:`text-xs font-black uppercase tracking-[0.2em] ${null!==x?x<1e3?"text-oRed":x>1025?"text-oBlue":"text-oGreen":"text-hud-muted"} ${null!==x&&(x<1e3||x>1025)?"animate-soft-pulse":""}`,children:e(null!==x?x<1e3?"widgets.pressureLow":x>1025?"widgets.pressureHigh":"widgets.pressureNormal":"widgets.offline")}),(0,t.jsx)("div",{className:"text-hud-muted text-xs uppercase font-black tracking-widest opacity-40",children:"950 — 1050"})]})]})})}let T="environment.inside.co2",F=e=>Math.round(e||0),A="environment.inside.pm25",I=e=>Math.round(e||0),R="environment.inside.voc",W=e=>Math.round((e||0)/1e3),G="environment.inside.relativeHumidity",L=e=>Math.round(100*(e||0));function B(){var e;let{t:s}=(0,r.useTranslation)(),l=u.default.get("debugMode"),n=(0,o.useSignalKPath)(T),c=(0,o.useSignalKPath)(A),x=(0,o.useSignalKPath)(R),h=(0,o.useSignalKPath)(G),m=(0,a.useMemo)(()=>null!==n||null!==c||null!==x||l?{hasData:!0,co2:null!==n?F(n):l?420:null,pm25:null!==c?I(c):l?12:null,voc:null!==x?W(x):l?350:null,humidity:null!==h?L(h):null}:{hasData:!1},[n,c,x,h,l]),{hasData:g,co2:p,pm25:f,voc:v,humidity:b}=m,w=null===p&&null!==v,j=w?v>=300?{level:s("widgets.aqGood"),color:"text-oGreen",bg:"bg-oGreen/10 border-oGreen/20"}:v>=150?{level:s("widgets.aqModerate"),color:"text-oYellow",bg:"bg-oYellow/10 border-oYellow/20"}:v>=50?{level:s("widgets.aqPoor"),color:"text-oYellow",bg:"bg-oYellow/10 border-oYellow/20"}:v>=20?{level:s("widgets.aqUnhealthy"),color:"text-oRed",bg:"bg-oRed/10 border-oRed/20"}:{level:s("widgets.aqHazardous"),color:"text-oRed",bg:"bg-oRed/20 border-oRed/30"}:(e=p??400)<=800?{level:s("widgets.aqGood"),color:"text-oGreen",bg:"bg-oGreen/10 border-oGreen/20"}:e<=1e3?{level:s("widgets.aqModerate"),color:"text-oYellow",bg:"bg-oYellow/10 border-oYellow/20"}:e<=1500?{level:s("widgets.aqPoor"),color:"text-oYellow",bg:"bg-oYellow/10 border-oYellow/20"}:e<=2e3?{level:s("widgets.aqUnhealthy"),color:"text-oRed",bg:"bg-oRed/10 border-oRed/20"}:{level:s("widgets.aqHazardous"),color:"text-oRed",bg:"bg-oRed/20 border-oRed/30"},N=w?v:p,y=s(w?"widgets.vocGasResistance":"widgets.co2Concentration"),k=w?null!==v&&v<20:p>1500,M=w?null!==v?Math.min(v/500,1):0:null!==p?Math.min(p/2e3,1):0,S=w?v>=300?"bg-oGreen":v>=50?"bg-oYellow":"bg-oRed":p<=800?"bg-oGreen":p<=1e3?"bg-oYellow":"bg-oRed";return(0,t.jsx)(d,{title:s("widgets.airQualityMonitoring"),icon:i.faWind,hasData:m.hasData,noDataMessage:s("widgets.signalLossAir"),children:(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[(0,t.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center",children:[(0,t.jsxs)("div",{className:`text-6xl font-black mb-3 leading-none gliding-value tracking-tighter ${j.color} ${k?"animate-soft-pulse":""}`,children:[null!==N?N:s("common.na"),null!==N&&w&&(0,t.jsx)("span",{className:"text-2xl ml-1 align-baseline",children:"kΩ"})]}),(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black tracking-[0.3em] opacity-60",children:y}),(0,t.jsx)("div",{className:"w-full bg-hud-elevated rounded-full h-1 mt-4 overflow-hidden shadow-inner",children:(0,t.jsx)("div",{className:`h-full transition-all duration-1000 ${S}`,style:{width:`${100*M}%`}})}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)("div",{className:`inline-block px-4 py-1.5 rounded-sm uppercase text-xs font-black tracking-[0.2em] shadow-soft ${j.bg} border border-hud`,children:(0,t.jsxs)("span",{className:j.color,children:[j.level," ",s("widgets.atmosphere")]})})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 shrink-0",children:[(0,t.jsx)("div",{className:"tesla-card p-3 text-center tesla-hover bg-hud-bg",children:null!==f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:`text-2xl font-black mb-1 gliding-value ${f>25?"text-oRed":"text-hud-main"}`,children:f}),(0,t.jsx)("div",{className:"text-hud-muted text-xs uppercase font-black tracking-widest opacity-60",children:s("widgets.pm25Particulate")})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"text-2xl font-black mb-1 gliding-value text-hud-main",children:null!==b?`${b}%`:s("common.na")}),(0,t.jsx)("div",{className:"text-hud-muted text-xs uppercase font-black tracking-widest opacity-60",children:s("environmental.humidity")})]})}),(0,t.jsxs)("div",{className:"tesla-card p-3 bg-hud-bg tesla-hover flex flex-col justify-center space-y-2",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center text-xs font-black uppercase tracking-widest",children:[(0,t.jsx)("span",{className:"text-hud-muted",children:s("widgets.nominal")}),(0,t.jsx)("span",{className:"text-oGreen",children:w?"> 300":"< 800"})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center text-xs font-black uppercase tracking-widest",children:[(0,t.jsx)("span",{className:"text-hud-muted",children:s("widgets.critical")}),(0,t.jsx)("span",{className:"text-oRed",children:w?"< 50":"> 1500"})]})]})]})]})})}var K=e.i(1725),O=e.i(237),Y=e.i(85183),E=e.i(93230),U=e.i(72526),H=e.i(34239),_=e.i(31195),z=e.i(7670),q=e.i(97865),V=e.i(494),X=e.i(94395),Z=e.i(44171),Q=e.i(46710),J=e.i(31725),ee=e.i(27241),et=e.i(61764),ea=e.i(75337),es=e.i(89763),el=e.i(43404),en=e.i(51883),ei=e.i(29601),er=e.i(18457),eo=e.i(22075);class ec{constructor(e){var t=e.x,a=e.y;this.xAxisScale=t,this.yAxisScale=a}map(e,t){var a,s,l=t.position;return{x:null!=(a=this.xAxisScale.map(e.x,{position:l}))?a:0,y:null!=(s=this.yAxisScale.map(e.y,{position:l}))?s:0}}mapWithFallback(e,t){var a,s,l,n,i=t.position,r=t.fallback;return l="rangeMin"===r?this.yAxisScale.rangeMin():"rangeMax"===r?this.yAxisScale.rangeMax():0,n="rangeMin"===r?this.xAxisScale.rangeMin():"rangeMax"===r?this.xAxisScale.rangeMax():0,{x:null!=(a=this.xAxisScale.map(e.x,{position:i}))?a:n,y:null!=(s=this.yAxisScale.map(e.y,{position:i}))?s:l}}isInRange(e){var t=e.x,a=e.y,s=null==t||this.xAxisScale.isInRange(t),l=null==a||this.yAxisScale.isInRange(a);return s&&l}}function ed(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,s)}return a}function eu(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ed(Object(a),!0).forEach(function(t){var s,l,n;s=e,l=t,n=a[t],(l=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var s=a.call(e,t||"default");if("object"!=typeof s)return s;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(l))in s?Object.defineProperty(s,l,{value:n,enumerable:!0,configurable:!0,writable:!0}):s[l]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ed(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function ex(){return(ex=Object.assign.bind()).apply(null,arguments)}function eh(e){var t=(0,ee.useAppDispatch)();return(0,a.useEffect)(()=>(t((0,J.addLine)(e)),()=>{t((0,J.removeLine)(e))})),null}function em(e){var t=e.xAxisId,s=e.yAxisId,l=e.shape,n=e.className,i=e.ifOverflow,r=(0,ea.useIsPanorama)(),o=(0,es.useClipPathId)(),c=(0,ee.useAppSelector)(e=>(0,et.selectXAxisSettings)(e,t)),d=(0,ee.useAppSelector)(e=>(0,et.selectYAxisSettings)(e,s)),u=(0,ee.useAppSelector)(e=>(0,et.selectAxisScale)(e,"xAxis",t,r)),x=(0,ee.useAppSelector)(e=>(0,et.selectAxisScale)(e,"yAxis",s,r)),h=(0,Q.useViewBox)();if(!o||!h||null==c||null==d||null==u||null==x)return null;var m=((e,t,a,s,l,n,i)=>{var r,o,c=i.x,d=i.y,u=i.segment,x=i.ifOverflow,h=(0,X.isNumOrStr)(c);if((0,X.isNumOrStr)(d)){var m=a.x,g=a.width,p=t.map(d,{position:s});if(!(0,eo.isWellBehavedNumber)(p)||"discard"===x&&!t.isInRange(p))return null;var f=[{x:m+g,y:p},{x:m,y:p}];return"left"===n?f.reverse():f}if(h){var v=a.y,b=a.height,w=e.map(c,{position:s});if(!(0,eo.isWellBehavedNumber)(w)||"discard"===x&&!e.isInRange(w))return null;var j=[{x:w,y:v+b},{x:w,y:v}];return"top"===l?j.reverse():j}return null!=u&&2===u.length?(o=[(r=new ec({x:e,y:t})).mapWithFallback(u[0],{position:s,fallback:"rangeMin"}),r.mapWithFallback(u[1],{position:s,fallback:"rangeMax"})],"discard"===x&&o.some(e=>!r.isInRange(e))?null:o):null})(u,x,h,e.position,c.orientation,d.orientation,e);if(!m)return null;var g=m[0],p=m[1];if(null==g||null==p)return null;var f=g.x,v=g.y,b=p.x,w=p.y,j=eu(eu({clipPath:"hidden"===i?"url(#".concat(o,")"):void 0},(0,el.svgPropertiesAndEvents)(e)),{},{x1:f,y1:v,x2:b,y2:w}),N=(0,Z.rectWithCoords)({x1:f,y1:v,x2:b,y2:w});return a.createElement(ei.ZIndexLayer,{zIndex:e.zIndex},a.createElement(q.Layer,{className:(0,z.clsx)("recharts-reference-line",n)},((e,t)=>{var s;if(a.isValidElement(e))s=a.cloneElement(e,t);else if("function"==typeof e)s=e(t);else{if(!(0,eo.isWellBehavedNumber)(t.x1)||!(0,eo.isWellBehavedNumber)(t.y1)||!(0,eo.isWellBehavedNumber)(t.x2)||!(0,eo.isWellBehavedNumber)(t.y2))return null;s=a.createElement("line",ex({},t,{className:"recharts-reference-line-line"}))}return s})(l,j),a.createElement(V.CartesianLabelContextProvider,ex({},N,{lowerWidth:N.width,upperWidth:N.width}),a.createElement(V.CartesianLabelFromLabelProp,{label:e.label}),e.children)))}var eg={ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",label:!1,stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle",zIndex:er.DefaultZIndexes.line};function ep(e){var t=(0,en.resolveDefaultProps)(e,eg);return a.createElement(a.Fragment,null,a.createElement(eh,{yAxisId:t.yAxisId,xAxisId:t.xAxisId,ifOverflow:t.ifOverflow,x:t.x,y:t.y,segment:t.segment}),a.createElement(em,t))}ep.displayName="ReferenceLine";var ef=e.i(11426);let ev=(e,t,a,s,l)=>{let n,i,r,o=a.getTime(),c=(n=s.getTime(),i=l.getTime(),r=[],n<i?r.push({time:n-67068e3,height:t,type:"low"},{time:n-44712e3,height:e,type:"high"},{time:n-22356e3,height:t,type:"low"},{time:n,height:e,type:"high"},{time:i,height:t,type:"low"},{time:i+22356e3,height:e,type:"high"},{time:i+44712e3,height:t,type:"low"},{time:i+67068e3,height:e,type:"high"}):r.push({time:i-67068e3,height:e,type:"high"},{time:i-44712e3,height:t,type:"low"},{time:i-22356e3,height:e,type:"high"},{time:i,height:t,type:"low"},{time:n,height:e,type:"high"},{time:n+22356e3,height:t,type:"low"},{time:n+44712e3,height:e,type:"high"},{time:n+67068e3,height:t,type:"low"}),r);for(let a=0;a<c.length-1;a++)if(o>=c[a].time&&o<=c[a+1].time){let s=c[a].height,l=c[a+1].height,n=c[a+1].time-c[a].time;if(n<=0)return(e+t)/2;return parseFloat((s+(l-s)*((1-Math.cos((o-c[a].time)/n*Math.PI))/2)).toFixed(2))}return(e+t)/2},eb=e=>{if(!e)return null;if(e.includes("T")||e.includes("-")){let t=new Date(e);if(!isNaN(t.getTime()))return t.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1})}return e},ew=e=>{if(!e)return null;if(e.includes("T")||e.includes("-")){let t=new Date(e);return isNaN(t.getTime())?null:t}let t=e.split(":").map(Number);if(t.length<2)return null;let a=new Date;return a.setHours(t[0],t[1],0,0),a};function ej(){let{t:e}=(0,r.useTranslation)(),{nightMode:s}=(0,c.useOcearoContext)(),l=u.default.get("debugMode"),n=(0,a.useMemo)(()=>["environment.tide.heightNow","environment.tide.heightHigh","environment.tide.heightLow","environment.tide.timeLow","environment.tide.timeHigh","environment.tide.coeffNow"],[]),i=(0,o.useSignalKPaths)(n),{tideData:x}=(0,ef.useTide)(),h=i["environment.tide.heightNow"]??x?.level??null,m=i["environment.tide.heightHigh"]??x?.high??null,g=i["environment.tide.heightLow"]??x?.low??null,p=i["environment.tide.timeLow"]??x?.timeLow??null,f=i["environment.tide.timeHigh"]??x?.timeHigh??null,v=i["environment.tide.coeffNow"]??x?.coefficient??null,b=null!==h||null!==m||null!==g||l,w=(0,a.useMemo)(()=>ew(f),[f]),j=(0,a.useMemo)(()=>ew(p),[p]),N=(0,a.useMemo)(()=>!!w&&!!j&&w.getTime()<j.getTime(),[w,j]),y=(0,a.useMemo)(()=>{let e,t,a=m||4.2,s=g||.8,l=w||((e=new Date).setHours(14,0,0,0),e),n=j||((t=new Date).setHours(8,0,0,0),t),i=[],r=new Date,o=new Date(r);o.setHours(0,0,0,0);for(let e=0;e<=48;e++){let t=new Date(o.getTime()+30*e*6e4),c=ev(a,s,t,l,n);i.push({time:t.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1}),height:c,isNow:9e5>Math.abs(t.getTime()-r.getTime())})}return i},[m,g,w,j]);return(0,t.jsx)(d,{title:e("widgets.tidalTelemetry"),icon:()=>(0,t.jsx)("svg",{className:"w-5 h-5 opacity-50",viewBox:"0 0 24 24",fill:"none",children:(0,t.jsx)("path",{d:"M3 11h18M3 6h18M3 16h18M3 21h18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}),hasData:b,noDataMessage:e("widgets.signalLossTidal"),children:(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3 shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-baseline space-x-3",children:[(0,t.jsxs)("span",{className:"text-4xl font-black text-hud-main leading-none gliding-value tracking-tighter",children:[(h||2.1).toFixed(1),(0,t.jsx)("span",{className:"text-lg text-hud-muted ml-1",children:"m"})]}),(0,t.jsx)("span",{className:`text-xs font-black uppercase tracking-[0.2em] ${N?"text-oGreen":"text-oBlue"}`,children:e(N?"widgets.rising":"widgets.ebb")})]}),v&&(0,t.jsxs)("span",{className:"text-hud-muted text-xs font-black",children:["C",Math.round(v)]})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0 mb-3 overflow-hidden",children:(0,t.jsx)(_.ResponsiveContainer,{width:"100%",height:"100%",minWidth:0,minHeight:0,children:(0,t.jsxs)(K.AreaChart,{data:y,margin:{top:5,right:5,left:-25,bottom:0},children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"colorTide",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,t.jsx)("stop",{offset:"5%",stopColor:N?s?"#ef4444":c.oGreen:s?"#ef4444":c.oBlue,stopOpacity:.3}),(0,t.jsx)("stop",{offset:"95%",stopColor:N?s?"#ef4444":c.oGreen:s?"#ef4444":c.oBlue,stopOpacity:0})]})}),(0,t.jsx)(U.CartesianGrid,{strokeDasharray:"3 3",stroke:"var(--hud-border)",vertical:!1}),(0,t.jsx)(Y.XAxis,{dataKey:"time",tick:{fill:"var(--hud-text-muted)",fontSize:10,fontWeight:900},axisLine:!1,tickLine:!1,interval:6}),(0,t.jsx)(E.YAxis,{tick:{fill:"var(--hud-text-muted)",fontSize:10,fontWeight:900},axisLine:!1,tickLine:!1,domain:["dataMin - 0.5","dataMax + 0.5"],tickFormatter:e=>Number(e).toFixed(1)}),(0,t.jsx)(H.Tooltip,{contentStyle:{backgroundColor:"var(--hud-bg)",border:"1px solid var(--hud-border)",borderRadius:"4px",fontSize:"11px",fontWeight:900,textTransform:"uppercase"},itemStyle:{color:N?s?"#ef4444":c.oGreen:s?"#ef4444":c.oBlue}}),(0,t.jsx)(O.Area,{type:"monotone",dataKey:"height",stroke:N?s?"#ef4444":c.oGreen:s?"#ef4444":c.oBlue,strokeWidth:2,fillOpacity:1,fill:"url(#colorTide)",isAnimationActive:!0,animationDuration:2e3}),h&&(0,t.jsx)(ep,{y:h,stroke:"var(--hud-border)",strokeDasharray:"4 4"})]})})}),(0,t.jsxs)("div",{className:"flex items-center justify-between shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("span",{className:"text-hud-muted text-xs font-black uppercase tracking-widest",children:e("widgets.high")}),(0,t.jsx)("span",{className:"text-hud-main font-black text-sm gliding-value",children:eb(f)||"--:--"}),(0,t.jsxs)("span",{className:"text-oGreen text-xs font-black",children:[(m||0).toFixed(1),"m"]})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("span",{className:"text-hud-muted text-xs font-black uppercase tracking-widest",children:e("widgets.low")}),(0,t.jsx)("span",{className:"text-hud-main font-black text-sm gliding-value",children:eb(p)||"--:--"}),(0,t.jsxs)("span",{className:"text-oBlue text-xs font-black",children:[(g||0).toFixed(1),"m"]})]})]})]})})}let eN=e=>null!=e?(0,C.convertTemperatureUnit)(e):null,ey=a.default.memo(()=>{var e;let s,{t:l}=(0,r.useTranslation)(),n=u.default.get("debugMode"),c=(0,a.useRef)({airTemp:null,seaTemp:null}),x=(0,o.useSignalKPath)("environment.outside.temperature"),h=(0,o.useSignalKPath)("environment.inside.lazarette.temperature"),m=x??h,g=(0,o.useSignalKPath)("environment.water.temperature"),{hasData:p,airTemp:f,seaTemp:v}=(0,a.useMemo)(()=>{if(!(null!==m||null!==g||n))return{hasData:!1};let e=null!==m?eN(m):n?21:null,t=null!==g?eN(g):n?17:null;return null!==e&&(c.current.airTemp=e),null!==t&&(c.current.seaTemp=t),{hasData:!0,airTemp:null!==e?e:c.current.airTemp,seaTemp:null!==t?t:c.current.seaTemp}},[m,g,n]);return(0,t.jsx)(d,{title:l("widgets.temperatureMonitoring"),icon:i.faThermometerHalf,hasData:p,noDataMessage:l("widgets.signalLossThermal"),children:(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-6 w-full",children:[(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black tracking-[0.2em] mb-3 opacity-60",children:l("widgets.atmosphereLabel")}),(0,t.jsx)("div",{className:"text-5xl font-black text-hud-main leading-none gliding-value tracking-tighter",children:null!==f?`${f}\xb0`:l("common.na")})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black tracking-[0.2em] mb-3 opacity-60",children:l("widgets.hydrosphere")}),(0,t.jsx)("div",{className:"text-5xl font-black text-hud-main leading-none gliding-value tracking-tighter",children:null!==v?`${v}\xb0`:l("common.na")})]})]})}),(0,t.jsx)("div",{className:"space-y-4 shrink-0",children:[{label:l("widgets.airSystem"),value:f},{label:l("widgets.seaSystem"),value:v}].map((e,a)=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center text-xs font-black uppercase tracking-widest text-hud-muted",children:[(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"text-hud-main opacity-80",children:null!==e.value?`${e.value}${(0,C.getTemperatureUnitLabel)()}`:l("widgets.offline")})]}),(0,t.jsx)("div",{className:"h-1 bg-hud-elevated rounded-full overflow-hidden shadow-inner",children:(0,t.jsx)("div",{className:`h-full transition-all duration-1000 ${null!==e.value&&e.value<10?"bg-oBlue":null!==e.value&&e.value>25?"bg-oRed":"bg-oGreen"}`,style:{width:`${null!==e.value?Math.min(100,Math.max(0,(e.value+10)*2)):0}%`}})})]},a))}),(0,t.jsxs)("div",{className:"flex justify-between items-center mt-4 shrink-0",children:[(0,t.jsx)("div",{className:`text-xs font-black uppercase tracking-[0.2em] ${null!==f&&null!==v?(e=(f+v)/2)<10?"text-oBlue":e>25?"text-oRed":"text-oGreen":"text-hud-muted"}`,children:null!==f&&null!==v?(s=(f+v)/2)<15?l("widgets.cold"):s>25?l("widgets.warm"):l("widgets.moderate"):l("widgets.systemStandby")}),(0,t.jsxs)("div",{className:"text-xs text-hud-secondary uppercase font-black tracking-widest",children:[l("widgets.delta")," ",(0,t.jsx)("span",{className:"text-hud-main gliding-value",children:null!==f&&null!==v?`${Math.abs(f-v).toFixed(1)}\xb0`:l("common.na")})]})]})]})})});ey.displayName="TemperatureWidget";var ek=e.i(75056),eM=e.i(43257),eS=e.i(30297),eD=e.i(66326),e$=e.i(32615);function eC(){let{t:e}=(0,r.useTranslation)(),{nightMode:s}=(0,c.useOcearoContext)(),[l,u]=(0,a.useState)(!0),x=(0,o.useSignalKPath)("navigation.headingTrue"),h=(0,o.useSignalKPath)("navigation.speedOverGround"),m=(0,o.useSignalKPath)("environment.wind.speedApparent"),g=(0,o.useSignalKPath)("environment.wind.angleApparent"),p=(0,o.useSignalKPath)("navigation.attitude.heel"),f=(0,o.useSignalKPath)("navigation.attitude.pitch"),v=(0,a.useMemo)(()=>({heading:Math.round((0,C.toDegrees)(x)||0),speed:null!==h?h:0,windSpeed:null!==m?m:0,windAngle:Math.round((0,C.toDegrees)(g)||0),heel:Math.round((0,C.toDegrees)(p)||0),pitch:Math.round((0,C.toDegrees)(f)||0)}),[x,h,m,g,p,f]);return(0,t.jsxs)(d,{title:e("widgets.boatView3D"),icon:i.faShip,hasData:!0,children:[(0,t.jsxs)("div",{className:"absolute top-4 right-4 z-10 flex items-center space-x-4",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faCompass,className:`${s?"text-oNight":"text-oYellow"} text-xs opacity-50`}),(0,t.jsxs)("span",{className:"text-hud-main text-xs font-black uppercase tracking-widest gliding-value",children:[Math.round(v.heading),"°"]})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2 border-l border-hud pl-4",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faWater,className:`${s?"text-oNight":"text-oBlue"} text-xs opacity-50`}),(0,t.jsxs)("span",{className:"text-hud-main text-xs font-black uppercase tracking-widest gliding-value",children:[(v.speed*C.MS_TO_KNOTS).toFixed(1)," kts"]})]})]}),(0,t.jsxs)("div",{className:"flex-1 relative rounded-sm overflow-hidden bg-hud-bg shadow-inner mt-2",children:[(0,t.jsx)(ek.Canvas,{camera:{position:[3,2,3],fov:45},className:"w-full h-full",dpr:[1,1.5],performance:{min:.5},onCreated:()=>u(!1),children:(0,t.jsxs)(a.Suspense,{fallback:null,children:[(0,t.jsx)(eS.OrbitControls,{enablePan:!1,minDistance:2,maxDistance:8,maxPolarAngle:Math.PI/2,target:[0,0,0]}),(0,t.jsx)(eM.Environment,{files:"./assets/ocearo_env.hdr",background:!1,intensity:.6,resolution:128}),(0,t.jsx)("ambientLight",{intensity:.8}),(0,t.jsx)("directionalLight",{position:[5,5,5],intensity:.6}),(0,t.jsxs)("group",{position:[0,-.5,0],scale:[.3,.3,.3],children:[(0,t.jsx)(eD.default,{position:[0,0,0],scale:[.7,.7,.7],showSail:!0,heel:v.heel,pitch:v.pitch}),(0,t.jsx)(e$.default,{visible:!0,position:[3,1,-1],scale:[.3,.3,.3]})]})]})}),(0,t.jsxs)("div",{className:"absolute top-2 left-2 flex flex-col space-y-1.5",children:[(0,t.jsxs)("div",{className:"bg-hud-bg backdrop-blur-md border border-hud rounded-sm px-2 py-1 text-xs font-black uppercase text-hud-main tracking-widest shadow-soft",children:[(0,t.jsx)("span",{className:`${s?"text-oNight":"text-oRed"} mr-2 opacity-60`,children:"HEEL:"}),(0,t.jsxs)("span",{className:"gliding-value",children:[Math.round(v.heel),"°"]})]}),(0,t.jsxs)("div",{className:"bg-hud-bg backdrop-blur-md border border-hud rounded-sm px-2 py-1 text-xs font-black uppercase text-hud-main tracking-widest shadow-soft",children:[(0,t.jsx)("span",{className:`${s?"text-oNight":"text-oBlue"} mr-2 opacity-60`,children:"PITCH:"}),(0,t.jsxs)("span",{className:"gliding-value",children:[Math.round(v.pitch),"°"]})]})]}),(0,t.jsxs)("div",{className:"absolute top-2 right-2 flex flex-col space-y-1.5 items-end",children:[(0,t.jsxs)("div",{className:"bg-hud-bg backdrop-blur-md border border-hud rounded-sm px-2 py-1 text-xs font-black uppercase text-hud-main tracking-widest shadow-soft",children:[(0,t.jsx)("span",{className:`${s?"text-oNight":"text-oYellow"} mr-2 opacity-60`,children:"WIND:"}),(0,t.jsxs)("span",{className:"gliding-value",children:[Math.round(v.windSpeed*C.MS_TO_KNOTS)," kts"]})]}),(0,t.jsxs)("div",{className:"bg-hud-bg backdrop-blur-md border border-hud rounded-sm px-2 py-1 text-xs font-black uppercase text-hud-main tracking-widest shadow-soft",children:[(0,t.jsx)("span",{className:"text-hud-muted mr-2 opacity-60",children:"ANGLE:"}),(0,t.jsxs)("span",{className:"gliding-value",children:[Math.round(v.windAngle),"°"]})]})]}),l&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-hud-bg text-hud-main backdrop-blur-xl",children:(0,t.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faShip,className:"text-3xl text-oBlue animate-soft-pulse"}),(0,t.jsx)("span",{className:"font-black uppercase tracking-[0.4em] text-xs text-hud-muted",children:e("widgets.initializingNode")})]})})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center mt-2 shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3 text-xs font-black uppercase tracking-widest",children:[(0,t.jsxs)("span",{className:"text-hud-main gliding-value",children:[Math.round(v.heading),"° ",(0,t.jsx)("span",{className:"text-hud-secondary",children:"HDG"})]}),(0,t.jsxs)("span",{className:"text-hud-main gliding-value",children:[(v.speed*C.MS_TO_KNOTS).toFixed(1)," ",(0,t.jsx)("span",{className:"text-hud-secondary",children:"KTS"})]})]}),(0,t.jsxs)("div",{className:`flex items-center space-x-1 ${s?"text-oNight":"text-oBlue"}`,children:[(0,t.jsx)("div",{className:`w-1 h-1 rounded-full ${s?"bg-oNight":"bg-oBlue"} animate-soft-pulse`}),(0,t.jsx)("span",{className:"text-xs font-black uppercase tracking-[0.2em]",children:e("widgets.telemetryLive")})]})]})]})}var eP=e.i(35637);function eT(){let{t:e}=(0,r.useTranslation)(),{nightMode:s}=(0,c.useOcearoContext)(),l=(0,a.useRef)(null),x=u.default.get("debugMode"),h=(0,o.useSignalKPath)("navigation.attitude"),m=(0,o.useSignalKPath)("navigation.headingTrue"),g=(0,a.useMemo)(()=>{if(null===h&&null===m&&!x)return{hasData:!1};let e=h||{roll:0,pitch:0,yaw:0},t=m||0;return{hasData:!0,roll:void 0!==e.roll&&(0,C.toDegrees)(e.roll)||0,pitch:void 0!==e.pitch&&(0,C.toDegrees)(e.pitch)||0,yaw:void 0!==e.yaw&&(0,C.toDegrees)(e.yaw)||0,heading:null!==t&&(0,C.toDegrees)(t)||0}},[h,m,x]);return(0,a.useEffect)(()=>{var e,t,a;let n=l.current;if(!n)return;let i=n.getContext("2d"),r=n.width,o=n.height,d=(()=>{if("u">typeof document){let e=getComputedStyle(document.documentElement);return{leftPaneBg:e.getPropertyValue("--color-leftPaneBg").trim()||"#0e0e0e",rightPaneBg:e.getPropertyValue("--color-rightPaneBg").trim()||"#1e1e1e"}}return{leftPaneBg:"#0e0e0e",rightPaneBg:"#1e1e1e"}})();e=g.roll,t=g.pitch,a=g.yaw,(0,eP.drawAttitudeInstrument)(i,{w:r,h:o,roll:e,pitch:t,yaw:a,nightMode:s,showBezel:!0,colors:{oBlue:c.oBlue,oRed:c.oRed,oYellow:c.oYellow,oGreen:c.oGreen,oNight:c.oNight,rightPaneBg:d.rightPaneBg}})},[g,s]),(0,t.jsxs)(d,{title:e("widgets.attitudeInertial"),icon:i.faCompass,hasData:g.hasData,noDataMessage:e("widgets.signalLossIMU"),children:[(0,t.jsxs)("div",{className:"absolute top-4 right-4 z-10 flex items-center space-x-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faCompass,className:`${s?"text-oNight":"text-oYellow"} text-xs opacity-50`}),(0,t.jsxs)("span",{className:`${s?"text-oNight":"text-hud-main"} text-xs font-black uppercase tracking-widest gliding-value`,children:[Math.round(g.heading),"°"]})]}),(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center min-h-0 scale-95 group transition-transform duration-700",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("canvas",{ref:l,width:220,height:220,className:`${s?"brightness-75 contrast-125":""} transition-all duration-700 group-hover:scale-105`}),(0,t.jsxs)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:[(0,t.jsx)("div",{className:`w-8 h-px ${s?"bg-oNight":"bg-oYellow/40"}`}),(0,t.jsx)("div",{className:`w-px h-8 ${s?"bg-oNight":"bg-oYellow/40"}`})]})]})}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-4 mt-4 text-center",children:[{label:"ROLL",value:g.roll,color:"text-oRed",icon:i.faPlane,rotate:90},{label:"PITCH",value:g.pitch,color:"text-oBlue",icon:i.faPlane,rotate:0},{label:"HDG",value:g.heading,color:"text-oYellow",icon:i.faCompass,rotate:0}].map((e,a)=>(0,t.jsxs)("div",{className:"tesla-card p-2 tesla-hover bg-hud-bg border border-hud",children:[(0,t.jsxs)("div",{className:"flex items-center justify-center space-x-2 mb-1 opacity-60",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:e.icon,className:`${s?"text-oNight":e.color} text-xs`,style:{transform:`rotate(${e.rotate}deg)`}}),(0,t.jsx)("span",{className:`${s?"text-oNight/60":"text-hud-muted"} uppercase text-xs font-black tracking-widest`,children:e.label})]}),(0,t.jsxs)("div",{className:`${s?"text-oNight":"text-hud-main"} font-black text-lg gliding-value tracking-tighter`,children:[Math.round(e.value),"°"]})]},a))})]})}function eF(){var e;let{t:s}=(0,r.useTranslation)(),l=u.default.get("debugMode"),c=(0,o.useSignalKPath)("environment.depth.belowKeel"),x=(0,o.useSignalKPath)("environment.depth.belowSurface"),h=(0,o.useSignalKPath)("environment.depth.belowTransducer"),m=(0,a.useMemo)(()=>{let e=c??h??(l?5.2:null),t=x??(null!==h?h+1.5:l?6.8:null);return null!==e||null!==t||l?{hasData:!0,belowKeel:null!==e?(0,C.convertDepthUnit)(e):null,belowSurface:null!==t?(0,C.convertDepthUnit)(t):null,depthUnitLabel:(0,C.getDepthUnitLabel)()}:{hasData:!1}},[c,x,h,l]),g=e=>e<2?"text-oRed":e<5?"text-oYellow":"text-oBlue";return(0,t.jsx)(d,{title:s("widgets.depth"),icon:i.faWater,hasData:m.hasData,noDataMessage:s("widgets.noDepthData"),children:(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[(0,t.jsxs)("div",{className:"text-center mb-6",children:[(0,t.jsxs)("div",{className:"text-5xl font-black text-hud-main leading-none gliding-value tracking-tighter",children:[null!==m.belowKeel?m.belowKeel:s("common.na"),null!==m.belowKeel&&(0,t.jsx)("span",{className:"text-xl text-hud-secondary ml-2 uppercase font-black tracking-widest",children:m.depthUnitLabel})]}),(0,t.jsx)("div",{className:`text-xs font-black uppercase tracking-[0.3em] mt-3 ${null!==m.belowKeel?g(m.belowKeel):"text-hud-muted"} ${null!==m.belowKeel&&m.belowKeel<5?"animate-soft-pulse":""}`,children:s(null!==m.belowKeel?(e=m.belowKeel)<2?"widgets.shallow":e<5?"widgets.caution":e<10?"widgets.safe":"widgets.deep":"widgets.offline")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-6",children:[(0,t.jsxs)("div",{className:"tesla-card p-3 text-center tesla-hover bg-hud-bg",children:[(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black tracking-widest mb-1 opacity-60",children:s("widgets.belowKeel")}),(0,t.jsx)("div",{className:`text-xl font-black gliding-value ${null!==m.belowKeel?g(m.belowKeel):"text-hud-muted"}`,children:null!==m.belowKeel?`${m.belowKeel} ${m.depthUnitLabel}`:s("common.na")})]}),(0,t.jsxs)("div",{className:"tesla-card p-3 text-center tesla-hover bg-hud-bg",children:[(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black tracking-widest mb-1 opacity-60",children:s("widgets.surface")}),(0,t.jsx)("div",{className:`text-xl font-black gliding-value ${null!==m.belowSurface?g(m.belowSurface):"text-hud-muted"}`,children:null!==m.belowSurface?`${m.belowSurface} ${m.depthUnitLabel}`:s("common.na")})]})]}),(0,t.jsx)("div",{className:"mb-6 px-2",children:(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faAnchor,className:"text-hud-muted text-xs opacity-50"}),(0,t.jsx)("div",{className:"flex-1 bg-hud-elevated rounded-full h-1 overflow-hidden shadow-inner",children:(0,t.jsx)("div",{className:`h-full transition-all duration-1000 ${null!==m.belowKeel?g(m.belowKeel).replace("text-","bg-"):"bg-hud-bg"}`,style:{width:`${null!==m.belowKeel?Math.min(100,m.belowKeel/50*100):0}%`}})}),(0,t.jsxs)("div",{className:"text-hud-muted text-xs font-black tracking-tighter",children:["50",m.depthUnitLabel]})]})}),(0,t.jsxs)("div",{className:"tesla-card p-3 bg-hud-bg space-y-2",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center text-xs font-black uppercase tracking-widest",children:[(0,t.jsx)("span",{className:"text-hud-secondary",children:s("widgets.hullClearance")}),(0,t.jsx)("span",{className:`gliding-value font-mono ${null!==m.belowKeel&&m.belowKeel<2?"text-oRed":"text-hud-main"}`,children:null!==m.belowKeel?`${Math.max(0,m.belowKeel-(0,C.convertDepthUnit)(1.5)).toFixed(1)} ${m.depthUnitLabel}`:s("common.na")})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center text-xs font-black uppercase tracking-widest",children:[(0,t.jsx)("span",{className:"text-hud-secondary",children:s("widgets.transducerOffset")}),(0,t.jsx)("span",{className:"text-hud-dim font-mono opacity-60",children:"1.5m"})]})]})]})})}var eA=e.i(62588);let eI=[1,2,5,10,20],eR=a.default.memo(()=>{let{t:e}=(0,r.useTranslation)(),{aisData:s,vesselIds:l}=(0,eA.useAIS)(),[c,x]=(0,a.useState)(5),h=u.default.get("debugMode"),m=(0,a.useCallback)(e=>{e.preventDefault(),x(t=>{let a=eI.indexOf(t);return -1===a?t:e.deltaY<0&&a>0?eI[a-1]:e.deltaY>0&&a<eI.length-1?eI[a+1]:t})},[]),g=(0,o.useSignalKPath)("navigation.position"),p=(0,o.useSignalKPath)("navigation.headingTrue"),f=(0,o.useSignalKPath)("navigation.headingMagnetic"),v=(0,o.useSignalKPath)("navigation.courseOverGroundTrue"),b=(0,o.useSignalKPath)("navigation.speedOverGround"),w=p??f??0,j=(0,a.useMemo)(()=>s&&0!==Object.keys(s).length&&g?l.filter(e=>e.distanceMeters&&e.distanceMeters<=1852*c).map(e=>{let t=e.distanceMeters/1852,a=180*Math.atan2(e.sceneX,-e.sceneZ)/Math.PI,s=function({rangeMeters:e,bearingRad:t,ownSog:a,ownCog:s,targetSog:l,targetCog:n}){if(![e,t,a,s,l,n].every(Number.isFinite))return null;let i=e*Math.sin(t),r=e*Math.cos(t),o=l*Math.sin(n)-a*Math.sin(s),c=l*Math.cos(n)-a*Math.cos(s),d=o*o+c*c;if(d<1e-9)return e/1852;let u=Math.max(0,-(i*o+r*c)/d);return Math.hypot(i+o*u,r+c*u)/1852}({rangeMeters:e.distanceMeters,bearingRad:(a+360)%360*Math.PI/180,ownSog:b,ownCog:v??w,targetSog:e.sog,targetCog:e.cog??e.cogMagnetic});return{id:e.mmsi,name:e.name||`MMSI ${e.mmsi}`,distance:Math.round(10*t)/10,bearing:Math.round((a+180+360)%360),type:e.shipType||"unknown",cpa:null===s?null:Math.round(10*s)/10}}).sort((e,t)=>e.distance-t.distance).slice(0,10):[],[s,l,c,g,w,v,b]),N=e=>null===e.cpa?e.distance<.5?"text-oYellow":"text-hud-secondary":e.cpa<.5?"text-oRed":e.cpa<1?"text-oYellow":"text-oGreen",y=h||j.length>0;return(0,t.jsxs)(d,{title:e("widgets.aisTacticalRadar"),icon:i.faTowerBroadcast,hasData:y,noDataMessage:e("widgets.signalLossAIS"),children:[(0,t.jsx)("div",{className:"absolute top-4 right-4 z-10",children:(0,t.jsxs)("select",{value:c,onChange:e=>x(Number(e.target.value)),className:"bg-hud-elevated text-hud-secondary text-xs font-black uppercase tracking-widest rounded-sm px-3 py-1 border border-hud shadow-soft focus:outline-none focus:ring-1 focus:ring-oBlue/50 hover:bg-hud-bg hover:text-hud-main transition-all duration-500",children:[(0,t.jsx)("option",{value:1,children:"1 NM"}),(0,t.jsx)("option",{value:2,children:"2 NM"}),(0,t.jsx)("option",{value:5,children:"5 NM"}),(0,t.jsx)("option",{value:10,children:"10 NM"}),(0,t.jsx)("option",{value:20,children:"20 NM"})]})}),(0,t.jsxs)("div",{className:"flex-1 relative min-h-0 bg-hud-bg rounded-sm overflow-hidden border border-hud shadow-inner group mt-2",onWheel:m,children:[(0,t.jsxs)("svg",{className:"w-full h-full p-2 transition-transform duration-700 group-hover:scale-[1.02]",viewBox:"0 0 200 200",children:[[1,2,3,4].map(e=>(0,t.jsx)("circle",{cx:"100",cy:"100",r:20*e,fill:"none",stroke:"var(--color-oBlue)",strokeOpacity:"0.1",strokeWidth:"0.5"},e)),(0,t.jsx)("line",{x1:"100",y1:"20",x2:"100",y2:"180",stroke:"var(--color-oBlue)",strokeOpacity:"0.05",strokeWidth:"0.5"}),(0,t.jsx)("line",{x1:"20",y1:"100",x2:"180",y2:"100",stroke:"var(--color-oBlue)",strokeOpacity:"0.05",strokeWidth:"0.5"}),(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:"100",y1:"100",x2:"100",y2:"20",stroke:"var(--color-oGreen)",strokeWidth:"1",strokeOpacity:"0.4"}),(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 100 100",to:"360 100 100",dur:"3s",repeatCount:"indefinite"})]}),j.map(e=>{let a=e.distance/c*80,s=100+a*Math.cos((e.bearing-90)*Math.PI/180),l=100+a*Math.sin((e.bearing-90)*Math.PI/180),n=null!==e.cpa&&e.cpa<.5;return(0,t.jsxs)("g",{className:n?"animate-soft-pulse":"",children:[(0,t.jsx)("circle",{cx:s,cy:l,r:n?"3":"2",fill:n?"var(--color-oRed)":null!==e.cpa&&e.cpa<1?"var(--color-oYellow)":"var(--color-oGreen)",className:"transition-all duration-1000"}),(0,t.jsx)("text",{x:s+5,y:l-5,fill:"currentColor",fontSize:"5",className:"font-black pointer-events-none uppercase tracking-tighter opacity-60 text-hud-main",children:e.name.substring(0,8)})]},e.id)}),(0,t.jsx)("polygon",{points:"100,95 105,105 100,102 95,105",fill:"var(--color-oBlue)",stroke:"currentColor",strokeWidth:"0.5",opacity:"0.8",className:"text-hud-main"})]}),(0,t.jsxs)("div",{className:"absolute top-2 left-2 text-xs text-hud-muted font-black pointer-events-none uppercase tracking-widest space-y-1",children:[(0,t.jsxs)("div",{className:"bg-hud-bg/40 px-1.5 py-0.5 rounded-sm",children:[e("widgets.range")," ",c," NM"]}),(0,t.jsxs)("div",{className:"bg-hud-bg/40 px-1.5 py-0.5 rounded-sm",children:[e("widgets.targets")," ",j.length]})]})]}),j.length>0&&(0,t.jsxs)("div",{className:"mt-4 space-y-2",children:[(0,t.jsx)("div",{className:"text-xs text-hud-muted font-black uppercase tracking-[0.2em] px-1",children:e("widgets.tacticalAnalysis")}),j.slice(0,2).map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs tesla-card bg-hud-bg px-3 py-2 border border-hud tesla-hover",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3 min-w-0",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:(e=>{switch(e){case"cargo":case"fishing":return i.faShip;default:return i.faLocationDot}})(e.type),className:`${N(e)} text-xs opacity-80 ${null!==e.cpa&&e.cpa<.5?"animate-soft-pulse":""}`}),(0,t.jsx)("span",{className:"text-hud-main truncate font-black uppercase tracking-tight",children:e.name})]}),(0,t.jsxs)("div",{className:"flex space-x-4 text-hud-secondary font-black tracking-tighter",children:[(0,t.jsxs)("span",{className:"gliding-value",children:[e.distance.toFixed(1)," NM"]}),(0,t.jsxs)("span",{className:`${N(e)} gliding-value`,children:["CPA: ",null===e.cpa?"--":e.cpa.toFixed(1)]})]})]},e.id))]})]})});function eW(){var e;let{t:s}=(0,r.useTranslation)(),l=u.default.get("debugMode"),c=(0,o.useSignalKPaths)(["electrical.batteries.1.voltage","electrical.batteries.0.voltage","electrical.batteries.1.current","electrical.batteries.0.current"]),x=(0,a.useMemo)(()=>{let e=c["electrical.batteries.1.voltage"],t=c["electrical.batteries.0.voltage"],a=c["electrical.batteries.1.current"],s=c["electrical.batteries.0.current"],n={voltage:null,current:null,percentage:null};if(!(null!==e||null!==t||l))return{hasData:!1,house:n,starter:n};let i=e||(l?12.6:null),r=t||(l?12.4:null),o=a||(l?-2.3:null),d=s||(l?.1:null);return{hasData:!0,house:{voltage:i?Math.round(10*i)/10:null,current:o?Math.round(10*o)/10:null,percentage:i?Math.min(100,Math.max(0,(i-11.8)/1*100)):null},starter:{voltage:r?Math.round(10*r)/10:null,current:d?Math.round(10*d)/10:null,percentage:r?Math.min(100,Math.max(0,(r-11.8)/1*100)):null}}},[c,l]),h=e=>e>75?i.faBatteryFull:e>25?i.faBatteryHalf:i.faBatteryQuarter,m=e=>e<20?"text-oRed":e<50?"text-oYellow":"text-oGreen";return(0,t.jsx)(d,{title:s("widgets.energyStorage"),icon:i.faBolt,hasData:x.hasData,noDataMessage:s("widgets.signalLossPowerGrid"),children:(0,t.jsxs)("div",{className:"flex-1 flex flex-col justify-center py-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-8",children:[(0,t.jsxs)("div",{className:"text-center tesla-card p-3 tesla-hover bg-hud-bg",children:[(0,t.jsx)("div",{className:"text-hud-muted text-xs uppercase mb-2 font-black tracking-widest",children:s("widgets.serviceBank")}),(0,t.jsxs)("div",{className:"flex items-center justify-center space-x-3 mb-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:h(x.house.percentage||0),className:`text-sm ${null!==x.house.percentage?m(x.house.percentage):"text-hud-muted"} ${x.house.percentage<20?"animate-soft-pulse":""}`}),(0,t.jsx)("div",{className:"text-hud-main text-2xl font-black leading-none gliding-value tracking-tighter",children:null!==x.house.voltage?`${x.house.voltage}V`:s("common.na")})]}),(0,t.jsx)("div",{className:`text-xs font-black uppercase tracking-widest ${null!==x.house.percentage?m(x.house.percentage):"text-hud-muted"}`,children:null!==x.house.percentage?`${Math.round(x.house.percentage)}%`:s("widgets.offline")}),(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black tracking-widest mt-2",children:null!==x.house.current?`${x.house.current>0?"+":""}${x.house.current}A`:"—"})]}),(0,t.jsxs)("div",{className:"text-center tesla-card p-3 tesla-hover bg-hud-bg",children:[(0,t.jsx)("div",{className:"text-hud-muted text-xs uppercase mb-2 font-black tracking-widest",children:s("widgets.ignitionBank")}),(0,t.jsxs)("div",{className:"flex items-center justify-center space-x-3 mb-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:h(x.starter.percentage||0),className:`text-sm ${null!==x.starter.percentage?m(x.starter.percentage):"text-hud-muted"} ${x.starter.percentage<20?"animate-soft-pulse":""}`}),(0,t.jsx)("div",{className:"text-hud-main text-2xl font-black leading-none gliding-value tracking-tighter",children:null!==x.starter.voltage?`${x.starter.voltage}V`:s("common.na")})]}),(0,t.jsx)("div",{className:`text-xs font-black uppercase tracking-widest ${null!==x.starter.percentage?m(x.starter.percentage):"text-hud-muted"}`,children:null!==x.starter.percentage?`${Math.round(x.starter.percentage)}%`:s("widgets.offline")}),(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black tracking-widest mt-2",children:null!==x.starter.current?`${x.starter.current>0?"+":""}${x.starter.current}A`:"—"})]})]}),(0,t.jsx)("div",{className:"space-y-6 mb-8 px-2",children:[{label:s("widgets.serviceCap"),percentage:x.house.percentage},{label:s("widgets.ignitionCap"),percentage:x.starter.percentage}].map((e,a)=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center text-xs font-black uppercase tracking-widest text-hud-muted",children:[(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"text-hud-main opacity-80",children:null!==e.percentage?`${Math.round(e.percentage)}%`:s("widgets.offline")})]}),(0,t.jsx)("div",{className:"h-1 bg-hud-elevated rounded-full overflow-hidden shadow-inner",children:(0,t.jsx)("div",{className:`h-full transition-all duration-1000 ${null!==e.percentage&&e.percentage<20?"bg-oRed shadow-[0_0_8px_var(--color-oRed)]":null!==e.percentage&&e.percentage<50?"bg-oYellow":"bg-oGreen"}`,style:{width:`${null!==e.percentage?e.percentage:0}%`}})})]},a))}),(0,t.jsxs)("div",{className:"tesla-card p-3 bg-hud-bg tesla-hover border border-hud",children:[(0,t.jsx)("div",{className:`text-xs font-black uppercase tracking-[0.2em] text-center mb-3 ${null!==x.house.percentage&&null!==x.starter.percentage?m(Math.min(x.house.percentage,x.starter.percentage)):"text-hud-muted"} ${null!==x.house.percentage&&null!==x.starter.percentage&&20>Math.min(x.house.percentage,x.starter.percentage)?"animate-soft-pulse":""}`,children:null!==x.house.percentage&&null!==x.starter.percentage?`${(e=Math.min(x.house.percentage,x.starter.percentage))<20?s("widgets.batteryCritical"):e<50?s("widgets.batteryLow"):e<80?s("widgets.batteryGood"):s("widgets.batteryExcellent")} ${s("widgets.health")}`:s("widgets.analyzingCells")}),(0,t.jsxs)("div",{className:"flex justify-between items-center text-xs font-black uppercase tracking-widest text-hud-secondary",children:[(0,t.jsxs)("span",{children:[s("widgets.gridLoad")," ",(0,t.jsx)("span",{className:"text-hud-main ml-1 gliding-value",children:null!==x.house.current&&null!==x.starter.current?`${Math.abs(x.house.current+x.starter.current).toFixed(1)}A`:"—"})]}),(0,t.jsx)("span",{className:"text-hud-dim",children:s("widgets.operatingRange")})]})]})]})})}function eG(){let{t:e}=(0,r.useTranslation)(),s=(0,o.useSignalKPaths)(["tanks.fuel.0.currentLevel","tanks.fuel.0.capacity","tanks.fuel.0.name","tanks.fuel.0.type","tanks.fuel.0.temperature","tanks.freshWater.0.currentLevel","tanks.freshWater.0.capacity","tanks.freshWater.0.name","tanks.freshWater.0.type","tanks.freshWater.0.temperature","tanks.wasteWater.0.currentLevel","tanks.wasteWater.0.capacity","tanks.wasteWater.0.name","tanks.wasteWater.0.type","tanks.wasteWater.0.temperature","tanks.oil.0.currentLevel","tanks.oil.0.capacity","tanks.oil.0.name","tanks.oil.0.type","tanks.oil.0.temperature"]),l=(0,a.useMemo)(()=>{let t=(e,t,a,l,n)=>({level:s[`tanks.${e}.0.currentLevel`]??null,capacity:s[`tanks.${e}.0.capacity`]??null,tankName:s[`tanks.${e}.0.name`],tankType:s[`tanks.${e}.0.type`],temperature:s[`tanks.${e}.0.temperature`],icon:a,color:l,bgColor:n,displayName:t}),a={fuel:t("fuel",e("widgets.tankFuel"),i.faGasPump,"text-oYellow","bg-oYellow"),freshWater:t("freshWater",e("widgets.tankFreshWater"),i.faTint,"text-oBlue","bg-oBlue"),wasteWater:t("wasteWater",e("widgets.tankWasteWater"),i.faToilet,"text-hud-secondary","bg-hud-elevated"),oil:t("oil",e("widgets.tankEngineOil"),i.faOilCan,"text-oYellow","bg-oYellow")};return{hasData:Object.values(a).some(e=>null!==e.level),...a}},[s,e]);return(0,t.jsx)(d,{title:e("widgets.storageSystems"),icon:i.faGasPump,hasData:l.hasData,noDataMessage:e("widgets.signalLossLevelSensors"),children:(0,t.jsx)("div",{className:"flex-1 flex flex-col justify-center min-h-0 space-y-4",children:Object.entries(l).filter(([e])=>"hasData"!==e).map(([e,a])=>{if(null===a.level||null===a.capacity)return null;let s=Math.round(100*a.level),l=Math.round(a.level*a.capacity),i="wasteWater"===e,r=i?a.level>.8:a.level<.1;return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)("div",{className:"flex items-center justify-center w-6 h-6 bg-hud-elevated rounded-full",children:(0,t.jsx)(n.FontAwesomeIcon,{icon:a.icon,className:`${a.color} text-xs opacity-80`})}),(0,t.jsx)("span",{className:"text-hud-main text-xs font-black uppercase tracking-widest",children:a.displayName})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsxs)("span",{className:"text-hud-secondary text-xs font-black opacity-60",children:[l,"/",a.capacity,"L"]}),(0,t.jsxs)("span",{className:`text-sm font-black ${((e,t=!1)=>t?e>.8?"text-oRed":e>.6?"text-oYellow":"text-oGreen":e<.1?"text-oRed":e<.25?"text-oYellow":"text-oGreen")(a.level,i)} ${r?"animate-soft-pulse":""}`,children:[s,"%"]})]})]}),(0,t.jsx)("div",{className:"bg-hud-elevated rounded-full h-1.5 overflow-hidden shadow-inner",children:(0,t.jsx)("div",{className:`h-full transition-all duration-1000 ${i?a.level>.8?"bg-oRed":a.level>.6?"bg-oYellow":"bg-oGreen":a.level<.1?"bg-oRed":a.level<.25?"bg-oYellow":"bg-oGreen"}`,style:{width:`${s}%`}})})]},e)})})})}function eL(){var e,s,l;let{t:c}=(0,r.useTranslation)(),x=u.default.get("debugMode"),h=(0,o.useSignalKPath)("environment.outside.visibility"),m=(0,a.useMemo)(()=>{if(!(null!==h||x))return{hasData:!1};let e=h||(x?8e3:null);return{hasData:!0,distance:null!==e?Math.round(e/100)/10:null,distanceNM:null!==e?Math.round(e/1852*10)/10:null}},[h,x]),g=e=>e<1?"text-oRed":e<2||e<5?"text-oYellow":e<10?"text-oBlue":"text-oGreen";return(0,t.jsx)(d,{title:c("widgets.atmosphericVisibility"),icon:i.faEye,hasData:m.hasData,noDataMessage:c("widgets.signalLossOptical"),children:(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[(0,t.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center",children:[(0,t.jsx)("div",{className:`text-5xl mb-4 ${g(m.distance)}`,children:(0,t.jsx)(n.FontAwesomeIcon,{icon:(e=m.distance)<2?i.faSmog:e<10?i.faCloud:i.faSun,className:m.distance<10?"animate-soft-pulse":""})}),(0,t.jsxs)("div",{className:"text-5xl font-black text-hud-main leading-none gliding-value tracking-tighter",children:[m.distance,(0,t.jsx)("span",{className:"text-xl text-hud-secondary ml-2 uppercase font-black tracking-widest",children:"km"})]}),(0,t.jsx)("div",{className:`text-xs font-black uppercase tracking-[0.3em] mt-3 ${g(m.distance)}`,children:c((s=m.distance)<1?"widgets.denseFog":s<2?"widgets.thickFog":s<5?"widgets.moderateFog":s<10?"widgets.lightHaze":s<20?"widgets.visGood":"widgets.visExcellent")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4 shrink-0",children:[(0,t.jsxs)("div",{className:"tesla-card p-3 text-center tesla-hover bg-hud-bg",children:[(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black tracking-widest mb-1 opacity-60",children:c("widgets.metricRange")}),(0,t.jsxs)("div",{className:`text-xl font-black gliding-value ${g(m.distance)}`,children:[m.distance," km"]})]}),(0,t.jsxs)("div",{className:"tesla-card p-3 text-center tesla-hover bg-hud-bg",children:[(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black tracking-widest mb-1 opacity-60",children:c("widgets.nauticalRange")}),(0,t.jsxs)("div",{className:`text-xl font-black gliding-value ${g(m.distance)}`,children:[m.distanceNM," NM"]})]})]}),(0,t.jsxs)("div",{className:"shrink-0 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)("div",{className:"text-hud-muted text-xs font-black tracking-tighter",children:"0"}),(0,t.jsx)("div",{className:"flex-1 bg-hud-elevated rounded-full h-1 overflow-hidden shadow-inner",children:(0,t.jsx)("div",{className:`h-full transition-all duration-1000 ${m.distance<1?"bg-oRed":m.distance<5?"bg-oYellow":m.distance<10?"bg-oBlue":"bg-oGreen"}`,style:{width:`${Math.min(100,m.distance/20*100)}%`}})}),(0,t.jsx)("div",{className:"text-hud-muted text-xs font-black tracking-tighter",children:"20k+"})]}),(0,t.jsx)("div",{className:"text-center text-hud-main font-black text-xs uppercase tracking-widest opacity-60",children:c((l=m.distance)<.05?"widgets.extremelyDenseFog":l<.2?"widgets.veryDenseFog":l<.5?"widgets.denseFog":l<1?"widgets.thickFog":l<2?"widgets.moderateFog":l<4?"widgets.lightFog":l<10?"widgets.mistOrHaze":l<20?"widgets.slightHaze":l<40?"widgets.clear":"widgets.veryClear")})]})]})})}eR.displayName="AISRadarWidget";var eB=e.i(83934);function eK(){var e;let{t:s}=(0,r.useTranslation)(),l=u.default.get("debugMode"),{forecasts:o,isLoading:c,weatherApiAvailable:x,fetchWeatherForecast:h,getCurrentWeather:m}=(0,eB.useWeather)(),g=(0,a.useMemo)(()=>{let e=m();o.length>0&&o[0];let t=(0,C.convertTemperatureUnit)(e.temperature),a=null!==(0,C.finite)(e.humidity)?Math.round(100*e.humidity):null,s=null!==(0,C.convertPressure)(e.pressure)?Math.round(e.pressure/100):null,n=(0,C.convertSpeedUnit)(e.windSpeed),i=(0,C.toDegrees)(e.windDirection),r=e.description,c=e.source,d=null!==t||null!==a||null!==s||null!==n;if(!d&&!l)return{hasData:!1,dataSource:null};let u=t,x=a,h=s,g=n,p=i;!d&&l&&(u=15,x=65,h=1013,g=5.2,p=120,c="debug");let f="sunny";if(r){let e=r.toLowerCase();e.includes("rain")||e.includes("shower")?f="rainy":e.includes("snow")?f="snow":e.includes("cloud")||e.includes("overcast")?f="cloudy":e.includes("partly")||e.includes("few clouds")?f="partly-cloudy":(e.includes("clear")||e.includes("sun"))&&(f="sunny")}else h&&(f=h<1e3?x&&x>80?"rainy":"cloudy":h>1020?"sunny":"partly-cloudy");return{hasData:!0,dataSource:c,description:r,temperature:u,humidity:x,pressure:h,windSpeed:g,windDirection:p,condition:f,forecast:o}},[m,o,l]),p=e=>{switch(e){case"sunny":return i.faSun;case"partly-cloudy":default:return i.faCloudSun;case"cloudy":return i.faCloud;case"rainy":return i.faCloudRain;case"heavy-rain":return i.faCloudShowersHeavy;case"snow":return i.faSnowflake}},f=e=>{switch(e){case"sunny":return"text-oYellow";case"partly-cloudy":case"rainy":case"heavy-rain":default:return"text-oBlue";case"cloudy":return"text-hud-muted";case"snow":return"text-hud-main"}},v=e=>null===(0,C.finite)(e)?"":["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][(Math.round(e/22.5)%16+16)%16];return g.hasData&&((e=g.pressure)>1020?s("widgets.pressureRising"):e<1e3?s("widgets.pressureFalling"):s("widgets.pressureStable")),(0,t.jsxs)(d,{title:s("widgets.meteorologicalData"),icon:p(g.condition),hasData:g.hasData,noDataMessage:c?s("widgets.acquiringSatellite"):s("widgets.signalLossWeather"),children:[(0,t.jsxs)("div",{className:"absolute top-4 right-4 z-10 flex items-center space-x-3",children:[g.dataSource&&(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-sm uppercase font-black tracking-widest text-hud-main shadow-soft ${"sensors"===g.dataSource?"bg-oGreen/40 border border-oGreen/30":"forecast"===g.dataSource?"bg-oBlue/40 border border-oBlue/30":"bg-hud-elevated border border-hud"}`,children:(()=>{switch(g.dataSource){case"sensors":return s("widgets.dataSourceLive");case"forecast":return s("widgets.dataSourceForecast");case"debug":return s("widgets.dataSourceDemo");default:return""}})()}),!1!==x&&(0,t.jsx)("button",{onClick:h,disabled:c,className:"w-7 h-7 rounded-full bg-hud-elevated flex items-center justify-center text-hud-secondary hover:text-hud-main transition-all duration-500 tesla-hover",title:s("widgets.updateForecast"),children:(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faSync,className:`text-xs ${c?"animate-spin":""}`})})]}),(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[(0,t.jsx)("div",{className:"flex-1 flex flex-col justify-center",children:(0,t.jsxs)("div",{className:"text-center mb-6 group",children:[(0,t.jsx)("div",{className:`text-5xl mb-4 transition-transform duration-700 group-hover:scale-110 ${f(g.condition)}`,children:(0,t.jsx)(n.FontAwesomeIcon,{icon:p(g.condition),className:"sunny"!==g.condition?"animate-soft-pulse":""})}),(0,t.jsx)("div",{className:"text-5xl font-black text-hud-main leading-none gliding-value tracking-tighter",children:null!==g.temperature?`${g.temperature}${(0,C.getTemperatureUnitLabel)()}`:s("common.na")}),(0,t.jsx)("div",{className:"text-xs font-black text-hud-secondary uppercase tracking-[0.3em] mt-3 opacity-60",children:g.description||(e=>{switch(e){case"sunny":return s("widgets.clearSkies");case"partly-cloudy":return s("widgets.partlyCloudy");case"cloudy":return s("widgets.overcast");case"rainy":return s("widgets.lightRain");case"heavy-rain":return s("widgets.heavyRain");case"snow":return s("widgets.snow");default:return s("widgets.variable")}})(g.condition)})]})}),g.forecast&&g.forecast.length>1&&(0,t.jsx)("div",{className:"space-y-2 shrink-0",children:g.forecast.slice(1,4).map((e,a)=>{let s=new Date(e.date?e.date:Date.now()+(a+1)*864e5),l=isNaN(s.getTime())?e.time||`+${a+1}d`:s.toLocaleDateString("en-GB",{weekday:"short"}),r=e.description?e.description.toLowerCase().includes("rain")?"rainy":e.description.toLowerCase().includes("cloud")?"cloudy":e.description.toLowerCase().includes("snow")?"snow":"sunny":"partly-cloudy",o=null!==(0,C.finite)(e.wind?.speed)?Math.round(10*e.wind.speed)/10:null,c=v(e.wind?.direction)||null;return(0,t.jsxs)("div",{className:"flex items-center justify-between py-1.5 border-b border-hud/30 last:border-0",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)("span",{className:"text-hud-muted text-xs font-black uppercase tracking-widest w-8",children:l}),(0,t.jsx)(n.FontAwesomeIcon,{icon:p(r),className:`text-sm w-5 ${f(r)}`}),(0,t.jsx)("span",{className:"text-hud-main text-sm font-black gliding-value w-8",children:null!==e.temperature?`${Math.round(e.temperature)}\xb0`:"--"})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faWind,className:"text-oBlue text-xs opacity-50"}),(0,t.jsx)("span",{className:"text-hud-main text-xs font-black gliding-value",children:null!==o?`${o} ${(0,C.getSpeedUnitLabel)()}`:"--"}),c&&(0,t.jsx)("span",{className:"text-hud-muted text-xs font-black tracking-widest opacity-60",children:c})]})]},a)})}),(0,t.jsxs)("div",{className:"flex items-center justify-between shrink-0 mt-2",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faWind,className:"text-oBlue text-sm opacity-50"}),(0,t.jsx)("span",{className:"text-hud-secondary text-xs uppercase font-black tracking-widest",children:s("widgets.now")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("span",{className:"text-hud-main text-sm font-black gliding-value tracking-tight",children:null!==g.windSpeed?`${g.windSpeed} ${(0,C.getSpeedUnitLabel)()}`:s("common.na")}),(0,t.jsx)("span",{className:"text-hud-muted text-xs uppercase font-black tracking-widest ml-2 opacity-60",children:null!==g.windDirection?v(g.windDirection):""})]})]})]})]})}let eO=a.default.memo(()=>{var e;let{t:s}=(0,r.useTranslation)(),l=u.default.get("debugMode"),c=(0,o.useSignalKPath)("navigation.speedOverGround"),x=(0,o.useSignalKPath)("navigation.speedThroughWater"),h=(0,o.useSignalKPath)("navigation.headingTrue"),m=(0,o.useSignalKPath)("navigation.courseOverGroundTrue"),g=(0,o.useSignalKPath)("environment.wind.speedApparent"),p=(0,a.useMemo)(()=>{if(!(null!==c||null!==x||l))return{hasData:!1};let e=c||(l?5.2:null),t=x||(l?4.8:null),a=h||(l?.52:null),s=m||(l?.61:null),n=g||(l?12.5:null);return{hasData:!0,sog:(0,C.convertSpeedUnit)(e),stw:(0,C.convertSpeedUnit)(t),heading:(0,C.toDegrees)(a),cog:(0,C.toDegrees)(s),windSpeed:(0,C.convertSpeedUnit)(n),drift:null!==(0,C.finite)(e)&&null!==(0,C.finite)(t)?(0,C.convertSpeedUnit)(e-t):null,speedUnitLabel:(0,C.getSpeedUnitLabel)()}},[c,x,h,m,g,l]),f=e=>e<2?"text-hud-secondary":e<5?"text-oBlue":e<8?"text-oGreen":"text-oYellow";return(0,t.jsx)(d,{title:s("widgets.speed"),icon:i.faTachometerAlt,hasData:p.hasData,noDataMessage:s("widgets.noSpeedData"),children:(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[(0,t.jsxs)("div",{className:"flex-1 flex flex-col justify-center",children:[(0,t.jsxs)("div",{className:"text-center mb-6",children:[(0,t.jsxs)("div",{className:"text-5xl font-black text-hud-main leading-none gliding-value tracking-tighter",children:[null!==p.sog?p.sog:s("common.na"),null!==p.sog&&(0,t.jsx)("span",{className:"text-xl text-hud-secondary ml-2 uppercase font-black tracking-widest",children:p.speedUnitLabel})]}),(0,t.jsx)("div",{className:`text-xs font-black uppercase tracking-[0.3em] mt-3 ${null!==p.sog?f(p.sog):"text-hud-muted"}`,children:s(null!==p.sog?(e=p.sog)<1?"widgets.stationary":e<3?"widgets.slow":e<6?"widgets.moderate":e<10?"widgets.fast":"widgets.veryFast":"widgets.offline")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-3",children:[(0,t.jsxs)("div",{className:"tesla-card p-2 text-center tesla-hover bg-hud-bg",children:[(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black tracking-widest opacity-60",children:"SOG"}),(0,t.jsx)("div",{className:`text-xl font-black gliding-value ${null!==p.sog?f(p.sog):"text-hud-muted"}`,children:null!==p.sog?p.sog:"--"})]}),(0,t.jsxs)("div",{className:"tesla-card p-2 text-center tesla-hover bg-hud-bg",children:[(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black tracking-widest opacity-60",children:"STW"}),(0,t.jsx)("div",{className:`text-xl font-black gliding-value ${null!==p.stw?f(p.stw):"text-hud-muted"}`,children:null!==p.stw?p.stw:"--"})]}),(0,t.jsxs)("div",{className:"tesla-card p-2 text-center tesla-hover bg-hud-bg",children:[(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black tracking-widest opacity-60",children:"HDG"}),(0,t.jsx)("div",{className:"text-hud-main text-xl font-black gliding-value",children:null!==p.heading?`${p.heading}\xb0`:"--"})]}),(0,t.jsxs)("div",{className:"tesla-card p-2 text-center tesla-hover bg-hud-bg",children:[(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black tracking-widest opacity-60",children:"COG"}),(0,t.jsx)("div",{className:"text-hud-main text-xl font-black gliding-value",children:null!==p.cog?`${p.cog}\xb0`:"--"})]})]})]}),(0,t.jsx)("div",{className:"mb-4 shrink-0",children:(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)("div",{className:"text-hud-muted text-xs font-black tracking-tighter",children:"0"}),(0,t.jsx)("div",{className:"flex-1 bg-hud-elevated rounded-full h-1 overflow-hidden shadow-inner",children:(0,t.jsx)("div",{className:`h-full transition-all duration-1000 ${p.sog<2?"bg-hud-bg":p.sog<5?"bg-oBlue":p.sog<8?"bg-oGreen":"bg-oYellow"}`,style:{width:`${null!==p.sog?Math.min(100,p.sog/15*100):0}%`}})}),(0,t.jsx)("div",{className:"text-hud-muted text-xs font-black tracking-tighter",children:"15+"})]})}),(0,t.jsx)("div",{className:"tesla-card p-3 bg-hud-bg tesla-hover shrink-0",children:(0,t.jsxs)("div",{className:"flex justify-between items-center text-xs font-black uppercase tracking-widest",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("span",{className:"text-hud-secondary",children:s("widgets.driftEffect")}),(0,t.jsx)("span",{className:`gliding-value ${null!==p.drift&&p.drift>0?"text-oGreen":null!==p.drift&&p.drift<0?"text-oRed":"text-hud-muted"}`,children:null!==p.drift?`${p.drift>0?"+":""}${p.drift} ${p.speedUnitLabel}`:s("common.na")})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faWind,className:"text-oBlue text-xs opacity-50"}),(0,t.jsx)("span",{className:"text-hud-main gliding-value",children:null!==p.windSpeed?`${p.windSpeed} ${p.speedUnitLabel}`:s("common.na")})]})]})})]})})});eO.displayName="SpeedWidget";let eY=a.default.memo(()=>{let{t:e}=(0,r.useTranslation)(),[s,l]=(0,a.useState)(new Date);(0,a.useEffect)(()=>{let e=setInterval(()=>l(new Date),1e3);return()=>clearInterval(e)},[]);let{nightMode:u}=(0,c.useOcearoContext)(),x=(0,o.useSignalKPath)("navigation.position.latitude",.7854),h=(0,o.useSignalKPath)("navigation.position.longitude",.1396),m=(180*x/Math.PI).toFixed(4),g=(180*h/Math.PI).toFixed(4),p=new Date(s.getTime()),f=Math.round(12*h/Math.PI),v=new Date(p.getTime()+60*f*6e4),b=(e,t=!0)=>{let a={hour:"2-digit",minute:"2-digit",...t&&{second:"2-digit"},hour12:!1};return e.toLocaleTimeString("en-GB",a)},w=s.getHours(),j=w>=6&&w<18,N=new Date(s);N.setHours(6,30,0,0);let y=new Date(s);return y.setHours(18,45,0,0),(0,t.jsx)(d,{title:e("widgets.temporalNode"),icon:i.faClock,hasData:!0,children:(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[(0,t.jsxs)("div",{className:"flex-1 flex flex-col justify-center",children:[(0,t.jsxs)("div",{className:"text-center group mb-6",children:[(0,t.jsx)("div",{className:"text-6xl font-black text-hud-main leading-none font-mono tracking-tighter gliding-value",children:b(s)}),(0,t.jsx)("div",{className:"text-hud-secondary text-xs font-black uppercase tracking-[0.3em] mt-4 opacity-60",children:s.toLocaleDateString("en-GB",{weekday:"long",year:"numeric",month:"long",day:"numeric"})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"tesla-card p-4 tesla-hover bg-hud-bg",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3 mb-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faGlobe,className:"text-oBlue text-xs opacity-50"}),(0,t.jsx)("span",{className:"text-hud-muted text-xs font-black uppercase tracking-widest",children:e("widgets.localSync")})]}),(0,t.jsx)("div",{className:"text-hud-main font-mono font-black text-xl gliding-value",children:b(v,!1)})]}),(0,t.jsxs)("div",{className:"tesla-card p-4 tesla-hover bg-hud-bg",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3 mb-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faGlobe,className:"text-hud-muted text-xs opacity-50"}),(0,t.jsx)("span",{className:"text-hud-muted text-xs font-black uppercase tracking-widest",children:e("widgets.utcClock")})]}),(0,t.jsx)("div",{className:"text-hud-main font-mono font-black text-xl gliding-value",children:b(p,!1)})]})]})]}),(0,t.jsxs)("div",{className:"shrink-0 space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:j?i.faSun:i.faMoon,className:j?"text-oYellow text-lg":u?"text-oNight text-lg":"text-oBlue text-lg"}),(0,t.jsx)("span",{className:"text-hud-main text-xs font-black uppercase tracking-widest",children:e(j?"widgets.diurnalPhase":"widgets.nocturnalPhase")})]}),(0,t.jsxs)("span",{className:"text-hud-muted text-xs font-black font-mono opacity-60",children:[j?"☀":"☾"," ",b(j?y:N,!1)]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs font-black uppercase opacity-60",children:[(0,t.jsxs)("span",{className:"text-hud-muted",children:[(0,t.jsx)("span",{className:"tracking-widest",children:"LAT"})," ",(0,t.jsxs)("span",{className:"text-hud-main font-mono",children:[m,"°"]})]}),(0,t.jsxs)("span",{className:"text-hud-muted",children:[(0,t.jsx)("span",{className:"tracking-widest",children:"LON"})," ",(0,t.jsxs)("span",{className:"text-hud-main font-mono",children:[g,"°"]})]})]})]})]})})});eY.displayName="TimeWidget";var eE=e.i(66799);let eU=(0,a.createContext)(),eH=({children:e})=>{(0,o.useSignalKPath)("navigation.position");let[s,l]=(0,a.useState)({}),[n,i]=(0,a.useState)({}),[r,c]=(0,a.useState)({}),[d,u]=(0,a.useState)(!1),[x,h]=(0,a.useState)(null),[m,g]=(0,a.useState)(null),[p,f]=(0,a.useState)(null),[v,b]=(0,a.useState)(!1),[w,j]=(0,a.useState)(null),N=(0,a.useRef)(null),y=(0,a.useRef)(null),k=(0,a.useCallback)(async()=>{u(!0),h(null);try{let[e,t,a]=await Promise.all([eE.default.getRoutes().catch(e=>("NetworkError"!==e.name&&console.error("NavigationContext: Failed to fetch routes:",e),{})),eE.default.getWaypoints().catch(e=>("NetworkError"!==e.name&&console.error("NavigationContext: Failed to fetch waypoints:",e),{})),eE.default.getCharts().catch(e=>("NetworkError"!==e.name&&console.error("NavigationContext: Failed to fetch charts:",e),{}))]);l(e||{}),i(t||{}),c(a||{})}catch(e){"NetworkError"!==e.name&&(console.error("NavigationContext: Failed to fetch resources:",e),h(e.message))}finally{u(!1)}},[]),M=(0,a.useCallback)(async()=>{try{let e=await eE.default.getRoutes();return l(e||{}),e}catch(e){throw console.error("NavigationContext: Failed to fetch routes:",e),e}},[]),S=(0,a.useCallback)(async()=>{try{let e=await eE.default.getWaypoints();return i(e||{}),e}catch(e){throw console.error("NavigationContext: Failed to fetch waypoints:",e),e}},[]),D=(0,a.useCallback)(async()=>{try{let[e,t]=await Promise.all([eE.default.getCourse().catch(()=>null),eE.default.getCourseCalculations().catch(()=>null)]);g(e),f(t)}catch(e){console.error("NavigationContext: Failed to fetch course:",e),j(e.message)}},[]),$=(0,a.useCallback)(async e=>{b(!0),j(null);try{await eE.default.setDestinationWaypoint(e),await D()}catch(e){throw console.error("NavigationContext: Failed to set waypoint destination:",e),j(e.message),e}finally{b(!1)}},[D]),C=(0,a.useCallback)(async(e,t)=>{b(!0),j(null);try{await eE.default.setDestinationPosition(e,t),await D()}catch(e){throw console.error("NavigationContext: Failed to set position destination:",e),j(e.message),e}finally{b(!1)}},[D]),P=(0,a.useCallback)(async(e,t=0,a=!1)=>{b(!0),j(null);try{await eE.default.activateRoute(e,t,a),await D()}catch(e){throw console.error("NavigationContext: Failed to activate route:",e),j(e.message),e}finally{b(!1)}},[D]),T=(0,a.useCallback)(async()=>{b(!0),j(null);try{await eE.default.clearCourse(),g(null),f(null)}catch(e){throw console.error("NavigationContext: Failed to clear course:",e),j(e.message),e}finally{b(!1)}},[]),F=(0,a.useCallback)(async()=>{try{await eE.default.nextWaypoint(),await D()}catch(e){throw console.error("NavigationContext: Failed to go to next waypoint:",e),e}},[D]),A=(0,a.useCallback)(async()=>{try{await eE.default.previousWaypoint(),await D()}catch(e){throw console.error("NavigationContext: Failed to go to previous waypoint:",e),e}},[D]),I=(0,a.useCallback)(async(e,t,a,s="")=>{try{let l=eE.default.generateUUID(),n=eE.default.createWaypointFeature(t,e,a,s);return await eE.default.saveWaypoint(l,n),await S(),l}catch(e){throw console.error("NavigationContext: Failed to create waypoint:",e),e}},[S]),R=(0,a.useCallback)(async e=>{try{await eE.default.deleteWaypoint(e),await S()}catch(e){throw console.error("NavigationContext: Failed to delete waypoint:",e),e}},[S]),W=(0,a.useCallback)(async(e,t,a="")=>{try{let s=eE.default.generateUUID(),l=e.map(e=>[e.longitude,e.latitude]),n=eE.default.createRouteFeature(l,t,a);return await eE.default.saveRoute(s,n),await M(),s}catch(e){throw console.error("NavigationContext: Failed to create route:",e),e}},[M]),G=(0,a.useCallback)(async e=>{try{await eE.default.deleteRoute(e),await M()}catch(e){throw console.error("NavigationContext: Failed to delete route:",e),e}},[M]),L=(0,a.useCallback)(e=>{let t=s[e];return t?eE.default.parseRouteCoordinates(t):[]},[s]),B=(0,a.useCallback)(e=>{let t=n[e];return t?eE.default.parseWaypointPosition(t):null},[n]),K=(0,a.useCallback)(()=>Object.entries(s).map(([e,t])=>({id:e,name:t.name||"Unnamed Route",description:t.description||"",pointCount:t.feature?.geometry?.coordinates?.length||0})),[s]),O=(0,a.useCallback)(()=>Object.entries(n).map(([e,t])=>{let a=eE.default.parseWaypointPosition(t);return{id:e,name:t.name||"Unnamed Waypoint",description:t.description||"",latitude:a?.latitude,longitude:a?.longitude}}),[n]),Y=(0,a.useCallback)(()=>m?.nextPoint?.position!=null||m?.activeRoute?.href!=null,[m]),E=(0,a.useCallback)(()=>m?{position:m.nextPoint?.position,waypointHref:m.nextPoint?.href,routeHref:m.activeRoute?.href,pointIndex:m.activeRoute?.pointIndex,isRoute:!!m.activeRoute?.href,arrivalCircle:m.arrivalCircle}:null,[m]);return(0,a.useEffect)(()=>(k(),D(),N.current=setInterval(()=>{D()},5e3),y.current=setInterval(()=>{k()},3e5),()=>{N.current&&clearInterval(N.current),y.current&&clearInterval(y.current)}),[k,D]),(0,t.jsx)(eU.Provider,{value:{routes:s,waypoints:n,charts:r,isLoadingResources:d,resourcesError:x,activeCourse:m,courseCalculations:p,isLoadingCourse:v,courseError:w,fetchResources:k,fetchRoutes:M,fetchWaypoints:S,fetchCourse:D,navigateToWaypoint:$,navigateToPosition:C,activateRoute:P,clearCourse:T,goToNextWaypoint:F,goToPreviousWaypoint:A,createWaypoint:I,deleteWaypoint:R,createRoute:W,deleteRoute:G,getRouteCoordinates:L,getWaypointPosition:B,getRoutesList:K,getWaypointsList:O,hasActiveDestination:Y,getDestinationInfo:E},children:e})};function e_(){var e,s;let{t:l}=(0,r.useTranslation)(),{activeCourse:c,courseCalculations:x,waypoints:h,routes:m,isLoadingCourse:g,navigateToWaypoint:p,activateRoute:f,clearCourse:v,goToNextWaypoint:b,goToPreviousWaypoint:w,getWaypointsList:j,getRoutesList:N,hasActiveDestination:y}=(()=>{let e=(0,a.useContext)(eU);if(!e)throw Error("useNavigation must be used within a NavigationContextProvider");return e})(),k=u.default.get("debugMode"),M=(0,o.useSignalKPath)("navigation.courseGreatCircle.nextPoint.distance"),S=(0,o.useSignalKPath)("navigation.courseGreatCircle.nextPoint.bearingTrue"),D=(0,o.useSignalKPath)("navigation.courseGreatCircle.crossTrackError"),$=(0,o.useSignalKPath)("navigation.courseGreatCircle.velocityMadeGood"),P=(0,o.useSignalKPath)("steering.autopilot.state"),T=(0,o.useSignalKPath)("steering.autopilot.mode"),F=(0,o.useSignalKPath)("steering.autopilot.target.headingTrue"),[A,I]=(0,a.useState)(!1),[R,W]=(0,a.useState)(!1),G=a.default.useMemo(()=>x?{hasData:!0,distance:x.distance,bearingTrue:x.bearingTrue,bearingMagnetic:x.bearingMagnetic,crossTrackError:x.crossTrackError,velocityMadeGood:x.velocityMadeGood,timeToGo:x.timeToGo,estimatedTimeOfArrival:x.estimatedTimeOfArrival,calcMethod:x.calcMethod}:null!==M||null!==S||k?{hasData:!0,distance:M||(k?5e3:null),bearingTrue:S||(k?.52:null),crossTrackError:D||(k?50:null),velocityMadeGood:$||(k?5.5:null),timeToGo:null,estimatedTimeOfArrival:null}:{hasData:!1},[x,M,S,D,$,k]),L=async e=>{try{await p(e),I(!1)}catch(e){console.error("Failed to navigate to waypoint:",e)}},B=async e=>{try{await f(e),W(!1)}catch(e){console.error("Failed to activate route:",e)}},K=j(),O=N(),Y=y();return(0,t.jsxs)(d,{title:l("widgets.course"),icon:i.faRoute,iconColorClass:"text-oGreen",hasData:G.hasData||Y||K.length>0||O.length>0,noDataMessage:l("widgets.noCourseData"),children:[(0,t.jsxs)("div",{className:"absolute top-4 right-4 z-10 flex space-x-2",children:[(0,t.jsx)("button",{onClick:()=>{I(!A),W(!1)},className:`w-8 h-8 rounded-full flex items-center justify-center transition-all duration-500 shadow-soft ${A?"bg-oGreen text-hud-main":"bg-hud-elevated text-hud-secondary tesla-hover"}`,title:l("widgets.waypoints"),children:(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faLocationDot,className:"text-xs"})}),(0,t.jsx)("button",{onClick:()=>{W(!R),I(!1)},className:`w-8 h-8 rounded-full flex items-center justify-center transition-all duration-500 shadow-soft ${R?"bg-oGreen text-hud-main":"bg-hud-elevated text-hud-secondary tesla-hover"}`,title:l("widgets.routes"),children:(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faList,className:"text-xs"})})]}),(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[A&&(0,t.jsxs)("div",{className:"mb-4 max-h-40 overflow-y-auto tesla-card bg-hud-bg p-2 space-y-1",children:[(0,t.jsx)("div",{className:"text-xs text-hud-muted mb-2 uppercase font-black tracking-[0.2em] px-2 pt-1",children:l("widgets.storedWaypoints")}),0===K.length?(0,t.jsx)("div",{className:"text-xs text-hud-secondary italic px-2 py-4 text-center font-black uppercase",children:l("widgets.noActiveNodes")}):K.map(e=>(0,t.jsxs)("button",{onClick:()=>L(e.id),className:"w-full text-left p-2 tesla-hover rounded-sm text-xs text-hud-main flex items-center group font-black uppercase tracking-tight",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faLocationDot,className:"text-oYellow mr-3 text-xs opacity-50 group-hover:opacity-100"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]},e.id))]}),R&&(0,t.jsxs)("div",{className:"mb-4 max-h-40 overflow-y-auto tesla-card bg-hud-bg p-2 space-y-1",children:[(0,t.jsx)("div",{className:"text-xs text-hud-muted mb-2 uppercase font-black tracking-[0.2em] px-2 pt-1",children:l("widgets.missionRoutes")}),0===O.length?(0,t.jsx)("div",{className:"text-xs text-hud-secondary italic px-2 py-4 text-center font-black uppercase",children:l("widgets.noRoutesLoaded")}):O.map(e=>(0,t.jsxs)("button",{onClick:()=>B(e.id),className:"w-full text-left p-2 tesla-hover rounded-sm text-xs text-hud-main flex items-center justify-between group font-black uppercase tracking-tight",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faRoute,className:"text-oGreen mr-3 text-xs opacity-50 group-hover:opacity-100"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]}),(0,t.jsxs)("span",{className:"text-xs text-hud-muted font-black",children:[e.pointCount," pts"]})]},e.id))]}),Y&&(0,t.jsxs)("div",{className:"tesla-card bg-oYellow/5 p-4 mb-6 shadow-subtle border-l-2 border-oYellow/30 animate-soft-pulse",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faCrosshairs,className:"text-oYellow text-sm"}),(0,t.jsx)("span",{className:"text-hud-main text-xs font-black uppercase tracking-widest truncate",children:(()=>{if(!c)return l("widgets.noDestination");if(c.activeRoute?.href){let e=m[c.activeRoute.href.split("/").pop()],t=c.activeRoute.pointIndex||0;return e?.name?`${e.name} (${t+1})`:l("widgets.activeRoute")}if(c.nextPoint?.href){let e=h[c.nextPoint.href.split("/").pop()];return e?.name||l("widgets.waypoint")}if(c.nextPoint?.position){let e=c.nextPoint.position;return`${e.latitude?.toFixed(4)}\xb0, ${e.longitude?.toFixed(4)}\xb0`}return l("widgets.noDestination")})()})]}),(0,t.jsx)("button",{onClick:v,className:"text-hud-secondary hover:text-oRed transition-colors p-1",title:l("widgets.abortNavigation"),children:(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faTimes,className:"text-sm"})})]}),c?.activeRoute?.href&&(0,t.jsxs)("div",{className:"flex justify-center space-x-3 mt-4",children:[(0,t.jsxs)("button",{onClick:w,className:"bg-hud-elevated hover:bg-hud-bg text-hud-main px-4 py-1.5 rounded text-xs font-black uppercase tracking-widest transition-all shadow-soft",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faArrowLeft,className:"mr-2"}),l("widgets.previous")]}),(0,t.jsxs)("button",{onClick:b,className:"bg-oBlue hover:bg-oBlue/80 text-hud-main px-4 py-1.5 rounded text-xs font-black uppercase tracking-widest transition-all shadow-lg shadow-oBlue/20",children:[l("widgets.proceed"),(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faArrowRight,className:"ml-2"})]})]})]}),P&&(0,t.jsxs)("div",{className:`tesla-card px-3 py-2 mb-3 bg-hud-bg flex items-center justify-between ${"enabled"===P?"border-l-2 border-oGreen/30":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faRobot,className:`text-xs ${"enabled"===P?"text-oGreen":"text-hud-muted"}`}),(0,t.jsx)("span",{className:`text-xs font-black uppercase capitalize gliding-value ${"enabled"===P?"text-oGreen":"text-hud-secondary"}`,children:P})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-4 text-xs font-black uppercase",children:[(0,t.jsx)("span",{className:"text-hud-main capitalize gliding-value",children:T||"—"}),(0,t.jsx)("span",{className:"text-oYellow gliding-value",children:null!==F?`${Math.round((0,C.toDegrees)(F))}\xb0`:"—"})]})]}),G.hasData&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"tesla-card p-4 text-center tesla-hover bg-hud-bg",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faRuler,className:"text-oGreen text-xs mb-2 opacity-50"}),(0,t.jsx)("div",{className:"text-hud-main text-2xl font-black gliding-value tracking-tighter",children:null==(e=G.distance)?l("common.na"):e<1e3?`${Math.round(e)} m`:`${(0,C.convertDistanceUnit)(e)} ${(0,C.getDistanceUnitLabel)()}`}),(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black mt-2 tracking-[0.2em]",children:l("widgets.distance")})]}),(0,t.jsxs)("div",{className:"tesla-card p-4 text-center tesla-hover bg-hud-bg",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faCompass,className:"text-oBlue text-xs mb-2 opacity-50"}),(0,t.jsx)("div",{className:"text-hud-main text-2xl font-black gliding-value tracking-tighter",children:null!==G.bearingTrue?`${Math.round((0,C.toDegrees)(G.bearingTrue))}\xb0`:l("common.na")}),(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black mt-2 tracking-[0.2em]",children:l("widgets.bearing")})]}),(0,t.jsxs)("div",{className:"tesla-card p-4 text-center tesla-hover bg-hud-bg",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faArrowRight,className:`${G.crossTrackError>50||G.crossTrackError<-50?"text-oRed animate-soft-pulse":"text-oGreen opacity-50"} text-xs mb-2`}),(0,t.jsx)("div",{className:"text-hud-main text-2xl font-black gliding-value tracking-tighter",children:null!==G.crossTrackError?`${Math.abs(Math.round(G.crossTrackError))}m`:l("common.na")}),(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black mt-2 tracking-[0.2em]",children:"XTE"})]}),(0,t.jsxs)("div",{className:"tesla-card p-4 text-center tesla-hover bg-hud-bg",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faPlay,className:"text-oGreen text-xs mb-2 opacity-50"}),(0,t.jsxs)("div",{className:"text-hud-main text-2xl font-black gliding-value tracking-tighter",children:[null!==G.velocityMadeGood?`${(0,C.convertSpeedUnit)(G.velocityMadeGood)}`:l("common.na"),(0,t.jsx)("span",{className:"text-xs text-hud-secondary ml-1",children:(0,C.getSpeedUnitLabel)()})]}),(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black mt-2 tracking-[0.2em]",children:"VMG"})]}),null!==G.timeToGo&&(0,t.jsxs)("div",{className:"tesla-card p-4 text-center tesla-hover bg-hud-bg",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faClock,className:"text-oGreen text-xs mb-2 opacity-50"}),(0,t.jsx)("div",{className:"text-hud-main text-2xl font-black gliding-value tracking-tighter",children:(e=>{if(null==e)return l("common.na");let t=Math.floor(e/3600),a=Math.floor(e%3600/60);return t>0?`${t}h ${a}m`:`${a}m`})(G.timeToGo)}),(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black mt-2 tracking-[0.2em]",children:"TTG"})]}),G.estimatedTimeOfArrival&&(0,t.jsxs)("div",{className:"tesla-card p-4 text-center tesla-hover bg-hud-bg",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faClock,className:"text-oYellow text-xs mb-2 opacity-50"}),(0,t.jsx)("div",{className:"text-hud-main text-2xl font-black gliding-value tracking-tighter",children:(s=G.estimatedTimeOfArrival)?new Date(s).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):l("common.na")}),(0,t.jsx)("div",{className:"text-hud-secondary text-xs uppercase font-black mt-2 tracking-[0.2em]",children:"ETA"})]})]})]})]})}let ez=a.default.memo(({children:e,widgetName:a,className:l="",fullscreenWidget:r,toggleFullscreen:o})=>(0,t.jsxs)(s.motion.div,{layout:!0,variants:{hidden:{opacity:0,y:20},show:{opacity:1,y:0}},transition:{duration:.5,ease:[.4,0,.2,1]},className:`relative group ${l}`,children:[e,(0,t.jsx)("button",{onClick:()=>o(a),className:"absolute top-3 right-3 opacity-0 group-hover:opacity-100 transition-all duration-500 bg-hud-bg backdrop-blur-md hover:bg-hud-elevated rounded-full w-8 h-8 flex items-center justify-center text-hud-muted hover:text-hud-main z-10 shadow-soft",title:r===a?"Exit fullscreen":"Fullscreen",children:(0,t.jsx)(n.FontAwesomeIcon,{icon:r===a?i.faCompress:i.faExpand,className:"text-xs"})})]}));ez.displayName="WidgetWrapper";let eq={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}};e.s(["default",0,function(){let{t:e}=(0,r.useTranslation)(),[o,c]=(0,a.useState)("environment"),[d,u]=(0,a.useState)(null),x=a.default.useCallback(e=>{u(t=>t===e?null:e)},[]),h=a.default.useMemo(()=>(0,t.jsxs)(s.motion.div,{variants:eq,initial:"hidden",animate:"show",className:`${d?"flex h-full":"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4 h-full auto-rows-fr"}`,children:[(0,t.jsx)(ez,{widgetName:"temperature",fullscreenWidget:d,toggleFullscreen:x,className:d&&"temperature"!==d?"hidden":"temperature"===d?"w-full h-full":"",children:(0,t.jsx)(ey,{})}),(0,t.jsx)(ez,{widgetName:"weather",fullscreenWidget:d,toggleFullscreen:x,className:d&&"weather"!==d?"hidden":"weather"===d?"w-full h-full":"",children:(0,t.jsx)(eK,{})}),(0,t.jsx)(ez,{widgetName:"tide",fullscreenWidget:d,toggleFullscreen:x,className:d&&"tide"!==d?"hidden":"tide"===d?"w-full h-full":"",children:(0,t.jsx)(ej,{})}),(0,t.jsx)(ez,{widgetName:"visibility",fullscreenWidget:d,toggleFullscreen:x,className:d&&"visibility"!==d?"hidden":"visibility"===d?"w-full h-full":"",children:(0,t.jsx)(eL,{})}),(0,t.jsx)(ez,{widgetName:"airquality",fullscreenWidget:d,toggleFullscreen:x,className:d&&"airquality"!==d?"hidden":"airquality"===d?"w-full h-full":"",children:(0,t.jsx)(B,{})}),(0,t.jsx)(ez,{widgetName:"pressure",fullscreenWidget:d,toggleFullscreen:x,className:d&&"pressure"!==d?"hidden":"pressure"===d?"w-full h-full":"",children:(0,t.jsx)(P,{})})]}),[d,x]),m=a.default.useMemo(()=>(0,t.jsxs)(s.motion.div,{variants:eq,initial:"hidden",animate:"show",className:`${d?"flex h-full":"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4 h-full auto-rows-fr"}`,children:[(0,t.jsx)(ez,{widgetName:"boat3d",fullscreenWidget:d,toggleFullscreen:x,className:d&&"boat3d"!==d?"hidden":"boat3d"===d?"w-full h-full":"",children:(0,t.jsx)(eC,{})}),(0,t.jsx)(ez,{widgetName:"attitude",fullscreenWidget:d,toggleFullscreen:x,className:d&&"attitude"!==d?"hidden":"attitude"===d?"w-full h-full":"",children:(0,t.jsx)(eT,{})}),(0,t.jsx)(ez,{widgetName:"speed",fullscreenWidget:d,toggleFullscreen:x,className:d&&"speed"!==d?"hidden":"speed"===d?"w-full h-full":"",children:(0,t.jsx)(eO,{})}),(0,t.jsx)(ez,{widgetName:"depth",fullscreenWidget:d,toggleFullscreen:x,className:d&&"depth"!==d?"hidden":"depth"===d?"w-full h-full":"",children:(0,t.jsx)(eF,{})}),(0,t.jsx)(ez,{widgetName:"aisradar",fullscreenWidget:d,toggleFullscreen:x,className:d&&"aisradar"!==d?"hidden":"aisradar"===d?"w-full h-full":"",children:(0,t.jsx)(eA.AISProvider,{children:(0,t.jsx)(eR,{})})}),(0,t.jsx)(ez,{widgetName:"course",fullscreenWidget:d,toggleFullscreen:x,className:d&&"course"!==d?"hidden":"course"===d?"w-full h-full":"",children:(0,t.jsx)(eH,{children:(0,t.jsx)(e_,{})})})]}),[d,x]),g=a.default.useMemo(()=>(0,t.jsxs)(s.motion.div,{variants:eq,initial:"hidden",animate:"show",className:`${d?"flex h-full":"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4 h-full auto-rows-fr"}`,children:[(0,t.jsx)(ez,{widgetName:"battery",fullscreenWidget:d,toggleFullscreen:x,className:d&&"battery"!==d?"hidden":"battery"===d?"w-full h-full":"",children:(0,t.jsx)(eW,{})}),(0,t.jsx)(ez,{widgetName:"tanks",fullscreenWidget:d,toggleFullscreen:x,className:d&&"tanks"!==d?"hidden":"tanks"===d?"w-full h-full":"",children:(0,t.jsx)(eG,{})}),(0,t.jsx)(ez,{widgetName:"humidity",fullscreenWidget:d,toggleFullscreen:x,className:d&&"humidity"!==d?"hidden":"humidity"===d?"w-full h-full":"",children:(0,t.jsx)($,{})}),(0,t.jsx)(ez,{widgetName:"uvindex",fullscreenWidget:d,toggleFullscreen:x,className:d&&"uvindex"!==d?"hidden":"uvindex"===d?"w-full h-full":"",children:(0,t.jsx)(y,{})}),(0,t.jsx)(ez,{widgetName:"sunrise",fullscreenWidget:d,toggleFullscreen:x,className:d&&"sunrise"!==d?"hidden":"sunrise"===d?"w-full h-full":"",children:(0,t.jsx)(N,{})}),(0,t.jsx)(ez,{widgetName:"time",fullscreenWidget:d,toggleFullscreen:x,className:d&&"time"!==d?"hidden":"time"===d?"w-full h-full":"",children:(0,t.jsx)(eY,{})})]}),[d,x]),p=a.default.useMemo(()=>{switch(o){case"environment":default:return h;case"navigation":return m;case"system":return g}},[o,h,m,g]);return(0,t.jsxs)("div",{className:"flex flex-col h-full bg-rightPaneBg overflow-hidden",children:[(0,t.jsx)("div",{className:"flex border-b border-hud bg-hud-bg",children:[{id:"environment",label:e("dashboard.environment"),icon:i.faLeaf},{id:"navigation",label:e("dashboard.navigation"),icon:i.faCompass},{id:"system",label:e("dashboard.systems"),icon:i.faCog}].map(e=>(0,t.jsxs)("button",{onClick:()=>c(e.id),className:`flex-1 py-3 px-2 text-xs font-black uppercase flex items-center justify-center transition-all duration-500 ${o===e.id?"text-oGreen border-b-2 border-oGreen bg-hud-bg":"text-hud-secondary hover:text-hud-main tesla-hover"}`,children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:e.icon,className:"mr-2"}),e.label]},e.id))}),(0,t.jsx)("div",{className:"flex-1 p-4 min-h-0 overflow-auto scrollbar-hide",children:(0,t.jsx)(l.AnimatePresence,{mode:"wait",children:(0,t.jsx)(s.motion.div,{initial:{opacity:0,x:10},animate:{opacity:1,x:0},exit:{opacity:0,x:-10},transition:{duration:.4,ease:"easeOut"},className:"h-full",children:p},o)})})]})}],54784)},25294,e=>{e.n(e.i(54784))}]);
|