ocearo-ui 2.0.0 → 2.0.1

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.
Files changed (55) hide show
  1. package/404.html +1 -1
  2. package/README.fr.md +27 -3
  3. package/README.md +27 -3
  4. package/__next.__PAGE__.txt +3 -3
  5. package/__next._full.txt +4 -4
  6. package/__next._tree.txt +2 -2
  7. package/_next/static/chunks/0m7wbuocx-b4_.js +9 -0
  8. package/_next/static/chunks/0voiofm58khqd.js +1 -0
  9. package/_next/static/chunks/{3xjnsskh0tayo.js → 15imr2-f_8n-x.js} +1 -1
  10. package/_next/static/chunks/{32j_j396qs7be.js → 18_i6mf6hb_c7.js} +1 -1
  11. package/_next/static/chunks/{1fzzb4jtgv5gg.js → 1gt2hhqk1821k.js} +2 -2
  12. package/_next/static/chunks/{3ktj0iemsr1m-.js → 1pa1cfmfts0i9.js} +1 -1
  13. package/_next/static/chunks/1zm03hw2ylxw8.js +1 -0
  14. package/_next/static/chunks/2dvwb-mfasp68.js +1 -0
  15. package/_next/static/chunks/2kwn4iymxaom3.js +1 -0
  16. package/_next/static/chunks/2ryo_bbmt6t74.css +3 -0
  17. package/_next/static/chunks/{0oaqe70syw_b5.js → 2s6w3x5jnc2tg.js} +1 -1
  18. package/_next/static/chunks/{34_oyzp8_pi_m.js → 2w44atvyp9o_w.js} +1 -1
  19. package/_next/static/chunks/{0yiqocv54ogoq.js → 3p9ziqn6r35qf.js} +1 -1
  20. package/_next/static/chunks/{31lugryguappr.js → 3q8o52_juxmdp.js} +1 -1
  21. package/_next/static/chunks/3wwn1rti8oc_r.js +1 -0
  22. package/_not-found/__next._full.txt +3 -3
  23. package/_not-found/__next._not-found.__PAGE__.txt +2 -2
  24. package/_not-found/__next._tree.txt +2 -2
  25. package/_not-found.html +1 -1
  26. package/_not-found.txt +3 -3
  27. package/apple-touch-icon.png +0 -0
  28. package/favicon-96x96.png +0 -0
  29. package/favicon.ico +0 -0
  30. package/favicon.svg +1 -3
  31. package/icons/favicon-16x16.png +0 -0
  32. package/icons/favicon-32x32.png +0 -0
  33. package/icons/favicon-48x48.png +0 -0
  34. package/icons/icon-192x192.png +0 -0
  35. package/icons/icon-512x512.png +0 -0
  36. package/icons/ocearo.webp +0 -0
  37. package/index.html +1 -1
  38. package/index.txt +4 -4
  39. package/manifest.json +2 -3
  40. package/package.json +2 -1
  41. package/settings/__next._full.txt +3 -3
  42. package/settings/__next._tree.txt +2 -2
  43. package/settings/__next.settings.__PAGE__.txt +2 -2
  44. package/settings.html +1 -1
  45. package/settings.txt +3 -3
  46. package/_next/static/chunks/01atsfq_4opab.js +0 -1
  47. package/_next/static/chunks/0cx639tthxlz4.js +0 -1
  48. package/_next/static/chunks/0zlk2mlkvbtj1.js +0 -1
  49. package/_next/static/chunks/1gaiqhzy_0d7s.js +0 -1
  50. package/_next/static/chunks/2r_h93rt76vka.js +0 -1
  51. package/_next/static/chunks/2y3d8zopa8r5r.css +0 -3
  52. package/_next/static/chunks/3k5itcabq5oqs.js +0 -9
  53. /package/_next/static/{baa0rBM5TIECz8JV_tLT6 → 01VWnAYjs9QwBnnMyWbQF}/_buildManifest.js +0 -0
  54. /package/_next/static/{baa0rBM5TIECz8JV_tLT6 → 01VWnAYjs9QwBnnMyWbQF}/_clientMiddlewareManifest.js +0 -0
  55. /package/_next/static/{baa0rBM5TIECz8JV_tLT6 → 01VWnAYjs9QwBnnMyWbQF}/_ssgManifest.js +0 -0
@@ -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))}]);