@rr0/ufoathome 0.188.1 → 0.189.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-embed-scene/{BirdEditor-C7dHFbA6.js → BirdEditor-BxlHc4L5.js} +1 -1
- package/dist-embed-scene/{BirdFlock-DOjnGqqt.js → BirdFlock-DGC3adr7.js} +1 -1
- package/dist-embed-scene/{LanternEditor-D2mmscWP.js → LanternEditor-CpNWWMyY.js} +1 -1
- package/dist-embed-scene/{ModuleSession-BAeWIbSU.js → ModuleSession-Dd9RVc7I.js} +2 -2
- package/dist-embed-scene/ModuleThree-q18pyqmA.js +1 -0
- package/dist-embed-scene/ReentryEditor-DGLg57vB.js +28 -0
- package/dist-embed-scene/ReentryEditorMessages_en-BmTZMr-m.js +1 -0
- package/dist-embed-scene/ReentryEditorMessages_es-edid__Jo.js +1 -0
- package/dist-embed-scene/ReentryEditorMessages_fr-DHbcY0tN.js +1 -0
- package/dist-embed-scene/ReentryEditorMessages_it-CIzkIU4G.js +1 -0
- package/dist-embed-scene/ReentryKindMessages_en-BGZgya17.js +1 -0
- package/dist-embed-scene/ReentryKindMessages_es--UxzPNfj.js +1 -0
- package/dist-embed-scene/ReentryKindMessages_fr-7mer-cdj.js +1 -0
- package/dist-embed-scene/ReentryKindMessages_it-BBVQXE1M.js +1 -0
- package/dist-embed-scene/ReentryParameterTexts_en-5BOfwCsS.js +1 -0
- package/dist-embed-scene/ReentryParameterTexts_es-ze1-U4jB.js +1 -0
- package/dist-embed-scene/ReentryParameterTexts_fr-BgUJROXF.js +1 -0
- package/dist-embed-scene/ReentryParameterTexts_it-MTb9Vuq0.js +1 -0
- package/dist-embed-scene/ReentryTypeNames_en-CBu890Bd.js +1 -0
- package/dist-embed-scene/ReentryTypeNames_es-_LnketjJ.js +1 -0
- package/dist-embed-scene/ReentryTypeNames_fr-BXq89mrz.js +1 -0
- package/dist-embed-scene/ReentryTypeNames_it-Yfq-TDip.js +1 -0
- package/dist-embed-scene/SkyLantern-dInLqzN4.js +1 -0
- package/dist-embed-scene/rr0-scene.mjs +305 -305
- package/dist-embed-scene/{sightingSchema-Dk010uUD.js → sightingSchema-DjI7FV42.js} +1 -1
- package/dist-embed-sighting/{CaseReportExport-DbGfu7DP.js → CaseReportExport-Dq8QfB_9.js} +1 -1
- package/dist-embed-sighting/{LanternEditor-DIun2igg.js → LanternEditor-C6tHr2lo.js} +1 -1
- package/dist-embed-sighting/{ModuleSession-CDsk4Atg.js → ModuleSession-YoBCzrOV.js} +2 -2
- package/dist-embed-sighting/ModuleThree-BHRi7HrA.js +1 -0
- package/dist-embed-sighting/ReentryEditor-BzOyu6AB.js +28 -0
- package/dist-embed-sighting/ReentryEditorMessages_en-BmTZMr-m.js +1 -0
- package/dist-embed-sighting/ReentryEditorMessages_es-edid__Jo.js +1 -0
- package/dist-embed-sighting/ReentryEditorMessages_fr-DHbcY0tN.js +1 -0
- package/dist-embed-sighting/ReentryEditorMessages_it-CIzkIU4G.js +1 -0
- package/dist-embed-sighting/ReentryKindMessages_en-BGZgya17.js +1 -0
- package/dist-embed-sighting/ReentryKindMessages_es--UxzPNfj.js +1 -0
- package/dist-embed-sighting/ReentryKindMessages_fr-7mer-cdj.js +1 -0
- package/dist-embed-sighting/ReentryKindMessages_it-BBVQXE1M.js +1 -0
- package/dist-embed-sighting/ReentryParameterTexts_en-5BOfwCsS.js +1 -0
- package/dist-embed-sighting/ReentryParameterTexts_es-ze1-U4jB.js +1 -0
- package/dist-embed-sighting/ReentryParameterTexts_fr-BgUJROXF.js +1 -0
- package/dist-embed-sighting/ReentryParameterTexts_it-MTb9Vuq0.js +1 -0
- package/dist-embed-sighting/ReentryTypeNames_en-CBu890Bd.js +1 -0
- package/dist-embed-sighting/ReentryTypeNames_es-_LnketjJ.js +1 -0
- package/dist-embed-sighting/ReentryTypeNames_fr-BXq89mrz.js +1 -0
- package/dist-embed-sighting/ReentryTypeNames_it-Yfq-TDip.js +1 -0
- package/dist-embed-sighting/SkyLantern-BdVGIBoq.js +1 -0
- package/dist-embed-sighting/rr0-sighting.mjs +320 -320
- package/dist-embed-sighting/{sightingSchema-Dk010uUD.js → sightingSchema-DjI7FV42.js} +1 -1
- package/dist-embed-sighting-editor/{BallesterGuaspAssessor-DysBC5VV.js → BallesterGuaspAssessor-CeyXntPc.js} +1 -1
- package/dist-embed-sighting-editor/{CaseReportExport-Cc4W9Lim.js → CaseReportExport-DQEJL9zL.js} +1 -1
- package/dist-embed-sighting-editor/{ControlPasses-Bo1RUT7-.js → ControlPasses-C2E5CKcL.js} +1 -1
- package/dist-embed-sighting-editor/{CoverageAssessor-tRNaBy0f.js → CoverageAssessor-DvVcSmz6.js} +1 -1
- package/dist-embed-sighting-editor/{GLTFLoader-B3aYB7cS.js → GLTFLoader-fTZft-Zt.js} +1 -1
- package/dist-embed-sighting-editor/{HeadlightSystem-YWAhxcbe.js → HeadlightSystem-uWB_oNGK.js} +1 -1
- package/dist-embed-sighting-editor/{HynekAssessor-IoHDLJUa.js → HynekAssessor-D-u8nJfp.js} +1 -1
- package/dist-embed-sighting-editor/{InterviewEditorElement-ByXtSShu.js → InterviewEditorElement-MBuptUl8.js} +2 -2
- package/dist-embed-sighting-editor/{LanternEditor-BYeK9kFU.js → LanternEditor-DIew0BrY.js} +1 -1
- package/dist-embed-sighting-editor/ModuleConformance-_3-3Kbbt.js +2 -0
- package/dist-embed-sighting-editor/{ModuleSession-B8U-T57q.js → ModuleSession-mVLpd6IE.js} +2 -2
- package/dist-embed-sighting-editor/ModuleThree-cXvmWIn4.js +1 -0
- package/dist-embed-sighting-editor/{ModulesPanelElement-BndWwnmX.js → ModulesPanelElement-DZ7dkdsm.js} +3 -3
- package/dist-embed-sighting-editor/{NearestApproach-C48vgZ_Z.js → NearestApproach-BDjtUet2.js} +1 -1
- package/dist-embed-sighting-editor/{PoherAssessor-DRLbEZBS.js → PoherAssessor-DrseSHg-.js} +1 -1
- package/dist-embed-sighting-editor/{RailwaySystem-SB2r1oRG.js → RailwaySystem-De5BYxNx.js} +1 -1
- package/dist-embed-sighting-editor/ReentryEditor-DWqXWztK.js +28 -0
- package/dist-embed-sighting-editor/ReentryEditorMessages_en-BmTZMr-m.js +1 -0
- package/dist-embed-sighting-editor/ReentryEditorMessages_es-edid__Jo.js +1 -0
- package/dist-embed-sighting-editor/ReentryEditorMessages_fr-DHbcY0tN.js +1 -0
- package/dist-embed-sighting-editor/ReentryEditorMessages_it-CIzkIU4G.js +1 -0
- package/dist-embed-sighting-editor/ReentryKindMessages_en-BGZgya17.js +1 -0
- package/dist-embed-sighting-editor/ReentryKindMessages_es--UxzPNfj.js +1 -0
- package/dist-embed-sighting-editor/ReentryKindMessages_fr-7mer-cdj.js +1 -0
- package/dist-embed-sighting-editor/ReentryKindMessages_it-BBVQXE1M.js +1 -0
- package/dist-embed-sighting-editor/ReentryParameterTexts_en-5BOfwCsS.js +1 -0
- package/dist-embed-sighting-editor/ReentryParameterTexts_es-ze1-U4jB.js +1 -0
- package/dist-embed-sighting-editor/ReentryParameterTexts_fr-BgUJROXF.js +1 -0
- package/dist-embed-sighting-editor/ReentryParameterTexts_it-MTb9Vuq0.js +1 -0
- package/dist-embed-sighting-editor/ReentryTypeNames_en-CBu890Bd.js +1 -0
- package/dist-embed-sighting-editor/ReentryTypeNames_es-_LnketjJ.js +1 -0
- package/dist-embed-sighting-editor/ReentryTypeNames_fr-BXq89mrz.js +1 -0
- package/dist-embed-sighting-editor/ReentryTypeNames_it-Yfq-TDip.js +1 -0
- package/dist-embed-sighting-editor/{ReferenceSystem-DlpoDXXV.js → ReferenceSystem-BoCM4vB1.js} +1 -1
- package/dist-embed-sighting-editor/{SightingEditorMessages_en-Lx3C0BAS.js → SightingEditorMessages_en-Bt9dhchY.js} +1 -1
- package/dist-embed-sighting-editor/{SightingEditorMessages_es-Dh01a5sk.js → SightingEditorMessages_es-BnoHmcFj.js} +1 -1
- package/dist-embed-sighting-editor/{SightingEditorMessages_fr-CUfrDDiv.js → SightingEditorMessages_fr-CE7C8gk2.js} +1 -1
- package/dist-embed-sighting-editor/{SightingEditorMessages_it-C0Werz3D.js → SightingEditorMessages_it-lqZ7QCHn.js} +1 -1
- package/dist-embed-sighting-editor/{SightingFileEditor-Wx9tn4bw.js → SightingFileEditor-Dtz8Azd2.js} +1 -1
- package/dist-embed-sighting-editor/SkyLantern-CaRiiIZX.js +1 -0
- package/dist-embed-sighting-editor/{TraceSystem-Cz4lbziC.js → TraceSystem-DdEd9Z5I.js} +1 -1
- package/dist-embed-sighting-editor/{WaterSystem-C39XDvNY.js → WaterSystem-DntD2XIE.js} +2 -2
- package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +371 -367
- package/dist-embed-sighting-editor/{sightingSchema-Dk010uUD.js → sightingSchema-DjI7FV42.js} +1 -1
- package/package.json +1 -1
- package/dist-embed-scene/ModuleThree-BLw9W-dX.js +0 -1
- package/dist-embed-scene/ReentryEditor-BR99W168.js +0 -27
- package/dist-embed-scene/ReentryEditorMessages_en-O-YSmHxv.js +0 -1
- package/dist-embed-scene/ReentryEditorMessages_es-CvO9Jwz5.js +0 -1
- package/dist-embed-scene/ReentryEditorMessages_fr-xuC-qZ6M.js +0 -1
- package/dist-embed-scene/ReentryEditorMessages_it-B7vyCX9o.js +0 -1
- package/dist-embed-scene/ReentryKindMessages_en-Cbgk3paQ.js +0 -1
- package/dist-embed-scene/ReentryKindMessages_es-DwgJQanC.js +0 -1
- package/dist-embed-scene/ReentryKindMessages_fr-D9r9x2bK.js +0 -1
- package/dist-embed-scene/ReentryKindMessages_it-DQ-J5YpD.js +0 -1
- package/dist-embed-scene/ReentryParameterTexts_en-BH1tGP5C.js +0 -1
- package/dist-embed-scene/ReentryParameterTexts_es-BDMJ4K1g.js +0 -1
- package/dist-embed-scene/ReentryParameterTexts_fr-C8ROK57p.js +0 -1
- package/dist-embed-scene/ReentryParameterTexts_it-CwC8vNTI.js +0 -1
- package/dist-embed-scene/SkyLantern-CIoY8lu4.js +0 -1
- package/dist-embed-sighting/ModuleThree-ZXC7TlGn.js +0 -1
- package/dist-embed-sighting/ReentryEditor-DS0nJdBD.js +0 -27
- package/dist-embed-sighting/ReentryEditorMessages_en-O-YSmHxv.js +0 -1
- package/dist-embed-sighting/ReentryEditorMessages_es-CvO9Jwz5.js +0 -1
- package/dist-embed-sighting/ReentryEditorMessages_fr-xuC-qZ6M.js +0 -1
- package/dist-embed-sighting/ReentryEditorMessages_it-B7vyCX9o.js +0 -1
- package/dist-embed-sighting/ReentryKindMessages_en-Cbgk3paQ.js +0 -1
- package/dist-embed-sighting/ReentryKindMessages_es-DwgJQanC.js +0 -1
- package/dist-embed-sighting/ReentryKindMessages_fr-D9r9x2bK.js +0 -1
- package/dist-embed-sighting/ReentryKindMessages_it-DQ-J5YpD.js +0 -1
- package/dist-embed-sighting/ReentryParameterTexts_en-BH1tGP5C.js +0 -1
- package/dist-embed-sighting/ReentryParameterTexts_es-BDMJ4K1g.js +0 -1
- package/dist-embed-sighting/ReentryParameterTexts_fr-C8ROK57p.js +0 -1
- package/dist-embed-sighting/ReentryParameterTexts_it-CwC8vNTI.js +0 -1
- package/dist-embed-sighting/SkyLantern--RJZtEMU.js +0 -1
- package/dist-embed-sighting-editor/ModuleConformance-C-KZlNCi.js +0 -2
- package/dist-embed-sighting-editor/ModuleThree-Ce5HhfdG.js +0 -1
- package/dist-embed-sighting-editor/ReentryEditor-JhfAVd18.js +0 -27
- package/dist-embed-sighting-editor/ReentryEditorMessages_en-O-YSmHxv.js +0 -1
- package/dist-embed-sighting-editor/ReentryEditorMessages_es-CvO9Jwz5.js +0 -1
- package/dist-embed-sighting-editor/ReentryEditorMessages_fr-xuC-qZ6M.js +0 -1
- package/dist-embed-sighting-editor/ReentryEditorMessages_it-B7vyCX9o.js +0 -1
- package/dist-embed-sighting-editor/ReentryKindMessages_en-Cbgk3paQ.js +0 -1
- package/dist-embed-sighting-editor/ReentryKindMessages_es-DwgJQanC.js +0 -1
- package/dist-embed-sighting-editor/ReentryKindMessages_fr-D9r9x2bK.js +0 -1
- package/dist-embed-sighting-editor/ReentryKindMessages_it-DQ-J5YpD.js +0 -1
- package/dist-embed-sighting-editor/ReentryParameterTexts_en-BH1tGP5C.js +0 -1
- package/dist-embed-sighting-editor/ReentryParameterTexts_es-BDMJ4K1g.js +0 -1
- package/dist-embed-sighting-editor/ReentryParameterTexts_fr-C8ROK57p.js +0 -1
- package/dist-embed-sighting-editor/ReentryParameterTexts_it-CwC8vNTI.js +0 -1
- package/dist-embed-sighting-editor/SkyLantern-B0V58mct.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleThree-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleThree-cXvmWIn4.js","./rr0-sighting-editor.mjs"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{C as g,D as w,_ as b,M as p}from"./rr0-sighting-editor.mjs";class n{static STORAGE_KEY="ufoathome.modules";static FORMAT=1;static empty(){return{format:1,modules:[]}}static read(t=n.storage()){try{const e=t?.getItem(n.STORAGE_KEY);return e?n.parse(e):n.empty()}catch{return n.empty()}}static write(t,e=n.storage()){try{return e?(t.modules.length===0?e.removeItem(n.STORAGE_KEY):e.setItem(n.STORAGE_KEY,n.text(t)),!0):!1}catch{return!1}}static parse(t){const e=JSON.parse(t);if(e===null||typeof e!="object"||!Array.isArray(e.modules))throw new Error("not a UFO@home module list");if(typeof e.format=="number"&&e.format>n.FORMAT)throw new Error(`format ${e.format} is newer than ${n.FORMAT}`);const r=new Set,s=[];for(const i of e.modules)typeof i?.url!="string"||r.has(i.url)||(r.add(i.url),s.push({url:i.url,enabled:i.enabled!==!1}));return{format:1,modules:s}}static text(t){return JSON.stringify({format:n.FORMAT,modules:t.modules},null,2)+`
|
|
3
|
-
`}static storage(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}}class E{constructor(t,e){this.attribution=t,this.models=e}async entries(t){return t?this.models.filter(e=>[e.kind].flat().includes(t)):[...this.models]}async entry(t){return this.models.find(e=>e.id===t)}}class f{attribution;fetchImpl;tileUrlTemplate;constructor(t){this.attribution=t.attribution,this.tileUrlTemplate=t.tileUrlTemplate,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis)}getImageryTexture(t,e){return g(t,e,r=>f.tileUrl(this.tileUrlTemplate,r),this.fetchImpl)}static tileUrl(t,e){return t.replaceAll("{z}",String(e.z)).replaceAll("{x}",String(e.x)).replaceAll("{y}",String(e.y))}}class v extends Error{constructor(t,e){super(`${t}: ${e}`),this.url=t,this.reason=e,this.name="ModuleManifestError"}}class d{static FORMAT=1;static check(t,e){const r=o=>{throw new v(e,o)};(t===null||typeof t!="object"||Array.isArray(t))&&r("not a JSON object");const s=t;typeof s.format!="number"&&r('no "format"'),s.format>d.FORMAT&&r(`format ${s.format} is newer than ${d.FORMAT}, which this version reads`),(typeof s.id!="string"||!/^[a-z0-9][a-z0-9._-]*$/.test(s.id))&&r(`"id" must be lowercase letters, digits, '.', '_' or '-'`),(typeof s.name!="string"||s.name.trim()==="")&&r('no "name"'),s.script!==void 0&&typeof s.script!="string"&&r('"script" must be an address');const i=s.contributes??{};for(const o of["imagery","elevation"]){const c=i[o];c!==void 0&&(Array.isArray(c)||r(`"contributes.${o}" must be a list`),c.forEach((l,h)=>{for(const m of["id","name","credit","creditUrl","tiles"])(typeof l?.[m]!="string"||l[m]==="")&&r(`"contributes.${o}[${h}].${m}" is missing`);["{z}","{x}","{y}"].every(m=>l.tiles.includes(m))||r(`"contributes.${o}[${h}].tiles" must hold {z}, {x} and {y}`)}))}const a=i.models;return a!==void 0&&(Array.isArray(a)||r('"contributes.models" must be a list'),a.forEach((o,c)=>{for(const l of["id","name","file"])(typeof o?.[l]!="string"||o[l]==="")&&r(`"contributes.models[${c}].${l}" is missing`);o.kind===void 0&&r(`"contributes.models[${c}].kind" is missing`),(!o.credit||typeof o.credit!="object")&&r(`"contributes.models[${c}].credit" is missing: a model is shown with its author and licence`)})),s}static contributions(t,e){const r=t.contributes??{},s={};if(r.imagery?.length&&(s.imagery=r.imagery.map(i=>({id:i.id,name:i.name,credit:i.credit,creditUrl:i.creditUrl,create:a=>new f({tileUrlTemplate:d.absoluteTemplate(i.tiles,e),attribution:i.credit,fetchImpl:a})}))),r.elevation?.length&&(s.elevation=r.elevation.map(i=>({id:i.id,name:i.name,credit:i.credit,creditUrl:i.creditUrl,create:a=>new w({tileUrlTemplate:d.absoluteTemplate(i.tiles,e),fetchImpl:a})}))),r.models?.length){const i=r.models.map(({file:o,...c})=>({...c,url:new URL(o,e).href})),a=t.credit??t.name;s.decorModels=[{id:`${t.id}-models`,name:t.name,credit:a,creditUrl:t.creditUrl??e,create:()=>new E(a,i)}]}return s}static module(t,e,r={}){const s=d.contributions(t,e);for(const[i,a]of Object.entries(r))Array.isArray(a)&&(s[i]=[...s[i]??[],...a]);return{id:t.id,name:t.name,credit:t.credit,creditUrl:t.creditUrl,url:e,contributes:s}}static absoluteTemplate(t,e){const r=t.replaceAll("{z}","__Z__").replaceAll("{x}","__X__").replaceAll("{y}","__Y__");return new URL(r,e).href.replaceAll("__Z__","{z}").replaceAll("__X__","{x}").replaceAll("__Y__","{y}")}}class T{fetchImpl;importImpl;constructor(t={}){this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.importImpl=t.importImpl??(e=>import(e))}async load(t,e){const r=await this.fetchImpl(t);if(!r.ok)throw new Error(`${t}: HTTP ${r.status}`);const s=d.check(await r.json(),t),i=s.script!==void 0;let a={};if(i&&e.runScript){const o=new URL(s.script,t).href,c=await this.importImpl(o);if(typeof c.default!="function")throw new Error(`${o}: its default export is not a function`);const{MODULE_THREE:l}=await b(async()=>{const{MODULE_THREE:h}=await import("./ModuleThree-
|
|
3
|
+
`}static storage(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}}class E{constructor(t,e){this.attribution=t,this.models=e}async entries(t){return t?this.models.filter(e=>[e.kind].flat().includes(t)):[...this.models]}async entry(t){return this.models.find(e=>e.id===t)}}class f{attribution;fetchImpl;tileUrlTemplate;constructor(t){this.attribution=t.attribution,this.tileUrlTemplate=t.tileUrlTemplate,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis)}getImageryTexture(t,e){return g(t,e,r=>f.tileUrl(this.tileUrlTemplate,r),this.fetchImpl)}static tileUrl(t,e){return t.replaceAll("{z}",String(e.z)).replaceAll("{x}",String(e.x)).replaceAll("{y}",String(e.y))}}class v extends Error{constructor(t,e){super(`${t}: ${e}`),this.url=t,this.reason=e,this.name="ModuleManifestError"}}class d{static FORMAT=1;static check(t,e){const r=o=>{throw new v(e,o)};(t===null||typeof t!="object"||Array.isArray(t))&&r("not a JSON object");const s=t;typeof s.format!="number"&&r('no "format"'),s.format>d.FORMAT&&r(`format ${s.format} is newer than ${d.FORMAT}, which this version reads`),(typeof s.id!="string"||!/^[a-z0-9][a-z0-9._-]*$/.test(s.id))&&r(`"id" must be lowercase letters, digits, '.', '_' or '-'`),(typeof s.name!="string"||s.name.trim()==="")&&r('no "name"'),s.script!==void 0&&typeof s.script!="string"&&r('"script" must be an address');const i=s.contributes??{};for(const o of["imagery","elevation"]){const c=i[o];c!==void 0&&(Array.isArray(c)||r(`"contributes.${o}" must be a list`),c.forEach((l,h)=>{for(const m of["id","name","credit","creditUrl","tiles"])(typeof l?.[m]!="string"||l[m]==="")&&r(`"contributes.${o}[${h}].${m}" is missing`);["{z}","{x}","{y}"].every(m=>l.tiles.includes(m))||r(`"contributes.${o}[${h}].tiles" must hold {z}, {x} and {y}`)}))}const a=i.models;return a!==void 0&&(Array.isArray(a)||r('"contributes.models" must be a list'),a.forEach((o,c)=>{for(const l of["id","name","file"])(typeof o?.[l]!="string"||o[l]==="")&&r(`"contributes.models[${c}].${l}" is missing`);o.kind===void 0&&r(`"contributes.models[${c}].kind" is missing`),(!o.credit||typeof o.credit!="object")&&r(`"contributes.models[${c}].credit" is missing: a model is shown with its author and licence`)})),s}static contributions(t,e){const r=t.contributes??{},s={};if(r.imagery?.length&&(s.imagery=r.imagery.map(i=>({id:i.id,name:i.name,credit:i.credit,creditUrl:i.creditUrl,create:a=>new f({tileUrlTemplate:d.absoluteTemplate(i.tiles,e),attribution:i.credit,fetchImpl:a})}))),r.elevation?.length&&(s.elevation=r.elevation.map(i=>({id:i.id,name:i.name,credit:i.credit,creditUrl:i.creditUrl,create:a=>new w({tileUrlTemplate:d.absoluteTemplate(i.tiles,e),fetchImpl:a})}))),r.models?.length){const i=r.models.map(({file:o,...c})=>({...c,url:new URL(o,e).href})),a=t.credit??t.name;s.decorModels=[{id:`${t.id}-models`,name:t.name,credit:a,creditUrl:t.creditUrl??e,create:()=>new E(a,i)}]}return s}static module(t,e,r={}){const s=d.contributions(t,e);for(const[i,a]of Object.entries(r))Array.isArray(a)&&(s[i]=[...s[i]??[],...a]);return{id:t.id,name:t.name,credit:t.credit,creditUrl:t.creditUrl,url:e,contributes:s}}static absoluteTemplate(t,e){const r=t.replaceAll("{z}","__Z__").replaceAll("{x}","__X__").replaceAll("{y}","__Y__");return new URL(r,e).href.replaceAll("__Z__","{z}").replaceAll("__X__","{x}").replaceAll("__Y__","{y}")}}class T{fetchImpl;importImpl;constructor(t={}){this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.importImpl=t.importImpl??(e=>import(e))}async load(t,e){const r=await this.fetchImpl(t);if(!r.ok)throw new Error(`${t}: HTTP ${r.status}`);const s=d.check(await r.json(),t),i=s.script!==void 0;let a={};if(i&&e.runScript){const o=new URL(s.script,t).href,c=await this.importImpl(o);if(typeof c.default!="function")throw new Error(`${o}: its default export is not a function`);const{MODULE_THREE:l}=await b(async()=>{const{MODULE_THREE:h}=await import("./ModuleThree-cXvmWIn4.js");return{MODULE_THREE:h}},__vite__mapDeps([0,1]),import.meta.url);a=await c.default({manifestUrl:t,three:l})??{}}return{url:t,manifest:s,module:d.module(s,t,a),hasScript:i,scriptRun:i&&e.runScript}}}class y{constructor(t=new T,e){this.loader=t,this.storage=e}static shared=new y;changes=new EventTarget;states=new Map;config=n.empty();started;list(){const t=[...this.states.values()];return[...t.filter(e=>e.addedByPerson),...t.filter(e=>!e.addedByPerson)]}state(t){return this.states.get(t)}start(){return this.started??=this.applyConfig(n.read(this.storage)),this.started}async add(t){await this.start();const e=new URL(t,typeof location>"u"?void 0:location.href).href;return this.config.modules.some(r=>r.url===e)||(this.config={...this.config,modules:[...this.config.modules,{url:e,enabled:!0}]},this.save()),this.reload(e)}async remove(t){this.config={...this.config,modules:this.config.modules.filter(e=>e.url!==t)},this.save(),await this.reload(t)}async setEnabled(t,e){this.config={...this.config,modules:this.config.modules.map(r=>r.url===t?{...r,enabled:e}:r)},this.save(),await this.reload(t)}exportText(){return n.text(this.config)}async importText(t){const e=n.parse(t);await this.start();const r=this.config.modules.map(s=>s.url);this.config=e,this.save(),await Promise.all([...new Set([...r,...e.modules.map(s=>s.url)])].map(s=>this.reload(s)))}async require(t,e){t?.length&&(await this.start(),await Promise.all(t.map(async r=>{let s;try{s=new URL(r,e??(typeof location>"u"?void 0:location.href)).href}catch{return}const i=this.states.get(s);if(i&&i.status!=="off")return i.status==="loading"?this.pending.get(s):void 0;this.named.add(s),await this.reload(s)})))}named=new Set;pending=new Map;async applyConfig(t){this.config=t,await Promise.all(t.modules.map(e=>this.reload(e.url)))}reload(t){const e=this.reloadNow(t);return this.pending.set(t,e),e}async reloadNow(t){const e=this.config.modules.find(a=>a.url===t),r=this.states.get(t);r?.loaded&&p.uninstall(r.loaded.module.id);const s=e!==void 0,i=e?.enabled??!0;if(!s&&!this.named.has(t))return this.states.delete(t),this.announce(),{url:t,addedByPerson:s,enabled:i,status:"off"};if(s&&!i&&!this.named.has(t))return this.set({url:t,addedByPerson:s,enabled:i,status:"off"});this.set({url:t,addedByPerson:s,enabled:i,status:"loading"});try{const a=await this.loader.load(t,{runScript:s&&i});return p.install(a.module),this.set({url:t,addedByPerson:s,enabled:i,status:"installed",loaded:a})}catch(a){return this.set({url:t,addedByPerson:s,enabled:i,status:"failed",error:a instanceof Error?a.message:String(a)})}}set(t){return this.states.set(t.url,t),this.announce(),t}save(){n.write(this.config,this.storage)}announce(){this.changes.dispatchEvent(new Event("change"))}}export{y as ModuleSession};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{V as a,ba as e,cm as s,bt as t,bv as r,bI as i,bl as o,Q as n,bs as c,aS as l,bR as b,bJ as m,G as u,cn as d,ar as M,aF as G,ap as S,K as B,c6 as f,c3 as p,c7 as y,am as h,ck as x,bf as D,J as E,aG as L,co as g,cp as C,cq as P,aU as T,bu as v,aD as A,aE as F,cr as H,bH as V,aH as k}from"./rr0-sighting-editor.mjs";const O={AdditiveBlending:k,BackSide:V,BoxGeometry:H,BufferAttribute:F,BufferGeometry:A,CanvasTexture:v,Color:T,ConeGeometry:P,CylinderGeometry:C,DataTexture:g,DoubleSide:L,Euler:E,Float32BufferAttribute:D,FrontSide:x,Group:h,Line:y,LineBasicMaterial:p,LineSegments:f,Matrix4:B,Mesh:S,MeshBasicMaterial:G,MeshStandardMaterial:M,NormalBlending:d,Object3D:u,PlaneGeometry:m,PointLight:b,Points:l,PointsMaterial:c,Quaternion:n,ShaderMaterial:o,SphereGeometry:i,Sprite:r,SpriteMaterial:t,TorusGeometry:s,Vector2:e,Vector3:a};export{O as MODULE_THREE};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleConformance-
|
|
2
|
-
import{o as _,_ as x,H as y,z as L,i as m}from"./rr0-sighting-editor.mjs";import{ModuleSession as C}from"./ModuleSession-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleConformance-_3-3Kbbt.js","./rr0-sighting-editor.mjs"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as _,_ as x,H as y,z as L,i as m}from"./rr0-sighting-editor.mjs";import{ModuleSession as C}from"./ModuleSession-mVLpd6IE.js";const P=_.catalog({en:()=>x(()=>import("./ModulesPanelMessages_en-DuwrY3Pm.js"),[],import.meta.url).then(b=>b.modulesPanelMessages_en),fr:()=>x(()=>import("./ModulesPanelMessages_fr-B8cSDc6o.js"),[],import.meta.url).then(b=>b.modulesPanelMessages_fr),es:()=>x(()=>import("./ModulesPanelMessages_es-Bq5X-XuT.js"),[],import.meta.url).then(b=>b.modulesPanelMessages_es),it:()=>x(()=>import("./ModulesPanelMessages_it-BdC626aJ.js"),[],import.meta.url).then(b=>b.modulesPanelMessages_it)}),N="rr0-modules-panel",A=`
|
|
3
3
|
rr0-modules-panel { display: block; }
|
|
4
4
|
rr0-modules-panel .mp-add { display: flex; gap: .4em; align-items: center; margin: .4em 0; }
|
|
5
5
|
rr0-modules-panel .mp-add input { flex: 1 1 16em; min-width: 0; }
|
|
@@ -12,4 +12,4 @@ rr0-modules-panel .mp-head .mp-remove { margin-left: auto; }
|
|
|
12
12
|
rr0-modules-panel .mp-module p { margin: .2em 0; }
|
|
13
13
|
rr0-modules-panel .mp-findings { margin: .3em 0; padding-left: 1.2em; }
|
|
14
14
|
rr0-modules-panel .mp-files { display: flex; gap: .6em; flex-wrap: wrap; align-items: center; margin-top: .6em; }
|
|
15
|
-
`;class M extends HTMLElement{session=C.shared;messages;languageAsked=!1;named=[];recordingBase;note;languageToken=0;draft="";onChange=()=>this.render();checkContext;checks=new Map;set moduleSession(e){this.session.changes.removeEventListener("change",this.onChange),this.session=e,this.isConnected&&this.session.changes.addEventListener("change",this.onChange),this.render()}get recordingModules(){return[...this.named]}set recordingModules(e){this.named=[...e??[]],this.render()}set base(e){this.recordingBase=e,this.render()}async setLanguage(e){this.languageAsked=!0;const t=++this.languageToken,n=await P.load(e);t===this.languageToken&&(this.messages=n,this.render())}connectedCallback(){this.languageAsked||this.setLanguage(y.preferencesFor(this)[0]??"en"),this.session.changes.addEventListener("change",this.onChange),this.session.start(),this.render()}disconnectedCallback(){this.session.changes.removeEventListener("change",this.onChange)}absolute(e){try{return new URL(e,this.recordingBase??location.href).href}catch{return}}isNamed(e){return this.named.some(t=>this.absolute(t)===e)}setNamed(e,t){t!==this.isNamed(e)&&(this.named=t?[...this.named,L.of(e,this.recordingBase)]:this.named.filter(n=>this.absolute(n)!==e),t&&this.session.require([e]),this.dispatchEvent(new Event("recordingmoduleschange",{bubbles:!0})),this.render())}render(){const e=this.messages;if(!this.isConnected||!this.messages)return;const t=this.ownerDocument,n=t.createElement("style");n.textContent=A;const s=t.createElement("p");s.className=m.INFO,s.textContent=e.intro;const a=t.createElement("form");a.className="mp-add";const i=t.createElement("input");i.type="url",i.id="module-url",i.required=!0,i.placeholder=e.urlPlaceholder,i.value=this.draft,i.addEventListener("input",()=>{this.draft=i.value}),i.setAttribute("aria-label",e.urlPlaceholder);const u=t.createElement("button");u.type="submit",u.textContent=e.add,a.append(i,u),a.addEventListener("submit",r=>{r.preventDefault();const w=i.value.trim();w&&(this.draft="",this.session.add(w))});const l=t.createElement("p");l.className=m.WARNING,l.textContent=e.codeWarning;const c=this.session.list(),h=new Set(c.map(r=>r.url)),v=this.named.map(r=>this.absolute(r)).filter(r=>r!==void 0&&!h.has(r)),g=t.createElement("ul");g.className="mp-list",g.append(...c.map(r=>this.item(r)),...v.map(r=>this.item({url:r,addedByPerson:!1,enabled:!0,status:"loading"})));const k=t.createElement("p");k.className=m.INFO,k.textContent=e.none,k.hidden=g.childElementCount>0;const f=t.createElement("div");f.className="mp-files";const E=t.createElement("button");E.type="button",E.id="modules-export",E.textContent=e.exportConfig,E.disabled=!c.some(r=>r.addedByPerson),E.addEventListener("click",()=>this.download());const p=t.createElement("input");p.type="file",p.id="modules-import",p.accept="application/json,.json",p.hidden=!0;const o=t.createElement("button");o.type="button",o.textContent=e.importConfig,o.addEventListener("click",()=>p.click()),p.addEventListener("change",()=>{const r=p.files?.[0];r&&this.importFile(r),p.value=""}),f.append(E,o,p);const d=t.createElement("p");d.id="modules-note",d.setAttribute("role","status"),m.show(d,this.note?.text,this.note?.kind),this.replaceChildren(n,s,a,l,g,k,f,d)}item(e){const t=this.messages,n=this.ownerDocument,s=e.loaded,a=n.createElement("li");a.className="mp-module",a.dataset.url=e.url;const i=n.createElement("div");if(i.className="mp-head",e.addedByPerson){const o=n.createElement("label"),d=n.createElement("input");d.type="checkbox",d.className="mp-enabled",d.checked=e.enabled,d.addEventListener("change",()=>void this.session.setEnabled(e.url,d.checked)),o.append(d,n.createTextNode(` ${t.enabled}`)),i.append(o)}const u=n.createElement("span");u.className="mp-name",u.textContent=e.loaded?.module.name??e.url,i.append(u);const l=e.loaded?.module.credit;if(l){const o=n.createElement(e.loaded?.module.creditUrl?"a":"span");o.className=m.INFO,o.textContent=l,o instanceof HTMLAnchorElement&&(o.href=e.loaded.module.creditUrl,o.target="_blank",o.rel="noopener noreferrer"),i.append(o)}const c=n.createElement("button");if(c.type="button",c.className="mp-remove",e.addedByPerson?(c.textContent=t.remove,c.addEventListener("click",()=>void this.session.remove(e.url))):(c.textContent=t.addToMine,c.addEventListener("click",()=>void this.session.add(e.url))),e.status==="installed"&&s){const o=n.createElement("button");o.type="button",o.className="mp-check";const d=this.checks.get(e.url),r=d?.of===s&&d.findings===void 0&&d.crash===void 0;o.textContent=r?t.checking:t.check,o.disabled=r,o.addEventListener("click",()=>void this.check(e.url,s)),i.append(o)}i.append(c);const h=n.createElement("p");h.className=`${m.INFO} mp-url`,h.textContent=e.url;const v=n.createElement("p");v.className="mp-status",e.status==="loading"?m.show(v,t.loading):e.status==="failed"?m.show(v,t.failed.replace("{error}",e.error??""),"error"):e.status==="off"?m.show(v,t.off):m.show(v,this.brings(e));const g=n.createElement("p");g.className="mp-code",s?.scriptRun?m.show(g,t.runsCode,"warning"):s?.hasScript?m.show(g,t.codeNotRun,"info"):g.hidden=!0;const k=n.createElement("label");k.title=t.namedByRecordingHint;const f=n.createElement("input");f.type="checkbox",f.className="mp-named",f.checked=this.isNamed(e.url),f.addEventListener("change",()=>this.setNamed(e.url,f.checked)),k.append(f,n.createTextNode(` ${t.namedByRecording}`));const E=n.createElement("p");E.append(k),a.append(i,h,v,g,E);const p=this.checks.get(e.url);return p&&p.of===s&&a.append(...this.checkResult(p)),a}async check(e,t){const n={of:t};this.checks.set(e,n),this.render();try{const{ModuleConformance:s}=await x(async()=>{const{ModuleConformance:a}=await import("./ModuleConformance-
|
|
15
|
+
`;class M extends HTMLElement{session=C.shared;messages;languageAsked=!1;named=[];recordingBase;note;languageToken=0;draft="";onChange=()=>this.render();checkContext;checks=new Map;set moduleSession(e){this.session.changes.removeEventListener("change",this.onChange),this.session=e,this.isConnected&&this.session.changes.addEventListener("change",this.onChange),this.render()}get recordingModules(){return[...this.named]}set recordingModules(e){this.named=[...e??[]],this.render()}set base(e){this.recordingBase=e,this.render()}async setLanguage(e){this.languageAsked=!0;const t=++this.languageToken,n=await P.load(e);t===this.languageToken&&(this.messages=n,this.render())}connectedCallback(){this.languageAsked||this.setLanguage(y.preferencesFor(this)[0]??"en"),this.session.changes.addEventListener("change",this.onChange),this.session.start(),this.render()}disconnectedCallback(){this.session.changes.removeEventListener("change",this.onChange)}absolute(e){try{return new URL(e,this.recordingBase??location.href).href}catch{return}}isNamed(e){return this.named.some(t=>this.absolute(t)===e)}setNamed(e,t){t!==this.isNamed(e)&&(this.named=t?[...this.named,L.of(e,this.recordingBase)]:this.named.filter(n=>this.absolute(n)!==e),t&&this.session.require([e]),this.dispatchEvent(new Event("recordingmoduleschange",{bubbles:!0})),this.render())}render(){const e=this.messages;if(!this.isConnected||!this.messages)return;const t=this.ownerDocument,n=t.createElement("style");n.textContent=A;const s=t.createElement("p");s.className=m.INFO,s.textContent=e.intro;const a=t.createElement("form");a.className="mp-add";const i=t.createElement("input");i.type="url",i.id="module-url",i.required=!0,i.placeholder=e.urlPlaceholder,i.value=this.draft,i.addEventListener("input",()=>{this.draft=i.value}),i.setAttribute("aria-label",e.urlPlaceholder);const u=t.createElement("button");u.type="submit",u.textContent=e.add,a.append(i,u),a.addEventListener("submit",r=>{r.preventDefault();const w=i.value.trim();w&&(this.draft="",this.session.add(w))});const l=t.createElement("p");l.className=m.WARNING,l.textContent=e.codeWarning;const c=this.session.list(),h=new Set(c.map(r=>r.url)),v=this.named.map(r=>this.absolute(r)).filter(r=>r!==void 0&&!h.has(r)),g=t.createElement("ul");g.className="mp-list",g.append(...c.map(r=>this.item(r)),...v.map(r=>this.item({url:r,addedByPerson:!1,enabled:!0,status:"loading"})));const k=t.createElement("p");k.className=m.INFO,k.textContent=e.none,k.hidden=g.childElementCount>0;const f=t.createElement("div");f.className="mp-files";const E=t.createElement("button");E.type="button",E.id="modules-export",E.textContent=e.exportConfig,E.disabled=!c.some(r=>r.addedByPerson),E.addEventListener("click",()=>this.download());const p=t.createElement("input");p.type="file",p.id="modules-import",p.accept="application/json,.json",p.hidden=!0;const o=t.createElement("button");o.type="button",o.textContent=e.importConfig,o.addEventListener("click",()=>p.click()),p.addEventListener("change",()=>{const r=p.files?.[0];r&&this.importFile(r),p.value=""}),f.append(E,o,p);const d=t.createElement("p");d.id="modules-note",d.setAttribute("role","status"),m.show(d,this.note?.text,this.note?.kind),this.replaceChildren(n,s,a,l,g,k,f,d)}item(e){const t=this.messages,n=this.ownerDocument,s=e.loaded,a=n.createElement("li");a.className="mp-module",a.dataset.url=e.url;const i=n.createElement("div");if(i.className="mp-head",e.addedByPerson){const o=n.createElement("label"),d=n.createElement("input");d.type="checkbox",d.className="mp-enabled",d.checked=e.enabled,d.addEventListener("change",()=>void this.session.setEnabled(e.url,d.checked)),o.append(d,n.createTextNode(` ${t.enabled}`)),i.append(o)}const u=n.createElement("span");u.className="mp-name",u.textContent=e.loaded?.module.name??e.url,i.append(u);const l=e.loaded?.module.credit;if(l){const o=n.createElement(e.loaded?.module.creditUrl?"a":"span");o.className=m.INFO,o.textContent=l,o instanceof HTMLAnchorElement&&(o.href=e.loaded.module.creditUrl,o.target="_blank",o.rel="noopener noreferrer"),i.append(o)}const c=n.createElement("button");if(c.type="button",c.className="mp-remove",e.addedByPerson?(c.textContent=t.remove,c.addEventListener("click",()=>void this.session.remove(e.url))):(c.textContent=t.addToMine,c.addEventListener("click",()=>void this.session.add(e.url))),e.status==="installed"&&s){const o=n.createElement("button");o.type="button",o.className="mp-check";const d=this.checks.get(e.url),r=d?.of===s&&d.findings===void 0&&d.crash===void 0;o.textContent=r?t.checking:t.check,o.disabled=r,o.addEventListener("click",()=>void this.check(e.url,s)),i.append(o)}i.append(c);const h=n.createElement("p");h.className=`${m.INFO} mp-url`,h.textContent=e.url;const v=n.createElement("p");v.className="mp-status",e.status==="loading"?m.show(v,t.loading):e.status==="failed"?m.show(v,t.failed.replace("{error}",e.error??""),"error"):e.status==="off"?m.show(v,t.off):m.show(v,this.brings(e));const g=n.createElement("p");g.className="mp-code",s?.scriptRun?m.show(g,t.runsCode,"warning"):s?.hasScript?m.show(g,t.codeNotRun,"info"):g.hidden=!0;const k=n.createElement("label");k.title=t.namedByRecordingHint;const f=n.createElement("input");f.type="checkbox",f.className="mp-named",f.checked=this.isNamed(e.url),f.addEventListener("change",()=>this.setNamed(e.url,f.checked)),k.append(f,n.createTextNode(` ${t.namedByRecording}`));const E=n.createElement("p");E.append(k),a.append(i,h,v,g,E);const p=this.checks.get(e.url);return p&&p.of===s&&a.append(...this.checkResult(p)),a}async check(e,t){const n={of:t};this.checks.set(e,n),this.render();try{const{ModuleConformance:s}=await x(async()=>{const{ModuleConformance:a}=await import("./ModuleConformance-_3-3Kbbt.js");return{ModuleConformance:a}},__vite__mapDeps([0,1]),import.meta.url);n.findings=await s.check(t,this.checkContext?.())}catch(s){n.crash=s instanceof Error?s.message:String(s)}this.render()}checkResult(e){const t=this.messages,n=this.ownerDocument,s=(l,c)=>{const h=n.createElement("p");return h.className="mp-check-result",h.setAttribute("role","status"),m.show(h,l,c),h};if(e.crash!==void 0)return[s(t.checkCrashed.replace("{error}",()=>e.crash),"error")];if(!e.findings)return[];const a=e.findings.filter(l=>l.level==="failed"),i=e.findings.filter(l=>l.level==="note"),u=[];if(a.length===0&&u.push(s(t.checkPassed,"info")),a.length+i.length>0){const l=n.createElement("ul");l.className="mp-findings";for(const c of[...a,...i]){const h=n.createElement("li");m.show(h,this.finding(c),c.level==="failed"?"error":"info"),l.append(h)}u.push(l)}return u}finding(e){const t=this.messages,n=e.point===void 0?"":t.points[e.point]??e.point,s=t.checks[e.code].replace("{point}",()=>e.point??"").replace("{detail}",()=>e.detail??""),a=e.source??(e.code==="unknownPoint"||e.code==="notAList"?void 0:n);return a?t.checkAbout.replace("{about}",()=>a).replace("{text}",()=>s):s}brings(e){const t=Object.entries(e.loaded?.module.contributes??{}).filter(([,n])=>Array.isArray(n)&&n.length>0).map(([n,s])=>`${this.messages.points[n]??n} (${s.length})`);return t.length>0?this.messages.brings.replace("{points}",t.join(", ")):this.messages.bringsNothing}download(){const e=new Blob([this.session.exportText()],{type:"application/json"}),t=URL.createObjectURL(e),n=this.ownerDocument.createElement("a");n.href=t,n.download="ufoathome-modules.json",n.click(),URL.revokeObjectURL(t)}async importFile(e){try{await this.session.importText(await e.text());const t=this.session.list().filter(n=>n.addedByPerson).length;this.note={text:this.messages.imported.replace("{count}",String(t)),kind:"info"}}catch(t){this.note={text:this.messages.importFailed.replace("{error}",t instanceof Error?t.message:String(t)),kind:"error"}}this.render()}}function B(){customElements.get(N)||customElements.define(N,M)}export{N as MODULES_PANEL_ELEMENT_NAME,M as ModulesPanelElement,B as register};
|
package/dist-embed-sighting-editor/{NearestApproach-C48vgZ_Z.js → NearestApproach-BDjtUet2.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b4 as b,B as h}from"./rr0-sighting-editor.mjs";class c{static FLAT={heightAt:()=>0};static of(e){const s=e.timeline.sourceIds.map(n=>b.of(e,n)?.nearestM).filter(n=>n!==void 0);return s.length>0?{m:Math.min(...s),basis:"derived",paths:["timeline","observerTrack"]}:c.interpreted(e)}static interpreted(e){const s=(e.interpretation?.bodies??[]).map((t,i)=>({body:t,index:i})).filter(({body:t})=>Array.isArray(t.track)),n=s.filter(({body:t})=>(t.explains?.length??0)>0),u=n.length>0?n:s,d=c.FLAT,l=t=>h.eyeOf(e,t,d);let o;const p=[];for(const{body:t,index:i}of u){const M=new h(t,d,l);for(const{t:f}of t.track){const r=M.at(f),a=l(f);if(!r||!a)continue;const m=Math.hypot(r.eastM-a.eastM,r.northM-a.northM,r.upM-a.upM);(o===void 0||m<o)&&(o=m)}p.push(`interpretation.bodies.${i}`)}return o===void 0?void 0:{m:o,basis:"assumed",paths:p}}}export{c as N};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b6 as u}from"./rr0-sighting-editor.mjs";class o{about="shape";static STEP_DEG=2;static TURN_DEG=60;static ERRATIC_TURNS=3;static OSCILLATIONS=["vibrate","spiral","roll"];async assess(n){const t=this.trajectory(n),s=this.vanish(n),e=this.oscillation(n),a=this.landing(n),c=this.judged(n,"traces"),r=this.occupants(n),h=a.shown&&r.shown?5:a.shown&&c.shown?4:a.shown||t.value==="erratic"||s.shown||e.shown?3:t.value==="abnormal"?2:t.value==="straight"?1:0,i=[{id:"poher-trajectory",basis:t.basis,paths:t.paths,value:o.TRAJECTORIES.indexOf(t.value)},this.criterion("poher-vanish",s),this.criterion("poher-oscillation",e),{...this.criterion("poher-landing",a),unsupported:a.basis===void 0},this.criterion("poher-traces",c),this.criterion("poher-occupants",r)];return{verdict:String(h),criteria:i}}static TRAJECTORIES=["unknown","still","straight","abnormal","erratic"];criterion(n,t){return{id:n,value:t.shown?1:0,basis:t.basis,paths:t.basis===void 0?[]:t.paths}}trajectory(n){let t="unknown";for(const s of n.timeline.sourceIds){const e=this.seen(n,s).filter(i=>i.aim!==void 0).map(i=>i.aim);if(e.length<2)continue;const a=[o.unit(e[0])];for(const i of e.slice(1)){const l=o.unit(i);o.angleDeg(a[a.length-1],l)>=o.STEP_DEG&&a.push(l)}const c=a.length-1;let r=0;for(let i=1;i<a.length-1;i++){const l=o.cross(a[i-1],a[i]),d=o.cross(a[i],a[i+1]);o.angleDeg(l,d)>=o.TURN_DEG&&r++}const h=c===0?"still":r>=o.ERRATIC_TURNS?"erratic":r>0?"abnormal":"straight";o.TRAJECTORIES.indexOf(h)>o.TRAJECTORIES.indexOf(t)&&(t=h)}return t==="unknown"?{value:t,paths:[]}:{value:t,basis:"derived",paths:["timeline"]}}vanish(n){const t=(n.events??[]).findIndex(s=>s.eventType==="vanish"&&u.isPhenomenon(n,s));return t>=0?{shown:!0,basis:"stated",paths:[`events.${t}`]}:{shown:!1,paths:[]}}oscillation(n){const t=new Set((n.interpretation?.bodies??[]).map(e=>e.id)),s=(n.events??[]).findIndex(e=>o.OSCILLATIONS.includes(e.eventType)&&(u.isPhenomenon(n,e)||t.has(e.who?.split("/")[0]??"")));return s>=0?{shown:!0,basis:"stated",paths:[`events.${s}`]}:{shown:!1,paths:[]}}landing(n){const t=e=>!e.onGround&&((e.altitudeAboveGroundM??0)>0||(e.altitudeM??0)>0),s=(n.interpretation?.bodies??[]).findIndex(e=>Array.isArray(e.track)&&e.track.some(a=>a.onGround)&&e.track.some(t));return s>=0?{shown:!0,basis:"assumed",paths:[`interpretation.bodies.${s}`]}:{shown:!1,paths:[]}}occupants(n){const t=n.decor.findIndex(s=>s.kind==="entity");return t>=0?{shown:!0,basis:"stated",paths:[`decor.${t}`]}:this.judged(n,"beings")}judged(n,t){const s=n.account?.strangeness?.[t];return s===void 0?{shown:!1,paths:[]}:{shown:s,basis:"stated",paths:[`account.strangeness.${t}`]}}instants(n,t){return n.timeline.allKeyframes.map(s=>({t:s.t,shape:s.shapes.find(e=>e.sourceId===t)?.shape})).filter(({shape:s})=>s!==void 0).map(({t:s,shape:e})=>({t:s,aim:e.aim,visible:e.transparency<1})).sort((s,e)=>s.t-e.t)}seen(n,t){return this.instants(n,t).filter(s=>s.visible)}static unit(n){const[t,s]=[n.azimuthDeg*Math.PI/180,n.altitudeDeg*Math.PI/180];return[Math.cos(s)*Math.sin(t),Math.cos(s)*Math.cos(t),Math.sin(s)]}static cross(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}static angleDeg(n,t){const s=Math.hypot(...n)*Math.hypot(...t);if(s===0)return 0;const e=(n[0]*t[0]+n[1]*t[1]+n[2]*t[2])/s;return Math.acos(Math.max(-1,Math.min(1,e)))*180/Math.PI}}export{o as PoherAssessor};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{am as F,ar as P,aU as H,n as K,aD as w,aE as N,ap as U,bb as k}from"./rr0-sighting-editor.mjs";class b{static HOLLOW_M=1;static COVERED_M=3;static WINDOW_M=30;static SAMPLE_M=4;static MAX_GRADE={rail:.025,highSpeed:.035,subway:.04,light_rail:.06,tram:.08,funicular:1/0};static heights(t,s,e){const n=t.map(a=>a.level===0),o=t.map((a,i)=>n[i]?b.targets(a,s,e):[]),c=t.map((a,i)=>n[i]?b.samples(a,o[i]):[]),r=new Map;t.forEach((a,i)=>{if(n[i])for(const h of b.ends(a)){const u=b.key(h),p=r.get(u);p?p.push(i):r.set(u,[i])}});const M=a=>{const i=r.get(b.key(a));if(i)return b.median(i.flatMap(h=>c[h]),a)};return t.map((a,i)=>{if(n[i]){const h=[...new Set([i,...b.ends(a).flatMap(d=>r.get(b.key(d))??[])])].flatMap(d=>c[d]),u=a.centre.map((d,O)=>b.median(h,d)??o[i][O]),[p,A]=b.ends(a);return u[0]=M(p)??u[0],u[u.length-1]=M(A)??u[u.length-1],b.graded(u,a.along,a.highSpeed?b.MAX_GRADE.highSpeed:b.MAX_GRADE[a.kind])}return b.carried(a,s,e,M)})}static targets(t,s,e){return t.centre.map(n=>{const o=s(n.x,n.z);if(e===void 0||n.altitudeM===void 0)return o;const c=n.altitudeM+e;return c-o>b.HOLLOW_M||o-c>b.COVERED_M?c:o})}static samples(t,s){const e=[];let n=0;return t.centre.forEach((o,c)=>{t.along[c]+1e-6<n&&c<t.centre.length-1||(e.push({x:o.x,z:o.z,y:s[c]}),n=t.along[c]+b.SAMPLE_M)}),e}static median(t,s){const e=[];for(const o of t)Math.hypot(o.x-s.x,o.z-s.z)<=b.WINDOW_M&&e.push(o.y);if(e.length===0)return;e.sort((o,c)=>o-c);const n=e.length>>1;return e.length%2===1?e[n]:(e[n-1]+e[n])/2}static graded(t,s,e){if(!Number.isFinite(e)||t.length<3)return t;const n=[...t],o=n.length-1,c=s[o];if(Math.abs(n[o]-n[0])>e*c)return s.map(r=>n[0]+(n[o]-n[0])*r/c);for(let r=1;r<o;r++){const M=e*(s[r]-s[r-1]);n[r]=Math.min(n[r-1]+M,Math.max(n[r-1]-M,n[r]))}for(let r=o-1;r>0;r--){const M=e*(s[r+1]-s[r]);n[r]=Math.min(n[r+1]+M,Math.max(n[r+1]-M,n[r]))}return n}static carried(t,s,e,n){const[o,c]=b.ends(t),r=t.along[t.along.length-1],M=n(o),a=n(c);if(e!==void 0&&t.centre.every(u=>u.altitudeM!==void 0)){const u=t.centre.map(d=>d.altitudeM+e),p=M!==void 0?M-u[0]:0,A=a!==void 0?a-u[u.length-1]:0;return u.map((d,O)=>d+p+(A-p)*t.along[O]/r)}const i=M??s(o.x,o.z),h=a??s(c.x,c.z);return t.along.map(u=>i+(h-i)*u/r)}static ends(t){return[t.centre[0],t.centre[t.centre.length-1]]}static key(t){return`${Math.round(t.x*2)},${Math.round(t.z*2)}`}}class B{positions=[];indices=[];along=[];get vertexCount(){return this.positions.length/3}strip(t,s,e){const n=this.vertexCount;for(let o=0;o<t.length;o++)this.positions.push(t[o].x,t[o].y,t[o].z,s[o].x,s[o].y,s[o].z),e&&this.along.push(e[o],e[o]);for(let o=0;o<t.length-1;o++){const c=n+o*2;this.indices.push(c,c+2,c+1,c+1,c+2,c+3)}}beam(t,s,e,n=!0){const o=s.x-t.x,c=s.y-t.y,r=s.z-t.z,M=Math.hypot(o,c,r);if(M<1e-6)return;const a={x:o/M,y:c/M,z:r/M},i=Math.abs(a.y)>.9?{x:1,y:0,z:0}:{x:0,y:1,z:0},h=a.y*i.z-a.z*i.y,u=a.z*i.x-a.x*i.z,p=a.x*i.y-a.y*i.x,A=Math.hypot(h,u,p),d={x:h/A*e/2,y:u/A*e/2,z:p/A*e/2},O={x:a.y*d.z-a.z*d.y,y:a.z*d.x-a.x*d.z,z:a.x*d.y-a.y*d.x},g=(f,x,E)=>({x:f.x+d.x*x+O.x*E,y:f.y+d.y*x+O.y*E,z:f.z+d.z*x+O.z*E}),_=[[1,1],[-1,1],[-1,-1],[1,-1]];for(let f=0;f<4;f++){const[x,E]=_[f],[z,v]=_[(f+1)%4];this.quad(g(t,x,E),g(t,z,v),g(s,z,v),g(s,x,E))}n&&(this.quad(...[..._].reverse().map(([f,x])=>g(t,f,x))),this.quad(..._.map(([f,x])=>g(s,f,x))))}quad(t,s,e,n){const o=this.vertexCount;this.positions.push(t.x,t.y,t.z,s.x,s.y,s.z,e.x,e.y,e.z,n.x,n.y,n.z),this.indices.push(o,o+1,o+2,o,o+2,o+3)}}class l{static STEP_M=6;static BALLAST_HEIGHT_M=.5;static BALLAST_SLOPE=1.5;static BALLAST_SHOULDER_M=.45;static DECK_DEPTH_M=.8;static BANK_SLOPE=1.5;static SLEEPER_LENGTH_M=2.4;static SLEEPER_WIDTH_M=.29;static SLEEPER_SPACING_M=.6;static RAIL_HEAD_M=.072;static RAIL_HEIGHT_M=.18;static TRAM_RAIL_HEIGHT_M=.03;static LIFT_M=.06;static CATENARY={rail:{contactM:5.5,systemM:1.4,spanM:54,staggerM:.2},highSpeed:{contactM:5.08,systemM:1.4,spanM:63,staggerM:.2},service:{contactM:5.5,systemM:1.2,spanM:45,staggerM:.2},tram:{contactM:6,systemM:0,spanM:30,staggerM:.2}};static MESSENGER_SAG_M=.55;static MAST_SIDE_M=.26;static MAST_OFFSET_M=3.1;static MAST_ABOVE_M=.6;static CONTACT_DIAMETER_M=.012;static MESSENGER_DIAMETER_M=.011;static ARM_SIDE_M=.06;static TRACK_SPACING_M={rail:3.7,highSpeed:4.5,tram:3.1,subway:3.4,light_rail:3.4,funicular:3.2};static BALLAST_ALBEDO=[.17,.16,.15];static BANK_ALBEDO=[.085,.09,.05];static DECK_ALBEDO=[.26,.255,.24];static CONCRETE_ALBEDO=[.36,.35,.33];static WOOD_ALBEDO=[.07,.055,.045];static RUST_ALBEDO=[.085,.068,.058];static STEEL_ALBEDO=[.3,.31,.32];static COPPER_ALBEDO=[.09,.085,.07];static LINE_REACH_M=20;group=new F;stepM=l.STEP_M;drawn=0;laid=[];ballastMaterial=l.pebbled(l.lambert(l.BALLAST_ALBEDO,!0));earthMaterial=l.lambert(l.BANK_ALBEDO,!0);deckMaterial=l.lambert(l.DECK_ALBEDO,!1);concreteSleepers=l.sleeperMaterial(l.CONCRETE_ALBEDO);woodSleepers=l.sleeperMaterial(l.WOOD_ALBEDO);rustMaterial=l.lambert(l.RUST_ALBEDO,!0);headMaterial=new P({color:new H(.62,.62,.62),metalness:1,roughness:.28,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2});steelMaterial=l.lambert(l.STEEL_ALBEDO,!1);wireMaterial=l.lambert(l.COPPER_ALBEDO,!1);constructor(){this.group.name="railways"}get count(){return this.drawn}setGroundSpacing(t){this.stepM=Number.isFinite(t)&&t>0?Math.min(l.STEP_M,Math.max(1.5,t/2)):l.STEP_M}set(t,s,e,n,o=1/0){this.clear();const r=t.map(p=>({line:p,path:p.points.map(A=>({...K(A.lat,A.lng,s,e),altitudeM:A.altitudeM}))})).filter(({line:p,path:A})=>p.level>=0&&l.within(A,o)),M=l.altitudeOffset(r,n),a=r.flatMap(({line:p,path:A})=>{const d=this.layoutOf(p,A);return d?[{line:p,layout:d}]:[]}),i=b.heights(a.map(({layout:p})=>p),n,M),h={ballast:new B,earth:new B,deck:new B,concrete:new B,wood:new B,rust:new B,head:new B,steel:new B,wire:new B};a.forEach(({line:p,layout:A},d)=>{this.lay(p,{...A,y:i[d]},n,h),this.laid.push({line:p,centre:A.centre}),this.drawn++});const u=[[h.ballast,this.ballastMaterial,"ballast",!1],[h.earth,this.earthMaterial,"embankments",!1],[h.deck,this.deckMaterial,"decks",!0],[h.concrete,this.concreteSleepers,"sleepers",!1],[h.wood,this.woodSleepers,"sleepers wood",!1],[h.rust,this.rustMaterial,"rails",!1],[h.head,this.headMaterial,"rail heads",!1],[h.steel,this.steelMaterial,"catenary masts",!0],[h.wire,this.wireMaterial,"catenary wires",!1]];for(const[p,A,d,O]of u){const g=l.meshOf(p,A);g&&(g.name=`railways ${d}`,g.castShadow=O,g.receiveShadow=!0,this.group.add(g))}}clear(){for(const t of[...this.group.children])this.group.remove(t),t.geometry?.dispose();this.drawn=0,this.laid=[]}lineAt(t,s){let e;for(const{line:n,centre:o}of this.laid)for(let c=0;c<o.length-1;c++){const r=o[c],M=o[c+1],a=M.x-r.x,i=M.z-r.z,h=a*a+i*i,u=h===0?0:Math.max(0,Math.min(1,((t-r.x)*a+(s-r.z)*i)/h)),p=Math.hypot(t-(r.x+a*u),s-(r.z+i*u));p<=l.LINE_REACH_M&&(!e||p<e.distance)&&(e={line:n,distance:p})}return e?.line}mayMeet(t,s,e,n){const o=Math.hypot(s.x,s.z);if(o<1e-6)return this.lineAt(t.x,t.z)!==void 0;const c=s.x/o,r=s.z/o,M=l.LINE_REACH_M;for(const{centre:a}of this.laid)for(let i=0;i<a.length-1;i++){const h=a[i],u=a[i+1];for(const p of[0,.5,1]){const A=h.x+(u.x-h.x)*p,d=h.z+(u.z-h.z)*p,O=(A-t.x)*c+(d-t.z)*r;if(O<0)continue;const g=Math.abs((A-t.x)*r-(d-t.z)*c),_=Math.hypot(u.x-h.x,u.z-h.z)/2;if(g>M+_)continue;if(t.y+s.y*(O/o)<=e(A,d)+n)return!0}}return!1}contactHeightM(t){if(!(t.electrification!=="overhead"||t.kind==="subway"||t.kind==="funicular"))return l.catenaryOf(t).contactM}static catenaryOf(t){return t.kind==="tram"?l.CATENARY.tram:t.highSpeed?l.CATENARY.highSpeed:t.service?l.CATENARY.service:l.CATENARY.rail}dispose(){this.clear();for(const t of[this.ballastMaterial,this.earthMaterial,this.deckMaterial,this.concreteSleepers,this.woodSleepers,this.rustMaterial,this.headMaterial,this.steelMaterial,this.wireMaterial])t.dispose()}static within(t,s){if(!Number.isFinite(s))return!0;const e=s*1.1+100;return t.some((n,o)=>Math.hypot(n.x,n.z)<=e||o>0&&Math.hypot((n.x+t[o-1].x)/2,(n.z+t[o-1].z)/2)<=e)}static altitudeOffset(t,s){const e=[];for(const{line:n,path:o}of t)if(n.level===0)for(const c of o)c.altitudeM!==void 0&&e.push(s(c.x,c.z)-c.altitudeM);if(!(e.length<5))return e.sort((n,o)=>n-o),e[Math.floor(e.length/2)]}layoutOf(t,s){const e=[];for(let c=0;c<s.length-1;c++){const r=s[c],M=s[c+1],a=Math.max(1,Math.ceil(Math.hypot(M.x-r.x,M.z-r.z)/this.stepM));for(let i=0;i<a;i++){const h=i/a,u=r.altitudeM!==void 0&&M.altitudeM!==void 0?r.altitudeM+(M.altitudeM-r.altitudeM)*h:void 0;e.push({x:r.x+(M.x-r.x)*h,z:r.z+(M.z-r.z)*h,altitudeM:u})}}if(e.push(s[s.length-1]),e.length<2)return;const n=[0];for(let c=1;c<e.length;c++)n.push(n[c-1]+Math.hypot(e[c].x-e[c-1].x,e[c].z-e[c-1].z));if(n[n.length-1]<.5)return;const o=e.map((c,r)=>{const M=e[Math.max(0,r-1)],a=e[Math.min(e.length-1,r+1)],i=a.x-M.x,h=a.z-M.z,u=Math.hypot(i,h);return u<1e-6?{x:1,z:0}:{x:i/u,z:h/u}});return{kind:t.kind,...t.highSpeed?{highSpeed:!0}:{},level:t.level,centre:e,along:n,dir:o}}lay(t,s,e,n){const o=t.highSpeed?l.TRACK_SPACING_M.highSpeed:l.TRACK_SPACING_M[t.kind],c=Math.min(8,Math.max(1,t.tracks)),r=Array.from({length:c},(g,_)=>(_-(c-1)/2)*o),M=t.kind==="tram",a=M?0:l.BALLAST_HEIGHT_M,i=l.LIFT_M,h=(g,_,f)=>({x:s.centre[g].x-s.dir[g].z*_,y:s.y[g]+f,z:s.centre[g].z+s.dir[g].x*_}),u=s.centre.map((g,_)=>_);if(!M){const g=l.SLEEPER_LENGTH_M/2+l.BALLAST_SHOULDER_M+(r[r.length-1]??0),_=u.map(x=>h(x,g,a+i)),f=u.map(x=>h(x,-g,a+i));if(n.ballast.strip(_,f),t.level===0){const x=g+a*l.BALLAST_SLOPE;for(const E of[1,-1]){const z=[],v=[];let m=!1;for(const L of u){const C=h(L,E*x,i),S=e(C.x,C.z)+i,T=C.y-S;T<0&&(C.y=Math.min(S,s.y[L]+a-.05+i)),z.push(C);const I=h(L,E*(x+Math.max(0,T)*l.BANK_SLOPE),i);I.y=Math.min(e(I.x,I.z)+i,C.y),C.y-I.y>.02&&(m=!0),v.push(I)}const D=E>0?_:f;E>0?n.ballast.strip(z,D):n.ballast.strip(D,z),m&&(E>0?n.earth.strip(v,z):n.earth.strip(z,v))}}else{const x=-l.DECK_DEPTH_M,E=g+.15,z=u.map(L=>h(L,E,a+i+.1)),v=u.map(L=>h(L,-E,a+i+.1)),m=u.map(L=>h(L,E,x)),D=u.map(L=>h(L,-E,x));n.deck.strip(m,z),n.deck.strip(v,D),n.deck.strip(D,m),n.deck.strip(z,u.map(L=>h(L,g,a+i+.1))),n.deck.strip(u.map(L=>h(L,-g,a+i+.1)),v)}}const p=t.service?n.wood:n.concrete,A=t.gaugeMm/2e3+l.RAIL_HEAD_M/2,d=M?l.TRAM_RAIL_HEIGHT_M:l.RAIL_HEIGHT_M,O=a+i;for(const g of r){if(!M){const _=l.SLEEPER_LENGTH_M/2;p.strip(u.map(f=>h(f,g+_,O+.004)),u.map(f=>h(f,g-_,O+.004)),s.along)}for(const _ of[1,-1]){const f=g+_*A,x=l.RAIL_HEAD_M/2,E=u.map(v=>h(v,f+x,O+d)),z=u.map(v=>h(v,f-x,O+d));n.head.strip(E,z),n.rust.strip(u.map(v=>h(v,f+x,O)),E),n.rust.strip(z,u.map(v=>h(v,f-x,O)))}}t.electrification==="overhead"&&t.kind!=="subway"&&t.kind!=="funicular"&&this.catenary(t,s,r,O+d,h,e,n)}catenary(t,s,e,n,o,c,r){const M=l.catenaryOf(t),a=s.along[s.along.length-1],i=Math.max(1,Math.round(a/M.spanM)),h=a/i,u=Array.from({length:i},(E,z)=>(z+.5)*h),p=n+M.contactM,A=p+M.systemM,d=(M.systemM>0?A:p)+l.MAST_ABOVE_M,O=e[e.length-1],g=e.length>2,_=e.length===1?[1]:[1,-1],f=(E,z,v)=>{let m=0,D=s.along.length-2;for(;m<D;){const T=m+D+1>>1;s.along[T]<=E?m=T:D=T-1}const L=Math.min(1,Math.max(0,(E-s.along[m])/Math.max(1e-6,s.along[m+1]-s.along[m]))),C=o(m,z,v),S=o(m+1,z,v);return{x:C.x+(S.x-C.x)*L,y:C.y+(S.y-C.y)*L,z:C.z+(S.z-C.z)*L}};for(const E of u){const z=f(E,0,p);if(!(t.level===0&&c(z.x,z.z)>z.y)){for(const v of _){const m=v*(O+l.MAST_OFFSET_M),D=f(E,m,0);t.level===0&&(D.y=Math.min(D.y,c(D.x,D.z)));const L=f(E,m,d);if(r.steel.beam(D,L,l.MAST_SIDE_M),g)continue;const S=(_.length===1?e[0]:v*O)-v*.6,T=M.systemM>0?A:p+.3;r.steel.beam(f(E,m,T),f(E,S,T),l.ARM_SIDE_M),r.steel.beam(f(E,m,p-.4),f(E,S,T),l.ARM_SIDE_M)}if(g){const v=O+l.MAST_OFFSET_M;r.steel.beam(f(E,v,d-.2),f(E,-v,d-.2),l.MAST_SIDE_M*.8)}}}const x=[0,...u,a];for(const[E,z]of e.entries()){const v=m=>m===0||m===x.length-1?0:((m+E)%2===0?1:-1)*M.staggerM;for(let m=0;m<x.length-1;m++){const D=x[m],L=x[m+1];if(L-D<.1||(r.wire.beam(f(D,z+v(m),p),f(L,z+v(m+1),p),l.CONTACT_DIAMETER_M,!1),M.systemM<=0))continue;const C=4,S=T=>{const I=m===0?.5+T/2:m===x.length-2?T/2:T;return A-l.MESSENGER_SAG_M*4*I*(1-I)};for(let T=0;T<C;T++){const I=T/C,G=(T+1)/C;r.wire.beam(f(D+(L-D)*I,z,S(I)),f(D+(L-D)*G,z,S(G)),l.MESSENGER_DIAMETER_M,!1)}}}}static meshOf(t,s){if(t.indices.length===0)return;const e=new w;return e.setAttribute("position",new N(new Float32Array(t.positions),3)),t.along.length>0&&e.setAttribute("aAlong",new N(new Float32Array(t.along),1)),e.setIndex(new N(new Uint32Array(t.indices),1)),e.computeVertexNormals(),new U(e,s)}static lambert(t,s){return new k({color:new H(...t),...s?{polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2}:{}})}static pebbled(t){return t.onBeforeCompile=s=>{s.vertexShader=s.vertexShader.replace("#include <common>",`#include <common>
|
|
1
|
+
import{am as F,ar as P,aU as H,n as K,aD as w,aE as N,ap as U,bg as k}from"./rr0-sighting-editor.mjs";class b{static HOLLOW_M=1;static COVERED_M=3;static WINDOW_M=30;static SAMPLE_M=4;static MAX_GRADE={rail:.025,highSpeed:.035,subway:.04,light_rail:.06,tram:.08,funicular:1/0};static heights(t,s,e){const n=t.map(a=>a.level===0),o=t.map((a,i)=>n[i]?b.targets(a,s,e):[]),c=t.map((a,i)=>n[i]?b.samples(a,o[i]):[]),r=new Map;t.forEach((a,i)=>{if(n[i])for(const h of b.ends(a)){const u=b.key(h),p=r.get(u);p?p.push(i):r.set(u,[i])}});const M=a=>{const i=r.get(b.key(a));if(i)return b.median(i.flatMap(h=>c[h]),a)};return t.map((a,i)=>{if(n[i]){const h=[...new Set([i,...b.ends(a).flatMap(d=>r.get(b.key(d))??[])])].flatMap(d=>c[d]),u=a.centre.map((d,O)=>b.median(h,d)??o[i][O]),[p,A]=b.ends(a);return u[0]=M(p)??u[0],u[u.length-1]=M(A)??u[u.length-1],b.graded(u,a.along,a.highSpeed?b.MAX_GRADE.highSpeed:b.MAX_GRADE[a.kind])}return b.carried(a,s,e,M)})}static targets(t,s,e){return t.centre.map(n=>{const o=s(n.x,n.z);if(e===void 0||n.altitudeM===void 0)return o;const c=n.altitudeM+e;return c-o>b.HOLLOW_M||o-c>b.COVERED_M?c:o})}static samples(t,s){const e=[];let n=0;return t.centre.forEach((o,c)=>{t.along[c]+1e-6<n&&c<t.centre.length-1||(e.push({x:o.x,z:o.z,y:s[c]}),n=t.along[c]+b.SAMPLE_M)}),e}static median(t,s){const e=[];for(const o of t)Math.hypot(o.x-s.x,o.z-s.z)<=b.WINDOW_M&&e.push(o.y);if(e.length===0)return;e.sort((o,c)=>o-c);const n=e.length>>1;return e.length%2===1?e[n]:(e[n-1]+e[n])/2}static graded(t,s,e){if(!Number.isFinite(e)||t.length<3)return t;const n=[...t],o=n.length-1,c=s[o];if(Math.abs(n[o]-n[0])>e*c)return s.map(r=>n[0]+(n[o]-n[0])*r/c);for(let r=1;r<o;r++){const M=e*(s[r]-s[r-1]);n[r]=Math.min(n[r-1]+M,Math.max(n[r-1]-M,n[r]))}for(let r=o-1;r>0;r--){const M=e*(s[r+1]-s[r]);n[r]=Math.min(n[r+1]+M,Math.max(n[r+1]-M,n[r]))}return n}static carried(t,s,e,n){const[o,c]=b.ends(t),r=t.along[t.along.length-1],M=n(o),a=n(c);if(e!==void 0&&t.centre.every(u=>u.altitudeM!==void 0)){const u=t.centre.map(d=>d.altitudeM+e),p=M!==void 0?M-u[0]:0,A=a!==void 0?a-u[u.length-1]:0;return u.map((d,O)=>d+p+(A-p)*t.along[O]/r)}const i=M??s(o.x,o.z),h=a??s(c.x,c.z);return t.along.map(u=>i+(h-i)*u/r)}static ends(t){return[t.centre[0],t.centre[t.centre.length-1]]}static key(t){return`${Math.round(t.x*2)},${Math.round(t.z*2)}`}}class B{positions=[];indices=[];along=[];get vertexCount(){return this.positions.length/3}strip(t,s,e){const n=this.vertexCount;for(let o=0;o<t.length;o++)this.positions.push(t[o].x,t[o].y,t[o].z,s[o].x,s[o].y,s[o].z),e&&this.along.push(e[o],e[o]);for(let o=0;o<t.length-1;o++){const c=n+o*2;this.indices.push(c,c+2,c+1,c+1,c+2,c+3)}}beam(t,s,e,n=!0){const o=s.x-t.x,c=s.y-t.y,r=s.z-t.z,M=Math.hypot(o,c,r);if(M<1e-6)return;const a={x:o/M,y:c/M,z:r/M},i=Math.abs(a.y)>.9?{x:1,y:0,z:0}:{x:0,y:1,z:0},h=a.y*i.z-a.z*i.y,u=a.z*i.x-a.x*i.z,p=a.x*i.y-a.y*i.x,A=Math.hypot(h,u,p),d={x:h/A*e/2,y:u/A*e/2,z:p/A*e/2},O={x:a.y*d.z-a.z*d.y,y:a.z*d.x-a.x*d.z,z:a.x*d.y-a.y*d.x},g=(f,x,E)=>({x:f.x+d.x*x+O.x*E,y:f.y+d.y*x+O.y*E,z:f.z+d.z*x+O.z*E}),_=[[1,1],[-1,1],[-1,-1],[1,-1]];for(let f=0;f<4;f++){const[x,E]=_[f],[z,v]=_[(f+1)%4];this.quad(g(t,x,E),g(t,z,v),g(s,z,v),g(s,x,E))}n&&(this.quad(...[..._].reverse().map(([f,x])=>g(t,f,x))),this.quad(..._.map(([f,x])=>g(s,f,x))))}quad(t,s,e,n){const o=this.vertexCount;this.positions.push(t.x,t.y,t.z,s.x,s.y,s.z,e.x,e.y,e.z,n.x,n.y,n.z),this.indices.push(o,o+1,o+2,o,o+2,o+3)}}class l{static STEP_M=6;static BALLAST_HEIGHT_M=.5;static BALLAST_SLOPE=1.5;static BALLAST_SHOULDER_M=.45;static DECK_DEPTH_M=.8;static BANK_SLOPE=1.5;static SLEEPER_LENGTH_M=2.4;static SLEEPER_WIDTH_M=.29;static SLEEPER_SPACING_M=.6;static RAIL_HEAD_M=.072;static RAIL_HEIGHT_M=.18;static TRAM_RAIL_HEIGHT_M=.03;static LIFT_M=.06;static CATENARY={rail:{contactM:5.5,systemM:1.4,spanM:54,staggerM:.2},highSpeed:{contactM:5.08,systemM:1.4,spanM:63,staggerM:.2},service:{contactM:5.5,systemM:1.2,spanM:45,staggerM:.2},tram:{contactM:6,systemM:0,spanM:30,staggerM:.2}};static MESSENGER_SAG_M=.55;static MAST_SIDE_M=.26;static MAST_OFFSET_M=3.1;static MAST_ABOVE_M=.6;static CONTACT_DIAMETER_M=.012;static MESSENGER_DIAMETER_M=.011;static ARM_SIDE_M=.06;static TRACK_SPACING_M={rail:3.7,highSpeed:4.5,tram:3.1,subway:3.4,light_rail:3.4,funicular:3.2};static BALLAST_ALBEDO=[.17,.16,.15];static BANK_ALBEDO=[.085,.09,.05];static DECK_ALBEDO=[.26,.255,.24];static CONCRETE_ALBEDO=[.36,.35,.33];static WOOD_ALBEDO=[.07,.055,.045];static RUST_ALBEDO=[.085,.068,.058];static STEEL_ALBEDO=[.3,.31,.32];static COPPER_ALBEDO=[.09,.085,.07];static LINE_REACH_M=20;group=new F;stepM=l.STEP_M;drawn=0;laid=[];ballastMaterial=l.pebbled(l.lambert(l.BALLAST_ALBEDO,!0));earthMaterial=l.lambert(l.BANK_ALBEDO,!0);deckMaterial=l.lambert(l.DECK_ALBEDO,!1);concreteSleepers=l.sleeperMaterial(l.CONCRETE_ALBEDO);woodSleepers=l.sleeperMaterial(l.WOOD_ALBEDO);rustMaterial=l.lambert(l.RUST_ALBEDO,!0);headMaterial=new P({color:new H(.62,.62,.62),metalness:1,roughness:.28,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2});steelMaterial=l.lambert(l.STEEL_ALBEDO,!1);wireMaterial=l.lambert(l.COPPER_ALBEDO,!1);constructor(){this.group.name="railways"}get count(){return this.drawn}setGroundSpacing(t){this.stepM=Number.isFinite(t)&&t>0?Math.min(l.STEP_M,Math.max(1.5,t/2)):l.STEP_M}set(t,s,e,n,o=1/0){this.clear();const r=t.map(p=>({line:p,path:p.points.map(A=>({...K(A.lat,A.lng,s,e),altitudeM:A.altitudeM}))})).filter(({line:p,path:A})=>p.level>=0&&l.within(A,o)),M=l.altitudeOffset(r,n),a=r.flatMap(({line:p,path:A})=>{const d=this.layoutOf(p,A);return d?[{line:p,layout:d}]:[]}),i=b.heights(a.map(({layout:p})=>p),n,M),h={ballast:new B,earth:new B,deck:new B,concrete:new B,wood:new B,rust:new B,head:new B,steel:new B,wire:new B};a.forEach(({line:p,layout:A},d)=>{this.lay(p,{...A,y:i[d]},n,h),this.laid.push({line:p,centre:A.centre}),this.drawn++});const u=[[h.ballast,this.ballastMaterial,"ballast",!1],[h.earth,this.earthMaterial,"embankments",!1],[h.deck,this.deckMaterial,"decks",!0],[h.concrete,this.concreteSleepers,"sleepers",!1],[h.wood,this.woodSleepers,"sleepers wood",!1],[h.rust,this.rustMaterial,"rails",!1],[h.head,this.headMaterial,"rail heads",!1],[h.steel,this.steelMaterial,"catenary masts",!0],[h.wire,this.wireMaterial,"catenary wires",!1]];for(const[p,A,d,O]of u){const g=l.meshOf(p,A);g&&(g.name=`railways ${d}`,g.castShadow=O,g.receiveShadow=!0,this.group.add(g))}}clear(){for(const t of[...this.group.children])this.group.remove(t),t.geometry?.dispose();this.drawn=0,this.laid=[]}lineAt(t,s){let e;for(const{line:n,centre:o}of this.laid)for(let c=0;c<o.length-1;c++){const r=o[c],M=o[c+1],a=M.x-r.x,i=M.z-r.z,h=a*a+i*i,u=h===0?0:Math.max(0,Math.min(1,((t-r.x)*a+(s-r.z)*i)/h)),p=Math.hypot(t-(r.x+a*u),s-(r.z+i*u));p<=l.LINE_REACH_M&&(!e||p<e.distance)&&(e={line:n,distance:p})}return e?.line}mayMeet(t,s,e,n){const o=Math.hypot(s.x,s.z);if(o<1e-6)return this.lineAt(t.x,t.z)!==void 0;const c=s.x/o,r=s.z/o,M=l.LINE_REACH_M;for(const{centre:a}of this.laid)for(let i=0;i<a.length-1;i++){const h=a[i],u=a[i+1];for(const p of[0,.5,1]){const A=h.x+(u.x-h.x)*p,d=h.z+(u.z-h.z)*p,O=(A-t.x)*c+(d-t.z)*r;if(O<0)continue;const g=Math.abs((A-t.x)*r-(d-t.z)*c),_=Math.hypot(u.x-h.x,u.z-h.z)/2;if(g>M+_)continue;if(t.y+s.y*(O/o)<=e(A,d)+n)return!0}}return!1}contactHeightM(t){if(!(t.electrification!=="overhead"||t.kind==="subway"||t.kind==="funicular"))return l.catenaryOf(t).contactM}static catenaryOf(t){return t.kind==="tram"?l.CATENARY.tram:t.highSpeed?l.CATENARY.highSpeed:t.service?l.CATENARY.service:l.CATENARY.rail}dispose(){this.clear();for(const t of[this.ballastMaterial,this.earthMaterial,this.deckMaterial,this.concreteSleepers,this.woodSleepers,this.rustMaterial,this.headMaterial,this.steelMaterial,this.wireMaterial])t.dispose()}static within(t,s){if(!Number.isFinite(s))return!0;const e=s*1.1+100;return t.some((n,o)=>Math.hypot(n.x,n.z)<=e||o>0&&Math.hypot((n.x+t[o-1].x)/2,(n.z+t[o-1].z)/2)<=e)}static altitudeOffset(t,s){const e=[];for(const{line:n,path:o}of t)if(n.level===0)for(const c of o)c.altitudeM!==void 0&&e.push(s(c.x,c.z)-c.altitudeM);if(!(e.length<5))return e.sort((n,o)=>n-o),e[Math.floor(e.length/2)]}layoutOf(t,s){const e=[];for(let c=0;c<s.length-1;c++){const r=s[c],M=s[c+1],a=Math.max(1,Math.ceil(Math.hypot(M.x-r.x,M.z-r.z)/this.stepM));for(let i=0;i<a;i++){const h=i/a,u=r.altitudeM!==void 0&&M.altitudeM!==void 0?r.altitudeM+(M.altitudeM-r.altitudeM)*h:void 0;e.push({x:r.x+(M.x-r.x)*h,z:r.z+(M.z-r.z)*h,altitudeM:u})}}if(e.push(s[s.length-1]),e.length<2)return;const n=[0];for(let c=1;c<e.length;c++)n.push(n[c-1]+Math.hypot(e[c].x-e[c-1].x,e[c].z-e[c-1].z));if(n[n.length-1]<.5)return;const o=e.map((c,r)=>{const M=e[Math.max(0,r-1)],a=e[Math.min(e.length-1,r+1)],i=a.x-M.x,h=a.z-M.z,u=Math.hypot(i,h);return u<1e-6?{x:1,z:0}:{x:i/u,z:h/u}});return{kind:t.kind,...t.highSpeed?{highSpeed:!0}:{},level:t.level,centre:e,along:n,dir:o}}lay(t,s,e,n){const o=t.highSpeed?l.TRACK_SPACING_M.highSpeed:l.TRACK_SPACING_M[t.kind],c=Math.min(8,Math.max(1,t.tracks)),r=Array.from({length:c},(g,_)=>(_-(c-1)/2)*o),M=t.kind==="tram",a=M?0:l.BALLAST_HEIGHT_M,i=l.LIFT_M,h=(g,_,f)=>({x:s.centre[g].x-s.dir[g].z*_,y:s.y[g]+f,z:s.centre[g].z+s.dir[g].x*_}),u=s.centre.map((g,_)=>_);if(!M){const g=l.SLEEPER_LENGTH_M/2+l.BALLAST_SHOULDER_M+(r[r.length-1]??0),_=u.map(x=>h(x,g,a+i)),f=u.map(x=>h(x,-g,a+i));if(n.ballast.strip(_,f),t.level===0){const x=g+a*l.BALLAST_SLOPE;for(const E of[1,-1]){const z=[],v=[];let m=!1;for(const L of u){const C=h(L,E*x,i),S=e(C.x,C.z)+i,T=C.y-S;T<0&&(C.y=Math.min(S,s.y[L]+a-.05+i)),z.push(C);const I=h(L,E*(x+Math.max(0,T)*l.BANK_SLOPE),i);I.y=Math.min(e(I.x,I.z)+i,C.y),C.y-I.y>.02&&(m=!0),v.push(I)}const D=E>0?_:f;E>0?n.ballast.strip(z,D):n.ballast.strip(D,z),m&&(E>0?n.earth.strip(v,z):n.earth.strip(z,v))}}else{const x=-l.DECK_DEPTH_M,E=g+.15,z=u.map(L=>h(L,E,a+i+.1)),v=u.map(L=>h(L,-E,a+i+.1)),m=u.map(L=>h(L,E,x)),D=u.map(L=>h(L,-E,x));n.deck.strip(m,z),n.deck.strip(v,D),n.deck.strip(D,m),n.deck.strip(z,u.map(L=>h(L,g,a+i+.1))),n.deck.strip(u.map(L=>h(L,-g,a+i+.1)),v)}}const p=t.service?n.wood:n.concrete,A=t.gaugeMm/2e3+l.RAIL_HEAD_M/2,d=M?l.TRAM_RAIL_HEIGHT_M:l.RAIL_HEIGHT_M,O=a+i;for(const g of r){if(!M){const _=l.SLEEPER_LENGTH_M/2;p.strip(u.map(f=>h(f,g+_,O+.004)),u.map(f=>h(f,g-_,O+.004)),s.along)}for(const _ of[1,-1]){const f=g+_*A,x=l.RAIL_HEAD_M/2,E=u.map(v=>h(v,f+x,O+d)),z=u.map(v=>h(v,f-x,O+d));n.head.strip(E,z),n.rust.strip(u.map(v=>h(v,f+x,O)),E),n.rust.strip(z,u.map(v=>h(v,f-x,O)))}}t.electrification==="overhead"&&t.kind!=="subway"&&t.kind!=="funicular"&&this.catenary(t,s,r,O+d,h,e,n)}catenary(t,s,e,n,o,c,r){const M=l.catenaryOf(t),a=s.along[s.along.length-1],i=Math.max(1,Math.round(a/M.spanM)),h=a/i,u=Array.from({length:i},(E,z)=>(z+.5)*h),p=n+M.contactM,A=p+M.systemM,d=(M.systemM>0?A:p)+l.MAST_ABOVE_M,O=e[e.length-1],g=e.length>2,_=e.length===1?[1]:[1,-1],f=(E,z,v)=>{let m=0,D=s.along.length-2;for(;m<D;){const T=m+D+1>>1;s.along[T]<=E?m=T:D=T-1}const L=Math.min(1,Math.max(0,(E-s.along[m])/Math.max(1e-6,s.along[m+1]-s.along[m]))),C=o(m,z,v),S=o(m+1,z,v);return{x:C.x+(S.x-C.x)*L,y:C.y+(S.y-C.y)*L,z:C.z+(S.z-C.z)*L}};for(const E of u){const z=f(E,0,p);if(!(t.level===0&&c(z.x,z.z)>z.y)){for(const v of _){const m=v*(O+l.MAST_OFFSET_M),D=f(E,m,0);t.level===0&&(D.y=Math.min(D.y,c(D.x,D.z)));const L=f(E,m,d);if(r.steel.beam(D,L,l.MAST_SIDE_M),g)continue;const S=(_.length===1?e[0]:v*O)-v*.6,T=M.systemM>0?A:p+.3;r.steel.beam(f(E,m,T),f(E,S,T),l.ARM_SIDE_M),r.steel.beam(f(E,m,p-.4),f(E,S,T),l.ARM_SIDE_M)}if(g){const v=O+l.MAST_OFFSET_M;r.steel.beam(f(E,v,d-.2),f(E,-v,d-.2),l.MAST_SIDE_M*.8)}}}const x=[0,...u,a];for(const[E,z]of e.entries()){const v=m=>m===0||m===x.length-1?0:((m+E)%2===0?1:-1)*M.staggerM;for(let m=0;m<x.length-1;m++){const D=x[m],L=x[m+1];if(L-D<.1||(r.wire.beam(f(D,z+v(m),p),f(L,z+v(m+1),p),l.CONTACT_DIAMETER_M,!1),M.systemM<=0))continue;const C=4,S=T=>{const I=m===0?.5+T/2:m===x.length-2?T/2:T;return A-l.MESSENGER_SAG_M*4*I*(1-I)};for(let T=0;T<C;T++){const I=T/C,G=(T+1)/C;r.wire.beam(f(D+(L-D)*I,z,S(I)),f(D+(L-D)*G,z,S(G)),l.MESSENGER_DIAMETER_M,!1)}}}}static meshOf(t,s){if(t.indices.length===0)return;const e=new w;return e.setAttribute("position",new N(new Float32Array(t.positions),3)),t.along.length>0&&e.setAttribute("aAlong",new N(new Float32Array(t.along),1)),e.setIndex(new N(new Uint32Array(t.indices),1)),e.computeVertexNormals(),new U(e,s)}static lambert(t,s){return new k({color:new H(...t),...s?{polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2}:{}})}static pebbled(t){return t.onBeforeCompile=s=>{s.vertexShader=s.vertexShader.replace("#include <common>",`#include <common>
|
|
2
2
|
varying vec3 vBallast;`).replace("#include <begin_vertex>",`#include <begin_vertex>
|
|
3
3
|
vBallast = position;`),s.fragmentShader=s.fragmentShader.replace("#include <common>",`#include <common>
|
|
4
4
|
varying vec3 vBallast;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{o as w,_ as A,ac as b,aY as M,aZ as E,a_ as C,a$ as O,b0 as F,b1 as S,a1 as x,a3 as D,a2 as N,c as k,$ as _,a0 as P,b2 as L,N as G,aK as H}from"./rr0-sighting-editor.mjs";import{S as K}from"./SkyEventEditorStyle-CvY_AhbI.js";const z=w.catalog({en:()=>A(()=>import("./ReentryParameterTexts_en-5BOfwCsS.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_en),fr:()=>A(()=>import("./ReentryParameterTexts_fr-BgUJROXF.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_fr),es:()=>A(()=>import("./ReentryParameterTexts_es-ze1-U4jB.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_es),it:()=>A(()=>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 s=Math.PI/180,o=g.EARTH_KM,a=n*s,r=-o*Math.sin(a)+Math.sqrt((o*Math.sin(a))**2+(o+i)**2-o**2),d=Math.atan2(r*Math.cos(a),o+r*Math.sin(a)),c=t.lat*s,l=e*s,h=Math.asin(Math.sin(c)*Math.cos(d)+Math.cos(c)*Math.sin(d)*Math.cos(l)),m=t.lng*s+Math.atan2(Math.sin(l)*Math.sin(d)*Math.cos(c),Math.cos(d)-Math.sin(c)*Math.sin(h));return{lat:h/s,lng:(m/s+540)%360-180}}static trackFromSeen(t,e){const n=t.seen,{fromAzimuthDeg:i,fromAltitudeDeg:s,toAzimuthDeg:o,toAltitudeDeg:a,durationS:r}=n??{};if(i===void 0||s===void 0||o===void 0||a===void 0||!r)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,s,h),altitudeKm:h},{t:l+Math.round(r*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,[s,o]=e<(i[0]?.t??0)?[i[0],i[1]]:[i[i.length-2],i[i.length-1]];if(!s||!o||o.t===s.t){const r=s??o??{lat:0,lng:0,altitudeKm:80};return{t:e,lat:r.lat,lng:r.lng,altitudeKm:r.altitudeKm}}const a=(e-s.t)/(o.t-s.t);return{t:e,lat:s.lat+(o.lat-s.lat)*a,lng:s.lng+(o.lng-s.lng)*a,altitudeKm:Math.max(0,s.altitudeKm+(o.altitudeKm-s.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:()=>A(()=>import("./ReentryEditorMessages_en-BmTZMr-m.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_en),fr:()=>A(()=>import("./ReentryEditorMessages_fr-DHbcY0tN.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_fr),es:()=>A(()=>import("./ReentryEditorMessages_es-edid__Jo.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_es),it:()=>A(()=>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 C,reentries:new E};static viewOf(t,e,n){const i=t.track;if(i.length<2)return;const s=i[0],o=i[i.length-1],a=t.seen,r=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}:r(s),c=a?.toAzimuthDeg!==void 0&&a.toAltitudeDeg!==void 0?{azimuthDeg:a.toAzimuthDeg,altitudeDeg:a.toAltitudeDeg}:r(o),l=a?.durationS??(o.t-s.t)/1e3,h=Math.min(...t.fragments.flatMap(m=>[m.absoluteMagnitude,...(m.lightCurve??[]).map(f=>f.absoluteMagnitude)]));return{startMs:e.getTime()+s.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,s=e.t>t.startMs?e.t-t.startMs:0;if(Math.max(i,s)>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 r=Math.max(u.azimuthOff(t.from.azimuthDeg,o.azimuthDeg),u.azimuthOff(t.to.azimuthDeg,a.azimuthDeg));if(r>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+s)/6e4),headingOffDeg:Math.round(r),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 s=u.viewOf(t,e,n);if(!s)return[{verdict:"unchecked",source:"none",reason:"noDateOrPlace"}];const o=M.of(t.type)?.nature,a=[];if(o!=="artificial"&&a.push(...await u.checkFireballs(s,n,o==="natural",i)),o!=="artificial"){const r=u.showerOf(s,n);r&&(r.verdict==="compatible"||o==="natural")&&a.push(r)}return o!=="natural"&&a.push(...await u.checkCatalogue(t,s,n,o==="artificial",i)),o===void 0&&!a.some(r=>r.verdict==="known"||r.verdict==="possible"||r.verdict==="compatible")?[...a.filter(r=>r.verdict==="unchecked"),{verdict:"uninformative",source:"none",reason:"typeUnknown"}]:a}static vectorOf(t,e){const n=Math.PI/180,i=e*n,s=t*n;return[Math.cos(i)*Math.sin(s),Math.cos(i)*Math.cos(s),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),s=u.angleDeg(n,i);if(s<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]),r=new Date(t.startMs),d=O.activeAt(r);let c;for(const{shower:l,zhr:h}of d){const m=O.radiantPosition(l,r,{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),I=u.angleDeg(f,i);y>=I||I<=s||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 s=u.TIME_MARGIN_MIN*6e4;if(!C.mayCover(t.startMs))return n?[{verdict:"uninformative",source:"gmn",reason:"beforeArchive"}]:[];const o=await i.fireballs.between(t.startMs-s,t.startMs+s+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(F("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 r=new Date(t.startMs),d=Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),1),c=Date.UTC(r.getUTCFullYear(),r.getUTCMonth()+1,1)-1,h=(await i.fireballs.between(d,c)??[]).filter(m=>E.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,s){if(e.startMs<u.FIRST_ORBIT_MS)return i?[{verdict:"impossible",source:"catalogue"}]:[];const o=u.TIME_MARGIN_MIN*6e4,a=await s.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 r=t.object,d=r&&a.find(l=>r.cosparId&&l.record.cosparId===r.cosparId||r.norad!==void 0&&l.record.norad===r.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,K.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,,s]=await Promise.all([$.load(t),z.load(t),M.load(t),S(t).catch(()=>{})]);e===this.languageToken&&(this.sceneNames=s,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 x(this.element("reentry-parameters"),this.language,"reentry.",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(this.resolved(g.SET),new D(()=>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 s=this.origin(),o=s&&g.trackFromSeen(i,s);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 N.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
|
+
<p class="launch-intro">${t.intro}</p>
|
|
3
|
+
<div id="reentry-list"></div>
|
|
4
|
+
<div id="reentry-fields" class="launch-fields">
|
|
5
|
+
<div id="reentry-parameters" class="launch-parameters"></div>
|
|
6
|
+
<div id="reentry-evidence" class="launch-intro reentry-evidence" aria-live="polite"></div>
|
|
7
|
+
<div id="reentry-timeline"></div>
|
|
8
|
+
<button id="reentry-fragment-add" type="button" title="${t.addFragment}">${k.PLUS} ${t.fragment}</button>
|
|
9
|
+
<p class="launch-intro">${t.timelineNote}</p>
|
|
10
|
+
<fieldset id="reentry-path" class="launch-path">
|
|
11
|
+
<legend>${t.path}</legend>
|
|
12
|
+
<div id="reentry-place-parameters" class="launch-parameters"></div>
|
|
13
|
+
<button id="reentry-place-delete" class="icon-btn" type="button" title="${t.deletePlace}" aria-label="${t.deletePlace}">${k.TRASH}</button>
|
|
14
|
+
</fieldset>
|
|
15
|
+
<fieldset id="reentry-fragments" class="launch-path">
|
|
16
|
+
<legend id="reentry-fragment-legend">${t.fragment}</legend>
|
|
17
|
+
<div id="reentry-fragment-parameters" class="launch-parameters"></div>
|
|
18
|
+
<button id="reentry-fragment-delete" class="icon-btn" type="button" title="${t.deleteFragment}" aria-label="${t.deleteFragment}">${k.TRASH}</button>
|
|
19
|
+
<fieldset id="reentry-curve" class="launch-path">
|
|
20
|
+
<legend>${t.curve}</legend>
|
|
21
|
+
<p id="reentry-curve-empty" class="launch-intro">${t.noCurve}</p>
|
|
22
|
+
<div id="reentry-curve-parameters" class="launch-parameters"></div>
|
|
23
|
+
<button id="reentry-curve-delete" class="icon-btn" type="button" title="${t.deleteCurvePoint}" aria-label="${t.deleteCurvePoint}">${k.TRASH}</button>
|
|
24
|
+
</fieldset>
|
|
25
|
+
</fieldset>
|
|
26
|
+
<p class="launch-intro">${t.derivedNote}</p>
|
|
27
|
+
</div>
|
|
28
|
+
</div>`,this.list=new _({header:this.element("reentry-list"),body:this.element("reentry-fields"),ids:{list:"reentry-select",remove:"reentry-delete",add:"reentry-add",kinds:"reentry-add-kind",kind:e=>`reentry-add-${e}`},onSelect:e=>this.show(e),onAdd:e=>{e&&this.addReentry(e)},onRemove:()=>this.deleteCurrent(),actions:this.host.pointAt?[{id:"reentry-point",glyph:"🎯",onClick:()=>this.pointAtCurrent()}]:[]}),this.list.setLabels({list:t.reentry,remove:t.deleteReentry,add:t.addReentry,empty:t.none,actions:{"reentry-point":t.pointAtReentry}}),this.timeline=new P(this.element("reentry-timeline"),e=>this.host.seekTo(e),{addKeyframeHere:t.addPointHere,keyframeHere:t.pointHere,zoomHint:t.zoomHint}),this.element("reentry-place-delete").addEventListener("click",()=>this.removePlace()),this.element("reentry-curve-delete").addEventListener("click",()=>this.removeCurvePoint()),this.placeForm=void 0,this.element("reentry-fragment-add").addEventListener("click",()=>this.addFragment()),this.element("reentry-fragment-delete").addEventListener("click",()=>this.removeFragment()),this.fragmentForm=void 0,this.curveForm=void 0}written(){const t=this.current;t&&this.list?.rename(t.id,this.labelOf(t)),t?.seen&&this.syncPlace(!0),this.syncEvidence()}sceneNames;evidenceTimer;evidenceFor;syncEvidence(){const t=this.current,e=this.element("reentry-evidence");if(clearTimeout(this.evidenceTimer),!t)return;const n=this.host.sighting(),i=n.event?.place?.[0],s=i?.lng!==void 0&&n.event?.time?L(n.event.time,i.lng,n.event.utcOffsetHours):void 0,o=i?.lat!==void 0&&i.lng!==void 0?{lat:i.lat,lng:i.lng,heightM:0}:void 0,a={reentry:t,at:s?.getTime(),lat:o?.lat,lng:o?.lng},r=this.evidenceFor;r&&r.reentry===a.reentry&&r.at===a.at&&r.lat===a.lat&&r.lng===a.lng||(this.evidenceFor=a,e.textContent=`${this.messages.evidence} — ${this.messages.evidenceChecking}`,this.evidenceTimer=setTimeout(()=>{u.check(t,s,o).then(d=>{if(this.evidenceFor!==a)return;const c=this.messages,l=c.margins.replace("{minutes}",String(u.TIME_MARGIN_MIN)).replace("{heading}",String(u.HEADING_MARGIN_DEG)).replace("{factor}",String(u.DURATION_FACTOR)),h=document.createElement("strong");h.textContent=c.evidence;const m=d.map(p=>{const y=document.createElement("span");return y.className=`evidence-${p.verdict}`,y.textContent=this.findingText(p),y}),f=document.createElement("small");f.textContent=l,e.replaceChildren(h,...m.flatMap(p=>[document.createElement("br"),p]),document.createElement("br"),f)},()=>{this.evidenceFor===a&&(e.textContent="")})},400))}findingText(t){const e=this.messages,n=this.language,i=r=>new Intl.DateTimeFormat(n,{dateStyle:"medium",timeStyle:"short",timeZone:"UTC"}).format(r)+" UTC",s=r=>new Intl.DateTimeFormat(n,{dateStyle:"long",timeZone:"UTC"}).format(r),o=r=>r.toLocaleString(n,{maximumFractionDigits:1}),a=(r,d)=>Object.entries(d).reduce((c,[l,h])=>c.replaceAll(`{${l}}`,h===void 0?"?":String(h)),r);switch(t.verdict){case"known":if(t.source==="gmn"){const{record:r,offsetMinutes:d,headingOffDeg:c}=t.match;return a(e.knownFireball,{id:r.id,time:i(r.t),offset:d,stations:r.stations,mag:o(r.peakMagnitude),heading:c})}else{const{record:r,timeMs:d,seenKm:c}=t.candidate,l={name:r.name,cospar:r.cosparId??r.norad,time:i(d),when:r.precision==="day"?s(d):i(d),place:r.seenFrom,km:c===void 0?void 0:Math.round(c)};return a(t.by==="object"?e.knownObject:e.knownSeen,l)}case"possible":{const{record:r,timeMs:d,seenKm:c,offsetMinutes:l}=t.candidate,h={name:r.name,cospar:r.cosparId??r.norad,time:i(d),day:s(d),hours:r.uncertaintyHours,place:r.seenFrom,km:c===void 0?void 0:Math.round(c),offset:l};return a(r.precision==="minute"?e.possibleSeen:r.precision==="hours"?e.possibleWindow:e.possibleDay,h)}case"expectedAbsent":return t.source==="gmn"?a(e.expectedFireball,{mag:o(t.absoluteMagnitude),count:t.watchedCount,km:u.WATCHED_KM}):e.expectedCatalogue;case"impossible":return e.impossibleOrbit;case"uninformative":return t.source==="none"?e.typeUnknown:t.reason==="faint"?e.faintFireball:t.reason==="beforeArchive"?e.beforeGmn:t.reason==="daylight"?e.daylightGmn:a(e.unwatchedGmn,{km:u.WATCHED_KM});case"compatible":return a(e.compatibleShower,{shower:this.sceneNames?.showers[t.showerId]??t.showerId,off:t.offDeg,zhr:t.zhr,margin:u.SHOWER_MARGIN_DEG});case"sporadic":return t.active===0?e.sporadicNoShower:a(e.sporadicShower,{count:t.active});case"unchecked":return t.reason==="noDateOrPlace"?e.noDateOrPlace:t.source==="gmn"?e.unreachableGmn:e.unreachableCatalogue}}syncTimeline(){const t=this.current;if(!this.timeline||!t)return;const e=this.messages,n=t.track[0]?.t??0,i=t.track[t.track.length-1]?.t??0,s={id:"path",label:e.path,color:T.PATH_COLOR,times:t.track.map(l=>l.t),active:this.row==="path",selectedTime:this.row==="path"?t.track[this.placeIndex]?.t:void 0,open:()=>this.selectPlace(this.placeIndex),pressed:(l,h)=>{const m=h===void 0?-1:(this.current?.track??[]).findIndex(f=>f.t===h);this.selectPlace(m>=0?m:this.placeIndex)},move:(l,h)=>this.movePlace(l,h),add:()=>this.addPlaceAt(this.host.currentTime())},o=t.fragments.map((l,h)=>{const m=l.lightCurve??[];return{id:`fragment-${h}`,label:this.fragmentLabel(l,h),color:T.PIECE_COLOR,times:m.map(f=>f.t),spans:[{t:l.fromT??n,until:l.untilT??i,label:""}],active:this.row==="fragment"&&h===this.fragmentIndex,selectedTime:this.row==="fragment"&&h===this.fragmentIndex?m[this.curveIndex]?.t:void 0,open:()=>this.selectFragment(h),pressed:(f,p)=>{const y=p===void 0?-1:(this.current?.fragments[h]?.lightCurve??[]).findIndex(I=>I.t===p);this.selectFragment(h,y>=0?y:void 0)},move:(f,p)=>this.moveCurvePoint(h,f,p),add:()=>this.addCurvePointAt(h,this.host.currentTime())}}),a=g.instantsOf(t),r=Math.min(...a),d=Math.max(...a),c=Math.max(500,(d-r)/10);this.timeline.show([s,...o],this.host.duration(),this.host.currentTime(),{from:r-c,to:d+c})}static PATH_COLOR="#e08a1e";static PIECE_COLOR="#c0581b";static MIN_PLACES=2;syncPlace(t=!1){const e=this.current?.track??[];this.placeIndex=Math.max(0,Math.min(this.placeIndex,e.length-1)),this.element("reentry-place-delete").disabled=e.length<=T.MIN_PLACES,this.placeForm?this.placeForm.sync(t):(this.placeForm=new x(this.element("reentry-place-parameters"),this.language,"reentryPlace."),this.placeForm.show(this.resolved(g.PLACE),new D(()=>this.current?.track[this.placeIndex],n=>this.editPlace(this.placeIndex,n),void 0,this.host.positionPlace?.()),()=>{})),this.syncTimeline()}selectPlace(t){this.row="path",this.placeIndex=t,this.syncDetail(),this.syncPlace(!0)}syncDetail(){this.element("reentry-path").hidden=this.row!=="path",this.element("reentry-fragments").hidden=this.row!=="fragment";const t=this.currentFragment;this.element("reentry-fragment-legend").textContent=t?`${this.messages.fragment} ${this.fragmentLabel(t,this.fragmentIndex)}`:this.messages.fragment}editPlace(t,e){let n;this.editReentry(i=>{n={...i.track[t]},e(n),i.track=i.track.map((s,o)=>o===t?n:s).sort((s,o)=>s.t-o.t)}),n&&(this.placeIndex=this.current?.track.indexOf(n)??0),this.syncPlace()}movePlace(t,e){const n=this.current?.track.findIndex(i=>i.t===t)??-1;n<0||(this.editPlace(n,i=>{i.t=e}),this.syncPlace(!0))}addPlaceAt(t){const e=this.current;if(!e)return;const n=e.track.findIndex(s=>Math.abs(s.t-t)<1);if(n>=0){this.selectPlace(n);return}const i=g.placeAt(e,t);this.editReentry(s=>{s.track=[...s.track,i].sort((o,a)=>o.t-a.t)}),this.selectPlace(this.current?.track.indexOf(i)??0)}removePlace(){if((this.current?.track.length??0)<=T.MIN_PLACES)return;const t=this.placeIndex;this.editReentry(e=>{e.track=e.track.filter((n,i)=>i!==t)}),this.syncPlace(!0)}static MIN_FRAGMENTS=1;fragmentLabel(t,e){return t.id??String(e+1)}syncFragments(t,e=!1){const n=t.fragments;this.fragmentIndex=Math.max(0,Math.min(this.fragmentIndex,n.length-1)),this.element("reentry-fragment-delete").disabled=n.length<=T.MIN_FRAGMENTS,this.syncDetail(),this.fragmentForm?this.fragmentForm.sync(e):(this.fragmentForm=new x(this.element("reentry-fragment-parameters"),this.language,"reentryFragment."),this.fragmentForm.show(this.resolved(g.FRAGMENT),new D(()=>this.currentFragment,i=>this.editFragment(s=>i(s)),()=>this.current),()=>{})),this.syncCurve(e)}selectFragment(t,e){const n=t!==this.fragmentIndex;this.row="fragment",this.fragmentIndex=t,e!==void 0?this.curveIndex=e:n&&(this.curveIndex=0),this.current&&this.syncFragments(this.current,!0)}get currentFragment(){return this.current?.fragments[this.fragmentIndex]}editFragment(t,e=this.fragmentIndex){this.editReentry(n=>{const i={...n.fragments[e]};i.lightCurve&&(i.lightCurve=[...i.lightCurve]),t(i),n.fragments=n.fragments.map((s,o)=>o===e?i:s)}),this.syncDetail(),this.syncTimeline()}addFragment(){const t=this.current;if(!t)return;const e=t.fragments[t.fragments.length-1];let n=t.fragments.length+1;for(;t.fragments.some(s=>s.id===`piece-${n}`);)n++;const i={id:`piece-${n}`,lagS:(e?.lagS??0)+1,absoluteMagnitude:(e?.absoluteMagnitude??-4)+1};this.editReentry(s=>{s.fragments=[...s.fragments,i]}),this.selectFragment((this.current?.fragments.length??1)-1)}removeFragment(){if((this.current?.fragments.length??0)<=T.MIN_FRAGMENTS)return;const t=this.fragmentIndex;this.editReentry(e=>{e.fragments=e.fragments.filter((n,i)=>i!==t)}),this.curveIndex=0,this.selectFragment(Math.min(t,(this.current?.fragments.length??1)-1))}syncCurve(t=!1){const e=this.currentFragment?.lightCurve??[];this.curveIndex=Math.max(0,Math.min(this.curveIndex,e.length-1)),this.element("reentry-curve-empty").hidden=e.length>0,this.element("reentry-curve-parameters").hidden=e.length===0,this.element("reentry-curve-delete").hidden=e.length===0,this.curveForm?this.curveForm.sync(t):(this.curveForm=new x(this.element("reentry-curve-parameters"),this.language,"reentryCurve."),this.curveForm.show(this.resolved(g.CURVE_POINT),new D(()=>this.currentFragment?.lightCurve?.[this.curveIndex],n=>this.editCurvePoint(this.fragmentIndex,this.curveIndex,n)),()=>{})),this.syncTimeline()}editCurvePoint(t,e,n){let i;this.editFragment(s=>{const o=s.lightCurve??[];i={...o[e]},n(i),s.lightCurve=o.map((a,r)=>r===e?i:a).sort((a,r)=>a.t-r.t)},t),i&&(this.curveIndex=this.current?.fragments[t]?.lightCurve?.indexOf(i)??0),this.syncCurve()}moveCurvePoint(t,e,n){const i=this.current?.fragments[t]?.lightCurve?.findIndex(s=>s.t===e)??-1;i<0||(this.fragmentIndex=t,this.editCurvePoint(t,i,s=>{s.t=n}),this.syncFragments(this.current,!0))}addCurvePointAt(t,e){const n=this.current?.fragments[t];if(!n)return;const i=(n.lightCurve??[]).findIndex(o=>Math.abs(o.t-e)<1);if(i>=0){this.selectFragment(t,i);return}const s=g.curvePointAt(n,e);this.editFragment(o=>{o.lightCurve=[...o.lightCurve??[],s].sort((a,r)=>a.t-r.t)},t),this.selectFragment(t,this.current?.fragments[t]?.lightCurve?.indexOf(s)??0)}removeCurvePoint(){if(!this.currentFragment?.lightCurve?.length)return;const t=this.curveIndex;this.editFragment(e=>{const n=(e.lightCurve??[]).filter((i,s)=>s!==t);n.length?e.lightCurve=n:delete e.lightCurve}),this.syncCurve(!0)}editReentry(t){const e=this.current;if(!e)return;const n={...e,track:[...e.track],fragments:[...e.fragments]};t(n),this.writeReentries(this.reentries.map(i=>i===e?n:i)),this.host.changed()}pointAtCurrent(){const t=this.current,e=t?.track;if(!t||!e||e.length<2||!this.host.pointAt)return;const n=e[0].t,i=e[e.length-1].t;let s=this.host.currentTime();(s<n||s>i)&&(s=Math.round(n+Math.min(1e3,(i-n)/2)),this.host.seekTo(s));const o=this.host.sighting(),a=G(o,s),r=o.event?.place?.[0],d=a?.lat??r?.lat,c=a?.lng??r?.lng,l=b.leadAt(t,s);if(d===void 0||c===void 0||!l)return;const h=b.seenFrom({lat:d,lng:c,heightM:a?.elevationM??0},l);this.host.pointAt(h.azimuthDeg,h.altitudeDeg)}origin(){const t=this.host.sighting(),e=t.event?.place?.[0];if(!(e?.lat===void 0||e.lng===void 0))return{lat:e.lat,lng:e.lng,headingRad:(t.observerTrack?.getInterpolatedPoseAt(0)?.headingDeg??0)*Math.PI/180}}newOf(t){const e=this.origin(),n=M.of(t);if(!e||!n)return;const{distanceKm:i,speedKmS:s,durationS:o,fromAltitudeKm:a,toAltitudeKm:r,fragments:d}=n.template,c=Math.round(this.host.currentTime()),l=Math.max(.05,Math.cos(e.lat*Math.PI/180)),h=(f,p)=>{const y=f*Math.cos(e.headingRad)-p*Math.sin(e.headingRad),I=f*Math.sin(e.headingRad)+p*Math.cos(e.headingRad);return{lat:e.lat+y/111.32,lng:e.lng+I/(111.32*l)}},m=s*o/2;return{type:t,track:[{t:c,...h(i,-m),altitudeKm:a},{t:c+o*1e3,...h(i,m),altitudeKm:r}],fragments:d.map(f=>({...f,...f.sheds?{sheds:[...f.sheds]}:{}}))}}addReentry(t){const e=this.newOf(t);if(!e)return;let n=this.reentries.length+1;for(;this.reentries.some(s=>s.id===`${t}-${n}`);)n++;const i={id:`${t}-${n}`,...e};this.writeReentries([...this.reentries,i]),this.host.changed(),this.show(i.id)}deleteCurrent(){const t=this.current;t&&(this.currentId=void 0,this.writeReentries(this.reentries.filter(e=>e!==t)),this.host.changed(),this.sync())}writeReentries(t){const e=this.host.sighting();e.skyEvents=H.written({...e.skyEvents,reentries:t})}labelOf(t){const e=this.host.said().read(t.title)||t.object?.name||(t.type===void 0?"":M.nameOf(t.type));return e?`${e} (${t.id})`:t.id}get reentries(){return this.host.sighting().skyEvents?.reentries??[]}element(t){return this.container.querySelector(`#${t}`)}}export{T as ReentryEditor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={intro:"An atmospheric re-entry seen while the recording runs: a meteor or a fireball, which came in by itself, or a satellite, a rocket stage or a capsule burning up. A fact of the sky, not a reading of the account. It is placed where it really was, latitude, longitude and height, and seen through the Earth's shape; its light lights the scene from there.",none:"No re-entry in this recording",reentry:"Re-entry",deleteReentry:"Delete it",pointAtReentry:"Point at it",addReentry:"Add a re-entry",path:"Path",deletePlace:"Remove this point",fragments:"Pieces",fragment:"Piece",addFragment:"Add a piece behind the last",deleteFragment:"Remove this piece",curve:"Light curve",deleteCurvePoint:"Remove this point",noCurve:'No light curve: its absolute magnitude stands throughout. The "+" of its row on the timeline adds a point at the playhead.',addNowhere:"Give the recording a place first: a re-entry is put in front of the witness",derivedNote:"An empty field shows, greyed, the value in use. Empty a field to go back to it. The smaller pieces each one sheds are set in the file.",timelineNote:`On the timeline, a diamond pressed is the point shown below, and the scene goes to its instant; drag it to move it in time. The "+" of a row puts a point at the playhead. The hatched parts are before the recording's start or after its end.`,addPointHere:"Add a point here, at the playhead",pointHere:"A point is at the playhead: press it to edit it",zoomHint:"Pinch, or Ctrl + wheel, to zoom; Shift + wheel to scroll",evidence:"In the sources",evidenceChecking:"Asking the sources…",knownFireball:"Known: fireball {id} of the Global Meteor Network, at {time} ({offset} min off), triangulated by {stations} stations, absolute magnitude {mag}: within a witness's errors of what is entered ({heading}° off in heading).",knownObject:"Known: {name} ({cospar}), the object it names, is in the satellite catalogue; re-entry: {when}.",knownSeen:"Known: {name} ({cospar}) was seen coming down at {time} from {place}, {km} km from here.",possibleSeen:"Possible: {name} ({cospar}) was seen coming down at {time} from {place}, {km} km from here, {offset} min off: more than a witness errs by.",possibleWindow:"Possible: {name} ({cospar}) came down within {hours} h of {time}, somewhere along its orbit: nothing says it crossed this sky.",possibleDay:"Possible: {name} ({cospar}) came down on {day}, somewhere along its orbit: nothing says it crossed this sky.",expectedFireball:"Expected in the sources, absent: a fireball of absolute magnitude {mag} at night here, where the Global Meteor Network recorded {count} fireballs that month within {km} km, would be in it, unless its cameras were under cloud.",expectedCatalogue:"Expected in the sources, absent: every catalogued object's re-entry is dated since 1957. An object that was not catalogued (secret, a small piece of debris), or not a re-entry.",impossibleOrbit:"Impossible: nothing was in orbit before 4 October 1957.",faintFireball:"Absence says nothing: no network records every meteor fainter than absolute magnitude −3.",beforeGmn:"Absence says nothing: the Global Meteor Network's records begin in December 2018.",unwatchedGmn:"Absence says nothing: the Global Meteor Network recorded next to nothing within {km} km that month; this sky is not watched.",daylightGmn:"Absence says nothing: the Global Meteor Network's cameras do not run by day.",typeUnknown:"Nothing known matches it; its type not being said, its absence says nothing.",unreachableGmn:"Not checked: the Global Meteor Network's records could not be reached.",unreachableCatalogue:"Not checked: the satellite catalogue could not be reached.",noDateOrPlace:"Not checked: the recording needs a date and a place.",compatibleShower:"Compatible with the {shower}: traced back, its path passes {off}° from their radiant (within {margin}°), a shower then at some {zhr} meteors an hour at best. One of its meteors perhaps, never surely: a sporadic may cross the same way.",sporadicShower:"Sporadic, as most meteors are: traced back, its path comes from none of the {count} showers active then.",sporadicNoShower:"Sporadic, as most meteors are: no shower was active then.",margins:"Within a witness's errors: ±{minutes} min, heading ±{heading}°, elevation overestimated, duration ×/÷{factor}."};export{e as reentryEditorMessages_en};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={intro:"Una reentrada atmosférica vista durante la grabación: un meteoro o un bólido, llegado por sí solo, o un satélite, una etapa de cohete o una cápsula que se consume. Un hecho del cielo, no una lectura del relato. Se sitúa donde estaba realmente, latitud, longitud y altura, y se ve a través de la forma de la Tierra; su luz ilumina la escena desde allí.",none:"Ninguna reentrada en esta grabación",reentry:"Reentrada",deleteReentry:"Eliminarlo",pointAtReentry:"Apuntarlo",addReentry:"Añadir una reentrada",path:"Trayecto",deletePlace:"Quitar este punto",fragments:"Piezas",fragment:"Pieza",addFragment:"Añadir una pieza detrás de la última",deleteFragment:"Quitar esta pieza",curve:"Curva de luz",deleteCurvePoint:"Quitar este punto",noCurve:"Sin curva de luz: su magnitud absoluta vale todo el tiempo. El «+» de su fila en la línea de tiempo añade un punto en el cabezal.",addNowhere:"Dé primero un lugar a la grabación: una reentrada se coloca delante del testigo",derivedNote:"Un campo vacío muestra, en gris, el valor usado. Vacíe un campo para volver a él. Los fragmentos más pequeños que suelta cada pieza se ajustan en el archivo.",timelineNote:"En la línea de tiempo, un rombo pulsado es el punto mostrado debajo, y la escena va a su instante; arrástrelo para moverlo en el tiempo. El «+» de una fila pone un punto en el cabezal. Las partes rayadas están antes del inicio de la grabación o después de su final.",addPointHere:"Añadir un punto aquí, en el cabezal",pointHere:"Hay un punto en el cabezal: púlselo para editarlo",zoomHint:"Pellizque, o Ctrl + rueda, para ampliar; Mayús + rueda para desplazar",evidence:"En las fuentes",evidenceChecking:"Consultando las fuentes…",knownFireball:"Conocido: el bólido {id} de la Global Meteor Network, a las {time} ({offset} min de diferencia), triangulado por {stations} estaciones, magnitud absoluta {mag}: dentro de los errores de un testigo respecto a lo introducido ({heading}° de diferencia de rumbo).",knownObject:"Conocido: {name} ({cospar}), el objeto que nombra, está en el catálogo de satélites; reentrada: {when}.",knownSeen:"Conocido: {name} ({cospar}) se vio reentrar a las {time} desde {place}, a {km} km de aquí.",possibleSeen:"Posible: {name} ({cospar}) se vio reentrar a las {time} desde {place}, a {km} km de aquí, con {offset} min de diferencia: más de lo que yerra un testigo.",possibleWindow:"Posible: {name} ({cospar}) reentró con {hours} h de margen en torno a las {time}, en algún punto de su órbita: nada dice que cruzara este cielo.",possibleDay:"Posible: {name} ({cospar}) reentró el {day}, en algún punto de su órbita: nada dice que cruzara este cielo.",expectedFireball:"Esperado en las fuentes, ausente: un bólido de magnitud absoluta {mag} aquí de noche, donde la Global Meteor Network registró {count} bólidos ese mes a menos de {km} km, estaría en ellas, salvo que sus cámaras estuvieran bajo las nubes.",expectedCatalogue:"Esperado en las fuentes, ausente: la reentrada de todo objeto catalogado está fechada desde 1957. Un objeto no catalogado (secreto, un pequeño desecho), o no una reentrada.",impossibleOrbit:"Imposible: nada estaba en órbita antes del 4 de octubre de 1957.",faintFireball:"La ausencia no dice nada: ninguna red registra todos los meteoros más débiles que la magnitud absoluta −3.",beforeGmn:"La ausencia no dice nada: los registros de la Global Meteor Network empiezan en diciembre de 2018.",unwatchedGmn:"La ausencia no dice nada: la Global Meteor Network apenas registró nada a menos de {km} km ese mes; este cielo no está vigilado.",daylightGmn:"La ausencia no dice nada: las cámaras de la Global Meteor Network no funcionan de día.",typeUnknown:"Nada conocido coincide; al no decirse su tipo, su ausencia no dice nada.",unreachableGmn:"No comprobado: no se pudo acceder a los registros de la Global Meteor Network.",unreachableCatalogue:"No comprobado: no se pudo acceder al catálogo de satélites.",noDateOrPlace:"No comprobado: la grabación necesita una fecha y un lugar.",compatibleShower:"Compatible con las {shower}: prolongado hacia atrás, su camino pasa a {off}° de su radiante (con {margin}° de margen), una lluvia entonces de unos {zhr} meteoros por hora como mucho. Uno de sus meteoros quizá, nunca con certeza: un esporádico puede cruzar igual.",sporadicShower:"Esporádico, como la mayoría de los meteoros: prolongado hacia atrás, su camino no viene de ninguna de las {count} lluvias activas entonces.",sporadicNoShower:"Esporádico, como la mayoría de los meteoros: ninguna lluvia estaba activa entonces.",margins:"Dentro de los errores de un testigo: ±{minutes} min, rumbo ±{heading}°, altura sobreestimada, duración ×/÷{factor}."};export{e as reentryEditorMessages_es};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={intro:"Une rentrée atmosphérique vue pendant l'enregistrement : un météore ou un bolide, venu seul, ou un satellite, un étage de fusée ou une capsule qui se consume. Un fait du ciel, pas une lecture du compte rendu. Elle est placée là où elle était vraiment, latitude, longitude et altitude, et vue à travers la forme de la Terre ; sa lumière éclaire la scène depuis là.",none:"Aucune rentrée dans cet enregistrement",reentry:"Rentrée",deleteReentry:"Le supprimer",pointAtReentry:"Le pointer",addReentry:"Ajouter une rentrée",path:"Trajet",deletePlace:"Retirer ce point",fragments:"Pièces",fragment:"Pièce",addFragment:"Ajouter une pièce derrière la dernière",deleteFragment:"Retirer cette pièce",curve:"Courbe de lumière",deleteCurvePoint:"Retirer ce point",noCurve:"Pas de courbe de lumière : sa magnitude absolue vaut tout du long. Le « + » de sa ligne sur la frise ajoute un point à la tête de lecture.",addNowhere:"Donnez d'abord un lieu à l'enregistrement : une rentrée est placée devant le témoin",derivedNote:"Un champ vide montre, en grisé, la valeur utilisée. Videz un champ pour y revenir. Les débris plus petits que perd chaque pièce se règlent dans le fichier.",timelineNote:"Sur la frise, un losange pressé est le point affiché dessous, et la scène va à son instant ; faites-le glisser pour le déplacer dans le temps. Le « + » d'une ligne pose un point à la tête de lecture. Les parties hachurées sont avant le début de l'enregistrement ou après sa fin.",addPointHere:"Ajouter un point ici, à la tête de lecture",pointHere:"Un point est à la tête de lecture : pressez-le pour le modifier",zoomHint:"Pincez, ou Ctrl + molette, pour zoomer ; Maj + molette pour défiler",evidence:"Dans les sources",evidenceChecking:"Recherche dans les sources…",knownFireball:"Connu : le bolide {id} du Global Meteor Network, à {time} ({offset} min d'écart), triangulé par {stations} stations, magnitude absolue {mag} : dans les marges d'erreur d'un témoin par rapport à ce qui est saisi ({heading}° d'écart de cap).",knownObject:"Connu : {name} ({cospar}), l'objet qu'elle nomme, est au catalogue des satellites ; rentrée : {when}.",knownSeen:"Connu : {name} ({cospar}) a été vu rentrer à {time} depuis {place}, à {km} km d'ici.",possibleSeen:"Possible : {name} ({cospar}) a été vu rentrer à {time} depuis {place}, à {km} km d'ici, avec {offset} min d'écart : plus que l'erreur d'un témoin.",possibleWindow:"Possible : {name} ({cospar}) est rentré à {hours} h près de {time}, quelque part sur son orbite : rien ne dit qu'il a traversé ce ciel.",possibleDay:"Possible : {name} ({cospar}) est rentré le {day}, quelque part sur son orbite : rien ne dit qu'il a traversé ce ciel.",expectedFireball:"Attendu dans les sources, absent : un bolide de magnitude absolue {mag} ici de nuit, où le Global Meteor Network a enregistré {count} bolides ce mois-là à moins de {km} km, y serait, sauf si ses caméras étaient sous les nuages.",expectedCatalogue:"Attendu dans les sources, absent : la rentrée de tout objet catalogué est datée depuis 1957. Un objet non catalogué (secret, petit débris), ou pas une rentrée.",impossibleOrbit:"Impossible : rien n'était en orbite avant le 4 octobre 1957.",faintFireball:"Absence non informative : aucun réseau ne recense tous les météores plus faibles que la magnitude absolue −3.",beforeGmn:"Absence non informative : les enregistrements du Global Meteor Network commencent en décembre 2018.",unwatchedGmn:"Absence non informative : le Global Meteor Network n'a presque rien enregistré à moins de {km} km ce mois-là ; ce ciel n'est pas surveillé.",daylightGmn:"Absence non informative : les caméras du Global Meteor Network ne tournent pas de jour.",typeUnknown:"Rien de connu ne correspond ; son type n'étant pas dit, son absence ne dit rien.",unreachableGmn:"Non vérifié : les enregistrements du Global Meteor Network sont injoignables.",unreachableCatalogue:"Non vérifié : le catalogue des satellites est injoignable.",noDateOrPlace:"Non vérifié : l'enregistrement doit avoir une date et un lieu.",compatibleShower:"Compatible avec les {shower} : prolongé vers l'arrière, son trajet passe à {off}° de leur radiant (à {margin}° près), un essaim alors à quelque {zhr} météores par heure au mieux. Un de ses météores peut-être, jamais sûrement : un sporadique peut passer de même.",sporadicShower:"Sporadique, comme la plupart des météores : prolongé vers l'arrière, son trajet ne vient d'aucun des {count} essaims actifs alors.",sporadicNoShower:"Sporadique, comme la plupart des météores : aucun essaim n'était actif alors.",margins:"Dans les marges d'erreur d'un témoin : ±{minutes} min, cap ±{heading}°, hauteur surestimée, durée ×/÷{factor}."};export{e as reentryEditorMessages_fr};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={intro:"Un rientro atmosferico visto durante la registrazione: una meteora o un bolide, arrivato da sé, o un satellite, uno stadio di razzo o una capsula che si consuma. Un fatto del cielo, non una lettura del resoconto. È collocato dove si trovava davvero, latitudine, longitudine e quota, e visto attraverso la forma della Terra; la sua luce illumina la scena da lì.",none:"Nessun rientro in questa registrazione",reentry:"Rientro",deleteReentry:"Eliminarlo",pointAtReentry:"Puntarlo",addReentry:"Aggiungi un rientro",path:"Percorso",deletePlace:"Togliere questo punto",fragments:"Pezzi",fragment:"Pezzo",addFragment:"Aggiungere un pezzo dietro l'ultimo",deleteFragment:"Togliere questo pezzo",curve:"Curva di luce",deleteCurvePoint:"Togliere questo punto",noCurve:"Nessuna curva di luce: la sua magnitudine assoluta vale per tutto il tempo. Il «+» della sua riga sulla linea del tempo aggiunge un punto alla testina.",addNowhere:"Date prima un luogo alla registrazione: un rientro è posto davanti al testimone",derivedNote:"Un campo vuoto mostra, in grigio, il valore usato. Svuotate un campo per tornarci. I frammenti più piccoli che perde ogni pezzo si regolano nel file.",timelineNote:"Sulla linea del tempo, un rombo premuto è il punto mostrato sotto, e la scena va al suo istante; trascinatelo per spostarlo nel tempo. Il «+» di una riga mette un punto alla testina. Le parti tratteggiate sono prima dell'inizio della registrazione o dopo la sua fine.",addPointHere:"Aggiungere un punto qui, alla testina",pointHere:"C'è un punto alla testina: premetelo per modificarlo",zoomHint:"Pizzicate, o Ctrl + rotella, per ingrandire; Maiusc + rotella per scorrere",evidence:"Nelle fonti",evidenceChecking:"Consultazione delle fonti…",knownFireball:"Noto: il bolide {id} della Global Meteor Network, alle {time} ({offset} min di scarto), triangolato da {stations} stazioni, magnitudine assoluta {mag}: entro gli errori di un testimone rispetto a ciò che è inserito ({heading}° di scarto di direzione).",knownObject:"Noto: {name} ({cospar}), l'oggetto che nomina, è nel catalogo dei satelliti; rientro: {when}.",knownSeen:"Noto: {name} ({cospar}) è stato visto rientrare alle {time} da {place}, a {km} km da qui.",possibleSeen:"Possibile: {name} ({cospar}) è stato visto rientrare alle {time} da {place}, a {km} km da qui, con {offset} min di scarto: più di quanto sbagli un testimone.",possibleWindow:"Possibile: {name} ({cospar}) è rientrato entro {hours} h dalle {time}, in un punto della sua orbita: nulla dice che abbia attraversato questo cielo.",possibleDay:"Possibile: {name} ({cospar}) è rientrato il {day}, in un punto della sua orbita: nulla dice che abbia attraversato questo cielo.",expectedFireball:"Atteso nelle fonti, assente: un bolide di magnitudine assoluta {mag} qui di notte, dove la Global Meteor Network ha registrato {count} bolidi quel mese entro {km} km, vi sarebbe, a meno che le sue telecamere fossero sotto le nuvole.",expectedCatalogue:"Atteso nelle fonti, assente: il rientro di ogni oggetto catalogato è datato dal 1957. Un oggetto non catalogato (segreto, un piccolo detrito), o non un rientro.",impossibleOrbit:"Impossibile: nulla era in orbita prima del 4 ottobre 1957.",faintFireball:"L'assenza non dice nulla: nessuna rete registra tutte le meteore più deboli della magnitudine assoluta −3.",beforeGmn:"L'assenza non dice nulla: le registrazioni della Global Meteor Network iniziano nel dicembre 2018.",unwatchedGmn:"L'assenza non dice nulla: la Global Meteor Network non ha registrato quasi nulla entro {km} km quel mese; questo cielo non è sorvegliato.",daylightGmn:"L'assenza non dice nulla: le telecamere della Global Meteor Network non funzionano di giorno.",typeUnknown:"Nulla di noto corrisponde; non essendo detto il suo tipo, la sua assenza non dice nulla.",unreachableGmn:"Non verificato: le registrazioni della Global Meteor Network non sono raggiungibili.",unreachableCatalogue:"Non verificato: il catalogo dei satelliti non è raggiungibile.",noDateOrPlace:"Non verificato: la registrazione deve avere una data e un luogo.",compatibleShower:"Compatibile con le {shower}: prolungato all'indietro, il suo percorso passa a {off}° dal loro radiante (entro {margin}°), uno sciame allora di circa {zhr} meteore l'ora al massimo. Forse una delle sue meteore, mai con certezza: una sporadica può passare allo stesso modo.",sporadicShower:"Sporadica, come la maggior parte delle meteore: prolungato all'indietro, il suo percorso non viene da nessuno dei {count} sciami attivi allora.",sporadicNoShower:"Sporadica, come la maggior parte delle meteore: nessuno sciame era attivo allora.",margins:"Entro gli errori di un testimone: ±{minutes} min, direzione ±{heading}°, altezza sovrastimata, durata ×/÷{factor}."};export{e as reentryEditorMessages_it};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={title:"Re-entries",name:"Re-entry",piece:"{name} — mag {mag}, {height} km up, {distance} km away",fragment:"{name}, a fragment — mag {mag}, {height} km up, {distance} km away"};export{e as reentryKindMessages_en};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={title:"Reentradas",name:"Reentrada atmosférica",piece:"{name} — mag {mag}, a {height} km de altitud y {distance} km",fragment:"{name}, un fragmento — mag {mag}, a {height} km de altitud y {distance} km"};export{e as reentryKindMessages_es};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={title:"Rentrées",name:"Rentrée atmosphérique",piece:"{name} — mag {mag}, à {height} km d'altitude et {distance} km",fragment:"{name}, un fragment — mag {mag}, à {height} km d'altitude et {distance} km"};export{e as reentryKindMessages_fr};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={title:"Rientri",name:"Rientro atmosferico",piece:"{name} — mag {mag}, a {height} km di quota e {distance} km",fragment:"{name}, un frammento — mag {mag}, a {height} km di quota e {distance} km"};export{e as reentryKindMessages_it};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={name:"Name",object:"Object",light:"Light",when:"When",fireballOrReEntry:"Re-entry",type:"Type",whatCameInNaturalOrPut:"What came in: a meteor or a fireball came in by itself, a satellite, a rocket stage or a capsule was put in orbit.",notKnown:"Not known",seenByTheWitness:"Seen by the witness",appearedAzimuth:"Appeared, azimuth",appearedHeight:"Appeared, height",wentOutAzimuth:"Went out, azimuth",wentOutHeight:"Went out, height",seenFor:"Seen for",fromTheNorthTowardsTheEast:"Degrees from the north towards the east",aboveTheHorizon:"Degrees above the horizon",allSaidThePathIsWorkedOut:"Once all five are said, its path is worked out from them, at the heights of its path's first and last points, and replaces it",catalogueName:"Catalogue name",forAReEntryThePiece:'The piece as the satellite catalogue names it: "SL-12 R/B".',cosparId:"COSPAR id",t1968013c:"1968-013C",noradNumber:"NORAD number",pointOfThePath:"Point of the path",time:"Time",secondsOfTheRecordingNegativeBefore:"Seconds of the recording; negative before it began.",position:"Position",altitude:"Altitude",aboveTheEllipsoidAMeteorBegins:"Above the ellipsoid. A meteor begins to glow between 120 and 80 km; a satellite breaks up near 80.",piece:"Piece",id:"Id",absoluteMagnitude:"Absolute magnitude",itsBrightnessSeenFrom100Km:"Its brightness seen from 100 km, as fireball reports give it: −4 or brighter is a fireball, −17 a superbolide. Its light curve, when it has one, stands instead.",colour:"Colour",train:"Train",howLongAStretchOfIts:"How long a stretch of its own past path still glows behind it, seconds.",behindTheLead:"Behind the lead",secondsBehindTheLeadingPointAlong:"Seconds behind the leading point along the same path: 0 is the leading piece itself.",seenFrom:"Seen from",whenItBreaksOffOrBegins:"When it breaks off or begins to glow; empty, the start of the path.",outAt:"Out at",whenItHasBurnedUpOr:"When it has burned up or slowed below glowing; empty, the end of the path.",pointOfTheLightCurve:"Point of the light curve",secondsOfTheRecording:"Seconds of the recording."};export{e as reentryParameterTexts_en};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={name:"Nombre",object:"Objeto",light:"Luz",when:"Cuándo",fireballOrReEntry:"Reentrada",type:"Tipo",whatCameInNaturalOrPut:"Lo que entró: un meteoro o un bólido llegó por sí solo; un satélite, una etapa de cohete o una cápsula había sido puesto en órbita.",notKnown:"Desconocido",seenByTheWitness:"Visto por el testigo",appearedAzimuth:"Apareció, acimut",appearedHeight:"Apareció, altura",wentOutAzimuth:"Se apagó, acimut",wentOutHeight:"Se apagó, altura",seenFor:"Visto durante",fromTheNorthTowardsTheEast:"Grados desde el norte hacia el este",aboveTheHorizon:"Grados sobre el horizonte",allSaidThePathIsWorkedOut:"Una vez dichos los cinco valores, su camino se deduce de ellos, a las alturas del primer y último punto de su camino, y lo sustituye",catalogueName:"Nombre en el catálogo",forAReEntryThePiece:"La pieza como la nombra el catálogo de satélites: «SL-12 R/B».",cosparId:"Identificador COSPAR",t1968013c:"1968-013C",noradNumber:"Número NORAD",pointOfThePath:"Punto del trayecto",time:"Instante",secondsOfTheRecordingNegativeBefore:"Segundos de la grabación; negativos antes de su inicio.",position:"Posición",altitude:"Altitud",aboveTheEllipsoidAMeteorBegins:"Sobre el elipsoide. Un meteoro se enciende entre 120 y 80 km; un satélite se rompe hacia los 80.",piece:"Pieza",id:"Identificador",absoluteMagnitude:"Magnitud absoluta",itsBrightnessSeenFrom100Km:"Su brillo visto a 100 km, como lo dan los informes de bólidos: −4 o más brillante es un bólido, −17 un superbólido. Su curva de luz, cuando la tiene, vale en su lugar.",colour:"Color",train:"Estela",howLongAStretchOfIts:"Cuántos segundos de su propio trayecto siguen brillando detrás de él.",behindTheLead:"Retraso sobre la cabeza",secondsBehindTheLeadingPointAlong:"Segundos de retraso sobre el punto de cabeza, en el mismo trayecto: 0 es la propia pieza de cabeza.",seenFrom:"Visto desde",whenItBreaksOffOrBegins:"Cuando se desprende o se enciende; vacío, el inicio del trayecto.",outAt:"Apagado a",whenItHasBurnedUpOr:"Cuando se ha consumido o ha frenado demasiado para brillar; vacío, el final del trayecto.",pointOfTheLightCurve:"Punto de la curva de luz",secondsOfTheRecording:"Segundos de la grabación."};export{e as reentryParameterTexts_es};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={name:"Nom",object:"Objet",light:"Lumière",when:"Quand",fireballOrReEntry:"Rentrée",type:"Type",whatCameInNaturalOrPut:"Ce qui est entré : un météore ou un bolide est venu seul, un satellite, un étage de fusée ou une capsule avait été mis en orbite.",notKnown:"Inconnu",seenByTheWitness:"Vu par le témoin",appearedAzimuth:"Apparu, azimut",appearedHeight:"Apparu, hauteur",wentOutAzimuth:"Éteint, azimut",wentOutHeight:"Éteint, hauteur",seenFor:"Vu pendant",fromTheNorthTowardsTheEast:"Degrés depuis le nord vers l'est",aboveTheHorizon:"Degrés au-dessus de l'horizon",allSaidThePathIsWorkedOut:"Une fois les cinq valeurs dites, son trajet en est déduit, aux altitudes des premier et dernier points de son trajet, et le remplace",catalogueName:"Nom au catalogue",forAReEntryThePiece:"La pièce comme le catalogue des satellites la nomme : « SL-12 R/B ».",cosparId:"Identifiant COSPAR",t1968013c:"1968-013C",noradNumber:"Numéro NORAD",pointOfThePath:"Point du trajet",time:"Instant",secondsOfTheRecordingNegativeBefore:"Secondes de l'enregistrement ; négatives avant son début.",position:"Position",altitude:"Altitude",aboveTheEllipsoidAMeteorBegins:"Au-dessus de l'ellipsoïde. Un météore s'allume entre 120 et 80 km ; un satellite se brise vers 80.",piece:"Pièce",id:"Identifiant",absoluteMagnitude:"Magnitude absolue",itsBrightnessSeenFrom100Km:"Son éclat vu à 100 km, comme le donnent les rapports de bolides : −4 ou plus brillant est un bolide, −17 un superbolide. Sa courbe de lumière, quand il en a une, vaut à la place.",colour:"Couleur",train:"Traînée",howLongAStretchOfIts:"Combien de secondes de son propre trajet brillent encore derrière lui.",behindTheLead:"Retard sur la tête",secondsBehindTheLeadingPointAlong:"Secondes de retard sur le point de tête, sur le même trajet : 0 est la pièce de tête elle-même.",seenFrom:"Vu à partir de",whenItBreaksOffOrBegins:"Quand il se détache ou s'allume ; vide, le début du trajet.",outAt:"Éteint à",whenItHasBurnedUpOr:"Quand il s'est consumé ou a trop ralenti pour briller ; vide, la fin du trajet.",pointOfTheLightCurve:"Point de la courbe de lumière",secondsOfTheRecording:"Secondes de l'enregistrement."};export{e as reentryParameterTexts_fr};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={name:"Nome",object:"Oggetto",light:"Luce",when:"Quando",fireballOrReEntry:"Rientro",type:"Tipo",whatCameInNaturalOrPut:"Ciò che è entrato: una meteora o un bolide è arrivato da sé; un satellite, uno stadio di razzo o una capsula era stato messo in orbita.",notKnown:"Sconosciuto",seenByTheWitness:"Visto dal testimone",appearedAzimuth:"Apparso, azimut",appearedHeight:"Apparso, altezza",wentOutAzimuth:"Spento, azimut",wentOutHeight:"Spento, altezza",seenFor:"Visto per",fromTheNorthTowardsTheEast:"Gradi dal nord verso l'est",aboveTheHorizon:"Gradi sopra l'orizzonte",allSaidThePathIsWorkedOut:"Detti tutti e cinque i valori, il suo percorso ne è dedotto, alle quote del primo e dell'ultimo punto del percorso, e lo sostituisce",catalogueName:"Nome a catalogo",forAReEntryThePiece:"Il pezzo come lo chiama il catalogo dei satelliti: «SL-12 R/B».",cosparId:"Identificativo COSPAR",t1968013c:"1968-013C",noradNumber:"Numero NORAD",pointOfThePath:"Punto del percorso",time:"Istante",secondsOfTheRecordingNegativeBefore:"Secondi della registrazione; negativi prima del suo inizio.",position:"Posizione",altitude:"Altitudine",aboveTheEllipsoidAMeteorBegins:"Sopra l'ellissoide. Una meteora si accende tra 120 e 80 km; un satellite si spezza verso gli 80.",piece:"Pezzo",id:"Identificativo",absoluteMagnitude:"Magnitudine assoluta",itsBrightnessSeenFrom100Km:"La sua luminosità vista da 100 km, come la danno i rapporti sui bolidi: −4 o più brillante è un bolide, −17 un superbolide. La sua curva di luce, quando ce l'ha, vale al suo posto.",colour:"Colore",train:"Scia",howLongAStretchOfIts:"Quanti secondi del suo stesso percorso brillano ancora dietro di lui.",behindTheLead:"Ritardo sulla testa",secondsBehindTheLeadingPointAlong:"Secondi di ritardo sul punto di testa, sullo stesso percorso: 0 è il pezzo di testa stesso.",seenFrom:"Visto da",whenItBreaksOffOrBegins:"Quando si stacca o si accende; vuoto, l'inizio del percorso.",outAt:"Spento a",whenItHasBurnedUpOr:"Quando si è consumato o ha rallentato troppo per brillare; vuoto, la fine del percorso.",pointOfTheLightCurve:"Punto della curva di luce",secondsOfTheRecording:"Secondi della registrazione."};export{e as reentryParameterTexts_it};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={meteor:"Meteor",fireball:"Fireball",satellite:"Satellite",rocketStage:"Rocket stage",capsule:"Capsule"};export{e as reentryTypeNames_en};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={meteor:"Meteoro",fireball:"Bólido",satellite:"Satélite",rocketStage:"Etapa de cohete",capsule:"Cápsula"};export{e as reentryTypeNames_es};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={meteor:"Météore",fireball:"Bolide",satellite:"Satellite",rocketStage:"Étage de fusée",capsule:"Capsule"};export{e as reentryTypeNames_fr};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={meteor:"Meteora",fireball:"Bolide",satellite:"Satellite",rocketStage:"Stadio di razzo",capsule:"Capsula"};export{e as reentryTypeNames_it};
|
package/dist-embed-sighting-editor/{ReferenceSystem-DlpoDXXV.js → ReferenceSystem-BoCM4vB1.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as w,Q as M,
|
|
1
|
+
import{n as w,Q as M,bD as d,bE as y,bF as g,bd as c,bG as b,ap as k,aF as O,bH as E,bI as T,bJ as I,G as D}from"./rr0-sighting-editor.mjs";import{P as m,a as f}from"./PictureFetch-C3wgf1ZV.js";const v=3,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=w(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 M;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 y(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 b(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=E),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 T(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 I(e,s);return a.translate(0,0,-u),a}static orientation({headingDeg:t,pitchDeg:i,rollDeg:s}){const e=new D;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};
|