"use strict";exports.__esModule=!0,exports.default=void 0;var _extension=require("../../core/extension"),_constant=require("../../common/constant"),_CSS3DRenderer=require("three/examples/jsm/renderers/CSS3DRenderer"),_three=require("three"),_default=exports.default=(0,_extension.definePlugin)("css3d",{setup(a,b){const c=b.container,d=new _CSS3DRenderer.CSS3DRenderer,e=new _three.Scene;d.setSize(c.clientWidth,c.clientHeight),d.domElement.style.position="absolute",d.domElement.style.top="0",d.domElement.style.left="0px";let f=a=>{d.domElement.addEventListener(a,a=>{a.stopPropagation(),a.preventDefault()})};[_constant.ModelMouseEvent.Blur,_constant.ModelMouseEvent.Hover,_constant.ModelMouseEvent.Mousemove,_constant.ModelMouseEvent.ContextMenu].forEach(a=>f(a)),c.append(d.domElement);const g=b.renderer.onResize((a,b)=>{d.setSize(a,b)});return{css3DRenderer:d,dispose:()=>{g(),d.domElement.remove()},update:()=>{d.render(e,b.camera)},add:a=>{e.add(a)}}},render(){this.update()},destroyed(){this.dispose()}});