@u-gis/ue 3.0.7-beta.1 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/earthsdk3-ue.iife.js +1 -21
- package/dist/earthsdk3-ue.js +1021 -1091
- package/dist/earthsdk3-ue.umd.cjs +1 -21
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,21 +1 @@
|
|
|
1
|
-
(function(v,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("@u-gis/core"),require("xbsj-base"),require("@epicgames-ps/lib-pixelstreamingfrontend-ue5.4"),require("html2canvas")):typeof define=="function"&&define.amd?define(["exports","@u-gis/core","xbsj-base","@epicgames-ps/lib-pixelstreamingfrontend-ue5.4","html2canvas"],u):(v=typeof globalThis<"u"?globalThis:v||self,u(v.EarthSDK3_UE={},v.EarthSDK3,v["xbsj-base"],v.libPixelstreamingfrontendUe5_4,v.html2canvas))})(this,function(v,u,a,D,zn){"use strict";var wr=Object.defineProperty;var yr=(v,u,a)=>u in v?wr(v,u,{enumerable:!0,configurable:!0,writable:!0,value:a}):v[u]=a;var f=(v,u,a)=>yr(v,typeof u!="symbol"?u+"":u,a);const Hn={...u.ESViewer.defaults,geoReferenceOrigin:void 0,keepWorldOriginNearCamera:!1,useCache:!0,widgetInteractionDistance:200,memReportInterval:10,sceneControlled:!0,brightness:0,emissiveIntensity:1,statusUpdateInterval:.5,baseUrl:window.location.href??""},Wi=()=>({...u.ESViewer.createCommonProps(),apiKey:"",apiUrl:"",secretKey:"",speechVoiceMode:"",geoReferenceOrigin:a.reactArrayWithUndefined(void 0),keepWorldOriginNearCamera:void 0,useCache:void 0,widgetInteractionDistance:void 0,memReportInterval:void 0,sceneControlled:void 0,brightness:void 0,emissiveIntensity:void 0,statusUpdateInterval:void 0,baseUrl:void 0});function se(){const d=Wi(),e=[];return Object.keys(d).forEach(t=>{e.push(t)}),e}function pe(d){const{defaults:e}=A,t=se(),i={};return t.forEach(n=>{i[n]=d[n]??e[n]}),i}const Gn={Response:1},oe={UIInteraction:50,MouseWheel:75};class Jn extends a.HasOwner{constructor(t,i){super(t);f(this,"_processResponseFn",t=>this.esUeViewer.processResponse(t));f(this,"_inner",new WebSocket(this._uri));f(this,"_innerInit",(()=>{this.inner.onmessage=t=>{if(this.isDestroyed())return;let i=new FileReader;i.onload=n=>{if(this.isDestroyed())return;let r=n.target.result,s=new Uint32Array(r),o=0;if(s[0]===Gn.Response){o+=4;let g=s[o/4];o+=4;for(let c=0;c<g;c++){let w=s[o/4];o+=4;let y=new TextDecoder("utf-8").decode(r.slice(o,o+w));o+=w,this._processResponseFn(y)}}},i.readAsArrayBuffer(t.data)},this.inner.onopen=()=>{this.isDestroyed()||(console.warn("earthsdk message websocket server connected:",this.uri),console.log("%c[EarthSDK websocket open]","background: #a6ec99; color: black","open"),this.owner.dispatchEvent(new CustomEvent("esmsgwsopen",{detail:"websocket open"})))},this._inner.onclose=t=>{this.isDestroyed()||(console.log("%c[EarthSDK websocket close ]","background: red; color: black","error"),this.owner.dispatchEvent(new CustomEvent("error",{detail:"websocket close"})))},this._inner.onerror=t=>{this.isDestroyed()||(console.log("%c[EarthSDK websocket error ]","background: red; color: black","error"),this.owner.dispatchEvent(new CustomEvent("error",{detail:"websocket error"})))},this.d(()=>{!this.isDestroyed()&&this._inner.close()})})());this._uri=i}get esUeViewer(){return this.owner}get uri(){return this._uri}get inner(){return this._inner}sendInputData(t){const i=this.inner;if(i.readyState!==WebSocket.OPEN)return;const r=new Uint8Array(t)[0];if(r>=oe.UIInteraction&&r<=oe.MouseWheel){const s=new ArrayBuffer(t.byteLength+4);return new DataView(s).setUint32(0,t.byteLength,!0),new Uint8Array(s,4).set(new Uint8Array(t)),i.send(new DataView(s)),!0}else return!1}emitDescriptorWithString(t,i){let n=new TextEncoder().encode(i),r=new DataView(new ArrayBuffer(3+n.length)),s=0;r.setUint8(s,t),s++,r.setUint16(s,n.length,!0),s+=2;for(let o=0;o<n.length;o++)r.setUint8(s,n[o]),s+=1;try{this.sendInputData(r.buffer)}catch(o){console.error(`data.buffer.size: ${r.buffer.byteLength} 独立通道 sendInputData error: ${o}`,o)}}destroyImpl(){this._inner&&this._inner.close()}}window.g_emitDescriptor_maxBytes=3e4;let Bn=-1;D.Logger.SetLoggerVerbosity(1);class Kn extends a.Destroyable{constructor(t,i){super();f(this,"_eventTarget",new EventTarget);f(this,"debug",!1);f(this,"uiInteractionCallbacks",new Map);f(this,"_url",this._options.url);f(this,"_container",(()=>{const t=typeof this._domOrDomId=="string"?document.getElementById(this._domOrDomId):this._domOrDomId;if(!t)throw new Error(`ESUEViewer container${this._domOrDomId} error!`);return t})());f(this,"_pixelStream",(()=>{const t=new D.Config({initialSettings:{AutoPlayVideo:!0,AutoConnect:!0,StartVideoMuted:!0,WaitForStreamer:!0,SuppressBrowserKeys:!1,[D.TextParameters.SignallingServerUrl]:this._url}});t.setFlagEnabled(D.Flags.BrowserSendOffer,!1),t.setFlagEnabled(D.Flags.HoveringMouseMode,!0),t.setFlagEnabled(D.Flags.MatchViewportResolution,!0),t.setNumericSetting(D.NumericParameters.MaxReconnectAttempts,0);const i=new D.PixelStreaming(t,{videoElementParent:this._options.createUI?void 0:this.container});return this.d(()=>{!this.isDestroyed()&&i.disconnect()}),i})());f(this,"_esMsgWsWrapper");f(this,"_esMsgWsWrapperInit",(()=>{this._options.esmsgWsUri&&(this._esMsgWsWrapper=this.disposeVar(new Jn(this,this._options.esmsgWsUri)))})());this._domOrDomId=t,this._options=i;const n=this;if(n.esMsgWsWrapper){const r=this.webRtcController.sendMessageController.dataChannelSender.sendData;this.webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData=function(s){n.esMsgWsWrapper?n.esMsgWsWrapper.sendInputData(s):r.call(this,s)}}this.pixelStream.addEventListener("videoInitialized",()=>{console.log("%c[EarthSDK webrtc videoInitialized]","background: #a6ec99; color: black","videoInitialized"),this.dispatchEvent(new CustomEvent("videoinited",{detail:"videoinited"}))}),this.pixelStream.addEventListener("webRtcFailed",()=>{this.isDestroyed()||(console.log("%c[EarthSDK webRtc webRtcFailed]","background: red; color: black","webRtcFailed"),this.dispatchEvent(new CustomEvent("error",{detail:"webRtcFailed"})),this.pixelStream.disconnect())}),this.pixelStream.addEventListener("webRtcDisconnected",()=>{this.isDestroyed()||(console.log("%c[EarthSDK webRtc webRtcDisconnected]","background: red; color: black","webRtcDisconnected"),this.dispatchEvent(new CustomEvent("error",{detail:"webRtcDisconnected"})),this.pixelStream.disconnect())}),this.pixelStream.addEventListener("webRtcConnected",()=>{this.isDestroyed()||(console.log("%c[EarthSDK webrtc webRtcConnected]","background: #a6ec99; color: black","webRtcConnected"),this.dispatchEvent(new CustomEvent("webRtcConnected",{detail:"webRtcConnected"})))}),this.pixelStream.addResponseEventListener("esueviewer",r=>{this.processResponse(r)}),this.dispose(()=>{this._options.createUI||this.container.removeChild(this.webRtcController.videoPlayer.getVideoElement()),this.pixelStream.disconnect(),this.pixelStream.removeResponseEventListener("esueviewer")})}get eventTarget(){return this._eventTarget}addEventListener(t,i,n){return this.eventTarget.addEventListener(t,i,n)}removeEventListener(t,i,n){return this.eventTarget.removeEventListener(t,i,n)}dispatchEvent(t){return this.eventTarget.dispatchEvent(t)}get container(){return this._container}get pixelStream(){return this._pixelStream}get esMsgWsWrapper(){return this._esMsgWsWrapper}get esWebSocketReady(){var t;return((t=this.esMsgWsWrapper)==null?void 0:t.inner.readyState)===1}resolveCallback(t){let i={};try{i=JSON.parse(t)}catch{return!1}let n=i.callid;if(typeof n!="string"||!this.uiInteractionCallbacks.has(n))return!1;let r=this.uiInteractionCallbacks.get(n);return typeof r!="function"?!1:(r(i),this.uiInteractionCallbacks.delete(n),!0)}processResponse(t){if(this.debug??!1)try{const i=JSON.parse(t);if(i.ers=i.ers&&i.ers.filter(n=>n.et!=="mouseMoveEvent"),!(i.ers&&i.ers.length>0||i.frs&&i.frs.length>0))return;console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(i,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()}catch(i){console.error(`processResponse(${t}) error: ${i}`,i)}this.resolveCallback(t)||this.dispatchEvent(new CustomEvent("ueevent",{detail:t}))}emitUIInteraction(t,i){typeof i=="function"&&(t.callid=a.createGuid(),this.uiInteractionCallbacks.set(t.callid,i)),this.pixelStream.emitUIInteraction(t)}get webRtcController(){return this.pixelStream._webRtcController}_pixelStreamEmitUIInteractionAsString(t){this.webRtcController.streamMessageController.toStreamerHandlers.get("UIInteraction")([t])}emitUIInteractionForBigData(t,i){typeof i=="function"&&(t.callid=a.createGuid(),this.uiInteractionCallbacks.set(t.callid,i));const n=JSON.stringify(t),r=window.g_emitDescriptor_maxBytes,s=n.length,o=++Bn;if(this.esMsgWsWrapper){if(s<r){this.esMsgWsWrapper.emitDescriptorWithString(oe.UIInteraction,`${o}-0/1-`+n);return}const g=Math.ceil(s/r)|0;[...new Array(g).keys()].map(w=>n.slice(w*r,(w+1)*r)).forEach((w,y)=>{this.esMsgWsWrapper&&this.esMsgWsWrapper.emitDescriptorWithString(oe.UIInteraction,`${o}-${y}/${g}-`+w)})}}emitCommand(t){this.pixelStream.emitCommand(t)}getVideoSize(){const t=this.webRtcController.videoPlayer.getVideoElement();return{width:t.videoWidth,height:t.videoHeight}}resizeUEVideo(t,i){let n={Resolution:{Width:t,Height:i}};console.log(`resizeUEVideo emitCommand ${t} ${i} begin`),this.emitCommand(n)}}class Vn extends a.Destroyable{constructor(t,i,n){super();f(this,"_instance",this.disposeVar(new Kn(this._container,{url:this._wsuri,esmsgWsUri:this._esmsgWsUri})));f(this,"_event",this.disposeVar(new a.Event));if(this._container=t,this._wsuri=i,this._esmsgWsUri=n,"addEventListener"in this._instance){["esmsgwsopen","error","videoinited","ueevent","webRtcConnected"].forEach(s=>{const o=g=>{this._event.emit(s,g.detail)};this._instance.addEventListener(s,o),this.dispose(()=>this._instance.removeEventListener(s,o))});return}this.dispose(this._instance.errorEvent.disposableOn(r=>{this._event.emit("error",r.detail)})),this.dispose(this._instance.webRtcConnectedEvent.disposableOn(r=>{this._event.emit("webRtcConnected",r.detail)})),this.dispose(this._instance.videoinitedEvent.disposableOn(r=>{this._event.emit("videoinited",r.detail)})),this.dispose(this._instance.ueevent.disposableOn(r=>{this._event.emit("ueevent",r.detail)}))}get webSocketReady(){return this._instance.esWebSocketReady}get event(){return this._event}get debug(){return this._instance.debug}set debug(t){this._instance.debug=t}emitUIInteractionForBigData(t,i){return new Promise((n,r)=>{const s=(...o)=>{n(o),i&&i(...o)};try{this._instance.emitUIInteractionForBigData(t,s)}catch(o){console.warn(`emitUIInteraction发生错误:${o}`),r(o)}})}getVideoSize(){return this._instance.getVideoSize()}resize(t,i){this._instance.resizeUEVideo(t,i)}}const B=async(d,e,t,i,n,r="default")=>{const s=await d.callUeFunc({f:"flyTo",p:{id:e,duration:t,flyToParam:i,position:n,flyMode:r}});if(s.error){console.error(s.error);return}return s.re},we=async(d,e)=>{const t=await d.callUeFunc({f:"destroy",p:{id:e}});return t.error&&console.error(t.error),t},K=(d,e)=>{d.callUeFunc({f:"calcFlyToParam",p:{id:e}}).then(t=>{t.error&&console.error("calcFlyToParam:",t.error)}).catch(t=>{console.error("calcFlyToParam:",t)})},$i=(d,e)=>{d.callUeFunc({f:"refreshTileset",p:{id:e}}).then(t=>{t.error&&console.error("refreshTileset:",t.error)}).catch(t=>{console.error("refreshTileset:",t)})},Z=async(d,e,t,i,n,r="default")=>{const s=await d.callUeFunc({f:"flyIn",p:{id:e,position:t,rotation:i,duration:n,flyMode:r}});if(s.error){console.error(s.error);return}return s.re},_i=async(d,e)=>{if(!d){console.warn("DefaultCameraFlyIn: viewer is undefined");return}const t=await d.callUeFunc({f:"DefaultCameraFlyIn",p:{Duration:e??1}});if(t.error){console.error("DefaultCameraFlyIn:",t.error);return}return t},Ni=async d=>{if(!d){console.warn("StartVoice:viewer is undefined");return}const e=await d.callUeFunc({f:"StartVoice",p:{}});if(e.error){console.error("StartVoice:",e.error);return}return e},zi=async d=>{if(!d){console.warn("StopVoice:viewer is undefined");return}const e=await d.callUeFunc({f:"StopVoice",p:{}});if(e.error){console.error("StopVoice:",e.error);return}return e},Hi=async(d,e)=>{if(!d){console.warn("mountPakFiles:viewer is undefined");return}const t=await d.callUeFunc({f:"MountPakFiles",p:{json:e}});if(t.error){console.error("mountPakFiles:",t.error);return}return t},Gi=async d=>{if(!d){console.warn("generateMemReport:viewer is undefined");return}const e=await d.callUeFunc({f:"GenerateMemReport",p:{}});if(e.error){console.error("generateMemReport:",e.error);return}return e},ye=async(d,e)=>{const t=await d.callUeFunc({f:"resetWithCurrentCamera",p:{id:e}});return t.error&&console.error("resetWithCurrentCamera:",t.error),t},ae=(d,e,t,i,n)=>{d.callUeFunc({f:"smoothMoveWithRotation",p:{id:e,Destination:t,NewRotation:i,Time:n}}).then(r=>{r.error&&console.error("smoothMoveWithRotation:",r.error)}).catch(r=>{console.error("smoothMoveWithRotation:",r)})},le=(d,e,t,i,n,r)=>{d.callUeFunc({f:"smoothMoveOnGround",p:{id:e,Lon:t,Lat:i,Ground:n,Time:r}}).then(s=>{s.error&&console.error("smoothMoveOnGround:",s.error)}).catch(s=>{console.error("smoothMoveOnGround:",s)})},de=(d,e,t,i,n,r,s)=>{d.callUeFunc({f:"smoothMoveWithRotationOnGround",p:{id:e,NewRotation:t,Lon:i,Lat:n,Time:r,Ground:s}}).then(o=>{o.error&&console.error("smoothMoveWithRotationOnGround:",o.error)}).catch(o=>{console.error("smoothMoveWithRotationOnGround:",o)})},Ji=(d,e,t)=>{d.callUeFunc({f:"HighlightFeature",p:{id:e,HlId:t}}).then(i=>{i.error&&console.error("HighlightFeature:",i.error)}).catch(i=>{console.error("HighlightFeature:",i)})},Bi=(d,e,t,i)=>{d.callUeFunc({f:"HighlightFeatureAndFlyTo",p:{id:e,HlId:t,Duration:i}}).then(n=>{n.error&&console.error("HighlightFeatureAndFlyTo:",n.error)}).catch(n=>{console.error("HighlightFeatureAndFlyTo:",n)})},Ki=(d,e,t)=>{d.callUeFunc({f:"SetLayerVisible",p:{id:e,LayerJson:t}}).then(i=>{i.error&&console.error("SetLayerVisible:",i.error)}).catch(i=>{console.error("SetLayerVisible:",i)})},Vi=(d,e,t)=>{d.callUeFunc({f:"SetLayerColor",p:{id:e,LayerJson:t}}).then(i=>{i.error&&console.error("SetLayerColor:",i.error)}).catch(i=>{console.error("SetLayerColor:",i)})},ce=(d,e,t,i)=>{d.callUeFunc({f:"smoothMove",p:{id:e,Destination:t,Time:i}}).then(n=>{n.error&&console.error("smoothMove:",n.error)}).catch(n=>{console.error("smoothMove:",n)})},me=(d,e,t,i)=>{d.callUeFunc({f:"callFunction",p:{id:e,fn:t,p:i}}).then(n=>{n.error&&(console.error("callFunction:",n.error),console.error(`id: ${e} fn: ${t} param: ${i}`))}).catch(n=>{console.error("callFunction:",n),console.error(`id: ${e} fn: ${t} param: ${i}`)})},qi=(d,e,t,i)=>{d.callUeFunc({f:"SetNodePosition",p:{id:e,NodeName:t,NodePosition:i}}).then(n=>{n.error&&console.error("SetNodePosition:",n.error)}).catch(n=>{console.error("SetNodePosition:",n)})},Xi=(d,e,t,i)=>{d.callUeFunc({f:"SetNodeRotation",p:{id:e,NodeName:t,NodeRotation:i}}).then(n=>{n.error&&console.error("SetNodeRotation:",n.error)}).catch(n=>{console.error("SetNodeRotation:",n)})},Zi=(d,e,t,i)=>{d.callUeFunc({f:"SetNodeScale",p:{id:e,NodeName:t,NodeScale:i}}).then(n=>{n.error&&console.error("SetNodeScale:",n.error)}).catch(n=>{console.error("SetNodeScale:",n)})},M=async(d,e)=>{const t=await d.callUeFunc({f:"ChangeNavigationMode",p:e});if(t.error){console.error("ChangeNavigationMode:",t.error);return}return t},Qi=async(d,e)=>{const t=await d.callUeFunc({f:"setGlobalProperty",p:e});if(t.error){console.error("setGlobalProperty:",t.error);return}return t},Yi=async d=>{const e=await d.callUeFunc({f:"Quit",p:void 0});if(e.error){console.error("Quit:",e.error);return}return e},bi=async(d,e,t,i)=>{console.log("pickCallFunc",e,t,i);const n=await d.callUeFunc({f:"pick",p:{screenPosition:e,parentInfo:i}});if(!n.re&&(n.error||n.error=="")){console.error("pick:",n.error==""?"未获取到结果":n.error);return}let r=n.re.id;const s=r?u.ESSceneObject.getSceneObject(r):void 0;return s&&Reflect.has(s,"allowPicking")&&Reflect.has(s,"pickedEvent")&&(s.allowPicking??!1)&&s.pickedEvent.emit({attachedInfo:t}),s&&Reflect.has(s,"allowPicking")&&!s.allowPicking?new u.PickedResult:new u.PickedResult(n.re,s,n.re.features,n.re.add,t)},xi=async(d,e)=>{const t=await d.callUeFunc({f:"pickPosition",p:{screenPosition:e}});if(!t.re&&(t.error||t.error=="")){console.error("pickPosition",t.error==""?"未获取到结果":t.error);return}const{position:i}=t.re;return i},Oi=async(d,e,t,i="ECC_Visibility")=>{const n=await d.callUeFunc({f:"GetHeightByLonLat",p:{Lon:e,Lat:t,Channel:i}});if(n.error){console.warn(`GetHeightByLonLat:${n.error}`);return}return n.re},ji=async(d,e,t="ECC_Visibility")=>{const i=await d.callUeFunc({f:"GetHeightsByLonLats",p:{LonLats:e,Channel:t}});if(i.error){console.warn(`GetHeightsByLonLats:${i.error}`);return}i.re.heights.includes(null)&&console.warn("注意! GetHeightsByLonLats: 存在高度为null的点. there are points with a height of null");try{return i.re.heights}catch{return}},tn=async(d,e=64,t=64)=>{const i=await d.callUeFunc({f:"capture",p:{resx:e,resy:t}});if(i.error){console.warn(i.error);return}return i.re.image},en=async(d,e,t=[64,64])=>{const i=await d.callUeFunc({f:"partialCapture",p:{startPos:e,size:t}});if(i.error){console.warn(i.error);return}return i.re.image},nn=async(d,e)=>{const t=await d.callUeFunc({f:"LonLatAltToScreenPosition",p:{LonLatAlt:e}});return t.error&&console.warn(t.error),t.re},rn=async(d,e)=>{const t=await d.callUeFunc({f:"UEPositionToLonLatAlt",p:{UEPosition:e}});if(t.error){console.warn(t.error);return}return[...t.re.LonLatAlt]},sn=async(d,e)=>{const t=await d.callUeFunc({f:"GetAllSocketNamesByActorTag",p:{ActorTag:e}});if(t.error){console.warn(t.error);return}return[...t.re.socketNames]},on=async d=>{const e=await d.callUeFunc({f:"GetVersion",p:void 0});if(e.error){console.warn("GetVersion:",e.error);return}return e.re.version},an=async(d,e)=>{const t=await d.callUeFunc({f:"GetBoundSphere",p:{id:e}});if(t.error){console.warn(t.error);return}return t.re},ln=async(d,e)=>{const t=await d.callUeFunc({f:"GetBoundSphereWithChildren",p:{id:e}});if(t.error){console.warn(`GetBoundSphereWithChildren:${t.error}`);return}return t.re},dn=async(d,e)=>{const t=await d.callUeFunc({f:"GetStrokeMaterialParamInfo",p:{id:e}});if(t.error){console.warn(`GetStrokeMaterialParamInfo:${t.error}`);return}return t.re},cn=async(d,e)=>{const t=await d.callUeFunc({f:"GetFillMaterialParamInfo",p:{id:e}});if(t.error){console.warn(`GetFillMaterialParamInfo:${t.error}`);return}return t.re},un=async(d,e)=>{const t=await d.callUeFunc({f:"getGlobalProperty",p:{props:e}});if(t.error){console.warn(`getGlobalProperty:${t.error}`);return}return t.re},hn=async(d,e)=>{const t=await d.callUeFunc({f:"GetObjectByInfo",p:{info:e}});if(t.error){console.warn(`GetObjectByInfo:${t.error}`);return}return t.re},gn=async(d,e,t)=>await d.callUeFunc({f:"BindActorByTag",p:{ID:e,ActorTag:t}}),vn=async d=>await d.callUeFunc({f:"RestoreOriginalScene",p:void 0}),fn=async(d,e)=>await d.callUeFunc({f:"UnBindActorByID",p:{ID:e}}),pn=async(d,e)=>await d.callUeFunc({f:"UnBindActorByTag",p:{ActorTag:e}}),wn=async(d,e,t)=>await d.callUeFunc({f:"CreateActorByClass",p:{ID:e,ActorClass:t}}),yn=async function(d,e,t){return await d.callUeFunc({f:"Bind3DTilesetByTag",p:{ID:e,ActorTag:t}})},mn=async function(d,e){return await d.callUeFunc({f:"UnBind3DTilesetByTag",p:{ActorTag:e}})},Cn=async function(d,e){return await d.callUeFunc({f:"UnBind3DTilesetById",p:{ID:e}})},En=async function(d,e,t,i){return await d.callUeFunc({f:"BindImageryByTag",p:{ID:e,ActorTag:t,ComponentTag:i}})},Fn=async function(d,e,t){return await d.callUeFunc({f:"UnBindImageryByTag",p:{ActorTag:e,ComponentTag:t}})},Sn=async function(d,e){return await d.callUeFunc({f:"UnBindImageryById",p:{ID:e}})},In=async function(d,e,t,i){return await d.callUeFunc({f:"GetIdByComponentNameAndHitItem",p:{id:e,ComponentName:t,HitItem:i}})},Tn=async function(d,e="ECC_Visibility"){return await d.callUeFunc({f:"GetCameraRelativeHeight",p:{Channel:e}})},Rn=async function(d,e,t,i){const n=await d.callUeFunc({f:"SaveStringToFile",p:{String:e,Path:t??"undefine",File:i??"data.txt"}});return n.error!==""&&console.warn("SaveStringToFile: ",n.error),n},Dn=async function(d,e,t=!0){const i=await d.callUeFunc({f:"HighlightActorByTag",p:{ActorTag:e,Highlight:t}});return i.error!==""&&console.warn("HighlightActorByTag: ",i.error),i},kn=async function(d,e){const t=await d.callUeFunc({f:"SendCustomMessage",p:{Message:e}});return t.error!==""&&console.warn("SendCustomMessage: ",t.error),t},Ln=async function(d){const e=await d.callUeFunc({f:"GetStatus",p:void 0});if(e.error){console.warn(`GetStatus:${e.error}`);return}return e.re},Pn=async(d,e,t,i,n=!0)=>{const r=await d.callUeFunc({f:"startEditing",p:{sceneObjectID:e,editingID:t,modes:i,useKeyToSwitch:n}});if(r.error){console.error("startEditing:",r.error);return}return r},Un=async d=>{const e=await d.callUeFunc({f:"stopEditing",p:void 0});if(e.error){console.error("stopEditing:",e.error);return}return e},Mn=async(d,e,t)=>{const i=await d.callUeFunc({f:"moveObjects",p:{sceneObjectIDs:e,editingID:t}});if(i.error){console.error("moveObjects:",i.error);return}return i},An=async d=>{const e=await d.callUeFunc({f:"GetTilesetMaterialIDList",p:void 0});if(e.error){console.error("GetTilesetMaterialIDList:",e.error);return}return e.re.materialIDList};class Q extends a.Destroyable{}class qn extends u.PickedInfo{constructor(e,t,i){super(t),this.uePickResult=e,this.tilesetPickInfo=i}}class Xn extends Q{constructor(t,i,n,r){super();f(this,"_esueViewerWrapper");f(this,"_ueFuncResultWithIdsEvent",this.dv(new a.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Set);f(this,"_ueEvent",this.dv(new a.Event));f(this,"_errorEvent",this.dv(new a.Event));f(this,"_readyEvent",this.dv(new a.Event));f(this,"_esmsgwsopen",this.dv(a.react(!1)));f(this,"_videoinited",this.dv(a.react(!1)));f(this,"_webRtcConnected",this.dv(a.react(!1)));this._ueViewer=r,console.log("CSTMPSViewer init ! 以官方像素流 + 独立通信的模式启动!");const s=this._ueViewer;this._esueViewerWrapper=this.dv(new Vn(t,i,n));const o=this._esueViewerWrapper;{const p=()=>o.debug=s.debug??!1;p(),this.d(s.debugChanged.don(p))}let g=!1;{const p=()=>{if(g)return;const h=o.webSocketReady;if(this.videoinited&&this.webRtcConnected&&h){console.log("%c[EarthSDK: esmsgWebSocket && videoinited && webRtcConnected]","background: #a6ec99; color: black");const m={eventType:"init",params:{}};o.emitUIInteractionForBigData(m),this._readyEvent.emit(),g=!0}};this.d(this.videoinitedChanged.don(()=>{p()})),this.d(this.webRtcConnectedChanged.don(()=>{p()})),this.d(this.esmsgwsopenChanged.don(()=>{p()}))}this.d(o.event.don((p,h)=>{if(p==="error")this._errorEvent.emit(h);else if(p==="ueevent"){const m=JSON.parse(h);if(m.t==="cr"){const C=m;if(C.frs&&this._ueFuncResultWithIdsEvent.emit(C.frs),C.ers)for(let E of C.ers)this._ueEvent.emit(E)}}else p==="webRtcConnected"?this.webRtcConnected=!0:p==="videoinited"?this.videoinited=!0:p==="esmsgwsopen"&&(this.esmsgwsopen=!0)}));{const p=this.dv(a.createAnimateFrame());let h,m;p.start(()=>{if(h!==t.offsetWidth||m!==t.offsetHeight){if(h=t.offsetWidth,m=t.offsetHeight,h===void 0||m===void 0||!Number.isFinite(h)||!Number.isFinite(m)||h<0||m<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${h} ${m}`);return}o.resize(h,m),console.log(`resize: ${h} ${m}`)}})}this.d(this._ueFuncResultWithIdsEvent.don(p=>{for(const h of p){const m=this._waitingUeFuncIdAndResultCallbacks.get(h.fid);m&&(this._waitingUeFuncIdAndResultCallbacks.delete(h.fid),m.resultCallback(h.r))}}));let c=0;const w=p=>{const h={n:c++,tt:Date.now(),t:"c",fs:p};this._waitingUeCalls.add(h),s.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(h,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd()),this._esueViewerWrapper.emitUIInteractionForBigData(h,()=>{this._waitingUeCalls.delete(h)})},y=()=>{if(!g||this._ueFuncWithIdAndResultCallbacks.length===0)return;const p=this._ueFuncWithIdAndResultCallbacks.map(([h])=>h);for(const[h,m]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(h.fid,m);this._ueFuncWithIdAndResultCallbacks.length=0;{const h=window.g_emitDescriptor_maxBytes,m=p.map(R=>({f:R,s:JSON.stringify(R).length}));let C=m.length,E=0,I=0,F=[];do{do{const{f:R,s:T}=m[E];if(F.push(R),++E,I+T>h||F.length>=20)break}while(E<C);F.length>0&&(s.debug&&console.log(`传送${F.length}条消息...`),w([...F]),F.length=0,I=0)}while(E<C)}};this.dv(a.createInterval()).start(y,50),this.d(()=>console.log("UeCloudViewer正在销毁..."))}get esueViewerWrapper(){return this._esueViewerWrapper}get errorEvent(){return this._errorEvent}get readyEvent(){return this._readyEvent}get esmsgwsopen(){return this._esmsgwsopen.value}set esmsgwsopen(t){this._esmsgwsopen.value=t}get esmsgwsopenChanged(){return this._esmsgwsopen.changed}get videoinited(){return this._videoinited.value}set videoinited(t){this._videoinited.value=t}get videoinitedChanged(){return this._videoinited.changed}get webRtcConnected(){return this._webRtcConnected.value}set webRtcConnected(t){this._webRtcConnected.value=t}get webRtcConnectedChanged(){return this._webRtcConnected.changed}resize(t,i){this.esueViewerWrapper.resize(t,i)}callUeFunc(t){return new Promise(i=>{const r={fid:a.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,{timeStamp:Date.now(),ueFunc:t,resultCallback:i}])})}disposableOnUeEvent(t,i){(this._ueViewer.debug??!1)&&console.log(`disposableOnUeEvent from UeCloudViewer, type:${t}`);const n=a.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},s=this._ueEvent.don(o=>{o.et===t&&o.eid===n&&i(o)});return()=>{s(),r()}}}function Zn(d){let e="";const t=new Uint8Array(d),i=t.length;for(let n=0;n<i;n++)e+=String.fromCharCode(t[n]);return btoa(e)}const Qn=d=>{const e={type:"input",inputdata:Zn(d)};return JSON.stringify(e)};function Yn(d){return typeof d=="string"?document.getElementById(d):d}window.g_emitDescriptor_maxBytes=3e4,console.log("全局可设置消息体最大字节, window.g_emitDescriptor_maxBytes 默认 30000 。");let bn=-1;D.Logger.SetLoggerVerbosity(1);class xn extends a.Destroyable{constructor(t,i){super();f(this,"debug",!1);f(this,"_error",this.dv(new a.Event));f(this,"_connected",this.dv(new a.Event));f(this,"_ueevent",this.dv(new a.Event));f(this,"_pixelStream");f(this,"uiInteractionCallbacks",new Map);this._container=t,this._option=i;const n=new D.Config({initialSettings:{HoveringMouse:!0,AutoPlayVideo:!0,AutoConnect:!0,StartVideoMuted:!0,WaitForStreamer:!0,SuppressBrowserKeys:!1,ss:this._option.ws},useUrlParams:!0});n.setFlagEnabled(D.Flags.BrowserSendOffer,!1),n.setFlagEnabled(D.Flags.HoveringMouseMode,!0),n.setFlagEnabled(D.Flags.MatchViewportResolution,!0),n.setNumericSetting(D.NumericParameters.MaxReconnectAttempts,0),this._pixelStream=new D.PixelStreaming(n,{videoElementParent:this.container});{const r=this.pixelStream.webSocketController.webSocket,s=this._pixelStream._webRtcController.sendMessageController.dataChannelSender.sendData;this._pixelStream._webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData=function(o){r?r.send(Qn(o)):s.call(this,o)}}{const r=s=>{const o=this._pixelStream._webRtcController.mouseController;setTimeout(()=>{const g=o.coordinateConverter.normalizeAndQuantizeUnsigned(s.offsetX,s.offsetY),w=o.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp");w&&w([s.button,g.x,g.y]),s.preventDefault()})};this.container.addEventListener("dblclick",r),this.d(()=>{this.container.removeEventListener("dblclick",r)})}["error","close","open"].forEach(s=>{const o=()=>{this.isDestroyed()||(s==="open"?this.connected.emit("webSocketOpen"):s==="close"?this.error.emit("webSocketClose"):s==="error"&&this.error.emit("webSocketError"))};this.pixelStream.webSocketController.webSocket.addEventListener(s,o),this.d(()=>{this.pixelStream.webSocketController.webSocket.removeEventListener(s,o)})}),["videoInitialized","webRtcConnected","webRtcDisconnected","webRtcFailed"].forEach(s=>{const o=()=>{this.isDestroyed()||(s==="webRtcConnected"||s==="videoInitialized"?this.connected.emit(s):(s==="webRtcDisconnected"||s==="webRtcFailed")&&(this.error.emit(s),this.pixelStream.disconnect()))};this.pixelStream.addEventListener(s,o),this.d(()=>{this.pixelStream.removeEventListener(s,o)})}),this.pixelStream.addResponseEventListener("handle_responses",r=>{this.processResponse(r)}),this.d(()=>{this.pixelStream.removeResponseEventListener("handle_responses")})}get error(){return this._error}get connected(){return this._connected}get ueevent(){return this._ueevent}get container(){return Yn(this._container)}get pixelStream(){return this._pixelStream}get webSocketReady(){return this.pixelStream.webSocketController.webSocket.readyState===1}processResponse(t){if(this.debug??!1)try{const i=JSON.parse(t);console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(i,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()}catch(i){console.error(`processResponse(${t}) error: ${i}`,i)}this.resolveCallback(t)||this.ueevent.emit(t)}emitUIInteractionForBigData(t,i){typeof i=="function"&&(t.callid=a.createGuid(),this.uiInteractionCallbacks.set(t.callid,i));const n=JSON.stringify(t),r=window.g_emitDescriptor_maxBytes??3e4,s=n.length,o=++bn;if(s<r){const w={type:"earthsdk",time:new Date().getTime(),params:`${o}-0/1-`+n};this.sendData(JSON.stringify(w));return}const g=Math.ceil(s/r)|0;[...new Array(g).keys()].map(w=>n.slice(w*r,(w+1)*r)).forEach((w,y)=>{const l={type:"earthsdk",time:new Date().getTime(),params:`${o}-${y}/${g}-`+w};this.sendData(JSON.stringify(l))})}sendData(t){this.pixelStream.webSocketController.webSocket.send(t)}resolveCallback(t){let i={};try{i=JSON.parse(t)}catch{return!1}let n=i.callid;if(typeof n!="string"||!this.uiInteractionCallbacks.has(n))return!1;let r=this.uiInteractionCallbacks.get(n);return typeof r!="function"?!1:(r(i),this.uiInteractionCallbacks.delete(n),!0)}getVideoSize(){const t=this._pixelStream._webRtcController.videoPlayer.getVideoElement();return{width:t.videoWidth,height:t.videoHeight}}emitCommand(t){this.pixelStream.emitCommand(t)}emitUIInteraction(){console.log("emitUIInteraction 像素流初始化"),this.pixelStream.emitUIInteraction("像素流初始化")}resizeUEVideo(t,i){const n={Resolution:{Width:t,Height:i}};console.log(`resizeUEVideo emitCommand ${t} ${i} begin`),this.emitCommand(n)}}class On extends a.Destroyable{constructor(t,i,n){super();f(this,"_instance");f(this,"_event",this.dv(new a.Event));this._container=t,this._wsuri=i,this._esmsgWsUri=n,this._instance=this.dv(new xn(this._container,{ws:this._wsuri})),this.d(this._instance.connected.don(r=>{this._event.emit(r,r),console.log(`%c[EarthSDK] ${r}`,"background: #a6ec99; color: black")})),this.d(this._instance.error.don(r=>{this._event.emit("errorEvent",r),console.log(`%c[EarthSDK] ${r}`,"background: red; color: black")})),this.d(this._instance.ueevent.don(r=>{this._event.emit("ueevent",r)}))}get instance(){return this._instance}get event(){return this._event}get debug(){return this._instance.debug}set debug(t){this._instance.debug=t}emitUIInteractionForBigData(t,i){return new Promise((n,r)=>{const s=(...o)=>{n(o),i&&i(...o)};try{this._instance.emitUIInteractionForBigData(t,s)}catch(o){console.warn(`emitUIInteraction发生错误:${o}`),r(o)}})}getVideoSize(){return this._instance.getVideoSize()}resize(t,i){this._instance.resizeUEVideo(t,i)}}class jn extends Q{constructor(t,i,n,r){super();f(this,"_videoInitialized",this.dv(a.react(!1)));f(this,"_webRtcConnected",this.dv(a.react(!1)));f(this,"_webSocketOpen",this.dv(a.react(!1)));f(this,"_ue5ViewerWrapper");f(this,"_ueFuncResultWithIdsEvent",this.dv(new a.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Set);f(this,"_ueEvent",this.dv(new a.Event));f(this,"_errorEvent",this.dv(new a.Event));f(this,"_readyEvent",this.dv(new a.Event));this._ueViewer=r,console.log("INNPSViewer init ! 以内置信令服务器模式启动!");const s=this._ueViewer,o=this.dv(new On(t,i,n));this._ue5ViewerWrapper=o;{const l=()=>o.debug=s.debug??!1;l(),this.d(s.debugChanged.don(l))}{let l=!1;const p=this.dv(a.createNextAnimateFrameEvent(this._videoInitialized.changed,this._webRtcConnected.changed,this._webSocketOpen.changed));this.d(p.don(()=>{if(l)return;const h=this._ue5ViewerWrapper.instance.webSocketReady;if(this.videoInitialized&&this.webRtcConnected&&h){this._ue5ViewerWrapper.instance.emitUIInteraction(),this._readyEvent.emit(),l=!0,console.log("%c[EarthSDK videoInitialized && webRtcConnected && webSocketReady]","background: #a6ec99; color: black");const m={eventType:"init",params:{}};this._ue5ViewerWrapper.emitUIInteractionForBigData(m)}else console.warn("webSocketReady",h),l=!1}))}this.d(o.event.don((l,p)=>{if(l==="errorEvent")this._errorEvent.emit(p);else if(l==="videoInitialized")this._videoInitialized.value=!0;else if(l==="webRtcConnected")this._webRtcConnected.value=!0;else if(l==="webSocketOpen")this._webSocketOpen.value=!0;else if(l==="ueevent"){const h=JSON.parse(p);if(h.t==="cr"){const m=h;if(m.frs&&this._ueFuncResultWithIdsEvent.emit(m.frs),m.ers)for(let C of m.ers)this._ueEvent.emit(C)}}}));{const l=this.dv(a.createAnimateFrame());let p,h,m;l.start(()=>{if(p!==t.offsetWidth||h!==t.offsetHeight||m!==s.resolutionScale){if(p=t.offsetWidth,h=t.offsetHeight,p===void 0||h===void 0||!Number.isFinite(p)||!Number.isFinite(h)||p<0||h<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${p} ${h}`);return}m=s.resolutionScale,o.resize(p/m,h/m)}})}this.d(this._ueFuncResultWithIdsEvent.don(l=>{for(const p of l){const h=this._waitingUeFuncIdAndResultCallbacks.get(p.fid);h&&(this._waitingUeFuncIdAndResultCallbacks.delete(p.fid),h.resultCallback(p.r))}}));let g=0;const c=l=>{const p={n:g++,tt:Date.now(),t:"c",fs:l};this._waitingUeCalls.add(p),s.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(p,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd()),this._ue5ViewerWrapper.emitUIInteractionForBigData(p,()=>{this._waitingUeCalls.delete(p)})},w=()=>{if(!this._ue5ViewerWrapper.instance.webSocketReady||this._ueFuncWithIdAndResultCallbacks.length===0)return;const p=this._ueFuncWithIdAndResultCallbacks.map(([h])=>h);for(const[h,m]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(h.fid,m);this._ueFuncWithIdAndResultCallbacks.length=0;{const h=window.g_emitDescriptor_maxBytes,m=p.map(R=>({f:R,s:JSON.stringify(R).length}));let C=m.length,E=0,I=0,F=[];do{do{const{f:R,s:T}=m[E];if(F.push(R),++E,I+T>h||F.length>=20)break}while(E<C);F.length>0&&(s.debug&&console.log(`传送${F.length}条消息...`),c([...F]),F.length=0,I=0)}while(E<C)}};this.dv(a.createInterval()).start(w,50),this.d(()=>console.log("UeCloudViewer正在销毁..."))}get videoInitialized(){return this._videoInitialized.value}get webRtcConnected(){return this._webRtcConnected.value}get webSocketOpen(){return this._webSocketOpen.value}get ue5ViewerWrapper(){return this._ue5ViewerWrapper}get errorEvent(){return this._errorEvent}get readyEvent(){return this._readyEvent}resize(t,i){this.ue5ViewerWrapper.resize(t,i)}callUeFunc(t){return new Promise(i=>{const r={fid:a.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,{timeStamp:Date.now(),ueFunc:t,resultCallback:i}])})}disposableOnUeEvent(t,i){const n=a.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},s=this._ueEvent.don(o=>{o.et===t&&o.eid===n&&i(o)});return()=>{s(),r()}}}class tr extends a.Destroyable{constructor(t,i,n,r){super();f(this,"_onRuntimeInitialized",this.dv(new a.Event));f(this,"_vIframe",null);this._ueViewer=r;const s=this._ueViewer;{const o=document.createElement("iframe");this._vIframe=o,o.style.cssText="width: 100%; height: 100%; margin: 0; padding: 0; border: none; outline: none;",t.appendChild(o),this.d(()=>{o&&t.removeChild(o)});const g=u.ESSceneObject.getStrFromEnv(n+`/web/${i}.html`);o.src=g,o.onload=()=>{const c=o.contentWindow;if(!c){console.error("iframeWindow is null");return}console.log("iwindow.Module",c.Module),c.Module.onRuntimeInitialized=()=>{this._onRuntimeInitialized.emit(),s.setStatus("Created"),s.setStatusLog("创建成功"),c.Module.UE4_resizeCanvas(),c.console.log("创建成功__________________________________________")}}}}get onRuntimeInitialized(){return this._onRuntimeInitialized}get vIframe(){return this._vIframe}}const Wn=typeof TextDecoder<"u"?new TextDecoder:void 0,er=(d,e=0,t=NaN)=>{const i=e+t;let n=e;for(;d[n]&&!(n>=i);)++n;if(n-e>16&&d.buffer&&Wn)return Wn.decode(d.subarray(e,n));let r="";for(;e<n;){var s=d[e++];if(!(s&128)){r+=String.fromCharCode(s);continue}var o=d[e++]&63;if((s&224)==192){r+=String.fromCharCode((s&31)<<6|o);continue}var g=d[e++]&63;if((s&240)==224?s=(s&15)<<12|o<<6|g:((s&248)!=240&&console.warn("Invalid UTF-8 leading byte encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),s=(s&7)<<18|o<<12|g<<6|d[e++]&63),s<65536)r+=String.fromCharCode(s);else{var c=s-65536;r+=String.fromCharCode(55296|c>>10,56320|c&1023)}}return r};class ir extends a.Destroyable{constructor(e,t,i){super();{const n=()=>{const g=pe(t);t.setGlobalProperty(g)};n();const r=se(),s=[];r.forEach(g=>{const c=t[g+"Changed"];s.push(c)});const o=this.dv(a.createNextAnimateFrameEvent(...s));this.d(o.don(n))}this.d(t.propChanged.don(n=>{if(n.objId==="")try{Object.keys(n.props).forEach(r=>{const s=n.props[r]===null?void 0:n.props[r];t[r]=s})}catch(r){console.error("ueViewer propChanged:"+r)}})),t.useCustomInteraction=!1,this.dv(new u.ViewerCustomInteraction(t,e)),this.dv(new a.ObjResettingWithEvent(t.statusUpdateIntervalChanged,n=>{if((t.statusUpdateInterval??.5)===0)return;const s=new a.Destroyable;return s.d(i.disposableOnUeEvent("statusUpdate",o=>{t.statusUpdateEvent.emit(o)})),s})),this.dv(new a.ObjResettingWithEvent(t.propChangedListeningChanged,()=>{if(!(t.propChangedListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("propChanged",s=>{t.propChanged.emit(s)})),r})),this.dv(new a.ObjResettingWithEvent(t.objectEventListeningChanged,()=>{if(!(t.objectEventListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("objectEvent",s=>{t.objectEvent.emit(s)})),r})),this.dv(new a.ObjResettingWithEvent(t.widgetEventListeningChanged,()=>{if(!(t.widgetEventListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("widgetEvent",s=>{t.widgetEvent.emit(s)})),r})),this.dv(new a.ObjResettingWithEvent(t.speechRecognitionListeningChanged,()=>{if(!(t.speechRecognitionListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("speechRecognition",s=>{t.speechRecognition.emit(s)})),r})),this.dv(new a.ObjResettingWithEvent(t.customMessageListeningChanged,()=>{if(!(t.customMessageListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("customMessage",s=>{t.customMessage.emit(s)})),r})),this.dv(new a.ObjResettingWithEvent(t.editingEventListeningChanged,()=>{if(!(t.editingEventListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("editingEvent",s=>{s.objectIDs=s.objectIDs.map(o=>o.split("_")[0]),t.editingEvent.emit(s)})),r}))}}let nr=-1;class rr extends Q{constructor(t,i,n="${earthsdk3-ue-h5-assets-script-dir}",r){super();f(this,"_ueFuncResultWithIdsEvent",this.dv(new a.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Map);f(this,"_ueEvent",this.dv(new a.Event));this._ueViewer=r;const s=this._ueViewer,o=this.dv(new tr(t,i,n,s));let g=!1,c=null;this.d(o.onRuntimeInitialized.don(()=>{var p;if(g=!0,(p=o==null?void 0:o.vIframe)!=null&&p.contentWindow){c=o.vIframe.contentWindow;const h=o.vIframe.contentWindow.document.getElementById("mainarea");h?this.dv(new ir(h,s,this)):console.error("h5Container is null")}else{console.error("iframeWindow is null");return}c.UE_JSHTML5Communication?c.UE_JSHTML5Communication.UESendMessageToJS=h=>{try{const m=er(c.HEAPU8,h),C=JSON.parse(m);if(s.debug&&(console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(C,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()),C.t==="cr"){const E=C;if(E.frs&&this._ueFuncResultWithIdsEvent.emit(E.frs),E.ers)for(let I of E.ers)this._ueEvent.emit(I)}C.callid&&this._waitingUeCalls.has(C.callid)&&(this._waitingUeCalls.delete(C.callid),console.log(`waitingUeCalls.delete:${C.callid} end`))}catch(m){console.error("UE_JSHTML5Communication.UESendMessageToJS error:",m)}}:console.error("UE_JSHTML5Communication UESendMessageToJS not found")})),this.dispose(this._ueFuncResultWithIdsEvent.disposableOn(p=>{for(const h of p){const m=this._waitingUeFuncIdAndResultCallbacks.get(h.fid);m&&(this._waitingUeFuncIdAndResultCallbacks.delete(h.fid),m(h.r))}}));let w=0;const y=()=>{if(!g||!c||!c.UE_JSHTML5Communication||!c.UE_JSHTML5Communication.JSSendMessageToUE||this._ueFuncWithIdAndResultCallbacks.length===0)return;const p=this._ueFuncWithIdAndResultCallbacks.map(([T])=>T),h={n:w++,tt:Date.now(),t:"c",fs:p,callid:a.createGuid()};for(const[T,W]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(T.fid,W);this._ueFuncWithIdAndResultCallbacks.length=0,this._waitingUeCalls.set(h.callid,h),s.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(h,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd());const m=JSON.stringify(h),C=window.g_emitDescriptor_maxBytes??3e4,E=m.length,I=++nr;if(E<C){const T=`${I}-0/1-`+m;c.UE_JSHTML5Communication.JSSendMessageToUE(T);return}const F=Math.ceil(E/C)|0;[...new Array(F).keys()].map(T=>m.slice(T*C,(T+1)*C)).forEach((T,W)=>{const fe=`${I}-${W}/${F}-`+T;c.UE_JSHTML5Communication.JSSendMessageToUE(fe)})};this.dv(a.createInterval()).start(y,50)}processResponse(t){if(this._ueViewer.debug??!1)try{const i=JSON.parse(t);console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(i,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()}catch(i){console.error(`processResponse(${t}) error: ${i}`,i)}}callUeFunc(t){return new Promise(i=>{const r={fid:a.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,i])})}disposableOnUeEvent(t,i){const n=a.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},s=this._ueEvent.disposableOn(o=>{o.et===t&&o.eid===n&&((this._ueViewer.debug??!1)&&console.log(`callback, type:${t} eid:${n} ueEvent:${JSON.stringify(o)}`),i(o))});return()=>{s(),r()}}}let sr=-1;class or extends Q{constructor(t,i){super();f(this,"_ueFuncResultWithIdsEvent",this.dv(new a.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Set);f(this,"_ueEvent",this.dv(new a.Event));this._ueViewer=i;const n=this._ueViewer;let r=!1;const s={eventType:"init",params:{}};window.ue.es.oncommand(JSON.stringify(s)),r=!0,window.calljs=(w,y)=>{if(n.debug&&console.log(`calljs eventName:${w} eventDetailStr:${y}`),w==="ueevent"||w==="commanFinish")try{const l=JSON.parse(y);if(l.t==="cr"){const p=l;if(p.frs&&this._ueFuncResultWithIdsEvent.emit(p.frs),p.ers)for(let h of p.ers)this._ueEvent.emit(h)}}catch(l){console.error(l)}},this.dispose(this._ueFuncResultWithIdsEvent.disposableOn(w=>{for(const y of w){const l=this._waitingUeFuncIdAndResultCallbacks.get(y.fid);l&&(this._waitingUeFuncIdAndResultCallbacks.delete(y.fid),l(y.r))}}));let o=0;const g=()=>{if(!r||this._ueFuncWithIdAndResultCallbacks.length===0)return;const w=this._ueFuncWithIdAndResultCallbacks.map(([p])=>p),y={n:o++,tt:Date.now(),t:"c",fs:w};for(const[p,h]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(p.fid,h);this._ueFuncWithIdAndResultCallbacks.length=0,this._waitingUeCalls.add(y),n.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(y,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd());const l=++sr;window.ue.es.oncommand(`${l}-0/1-`+JSON.stringify(y)).then(()=>{this._waitingUeCalls.delete(y)})};this.dv(a.createInterval()).start(g,50)}callUeFunc(t){return new Promise(i=>{const r={fid:a.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,i])})}disposableOnUeEvent(t,i){const n=a.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},s=this._ueEvent.disposableOn(o=>{o.et===t&&o.eid===n&&((this._ueViewer.debug??!1)&&console.log(`callback, type:${t} eid:${n} ueEvent:${JSON.stringify(o)}`),i(o))});return()=>{s(),r()}}}class ar extends a.Destroyable{constructor(e,t){super();{const i=()=>{const o=pe(e);e.setGlobalProperty(o)};i();const n=se(),r=[];n.forEach(o=>{const g=e[o+"Changed"];r.push(g)});const s=this.dv(a.createNextAnimateFrameEvent(...r));this.d(s.don(i))}this.d(e.propChanged.don(i=>{if(i.objId==="")try{Object.keys(i.props).forEach(n=>{const r=i.props[n]===null?void 0:i.props[n];e[n]=r})}catch(n){console.error("ueViewer propChanged:"+n)}})),this.dv(new a.ObjResettingWithEvent(e.statusUpdateIntervalChanged,i=>{if((e.statusUpdateInterval??.5)===0)return;const r=new a.Destroyable;return r.d(t.disposableOnUeEvent("statusUpdate",s=>{e.statusUpdateEvent.emit(s)})),r})),this.dv(new a.ObjResettingWithEvent(e.propChangedListeningChanged,()=>{if(!(e.propChangedListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("propChanged",r=>{e.propChanged.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.objectEventListeningChanged,()=>{if(!(e.objectEventListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("objectEvent",r=>{e.objectEvent.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.widgetEventListeningChanged,()=>{if(!(e.widgetEventListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("widgetEvent",r=>{e.widgetEvent.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.speechRecognitionListeningChanged,()=>{if(!(e.speechRecognitionListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("speechRecognition",r=>{e.speechRecognition.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.customMessageListeningChanged,()=>{if(!(e.customMessageListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("customMessage",r=>{e.customMessage.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.editingEventListeningChanged,()=>{if(!(e.editingEventListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("editingEvent",r=>{r.objectIDs=r.objectIDs.map(s=>s.split("_")[0]),e.editingEvent.emit(r)})),n}))}}class lr extends a.Destroyable{constructor(e,t,i){super();{const r=()=>{const c=pe(t);t.setGlobalProperty(c)};r();const s=se(),o=[];s.forEach(c=>{const w=t[c+"Changed"];o.push(w)});const g=this.dv(a.createNextAnimateFrameEvent(...o));this.d(g.don(r))}this.d(t.propChanged.don(r=>{if(r.objId==="")try{Object.keys(r.props).forEach(s=>{const o=r.props[s]===null?void 0:r.props[s];t[s]=o})}catch(s){console.error("ueViewer propChanged:"+s)}}));const n=document.createElement("div");n.style.width="100%",n.style.height="100%",n.style.position="absolute",n.style.overflow="hidden",n.style.top="0",n.style.left="0",n.style.zIndex="0",n.style.backgroundColor="rgba(255,0,0,0)",n.setAttribute("masker","大屏顶层div,用于模拟鼠标事件和控制UE鼠标事件是否生效"),e.appendChild(n),this.d(()=>{n&&e&&e.removeChild(n)});{const r=(c,w)=>{window.ue.esinput.setinterceptevent(w),c.preventDefault()},s=c=>{r(c,!1)},o=c=>{r(c,!0)},g=c=>{r(c,!1)};n.addEventListener("mouseenter",s),n.addEventListener("mouseleave",o),n.addEventListener("mousemove",g),this.d(()=>{n.removeEventListener("mouseenter",s),n.removeEventListener("mouseleave",o),n.removeEventListener("mousemove",g)})}t.useCustomInteraction=!1,this.dv(new u.ViewerCustomInteraction(t,n,void 0,!0)),this.dv(new a.ObjResettingWithEvent(t.statusUpdateIntervalChanged,r=>{if((t.statusUpdateInterval??.5)===0)return;const o=new a.Destroyable;return o.d(i.disposableOnUeEvent("statusUpdate",g=>{t.statusUpdateEvent.emit(g)})),o})),this.dv(new a.ObjResettingWithEvent(t.propChangedListeningChanged,()=>{if(!(t.propChangedListening??!0))return;const s=new a.Destroyable;return s.d(i.disposableOnUeEvent("propChanged",o=>{t.propChanged.emit(o)})),s})),this.dv(new a.ObjResettingWithEvent(t.objectEventListeningChanged,()=>{if(!(t.objectEventListening??!0))return;const s=new a.Destroyable;return s.d(i.disposableOnUeEvent("objectEvent",o=>{t.objectEvent.emit(o)})),s})),this.dv(new a.ObjResettingWithEvent(t.widgetEventListeningChanged,()=>{if(!(t.widgetEventListening??!0))return;const s=new a.Destroyable;return s.d(i.disposableOnUeEvent("widgetEvent",o=>{t.widgetEvent.emit(o)})),s})),this.dv(new a.ObjResettingWithEvent(t.speechRecognitionListeningChanged,()=>{if(!(t.speechRecognitionListening??!0))return;const s=new a.Destroyable;return s.d(i.disposableOnUeEvent("speechRecognition",o=>{t.speechRecognition.emit(o)})),s})),this.dv(new a.ObjResettingWithEvent(t.customMessageListeningChanged,()=>{if(!(t.customMessageListening??!0))return;const s=new a.Destroyable;return s.d(i.disposableOnUeEvent("customMessage",o=>{t.customMessage.emit(o)})),s})),this.dv(new a.ObjResettingWithEvent(t.editingEventListeningChanged,()=>{if(!(t.editingEventListening??!0))return;const s=new a.Destroyable;return s.d(i.disposableOnUeEvent("editingEvent",o=>{o.objectIDs=o.objectIDs.map(g=>g.split("_")[0]),t.editingEvent.emit(o)})),s}))}}class dr extends a.Destroyable{constructor(t,i,n){super();f(this,"_reconnectEvent",this.dv(new a.Event));const r=(g,c)=>g.hasOwnProperty(c);let s=0,o;if(this.d(()=>{o&&clearTimeout(o)}),window.ue&&window.ue.es)if(window.ue.esinput){n.setStatus("Creating"),console.log("存在(window.ue && window.ue.es && window.ue.esinput 需要适配新版ESWebView 鼠标穿透), 开始创建UeFalseCloudViewer..."),n.setStatusLog("开始创建本地视口...");const g=this.dv(new or(t,n));this.d(()=>n.viewer=void 0),n.viewer=g,n.setStatus("Created"),n.setStatusLog("本地视口创建成功!"),this.dv(new lr(t,n,g))}else n.setStatus("Error"),n.setStatusLog("请升级 ESWebView !");else if(r(i.options,"ws")||r(i.options,"uri")&&r(i.options,"app")){n.setStatus("Creating"),n.setStatusLog("开始创建云渲染视口...");let g;this.d(()=>{n.setStatus("Raw"),n.setStatusLog(""),t&&g&&t.removeChild(g)&&(g=void 0)});const c=this.dv(a.createProcessingFromAsyncFunc(async w=>{n.viewer&&!n.viewer.isDestroyed()&&n.viewer.destroy(),n.viewer=void 0,g&&t.removeChild(g)&&(g=void 0),g=document.createElement("div"),g.setAttribute("earthsdk3-ue","earthsdk3-ue-videoContainer"),g.style.cssText="position:relative; height: 100%;width:100%;",t.appendChild(g);let y,l,p;if(r(i.options,"ws")){const{ws:E,esmsg:I,uselnternalSignallingServer:F}=i.options;y=E,l=I,p=F??!1}if(r(i.options,"uri")&&r(i.options,"app")){const{offsetWidth:E,offsetHeight:I}=g;let{uri:F,app:R,token:T}=i.options;F.endsWith("/")||(F+="/");const W=T?`?essstoken=${T}`:"",fe=`/${R}/${E??1920}/${I??1080}`+W;console.log(`请求信令服务器: ${F}instance${fe}`);const hr=await w.promise(fetch(`${F}instance${fe}`,{method:"GET"})),X=await w.promise(hr.json());if(X&&X.status!=="ok"){n.setStatus("Error"),n.setStatusLog(`信令服务器请求失败 ${X.status}`),this._reconnectEvent.emit(void 0);return}else{console.log(`信令服务器请求成功! ${JSON.stringify(X,void 0," ")}`),await a.sleep(5e3);const{server:gr,esmsg:vr,instanceId:fr,useInternalSignallingServer:pr}=X;if(!fr){n.setStatus("Error"),n.setStatusLog("检查信令服务器版本,返回数据错误! "),console.log("信令服务器返回数据错误!不包含instanceId!请升级到 ESSS V3.0+ 版本!"),this._reconnectEvent.emit(void 0);return}y=gr,l=vr,p=pr??!1,n.esssResponse=X}}const h=this.dv(p?new jn(g,y,l,n):new Xn(g,y,l,n));this.d(()=>n.viewer=void 0),this.d(h.errorEvent.don(E=>{const I=`[${E}]:像素流连接错误!`;n.setStatus("Error"),n.setStatusLog(I),this._reconnectEvent.emit(h)})),await w.promise(new Promise(E=>this.d(h.readyEvent.donce(E)))),n.setStatus("Created"),n.setStatusLog("云渲染视口创建成功!"),s=0,o&&clearTimeout(o),o=void 0;const{offsetWidth:m,offsetHeight:C}=g;h.resize(m*window.devicePixelRatio,C*window.devicePixelRatio),n.viewer=h,this.d(()=>n.viewer=void 0),this.dv(new ar(n,h))}));c.start(),this.d(this._reconnectEvent.don(w=>{o===void 0&&(w&&!w.isDestroyed()&&w.destroy(),n.viewer&&!n.viewer.isDestroyed()&&n.viewer.destroy(),n.viewer=void 0,n.autoReconnect&&(n.setStatus("Reconnecting"),n.setStatusLog("正在尝试重新连接..."),s=s+5e3>3e4?3e4:s+5e3,console.warn(`间隔:${s/1e3}s,正在尝试重新连接...`),o=window.setTimeout(()=>{c.restart()},s)))})),this.d(c.errorEvent.don(w=>{n.setStatus("Error"),n.setStatusLog("云渲染视口创建失败!"),console.warn("云渲染视口创建失败!",w),this._reconnectEvent.emit(void 0)}))}else if(r(i.options,"project")){const g=i,c=g.options.project,w=g.options.baseUrl;n.setStatus("Creating"),n.setStatusLog("下载编译中...");const y=this.dv(new rr(t,c,w,n));n.viewer=y,this.d(()=>n.viewer=void 0)}else n.setStatus("Error"),n.setStatusLog("视口创建失败!"),console.warn("视口创建失败: 参数错误!")}}const _=class _ extends u.ESViewer{constructor(t){super(t);f(this,"_viewer",this.dv(a.react(void 0)));f(this,"_esssResponse");f(this,"_speechRecognition",this.dv(new a.Event));f(this,"_propChanged",this.dv(new a.Event));f(this,"_objectEvent",this.dv(new a.Event));f(this,"_widgetEvent",this.dv(new a.Event));f(this,"_customMessage",this.dv(new a.Event));f(this,"_statusUpdateEvent",this.dv(new a.Event));f(this,"_statusUpdateEventdon",(()=>{this.d(this.statusUpdateEvent.don(t=>{this._statusInfo.fps=t.FPS??0,this._statusInfo.length=t.length??0,this._statusInfo.position=t.position??[0,0,0],this._statusInfo.rotation=t.rotation??[0,0,0]}))})());if(t.type!=="ESUeViewer")throw new Error("option.type must be ESUeViewer");const i=t;this.d(this._viewer.changed.don(()=>{this.viewerChanged.emit(this.viewer)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new dr(this.subContainer,i,this)}))}get defaultProps(){return _.createDefaultProps()}set viewer(t){this._viewer.value=t}get viewer(){return this._viewer.value}get esssResponse(){return this._esssResponse}set esssResponse(t){this._esssResponse=t}get speechRecognition(){return this._speechRecognition}get propChanged(){return this._propChanged}get objectEvent(){return this._objectEvent}get widgetEvent(){return this._widgetEvent}get customMessage(){return this._customMessage}get statusUpdateEvent(){return this._statusUpdateEvent}async uePositionToLonLatAlt(t){if(!this.viewer){console.warn("UEPositionToLonLatAlt: viewer is undefined");return}return await rn(this.viewer,t)}async changeNavigationMode(t){if(!this.viewer){console.warn("ChangeNavigationMode: viewer is undefined");return}const i=await M(this.viewer,t);return i&&!i.error&&(this._navigationMode.value=t.mode),i}async resetWithCurrentCamera(t){if(!this.viewer){console.warn("resetWithCurrentCamera: viewer is undefined");return}return await ye(this.viewer,t)}async getAllSocketNamesByActorTag(t){if(!this.viewer){console.warn("GetAllSocketNamesByActorTag: viewer is undefined");return}return await sn(this.viewer,t)}async getBoundSphere(t){if(!this.viewer){console.warn("getBoundSphere: viewer is undefined");return}return await an(this.viewer,t)}async getBoundSphereWithChildren(t){if(!this.viewer){console.warn("getBoundSphereWithChildren: viewer is undefined");return}return await ln(this.viewer,t)}async getStrokeMaterialParamInfo(t){if(!this.viewer){console.warn("GetStrokeMaterialParamInfo: viewer is undefined");return}return await dn(this.viewer,t)}async getFillMaterialParamInfo(t){if(!this.viewer){console.warn("getFillMaterialParamInfo: viewer is undefined");return}return await cn(this.viewer,t)}async getGlobalProperty(t){if(!this.viewer){console.warn("getGlobalProperty: viewer is undefined");return}return await un(this.viewer,t)}async getObjectByInfo(t){if(!this.viewer){console.warn("GetObjectByInfo: viewer is undefined");return}return await hn(this.viewer,t)}async defaultCameraFlyIn(t=1){if(!this.viewer){console.warn("DefaultCameraFlyIn: viewer is undefined");return}return await _i(this.viewer,t)}async startVoice(){if(!this.viewer){console.warn("startVoice:viewer is undefined");return}return await Ni(this.viewer)}async stopVoice(){if(!this.viewer){console.warn("startVoice:viewer is undefined");return}return await zi(this.viewer)}async mountPakFiles(t){if(!this.viewer){console.warn("mountPakFiles:viewer is undefined");return}return await Hi(this.viewer,t)}async generateMemReport(){if(!this.viewer){console.warn("generateMemReport:viewer is undefined");return}return await Gi(this.viewer)}async quit(){if(!this.viewer){console.warn("Quit: viewer is undefined");return}return await Yi(this.viewer)}async bindActorByTag(t,i){if(!this.viewer){console.warn("BindActorByTag: viewer is undefined");return}return await gn(this.viewer,t,i)}async restoreOriginalScene(){if(!this.viewer){console.warn("RestoreOriginalScene: viewer is undefined");return}return await vn(this.viewer)}async unBindActorByID(t){if(!this.viewer){console.warn("UnBindActorByID: viewer is undefined");return}return await fn(this.viewer,t)}async unBindActorByTag(t){if(!this.viewer){console.warn("UnBindActorByTag: viewer is undefined");return}return await pn(this.viewer,t)}async createActorByClass(t,i){if(!this.viewer){console.warn("CreateActorByClass: viewer is undefined");return}return await wn(this.viewer,t,i)}async bind3DTilesetByTag(t,i){if(!this.viewer){console.warn("Bind3DTilesetByTag: viewer is undefined");return}return await yn(this.viewer,t,i)}async unBind3DTilesetByTag(t){if(!this.viewer){console.warn("UnBind3DTilesetByTag: viewer is undefined");return}return await mn(this.viewer,t)}async unBind3DTilesetById(t){if(!this.viewer){console.warn("UnBind3DTilesetById: viewer is undefined");return}return await Cn(this.viewer,t)}async bindImageryByTag(t,i,n){if(!this.viewer){console.warn("BindImageryByTag: viewer is undefined");return}return await En(this.viewer,t,i,n)}async unBindImageryByTag(t,i){if(!this.viewer){console.warn("UnBindImageryByTag: viewer is undefined");return}return await Fn(this.viewer,t,i)}async unBindImageryById(t){if(!this.viewer){console.warn("UnBindImageryById: viewer is undefined");return}return await Sn(this.viewer,t)}async getIdByComponentNameAndHitItem(t,i,n){if(!this.viewer){console.warn("GetIdByComponentNameAndHitItem: viewer is undefined");return}return await In(this.viewer,t,i,n)}async getCameraRelativeHeight(t="ECC_Visibility"){if(!this.viewer){console.warn("GetCameraRelativeHeight: viewer is undefined");return}return await Tn(this.viewer,t)}async saveStringToFile(t,i,n){if(!this.viewer){console.warn("SaveStringToFile: viewer is undefined");return}return await Rn(this.viewer,t,i,n)}async highlightActorByTag(t,i=!0){if(!this.viewer){console.warn("HighlightActorByTag: viewer is undefined");return}return await Dn(this.viewer,t,i)}async sendCustomMessage(t){if(!this.viewer){console.warn("SendCustomMessage: viewer is undefined");return}return await kn(this.viewer,t)}async getStatus(){if(!this.viewer){console.warn("GetStatus:viewer is undefined");return}return await Ln(this.viewer)}async getTilesetMaterialIDList(){if(!this.viewer){console.warn("GetTilesetMaterialIDList:viewer is undefined");return}return await An(this.viewer)}async pick(t,i,n){if(!this.viewer)return;let r=t;if(t&&window.ue&&this.container){const[s,o]=t,{left:g,top:c}=this.container.getBoundingClientRect();r=[g+s,c+o]}return await bi(this.viewer,r,i,n)}async pickPosition(t){if(!this.viewer)return;let i=t;if(t&&window.ue&&this.container){const[n,r]=t,{left:s,top:o}=this.container.getBoundingClientRect();i=[s+n,o+r]}return await xi(this.viewer,i)}async flyIn(t,i=[0,0,0],n=1,r="default"){if(!this.viewer)return;const s=await Z(this.viewer,void 0,t,i,n,r);if(s)return s.endType===0&&console.warn(`flyTo:flyTo is end! endType:${s.endType}`),s.endType===1&&console.warn(`flyTo:飞行中断! endType:${s.endType}`),s}async flyTo(t,i,n="default"){if(!this.viewer)return;const r=await B(this.viewer,void 0,void 0,t,i,n);if(r)return r.endType===0&&console.warn(`flyTo:flyTo is end! endType:${r.endType}`),r.endType===1&&console.warn(`flyTo:飞行中断! endType:${r.endType}`),r}flyToBoundingSphere(t,i,n=1){const r=[[t[0],t[1],0],[t[0],t[3],0],[t[2],t[3],0],[t[2],t[1],0]],s=u.getGeoBoundingSphereFromPositions(r);if(!s)return;const{center:o,radius:g}=s,c={distance:i??g,heading:0,pitch:-90,flyDuration:n,hDelta:0,pDelta:0};this.flyTo(c,o)}getCurrentCameraInfo(){const{position:t,rotation:i}=this._statusInfo;return{position:t,rotation:i}}getLengthInPixel(){return this._statusInfo.length}async changeToWalk(t,i=4.2){if(!this.viewer)return;const n={mode:"Walk",position:t,jumpZVelocity:i},r=await M(this.viewer,n);return r&&!r.error&&(this._navigationMode.value=n.mode),r}async changeToMap(){if(!this.viewer)return;const t={mode:"Map"},i=await M(this.viewer,t);return i&&!i.error&&(this._navigationMode.value=t.mode),i}async changeToRotateGlobe(t=38,i=1e7,n=60){if(!this.viewer)return;const r={mode:"RotateGlobe",latitude:t,height:i,cycleTime:n},s=await M(this.viewer,r);return s&&!s.error&&(this._navigationMode.value=r.mode),s}async changeToLine(t,i=10,n=10,r=!0,s=10,o="auto"){if(!this.viewer)return;const g={mode:"Line",geoLineStringId:t,speed:i,heightOffset:n,loop:r,turnRateDPS:s,lineMode:o},c=await M(this.viewer,g);return c&&!c.error&&(this._navigationMode.value=g.mode),c}async changeToUserDefined(t){if(!this.viewer)return;const i={mode:"UserDefined",userDefinedPawn:t},n=await M(this.viewer,i);return n&&!n.error&&(this._navigationMode.value=i.mode),n}async changeToRotatePoint(t,i=5e4,n=60,r=0,s=-30){if(!this.viewer)return;const o={mode:"RotatePoint",position:t,distance:i,orbitPeriod:n,heading:r,pitch:s},g=await M(this.viewer,o);return g&&!g.error&&(this._navigationMode.value=o.mode),g}async changeToFollow(t,i=0,n=0,r=-30,s=!0){if(!this.viewer)return;const o={mode:"Follow",objectId:t,distance:i,heading:n,pitch:r,relativeRotation:s},g=await M(this.viewer,o);return g&&!g.error&&(this._navigationMode.value=o.mode),g}getFPS(){return this._statusInfo.fps}async getVersion(){const t=window.g_XE3CopyRights??{};if(!this.viewer)return t;const i=await on(this.viewer);return t.esforue=i,t}async getHeightByLonLat(t,i,n="ECC_Visibility"){if(!this.viewer)return null;const r=await Oi(this.viewer,t,i,n);return r&&r.height!==void 0?r.height:null}async getHeightsByLonLats(t,i="ECC_Visibility"){return this.viewer?await ji(this.viewer,t,i):void 0}async capture(t=64,i=64){return this.viewer?await tn(this.viewer,t,i):void 0}async partialCapture(t,i=[64,64]){if(!this.viewer){console.warn("partialCapture:viewer is undefined");return}return await en(this.viewer,t,i)}async lonLatAltToScreenPosition(t){if(!this.viewer)return;const i=await nn(this.viewer,t);return i&&[i.X,i.Y]}async setGlobalProperty(t){if(this.viewer)return await Qi(this.viewer,t)}async startEditing(t,i,n){n=Object.assign({useKeyToSwitch:!0,callSource:"outer"},n);const r=t.combinationClass?t.getMainClass():t;if(!r||!this.viewer||i==null)return;const s=Array.isArray(i)?[...i]:[i];return r.editingID=`${n.callSource}_${a.createGuid()}`,await Pn(this.viewer,r.id,r.editingID,s,n.useKeyToSwitch)}async stopEditing(){if(this.viewer)return await Un(this.viewer)}async moveObjects(t){if(!this.viewer)return;const i=[],n=a.createGuid();for(let r=0;r<t.length;r++){const s=t[r],o=s.combinationClass?s.getMainClass():s;o.editingID=n,o&&i.push(o.id)}if(i.length!==0)return await Mn(this.viewer,i,n)}getProperties(){return[...super.getProperties()]}};f(_,"type",_.register("ESUeViewer",_)),f(_,"defaults",{...Hn});let A=_;(d=>{d.createDefaultProps=()=>({...u.ESViewer.createDefaultProps(),...Wi(),resolutionScale:1,autoReconnect:!1,propChangedListening:void 0,objectEventListening:void 0,widgetEventListening:void 0,speechRecognitionListening:void 0,customMessageListening:void 0})})(A||(A={})),a.extendClassProps(A.prototype,A.createDefaultProps);class $ extends u.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(i&&(e.combinationClass||this.d(this.createdEvent.don(()=>{const n=this.constructor.propValFuncs,r=e.defaultProps,s=Object.keys(r).filter(l=>n[l]!==null);s.push(...this.constructor.forceUeUpdateProps);const o=e.constructor.defaults,g={val:{}},c=[];for(let l of s){const p=l+"Changed",h=e[p];c.push(h);const m=n[l];if(m===null)throw console.error("vf === null error"),new Error("vf === null error");const C=()=>{const E=e[l]??o[l];let I=m?m(E,this,t,e):E;if(I===void 0){console.warn(`UE自动更新的属性,不应该为undefined! 属性名:${l} 对象名:${e.name} 对象id: ${e.id}`);return}g.val[l]=I};C(),this.d(h.don(C))}const w=()=>{i.callUeFunc({f:"update",p:{id:e.id,...g.val}}),g.val={}},y=this.dv(a.createNextAnimateFrameEvent(...c));this.d(y.don(w)),this.d(e.createdEvent.don(w)),this.d(e.flushEvent.don(()=>y.flush()))})),!e.combinationClass)){let n=!1;this.d(()=>{n&&we(i,e.id)}),i.callUeFunc({f:"create",p:{type:e.typeName,id:e.id}}).then(()=>{n=!0,e.createdEvent.emit()}).catch(r=>console.error(r))}}}f($,"propValFuncs",{ref:null,devTags:null,extras:null,execOnceFuncStr:null,updateFuncStr:null,toDestroyFuncStr:null}),f($,"forceUeUpdateProps",[]);class k extends ${constructor(e,t){super(e,t);const i=t.viewer;i&&(this.d(e.flyToEvent.don(n=>{B(i,e.id,n)})),this.d(e.flyInEvent.don(n=>{var r,s;Z(i,e.id,(r=e.flyInParam)==null?void 0:r.position,(s=e.flyInParam)==null?void 0:s.rotation,n??1)})),this.d(e.calcFlyToParamEvent.don(()=>{K(i,e.id)})),this.d(e.calcFlyInParamEvent.don(()=>{const n=t.getCurrentCameraInfo();if(!n)return;const{position:r,rotation:s}=n;e.flyInParam={position:r,rotation:s,flyDuration:1}})),this.d(t.propChanged.don(n=>{n.objId===e.id&&Object.keys(n.props).forEach(r=>{const s=n.props[r]===null?void 0:n.props[r];e[r]=s})})))}}class S extends k{constructor(e,t){super(e,t);const i=t.viewer;if(!i)return;const n=()=>{e.editing||i.callUeFunc({f:"update",p:{id:e.id,position:e.position,rotation:e.rotation}})},r=this.dv(a.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.editingChanged));this.d(r.don(()=>{setTimeout(n,0)})),this.d(e.smoothMoveEvent.don((g,c)=>{ce(i,e.id,g,c)})),this.d(e.smoothMoveWithRotationEvent.don((g,c,w)=>{ae(i,e.id,g,c,w)})),this.d(e.smoothMoveOnGroundEvent.don((g,c,w,y)=>{le(i,e.id,g,c,y,w)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((g,c,w,y,l)=>{de(i,e.id,g,c,w,y,l)})),this.d(e.smoothMoveKeepPitchEvent.don(async(g,c)=>{const w=await i.callUeFunc({f:"SmoothMoveKeepPitch",p:{id:e.id,Destination:g,Time:c}});w.error&&console.error("SmoothMoveKeepPitch:",w.error)})),this.d(e.automaticLandingEvent.don(g=>{const c=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(w=>{w!==null&&(e.position=[...c,w],e.collision=g)})}));const s=async(g,c,w,y)=>{const{viewer:l}=g;if(!l){console.error("SmoothMoveRelatively: ueViewer.viewer is undefined");return}const p=await l.callUeFunc({f:"SmoothMoveRelatively",p:{id:c,RelativePosition:w,Time:y}});return p.error&&console.error("SmoothMoveRelatively:",p.error),p};this.d(e.smoothMoveRelativelyEvent.don((g,c)=>{s(t,e.id,g,c)}));const o=async(g,c,w,y,l)=>{const{viewer:p}=g;if(!p){console.error("SmoothMoveRelativelyWithRotation: ueViewer.viewer is undefined");return}const h=await p.callUeFunc({f:"SmoothMoveRelativelyWithRotation",p:{id:c,RelativePosition:w,NewRotation:y,Time:l}});return h.error&&console.error("SmoothMoveRelativelyWithRotation:",h.error),h};this.d(e.smoothMoveRelativelyWithRotationEvent.don((g,c,w)=>{o(t,e.id,g,c,w)}))}}class L extends k{constructor(e,t){super(e,t);const i=t.viewer;if(!i)return;const n=()=>{e.editing||i.callUeFunc({f:"update",p:{id:e.id,points:e.points}})},r=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.editingChanged));this.d(r.don(()=>{setTimeout(n,0)}))}}f(L,"propValFuncs",{...k.propValFuncs,pointStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})}),strokeStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})}),fillStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})})});class U extends S{constructor(e,t){super(e,t),t.viewer&&this.d(t.widgetEvent.don(n=>{if(n.objId!==e.id)return;const{type:r,add:s}=n;e.widgetEvent.emit({type:r,add:s})}))}}class Ce extends S{constructor(e,t){super(e,t),t.viewer}}f(Ce,"propValFuncs",{...S.propValFuncs,pointStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})}),strokeStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})}),fillStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})})});class ue extends Ce{constructor(e,t){super(e,t),t.viewer}}const $n=d=>{switch(d){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"没搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是3dTileset,无法绑定";default:return"未知错误"}},Y=class Y extends u.EngineObject{constructor(t,i){super(t,i);f(this,"_styleColor",this.dv(a.react([])));f(this,"_styleVisable",this.dv(a.react([])));const n=i.viewer;if(!n){console.warn("UeES3DTileset: viewer is undefined!");return}let r,s;const o=async()=>{!r&&!s||await n.callUeFunc({f:"update",p:{id:t.id,url:t.url,show:t.show,collision:t.collision,allowPicking:t.allowPicking,flyToParam:t.flyToParam??u.ESVisualObject.defaults.flyToParam,flyInParam:t.flyInParam??u.ESVisualObject.defaults.flyInParam,highlightID:t.highlightID,highlightColor:t.highlightColor,highlight:t.highlight,materialMode:t.materialMode,maximumScreenSpaceError:t.maximumScreenSpaceError,colorMode:Reflect.has(t,"colorMode")?t.colorMode:void 0,offset:t.offset,rotation:t.rotation,cacheBytes:t.cacheBytes,colorBlendMode:t.colorBlendMode,materialOverrideMap:t.materialOverrideMap}})},g=this.dv(a.createNextAnimateFrameEvent(t.urlChanged,t.showChanged,t.flyToParamChanged,t.flyInParamChanged,t.collisionChanged,t.allowPickingChanged,t.highlightIDChanged,t.highlightColorChanged,t.highlightChanged,t.materialModeChanged,t.maximumScreenSpaceErrorChanged,t.offsetChanged,t.rotationChanged,t.cacheBytesChanged,t.colorBlendModeChanged,t.materialOverrideMapChanged));o(),this.d(g.don(o)),Reflect.has(t,"colorMode")&&this.d(t.colorModeChanged.don(()=>o()));const c=this.dv(a.react(void 0));{const y=this.dv(a.createNextAnimateFrameEvent(t.actorTagChanged,t.urlChanged)),l=()=>{t.actorTag?c.value={type:"ActorTag",actorTag:t.actorTag}:t.url?c.value={type:"CreatedUrl",url:t.url}:c.value=void 0,t.editing=!1};l(),this.d(y.don(l))}const w=async()=>{const{id:y}=t;if(r!==void 0){r=void 0;try{const l=await i.unBind3DTilesetById(y);if(!l)return;if(l.error!==""){console.warn(`UeES3DTileset UnBind3DTilesetById: ${l.error}`);return}}catch(l){console.warn(`UeES3DTileset UnBind3DTilesetById: ${l}`);return}}if(s!==void 0){s=void 0;try{const l=await n.callUeFunc({f:"destroy",p:{id:y}});if(!l)return;if(l.error!==""){console.warn(`UeES3DTileset Destroy: ${l.error}`);return}}catch(l){console.warn(`UeES3DTileset Destroy: ${l}`);return}}};this.d(()=>{w()});{const y=this.dv(a.createProcessingFromAsyncFunc(async p=>{if(c.value===void 0){await p.promise(w());return}if(c.value.type==="ActorTag"){const{actorTag:h}=c.value;if(r!==h&&await p.promise(w()),r!==void 0||h===void 0)return;try{r=h;const m=await p.promise(i.bind3DTilesetByTag(t.id,h));if(!m)return;if(m.error!==""){console.warn(`UeES3DTileset Bind3DTilesetByTag: ${m.error}`);return}if(m.re.type!==0)if(m.re.type===1)console.warn(`UeES3DTileset Bind3DTilesetByTag: ${$n(m.re.type)}`);else{console.warn(`UeES3DTileset Bind3DTilesetByTag: ${$n(m.re.type)}`);return}}catch(m){console.warn(`UeES3DTileset Bind3DTilesetByTag: ${m}`);return}}else if(c.value.type==="CreatedUrl"){const{url:h}=c.value;if(h!==s&&await w(),s!==void 0||h===void 0)return;try{s=h;const m=await p.promise(n.callUeFunc({f:"create",p:{type:t.typeName,id:t.id}}));if(!m)return;if(m.error!==""){console.warn(`UeES3DTileset create: ${m.error}`);return}}catch(m){console.warn(`UeES3DTileset create: ${m}`);return}}await p.promise(o())})),l=async()=>{y.restart()};l(),this.d(c.changed.don(l))}this.d(t.refreshTilesetEvent.don(()=>{$i(n,t.id)})),this.d(t.flyToEvent.don(async(y,l)=>{if(!r&&!s)return;const p=await B(n,t.id,y);let h="over";p===void 0?h="error":p.endType===0?h="over":p.endType===1&&(h="cancelled"),t.flyOverEvent.emit(l,h,i)})),this.d(t.calcFlyToParamEvent.don(()=>{!r&&!s||K(n,t.id)})),this.d(t.calcFlyInParamEvent.don(async()=>{if(!r&&!s||!i.actived)return;const y=await i.getCurrentCameraInfo();if(!y)return;const{position:l,rotation:p}=y;t.flyInParam={position:l,rotation:p,flyDuration:1}})),this.d(i.propChanged.don(y=>{!r&&!s||y.objId===t.id&&Object.keys(y.props).forEach(l=>{const p=y.props[l]===null?void 0:y.props[l];t[l]=p})})),this.d(i.objectEvent.don(y=>{!r&&!s||y.id!==t.id||y.type!=="3DTilesetReady"||t.tilesetReady.emit(y.p)}));{const y=async(m,C)=>{if(!r&&!s)return;const E=await n.callUeFunc({f:"SetFeatureColor",p:{id:t.id,featureName:m,json:C}});if(E&&E.error!==""){console.warn(`UeES3DTileset SetFeatureColor: ${E.error}`);return}},l=async(m,C)=>{if(!r&&!s)return;const E=await n.callUeFunc({f:"SetFeatureVisable",p:{id:t.id,featureName:m,json:C}});if(E&&E.error!==""){console.warn(`UeES3DTileset SetFeatureVisable: ${E.error}`);return}},p=async()=>{if(!r&&!s)return;const m=await n.callUeFunc({f:"ResetFeatureStyle",p:{id:t.id}});if(m&&m.error!==""){console.warn(`UeES3DTileset ResetFeatureStyle: ${m.error}`);return}},h=async m=>{if(!r&&!s)return;const C=await n.callUeFunc({f:"SetFeatureStyle",p:{id:t.id,json:m}});if(C&&C.error!==""){console.warn(`UeES3DTileset SetFeatureStyle: ${C.error}`);return}};this.d(t.setFeatureColorEvent.don((m,C)=>{const E=[...this.styleColor,...C];this.styleColor=[...E],y(m,E)})),this.d(t.setFeatureVisableEvent.don((m,C)=>{const E=[...this.styleVisable,...C];this.styleVisable=[...E],l(m,E)})),this.d(t.resetFeatureStyleEvent.don(()=>{p(),this.styleColor=[],this.styleVisable=[]})),this.d(t.setFeatureStyleEvent.don(m=>{h(m)}))}{const y=async()=>{if(!r&&!s){t._featureTableResultEvent.emit(void 0);return}try{const l=await n.callUeFunc({f:"GetFeatureTable",p:{id:t.id}});l.error!==""&&console.warn(`UeES3DTileset GetFeatureTable: ${l.error}`),t._featureTableResultEvent.emit(l.re.table)}catch(l){console.warn(`UeES3DTileset GetFeatureTable: ${l}`),t._featureTableResultEvent.emit(void 0)}};this.d(t.getFeatureTableEvent.don(()=>{y()}))}{const y=async()=>{if(!r&&!s){t.getMaterialNameListEvent.emit(void 0);return}try{const l=await n.callUeFunc({f:"GetMaterialNameList",p:{id:t.id}});l.error!==""&&console.warn(`UeES3DTileset GetMaterialNameList: ${l.error}`),t.getMaterialNameListEvent.emit(l.re.materialNameList)}catch(l){console.warn(`UeES3DTileset GetMaterialNameList: ${l}`),t.getMaterialNameListEvent.emit(void 0)}};this.ad(t.getMaterialNameListEvent.don(l=>{l=="start"&&y()}))}}get styleColor(){return this._styleColor.value}set styleColor(t){this._styleColor.value=t}get styleVisable(){return this._styleVisable.value}set styleVisable(t){this._styleVisable.value=t}};f(Y,"type",Y.register("ESUeViewer",u.ES3DTileset.type,Y));let he=Y;const _n=d=>{switch(d){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"没搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag对应的Actor是地形,无法绑定";case 4:return"没搜索到ComponentTag,无法绑定";default:return"未知错误"}},b=class b extends u.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}let n,r;const s=this.dv(a.react(void 0)),o=this.ad(a.reactJson(""));{const y=()=>{if(typeof e.url=="string")o.value=u.ESSceneObject.context.getStrFromEnv(e.url);else{const l=e.url;l.url=u.ESSceneObject.context.getStrFromEnv(l.url),o.value=l}};y(),this.ad(e.urlChanged.don(y))}const g=async()=>{!n&&!r||await i.callUeFunc({f:"update",p:{id:e.id,show:e.show??!0,rectangle:e.rectangle??[-180,-90,180,90],collision:e.collision??!0,allowPicking:e.allowPicking??!1,flyToParam:e.flyToParam??u.ESVisualObject.defaults.flyToParam,flyInParam:e.flyInParam??u.ESVisualObject.defaults.flyInParam,url:o.value??"",zIndex:e.zIndex??0,maximumLevel:e.maximumLevel??u.ESImageryLayer.defaults.maximumLevel,minimumLevel:e.minimumLevel??u.ESImageryLayer.defaults.minimumLevel,options:e.options??u.ESImageryLayer.defaults.options,targetID:e.targetID??u.ESImageryLayer.defaults.targetID,opacity:e.opacity??u.ESImageryLayer.defaults.opacity}})},c=this.dv(a.createNextAnimateFrameEvent(e.showChanged,o.changed,e.flyToParamChanged,e.flyInParamChanged,e.zIndexChanged,e.collisionChanged,e.allowPickingChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.rectangleChanged,e.optionsChanged,e.targetIDChanged,e.opacityChanged));this.d(c.don(g));const w=async()=>{const{id:y}=e;if(n!==void 0){n=void 0;try{const l=await t.unBindImageryById(y);if(!l)return;if(l.error!==""){console.warn(`UeESImageryLayer UnImageryByID: ${l.error}`);return}}catch(l){console.warn(`UeESImageryLayer UnImageryByID promise: ${l}`);return}}if(r!==void 0){r=void 0;try{const l=await i.callUeFunc({f:"destroy",p:{id:y,test:"UeESImageryLayer"}});if(!l)return;if(l.error!==""){console.warn(`UeESImageryLayer Destroy: ${l.error}`);return}}catch(l){console.warn(`UeESImageryLayer Destroy promise: ${l}`);return}}};this.d(()=>{w()});{const y=this.dv(a.createProcessingFromAsyncFunc(async p=>{if(s.value===void 0){await p.promise(w());return}if(s.value.type==="ActorTag"){const{actorTag:h,componentTag:m}=s.value;if(n!==h&&await p.promise(w()),n!==void 0||h===void 0)return;try{n=h;const C=await p.promise(t.bindImageryByTag(e.id,h,m));if(!C)return;if(C.error!==""){console.warn(`ESImageryLayer BindImageryByTag: ${C.error}`);return}if(C.re.type!==0)if(C.re.type===1)console.warn(`ESImageryLayer BindImageryByTag: ${_n(C.re.type)}`);else{console.warn(`ESImageryLayer BindImageryByTag: ${_n(C.re.type)}`);return}}catch(C){console.warn(`ESImageryLayer BindImageryByTag promise: ${C}`);return}}else if(s.value.type==="CreatedUrl"){const{url:h}=s.value;if(h!==r&&await p.promise(w()),r!==void 0||h===void 0)return;try{r=h;const m=await p.promise(i.callUeFunc({f:"create",p:{type:"ESImageryLayer",id:e.id}}));if(!m)return;if(m.error!==""){console.warn(`ESImageryLayer create: ${m.error}`);return}}catch{console.warn("ESImageryLayer create: create promise error");return}}await p.promise(g())})),l=async()=>{y.restart()};l(),this.d(s.changed.don(l))}{const y=this.dv(a.createNextAnimateFrameEvent(e.actorTagChanged,o.changed,e.componentTagChanged)),l=()=>{e.actorTag&&e.componentTag?s.value={type:"ActorTag",actorTag:e.actorTag,componentTag:e.componentTag}:o.value?s.value={type:"CreatedUrl",url:o.value}:s.value=void 0};l(),this.d(y.don(l))}this.d(e.flyToEvent.don(async(y,l)=>{if(!n&&!r)return;const p=await B(i,e.id,y);let h="over";p===void 0?h="error":p.endType===0?h="over":p.endType===1&&(h="cancelled"),e.flyOverEvent.emit(l,h,t)})),this.d(e.flyInEvent.don(async(y,l)=>{var m,C;if(!n&&!r)return;const p=await Z(i,e.id,(m=e.flyInParam)==null?void 0:m.position,(C=e.flyInParam)==null?void 0:C.rotation,y??1);let h="over";p===void 0?h="error":p.endType===0?h="over":p.endType===1&&(h="cancelled"),e.flyOverEvent.emit(l,h,t)})),this.d(e.calcFlyToParamEvent.don(()=>{!n&&!r||K(i,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const y=await t.getCurrentCameraInfo();if(!y)return;const{position:l,rotation:p}=y;e.flyInParam={position:l,rotation:p,flyDuration:1}})),this.d(t.propChanged.don(y=>{!n&&!r||y.objId===e.id&&Object.keys(y.props).forEach(l=>{const p=y.props[l]===null?void 0:y.props[l];e[l]=p})}))}};f(b,"type",b.register("ESUeViewer",u.ESImageryLayer.type,b));let Ee=b;const N=class N extends k{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(N,"type",N.register("ESUeViewer",u.ESTerrainLayer.type,N)),f(N,"forceUeUpdateProps",[...k.forceUeUpdateProps,"url"]),f(N,"propValFuncs",{...k.propValFuncs,url:e=>typeof e=="string"?u.ESSceneObject.context.getStrFromEnv(e):(e.url=u.ESSceneObject.context.getStrFromEnv(e.url),e),czmMaxzoom:null,czmMinzoom:null});let Fe=N;const x=class x extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(x,"type",x.register("ESUeViewer",u.ESAlarm.type,x));let Se=x;const O=class O extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(O,"type",O.register("ESUeViewer",u.ESApertureEffect.type,O));let Ie=O;const j=class j extends L{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(j,"type",j.register("ESUeViewer",u.ESGeoPolygon.type,j));let P=j;const tt=class tt extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let s=u.ESAreaMeasurement.defaults.fillStyle;try{s={...e.fillStyle??u.ESAreaMeasurement.defaults.fillStyle}}catch(o){console.error("ESAreaMeasurement fillStyle 属性类型错误!",o),s={...u.ESAreaMeasurement.defaults.fillStyle}}s.materialParams=JSON.stringify(s.materialParams),i.callUeFunc({f:"update",p:{id:e.id,stroked:e.stroked??u.ESAreaMeasurement.defaults.stroked,fillStyle:s,filled:e.filled??u.ESAreaMeasurement.defaults.filled}}),console.log(s)},r=this.dv(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.strokedChanged,e.filledChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};f(tt,"type",tt.register("ESUeViewer",u.ESAreaMeasurement.type,tt));let Te=tt;const et=class et extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(et,"type",et.register("ESUeViewer",u.ESBlastParticleSystem.type,et));let Re=et;const it=class it extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};f(it,"type",it.register("ESUeViewer",u.ESBoxClipping.type,it));let De=it;const nt=class nt extends S{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.dispose(e.flyInEvent.don((n,r,s="default")=>{const{id:o,duration:g,position:c,rotation:w}=e;Z(i,o,c,w,g??n,s)})),this.dispose(e.resetWithCurrentCameraEvent.don(()=>{ye(i,e.id)})),this.dispose(e.captureEvent.don((n,r)=>{t.capture(n,r).then(o=>{o&&(e.thumbnail=o)})}))}};f(nt,"type",nt.register("ESUeViewer",u.ESCameraView.type,nt));let ke=nt;const rt=class rt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(rt,"type",rt.register("ESUeViewer",u.ESCameraVisibleRange.type,rt));let Le=rt;const st=class st extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(st,"type",st.register("ESUeViewer",u.ESCar.type,st));let Pe=st;const ot=class ot extends L{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let s=u.ESClassification.defaults.fillStyle;try{s={...e.fillStyle??u.ESClassification.defaults.fillStyle}}catch(o){console.error("ESClassification fillStyle 属性类型错误!",o),s={...u.ESClassification.defaults.fillStyle}}s.materialParams=JSON.stringify(s.materialParams),i.callUeFunc({f:"update",p:{id:e.id,filled:e.filled??u.ESClassification.defaults.filled,fillStyle:s}})},r=this.dv(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};f(ot,"type",ot.register("ESUeViewer",u.ESClassification.type,ot));let Ue=ot;const at=class at extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};f(at,"type",at.register("ESUeViewer",u.ESClippingPlane.type,at));let Me=at;const lt=class lt extends S{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=this.ad(a.reactJson(""));{const o=()=>{if(typeof e.url=="string")n.value=u.ESSceneObject.context.getStrFromEnv(e.url??u.ESDataMesh.defaults.url);else{const g=e.url;g.url=u.ESSceneObject.context.getStrFromEnv(g.url??u.ESDataMesh.defaults.url),n.value=g}};o(),this.ad(e.urlChanged.don(o))}const r=()=>{const o=e.colorStops??u.ESDataMesh.defaults.colorStops;i.callUeFunc({f:"update",p:{id:e.id,url:n.value??u.ESDataMesh.defaults.url,currentTime:e.currentTime??u.ESDataMesh.defaults.currentTime,minPropValue:e.minPropValue??u.ESDataMesh.defaults.minPropValue,maxPropValue:e.maxPropValue??u.ESDataMesh.defaults.maxPropValue,colorStops:JSON.stringify(o)}})},s=this.dv(a.createNextAnimateFrameEvent(n.changed,e.currentTimeChanged,e.minPropValueChanged,e.maxPropValueChanged,e.colorStopsChanged));this.d(s.don(r)),this.d(e.createdEvent.don(r))}};f(lt,"type",lt.register("ESUeViewer",u.ESDataMesh.type,lt));let Ae=lt;const dt=class dt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(dt,"type",dt.register("ESUeViewer",u.ESDatasmithRuntimeModel.type,dt));let We=dt;const ct=class ct extends L{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ct,"type",ct.register("ESUeViewer",u.ESDirectionMeasurement.type,ct));let $e=ct;const ut=class ut extends L{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let s;try{s={...e.strokeStyle??u.ESDistanceMeasurement.defaults.strokeStyle}}catch(o){console.error("ESDistanceMeasurement strokeStyle 属性类型错误!",o),s={...u.ESDistanceMeasurement.defaults.strokeStyle}}i.callUeFunc({f:"update",p:{id:e.id,strokeStyle:s}})},r=this.dv(a.createNextAnimateFrameEvent(e.strokeStyleChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};f(ut,"type",ut.register("ESUeViewer",u.ESDistanceMeasurement.type,ut));let _e=ut;const ht=class ht extends ue{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ht,"type",ht.register("ESUeViewer",u.ESLocalPolygon.type,ht));let ge=ht;const gt=class gt extends ge{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(gt,"type",gt.register("ESUeViewer",u.ESDynamicWater.type,gt));let Ne=gt;const vt=class vt extends k{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(t.widgetEvent.don(n=>{if(n.objId!==e.id)return;const{type:r,properties:s}=n;e.widgetEvent.emit({type:r,properties:s})}))}};f(vt,"type",vt.register("ESUeViewer",u.ESEntityCluster.type,vt));let ze=vt;const ft=class ft extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ft,"type",ft.register("ESUeViewer",u.ESExcavate.type,ft));let He=ft;const pt=class pt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(pt,"type",pt.register("ESUeViewer",u.ESFireParticleSystem.type,pt));let Ge=pt;const wt=class wt extends k{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=this.ad(a.reactJson(""));{const o=()=>{if(typeof e.url=="string")n.value=u.ESSceneObject.context.getStrFromEnv(e.url);else{const g=e.url;g.url=u.ESSceneObject.context.getStrFromEnv(g.url),n.value=g}};o(),this.ad(e.urlChanged.don(o))}const r=()=>{i.callUeFunc({f:"update",p:{id:e.id,url:n.value??u.ESForestTileset.defaults.url,treeTypes:e.treeTypes??u.ESForestTileset.defaults.treeTypes,xiaoBanWidget:e.xiaoBanWidget??u.ESForestTileset.defaults.xiaoBanWidgetDefault,youShiSZ:e.youShiSZ??u.ESForestTileset.defaults.youShiSZ,diLei:e.diLei??u.ESForestTileset.defaults.diLei,senLinLB:e.senLinLB??u.ESForestTileset.defaults.senLinLB,labelMaterial:e.labelMaterial??u.ESForestTileset.defaults.labelMaterial,heightOffset:e.heightOffset??u.ESForestTileset.defaults.heightOffset}})},s=this.dv(a.createNextAnimateFrameEvent(n.changed,e.treeTypesChanged,e.xiaoBanWidgetChanged,e.youShiSZChanged,e.diLeiChanged,e.senLinLBChanged,e.labelMaterialChanged,e.heightOffsetChanged));this.d(s.don(r)),this.d(e.createdEvent.don(r))}};f(wt,"type",wt.register("ESUeViewer",u.ESForestTileset.type,wt));let Je=wt;const yt=class yt extends u.EngineObject{constructor(t,i){super(t,i);f(this,"_imageLabel",this.dv(new u.ESImageLabel(`${this.sceneObject.id}_ESImageLabel`)));f(this,"_hasClassDivAndPos",{});const n=i.viewer;if(!n){console.warn("viewer is undefined!");return}t.mainClass=this._imageLabel;const r=this._imageLabel;i.add(r),this.d(()=>i.delete(r));{const s=()=>{if(!n)return;if(!t.instanceClass)throw new Error("!sceneObject.instanceClass");const c=document.createElement("div"),w=this.dv(new t.instanceClass(c,t,i))._container;if(w.style.opacity=t.opacity.toString()??u.ESGeoDiv.defaults.opacity,w.style.position="fixed",w.style.zIndex="-1",w.style.top="0px",!document.body.contains(w)){document.body.appendChild(w);let l=w?w.querySelectorAll("*[class]"):[];for(let p=0;p<l.length;p++){const h=l[p];var y=h.getBoundingClientRect();this._hasClassDivAndPos[h.className]=[h.offsetLeft,h.offsetTop,h.offsetLeft+y.width,h.offsetTop+y.height]}}zn(w,{backgroundColor:null,allowTaint:!0,useCORS:!0,width:w.offsetWidth,height:w.offsetHeight,scale:1}).then(l=>{document.body.contains(w)&&document.body.removeChild(w),r.url=l.toDataURL(),r.show=t.show}).catch(()=>{document.body.contains(w)&&document.body.removeChild(w)})},o=()=>{try{t.instanceClass?s():(r.url="",r.show=!1)}catch(c){console.error(c)}};o();const g=this.dv(a.createNextAnimateFrameEvent(t.instanceClassChanged,t.opacityChanged));this.d(g.don(o))}{const s=()=>{r.show=t.show};r.show=!1,this.ad(t.showChanged.don(s))}this.d(a.track([r,"anchor"],[t,"anchor"])),this.d(a.bind([r,"position"],[t,"position"])),this.d(a.bind([r,"rotation"],[t,"rotation"])),this.d(a.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(a.bind([r,"flyInParam"],[t,"flyInParam"])),this.d(a.bind([r,"allowPicking"],[t,"allowPicking"])),this.d(a.bind([r,"scale"],[t,"scale"])),this.d(a.track([r,"minVisibleDistance"],[t,"minVisibleDistance"])),this.d(a.track([r,"maxVisibleDistance"],[t,"maxVisibleDistance"])),this.ad(t.automaticLandingEvent.don(()=>{r.automaticLanding()})),this.d(r.pickedEvent.don(s=>{(t.allowPicking??!1)&&t.pickedEvent.emit(s)})),this.d(i.widgetEvent.don(s=>{if(s.objId!==this._imageLabel.id)return;const{type:o,add:g}=s;if(o==="leftClick"){const c=Object.keys(this._hasClassDivAndPos);for(let w=0;w<c.length;w++){const y=c[w];let l=this._hasClassDivAndPos[y];if(g&&g.mouseRelativePos&&g.mouseRelativePos[0]>=l[0]&&g.mouseRelativePos[0]<=l[2]&&g.mouseRelativePos[1]>=l[1]&&g.mouseRelativePos[1]<=l[3]){g.className=y;break}}}t.widgetEvent.emit({type:o,add:g})})),this.d(t.calcFlyToParamEvent.don(()=>{K(n,r.id)})),this.d(t.calcFlyInParamEvent.don(()=>{const s=i.getCurrentCameraInfo();if(!s)return;const{position:o,rotation:g}=s;t.flyInParam={position:o,rotation:g,flyDuration:1}})),this.d(t.smoothMoveEvent.don((s,o)=>{ce(n,r.id,s,o)})),this.d(t.smoothMoveWithRotationEvent.don((s,o,g)=>{ae(n,r.id,s,o,g)})),this.d(t.smoothMoveOnGroundEvent.don((s,o,g,c)=>{le(n,r.id,s,o,c,g)})),this.d(t.smoothMoveWithRotationOnGroundEvent.don((s,o,g,c,w)=>{de(n,r.id,s,o,g,c,w)})),this.d(t.flyToEvent.don((s,o)=>{r.flyTo(s)})),this.d(t.flyInEvent.don(s=>{r.flyIn(s)}))}};f(yt,"type",yt.register("ESUeViewer",u.ESGeoDiv.type,yt));let Be=yt;const mt=class mt extends k{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.flyToFeatureIndexEvent.don((n,r)=>{i.callUeFunc({f:"flyToFeatureIndex",p:{id:e.id,index:n,duration:r}})})),this.d(e.flyToFeatureEvent.don((n,r,s)=>{i.callUeFunc({f:"flyToFeature",p:{id:e.id,key:n,value:r,duration:s}})}))}};f(mt,"type",mt.register("ESUeViewer",u.ESGeoJson.type,mt));let Ke=mt;const Ct=class Ct extends L{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Ct,"type",Ct.register("ESUeViewer",u.ESGeoLineString.type,Ct));let ve=Ct;const Et=class Et extends L{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Et,"type",Et.register("ESUeViewer",u.ESGeoRectangle.type,Et));let Ve=Et;const Ft=class Ft extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Ft,"type",Ft.register("ESUeViewer",u.ESGeoWater.type,Ft));let qe=Ft;const z=class z extends S{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.setNodePositionEvent.don((n,r)=>{qi(i,e.id,n,r)})),this.d(e.setNodeRotationEvent.don((n,r)=>{Xi(i,e.id,n,r)})),this.d(e.setNodeScaleEvent.don((n,r)=>{Zi(i,e.id,n,r)}))}};f(z,"forceUeUpdateProps",[...S.forceUeUpdateProps,"url"]),f(z,"propValFuncs",{...S.propValFuncs,url:e=>typeof e=="string"?u.ESSceneObject.context.getStrFromEnv(u.rpToap(e)):(e.url=u.ESSceneObject.context.getStrFromEnv(u.rpToap(e.url)),e),czmMaximumScale:null,czmMinimumPixelSize:null,czmNativeScale:null,czmColor:null}),f(z,"type",z.register("ESUeViewer",u.ESGltfModel.type,z));let Xe=z;const St=class St extends L{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(St,"type",St.register("ESUeViewer",u.ESHeightMeasurement.type,St));let Ze=St;const It=class It extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=async(s,o,g,c)=>{const{viewer:w}=s;if(!w){console.error("AIMoveTo: ueViewer.viewer is undefined");return}const y=await w.callUeFunc({f:"AIMoveTo",p:{id:o,Destination:g,Time:c}});return y.error&&console.error("AIMoveTo:",y.error),y};this.d(e.aiMoveToEvent.don((s,o)=>{n(t,e.id,s,o)}));const r=async(s,o)=>{const{viewer:g}=s;if(!g){console.error("StopAIMove: ueViewer.viewer is undefined");return}const c=await g.callUeFunc({f:"StopAIMove",p:{id:o}});return c.error&&console.error("StopAIMove:",c.error),c};this.d(e.stopAIMoveEvent.don(()=>{r(t,e.id)}))}};f(It,"type",It.register("ESUeViewer",u.ESHuman.type,It));let Qe=It;const H=class H extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}e.anchor=[.5,1]}};f(H,"type",H.register("ESUeViewer",u.ESImageLabel.type,H)),f(H,"forceUeUpdateProps",[...U.forceUeUpdateProps,"url"]),f(H,"propValFuncs",{...U.propValFuncs,url:e=>typeof e=="string"?u.ESSceneObject.context.getStrFromEnv(u.rpToap(e)):(e.url=u.ESSceneObject.context.getStrFromEnv(u.rpToap(e.url)),e)});let Ye=H;const Tt=class Tt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Tt,"type",Tt.register("ESUeViewer",u.ESLevelRuntimeModel.type,Tt));let be=Tt;const Rt=class Rt extends ue{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Rt,"type",Rt.register("ESUeViewer",u.ESLocalCircle.type,Rt));let xe=Rt;const Dt=class Dt extends k{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Dt,"type",Dt.register("ESUeViewer",u.ESLocalPolygonZ.type,Dt));let Oe=Dt;const kt=class kt extends ue{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(kt,"type",kt.register("ESUeViewer",u.ESLocalRectangle.type,kt));let je=kt;const Lt=class Lt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Lt,"type",Lt.register("ESUeViewer",u.ESLocalSkyBox.type,Lt));let ti=Lt;const Pt=class Pt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Pt,"type",Pt.register("ESUeViewer",u.ESLocationMeasurement.type,Pt));let ei=Pt;const Ut=class Ut extends L{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Ut,"type",Ut.register("ESUeViewer",u.ESPipeFence.type,Ut));let ii=Ut;const Mt=class Mt extends ve{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Mt,"type",Mt.register("ESUeViewer",u.ESPipeline.type,Mt));let ni=Mt;const At=class At extends he{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.highlightFeatureEvent.don(n=>{const r=typeof n=="number"?n.toString():n;Ji(i,e.id,r)})),this.d(e.highlightFeatureAndFlyToEvent.don((n,r,s,o)=>{const g=typeof n=="number"?n.toString():n;Bi(i,e.id,g,o??1)})),this.d(e.setLayerVisibleEvent.don((n,r)=>{let s="";typeof r!="string"?s=JSON.stringify(r):s=r,Ki(i,e.id,s)})),this.d(e.setLayerColorEvent.don((n,r)=>{let s="";typeof r!="string"?s=JSON.stringify(r):s=r,Vi(i,e.id,s)}))}};f(At,"type",At.register("ESUeViewer",u.ESPipeserTileset.type,At));let ri=At;const Wt=class Wt extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Wt,"type",Wt.register("ESUeViewer",u.ESPit.type,Wt));let si=Wt;const $t=class $t extends U{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.ad(e.getInitialStyleEvent.don(async()=>{try{const n=await i.callUeFunc({f:"GetInitialStyle",p:{id:e.id}});n.error!=""&&console.error("getInitialStyleEvent:",n.error),e.initialStyle.value=structuredClone(n.re)}catch(n){console.error("getInitialStyleEvent:",n),e.initialStyle.value=void 0}}))}};f($t,"type",$t.register("ESUeViewer",u.ESPoi2D.type,$t));let oi=$t;const _t=class _t extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(_t,"type",_t.register("ESUeViewer",u.ESPoi3D.type,_t));let ai=_t;const G=class G extends k{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(G,"type",G.register("ESUeViewer",u.ESPoiTileset.type,G)),f(G,"forceUeUpdateProps",[...k.forceUeUpdateProps,"url"]),f(G,"propValFuncs",{...k.propValFuncs,url:e=>typeof e=="string"?u.ESSceneObject.context.getStrFromEnv(e):(e.url=u.ESSceneObject.context.getStrFromEnv(e.url),e)});let li=G;const Nt=class Nt extends L{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Nt,"type",Nt.register("ESUeViewer",u.ESPolygonFence.type,Nt));let di=Nt;const zt=class zt extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(zt,"type",zt.register("ESUeViewer",u.ESPolygonFlattenedPlane.type,zt));let ci=zt;const Ht=class Ht extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Ht,"type",Ht.register("ESUeViewer",u.ESPolygonWithHole.type,Ht));let ui=Ht;const Gt=class Gt extends ${constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(()=>{e.ids=[]}),this.d(e.highlightInner3DtilesetEvent.don(n=>{n.highlight=!0})),this.d(e.removeHighlightInner3DtilesetEvent.don(n=>{n.highlight=!1}));{const n=o=>{o=o.toLocaleLowerCase();let g=[255,255,255,1];if(o.startsWith("#")){if(o.length===4){let c=parseInt(o[1]+o[1],16),w=parseInt(o[2]+o[2],16),y=parseInt(o[3]+o[3],16);g=[c,w,y,1]}else if(o.length===7){let c=parseInt(o.substring(1,3),16),w=parseInt(o.substring(3,5),16),y=parseInt(o.substring(5,7),16);g=[c,w,y,1]}}else if(o.startsWith("rgba")){let c=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/);if(c){let w=parseInt(c[1]),y=parseInt(c[2]),l=parseInt(c[3]),p=parseFloat(c[4]);g=[w,y,l,p]}}else if(o.startsWith("rgb")){let c=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);if(c){let w=parseInt(c[1]),y=parseInt(c[2]),l=parseInt(c[3]);g=[w,y,l,1]}}else console.error("color类型只能为#rrggbb、#rgb、rgba(r,g,b,a)、rgb(r,g,b)");return[g[0]/255,g[1]/255,g[2]/255,g[3]]},r=()=>{const o=e.layerConfig;if(!o)return;const g=[];o.forEach(c=>{g.push({condition:[{field:"layer",op:"==",value:c.layer},{field:"dataset",op:"==",value:c.dataset}],color:n(c.value.color??"rgb(255,255,255)"),show:c.value.visible})}),e.setFeatureStyle(g)};r();const s=this.dv(a.createNextAnimateFrameEvent(e.layerConfigChanged));this.d(s.don(()=>{r()}))}}};f(Gt,"type",Gt.register("ESUeViewer",u.ESRtsTileset.type,Gt));let hi=Gt;const Jt=class Jt extends k{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(e.addTreesEvent.don(n=>{u.addTreesCallFunc(t,e.id,n)})),this.d(e.removeAllTreesEvent.don(()=>{u.removeAllTreesCallFunc(t,e.id)})),this.d(e.updateTreeParamsEvent.don(n=>{u.updateTreeParamsCallFunc(t,e.id,n)})),this.d(e.cutDownTreesEvent.don((n,r)=>{u.cutDownTreesCallFunc(t,e.id,n,r)})),this.d(e.growthSimulationEvent.don((n,r,s)=>{u.growthSimulationCallFunc(t,e.id,n,r,s)}))}};f(Jt,"type",Jt.register("ESUeViewer",u.ESSeparateFoliage.type,Jt));let gi=Jt;const Bt=class Bt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Bt,"type",Bt.register("ESUeViewer",u.ESSubmergingAnalysis.type,Bt));let vi=Bt;const Kt=class Kt extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{i.callUeFunc({f:"Start",p:{id:e.id}})})),this.d(e.stopEvent.don(()=>{i.callUeFunc({f:"Stop",p:{id:e.id}})}))}};f(Kt,"type",Kt.register("ESUeViewer",u.ESSunshineAnalysis.type,Kt));let fi=Kt;const Vt=class Vt extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{i.callUeFunc({f:"Start",p:{id:e.id}})}))}};f(Vt,"type",Vt.register("ESUeViewer",u.ESSurfaceAreaMeasurement.type,Vt));let pi=Vt;const qt=class qt extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(qt,"type",qt.register("ESUeViewer",u.ESTextLabel.type,qt));let wi=qt;const V=class V extends U{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.callFunctionEvent.don((n,r)=>{me(i,e.id,n,r)}))}};f(V,"type",V.register("ESUeViewer",u.ESUEWidget.type,V)),f(V,"propValFuncs",{...U.propValFuncs,info:e=>JSON.stringify(e??{})});let yi=V;const Nn=d=>{switch(d){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"未搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是场景原有的,而是新建的,无法绑定";case 4:return"搜索到ActorTag对应的Actor是地形或3DTileset,无法绑定";default:return"未知错误"}},cr=d=>{switch(d){case 0:return"创建成功";case 1:return"未找到对应的资源,无法创建";case 2:return"Id与场景中现有的ActorTag重复,创建后可能出现问题,创建失败";default:return"未知错误"}},Xt=class Xt extends u.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn(`${e.id} UeESUnrealActor viewer is undefined!`);return}this.d(()=>{we(i,e.id)});const n=async()=>{c()||await i.callUeFunc({f:"update",p:{id:e.id,name:e.name,show:e.show,rotation:e.rotation,flyToParam:e.flyToParam??u.ESVisualObject.defaults.flyToParam,flyInParam:e.flyInParam??u.ESVisualObject.defaults.flyInParam,highlight:e.highlight,collision:e.collision,scale:e.scale,minVisibleDistance:e.minVisibleDistance,maxVisibleDistance:e.maxVisibleDistance}})},r=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.nameChanged,e.rotationChanged,e.flyToParamChanged,e.flyInParamChanged,e.highlightChanged,e.collisionChanged,e.scaleChanged,e.minVisibleDistanceChanged,e.maxVisibleDistanceChanged));this.d(r.don(n)),this.d(e.flushEvent.don(()=>r.flush()));let s,o;const g=async()=>{c()||(await i.callUeFunc({f:"update",p:{id:e.id,position:e.position}}),(t.debug??!1)&&console.log(`updatePostion:${e.position},actorTag:${e.actorTag},actorClass:${e.actorClass}`))},c=()=>!s&&!o?(console.warn(`${e.id} 未绑定ActorTag或未创建ActorClass!`),!0):!1,w=async()=>{const{id:l}=e,p=await t.unBindActorByID(l);p&&p.error!==""&&console.warn(`${e.id} UeESUnrealActor UnBindActorByID: ${p.error}`),s=void 0;const h=await i.callUeFunc({f:"destroy",p:{id:l}});if(h&&h.error!==""){console.warn(`${e.id} UeESUnrealActor DestroyActorByID: ${h.error}`);return}o=void 0},y=this.dv(a.react({type:"ActorClass",actorClass:"default"}));{const l=this.dv(a.createNextAnimateFrameEvent(e.actorClassChanged,e.actorTagChanged)),p=async()=>{e.actorTag!==""?y.value={type:"ActorTag",actorTag:e.actorTag}:y.value={type:"ActorClass",actorClass:e.actorClass===""?"default":e.actorClass}};p(),this.d(l.don(p)),this.d(e.flushEvent.don(()=>l.flush()))}{const l=this.dv(a.createProcessingFromAsyncFunc(async h=>{if(await h.promise(w()),y.value.type==="ActorTag"){const{actorTag:m}=y.value;await h.promise(w());try{e.lastActorStatus="null";const C=await h.promise(t.bindActorByTag(e.id,m));if(!C)return;if(C.error!==""){console.warn(`${e.id} UeESUnrealActor BindActorByTag:${m},${C.error}`);return}if(C.re.type===0)e.lastActorStatus="bound",s=m;else if(C.re.type===1)e.lastActorStatus="bound",s=m,console.warn(`${e.id} UeESUnrealActor BindActorByTag:${m},${Nn(C.re.type)}`);else{s=void 0,console.warn(`${e.id} UeESUnrealActor BindActorByTag error:${m}, ${Nn(C.re.type)}`);return}}catch(C){console.warn(`${e.id} UeESUnrealActor BindActorByTag catch error:${m}, ${C}`);return}}else if(y.value.type==="ActorClass"){const{actorClass:m}=y.value;try{const C=await h.promise(t.createActorByClass(e.id,m));if(!C)return;if(C.error!==""){console.warn(`${e.id} UeESUnrealActor CreateActorByClass error :${m}, ${C.error}`);return}if(C.re.type===0)e.lastActorStatus="created",o=m;else{console.warn(`${e.id} UeESUnrealActor CreateActorByClass error type :${m},${cr(C.re.type)}`);return}}catch(C){console.warn(`${e.id} UeESUnrealActor CreateActorByClass error catch :${m}, ${JSON.stringify(C)}`);return}}await h.promise(n()),await h.promise(g())})),p=async()=>{l.restart()};p(),this.d(y.changed.don(p))}this.d(e.positionChanged.don(g)),this.d(e.callFunctionEvent.don((l,p)=>{c()||me(i,e.id,l,p)})),this.d(e.smoothMoveEvent.don((l,p)=>{c()||ce(i,e.id,l,p)})),this.d(e.smoothMoveWithRotationEvent.don((l,p,h)=>{c()||ae(i,e.id,l,p,h)})),this.d(e.smoothMoveOnGroundEvent.don((l,p,h,m)=>{c()||le(i,e.id,l,p,m,h)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((l,p,h,m,C)=>{c()||de(i,e.id,l,p,h,m,C)})),this.d(e.automaticLandingEvent.don(l=>{if(c())return;const p=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(h=>{h!==null&&(e.position=[...p,h],e.collision=l)})})),this.d(e.flyToEvent.don(async(l,p)=>{if(c())return;const h=await B(i,e.id,l);let m="over";h===void 0?m="error":h.endType===0?m="over":h.endType===1&&(m="cancelled"),e.flyOverEvent.emit(p,m,t)})),this.d(e.calcFlyToParamEvent.don(()=>{c()||K(i,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const l=await t.getCurrentCameraInfo();if(!l)return;const{position:p,rotation:h}=l;e.flyInParam={position:p,rotation:h,flyDuration:1}})),this.d(t.propChanged.don(l=>{c()||l.objId===e.id&&Object.keys(l.props).forEach(p=>{const h=l.props[p]===null?void 0:l.props[p];e[p]=h})}))}};f(Xt,"type",Xt.register("ESUeViewer",u.ESUnrealActor.type,Xt));let mi=Xt;const Zt=class Zt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Zt,"type",Zt.register("ESUeViewer",u.ESVideoFusion.type,Zt));let Ci=Zt;const Qt=class Qt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Qt,"type",Qt.register("ESUeViewer",u.ESViewShed.type,Qt));let Ei=Qt;const Yt=class Yt extends L{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};f(Yt,"type",Yt.register("ESUeViewer",u.ESVisibilityAnalysis.type,Yt));let Fi=Yt;const bt=class bt extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{i.callUeFunc({f:"Start",p:{id:e.id}})})),this.d(e.clearEvent.don(()=>{i.callUeFunc({f:"Clear",p:{id:e.id}})}))}};f(bt,"type",bt.register("ESUeViewer",u.ESVolumeMeasurement.type,bt));let Si=bt;const q=class q extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(q,"type",q.register("ESUeViewer",u.ESWidget.type,q)),f(q,"propValFuncs",{...U.propValFuncs,info:e=>JSON.stringify(e??{})});let Ii=q;const xt=class xt extends u.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}e.poi.actorTag=e.human.id,e.poi.positionOffset=[0,0,e.poiOffsetHeight-.8],this.d(e.poiOffsetHeightChanged.don(()=>{e.poi.positionOffset=[0,0,e.poiOffsetHeight-.8]})),this.d(()=>{e.poi.actorTag=""})}};f(xt,"type",xt.register("ESUeViewer",u.ESHumanPoi.type,xt));let Ti=xt;u.ESSceneObject.context.getStrFromEnv(u.ESNavigator.defaults.imgUrl);const Ot=class Ot extends u.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new u.ESCustomDiv);t.add(n),this.dispose(()=>t.delete(n)),this.dispose(a.track([n,"show"],[e,"show"])),n.instanceClass=class extends a.Destroyable{constructor(s,o,g){super(),this._subContainer=s;const c=document.createElement("div");this._subContainer.appendChild(c),this.dispose(()=>this._subContainer.removeChild(c));{const l=async()=>{const p=await t.getCurrentCameraInfo(),h=p==null?void 0:p.position,C=[...p==null?void 0:p.rotation];C[0]=360,t.flyIn(h,C)};c.addEventListener("click",l),c.style.cursor="pointer",this.dispose(()=>c.removeEventListener("click",l))}{const l=()=>{c.style.width=`${e.cssSize?e.cssSize:u.ESNavigator.defaults.cssSize}px`,c.style.height=`${e.cssSize?e.cssSize:u.ESNavigator.defaults.cssSize}px`};l(),e.dispose(e.cssSizeChanged.disposableOn(l))}c.style.position="fixed";{const l=()=>{c.style.top=`${e.cssPosition?e.cssPosition[0]:u.ESNavigator.defaults.cssPosition[0]}px`,c.style.right=`${e.cssPosition?e.cssPosition[1]:u.ESNavigator.defaults.cssPosition[1]}px`};l(),e.dispose(e.cssPositionChanged.disposableOn(l))}c.style.transition=" right 0.4s linear",c.style.cursor="pointer";const w=document.createElement("div");c.appendChild(w),this.dispose(()=>c.removeChild(w)),w.style.width="100%",w.style.height="100%",w.style.position="relative";const y=document.createElement("img");w.appendChild(y),this.dispose(()=>w.removeChild(y)),y.style.width="100%",y.style.height="100%",y.style.border="none";{const l=()=>y.src=e.imgUrl;l(),e.dispose(e.imgUrlChanged.disposableOn(l))}{const l=()=>{const C=-t.getCurrentCameraInfo().rotation[0];y.style.transform=`rotate(${C}deg)`};let p;const h=async()=>{l(),e.show?(c.style.display="block",p=setInterval(()=>{l()},1e3)):(c.style.display="none",clearInterval(p))};this.dispose(e.showChanged.disposableOn(h)),h(),this.dispose(()=>clearInterval(p))}y.style.transformOrigin="50% 50%"}}}};f(Ot,"type",Ot.register("ESUeViewer",u.ESNavigator.type,Ot));let Ri=Ot;const J=class J extends L{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}{const n=()=>{let r=e.materialMode==="blue"?"multipleArrows":e.materialMode==="purple"?"singleArrow":e.materialMode;i.callUeFunc({f:"update",p:{id:e.id,materialMode:r}})};this.dispose(e.materialModeChanged.disposableOn(n)),this.dispose(e.createdEvent.disposableOn(n))}}};f(J,"type",J.register("ESUeViewer",u.ESPath.type,J)),f(J,"forceUeUpdateProps",[...L.forceUeUpdateProps]),f(J,"propValFuncs",{...L.propValFuncs,materialMode:null});let Di=J;async function ur(d){navigator.clipboard.writeText(d).then(function(){console.log("复制成功")},function(e){console.log("复制失败")})}const jt=class jt extends u.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new u.ESCustomDiv);t.add(n),this.dispose(()=>t.delete(n)),n.instanceClass=class extends a.Destroyable{constructor(s,o,g){if(super(),this._subContainer=s,!g||!(g instanceof A))return;const c=document.createElement("div");this._subContainer.appendChild(c),this.dispose(()=>this._subContainer.removeChild(c)),c.style.width="100%",c.style.position="absolute",c.style.height=`${u.ESViewerStatusBar.defaults.height}px`,c.style.left="0",c.style.bottom="0",c.style.color="#fff",c.style.padding="0 20px 0 0",c.style.boxSizing="border-box",c.style.lineHeight=`${u.ESViewerStatusBar.defaults.height}px`,c.style.zIndex="100",c.style.alignContent="center",c.style.justifyContent="space-between";const w=document.createElement("span");c.appendChild(w),this.dispose(()=>c.removeChild(w));const y=document.createElement("span");w.appendChild(y),this.dispose(()=>w.removeChild(y));const l=document.createElement("span");w.appendChild(l),l.addEventListener("dblclick",function(){let h=l.innerHTML;h.startsWith("鼠标位置")&&(h=h.slice(5)),ur(h)}),l.style.cursor="pointer",this.dispose(()=>w.removeChild(l));const p=document.createElement("span");c.appendChild(p),this.dispose(()=>c.removeChild(p));{const h=()=>{c.style.height=(e.height??u.ESViewerStatusBar.defaults.height)+"px",c.style.lineHeight=(e.height??u.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(h)),h()}{const h=()=>{c.style.fontSize=(e.fontSize??u.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(h)),h()}{const h=()=>{e.bgColor?c.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:c.style.background=`rgba(${u.ESViewerStatusBar.defaults.bgColor[0]},${u.ESViewerStatusBar.defaults.bgColor[1]},${u.ESViewerStatusBar.defaults.bgColor[2]},${u.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(h)),h()}g.getVersion().then(h=>{h&&(p.innerText=`Ue 版本 : ${h[0]} `)}).catch(h=>{console.log(h)});{const h=()=>{let E="",I="";E+=`帧率:${g.getFPS().toFixed(0)}FPS`,y.innerText=E;const F=t.getCurrentCameraInfo();E+=` 经度: ${F.position[0].toFixed(5)}° 纬度: ${F.position[1].toFixed(5)}° 高度: ${F.position[2].toFixed(2)}米 偏航角: ${F.rotation[0].toFixed(2)}° 俯仰角: ${F.rotation[1].toFixed(2)}° 翻滚角:${F.rotation[2].toFixed(2)}° `,y.innerText=E,t.pick().then(R=>{if(R){const{pickResult:T}=R;if(T&&T.position){const{position:W}=T;I+=`鼠标位置:${W[0].toFixed(5)}° ${W[1].toFixed(5)}° ${W[2].toFixed(2)}m`}else I+="暂时无法获取鼠标位置...";l.innerText=I}}).catch(R=>{console.log(R)})};let m;const C=async()=>{h(),e.show?(c.style.display="flex",m=setInterval(()=>{h()},1e3)):(c.style.display="none",clearInterval(m))};this.dispose(e.showChanged.disposableOn(C)),C(),this.dispose(()=>clearInterval(m))}}}}};f(jt,"type",jt.register("ESUeViewer",u.ESViewerStatusBar.type,jt));let ki=jt;const te=class te extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(te,"type",te.register("ESUeViewer",u.ESGaussianSplatting.type,te));let Li=te;const ee=class ee extends ${constructor(t,i){super(t,i);f(this,"_es3DTileset",this.dv(new u.ES3DTileset(`${this.sceneObject.id}_ES3DTileset`)));if(!i.viewer){console.warn("viewer is undefined!");return}t.mainClass=this._es3DTileset;{const r=this._es3DTileset;i.add(r),this.dispose(()=>i.delete(r)),this.d(a.track([r,"allowPicking"],[t,"allowPicking"])),this.d(a.track([r,"collision"],[t,"collision"])),this.d(a.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(a.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(a.track([r,"url"],[t,"url"])),this.d(a.track([r,"actorTag"],[t,"actorTag"])),this.d(a.track([r,"materialMode"],[t,"materialMode"])),this.d(a.track([r,"highlight"],[t,"highlight"])),this.d(a.track([r,"maximumScreenSpaceError"],[t,"maximumScreenSpaceError"])),this.d(a.track([r,"highlightID"],[t,"highlightID"])),this.d(a.track([r,"highlightColor"],[t,"highlightColor"])),this.d(a.bind([r,"offset"],[t,"offset"])),this.d(a.bind([r,"rotation"],[t,"rotation"])),this.d(a.track([r,"czmImageBasedLightingFactor"],[t,"czmImageBasedLightingFactor"])),this.d(a.track([r,"czmLuminanceAtZenith"],[t,"czmLuminanceAtZenith"])),this.d(a.track([r,"czmMaximumMemoryUsage"],[t,"czmMaximumMemoryUsage"])),this.d(a.track([r,"czmClassificationType"],[t,"czmClassificationType"])),this.d(a.track([r,"czmStyleJson"],[t,"czmStyleJson"])),this.d(a.track([r,"czmBackFaceCulling"],[t,"czmBackFaceCulling"])),this.d(a.track([r,"czmDebugShowBoundingVolume"],[t,"czmDebugShowBoundingVolume"])),this.d(a.track([r,"czmDebugShowContentBoundingVolume"],[t,"czmDebugShowContentBoundingVolume"])),this.d(a.track([r,"colorBlendMode"],[t,"colorBlendMode"])),this.d(a.track([r,"cacheBytes"],[t,"cacheBytes"])),this.d(a.track([r,"clippingPlaneEnabled"],[t,"clippingPlaneEnabled"])),this.d(a.track([r,"unionClippingRegions"],[t,"unionClippingRegions"])),this.d(a.track([r,"clippingPlaneEdgeColor"],[t,"clippingPlaneEdgeColor"])),this.d(a.track([r,"clippingPlaneEdgeWidth"],[t,"clippingPlaneEdgeWidth"])),this.d(a.track([r,"materialParams"],[t,"materialParams"])),this.d(a.bind([r,"supportEdit"],[t,"supportEdit"])),this.d(a.bind([r,"clippingPlanesId"],[t,"clippingPlanesId"])),this.d(a.bind([r,"clippingPlaneIds"],[t,"clippingPlaneIds"])),this.d(a.bind([r,"flattenedPlaneId"],[t,"flattenedPlaneId"])),this.d(a.bind([r,"flattenedPlaneEnabled"],[t,"flattenedPlaneEnabled"])),this.d(a.bind([r,"clippingPlaneId"],[t,"clippingPlaneId"])),this.d(a.bind([r,"excavateId"],[t,"excavateId"]))}{const r=this._es3DTileset;this.d(t.refreshTilesetEvent.don(()=>{r.refreshTileset()})),this.d(t.highlightFeatureEvent.don((...s)=>{r.highlightFeature(...s)})),this.d(t.highlightFeatureAndFlyToEvent.don((...s)=>{r.highlightFeatureAndFlyTo(...s)})),this.d(t.setFeatureColorEvent.don((...s)=>{r.setFeatureColor(...s)})),this.d(t.setFeatureVisableEvent.don((...s)=>{r.setFeatureVisable(...s)})),this.d(t.resetFeatureStyleEvent.don((...s)=>{r.resetFeatureStyle(...s)})),this.d(t.flyInEvent.don((...s)=>{r.flyIn(s[0])})),this.d(t.flyToEvent.don((...s)=>{r.flyTo(s[0])})),this.d(t.calcFlyToParamEvent.don((...s)=>{r.calcFlyToParam(...s)})),this.d(t.calcFlyInParamEvent.don((...s)=>{r.calcFlyInParam(...s)}))}{const r=this._es3DTileset;this.d(r.tilesetReady.don(s=>{t.tilesetReady.emit(s)})),this.d(r.pickedEvent.don(s=>{t.pickedEvent.emit(new u.SceneObjectPickedInfo(t,s.childPickedInfo))}))}{const r=()=>{this.es3DTileset.show=t.show};r(),this.d(t.showChanged.don(()=>{r()}))}}get es3DTileset(){return this._es3DTileset}};f(ee,"type",ee.register("ESUeViewer",u.ESRtsFeatureEditing.type,ee));let Pi=ee;const ie=class ie extends ${constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ie,"type",ie.register("ESUeViewer",u.ESMsTileset.type,ie));let Ui=ie;const ne=class ne extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{i.callUeFunc({f:"update",p:{id:e.id,height:e.height??u.ESGeoExtrudedPolygon.defaults.height,extrudedHeight:e.extrudedHeight??u.ESGeoExtrudedPolygon.defaults.extrudedHeight,perPositionHeight:e.perPositionHeight??u.ESGeoExtrudedPolygon.defaults.perPositionHeight}})},r=this.disposeVar(a.createNextAnimateFrameEvent(e.heightChanged,e.extrudedHeightChanged,e.perPositionHeightChanged));this.dispose(r.disposableOn(n)),this.dispose(e.createdEvent.disposableOn(n))}};f(ne,"type",ne.register("ESUeViewer",u.ESGeoExtrudedPolygon.type,ne));let Mi=ne;const re=class re extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(re,"type",re.register("ESUeViewer",u.ESStaticMesh.type,re));let Ai=re;v.copyright=void 0;try{const d="@u-gis/ue",e="3.0.7-beta.1",t="2025-05-21T10:39:13.000Z",i="北京西部世界科技有限公司",n="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="117e212fa2bb7ff08f74ad36621c968d0c66a151",o=((Date.now()-1747823953e3)/36e5).toFixed(1),g=`%c🌏 ${d}%c ${e}.${r.slice(0,8)}.${t} (距今${o}个小时)
|
|
2
|
-
%c${n?n+`
|
|
3
|
-
`:""}当前网站正在使用${d},此软件版权归${i}所有
|
|
4
|
-
`;v.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","117e212fa2bb7ff08f74ad36621c968d0c66a151")},get info(){return g},get date(){return"2025-05-21T10:39:13.000Z"},get author(){return"suplyang"},get version(){return"3.0.7-beta.1"},get name(){return"@u-gis/ue"},get commitId(){return"117e212fa2bb7ff08f74ad36621c968d0c66a151"},print(c=!1){!c&&window._xe2_no_copy_print||console.info(this.info,`
|
|
5
|
-
font-size: 18px;
|
|
6
|
-
font-weight: 1000;
|
|
7
|
-
line-height: 1;
|
|
8
|
-
color: rgb(0, 120, 215);
|
|
9
|
-
padding-top: 20px;
|
|
10
|
-
padding-bottom: 10px;
|
|
11
|
-
`,`
|
|
12
|
-
font-size: 10px;
|
|
13
|
-
font-weight: 1000;
|
|
14
|
-
color: rgb(0, 120, 215);
|
|
15
|
-
`,`
|
|
16
|
-
font-size: 10px;
|
|
17
|
-
line-height: 1.5;
|
|
18
|
-
color: rgb(0, 120, 215);
|
|
19
|
-
padding-bottom: 2px;
|
|
20
|
-
padding-left: 35px;
|
|
21
|
-
`)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[d]=v.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&v.copyright.print()}catch{}v.ESUeViewer=A,v.HighlightFeatureAndFlyToCallFunc=Bi,v.HighlightFeatureCallFunc=Ji,v.SetLayerColorCallFunc=Vi,v.SetLayerVisibleCallFunc=Ki,v.UeCloudViewerBase=Q,v.UeES3DTileset=he,v.UeESAlarm=Se,v.UeESApertureEffect=Ie,v.UeESAreaMeasurement=Te,v.UeESBlastParticleSystem=Re,v.UeESBoxClipping=De,v.UeESCameraView=ke,v.UeESCameraVisibleRange=Le,v.UeESCar=Pe,v.UeESClassification=Ue,v.UeESClippingPlane=Me,v.UeESDataMesh=Ae,v.UeESDatasmithRuntimeModel=We,v.UeESDirectionMeasurement=$e,v.UeESDistanceMeasurement=_e,v.UeESDynamicWater=Ne,v.UeESEntityCluster=ze,v.UeESExcavate=He,v.UeESFireParticleSystem=Ge,v.UeESForestTileset=Je,v.UeESGaussianSplatting=Li,v.UeESGeoDiv=Be,v.UeESGeoExtrudedPolygon=Mi,v.UeESGeoJson=Ke,v.UeESGeoLineString=ve,v.UeESGeoPolygon=P,v.UeESGeoRectangle=Ve,v.UeESGeoVector=L,v.UeESGeoWater=qe,v.UeESGltfModel=Xe,v.UeESHeightMeasurement=Ze,v.UeESHuman=Qe,v.UeESHumanPoi=Ti,v.UeESImageLabel=Ye,v.UeESImageryLayer=Ee,v.UeESLabel=U,v.UeESLevelRuntimeModel=be,v.UeESLocalCircle=xe,v.UeESLocalPolygon=ge,v.UeESLocalPolygonZ=Oe,v.UeESLocalRectangle=je,v.UeESLocalSkyBox=ti,v.UeESLocalVector=Ce,v.UeESLocalVector2D=ue,v.UeESLocationMeasurement=ei,v.UeESMsTileset=Ui,v.UeESNavigator=Ri,v.UeESObjectWithLocation=S,v.UeESPath=Di,v.UeESPipeFence=ii,v.UeESPipeline=ni,v.UeESPipeserTileset=ri,v.UeESPit=si,v.UeESPoi2D=oi,v.UeESPoi3D=ai,v.UeESPoiTileset=li,v.UeESPolygonFence=di,v.UeESPolygonFlattenedPlane=ci,v.UeESPolygonWithHole=ui,v.UeESRtsFeatureEditing=Pi,v.UeESRtsTileset=hi,v.UeESSceneObject=$,v.UeESSeparateFoliage=gi,v.UeESStaticMesh=Ai,v.UeESSubmergingAnalysis=vi,v.UeESSunshineAnalysis=fi,v.UeESSurfaceAreaMeasurement=pi,v.UeESTerrainLayer=Fe,v.UeESTextLabel=wi,v.UeESUEWidget=yi,v.UeESUnrealActor=mi,v.UeESVideoFusion=Ci,v.UeESViewShed=Ei,v.UeESViewerStatusBar=ki,v.UeESVisibilityAnalysis=Fi,v.UeESVisualObject=k,v.UeESVolumeMeasurement=Si,v.UeESWidget=Ii,v.UePickedInfo=qn,v.bind3DTilesetByTagCallFunc=yn,v.bindActorByTagCallFunc=gn,v.bindImageryByTagCallFunc=En,v.calcFlyToParamCallFunc=K,v.callFunctionCallFunc=me,v.captureCallFunc=tn,v.changeNavigationModeCallFunc=M,v.createActorByClassCallFunc=wn,v.destroyCallFunc=we,v.flyInCallFunc=Z,v.flyInDefaultCameraCallFunc=_i,v.flyToCallFunc=B,v.generateMemReportCallFunc=Gi,v.getAllSocketNamesByActorTagCallFunc=sn,v.getBoundSphereCallFunc=an,v.getBoundSphereWithChildrenCallFunc=ln,v.getCameraRelativeHeightCallFunc=Tn,v.getFillMaterialParamInfoCallFunc=cn,v.getGlobalPropertyCallFunc=un,v.getHeightByLonLatCallFunc=Oi,v.getHeightByLonLatsCallFunc=ji,v.getIdByComponentNameAndHitItemCallFunc=In,v.getLonLatAltToScreenPositionCallFunc=nn,v.getObjectByInfoCallFunc=hn,v.getStatusCallFunc=Ln,v.getStrokeMaterialParamInfoCallFunc=dn,v.getTilesetMaterialIDListCallFunc=An,v.getVersionCallFunc=on,v.highlightActorByTagCallFunc=Dn,v.mountPakFiles=Hi,v.moveObjectsCallFunc=Mn,v.partialCaptureCallFunc=en,v.pickCallFunc=bi,v.pickPositionCallFunc=xi,v.quitCallFunc=Yi,v.refreshTilesetCallFunc=$i,v.resetWithCurrentCameraCallFunc=ye,v.restoreOriginalSceneCallFunc=vn,v.saveStringToFileCallFunc=Rn,v.sendCustomMessageCallFunc=kn,v.setGlobalPropertyCallFunc=Qi,v.setNodePositionCallFunc=qi,v.setNodeRotationCallFunc=Xi,v.setNodeScaleCallFunc=Zi,v.smoothMoveCallFunc=ce,v.smoothMoveOnGroundCallFunc=le,v.smoothMoveWithRotationCallFunc=ae,v.smoothMoveWithRotationOnGroundCallFunc=de,v.startEditingCallFunc=Pn,v.startVoiceCallFunc=Ni,v.stopEditingCallFunc=Un,v.stopVoiceCallFunc=zi,v.uePositionToLonLatAltCallFunc=rn,v.unBind3DTilesetByIdCallFunc=Cn,v.unBind3DTilesetByTagCallFunc=mn,v.unBindActorByIDCallFunc=fn,v.unBindActorByTagCallFunc=pn,v.unBindImageryByIdCallFunc=Sn,v.unBindImageryByTagCallFunc=Fn,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(f,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("@u-gis/core"),require("xbsj-base"),require("@epicgames-ps/lib-pixelstreamingfrontend-ue5.4"),require("html2canvas")):typeof define=="function"&&define.amd?define(["exports","@u-gis/core","xbsj-base","@epicgames-ps/lib-pixelstreamingfrontend-ue5.4","html2canvas"],c):(f=typeof globalThis<"u"?globalThis:f||self,c(f.EarthSDK3_UE={},f.EarthSDK3,f["xbsj-base"],f.libPixelstreamingfrontendUe5_4,f.html2canvas))})(this,function(f,c,a,D,zn){"use strict";var wr=Object.defineProperty;var yr=(f,c,a)=>c in f?wr(f,c,{enumerable:!0,configurable:!0,writable:!0,value:a}):f[c]=a;var g=(f,c,a)=>yr(f,typeof c!="symbol"?c+"":c,a);const Hn={...c.ESViewer.defaults,geoReferenceOrigin:void 0,keepWorldOriginNearCamera:!1,useCache:!0,widgetInteractionDistance:200,memReportInterval:10,sceneControlled:!0,brightness:0,emissiveIntensity:1,statusUpdateInterval:.5,baseUrl:window.location.href??""},Wi=()=>({...c.ESViewer.createCommonProps(),apiKey:"",apiUrl:"",secretKey:"",speechVoiceMode:"",geoReferenceOrigin:a.reactArrayWithUndefined(void 0),keepWorldOriginNearCamera:void 0,useCache:void 0,widgetInteractionDistance:void 0,memReportInterval:void 0,sceneControlled:void 0,brightness:void 0,emissiveIntensity:void 0,statusUpdateInterval:void 0,baseUrl:void 0});function se(){const u=Wi(),e=[];return Object.keys(u).forEach(t=>{e.push(t)}),e}function pe(u){const{defaults:e}=A,t=se(),i={};return t.forEach(n=>{i[n]=u[n]??e[n]}),i}const Gn={Response:1},oe={UIInteraction:50,MouseWheel:75};class Jn extends a.HasOwner{constructor(t,i){super(t);g(this,"_processResponseFn",t=>this.esUeViewer.processResponse(t));g(this,"_inner",new WebSocket(this._uri));g(this,"_innerInit",(()=>{this.inner.onmessage=t=>{if(this.isDestroyed())return;let i=new FileReader;i.onload=n=>{if(this.isDestroyed())return;let r=n.target.result,s=new Uint32Array(r),o=0;if(s[0]===Gn.Response){o+=4;let v=s[o/4];o+=4;for(let d=0;d<v;d++){let w=s[o/4];o+=4;let y=new TextDecoder("utf-8").decode(r.slice(o,o+w));o+=w,this._processResponseFn(y)}}},i.readAsArrayBuffer(t.data)},this.inner.onopen=()=>{this.isDestroyed()||(console.warn("earthsdk message websocket server connected:",this.uri),console.log("%c[EarthSDK websocket open]","background: #a6ec99; color: black","open"),this.owner.dispatchEvent(new CustomEvent("esmsgwsopen",{detail:"websocket open"})))},this._inner.onclose=t=>{this.isDestroyed()||(console.log("%c[EarthSDK websocket close ]","background: red; color: black","error"),this.owner.dispatchEvent(new CustomEvent("error",{detail:"websocket close"})))},this._inner.onerror=t=>{this.isDestroyed()||(console.log("%c[EarthSDK websocket error ]","background: red; color: black","error"),this.owner.dispatchEvent(new CustomEvent("error",{detail:"websocket error"})))},this.d(()=>{!this.isDestroyed()&&this._inner.close()})})());this._uri=i}get esUeViewer(){return this.owner}get uri(){return this._uri}get inner(){return this._inner}sendInputData(t){const i=this.inner;if(i.readyState!==WebSocket.OPEN)return;const r=new Uint8Array(t)[0];if(r>=oe.UIInteraction&&r<=oe.MouseWheel){const s=new ArrayBuffer(t.byteLength+4);return new DataView(s).setUint32(0,t.byteLength,!0),new Uint8Array(s,4).set(new Uint8Array(t)),i.send(new DataView(s)),!0}else return!1}emitDescriptorWithString(t,i){let n=new TextEncoder().encode(i),r=new DataView(new ArrayBuffer(3+n.length)),s=0;r.setUint8(s,t),s++,r.setUint16(s,n.length,!0),s+=2;for(let o=0;o<n.length;o++)r.setUint8(s,n[o]),s+=1;try{this.sendInputData(r.buffer)}catch(o){console.error(`data.buffer.size: ${r.buffer.byteLength} 独立通道 sendInputData error: ${o}`,o)}}destroyImpl(){this._inner&&this._inner.close()}}window.g_emitDescriptor_maxBytes=3e4;let Bn=-1;D.Logger.SetLoggerVerbosity(1);class Kn extends a.Destroyable{constructor(t,i){super();g(this,"_eventTarget",new EventTarget);g(this,"debug",!1);g(this,"uiInteractionCallbacks",new Map);g(this,"_url",this._options.url);g(this,"_container",(()=>{const t=typeof this._domOrDomId=="string"?document.getElementById(this._domOrDomId):this._domOrDomId;if(!t)throw new Error(`ESUEViewer container${this._domOrDomId} error!`);return t})());g(this,"_pixelStream",(()=>{const t=new D.Config({initialSettings:{AutoPlayVideo:!0,AutoConnect:!0,StartVideoMuted:!0,WaitForStreamer:!0,SuppressBrowserKeys:!1,[D.TextParameters.SignallingServerUrl]:this._url}});t.setFlagEnabled(D.Flags.BrowserSendOffer,!1),t.setFlagEnabled(D.Flags.HoveringMouseMode,!0),t.setFlagEnabled(D.Flags.MatchViewportResolution,!0),t.setNumericSetting(D.NumericParameters.MaxReconnectAttempts,0);const i=new D.PixelStreaming(t,{videoElementParent:this._options.createUI?void 0:this.container});return this.d(()=>{!this.isDestroyed()&&i.disconnect()}),i})());g(this,"_esMsgWsWrapper");g(this,"_esMsgWsWrapperInit",(()=>{this._options.esmsgWsUri&&(this._esMsgWsWrapper=this.disposeVar(new Jn(this,this._options.esmsgWsUri)))})());this._domOrDomId=t,this._options=i;const n=this;if(n.esMsgWsWrapper){const r=this.webRtcController.sendMessageController.dataChannelSender.sendData;this.webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData=function(s){n.esMsgWsWrapper?n.esMsgWsWrapper.sendInputData(s):r.call(this,s)}}this.pixelStream.addEventListener("videoInitialized",()=>{console.log("%c[EarthSDK webrtc videoInitialized]","background: #a6ec99; color: black","videoInitialized"),this.dispatchEvent(new CustomEvent("videoinited",{detail:"videoinited"}))}),this.pixelStream.addEventListener("webRtcFailed",()=>{this.isDestroyed()||(console.log("%c[EarthSDK webRtc webRtcFailed]","background: red; color: black","webRtcFailed"),this.dispatchEvent(new CustomEvent("error",{detail:"webRtcFailed"})),this.pixelStream.disconnect())}),this.pixelStream.addEventListener("webRtcDisconnected",()=>{this.isDestroyed()||(console.log("%c[EarthSDK webRtc webRtcDisconnected]","background: red; color: black","webRtcDisconnected"),this.dispatchEvent(new CustomEvent("error",{detail:"webRtcDisconnected"})),this.pixelStream.disconnect())}),this.pixelStream.addEventListener("webRtcConnected",()=>{this.isDestroyed()||(console.log("%c[EarthSDK webrtc webRtcConnected]","background: #a6ec99; color: black","webRtcConnected"),this.dispatchEvent(new CustomEvent("webRtcConnected",{detail:"webRtcConnected"})))}),this.pixelStream.addResponseEventListener("esueviewer",r=>{this.processResponse(r)}),this.dispose(()=>{this._options.createUI||this.container.removeChild(this.webRtcController.videoPlayer.getVideoElement()),this.pixelStream.disconnect(),this.pixelStream.removeResponseEventListener("esueviewer")})}get eventTarget(){return this._eventTarget}addEventListener(t,i,n){return this.eventTarget.addEventListener(t,i,n)}removeEventListener(t,i,n){return this.eventTarget.removeEventListener(t,i,n)}dispatchEvent(t){return this.eventTarget.dispatchEvent(t)}get container(){return this._container}get pixelStream(){return this._pixelStream}get esMsgWsWrapper(){return this._esMsgWsWrapper}get esWebSocketReady(){var t;return((t=this.esMsgWsWrapper)==null?void 0:t.inner.readyState)===1}resolveCallback(t){let i={};try{i=JSON.parse(t)}catch{return!1}let n=i.callid;if(typeof n!="string"||!this.uiInteractionCallbacks.has(n))return!1;let r=this.uiInteractionCallbacks.get(n);return typeof r!="function"?!1:(r(i),this.uiInteractionCallbacks.delete(n),!0)}processResponse(t){if(this.debug??!1)try{const i=JSON.parse(t);if(i.ers=i.ers&&i.ers.filter(n=>n.et!=="mouseMoveEvent"),!(i.ers&&i.ers.length>0||i.frs&&i.frs.length>0))return;console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(i,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()}catch(i){console.error(`processResponse(${t}) error: ${i}`,i)}this.resolveCallback(t)||this.dispatchEvent(new CustomEvent("ueevent",{detail:t}))}emitUIInteraction(t,i){typeof i=="function"&&(t.callid=a.createGuid(),this.uiInteractionCallbacks.set(t.callid,i)),this.pixelStream.emitUIInteraction(t)}get webRtcController(){return this.pixelStream._webRtcController}_pixelStreamEmitUIInteractionAsString(t){this.webRtcController.streamMessageController.toStreamerHandlers.get("UIInteraction")([t])}emitUIInteractionForBigData(t,i){typeof i=="function"&&(t.callid=a.createGuid(),this.uiInteractionCallbacks.set(t.callid,i));const n=JSON.stringify(t),r=window.g_emitDescriptor_maxBytes,s=n.length,o=++Bn;if(this.esMsgWsWrapper){if(s<r){this.esMsgWsWrapper.emitDescriptorWithString(oe.UIInteraction,`${o}-0/1-`+n);return}const v=Math.ceil(s/r)|0;[...new Array(v).keys()].map(w=>n.slice(w*r,(w+1)*r)).forEach((w,y)=>{this.esMsgWsWrapper&&this.esMsgWsWrapper.emitDescriptorWithString(oe.UIInteraction,`${o}-${y}/${v}-`+w)})}}emitCommand(t){this.pixelStream.emitCommand(t)}getVideoSize(){const t=this.webRtcController.videoPlayer.getVideoElement();return{width:t.videoWidth,height:t.videoHeight}}resizeUEVideo(t,i){let n={Resolution:{Width:t,Height:i}};console.log(`resizeUEVideo emitCommand ${t} ${i} begin`),this.emitCommand(n)}}class Vn extends a.Destroyable{constructor(t,i,n){super();g(this,"_instance",this.disposeVar(new Kn(this._container,{url:this._wsuri,esmsgWsUri:this._esmsgWsUri})));g(this,"_event",this.disposeVar(new a.Event));if(this._container=t,this._wsuri=i,this._esmsgWsUri=n,"addEventListener"in this._instance){["esmsgwsopen","error","videoinited","ueevent","webRtcConnected"].forEach(s=>{const o=v=>{this._event.emit(s,v.detail)};this._instance.addEventListener(s,o),this.dispose(()=>this._instance.removeEventListener(s,o))});return}this.dispose(this._instance.errorEvent.disposableOn(r=>{this._event.emit("error",r.detail)})),this.dispose(this._instance.webRtcConnectedEvent.disposableOn(r=>{this._event.emit("webRtcConnected",r.detail)})),this.dispose(this._instance.videoinitedEvent.disposableOn(r=>{this._event.emit("videoinited",r.detail)})),this.dispose(this._instance.ueevent.disposableOn(r=>{this._event.emit("ueevent",r.detail)}))}get webSocketReady(){return this._instance.esWebSocketReady}get event(){return this._event}get debug(){return this._instance.debug}set debug(t){this._instance.debug=t}emitUIInteractionForBigData(t,i){return new Promise((n,r)=>{const s=(...o)=>{n(o),i&&i(...o)};try{this._instance.emitUIInteractionForBigData(t,s)}catch(o){console.warn(`emitUIInteraction发生错误:${o}`),r(o)}})}getVideoSize(){return this._instance.getVideoSize()}resize(t,i){this._instance.resizeUEVideo(t,i)}}const B=async(u,e,t,i,n,r="default")=>{const s=await u.callUeFunc({f:"flyTo",p:{id:e,duration:t,flyToParam:i,position:n,flyMode:r}});if(s.error){console.error(s.error);return}return s.re},we=async(u,e)=>{const t=await u.callUeFunc({f:"destroy",p:{id:e}});return t.error&&console.error(t.error),t},K=(u,e)=>{u.callUeFunc({f:"calcFlyToParam",p:{id:e}}).then(t=>{t.error&&console.error("calcFlyToParam:",t.error)}).catch(t=>{console.error("calcFlyToParam:",t)})},$i=(u,e)=>{u.callUeFunc({f:"refreshTileset",p:{id:e}}).then(t=>{t.error&&console.error("refreshTileset:",t.error)}).catch(t=>{console.error("refreshTileset:",t)})},Q=async(u,e,t,i,n,r="default")=>{const s=await u.callUeFunc({f:"flyIn",p:{id:e,position:t,rotation:i,duration:n,flyMode:r}});if(s.error){console.error(s.error);return}return s.re},_i=async(u,e)=>{if(!u){console.warn("DefaultCameraFlyIn: viewer is undefined");return}const t=await u.callUeFunc({f:"DefaultCameraFlyIn",p:{Duration:e??1}});if(t.error){console.error("DefaultCameraFlyIn:",t.error);return}return t},Ni=async u=>{if(!u){console.warn("StartVoice:viewer is undefined");return}const e=await u.callUeFunc({f:"StartVoice",p:{}});if(e.error){console.error("StartVoice:",e.error);return}return e},zi=async u=>{if(!u){console.warn("StopVoice:viewer is undefined");return}const e=await u.callUeFunc({f:"StopVoice",p:{}});if(e.error){console.error("StopVoice:",e.error);return}return e},Hi=async(u,e)=>{if(!u){console.warn("mountPakFiles:viewer is undefined");return}const t=await u.callUeFunc({f:"MountPakFiles",p:{json:e}});if(t.error){console.error("mountPakFiles:",t.error);return}return t},Gi=async u=>{if(!u){console.warn("generateMemReport:viewer is undefined");return}const e=await u.callUeFunc({f:"GenerateMemReport",p:{}});if(e.error){console.error("generateMemReport:",e.error);return}return e},ye=async(u,e)=>{const t=await u.callUeFunc({f:"resetWithCurrentCamera",p:{id:e}});return t.error&&console.error("resetWithCurrentCamera:",t.error),t},ae=(u,e,t,i,n)=>{u.callUeFunc({f:"smoothMoveWithRotation",p:{id:e,Destination:t,NewRotation:i,Time:n}}).then(r=>{r.error&&console.error("smoothMoveWithRotation:",r.error)}).catch(r=>{console.error("smoothMoveWithRotation:",r)})},le=(u,e,t,i,n,r)=>{u.callUeFunc({f:"smoothMoveOnGround",p:{id:e,Lon:t,Lat:i,Ground:n,Time:r}}).then(s=>{s.error&&console.error("smoothMoveOnGround:",s.error)}).catch(s=>{console.error("smoothMoveOnGround:",s)})},de=(u,e,t,i,n,r,s)=>{u.callUeFunc({f:"smoothMoveWithRotationOnGround",p:{id:e,NewRotation:t,Lon:i,Lat:n,Time:r,Ground:s}}).then(o=>{o.error&&console.error("smoothMoveWithRotationOnGround:",o.error)}).catch(o=>{console.error("smoothMoveWithRotationOnGround:",o)})},Ji=(u,e,t)=>{u.callUeFunc({f:"HighlightFeature",p:{id:e,HlId:t}}).then(i=>{i.error&&console.error("HighlightFeature:",i.error)}).catch(i=>{console.error("HighlightFeature:",i)})},Bi=(u,e,t,i)=>{u.callUeFunc({f:"HighlightFeatureAndFlyTo",p:{id:e,HlId:t,Duration:i}}).then(n=>{n.error&&console.error("HighlightFeatureAndFlyTo:",n.error)}).catch(n=>{console.error("HighlightFeatureAndFlyTo:",n)})},Ki=(u,e,t)=>{u.callUeFunc({f:"SetLayerVisible",p:{id:e,LayerJson:t}}).then(i=>{i.error&&console.error("SetLayerVisible:",i.error)}).catch(i=>{console.error("SetLayerVisible:",i)})},Vi=(u,e,t)=>{u.callUeFunc({f:"SetLayerColor",p:{id:e,LayerJson:t}}).then(i=>{i.error&&console.error("SetLayerColor:",i.error)}).catch(i=>{console.error("SetLayerColor:",i)})},ce=(u,e,t,i)=>{u.callUeFunc({f:"smoothMove",p:{id:e,Destination:t,Time:i}}).then(n=>{n.error&&console.error("smoothMove:",n.error)}).catch(n=>{console.error("smoothMove:",n)})},me=(u,e,t,i)=>{u.callUeFunc({f:"callFunction",p:{id:e,fn:t,p:i}}).then(n=>{n.error&&(console.error("callFunction:",n.error),console.error(`id: ${e} fn: ${t} param: ${i}`))}).catch(n=>{console.error("callFunction:",n),console.error(`id: ${e} fn: ${t} param: ${i}`)})},qi=(u,e,t,i)=>{u.callUeFunc({f:"SetNodePosition",p:{id:e,NodeName:t,NodePosition:i}}).then(n=>{n.error&&console.error("SetNodePosition:",n.error)}).catch(n=>{console.error("SetNodePosition:",n)})},Xi=(u,e,t,i)=>{u.callUeFunc({f:"SetNodeRotation",p:{id:e,NodeName:t,NodeRotation:i}}).then(n=>{n.error&&console.error("SetNodeRotation:",n.error)}).catch(n=>{console.error("SetNodeRotation:",n)})},Qi=(u,e,t,i)=>{u.callUeFunc({f:"SetNodeScale",p:{id:e,NodeName:t,NodeScale:i}}).then(n=>{n.error&&console.error("SetNodeScale:",n.error)}).catch(n=>{console.error("SetNodeScale:",n)})},M=async(u,e)=>{const t=await u.callUeFunc({f:"ChangeNavigationMode",p:e});if(t.error){console.error("ChangeNavigationMode:",t.error);return}return t},Yi=async(u,e)=>{const t=await u.callUeFunc({f:"setGlobalProperty",p:e});if(t.error){console.error("setGlobalProperty:",t.error);return}return t},Zi=async u=>{const e=await u.callUeFunc({f:"Quit",p:void 0});if(e.error){console.error("Quit:",e.error);return}return e},bi=async(u,e,t,i)=>{console.log("pickCallFunc",e,t,i);const n=await u.callUeFunc({f:"pick",p:{screenPosition:e,parentInfo:i}});if(!n.re&&(n.error||n.error=="")){console.error("pick:",n.error==""?"未获取到结果":n.error);return}let r=n.re.id;const s=r?c.ESSceneObject.getSceneObject(r):void 0;return s&&Reflect.has(s,"allowPicking")&&Reflect.has(s,"pickedEvent")&&(s.allowPicking??!1)&&s.pickedEvent.emit({attachedInfo:t}),s&&Reflect.has(s,"allowPicking")&&!s.allowPicking?new c.PickedResult:new c.PickedResult(n.re,s,n.re.features,n.re.add,t)},xi=async(u,e)=>{const t=await u.callUeFunc({f:"pickPosition",p:{screenPosition:e}});if(!t.re&&(t.error||t.error=="")){console.error("pickPosition",t.error==""?"未获取到结果":t.error);return}const{position:i}=t.re;return i},Oi=async(u,e,t,i="ECC_Visibility")=>{const n=await u.callUeFunc({f:"GetHeightByLonLat",p:{Lon:e,Lat:t,Channel:i}});if(n.error){console.warn(`GetHeightByLonLat:${n.error}`);return}return n.re},ji=async(u,e,t="ECC_Visibility")=>{const i=await u.callUeFunc({f:"GetHeightsByLonLats",p:{LonLats:e,Channel:t}});if(i.error){console.warn(`GetHeightsByLonLats:${i.error}`);return}i.re.heights.includes(null)&&console.warn("注意! GetHeightsByLonLats: 存在高度为null的点. there are points with a height of null");try{return i.re.heights}catch{return}},tn=async(u,e=64,t=64)=>{const i=await u.callUeFunc({f:"capture",p:{resx:e,resy:t}});if(i.error){console.warn(i.error);return}return i.re.image},en=async(u,e,t=[64,64])=>{const i=await u.callUeFunc({f:"partialCapture",p:{startPos:e,size:t}});if(i.error){console.warn(i.error);return}return i.re.image},nn=async(u,e)=>{const t=await u.callUeFunc({f:"LonLatAltToScreenPosition",p:{LonLatAlt:e}});return t.error&&console.warn(t.error),t.re},rn=async(u,e)=>{const t=await u.callUeFunc({f:"UEPositionToLonLatAlt",p:{UEPosition:e}});if(t.error){console.warn(t.error);return}return[...t.re.LonLatAlt]},sn=async(u,e)=>{const t=await u.callUeFunc({f:"GetAllSocketNamesByActorTag",p:{ActorTag:e}});if(t.error){console.warn(t.error);return}return[...t.re.socketNames]},on=async u=>{const e=await u.callUeFunc({f:"GetVersion",p:void 0});if(e.error){console.warn("GetVersion:",e.error);return}return e.re.version},an=async(u,e)=>{const t=await u.callUeFunc({f:"GetBoundSphere",p:{id:e}});if(t.error){console.warn(t.error);return}return t.re},ln=async(u,e)=>{const t=await u.callUeFunc({f:"GetBoundSphereWithChildren",p:{id:e}});if(t.error){console.warn(`GetBoundSphereWithChildren:${t.error}`);return}return t.re},dn=async(u,e)=>{const t=await u.callUeFunc({f:"GetStrokeMaterialParamInfo",p:{id:e}});if(t.error){console.warn(`GetStrokeMaterialParamInfo:${t.error}`);return}return t.re},cn=async(u,e)=>{const t=await u.callUeFunc({f:"GetFillMaterialParamInfo",p:{id:e}});if(t.error){console.warn(`GetFillMaterialParamInfo:${t.error}`);return}return t.re},un=async(u,e)=>{const t=await u.callUeFunc({f:"getGlobalProperty",p:{props:e}});if(t.error){console.warn(`getGlobalProperty:${t.error}`);return}return t.re},hn=async(u,e)=>{const t=await u.callUeFunc({f:"GetObjectByInfo",p:{info:e}});if(t.error){console.warn(`GetObjectByInfo:${t.error}`);return}return t.re},vn=async(u,e,t)=>await u.callUeFunc({f:"BindActorByTag",p:{ID:e,ActorTag:t}}),gn=async u=>await u.callUeFunc({f:"RestoreOriginalScene",p:void 0}),fn=async(u,e)=>await u.callUeFunc({f:"UnBindActorByID",p:{ID:e}}),pn=async(u,e)=>await u.callUeFunc({f:"UnBindActorByTag",p:{ActorTag:e}}),wn=async(u,e,t)=>await u.callUeFunc({f:"CreateActorByClass",p:{ID:e,ActorClass:t}}),yn=async function(u,e,t){return await u.callUeFunc({f:"Bind3DTilesetByTag",p:{ID:e,ActorTag:t}})},mn=async function(u,e){return await u.callUeFunc({f:"UnBind3DTilesetByTag",p:{ActorTag:e}})},Cn=async function(u,e){return await u.callUeFunc({f:"UnBind3DTilesetById",p:{ID:e}})},En=async function(u,e,t,i){return await u.callUeFunc({f:"BindImageryByTag",p:{ID:e,ActorTag:t,ComponentTag:i}})},Fn=async function(u,e,t){return await u.callUeFunc({f:"UnBindImageryByTag",p:{ActorTag:e,ComponentTag:t}})},Sn=async function(u,e){return await u.callUeFunc({f:"UnBindImageryById",p:{ID:e}})},In=async function(u,e,t,i){return await u.callUeFunc({f:"GetIdByComponentNameAndHitItem",p:{id:e,ComponentName:t,HitItem:i}})},Tn=async function(u,e="ECC_Visibility"){return await u.callUeFunc({f:"GetCameraRelativeHeight",p:{Channel:e}})},Rn=async function(u,e,t,i){const n=await u.callUeFunc({f:"SaveStringToFile",p:{String:e,Path:t??"undefine",File:i??"data.txt"}});return n.error!==""&&console.warn("SaveStringToFile: ",n.error),n},Dn=async function(u,e,t=!0){const i=await u.callUeFunc({f:"HighlightActorByTag",p:{ActorTag:e,Highlight:t}});return i.error!==""&&console.warn("HighlightActorByTag: ",i.error),i},kn=async function(u,e){const t=await u.callUeFunc({f:"SendCustomMessage",p:{Message:e}});return t.error!==""&&console.warn("SendCustomMessage: ",t.error),t},Ln=async function(u){const e=await u.callUeFunc({f:"GetStatus",p:void 0});if(e.error){console.warn(`GetStatus:${e.error}`);return}return e.re},Pn=async(u,e,t,i,n=!0)=>{const r=await u.callUeFunc({f:"startEditing",p:{sceneObjectID:e,editingID:t,modes:i,useKeyToSwitch:n}});if(r.error){console.error("startEditing:",r.error);return}return r},Un=async u=>{const e=await u.callUeFunc({f:"stopEditing",p:void 0});if(e.error){console.error("stopEditing:",e.error);return}return e},Mn=async(u,e,t)=>{const i=await u.callUeFunc({f:"moveObjects",p:{sceneObjectIDs:e,editingID:t}});if(i.error){console.error("moveObjects:",i.error);return}return i},An=async u=>{const e=await u.callUeFunc({f:"GetTilesetMaterialIDList",p:void 0});if(e.error){console.error("GetTilesetMaterialIDList:",e.error);return}return e.re.materialIDList};class Y extends a.Destroyable{}class qn extends c.PickedInfo{constructor(e,t,i){super(t),this.uePickResult=e,this.tilesetPickInfo=i}}class Xn extends Y{constructor(t,i,n,r){super();g(this,"_esueViewerWrapper");g(this,"_ueFuncResultWithIdsEvent",this.dv(new a.Event));g(this,"_ueFuncWithIdAndResultCallbacks",[]);g(this,"_waitingUeFuncIdAndResultCallbacks",new Map);g(this,"_waitingUeCalls",new Set);g(this,"_ueEvent",this.dv(new a.Event));g(this,"_errorEvent",this.dv(new a.Event));g(this,"_readyEvent",this.dv(new a.Event));g(this,"_esmsgwsopen",this.dv(a.react(!1)));g(this,"_videoinited",this.dv(a.react(!1)));g(this,"_webRtcConnected",this.dv(a.react(!1)));this._ueViewer=r,console.log("CSTMPSViewer init ! 以官方像素流 + 独立通信的模式启动!");const s=this._ueViewer;this._esueViewerWrapper=this.dv(new Vn(t,i,n));const o=this._esueViewerWrapper;{const p=()=>o.debug=s.debug??!1;p(),this.d(s.debugChanged.don(p))}let v=!1;{const p=()=>{if(v)return;const h=o.webSocketReady;if(this.videoinited&&this.webRtcConnected&&h){console.log("%c[EarthSDK: esmsgWebSocket && videoinited && webRtcConnected]","background: #a6ec99; color: black");const m={eventType:"init",params:{}};o.emitUIInteractionForBigData(m),this._readyEvent.emit(),v=!0}};this.d(this.videoinitedChanged.don(()=>{p()})),this.d(this.webRtcConnectedChanged.don(()=>{p()})),this.d(this.esmsgwsopenChanged.don(()=>{p()}))}this.d(o.event.don((p,h)=>{if(p==="error")this._errorEvent.emit(h);else if(p==="ueevent"){const m=JSON.parse(h);if(m.t==="cr"){const C=m;if(C.frs&&this._ueFuncResultWithIdsEvent.emit(C.frs),C.ers)for(let E of C.ers)this._ueEvent.emit(E)}}else p==="webRtcConnected"?this.webRtcConnected=!0:p==="videoinited"?this.videoinited=!0:p==="esmsgwsopen"&&(this.esmsgwsopen=!0)}));{const p=this.dv(a.createAnimateFrame());let h,m;p.start(()=>{if(h!==t.offsetWidth||m!==t.offsetHeight){if(h=t.offsetWidth,m=t.offsetHeight,h===void 0||m===void 0||!Number.isFinite(h)||!Number.isFinite(m)||h<0||m<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${h} ${m}`);return}o.resize(h,m),console.log(`resize: ${h} ${m}`)}})}this.d(this._ueFuncResultWithIdsEvent.don(p=>{for(const h of p){const m=this._waitingUeFuncIdAndResultCallbacks.get(h.fid);m&&(this._waitingUeFuncIdAndResultCallbacks.delete(h.fid),m.resultCallback(h.r))}}));let d=0;const w=p=>{const h={n:d++,tt:Date.now(),t:"c",fs:p};this._waitingUeCalls.add(h),s.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(h,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd()),this._esueViewerWrapper.emitUIInteractionForBigData(h,()=>{this._waitingUeCalls.delete(h)})},y=()=>{if(!v||this._ueFuncWithIdAndResultCallbacks.length===0)return;const p=this._ueFuncWithIdAndResultCallbacks.map(([h])=>h);for(const[h,m]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(h.fid,m);this._ueFuncWithIdAndResultCallbacks.length=0;{const h=window.g_emitDescriptor_maxBytes,m=p.map(R=>({f:R,s:JSON.stringify(R).length}));let C=m.length,E=0,I=0,F=[];do{do{const{f:R,s:T}=m[E];if(F.push(R),++E,I+T>h||F.length>=20)break}while(E<C);F.length>0&&(s.debug&&console.log(`传送${F.length}条消息...`),w([...F]),F.length=0,I=0)}while(E<C)}};this.dv(a.createInterval()).start(y,50),this.d(()=>console.log("UeCloudViewer正在销毁..."))}get esueViewerWrapper(){return this._esueViewerWrapper}get errorEvent(){return this._errorEvent}get readyEvent(){return this._readyEvent}get esmsgwsopen(){return this._esmsgwsopen.value}set esmsgwsopen(t){this._esmsgwsopen.value=t}get esmsgwsopenChanged(){return this._esmsgwsopen.changed}get videoinited(){return this._videoinited.value}set videoinited(t){this._videoinited.value=t}get videoinitedChanged(){return this._videoinited.changed}get webRtcConnected(){return this._webRtcConnected.value}set webRtcConnected(t){this._webRtcConnected.value=t}get webRtcConnectedChanged(){return this._webRtcConnected.changed}resize(t,i){this.esueViewerWrapper.resize(t,i)}callUeFunc(t){return new Promise(i=>{const r={fid:a.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,{timeStamp:Date.now(),ueFunc:t,resultCallback:i}])})}disposableOnUeEvent(t,i){(this._ueViewer.debug??!1)&&console.log(`disposableOnUeEvent from UeCloudViewer, type:${t}`);const n=a.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},s=this._ueEvent.don(o=>{o.et===t&&o.eid===n&&i(o)});return()=>{s(),r()}}}function Qn(u){let e="";const t=new Uint8Array(u),i=t.length;for(let n=0;n<i;n++)e+=String.fromCharCode(t[n]);return btoa(e)}const Yn=u=>{const e={type:"input",inputdata:Qn(u)};return JSON.stringify(e)};function Zn(u){return typeof u=="string"?document.getElementById(u):u}window.g_emitDescriptor_maxBytes=3e4,console.log("全局可设置消息体最大字节, window.g_emitDescriptor_maxBytes 默认 30000 。");let bn=-1;D.Logger.SetLoggerVerbosity(1);class xn extends a.Destroyable{constructor(t,i){super();g(this,"debug",!1);g(this,"_error",this.dv(new a.Event));g(this,"_connected",this.dv(new a.Event));g(this,"_ueevent",this.dv(new a.Event));g(this,"_pixelStream");g(this,"uiInteractionCallbacks",new Map);this._container=t,this._option=i;const n=new D.Config({initialSettings:{HoveringMouse:!0,AutoPlayVideo:!0,AutoConnect:!0,StartVideoMuted:!0,WaitForStreamer:!0,SuppressBrowserKeys:!1,ss:this._option.ws},useUrlParams:!0});n.setFlagEnabled(D.Flags.BrowserSendOffer,!1),n.setFlagEnabled(D.Flags.HoveringMouseMode,!0),n.setFlagEnabled(D.Flags.MatchViewportResolution,!0),n.setNumericSetting(D.NumericParameters.MaxReconnectAttempts,0),this._pixelStream=new D.PixelStreaming(n,{videoElementParent:this.container});{const r=this.pixelStream.webSocketController.webSocket,s=this._pixelStream._webRtcController.sendMessageController.dataChannelSender.sendData;this._pixelStream._webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData=function(o){r?r.send(Yn(o)):s.call(this,o)}}{const r=s=>{const o=this._pixelStream._webRtcController.mouseController;setTimeout(()=>{const v=o.coordinateConverter.normalizeAndQuantizeUnsigned(s.offsetX,s.offsetY),w=o.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp");w&&w([s.button,v.x,v.y]),s.preventDefault()})};this.container.addEventListener("dblclick",r),this.d(()=>{this.container.removeEventListener("dblclick",r)})}["error","close","open"].forEach(s=>{const o=()=>{this.isDestroyed()||(s==="open"?this.connected.emit("webSocketOpen"):s==="close"?this.error.emit("webSocketClose"):s==="error"&&this.error.emit("webSocketError"))};this.pixelStream.webSocketController.webSocket.addEventListener(s,o),this.d(()=>{this.pixelStream.webSocketController.webSocket.removeEventListener(s,o)})}),["videoInitialized","webRtcConnected","webRtcDisconnected","webRtcFailed"].forEach(s=>{const o=()=>{this.isDestroyed()||(s==="webRtcConnected"||s==="videoInitialized"?this.connected.emit(s):(s==="webRtcDisconnected"||s==="webRtcFailed")&&(this.error.emit(s),this.pixelStream.disconnect()))};this.pixelStream.addEventListener(s,o),this.d(()=>{this.pixelStream.removeEventListener(s,o)})}),this.pixelStream.addResponseEventListener("handle_responses",r=>{this.processResponse(r)}),this.d(()=>{this.pixelStream.removeResponseEventListener("handle_responses")})}get error(){return this._error}get connected(){return this._connected}get ueevent(){return this._ueevent}get container(){return Zn(this._container)}get pixelStream(){return this._pixelStream}get webSocketReady(){return this.pixelStream.webSocketController.webSocket.readyState===1}processResponse(t){if(this.debug??!1)try{const i=JSON.parse(t);console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(i,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()}catch(i){console.error(`processResponse(${t}) error: ${i}`,i)}this.resolveCallback(t)||this.ueevent.emit(t)}emitUIInteractionForBigData(t,i){typeof i=="function"&&(t.callid=a.createGuid(),this.uiInteractionCallbacks.set(t.callid,i));const n=JSON.stringify(t),r=window.g_emitDescriptor_maxBytes??3e4,s=n.length,o=++bn;if(s<r){const w={type:"earthsdk",time:new Date().getTime(),params:`${o}-0/1-`+n};this.sendData(JSON.stringify(w));return}const v=Math.ceil(s/r)|0;[...new Array(v).keys()].map(w=>n.slice(w*r,(w+1)*r)).forEach((w,y)=>{const l={type:"earthsdk",time:new Date().getTime(),params:`${o}-${y}/${v}-`+w};this.sendData(JSON.stringify(l))})}sendData(t){this.pixelStream.webSocketController.webSocket.send(t)}resolveCallback(t){let i={};try{i=JSON.parse(t)}catch{return!1}let n=i.callid;if(typeof n!="string"||!this.uiInteractionCallbacks.has(n))return!1;let r=this.uiInteractionCallbacks.get(n);return typeof r!="function"?!1:(r(i),this.uiInteractionCallbacks.delete(n),!0)}getVideoSize(){const t=this._pixelStream._webRtcController.videoPlayer.getVideoElement();return{width:t.videoWidth,height:t.videoHeight}}emitCommand(t){this.pixelStream.emitCommand(t)}emitUIInteraction(){console.log("emitUIInteraction 像素流初始化"),this.pixelStream.emitUIInteraction("像素流初始化")}resizeUEVideo(t,i){const n={Resolution:{Width:t,Height:i}};console.log(`resizeUEVideo emitCommand ${t} ${i} begin`),this.emitCommand(n)}}class On extends a.Destroyable{constructor(t,i,n){super();g(this,"_instance");g(this,"_event",this.dv(new a.Event));this._container=t,this._wsuri=i,this._esmsgWsUri=n,this._instance=this.dv(new xn(this._container,{ws:this._wsuri})),this.d(this._instance.connected.don(r=>{this._event.emit(r,r),console.log(`%c[EarthSDK] ${r}`,"background: #a6ec99; color: black")})),this.d(this._instance.error.don(r=>{this._event.emit("errorEvent",r),console.log(`%c[EarthSDK] ${r}`,"background: red; color: black")})),this.d(this._instance.ueevent.don(r=>{this._event.emit("ueevent",r)}))}get instance(){return this._instance}get event(){return this._event}get debug(){return this._instance.debug}set debug(t){this._instance.debug=t}emitUIInteractionForBigData(t,i){return new Promise((n,r)=>{const s=(...o)=>{n(o),i&&i(...o)};try{this._instance.emitUIInteractionForBigData(t,s)}catch(o){console.warn(`emitUIInteraction发生错误:${o}`),r(o)}})}getVideoSize(){return this._instance.getVideoSize()}resize(t,i){this._instance.resizeUEVideo(t,i)}}class jn extends Y{constructor(t,i,n,r){super();g(this,"_videoInitialized",this.dv(a.react(!1)));g(this,"_webRtcConnected",this.dv(a.react(!1)));g(this,"_webSocketOpen",this.dv(a.react(!1)));g(this,"_ue5ViewerWrapper");g(this,"_ueFuncResultWithIdsEvent",this.dv(new a.Event));g(this,"_ueFuncWithIdAndResultCallbacks",[]);g(this,"_waitingUeFuncIdAndResultCallbacks",new Map);g(this,"_waitingUeCalls",new Set);g(this,"_ueEvent",this.dv(new a.Event));g(this,"_errorEvent",this.dv(new a.Event));g(this,"_readyEvent",this.dv(new a.Event));this._ueViewer=r,console.log("INNPSViewer init ! 以内置信令服务器模式启动!");const s=this._ueViewer,o=this.dv(new On(t,i,n));this._ue5ViewerWrapper=o;{const l=()=>o.debug=s.debug??!1;l(),this.d(s.debugChanged.don(l))}{let l=!1;const p=this.dv(a.createNextAnimateFrameEvent(this._videoInitialized.changed,this._webRtcConnected.changed,this._webSocketOpen.changed));this.d(p.don(()=>{if(l)return;const h=this._ue5ViewerWrapper.instance.webSocketReady;if(this.videoInitialized&&this.webRtcConnected&&h){this._ue5ViewerWrapper.instance.emitUIInteraction(),this._readyEvent.emit(),l=!0,console.log("%c[EarthSDK videoInitialized && webRtcConnected && webSocketReady]","background: #a6ec99; color: black");const m={eventType:"init",params:{}};this._ue5ViewerWrapper.emitUIInteractionForBigData(m)}else console.warn("webSocketReady",h),l=!1}))}this.d(o.event.don((l,p)=>{if(l==="errorEvent")this._errorEvent.emit(p);else if(l==="videoInitialized")this._videoInitialized.value=!0;else if(l==="webRtcConnected")this._webRtcConnected.value=!0;else if(l==="webSocketOpen")this._webSocketOpen.value=!0;else if(l==="ueevent"){const h=JSON.parse(p);if(h.t==="cr"){const m=h;if(m.frs&&this._ueFuncResultWithIdsEvent.emit(m.frs),m.ers)for(let C of m.ers)this._ueEvent.emit(C)}}}));{const l=this.dv(a.createAnimateFrame());let p,h,m;l.start(()=>{if(p!==t.offsetWidth||h!==t.offsetHeight||m!==s.resolutionScale){if(p=t.offsetWidth,h=t.offsetHeight,p===void 0||h===void 0||!Number.isFinite(p)||!Number.isFinite(h)||p<0||h<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${p} ${h}`);return}m=s.resolutionScale,o.resize(p/m,h/m)}})}this.d(this._ueFuncResultWithIdsEvent.don(l=>{for(const p of l){const h=this._waitingUeFuncIdAndResultCallbacks.get(p.fid);h&&(this._waitingUeFuncIdAndResultCallbacks.delete(p.fid),h.resultCallback(p.r))}}));let v=0;const d=l=>{const p={n:v++,tt:Date.now(),t:"c",fs:l};this._waitingUeCalls.add(p),s.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(p,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd()),this._ue5ViewerWrapper.emitUIInteractionForBigData(p,()=>{this._waitingUeCalls.delete(p)})},w=()=>{if(!this._ue5ViewerWrapper.instance.webSocketReady||this._ueFuncWithIdAndResultCallbacks.length===0)return;const p=this._ueFuncWithIdAndResultCallbacks.map(([h])=>h);for(const[h,m]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(h.fid,m);this._ueFuncWithIdAndResultCallbacks.length=0;{const h=window.g_emitDescriptor_maxBytes,m=p.map(R=>({f:R,s:JSON.stringify(R).length}));let C=m.length,E=0,I=0,F=[];do{do{const{f:R,s:T}=m[E];if(F.push(R),++E,I+T>h||F.length>=20)break}while(E<C);F.length>0&&(s.debug&&console.log(`传送${F.length}条消息...`),d([...F]),F.length=0,I=0)}while(E<C)}};this.dv(a.createInterval()).start(w,50),this.d(()=>console.log("UeCloudViewer正在销毁..."))}get videoInitialized(){return this._videoInitialized.value}get webRtcConnected(){return this._webRtcConnected.value}get webSocketOpen(){return this._webSocketOpen.value}get ue5ViewerWrapper(){return this._ue5ViewerWrapper}get errorEvent(){return this._errorEvent}get readyEvent(){return this._readyEvent}resize(t,i){this.ue5ViewerWrapper.resize(t,i)}callUeFunc(t){return new Promise(i=>{const r={fid:a.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,{timeStamp:Date.now(),ueFunc:t,resultCallback:i}])})}disposableOnUeEvent(t,i){const n=a.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},s=this._ueEvent.don(o=>{o.et===t&&o.eid===n&&i(o)});return()=>{s(),r()}}}class tr extends a.Destroyable{constructor(t,i,n,r){super();g(this,"_onRuntimeInitialized",this.dv(new a.Event));g(this,"_vIframe",null);this._ueViewer=r;const s=this._ueViewer;{const o=document.createElement("iframe");this._vIframe=o,o.style.cssText="width: 100%; height: 100%; margin: 0; padding: 0; border: none; outline: none;",t.appendChild(o),this.d(()=>{o&&t.removeChild(o)});const v=c.ESSceneObject.getStrFromEnv(n+`/web/${i}.html`);o.src=v,o.onload=()=>{const d=o.contentWindow;if(!d){console.error("iframeWindow is null");return}console.log("iwindow.Module",d.Module),d.Module.onRuntimeInitialized=()=>{this._onRuntimeInitialized.emit(),s.setStatus("Created"),s.setStatusLog("创建成功"),d.Module.UE4_resizeCanvas(),d.console.log("创建成功__________________________________________")}}}}get onRuntimeInitialized(){return this._onRuntimeInitialized}get vIframe(){return this._vIframe}}const Wn=typeof TextDecoder<"u"?new TextDecoder:void 0,er=(u,e=0,t=NaN)=>{const i=e+t;let n=e;for(;u[n]&&!(n>=i);)++n;if(n-e>16&&u.buffer&&Wn)return Wn.decode(u.subarray(e,n));let r="";for(;e<n;){var s=u[e++];if(!(s&128)){r+=String.fromCharCode(s);continue}var o=u[e++]&63;if((s&224)==192){r+=String.fromCharCode((s&31)<<6|o);continue}var v=u[e++]&63;if((s&240)==224?s=(s&15)<<12|o<<6|v:((s&248)!=240&&console.warn("Invalid UTF-8 leading byte encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),s=(s&7)<<18|o<<12|v<<6|u[e++]&63),s<65536)r+=String.fromCharCode(s);else{var d=s-65536;r+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return r};class ir extends a.Destroyable{constructor(e,t,i){super();{const n=()=>{const v=pe(t);t.setGlobalProperty(v)};n();const r=se(),s=[];r.forEach(v=>{const d=t[v+"Changed"];s.push(d)});const o=this.dv(a.createNextAnimateFrameEvent(...s));this.d(o.don(n))}this.d(t.propChanged.don(n=>{if(n.objId==="")try{Object.keys(n.props).forEach(r=>{const s=n.props[r]===null?void 0:n.props[r];t[r]=s})}catch(r){console.error("ueViewer propChanged:"+r)}})),t.useCustomInteraction=!1,this.dv(new c.ViewerCustomInteraction(t,e)),this.dv(new a.ObjResettingWithEvent(t.statusUpdateIntervalChanged,n=>{if((t.statusUpdateInterval??.5)===0)return;const s=new a.Destroyable;return s.d(i.disposableOnUeEvent("statusUpdate",o=>{t.statusUpdateEvent.emit(o)})),s})),this.dv(new a.ObjResettingWithEvent(t.propChangedListeningChanged,()=>{if(!(t.propChangedListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("propChanged",s=>{t.propChanged.emit(s)})),r})),this.dv(new a.ObjResettingWithEvent(t.objectEventListeningChanged,()=>{if(!(t.objectEventListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("objectEvent",s=>{t.objectEvent.emit(s)})),r})),this.dv(new a.ObjResettingWithEvent(t.widgetEventListeningChanged,()=>{if(!(t.widgetEventListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("widgetEvent",s=>{t.widgetEvent.emit(s)})),r})),this.dv(new a.ObjResettingWithEvent(t.speechRecognitionListeningChanged,()=>{if(!(t.speechRecognitionListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("speechRecognition",s=>{t.speechRecognition.emit(s)})),r})),this.dv(new a.ObjResettingWithEvent(t.customMessageListeningChanged,()=>{if(!(t.customMessageListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("customMessage",s=>{t.customMessage.emit(s)})),r})),this.dv(new a.ObjResettingWithEvent(t.editingEventListeningChanged,()=>{if(!(t.editingEventListening??!0))return;const r=new a.Destroyable;return r.d(i.disposableOnUeEvent("editingEvent",s=>{s.objectIDs=s.objectIDs.map(o=>o.split("_")[0]),t.editingEvent.emit(s)})),r}))}}let nr=-1;class rr extends Y{constructor(t,i,n="${earthsdk3-ue-h5-assets-script-dir}",r){super();g(this,"_ueFuncResultWithIdsEvent",this.dv(new a.Event));g(this,"_ueFuncWithIdAndResultCallbacks",[]);g(this,"_waitingUeFuncIdAndResultCallbacks",new Map);g(this,"_waitingUeCalls",new Map);g(this,"_ueEvent",this.dv(new a.Event));this._ueViewer=r;const s=this._ueViewer,o=this.dv(new tr(t,i,n,s));let v=!1,d=null;this.d(o.onRuntimeInitialized.don(()=>{var p;if(v=!0,(p=o==null?void 0:o.vIframe)!=null&&p.contentWindow){d=o.vIframe.contentWindow;const h=o.vIframe.contentWindow.document.getElementById("mainarea");h?this.dv(new ir(h,s,this)):console.error("h5Container is null")}else{console.error("iframeWindow is null");return}d.UE_JSHTML5Communication?d.UE_JSHTML5Communication.UESendMessageToJS=h=>{try{const m=er(d.HEAPU8,h),C=JSON.parse(m);if(s.debug&&(console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(C,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()),C.t==="cr"){const E=C;if(E.frs&&this._ueFuncResultWithIdsEvent.emit(E.frs),E.ers)for(let I of E.ers)this._ueEvent.emit(I)}C.callid&&this._waitingUeCalls.has(C.callid)&&(this._waitingUeCalls.delete(C.callid),console.log(`waitingUeCalls.delete:${C.callid} end`))}catch(m){console.error("UE_JSHTML5Communication.UESendMessageToJS error:",m)}}:console.error("UE_JSHTML5Communication UESendMessageToJS not found")})),this.dispose(this._ueFuncResultWithIdsEvent.disposableOn(p=>{for(const h of p){const m=this._waitingUeFuncIdAndResultCallbacks.get(h.fid);m&&(this._waitingUeFuncIdAndResultCallbacks.delete(h.fid),m(h.r))}}));let w=0;const y=()=>{if(!v||!d||!d.UE_JSHTML5Communication||!d.UE_JSHTML5Communication.JSSendMessageToUE||this._ueFuncWithIdAndResultCallbacks.length===0)return;const p=this._ueFuncWithIdAndResultCallbacks.map(([T])=>T),h={n:w++,tt:Date.now(),t:"c",fs:p,callid:a.createGuid()};for(const[T,W]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(T.fid,W);this._ueFuncWithIdAndResultCallbacks.length=0,this._waitingUeCalls.set(h.callid,h),s.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(h,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd());const m=JSON.stringify(h),C=window.g_emitDescriptor_maxBytes??3e4,E=m.length,I=++nr;if(E<C){const T=`${I}-0/1-`+m;d.UE_JSHTML5Communication.JSSendMessageToUE(T);return}const F=Math.ceil(E/C)|0;[...new Array(F).keys()].map(T=>m.slice(T*C,(T+1)*C)).forEach((T,W)=>{const fe=`${I}-${W}/${F}-`+T;d.UE_JSHTML5Communication.JSSendMessageToUE(fe)})};this.dv(a.createInterval()).start(y,50)}processResponse(t){if(this._ueViewer.debug??!1)try{const i=JSON.parse(t);console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(i,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()}catch(i){console.error(`processResponse(${t}) error: ${i}`,i)}}callUeFunc(t){return new Promise(i=>{const r={fid:a.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,i])})}disposableOnUeEvent(t,i){const n=a.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},s=this._ueEvent.disposableOn(o=>{o.et===t&&o.eid===n&&((this._ueViewer.debug??!1)&&console.log(`callback, type:${t} eid:${n} ueEvent:${JSON.stringify(o)}`),i(o))});return()=>{s(),r()}}}let sr=-1;class or extends Y{constructor(t,i){super();g(this,"_ueFuncResultWithIdsEvent",this.dv(new a.Event));g(this,"_ueFuncWithIdAndResultCallbacks",[]);g(this,"_waitingUeFuncIdAndResultCallbacks",new Map);g(this,"_waitingUeCalls",new Set);g(this,"_ueEvent",this.dv(new a.Event));this._ueViewer=i;const n=this._ueViewer;let r=!1;const s={eventType:"init",params:{}};window.ue.es.oncommand(JSON.stringify(s)),r=!0,window.calljs=(w,y)=>{if(n.debug&&console.log(`calljs eventName:${w} eventDetailStr:${y}`),w==="ueevent"||w==="commanFinish")try{const l=JSON.parse(y);if(l.t==="cr"){const p=l;if(p.frs&&this._ueFuncResultWithIdsEvent.emit(p.frs),p.ers)for(let h of p.ers)this._ueEvent.emit(h)}}catch(l){console.error(l)}},this.dispose(this._ueFuncResultWithIdsEvent.disposableOn(w=>{for(const y of w){const l=this._waitingUeFuncIdAndResultCallbacks.get(y.fid);l&&(this._waitingUeFuncIdAndResultCallbacks.delete(y.fid),l(y.r))}}));let o=0;const v=()=>{if(!r||this._ueFuncWithIdAndResultCallbacks.length===0)return;const w=this._ueFuncWithIdAndResultCallbacks.map(([p])=>p),y={n:o++,tt:Date.now(),t:"c",fs:w};for(const[p,h]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(p.fid,h);this._ueFuncWithIdAndResultCallbacks.length=0,this._waitingUeCalls.add(y),n.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(y,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd());const l=++sr;window.ue.es.oncommand(`${l}-0/1-`+JSON.stringify(y)).then(()=>{this._waitingUeCalls.delete(y)})};this.dv(a.createInterval()).start(v,50)}callUeFunc(t){return new Promise(i=>{const r={fid:a.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,i])})}disposableOnUeEvent(t,i){const n=a.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},s=this._ueEvent.disposableOn(o=>{o.et===t&&o.eid===n&&((this._ueViewer.debug??!1)&&console.log(`callback, type:${t} eid:${n} ueEvent:${JSON.stringify(o)}`),i(o))});return()=>{s(),r()}}}class ar extends a.Destroyable{constructor(e,t){super();{const i=()=>{const o=pe(e);e.setGlobalProperty(o)};i();const n=se(),r=[];n.forEach(o=>{const v=e[o+"Changed"];r.push(v)});const s=this.dv(a.createNextAnimateFrameEvent(...r));this.d(s.don(i))}this.d(e.propChanged.don(i=>{if(i.objId==="")try{Object.keys(i.props).forEach(n=>{const r=i.props[n]===null?void 0:i.props[n];e[n]=r})}catch(n){console.error("ueViewer propChanged:"+n)}})),this.dv(new a.ObjResettingWithEvent(e.statusUpdateIntervalChanged,i=>{if((e.statusUpdateInterval??.5)===0)return;const r=new a.Destroyable;return r.d(t.disposableOnUeEvent("statusUpdate",s=>{e.statusUpdateEvent.emit(s)})),r})),this.dv(new a.ObjResettingWithEvent(e.propChangedListeningChanged,()=>{if(!(e.propChangedListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("propChanged",r=>{e.propChanged.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.objectEventListeningChanged,()=>{if(!(e.objectEventListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("objectEvent",r=>{e.objectEvent.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.widgetEventListeningChanged,()=>{if(!(e.widgetEventListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("widgetEvent",r=>{e.widgetEvent.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.speechRecognitionListeningChanged,()=>{if(!(e.speechRecognitionListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("speechRecognition",r=>{e.speechRecognition.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.customMessageListeningChanged,()=>{if(!(e.customMessageListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("customMessage",r=>{e.customMessage.emit(r)})),n})),this.dv(new a.ObjResettingWithEvent(e.editingEventListeningChanged,()=>{if(!(e.editingEventListening??!0))return;const n=new a.Destroyable;return n.d(t.disposableOnUeEvent("editingEvent",r=>{r.objectIDs=r.objectIDs.map(s=>s.split("_")[0]),e.editingEvent.emit(r)})),n}))}}class lr extends a.Destroyable{constructor(e,t,i){super();{const r=()=>{const d=pe(t);t.setGlobalProperty(d)};r();const s=se(),o=[];s.forEach(d=>{const w=t[d+"Changed"];o.push(w)});const v=this.dv(a.createNextAnimateFrameEvent(...o));this.d(v.don(r))}this.d(t.propChanged.don(r=>{if(r.objId==="")try{Object.keys(r.props).forEach(s=>{const o=r.props[s]===null?void 0:r.props[s];t[s]=o})}catch(s){console.error("ueViewer propChanged:"+s)}}));const n=document.createElement("div");n.style.width="100%",n.style.height="100%",n.style.position="absolute",n.style.overflow="hidden",n.style.top="0",n.style.left="0",n.style.zIndex="0",n.style.backgroundColor="rgba(255,0,0,0)",n.setAttribute("masker","大屏顶层div,用于模拟鼠标事件和控制UE鼠标事件是否生效"),e.appendChild(n),this.d(()=>{n&&e&&e.removeChild(n)});{const r=(d,w)=>{window.ue.esinput.setinterceptevent(w),d.preventDefault()},s=d=>{r(d,!1)},o=d=>{r(d,!0)},v=d=>{r(d,!1)};n.addEventListener("mouseenter",s),n.addEventListener("mouseleave",o),n.addEventListener("mousemove",v),this.d(()=>{n.removeEventListener("mouseenter",s),n.removeEventListener("mouseleave",o),n.removeEventListener("mousemove",v)})}t.useCustomInteraction=!1,this.dv(new c.ViewerCustomInteraction(t,n,void 0,!0)),this.dv(new a.ObjResettingWithEvent(t.statusUpdateIntervalChanged,r=>{if((t.statusUpdateInterval??.5)===0)return;const o=new a.Destroyable;return o.d(i.disposableOnUeEvent("statusUpdate",v=>{t.statusUpdateEvent.emit(v)})),o})),this.dv(new a.ObjResettingWithEvent(t.propChangedListeningChanged,()=>{if(!(t.propChangedListening??!0))return;const s=new a.Destroyable;return s.d(i.disposableOnUeEvent("propChanged",o=>{t.propChanged.emit(o)})),s})),this.dv(new a.ObjResettingWithEvent(t.objectEventListeningChanged,()=>{if(!(t.objectEventListening??!0))return;const s=new a.Destroyable;return s.d(i.disposableOnUeEvent("objectEvent",o=>{t.objectEvent.emit(o)})),s})),this.dv(new a.ObjResettingWithEvent(t.widgetEventListeningChanged,()=>{if(!(t.widgetEventListening??!0))return;const s=new a.Destroyable;return s.d(i.disposableOnUeEvent("widgetEvent",o=>{t.widgetEvent.emit(o)})),s})),this.dv(new a.ObjResettingWithEvent(t.speechRecognitionListeningChanged,()=>{if(!(t.speechRecognitionListening??!0))return;const s=new a.Destroyable;return s.d(i.disposableOnUeEvent("speechRecognition",o=>{t.speechRecognition.emit(o)})),s})),this.dv(new a.ObjResettingWithEvent(t.customMessageListeningChanged,()=>{if(!(t.customMessageListening??!0))return;const s=new a.Destroyable;return s.d(i.disposableOnUeEvent("customMessage",o=>{t.customMessage.emit(o)})),s})),this.dv(new a.ObjResettingWithEvent(t.editingEventListeningChanged,()=>{if(!(t.editingEventListening??!0))return;const s=new a.Destroyable;return s.d(i.disposableOnUeEvent("editingEvent",o=>{o.objectIDs=o.objectIDs.map(v=>v.split("_")[0]),t.editingEvent.emit(o)})),s}))}}class dr extends a.Destroyable{constructor(t,i,n){super();g(this,"_reconnectEvent",this.dv(new a.Event));const r=(v,d)=>v.hasOwnProperty(d);let s=0,o;if(this.d(()=>{o&&clearTimeout(o)}),window.ue&&window.ue.es)if(window.ue.esinput){n.setStatus("Creating"),console.log("存在(window.ue && window.ue.es && window.ue.esinput 需要适配新版ESWebView 鼠标穿透), 开始创建UeFalseCloudViewer..."),n.setStatusLog("开始创建本地视口...");const v=this.dv(new or(t,n));this.d(()=>n.viewer=void 0),n.viewer=v,n.setStatus("Created"),n.setStatusLog("本地视口创建成功!"),this.dv(new lr(t,n,v))}else n.setStatus("Error"),n.setStatusLog("请升级 ESWebView !");else if(r(i.options,"ws")||r(i.options,"uri")&&r(i.options,"app")){n.setStatus("Creating"),n.setStatusLog("开始创建云渲染视口...");let v;this.d(()=>{n.setStatus("Raw"),n.setStatusLog(""),t&&v&&t.removeChild(v)&&(v=void 0)});const d=this.dv(a.createProcessingFromAsyncFunc(async w=>{n.viewer&&!n.viewer.isDestroyed()&&n.viewer.destroy(),n.viewer=void 0,v&&t.removeChild(v)&&(v=void 0),v=document.createElement("div"),v.setAttribute("earthsdk3-ue","earthsdk3-ue-videoContainer"),v.style.cssText="position:relative; height: 100%;width:100%;",t.appendChild(v);let y,l,p;if(r(i.options,"ws")){const{ws:E,esmsg:I,uselnternalSignallingServer:F}=i.options;y=E,l=I,p=F??!1}if(r(i.options,"uri")&&r(i.options,"app")){const{offsetWidth:E,offsetHeight:I}=v;let{uri:F,app:R,token:T}=i.options;F.endsWith("/")||(F+="/");const W=T?`?essstoken=${T}`:"",fe=`/${R}/${E??1920}/${I??1080}`+W;console.log(`请求信令服务器: ${F}instance${fe}`);const hr=await w.promise(fetch(`${F}instance${fe}`,{method:"GET"})),X=await w.promise(hr.json());if(X&&X.status!=="ok"){n.setStatus("Error"),n.setStatusLog(`信令服务器请求失败 ${X.status}`),this._reconnectEvent.emit(void 0);return}else{console.log(`信令服务器请求成功! ${JSON.stringify(X,void 0," ")}`),await a.sleep(5e3);const{server:vr,esmsg:gr,instanceId:fr,useInternalSignallingServer:pr}=X;if(!fr){n.setStatus("Error"),n.setStatusLog("检查信令服务器版本,返回数据错误! "),console.log("信令服务器返回数据错误!不包含instanceId!请升级到 ESSS V3.0+ 版本!"),this._reconnectEvent.emit(void 0);return}y=vr,l=gr,p=pr??!1,n.esssResponse=X}}const h=this.dv(p?new jn(v,y,l,n):new Xn(v,y,l,n));this.d(()=>n.viewer=void 0),this.d(h.errorEvent.don(E=>{const I=`[${E}]:像素流连接错误!`;n.setStatus("Error"),n.setStatusLog(I),this._reconnectEvent.emit(h)})),await w.promise(new Promise(E=>this.d(h.readyEvent.donce(E)))),n.setStatus("Created"),n.setStatusLog("云渲染视口创建成功!"),s=0,o&&clearTimeout(o),o=void 0;const{offsetWidth:m,offsetHeight:C}=v;h.resize(m*window.devicePixelRatio,C*window.devicePixelRatio),n.viewer=h,this.d(()=>n.viewer=void 0),this.dv(new ar(n,h))}));d.start(),this.d(this._reconnectEvent.don(w=>{o===void 0&&(w&&!w.isDestroyed()&&w.destroy(),n.viewer&&!n.viewer.isDestroyed()&&n.viewer.destroy(),n.viewer=void 0,n.autoReconnect&&(n.setStatus("Reconnecting"),n.setStatusLog("正在尝试重新连接..."),s=s+5e3>3e4?3e4:s+5e3,console.warn(`间隔:${s/1e3}s,正在尝试重新连接...`),o=window.setTimeout(()=>{d.restart()},s)))})),this.d(d.errorEvent.don(w=>{n.setStatus("Error"),n.setStatusLog("云渲染视口创建失败!"),console.warn("云渲染视口创建失败!",w),this._reconnectEvent.emit(void 0)}))}else if(r(i.options,"project")){const v=i,d=v.options.project,w=v.options.baseUrl;n.setStatus("Creating"),n.setStatusLog("下载编译中...");const y=this.dv(new rr(t,d,w,n));n.viewer=y,this.d(()=>n.viewer=void 0)}else n.setStatus("Error"),n.setStatusLog("视口创建失败!"),console.warn("视口创建失败: 参数错误!")}}const _=class _ extends c.ESViewer{constructor(t){super(t);g(this,"_viewer",this.dv(a.react(void 0)));g(this,"_esssResponse");g(this,"_speechRecognition",this.dv(new a.Event));g(this,"_propChanged",this.dv(new a.Event));g(this,"_objectEvent",this.dv(new a.Event));g(this,"_widgetEvent",this.dv(new a.Event));g(this,"_customMessage",this.dv(new a.Event));g(this,"_statusUpdateEvent",this.dv(new a.Event));g(this,"_statusUpdateEventdon",(()=>{this.d(this.statusUpdateEvent.don(t=>{this._statusInfo.fps=t.FPS??0,this._statusInfo.length=t.length??0,this._statusInfo.position=t.position??[0,0,0],this._statusInfo.rotation=t.rotation??[0,0,0]}))})());if(t.type!=="ESUeViewer")throw new Error("option.type must be ESUeViewer");const i=t;this.d(this._viewer.changed.don(()=>{this.viewerChanged.emit(this.viewer)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new dr(this.subContainer,i,this)}))}get defaultProps(){return _.createDefaultProps()}set viewer(t){this._viewer.value=t}get viewer(){return this._viewer.value}get esssResponse(){return this._esssResponse}set esssResponse(t){this._esssResponse=t}get speechRecognition(){return this._speechRecognition}get propChanged(){return this._propChanged}get objectEvent(){return this._objectEvent}get widgetEvent(){return this._widgetEvent}get customMessage(){return this._customMessage}get statusUpdateEvent(){return this._statusUpdateEvent}async uePositionToLonLatAlt(t){if(!this.viewer){console.warn("UEPositionToLonLatAlt: viewer is undefined");return}return await rn(this.viewer,t)}async changeNavigationMode(t){if(!this.viewer){console.warn("ChangeNavigationMode: viewer is undefined");return}const i=await M(this.viewer,t);return i&&!i.error&&(this._navigationMode.value=t.mode),i}async resetWithCurrentCamera(t){if(!this.viewer){console.warn("resetWithCurrentCamera: viewer is undefined");return}return await ye(this.viewer,t)}async getAllSocketNamesByActorTag(t){if(!this.viewer){console.warn("GetAllSocketNamesByActorTag: viewer is undefined");return}return await sn(this.viewer,t)}async getBoundSphere(t){if(!this.viewer){console.warn("getBoundSphere: viewer is undefined");return}return await an(this.viewer,t)}async getBoundSphereWithChildren(t){if(!this.viewer){console.warn("getBoundSphereWithChildren: viewer is undefined");return}return await ln(this.viewer,t)}async getStrokeMaterialParamInfo(t){if(!this.viewer){console.warn("GetStrokeMaterialParamInfo: viewer is undefined");return}return await dn(this.viewer,t)}async getFillMaterialParamInfo(t){if(!this.viewer){console.warn("getFillMaterialParamInfo: viewer is undefined");return}return await cn(this.viewer,t)}async getGlobalProperty(t){if(!this.viewer){console.warn("getGlobalProperty: viewer is undefined");return}return await un(this.viewer,t)}async getObjectByInfo(t){if(!this.viewer){console.warn("GetObjectByInfo: viewer is undefined");return}return await hn(this.viewer,t)}async defaultCameraFlyIn(t=1){if(!this.viewer){console.warn("DefaultCameraFlyIn: viewer is undefined");return}return await _i(this.viewer,t)}async startVoice(){if(!this.viewer){console.warn("startVoice:viewer is undefined");return}return await Ni(this.viewer)}async stopVoice(){if(!this.viewer){console.warn("startVoice:viewer is undefined");return}return await zi(this.viewer)}async mountPakFiles(t){if(!this.viewer){console.warn("mountPakFiles:viewer is undefined");return}return await Hi(this.viewer,t)}async generateMemReport(){if(!this.viewer){console.warn("generateMemReport:viewer is undefined");return}return await Gi(this.viewer)}async quit(){if(!this.viewer){console.warn("Quit: viewer is undefined");return}return await Zi(this.viewer)}async bindActorByTag(t,i){if(!this.viewer){console.warn("BindActorByTag: viewer is undefined");return}return await vn(this.viewer,t,i)}async restoreOriginalScene(){if(!this.viewer){console.warn("RestoreOriginalScene: viewer is undefined");return}return await gn(this.viewer)}async unBindActorByID(t){if(!this.viewer){console.warn("UnBindActorByID: viewer is undefined");return}return await fn(this.viewer,t)}async unBindActorByTag(t){if(!this.viewer){console.warn("UnBindActorByTag: viewer is undefined");return}return await pn(this.viewer,t)}async createActorByClass(t,i){if(!this.viewer){console.warn("CreateActorByClass: viewer is undefined");return}return await wn(this.viewer,t,i)}async bind3DTilesetByTag(t,i){if(!this.viewer){console.warn("Bind3DTilesetByTag: viewer is undefined");return}return await yn(this.viewer,t,i)}async unBind3DTilesetByTag(t){if(!this.viewer){console.warn("UnBind3DTilesetByTag: viewer is undefined");return}return await mn(this.viewer,t)}async unBind3DTilesetById(t){if(!this.viewer){console.warn("UnBind3DTilesetById: viewer is undefined");return}return await Cn(this.viewer,t)}async bindImageryByTag(t,i,n){if(!this.viewer){console.warn("BindImageryByTag: viewer is undefined");return}return await En(this.viewer,t,i,n)}async unBindImageryByTag(t,i){if(!this.viewer){console.warn("UnBindImageryByTag: viewer is undefined");return}return await Fn(this.viewer,t,i)}async unBindImageryById(t){if(!this.viewer){console.warn("UnBindImageryById: viewer is undefined");return}return await Sn(this.viewer,t)}async getIdByComponentNameAndHitItem(t,i,n){if(!this.viewer){console.warn("GetIdByComponentNameAndHitItem: viewer is undefined");return}return await In(this.viewer,t,i,n)}async getCameraRelativeHeight(t="ECC_Visibility"){if(!this.viewer){console.warn("GetCameraRelativeHeight: viewer is undefined");return}return await Tn(this.viewer,t)}async saveStringToFile(t,i,n){if(!this.viewer){console.warn("SaveStringToFile: viewer is undefined");return}return await Rn(this.viewer,t,i,n)}async highlightActorByTag(t,i=!0){if(!this.viewer){console.warn("HighlightActorByTag: viewer is undefined");return}return await Dn(this.viewer,t,i)}async sendCustomMessage(t){if(!this.viewer){console.warn("SendCustomMessage: viewer is undefined");return}return await kn(this.viewer,t)}async getStatus(){if(!this.viewer){console.warn("GetStatus:viewer is undefined");return}return await Ln(this.viewer)}async getTilesetMaterialIDList(){if(!this.viewer){console.warn("GetTilesetMaterialIDList:viewer is undefined");return}return await An(this.viewer)}async pick(t,i,n){if(!this.viewer)return;let r=t;if(t&&window.ue&&this.container){const[s,o]=t,{left:v,top:d}=this.container.getBoundingClientRect();r=[v+s,d+o]}return await bi(this.viewer,r,i,n)}async pickPosition(t){if(!this.viewer)return;let i=t;if(t&&window.ue&&this.container){const[n,r]=t,{left:s,top:o}=this.container.getBoundingClientRect();i=[s+n,o+r]}return await xi(this.viewer,i)}async flyIn(t,i=[0,0,0],n=1,r="default"){if(!this.viewer)return;const s=await Q(this.viewer,void 0,t,i,n,r);if(s)return s.endType===0&&console.warn(`flyTo:flyTo is end! endType:${s.endType}`),s.endType===1&&console.warn(`flyTo:飞行中断! endType:${s.endType}`),s}async flyTo(t,i,n="default"){if(!this.viewer)return;const r=await B(this.viewer,void 0,void 0,t,i,n);if(r)return r.endType===0&&console.warn(`flyTo:flyTo is end! endType:${r.endType}`),r.endType===1&&console.warn(`flyTo:飞行中断! endType:${r.endType}`),r}flyToBoundingSphere(t,i,n=1){const r=[[t[0],t[1],0],[t[0],t[3],0],[t[2],t[3],0],[t[2],t[1],0]],s=c.getGeoBoundingSphereFromPositions(r);if(!s)return;const{center:o,radius:v}=s,d={distance:i??v,heading:0,pitch:-90,flyDuration:n,hDelta:0,pDelta:0};this.flyTo(d,o)}getCurrentCameraInfo(){const{position:t,rotation:i}=this._statusInfo;return{position:t,rotation:i}}getLengthInPixel(){return this._statusInfo.length}async changeToWalk(t,i=4.2){if(!this.viewer)return;const n={mode:"Walk",position:t,jumpZVelocity:i},r=await M(this.viewer,n);return r&&!r.error&&(this._navigationMode.value=n.mode),r}async changeToMap(){if(!this.viewer)return;const t={mode:"Map"},i=await M(this.viewer,t);return i&&!i.error&&(this._navigationMode.value=t.mode),i}async changeToRotateGlobe(t=38,i=1e7,n=60){if(!this.viewer)return;const r={mode:"RotateGlobe",latitude:t,height:i,cycleTime:n},s=await M(this.viewer,r);return s&&!s.error&&(this._navigationMode.value=r.mode),s}async changeToLine(t,i=10,n=10,r=!0,s=10,o="auto"){if(!this.viewer)return;const v={mode:"Line",geoLineStringId:t,speed:i,heightOffset:n,loop:r,turnRateDPS:s,lineMode:o},d=await M(this.viewer,v);return d&&!d.error&&(this._navigationMode.value=v.mode),d}async changeToUserDefined(t){if(!this.viewer)return;const i={mode:"UserDefined",userDefinedPawn:t},n=await M(this.viewer,i);return n&&!n.error&&(this._navigationMode.value=i.mode),n}async changeToRotatePoint(t,i=5e4,n=60,r=0,s=-30){if(!this.viewer)return;const o={mode:"RotatePoint",position:t,distance:i,orbitPeriod:n,heading:r,pitch:s},v=await M(this.viewer,o);return v&&!v.error&&(this._navigationMode.value=o.mode),v}async changeToFollow(t,i=0,n=0,r=-30,s=!0){if(!this.viewer)return;const o={mode:"Follow",objectId:t,distance:i,heading:n,pitch:r,relativeRotation:s},v=await M(this.viewer,o);return v&&!v.error&&(this._navigationMode.value=o.mode),v}getFPS(){return this._statusInfo.fps}async getVersion(){const t=window.g_XE3CopyRights??{};if(!this.viewer)return t;const i=await on(this.viewer);return t.esforue=i,t}async getHeightByLonLat(t,i,n="ECC_Visibility"){if(!this.viewer)return null;const r=await Oi(this.viewer,t,i,n);return r&&r.height!==void 0?r.height:null}async getHeightsByLonLats(t,i="ECC_Visibility"){return this.viewer?await ji(this.viewer,t,i):void 0}async capture(t=64,i=64){return this.viewer?await tn(this.viewer,t,i):void 0}async partialCapture(t,i=[64,64]){if(!this.viewer){console.warn("partialCapture:viewer is undefined");return}return await en(this.viewer,t,i)}async lonLatAltToScreenPosition(t){if(!this.viewer)return;const i=await nn(this.viewer,t);return i&&[i.X,i.Y]}async setGlobalProperty(t){if(this.viewer)return await Yi(this.viewer,t)}async startEditing(t,i,n){n=Object.assign({useKeyToSwitch:!0,callSource:"outer"},n);const r=t.combinationClass?t.getMainClass():t;if(!r||!this.viewer||i==null)return;const s=Array.isArray(i)?[...i]:[i];return r.editingID=`${n.callSource}_${a.createGuid()}`,await Pn(this.viewer,r.id,r.editingID,s,n.useKeyToSwitch)}async stopEditing(){if(this.viewer)return await Un(this.viewer)}async moveObjects(t){if(!this.viewer)return;const i=[],n=a.createGuid();for(let r=0;r<t.length;r++){const s=t[r],o=s.combinationClass?s.getMainClass():s;o.editingID=n,o&&i.push(o.id)}if(i.length!==0)return await Mn(this.viewer,i,n)}getProperties(){return[...super.getProperties()]}};g(_,"type",_.register("ESUeViewer",_)),g(_,"defaults",{...Hn});let A=_;(u=>{u.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...Wi(),resolutionScale:1,autoReconnect:!1,propChangedListening:void 0,objectEventListening:void 0,widgetEventListening:void 0,speechRecognitionListening:void 0,customMessageListening:void 0})})(A||(A={})),a.extendClassProps(A.prototype,A.createDefaultProps);class $ extends c.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(i&&(e.combinationClass||this.d(this.createdEvent.don(()=>{const n=this.constructor.propValFuncs,r=e.defaultProps,s=Object.keys(r).filter(l=>n[l]!==null);s.push(...this.constructor.forceUeUpdateProps);const o=e.constructor.defaults,v={val:{}},d=[];for(let l of s){const p=l+"Changed",h=e[p];d.push(h);const m=n[l];if(m===null)throw console.error("vf === null error"),new Error("vf === null error");const C=()=>{const E=e[l]??o[l];let I=m?m(E,this,t,e):E;if(I===void 0){console.warn(`UE自动更新的属性,不应该为undefined! 属性名:${l} 对象名:${e.name} 对象id: ${e.id}`);return}v.val[l]=I};C(),this.d(h.don(C))}const w=()=>{i.callUeFunc({f:"update",p:{id:e.id,...v.val}}),v.val={}},y=this.dv(a.createNextAnimateFrameEvent(...d));this.d(y.don(w)),this.d(e.createdEvent.don(w)),this.d(e.flushEvent.don(()=>y.flush()))})),!e.combinationClass)){let n=!1;this.d(()=>{n&&we(i,e.id)}),i.callUeFunc({f:"create",p:{type:e.typeName,id:e.id}}).then(()=>{n=!0,e.createdEvent.emit()}).catch(r=>console.error(r))}}}g($,"propValFuncs",{ref:null,devTags:null,extras:null,execOnceFuncStr:null,updateFuncStr:null,toDestroyFuncStr:null}),g($,"forceUeUpdateProps",[]);class k extends ${constructor(e,t){super(e,t);const i=t.viewer;i&&(this.d(e.flyToEvent.don(n=>{B(i,e.id,n)})),this.d(e.flyInEvent.don(n=>{var r,s;Q(i,e.id,(r=e.flyInParam)==null?void 0:r.position,(s=e.flyInParam)==null?void 0:s.rotation,n??1)})),this.d(e.calcFlyToParamEvent.don(()=>{K(i,e.id)})),this.d(e.calcFlyInParamEvent.don(()=>{const n=t.getCurrentCameraInfo();if(!n)return;const{position:r,rotation:s}=n;e.flyInParam={position:r,rotation:s,flyDuration:1}})),this.d(t.propChanged.don(n=>{n.objId===e.id&&Object.keys(n.props).forEach(r=>{const s=n.props[r]===null?void 0:n.props[r];e[r]=s})})))}}class S extends k{constructor(e,t){super(e,t);const i=t.viewer;if(!i)return;const n=()=>{e.editing||i.callUeFunc({f:"update",p:{id:e.id,position:e.position,rotation:e.rotation}})},r=this.dv(a.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.editingChanged));this.d(r.don(()=>{setTimeout(n,0)})),this.d(e.smoothMoveEvent.don((v,d)=>{ce(i,e.id,v,d)})),this.d(e.smoothMoveWithRotationEvent.don((v,d,w)=>{ae(i,e.id,v,d,w)})),this.d(e.smoothMoveOnGroundEvent.don((v,d,w,y)=>{le(i,e.id,v,d,y,w)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((v,d,w,y,l)=>{de(i,e.id,v,d,w,y,l)})),this.d(e.smoothMoveKeepPitchEvent.don(async(v,d)=>{const w=await i.callUeFunc({f:"SmoothMoveKeepPitch",p:{id:e.id,Destination:v,Time:d}});w.error&&console.error("SmoothMoveKeepPitch:",w.error)})),this.d(e.automaticLandingEvent.don(v=>{const d=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(w=>{w!==null&&(e.position=[...d,w],e.collision=v)})}));const s=async(v,d,w,y)=>{const{viewer:l}=v;if(!l){console.error("SmoothMoveRelatively: ueViewer.viewer is undefined");return}const p=await l.callUeFunc({f:"SmoothMoveRelatively",p:{id:d,RelativePosition:w,Time:y}});return p.error&&console.error("SmoothMoveRelatively:",p.error),p};this.d(e.smoothMoveRelativelyEvent.don((v,d)=>{s(t,e.id,v,d)}));const o=async(v,d,w,y,l)=>{const{viewer:p}=v;if(!p){console.error("SmoothMoveRelativelyWithRotation: ueViewer.viewer is undefined");return}const h=await p.callUeFunc({f:"SmoothMoveRelativelyWithRotation",p:{id:d,RelativePosition:w,NewRotation:y,Time:l}});return h.error&&console.error("SmoothMoveRelativelyWithRotation:",h.error),h};this.d(e.smoothMoveRelativelyWithRotationEvent.don((v,d,w)=>{o(t,e.id,v,d,w)}))}}class L extends k{constructor(e,t){super(e,t);const i=t.viewer;if(!i)return;const n=()=>{e.editing||i.callUeFunc({f:"update",p:{id:e.id,points:e.points}})},r=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.editingChanged));this.d(r.don(()=>{setTimeout(n,0)}))}}g(L,"propValFuncs",{...k.propValFuncs,pointStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})}),strokeStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})}),fillStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})})});class U extends S{constructor(e,t){super(e,t),t.viewer&&this.d(t.widgetEvent.don(n=>{if(n.objId!==e.id)return;const{type:r,add:s}=n;e.widgetEvent.emit({type:r,add:s})}))}}class Ce extends S{constructor(e,t){super(e,t),t.viewer}}g(Ce,"propValFuncs",{...S.propValFuncs,pointStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})}),strokeStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})}),fillStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})})});class ue extends Ce{constructor(e,t){super(e,t),t.viewer}}const $n=u=>{switch(u){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"没搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是3dTileset,无法绑定";default:return"未知错误"}},Z=class Z extends c.EngineObject{constructor(t,i){super(t,i);g(this,"_styleColor",this.dv(a.react([])));g(this,"_styleVisable",this.dv(a.react([])));const n=i.viewer;if(!n){console.warn("UeES3DTileset: viewer is undefined!");return}let r,s;const o=async()=>{!r&&!s||await n.callUeFunc({f:"update",p:{id:t.id,url:t.url,show:t.show,collision:t.collision,allowPicking:t.allowPicking,flyToParam:t.flyToParam??c.ESVisualObject.defaults.flyToParam,flyInParam:t.flyInParam??c.ESVisualObject.defaults.flyInParam,highlightID:t.highlightID,highlightColor:t.highlightColor,highlight:t.highlight,materialMode:t.materialMode,maximumScreenSpaceError:t.maximumScreenSpaceError,colorMode:Reflect.has(t,"colorMode")?t.colorMode:void 0,offset:t.offset,rotation:t.rotation,cacheBytes:t.cacheBytes,colorBlendMode:t.colorBlendMode,materialOverrideMap:t.materialOverrideMap}})},v=this.dv(a.createNextAnimateFrameEvent(t.urlChanged,t.showChanged,t.flyToParamChanged,t.flyInParamChanged,t.collisionChanged,t.allowPickingChanged,t.highlightIDChanged,t.highlightColorChanged,t.highlightChanged,t.materialModeChanged,t.maximumScreenSpaceErrorChanged,t.offsetChanged,t.rotationChanged,t.cacheBytesChanged,t.colorBlendModeChanged,t.materialOverrideMapChanged));o(),this.d(v.don(o)),Reflect.has(t,"colorMode")&&this.d(t.colorModeChanged.don(()=>o()));const d=this.dv(a.react(void 0));{const y=this.dv(a.createNextAnimateFrameEvent(t.actorTagChanged,t.urlChanged)),l=()=>{t.actorTag?d.value={type:"ActorTag",actorTag:t.actorTag}:t.url?d.value={type:"CreatedUrl",url:t.url}:d.value=void 0,t.editing=!1};l(),this.d(y.don(l))}const w=async()=>{const{id:y}=t;if(r!==void 0){r=void 0;try{const l=await i.unBind3DTilesetById(y);if(!l)return;if(l.error!==""){console.warn(`UeES3DTileset UnBind3DTilesetById: ${l.error}`);return}}catch(l){console.warn(`UeES3DTileset UnBind3DTilesetById: ${l}`);return}}if(s!==void 0){s=void 0;try{const l=await n.callUeFunc({f:"destroy",p:{id:y}});if(!l)return;if(l.error!==""){console.warn(`UeES3DTileset Destroy: ${l.error}`);return}}catch(l){console.warn(`UeES3DTileset Destroy: ${l}`);return}}};this.d(()=>{w()});{const y=this.dv(a.createProcessingFromAsyncFunc(async p=>{if(d.value===void 0){await p.promise(w());return}if(d.value.type==="ActorTag"){const{actorTag:h}=d.value;if(r!==h&&await p.promise(w()),r!==void 0||h===void 0)return;try{r=h;const m=await p.promise(i.bind3DTilesetByTag(t.id,h));if(!m)return;if(m.error!==""){console.warn(`UeES3DTileset Bind3DTilesetByTag: ${m.error}`);return}if(m.re.type!==0)if(m.re.type===1)console.warn(`UeES3DTileset Bind3DTilesetByTag: ${$n(m.re.type)}`);else{console.warn(`UeES3DTileset Bind3DTilesetByTag: ${$n(m.re.type)}`);return}}catch(m){console.warn(`UeES3DTileset Bind3DTilesetByTag: ${m}`);return}}else if(d.value.type==="CreatedUrl"){const{url:h}=d.value;if(h!==s&&await w(),s!==void 0||h===void 0)return;try{s=h;const m=await p.promise(n.callUeFunc({f:"create",p:{type:t.typeName,id:t.id}}));if(!m)return;if(m.error!==""){console.warn(`UeES3DTileset create: ${m.error}`);return}}catch(m){console.warn(`UeES3DTileset create: ${m}`);return}}await p.promise(o())})),l=async()=>{y.restart()};l(),this.d(d.changed.don(l))}this.d(t.refreshTilesetEvent.don(()=>{$i(n,t.id)})),this.d(t.flyToEvent.don(async(y,l)=>{if(!r&&!s)return;const p=await B(n,t.id,y);let h="over";p===void 0?h="error":p.endType===0?h="over":p.endType===1&&(h="cancelled"),t.flyOverEvent.emit(l,h,i)})),this.d(t.calcFlyToParamEvent.don(()=>{!r&&!s||K(n,t.id)})),this.d(t.calcFlyInParamEvent.don(async()=>{if(!r&&!s||!i.actived)return;const y=await i.getCurrentCameraInfo();if(!y)return;const{position:l,rotation:p}=y;t.flyInParam={position:l,rotation:p,flyDuration:1}})),this.d(i.propChanged.don(y=>{!r&&!s||y.objId===t.id&&Object.keys(y.props).forEach(l=>{const p=y.props[l]===null?void 0:y.props[l];t[l]=p})})),this.d(i.objectEvent.don(y=>{!r&&!s||y.id!==t.id||y.type!=="3DTilesetReady"||t.tilesetReady.emit(y.p)}));{const y=async(m,C)=>{if(!r&&!s)return;const E=await n.callUeFunc({f:"SetFeatureColor",p:{id:t.id,featureName:m,json:C}});if(E&&E.error!==""){console.warn(`UeES3DTileset SetFeatureColor: ${E.error}`);return}},l=async(m,C)=>{if(!r&&!s)return;const E=await n.callUeFunc({f:"SetFeatureVisable",p:{id:t.id,featureName:m,json:C}});if(E&&E.error!==""){console.warn(`UeES3DTileset SetFeatureVisable: ${E.error}`);return}},p=async()=>{if(!r&&!s)return;const m=await n.callUeFunc({f:"ResetFeatureStyle",p:{id:t.id}});if(m&&m.error!==""){console.warn(`UeES3DTileset ResetFeatureStyle: ${m.error}`);return}},h=async m=>{if(!r&&!s)return;const C=await n.callUeFunc({f:"SetFeatureStyle",p:{id:t.id,json:m}});if(C&&C.error!==""){console.warn(`UeES3DTileset SetFeatureStyle: ${C.error}`);return}};this.d(t.setFeatureColorEvent.don((m,C)=>{const E=[...this.styleColor,...C];this.styleColor=[...E],y(m,E)})),this.d(t.setFeatureVisableEvent.don((m,C)=>{const E=[...this.styleVisable,...C];this.styleVisable=[...E],l(m,E)})),this.d(t.resetFeatureStyleEvent.don(()=>{p(),this.styleColor=[],this.styleVisable=[]})),this.d(t.setFeatureStyleEvent.don(m=>{h(m)}))}{const y=async()=>{if(!r&&!s){t._featureTableResultEvent.emit(void 0);return}try{const l=await n.callUeFunc({f:"GetFeatureTable",p:{id:t.id}});l.error!==""&&console.warn(`UeES3DTileset GetFeatureTable: ${l.error}`),t._featureTableResultEvent.emit(l.re.table)}catch(l){console.warn(`UeES3DTileset GetFeatureTable: ${l}`),t._featureTableResultEvent.emit(void 0)}};this.d(t.getFeatureTableEvent.don(()=>{y()}))}{const y=async()=>{if(!r&&!s){t.getMaterialNameListEvent.emit(void 0);return}try{const l=await n.callUeFunc({f:"GetMaterialNameList",p:{id:t.id}});l.error!==""&&console.warn(`UeES3DTileset GetMaterialNameList: ${l.error}`),t.getMaterialNameListEvent.emit(l.re.materialNameList)}catch(l){console.warn(`UeES3DTileset GetMaterialNameList: ${l}`),t.getMaterialNameListEvent.emit(void 0)}};this.ad(t.getMaterialNameListEvent.don(l=>{l=="start"&&y()}))}}get styleColor(){return this._styleColor.value}set styleColor(t){this._styleColor.value=t}get styleVisable(){return this._styleVisable.value}set styleVisable(t){this._styleVisable.value=t}};g(Z,"type",Z.register("ESUeViewer",c.ES3DTileset.type,Z));let he=Z;const _n=u=>{switch(u){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"没搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag对应的Actor是地形,无法绑定";case 4:return"没搜索到ComponentTag,无法绑定";default:return"未知错误"}},b=class b extends c.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}let n,r;const s=this.dv(a.react(void 0)),o=this.ad(a.reactJson(""));{const y=()=>{if(typeof e.url=="string")o.value=c.ESSceneObject.context.getStrFromEnv(e.url);else{const l=e.url;l.url=c.ESSceneObject.context.getStrFromEnv(l.url),o.value=l}};y(),this.ad(e.urlChanged.don(y))}const v=async()=>{!n&&!r||await i.callUeFunc({f:"update",p:{id:e.id,show:e.show??!0,rectangle:e.rectangle??[-180,-90,180,90],collision:e.collision??!0,allowPicking:e.allowPicking??!1,flyToParam:e.flyToParam??c.ESVisualObject.defaults.flyToParam,flyInParam:e.flyInParam??c.ESVisualObject.defaults.flyInParam,url:o.value??"",zIndex:e.zIndex??0,maximumLevel:e.maximumLevel??c.ESImageryLayer.defaults.maximumLevel,minimumLevel:e.minimumLevel??c.ESImageryLayer.defaults.minimumLevel,options:e.options??c.ESImageryLayer.defaults.options,targetID:e.targetID??c.ESImageryLayer.defaults.targetID,opacity:e.opacity??c.ESImageryLayer.defaults.opacity}})},d=this.dv(a.createNextAnimateFrameEvent(e.showChanged,o.changed,e.flyToParamChanged,e.flyInParamChanged,e.zIndexChanged,e.collisionChanged,e.allowPickingChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.rectangleChanged,e.optionsChanged,e.targetIDChanged,e.opacityChanged));this.d(d.don(v));const w=async()=>{const{id:y}=e;if(n!==void 0){n=void 0;try{const l=await t.unBindImageryById(y);if(!l)return;if(l.error!==""){console.warn(`UeESImageryLayer UnImageryByID: ${l.error}`);return}}catch(l){console.warn(`UeESImageryLayer UnImageryByID promise: ${l}`);return}}if(r!==void 0){r=void 0;try{const l=await i.callUeFunc({f:"destroy",p:{id:y,test:"UeESImageryLayer"}});if(!l)return;if(l.error!==""){console.warn(`UeESImageryLayer Destroy: ${l.error}`);return}}catch(l){console.warn(`UeESImageryLayer Destroy promise: ${l}`);return}}};this.d(()=>{w()});{const y=this.dv(a.createProcessingFromAsyncFunc(async p=>{if(s.value===void 0){await p.promise(w());return}if(s.value.type==="ActorTag"){const{actorTag:h,componentTag:m}=s.value;if(n!==h&&await p.promise(w()),n!==void 0||h===void 0)return;try{n=h;const C=await p.promise(t.bindImageryByTag(e.id,h,m));if(!C)return;if(C.error!==""){console.warn(`ESImageryLayer BindImageryByTag: ${C.error}`);return}if(C.re.type!==0)if(C.re.type===1)console.warn(`ESImageryLayer BindImageryByTag: ${_n(C.re.type)}`);else{console.warn(`ESImageryLayer BindImageryByTag: ${_n(C.re.type)}`);return}}catch(C){console.warn(`ESImageryLayer BindImageryByTag promise: ${C}`);return}}else if(s.value.type==="CreatedUrl"){const{url:h}=s.value;if(h!==r&&await p.promise(w()),r!==void 0||h===void 0)return;try{r=h;const m=await p.promise(i.callUeFunc({f:"create",p:{type:"ESImageryLayer",id:e.id}}));if(!m)return;if(m.error!==""){console.warn(`ESImageryLayer create: ${m.error}`);return}}catch{console.warn("ESImageryLayer create: create promise error");return}}await p.promise(v())})),l=async()=>{y.restart()};l(),this.d(s.changed.don(l))}{const y=this.dv(a.createNextAnimateFrameEvent(e.actorTagChanged,o.changed,e.componentTagChanged)),l=()=>{e.actorTag&&e.componentTag?s.value={type:"ActorTag",actorTag:e.actorTag,componentTag:e.componentTag}:o.value?s.value={type:"CreatedUrl",url:o.value}:s.value=void 0};l(),this.d(y.don(l))}this.d(e.flyToEvent.don(async(y,l)=>{if(!n&&!r)return;const p=await B(i,e.id,y);let h="over";p===void 0?h="error":p.endType===0?h="over":p.endType===1&&(h="cancelled"),e.flyOverEvent.emit(l,h,t)})),this.d(e.flyInEvent.don(async(y,l)=>{var m,C;if(!n&&!r)return;const p=await Q(i,e.id,(m=e.flyInParam)==null?void 0:m.position,(C=e.flyInParam)==null?void 0:C.rotation,y??1);let h="over";p===void 0?h="error":p.endType===0?h="over":p.endType===1&&(h="cancelled"),e.flyOverEvent.emit(l,h,t)})),this.d(e.calcFlyToParamEvent.don(()=>{!n&&!r||K(i,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const y=await t.getCurrentCameraInfo();if(!y)return;const{position:l,rotation:p}=y;e.flyInParam={position:l,rotation:p,flyDuration:1}})),this.d(t.propChanged.don(y=>{!n&&!r||y.objId===e.id&&Object.keys(y.props).forEach(l=>{const p=y.props[l]===null?void 0:y.props[l];e[l]=p})}))}};g(b,"type",b.register("ESUeViewer",c.ESImageryLayer.type,b));let Ee=b;const N=class N extends k{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(N,"type",N.register("ESUeViewer",c.ESTerrainLayer.type,N)),g(N,"forceUeUpdateProps",[...k.forceUeUpdateProps,"url"]),g(N,"propValFuncs",{...k.propValFuncs,url:e=>typeof e=="string"?c.ESSceneObject.context.getStrFromEnv(e):(e.url=c.ESSceneObject.context.getStrFromEnv(e.url),e),czmMaxzoom:null,czmMinzoom:null});let Fe=N;const x=class x extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(x,"type",x.register("ESUeViewer",c.ESAlarm.type,x));let Se=x;const O=class O extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(O,"type",O.register("ESUeViewer",c.ESApertureEffect.type,O));let Ie=O;const j=class j extends L{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(j,"type",j.register("ESUeViewer",c.ESGeoPolygon.type,j));let P=j;const tt=class tt extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let s=c.ESAreaMeasurement.defaults.fillStyle;try{s={...e.fillStyle??c.ESAreaMeasurement.defaults.fillStyle}}catch(o){console.error("ESAreaMeasurement fillStyle 属性类型错误!",o),s={...c.ESAreaMeasurement.defaults.fillStyle}}s.materialParams=JSON.stringify(s.materialParams),i.callUeFunc({f:"update",p:{id:e.id,stroked:e.stroked??c.ESAreaMeasurement.defaults.stroked,fillStyle:s,filled:e.filled??c.ESAreaMeasurement.defaults.filled}}),console.log(s)},r=this.dv(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.strokedChanged,e.filledChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};g(tt,"type",tt.register("ESUeViewer",c.ESAreaMeasurement.type,tt));let Te=tt;const et=class et extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(et,"type",et.register("ESUeViewer",c.ESBlastParticleSystem.type,et));let Re=et;const it=class it extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};g(it,"type",it.register("ESUeViewer",c.ESBoxClipping.type,it));let De=it;const nt=class nt extends S{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.dispose(e.flyInEvent.don((n,r,s="default")=>{const{id:o,duration:v,position:d,rotation:w}=e;Q(i,o,d,w,v??n,s)})),this.dispose(e.resetWithCurrentCameraEvent.don(()=>{ye(i,e.id)})),this.dispose(e.captureEvent.don((n,r)=>{t.capture(n,r).then(o=>{o&&(e.thumbnail=o)})}))}};g(nt,"type",nt.register("ESUeViewer",c.ESCameraView.type,nt));let ke=nt;const rt=class rt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(rt,"type",rt.register("ESUeViewer",c.ESCameraVisibleRange.type,rt));let Le=rt;const st=class st extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(st,"type",st.register("ESUeViewer",c.ESCar.type,st));let Pe=st;const ot=class ot extends L{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let s=c.ESClassification.defaults.fillStyle;try{s={...e.fillStyle??c.ESClassification.defaults.fillStyle}}catch(o){console.error("ESClassification fillStyle 属性类型错误!",o),s={...c.ESClassification.defaults.fillStyle}}s.materialParams=JSON.stringify(s.materialParams),i.callUeFunc({f:"update",p:{id:e.id,filled:e.filled??c.ESClassification.defaults.filled,fillStyle:s}})},r=this.dv(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};g(ot,"type",ot.register("ESUeViewer",c.ESClassification.type,ot));let Ue=ot;const at=class at extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};g(at,"type",at.register("ESUeViewer",c.ESClippingPlane.type,at));let Me=at;const lt=class lt extends S{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=this.ad(a.reactJson(""));{const o=()=>{if(typeof e.url=="string")n.value=c.ESSceneObject.context.getStrFromEnv(e.url??c.ESDataMesh.defaults.url);else{const v=e.url;v.url=c.ESSceneObject.context.getStrFromEnv(v.url??c.ESDataMesh.defaults.url),n.value=v}};o(),this.ad(e.urlChanged.don(o))}const r=()=>{const o=e.colorStops??c.ESDataMesh.defaults.colorStops;i.callUeFunc({f:"update",p:{id:e.id,url:n.value??c.ESDataMesh.defaults.url,currentTime:e.currentTime??c.ESDataMesh.defaults.currentTime,minPropValue:e.minPropValue??c.ESDataMesh.defaults.minPropValue,maxPropValue:e.maxPropValue??c.ESDataMesh.defaults.maxPropValue,colorStops:JSON.stringify(o)}})},s=this.dv(a.createNextAnimateFrameEvent(n.changed,e.currentTimeChanged,e.minPropValueChanged,e.maxPropValueChanged,e.colorStopsChanged));this.d(s.don(r)),this.d(e.createdEvent.don(r))}};g(lt,"type",lt.register("ESUeViewer",c.ESDataMesh.type,lt));let Ae=lt;const dt=class dt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(dt,"type",dt.register("ESUeViewer",c.ESDatasmithRuntimeModel.type,dt));let We=dt;const ct=class ct extends L{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(ct,"type",ct.register("ESUeViewer",c.ESDirectionMeasurement.type,ct));let $e=ct;const ut=class ut extends L{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let s;try{s={...e.strokeStyle??c.ESDistanceMeasurement.defaults.strokeStyle}}catch(o){console.error("ESDistanceMeasurement strokeStyle 属性类型错误!",o),s={...c.ESDistanceMeasurement.defaults.strokeStyle}}i.callUeFunc({f:"update",p:{id:e.id,strokeStyle:s}})},r=this.dv(a.createNextAnimateFrameEvent(e.strokeStyleChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};g(ut,"type",ut.register("ESUeViewer",c.ESDistanceMeasurement.type,ut));let _e=ut;const ht=class ht extends ue{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(ht,"type",ht.register("ESUeViewer",c.ESLocalPolygon.type,ht));let ve=ht;const vt=class vt extends ve{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(vt,"type",vt.register("ESUeViewer",c.ESDynamicWater.type,vt));let Ne=vt;const gt=class gt extends k{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(t.widgetEvent.don(n=>{if(n.objId!==e.id)return;const{type:r,properties:s}=n;e.widgetEvent.emit({type:r,properties:s})}))}};g(gt,"type",gt.register("ESUeViewer",c.ESEntityCluster.type,gt));let ze=gt;const ft=class ft extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(ft,"type",ft.register("ESUeViewer",c.ESExcavate.type,ft));let He=ft;const pt=class pt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(pt,"type",pt.register("ESUeViewer",c.ESFireParticleSystem.type,pt));let Ge=pt;const wt=class wt extends k{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=this.ad(a.reactJson(""));{const o=()=>{if(typeof e.url=="string")n.value=c.ESSceneObject.context.getStrFromEnv(e.url);else{const v=e.url;v.url=c.ESSceneObject.context.getStrFromEnv(v.url),n.value=v}};o(),this.ad(e.urlChanged.don(o))}const r=()=>{i.callUeFunc({f:"update",p:{id:e.id,url:n.value??c.ESForestTileset.defaults.url,treeTypes:e.treeTypes??c.ESForestTileset.defaults.treeTypes,xiaoBanWidget:e.xiaoBanWidget??c.ESForestTileset.defaults.xiaoBanWidgetDefault,youShiSZ:e.youShiSZ??c.ESForestTileset.defaults.youShiSZ,diLei:e.diLei??c.ESForestTileset.defaults.diLei,senLinLB:e.senLinLB??c.ESForestTileset.defaults.senLinLB,labelMaterial:e.labelMaterial??c.ESForestTileset.defaults.labelMaterial,heightOffset:e.heightOffset??c.ESForestTileset.defaults.heightOffset}})},s=this.dv(a.createNextAnimateFrameEvent(n.changed,e.treeTypesChanged,e.xiaoBanWidgetChanged,e.youShiSZChanged,e.diLeiChanged,e.senLinLBChanged,e.labelMaterialChanged,e.heightOffsetChanged));this.d(s.don(r)),this.d(e.createdEvent.don(r))}};g(wt,"type",wt.register("ESUeViewer",c.ESForestTileset.type,wt));let Je=wt;const yt=class yt extends c.EngineObject{constructor(t,i){super(t,i);g(this,"_imageLabel",this.dv(new c.ESImageLabel(`${this.sceneObject.id}_ESImageLabel`)));g(this,"_hasClassDivAndPos",{});const n=i.viewer;if(!n){console.warn("viewer is undefined!");return}t.mainClass=this._imageLabel;const r=this._imageLabel;i.add(r),this.d(()=>i.delete(r));{const s=()=>{if(!n)return;if(!t.instanceClass)throw new Error("!sceneObject.instanceClass");const d=document.createElement("div"),w=this.dv(new t.instanceClass(d,t,i))._container;if(w.style.opacity=t.opacity.toString()??c.ESGeoDiv.defaults.opacity,w.style.position="fixed",w.style.zIndex="-1",w.style.top="0px",!document.body.contains(w)){document.body.appendChild(w);let l=w?w.querySelectorAll("*[class]"):[];for(let p=0;p<l.length;p++){const h=l[p];var y=h.getBoundingClientRect();this._hasClassDivAndPos[h.className]=[h.offsetLeft,h.offsetTop,h.offsetLeft+y.width,h.offsetTop+y.height]}}zn(w,{backgroundColor:null,allowTaint:!0,useCORS:!0,width:w.offsetWidth,height:w.offsetHeight,scale:1}).then(l=>{document.body.contains(w)&&document.body.removeChild(w),r.url=l.toDataURL(),r.show=t.show}).catch(()=>{document.body.contains(w)&&document.body.removeChild(w)})},o=()=>{try{t.instanceClass?s():(r.url="",r.show=!1)}catch(d){console.error(d)}};o();const v=this.dv(a.createNextAnimateFrameEvent(t.instanceClassChanged,t.opacityChanged));this.d(v.don(o))}{const s=()=>{r.show=t.show};r.show=!1,this.ad(t.showChanged.don(s))}this.d(a.track([r,"anchor"],[t,"anchor"])),this.d(a.bind([r,"position"],[t,"position"])),this.d(a.bind([r,"rotation"],[t,"rotation"])),this.d(a.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(a.bind([r,"flyInParam"],[t,"flyInParam"])),this.d(a.bind([r,"allowPicking"],[t,"allowPicking"])),this.d(a.bind([r,"scale"],[t,"scale"])),this.d(a.track([r,"minVisibleDistance"],[t,"minVisibleDistance"])),this.d(a.track([r,"maxVisibleDistance"],[t,"maxVisibleDistance"])),this.ad(t.automaticLandingEvent.don(()=>{r.automaticLanding()})),this.d(r.pickedEvent.don(s=>{(t.allowPicking??!1)&&t.pickedEvent.emit(s)})),this.d(i.widgetEvent.don(s=>{if(s.objId!==this._imageLabel.id)return;const{type:o,add:v}=s;if(o==="leftClick"){const d=Object.keys(this._hasClassDivAndPos);for(let w=0;w<d.length;w++){const y=d[w];let l=this._hasClassDivAndPos[y];if(v&&v.mouseRelativePos&&v.mouseRelativePos[0]>=l[0]&&v.mouseRelativePos[0]<=l[2]&&v.mouseRelativePos[1]>=l[1]&&v.mouseRelativePos[1]<=l[3]){v.className=y;break}}}t.widgetEvent.emit({type:o,add:v})})),this.d(t.calcFlyToParamEvent.don(()=>{K(n,r.id)})),this.d(t.calcFlyInParamEvent.don(()=>{const s=i.getCurrentCameraInfo();if(!s)return;const{position:o,rotation:v}=s;t.flyInParam={position:o,rotation:v,flyDuration:1}})),this.d(t.smoothMoveEvent.don((s,o)=>{ce(n,r.id,s,o)})),this.d(t.smoothMoveWithRotationEvent.don((s,o,v)=>{ae(n,r.id,s,o,v)})),this.d(t.smoothMoveOnGroundEvent.don((s,o,v,d)=>{le(n,r.id,s,o,d,v)})),this.d(t.smoothMoveWithRotationOnGroundEvent.don((s,o,v,d,w)=>{de(n,r.id,s,o,v,d,w)})),this.d(t.flyToEvent.don((s,o)=>{r.flyTo(s)})),this.d(t.flyInEvent.don(s=>{r.flyIn(s)}))}};g(yt,"type",yt.register("ESUeViewer",c.ESGeoDiv.type,yt));let Be=yt;const mt=class mt extends k{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.flyToFeatureIndexEvent.don((n,r)=>{i.callUeFunc({f:"flyToFeatureIndex",p:{id:e.id,index:n,duration:r}})})),this.d(e.flyToFeatureEvent.don((n,r,s)=>{i.callUeFunc({f:"flyToFeature",p:{id:e.id,key:n,value:r,duration:s}})}))}};g(mt,"type",mt.register("ESUeViewer",c.ESGeoJson.type,mt));let Ke=mt;const Ct=class Ct extends L{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(Ct,"type",Ct.register("ESUeViewer",c.ESGeoLineString.type,Ct));let ge=Ct;const Et=class Et extends L{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(Et,"type",Et.register("ESUeViewer",c.ESGeoRectangle.type,Et));let Ve=Et;const Ft=class Ft extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(Ft,"type",Ft.register("ESUeViewer",c.ESGeoWater.type,Ft));let qe=Ft;const z=class z extends S{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.setNodePositionEvent.don((n,r)=>{qi(i,e.id,n,r)})),this.d(e.setNodeRotationEvent.don((n,r)=>{Xi(i,e.id,n,r)})),this.d(e.setNodeScaleEvent.don((n,r)=>{Qi(i,e.id,n,r)}))}};g(z,"forceUeUpdateProps",[...S.forceUeUpdateProps,"url"]),g(z,"propValFuncs",{...S.propValFuncs,url:e=>typeof e=="string"?c.ESSceneObject.context.getStrFromEnv(c.rpToap(e)):(e.url=c.ESSceneObject.context.getStrFromEnv(c.rpToap(e.url)),e),czmMaximumScale:null,czmMinimumPixelSize:null,czmNativeScale:null,czmColor:null}),g(z,"type",z.register("ESUeViewer",c.ESGltfModel.type,z));let Xe=z;const St=class St extends L{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(St,"type",St.register("ESUeViewer",c.ESHeightMeasurement.type,St));let Qe=St;const It=class It extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=async(s,o,v,d)=>{const{viewer:w}=s;if(!w){console.error("AIMoveTo: ueViewer.viewer is undefined");return}const y=await w.callUeFunc({f:"AIMoveTo",p:{id:o,Destination:v,Time:d}});return y.error&&console.error("AIMoveTo:",y.error),y};this.d(e.aiMoveToEvent.don((s,o)=>{n(t,e.id,s,o)}));const r=async(s,o)=>{const{viewer:v}=s;if(!v){console.error("StopAIMove: ueViewer.viewer is undefined");return}const d=await v.callUeFunc({f:"StopAIMove",p:{id:o}});return d.error&&console.error("StopAIMove:",d.error),d};this.d(e.stopAIMoveEvent.don(()=>{r(t,e.id)}))}};g(It,"type",It.register("ESUeViewer",c.ESHuman.type,It));let Ye=It;const H=class H extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}e.anchor=[.5,1]}};g(H,"type",H.register("ESUeViewer",c.ESImageLabel.type,H)),g(H,"forceUeUpdateProps",[...U.forceUeUpdateProps,"url"]),g(H,"propValFuncs",{...U.propValFuncs,url:e=>typeof e=="string"?c.ESSceneObject.context.getStrFromEnv(c.rpToap(e)):(e.url=c.ESSceneObject.context.getStrFromEnv(c.rpToap(e.url)),e)});let Ze=H;const Tt=class Tt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(Tt,"type",Tt.register("ESUeViewer",c.ESLevelRuntimeModel.type,Tt));let be=Tt;const Rt=class Rt extends ue{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(Rt,"type",Rt.register("ESUeViewer",c.ESLocalCircle.type,Rt));let xe=Rt;const Dt=class Dt extends k{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(Dt,"type",Dt.register("ESUeViewer",c.ESLocalPolygonZ.type,Dt));let Oe=Dt;const kt=class kt extends ue{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(kt,"type",kt.register("ESUeViewer",c.ESLocalRectangle.type,kt));let je=kt;const Lt=class Lt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(Lt,"type",Lt.register("ESUeViewer",c.ESLocalSkyBox.type,Lt));let ti=Lt;const Pt=class Pt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(Pt,"type",Pt.register("ESUeViewer",c.ESLocationMeasurement.type,Pt));let ei=Pt;const Ut=class Ut extends L{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(Ut,"type",Ut.register("ESUeViewer",c.ESPipeFence.type,Ut));let ii=Ut;const Mt=class Mt extends ge{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(Mt,"type",Mt.register("ESUeViewer",c.ESPipeline.type,Mt));let ni=Mt;const At=class At extends he{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.highlightFeatureEvent.don(n=>{const r=typeof n=="number"?n.toString():n;Ji(i,e.id,r)})),this.d(e.highlightFeatureAndFlyToEvent.don((n,r,s,o)=>{const v=typeof n=="number"?n.toString():n;Bi(i,e.id,v,o??1)})),this.d(e.setLayerVisibleEvent.don((n,r)=>{let s="";typeof r!="string"?s=JSON.stringify(r):s=r,Ki(i,e.id,s)})),this.d(e.setLayerColorEvent.don((n,r)=>{let s="";typeof r!="string"?s=JSON.stringify(r):s=r,Vi(i,e.id,s)}))}};g(At,"type",At.register("ESUeViewer",c.ESPipeserTileset.type,At));let ri=At;const Wt=class Wt extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(Wt,"type",Wt.register("ESUeViewer",c.ESPit.type,Wt));let si=Wt;const $t=class $t extends U{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.ad(e.getInitialStyleEvent.don(async()=>{try{const n=await i.callUeFunc({f:"GetInitialStyle",p:{id:e.id}});n.error!=""&&console.error("getInitialStyleEvent:",n.error),e.initialStyle.value=structuredClone(n.re)}catch(n){console.error("getInitialStyleEvent:",n),e.initialStyle.value=void 0}}))}};g($t,"type",$t.register("ESUeViewer",c.ESPoi2D.type,$t));let oi=$t;const _t=class _t extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(_t,"type",_t.register("ESUeViewer",c.ESPoi3D.type,_t));let ai=_t;const G=class G extends k{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(G,"type",G.register("ESUeViewer",c.ESPoiTileset.type,G)),g(G,"forceUeUpdateProps",[...k.forceUeUpdateProps,"url"]),g(G,"propValFuncs",{...k.propValFuncs,url:e=>typeof e=="string"?c.ESSceneObject.context.getStrFromEnv(e):(e.url=c.ESSceneObject.context.getStrFromEnv(e.url),e)});let li=G;const Nt=class Nt extends L{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(Nt,"type",Nt.register("ESUeViewer",c.ESPolygonFence.type,Nt));let di=Nt;const zt=class zt extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(zt,"type",zt.register("ESUeViewer",c.ESPolygonFlattenedPlane.type,zt));let ci=zt;const Ht=class Ht extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(Ht,"type",Ht.register("ESUeViewer",c.ESPolygonWithHole.type,Ht));let ui=Ht;const Gt=class Gt extends ${constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(()=>{e.ids=[]}),this.d(e.highlightInner3DtilesetEvent.don(n=>{n.highlight=!0})),this.d(e.removeHighlightInner3DtilesetEvent.don(n=>{n.highlight=!1}));{const n=o=>{o=o.toLocaleLowerCase();let v=[255,255,255,1];if(o.startsWith("#")){if(o.length===4){let d=parseInt(o[1]+o[1],16),w=parseInt(o[2]+o[2],16),y=parseInt(o[3]+o[3],16);v=[d,w,y,1]}else if(o.length===7){let d=parseInt(o.substring(1,3),16),w=parseInt(o.substring(3,5),16),y=parseInt(o.substring(5,7),16);v=[d,w,y,1]}}else if(o.startsWith("rgba")){let d=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/);if(d){let w=parseInt(d[1]),y=parseInt(d[2]),l=parseInt(d[3]),p=parseFloat(d[4]);v=[w,y,l,p]}}else if(o.startsWith("rgb")){let d=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);if(d){let w=parseInt(d[1]),y=parseInt(d[2]),l=parseInt(d[3]);v=[w,y,l,1]}}else console.error("color类型只能为#rrggbb、#rgb、rgba(r,g,b,a)、rgb(r,g,b)");return[v[0]/255,v[1]/255,v[2]/255,v[3]]},r=()=>{const o=e.layerConfig;if(!o)return;const v=[];o.forEach(d=>{v.push({condition:[{field:"layer",op:"==",value:d.layer},{field:"dataset",op:"==",value:d.dataset}],color:n(d.value.color??"rgb(255,255,255)"),show:d.value.visible})}),e.setFeatureStyle(v)};r();const s=this.dv(a.createNextAnimateFrameEvent(e.layerConfigChanged));this.d(s.don(()=>{r()}))}}};g(Gt,"type",Gt.register("ESUeViewer",c.ESRtsTileset.type,Gt));let hi=Gt;const Jt=class Jt extends k{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(e.addTreesEvent.don(n=>{c.addTreesCallFunc(t,e.id,n)})),this.d(e.removeAllTreesEvent.don(()=>{c.removeAllTreesCallFunc(t,e.id)})),this.d(e.updateTreeParamsEvent.don(n=>{c.updateTreeParamsCallFunc(t,e.id,n)})),this.d(e.cutDownTreesEvent.don((n,r)=>{c.cutDownTreesCallFunc(t,e.id,n,r)})),this.d(e.growthSimulationEvent.don((n,r,s)=>{c.growthSimulationCallFunc(t,e.id,n,r,s)}))}};g(Jt,"type",Jt.register("ESUeViewer",c.ESSeparateFoliage.type,Jt));let vi=Jt;const Bt=class Bt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(Bt,"type",Bt.register("ESUeViewer",c.ESSubmergingAnalysis.type,Bt));let gi=Bt;const Kt=class Kt extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{i.callUeFunc({f:"Start",p:{id:e.id}})})),this.d(e.stopEvent.don(()=>{i.callUeFunc({f:"Stop",p:{id:e.id}})}))}};g(Kt,"type",Kt.register("ESUeViewer",c.ESSunshineAnalysis.type,Kt));let fi=Kt;const Vt=class Vt extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{i.callUeFunc({f:"Start",p:{id:e.id}})}))}};g(Vt,"type",Vt.register("ESUeViewer",c.ESSurfaceAreaMeasurement.type,Vt));let pi=Vt;const qt=class qt extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(qt,"type",qt.register("ESUeViewer",c.ESTextLabel.type,qt));let wi=qt;const V=class V extends U{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.callFunctionEvent.don((n,r)=>{me(i,e.id,n,r)}))}};g(V,"type",V.register("ESUeViewer",c.ESUEWidget.type,V)),g(V,"propValFuncs",{...U.propValFuncs,info:e=>JSON.stringify(e??{})});let yi=V;const Nn=u=>{switch(u){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"未搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是场景原有的,而是新建的,无法绑定";case 4:return"搜索到ActorTag对应的Actor是地形或3DTileset,无法绑定";default:return"未知错误"}},cr=u=>{switch(u){case 0:return"创建成功";case 1:return"未找到对应的资源,无法创建";case 2:return"Id与场景中现有的ActorTag重复,创建后可能出现问题,创建失败";default:return"未知错误"}},Xt=class Xt extends c.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn(`${e.id} UeESUnrealActor viewer is undefined!`);return}this.d(()=>{we(i,e.id)});const n=async()=>{d()||await i.callUeFunc({f:"update",p:{id:e.id,name:e.name,show:e.show,rotation:e.rotation,flyToParam:e.flyToParam??c.ESVisualObject.defaults.flyToParam,flyInParam:e.flyInParam??c.ESVisualObject.defaults.flyInParam,highlight:e.highlight,collision:e.collision,scale:e.scale,minVisibleDistance:e.minVisibleDistance,maxVisibleDistance:e.maxVisibleDistance}})},r=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.nameChanged,e.rotationChanged,e.flyToParamChanged,e.flyInParamChanged,e.highlightChanged,e.collisionChanged,e.scaleChanged,e.minVisibleDistanceChanged,e.maxVisibleDistanceChanged));this.d(r.don(n)),this.d(e.flushEvent.don(()=>r.flush()));let s,o;const v=async()=>{d()||(await i.callUeFunc({f:"update",p:{id:e.id,position:e.position}}),(t.debug??!1)&&console.log(`updatePostion:${e.position},actorTag:${e.actorTag},actorClass:${e.actorClass}`))},d=()=>!s&&!o?(console.warn(`${e.id} 未绑定ActorTag或未创建ActorClass!`),!0):!1,w=async()=>{const{id:l}=e,p=await t.unBindActorByID(l);p&&p.error!==""&&console.warn(`${e.id} UeESUnrealActor UnBindActorByID: ${p.error}`),s=void 0;const h=await i.callUeFunc({f:"destroy",p:{id:l}});if(h&&h.error!==""){console.warn(`${e.id} UeESUnrealActor DestroyActorByID: ${h.error}`);return}o=void 0},y=this.dv(a.react({type:"ActorClass",actorClass:"default"}));{const l=this.dv(a.createNextAnimateFrameEvent(e.actorClassChanged,e.actorTagChanged)),p=async()=>{e.actorTag!==""?y.value={type:"ActorTag",actorTag:e.actorTag}:y.value={type:"ActorClass",actorClass:e.actorClass===""?"default":e.actorClass}};p(),this.d(l.don(p)),this.d(e.flushEvent.don(()=>l.flush()))}{const l=this.dv(a.createProcessingFromAsyncFunc(async h=>{if(await h.promise(w()),y.value.type==="ActorTag"){const{actorTag:m}=y.value;await h.promise(w());try{e.lastActorStatus="null";const C=await h.promise(t.bindActorByTag(e.id,m));if(!C)return;if(C.error!==""){console.warn(`${e.id} UeESUnrealActor BindActorByTag:${m},${C.error}`);return}if(C.re.type===0)e.lastActorStatus="bound",s=m;else if(C.re.type===1)e.lastActorStatus="bound",s=m,console.warn(`${e.id} UeESUnrealActor BindActorByTag:${m},${Nn(C.re.type)}`);else{s=void 0,console.warn(`${e.id} UeESUnrealActor BindActorByTag error:${m}, ${Nn(C.re.type)}`);return}}catch(C){console.warn(`${e.id} UeESUnrealActor BindActorByTag catch error:${m}, ${C}`);return}}else if(y.value.type==="ActorClass"){const{actorClass:m}=y.value;try{const C=await h.promise(t.createActorByClass(e.id,m));if(!C)return;if(C.error!==""){console.warn(`${e.id} UeESUnrealActor CreateActorByClass error :${m}, ${C.error}`);return}if(C.re.type===0)e.lastActorStatus="created",o=m;else{console.warn(`${e.id} UeESUnrealActor CreateActorByClass error type :${m},${cr(C.re.type)}`);return}}catch(C){console.warn(`${e.id} UeESUnrealActor CreateActorByClass error catch :${m}, ${JSON.stringify(C)}`);return}}await h.promise(n()),await h.promise(v())})),p=async()=>{l.restart()};p(),this.d(y.changed.don(p))}this.d(e.positionChanged.don(v)),this.d(e.callFunctionEvent.don((l,p)=>{d()||me(i,e.id,l,p)})),this.d(e.smoothMoveEvent.don((l,p)=>{d()||ce(i,e.id,l,p)})),this.d(e.smoothMoveWithRotationEvent.don((l,p,h)=>{d()||ae(i,e.id,l,p,h)})),this.d(e.smoothMoveOnGroundEvent.don((l,p,h,m)=>{d()||le(i,e.id,l,p,m,h)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((l,p,h,m,C)=>{d()||de(i,e.id,l,p,h,m,C)})),this.d(e.automaticLandingEvent.don(l=>{if(d())return;const p=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(h=>{h!==null&&(e.position=[...p,h],e.collision=l)})})),this.d(e.flyToEvent.don(async(l,p)=>{if(d())return;const h=await B(i,e.id,l);let m="over";h===void 0?m="error":h.endType===0?m="over":h.endType===1&&(m="cancelled"),e.flyOverEvent.emit(p,m,t)})),this.d(e.calcFlyToParamEvent.don(()=>{d()||K(i,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const l=await t.getCurrentCameraInfo();if(!l)return;const{position:p,rotation:h}=l;e.flyInParam={position:p,rotation:h,flyDuration:1}})),this.d(t.propChanged.don(l=>{d()||l.objId===e.id&&Object.keys(l.props).forEach(p=>{const h=l.props[p]===null?void 0:l.props[p];e[p]=h})}))}};g(Xt,"type",Xt.register("ESUeViewer",c.ESUnrealActor.type,Xt));let mi=Xt;const Qt=class Qt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(Qt,"type",Qt.register("ESUeViewer",c.ESVideoFusion.type,Qt));let Ci=Qt;const Yt=class Yt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(Yt,"type",Yt.register("ESUeViewer",c.ESViewShed.type,Yt));let Ei=Yt;const Zt=class Zt extends L{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};g(Zt,"type",Zt.register("ESUeViewer",c.ESVisibilityAnalysis.type,Zt));let Fi=Zt;const bt=class bt extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{i.callUeFunc({f:"Start",p:{id:e.id}})})),this.d(e.clearEvent.don(()=>{i.callUeFunc({f:"Clear",p:{id:e.id}})}))}};g(bt,"type",bt.register("ESUeViewer",c.ESVolumeMeasurement.type,bt));let Si=bt;const q=class q extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(q,"type",q.register("ESUeViewer",c.ESWidget.type,q)),g(q,"propValFuncs",{...U.propValFuncs,info:e=>JSON.stringify(e??{})});let Ii=q;const xt=class xt extends c.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}e.poi.actorTag=e.human.id,e.poi.positionOffset=[0,0,e.poiOffsetHeight-.8],this.d(e.poiOffsetHeightChanged.don(()=>{e.poi.positionOffset=[0,0,e.poiOffsetHeight-.8]})),this.d(()=>{e.poi.actorTag=""})}};g(xt,"type",xt.register("ESUeViewer",c.ESHumanPoi.type,xt));let Ti=xt;c.ESSceneObject.context.getStrFromEnv(c.ESNavigator.defaults.imgUrl);const Ot=class Ot extends c.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new c.ESCustomDiv);t.add(n),this.dispose(()=>t.delete(n)),this.dispose(a.track([n,"show"],[e,"show"])),n.instanceClass=class extends a.Destroyable{constructor(s,o,v){super(),this._subContainer=s;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));{const l=async()=>{const p=await t.getCurrentCameraInfo(),h=p==null?void 0:p.position,C=[...p==null?void 0:p.rotation];C[0]=360,t.flyIn(h,C)};d.addEventListener("click",l),d.style.cursor="pointer",this.dispose(()=>d.removeEventListener("click",l))}{const l=()=>{d.style.width=`${e.cssSize?e.cssSize:c.ESNavigator.defaults.cssSize}px`,d.style.height=`${e.cssSize?e.cssSize:c.ESNavigator.defaults.cssSize}px`};l(),e.dispose(e.cssSizeChanged.disposableOn(l))}d.style.position="fixed";{const l=()=>{d.style.top=`${e.cssPosition?e.cssPosition[0]:c.ESNavigator.defaults.cssPosition[0]}px`,d.style.right=`${e.cssPosition?e.cssPosition[1]:c.ESNavigator.defaults.cssPosition[1]}px`};l(),e.dispose(e.cssPositionChanged.disposableOn(l))}d.style.transition=" right 0.4s linear",d.style.cursor="pointer";const w=document.createElement("div");d.appendChild(w),this.dispose(()=>d.removeChild(w)),w.style.width="100%",w.style.height="100%",w.style.position="relative";const y=document.createElement("img");w.appendChild(y),this.dispose(()=>w.removeChild(y)),y.style.width="100%",y.style.height="100%",y.style.border="none";{const l=()=>y.src=e.imgUrl;l(),e.dispose(e.imgUrlChanged.disposableOn(l))}{const l=()=>{const C=-t.getCurrentCameraInfo().rotation[0];y.style.transform=`rotate(${C}deg)`};let p;const h=async()=>{l(),e.show?(d.style.display="block",p=setInterval(()=>{l()},1e3)):(d.style.display="none",clearInterval(p))};this.dispose(e.showChanged.disposableOn(h)),h(),this.dispose(()=>clearInterval(p))}y.style.transformOrigin="50% 50%"}}}};g(Ot,"type",Ot.register("ESUeViewer",c.ESNavigator.type,Ot));let Ri=Ot;const J=class J extends L{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}{const n=()=>{let r=e.materialMode==="blue"?"multipleArrows":e.materialMode==="purple"?"singleArrow":e.materialMode;i.callUeFunc({f:"update",p:{id:e.id,materialMode:r}})};this.dispose(e.materialModeChanged.disposableOn(n)),this.dispose(e.createdEvent.disposableOn(n))}}};g(J,"type",J.register("ESUeViewer",c.ESPath.type,J)),g(J,"forceUeUpdateProps",[...L.forceUeUpdateProps]),g(J,"propValFuncs",{...L.propValFuncs,materialMode:null});let Di=J;async function ur(u){navigator.clipboard.writeText(u).then(function(){console.log("复制成功")},function(e){console.log("复制失败")})}const jt=class jt extends c.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new c.ESCustomDiv);t.add(n),this.dispose(()=>t.delete(n)),n.instanceClass=class extends a.Destroyable{constructor(s,o,v){if(super(),this._subContainer=s,!v||!(v instanceof A))return;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d)),d.style.width="100%",d.style.position="absolute",d.style.height=`${c.ESViewerStatusBar.defaults.height}px`,d.style.left="0",d.style.bottom="0",d.style.color="#fff",d.style.padding="0 20px 0 0",d.style.boxSizing="border-box",d.style.lineHeight=`${c.ESViewerStatusBar.defaults.height}px`,d.style.zIndex="100",d.style.alignContent="center",d.style.justifyContent="space-between";const w=document.createElement("span");d.appendChild(w),this.dispose(()=>d.removeChild(w));const y=document.createElement("span");w.appendChild(y),this.dispose(()=>w.removeChild(y));const l=document.createElement("span");w.appendChild(l),l.addEventListener("dblclick",function(){let h=l.innerHTML;h.startsWith("鼠标位置")&&(h=h.slice(5)),ur(h)}),l.style.cursor="pointer",this.dispose(()=>w.removeChild(l));const p=document.createElement("span");d.appendChild(p),this.dispose(()=>d.removeChild(p));{const h=()=>{d.style.height=(e.height??c.ESViewerStatusBar.defaults.height)+"px",d.style.lineHeight=(e.height??c.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(h)),h()}{const h=()=>{d.style.fontSize=(e.fontSize??c.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(h)),h()}{const h=()=>{e.bgColor?d.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:d.style.background=`rgba(${c.ESViewerStatusBar.defaults.bgColor[0]},${c.ESViewerStatusBar.defaults.bgColor[1]},${c.ESViewerStatusBar.defaults.bgColor[2]},${c.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(h)),h()}v.getVersion().then(h=>{h&&(p.innerText=`Ue 版本 : ${h[0]} `)}).catch(h=>{console.log(h)});{const h=()=>{let E="",I="";E+=`帧率:${v.getFPS().toFixed(0)}FPS`,y.innerText=E;const F=t.getCurrentCameraInfo();E+=` 经度: ${F.position[0].toFixed(5)}° 纬度: ${F.position[1].toFixed(5)}° 高度: ${F.position[2].toFixed(2)}米 偏航角: ${F.rotation[0].toFixed(2)}° 俯仰角: ${F.rotation[1].toFixed(2)}° 翻滚角:${F.rotation[2].toFixed(2)}° `,y.innerText=E,t.pick().then(R=>{if(R){const{pickResult:T}=R;if(T&&T.position){const{position:W}=T;I+=`鼠标位置:${W[0].toFixed(5)}° ${W[1].toFixed(5)}° ${W[2].toFixed(2)}m`}else I+="暂时无法获取鼠标位置...";l.innerText=I}}).catch(R=>{console.log(R)})};let m;const C=async()=>{h(),e.show?(d.style.display="flex",m=setInterval(()=>{h()},1e3)):(d.style.display="none",clearInterval(m))};this.dispose(e.showChanged.disposableOn(C)),C(),this.dispose(()=>clearInterval(m))}}}}};g(jt,"type",jt.register("ESUeViewer",c.ESViewerStatusBar.type,jt));let ki=jt;const te=class te extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(te,"type",te.register("ESUeViewer",c.ESGaussianSplatting.type,te));let Li=te;const ee=class ee extends ${constructor(t,i){super(t,i);g(this,"_es3DTileset",this.dv(new c.ES3DTileset(`${this.sceneObject.id}_ES3DTileset`)));if(!i.viewer){console.warn("viewer is undefined!");return}t.mainClass=this._es3DTileset;{const r=this._es3DTileset;i.add(r),this.dispose(()=>i.delete(r)),this.d(a.track([r,"allowPicking"],[t,"allowPicking"])),this.d(a.track([r,"collision"],[t,"collision"])),this.d(a.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(a.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(a.track([r,"url"],[t,"url"])),this.d(a.track([r,"actorTag"],[t,"actorTag"])),this.d(a.track([r,"materialMode"],[t,"materialMode"])),this.d(a.track([r,"highlight"],[t,"highlight"])),this.d(a.track([r,"maximumScreenSpaceError"],[t,"maximumScreenSpaceError"])),this.d(a.track([r,"highlightID"],[t,"highlightID"])),this.d(a.track([r,"highlightColor"],[t,"highlightColor"])),this.d(a.bind([r,"offset"],[t,"offset"])),this.d(a.bind([r,"rotation"],[t,"rotation"])),this.d(a.track([r,"czmImageBasedLightingFactor"],[t,"czmImageBasedLightingFactor"])),this.d(a.track([r,"czmLuminanceAtZenith"],[t,"czmLuminanceAtZenith"])),this.d(a.track([r,"czmMaximumMemoryUsage"],[t,"czmMaximumMemoryUsage"])),this.d(a.track([r,"czmClassificationType"],[t,"czmClassificationType"])),this.d(a.track([r,"czmStyleJson"],[t,"czmStyleJson"])),this.d(a.track([r,"czmBackFaceCulling"],[t,"czmBackFaceCulling"])),this.d(a.track([r,"czmDebugShowBoundingVolume"],[t,"czmDebugShowBoundingVolume"])),this.d(a.track([r,"czmDebugShowContentBoundingVolume"],[t,"czmDebugShowContentBoundingVolume"])),this.d(a.track([r,"colorBlendMode"],[t,"colorBlendMode"])),this.d(a.track([r,"cacheBytes"],[t,"cacheBytes"])),this.d(a.track([r,"clippingPlaneEnabled"],[t,"clippingPlaneEnabled"])),this.d(a.track([r,"unionClippingRegions"],[t,"unionClippingRegions"])),this.d(a.track([r,"clippingPlaneEdgeColor"],[t,"clippingPlaneEdgeColor"])),this.d(a.track([r,"clippingPlaneEdgeWidth"],[t,"clippingPlaneEdgeWidth"])),this.d(a.track([r,"materialParams"],[t,"materialParams"])),this.d(a.bind([r,"supportEdit"],[t,"supportEdit"])),this.d(a.bind([r,"clippingPlanesId"],[t,"clippingPlanesId"])),this.d(a.bind([r,"clippingPlaneIds"],[t,"clippingPlaneIds"])),this.d(a.bind([r,"flattenedPlaneId"],[t,"flattenedPlaneId"])),this.d(a.bind([r,"flattenedPlaneEnabled"],[t,"flattenedPlaneEnabled"])),this.d(a.bind([r,"clippingPlaneId"],[t,"clippingPlaneId"])),this.d(a.bind([r,"excavateId"],[t,"excavateId"]))}{const r=this._es3DTileset;this.d(t.refreshTilesetEvent.don(()=>{r.refreshTileset()})),this.d(t.highlightFeatureEvent.don((...s)=>{r.highlightFeature(...s)})),this.d(t.highlightFeatureAndFlyToEvent.don((...s)=>{r.highlightFeatureAndFlyTo(...s)})),this.d(t.setFeatureColorEvent.don((...s)=>{r.setFeatureColor(...s)})),this.d(t.setFeatureVisableEvent.don((...s)=>{r.setFeatureVisable(...s)})),this.d(t.resetFeatureStyleEvent.don((...s)=>{r.resetFeatureStyle(...s)})),this.d(t.flyInEvent.don((...s)=>{r.flyIn(s[0])})),this.d(t.flyToEvent.don((...s)=>{r.flyTo(s[0])})),this.d(t.calcFlyToParamEvent.don((...s)=>{r.calcFlyToParam(...s)})),this.d(t.calcFlyInParamEvent.don((...s)=>{r.calcFlyInParam(...s)}))}{const r=this._es3DTileset;this.d(r.tilesetReady.don(s=>{t.tilesetReady.emit(s)})),this.d(r.pickedEvent.don(s=>{t.pickedEvent.emit(new c.SceneObjectPickedInfo(t,s.childPickedInfo))}))}{const r=()=>{this.es3DTileset.show=t.show};r(),this.d(t.showChanged.don(()=>{r()}))}}get es3DTileset(){return this._es3DTileset}};g(ee,"type",ee.register("ESUeViewer",c.ESRtsFeatureEditing.type,ee));let Pi=ee;const ie=class ie extends ${constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(ie,"type",ie.register("ESUeViewer",c.ESMsTileset.type,ie));let Ui=ie;const ne=class ne extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{i.callUeFunc({f:"update",p:{id:e.id,height:e.height??c.ESGeoExtrudedPolygon.defaults.height,extrudedHeight:e.extrudedHeight??c.ESGeoExtrudedPolygon.defaults.extrudedHeight,perPositionHeight:e.perPositionHeight??c.ESGeoExtrudedPolygon.defaults.perPositionHeight}})},r=this.disposeVar(a.createNextAnimateFrameEvent(e.heightChanged,e.extrudedHeightChanged,e.perPositionHeightChanged));this.dispose(r.disposableOn(n)),this.dispose(e.createdEvent.disposableOn(n))}};g(ne,"type",ne.register("ESUeViewer",c.ESGeoExtrudedPolygon.type,ne));let Mi=ne;const re=class re extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};g(re,"type",re.register("ESUeViewer",c.ESStaticMesh.type,re));let Ai=re;f.ESUeViewer=A,f.HighlightFeatureAndFlyToCallFunc=Bi,f.HighlightFeatureCallFunc=Ji,f.SetLayerColorCallFunc=Vi,f.SetLayerVisibleCallFunc=Ki,f.UeCloudViewerBase=Y,f.UeES3DTileset=he,f.UeESAlarm=Se,f.UeESApertureEffect=Ie,f.UeESAreaMeasurement=Te,f.UeESBlastParticleSystem=Re,f.UeESBoxClipping=De,f.UeESCameraView=ke,f.UeESCameraVisibleRange=Le,f.UeESCar=Pe,f.UeESClassification=Ue,f.UeESClippingPlane=Me,f.UeESDataMesh=Ae,f.UeESDatasmithRuntimeModel=We,f.UeESDirectionMeasurement=$e,f.UeESDistanceMeasurement=_e,f.UeESDynamicWater=Ne,f.UeESEntityCluster=ze,f.UeESExcavate=He,f.UeESFireParticleSystem=Ge,f.UeESForestTileset=Je,f.UeESGaussianSplatting=Li,f.UeESGeoDiv=Be,f.UeESGeoExtrudedPolygon=Mi,f.UeESGeoJson=Ke,f.UeESGeoLineString=ge,f.UeESGeoPolygon=P,f.UeESGeoRectangle=Ve,f.UeESGeoVector=L,f.UeESGeoWater=qe,f.UeESGltfModel=Xe,f.UeESHeightMeasurement=Qe,f.UeESHuman=Ye,f.UeESHumanPoi=Ti,f.UeESImageLabel=Ze,f.UeESImageryLayer=Ee,f.UeESLabel=U,f.UeESLevelRuntimeModel=be,f.UeESLocalCircle=xe,f.UeESLocalPolygon=ve,f.UeESLocalPolygonZ=Oe,f.UeESLocalRectangle=je,f.UeESLocalSkyBox=ti,f.UeESLocalVector=Ce,f.UeESLocalVector2D=ue,f.UeESLocationMeasurement=ei,f.UeESMsTileset=Ui,f.UeESNavigator=Ri,f.UeESObjectWithLocation=S,f.UeESPath=Di,f.UeESPipeFence=ii,f.UeESPipeline=ni,f.UeESPipeserTileset=ri,f.UeESPit=si,f.UeESPoi2D=oi,f.UeESPoi3D=ai,f.UeESPoiTileset=li,f.UeESPolygonFence=di,f.UeESPolygonFlattenedPlane=ci,f.UeESPolygonWithHole=ui,f.UeESRtsFeatureEditing=Pi,f.UeESRtsTileset=hi,f.UeESSceneObject=$,f.UeESSeparateFoliage=vi,f.UeESStaticMesh=Ai,f.UeESSubmergingAnalysis=gi,f.UeESSunshineAnalysis=fi,f.UeESSurfaceAreaMeasurement=pi,f.UeESTerrainLayer=Fe,f.UeESTextLabel=wi,f.UeESUEWidget=yi,f.UeESUnrealActor=mi,f.UeESVideoFusion=Ci,f.UeESViewShed=Ei,f.UeESViewerStatusBar=ki,f.UeESVisibilityAnalysis=Fi,f.UeESVisualObject=k,f.UeESVolumeMeasurement=Si,f.UeESWidget=Ii,f.UePickedInfo=qn,f.bind3DTilesetByTagCallFunc=yn,f.bindActorByTagCallFunc=vn,f.bindImageryByTagCallFunc=En,f.calcFlyToParamCallFunc=K,f.callFunctionCallFunc=me,f.captureCallFunc=tn,f.changeNavigationModeCallFunc=M,f.createActorByClassCallFunc=wn,f.destroyCallFunc=we,f.flyInCallFunc=Q,f.flyInDefaultCameraCallFunc=_i,f.flyToCallFunc=B,f.generateMemReportCallFunc=Gi,f.getAllSocketNamesByActorTagCallFunc=sn,f.getBoundSphereCallFunc=an,f.getBoundSphereWithChildrenCallFunc=ln,f.getCameraRelativeHeightCallFunc=Tn,f.getFillMaterialParamInfoCallFunc=cn,f.getGlobalPropertyCallFunc=un,f.getHeightByLonLatCallFunc=Oi,f.getHeightByLonLatsCallFunc=ji,f.getIdByComponentNameAndHitItemCallFunc=In,f.getLonLatAltToScreenPositionCallFunc=nn,f.getObjectByInfoCallFunc=hn,f.getStatusCallFunc=Ln,f.getStrokeMaterialParamInfoCallFunc=dn,f.getTilesetMaterialIDListCallFunc=An,f.getVersionCallFunc=on,f.highlightActorByTagCallFunc=Dn,f.mountPakFiles=Hi,f.moveObjectsCallFunc=Mn,f.partialCaptureCallFunc=en,f.pickCallFunc=bi,f.pickPositionCallFunc=xi,f.quitCallFunc=Zi,f.refreshTilesetCallFunc=$i,f.resetWithCurrentCameraCallFunc=ye,f.restoreOriginalSceneCallFunc=gn,f.saveStringToFileCallFunc=Rn,f.sendCustomMessageCallFunc=kn,f.setGlobalPropertyCallFunc=Yi,f.setNodePositionCallFunc=qi,f.setNodeRotationCallFunc=Xi,f.setNodeScaleCallFunc=Qi,f.smoothMoveCallFunc=ce,f.smoothMoveOnGroundCallFunc=le,f.smoothMoveWithRotationCallFunc=ae,f.smoothMoveWithRotationOnGroundCallFunc=de,f.startEditingCallFunc=Pn,f.startVoiceCallFunc=Ni,f.stopEditingCallFunc=Un,f.stopVoiceCallFunc=zi,f.uePositionToLonLatAltCallFunc=rn,f.unBind3DTilesetByIdCallFunc=Cn,f.unBind3DTilesetByTagCallFunc=mn,f.unBindActorByIDCallFunc=fn,f.unBindActorByTagCallFunc=pn,f.unBindImageryByIdCallFunc=Sn,f.unBindImageryByTagCallFunc=Fn,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|