@rr0/ufoathome 0.172.0 → 0.174.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/dist-embed-scene/{AdsbLolArchiveProvider-CmrPztlQ.js → AdsbLolArchiveProvider-liG2xlWV.js} +1 -1
- package/dist-embed-scene/{BeamEditor-moWuVLT-.js → BeamEditor-DRrVChwI.js} +1 -1
- package/dist-embed-scene/{BeamSystem-DXTXXbc7.js → BeamSystem-CEzXZFNu.js} +1 -1
- package/dist-embed-scene/{ContrailSystem-CcDlnjiD.js → ContrailSystem-BSbI2jUe.js} +1 -1
- package/dist-embed-scene/{Flightradar24Provider-6Yk43zPK.js → Flightradar24Provider-BkhQ2iqB.js} +1 -1
- package/dist-embed-scene/GLTFLoader-UnRP5t__.js +1 -0
- package/dist-embed-scene/{HeadlightSystem-B0Ubhwxs.js → HeadlightSystem-Dvc4Rbz-.js} +1 -1
- package/dist-embed-scene/{LanternEditor-4v_UpY6t.js → LanternEditor-DCP-Wz-Q.js} +1 -1
- package/dist-embed-scene/{LaserBeam-DJnJ5Okd.js → LaserBeam-DfUrxrC_.js} +1 -1
- package/dist-embed-scene/{LaunchEditor-DKZ1U9ZU.js → LaunchEditor-DzToEZHF.js} +1 -1
- package/dist-embed-scene/{LaunchPlume-DwOSrKP_.js → LaunchPlume-D7l6FeNX.js} +1 -1
- package/dist-embed-scene/{LaunchSimulation-ClGdZJHr.js → LaunchSimulation-DKpm2Xqs.js} +1 -1
- package/dist-embed-scene/{ModuleSession-BGQH5SEC.js → ModuleSession-VVjH7nnr.js} +2 -2
- package/dist-embed-scene/ModuleThree-5mmzRPs2.js +1 -0
- package/dist-embed-scene/ParameterForm-BDYo2bPV.js +94 -0
- package/dist-embed-scene/{ReentryEditor-Rr_H4UZf.js → ReentryEditor-Dk_CUVvM.js} +1 -1
- package/dist-embed-scene/{ReentrySimulation-CrhMgBEf.js → ReentrySimulation-D-FR761p.js} +1 -1
- package/dist-embed-scene/ReferenceSystem-BUj-6A76.js +1 -0
- package/dist-embed-scene/{SceneNames_en-BL9uncGh.js → SceneNames_en-DGqvOiKr.js} +1 -1
- package/dist-embed-scene/{SceneNames_es-CH-eXo8N.js → SceneNames_es-CjXqPgH3.js} +1 -1
- package/dist-embed-scene/{SceneNames_fr-DcyxwufJ.js → SceneNames_fr-BJqNnvOr.js} +1 -1
- package/dist-embed-scene/{SceneNames_it-DT3v8j9C.js → SceneNames_it-BYKERxdw.js} +1 -1
- package/{dist-embed-sighting/TimelineTracks-Cuz5LKXi.js → dist-embed-scene/TimelineTracks-BPVmDKpc.js} +1 -1
- package/dist-embed-scene/{TraceSystem-D7pxye9d.js → TraceSystem-gVZk_ffU.js} +1 -1
- package/dist-embed-scene/{UfoMessages_en-DiW_p05E.js → UfoMessages_en-wpJoNj_d.js} +1 -1
- package/dist-embed-scene/rr0-scene.mjs +299 -279
- package/dist-embed-scene/sightingSchema-DZXw4x_Q.js +1 -0
- package/dist-embed-scene/trafficRuntime-BgM4IVmy.js +2 -0
- package/dist-embed-sighting/{AdsbLolArchiveProvider-B7vb8UEW.js → AdsbLolArchiveProvider-CkHzWGQi.js} +1 -1
- package/dist-embed-sighting/BallesterGuaspAssessor-C3AZoSYJ.js +1 -0
- package/dist-embed-sighting/{BeamEditor-EW6OYCVG.js → BeamEditor-BJNdmRuT.js} +1 -1
- package/dist-embed-sighting/{BeamSystem-Bm8JAQ9L.js → BeamSystem-K3DiM1GA.js} +1 -1
- package/dist-embed-sighting/{ContrailSystem-Bgre4cLs.js → ContrailSystem-CRHKaUK-.js} +1 -1
- package/dist-embed-sighting/CoverageAssessor-BSoRnjHD.js +1 -0
- package/dist-embed-sighting/{Flightradar24Provider-DD9gPyCn.js → Flightradar24Provider--mgNvbo7.js} +1 -1
- package/dist-embed-sighting/{GLTFLoader-BWnr870a.js → GLTFLoader-NORF7Wya.js} +1 -1
- package/dist-embed-sighting/{HeadlightSystem-CmppP6Mm.js → HeadlightSystem-BrccF2M7.js} +1 -1
- package/dist-embed-sighting/{HynekAssessor-tNpli5GC.js → HynekAssessor-BNn-J5RL.js} +1 -1
- package/dist-embed-sighting/{LanternEditor-BDrPaoos.js → LanternEditor-v7J6meRk.js} +1 -1
- package/dist-embed-sighting/{LaserBeam-Dfjpv2LA.js → LaserBeam-CrsVNYnr.js} +1 -1
- package/dist-embed-sighting/{LaunchEditor-Dm5CIbfP.js → LaunchEditor-BQKUng5i.js} +2 -2
- package/dist-embed-sighting/{LaunchPlume-DH8ZMXrj.js → LaunchPlume-zs7QuS9V.js} +1 -1
- package/dist-embed-sighting/{LaunchSimulation-3m1LUs2t.js → LaunchSimulation-Vj5v57hz.js} +1 -1
- package/dist-embed-sighting/{ModuleSession-Bg99aje_.js → ModuleSession-BgHWPEDv.js} +2 -2
- package/dist-embed-sighting/ModuleThree-cSwqALyP.js +1 -0
- package/dist-embed-sighting/{NearestApproach-hO2JFAfU.js → NearestApproach-Dm99M0L8.js} +1 -1
- package/dist-embed-sighting/ParameterForm-BEtRCdpW.js +94 -0
- package/dist-embed-sighting/{PoherAssessor-CxcKyCRu.js → PoherAssessor-BUqWHdc2.js} +1 -1
- package/dist-embed-sighting/{RailwaySystem-C920HhY6.js → RailwaySystem-Bb0sdKJq.js} +1 -1
- package/dist-embed-sighting/ReadingCheckTexts_en-eq6teExJ.js +1 -0
- package/dist-embed-sighting/ReadingCheckTexts_es-CR_JJZMV.js +1 -0
- package/dist-embed-sighting/ReadingCheckTexts_fr-pcDleIvY.js +1 -0
- package/dist-embed-sighting/ReadingCheckTexts_it-MFKeoXnq.js +1 -0
- package/dist-embed-sighting/{ReentryEditor-iXEKSCu_.js → ReentryEditor-CMnCxTU4.js} +2 -2
- package/dist-embed-sighting/ReentrySimulation-B7bV2GTy.js +1 -0
- package/dist-embed-sighting/{ReferenceSystem-DJUjnjNZ.js → ReferenceSystem-s-ggwBEd.js} +1 -1
- package/dist-embed-sighting/{RoadMarkings-DDNrriGo.js → RoadMarkings-DiBAmqci.js} +1 -1
- package/dist-embed-sighting/{SceneNames_en-BCismFgW.js → SceneNames_en-Cy3_acfm.js} +1 -1
- package/dist-embed-sighting/{SceneNames_es-u83jdbyr.js → SceneNames_es-VxS6QttN.js} +1 -1
- package/dist-embed-sighting/{SceneNames_fr-hA9CGBs-.js → SceneNames_fr-Dg8Zgkb7.js} +1 -1
- package/dist-embed-sighting/{SceneNames_it-Bp7twqSK.js → SceneNames_it-Cf-I4HxZ.js} +1 -1
- package/dist-embed-sighting/{SightingMessages_en-BcD8zikg.js → SightingMessages_en-BjIUyT4W.js} +1 -1
- package/dist-embed-sighting/{SightingMessages_es-MrTWzprC.js → SightingMessages_es-TueslN1u.js} +1 -1
- package/dist-embed-sighting/{SightingMessages_fr-CPZ7UIEm.js → SightingMessages_fr-Dfp6mAcU.js} +1 -1
- package/dist-embed-sighting/{SightingMessages_it-0JPA_6O9.js → SightingMessages_it-C0VvJY01.js} +1 -1
- package/{dist-embed-scene/TimelineTracks-DcYnMVi8.js → dist-embed-sighting/TimelineTracks-D_Oedo7x.js} +1 -1
- package/dist-embed-sighting/{TraceSystem-BrpqiAAJ.js → TraceSystem-DW2kF0O_.js} +1 -1
- package/dist-embed-sighting/{WaterSystem-D3andNtL.js → WaterSystem-B1eVrX5D.js} +1 -1
- package/dist-embed-sighting/rr0-sighting.mjs +3744 -3724
- package/dist-embed-sighting/sightingSchema-DZXw4x_Q.js +1 -0
- package/dist-embed-sighting/trafficRuntime-D2QZwJQQ.js +2 -0
- package/dist-embed-sighting-editor/{AdsbLolArchiveProvider-DS9ev-HU.js → AdsbLolArchiveProvider-CpaPx7Px.js} +1 -1
- package/dist-embed-sighting-editor/BallesterGuaspAssessor-BIHqYTXC.js +1 -0
- package/dist-embed-sighting-editor/{BeamEditor-DQp2vKdn.js → BeamEditor-8NrnezeZ.js} +1 -1
- package/dist-embed-sighting-editor/{BeamSystem-Dd5G0PNW.js → BeamSystem-CaxJaT_y.js} +1 -1
- package/dist-embed-sighting-editor/{BodyEditor-CamqX5Xg.js → BodyEditor-Cj7TgjV-.js} +2 -2
- package/dist-embed-sighting-editor/{ContrailSystem-DYAYamnm.js → ContrailSystem-CTAB7sqQ.js} +1 -1
- package/dist-embed-sighting-editor/CoverageAssessor-CHa6U2A7.js +1 -0
- package/dist-embed-sighting-editor/Flightradar24Provider-DAS99x3c.js +1 -0
- package/dist-embed-sighting-editor/{GLTFLoader-DQ9JYWIM.js → GLTFLoader-BLpME7vC.js} +1 -1
- package/dist-embed-sighting-editor/GeoExportTexts-DAllttgw.js +1 -0
- package/dist-embed-sighting-editor/GeoExportTexts_en-Dq0fSJQp.js +1 -0
- package/dist-embed-sighting-editor/GeoExportTexts_es-CoVHdOo0.js +1 -0
- package/dist-embed-sighting-editor/GeoExportTexts_fr-DVAMpZIR.js +1 -0
- package/dist-embed-sighting-editor/GeoExportTexts_it-Bh1uJBQp.js +1 -0
- package/dist-embed-sighting-editor/GeoJsonExport-3snOe-2J.js +2 -0
- package/dist-embed-sighting-editor/GeoJsonImport-CIftC0ws.js +1 -0
- package/dist-embed-sighting-editor/GeographicFigures-CLBS2HJ-.js +1 -0
- package/dist-embed-sighting-editor/{HeadlightSystem-FfcayJJX.js → HeadlightSystem-Crmc9zbw.js} +1 -1
- package/dist-embed-sighting-editor/{HynekAssessor-CI7wuMYw.js → HynekAssessor-D_UJjt62.js} +1 -1
- package/dist-embed-sighting-editor/{InterviewEditorElement-Bwn4BIQi.js → InterviewEditorElement-DtBxBtVw.js} +2 -2
- package/dist-embed-sighting-editor/KmlExport-B0SKgn4U.js +19 -0
- package/dist-embed-sighting-editor/{LanternEditor-DT2LvlBk.js → LanternEditor-DWIefcSu.js} +1 -1
- package/dist-embed-sighting-editor/{LaserBeam-DCfAd_IK.js → LaserBeam-C_5uHg0U.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchEditor-hAMtWhby.js → LaunchEditor-ByC2Emjf.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchPlume-B1QcGtTl.js → LaunchPlume-CpAzgYlA.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchSimulation-Bl72jnqq.js → LaunchSimulation-D4CHeSnk.js} +1 -1
- package/dist-embed-sighting-editor/{ModelSource-CE5kDeLL.js → ModelSource-UJizu116.js} +1 -1
- package/dist-embed-sighting-editor/{ModelThumbnails-cuvgO3ks.js → ModelThumbnails-C6MY31ux.js} +1 -1
- package/dist-embed-sighting-editor/{ModelViewer-DjGC6fMB.js → ModelViewer-vYoh4mVh.js} +1 -1
- package/dist-embed-sighting-editor/{ModuleConformance-H7LbISvs.js → ModuleConformance-D6VFY6JB.js} +2 -2
- package/dist-embed-sighting-editor/{ModuleSession-BXk5ijvF.js → ModuleSession-Dsi0JKlc.js} +2 -2
- package/dist-embed-sighting-editor/ModuleThree-HknjibVQ.js +1 -0
- package/dist-embed-sighting-editor/{ModulesPanelElement-B1KHXTpq.js → ModulesPanelElement-CeEA058j.js} +3 -3
- package/dist-embed-sighting-editor/NearestApproach-B8jOOhQy.js +1 -0
- package/dist-embed-sighting-editor/{PoherAssessor-YeV1i0Lw.js → PoherAssessor-COIGIPYG.js} +1 -1
- package/dist-embed-sighting-editor/{RailwaySystem-CuqGInI5.js → RailwaySystem-DPEyve9f.js} +1 -1
- package/dist-embed-sighting-editor/ReadingCheckTexts_en-eq6teExJ.js +1 -0
- package/dist-embed-sighting-editor/ReadingCheckTexts_es-CR_JJZMV.js +1 -0
- package/dist-embed-sighting-editor/ReadingCheckTexts_fr-pcDleIvY.js +1 -0
- package/dist-embed-sighting-editor/ReadingCheckTexts_it-MFKeoXnq.js +1 -0
- package/dist-embed-sighting-editor/{ReentryEditor-Bt90y2I7.js → ReentryEditor-pBwTz0Zh.js} +2 -2
- package/dist-embed-sighting-editor/{ReentrySimulation-DS7Q5nso.js → ReentrySimulation-Dfg-6_Da.js} +1 -1
- package/dist-embed-sighting-editor/{ReferenceSystem-D-bNZI8e.js → ReferenceSystem-CGC3BqZJ.js} +1 -1
- package/dist-embed-sighting-editor/{RoadMarkings-GIdi730L.js → RoadMarkings-Cr-sSvIY.js} +1 -1
- package/dist-embed-sighting-editor/{SceneNames_en-DNhr4wdu.js → SceneNames_en-DggkchR4.js} +1 -1
- package/dist-embed-sighting-editor/{SceneNames_es-DP1RW7Iw.js → SceneNames_es-BtXXqtTk.js} +1 -1
- package/dist-embed-sighting-editor/{SceneNames_fr-mGHb5j1M.js → SceneNames_fr-I6FOP0oQ.js} +1 -1
- package/dist-embed-sighting-editor/{SceneNames_it-fxUdb_jZ.js → SceneNames_it-DrW4eXBX.js} +1 -1
- package/dist-embed-sighting-editor/SightingEditorMessages_en-G8-sD56V.js +12 -0
- package/dist-embed-sighting-editor/SightingEditorMessages_es-DEmsmIRU.js +12 -0
- package/dist-embed-sighting-editor/SightingEditorMessages_fr-D2HXab_N.js +12 -0
- package/dist-embed-sighting-editor/SightingEditorMessages_it-LpFdlGY5.js +12 -0
- package/dist-embed-sighting-editor/{SightingFileEditor-CXaZ0zyV.js → SightingFileEditor-BymOujPF.js} +1 -1
- package/dist-embed-sighting-editor/TraceImport-CL8lefw6.js +2 -0
- package/dist-embed-sighting-editor/{TraceSystem-CUMKKQY4.js → TraceSystem-BAZq4Mcs.js} +2 -2
- package/dist-embed-sighting-editor/{UfoMessages_en-DVlS5Elx.js → UfoMessages_en-BxhQNf5z.js} +1 -1
- package/dist-embed-sighting-editor/{WaterSystem-BBrkl1Y3.js → WaterSystem-1Sp5frNp.js} +1 -1
- package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +5267 -5235
- package/dist-embed-sighting-editor/sightingSchema-CUVU5eOl.js +1 -0
- package/dist-embed-sighting-editor/trafficRuntime-C9bT5cO9.js +2 -0
- package/package.json +1 -1
- package/dist-embed-scene/GLTFLoader-BYBOfwYv.js +0 -1
- package/dist-embed-scene/ModuleThree-4waMG8o7.js +0 -1
- package/dist-embed-scene/ParameterForm-DTX-QXNh.js +0 -85
- package/dist-embed-scene/ReferenceSystem-B8i0qbr6.js +0 -1
- package/dist-embed-scene/sightingSchema-9ZtPvUrR.js +0 -1
- package/dist-embed-scene/trafficRuntime-cS8H9PlA.js +0 -2
- package/dist-embed-sighting/BallesterGuaspAssessor-VMcyGlQb.js +0 -1
- package/dist-embed-sighting/CoverageAssessor-C7k3p3iN.js +0 -1
- package/dist-embed-sighting/ModuleThree-DTr6m1tj.js +0 -1
- package/dist-embed-sighting/ParameterForm-CbQHBPju.js +0 -85
- package/dist-embed-sighting/ReadingCheckTexts_en-DMSQIyl-.js +0 -1
- package/dist-embed-sighting/ReadingCheckTexts_es-U0mwsu1B.js +0 -1
- package/dist-embed-sighting/ReadingCheckTexts_fr-BGsdUnRK.js +0 -1
- package/dist-embed-sighting/ReadingCheckTexts_it-BGVlr3JP.js +0 -1
- package/dist-embed-sighting/ReentrySimulation-BfkUcIGM.js +0 -1
- package/dist-embed-sighting/sightingSchema-9ZtPvUrR.js +0 -1
- package/dist-embed-sighting/trafficRuntime-BKg4PEmv.js +0 -2
- package/dist-embed-sighting-editor/BallesterGuaspAssessor-Baptv_sO.js +0 -1
- package/dist-embed-sighting-editor/CoverageAssessor-C9c1Isxw.js +0 -1
- package/dist-embed-sighting-editor/Flightradar24Provider-VG9pYq17.js +0 -1
- package/dist-embed-sighting-editor/ModuleThree-DsbRgMxg.js +0 -1
- package/dist-embed-sighting-editor/NearestApproach-Bw4UBKQD.js +0 -1
- package/dist-embed-sighting-editor/ReadingCheckTexts_en-DMSQIyl-.js +0 -1
- package/dist-embed-sighting-editor/ReadingCheckTexts_es-U0mwsu1B.js +0 -1
- package/dist-embed-sighting-editor/ReadingCheckTexts_fr-BGsdUnRK.js +0 -1
- package/dist-embed-sighting-editor/ReadingCheckTexts_it-BGVlr3JP.js +0 -1
- package/dist-embed-sighting-editor/SightingEditorMessages_en-B1i2vZCG.js +0 -12
- package/dist-embed-sighting-editor/SightingEditorMessages_es-DLhzlNDm.js +0 -12
- package/dist-embed-sighting-editor/SightingEditorMessages_fr-B5jPMP9L.js +0 -12
- package/dist-embed-sighting-editor/SightingEditorMessages_it-BJwvaU7I.js +0 -12
- package/dist-embed-sighting-editor/sightingSchema-9ZtPvUrR.js +0 -1
- package/dist-embed-sighting-editor/trafficRuntime-CBsyESZY.js +0 -2
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import{ao as p,S as D,ap as f}from"./rr0-sighting.mjs";class Y{static attach(t,e,i){t.classList.add(e);const n=`${e}-style`;if(t.parentElement?.querySelector(`:scope > style.${n}`))return;const s=t.ownerDocument.createElement("style");s.className=n,s.textContent=i,t.before(s)}}class V{constructor(t,e,i,n){this.button=t,this.onPick=i,this.idOf=n;const s=this.panel=t.ownerDocument.createElement("div");s.id=e,s.className="add-menu",s.setAttribute("popover",""),s.setAttribute("role","menu");const o=`--add-menu-${e}`;t.style.setProperty("anchor-name",o),s.style.setProperty("position-anchor",o),t.setAttribute("popovertarget",e),t.setAttribute("aria-haspopup","menu"),t.after(s)}static CSS=`
|
|
2
|
-
.add-menu { padding: .3em 0; border: 1px solid color-mix(in srgb, CanvasText 30%, transparent); border-radius: 4px; background: Canvas; color: CanvasText;
|
|
3
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, .25); max-height: 60vh; overflow-y: auto; font-size: .9em; }
|
|
4
|
-
@supports (position-area: bottom span-left) {
|
|
5
|
-
.add-menu:popover-open { inset: auto; position-area: bottom span-left; margin: .2em 0 0 0; }
|
|
6
|
-
}
|
|
7
|
-
.add-menu-choice { display: block; width: 100%; padding: .25em .9em; border: 0; background: none; color: inherit; font: inherit; text-align: left;
|
|
8
|
-
cursor: pointer; white-space: nowrap; }
|
|
9
|
-
.add-menu-choice:hover, .add-menu-choice:focus-visible { background: color-mix(in srgb, CanvasText 12%, transparent); }
|
|
10
|
-
.add-menu-choice[aria-disabled="true"] { opacity: .45; cursor: not-allowed; background: none; }
|
|
11
|
-
.add-menu-choice[hidden] { display: none; }
|
|
12
|
-
`;panel;kinds=[];last;setKinds(t){this.kinds=t;const e=this.button.ownerDocument;this.panel.replaceChildren(...t.map(i=>{const n=e.createElement("button");return n.type="button",n.className="add-menu-choice",n.setAttribute("role","menuitem"),this.idOf&&(n.id=this.idOf(i.value)),n.dataset.value=i.value,n.textContent=i.label,n.hidden=i.hidden===!0,i.disabledReason&&(n.setAttribute("aria-disabled","true"),n.title=i.disabledReason),n.addEventListener("click",()=>{n.getAttribute("aria-disabled")!=="true"&&(this.close(),this.last=i.value,this.onPick(i.value))}),n}))}setDisabled(t,e){this.kinds=this.kinds.map(n=>n.value===t?{...n,disabledReason:e}:n);const i=[...this.panel.children].find(n=>n.dataset.value===t);i&&(e?(i.setAttribute("aria-disabled","true"),i.title=e):(i.removeAttribute("aria-disabled"),i.title=""))}labelOf(t){return this.kinds.find(e=>e.value===t)?.label??t}get lastPicked(){return this.last}close(){if(typeof this.panel.hidePopover=="function")try{this.panel.matches(":popover-open")&&this.panel.hidePopover()}catch{}}}class l{static draw(t,e="none"){return`<svg class="icon" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" fill="${e}" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">${t}</svg>`}static TRASH=l.draw('<path d="M2.5 4.5h11"/><path d="M6 4.5V3h4v1.5"/><path d="M4 4.5l.7 9h6.6l.7-9"/><path d="M6.8 7v4.5M9.2 7v4.5"/>');static TARGET=l.draw('<circle cx="8" cy="8" r="5"/><circle cx="8" cy="8" r="1.6"/><path d="M8 1v2.2M8 12.8V15M1 8h2.2M12.8 8H15"/>');static PLAY=l.draw('<path d="M5 3.2v9.6L12.6 8z"/>',"currentColor");static PAUSE=l.draw('<path d="M5.5 3.5v9M10.5 3.5v9"/>');static RECORD=l.draw('<circle cx="8" cy="8" r="4.2" fill="var(--error, #d93025)" stroke="none"/>');static STOP=l.draw('<rect x="4" y="4" width="8" height="8" rx="1.2"/>',"currentColor");static PREVIOUS_MARK=l.draw('<path d="M6.5 4 2.5 8l4 4"/><path d="M11 5.2 13.8 8 11 10.8 8.2 8z"/>');static NEXT_MARK=l.draw('<path d="M9.5 4l4 4-4 4"/><path d="M5 5.2 7.8 8 5 10.8 2.2 8z"/>');static CLOSE=l.draw('<path d="M4 4l8 8M12 4l-8 8"/>');static PLUS=l.draw('<path d="M8 3v10M3 8h10"/>');static METEOR=l.draw('<path d="M2.5 2.5l7 7"/><path d="M5.5 2.5l5 5"/><circle cx="11.5" cy="11.5" r="2"/>');static COMET=l.draw('<circle cx="11" cy="11" r="2.4"/><path d="M9.3 9.3 2.5 2.5M9 11.2 3 7M11.2 9 7 3"/>');static STAR=l.draw('<path d="M8 2.2l1.7 3.6 3.9.5-2.9 2.7.8 3.9L8 11l-3.5 1.9.8-3.9-2.9-2.7 3.9-.5z"/>');static SATELLITE=l.draw('<rect x="6.3" y="6.3" width="3.4" height="3.4" transform="rotate(45 8 8)"/><path d="M5.4 5.4 3 3M10.6 10.6 13 13"/><path d="M1.8 4.2 4.2 1.8M11.8 14.2l2.4-2.4"/><path d="M10.5 3.5a3 3 0 0 1 2 2"/>');static FIREBALL=l.draw('<circle cx="10.5" cy="10.5" r="2.6"/><path d="M8.6 8.6 3 3M8 10.6 4.5 8.5M10.6 8 8.5 4.5"/>');static SUMMARY=l.draw('<rect x="3" y="2" width="10" height="12" rx="1.5"/><path d="M5.5 5.5h5M5.5 8h5M5.5 10.5h3"/>');static WITNESS=l.draw('<circle cx="8" cy="5" r="2.6"/><path d="M2.8 14c.6-3 2.6-4.6 5.2-4.6s4.6 1.6 5.2 4.6"/>');static LOCATION=l.draw('<path d="M8 14.3s4.5-4.3 4.5-7.8a4.5 4.5 0 0 0-9 0c0 3.5 4.5 7.8 4.5 7.8z"/><circle cx="8" cy="6.5" r="1.6"/>');static DATE=l.draw('<rect x="2.3" y="3.3" width="11.4" height="10.4" rx="1.5"/><path d="M2.3 6.6h11.4M5.3 1.8v2.8M10.7 1.8v2.8"/>');static ENVIRONMENT=l.draw('<path d="M1.5 14h13"/><path d="M2.8 14V8.3L6.3 5.5l3.5 2.8V14"/><path d="M12.2 14V9.4"/><circle cx="12.2" cy="7.4" r="2.1"/>');static SKY=l.draw('<path d="M4.6 12.5h7a2.6 2.6 0 0 0 .3-5.2 3.8 3.8 0 0 0-7.3-.6 2.9 2.9 0 0 0 0 5.8z"/>');static PHENOMENON=l.draw('<ellipse cx="8" cy="9" rx="6.3" ry="2.1"/><path d="M4.6 7.8a3.4 3.4 0 0 1 6.8 0"/><path d="M5 13.4l.6-1.4M11 13.4l-.6-1.4M8 14v-1.4"/>');static SOUND=l.draw('<path d="M2.5 6.2h2.3L8 3.5v9L4.8 9.8H2.5z"/><path d="M10.5 6a2.8 2.8 0 0 1 0 4M12.3 4.2a5.4 5.4 0 0 1 0 7.6"/>');static PICTURES=l.draw('<rect x="2" y="3" width="12" height="10" rx="1.5"/><circle cx="5.8" cy="6.4" r="1.2"/><path d="M2.5 12l3.8-3.6 2.4 2.2 2.2-1.8 2.6 2.5"/>');static FILES=l.draw('<path d="M4 1.8h5.2L12.5 5v9.2H4z"/><path d="M9 1.8V5.2h3.5"/>');static BY_GLYPH={"🗑":l.TRASH,"🎯":l.TARGET,"+":l.PLUS,"✕":l.CLOSE,"▶":l.PLAY,"⏸":l.PAUSE,"⏺":l.RECORD,"⏹":l.STOP};static show(t,e){if(t.dataset.icon===e&&t.firstChild)return;const i=l.BY_GLYPH[e];i?t.innerHTML=i:t.textContent=e,t.dataset.icon=e}static CSS=`
|
|
13
|
-
.icon { display: block; flex: none; }
|
|
14
|
-
button:has(> .icon:only-child) { display: inline-flex; align-items: center; justify-content: center; }
|
|
15
|
-
`}class L{constructor(t){this.options=t,this.row=document.createElement("div"),this.row.className="element-list-row",this.pickerRow=document.createElement("label"),this.pickerRow.className="element-list-picker",this.select=document.createElement("select"),this.select.id=t.ids.list,this.select.addEventListener("change",()=>t.onSelect(this.select.value)),this.pickerRow.append(this.select),t.header.append(this.row),this.row.append(this.pickerRow);const e=t.navigation;e&&(this.previousButton=this.iconButton(`${t.ids.list}-previous`,"▲"),this.nextButton=this.iconButton(`${t.ids.list}-next`,"▼"),this.previousButton.addEventListener("click",()=>e.onStep(-1)),this.nextButton.addEventListener("click",()=>e.onStep(1)),this.row.append(this.previousButton,this.nextButton),e.scope.addEventListener("keydown",i=>{if(!i.altKey||i.ctrlKey||i.metaKey||i.shiftKey||i.key!=="ArrowUp"&&i.key!=="ArrowDown"||this.pickerRow.closest("[hidden]")||!this.pickerRow.isConnected)return;i.preventDefault(),i.stopPropagation();const n=i.key==="ArrowUp"?this.previousButton:this.nextButton;n&&!n.disabled&&e.onStep(i.key==="ArrowUp"?-1:1)}));for(const i of t.actions??[]){const n=this.iconButton(i.id,i.glyph);n.addEventListener("click",()=>i.onClick()),this.actionButtons.set(i.id,n),this.row.append(n)}this.removeButton=this.iconButton(t.ids.remove,"🗑"),this.removeButton.addEventListener("click",()=>t.onRemove()),this.emptyText=document.createElement("span"),this.emptyText.className="element-list-empty",this.addButton=this.iconButton(t.ids.add,"+"),this.addButton.classList.add("element-list-add"),this.row.append(this.removeButton,this.emptyText,this.addButton),t.ids.kinds?this.kindMenu=new V(this.addButton,t.ids.kinds,i=>t.onAdd(i),t.ids.kind):this.addButton.addEventListener("click",()=>t.onAdd(void 0)),t.body&&t.body.classList.add("element-list-body")}static CSS=`
|
|
16
|
-
.element-list-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .4em; flex: 1 1 100%; min-width: 0; }
|
|
17
|
-
.element-list-picker { flex: 1 1 10em; min-width: 0; display: flex; }
|
|
18
|
-
.element-list-picker select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
|
|
19
|
-
.element-list-empty { align-self: center; opacity: .75; font-style: italic; }
|
|
20
|
-
/* The fields of the picked element unroll from its picker: the frame starts where the picker ends, with no space between (the gap of the
|
|
21
|
-
container both stand in is taken back, see glue), its corner under the picker square. The row is aligned on its bottom so that the
|
|
22
|
-
picker's lower edge is the row's, whatever the height of the buttons beside it. */
|
|
23
|
-
.element-list-body { flex: 1 1 100%; min-width: 0; box-sizing: border-box; border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
|
|
24
|
-
border-radius: 0 6px 6px 6px; padding: .5em .6em; margin: 0 0 .3em; display: flex; flex-wrap: wrap;
|
|
25
|
-
align-items: center; gap: .5em; }
|
|
26
|
-
.element-list-picker select { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
|
|
27
|
-
.element-list-row [hidden], .element-list-body[hidden] { display: none !important; }
|
|
28
|
-
${V.CSS}`;static showPresence(t,e,i,n=!1){for(const s of t.children)if(!s.matches(".element-list-add, .add-menu, .add-reason")){if(s.matches(".element-list-empty")){s.hidden=i||n;continue}if(s.matches(".element-list-picker")){s.hidden=!i&&!n;continue}s.hidden=!i&&!n,s instanceof HTMLButtonElement&&!i&&(s.disabled=!0)}e&&(e.hidden=!i,i&&!L.glued.has(e)&&L.glue(e))}static glued=new WeakSet;static glue(t){const e=t.parentElement,i=t.ownerDocument.defaultView;if(!e||!i)return;const n=i.getComputedStyle(e),s=/flex|grid/.test(n.display)&&parseFloat(n.rowGap)||0;t.style.marginTop=`${-s}px`,n.display!=="none"&&L.glued.add(t)}select;row;pickerRow;emptyText;removeButton;addButton;addReason;kindMenu;previousButton;nextButton;actionButtons=new Map;items=[];noneLabel="—";addLabel="";removeEnabled=!0;actionEnabled=new Map;iconButton(t,e){const i=document.createElement("button");return i.type="button",i.className="icon-btn",i.id=t,l.show(i,e),i}setLabels(t){if(this.previousButton&&this.nextButton)for(const[e,i,n]of[[this.previousButton,t.previous??"","Alt+↑"],[this.nextButton,t.next??"","Alt+↓"]]){const s=i===""?n:`${i} (${n})`;e.title=s,e.setAttribute("aria-label",i||s),e.setAttribute("aria-keyshortcuts",n.replace("↑","ArrowUp").replace("↓","ArrowDown"))}this.select.setAttribute("aria-label",t.list),this.emptyText.textContent=t.empty??"",this.noneLabel=t.none??this.noneLabel,this.addLabel=t.add,this.kindMenu?.panel.setAttribute("aria-label",t.add),this.options.optional&&this.listed(this.items,this.select.value);for(const[e,i]of[[this.removeButton,t.remove],[this.addButton,t.add],...[...this.actionButtons].map(([n,s])=>[s,t.actions?.[n]??""])])e.title=i,e.setAttribute("aria-label",i)}setKinds(t){this.kindMenu?.setKinds(t)}kindLabel(t){return this.kindMenu?.labelOf(t)??t}get pickedKind(){return this.kindMenu?.lastPicked}setItems(t,e){this.items=t,this.listed(t,e)}listed(t,e){this.select.replaceChildren(...this.options.optional?[new Option(this.noneLabel,"")]:[],...t.map(i=>new Option(i.label,i.id))),e!==void 0&&(this.select.value=e),this.select.selectedIndex<0&&(this.select.selectedIndex=0),this.setPresent(this.options.optional?this.select.value!=="":t.length>0)}setStepState(t,e){this.previousButton&&(this.previousButton.disabled=!t),this.nextButton&&(this.nextButton.disabled=!e)}setActionEnabled(t,e){const i=this.actionButtons.get(t);i&&(i.disabled=!e||this.select.disabled),this.actionEnabled.set(t,e)}setRemoveEnabled(t){this.removeEnabled=t,this.removeButton.disabled=!t||this.select.value===""&&this.options.optional===!0}get value(){return this.select.value}setAddState(t,e){this.addButton.disabled=!t;const i=e??this.addLabel;this.addButton.title=i,this.addButton.setAttribute("aria-label",i),this.addReason||(this.addReason=this.addButton.ownerDocument.createElement("span"),this.addReason.className="add-reason",this.addReason.style.cssText="font-size: .85em; opacity: .8; align-self: center;",this.row.append(this.addReason)),this.addReason.textContent=!t&&e?e:"",this.addReason.hidden=t||!e}rename(t,e){const i=[...this.select.options].find(n=>n.value===t);i&&(i.textContent=e)}show(t){this.select.value=t,this.options.optional&&this.setPresent(this.select.value!=="")}setPresent(t){const e=this.options.optional===!0;if(L.showPresence(this.row,this.options.body,t,e),this.select.disabled=!t&&!e,!!t){this.removeButton.disabled=!this.removeEnabled;for(const[i,n]of this.actionButtons)n.disabled=this.actionEnabled.get(i)===!1}}focus(){this.select.focus()}}class m{static CHROME="2.6em";static UNBOUNDED=9999;static fit(t){const e=[...t.querySelectorAll('input[type="number"]')];for(const i of e)i.style.width=`calc(${m.charsFor(i)}ch + ${m.CHROME})`,m.hold(i,!m.isFocused(i)),i.dataset.held!==""&&(i.dataset.held="",i.addEventListener("input",()=>m.hold(i)),i.addEventListener("change",()=>m.hold(i,!0)));return e.length}static hold(t,e=!1){const i=m.heldValue(t.value,t,e);i!==t.value&&(t.value=i,t.dispatchEvent(new Event("input",{bubbles:!0})))}static isFocused(t){return t.getRootNode().activeElement===t}static heldValue(t,e,i=!1){if(t===""||!/^-?\d+(\.\d+)?$/.test(t))return t;const n=m.wholeOnly(e.step)?0:m.decimalsOf(e.step),s=t.indexOf("."),o=s>=0&&t.length-s-1>n?n===0?t.slice(0,s):t.slice(0,s+n+1):t,r=Number(o),d=e.min===""?void 0:Number(e.min),a=e.max===""?void 0:Number(e.max);return a!==void 0&&r>a?String(a):i&&d!==void 0&&r<d?String(d):o}static charsFor(t){const e=r=>r===""?void 0:Math.abs(Number(r)),i=Math.max(e(t.max)??m.UNBOUNDED,e(t.min)??0),n=String(Math.floor(Number.isFinite(i)?i:m.UNBOUNDED)).length,s=t.min!==""&&Number(t.min)<0?1:0,o=m.wholeOnly(t.step)?0:m.decimalsOf(t.step);return n+s+(o>0?o+1:0)}static decimalsOf(t){if(t===""||t==="any")return 2;const e=t.indexOf(".");return Math.max(2,e<0?0:t.length-e-1)}static wholeOnly(t){return t!==""&&t!=="any"&&!t.includes(".")}}class x{static CSS=`
|
|
29
|
-
.window-close {
|
|
30
|
-
position: absolute; top: 8px; right: 8px; z-index: 1;
|
|
31
|
-
display: inline-flex; align-items: center; justify-content: center;
|
|
32
|
-
width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0;
|
|
33
|
-
border: 0; border-radius: 8px; background: none; color: inherit; opacity: .7; cursor: pointer;
|
|
34
|
-
}
|
|
35
|
-
.window-close:hover, .window-close:focus-visible { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
|
|
36
|
-
:is(dialog, [popover], .context-menu):has(> .window-close) { position: relative; padding-right: 44px; }
|
|
37
|
-
.context-menu:has(> .window-close) { position: fixed; }
|
|
38
|
-
`;static button(t,e,i){const n=t.querySelector(":scope > .window-close");if(n)return x.label(n,e),n;const s=document.createElement("button");return s.type="button",s.className="window-close",s.innerHTML=l.CLOSE,x.label(s,e),s.addEventListener("click",o=>{o.stopPropagation(),i()}),t.prepend(s),s}static popover(t,e){return x.button(t,e,()=>{typeof t.hidePopover=="function"&&t.matches(":popover-open")&&t.hidePopover()})}static dialog(t,e,i){if(!t.dataset.closesBeside){t.dataset.closesBeside="true";let n=!1;t.addEventListener("pointerdown",s=>n=s.target===t),t.addEventListener("click",s=>{s.target===t&&n&&x.outside(t,s)&&i()})}return x.button(t,e,i)}static outside(t,e){const i=t.getBoundingClientRect();return e.clientX<i.left||e.clientX>i.right||e.clientY<i.top||e.clientY>i.bottom}static label(t,e){t.title=e,t.setAttribute("aria-label",e)}}class E extends HTMLElement{static TAG="rr0-input-basis";static CSS=`
|
|
39
|
-
rr0-input-basis { display: inline-block; }
|
|
40
|
-
rr0-input-basis[hidden] { display: none; }
|
|
41
|
-
.basis-mark {
|
|
42
|
-
display: inline-block; margin-left: 8px; padding: 0 8px; border: 1px solid var(--glow-dim); border-radius: 999px;
|
|
43
|
-
font: 600 11px/1.6 var(--sans); color: var(--glow); cursor: pointer; vertical-align: .05em; user-select: none;
|
|
44
|
-
}
|
|
45
|
-
/* Always there, so that nothing moves when it shows: "stated", the default, said quietly, and fully on the hover of its field. */
|
|
46
|
-
.basis-mark[data-basis="stated"] { border-style: dashed; opacity: .55; }
|
|
47
|
-
:is(label, .field, .event-param-label):is(:hover, :focus-within) .basis-mark, .basis-mark:is(:hover, :focus-visible) { opacity: 1; }
|
|
48
|
-
.basis-mark[data-basis="assumed"], .basis-mark[data-basis="derived"] { font-style: italic; }
|
|
49
|
-
.basis-window { width: min(26em, 92vw); padding: 18px 20px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--ground-raised); color: var(--ink); box-shadow: 0 12px 32px rgba(0, 0, 0, .3); }
|
|
50
|
-
.basis-window h3 { margin: 0 0 12px; font: 600 19px/1.3 var(--serif); }
|
|
51
|
-
.basis-window label { display: flex; flex-direction: column; gap: 5px; margin: 0 0 12px; font: 600 13px/1.3 var(--sans); color: var(--ink-dim); }
|
|
52
|
-
.basis-window :is(select, textarea) { box-sizing: border-box; width: 100%; font-weight: 400; }
|
|
53
|
-
/* Beside its pill, under it or above it where there is room (anchored, see open); centred where anchors are not known. Fixed, against a
|
|
54
|
-
window's own rule (WindowClose), which makes a popover with a ✕ relative, and so drawn at the top of the page. */
|
|
55
|
-
.basis-window.basis-window:popover-open { position: fixed; inset: auto; margin: 6px 0; max-height: calc(100vh - 24px); overflow: auto;
|
|
56
|
-
position-area: bottom span-right; position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline; }
|
|
57
|
-
@supports not (position-area: bottom) { .basis-window.basis-window:popover-open { inset: 0; margin: auto; height: fit-content; } }
|
|
58
|
-
.basis-window textarea { min-height: 8em; font: 400 14px/1.45 var(--sans, sans-serif); resize: vertical; }
|
|
59
|
-
`;hows=[];rationaleKept=!0;wording;shown;mark;window;static count=0;anchor=`--rr0-basis-${++E.count}`;set anchorKey(t){this.anchor=`--rr0-basis-${t.replace(/[^a-zA-Z0-9_-]/g,"-")}`,this.mark?.style.setProperty("anchor-name",this.anchor)}build(){if(this.mark)return;const t=document.createElement("span");t.className="basis-mark",t.setAttribute("role","button"),t.tabIndex=0,t.style.setProperty("anchor-name",this.anchor);const e=i=>{i.preventDefault(),i.stopPropagation(),this.open()};t.addEventListener("click",e),t.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&e(i)}),this.append(t),this.mark=t,this.say()}connectedCallback(){this.build()}set messages(t){this.wording=t,this.say()}get entry(){return this.shown}set entry(t){this.shown=t&&(t.basis!=="stated"||t.how!==void 0||t.rationale!==void 0)?{...t}:void 0,this.say()}get pill(){return this.build(),this.mark}say(){const t=this.mark,e=this.wording;if(!t||!e)return;const i=this.shown?.basis??"stated";t.dataset.basis=i,this.dataset.basis=i,t.textContent!==e.basis[i]&&(t.textContent=e.basis[i]),t.title=this.shown?.rationale?`${e.title} : ${this.shown.rationale}`:e.title,t.setAttribute("aria-label",`${e.title} : ${e.basis[i]}`)}open(){const t=this.wording;if(!t)return;const e=Object.assign(document.createElement("h3"),{textContent:t.title}),i=document.createElement("select");for(const a of["measured","stated","derived","assumed"])i.append(new Option(t.basis[a],a));i.value=this.shown?.basis??"stated";const n=document.createElement("select");n.append(new Option("—",""));for(const a of this.hows)n.append(new Option(a.label,a.value));n.value=this.shown?.how??"";const s=document.createElement("textarea");s.value=this.shown?.rationale??"";const o=()=>{this.entry={basis:i.value,...n.value?{how:n.value}:{},...s.value.trim()?{rationale:s.value.trim()}:{}},this.dispatchEvent(new CustomEvent("basischange",{detail:{entry:this.shown},bubbles:!0,composed:!0}))};for(const a of[i,n])a.addEventListener("change",o);s.addEventListener("change",o);const r=(a,u)=>{const h=document.createElement("label");return h.append(Object.assign(document.createElement("span"),{textContent:a}),u),h},d=this.windowElement();d.replaceChildren(e,r(t.basisField,i),...this.hows.length>0?[r(t.howField,n)]:[],...this.rationaleKept?[r(t.rationaleField,s)]:[]),x.popover(d,t.title),typeof d.showPopover=="function"&&d.isConnected?d.showPopover():d.hidden=!1}windowElement(){if(this.window)return this.window;const t=document.createElement("div");t.className="basis-window",t.setAttribute("popover",""),t.setAttribute("role","dialog"),t.style.setProperty("position-anchor",this.anchor),t.addEventListener("toggle",i=>{i.newState==="closed"&&(t.remove(),this.window=void 0)});const e=this.getRootNode();return e instanceof ShadowRoot?e.append(t):(e instanceof Document?e.body:this).append(t),this.window=t,t}get openWindow(){return this.window}}function K(){customElements.get(E.TAG)||customElements.define(E.TAG,E)}const G="rr0-input-position",H={positionRelative:"relative",positionAbsolute:"absolute",positionModeHint:"Click to say it the other way: from something else, or as a latitude and a longitude",positionNoPlace:"The recording has no place yet: give the observer a latitude and a longitude first",positionFrom:"from",positionObserver:"the observer",positionEast:"East",positionNorth:"North",positionLatitude:"Latitude",positionLongitude:"Longitude",positionLabel:"Position",positionBasisHint:"Where this position comes from",positionBasisStated:"stated",positionBasisMeasured:"measured",positionBasisDerived:"derived",positionBasisAssumed:"assumed",positionBasisField:"Basis"},U=`${E.CSS}
|
|
60
|
-
rr0-input-position { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3em .5em; }
|
|
61
|
-
/* As the date's own switch (see DateInputElement): it reads as part of the label, before the fields. */
|
|
62
|
-
rr0-input-position .position-mode { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .15em; }
|
|
63
|
-
rr0-input-position .position-mode:hover:not(:disabled) { text-decoration-thickness: 2px; }
|
|
64
|
-
rr0-input-position .position-mode:disabled { cursor: default; text-decoration: none; opacity: .75; }
|
|
65
|
-
rr0-input-position .position-mode:focus-visible { outline: 2px solid #4af; outline-offset: 2px; border-radius: 2px; }
|
|
66
|
-
rr0-input-position .position-axis { display: inline-flex; align-items: center; gap: .3em; white-space: nowrap; }
|
|
67
|
-
/* East and North are two fields, each with its unit: room between the unit of one and the name of the next. */
|
|
68
|
-
rr0-input-position :is(.position-local, .position-geo) { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3em 1em; }
|
|
69
|
-
rr0-input-position .position-from { display: inline-flex; align-items: center; gap: .3em; white-space: nowrap; }
|
|
70
|
-
rr0-input-position .position-from select { width: auto; max-width: 14em; }
|
|
71
|
-
rr0-input-position input[type="number"] { width: 7em; }
|
|
72
|
-
rr0-input-position .position-geo input[type="number"] { width: 9.5em; }
|
|
73
|
-
/* What it stands on (see BasisInputElement): before the switch, as a date's. */
|
|
74
|
-
rr0-input-position .position-basis { order: -2; }
|
|
75
|
-
rr0-input-position .position-mode { order: -1; }
|
|
76
|
-
rr0-input-position [hidden] { display: none !important; }
|
|
77
|
-
`;class b extends HTMLElement{modeButton;fromRow;fromSelect;localRow;geoRow;eastField;northField;latField;lngField;basisSelect;eastLabel;northLabel;latLabel;lngLabel;wording=H;shownFrame={references:[]};shownValue;shownBasis;relativeShown=!0;referenceId;build(){if(this.modeButton)return;const t=this.getAttribute("name")??"position",e=this.ownerDocument,i=e.createElement("style");i.textContent=U;const n=e.createElement("button");n.type="button",n.className="position-mode",n.addEventListener("click",()=>this.setRelative(!this.relativeShown));const s=e.createElement("span");s.className="position-from";const o=e.createElement("span");o.className="position-from-text";const r=e.createElement("select");r.id=`${t}-from`,r.addEventListener("input",()=>this.pickReference(r.value)),s.append(o,r);const d=this.getAttribute("step")??"0.1",a=(w,k,S,R)=>{const y=e.createElement("input");return y.type="number",y.id=w,y.min=String(k),y.max=String(S),y.step=R,y.autocomplete="off",y},u=(w,k)=>{const S=e.createElement("label");S.className="position-axis";const R=e.createElement("span");return S.append(R,w,k),{row:S,label:R}},h=Number(this.getAttribute("range")??3e4),c=a(this.getAttribute("east-id")??`${t}-east`,-h,h,d),v=a(this.getAttribute("north-id")??`${t}-north`,-h,h,d),O=a(this.getAttribute("lat-id")??`${t}-lat`,-90,90,"0.000001"),N=a(this.getAttribute("lng-id")??`${t}-lng`,-180,180,"0.000001"),A=e.createElement("span");A.className="position-local";const P=u(c,"m"),T=u(v,"m");A.append(P.row,T.row);const B=e.createElement("span");B.className="position-geo";const $=u(O,"°"),F=u(N,"°");B.append($.row,F.row);for(const w of[c,v])w.addEventListener("input",()=>this.typedLocal());for(const w of[O,N])w.addEventListener("input",()=>this.typedGeo());K();const g=e.createElement(E.TAG);g.id=`${t}-basis`,g.className="position-basis",g.rationaleKept=!1,g.anchorKey=`${t}-basis`,g.addEventListener("basischange",w=>{w.stopPropagation();const k=w.detail.entry;this.shownBasis=k?.basis==="stated"?void 0:k?.basis,this.dispatchEvent(new CustomEvent("basischange",{detail:{basis:this.shownBasis},bubbles:!0,composed:!0}))}),this.append(i,n,s,A,B,g),this.modeButton=n,this.fromRow=s,this.fromSelect=r,this.localRow=A,this.geoRow=B,this.eastField=c,this.northField=v,this.latField=O,this.lngField=N,this.basisSelect=g,this.eastLabel=P.label,this.northLabel=T.label,this.latLabel=$.label,this.lngLabel=F.label,this.relativeShown=!this.isGeo,this.word(),this.show()}connectedCallback(){this.build()}get isGeo(){return this.getAttribute("native")==="geo"}get eastInput(){return this.build(),this.eastField}get northInput(){return this.build(),this.northField}get latInput(){return this.build(),this.latField}get lngInput(){return this.build(),this.lngField}get frame(){return this.shownFrame}set frame(t){this.shownFrame=t,this.build(),this.pullDegrees(),this.show()}get value(){return this.shownValue}set value(t){if(this.shownValue=t,this.build(),this.isGeo){const e=t;this.latField.value=e?String(p.degrees(e.lat)):"",this.lngField.value=e?String(p.degrees(e.lng)):""}this.show()}set said(t){this.build(),this.pullDegrees(),p.isRelative(t)?(this.relativeShown=!0,this.referenceId=t.relativeTo):p.isAbsolute(t)?this.relativeShown=!1:(this.relativeShown=!this.isGeo,this.referenceId=void 0),this.show()}get said(){const t=this.localValue();if(t)return p.restated(this.relativeShown?p.relative(0,0,this.referenceId):{lat:0,lng:0},t,this.shownFrame)}get relative(){return this.relativeShown}get basis(){return this.shownBasis}set basis(t){this.shownBasis=t==="stated"?void 0:t,this.build(),this.markBasis()}set basisShown(t){this.build(),this.basisSelect.hidden=!t}set messages(t){this.wording=t,this.modeButton&&(this.word(),this.show())}setRelative(t){!this.shownFrame.origin||this.references().length===0||(this.pullDegrees(),this.relativeShown=t,this.show())}pullDegrees(){if(!this.isGeo||!this.latField)return;const t=b.typed(this.latField),e=b.typed(this.lngField);this.shownValue=t!==void 0&&e!==void 0?{lat:t,lng:e}:this.latField.value===""&&this.lngField.value===""?void 0:this.shownValue}word(){const t=this.wording;this.eastLabel.textContent=t.positionEast,this.northLabel.textContent=t.positionNorth,this.latLabel.textContent=t.positionLatitude,this.lngLabel.textContent=t.positionLongitude,this.fromRow.querySelector(".position-from-text").textContent=t.positionFrom,this.basisSelect.messages={title:t.positionBasisHint,basisField:t.positionBasisField,howField:"",rationaleField:"",basis:{stated:t.positionBasisStated,measured:t.positionBasisMeasured,derived:t.positionBasisDerived,assumed:t.positionBasisAssumed}},this.markBasis()}markBasis(){this.basisSelect&&(this.basisSelect.entry=this.shownBasis?{basis:this.shownBasis}:void 0)}references(){const t=this.shownFrame.references;return t.length>0||this.isGeo?t:[{label:this.wording.positionObserver,eastM:0,northM:0}]}reference(){const t=this.references();return t.find(e=>e.id===this.referenceId)??t[0]??{label:"",eastM:0,northM:0}}localValue(){const t=this.shownValue;if(!t)return;if(!this.isGeo)return t;const e=this.shownFrame.origin;return e?p.toLocal(t,e):void 0}geoValue(){const t=this.shownValue;if(!t)return;if(this.isGeo)return t;const e=this.shownFrame.origin;return e?p.toGeo(t,e):void 0}show(){if(!this.modeButton)return;const t=this.wording,e=this.shownFrame.origin!==void 0&&this.references().length>0;e||(this.relativeShown=!this.isGeo);const i=this.modeButton;i.textContent=this.relativeShown?t.positionRelative:t.positionAbsolute,i.disabled=!e,i.title=e?t.positionModeHint:t.positionNoPlace;const n=this.references(),s=this.fromSelect,o=n.map(c=>c.id??"");([...s.options].map(c=>c.value).join(`
|
|
78
|
-
`)!==o.join(`
|
|
79
|
-
`)||[...s.options].map(c=>c.text).join(`
|
|
80
|
-
`)!==n.map(c=>c.label).join(`
|
|
81
|
-
`))&&s.replaceChildren(...n.map(c=>new Option(c.label,c.id??""))),this.referenceId!==void 0&&!n.some(c=>c.id===this.referenceId)&&(this.referenceId=void 0),s.value=this.referenceId??o[0]??"",this.fromRow.hidden=!this.relativeShown,this.localRow.hidden=!this.relativeShown,this.geoRow.hidden=this.relativeShown;const r=this.getRootNode().activeElement,d=(c,v)=>{c!==r&&(c.value=v===void 0?"":String(v))},a=this.localValue(),u=this.reference();if(d(this.eastField,a?p.metres(a.eastM-u.eastM):void 0),d(this.northField,a?p.metres(a.northM-u.northM):void 0),this.isGeo&&!this.relativeShown)return;const h=this.geoValue();d(this.latField,h?p.degrees(h.lat):void 0),d(this.lngField,h?p.degrees(h.lng):void 0)}pickReference(t){this.pullDegrees(),this.referenceId=t===""?void 0:t,this.show();const e=this.said;e&&this.shownValue&&this.tell(this.shownValue,e)}static typed(t){const e=t.value.trim(),i=e===""?NaN:Number(e);return Number.isFinite(i)?i:void 0}typedLocal(){const t=b.typed(this.eastField),e=b.typed(this.northField);if(t===void 0||e===void 0)return;const i=this.reference(),n={eastM:i.eastM+t,northM:i.northM+e};let s=n;if(this.isGeo){const o=this.shownFrame.origin;if(!o)return;s=p.toGeo(n,o)}this.shownValue=s,this.tell(s,p.relative(t,e,this.referenceId))}typedGeo(){const t=b.typed(this.latField),e=b.typed(this.lngField);if(t===void 0||e===void 0)return;let i={lat:t,lng:e};if(!this.isGeo){const n=this.shownFrame.origin;if(!n)return;i=p.toLocal({lat:t,lng:e},n)}this.shownValue=i,this.tell(i,{lat:t,lng:e})}tell(t,e){this.show();const i=this.isGeo?p.isAbsolute(e):p.isRelative(e)&&e.relativeTo===void 0;this.dispatchEvent(new CustomEvent("positionchange",{detail:{value:t,said:i?void 0:e},bubbles:!0,composed:!0}))}}function z(){customElements.get(G)||customElements.define(G,b)}class C{constructor(t,e,i=()=>{},n){this.read=t,this.edit=e,this.context=i,this.place=n}static inPlace(t){return new C(()=>t,e=>e(t))}}class M{constructor(t,e,i="",n,s){this.container=t,this.idPrefix=i,this.values=n,this.enhance=s,this.said=new D([e,"en"])}set;target;changed=()=>{};said;setLanguage(t){this.said=new D([t,"en"]),this.set&&this.target&&this.show(this.set,this.target,this.changed)}show(t,e,i){this.set=t,this.target=e instanceof C?e:C.inPlace(e),this.changed=i,this.container.replaceChildren();const n=new Map;for(const s of t.parameters){const o=this.read(s.group)??"";let r=n.get(o);if(!r){if(r=document.createElement("fieldset"),r.className="parameter-group",o!==""){const d=document.createElement("legend");d.textContent=o,r.append(d)}else r.classList.add("parameter-group-untitled"),r.style.border="0",r.style.padding="0",r.style.marginInline="0";n.set(o,r),this.container.append(r)}r.append(this.fieldOf(s))}m.fit(this.container),this.sync()}clear(){this.set=void 0,this.target=void 0,this.container.replaceChildren()}field(t){return this.container.querySelector(`[data-key="${t}"]`)??void 0}sync(t=!1){const e=this.target?.read();if(!this.set||!e)return;const i=this.target.context(),n=t?null:this.container.getRootNode().activeElement;for(const s of this.set.parameters){const o=s.type==="position"?this.positionOf(s):this.field(s.key);if(!o)continue;const r=o.closest("label, .parameter-row")??o;r.hidden=s.visibleWhen!==void 0&&!s.visibleWhen(e,i);const d=f.read(e,s.key);if(s.type==="number"){const a=o;a!==n&&(a.value=typeof d=="number"?M.shown(d,s):"");const u=M.boundsOf(s,e,i);a.min=String(u.min),a.max=String(u.max);const h=s.effective?.(e,i);a.placeholder=h!==void 0?M.shown(h,s):this.read(s.placeholder)??"",a.classList.toggle("parameter-derived",d===void 0)}else if(s.type==="choice"){const a=o,u=s.optionsOf?.(e,i)??s.choices;if([...a.options].filter(h=>h.value!=="").map(h=>h.value).join(`
|
|
82
|
-
`)!==u.map(h=>h.value).join(`
|
|
83
|
-
`)&&a.replaceChildren(...s.required?[]:[new Option("—","")],...u.map(h=>new Option(this.read(h.label)??h.value,h.value))),a!==n&&(a.value=typeof d=="string"&&u.some(h=>h.value===d)?d:s.required?a.options[0]?.value??"":""),!s.required){const h=s.effective?.(e,i),c=u.find(v=>v.value===h);a.options[0].textContent=c?this.read(c.label)??c.value:this.read(s.empty)??"—"}}else if(s.type==="boolean"){const a=o;a.checked=d===!0}else if(s.type==="colour"){const a=o;a!==n&&(a.value=M.swatchOf(d,s.fallback??"#808080"))}else if(s.type==="set")this.syncSet(s,o,e,i);else if(s.type==="position")this.syncPosition(s,o,e);else if(s.type==="said"){const a=o;a!==n&&(a.value=this.values?.said().read(f.read(e,s.key))??""),this.markMissing(s,a)}else{const a=o;a!==n&&(a.value=typeof d=="string"?d:"",a.classList.remove("invalid"),a.removeAttribute("aria-invalid"))}}for(const s of this.container.querySelectorAll("fieldset.parameter-group"))s.hidden=[...s.querySelectorAll("label, .parameter-row")].filter(o=>o.parentElement===s).every(o=>o.hidden)}fieldOf(t){const e=document.createElement("label"),i=this.read(t.hint);i&&(e.title=i);const n=document.createElement("span");n.textContent=this.read(t.label)??t.key,e.append(n," ");let s;if(t.type==="choice"){const o=document.createElement("select");this.identify(o,t),t.required||o.append(new Option("—","")),o.append(...t.choices.map(r=>new Option(this.read(r.label)??r.value,r.value))),o.addEventListener("input",()=>this.write(t,o.value===""?void 0:o.value)),e.append(o),this.enhance?.(t,o)}else{if(t.type==="position")return this.setRow(t,this.positionFieldOf(t));if(t.type==="set"){const o=document.createElement("div");return this.identify(o,t),o.className="parameter-set",o.addEventListener("input",()=>{const r=[...o.querySelectorAll("input:checked")].map(d=>d.value);this.write(t,r.length>0?r:void 0)}),this.setRow(t,o)}else if(t.type==="boolean"){const o=document.createElement("input");o.type="checkbox",this.identify(o,t),o.addEventListener("input",()=>this.write(t,o.checked?!0:t.required?!1:void 0)),e.prepend(o),e.append(" ")}else{const o=document.createElement("input");this.identify(o,t),o.autocomplete="off",t.type==="number"?(o.type="number",o.min=String(t.min),o.max=String(t.max),o.step=String(t.step),s=t.unit,o.addEventListener("input",()=>{const r=o.value.trim();if(r==="")return t.required?void 0:this.write(t,void 0);const d=Number(r);Number.isFinite(d)&&this.write(t,d)})):t.type==="colour"?(o.type="color",o.addEventListener("input",()=>this.write(t,o.value))):t.type==="said"?(o.type="text",o.placeholder=this.read(t.placeholder)??"",o.addEventListener("input",()=>{const r=this.target?.read(),d=this.values;!r||!d||(this.write(t,d.said().write(f.read(r,t.key),o.value,d.writingLanguage())),this.markMissing(t,o))})):(o.type="text",o.placeholder=this.read(t.placeholder)??"",o.addEventListener("input",()=>{const r=t.required||t.validate?o.value.trim():o.value,d=this.target?.read(),a=d!==void 0&&(t.required===!0&&r===""||r!==""&&t.validate?.(r,d,this.target.context())===!1);o.classList.toggle("invalid",a),a?o.setAttribute("aria-invalid","true"):o.removeAttribute("aria-invalid"),!a&&this.write(t,r===""?void 0:r)}),o.addEventListener("change",()=>{if(!o.classList.contains("invalid"))return;o.classList.remove("invalid"),o.removeAttribute("aria-invalid");const r=this.target?.read(),d=r===void 0?void 0:f.read(r,t.key);o.value=typeof d=="string"?d:""})),e.append(o)}}return s&&e.append(` ${s}`),e}markMissing(t,e){t.type!=="said"||!t.required||(e.classList.toggle("invalid",e.value===""),e.setAttribute("aria-invalid",String(e.value==="")))}positionFieldOf(t){z();const e=document.createElement("rr0-input-position"),i=`${this.idPrefix}${t.key}`;e.setAttribute("name",i),t.native==="geo"&&e.setAttribute("native","geo"),t.step!==void 0&&e.setAttribute("step",String(t.step)),t.rangeM!==void 0&&e.setAttribute("range",String(t.rangeM));const n=t.native==="geo"?["lat-id","lng-id"]:["east-id","north-id"];this.idPrefix!==""&&(e.setAttribute(n[0],`${this.idPrefix}${t.key}`),e.setAttribute(n[1],`${this.idPrefix}${t.secondKey}`)),e.dataset.position=t.key,e.build();const[s,o]=t.native==="geo"?[e.latInput,e.lngInput]:[e.eastInput,e.northInput];s.dataset.key=t.key,o.dataset.key=t.secondKey;const r=this.target?.place;return r&&(e.messages=r.messages()),e.basisShown=r?.basis!==void 0,e.addEventListener("positionchange",d=>{const{value:a,said:u}=d.detail;this.writePosition(t,a,u)}),e.addEventListener("basischange",d=>this.target?.place?.basis?.write(t,d.detail.basis)),e}positionOf(t){return this.container.querySelector(`rr0-input-position[data-position="${t.key}"]`)??void 0}syncPosition(t,e,i){const n=this.target?.place;n&&(e.messages=n.messages(),e.frame=n.frame());const s=f.read(i,t.key),o=f.read(i,t.secondKey),r=typeof s=="number"&&typeof o=="number";e.value=r?t.native==="geo"?{lat:s,lng:o}:{eastM:s,northM:o}:void 0;const d=f.read(i,t.saidKey),a=JSON.stringify(d??null);e.dataset.said!==a&&(e.dataset.said=a,e.said=d),e.basis=n?.basis?.read(t)}writePosition(t,e,i){const n=this.target;if(!n)return;const[s,o]="lat"in e?[e.lat,e.lng]:[e.eastM,e.northM],r=t.native==="geo"?d=>Math.round(d*1e7)/1e7:d=>Math.round(d*1e3)/1e3;this.positionOf(t)?.setAttribute("data-said",JSON.stringify(i??null)),n.edit(d=>{f.write(d,t.key,r(s)),f.write(d,t.secondKey,r(o)),f.write(d,t.saidKey,i)},t),this.changed(),this.sync()}setRow(t,e){const i=document.createElement("div");i.className="parameter-row";const n=this.read(t.hint);n&&(i.title=n);const s=document.createElement("span");return s.textContent=this.read(t.label)??t.key,i.append(s," ",e),i}syncSet(t,e,i,n){if(t.type!=="set")return;const s=f.read(i,t.key),o=new Set(Array.isArray(s)?s:[]),r=t.options(i,n);if(r.length===0){e.textContent=this.read(t.empty)??"";return}[...e.querySelectorAll("input")].map(a=>a.value).join(`
|
|
84
|
-
`)===r.map(a=>a.value).join(`
|
|
85
|
-
`)||e.replaceChildren(...r.map(a=>{const u=document.createElement("label"),h=document.createElement("input");return h.type="checkbox",h.value=a.value,u.append(h," ",a.label),u}));for(const a of e.querySelectorAll("input"))a.checked=o.has(a.value)}identify(t,e){t.dataset.key=e.key,this.idPrefix!==""&&(t.id=`${this.idPrefix}${e.key}`)}write(t,e){const i=this.target;if(!i)return;let n=e;if(t.type==="number"&&typeof e=="number"){const s=i.read();if(s){const o=M.boundsOf(t,s,i.context());n=Math.max(o.min,Math.min(o.max,e))/(t.scale??1)}}i.edit(s=>f.write(s,t.key,n),t),this.changed(),this.sync()}read(t){return this.said.read(t)}static boundsOf(t,e,i){const n=t.bounds?.(e,i);return{min:n?.min??t.min,max:n?.max??t.max}}static swatchOf(t,e){if(typeof t!="string")return e;const i=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(t);return i?`#${i[1]}${i[1]}${i[2]}${i[2]}${i[3]}${i[3]}`.toLowerCase():/^#[0-9a-f]{6}$/i.test(t)?t.toLowerCase():e}static shown(t,e){const i=Math.max(2,Math.min(6,(String(e.step).split(".")[1]??"").length));return String(Number((t*(e.scale??1)).toFixed(i)))}static choicesOf(t){return t.choices.map(e=>e.value)}}export{L as E,l as I,M as P,Y as S,C as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t={timeWithin:"Its time, {time}, is within what is known of it ({range}).",timeOutside:"Its time, {time}, is outside what is known of it ({range}).",timeChanged:"It moves the time from {from} to {time}, which the observation states.",valueWithin:"Its {what}, {value}, is within what is known of it ({min} to {max}).",valueOutside:"Its {what}, {value}, is outside what is known of it ({min} to {max}).",valueChanged:"It moves the {what} from {from} to {value}, which the observation states.",lightingHolds:"The Sun it puts together ({bearing}° from where the camera looks, {altitude}° high) lights the scene as the picture shows it ({from}° to {to}° from where it looks{altitudes}).",lightingFails:"The Sun it puts together ({bearing}° from where the camera looks, {altitude}° high) does not light the scene as the picture shows it ({from}° to {to}° from where it looks{altitudes}).",altitudes:", {min}° to {max}° high",latitude:"latitude",longitude:"longitude"};export{t as readingCheckTexts_en};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e={timeWithin:"Su hora, {time}, está dentro de lo que se sabe de ella ({range}).",timeOutside:"Su hora, {time}, está fuera de lo que se sabe de ella ({range}).",timeChanged:"Desplaza la hora de {from} a {time}, que la observación indica.",valueWithin:"Su {what}, {value}, está dentro de lo que se sabe ({min} a {max}).",valueOutside:"Su {what}, {value}, está fuera de lo que se sabe ({min} a {max}).",valueChanged:"Desplaza la {what} de {from} a {value}, que la observación indica.",lightingHolds:"El Sol que compone ({bearing}° de la dirección de mira, {altitude}° de altura) ilumina la escena como la muestra la imagen ({from}° a {to}° de la mira{altitudes}).",lightingFails:"El Sol que compone ({bearing}° de la dirección de mira, {altitude}° de altura) no ilumina la escena como la muestra la imagen ({from}° a {to}° de la mira{altitudes}).",altitudes:", {min}° a {max}° de altura",latitude:"latitud",longitude:"longitud"};export{e as readingCheckTexts_es};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e={timeWithin:"Son heure, {time}, est dans ce qu'on en sait ({range}).",timeOutside:"Son heure, {time}, est hors de ce qu'on en sait ({range}).",timeChanged:"Elle déplace l'heure de {from} à {time}, que l'observation indique.",valueWithin:"Sa {what}, {value}, est dans ce qu'on en sait ({min} à {max}).",valueOutside:"Sa {what}, {value}, est hors de ce qu'on en sait ({min} à {max}).",valueChanged:"Elle déplace la {what} de {from} à {value}, que l'observation indique.",lightingHolds:"Le Soleil qu'elle compose ({bearing}° de la direction de visée, {altitude}° de haut) éclaire la scène comme l'image la montre ({from}° à {to}° de la visée{altitudes}).",lightingFails:"Le Soleil qu'elle compose ({bearing}° de la direction de visée, {altitude}° de haut) n'éclaire pas la scène comme l'image la montre ({from}° à {to}° de la visée{altitudes}).",altitudes:", {min}° à {max}° de haut",latitude:"latitude",longitude:"longitude"};export{e as readingCheckTexts_fr};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const a={timeWithin:"La sua ora, {time}, è entro ciò che se ne sa ({range}).",timeOutside:"La sua ora, {time}, è fuori da ciò che se ne sa ({range}).",timeChanged:"Sposta l'ora da {from} a {time}, che l'osservazione indica.",valueWithin:"La sua {what}, {value}, è entro ciò che se ne sa (da {min} a {max}).",valueOutside:"La sua {what}, {value}, è fuori da ciò che se ne sa (da {min} a {max}).",valueChanged:"Sposta la {what} da {from} a {value}, che l'osservazione indica.",lightingHolds:"Il Sole che compone ({bearing}° dalla direzione di mira, {altitude}° di altezza) illumina la scena come la mostra l'immagine (da {from}° a {to}° dalla mira{altitudes}).",lightingFails:"Il Sole che compone ({bearing}° dalla direzione di mira, {altitude}° di altezza) non illumina la scena come la mostra l'immagine (da {from}° a {to}° dalla mira{altitudes}).",altitudes:", da {min}° a {max}° di altezza",latitude:"latitudine",longitude:"longitudine"};export{a as readingCheckTexts_it};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{G,be as S,X as _,n as f,bf as M,q as w,j as F,b8 as R,b9 as I,y,C as N,bg as H,bh as C,bi as j,R as L}from"./rr0-sighting.mjs";class h{static RADIUS=840;static MAX_SEGMENTS=1024;static VERTICES_PER_SEGMENT=12;static MIN_HALF_WIDTH_DEG=.1;static BRIGHT_HALF_WIDTH_DEG=.22;static TRAIN_SHARE=.9;static TRAIN_FALLOFF=1.2;object=new G;tiers;trains;positions;colors;shown=0;drawn=[];constructor(){this.object.name="reentries",this.tiers=S.map(i=>{const o=new _(new f,M.material(i.size,!1));return M.track(o),o.frustumCulled=!1,this.object.add(o),o});const s=h.MAX_SEGMENTS*h.VERTICES_PER_SEGMENT;this.positions=new Float32Array(s*3),this.colors=new Float32Array(s*3);const t=new f;t.setAttribute("position",new w(this.positions,3)),t.setAttribute("color",new w(this.colors,3)),t.setDrawRange(0,0),this.trains=new F(t,R.material()),this.trains.frustumCulled=!1,R.track(this.trains),this.object.add(this.trains)}nearest(s,t){let i,o=t;for(const e of this.drawn){const n=e.direction.dot(s);(n>o||i&&n===o&&e.magnitude<i.magnitude)&&(o=n,i=e)}return i}static directionOf(s){const{x:t,y:i,z:o}=I(s.altitudeDeg,s.azimuthDeg,1);return new y(t,i,o)}get count(){return this.shown}set(s,t,i,o){const e=this.tiers.map(()=>[]);let n=0,E=0;const r=new N;this.drawn=[];for(const a of s){const u=i(a.head);if(u<=0)continue;const c=a.magnitude-2.5*Math.log10(u);if(c>t)continue;E++,this.drawn.push({direction:h.directionOf(a.head),view:a,magnitude:c}),r.set(a.color);const d=H(c,t)*a.fade,{x:b,y:A,z:p}=I(a.head.altitudeDeg,a.head.azimuthDeg,h.RADIUS),[l,m,T]=o(a.head,c),z=a.fade,D=Math.max(r.r,r.g,r.b)||1;e[C(d)].push({x:b,y:A,z:p,r:l*r.r*z/D,g:m*r.g*z/D,b:T*r.b*z/D}),n=this.pushTrain(n,a.train,d,r)}this.shown=E,this.tiers.forEach((a,u)=>{const c=e[u],d=new Float32Array(c.length*3),b=new Float32Array(c.length*3);c.forEach((p,l)=>{d.set([p.x,p.y,p.z],l*3),b.set([p.r,p.g,p.b],l*3)}),a.geometry.dispose();const A=new f;A.setAttribute("position",new w(d,3)),A.setAttribute("color",new w(b,3)),a.geometry=A});const g=this.trains.geometry;g.setDrawRange(0,n),g.getAttribute("position").needsUpdate=!0,g.getAttribute("color").needsUpdate=!0}pushTrain(s,t,i,o){const e=t.length-1;for(let n=0;n<e;n++){if(s+h.VERTICES_PER_SEGMENT>h.MAX_SEGMENTS*h.VERTICES_PER_SEGMENT)return s;const E=1-n/e,r=1-(n+1)/e,g=I(t[n].altitudeDeg,t[n].azimuthDeg,h.RADIUS),a=I(t[n+1].altitudeDeg,t[n+1].azimuthDeg,h.RADIUS),u=d=>h.RADIUS*((h.MIN_HALF_WIDTH_DEG+h.BRIGHT_HALF_WIDTH_DEG*i*d)*Math.PI/180),c=d=>h.TRAIN_SHARE*i*d**h.TRAIN_FALLOFF;s=this.pushRibbon(s,g,a,u(E),u(r),c(E),c(r),o)}return s}pushRibbon(s,t,i,o,e,n,E,r){const g={x:i.x-t.x,y:i.y-t.y,z:i.z-t.z};if(Math.hypot(g.x,g.y,g.z)<1e-9)return s;const a=this.normalise(this.cross(this.normalise(t),this.normalise(g)));for(const[u,c]of[[-1,0],[0,1]]){const d=this.across(t,a,o,u),b=this.across(i,a,e,u),A=this.across(t,a,o,c),p=this.across(i,a,e,c),l=(m,T)=>m===0?T:0;s=this.push(s,d,l(u,n),r),s=this.push(s,b,l(u,E),r),s=this.push(s,A,l(c,n),r),s=this.push(s,b,l(u,E),r),s=this.push(s,p,l(c,E),r),s=this.push(s,A,l(c,n),r)}return s}across(s,t,i,o){return{x:s.x+t.x*i*o,y:s.y+t.y*i*o,z:s.z+t.z*i*o}}push(s,t,i,o){const e=s*3;this.positions[e]=t.x,this.positions[e+1]=t.y,this.positions[e+2]=t.z;const n=j.relativeOfResponse(Math.max(0,Math.min(1,i)));return this.colors[e]=n*o.r,this.colors[e+1]=n*o.g,this.colors[e+2]=n*o.b,s+1}cross(s,t){return{x:s.y*t.z-s.z*t.y,y:s.z*t.x-s.x*t.z,z:s.x*t.y-s.y*t.x}}normalise(s){const t=Math.hypot(s.x,s.y,s.z)||1;return{x:s.x/t,y:s.y/t,z:s.z/t}}dispose(){for(const s of this.tiers)s.geometry.dispose(),s.material.dispose();this.trains.geometry.dispose(),this.trains.material.dispose(),this.object.removeFromParent()}}class B{inSky=!0;hiddenFromEye=!0;pieces=new h;get object(){return this.pieces.object}get drawnCount(){return this.pieces.count}update(s,t,i){const o=s.length===0?[]:L.viewsAt(s,t,i.observer);o.length===0&&this.pieces.count===0||(this.pieces.set(o,i.magnitudeLimit,e=>i.cloudTransmission(e),(e,n)=>i.arrivingIlluminance(e,n,1)),i.lightFrom(o.map(e=>({position:e.head,magnitude:e.magnitude}))),i.glareFrom(o.map(e=>({key:`${e.reentryId}:${e.fragmentId}`,position:e.head,magnitude:e.magnitude,fade:e.fade}))))}pick(s,t,i){const o=this.pieces.nearest(t,i.nearestCos);return o&&{id:o.view.reentryId,detail:o}}dispose(){this.pieces.dispose()}}export{B as ReentrySimulation};
|