/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
import{r as t,c as s,h as n,H as i}from"./p-EpnuuCxl.js";import{v as h,q as a,m as o,h as e}from"./p-DfdVaPrt.js";import{o as r}from"./p-BuOEMGyM.js";import"./p-CG9AChtV.js";const d=()=>`.sc-vertex-viewer-dom-group-h{display:block;transform-style:preserve-3d}`;const l=class{constructor(n){t(this,n);this.propertyChange=s(this,"propertyChange");this.position=h.origin();this.positionJson="";this.quaternion=a.create();this.quaternionJson="";this.scale=h.create(1,1,1);this.scaleJson="";this.matrix=o.makeIdentity()}handlePositionChange(){this.syncMatrix()}handlePositionJsonChanged(){this.syncPosition()}handleRotationChanged(){this.syncQuaternionWithRotation()}handleRotationJsonChanged(){this.syncRotation()}handleQuaternionChange(){this.syncMatrix()}handleQuaternionJsonChanged(){this.syncQuaternion()}handleScaleChange(){this.syncMatrix()}handleScaleJsonChanged(){this.syncScale()}handleMatrixChanged(t,s){if(!r.isEqual(t,s)){this.propertyChange.emit()}}componentWillLoad(){this.syncProperties()}componentShouldUpdate(){return false}syncProperties(){this.syncPosition();this.syncRotation();this.syncQuaternion();this.syncScale();this.syncMatrix()}syncPosition(){this.position=this.positionJson.length>0?this.parseJson("positionJson",this.positionJson,h.fromJson):this.position}syncRotation(){this.rotation=this.rotationJson!=null&&this.rotationJson.length>0?this.parseJson("rotationJson",this.rotationJson,e.fromJson):this.rotation;this.syncQuaternionWithRotation()}syncQuaternionWithRotation(){this.quaternion=this.rotation!=null?a.fromEuler(this.rotation):this.quaternion}syncQuaternion(){this.quaternion=this.quaternionJson.length>0?this.parseJson("quaternionJson",this.quaternionJson,a.fromJson):this.quaternion}syncScale(){this.scale=this.scaleJson.length>0?this.parseJson("scaleJson",this.scaleJson,h.fromJson):this.scale}syncMatrix(){this.matrix=o.makeTRS(this.position,this.quaternion,this.scale)}parseJson(t,s,n){try{return n(s)}catch(s){console.warn(`Could not parse \`${t}\`. Invalid JSON.`);throw s}}render(){return n(i,{key:"38d400024a27631bf1f111d9a4f44b01469c814d"},n("slot",{key:"50ab66305307ce5c45638c562830ca55c2956835"}))}static get watchers(){return{position:[{handlePositionChange:0}],positionJson:[{handlePositionJsonChanged:0}],rotation:[{handleRotationChanged:0}],rotationJson:[{handleRotationJsonChanged:0}],quaternion:[{handleQuaternionChange:0}],quaternionJson:[{handleQuaternionJsonChanged:0}],scale:[{handleScaleChange:0}],scaleJson:[{handleScaleJsonChanged:0}],matrix:[{handleMatrixChanged:0}]}}};l.style=d();export{l as vertex_viewer_dom_group};
//# sourceMappingURL=p-64ee30f9.entry.js.map