@rr0/ufoathome 0.195.0 → 0.196.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.
Files changed (127) hide show
  1. package/dist-embed-scene/rr0-scene.mjs +4 -4
  2. package/dist-embed-sighting/CaseMessages_en-G5J5w1_d.js +1 -0
  3. package/dist-embed-sighting/CaseMessages_es-D7Rp1_1K.js +1 -0
  4. package/dist-embed-sighting/CaseMessages_fr-B8eZ1NIJ.js +1 -0
  5. package/dist-embed-sighting/CaseMessages_it-Cu02nVVo.js +1 -0
  6. package/dist-embed-sighting/{CaseReportExport-BeKawC8S.js → CaseReportExport-CdRgJb5M.js} +1 -1
  7. package/dist-embed-sighting/rr0-sighting.mjs +343 -324
  8. package/dist-embed-sighting-editor/{AdsbLolArchiveProvider--KjPxNqw.js → AdsbLolArchiveProvider-BqEnqRP0.js} +1 -1
  9. package/dist-embed-sighting-editor/{BallesterGuaspAssessor-BTmq0r-G.js → BallesterGuaspAssessor-BL_yzudf.js} +1 -1
  10. package/dist-embed-sighting-editor/{BeamEditor-CI8-9VOc.js → BeamEditor-DA29mfqm.js} +1 -1
  11. package/dist-embed-sighting-editor/{BeamSystem-odg570aR.js → BeamSystem-DYohqXlF.js} +1 -1
  12. package/dist-embed-sighting-editor/{BirdEditor-DV3ndYff.js → BirdEditor-CAoRqqRV.js} +1 -1
  13. package/dist-embed-sighting-editor/{BirdFlock-O7K_g8y7.js → BirdFlock-TI63ZAKZ.js} +1 -1
  14. package/dist-embed-sighting-editor/{CaseEditorMessages_en-CoFukfwf.js → CaseEditorMessages_en-BPdxQsTX.js} +1 -1
  15. package/dist-embed-sighting-editor/{CaseEditorMessages_es-DZptbzB7.js → CaseEditorMessages_es-B48BAICC.js} +1 -1
  16. package/dist-embed-sighting-editor/{CaseEditorMessages_fr-DXl2GNmR.js → CaseEditorMessages_fr-DTWi9mIY.js} +1 -1
  17. package/dist-embed-sighting-editor/{CaseEditorMessages_it-ss10VmRM.js → CaseEditorMessages_it-CMLxgu8y.js} +1 -1
  18. package/dist-embed-sighting-editor/CaseElement-AXaERD8m.js +112 -0
  19. package/dist-embed-sighting-editor/CaseMessages_en-G5J5w1_d.js +1 -0
  20. package/dist-embed-sighting-editor/CaseMessages_es-D7Rp1_1K.js +1 -0
  21. package/dist-embed-sighting-editor/CaseMessages_fr-B8eZ1NIJ.js +1 -0
  22. package/dist-embed-sighting-editor/CaseMessages_it-Cu02nVVo.js +1 -0
  23. package/dist-embed-sighting-editor/{CaseReportExport-DisXbZ3b.js → CaseReportExport-CDZp6xGk.js} +2 -2
  24. package/dist-embed-sighting-editor/{ContrailSystem-BddkU7fj.js → ContrailSystem-B0cQbaHc.js} +1 -1
  25. package/dist-embed-sighting-editor/{ControlPasses-CNlCUT1L.js → ControlPasses-BvS8haeS.js} +1 -1
  26. package/dist-embed-sighting-editor/{CoverageAssessor-DjY8iKp5.js → CoverageAssessor-DD1kSvun.js} +1 -1
  27. package/dist-embed-sighting-editor/{DroneEditor-DRsM2ash.js → DroneEditor-BRB2-dAw.js} +1 -1
  28. package/dist-embed-sighting-editor/{DroneFlight-Fr4Vgso3.js → DroneFlight-BpnBgJ9K.js} +1 -1
  29. package/dist-embed-sighting-editor/{Flightradar24Provider-BxeduRam.js → Flightradar24Provider-D5OdIL0L.js} +1 -1
  30. package/dist-embed-sighting-editor/{GLTFLoader-C6nlGTTi.js → GLTFLoader-DuqJVU4y.js} +1 -1
  31. package/dist-embed-sighting-editor/{HeadlightSystem-DI5wHYZu.js → HeadlightSystem-BejdfHqe.js} +1 -1
  32. package/dist-embed-sighting-editor/{HynekAssessor-DlXalbph.js → HynekAssessor-CwzpS7YP.js} +1 -1
  33. package/dist-embed-sighting-editor/{LanternEditor-M887ltwe.js → LanternEditor-BnXAwLuQ.js} +1 -1
  34. package/dist-embed-sighting-editor/{LaserBeam-Drpkr84G.js → LaserBeam-tqM2fwHf.js} +1 -1
  35. package/dist-embed-sighting-editor/{LaunchEditor-BjAk4XZR.js → LaunchEditor-vwecAGwH.js} +1 -1
  36. package/dist-embed-sighting-editor/{LaunchPlume-CrzPcqw7.js → LaunchPlume-DWyU0YyJ.js} +1 -1
  37. package/dist-embed-sighting-editor/{LaunchSimulation-C1ZWpKZT.js → LaunchSimulation-C_OJQoKC.js} +1 -1
  38. package/dist-embed-sighting-editor/{ModelSource-Bko_3OJt.js → ModelSource-D1Wt6VYS.js} +1 -1
  39. package/dist-embed-sighting-editor/{ModelThumbnails-DSshyLu2.js → ModelThumbnails-C_8KCF7H.js} +1 -1
  40. package/dist-embed-sighting-editor/{ModelViewer-_yhAYvNy.js → ModelViewer-Cy-6IZBY.js} +1 -1
  41. package/dist-embed-sighting-editor/{ModuleConformance-B6iFVb8X.js → ModuleConformance-DYi4XZdB.js} +2 -2
  42. package/dist-embed-sighting-editor/{ModuleSession-jKFl1FMo.js → ModuleSession-BDbaoiCf.js} +2 -2
  43. package/dist-embed-sighting-editor/ModuleThree-DRf9SEr_.js +1 -0
  44. package/dist-embed-sighting-editor/{ModulesPanelElement-VPRCdjmv.js → ModulesPanelElement-hDjGLhRa.js} +3 -3
  45. package/dist-embed-sighting-editor/{NearestApproach-O8k2n_qL.js → NearestApproach-D6tQo7dk.js} +1 -1
  46. package/dist-embed-sighting-editor/{PoherAssessor-sTJEnlmb.js → PoherAssessor-BTYpHucH.js} +1 -1
  47. package/dist-embed-sighting-editor/{RailwaySystem-BZqNSSFA.js → RailwaySystem-D_8D64Bu.js} +1 -1
  48. package/dist-embed-sighting-editor/{ReentryEditor-DfDGpL5C.js → ReentryEditor-D7HxkvKP.js} +2 -2
  49. package/dist-embed-sighting-editor/{ReentrySimulation-BuUK0niI.js → ReentrySimulation-Bom073AV.js} +1 -1
  50. package/dist-embed-sighting-editor/{ReferenceSystem-DvcQp167.js → ReferenceSystem-D_eueNAb.js} +1 -1
  51. package/dist-embed-sighting-editor/{SightingElement-Bdkf99VT.js → SightingElement-DukKlaH1.js} +4 -4
  52. package/dist-embed-sighting-editor/{SkyLantern-B7UlFgmB.js → SkyLantern-BDpxvmY3.js} +1 -1
  53. package/dist-embed-sighting-editor/{TraceSystem-vZF4B5EC.js → TraceSystem-B1mmypS3.js} +2 -2
  54. package/dist-embed-sighting-editor/{WaterSystem-DSWmZbiL.js → WaterSystem-mZ-f2CcD.js} +2 -2
  55. package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +370 -359
  56. package/dist-embed-sighting-editor/{trafficRuntime-C5BXL-G6.js → trafficRuntime-CvK_m6bC.js} +1 -1
  57. package/dist-embed-ufoathome/{AdsbLolArchiveProvider-veDw9Mxo.js → AdsbLolArchiveProvider-BAZqWk1I.js} +1 -1
  58. package/dist-embed-ufoathome/{BallesterGuaspAssessor-BVygSN0R.js → BallesterGuaspAssessor-D5DnaJGn.js} +1 -1
  59. package/dist-embed-ufoathome/{BeamEditor-eDeeNBE9.js → BeamEditor-DmuKTRqU.js} +1 -1
  60. package/dist-embed-ufoathome/{BeamSystem-B5u4ithz.js → BeamSystem-KHzcEosy.js} +1 -1
  61. package/dist-embed-ufoathome/{BodyEditor-23Dua2K5.js → BodyEditor-Blkm_Xmd.js} +1 -1
  62. package/dist-embed-ufoathome/{CaseEditorElement-DYMt7oB4.js → CaseEditorElement-BTZu9wey.js} +33 -29
  63. package/dist-embed-ufoathome/{CaseEditorMessages_en-CoFukfwf.js → CaseEditorMessages_en-BPdxQsTX.js} +1 -1
  64. package/dist-embed-ufoathome/{CaseEditorMessages_es-DZptbzB7.js → CaseEditorMessages_es-B48BAICC.js} +1 -1
  65. package/dist-embed-ufoathome/{CaseEditorMessages_fr-DXl2GNmR.js → CaseEditorMessages_fr-DTWi9mIY.js} +1 -1
  66. package/dist-embed-ufoathome/{CaseEditorMessages_it-ss10VmRM.js → CaseEditorMessages_it-CMLxgu8y.js} +1 -1
  67. package/dist-embed-ufoathome/CaseElement-Cr3vTWdf.js +112 -0
  68. package/dist-embed-ufoathome/CaseMessages_en-G5J5w1_d.js +1 -0
  69. package/dist-embed-ufoathome/CaseMessages_es-D7Rp1_1K.js +1 -0
  70. package/dist-embed-ufoathome/CaseMessages_fr-B8eZ1NIJ.js +1 -0
  71. package/dist-embed-ufoathome/CaseMessages_it-Cu02nVVo.js +1 -0
  72. package/dist-embed-ufoathome/{CaseReportExport-Cgs2Y0v3.js → CaseReportExport-CyuSf3U_.js} +3 -3
  73. package/dist-embed-ufoathome/{CaseTimeline-BwCuVg5N.js → ColumnResize-DifCqMt1.js} +14 -7
  74. package/dist-embed-ufoathome/{ContrailSystem-CtQPQFyc.js → ContrailSystem-DqZ8PoEd.js} +1 -1
  75. package/dist-embed-ufoathome/{ControlPasses-B_uf1Wmh.js → ControlPasses-BtU_MVQU.js} +1 -1
  76. package/dist-embed-ufoathome/{CoverageAssessor-JQCFe16i.js → CoverageAssessor-DkVligEj.js} +1 -1
  77. package/dist-embed-ufoathome/{Flightradar24Provider-BR8_7wmx.js → Flightradar24Provider-GYjtvwah.js} +1 -1
  78. package/dist-embed-ufoathome/{GLTFLoader-DrBMau2Y.js → GLTFLoader-DzEwUqtj.js} +1 -1
  79. package/dist-embed-ufoathome/{GeoJsonExport-wUgEVyel.js → GeoJsonExport-B1i0YjqN.js} +1 -1
  80. package/dist-embed-ufoathome/{GeographicFigures-CpbFopao.js → GeographicFigures-D5ZCRN0K.js} +1 -1
  81. package/dist-embed-ufoathome/{HeadlightSystem-YXD1Zdpn.js → HeadlightSystem-x2xYh-cs.js} +1 -1
  82. package/dist-embed-ufoathome/{HynekAssessor-BV2nWUx8.js → HynekAssessor-DOUPfuRV.js} +1 -1
  83. package/dist-embed-ufoathome/{InterviewEditorElement-DiT6FZnj.js → InterviewEditorElement-Dt-KQiv0.js} +1 -1
  84. package/dist-embed-ufoathome/{InterviewElement-DFcCnZtF.js → InterviewElement-BPsBLXlf.js} +1 -1
  85. package/dist-embed-ufoathome/{KmlExport-wWr2S8H-.js → KmlExport-JEXMAssj.js} +1 -1
  86. package/dist-embed-ufoathome/{LaserBeam-CejB0H9v.js → LaserBeam-Cy9lfcCE.js} +1 -1
  87. package/dist-embed-ufoathome/{LaunchEditor-ConcMLIe.js → LaunchEditor-zWZhMyLf.js} +1 -1
  88. package/dist-embed-ufoathome/{LaunchPlume-BQEYjeSf.js → LaunchPlume-CcUQvACB.js} +1 -1
  89. package/dist-embed-ufoathome/{LaunchSimulation-BIiU6D8P.js → LaunchSimulation-DRH0rTE7.js} +1 -1
  90. package/dist-embed-ufoathome/{ModelSource-B93j0IA6.js → ModelSource-Dljnl-RW.js} +1 -1
  91. package/dist-embed-ufoathome/{ModelThumbnails-3U8M50_n.js → ModelThumbnails-DeaPuKSb.js} +1 -1
  92. package/dist-embed-ufoathome/{ModelViewer-Cnxj0Oi9.js → ModelViewer-B-ZLBTmq.js} +1 -1
  93. package/dist-embed-ufoathome/{ModuleConformance-BlrRirPF.js → ModuleConformance-Bd8yK7Ic.js} +2 -2
  94. package/dist-embed-ufoathome/{ModuleSession-Cdilmebx.js → ModuleSession-DXdpVejH.js} +3 -3
  95. package/dist-embed-ufoathome/{ModuleThree-Dpv5uvYp.js → ModuleThree-BL59t48W.js} +1 -1
  96. package/dist-embed-ufoathome/{ModulesPanelElement-CwgqBVUI.js → ModulesPanelElement-6KUAMJcl.js} +3 -3
  97. package/dist-embed-ufoathome/{NearestApproach-CQ2w9ctm.js → NearestApproach-wbFbwOAh.js} +1 -1
  98. package/dist-embed-ufoathome/{PictureRegistration-DOSDjiOf.js → PictureRegistration-CfSYGbeh.js} +1 -1
  99. package/dist-embed-ufoathome/{PoherAssessor-C8g5YvJi.js → PoherAssessor-CVIeQpd7.js} +1 -1
  100. package/dist-embed-ufoathome/{RailwaySystem-D8B965iv.js → RailwaySystem-DTXetaSg.js} +1 -1
  101. package/dist-embed-ufoathome/{ReentryEditor-CEbb0oLd.js → ReentryEditor-7Fxkxq-Q.js} +1 -1
  102. package/dist-embed-ufoathome/{ReentrySimulation-D_JX7wWS.js → ReentrySimulation-T3H0mJI3.js} +1 -1
  103. package/dist-embed-ufoathome/{ReferenceSystem-xm8mzWiT.js → ReferenceSystem-CJaq2UzO.js} +1 -1
  104. package/dist-embed-ufoathome/{ShareDialogElement-BBMLOqSW.js → ShareDialogElement-ClhewPap.js} +11 -11
  105. package/dist-embed-ufoathome/{SightingElement-e9ZcWa58.js → SightingElement-BtHQ5LDE.js} +4 -4
  106. package/dist-embed-ufoathome/{TraceSystem-BL6qfrHF.js → TraceSystem-B42kzZXG.js} +1 -1
  107. package/dist-embed-ufoathome/{VideoButton-DA48Qz2E.js → VideoButton-DhanY6AD.js} +1 -1
  108. package/dist-embed-ufoathome/{WaterSystem-BLy0L9qC.js → WaterSystem-DyJivqCq.js} +1 -1
  109. package/dist-embed-ufoathome/rr0-ufoathome.mjs +3 -3
  110. package/dist-embed-ufoathome/{surroundingsSources-Dlyt6moH.js → surroundingsSources-DEMGw8rm.js} +1 -1
  111. package/dist-embed-ufoathome/{trafficRuntime-B_bwWY8d.js → trafficRuntime-BJFdLEcT.js} +1 -1
  112. package/package.json +1 -1
  113. package/dist-embed-sighting/CaseMessages_en-BbbbikHH.js +0 -1
  114. package/dist-embed-sighting/CaseMessages_es-AHBxl8Ka.js +0 -1
  115. package/dist-embed-sighting/CaseMessages_fr-CD33PQCH.js +0 -1
  116. package/dist-embed-sighting/CaseMessages_it-DyMACGSU.js +0 -1
  117. package/dist-embed-sighting-editor/CaseElement-CVi_yfyW.js +0 -100
  118. package/dist-embed-sighting-editor/CaseMessages_en-BbbbikHH.js +0 -1
  119. package/dist-embed-sighting-editor/CaseMessages_es-AHBxl8Ka.js +0 -1
  120. package/dist-embed-sighting-editor/CaseMessages_fr-CD33PQCH.js +0 -1
  121. package/dist-embed-sighting-editor/CaseMessages_it-DyMACGSU.js +0 -1
  122. package/dist-embed-sighting-editor/ModuleThree-Fvr5G-Yh.js +0 -1
  123. package/dist-embed-ufoathome/CaseElement-C6KVIESP.js +0 -100
  124. package/dist-embed-ufoathome/CaseMessages_en-BbbbikHH.js +0 -1
  125. package/dist-embed-ufoathome/CaseMessages_es-AHBxl8Ka.js +0 -1
  126. package/dist-embed-ufoathome/CaseMessages_fr-CD33PQCH.js +0 -1
  127. package/dist-embed-ufoathome/CaseMessages_it-DyMACGSU.js +0 -1
@@ -1 +1 @@
1
- import{aQ as M,aR as y,aJ as I}from"./rr0-sighting-editor.mjs";class d{static RECORD_BYTES=20;static NON_ICAO_FLAG=1<<24;static UNKNOWN=65535;static MAX_DT=35999;static decode(t){if(t.length%d.RECORD_BYTES!==0)throw new Error(`An aircraft tile is a multiple of ${d.RECORD_BYTES} bytes, not ${t.length}`);const e=new DataView(t.buffer,t.byteOffset,t.byteLength),c=[];for(let n=0;n<t.length;n+=d.RECORD_BYTES){const s=e.getUint32(n,!0),a=e.getUint16(n+16,!0),r=e.getUint16(n+18,!0);c.push({icao:s&16777215,nonIcao:(s&d.NON_ICAO_FLAG)!==0,secondsInHour:e.getUint16(n+4,!0)/10,lat:e.getInt32(n+6,!0)/1e5,lng:e.getInt32(n+10,!0)/1e5,altitudeFt:e.getInt16(n+14,!0)*25,groundSpeedKt:a===d.UNKNOWN?void 0:a/10,trackDeg:r===d.UNKNOWN?void 0:r/10})}return c}}const w="https://ufoathome.org/aircraft/index.json";class f{citation=M;static DEFAULT_RADIUS_KM=150;static FLAG_MILITARY=1;static FLAG_PIA=4;static FLAG_LADD=8;static KM_PER_DEG=111.32;static HOUR_MS=36e5;fetchImpl;indexUrls;index;hours=new Map;tiles=new Map;shards=new Map;constructor(t={}){this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.indexUrls=t.indexUrls??f.defaultIndexUrls()}static defaultIndexUrls(){const t=[];return typeof location<"u"&&/^https?:$/.test(location.protocol)&&t.push(new URL("/aircraft/index.json",location.href).href),t.includes(w)||t.push(w),t}mayCover(t){return y.mayCover(t)}async between(t,e,c,n=f.DEFAULT_RADIUS_KM){const s=await this.loadIndex();if(!s)return{status:"failed"};const a=[];for(let o=Math.floor(e/f.HOUR_MS);o<=Math.floor(c/f.HOUR_MS);o++)a.push(o);if(!a.every(o=>s.index.days.includes(f.dayOf(o))))return{status:"outside"};const r=f.tilesAround(t,n);try{const o=(await Promise.all(a.flatMap(u=>r.map(i=>this.tileOf(s.base,u,i))))).flat();return{status:"found",tracks:f.merge(o,t,e,c,n)}}catch{return{status:"failed"}}}async describe(t,e){const c=await this.loadIndex();if(!c)return;const n=t.icao.toString(16).padStart(6,"0"),s=t.nonIcao?"non-icao":n.slice(0,2),a=`${e}/${s}`;let r=this.shards.get(a);r||(r=this.fetchImpl(new URL(`${e}/aircraft/${s}.json`,c.base).href).then(g=>g.ok?g.json():{}).catch(()=>({})),this.shards.set(a,r));const o=(await r)[t.nonIcao?`~${n}`:n];if(!o)return;const[u,i,l,h=0]=o,p={registration:u||void 0,type:i||void 0,category:l||void 0,military:(h&f.FLAG_MILITARY)!==0||void 0,restricted:(h&(f.FLAG_PIA|f.FLAG_LADD))!==0||void 0};return Object.values(p).some(g=>g!==void 0)?p:void 0}static tilesAround(t,e){const c=e/f.KM_PER_DEG,n=Math.max(-90,t.lat-c),s=Math.min(90,t.lat+c),a=Math.cos(Math.max(Math.abs(n),Math.abs(s))*Math.PI/180),r=a<1e-6?180:e/(f.KM_PER_DEG*a),o=new Set;if(r>=180)for(let i=-180;i<180;i++)o.add(i);else for(let i=Math.floor(t.lng-r);i<=Math.floor(t.lng+r);i++)o.add(I.wrapLongitude(i));const u=[];for(let i=Math.floor(n);i<=Math.min(89,Math.floor(s));i++)for(const l of o)u.push(`${i}_${l}`);return u}static dayOf(t){return new Date(t*f.HOUR_MS).toISOString().slice(0,10)}static merge(t,e,c,n,s){const a=new Map;for(const o of t){const u=o.points.filter(h=>h.t>=c&&h.t<=n&&I.groundDistanceKm(e,h)<=s);if(u.length===0)continue;const i=`${o.nonIcao?"~":""}${o.icao}`,l=a.get(i);l?l.points.push(...u):a.set(i,{icao:o.icao,nonIcao:o.nonIcao,points:u})}const r=[...a.values()];for(const o of r)o.points.sort((u,i)=>u.t-i.t);return r.sort((o,u)=>o.icao-u.icao)}loadIndex(){return this.index??=(async()=>{for(const t of this.indexUrls)try{const e=await this.fetchImpl(t);if(e.ok)return{index:await e.json(),base:t}}catch{}})(),this.index}tileOf(t,e,c){const n=f.dayOf(e),s=String(e%24).padStart(2,"0"),a=`${n}/${s}/${c}`;let r=this.tiles.get(a);return r||(r=this.hourIndex(t,n,s).then(async o=>{const u=o[c];if(!u)return[];const[i,l]=u,h=await this.fetchImpl(new URL(`${n}/${s}.pack`,t).href,{headers:{Range:`bytes=${i}-${i+l-1}`}});if(!h.ok)throw new Error(`The pack of ${n} ${s} h answered ${h.status}`);const p=new Uint8Array(await h.arrayBuffer()),g=h.status===206?p:p.subarray(i,i+l);return f.tracksOf(await f.gunzip(g),e)}),r.catch(()=>this.tiles.delete(a)),this.tiles.set(a,r)),r}hourIndex(t,e,c){const n=`${e}/${c}`;let s=this.hours.get(n);return s||(s=this.fetchImpl(new URL(`${e}/${c}.json`,t).href).then(a=>{if(a.status===404)return{};if(!a.ok)throw new Error(`The index of ${e} ${c} h answered ${a.status}`);return a.json()}),s.catch(()=>this.hours.delete(n)),this.hours.set(n,s)),s}static async gunzip(t){const e=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));return new Uint8Array(await new Response(e).arrayBuffer())}static tracksOf(t,e){const c=new Map;for(const n of d.decode(t)){const s=`${n.nonIcao?"~":""}${n.icao}`;let a=c.get(s);a||c.set(s,a={icao:n.icao,nonIcao:n.nonIcao,points:[]}),a.points.push({t:e*f.HOUR_MS+n.secondsInHour*1e3,lat:n.lat,lng:n.lng,altitudeFt:n.altitudeFt,groundSpeedKt:n.groundSpeedKt,trackDeg:n.trackDeg})}return[...c.values()]}}export{f as AdsbLolArchiveProvider,w as UFOATHOME_AIRCRAFT_INDEX_URL};
1
+ import{aR as M,aS as y,aK as I}from"./rr0-sighting-editor.mjs";class d{static RECORD_BYTES=20;static NON_ICAO_FLAG=1<<24;static UNKNOWN=65535;static MAX_DT=35999;static decode(t){if(t.length%d.RECORD_BYTES!==0)throw new Error(`An aircraft tile is a multiple of ${d.RECORD_BYTES} bytes, not ${t.length}`);const e=new DataView(t.buffer,t.byteOffset,t.byteLength),c=[];for(let n=0;n<t.length;n+=d.RECORD_BYTES){const s=e.getUint32(n,!0),a=e.getUint16(n+16,!0),r=e.getUint16(n+18,!0);c.push({icao:s&16777215,nonIcao:(s&d.NON_ICAO_FLAG)!==0,secondsInHour:e.getUint16(n+4,!0)/10,lat:e.getInt32(n+6,!0)/1e5,lng:e.getInt32(n+10,!0)/1e5,altitudeFt:e.getInt16(n+14,!0)*25,groundSpeedKt:a===d.UNKNOWN?void 0:a/10,trackDeg:r===d.UNKNOWN?void 0:r/10})}return c}}const w="https://ufoathome.org/aircraft/index.json";class f{citation=M;static DEFAULT_RADIUS_KM=150;static FLAG_MILITARY=1;static FLAG_PIA=4;static FLAG_LADD=8;static KM_PER_DEG=111.32;static HOUR_MS=36e5;fetchImpl;indexUrls;index;hours=new Map;tiles=new Map;shards=new Map;constructor(t={}){this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.indexUrls=t.indexUrls??f.defaultIndexUrls()}static defaultIndexUrls(){const t=[];return typeof location<"u"&&/^https?:$/.test(location.protocol)&&t.push(new URL("/aircraft/index.json",location.href).href),t.includes(w)||t.push(w),t}mayCover(t){return y.mayCover(t)}async between(t,e,c,n=f.DEFAULT_RADIUS_KM){const s=await this.loadIndex();if(!s)return{status:"failed"};const a=[];for(let o=Math.floor(e/f.HOUR_MS);o<=Math.floor(c/f.HOUR_MS);o++)a.push(o);if(!a.every(o=>s.index.days.includes(f.dayOf(o))))return{status:"outside"};const r=f.tilesAround(t,n);try{const o=(await Promise.all(a.flatMap(u=>r.map(i=>this.tileOf(s.base,u,i))))).flat();return{status:"found",tracks:f.merge(o,t,e,c,n)}}catch{return{status:"failed"}}}async describe(t,e){const c=await this.loadIndex();if(!c)return;const n=t.icao.toString(16).padStart(6,"0"),s=t.nonIcao?"non-icao":n.slice(0,2),a=`${e}/${s}`;let r=this.shards.get(a);r||(r=this.fetchImpl(new URL(`${e}/aircraft/${s}.json`,c.base).href).then(g=>g.ok?g.json():{}).catch(()=>({})),this.shards.set(a,r));const o=(await r)[t.nonIcao?`~${n}`:n];if(!o)return;const[u,i,l,h=0]=o,p={registration:u||void 0,type:i||void 0,category:l||void 0,military:(h&f.FLAG_MILITARY)!==0||void 0,restricted:(h&(f.FLAG_PIA|f.FLAG_LADD))!==0||void 0};return Object.values(p).some(g=>g!==void 0)?p:void 0}static tilesAround(t,e){const c=e/f.KM_PER_DEG,n=Math.max(-90,t.lat-c),s=Math.min(90,t.lat+c),a=Math.cos(Math.max(Math.abs(n),Math.abs(s))*Math.PI/180),r=a<1e-6?180:e/(f.KM_PER_DEG*a),o=new Set;if(r>=180)for(let i=-180;i<180;i++)o.add(i);else for(let i=Math.floor(t.lng-r);i<=Math.floor(t.lng+r);i++)o.add(I.wrapLongitude(i));const u=[];for(let i=Math.floor(n);i<=Math.min(89,Math.floor(s));i++)for(const l of o)u.push(`${i}_${l}`);return u}static dayOf(t){return new Date(t*f.HOUR_MS).toISOString().slice(0,10)}static merge(t,e,c,n,s){const a=new Map;for(const o of t){const u=o.points.filter(h=>h.t>=c&&h.t<=n&&I.groundDistanceKm(e,h)<=s);if(u.length===0)continue;const i=`${o.nonIcao?"~":""}${o.icao}`,l=a.get(i);l?l.points.push(...u):a.set(i,{icao:o.icao,nonIcao:o.nonIcao,points:u})}const r=[...a.values()];for(const o of r)o.points.sort((u,i)=>u.t-i.t);return r.sort((o,u)=>o.icao-u.icao)}loadIndex(){return this.index??=(async()=>{for(const t of this.indexUrls)try{const e=await this.fetchImpl(t);if(e.ok)return{index:await e.json(),base:t}}catch{}})(),this.index}tileOf(t,e,c){const n=f.dayOf(e),s=String(e%24).padStart(2,"0"),a=`${n}/${s}/${c}`;let r=this.tiles.get(a);return r||(r=this.hourIndex(t,n,s).then(async o=>{const u=o[c];if(!u)return[];const[i,l]=u,h=await this.fetchImpl(new URL(`${n}/${s}.pack`,t).href,{headers:{Range:`bytes=${i}-${i+l-1}`}});if(!h.ok)throw new Error(`The pack of ${n} ${s} h answered ${h.status}`);const p=new Uint8Array(await h.arrayBuffer()),g=h.status===206?p:p.subarray(i,i+l);return f.tracksOf(await f.gunzip(g),e)}),r.catch(()=>this.tiles.delete(a)),this.tiles.set(a,r)),r}hourIndex(t,e,c){const n=`${e}/${c}`;let s=this.hours.get(n);return s||(s=this.fetchImpl(new URL(`${e}/${c}.json`,t).href).then(a=>{if(a.status===404)return{};if(!a.ok)throw new Error(`The index of ${e} ${c} h answered ${a.status}`);return a.json()}),s.catch(()=>this.hours.delete(n)),this.hours.set(n,s)),s}static async gunzip(t){const e=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));return new Uint8Array(await new Response(e).arrayBuffer())}static tracksOf(t,e){const c=new Map;for(const n of d.decode(t)){const s=`${n.nonIcao?"~":""}${n.icao}`;let a=c.get(s);a||c.set(s,a={icao:n.icao,nonIcao:n.nonIcao,points:[]}),a.points.push({t:e*f.HOUR_MS+n.secondsInHour*1e3,lat:n.lat,lng:n.lng,altitudeFt:n.altitudeFt,groundSpeedKt:n.groundSpeedKt,trackDeg:n.trackDeg})}return[...c.values()]}}export{f as AdsbLolArchiveProvider,w as UFOATHOME_AIRCRAFT_INDEX_URL};
@@ -1 +1 @@
1
- import{bC as h,a as p}from"./rr0-sighting-editor.mjs";import{N as m}from"./NearestApproach-O8k2n_qL.js";import{CoverageAssessor as S}from"./CoverageAssessor-DjY8iKp5.js";class s{about="observer";static PAGE_WORDS=250;static ARTICLE_WORDS=500;static CLOSE_M=150;static WEIGHTS={witnesses:.25,occupation:.2,relation:.15,geography:.15,activity:.15,age:.1};static OCCUPATIONS={student:.3,worker:.5,farmer:.5,homemaker:.5,merchant:.7,business:.7,employee:.7,artist:.7,technician:.9,police:.9,pilot:.9,military:1};static RELATIONS={friends:.3,family:.6,professional:.8,none:1};static ACTIVITIES={leisure:.3,travelling:.6,cultural:.8,working:1};static FACTORS=h;static PENDING="pending";static WEAKEST_FIRST=["fitted","assumed","derived","stated","measured","established"];async assess(t){const e=t.account??{},i=this.information(t,e),n=this.strangeness(t,e),u=this.reliability(t,e),v=i.value,r=n.filter(d=>d.value>0).length/s.FACTORS.length,c=s.WEIGHTS,a=Object.keys(c).reduce((d,l)=>d+c[l]*u[l].value,0),o=[this.criterion("bg-information",i),...s.FACTORS.map((d,l)=>this.criterion(`bg-${d}`,n[l])),...Object.keys(c).map(d=>this.criterion(`bg-${d}`,u[d]))],b=Object.values(e.strangeness??{}).some(d=>d!==void 0);return e.source===void 0||!b?{verdict:s.PENDING,factors:{q:v,sigma:r,pi:a},criteria:o}:{score:v*r*a,factors:{q:v,sigma:r,pi:a},criteria:o}}criterion(t,e){return{id:t,value:e.value,basis:e.basis,paths:e.basis===void 0?[]:e.paths}}information(t,e){const i=e.source;if(i===void 0)return{value:0,paths:[]};const n=this.basis(t,"account.source"),u=e.enquiryMinutes,v=(a,o,b)=>u===void 0?{value:b,basis:this.weakest(n,"assumed"),paths:["account.source"]}:{value:u>=a?o:b,basis:this.weakest(n,this.basis(t,"account.enquiryMinutes")),paths:["account.source","account.enquiryMinutes"]},r=this.words(t),c=(a,o,b)=>({value:r>=a?o:b,basis:this.weakest(n,"derived"),paths:["account.source","event.description"]});switch(i){case"on-site":return v(120,1,.9);case"interview":return v(60,.9,.8);case"telephone":return v(30,.7,.6);case"questionnaire":return e.followedUp?c(s.PAGE_WORDS,.7,.6):{value:.6,basis:n,paths:["account.source"]};case"letter":case"social-media":return e.followedUp?c(s.PAGE_WORDS,.6,.5):c(s.PAGE_WORDS,.4,.3);case"press":return c(s.ARTICLE_WORDS,.2,.1)}}words(t){return(p.any.read(t.event.description)??"").split(/\s+/).filter(i=>i!=="").length}strangeness(t,e){const i=e.strangeness??{},n=s.FACTORS.map(r=>{const c=i[r];if(c!==void 0){const a=`account.strangeness.${r}`;return{value:c?1:0,basis:this.basis(t,a),paths:[a]}}switch(r){case"detection":{const a=t.instrument.category;return{value:a==="eye"||a==="binoculars"?0:1,basis:"derived",paths:["instrumentId"]}}case"close":{const a=m.of(t);return a===void 0?{value:0,paths:[]}:{value:a.m<=s.CLOSE_M?1:0,basis:a.basis,paths:a.paths}}case"beings":{const a=t.decor.map((o,b)=>({object:o,index:b})).filter(({object:o})=>o.kind==="entity");return a.length>0?{value:1,basis:"stated",paths:a.map(({index:o})=>`decor.${o}`)}:{value:0,basis:"derived",paths:["decor"]}}default:return{value:0,paths:[]}}}),u=s.FACTORS.indexOf("beings");return!["appearance","movement","incongruity"].some(r=>n[s.FACTORS.indexOf(r)].value>0)&&n[u].value>0&&(n[u]={...n[u],value:0}),n}reliability(t,e){const i=t.observerCount,n=i===1,u=i===1?.3:i===2?.5:i<=5?.7:i<=10?.9:1,v=e.observerGraduate?{value:1,basis:this.basis(t,"account.observerGraduate"),paths:["account.observerGraduate"]}:e.observerOccupationKind===void 0?{value:0,paths:[]}:{value:s.OCCUPATIONS[e.observerOccupationKind],basis:this.basis(t,"account.observerOccupationKind"),paths:["account.observerOccupationKind"]},r=n?{value:.6,basis:"derived",paths:["decor"]}:e.observersRelation===void 0?{value:0,paths:[]}:{value:s.RELATIONS[e.observersRelation],basis:this.basis(t,"account.observersRelation"),paths:["account.observersRelation"]},c=e.activity!==void 0?{value:s.ACTIVITIES[e.activity],basis:this.basis(t,"account.activity"),paths:["account.activity"]}:t.vehicle!==void 0?{value:s.ACTIVITIES.travelling,basis:"derived",paths:["vehicle"]}:{value:0,paths:[]},a=e.observerAgeYears,o=a===void 0?{value:0,paths:[]}:{value:a<10||a>75?.2:a<18?.4:a<35?.6:a<65?1:.8,basis:this.basis(t,"account.observerAgeYears"),paths:["account.observerAgeYears"]};return{witnesses:{value:u,basis:"derived",paths:["decor"]},occupation:v,relation:r,geography:{value:.5,basis:"derived",paths:["decor"]},activity:c,age:o}}basis(t,e){return S.basisAt(e,t)??"stated"}weakest(...t){return s.WEAKEST_FIRST.find(e=>t.includes(e))}}export{s as BallesterGuaspAssessor};
1
+ import{bD as h,a as p}from"./rr0-sighting-editor.mjs";import{N as m}from"./NearestApproach-D6tQo7dk.js";import{CoverageAssessor as S}from"./CoverageAssessor-DD1kSvun.js";class s{about="observer";static PAGE_WORDS=250;static ARTICLE_WORDS=500;static CLOSE_M=150;static WEIGHTS={witnesses:.25,occupation:.2,relation:.15,geography:.15,activity:.15,age:.1};static OCCUPATIONS={student:.3,worker:.5,farmer:.5,homemaker:.5,merchant:.7,business:.7,employee:.7,artist:.7,technician:.9,police:.9,pilot:.9,military:1};static RELATIONS={friends:.3,family:.6,professional:.8,none:1};static ACTIVITIES={leisure:.3,travelling:.6,cultural:.8,working:1};static FACTORS=h;static PENDING="pending";static WEAKEST_FIRST=["fitted","assumed","derived","stated","measured","established"];async assess(t){const e=t.account??{},i=this.information(t,e),n=this.strangeness(t,e),u=this.reliability(t,e),v=i.value,r=n.filter(d=>d.value>0).length/s.FACTORS.length,c=s.WEIGHTS,a=Object.keys(c).reduce((d,l)=>d+c[l]*u[l].value,0),o=[this.criterion("bg-information",i),...s.FACTORS.map((d,l)=>this.criterion(`bg-${d}`,n[l])),...Object.keys(c).map(d=>this.criterion(`bg-${d}`,u[d]))],b=Object.values(e.strangeness??{}).some(d=>d!==void 0);return e.source===void 0||!b?{verdict:s.PENDING,factors:{q:v,sigma:r,pi:a},criteria:o}:{score:v*r*a,factors:{q:v,sigma:r,pi:a},criteria:o}}criterion(t,e){return{id:t,value:e.value,basis:e.basis,paths:e.basis===void 0?[]:e.paths}}information(t,e){const i=e.source;if(i===void 0)return{value:0,paths:[]};const n=this.basis(t,"account.source"),u=e.enquiryMinutes,v=(a,o,b)=>u===void 0?{value:b,basis:this.weakest(n,"assumed"),paths:["account.source"]}:{value:u>=a?o:b,basis:this.weakest(n,this.basis(t,"account.enquiryMinutes")),paths:["account.source","account.enquiryMinutes"]},r=this.words(t),c=(a,o,b)=>({value:r>=a?o:b,basis:this.weakest(n,"derived"),paths:["account.source","event.description"]});switch(i){case"on-site":return v(120,1,.9);case"interview":return v(60,.9,.8);case"telephone":return v(30,.7,.6);case"questionnaire":return e.followedUp?c(s.PAGE_WORDS,.7,.6):{value:.6,basis:n,paths:["account.source"]};case"letter":case"social-media":return e.followedUp?c(s.PAGE_WORDS,.6,.5):c(s.PAGE_WORDS,.4,.3);case"press":return c(s.ARTICLE_WORDS,.2,.1)}}words(t){return(p.any.read(t.event.description)??"").split(/\s+/).filter(i=>i!=="").length}strangeness(t,e){const i=e.strangeness??{},n=s.FACTORS.map(r=>{const c=i[r];if(c!==void 0){const a=`account.strangeness.${r}`;return{value:c?1:0,basis:this.basis(t,a),paths:[a]}}switch(r){case"detection":{const a=t.instrument.category;return{value:a==="eye"||a==="binoculars"?0:1,basis:"derived",paths:["instrumentId"]}}case"close":{const a=m.of(t);return a===void 0?{value:0,paths:[]}:{value:a.m<=s.CLOSE_M?1:0,basis:a.basis,paths:a.paths}}case"beings":{const a=t.decor.map((o,b)=>({object:o,index:b})).filter(({object:o})=>o.kind==="entity");return a.length>0?{value:1,basis:"stated",paths:a.map(({index:o})=>`decor.${o}`)}:{value:0,basis:"derived",paths:["decor"]}}default:return{value:0,paths:[]}}}),u=s.FACTORS.indexOf("beings");return!["appearance","movement","incongruity"].some(r=>n[s.FACTORS.indexOf(r)].value>0)&&n[u].value>0&&(n[u]={...n[u],value:0}),n}reliability(t,e){const i=t.observerCount,n=i===1,u=i===1?.3:i===2?.5:i<=5?.7:i<=10?.9:1,v=e.observerGraduate?{value:1,basis:this.basis(t,"account.observerGraduate"),paths:["account.observerGraduate"]}:e.observerOccupationKind===void 0?{value:0,paths:[]}:{value:s.OCCUPATIONS[e.observerOccupationKind],basis:this.basis(t,"account.observerOccupationKind"),paths:["account.observerOccupationKind"]},r=n?{value:.6,basis:"derived",paths:["decor"]}:e.observersRelation===void 0?{value:0,paths:[]}:{value:s.RELATIONS[e.observersRelation],basis:this.basis(t,"account.observersRelation"),paths:["account.observersRelation"]},c=e.activity!==void 0?{value:s.ACTIVITIES[e.activity],basis:this.basis(t,"account.activity"),paths:["account.activity"]}:t.vehicle!==void 0?{value:s.ACTIVITIES.travelling,basis:"derived",paths:["vehicle"]}:{value:0,paths:[]},a=e.observerAgeYears,o=a===void 0?{value:0,paths:[]}:{value:a<10||a>75?.2:a<18?.4:a<35?.6:a<65?1:.8,basis:this.basis(t,"account.observerAgeYears"),paths:["account.observerAgeYears"]};return{witnesses:{value:u,basis:"derived",paths:["decor"]},occupation:v,relation:r,geography:{value:.5,basis:"derived",paths:["decor"]},activity:c,age:o}}basis(t,e){return S.basisAt(e,t)??"stated"}weakest(...t){return s.WEAKEST_FIRST.find(e=>t.includes(e))}}export{s as BallesterGuaspAssessor};
@@ -1,4 +1,4 @@
1
- import{n as T,_ as c,b5 as I,$ as p,a0 as L,I as x,Y as w,Z as E,a1 as f,bh as M}from"./rr0-sighting-editor.mjs";import{L as u}from"./LaserBeam-Drpkr84G.js";import{S as _}from"./SkyEventEditorStyle-CvY_AhbI.js";const O=T.catalog({en:()=>c(()=>import("./BeamParameterTexts_en-DZB75ouZ.js"),[],import.meta.url).then(l=>l.beamParameterTexts_en),fr:()=>c(()=>import("./BeamParameterTexts_fr-BHG3fW40.js"),[],import.meta.url).then(l=>l.beamParameterTexts_fr),es:()=>c(()=>import("./BeamParameterTexts_es-AeZmsufG.js"),[],import.meta.url).then(l=>l.beamParameterTexts_es),it:()=>c(()=>import("./BeamParameterTexts_it-CPwmQX-g.js"),[],import.meta.url).then(l=>l.beamParameterTexts_it)});class h{static LIGHT_TITLE="light";static BEAM="beam";static WHEN="when";static nextPlace(e){const t=e[e.length-1]??{lat:0,lng:0,altitudeM:0},i=e[e.length-2];return i?{lat:2*t.lat-i.lat,lng:2*t.lng-i.lng,altitudeM:2*t.altitudeM-i.altitudeM}:{lat:t.lat,lng:t.lng+500/(111320*Math.max(.05,Math.cos(t.lat*Math.PI/180))),altitudeM:t.altitudeM}}static instant(e,t,i,s=!1){return{type:"number",key:e,min:-3600,max:36e3,step:.1,unit:"s",scale:.001,label:t,hint:i,...s?{required:s}:{}}}static SET={kind:"beam",title:"beam",parameters:[{type:"said",key:"title",label:"name",group:h.BEAM},{type:"number",key:"divergenceMrad",min:.001,max:1e3,step:.001,unit:"mrad",group:h.BEAM,effective:()=>u.DEFAULT_DIVERGENCE_MRAD,label:"divergence",hint:"howFastItWidensFullAngle"},{type:"number",key:"apertureM",min:.001,max:10,step:.001,unit:"m",group:h.BEAM,effective:()=>u.DEFAULT_APERTURE_M,label:"widthAtTheEmitter"},{type:"number",key:"patchiness",min:0,max:100,step:1,unit:"%",scale:100,group:h.BEAM,effective:()=>u.DEFAULT_PATCHINESS,label:"unevenHaze",hint:"howUnevenlyTheHazeItCrosses"}]};static WAVELENGTH_HINT="itsColour532ForTheGreen";static POWER_HINT="theOpticalPowerItCarriesIts";static WAVELENGTH_LABEL="wavelength";static POWER_LABEL="power";static LIGHT={kind:"beam-light",title:h.LIGHT_TITLE,parameters:[{type:"number",key:"wavelengthNm",min:380,max:780,step:1,unit:"nm",required:!0,label:h.WAVELENGTH_LABEL,hint:h.WAVELENGTH_HINT},{type:"number",key:"powerW",min:.001,max:1e5,step:.001,unit:"W",required:!0,label:h.POWER_LABEL,hint:h.POWER_HINT}]};static LIGHT_KEY={kind:"beam-light-key",title:h.LIGHT_TITLE,parameters:[h.instant("t","time","secondsOfTheRecording",!0),{type:"number",key:"wavelengthNm",min:380,max:780,step:1,unit:"nm",label:h.WAVELENGTH_LABEL,hint:h.WAVELENGTH_HINT,effective:(e,t)=>t?.wavelengthNm},{type:"number",key:"powerW",min:.001,max:1e5,step:.001,unit:"W",label:h.POWER_LABEL,hint:h.POWER_HINT,effective:(e,t)=>t?.powerW}]};static ON={kind:"beam-on",title:h.WHEN,parameters:[h.instant("fromT","onFrom","secondsOfTheRecordingEmptyFrom"),h.instant("untilT","offAt","secondsOfTheRecordingEmptyUntil")]};static MOVE_KEY={kind:"beam-move-key",title:"pathAtAnInstant",parameters:[h.instant("t","time","secondsOfTheRecording",!0)]};static hexOf(e){const t=u.colourOf(e),i=Math.max(...t,1e-9),s=n=>{const o=Math.min(1,Math.max(0,n/i)),a=o<=.0031308?12.92*o:1.055*o**(1/2.4)-.055;return Math.round(a*255).toString(16).padStart(2,"0")};return`#${t.map(s).join("")}`}static wavelengthOf(e){const t=h.hueOf(e);let i=532,s=1/0;for(let n=400;n<=700;n++){const o=Math.abs((h.hueOf(h.hexOf(n))-t+540)%360-180);o<s&&(s=o,i=n)}return i}static hueOf(e){const t=Number.parseInt(e.replace("#",""),16),[i,s,n]=[t>>16&255,t>>8&255,t&255].map(b=>b/255),o=Math.max(i,s,n),a=Math.min(i,s,n);if(o===a)return 0;const r=o-a;return((o===i?(s-n)/r%6:o===s?(n-i)/r+2:(i-s)/r+4)*60+360)%360}static PLACE={kind:"beam-place",title:"pointOfThePath",parameters:[{type:"position",key:"lat",secondKey:"lng",saidKey:"saidPosition",native:"geo",step:.1,label:"position"},{type:"number",key:"altitudeM",min:-500,max:1e5,step:.1,unit:"m",required:!0,label:"altitude",hint:"aboveTheSeaNotTheGround"}]};static publish(){I.publish(h.SET)}}const A=T.catalog({en:()=>c(()=>import("./BeamEditorMessages_en-DDvPWAdd.js"),[],import.meta.url).then(l=>l.beamEditorMessages_en),fr:()=>c(()=>import("./BeamEditorMessages_fr-CtX6uP-x.js"),[],import.meta.url).then(l=>l.beamEditorMessages_fr),es:()=>c(()=>import("./BeamEditorMessages_es-BhCkhUkN.js"),[],import.meta.url).then(l=>l.beamEditorMessages_es),it:()=>c(()=>import("./BeamEditorMessages_it-DVweRQFi.js"),[],import.meta.url).then(l=>l.beamEditorMessages_it)});class g{constructor(e,t,i){this.container=e,this.host=t,this.language=i,_.attach(e,"beam-editor",g.STYLE),I.of("beam")||h.publish(),this.ready=this.setLanguage(i)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;timeline;row="on";onForm;lightForm;lightKeyForm;lightIndex;moveKeyForm;moveIndex;places;placeForm;placeIndex=0;language;shown=[];static STYLE='.beam-editor { flex-basis: 100%; min-width: 0; } .beam-editor #beam-timeline { flex-basis: 100%; min-width: 0; padding: 4px 0; } .beam-editor #beam-list, .beam-editor #beam-places { flex-basis: 100%; min-width: 0; } .beam-editor .launch-editor, .beam-editor .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .beam-editor .launch-fields { flex-basis: 100%; min-width: 0; } .beam-editor [hidden] { display: none !important; } .beam-editor select { min-width: 0; width: 100%; } .beam-editor .launch-intro { flex-basis: 100%; margin: 0; } .beam-editor .launch-track { flex-basis: 100%; margin: 0; } .beam-editor .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .beam-editor .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; } .beam-editor input, .beam-editor select { max-width: 100%; box-sizing: border-box; } .beam-editor input[type="text"] { width: 12em; } .beam-editor #launch-title { width: 18em; } .beam-editor label { min-width: 0; max-width: 100%; } .beam-editor input.parameter-derived::placeholder { opacity: .65; } .beam-editor .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(e){const t=++this.languageToken;this.language=e;const[i,s]=await Promise.all([A.load(e),O.load(e)]);t===this.languageToken&&(this.messages=i,this.parameterTexts=s,this.render(),this.sync())}sync(){if(!this.messages)return;const e=this.beams;this.shown=[...e],e.some(s=>s.id===this.currentId)||(this.currentId=e[0]?.id),this.list?.setItems(e.map(s=>({id:s.id,label:this.labelOf(s)})),this.currentId),this.syncAddState();const t=this.current;if(this.element("beam-fields").hidden=t===void 0,!t)return;const i={said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()};this.form??=new p(this.element("beam-parameters"),this.language,"beam.",i),this.form.show(this.resolved(h.SET),this.targetOfBeam(),()=>this.written()),this.syncDetail(!0)}refresh(){if(!this.messages)return;this.syncAddState();const e=this.beams;if(e.length===this.shown.length&&e.every((t,i)=>t.id===this.shown[i].id)){this.syncTimeline();return}this.sync()}setTime(e){this.messages&&this.timeline?.setTime(e)}syncAddState(){const e=this.pathOfNew()!==void 0;this.list?.setAddState(e,e?void 0:this.messages.addBeamNowhere)}get current(){return this.beams.find(e=>e.id===this.currentId)}show(e){this.messages&&(this.currentId=e,this.row="on",this.lightIndex=void 0,this.moveIndex=void 0,this.placeIndex=0,this.sync())}resolved(e){return L.resolve(e,this.parameterTexts)}render(){if(!this.messages)return;const e=this.messages;this.form=void 0,this.container.innerHTML=`<div class="launch-editor">
1
+ import{n as T,_ as c,b6 as I,$ as p,a0 as L,I as x,Y as w,Z as E,a1 as f,bi as M}from"./rr0-sighting-editor.mjs";import{L as u}from"./LaserBeam-tqM2fwHf.js";import{S as _}from"./SkyEventEditorStyle-CvY_AhbI.js";const O=T.catalog({en:()=>c(()=>import("./BeamParameterTexts_en-DZB75ouZ.js"),[],import.meta.url).then(l=>l.beamParameterTexts_en),fr:()=>c(()=>import("./BeamParameterTexts_fr-BHG3fW40.js"),[],import.meta.url).then(l=>l.beamParameterTexts_fr),es:()=>c(()=>import("./BeamParameterTexts_es-AeZmsufG.js"),[],import.meta.url).then(l=>l.beamParameterTexts_es),it:()=>c(()=>import("./BeamParameterTexts_it-CPwmQX-g.js"),[],import.meta.url).then(l=>l.beamParameterTexts_it)});class h{static LIGHT_TITLE="light";static BEAM="beam";static WHEN="when";static nextPlace(e){const t=e[e.length-1]??{lat:0,lng:0,altitudeM:0},i=e[e.length-2];return i?{lat:2*t.lat-i.lat,lng:2*t.lng-i.lng,altitudeM:2*t.altitudeM-i.altitudeM}:{lat:t.lat,lng:t.lng+500/(111320*Math.max(.05,Math.cos(t.lat*Math.PI/180))),altitudeM:t.altitudeM}}static instant(e,t,i,s=!1){return{type:"number",key:e,min:-3600,max:36e3,step:.1,unit:"s",scale:.001,label:t,hint:i,...s?{required:s}:{}}}static SET={kind:"beam",title:"beam",parameters:[{type:"said",key:"title",label:"name",group:h.BEAM},{type:"number",key:"divergenceMrad",min:.001,max:1e3,step:.001,unit:"mrad",group:h.BEAM,effective:()=>u.DEFAULT_DIVERGENCE_MRAD,label:"divergence",hint:"howFastItWidensFullAngle"},{type:"number",key:"apertureM",min:.001,max:10,step:.001,unit:"m",group:h.BEAM,effective:()=>u.DEFAULT_APERTURE_M,label:"widthAtTheEmitter"},{type:"number",key:"patchiness",min:0,max:100,step:1,unit:"%",scale:100,group:h.BEAM,effective:()=>u.DEFAULT_PATCHINESS,label:"unevenHaze",hint:"howUnevenlyTheHazeItCrosses"}]};static WAVELENGTH_HINT="itsColour532ForTheGreen";static POWER_HINT="theOpticalPowerItCarriesIts";static WAVELENGTH_LABEL="wavelength";static POWER_LABEL="power";static LIGHT={kind:"beam-light",title:h.LIGHT_TITLE,parameters:[{type:"number",key:"wavelengthNm",min:380,max:780,step:1,unit:"nm",required:!0,label:h.WAVELENGTH_LABEL,hint:h.WAVELENGTH_HINT},{type:"number",key:"powerW",min:.001,max:1e5,step:.001,unit:"W",required:!0,label:h.POWER_LABEL,hint:h.POWER_HINT}]};static LIGHT_KEY={kind:"beam-light-key",title:h.LIGHT_TITLE,parameters:[h.instant("t","time","secondsOfTheRecording",!0),{type:"number",key:"wavelengthNm",min:380,max:780,step:1,unit:"nm",label:h.WAVELENGTH_LABEL,hint:h.WAVELENGTH_HINT,effective:(e,t)=>t?.wavelengthNm},{type:"number",key:"powerW",min:.001,max:1e5,step:.001,unit:"W",label:h.POWER_LABEL,hint:h.POWER_HINT,effective:(e,t)=>t?.powerW}]};static ON={kind:"beam-on",title:h.WHEN,parameters:[h.instant("fromT","onFrom","secondsOfTheRecordingEmptyFrom"),h.instant("untilT","offAt","secondsOfTheRecordingEmptyUntil")]};static MOVE_KEY={kind:"beam-move-key",title:"pathAtAnInstant",parameters:[h.instant("t","time","secondsOfTheRecording",!0)]};static hexOf(e){const t=u.colourOf(e),i=Math.max(...t,1e-9),s=n=>{const o=Math.min(1,Math.max(0,n/i)),a=o<=.0031308?12.92*o:1.055*o**(1/2.4)-.055;return Math.round(a*255).toString(16).padStart(2,"0")};return`#${t.map(s).join("")}`}static wavelengthOf(e){const t=h.hueOf(e);let i=532,s=1/0;for(let n=400;n<=700;n++){const o=Math.abs((h.hueOf(h.hexOf(n))-t+540)%360-180);o<s&&(s=o,i=n)}return i}static hueOf(e){const t=Number.parseInt(e.replace("#",""),16),[i,s,n]=[t>>16&255,t>>8&255,t&255].map(b=>b/255),o=Math.max(i,s,n),a=Math.min(i,s,n);if(o===a)return 0;const r=o-a;return((o===i?(s-n)/r%6:o===s?(n-i)/r+2:(i-s)/r+4)*60+360)%360}static PLACE={kind:"beam-place",title:"pointOfThePath",parameters:[{type:"position",key:"lat",secondKey:"lng",saidKey:"saidPosition",native:"geo",step:.1,label:"position"},{type:"number",key:"altitudeM",min:-500,max:1e5,step:.1,unit:"m",required:!0,label:"altitude",hint:"aboveTheSeaNotTheGround"}]};static publish(){I.publish(h.SET)}}const A=T.catalog({en:()=>c(()=>import("./BeamEditorMessages_en-DDvPWAdd.js"),[],import.meta.url).then(l=>l.beamEditorMessages_en),fr:()=>c(()=>import("./BeamEditorMessages_fr-CtX6uP-x.js"),[],import.meta.url).then(l=>l.beamEditorMessages_fr),es:()=>c(()=>import("./BeamEditorMessages_es-BhCkhUkN.js"),[],import.meta.url).then(l=>l.beamEditorMessages_es),it:()=>c(()=>import("./BeamEditorMessages_it-DVweRQFi.js"),[],import.meta.url).then(l=>l.beamEditorMessages_it)});class g{constructor(e,t,i){this.container=e,this.host=t,this.language=i,_.attach(e,"beam-editor",g.STYLE),I.of("beam")||h.publish(),this.ready=this.setLanguage(i)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;timeline;row="on";onForm;lightForm;lightKeyForm;lightIndex;moveKeyForm;moveIndex;places;placeForm;placeIndex=0;language;shown=[];static STYLE='.beam-editor { flex-basis: 100%; min-width: 0; } .beam-editor #beam-timeline { flex-basis: 100%; min-width: 0; padding: 4px 0; } .beam-editor #beam-list, .beam-editor #beam-places { flex-basis: 100%; min-width: 0; } .beam-editor .launch-editor, .beam-editor .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .beam-editor .launch-fields { flex-basis: 100%; min-width: 0; } .beam-editor [hidden] { display: none !important; } .beam-editor select { min-width: 0; width: 100%; } .beam-editor .launch-intro { flex-basis: 100%; margin: 0; } .beam-editor .launch-track { flex-basis: 100%; margin: 0; } .beam-editor .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .beam-editor .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; } .beam-editor input, .beam-editor select { max-width: 100%; box-sizing: border-box; } .beam-editor input[type="text"] { width: 12em; } .beam-editor #launch-title { width: 18em; } .beam-editor label { min-width: 0; max-width: 100%; } .beam-editor input.parameter-derived::placeholder { opacity: .65; } .beam-editor .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(e){const t=++this.languageToken;this.language=e;const[i,s]=await Promise.all([A.load(e),O.load(e)]);t===this.languageToken&&(this.messages=i,this.parameterTexts=s,this.render(),this.sync())}sync(){if(!this.messages)return;const e=this.beams;this.shown=[...e],e.some(s=>s.id===this.currentId)||(this.currentId=e[0]?.id),this.list?.setItems(e.map(s=>({id:s.id,label:this.labelOf(s)})),this.currentId),this.syncAddState();const t=this.current;if(this.element("beam-fields").hidden=t===void 0,!t)return;const i={said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()};this.form??=new p(this.element("beam-parameters"),this.language,"beam.",i),this.form.show(this.resolved(h.SET),this.targetOfBeam(),()=>this.written()),this.syncDetail(!0)}refresh(){if(!this.messages)return;this.syncAddState();const e=this.beams;if(e.length===this.shown.length&&e.every((t,i)=>t.id===this.shown[i].id)){this.syncTimeline();return}this.sync()}setTime(e){this.messages&&this.timeline?.setTime(e)}syncAddState(){const e=this.pathOfNew()!==void 0;this.list?.setAddState(e,e?void 0:this.messages.addBeamNowhere)}get current(){return this.beams.find(e=>e.id===this.currentId)}show(e){this.messages&&(this.currentId=e,this.row="on",this.lightIndex=void 0,this.moveIndex=void 0,this.placeIndex=0,this.sync())}resolved(e){return L.resolve(e,this.parameterTexts)}render(){if(!this.messages)return;const e=this.messages;this.form=void 0,this.container.innerHTML=`<div class="launch-editor">
2
2
  <p class="launch-intro">${e.intro}</p>
3
3
  <div id="beam-list"></div>
4
4
  <div id="beam-fields" class="launch-fields">
@@ -1 +1 @@
1
- import{aU as V,ba as W,bb as H,aX as m,bc as v,bd as k,be as D}from"./rr0-sighting-editor.mjs";import{L as S}from"./LaserBeam-Drpkr84G.js";class x{static MAX_SEGMENTS=12e3;static MIN_PIXELS=2;static VERTICES_PER_SEGMENT=24;static HALO_RAD=.002;static HALO_SHARE=.15;static BRIGHTEST_RELATIVE=6e4;group=new V;mesh;positions=new Float32Array(x.MAX_SEGMENTS*x.VERTICES_PER_SEGMENT*3);colors=new Float32Array(x.MAX_SEGMENTS*x.VERTICES_PER_SEGMENT*3);segments=0;drawn=[];cut;constructor(){const s=new W;s.setAttribute("position",new H(this.positions,3)),s.setAttribute("color",new H(this.colors,3)),s.setDrawRange(0,0),this.mesh=new m(s,new v({vertexColors:!0,transparent:!0,blending:D,depthWrite:!1,fog:!1,side:k})),this.mesh.frustumCulled=!1,this.mesh.renderOrder=8,this.mesh.name="beams",this.group.name="beams",this.group.add(this.mesh)}get segmentCount(){return this.segments}get object(){return this.group}get drawnCount(){return this.segments}pick(s,t,e){return this.pickAt(s,t,e.toleranceRad)}update(s,t,e){const l=this.viewsOf(s,t,e);let r=0;this.segments=0,this.drawn=[];for(const h of l){const c=S.colourOf(h.wavelengthNm),i=this.place(h,t,e);this.drawn.push({id:h.id,points:i});for(let y=0;y+1<i.length&&!(this.segments>=x.MAX_SEGMENTS);y++){const E=this.pushSegment(r,i[y],i[y+1],h.wavelengthNm,c,e);E>r&&this.segments++,r=E}}const o=this.mesh.geometry;o.setDrawRange(0,r);for(const h of["position","color"]){const c=o.getAttribute(h);c.clearUpdateRanges(),r>0&&c.addUpdateRange(0,r*3),c.needsUpdate=!0}}viewsOf(s,t,e){const{lat:l,lng:r}=e.reference;(!this.cut||this.cut.lat!==l||this.cut.lng!==r||this.cut.air!==e.air)&&(this.cut={lat:l,lng:r,air:e.air,views:new Map});const o=this.cut.views,h=new Set(s);return S.onAt(s,t).map(c=>{if(!h.has(c))return S.viewOf(c,e.reference,e.air);let i=o.get(c);return i||o.set(c,i=S.viewOf(c,e.reference,e.air)),i})}place(s,t,e){const l=[],r=e.wind??{eastMS:0,northMS:0};for(const o of s.samples){const h=e.origin.x+o.eastM*e.eastScale,c=e.origin.z-o.northM,i=o.upM-e.siteElevationM;if(l.length>0&&i<e.groundYAt(h,c))break;const y=r.eastMS*o.dirEast+r.northMS*o.dirNorth,E=r.eastMS*o.dirNorth-r.northMS*o.dirEast,g=S.patchAt(o.fromSourceM,t,{windAlongMS:y,windAcrossMS:E,patchiness:s.patchiness});l.push({x:h,y:i,z:c,altitudeM:o.altitudeM,widthM:o.widthM,powerW:o.powerW,haze:g})}return l}static SMOOTH_RATIO=1.08;static MAX_HALVINGS=6;pushSegment(s,t,e,l,r,o,h=0){const c={x:e.x-t.x,y:e.y-t.y,z:e.z-t.z},i=Math.hypot(c.x,c.y,c.z);if(i<1e-6)return s;const y={x:c.x/i,y:c.y/i,z:c.z/i};if(Math.hypot((t.x+e.x)/2-o.eye.x,(t.y+e.y)/2-o.eye.y,(t.z+e.z)/2-o.eye.z)<.001)return s;const E=n=>{const u={x:o.eye.x-n.x,y:o.eye.y-n.y,z:o.eye.z-n.z},z=Math.hypot(u.x,u.y,u.z)||.001,d=(y.x*u.x+y.y*u.y+y.z*u.z)/z,a=Math.sqrt(Math.max(0,1-d*d)),w=S.coefficientsAt(o.air,l,n.altitudeM),p=S.phasedScattering({...w,aerosolPerM:w.aerosolPerM*n.haze},d);return{sinTurn:a,scattered:p,through:o.transmittanceTo(n.x,n.y,n.z)}},g=n=>x.MIN_PIXELS*o.pixelRad*Math.hypot(n.x-o.eye.x,n.y-o.eye.y,n.z-o.eye.z),N=n=>Math.hypot(n.x-o.eye.x,n.y-o.eye.y,n.z-o.eye.z),R=n=>Math.max(n.widthM,x.HALO_RAD*N(n)),f=n=>{const u=R(n)/g(n),z=Math.min(1,Math.max(0,u-1));return x.HALO_SHARE*z*z*(3-2*z)},O=new Map([t,e].map(n=>[n,E(n)])),M=(n,u,z)=>{const d=Math.max(u,g(n)),{sinTurn:a,scattered:w,through:p}=O.get(n),I=2*z*S.luminanceCdM2(n.powerW,l,w,d,a),L=r.map((C,X)=>Math.min(x.BRIGHTEST_RELATIVE,I*o.relativeScale*C*p[X])),_={x:o.eye.x-n.x,y:o.eye.y-n.y,z:o.eye.z-n.z},P=this.normalise(this.cross(y,_));return{point:n,half:d/2,level:L,across:P}},A=[[M(t,t.widthM,1-f(t)),M(e,e.widthM,1-f(e))],[M(t,R(t),f(t)),M(e,R(e),f(e))]],[G,T]=A[0].map(n=>Math.max(...n.level));if(h<x.MAX_HALVINGS&&Math.max(G,T)>x.SMOOTH_RATIO*Math.max(Math.min(G,T),1e-12)){const n={x:(t.x+e.x)/2,y:(t.y+e.y)/2,z:(t.z+e.z)/2,altitudeM:(t.altitudeM+e.altitudeM)/2,widthM:(t.widthM+e.widthM)/2,powerW:Math.sqrt(t.powerW*e.powerW),haze:(t.haze+e.haze)/2};return this.pushSegment(this.pushSegment(s,t,n,l,r,o,h+1),n,e,l,r,o,h+1)}if((s+x.VERTICES_PER_SEGMENT)*3>this.positions.length)return s;for(const n of A){if(n.every(a=>Math.max(...a.level)<=0))continue;const u=(a,w)=>{const p=s*3;this.positions[p]=a.point.x+a.across.x*a.half*w,this.positions[p+1]=a.point.y+a.across.y*a.half*w,this.positions[p+2]=a.point.z+a.across.z*a.half*w;const I=w===0?1:0;this.colors[p]=a.level[0]*I,this.colors[p+1]=a.level[1]*I,this.colors[p+2]=a.level[2]*I,s++},[z,d]=n;for(const a of[-1,1])u(z,a),u(z,0),u(d,a),u(z,0),u(d,0),u(d,a)}return s}pickAt(s,t,e){let l;for(const r of this.drawn)for(let o=0;o+1<r.points.length;o++){const h=r.points[o],c=r.points[o+1],i={x:c.x-h.x,y:c.y-h.y,z:c.z-h.z},y={x:h.x-s.x,y:h.y-s.y,z:h.z-s.z},E=i.x*i.x+i.y*i.y+i.z*i.z,g=i.x*t.x+i.y*t.y+i.z*t.z,N=i.x*y.x+i.y*y.y+i.z*y.z,R=t.x*y.x+t.y*y.y+t.z*y.z,f=E-g*g,O=f>1e-9?Math.min(1,Math.max(0,(g*R-N)/f)):0,M={x:h.x+i.x*O,y:h.y+i.y*O,z:h.z+i.z*O},A=(M.x-s.x)*t.x+(M.y-s.y)*t.y+(M.z-s.z)*t.z;if(A<=0)continue;const G=Math.hypot(M.x-s.x-t.x*A,M.y-s.y-t.y*A,M.z-s.z-t.z*A),T=Math.atan2(G,A);T<=e&&(!l||T<l.angle)&&(l={id:r.id,distanceM:Math.hypot(M.x-s.x,M.y-s.y,M.z-s.z),angle:T})}return l&&{id:l.id,distanceM:l.distanceM}}cross(s,t){return{x:s.y*t.z-s.z*t.y,y:s.z*t.x-s.x*t.z,z:s.x*t.y-s.y*t.x}}normalise(s){const t=Math.hypot(s.x,s.y,s.z)||1;return{x:s.x/t,y:s.y/t,z:s.z/t}}dispose(){this.mesh.geometry.dispose(),this.mesh.material.dispose(),this.group.removeFromParent()}}export{x as BeamSystem};
1
+ import{aV as W,bb as X,bc as H,aY as m,bd as v,be as k,bf as D}from"./rr0-sighting-editor.mjs";import{L as S}from"./LaserBeam-tqM2fwHf.js";class x{static MAX_SEGMENTS=12e3;static MIN_PIXELS=2;static VERTICES_PER_SEGMENT=24;static HALO_RAD=.002;static HALO_SHARE=.15;static BRIGHTEST_RELATIVE=6e4;group=new W;mesh;positions=new Float32Array(x.MAX_SEGMENTS*x.VERTICES_PER_SEGMENT*3);colors=new Float32Array(x.MAX_SEGMENTS*x.VERTICES_PER_SEGMENT*3);segments=0;drawn=[];cut;constructor(){const s=new X;s.setAttribute("position",new H(this.positions,3)),s.setAttribute("color",new H(this.colors,3)),s.setDrawRange(0,0),this.mesh=new m(s,new v({vertexColors:!0,transparent:!0,blending:D,depthWrite:!1,fog:!1,side:k})),this.mesh.frustumCulled=!1,this.mesh.renderOrder=8,this.mesh.name="beams",this.group.name="beams",this.group.add(this.mesh)}get segmentCount(){return this.segments}get object(){return this.group}get drawnCount(){return this.segments}pick(s,t,e){return this.pickAt(s,t,e.toleranceRad)}update(s,t,e){const l=this.viewsOf(s,t,e);let r=0;this.segments=0,this.drawn=[];for(const h of l){const c=S.colourOf(h.wavelengthNm),i=this.place(h,t,e);this.drawn.push({id:h.id,points:i});for(let y=0;y+1<i.length&&!(this.segments>=x.MAX_SEGMENTS);y++){const E=this.pushSegment(r,i[y],i[y+1],h.wavelengthNm,c,e);E>r&&this.segments++,r=E}}const o=this.mesh.geometry;o.setDrawRange(0,r);for(const h of["position","color"]){const c=o.getAttribute(h);c.clearUpdateRanges(),r>0&&c.addUpdateRange(0,r*3),c.needsUpdate=!0}}viewsOf(s,t,e){const{lat:l,lng:r}=e.reference;(!this.cut||this.cut.lat!==l||this.cut.lng!==r||this.cut.air!==e.air)&&(this.cut={lat:l,lng:r,air:e.air,views:new Map});const o=this.cut.views,h=new Set(s);return S.onAt(s,t).map(c=>{if(!h.has(c))return S.viewOf(c,e.reference,e.air);let i=o.get(c);return i||o.set(c,i=S.viewOf(c,e.reference,e.air)),i})}place(s,t,e){const l=[],r=e.wind??{eastMS:0,northMS:0};for(const o of s.samples){const h=e.origin.x+o.eastM*e.eastScale,c=e.origin.z-o.northM,i=o.upM-e.siteElevationM;if(l.length>0&&i<e.groundYAt(h,c))break;const y=r.eastMS*o.dirEast+r.northMS*o.dirNorth,E=r.eastMS*o.dirNorth-r.northMS*o.dirEast,g=S.patchAt(o.fromSourceM,t,{windAlongMS:y,windAcrossMS:E,patchiness:s.patchiness});l.push({x:h,y:i,z:c,altitudeM:o.altitudeM,widthM:o.widthM,powerW:o.powerW,haze:g})}return l}static SMOOTH_RATIO=1.08;static MAX_HALVINGS=6;pushSegment(s,t,e,l,r,o,h=0){const c={x:e.x-t.x,y:e.y-t.y,z:e.z-t.z},i=Math.hypot(c.x,c.y,c.z);if(i<1e-6)return s;const y={x:c.x/i,y:c.y/i,z:c.z/i};if(Math.hypot((t.x+e.x)/2-o.eye.x,(t.y+e.y)/2-o.eye.y,(t.z+e.z)/2-o.eye.z)<.001)return s;const E=n=>{const u={x:o.eye.x-n.x,y:o.eye.y-n.y,z:o.eye.z-n.z},z=Math.hypot(u.x,u.y,u.z)||.001,d=(y.x*u.x+y.y*u.y+y.z*u.z)/z,a=Math.sqrt(Math.max(0,1-d*d)),w=S.coefficientsAt(o.air,l,n.altitudeM),p=S.phasedScattering({...w,aerosolPerM:w.aerosolPerM*n.haze},d);return{sinTurn:a,scattered:p,through:o.transmittanceTo(n.x,n.y,n.z)}},g=n=>x.MIN_PIXELS*o.pixelRad*Math.hypot(n.x-o.eye.x,n.y-o.eye.y,n.z-o.eye.z),N=n=>Math.hypot(n.x-o.eye.x,n.y-o.eye.y,n.z-o.eye.z),R=n=>Math.max(n.widthM,x.HALO_RAD*N(n)),f=n=>{const u=R(n)/g(n),z=Math.min(1,Math.max(0,u-1));return x.HALO_SHARE*z*z*(3-2*z)},O=new Map([t,e].map(n=>[n,E(n)])),M=(n,u,z)=>{const d=Math.max(u,g(n)),{sinTurn:a,scattered:w,through:p}=O.get(n),I=2*z*S.luminanceCdM2(n.powerW,l,w,d,a),L=r.map((C,V)=>Math.min(x.BRIGHTEST_RELATIVE,I*o.relativeScale*C*p[V])),_={x:o.eye.x-n.x,y:o.eye.y-n.y,z:o.eye.z-n.z},P=this.normalise(this.cross(y,_));return{point:n,half:d/2,level:L,across:P}},A=[[M(t,t.widthM,1-f(t)),M(e,e.widthM,1-f(e))],[M(t,R(t),f(t)),M(e,R(e),f(e))]],[G,T]=A[0].map(n=>Math.max(...n.level));if(h<x.MAX_HALVINGS&&Math.max(G,T)>x.SMOOTH_RATIO*Math.max(Math.min(G,T),1e-12)){const n={x:(t.x+e.x)/2,y:(t.y+e.y)/2,z:(t.z+e.z)/2,altitudeM:(t.altitudeM+e.altitudeM)/2,widthM:(t.widthM+e.widthM)/2,powerW:Math.sqrt(t.powerW*e.powerW),haze:(t.haze+e.haze)/2};return this.pushSegment(this.pushSegment(s,t,n,l,r,o,h+1),n,e,l,r,o,h+1)}if((s+x.VERTICES_PER_SEGMENT)*3>this.positions.length)return s;for(const n of A){if(n.every(a=>Math.max(...a.level)<=0))continue;const u=(a,w)=>{const p=s*3;this.positions[p]=a.point.x+a.across.x*a.half*w,this.positions[p+1]=a.point.y+a.across.y*a.half*w,this.positions[p+2]=a.point.z+a.across.z*a.half*w;const I=w===0?1:0;this.colors[p]=a.level[0]*I,this.colors[p+1]=a.level[1]*I,this.colors[p+2]=a.level[2]*I,s++},[z,d]=n;for(const a of[-1,1])u(z,a),u(z,0),u(d,a),u(z,0),u(d,0),u(d,a)}return s}pickAt(s,t,e){let l;for(const r of this.drawn)for(let o=0;o+1<r.points.length;o++){const h=r.points[o],c=r.points[o+1],i={x:c.x-h.x,y:c.y-h.y,z:c.z-h.z},y={x:h.x-s.x,y:h.y-s.y,z:h.z-s.z},E=i.x*i.x+i.y*i.y+i.z*i.z,g=i.x*t.x+i.y*t.y+i.z*t.z,N=i.x*y.x+i.y*y.y+i.z*y.z,R=t.x*y.x+t.y*y.y+t.z*y.z,f=E-g*g,O=f>1e-9?Math.min(1,Math.max(0,(g*R-N)/f)):0,M={x:h.x+i.x*O,y:h.y+i.y*O,z:h.z+i.z*O},A=(M.x-s.x)*t.x+(M.y-s.y)*t.y+(M.z-s.z)*t.z;if(A<=0)continue;const G=Math.hypot(M.x-s.x-t.x*A,M.y-s.y-t.y*A,M.z-s.z-t.z*A),T=Math.atan2(G,A);T<=e&&(!l||T<l.angle)&&(l={id:r.id,distanceM:Math.hypot(M.x-s.x,M.y-s.y,M.z-s.z),angle:T})}return l&&{id:l.id,distanceM:l.distanceM}}cross(s,t){return{x:s.y*t.z-s.z*t.y,y:s.z*t.x-s.x*t.z,z:s.x*t.y-s.y*t.x}}normalise(s){const t=Math.hypot(s.x,s.y,s.z)||1;return{x:s.x/t,y:s.y/t,z:s.z/t}}dispose(){this.mesh.geometry.dispose(),this.mesh.material.dispose(),this.group.removeFromParent()}}export{x as BeamSystem};
@@ -1,4 +1,4 @@
1
- import{n as k,_ as c,b8 as u,b5 as y,$ as O,a1 as x,a0 as T,I as w,Y as M,Z as I,a2 as F,a3 as A}from"./rr0-sighting-editor.mjs";import{S}from"./SkyEventEditorStyle-CvY_AhbI.js";import{B as v,a as m,F as E}from"./BirdFlock-O7K_g8y7.js";const L=k.catalog({en:()=>c(()=>import("./BirdParameterTexts_en-C6FkYUww.js"),[],import.meta.url).then(l=>l.birdParameterTexts_en),fr:()=>c(()=>import("./BirdParameterTexts_fr-BiTR-olu.js"),[],import.meta.url).then(l=>l.birdParameterTexts_fr),es:()=>c(()=>import("./BirdParameterTexts_es-T8JyeNlI.js"),[],import.meta.url).then(l=>l.birdParameterTexts_es),it:()=>c(()=>import("./BirdParameterTexts_it-oQY4DX6B.js"),[],import.meta.url).then(l=>l.birdParameterTexts_it)});class n{static FLOCK="flock";static FORMATION="formation";static FLIGHT="flight";static LOOK="look";static speciesOf(t){return v.speciesOf(t)}static speciesLabel(t){return t.replace(/-([a-z])/g,(e,i)=>i.toUpperCase())}static formationOf(t){const e=u.read(t,"formation.kind");return typeof e=="string"?e:n.formationUnstated(t)}static formationUnstated(t){return(u.read(t,"count")??1)>1?"cluster":"single"}static flightOf(t){const e=u.read(t,"flight.kind");return typeof e=="string"?e:n.speciesOf(t).flight.kind}static burstOf(t,e){const i=u.read(t,`flight.${e}`);if(typeof i=="number")return i;const s=n.speciesOf(t).flight;return s.kind==="flapping"?n.BURST[e]:s[e]}static BURST={beats:4,glideS:2};static colour(t,e,i){return{type:"colour",key:`colours.${t}`,group:n.LOOK,label:e,...i?{hint:i}:{},effective:s=>m.colourOf(n.speciesOf(s),t)}}static SET={kind:"birds",title:"birds",parameters:[{type:"said",key:"title",label:"name",group:n.FLOCK},{type:"choice",key:"species",required:!0,group:n.FLOCK,label:"species",choices:m.ALL.map(t=>({value:t.id,label:n.speciesLabel(t.id)}))},{type:"number",key:"count",min:1,max:2e3,step:1,group:n.FLOCK,effective:()=>1,label:"howMany"},{type:"set",key:"explains",group:n.FLOCK,label:"standForTheShapes",hint:"theWholeFlockTakenForOne",visibleWhen:t=>t.explainsEach===void 0,options:(t,e)=>{const i=e?.shapes??[],s=(t.explains??[]).filter(o=>!i.some(a=>a.value===o));return[...i,...s.map(o=>({value:o,label:o}))]},empty:"noShape"},{type:"number",key:"seed",min:0,max:4294967295,step:1,group:n.FLOCK,effective:()=>1,label:"draw",hint:"whatTheDrawsStartFrom"},{type:"choice",key:"formation.kind",group:n.FORMATION,label:"pattern",effective:t=>n.formationUnstated(t),choices:[{value:"single",label:"oneBird"},{value:"v",label:"inAV"},{value:"j",label:"inAJ"},{value:"echelon",label:"inEchelon"},{value:"column",label:"inAColumn"},{value:"front",label:"abreast"},{value:"cluster",label:"aLooseCrowd"},{value:"flock",label:"aFlockThatFliesItself"}]},{type:"number",key:"formation.angleDeg",min:5,max:180,step:1,unit:"°",group:n.FORMATION,effective:()=>70,label:"angleBetweenTheArms",hint:"aGooseVMeasures",visibleWhen:t=>["v","j"].includes(n.formationOf(t))},{type:"number",key:"formation.asymmetry",min:0,max:100,step:5,unit:"%",scale:100,group:n.FORMATION,effective:()=>.7,label:"onTheRightArm",visibleWhen:t=>n.formationOf(t)==="j"},{type:"number",key:"formation.spacing",min:.2,max:20,step:.1,group:n.FORMATION,effective:t=>["v","j","echelon","column"].includes(n.formationOf(t))?1:1.5,label:"spacingInWingspans",hint:"betweenNeighbours",visibleWhen:t=>n.formationOf(t)!=="single"},{type:"number",key:"formation.wander",min:0,max:5,step:.05,group:n.FORMATION,effective:t=>["v","j","echelon","column"].includes(n.formationOf(t))?.15:.4,label:"strayInWingspans",hint:"howMuchEachBirdStrays",visibleWhen:t=>!["single","flock"].includes(n.formationOf(t))},{type:"number",key:"formation.informed",min:0,max:100,step:1,unit:"%",scale:100,group:n.FORMATION,effective:()=>E.INFORMED_SHARE,label:"informed",hint:"aFewKnowWhereTheFlockIsGoing",visibleWhen:t=>n.formationOf(t)==="flock"},{type:"number",key:"wingbeatHz",min:.5,max:30,step:.01,unit:"Hz",group:n.FLIGHT,effective:t=>{const e=t,i=v.pathOf(e)[0]?.upM??0;return Math.round(m.wingbeatHz(n.speciesOf(t),m.airDensityAt((e.originElevationM??0)+i))*100)/100},label:"wingbeat",hint:"predictedFromItsSpecies"},{type:"choice",key:"flight.kind",group:n.FLIGHT,label:"howTheyFly",effective:t=>n.speciesOf(t).flight.kind,choices:[{value:"flapping",label:"flappingAllTheTime"},{value:"bursts",label:"inBurstsAndGlides"},{value:"path",label:"asTheirPathAsks"}]},{type:"number",key:"flight.beats",min:1,max:50,step:1,group:n.FLIGHT,label:"wingbeatsABurst",effective:t=>n.burstOf(t,"beats"),visibleWhen:t=>n.flightOf(t)!=="flapping"},{type:"number",key:"flight.glideS",min:0,max:60,step:.1,unit:"s",group:n.FLIGHT,label:"glideBetween",effective:t=>n.burstOf(t,"glideS"),visibleWhen:t=>n.flightOf(t)!=="flapping"},{type:"number",key:"originElevationM",min:-500,max:6e3,step:1,unit:"m",group:n.FLIGHT,effective:()=>0,label:"thePlaceSGroundAboveTheSea",hint:"whatSetsHowThinTheAir"},n.colour("upperColor","upperSide","theBackAndTheUpperSide"),n.colour("underColor","underSide","theBellyAndTheUnderSide"),n.colour("tipColor","wingTips"),n.colour("headColor","head"),n.colour("neckColor","neck"),n.colour("billColor","bill"),{type:"number",key:"lightFromBelow.lux",min:0,max:1e4,step:.1,unit:"lx",group:n.LOOK,effective:()=>0,label:"litFromBelow",hint:"theLampsOfATown"},{type:"colour",key:"lightFromBelow.color",group:n.LOOK,fallback:"#ffd7a0",label:"lightFromBelowColour",visibleWhen:t=>typeof u.read(t,"lightFromBelow.lux")=="number"}]};static angular(t){return typeof t.azimuthDeg=="number"}static WAYPOINT={kind:"birds-waypoint",title:"pointOfThePath",parameters:[{type:"number",key:"t",min:-36e3,max:36e3,step:.1,unit:"s",scale:.001,required:!0,label:"time",hint:"secondsOfTheRecording"},{type:"position",key:"eastM",secondKey:"northM",saidKey:"saidPosition",native:"local",step:1,rangeM:1e5,label:"position",visibleWhen:t=>!n.angular(t)},{type:"number",key:"altitudeM",min:-500,max:1e4,step:.1,unit:"m",required:!0,label:"height",hint:"aboveTheGroundOfThePlace",visibleWhen:t=>!n.angular(t)},{type:"number",key:"azimuthDeg",min:0,max:360,step:.1,unit:"°",required:!0,label:"azimuth",visibleWhen:t=>n.angular(t)},{type:"number",key:"altitudeDeg",min:-90,max:90,step:.1,unit:"°",required:!0,label:"elevation",visibleWhen:t=>n.angular(t)},{type:"number",key:"distanceM",min:0,max:1e5,step:1,unit:"m",required:!0,label:"distance",visibleWhen:t=>n.angular(t)},{type:"number",key:"eyeHeightM",min:0,max:1e4,step:.1,unit:"m",effective:()=>1.6,label:"eyeHeight",visibleWhen:t=>n.angular(t)}]};static waypointAt(t,e){const i=v.pathOf(t),s=g=>Math.round(g*10)/10;if(i.length===0)return{t:e,eastM:0,northM:0,altitudeM:0};const o=i.findIndex(g=>g.t>=e),[a,r]=o<=0?[i[Math.max(o,0)],i[Math.max(o,0)]]:[i[o-1],i[o]],h=o<0?i[i.length-1]:void 0,p=h||r.t===a.t?0:(e-a.t)/(r.t-a.t),d=h??a,b=h??r;return{t:Math.round(e),eastM:s(d.eastM+(b.eastM-d.eastM)*p),northM:s(d.northM+(b.northM-d.northM)*p),altitudeM:s(d.upM+(b.upM-d.upM)*p)}}static publish(){y.publish(n.SET),y.publish(n.WAYPOINT)}}const R=k.catalog({en:()=>c(()=>import("./BirdEditorMessages_en-CN1OJud9.js"),[],import.meta.url).then(l=>l.birdEditorMessages_en),fr:()=>c(()=>import("./BirdEditorMessages_fr-hL72V8wm.js"),[],import.meta.url).then(l=>l.birdEditorMessages_fr),es:()=>c(()=>import("./BirdEditorMessages_es-DDEnjRrz.js"),[],import.meta.url).then(l=>l.birdEditorMessages_es),it:()=>c(()=>import("./BirdEditorMessages_it-BmLyiPYp.js"),[],import.meta.url).then(l=>l.birdEditorMessages_it)});class f{constructor(t,e,i){this.container=t,this.host=e,S.attach(t,"bird-editor-part",f.STYLE),this.language=i,y.of("birds")||n.publish(),this.ready=this.setLanguage(i)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;timeline;pointForm;pointIndex=0;language;shown=[];static STYLE='.bird-editor-part { flex-basis: 100%; min-width: 0; } .bird-editor-part #bird-list, .bird-editor-part #bird-timeline { flex-basis: 100%; min-width: 0; } .bird-editor-part #bird-timeline { padding: 4px 0; } .bird-editor-part #bird-path > .icon-btn { align-self: flex-end; } .bird-editor-part .launch-editor, .bird-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .bird-editor-part .launch-fields { flex-basis: 100%; min-width: 0; } .bird-editor-part [hidden] { display: none !important; } .bird-editor-part select { min-width: 0; width: 100%; } .bird-editor-part .launch-intro { flex-basis: 100%; margin: 0; } .bird-editor-part .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .bird-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; } .bird-editor-part input, .bird-editor-part select { max-width: 100%; box-sizing: border-box; } .bird-editor-part input[type="text"] { width: 12em; } .bird-editor-part label { min-width: 0; max-width: 100%; } .bird-editor-part input.parameter-derived::placeholder { opacity: .65; } .bird-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; }';static PATH_COLOR="#3b82c4";async setLanguage(t){const e=++this.languageToken;this.language=t;const[i,s]=await Promise.all([R.load(t),L.load(t)]);e===this.languageToken&&(this.messages=i,this.parameterTexts=s,this.render(),this.sync())}sync(){if(!this.messages)return;const t=this.flocks;this.shown=[...t],t.some(s=>s.id===this.currentId)||(this.currentId=t[0]?.id),this.list?.setItems(t.map(s=>({id:s.id,label:this.labelOf(s)})),this.currentId),this.syncAddState();const e=this.current;if(this.element("bird-fields").hidden=e===void 0,!e)return;const i=this.element("bird-each");i.hidden=e.explainsEach===void 0,i.textContent=this.messages.explainsEachNote.replace("{n}",String(e.explainsEach?.length??0)),this.form??=new O(this.element("bird-parameters"),this.language,"birds.",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(this.resolved(n.SET),new x(()=>this.current,s=>this.editFlock(o=>s(o)),()=>({shapes:this.host.shapes().map(s=>({value:s.id,label:s.label}))}),this.host.positionPlace?.()),()=>this.written()),this.syncPoint(!0)}refresh(){if(!this.messages)return;this.syncAddState();const t=this.flocks;if(t.length===this.shown.length&&t.every((e,i)=>e.id===this.shown[i].id)){this.syncTimeline();return}this.sync()}setTime(t){this.messages&&this.timeline?.setTime(t)}syncAddState(){const t=this.frontOfObserver()!==void 0;this.list?.setAddState(t,t?void 0:this.messages.addNowhere)}get current(){return this.flocks.find(t=>t.id===this.currentId)}resolved(t){return T.resolve(t,this.parameterTexts)}render(){if(!this.messages)return;const t=this.messages;this.form=void 0,this.pointForm=void 0,this.container.innerHTML=`<div class="launch-editor">
1
+ import{n as k,_ as c,b9 as u,b6 as y,$ as O,a1 as x,a0 as T,I as w,Y as M,Z as I,a2 as F,a3 as A}from"./rr0-sighting-editor.mjs";import{S}from"./SkyEventEditorStyle-CvY_AhbI.js";import{B as v,a as m,F as E}from"./BirdFlock-TI63ZAKZ.js";const L=k.catalog({en:()=>c(()=>import("./BirdParameterTexts_en-C6FkYUww.js"),[],import.meta.url).then(l=>l.birdParameterTexts_en),fr:()=>c(()=>import("./BirdParameterTexts_fr-BiTR-olu.js"),[],import.meta.url).then(l=>l.birdParameterTexts_fr),es:()=>c(()=>import("./BirdParameterTexts_es-T8JyeNlI.js"),[],import.meta.url).then(l=>l.birdParameterTexts_es),it:()=>c(()=>import("./BirdParameterTexts_it-oQY4DX6B.js"),[],import.meta.url).then(l=>l.birdParameterTexts_it)});class n{static FLOCK="flock";static FORMATION="formation";static FLIGHT="flight";static LOOK="look";static speciesOf(t){return v.speciesOf(t)}static speciesLabel(t){return t.replace(/-([a-z])/g,(e,i)=>i.toUpperCase())}static formationOf(t){const e=u.read(t,"formation.kind");return typeof e=="string"?e:n.formationUnstated(t)}static formationUnstated(t){return(u.read(t,"count")??1)>1?"cluster":"single"}static flightOf(t){const e=u.read(t,"flight.kind");return typeof e=="string"?e:n.speciesOf(t).flight.kind}static burstOf(t,e){const i=u.read(t,`flight.${e}`);if(typeof i=="number")return i;const s=n.speciesOf(t).flight;return s.kind==="flapping"?n.BURST[e]:s[e]}static BURST={beats:4,glideS:2};static colour(t,e,i){return{type:"colour",key:`colours.${t}`,group:n.LOOK,label:e,...i?{hint:i}:{},effective:s=>m.colourOf(n.speciesOf(s),t)}}static SET={kind:"birds",title:"birds",parameters:[{type:"said",key:"title",label:"name",group:n.FLOCK},{type:"choice",key:"species",required:!0,group:n.FLOCK,label:"species",choices:m.ALL.map(t=>({value:t.id,label:n.speciesLabel(t.id)}))},{type:"number",key:"count",min:1,max:2e3,step:1,group:n.FLOCK,effective:()=>1,label:"howMany"},{type:"set",key:"explains",group:n.FLOCK,label:"standForTheShapes",hint:"theWholeFlockTakenForOne",visibleWhen:t=>t.explainsEach===void 0,options:(t,e)=>{const i=e?.shapes??[],s=(t.explains??[]).filter(o=>!i.some(a=>a.value===o));return[...i,...s.map(o=>({value:o,label:o}))]},empty:"noShape"},{type:"number",key:"seed",min:0,max:4294967295,step:1,group:n.FLOCK,effective:()=>1,label:"draw",hint:"whatTheDrawsStartFrom"},{type:"choice",key:"formation.kind",group:n.FORMATION,label:"pattern",effective:t=>n.formationUnstated(t),choices:[{value:"single",label:"oneBird"},{value:"v",label:"inAV"},{value:"j",label:"inAJ"},{value:"echelon",label:"inEchelon"},{value:"column",label:"inAColumn"},{value:"front",label:"abreast"},{value:"cluster",label:"aLooseCrowd"},{value:"flock",label:"aFlockThatFliesItself"}]},{type:"number",key:"formation.angleDeg",min:5,max:180,step:1,unit:"°",group:n.FORMATION,effective:()=>70,label:"angleBetweenTheArms",hint:"aGooseVMeasures",visibleWhen:t=>["v","j"].includes(n.formationOf(t))},{type:"number",key:"formation.asymmetry",min:0,max:100,step:5,unit:"%",scale:100,group:n.FORMATION,effective:()=>.7,label:"onTheRightArm",visibleWhen:t=>n.formationOf(t)==="j"},{type:"number",key:"formation.spacing",min:.2,max:20,step:.1,group:n.FORMATION,effective:t=>["v","j","echelon","column"].includes(n.formationOf(t))?1:1.5,label:"spacingInWingspans",hint:"betweenNeighbours",visibleWhen:t=>n.formationOf(t)!=="single"},{type:"number",key:"formation.wander",min:0,max:5,step:.05,group:n.FORMATION,effective:t=>["v","j","echelon","column"].includes(n.formationOf(t))?.15:.4,label:"strayInWingspans",hint:"howMuchEachBirdStrays",visibleWhen:t=>!["single","flock"].includes(n.formationOf(t))},{type:"number",key:"formation.informed",min:0,max:100,step:1,unit:"%",scale:100,group:n.FORMATION,effective:()=>E.INFORMED_SHARE,label:"informed",hint:"aFewKnowWhereTheFlockIsGoing",visibleWhen:t=>n.formationOf(t)==="flock"},{type:"number",key:"wingbeatHz",min:.5,max:30,step:.01,unit:"Hz",group:n.FLIGHT,effective:t=>{const e=t,i=v.pathOf(e)[0]?.upM??0;return Math.round(m.wingbeatHz(n.speciesOf(t),m.airDensityAt((e.originElevationM??0)+i))*100)/100},label:"wingbeat",hint:"predictedFromItsSpecies"},{type:"choice",key:"flight.kind",group:n.FLIGHT,label:"howTheyFly",effective:t=>n.speciesOf(t).flight.kind,choices:[{value:"flapping",label:"flappingAllTheTime"},{value:"bursts",label:"inBurstsAndGlides"},{value:"path",label:"asTheirPathAsks"}]},{type:"number",key:"flight.beats",min:1,max:50,step:1,group:n.FLIGHT,label:"wingbeatsABurst",effective:t=>n.burstOf(t,"beats"),visibleWhen:t=>n.flightOf(t)!=="flapping"},{type:"number",key:"flight.glideS",min:0,max:60,step:.1,unit:"s",group:n.FLIGHT,label:"glideBetween",effective:t=>n.burstOf(t,"glideS"),visibleWhen:t=>n.flightOf(t)!=="flapping"},{type:"number",key:"originElevationM",min:-500,max:6e3,step:1,unit:"m",group:n.FLIGHT,effective:()=>0,label:"thePlaceSGroundAboveTheSea",hint:"whatSetsHowThinTheAir"},n.colour("upperColor","upperSide","theBackAndTheUpperSide"),n.colour("underColor","underSide","theBellyAndTheUnderSide"),n.colour("tipColor","wingTips"),n.colour("headColor","head"),n.colour("neckColor","neck"),n.colour("billColor","bill"),{type:"number",key:"lightFromBelow.lux",min:0,max:1e4,step:.1,unit:"lx",group:n.LOOK,effective:()=>0,label:"litFromBelow",hint:"theLampsOfATown"},{type:"colour",key:"lightFromBelow.color",group:n.LOOK,fallback:"#ffd7a0",label:"lightFromBelowColour",visibleWhen:t=>typeof u.read(t,"lightFromBelow.lux")=="number"}]};static angular(t){return typeof t.azimuthDeg=="number"}static WAYPOINT={kind:"birds-waypoint",title:"pointOfThePath",parameters:[{type:"number",key:"t",min:-36e3,max:36e3,step:.1,unit:"s",scale:.001,required:!0,label:"time",hint:"secondsOfTheRecording"},{type:"position",key:"eastM",secondKey:"northM",saidKey:"saidPosition",native:"local",step:1,rangeM:1e5,label:"position",visibleWhen:t=>!n.angular(t)},{type:"number",key:"altitudeM",min:-500,max:1e4,step:.1,unit:"m",required:!0,label:"height",hint:"aboveTheGroundOfThePlace",visibleWhen:t=>!n.angular(t)},{type:"number",key:"azimuthDeg",min:0,max:360,step:.1,unit:"°",required:!0,label:"azimuth",visibleWhen:t=>n.angular(t)},{type:"number",key:"altitudeDeg",min:-90,max:90,step:.1,unit:"°",required:!0,label:"elevation",visibleWhen:t=>n.angular(t)},{type:"number",key:"distanceM",min:0,max:1e5,step:1,unit:"m",required:!0,label:"distance",visibleWhen:t=>n.angular(t)},{type:"number",key:"eyeHeightM",min:0,max:1e4,step:.1,unit:"m",effective:()=>1.6,label:"eyeHeight",visibleWhen:t=>n.angular(t)}]};static waypointAt(t,e){const i=v.pathOf(t),s=g=>Math.round(g*10)/10;if(i.length===0)return{t:e,eastM:0,northM:0,altitudeM:0};const o=i.findIndex(g=>g.t>=e),[a,r]=o<=0?[i[Math.max(o,0)],i[Math.max(o,0)]]:[i[o-1],i[o]],h=o<0?i[i.length-1]:void 0,p=h||r.t===a.t?0:(e-a.t)/(r.t-a.t),d=h??a,b=h??r;return{t:Math.round(e),eastM:s(d.eastM+(b.eastM-d.eastM)*p),northM:s(d.northM+(b.northM-d.northM)*p),altitudeM:s(d.upM+(b.upM-d.upM)*p)}}static publish(){y.publish(n.SET),y.publish(n.WAYPOINT)}}const R=k.catalog({en:()=>c(()=>import("./BirdEditorMessages_en-CN1OJud9.js"),[],import.meta.url).then(l=>l.birdEditorMessages_en),fr:()=>c(()=>import("./BirdEditorMessages_fr-hL72V8wm.js"),[],import.meta.url).then(l=>l.birdEditorMessages_fr),es:()=>c(()=>import("./BirdEditorMessages_es-DDEnjRrz.js"),[],import.meta.url).then(l=>l.birdEditorMessages_es),it:()=>c(()=>import("./BirdEditorMessages_it-BmLyiPYp.js"),[],import.meta.url).then(l=>l.birdEditorMessages_it)});class f{constructor(t,e,i){this.container=t,this.host=e,S.attach(t,"bird-editor-part",f.STYLE),this.language=i,y.of("birds")||n.publish(),this.ready=this.setLanguage(i)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;timeline;pointForm;pointIndex=0;language;shown=[];static STYLE='.bird-editor-part { flex-basis: 100%; min-width: 0; } .bird-editor-part #bird-list, .bird-editor-part #bird-timeline { flex-basis: 100%; min-width: 0; } .bird-editor-part #bird-timeline { padding: 4px 0; } .bird-editor-part #bird-path > .icon-btn { align-self: flex-end; } .bird-editor-part .launch-editor, .bird-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .bird-editor-part .launch-fields { flex-basis: 100%; min-width: 0; } .bird-editor-part [hidden] { display: none !important; } .bird-editor-part select { min-width: 0; width: 100%; } .bird-editor-part .launch-intro { flex-basis: 100%; margin: 0; } .bird-editor-part .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .bird-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; } .bird-editor-part input, .bird-editor-part select { max-width: 100%; box-sizing: border-box; } .bird-editor-part input[type="text"] { width: 12em; } .bird-editor-part label { min-width: 0; max-width: 100%; } .bird-editor-part input.parameter-derived::placeholder { opacity: .65; } .bird-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; }';static PATH_COLOR="#3b82c4";async setLanguage(t){const e=++this.languageToken;this.language=t;const[i,s]=await Promise.all([R.load(t),L.load(t)]);e===this.languageToken&&(this.messages=i,this.parameterTexts=s,this.render(),this.sync())}sync(){if(!this.messages)return;const t=this.flocks;this.shown=[...t],t.some(s=>s.id===this.currentId)||(this.currentId=t[0]?.id),this.list?.setItems(t.map(s=>({id:s.id,label:this.labelOf(s)})),this.currentId),this.syncAddState();const e=this.current;if(this.element("bird-fields").hidden=e===void 0,!e)return;const i=this.element("bird-each");i.hidden=e.explainsEach===void 0,i.textContent=this.messages.explainsEachNote.replace("{n}",String(e.explainsEach?.length??0)),this.form??=new O(this.element("bird-parameters"),this.language,"birds.",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(this.resolved(n.SET),new x(()=>this.current,s=>this.editFlock(o=>s(o)),()=>({shapes:this.host.shapes().map(s=>({value:s.id,label:s.label}))}),this.host.positionPlace?.()),()=>this.written()),this.syncPoint(!0)}refresh(){if(!this.messages)return;this.syncAddState();const t=this.flocks;if(t.length===this.shown.length&&t.every((e,i)=>e.id===this.shown[i].id)){this.syncTimeline();return}this.sync()}setTime(t){this.messages&&this.timeline?.setTime(t)}syncAddState(){const t=this.frontOfObserver()!==void 0;this.list?.setAddState(t,t?void 0:this.messages.addNowhere)}get current(){return this.flocks.find(t=>t.id===this.currentId)}resolved(t){return T.resolve(t,this.parameterTexts)}render(){if(!this.messages)return;const t=this.messages;this.form=void 0,this.pointForm=void 0,this.container.innerHTML=`<div class="launch-editor">
2
2
  <p class="launch-intro">${t.intro}</p>
3
3
  <div id="bird-list"></div>
4
4
  <div id="bird-fields" class="launch-fields">
@@ -1 +1 @@
1
- import{b4 as jt}from"./rr0-sighting-editor.mjs";class V{static G=9.81;static BUILDS={gull:{lengthM:.6,wingspanM:1.4,restM:{widthM:1.4,heightM:.14,lengthM:.653},colours:{upperColor:"#a9b1b9",underColor:"#f3f2ec",tipColor:"#1b1c1f",headColor:"#f3f2ec",neckColor:"#f3f2ec",billColor:"#e6bd35"}},pelican:{lengthM:1.2,wingspanM:2.1,restM:{widthM:2.147,heightM:.281,lengthM:1.299},colours:{upperColor:"#7d7468",underColor:"#4f4840",tipColor:"#3b3631",headColor:"#e9dfb5",neckColor:"#5a3a2a",billColor:"#8d8778"}},goose:{lengthM:.95,wingspanM:1.6,restM:{widthM:1.6,heightM:.22,lengthM:1.003},colours:{upperColor:"#6b5d4f",underColor:"#cfc6b8",tipColor:"#3a332c",headColor:"#1d1c1b",neckColor:"#1d1c1b",billColor:"#1d1c1b"}},duck:{lengthM:.58,wingspanM:.9,restM:{widthM:.9,heightM:.15,lengthM:.633},colours:{upperColor:"#6d6457",underColor:"#b9b2a6",tipColor:"#4d463d",headColor:"#1f5a35",neckColor:"#ece9e1",billColor:"#d9b23a"}},plover:{lengthM:.27,wingspanM:.68,restM:{widthM:.68,heightM:.07,lengthM:.291},colours:{upperColor:"#6f6650",underColor:"#e8e4da",tipColor:"#3b362c",headColor:"#6f6650",neckColor:"#e8e4da",billColor:"#1d1c1b"}}};static ALL=[{id:"herring-gull",name:"Herring gull",build:"gull",lengthM:.6,wingspanM:1.4,massKg:1,wingAreaM2:.2,flight:{kind:"flapping"},plumage:{color:"#e6e8ea",albedo:.6}},{id:"ring-billed-gull",name:"Ring-billed gull",build:"gull",lengthM:.48,wingspanM:1.2,massKg:.5,wingAreaM2:.14,flight:{kind:"flapping"},colours:{upperColor:"#b3bbc3"},plumage:{color:"#e6e8ea",albedo:.6}},{id:"black-headed-gull",name:"Black-headed gull",build:"gull",lengthM:.37,wingspanM:1,massKg:.28,wingAreaM2:.1,flight:{kind:"flapping"},colours:{upperColor:"#c3c9cf",headColor:"#3d2b24",billColor:"#8f1d1d"},plumage:{color:"#e8eaec",albedo:.6}},{id:"brown-pelican",name:"Brown pelican",build:"pelican",lengthM:1.2,wingspanM:2.1,massKg:3.5,wingAreaM2:.55,flight:{kind:"bursts",beats:5,glideS:3},plumage:{color:"#7d7468",albedo:.25}},{id:"american-white-pelican",name:"American white pelican",build:"pelican",lengthM:1.5,wingspanM:2.7,massKg:7,wingAreaM2:.9,flight:{kind:"bursts",beats:6,glideS:3},plumage:{color:"#f3f2ec",albedo:.8},colours:{upperColor:"#f3f2ec",underColor:"#f3f2ec",tipColor:"#1b1c1f",headColor:"#f3f2ec",neckColor:"#f3f2ec",billColor:"#e89a3c"}},{id:"canada-goose",name:"Canada goose",build:"goose",lengthM:.95,wingspanM:1.6,massKg:4,wingAreaM2:.3,flight:{kind:"flapping"},plumage:{color:"#8a7c6c",albedo:.25}},{id:"snow-goose",name:"Snow goose",build:"goose",lengthM:.75,wingspanM:1.45,massKg:2.6,wingAreaM2:.25,flight:{kind:"flapping"},plumage:{color:"#f3f2ec",albedo:.8},colours:{upperColor:"#f3f2ec",underColor:"#f3f2ec",tipColor:"#1b1c1f",headColor:"#f3f2ec",neckColor:"#f3f2ec",billColor:"#d9898a"}},{id:"mallard",name:"Mallard",build:"duck",lengthM:.58,wingspanM:.9,massKg:1.1,wingAreaM2:.095,flight:{kind:"flapping"},plumage:{color:"#8a8074",albedo:.3}},{id:"american-golden-plover",name:"American golden plover",build:"plover",lengthM:.26,wingspanM:.68,massKg:.145,wingAreaM2:.038,flight:{kind:"flapping"},plumage:{color:"#8a8070",albedo:.3}},{id:"killdeer",name:"Killdeer",build:"plover",lengthM:.25,wingspanM:.6,massKg:.09,wingAreaM2:.03,flight:{kind:"flapping"},colours:{upperColor:"#7a6249",headColor:"#7a6249"},plumage:{color:"#9a8a72",albedo:.3}}];static byId(t){return V.ALL.find(a=>a.id===t)}static wingbeatHz(t,a=1.225){return t.massKg**(3/8)*Math.sqrt(V.G)*t.wingspanM**(-23/24)*t.wingAreaM2**(-1/3)*a**(-3/8)}static airDensityAt(t){return 1.225*((288.15-.0065*t)/288.15)**4.2559}static colourOf(t,a){return t.colours?.[a]??V.BUILDS[t.build].colours[a]}static sizeOf(t){const a=V.BUILDS[t.build],e=t.wingspanM/a.wingspanM,o=t.lengthM/a.lengthM;return{widthM:a.restM.widthM*e,lengthM:a.restM.lengthM*o,heightM:a.restM.heightM*o}}}class l{static STEP_S=.05;static NEIGHBOURS=7;static MAX_BANK_DEG=60;static INFORMED_SHARE=.2;static BLIND_HALF_DEG=30;static TURN_LAG_S=.25;static SEPARATION=4;static ALIGNMENT=1;static TURN_FOLLOWING=.8;static COHESION=.6;static EDGE_COHESION=1;static VERTICAL_COHESION=.1;static LEAD=.6;static FOLLOWER_LEAD=.3;static LOOK_AHEAD_S=3;static SPEED_RATE=1.5;static SPEED_COHESION=.5;static STEERING=2;static NOISE=1.5;static OWN_SPEED=.5;static AVOIDANCE=6;static AVOID_AHEAD_S=1;static OVER_WITHIN_M=6;static MAX_RINGS=6;static run(t){const{path:a,count:e,species:o,random:n,sampleMs:r}=t,h=t.obstacles?.empty===!1?t.obstacles:void 0,f=new It(a),g=a[0].t,A=a[a.length-1].t,u=D=>{const S=f.velocityAt(D);return Math.max(Math.hypot(S.east,S.north,S.up),10)},c=t.spacing*o.wingspanM,d=p.slotsOf({kind:"cluster",spacing:t.spacing},e,o.wingspanM,n),w=f.velocityAt(g),M=Math.atan2(w.east,w.north),b=f.at(g),i=e,m=new Float64Array(i),y=new Float64Array(i),E=new Float64Array(i),O=new Float64Array(i),N=new Float64Array(i),I=new Float64Array(i),z=new Float64Array(i),T=new Float64Array(i),P=new Float64Array(i),v=new Float64Array(i),et=new Float64Array(i),at=new Float64Array(i),nt=new Float64Array(i),Ct=new Float64Array(i),Mt=new Uint8Array(i);d.forEach((D,S)=>{m[S]=b.eastM+Math.sin(M)*D.forwardM+Math.cos(M)*D.rightM,y[S]=b.northM+Math.cos(M)*D.forwardM-Math.sin(M)*D.rightM,E[S]=b.upM+D.upM,nt[S]=1+(n()-.5)*.08,O[S]=Math.sin(M)*u(g)*nt[S],N[S]=Math.cos(M)*u(g)*nt[S]});const Ut=Math.max(0,Math.min(1,t.informedShare??l.INFORMED_SHARE)),Vt=i===1?1:Math.min(i,Math.max(2,Math.round(i*Ut)));for(let D=0;D<Vt;){const S=Math.floor(n()*i);Mt[S]||(Mt[S]=1,D++)}const xt=d.map(()=>[]),Wt=d.map(()=>({x:0,y:0,z:0})),Dt=new Yt(i,Math.max(c*1.5,.1)),lt=Math.min(l.NEIGHBOURS,i-1),Nt=new Int32Array(Math.max(lt,1)),st=9.81*Math.tan(l.MAX_BANK_DEG*Math.PI/180),Xt=-Math.cos(l.BLIND_HALF_DEG*Math.PI/180),U=l.STEP_S,ct=Math.min(1,U/l.TURN_LAG_S);let gt=g;for(let D=g;D<=A+1e-6;D+=U*1e3){if(D>=gt-1e-6){for(let s=0;s<i;s++)xt[s].push({t:gt,eastM:m[s],northM:y[s],upM:E[s],headingDeg:0,pitchDeg:0,rollDeg:0});gt+=r}const S=f.at(D),dt=f.velocityAt(D),pt=u(D);Dt.fill(m,y,E);for(let s=0;s<i;s++){const W=Math.max(Math.hypot(O[s],N[s],I[s]),.001),X=O[s]/W,j=N[s]/W,Y=I[s]/W,L=lt>0?Dt.nearest(s,m,y,E,lt,l.MAX_RINGS,Nt,(C,x,K,G)=>(C*X+x*j+K*Y)/G>Xt):0;let Q=0,H=0,ut=0,St=0,Lt=0,zt=0,ft=0,At=0,wt=0,vt=0,Tt=0,Rt=0,Pt=0,Gt=0,Ht=0;for(let C=0;C<L;C++){const x=Nt[C],K=m[x]-m[s],G=y[x]-y[s],q=E[x]-E[s],R=Math.max(Math.hypot(K,G,q),.001);if(R<c){const J=(1-R/c)/R;Q-=K*J,H-=G*J,ut-=q*J}St+=m[x],Lt+=y[x],zt+=E[x],ft+=O[x],At+=N[x],wt+=I[x],vt+=z[x],Tt+=T[x],Rt+=P[x],Pt+=K/R,Gt+=G/R,Ht+=q/R}let _=0,B=0,Z=0,F=nt[s]*pt;const tt=Math.hypot(Q,H,ut);if(tt>0){const C=Math.min(1,tt*c);_+=Q/tt*l.SEPARATION*C,B+=H/tt*l.SEPARATION*C,Z+=ut/tt*l.SEPARATION*C}if(L>0){const C=St/L-m[s],x=Lt/L-y[s],K=zt/L-E[s],G=Math.max(Math.hypot(C,x,K),.001),q=Math.hypot(Pt,Gt,Ht)/L,R=(Math.min(1,G/(2*c))+l.EDGE_COHESION*q)*l.COHESION;_+=C/G*R,B+=x/G*R,Z+=K/G*R;const J=Math.max(Math.hypot(ft,At,wt)/L,.001);Z*=l.VERTICAL_COHESION,_+=ft/L/J*l.ALIGNMENT,B+=At/L/J*l.ALIGNMENT,Z+=wt/L/J*l.ALIGNMENT,F=J+(F-J)*l.OWN_SPEED,F+=(C*X+x*j+K*Y)*l.SPEED_COHESION}if(h){const C=h.inside(m[s]+O[s]*l.AVOID_AHEAD_S,y[s]+N[s]*l.AVOID_AHEAD_S,E[s]+I[s]*l.AVOID_AHEAD_S,c)??h.inside(m[s],y[s],E[s],c);C&&(_+=C.nx*l.AVOIDANCE,B+=C.ny*l.AVOIDANCE,C.belowTopM<l.OVER_WITHIN_M&&(Z+=l.AVOIDANCE))}{const C=l.LOOK_AHEAD_S,x=S.eastM+dt.east*C-m[s],K=S.northM+dt.north*C-y[s],G=S.upM+dt.up*C-E[s],q=Math.max(Math.hypot(x,K,G),.001),R=Mt[s]||L===0?l.LEAD:l.FOLLOWER_LEAD;_+=x/q*R,B+=K/q*R,Z+=G/q*R}const k=Math.hypot(_,B,Z);F=Math.max(.7*pt,Math.min(1.4*pt,F));const bt=l.STEERING*W;let ot=k>1e-6?(_/k-X)*bt:0,rt=k>1e-6?(B/k-j)*bt:0,ht=k>1e-6?(Z/k-Y)*bt:0;L>0&&(ot+=(vt/L-z[s])*l.TURN_FOLLOWING,rt+=(Tt/L-T[s])*l.TURN_FOLLOWING,ht+=(Rt/L-P[s])*l.TURN_FOLLOWING);const $=Wt[s];$.x+=((n()-.5)*2*l.NOISE-$.x)*U,$.y+=((n()-.5)*2*l.NOISE-$.y)*U,$.z+=((n()-.5)*l.NOISE-$.z)*U,ot+=$.x,rt+=$.y,ht+=$.z;const mt=ot*X+rt*j+ht*Y;let Et=ot-mt*X,yt=rt-mt*j,Ot=ht-mt*Y;const it=Math.hypot(Et,yt,Ot);it>st&&(Et*=st/it,yt*=st/it,Ot*=st/it),v[s]=Et,et[s]=yt,at[s]=Ot,Ct[s]=Math.max(-3,Math.min(3,(F-W)*l.SPEED_RATE))}for(let s=0;s<i;s++){z[s]+=(v[s]-z[s])*ct,T[s]+=(et[s]-T[s])*ct,P[s]+=(at[s]-P[s])*ct;const W=Math.max(Math.hypot(O[s],N[s],I[s]),.001),X=O[s]/W,j=N[s]/W,Y=I[s]/W,L=z[s]*X+T[s]*j+P[s]*Y;z[s]-=L*X,T[s]-=L*j,P[s]-=L*Y;const Q=Ct[s];if(O[s]+=(z[s]+X*Q)*U,N[s]+=(T[s]+j*Q)*U,I[s]+=(P[s]+Y*Q)*U,m[s]+=O[s]*U,y[s]+=N[s]*U,E[s]+=I[s]*U,h){const H=h.inside(m[s],y[s],E[s]);H&&(H.belowTopM<H.depthM?E[s]+=H.belowTopM:(m[s]+=H.nx*H.depthM,y[s]+=H.ny*H.depthM))}}}return xt.map(D=>(p.attitudes(D),{samples:D,delayS:0}))}}class Yt{constructor(t,a){this.n=t,this.cellM=a;let e=16;for(;e<t*2;)e*=2;this.size=e,this.start=new Int32Array(e+1),this.counts=new Int32Array(e),this.members=new Int32Array(t),this.slotOf=new Int32Array(t),this.seen=new Int32Array(e),this.distances=new Float64Array(t)}size;start;counts;members;slotOf;seen;search=0;distances;cell(t){return Math.floor(t/this.cellM)}slot(t,a,e){return(Math.imul(t,73856093)^Math.imul(a,19349663)^Math.imul(e,83492791))&this.size-1}fill(t,a,e){this.counts.fill(0);for(let n=0;n<this.n;n++){const r=this.slot(this.cell(t[n]),this.cell(a[n]),this.cell(e[n]));this.slotOf[n]=r,this.counts[r]++}this.start[0]=0;for(let n=0;n<this.size;n++)this.start[n+1]=this.start[n]+this.counts[n];const o=this.start.slice(0,this.size);for(let n=0;n<this.n;n++)this.members[o[this.slotOf[n]]++]=n}nearest(t,a,e,o,n,r,h,f){const g=++this.search,A=this.cell(a[t]),u=this.cell(e[t]),c=this.cell(o[t]);let d=0;const w=this.distances;for(let M=0;M<=r;M++){for(let b=A-M;b<=A+M;b++)for(let i=u-M;i<=u+M;i++)for(let m=c-M;m<=c+M;m++){if(Math.max(Math.abs(b-A),Math.abs(i-u),Math.abs(m-c))!==M)continue;const y=this.slot(b,i,m);if(this.seen[y]!==g){this.seen[y]=g;for(let E=this.start[y];E<this.start[y+1];E++){const O=this.members[E];if(O===t)continue;const N=a[O]-a[t],I=e[O]-e[t],z=o[O]-o[t],T=N*N+I*I+z*z;if(d===n&&T>=w[n-1])continue;const P=Math.sqrt(T);if(P>0&&!f(N,I,z,P))continue;let v=Math.min(d,n-1);for(;v>0&&w[v-1]>T;)w[v]=w[v-1],h[v]=h[v-1],v--;w[v]=T,h[v]=O,d<n&&d++}}}if(d===n&&w[n-1]<=(M*this.cellM)**2)break}return d}}class p{static SAMPLE_MS=100;static MAX_KEYFRAMES=6e4;static computed=new Map;static bodiesOf(t,a=jt.NONE){const e=JSON.stringify(t)+a.signature;let o=p.computed.get(e);return o||(o=p.compute(t,a),p.computed.set(e,o),p.computed.size>16&&p.computed.delete(p.computed.keys().next().value)),o}static speciesOf(t){return V.byId(t.species)??V.ALL[0]}static compute(t,a){const e=p.pathOf(t);if(e.length===0)return[];const o=p.speciesOf(t),n=Math.max(1,Math.floor(t.count??1)),r=p.randomFrom(t.seed??1),h=t.wingbeatHz??V.wingbeatHz(o,V.airDensityAt((t.originElevationM??0)+e[0].upM)),f=t.flight??o.flight,g=e[0].t,A=e[e.length-1].t,u=p.sampleMs(n,A-g),c=t.formation?.kind==="flock"?l.run({path:e,count:n,species:o,spacing:t.formation.spacing??1.5,informedShare:t.formation.informed,obstacles:a,random:r,sampleMs:u}):p.arranged(t,e,o,n,r,u),d=V.sizeOf(o),w={...o.colours,...t.colours};return c.map((M,b)=>{const i=h*(1+(r()-.5)*.06),m=r(),y=M.delayS,E=f.kind==="path"?p.flapsAlong(M.samples,i,f,m):void 0,O=M.samples.map((I,z)=>({t:Math.round(I.t),eastM:p.round(I.eastM),northM:p.round(I.northM),altitudeM:p.round(I.upM-d.heightM/2),...z===0?{sizeM:d,appearance:{color:o.plumage.color,albedo:o.plumage.albedo}}:{},attitude:{headingDeg:p.round(I.headingDeg),pitchDeg:p.round(I.pitchDeg),rollDeg:p.round(I.rollDeg)},motions:{flap:p.round(E?E[z]:p.beatsAt((I.t-g)/1e3-y,i,f,m),1e3)}}));return{id:n>1?`${t.id}-${b+1}`:t.id,...t.title?{title:t.title}:{},...t.explainsEach?t.explainsEach[b]!==void 0?{explains:[t.explainsEach[b]]}:{}:{...t.explains?{explains:t.explains}:{},...n>1?{ensemble:t.id}:{}},model:{id:`ufoathome-bird-${o.build}`},shadow:!1,...Object.keys(w).length>0?{modelParameters:w}:{},...t.lightFromBelow?{lightFromBelow:t.lightFromBelow}:{},track:O}})}static beatsAt(t,a,e,o){if(e.kind==="flapping")return Math.max(0,t*a+o);const r=e.beats/a+e.glideS,h=Math.max(0,t+o*r),f=Math.floor(h/r),g=h-f*r;return f*e.beats+Math.min(e.beats,g*a)}static CLIMB_FLAPS_MS=.3;static DESCENT_GLIDES_MS=-.8;static flapsAlong(t,a,e,o){let n=o,r=!0,h=Math.floor(n),f=0;return t.map((g,A)=>{if(A===0)return n;const u=t[A-1],c=(g.t-u.t)/1e3;if(c<=0)return n;const d=(g.upM-u.upM)/c,w=r?n-h<e.beats:(g.t-f)/1e3>=e.glideS,M=d>p.CLIMB_FLAPS_MS?!0:d<p.DESCENT_GLIDES_MS?!1:w;if(r){const b=n+a*c;!M&&Math.floor(b)>Math.floor(n)?(n=Math.floor(b),r=!1,f=g.t):n=b}else M&&(r=!0,h=n);return n})}static sampleMs(t,a){const e=t*(a/p.SAMPLE_MS+1);return e<=p.MAX_KEYFRAMES?p.SAMPLE_MS:Math.ceil(p.SAMPLE_MS*e/p.MAX_KEYFRAMES/50)*50}static pathOf(t){return[...t.path].sort((a,e)=>a.t-e.t).map(a=>{if("eastM"in a)return{t:a.t,eastM:a.eastM,northM:a.northM,upM:a.altitudeM};const e=a.azimuthDeg*Math.PI/180,o=a.altitudeDeg*Math.PI/180,n=a.distanceM*Math.cos(o);return{t:a.t,eastM:n*Math.sin(e),northM:n*Math.cos(e),upM:(a.eyeHeightM??1.6)+a.distanceM*Math.sin(o)}})}static arranged(t,a,e,o,n,r){const h=t.formation??{kind:o>1?"cluster":"single"},f=p.slotsOf(h,o,e.wingspanM,n),g=h.kind==="v"||h.kind==="j"||h.kind==="echelon"||h.kind==="column",A=(h.wander??(g?.15:.4))*e.wingspanM,u=new It(a),c=Math.max(u.meanSpeedMS(),1);return f.map(d=>{const w=g?Math.max(0,-d.forwardM)/c:0,M=p.swayFrom(n,A),b=[];for(let i=a[0].t;i<=a[a.length-1].t+1e-6;i+=r){const m=(i-a[0].t)/1e3,y=i-w*1e3,E=u.at(y),O=u.velocityAt(y),N=Math.atan2(O.east,O.north),[I,z,T]=M(m),P=g?I:d.forwardM+I,v=d.rightM+z,et=E.eastM+Math.sin(N)*P+Math.cos(N)*v,at=E.northM+Math.cos(N)*P-Math.sin(N)*v;b.push({t:i,eastM:et,northM:at,upM:E.upM+d.upM+T,headingDeg:0,pitchDeg:0,rollDeg:0})}return p.attitudes(b),{samples:b,delayS:w}})}static slotsOf(t,a,e,o){const n=[],r=t.kind;if(r==="single"||a===1)return[{forwardM:0,rightM:0,upM:0}];if(r==="v"||r==="j"||r==="echelon"||r==="column"){const c=(t.spacing??1)*e*(r==="column"?0:1),d=(t.angleDeg??70)/2*Math.PI/180,w=r==="column"?(t.spacing??1)*e:c/Math.tan(d),M=r==="v"?.5:r==="echelon"||r==="column"?1:t.asymmetry??.7;n.push({forwardM:0,rightM:0,upM:0});const b=Math.round(M*(a-1));let i=0,m=0;for(let y=1;y<a;y++){const E=m>=a-1-b||i<b&&i/Math.max(b,1)<=m/Math.max(a-1-b,1),O=E?++i:++m;n.push({forwardM:-w*O,rightM:(E?1:-1)*c*O,upM:-.05*e*O*o()})}return n}const h=(t.spacing??1.5)*e;if(r==="front"){for(let c=0;c<a;c++)n.push({forwardM:(o()-.5)*h*1.2,rightM:(c-(a-1)/2)*h,upM:(o()-.5)*h*.4});return n}const f=a*h**3,g=Math.cbrt(f/(4/3*Math.PI*1*2.8*5.6)),A={up:g,across:2.8*g,along:5.6*g};let u=0;for(;n.length<a&&u<a*200;){u++;const c=2*o()-1,d=2*o()-1,w=2*o()-1;if(c*c+d*d+w*w>1)continue;const M={forwardM:c*A.along,rightM:d*A.across,upM:w*A.up};n.some(b=>(b.forwardM-M.forwardM)**2+(b.rightM-M.rightM)**2+(b.upM-M.upM)**2<(h/2)**2)||n.push(M)}for(;n.length<a;)n.push({forwardM:(o()-.5)*A.along,rightM:(o()-.5)*A.across,upM:0});return n}static swayFrom(t,a){const e=[0,1,2].map(o=>[0,1].map(()=>({period:3+t()*7,phase:t()*2*Math.PI,share:(o===2?.4:o===1?.7:1)*(.4+.6*t())})));return o=>e.map(n=>n.reduce((r,h)=>r+a*h.share*.5*Math.sin(2*Math.PI*o/h.period+h.phase),0))}static attitudes(t){const a=t.length;if(!(a<2)){for(let e=0;e<a;e++){const o=t[Math.max(0,e-1)],n=t[Math.min(a-1,e+1)],r=(n.t-o.t)/1e3,h=(n.eastM-o.eastM)/r,f=(n.northM-o.northM)/r,g=(n.upM-o.upM)/r,A=Math.hypot(h,f),u=t[e];u.headingDeg=A>.05?(Math.atan2(h,f)*180/Math.PI+360)%360:e>0?t[e-1].headingDeg:0,u.pitchDeg=Math.atan2(g,Math.max(A,.5))*180/Math.PI}for(let e=0;e<a;e++){const o=t[Math.max(0,e-2)],n=t[Math.min(a-1,e+2)],r=(n.t-o.t)/1e3;let h=n.headingDeg-o.headingDeg;h=(h+540)%360-180;const f=t[e],g=t[Math.max(0,e-1)],A=t[Math.min(a-1,e+1)],u=Math.hypot(A.eastM-g.eastM,A.northM-g.northM)/Math.max((A.t-g.t)/1e3,.001),c=r>0?h*Math.PI/180/r:0,d=Math.atan(u*c/V.G)*180/Math.PI;f.rollDeg=Math.max(-70,Math.min(70,d))}}}static randomFrom(t){let a=t>>>0;return()=>{a=a+1831565813>>>0;let e=a;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}static round(t,a=100){return Math.round(t*a)/a}}class It{constructor(t){this.points=t}at(t){const a=this.points;if(a.length===1||t<=a[0].t)return this.extrapolated(t,0);if(t>=a[a.length-1].t)return this.extrapolated(t,a.length-1);let e=0;for(;e<a.length-2&&t>a[e+1].t;)e++;const o=a[Math.max(0,e-1)],n=a[e],r=a[e+1],h=a[Math.min(a.length-1,e+2)],f=(t-n.t)/(r.t-n.t),g=(u,c,d)=>(c[d]-u[d])/Math.max(c.t-u.t,1)*(r.t-n.t),A=u=>{const c=g(o,r,u),d=g(n,h,u),w=f*f,M=w*f;return(2*M-3*w+1)*n[u]+(M-2*w+f)*c+(-2*M+3*w)*r[u]+(M-w)*d};return{t,eastM:A("eastM"),northM:A("northM"),upM:A("upM")}}extrapolated(t,a){const e=this.points,o=e[a];if(e.length<2)return{...o,t};const n=a===0?e[0]:e[e.length-2],r=a===0?e[1]:e[e.length-1],h=(t-o.t)/Math.max(r.t-n.t,1);return{t,eastM:o.eastM+(r.eastM-n.eastM)*h,northM:o.northM+(r.northM-n.northM)*h,upM:o.upM+(r.upM-n.upM)*h}}velocityAt(t){const a=this.at(t-50),e=this.at(t+50);return{east:(e.eastM-a.eastM)/.1,north:(e.northM-a.northM)/.1,up:(e.upM-a.upM)/.1}}meanSpeedMS(){const t=this.points;if(t.length<2)return 0;let a=0;for(let e=1;e<t.length;e++)a+=Math.hypot(t[e].eastM-t[e-1].eastM,t[e].northM-t[e-1].northM,t[e].upM-t[e-1].upM);return a/Math.max((t[t.length-1].t-t[0].t)/1e3,.001)}}const qt=Object.freeze(Object.defineProperty({__proto__:null,BirdFlock:p,FlightPath:It},Symbol.toStringTag,{value:"Module"}));export{p as B,l as F,V as a,qt as b};
1
+ import{b5 as jt}from"./rr0-sighting-editor.mjs";class V{static G=9.81;static BUILDS={gull:{lengthM:.6,wingspanM:1.4,restM:{widthM:1.4,heightM:.14,lengthM:.653},colours:{upperColor:"#a9b1b9",underColor:"#f3f2ec",tipColor:"#1b1c1f",headColor:"#f3f2ec",neckColor:"#f3f2ec",billColor:"#e6bd35"}},pelican:{lengthM:1.2,wingspanM:2.1,restM:{widthM:2.147,heightM:.281,lengthM:1.299},colours:{upperColor:"#7d7468",underColor:"#4f4840",tipColor:"#3b3631",headColor:"#e9dfb5",neckColor:"#5a3a2a",billColor:"#8d8778"}},goose:{lengthM:.95,wingspanM:1.6,restM:{widthM:1.6,heightM:.22,lengthM:1.003},colours:{upperColor:"#6b5d4f",underColor:"#cfc6b8",tipColor:"#3a332c",headColor:"#1d1c1b",neckColor:"#1d1c1b",billColor:"#1d1c1b"}},duck:{lengthM:.58,wingspanM:.9,restM:{widthM:.9,heightM:.15,lengthM:.633},colours:{upperColor:"#6d6457",underColor:"#b9b2a6",tipColor:"#4d463d",headColor:"#1f5a35",neckColor:"#ece9e1",billColor:"#d9b23a"}},plover:{lengthM:.27,wingspanM:.68,restM:{widthM:.68,heightM:.07,lengthM:.291},colours:{upperColor:"#6f6650",underColor:"#e8e4da",tipColor:"#3b362c",headColor:"#6f6650",neckColor:"#e8e4da",billColor:"#1d1c1b"}}};static ALL=[{id:"herring-gull",name:"Herring gull",build:"gull",lengthM:.6,wingspanM:1.4,massKg:1,wingAreaM2:.2,flight:{kind:"flapping"},plumage:{color:"#e6e8ea",albedo:.6}},{id:"ring-billed-gull",name:"Ring-billed gull",build:"gull",lengthM:.48,wingspanM:1.2,massKg:.5,wingAreaM2:.14,flight:{kind:"flapping"},colours:{upperColor:"#b3bbc3"},plumage:{color:"#e6e8ea",albedo:.6}},{id:"black-headed-gull",name:"Black-headed gull",build:"gull",lengthM:.37,wingspanM:1,massKg:.28,wingAreaM2:.1,flight:{kind:"flapping"},colours:{upperColor:"#c3c9cf",headColor:"#3d2b24",billColor:"#8f1d1d"},plumage:{color:"#e8eaec",albedo:.6}},{id:"brown-pelican",name:"Brown pelican",build:"pelican",lengthM:1.2,wingspanM:2.1,massKg:3.5,wingAreaM2:.55,flight:{kind:"bursts",beats:5,glideS:3},plumage:{color:"#7d7468",albedo:.25}},{id:"american-white-pelican",name:"American white pelican",build:"pelican",lengthM:1.5,wingspanM:2.7,massKg:7,wingAreaM2:.9,flight:{kind:"bursts",beats:6,glideS:3},plumage:{color:"#f3f2ec",albedo:.8},colours:{upperColor:"#f3f2ec",underColor:"#f3f2ec",tipColor:"#1b1c1f",headColor:"#f3f2ec",neckColor:"#f3f2ec",billColor:"#e89a3c"}},{id:"canada-goose",name:"Canada goose",build:"goose",lengthM:.95,wingspanM:1.6,massKg:4,wingAreaM2:.3,flight:{kind:"flapping"},plumage:{color:"#8a7c6c",albedo:.25}},{id:"snow-goose",name:"Snow goose",build:"goose",lengthM:.75,wingspanM:1.45,massKg:2.6,wingAreaM2:.25,flight:{kind:"flapping"},plumage:{color:"#f3f2ec",albedo:.8},colours:{upperColor:"#f3f2ec",underColor:"#f3f2ec",tipColor:"#1b1c1f",headColor:"#f3f2ec",neckColor:"#f3f2ec",billColor:"#d9898a"}},{id:"mallard",name:"Mallard",build:"duck",lengthM:.58,wingspanM:.9,massKg:1.1,wingAreaM2:.095,flight:{kind:"flapping"},plumage:{color:"#8a8074",albedo:.3}},{id:"american-golden-plover",name:"American golden plover",build:"plover",lengthM:.26,wingspanM:.68,massKg:.145,wingAreaM2:.038,flight:{kind:"flapping"},plumage:{color:"#8a8070",albedo:.3}},{id:"killdeer",name:"Killdeer",build:"plover",lengthM:.25,wingspanM:.6,massKg:.09,wingAreaM2:.03,flight:{kind:"flapping"},colours:{upperColor:"#7a6249",headColor:"#7a6249"},plumage:{color:"#9a8a72",albedo:.3}}];static byId(t){return V.ALL.find(a=>a.id===t)}static wingbeatHz(t,a=1.225){return t.massKg**(3/8)*Math.sqrt(V.G)*t.wingspanM**(-23/24)*t.wingAreaM2**(-1/3)*a**(-3/8)}static airDensityAt(t){return 1.225*((288.15-.0065*t)/288.15)**4.2559}static colourOf(t,a){return t.colours?.[a]??V.BUILDS[t.build].colours[a]}static sizeOf(t){const a=V.BUILDS[t.build],e=t.wingspanM/a.wingspanM,o=t.lengthM/a.lengthM;return{widthM:a.restM.widthM*e,lengthM:a.restM.lengthM*o,heightM:a.restM.heightM*o}}}class l{static STEP_S=.05;static NEIGHBOURS=7;static MAX_BANK_DEG=60;static INFORMED_SHARE=.2;static BLIND_HALF_DEG=30;static TURN_LAG_S=.25;static SEPARATION=4;static ALIGNMENT=1;static TURN_FOLLOWING=.8;static COHESION=.6;static EDGE_COHESION=1;static VERTICAL_COHESION=.1;static LEAD=.6;static FOLLOWER_LEAD=.3;static LOOK_AHEAD_S=3;static SPEED_RATE=1.5;static SPEED_COHESION=.5;static STEERING=2;static NOISE=1.5;static OWN_SPEED=.5;static AVOIDANCE=6;static AVOID_AHEAD_S=1;static OVER_WITHIN_M=6;static MAX_RINGS=6;static run(t){const{path:a,count:e,species:o,random:n,sampleMs:r}=t,h=t.obstacles?.empty===!1?t.obstacles:void 0,f=new It(a),g=a[0].t,A=a[a.length-1].t,u=D=>{const S=f.velocityAt(D);return Math.max(Math.hypot(S.east,S.north,S.up),10)},c=t.spacing*o.wingspanM,d=p.slotsOf({kind:"cluster",spacing:t.spacing},e,o.wingspanM,n),w=f.velocityAt(g),M=Math.atan2(w.east,w.north),b=f.at(g),i=e,m=new Float64Array(i),y=new Float64Array(i),E=new Float64Array(i),O=new Float64Array(i),N=new Float64Array(i),I=new Float64Array(i),z=new Float64Array(i),T=new Float64Array(i),P=new Float64Array(i),v=new Float64Array(i),et=new Float64Array(i),at=new Float64Array(i),nt=new Float64Array(i),Ct=new Float64Array(i),Mt=new Uint8Array(i);d.forEach((D,S)=>{m[S]=b.eastM+Math.sin(M)*D.forwardM+Math.cos(M)*D.rightM,y[S]=b.northM+Math.cos(M)*D.forwardM-Math.sin(M)*D.rightM,E[S]=b.upM+D.upM,nt[S]=1+(n()-.5)*.08,O[S]=Math.sin(M)*u(g)*nt[S],N[S]=Math.cos(M)*u(g)*nt[S]});const Ut=Math.max(0,Math.min(1,t.informedShare??l.INFORMED_SHARE)),Vt=i===1?1:Math.min(i,Math.max(2,Math.round(i*Ut)));for(let D=0;D<Vt;){const S=Math.floor(n()*i);Mt[S]||(Mt[S]=1,D++)}const xt=d.map(()=>[]),Wt=d.map(()=>({x:0,y:0,z:0})),Dt=new Yt(i,Math.max(c*1.5,.1)),lt=Math.min(l.NEIGHBOURS,i-1),Nt=new Int32Array(Math.max(lt,1)),st=9.81*Math.tan(l.MAX_BANK_DEG*Math.PI/180),Xt=-Math.cos(l.BLIND_HALF_DEG*Math.PI/180),U=l.STEP_S,ct=Math.min(1,U/l.TURN_LAG_S);let gt=g;for(let D=g;D<=A+1e-6;D+=U*1e3){if(D>=gt-1e-6){for(let s=0;s<i;s++)xt[s].push({t:gt,eastM:m[s],northM:y[s],upM:E[s],headingDeg:0,pitchDeg:0,rollDeg:0});gt+=r}const S=f.at(D),dt=f.velocityAt(D),pt=u(D);Dt.fill(m,y,E);for(let s=0;s<i;s++){const W=Math.max(Math.hypot(O[s],N[s],I[s]),.001),X=O[s]/W,j=N[s]/W,Y=I[s]/W,L=lt>0?Dt.nearest(s,m,y,E,lt,l.MAX_RINGS,Nt,(C,x,K,G)=>(C*X+x*j+K*Y)/G>Xt):0;let Q=0,H=0,ut=0,St=0,Lt=0,zt=0,ft=0,At=0,wt=0,vt=0,Tt=0,Rt=0,Pt=0,Gt=0,Ht=0;for(let C=0;C<L;C++){const x=Nt[C],K=m[x]-m[s],G=y[x]-y[s],q=E[x]-E[s],R=Math.max(Math.hypot(K,G,q),.001);if(R<c){const J=(1-R/c)/R;Q-=K*J,H-=G*J,ut-=q*J}St+=m[x],Lt+=y[x],zt+=E[x],ft+=O[x],At+=N[x],wt+=I[x],vt+=z[x],Tt+=T[x],Rt+=P[x],Pt+=K/R,Gt+=G/R,Ht+=q/R}let _=0,B=0,Z=0,F=nt[s]*pt;const tt=Math.hypot(Q,H,ut);if(tt>0){const C=Math.min(1,tt*c);_+=Q/tt*l.SEPARATION*C,B+=H/tt*l.SEPARATION*C,Z+=ut/tt*l.SEPARATION*C}if(L>0){const C=St/L-m[s],x=Lt/L-y[s],K=zt/L-E[s],G=Math.max(Math.hypot(C,x,K),.001),q=Math.hypot(Pt,Gt,Ht)/L,R=(Math.min(1,G/(2*c))+l.EDGE_COHESION*q)*l.COHESION;_+=C/G*R,B+=x/G*R,Z+=K/G*R;const J=Math.max(Math.hypot(ft,At,wt)/L,.001);Z*=l.VERTICAL_COHESION,_+=ft/L/J*l.ALIGNMENT,B+=At/L/J*l.ALIGNMENT,Z+=wt/L/J*l.ALIGNMENT,F=J+(F-J)*l.OWN_SPEED,F+=(C*X+x*j+K*Y)*l.SPEED_COHESION}if(h){const C=h.inside(m[s]+O[s]*l.AVOID_AHEAD_S,y[s]+N[s]*l.AVOID_AHEAD_S,E[s]+I[s]*l.AVOID_AHEAD_S,c)??h.inside(m[s],y[s],E[s],c);C&&(_+=C.nx*l.AVOIDANCE,B+=C.ny*l.AVOIDANCE,C.belowTopM<l.OVER_WITHIN_M&&(Z+=l.AVOIDANCE))}{const C=l.LOOK_AHEAD_S,x=S.eastM+dt.east*C-m[s],K=S.northM+dt.north*C-y[s],G=S.upM+dt.up*C-E[s],q=Math.max(Math.hypot(x,K,G),.001),R=Mt[s]||L===0?l.LEAD:l.FOLLOWER_LEAD;_+=x/q*R,B+=K/q*R,Z+=G/q*R}const k=Math.hypot(_,B,Z);F=Math.max(.7*pt,Math.min(1.4*pt,F));const bt=l.STEERING*W;let ot=k>1e-6?(_/k-X)*bt:0,rt=k>1e-6?(B/k-j)*bt:0,ht=k>1e-6?(Z/k-Y)*bt:0;L>0&&(ot+=(vt/L-z[s])*l.TURN_FOLLOWING,rt+=(Tt/L-T[s])*l.TURN_FOLLOWING,ht+=(Rt/L-P[s])*l.TURN_FOLLOWING);const $=Wt[s];$.x+=((n()-.5)*2*l.NOISE-$.x)*U,$.y+=((n()-.5)*2*l.NOISE-$.y)*U,$.z+=((n()-.5)*l.NOISE-$.z)*U,ot+=$.x,rt+=$.y,ht+=$.z;const mt=ot*X+rt*j+ht*Y;let Et=ot-mt*X,yt=rt-mt*j,Ot=ht-mt*Y;const it=Math.hypot(Et,yt,Ot);it>st&&(Et*=st/it,yt*=st/it,Ot*=st/it),v[s]=Et,et[s]=yt,at[s]=Ot,Ct[s]=Math.max(-3,Math.min(3,(F-W)*l.SPEED_RATE))}for(let s=0;s<i;s++){z[s]+=(v[s]-z[s])*ct,T[s]+=(et[s]-T[s])*ct,P[s]+=(at[s]-P[s])*ct;const W=Math.max(Math.hypot(O[s],N[s],I[s]),.001),X=O[s]/W,j=N[s]/W,Y=I[s]/W,L=z[s]*X+T[s]*j+P[s]*Y;z[s]-=L*X,T[s]-=L*j,P[s]-=L*Y;const Q=Ct[s];if(O[s]+=(z[s]+X*Q)*U,N[s]+=(T[s]+j*Q)*U,I[s]+=(P[s]+Y*Q)*U,m[s]+=O[s]*U,y[s]+=N[s]*U,E[s]+=I[s]*U,h){const H=h.inside(m[s],y[s],E[s]);H&&(H.belowTopM<H.depthM?E[s]+=H.belowTopM:(m[s]+=H.nx*H.depthM,y[s]+=H.ny*H.depthM))}}}return xt.map(D=>(p.attitudes(D),{samples:D,delayS:0}))}}class Yt{constructor(t,a){this.n=t,this.cellM=a;let e=16;for(;e<t*2;)e*=2;this.size=e,this.start=new Int32Array(e+1),this.counts=new Int32Array(e),this.members=new Int32Array(t),this.slotOf=new Int32Array(t),this.seen=new Int32Array(e),this.distances=new Float64Array(t)}size;start;counts;members;slotOf;seen;search=0;distances;cell(t){return Math.floor(t/this.cellM)}slot(t,a,e){return(Math.imul(t,73856093)^Math.imul(a,19349663)^Math.imul(e,83492791))&this.size-1}fill(t,a,e){this.counts.fill(0);for(let n=0;n<this.n;n++){const r=this.slot(this.cell(t[n]),this.cell(a[n]),this.cell(e[n]));this.slotOf[n]=r,this.counts[r]++}this.start[0]=0;for(let n=0;n<this.size;n++)this.start[n+1]=this.start[n]+this.counts[n];const o=this.start.slice(0,this.size);for(let n=0;n<this.n;n++)this.members[o[this.slotOf[n]]++]=n}nearest(t,a,e,o,n,r,h,f){const g=++this.search,A=this.cell(a[t]),u=this.cell(e[t]),c=this.cell(o[t]);let d=0;const w=this.distances;for(let M=0;M<=r;M++){for(let b=A-M;b<=A+M;b++)for(let i=u-M;i<=u+M;i++)for(let m=c-M;m<=c+M;m++){if(Math.max(Math.abs(b-A),Math.abs(i-u),Math.abs(m-c))!==M)continue;const y=this.slot(b,i,m);if(this.seen[y]!==g){this.seen[y]=g;for(let E=this.start[y];E<this.start[y+1];E++){const O=this.members[E];if(O===t)continue;const N=a[O]-a[t],I=e[O]-e[t],z=o[O]-o[t],T=N*N+I*I+z*z;if(d===n&&T>=w[n-1])continue;const P=Math.sqrt(T);if(P>0&&!f(N,I,z,P))continue;let v=Math.min(d,n-1);for(;v>0&&w[v-1]>T;)w[v]=w[v-1],h[v]=h[v-1],v--;w[v]=T,h[v]=O,d<n&&d++}}}if(d===n&&w[n-1]<=(M*this.cellM)**2)break}return d}}class p{static SAMPLE_MS=100;static MAX_KEYFRAMES=6e4;static computed=new Map;static bodiesOf(t,a=jt.NONE){const e=JSON.stringify(t)+a.signature;let o=p.computed.get(e);return o||(o=p.compute(t,a),p.computed.set(e,o),p.computed.size>16&&p.computed.delete(p.computed.keys().next().value)),o}static speciesOf(t){return V.byId(t.species)??V.ALL[0]}static compute(t,a){const e=p.pathOf(t);if(e.length===0)return[];const o=p.speciesOf(t),n=Math.max(1,Math.floor(t.count??1)),r=p.randomFrom(t.seed??1),h=t.wingbeatHz??V.wingbeatHz(o,V.airDensityAt((t.originElevationM??0)+e[0].upM)),f=t.flight??o.flight,g=e[0].t,A=e[e.length-1].t,u=p.sampleMs(n,A-g),c=t.formation?.kind==="flock"?l.run({path:e,count:n,species:o,spacing:t.formation.spacing??1.5,informedShare:t.formation.informed,obstacles:a,random:r,sampleMs:u}):p.arranged(t,e,o,n,r,u),d=V.sizeOf(o),w={...o.colours,...t.colours};return c.map((M,b)=>{const i=h*(1+(r()-.5)*.06),m=r(),y=M.delayS,E=f.kind==="path"?p.flapsAlong(M.samples,i,f,m):void 0,O=M.samples.map((I,z)=>({t:Math.round(I.t),eastM:p.round(I.eastM),northM:p.round(I.northM),altitudeM:p.round(I.upM-d.heightM/2),...z===0?{sizeM:d,appearance:{color:o.plumage.color,albedo:o.plumage.albedo}}:{},attitude:{headingDeg:p.round(I.headingDeg),pitchDeg:p.round(I.pitchDeg),rollDeg:p.round(I.rollDeg)},motions:{flap:p.round(E?E[z]:p.beatsAt((I.t-g)/1e3-y,i,f,m),1e3)}}));return{id:n>1?`${t.id}-${b+1}`:t.id,...t.title?{title:t.title}:{},...t.explainsEach?t.explainsEach[b]!==void 0?{explains:[t.explainsEach[b]]}:{}:{...t.explains?{explains:t.explains}:{},...n>1?{ensemble:t.id}:{}},model:{id:`ufoathome-bird-${o.build}`},shadow:!1,...Object.keys(w).length>0?{modelParameters:w}:{},...t.lightFromBelow?{lightFromBelow:t.lightFromBelow}:{},track:O}})}static beatsAt(t,a,e,o){if(e.kind==="flapping")return Math.max(0,t*a+o);const r=e.beats/a+e.glideS,h=Math.max(0,t+o*r),f=Math.floor(h/r),g=h-f*r;return f*e.beats+Math.min(e.beats,g*a)}static CLIMB_FLAPS_MS=.3;static DESCENT_GLIDES_MS=-.8;static flapsAlong(t,a,e,o){let n=o,r=!0,h=Math.floor(n),f=0;return t.map((g,A)=>{if(A===0)return n;const u=t[A-1],c=(g.t-u.t)/1e3;if(c<=0)return n;const d=(g.upM-u.upM)/c,w=r?n-h<e.beats:(g.t-f)/1e3>=e.glideS,M=d>p.CLIMB_FLAPS_MS?!0:d<p.DESCENT_GLIDES_MS?!1:w;if(r){const b=n+a*c;!M&&Math.floor(b)>Math.floor(n)?(n=Math.floor(b),r=!1,f=g.t):n=b}else M&&(r=!0,h=n);return n})}static sampleMs(t,a){const e=t*(a/p.SAMPLE_MS+1);return e<=p.MAX_KEYFRAMES?p.SAMPLE_MS:Math.ceil(p.SAMPLE_MS*e/p.MAX_KEYFRAMES/50)*50}static pathOf(t){return[...t.path].sort((a,e)=>a.t-e.t).map(a=>{if("eastM"in a)return{t:a.t,eastM:a.eastM,northM:a.northM,upM:a.altitudeM};const e=a.azimuthDeg*Math.PI/180,o=a.altitudeDeg*Math.PI/180,n=a.distanceM*Math.cos(o);return{t:a.t,eastM:n*Math.sin(e),northM:n*Math.cos(e),upM:(a.eyeHeightM??1.6)+a.distanceM*Math.sin(o)}})}static arranged(t,a,e,o,n,r){const h=t.formation??{kind:o>1?"cluster":"single"},f=p.slotsOf(h,o,e.wingspanM,n),g=h.kind==="v"||h.kind==="j"||h.kind==="echelon"||h.kind==="column",A=(h.wander??(g?.15:.4))*e.wingspanM,u=new It(a),c=Math.max(u.meanSpeedMS(),1);return f.map(d=>{const w=g?Math.max(0,-d.forwardM)/c:0,M=p.swayFrom(n,A),b=[];for(let i=a[0].t;i<=a[a.length-1].t+1e-6;i+=r){const m=(i-a[0].t)/1e3,y=i-w*1e3,E=u.at(y),O=u.velocityAt(y),N=Math.atan2(O.east,O.north),[I,z,T]=M(m),P=g?I:d.forwardM+I,v=d.rightM+z,et=E.eastM+Math.sin(N)*P+Math.cos(N)*v,at=E.northM+Math.cos(N)*P-Math.sin(N)*v;b.push({t:i,eastM:et,northM:at,upM:E.upM+d.upM+T,headingDeg:0,pitchDeg:0,rollDeg:0})}return p.attitudes(b),{samples:b,delayS:w}})}static slotsOf(t,a,e,o){const n=[],r=t.kind;if(r==="single"||a===1)return[{forwardM:0,rightM:0,upM:0}];if(r==="v"||r==="j"||r==="echelon"||r==="column"){const c=(t.spacing??1)*e*(r==="column"?0:1),d=(t.angleDeg??70)/2*Math.PI/180,w=r==="column"?(t.spacing??1)*e:c/Math.tan(d),M=r==="v"?.5:r==="echelon"||r==="column"?1:t.asymmetry??.7;n.push({forwardM:0,rightM:0,upM:0});const b=Math.round(M*(a-1));let i=0,m=0;for(let y=1;y<a;y++){const E=m>=a-1-b||i<b&&i/Math.max(b,1)<=m/Math.max(a-1-b,1),O=E?++i:++m;n.push({forwardM:-w*O,rightM:(E?1:-1)*c*O,upM:-.05*e*O*o()})}return n}const h=(t.spacing??1.5)*e;if(r==="front"){for(let c=0;c<a;c++)n.push({forwardM:(o()-.5)*h*1.2,rightM:(c-(a-1)/2)*h,upM:(o()-.5)*h*.4});return n}const f=a*h**3,g=Math.cbrt(f/(4/3*Math.PI*1*2.8*5.6)),A={up:g,across:2.8*g,along:5.6*g};let u=0;for(;n.length<a&&u<a*200;){u++;const c=2*o()-1,d=2*o()-1,w=2*o()-1;if(c*c+d*d+w*w>1)continue;const M={forwardM:c*A.along,rightM:d*A.across,upM:w*A.up};n.some(b=>(b.forwardM-M.forwardM)**2+(b.rightM-M.rightM)**2+(b.upM-M.upM)**2<(h/2)**2)||n.push(M)}for(;n.length<a;)n.push({forwardM:(o()-.5)*A.along,rightM:(o()-.5)*A.across,upM:0});return n}static swayFrom(t,a){const e=[0,1,2].map(o=>[0,1].map(()=>({period:3+t()*7,phase:t()*2*Math.PI,share:(o===2?.4:o===1?.7:1)*(.4+.6*t())})));return o=>e.map(n=>n.reduce((r,h)=>r+a*h.share*.5*Math.sin(2*Math.PI*o/h.period+h.phase),0))}static attitudes(t){const a=t.length;if(!(a<2)){for(let e=0;e<a;e++){const o=t[Math.max(0,e-1)],n=t[Math.min(a-1,e+1)],r=(n.t-o.t)/1e3,h=(n.eastM-o.eastM)/r,f=(n.northM-o.northM)/r,g=(n.upM-o.upM)/r,A=Math.hypot(h,f),u=t[e];u.headingDeg=A>.05?(Math.atan2(h,f)*180/Math.PI+360)%360:e>0?t[e-1].headingDeg:0,u.pitchDeg=Math.atan2(g,Math.max(A,.5))*180/Math.PI}for(let e=0;e<a;e++){const o=t[Math.max(0,e-2)],n=t[Math.min(a-1,e+2)],r=(n.t-o.t)/1e3;let h=n.headingDeg-o.headingDeg;h=(h+540)%360-180;const f=t[e],g=t[Math.max(0,e-1)],A=t[Math.min(a-1,e+1)],u=Math.hypot(A.eastM-g.eastM,A.northM-g.northM)/Math.max((A.t-g.t)/1e3,.001),c=r>0?h*Math.PI/180/r:0,d=Math.atan(u*c/V.G)*180/Math.PI;f.rollDeg=Math.max(-70,Math.min(70,d))}}}static randomFrom(t){let a=t>>>0;return()=>{a=a+1831565813>>>0;let e=a;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}static round(t,a=100){return Math.round(t*a)/a}}class It{constructor(t){this.points=t}at(t){const a=this.points;if(a.length===1||t<=a[0].t)return this.extrapolated(t,0);if(t>=a[a.length-1].t)return this.extrapolated(t,a.length-1);let e=0;for(;e<a.length-2&&t>a[e+1].t;)e++;const o=a[Math.max(0,e-1)],n=a[e],r=a[e+1],h=a[Math.min(a.length-1,e+2)],f=(t-n.t)/(r.t-n.t),g=(u,c,d)=>(c[d]-u[d])/Math.max(c.t-u.t,1)*(r.t-n.t),A=u=>{const c=g(o,r,u),d=g(n,h,u),w=f*f,M=w*f;return(2*M-3*w+1)*n[u]+(M-2*w+f)*c+(-2*M+3*w)*r[u]+(M-w)*d};return{t,eastM:A("eastM"),northM:A("northM"),upM:A("upM")}}extrapolated(t,a){const e=this.points,o=e[a];if(e.length<2)return{...o,t};const n=a===0?e[0]:e[e.length-2],r=a===0?e[1]:e[e.length-1],h=(t-o.t)/Math.max(r.t-n.t,1);return{t,eastM:o.eastM+(r.eastM-n.eastM)*h,northM:o.northM+(r.northM-n.northM)*h,upM:o.upM+(r.upM-n.upM)*h}}velocityAt(t){const a=this.at(t-50),e=this.at(t+50);return{east:(e.eastM-a.eastM)/.1,north:(e.northM-a.northM)/.1,up:(e.upM-a.upM)/.1}}meanSpeedMS(){const t=this.points;if(t.length<2)return 0;let a=0;for(let e=1;e<t.length;e++)a+=Math.hypot(t[e].eastM-t[e-1].eastM,t[e].northM-t[e-1].northM,t[e].upM-t[e-1].upM);return a/Math.max((t[t.length-1].t-t[0].t)/1e3,.001)}}const qt=Object.freeze(Object.defineProperty({__proto__:null,BirdFlock:p,FlightPath:It},Symbol.toStringTag,{value:"Module"}));export{p as B,l as F,V as a,qt as b};
@@ -1 +1 @@
1
- const e={event:"Event",accountOf:"Observation of",passagesHeading:"Reported in",interviewOf:"Interview of",untitledInterview:"Interview {n}",deleteInterviewQuestion:"Delete this interview from the case? Nothing is written until the case is saved.",untitledReading:"Reading {n}",eventsInTime:"Events · in the order of time",citedMoment:"Moment {k}, quoted in {title}: “{quote}”",backToInterview:"Back to the interview",openEvent:"Open",previousEvent:"Previous event",nextEvent:"Next event",kindObservations:"Observations",kindReadings:"Readings",kindInterviews:"Interviews",linkAnd:"and",byAuthor:"by",kindReading:"Reading",readingsCount:"{n} reading(s)",readingVerdict:{incompatible:"Contradicts what is established",unsettled:"Not settled",compatible:"Compatible"},findingOutcome:{holds:"Holds",fails:"Fails",untested:"Could not be tested"},findingAgainst:{established:"against what is established",supposed:"against a supposition"},untitledObservation:"Observation {n}",deleteRecording:"Delete this recording from the case",cloneEvent:"Copy this event: the copy is what you carry on with",freezeEvent:"Freeze this event, so that work resting on it stays true",unfreezeEvent:"Thaw this event, to edit it again",sealedChip:"Frozen",deleteFrozen:"Frozen: thaw it to delete it",frozenNote:"This event is frozen: nothing can be edited in it, so that an interview or a hypothesis resting on it is not invalidated. Copy it to carry on, or thaw it.",thawButton:"Thaw",deleteReadingQuestion:"Delete this reading? Nothing is written until the case is saved.",deleteObservationQuestion:"Delete this observation from the case? Nothing is written until the case is saved.",deleteRefused:"This observation is read by {n} reading(s): delete them first.",titleField:"Title of the reading",authorField:"Author",investigatorField:"Investigator",addTitle:"Add an event",kindField:"Type",kindObservation:"Observation",kindInterview:"Interview",witnessField:"Witness",mediumField:"Medium",interviewerField:"Interviewer",plainTitleField:"Title",sourceField:"Source",sourceBlank:"A blank recording",sourceFile:"An existing recording",observerField:"Witness",fileField:"File",loadFailed:"That recording could not be read.",isACase:"That is a case, not a recording.",ok:"OK",cancel:"Cancel",caseHeading:"Case",caseId:"ID",recordingId:"ID",idTaken:"Another recording of the case has this ID.",idInvalid:"An ID is made of letters, digits, hyphens and underscores, and starts with a letter or a digit.",idNeeded:"A reading names this recording by its ID: it cannot be left empty.",idDuplicated:"Two events of the case have the ID “{id}”: a reading that names it is ambiguous.",readingUnresolved:"A reading names “{id}”, which no event of the case has as its ID, nor any recording it lists.",caseTitle:"Title",caseTime:"When",eventsTab:"Events",fileTab:"File",importFile:"Load case file",inputFileFromFile:"from your disk",inputFileFromUrl:"from an address",inputFileModeHint:"Click to give it the other way: a file of yours, or an address",inputFileLoad:"Load",fileNotACase:"That file is not a case (it has no events).",formatVersionError:"This file states version {found} of its format; this UFO@home reads up to version {supported}. Open it with a newer UFO@home.",fileInvalid:"This text is not valid JSON yet, or not a case: the case keeps what it last understood.",fileLoading:"Loading the editor…",add:"Add",addHint:"Add an event",interpretationOf:"Reading of",colon:": ",quoted:"“{text}”",interpretationOfNone:"—",groupReadings:"Group the readings under their observation",alsoAbout:"Also about",foldReadings:"Fold its readings away",unfoldReadings:"Unfold its readings",exportButton:"Save",readButton:"Read",readTitle:"Read what is edited, as a reader sees it",exportTitle:"Save the case",exportAlso:"Also save the observations",addToCase:"Add to a case",unsavedChanges:"Changes not saved",discardQuestion:"Some changes are not saved yet. Load anyway and lose them?",discardTitle:"Unsaved changes",discardOk:"Load anyway",leaveQuestion:"Some changes are not saved yet. Leave anyway and lose them?",leaveOk:"Leave anyway"};export{e as caseEditorMessages_en};
1
+ const e={event:"Event",accountOf:"Observation of",passagesHeading:"Reported in",interviewOf:"Interview of",untitledInterview:"Interview {n}",deleteInterviewQuestion:"Delete this interview from the case? Nothing is written until the case is saved.",untitledReading:"Reading {n}",eventsInTime:"Events · in the order of time",citedMoment:"Moment {k}, quoted in {title}: “{quote}”",backToInterview:"Back to the interview",openEvent:"Open",previousEvent:"Previous event",nextEvent:"Next event",kindObservations:"Observations",kindReadings:"Readings",kindInterviews:"Interviews",linkAnd:"and",byAuthor:"by",kindReading:"Reading",readingsCount:"{n} reading(s)",readingVerdict:{incompatible:"Contradicts what is established",unsettled:"Not settled",compatible:"Compatible"},findingOutcome:{holds:"Holds",fails:"Fails",untested:"Could not be tested"},findingAgainst:{established:"against what is established",supposed:"against a supposition"},untitledObservation:"Observation {n}",deleteRecording:"Delete this recording from the case",cloneEvent:"Copy this event: the copy is what you carry on with",freezeEvent:"Freeze this event, so that work resting on it stays true",unfreezeEvent:"Thaw this event, to edit it again",sealedChip:"Frozen",deleteFrozen:"Frozen: thaw it to delete it",frozenNote:"This event is frozen: nothing can be edited in it, so that an interview or a hypothesis resting on it is not invalidated. Copy it to carry on, or thaw it.",thawButton:"Thaw",deleteReadingQuestion:"Delete this reading? Nothing is written until the case is saved.",deleteObservationQuestion:"Delete this observation from the case? Nothing is written until the case is saved.",deleteRefused:"This observation is read by {n} reading(s): delete them first.",titleField:"Title of the reading",authorField:"Author",investigatorField:"Investigator",addTitle:"Add an event",kindField:"Type",kindObservation:"Observation",kindInterview:"Interview",witnessField:"Witness",mediumField:"Medium",interviewerField:"Interviewer",plainTitleField:"Title",sourceField:"Source",sourceBlank:"A blank recording",sourceFile:"An existing recording",observerField:"Witness",fileField:"File",loadFailed:"That recording could not be read.",isACase:"That is a case, not a recording.",ok:"OK",cancel:"Cancel",caseHeading:"Case",caseId:"ID",recordingId:"ID",idTaken:"Another recording of the case has this ID.",idInvalid:"An ID is made of letters, digits, hyphens and underscores, and starts with a letter or a digit.",idNeeded:"A reading names this recording by its ID: it cannot be left empty.",idDuplicated:"Two events of the case have the ID “{id}”: a reading that names it is ambiguous.",readingUnresolved:"A reading names “{id}”, which no event of the case has as its ID, nor any recording it lists.",caseTitle:"Title",caseTime:"When",eventsTab:"Events",fileTab:"File",importFile:"Load case file",inputFileFromFile:"from your disk",inputFileFromUrl:"from an address",inputFileModeHint:"Click to give it the other way: a file of yours, or an address",inputFileLoad:"Load",fileNotACase:"That file is not a case (it has no events).",formatVersionError:"This file states version {found} of its format; this UFO@home reads up to version {supported}. Open it with a newer UFO@home.",fileInvalid:"This text is not valid JSON yet, or not a case: the case keeps what it last understood.",fileLoading:"Loading the editor…",add:"Add",addHint:"Add an event",interpretationOf:"Reading of",colon:": ",quoted:"“{text}”",interpretationOfNone:"—",groupReadings:"Group the readings under their observation",resizeColumns:"Resize the history column (double-click: back to its width)",alsoAbout:"Also about",foldReadings:"Fold its readings away",unfoldReadings:"Unfold its readings",exportButton:"Save",readButton:"Read",readTitle:"Read what is edited, as a reader sees it",exportTitle:"Save the case",exportAlso:"Also save the observations",addToCase:"Add to a case",unsavedChanges:"Changes not saved",discardQuestion:"Some changes are not saved yet. Load anyway and lose them?",discardTitle:"Unsaved changes",discardOk:"Load anyway",leaveQuestion:"Some changes are not saved yet. Leave anyway and lose them?",leaveOk:"Leave anyway"};export{e as caseEditorMessages_en};
@@ -1 +1 @@
1
- const e={event:"Evento",accountOf:"Observación de",passagesHeading:"Relatado en",interviewOf:"Entrevista a",untitledInterview:"Entrevista {n}",deleteInterviewQuestion:"¿Eliminar esta entrevista del caso? Nada se escribe hasta guardar el caso.",untitledReading:"Lectura {n}",eventsInTime:"Eventos · en orden cronológico",citedMoment:"Momento {k}, citado en {title}: «{quote}»",backToInterview:"Volver a la entrevista",openEvent:"Abrir",previousEvent:"Evento anterior",nextEvent:"Evento siguiente",kindObservations:"Observaciones",kindReadings:"Lecturas",kindInterviews:"Entrevistas",linkAnd:"y",byAuthor:"por",kindReading:"Lectura",readingsCount:"{n} lectura(s)",readingVerdict:{incompatible:"Contradice lo establecido",unsettled:"Sin resolver",compatible:"Compatible"},findingOutcome:{holds:"Se sostiene",fails:"Falla",untested:"No se pudo probar"},findingAgainst:{established:"contra un elemento establecido",supposed:"contra una suposición"},untitledObservation:"Observación {n}",deleteRecording:"Quitar esta grabación del caso",cloneEvent:"Clonar este evento: el clon es lo que continúas",freezeEvent:"Congelar este evento, para que lo que se apoya en él siga siendo cierto",unfreezeEvent:"Descongelar este evento, para volver a editarlo",sealedChip:"Congelado",deleteFrozen:"Congelado: descongélalo para quitarlo",frozenNote:"Este evento está congelado: nada se edita en él, para que una entrevista o una hipótesis que se apoye en él no quede invalidada. Clónalo para continuar, o descongélalo.",thawButton:"Descongelar",deleteReadingQuestion:"¿Eliminar esta lectura? Nada se escribe hasta guardar el caso.",deleteObservationQuestion:"¿Eliminar esta observación del caso? Nada se escribe hasta guardar el caso.",deleteRefused:"Esta observación es leída por {n} lectura(s): elimínelas primero.",titleField:"Título de la lectura",authorField:"Autor",investigatorField:"Investigador",addTitle:"Añadir un evento",kindField:"Tipo",kindObservation:"Observación",kindInterview:"Entrevista",witnessField:"Testigo",mediumField:"Medio",interviewerField:"Entrevistador",plainTitleField:"Título",sourceField:"Origen",sourceBlank:"Una grabación en blanco",sourceFile:"Un registro existente",observerField:"Testigo",fileField:"Archivo",loadFailed:"No se pudo leer esa grabación.",isACase:"Eso es un caso, no una grabación.",ok:"Aceptar",cancel:"Cancelar",caseHeading:"Caso",caseId:"Identificador",recordingId:"Identificador",idTaken:"Otra grabación del caso tiene este identificador.",idInvalid:"Un identificador se compone de letras, dígitos, guiones y guiones bajos, y empieza por una letra o un dígito.",idNeeded:"Una lectura designa esta grabación por su identificador: no puede quedar vacío.",idDuplicated:"Dos eventos del caso tienen el identificador «{id}»: una lectura que lo designa es ambigua.",readingUnresolved:"Una lectura designa «{id}», que ningún evento del caso tiene como identificador, ni ninguna grabación que enumera.",caseTitle:"Título",caseTime:"Fecha",eventsTab:"Eventos",fileTab:"Archivo",importFile:"Cargar un archivo de caso",inputFileFromFile:"desde su disco",inputFileFromUrl:"desde una dirección",inputFileModeHint:"Pulsar para darlo de la otra forma: un archivo suyo o una dirección",inputFileLoad:"Cargar",fileNotACase:"Ese archivo no es un caso (no tiene eventos).",formatVersionError:"Este archivo indica la versión {found} de su formato; este UFO@home lee hasta la versión {supported}. Ábralo con un UFO@home más reciente.",fileInvalid:"Este texto aún no es JSON válido, o no es un caso: el caso conserva lo último que entendió.",fileLoading:"Cargando el editor…",add:"Añadir",addHint:"Añadir un evento",interpretationOf:"Lectura de",colon:": ",quoted:"«{text}»",interpretationOfNone:"—",groupReadings:"Agrupar las lecturas por observación",alsoAbout:"También trata de",foldReadings:"Plegar sus lecturas",unfoldReadings:"Desplegar sus lecturas",exportButton:"Guardar",readButton:"Leer",readTitle:"Leer lo que se edita, tal como lo ve un lector",exportTitle:"Guardar el caso",exportAlso:"Guardar también las observaciones",addToCase:"Añadir a un caso",unsavedChanges:"Cambios sin guardar",discardQuestion:"Hay cambios que aún no se han guardado. ¿Cargar de todos modos y perderlos?",discardTitle:"Cambios sin guardar",discardOk:"Cargar de todos modos",leaveQuestion:"Hay cambios que aún no se han guardado. ¿Salir de todos modos y perderlos?",leaveOk:"Salir de todos modos"};export{e as caseEditorMessages_es};
1
+ const e={event:"Evento",accountOf:"Observación de",passagesHeading:"Relatado en",interviewOf:"Entrevista a",untitledInterview:"Entrevista {n}",deleteInterviewQuestion:"¿Eliminar esta entrevista del caso? Nada se escribe hasta guardar el caso.",untitledReading:"Lectura {n}",eventsInTime:"Eventos · en orden cronológico",citedMoment:"Momento {k}, citado en {title}: «{quote}»",backToInterview:"Volver a la entrevista",openEvent:"Abrir",previousEvent:"Evento anterior",nextEvent:"Evento siguiente",kindObservations:"Observaciones",kindReadings:"Lecturas",kindInterviews:"Entrevistas",linkAnd:"y",byAuthor:"por",kindReading:"Lectura",readingsCount:"{n} lectura(s)",readingVerdict:{incompatible:"Contradice lo establecido",unsettled:"Sin resolver",compatible:"Compatible"},findingOutcome:{holds:"Se sostiene",fails:"Falla",untested:"No se pudo probar"},findingAgainst:{established:"contra un elemento establecido",supposed:"contra una suposición"},untitledObservation:"Observación {n}",deleteRecording:"Quitar esta grabación del caso",cloneEvent:"Clonar este evento: el clon es lo que continúas",freezeEvent:"Congelar este evento, para que lo que se apoya en él siga siendo cierto",unfreezeEvent:"Descongelar este evento, para volver a editarlo",sealedChip:"Congelado",deleteFrozen:"Congelado: descongélalo para quitarlo",frozenNote:"Este evento está congelado: nada se edita en él, para que una entrevista o una hipótesis que se apoye en él no quede invalidada. Clónalo para continuar, o descongélalo.",thawButton:"Descongelar",deleteReadingQuestion:"¿Eliminar esta lectura? Nada se escribe hasta guardar el caso.",deleteObservationQuestion:"¿Eliminar esta observación del caso? Nada se escribe hasta guardar el caso.",deleteRefused:"Esta observación es leída por {n} lectura(s): elimínelas primero.",titleField:"Título de la lectura",authorField:"Autor",investigatorField:"Investigador",addTitle:"Añadir un evento",kindField:"Tipo",kindObservation:"Observación",kindInterview:"Entrevista",witnessField:"Testigo",mediumField:"Medio",interviewerField:"Entrevistador",plainTitleField:"Título",sourceField:"Origen",sourceBlank:"Una grabación en blanco",sourceFile:"Un registro existente",observerField:"Testigo",fileField:"Archivo",loadFailed:"No se pudo leer esa grabación.",isACase:"Eso es un caso, no una grabación.",ok:"Aceptar",cancel:"Cancelar",caseHeading:"Caso",caseId:"Identificador",recordingId:"Identificador",idTaken:"Otra grabación del caso tiene este identificador.",idInvalid:"Un identificador se compone de letras, dígitos, guiones y guiones bajos, y empieza por una letra o un dígito.",idNeeded:"Una lectura designa esta grabación por su identificador: no puede quedar vacío.",idDuplicated:"Dos eventos del caso tienen el identificador «{id}»: una lectura que lo designa es ambigua.",readingUnresolved:"Una lectura designa «{id}», que ningún evento del caso tiene como identificador, ni ninguna grabación que enumera.",caseTitle:"Título",caseTime:"Fecha",eventsTab:"Eventos",fileTab:"Archivo",importFile:"Cargar un archivo de caso",inputFileFromFile:"desde su disco",inputFileFromUrl:"desde una dirección",inputFileModeHint:"Pulsar para darlo de la otra forma: un archivo suyo o una dirección",inputFileLoad:"Cargar",fileNotACase:"Ese archivo no es un caso (no tiene eventos).",formatVersionError:"Este archivo indica la versión {found} de su formato; este UFO@home lee hasta la versión {supported}. Ábralo con un UFO@home más reciente.",fileInvalid:"Este texto aún no es JSON válido, o no es un caso: el caso conserva lo último que entendió.",fileLoading:"Cargando el editor…",add:"Añadir",addHint:"Añadir un evento",interpretationOf:"Lectura de",colon:": ",quoted:"«{text}»",interpretationOfNone:"—",groupReadings:"Agrupar las lecturas por observación",resizeColumns:"Cambiar el ancho de la columna del historial (doble clic: ancho por defecto)",alsoAbout:"También trata de",foldReadings:"Plegar sus lecturas",unfoldReadings:"Desplegar sus lecturas",exportButton:"Guardar",readButton:"Leer",readTitle:"Leer lo que se edita, tal como lo ve un lector",exportTitle:"Guardar el caso",exportAlso:"Guardar también las observaciones",addToCase:"Añadir a un caso",unsavedChanges:"Cambios sin guardar",discardQuestion:"Hay cambios que aún no se han guardado. ¿Cargar de todos modos y perderlos?",discardTitle:"Cambios sin guardar",discardOk:"Cargar de todos modos",leaveQuestion:"Hay cambios que aún no se han guardado. ¿Salir de todos modos y perderlos?",leaveOk:"Salir de todos modos"};export{e as caseEditorMessages_es};
@@ -1 +1 @@
1
- const e={event:"Événement",accountOf:"Observation de",passagesHeading:"Relaté dans",interviewOf:"Interview de",untitledInterview:"Interview {n}",deleteInterviewQuestion:"Supprimer cet entretien du dossier ? Rien n'est écrit avant la sauvegarde du dossier.",untitledReading:"Lecture {n}",eventsInTime:"Événements · dans l'ordre du temps",citedMoment:"Moment {k}, cité dans {title} : « {quote} »",backToInterview:"Revenir à l'entretien",openEvent:"Ouvrir",previousEvent:"Événement précédent",nextEvent:"Événement suivant",kindObservations:"Observations",kindReadings:"Lectures",kindInterviews:"Interviews",linkAnd:"et",byAuthor:"par",kindReading:"Lecture",readingsCount:"{n} lecture(s)",readingVerdict:{incompatible:"Contredit ce qui est établi",unsettled:"Non tranchée",compatible:"Compatible"},findingOutcome:{holds:"Tient",fails:"Échoue",untested:"Non testable"},findingAgainst:{established:"contre un élément établi",supposed:"contre une supposition"},untitledObservation:"Observation {n}",deleteRecording:"Retirer cet enregistrement du dossier",cloneEvent:"Cloner cet événement : c'est le clone que vous continuez",freezeEvent:"Geler cet événement, pour que ce qui s'appuie dessus reste vrai",unfreezeEvent:"Dégeler cet événement, pour le modifier à nouveau",sealedChip:"Gelé",deleteFrozen:"Gelé : le dégeler pour le retirer",frozenNote:"Cet événement est gelé : rien ne s'y modifie, afin qu'une interview ou une hypothèse qui s'appuie dessus ne soit pas invalidée. Clonez-le pour continuer, ou dégelez-le.",thawButton:"Dégeler",deleteReadingQuestion:"Supprimer cette lecture ? Rien n'est écrit avant la sauvegarde du dossier.",deleteObservationQuestion:"Supprimer cette observation du dossier ? Rien n'est écrit avant la sauvegarde du dossier.",deleteRefused:"Cette observation est lue par {n} lecture(s) : supprimez-les d'abord.",titleField:"Titre de la lecture",authorField:"Auteur",investigatorField:"Enquêteur",addTitle:"Ajouter un événement",kindField:"Type",kindObservation:"Observation",kindInterview:"Interview",witnessField:"Témoin",mediumField:"Moyen",interviewerField:"Enquêteur",plainTitleField:"Titre",sourceField:"Source",sourceBlank:"Un enregistrement vierge",sourceFile:"Un enregistrement existant",observerField:"Témoin",fileField:"Fichier",loadFailed:"Cet enregistrement n'a pas pu être lu.",isACase:"C'est un dossier, pas un enregistrement.",ok:"OK",cancel:"Annuler",caseHeading:"Dossier",caseId:"Identifiant",recordingId:"Identifiant",idTaken:"Un autre enregistrement du dossier porte cet identifiant.",idInvalid:"Un identifiant est fait de lettres, de chiffres, de tirets et de soulignés, et commence par une lettre ou un chiffre.",idNeeded:"Une lecture désigne cet enregistrement par son identifiant : il ne peut pas rester vide.",idDuplicated:"Deux événements du dossier portent l'identifiant « {id} » : une lecture qui le désigne est ambiguë.",readingUnresolved:"Une lecture désigne « {id} », qu'aucun événement du dossier ne porte comme identifiant, ni aucun enregistrement qu'il liste.",caseTitle:"Titre",caseTime:"Date",eventsTab:"Événements",fileTab:"Fichier",importFile:"Charger un fichier de dossier",inputFileFromFile:"depuis votre disque",inputFileFromUrl:"depuis une adresse",inputFileModeHint:"Cliquer pour le donner autrement : un fichier à vous, ou une adresse",inputFileLoad:"Charger",fileNotACase:"Ce fichier n'est pas un dossier (il n'a pas d'événements).",formatVersionError:"Ce fichier indique la version {found} de son format ; cet UFO@home lit jusqu'à la version {supported}. Ouvrez-le avec un UFO@home plus récent.",fileInvalid:"Ce texte n'est pas encore du JSON valide, ou pas un dossier : le dossier garde ce qu'il a compris en dernier.",fileLoading:"Chargement de l'éditeur…",add:"Ajouter",addHint:"Ajouter un événement",interpretationOf:"Lecture de",colon:" : ",quoted:"« {text} »",interpretationOfNone:"—",groupReadings:"Regrouper les lectures par observation",alsoAbout:"Porte aussi sur",foldReadings:"Replier ses lectures",unfoldReadings:"Déplier ses lectures",exportButton:"Sauver",readButton:"Lire",readTitle:"Lire ce qui est édité, tel qu'un lecteur le voit",exportTitle:"Sauver le dossier",exportAlso:"Sauver aussi les observations",addToCase:"Ajouter à un dossier",unsavedChanges:"Modifications non sauvées",discardQuestion:"Des modifications ne sont pas encore sauvées. Charger quand même et les perdre ?",discardTitle:"Modifications non sauvées",discardOk:"Charger quand même",leaveQuestion:"Des modifications ne sont pas encore sauvées. Quitter quand même et les perdre ?",leaveOk:"Quitter quand même"};export{e as caseEditorMessages_fr};
1
+ const e={event:"Événement",accountOf:"Observation de",passagesHeading:"Relaté dans",interviewOf:"Interview de",untitledInterview:"Interview {n}",deleteInterviewQuestion:"Supprimer cet entretien du dossier ? Rien n'est écrit avant la sauvegarde du dossier.",untitledReading:"Lecture {n}",eventsInTime:"Événements · dans l'ordre du temps",citedMoment:"Moment {k}, cité dans {title} : « {quote} »",backToInterview:"Revenir à l'entretien",openEvent:"Ouvrir",previousEvent:"Événement précédent",nextEvent:"Événement suivant",kindObservations:"Observations",kindReadings:"Lectures",kindInterviews:"Interviews",linkAnd:"et",byAuthor:"par",kindReading:"Lecture",readingsCount:"{n} lecture(s)",readingVerdict:{incompatible:"Contredit ce qui est établi",unsettled:"Non tranchée",compatible:"Compatible"},findingOutcome:{holds:"Tient",fails:"Échoue",untested:"Non testable"},findingAgainst:{established:"contre un élément établi",supposed:"contre une supposition"},untitledObservation:"Observation {n}",deleteRecording:"Retirer cet enregistrement du dossier",cloneEvent:"Cloner cet événement : c'est le clone que vous continuez",freezeEvent:"Geler cet événement, pour que ce qui s'appuie dessus reste vrai",unfreezeEvent:"Dégeler cet événement, pour le modifier à nouveau",sealedChip:"Gelé",deleteFrozen:"Gelé : le dégeler pour le retirer",frozenNote:"Cet événement est gelé : rien ne s'y modifie, afin qu'une interview ou une hypothèse qui s'appuie dessus ne soit pas invalidée. Clonez-le pour continuer, ou dégelez-le.",thawButton:"Dégeler",deleteReadingQuestion:"Supprimer cette lecture ? Rien n'est écrit avant la sauvegarde du dossier.",deleteObservationQuestion:"Supprimer cette observation du dossier ? Rien n'est écrit avant la sauvegarde du dossier.",deleteRefused:"Cette observation est lue par {n} lecture(s) : supprimez-les d'abord.",titleField:"Titre de la lecture",authorField:"Auteur",investigatorField:"Enquêteur",addTitle:"Ajouter un événement",kindField:"Type",kindObservation:"Observation",kindInterview:"Interview",witnessField:"Témoin",mediumField:"Moyen",interviewerField:"Enquêteur",plainTitleField:"Titre",sourceField:"Source",sourceBlank:"Un enregistrement vierge",sourceFile:"Un enregistrement existant",observerField:"Témoin",fileField:"Fichier",loadFailed:"Cet enregistrement n'a pas pu être lu.",isACase:"C'est un dossier, pas un enregistrement.",ok:"OK",cancel:"Annuler",caseHeading:"Dossier",caseId:"Identifiant",recordingId:"Identifiant",idTaken:"Un autre enregistrement du dossier porte cet identifiant.",idInvalid:"Un identifiant est fait de lettres, de chiffres, de tirets et de soulignés, et commence par une lettre ou un chiffre.",idNeeded:"Une lecture désigne cet enregistrement par son identifiant : il ne peut pas rester vide.",idDuplicated:"Deux événements du dossier portent l'identifiant « {id} » : une lecture qui le désigne est ambiguë.",readingUnresolved:"Une lecture désigne « {id} », qu'aucun événement du dossier ne porte comme identifiant, ni aucun enregistrement qu'il liste.",caseTitle:"Titre",caseTime:"Date",eventsTab:"Événements",fileTab:"Fichier",importFile:"Charger un fichier de dossier",inputFileFromFile:"depuis votre disque",inputFileFromUrl:"depuis une adresse",inputFileModeHint:"Cliquer pour le donner autrement : un fichier à vous, ou une adresse",inputFileLoad:"Charger",fileNotACase:"Ce fichier n'est pas un dossier (il n'a pas d'événements).",formatVersionError:"Ce fichier indique la version {found} de son format ; cet UFO@home lit jusqu'à la version {supported}. Ouvrez-le avec un UFO@home plus récent.",fileInvalid:"Ce texte n'est pas encore du JSON valide, ou pas un dossier : le dossier garde ce qu'il a compris en dernier.",fileLoading:"Chargement de l'éditeur…",add:"Ajouter",addHint:"Ajouter un événement",interpretationOf:"Lecture de",colon:" : ",quoted:"« {text} »",interpretationOfNone:"—",groupReadings:"Regrouper les lectures par observation",resizeColumns:"Redimensionner la colonne de l'historique (double-clic : largeur par défaut)",alsoAbout:"Porte aussi sur",foldReadings:"Replier ses lectures",unfoldReadings:"Déplier ses lectures",exportButton:"Sauver",readButton:"Lire",readTitle:"Lire ce qui est édité, tel qu'un lecteur le voit",exportTitle:"Sauver le dossier",exportAlso:"Sauver aussi les observations",addToCase:"Ajouter à un dossier",unsavedChanges:"Modifications non sauvées",discardQuestion:"Des modifications ne sont pas encore sauvées. Charger quand même et les perdre ?",discardTitle:"Modifications non sauvées",discardOk:"Charger quand même",leaveQuestion:"Des modifications ne sont pas encore sauvées. Quitter quand même et les perdre ?",leaveOk:"Quitter quand même"};export{e as caseEditorMessages_fr};
@@ -1 +1 @@
1
- const e={event:"Evento",accountOf:"Osservazione di",passagesHeading:"Riportato in",interviewOf:"Intervista a",untitledInterview:"Intervista {n}",deleteInterviewQuestion:"Eliminare questa intervista dal caso? Nulla viene scritto prima del salvataggio del caso.",untitledReading:"Lettura {n}",eventsInTime:"Eventi · in ordine di tempo",citedMoment:"Momento {k}, citato in {title}: «{quote}»",backToInterview:"Torna all'intervista",openEvent:"Apri",previousEvent:"Evento precedente",nextEvent:"Evento successivo",kindObservations:"Osservazioni",kindReadings:"Letture",kindInterviews:"Interviste",linkAnd:"e",byAuthor:"di",kindReading:"Lettura",readingsCount:"{n} lettura/e",readingVerdict:{incompatible:"Contraddice ciò che è accertato",unsettled:"Non decisa",compatible:"Compatibile"},findingOutcome:{holds:"Regge",fails:"Fallisce",untested:"Non verificabile"},findingAgainst:{established:"contro un elemento accertato",supposed:"contro una supposizione"},untitledObservation:"Osservazione {n}",deleteRecording:"Togliere questa registrazione dal caso",cloneEvent:"Clonare questo evento: è il clone che continui",freezeEvent:"Congelare questo evento, perché ciò che si basa su di esso resti vero",unfreezeEvent:"Scongelare questo evento, per modificarlo di nuovo",sealedChip:"Congelato",deleteFrozen:"Congelato: scongelalo per toglierlo",frozenNote:"Questo evento è congelato: nulla vi si modifica, perché un'intervista o un'ipotesi che si basa su di esso non sia invalidata. Clonalo per continuare, o scongelalo.",thawButton:"Scongelare",deleteReadingQuestion:"Eliminare questa lettura? Nulla viene scritto prima del salvataggio del caso.",deleteObservationQuestion:"Eliminare questa osservazione dal caso? Nulla viene scritto prima del salvataggio del caso.",deleteRefused:"Questa osservazione è letta da {n} lettura/e: eliminale prima.",titleField:"Titolo della lettura",authorField:"Autore",investigatorField:"Investigatore",addTitle:"Aggiungi un evento",kindField:"Tipo",kindObservation:"Osservazione",kindInterview:"Intervista",witnessField:"Testimone",mediumField:"Mezzo",interviewerField:"Intervistatore",plainTitleField:"Titolo",sourceField:"Origine",sourceBlank:"Una registrazione vuota",sourceFile:"Una registrazione esistente",observerField:"Testimone",fileField:"File",loadFailed:"Impossibile leggere quella registrazione.",isACase:"Questo è un caso, non una registrazione.",ok:"OK",cancel:"Annulla",caseHeading:"Caso",caseId:"Identificativo",recordingId:"Identificativo",idTaken:"Un'altra registrazione del caso ha questo identificativo.",idInvalid:"Un identificativo è fatto di lettere, cifre, trattini e trattini bassi, e inizia con una lettera o una cifra.",idNeeded:"Una lettura designa questa registrazione con il suo identificativo: non può restare vuoto.",idDuplicated:"Due eventi del caso hanno l'identificativo «{id}»: una lettura che lo designa è ambigua.",readingUnresolved:"Una lettura designa «{id}», che nessun evento del caso ha come identificativo, né alcuna registrazione che elenca.",caseTitle:"Titolo",caseTime:"Data",eventsTab:"Eventi",fileTab:"File",importFile:"Carica un file di caso",inputFileFromFile:"dal proprio disco",inputFileFromUrl:"da un indirizzo",inputFileModeHint:"Fare clic per darlo nell'altro modo: un proprio file o un indirizzo",inputFileLoad:"Carica",fileNotACase:"Quel file non è un caso (non ha eventi).",formatVersionError:"Questo file indica la versione {found} del suo formato; questo UFO@home legge fino alla versione {supported}. Lo apra con un UFO@home più recente.",fileInvalid:"Questo testo non è ancora JSON valido, o non è un caso: il caso conserva l'ultimo che ha capito.",fileLoading:"Caricamento dell'editor…",add:"Aggiungi",addHint:"Aggiungi un evento",interpretationOf:"Lettura di",colon:": ",quoted:"«{text}»",interpretationOfNone:"—",groupReadings:"Raggruppa le letture per osservazione",alsoAbout:"Riguarda anche",foldReadings:"Chiudi le sue letture",unfoldReadings:"Apri le sue letture",exportButton:"Salva",readButton:"Leggi",readTitle:"Leggere ciò che si modifica, come lo vede un lettore",exportTitle:"Salva il caso",exportAlso:"Salva anche le osservazioni",addToCase:"Aggiungi a un caso",unsavedChanges:"Modifiche non salvate",discardQuestion:"Alcune modifiche non sono ancora state salvate. Caricare comunque e perderle?",discardTitle:"Modifiche non salvate",discardOk:"Carica comunque",leaveQuestion:"Alcune modifiche non sono ancora state salvate. Uscire comunque e perderle?",leaveOk:"Esci comunque"};export{e as caseEditorMessages_it};
1
+ const e={event:"Evento",accountOf:"Osservazione di",passagesHeading:"Riportato in",interviewOf:"Intervista a",untitledInterview:"Intervista {n}",deleteInterviewQuestion:"Eliminare questa intervista dal caso? Nulla viene scritto prima del salvataggio del caso.",untitledReading:"Lettura {n}",eventsInTime:"Eventi · in ordine di tempo",citedMoment:"Momento {k}, citato in {title}: «{quote}»",backToInterview:"Torna all'intervista",openEvent:"Apri",previousEvent:"Evento precedente",nextEvent:"Evento successivo",kindObservations:"Osservazioni",kindReadings:"Letture",kindInterviews:"Interviste",linkAnd:"e",byAuthor:"di",kindReading:"Lettura",readingsCount:"{n} lettura/e",readingVerdict:{incompatible:"Contraddice ciò che è accertato",unsettled:"Non decisa",compatible:"Compatibile"},findingOutcome:{holds:"Regge",fails:"Fallisce",untested:"Non verificabile"},findingAgainst:{established:"contro un elemento accertato",supposed:"contro una supposizione"},untitledObservation:"Osservazione {n}",deleteRecording:"Togliere questa registrazione dal caso",cloneEvent:"Clonare questo evento: è il clone che continui",freezeEvent:"Congelare questo evento, perché ciò che si basa su di esso resti vero",unfreezeEvent:"Scongelare questo evento, per modificarlo di nuovo",sealedChip:"Congelato",deleteFrozen:"Congelato: scongelalo per toglierlo",frozenNote:"Questo evento è congelato: nulla vi si modifica, perché un'intervista o un'ipotesi che si basa su di esso non sia invalidata. Clonalo per continuare, o scongelalo.",thawButton:"Scongelare",deleteReadingQuestion:"Eliminare questa lettura? Nulla viene scritto prima del salvataggio del caso.",deleteObservationQuestion:"Eliminare questa osservazione dal caso? Nulla viene scritto prima del salvataggio del caso.",deleteRefused:"Questa osservazione è letta da {n} lettura/e: eliminale prima.",titleField:"Titolo della lettura",authorField:"Autore",investigatorField:"Investigatore",addTitle:"Aggiungi un evento",kindField:"Tipo",kindObservation:"Osservazione",kindInterview:"Intervista",witnessField:"Testimone",mediumField:"Mezzo",interviewerField:"Intervistatore",plainTitleField:"Titolo",sourceField:"Origine",sourceBlank:"Una registrazione vuota",sourceFile:"Una registrazione esistente",observerField:"Testimone",fileField:"File",loadFailed:"Impossibile leggere quella registrazione.",isACase:"Questo è un caso, non una registrazione.",ok:"OK",cancel:"Annulla",caseHeading:"Caso",caseId:"Identificativo",recordingId:"Identificativo",idTaken:"Un'altra registrazione del caso ha questo identificativo.",idInvalid:"Un identificativo è fatto di lettere, cifre, trattini e trattini bassi, e inizia con una lettera o una cifra.",idNeeded:"Una lettura designa questa registrazione con il suo identificativo: non può restare vuoto.",idDuplicated:"Due eventi del caso hanno l'identificativo «{id}»: una lettura che lo designa è ambigua.",readingUnresolved:"Una lettura designa «{id}», che nessun evento del caso ha come identificativo, né alcuna registrazione che elenca.",caseTitle:"Titolo",caseTime:"Data",eventsTab:"Eventi",fileTab:"File",importFile:"Carica un file di caso",inputFileFromFile:"dal proprio disco",inputFileFromUrl:"da un indirizzo",inputFileModeHint:"Fare clic per darlo nell'altro modo: un proprio file o un indirizzo",inputFileLoad:"Carica",fileNotACase:"Quel file non è un caso (non ha eventi).",formatVersionError:"Questo file indica la versione {found} del suo formato; questo UFO@home legge fino alla versione {supported}. Lo apra con un UFO@home più recente.",fileInvalid:"Questo testo non è ancora JSON valido, o non è un caso: il caso conserva l'ultimo che ha capito.",fileLoading:"Caricamento dell'editor…",add:"Aggiungi",addHint:"Aggiungi un evento",interpretationOf:"Lettura di",colon:": ",quoted:"«{text}»",interpretationOfNone:"—",groupReadings:"Raggruppa le letture per osservazione",resizeColumns:"Ridimensiona la colonna della cronologia (doppio clic: larghezza predefinita)",alsoAbout:"Riguarda anche",foldReadings:"Chiudi le sue letture",unfoldReadings:"Apri le sue letture",exportButton:"Salva",readButton:"Leggi",readTitle:"Leggere ciò che si modifica, come lo vede un lettore",exportTitle:"Salva il caso",exportAlso:"Salva anche le osservazioni",addToCase:"Aggiungi a un caso",unsavedChanges:"Modifiche non salvate",discardQuestion:"Alcune modifiche non sono ancora state salvate. Caricare comunque e perderle?",discardTitle:"Modifiche non salvate",discardOk:"Carica comunque",leaveQuestion:"Alcune modifiche non sono ancora state salvate. Uscire comunque e perderle?",leaveOk:"Esci comunque"};export{e as caseEditorMessages_it};
@@ -0,0 +1,112 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./InterviewElement-B3tm7y49.js","./rr0-sighting-editor.mjs","./interviewJson-CsMHIcZ-.js"])))=>i.map(i=>d[i]);
2
+ import{a9 as y,aa as p,a as I,ab as M,ac as _,f as E,i as L,ad as $,ae as U,a6 as j,af as S,ag as H,ah as V,ai as P,s as q,U as z,c as B,aj as G,ak as k,_ as D,I as K}from"./rr0-sighting-editor.mjs";import{SHOW_INFO_ATTRIBUTE as A,OBSERVER_ATTRIBUTE as m,registerSighting as F,HIDE_PICKERS_ATTRIBUTE as C,SIGHTING_ELEMENT_NAME as c,INTERPRETATION_ATTRIBUTE as b,CASE_NAMED_ATTRIBUTE as W,OBSERVER_CHANGE_EVENT as O,INTERPRETATION_CHANGE_EVENT as Y}from"./SightingElement-DukKlaH1.js";const Z=`
3
+ <header class="case-head">
4
+ <div class="case-bar">
5
+ <p id="case-kind" class="case-kind"></p>
6
+ <h2 id="case-title" class="case-title"></h2>
7
+ <!-- The same pair the observation carries, for the case: the way into the editor, and what the case says of itself. -->
8
+ <!-- The same three in the same order as an observation carries (see sightingTemplate): the way into the editor, this element's own
9
+ toggle, and what it says of itself. A reader moving between a case and an observation finds the buttons where they were. -->
10
+ <span class="case-actions">
11
+ <!-- Sharing the case: its address and the element that shows it whole (an observation of it is shared from its own player). -->
12
+ <button id="share" type="button" class="icon-btn" aria-haspopup="dialog"></button>
13
+ <rr0-case-export id="export" class="case-export"></rr0-case-export>
14
+ <button id="edit" type="button" class="icon-btn"><svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M11.3 1.3a1 1 0 0 1 1.4 0l2 2a1 1 0 0 1 0 1.4l-8.5 8.5-3.4.9.9-3.4 8.6-8.4Zm-7 9.2-.5 1.7 1.7-.5 6.9-6.9-1.2-1.2-6.9 6.9Z" fill="currentColor"/></svg></button>
15
+ <button id="timeline-button" type="button" class="icon-btn" aria-pressed="true"><svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><circle cx="8" cy="8" r="6"/><path d="M8 4.6V8l2.4 1.6"/></svg></button>
16
+ <button id="info" type="button" class="icon-btn" aria-expanded="false"><svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><circle cx="8" cy="3.6" r="1.4" fill="currentColor"/><path d="M6 6.5h3v6h1.5V14h-4.5v-1.5H7.5V8H6Z" fill="currentColor"/></svg></button>
17
+ </span>
18
+ </div>
19
+ <p id="case-summary" class="case-summary" hidden></p>
20
+ <rr0-share-dialog id="share-dialog"></rr0-share-dialog>
21
+ </header>
22
+ <!-- The chronology and what is open, one above the other; side by side when the case is given the width for both (see .case-layout). -->
23
+ <div class="case-layout">
24
+ <!-- The chronology, in the upper part: choosing an event opens it alone below; its mark on the rail shows it beside what is open, or puts
25
+ it away. Several can be open at once that way. -->
26
+ <section class="case-timeline">
27
+ <div class="events-bar">
28
+ <h3 class="events-heading"><span id="events-icon" class="events-icon" aria-hidden="true"></span><span id="events-heading"></span></h3>
29
+ <!-- Each reading under the observation it reads, or every event in the order of time: the reader's choice, remembered. -->
30
+ <button id="group-readings" type="button" class="icon-btn" aria-pressed="false"><svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><circle cx="4" cy="3.5" r="1.6"/><path d="M4 5.1v7.4M4 8.5h3.5M4 12.5h3.5"/><path d="M9.5 8.5h4M9.5 12.5h4"/></svg></button>
31
+ </div>
32
+ <ol id="case-events" class="event-list"></ol>
33
+ <rr0-readings-comparison id="readings-comparison" class="readings-comparison"></rr0-readings-comparison>
34
+ </section>
35
+ <!-- The grip between the two, on the history's edge: its width, dragged. -->
36
+ <div id="column-resize" class="column-resize"></div>
37
+ <!-- What is open, in the order of time whatever the order they were opened in. -->
38
+ <div id="open-events" class="open-events"></div>
39
+ </div>
40
+ `,J=`
41
+ :host { display: block; color: var(--rr0-ink, inherit); container-type: inline-size; }
42
+ /* The buttons' own colours, light and dark, the very ones an observation's popups are drawn with (see sightingTemplate's --pop-*): a page
43
+ that gives its own (--rr0-button-bg, -fg, -border, -hover, -on, -ring, inherited from anywhere, :root included) has them win. */
44
+ :host { --btn-bg: #f2f2f2; --btn-fg: #222; --btn-border: #ccc; --btn-hover: #e4e4e4; --btn-on: #dbe6f7; --btn-ring: #9bb6e0; }
45
+ @media (prefers-color-scheme: dark) {
46
+ :host { --btn-bg: #2c2e33; --btn-fg: #e6e6e6; --btn-border: #4a4c52; --btn-hover: #3a3d43; --btn-on: #274066; --btn-ring: #4f7bc4; }
47
+ }
48
+ .case-head { display: grid; gap: 6px; margin: 0 0 12px; }
49
+ .case-bar { display: flex; align-items: baseline; gap: 10px; }
50
+ .case-kind { margin: 0; font: 600 12px/1.4 var(--rr0-sans, system-ui, sans-serif); letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
51
+ .case-title { margin: 0; font: 600 24px/1.25 var(--rr0-serif, Georgia, serif); }
52
+ .case-actions { display: flex; gap: 4px; margin-left: auto; }
53
+ /* The very square the observation's own row wears (see sightingTemplate's .edit-link and .info-btn): same size, same border, same
54
+ background, so that the two rows are one set of buttons seen in two places. */
55
+ .icon-btn {
56
+ flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 1.8em; height: 1.8em; box-sizing: border-box;
57
+ padding: 0; border: 1px solid var(--rr0-button-border, var(--btn-border)); border-radius: 3px; background: var(--rr0-button-bg, var(--btn-bg));
58
+ color: var(--rr0-button-fg, var(--btn-fg)); cursor: pointer;
59
+ }
60
+ .icon-btn:hover, .icon-btn:focus-visible { background: var(--rr0-button-hover, var(--btn-hover)); }
61
+ /* The report's export wears the same square, its button being its own (see CaseExportElement). */
62
+ .case-export { display: inline-flex; }
63
+ .case-export::part(button) {
64
+ display: inline-flex; align-items: center; justify-content: center; width: 1.8em; height: 1.8em; box-sizing: border-box;
65
+ padding: 0; border: 1px solid var(--rr0-button-border, var(--btn-border)); border-radius: 3px; background: var(--rr0-button-bg, var(--btn-bg));
66
+ color: var(--rr0-button-fg, var(--btn-fg));
67
+ }
68
+ .case-export::part(button):hover { background: var(--rr0-button-hover, var(--btn-hover)); }
69
+ .icon-btn[aria-expanded="true"], .icon-btn[aria-pressed="false"] { background: var(--rr0-button-on, var(--btn-on)); }
70
+ .case-summary { margin: 0; font-size: 15px; line-height: 1.5; opacity: .85; }
71
+ .case-summary[hidden] { display: none; }
72
+ /* The chronology itself is common to the editor (see CaseTimeline): what cannot be done while reading is absent, not greyed out. */
73
+ .case-timeline { margin: 0 0 14px; }
74
+ .case-timeline[hidden] { display: none; }
75
+ .readings-comparison { margin-top: 12px; }
76
+ .events-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
77
+ .events-bar .icon-btn { margin-left: auto; }
78
+ /* Lit when grouping, as a switch is: not the history's own button, which is lit when the history is put away. */
79
+ #group-readings[aria-pressed="false"] { background: var(--rr0-button-bg, var(--btn-bg)); }
80
+ #group-readings:is(:hover, :focus-visible) { background: var(--rr0-button-hover, var(--btn-hover)); }
81
+ #group-readings[aria-pressed="true"] { background: var(--rr0-button-on, var(--btn-on)); }
82
+ #group-readings[hidden], #share[hidden] { display: none; }
83
+ .events-heading { display: flex; align-items: center; gap: 6px; margin: 0; font: 600 12px/1.4 var(--rr0-sans, system-ui, sans-serif); letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
84
+ .events-icon { display: inline-flex; }
85
+ .events-icon svg { width: 14px; height: 14px; }
86
+ /* What is open: one block per event, each saying which it is, in the order of time. */
87
+ /* One column as wide as the case, never as wide as what is in it: an implicit "auto" column grew to the player's own widest content,
88
+ McMinnville's longest reading in its choice (228 letters), and the stage, 16:9 of that, put the photograph beyond the case's edge. */
89
+ .open-events { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
90
+ /* Given the width (the app on a computer), the chronology in a column of its own beside what is open, kept in view as that scrolls; the
91
+ whole width to what is open when the chronology is put away. The width the case is given, never the window's. */
92
+ @container (min-width: 760px) {
93
+ .case-layout { display: grid; grid-template-columns: var(${y.PROPERTY}, minmax(16rem, 1fr)) minmax(0, 2.6fr); gap: 20px; align-items: start; }
94
+ .case-layout > .case-timeline { grid-column: 1; grid-row: 1; }
95
+ .case-layout > .open-events { grid-column: 2; grid-row: 1; }
96
+ .case-layout > .column-resize { display: block; grid-column: 1; grid-row: 1; margin-right: -16px; }
97
+ .case-layout:has(> .case-timeline[hidden]) { grid-template-columns: minmax(0, 1fr); }
98
+ .case-layout:has(> .case-timeline[hidden]) > :is(.open-events, .column-resize) { grid-column: 1; }
99
+ .case-layout:has(> .case-timeline[hidden]) > .column-resize { display: none; }
100
+ .case-layout > .case-timeline { position: sticky; top: 0; max-height: 100dvh; overflow-y: auto; margin: 0; }
101
+ /* A dialogue open alone beside the chronology has the height the chronology has (dicté : « toute la hauteur »), not the 22 lines kept
102
+ under a player when they are one above the other; kept in view as the page scrolls, as the chronology is. */
103
+ .case-layout > .open-events:has(> .open-event:only-child rr0-interview) { position: sticky; top: 0; }
104
+ .open-event:only-child rr0-interview { max-height: calc(var(--rr0-editor-height, 100dvh) - 3rem); }
105
+ }
106
+ .open-event { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
107
+ .open-event > .open-title { margin: 0; font: 600 13px/1.4 var(--rr0-sans, system-ui, sans-serif); letter-spacing: .04em; text-transform: uppercase; opacity: .7; }
108
+ .open-event rr0-interview { padding: 10px 12px; border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-radius: 10px;
109
+ font-size: 14px; line-height: 1.5; max-height: 22em; overflow-y: auto; }
110
+ ${p.CSS}
111
+ ${y.CSS}
112
+ `,g="rr0-case",v="show-timeline",w="open-events",Q="openchange";class u extends HTMLElement{static get observedAttributes(){return["src","show-labels",A,v,w,m]}static PASSED_ON=["show-labels"];shadow;openEvents;timeline;shown=new Map;messages;said=new I(["en"]);json;url;shareMessages;entries=[];grouping=!1;folded=new Set;columns;constructor(){super(),this.shadow=this.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=J;const i=document.createElement("div");i.innerHTML=Z,this.shadow.append(e,i),F(),this.timeline=new p(this.byId("case-events"),n=>void this.only(n),n=>void this.only(n),n=>void this.toggle(n),n=>{this.folded.delete(n)||this.folded.add(n),this.draw()}),this.grouping=p.groupingRemembered(),this.columns=new y(this.byId("column-resize"),this.shadow.querySelector(".case-layout"),()=>this.shadow.querySelector(".case-timeline"),y.CASE_HISTORY_KEY),this.byId("group-readings").addEventListener("click",()=>{this.grouping=!this.grouping,p.rememberGrouping(this.grouping),this.order(),this.draw()}),M.register(),_.register(),this.byId("export").source=async()=>{const n=this.json,o=new Map;return await Promise.all(this.entries.filter(a=>a.kind!=="interview"&&a.url).map(async a=>{try{o.set(a.url,await E.recording(a.url))}catch{}})),{caseJson:n,caseUrl:this.url,recordings:o}},this.openEvents=this.byId("open-events"),this.openEvents.addEventListener(L,n=>{const{at:o,sighting:a}=n.detail;this.seekObservation(o,a)}),this.openEvents.addEventListener($,n=>{const o=n.target?.closest?.(".open-event");this.followReplay(o??void 0)}),U.register();const t=this.byId("share");t.innerHTML=j.SHARE;const s=this.byId("share-dialog");s.subject=this.shareSubject,t.addEventListener("click",()=>{this.url&&(s.note=S.changed(this.url,...this.entries.map(n=>n.url))?this.shareMessages?.unsaved:void 0,s.open())}),this.byId("edit").addEventListener("click",()=>{if(this.url&&H.ask(this,V,{src:this.url}))return;const n=this.editorUrl();n&&window.open(n,"_blank","noopener")}),this.byId("info").addEventListener("click",()=>this.showSummary(this.byId("case-summary").hidden)),this.byId("timeline-button").addEventListener("click",()=>{this.showTimeline(this.byId("case-events").parentElement.hidden)})}shareSubject={module:"rr0-sighting",link:()=>{const e=this.openKeys();return`${P.home()}/play/?file=${encodeURIComponent(this.url??"")}${e?`&events=${encodeURIComponent(e)}`:""}`+(this.timelineShown()?"":"&timeline=0")},element:()=>{const e=this.openKeys();return`<${g} src="${this.url??""}"${e?` ${w}="${e}"`:""}${this.timelineShown()?"":` ${v}="false"`}></${g}>`}};timelineShown(){return!this.byId("case-events").parentElement.hidden}openKeys(){const e=[...this.shown.keys()].sort((i,t)=>i-t);return e.length===1&&e[0]===this.firstObservation()?"":e.map(i=>u.keyOf(this.entries[i])).join(",")}static keyOf(e){return e.event.id??u.fileNameOf(e)}static fileNameOf(e){return(e.url??"").split("/").pop().replace(/[.]json$/i,"")}asked(e){if(e===null)return[];if(e.trim()==="all")return this.entries.map((t,s)=>s);const i=e.split(",").map(t=>t.trim().replace(/[.]json$/i,"")).filter(t=>t!=="");return this.entries.map((t,s)=>({entry:t,at:s})).filter(({entry:t})=>i.some(s=>s===t.event.id||s===u.fileNameOf(t))).map(({at:t})=>t)}firstObservation(){return this.entries.findIndex(e=>e.kind!=="interview")}byId(e){return this.shadow.getElementById(e)}showSummary(e){this.byId("case-summary").hidden=!e,this.byId("info").setAttribute("aria-expanded",String(e))}showTimeline(e){this.byId("case-events").parentElement.hidden=!e,this.byId("timeline-button").setAttribute("aria-pressed",String(e));for(const i of this.players())i.toggleAttribute(C,e)}connectedCallback(){this.loadMessages(),this.showTimeline(this.getAttribute(v)!=="false"),this.showSummary(this.hasAttribute(A));const e=this.getAttribute("src");e&&this.load(e).catch(i=>console.warn(`<${g}> could not read ${e}:`,i))}attributeChangedCallback(e,i,t){if(!(!this.isConnected||t===i))if(e==="src"&&t)this.load(t);else if(e===v)this.showTimeline(t!=="false");else if(e===w)for(const s of this.asked(t))this.open(s);else for(const s of this.players())t===null?s.removeAttribute(e):s.setAttribute(e,t)}async loadMessages(){const e=q(B.preferencesFor(this),z);this.said=new I([e,"en"]),this.messages=await G(e),this.shareMessages=await this.byId("share-dialog").useLanguage(e),this.draw()}async load(e){this.url=new URL(e,location.href).href;const i=await E.recording(this.url);if(!k.isCase(i))throw new Error(`${e} is not a case: <${g}> reads a case.json`);this.json=i,this.byId("share").hidden=S.local(this.url),this.entries=u.inTime((i.events??[]).map(r=>this.entryOf(r)).filter(r=>r!==void 0)),this.shown.clear(),this.folded.clear(),this.openEvents.replaceChildren(),this.draw(),this.compareReadings();const t=this.asked(this.getAttribute(w));if(t.length>0){for(const r of t)await this.open(r);return}const s=this.firstObservation();s>=0&&this.open(s)}static inTime(e){const i=new Map(e.filter(t=>t.event.id!==void 0).map(t=>[t.event.id,t]));return p.inTime(e,{when:t=>t.when,kind:t=>t.kind,read:t=>[t.event.interpretationOf].flat().map(s=>s===void 0?void 0:i.get(s)).filter(s=>s!==void 0)}).map(({item:t})=>t)}entryOf(e){if(typeof e.url!="string"||e.url==="")return;const i=e.eventType===k.INTERVIEW_EVENT?"interview":e.eventType===k.SIGHTING_EVENT?e.interpretationOf===void 0?"observation":"reading":void 0;if(i)return{event:e,kind:i,url:new URL(e.url,this.url??location.href).href,title:this.said.read(e.title)??e.id??"",when:String(e.time??"")}}compareReadings(){const e=this.byId("readings-comparison"),i=new Map,t=r=>{let n=i.get(r);return n||(n=E.recording(r).then(o=>o,()=>{}),i.set(r,n)),n},s=async r=>Promise.all(this.entries.flatMap((n,o)=>{if(n.kind!=="reading")return[];const a=this.accountOf(n);return[(async()=>({title:n.title,witness:a?.title??"",...r&&a?.url&&n.url?{account:await t(a.url),reading:await t(n.url)}:{},open:()=>void this.only(o).then(()=>this.shown.get(o)?.scrollIntoView({block:"start",behavior:"smooth"}))}))()]}));s(!1).then(r=>e.show(r,()=>s(!0)))}accountOf(e){return this.accountsOf(e)[0]}accountsOf(e){const i=[e.event.interpretationOf].flat().filter(t=>t!==void 0);return this.entries.filter(t=>t.kind==="observation"&&i.includes(t.event.id??""))}editorUrl(){if(!this.url)return;const e=new URL("/edit/",location.href);return e.searchParams.set("file",this.url),e.href}async only(e){const i=this.turn(e);for(const t of[...this.shown.keys()])t!==e&&this.shut(t);i||await this.open(e)}turn(e){const i=this.entries[e];if(!i?.url||this.shown.has(e)||i.kind!=="observation"&&i.kind!=="reading")return!1;const[t,s]=[...this.shown.entries()].find(([n,o])=>{const a=this.entries[n]?.kind;return(a==="observation"||a==="reading")&&o.querySelector(c)})??[],r=s?.querySelector(c);return t===void 0||!s||!r?!1:(this.shown.delete(t),this.shown.set(e,s),s.dataset.at=String(e),i.kind==="reading"?(r.setAttribute(b,i.url),r.setAttribute(m,this.accountOf(i)?.url??i.url)):(r.setAttribute(m,i.url),r.removeAttribute(b)),this.order(),this.draw(),window.setTimeout(()=>this.markCitedMoments(),300),this.announceOpen(),!0)}async toggle(e){this.shown.has(e)?this.shut(e):await this.open(e)}async open(e){const i=this.entries[e];if(!i||!i.url||this.shown.has(e))return;const t=document.createElement("section");if(t.className="open-event",t.dataset.at=String(e),i.kind==="interview"){const s=document.createElement("p");s.className="open-title",s.textContent=i.title,t.append(s)}if(i.kind==="interview"){const{register:s}=await D(async()=>{const{register:n}=await import("./InterviewElement-B3tm7y49.js");return{register:n}},__vite__mapDeps([0,1,2]),import.meta.url);s();const r=document.createElement("rr0-interview");r.setAttribute("src",i.url),t.append(r),window.setTimeout(()=>{this.followReplay(),this.markCitedMoments()},300)}else{const s=document.createElement(c);s.setAttribute(W,""),s.toggleAttribute(C,!this.byId("case-events").parentElement.hidden),s.setAttribute("src",this.url??"");const r=i.kind==="reading"?this.accountOf(i):void 0;s.setAttribute(m,(r??i).url??""),i.kind==="reading"&&s.setAttribute(b,i.url),queueMicrotask(()=>{for(const n of u.PASSED_ON){const o=this.getAttribute(n);o!==null&&s.setAttribute(n,o)}}),s.addEventListener(O,n=>{this.dispatchEvent(new CustomEvent(O,{detail:n.detail})),this.follow(t,s)}),s.addEventListener(Y,()=>this.follow(t,s)),t.append(s)}this.shown.set(e,t),this.order(),this.draw(),i.kind!=="interview"&&window.setTimeout(()=>this.markCitedMoments(),300),this.announceOpen()}follow(e,i){const t=Number(e.dataset.at),s=i.shownReadingUrl,r=i.shownRecordingUrl,n=(h,f)=>h!==void 0&&f!==void 0&&new URL(h,this.url??location.href).href===new URL(f,this.url??location.href).href,o=s?this.entries.findIndex(h=>h.kind==="reading"&&n(h.url,s)):this.entries.findIndex(h=>h.kind==="observation"&&n(h.url,r));if(o<0||o===t||this.shown.get(t)!==e||this.shown.has(o))return;this.shown.delete(t),this.shown.set(o,e),e.dataset.at=String(o);const a=this.entries[o];a.kind==="reading"?i.setAttribute(b,a.url):(i.removeAttribute(b),a.url&&i.setAttribute(m,a.url)),this.order(),this.draw(),this.announceOpen()}announceOpen(){this.dispatchEvent(new CustomEvent(Q,{detail:{events:this.openKeys()}}))}followReplay(e){const i=e??[...this.shown.values()].find(n=>n.querySelector(c)),t=i?Number(i.dataset.at):NaN,s=Number.isNaN(t)?void 0:this.entries[t],r=i?.querySelector(c);if(!(!s||!r)){for(const[n,o]of this.shown){if(this.entries[n]?.kind!=="interview")continue;o.querySelector("rr0-interview")?.revealAt?.(r.playedSeconds,s.event.id)}return i}}markCitedMoments(){for(const[e,i]of this.shown){const t=this.entries[e],s=i.querySelector(c);if(!t||!s)continue;const r=[];for(const[n,o]of this.shown){if(this.entries[n]?.kind!=="interview")continue;const a=o.querySelector("rr0-interview");r.push(...a?.momentsCited?.(t.event.id)??[])}s.citedMoments=r.sort((n,o)=>n.at-o.at)}}shut(e){this.shown.get(e)?.remove(),this.shown.delete(e),this.markCitedMoments(),this.draw(),this.announceOpen()}order(){const e=new Map(this.listed().map(({index:t},s)=>[t,s])),i=[...this.shown.entries()].sort(([t],[s])=>(e.get(t)??t)-(e.get(s)??s)).map(([,t])=>t);i.length===this.openEvents.children.length&&i.every((t,s)=>this.openEvents.children[s]===t)||this.openEvents.replaceChildren(...i)}listed(){const e=this.entries.map((i,t)=>({item:i,index:t}));return this.grouping?p.grouped(e,{kind:i=>i.kind,read:i=>this.accountsOf(i)}):e}async seekObservation(e,i){const t=this.entries.findIndex(n=>n.kind!=="interview"&&(n.event.id===i||i!==void 0&&n.url?.endsWith(`/${i}.json`))),s=t>=0?t:this.entries.findIndex(n=>n.kind!=="interview");if(s<0)return;this.shown.has(s)||await this.open(s),this.shown.get(s)?.querySelector(c)?.seekTo(e,i),this.shown.get(s)?.scrollIntoView({block:"nearest",behavior:"smooth"})}authors(e){const i=this.messages,t=(e??[]).map(s=>"people"in s?s.people:"org"in s?s.org:this.said.read(s.title)??"").filter(s=>s!=="");return t.length<2||!i?t.join(", "):`${t.slice(0,-1).join(", ")} ${i.linkAnd} ${t[t.length-1]}`}linkedTo(e){const i=this.messages;if(i){if(e.kind==="reading"){const t=[e.event.interpretationOf].flat().filter(r=>r!==void 0),s=this.entries.map((r,n)=>t.includes(r.event.id??"")?n:-1).filter(r=>r>=0);return s.length>0?{heading:i.interpretationOf,to:s}:void 0}if(e.kind==="observation"){const t=this.entries.map((s,r)=>s.kind==="interview"&&[s.event.interviewOf].flat().includes(e.event.id)?r:-1).filter(s=>s>=0);return t.length>0?{heading:i.passagesHeading,to:t}:void 0}}}draw(){const e=this.messages,i=this.json;if(!e||!i)return;this.byId("case-kind").textContent=e.caseHeading,this.byId("case-title").textContent=this.said.read(i.title)??i.id??"";const t=this.said.read(i.summary)??"",s=this.byId("case-summary");s.textContent=t;const r=this.byId("info");r.hidden=t==="",r.title=e.caseSummary,r.setAttribute("aria-label",e.caseSummary),t===""&&this.showSummary(!1),this.byId("events-heading").textContent=e.eventsHeading,this.byId("events-icon").innerHTML=K.CLOCK;const n=this.byId("share");n.title=e.shareCase,n.setAttribute("aria-label",e.shareCase);const o=this.byId("edit");o.title=e.editCase,o.setAttribute("aria-label",e.editCase);const a=this.byId("group-readings");a.title=e.groupReadings,a.setAttribute("aria-label",e.groupReadings),this.columns.label(e.resizeColumns),a.setAttribute("aria-pressed",String(this.grouping)),a.hidden=!this.entries.some(d=>d.kind==="reading");const h=this.listed(),f=d=>h.filter(({under:l})=>l===d).length,N=new Map(this.entries.map((d,l)=>[d,l]));this.timeline.render(h.filter(({index:d,under:l})=>l===void 0||!this.folded.has(N.get(l))||this.shown.has(d)).map(({item:d,index:l,under:R})=>{const x=this.card(d,l,R),T=this.grouping&&d.kind==="observation"?f(d):0;return T>0?{...x,readings:{count:T,folded:this.folded.has(l)}}:x}),e)}card(e,i,t){const s=this.linkedTo(e),r=(s?.to??[]).filter(o=>this.entries[o]!==t),n=t?this.messages.alsoAbout:s?.heading??"";return{at:i,kind:e.kind,title:e.title,meta:e.when.replace("T"," "),open:this.shown.has(i),...r.length>0?{links:{heading:n,to:r.map(o=>({at:o,title:this.entries[o].title}))}}:{},by:e.kind==="observation"?"":this.authors(e.event.by),...t?{nested:!0}:{}}}async loadFromSrc(e){await this.load(e),await this.player?.loaded}get scene(){return this.players()[0]?.scene}players(){return[...this.shown.entries()].sort(([e],[i])=>e-i).map(([,e])=>e.querySelector(c)).filter(e=>e!==null)}get sightingData(){return this.players()[0]?.sightingData}get player(){return this.players()[0]}}function te(){customElements.get(g)||customElements.define(g,u)}export{g as CASE_ELEMENT_NAME,u as CaseElement,Q as OPEN_CHANGE_EVENT,w as OPEN_EVENTS_ATTRIBUTE,v as SHOW_TIMELINE_ATTRIBUTE,te as register};
@@ -0,0 +1 @@
1
+ const e={caseHeading:"Case",eventsHeading:"History",kindObservation:"Observation",kindReading:"Reading",kindInterview:"Interview",openEvent:"Open this event alone",toggleEvent:"Show beside the others, or put away",groupReadings:"Group the readings under their observation",resizeColumns:"Resize the history column (double-click: back to its width)",alsoAbout:"Also about",foldReadings:"Fold its readings away",unfoldReadings:"Unfold its readings",interpretationOf:"Reading of",passagesHeading:"Told in",byAuthor:"by",linkAnd:"and",caseSummary:"What this case says of itself",editCase:"Edit this case",shareCase:"Share this case"};export{e as caseMessages_en};
@@ -0,0 +1 @@
1
+ const e={caseHeading:"Caso",eventsHeading:"Historial",kindObservation:"Observación",kindReading:"Lectura",kindInterview:"Entrevista",openEvent:"Abrir solo este evento",toggleEvent:"Mostrar junto a los demás, o quitar",groupReadings:"Agrupar las lecturas por observación",resizeColumns:"Cambiar el ancho de la columna del historial (doble clic: ancho por defecto)",alsoAbout:"También trata de",foldReadings:"Plegar sus lecturas",unfoldReadings:"Desplegar sus lecturas",interpretationOf:"Lectura de",passagesHeading:"Relatado en",byAuthor:"por",linkAnd:"y",caseSummary:"Lo que este caso dice de sí mismo",editCase:"Editar este caso",shareCase:"Compartir este caso"};export{e as caseMessages_es};
@@ -0,0 +1 @@
1
+ const e={caseHeading:"Dossier",eventsHeading:"Historique",kindObservation:"Observation",kindReading:"Lecture",kindInterview:"Interview",openEvent:"Ouvrir cet événement seul",toggleEvent:"Afficher à côté des autres, ou retirer",groupReadings:"Regrouper les lectures par observation",resizeColumns:"Redimensionner la colonne de l'historique (double-clic : largeur par défaut)",alsoAbout:"Porte aussi sur",foldReadings:"Replier ses lectures",unfoldReadings:"Déplier ses lectures",interpretationOf:"Lecture de",passagesHeading:"Relaté dans",byAuthor:"par",linkAnd:"et",caseSummary:"Ce que ce dossier dit de lui-même",editCase:"Modifier ce dossier",shareCase:"Partager ce dossier"};export{e as caseMessages_fr};
@@ -0,0 +1 @@
1
+ const e={caseHeading:"Caso",eventsHeading:"Cronologia",kindObservation:"Osservazione",kindReading:"Lettura",kindInterview:"Intervista",openEvent:"Apri solo questo evento",toggleEvent:"Mostra accanto agli altri, o togli",groupReadings:"Raggruppa le letture per osservazione",resizeColumns:"Ridimensiona la colonna della cronologia (doppio clic: larghezza predefinita)",alsoAbout:"Riguarda anche",foldReadings:"Chiudi le sue letture",unfoldReadings:"Apri le sue letture",interpretationOf:"Lettura di",passagesHeading:"Raccontato in",byAuthor:"di",linkAnd:"e",caseSummary:"Ciò che questo caso dice di sé",editCase:"Modificare questo caso",shareCase:"Condividi questo caso"};export{e as caseMessages_it};