@splinetool/runtime 2.0.8 → 2.0.10
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/build/hana-ui.js +122 -42
- package/build/hana-ui.js.br +0 -0
- package/build/hana-ui.js.gz +0 -0
- package/build/hana-ui.wasm +0 -0
- package/build/hana-ui.wasm.br +0 -0
- package/build/hana-ui.wasm.gz +0 -0
- package/build/{runtime-chunk-PDASWDVC.js → runtime-chunk-4LKRNVPP.js} +1 -1
- package/build/{runtime-chunk-PDASWDVC.js.br → runtime-chunk-4LKRNVPP.js.br} +0 -0
- package/build/runtime-chunk-4LKRNVPP.js.gz +0 -0
- package/build/{runtime-chunk-DK66VKWP.js → runtime-chunk-7FDJ7IIR.js} +1 -1
- package/build/runtime-chunk-7FDJ7IIR.js.br +0 -0
- package/build/runtime-chunk-7FDJ7IIR.js.gz +0 -0
- package/build/{runtime-chunk-23QXG35G.js → runtime-chunk-BLFFIB2B.js} +1 -1
- package/build/runtime-chunk-BLFFIB2B.js.br +0 -0
- package/build/runtime-chunk-BLFFIB2B.js.gz +0 -0
- package/build/{runtime-chunk-DHWGP6NU.js → runtime-chunk-CDR3AZNB.js} +1 -1
- package/build/runtime-chunk-CDR3AZNB.js.br +0 -0
- package/build/runtime-chunk-CDR3AZNB.js.gz +0 -0
- package/build/{runtime-chunk-HZ6FL5GH.js → runtime-chunk-CDYE22J6.js} +1 -1
- package/build/runtime-chunk-CDYE22J6.js.br +0 -0
- package/build/runtime-chunk-CDYE22J6.js.gz +0 -0
- package/build/runtime-chunk-DZIH7EMN.js +1 -0
- package/build/runtime-chunk-DZIH7EMN.js.br +0 -0
- package/build/runtime-chunk-DZIH7EMN.js.gz +0 -0
- package/build/{runtime-chunk-TAY7IXEZ.js → runtime-chunk-FN2C54JM.js} +1 -1
- package/build/runtime-chunk-FN2C54JM.js.br +0 -0
- package/build/runtime-chunk-FN2C54JM.js.gz +0 -0
- package/build/runtime-chunk-I6B5A36U.js +1 -0
- package/build/runtime-chunk-I6B5A36U.js.br +0 -0
- package/build/runtime-chunk-I6B5A36U.js.gz +0 -0
- package/build/{runtime-chunk-E3IEBR27.js → runtime-chunk-JSRKKIOS.js} +1 -1
- package/build/runtime-chunk-JSRKKIOS.js.br +0 -0
- package/build/runtime-chunk-JSRKKIOS.js.gz +0 -0
- package/build/{runtime-chunk-BMA5KYBS.js → runtime-chunk-KKDM5MC5.js} +1 -1
- package/build/runtime-chunk-KKDM5MC5.js.br +0 -0
- package/build/runtime-chunk-KKDM5MC5.js.gz +0 -0
- package/build/{runtime-chunk-3GRN37GY.js → runtime-chunk-L2C7JGYG.js} +1 -1
- package/build/runtime-chunk-L2C7JGYG.js.br +0 -0
- package/build/runtime-chunk-L2C7JGYG.js.gz +0 -0
- package/build/{runtime-chunk-GZ7C2GJM.js → runtime-chunk-LQL2PJVX.js} +1 -1
- package/build/runtime-chunk-LQL2PJVX.js.br +0 -0
- package/build/runtime-chunk-LQL2PJVX.js.gz +0 -0
- package/build/{runtime-chunk-EJJZJ5MV.js → runtime-chunk-M4BPCY7K.js} +1 -1
- package/build/runtime-chunk-M4BPCY7K.js.br +0 -0
- package/build/runtime-chunk-M4BPCY7K.js.gz +0 -0
- package/build/{runtime-chunk-CKT62HES.js → runtime-chunk-MOZWC42D.js} +1 -1
- package/build/runtime-chunk-MOZWC42D.js.br +0 -0
- package/build/runtime-chunk-MOZWC42D.js.gz +0 -0
- package/build/{runtime-chunk-RLYG5YBB.js → runtime-chunk-MVJAFW5H.js} +1 -1
- package/build/runtime-chunk-MVJAFW5H.js.br +1 -0
- package/build/runtime-chunk-MVJAFW5H.js.gz +0 -0
- package/build/{runtime-chunk-USGQ26QU.js → runtime-chunk-QSJVWNNM.js} +1 -1
- package/build/runtime-chunk-QSJVWNNM.js.br +0 -0
- package/build/runtime-chunk-QSJVWNNM.js.gz +0 -0
- package/build/{runtime-chunk-F3ZACLZW.js → runtime-chunk-RTRWO43P.js} +1 -1
- package/build/runtime-chunk-RTRWO43P.js.br +0 -0
- package/build/runtime-chunk-RTRWO43P.js.gz +0 -0
- package/build/{runtime-chunk-HK23JJVH.js → runtime-chunk-RX3SW5K2.js} +1 -1
- package/build/runtime-chunk-RX3SW5K2.js.br +0 -0
- package/build/runtime-chunk-RX3SW5K2.js.gz +0 -0
- package/build/{runtime-chunk-5RXW5MNJ.js → runtime-chunk-UHCXLQHA.js} +1 -1
- package/build/runtime-chunk-UHCXLQHA.js.br +0 -0
- package/build/runtime-chunk-UHCXLQHA.js.gz +0 -0
- package/build/{runtime-chunk-AELTGHV2.js → runtime-chunk-VNO2DW74.js} +1 -1
- package/build/{runtime-chunk-AELTGHV2.js.br → runtime-chunk-VNO2DW74.js.br} +0 -0
- package/build/runtime-chunk-VNO2DW74.js.gz +0 -0
- package/build/{runtime-chunk-UIM3XKIT.js → runtime-chunk-WQ2NXI3U.js} +1 -1
- package/build/runtime-chunk-WQ2NXI3U.js.br +0 -0
- package/build/runtime-chunk-WQ2NXI3U.js.gz +0 -0
- package/build/{runtime-chunk-557KVSJL.js → runtime-chunk-YO3XFDZF.js} +1 -1
- package/build/runtime-chunk-YO3XFDZF.js.br +0 -0
- package/build/runtime-chunk-YO3XFDZF.js.gz +0 -0
- package/build/{runtime-chunk-32KZP4YN.js → runtime-chunk-YS7K3AW3.js} +1 -1
- package/build/runtime-chunk-YS7K3AW3.js.br +0 -0
- package/build/runtime-chunk-YS7K3AW3.js.gz +0 -0
- package/build/{runtime-chunk-YULW5JRE.js → runtime-chunk-ZASM3KKC.js} +1 -1
- package/build/runtime-chunk-ZASM3KKC.js.br +0 -0
- package/build/runtime-chunk-ZASM3KKC.js.gz +0 -0
- package/build/{runtime-chunk-OUXEWX5Z.js → runtime-chunk-ZLOMOV3N.js} +1 -1
- package/build/runtime-chunk-ZLOMOV3N.js.br +0 -0
- package/build/runtime-chunk-ZLOMOV3N.js.gz +0 -0
- package/build/{runtime-chunk-5JEZ42OM.js → runtime-chunk-ZM7N5SZG.js} +1 -1
- package/build/runtime-chunk-ZM7N5SZG.js.br +0 -0
- package/build/runtime-chunk-ZM7N5SZG.js.gz +0 -0
- package/build/{runtime-classicRuntime-U672GAGM.js → runtime-classicRuntime-A3DEJ3YH.js} +1 -1
- package/build/runtime-classicRuntime-A3DEJ3YH.js.br +0 -0
- package/build/runtime-classicRuntime-A3DEJ3YH.js.gz +0 -0
- package/build/{runtime-cloners-2AC7OZRC.js → runtime-cloners-UFF7A36S.js} +1 -1
- package/build/runtime-cloners-UFF7A36S.js.br +1 -0
- package/build/runtime-cloners-UFF7A36S.js.gz +0 -0
- package/build/{runtime-components-L63NUGAO.js → runtime-components-EESAIEPO.js} +1 -1
- package/build/runtime-components-EESAIEPO.js.br +0 -0
- package/build/runtime-components-EESAIEPO.js.gz +0 -0
- package/build/{runtime-createDestroy-QHHQ6LYS.js → runtime-createDestroy-WBIIVRMC.js} +1 -1
- package/build/runtime-createDestroy-WBIIVRMC.js.br +0 -0
- package/build/runtime-createDestroy-WBIIVRMC.js.gz +0 -0
- package/build/{runtime-dragDrop-YBSWK3ET.js → runtime-dragDrop-D45J5GQ5.js} +1 -1
- package/build/runtime-dragDrop-D45J5GQ5.js.br +0 -0
- package/build/runtime-dragDrop-D45J5GQ5.js.gz +0 -0
- package/build/{runtime-gameControls-DSJRSTW5.js → runtime-gameControls-GNLQ3FT6.js} +1 -1
- package/build/runtime-gameControls-GNLQ3FT6.js.br +0 -0
- package/build/runtime-gameControls-GNLQ3FT6.js.gz +0 -0
- package/build/{runtime-hair-V4RTCES2.js → runtime-hair-55OFZZFY.js} +1 -1
- package/build/runtime-hair-55OFZZFY.js.br +1 -0
- package/build/runtime-hair-55OFZZFY.js.gz +0 -0
- package/build/{runtime-mergeStaticGeometries-VXENKMD4.js → runtime-mergeStaticGeometries-NLUOSGZB.js} +1 -1
- package/build/runtime-mergeStaticGeometries-NLUOSGZB.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-NLUOSGZB.js.gz +0 -0
- package/build/{runtime-miscActions-RPUPHHGJ.js → runtime-miscActions-5YY5ARQT.js} +1 -1
- package/build/runtime-miscActions-5YY5ARQT.js.br +0 -0
- package/build/runtime-miscActions-5YY5ARQT.js.gz +0 -0
- package/build/{runtime-mouseHover-HG6AHA2L.js → runtime-mouseHover-MTTJI6DT.js} +1 -1
- package/build/runtime-mouseHover-MTTJI6DT.js.br +0 -0
- package/build/runtime-mouseHover-MTTJI6DT.js.gz +0 -0
- package/build/{runtime-particles-ZHE2MC33.js → runtime-particles-VZVZJ35I.js} +1 -1
- package/build/runtime-particles-VZVZJ35I.js.br +0 -0
- package/build/runtime-particles-VZVZJ35I.js.gz +0 -0
- package/build/{runtime-paths-GN6E6ZYL.js → runtime-paths-4UDUBYZN.js} +1 -1
- package/build/runtime-paths-4UDUBYZN.js.br +0 -0
- package/build/runtime-paths-4UDUBYZN.js.gz +0 -0
- package/build/{runtime-resize-LACR4RFK.js → runtime-resize-QYCZUOPF.js} +1 -1
- package/build/runtime-resize-QYCZUOPF.js.br +0 -0
- package/build/runtime-resize-QYCZUOPF.js.gz +0 -0
- package/build/{runtime-sceneTransition-QLPFYHHY.js → runtime-sceneTransition-FC5TQNCH.js} +1 -1
- package/build/runtime-sceneTransition-FC5TQNCH.js.br +0 -0
- package/build/runtime-sceneTransition-FC5TQNCH.js.gz +0 -0
- package/build/{runtime-scroll-WZZBT2XR.js → runtime-scroll-VKMCDMAZ.js} +1 -1
- package/build/runtime-scroll-VKMCDMAZ.js.br +0 -0
- package/build/runtime-scroll-VKMCDMAZ.js.gz +0 -0
- package/build/runtime-shapeBlends-3QLNRN2O.js +1 -0
- package/build/runtime-shapeBlends-3QLNRN2O.js.br +4 -0
- package/build/runtime-shapeBlends-3QLNRN2O.js.gz +0 -0
- package/build/{runtime-text-UADJSRL4.js → runtime-text-IYCY3PFB.js} +1 -1
- package/build/runtime-text-IYCY3PFB.js.br +0 -0
- package/build/runtime-text-IYCY3PFB.js.gz +0 -0
- package/build/{runtime-textInputs-7U3TTJ4X.js → runtime-textInputs-LFDWIRLC.js} +1 -1
- package/build/runtime-textInputs-LFDWIRLC.js.br +0 -0
- package/build/runtime-textInputs-LFDWIRLC.js.gz +0 -0
- package/build/runtime-timeline-WNUPRRKW.js +1 -0
- package/build/runtime-timeline-WNUPRRKW.js.br +0 -0
- package/build/runtime-timeline-WNUPRRKW.js.gz +0 -0
- package/build/{runtime-tracking-MC74576T.js → runtime-tracking-HMTCBZ7J.js} +1 -1
- package/build/runtime-tracking-HMTCBZ7J.js.br +0 -0
- package/build/runtime-tracking-HMTCBZ7J.js.gz +0 -0
- package/build/{runtime-transitions-S22YS7E6.js → runtime-transitions-NPD3CNKU.js} +1 -1
- package/build/runtime-transitions-NPD3CNKU.js.br +0 -0
- package/build/runtime-transitions-NPD3CNKU.js.gz +0 -0
- package/build/{runtime-ui2d-EX3RBXPP.js → runtime-ui2d-NZTQW5UJ.js} +1 -1
- package/build/runtime-ui2d-NZTQW5UJ.js.br +0 -0
- package/build/runtime-ui2d-NZTQW5UJ.js.gz +0 -0
- package/build/{runtime-vectorShapes-J5Y3LMND.js → runtime-vectorShapes-26IDV3ZL.js} +1 -1
- package/build/runtime-vectorShapes-26IDV3ZL.js.br +0 -0
- package/build/runtime-vectorShapes-26IDV3ZL.js.gz +0 -0
- package/build/{runtime-webgpu-LDZ3N2D5.js → runtime-webgpu-CDBERG7X.js} +1 -1
- package/build/runtime-webgpu-CDBERG7X.js.br +0 -0
- package/build/runtime-webgpu-CDBERG7X.js.gz +0 -0
- package/build/runtime.cjs +5 -5
- package/build/runtime.js +1 -1
- package/build/runtime.js.br +0 -0
- package/build/runtime.js.gz +0 -0
- package/build/runtime.standalone.js +1 -1
- package/build/runtime.standalone.js.br +0 -0
- package/build/runtime.standalone.js.gz +0 -0
- package/build/runtime.standalone.webgl.js +1 -1
- package/build/runtime.standalone.webgl.js.br +0 -0
- package/build/runtime.standalone.webgl.js.gz +0 -0
- package/build/runtime.standalone.webgpu.js +1 -1
- package/build/runtime.standalone.webgpu.js.br +0 -0
- package/build/runtime.standalone.webgpu.js.gz +0 -0
- package/build/runtime.standalone.webgpu.micro.js +1 -1
- package/build/runtime.standalone.webgpu.micro.js.br +0 -0
- package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
- package/build/runtime.standalone.webgpu.min.js +1 -1
- package/build/runtime.standalone.webgpu.min.js.br +0 -0
- package/build/runtime.standalone.webgpu.min.js.gz +0 -0
- package/build/snippets/hana-82e9eb82a79dead4/js-imports.js +204 -77
- package/package.json +1 -1
- package/build/runtime-chunk-23QXG35G.js.br +0 -0
- package/build/runtime-chunk-23QXG35G.js.gz +0 -0
- package/build/runtime-chunk-32KZP4YN.js.br +0 -0
- package/build/runtime-chunk-32KZP4YN.js.gz +0 -0
- package/build/runtime-chunk-3GRN37GY.js.br +0 -0
- package/build/runtime-chunk-3GRN37GY.js.gz +0 -0
- package/build/runtime-chunk-557KVSJL.js.br +0 -0
- package/build/runtime-chunk-557KVSJL.js.gz +0 -0
- package/build/runtime-chunk-5JEZ42OM.js.br +0 -0
- package/build/runtime-chunk-5JEZ42OM.js.gz +0 -0
- package/build/runtime-chunk-5RXW5MNJ.js.br +0 -0
- package/build/runtime-chunk-5RXW5MNJ.js.gz +0 -0
- package/build/runtime-chunk-AELTGHV2.js.gz +0 -0
- package/build/runtime-chunk-BMA5KYBS.js.br +0 -0
- package/build/runtime-chunk-BMA5KYBS.js.gz +0 -0
- package/build/runtime-chunk-CKT62HES.js.br +0 -0
- package/build/runtime-chunk-CKT62HES.js.gz +0 -0
- package/build/runtime-chunk-DHWGP6NU.js.br +0 -0
- package/build/runtime-chunk-DHWGP6NU.js.gz +0 -0
- package/build/runtime-chunk-DK66VKWP.js.br +0 -0
- package/build/runtime-chunk-DK66VKWP.js.gz +0 -0
- package/build/runtime-chunk-E3IEBR27.js.br +0 -0
- package/build/runtime-chunk-E3IEBR27.js.gz +0 -0
- package/build/runtime-chunk-EJJZJ5MV.js.br +0 -0
- package/build/runtime-chunk-EJJZJ5MV.js.gz +0 -0
- package/build/runtime-chunk-F3ZACLZW.js.br +0 -0
- package/build/runtime-chunk-F3ZACLZW.js.gz +0 -0
- package/build/runtime-chunk-GZ7C2GJM.js.br +0 -0
- package/build/runtime-chunk-GZ7C2GJM.js.gz +0 -0
- package/build/runtime-chunk-HK23JJVH.js.br +0 -0
- package/build/runtime-chunk-HK23JJVH.js.gz +0 -0
- package/build/runtime-chunk-HZ6FL5GH.js.br +0 -0
- package/build/runtime-chunk-HZ6FL5GH.js.gz +0 -0
- package/build/runtime-chunk-KE6HNYUL.js +0 -1
- package/build/runtime-chunk-KE6HNYUL.js.br +0 -0
- package/build/runtime-chunk-KE6HNYUL.js.gz +0 -0
- package/build/runtime-chunk-KNL33WN7.js +0 -1
- package/build/runtime-chunk-KNL33WN7.js.br +0 -0
- package/build/runtime-chunk-KNL33WN7.js.gz +0 -0
- package/build/runtime-chunk-OUXEWX5Z.js.br +0 -0
- package/build/runtime-chunk-OUXEWX5Z.js.gz +0 -0
- package/build/runtime-chunk-PDASWDVC.js.gz +0 -0
- package/build/runtime-chunk-RLYG5YBB.js.br +0 -1
- package/build/runtime-chunk-RLYG5YBB.js.gz +0 -0
- package/build/runtime-chunk-TAY7IXEZ.js.br +0 -0
- package/build/runtime-chunk-TAY7IXEZ.js.gz +0 -0
- package/build/runtime-chunk-UIM3XKIT.js.br +0 -0
- package/build/runtime-chunk-UIM3XKIT.js.gz +0 -0
- package/build/runtime-chunk-USGQ26QU.js.br +0 -0
- package/build/runtime-chunk-USGQ26QU.js.gz +0 -0
- package/build/runtime-chunk-YULW5JRE.js.br +0 -0
- package/build/runtime-chunk-YULW5JRE.js.gz +0 -0
- package/build/runtime-classicRuntime-U672GAGM.js.br +0 -0
- package/build/runtime-classicRuntime-U672GAGM.js.gz +0 -0
- package/build/runtime-cloners-2AC7OZRC.js.br +0 -0
- package/build/runtime-cloners-2AC7OZRC.js.gz +0 -0
- package/build/runtime-components-L63NUGAO.js.br +0 -0
- package/build/runtime-components-L63NUGAO.js.gz +0 -0
- package/build/runtime-createDestroy-QHHQ6LYS.js.br +0 -0
- package/build/runtime-createDestroy-QHHQ6LYS.js.gz +0 -0
- package/build/runtime-dragDrop-YBSWK3ET.js.br +0 -0
- package/build/runtime-dragDrop-YBSWK3ET.js.gz +0 -0
- package/build/runtime-gameControls-DSJRSTW5.js.br +0 -0
- package/build/runtime-gameControls-DSJRSTW5.js.gz +0 -0
- package/build/runtime-hair-V4RTCES2.js.br +0 -2
- package/build/runtime-hair-V4RTCES2.js.gz +0 -0
- package/build/runtime-mergeStaticGeometries-VXENKMD4.js.br +0 -0
- package/build/runtime-mergeStaticGeometries-VXENKMD4.js.gz +0 -0
- package/build/runtime-miscActions-RPUPHHGJ.js.br +0 -0
- package/build/runtime-miscActions-RPUPHHGJ.js.gz +0 -0
- package/build/runtime-mouseHover-HG6AHA2L.js.br +0 -0
- package/build/runtime-mouseHover-HG6AHA2L.js.gz +0 -0
- package/build/runtime-particles-ZHE2MC33.js.br +0 -0
- package/build/runtime-particles-ZHE2MC33.js.gz +0 -0
- package/build/runtime-paths-GN6E6ZYL.js.br +0 -0
- package/build/runtime-paths-GN6E6ZYL.js.gz +0 -0
- package/build/runtime-resize-LACR4RFK.js.br +0 -0
- package/build/runtime-resize-LACR4RFK.js.gz +0 -0
- package/build/runtime-sceneTransition-QLPFYHHY.js.br +0 -0
- package/build/runtime-sceneTransition-QLPFYHHY.js.gz +0 -0
- package/build/runtime-scroll-WZZBT2XR.js.br +0 -0
- package/build/runtime-scroll-WZZBT2XR.js.gz +0 -0
- package/build/runtime-shapeBlends-O6ATLCCA.js +0 -1
- package/build/runtime-shapeBlends-O6ATLCCA.js.br +0 -0
- package/build/runtime-shapeBlends-O6ATLCCA.js.gz +0 -0
- package/build/runtime-text-UADJSRL4.js.br +0 -0
- package/build/runtime-text-UADJSRL4.js.gz +0 -0
- package/build/runtime-textInputs-7U3TTJ4X.js.br +0 -0
- package/build/runtime-textInputs-7U3TTJ4X.js.gz +0 -0
- package/build/runtime-timeline-JXKHKUAC.js +0 -1
- package/build/runtime-timeline-JXKHKUAC.js.br +0 -0
- package/build/runtime-timeline-JXKHKUAC.js.gz +0 -0
- package/build/runtime-tracking-MC74576T.js.br +0 -0
- package/build/runtime-tracking-MC74576T.js.gz +0 -0
- package/build/runtime-transitions-S22YS7E6.js.br +0 -0
- package/build/runtime-transitions-S22YS7E6.js.gz +0 -0
- package/build/runtime-ui2d-EX3RBXPP.js.br +0 -0
- package/build/runtime-ui2d-EX3RBXPP.js.gz +0 -0
- package/build/runtime-vectorShapes-J5Y3LMND.js.br +0 -0
- package/build/runtime-vectorShapes-J5Y3LMND.js.gz +0 -0
- package/build/runtime-webgpu-LDZ3N2D5.js.br +0 -0
- package/build/runtime-webgpu-LDZ3N2D5.js.gz +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as t}from"./runtime-chunk-N2ZRGNPR.js";import{a as e,c as i}from"./runtime-chunk-VAVYZ35B.js";import{b as s,c as o,d as a,e as n}from"./runtime-chunk-FQNSP44B.js";import{a as r}from"./runtime-chunk-RLYG5YBB.js";import{G as h,a as l}from"./runtime-chunk-DK66VKWP.js";import{f as d,g as c}from"./runtime-chunk-EPHVY3XO.js";import{h as p}from"./runtime-chunk-CKT62HES.js";import{a as m,b as u,g as y,h as v,i as g}from"./runtime-chunk-2PT2WH66.js";import{a as f}from"./runtime-chunk-4KZXQGUQ.js";import{c as b}from"./runtime-chunk-TZCHGFVF.js";import{Fa as E}from"./runtime-chunk-VPEJ5BFD.js";import{Bc as P,Dc as C,Ec as M,Fc as x,Oc as T,Oe as S,Pc as D,Rc as w,Xc as R,b as j,bd as G,cd as L,dd as B}from"./runtime-chunk-VGN7YHB7.js";var A=200,W=null;function O(t){W=t}function I(){return W}function F(t){let e=!1;return t.scene.objects.forEach(i=>{"Page"===i.data.type&&!e&&i.data.publish.gameControlObject&&E.traverseModuleInstances(t,i.id,(t,i,s)=>{for(let t of s)"GameControl"===t.data.type&&t.data.navmesh.enabled&&(e=!0)})}),e}function k(t){return s?t.metaKey:t.ctrlKey}function V(t,e){return Math.abs(t+3*e)<=2||Math.abs(t+3*window.devicePixelRatio*e)<=2}var z={type:"change"},H={type:"start"},Z={type:"end",nonOrbit:!0},U={type:"end",nonOrbit:!1},Y={type:"end",isZoom:!0,nonOrbit:!0},X={type:"end",changed:!1},N={type:"cameraAnimatingInTimeline"},K=new M,_=new C,q=2*Math.PI,Q=new x,J=new C,$=new x,tt=new M,et=new T,it={type:"requestRender"},st=class extends P{constructor(t,i,s={isPlayMode:!1,isExport:!1},a){super(),this.object=t,this.domElement=i,this.options=s,this.timelineState=a,this.enabled=!0,this.useKeyEvents=!0,this.enableDamping=!1,this.enableZoom=!0,this.enableRotate=!0,this.enablePan=!0,this.autoRotate=!1,this.rotationLimitsMode=0,this.panLimitsMode=0,this.rotationSoftLimit=2,this.panSoftLimit=2,this.hoverRotatePanMode=0,this.zoomLimitsEnabled=!1,this.mouseButtons=[0,5],this.mouseButtonsPlay=[3,4,5],this.touches=[null,j.DOLLY_ROTATE,j.PAN],this.offset=new x,this.eye=new x,this.lastPosition=new x,this.lastQuaternion=new M,this.current=new C,this.overShoot=new C,this.overRatio=new C,this.spherical=new S,this.sphericalDelta=new S,this.panOffset=new x,this.panLeftV=new x,this.panUpV=new x,this.panV=new x,this.rotateStart=new C,this.rotateEnd=new C,this.rotateDelta=new C,this.panStart=new C,this.panEnd=new C,this.panDelta=new C,this.dollyStart=new C,this.dollyEnd=new C,this.dollyDelta=new C,this.rotationRangeFactor=new C,this.panRangeFactor=new C,this.state=-1,this.zoomChanged=!1,this.isPointerDown=!1,this.isThetaFlipped=!1,this.prevScale=0,this.scale=1,this.gesture=!1,this.lastTrackpadPanTime=-1/0,this.lastMouseWheelZoomTime=-1/0,this.timer=-1,this.timerHover=-1,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPhi=0,this.maxPhi=Math.PI,this.minTheta=-1/0,this.maxTheta=1/0,this.minH=0,this.maxH=Math.PI,this.minV=-1/0,this.maxV=1/0,this.autoRotateClockwise=!0,this.isPanOverShoot=!1,this.isRotateOverShoot=!1,this.resetHoverEffectOnPointerLeave=!1,this.hasChange=!1,this.useWindowEvents=!1,this.isTouchZoom=!0,this.autoRotateSpeed=2,this.dampingFactor=.125,this.zoomSpeed=2,this.rotateSpeed=1,this.rotateFactor=1,this.panSpeed=1,this.hoverRotatePanStrength=.1,this.hoverRotateDamping=this.dampingFactor,this.isCurrentlyDamping=!1,this.thetaIsFree=!1,this.phiIsFree=!1,this.needsUpdate=!0,this.onCameraChange=t=>{this.object.removeEventListener("beginState",this.onBeginState),this.object.removeEventListener("completeState",this.onCompleteState),this.object.removeEventListener("cameraChange",this.onCameraChange),this.object=t.camera,this.object.addEventListener("beginState",this.onBeginState),this.object.addEventListener("completeState",this.onCompleteState),this.object.addEventListener("cameraChange",this.onCameraChange)},this.update=()=>{this.object.updateWorldMatrix(!0,!1),this.object.matrixWorld.decompose($,tt,Q),this.offset.copy($).sub(this.target),this.spherical.setFromVector3(this.offset),this.object.isUpVectorFlipped&&(this.spherical.phi*=-1,this.spherical.theta-=Math.PI),this.autoRotate&&-1===this.state&&this.rotateLeft((!0===this.autoRotateClockwise?1:-1)*this.getAutoRotationAngle()),0!==this.rotationLimitsMode&&this.applyLimits(this.sphericalDelta,this.rotationLimitsMode,this.rotationSoftLimit,this.maxTheta,this.minTheta,this.maxPhi,this.minPhi,this.rotationRangeFactor),2!==this.rotationLimitsMode&&(this.spherical.phi+=this.sphericalDelta.phi),(1!==this.rotationLimitsMode||!0===this.autoRotate)&&(this.spherical.theta+=this.sphericalDelta.theta),this.spherical.radius*=this.scale,this.zoomLimitsEnabled&&this.object.isPerspectiveCamera&&(this.spherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.spherical.radius))),0!==this.panLimitsMode&&(this.target.applyQuaternion(K.copy(tt).invert()),this.panOffset.applyQuaternion(K),this.applyLimits(this.panOffset,this.panLimitsMode,this.panSoftLimit,this.maxH,this.minH,this.maxV,this.minV,this.panRangeFactor),this.target.applyQuaternion(tt),this.panOffset.applyQuaternion(tt)),2===this.panLimitsMode&&(this.panOffset.y=0),1===this.panLimitsMode&&(this.panOffset.x=0),-1!==this.state||this.gesture?(this.target.add(this.panOffset),this.panOffset.set(0,0,0)):(this.panOffset.multiplyScalar(1-this.dampingFactor),this.target.add(this.panOffset)),this.offset.setFromSpherical(this.spherical),$.copy(this.target).add(this.offset),this.object.position.copy(this.target).add(this.offset),this.object.parent&&(et.copy(this.object.parent.matrixWorld).invert(),this.object.position.applyMatrix4(et));let t=this.spherical.phi%q;if(this.eye.copy(this.offset).normalize(),this.object.up.copy(w.DEFAULT_UP).applyAxisAngle(this.eye,this.object.angleOffsetFromUp),t>0&&t>Math.PI||t<0&&t>-Math.PI?(this.object.up.negate(),this.object.lookAt(this.target),this.object.isUpVectorFlipped=!0):(this.object.lookAt(this.target),this.object.isUpVectorFlipped=!1),-1===this.state||!0===this.enableDamping){let t=1===this.hoverRotatePanMode?this.hoverRotateDamping:this.dampingFactor;this.sphericalDelta.theta*=1-t,this.sphericalDelta.phi*=1-t}else this.sphericalDelta.set(0,0,0);if(this.scale=1,this.lastPosition.distanceToSquared(this.object.position)>.01||8*(1-this.lastQuaternion.dot(this.object.quaternion))>1e-8)return this.dispatchEvent(z),this.object.dispatchEvent(it),this.lastPosition.copy(this.object.position),this.lastQuaternion.copy(this.object.quaternion),void(this.isCurrentlyDamping=!0);this.isPanOverShoot=!1,this.isRotateOverShoot=!1,this.object.wasMovedBySwitchCameraAction=!1,this.sphericalDelta.set(0,0,0),this.panOffset.set(0,0,0),this.isCurrentlyDamping=!1},this.onPointerDown=t=>{!1!==this.enabled&&("touch"===t.pointerType||"pen"===t.pointerType&&n?this.onPointerDownTouch(t):this.onPointerDownMouse(t),-1!==this.state&&(this.isPointerDown=!0,this.dispatchEvent(H),this.domElement.addEventListener("pointermove",this.onPointerMove),this.domElement.addEventListener("pointerup",this.onPointerUp),t.stopPropagation(),"touch"===t.pointerType||"pen"===t.pointerType&&n||this.domElement.setPointerCapture(t.pointerId)))},this.onPointerLeave=t=>{this.resetHoverEffectOnPointerLeave&&!this.useWindowEvents?(1===this.hoverRotatePanMode?(this.sphericalDelta.theta=-this.spherical.theta,this.sphericalDelta.phi=-this.spherical.phi,Q.subVectors(this.position0,this.target0),this.spherical.setFromVector3(Q),this.sphericalDelta.theta+=this.spherical.theta,this.sphericalDelta.phi+=this.spherical.phi,this.sphericalDelta.theta/=8,this.sphericalDelta.phi/=8):2===this.hoverRotatePanMode&&this.panOffset.subVectors(this.target0,this.target).divideScalar(8),this.update()):this.pointerLeaveEvent=t},this.onPointerEnter=t=>{this.resetHoverEffectOnPointerLeave||void 0===this.pointerLeaveEvent?J.set(t.clientX-this.domElement.clientWidth/2,t.clientY-this.domElement.clientHeight/2):J.set(t.clientX-this.pointerLeaveEvent.clientX,t.clientY-this.pointerLeaveEvent.clientY),1===this.hoverRotatePanMode?(this.rotateDelta.copy(J).multiplyScalar(this.rotateSpeed*this.hoverRotatePanStrength).rotateAround(_,-this.object.angleOffsetFromUp),this.rotateLeft(2*Math.PI*this.rotateDelta.x/this.domElement.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/this.domElement.clientHeight),this.rotateStart.set(t.clientX,t.clientY)):2===this.hoverRotatePanMode&&(this.panDelta.copy(J).multiplyScalar(this.panSpeed*this.hoverRotatePanStrength),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.set(t.clientX,t.clientY)),this.update()},this.onPointerMove=t=>{this.timelineState?.isPlayingCameraAnimation?this.dispatchEvent(N):!1!==this.enabled&&(this.checkRaycastLock()||("touch"===t.pointerType||"pen"===t.pointerType&&n?this.onPointerMoveTouch(t):this.onPointerMoveMouse(t),t.stopPropagation()))},this.onPointerUp=t=>{this.isPointerDown=!1,0===e.length&&(this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp)),e.length>1&&t.preventDefault(),this.hasChange?this.dispatchEvent(0===this.state?U:Z):this.dispatchEvent(X),this.state=-1,t&&(t.stopPropagation(),"touch"===t.pointerType||"pen"===t.pointerType&&n||this.domElement.releasePointerCapture(t.pointerId))},this.onPointerDownMouse=t=>{let e;switch(e=this.useKeyEvents?this.mouseButtons[t.button]:this.mouseButtonsPlay[t.button],e){case 0:if(!0!==t.altKey||t.shiftKey||k(t)){if(" "===this.key){if(!1===this.enablePan)return;this.handleMouseDownPan(t),this.state=2}}else{if(!1===this.enableRotate)return;this.handleMouseDownRotate(t),this.state=0}break;case 4:if(!1===this.enablePan)return;this.handleMouseDownPan(t),this.state=2;break;case 3:if(k(t)||t.shiftKey){if(!1===this.enablePan)return;this.handleMouseDownPan(t),this.state=2}else{if(!1===this.enableRotate)return;this.handleMouseDownRotate(t),this.state=0}break;case 5:if(k(t)||t.shiftKey){if(!1===this.enableRotate)return;this.handleMouseDownRotate(t),this.state=0}else{if(!1===this.enablePan)return;this.handleMouseDownPan(t),this.state=2}break;default:this.state=-1}},this.onPointerMoveMouse=t=>{switch(this.state){case 0:if(!1===this.enableRotate)return;this.handleMouseMoveRotate(t);break;case 1:if(!1===this.enableZoom)return;this.handleMouseMoveDolly(t);break;case 2:if(!1===this.enablePan)return;this.handleMouseMovePan(t)}this.object.wasMovedByUser=!0},this.onPointerDownTouch=t=>{switch(e.length>1&&t.preventDefault(),this.touches[e.length-1]){case j.ROTATE:if(!1===this.enableRotate)return void(this.state=-1);this.handleTouchStartRotate(),this.state=3;break;case j.PAN:if(!1===this.enablePan)return void(this.state=-1);this.handleTouchStartPan(),this.state=4;break;case j.DOLLY_PAN:if(!1===this.enableZoom&&!1===this.enablePan)return;this.handleTouchStartDollyPan(),this.state=5;break;case j.DOLLY_ROTATE:if(!1===this.enableZoom&&!1===this.enableRotate)return;this.handleTouchStartDollyRotate(),this.state=6;break;default:this.state=-1}},this.onPointerMoveTouch=t=>{switch(e.length>1&&t.preventDefault(),this.state){case 3:if(!1===this.enableRotate)return;this.handleTouchMoveRotate(t),this.update();break;case 4:if(!1===this.enablePan)return;this.handleTouchMovePan(t),this.update();break;case 5:if(!1===this.enableZoom&&!1===this.enablePan)return;this.handleTouchMoveDollyPan(t),this.update();break;case 6:if(!1===this.enableZoom&&!1===this.enableRotate)return;this.handleTouchMoveDollyRotate(t),this.update();break;default:this.state=-1}this.object.wasMovedByUser=!0},this.dispatchEndDebounced=f(()=>{this.zoomChanged?this.dispatchEvent(Y):this.dispatchEvent(Z),this.zoomChanged=!1},33),this.onMouseWheel=t=>{if(!1!==this.enabled&&(!1!==this.enableZoom||!1!==this.enablePan)&&!this.checkRaycastLock()){if(!this.options.isExport&&this.domElement.clientHeight===document.body.clientHeight&&this.domElement.clientWidth===document.body.clientWidth&&t.preventDefault(),this.dispatchEvent(H),this.timelineState?.isPlayingCameraAnimation)return void this.dispatchEvent(N);this.handleMouseWheel(t),this.dispatchEndDebounced(),this.object.wasMovedByUser=!0}},this.onGesture=t=>{if(t.preventDefault(),!1!==this.enabled&&!this.checkRaycastLock()&&!o){if(this.timelineState?.isPlayingCameraAnimation)return void this.dispatchEvent(N);if("gesturechange"===t.type){if(!1===this.enableZoom||!1===this.isTouchZoom)return;this.dispatchEvent(H),t.scale>this.prevScale?this.dollyIn(this.getZoomScale()):t.scale<this.prevScale&&this.dollyOut(this.getZoomScale()),this.prevScale=t.scale,this.update(),this.object.wasMovedByUser=!0}else this.dispatchEvent(Z)}},this.onContextMenu=t=>{t.preventDefault()},this.onTouchEnd=t=>{t.preventDefault()},this.onKeyDown=t=>{!1!==this.enabled&&(this.key=t.key," "===t.key&&this.dispatchEvent(H))},this.onKeyUp=t=>{this.key=void 0,!1!==this.enabled&&(-1!==this.state&&"Alt"===t.key&&this.onPointerUp(e[0])," "===t.key&&this.dispatchEvent(Z))},this.onPointerHover=t=>{"mouse"!==t.pointerType||!1===this.enabled||-1!==this.state||2===this.hoverRotatePanMode&&this.isPanOverShoot||1===this.hoverRotatePanMode&&this.isRotateOverShoot||(this.isPointerDown=!0,2===this.hoverRotatePanMode?this.handleMouseMovePan(t,this.hoverRotatePanStrength):1===this.hoverRotatePanMode&&this.handleMouseMoveRotate(t,this.hoverRotatePanStrength))},this.onBeginState=()=>{this.enabled=!1,this.needsUpdate=!1},this.onCompleteState=t=>{t.isfromEntity&&this.options.isPlayMode||(this.enabled=!0,this.needsUpdate=!0,this.object.updateUp(),this.object.getTarget(this.target))},this.target=this.object.getTarget(),this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.quat0=this.object.quaternion.clone(),this.isUpVectorFlipped0=this.object.isUpVectorFlipped,this.object.updateWorldMatrix(!0,!1),this.object.matrixWorld.decompose($,tt,Q),this.offset.copy($).sub(this.target),this.spherical.setFromVector3(this.offset),this.object.isUpVectorFlipped&&(this.spherical.phi*=-1,this.spherical.theta-=Math.PI),this.initialSphericalRadius=this.spherical.radius,this.addEventListenersToCamera()}dispatchEvent(t){"start"===t.type?this.hasChange=!1:this.hasChange=!0,super.dispatchEvent(t)}addEventListenersToCamera(){this.object.addEventListener("beginState",this.onBeginState),this.object.addEventListener("completeState",this.onCompleteState),this.object.addEventListener("cameraChange",this.onCameraChange)}removeEventListenersFromCamera(){this.object.removeEventListener("beginState",this.onBeginState),this.object.removeEventListener("completeState",this.onCompleteState),this.object.removeEventListener("cameraChange",this.onCameraChange)}updateUseWindowEvents(t){if(window.removeEventListener("pointermove",this.onPointerHover),this.domElement.removeEventListener("pointermove",this.onPointerHover),this.useWindowEvents=t,0!==this.hoverRotatePanMode&&(this.useWindowEvents?window.addEventListener("pointermove",this.onPointerHover):this.domElement.addEventListener("pointermove",this.onPointerHover)),this.domElement.removeEventListener("pointerleave",this.onPointerLeave),this.domElement.removeEventListener("pointerenter",this.onPointerEnter),window.removeEventListener("pointerleave",this.onPointerLeave),window.removeEventListener("pointerenter",this.onPointerEnter),0!==this.hoverRotatePanMode&&!this.useWindowEvents){let t=this.useWindowEvents?window:this.domElement;t.addEventListener("pointerleave",this.onPointerLeave),t.addEventListener("pointerenter",this.onPointerEnter)}}fromJSON(t,e){this.rotateFactor=t.rotationSpeed??1,this.setEnableDampingSpeed(t.enableDamping),this.enablePan=t.enablePan,this.enableZoom=t.enableZoom,this.enableRotate=t.enableRotate,this.rotationLimitsMode=t.rotationLimitsMode,this.thetaIsFree=t.rotationHorizontalOffset.min===t.rotationHorizontalOffset.max&&t.rotationHorizontalOffset.min===Math.PI,this.phiIsFree=t.rotationVerticalOffset.min===t.rotationVerticalOffset.max&&t.rotationVerticalOffset.min===Math.PI,this.panLimitsMode=t.panLimitsMode,this.panSoftLimit=t.panSoftLimit,this.rotationSoftLimit=t.rotationSoftLimit,this.hoverRotatePanMode=t.hoverRotatePanMode,this.hoverRotateDamping=t.hoverRotateDamping??this.dampingFactor,this.useWindowEvents="window"===e,0!==this.hoverRotatePanMode&&(this.useWindowEvents?window.addEventListener("pointermove",this.onPointerHover):this.domElement.addEventListener("pointermove",this.onPointerHover));let i=t.hoverRotatePanStrength/100;this.hoverRotatePanStrength=i**2,this.zoomLimitsEnabled=t.zoomLimitsEnabled,this.minZoom=t.zoomLimits.min,this.maxZoom=Math.max(t.zoomLimits.min,t.zoomLimits.max),this.minDistance=1e3/this.maxZoom,this.maxDistance=Math.max(this.minDistance,1e3/t.zoomLimits.min),this.autoRotate=t.autoRotate,this.autoRotateSpeed=t.autoRotateSpeed,this.autoRotateClockwise=t.autoRotateClockwise;let s=this.object.getTarget().applyQuaternion(K.copy(this.object.quaternion).invert());this.minV=-t.panVerticalOffset.min+s.y,this.maxV=t.panVerticalOffset.max+s.y,this.minH=-t.panHorizontalOffset.min+s.x,this.maxH=t.panHorizontalOffset.max+s.x,this.panRangeFactor.set(this.maxH-this.minH,this.maxV-this.minV).divideScalar(2),this.rotationRangeFactor.setScalar(Math.PI).divideScalar(4),this.minPhi=ot(this.spherical.phi-t.rotationVerticalOffset.min),this.maxPhi=ot(this.spherical.phi+t.rotationVerticalOffset.max),this.minTheta=ot(ot(this.spherical.theta)-t.rotationHorizontalOffset.min),this.maxTheta=ot(ot(this.spherical.theta)+t.rotationHorizontalOffset.max),this.isThetaFlipped=this.minTheta>this.maxTheta,1===t.orbitTouches&&(this.touches[0]=j.ROTATE),1===t.panTouches&&(this.touches[0]=j.PAN),2===t.orbitTouches&&(this.touches[1]=j.DOLLY_ROTATE),2===t.panTouches&&(this.touches[1]=j.DOLLY_PAN),3===t.orbitTouches&&(this.touches[2]=j.ROTATE),3===t.panTouches&&(this.touches[2]=j.PAN),this.isTouchZoom=t.isTouchZoom,this.resetHoverEffectOnPointerLeave=t.resetHoverEffectOnPointerLeave??!1}connect(){if(this.domElement.addEventListener("contextmenu",this.onContextMenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("wheel",this.onMouseWheel),window.addEventListener("keydown",this.onKeyDown,!1),window.addEventListener("keyup",this.onKeyUp,!1),this.domElement.addEventListener("gesturestart",this.onGesture),this.domElement.addEventListener("gesturechange",this.onGesture),this.domElement.addEventListener("gestureend",this.onGesture),this.domElement.addEventListener("touchend",this.onTouchEnd),0!==this.hoverRotatePanMode&&!this.useWindowEvents){let t=this.useWindowEvents?window:this.domElement;t.addEventListener("pointerleave",this.onPointerLeave),t.addEventListener("pointerenter",this.onPointerEnter)}this.pointerLeaveEvent=void 0}dispose(){this.removeEventListenersFromCamera(),this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("wheel",this.onMouseWheel),window.removeEventListener("keydown",this.onKeyDown,!1),window.removeEventListener("keyup",this.onKeyUp,!1),this.domElement.removeEventListener("pointermove",this.onPointerHover),window.removeEventListener("pointermove",this.onPointerHover),this.domElement.removeEventListener("gesturestart",this.onGesture),this.domElement.removeEventListener("gesturechange",this.onGesture),this.domElement.removeEventListener("gestureend",this.onGesture),this.domElement.removeEventListener("touchend",this.onTouchEnd),this.domElement.removeEventListener("pointerleave",this.onPointerLeave),this.domElement.removeEventListener("pointerenter",this.onPointerEnter),window.removeEventListener("pointerleave",this.onPointerLeave),window.removeEventListener("pointerenter",this.onPointerEnter),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp)}applyLimits(t,e,i,s,o,a,n,r){let h,l,d;this.overShoot.set(0,0),t instanceof x?(h=t.x,l=t.y,this.current.set(this.target.x,this.target.y),d=!0):(h=t.theta,l=t.phi,this.current.set(ot(this.spherical.theta),ot(this.spherical.phi)),d=!1),0===i&&(this.current.x+=h,this.current.y+=l),(3===e||2===e)&&(!d&&this.isThetaFlipped?this.current.x>s&&this.current.x<0?this.overShoot.x=s-this.current.x:this.current.x<o&&this.current.x>0&&(this.overShoot.x=o-this.current.x):this.current.x>s?this.overShoot.x=s-this.current.x:this.current.x<o&&(this.overShoot.x=o-this.current.x)),(3===e||1===e)&&(this.current.y>a?this.overShoot.y=a-this.current.y:this.current.y<n&&(this.overShoot.y=n-this.current.y)),d||(this.overShoot.x=ot(this.overShoot.x),this.overShoot.y=ot(this.overShoot.y)),0!==i?(this.overRatio.copy(this.overShoot).divide(r),this.overRatio.x=Math.min(Math.abs(this.overRatio.x),1),this.overRatio.y=Math.min(Math.abs(this.overRatio.y),1),1===i&&(this.overRatio.x=at(Math.abs(this.overRatio.x)),this.overRatio.y=at(Math.abs(this.overRatio.y))),this.isPointerDown||1===i?2===i&&(this.overRatio.x>.9&&!this.thetaIsFree||this.overRatio.y>.9&&!this.phiIsFree)?this.isPointerDown=!1:(h*this.overShoot.x<0&&!this.thetaIsFree&&(h*=1-this.overRatio.x),l*this.overShoot.y<0&&!this.phiIsFree&&(l*=1-this.overRatio.y)):2===i&&(!d&&(this.overRatio.x>.002&&!this.thetaIsFree||this.overRatio.y>.002&&!this.phiIsFree)||d&&(Math.abs(this.overShoot.x)>2||Math.abs(this.overShoot.y)>2)?(this.thetaIsFree||(h=.05*this.overShoot.x),this.phiIsFree||(l=.05*this.overShoot.y),d?this.isPanOverShoot=!0:this.isRotateOverShoot=!0):d?this.isPanOverShoot=!1:this.isRotateOverShoot=!1)):(h+=this.overShoot.x,l+=this.overShoot.y),t instanceof x?(t.x=h,t.y=l):(this.thetaIsFree||(t.theta=h),this.phiIsFree||(t.phi=l))}setEnableDampingSpeed(t){this.enableDamping=t,this.rotateSpeed=(!0===t?.2:1)*this.rotateFactor}stopDamping(){this.sphericalDelta.theta=0,this.sphericalDelta.phi=0,this.panOffset.set(0,0,0)}setTarget(t,e,i){this.stopDamping(),this.target.set(t,e,i)}getAutoRotationAngle(){return 2*Math.PI/60/60*this.autoRotateSpeed}getZoomScale(){return Math.pow(.95,this.zoomSpeed)}rotateLeft(t){this.sphericalDelta.theta-=t}rotateUp(t){this.sphericalDelta.phi-=t}panLeft(t,e){this.panLeftV.setFromMatrixColumn(e,0),this.panLeftV.multiplyScalar(-t),this.panOffset.add(this.panLeftV)}panUp(t,e){this.panUpV.setFromMatrixColumn(e,1),this.panUpV.multiplyScalar(t),this.panOffset.add(this.panUpV)}pan(t,e){let i=this.domElement;if(i&&this.object.isPerspectiveCamera){let s=this.object.position;this.panV.copy(s).sub(this.target);let o=this.panV.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this.panLeft(2*t*o/i.clientHeight,this.object.matrixWorld),this.panUp(2*e*o/i.clientHeight,this.object.matrixWorld)}else i&&this.object.isOrthographicCamera&&(this.panLeft(t*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrixWorld),this.panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrixWorld));this.dispatchEvent(z)}dollyOut(t){this.object.isPerspectiveCamera?this.scale/=t:this.object.isOrthographicCamera&&(this.object.zoom*=t,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0),this.dispatchEvent(z)}dollyIn(t){this.object.isPerspectiveCamera?this.scale*=t:this.object.isOrthographicCamera&&(this.object.zoom/=t,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0),this.dispatchEvent(z)}setZoom(t){if(this.dispatchEvent(H),this.object.isPerspectiveCamera){let e=this.initialSphericalRadius/t/this.spherical.radius;this.scale=e}else this.object.isOrthographicCamera&&(this.object.zoom=t,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0);this.dispatchEvent(Z)}handleMouseDownRotate(t){this.rotateStart.set(t.clientX,t.clientY)}handleMouseDownDolly(t){this.dollyStart.set(t.clientX,t.clientY)}handleMouseDownPan(t){this.panStart.set(t.clientX,t.clientY)}handleMouseMoveRotate(t,e=1){void 0!==t.movementX?this.rotateDelta.set(t.movementX,t.movementY):(this.rotateEnd.set(t.clientX,t.clientY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart),this.rotateStart.copy(this.rotateEnd)),this.rotateDelta.multiplyScalar(this.rotateSpeed*e).rotateAround(_,-this.object.angleOffsetFromUp);let i=this.domElement,s=this.useWindowEvents?window.innerHeight:i.clientHeight,o=2*Math.PI*this.rotateDelta.x/s,a=2*Math.PI*this.rotateDelta.y/s;this.rotateLeft(o),this.rotateUp(a),this.update()}handleMouseMoveDolly(t){this.dollyEnd.set(t.clientX,t.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),this.dollyDelta.y>0?this.dollyOut(this.getZoomScale()):this.dollyDelta.y<0&&this.dollyIn(this.getZoomScale()),this.dollyStart.copy(this.dollyEnd),this.update()}handleMouseMovePan(t,e=1){void 0!==t.movementX?this.panDelta.set(t.movementX,t.movementY):(this.panEnd.set(t.clientX,t.clientY),this.panDelta.subVectors(this.panEnd,this.panStart),this.panStart.copy(this.panEnd)),this.panDelta.multiplyScalar(this.panSpeed*e),this.pan(this.panDelta.x,this.panDelta.y),this.update()}handleMouseWheel(t){if(0===t.deltaX&&0===t.deltaY)return;let e=!0===t.ctrlKey||!0===k(t),i=!1===k(t)&&!0===(0===(r=t).wheelDeltaY||0===r.deltaY?!(s&&r.shiftKey&&Math.abs(r.wheelDeltaX)>=120)&&(r.wheelDeltaX?V(r.wheelDeltaX,r.deltaX):0===r.deltaMode):r.wheelDeltaY?V(r.wheelDeltaY,r.deltaY):0===r.deltaMode),o=!1===e&&(!0===this.gesture||t.timeStamp-this.lastTrackpadPanTime<300),n=!1===e&&!1===o&&t.timeStamp-this.lastMouseWheelZoomTime<300;var r;if(!1!==a||!1!==n||!0!==i&&!0!==o){if(!1===this.enableZoom)return;this.gesture&&(window.clearTimeout(this.timer),this.gesture=!1,this.isPointerDown=!1,this.dispatchEvent(Z)),!1===e&&!1===i&&(this.lastMouseWheelZoomTime=t.timeStamp),0===t.deltaY?t.deltaX<0?this.dollyIn(this.getZoomScale()):t.deltaX>0&&this.dollyOut(this.getZoomScale()):t.deltaY<0?this.dollyIn(this.getZoomScale()):t.deltaY>0&&this.dollyOut(this.getZoomScale()),this.update(),this.gesture=!1,this.isPointerDown=!1}else{if(!1===this.enablePan)return;let e=!1===this.gesture&&!1===o;this.lastTrackpadPanTime=t.timeStamp,this.gesture||(this.gesture=!0,this.isPointerDown=!0),!1===e&&(this.panDelta.set(-t.deltaX,-t.deltaY).multiplyScalar(this.panSpeed),this.panDelta.x=Math.min(Math.abs(this.panDelta.x),100)*(this.panDelta.x<0?-1:1),this.panDelta.y=Math.min(Math.abs(this.panDelta.y),100)*(this.panDelta.y<0?-1:1),t.altKey?this.pan(0,this.panDelta.y):t.shiftKey?this.pan(this.panDelta.x,0):this.pan(this.panDelta.x,this.panDelta.y),this.update()),window.clearTimeout(this.timer),this.timer=window.setTimeout(()=>{this.gesture=!1,this.isPointerDown=!1,this.dispatchEvent(Z)},100)}}handleTouchStartRotate(){if(2===e.length){let t=.5*(e[0].pageX+e[1].pageX),i=.5*(e[0].pageY+e[1].pageY);this.rotateStart.set(t,i)}else this.rotateStart.set(e[0].pageX,e[0].pageY)}handleTouchStartPan(){if(2===e.length){let t=.5*(e[0].pageX+e[1].pageX),i=.5*(e[0].pageY+e[1].pageY);this.panStart.set(t,i)}else this.panStart.set(e[0].pageX,e[0].pageY)}handleTouchStartDolly(){let t=e[0].pageX-e[1].pageX,i=e[0].pageY-e[1].pageY,s=Math.sqrt(t*t+i*i);this.dollyStart.set(0,s)}handleTouchStartDollyPan(){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchStartDolly(),this.enablePan&&this.handleTouchStartPan()}handleTouchStartDollyRotate(){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchStartDolly(),this.enableRotate&&this.handleTouchStartRotate()}handleTouchMoveRotate(t){if(2===e.length){let e=i(t),s=.5*(t.pageX+e.x),o=.5*(t.pageY+e.y);this.rotateEnd.set(s,o)}else{if(t.pointerId!==e[0].pointerId)return;this.rotateEnd.set(t.pageX,t.pageY)}this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);let s=this.domElement;s&&(this.rotateLeft(2*Math.PI*this.rotateDelta.x/s.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/s.clientHeight)),this.rotateStart.copy(this.rotateEnd)}handleTouchMovePan(t){if(2===e.length){let e=i(t),s=.5*(t.pageX+e.x),o=.5*(t.pageY+e.y);this.panEnd.set(s,o)}else{if(t.pointerId!==e[0].pointerId)return;this.panEnd.set(t.pageX,t.pageY)}this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(this.panSpeed),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd)}handleTouchMoveDolly(t){let e=i(t),s=t.pageX-e.x,o=t.pageY-e.y,a=Math.sqrt(s*s+o*o);this.dollyEnd.set(0,a),this.dollyDelta.set(0,Math.pow(this.dollyEnd.y/this.dollyStart.y,this.zoomSpeed)),this.dollyOut(this.dollyDelta.y),this.dollyStart.copy(this.dollyEnd)}handleTouchMoveDollyPan(t){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchMoveDolly(t),this.enablePan&&this.handleTouchMovePan(t)}handleTouchMoveDollyRotate(t){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchMoveDolly(t),this.enableRotate&&this.handleTouchMoveRotate(t)}checkRaycastLock(){if(this.object.data.raycastLock){if(this.options.isPlayMode)return!1;{let t=this.options?.showCameraLock;return t&&t(),!0}}return!1}};function ot(t){let e=2*Math.PI;for(;t<=-Math.PI;)t+=e;for(;t>Math.PI;)t-=e;return t}function at(t){return 1-Math.pow(1-t,4)}var nt,rt,ht=new Promise(t=>{nt=t});function lt(t){return rt||(rt=async function(){let e=t??"https://cdn.spline.design/@splinetool/runtime@2.0.8/build",i=import("./physics.js"),[s,o]=await Promise.all([i,fetch(`${e}/physics.wasm`).then(t=>t.arrayBuffer())]);await s.init(o),nt(s)}())}function dt(t){let e=t.elements,i=e[0]**2+e[1]**2+e[2]**2,s=e[4]**2+e[5]**2+e[6]**2,o=e[8]**2+e[9]**2+e[10]**2,a=e[0]**2+e[4]**2+e[8]**2,n=e[1]**2+e[5]**2+e[9]**2,r=e[2]**2+e[6]**2+e[10]**2,h=1e-8;return i<h||s<h||o<h||a<h||n<h||r<h}function ct(t,e){let i=new B;if(e&&dt(e))return i.setAttribute("position",new G([],3)),i.setIndex([]),i;if(!t.getAttribute("position"))return i.setAttribute("position",new G([],3)),i.setIndex([]),i;let{positions:s,triIndices:o}=h(t.getAttribute("position"),t.getIndex());return i.setAttribute("position",new G(s,3)),i.setIndex(o),e&&i.applyMatrix4(e),i}var pt,mt=class{constructor(t,e,i,s,o,a){this.id=t,this.data=e,this.object=i,this.initialDisabled=!1,this.actions=d(e,e.actions,s,o,a,i),this.target=e.target}disconnect(){c(this.actions)}dispatch(t){this.initialDisabled||(this.actions.Transition.forEach(t=>{t.object.currentTransitionEvent!==this&&(t.object.currentTransitionEvent=this,t.init())}),this.object.dispatchEvent({type:"beginEvent",eventName:"Collision"}),this.actions.Transition.forEach(t=>{"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.Animation.forEach(t=>{"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.TimelineAnimation.forEach(t=>{"runMode"in t.data&&"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.Reset.forEach(t=>{t.dispatch()}),this.actions.Link.forEach(t=>{t.dispatch()}),this.actions.Reset.forEach(t=>{t.dispatch()}),this.actions.Create.forEach(t=>{t.dispatch()}),this.actions.Destroy.forEach(e=>{e.dispatch(t??!1)}),this.actions.SetVariable.forEach(t=>t.checkConditions()),this.actions.SetVariable.forEach(t=>t.dispatch()),this.actions.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actions.Audio.forEach(t=>{t.dispatchBasic()}),this.actions.Particles.forEach(t=>{t.dispatchBasic()}),this.actions.Video.forEach(t=>{t.dispatchBasic()}),this.actions.ClearLocalStorage.forEach(t=>t.dispatch()),this.actions.UserAPI.forEach(t=>t.dispatch()))}},ut=class{constructor(t,e,i,s,o,a){this.id=t,this.data=e,this.object=i,this.page=s,this.currentIntersectedObjects=[],this.actions=d(e,e.actions,s,o,a,i),this.target=e.target,this.triggeringObjects=[];for(let t of e.triggeringObjects){let e=s.scene.find(t);e&&this.triggeringObjects.push(e)}}isValidTriggeringObject(t){return"all"===this.target||this.triggeringObjects.some(e=>e===t||e.isAncestorOf(t.uuid)||t.isAncestorOf(e.uuid))}disconnect(){c(this.actions)}dispatch(){this.object.destroyedInAction||(this.actions.Transition.forEach(t=>{t.object.currentTransitionEvent!==this&&(t.object.currentTransitionEvent=this,t.init())}),this.object.dispatchEvent({type:"beginEvent",eventName:"Trigger"}),this.actions.Transition.forEach(t=>{"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.SwitchCamera.forEach(t=>{"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.TimelineAnimation.forEach(t=>{"runMode"in t.data&&"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.Link.forEach(t=>{t.dispatch()}),this.actions.Reset.forEach(t=>{t.dispatch()}),this.actions.Create.forEach(t=>{t.dispatch()}),this.actions.Destroy.forEach(t=>{t.dispatch(!1)}),this.actions.Audio.forEach(t=>{t.dispatchBasic()}),this.actions.Particles.forEach(t=>{t.dispatchBasic()}),this.actions.Video.forEach(t=>{t.dispatchBasic()}),this.actions.SceneTransition.forEach(t=>{t.dispatch()}),this.actions.SetVariable.forEach(t=>t.checkConditions()),this.actions.SetVariable.forEach(t=>t.dispatch()),this.actions.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actions.ClearLocalStorage.forEach(t=>t.dispatch()),this.actions.UserAPI.forEach(t=>t.dispatch()))}};ht.then(t=>pt=t);var yt=new x,vt=new M,gt=new x,ft=(new D(0,0,0,"YXZ"),new D(0,0,0,"XYZ")),bt=new x,Et=new x,Pt=new x(1,1,1),Ct=new M,Mt=new T,xt=new T,Tt={type:"updateMatrix"},St=new M,Dt=new L,wt=.01,Rt={type:"beginEvent",eventName:"Collision"},jt={type:"beginEvent",eventName:"Trigger"};function Gt(t){if(E.physicsEnabled(t.scene.objects))return!0;let e=!1;return t.scene.objects.traverse((t,i)=>{if(i.events)if(Array.isArray(i.events)){for(let t of i.events)if(!0!==t.data.disabled&&"GameControl"===t.data.type&&t.data.collisionEnabled){e=!0;break}}else for(let t of Object.values(i.events))if(!0!==t.disabled&&"GameControl"===t.type&&t.collisionEnabled){e=!0;break}}),e}var Lt=t=>t.states.some(t=>void 0!==t.data.position||void 0!==t.data.rotation||void 0!==t.data.hiddenMatrix||void 0!==t.data.cloner||void 0!==t.data.pathSnapping);function Bt(t){return y(g(t)?t.object:t)}var At,Wt,Ot,It=class{constructor(t){this.eventContext=t,this.isEnabled=!1,this.gameControl=null,this.joysticks=[],this.joystickToGameControls=[],this.sharedGameControlGlobals={entitiesWithTransformAnim:[],entityToCollisionEvents:{},colliderToEntity:new Map,kinematicBodyToEntity:new Map,triggers:[],gamePads:[],createdObjects:[],nCreatedPerAction:{}},this.sensorToTriggerEvent={},this.eventManager=void 0,this.needsCollisionDetection=!1,this.initializationCounter=-1,this.fixedBodiesToWatch=[],this.rigidBodyToMesh=new Map,this.nActiveRigidBodies=0,this.collisionEvents=[],this.isExport=!1,this.skipRender=!0,this._staticBVHAttrIds=new WeakMap,this._staticBVHNextAttrId=1,this.processRigidBody=t=>{if(t.bodyType()!==pt.RigidBodyType.Dynamic)return;t.isSleeping()||this.nActiveRigidBodies++;let[e,i,s]=this.rigidBodyToMesh.get(t.handle);if(yt.copy(t.translation()).multiplyScalar(this.pixelsPerMeter),vt.copy(t.rotation()),e.matrixWorld.compose(yt,vt,i),e.hasNonUniformScale&&e.matrixWorld.multiply(e.shearScale),e.dispatchEvent(Tt),s){let t=e.cloner;if(t&&void 0===t.objectForSample){t.matrixWorld.copy(e.matrixWorld);for(let e of t.children)e.updateMatrixWorld(!0)}for(let t of e.children)t.updateMatrixWorld(!0)}},this.accumulator=0,this.handleCollisionEvents=(t,e,i)=>{if(!1===i)return;let s,o;if(this.sensorToTriggerEvent[t]?(s=this.sensorToTriggerEvent[t],o=this.sharedGameControlGlobals.colliderToEntity.get(e)):this.sensorToTriggerEvent[e]&&(s=this.sensorToTriggerEvent[e],o=this.sharedGameControlGlobals.colliderToEntity.get(t)),s&&o&&s.isValidTriggeringObject(o))s.dispatch();else{for(let i=this.sharedGameControlGlobals.createdObjects.length-1;i>=0;i--){let s=this.sharedGameControlGlobals.createdObjects[i];if(s.userData.hasCollisionDestroy&&(s.rigidBody?.collider(0).handle===t||s.rigidBody?.collider(0).handle===e)){this.sharedGameControlGlobals.createdObjects.splice(i,1),s.removeFromParent();let t=s.rigidBody;requestAnimationFrame(()=>{s.rigidBody===t&&(this.sharedGameControlGlobals.rapierWorld?.removeRigidBody(t),s.rigidBody=void 0)});break}}if(void 0!==this.gameControl?.object&&this.gameControl.object===this.sharedGameControlGlobals.colliderToEntity.get(t)){let t=this.sharedGameControlGlobals.colliderToEntity.get(e),i=this.sharedGameControlGlobals.entityToCollisionEvents[t.uuid];if(void 0===i)return;for(let s of i)"character"===s.data.target&&this.dispatchCollisionEvent(s,t,e)}else if(void 0!==this.gameControl?.object&&this.gameControl.object===this.sharedGameControlGlobals.colliderToEntity.get(e)){let e=this.sharedGameControlGlobals.colliderToEntity.get(t),i=this.sharedGameControlGlobals.entityToCollisionEvents[e.uuid];if(void 0===i)return;for(let s of i)"character"===s.data.target&&this.dispatchCollisionEvent(s,e,t)}else{let i=this.sharedGameControlGlobals.colliderToEntity.get(t),s=this.sharedGameControlGlobals.entityToCollisionEvents[i.uuid];if(void 0!==s)for(let e of s)"scene"===e.data.target&&this.dispatchCollisionEvent(e,i,t);let o=this.sharedGameControlGlobals.colliderToEntity.get(e),a=this.sharedGameControlGlobals.entityToCollisionEvents[o?.uuid];if(void 0!==a)for(let t of a)"scene"===t.data.target&&this.dispatchCollisionEvent(t,o,e)}}},this.isExport=t.isExport,this.sharedAssets=t.sharedAssets,this.renderer=t.renderer,this.requestRender=t.requestRender,this.domElement=this.renderer.domElement,this.pixelsPerMeter=200,this.gravity=this.page.data.globalPhysics.gravity}get page(){return this.eventContext.page}markIsDestroyTarget(){this.page.traverseVisibleEntity(t=>{let e=t.dataPatched;for(let t of e.events){if(!0===t.data.disabled)continue;let e=t.data.actions?.find(t=>"Destroy"===t.data.type)?.data;if(e)for(let t of e.objects){let e=this.page.scene.find(t);e&&(e.userData.hasDestroy=!0)}}})}markIsDragObject(){this.page.traverseVisibleEntity(t=>{let e=t.dataPatched;for(let t of e.events)if(!0!==t.data.disabled&&"DragDrop"===t.data.type)for(let e of t.data.objects){let t=this.page.scene.find(e);t&&(t.userData.hasDrag=!0)}})}_staticBVHIdOf(t){let e=this._staticBVHAttrIds.get(t);return void 0===e&&(e=this._staticBVHNextAttrId++,this._staticBVHAttrIds.set(t,e)),e}initBVH(){if(null===t())return void b("collision-bvh","trigger/collision detection");let e=[],i=[];if(this.page.traverseChildren(t=>{let s,o=t instanceof r,a=m(t);if(v(t)||o||a)return;s=g(t)?t.object:t;let n=s.dataPatched;if("visibility"===n.physics?.enabled?!n.visible:!n.physics?.enabled)return!0;let h=t.geometry,l=!0===s.userData.hasDestroy,d=!0===s.userData.hasDrag;if(Lt(n)||l||d||s.dataPatched.events.some(t=>!0!==t.data.disabled&&("GameControl"===t.data.type||"Follow"===t.data.type)))return t.updateMatrixWorldRigid(),this.addBoundsTree(t),!0;if(h){let s=h.getAttribute("position");if(void 0!==s&&s.count>0){e.push({geometry:h,matrixWorld:t.matrixWorld}),i.push(h.id,this._staticBVHIdOf(s),s.version,null!==h.index?this._staticBVHIdOf(h.index):-1,null!==h.index?h.index.version:-1);for(let e of t.matrixWorld.elements)i.push(e)}}return!!Bt(t)||void 0}),e.length>0){let s=this._staticBVHCache;if(void 0!==s&&s.signature.length===i.length&&s.signature.every((t,e)=>t===i[e]))return void(this.sharedGameControlGlobals.staticMeshBVH=s.bvh);let o=e.map(t=>ct(t.geometry,t.matrixWorld)),a=l(o,!1),n=new(t())(a);this._staticBVHCache={signature:i,bvh:n},this.sharedGameControlGlobals.staticMeshBVH=n}}addRigidBody(t,e,i){if(dt(t.matrixWorld))return;let s=[],o="geometry"in t?t.geometry:void 0,a=e.dataPatched;if(void 0!==o?.getAttribute("position")&&s.push(ct(o,t.shearScale)),a.physics.fusedBody){let e=this.gatherChildrenGeom(t,s);t.traverseObject(e),t.children.forEach(t=>t.updateMatrixWorld(!0));let i=t.cloner;i&&void 0===i.objectForSample&&"dynamic"===a.physics.rigidBody&&(i.traverseObject(e),i.children.forEach(t=>t.updateMatrixWorld(!0)))}if(s.length>0){let n,r=!1,h=!i.fromCreate&&"dynamic"===a.physics.rigidBody||i.fromCreate&&i.dynamic;h?(n=pt.RigidBodyDesc.dynamic(),n.setLinearDamping(a.physics.damping).setAngularDamping(a.physics.damping).setAdditionalMass(1e-9).setGravityScale(a.physics.gravityScale).enabledRotations(...a.physics.enabledRotation).enabledTranslations(...a.physics.enabledTranslation)):(i.hasTransformAnim||i.hasFollow||i.hasDrag)&&!i.fromCreate?(n=pt.RigidBodyDesc.kinematicPositionBased(),r=!0):n=pt.RigidBodyDesc.fixed();let d=l(s);(t.hasNonUniformScale?t.matrixWorldRigid:t.matrixWorld).decompose(yt,vt,gt),t.position0=yt.clone().divideScalar(this.pixelsPerMeter),t.rotation0=vt.clone(),yt.divideScalar(this.pixelsPerMeter),n.setTranslation(yt.x,yt.y,yt.z).setRotation(vt),o?d?.scale(1/this.pixelsPerMeter,1/this.pixelsPerMeter,1/this.pixelsPerMeter):d?.scale(gt.x/this.pixelsPerMeter,gt.y/this.pixelsPerMeter,gt.z/this.pixelsPerMeter);let c=this.sharedGameControlGlobals.rapierWorld.createRigidBody(n),p=!(void 0===a.geometry||"SubdivGeometry"===a.geometry.type||"NonParametricGeometry"===a.geometry.type||"BooleanGeometry"===a.geometry.type||"VectorGeometry"===a.geometry.type||"StarGeometry"===a.geometry.type||"RectangleGeometry"===a.geometry.type||"EllipseGeometry"===a.geometry.type||"TriangleGeometry"===a.geometry.type||"TorusGeometry"===a.geometry.type||"HelixGeometry"===a.geometry.type);try{this.addCollider(c,a.physics,d,e,p)}catch{try{this.addCollider(c,a.physics,d,e,!1)}catch(t){console.error(t)}}if(0===c.numColliders())return void this.sharedGameControlGlobals.rapierWorld.removeRigidBody(c);h?this.rigidBodyToMesh.set(c.handle,[t,gt.clone(),a.physics.fusedBody]):r?(this.sharedGameControlGlobals.kinematicBodyToEntity.set(c.handle,t),this.sharedGameControlGlobals.entitiesWithTransformAnim.push(t)):this.fixedBodiesToWatch.push([t,c,(t.hasNonUniformScale?t.matrixWorldRigid:t.matrixWorld).clone()]),t.rigidBody=c}}addBoundsTree(e){let i=[];if(void 0!==e.geometry?.getAttribute("position")&&e.geometry?.getAttribute("position").count>0&&i.push(ct(e.geometry,e.shearScale)),e.traverseObject(this.gatherChildrenGeom(e,i)),e.children.forEach(t=>t.updateMatrixWorld(!0)),i.length>0){let s=l(i,!1);e.bvhGeometry=s,s.getAttribute("position").count>0&&(e.bvhGeometry.boundsTree=new(t())(s),this.sharedGameControlGlobals.entitiesWithTransformAnim.push(e))}}addCollider(t,e,i,s,o=!0){if(0===i?.getAttribute("position").count||0===i?.getIndex()?.count)return;let a;i&&(a="trimesh"===e.colliderType?pt.ColliderDesc.trimesh(i.getAttribute("position").array,i.getIndex().array):pt.ColliderDesc.convexMesh(i.getAttribute("position").array,o?i.getIndex().array:void 0)),a.setFrictionCombineRule(pt.CoefficientCombineRule.Average).setRestitutionCombineRule(pt.CoefficientCombineRule.Average).setDensity(e.density).setFriction(e.friction).setRestitution(e.restitution);let n=this.sharedGameControlGlobals.rapierWorld.createCollider(a,t);this.sharedGameControlGlobals.colliderToEntity.set(n.handle,s),this.sharedGameControlGlobals.entityToCollisionEvents[s.uuid]?.some(t=>"scene"===t.target)&&n.setActiveEvents(pt.ActiveEvents.COLLISION_EVENTS)}gatherChildrenGeom(t,e){let i=Bt(t);return(s,o)=>{if(0===o)return;if(i&&s.parent===t)return!0;let a;if(v(s)){if(!s.objectForSample)return!0===s.object.dataPatched.physics.fusedBody&&"dynamic"===s.object.dataPatched.physics.rigidBody||void 0;if(s.objectForSample.dataPatched.physics.fusedBody)return;a=s.object}else if(g(s))a=s.object;else if(a=s,a.dataPatched.cloner?.hideBase)return!0;let n=a.dataPatched;if("visibility"===n.physics.enabled?!n.visible:!n.physics.enabled)return!0;1===o?t.hasNonUniformScale?s.matrixWorld.multiplyMatrices(t.shearScale,s.hiddenMatrix):s.matrixWorld.copy(s.hiddenMatrix):s.matrixWorld.multiplyMatrices(s.parent.matrixWorld,s.hiddenMatrix),s.matrixWorld.multiply(s.matrix);let r=s.geometry;return void 0!==r?.getAttribute("position")&&e.push(ct(r,s.matrixWorld)),!!Bt(s)||void 0}}activate(t){if(this.isEnabled)return;this.isEnabled=!0,this.eventManager=t,this.usePhysics=this.page.data.globalPhysics.usePhysics;let e=this.page.playCamera,i=!1;this.page.traverseEntity(t=>{for(let e of t.dataPatched.events)if(!1===e.data.disabled&&"Trigger"===e.data.type)return this.needsCollisionDetection=!0,!0});let s=I();if(null!==s?i=s.setup({manager:this,camera:e,renderer:this.renderer,sharedAssets:this.sharedAssets,eventContext:this.eventContext,isExport:this.isExport})||i:null!==this.page.data.publish.gameControlObject&&b("game-controls","the scene's game controls"),!1===i){let{enableRotate:t,enablePan:i,enableZoom:s,autoRotate:o,hoverRotatePanMode:a}=this.eventManager.publish.orbitControls;(t||i||s||o||0!==a)&&(this.orbitControls=new st(e,this.renderer.domElement,{isExport:this.isExport,isPlayMode:!0}),this.orbitControls.addEventListener("change",this.requestRender),this.orbitControls.addEventListener("end",this.requestRender),this.orbitControls.addEventListener("start",this.requestRender),this.orbitControls.fromJSON(this.eventManager.publish.orbitControls,this.eventManager.publish.mouseEventTarget),this.orbitControls.useKeyEvents=!1,this.orbitControls.addEventListenersToCamera(),this.orbitControls.connect(),this.orbitControls.update())}let o=this.renderer.domElement.width/this.renderer.getPixelRatio(),a=this.renderer.domElement.height/this.renderer.getPixelRatio();I()?.createJoysticks(this,o,a),this.markIsDestroyTarget(),this.markIsDragObject(),this.rebuildBVH(),this.initializationCounter++,window.setTimeout(()=>{this.collisionEvents.forEach(t=>t.initialDisabled=!1)},80)}initPhysics(){this.sharedGameControlGlobals.rapierWorld?.free(),this.sharedGameControlGlobals.rapierWorld=new pt.World(new pt.Vector3(0,this.gravity,0)),this.events=new pt.EventQueue(!0);let t=[],e=[];if(this.page.traverseChildren(i=>{let s;if(v(i)){if(!i.objectForSample)return!0===i.object.dataPatched.physics.fusedBody&&"dynamic"===i.object.dataPatched.physics.rigidBody||void 0;if(i.objectForSample.dataPatched.physics.fusedBody)return;s=i.object}else if(g(i))s=i.object;else{if(m(i)||u(i)||i instanceof r)return;if(s=i,!1===s.dataPatched.cloner?.disabled&&s.dataPatched.cloner?.hideBase&&!0!==s.dataPatched.physics?.fusedBody)return!0}let o,a=s.dataPatched;for(let t of a.events)!0!==t.data.disabled&&"GameControl"===t.data.type&&(o=t.data);if(!a.physics||("visibility"===a.physics.enabled?!a.visible:!a.physics.enabled))return!0;i.updateMatrixWorldRigid();let n=Lt(a),h=!1,l=s.userData.hasDestroy,d=s.userData.hasDrag,c=!1;for(let t of a.events)if(!0!==t.data.disabled)if("Collision"===t.data.type){h=!0;let e=new mt(t.id,t.data,s,this.page,this.sharedAssets,this.eventManager);e.initialDisabled=!0,this.collisionEvents.push(e),this.sharedGameControlGlobals.entityToCollisionEvents[s.uuid]&&this.sharedGameControlGlobals.entityToCollisionEvents[s.uuid].every(e=>e.id!==t.id)?this.sharedGameControlGlobals.entityToCollisionEvents[s.uuid].push(e):this.sharedGameControlGlobals.entityToCollisionEvents[s.uuid]=[e]}else if("Follow"===t.data.type){c=!0;let e=t.data.target;i.traverseVisible(t=>{t.userData.isFollowingObj=e})}"dynamic"===a.physics.rigidBody&&!1===a.physics.fusedBody&&(i.matrixWorldFusedFalse=i.matrixWorld.clone());let p=i.geometry;if(void 0!==o){let t=pt.RigidBodyDesc.kinematicPositionBased();(i.hasNonUniformScale?i.matrixWorldRigid:i.matrixWorld).decompose(yt,vt,gt),i.position0=yt.clone().divideScalar(this.pixelsPerMeter),i.rotation0=vt.clone(),yt.divideScalar(this.pixelsPerMeter),t.setTranslation(yt.x,yt.y,yt.z).setRotation(vt);let e,n=this.sharedGameControlGlobals.rapierWorld.createRigidBody(t);i.rigidBody=n,e="sphere"===o.collider.type?pt.ColliderDesc.ball(o.collider.radius/this.pixelsPerMeter):"capsule"===o.collider.type?pt.ColliderDesc.capsule((o.collider.height/2-o.collider.radius)/this.pixelsPerMeter,o.collider.radius/this.pixelsPerMeter):pt.ColliderDesc.cuboid(o.collider.width/this.pixelsPerMeter/2,o.collider.height/this.pixelsPerMeter/2,o.collider.depth/this.pixelsPerMeter/2),e.setFrictionCombineRule(pt.CoefficientCombineRule.Average).setDensity(a.physics.density).setFriction(a.physics.friction).setRestitution(0).setRestitutionCombineRule(pt.CoefficientCombineRule.Min);let r=this.sharedGameControlGlobals.rapierWorld.createCollider(e,n);this.sharedGameControlGlobals.colliderToEntity.set(r.handle,s),yt.fromArray(o.collider.position.map(t=>"number"==typeof t?t:0)).multiply(gt.setFromMatrixScale(s.matrixWorld)).divideScalar(this.pixelsPerMeter),r.setTranslationWrtParent(yt);let h=(new M).setFromEuler((new D).setFromVector3((new x).fromArray(o.collider.rotation.map(t=>"number"==typeof t?t:0))));r.setRotationWrtParent(h),r.setActiveEvents(pt.ActiveEvents.COLLISION_EVENTS),this.generateSensorColliderDescs(s,!0)}else"dynamic"===a.physics.rigidBody||n||c||l||d||h?(this.addRigidBody(i,s,{hasFollow:c,hasTransformAnim:n,hasDrag:d}),this.generateSensorColliderDescs(s,a.physics.fusedBody)):(p&&t.push(ct(p,i.matrixWorld)),a.physics.fusedBody&&!Bt(i)&&i.traverseObject((e,i)=>{if(0===i)return;let s;if(v(e)){if(!e.objectForSample)return!0===e.object.dataPatched.physics.fusedBody&&"dynamic"===e.object.dataPatched.physics.rigidBody||void 0;if(e.objectForSample.dataPatched.physics.fusedBody)return;s=e.object}else{if(m(e)||u(e)||e instanceof r)return;if(g(e))s=e.object;else if(s=e,s.dataPatched.cloner?.hideBase)return!0}let o=s.dataPatched;if("visibility"===o.physics.enabled?!o.visible:!o.physics.enabled)return!0;let a=e.geometry;return void 0!==a?.getAttribute("position")&&t.push(ct(a,e.matrixWorld)),!!Bt(e)||void 0}),this.generateSensorColliderDescs(s,a.physics.fusedBody,e));return!(!0!==a.physics?.fusedBody&&!o&&!Bt(i))||void 0}),0===t.length)return;let i=l(t),s=i.getIndex().count>0;if(!s&&0===e.length)return;i.scale(1/this.pixelsPerMeter,1/this.pixelsPerMeter,1/this.pixelsPerMeter);let o=pt.RigidBodyDesc.fixed(),a=this.sharedGameControlGlobals.rapierWorld.createRigidBody(o);if(s){let t=pt.ColliderDesc.trimesh(i.getAttribute("position").array,i.getIndex().array).setFrictionCombineRule(pt.CoefficientCombineRule.Multiply).setRestitutionCombineRule(pt.CoefficientCombineRule.Multiply).setFriction(1).setRestitution(1);this.sharedGameControlGlobals.rapierWorld.createCollider(t,a)}for(let[t,i]of e){let e=this.sharedGameControlGlobals.rapierWorld.createCollider(t,a);this.sensorToTriggerEvent[e.handle]=i}}updatePositions(){return this.nActiveRigidBodies=0,this.sharedGameControlGlobals.rapierWorld.forEachRigidBody(this.processRigidBody),this.nActiveRigidBodies>0}rebuildBVH(){this.usePhysics?this.initPhysics():(this.page.traverseEntity(t=>{for(let e of t.dataPatched.events)if("Trigger"===e.data.type&&!0!==e.data.disabled){let i=new ut(e.id,e.data,t,this.page,this.sharedAssets,this.eventManager),s=(new T).compose(bt.fromArray(e.data.position.map(t=>"number"==typeof t?t:0)),Ct.setFromEuler(ft.fromArray(e.data.rotation.map(t=>"number"==typeof t?t:0))),Pt);if("box"===e.data.triggerZone){let o=new R;o.min.fromArray(e.data.size.map(t=>"number"==typeof t?t:0)).multiplyScalar(-.5),o.max.fromArray(e.data.size.map(t=>"number"==typeof t?t:0)).multiplyScalar(.5),this.sharedGameControlGlobals.triggers.push([o,s,t,i])}else this.sharedGameControlGlobals.triggers.push([e.data.radius,s,t,i])}}),this.needsCollisionDetection&&this.initBVH())}disconnectEvents(){this.collisionEvents.forEach(t=>t.disconnect()),this.sharedGameControlGlobals.triggers.forEach(t=>t[3].disconnect()),this.sharedGameControlGlobals.triggers.length=0}deactivate(){if(this.isEnabled){this.isEnabled=!1,this.page.traverse(t=>{let e=t;e.matrixWorldFusedFalse&&(e.matrixWorldFusedFalse=void 0),e.rigidBody&&(e.rigidBody=void 0),e.position0&&(e.position0=void 0),e.rotation0&&(e.rotation0=void 0)}),this.sharedGameControlGlobals.rapierWorld?.free(),this.sharedGameControlGlobals.rapierWorld=void 0,this.sharedGameControlGlobals.staticMeshBVH=void 0,this.accumulator=0,this.sharedGameControlGlobals.entitiesWithTransformAnim=[],this.sharedGameControlGlobals.kinematicBodyToEntity.clear(),this.fixedBodiesToWatch=[],this.disconnectEvents(),this.gameControl?.reset(),this.gameControl?.dispose(),this.gameControl=null,this.initializationCounter=-1,this.joysticks.forEach(([t,e])=>{t?.destroy(),e.remove()}),this.joystickToGameControls=[],this.joysticks=[],this.orbitControls&&(this.orbitControls.dispose(),this.orbitControls=void 0),this.navigationMeshWrapper?.dispose(),this.navigationMeshWrapper=void 0;for(let t of Object.values(this.sharedGameControlGlobals.entityToCollisionEvents))t.forEach(t=>t.disconnect());this.sharedGameControlGlobals.entityToCollisionEvents={},this.page.updateMatrixWorld(!0)}}update(t){if(!this.isEnabled)return!0;let e=!0;if(void 0!==this.orbitControls&&this.orbitControls.needsUpdate&&(this.orbitControls.update(),e=!this.orbitControls.isCurrentlyDamping),this.initializationCounter>=0&&this.initializationCounter<2?(this.initializationCounter++,e=!1):2===this.initializationCounter&&this.gameControl&&(e=!this.gameControl.update(t)&&e),!1===this.usePhysics&&this.checkTrigger(),this.usePhysics){let i=.016666666666666666;if(0===t)e=this.stepPhysics()&&e;else{let s=t/1e3;s<i&&s>.55*i&&(s=i),this.accumulator+=s;let o=performance.now(),a=0,n=6;for(;this.accumulator>=i&&a<n&&(e=this.stepPhysics()&&e,this.accumulator-=i,a++,!(performance.now()-o>1e3*i)););this.accumulator=this.accumulator%i}}this.skipRender=e}recordPhysicsPose(t){(t.hasNonUniformScale?t.matrixWorldRigid:t.matrixWorld).decompose(yt,vt,gt);let e=t;void 0===e.prevQ?(e.prevQ=vt.clone(),e.prevT=yt.clone()):(e.prevQ.copy(vt),e.prevT.copy(yt))}promoteMovedFixedBodies(){for(let t=this.fixedBodiesToWatch.length-1;t>=0;t--){let[e,i,s]=this.fixedBodiesToWatch[t];(e.hasNonUniformScale?e.matrixWorldRigid:e.matrixWorld).equals(s)||(i.setBodyType(pt.RigidBodyType.KinematicPositionBased,!0),this.sharedGameControlGlobals.kinematicBodyToEntity.set(i.handle,e),this.sharedGameControlGlobals.entitiesWithTransformAnim.push(e),this.fixedBodiesToWatch.splice(t,1))}}clampPushedBodies(){let t=this.gameControl?.object.rigidBody;if(void 0===t)return;let e=this.sharedGameControlGlobals.rapierWorld,i=t.linvel(),s=t.translation(),o=Math.hypot(i.x,i.z);for(let a=0;a<t.numColliders();a++){let n=t.collider(a);e.contactPairsWith(n,t=>{let a=t.parent();if(null===a||!a.isDynamic())return;let r=a.translation(),h=-1/0,l=0,d=0;if(e.contactPair(n,t,t=>{let e=t.normal(),o=e.x*(r.x-s.x)+e.y*(r.y-s.y)+e.z*(r.z-s.z)<0?-1:1;if(Math.abs(e.y)>.7)return;let a=o*e.x,n=o*e.z,c=Math.hypot(a,n);if(c<1e-4)return;let p=(i.x*a+i.z*n)/c;p>h&&(h=p,l=a/c,d=n/c)}),h===-1/0)return;let c=i.x*l+i.z*d;if(c<-wt)return;let p=a.linvel();if(o>wt&&c>wt){let t=p.x*l+p.z*d;if(t<=0)return;let e=Math.min(t,c);return void a.setLinvel({x:l*e,y:p.y,z:d*e},!0)}let m=p.x*l+p.z*d-Math.max(0,c);if(m<=0)return;let u=.5*m;a.setLinvel({x:p.x-l*u,y:p.y,z:p.z-d*u},!0)})}}stepPhysics(){this.promoteMovedFixedBodies();for(let t of this.sharedGameControlGlobals.kinematicBodyToEntity.values())this.recordPhysicsPose(t),t.rigidBody.setNextKinematicTranslation(yt.divideScalar(this.pixelsPerMeter)),t.rigidBody.setNextKinematicRotation(vt);for(let t of this.sharedGameControlGlobals.entitiesWithTransformAnim)!0!==t.rigidBody?.isKinematic()&&this.recordPhysicsPose(t);return this.sharedGameControlGlobals.rapierWorld.step(this.events),this.clampPushedBodies(),this.events?.drainCollisionEvents(this.handleCollisionEvents),!this.updatePositions()}dispatchCollisionEvent(t,e,i){let s,o=(this.sharedGameControlGlobals.rapierWorld?.getCollider(i))._parent;if(e.cloner)for(let t of e.cloner.children)if(t.rigidBody===o){s=t;break}t.dispatch(s),e.dispatchEvent(Rt)}updateUseWindowEvents(t){this.orbitControls?.updateUseWindowEvents(t)}generateSensorColliderDescs(t,e,i){let s=xt.copy(t.matrixWorld).invert();t.traverseEntity((o,a)=>{if(!1===e&&1===a)return!0;for(let e of o.dataPatched.events)if("Trigger"===e.data.type&&!0!==e.data.disabled){let a,n=new ut(e.id,e.data,o,this.page,this.sharedAssets,this.eventManager);if(a="box"===e.data.triggerZone?pt.ColliderDesc.cuboid(...e.data.size.map(t=>("number"==typeof t?t:1)/(2*this.pixelsPerMeter))):pt.ColliderDesc.ball(e.data.radius/this.pixelsPerMeter),a.setDensity(0).setSensor(!0).setActiveEvents(pt.ActiveEvents.COLLISION_EVENTS),bt.fromArray(e.data.position.map(t=>"number"==typeof t?t:0)),Ct.setFromEuler(ft.fromArray(e.data.rotation.map(t=>"number"==typeof t?t:0))),Mt.compose(bt,Ct,Pt).premultiply(o.matrixWorld),i?(Mt.decompose(bt,Ct,Et),a.setActiveCollisionTypes(pt.ActiveCollisionTypes.KINEMATIC_FIXED|pt.ActiveCollisionTypes.DYNAMIC_FIXED)):(Mt.premultiply(s).decompose(bt,Ct,Et),t.rigidBody.bodyType()===pt.RigidBodyType.Dynamic||(t.rigidBody.bodyType()===pt.RigidBodyType.Fixed?a.setActiveCollisionTypes(pt.ActiveCollisionTypes.KINEMATIC_FIXED|pt.ActiveCollisionTypes.DYNAMIC_FIXED):a.setActiveCollisionTypes(pt.ActiveCollisionTypes.KINEMATIC_KINEMATIC|pt.ActiveCollisionTypes.DYNAMIC_KINEMATIC))),bt.divideScalar(this.pixelsPerMeter),a.setTranslation(bt.x,bt.y,bt.z),a.setRotation(Ct),i)i.push([a,n]);else{let e=this.sharedGameControlGlobals.rapierWorld.createCollider(a,t.rigidBody);this.sensorToTriggerEvent[e.handle]=n}}})}checkTrigger(){let t;for(let e=0;e<this.sharedGameControlGlobals.triggers.length;e++){let[i,s,o,a]=this.sharedGameControlGlobals.triggers[e];for(let e=0;e<this.sharedGameControlGlobals.entitiesWithTransformAnim.length;e++){let n=this.sharedGameControlGlobals.entitiesWithTransformAnim[e];if(o===n||!1===a.isValidTriggeringObject(p.is(n)?n:n.object))continue;let r=xt.copy(o.matrixWorld).decompose(bt,St,Et).compose(bt,St,Pt).multiply(s),h=Mt.copy(n.matrixWorld).invert().multiply(r),l=n.bvhGeometry.boundsTree;i instanceof R?t=l.intersectsBox(i,h):(Dt.radius=i,Dt.center.setFromMatrixPosition(h),t=l.intersectsSphere(Dt)),t?-1===a.currentIntersectedObjects.indexOf(n)&&(a.currentIntersectedObjects.push(n),a.dispatch(),o.dispatchEvent(jt)):a.currentIntersectedObjects=a.currentIntersectedObjects.filter(t=>t!==n)}}}},Ft=new Promise(t=>{At=t});function kt(t){return Ot||(Ot=async function(){let e=t??"https://cdn.spline.design/@splinetool/runtime@2.0.8/build";typeof window<"u"&&(Wt=new URL(e.endsWith("/")?e:`${e}/`,window.location.href).href);let i=import("./navmesh.js"),[s,o]=await Promise.all([i,fetch(`${e}/navmesh.wasm`).then(t=>t.arrayBuffer())]),a=s.default,n=await a({wasmBinary:o});At(n)}())}export{st as a,lt as b,A as c,O as d,F as e,ct as f,Rt as g,Gt as h,Lt as i,It as j,Ft as k,Wt as l,kt as m};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
G ��tk<w�*���*KP���������7<7���B����J�}�k`�,)����[y��Yph�3���Pv ��+��Y����y��P�5�?����Pe4�����H)&��w�I2����!���
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as m}from"./runtime-chunk-HK23JJVH.js";import"./runtime-chunk-GZ7C2GJM.js";import"./runtime-chunk-PDASWDVC.js";import"./runtime-chunk-RLYG5YBB.js";import"./runtime-chunk-E3IEBR27.js";import"./runtime-chunk-EJJZJ5MV.js";import"./runtime-chunk-USGQ26QU.js";import"./runtime-chunk-AELTGHV2.js";import"./runtime-chunk-DK66VKWP.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import"./runtime-chunk-CKT62HES.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-4KZXQGUQ.js";import"./runtime-chunk-U4QOT2PX.js";import{a as n,f as r}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-VPEJ5BFD.js";import"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";r("ShapeBlendGeometry",(n,r,t)=>new m(n,r,t)),n("shape-blends");
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as t,b as e,c as i,d as a,e as n,f as s,h as r,i as o}from"./runtime-chunk-OUXEWX5Z.js";import"./runtime-chunk-KE6HNYUL.js";import"./runtime-chunk-NTUTXO7Q.js";import{a as l}from"./runtime-chunk-R43XZP65.js";import{a as d}from"./runtime-chunk-5JEZ42OM.js";import{a as h,b as u}from"./runtime-chunk-F3ZACLZW.js";import"./runtime-chunk-YULW5JRE.js";import"./runtime-chunk-FTVQTRM7.js";import{a as c}from"./runtime-chunk-32KZP4YN.js";import"./runtime-chunk-E3IEBR27.js";import"./runtime-chunk-EJJZJ5MV.js";import"./runtime-chunk-AELTGHV2.js";import{Y as m,ca as p}from"./runtime-chunk-DK66VKWP.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as g,e as f}from"./runtime-chunk-EPHVY3XO.js";import"./runtime-chunk-CKT62HES.js";import{d as y}from"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-4KZXQGUQ.js";import{g as v,h as x,i as M}from"./runtime-chunk-U4QOT2PX.js";import{a as b}from"./runtime-chunk-TZCHGFVF.js";import{A as N,B as k,C,D as T,E as j,q as O,z as E}from"./runtime-chunk-VPEJ5BFD.js";import{Bc as w,Cc as F}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var P=0;function A(){P++}function L(t,e){return(e.epoch!==P||e.t!==t.t||e.index!==t.index)&&(e.epoch=P,e.t=t.t,e.index=t.index,!0)}function D(t,e,i,a){if(e){let n={},s=[...e.keyframes??[]].sort((t,e)=>t.data.time-e.data.time);if("data"in t){let e=s[0];e&&i?.(e.data.value,t),n={index:[],t:[]};for(let t=0;t<s.length-1;t++){let e=s[t],i=s[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*s[0].data.time:0};n.t.push({...a,value:t%2==0?1:0,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),n.index.push({...a,value:t,easing:"linear"})}if(s.length>1){let e={t:0,index:0},r={t:NaN,index:NaN};return{targets:e,...n,update:()=>{if(!L(e,r))return;let n=Math.ceil(e.index),o=n%2==0?e.t:1-e.t,l=s?.[Math.min(n,s.length-1)].data.value,d=s?.[Math.min(n,s.length-1)+1]?.data.value,h={},u={};if(Object.keys(l).length>0&&Object.keys(d).length>0)for(let e in t.data)if(e in l&&e in d){let t=I(l[e],d[e],o,a);void 0!==t&&(h[e]=t,u[e]={start:l,end:d,t:o})}i?.({...h},t,u)}}}}}}function I(t,e,i,a){if("string"==typeof t&&a&&(t=a.color(t)),"string"==typeof e&&a&&(e=a.color(e)),"number"==typeof t)return F.lerp(t,e,i);if(j.is(t))return j.lerp(t,e,i);if(T.is(t))return T.lerp(t,e,i);if(Array.isArray(t))return(t.length>e.length?e:t).map((a,n)=>{if(Array.isArray(a)){let a=t[n].length>e[n].length?e[n].length:t[n].length;return(4===a?k:3===a?N:E).lerp(t[n],e[n],i)}return F.lerp(t[n],e[n],i)});if("object"==typeof t&&null!==t){let n={};for(let s in t){let r=I(t[s],e[s],i,a);void 0!==r&&(n[s]=r)}return n}}var _=new Map,H=new Map,S=class extends w{constructor(s,g,f,b,N,k,T){super(),this.id=s,this.data=g,this.scene=f,this.sharedAssets=b,this.object=N,this.eventType=k,this.actionCondition=T,this.toggleIsForward=!1,this._finished=!1,this.hasPlayedOnce=!1,this._shouldForwardLoop=!1,this._shouldPauseOnNextLoopComplete=!1,this.hiddenMatrixOverrides=[],this._onLoopComplete=()=>{this._shouldPauseOnNextLoopComplete&&(this.timeline.pause(),this._shouldPauseOnNextLoopComplete=!1)};try{let s=r(this.data);"number"==typeof s.loop&&s.loop--,this.timeline=l.timeline({...s,autoplay:!1}),this._shouldForwardLoop=!0===s.loop||"number"==typeof s.loop&&s.loop>1;let g=this.sharedAssets.data.timelineAnimations[this.data.timeline].mapping;Object.entries(g).forEach(([s,r])=>{let o=this.scene.find(s);if(!o)return;let l=o.data.timelineAnimations[r];if(!l)return;let g=o.data.states.data(r);g?.hiddenMatrix&&16===g.hiddenMatrix.length&&!C.isEqual(g.hiddenMatrix,o.data.hiddenMatrix)&&this.hiddenMatrixOverrides.push({objId:s,original:o.hiddenMatrix.clone(),state:g.hiddenMatrix});let N=function(n,s,r,o){let l=[];return s.properties.forEach(s=>{let g=s.data.path?.[0];if(g&&["position","rotation","scale"].includes(g)){let t=function(t,e=()=>{}){let i=[];for(let a of M){let n=[...t.keyframes??[]].filter(t=>void 0!==t.data.value[a]).sort((t,e)=>t.data.time-e.data.time),s=n[0];s&&e?.(s.data.value);let r={index:[],t:[]};for(let t=0;t<n.length-1;t++){let e=n[t],i=n[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*n[0].data.time:0};r.t.push({...a,value:t%2==0?1:0,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),r.index.push({...a,value:t,easing:"linear"})}if(n.length>1){let t={t:0,index:0},s={t:NaN,index:NaN};i.push({targets:t,...r,update:()=>{if(!L(t,s))return;let i=Math.ceil(t.index),r=i%2==0?t.t:1-t.t,o=n?.[i].data.value,l=n?.[i+1]?.data.value;void 0!==o&&void 0!==l&&e?.({[a]:o[a]+(l[a]-o[a])*r})}})}}return i}(s.data,r?.[g]);t&&l.push(...t)}if(g&&"shape size"===g&&"geometry"in n){let t=function(t,e,i){let a=[];for(let t of M){let n={},s=[...e.keyframes??[]].filter(e=>void 0!==e.data.value[t]).sort((t,e)=>t.data.time-e.data.time),r=s[0];r&&i?.(r.data.value),n={index:[],t:[]};for(let t=0;t<s.length-1;t++){let e=s[t],i=s[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*s[0].data.time:0};n.t.push({...a,value:t%2==0?1:0,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),n.index.push({...a,value:t,easing:"linear"})}if(s.length>1){let e={t:0,index:0},r={t:NaN,index:NaN};a.push({targets:e,...n,update:()=>{if(!L(e,r))return;let a=Math.ceil(e.index),n=a%2==0?e.t:1-e.t,o=s?.[a].data.value,l=s?.[a+1]?.data.value;void 0!==o&&void 0!==l&&i?.({[t]:o[t]+(l[t]-o[t])*n})}})}}return a}(0,s.data,r?.shapeSize);t&&l.push(...t)}if(g&&"path extrusion"===g&&y(n)){let e=function(e,i,a){let n={},s=[...i.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),r=s[0];r&&a?.(e,r.data.value),n={index:[],t:[]};for(let t=0;t<s.length-1;t++){let e=s[t],i=s[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*s[0].data.time:0};n.t.push({...a,value:t%2==0?1:0,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),n.index.push({...a,value:t,easing:"linear"})}if(s.length>1){let i={t:0,index:0},r={t:NaN,index:NaN};return{targets:i,...n,update:()=>{if(!L(i,r))return;let n=Math.ceil(i.index),o=n%2==0?i.t:1-i.t,l=s?.[Math.min(n,s.length-1)].data.value,d=s?.[Math.min(n,s.length-1)+1]?.data.value;a?.(e,t(e,l,d,o))}}}}(n,s.data,r?.pathExtrusion);e&&l.push(e)}if(g&&"path snapping"===g&&n.data.pathSnapping){let t=function(t,i,a){let n={},s=[...i.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),r=s[0];r&&a?.(r.data.value),n={index:[],t:[]};for(let t=0;t<s.length-1;t++){let e=s[t],i=s[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*s[0].data.time:0};n.t.push({...a,value:t%2==0?1:0,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),n.index.push({...a,value:t,easing:"linear"})}if(s.length>1){let i={t:0,index:0},r={t:NaN,index:NaN};return{targets:i,...n,update:()=>{if(!L(i,r))return;let n=Math.ceil(i.index),o=n%2==0?i.t:1-i.t,l=s?.[Math.min(n,s.length-1)].data.value,d=s?.[Math.min(n,s.length-1)+1]?.data.value;a?.(e(t,l,d,o))}}}}(n,s.data,r?.pathSnapping);t&&l.push(t)}if(g&&"material"===g&&"Mesh"===n.type&&"material"in n){let t=p(n.material)?n.material:void 0;if(t){let e=s.data.id;if(e){let i=(s.data.keyframes??[]).some(t=>m(t.data.value?.noiseStrength)),a=t.ensureRainbowNoiseCompiled,n=e=>{i&&"function"==typeof a&&a.call(t,e)};n(e);let d=t.getLayerByUuid(e);if(d){let t=D(d,s.data,r?.material,o);t&&l.push(t)}else{let e=s.data.type;for(let i of t.getLayersOfType(e))n(i.uuid);let i=t.getLayersOfType(e);if(i)for(let t of i){let e=D(t,s.data,r?.material,o);e&&l.push(e)}}}}}if(g&&"opacity"===g&&"Mesh"===n.type&&"material"in n){let t=function(t,e){if(t){let i={},a=[...t.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),n=a[0];n&&e?.(n.data.value),i={index:[],t:[]};for(let t=0;t<a.length-1;t++){let e=a[t],n=a[t+1]??e,s={duration:1e3*(n?.data?.time-e.data.time),delay:0===t?1e3*a[0].data.time:0};i.t.push({...s,value:t%2==0?1:0,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(n.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),i.index.push({...s,value:t,easing:"linear"})}if(a.length>1){let t={t:0,index:0},n={t:NaN,index:NaN};return{targets:t,...i,update:()=>{if(!L(t,n))return;let i=Math.ceil(t.index),s=i%2==0?t.t:1-t.t,r=a?.[Math.min(i,a.length-1)].data.value,o=a?.[Math.min(i,a.length-1)+1]?.data.value;e?.(F.lerp(r,o,s))}}}}}(s.data,r?.opacity);t&&l.push(t)}if(g&&"cloner"===g){let t=function(t,e,n){let s={},r=[...e.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),o=r[0];o&&n?.(t,o.data.value,o.data.value),s={index:[],t:[]};for(let t=0;t<r.length-1;t++){let e=r[t],i=r[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*r[0].data.time:0};s.t.push({...a,value:t%2==0?1:0,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),s.index.push({...a,value:t,easing:"linear"})}if(r.length>1){let e={t:0,index:0},o={t:NaN,index:NaN};return{targets:e,...s,update:()=>{if(!L(e,o))return;let s=Math.ceil(e.index),l=s%2==0?e.t:1-e.t,d=r?.[Math.min(s,r.length-1)].data.value,h=r?.[Math.min(s,r.length-1)+1]?.data.value;n?.(t,d.randomnessObject?void 0:i(d,h,l,t),d.randomnessObject?a(d,h,l,t):void 0)}}}}(n,s.data,r?.cloner);t&&l.push(t)}if(g&&"camera"===g&&n instanceof c){let t=function(t,e,i,a){if(e){let n={[a]:[]},s=[...e.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),r=s[0];r&&(t[a]=r.data.value,i?.(a,r.data.value));for(let t=0;t<s.length-1;t++){let e=s[t];if(!Number.isFinite(e.data.value))continue;let i=s[t+1]??e;n[a].push({value:i.data.value,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters),duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*s[0].data.time:0})}if(s.length>1)return{targets:t,...n,update:()=>{i?.(a,t[a])}}}}(n,s.data,r?.camera,"zoom");t&&l.push(t)}if(g&&"light"===g&&(n instanceof h||n instanceof d||n instanceof u)){let t=function(t,e,i,a,n){if(e){let s={},r=[...e.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),o=r[0];if(o){let e=o.data.value;t[a]=e,i?.(a,e)}s={index:[],t:[]};for(let t=0;t<r.length-1;t++){let e=r[t],i=r[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*r[0].data.time:0};s.t.push({...a,value:t%2==0?1:0,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),s.index.push({...a,value:t,easing:"linear"})}if(r.length>1){let t={t:0,index:0},e={t:NaN,index:NaN};return{targets:t,...s,update:()=>{if(!L(t,e))return;let s=Math.ceil(t.index),o=s%2==0?t.t:1-t.t,l=r?.[Math.min(s,r.length-1)].data.value,d=r?.[Math.min(s,r.length-1)+1]?.data.value;i?.(a,I(l,d,o,n))}}}}}(n,s.data,r?.light,s.data.path[1],o);t&&l.push(t)}}),l}(o,{...l},n(o,{scene:f,shared:b}),this.sharedAssets),k=("start"===this.data.delayDirection?this.data.delay:0)+("start-end"===this.data.delayDirection?this.data.delay:0)+("start-once"===this.data.delayDirection?this.data.delay:0);N.forEach(t=>{this.timeline.add(t,k)}),this.timeline.duration=1e3*l.to+k}),this.timeline.delay=0,this.timeline.duration+=("start"===this.data.delayDirection?this.data.delay:0)+("end"===this.data.delayDirection?this.data.delay:0)+("start-end"===this.data.delayDirection?2*this.data.delay:0)+("start-once"===this.data.delayDirection?2*this.data.delay:0),this.timeline.finished.then(()=>{Object.keys(g).forEach(t=>{let e=this.scene.find(t);e instanceof c&&e.dispatchEvent(o)}),this._finished=!0}),this.timeline.loopComplete=this._onLoopComplete}catch(t){throw new Error("Missing property")}N&&(H.has(N.uuid)?H.get(N.uuid).push(this):H.set(N.uuid,[this])),_.set(s,this)}get playing(){return!1===this.timeline.paused}get finished(){return this._finished}get paused(){return this.timeline.paused}applyStateHiddenMatrices(){for(let{objId:t,state:e}of this.hiddenMatrixOverrides){let i=this.scene.find(t);i&&i.hiddenMatrix.fromArray(e)}}restoreOriginalHiddenMatrices(){for(let{objId:t,original:e}of this.hiddenMatrixOverrides){let i=this.scene.find(t);i&&i.hiddenMatrix.copy(e)}}play(){let t=void 0!==this.eventType&&O(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce&&this.paused&&this.timeline.currentTime>0&&!this._finished;if(void 0!==this.eventType&&O(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce&&!t||void 0===this.eventType&&this._finished)return!1;this.hasPlayedOnce=!0,this.applyStateHiddenMatrices();let e=this.sharedAssets.data.timelineAnimations[this.data.timeline].mapping;Object.keys(e).forEach(t=>{let e=this.scene.find(t);e instanceof c&&e.dispatchEvent(s)}),A(),this.paused&&this.timeline.currentTime>0?this.timeline.play():this.timeline.restart()}pauseTimeline(){this.paused||this.timeline.pause()}pause(){this.pauseTimeline()}stop(){this.pauseTimeline(),this.seek(0),this.timeline.reset(),this.restoreOriginalHiddenMatrices(),this._finished=!1}seek(t){this.timeline.seek(t*this.timeline.duration,!0)}toggle(t){let e=this.paused&&this.timeline.currentTime>0&&this.timeline.currentTime<this.timeline.duration;if(void 0!==t?this.toggleIsForward=t:e||(this.toggleIsForward=!this.toggleIsForward),this.playing){if(!this.toggleIsForward&&this.timeline.reversed&&this._shouldForwardLoop&&this.timeline.remaining%2==1)return void(this._shouldPauseOnNextLoopComplete=!0);this.timeline.reverse(this.timeline.duration-this.timeline.currentTime),this._shouldForwardLoop&&this.timeline.loop&&this.timeline.reversed&&(this._shouldPauseOnNextLoopComplete=!0)}else this.applyStateHiddenMatrices(),A(),(!this.toggleIsForward!==this.timeline.reversed||!this.toggleIsForward&&this.timeline.reversed&&"alternate"===this.timeline.direction)&&this.timeline.reverse(),"number"==typeof this.timeline.loop&&"number"==typeof this.timeline.remaining&&this.timeline.remaining<this.timeline.loop&&this.toggleIsForward&&(this.timeline.remaining=this.timeline.loop),this.timeline.play()}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){this.pauseTimeline(),this.restoreOriginalHiddenMatrices()}},Z=class{constructor(t){this.data=t}dispatch(){this.data.playTimeline?this.pauseTimeline(this.data.playTimeline):this.data.object?this.pauseAllTimelinesFromObject(this.data.object):this.pauseAllTimelines()}pauseTimeline(t){let e=this.getTimelineActions(t);!e.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{e.forEach(t=>{t[this.data.interaction]()}),this.disposeDelay()},this.data.delay)):e.forEach(t=>{t[this.data.interaction]()}))}getTimelineActions(t){let e=_.get(t);return e?[e]:[..._.values()].filter(e=>e.data.timeline===t)}pauseAllTimelinesFromObject(t){let e=H.get(t);!e?.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{e.forEach(t=>t[this.data.interaction]()),this.disposeDelay()},this.data.delay)):e.forEach(t=>t[this.data.interaction]()))}pauseAllTimelines(){let t=[...H.values()];!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(t=>{t.forEach(t=>{t[this.data.interaction]()})}),this.disposeDelay()},this.data.delay)):t.forEach(t=>{t.forEach(t=>{t[this.data.interaction]()})}))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},U=class{constructor(t,e,i,a,n,s,r){this.data=e;let o="interaction"in e?e.interaction:"play";if("play"===o||void 0===o)this.interaction=new S(t,e,i,a,n,s,r);else{if("pause"!==o&&"stop"!==o)throw new Error("Missing property");this.interaction=new Z(e)}}get playing(){return this.interaction instanceof S&&this.interaction.playing}get finished(){return!(this.interaction instanceof S)||this.interaction.finished}get paused(){return!(this.interaction instanceof S)||this.interaction.paused}play(){if(this.interaction instanceof S)return this.interaction.play();this.interaction.dispatch()}stop(){this.interaction instanceof S&&this.interaction.stop()}seek(t){this.interaction instanceof S&&this.interaction.seek(t)}toggle(t){this.interaction instanceof S?this.interaction.toggle(t):this.interaction.dispatch()}playFromCurrent(){this.interaction instanceof S?this.interaction.playFromCurrent():this.interaction.dispatch()}dispatchConditional(){this.interaction instanceof S?f(this.interaction.sharedAssets,this.interaction.actionCondition)&&this.interaction.playFromCurrent():this.interaction.dispatch()}reverseFromCurrent(){this.interaction instanceof S&&this.interaction.reverseFromCurrent()}dispose(){this.interaction.dispose()}};g("TimelineAnimation",({id:t,data:e,page:i,shared:a,object:n,eventType:s,actionCondition:r})=>new U(t,e,i.scene,a,n,s,r)),b("timeline");
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|