@rr0/ufoathome 0.202.0 → 0.202.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-embed-scene/{AirshipEditor-BnRmKeVs.js → AirshipEditor-guE_ib3z.js} +1 -1
- package/dist-embed-scene/{AirshipFlight-C9DSPGwk.js → AirshipFlight-DzW0313e.js} +1 -1
- package/dist-embed-scene/{BalloonEditor-BehJs6H-.js → BalloonEditor-BIsCy_y4.js} +2 -2
- package/dist-embed-scene/{BalloonFlight-BYn4diw1.js → BalloonFlight-gunghgAq.js} +1 -1
- package/dist-embed-scene/{BirdEditor-dOp1sGsz.js → BirdEditor-CuLv4Ij5.js} +1 -1
- package/dist-embed-scene/{BirdFlock-CfJeXvWu.js → BirdFlock-L3dYU2K_.js} +1 -1
- package/dist-embed-scene/{DroneEditor-CBoR4fJ_.js → DroneEditor-BQWPhTyf.js} +1 -1
- package/dist-embed-scene/{DroneFlight-DSE1OXqh.js → DroneFlight-ERYah68l.js} +1 -1
- package/dist-embed-scene/{DroneParameters-D3EOg4oe.js → DroneParameters-CoWQympS.js} +1 -1
- package/dist-embed-scene/{LanternEditor-CbcA7K8y.js → LanternEditor-BpCyb79i.js} +1 -1
- package/dist-embed-scene/{ModuleSession-XnOI5Mcr.js → ModuleSession-bj7QHWjO.js} +2 -2
- package/dist-embed-scene/ModuleThree-DRsA8rtL.js +1 -0
- package/dist-embed-scene/SearchlightSystem-Ddws2hQY.js +1 -0
- package/dist-embed-scene/{SkyLantern-Dp_B40X0.js → SkyLantern-C3BSxHtq.js} +1 -1
- package/dist-embed-scene/rr0-scene.mjs +85 -64
- package/dist-embed-sighting/{CaseReportExport-CkWf0HNx.js → CaseReportExport-BtGCWD7H.js} +1 -1
- package/dist-embed-sighting/{ModuleSession-ChJsGuTn.js → ModuleSession-DztK084a.js} +2 -2
- package/dist-embed-sighting/{ModuleThree-whEZoXYF.js → ModuleThree-BLNSm2eY.js} +1 -1
- package/dist-embed-sighting/SearchlightSystem-PEMBDW1s.js +1 -0
- package/dist-embed-sighting/rr0-sighting.mjs +90 -69
- package/dist-embed-sighting-editor/{BallesterGuaspAssessor-Bylahnc2.js → BallesterGuaspAssessor-CJyRqwvh.js} +1 -1
- package/dist-embed-sighting-editor/{CaseElement-DPlro-7S.js → CaseElement-D80gHg4r.js} +1 -1
- package/dist-embed-sighting-editor/{CaseReportExport-C1g5C8hi.js → CaseReportExport-Bv6FWPs2.js} +1 -1
- package/dist-embed-sighting-editor/{ControlPasses-BMEmppip.js → ControlPasses-CaVHMhEY.js} +1 -1
- package/dist-embed-sighting-editor/{CoverageAssessor-uzQnTEH8.js → CoverageAssessor-CTfHqAd_.js} +1 -1
- package/dist-embed-sighting-editor/{GLTFLoader-2Zbfb3kh.js → GLTFLoader-CrRPu-Pt.js} +1 -1
- package/dist-embed-sighting-editor/{HeadlightSystem-CBmEcC9f.js → HeadlightSystem-BmPfcHt1.js} +1 -1
- package/dist-embed-sighting-editor/{HynekAssessor-uub2VxTi.js → HynekAssessor-nBidt6QV.js} +1 -1
- package/dist-embed-sighting-editor/{InterviewEditorElement-_1fa2bG7.js → InterviewEditorElement-CQWfYlGL.js} +2 -2
- package/dist-embed-sighting-editor/{ModuleConformance-Cr6fM28A.js → ModuleConformance-CpMYkYgb.js} +2 -2
- package/dist-embed-sighting-editor/{ModuleSession-WA6lqfV6.js → ModuleSession-b_pmjUfP.js} +2 -2
- package/dist-embed-sighting-editor/ModuleThree-B_FZVqsf.js +1 -0
- package/dist-embed-sighting-editor/{ModulesPanelElement-BsRg3mzl.js → ModulesPanelElement-D0gn9Z-y.js} +3 -3
- package/dist-embed-sighting-editor/{NearestApproach-Bnx9Ld5_.js → NearestApproach-Bxo_N7a9.js} +1 -1
- package/dist-embed-sighting-editor/{PoherAssessor-CNj_Nyci.js → PoherAssessor-CEVA26zd.js} +1 -1
- package/dist-embed-sighting-editor/{RailwaySystem-6bwbv8UB.js → RailwaySystem-Ceb0_MVz.js} +1 -1
- package/dist-embed-sighting-editor/{ReferenceSystem-8QgwbbAG.js → ReferenceSystem-B15kw0uH.js} +1 -1
- package/dist-embed-sighting-editor/SearchlightSystem-D7sdsRYn.js +1 -0
- package/dist-embed-sighting-editor/{SightingElement-BQdiez39.js → SightingElement-Bp-t_EAF.js} +1 -1
- package/dist-embed-sighting-editor/{TraceSystem-DZMUxSn-.js → TraceSystem-Bv4kLpie.js} +2 -2
- package/dist-embed-sighting-editor/{WaterSystem-CB5jE7qB.js → WaterSystem-Bbk_RJKg.js} +1 -1
- package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +193 -172
- package/dist-embed-ufoathome/{AdsbLolArchiveProvider-KbJPyJ97.js → AdsbLolArchiveProvider-v1sSwhN1.js} +1 -1
- package/dist-embed-ufoathome/{Aurora-C_mCH4JM.js → Aurora-Dc4u2vEw.js} +1 -1
- package/dist-embed-ufoathome/{AuroraEditor-Dzvgh6e0.js → AuroraEditor-CeLzRDPj.js} +1 -1
- package/dist-embed-ufoathome/{AuroraSimulation-BRUnHmlp.js → AuroraSimulation-BT1CdWX5.js} +1 -1
- package/dist-embed-ufoathome/{BallesterGuaspAssessor-DurdUgbG.js → BallesterGuaspAssessor-CPW-Omah.js} +1 -1
- package/dist-embed-ufoathome/{BeamEditor-Ccvx7l7x.js → BeamEditor-BS73mBZU.js} +1 -1
- package/dist-embed-ufoathome/{BeamSystem-CPM8m17q.js → BeamSystem-C5EpRhij.js} +1 -1
- package/dist-embed-ufoathome/{BodyEditor-BG--NjnZ.js → BodyEditor-BV8WwzAj.js} +1 -1
- package/dist-embed-ufoathome/{CaseEditorElement-0J_TCeiq.js → CaseEditorElement-HR8RFluQ.js} +6 -6
- package/dist-embed-ufoathome/{CaseElement-CRXPyMMR.js → CaseElement-vCbCfGOv.js} +3 -3
- package/dist-embed-ufoathome/{CaseReportExport-DKrBXPgZ.js → CaseReportExport-XLbFCkPg.js} +3 -3
- package/dist-embed-ufoathome/{ColumnResize-DV-byvDt.js → ColumnResize-CEXrq3KB.js} +3 -3
- package/dist-embed-ufoathome/{ControlPasses-CKvTCqTI.js → ControlPasses-CKOU_3lG.js} +1 -1
- package/dist-embed-ufoathome/{CoverageAssessor-MeOMUjkZ.js → CoverageAssessor-BYMf3Qhv.js} +1 -1
- package/dist-embed-ufoathome/{Flightradar24Provider-DxTfswSh.js → Flightradar24Provider-_QPbhh5s.js} +1 -1
- package/dist-embed-ufoathome/{GLTFLoader-pi-JKaNa.js → GLTFLoader-DQeHB-Bk.js} +1 -1
- package/dist-embed-ufoathome/{GeoJsonExport-iyhoKOUU.js → GeoJsonExport-Pq_pPvjK.js} +1 -1
- package/dist-embed-ufoathome/{GeographicFigures-DBmuFlvH.js → GeographicFigures-KII55iXE.js} +1 -1
- package/dist-embed-ufoathome/{HynekAssessor-Bda6csgM.js → HynekAssessor-wCDhgIB8.js} +1 -1
- package/dist-embed-ufoathome/{InterviewEditorElement-BA060rqJ.js → InterviewEditorElement-BSwkegEp.js} +4 -4
- package/dist-embed-ufoathome/{InterviewElement-DvqsCA3I.js → InterviewElement-CfkDtybc.js} +1 -1
- package/dist-embed-ufoathome/{KmlExport-DEPgRRWe.js → KmlExport-BMNwwys8.js} +1 -1
- package/dist-embed-ufoathome/{LaserBeam--dquPX_h.js → LaserBeam-B-tlAzNB.js} +1 -1
- package/dist-embed-ufoathome/{LaunchEditor-D3P0GkLr.js → LaunchEditor-Cy5D-gwU.js} +1 -1
- package/dist-embed-ufoathome/{LaunchPlume-w4l4TR4A.js → LaunchPlume-D-vSb8tJ.js} +1 -1
- package/dist-embed-ufoathome/{LaunchSimulation-BpZd-Nov.js → LaunchSimulation-CZ8Oba00.js} +1 -1
- package/dist-embed-ufoathome/{ModelSource-Csnm3RH_.js → ModelSource-HSiigkeO.js} +1 -1
- package/dist-embed-ufoathome/{ModelThumbnails-Cnt2GxTb.js → ModelThumbnails-DWvRMmj_.js} +1 -1
- package/dist-embed-ufoathome/{ModelViewer-DOfAkPgK.js → ModelViewer-CM7qTW8F.js} +1 -1
- package/dist-embed-ufoathome/{ModulesPanelElement-DH1oroWm.js → ModulesPanelElement-DsOa2zH0.js} +1 -1
- package/dist-embed-ufoathome/{NearestApproach-DJ98M81-.js → NearestApproach-PAsV5RlG.js} +1 -1
- package/dist-embed-ufoathome/{PoherAssessor-4zSdFnFp.js → PoherAssessor-CniYlhUl.js} +1 -1
- package/dist-embed-ufoathome/{QuestionnaireFeed-W69udpmT.js → QuestionnaireFeed-CpZqkxlt.js} +1 -1
- package/dist-embed-ufoathome/{QuestionnaireForm-U78nFPn5.js → QuestionnaireForm-LkllpNx-.js} +1 -1
- package/dist-embed-ufoathome/{QuestionnaireImport-Q5uHxQwU.js → QuestionnaireImport-CNROmkT2.js} +1 -1
- package/dist-embed-ufoathome/{ReentryEditor-DEi9nT0z.js → ReentryEditor-Qax1sT82.js} +1 -1
- package/dist-embed-ufoathome/{ReentrySimulation-CSO1vgro.js → ReentrySimulation-CTeCaxZl.js} +1 -1
- package/dist-embed-ufoathome/{ReferenceSystem--tiMGm4e.js → ReferenceSystem-CM27OCUo.js} +1 -1
- package/dist-embed-ufoathome/{ScenarioReadings-Dzdgopl3.js → ScenarioReadings-Is3HX0n0.js} +1 -1
- package/dist-embed-ufoathome/{ScenarioSweep-CMcleprC.js → ScenarioSweep-BbtX26Fi.js} +1 -1
- package/dist-embed-ufoathome/{SearchlightEditor--1uL8bTa.js → SearchlightEditor-PuLz84pp.js} +1 -1
- package/dist-embed-ufoathome/SearchlightSystem-B-tHvY1M.js +1 -0
- package/dist-embed-ufoathome/{ShareDialogElement-Dlfy9NCE.js → ShareDialogElement-EzLob2Tz.js} +92 -71
- package/dist-embed-ufoathome/{SightingElement-BJSNmFM6.js → SightingElement--qpGoyxL.js} +2 -2
- package/dist-embed-ufoathome/{TraceSystem-Cq2TgP-u.js → TraceSystem-8XQX03MS.js} +1 -1
- package/dist-embed-ufoathome/{VideoButton-MRJlVNm_.js → VideoButton-WNtEngz-.js} +1 -1
- package/dist-embed-ufoathome/rr0-ufoathome.mjs +2 -2
- package/dist-embed-ufoathome/{surroundingsSources--qffL_nJ.js → surroundingsSources-UHKGesPa.js} +1 -1
- package/dist-embed-ufoathome/{trafficRuntime-CTCGr90P.js → trafficRuntime-CgY_7-NH.js} +1 -1
- package/package.json +1 -1
- package/dist-embed-scene/ModuleThree-BTQgimAj.js +0 -1
- package/dist-embed-scene/SearchlightSystem-CX1_nBkz.js +0 -1
- package/dist-embed-sighting/SearchlightSystem-B2-MzG4x.js +0 -1
- package/dist-embed-sighting-editor/ModuleThree-CB_EjTOI.js +0 -1
- package/dist-embed-sighting-editor/SearchlightSystem-CEG52QDx.js +0 -1
- package/dist-embed-ufoathome/SearchlightSystem-7bntVtp_.js +0 -1
package/dist-embed-ufoathome/{QuestionnaireForm-U78nFPn5.js → QuestionnaireForm-LkllpNx-.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Q as E}from"./CaseEditorElement-
|
|
1
|
+
import{Q as E}from"./CaseEditorElement-HR8RFluQ.js";import{InterviewFile as N}from"./interviewJson-D-i14LTf.js";import{I as y}from"./InterviewAttachments-BP6Prvdu.js";import{r as A}from"./rr0-ufoathome.mjs";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./ParameterForm-XbqxCLRn.js";import"./ColumnResize-CEXrq3KB.js";import"./ShareDialogElement-EzLob2Tz.js";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./TimelineTracks-Daaqw9ly.js";import"./ReentryArchive-CeXHrU7L.js";import"./ReferenceTimeline-2kBldQeG.js";import"./upperAirSources-BU0pD84c.js";import"./Account-C4jhsVtN.js";class x{constructor(e,o,i=()=>{}){this.container=e,this.answered=o,this.gave=i}json;recalled=()=>{};files;show(e,o,i,c,a,d=()=>{},r){this.json=o,this.recalled=d,this.files=r;const s=t=>E.text(t,c),u=[],l=e.intro?s(e.intro):i.intro.replace("{title}",s(e.title));for(const t of l.split(/\n\s*\n/)){const n=document.createElement("p");n.className="form-intro",n.textContent=t.trim(),u.push(n)}if(e.source?.url){const t=document.createElement("p");t.className="form-source";const n=document.createElement("a");n.href=e.source.url,n.target="_blank",n.rel="noopener noreferrer",n.textContent=i.source.replace("{publisher}",e.source.publisher??e.source.title??e.source.url),t.append(n),u.push(t)}const m=new Set(E.fields(e).map(t=>t.id));for(const t of e.sections)u.push(this.section(s(t.title),t.number,t.intro?s(t.intro):void 0,t.fields,o,i,c,a,t.images));const f=(o?.segments??[]).filter(t=>t.field!==void 0&&!m.has(t.field)&&o.speakers[t.speaker]?.role!=="witness").map(t=>({id:t.field,question:N.plain(t.text??t.field),kind:"long",required:!1}));f.length>0&&u.push(this.section(i.other,void 0,void 0,f,o,i,c,a)),this.container.replaceChildren(...u),this.messages=i,this.complete=new WeakSet([...this.container.querySelectorAll(".form-section")].filter(x.isComplete)),this.place()}messages;complete=new WeakSet;place(){const e=this.messages;if(e)for(const o of this.container.querySelectorAll("details.form-section")){const i=[...o.querySelectorAll(".form-field")],c=i.filter(x.isAnswered).length,a=o.querySelector(".form-section-count");a&&(a.textContent=e.sectionAnswered.replace("{n}",String(c)).replace("{total}",String(i.length))),c<i.length?this.complete.delete(o):this.complete.has(o)||(this.complete.add(o),o.open=!1)}}static isComplete(e){return[...e.querySelectorAll(".form-field")].every(x.isAnswered)}static isAnswered(e){return e.querySelector(".form-file-list li")||e.querySelector("input:checked")?!0:[...e.querySelectorAll("textarea, input:not([type=radio]):not([type=checkbox]):not([type=file]):not([type=url])")].some(o=>o.value.trim()!=="")}section(e,o,i,c,a,d,r,s,u){const l=document.createElement("details");l.className="form-section";const m=document.createElement("summary"),f=document.createElement("span");f.className="form-section-title",f.textContent=o?`${o}. ${e}`:e;const t=document.createElement("span");t.className="form-section-count",m.append(f,t),l.append(m),l.addEventListener("change",()=>this.place());for(const n of i?.split(/\n\s*\n/)??[]){const h=document.createElement("p");h.className="form-section-intro",h.textContent=n.trim(),l.append(h)}u&&l.append(...x.figures(u,r));for(const n of c){const h=n.confidential?this.recalled(n.id)??"":a?E.answerOf(a,n.id)??"":"";l.append(this.field(n,h,d,r,s))}return l}field(e,o,i,c,a){const d=E.text(e.question,c),r=document.createElement("div");r.className="form-field",r.dataset.field=e.id;const s=document.createElement("label"),u=`form-${e.id.replace(/[^A-Za-z0-9_-]/g,"_")}`;s.htmlFor=u;const l=/^[A-Za-z]?\d/.test(e.id)?`${e.id}. `:"";if(s.textContent=`${l}${d}`,e.required!==!1){const n=document.createElement("span");n.className="required",n.textContent=" *",n.title=i.required,s.append(n)}if(r.append(s),e.hint){const n=document.createElement("p");n.className="form-hint",n.textContent=E.text(e.hint,c),r.append(n)}e.images&&r.append(...x.figures(e.images,c)),e.confidential&&r.append(this.confidentialNote(e,o,i,c));const m=n=>this.answered(e.id,n,d),f=e.kind??"long";if(f==="files")return r.append(this.attached(e,u,d,i,a)),r;if((f==="choice"||f==="scale")&&e.choices){const n=document.createElement("div");n.className=`form-choices ${f}`,n.id=u;const h=f==="choice"&&e.multiple===!0;n.setAttribute("role",h?"group":"radiogroup");const w=h?o.split(";").map(v=>v.trim()):[o.trim()];for(const v of e.choices){const b=document.createElement("label"),p=document.createElement("input");p.type=h?"checkbox":"radio",p.name=u,p.value=v.value,p.checked=w.includes(v.value),p.disabled=a,p.addEventListener("change",()=>{h?m([...n.querySelectorAll("input:checked")].map(k=>k.value).join("; ")):p.checked&&m(v.value)}),b.append(p,` ${E.text(v.label,c)}`),n.append(b)}return r.append(n),r}const t=f==="long"?document.createElement("textarea"):document.createElement("input");return t.id=u,t.value=o,t.disabled=a,t.addEventListener("change",()=>m(t.value)),t instanceof HTMLInputElement&&(f==="date"||f==="time")?r.append(this.when(t,f,o,i,s)):r.append(t),r}when(e,o,i,c,a){const d=o==="date"?/^\d{4}-\d{2}-\d{2}$/:/^\d{2}:\d{2}(:\d{2})?$/,r=document.createElement("div");r.className="form-when";const s=document.createElement("button");s.type="button",s.className="form-when-mode",s.disabled=e.disabled;const u=l=>{const m=e.value;e.type=l?o:"text",o==="time"&&(e.step=l?"1":""),e.placeholder=l?"":o==="date"?c.impreciseDate:c.impreciseTime,e.value=l&&!d.test(m)?"":m,!l&&m===""&&i!==""&&(e.value=i),r.dataset.mode=l?"precise":"imprecise",s.textContent=l?c.precise:c.imprecise,s.title=l?c.preciseHint:c.impreciseHint};return s.addEventListener("click",()=>u(r.dataset.mode!=="precise")),u(i===""||d.test(i.trim())),a.append(" ",s),r.append(e),r}attached(e,o,i,c,a){const d=document.createElement("div");d.className="form-files";const r=this.json?[...E.filesOf(this.json,e.id)]:[],s=document.createElement("ul");s.className="form-file-list";const u=()=>{s.replaceChildren(...r.map((t,n)=>{const h=document.createElement("li"),w=E.fileName(t),v=this.files?.shown(t)??t.src,b=document.createElement("a");if(b.href=v,b.target="_blank",b.rel="noopener noreferrer",y.isImage(t)){const p=document.createElement("img");p.src=v,p.alt=w,p.loading="lazy",b.append(p)}if(b.append(w),h.append(b),!a){const p=document.createElement("button");p.type="button",p.className="form-file-remove",p.textContent="×",p.title=c.removeFile.replace("{name}",w),p.setAttribute("aria-label",p.title),p.addEventListener("click",()=>{r.splice(n,1),u(),this.gave(e.id,[...r],i),this.place()}),h.append(p)}return h})),s.hidden=r.length===0};if(u(),d.append(s),a||!this.files)return d;A();const l=document.createElement("label");l.className="form-file-add";const m=document.createElement("rr0-input-file");m.setAttribute("name",o),m.setAttribute("multiple",""),m.setAttribute("no-button",""),e.accept&&m.setAttribute("accept",e.accept),m.build(),m.messages=this.files.messages;const f=this.files;return m.addEventListener("filepick",t=>{const n=t.detail;if(n.url!==void 0){if(n.url.trim()==="")return;r.push({src:n.url.trim()}),m.url=""}else for(const h of n.files??[n.file])r.push(f.add(h));u(),this.gave(e.id,[...r],i),this.place()}),l.append(`${c.addFile} `,m),d.append(l),d}confidentialNote(e,o,i,c){const a=document.createElement("p");a.className="form-confidential";const d=this.json?.questionnaire?.recipient,r=o===""&&this.json?.segments.some(s=>s.field===e.id&&s.redacted?.sealed!==void 0);if(d){const s=E.text(d.name,c);a.textContent=(r?i.confidentialSealedBefore:i.confidentialSealed).replace("{name}",s)}else a.textContent=i.confidentialNowhere,a.classList.add("nowhere");return a}static figures(e,o){return e.map(i=>{const c=document.createElement("figure");c.className="form-figure";const a=document.createElement("img");if(a.src=i.src,a.alt=E.text(i.alt,o),a.loading="lazy",c.append(a),i.caption){const d=document.createElement("figcaption");d.textContent=E.text(i.caption,o),c.append(d)}return c})}}export{x as QuestionnaireForm};
|
package/dist-embed-ufoathome/{QuestionnaireImport-Q5uHxQwU.js → QuestionnaireImport-CNROmkT2.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InterviewFile as x}from"./interviewJson-D-i14LTf.js";import{Q as w}from"./CaseEditorElement-
|
|
1
|
+
import{InterviewFile as x}from"./interviewJson-D-i14LTf.js";import{Q as w}from"./CaseEditorElement-HR8RFluQ.js";import"./rr0-ufoathome.mjs";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./ParameterForm-XbqxCLRn.js";import"./ColumnResize-CEXrq3KB.js";import"./ShareDialogElement-EzLob2Tz.js";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./InterviewAttachments-BP6Prvdu.js";import"./TimelineTracks-Daaqw9ly.js";import"./ReentryArchive-CeXHrU7L.js";import"./ReferenceTimeline-2kBldQeG.js";import"./upperAirSources-BU0pD84c.js";import"./Account-C4jhsVtN.js";class d{static UNINFORMED=new RegExp("^(?:"+["je ne sais pas","j'?sais pas","sais pas","ne sait pas","nsp","inconnu","inconnue","aucune id[ée]e","je ne (?:me )?souviens (?:pas|plus)","ne se souvient pas","non renseign[ée]e?","i don'?t know","don'?t know","do not know","dunno","unknown","not known","dk","n/?a","i don'?t remember","can'?t remember","not sure","no s[ée]","no lo s[ée]","desconocido","no recuerdo","non so","non lo so","sconosciuto","non ricordo","\\?+","-+","[—–]","…","\\.{2,}"].join("|")+")[.!]?$","iu");static informed(e){if(e===void 0)return!1;const s=x.plain(e).trim().replace(/\s+/g," ").replace(/[’]/g,"'");return s!==""&&!d.UNINFORMED.test(s)}static parse(e,s={},t){const i=typeof e=="string"?d.fromText(e,t):d.fromJson(e);if(!i||i.fields.length===0)return;const r=d.interview(i.fields,s,i.about);return t&&(r.questionnaire={id:t.id,...t.version?{version:t.version}:{}}),r}static interview(e,s={},t={}){const i={},r=s.by?.[0];i.interviewer={role:"interviewer",...r!==void 0?{by:{people:r}}:{}};const c=s.witnesses?.length===1?s.witnesses[0]:void 0;i.witness={role:"witness",...c?{title:c.label,of:c.id}:{}};const n=[];for(const a of e){n.push({speaker:"interviewer",field:a.id,text:a.question});const l=a.answer?.trim();l&&n.push({speaker:"witness",field:a.id,text:l})}return{version:1,...t.language?{language:t.language}:{},...t.title?{title:t.title}:{},...t.time?{time:t.time}:{},medium:"questionnaire",...c?{interviewOf:c.id}:{},speakers:i,transcription:{method:"manual"},proofreading:{interviewer:{status:"pending"},witness:{status:"pending"}},segments:n}}static answers(e){const s=new Map;return e.segments.forEach((t,i)=>{if(t.field===void 0||s.has(t.field)||e.speakers[t.speaker]?.role!=="witness")return;const r=x.said(t);r!==void 0&&d.informed(r)&&s.set(t.field,{field:t.field,segment:i,text:r.trim()})}),s}static sourceOf(e,s,t){const i=d.answers(e).get(s);if(i)return{said:{...t!==void 0?{interview:t}:{},segment:i.segment}}}static fromJson(e){const s={};let t=e;if(e!==null&&typeof e=="object"&&!Array.isArray(e)){const r=e,c=["fields","questions","answers"].find(n=>Array.isArray(r[n]));if(c){t=r[c];for(const n of["title","time","language"])typeof r[n]=="string"&&(s[n]=r[n])}else{const n=Object.entries(r);return n.length===0||!n.every(([,a])=>d.isAnswer(a))?void 0:{fields:n.map(([a,l],g)=>({id:String(g+1),question:a,...d.answerOf(l)})),about:s}}}if(!Array.isArray(t))return;const i=[];return t.forEach((r,c)=>{if(r===null||typeof r!="object"||Array.isArray(r))return;const n=r,a=(...m)=>m.map(o=>n[o]).find(o=>o!==void 0),l=a("id","number","field","key","name"),g=a("question","label","title","text","q"),p=a("answer","value","response","a","reply");g===void 0&&l===void 0||i.push({id:String(l!==void 0?l:c+1),question:typeof g=="string"&&g.trim()!==""?g.trim():String(l),...d.isAnswer(p)?d.answerOf(p):{}})}),{fields:i,about:s}}static isAnswer(e){return e==null||["string","number","boolean"].includes(typeof e)||Array.isArray(e)&&e.every(s=>["string","number","boolean"].includes(typeof s))}static answerOf(e){if(e==null)return{};const s=Array.isArray(e)?e.map(String).join(", "):String(e);return s.trim()===""?{}:{answer:s.trim()}}static fromText(e,s){const t=e.replace(/^/,"").replace(/\r\n?/g,`
|
|
2
2
|
`).replace(/^(?:[ \t]*\n)+|(?:\n[ \t]*)+$/g,"");if(t.trim()==="")return;if(/^\s*[{[]/.test(t))try{return d.fromJson(JSON.parse(t))}catch{}const i=d.table(t);return i?{fields:i,about:{}}:{fields:d.lines(t,s),about:{}}}static table(e){const s=e.split(`
|
|
3
3
|
`).filter(t=>t.trim()!=="");for(const t of[" ",";",","]){const i=s.map(n=>d.cells(n,t)),r=i[0].length;if(r<2||!i.every(n=>n.length===r))continue;const c=i[0].some(n=>/^(question|questions|answer|answers|r[ée]ponse|r[ée]ponses|field|champ|n°|no|num[ée]ro|id)$/i.test(n.trim()));return i.slice(c?1:0).map((n,a)=>r===2?{id:String(a+1),question:n[0].trim(),...d.answerOf(n[1])}:{id:n[0].trim()||String(a+1),question:n[1].trim()||n[0].trim(),...d.answerOf(n.slice(2).join(t===" "?" ":`${t} `))})}}static cells(e,s){const t=[];let i="",r=!1;for(let c=0;c<e.length;c++){const n=e[c];r?n==='"'&&e[c+1]==='"'?(i+='"',c++):n==='"'?r=!1:i+=n:n==='"'&&i.trim()===""?(r=!0,i=""):n===s?(t.push(i),i=""):i+=n}return t.push(i),t}static lines(e,s){const t=o=>o.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]/g,""),r=(s?w.fields(s):[]).filter(o=>!/^[A-Za-z]?\d/.test(o.id)).map(o=>({id:o.id,key:t(w.text(o.question,s?.language))})),c=(s?.stops??[]).map(o=>t(w.text(o,s?.language))).filter(o=>o!==""),n=new Set((s?.sections??[]).flatMap(o=>[o.title,o.intro]).filter(o=>o!==void 0).map(o=>t(w.text(o,s?.language)))),a=/^(?:q(?:uestion)?\s*)?([A-Za-z]?\d+[a-z]?['’]?)\s*[.)\-–:]\s*(.*)$/u,l=/\bpage\s*:?\s*\d+(?:\s*\/\s*\d+)?\s*$/i,g=[];let p;const m=[];for(const o of e.split(`
|
|
4
4
|
`)){const f=o.trim();if(l.test(f))continue;if(c.some(y=>t(f).startsWith(y))){p=void 0;continue}const u=a.exec(f),v=u&&(!s||w.field(s,d.idOf(u[1])))?u:null,h=v?void 0:r.find(y=>y.key!==""&&t(f).startsWith(y.key));if(v||h){p={id:v?d.idOf(v[1]):h.id,lines:[v?v[2]:f]},g.push(p);continue}if(n.has(t(f))&&f!=="")continue;if(p){p.lines.push(f);continue}if(f===""||s)continue;const q=d.split(f);q&&m.push({id:String(m.length+1),...q})}return g.length===0?m:g.map(o=>{const f=o.lines.join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{M as w,_ as I,d as F}from"./rr0-ufoathome.mjs";import{P as S,I as x}from"./SaidPosition-OJEYhVKN.js";import{S as N}from"./SkyEventEditorStyle-CvY_AhbI.js";import{q as b,bm as M,aK as E,aE as C,m as _,s as P,ba as L}from"./ShareDialogElement-Dlfy9NCE.js";import{c as G}from"./Sighting-B7bsiTIQ.js";import{P as D,a as k,E as H}from"./ParameterForm-XbqxCLRn.js";import{T as K}from"./TimelineTracks-Daaqw9ly.js";import{R as O}from"./ReentryArchive-CeXHrU7L.js";import"./GeoProjection-DvqDbRIx.js";import"./three.module-CbaHqYFq.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./VisualAids-DI-hEL46.js";const z=w.catalog({en:()=>I(()=>import("./ReentryParameterTexts_en-5BOfwCsS.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_en),fr:()=>I(()=>import("./ReentryParameterTexts_fr-BgUJROXF.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_fr),es:()=>I(()=>import("./ReentryParameterTexts_es-ze1-U4jB.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_es),it:()=>I(()=>import("./ReentryParameterTexts_it-MTb9Vuq0.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_it)});class g{static NAME="name";static OBJECT="object";static LIGHT="light";static WHEN="when";static SEEN="seenByTheWitness";static EARTH_KM=6371;static placeSeen(t,e,n,i){const r=Math.PI/180,o=g.EARTH_KM,a=n*r,s=-o*Math.sin(a)+Math.sqrt((o*Math.sin(a))**2+(o+i)**2-o**2),d=Math.atan2(s*Math.cos(a),o+s*Math.sin(a)),c=t.lat*r,l=e*r,h=Math.asin(Math.sin(c)*Math.cos(d)+Math.cos(c)*Math.sin(d)*Math.cos(l)),m=t.lng*r+Math.atan2(Math.sin(l)*Math.sin(d)*Math.cos(c),Math.cos(d)-Math.sin(c)*Math.sin(h));return{lat:h/r,lng:(m/r+540)%360-180}}static trackFromSeen(t,e){const n=t.seen,{fromAzimuthDeg:i,fromAltitudeDeg:r,toAzimuthDeg:o,toAltitudeDeg:a,durationS:s}=n??{};if(i===void 0||r===void 0||o===void 0||a===void 0||!s)return;const d=t.track[0],c=t.track[t.track.length-1],l=d?.t??0,h=d?.altitudeKm??100,m=c?.altitudeKm??h;return[{t:l,...g.placeSeen(e,i,r,h),altitudeKm:h},{t:l+Math.round(s*1e3),...g.placeSeen(e,o,a,m),altitudeKm:m}]}static placeAt(t,e){const n=b.leadAt(t,e);if(n)return{t:e,lat:n.lat,lng:n.lng,altitudeKm:n.heightM/1e3};const i=t.track,[r,o]=e<(i[0]?.t??0)?[i[0],i[1]]:[i[i.length-2],i[i.length-1]];if(!r||!o||o.t===r.t){const s=r??o??{lat:0,lng:0,altitudeKm:80};return{t:e,lat:s.lat,lng:s.lng,altitudeKm:s.altitudeKm}}const a=(e-r.t)/(o.t-r.t);return{t:e,lat:r.lat+(o.lat-r.lat)*a,lng:r.lng+(o.lng-r.lng)*a,altitudeKm:Math.max(0,r.altitudeKm+(o.altitudeKm-r.altitudeKm)*a)}}static curvePointAt(t,e){return{t:e,absoluteMagnitude:Math.round(b.absoluteMagnitudeAt(t,e)*10)/10}}static instantsOf(t){return[...t.track.map(e=>e.t),...t.fragments.flatMap(e=>[...e.fromT===void 0?[]:[e.fromT],...e.untilT===void 0?[]:[e.untilT],...(e.lightCurve??[]).map(n=>n.t)])]}static instant(t,e,n,i={}){return{type:"number",key:t,min:-3600,max:36e3,step:.1,unit:"s",scale:.001,label:e,hint:n,...i}}static mayBeCatalogued(t){return M.of(t.type)?.nature!=="natural"}static SET={kind:"reentry",title:"fireballOrReEntry",parameters:[{type:"said",key:"title",label:g.NAME},{type:"choice",key:"type",label:"type",hint:"whatCameInNaturalOrPut",empty:"notKnown",choices:[],optionsOf:t=>{const e=t.type,n=M.all().map(i=>({value:i.key,label:M.nameOf(i.key)}));return e===void 0||n.some(i=>i.value===e)?n:[...n,{value:e,label:e}]}},{type:"text",key:"object.name",group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"catalogueName",hint:"forAReEntryThePiece"},{type:"text",key:"object.cosparId",group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"cosparId",placeholder:"t1968013c"},{type:"number",key:"object.norad",min:1,max:999999,step:1,group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"noradNumber"},{type:"number",key:"seen.fromAzimuthDeg",min:0,max:360,step:1,unit:"°",group:g.SEEN,label:"appearedAzimuth",hint:"fromTheNorthTowardsTheEast"},{type:"number",key:"seen.fromAltitudeDeg",min:-5,max:90,step:1,unit:"°",group:g.SEEN,label:"appearedHeight",hint:"aboveTheHorizon"},{type:"number",key:"seen.toAzimuthDeg",min:0,max:360,step:1,unit:"°",group:g.SEEN,label:"wentOutAzimuth",hint:"fromTheNorthTowardsTheEast"},{type:"number",key:"seen.toAltitudeDeg",min:-5,max:90,step:1,unit:"°",group:g.SEEN,label:"wentOutHeight",hint:"aboveTheHorizon"},{type:"number",key:"seen.durationS",min:.1,max:3600,step:.1,unit:"s",group:g.SEEN,label:"seenFor",hint:"allSaidThePathIsWorkedOut"}]};static PLACE={kind:"reentry-place",title:"pointOfThePath",parameters:[g.instant("t","time","secondsOfTheRecordingNegativeBefore",{required:!0}),{type:"position",key:"lat",secondKey:"lng",saidKey:"saidPosition",native:"geo",step:1,rangeM:2e6,label:"position"},{type:"number",key:"altitudeKm",min:0,max:300,step:.1,unit:"km",required:!0,label:"altitude",hint:"aboveTheEllipsoidAMeteorBegins"}]};static trackEnd(t,e){const n=t?.track;if(n?.length)return e==="first"?n[0].t:n[n.length-1].t}static FRAGMENT={kind:"reentry-fragment",title:"piece",parameters:[{type:"text",key:"id",label:"id",validate:(t,e,n)=>!n?.fragments.some(i=>i!==e&&i.id===t)},{type:"number",key:"absoluteMagnitude",min:-40,max:10,step:.1,required:!0,group:g.LIGHT,label:"absoluteMagnitude",hint:"itsBrightnessSeenFrom100Km"},{type:"colour",key:"color",group:g.LIGHT,fallback:b.DEFAULT_COLOR,label:"colour"},{type:"number",key:"trainS",min:0,max:600,step:.1,unit:"s",group:g.LIGHT,effective:()=>b.DEFAULT_TRAIN_S,label:"train",hint:"howLongAStretchOfIts"},{type:"number",key:"lagS",min:0,max:600,step:.1,unit:"s",group:g.WHEN,effective:()=>0,label:"behindTheLead",hint:"secondsBehindTheLeadingPointAlong"},g.instant("fromT","seenFrom","whenItBreaksOffOrBegins",{group:g.WHEN,effective:(t,e)=>g.trackEnd(e,"first")}),g.instant("untilT","outAt","whenItHasBurnedUpOr",{group:g.WHEN,effective:(t,e)=>g.trackEnd(e,"last")})]};static CURVE_POINT={kind:"reentry-curve-point",title:"pointOfTheLightCurve",parameters:[g.instant("t","time","secondsOfTheRecording",{required:!0}),{type:"number",key:"absoluteMagnitude",min:-40,max:10,step:.1,required:!0,label:"absoluteMagnitude"}]}}const $=w.catalog({en:()=>I(()=>import("./ReentryEditorMessages_en-BmTZMr-m.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_en),fr:()=>I(()=>import("./ReentryEditorMessages_fr-DHbcY0tN.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_fr),es:()=>I(()=>import("./ReentryEditorMessages_es-edid__Jo.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_es),it:()=>I(()=>import("./ReentryEditorMessages_it-CIzkIU4G.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_it)});class u{static TIME_MARGIN_MIN=6;static HEADING_MARGIN_DEG=45;static ELEVATION_LOW_FACTOR=.3;static ELEVATION_SLACK_DEG=5;static DURATION_FACTOR=3;static ARCHIVED_MAGNITUDE=-3;static WATCHED_KM=600;static WATCHED_COUNT=5;static NIGHT_SUN_DEG=-12;static SHOWER_MARGIN_DEG=20;static RADIANT_BELOW_DEG=-10;static FIRST_ORBIT_MS=Date.UTC(1957,9,4);static shared={fireballs:new E,reentries:new O};static viewOf(t,e,n){const i=t.track;if(i.length<2)return;const r=i[0],o=i[i.length-1],a=t.seen,s=m=>b.seenFrom(n,{lat:m.lat,lng:m.lng,heightM:m.altitudeKm*1e3}),d=a?.fromAzimuthDeg!==void 0&&a.fromAltitudeDeg!==void 0?{azimuthDeg:a.fromAzimuthDeg,altitudeDeg:a.fromAltitudeDeg}:s(r),c=a?.toAzimuthDeg!==void 0&&a.toAltitudeDeg!==void 0?{azimuthDeg:a.toAzimuthDeg,altitudeDeg:a.toAltitudeDeg}:s(o),l=a?.durationS??(o.t-r.t)/1e3,h=Math.min(...t.fragments.flatMap(m=>[m.absoluteMagnitude,...(m.lightCurve??[]).map(f=>f.absoluteMagnitude)]));return{startMs:e.getTime()+r.t,durationS:l,from:{azimuthDeg:d.azimuthDeg,altitudeDeg:d.altitudeDeg},to:{azimuthDeg:c.azimuthDeg,altitudeDeg:c.altitudeDeg},peakAbsoluteMagnitude:h}}static azimuthOff(t,e){const n=Math.abs(((t-e)%360+360)%360);return Math.min(n,360-n)}static elevationOff(t,e){const n=Math.max(0,t*u.ELEVATION_LOW_FACTOR)-u.ELEVATION_SLACK_DEG,i=t+u.ELEVATION_SLACK_DEG;return e<n?n-e:e>i?e-i:0}static matchFireball(t,e,n){const i=e.t<t.startMs?t.startMs-e.t:0,r=e.t>t.startMs?e.t-t.startMs:0;if(Math.max(i,r)>u.TIME_MARGIN_MIN*6e4)return;const o=b.seenFrom(n,{lat:e.from[0],lng:e.from[1],heightM:e.from[2]*1e3}),a=b.seenFrom(n,{lat:e.to[0],lng:e.to[1],heightM:e.to[2]*1e3});if(o.altitudeDeg<0&&a.altitudeDeg<0)return;const s=Math.max(u.azimuthOff(t.from.azimuthDeg,o.azimuthDeg),u.azimuthOff(t.to.azimuthDeg,a.azimuthDeg));if(s>u.HEADING_MARGIN_DEG||Math.max(u.elevationOff(t.from.altitudeDeg,o.altitudeDeg),u.elevationOff(t.to.altitudeDeg,a.altitudeDeg))>0)return;const c=u.DURATION_FACTOR;if(!(e.durationS>0&&(t.durationS<e.durationS/c||t.durationS>e.durationS*c)))return{record:e,offsetMinutes:Math.round((i+r)/6e4),headingOffDeg:Math.round(s),altitudeOffDeg:Math.round(Math.abs(a.altitudeDeg-t.to.altitudeDeg))}}static async check(t,e,n,i=u.shared){if(!e||!n)return[{verdict:"unchecked",source:"none",reason:"noDateOrPlace"}];const r=u.viewOf(t,e,n);if(!r)return[{verdict:"unchecked",source:"none",reason:"noDateOrPlace"}];const o=M.of(t.type)?.nature,a=[];if(o!=="artificial"&&a.push(...await u.checkFireballs(r,n,o==="natural",i)),o!=="artificial"){const s=u.showerOf(r,n);s&&(s.verdict==="compatible"||o==="natural")&&a.push(s)}return o!=="natural"&&a.push(...await u.checkCatalogue(t,r,n,o==="artificial",i)),o===void 0&&!a.some(s=>s.verdict==="known"||s.verdict==="possible"||s.verdict==="compatible")?[...a.filter(s=>s.verdict==="unchecked"),{verdict:"uninformative",source:"none",reason:"typeUnknown"}]:a}static vectorOf(t,e){const n=Math.PI/180,i=e*n,r=t*n;return[Math.cos(i)*Math.sin(r),Math.cos(i)*Math.cos(r),Math.sin(i)]}static angleDeg(t,e){return Math.acos(Math.max(-1,Math.min(1,t[0]*e[0]+t[1]*e[1]+t[2]*e[2])))*180/Math.PI}static showerOf(t,e){const n=u.vectorOf(t.from.azimuthDeg,t.from.altitudeDeg),i=u.vectorOf(t.to.azimuthDeg,t.to.altitudeDeg),r=u.angleDeg(n,i);if(r<1)return;const o=[n[1]*i[2]-n[2]*i[1],n[2]*i[0]-n[0]*i[2],n[0]*i[1]-n[1]*i[0]],a=Math.hypot(o[0],o[1],o[2]),s=new Date(t.startMs),d=C.activeAt(s);let c;for(const{shower:l,zhr:h}of d){const m=C.radiantPosition(l,s,{lat:e.lat,lng:e.lng,elevationM:e.heightM});if(m.altitudeDeg<u.RADIANT_BELOW_DEG)continue;const f=u.vectorOf(m.azimuthDeg,m.altitudeDeg),p=Math.asin(Math.min(1,Math.abs((f[0]*o[0]+f[1]*o[1]+f[2]*o[2])/a)))*180/Math.PI,y=u.angleDeg(f,n),A=u.angleDeg(f,i);y>=A||A<=r||p<=u.SHOWER_MARGIN_DEG&&(!c||p<c.offDeg)&&(c={showerId:l.id,offDeg:Math.round(p),zhr:Math.round(h)})}return c?{verdict:"compatible",source:"showers",...c}:{verdict:"sporadic",source:"showers",active:d.length}}static async checkFireballs(t,e,n,i){const r=u.TIME_MARGIN_MIN*6e4;if(!E.mayCover(t.startMs))return n?[{verdict:"uninformative",source:"gmn",reason:"beforeArchive"}]:[];const o=await i.fireballs.between(t.startMs-r,t.startMs+r+t.durationS*1e3);if(o===void 0)return n?[{verdict:"unchecked",source:"gmn",reason:"unreachable"}]:[];const a=o.map(m=>u.matchFireball(t,m,e)).filter(m=>m!==void 0).sort((m,f)=>m.offsetMinutes-f.offsetMinutes||m.headingOffDeg-f.headingOffDeg);if(a.length>0)return[{verdict:"known",source:"gmn",match:a[0]}];if(!n)return[];if(t.peakAbsoluteMagnitude>u.ARCHIVED_MAGNITUDE)return[{verdict:"uninformative",source:"gmn",reason:"faint"}];if(_("Sun",new Date(t.startMs),{lat:e.lat,lng:e.lng,elevationM:0}).altitudeDeg>u.NIGHT_SUN_DEG)return[{verdict:"uninformative",source:"gmn",reason:"daylight"}];const s=new Date(t.startMs),d=Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),1),c=Date.UTC(s.getUTCFullYear(),s.getUTCMonth()+1,1)-1,h=(await i.fireballs.between(d,c)??[]).filter(m=>O.distanceKm(e.lat,e.lng,m.from[0],m.from[1])<=u.WATCHED_KM).length;return h<u.WATCHED_COUNT?[{verdict:"uninformative",source:"gmn",reason:"unwatched"}]:[{verdict:"expectedAbsent",source:"gmn",absoluteMagnitude:t.peakAbsoluteMagnitude,watchedCount:h}]}static async checkCatalogue(t,e,n,i,r){if(e.startMs<u.FIRST_ORBIT_MS)return i?[{verdict:"impossible",source:"catalogue"}]:[];const o=u.TIME_MARGIN_MIN*6e4,a=await r.reentries.candidates(e.startMs-o,e.startMs+o+e.durationS*1e3,n);if(a===void 0)return i?[{verdict:"unchecked",source:"catalogue",reason:"unreachable"}]:[];const s=t.object,d=s&&a.find(l=>s.cosparId&&l.record.cosparId===s.cosparId||s.norad!==void 0&&l.record.norad===s.norad);if(d)return[{verdict:"known",source:"catalogue",candidate:d,by:"object"}];const c=a.find(l=>l.record.precision==="minute"&&l.seenKm!==void 0&&(l.offsetMinutes??0)<=u.TIME_MARGIN_MIN);return c?[{verdict:"known",source:"catalogue",candidate:c,by:"seen"}]:a.length>0?a.slice(0,3).map(l=>({verdict:"possible",source:"catalogue",candidate:l})):i?[{verdict:"expectedAbsent",source:"catalogue"}]:[]}}class T{constructor(t,e,n){this.container=t,this.host=e,N.attach(t,"reentry-editor-part",T.STYLE),this.language=n,this.ready=this.setLanguage(n)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;timeline;placeForm;placeIndex=0;row="path";fragmentForm;fragmentIndex=0;curveForm;curveIndex=0;language;shown=[];static STYLE='.reentry-editor-part { flex-basis: 100%; min-width: 0; } .reentry-editor-part #reentry-timeline { flex-basis: 100%; min-width: 0; padding: 4px 0; } .reentry-editor-part #reentry-path > .icon-btn, .reentry-editor-part #reentry-curve > .icon-btn { align-self: flex-end; } .reentry-editor-part #reentry-list, .reentry-editor-part #reentry-places, .reentry-editor-part #reentry-fragment-list, .reentry-editor-part #reentry-curve-list { flex-basis: 100%; min-width: 0; } .reentry-editor-part .launch-editor, .reentry-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .reentry-editor-part .launch-fields { flex-basis: 100%; min-width: 0; } .reentry-editor-part [hidden] { display: none !important; } .reentry-editor-part .reentry-evidence { flex-basis: 100%; } .reentry-editor-part .evidence-known, .reentry-editor-part .evidence-impossible, .reentry-editor-part .evidence-expectedAbsent { font-weight: 600; } .reentry-editor-part select { min-width: 0; width: 100%; } .reentry-editor-part .launch-intro { flex-basis: 100%; margin: 0; } .reentry-editor-part .launch-track { flex-basis: 100%; margin: 0; } .reentry-editor-part .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .reentry-editor-part .parameter-group { flex: 1 1 14em; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; align-content: flex-start; } .reentry-editor-part input, .reentry-editor-part select { max-width: 100%; box-sizing: border-box; } .reentry-editor-part input[type="text"] { width: 12em; } .reentry-editor-part input[data-key="title"] { width: 18em; } .reentry-editor-part label { min-width: 0; max-width: 100%; } .reentry-editor-part input.parameter-derived::placeholder { opacity: .65; } .reentry-editor-part .launch-path { flex: 1 1 100%; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; }';async setLanguage(t){const e=++this.languageToken;this.language=t;const[n,i,,r]=await Promise.all([$.load(t),z.load(t),M.load(t),F(t).catch(()=>{})]);e===this.languageToken&&(this.sceneNames=r,this.messages=n,this.parameterTexts=i,this.render(),this.sync())}sync(){if(!this.messages)return;const t=this.reentries;this.shown=[...t],t.some(n=>n.id===this.currentId)||(this.currentId=t[0]?.id),this.list?.setItems(t.map(n=>({id:n.id,label:this.labelOf(n)})),this.currentId),this.list?.setKinds(M.all().map(n=>({value:n.key,label:M.nameOf(n.key)}))),this.syncAddState();const e=this.current;this.element("reentry-fields").hidden=e===void 0,e&&(this.syncPlace(!0),this.syncFragments(e,!0),this.syncEvidence(),this.form??=new D(this.element("reentry-parameters"),this.language,"reentry.",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(this.resolved(g.SET),new k(()=>this.current,n=>this.editReentry(i=>{i.object&&(i.object={...i.object}),i.seen&&(i.seen={...i.seen}),n(i),i.object&&Object.values(i.object).every(a=>a===void 0||a==="")&&delete i.object;const r=this.origin(),o=r&&g.trackFromSeen(i,r);o&&(i.track=o)})),()=>this.written()))}refresh(){if(!this.messages)return;this.syncAddState();const t=this.reentries;if(t.length===this.shown.length&&t.every((e,n)=>e.id===this.shown[n].id)){this.syncTimeline();return}this.sync()}setTime(t){this.messages&&this.timeline?.setTime(t)}syncAddState(){const t=this.origin()!==void 0;this.list?.setAddState(t,t?void 0:this.messages.addNowhere)}get current(){return this.reentries.find(t=>t.id===this.currentId)}show(t){this.messages&&(this.currentId=t,this.row="path",this.placeIndex=0,this.fragmentIndex=0,this.curveIndex=0,this.sync())}resolved(t){return S.resolve(t,this.parameterTexts)}render(){if(!this.messages)return;const t=this.messages;this.form=void 0,this.evidenceFor=void 0,this.container.innerHTML=`<div class="launch-editor">
|
|
1
|
+
import{M as w,_ as I,d as F}from"./rr0-ufoathome.mjs";import{P as S,I as x}from"./SaidPosition-OJEYhVKN.js";import{S as N}from"./SkyEventEditorStyle-CvY_AhbI.js";import{q as b,bm as M,aK as E,aE as C,m as _,s as P,ba as L}from"./ShareDialogElement-EzLob2Tz.js";import{c as G}from"./Sighting-B7bsiTIQ.js";import{P as D,a as k,E as H}from"./ParameterForm-XbqxCLRn.js";import{T as K}from"./TimelineTracks-Daaqw9ly.js";import{R as O}from"./ReentryArchive-CeXHrU7L.js";import"./GeoProjection-DvqDbRIx.js";import"./three.module-CbaHqYFq.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./VisualAids-DI-hEL46.js";const z=w.catalog({en:()=>I(()=>import("./ReentryParameterTexts_en-5BOfwCsS.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_en),fr:()=>I(()=>import("./ReentryParameterTexts_fr-BgUJROXF.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_fr),es:()=>I(()=>import("./ReentryParameterTexts_es-ze1-U4jB.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_es),it:()=>I(()=>import("./ReentryParameterTexts_it-MTb9Vuq0.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_it)});class g{static NAME="name";static OBJECT="object";static LIGHT="light";static WHEN="when";static SEEN="seenByTheWitness";static EARTH_KM=6371;static placeSeen(t,e,n,i){const r=Math.PI/180,o=g.EARTH_KM,a=n*r,s=-o*Math.sin(a)+Math.sqrt((o*Math.sin(a))**2+(o+i)**2-o**2),d=Math.atan2(s*Math.cos(a),o+s*Math.sin(a)),c=t.lat*r,l=e*r,h=Math.asin(Math.sin(c)*Math.cos(d)+Math.cos(c)*Math.sin(d)*Math.cos(l)),m=t.lng*r+Math.atan2(Math.sin(l)*Math.sin(d)*Math.cos(c),Math.cos(d)-Math.sin(c)*Math.sin(h));return{lat:h/r,lng:(m/r+540)%360-180}}static trackFromSeen(t,e){const n=t.seen,{fromAzimuthDeg:i,fromAltitudeDeg:r,toAzimuthDeg:o,toAltitudeDeg:a,durationS:s}=n??{};if(i===void 0||r===void 0||o===void 0||a===void 0||!s)return;const d=t.track[0],c=t.track[t.track.length-1],l=d?.t??0,h=d?.altitudeKm??100,m=c?.altitudeKm??h;return[{t:l,...g.placeSeen(e,i,r,h),altitudeKm:h},{t:l+Math.round(s*1e3),...g.placeSeen(e,o,a,m),altitudeKm:m}]}static placeAt(t,e){const n=b.leadAt(t,e);if(n)return{t:e,lat:n.lat,lng:n.lng,altitudeKm:n.heightM/1e3};const i=t.track,[r,o]=e<(i[0]?.t??0)?[i[0],i[1]]:[i[i.length-2],i[i.length-1]];if(!r||!o||o.t===r.t){const s=r??o??{lat:0,lng:0,altitudeKm:80};return{t:e,lat:s.lat,lng:s.lng,altitudeKm:s.altitudeKm}}const a=(e-r.t)/(o.t-r.t);return{t:e,lat:r.lat+(o.lat-r.lat)*a,lng:r.lng+(o.lng-r.lng)*a,altitudeKm:Math.max(0,r.altitudeKm+(o.altitudeKm-r.altitudeKm)*a)}}static curvePointAt(t,e){return{t:e,absoluteMagnitude:Math.round(b.absoluteMagnitudeAt(t,e)*10)/10}}static instantsOf(t){return[...t.track.map(e=>e.t),...t.fragments.flatMap(e=>[...e.fromT===void 0?[]:[e.fromT],...e.untilT===void 0?[]:[e.untilT],...(e.lightCurve??[]).map(n=>n.t)])]}static instant(t,e,n,i={}){return{type:"number",key:t,min:-3600,max:36e3,step:.1,unit:"s",scale:.001,label:e,hint:n,...i}}static mayBeCatalogued(t){return M.of(t.type)?.nature!=="natural"}static SET={kind:"reentry",title:"fireballOrReEntry",parameters:[{type:"said",key:"title",label:g.NAME},{type:"choice",key:"type",label:"type",hint:"whatCameInNaturalOrPut",empty:"notKnown",choices:[],optionsOf:t=>{const e=t.type,n=M.all().map(i=>({value:i.key,label:M.nameOf(i.key)}));return e===void 0||n.some(i=>i.value===e)?n:[...n,{value:e,label:e}]}},{type:"text",key:"object.name",group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"catalogueName",hint:"forAReEntryThePiece"},{type:"text",key:"object.cosparId",group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"cosparId",placeholder:"t1968013c"},{type:"number",key:"object.norad",min:1,max:999999,step:1,group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"noradNumber"},{type:"number",key:"seen.fromAzimuthDeg",min:0,max:360,step:1,unit:"°",group:g.SEEN,label:"appearedAzimuth",hint:"fromTheNorthTowardsTheEast"},{type:"number",key:"seen.fromAltitudeDeg",min:-5,max:90,step:1,unit:"°",group:g.SEEN,label:"appearedHeight",hint:"aboveTheHorizon"},{type:"number",key:"seen.toAzimuthDeg",min:0,max:360,step:1,unit:"°",group:g.SEEN,label:"wentOutAzimuth",hint:"fromTheNorthTowardsTheEast"},{type:"number",key:"seen.toAltitudeDeg",min:-5,max:90,step:1,unit:"°",group:g.SEEN,label:"wentOutHeight",hint:"aboveTheHorizon"},{type:"number",key:"seen.durationS",min:.1,max:3600,step:.1,unit:"s",group:g.SEEN,label:"seenFor",hint:"allSaidThePathIsWorkedOut"}]};static PLACE={kind:"reentry-place",title:"pointOfThePath",parameters:[g.instant("t","time","secondsOfTheRecordingNegativeBefore",{required:!0}),{type:"position",key:"lat",secondKey:"lng",saidKey:"saidPosition",native:"geo",step:1,rangeM:2e6,label:"position"},{type:"number",key:"altitudeKm",min:0,max:300,step:.1,unit:"km",required:!0,label:"altitude",hint:"aboveTheEllipsoidAMeteorBegins"}]};static trackEnd(t,e){const n=t?.track;if(n?.length)return e==="first"?n[0].t:n[n.length-1].t}static FRAGMENT={kind:"reentry-fragment",title:"piece",parameters:[{type:"text",key:"id",label:"id",validate:(t,e,n)=>!n?.fragments.some(i=>i!==e&&i.id===t)},{type:"number",key:"absoluteMagnitude",min:-40,max:10,step:.1,required:!0,group:g.LIGHT,label:"absoluteMagnitude",hint:"itsBrightnessSeenFrom100Km"},{type:"colour",key:"color",group:g.LIGHT,fallback:b.DEFAULT_COLOR,label:"colour"},{type:"number",key:"trainS",min:0,max:600,step:.1,unit:"s",group:g.LIGHT,effective:()=>b.DEFAULT_TRAIN_S,label:"train",hint:"howLongAStretchOfIts"},{type:"number",key:"lagS",min:0,max:600,step:.1,unit:"s",group:g.WHEN,effective:()=>0,label:"behindTheLead",hint:"secondsBehindTheLeadingPointAlong"},g.instant("fromT","seenFrom","whenItBreaksOffOrBegins",{group:g.WHEN,effective:(t,e)=>g.trackEnd(e,"first")}),g.instant("untilT","outAt","whenItHasBurnedUpOr",{group:g.WHEN,effective:(t,e)=>g.trackEnd(e,"last")})]};static CURVE_POINT={kind:"reentry-curve-point",title:"pointOfTheLightCurve",parameters:[g.instant("t","time","secondsOfTheRecording",{required:!0}),{type:"number",key:"absoluteMagnitude",min:-40,max:10,step:.1,required:!0,label:"absoluteMagnitude"}]}}const $=w.catalog({en:()=>I(()=>import("./ReentryEditorMessages_en-BmTZMr-m.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_en),fr:()=>I(()=>import("./ReentryEditorMessages_fr-DHbcY0tN.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_fr),es:()=>I(()=>import("./ReentryEditorMessages_es-edid__Jo.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_es),it:()=>I(()=>import("./ReentryEditorMessages_it-CIzkIU4G.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_it)});class u{static TIME_MARGIN_MIN=6;static HEADING_MARGIN_DEG=45;static ELEVATION_LOW_FACTOR=.3;static ELEVATION_SLACK_DEG=5;static DURATION_FACTOR=3;static ARCHIVED_MAGNITUDE=-3;static WATCHED_KM=600;static WATCHED_COUNT=5;static NIGHT_SUN_DEG=-12;static SHOWER_MARGIN_DEG=20;static RADIANT_BELOW_DEG=-10;static FIRST_ORBIT_MS=Date.UTC(1957,9,4);static shared={fireballs:new E,reentries:new O};static viewOf(t,e,n){const i=t.track;if(i.length<2)return;const r=i[0],o=i[i.length-1],a=t.seen,s=m=>b.seenFrom(n,{lat:m.lat,lng:m.lng,heightM:m.altitudeKm*1e3}),d=a?.fromAzimuthDeg!==void 0&&a.fromAltitudeDeg!==void 0?{azimuthDeg:a.fromAzimuthDeg,altitudeDeg:a.fromAltitudeDeg}:s(r),c=a?.toAzimuthDeg!==void 0&&a.toAltitudeDeg!==void 0?{azimuthDeg:a.toAzimuthDeg,altitudeDeg:a.toAltitudeDeg}:s(o),l=a?.durationS??(o.t-r.t)/1e3,h=Math.min(...t.fragments.flatMap(m=>[m.absoluteMagnitude,...(m.lightCurve??[]).map(f=>f.absoluteMagnitude)]));return{startMs:e.getTime()+r.t,durationS:l,from:{azimuthDeg:d.azimuthDeg,altitudeDeg:d.altitudeDeg},to:{azimuthDeg:c.azimuthDeg,altitudeDeg:c.altitudeDeg},peakAbsoluteMagnitude:h}}static azimuthOff(t,e){const n=Math.abs(((t-e)%360+360)%360);return Math.min(n,360-n)}static elevationOff(t,e){const n=Math.max(0,t*u.ELEVATION_LOW_FACTOR)-u.ELEVATION_SLACK_DEG,i=t+u.ELEVATION_SLACK_DEG;return e<n?n-e:e>i?e-i:0}static matchFireball(t,e,n){const i=e.t<t.startMs?t.startMs-e.t:0,r=e.t>t.startMs?e.t-t.startMs:0;if(Math.max(i,r)>u.TIME_MARGIN_MIN*6e4)return;const o=b.seenFrom(n,{lat:e.from[0],lng:e.from[1],heightM:e.from[2]*1e3}),a=b.seenFrom(n,{lat:e.to[0],lng:e.to[1],heightM:e.to[2]*1e3});if(o.altitudeDeg<0&&a.altitudeDeg<0)return;const s=Math.max(u.azimuthOff(t.from.azimuthDeg,o.azimuthDeg),u.azimuthOff(t.to.azimuthDeg,a.azimuthDeg));if(s>u.HEADING_MARGIN_DEG||Math.max(u.elevationOff(t.from.altitudeDeg,o.altitudeDeg),u.elevationOff(t.to.altitudeDeg,a.altitudeDeg))>0)return;const c=u.DURATION_FACTOR;if(!(e.durationS>0&&(t.durationS<e.durationS/c||t.durationS>e.durationS*c)))return{record:e,offsetMinutes:Math.round((i+r)/6e4),headingOffDeg:Math.round(s),altitudeOffDeg:Math.round(Math.abs(a.altitudeDeg-t.to.altitudeDeg))}}static async check(t,e,n,i=u.shared){if(!e||!n)return[{verdict:"unchecked",source:"none",reason:"noDateOrPlace"}];const r=u.viewOf(t,e,n);if(!r)return[{verdict:"unchecked",source:"none",reason:"noDateOrPlace"}];const o=M.of(t.type)?.nature,a=[];if(o!=="artificial"&&a.push(...await u.checkFireballs(r,n,o==="natural",i)),o!=="artificial"){const s=u.showerOf(r,n);s&&(s.verdict==="compatible"||o==="natural")&&a.push(s)}return o!=="natural"&&a.push(...await u.checkCatalogue(t,r,n,o==="artificial",i)),o===void 0&&!a.some(s=>s.verdict==="known"||s.verdict==="possible"||s.verdict==="compatible")?[...a.filter(s=>s.verdict==="unchecked"),{verdict:"uninformative",source:"none",reason:"typeUnknown"}]:a}static vectorOf(t,e){const n=Math.PI/180,i=e*n,r=t*n;return[Math.cos(i)*Math.sin(r),Math.cos(i)*Math.cos(r),Math.sin(i)]}static angleDeg(t,e){return Math.acos(Math.max(-1,Math.min(1,t[0]*e[0]+t[1]*e[1]+t[2]*e[2])))*180/Math.PI}static showerOf(t,e){const n=u.vectorOf(t.from.azimuthDeg,t.from.altitudeDeg),i=u.vectorOf(t.to.azimuthDeg,t.to.altitudeDeg),r=u.angleDeg(n,i);if(r<1)return;const o=[n[1]*i[2]-n[2]*i[1],n[2]*i[0]-n[0]*i[2],n[0]*i[1]-n[1]*i[0]],a=Math.hypot(o[0],o[1],o[2]),s=new Date(t.startMs),d=C.activeAt(s);let c;for(const{shower:l,zhr:h}of d){const m=C.radiantPosition(l,s,{lat:e.lat,lng:e.lng,elevationM:e.heightM});if(m.altitudeDeg<u.RADIANT_BELOW_DEG)continue;const f=u.vectorOf(m.azimuthDeg,m.altitudeDeg),p=Math.asin(Math.min(1,Math.abs((f[0]*o[0]+f[1]*o[1]+f[2]*o[2])/a)))*180/Math.PI,y=u.angleDeg(f,n),A=u.angleDeg(f,i);y>=A||A<=r||p<=u.SHOWER_MARGIN_DEG&&(!c||p<c.offDeg)&&(c={showerId:l.id,offDeg:Math.round(p),zhr:Math.round(h)})}return c?{verdict:"compatible",source:"showers",...c}:{verdict:"sporadic",source:"showers",active:d.length}}static async checkFireballs(t,e,n,i){const r=u.TIME_MARGIN_MIN*6e4;if(!E.mayCover(t.startMs))return n?[{verdict:"uninformative",source:"gmn",reason:"beforeArchive"}]:[];const o=await i.fireballs.between(t.startMs-r,t.startMs+r+t.durationS*1e3);if(o===void 0)return n?[{verdict:"unchecked",source:"gmn",reason:"unreachable"}]:[];const a=o.map(m=>u.matchFireball(t,m,e)).filter(m=>m!==void 0).sort((m,f)=>m.offsetMinutes-f.offsetMinutes||m.headingOffDeg-f.headingOffDeg);if(a.length>0)return[{verdict:"known",source:"gmn",match:a[0]}];if(!n)return[];if(t.peakAbsoluteMagnitude>u.ARCHIVED_MAGNITUDE)return[{verdict:"uninformative",source:"gmn",reason:"faint"}];if(_("Sun",new Date(t.startMs),{lat:e.lat,lng:e.lng,elevationM:0}).altitudeDeg>u.NIGHT_SUN_DEG)return[{verdict:"uninformative",source:"gmn",reason:"daylight"}];const s=new Date(t.startMs),d=Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),1),c=Date.UTC(s.getUTCFullYear(),s.getUTCMonth()+1,1)-1,h=(await i.fireballs.between(d,c)??[]).filter(m=>O.distanceKm(e.lat,e.lng,m.from[0],m.from[1])<=u.WATCHED_KM).length;return h<u.WATCHED_COUNT?[{verdict:"uninformative",source:"gmn",reason:"unwatched"}]:[{verdict:"expectedAbsent",source:"gmn",absoluteMagnitude:t.peakAbsoluteMagnitude,watchedCount:h}]}static async checkCatalogue(t,e,n,i,r){if(e.startMs<u.FIRST_ORBIT_MS)return i?[{verdict:"impossible",source:"catalogue"}]:[];const o=u.TIME_MARGIN_MIN*6e4,a=await r.reentries.candidates(e.startMs-o,e.startMs+o+e.durationS*1e3,n);if(a===void 0)return i?[{verdict:"unchecked",source:"catalogue",reason:"unreachable"}]:[];const s=t.object,d=s&&a.find(l=>s.cosparId&&l.record.cosparId===s.cosparId||s.norad!==void 0&&l.record.norad===s.norad);if(d)return[{verdict:"known",source:"catalogue",candidate:d,by:"object"}];const c=a.find(l=>l.record.precision==="minute"&&l.seenKm!==void 0&&(l.offsetMinutes??0)<=u.TIME_MARGIN_MIN);return c?[{verdict:"known",source:"catalogue",candidate:c,by:"seen"}]:a.length>0?a.slice(0,3).map(l=>({verdict:"possible",source:"catalogue",candidate:l})):i?[{verdict:"expectedAbsent",source:"catalogue"}]:[]}}class T{constructor(t,e,n){this.container=t,this.host=e,N.attach(t,"reentry-editor-part",T.STYLE),this.language=n,this.ready=this.setLanguage(n)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;timeline;placeForm;placeIndex=0;row="path";fragmentForm;fragmentIndex=0;curveForm;curveIndex=0;language;shown=[];static STYLE='.reentry-editor-part { flex-basis: 100%; min-width: 0; } .reentry-editor-part #reentry-timeline { flex-basis: 100%; min-width: 0; padding: 4px 0; } .reentry-editor-part #reentry-path > .icon-btn, .reentry-editor-part #reentry-curve > .icon-btn { align-self: flex-end; } .reentry-editor-part #reentry-list, .reentry-editor-part #reentry-places, .reentry-editor-part #reentry-fragment-list, .reentry-editor-part #reentry-curve-list { flex-basis: 100%; min-width: 0; } .reentry-editor-part .launch-editor, .reentry-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .reentry-editor-part .launch-fields { flex-basis: 100%; min-width: 0; } .reentry-editor-part [hidden] { display: none !important; } .reentry-editor-part .reentry-evidence { flex-basis: 100%; } .reentry-editor-part .evidence-known, .reentry-editor-part .evidence-impossible, .reentry-editor-part .evidence-expectedAbsent { font-weight: 600; } .reentry-editor-part select { min-width: 0; width: 100%; } .reentry-editor-part .launch-intro { flex-basis: 100%; margin: 0; } .reentry-editor-part .launch-track { flex-basis: 100%; margin: 0; } .reentry-editor-part .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .reentry-editor-part .parameter-group { flex: 1 1 14em; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; align-content: flex-start; } .reentry-editor-part input, .reentry-editor-part select { max-width: 100%; box-sizing: border-box; } .reentry-editor-part input[type="text"] { width: 12em; } .reentry-editor-part input[data-key="title"] { width: 18em; } .reentry-editor-part label { min-width: 0; max-width: 100%; } .reentry-editor-part input.parameter-derived::placeholder { opacity: .65; } .reentry-editor-part .launch-path { flex: 1 1 100%; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; }';async setLanguage(t){const e=++this.languageToken;this.language=t;const[n,i,,r]=await Promise.all([$.load(t),z.load(t),M.load(t),F(t).catch(()=>{})]);e===this.languageToken&&(this.sceneNames=r,this.messages=n,this.parameterTexts=i,this.render(),this.sync())}sync(){if(!this.messages)return;const t=this.reentries;this.shown=[...t],t.some(n=>n.id===this.currentId)||(this.currentId=t[0]?.id),this.list?.setItems(t.map(n=>({id:n.id,label:this.labelOf(n)})),this.currentId),this.list?.setKinds(M.all().map(n=>({value:n.key,label:M.nameOf(n.key)}))),this.syncAddState();const e=this.current;this.element("reentry-fields").hidden=e===void 0,e&&(this.syncPlace(!0),this.syncFragments(e,!0),this.syncEvidence(),this.form??=new D(this.element("reentry-parameters"),this.language,"reentry.",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(this.resolved(g.SET),new k(()=>this.current,n=>this.editReentry(i=>{i.object&&(i.object={...i.object}),i.seen&&(i.seen={...i.seen}),n(i),i.object&&Object.values(i.object).every(a=>a===void 0||a==="")&&delete i.object;const r=this.origin(),o=r&&g.trackFromSeen(i,r);o&&(i.track=o)})),()=>this.written()))}refresh(){if(!this.messages)return;this.syncAddState();const t=this.reentries;if(t.length===this.shown.length&&t.every((e,n)=>e.id===this.shown[n].id)){this.syncTimeline();return}this.sync()}setTime(t){this.messages&&this.timeline?.setTime(t)}syncAddState(){const t=this.origin()!==void 0;this.list?.setAddState(t,t?void 0:this.messages.addNowhere)}get current(){return this.reentries.find(t=>t.id===this.currentId)}show(t){this.messages&&(this.currentId=t,this.row="path",this.placeIndex=0,this.fragmentIndex=0,this.curveIndex=0,this.sync())}resolved(t){return S.resolve(t,this.parameterTexts)}render(){if(!this.messages)return;const t=this.messages;this.form=void 0,this.evidenceFor=void 0,this.container.innerHTML=`<div class="launch-editor">
|
|
2
2
|
<p class="launch-intro">${t.intro}</p>
|
|
3
3
|
<div id="reentry-list"></div>
|
|
4
4
|
<div id="reentry-fields" class="launch-fields">
|
package/dist-embed-ufoathome/{ReentrySimulation-CSO1vgro.js → ReentrySimulation-CTeCaxZl.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bh as S,bi as f,bb as R,bc as b,bj as G,bk as _,bl as F,q as N}from"./ShareDialogElement-
|
|
1
|
+
import{bh as S,bi as f,bb as R,bc as b,bj as G,bk as _,bl as F,q as N}from"./ShareDialogElement-EzLob2Tz.js";import{I as y,J as H,w as M,x as w,M as C,V as j,C as k}from"./three.module-CbaHqYFq.js";import"./rr0-ufoathome.mjs";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";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 y;tiers;trains;positions;colors;shown=0;drawn=[];constructor(){this.object.name="reentries",this.tiers=S.map(i=>{const o=new H(new M,f.material(i.size,!1));return f.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 M;t.setAttribute("position",new w(this.positions,3)),t.setAttribute("color",new w(this.colors,3)),t.setDrawRange(0,0),this.trains=new C(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}=b(s.altitudeDeg,s.azimuthDeg,1);return new j(t,i,o)}get count(){return this.shown}set(s,t,i,o){const e=this.tiers.map(()=>[]);let n=0,m=0;const a=new k;this.drawn=[];for(const r of s){const u=i(r.head);if(u<=0)continue;const c=r.magnitude-2.5*Math.log10(u);if(c>t)continue;m++,this.drawn.push({direction:h.directionOf(r.head),view:r,magnitude:c}),a.set(r.color);const d=G(c,t)*r.fade,{x:A,y:E,z:g}=b(r.head.altitudeDeg,r.head.azimuthDeg,h.RADIUS),[p,I,T]=o(r.head,c),z=r.fade,D=Math.max(a.r,a.g,a.b)||1;e[_(d)].push({x:A,y:E,z:g,r:p*a.r*z/D,g:I*a.g*z/D,b:T*a.b*z/D}),n=this.pushTrain(n,r.train,d,a)}this.shown=m,this.tiers.forEach((r,u)=>{const c=e[u],d=new Float32Array(c.length*3),A=new Float32Array(c.length*3);c.forEach((g,p)=>{d.set([g.x,g.y,g.z],p*3),A.set([g.r,g.g,g.b],p*3)}),r.geometry.dispose();const E=new M;E.setAttribute("position",new w(d,3)),E.setAttribute("color",new w(A,3)),r.geometry=E});const l=this.trains.geometry;l.setDrawRange(0,n),l.getAttribute("position").needsUpdate=!0,l.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 m=1-n/e,a=1-(n+1)/e,l=b(t[n].altitudeDeg,t[n].azimuthDeg,h.RADIUS),r=b(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,l,r,u(m),u(a),c(m),c(a),o)}return s}pushRibbon(s,t,i,o,e,n,m,a){const l={x:i.x-t.x,y:i.y-t.y,z:i.z-t.z};if(Math.hypot(l.x,l.y,l.z)<1e-9)return s;const r=this.normalise(this.cross(this.normalise(t),this.normalise(l)));for(const[u,c]of[[-1,0],[0,1]]){const d=this.across(t,r,o,u),A=this.across(i,r,e,u),E=this.across(t,r,o,c),g=this.across(i,r,e,c),p=(I,T)=>I===0?T:0;s=this.push(s,d,p(u,n),a),s=this.push(s,A,p(u,m),a),s=this.push(s,E,p(c,n),a),s=this.push(s,A,p(u,m),a),s=this.push(s,g,p(c,m),a),s=this.push(s,E,p(c,n),a)}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=F.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 K{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?[]:N.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{K as ReentrySimulation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Q as w,aO as M,z as g,L as c,aP as y,M as k,K as O,B as T,a as b,P as E,ac as I}from"./three.module-CbaHqYFq.js";import{R as d}from"./ReferenceTimeline-2kBldQeG.js";import{g as D}from"./GeoProjection-DvqDbRIx.js";import{P as m,a as f}from"./PictureFetch-C3wgf1ZV.js";import{b3 as x}from"./ShareDialogElement-
|
|
1
|
+
import{Q as w,aO as M,z as g,L as c,aP as y,M as k,K as O,B as T,a as b,P as E,ac as I}from"./three.module-CbaHqYFq.js";import{R as d}from"./ReferenceTimeline-2kBldQeG.js";import{g as D}from"./GeoProjection-DvqDbRIx.js";import{P as m,a as f}from"./PictureFetch-C3wgf1ZV.js";import{b3 as x}from"./ShareDialogElement-EzLob2Tz.js";import"./rr0-ufoathome.mjs";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./SaidPosition-OJEYhVKN.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";const v=x.reference,u=800,l=Math.PI/180;class r{constructor(t,i,s=r.fetchImage,e=r.openVideo){this.scene=t,this.onImageLoaded=i,this.loadImage=s,this.loadVideo=e}meshes=new Map;signatures=new Map;images=new Map;loading=new Map;failed=new Map;references=[];views=new Map;shown=!0;observerAt;clock={t:0,playing:!1,timeScale:1};static PRESENT_WITHIN_M=2;static GONE_BEYOND_M=20;static presenceAt(t,i){if(!t.from||!i)return 1;const s=D(i.lat,i.lng,t.from.lat,t.from.lng),a=(Math.hypot(s.x,s.z)-r.PRESENT_WITHIN_M)/(r.GONE_BEYOND_M-r.PRESENT_WITHIN_M),o=Math.min(Math.max(a,0),1);return 1-o*o*(3-2*o)}set(t,i=this.views,s){this.references=t,this.observerAt=s,this.views=i;const e=new Set(t.map(a=>a.id));for(const[a,o]of this.meshes)e.has(a)||(this.dispose(o),this.meshes.delete(a),this.signatures.delete(a));for(const[a,o]of this.images){const n=t.find(p=>p.id===a);if(n&&n.src===o.texture.userData.src&&n.kind==="video"==(o.video!==void 0))continue;r.release(o),this.images.delete(a);const h=this.meshes.get(a);h&&(this.dispose(h),this.meshes.delete(a),this.signatures.delete(a))}for(const a of t){const o=this.images.get(a.id);if(!o){this.load(a);continue}this.build(a,o)}this.follow()}setTime(t){this.clock=t,this.follow()}setShown(t){this.shown=t;for(const i of this.meshes.values())i.visible=t&&this.opacityOf(i.userData.id)>0}setView(t,i){this.views.set(t,i);const s=this.meshes.get(t);s&&this.applyOpacity(s,t)}layer=v;get any(){for(const t of this.meshes.values())if(t.visible)return!0;return!1}place(t){const i=this.held;i&&t.getWorldQuaternion(this.cameraTurn);for(const s of this.meshes.values()){if(!s.visible)continue;s.position.copy(t.position);const e=i?.get(s);e&&s.quaternion.copy(this.cameraTurn).multiply(e),s.updateMatrixWorld()}}hold(t){t.getWorldQuaternion(this.cameraTurn);const i=this.cameraTurn.clone().invert();this.held=new Map([...this.meshes.values()].map(s=>[s,i.clone().multiply(s.quaternion)])),this.registered=new Map([...this.meshes.values()].map(s=>[s,s.quaternion.clone()]))}release(){if(this.held){for(const[t,i]of this.registered??[])t.quaternion.copy(i);this.held=void 0,this.registered=void 0}}registered;held;cameraTurn=new w;get furthestM(){return this.meshes.size>0?u:0}directionOfPixel(t,i,s,e){const a=this.images.get(t.id),o=a?a.width/a.height:1,n=d.registrationAt(t,this.clock.t),h=Math.tan(n.fovDeg/2*l),p=h*o;return e.set((i*2-1)*p,(1-s*2)*h,-1).normalize(),e.applyQuaternion(r.orientation(n))}aspectOf(t){const i=this.images.get(t);return i?i.width/i.height:void 0}failureOf(t){return this.failed.get(t)}follow(){for(const t of this.references){const i=this.meshes.get(t.id),s=this.images.get(t.id)?.video;s&&this.sync(t,s),i&&(t.registrationTrack?.length&&r.point(i,t,d.registrationAt(t,this.clock.t)),t.kind==="video"&&this.applyOpacity(i,t.id))}}sync(t,i){const s=d.mediaSecondsAt(t,this.clock.t,this.clock.timeScale,Number.isFinite(i.duration)?i.duration:void 0);if(s===void 0){i.paused||i.pause();return}const e=d.command(i.currentTime,s,this.clock.playing,d.rateOf(t));i.playbackRate=e.rate,e.seekS!==void 0&&!i.seeking&&(i.currentTime=e.seekS),e.play&&i.paused&&i.play().catch(()=>{}),!e.play&&!i.paused&&i.pause()}load(t){const i=t.src;if(this.loading.has(t.id)||this.failed.has(i))return;const s=t.kind==="video",a=(s?this.loadVideo(i,()=>this.onVideoFrame()):this.loadImage(i)).then(o=>{this.loading.delete(t.id);const n=this.references.find(h=>h.id===t.id);if(!n||n.src!==i||n.kind==="video"!==s){r.release(o);return}o.texture.userData.src=i,this.images.set(t.id,o),this.build(n,o),this.follow(),this.onImageLoaded()},o=>{this.loading.delete(t.id),this.failed.set(i,m.failureOf(o)),this.onImageLoaded()});this.loading.set(t.id,a)}onVideoFrame(){this.follow(),this.onFrame?.()}onFrame;static openVideo(t,i){return new Promise((s,e)=>{const a=document.createElement("video");a.crossOrigin="anonymous",a.muted=!0,a.playsInline=!0,a.preload="auto",a.addEventListener("loadeddata",()=>{const o=new M(a);o.colorSpace=g,o.minFilter=c,o.magFilter=c,o.generateMipmaps=!1,a.addEventListener("seeked",i);const n=()=>{a.paused&&i(),a.src&&a.requestVideoFrameCallback(n)};"requestVideoFrameCallback"in a&&a.requestVideoFrameCallback(n),s({texture:o,width:a.videoWidth,height:a.videoHeight,video:a})},{once:!0}),a.addEventListener("error",()=>{m.whyVideoUnread(t).then(o=>e(new f(t,o)))},{once:!0}),a.src=t})}static release(t){t.texture.dispose();const i=t.video;i&&(i.pause(),i.removeAttribute?.("src"),i.load?.())}static async fetchImage(t){const i=await m.blob(t),s=await createImageBitmap(i,{imageOrientation:"flipY"}).catch(()=>{throw new f(t,{kind:"notPicture"})}),e=new y(s);return e.flipY=!1,e.colorSpace=g,e.minFilter=c,e.magFilter=c,e.generateMipmaps=!1,e.needsUpdate=!0,{texture:e,width:s.width,height:s.height}}build(t,i){const s=r.signatureOf(t,i);let e=this.meshes.get(t.id);if(e&&this.signatures.get(t.id)===s){this.applyOpacity(e,t.id);return}e&&(this.dispose(e),this.meshes.delete(t.id)),e=new k(r.geometryOf(t,i),new O({map:i.texture,transparent:!0,depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1})),t.kind==="panorama"&&(e.material.side=T),e.frustumCulled=!1,e.layers.set(v),e.userData.id=t.id,r.point(e,t,d.registrationAt(t,this.clock.t)),this.scene.add(e),this.meshes.set(t.id,e),this.signatures.set(t.id,s),this.applyOpacity(e,t.id)}static geometryOf(t,i){if(t.kind==="panorama"){const o=new b(u,64,32,Math.PI/2,Math.PI*2),n=o.attributes.uv;for(let h=0;h<n.count;h++)n.setX(h,1-n.getX(h));return n.needsUpdate=!0,o}const s=2*u*Math.tan(t.registration.fovDeg/2*l),e=s*(i.width/Math.max(i.height,1)),a=new E(e,s);return a.translate(0,0,-u),a}static orientation({headingDeg:t,pitchDeg:i,rollDeg:s}){const e=new I;return e.rotation.set(i*l,-t*l,-(s??0)*l,"YXZ"),e.quaternion}static point(t,i,s){if(t.quaternion.copy(r.orientation(s)),i.kind==="panorama")return;const e=Math.tan(s.fovDeg/2*l)/Math.tan(i.registration.fovDeg/2*l);t.scale.set(e,e,1)}inTime(t){if(t.kind!=="video")return!0;const i=this.images.get(t.id)?.video?.duration;return d.mediaSecondsAt(t,this.clock.t,this.clock.timeScale,i!==void 0&&Number.isFinite(i)?i:void 0)!==void 0}opacityOf(t){const i=this.references.find(a=>a.id===t);if(i&&!this.inTime(i))return 0;const s=this.views.get(t),e=i?r.presenceAt(i,this.observerAt):1;return(s?.opacity??i?.opacity??0)*e}applyOpacity(t,i){const s=this.opacityOf(i);t.material.opacity=s,t.visible=this.shown&&s>0}static signatureOf(t,i){const{headingDeg:s,pitchDeg:e,rollDeg:a,fovDeg:o}=t.registration;return[t.kind,t.src,i.width,i.height,s,e,a??0,o].join("|")}dispose(t){this.scene.remove(t),t.geometry.dispose(),t.material.dispose()}disposeAll(){for(const t of this.meshes.values())this.dispose(t);this.meshes.clear(),this.signatures.clear();for(const t of this.images.values())r.release(t);this.images.clear()}}export{v as REFERENCE_LAYER,r as ReferenceSystem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as y,p as k,W as h}from"./rr0-ufoathome.mjs";import{ScenarioSweep as j}from"./ScenarioSweep-
|
|
1
|
+
import{P as y,p as k,W as h}from"./rr0-ufoathome.mjs";import{ScenarioSweep as j}from"./ScenarioSweep-BbtX26Fi.js";import"./ShareDialogElement-EzLob2Tz.js";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./CaseEditorElement-HR8RFluQ.js";import"./ParameterForm-XbqxCLRn.js";import"./ColumnResize-CEXrq3KB.js";import"./InterviewAttachments-BP6Prvdu.js";import"./TimelineTracks-Daaqw9ly.js";import"./ReentryArchive-CeXHrU7L.js";import"./ReferenceTimeline-2kBldQeG.js";import"./upperAirSources-BU0pD84c.js";import"./Account-C4jhsVtN.js";import"./SatellitePasses-Pfro2-0Z.js";class b{static fileName(c,n){const t=c.replace(/\.json$/,""),d=n.placeId.replace(/[^A-Za-z0-9-]+/g,"-"),p=n.local.replace(/[-:]/g,"").replace("T","-");return`${t}-scenario-${d}-${p}.json`}static recording(c,n,t,d,p,i={}){const a=structuredClone(c),r=y.strip(c).recording,l=a.interpretation;if(!l||!r.interpretation)throw new Error(`${n} states no interpretation`);a.id=`${r.id??n.replace(/\.json$/,"")}-scenario-${t.id}`,t.ownPlace||(a.place={value:{...t.placeName?{name:t.placeName}:{},locations:[{lat:t.lat,lng:t.lng}]},basis:"assumed",rationale:`one of the candidate places of the case, played as scenario ${t.id}${i.placeRationale?`: ${i.placeRationale}`:""}`},delete a.snapshots);const e=r.time?r.time.replace(/[~?%]$/,"").slice(0,16):void 0;return t.local!==e&&(a.time={value:`${t.local}:00`,basis:"assumed",rationale:`one of the candidate instants of the case, played as scenario ${t.id}${i.timeRationale?`: ${i.timeRationale}`:""}`}),delete a.image,d&&b.rewind(l,r.interpretation,d,t,p),l.scenario={id:t.id,of:n,...i.verdict?{verdict:i.verdict}:{}},i.title!==void 0&&(l.title=i.title),a}static rewind(c,n,t,d,p){const i={at:e=>h.at(t,e),levels:t.levels.map(e=>e.aboveGroundM)},a=e=>`${e} archived at ${t.hour} UTC at this place (${t.credit}, grid point ${t.lat.toFixed(3)}, ${t.lng.toFixed(3)}): established given scenario ${d.id} only`;for(const e of p){const f=k.itemsOf(n,e.key);if(!e.inWind||f.length===0)continue;const u=c[e.key];f.forEach((m,v)=>{const s=e.inWind(m,i);for(const o of Object.keys(s))JSON.stringify(s[o])!==JSON.stringify(m[o])&&(u[v][o]=o==="wind"?{value:s[o],basis:"established",rationale:a("the wind at the ground")}:s[o])})}const r=h.at(t,10),l=c.bodies;n.bodies.forEach((e,f)=>{if(!e.drifting)return;const u=j.drifted(e,r),m=l[f].track;!m||!u.track||u.track.forEach((v,s)=>{for(const o of["eastM","northM"]){const w=v[o];if(w===void 0)continue;const g=Math.round(w*100)/100,$=m[s][o];m[s][o]=typeof $=="object"&&$!==null&&"value"in $?{...$,value:g,...s===0?{rationale:a(`drifting with the wind at the ground, ${h.rounded(r).speedMS} m/s towards ${h.rounded(r).towardDeg}°,`)}:{}}:g}})})}}export{b as ScenarioReadings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as R,P as k,p as A,W as N}from"./rr0-ufoathome.mjs";import{W as P,aR as O,a7 as K,ab as T}from"./ShareDialogElement-Dlfy9NCE.js";import{S as y,C as $}from"./CaseEditorElement-0J_TCeiq.js";import{SatellitePasses as S}from"./SatellitePasses-Pfro2-0Z.js";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./ParameterForm-XbqxCLRn.js";import"./ColumnResize-DV-byvDt.js";import"./InterviewAttachments-BP6Prvdu.js";import"./TimelineTracks-Daaqw9ly.js";import"./ReentryArchive-CeXHrU7L.js";import"./ReferenceTimeline-2kBldQeG.js";import"./upperAirSources-BU0pD84c.js";import"./Account-C4jhsVtN.js";class f{static MAX_SCENARIOS=200;static KM_PER_DEG=111.32;static merged(t,s){return t?s?{...t,...s}:t:s}static scenarios(t,s){const e=f.places(t,s?.places),a=f.instants(t,s?.time),n=[];for(const r of e)for(const i of a){const d=r.placeId==="own"&&i===f.minute(t.local);n.push({id:`${r.placeId}@${i}`,placeId:r.placeId,...r.placeName?{placeName:r.placeName}:{},lat:r.lat,lng:r.lng,local:i,date:f.utc(i,t.utcOffsetHours),own:d,ownPlace:r.placeId==="own"})}if(n.length>f.MAX_SCENARIOS)throw new Error(`${n.length} scenarios for one account: more than ${f.MAX_SCENARIOS}. Take a coarser step or fewer points.`);return n.sort((r,i)=>Number(i.own)-Number(r.own))}static places(t,s){const e={placeId:"own",...t.placeName?{placeName:t.placeName}:{},lat:t.lat,lng:t.lng},a=s?.own===!1?[]:[e],n=(s?.candidates??[]).filter(r=>!r.for||t.eventId===void 0||r.for.includes(t.eventId)).flatMap(r=>{const i=r.place.locations?.[0];return i?[{placeId:r.id,...r.place.name?{placeName:r.place.name}:{},lat:i.lat,lng:i.lng}]:[]});switch(s?.sweep??"bounds"){case"bounds":return[...a,...n];case"points":{const r=new Set(s?.points??[]);return[...a,...n.filter(i=>r.has(i.placeId))]}case"deltas":return[...a,...(s?.deltasKm??[]).filter(r=>r.eastKm!==0||r.northKm!==0).map(r=>({placeId:`own${r.eastKm>=0?"+":""}${r.eastKm},${r.northKm>=0?"+":""}${r.northKm}km`,...t.placeName?{placeName:t.placeName}:{},lat:t.lat+r.northKm/f.KM_PER_DEG,lng:t.lng+r.eastKm/(f.KM_PER_DEG*Math.cos(t.lat*Math.PI/180))}))];case"step":{const r=s?.stepKm;if(!r||r<=0)throw new Error("A sweep of places by step states its stepKm.");const i=[e,...n],d=Math.min(...i.map(u=>u.lat)),o=Math.max(...i.map(u=>u.lat)),l=Math.min(...i.map(u=>u.lng)),c=Math.max(...i.map(u=>u.lng)),h=f.KM_PER_DEG*Math.cos((d+o)/2*Math.PI/180),m=[];for(let u=0;d+u*r/f.KM_PER_DEG<=o+1e-9;u++)for(let p=0;l+p*r/h<=c+1e-9;p++){const g=d+u*r/f.KM_PER_DEG,v=l+p*r/h;m.push({placeId:`grid${g.toFixed(3)},${v.toFixed(3)}`,lat:g,lng:v})}return[...a,...m]}}}static instants(t,s){const e=f.minute(t.local);if(!s)return[e];const a=f.ms(e),n=f.ms(s.from),r=f.ms(s.to),i=s.each??"day",d=864e5,o=c=>{const h=[];if(i==="day"){const m=a+Math.ceil((n-a)/d)*d;for(let u=m;u<=r;u+=c)h.push(u)}else for(let m=n;m<=r;m+=c)h.push(m);return h};let l;switch(s.sweep??"bounds"){case"bounds":{const c=o(i==="day"?d:6e4);l=c.length>0?[c[0],c[c.length-1]]:[];break}case"points":l=(s.points??[]).map(c=>/T/.test(c)?f.ms(c):f.ms(`${c}T${e.slice(11)}`));break;case"step":l=o((s.stepMinutes??(i==="day"?1440:60))*6e4);break;case"deltas":l=[a,...(s.deltasMinutes??[]).map(c=>a+c*6e4)];break}return[...new Set(l)].sort((c,h)=>c-h).map(c=>new Date(c).toISOString().slice(0,16))}static ms(t){const s=t.replace(/[~?%]$/,"").replace(/(Z|[+-]\d\d:\d\d)$/,""),e=s.length===10?`${s}T00:00`:s,a=Date.parse(`${e}Z`);if(Number.isNaN(a))throw new Error(`Not an instant: ${t}`);return a}static minute(t){return new Date(f.ms(t)).toISOString().slice(0,16)}static utc(t,s){return new Date(f.ms(t)-s*36e5)}}class b{constructor(t){this.sources=t,this.model=t.model??P.MODELS[0]}static PLAUSIBLE=O.MEASURABLE;static DRAWN_STEP_MS=500;static STARS=6;static STAR_MAG=1.5;model;async sweep(t,s={}){const e=(t.events??[]).filter(o=>o.eventType===R.SIGHTING_EVENT&&!o.interpretationOf&&o.url).filter(o=>!s.accounts||o.id!==void 0&&s.accounts.includes(o.id)),a=[],n=await Promise.all(e.map(async o=>{const l=await this.sources.load(o.url),c=s.conditions??f.merged(t.conditions,k.strip(l).recording.conditions),h=f.scenarios(b.conditionsOf(l,o.id),c),m=[o.id,k.strip(l).recording.id].filter(p=>!!p),u=R.interpretationEvents(t,m).filter(p=>p.url&&(!s.readings||s.readings.includes(p.url)));return{event:o,accountJson:l,conditions:c,scenarios:h,readings:u}})),r=n.reduce((o,l)=>o+l.scenarios.length*(l.readings.length+(s.sky===!1?0:1)),0);let i=0;const d=()=>s.progress?.(++i,r);for(const{event:o,accountJson:l,conditions:c,scenarios:h,readings:m}of n){const u={...o.id?{eventId:o.id}:{},url:o.url,title:o.title,scenarios:h,readings:[],sky:[]},p=b.judges(l);for(const g of m){const v=await this.sources.load(g.url),w=k.strip(v).recording.interpretation;if(!w||w.scenario){h.forEach(d);continue}const M=await this.replay(g.url,g.title,w,h,p,d);M.kept=b.kept(M,s.keep??c?.keep??"telling"),u.readings.push(M)}if(s.sky!==!1){const g=await this.sky(l,h,d);u.sky=g.replays,g.note&&(u.skyNote=g.note)}a.push(u)}return{accounts:a,alerts:b.alerts(a)}}static conditionsOf(t,s){const e=k.strip(t).recording,a=e.place?.locations?.[0];if(!e.time||!a)throw new Error(`An account with no time or no place cannot be played elsewhere: ${e.id??s}`);return{...s?{eventId:s}:{},local:e.time,utcOffsetHours:e.utcOffsetHours??Math.round(a.lng/15),lat:a.lat,lng:a.lng,...e.place?.name?{placeName:e.place.name}:{}}}static judges(t){const s=O.forAccount(t),e=K(t),a=k.strip(t).recording.timeline?.keyframes??[],n=Math.max(0,...a.map(d=>d.t)),r=Array.from({length:Math.floor(n/b.DRAWN_STEP_MS)+1},(d,o)=>o*b.DRAWN_STEP_MS),i=T.lawsOf(P.MODELS[0],e.account?.conditions);return{said:s,drawn:new O(e,r,i)}}dependsOn(t){return this.sources.kinds.some(e=>e.inWind&&A.itemsOf(t,e.key).length>0)||t.bodies.some(e=>e.drifting)?["wind"]:[]}inWind(t,s){const e={at:n=>N.at(s,n),levels:s.levels.map(n=>n.aboveGroundM)},a={...t};for(const n of this.sources.kinds){const r=A.itemsOf(t,n.key);!n.inWind||r.length===0||(a[n.key]=r.map(i=>n.inWind(i,e)))}return a.bodies=t.bodies.map(n=>n.drifting?b.drifted(n,N.at(s,10)):n),a}static drifted(t,s){const e=t.track;if(!e||e.length<2)return t;const a=e[0],n=e[e.length-1],r=(n.t-a.t)/1e3;if(r<=0||a.eastM===void 0||n.eastM===void 0||a.northM===void 0||n.northM===void 0)return t;const[i,d]=N.vector(s),o=i-(n.eastM-a.eastM)/r,l=d-(n.northM-a.northM)/r;return{...t,track:e.map(c=>c.eastM===void 0||c.northM===void 0?c:{...c,eastM:c.eastM+o*(c.t-a.t)/1e3,northM:c.northM+l*(c.t-a.t)/1e3})}}async bodiesOf(t){return await A.load(t,this.sources.kinds),A.expand(t,this.sources.kinds).bodies}async replay(t,s,e,a,n,r){const i=this.dependsOn(e),d=m=>{const u=b.summary(n.said.comparisons(m)),p=b.summary(n.drawn.comparisons(m));return{said:u,drawn:p,plausible:b.plausible(u,p)}},o=d(await this.bodiesOf(e)),l=[];for(const m of a){if(r(),i.length===0){l.push({scenario:m,...o});continue}try{const u=await this.sources.wind.profile(m.lat,m.lng,m.date);l.push({scenario:m,...d(await this.bodiesOf(this.inWind(e,u))),groundWind:N.at(u,10)})}catch(u){l.push({scenario:m,...o,plausible:o.plausible,error:u.message})}}const c=l.filter(m=>!m.error),h=b.verdict(o.plausible?"plausible":"excluded",c.map(m=>({scenario:m.scenario,plausible:m.plausible})));return i.length===0&&(h.independent=!0),{url:t,title:s,depends:i,asWritten:o,outcomes:l,verdict:h,kept:[]}}static plausible(t,s){const e=t.compared>0?t:s;return e.compared>0&&e.agreedDirection/e.compared>=b.PLAUSIBLE}static summary(t){const s=t.filter(e=>e.separationDeg!==void 0).map(e=>e.separationDeg).sort((e,a)=>e-a);return{agreed:t.filter(e=>e.agrees).length,compared:t.length,agreedDirection:t.filter(e=>!e.contradicted?.includes("direction")).length,...s.length?{medianDeg:s[Math.floor(s.length/2)],worstDeg:s[s.length-1]}:{}}}static verdict(t,s){const e=s.filter(n=>n.plausible),a=s.length;return a===0?{robustness:t==="plausible"?"robust-plausible":"robust-exclusion",asWritten:t,holds:0,played:0,independent:!0}:e.length===a?{robustness:"robust-plausible",asWritten:t,holds:a,played:a}:e.length===0?{robustness:"robust-exclusion",asWritten:t,holds:0,played:a}:{robustness:"conditional",asWritten:t,onlyIf:b.onlyIf(s),holds:e.length,played:a}}static onlyIf(t){const s=n=>{const r=new Map;for(const d of t)r.set(n(d.scenario),[...r.get(n(d.scenario))??[],d.plausible]);const i=[...r.entries()];return i.every(([,d])=>d.every(o=>o)||d.every(o=>!o))?i.filter(([,d])=>d[0]).map(([d])=>d):void 0},e=s(n=>n.placeId);if(e&&new Set(t.map(n=>n.scenario.placeId)).size>1)return{places:e};const a=s(n=>n.local.slice(0,10));return a&&new Set(t.map(n=>n.scenario.local.slice(0,10))).size>1?{dates:a}:{scenarios:t.filter(n=>n.plausible).map(n=>n.scenario.id)}}static kept(t,s){if(s==="none"||t.verdict.independent)return[];const e=t.outcomes.filter(o=>!o.error);if(s==="all")return e.map(o=>o.scenario);const a=t.verdict.robustness!=="conditional";if(s==="robust"&&!a||s==="conditional"&&a)return[];const n=o=>{const l=o.said.compared>0?o.said:o.drawn;return(l.compared?l.agreedDirection/l.compared:0)-(l.medianDeg??180)/1e4},r=[...e].sort((o,l)=>n(l)-n(o));if(a){const o=t.verdict.robustness==="robust-plausible"?r[r.length-1]:r[0];return o?[o.scenario]:[]}const i=r.find(o=>o.plausible),d=[...r].reverse().find(o=>!o.plausible);return[i,d].filter(o=>!!o).map(o=>o.scenario)}async sky(t,s,e){const a=K(t),n=y.statement(a);if(!n)return s.forEach(e),{replays:[],note:"no-direction"};const{statement:r,t:i}=n,d=new $(this.model,a.account?.conditions,{dateShiftDays:[],mirror:!1}),o=p=>this.sources.names?.(p)??p,l=s.find(p=>p.own)??s[0],c={date:l.date,observer:{lat:l.lat,lng:l.lng,elevationM:0}},h=new Set(y.stars(c,i,r,this.sources.limitAt,b.STARS,b.STAR_MAG).map(({star:p})=>p.name)),m=new Map;for(const p of s){e();const g={date:p.date,observer:{lat:p.lat,lng:p.lng,elevationM:0}},v=[{track:y.body("Moon",o("Moon"),g,i,this.sources.limitAt),kind:"body"},...y.PLANETS.map(M=>({track:y.body(M,o(M),g,i,this.sources.limitAt),kind:"body"})),...y.stars(g,i,{...r,aim:void 0},this.sources.limitAt,1/0,b.STAR_MAG).filter(({star:M})=>h.has(M.name)).map(({star:M,track:D})=>({track:{...D,label:o(M.name)},kind:"star"}))],w=await this.issTrack(g,i);w&&v.push({track:w,kind:"satellite"});for(const{track:M,kind:D}of v){const I=d.fit(r,M);let E=m.get(M.id);E||(E={candidate:M.id,label:M.label,kind:D,outcomes:[],verdict:void 0},m.set(M.id,E)),E.outcomes.push({scenario:p,verdict:I.verdict,cost:I.cost,...I.reason?{reason:I.reason}:{}})}}const u=[...m.values()];for(const p of u){const g=p.outcomes.find(w=>w.scenario.own),v=g?g.verdict==="incompatible"?"excluded":"plausible":p.outcomes.every(w=>w.verdict==="incompatible")?"excluded":"plausible";p.verdict=b.verdict(v,p.outcomes.map(w=>({scenario:w.scenario,plausible:w.verdict!=="incompatible"})))}return{replays:u}}async issTrack(t,s){if(!this.sources.satellites)return;const a=(await this.sources.satellites(t.date).catch(()=>{}))?.find(r=>r.norad===y.ISS_NORAD);if(!a)return;const n=new S([a]);return y.satellite(`satellite-${a.norad}`,this.sources.names?.("ISS")??"ISS",r=>n.positionsAt(r,t.observer,-90).find(i=>i.object.norad===a.norad),t,s,this.sources.limitAt)}static alerts(t){return t.flatMap(s=>s.sky.filter(e=>e.kind!=="star"||e.verdict.robustness!=="robust-exclusion").map(e=>({...s.eventId?{eventId:s.eventId}:{},candidate:e.candidate,label:e.label,robustness:e.verdict.robustness,...e.verdict.onlyIf?{onlyIf:e.verdict.onlyIf}:{}})))}}export{b as ScenarioSweep};
|
|
1
|
+
import{C as R,P as k,p as A,W as N}from"./rr0-ufoathome.mjs";import{W as P,aR as O,a7 as K,ab as T}from"./ShareDialogElement-EzLob2Tz.js";import{S as y,C as $}from"./CaseEditorElement-HR8RFluQ.js";import{SatellitePasses as S}from"./SatellitePasses-Pfro2-0Z.js";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./ParameterForm-XbqxCLRn.js";import"./ColumnResize-CEXrq3KB.js";import"./InterviewAttachments-BP6Prvdu.js";import"./TimelineTracks-Daaqw9ly.js";import"./ReentryArchive-CeXHrU7L.js";import"./ReferenceTimeline-2kBldQeG.js";import"./upperAirSources-BU0pD84c.js";import"./Account-C4jhsVtN.js";class f{static MAX_SCENARIOS=200;static KM_PER_DEG=111.32;static merged(t,s){return t?s?{...t,...s}:t:s}static scenarios(t,s){const e=f.places(t,s?.places),a=f.instants(t,s?.time),n=[];for(const r of e)for(const i of a){const d=r.placeId==="own"&&i===f.minute(t.local);n.push({id:`${r.placeId}@${i}`,placeId:r.placeId,...r.placeName?{placeName:r.placeName}:{},lat:r.lat,lng:r.lng,local:i,date:f.utc(i,t.utcOffsetHours),own:d,ownPlace:r.placeId==="own"})}if(n.length>f.MAX_SCENARIOS)throw new Error(`${n.length} scenarios for one account: more than ${f.MAX_SCENARIOS}. Take a coarser step or fewer points.`);return n.sort((r,i)=>Number(i.own)-Number(r.own))}static places(t,s){const e={placeId:"own",...t.placeName?{placeName:t.placeName}:{},lat:t.lat,lng:t.lng},a=s?.own===!1?[]:[e],n=(s?.candidates??[]).filter(r=>!r.for||t.eventId===void 0||r.for.includes(t.eventId)).flatMap(r=>{const i=r.place.locations?.[0];return i?[{placeId:r.id,...r.place.name?{placeName:r.place.name}:{},lat:i.lat,lng:i.lng}]:[]});switch(s?.sweep??"bounds"){case"bounds":return[...a,...n];case"points":{const r=new Set(s?.points??[]);return[...a,...n.filter(i=>r.has(i.placeId))]}case"deltas":return[...a,...(s?.deltasKm??[]).filter(r=>r.eastKm!==0||r.northKm!==0).map(r=>({placeId:`own${r.eastKm>=0?"+":""}${r.eastKm},${r.northKm>=0?"+":""}${r.northKm}km`,...t.placeName?{placeName:t.placeName}:{},lat:t.lat+r.northKm/f.KM_PER_DEG,lng:t.lng+r.eastKm/(f.KM_PER_DEG*Math.cos(t.lat*Math.PI/180))}))];case"step":{const r=s?.stepKm;if(!r||r<=0)throw new Error("A sweep of places by step states its stepKm.");const i=[e,...n],d=Math.min(...i.map(u=>u.lat)),o=Math.max(...i.map(u=>u.lat)),l=Math.min(...i.map(u=>u.lng)),c=Math.max(...i.map(u=>u.lng)),h=f.KM_PER_DEG*Math.cos((d+o)/2*Math.PI/180),m=[];for(let u=0;d+u*r/f.KM_PER_DEG<=o+1e-9;u++)for(let p=0;l+p*r/h<=c+1e-9;p++){const g=d+u*r/f.KM_PER_DEG,v=l+p*r/h;m.push({placeId:`grid${g.toFixed(3)},${v.toFixed(3)}`,lat:g,lng:v})}return[...a,...m]}}}static instants(t,s){const e=f.minute(t.local);if(!s)return[e];const a=f.ms(e),n=f.ms(s.from),r=f.ms(s.to),i=s.each??"day",d=864e5,o=c=>{const h=[];if(i==="day"){const m=a+Math.ceil((n-a)/d)*d;for(let u=m;u<=r;u+=c)h.push(u)}else for(let m=n;m<=r;m+=c)h.push(m);return h};let l;switch(s.sweep??"bounds"){case"bounds":{const c=o(i==="day"?d:6e4);l=c.length>0?[c[0],c[c.length-1]]:[];break}case"points":l=(s.points??[]).map(c=>/T/.test(c)?f.ms(c):f.ms(`${c}T${e.slice(11)}`));break;case"step":l=o((s.stepMinutes??(i==="day"?1440:60))*6e4);break;case"deltas":l=[a,...(s.deltasMinutes??[]).map(c=>a+c*6e4)];break}return[...new Set(l)].sort((c,h)=>c-h).map(c=>new Date(c).toISOString().slice(0,16))}static ms(t){const s=t.replace(/[~?%]$/,"").replace(/(Z|[+-]\d\d:\d\d)$/,""),e=s.length===10?`${s}T00:00`:s,a=Date.parse(`${e}Z`);if(Number.isNaN(a))throw new Error(`Not an instant: ${t}`);return a}static minute(t){return new Date(f.ms(t)).toISOString().slice(0,16)}static utc(t,s){return new Date(f.ms(t)-s*36e5)}}class b{constructor(t){this.sources=t,this.model=t.model??P.MODELS[0]}static PLAUSIBLE=O.MEASURABLE;static DRAWN_STEP_MS=500;static STARS=6;static STAR_MAG=1.5;model;async sweep(t,s={}){const e=(t.events??[]).filter(o=>o.eventType===R.SIGHTING_EVENT&&!o.interpretationOf&&o.url).filter(o=>!s.accounts||o.id!==void 0&&s.accounts.includes(o.id)),a=[],n=await Promise.all(e.map(async o=>{const l=await this.sources.load(o.url),c=s.conditions??f.merged(t.conditions,k.strip(l).recording.conditions),h=f.scenarios(b.conditionsOf(l,o.id),c),m=[o.id,k.strip(l).recording.id].filter(p=>!!p),u=R.interpretationEvents(t,m).filter(p=>p.url&&(!s.readings||s.readings.includes(p.url)));return{event:o,accountJson:l,conditions:c,scenarios:h,readings:u}})),r=n.reduce((o,l)=>o+l.scenarios.length*(l.readings.length+(s.sky===!1?0:1)),0);let i=0;const d=()=>s.progress?.(++i,r);for(const{event:o,accountJson:l,conditions:c,scenarios:h,readings:m}of n){const u={...o.id?{eventId:o.id}:{},url:o.url,title:o.title,scenarios:h,readings:[],sky:[]},p=b.judges(l);for(const g of m){const v=await this.sources.load(g.url),w=k.strip(v).recording.interpretation;if(!w||w.scenario){h.forEach(d);continue}const M=await this.replay(g.url,g.title,w,h,p,d);M.kept=b.kept(M,s.keep??c?.keep??"telling"),u.readings.push(M)}if(s.sky!==!1){const g=await this.sky(l,h,d);u.sky=g.replays,g.note&&(u.skyNote=g.note)}a.push(u)}return{accounts:a,alerts:b.alerts(a)}}static conditionsOf(t,s){const e=k.strip(t).recording,a=e.place?.locations?.[0];if(!e.time||!a)throw new Error(`An account with no time or no place cannot be played elsewhere: ${e.id??s}`);return{...s?{eventId:s}:{},local:e.time,utcOffsetHours:e.utcOffsetHours??Math.round(a.lng/15),lat:a.lat,lng:a.lng,...e.place?.name?{placeName:e.place.name}:{}}}static judges(t){const s=O.forAccount(t),e=K(t),a=k.strip(t).recording.timeline?.keyframes??[],n=Math.max(0,...a.map(d=>d.t)),r=Array.from({length:Math.floor(n/b.DRAWN_STEP_MS)+1},(d,o)=>o*b.DRAWN_STEP_MS),i=T.lawsOf(P.MODELS[0],e.account?.conditions);return{said:s,drawn:new O(e,r,i)}}dependsOn(t){return this.sources.kinds.some(e=>e.inWind&&A.itemsOf(t,e.key).length>0)||t.bodies.some(e=>e.drifting)?["wind"]:[]}inWind(t,s){const e={at:n=>N.at(s,n),levels:s.levels.map(n=>n.aboveGroundM)},a={...t};for(const n of this.sources.kinds){const r=A.itemsOf(t,n.key);!n.inWind||r.length===0||(a[n.key]=r.map(i=>n.inWind(i,e)))}return a.bodies=t.bodies.map(n=>n.drifting?b.drifted(n,N.at(s,10)):n),a}static drifted(t,s){const e=t.track;if(!e||e.length<2)return t;const a=e[0],n=e[e.length-1],r=(n.t-a.t)/1e3;if(r<=0||a.eastM===void 0||n.eastM===void 0||a.northM===void 0||n.northM===void 0)return t;const[i,d]=N.vector(s),o=i-(n.eastM-a.eastM)/r,l=d-(n.northM-a.northM)/r;return{...t,track:e.map(c=>c.eastM===void 0||c.northM===void 0?c:{...c,eastM:c.eastM+o*(c.t-a.t)/1e3,northM:c.northM+l*(c.t-a.t)/1e3})}}async bodiesOf(t){return await A.load(t,this.sources.kinds),A.expand(t,this.sources.kinds).bodies}async replay(t,s,e,a,n,r){const i=this.dependsOn(e),d=m=>{const u=b.summary(n.said.comparisons(m)),p=b.summary(n.drawn.comparisons(m));return{said:u,drawn:p,plausible:b.plausible(u,p)}},o=d(await this.bodiesOf(e)),l=[];for(const m of a){if(r(),i.length===0){l.push({scenario:m,...o});continue}try{const u=await this.sources.wind.profile(m.lat,m.lng,m.date);l.push({scenario:m,...d(await this.bodiesOf(this.inWind(e,u))),groundWind:N.at(u,10)})}catch(u){l.push({scenario:m,...o,plausible:o.plausible,error:u.message})}}const c=l.filter(m=>!m.error),h=b.verdict(o.plausible?"plausible":"excluded",c.map(m=>({scenario:m.scenario,plausible:m.plausible})));return i.length===0&&(h.independent=!0),{url:t,title:s,depends:i,asWritten:o,outcomes:l,verdict:h,kept:[]}}static plausible(t,s){const e=t.compared>0?t:s;return e.compared>0&&e.agreedDirection/e.compared>=b.PLAUSIBLE}static summary(t){const s=t.filter(e=>e.separationDeg!==void 0).map(e=>e.separationDeg).sort((e,a)=>e-a);return{agreed:t.filter(e=>e.agrees).length,compared:t.length,agreedDirection:t.filter(e=>!e.contradicted?.includes("direction")).length,...s.length?{medianDeg:s[Math.floor(s.length/2)],worstDeg:s[s.length-1]}:{}}}static verdict(t,s){const e=s.filter(n=>n.plausible),a=s.length;return a===0?{robustness:t==="plausible"?"robust-plausible":"robust-exclusion",asWritten:t,holds:0,played:0,independent:!0}:e.length===a?{robustness:"robust-plausible",asWritten:t,holds:a,played:a}:e.length===0?{robustness:"robust-exclusion",asWritten:t,holds:0,played:a}:{robustness:"conditional",asWritten:t,onlyIf:b.onlyIf(s),holds:e.length,played:a}}static onlyIf(t){const s=n=>{const r=new Map;for(const d of t)r.set(n(d.scenario),[...r.get(n(d.scenario))??[],d.plausible]);const i=[...r.entries()];return i.every(([,d])=>d.every(o=>o)||d.every(o=>!o))?i.filter(([,d])=>d[0]).map(([d])=>d):void 0},e=s(n=>n.placeId);if(e&&new Set(t.map(n=>n.scenario.placeId)).size>1)return{places:e};const a=s(n=>n.local.slice(0,10));return a&&new Set(t.map(n=>n.scenario.local.slice(0,10))).size>1?{dates:a}:{scenarios:t.filter(n=>n.plausible).map(n=>n.scenario.id)}}static kept(t,s){if(s==="none"||t.verdict.independent)return[];const e=t.outcomes.filter(o=>!o.error);if(s==="all")return e.map(o=>o.scenario);const a=t.verdict.robustness!=="conditional";if(s==="robust"&&!a||s==="conditional"&&a)return[];const n=o=>{const l=o.said.compared>0?o.said:o.drawn;return(l.compared?l.agreedDirection/l.compared:0)-(l.medianDeg??180)/1e4},r=[...e].sort((o,l)=>n(l)-n(o));if(a){const o=t.verdict.robustness==="robust-plausible"?r[r.length-1]:r[0];return o?[o.scenario]:[]}const i=r.find(o=>o.plausible),d=[...r].reverse().find(o=>!o.plausible);return[i,d].filter(o=>!!o).map(o=>o.scenario)}async sky(t,s,e){const a=K(t),n=y.statement(a);if(!n)return s.forEach(e),{replays:[],note:"no-direction"};const{statement:r,t:i}=n,d=new $(this.model,a.account?.conditions,{dateShiftDays:[],mirror:!1}),o=p=>this.sources.names?.(p)??p,l=s.find(p=>p.own)??s[0],c={date:l.date,observer:{lat:l.lat,lng:l.lng,elevationM:0}},h=new Set(y.stars(c,i,r,this.sources.limitAt,b.STARS,b.STAR_MAG).map(({star:p})=>p.name)),m=new Map;for(const p of s){e();const g={date:p.date,observer:{lat:p.lat,lng:p.lng,elevationM:0}},v=[{track:y.body("Moon",o("Moon"),g,i,this.sources.limitAt),kind:"body"},...y.PLANETS.map(M=>({track:y.body(M,o(M),g,i,this.sources.limitAt),kind:"body"})),...y.stars(g,i,{...r,aim:void 0},this.sources.limitAt,1/0,b.STAR_MAG).filter(({star:M})=>h.has(M.name)).map(({star:M,track:D})=>({track:{...D,label:o(M.name)},kind:"star"}))],w=await this.issTrack(g,i);w&&v.push({track:w,kind:"satellite"});for(const{track:M,kind:D}of v){const I=d.fit(r,M);let E=m.get(M.id);E||(E={candidate:M.id,label:M.label,kind:D,outcomes:[],verdict:void 0},m.set(M.id,E)),E.outcomes.push({scenario:p,verdict:I.verdict,cost:I.cost,...I.reason?{reason:I.reason}:{}})}}const u=[...m.values()];for(const p of u){const g=p.outcomes.find(w=>w.scenario.own),v=g?g.verdict==="incompatible"?"excluded":"plausible":p.outcomes.every(w=>w.verdict==="incompatible")?"excluded":"plausible";p.verdict=b.verdict(v,p.outcomes.map(w=>({scenario:w.scenario,plausible:w.verdict!=="incompatible"})))}return{replays:u}}async issTrack(t,s){if(!this.sources.satellites)return;const a=(await this.sources.satellites(t.date).catch(()=>{}))?.find(r=>r.norad===y.ISS_NORAD);if(!a)return;const n=new S([a]);return y.satellite(`satellite-${a.norad}`,this.sources.names?.("ISS")??"ISS",r=>n.positionsAt(r,t.observer,-90).find(i=>i.object.norad===a.norad),t,s,this.sources.limitAt)}static alerts(t){return t.flatMap(s=>s.sky.filter(e=>e.kind!=="star"||e.verdict.robustness!=="robust-exclusion").map(e=>({...s.eventId?{eventId:s.eventId}:{},candidate:e.candidate,label:e.label,robustness:e.verdict.robustness,...e.verdict.onlyIf?{onlyIf:e.verdict.onlyIf}:{}})))}}export{b as ScenarioSweep};
|
package/dist-embed-ufoathome/{SearchlightEditor--1uL8bTa.js → SearchlightEditor-PuLz84pp.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{M as c,_ as n}from"./rr0-ufoathome.mjs";import{b as g,P as d}from"./SaidPosition-OJEYhVKN.js";import{bp as r,ba as p}from"./ShareDialogElement-
|
|
1
|
+
import{M as c,_ as n}from"./rr0-ufoathome.mjs";import{b as g,P as d}from"./SaidPosition-OJEYhVKN.js";import{bp as r,ba as p}from"./ShareDialogElement-EzLob2Tz.js";import{S as u}from"./SkyEventEditorStyle-CvY_AhbI.js";import{P as f,a as _,E}from"./ParameterForm-XbqxCLRn.js";import"./GeoProjection-DvqDbRIx.js";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";const v=c.catalog({en:()=>n(()=>import("./SearchlightParameterTexts_en-BwanYoMW.js"),[],import.meta.url).then(i=>i.searchlightParameterTexts_en),fr:()=>n(()=>import("./SearchlightParameterTexts_fr-B7eZQIdG.js"),[],import.meta.url).then(i=>i.searchlightParameterTexts_fr),es:()=>n(()=>import("./SearchlightParameterTexts_es-Cz_rg-Xe.js"),[],import.meta.url).then(i=>i.searchlightParameterTexts_es),it:()=>n(()=>import("./SearchlightParameterTexts_it-BjhuOJre.js"),[],import.meta.url).then(i=>i.searchlightParameterTexts_it)}),y=c.catalog({en:()=>n(()=>import("./SearchlightEditorMessages_en-BWTcGHYC.js"),[],import.meta.url).then(i=>i.searchlightEditorMessages_en),fr:()=>n(()=>import("./SearchlightEditorMessages_fr-CpaD2Il2.js"),[],import.meta.url).then(i=>i.searchlightEditorMessages_fr),es:()=>n(()=>import("./SearchlightEditorMessages_es-PS4IIWFS.js"),[],import.meta.url).then(i=>i.searchlightEditorMessages_es),it:()=>n(()=>import("./SearchlightEditorMessages_it-Br2IjowF.js"),[],import.meta.url).then(i=>i.searchlightEditorMessages_it)});class h{static time(t,e,s){return{type:"number",key:t,min:-36e3,max:36e3,step:1,unit:"s",scale:.001,label:e,hint:s,group:"when"}}static of(t){return t}static SET={kind:"searchlight",title:"searchlight",parameters:[{type:"said",key:"title",label:"name",group:"searchlight"},{type:"position",key:"lat",secondKey:"lng",saidKey:"saidPosition",native:"geo",step:1,label:"position",group:"searchlight"},{type:"number",key:"heightM",min:0,max:500,step:.5,unit:"m",label:"height",hint:"heightHint",group:"searchlight",effective:()=>r.DEFAULT_HEIGHT_M},{type:"number",key:"beams",min:1,max:r.MAX_BEAMS,step:1,label:"beams",hint:"beamsHint",group:"lamp",effective:()=>1},{type:"number",key:"intensityCd",min:1e4,max:1e10,step:1e6,unit:"cd",label:"intensity",hint:"intensityHint",group:"lamp",effective:()=>r.DEFAULT_INTENSITY_CD},{type:"number",key:"divergenceDeg",min:.1,max:20,step:.1,unit:"°",label:"divergence",hint:"divergenceHint",group:"lamp",effective:()=>r.DEFAULT_DIVERGENCE_DEG},{type:"number",key:"colourTemperatureK",min:2e3,max:1e4,step:100,unit:"K",label:"temperature",hint:"temperatureHint",group:"lamp",effective:()=>r.DEFAULT_TEMPERATURE_K},{type:"choice",key:"motion",label:"pattern",hint:"patternHint",group:"motion",effective:t=>r.motionOf(h.of(t)),choices:[{value:"fixed",label:"fixed"},{value:"sweep",label:"sweep"},{value:"rotate",label:"rotate"},{value:"cloverleaf",label:"cloverleaf"}]},{type:"number",key:"tiltDeg",min:0,max:85,step:1,unit:"°",label:"tilt",hint:"tiltHint",group:"motion",effective:()=>r.DEFAULT_TILT_DEG},{type:"number",key:"spreadDeg",min:0,max:360,step:1,unit:"°",label:"spread",hint:"spreadHint",group:"motion",effective:()=>r.DEFAULT_SPREAD_DEG,visibleWhen:t=>r.motionOf(h.of(t))==="sweep"},{type:"number",key:"azimuthDeg",min:0,max:360,step:1,unit:"°",label:"azimuth",hint:"azimuthHint",group:"motion",effective:()=>0},{type:"number",key:"periodS",min:.5,max:600,step:.5,unit:"s",label:"period",hint:"periodHint",group:"motion",effective:()=>r.DEFAULT_PERIOD_S,visibleWhen:t=>r.motionOf(h.of(t))!=="fixed"},h.time("fromT","from","fromHint"),h.time("untilT","until","untilHint")]};static publish(){g.publish(h.SET)}}class m{constructor(t,e,s){this.container=t,this.host=e,u.attach(t,"searchlight-editor-part",m.STYLE),this.language=s,g.of("searchlight")||h.publish(),this.ready=this.setLanguage(s)}messages;parameterTexts;ready;languageToken=0;currentId;form;list;language;shown=[];static STYLE=".searchlight-editor-part { flex-basis: 100%; min-width: 0; } .searchlight-editor-part .searchlight-editor, .searchlight-editor-part .searchlight-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .searchlight-editor-part #searchlight-list, .searchlight-editor-part .searchlight-fields { flex-basis: 100%; min-width: 0; } .searchlight-editor-part [hidden] { display: none !important; } .searchlight-editor-part .searchlight-intro { flex-basis: 100%; margin: 0; } .searchlight-editor-part .searchlight-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .searchlight-editor-part .parameter-group { flex: 1 1 14em; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; align-content: flex-start; } .searchlight-editor-part input, .searchlight-editor-part select { max-width: 100%; box-sizing: border-box; } .searchlight-editor-part label { min-width: 0; max-width: 100%; } .searchlight-editor-part input.parameter-derived::placeholder { opacity: .65; }";async setLanguage(t){const e=++this.languageToken;this.language=t;const[s,l]=await Promise.all([y.load(t),v.load(t)]);e===this.languageToken&&(this.messages=s,this.parameterTexts=l,this.render(),this.sync())}sync(){if(!this.messages)return;const t=this.searchlights;this.shown=[...t],t.some(a=>a.id===this.currentId)||(this.currentId=t[0]?.id),this.list?.setItems(t.map(a=>({id:a.id,label:this.labelOf(a)})),this.currentId);const e=this.placeOfNew()!==void 0;this.list?.setAddState(e,e?void 0:this.messages.addNowhere);const s=this.current;if(this.element("searchlight-fields").hidden=s===void 0,!s)return;const l=d.resolve(g.of("searchlight"),this.parameterTexts);this.form??=new f(this.element("searchlight-parameters"),this.language,"",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(l,new _(()=>this.current,a=>{const o=this.current;o&&a(o)},void 0,this.host.positionPlace?.()),()=>this.host.changed())}refresh(){if(!this.messages)return;const t=this.searchlights;t.length===this.shown.length&&t.every((e,s)=>e===this.shown[s])||this.sync()}setTime(t){}get current(){return this.searchlights.find(t=>t.id===this.currentId)}render(){const t=this.messages;this.form=void 0,this.container.innerHTML=`<div class="searchlight-editor">
|
|
2
2
|
<p class="searchlight-intro">${t.intro}</p>
|
|
3
3
|
<div id="searchlight-list"></div>
|
|
4
4
|
<div id="searchlight-fields" class="searchlight-fields">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BeamSystem as L}from"./BeamSystem-C5EpRhij.js";import{L as x}from"./LaserBeam-B-tlAzNB.js";import{bo as N,bp as r,bq as U,q as D}from"./ShareDialogElement-EzLob2Tz.js";import"./three.module-CbaHqYFq.js";import"./rr0-ufoathome.mjs";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";class E{static APERTURE_M=.6;static NEAR_STEP_M=10;static FAR_STEP_M=250;static STEP_SHARE=.05;static CLOUD_STEP_M=25;static SPENT=.003;beams=new L;placed;lineOwners=[];constructor(){this.beams.group.name="searchlights"}get object(){return this.beams.group}get drawnCount(){return this.beams.drawnCount}update(a,s,t){const c=[],M=[];this.lineOwners=[];const i=t.clouds;i?i.dim(this.beams.material):N.apply(this.beams.material,[]);const l=t.wind??{eastMS:0,northMS:0};for(const o of r.onAt(a,s)){const A=this.whereOf(o,t.reference),g=t.origin.x+A.eastM*t.eastScale,d=t.origin.z-A.northM,u=t.groundYAt(g,d)+(o.heightM??r.DEFAULT_HEIGHT_M),e=o.intensityCd??r.DEFAULT_INTENSITY_CD,b=o.divergenceDeg??r.DEFAULT_DIVERGENCE_DEG,S=b*Math.PI/180,m=r.fluxLm(e,b),n=U.ofTemperature(o.colourTemperatureK??r.DEFAULT_TEMPERATURE_K),w=L.white(n);r.aimsAt(o,s).forEach((T,_)=>{const p=r.axisOf(T),h={x:p.east,y:p.up,z:-p.north},P={windAlongMS:l.eastMS*p.east+l.northMS*p.north,windAcrossMS:l.eastMS*p.north-l.northMS*p.east},{points:y,throughBelow:I}=this.walk({x:g,y:u,z:d},h,S,m,s,t,P);if(c.push({id:o.id,points:y,spectrum:w}),this.lineOwners.push({id:o.id,beam:_}),i&&h.y>.02&&i.bottomY>u){const v=(i.bottomY-u)/h.y,R=t.air.transmittance(t.siteElevationM+u,t.siteElevationM+i.bottomY,v),C=e*t.relativeScale;M.push({x:g,y:u,z:d,axis:h,fwhmRad:S,rgb:[C*n[0]*R[0],C*n[1]*R[1],C*n[2]*R[2]],throughCloudsBelow:I})}})}this.beams.drawLines(c,t),t.lightClouds?.(M)}walk(a,s,t,c,M,i,l){const o=i.clouds,A=[],g=[],d=[],u=i.siteElevationM+a.y;let e=0,b=0;for(;;){const m=a.x+s.x*e,n=a.y+s.y*e,w=a.z+s.z*e,T=o!==void 0&&n>=o.bottomY&&n<=o.topY,_=Math.exp(-b),p=e>0?i.air.transmittance(u,i.siteElevationM+n,e)[1]:1;if(A.push({x:m,y:n,z:w,altitudeM:i.siteElevationM+n,widthM:E.APERTURE_M+t*e,powerW:c*p*_,haze:x.patchAt(e,M,{...l,patchiness:x.DEFAULT_PATCHINESS})}),g.push(n),d.push(_),e>=r.RANGE_M||n>=r.CEILING_M||_<E.SPENT)break;const h=T?E.CLOUD_STEP_M:Math.min(E.FAR_STEP_M,Math.max(E.NEAR_STEP_M,e*E.STEP_SHARE));if(o&&(T||n<o.bottomY&&n+s.y*h>o.bottomY)){const P=T?h:Math.max(0,(o.bottomY-n)/Math.max(s.y,1e-6));if(!T){e+=Math.max(1,P);continue}b+=o.extinctionAt(m+s.x*h/2,n+s.y*h/2,w+s.z*h/2)*h}e+=h}return{points:A,throughBelow:m=>{const n=g.findIndex(w=>w>=m);return n<0?d[d.length-1]:d[n]}}}whereOf(a,s){(!this.placed||this.placed.lat!==s.lat||this.placed.lng!==s.lng)&&(this.placed={...s,at:new Map});let t=this.placed.at.get(a);if(!t){const c=D.ecef({lat:s.lat,lng:s.lng,heightM:0}),M=D.ecef({lat:a.lat,lng:a.lng,heightM:0}),i=s.lat*Math.PI/180,l=s.lng*Math.PI/180,o=[M[0]-c[0],M[1]-c[1],M[2]-c[2]];t={eastM:-Math.sin(l)*o[0]+Math.cos(l)*o[1],northM:-Math.sin(i)*Math.cos(l)*o[0]-Math.sin(i)*Math.sin(l)*o[1]+Math.cos(i)*o[2]},this.placed.at.set(a,t)}return t}pick(a,s,t){const c=this.beams.pickAt(a,s,t.toleranceRad);if(c)return{id:c.id,distanceM:c.distanceM,detail:{beam:(this.lineOwners[c.line]?.beam??0)+1}}}dispose(){this.beams.dispose()}}export{E as SearchlightSystem};
|