ocearo-ui 0.1.22 → 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 +118 -158
- package/README.md +114 -158
- 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/0-z15txb4-uhu.js +0 -409
- package/_next/static/chunks/009rlietvsaq2.js +0 -1
- package/_next/static/chunks/070stlm97b9a2.js +0 -1
- package/_next/static/chunks/0abo2oxxw3hpi.js +0 -1
- package/_next/static/chunks/0jzbiie0nzar2.js +0 -1
- package/_next/static/chunks/0kinaai2rvd43.js +0 -9
- package/_next/static/chunks/0l9s4rhr00adq.js +0 -1
- package/_next/static/chunks/0qj7yy4f6sk8y.js +0 -455
- package/_next/static/chunks/0ri_um14-5x7u.js +0 -1
- package/_next/static/chunks/0uvr7xkt_5uno.js +0 -1
- package/_next/static/chunks/0yf1ifg_o1bq6.js +0 -1
- package/_next/static/chunks/0zbzk2ob0li1n.js +0 -1
- package/_next/static/chunks/0zjxnzbxh76mt.js +0 -1
- package/_next/static/chunks/17ma1x64d-211.js +0 -1
- package/_next/static/chunks/19xb2y6sgfnza.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/1ptwltjb3h6jf.js +0 -4
- package/_next/static/chunks/1q572rz5m8mb-.js +0 -1
- package/_next/static/chunks/1rkf8qtk5-48h.js +0 -1
- package/_next/static/chunks/1sq_733weprvs.js +0 -1
- package/_next/static/chunks/26e1o1as-77nq.js +0 -172
- package/_next/static/chunks/27hn45pv56pv7.js +0 -393
- package/_next/static/chunks/28y-j215vt42m.js +0 -1
- package/_next/static/chunks/2a0yjir_3mk1m.js +0 -1
- package/_next/static/chunks/2atijj_pkc4uc.js +0 -2
- package/_next/static/chunks/2ccpehidlaq88.js +0 -1
- package/_next/static/chunks/2fy4q1c5l3tpj.js +0 -1
- package/_next/static/chunks/2lvvt2f1l5sfu.js +0 -1
- package/_next/static/chunks/2lw7kypuhij1_.css +0 -3
- package/_next/static/chunks/2nd5amcst4lhp.js +0 -1
- package/_next/static/chunks/2pwmb4pkqygy_.js +0 -1
- package/_next/static/chunks/2q_83f24jeg0e.js +0 -1
- package/_next/static/chunks/2rsdqsatgq9ta.js +0 -1
- package/_next/static/chunks/2udirievybq_j.js +0 -1
- package/_next/static/chunks/2urimbxg5bqv3.js +0 -1
- package/_next/static/chunks/32cbrrsp-x35l.js +0 -1
- package/_next/static/chunks/36ra6xjie0dsv.js +0 -9
- 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/3myql5zu0rstt.js +0 -425
- package/_next/static/chunks/3rhgquok36e79.js +0 -1
- 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/{sct9rcMTcCyBLHTxQQ75- → baa0rBM5TIECz8JV_tLT6}/_buildManifest.js +0 -0
- /package/_next/static/{sct9rcMTcCyBLHTxQQ75- → baa0rBM5TIECz8JV_tLT6}/_clientMiddlewareManifest.js +0 -0
- /package/_next/static/{sct9rcMTcCyBLHTxQQ75- → baa0rBM5TIECz8JV_tLT6}/_ssgManifest.js +0 -0
|
@@ -1,409 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,62588,e=>{"use strict";var t=e.i(43476),n=e.i(71645);e.i(49018);var i=e.i(83402),a=e.i(66799),r=e.i(67561),o=e.i(85709);let s=(0,n.createContext)(),l=(e,t,n,i)=>{let a=n.split(".").reduce((e,t)=>e?.[t],i);void 0!==a&&(e[t]=a)};e.s(["AISProvider",0,({children:e})=>{let[u,c]=(0,n.useState)({}),[d,f]=(0,n.useState)([]),p=(0,n.useRef)(null),h=(0,n.useRef)({}),v=(0,n.useRef)(null),{convertLatLonToXY:m}=(0,r.useOcearoContext)(),g=(0,o.useSignalKPath)("navigation.position"),y=(0,n.useRef)(),S=(0,n.useRef)(),b=(0,n.useCallback)(e=>{if(e.latitude&&e.longitude&&g&&g.latitude&&g.longitude&&e.latitude!=g.latitude&&e.longitude!=g.longitude){let t=i.default.get("aisLengthScalingFactor")||.7,{x:n,y:a}=m({lat:e.latitude,lon:e.longitude},{lat:g.latitude,lon:g.longitude});e.sceneX=n*t,e.sceneZ=-a*t,e.rotationAngleY=(e=>{if(!e)return 0;let t=e.heading||e.headingMagnetic;return e.cog||e.cogMagnetic||t||0})(e),e.distanceMeters=Math.sqrt(n**2+a**2);let r=e.visible;return e.visible=e.distanceMeters>10&&e.distanceMeters<=5e3,r!==e.visible}return!1},[g,m]),w=(0,n.useCallback)(()=>{v.current&&(clearTimeout(v.current),v.current=null);let e=Object.values(u).filter(e=>e.visible);((e,t)=>{if(e.length!==t.length)return!0;let n=new Set(e.map(e=>e.mmsi)),i=new Set(t.map(e=>e.mmsi));if(n.size!==i.size)return!0;for(let e of n)if(!i.has(e))return!0;return!1})(d,e)&&(console.log(`Updating visible vessels: ${e.length} vessels`),f(e))},[u,d]),x=(0,n.useCallback)(()=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{w(),v.current=null},100)},[w]);return(0,n.useEffect)(()=>{y.current=b,S.current=x},[b,x]),(0,n.useEffect)(()=>{let e=setInterval(()=>{let e=Date.now();c(t=>{let n=!1,i={...t};return(Object.entries(i).forEach(([t,a])=>{e-a.lastUpdate>6e5&&(delete i[t],n=!0)}),n)?(x(),i):t})},6e4);return()=>clearInterval(e)},[x]),(0,n.useEffect)(()=>{let e=async e=>{console.log("Fetching static vessel info...");try{let t=await e.API().then(e=>e.vessels()),n=Object.entries(t).map(([e,t])=>{let n={mmsi:e};return l(n,"name","name",t),l(n,"latitude","navigation.position.value.latitude",t),l(n,"longitude","navigation.position.value.longitude",t),l(n,"sog","navigation.speedOverGround.value",t),l(n,"cog","navigation.courseOverGroundTrue.value",t),l(n,"cogMagnetic","navigation.courseOverGroundMagnetic.value",t),l(n,"heading","navigation.headingTrue.value",t),l(n,"headingMagnetic","navigation.headingMagnetic.value",t),l(n,"length","design.length.value.overall",t),l(n,"beam","design.beam.value",t),l(n,"callsign","communication.callsignVhf",t),l(n,"shipType","design.aisShipType.value.id",t),n.lastUpdate=Date.now(),n.distanceMeters=null,n.sceneX=null,n.sceneZ=null,n.rotationAngleY=null,n.visible=!1,n}),i={};if(n.forEach(e=>{e.mmsi&&"self"!=e.mmsi&&(null!==e.latitude||null!==e.longitude)&&(y.current(e),i[e.mmsi]=e)}),console.log(`Fetched ${n.length} vessels.`),Object.keys(i).length>0){console.log(`Initializing AIS data with ${Object.keys(i).length} vessels`),c(i);let e=Object.values(i).filter(e=>e.visible);f(e),console.log(`${e.length} vessels initially visible`)}}catch(e){console.error("Error fetching static info:",e)}},t=e=>{if(!e?.updates)return void console.warn("Missing delta or no updates:",e);let t=e.context.replace("vessels.","");t?(h.current[t]=Date.now(),c(n=>{let i=n[t]||{mmsi:t,name:"unknown",latitude:null,longitude:null,sog:null,cog:null,cogMagnetic:null,heading:null,headingMagnetic:null,distanceMeters:null,sceneX:null,sceneZ:null,rotationAngleY:null,visible:!1,length:null,beam:null,shipType:null};i.lastUpdate=h.current[t];let a=!1,r=!1;return e.updates.forEach(e=>{e.values&&e.values.forEach(e=>{switch(e.path){case"name":i.name=e.value;break;case"navigation.position":i.latitude=e.value.latitude,i.longitude=e.value.longitude,a=!0;break;case"navigation.speedOverGround":i.sog=e.value;break;case"navigation.courseOverGroundTrue":i.cog=e.value,r=!0;break;case"navigation.courseOverGroundMagnetic":i.cogMagnetic=e.value,r=!0;break;case"navigation.headingTrue":i.heading=e.value,r=!0;break;case"navigation.headingMagnetic":i.headingMagnetic=e.value,r=!0;break;case"design.aisShipType":i.shipType=e.value?.id??e.value;break;case"design.length":i.length=e.value?.overall??e.value;break;case"design.beam":i.beam=e.value;break;case"communication.callsignVhf":i.callsign=e.value}})}),(y.current(i)||a||r)&&S.current(),{...n,[t]:i}})):console.warn("Update without MMSI context:",e)};return(async()=>{try{let{signalkUrl:n}=i.default.getAll();if(console.log("SignalK URL:",n),!n)throw Error("SignalK URL is undefined or invalid.");console.log(`Connecting to SignalK at: ${n}`);let r=a.default.createClient({subscriptions:[{context:"vessels.*",subscribe:[{path:"navigation.position"},{path:"navigation.speedOverGround"},{path:"navigation.courseOverGroundTrue"},{path:"navigation.courseOverGroundMagnetic"},{path:"navigation.headingTrue"},{path:"navigation.headingMagnetic"},{path:"name"},{path:"design.aisShipType"},{path:"design.length"},{path:"design.beam"},{path:"communication.callsignVhf"}]}]});p.current=r,await r.connect(),console.log("SignalK client connected."),await e(r),r.on("delta",t)}catch(e){console.warn("Error connecting to SignalK:",e)}})(),()=>{console.log("Disconnecting SignalK client..."),v.current&&clearTimeout(v.current),p.current?.disconnect()}},[]),(0,t.jsx)(s.Provider,{value:{aisData:u,vesselIds:d},children:e})},"useAIS",0,()=>(0,n.useContext)(s)])},43216,e=>{"use strict";let t,n;var i=e.i(31067),a=e.i(71645),r=e.i(90072),o=e.i(28600),s=r,l=r;let u=new l.Box3,c=new l.Vector3;class d extends l.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new l.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new l.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(e){let t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));let n=new l.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceStart",new l.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new l.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,t=3){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));let i=new l.InstancedInterleavedBuffer(n,2*t,1);return this.setAttribute("instanceColorStart",new l.InterleavedBufferAttribute(i,t,0)),this.setAttribute("instanceColorEnd",new l.InterleavedBufferAttribute(i,t,t)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new l.WireframeGeometry(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new l.Box3);let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;void 0!==e&&void 0!==t&&(this.boundingBox.setFromBufferAttribute(e),u.setFromBufferAttribute(t),this.boundingBox.union(u))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new l.Sphere),null===this.boundingBox&&this.computeBoundingBox();let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){let n=this.boundingSphere.center;this.boundingBox.getCenter(n);let i=0;for(let a=0,r=e.count;a<r;a++)c.fromBufferAttribute(e,a),i=Math.max(i,n.distanceToSquared(c)),c.fromBufferAttribute(t,a),i=Math.max(i,n.distanceToSquared(c));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}var f=r,p=e.i(8560),h=e.i(31497);class v extends f.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:f.UniformsUtils.clone(f.UniformsUtils.merge([p.UniformsLib.common,p.UniformsLib.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new f.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:`
|
|
2
|
-
#include <common>
|
|
3
|
-
#include <fog_pars_vertex>
|
|
4
|
-
#include <logdepthbuf_pars_vertex>
|
|
5
|
-
#include <clipping_planes_pars_vertex>
|
|
6
|
-
|
|
7
|
-
uniform float linewidth;
|
|
8
|
-
uniform vec2 resolution;
|
|
9
|
-
|
|
10
|
-
attribute vec3 instanceStart;
|
|
11
|
-
attribute vec3 instanceEnd;
|
|
12
|
-
|
|
13
|
-
#ifdef USE_COLOR
|
|
14
|
-
#ifdef USE_LINE_COLOR_ALPHA
|
|
15
|
-
varying vec4 vLineColor;
|
|
16
|
-
attribute vec4 instanceColorStart;
|
|
17
|
-
attribute vec4 instanceColorEnd;
|
|
18
|
-
#else
|
|
19
|
-
varying vec3 vLineColor;
|
|
20
|
-
attribute vec3 instanceColorStart;
|
|
21
|
-
attribute vec3 instanceColorEnd;
|
|
22
|
-
#endif
|
|
23
|
-
#endif
|
|
24
|
-
|
|
25
|
-
#ifdef WORLD_UNITS
|
|
26
|
-
|
|
27
|
-
varying vec4 worldPos;
|
|
28
|
-
varying vec3 worldStart;
|
|
29
|
-
varying vec3 worldEnd;
|
|
30
|
-
|
|
31
|
-
#ifdef USE_DASH
|
|
32
|
-
|
|
33
|
-
varying vec2 vUv;
|
|
34
|
-
|
|
35
|
-
#endif
|
|
36
|
-
|
|
37
|
-
#else
|
|
38
|
-
|
|
39
|
-
varying vec2 vUv;
|
|
40
|
-
|
|
41
|
-
#endif
|
|
42
|
-
|
|
43
|
-
#ifdef USE_DASH
|
|
44
|
-
|
|
45
|
-
uniform float dashScale;
|
|
46
|
-
attribute float instanceDistanceStart;
|
|
47
|
-
attribute float instanceDistanceEnd;
|
|
48
|
-
varying float vLineDistance;
|
|
49
|
-
|
|
50
|
-
#endif
|
|
51
|
-
|
|
52
|
-
void trimSegment( const in vec4 start, inout vec4 end ) {
|
|
53
|
-
|
|
54
|
-
// trim end segment so it terminates between the camera plane and the near plane
|
|
55
|
-
|
|
56
|
-
// conservative estimate of the near plane
|
|
57
|
-
float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
|
|
58
|
-
float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
|
|
59
|
-
float nearEstimate = - 0.5 * b / a;
|
|
60
|
-
|
|
61
|
-
float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
|
|
62
|
-
|
|
63
|
-
end.xyz = mix( start.xyz, end.xyz, alpha );
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
void main() {
|
|
68
|
-
|
|
69
|
-
#ifdef USE_COLOR
|
|
70
|
-
|
|
71
|
-
vLineColor = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
|
|
72
|
-
|
|
73
|
-
#endif
|
|
74
|
-
|
|
75
|
-
#ifdef USE_DASH
|
|
76
|
-
|
|
77
|
-
vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
|
|
78
|
-
vUv = uv;
|
|
79
|
-
|
|
80
|
-
#endif
|
|
81
|
-
|
|
82
|
-
float aspect = resolution.x / resolution.y;
|
|
83
|
-
|
|
84
|
-
// camera space
|
|
85
|
-
vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
|
|
86
|
-
vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
|
|
87
|
-
|
|
88
|
-
#ifdef WORLD_UNITS
|
|
89
|
-
|
|
90
|
-
worldStart = start.xyz;
|
|
91
|
-
worldEnd = end.xyz;
|
|
92
|
-
|
|
93
|
-
#else
|
|
94
|
-
|
|
95
|
-
vUv = uv;
|
|
96
|
-
|
|
97
|
-
#endif
|
|
98
|
-
|
|
99
|
-
// special case for perspective projection, and segments that terminate either in, or behind, the camera plane
|
|
100
|
-
// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
|
|
101
|
-
// but we need to perform ndc-space calculations in the shader, so we must address this issue directly
|
|
102
|
-
// perhaps there is a more elegant solution -- WestLangley
|
|
103
|
-
|
|
104
|
-
bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
|
|
105
|
-
|
|
106
|
-
if ( perspective ) {
|
|
107
|
-
|
|
108
|
-
if ( start.z < 0.0 && end.z >= 0.0 ) {
|
|
109
|
-
|
|
110
|
-
trimSegment( start, end );
|
|
111
|
-
|
|
112
|
-
} else if ( end.z < 0.0 && start.z >= 0.0 ) {
|
|
113
|
-
|
|
114
|
-
trimSegment( end, start );
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// clip space
|
|
121
|
-
vec4 clipStart = projectionMatrix * start;
|
|
122
|
-
vec4 clipEnd = projectionMatrix * end;
|
|
123
|
-
|
|
124
|
-
// ndc space
|
|
125
|
-
vec3 ndcStart = clipStart.xyz / clipStart.w;
|
|
126
|
-
vec3 ndcEnd = clipEnd.xyz / clipEnd.w;
|
|
127
|
-
|
|
128
|
-
// direction
|
|
129
|
-
vec2 dir = ndcEnd.xy - ndcStart.xy;
|
|
130
|
-
|
|
131
|
-
// account for clip-space aspect ratio
|
|
132
|
-
dir.x *= aspect;
|
|
133
|
-
dir = normalize( dir );
|
|
134
|
-
|
|
135
|
-
#ifdef WORLD_UNITS
|
|
136
|
-
|
|
137
|
-
// get the offset direction as perpendicular to the view vector
|
|
138
|
-
vec3 worldDir = normalize( end.xyz - start.xyz );
|
|
139
|
-
vec3 offset;
|
|
140
|
-
if ( position.y < 0.5 ) {
|
|
141
|
-
|
|
142
|
-
offset = normalize( cross( start.xyz, worldDir ) );
|
|
143
|
-
|
|
144
|
-
} else {
|
|
145
|
-
|
|
146
|
-
offset = normalize( cross( end.xyz, worldDir ) );
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// sign flip
|
|
151
|
-
if ( position.x < 0.0 ) offset *= - 1.0;
|
|
152
|
-
|
|
153
|
-
float forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );
|
|
154
|
-
|
|
155
|
-
// don't extend the line if we're rendering dashes because we
|
|
156
|
-
// won't be rendering the endcaps
|
|
157
|
-
#ifndef USE_DASH
|
|
158
|
-
|
|
159
|
-
// extend the line bounds to encompass endcaps
|
|
160
|
-
start.xyz += - worldDir * linewidth * 0.5;
|
|
161
|
-
end.xyz += worldDir * linewidth * 0.5;
|
|
162
|
-
|
|
163
|
-
// shift the position of the quad so it hugs the forward edge of the line
|
|
164
|
-
offset.xy -= dir * forwardOffset;
|
|
165
|
-
offset.z += 0.5;
|
|
166
|
-
|
|
167
|
-
#endif
|
|
168
|
-
|
|
169
|
-
// endcaps
|
|
170
|
-
if ( position.y > 1.0 || position.y < 0.0 ) {
|
|
171
|
-
|
|
172
|
-
offset.xy += dir * 2.0 * forwardOffset;
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// adjust for linewidth
|
|
177
|
-
offset *= linewidth * 0.5;
|
|
178
|
-
|
|
179
|
-
// set the world position
|
|
180
|
-
worldPos = ( position.y < 0.5 ) ? start : end;
|
|
181
|
-
worldPos.xyz += offset;
|
|
182
|
-
|
|
183
|
-
// project the worldpos
|
|
184
|
-
vec4 clip = projectionMatrix * worldPos;
|
|
185
|
-
|
|
186
|
-
// shift the depth of the projected points so the line
|
|
187
|
-
// segments overlap neatly
|
|
188
|
-
vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
|
|
189
|
-
clip.z = clipPose.z * clip.w;
|
|
190
|
-
|
|
191
|
-
#else
|
|
192
|
-
|
|
193
|
-
vec2 offset = vec2( dir.y, - dir.x );
|
|
194
|
-
// undo aspect ratio adjustment
|
|
195
|
-
dir.x /= aspect;
|
|
196
|
-
offset.x /= aspect;
|
|
197
|
-
|
|
198
|
-
// sign flip
|
|
199
|
-
if ( position.x < 0.0 ) offset *= - 1.0;
|
|
200
|
-
|
|
201
|
-
// endcaps
|
|
202
|
-
if ( position.y < 0.0 ) {
|
|
203
|
-
|
|
204
|
-
offset += - dir;
|
|
205
|
-
|
|
206
|
-
} else if ( position.y > 1.0 ) {
|
|
207
|
-
|
|
208
|
-
offset += dir;
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// adjust for linewidth
|
|
213
|
-
offset *= linewidth;
|
|
214
|
-
|
|
215
|
-
// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
|
|
216
|
-
offset /= resolution.y;
|
|
217
|
-
|
|
218
|
-
// select end
|
|
219
|
-
vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
|
|
220
|
-
|
|
221
|
-
// back to clip space
|
|
222
|
-
offset *= clip.w;
|
|
223
|
-
|
|
224
|
-
clip.xy += offset;
|
|
225
|
-
|
|
226
|
-
#endif
|
|
227
|
-
|
|
228
|
-
gl_Position = clip;
|
|
229
|
-
|
|
230
|
-
vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
|
|
231
|
-
|
|
232
|
-
#include <logdepthbuf_vertex>
|
|
233
|
-
#include <clipping_planes_vertex>
|
|
234
|
-
#include <fog_vertex>
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
`,fragmentShader:`
|
|
238
|
-
uniform vec3 diffuse;
|
|
239
|
-
uniform float opacity;
|
|
240
|
-
uniform float linewidth;
|
|
241
|
-
|
|
242
|
-
#ifdef USE_DASH
|
|
243
|
-
|
|
244
|
-
uniform float dashOffset;
|
|
245
|
-
uniform float dashSize;
|
|
246
|
-
uniform float gapSize;
|
|
247
|
-
|
|
248
|
-
#endif
|
|
249
|
-
|
|
250
|
-
varying float vLineDistance;
|
|
251
|
-
|
|
252
|
-
#ifdef WORLD_UNITS
|
|
253
|
-
|
|
254
|
-
varying vec4 worldPos;
|
|
255
|
-
varying vec3 worldStart;
|
|
256
|
-
varying vec3 worldEnd;
|
|
257
|
-
|
|
258
|
-
#ifdef USE_DASH
|
|
259
|
-
|
|
260
|
-
varying vec2 vUv;
|
|
261
|
-
|
|
262
|
-
#endif
|
|
263
|
-
|
|
264
|
-
#else
|
|
265
|
-
|
|
266
|
-
varying vec2 vUv;
|
|
267
|
-
|
|
268
|
-
#endif
|
|
269
|
-
|
|
270
|
-
#include <common>
|
|
271
|
-
#include <fog_pars_fragment>
|
|
272
|
-
#include <logdepthbuf_pars_fragment>
|
|
273
|
-
#include <clipping_planes_pars_fragment>
|
|
274
|
-
|
|
275
|
-
#ifdef USE_COLOR
|
|
276
|
-
#ifdef USE_LINE_COLOR_ALPHA
|
|
277
|
-
varying vec4 vLineColor;
|
|
278
|
-
#else
|
|
279
|
-
varying vec3 vLineColor;
|
|
280
|
-
#endif
|
|
281
|
-
#endif
|
|
282
|
-
|
|
283
|
-
vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {
|
|
284
|
-
|
|
285
|
-
float mua;
|
|
286
|
-
float mub;
|
|
287
|
-
|
|
288
|
-
vec3 p13 = p1 - p3;
|
|
289
|
-
vec3 p43 = p4 - p3;
|
|
290
|
-
|
|
291
|
-
vec3 p21 = p2 - p1;
|
|
292
|
-
|
|
293
|
-
float d1343 = dot( p13, p43 );
|
|
294
|
-
float d4321 = dot( p43, p21 );
|
|
295
|
-
float d1321 = dot( p13, p21 );
|
|
296
|
-
float d4343 = dot( p43, p43 );
|
|
297
|
-
float d2121 = dot( p21, p21 );
|
|
298
|
-
|
|
299
|
-
float denom = d2121 * d4343 - d4321 * d4321;
|
|
300
|
-
|
|
301
|
-
float numer = d1343 * d4321 - d1321 * d4343;
|
|
302
|
-
|
|
303
|
-
mua = numer / denom;
|
|
304
|
-
mua = clamp( mua, 0.0, 1.0 );
|
|
305
|
-
mub = ( d1343 + d4321 * ( mua ) ) / d4343;
|
|
306
|
-
mub = clamp( mub, 0.0, 1.0 );
|
|
307
|
-
|
|
308
|
-
return vec2( mua, mub );
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
void main() {
|
|
313
|
-
|
|
314
|
-
#include <clipping_planes_fragment>
|
|
315
|
-
|
|
316
|
-
#ifdef USE_DASH
|
|
317
|
-
|
|
318
|
-
if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
|
|
319
|
-
|
|
320
|
-
if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
|
|
321
|
-
|
|
322
|
-
#endif
|
|
323
|
-
|
|
324
|
-
float alpha = opacity;
|
|
325
|
-
|
|
326
|
-
#ifdef WORLD_UNITS
|
|
327
|
-
|
|
328
|
-
// Find the closest points on the view ray and the line segment
|
|
329
|
-
vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
|
|
330
|
-
vec3 lineDir = worldEnd - worldStart;
|
|
331
|
-
vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );
|
|
332
|
-
|
|
333
|
-
vec3 p1 = worldStart + lineDir * params.x;
|
|
334
|
-
vec3 p2 = rayEnd * params.y;
|
|
335
|
-
vec3 delta = p1 - p2;
|
|
336
|
-
float len = length( delta );
|
|
337
|
-
float norm = len / linewidth;
|
|
338
|
-
|
|
339
|
-
#ifndef USE_DASH
|
|
340
|
-
|
|
341
|
-
#ifdef USE_ALPHA_TO_COVERAGE
|
|
342
|
-
|
|
343
|
-
float dnorm = fwidth( norm );
|
|
344
|
-
alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );
|
|
345
|
-
|
|
346
|
-
#else
|
|
347
|
-
|
|
348
|
-
if ( norm > 0.5 ) {
|
|
349
|
-
|
|
350
|
-
discard;
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
#endif
|
|
355
|
-
|
|
356
|
-
#endif
|
|
357
|
-
|
|
358
|
-
#else
|
|
359
|
-
|
|
360
|
-
#ifdef USE_ALPHA_TO_COVERAGE
|
|
361
|
-
|
|
362
|
-
// artifacts appear on some hardware if a derivative is taken within a conditional
|
|
363
|
-
float a = vUv.x;
|
|
364
|
-
float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
|
|
365
|
-
float len2 = a * a + b * b;
|
|
366
|
-
float dlen = fwidth( len2 );
|
|
367
|
-
|
|
368
|
-
if ( abs( vUv.y ) > 1.0 ) {
|
|
369
|
-
|
|
370
|
-
alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
|
|
371
|
-
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
#else
|
|
375
|
-
|
|
376
|
-
if ( abs( vUv.y ) > 1.0 ) {
|
|
377
|
-
|
|
378
|
-
float a = vUv.x;
|
|
379
|
-
float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
|
|
380
|
-
float len2 = a * a + b * b;
|
|
381
|
-
|
|
382
|
-
if ( len2 > 1.0 ) discard;
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
#endif
|
|
387
|
-
|
|
388
|
-
#endif
|
|
389
|
-
|
|
390
|
-
vec4 diffuseColor = vec4( diffuse, alpha );
|
|
391
|
-
#ifdef USE_COLOR
|
|
392
|
-
#ifdef USE_LINE_COLOR_ALPHA
|
|
393
|
-
diffuseColor *= vLineColor;
|
|
394
|
-
#else
|
|
395
|
-
diffuseColor.rgb *= vLineColor;
|
|
396
|
-
#endif
|
|
397
|
-
#endif
|
|
398
|
-
|
|
399
|
-
#include <logdepthbuf_fragment>
|
|
400
|
-
|
|
401
|
-
gl_FragColor = diffuseColor;
|
|
402
|
-
|
|
403
|
-
#include <tonemapping_fragment>
|
|
404
|
-
#include <${h.version>=154?"colorspace_fragment":"encodings_fragment"}>
|
|
405
|
-
#include <fog_fragment>
|
|
406
|
-
#include <premultiplied_alpha_fragment>
|
|
407
|
-
|
|
408
|
-
}
|
|
409
|
-
`,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA="1":delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(e){!0===e?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(e){!!e!="USE_DASH"in this.defines&&(this.needsUpdate=!0),!0===e?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(e){!!e!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),!0===e?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}}let m=h.version>=125?"uv1":"uv2",g=new s.Vector4,y=new s.Vector3,S=new s.Vector3,b=new s.Vector4,w=new s.Vector4,x=new s.Vector4,E=new s.Vector3,A=new s.Matrix4,_=new s.Line3,U=new s.Vector3,L=new s.Box3,M=new s.Sphere,O=new s.Vector4;function z(e,t,i){return O.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),O.multiplyScalar(1/O.w),O.x=n/i.width,O.y=n/i.height,O.applyMatrix4(e.projectionMatrixInverse),O.multiplyScalar(1/O.w),Math.abs(Math.max(O.x,O.y))}class B extends s.Mesh{constructor(e=new d,t=new v({color:0xffffff*Math.random()})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let e=0,a=0,r=t.count;e<r;e++,a+=2)y.fromBufferAttribute(t,e),S.fromBufferAttribute(n,e),i[a]=0===a?0:i[a-1],i[a+1]=i[a]+y.distanceTo(S);let a=new s.InstancedInterleavedBuffer(i,2,1);return e.setAttribute("instanceDistanceStart",new s.InterleavedBufferAttribute(a,1,0)),e.setAttribute("instanceDistanceEnd",new s.InterleavedBufferAttribute(a,1,1)),this}raycast(e,i){let a,r,o=this.material.worldUnits,l=e.camera;null!==l||o||console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');let u=void 0!==e.params.Line2&&e.params.Line2.threshold||0;t=e.ray;let c=this.matrixWorld,d=this.geometry,f=this.material;if(n=f.linewidth+u,null===d.boundingSphere&&d.computeBoundingSphere(),M.copy(d.boundingSphere).applyMatrix4(c),o)a=.5*n;else{let e=Math.max(l.near,M.distanceToPoint(t.origin));a=z(l,e,f.resolution)}if(M.radius+=a,!1!==t.intersectsSphere(M)){if(null===d.boundingBox&&d.computeBoundingBox(),L.copy(d.boundingBox).applyMatrix4(c),o)r=.5*n;else{let e=Math.max(l.near,L.distanceToPoint(t.origin));r=z(l,e,f.resolution)}L.expandByScalar(r),!1!==t.intersectsBox(L)&&(o?function(e,i){let a=e.matrixWorld,r=e.geometry,o=r.attributes.instanceStart,l=r.attributes.instanceEnd,u=Math.min(r.instanceCount,o.count);for(let r=0;r<u;r++){_.start.fromBufferAttribute(o,r),_.end.fromBufferAttribute(l,r),_.applyMatrix4(a);let u=new s.Vector3,c=new s.Vector3;t.distanceSqToSegment(_.start,_.end,c,u),c.distanceTo(u)<.5*n&&i.push({point:c,pointOnLine:u,distance:t.origin.distanceTo(c),object:e,face:null,faceIndex:r,uv:null,[m]:null})}}(this,i):function(e,i,a){let r=i.projectionMatrix,o=e.material.resolution,l=e.matrixWorld,u=e.geometry,c=u.attributes.instanceStart,d=u.attributes.instanceEnd,f=Math.min(u.instanceCount,c.count),p=-i.near;t.at(1,x),x.w=1,x.applyMatrix4(i.matrixWorldInverse),x.applyMatrix4(r),x.multiplyScalar(1/x.w),x.x*=o.x/2,x.y*=o.y/2,x.z=0,E.copy(x),A.multiplyMatrices(i.matrixWorldInverse,l);for(let i=0;i<f;i++){if(b.fromBufferAttribute(c,i),w.fromBufferAttribute(d,i),b.w=1,w.w=1,b.applyMatrix4(A),w.applyMatrix4(A),b.z>p&&w.z>p)continue;if(b.z>p){let e=b.z-w.z,t=(b.z-p)/e;b.lerp(w,t)}else if(w.z>p){let e=w.z-b.z,t=(w.z-p)/e;w.lerp(b,t)}b.applyMatrix4(r),w.applyMatrix4(r),b.multiplyScalar(1/b.w),w.multiplyScalar(1/w.w),b.x*=o.x/2,b.y*=o.y/2,w.x*=o.x/2,w.y*=o.y/2,_.start.copy(b),_.start.z=0,_.end.copy(w),_.end.z=0;let u=_.closestPointToPointParameter(E,!0);_.at(u,U);let f=s.MathUtils.lerp(b.z,w.z,u),h=f>=-1&&f<=1,v=E.distanceTo(U)<.5*n;if(h&&v){_.start.fromBufferAttribute(c,i),_.end.fromBufferAttribute(d,i),_.start.applyMatrix4(l),_.end.applyMatrix4(l);let n=new s.Vector3,r=new s.Vector3;t.distanceSqToSegment(_.start,_.end,r,n),a.push({point:r,pointOnLine:n,distance:t.origin.distanceTo(r),object:e,face:null,faceIndex:i,uv:null,[m]:null})}}}(this,l,i))}}onBeforeRender(e){let t=this.material.uniforms;t&&t.resolution&&(e.getViewport(g),this.material.uniforms.resolution.value.set(g.z,g.w))}}class C extends d{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){let t=e.length-3,n=new Float32Array(2*t);for(let i=0;i<t;i+=3)n[2*i]=e[i],n[2*i+1]=e[i+1],n[2*i+2]=e[i+2],n[2*i+3]=e[i+3],n[2*i+4]=e[i+4],n[2*i+5]=e[i+5];return super.setPositions(n),this}setColors(e,t=3){let n=e.length-t,i=new Float32Array(2*n);if(3===t)for(let a=0;a<n;a+=t)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];else for(let a=0;a<n;a+=t)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5],i[2*a+6]=e[a+6],i[2*a+7]=e[a+7];return super.setColors(i,t),this}fromLine(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class T extends B{constructor(e=new C,t=new v({color:0xffffff*Math.random()})){super(e,t),this.isLine2=!0,this.type="Line2"}}let D=a.forwardRef(function({points:e,color:t=0xffffff,vertexColors:n,linewidth:s,lineWidth:l,segments:u,dashed:c,...f},p){var h,m;let g=(0,o.useThree)(e=>e.size),y=a.useMemo(()=>u?new B:new T,[u]),[S]=a.useState(()=>new v),b=(null==n||null==(h=n[0])?void 0:h.length)===4?4:3,w=a.useMemo(()=>{let i=u?new d:new C,a=e.map(e=>{let t=Array.isArray(e);return e instanceof r.Vector3||e instanceof r.Vector4?[e.x,e.y,e.z]:e instanceof r.Vector2?[e.x,e.y,0]:t&&3===e.length?[e[0],e[1],e[2]]:t&&2===e.length?[e[0],e[1],0]:e});if(i.setPositions(a.flat()),n){t=0xffffff;let e=n.map(e=>e instanceof r.Color?e.toArray():e);i.setColors(e.flat(),b)}return i},[e,u,n,b]);return a.useLayoutEffect(()=>{y.computeLineDistances()},[e,y]),a.useLayoutEffect(()=>{c?S.defines.USE_DASH="":delete S.defines.USE_DASH,S.needsUpdate=!0},[c,S]),a.useEffect(()=>()=>{w.dispose(),S.dispose()},[w]),a.createElement("primitive",(0,i.default)({object:y,ref:p},f),a.createElement("primitive",{object:w,attach:"geometry"}),a.createElement("primitive",(0,i.default)({object:S,attach:"material",color:t,vertexColors:!!n,resolution:[g.width,g.height],linewidth:null!=(m=null!=s?s:l)?m:1,dashed:c,transparent:4===b},f)))});e.s(["Line",0,D],43216)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81694,e=>{"use strict";e.i(47167);var t=e.i(43476),i=e.i(71645),r=e.i(70703);let n={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function s(e,t,i){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*i):e*t*i/(t+i*e)}function o(e,t,i,r=.15){return 0===r?Math.max(t,Math.min(e,i)):e<t?-s(t-e,i-t,r)+t:e>i?+s(e-i,i-t,r)+i:e}function a(e,t,i){var r;return(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?r:String(r))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function l(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)}return i}function c(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?l(Object(i),!0).forEach(function(t){a(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):l(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}let u={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function d(e){return e?e[0].toUpperCase()+e.slice(1):""}let h=["enter","leave"],f=["gotpointercapture","lostpointercapture"];function p(e){return"touches"in e}function m(e){return p(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function g(e){return p(e)?("touchend"===e.type||"touchcancel"===e.type?e.changedTouches:e.targetTouches)[0]:e}function v(e){let t=g(e);return p(e)?t.identifier:t.pointerId}function b(e){let t=g(e);return[t.clientX,t.clientY]}function x(e,...t){return"function"==typeof e?e(...t):e}function w(){}function y(e,t){return Object.assign({},t,e||{})}class _{constructor(e,t,i){this.ctrl=e,this.args=t,this.key=i,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){let{state:e,shared:t,ingKey:i,args:r}=this;t[i]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){let t=this.state,i=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=i.from?x(i.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){let t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){let e=this.state;e._initial=e._values,e.initial=e.values}compute(e){let{state:t,config:i,shared:r}=this;t.args=this.args;let s=0;if(e&&(t.event=e,i.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,function(e){let t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){let{shiftKey:i,altKey:r,metaKey:n,ctrlKey:s}=e;Object.assign(t,{shiftKey:i,altKey:r,metaKey:n,ctrlKey:s})}return t}(e)),r.down=r.pressed=r.buttons%2==1||r.touches>0,s=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){let e=t._delta.map(Math.abs);n.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);let[a,l]=t._movement,[c,u]=i.threshold,{_step:d,values:h}=t;if(i.hasCustomTransform?(!1===d[0]&&(d[0]=Math.abs(a)>=c&&h[0]),!1===d[1]&&(d[1]=Math.abs(l)>=u&&h[1])):(!1===d[0]&&(d[0]=Math.abs(a)>=c&&Math.sign(a)*c),!1===d[1]&&(d[1]=Math.abs(l)>=u&&Math.sign(l)*u)),t.intentional=!1!==d[0]||!1!==d[1],!t.intentional)return;let f=[0,0];if(i.hasCustomTransform){let[e,t]=h;f[0]=!1!==d[0]?e-d[0]:0,f[1]=!1!==d[1]?t-d[1]:0}else f[0]=!1!==d[0]?a-d[0]:0,f[1]=!1!==d[1]?l-d[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(f);let p=t.offset,m=t._active&&!t._blocked||t.active;m&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in i&&(t._bounds=x(i.bounds,t)),this.setup&&this.setup()),t.movement=f,this.computeOffset()));let[g,v]=t.offset,[[b,w],[y,_]]=t._bounds;t.overflow=[g<b?-1:+(g>w),v<y?-1:+(v>_)],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);let k=t._active&&i.rubberband||[0,0];if(t.offset=function(e,[t,i],[r,n]){let[[s,a],[l,c]]=e;return[o(t,s,a,r),o(i,l,c,n)]}(t._bounds,t.offset,k),t.delta=n.sub(t.offset,p),this.computeMovement(),m&&(!t.last||s>32)){t.delta=n.sub(t.offset,p);let e=t.delta.map(Math.abs);n.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&s>0&&(t.velocity=[e[0]/s,e[1]/s],t.timeDelta=s)}}emit(){let e=this.state,t=this.shared,i=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!i.triggerAllEvents)return;let r=this.handler(c(c(c({},t),e),{},{[this.aliasKey]:e.values}));void 0!==r&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class k extends _{constructor(...e){super(...e),a(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=n.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=n.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){let t=this.state,i=this.config;if(!t.axis&&e){let r="object"==typeof i.axisThreshold?i.axisThreshold[m(e)]:i.axisThreshold;t.axis=function([e,t],i){let r=Math.abs(e),n=Math.abs(t);return r>n&&r>i?"x":n>r&&n>i?"y":void 0}(t._movement,r)}t._blocked=(i.lockDirection||!!i.axis)&&!t.axis||!!i.axis&&i.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}let S=e=>e,T={enabled:(e=!0)=>e,eventOptions:(e,t,i)=>c(c({},i.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return n.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?n.toVector(e):void 0,transform(e,t,i){let r=e||i.shared.transform;return this.hasCustomTransform=!!r,r||S},threshold:e=>n.toVector(e,0)},j=0,P=c(c({},T),{},{axis(e,t,{axis:i}){if(this.lockDirection="lock"===i,!this.lockDirection)return i},axisThreshold:(e=j)=>e,bounds(e={}){if("function"==typeof e)return t=>P.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;let{left:t=-1/0,right:i=1/0,top:r=-1/0,bottom:n=1/0}=e;return[[t,i],[r,n]]}}),O={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]},A="u">typeof window&&window.document&&window.document.createElement;function E(){return A&&"ontouchstart"in window}let C={isBrowser:A,gesture:function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),touch:E(),touchscreen:E()||A&&window.navigator.maxTouchPoints>1,pointer:A&&"onpointerdown"in window,pointerLock:A&&"exitPointerLock"in window.document},D=10,M={mouse:0,touch:0,pen:8},I=c(c({},P),{},{device(e,t,{pointer:{touch:i=!1,lock:r=!1,mouse:n=!1}={}}){return(this.pointerLock=r&&C.pointerLock,C.touch&&i)?"touch":this.pointerLock?"mouse":C.pointer&&!n?"pointer":C.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:i}){if(this.preventScrollDelay="number"==typeof i?i:i||void 0===i&&e?250:void 0,C.touchscreen&&!1!==i)return e||(void 0!==i?"y":void 0)},pointerCapture(e,t,{pointer:{capture:i=!0,buttons:r=1,keys:n=!0}={}}){return this.pointerButtons=r,this.keys=n,!this.pointerLock&&"pointer"===this.device&&i},threshold(e,t,{filterTaps:i=!1,tapsThreshold:r=3,axis:s}){let o=n.toVector(e,i?r:+!!s);return this.filterTaps=i,this.tapsThreshold=r,o},swipe({velocity:e=.5,distance:t=50,duration:i=250}={}){return{velocity:this.transform(n.toVector(e)),distance:this.transform(n.toVector(t)),duration:i}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?c(c({},M),e):M,keyboardDisplacement:(e=D)=>e});c(c({},T),{},{device(e,t,{shared:i,pointer:{touch:r=!1}={}}){if(i.target&&!C.touch&&C.gesture)return"gesture";if(C.touch&&r)return"touch";if(C.touchscreen){if(C.pointer)return"pointer";if(C.touch)return"touch"}},bounds(e,t,{scaleBounds:i={},angleBounds:r={}}){let n=e=>{let t=y(x(i,e),{min:-1/0,max:1/0});return[t.min,t.max]},s=e=>{let t=y(x(r,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof i&&"function"!=typeof r?[n(),s()]:e=>[n(e),s(e)]},threshold(e,t,i){return this.lockDirection="lock"===i.axis,n.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e}),c(c({},P),{},{mouseOnly:(e=!0)=>e}),c(c({},P),{},{mouseOnly:(e=!0)=>e});let B=new Map,L=new Map,N={key:"drag",engine:class extends k{constructor(...e){super(...e),a(this,"ingKey","dragging")}reset(){super.reset();let e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){let e=this.state;if(e._bounds instanceof HTMLElement){let t=e._bounds.getBoundingClientRect(),i=e.currentTarget.getBoundingClientRect(),r={left:t.left-i.left+e.offset[0],right:t.right-i.right+e.offset[0],top:t.top-i.top+e.offset[1],bottom:t.bottom-i.bottom+e.offset[1]};e._bounds=P.bounds(r)}}cancel(){let e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){let t=this.config,i=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;let r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),r&&r.size>1&&i._pointerActive||(this.start(e),this.setupPointer(e),i._pointerId=v(e),i._pointerActive=!0,this.computeValues(b(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==m(e)?(i._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){let t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){let t=this.state,i=this.config;if(!t._pointerActive)return;let r=v(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;let s=b(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=n.sub(s,t._values),this.computeValues(s)),n.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(i.preventScrollAxis&&!t._preventScroll)if(!t.axis)return;else if(t.axis===i.preventScrollAxis||"xy"===i.preventScrollAxis){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(e){}let t=this.state,i=this.config;if(!t._active||!t._pointerActive)return;let r=v(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);let[n,s]=t._distance;if(t.tap=n<=i.tapsThreshold&&s<=i.tapsThreshold,t.tap&&i.filterTaps)t._force=!0;else{let[e,r]=t._delta,[n,s]=t._movement,[o,a]=i.swipe.velocity,[l,c]=i.swipe.distance,u=i.swipe.duration;if(t.elapsedTime<u){let i=Math.abs(e/t.timeDelta),u=Math.abs(r/t.timeDelta);i>o&&Math.abs(n)>l&&(t.swipe[0]=Math.sign(e)),u>a&&Math.abs(s)>c&&(t.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){let t=this.config,i=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,i,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){var t;this.state._preventScroll=!1,"persist"in(t=e)&&"function"==typeof t.persist&&t.persist();let i=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",i),this.eventStore.add(this.sharedConfig.window,"touch","cancel",i),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){let t=O[e.key];if(t){let i=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),i._delta=t(this.config.keyboardDisplacement,r),i._keyboardActive=!0,n.addTo(i._movement,i._delta),this.compute(e),this.emit()}}keyUp(e){e.key in O&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){let t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:I},V={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=C.isBrowser?window:void 0)=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},K=["target","eventOptions","window","enabled","transform"];function R(e={},t){let i={};for(let[r,n]of Object.entries(t))switch(typeof n){case"function":i[r]=n.call(i,e[r],r,e);break;case"object":i[r]=R(e[r],n);break;case"boolean":n&&(i[r]=e[r])}return i}class U{constructor(e,t){a(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,i,r,n){let s=this._listeners,o=function(e,t=""){let i=u[e];return e+(i&&i[t]||t)}(t,i),a=c(c({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),n);e.addEventListener(o,r,a);let l=()=>{e.removeEventListener(o,r,a),s.delete(l)};return s.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class F{constructor(){a(this,"_timeouts",new Map)}add(e,t,i=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,i,...r))}remove(e){let t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class H{constructor(e){a(this,"gestures",new Set),a(this,"_targetEventStore",new U(this)),a(this,"gestureEventStores",{}),a(this,"gestureTimeoutStores",{}),a(this,"handlers",{}),a(this,"config",{}),a(this,"pointerIds",new Set),a(this,"touchIds",new Set),a(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&z(e,"drag"),t.wheel&&z(e,"wheel"),t.scroll&&z(e,"scroll"),t.move&&z(e,"move"),t.pinch&&z(e,"pinch"),t.hover&&z(e,"hover")}(this,e)}setEventIds(e){if(p(e))return this.touchIds=new Set(Array.from(e.touches).filter(t=>{var i,r;return t.target===e.currentTarget||(null==(i=e.currentTarget)||null==(r=i.contains)?void 0:r.call(i,t.target))}).map(e=>e.identifier)),this.touchIds;if("pointerId"in e)return"pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,i={}){let{target:r,eventOptions:n,window:s,enabled:o,transform:a}=e,l=function(e,t){if(null==e)return{};var i,r,n=function(e,t){if(null==e)return{};var i,r,n={},s=Object.keys(e);for(r=0;r<s.length;r++)i=s[r],t.indexOf(i)>=0||(n[i]=e[i]);return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)i=s[r],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}(e,K);if(i.shared=R({target:r,eventOptions:n,window:s,enabled:o,transform:a},V),t){let e=L.get(t);i[t]=R(c({shared:i.shared},l),e)}else for(let e in l){let t=L.get(e);t&&(i[e]=R(c({shared:i.shared},l[e]),t))}return i}(e,t,this.config)}clean(){for(let e of(this._targetEventStore.clean(),this.gestures))this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){let t,i=this.config.shared,r={};if(!i.target||(t=i.target())){if(i.enabled){for(let i of this.gestures){let n=this.config[i],s=W(r,n.eventOptions,!!t);n.enabled&&new(B.get(i))(this,e,i).bind(s)}let n=W(r,i.eventOptions,!!t);for(let t in this.nativeHandlers)n(t,"",i=>this.nativeHandlers[t](c(c({},this.state.shared),{},{event:i,args:e})),void 0,!0)}for(let e in r)r[e]=function(...e){return 0===e.length?w:1===e.length?e[0]:function(){let t;for(let i of e)t=i.apply(this,arguments)||t;return t}}(...r[e]);if(!t)return r;for(let e in r){let{device:i,capture:n,passive:s}=function(e){let t=e.substring(2).toLowerCase(),i=!!~t.indexOf("passive");i&&(t=t.replace("passive",""));let r=f.includes(t)?"capturecapture":"capture",n=!!~t.indexOf(r);return n&&(t=t.replace("capture","")),{device:t,capture:n,passive:i}}(e);this._targetEventStore.add(t,i,"",r[e],{capture:n,passive:s})}}}}function z(e,t){e.gestures.add(t),e.gestureEventStores[t]=new U(e,t),e.gestureTimeoutStores[t]=new F}let W=(e,t,i)=>(r,n,s,o={},a=!1)=>{var l,c;let f=null!=(l=o.capture)?l:t.capture,p=null!=(c=o.passive)?c:t.passive,m=a?r:function(e,t="",i=!1){let r=u[e],n=r&&r[t]||t;return"on"+d(e)+d(n)+(!function(e=!1,t){return e&&!h.includes(t)}(i,n)?"":"Capture")}(r,n,f);i&&p&&(m+="Passive"),e[m]=e[m]||[],e[m].push(s)};var G=e.i(67561),q=e.i(83934),X=e.i(11426),Y=i;class $ extends Y.default.Component{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){this.setState({error:e,errorInfo:t}),console.error("Error caught in Error Boundary:",e,t)}handleRefresh=()=>{window.location.reload()};handleExitFullscreen=()=>{document.fullscreenElement&&(window.close(),document.exitFullscreen().catch(e=>{console.error("Failed to exit fullscreen:",e)}))};render(){if(this.state.hasError){let{error:e,errorInfo:i}=this.state;return(0,t.jsx)("div",{className:"flex flex-col items-center justify-center min-h-screen bg-hud-bg text-hud-main p-6",children:(0,t.jsxs)("div",{className:"tesla-card p-10 max-w-2xl w-full bg-hud-elevated backdrop-blur-xl border border-hud rounded-3xl shadow-2xl flex flex-col items-center text-center",children:[(0,t.jsx)("div",{className:"w-20 h-20 rounded-full bg-oRed/20 flex items-center justify-center mb-8",children:(0,t.jsx)("div",{className:"w-4 h-4 rounded-full bg-oRed animate-soft-pulse"})}),(0,t.jsx)("h1",{className:"text-3xl font-black uppercase tracking-tighter text-oRed mb-6",children:"System Critical Error"}),(0,t.jsxs)("p",{className:"text-lg font-medium text-hud-main/80 mb-8 max-w-md",children:[(0,t.jsx)("span",{className:"text-hud-muted uppercase text-xs font-black tracking-widest block mb-2",children:"Technical Status"}),e?e.toString():"Unknown exception detected in UI thread"]}),i&&(0,t.jsxs)("details",{className:"w-full whitespace-pre-wrap bg-hud-bg/5 p-6 rounded-2xl mb-10 text-left border border-hud group",children:[(0,t.jsxs)("summary",{className:"cursor-pointer text-oBlue text-xs font-black uppercase tracking-widest hover:text-hud-main transition-colors flex items-center justify-between",children:[(0,t.jsx)("span",{children:"Diagnostic Stack Trace"}),(0,t.jsx)("span",{className:"opacity-40 group-open:rotate-180 transition-transform",children:"▼"})]}),(0,t.jsx)("pre",{className:"mt-6 text-xs font-mono text-hud-muted overflow-auto max-h-60 custom-scrollbar leading-relaxed",children:i.componentStack})]}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 w-full justify-center",children:[(0,t.jsx)("button",{onClick:this.handleRefresh,className:"px-8 py-4 bg-oBlue hover:bg-blue-600 text-hud-main rounded-xl text-xs font-black uppercase tracking-[0.2em] transition-all duration-500 shadow-lg shadow-oBlue/20 active:scale-95",children:"Reboot Session"}),(0,t.jsx)("button",{onClick:this.handleExitFullscreen,className:"px-8 py-4 bg-hud-elevated hover:bg-hud-bg text-hud-main border border-hud rounded-xl text-xs font-black uppercase tracking-[0.2em] transition-all duration-500 active:scale-95",children:"Exit Console"})]})]})})}return this.props.children}}e.i(85269);var J=e.i(71),Q=e.i(18850),Z=e.i(83402);function ee({children:e}){return(0,i.useEffect)(()=>{let e=Z.default.get("language");e&&e!==Q.default.language&&Q.default.changeLanguage(e)},[]),(0,t.jsx)(J.I18nextProvider,{i18n:Q.default,children:e})}let et=(0,r.default)(()=>e.A(45344),{loadableGenerated:{modules:[42602]},loading:()=>(0,t.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:"Loading..."})}),ei=(0,r.default)(()=>e.A(10520),{loadableGenerated:{modules:[61891]}}),er=(0,r.default)(()=>e.A(49063),{loadableGenerated:{modules:[85626]}}),en=(0,r.default)(()=>e.A(13181),{loadableGenerated:{modules:[23595]},loading:()=>(0,t.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-hud-main text-2xl",children:"Loading 3D View..."})}),ssr:!1}),es={BOAT:"boat",APP:"app",SPLIT:"split"};e.s(["VIEW_MODES",0,es,"default",0,function(){var e,r;let n=(0,i.useRef)(!1),s=(0,i.useRef)(null),[o,a]=(0,i.useState)(null),[l,c]=(0,i.useState)(()=>Z.default.getCurrentView()||"navigation"),[u,d]=(0,i.useState)(!1),[h,f]=(0,i.useState)(!1),p=(0,i.useRef)(!1);(0,i.useEffect)(()=>{},[]),(0,i.useEffect)(()=>{let e,t=Z.default.get("viewMode");a(Object.values(es).includes(t)?t:window.innerWidth>=1366?es.SPLIT:es.BOAT),n.current=!0;let i=()=>{clearTimeout(e),e=setTimeout(()=>{p.current||Z.default.get("viewMode")||a(window.innerWidth>=1366?es.SPLIT:es.BOAT)},250)};return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i),clearTimeout(e)}},[]);let m=(0,i.useCallback)(()=>{d(e=>!e)},[]),g=(0,i.useCallback)(e=>{a(e),Z.default.set("viewMode",e)},[]),v=(e=({movement:[e]})=>{let t=window.innerWidth/5;e>t?g(es.BOAT):e<-t?g(es.APP):g(es.SPLIT)},r={axis:"x"},B.set(N.key,N.engine),L.set(N.key,N.resolver),function(e,t={},r){let n=i.default.useMemo(()=>new H(e),[]);if(n.applyHandlers(e,void 0),n.applyConfig(t,r),i.default.useEffect(n.effect.bind(n)),i.default.useEffect(()=>n.clean.bind(n),[]),void 0===t.target)return n.bind.bind(n)}({drag:e},r||{},"drag")),b=(0,i.useCallback)(()=>{document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen().catch(e=>{console.error("Fullscreen error:",e.message)})},[]),x=(0,i.useCallback)(e=>{o===es.BOAT&&g(es.APP),c(e),Z.default.setCurrentView(e)},[o,g]),w=(0,i.useRef)(null),y=(0,i.useRef)(null),_=(0,i.useCallback)(()=>{if("settings"===l){p.current=!1,f(!1);let e=y.current||"navigation";c(e),Z.default.setCurrentView(e),g(w.current||es.BOAT)}else w.current=o,y.current=l,p.current=!0,f(!0),x("settings"),a(es.APP)},[l,o,g,x]);(0,i.useEffect)(()=>{if("settings"===l){p.current||(p.current=!0,f(!0));return}p.current&&(p.current=!1,f(!1))},[l]);let k=(0,i.useMemo)(()=>null===o?{}:{leftPane:`transition-all duration-300 ${o===es.BOAT?"w-full":o===es.APP?"hidden":"w-2/5"} bg-leftPaneBg h-full relative`,rightPane:`transition-all duration-300 ${o===es.APP?"w-full":o===es.BOAT?"hidden":"w-3/5"} h-full bg-rightPaneBg`},[o]);return n.current?(0,t.jsx)($,{children:(0,t.jsx)(ee,{children:(0,t.jsx)(G.OcearoContextProvider,{children:(0,t.jsx)(q.WeatherContextProvider,{children:(0,t.jsx)(X.TideContextProvider,{children:(0,t.jsxs)("div",{className:"h-[100dvh] flex flex-col bg-hud-bg relative overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex flex-1 min-h-0",children:[(0,t.jsx)("div",{className:k.leftPane,children:(0,t.jsx)(en,{active:o!==es.APP})}),(0,t.jsx)("div",{ref:s,...v(),className:"handle w-1 bg-leftPaneBg h-full cursor-col-resize transition-all duration-200 flex items-center justify-center touch-none",children:(0,t.jsx)("div",{className:"rounded-full w-3 bg-hud-dim h-40 transition-all duration-200 hover:bg-hud-muted border border-hud"})}),(0,t.jsx)("div",{className:k.rightPane,children:(0,t.jsx)(et,{view:l})})]}),(0,t.jsx)("div",{className:"w-full h-16 min-h-16 bg-leftPaneBg border-t border-hud flex items-center justify-center shrink-0",children:(0,t.jsx)(ei,{setRightView:x,toggleAppMenu:m,toggleSettings:_})}),u&&(0,t.jsx)(er,{currentViewMode:o,toggleViewMode:g,handleSetRightView:x,toggleSettings:_,toggleFullscreen:b,setShowAppMenu:d})]})})})})})}):(0,t.jsx)("div",{className:"h-[100dvh] bg-hud-bg flex items-center justify-center",children:(0,t.jsx)("div",{className:"animate-pulse text-hud-main",children:"Loading..."})})}],81694)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,87628,e=>{"use strict";var s=e.i(43476),t=e.i(71645),a=e.i(46932);e.i(85269);var r=e.i(22831),l=e.i(83402),n=e.i(67561),d=e.i(18850);let c=({color:e})=>(0,s.jsx)("span",{className:`inline-block w-2.5 h-2.5 rounded-full ${e} animate-pulse ml-2 shrink-0`});e.s(["default",0,({onSave:e})=>{let{t:i,i18n:o}=(0,r.useTranslation)(),{theme:u,setTheme:h}=(0,n.useOcearoContext)(),p=l.default.getAll(),x=l.default.getComputedSignalKUrl(),m=l.default.getBoatsData(),[g,b]=(0,t.useState)(p),[f,j]=(0,t.useState)(p.useAuthentication||!!p.username||!!p.password),[N,v]=(0,t.useState)(p.signalKUrlSet||!1),[k,w]=(0,t.useState)(null),[y,B]=(0,t.useState)(!1),[C,U]=(0,t.useState)({visible:!1,message:""}),[S,T]=(0,t.useState)("system"),A=(0,t.useCallback)(e=>{B(JSON.stringify(e)!==JSON.stringify(p))},[p]);(0,t.useEffect)(()=>{(async()=>{let e=l.default.getAll();b(e),v(e.signalKUrlSet||!1),j(e.useAuthentication||!!e.username||!!e.password),e.selectedBoat&&w(m.find(s=>s.name===e.selectedBoat)||null)})()},[m]);let D=s=>{let t={...g,...s};b(t),A(t);let a={...t};s.theme&&s.theme!==u&&h(s.theme),s.hasOwnProperty("signalKUrlSet")?!1===s.signalKUrlSet&&(a.signalkUrl=x,a.username="",a.password="",a.useAuthentication=!1):N||s.hasOwnProperty("signalkUrl")||(a.signalkUrl=x,a.username="",a.password=""),s.hasOwnProperty("useAuthentication")&&(a.useAuthentication=s.useAuthentication,s.useAuthentication||(a.username="",a.password="")),l.default.saveConfig(a),e?.(a),B(!1),U({visible:!0,message:i("settings.savedAuto")}),setTimeout(()=>U({visible:!1,message:""}),2e3)};return(0,s.jsxs)("div",{className:"p-8 text-hud-main w-full relative",children:[(0,s.jsxs)("header",{className:"mb-10 flex justify-between items-start sm:items-center relative min-h-[4rem]",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-3xl font-black uppercase tracking-tighter mb-1",children:i("settings.title")}),(0,s.jsx)("p",{className:"text-hud-secondary text-sm font-medium uppercase tracking-widest",children:i("settings.subtitle")})]}),C.visible&&(0,s.jsx)(a.motion.span,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"absolute right-0 top-0 sm:relative text-xs font-black bg-oGreen/20 text-oGreen border border-oGreen/30 px-4 py-2 rounded-full uppercase tracking-widest whitespace-nowrap",children:C.message})]}),(0,s.jsxs)("div",{className:"flex bg-hud-bg p-1 rounded-xl border border-hud mb-8",children:[(0,s.jsx)("button",{onClick:()=>T("system"),className:`flex-1 py-3 px-6 text-xs font-black uppercase tracking-widest transition-all rounded-lg ${"system"===S?"bg-oBlue/15 text-oBlue border border-oBlue/40 shadow-lg shadow-oBlue/10":"text-hud-secondary hover:text-hud-main"}`,children:i("settings.tabSystem")}),(0,s.jsx)("button",{onClick:()=>T("interface"),className:`flex-1 py-3 px-6 text-xs font-black uppercase tracking-widest transition-all rounded-lg ${"interface"===S?"bg-oBlue/15 text-oBlue border border-oBlue/40 shadow-lg shadow-oBlue/10":"text-hud-secondary hover:text-hud-main"}`,children:i("settings.tabInterface")})]}),(0,s.jsx)("div",{className:"space-y-8",children:"system"===S?(0,s.jsxs)("div",{className:"space-y-8 animate-in fade-in duration-500",children:[(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.connection")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-xl bg-hud-bg tesla-hover",children:[(0,s.jsxs)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary flex items-center",children:[i("settings.signalkServer"),!N&&(0,s.jsx)(c,{color:"bg-oBlue"})]}),(0,s.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:N,onChange:e=>{v(e.target.checked),D({signalKUrlSet:e.target.checked})}}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})]}),!N&&(0,s.jsxs)("div",{className:"p-4 rounded-xl bg-hud-bg border border-hud",children:[(0,s.jsx)("span",{className:"text-xs font-bold uppercase tracking-widest text-hud-muted block mb-1",children:i("settings.detectedUrl")}),(0,s.jsx)("span",{className:"text-sm font-mono text-oBlue",children:x})]})]}),N&&(0,s.jsxs)(a.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"space-y-6",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.customEndpoint")}),(0,s.jsx)("input",{type:"text",className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors font-mono",placeholder:"https://your-signalk-server.local",value:g.signalkUrl||"",onChange:e=>D({signalkUrl:e.target.value})})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-xl bg-hud-bg tesla-hover",children:[(0,s.jsxs)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary flex items-center",children:[i("settings.authentication"),N&&!f&&(0,s.jsx)(c,{color:"bg-oBlue"})]}),(0,s.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:f,onChange:e=>{j(e.target.checked),D({useAuthentication:e.target.checked})}}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})]}),f&&(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.username")}),(0,s.jsx)("input",{type:"text",className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors",value:g.username||"",onChange:e=>D({username:e.target.value})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.password")}),(0,s.jsx)("input",{type:"password",className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors",value:g.password||"",onChange:e=>D({password:e.target.value})})]})]})]})]}),(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.vessel")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.activeProfile")}),(0,s.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:g.selectedBoat||"",onChange:e=>{let s=e.target.value;w(m.find(e=>e.name===s)||null),D({selectedBoat:s})},children:[(0,s.jsx)("option",{value:"",className:"bg-hud-bg",children:i("settings.selectVessel")}),m.map(e=>(0,s.jsx)("option",{value:e.name,className:"bg-hud-bg",children:e.name},e.name))]})]}),k&&(0,s.jsxs)("div",{className:"p-4 rounded-xl bg-oBlue/10 border border-oBlue/20 space-y-1",children:[(0,s.jsx)("div",{className:"text-xs font-black uppercase tracking-widest text-oBlue mb-2",children:i("settings.specifications")}),(0,s.jsxs)("div",{className:"text-sm font-medium",children:[i("settings.model"),": ",(0,s.jsx)("span",{className:"text-hud-main",children:k.modelPath})]}),(0,s.jsxs)("div",{className:"text-sm font-medium",children:[i("settings.capabilities"),": ",(0,s.jsx)("span",{className:"text-hud-main",children:k.capabilities?.join(", ")})]})]})]})]}),(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.advanced")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,s.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary flex items-center",children:[i("settings.debugMode"),g.debugMode&&(0,s.jsx)(c,{color:"bg-oYellow"})]}),(0,s.jsx)("p",{className:"text-xs text-hud-muted font-medium uppercase tracking-wider",children:i("settings.debugModeDesc")})]}),(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:g.debugMode||!1,onChange:e=>{let s={debugMode:e.target.checked};!N&&e.target.checked&&(s.signalkUrl="https://demo.signalk.org:443"),D(s)}}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})})]}),(0,s.jsxs)("section",{className:"tesla-card p-6 border-oRed/10",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-oRed/80",children:i("settings.critical")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-oRed/5 mx-4"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-xl bg-oRed/5 border border-oRed/10",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-oRed/80",children:i("settings.factoryReset")}),(0,s.jsx)("p",{className:"text-xs text-oRed/40 font-medium uppercase tracking-wider",children:i("settings.factoryResetDesc")})]}),(0,s.jsx)("button",{onClick:()=>{let e=l.default.getDefaultConfig();b(e),j(!1),e.useAuthentication=!1,v(!1),e.signalKUrlSet=!1,e.showCustomUrls=!1,e.customExternalUrls={},e.theme&&h(e.theme),e.language&&o.changeLanguage(e.language),l.default.saveConfig(e),B(!1)},className:"bg-oRed/20 text-oRed border border-oRed/30 px-6 py-2 rounded-xl text-xs font-black uppercase tracking-widest hover:bg-oRed hover:text-hud-main transition-all duration-300 shadow-lg shadow-oRed/10",children:i("common.reset")})]})]})]}):(0,s.jsxs)("div",{className:"space-y-8 animate-in fade-in duration-500",children:[(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.appearance")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.themeMode")}),(0,s.jsx)("div",{className:"flex bg-hud-bg p-1 rounded-xl border border-hud",children:["dark","light"].map(e=>(0,s.jsx)("button",{onClick:()=>D({theme:e}),className:`flex-1 py-3 px-4 rounded-lg text-xs font-black uppercase tracking-widest transition-all ${g.theme===e?"bg-oBlue/15 text-oBlue border border-oBlue/40 shadow-lg shadow-oBlue/10":"text-hud-secondary hover:text-hud-main"}`,children:e},e))})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.uiAccents")}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-xl bg-hud-bg tesla-hover self-end h-[60px]",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary",children:i("settings.metallic")}),(0,s.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:g.metallicEffect||!1,onChange:e=>D({metallicEffect:e.target.checked})}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})]}),(0,s.jsxs)("div",{className:"p-2 rounded-xl bg-hud-bg border border-hud flex items-center space-x-4",children:[(0,s.jsx)("input",{type:"color",className:"w-12 h-10 bg-transparent cursor-pointer rounded overflow-hidden border-none",value:g.primaryColor||"#09bfff",onChange:e=>D({primaryColor:e.target.value})}),(0,s.jsx)("span",{className:"text-xs font-mono uppercase text-hud-main/60",children:g.primaryColor||"#09bfff"})]})]})]})]})]}),(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.language")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.languageDesc")}),(0,s.jsx)("div",{className:"grid grid-cols-3 md:grid-cols-4 gap-1 bg-hud-bg p-1 rounded-xl border border-hud",children:d.SUPPORTED_LANGUAGES.map(e=>(0,s.jsxs)("button",{onClick:()=>{o.changeLanguage(e.code),D({language:e.code})},className:`py-3 px-2 rounded-lg text-xs font-black uppercase tracking-widest transition-all flex items-center justify-center space-x-2 ${(g.language||"en")===e.code?"bg-oBlue/15 text-oBlue border border-oBlue/40 shadow-lg shadow-oBlue/10":"text-hud-secondary hover:text-hud-main"}`,children:[(0,s.jsx)("span",{children:e.flag}),(0,s.jsx)("span",{children:e.label})]},e.code))})]})]}),(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.navigationHud")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,s.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary",children:i("settings.compassOrientation")}),(0,s.jsx)("p",{className:"text-xs text-hud-muted font-medium uppercase tracking-wider",children:g.compassNorthUp?i("settings.northAtTop"):i("settings.northAtBottom")})]}),(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:g.compassNorthUp||!1,onChange:e=>D({compassNorthUp:e.target.checked})}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),(0,s.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,s.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary",children:i("settings.hide3DCompass")}),(0,s.jsx)("p",{className:"text-xs text-hud-muted font-medium uppercase tracking-wider",children:g.hide3DCompass?i("settings.hidden"):i("settings.visible")})]}),(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:g.hide3DCompass||!1,onChange:e=>D({hide3DCompass:e.target.checked})}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),(0,s.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,s.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary",children:i("settings.hideTrueWind")}),(0,s.jsx)("p",{className:"text-xs text-hud-muted font-medium uppercase tracking-wider",children:g.hideTrueWind?i("settings.hidden"):i("settings.visible")})]}),(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:g.hideTrueWind||!1,onChange:e=>D({hideTrueWind:e.target.checked})}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),(0,s.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,s.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary",children:i("settings.attitudeIndicator")}),(0,s.jsx)("p",{className:"text-xs text-hud-muted font-medium uppercase tracking-wider",children:!1!==g.showAttitudeIndicator?i("settings.visible"):i("settings.hidden")})]}),(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:!1!==g.showAttitudeIndicator,onChange:e=>D({showAttitudeIndicator:e.target.checked})}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),(0,s.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,s.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary",children:i("settings.sailTrimSliders")}),(0,s.jsx)("p",{className:"text-xs text-hud-muted font-medium uppercase tracking-wider",children:!1!==g.showSailTrimSliders?i("settings.visible"):i("settings.hidden")})]}),(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:!1!==g.showSailTrimSliders,onChange:e=>D({showSailTrimSliders:e.target.checked})}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),(0,s.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,s.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary",children:i("settings.rigging")}),(0,s.jsx)("p",{className:"text-xs text-hud-muted font-medium uppercase tracking-wider",children:!1!==g.showRigging?i("settings.visible"):i("settings.hidden")})]}),(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:!1!==g.showRigging,onChange:e=>D({showRigging:e.target.checked})}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})})]}),(0,s.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,s.jsxs)("div",{className:"flex justify-between items-end",children:[(0,s.jsxs)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:[i("settings.aisLengthScaling"),(0,s.jsx)("span",{className:"block text-xs text-hud-muted font-medium mt-1 uppercase",children:i("settings.mapTargetVisibility")})]}),(0,s.jsx)("span",{className:"text-xl font-black text-oBlue bg-oBlue/10 px-3 py-1 rounded-lg",children:g.aisLengthScalingFactor||.7})]}),(0,s.jsx)("input",{type:"range",className:"w-full h-1.5 bg-hud-bg-elevated rounded-lg appearance-none cursor-pointer accent-oBlue",min:"0.1",max:"2.0",step:"0.1",value:g.aisLengthScalingFactor||.7,onChange:e=>D({aisLengthScalingFactor:parseFloat(e.target.value)})})]})]}),(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.unitsValues")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.distanceUnits")}),(0,s.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:g.distanceUnits||"nm",onChange:e=>D({distanceUnits:e.target.value}),children:[(0,s.jsx)("option",{value:"nm",className:"bg-hud-bg",children:"Nautical Miles"}),(0,s.jsx)("option",{value:"km",className:"bg-hud-bg",children:"Kilometres"}),(0,s.jsx)("option",{value:"mi",className:"bg-hud-bg",children:"Miles"})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.depthUnits")}),(0,s.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:g.depthUnits||"m",onChange:e=>D({depthUnits:e.target.value}),children:[(0,s.jsx)("option",{value:"m",className:"bg-hud-bg",children:"metres"}),(0,s.jsx)("option",{value:"ft",className:"bg-hud-bg",children:"feet"}),(0,s.jsx)("option",{value:"fa",className:"bg-hud-bg",children:"fathoms"})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.speedUnits")}),(0,s.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:g.speedUnits||"kn",onChange:e=>D({speedUnits:e.target.value}),children:[(0,s.jsx)("option",{value:"kn",className:"bg-hud-bg",children:"knots"}),(0,s.jsx)("option",{value:"km/h",className:"bg-hud-bg",children:"km/h"}),(0,s.jsx)("option",{value:"mph",className:"bg-hud-bg",children:"mph"}),(0,s.jsx)("option",{value:"m/s",className:"bg-hud-bg",children:"m/s"})]})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.temperatureUnits")}),(0,s.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:g.temperatureUnits||"C",onChange:e=>D({temperatureUnits:e.target.value}),children:[(0,s.jsx)("option",{value:"C",className:"bg-hud-bg",children:"Celsius"}),(0,s.jsx)("option",{value:"F",className:"bg-hud-bg",children:"Fahrenheit"})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.positionFormat")}),(0,s.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:g.positionFormat||"DD",onChange:e=>D({positionFormat:e.target.value}),children:[(0,s.jsx)("option",{value:"DD",className:"bg-hud-bg",children:"-128.12345"}),(0,s.jsx)("option",{value:"DM",className:"bg-hud-bg",children:"-128° 07.407'"}),(0,s.jsx)("option",{value:"DMS",className:"bg-hud-bg",children:"-128° 07' 24.4\""})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.preferTrueValues")}),(0,s.jsxs)("select",{className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors appearance-none cursor-pointer",value:!1!==g.preferTrueValues?"true":"false",onChange:e=>D({preferTrueValues:"true"===e.target.value}),children:[(0,s.jsx)("option",{value:"true",className:"bg-hud-bg",children:i("settings.preferTrue")}),(0,s.jsx)("option",{value:"false",className:"bg-hud-bg",children:i("settings.preferMagnetic")})]})]})]})]}),(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.preferredPaths")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.trueWindSpeed")}),(0,s.jsx)("div",{className:"space-y-2 p-4 rounded-xl bg-hud-bg border border-hud",children:[{value:"speedTrue",label:i("settings.pathSpeedTrue")},{value:"speedApparent",label:i("settings.pathSpeedApparent")}].map(e=>(0,s.jsxs)("label",{className:"flex items-center space-x-3 cursor-pointer",children:[(0,s.jsx)("input",{type:"radio",name:"preferredWindSpeedPath",value:e.value,checked:(g.preferredWindSpeedPath||"speedTrue")===e.value,onChange:e=>D({preferredWindSpeedPath:e.target.value}),className:"w-4 h-4 accent-oBlue"}),(0,s.jsx)("span",{className:"text-sm text-hud-main",children:e.label})]},e.value))})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.trueWindDirection")}),(0,s.jsx)("div",{className:"space-y-2 p-4 rounded-xl bg-hud-bg border border-hud",children:[{value:"directionTrue",label:i("settings.pathDirectionTrue")},{value:"angleApparent",label:i("settings.pathAngleApparent")},{value:"angleTrueWater",label:i("settings.pathAngleTrueWater")}].map(e=>(0,s.jsxs)("label",{className:"flex items-center space-x-3 cursor-pointer",children:[(0,s.jsx)("input",{type:"radio",name:"preferredWindDirectionPath",value:e.value,checked:(g.preferredWindDirectionPath||"directionTrue")===e.value,onChange:e=>D({preferredWindDirectionPath:e.target.value}),className:"w-4 h-4 accent-oBlue"}),(0,s.jsx)("span",{className:"text-sm text-hud-main",children:e.label})]},e.value))})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:i("settings.headingCog")}),(0,s.jsx)("div",{className:"space-y-2 p-4 rounded-xl bg-hud-bg border border-hud",children:[{value:"courseOverGroundTrue",label:i("settings.pathCourseOverGroundTrue")},{value:"headingTrue",label:i("settings.pathHeadingTrue")},{value:"courseOverGroundMagnetic",label:i("settings.pathCourseOverGroundMagnetic")},{value:"headingMagnetic",label:i("settings.pathHeadingMagnetic")}].map(e=>(0,s.jsxs)("label",{className:"flex items-center space-x-3 cursor-pointer",children:[(0,s.jsx)("input",{type:"radio",name:"preferredHeadingPath",value:e.value,checked:(g.preferredHeadingPath||"courseOverGroundTrue")===e.value,onChange:e=>D({preferredHeadingPath:e.target.value}),className:"w-4 h-4 accent-oBlue"}),(0,s.jsx)("span",{className:"text-sm text-hud-main",children:e.label})]},e.value))})]})]})]}),(0,s.jsxs)("section",{className:"tesla-card p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h2",{className:"text-lg font-black uppercase tracking-widest text-hud-main/90",children:i("settings.externalLinks")}),(0,s.jsx)("div",{className:"h-[1px] flex-grow bg-hud-border mx-4"})]}),(0,s.jsx)("div",{className:"p-4 rounded-xl bg-hud-bg tesla-hover border border-hud",children:(0,s.jsxs)("label",{className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:"text-sm font-bold uppercase tracking-widest text-hud-secondary",children:i("settings.customToolUrls")}),(0,s.jsx)("p",{className:"text-xs text-hud-muted font-medium uppercase tracking-wider",children:i("settings.customToolUrlsDesc")})]}),(0,s.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:g.showCustomUrls||!1,onChange:e=>D({showCustomUrls:e.target.checked})}),(0,s.jsx)("div",{className:"relative w-11 h-6 bg-hud-bg-elevated peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-hud-main after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-hud-main after:border-hud-main after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-oBlue"})]})}),g.showCustomUrls&&(0,s.jsx)(a.motion.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"space-y-6 pt-4 border-t border-hud",children:(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[{id:"navigation",label:i("settings.urlNavigation"),placeholder:"${signalkUrl}/@signalk/freeboard-sk/"},{id:"instrument",label:i("settings.urlInstruments"),placeholder:"${signalkUrl}/@mxtommy/kip/"},{id:"dashboard",label:i("settings.urlMetrics"),placeholder:"${signalkUrl}/grafana"},{id:"webcam1",label:i("settings.urlWebcamAlpha"),placeholder:"https://example.com/stream1"},{id:"webcam2",label:i("settings.urlWebcamBeta"),placeholder:"https://example.com/stream2"},{id:"weather",label:i("settings.urlAtmospheric"),placeholder:"https://windy.com/..."}].map(e=>(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-xs font-black uppercase tracking-widest text-hud-secondary ml-1",children:e.label}),(0,s.jsx)("input",{type:"text",className:"w-full bg-hud-bg border border-hud rounded-xl p-4 text-sm text-hud-main focus:outline-none focus:border-oBlue/50 transition-colors font-mono",placeholder:e.placeholder,value:g.customExternalUrls?.[e.id]||"",onChange:s=>{let t={...g.customExternalUrls};t[e.id]=s.target.value,D({customExternalUrls:t})}})]},e.id))})})]})]})})]})}])},34900,e=>{e.n(e.i(87628))}]);
|
|
@@ -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))}]);
|