ocearo-ui 2.0.0 → 2.0.2
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 +27 -3
- package/README.md +27 -3
- package/__next.__PAGE__.txt +3 -3
- package/__next._full.txt +4 -4
- package/__next._tree.txt +2 -2
- package/_next/static/chunks/0m7wbuocx-b4_.js +9 -0
- package/_next/static/chunks/0voiofm58khqd.js +1 -0
- package/_next/static/chunks/{3xjnsskh0tayo.js → 15imr2-f_8n-x.js} +1 -1
- package/_next/static/chunks/{32j_j396qs7be.js → 18_i6mf6hb_c7.js} +1 -1
- package/_next/static/chunks/{1fzzb4jtgv5gg.js → 1gt2hhqk1821k.js} +2 -2
- package/_next/static/chunks/{3ktj0iemsr1m-.js → 1pa1cfmfts0i9.js} +1 -1
- package/_next/static/chunks/1zm03hw2ylxw8.js +1 -0
- package/_next/static/chunks/2dvwb-mfasp68.js +1 -0
- package/_next/static/chunks/2kwn4iymxaom3.js +1 -0
- package/_next/static/chunks/2ryo_bbmt6t74.css +3 -0
- package/_next/static/chunks/{0oaqe70syw_b5.js → 2s6w3x5jnc2tg.js} +1 -1
- package/_next/static/chunks/{34_oyzp8_pi_m.js → 2w44atvyp9o_w.js} +1 -1
- package/_next/static/chunks/{0yiqocv54ogoq.js → 3p9ziqn6r35qf.js} +1 -1
- package/_next/static/chunks/{31lugryguappr.js → 3q8o52_juxmdp.js} +1 -1
- package/_next/static/chunks/3wwn1rti8oc_r.js +1 -0
- package/_not-found/__next._full.txt +3 -3
- package/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/_not-found/__next._tree.txt +2 -2
- package/_not-found.html +1 -1
- package/_not-found.txt +3 -3
- package/apple-touch-icon.png +0 -0
- package/favicon-96x96.png +0 -0
- package/favicon.ico +0 -0
- package/favicon.svg +1 -3
- package/icons/favicon-16x16.png +0 -0
- package/icons/favicon-32x32.png +0 -0
- package/icons/favicon-48x48.png +0 -0
- package/icons/icon-192x192.png +0 -0
- package/icons/icon-512x512.png +0 -0
- package/icons/ocearo.webp +0 -0
- package/index.html +1 -1
- package/index.txt +4 -4
- package/manifest.json +2 -3
- package/package.json +6 -7
- package/settings/__next._full.txt +3 -3
- package/settings/__next._tree.txt +2 -2
- package/settings/__next.settings.__PAGE__.txt +2 -2
- package/settings.html +1 -1
- package/settings.txt +3 -3
- package/_next/static/chunks/01atsfq_4opab.js +0 -1
- package/_next/static/chunks/0cx639tthxlz4.js +0 -1
- package/_next/static/chunks/0zlk2mlkvbtj1.js +0 -1
- package/_next/static/chunks/1gaiqhzy_0d7s.js +0 -1
- package/_next/static/chunks/2r_h93rt76vka.js +0 -1
- package/_next/static/chunks/2y3d8zopa8r5r.css +0 -3
- package/_next/static/chunks/3k5itcabq5oqs.js +0 -9
- /package/_next/static/{baa0rBM5TIECz8JV_tLT6 → _UKzzvfzAh-9NIsngWWio}/_buildManifest.js +0 -0
- /package/_next/static/{baa0rBM5TIECz8JV_tLT6 → _UKzzvfzAh-9NIsngWWio}/_clientMiddlewareManifest.js +0 -0
- /package/_next/static/{baa0rBM5TIECz8JV_tLT6 → _UKzzvfzAh-9NIsngWWio}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,91440,e=>{"use strict";var t=e.i(43476),a=e.i(71645),o=e.i(46932),i=e.i(88653);e.i(67561);var s=e.i(46991),n=e.i(85709),l=e.i(66799),d=e.i(83402),r=e.i(48390),c=e.i(49721),u=e.i(68757);e.i(85269);var p=e.i(22831);let g=["compass","wind","gps","route"],m=({label:e,button:o,onChange:i,primaryTextClass:s,secondaryTextClass:n})=>{let[l,d]=(0,a.useState)(!1);return(0,t.jsxs)("div",{className:"flex items-center justify-between py-2",children:[(0,t.jsx)("span",{className:`text-label ${s}`,children:e}),l?(0,t.jsx)("select",{value:o,onChange:e=>{i(e.target.value),d(!1)},onBlur:()=>d(!1),autoFocus:!0,className:"bg-hud-elevated text-hud-main rounded px-2 py-1 text-label border border-hud focus:border-oGreen/50 focus:outline-none transition-all",children:["X","Circle","Square","Triangle","L1","R1","L2","R2","D-Pad Up","D-Pad Down","D-Pad Left","D-Pad Right","Left Stick Up","Left Stick Down","Left Stick Left","Left Stick Right","Right Stick Up","Right Stick Down","Right Stick Left","Right Stick Right","L3","R3","Options","Share","PS"].map(e=>(0,t.jsx)("option",{value:e,children:e},e))}):(0,t.jsx)("button",{onClick:()=>d(!0),className:`px-3 py-1 bg-hud-elevated rounded text-label ${n} hover:bg-hud-bg border border-hud transition-all`,children:o})]})};e.s(["default",0,function(){var e;let h,{t:x}=(0,p.useTranslation)(),b=d.default.get("debugMode"),f=(0,a.useMemo)(()=>["navigation.headingTrue","navigation.headingMagnetic","environment.wind.angleApparent","steering.rudderAngle","steering.autopilot.state","steering.autopilot.mode","steering.autopilot.engaged","steering.autopilot.target","steering.autopilot.target.headingTrue","steering.autopilot.target.windAngleApparent"],[]),v=(0,n.useSignalKPaths)(f),j=v["navigation.headingTrue"]??v["navigation.headingMagnetic"],y=v["environment.wind.angleApparent"],N=v["steering.rudderAngle"],[C,w]=(0,a.useState)("control"),T="text-hud-main",A="text-hud-secondary",$="text-hud-muted",[k,S]=(0,a.useState)(null),[R,P]=(0,a.useState)([]),[G,L]=(0,a.useState)("_default"),[D,M]=(0,a.useState)(!0),[I,F]=(0,a.useState)(null),[B,O]=(0,a.useState)(null),[Y,E]=(0,a.useState)(!1),U=a.default.useRef(v);U.current=v;let H=(0,a.useCallback)(async()=>{try{let e=await l.default.getAutopilotDevices(),t=e.length>0;if(P(e),!t){let e=U.current,t=e["steering.autopilot.state"],a=e["steering.autopilot.mode"],o=e["steering.autopilot.target.headingTrue"]||e["steering.autopilot.target.windAngleApparent"];F(b?null:t?x("autopilot.providerMissingButDetected"):x("autopilot.providerMissing")),S({state:t??(b?"standby":"off-line"),mode:a??(b?"compass":null),target:o??(b?1.57:null),engaged:e["steering.autopilot.engaged"]??!1});return}let a=e.includes(G)||"_default"===G?G:e[0];a!==G&&L(a);let o=await l.default.getAutopilotData(a);S(o),F(null)}catch(e){console.error("AutopilotView: Failed to fetch autopilot data:",e),F(e.message)}finally{M(!1)}},[G,b,x]),W=(0,a.useCallback)(async()=>{try{let e=await (0,r.makeOcearoCoreApiCall)("/api/controller/config");O(e),E(e?.connected||!1)}catch(e){console.warn("AutopilotView: Could not fetch controller config:",e.message),O(null)}},[]);(0,a.useEffect)(()=>{H(),W();let e=setInterval(()=>{H()},5e3);return()=>clearInterval(e)},[H,W]);let[Z,K]=(0,a.useState)(!1),_=(0,a.useCallback)(async(e,t,{lock:a=!0}={})=>{if(!a||!Z){a&&K(!0);try{F(null),await e(),await H()}catch(e){F(x(t,{message:e.message}))}finally{a&&K(!1)}}},[Z,H,x]),z=e=>_(()=>l.default.adjustAutopilotTarget(e,G),"autopilot.failedToAdjustHeading",{lock:!1}),V=e=>_(()=>l.default.autopilotDodge(e,G),"autopilot.failedToDodge"),X=e=>_(()=>l.default.autopilotCourseAction(e,G),"autopilot.failedToSteerCourse"),[q,J]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(!q)return;let e=setTimeout(()=>J(null),4e3);return()=>clearTimeout(e)},[q]);let Q=async e=>{try{await (0,r.makeOcearoCoreApiCall)("/api/controller/config",{method:"PUT",body:JSON.stringify(e)}),O(e)}catch(e){F(x("autopilot.failedToSaveConfig",{message:e.message}))}},ee="_default"===G||R.length<=1,et=e=>ee?v[e]:void 0,ea=et("steering.autopilot.state")??k?.state,eo=et("steering.autopilot.mode")??k?.mode,ei=et("steering.autopilot.target"),es="number"==typeof ei?ei:k?.target,en=et("steering.autopilot.engaged")??k?.engaged??"enabled"===ea,el="off-line"===ea,ed=(e=k?.options,(Array.isArray(h=e?.modes??e?.mode)?h.map(e=>"string"==typeof e?e:e?.value??e?.name).filter(Boolean):null)??g),er=Array.isArray(k?.options?.actions)?k.options.actions:null,ec=e=>er?er.some(t=>t.id===e&&t.available):"tack"===e||"gybe"===e,eu=e=>{switch(e){case"compass":default:return u.faCompass;case"wind":return u.faWind;case"gps":return u.faSatellite;case"route":return u.faRoute;case"dodge":return u.faAnchor}},ep=e=>{if(null==e)return"---°";let t=(0,s.toDegrees)(e);return`${t}\xb0`};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:"control",label:x("autopilot.control"),icon:u.faCompass},{id:"controller",label:x("autopilot.controller"),icon:u.faGamepad}].map(e=>(0,t.jsxs)("button",{onClick:()=>w(e.id),className:`flex-1 py-3 px-2 text-caption font-semibold uppercase flex items-center justify-center transition-all duration-500 ${C===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)(c.FontAwesomeIcon,{icon:e.icon,className:"mr-2"}),e.label]},e.id))}),(0,t.jsx)(i.AnimatePresence,{children:I&&(0,t.jsxs)(o.motion.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"bg-oRed/20 text-oRed p-3 rounded-lg mx-4 mt-4 border border-oRed/30",children:[(0,t.jsx)(c.FontAwesomeIcon,{icon:u.faExclamationTriangle,className:"mr-2"}),I]})}),R.length>0&&(0,t.jsx)("div",{className:"px-4 pt-4",children:(0,t.jsx)("select",{value:G,onChange:e=>L(e.target.value),className:"bg-hud-elevated text-hud-main rounded px-3 py-2 w-full border border-hud focus:border-oGreen/50 focus:outline-none transition-all",children:R.map(e=>(0,t.jsx)("option",{value:e,children:e},e))})}),(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-auto scrollbar-hide",children:(0,t.jsx)(i.AnimatePresence,{mode:"wait",children:D?(0,t.jsx)(o.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"flex items-center justify-center h-32",children:(0,t.jsx)("div",{className:"text-hud-main",children:"Loading..."})},"loading"):(0,t.jsx)(o.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:"control"===C?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"tesla-card ",children:[(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3 text-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:`text-value mb-1 ${el?"text-oRed":en?"text-oGreen":ea?"text-oYellow":"text-hud-muted"}`,children:(0,t.jsx)(c.FontAwesomeIcon,{icon:el?u.faTimesCircle:en?u.faCheckCircle:ea?u.faPause:u.faExclamationTriangle})}),(0,t.jsx)("div",{className:`text-caption ${A} font-bold`,children:x("autopilot.state")}),(0,t.jsx)("div",{className:`text-label ${T} font-semibold capitalize`,children:ea||x("autopilot.unknown")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-value mb-1 text-oBlue",children:(0,t.jsx)(c.FontAwesomeIcon,{icon:eu(eo)})}),(0,t.jsx)("div",{className:`text-caption ${A} font-bold`,children:x("autopilot.mode")}),(0,t.jsx)("div",{className:`text-label ${T} font-semibold capitalize`,children:eo||x("autopilot.none")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-value mb-1 text-oYellow",children:(0,t.jsx)(c.FontAwesomeIcon,{icon:u.faLocationArrow})}),(0,t.jsx)("div",{className:`text-caption ${A} font-bold`,children:x("autopilot.target")}),(0,t.jsx)("div",{className:`text-label ${T} font-semibold`,children:ep(es)})]})]}),(0,t.jsxs)("div",{className:"mt-3 pt-3 border-t border-hud text-center",children:[(0,t.jsx)("div",{className:`text-caption ${A} font-bold uppercase`,children:"wind"===eo?x("autopilot.apparentWindAngle"):x("autopilot.currentHeading")}),(0,t.jsx)("div",{className:`text-hero font-medium ${T}`,children:ep("wind"===eo?y:j)}),"number"==typeof N&&(0,t.jsxs)("div",{className:`text-caption mt-1 ${$} font-bold uppercase`,children:[x("autopilot.rudder")," ",Math.abs((0,s.toDegrees)(N)),"° ",N<0?x("autopilot.port"):N>0?x("autopilot.stbd"):""]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("button",{onClick:()=>_(()=>l.default.engageAutopilot(G),"autopilot.failedToEngage"),disabled:Z||en||el,className:`py-3 rounded font-semibold text-label uppercase transition-all ${Z||en||el?"bg-hud-bg text-hud-dim cursor-not-allowed border border-hud":"bg-oGreen hover:bg-oGreen/80 text-hud-main shadow-lg shadow-oGreen/20"}`,children:[(0,t.jsx)(c.FontAwesomeIcon,{icon:u.faPlay,className:"mr-2"}),x("autopilot.engage")]}),(0,t.jsxs)("button",{onClick:()=>_(()=>l.default.disengageAutopilot(G),"autopilot.failedToDisengage"),disabled:Z||!en,className:`py-3 rounded font-semibold text-label uppercase transition-all ${Z||!en?"bg-hud-bg text-hud-dim cursor-not-allowed border border-hud":"bg-oRed hover:bg-oRed/80 text-hud-main shadow-lg shadow-oRed/20"}`,children:[(0,t.jsx)(c.FontAwesomeIcon,{icon:u.faStop,className:"mr-2"}),x("autopilot.disengage")]})]}),(0,t.jsxs)("div",{className:"tesla-card ",children:[(0,t.jsx)("div",{className:`text-caption font-semibold uppercase ${A} mb-3`,children:x("autopilot.modeSelection")}),(0,t.jsx)("div",{className:"grid grid-cols-4 gap-3",children:ed.map(e=>(0,t.jsxs)("button",{onClick:()=>_(()=>l.default.setAutopilotMode(e,G),"autopilot.failedToSetMode"),disabled:Z||el,className:`py-2 rounded font-bold transition-all flex flex-col items-center border disabled:opacity-50 ${eo===e?"bg-oBlue text-hud-main border-oBlue shadow-lg shadow-oBlue/20":"bg-hud-bg text-hud-secondary border-hud hover:bg-hud-elevated"}`,children:[(0,t.jsx)(c.FontAwesomeIcon,{icon:eu(e),className:"text-lg mb-1"}),(0,t.jsx)("span",{className:"text-caption uppercase",children:e})]},e))})]}),(0,t.jsxs)("div",{className:"tesla-card ",children:[(0,t.jsx)("div",{className:`text-caption font-semibold uppercase ${A} mb-3`,children:x("autopilot.targetAdjustment")}),(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-3",children:[(0,t.jsx)("button",{onClick:()=>z(-10),className:"py-3 bg-oRed/40 hover:bg-oRed/60 text-hud-main rounded border border-oRed/50 font-semibold text-label",children:"-10°"}),(0,t.jsx)("button",{onClick:()=>z(-1),className:"py-3 bg-oRed/20 hover:bg-oRed/40 text-hud-main rounded border border-oRed/30 font-semibold text-label",children:"-1°"}),(0,t.jsx)("button",{onClick:()=>z(1),className:"py-3 bg-oGreen/20 hover:bg-oGreen/40 text-hud-main rounded border border-oGreen/30 font-semibold text-label",children:"+1°"}),(0,t.jsx)("button",{onClick:()=>z(10),className:"py-3 bg-oGreen/40 hover:bg-oGreen/60 text-hud-main rounded border border-oGreen/50 font-semibold text-label",children:"+10°"})]}),(0,t.jsxs)("button",{onClick:()=>{let e;return null!=j&&(e=(0,s.toDegrees)(j),_(()=>l.default.setAutopilotTarget(e*Math.PI/180,G),"autopilot.failedToSetHeading"))},disabled:null==j,className:"w-full mt-3 py-2.5 bg-hud-bg hover:bg-hud-elevated text-hud-main rounded border border-hud font-bold text-caption uppercase",children:[(0,t.jsx)(c.FontAwesomeIcon,{icon:u.faCompass,className:"mr-2"}),x("autopilot.syncTargetToHeading")]})]}),(0,t.jsxs)("div",{className:"tesla-card ",children:[(0,t.jsx)("div",{className:`text-caption font-semibold uppercase ${A} mb-3`,children:x("autopilot.maneuvers")}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-4",children:["tack","gybe"].map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:`text-caption font-semibold uppercase ${$} mb-2 text-center`,children:x(`autopilot.${e}`)}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-3",children:["port","starboard"].map(a=>{let o=q===`${e}:${a}`;return(0,t.jsx)("button",{onClick:()=>{let t;q!==(t=`${e}:${a}`)?J(t):(J(null),_(()=>l.default.autopilotManeuver(e,a,G),"tack"===e?"autopilot.failedToTack":"autopilot.failedToGybe"))},disabled:Z||!en||!ec(e),className:`py-2 rounded border font-bold text-caption transition-all disabled:opacity-40 ${o?"bg-oYellow text-hud-bg border-oYellow animate-soft-pulse":"bg-hud-bg hover:bg-hud-elevated text-hud-main border-hud"}`,children:o?x("autopilot.confirm"):x("port"===a?"autopilot.port":"autopilot.stbd")},a)})})]},e))})]}),(ec("dodge")||ec("courseCurrentPoint")||ec("courseNextPoint"))&&(0,t.jsx)("div",{className:"tesla-card ",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[ec("dodge")&&("dodge"===eo?(0,t.jsx)("button",{onClick:()=>V({exit:!0}),disabled:Z,className:"py-2 rounded border border-oYellow bg-oYellow/20 text-hud-main font-bold text-caption uppercase disabled:opacity-40",children:x("autopilot.exitDodge")}):(0,t.jsx)("button",{onClick:()=>V(),disabled:Z||!en,className:"py-2 rounded border border-hud bg-hud-bg hover:bg-hud-elevated text-hud-main font-bold text-caption uppercase disabled:opacity-40",children:x("autopilot.dodge")})),ec("courseCurrentPoint")&&(0,t.jsx)("button",{onClick:()=>X("courseCurrentPoint"),disabled:Z,className:"py-2 rounded border border-hud bg-hud-bg hover:bg-hud-elevated text-hud-main font-bold text-caption uppercase disabled:opacity-40",children:x("autopilot.steerToWaypoint")}),ec("courseNextPoint")&&(0,t.jsx)("button",{onClick:()=>X("courseNextPoint"),disabled:Z,className:"py-2 rounded border border-hud bg-hud-bg hover:bg-hud-elevated text-hud-main font-bold text-caption uppercase disabled:opacity-40",children:x("autopilot.nextWaypoint")})]})})]}):(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"tesla-card ",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)(c.FontAwesomeIcon,{icon:u.faGamepad,className:`text-xl ${Y?"text-oGreen":"text-hud-muted"}`}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:`text-label font-bold ${T}`,children:x("autopilot.controller")}),(0,t.jsx)("div",{className:`text-caption ${Y?"text-oGreen":"text-hud-muted"} font-bold`,children:Y?x("autopilot.connected"):x("autopilot.notConnected")})]})]}),(0,t.jsx)("button",{onClick:W,className:"p-2 text-hud-secondary hover:text-hud-main",children:(0,t.jsx)(c.FontAwesomeIcon,{icon:u.faSync,className:"text-sm"})})]}),!Y&&(0,t.jsxs)("div",{className:`text-caption ${$} bg-hud-elevated border border-hud rounded p-2.5 font-bold`,children:[(0,t.jsx)(c.FontAwesomeIcon,{icon:u.faExclamationTriangle,className:"text-oYellow mr-2"}),x("autopilot.connectController")]})]}),(0,t.jsxs)("div",{className:"tesla-card ",children:[(0,t.jsx)("div",{className:`text-caption font-semibold uppercase ${A} mb-3`,children:x("autopilot.buttonMappings")}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(m,{label:x("autopilot.engageAutopilot"),button:B?.mappings?.engage||"X",onChange:e=>Q({...B,mappings:{...B?.mappings,engage:e}}),primaryTextClass:T,secondaryTextClass:A}),(0,t.jsx)(m,{label:x("autopilot.disengageAutopilot"),button:B?.mappings?.disengage||"Circle",onChange:e=>Q({...B,mappings:{...B?.mappings,disengage:e}}),primaryTextClass:T,secondaryTextClass:A}),(0,t.jsx)("div",{className:"border-t border-hud pt-2 mt-2",children:(0,t.jsx)("div",{className:`text-caption font-semibold uppercase ${$} mb-2`,children:x("autopilot.headingControl")})}),(0,t.jsx)(m,{label:x("autopilot.headingMinus1"),button:B?.mappings?.headingMinus1||"D-Pad Left",onChange:e=>Q({...B,mappings:{...B?.mappings,headingMinus1:e}}),primaryTextClass:T,secondaryTextClass:A}),(0,t.jsx)(m,{label:x("autopilot.headingPlus1"),button:B?.mappings?.headingPlus1||"D-Pad Right",onChange:e=>Q({...B,mappings:{...B?.mappings,headingPlus1:e}}),primaryTextClass:T,secondaryTextClass:A}),(0,t.jsx)(m,{label:x("autopilot.headingMinus10"),button:B?.mappings?.headingMinus10||"L1",onChange:e=>Q({...B,mappings:{...B?.mappings,headingMinus10:e}}),primaryTextClass:T,secondaryTextClass:A}),(0,t.jsx)(m,{label:x("autopilot.headingPlus10"),button:B?.mappings?.headingPlus10||"R1",onChange:e=>Q({...B,mappings:{...B?.mappings,headingPlus10:e}}),primaryTextClass:T,secondaryTextClass:A}),(0,t.jsx)("div",{className:"border-t border-hud pt-2 mt-2",children:(0,t.jsx)("div",{className:`text-caption font-semibold uppercase ${$} mb-2`,children:x("autopilot.rudderControl")})}),(0,t.jsx)(m,{label:x("autopilot.rudderLeft"),button:B?.mappings?.rudderLeft||"Left Stick Left",onChange:e=>Q({...B,mappings:{...B?.mappings,rudderLeft:e}}),primaryTextClass:T,secondaryTextClass:A}),(0,t.jsx)(m,{label:x("autopilot.rudderRight"),button:B?.mappings?.rudderRight||"Left Stick Right",onChange:e=>Q({...B,mappings:{...B?.mappings,rudderRight:e}}),primaryTextClass:T,secondaryTextClass:A})]})]}),(0,t.jsxs)("div",{className:"tesla-card ",children:[(0,t.jsx)("div",{className:`text-caption font-semibold uppercase ${A} mb-3`,children:x("autopilot.sensitivity")}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex justify-between mb-1",children:[(0,t.jsx)("span",{className:`text-caption font-bold ${T}`,children:x("autopilot.rudderSensitivity")}),(0,t.jsxs)("span",{className:`text-caption font-bold ${A}`,children:[B?.sensitivity?.rudder||50,"%"]})]}),(0,t.jsx)("input",{type:"range",min:"10",max:"100",value:B?.sensitivity?.rudder||50,onChange:e=>Q({...B,sensitivity:{...B?.sensitivity,rudder:parseInt(e.target.value)}}),className:"w-full h-1.5 bg-hud-elevated rounded-full appearance-none cursor-pointer accent-oGreen"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex justify-between mb-1",children:[(0,t.jsx)("span",{className:`text-caption font-bold ${T}`,children:x("autopilot.deadZone")}),(0,t.jsxs)("span",{className:`text-caption font-bold ${A}`,children:[B?.sensitivity?.deadZone||10,"%"]})]}),(0,t.jsx)("input",{type:"range",min:"0",max:"30",value:B?.sensitivity?.deadZone||10,onChange:e=>Q({...B,sensitivity:{...B?.sensitivity,deadZone:parseInt(e.target.value)}}),className:"w-full h-1.5 bg-hud-elevated rounded-full appearance-none cursor-pointer accent-oGreen"})]})]})]})]})},C)})})]})}])},33946,function(e){e.n(e.i(91440))}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,76103,e=>{"use strict";var t=e.i(43476),o=e.i(71645),a=e.i(67561),s=e.i(85709),n=e.i(49721),l=e.i(68757),i=e.i(83402),r=e.i(46991),d=e.i(48390),c=e.i(46932),u=e.i(88653);e.i(85269);var m=e.i(22831),x=e.i(44485),b=e.i(30206);let p=()=>{let{t:e,i18n:a}=(0,m.useTranslation)(),[s,i]=(0,o.useState)(null),[r,d]=(0,o.useState)(null),[c,u]=(0,o.useState)(null);(0,o.useEffect)(()=>{let e=!1;return(0,x.listVoyages)().then(t=>{e||i(t)}).catch(t=>{e||(d(t.message),i([]))}),()=>{e=!0}},[]);let p=(0,o.useCallback)(async e=>{u(e.id);try{let t=await (0,x.getSamples)(e.start,e.end);(0,b.startReplay)(e,t)}finally{u(null)}},[]),h=new Intl.DateTimeFormat(a.language,{weekday:"short",day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"});return(0,t.jsxs)("div",{className:"p-4 flex flex-col gap-4",children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main uppercase tracking-widest flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faRoute,className:"mr-2 text-oBlue text-xs"}),e("replay.voyages")]}),(0,t.jsx)("p",{className:"text-caption text-hud-muted max-w-prose",children:e("replay.explain")}),r&&(0,t.jsx)("div",{className:"text-caption text-oRed",children:r}),s&&0===s.length&&(0,t.jsx)("div",{className:"tesla-card p-4 text-label text-hud-secondary",children:e("replay.none")}),(0,t.jsx)("ul",{className:"flex flex-col gap-2",children:s?.map(o=>{let a;return(0,t.jsxs)("li",{className:"tesla-card px-4 py-3 flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-label font-semibold text-hud-main",children:h.format(new Date(o.start))}),(0,t.jsxs)("div",{className:"text-caption text-hud-muted tabular-nums",children:[(a=Math.round((o.end-o.start)/6e4))<60?`${a} min`:`${Math.floor(a/60)} h ${String(a%60).padStart(2,"0")}`," · ",(o.distanceM/1852).toFixed(1)," NM · ",e("replay.max")," ",(1.943844*o.maxSog).toFixed(1)," kn"]})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>p(o),disabled:c===o.id,className:"bg-oBlue hover:bg-oBlue/80 text-white px-3 py-1.5 rounded text-caption font-semibold uppercase flex items-center gap-2 disabled:opacity-50",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faPlay}),e("replay.replay")]})]},o.id)})})]})};e.s(["default",0,()=>{let e,x,b,h,g,f,y,v,N,j,{t:w}=(0,m.useTranslation)(),{states:k,toggleState:S}=(0,a.useOcearoContext)(),C=k?.racing??!1,[F,A]=(0,o.useState)("logbook"),T=(0,o.useMemo)(()=>["navigation.position","navigation.courseOverGroundTrue","navigation.headingTrue","navigation.speedOverGround","environment.wind.speedTrue","environment.wind.angleTrueWater","environment.wind.speedApparent","environment.wind.angleApparent","environment.outside.pressure","environment.outside.temperature","environment.depth.belowKeel","environment.depth.belowTransducer","navigation.log","propulsion.main.runTime"],[]),B=(0,s.useSignalKPaths)(T),[R,G]=(0,o.useState)([]),[O,$]=(0,o.useState)(!1),[I,E]=(0,o.useState)(null),[L,D]=(0,o.useState)("UTC"),[P,Y]=(0,o.useState)(null),[M,K]=(0,o.useState)(!1),[W,z]=(0,o.useState)({text:"",author:"manual"}),[J,U]=(0,o.useState)(!1),[V,Z]=(0,o.useState)(null),[_,H]=(0,o.useState)(null),[q,Q]=(0,o.useState)(!1);i.default.getAll();let X=(0,d.isOcearoCoreEnabled)(),ee=(0,o.useCallback)(async()=>{$(!0),E(null);try{let e=(await (0,d.fetchLogbookEntries)()).map(e=>({...e,date:new Date(e.datetime||e.date),point:e.point?{...e.point,toString:()=>"number"==typeof e.point.latitude&&"number"==typeof e.point.longitude?`${e.point.latitude.toFixed(6)}, ${e.point.longitude.toFixed(6)}`:"Invalid coordinates"}:null}));G(e)}catch(e){"NetworkError"!==e.name&&"TimeoutError"!==e.name&&console.warn("Error fetching logbook entries:",e),E((0,d.handleOcearoCoreError)(e,"Logbook fetch")),i.default.get("debugMode")?G(et()):G([])}finally{$(!1)}},[]),et=()=>[{datetime:new Date().toISOString(),date:new Date,course:45,speed:{sog:6.5},wind:{speed:12,direction:180},observations:{seaState:2,cloudCoverage:3,visibility:7},barometer:1013.2,point:{latitude:46.1591,longitude:-1.1522,toString:()=>"46.159100, -1.152200"},position:{source:"GPS",latitude:46.1591,longitude:-1.1522},log:125.5,engine:{hours:245.2},author:"Captain",text:"Departing La Rochelle, good conditions"},{datetime:new Date(Date.now()-36e5).toISOString(),date:new Date(Date.now()-36e5),heading:42,speed:{sog:7.2},wind:{speed:15,direction:200},observations:{seaState:3,cloudCoverage:2,visibility:8},barometer:1012.8,point:{latitude:46.2591,longitude:-1.2522,toString:()=>"46.259100, -1.252200"},position:{source:"GPS",latitude:46.2591,longitude:-1.2522},log:132.1,engine:{hours:245.8},author:"auto",text:"Wind picking up, adjusting course"}],eo=(0,o.useCallback)(()=>{Y(null),z({text:"",author:"manual"}),K(!0)},[]),ea=(0,o.useCallback)(async()=>{try{let e;if(P)e={...P,author:W.author||P.author||"manual",text:W.text||P.text||"Manual entry"},delete e.date,delete e.point;else{let t=B["navigation.position"]||{},o=B["navigation.headingTrue"],a=B["environment.wind.speedTrue"],s=B["environment.wind.speedApparent"],n=null==a,l=n?B["environment.wind.angleApparent"]:B["environment.wind.angleTrueWater"],i={},d=(0,r.msToKnots)(n?s:a);if(null!==d&&(i.speed=d),null!=o&&null!=l){let e=(0,r.toDegrees)(o+l);null!==e&&(i.direction=e)}n&&Object.keys(i).length&&(i.apparent=!0);let c=B["environment.depth.belowKeel"]??B["environment.depth.belowTransducer"],u=B["navigation.log"],m=B["propulsion.main.runTime"];e={datetime:new Date().toISOString(),position:{latitude:t.latitude||46.1591,longitude:t.longitude||-1.1522,source:"GPS"},course:(0,r.toDegrees)(B["navigation.courseOverGroundTrue"]??o),speed:{sog:(0,r.msToKnots)(B["navigation.speedOverGround"])},wind:i,barometer:(0,r.convertPressure)(B["environment.outside.pressure"]),log:Number.isFinite(u)?parseFloat((u/1852).toFixed(1)):null,depth:Number.isFinite(c)?parseFloat(c.toFixed(1)):null,engine:{hours:Number.isFinite(m)?parseFloat((m/3600).toFixed(1)):null},author:W.author||"manual",text:W.text||"Manual entry"}}await (0,d.addLogbookEntry)(e),K(!1),Y(null),ee()}catch(e){console.warn("Error saving entry:",e),E((0,d.handleOcearoCoreError)(e,"Save logbook entry"))}},[B,ee,W,P]),es=(0,o.useCallback)(async()=>{if(!X)return void E(w("logbook.ocearoCoreNotEnabled"));try{Q(!0),E(null);let e={position:B["navigation.position"],course:B["navigation.courseOverGroundTrue"]||B["navigation.headingTrue"],speed:B["navigation.speedOverGround"],wind:{speed:B["environment.wind.speedTrue"],direction:B["environment.wind.angleTrueWater"]},weather:{pressure:B["environment.outside.pressure"],temperature:B["environment.outside.temperature"]},engine:{hours:B["propulsion.main.runTime"]},log:B["navigation.log"]},t=await (0,d.generateOcearoCoreLogbookEntry)(e);await ee(),t&&t.analysis&&(Z(t.analysis),H("auto-entry"),A("analysis"))}catch(e){E((0,d.handleOcearoCoreError)(e,"OcearoCore entry generation"))}finally{Q(!1)}},[X,B,ee,w]),en=(0,o.useCallback)(async e=>{if(!X)return void E(w("logbook.ocearoCoreNotEnabled"));try{U(!0),Z(null),H(e),E(null),A("analysis");let t=await (0,d.requestAnalysis)(e);Z(t),console.log("OcearoCore Analysis:",t)}catch(e){E((0,d.handleOcearoCoreError)(e,"OcearoCore analysis"))}finally{U(!1)}},[X,w]),el=(0,o.useCallback)(async()=>{if(!X)return void E(w("logbook.ocearoCoreNotEnabled"));try{U(!0),Z(null),H("logbook"),E(null),A("analysis");let e=await (0,d.analyzeLogbookWithOcearoCore)();Z(e),console.log("Logbook Analysis:",e)}catch(e){E((0,d.handleOcearoCoreError)(e,"Logbook analysis"))}finally{U(!1)}},[X,w]),ei=(0,o.useCallback)(e=>{Y(e),z({text:e.text||"",author:e.author||"manual"}),K(!0)},[]),er=(e,t="")=>Number.isFinite(e)?`${e}${t}`:"",ed=e=>Number.isFinite(e.course)?`${e.course}\xb0`:Number.isFinite(e.heading)?`HDT ${e.heading}\xb0`:"";(0,o.useEffect)(()=>{ee()},[ee]);let ec={safety:{color:"text-oRed",border:"border-oRed/40",bg:"bg-oRed/10"},alert:{color:"text-oRed",border:"border-oRed/40",bg:"bg-oRed/10"},weather:{color:"text-oYellow",border:"border-oYellow/40",bg:"bg-oYellow/10"},startup_analysis:{color:"text-oGreen",border:"border-oGreen/40",bg:"bg-oGreen/10"},briefing:{color:"text-oGreen",border:"border-oGreen/40",bg:"bg-oGreen/10"},racing:{color:"text-oYellow",border:"border-oYellow/40",bg:"bg-oYellow/10"},maintenance:{color:"text-oYellow",border:"border-oYellow/40",bg:"bg-oYellow/10"},hourly_entry:{color:"text-oBlue",border:"border-oBlue/40",bg:"bg-oBlue/10"},navigation:{color:"text-oBlue",border:"border-oBlue/40",bg:"bg-oBlue/10"},default:{color:"text-hud-secondary",border:"border-hud",bg:"bg-hud-elevated"}};return(0,t.jsxs)("div",{className:"flex flex-col h-full bg-rightPaneBg overflow-hidden",children:[X&&(0,t.jsxs)("div",{className:`flex items-center justify-between px-4 py-2 border-b transition-all duration-500 ${C?"bg-oYellow/10 border-oYellow/30":"bg-hud-bg border-hud"}`,children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faTrophy,className:`text-xs transition-colors duration-300 ${C?"text-oYellow animate-soft-pulse":"text-hud-muted"}`}),(0,t.jsx)("span",{className:"text-caption font-semibold uppercase tracking-widest text-hud-main",children:C?w("logbook.racingModeActive"):w("logbook.racingMode")}),C&&(0,t.jsxs)("span",{className:"text-caption font-semibold uppercase tracking-widest text-oYellow opacity-70",children:["— ",w("logbook.racingModeAISInfo")]})]}),(0,t.jsx)("button",{onClick:()=>S("racing"),className:`relative inline-flex h-5 w-10 items-center rounded-full transition-colors duration-300 focus:outline-none ${C?"bg-oYellow":"bg-hud-elevated border border-hud"}`,"aria-label":w("logbook.racingMode"),children:(0,t.jsx)("span",{className:`inline-block h-3.5 w-3.5 transform rounded-full bg-hud-main shadow transition-transform duration-300 ${C?"translate-x-5":"translate-x-1"}`})})]}),(0,t.jsx)("div",{className:"flex border-b border-hud bg-hud-bg",children:[{id:"timeline",label:w("logbook.missionTimeline"),icon:l.faTimeline},{id:"logbook",label:w("logbook.tacticalLog"),icon:l.faBook},{id:"analysis",label:w("logbook.fleetIntelligence"),icon:l.faChartLine},{id:"voyages",label:w("replay.voyages"),icon:l.faRoute}].map(e=>(0,t.jsxs)("button",{onClick:()=>A(e.id),className:`flex-1 py-3 px-2 text-caption font-semibold uppercase flex items-center justify-center transition-all duration-500 ${F===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 flex flex-col min-h-0",children:(0,t.jsx)(u.AnimatePresence,{mode:"wait",children:(0,t.jsxs)(c.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 overflow-auto scrollbar-hide",children:["logbook"===F&&(0,t.jsxs)("div",{className:"p-4 flex flex-col h-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main uppercase tracking-widest flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faBook,className:"mr-2 text-oBlue text-xs"}),w("logbook.logbookEntries")]}),(0,t.jsxs)("div",{className:"flex space-x-3",children:[X&&(0,t.jsxs)("button",{className:"bg-oGreen/10 text-oGreen hover:bg-oGreen/20 px-3 py-1.5 rounded text-caption font-semibold uppercase transition-all duration-300 flex items-center shadow-soft border border-oGreen/20 disabled:opacity-50",onClick:es,disabled:q||O,children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faRobot,className:`mr-2 ${q?"animate-spin":""}`}),q?w("logbook.aiEntryGenerating"):w("logbook.aiEntry")]}),(0,t.jsxs)("button",{className:"bg-oBlue hover:bg-oBlue/80 text-hud-main px-3 py-1.5 rounded text-caption font-semibold uppercase transition-all duration-300 flex items-center shadow-soft",onClick:eo,disabled:O,children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faPlus,className:"mr-2"}),w("logbook.add")]})]})]}),I&&(0,t.jsx)("div",{className:"bg-oRed/10 text-oRed p-3 rounded text-caption font-semibold uppercase mb-4 animate-soft-pulse border border-oRed/20",children:I}),(0,t.jsx)("div",{className:"tesla-card flex-1 overflow-auto ",children:(0,t.jsxs)("table",{className:"w-full text-caption font-semibold uppercase tracking-tight",children:[(0,t.jsx)("thead",{className:"sticky top-0 bg-hud-bg backdrop-blur-md z-10",children:(0,t.jsxs)("tr",{className:"text-hud-secondary border-b border-hud",children:[(0,t.jsx)("th",{className:"p-3 text-left",children:w("logbook.time")}),(0,t.jsx)("th",{className:"p-3 text-left",children:w("logbook.courseCol")}),(0,t.jsx)("th",{className:"p-3 text-left",children:w("logbook.sog")}),(0,t.jsx)("th",{className:"p-3 text-left",children:w("logbook.weatherCol")}),(0,t.jsx)("th",{className:"p-3 text-left",children:w("logbook.baro")}),(0,t.jsx)("th",{className:"p-3 text-left",children:w("logbook.depth")}),(0,t.jsx)("th",{className:"p-3 text-left",children:w("logbook.position")}),(0,t.jsx)("th",{className:"p-3 text-left",children:w("logbook.log")}),(0,t.jsx)("th",{className:"p-3 text-left",children:w("logbook.eng")}),(0,t.jsx)("th",{className:"p-3 text-left",children:w("logbook.by")}),(0,t.jsx)("th",{className:"p-3 text-left",children:w("logbook.noteCol")})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-hud",children:R.map((e,o)=>(0,t.jsxs)("tr",{onClick:()=>ei(e),className:"tesla-hover cursor-pointer text-hud-main",children:[(0,t.jsx)("td",{className:"p-3 whitespace-nowrap opacity-60",children:e.date.toLocaleString("en-GB",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit",timeZone:L})}),(0,t.jsx)("td",{className:"p-3 gliding-value",children:ed(e)}),(0,t.jsx)("td",{className:"p-3 gliding-value",children:er(e.speed?.sog,"kt")}),(0,t.jsx)("td",{className:"p-3 text-hud-secondary font-bold normal-case whitespace-nowrap",children:(e=>{let t=[];if(e.wind){let o=[];Number.isFinite(e.wind.speed)&&o.push(`${e.wind.speed}kt`),Number.isFinite(e.wind.direction)&&o.push(`${e.wind.direction}\xb0`),o.length&&t.push(`${e.wind.apparent?w("logbook.windApparentShort"):""}${o.join(" ")}`.trim())}return e.observations&&(Number.isFinite(e.observations.seaState)&&t.push(w("logbook.seaStateShort",{value:e.observations.seaState})),Number.isFinite(e.observations.cloudCoverage)&&t.push(`☁ ${e.observations.cloudCoverage}/8`),Number.isFinite(e.observations.visibility)&&t.push(w("logbook.visibilityShort",{value:e.observations.visibility+1}))),t.join(" · ")})(e)}),(0,t.jsx)("td",{className:"p-3 gliding-value opacity-60",children:er(e.barometer)}),(0,t.jsx)("td",{className:"p-3 gliding-value",children:er(e.depth,"m")}),(0,t.jsx)("td",{className:"p-3 text-caption text-hud-muted font-mono tracking-tighter",children:e.point?e.point.toString():"n/a"}),(0,t.jsx)("td",{className:"p-3 gliding-value",children:er(e.log,"NM")}),(0,t.jsx)("td",{className:"p-3 gliding-value",children:er(e.engine?.hours,"h")}),(0,t.jsx)("td",{className:"p-3 text-oBlue opacity-80",children:e.author||"auto"}),(0,t.jsx)("td",{className:"p-3 normal-case font-bold text-hud-secondary truncate max-w-xs",children:e.text})]},e.datetime||o))})]})})]}),"voyages"===F&&(0,t.jsx)(p,{}),"timeline"===F&&(()=>{let e=[...R].reverse(),o=[];for(let t of e){let e=t.date.toLocaleDateString("fr-FR",{weekday:"long",day:"numeric",month:"long",year:"numeric",timeZone:L}),a=o[o.length-1];a&&a.day===e?a.items.push(t):o.push({day:e,items:[t]})}return o.reverse(),(0,t.jsxs)("div",{className:"p-4 space-y-6",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main uppercase tracking-widest flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faTimeline,className:"mr-2 text-oGreen text-xs"}),w("logbook.cruiseTimeline")]}),(0,t.jsxs)("div",{className:"flex space-x-3",children:[X&&(0,t.jsxs)("button",{className:"bg-oGreen/10 text-oGreen hover:bg-oGreen/20 px-3 py-1.5 rounded text-caption font-semibold uppercase transition-all duration-300 flex items-center shadow-soft border border-oGreen/20 disabled:opacity-50",onClick:es,disabled:q||O,children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faRobot,className:`mr-2 ${q?"animate-spin":""}`}),q?w("logbook.aiEntryGenerating"):w("logbook.aiAuto")]}),(0,t.jsxs)("button",{className:"bg-oBlue hover:bg-oBlue/80 text-hud-main px-3 py-1.5 rounded text-caption font-semibold uppercase transition-all duration-300 flex items-center shadow-soft",onClick:eo,disabled:O,children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faPlus,className:"mr-2"}),w("logbook.add")]})]})]}),I&&(0,t.jsx)("div",{className:"bg-oRed/10 text-oRed p-3 rounded text-caption font-semibold uppercase mb-4 animate-soft-pulse border border-oRed/20",children:I}),(0,t.jsx)("div",{className:"space-y-6",children:o.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center mb-3",children:[(0,t.jsx)("div",{className:"w-2 h-2 rounded-full bg-oBlue mr-3"}),(0,t.jsx)("span",{className:"text-caption font-semibold text-hud-main uppercase tracking-widest",children:e.day}),(0,t.jsx)("div",{className:"flex-1 h-px bg-hud-border ml-4 opacity-40"}),(0,t.jsx)("span",{className:"text-caption font-semibold text-hud-muted ml-3",children:e.items.length})]}),(0,t.jsx)("div",{className:"space-y-2 ml-1 pl-4 border-l border-hud",children:e.items.map((e,o)=>{let a=e.entryType||e.analysis?.type||"default",s=ec[a]||ec.default,n=(e=>{let t=[],o=ed(e);if(o&&t.push({label:w("logbook.courseCol"),value:o}),Number.isFinite(e.speed?.sog)&&t.push({label:w("logbook.speed"),value:`${e.speed.sog}kt`}),Number.isFinite(e.wind?.speed)){let o=Number.isFinite(e.wind.direction)?` ${e.wind.direction}\xb0`:"";t.push({label:w("logbook.weatherCol"),value:`${e.wind.speed}kt${o}`})}return Number.isFinite(e.barometer)&&t.push({label:w("logbook.baro"),value:`${e.barometer}`}),Number.isFinite(e.depth)&&t.push({label:w("logbook.depth"),value:`${e.depth}m`}),Number.isFinite(e.log)&&t.push({label:w("logbook.log"),value:`${e.log}NM`}),Number.isFinite(e.engine?.hours)&&t.push({label:w("logbook.eng"),value:`${e.engine.hours}h`}),e.point&&"number"==typeof e.point.latitude&&t.push({label:w("logbook.coord"),value:e.point.toString(),mono:!0}),t})(e);return(0,t.jsxs)("div",{onClick:()=>ei(e),className:"tesla-card tesla-hover cursor-pointer group",children:[(0,t.jsxs)("div",{className:"px-4 py-2 flex justify-between items-center border-b border-hud",children:[(0,t.jsxs)("div",{className:"flex items-center min-w-0 gap-3",children:[(0,t.jsx)("span",{className:"text-label font-semibold text-hud-main tracking-tight",children:e.date.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit",timeZone:L})}),(0,t.jsx)("span",{className:`px-2 py-0.5 rounded-sm text-caption font-semibold uppercase tracking-widest border ${s.color} ${s.border} ${s.bg}`,children:w(`logbook.types.${a}`,{defaultValue:a.replace(/_/g," ")})})]}),(0,t.jsx)("div",{className:"text-caption font-semibold text-hud-muted uppercase tracking-tighter truncate ml-3",children:e.author||"system"})]}),(0,t.jsxs)("div",{className:"p-4",children:[e.text&&(0,t.jsx)("div",{className:"text-caption font-bold text-hud-secondary normal-case leading-relaxed mb-3",children:e.text}),n.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-x-6 gap-y-2 text-caption font-semibold uppercase tracking-tight text-hud-secondary",children:n.map(e=>(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"text-hud-dim",children:e.label}),(0,t.jsx)("span",{className:`text-hud-main ${e.mono?"font-mono text-caption":"gliding-value"}`,children:e.value})]},e.label))})]})]},e.datetime||o)})})]},e.day))})]})})(),"analysis"===F&&(0,t.jsxs)("div",{className:"p-4 space-y-6",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsxs)("h3",{className:"text-caption font-semibold text-hud-main uppercase tracking-widest flex items-center mb-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faChartLine,className:"mr-2 text-oBlue text-xs"}),w("logbook.fleetIntelligence")]}),(0,t.jsx)("p",{className:"text-hud-secondary text-caption font-semibold uppercase tracking-tighter",children:w("logbook.aiPoweredAnalysis")})]}),X&&(0,t.jsxs)("div",{className:"tesla-card mb-6 ",children:[(0,t.jsx)("h4",{className:"text-caption font-semibold text-hud-secondary mb-4 uppercase tracking-widest",children:w("logbook.selectOperation")}),(0,t.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:[{id:"logbook",label:"LOGBOOK",icon:l.faBook,color:"bg-oBlue",action:el},{id:"weather",label:"WEATHER",icon:l.faCloudSun,color:"bg-oBlue",action:()=>en("weather")},{id:"sail",label:"SAIL",icon:l.faCompass,color:"bg-oGreen",action:()=>en("sail")},{id:"alerts",label:"ALERTS",icon:l.faRobot,color:"bg-oRed",action:()=>en("alerts")},{id:"status",label:"STATUS",icon:l.faTachometerAlt,color:"bg-hud-muted",action:()=>en("status")},{id:"racing",label:w("logbook.racingAdvice"),icon:l.faTrophy,color:C?"bg-oYellow":"bg-oYellow/40",action:()=>en("racing")}].map(e=>(0,t.jsxs)("button",{className:"tesla-card tesla-hover flex flex-col items-center justify-center space-y-3 group ",onClick:e.action,disabled:J,children:[(0,t.jsx)("div",{className:`${e.color} w-10 h-10 rounded-full flex items-center justify-center shadow-lg group-hover:scale-110 transition-transform duration-500`,children:(0,t.jsx)(n.FontAwesomeIcon,{icon:e.icon,className:"text-hud-main text-sm"})}),(0,t.jsx)("span",{className:"text-caption font-semibold text-hud-main tracking-widest",children:e.label})]},e.id))})]}),I&&(0,t.jsx)("div",{className:"bg-oRed/10 text-oRed p-3 rounded text-caption font-semibold uppercase mb-4 animate-soft-pulse border border-oRed/20",children:I}),J&&(0,t.jsxs)("div",{className:"tesla-card text-center ",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faRobot,className:"text-4xl text-oGreen mb-6 animate-soft-pulse"}),(0,t.jsx)("h4",{className:"text-caption font-semibold text-hud-main uppercase tracking-widest mb-4",children:w("logbook.neuralProcessing")}),(0,t.jsx)("div",{className:"w-48 mx-auto bg-hud-elevated h-1 rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:"bg-oGreen h-full animate-progress-indefinite rounded-full",style:{width:"40%"}})}),(0,t.jsxs)("p",{className:"text-hud-muted text-caption font-semibold uppercase mt-4 tracking-tighter italic",children:[w("logbook.processNode")," ",_]})]}),V&&!J&&(e=V.analysis&&"object"==typeof V.analysis?V.analysis:null,x="string"==typeof V.analysis?V.analysis:null,b=void 0!==V.settings&&!V.analysis,h=x||e?.text||e?.summary||V.aiAnalysis||("string"==typeof V.summary?V.summary:null)||b&&(V.settings?.analysis?.speech||V.course?.analysis?.speech)||null,g=V.speechText||("string"==typeof V.speech?V.speech:null)||e?.speech||(b?V.settings?.analysis?.speech||V.course?.analysis?.speech:null),y=Array.isArray(f=V.recommendations||e?.recommendations||(b&&V.settings?.adjustments?.length>0?V.settings.adjustments.map(e=>e.action||e.message||JSON.stringify(e)):null))?f:null,N=Array.isArray(v=V.insights||e?.expertAdvice)?v:null,j=V.data||V.weatherData||V.assessment||(b?{course:V.course,settings:V.settings}:null),(0,t.jsxs)("div",{className:"tesla-card animate-fade-in",children:[(0,t.jsxs)("div",{className:"flex items-center mb-6 border-b border-hud pb-4",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faChartLine,className:"text-oGreen mr-3 text-sm"}),(0,t.jsxs)("h4",{className:"text-caption font-semibold text-hud-main uppercase tracking-widest",children:[w("logbook.operationReport")," ",_]})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[h&&(0,t.jsxs)("div",{className:"tesla-card border-l-2 border-oBlue/30 ",children:[(0,t.jsx)("h5",{className:"text-caption font-semibold text-oBlue mb-3 uppercase tracking-widest",children:w("logbook.executiveSummary")}),(0,t.jsx)("p",{className:"text-hud-secondary text-caption font-bold leading-relaxed italic normal-case",children:h})]}),(N||y)&&(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[N&&(0,t.jsxs)("div",{className:"tesla-card ",children:[(0,t.jsxs)("h5",{className:"text-caption font-semibold text-oBlue mb-3 uppercase tracking-widest flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faRobot,className:"mr-2 text-xs"}),w("logbook.strategicInsights")]}),(0,t.jsx)("ul",{className:"space-y-2",children:N.map((e,o)=>{let a="string"==typeof e?e:e&&"object"==typeof e?e.text||e.message||e.insight||JSON.stringify(e):String(e);return(0,t.jsxs)("li",{className:"text-caption font-bold text-hud-secondary normal-case flex items-start",children:[(0,t.jsx)("span",{className:"text-oBlue mr-2 opacity-50",children:"›"}),a]},o)})})]}),y&&(0,t.jsxs)("div",{className:"tesla-card ",children:[(0,t.jsxs)("h5",{className:"text-caption font-semibold text-oGreen mb-3 uppercase tracking-widest flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faChartLine,className:"mr-2 text-xs"}),w("logbook.operationalAdvice")]}),(0,t.jsx)("ul",{className:"space-y-2",children:y.map((e,o)=>{let a;return a="string"==typeof e?e:e&&"object"==typeof e?"string"==typeof e.message?e.message:e.message&&"object"==typeof e.message?e.message.message||e.text||e.action||JSON.stringify(e.message):e.text||e.action||JSON.stringify(e):String(e),(0,t.jsxs)("li",{className:"text-caption font-bold text-hud-secondary normal-case flex items-start",children:[(0,t.jsx)("span",{className:"text-oGreen mr-2 opacity-50",children:"✓"}),a]},o)})})]})]}),g&&(0,t.jsxs)("div",{className:"bg-oBlue/5 p-4 rounded-sm border border-oBlue/10 shadow-soft",children:[(0,t.jsxs)("h5",{className:"text-caption font-semibold text-oBlue mb-2 uppercase tracking-widest flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faRobot,className:"mr-2 animate-soft-pulse"}),w("logbook.voiceTelemetry")]}),(0,t.jsx)("p",{className:"text-hud-secondary text-caption font-bold leading-relaxed italic normal-case",children:g})]}),j&&(0,t.jsxs)("div",{className:"tesla-card ",children:[(0,t.jsx)("h5",{className:"text-caption font-semibold text-hud-secondary mb-3 uppercase tracking-widest",children:w("logbook.rawTelemetryData")}),(0,t.jsx)("pre",{className:"text-oGreen/70 text-caption font-mono overflow-auto max-h-40 font-bold scrollbar-thin",children:JSON.stringify(j,null,2)})]}),V.timestamp&&(0,t.jsxs)("div",{className:"text-hud-dim text-caption font-semibold text-right uppercase tracking-tighter",children:[w("logbook.generated")," ",new Date(V.timestamp).toLocaleString()," ","// OCEAROCORE V2.4"]})]})]})),!V&&!J&&(0,t.jsx)("div",{className:"tesla-card text-center ",children:(0,t.jsxs)("div",{className:"text-hud-muted",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faRobot,size:"3x",className:"mb-6 opacity-20"}),(0,t.jsx)("h4",{className:"text-caption font-semibold text-hud-main uppercase tracking-widest mb-3",children:w("logbook.diagnosticReady")}),(0,t.jsx)("p",{className:"text-caption font-semibold uppercase tracking-tight max-w-xs mx-auto leading-relaxed",children:w("logbook.diagnosticReadyDesc")})]})})]})]},F)})}),M&&(0,t.jsx)("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",onClick:()=>K(!1),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-value font-semibold text-hud-main flex items-center tracking-tight",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faBook,className:"mr-3 text-oBlue"}),P?w("logbook.editEntry"):w("logbook.manualEntry")]}),(0,t.jsx)("button",{onClick:()=>K(!1),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",children:(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faTimes,size:"lg"})})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-caption font-semibold uppercase tracking-widest text-hud-secondary mb-2 flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faUser,className:"mr-2 text-oBlue"}),w("logbook.author")]}),(0,t.jsx)("input",{type:"text",value:W.author,onChange:e=>z({...W,author: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 font-bold",placeholder:w("logbook.authorPlaceholder")})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-caption font-semibold uppercase tracking-widest text-hud-secondary mb-2 flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faStickyNote,className:"mr-2 text-oYellow"}),w("logbook.note")]}),(0,t.jsx)("textarea",{value:W.text,onChange:e=>z({...W,text: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 font-bold min-h-[120px]",placeholder:w("logbook.notePlaceholder")})]}),(0,t.jsxs)("div",{className:"flex justify-end space-x-4 pt-6 border-t border-hud",children:[(0,t.jsx)("button",{onClick:()=>K(!1),className:"px-6 py-3 bg-hud-elevated hover:bg-hud-bg text-hud-main font-bold rounded-xl transition-all duration-300",children:w("logbook.cancel")}),(0,t.jsxs)("button",{onClick:ea,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 shadow-lg shadow-oBlue/20",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:l.faPlus,className:"mr-2"}),w("logbook.saveEntry")]})]})]})]})})]})}],76103)},70127,function(e){e.n(e.i(76103))}]);
|