@rr0/ufoathome 0.201.0 → 0.202.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-embed-interview/InterviewMessages_en-BrnxG2rl.js +3 -0
- package/dist-embed-interview/InterviewMessages_es-Dxfjqrte.js +3 -0
- package/dist-embed-interview/InterviewMessages_fr-DIA-1qu8.js +3 -0
- package/dist-embed-interview/InterviewMessages_it-CYBEIKX-.js +3 -0
- package/dist-embed-interview/rr0-interview.mjs +10 -6
- package/dist-embed-scene/{AirshipEditor-BnRmKeVs.js → AirshipEditor-guE_ib3z.js} +1 -1
- package/dist-embed-scene/{AirshipFlight-C9DSPGwk.js → AirshipFlight-DzW0313e.js} +1 -1
- package/{dist-embed-sighting/AuroraSimulation-C9hvCV0W.js → dist-embed-scene/AuroraSimulation-Dh4kZW1x.js} +7 -2
- package/dist-embed-scene/{BalloonEditor-BehJs6H-.js → BalloonEditor-BIsCy_y4.js} +2 -2
- package/dist-embed-scene/{BalloonFlight-BYn4diw1.js → BalloonFlight-gunghgAq.js} +1 -1
- package/dist-embed-scene/{BirdEditor-dOp1sGsz.js → BirdEditor-CuLv4Ij5.js} +1 -1
- package/dist-embed-scene/{BirdFlock-CfJeXvWu.js → BirdFlock-L3dYU2K_.js} +1 -1
- package/dist-embed-scene/{DroneEditor-CBoR4fJ_.js → DroneEditor-BQWPhTyf.js} +1 -1
- package/dist-embed-scene/{DroneFlight-DSE1OXqh.js → DroneFlight-ERYah68l.js} +1 -1
- package/dist-embed-scene/{DroneParameters-D3EOg4oe.js → DroneParameters-CoWQympS.js} +1 -1
- package/dist-embed-scene/{LanternEditor-CbcA7K8y.js → LanternEditor-BpCyb79i.js} +1 -1
- package/dist-embed-scene/{ModuleSession-XnOI5Mcr.js → ModuleSession-bj7QHWjO.js} +2 -2
- package/dist-embed-scene/ModuleThree-DRsA8rtL.js +1 -0
- package/dist-embed-scene/SearchlightSystem-Ddws2hQY.js +1 -0
- package/dist-embed-scene/{SkyLantern-Dp_B40X0.js → SkyLantern-C3BSxHtq.js} +1 -1
- package/dist-embed-scene/rr0-scene.mjs +106 -81
- package/{dist-embed-scene/AuroraSimulation-BZpjImM0.js → dist-embed-sighting/AuroraSimulation-C7LAHgWM.js} +7 -2
- package/dist-embed-sighting/{CaseReportExport-DVVsc8gA.js → CaseReportExport-BtGCWD7H.js} +1 -1
- package/dist-embed-sighting/{InterviewElement-BduwyUn5.js → InterviewElement-B_ULRy5z.js} +9 -5
- package/dist-embed-sighting/InterviewMessages_en-BrnxG2rl.js +3 -0
- package/dist-embed-sighting/InterviewMessages_es-Dxfjqrte.js +3 -0
- package/dist-embed-sighting/InterviewMessages_fr-DIA-1qu8.js +3 -0
- package/dist-embed-sighting/InterviewMessages_it-CYBEIKX-.js +3 -0
- package/dist-embed-sighting/{ModuleSession-ChJsGuTn.js → ModuleSession-DztK084a.js} +2 -2
- package/dist-embed-sighting/{ModuleThree-whEZoXYF.js → ModuleThree-BLNSm2eY.js} +1 -1
- package/dist-embed-sighting/SearchlightSystem-PEMBDW1s.js +1 -0
- package/dist-embed-sighting/rr0-sighting.mjs +112 -87
- package/dist-embed-sighting-editor/{AdsbLolArchiveProvider-CWpyBqG3.js → AdsbLolArchiveProvider-Bz1OjSjY.js} +1 -1
- package/dist-embed-sighting-editor/{AirshipEditor-BvnVNcF4.js → AirshipEditor-BlJXyxlr.js} +1 -1
- package/dist-embed-sighting-editor/{AirshipFlight-CB1Quf68.js → AirshipFlight-Cx40Y8JT.js} +1 -1
- package/dist-embed-sighting-editor/{Aurora-BRXvgyRM.js → Aurora-Ldk66p1A.js} +1 -1
- package/dist-embed-sighting-editor/{AuroraEditor-JQ3kRqrq.js → AuroraEditor-CGSomAFk.js} +1 -1
- package/dist-embed-sighting-editor/{AuroraSimulation-i64MFW2z.js → AuroraSimulation-vKcv2Hue.js} +7 -2
- package/dist-embed-sighting-editor/{BallesterGuaspAssessor-BaKKAdY3.js → BallesterGuaspAssessor-CJyRqwvh.js} +1 -1
- package/dist-embed-sighting-editor/{BalloonEditor-C2oHClW7.js → BalloonEditor-CgO4LaWn.js} +1 -1
- package/dist-embed-sighting-editor/{BalloonFlight-B9A6MoCj.js → BalloonFlight-hLr_4TFU.js} +1 -1
- package/dist-embed-sighting-editor/{BeamEditor-CW7mTQjS.js → BeamEditor-B8qreA3j.js} +1 -1
- package/dist-embed-sighting-editor/{BeamSystem-CSfJjLCb.js → BeamSystem-D0hrju5J.js} +1 -1
- package/dist-embed-sighting-editor/{BirdEditor-BdxhCoW9.js → BirdEditor-BNzrfSqX.js} +1 -1
- package/dist-embed-sighting-editor/{BirdFlock-DCbrukNp.js → BirdFlock-iSovVEZd.js} +1 -1
- package/dist-embed-sighting-editor/{BodyEditor-DE8ZQrqe.js → BodyEditor-Bd_pKafG.js} +2 -2
- package/dist-embed-sighting-editor/{CaseElement-C46wM-nU.js → CaseElement-D80gHg4r.js} +3 -3
- package/dist-embed-sighting-editor/{CaseReportExport-UVrInf6H.js → CaseReportExport-Bv6FWPs2.js} +2 -2
- package/dist-embed-sighting-editor/{ContrailSystem-CDSSxouG.js → ContrailSystem-D3tXAg2r.js} +1 -1
- package/dist-embed-sighting-editor/{ControlPasses-CsOVa-jq.js → ControlPasses-CaVHMhEY.js} +1 -1
- package/dist-embed-sighting-editor/{CoverageAssessor-DWY_gJJX.js → CoverageAssessor-CTfHqAd_.js} +1 -1
- package/dist-embed-sighting-editor/{DroneEditor-DgeuaHdb.js → DroneEditor-BFsArPKi.js} +1 -1
- package/dist-embed-sighting-editor/{DroneFlight-CFztr-9j.js → DroneFlight-B96pVrY1.js} +1 -1
- package/dist-embed-sighting-editor/{DroneParameters-CHmDmRoC.js → DroneParameters-DW-enQUo.js} +1 -1
- package/dist-embed-sighting-editor/{Flightradar24Provider-e6_3o9Jf.js → Flightradar24Provider-CBGkjw03.js} +1 -1
- package/dist-embed-sighting-editor/GLTFLoader-CrRPu-Pt.js +1 -0
- package/dist-embed-sighting-editor/{GenerativeKitMessages-CmqG-T2c.js → GenerativeKitMessages-DmeZ_YZO.js} +1 -1
- package/dist-embed-sighting-editor/{GeoExportTexts-Wjc5YKlM.js → GeoExportTexts-Cp95Dg-h.js} +1 -1
- package/dist-embed-sighting-editor/{GeoJsonExport-BSPGzTbG.js → GeoJsonExport-CdadOwd2.js} +1 -1
- package/dist-embed-sighting-editor/{GeographicFigures-D_TfLkj9.js → GeographicFigures-Bo9rsT_L.js} +1 -1
- package/dist-embed-sighting-editor/{HeadlightSystem-DljWmzj5.js → HeadlightSystem-BmPfcHt1.js} +1 -1
- package/dist-embed-sighting-editor/{HynekAssessor-BCDwoOI9.js → HynekAssessor-nBidt6QV.js} +1 -1
- package/dist-embed-sighting-editor/InterviewEditorElement-CQWfYlGL.js +294 -0
- package/dist-embed-sighting-editor/{InterviewElement-DDa53uMq.js → InterviewElement-Ala811KB.js} +6 -2
- package/dist-embed-sighting-editor/InterviewMessages_en-BrnxG2rl.js +3 -0
- package/dist-embed-sighting-editor/InterviewMessages_es-Dxfjqrte.js +3 -0
- package/dist-embed-sighting-editor/InterviewMessages_fr-DIA-1qu8.js +3 -0
- package/dist-embed-sighting-editor/InterviewMessages_it-CYBEIKX-.js +3 -0
- package/dist-embed-sighting-editor/{KmlExport-B46AfaoJ.js → KmlExport-DIxM5Hpx.js} +1 -1
- package/dist-embed-sighting-editor/{LanternEditor-CkbeitJh.js → LanternEditor-CjQVFowY.js} +1 -1
- package/dist-embed-sighting-editor/{LaserBeam-Ber-PT8j.js → LaserBeam-BVc8Mvhr.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchEditor-BsvHahqK.js → LaunchEditor-Cz8Mzo4a.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchPlume-BmPMeGMN.js → LaunchPlume-CvBhTPgN.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchSimulation-g-ETWhEH.js → LaunchSimulation-CkZIG-3P.js} +1 -1
- package/dist-embed-sighting-editor/{ModelSource-DOUnBBhu.js → ModelSource-B153oeTu.js} +1 -1
- package/dist-embed-sighting-editor/{ModelThumbnails-TwG1snwZ.js → ModelThumbnails-BUL_OLFv.js} +1 -1
- package/dist-embed-sighting-editor/{ModelViewer-Y_B6eM4z.js → ModelViewer-BzBLcY9s.js} +1 -1
- package/dist-embed-sighting-editor/{ModuleConformance-CO1S9pa3.js → ModuleConformance-CpMYkYgb.js} +2 -2
- package/dist-embed-sighting-editor/{ModuleSession-VLS0tjAb.js → ModuleSession-b_pmjUfP.js} +3 -3
- package/dist-embed-sighting-editor/ModuleThree-B_FZVqsf.js +1 -0
- package/dist-embed-sighting-editor/{ModulesPanelElement--YQ0QtcW.js → ModulesPanelElement-D0gn9Z-y.js} +3 -3
- package/dist-embed-sighting-editor/{NearestApproach-C_8Uvp6i.js → NearestApproach-Bxo_N7a9.js} +1 -1
- package/dist-embed-sighting-editor/PictureRegistration-D8fDZm4v.js +1 -0
- package/dist-embed-sighting-editor/{PoherAssessor-DtDcuhWK.js → PoherAssessor-CEVA26zd.js} +1 -1
- package/dist-embed-sighting-editor/{QuestionnaireFeed-CvLtuLIH.js → QuestionnaireFeed-B0j8W4JM.js} +1 -1
- package/dist-embed-sighting-editor/QuestionnaireForm-lzn9MPr2.js +1 -0
- package/dist-embed-sighting-editor/{QuestionnaireImport-BYj5QoJS.js → QuestionnaireImport-BmcxlQBq.js} +1 -1
- package/dist-embed-sighting-editor/RailwaySystem-Ceb0_MVz.js +41 -0
- package/dist-embed-sighting-editor/{ReentryEditor-CW8H7KaA.js → ReentryEditor-BWCK2g_s.js} +1 -1
- package/dist-embed-sighting-editor/{ReentrySimulation-DVl__RjO.js → ReentrySimulation-B09JXMu5.js} +1 -1
- package/dist-embed-sighting-editor/ReferenceSystem-B15kw0uH.js +1 -0
- package/dist-embed-sighting-editor/{RoadMarkings-DJraHdS6.js → RoadMarkings-Dl6zVQIx.js} +1 -1
- package/dist-embed-sighting-editor/ScenarioReadings-DyMshXS4.js +1 -0
- package/dist-embed-sighting-editor/{ScenarioSweep-Ddtuo_Af.js → ScenarioSweep-ByqOTfs2.js} +1 -1
- package/dist-embed-sighting-editor/{SceneNames_en-p5YNYZhA.js → SceneNames_en-c5zNw0Hi.js} +1 -1
- package/dist-embed-sighting-editor/{SceneNames_es-DlMqYLL9.js → SceneNames_es-CDjoBwy_.js} +1 -1
- package/dist-embed-sighting-editor/{SceneNames_fr-lFA7hY3x.js → SceneNames_fr-CoZNmFu3.js} +1 -1
- package/dist-embed-sighting-editor/{SceneNames_it-CDwvX1Nw.js → SceneNames_it-CVEahBpq.js} +1 -1
- package/dist-embed-sighting-editor/{SearchlightEditor-BSI8hB1V.js → SearchlightEditor-BpwPOhJ6.js} +1 -1
- package/dist-embed-sighting-editor/SearchlightSystem-D7sdsRYn.js +1 -0
- package/dist-embed-sighting-editor/{SightingElement-T0x4j9Zt.js → SightingElement-Bp-t_EAF.js} +3 -3
- package/dist-embed-sighting-editor/{SkyLantern-Dl4yl-lc.js → SkyLantern-D6bru_e_.js} +1 -1
- package/dist-embed-sighting-editor/{TraceSystem-Dbu_bgfE.js → TraceSystem-Bv4kLpie.js} +2 -2
- package/dist-embed-sighting-editor/{UfoMessages_en-BAuHAGgq.js → UfoMessages_en-DdCKc-Ez.js} +1 -1
- package/dist-embed-sighting-editor/{VideoButton-C8eRmv7A.js → VideoButton-CzJg9lBG.js} +1 -1
- package/dist-embed-sighting-editor/{WaterSystem-DpJCe_2Q.js → WaterSystem-Bbk_RJKg.js} +2 -2
- package/dist-embed-sighting-editor/geipan-qt-2025-B_RUiH8B.js +7 -0
- package/dist-embed-sighting-editor/{interviewImport-zzDGCbXd.js → interviewImport-D4P6e28u.js} +1 -1
- package/dist-embed-sighting-editor/{interviewJson-DngUPqK8.js → interviewJson-BJF9C-Rb.js} +1 -1
- package/dist-embed-sighting-editor/interviewSchema-r5bW7skq.js +1 -0
- package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +424 -397
- package/dist-embed-sighting-editor/{surroundingsSources-lvh4Rw5C.js → surroundingsSources-CqL7lcmF.js} +1 -1
- package/dist-embed-sighting-editor/{trafficRuntime-Drx7CE9H.js → trafficRuntime-Bu3my6S4.js} +2 -2
- package/dist-embed-ufoathome/{AdsbLolArchiveProvider-CqedGYi5.js → AdsbLolArchiveProvider-v1sSwhN1.js} +1 -1
- package/dist-embed-ufoathome/{Aurora-CpZx9hQ3.js → Aurora-Dc4u2vEw.js} +1 -1
- package/dist-embed-ufoathome/{AuroraEditor-D2v8sWVE.js → AuroraEditor-CeLzRDPj.js} +1 -1
- package/dist-embed-ufoathome/{AuroraSimulation-DdSP66LD.js → AuroraSimulation-BT1CdWX5.js} +7 -2
- package/dist-embed-ufoathome/{BallesterGuaspAssessor-C4IktJ1l.js → BallesterGuaspAssessor-CPW-Omah.js} +1 -1
- package/dist-embed-ufoathome/{BeamEditor-CuW3LVO-.js → BeamEditor-BS73mBZU.js} +1 -1
- package/dist-embed-ufoathome/{BeamSystem-BPEYuCF4.js → BeamSystem-C5EpRhij.js} +1 -1
- package/dist-embed-ufoathome/{BodyEditor-COMX-T65.js → BodyEditor-BV8WwzAj.js} +1 -1
- package/dist-embed-ufoathome/{CaseEditorElement-C5BHP8jT.js → CaseEditorElement-HR8RFluQ.js} +64 -62
- package/dist-embed-ufoathome/{CaseElement-CIZvyRVi.js → CaseElement-vCbCfGOv.js} +3 -3
- package/dist-embed-ufoathome/{CaseReportExport-BFbswUIB.js → CaseReportExport-XLbFCkPg.js} +3 -3
- package/dist-embed-ufoathome/{ColumnResize-Dh6Xyspd.js → ColumnResize-CEXrq3KB.js} +6 -6
- package/dist-embed-ufoathome/{ControlPasses-CnL1GmT-.js → ControlPasses-CKOU_3lG.js} +1 -1
- package/dist-embed-ufoathome/{CoverageAssessor-CiqUEJkN.js → CoverageAssessor-BYMf3Qhv.js} +1 -1
- package/dist-embed-ufoathome/{Flightradar24Provider-_tNmWf11.js → Flightradar24Provider-_QPbhh5s.js} +1 -1
- package/dist-embed-ufoathome/{GLTFLoader-BLk8prLt.js → GLTFLoader-DQeHB-Bk.js} +1 -1
- package/dist-embed-ufoathome/{GeoJsonExport-DkPKk-7q.js → GeoJsonExport-Pq_pPvjK.js} +1 -1
- package/dist-embed-ufoathome/{GeographicFigures-l-PfHdSR.js → GeographicFigures-KII55iXE.js} +1 -1
- package/dist-embed-ufoathome/{HynekAssessor-BhnvqsYz.js → HynekAssessor-wCDhgIB8.js} +1 -1
- package/dist-embed-ufoathome/InterviewAttachments-BP6Prvdu.js +1 -0
- package/dist-embed-ufoathome/InterviewEditorElement-BSwkegEp.js +294 -0
- package/dist-embed-ufoathome/{InterviewElement-CuRmQ0d3.js → InterviewElement-CfkDtybc.js} +6 -2
- package/dist-embed-ufoathome/InterviewMessages_en-BrnxG2rl.js +3 -0
- package/dist-embed-ufoathome/InterviewMessages_es-Dxfjqrte.js +3 -0
- package/dist-embed-ufoathome/InterviewMessages_fr-DIA-1qu8.js +3 -0
- package/dist-embed-ufoathome/InterviewMessages_it-CYBEIKX-.js +3 -0
- package/dist-embed-ufoathome/{KmlExport-BUl3gOrw.js → KmlExport-BMNwwys8.js} +1 -1
- package/dist-embed-ufoathome/{LaserBeam-C7glTvQN.js → LaserBeam-B-tlAzNB.js} +1 -1
- package/dist-embed-ufoathome/{LaunchEditor-DvudtAzp.js → LaunchEditor-Cy5D-gwU.js} +1 -1
- package/dist-embed-ufoathome/{LaunchPlume-CrDBzsQe.js → LaunchPlume-D-vSb8tJ.js} +1 -1
- package/dist-embed-ufoathome/{LaunchSimulation-DyOA4lPb.js → LaunchSimulation-CZ8Oba00.js} +1 -1
- package/dist-embed-ufoathome/{ModelSource-CoT4mxTx.js → ModelSource-HSiigkeO.js} +1 -1
- package/dist-embed-ufoathome/{ModelThumbnails-t59SZ3Vn.js → ModelThumbnails-DWvRMmj_.js} +1 -1
- package/dist-embed-ufoathome/{ModelViewer-DEdruEtl.js → ModelViewer-CM7qTW8F.js} +1 -1
- package/dist-embed-ufoathome/{ModulesPanelElement-N-ccpGxl.js → ModulesPanelElement-DsOa2zH0.js} +2 -2
- package/dist-embed-ufoathome/{NearestApproach-Do15yfeg.js → NearestApproach-PAsV5RlG.js} +1 -1
- package/dist-embed-ufoathome/{PoherAssessor-Cs8-ZBge.js → PoherAssessor-CniYlhUl.js} +1 -1
- package/dist-embed-ufoathome/QuestionnaireFeed-CpZqkxlt.js +1 -0
- package/dist-embed-ufoathome/QuestionnaireForm-LkllpNx-.js +1 -0
- package/dist-embed-ufoathome/{QuestionnaireImport-Cx1dQiha.js → QuestionnaireImport-CNROmkT2.js} +1 -1
- package/dist-embed-ufoathome/{ReentryEditor-CJUFkVFO.js → ReentryEditor-Qax1sT82.js} +1 -1
- package/dist-embed-ufoathome/{ReentrySimulation-B5QcdOTq.js → ReentrySimulation-CTeCaxZl.js} +1 -1
- package/dist-embed-ufoathome/{ReferenceSystem-DyzOUClN.js → ReferenceSystem-CM27OCUo.js} +1 -1
- package/dist-embed-ufoathome/ScenarioReadings-Is3HX0n0.js +1 -0
- package/dist-embed-ufoathome/ScenarioSweep-BbtX26Fi.js +1 -0
- package/dist-embed-ufoathome/{SearchlightEditor-CPDNpfNC.js → SearchlightEditor-PuLz84pp.js} +1 -1
- package/dist-embed-ufoathome/SearchlightSystem-B-tHvY1M.js +1 -0
- package/dist-embed-ufoathome/{ShareDialogElement-CBeU9ChH.js → ShareDialogElement-EzLob2Tz.js} +105 -80
- package/dist-embed-ufoathome/{SightingElement-BveOM4nF.js → SightingElement--qpGoyxL.js} +2 -2
- package/dist-embed-ufoathome/{TraceSystem-CoHX04R3.js → TraceSystem-8XQX03MS.js} +1 -1
- package/dist-embed-ufoathome/{VideoButton-DNQmWtfv.js → VideoButton-WNtEngz-.js} +1 -1
- package/dist-embed-ufoathome/geipan-qt-2025-B_RUiH8B.js +7 -0
- package/dist-embed-ufoathome/interviewSchema-r5bW7skq.js +1 -0
- package/dist-embed-ufoathome/rr0-ufoathome.mjs +4 -4
- package/dist-embed-ufoathome/{surroundingsSources-C823p3dG.js → surroundingsSources-UHKGesPa.js} +1 -1
- package/dist-embed-ufoathome/{trafficRuntime-DtXb9B2f.js → trafficRuntime-CgY_7-NH.js} +1 -1
- package/package.json +1 -1
- package/dist-embed-interview/InterviewMessages_en-BRmuWrAg.js +0 -1
- package/dist-embed-interview/InterviewMessages_es-BTotimwY.js +0 -1
- package/dist-embed-interview/InterviewMessages_fr-DBCdGB0r.js +0 -1
- package/dist-embed-interview/InterviewMessages_it-B5EyMD-k.js +0 -1
- package/dist-embed-scene/ModuleThree-BTQgimAj.js +0 -1
- package/dist-embed-scene/SearchlightSystem-CX1_nBkz.js +0 -1
- package/dist-embed-sighting/InterviewMessages_en-BRmuWrAg.js +0 -1
- package/dist-embed-sighting/InterviewMessages_es-BTotimwY.js +0 -1
- package/dist-embed-sighting/InterviewMessages_fr-DBCdGB0r.js +0 -1
- package/dist-embed-sighting/InterviewMessages_it-B5EyMD-k.js +0 -1
- package/dist-embed-sighting/SearchlightSystem-B2-MzG4x.js +0 -1
- package/dist-embed-sighting-editor/GLTFLoader-Df-r7_lf.js +0 -1
- package/dist-embed-sighting-editor/InterviewEditorElement-KHpgfy3k.js +0 -277
- package/dist-embed-sighting-editor/InterviewMessages_en-BRmuWrAg.js +0 -1
- package/dist-embed-sighting-editor/InterviewMessages_es-BTotimwY.js +0 -1
- package/dist-embed-sighting-editor/InterviewMessages_fr-DBCdGB0r.js +0 -1
- package/dist-embed-sighting-editor/InterviewMessages_it-B5EyMD-k.js +0 -1
- package/dist-embed-sighting-editor/ModuleThree-DQ2dT7XW.js +0 -1
- package/dist-embed-sighting-editor/PictureRegistration-Br0xjLE2.js +0 -1
- package/dist-embed-sighting-editor/QuestionnaireForm-DA6LPvBt.js +0 -1
- package/dist-embed-sighting-editor/RailwaySystem-eT-ZKfZl.js +0 -41
- package/dist-embed-sighting-editor/ReferenceSystem-DxVYO7g9.js +0 -1
- package/dist-embed-sighting-editor/ScenarioReadings-BYqlpLo8.js +0 -1
- package/dist-embed-sighting-editor/SearchlightSystem-DHfVi2np.js +0 -1
- package/dist-embed-sighting-editor/geipan-qt-2025-j-yGY7EN.js +0 -7
- package/dist-embed-sighting-editor/interviewSchema-DRWvRSL2.js +0 -1
- package/dist-embed-ufoathome/InterviewEditorElement-iw2lnwx8.js +0 -277
- package/dist-embed-ufoathome/InterviewMessages_en-BRmuWrAg.js +0 -1
- package/dist-embed-ufoathome/InterviewMessages_es-BTotimwY.js +0 -1
- package/dist-embed-ufoathome/InterviewMessages_fr-DBCdGB0r.js +0 -1
- package/dist-embed-ufoathome/InterviewMessages_it-B5EyMD-k.js +0 -1
- package/dist-embed-ufoathome/QuestionnaireFeed-BfvRSPoo.js +0 -1
- package/dist-embed-ufoathome/QuestionnaireForm-ByFmq67M.js +0 -1
- package/dist-embed-ufoathome/ScenarioReadings-CfZehU_P.js +0 -1
- package/dist-embed-ufoathome/ScenarioSweep-CDumnmq2.js +0 -1
- package/dist-embed-ufoathome/SearchlightSystem-Ca0rZcXv.js +0 -1
- package/dist-embed-ufoathome/geipan-qt-2025-j-yGY7EN.js +0 -7
- package/dist-embed-ufoathome/interviewSchema-DRWvRSL2.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,b as
|
|
1
|
+
import{a as h,b as J,D as N}from"./DroneFlight-ERYah68l.js";import{bI as H}from"./rr0-scene.mjs";class s{static SAMPLE_MS=500;static MAX_KEYFRAMES=2e4;static BANK_SHARE=.25;static MAX_PITCH_DEG=20;static TITLES={blimp:{en:"Blimp",fr:"Dirigeable souple",es:"Dirigible flexible",it:"Dirigibile floscio"},"zeppelin-nt":{en:"Zeppelin NT",fr:"Zeppelin NT",es:"Zeppelin NT",it:"Zeppelin NT"},lightship:{en:"Lightship",fr:"Dirigeable lumineux",es:"Dirigible luminoso",it:"Dirigibile luminoso"},aerostat:{en:"Tethered aerostat",fr:"Aérostat captif",es:"Aeróstato cautivo",it:"Aerostato frenato"},rigid:{en:"Rigid airship",fr:"Dirigeable rigide",es:"Dirigible rígido",it:"Dirigibile rigido"}};static computed=new Map;static bodiesOf(t){const o=JSON.stringify(t);let e=s.computed.get(o);return e||(e=s.compute(t),s.computed.set(o,e),s.computed.size>16&&s.computed.delete(s.computed.keys().next().value)),e}static typeOf(t){const o=t.airship,e=typeof o=="string"?o:o?.id,i=H.byId(e)??H.ALL[0];return typeof o=="string"?i:{...i,...o,id:i.id}}static lightsOf(t){const o={};for(const[e,i]of Object.entries(s.typeOf(t).lights)){const r=t.lights?.[e];if(r===!1)continue;const c={...i,...r??{}};c.off||(o[e]=c)}return o}static signOf(t){const o=s.typeOf(t).sign;if(!o)return;const e=t.sign;if(!(e===!1||e===void 0&&!o.lit))return{color:o.color,luminanceCdM2:o.luminanceCdM2,...typeof e=="object"?e:{}}}static compute(t){const o=h.pathOf(t);if(o.length===0)return[];const e=s.typeOf(t),i=h.randomFrom(t.seed??1),r=o[0].t,c=Math.max(o[o.length-1].t,r),L=Math.max(s.SAMPLE_MS,Math.ceil((c-r)/s.MAX_KEYFRAMES/100)*100),S=(t.wind?.fromDeg??0)*Math.PI/180,w=t.wind?.speedMS??0,j=-w*Math.sin(S),z=-w*Math.cos(S),K=new J(o,!1),M={period:40+40*i(),phase:2*Math.PI*i(),amplitudeDeg:4+4*i()},I=n=>{if(!e.tethered){const d=K.at(n);return{eastM:d.eastM,northM:d.northM,upM:d.upM}}const a=(n-r)/1e3,l=Math.sin(2*Math.PI*a/M.period+M.phase);return{eastM:o[0].eastM+3*l,northM:o[0].northM+3*Math.cos(2*Math.PI*a/M.period*.7),upM:o[0].upM+1.5*l}},u=s.lightsOf(t),O=Object.fromEntries(Object.entries(u).map(([n,a])=>[n,a.phase??i()])),p=[];for(let n=r;n<=c+1e-6;n+=L)p.push(Math.round(n));p[p.length-1]<c&&p.push(Math.round(c));const y=[...new Set([...p,...h.switchesOf(u,O,r,c)])].filter(n=>n>=r&&n<=c).sort((n,a)=>n-a),T=s.signOf(t),R=e.glowCdM2!==void 0&&t.lit!==!1?e.glowCdM2:0,X=e.sizeM.heightM/2;let b;const k=y.map((n,a)=>{const l=I(n),d=I(n-1e3),E=I(n+1e3),m={e:(E.eastM-d.eastM)/2,n:(E.northM-d.northM)/2,u:(E.upM-d.upM)/2},C=m.e-j,x=m.n-z,G=Math.hypot(C,x);let f;if(e.tethered||G<1){const D=w>.3?(t.wind.fromDeg+360)%360:b??0;f=e.tethered?(D+M.amplitudeDeg*Math.sin(2*Math.PI*(n-r)/1e3/M.period+M.phase)+360)%360:D}else f=(Math.atan2(C,x)*180/Math.PI+360)%360;const v=Math.hypot(m.e,m.n),Z=e.tethered?0:Math.max(-s.MAX_PITCH_DEG,Math.min(s.MAX_PITCH_DEG,Math.atan2(m.u,Math.max(v,2))*180/Math.PI)),B=b===void 0?0:((f-b+540)%360-180)/Math.max(.001,(n-(y[a-1]??n))/1e3),Y=e.tethered?0:Math.max(-10,Math.min(10,Math.atan(v*B*Math.PI/180/N.G)*180/Math.PI*s.BANK_SHARE));b=f;const P=h.luminancesAt(u,O,n,y[a+1]===n+1);if(e.sign)for(const D of["left","right"])P[`light-sign-${D}`]=T?.luminanceCdM2??0;return e.glowCdM2!==void 0&&(P.envelope=R),{t:n,eastM:s.round(l.eastM),northM:s.round(l.northM),altitudeM:s.round(l.upM-X),...a===0?{sizeM:e.sizeM,appearance:{color:t.color??e.color,albedo:e.albedo}}:{},attitude:{headingDeg:s.round(f,10),pitchDeg:s.round(Z,10),rollDeg:s.round(Y,10)},lights:P}}),g={envelopeColor:t.color??e.color};e.modelId!=="ufoathome-airship-lightship"&&(g.finColor=t.finColor??e.finColor),e.sign&&(g.signColor=T?.color??e.sign.color);for(const[n,a]of Object.entries(u))g[N.colourKeyOf(n)]=a.color;return[{id:t.id,title:t.title??s.TITLES[e.id],...t.explains?{explains:t.explains}:{},model:{id:e.modelId},modelParameters:g,lamps:h.lampsOf(u,O),...t.silent||!e.sound?{}:{sound:{kind:e.sound}},track:k}]}static round(t,o=100){return Math.round(t*o)/o}}export{s as AirshipFlight};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{E as O,ah as z,a6 as $,V as h,k as L,o as P,ai as _,bs as I,bf as p}from"./rr0-scene.mjs";import{A,a as c,b,c as G}from"./Aurora-BmVyTP6i.js";class r{static RADIUS=885;static MAX_ARCS=4;static STEPS=56;static ALTITUDES=[-3,0,1,2,4,7,12,20,35,60,90];object;material;shown=!1;constructor(){const e=A,a=i=>i.toFixed(6);this.material=new O({uniforms:{uAxis:{value:new h(0,1,0)},uSun:{value:new h(0,-1,0)},uObserverKm:{value:e.EARTH_KM},uEdge:{value:60},uWidth:{value:8},uDiffuse:{value:0},uRed:{value:0},uArcRed:{value:new h(.1,250,70)},uArcs:{value:Array.from({length:r.MAX_ARCS},()=>new L)},uArcCount:{value:0},uTime:{value:0},uGreenLight:{value:new h},uRedLight:{value:new h},uBlueLight:{value:new h},uAir:{value:r.ALTITUDES.map(()=>new h(1,1,1))}},vertexShader:`
|
|
2
2
|
varying vec3 vDirection;
|
|
3
3
|
void main() {
|
|
4
4
|
vDirection = (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition;
|
|
@@ -115,6 +115,11 @@ import{ad as O,aE as z,at as L,K as h,Q as P,Y as $,aF as _,w as G,bG as p}from"
|
|
|
115
115
|
for (int a = 0; a < ${r.MAX_ARCS}; a++) {
|
|
116
116
|
if (a >= uArcCount) break;
|
|
117
117
|
vec4 arc = uArcs[a];
|
|
118
|
+
// Its folds move it at most 0.75° from where it stands: a step whose field lines come down farther than that and five of its
|
|
119
|
+
// thicknesses away crosses nothing of it, and is passed over before its folds, its sheet and its rays are worked out.
|
|
120
|
+
float nominal = edge + arc.x;
|
|
121
|
+
float reach = 0.75 + 5.0 * ${a(e.ARC_THICKNESS_DEG)};
|
|
122
|
+
if (min(fieldA.x, fieldB.x) > nominal + reach || max(fieldA.x, fieldB.x) < nominal - reach) continue;
|
|
118
123
|
// Where it stands here along its length: folded, the folds drifting.
|
|
119
124
|
float phi = fm.y;
|
|
120
125
|
float centre = edge + arc.x + 0.6 * sin(9.0 * phi + 0.004 * uTime + arc.z) + 0.15 * sin(37.0 * phi - 0.02 * uTime + 2.0 * arc.z);
|
|
@@ -149,4 +154,4 @@ import{ad as O,aE as z,at as L,K as h,Q as P,Y as $,aF as _,w as G,bG as p}from"
|
|
|
149
154
|
if (max(light.r, max(light.g, light.b)) <= 0.0) discard;
|
|
150
155
|
gl_FragColor = vec4(min(light, vec3(60000.0)), 1.0);
|
|
151
156
|
}
|
|
152
|
-
`,transparent:!0,blending
|
|
157
|
+
`,transparent:!0,blending:$,depthWrite:!1,side:z,fog:!1}),this.object=new P(new _(r.RADIUS,96,48),this.material),this.object.name="aurora",this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.visible=!1}get count(){return this.shown?1:0}set(e,a,i){if(this.shown=e!==void 0,this.object.visible=this.shown,!e)return;const t=this.material.uniforms;t.uAxis.value.set(...e.axis),t.uSun.value.set(...e.sun).normalize(),t.uObserverKm.value=A.EARTH_KM+e.observerHeightKm,t.uEdge.value=e.edgeDeg,t.uWidth.value=e.widthDeg,t.uDiffuse.value=e.diffuseKR,t.uRed.value=e.redKR,t.uArcRed.value.set(e.arcRed.share,e.arcRed.peakKm,e.arcRed.widthKm);const l=e.arcs.slice(0,r.MAX_ARCS);t.uArcCount.value=l.length,l.forEach((o,d)=>t.uArcs.value[d].set(o.offsetDeg,o.kr,o.foldPhase,o.rayPhase)),t.uTime.value=e.timeS;const u=a*e.fade,s=(o,d)=>d.set(o.colour[0],o.colour[1],o.colour[2]).multiplyScalar(o.cdM2PerKR*u);s(c.GREEN,t.uGreenLight.value),s(c.RED,t.uRedLight.value),s(c.BLUE,t.uBlueLight.value),r.ALTITUDES.forEach((o,d)=>{const n=i({altitudeDeg:Math.max(o,0),azimuthDeg:0});t.uAir.value[d].set(n[0],n[1],n[2])})}dispose(){this.object.geometry.dispose(),this.material.dispose(),this.object.removeFromParent()}}class E{inSky=!0;static DAYLIGHT_DEG=-4;system=new r;lit;get object(){return this.system.object}get drawnCount(){return this.system.count}drawn;update(e,a,i){const t=i.date?this.viewOf(e,a,i):void 0;this.system.set(t,i.relativeScale,l=>i.transmittanceFromSpace(l)),this.drawn=t&&{view:t,relativeScale:i.relativeScale},this.lightGround(t,i)}pick(e,a,i){if(!this.drawn)return;const{view:t,relativeScale:l}=this.drawn,[u,s,o]=b.along(t,[a.x,a.y,a.z]);if(!((u*c.GREEN.cdM2PerKR+s*c.RED.cdM2PerKR+o*c.BLUE.cdM2PerKR)*l<.1*i.skyLightTowards(a)))return{id:t.id,detail:{kp:t.kp,green:u,red:s}}}viewOf(e,a,i){const t=new Date(i.date.getTime()),l=I("Sun",t,{lat:i.observer.lat,lng:i.observer.lng,elevationM:i.observer.heightM});if(l.altitudeDeg>E.DAYLIGHT_DEG)return;const u=p(l.altitudeDeg,l.azimuthDeg,1);for(const s of e){const o=G.viewAt(s,a,i.observer,t,[u.x,u.y,u.z]);if(o)return o}}lightGround(e,a){if(!e){this.lit&&a.lightFrom([]),this.lit=void 0;return}const i=`${e.kp.toFixed(1)}:${e.fade.toFixed(2)}:${Math.floor(e.timeS/10)}:${a.observer.lat.toFixed(2)}:${a.observer.lng.toFixed(2)}`;if(this.lit?.key===i)return;let t=0,l=0,u={altitudeDeg:90,azimuthDeg:0};const s=[3,10,22,40,62,82],o=12;for(let n=0;n<s.length;n++){const T=n===0?0:(s[n-1]+s[n])/2,R=n===s.length-1?90:(s[n]+s[n+1])/2,x=2*Math.PI*(Math.sin(R*Math.PI/180)-Math.sin(T*Math.PI/180))/o,D=Math.sin(s[n]*Math.PI/180);for(let g=0;g<o;g++){const f={altitudeDeg:s[n],azimuthDeg:360*g/o},m=p(f.altitudeDeg,f.azimuthDeg,1),[S,M,w]=b.along(e,[m.x,m.y,m.z],48),K=a.transmittanceFromSpace(f)[1]*a.cloudTransmission(f),v=(S*c.GREEN.cdM2PerKR+M*c.RED.cdM2PerKR+w*c.BLUE.cdM2PerKR)*K;t+=v*x*D,v>l&&(l=v,u=f)}}const d=t<1e-4?[]:[{position:u,magnitude:-14.18-2.5*Math.log10(t)}];this.lit={key:i,sources:d},a.lightFrom(d)}dispose(){this.system.dispose()}}export{E as AuroraSimulation};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as m,_ as h,
|
|
1
|
+
import{e as m,_ as h,bG as w,bH as E,bC as A,bD as L,bE as O}from"./rr0-scene.mjs";import{d as f,P as b,S as T,a as S,c as x,b as M,E as k}from"./ParameterForm-CRC9iA-m.js";import{D as R}from"./DroneParameters-CoWQympS.js";import{BalloonFlight as c}from"./BalloonFlight-gunghgAq.js";import"./DroneFlight-ERYah68l.js";const I=m.catalog({en:()=>h(()=>import("./BalloonParameterTexts_en-CHm_vRVx.js"),[],import.meta.url).then(a=>a.balloonParameterTexts_en),fr:()=>h(()=>import("./BalloonParameterTexts_fr-IhyPRhYG.js"),[],import.meta.url).then(a=>a.balloonParameterTexts_fr),es:()=>h(()=>import("./BalloonParameterTexts_es-BYaljnsn.js"),[],import.meta.url).then(a=>a.balloonParameterTexts_es),it:()=>h(()=>import("./BalloonParameterTexts_it-BqBPIfav.js"),[],import.meta.url).then(a=>a.balloonParameterTexts_it)});class i{static BALLOON="balloon";static RELEASE="letGo";static AIR="air";static FLIGHT="flight";static viewOf(e){const{balloon:t,windsAloft:s,plan:n,...o}=structuredClone(e),r={...o,balloon:typeof t=="string"?t:t.id,mode:e.group?"group":"one"};if(typeof t=="object"){const{id:d,...u}=t;Object.keys(u).length>0&&(r.figures=u)}return e.group||(r.release=structuredClone(e.releases?.[0]??{t:0})),s?.[0]&&(r.windAloft={...s[0]}),n&&n.length===1&&(r.cruiseM=n[0].altitudeM),r}static fromView(e,t){const{balloon:s,figures:n,mode:o,release:r,windAloft:d,cruiseM:u,...v}=structuredClone(e),l={...v,balloon:n&&Object.keys(n).length>0?{...n,id:s}:s};if(o==="group"){const p=r?.t??t.releases?.[0]?.t??0;l.group={count:10,fromT:p,untilT:p+6e4,...e.group??{}},t.group&&t.releases?.length?l.releases=t.releases:delete l.releases}else{delete l.group;const p={...r??{},t:r?.t??t.group?.fromT??0};l.releases=[p,...t.group?[]:t.releases?.slice(1)??[]]}const g=t.windsAloft?.slice(1)??[];return d&&Object.values(d).some(p=>p!==void 0)?l.windsAloft=[{atM:d.atM??1e3,towardDeg:d.towardDeg??0,speedMS:d.speedMS??0},...g]:g.length>0&&(l.windsAloft=g),t.plan&&t.plan.length>1?l.plan=t.plan:u!==void 0&&(l.plan=[{t:t.plan?.[0]?.t??0,altitudeM:u}]),l.wind&&l.wind.towardDeg===void 0&&l.wind.speedMS===void 0?delete l.wind:l.wind&&(l.wind.towardDeg??=0,l.wind.speedMS??=0),l}static typeOf(e){const t=e;return c.typeOf({balloon:t.figures?{...t.figures,id:t.balloon}:t.balloon,shape:t.shape})}static FIGURE={hair:"#5a2e14",skin:"#e8955a",bottom:"#f39a1e",shoes:"#f2f2f2"};static one(e){return f.read(e,"mode")!=="group"}static instant(e,t,s,n){return{type:"number",key:e,min:-36e3,max:36e3,step:1,unit:"s",scale:.001,required:!0,label:t,hint:"secondsOfTheRecording",group:s,visibleWhen:n}}static SET={kind:"balloons",title:"balloons",parameters:[{type:"said",key:"title",label:"name",group:i.BALLOON},{type:"choice",key:"balloon",required:!0,group:i.BALLOON,label:"type",choices:w.ALL.map(e=>({value:e.id,label:R.textKey(e.id)}))},{type:"choice",key:"shape",group:i.BALLOON,label:"shape",effective:()=>"round",choices:E.map(e=>({value:e,label:e})),visibleWhen:e=>i.typeOf(e).shapes!==void 0},{type:"colour",key:"color",group:i.BALLOON,label:"colour",hint:"itsLightsForAnLedBalloon",effective:e=>{const t=i.typeOf(e);return t.glow?.color??t.color}},...["hair","skin","bottom","shoes"].map(e=>({type:"colour",key:`partColors.${e}`,group:i.BALLOON,label:e,fallback:i.FIGURE[e],visibleWhen:t=>f.read(t,"shape")==="figure"})),{type:"number",key:"flames",min:1,max:9,step:1,group:i.BALLOON,label:"flamesLit",hint:"candlesOrFlares",effective:e=>i.typeOf(e).flames?.count,visibleWhen:e=>i.typeOf(e).flames!==void 0},{type:"colour",key:"partColors.flame",group:i.BALLOON,label:"flameColour",effective:e=>i.typeOf(e).flames?.color,visibleWhen:e=>i.typeOf(e).flames!==void 0},{type:"number",key:"figures.launchVolumeM3",min:.001,max:1e6,step:.001,unit:"m³",group:i.BALLOON,label:"filledWith",hint:"atSeaLevel",effective:e=>i.typeOf(e).launchVolumeM3},{type:"number",key:"figures.massKg",min:1e-4,max:1e5,step:1e-4,unit:"kg",group:i.BALLOON,label:"weight",hint:"withoutItsGas",effective:e=>i.typeOf(e).massKg},{type:"set",key:"explains",group:i.BALLOON,label:"standForTheShapes",options:(e,t)=>{const s=t?.shapes??[],n=(e.explains??[]).filter(o=>!s.some(r=>r.value===o));return[...s,...n.map(o=>({value:o,label:o}))]},empty:"noShape"},{type:"position",key:"site.eastM",secondKey:"site.northM",saidKey:"site.saidPosition",native:"local",step:1,rangeM:1e5,group:i.RELEASE,label:"whereLetGo"},{type:"number",key:"site.altitudeM",min:-1e3,max:9e3,step:.1,unit:"m",group:i.RELEASE,effective:()=>0,label:"heightOfTheSite",hint:"aboveTheGroundOfThePlace"},{type:"number",key:"site.originElevationM",min:-500,max:6e3,step:1,unit:"m",group:i.RELEASE,effective:()=>0,label:"thePlaceAboveTheSea",hint:"whatSetsHowThinTheAir"},{type:"choice",key:"mode",required:!0,group:i.RELEASE,label:"howMany",choices:[{value:"one",label:"oneBalloon"},{value:"group",label:"aGroup"}]},i.instant("release.t","letGoAt",i.RELEASE,i.one),{type:"number",key:"release.altitudeM",min:0,max:47e3,step:1,unit:"m",group:i.RELEASE,label:"firstSeenAt",hint:"alreadyUp",visibleWhen:i.one},{type:"number",key:"group.count",min:1,max:500,step:1,required:!0,group:i.RELEASE,label:"count",visibleWhen:e=>!i.one(e)},i.instant("group.fromT","firstLetGoAt",i.RELEASE,e=>!i.one(e)),i.instant("group.untilT","lastLetGoAt",i.RELEASE,e=>!i.one(e)),{type:"number",key:"group.radiusM",min:0,max:5e3,step:1,unit:"m",group:i.RELEASE,effective:()=>10,label:"letGoWithin",visibleWhen:e=>!i.one(e)},{type:"number",key:"group.fillSpread",min:0,max:1,step:.01,group:i.RELEASE,effective:()=>.1,label:"fillingUnlike",hint:"asAShare",visibleWhen:e=>!i.one(e)},{type:"number",key:"group.seed",min:0,max:4294967295,step:1,group:i.RELEASE,effective:()=>1,label:"draw",hint:"whatTheDrawsStartFrom",visibleWhen:e=>!i.one(e)},{type:"number",key:"wind.towardDeg",min:0,max:360,step:1,unit:"°",group:i.AIR,label:"windTowards",hint:"atTheGround",effective:()=>0},{type:"number",key:"wind.speedMS",min:0,max:100,step:.1,unit:"m/s",group:i.AIR,label:"windSpeed",effective:()=>0},{type:"number",key:"windAloft.atM",min:10,max:47e3,step:10,unit:"m",group:i.AIR,label:"windAloftAt",hint:"aboveTheSite"},{type:"number",key:"windAloft.towardDeg",min:0,max:360,step:1,unit:"°",group:i.AIR,label:"windAloftTowards"},{type:"number",key:"windAloft.speedMS",min:0,max:150,step:.1,unit:"m/s",group:i.AIR,label:"windAloftSpeed"},{type:"number",key:"airTemperatureC",min:-60,max:50,step:.5,unit:"°C",group:i.AIR,effective:()=>15,label:"airTemperature",hint:"atTheSite"},{type:"number",key:"turbulence.horizontalMS",min:0,max:10,step:.1,unit:"m/s",group:i.AIR,effective:()=>c.TURBULENCE.horizontalMS,label:"gustsAcross"},{type:"number",key:"turbulence.verticalMS",min:0,max:10,step:.1,unit:"m/s",group:i.AIR,effective:()=>c.TURBULENCE.verticalMS,label:"gustsUpAndDown"},{type:"number",key:"cruiseM",min:0,max:1e4,step:1,unit:"m",group:i.FLIGHT,effective:()=>c.CRUISE_M,label:"pilotHolds",hint:"aboveTheSite",visibleWhen:e=>i.typeOf(e).burner!==void 0},{type:"number",key:"triggerM",min:10,max:1e4,step:10,unit:"m",group:i.FLIGHT,label:"torchLitAt",hint:"itsAltimeterLightsIt",effective:e=>i.typeOf(e).torch?.aboveM,visibleWhen:e=>i.typeOf(e).torch!==void 0},{type:"number",key:"tetherM",min:1,max:5e3,step:1,unit:"m",group:i.FLIGHT,effective:()=>c.TETHER_M,label:"line",visibleWhen:e=>i.typeOf(e).envelope==="sealed"},{type:"boolean",key:"lit",group:i.FLIGHT,label:"lampLit",hint:"theLampUnderIt",visibleWhen:e=>i.typeOf(e).lamp!==void 0},{type:"number",key:"durationS",min:1,max:86400,step:1,unit:"s",group:i.FLIGHT,effective:e=>i.typeOf(e).durationS,label:"computedFor",hint:"itMayBurstOrLandBefore"}]};static publish(){b.publish(i.SET)}}const D=m.catalog({en:()=>h(()=>import("./BalloonEditorMessages_en-B2n2FutN.js"),[],import.meta.url).then(a=>a.balloonEditorMessages_en),fr:()=>h(()=>import("./BalloonEditorMessages_fr-BmUizmQy.js"),[],import.meta.url).then(a=>a.balloonEditorMessages_fr),es:()=>h(()=>import("./BalloonEditorMessages_es-BXppdrpF.js"),[],import.meta.url).then(a=>a.balloonEditorMessages_es),it:()=>h(()=>import("./BalloonEditorMessages_it-Dx0JODqK.js"),[],import.meta.url).then(a=>a.balloonEditorMessages_it)});class y{constructor(e,t,s){this.container=e,this.host=t,T.attach(e,"balloon-editor-part",y.STYLE),this.language=s,b.of("balloons")||i.publish(),this.ready=this.setLanguage(s)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;language;shown=[];viewed;static STYLE=`
|
|
2
2
|
.balloon-editor-part, .balloon-editor-part #balloon-list, .balloon-editor-part .launch-fields { flex-basis: 100%; min-width: 0; }
|
|
3
3
|
.balloon-editor-part .launch-editor, .balloon-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
|
|
4
4
|
.balloon-editor-part [hidden] { display: none !important; }
|
|
@@ -13,7 +13,7 @@ import{e as m,_ as h,bH as w,bI as E,bD as A,bE as L,bF as O}from"./rr0-scene.mj
|
|
|
13
13
|
.balloon-editor-part input, .balloon-editor-part select { min-width: 0; max-width: 100%; box-sizing: border-box; }
|
|
14
14
|
.balloon-editor-part input[type="text"] { width: 12em; }
|
|
15
15
|
.balloon-editor-part input.parameter-derived::placeholder { opacity: .65; }
|
|
16
|
-
`;async setLanguage(e){const t=++this.languageToken;this.language=e;const[s,n]=await Promise.all([D.load(e),
|
|
16
|
+
`;async setLanguage(e){const t=++this.languageToken;this.language=e;const[s,n]=await Promise.all([D.load(e),I.load(e)]);t===this.languageToken&&(this.messages=s,this.parameterTexts=n,this.render(),this.sync())}sync(){if(!this.messages)return;const e=this.flights;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;this.element("balloon-fields").hidden=t===void 0,t&&(this.syncNotes(),this.form??=new S(this.element("balloon-parameters"),this.language,"balloons.",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(this.resolved(i.SET),new x(()=>this.view,s=>this.editView(n=>s(n)),()=>({shapes:this.host.shapes().map(s=>({value:s.id,label:s.label}))}),this.host.positionPlace?.()),()=>this.written()))}refresh(){if(!this.messages)return;this.syncAddState();const e=this.flights;e.length===this.shown.length&&e.every((t,s)=>t.id===this.shown[s].id)||this.sync()}get current(){return this.flights.find(e=>e.id===this.currentId)}get view(){const e=this.current;if(e)return this.viewed?.of!==e&&(this.viewed={of:e,view:i.viewOf(e)}),this.viewed.view}syncAddState(){const e=this.frontOfObserver()!==void 0;this.list?.setAddState(e,e?void 0:this.messages.addNowhere)}syncNotes(){const e=this.current,t=e.group?e.releases?.length??0:Math.max(0,(e.releases?.length??0)-1),s=Math.max(0,(e.windsAloft?.length??0)-1),n=(e.plan?.length??0)>1?e.plan.length:0,o=[t>0?this.messages.releasesNote.replace("{n}",String(t)):"",s>0?this.messages.windsNote.replace("{n}",String(s)):"",n>0?this.messages.planNote.replace("{n}",String(n)):""].filter(Boolean),r=this.element("balloon-kept");r.hidden=o.length===0,r.textContent=o.join(" ")}resolved(e){return M.resolve(e,this.parameterTexts)}render(){if(!this.messages)return;const e=this.messages;this.form=void 0,this.container.innerHTML=`<div class="launch-editor">
|
|
17
17
|
<p class="launch-intro">${e.intro}</p>
|
|
18
18
|
<div id="balloon-list"></div>
|
|
19
19
|
<div id="balloon-fields" class="launch-fields">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bH as X}from"./rr0-scene.mjs";class a{static SAMPLE_MS=1e3;static MAX_KEYFRAMES=6e3;static STEP_S=.05;static G=9.80665;static R=8.314462;static AIR_KG_MOL=.0289644;static R_AIR=a.R/a.AIR_KG_MOL;static TURBULENCE={horizontalMS:.8,verticalMS:.3,timescaleS:30};static GUST_GROUND_M=2;static MAX_FLAMES=9;static TETHER_M=30;static CRUISE_M=300;static PILOT_MS=2;static TITLES={"hot-air":{en:"Hot-air balloon",fr:"Montgolfière",es:"Globo aerostático",it:"Mongolfiera"},party:{en:"Party balloon",fr:"Ballon de baudruche",es:"Globo de fiesta",it:"Palloncino"},led:{en:"LED balloon",fr:"Ballon lumineux à LED",es:"Globo de LED",it:"Palloncino a LED"},foil:{en:"Foil balloon",fr:"Ballon métallisé",es:"Globo metalizado",it:"Palloncino metallizzato"},pilot:{en:"Pilot balloon",fr:"Ballon pilote",es:"Globo piloto",it:"Pallone pilota"},weather:{en:"Weather balloon",fr:"Ballon-sonde",es:"Globo sonda",it:"Pallone sonda"},stratospheric:{en:"Stratospheric balloon",fr:"Ballon stratosphérique",es:"Globo estratosférico",it:"Pallone stratosferico"},"stratospheric-large":{en:"Large stratospheric balloon",fr:"Grand ballon stratosphérique",es:"Gran globo estratosférico",it:"Grande pallone stratosferico"},superpressure:{en:"Superpressure balloon",fr:"Ballon pressurisé",es:"Globo presurizado",it:"Pallone pressurizzato"},infrared:{en:"Infrared hot-air balloon",fr:"Montgolfière infrarouge",es:"Globo infrarrojo",it:"Mongolfiera infrarossa"},"prank-candles":{en:"Prank balloon",fr:"Ballon farceur",es:"Globo de broma",it:"Pallone scherzo"},"prank-flares":{en:"Prank balloon with a flare",fr:"Ballon farceur à feu de détresse",es:"Globo de broma con bengala",it:"Pallone scherzo con razzo"},"anti-hail":{en:"Anti-hail balloon",fr:"Ballon anti-grêle",es:"Globo antigranizo",it:"Pallone antigrandine"},solar:{en:"Solar balloon",fr:"Ballon solaire",es:"Globo solar",it:"Pallone solare"},captive:{en:"Captive balloon",fr:"Ballon captif",es:"Globo cautivo",it:"Pallone frenato"}};static computed=new Map;static bodiesOf(e){const n=JSON.stringify(e);let r=a.computed.get(n);if(!r){const t=a.releasesOf(e);r=t.flatMap((c,o)=>a.balloonBodies(e,c,o,t.length)),a.computed.set(n,r),a.computed.size>16&&a.computed.delete(a.computed.keys().next().value)}return r}static typeOf(e){const n=e.balloon,r=typeof n=="string"?n:n?.id,t=X.byId(r)??X.ALL[0],c=t.shapes?t.shapes[e.shape??"round"]??Object.values(t.shapes)[0]:void 0,o=c?{...t,...c}:t;return typeof n=="string"?o:{...o,...n,id:o.id}}static flamesOf(e,n){return n.flames?Math.max(1,Math.min(9,Math.round(e.flames??n.flames.count))):0}static flameShare(e,n){const r=e.flames?.burnS;if(r===void 0||n<0||n>=r)return 0;const t=r*.75;return n<=t?1:(r-n)/(r-t)}static releasesOf(e){const n=[...e.releases??[]],r=e.group;if(r&&r.count>0){const t=a.randomFrom(r.seed??1),c=r.count>1?(r.untilT-r.fromT)/(r.count-1):0,o=r.radiusM??10,d=r.fillSpread??.1;for(let i=0;i<r.count;i++){const f=r.fromT+c*i+(t()-.5)*c,p=o*Math.sqrt(t()),u=2*Math.PI*t();n.push({t:Math.round(Math.min(r.untilT,Math.max(r.fromT,f))),eastM:Math.round(p*Math.sin(u)*10)/10,northM:Math.round(p*Math.cos(u)*10)/10,fill:Math.round((2*t()-1)*d*1e3)/1e3,...r.colors?.length?{color:r.colors[i%r.colors.length]}:{},seed:Math.floor(t()*4294967296)})}}return n.length>0?n:[{t:0}]}static airAt(e,n=0,r=0){const t=a.LAYERS,c=Math.max(-500,Math.min(a.EARTH_RADIUS_M*e/(a.EARTH_RADIUS_M+e),47e3));let o=t[0];for(const M of t)c>=M.fromM&&(o=M);const d=c-o.fromM,i=o.baseK+o.lapseKM*d,f=a.G*a.AIR_KG_MOL/a.R,p=o.lapseKM===0?o.basePa*Math.exp(-f*d/o.baseK):o.basePa*Math.pow(o.baseK/i,f/o.lapseKM),u=Math.max(0,1-Math.max(0,e-r)/11e3);return{pressurePa:p,temperatureK:i+n*u}}static EARTH_RADIUS_M=6356766;static LAYERS=[{fromM:0,baseK:288.15,basePa:101325,lapseKM:-.0065},{fromM:11e3,baseK:216.65,basePa:22632.06,lapseKM:0},{fromM:2e4,baseK:216.65,basePa:5474.889,lapseKM:.001},{fromM:32e3,baseK:228.65,basePa:868.0187,lapseKM:.0028}];static windAt(e,n){const r=[{atM:0,...e.wind??{towardDeg:0,speedMS:0}},...[...e.windsAloft??[]].sort((c,o)=>c.atM-o.atM)],t=c=>({x:Math.sin(c.towardDeg*Math.PI/180)*c.speedMS,y:Math.cos(c.towardDeg*Math.PI/180)*c.speedMS});if(n<=r[0].atM||r.length===1)return t(r[0]);for(let c=1;c<r.length;c++){if(n>r[c].atM)continue;const o=t(r[c-1]),d=t(r[c]),i=(n-r[c-1].atM)/Math.max(1e-6,r[c].atM-r[c-1].atM);return{x:o.x+(d.x-o.x)*i,y:o.y+(d.y-o.y)*i}}return t(r[r.length-1])}static planAt(e,n){const r=[...e.plan??[]].sort((c,o)=>c.t-o.t);if(r.length===0)return a.CRUISE_M;let t=r[0].altitudeM;for(const c of r)c.t<=n&&(t=c.altitudeM);return t}static widthOf(e,n){return e.widthM!==void 0?e.widthM:Math.cbrt(6*n/Math.PI)}static trajectory(e,n,r=a.SAMPLE_MS){const t=a.typeOf(e),c=e.site,o=c.altitudeM??0,d=c.originElevationM??0,i=d+o,f=(e.airTemperatureC??15)+273.15-a.airAt(i).temperatureK,p=t.gasMolarMassKgMol??X.HELIUM_KG_MOL,u=e.durationS??t.durationS,M=a.STEP_S,v=Math.ceil(u/M);r=Math.max(r,Math.ceil(u*1e3/a.MAX_KEYFRAMES/500)*500);const x=Math.max(1,Math.round(r/1e3/M)),K={x:c.eastM+(n.eastM??0),y:c.northM+(n.northM??0)},E=t.tethered?e.tetherM??a.TETHER_M:void 0,T=a.flamesOf(e,t),O=t.flames?(t.insideExcessK??0)*T/t.flames.count:0,A=l=>{const{pressurePa:m,temperatureK:b}=a.airAt(l+d,f,i);return{p:m,T:b,rho:m/(a.R_AIR*b)}},D=1+(n.fill??0),V=t.launchVolumeM3*D*101325*p/(a.R*288.15),z=n.altitudeM??o,s={x:K.x,y:K.y,z,vx:0,vy:0,vz:0,gasKg:V,excessK:0,burnUntilS:-1,ballastKg:t.ballastKg??0,floated:!1};if(t.envelope==="open"){const l=A(z);s.excessK=t.burner?Math.max(0,l.T*t.massKg/(l.rho*t.maxVolumeM3-t.massKg)):t.flames?O*a.flameShare(t,0):t.insideExcessK??0}const S=l=>{if(t.envelope==="sealed")return t.maxVolumeM3;if(t.envelope==="open")return t.launchVolumeM3>=t.maxVolumeM3?t.maxVolumeM3:Math.min(t.maxVolumeM3,t.launchVolumeM3*D*(101325/288.15)/(l.p/l.T));const m=s.gasKg*a.R*l.T/(l.p*p);return t.envelope==="elastic"?m:Math.min(m,t.maxVolumeM3)},P=A(z),y=[{t:n.t,x:s.x,y:s.y,z:s.z,widthM:a.widthOf(t,S(P)),burning:!1,flame:a.flameShare(t,0)}],k=a.gusts(e.turbulence??a.TURBULENCE,a.seedOf(n),M);let w="time",q=0,Y=-1/0;for(let l=1;l<=v;l++){const m=l*M,b=A(s.z);let R=S(b);if(t.torch&&s.z-o>=(e.triggerM??t.torch.aboveM)){w="lit",y.push({t:n.t+Math.round(m*1e3),x:s.x,y:s.y,z:s.z,widthM:a.widthOf(t,R),burning:!1,flame:0});break}if(t.envelope==="elastic"&&R>=t.maxVolumeM3){w="burst",y.push({t:n.t+Math.round(m*1e3),x:s.x,y:s.y,z:s.z,widthM:a.widthOf(t,t.maxVolumeM3),burning:!1,flame:0});break}if(t.envelope==="vented"){const h=t.maxVolumeM3*b.p*p/(a.R*b.T);s.gasKg>=h&&(s.gasKg=h,s.floated=!0),R=S(b)}const G=t.burner;let I=!1;if(G){const h=a.planAt(e,n.t+m*1e3),F=h<=0?-Math.min(1,Math.max(.5,(s.z-o)/40))*a.PILOT_MS/2:Math.max(-a.PILOT_MS,Math.min(a.PILOT_MS,(h+o-s.z)/40)),ee=h<=0,ce=ee?-2.5:F-.3,ie=ee?-.3:F+.8;m>=s.burnUntilS&&s.vz<ce&&m-Y>2&&s.excessK<G.maxExcessK&&(s.burnUntilS=m+G.blastS),I=m<s.burnUntilS,!I&&s.burnUntilS>0&&m-M<s.burnUntilS&&(Y=m),I&&(s.excessK=Math.min(G.maxExcessK,s.excessK+G.heatingKS*M)),s.excessK-=s.excessK/G.coolingS*M,!I&&s.vz>ie&&(s.excessK-=.5*M),s.excessK=Math.max(0,s.excessK)}const j=a.flameShare(t,m);t.flames&&(s.excessK+=(O*j-s.excessK)*Math.min(1,M/t.flames.coolingS));const Z=t.envelope==="open"?b.p*R/(a.R_AIR*(b.T+s.excessK)):s.gasKg,N=(b.rho*R-Z)*a.G;let U=t.massKg-((t.ballastKg??0)-s.ballastKg);if(s.floated&&s.ballastKg>0&&N<U*a.G){const h=Math.min(s.ballastKg,U-N/a.G);s.ballastKg-=h,U-=h}const te=U*a.G,W=U+Z+.5*b.rho*R,H=a.widthOf(t,R),se=Math.PI*H*H/4*(t.depthRatio!==void 0?(1+t.depthRatio)/2:1),J=s.z-o,Q=a.windAt(e,J),$=k(),ae=Math.max(0,Math.min(1,J/a.GUST_GROUND_M)),C={x:Q.x+$.x,y:Q.y+$.y,z:$.z*ae},re=s.vx-C.x,oe=s.vy-C.y,ne=s.vz-C.z,L=.5*b.rho*t.dragCoefficient*se*Math.hypot(re,oe,ne)/W;s.vx=(s.vx+L*M*C.x)/(1+L*M),s.vy=(s.vy+L*M*C.y)/(1+L*M),s.vz=(s.vz+L*M*C.z+(N-te)/W*M)/(1+L*M);const g=s.z<=o+1e-6&&s.vz<=0;g&&(s.vx=0,s.vy=0,s.vz=0),s.x+=s.vx*M,s.y+=s.vy*M,s.z=Math.max(o,s.z+s.vz*M),E!==void 0&&a.heldBy(s,K,o,E),q=g&&m>10?q+M:0;const _=q>30&&!t.tethered,B=y.length>0&&y[y.length-1].burning!==I;if(l%x===0||l===v||B||_){const h=n.t+Math.round(m*1e3);B&&y.push({t:h-1,x:s.x,y:s.y,z:s.z,widthM:H,burning:!I,flame:j}),y.push({t:h,x:s.x,y:s.y,z:s.z,widthM:H,burning:I,flame:j})}if(_){w="landed";break}}return{samples:y,end:w}}static heldBy(e,n,r,t){const c=e.x-n.x,o=e.y-n.y,d=e.z-r,i=Math.hypot(c,o,d);if(i<=t||i===0)return;const f=c/i,p=o/i,u=d/i;e.x=n.x+f*t,e.y=n.y+p*t,e.z=r+u*t;const M=e.vx*f+e.vy*p+e.vz*u;M>0&&(e.vx-=M*f,e.vy-=M*p,e.vz-=M*u)}static balloonBodies(e,n,r,t){const{samples:c,end:o}=a.trajectory(e,n),d=a.balloonBody(e,n,r,t,c),i=a.typeOf(e);return o==="lit"&&i.torch?[d,a.torchBody(e,n,d.id,c[c.length-1],i.torch)]:[d]}static torchBody(e,n,r,t,c){const o=e.site.altitudeM??0,d=a.TORCH_FLAME_M/2,i=[];let f=t.x,p=t.y,u=t.z;const M=a.randomFrom(a.seedOf(n)^1374496523),v={degrees:4+4*M(),periodS:2+2*M(),phase:2*Math.PI*M()};for(let x=0;;x++){const K=x<c.burnS*.9?1:x<c.burnS?(c.burnS-x)/(c.burnS*.1):0,E=2*Math.PI*x/v.periodS+v.phase;if(i.push({t:t.t+x*1e3,eastM:a.round(f),northM:a.round(p),altitudeM:a.round(u),...x===0?{sizeM:a.TORCH_SIZE,present:!0,appearance:{color:"#d8d2c4",albedo:.6}}:{},attitude:{pitchDeg:a.round(v.degrees*Math.sin(E),10),rollDeg:a.round(v.degrees*Math.cos(E),10)},lights:{"light-flame":a.round(c.candela*K/(Math.PI*d*d),1)}}),u<=o)break;const T=a.windAt(e,u-o);f+=T.x,p+=T.y,u=Math.max(o,u-c.fallMS)}return i.push({t:i[i.length-1].t+1,present:!1}),{id:`${r}-torch`,title:a.TORCH_TITLE,...e.explains?{explains:e.explains}:{},model:{id:"ufoathome-balloon-torch"},modelParameters:{flameColor:c.color},track:i}}static TORCH_SIZE={widthM:1.2,lengthM:1.2,heightM:1.6};static TORCH_FLAME_M=.2;static TORCH_TITLE={en:"Hygroscopic torch",fr:"Torche hygroscopique",es:"Antorcha higroscópica",it:"Torcia igroscopica"};static balloonBody(e,n,r,t,c){const o=a.typeOf(e),d=n.color??e.color??(o.glow?o.glow.color:o.color),i=o.depthRatio??1,f=e.lit&&o.lamp?o.lamp:void 0,p=s=>o.glow?o.glow.candela/(Math.PI*s*s/4):0,u=a.randomFrom(a.seedOf(n)^2654435769),M=o.spins?(5+15*u())*(u()<.5?-1:1):0,v=360*u(),x=o.sways?{degrees:3+4*u(),periodS:3+3*u(),phase:2*Math.PI*u()}:void 0,K=s=>{if(M===0&&!x)return;const S=(s-n.t)/1e3,P=x?2*Math.PI*S/x.periodS+x.phase:0;return{...M!==0?{headingDeg:a.round(((v+M*S)%360+360)%360,10)}:{},...x?{pitchDeg:a.round(x.degrees*Math.sin(P),10),rollDeg:a.round(x.degrees*Math.cos(P*.83),10)}:{}}},E=a.flamesOf(e,o),T=e.partColors?.flame??o.flames?.color;let O=-1;const A=c.map((s,S)=>{const P=Math.abs(s.widthM-O)>O*.005;P&&(O=s.widthM);const y={widthM:a.round(s.widthM,1e3),lengthM:a.round(s.widthM*i,1e3),heightM:a.round(s.widthM*o.aspect,1e3)},k={t:s.t,eastM:a.round(s.x),northM:a.round(s.y),altitudeM:a.round(s.z),...S===0?{present:!0}:{},...P?{sizeM:y}:{},...K(s.t)?{attitude:K(s.t)}:{},...S===0?{appearance:{color:d,albedo:o.albedo,...o.finish?{finish:o.finish}:{},...o.glow?{luminanceCdM2:p(s.widthM)}:{}}}:o.glow&&P?{appearance:{color:d,luminanceCdM2:a.round(p(s.widthM),100)}}:{}},w=a.lightsOf(o,s.burning,f,s.widthM,E,s.flame);return w&&(k.lights=w),k});A.push({t:c[c.length-1].t+1,present:!1});const D=e.title??a.TITLES[o.id],V=e.explainsEach?e.explainsEach[r]!==void 0?{explains:[e.explainsEach[r]]}:{}:{...e.explains?{explains:e.explains}:{},...t>1?{ensemble:e.id}:{}},z={envelopeColor:d};o.stripeColor&&(z.stripeColor=o.stripeColor),f&&(z.lampColor=f.color),T&&(z.flameColor=T);for(const[s,S]of Object.entries(e.partColors??{}))z[`${s}Color`]=S;return{id:t>1?`${e.id}-${r+1}`:e.id,title:D,...V,model:{id:o.modelId},modelParameters:z,...o.id==="hot-air"?{sound:{kind:"balloon"}}:{},altitudeFrom:{eastM:c[0].x,northM:c[0].y},track:A}}static lightsOf(e,n,r,t,c=0,o=0){if(e.flames){const d=t/50,i={};for(let f=1;f<=a.MAX_FLAMES;f++)i[`light-flame-${f}`]=f<=c?a.round(e.flames.candela*o/(Math.PI*d*d),1):0;return i.envelope=a.round(e.flames.candela*c*o*.5/(Math.PI*t/2*t*e.aspect/2),1e3),i}if(e.burner){const d=n?e.burner.envelopeCdM2:0;return{flame:n?e.burner.flameCdM2:0,envelope:d,"envelope-stripe":d}}if(e.modelId==="ufoathome-balloon-latex"){const d=t/40;return{"light-lamp":r?a.round(r.candela/(Math.PI*d*d),1):0}}}static seedOf(e){return e.seed!==void 0?e.seed:Math.round(e.t)*2654435761+Math.round((e.eastM??0)*100)*40503+Math.round((e.northM??0)*100)>>>0}static gusts(e,n,r){const t=a.randomFrom(n),c=()=>Math.sqrt(-2*Math.log(Math.max(1e-12,t())))*Math.cos(2*Math.PI*t()),o=e.timescaleS>0?Math.exp(-r/e.timescaleS):0,d=Math.sqrt(1-o*o),i={x:e.horizontalMS*c(),y:e.horizontalMS*c(),z:e.verticalMS*c()};return()=>(i.x=o*i.x+d*e.horizontalMS*c(),i.y=o*i.y+d*e.horizontalMS*c(),i.z=o*i.z+d*e.verticalMS*c(),i)}static randomFrom(e){let n=e>>>0;return()=>{n=n+1831565813>>>0;let r=n;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}static round(e,n=100){return Math.round(e*n)/n}}export{a as BalloonFlight};
|
|
1
|
+
import{bG as X}from"./rr0-scene.mjs";class a{static SAMPLE_MS=1e3;static MAX_KEYFRAMES=6e3;static STEP_S=.05;static G=9.80665;static R=8.314462;static AIR_KG_MOL=.0289644;static R_AIR=a.R/a.AIR_KG_MOL;static TURBULENCE={horizontalMS:.8,verticalMS:.3,timescaleS:30};static GUST_GROUND_M=2;static MAX_FLAMES=9;static TETHER_M=30;static CRUISE_M=300;static PILOT_MS=2;static TITLES={"hot-air":{en:"Hot-air balloon",fr:"Montgolfière",es:"Globo aerostático",it:"Mongolfiera"},party:{en:"Party balloon",fr:"Ballon de baudruche",es:"Globo de fiesta",it:"Palloncino"},led:{en:"LED balloon",fr:"Ballon lumineux à LED",es:"Globo de LED",it:"Palloncino a LED"},foil:{en:"Foil balloon",fr:"Ballon métallisé",es:"Globo metalizado",it:"Palloncino metallizzato"},pilot:{en:"Pilot balloon",fr:"Ballon pilote",es:"Globo piloto",it:"Pallone pilota"},weather:{en:"Weather balloon",fr:"Ballon-sonde",es:"Globo sonda",it:"Pallone sonda"},stratospheric:{en:"Stratospheric balloon",fr:"Ballon stratosphérique",es:"Globo estratosférico",it:"Pallone stratosferico"},"stratospheric-large":{en:"Large stratospheric balloon",fr:"Grand ballon stratosphérique",es:"Gran globo estratosférico",it:"Grande pallone stratosferico"},superpressure:{en:"Superpressure balloon",fr:"Ballon pressurisé",es:"Globo presurizado",it:"Pallone pressurizzato"},infrared:{en:"Infrared hot-air balloon",fr:"Montgolfière infrarouge",es:"Globo infrarrojo",it:"Mongolfiera infrarossa"},"prank-candles":{en:"Prank balloon",fr:"Ballon farceur",es:"Globo de broma",it:"Pallone scherzo"},"prank-flares":{en:"Prank balloon with a flare",fr:"Ballon farceur à feu de détresse",es:"Globo de broma con bengala",it:"Pallone scherzo con razzo"},"anti-hail":{en:"Anti-hail balloon",fr:"Ballon anti-grêle",es:"Globo antigranizo",it:"Pallone antigrandine"},solar:{en:"Solar balloon",fr:"Ballon solaire",es:"Globo solar",it:"Pallone solare"},captive:{en:"Captive balloon",fr:"Ballon captif",es:"Globo cautivo",it:"Pallone frenato"}};static computed=new Map;static bodiesOf(e){const n=JSON.stringify(e);let r=a.computed.get(n);if(!r){const t=a.releasesOf(e);r=t.flatMap((c,o)=>a.balloonBodies(e,c,o,t.length)),a.computed.set(n,r),a.computed.size>16&&a.computed.delete(a.computed.keys().next().value)}return r}static typeOf(e){const n=e.balloon,r=typeof n=="string"?n:n?.id,t=X.byId(r)??X.ALL[0],c=t.shapes?t.shapes[e.shape??"round"]??Object.values(t.shapes)[0]:void 0,o=c?{...t,...c}:t;return typeof n=="string"?o:{...o,...n,id:o.id}}static flamesOf(e,n){return n.flames?Math.max(1,Math.min(9,Math.round(e.flames??n.flames.count))):0}static flameShare(e,n){const r=e.flames?.burnS;if(r===void 0||n<0||n>=r)return 0;const t=r*.75;return n<=t?1:(r-n)/(r-t)}static releasesOf(e){const n=[...e.releases??[]],r=e.group;if(r&&r.count>0){const t=a.randomFrom(r.seed??1),c=r.count>1?(r.untilT-r.fromT)/(r.count-1):0,o=r.radiusM??10,d=r.fillSpread??.1;for(let i=0;i<r.count;i++){const f=r.fromT+c*i+(t()-.5)*c,p=o*Math.sqrt(t()),u=2*Math.PI*t();n.push({t:Math.round(Math.min(r.untilT,Math.max(r.fromT,f))),eastM:Math.round(p*Math.sin(u)*10)/10,northM:Math.round(p*Math.cos(u)*10)/10,fill:Math.round((2*t()-1)*d*1e3)/1e3,...r.colors?.length?{color:r.colors[i%r.colors.length]}:{},seed:Math.floor(t()*4294967296)})}}return n.length>0?n:[{t:0}]}static airAt(e,n=0,r=0){const t=a.LAYERS,c=Math.max(-500,Math.min(a.EARTH_RADIUS_M*e/(a.EARTH_RADIUS_M+e),47e3));let o=t[0];for(const M of t)c>=M.fromM&&(o=M);const d=c-o.fromM,i=o.baseK+o.lapseKM*d,f=a.G*a.AIR_KG_MOL/a.R,p=o.lapseKM===0?o.basePa*Math.exp(-f*d/o.baseK):o.basePa*Math.pow(o.baseK/i,f/o.lapseKM),u=Math.max(0,1-Math.max(0,e-r)/11e3);return{pressurePa:p,temperatureK:i+n*u}}static EARTH_RADIUS_M=6356766;static LAYERS=[{fromM:0,baseK:288.15,basePa:101325,lapseKM:-.0065},{fromM:11e3,baseK:216.65,basePa:22632.06,lapseKM:0},{fromM:2e4,baseK:216.65,basePa:5474.889,lapseKM:.001},{fromM:32e3,baseK:228.65,basePa:868.0187,lapseKM:.0028}];static windAt(e,n){const r=[{atM:0,...e.wind??{towardDeg:0,speedMS:0}},...[...e.windsAloft??[]].sort((c,o)=>c.atM-o.atM)],t=c=>({x:Math.sin(c.towardDeg*Math.PI/180)*c.speedMS,y:Math.cos(c.towardDeg*Math.PI/180)*c.speedMS});if(n<=r[0].atM||r.length===1)return t(r[0]);for(let c=1;c<r.length;c++){if(n>r[c].atM)continue;const o=t(r[c-1]),d=t(r[c]),i=(n-r[c-1].atM)/Math.max(1e-6,r[c].atM-r[c-1].atM);return{x:o.x+(d.x-o.x)*i,y:o.y+(d.y-o.y)*i}}return t(r[r.length-1])}static planAt(e,n){const r=[...e.plan??[]].sort((c,o)=>c.t-o.t);if(r.length===0)return a.CRUISE_M;let t=r[0].altitudeM;for(const c of r)c.t<=n&&(t=c.altitudeM);return t}static widthOf(e,n){return e.widthM!==void 0?e.widthM:Math.cbrt(6*n/Math.PI)}static trajectory(e,n,r=a.SAMPLE_MS){const t=a.typeOf(e),c=e.site,o=c.altitudeM??0,d=c.originElevationM??0,i=d+o,f=(e.airTemperatureC??15)+273.15-a.airAt(i).temperatureK,p=t.gasMolarMassKgMol??X.HELIUM_KG_MOL,u=e.durationS??t.durationS,M=a.STEP_S,v=Math.ceil(u/M);r=Math.max(r,Math.ceil(u*1e3/a.MAX_KEYFRAMES/500)*500);const x=Math.max(1,Math.round(r/1e3/M)),K={x:c.eastM+(n.eastM??0),y:c.northM+(n.northM??0)},E=t.tethered?e.tetherM??a.TETHER_M:void 0,T=a.flamesOf(e,t),O=t.flames?(t.insideExcessK??0)*T/t.flames.count:0,A=l=>{const{pressurePa:m,temperatureK:b}=a.airAt(l+d,f,i);return{p:m,T:b,rho:m/(a.R_AIR*b)}},D=1+(n.fill??0),V=t.launchVolumeM3*D*101325*p/(a.R*288.15),z=n.altitudeM??o,s={x:K.x,y:K.y,z,vx:0,vy:0,vz:0,gasKg:V,excessK:0,burnUntilS:-1,ballastKg:t.ballastKg??0,floated:!1};if(t.envelope==="open"){const l=A(z);s.excessK=t.burner?Math.max(0,l.T*t.massKg/(l.rho*t.maxVolumeM3-t.massKg)):t.flames?O*a.flameShare(t,0):t.insideExcessK??0}const S=l=>{if(t.envelope==="sealed")return t.maxVolumeM3;if(t.envelope==="open")return t.launchVolumeM3>=t.maxVolumeM3?t.maxVolumeM3:Math.min(t.maxVolumeM3,t.launchVolumeM3*D*(101325/288.15)/(l.p/l.T));const m=s.gasKg*a.R*l.T/(l.p*p);return t.envelope==="elastic"?m:Math.min(m,t.maxVolumeM3)},P=A(z),y=[{t:n.t,x:s.x,y:s.y,z:s.z,widthM:a.widthOf(t,S(P)),burning:!1,flame:a.flameShare(t,0)}],k=a.gusts(e.turbulence??a.TURBULENCE,a.seedOf(n),M);let w="time",q=0,Y=-1/0;for(let l=1;l<=v;l++){const m=l*M,b=A(s.z);let R=S(b);if(t.torch&&s.z-o>=(e.triggerM??t.torch.aboveM)){w="lit",y.push({t:n.t+Math.round(m*1e3),x:s.x,y:s.y,z:s.z,widthM:a.widthOf(t,R),burning:!1,flame:0});break}if(t.envelope==="elastic"&&R>=t.maxVolumeM3){w="burst",y.push({t:n.t+Math.round(m*1e3),x:s.x,y:s.y,z:s.z,widthM:a.widthOf(t,t.maxVolumeM3),burning:!1,flame:0});break}if(t.envelope==="vented"){const h=t.maxVolumeM3*b.p*p/(a.R*b.T);s.gasKg>=h&&(s.gasKg=h,s.floated=!0),R=S(b)}const G=t.burner;let I=!1;if(G){const h=a.planAt(e,n.t+m*1e3),F=h<=0?-Math.min(1,Math.max(.5,(s.z-o)/40))*a.PILOT_MS/2:Math.max(-a.PILOT_MS,Math.min(a.PILOT_MS,(h+o-s.z)/40)),ee=h<=0,ce=ee?-2.5:F-.3,ie=ee?-.3:F+.8;m>=s.burnUntilS&&s.vz<ce&&m-Y>2&&s.excessK<G.maxExcessK&&(s.burnUntilS=m+G.blastS),I=m<s.burnUntilS,!I&&s.burnUntilS>0&&m-M<s.burnUntilS&&(Y=m),I&&(s.excessK=Math.min(G.maxExcessK,s.excessK+G.heatingKS*M)),s.excessK-=s.excessK/G.coolingS*M,!I&&s.vz>ie&&(s.excessK-=.5*M),s.excessK=Math.max(0,s.excessK)}const j=a.flameShare(t,m);t.flames&&(s.excessK+=(O*j-s.excessK)*Math.min(1,M/t.flames.coolingS));const Z=t.envelope==="open"?b.p*R/(a.R_AIR*(b.T+s.excessK)):s.gasKg,N=(b.rho*R-Z)*a.G;let U=t.massKg-((t.ballastKg??0)-s.ballastKg);if(s.floated&&s.ballastKg>0&&N<U*a.G){const h=Math.min(s.ballastKg,U-N/a.G);s.ballastKg-=h,U-=h}const te=U*a.G,W=U+Z+.5*b.rho*R,H=a.widthOf(t,R),se=Math.PI*H*H/4*(t.depthRatio!==void 0?(1+t.depthRatio)/2:1),J=s.z-o,Q=a.windAt(e,J),$=k(),ae=Math.max(0,Math.min(1,J/a.GUST_GROUND_M)),C={x:Q.x+$.x,y:Q.y+$.y,z:$.z*ae},re=s.vx-C.x,oe=s.vy-C.y,ne=s.vz-C.z,L=.5*b.rho*t.dragCoefficient*se*Math.hypot(re,oe,ne)/W;s.vx=(s.vx+L*M*C.x)/(1+L*M),s.vy=(s.vy+L*M*C.y)/(1+L*M),s.vz=(s.vz+L*M*C.z+(N-te)/W*M)/(1+L*M);const g=s.z<=o+1e-6&&s.vz<=0;g&&(s.vx=0,s.vy=0,s.vz=0),s.x+=s.vx*M,s.y+=s.vy*M,s.z=Math.max(o,s.z+s.vz*M),E!==void 0&&a.heldBy(s,K,o,E),q=g&&m>10?q+M:0;const _=q>30&&!t.tethered,B=y.length>0&&y[y.length-1].burning!==I;if(l%x===0||l===v||B||_){const h=n.t+Math.round(m*1e3);B&&y.push({t:h-1,x:s.x,y:s.y,z:s.z,widthM:H,burning:!I,flame:j}),y.push({t:h,x:s.x,y:s.y,z:s.z,widthM:H,burning:I,flame:j})}if(_){w="landed";break}}return{samples:y,end:w}}static heldBy(e,n,r,t){const c=e.x-n.x,o=e.y-n.y,d=e.z-r,i=Math.hypot(c,o,d);if(i<=t||i===0)return;const f=c/i,p=o/i,u=d/i;e.x=n.x+f*t,e.y=n.y+p*t,e.z=r+u*t;const M=e.vx*f+e.vy*p+e.vz*u;M>0&&(e.vx-=M*f,e.vy-=M*p,e.vz-=M*u)}static balloonBodies(e,n,r,t){const{samples:c,end:o}=a.trajectory(e,n),d=a.balloonBody(e,n,r,t,c),i=a.typeOf(e);return o==="lit"&&i.torch?[d,a.torchBody(e,n,d.id,c[c.length-1],i.torch)]:[d]}static torchBody(e,n,r,t,c){const o=e.site.altitudeM??0,d=a.TORCH_FLAME_M/2,i=[];let f=t.x,p=t.y,u=t.z;const M=a.randomFrom(a.seedOf(n)^1374496523),v={degrees:4+4*M(),periodS:2+2*M(),phase:2*Math.PI*M()};for(let x=0;;x++){const K=x<c.burnS*.9?1:x<c.burnS?(c.burnS-x)/(c.burnS*.1):0,E=2*Math.PI*x/v.periodS+v.phase;if(i.push({t:t.t+x*1e3,eastM:a.round(f),northM:a.round(p),altitudeM:a.round(u),...x===0?{sizeM:a.TORCH_SIZE,present:!0,appearance:{color:"#d8d2c4",albedo:.6}}:{},attitude:{pitchDeg:a.round(v.degrees*Math.sin(E),10),rollDeg:a.round(v.degrees*Math.cos(E),10)},lights:{"light-flame":a.round(c.candela*K/(Math.PI*d*d),1)}}),u<=o)break;const T=a.windAt(e,u-o);f+=T.x,p+=T.y,u=Math.max(o,u-c.fallMS)}return i.push({t:i[i.length-1].t+1,present:!1}),{id:`${r}-torch`,title:a.TORCH_TITLE,...e.explains?{explains:e.explains}:{},model:{id:"ufoathome-balloon-torch"},modelParameters:{flameColor:c.color},track:i}}static TORCH_SIZE={widthM:1.2,lengthM:1.2,heightM:1.6};static TORCH_FLAME_M=.2;static TORCH_TITLE={en:"Hygroscopic torch",fr:"Torche hygroscopique",es:"Antorcha higroscópica",it:"Torcia igroscopica"};static balloonBody(e,n,r,t,c){const o=a.typeOf(e),d=n.color??e.color??(o.glow?o.glow.color:o.color),i=o.depthRatio??1,f=e.lit&&o.lamp?o.lamp:void 0,p=s=>o.glow?o.glow.candela/(Math.PI*s*s/4):0,u=a.randomFrom(a.seedOf(n)^2654435769),M=o.spins?(5+15*u())*(u()<.5?-1:1):0,v=360*u(),x=o.sways?{degrees:3+4*u(),periodS:3+3*u(),phase:2*Math.PI*u()}:void 0,K=s=>{if(M===0&&!x)return;const S=(s-n.t)/1e3,P=x?2*Math.PI*S/x.periodS+x.phase:0;return{...M!==0?{headingDeg:a.round(((v+M*S)%360+360)%360,10)}:{},...x?{pitchDeg:a.round(x.degrees*Math.sin(P),10),rollDeg:a.round(x.degrees*Math.cos(P*.83),10)}:{}}},E=a.flamesOf(e,o),T=e.partColors?.flame??o.flames?.color;let O=-1;const A=c.map((s,S)=>{const P=Math.abs(s.widthM-O)>O*.005;P&&(O=s.widthM);const y={widthM:a.round(s.widthM,1e3),lengthM:a.round(s.widthM*i,1e3),heightM:a.round(s.widthM*o.aspect,1e3)},k={t:s.t,eastM:a.round(s.x),northM:a.round(s.y),altitudeM:a.round(s.z),...S===0?{present:!0}:{},...P?{sizeM:y}:{},...K(s.t)?{attitude:K(s.t)}:{},...S===0?{appearance:{color:d,albedo:o.albedo,...o.finish?{finish:o.finish}:{},...o.glow?{luminanceCdM2:p(s.widthM)}:{}}}:o.glow&&P?{appearance:{color:d,luminanceCdM2:a.round(p(s.widthM),100)}}:{}},w=a.lightsOf(o,s.burning,f,s.widthM,E,s.flame);return w&&(k.lights=w),k});A.push({t:c[c.length-1].t+1,present:!1});const D=e.title??a.TITLES[o.id],V=e.explainsEach?e.explainsEach[r]!==void 0?{explains:[e.explainsEach[r]]}:{}:{...e.explains?{explains:e.explains}:{},...t>1?{ensemble:e.id}:{}},z={envelopeColor:d};o.stripeColor&&(z.stripeColor=o.stripeColor),f&&(z.lampColor=f.color),T&&(z.flameColor=T);for(const[s,S]of Object.entries(e.partColors??{}))z[`${s}Color`]=S;return{id:t>1?`${e.id}-${r+1}`:e.id,title:D,...V,model:{id:o.modelId},modelParameters:z,...o.id==="hot-air"?{sound:{kind:"balloon"}}:{},altitudeFrom:{eastM:c[0].x,northM:c[0].y},track:A}}static lightsOf(e,n,r,t,c=0,o=0){if(e.flames){const d=t/50,i={};for(let f=1;f<=a.MAX_FLAMES;f++)i[`light-flame-${f}`]=f<=c?a.round(e.flames.candela*o/(Math.PI*d*d),1):0;return i.envelope=a.round(e.flames.candela*c*o*.5/(Math.PI*t/2*t*e.aspect/2),1e3),i}if(e.burner){const d=n?e.burner.envelopeCdM2:0;return{flame:n?e.burner.flameCdM2:0,envelope:d,"envelope-stripe":d}}if(e.modelId==="ufoathome-balloon-latex"){const d=t/40;return{"light-lamp":r?a.round(r.candela/(Math.PI*d*d),1):0}}}static seedOf(e){return e.seed!==void 0?e.seed:Math.round(e.t)*2654435761+Math.round((e.eastM??0)*100)*40503+Math.round((e.northM??0)*100)>>>0}static gusts(e,n,r){const t=a.randomFrom(n),c=()=>Math.sqrt(-2*Math.log(Math.max(1e-12,t())))*Math.cos(2*Math.PI*t()),o=e.timescaleS>0?Math.exp(-r/e.timescaleS):0,d=Math.sqrt(1-o*o),i={x:e.horizontalMS*c(),y:e.horizontalMS*c(),z:e.verticalMS*c()};return()=>(i.x=o*i.x+d*e.horizontalMS*c(),i.y=o*i.y+d*e.horizontalMS*c(),i.z=o*i.z+d*e.verticalMS*c(),i)}static randomFrom(e){let n=e>>>0;return()=>{n=n+1831565813>>>0;let r=n;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}static round(e,n=100){return Math.round(e*n)/n}}export{a as BalloonFlight};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as k,_ as c,b6 as T,bE as w,bF as M}from"./rr0-scene.mjs";import{d as u,P as y,S as I,a as O,c as x,b as F,E as A}from"./ParameterForm-CRC9iA-m.js";import{B as v,a as m,F as S}from"./BirdFlock-CfJeXvWu.js";import{T as E}from"./TimelineTracks-iym9uOfD.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(r=>r.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:()=>S.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),[r,a]=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||a.t===r.t?0:(e-r.t)/(a.t-r.t),d=h??r,b=h??a;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,I.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 F.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{e as k,_ as c,b6 as T,bD as w,bE as M}from"./rr0-scene.mjs";import{d as u,P as y,S as I,a as O,c as x,b as F,E as A}from"./ParameterForm-CRC9iA-m.js";import{B as v,a as m,F as S}from"./BirdFlock-L3dYU2K_.js";import{T as E}from"./TimelineTracks-iym9uOfD.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(r=>r.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:()=>S.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),[r,a]=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||a.t===r.t?0:(e-r.t)/(a.t-r.t),d=h??r,b=h??a;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,I.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 F.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{bB as jt}from"./rr0-scene.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{bA as jt}from"./rr0-scene.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,4 +1,4 @@
|
|
|
1
|
-
import{e as g,_ as h,b6 as x,
|
|
1
|
+
import{e as g,_ as h,b6 as x,bD as v,bE as P}from"./rr0-scene.mjs";import{S as _,P as w,a as m,c as f,b as T,E as b}from"./ParameterForm-CRC9iA-m.js";import{D as p}from"./DroneParameters-CoWQympS.js";import{T as O}from"./TimelineTracks-iym9uOfD.js";import"./DroneFlight-ERYah68l.js";const I=g.catalog({en:()=>h(()=>import("./DroneParameterTexts_en-sL1dR2RG.js"),[],import.meta.url).then(o=>o.droneParameterTexts_en),fr:()=>h(()=>import("./DroneParameterTexts_fr-B8Ym7Yz6.js"),[],import.meta.url).then(o=>o.droneParameterTexts_fr),es:()=>h(()=>import("./DroneParameterTexts_es-Bg8_8XVE.js"),[],import.meta.url).then(o=>o.droneParameterTexts_es),it:()=>h(()=>import("./DroneParameterTexts_it-DfvWjvoc.js"),[],import.meta.url).then(o=>o.droneParameterTexts_it)}),y=g.catalog({en:()=>h(()=>import("./DroneEditorMessages_en-BViHK30c.js"),[],import.meta.url).then(o=>o.droneEditorMessages_en),fr:()=>h(()=>import("./DroneEditorMessages_fr-CvV0RyOT.js"),[],import.meta.url).then(o=>o.droneEditorMessages_fr),es:()=>h(()=>import("./DroneEditorMessages_es-D6bhIOAa.js"),[],import.meta.url).then(o=>o.droneEditorMessages_es),it:()=>h(()=>import("./DroneEditorMessages_it-CYi-jmVN.js"),[],import.meta.url).then(o=>o.droneEditorMessages_it)});class d{constructor(t,i,e){this.container=t,this.host=i,_.attach(t,"drone-editor-part",d.STYLE),this.language=e,w.of("drones")||p.publish(),this.ready=this.setLanguage(e)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;timeline;pointForm;pointIndex=0;language;shown=[];static STYLE='.drone-editor-part { flex-basis: 100%; min-width: 0; } .drone-editor-part #drone-list, .drone-editor-part #drone-timeline { flex-basis: 100%; min-width: 0; } .drone-editor-part #drone-timeline { padding: 4px 0; } .drone-editor-part #drone-path > .icon-btn { align-self: flex-end; } .drone-editor-part .launch-editor, .drone-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .drone-editor-part .launch-fields { flex-basis: 100%; min-width: 0; } .drone-editor-part [hidden] { display: none !important; } .drone-editor-part select { min-width: 0; width: 100%; } .drone-editor-part .launch-intro { flex-basis: 100%; margin: 0; } .drone-editor-part .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .drone-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; } .drone-editor-part input, .drone-editor-part select { max-width: 100%; box-sizing: border-box; } .drone-editor-part input[type="text"] { width: 12em; } .drone-editor-part label { min-width: 0; max-width: 100%; } .drone-editor-part input.parameter-derived::placeholder { opacity: .65; } .drone-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 i=++this.languageToken;this.language=t;const[e,s]=await Promise.all([y.load(t),I.load(t)]);i===this.languageToken&&(this.messages=e,this.parameterTexts=s,this.render(),this.sync())}sync(){if(!this.messages)return;const t=this.flights;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 i=this.current;if(this.element("drone-fields").hidden=i===void 0,!i)return;const e=this.element("drone-each");e.hidden=i.explainsEach===void 0,e.textContent=this.messages.explainsEachNote.replace("{n}",String(i.explainsEach?.length??0)),this.form??=new m(this.element("drone-parameters"),this.language,"drones.",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(this.resolved(p.SET),new f(()=>this.current,s=>this.editFlight(n=>s(n)),()=>({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.flights;if(t.length===this.shown.length&&t.every((i,e)=>i.id===this.shown[e].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.flights.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="drone-list"></div>
|
|
4
4
|
<div id="drone-fields" class="launch-fields">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bG as T}from"./rr0-scene.mjs";class O{static G=9.81;static ALL=[{id:"quadcopter",modelId:"ufoathome-drone-quadcopter",sizeM:{widthM:.508,lengthM:.493,heightM:.093},hovers:!0,maxSpeedMS:21,maxTiltDeg:35,holdM:{horizontalM:.5,verticalM:.5},yawRateDegS:120,bodyColor:"#5b5f63",lights:{front:{color:"#ff2a1a",candela:1,leds:[{at:[-.125,-.03,-.14],radiusM:.004},{at:[.125,-.03,-.14],radiusM:.004}]},rear:{color:"#2aff5a",candela:1,hz:.5,leds:[{at:[0,.005,.135],radiusM:.004}]},strobe:{color:"#ffffff",candela:40,hz:1.25,flashS:.06,leds:[{at:[0,-.034,.05],radiusM:.006}]}}},{id:"saucer",modelId:"ufoathome-drone-saucer",sizeM:{widthM:.8,lengthM:.8,heightM:.206},hovers:!0,maxSpeedMS:12,maxTiltDeg:25,holdM:{horizontalM:.5,verticalM:.5},yawRateDegS:90,bodyColor:"#c9ccd0",lights:{rim:{color:"#4fd2ff",candela:1,leds:O.ring(12,.388,0,.012)},under:{color:"#ffffff",candela:3,leds:[{at:[0,-.094,0],radiusM:.02}]},strobe:{color:"#ffffff",candela:40,hz:1.25,flashS:.06,off:!0,leds:[{at:[0,.1,0],radiusM:.006}]}}},{id:"fixed-wing",modelId:"ufoathome-drone-fixed-wing",sizeM:{widthM:3.596,lengthM:1.848,heightM:.53},hovers:!1,maxSpeedMS:33,maxTiltDeg:0,holdM:{horizontalM:1,verticalM:.5},yawRateDegS:0,bodyColor:"#6f7568",lights:{"nav-left":{color:"#ff2a1a",candela:2,leds:[{at:[-1.79,.02,.05],radiusM:.008}]},"nav-right":{color:"#2aff5a",candela:2,leds:[{at:[1.79,.02,.05],radiusM:.008}]},tail:{color:"#ffffff",candela:1,leds:[{at:[0,.05,.94],radiusM:.008}]},strobe:{color:"#ffffff",candela:40,hz:1,flashS:.06,leds:[{at:[0,-.1,.1],radiusM:.008}]}}}];static byId(t){return O.ALL.find(a=>a.id===t)}static materialOf(t,a,e){return e>1?`light-${t}-${a+1}`:`light-${t}`}static colourKeyOf(t){return t.replace(/-([a-z])/g,(a,e)=>e.toUpperCase())+"Color"}static ring(t,a,e,n){return Array.from({length:t},(s,M)=>{const r=M/t*2*Math.PI;return{at:[Math.round(a*Math.sin(r)*1e4)/1e4,e,Math.round(-a*Math.cos(r)*1e4)/1e4],radiusM:n}})}}class i{static SAMPLE_MS=100;static MAX_KEYFRAMES=6e4;static computed=new Map;static bodiesOf(t){const a=JSON.stringify(t);let e=i.computed.get(a);return e||(e=i.compute(t),i.computed.set(a,e),i.computed.size>16&&i.computed.delete(i.computed.keys().next().value)),e}static airframeOf(t){return O.byId(t.airframe)??O.ALL[0]}static lightsOf(t){const a=i.airframeOf(t),e={};for(const[n,s]of Object.entries(a.lights)){const M=t.lights?.[n];if(M===!1)continue;const r={...s,...M??{}};r.off||(e[n]=r)}return e}static compute(t){const a=i.pathOf(t);if(a.length===0)return[];const e=i.airframeOf(t),n=new j(a,e.hovers),s=Math.max(1,Math.floor(t.count??1)),M=i.randomFrom(t.seed??1),r=a[0].t,c=Math.max(a[a.length-1].t,r),d=i.sampleMs(s,c-r),u=i.offsetsOf(t.formation??{kind:s>1?"cluster":"single"},s,M),f=i.lightsOf(t),y={bodyColor:t.bodyColor??e.bodyColor};for(const[m,o]of Object.entries(f))y[O.colourKeyOf(m)]=o.color;const S=t.formation?.kind==="line";return u.map((m,o)=>{const h=i.swayFrom(M,e.holdM),p=Object.fromEntries(Object.entries(f).map(([l,b])=>[l,b.phase??(s>1?M():0)])),g=l=>{const b=n.at(l),[z,I,N]=h((l-r)/1e3);let k=m.eastM,C=m.northM;if(S){const D=n.velocityAt(l),R=Math.hypot(D.east,D.north)>.3?Math.atan2(D.east,D.north):n.headingAtRest(l);k=Math.cos(R)*m.rightM,C=-Math.sin(R)*m.rightM}return{eastM:b.eastM+k+z,northM:b.northM+C+I,upM:b.upM+m.upM+N}},w=[];for(let l=r;l<=c+1e-6;l+=d)w.push(l);w[w.length-1]<c&&w.push(c);const x=i.attitudes(w.map(l=>({t:l,...g(l),headingDeg:0,pitchDeg:0,rollDeg:0})),e,t),P=i.switchesOf(f,p,r,c),E=[...new Set([...w.map(l=>Math.round(l)),...P])].filter(l=>l>=r&&l<=c).sort((l,b)=>l-b);let v=0;const A=E.map((l,b)=>{for(;v<x.length-2&&x[v+1].t<=l;)v++;const z=i.between(x[v],x[Math.min(x.length-1,v+1)],l,g);return{t:l,eastM:i.round(z.eastM),northM:i.round(z.northM),altitudeM:i.round(z.upM-e.sizeM.heightM/2),...b===0?{sizeM:e.sizeM}:{},attitude:{headingDeg:i.round(z.headingDeg,10),pitchDeg:i.round(z.pitchDeg,10),rollDeg:i.round(z.rollDeg,10)},lights:i.luminancesAt(f,p,l,E[b+1]===l+1)}});return{id:s>1?`${t.id}-${o+1}`:t.id,...t.title?{title:t.title}:{},...t.explainsEach?t.explainsEach[o]!==void 0?{explains:[t.explainsEach[o]]}:{}:{...t.explains?{explains:t.explains}:{},...s>1?{ensemble:t.id}:{}},model:{id:e.modelId},modelParameters:y,lamps:i.lampsOf(f,p),...t.silent?{}:{sound:{kind:"unmanned",...t.quieterDb?{quieterDb:t.quieterDb}:{}}},track:A}})}static lampsOf(t,a){return Object.entries(t).flatMap(([e,n])=>n.leds.map((s,M)=>{const r=n.hz>0,c=r?1/n.hz:0;return{id:O.materialOf(e,M,n.leds.length),offsetM:{x:s.at[0],y:s.at[1],z:-s.at[2]},color:n.color,intensity:n.candela/T,pattern:r?{kind:"flash",perMinute:n.hz*60,dutyCycle:Math.min(1,(n.flashS??.5*c)/c),phase:((1-(a[e]??0))%1+1)%1}:{kind:"steady"}}}))}static luminancesAt(t,a,e,n=!1){const s={};for(const[M,r]of Object.entries(t)){const c=i.isOn(r,a[M]??0,n?e-1:e+.5);r.leds.forEach((d,u)=>{s[O.materialOf(M,u,r.leds.length)]=c?i.round(r.candela/(Math.PI*d.radiusM**2),1):0})}return s}static isOn(t,a,e){if(!(t.hz>0))return!0;const n=1e3/t.hz,s=Math.min(n,(t.flashS??.5/t.hz)*1e3);return((e/n-a)%1+1)%1*n<s}static switchesOf(t,a,e,n){const s=[];for(const[M,r]of Object.entries(t)){if(!(r.hz>0))continue;const c=1e3/r.hz,d=Math.min(c,(r.flashS??.5/r.hz)*1e3);if(d>=c)continue;const u=(a[M]??0)*c;for(let f=Math.floor((e-u)/c)*c+u;f<=n;f+=c)for(const y of[f,f+d]){const S=Math.round(y);S>=e&&S<n&&s.push(S,S+1)}}return s}static sampleMs(t,a){const e=t*(a/i.SAMPLE_MS+1);return e<=i.MAX_KEYFRAMES?i.SAMPLE_MS:Math.ceil(i.SAMPLE_MS*e/i.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,n=a.altitudeDeg*Math.PI/180,s=a.distanceM*Math.cos(n);return{t:a.t,eastM:s*Math.sin(e),northM:s*Math.cos(e),upM:(a.eyeHeightM??1.6)+a.distanceM*Math.sin(n)}})}static offsetsOf(t,a,e){if(t.kind==="single"||a===1)return[{eastM:0,northM:0,upM:0,rightM:0}];if(t.kind==="line"){const c=t.spacingM??5;return Array.from({length:a},(d,u)=>({eastM:0,northM:0,upM:(e()-.5)*c*.2,rightM:(u-(a-1)/2)*c}))}const n=t.spacingM??10,s=Math.cbrt(a*n**3/(4/3*Math.PI*2*2*1)),M=[];let r=0;for(;M.length<a&&r<a*200;){r++;const c=2*e()-1,d=2*e()-1,u=2*e()-1;if(c*c+d*d+u*u>1)continue;const f={eastM:c*2*s,northM:d*2*s,upM:u*s,rightM:0};M.some(y=>(y.eastM-f.eastM)**2+(y.northM-f.northM)**2+(y.upM-f.upM)**2<(n/2)**2)||M.push(f)}for(;M.length<a;)M.push({eastM:(e()-.5)*4*s,northM:(e()-.5)*4*s,upM:0,rightM:0});return M}static swayFrom(t,a){const e=[a.horizontalM,a.horizontalM,a.verticalM].map(n=>[0,1].map(()=>({period:4+t()*10,phase:t()*2*Math.PI,amplitude:n*.5*(.5+.5*t())})));return n=>e.map(s=>s.reduce((M,r)=>M+r.amplitude*Math.sin(2*Math.PI*n/r.period+r.phase),0))}static attitudes(t,a,e){const n=t.length;if(n===0)return t;const s=O.G,M=(e.wind?.fromDeg??0)*Math.PI/180,r=-(e.wind?.speedMS??0)*Math.sin(M),c=-(e.wind?.speedMS??0)*Math.cos(M),d=o=>{const h=t[Math.max(0,o-1)],p=t[Math.min(n-1,o+1)],g=Math.max((p.t-h.t)/1e3,.001);return{e:(p.eastM-h.eastM)/g,n:(p.northM-h.northM)/g,u:(p.upM-h.upM)/g}},u=t.map((o,h)=>d(h)),f=o=>{const h=u[Math.max(0,o-1)],p=u[Math.min(n-1,o+1)],g=Math.max((t[Math.min(n-1,o+1)].t-t[Math.max(0,o-1)].t)/1e3,.001);return{e:(p.e-h.e)/g,n:(p.n-h.n)/g,u:(p.u-h.u)/g}};if(!a.hovers){for(let o=0;o<n;o++){const h=u[o],p=h.e-r,g=h.n-c,w=Math.hypot(h.e,h.n);t[o].headingDeg=Math.hypot(p,g)>.5?(Math.atan2(p,g)*180/Math.PI+360)%360:o>0?t[o-1].headingDeg:0,t[o].pitchDeg=Math.atan2(h.u,Math.max(w,1))*180/Math.PI+2;const x=f(o),P=w>.5?(x.e*h.n-x.n*h.e)/w:0;t[o].rollDeg=Math.max(-45,Math.min(45,Math.atan(P/s)*180/Math.PI))}return t}const y=s*Math.tan(a.maxTiltDeg*Math.PI/180)/a.maxSpeedMS**2,S=a.yawRateDegS*i.SAMPLE_MS/1e3;let m=e.headingDeg;if(m===void 0){const o=u.find(h=>Math.hypot(h.e,h.n)>1);m=o?(Math.atan2(o.e,o.n)*180/Math.PI+360)%360:0}for(let o=0;o<n;o++){const h=u[o];if(e.headingDeg===void 0&&Math.hypot(h.e,h.n)>1){const z=((Math.atan2(h.e,h.n)*180/Math.PI+360)%360-m+540)%360-180,I=o>0?(t[o].t-t[o-1].t)/i.SAMPLE_MS:1;m=(m+Math.max(-S*I,Math.min(S*I,z))+360)%360}const p=f(o),g=h.e-r,w=h.n-c,x=Math.hypot(g,w),P=p.e+y*x*g,E=p.n+y*x*w,v=Math.max(s+p.u,.2*s),A=m*Math.PI/180,L=P*Math.sin(A)+E*Math.cos(A),l=P*Math.cos(A)-E*Math.sin(A);t[o].headingDeg=m,t[o].pitchDeg=-Math.atan(L/v)*180/Math.PI,t[o].rollDeg=Math.atan(l/v)*180/Math.PI}return t}static between(t,a,e,n){if(e===t.t)return t;if(e===a.t)return a;const s=a.t===t.t?0:Math.min(1,Math.max(0,(e-t.t)/(a.t-t.t))),M=(a.headingDeg-t.headingDeg+540)%360-180;return{t:e,...n(e),headingDeg:(t.headingDeg+M*s+360)%360,pitchDeg:t.pitchDeg+(a.pitchDeg-t.pitchDeg)*s,rollDeg:t.rollDeg+(a.rollDeg-t.rollDeg)*s}}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 j{constructor(t,a){this.points=t,this.hovers=a;const e=t;this.speeds=e.map((n,s)=>{const M=e[s-1],r=e[s+1],c=(h,p)=>{const g=Math.max((p.t-h.t)/1e3,.001);return{e:(p.eastM-h.eastM)/g,n:(p.northM-h.northM)/g,u:(p.upM-h.upM)/g}};if(!M||!r)return a||e.length<2?{e:0,n:0,u:0}:M?c(M,n):c(n,r);const d=c(M,n),u=c(n,r),f=Math.hypot(d.e,d.n,d.u),y=Math.hypot(u.e,u.n,u.u);if(a&&(f<.05||y<.05||d.e*u.e+d.n*u.n+d.u*u.u<0))return{e:0,n:0,u:0};const S=n.t-M.t,m=r.t-n.t,o=S/Math.max(S+m,1);return{e:d.e*(1-o)+u.e*o,n:d.n*(1-o)+u.n*o,u:d.u*(1-o)+u.u*o}})}speeds;at(t){const a=this.points;if(a.length===1)return{...a[0],t};if(t<=a[0].t)return this.outside(t,0);if(t>=a[a.length-1].t)return this.outside(t,a.length-1);let e=0;for(;e<a.length-2&&t>a[e+1].t;)e++;const n=a[e],s=a[e+1],M=Math.max((s.t-n.t)/1e3,.001),r=(t-n.t)/(s.t-n.t),c=r*r,d=c*r,u=2*d-3*c+1,f=d-2*c+r,y=-2*d+3*c,S=d-c,m=this.speeds[e],o=this.speeds[e+1];return{t,eastM:u*n.eastM+f*m.e*M+y*s.eastM+S*o.e*M,northM:u*n.northM+f*m.n*M+y*s.northM+S*o.n*M,upM:u*n.upM+f*m.u*M+y*s.upM+S*o.u*M}}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}}headingAtRest(t){const a=this.points;for(let e=a.length-1;e>0;e--){if(a[e].t>t&&e>1)continue;const n=a[e].eastM-a[e-1].eastM,s=a[e].northM-a[e-1].northM;if(Math.hypot(n,s)>.1)return Math.atan2(n,s)}for(let e=1;e<a.length;e++){const n=a[e].eastM-a[e-1].eastM,s=a[e].northM-a[e-1].northM;if(Math.hypot(n,s)>.1)return Math.atan2(n,s)}return 0}outside(t,a){const e=this.points[a];if(this.hovers)return{...e,t};const n=this.speeds[a],s=(t-e.t)/1e3;return{t,eastM:e.eastM+n.e*s,northM:e.northM+n.n*s,upM:e.upM+n.u*s}}}const K=Object.freeze(Object.defineProperty({__proto__:null,DroneFlight:i,DronePath:j},Symbol.toStringTag,{value:"Module"}));export{O as D,i as a,j as b,K as c};
|
|
1
|
+
import{bF as T}from"./rr0-scene.mjs";class O{static G=9.81;static ALL=[{id:"quadcopter",modelId:"ufoathome-drone-quadcopter",sizeM:{widthM:.508,lengthM:.493,heightM:.093},hovers:!0,maxSpeedMS:21,maxTiltDeg:35,holdM:{horizontalM:.5,verticalM:.5},yawRateDegS:120,bodyColor:"#5b5f63",lights:{front:{color:"#ff2a1a",candela:1,leds:[{at:[-.125,-.03,-.14],radiusM:.004},{at:[.125,-.03,-.14],radiusM:.004}]},rear:{color:"#2aff5a",candela:1,hz:.5,leds:[{at:[0,.005,.135],radiusM:.004}]},strobe:{color:"#ffffff",candela:40,hz:1.25,flashS:.06,leds:[{at:[0,-.034,.05],radiusM:.006}]}}},{id:"saucer",modelId:"ufoathome-drone-saucer",sizeM:{widthM:.8,lengthM:.8,heightM:.206},hovers:!0,maxSpeedMS:12,maxTiltDeg:25,holdM:{horizontalM:.5,verticalM:.5},yawRateDegS:90,bodyColor:"#c9ccd0",lights:{rim:{color:"#4fd2ff",candela:1,leds:O.ring(12,.388,0,.012)},under:{color:"#ffffff",candela:3,leds:[{at:[0,-.094,0],radiusM:.02}]},strobe:{color:"#ffffff",candela:40,hz:1.25,flashS:.06,off:!0,leds:[{at:[0,.1,0],radiusM:.006}]}}},{id:"fixed-wing",modelId:"ufoathome-drone-fixed-wing",sizeM:{widthM:3.596,lengthM:1.848,heightM:.53},hovers:!1,maxSpeedMS:33,maxTiltDeg:0,holdM:{horizontalM:1,verticalM:.5},yawRateDegS:0,bodyColor:"#6f7568",lights:{"nav-left":{color:"#ff2a1a",candela:2,leds:[{at:[-1.79,.02,.05],radiusM:.008}]},"nav-right":{color:"#2aff5a",candela:2,leds:[{at:[1.79,.02,.05],radiusM:.008}]},tail:{color:"#ffffff",candela:1,leds:[{at:[0,.05,.94],radiusM:.008}]},strobe:{color:"#ffffff",candela:40,hz:1,flashS:.06,leds:[{at:[0,-.1,.1],radiusM:.008}]}}}];static byId(t){return O.ALL.find(a=>a.id===t)}static materialOf(t,a,e){return e>1?`light-${t}-${a+1}`:`light-${t}`}static colourKeyOf(t){return t.replace(/-([a-z])/g,(a,e)=>e.toUpperCase())+"Color"}static ring(t,a,e,n){return Array.from({length:t},(s,M)=>{const r=M/t*2*Math.PI;return{at:[Math.round(a*Math.sin(r)*1e4)/1e4,e,Math.round(-a*Math.cos(r)*1e4)/1e4],radiusM:n}})}}class i{static SAMPLE_MS=100;static MAX_KEYFRAMES=6e4;static computed=new Map;static bodiesOf(t){const a=JSON.stringify(t);let e=i.computed.get(a);return e||(e=i.compute(t),i.computed.set(a,e),i.computed.size>16&&i.computed.delete(i.computed.keys().next().value)),e}static airframeOf(t){return O.byId(t.airframe)??O.ALL[0]}static lightsOf(t){const a=i.airframeOf(t),e={};for(const[n,s]of Object.entries(a.lights)){const M=t.lights?.[n];if(M===!1)continue;const r={...s,...M??{}};r.off||(e[n]=r)}return e}static compute(t){const a=i.pathOf(t);if(a.length===0)return[];const e=i.airframeOf(t),n=new j(a,e.hovers),s=Math.max(1,Math.floor(t.count??1)),M=i.randomFrom(t.seed??1),r=a[0].t,c=Math.max(a[a.length-1].t,r),d=i.sampleMs(s,c-r),u=i.offsetsOf(t.formation??{kind:s>1?"cluster":"single"},s,M),f=i.lightsOf(t),y={bodyColor:t.bodyColor??e.bodyColor};for(const[m,o]of Object.entries(f))y[O.colourKeyOf(m)]=o.color;const S=t.formation?.kind==="line";return u.map((m,o)=>{const h=i.swayFrom(M,e.holdM),p=Object.fromEntries(Object.entries(f).map(([l,b])=>[l,b.phase??(s>1?M():0)])),g=l=>{const b=n.at(l),[z,I,N]=h((l-r)/1e3);let k=m.eastM,C=m.northM;if(S){const D=n.velocityAt(l),R=Math.hypot(D.east,D.north)>.3?Math.atan2(D.east,D.north):n.headingAtRest(l);k=Math.cos(R)*m.rightM,C=-Math.sin(R)*m.rightM}return{eastM:b.eastM+k+z,northM:b.northM+C+I,upM:b.upM+m.upM+N}},w=[];for(let l=r;l<=c+1e-6;l+=d)w.push(l);w[w.length-1]<c&&w.push(c);const x=i.attitudes(w.map(l=>({t:l,...g(l),headingDeg:0,pitchDeg:0,rollDeg:0})),e,t),P=i.switchesOf(f,p,r,c),E=[...new Set([...w.map(l=>Math.round(l)),...P])].filter(l=>l>=r&&l<=c).sort((l,b)=>l-b);let v=0;const A=E.map((l,b)=>{for(;v<x.length-2&&x[v+1].t<=l;)v++;const z=i.between(x[v],x[Math.min(x.length-1,v+1)],l,g);return{t:l,eastM:i.round(z.eastM),northM:i.round(z.northM),altitudeM:i.round(z.upM-e.sizeM.heightM/2),...b===0?{sizeM:e.sizeM}:{},attitude:{headingDeg:i.round(z.headingDeg,10),pitchDeg:i.round(z.pitchDeg,10),rollDeg:i.round(z.rollDeg,10)},lights:i.luminancesAt(f,p,l,E[b+1]===l+1)}});return{id:s>1?`${t.id}-${o+1}`:t.id,...t.title?{title:t.title}:{},...t.explainsEach?t.explainsEach[o]!==void 0?{explains:[t.explainsEach[o]]}:{}:{...t.explains?{explains:t.explains}:{},...s>1?{ensemble:t.id}:{}},model:{id:e.modelId},modelParameters:y,lamps:i.lampsOf(f,p),...t.silent?{}:{sound:{kind:"unmanned",...t.quieterDb?{quieterDb:t.quieterDb}:{}}},track:A}})}static lampsOf(t,a){return Object.entries(t).flatMap(([e,n])=>n.leds.map((s,M)=>{const r=n.hz>0,c=r?1/n.hz:0;return{id:O.materialOf(e,M,n.leds.length),offsetM:{x:s.at[0],y:s.at[1],z:-s.at[2]},color:n.color,intensity:n.candela/T,pattern:r?{kind:"flash",perMinute:n.hz*60,dutyCycle:Math.min(1,(n.flashS??.5*c)/c),phase:((1-(a[e]??0))%1+1)%1}:{kind:"steady"}}}))}static luminancesAt(t,a,e,n=!1){const s={};for(const[M,r]of Object.entries(t)){const c=i.isOn(r,a[M]??0,n?e-1:e+.5);r.leds.forEach((d,u)=>{s[O.materialOf(M,u,r.leds.length)]=c?i.round(r.candela/(Math.PI*d.radiusM**2),1):0})}return s}static isOn(t,a,e){if(!(t.hz>0))return!0;const n=1e3/t.hz,s=Math.min(n,(t.flashS??.5/t.hz)*1e3);return((e/n-a)%1+1)%1*n<s}static switchesOf(t,a,e,n){const s=[];for(const[M,r]of Object.entries(t)){if(!(r.hz>0))continue;const c=1e3/r.hz,d=Math.min(c,(r.flashS??.5/r.hz)*1e3);if(d>=c)continue;const u=(a[M]??0)*c;for(let f=Math.floor((e-u)/c)*c+u;f<=n;f+=c)for(const y of[f,f+d]){const S=Math.round(y);S>=e&&S<n&&s.push(S,S+1)}}return s}static sampleMs(t,a){const e=t*(a/i.SAMPLE_MS+1);return e<=i.MAX_KEYFRAMES?i.SAMPLE_MS:Math.ceil(i.SAMPLE_MS*e/i.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,n=a.altitudeDeg*Math.PI/180,s=a.distanceM*Math.cos(n);return{t:a.t,eastM:s*Math.sin(e),northM:s*Math.cos(e),upM:(a.eyeHeightM??1.6)+a.distanceM*Math.sin(n)}})}static offsetsOf(t,a,e){if(t.kind==="single"||a===1)return[{eastM:0,northM:0,upM:0,rightM:0}];if(t.kind==="line"){const c=t.spacingM??5;return Array.from({length:a},(d,u)=>({eastM:0,northM:0,upM:(e()-.5)*c*.2,rightM:(u-(a-1)/2)*c}))}const n=t.spacingM??10,s=Math.cbrt(a*n**3/(4/3*Math.PI*2*2*1)),M=[];let r=0;for(;M.length<a&&r<a*200;){r++;const c=2*e()-1,d=2*e()-1,u=2*e()-1;if(c*c+d*d+u*u>1)continue;const f={eastM:c*2*s,northM:d*2*s,upM:u*s,rightM:0};M.some(y=>(y.eastM-f.eastM)**2+(y.northM-f.northM)**2+(y.upM-f.upM)**2<(n/2)**2)||M.push(f)}for(;M.length<a;)M.push({eastM:(e()-.5)*4*s,northM:(e()-.5)*4*s,upM:0,rightM:0});return M}static swayFrom(t,a){const e=[a.horizontalM,a.horizontalM,a.verticalM].map(n=>[0,1].map(()=>({period:4+t()*10,phase:t()*2*Math.PI,amplitude:n*.5*(.5+.5*t())})));return n=>e.map(s=>s.reduce((M,r)=>M+r.amplitude*Math.sin(2*Math.PI*n/r.period+r.phase),0))}static attitudes(t,a,e){const n=t.length;if(n===0)return t;const s=O.G,M=(e.wind?.fromDeg??0)*Math.PI/180,r=-(e.wind?.speedMS??0)*Math.sin(M),c=-(e.wind?.speedMS??0)*Math.cos(M),d=o=>{const h=t[Math.max(0,o-1)],p=t[Math.min(n-1,o+1)],g=Math.max((p.t-h.t)/1e3,.001);return{e:(p.eastM-h.eastM)/g,n:(p.northM-h.northM)/g,u:(p.upM-h.upM)/g}},u=t.map((o,h)=>d(h)),f=o=>{const h=u[Math.max(0,o-1)],p=u[Math.min(n-1,o+1)],g=Math.max((t[Math.min(n-1,o+1)].t-t[Math.max(0,o-1)].t)/1e3,.001);return{e:(p.e-h.e)/g,n:(p.n-h.n)/g,u:(p.u-h.u)/g}};if(!a.hovers){for(let o=0;o<n;o++){const h=u[o],p=h.e-r,g=h.n-c,w=Math.hypot(h.e,h.n);t[o].headingDeg=Math.hypot(p,g)>.5?(Math.atan2(p,g)*180/Math.PI+360)%360:o>0?t[o-1].headingDeg:0,t[o].pitchDeg=Math.atan2(h.u,Math.max(w,1))*180/Math.PI+2;const x=f(o),P=w>.5?(x.e*h.n-x.n*h.e)/w:0;t[o].rollDeg=Math.max(-45,Math.min(45,Math.atan(P/s)*180/Math.PI))}return t}const y=s*Math.tan(a.maxTiltDeg*Math.PI/180)/a.maxSpeedMS**2,S=a.yawRateDegS*i.SAMPLE_MS/1e3;let m=e.headingDeg;if(m===void 0){const o=u.find(h=>Math.hypot(h.e,h.n)>1);m=o?(Math.atan2(o.e,o.n)*180/Math.PI+360)%360:0}for(let o=0;o<n;o++){const h=u[o];if(e.headingDeg===void 0&&Math.hypot(h.e,h.n)>1){const z=((Math.atan2(h.e,h.n)*180/Math.PI+360)%360-m+540)%360-180,I=o>0?(t[o].t-t[o-1].t)/i.SAMPLE_MS:1;m=(m+Math.max(-S*I,Math.min(S*I,z))+360)%360}const p=f(o),g=h.e-r,w=h.n-c,x=Math.hypot(g,w),P=p.e+y*x*g,E=p.n+y*x*w,v=Math.max(s+p.u,.2*s),A=m*Math.PI/180,L=P*Math.sin(A)+E*Math.cos(A),l=P*Math.cos(A)-E*Math.sin(A);t[o].headingDeg=m,t[o].pitchDeg=-Math.atan(L/v)*180/Math.PI,t[o].rollDeg=Math.atan(l/v)*180/Math.PI}return t}static between(t,a,e,n){if(e===t.t)return t;if(e===a.t)return a;const s=a.t===t.t?0:Math.min(1,Math.max(0,(e-t.t)/(a.t-t.t))),M=(a.headingDeg-t.headingDeg+540)%360-180;return{t:e,...n(e),headingDeg:(t.headingDeg+M*s+360)%360,pitchDeg:t.pitchDeg+(a.pitchDeg-t.pitchDeg)*s,rollDeg:t.rollDeg+(a.rollDeg-t.rollDeg)*s}}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 j{constructor(t,a){this.points=t,this.hovers=a;const e=t;this.speeds=e.map((n,s)=>{const M=e[s-1],r=e[s+1],c=(h,p)=>{const g=Math.max((p.t-h.t)/1e3,.001);return{e:(p.eastM-h.eastM)/g,n:(p.northM-h.northM)/g,u:(p.upM-h.upM)/g}};if(!M||!r)return a||e.length<2?{e:0,n:0,u:0}:M?c(M,n):c(n,r);const d=c(M,n),u=c(n,r),f=Math.hypot(d.e,d.n,d.u),y=Math.hypot(u.e,u.n,u.u);if(a&&(f<.05||y<.05||d.e*u.e+d.n*u.n+d.u*u.u<0))return{e:0,n:0,u:0};const S=n.t-M.t,m=r.t-n.t,o=S/Math.max(S+m,1);return{e:d.e*(1-o)+u.e*o,n:d.n*(1-o)+u.n*o,u:d.u*(1-o)+u.u*o}})}speeds;at(t){const a=this.points;if(a.length===1)return{...a[0],t};if(t<=a[0].t)return this.outside(t,0);if(t>=a[a.length-1].t)return this.outside(t,a.length-1);let e=0;for(;e<a.length-2&&t>a[e+1].t;)e++;const n=a[e],s=a[e+1],M=Math.max((s.t-n.t)/1e3,.001),r=(t-n.t)/(s.t-n.t),c=r*r,d=c*r,u=2*d-3*c+1,f=d-2*c+r,y=-2*d+3*c,S=d-c,m=this.speeds[e],o=this.speeds[e+1];return{t,eastM:u*n.eastM+f*m.e*M+y*s.eastM+S*o.e*M,northM:u*n.northM+f*m.n*M+y*s.northM+S*o.n*M,upM:u*n.upM+f*m.u*M+y*s.upM+S*o.u*M}}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}}headingAtRest(t){const a=this.points;for(let e=a.length-1;e>0;e--){if(a[e].t>t&&e>1)continue;const n=a[e].eastM-a[e-1].eastM,s=a[e].northM-a[e-1].northM;if(Math.hypot(n,s)>.1)return Math.atan2(n,s)}for(let e=1;e<a.length;e++){const n=a[e].eastM-a[e-1].eastM,s=a[e].northM-a[e-1].northM;if(Math.hypot(n,s)>.1)return Math.atan2(n,s)}return 0}outside(t,a){const e=this.points[a];if(this.hovers)return{...e,t};const n=this.speeds[a],s=(t-e.t)/1e3;return{t,eastM:e.eastM+n.e*s,northM:e.northM+n.n*s,upM:e.upM+n.u*s}}}const K=Object.freeze(Object.defineProperty({__proto__:null,DroneFlight:i,DronePath:j},Symbol.toStringTag,{value:"Module"}));export{O as D,i as a,j as b,K as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as o,P as f}from"./ParameterForm-CRC9iA-m.js";import{D as c,a,b}from"./DroneFlight-
|
|
1
|
+
import{d as o,P as f}from"./ParameterForm-CRC9iA-m.js";import{D as c,a,b}from"./DroneFlight-ERYah68l.js";class e{static DRONE="drone";static FLIGHT="flight";static LOOK="look";static LIGHT_NAMES=[...new Set(c.ALL.flatMap(t=>Object.keys(t.lights)))];static textKey(t){return t.replace(/-([a-z])/g,(l,s)=>s.toUpperCase())}static flightOf(t){return t}static ownLight(t,l){return a.airframeOf(e.flightOf(t)).lights[l]}static formationUnstated(t){return(o.read(t,"count")??1)>1?"cluster":"single"}static formationOf(t){const l=o.read(t,"formation.kind");return typeof l=="string"?l:e.formationUnstated(t)}static hovers(t){return a.airframeOf(e.flightOf(t)).hovers}static light(t){const l=e.textKey(t),s=i=>e.ownLight(i,t)!==void 0,h=i=>{const u=e.flightOf(i).lights?.[t];return u===!1?!0:typeof u?.off=="boolean"?u.off:e.ownLight(i,t)?.off===!0},n=i=>s(i)&&!h(i);return[{type:"boolean",key:`lights.${t}.off`,group:l,label:"switchedOff",visibleWhen:s,effective:i=>e.flightOf(i).lights?.[t]===!1||e.ownLight(i,t)?.off===!0},{type:"colour",key:`lights.${t}.color`,group:l,label:"colour",visibleWhen:n,effective:i=>e.ownLight(i,t)?.color},{type:"number",key:`lights.${t}.candela`,min:0,max:1e5,step:.1,unit:"cd",group:l,label:"intensity",hint:"eachLed",visibleWhen:n,effective:i=>e.ownLight(i,t)?.candela},{type:"number",key:`lights.${t}.hz`,min:0,max:50,step:.05,unit:"Hz",group:l,label:"flashesASecond",hint:"steadyAtNought",visibleWhen:n,effective:i=>e.ownLight(i,t)?.hz??0},{type:"number",key:`lights.${t}.flashS`,min:.001,max:60,step:.001,unit:"s",group:l,label:"eachFlashLasts",visibleWhen:i=>n(i)&&(o.read(i,`lights.${t}.hz`)??e.ownLight(i,t)?.hz??0)>0,effective:i=>{const u=e.ownLight(i,t),p=o.read(i,`lights.${t}.hz`)??u?.hz??0;return u?.flashS??(p>0?Math.round(500/p)/1e3:void 0)}}]}static SET={kind:"drones",title:"drones",parameters:[{type:"said",key:"title",label:"name",group:e.DRONE},{type:"choice",key:"airframe",required:!0,group:e.DRONE,label:"airframe",choices:c.ALL.map(t=>({value:t.id,label:e.textKey(t.id)}))},{type:"number",key:"count",min:1,max:2e3,step:1,group:e.DRONE,effective:()=>1,label:"howMany"},{type:"set",key:"explains",group:e.DRONE,label:"standForTheShapes",hint:"theWholeGroupTakenForOne",visibleWhen:t=>e.flightOf(t).explainsEach===void 0,options:(t,l)=>{const s=l?.shapes??[],h=(e.flightOf(t).explains??[]).filter(n=>!s.some(i=>i.value===n));return[...s,...h.map(n=>({value:n,label:n}))]},empty:"noShape"},{type:"number",key:"seed",min:0,max:4294967295,step:1,group:e.DRONE,effective:()=>1,label:"draw",hint:"whatTheDrawsStartFrom"},{type:"choice",key:"formation.kind",group:e.FLIGHT,label:"pattern",effective:t=>e.formationUnstated(t),choices:[{value:"single",label:"oneDrone"},{value:"cluster",label:"aLooseGroup"},{value:"line",label:"abreast"}],visibleWhen:t=>(o.read(t,"count")??1)>1},{type:"number",key:"formation.spacingM",min:.5,max:1e3,step:.5,unit:"m",group:e.FLIGHT,effective:t=>e.formationOf(t)==="line"?5:10,label:"spacing",hint:"betweenNeighbours",visibleWhen:t=>(o.read(t,"count")??1)>1&&e.formationOf(t)!=="single"},{type:"number",key:"headingDeg",min:0,max:360,step:1,unit:"°",group:e.FLIGHT,label:"noseTowards",hint:"emptyItFacesWhereItGoes",placeholder:"whereItGoes",visibleWhen:e.hovers},{type:"number",key:"wind.fromDeg",min:0,max:360,step:1,unit:"°",group:e.FLIGHT,label:"windFrom",effective:()=>0,hint:"whatItLeansInto"},{type:"number",key:"wind.speedMS",min:0,max:60,step:.1,unit:"m/s",group:e.FLIGHT,label:"windSpeed",effective:()=>0},{type:"boolean",key:"silent",group:e.FLIGHT,label:"silent",hint:"notEvenItsRotors"},{type:"number",key:"quieterDb",min:0,max:60,step:1,unit:"dB",group:e.FLIGHT,label:"quieter",hint:"thanItsClass",effective:()=>0,visibleWhen:t=>o.read(t,"silent")!==!0},{type:"colour",key:"bodyColor",group:e.LOOK,label:"hull",effective:t=>a.airframeOf(e.flightOf(t)).bodyColor},...e.LIGHT_NAMES.flatMap(t=>e.light(t))]};static angular(t){return typeof t.azimuthDeg=="number"}static WAYPOINT={kind:"drones-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=>!e.angular(t)},{type:"number",key:"altitudeM",min:-500,max:2e4,step:.1,unit:"m",required:!0,label:"height",hint:"aboveTheGroundOfThePlace",visibleWhen:t=>!e.angular(t)},{type:"number",key:"azimuthDeg",min:0,max:360,step:.1,unit:"°",required:!0,label:"azimuth",visibleWhen:t=>e.angular(t)},{type:"number",key:"altitudeDeg",min:-90,max:90,step:.1,unit:"°",required:!0,label:"elevation",visibleWhen:t=>e.angular(t)},{type:"number",key:"distanceM",min:0,max:1e5,step:1,unit:"m",required:!0,label:"distance",visibleWhen:t=>e.angular(t)},{type:"number",key:"eyeHeightM",min:0,max:1e4,step:.1,unit:"m",effective:()=>1.6,label:"eyeHeight",visibleWhen:t=>e.angular(t)}]};static waypointAt(t,l){const s=a.pathOf(t);if(s.length===0)return{t:Math.round(l),eastM:0,northM:0,altitudeM:0};const h=new b(s,a.airframeOf(t).hovers).at(l),n=i=>Math.round(i*10)/10;return{t:Math.round(l),eastM:n(h.eastM),northM:n(h.northM),altitudeM:n(h.upM)}}static publish(){f.publish(e.SET),f.publish(e.WAYPOINT)}}export{e as D};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as u,_ as h,
|
|
1
|
+
import{e as u,_ as h,bB as g,bC as f,bD as y,bE as b}from"./rr0-scene.mjs";import{P as p,S as T,a as w,c as A,b as E,E as v}from"./ParameterForm-CRC9iA-m.js";import{SkyLantern as o}from"./SkyLantern-C3BSxHtq.js";const x=u.catalog({en:()=>h(()=>import("./LanternParameterTexts_en-CcnGd8UH.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_en),fr:()=>h(()=>import("./LanternParameterTexts_fr-P2JwYOUy.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_fr),es:()=>h(()=>import("./LanternParameterTexts_es-CUTgNutZ.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_es),it:()=>h(()=>import("./LanternParameterTexts_it-CzNnIUrX.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_it)});class i{static RELEASE="letGo";static LANTERNS="lanterns";static AIR="air";static LANTERN="eachLantern";static instant(e,t,n){return{type:"number",key:e,min:-36e3,max:36e3,step:1,unit:"s",scale:.001,required:!0,label:t,hint:n,group:i.LANTERNS}}static wind(e,t,n,s){return[{type:"number",key:`${e}.towardDeg`,min:0,max:360,step:1,unit:"°",group:i.AIR,hint:s,label:t},{type:"number",key:`${e}.speedMS`,min:0,max:60,step:.1,unit:"m/s",group:i.AIR,label:n}]}static SET={kind:"lantern",title:"skyLanterns",parameters:[{type:"said",key:"title",label:"name",group:i.RELEASE},{type:"position",key:"site.eastM",secondKey:"site.northM",saidKey:"site.saidPosition",native:"local",step:1,rangeM:1e5,group:i.RELEASE,label:"whereTheyAreLetGo",hint:"whereTheyAreLetGoFrom"},{type:"number",key:"site.altitudeM",min:-1e3,max:5e3,step:.1,unit:"m",group:i.RELEASE,effective:()=>0,label:"heightAboveThePlaceSGround",hint:"aGardenOnAHillAbove"},{type:"number",key:"site.originElevationM",min:-500,max:6e3,step:1,unit:"m",group:i.RELEASE,effective:()=>0,label:"thePlaceSGroundAboveThe",hint:"whatSetsHowThinTheAir"},{type:"number",key:"group.count",min:1,max:200,step:1,required:!0,group:i.LANTERNS,label:"howMany"},i.instant("group.fromT","firstLetGoAt","secondsOfTheRecordingBeforeIts"),i.instant("group.untilT","lastLetGoAt","secondsOfTheRecordingTheOthers"),{type:"number",key:"group.radiusM",min:0,max:5e3,step:1,unit:"m",group:i.LANTERNS,effective:()=>20,label:"letGoWithin",hint:"aCrowdLetsThemGoA"},{type:"number",key:"group.burnS.min",min:10,max:3600,step:1,unit:"s",group:i.LANTERNS,effective:()=>480,label:"burnsAtLeast",hint:"howLongEachBurnsFromWhen"},{type:"number",key:"group.burnS.max",min:10,max:3600,step:1,unit:"s",group:i.LANTERNS,effective:()=>900,label:"burnsAtMost"},{type:"number",key:"group.insideExcessK.min",min:10,max:400,step:1,unit:"K",group:i.LANTERNS,effective:()=>125,label:"hotterThanTheAirAtLeast",hint:"howMuchHotterThanTheAir"},{type:"number",key:"group.insideExcessK.max",min:10,max:400,step:1,unit:"K",group:i.LANTERNS,effective:()=>175,label:"hotterThanTheAirAtMost"},{type:"number",key:"group.burnedS",min:0,max:3600,step:1,unit:"s",group:i.LANTERNS,effective:()=>0,label:"alreadyBurntWhenLetGo",hint:"forLanternsTheAccountOnlyHas"},{type:"number",key:"group.seed",min:0,max:4294967295,step:1,group:i.LANTERNS,effective:()=>1,label:"draw",hint:"whatTheDrawsStartFromAnother"},{type:"set",key:"group.explains",group:i.LANTERNS,label:"standForTheShapes",options:(e,t)=>{const n=t?.shapes??[],s=(e.group?.explains??[]).filter(r=>!n.some(l=>l.value===r));return[...n,...s.map(r=>({value:r,label:r}))]},empty:"noShape"},...i.wind("wind","windAtTheGroundTowards","windAtTheGroundSpeed","whereItBlowsTowardsWhichIs"),...i.wind("windAloft","windAloftTowards","windAloftSpeed","theWindHigherUpBlendedWith"),{type:"number",key:"windAloft.atM",min:10,max:1e4,step:10,unit:"m",group:i.AIR,label:"windAloftAt",hint:"metresAboveWhereTheyAreLet"},{type:"number",key:"airTemperatureC",min:-60,max:50,step:.5,unit:"°C",group:i.AIR,effective:()=>10,label:"airTemperature",hint:"atTheGroundFallingBy6"},{type:"number",key:"turbulence.horizontalMS",min:0,max:10,step:.1,unit:"m/s",group:i.AIR,effective:()=>o.TURBULENCE.horizontalMS,label:"gustsAcross",hint:"howFarTheAirSSpeed"},{type:"number",key:"turbulence.verticalMS",min:0,max:10,step:.1,unit:"m/s",group:i.AIR,effective:()=>o.TURBULENCE.verticalMS,label:"gustsUpAndDown"},{type:"number",key:"turbulence.timescaleS",min:1,max:600,step:1,unit:"s",group:i.AIR,effective:()=>o.TURBULENCE.timescaleS,label:"aGustLasts"},{type:"number",key:"lantern.luminousIntensityCd",min:.1,max:1e3,step:.1,unit:"cd",group:i.LANTERN,effective:()=>o.COMMON.luminousIntensityCd,label:"light",hint:"itsFlameSLightThroughThe"},{type:"choice",key:"lantern.shape",group:i.LANTERN,effective:()=>o.COMMON.shape,label:"shape",choices:[{value:"classic",label:"roundAtTheMouthSquareAt"},{value:"balloon",label:"balloonLobedTop"}]},{type:"colour",key:"lantern.paperColor",group:i.LANTERN,fallback:o.COMMON.paperColor,label:"paperColour",hint:"whatItLooksLikeByDay"},{type:"colour",key:"lantern.color",group:i.LANTERN,fallback:o.COMMON.color,label:"flameLight",hint:"itsFlameSLightThroughWhite"},{type:"number",key:"lantern.envelopeVolumeM3",min:.01,max:10,step:.01,unit:"m³",group:i.LANTERN,effective:()=>o.COMMON.envelopeVolumeM3,label:"airItHolds"},{type:"number",key:"lantern.massKg",min:.005,max:5,step:.001,unit:"kg",group:i.LANTERN,effective:()=>o.COMMON.massKg,label:"weightWhenLetGo"}]};static publish(){p.publish(i.SET)}}const S=u.catalog({en:()=>h(()=>import("./LanternEditorMessages_en-DaT3UNfD.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_en),fr:()=>h(()=>import("./LanternEditorMessages_fr-9mByTFMG.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_fr),es:()=>h(()=>import("./LanternEditorMessages_es-TDV5lKeJ.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_es),it:()=>h(()=>import("./LanternEditorMessages_it-MRkJnDQp.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_it)});class c{constructor(e,t,n){this.container=e,this.host=t,T.attach(e,"lantern-editor-part",c.STYLE),this.language=n,p.of("lantern")||i.publish(),this.ready=this.setLanguage(n)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;language;shown=[];static STYLE=`
|
|
2
2
|
.lantern-editor-part, .lantern-editor-part #lantern-list, .lantern-editor-part .launch-fields { flex-basis: 100%; min-width: 0; }
|
|
3
3
|
.lantern-editor-part .launch-editor, .lantern-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
|
|
4
4
|
.lantern-editor-part [hidden] { display: none !important; }
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleThree-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleThree-DRsA8rtL.js","./rr0-scene.mjs"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{f as g,d as w,_ as b,M as p}from"./rr0-scene.mjs";class o{static STORAGE_KEY="ufoathome.modules";static FORMAT=1;static empty(){return{format:1,modules:[]}}static read(t=o.storage()){try{const e=t?.getItem(o.STORAGE_KEY);return e?o.parse(e):o.empty()}catch{return o.empty()}}static write(t,e=o.storage()){try{return e?(t.modules.length===0?e.removeItem(o.STORAGE_KEY):e.setItem(o.STORAGE_KEY,o.text(t)),!0):!1}catch{return!1}}static parse(t){const e=JSON.parse(t);if(e===null||typeof e!="object"||!Array.isArray(e.modules))throw new Error("not a UFO@home module list");if(typeof e.format=="number"&&e.format>o.FORMAT)throw new Error(`format ${e.format} is newer than ${o.FORMAT}`);const s=new Set,i=[];for(const r of e.modules)typeof r?.url!="string"||s.has(r.url)||(s.add(r.url),i.push({url:r.url,enabled:r.enabled!==!1}));return{format:1,modules:i}}static text(t){return JSON.stringify({format:o.FORMAT,modules:t.modules},null,2)+`
|
|
3
|
-
`}static storage(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}}class E{constructor(t,e){this.attribution=t,this.models=e}async entries(t){return t?this.models.filter(e=>[e.kind].flat().includes(t)):[...this.models]}async entry(t){return this.models.find(e=>e.id===t)}}class f{attribution;fetchImpl;tileUrlTemplate;constructor(t){this.attribution=t.attribution,this.tileUrlTemplate=t.tileUrlTemplate,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis)}getImageryTexture(t,e){return g(t,e,s=>f.tileUrl(this.tileUrlTemplate,s),this.fetchImpl)}static tileUrl(t,e){return t.replaceAll("{z}",String(e.z)).replaceAll("{x}",String(e.x)).replaceAll("{y}",String(e.y))}}class v extends Error{constructor(t,e){super(`${t}: ${e}`),this.url=t,this.reason=e,this.name="ModuleManifestError"}}class d{static FORMAT=1;static check(t,e){const s=n=>{throw new v(e,n)};(t===null||typeof t!="object"||Array.isArray(t))&&s("not a JSON object");const i=t;typeof i.format!="number"&&s('no "format"'),i.format>d.FORMAT&&s(`format ${i.format} is newer than ${d.FORMAT}, which this version reads`),(typeof i.id!="string"||!/^[a-z0-9][a-z0-9._-]*$/.test(i.id))&&s(`"id" must be lowercase letters, digits, '.', '_' or '-'`),(typeof i.name!="string"||i.name.trim()==="")&&s('no "name"'),i.script!==void 0&&typeof i.script!="string"&&s('"script" must be an address');const r=i.contributes??{};for(const n of["imagery","elevation"]){const c=r[n];c!==void 0&&(Array.isArray(c)||s(`"contributes.${n}" must be a list`),c.forEach((l,m)=>{for(const h of["id","name","credit","creditUrl","tiles"])(typeof l?.[h]!="string"||l[h]==="")&&s(`"contributes.${n}[${m}].${h}" is missing`);["{z}","{x}","{y}"].every(h=>l.tiles.includes(h))||s(`"contributes.${n}[${m}].tiles" must hold {z}, {x} and {y}`)}))}const a=r.models;return a!==void 0&&(Array.isArray(a)||s('"contributes.models" must be a list'),a.forEach((n,c)=>{for(const l of["id","name","file"])(typeof n?.[l]!="string"||n[l]==="")&&s(`"contributes.models[${c}].${l}" is missing`);n.kind===void 0&&s(`"contributes.models[${c}].kind" is missing`),(!n.credit||typeof n.credit!="object")&&s(`"contributes.models[${c}].credit" is missing: a model is shown with its author and licence`)})),i}static contributions(t,e){const s=t.contributes??{},i={};if(s.imagery?.length&&(i.imagery=s.imagery.map(r=>({id:r.id,name:r.name,credit:r.credit,creditUrl:r.creditUrl,create:a=>new f({tileUrlTemplate:d.absoluteTemplate(r.tiles,e),attribution:r.credit,fetchImpl:a})}))),s.elevation?.length&&(i.elevation=s.elevation.map(r=>({id:r.id,name:r.name,credit:r.credit,creditUrl:r.creditUrl,create:a=>new w({tileUrlTemplate:d.absoluteTemplate(r.tiles,e),fetchImpl:a})}))),s.models?.length){const r=s.models.map(({file:n,...c})=>({...c,url:new URL(n,e).href})),a=t.credit??t.name;i.decorModels=[{id:`${t.id}-models`,name:t.name,credit:a,creditUrl:t.creditUrl??e,create:()=>new E(a,r)}]}return i}static module(t,e,s={}){const i=d.contributions(t,e);for(const[r,a]of Object.entries(s))Array.isArray(a)&&(i[r]=[...i[r]??[],...a]);return{id:t.id,name:t.name,credit:t.credit,creditUrl:t.creditUrl,url:e,contributes:i}}static absoluteTemplate(t,e){const s=t.replaceAll("{z}","__Z__").replaceAll("{x}","__X__").replaceAll("{y}","__Y__");return new URL(s,e).href.replaceAll("__Z__","{z}").replaceAll("__X__","{x}").replaceAll("__Y__","{y}")}}class T{fetchImpl;importImpl;constructor(t={}){this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.importImpl=t.importImpl??(e=>import(e))}async load(t,e){const s=await this.fetchImpl(t);if(!s.ok)throw new Error(`${t}: HTTP ${s.status}`);const i=d.check(await s.json(),t),r=i.script!==void 0;let a={};if(r&&e.runScript){const n=new URL(i.script,t).href,c=await this.importImpl(n);if(typeof c.default!="function")throw new Error(`${n}: its default export is not a function`);const{MODULE_THREE:l}=await b(async()=>{const{MODULE_THREE:m}=await import("./ModuleThree-
|
|
3
|
+
`}static storage(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}}class E{constructor(t,e){this.attribution=t,this.models=e}async entries(t){return t?this.models.filter(e=>[e.kind].flat().includes(t)):[...this.models]}async entry(t){return this.models.find(e=>e.id===t)}}class f{attribution;fetchImpl;tileUrlTemplate;constructor(t){this.attribution=t.attribution,this.tileUrlTemplate=t.tileUrlTemplate,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis)}getImageryTexture(t,e){return g(t,e,s=>f.tileUrl(this.tileUrlTemplate,s),this.fetchImpl)}static tileUrl(t,e){return t.replaceAll("{z}",String(e.z)).replaceAll("{x}",String(e.x)).replaceAll("{y}",String(e.y))}}class v extends Error{constructor(t,e){super(`${t}: ${e}`),this.url=t,this.reason=e,this.name="ModuleManifestError"}}class d{static FORMAT=1;static check(t,e){const s=n=>{throw new v(e,n)};(t===null||typeof t!="object"||Array.isArray(t))&&s("not a JSON object");const i=t;typeof i.format!="number"&&s('no "format"'),i.format>d.FORMAT&&s(`format ${i.format} is newer than ${d.FORMAT}, which this version reads`),(typeof i.id!="string"||!/^[a-z0-9][a-z0-9._-]*$/.test(i.id))&&s(`"id" must be lowercase letters, digits, '.', '_' or '-'`),(typeof i.name!="string"||i.name.trim()==="")&&s('no "name"'),i.script!==void 0&&typeof i.script!="string"&&s('"script" must be an address');const r=i.contributes??{};for(const n of["imagery","elevation"]){const c=r[n];c!==void 0&&(Array.isArray(c)||s(`"contributes.${n}" must be a list`),c.forEach((l,m)=>{for(const h of["id","name","credit","creditUrl","tiles"])(typeof l?.[h]!="string"||l[h]==="")&&s(`"contributes.${n}[${m}].${h}" is missing`);["{z}","{x}","{y}"].every(h=>l.tiles.includes(h))||s(`"contributes.${n}[${m}].tiles" must hold {z}, {x} and {y}`)}))}const a=r.models;return a!==void 0&&(Array.isArray(a)||s('"contributes.models" must be a list'),a.forEach((n,c)=>{for(const l of["id","name","file"])(typeof n?.[l]!="string"||n[l]==="")&&s(`"contributes.models[${c}].${l}" is missing`);n.kind===void 0&&s(`"contributes.models[${c}].kind" is missing`),(!n.credit||typeof n.credit!="object")&&s(`"contributes.models[${c}].credit" is missing: a model is shown with its author and licence`)})),i}static contributions(t,e){const s=t.contributes??{},i={};if(s.imagery?.length&&(i.imagery=s.imagery.map(r=>({id:r.id,name:r.name,credit:r.credit,creditUrl:r.creditUrl,create:a=>new f({tileUrlTemplate:d.absoluteTemplate(r.tiles,e),attribution:r.credit,fetchImpl:a})}))),s.elevation?.length&&(i.elevation=s.elevation.map(r=>({id:r.id,name:r.name,credit:r.credit,creditUrl:r.creditUrl,create:a=>new w({tileUrlTemplate:d.absoluteTemplate(r.tiles,e),fetchImpl:a})}))),s.models?.length){const r=s.models.map(({file:n,...c})=>({...c,url:new URL(n,e).href})),a=t.credit??t.name;i.decorModels=[{id:`${t.id}-models`,name:t.name,credit:a,creditUrl:t.creditUrl??e,create:()=>new E(a,r)}]}return i}static module(t,e,s={}){const i=d.contributions(t,e);for(const[r,a]of Object.entries(s))Array.isArray(a)&&(i[r]=[...i[r]??[],...a]);return{id:t.id,name:t.name,credit:t.credit,creditUrl:t.creditUrl,url:e,contributes:i}}static absoluteTemplate(t,e){const s=t.replaceAll("{z}","__Z__").replaceAll("{x}","__X__").replaceAll("{y}","__Y__");return new URL(s,e).href.replaceAll("__Z__","{z}").replaceAll("__X__","{x}").replaceAll("__Y__","{y}")}}class T{fetchImpl;importImpl;constructor(t={}){this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.importImpl=t.importImpl??(e=>import(e))}async load(t,e){const s=await this.fetchImpl(t);if(!s.ok)throw new Error(`${t}: HTTP ${s.status}`);const i=d.check(await s.json(),t),r=i.script!==void 0;let a={};if(r&&e.runScript){const n=new URL(i.script,t).href,c=await this.importImpl(n);if(typeof c.default!="function")throw new Error(`${n}: its default export is not a function`);const{MODULE_THREE:l}=await b(async()=>{const{MODULE_THREE:m}=await import("./ModuleThree-DRsA8rtL.js");return{MODULE_THREE:m}},__vite__mapDeps([0,1]),import.meta.url);a=await c.default({manifestUrl:t,three:l})??{}}return{url:t,manifest:i,module:d.module(i,t,a),hasScript:r,scriptRun:r&&e.runScript}}}class y{constructor(t=new T,e){this.loader=t,this.storage=e}static shared=new y;changes=new EventTarget;states=new Map;config=o.empty();started;list(){const t=[...this.states.values()];return[...t.filter(e=>e.addedByPerson),...t.filter(e=>!e.addedByPerson)]}state(t){return this.states.get(t)}start(){return this.started??=this.applyConfig(o.read(this.storage)),this.started}async add(t){await this.start();const e=new URL(t,typeof location>"u"?void 0:location.href).href;return this.config.modules.some(s=>s.url===e)||(this.config={...this.config,modules:[...this.config.modules,{url:e,enabled:!0}]},this.save()),this.reload(e)}async remove(t){this.config={...this.config,modules:this.config.modules.filter(e=>e.url!==t)},this.save(),await this.reload(t)}async setEnabled(t,e){this.config={...this.config,modules:this.config.modules.map(s=>s.url===t?{...s,enabled:e}:s)},this.save(),await this.reload(t)}exportText(){return o.text(this.config)}async importText(t){const e=o.parse(t);await this.start();const s=this.config.modules.map(i=>i.url);this.config=e,this.save(),await Promise.all([...new Set([...s,...e.modules.map(i=>i.url)])].map(i=>this.reload(i)))}async require(t,e,s=!1){t?.length&&(await this.start(),await Promise.all(t.map(async i=>{let r;try{r=new URL(i,e??(typeof location>"u"?void 0:location.href)).href}catch{return}const a=this.states.get(r),n=s&&!this.trusted.has(r);if(s&&this.trusted.add(r),a&&a.status!=="off"&&!(n&&a.loaded&&!a.loaded.scriptRun))return a.status==="loading"?this.pending.get(r):void 0;this.named.add(r),await this.reload(r)})))}named=new Set;trusted=new Set;pending=new Map;async applyConfig(t){this.config=t,await Promise.all(t.modules.map(e=>this.reload(e.url)))}reload(t){const e=this.reloadNow(t);return this.pending.set(t,e),e}async reloadNow(t){const e=this.config.modules.find(a=>a.url===t),s=this.states.get(t);s?.loaded&&p.uninstall(s.loaded.module.id);const i=e!==void 0,r=e?.enabled??!0;if(!i&&!this.named.has(t))return this.states.delete(t),this.announce(),{url:t,addedByPerson:i,enabled:r,status:"off"};if(i&&!r&&!this.named.has(t))return this.set({url:t,addedByPerson:i,enabled:r,status:"off"});this.set({url:t,addedByPerson:i,enabled:r,status:"loading"});try{const a=await this.loader.load(t,{runScript:i&&r||!i&&this.trusted.has(t)});return p.install(a.module),this.set({url:t,addedByPerson:i,enabled:r,status:"installed",loaded:a})}catch(a){return this.set({url:t,addedByPerson:i,enabled:r,status:"failed",error:a instanceof Error?a.message:String(a)})}}set(t){return this.states.set(t.url,t),this.announce(),t}save(){o.write(this.config,this.storage)}announce(){this.changes.dispatchEvent(new Event("change"))}}export{y as ModuleSession};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{V as a,m as e,bJ as s,$ as t,a1 as r,ai as i,E as o,ad as n,Y as l,Z as b,ay as d,aj as m,ak as u,bK as M,s as B,a2 as y,o as G,h as S,aQ as h,aN as c,aR as f,G as p,b2 as L,F as x,bL as C,a3 as E,bM as P,bN as g,bO as D,C as T,a0 as A,B as F,t as N,bP as O,ah as V,a6 as j}from"./rr0-scene.mjs";const v={AdditiveBlending:j,BackSide:V,BoxGeometry:O,BufferAttribute:N,BufferGeometry:F,CanvasTexture:A,Color:T,ConeGeometry:D,CylinderGeometry:g,DataTexture:P,DoubleSide:E,Euler:C,Float32BufferAttribute:x,FrontSide:L,Group:p,Line:f,LineBasicMaterial:c,LineSegments:h,Matrix4:S,Mesh:G,MeshBasicMaterial:y,MeshStandardMaterial:B,NormalBlending:M,Object3D:u,PlaneGeometry:m,PointLight:d,Points:b,PointsMaterial:l,Quaternion:n,ShaderMaterial:o,SphereGeometry:i,Sprite:r,SpriteMaterial:t,TorusGeometry:s,Vector2:e,Vector3:a};export{v as MODULE_THREE};
|