earthsdk3-ue 3.3.0-beta.4 → 3.3.0-beta.5
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.
|
@@ -109,10 +109,10 @@ Msg: ${e}`;console.warn(t)}};u.verboseLogLevel=5,function(r){r.LIST_STREAMERS="l
|
|
|
109
109
|
content: "" !important;
|
|
110
110
|
display: none !important;
|
|
111
111
|
}`,dw=function(r){uw(r,"."+$s+lw+Jc+`
|
|
112
|
-
.`+Zs+cw+Jc)},uw=function(r,A){var e=r.ownerDocument;if(e){var t=e.createElement("style");t.textContent=A,r.appendChild(t)}},zc=function(){function r(){}return r.getOrigin=function(A){var e=r._link;return e?(e.href=A,e.href=e.href,e.protocol+e.hostname+e.port):"about:blank"},r.isSameOrigin=function(A){return r.getOrigin(A)===r._origin},r.setContext=function(A){r._link=A.document.createElement("a"),r._origin=r.getOrigin(A.location.href)},r._origin="about:blank",r}(),hw=function(){function r(A,e){this.context=A,this._options=e,this._cache={}}return r.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)||(js(A)||ww(A))&&(this._cache[A]=this.loadImage(A)).catch(function(){}),e},r.prototype.match=function(A){return this._cache[A]},r.prototype.loadImage=function(A){return dA(this,void 0,void 0,function(){var e,t,n,s,i=this;return nA(this,function(o){switch(o.label){case 0:return e=zc.isSameOrigin(A),t=!qs(A)&&this._options.useCORS===!0&&eA.SUPPORT_CORS_IMAGES&&!e,n=!qs(A)&&!e&&!js(A)&&typeof this._options.proxy=="string"&&eA.SUPPORT_CORS_XHR&&!t,!e&&this._options.allowTaint===!1&&!qs(A)&&!js(A)&&!n&&!t?[2]:(s=A,n?[4,this.proxy(s)]:[3,2]);case 1:s=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise(function(a,l){var c=new Image;c.onload=function(){return a(c)},c.onerror=l,(pw(s)||t)&&(c.crossOrigin="anonymous"),c.src=s,c.complete===!0&&setTimeout(function(){return a(c)},500),i._options.imageTimeout>0&&setTimeout(function(){return l("Timed out ("+i._options.imageTimeout+"ms) loading image")},i._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},r.prototype.has=function(A){return typeof this._cache[A]<"u"},r.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},r.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var n=A.substring(0,256);return new Promise(function(s,i){var o=eA.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(a.status===200)if(o==="text")s(a.response);else{var h=new FileReader;h.addEventListener("load",function(){return s(h.result)},!1),h.addEventListener("error",function(d){return i(d)},!1),h.readAsDataURL(a.response)}else i("Failed to proxy resource "+n+" with status code "+a.status)},a.onerror=i;var l=t.indexOf("?")>-1?"&":"?";if(a.open("GET",""+t+l+"url="+encodeURIComponent(A)+"&responseType="+o),o!=="text"&&a instanceof XMLHttpRequest&&(a.responseType=o),e._options.imageTimeout){var c=e._options.imageTimeout;a.timeout=c,a.ontimeout=function(){return i("Timed out ("+c+"ms) proxying "+n)}}a.send()})},r}(),gw=/^data:image\/svg\+xml/i,Bw=/^data:image\/.*;base64,/i,fw=/^data:image\/.*/i,ww=function(r){return eA.SUPPORT_SVG_DRAWING||!Cw(r)},qs=function(r){return fw.test(r)},pw=function(r){return Bw.test(r)},js=function(r){return r.substr(0,4)==="blob"},Cw=function(r){return r.substr(-3).toLowerCase()==="svg"||gw.test(r)},S=function(){function r(A,e){this.type=0,this.x=A,this.y=e}return r.prototype.add=function(A,e){return new r(this.x+A,this.y+e)},r}(),Ie=function(r,A,e){return new S(r.x+(A.x-r.x)*e,r.y+(A.y-r.y)*e)},Bn=function(){function r(A,e,t,n){this.type=1,this.start=A,this.startControl=e,this.endControl=t,this.end=n}return r.prototype.subdivide=function(A,e){var t=Ie(this.start,this.startControl,A),n=Ie(this.startControl,this.endControl,A),s=Ie(this.endControl,this.end,A),i=Ie(t,n,A),o=Ie(n,s,A),a=Ie(i,o,A);return e?new r(this.start,t,i,a):new r(a,o,s,this.end)},r.prototype.add=function(A,e){return new r(this.start.add(A,e),this.startControl.add(A,e),this.endControl.add(A,e),this.end.add(A,e))},r.prototype.reverse=function(){return new r(this.end,this.endControl,this.startControl,this.start)},r}(),CA=function(r){return r.type===1},vw=function(){function r(A){var e=A.styles,t=A.bounds,n=st(e.borderTopLeftRadius,t.width,t.height),s=n[0],i=n[1],o=st(e.borderTopRightRadius,t.width,t.height),a=o[0],l=o[1],c=st(e.borderBottomRightRadius,t.width,t.height),h=c[0],d=c[1],B=st(e.borderBottomLeftRadius,t.width,t.height),g=B[0],f=B[1],m=[];m.push((s+a)/t.width),m.push((g+h)/t.width),m.push((i+f)/t.height),m.push((l+d)/t.height);var F=Math.max.apply(Math,m);F>1&&(s/=F,i/=F,a/=F,l/=F,h/=F,d/=F,g/=F,f/=F);var Q=t.width-a,y=t.height-d,L=t.width-h,T=t.height-f,E=e.borderTopWidth,R=e.borderRightWidth,K=e.borderBottomWidth,b=e.borderLeftWidth,W=_(e.paddingTop,A.bounds.width),iA=_(e.paddingRight,A.bounds.width),uA=_(e.paddingBottom,A.bounds.width),G=_(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=s>0||i>0?O(t.left+b/3,t.top+E/3,s-b/3,i-E/3,k.TOP_LEFT):new S(t.left+b/3,t.top+E/3),this.topRightBorderDoubleOuterBox=s>0||i>0?O(t.left+Q,t.top+E/3,a-R/3,l-E/3,k.TOP_RIGHT):new S(t.left+t.width-R/3,t.top+E/3),this.bottomRightBorderDoubleOuterBox=h>0||d>0?O(t.left+L,t.top+y,h-R/3,d-K/3,k.BOTTOM_RIGHT):new S(t.left+t.width-R/3,t.top+t.height-K/3),this.bottomLeftBorderDoubleOuterBox=g>0||f>0?O(t.left+b/3,t.top+T,g-b/3,f-K/3,k.BOTTOM_LEFT):new S(t.left+b/3,t.top+t.height-K/3),this.topLeftBorderDoubleInnerBox=s>0||i>0?O(t.left+b*2/3,t.top+E*2/3,s-b*2/3,i-E*2/3,k.TOP_LEFT):new S(t.left+b*2/3,t.top+E*2/3),this.topRightBorderDoubleInnerBox=s>0||i>0?O(t.left+Q,t.top+E*2/3,a-R*2/3,l-E*2/3,k.TOP_RIGHT):new S(t.left+t.width-R*2/3,t.top+E*2/3),this.bottomRightBorderDoubleInnerBox=h>0||d>0?O(t.left+L,t.top+y,h-R*2/3,d-K*2/3,k.BOTTOM_RIGHT):new S(t.left+t.width-R*2/3,t.top+t.height-K*2/3),this.bottomLeftBorderDoubleInnerBox=g>0||f>0?O(t.left+b*2/3,t.top+T,g-b*2/3,f-K*2/3,k.BOTTOM_LEFT):new S(t.left+b*2/3,t.top+t.height-K*2/3),this.topLeftBorderStroke=s>0||i>0?O(t.left+b/2,t.top+E/2,s-b/2,i-E/2,k.TOP_LEFT):new S(t.left+b/2,t.top+E/2),this.topRightBorderStroke=s>0||i>0?O(t.left+Q,t.top+E/2,a-R/2,l-E/2,k.TOP_RIGHT):new S(t.left+t.width-R/2,t.top+E/2),this.bottomRightBorderStroke=h>0||d>0?O(t.left+L,t.top+y,h-R/2,d-K/2,k.BOTTOM_RIGHT):new S(t.left+t.width-R/2,t.top+t.height-K/2),this.bottomLeftBorderStroke=g>0||f>0?O(t.left+b/2,t.top+T,g-b/2,f-K/2,k.BOTTOM_LEFT):new S(t.left+b/2,t.top+t.height-K/2),this.topLeftBorderBox=s>0||i>0?O(t.left,t.top,s,i,k.TOP_LEFT):new S(t.left,t.top),this.topRightBorderBox=a>0||l>0?O(t.left+Q,t.top,a,l,k.TOP_RIGHT):new S(t.left+t.width,t.top),this.bottomRightBorderBox=h>0||d>0?O(t.left+L,t.top+y,h,d,k.BOTTOM_RIGHT):new S(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=g>0||f>0?O(t.left,t.top+T,g,f,k.BOTTOM_LEFT):new S(t.left,t.top+t.height),this.topLeftPaddingBox=s>0||i>0?O(t.left+b,t.top+E,Math.max(0,s-b),Math.max(0,i-E),k.TOP_LEFT):new S(t.left+b,t.top+E),this.topRightPaddingBox=a>0||l>0?O(t.left+Math.min(Q,t.width-R),t.top+E,Q>t.width+R?0:Math.max(0,a-R),Math.max(0,l-E),k.TOP_RIGHT):new S(t.left+t.width-R,t.top+E),this.bottomRightPaddingBox=h>0||d>0?O(t.left+Math.min(L,t.width-b),t.top+Math.min(y,t.height-K),Math.max(0,h-R),Math.max(0,d-K),k.BOTTOM_RIGHT):new S(t.left+t.width-R,t.top+t.height-K),this.bottomLeftPaddingBox=g>0||f>0?O(t.left+b,t.top+Math.min(T,t.height-K),Math.max(0,g-b),Math.max(0,f-K),k.BOTTOM_LEFT):new S(t.left+b,t.top+t.height-K),this.topLeftContentBox=s>0||i>0?O(t.left+b+G,t.top+E+W,Math.max(0,s-(b+G)),Math.max(0,i-(E+W)),k.TOP_LEFT):new S(t.left+b+G,t.top+E+W),this.topRightContentBox=a>0||l>0?O(t.left+Math.min(Q,t.width+b+G),t.top+E+W,Q>t.width+b+G?0:a-b+G,l-(E+W),k.TOP_RIGHT):new S(t.left+t.width-(R+iA),t.top+E+W),this.bottomRightContentBox=h>0||d>0?O(t.left+Math.min(L,t.width-(b+G)),t.top+Math.min(y,t.height+E+W),Math.max(0,h-(R+iA)),d-(K+uA),k.BOTTOM_RIGHT):new S(t.left+t.width-(R+iA),t.top+t.height-(K+uA)),this.bottomLeftContentBox=g>0||f>0?O(t.left+b+G,t.top+T,Math.max(0,g-(b+G)),f-(K+uA),k.BOTTOM_LEFT):new S(t.left+b+G,t.top+t.height-(K+uA))}return r}(),k;(function(r){r[r.TOP_LEFT=0]="TOP_LEFT",r[r.TOP_RIGHT=1]="TOP_RIGHT",r[r.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",r[r.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(k||(k={}));var O=function(r,A,e,t,n){var s=4*((Math.sqrt(2)-1)/3),i=e*s,o=t*s,a=r+e,l=A+t;switch(n){case k.TOP_LEFT:return new Bn(new S(r,l),new S(r,l-o),new S(a-i,A),new S(a,A));case k.TOP_RIGHT:return new Bn(new S(r,A),new S(r+i,A),new S(a,l-o),new S(a,l));case k.BOTTOM_RIGHT:return new Bn(new S(a,A),new S(a,A+o),new S(r+i,l),new S(r,l));case k.BOTTOM_LEFT:default:return new Bn(new S(a,l),new S(a-i,l),new S(r,A+o),new S(r,A))}},fn=function(r){return[r.topLeftBorderBox,r.topRightBorderBox,r.bottomRightBorderBox,r.bottomLeftBorderBox]},mw=function(r){return[r.topLeftContentBox,r.topRightContentBox,r.bottomRightContentBox,r.bottomLeftContentBox]},wn=function(r){return[r.topLeftPaddingBox,r.topRightPaddingBox,r.bottomRightPaddingBox,r.bottomLeftPaddingBox]},Fw=function(){function r(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6}return r}(),pn=function(){function r(A,e){this.path=A,this.target=e,this.type=1}return r}(),Qw=function(){function r(A){this.opacity=A,this.type=2,this.target=6}return r}(),Uw=function(r){return r.type===0},Yc=function(r){return r.type===1},Ew=function(r){return r.type===2},$c=function(r,A){return r.length===A.length?r.some(function(e,t){return e===A[t]}):!1},yw=function(r,A,e,t,n){return r.map(function(s,i){switch(i){case 0:return s.add(A,e);case 1:return s.add(A+t,e);case 2:return s.add(A+t,e+n);case 3:return s.add(A,e+n)}return s})},Zc=function(){function r(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return r}(),qc=function(){function r(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new vw(this.container),this.container.styles.opacity<1&&this.effects.push(new Qw(this.container.styles.opacity)),this.container.styles.transform!==null){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,s=this.container.styles.transform;this.effects.push(new Fw(t,n,s))}if(this.container.styles.overflowX!==0){var i=fn(this.curves),o=wn(this.curves);$c(i,o)?this.effects.push(new pn(i,6)):(this.effects.push(new pn(i,2)),this.effects.push(new pn(o,4)))}}return r.prototype.getEffects=function(A){for(var e=[2,3].indexOf(this.container.styles.position)===-1,t=this.parent,n=this.effects.slice(0);t;){var s=t.effects.filter(function(a){return!Yc(a)});if(e||t.container.styles.position!==0||!t.parent){if(n.unshift.apply(n,s),e=[2,3].indexOf(t.container.styles.position)===-1,t.container.styles.overflowX!==0){var i=fn(t.curves),o=wn(t.curves);$c(i,o)||n.unshift(new pn(o,6))}}else n.unshift.apply(n,s);t=t.parent}return n.filter(function(a){return Z(a.target,A)})},r}(),Ai=function(r,A,e,t){r.container.elements.forEach(function(n){var s=Z(n.flags,4),i=Z(n.flags,2),o=new qc(n,r);Z(n.styles.display,2048)&&t.push(o);var a=Z(n.flags,8)?[]:t;if(s||i){var l=s||n.styles.isPositioned()?e:A,c=new Zc(o);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var h=n.styles.zIndex.order;if(h<0){var d=0;l.negativeZIndex.some(function(g,f){return h>g.element.container.styles.zIndex.order?(d=f,!1):d>0}),l.negativeZIndex.splice(d,0,c)}else if(h>0){var B=0;l.positiveZIndex.some(function(g,f){return h>=g.element.container.styles.zIndex.order?(B=f+1,!1):B>0}),l.positiveZIndex.splice(B,0,c)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else n.styles.isFloating()?l.nonPositionedFloats.push(c):l.nonPositionedInlineLevel.push(c);Ai(o,c,s?c:e,a)}else n.styles.isInlineLevel()?A.inlineLevel.push(o):A.nonInlineLevel.push(o),Ai(o,A,e,a);Z(n.flags,8)&&jc(n,a)})},jc=function(r,A){for(var e=r instanceof Vs?r.start:1,t=r instanceof Vs?r.reversed:!1,n=0;n<A.length;n++){var s=A[n];s.container instanceof Uc&&typeof s.container.value=="number"&&s.container.value!==0&&(e=s.container.value),s.listValue=dt(e,s.container.styles.listStyleType,!0),e+=t?-1:1}},Sw=function(r){var A=new qc(r,null),e=new Zc(A),t=[];return Ai(A,e,e,t),jc(A.container,t),e},Ad=function(r,A){switch(A){case 0:return vA(r.topLeftBorderBox,r.topLeftPaddingBox,r.topRightBorderBox,r.topRightPaddingBox);case 1:return vA(r.topRightBorderBox,r.topRightPaddingBox,r.bottomRightBorderBox,r.bottomRightPaddingBox);case 2:return vA(r.bottomRightBorderBox,r.bottomRightPaddingBox,r.bottomLeftBorderBox,r.bottomLeftPaddingBox);case 3:default:return vA(r.bottomLeftBorderBox,r.bottomLeftPaddingBox,r.topLeftBorderBox,r.topLeftPaddingBox)}},Iw=function(r,A){switch(A){case 0:return vA(r.topLeftBorderBox,r.topLeftBorderDoubleOuterBox,r.topRightBorderBox,r.topRightBorderDoubleOuterBox);case 1:return vA(r.topRightBorderBox,r.topRightBorderDoubleOuterBox,r.bottomRightBorderBox,r.bottomRightBorderDoubleOuterBox);case 2:return vA(r.bottomRightBorderBox,r.bottomRightBorderDoubleOuterBox,r.bottomLeftBorderBox,r.bottomLeftBorderDoubleOuterBox);case 3:default:return vA(r.bottomLeftBorderBox,r.bottomLeftBorderDoubleOuterBox,r.topLeftBorderBox,r.topLeftBorderDoubleOuterBox)}},Tw=function(r,A){switch(A){case 0:return vA(r.topLeftBorderDoubleInnerBox,r.topLeftPaddingBox,r.topRightBorderDoubleInnerBox,r.topRightPaddingBox);case 1:return vA(r.topRightBorderDoubleInnerBox,r.topRightPaddingBox,r.bottomRightBorderDoubleInnerBox,r.bottomRightPaddingBox);case 2:return vA(r.bottomRightBorderDoubleInnerBox,r.bottomRightPaddingBox,r.bottomLeftBorderDoubleInnerBox,r.bottomLeftPaddingBox);case 3:default:return vA(r.bottomLeftBorderDoubleInnerBox,r.bottomLeftPaddingBox,r.topLeftBorderDoubleInnerBox,r.topLeftPaddingBox)}},Hw=function(r,A){switch(A){case 0:return Cn(r.topLeftBorderStroke,r.topRightBorderStroke);case 1:return Cn(r.topRightBorderStroke,r.bottomRightBorderStroke);case 2:return Cn(r.bottomRightBorderStroke,r.bottomLeftBorderStroke);case 3:default:return Cn(r.bottomLeftBorderStroke,r.topLeftBorderStroke)}},Cn=function(r,A){var e=[];return CA(r)?e.push(r.subdivide(.5,!1)):e.push(r),CA(A)?e.push(A.subdivide(.5,!0)):e.push(A),e},vA=function(r,A,e,t){var n=[];return CA(r)?n.push(r.subdivide(.5,!1)):n.push(r),CA(e)?n.push(e.subdivide(.5,!0)):n.push(e),CA(t)?n.push(t.subdivide(.5,!0).reverse()):n.push(t),CA(A)?n.push(A.subdivide(.5,!1).reverse()):n.push(A),n},ed=function(r){var A=r.bounds,e=r.styles;return A.add(e.borderLeftWidth,e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth),-(e.borderTopWidth+e.borderBottomWidth))},vn=function(r){var A=r.styles,e=r.bounds,t=_(A.paddingLeft,e.width),n=_(A.paddingRight,e.width),s=_(A.paddingTop,e.width),i=_(A.paddingBottom,e.width);return e.add(t+A.borderLeftWidth,s+A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth+t+n),-(A.borderTopWidth+A.borderBottomWidth+s+i))},Lw=function(r,A){return r===0?A.bounds:r===2?vn(A):ed(A)},Mw=function(r,A){return r===0?A.bounds:r===2?vn(A):ed(A)},ei=function(r,A,e){var t=Lw(He(r.styles.backgroundOrigin,A),r),n=Mw(He(r.styles.backgroundClip,A),r),s=bw(He(r.styles.backgroundSize,A),e,t),i=s[0],o=s[1],a=st(He(r.styles.backgroundPosition,A),t.width-i,t.height-o),l=Dw(He(r.styles.backgroundRepeat,A),a,s,t,n),c=Math.round(t.left+a[0]),h=Math.round(t.top+a[1]);return[l,c,h,i,o]},Te=function(r){return N(r)&&r.value===Ue.AUTO},mn=function(r){return typeof r=="number"},bw=function(r,A,e){var t=A[0],n=A[1],s=A[2],i=r[0],o=r[1];if(!i)return[0,0];if(Y(i)&&o&&Y(o))return[_(i,e.width),_(o,e.height)];var a=mn(s);if(N(i)&&(i.value===Ue.CONTAIN||i.value===Ue.COVER)){if(mn(s)){var l=e.width/e.height;return l<s!=(i.value===Ue.COVER)?[e.width,e.width/s]:[e.height*s,e.height]}return[e.width,e.height]}var c=mn(t),h=mn(n),d=c||h;if(Te(i)&&(!o||Te(o))){if(c&&h)return[t,n];if(!a&&!d)return[e.width,e.height];if(d&&a){var B=c?t:n*s,g=h?n:t/s;return[B,g]}var f=c?t:e.width,m=h?n:e.height;return[f,m]}if(a){var F=0,Q=0;return Y(i)?F=_(i,e.width):Y(o)&&(Q=_(o,e.height)),Te(i)?F=Q*s:(!o||Te(o))&&(Q=F/s),[F,Q]}var y=null,L=null;if(Y(i)?y=_(i,e.width):o&&Y(o)&&(L=_(o,e.height)),y!==null&&(!o||Te(o))&&(L=c&&h?y/t*n:e.height),L!==null&&Te(i)&&(y=c&&h?L/n*t:e.width),y!==null&&L!==null)return[y,L];throw new Error("Unable to calculate background-size for element")},He=function(r,A){var e=r[A];return typeof e>"u"?r[0]:e},Dw=function(r,A,e,t,n){var s=A[0],i=A[1],o=e[0],a=e[1];switch(r){case 2:return[new S(Math.round(t.left),Math.round(t.top+i)),new S(Math.round(t.left+t.width),Math.round(t.top+i)),new S(Math.round(t.left+t.width),Math.round(a+t.top+i)),new S(Math.round(t.left),Math.round(a+t.top+i))];case 3:return[new S(Math.round(t.left+s),Math.round(t.top)),new S(Math.round(t.left+s+o),Math.round(t.top)),new S(Math.round(t.left+s+o),Math.round(t.height+t.top)),new S(Math.round(t.left+s),Math.round(t.height+t.top))];case 1:return[new S(Math.round(t.left+s),Math.round(t.top+i)),new S(Math.round(t.left+s+o),Math.round(t.top+i)),new S(Math.round(t.left+s+o),Math.round(t.top+i+a)),new S(Math.round(t.left+s),Math.round(t.top+i+a))];default:return[new S(Math.round(n.left),Math.round(n.top)),new S(Math.round(n.left+n.width),Math.round(n.top)),new S(Math.round(n.left+n.width),Math.round(n.height+n.top)),new S(Math.round(n.left),Math.round(n.height+n.top))]}},Rw="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",td="Hidden Text",Pw=function(){function r(A){this._data={},this._document=A}return r.prototype.parseMetrics=function(A,e){var t=this._document.createElement("div"),n=this._document.createElement("img"),s=this._document.createElement("span"),i=this._document.body;t.style.visibility="hidden",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin="0",t.style.padding="0",t.style.whiteSpace="nowrap",i.appendChild(t),n.src=Rw,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",s.style.fontFamily=A,s.style.fontSize=e,s.style.margin="0",s.style.padding="0",s.appendChild(this._document.createTextNode(td)),t.appendChild(s),t.appendChild(n);var o=n.offsetTop-s.offsetTop+2;t.removeChild(s),t.appendChild(this._document.createTextNode(td)),t.style.lineHeight="normal",n.style.verticalAlign="super";var a=n.offsetTop-t.offsetTop+2;return i.removeChild(t),{baseline:o,middle:a}},r.prototype.getMetrics=function(A,e){var t=A+" "+e;return typeof this._data[t]>"u"&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]},r}(),rd=function(){function r(A,e){this.context=A,this.options=e}return r}(),Kw=1e4,xw=function(r){FA(A,r);function A(e,t){var n=r.call(this,e,t)||this;return n._activeEffects=[],n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),t.canvas||(n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width=t.width+"px",n.canvas.style.height=t.height+"px"),n.fontMetrics=new Pw(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+t.width+"x"+t.height+") with scale "+t.scale),n}return A.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach(function(n){return t.applyEffect(n)})},A.prototype.applyEffect=function(e){this.ctx.save(),Ew(e)&&(this.ctx.globalAlpha=e.opacity),Uw(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),Yc(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},A.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},A.prototype.renderStack=function(e){return dA(this,void 0,void 0,function(){var t;return nA(this,function(n){switch(n.label){case 0:return t=e.element.container.styles,t.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},A.prototype.renderNode=function(e){return dA(this,void 0,void 0,function(){return nA(this,function(t){switch(t.label){case 0:if(Z(e.container.flags,16))debugger;return e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},A.prototype.renderTextWithLetterSpacing=function(e,t,n){var s=this;if(t===0)this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+n);else{var i=_s(e.text);i.reduce(function(o,a){return s.ctx.fillText(a,o,e.bounds.top+n),o+s.ctx.measureText(a).width},e.bounds.left)}},A.prototype.createFontStyle=function(e){var t=e.fontVariant.filter(function(i){return i==="normal"||i==="small-caps"}).join(""),n=Vw(e.fontFamily).join(", "),s=nt(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,t,e.fontWeight,s,n].join(" "),n,s]},A.prototype.renderTextNode=function(e,t){return dA(this,void 0,void 0,function(){var n,s,i,o,a,l,c,h,d=this;return nA(this,function(B){return n=this.createFontStyle(t),s=n[0],i=n[1],o=n[2],this.ctx.font=s,this.ctx.direction=t.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(i,o),l=a.baseline,c=a.middle,h=t.paintOrder,e.textBounds.forEach(function(g){h.forEach(function(f){switch(f){case 0:d.ctx.fillStyle=q(t.color),d.renderTextWithLetterSpacing(g,t.letterSpacing,l);var m=t.textShadow;m.length&&g.text.trim().length&&(m.slice(0).reverse().forEach(function(F){d.ctx.shadowColor=q(F.color),d.ctx.shadowOffsetX=F.offsetX.number*d.options.scale,d.ctx.shadowOffsetY=F.offsetY.number*d.options.scale,d.ctx.shadowBlur=F.blur.number,d.renderTextWithLetterSpacing(g,t.letterSpacing,l)}),d.ctx.shadowColor="",d.ctx.shadowOffsetX=0,d.ctx.shadowOffsetY=0,d.ctx.shadowBlur=0),t.textDecorationLine.length&&(d.ctx.fillStyle=q(t.textDecorationColor||t.color),t.textDecorationLine.forEach(function(F){switch(F){case 1:d.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top+l),g.bounds.width,1);break;case 2:d.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top),g.bounds.width,1);break;case 3:d.ctx.fillRect(g.bounds.left,Math.ceil(g.bounds.top+c),g.bounds.width,1);break}}));break;case 1:t.webkitTextStrokeWidth&&g.text.trim().length&&(d.ctx.strokeStyle=q(t.webkitTextStrokeColor),d.ctx.lineWidth=t.webkitTextStrokeWidth,d.ctx.lineJoin=window.chrome?"miter":"round",d.ctx.strokeText(g.text,g.bounds.left,g.bounds.top+l)),d.ctx.strokeStyle="",d.ctx.lineWidth=0,d.ctx.lineJoin="miter";break}})}),[2]})})},A.prototype.renderReplacedElement=function(e,t,n){if(n&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var s=vn(e),i=wn(t);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,e.intrinsicWidth,e.intrinsicHeight,s.left,s.top,s.width,s.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(e){return dA(this,void 0,void 0,function(){var t,n,s,i,o,a,Q,Q,l,c,h,d,L,B,g,T,f,m,F,Q,y,L,T;return nA(this,function(E){switch(E.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,n=e.curves,s=t.styles,i=0,o=t.textNodes,E.label=1;case 1:return i<o.length?(a=o[i],[4,this.renderTextNode(a,s)]):[3,4];case 2:E.sent(),E.label=3;case 3:return i++,[3,1];case 4:if(!(t instanceof mc))return[3,8];E.label=5;case 5:return E.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return Q=E.sent(),this.renderReplacedElement(t,n,Q),[3,8];case 7:return E.sent(),this.context.logger.error("Error loading image "+t.src),[3,8];case 8:if(t instanceof Fc&&this.renderReplacedElement(t,n,t.canvas),!(t instanceof Qc))return[3,12];E.label=9;case 9:return E.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return Q=E.sent(),this.renderReplacedElement(t,n,Q),[3,12];case 11:return E.sent(),this.context.logger.error("Error loading svg "+t.svg.substring(0,255)),[3,12];case 12:return t instanceof Ic&&t.tree?(l=new A(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}),[4,l.render(t.tree)]):[3,14];case 13:c=E.sent(),t.width&&t.height&&this.ctx.drawImage(c,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),E.label=14;case 14:if(t instanceof Os&&(h=Math.min(t.bounds.width,t.bounds.height),t.type===ln?t.checked&&(this.ctx.save(),this.path([new S(t.bounds.left+h*.39363,t.bounds.top+h*.79),new S(t.bounds.left+h*.16,t.bounds.top+h*.5549),new S(t.bounds.left+h*.27347,t.bounds.top+h*.44071),new S(t.bounds.left+h*.39694,t.bounds.top+h*.5649),new S(t.bounds.left+h*.72983,t.bounds.top+h*.23),new S(t.bounds.left+h*.84,t.bounds.top+h*.34085),new S(t.bounds.left+h*.39363,t.bounds.top+h*.79)]),this.ctx.fillStyle=q(Ec),this.ctx.fill(),this.ctx.restore()):t.type===cn&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+h/2,t.bounds.top+h/2,h/4,0,Math.PI*2,!0),this.ctx.fillStyle=q(Ec),this.ctx.fill(),this.ctx.restore())),kw(t)&&t.value.length){switch(d=this.createFontStyle(s),L=d[0],B=d[1],g=this.fontMetrics.getMetrics(L,B).baseline,this.ctx.font=L,this.ctx.fillStyle=q(s.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Nw(t.styles.textAlign),T=vn(t),f=0,t.styles.textAlign){case 1:f+=T.width/2;break;case 2:f+=T.width;break}m=T.add(f,0,0,-T.height/2+1),this.ctx.save(),this.path([new S(T.left,T.top),new S(T.left+T.width,T.top),new S(T.left+T.width,T.top+T.height),new S(T.left,T.top+T.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new lt(t.value,m),s.letterSpacing,g),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!Z(t.styles.display,2048))return[3,20];if(t.styles.listStyleImage===null)return[3,19];if(F=t.styles.listStyleImage,F.type!==0)return[3,18];Q=void 0,y=F.url,E.label=15;case 15:return E.trys.push([15,17,,18]),[4,this.context.cache.match(y)];case 16:return Q=E.sent(),this.ctx.drawImage(Q,t.bounds.left-(Q.width+10),t.bounds.top),[3,18];case 17:return E.sent(),this.context.logger.error("Error loading list-style-image "+y),[3,18];case 18:return[3,20];case 19:e.listValue&&t.styles.listStyleType!==-1&&(L=this.createFontStyle(s)[0],this.ctx.font=L,this.ctx.fillStyle=q(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",T=new MA(t.bounds.left,t.bounds.top+_(t.styles.paddingTop,t.bounds.width),t.bounds.width,tc(s.lineHeight,s.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new lt(e.listValue,T),s.letterSpacing,tc(s.lineHeight,s.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),E.label=20;case 20:return[2]}})})},A.prototype.renderStackContent=function(e){return dA(this,void 0,void 0,function(){var t,n,F,s,i,F,o,a,F,l,c,F,h,d,F,B,g,F,f,m,F;return nA(this,function(Q){switch(Q.label){case 0:if(Z(e.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:Q.sent(),t=0,n=e.negativeZIndex,Q.label=2;case 2:return t<n.length?(F=n[t],[4,this.renderStack(F)]):[3,5];case 3:Q.sent(),Q.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:Q.sent(),s=0,i=e.nonInlineLevel,Q.label=7;case 7:return s<i.length?(F=i[s],[4,this.renderNode(F)]):[3,10];case 8:Q.sent(),Q.label=9;case 9:return s++,[3,7];case 10:o=0,a=e.nonPositionedFloats,Q.label=11;case 11:return o<a.length?(F=a[o],[4,this.renderStack(F)]):[3,14];case 12:Q.sent(),Q.label=13;case 13:return o++,[3,11];case 14:l=0,c=e.nonPositionedInlineLevel,Q.label=15;case 15:return l<c.length?(F=c[l],[4,this.renderStack(F)]):[3,18];case 16:Q.sent(),Q.label=17;case 17:return l++,[3,15];case 18:h=0,d=e.inlineLevel,Q.label=19;case 19:return h<d.length?(F=d[h],[4,this.renderNode(F)]):[3,22];case 20:Q.sent(),Q.label=21;case 21:return h++,[3,19];case 22:B=0,g=e.zeroOrAutoZIndexOrTransformedOrOpacity,Q.label=23;case 23:return B<g.length?(F=g[B],[4,this.renderStack(F)]):[3,26];case 24:Q.sent(),Q.label=25;case 25:return B++,[3,23];case 26:f=0,m=e.positiveZIndex,Q.label=27;case 27:return f<m.length?(F=m[f],[4,this.renderStack(F)]):[3,30];case 28:Q.sent(),Q.label=29;case 29:return f++,[3,27];case 30:return[2]}})})},A.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},A.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},A.prototype.formatPath=function(e){var t=this;e.forEach(function(n,s){var i=CA(n)?n.start:n;s===0?t.ctx.moveTo(i.x,i.y):t.ctx.lineTo(i.x,i.y),CA(n)&&t.ctx.bezierCurveTo(n.startControl.x,n.startControl.y,n.endControl.x,n.endControl.y,n.end.x,n.end.y)})},A.prototype.renderRepeat=function(e,t,n,s){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(n,s),this.ctx.fill(),this.ctx.translate(-n,-s)},A.prototype.resizeImage=function(e,t,n){var s;if(e.width===t&&e.height===n)return e;var i=(s=this.canvas.ownerDocument)!==null&&s!==void 0?s:document,o=i.createElement("canvas");o.width=Math.max(1,t),o.height=Math.max(1,n);var a=o.getContext("2d");return a.drawImage(e,0,0,e.width,e.height,0,0,t,n),o},A.prototype.renderBackgroundImage=function(e){return dA(this,void 0,void 0,function(){var t,n,s,i,o,a;return nA(this,function(l){switch(l.label){case 0:t=e.styles.backgroundImage.length-1,n=function(c){var h,d,B,W,gA,BA,G,tA,K,g,W,gA,BA,G,tA,f,m,F,Q,y,L,T,E,R,K,b,W,iA,uA,G,tA,zA,gA,BA,de,IA,YA,ue,he,PA,ge,KA;return nA(this,function(Ke){switch(Ke.label){case 0:if(c.type!==0)return[3,5];h=void 0,d=c.url,Ke.label=1;case 1:return Ke.trys.push([1,3,,4]),[4,s.context.cache.match(d)];case 2:return h=Ke.sent(),[3,4];case 3:return Ke.sent(),s.context.logger.error("Error loading background-image "+d),[3,4];case 4:return h&&(B=ei(e,t,[h.width,h.height,h.width/h.height]),W=B[0],gA=B[1],BA=B[2],G=B[3],tA=B[4],K=s.ctx.createPattern(s.resizeImage(h,G,tA),"repeat"),s.renderRepeat(W,K,gA,BA)),[3,6];case 5:Qg(c)?(g=ei(e,t,[null,null,null]),W=g[0],gA=g[1],BA=g[2],G=g[3],tA=g[4],f=pg(c.angle,G,tA),m=f[0],F=f[1],Q=f[2],y=f[3],L=f[4],T=document.createElement("canvas"),T.width=G,T.height=tA,E=T.getContext("2d"),R=E.createLinearGradient(F,y,Q,L),Wl(c.stops,m).forEach(function(vr){return R.addColorStop(vr.stop,q(vr.color))}),E.fillStyle=R,E.fillRect(0,0,G,tA),G>0&&tA>0&&(K=s.ctx.createPattern(T,"repeat"),s.renderRepeat(W,K,gA,BA))):Ug(c)&&(b=ei(e,t,[null,null,null]),W=b[0],iA=b[1],uA=b[2],G=b[3],tA=b[4],zA=c.position.length===0?[Ss]:c.position,gA=_(zA[0],G),BA=_(zA[zA.length-1],tA),de=Cg(c,gA,BA,G,tA),IA=de[0],YA=de[1],IA>0&&YA>0&&(ue=s.ctx.createRadialGradient(iA+gA,uA+BA,0,iA+gA,uA+BA,IA),Wl(c.stops,IA*2).forEach(function(vr){return ue.addColorStop(vr.stop,q(vr.color))}),s.path(W),s.ctx.fillStyle=ue,IA!==YA?(he=e.bounds.left+.5*e.bounds.width,PA=e.bounds.top+.5*e.bounds.height,ge=YA/IA,KA=1/ge,s.ctx.save(),s.ctx.translate(he,PA),s.ctx.transform(1,0,0,ge,0,0),s.ctx.translate(-he,-PA),s.ctx.fillRect(iA,KA*(uA-PA)+PA,G,tA*KA),s.ctx.restore()):s.ctx.fill())),Ke.label=6;case 6:return t--,[2]}})},s=this,i=0,o=e.styles.backgroundImage.slice(0).reverse(),l.label=1;case 1:return i<o.length?(a=o[i],[5,n(a)]):[3,4];case 2:l.sent(),l.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},A.prototype.renderSolidBorder=function(e,t,n){return dA(this,void 0,void 0,function(){return nA(this,function(s){return this.path(Ad(n,t)),this.ctx.fillStyle=q(e),this.ctx.fill(),[2]})})},A.prototype.renderDoubleBorder=function(e,t,n,s){return dA(this,void 0,void 0,function(){var i,o;return nA(this,function(a){switch(a.label){case 0:return t<3?[4,this.renderSolidBorder(e,n,s)]:[3,2];case 1:return a.sent(),[2];case 2:return i=Iw(s,n),this.path(i),this.ctx.fillStyle=q(e),this.ctx.fill(),o=Tw(s,n),this.path(o),this.ctx.fill(),[2]}})})},A.prototype.renderNodeBackgroundAndBorders=function(e){return dA(this,void 0,void 0,function(){var t,n,s,i,o,a,l,c,h=this;return nA(this,function(d){switch(d.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,n=!OA(t.backgroundColor)||t.backgroundImage.length,s=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],i=Gw(He(t.backgroundClip,0),e.curves),n||t.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),OA(t.backgroundColor)||(this.ctx.fillStyle=q(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:d.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(function(B){h.ctx.save();var g=fn(e.curves),f=B.inset?0:Kw,m=yw(g,-f+(B.inset?1:-1)*B.spread.number,(B.inset?1:-1)*B.spread.number,B.spread.number*(B.inset?-2:2),B.spread.number*(B.inset?-2:2));B.inset?(h.path(g),h.ctx.clip(),h.mask(m)):(h.mask(g),h.ctx.clip(),h.path(m)),h.ctx.shadowOffsetX=B.offsetX.number+f,h.ctx.shadowOffsetY=B.offsetY.number,h.ctx.shadowColor=q(B.color),h.ctx.shadowBlur=B.blur.number,h.ctx.fillStyle=B.inset?q(B.color):"rgba(0,0,0,1)",h.ctx.fill(),h.ctx.restore()}),d.label=2;case 2:o=0,a=0,l=s,d.label=3;case 3:return a<l.length?(c=l[a],c.style!==0&&!OA(c.color)&&c.width>0?c.style!==2?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,o,e.curves,2)]:[3,11]):[3,13];case 4:return d.sent(),[3,11];case 5:return c.style!==3?[3,7]:[4,this.renderDashedDottedBorder(c.color,c.width,o,e.curves,3)];case 6:return d.sent(),[3,11];case 7:return c.style!==4?[3,9]:[4,this.renderDoubleBorder(c.color,c.width,o,e.curves)];case 8:return d.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,o,e.curves)];case 10:d.sent(),d.label=11;case 11:o++,d.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},A.prototype.renderDashedDottedBorder=function(e,t,n,s,i){return dA(this,void 0,void 0,function(){var o,a,l,c,h,d,B,g,f,m,F,Q,y,L,T,E,T,E;return nA(this,function(R){return this.ctx.save(),o=Hw(s,n),a=Ad(s,n),i===2&&(this.path(a),this.ctx.clip()),CA(a[0])?(l=a[0].start.x,c=a[0].start.y):(l=a[0].x,c=a[0].y),CA(a[1])?(h=a[1].end.x,d=a[1].end.y):(h=a[1].x,d=a[1].y),n===0||n===2?B=Math.abs(l-h):B=Math.abs(c-d),this.ctx.beginPath(),i===3?this.formatPath(o):this.formatPath(a.slice(0,2)),g=t<3?t*3:t*2,f=t<3?t*2:t,i===3&&(g=t,f=t),m=!0,B<=g*2?m=!1:B<=g*2+f?(F=B/(2*g+f),g*=F,f*=F):(Q=Math.floor((B+f)/(g+f)),y=(B-Q*g)/(Q-1),L=(B-(Q+1)*g)/Q,f=L<=0||Math.abs(f-y)<Math.abs(f-L)?y:L),m&&(i===3?this.ctx.setLineDash([0,g+f]):this.ctx.setLineDash([g,f])),i===3?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=t*2+1.1,this.ctx.strokeStyle=q(e),this.ctx.stroke(),this.ctx.setLineDash([]),i===2&&(CA(a[0])&&(T=a[3],E=a[0],this.ctx.beginPath(),this.formatPath([new S(T.end.x,T.end.y),new S(E.start.x,E.start.y)]),this.ctx.stroke()),CA(a[1])&&(T=a[1],E=a[2],this.ctx.beginPath(),this.formatPath([new S(T.end.x,T.end.y),new S(E.start.x,E.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},A.prototype.render=function(e){return dA(this,void 0,void 0,function(){var t;return nA(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=q(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=Sw(e),[4,this.renderStack(t)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},A}(rd),kw=function(r){return r instanceof Sc||r instanceof yc?!0:r instanceof Os&&r.type!==cn&&r.type!==ln},Gw=function(r,A){switch(r){case 0:return fn(A);case 2:return mw(A);case 1:default:return wn(A)}},Nw=function(r){switch(r){case 1:return"center";case 2:return"right";case 0:default:return"left"}},_w=["-apple-system","system-ui"],Vw=function(r){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?r.filter(function(A){return _w.indexOf(A)===-1}):r},Ow=function(r){FA(A,r);function A(e,t){var n=r.call(this,e,t)||this;return n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=t,n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width=t.width+"px",n.canvas.style.height=t.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+t.width+"x"+t.height+" at "+t.x+","+t.y+") with scale "+t.scale),n}return A.prototype.render=function(e){return dA(this,void 0,void 0,function(){var t,n;return nA(this,function(s){switch(s.label){case 0:return t=Ns(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,Ww(t)];case 1:return n=s.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=q(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},A}(rd),Ww=function(r){return new Promise(function(A,e){var t=new Image;t.onload=function(){A(t)},t.onerror=e,t.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(r))})},Xw=function(){function r(A){var e=A.id,t=A.enabled;this.id=e,this.enabled=t,this.start=Date.now()}return r.prototype.debug=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,Ir([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},r.prototype.getTime=function(){return Date.now()-this.start},r.prototype.info=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,Ir([this.id,this.getTime()+"ms"],A))},r.prototype.warn=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,Ir([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},r.prototype.error=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,Ir([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},r.instances={},r}(),Jw=function(){function r(A,e){var t;this.windowBounds=e,this.instanceName="#"+r.instanceCount++,this.logger=new Xw({id:this.instanceName,enabled:A.logging}),this.cache=(t=A.cache)!==null&&t!==void 0?t:new hw(this,A)}return r.instanceCount=1,r}(),zw=function(r,A){return A===void 0&&(A={}),Yw(r,A)};typeof window<"u"&&zc.setContext(window);var Yw=function(r,A){return dA(void 0,void 0,void 0,function(){var e,t,n,s,i,o,a,l,c,h,d,B,g,f,m,F,Q,y,L,T,R,E,R,K,b,W,iA,uA,G,tA,zA,gA,BA,de,IA,YA,ue,he,PA,ge;return nA(this,function(KA){switch(KA.label){case 0:if(!r||typeof r!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(e=r.ownerDocument,!e)throw new Error("Element is not attached to a Document");if(t=e.defaultView,!t)throw new Error("Document is not attached to a Window");return n={allowTaint:(K=A.allowTaint)!==null&&K!==void 0?K:!1,imageTimeout:(b=A.imageTimeout)!==null&&b!==void 0?b:15e3,proxy:A.proxy,useCORS:(W=A.useCORS)!==null&&W!==void 0?W:!1},s=is({logging:(iA=A.logging)!==null&&iA!==void 0?iA:!0,cache:A.cache},n),i={windowWidth:(uA=A.windowWidth)!==null&&uA!==void 0?uA:t.innerWidth,windowHeight:(G=A.windowHeight)!==null&&G!==void 0?G:t.innerHeight,scrollX:(tA=A.scrollX)!==null&&tA!==void 0?tA:t.pageXOffset,scrollY:(zA=A.scrollY)!==null&&zA!==void 0?zA:t.pageYOffset},o=new MA(i.scrollX,i.scrollY,i.windowWidth,i.windowHeight),a=new Jw(s,o),l=(gA=A.foreignObjectRendering)!==null&&gA!==void 0?gA:!1,c={allowTaint:(BA=A.allowTaint)!==null&&BA!==void 0?BA:!1,onclone:A.onclone,ignoreElements:A.ignoreElements,inlineImages:l,copyStyles:l},a.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),h=new Xc(a,r,c),d=h.clonedReferenceElement,d?[4,h.toIFrame(e,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return B=KA.sent(),g=Xs(d)||$f(d)?Eu(d.ownerDocument):Tr(a,d),f=g.width,m=g.height,F=g.left,Q=g.top,y=$w(a,d,A.backgroundColor),L={canvas:A.canvas,backgroundColor:y,scale:(IA=(de=A.scale)!==null&&de!==void 0?de:t.devicePixelRatio)!==null&&IA!==void 0?IA:1,x:((YA=A.x)!==null&&YA!==void 0?YA:0)+F,y:((ue=A.y)!==null&&ue!==void 0?ue:0)+Q,width:(he=A.width)!==null&&he!==void 0?he:Math.ceil(f),height:(PA=A.height)!==null&&PA!==void 0?PA:Math.ceil(m)},l?(a.logger.debug("Document cloned, using foreign object rendering"),R=new Ow(a,L),[4,R.render(d)]):[3,3];case 2:return T=KA.sent(),[3,5];case 3:return a.logger.debug("Document cloned, element located at "+F+","+Q+" with size "+f+"x"+m+" using computed rendering"),a.logger.debug("Starting DOM parsing"),E=Hc(a,d),y===E.styles.backgroundColor&&(E.styles.backgroundColor=DA.TRANSPARENT),a.logger.debug("Starting renderer for element at "+L.x+","+L.y+" with size "+L.width+"x"+L.height),R=new xw(a,L),[4,R.render(E)];case 4:T=KA.sent(),KA.label=5;case 5:return(!((ge=A.removeContainer)!==null&&ge!==void 0)||ge)&&(Xc.destroy(B)||a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),a.logger.debug("Finished rendering"),[2,T]}})})},$w=function(r,A,e){var t=A.ownerDocument,n=t.documentElement?it(r,getComputedStyle(t.documentElement).backgroundColor):DA.TRANSPARENT,s=t.body?it(r,getComputedStyle(t.body).backgroundColor):DA.TRANSPARENT,i=typeof e=="string"?it(r,e):e===null?DA.TRANSPARENT:4294967295;return A===t.documentElement?OA(n)?OA(s)?i:s:n:i};const bt=class bt extends p.EngineObject{constructor(A,e){super(A,e),this.ad(new w.ObjResettingWithEvent(A.renderInUEChanged,()=>A.renderInUE?new sd(A,e):new nd(A,e)))}};C(bt,"type",bt.register("ESUeViewer",p.ESGeoDiv.type,bt));let ti=bt;class nd extends w.Destroyable{constructor(e,t){super();C(this,"_screenPosition",this.disposeVar(w.reactArrayWithUndefined(void 0)));const n=t.viewer;if(!n){console.warn("viewer is undefined!");return}const s=this.disposeVar(new p.ESTextLabel);s.parentID=e.id,e.mainClass=s,t.add(s),this.dispose(()=>t.delete(s)),s.show=!1,this.dispose(w.bind([s,"position"],[e,"position"])),this.dispose(w.bind([s,"rotation"],[e,"rotation"])),this.dispose(w.bind([s,"flyToParam"],[e,"flyToParam"])),this.dispose(w.bind([s,"flyInParam"],[e,"flyInParam"])),this.dispose(e.calcFlyToParamEvent.disposableOn(()=>{$A(n,s.id)})),this.dispose(e.calcFlyInParamEvent.disposableOn(async()=>{if(!t.actived)return;const a=await t.getCurrentCameraInfo();if(!a)return;const{position:l,rotation:c}=a;e.flyInParam={position:l,rotation:c,flyDuration:1}})),this.dispose(e.smoothMoveEvent.disposableOn((a,l)=>{_e(n,s.id,a,l)})),this.dispose(e.smoothMoveWithRotationEvent.disposableOn((a,l,c)=>{ke(n,s.id,a,l,c)})),this.dispose(e.smoothMoveOnGroundEvent.disposableOn((a,l,c,h)=>{Ge(n,s.id,a,l,h,c)})),this.dispose(e.smoothMoveWithRotationOnGroundEvent.disposableOn((a,l,c,h,d)=>{Ne(n,s.id,a,l,c,h,d)})),this.dispose(e.flyToEvent.disposableOn((a,l)=>{s.flyTo(a)})),this.dispose(e.flyInEvent.don(a=>{s.flyIn(a)}));const i=this._screenPosition,o=this.disposeVar(new p.ESCustomDiv);o.parentID=e.id,t.add(o),this.dispose(()=>t.delete(o)),this.dispose(w.bind([o,"allowPicking"],[e,"allowPicking"]));{const a=this.disposeVar(w.createAnimateFrame()),l=()=>{e.show?a.restart(void 0,async()=>{if(!e.position)return;const c=await t.lonLatAltToScreenPosition(e.position);if(!this.isDestroyed())if(!c)this._screenPosition.value=void 0;else{const[h,d]=c;h===-1&&d===-1?this._screenPosition.value=void 0:this._screenPosition.value=[h,d]}}):a.cancel()};l(),this.dispose(e.showChanged.disposableOn(l))}{const a=()=>class extends w.Destroyable{constructor(d,B,g){if(super(),this._subContainer=d,!g)return;if(!e.instanceClass)throw new Error("!sceneObject.instanceClass");const f=new w.PosFloatDiv,m=f.element;this._subContainer.appendChild(m),this.dispose(()=>this._subContainer.removeChild(m)),m.onclick=F=>{(e.allowPicking??!1)&&e.pickedEvent.emit(new p.ESJPickedResult({div:m,pointerEvent:F},e,void 0,void 0,void 0,[F.x,F.y]))};{const F=()=>{e.editing?m.children[0].style.pointerEvents="none":m.children[0].style.pointerEvents="all"};F(),this.d(e.editingChanged.don(F))}{const F=()=>{const y=e.show;i.value&&y?(f.show=!0,f.winPos=[...i.value]):(f.show=!1,f.winPos=[0,0])};F();const Q=this.disposeVar(w.createNextAnimateFrameEvent(e.showChanged,i.changed));this.dispose(Q.disposableOn(F))}{const F=()=>{const[Q,y]=e.anchor??p.ESGeoDiv.defaults.anchor;f.originRatioX=Q,f.originRatioY=y};F(),this.dispose(e.anchorChanged.disposableOn(F))}{const F=()=>{f.opacity=e.opacity??p.ESGeoDiv.defaults.opacity};F(),this.dispose(e.opacityChanged.disposableOn(F))}this.disposeVar(new e.instanceClass(f.contentDiv,e,g))}},l=()=>{try{e.instanceClass?o.instanceClass=a():o.instanceClass=void 0}catch(h){console.error(h)}};l();const c=this.dv(w.createNextAnimateFrameEvent(e.instanceClassChanged,e.opacityChanged,e.anchorChanged,e.editingChanged,e.showChanged,e.allowPickingChanged));this.d(c.don(l))}}get screenPosition(){return this._screenPosition.value}get screenPositionChanged(){return this._screenPosition.changed}set screenPosition(e){this._screenPosition.value=e}}class sd extends w.Destroyable{constructor(e,t){super();C(this,"_imageLabel");C(this,"_hasClassDivAndPos",{});this._imageLabel=this.dv(new p.ESImageLabel),this._imageLabel.isHoverZoom=!1,this._imageLabel.parentID=e.id;const n=t.viewer;if(!n){console.warn("viewer is undefined!");return}e.mainClass=this._imageLabel;const s=this._imageLabel;t.add(s),this.d(()=>t.delete(s));{const i=()=>{if(!n)return;if(!e.instanceClass)throw new Error("!sceneObject.instanceClass");const l=document.createElement("div"),c=this.dv(new e.instanceClass(l,e,t))._container;if(c.style.opacity=e.opacity.toString()??p.ESGeoDiv.defaults.opacity,c.style.position="fixed",c.style.zIndex="-1",c.style.top="0px",!document.body.contains(c)){document.body.appendChild(c);let d=c?c.querySelectorAll("*[class]"):[];for(let B=0;B<d.length;B++){const g=d[B];var h=g.getBoundingClientRect();this._hasClassDivAndPos[g.className]=[g.offsetLeft,g.offsetTop,g.offsetLeft+h.width,g.offsetTop+h.height]}}zw(c,{backgroundColor:null,allowTaint:!0,useCORS:!0,width:c.offsetWidth,height:c.offsetHeight,scale:1}).then(d=>{document.body.contains(c)&&document.body.removeChild(c),s.url=d.toDataURL(),s.show=e.show}).catch(()=>{document.body.contains(c)&&document.body.removeChild(c)})},o=()=>{try{e.instanceClass?i():(s.url="",s.show=!1)}catch(l){console.error(l)}};o();const a=this.dv(w.createNextAnimateFrameEvent(e.instanceClassChanged,e.opacityChanged));this.d(a.don(o))}{const i=()=>{s.show=e.show};s.show=!1,this.ad(e.showChanged.don(i))}this.d(w.track([s,"anchor"],[e,"anchor"])),this.d(w.bind([s,"position"],[e,"position"])),this.d(w.bind([s,"rotation"],[e,"rotation"])),this.d(w.bind([s,"flyToParam"],[e,"flyToParam"])),this.d(w.bind([s,"flyInParam"],[e,"flyInParam"])),this.d(w.bind([s,"allowPicking"],[e,"allowPicking"])),this.d(w.bind([s,"scale"],[e,"scale"])),this.d(w.track([s,"minVisibleDistance"],[e,"minVisibleDistance"])),this.d(w.track([s,"maxVisibleDistance"],[e,"maxVisibleDistance"])),this.ad(e.automaticLandingEvent.don(()=>{s.automaticLanding()})),this.d(t.widgetEvent.don(i=>{if(i.objId!==this._imageLabel.id)return;const{type:o,add:a}=i;if(o==="leftClick"&&a){const l=(a==null?void 0:a.classNames)??[],c=Object.keys(this._hasClassDivAndPos);for(let h=0;h<c.length;h++){const d=c[h];let B=this._hasClassDivAndPos[d];a&&a.mouseRelativePos&&a.mouseRelativePos[0]>=B[0]&&a.mouseRelativePos[0]<=B[2]&&a.mouseRelativePos[1]>=B[1]&&a.mouseRelativePos[1]<=B[3]&&l.push(d)}a.classNames=l}e.widgetEvent.emit({type:o,add:a})})),this.d(e.calcFlyToParamEvent.don(()=>{$A(n,s.id)})),this.d(e.calcFlyInParamEvent.don(()=>{const i=t.getCurrentCameraInfo();if(!i)return;const{position:o,rotation:a}=i;e.flyInParam={position:o,rotation:a,flyDuration:1}})),this.d(e.smoothMoveEvent.don((i,o)=>{_e(n,s.id,i,o)})),this.d(e.smoothMoveWithRotationEvent.don((i,o,a)=>{ke(n,s.id,i,o,a)})),this.d(e.smoothMoveOnGroundEvent.don((i,o,a,l)=>{Ge(n,s.id,i,o,l,a)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((i,o,a,l,c)=>{Ne(n,s.id,i,o,a,l,c)})),this.d(e.flyToEvent.don((i,o)=>{s.flyTo(i)})),this.d(e.flyInEvent.don(i=>{s.flyIn(i)}))}}const Dt=class Dt extends lA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.d(A.flyToFeatureIndexEvent.don((n,s)=>{t.callUeFunc({f:"flyToFeatureIndex",p:{id:A.id,index:n,duration:s}})})),this.d(A.flyToFeatureEvent.don((n,s,i)=>{t.callUeFunc({f:"flyToFeature",p:{id:A.id,key:n,value:s,duration:i}})}))}};C(Dt,"type",Dt.register("ESUeViewer",p.ESGeoJson.type,Dt));let ri=Dt;const Rt=class Rt extends rA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Rt,"type",Rt.register("ESUeViewer",p.ESGeoLineString.type,Rt));let Fn=Rt;const Pt=class Pt extends rA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Pt,"type",Pt.register("ESUeViewer",p.ESGeoRectangle.type,Pt));let ni=Pt;const Kt=class Kt extends cA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Kt,"type",Kt.register("ESUeViewer",p.ESGeoWater.type,Kt));let si=Kt;const oe=class oe extends x{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.d(A.setNodePositionEvent.don((n,s)=>{io(t,A.id,n,s)})),this.d(A.setNodeRotationEvent.don((n,s)=>{oo(t,A.id,n,s)})),this.d(A.setNodeScaleEvent.don((n,s)=>{ao(t,A.id,n,s)}))}};C(oe,"forceUeUpdateProps",[...x.forceUeUpdateProps,"url"]),C(oe,"propValFuncs",{...x.propValFuncs,url:A=>typeof A=="string"?p.ESSceneObject.context.getStrFromEnv(p.rpToap(A)):(A.url=p.ESSceneObject.context.getStrFromEnv(p.rpToap(A.url)),A),czmMaximumScale:null,czmMinimumPixelSize:null,czmNativeScale:null,czmColor:null}),C(oe,"type",oe.register("ESUeViewer",p.ESGltfModel.type,oe));let ii=oe;const xt=class xt extends rA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(xt,"type",xt.register("ESUeViewer",p.ESHeightMeasurement.type,xt));let oi=xt;const kt=class kt extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}const n=async(i,o,a,l)=>{const{viewer:c}=i;if(!c){console.error("AIMoveTo: ueViewer.viewer is undefined");return}const h=await c.callUeFunc({f:"AIMoveTo",p:{id:o,Destination:a,Time:l}});return h.error&&console.error("AIMoveTo:",h.error),h};this.d(A.aiMoveToEvent.don((i,o)=>{n(e,A.id,i,o)}));const s=async(i,o)=>{const{viewer:a}=i;if(!a){console.error("StopAIMove: ueViewer.viewer is undefined");return}const l=await a.callUeFunc({f:"StopAIMove",p:{id:o}});return l.error&&console.error("StopAIMove:",l.error),l};this.d(A.stopAIMoveEvent.don(()=>{s(e,A.id)}))}};C(kt,"type",kt.register("ESUeViewer",p.ESHuman.type,kt));let ai=kt;const ae=class ae extends UA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}A.anchor=[.5,1]}};C(ae,"type",ae.register("ESUeViewer",p.ESImageLabel.type,ae)),C(ae,"forceUeUpdateProps",[...UA.forceUeUpdateProps,"url"]),C(ae,"propValFuncs",{...UA.propValFuncs,url:A=>typeof A=="string"?p.ESSceneObject.context.getStrFromEnv(p.rpToap(A)):(A.url=p.ESSceneObject.context.getStrFromEnv(p.rpToap(A.url)),A)});let li=ae;const Gt=class Gt extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Gt,"type",Gt.register("ESUeViewer",p.ESLevelRuntimeModel.type,Gt));let ci=Gt;const Nt=class Nt extends Er{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Nt,"type",Nt.register("ESUeViewer",p.ESLocalCircle.type,Nt));let di=Nt;const _t=class _t extends lA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(_t,"type",_t.register("ESUeViewer",p.ESLocalPolygonZ.type,_t));let ui=_t;const Vt=class Vt extends Er{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Vt,"type",Vt.register("ESUeViewer",p.ESLocalRectangle.type,Vt));let hi=Vt;const Ot=class Ot extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Ot,"type",Ot.register("ESUeViewer",p.ESLocalSkyBox.type,Ot));let gi=Ot;const Wt=class Wt extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Wt,"type",Wt.register("ESUeViewer",p.ESLocationMeasurement.type,Wt));let Bi=Wt;const Xt=class Xt extends rA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Xt,"type",Xt.register("ESUeViewer",p.ESPipeFence.type,Xt));let fi=Xt;const Jt=class Jt extends Fn{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Jt,"type",Jt.register("ESUeViewer",p.ESPipeline.type,Jt));let wi=Jt;const zt=class zt extends yr{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.d(A.highlightFeatureEvent.don(n=>{const s=typeof n=="number"?n.toString():n;to(t,A.id,s)})),this.d(A.highlightFeatureAndFlyToEvent.don((n,s,i,o)=>{const a=typeof n=="number"?n.toString():n;ro(t,A.id,a,o??1)})),this.d(A.setLayerVisibleEvent.don((n,s)=>{let i="";typeof s!="string"?i=JSON.stringify(s):i=s,no(t,A.id,i)})),this.d(A.setLayerColorEvent.don((n,s)=>{let i="";typeof s!="string"?i=JSON.stringify(s):i=s,so(t,A.id,i)}))}};C(zt,"type",zt.register("ESUeViewer",p.ESPipeserTileset.type,zt));let pi=zt;const Yt=class Yt extends cA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Yt,"type",Yt.register("ESUeViewer",p.ESPit.type,Yt));let Ci=Yt;const $t=class $t extends UA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.ad(A.getInitialStyleEvent.don(async()=>{try{const n=await t.callUeFunc({f:"GetInitialStyle",p:{id:A.id}});n.error!=""&&console.error("getInitialStyleEvent:",n.error),A.initialStyle.value=structuredClone(n.re)}catch(n){console.error("getInitialStyleEvent:",n),A.initialStyle.value=void 0}}))}};C($t,"type",$t.register("ESUeViewer",p.ESPoi2D.type,$t));let vi=$t;const Zt=class Zt extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Zt,"type",Zt.register("ESUeViewer",p.ESPoi3D.type,Zt));let mi=Zt;const le=class le extends lA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(le,"type",le.register("ESUeViewer",p.ESPoiTileset.type,le)),C(le,"forceUeUpdateProps",[...lA.forceUeUpdateProps,"url"]),C(le,"propValFuncs",{...lA.propValFuncs,url:A=>typeof A=="string"?p.ESSceneObject.context.getStrFromEnv(A):(A.url=p.ESSceneObject.context.getStrFromEnv(A.url),A)});let Fi=le;const qt=class qt extends rA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(qt,"type",qt.register("ESUeViewer",p.ESPolygonFence.type,qt));let Qi=qt;const De=class De extends cA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(De,"type",De.register("ESUeViewer",p.ESPolygonFlattenedPlane.type,De)),C(De,"propValFuncs",{...cA.propValFuncs,targetID:A=>{if(!A)return"";const e=p.ESSceneObject.getSceneObject(A);return e?e.getMainClass().id:A}});let Ui=De;const jt=class jt extends cA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(jt,"type",jt.register("ESUeViewer",p.ESPolygonWithHole.type,jt));let Ei=jt;const Ar=class Ar extends jA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(()=>{A.ids=[]}),this.d(A.highlightInner3DtilesetEvent.don(n=>{n.highlight=!0})),this.d(A.removeHighlightInner3DtilesetEvent.don(n=>{n.highlight=!1}));{const n=o=>{o=o.toLocaleLowerCase();let a=[255,255,255,1];if(o.startsWith("#")){if(o.length===4){let l=parseInt(o[1]+o[1],16),c=parseInt(o[2]+o[2],16),h=parseInt(o[3]+o[3],16);a=[l,c,h,1]}else if(o.length===7){let l=parseInt(o.substring(1,3),16),c=parseInt(o.substring(3,5),16),h=parseInt(o.substring(5,7),16);a=[l,c,h,1]}}else if(o.startsWith("rgba")){let l=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/);if(l){let c=parseInt(l[1]),h=parseInt(l[2]),d=parseInt(l[3]),B=parseFloat(l[4]);a=[c,h,d,B]}}else if(o.startsWith("rgb")){let l=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);if(l){let c=parseInt(l[1]),h=parseInt(l[2]),d=parseInt(l[3]);a=[c,h,d,1]}}else console.error("color类型只能为#rrggbb、#rgb、rgba(r,g,b,a)、rgb(r,g,b)");return[a[0]/255,a[1]/255,a[2]/255,a[3]]},s=()=>{const o=A.layerConfig;if(!o)return;const a=[];o.forEach(l=>{o.filter(h=>h.dataset==l.dataset).length==1?a.push({condition:[{field:"dataset",op:"==",value:l.dataset}],color:n(l.value.color??"rgb(255,255,255)"),show:l.value.visible}):a.push({condition:[{field:"layer",op:"==",value:l.layer},{field:"dataset",op:"==",value:l.dataset}],color:n(l.value.color??"rgb(255,255,255)"),show:l.value.visible})}),A.setFeatureStyle(a)};s();const i=this.dv(w.createNextAnimateFrameEvent(A.layerConfigChanged,A.colorBlendModeChanged));this.d(i.don(()=>{s()}))}}};C(Ar,"type",Ar.register("ESUeViewer",p.ESRtsTileset.type,Ar));let yi=Ar;const er=class er extends lA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(A.addTreesEvent.don(n=>{p.addTreesCallFunc(e,A.id,n)})),this.d(A.removeAllTreesEvent.don(()=>{p.removeAllTreesCallFunc(e,A.id)})),this.d(A.updateTreeParamsEvent.don(n=>{p.updateTreeParamsCallFunc(e,A.id,n)})),this.d(A.cutDownTreesEvent.don((n,s)=>{p.cutDownTreesCallFunc(e,A.id,n,s)})),this.d(A.growthSimulationEvent.don((n,s,i)=>{p.growthSimulationCallFunc(e,A.id,n,s,i)}))}};C(er,"type",er.register("ESUeViewer",p.ESSeparateFoliage.type,er));let Si=er;const tr=class tr extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(tr,"type",tr.register("ESUeViewer",p.ESSubmergingAnalysis.type,tr));let Ii=tr;const rr=class rr extends cA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.d(A.startEvent.don(()=>{t.callUeFunc({f:"Start",p:{id:A.id}})})),this.d(A.stopEvent.don(()=>{t.callUeFunc({f:"Stop",p:{id:A.id}})}))}};C(rr,"type",rr.register("ESUeViewer",p.ESSunshineAnalysis.type,rr));let Ti=rr;const nr=class nr extends cA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.d(A.startEvent.don(()=>{t.callUeFunc({f:"Start",p:{id:A.id}})}))}};C(nr,"type",nr.register("ESUeViewer",p.ESSurfaceAreaMeasurement.type,nr));let Hi=nr;const sr=class sr extends UA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(sr,"type",sr.register("ESUeViewer",p.ESTextLabel.type,sr));let Li=sr;const Re=class Re extends UA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.d(A.callFunctionEvent.don(async(n,s)=>{const i=await yn(t,A.id,n,s);A.__callFunctionResultEvent.emit(i)}))}};C(Re,"type",Re.register("ESUeViewer",p.ESUEWidget.type,Re)),C(Re,"propValFuncs",{...UA.propValFuncs,info:A=>JSON.stringify(A??{})});let Mi=Re;const id=r=>{switch(r){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"未搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是场景原有的,而是新建的,无法绑定";case 4:return"搜索到ActorTag对应的Actor是地形或3DTileset,无法绑定";default:return"未知错误"}},Zw=r=>{switch(r){case 0:return"创建成功";case 1:return"未找到对应的资源,无法创建";case 2:return"Id与场景中现有的ActorTag重复,创建后可能出现问题,创建失败";default:return"未知错误"}},ir=class ir extends p.EngineObject{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn(`${A.id} UeESUnrealActor viewer is undefined!`);return}this.d(()=>{Un(t,A.id)});const n=async()=>{l()||await t.callUeFunc({f:"update",p:{id:A.id,name:A.name,show:A.show,rotation:A.rotation,flyToParam:A.flyToParam??p.ESVisualObject.defaults.flyToParam,flyInParam:A.flyInParam??p.ESVisualObject.defaults.flyInParam,highlight:A.highlight,collision:A.collision,scale:A.scale,minVisibleDistance:A.minVisibleDistance,maxVisibleDistance:A.maxVisibleDistance}})},s=this.dv(w.createNextAnimateFrameEvent(A.showChanged,A.nameChanged,A.rotationChanged,A.flyToParamChanged,A.flyInParamChanged,A.highlightChanged,A.collisionChanged,A.scaleChanged,A.minVisibleDistanceChanged,A.maxVisibleDistanceChanged));this.d(s.don(n)),this.d(A.flushEvent.don(()=>s.flush()));let i,o;const a=async()=>{l()||(await t.callUeFunc({f:"update",p:{id:A.id,position:A.position}}),(e.debug??!1)&&console.log(`updatePostion:${A.position},actorTag:${A.actorTag},actorClass:${A.actorClass}`))},l=()=>!i&&!o?(console.warn(`${A.id} 未绑定ActorTag或未创建ActorClass!`),!0):!1,c=async()=>{const{id:d}=A,B=await e.unBindActorByID(d);B&&B.error!==""&&console.warn(`${A.id} UeESUnrealActor UnBindActorByID: ${B.error}`),i=void 0;const g=await t.callUeFunc({f:"destroy",p:{id:d}});if(g&&g.error!==""){console.warn(`${A.id} UeESUnrealActor DestroyActorByID: ${g.error}`);return}o=void 0},h=this.dv(w.react({type:"ActorClass",actorClass:"default"}));{const d=this.dv(w.createNextAnimateFrameEvent(A.actorClassChanged,A.actorTagChanged)),B=async()=>{A.actorTag!==""?h.value={type:"ActorTag",actorTag:A.actorTag}:h.value={type:"ActorClass",actorClass:A.actorClass===""?"default":A.actorClass}};B(),this.d(d.don(B)),this.d(A.flushEvent.don(()=>d.flush()))}{const d=this.dv(w.createProcessingFromAsyncFunc(async g=>{if(await g.promise(c()),h.value.type==="ActorTag"){const{actorTag:f}=h.value;await g.promise(c());try{A.lastActorStatus="null";const m=await g.promise(e.bindActorByTag(A.id,f));if(!m)return;if(m.error!==""){console.warn(`${A.id} UeESUnrealActor BindActorByTag:${f},${m.error}`);return}if(m.re.type===0)A.lastActorStatus="bound",i=f;else if(m.re.type===1)A.lastActorStatus="bound",i=f,console.warn(`${A.id} UeESUnrealActor BindActorByTag:${f},${id(m.re.type)}`);else{i=void 0,console.warn(`${A.id} UeESUnrealActor BindActorByTag error:${f}, ${id(m.re.type)}`);return}}catch(m){console.warn(`${A.id} UeESUnrealActor BindActorByTag catch error:${f}, ${m}`);return}}else if(h.value.type==="ActorClass"){const{actorClass:f}=h.value;try{const m=await g.promise(e.createActorByClass(A.id,f));if(!m)return;if(m.error!==""){console.warn(`${A.id} UeESUnrealActor CreateActorByClass error :${f}, ${m.error}`);return}if(m.re.type===0)A.lastActorStatus="created",o=f;else{console.warn(`${A.id} UeESUnrealActor CreateActorByClass error type :${f},${Zw(m.re.type)}`);return}}catch(m){console.warn(`${A.id} UeESUnrealActor CreateActorByClass error catch :${f}, ${JSON.stringify(m)}`);return}}await g.promise(n()),await g.promise(a())})),B=async()=>{d.restart()};B(),this.d(h.changed.don(B))}this.d(A.positionChanged.don(a)),this.d(A.callFunctionEvent.don(async(d,B)=>{if(l()){A.__callFunctionResultEvent.emit(void 0);return}const g=await yn(t,A.id,d,B);A.__callFunctionResultEvent.emit(g)})),this.d(A.smoothMoveEvent.don((d,B)=>{l()||_e(t,A.id,d,B)})),this.d(A.smoothMoveWithRotationEvent.don((d,B,g)=>{l()||ke(t,A.id,d,B,g)})),this.d(A.smoothMoveOnGroundEvent.don((d,B,g,f)=>{l()||Ge(t,A.id,d,B,f,g)})),this.d(A.smoothMoveWithRotationOnGroundEvent.don((d,B,g,f,m)=>{l()||Ne(t,A.id,d,B,g,f,m)})),this.d(A.automaticLandingEvent.don(d=>{if(l())return;const B=[A.position[0],A.position[1]];e.getHeightByLonLat(A.position[0],A.position[1],"Visibility").then(g=>{g!==null&&(A.position=[...B,g],A.collision=d)})})),this.d(A.flyToEvent.don(async(d,B)=>{if(l())return;const g=await Be(t,A.id,d);let f="over";g===void 0?f="error":g.endType===0?f="over":g.endType===1&&(f="cancelled"),A.flyOverEvent.emit(B,f,e)})),this.d(A.calcFlyToParamEvent.don(()=>{l()||$A(t,A.id)})),this.d(A.calcFlyInParamEvent.don(async()=>{if(!e.actived)return;const d=await e.getCurrentCameraInfo();if(!d)return;const{position:B,rotation:g}=d;A.flyInParam={position:B,rotation:g,flyDuration:1}})),this.d(e.propChanged.don(d=>{l()||d.objId===A.id&&Object.keys(d.props).forEach(B=>{const g=d.props[B]===null?void 0:d.props[B];A[B]=g})}))}};C(ir,"type",ir.register("ESUeViewer",p.ESUnrealActor.type,ir));let bi=ir;const or=class or extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(or,"type",or.register("ESUeViewer",p.ESVideoFusion.type,or));let Di=or;const ar=class ar extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(ar,"type",ar.register("ESUeViewer",p.ESViewShed.type,ar));let Ri=ar;const lr=class lr extends rA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is underfined!");return}}};C(lr,"type",lr.register("ESUeViewer",p.ESVisibilityAnalysis.type,lr));let Pi=lr;const cr=class cr extends cA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.ad(w.track([A,"volume"],[A,"cutAndFillVolume"])),this.d(A.startEvent.don(()=>{t.callUeFunc({f:"Start",p:{id:A.id}})})),this.d(A.clearEvent.don(()=>{t.callUeFunc({f:"Clear",p:{id:A.id}})}))}};C(cr,"type",cr.register("ESUeViewer",p.ESVolumeMeasurement.type,cr));let Ki=cr;const Pe=class Pe extends UA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Pe,"type",Pe.register("ESUeViewer",p.ESWidget.type,Pe)),C(Pe,"propValFuncs",{...UA.propValFuncs,info:A=>JSON.stringify(A??{})});let xi=Pe;const dr=class dr extends p.EngineObject{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}A.poi.actorTag=A.human.id,A.poi.positionOffset=[0,0,A.poiOffsetHeight-.8],this.d(A.poiOffsetHeightChanged.don(()=>{A.poi.positionOffset=[0,0,A.poiOffsetHeight-.8]})),this.d(()=>{A.poi.actorTag=""})}};C(dr,"type",dr.register("ESUeViewer",p.ESHumanPoi.type,dr));let ki=dr;p.ESSceneObject.context.getStrFromEnv(p.ESNavigator.defaults.imgUrl);const ur=class ur extends p.EngineObject{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new p.ESCustomDiv);e.add(n),this.dispose(()=>e.delete(n)),this.dispose(w.track([n,"show"],[A,"show"])),n.instanceClass=class extends w.Destroyable{constructor(i,o,a){super(),this._subContainer=i;const l=document.createElement("div");this._subContainer.appendChild(l),this.dispose(()=>this._subContainer.removeChild(l));{const d=async()=>{const B=await e.getCurrentCameraInfo(),g=B==null?void 0:B.position,m=[...B==null?void 0:B.rotation];m[0]=360,e.flyIn(g,m)};l.addEventListener("click",d),l.style.cursor="pointer",this.dispose(()=>l.removeEventListener("click",d))}{const d=()=>{l.style.width=`${A.cssSize?A.cssSize:p.ESNavigator.defaults.cssSize}px`,l.style.height=`${A.cssSize?A.cssSize:p.ESNavigator.defaults.cssSize}px`};d(),A.dispose(A.cssSizeChanged.disposableOn(d))}l.style.position="fixed";{const d=()=>{l.style.top=`${A.cssPosition?A.cssPosition[0]:p.ESNavigator.defaults.cssPosition[0]}px`,l.style.right=`${A.cssPosition?A.cssPosition[1]:p.ESNavigator.defaults.cssPosition[1]}px`};d(),A.dispose(A.cssPositionChanged.disposableOn(d))}l.style.transition=" right 0.4s linear",l.style.cursor="pointer";const c=document.createElement("div");l.appendChild(c),this.dispose(()=>l.removeChild(c)),c.style.width="100%",c.style.height="100%",c.style.position="relative";const h=document.createElement("img");c.appendChild(h),this.dispose(()=>c.removeChild(h)),h.style.width="100%",h.style.height="100%",h.style.border="none";{const d=()=>h.src=A.imgUrl;d(),A.dispose(A.imgUrlChanged.disposableOn(d))}{const d=()=>{const m=-e.getCurrentCameraInfo().rotation[0];h.style.transform=`rotate(${m}deg)`};let B;const g=async()=>{d(),A.show?(l.style.display="block",B=setInterval(()=>{d()},1e3)):(l.style.display="none",clearInterval(B))};this.dispose(A.showChanged.disposableOn(g)),g(),this.dispose(()=>clearInterval(B))}h.style.transformOrigin="50% 50%"}}}};C(ur,"type",ur.register("ESUeViewer",p.ESNavigator.type,ur));let Gi=ur;const ce=class ce extends rA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}{const n=()=>{let s=A.materialMode==="blue"?"multipleArrows":A.materialMode==="purple"?"singleArrow":A.materialMode;t.callUeFunc({f:"update",p:{id:A.id,materialMode:s}})};this.dispose(A.materialModeChanged.disposableOn(n)),this.dispose(A.createdEvent.disposableOn(n))}}};C(ce,"type",ce.register("ESUeViewer",p.ESPath.type,ce)),C(ce,"forceUeUpdateProps",[...rA.forceUeUpdateProps]),C(ce,"propValFuncs",{...rA.propValFuncs,materialMode:null});let Ni=ce;async function qw(r){navigator.clipboard.writeText(r).then(function(){console.log("复制成功")},function(A){console.log("复制失败")})}const hr=class hr extends p.EngineObject{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new p.ESCustomDiv);e.add(n),this.dispose(()=>e.delete(n)),n.instanceClass=class extends w.Destroyable{constructor(i,o,a){if(super(),this._subContainer=i,!a||!(a instanceof LA))return;const l=document.createElement("div");this._subContainer.appendChild(l),this.dispose(()=>this._subContainer.removeChild(l)),l.style.width="100%",l.style.position="absolute",l.style.height=`${p.ESViewerStatusBar.defaults.height}px`,l.style.left="0",l.style.bottom="0",l.style.color="#fff",l.style.padding="0 20px 0 0",l.style.boxSizing="border-box",l.style.lineHeight=`${p.ESViewerStatusBar.defaults.height}px`,l.style.zIndex="100",l.style.alignContent="center",l.style.justifyContent="space-between";const c=document.createElement("span");l.appendChild(c),this.dispose(()=>l.removeChild(c));const h=document.createElement("span");c.appendChild(h),this.dispose(()=>c.removeChild(h));const d=document.createElement("span");c.appendChild(d),d.addEventListener("dblclick",function(){let g=d.innerHTML;g.startsWith("鼠标位置")&&(g=g.slice(5)),qw(g)}),d.style.cursor="pointer",this.dispose(()=>c.removeChild(d));const B=document.createElement("span");l.appendChild(B),this.dispose(()=>l.removeChild(B));{const g=()=>{l.style.height=(A.height??p.ESViewerStatusBar.defaults.height)+"px",l.style.lineHeight=(A.height??p.ESViewerStatusBar.defaults.height)+"px"};this.dispose(A.heightChanged.disposableOn(g)),g()}{const g=()=>{l.style.fontSize=(A.fontSize??p.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(A.fontSizeChanged.disposableOn(g)),g()}{const g=()=>{A.bgColor?l.style.background=`rgba(${A.bgColor[0]*255},${A.bgColor[1]*255},${A.bgColor[2]*255},${A.bgColor[3]})`:l.style.background=`rgba(${p.ESViewerStatusBar.defaults.bgColor[0]},${p.ESViewerStatusBar.defaults.bgColor[1]},${p.ESViewerStatusBar.defaults.bgColor[2]},${p.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(A.bgColorChanged.disposableOn(g)),g()}a.getVersion().then(g=>{g&&(B.innerText=`Ue 版本 : ${g[0]} `)}).catch(g=>{console.log(g)});{const g=()=>{let F="",Q="";F+=`帧率:${a.getFPS().toFixed(0)}FPS`,h.innerText=F;const y=e.getCurrentCameraInfo();F+=` 经度: ${y.position[0].toFixed(5)}° 纬度: ${y.position[1].toFixed(5)}° 高度: ${y.position[2].toFixed(2)}米 偏航角: ${y.rotation[0].toFixed(2)}° 俯仰角: ${y.rotation[1].toFixed(2)}° 翻滚角:${y.rotation[2].toFixed(2)}° `,h.innerText=F,e.pick().then(L=>{if(L){const{pickResult:T}=L;if(T&&T.position){const{position:E}=T;Q+=`鼠标位置:${E[0].toFixed(5)}° ${E[1].toFixed(5)}° ${E[2].toFixed(2)}m`}else Q+="暂时无法获取鼠标位置...";d.innerText=Q}}).catch(L=>{console.log(L)})};let f;const m=async()=>{g(),A.show?(l.style.display="flex",f=setInterval(()=>{g()},1e3)):(l.style.display="none",clearInterval(f))};this.dispose(A.showChanged.disposableOn(m)),m(),this.dispose(()=>clearInterval(f))}}}}};C(hr,"type",hr.register("ESUeViewer",p.ESViewerStatusBar.type,hr));let _i=hr;const gr=class gr extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(gr,"type",gr.register("ESUeViewer",p.ESGaussianSplatting.type,gr));let Vi=gr;const Br=class Br extends jA{constructor(e,t){super(e,t);C(this,"_es3DTileset",this.dv(new p.ES3DTileset));if(!t.viewer){console.warn("viewer is undefined!");return}this.es3DTileset.parentID=e.id,e.mainClass=this._es3DTileset;{const s=this._es3DTileset;t.add(s),this.dispose(()=>t.delete(s)),this.d(w.track([s,"allowPicking"],[e,"allowPicking"])),this.d(w.track([s,"collision"],[e,"collision"])),this.d(w.bind([s,"flyToParam"],[e,"flyToParam"])),this.d(w.bind([s,"flyToParam"],[e,"flyToParam"])),this.d(w.track([s,"url"],[e,"url"])),this.d(w.track([s,"actorTag"],[e,"actorTag"])),this.d(w.track([s,"materialMode"],[e,"materialMode"])),this.d(w.track([s,"highlight"],[e,"highlight"])),this.d(w.track([s,"maximumScreenSpaceError"],[e,"maximumScreenSpaceError"])),this.d(w.track([s,"highlightID"],[e,"highlightID"])),this.d(w.track([s,"highlightColor"],[e,"highlightColor"])),this.d(w.bind([s,"offset"],[e,"offset"])),this.d(w.bind([s,"rotation"],[e,"rotation"])),this.d(w.track([s,"czmImageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(w.track([s,"czmLuminanceAtZenith"],[e,"czmLuminanceAtZenith"])),this.d(w.track([s,"czmMaximumMemoryUsage"],[e,"czmMaximumMemoryUsage"])),this.d(w.track([s,"czmClassificationType"],[e,"czmClassificationType"])),this.d(w.track([s,"czmStyleJson"],[e,"czmStyleJson"])),this.d(w.track([s,"czmBackFaceCulling"],[e,"czmBackFaceCulling"])),this.d(w.track([s,"czmDebugShowBoundingVolume"],[e,"czmDebugShowBoundingVolume"])),this.d(w.track([s,"czmDebugShowContentBoundingVolume"],[e,"czmDebugShowContentBoundingVolume"])),this.d(w.track([s,"colorBlendMode"],[e,"colorBlendMode"])),this.d(w.track([s,"cacheBytes"],[e,"cacheBytes"])),this.d(w.track([s,"clippingPlaneEnabled"],[e,"clippingPlaneEnabled"])),this.d(w.track([s,"unionClippingRegions"],[e,"unionClippingRegions"])),this.d(w.track([s,"clippingPlaneEdgeColor"],[e,"clippingPlaneEdgeColor"])),this.d(w.track([s,"clippingPlaneEdgeWidth"],[e,"clippingPlaneEdgeWidth"])),this.d(w.track([s,"materialParams"],[e,"materialParams"])),this.d(w.bind([s,"supportEdit"],[e,"supportEdit"])),this.d(w.bind([s,"clippingPlanesId"],[e,"clippingPlanesId"])),this.d(w.bind([s,"clippingPlaneIds"],[e,"clippingPlaneIds"])),this.d(w.bind([s,"flattenedPlaneId"],[e,"flattenedPlaneId"])),this.d(w.bind([s,"flattenedPlaneEnabled"],[e,"flattenedPlaneEnabled"])),this.d(w.bind([s,"clippingPlaneId"],[e,"clippingPlaneId"])),this.d(w.bind([s,"excavateId"],[e,"excavateId"]))}{const s=this._es3DTileset;this.d(e.refreshTilesetEvent.don(()=>{s.refreshTileset()})),this.d(e.highlightFeatureEvent.don((...i)=>{s.highlightFeature(...i)})),this.d(e.highlightFeatureAndFlyToEvent.don((...i)=>{s.highlightFeatureAndFlyTo(...i)})),this.d(e.setFeatureColorEvent.don((...i)=>{s.setFeatureColor(...i)})),this.d(e.setFeatureVisableEvent.don((...i)=>{s.setFeatureVisable(...i)})),this.d(e.resetFeatureStyleEvent.don((...i)=>{s.resetFeatureStyle(...i)})),this.d(e.flyInEvent.don((...i)=>{s.flyIn(i[0])})),this.d(e.flyToEvent.don((...i)=>{s.flyTo(i[0])})),this.d(e.calcFlyToParamEvent.don((...i)=>{s.calcFlyToParam(...i)})),this.d(e.calcFlyInParamEvent.don((...i)=>{s.calcFlyInParam(...i)}))}{const s=this._es3DTileset;this.d(s.tilesetReady.don(i=>{e.tilesetReady.emit(i)})),this.d(s.pickedEvent.don(i=>{i.assign({sceneObject:e}),e.pickedEvent.emit(i)}))}{const s=()=>{this.es3DTileset.show=e.show};s(),this.d(e.showChanged.don(()=>{s()}))}}get es3DTileset(){return this._es3DTileset}};C(Br,"type",Br.register("ESUeViewer",p.ESRtsFeatureEditing.type,Br));let Oi=Br;const fr=class fr extends jA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(fr,"type",fr.register("ESUeViewer",p.ESMsTileset.type,fr));let Wi=fr;const wr=class wr extends cA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}const n=()=>{t.callUeFunc({f:"update",p:{id:A.id,height:A.height??p.ESGeoExtrudedPolygon.defaults.height,extrudedHeight:A.extrudedHeight??p.ESGeoExtrudedPolygon.defaults.extrudedHeight,perPositionHeight:A.perPositionHeight??p.ESGeoExtrudedPolygon.defaults.perPositionHeight}})},s=this.disposeVar(w.createNextAnimateFrameEvent(A.heightChanged,A.extrudedHeightChanged,A.perPositionHeightChanged));this.dispose(s.disposableOn(n)),this.dispose(A.createdEvent.disposableOn(n))}};C(wr,"type",wr.register("ESUeViewer",p.ESGeoExtrudedPolygon.type,wr));let Xi=wr;const pr=class pr extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(pr,"type",pr.register("ESUeViewer",p.ESStaticMesh.type,pr));let Ji=pr;const Cr=class Cr extends rA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.d(A.startEvent.don(()=>{t.callUeFunc({f:"Start",p:{id:A.id}})})),this.d(A.clearEvent.don(()=>{t.callUeFunc({f:"Clear",p:{id:A.id}})}))}};C(Cr,"type",Cr.register("ESUeViewer",p.ESSkylineAnalysis.type,Cr));let zi=Cr;v.copyright=void 0;try{const r="earthsdk3-ue",A="3.3.0-beta.4",e="2025-08-09T09:17:14.000Z",t="北京西部世界科技有限公司",n="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="0726e990dfd959605c6040b45cc99223148fee71",o=((Date.now()-1754731034e3)/36e5).toFixed(1),a=`%c🌏 ${r}%c ${A}.${s.slice(0,8)}.${e} (距今${o}个小时)
|
|
112
|
+
.`+Zs+cw+Jc)},uw=function(r,A){var e=r.ownerDocument;if(e){var t=e.createElement("style");t.textContent=A,r.appendChild(t)}},zc=function(){function r(){}return r.getOrigin=function(A){var e=r._link;return e?(e.href=A,e.href=e.href,e.protocol+e.hostname+e.port):"about:blank"},r.isSameOrigin=function(A){return r.getOrigin(A)===r._origin},r.setContext=function(A){r._link=A.document.createElement("a"),r._origin=r.getOrigin(A.location.href)},r._origin="about:blank",r}(),hw=function(){function r(A,e){this.context=A,this._options=e,this._cache={}}return r.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)||(js(A)||ww(A))&&(this._cache[A]=this.loadImage(A)).catch(function(){}),e},r.prototype.match=function(A){return this._cache[A]},r.prototype.loadImage=function(A){return dA(this,void 0,void 0,function(){var e,t,n,s,i=this;return nA(this,function(o){switch(o.label){case 0:return e=zc.isSameOrigin(A),t=!qs(A)&&this._options.useCORS===!0&&eA.SUPPORT_CORS_IMAGES&&!e,n=!qs(A)&&!e&&!js(A)&&typeof this._options.proxy=="string"&&eA.SUPPORT_CORS_XHR&&!t,!e&&this._options.allowTaint===!1&&!qs(A)&&!js(A)&&!n&&!t?[2]:(s=A,n?[4,this.proxy(s)]:[3,2]);case 1:s=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise(function(a,l){var c=new Image;c.onload=function(){return a(c)},c.onerror=l,(pw(s)||t)&&(c.crossOrigin="anonymous"),c.src=s,c.complete===!0&&setTimeout(function(){return a(c)},500),i._options.imageTimeout>0&&setTimeout(function(){return l("Timed out ("+i._options.imageTimeout+"ms) loading image")},i._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},r.prototype.has=function(A){return typeof this._cache[A]<"u"},r.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},r.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var n=A.substring(0,256);return new Promise(function(s,i){var o=eA.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(a.status===200)if(o==="text")s(a.response);else{var h=new FileReader;h.addEventListener("load",function(){return s(h.result)},!1),h.addEventListener("error",function(d){return i(d)},!1),h.readAsDataURL(a.response)}else i("Failed to proxy resource "+n+" with status code "+a.status)},a.onerror=i;var l=t.indexOf("?")>-1?"&":"?";if(a.open("GET",""+t+l+"url="+encodeURIComponent(A)+"&responseType="+o),o!=="text"&&a instanceof XMLHttpRequest&&(a.responseType=o),e._options.imageTimeout){var c=e._options.imageTimeout;a.timeout=c,a.ontimeout=function(){return i("Timed out ("+c+"ms) proxying "+n)}}a.send()})},r}(),gw=/^data:image\/svg\+xml/i,Bw=/^data:image\/.*;base64,/i,fw=/^data:image\/.*/i,ww=function(r){return eA.SUPPORT_SVG_DRAWING||!Cw(r)},qs=function(r){return fw.test(r)},pw=function(r){return Bw.test(r)},js=function(r){return r.substr(0,4)==="blob"},Cw=function(r){return r.substr(-3).toLowerCase()==="svg"||gw.test(r)},S=function(){function r(A,e){this.type=0,this.x=A,this.y=e}return r.prototype.add=function(A,e){return new r(this.x+A,this.y+e)},r}(),Ie=function(r,A,e){return new S(r.x+(A.x-r.x)*e,r.y+(A.y-r.y)*e)},Bn=function(){function r(A,e,t,n){this.type=1,this.start=A,this.startControl=e,this.endControl=t,this.end=n}return r.prototype.subdivide=function(A,e){var t=Ie(this.start,this.startControl,A),n=Ie(this.startControl,this.endControl,A),s=Ie(this.endControl,this.end,A),i=Ie(t,n,A),o=Ie(n,s,A),a=Ie(i,o,A);return e?new r(this.start,t,i,a):new r(a,o,s,this.end)},r.prototype.add=function(A,e){return new r(this.start.add(A,e),this.startControl.add(A,e),this.endControl.add(A,e),this.end.add(A,e))},r.prototype.reverse=function(){return new r(this.end,this.endControl,this.startControl,this.start)},r}(),CA=function(r){return r.type===1},vw=function(){function r(A){var e=A.styles,t=A.bounds,n=st(e.borderTopLeftRadius,t.width,t.height),s=n[0],i=n[1],o=st(e.borderTopRightRadius,t.width,t.height),a=o[0],l=o[1],c=st(e.borderBottomRightRadius,t.width,t.height),h=c[0],d=c[1],B=st(e.borderBottomLeftRadius,t.width,t.height),g=B[0],f=B[1],m=[];m.push((s+a)/t.width),m.push((g+h)/t.width),m.push((i+f)/t.height),m.push((l+d)/t.height);var F=Math.max.apply(Math,m);F>1&&(s/=F,i/=F,a/=F,l/=F,h/=F,d/=F,g/=F,f/=F);var Q=t.width-a,y=t.height-d,L=t.width-h,T=t.height-f,E=e.borderTopWidth,R=e.borderRightWidth,K=e.borderBottomWidth,b=e.borderLeftWidth,W=_(e.paddingTop,A.bounds.width),iA=_(e.paddingRight,A.bounds.width),uA=_(e.paddingBottom,A.bounds.width),G=_(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=s>0||i>0?O(t.left+b/3,t.top+E/3,s-b/3,i-E/3,k.TOP_LEFT):new S(t.left+b/3,t.top+E/3),this.topRightBorderDoubleOuterBox=s>0||i>0?O(t.left+Q,t.top+E/3,a-R/3,l-E/3,k.TOP_RIGHT):new S(t.left+t.width-R/3,t.top+E/3),this.bottomRightBorderDoubleOuterBox=h>0||d>0?O(t.left+L,t.top+y,h-R/3,d-K/3,k.BOTTOM_RIGHT):new S(t.left+t.width-R/3,t.top+t.height-K/3),this.bottomLeftBorderDoubleOuterBox=g>0||f>0?O(t.left+b/3,t.top+T,g-b/3,f-K/3,k.BOTTOM_LEFT):new S(t.left+b/3,t.top+t.height-K/3),this.topLeftBorderDoubleInnerBox=s>0||i>0?O(t.left+b*2/3,t.top+E*2/3,s-b*2/3,i-E*2/3,k.TOP_LEFT):new S(t.left+b*2/3,t.top+E*2/3),this.topRightBorderDoubleInnerBox=s>0||i>0?O(t.left+Q,t.top+E*2/3,a-R*2/3,l-E*2/3,k.TOP_RIGHT):new S(t.left+t.width-R*2/3,t.top+E*2/3),this.bottomRightBorderDoubleInnerBox=h>0||d>0?O(t.left+L,t.top+y,h-R*2/3,d-K*2/3,k.BOTTOM_RIGHT):new S(t.left+t.width-R*2/3,t.top+t.height-K*2/3),this.bottomLeftBorderDoubleInnerBox=g>0||f>0?O(t.left+b*2/3,t.top+T,g-b*2/3,f-K*2/3,k.BOTTOM_LEFT):new S(t.left+b*2/3,t.top+t.height-K*2/3),this.topLeftBorderStroke=s>0||i>0?O(t.left+b/2,t.top+E/2,s-b/2,i-E/2,k.TOP_LEFT):new S(t.left+b/2,t.top+E/2),this.topRightBorderStroke=s>0||i>0?O(t.left+Q,t.top+E/2,a-R/2,l-E/2,k.TOP_RIGHT):new S(t.left+t.width-R/2,t.top+E/2),this.bottomRightBorderStroke=h>0||d>0?O(t.left+L,t.top+y,h-R/2,d-K/2,k.BOTTOM_RIGHT):new S(t.left+t.width-R/2,t.top+t.height-K/2),this.bottomLeftBorderStroke=g>0||f>0?O(t.left+b/2,t.top+T,g-b/2,f-K/2,k.BOTTOM_LEFT):new S(t.left+b/2,t.top+t.height-K/2),this.topLeftBorderBox=s>0||i>0?O(t.left,t.top,s,i,k.TOP_LEFT):new S(t.left,t.top),this.topRightBorderBox=a>0||l>0?O(t.left+Q,t.top,a,l,k.TOP_RIGHT):new S(t.left+t.width,t.top),this.bottomRightBorderBox=h>0||d>0?O(t.left+L,t.top+y,h,d,k.BOTTOM_RIGHT):new S(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=g>0||f>0?O(t.left,t.top+T,g,f,k.BOTTOM_LEFT):new S(t.left,t.top+t.height),this.topLeftPaddingBox=s>0||i>0?O(t.left+b,t.top+E,Math.max(0,s-b),Math.max(0,i-E),k.TOP_LEFT):new S(t.left+b,t.top+E),this.topRightPaddingBox=a>0||l>0?O(t.left+Math.min(Q,t.width-R),t.top+E,Q>t.width+R?0:Math.max(0,a-R),Math.max(0,l-E),k.TOP_RIGHT):new S(t.left+t.width-R,t.top+E),this.bottomRightPaddingBox=h>0||d>0?O(t.left+Math.min(L,t.width-b),t.top+Math.min(y,t.height-K),Math.max(0,h-R),Math.max(0,d-K),k.BOTTOM_RIGHT):new S(t.left+t.width-R,t.top+t.height-K),this.bottomLeftPaddingBox=g>0||f>0?O(t.left+b,t.top+Math.min(T,t.height-K),Math.max(0,g-b),Math.max(0,f-K),k.BOTTOM_LEFT):new S(t.left+b,t.top+t.height-K),this.topLeftContentBox=s>0||i>0?O(t.left+b+G,t.top+E+W,Math.max(0,s-(b+G)),Math.max(0,i-(E+W)),k.TOP_LEFT):new S(t.left+b+G,t.top+E+W),this.topRightContentBox=a>0||l>0?O(t.left+Math.min(Q,t.width+b+G),t.top+E+W,Q>t.width+b+G?0:a-b+G,l-(E+W),k.TOP_RIGHT):new S(t.left+t.width-(R+iA),t.top+E+W),this.bottomRightContentBox=h>0||d>0?O(t.left+Math.min(L,t.width-(b+G)),t.top+Math.min(y,t.height+E+W),Math.max(0,h-(R+iA)),d-(K+uA),k.BOTTOM_RIGHT):new S(t.left+t.width-(R+iA),t.top+t.height-(K+uA)),this.bottomLeftContentBox=g>0||f>0?O(t.left+b+G,t.top+T,Math.max(0,g-(b+G)),f-(K+uA),k.BOTTOM_LEFT):new S(t.left+b+G,t.top+t.height-(K+uA))}return r}(),k;(function(r){r[r.TOP_LEFT=0]="TOP_LEFT",r[r.TOP_RIGHT=1]="TOP_RIGHT",r[r.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",r[r.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(k||(k={}));var O=function(r,A,e,t,n){var s=4*((Math.sqrt(2)-1)/3),i=e*s,o=t*s,a=r+e,l=A+t;switch(n){case k.TOP_LEFT:return new Bn(new S(r,l),new S(r,l-o),new S(a-i,A),new S(a,A));case k.TOP_RIGHT:return new Bn(new S(r,A),new S(r+i,A),new S(a,l-o),new S(a,l));case k.BOTTOM_RIGHT:return new Bn(new S(a,A),new S(a,A+o),new S(r+i,l),new S(r,l));case k.BOTTOM_LEFT:default:return new Bn(new S(a,l),new S(a-i,l),new S(r,A+o),new S(r,A))}},fn=function(r){return[r.topLeftBorderBox,r.topRightBorderBox,r.bottomRightBorderBox,r.bottomLeftBorderBox]},mw=function(r){return[r.topLeftContentBox,r.topRightContentBox,r.bottomRightContentBox,r.bottomLeftContentBox]},wn=function(r){return[r.topLeftPaddingBox,r.topRightPaddingBox,r.bottomRightPaddingBox,r.bottomLeftPaddingBox]},Fw=function(){function r(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6}return r}(),pn=function(){function r(A,e){this.path=A,this.target=e,this.type=1}return r}(),Qw=function(){function r(A){this.opacity=A,this.type=2,this.target=6}return r}(),Uw=function(r){return r.type===0},Yc=function(r){return r.type===1},Ew=function(r){return r.type===2},$c=function(r,A){return r.length===A.length?r.some(function(e,t){return e===A[t]}):!1},yw=function(r,A,e,t,n){return r.map(function(s,i){switch(i){case 0:return s.add(A,e);case 1:return s.add(A+t,e);case 2:return s.add(A+t,e+n);case 3:return s.add(A,e+n)}return s})},Zc=function(){function r(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return r}(),qc=function(){function r(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new vw(this.container),this.container.styles.opacity<1&&this.effects.push(new Qw(this.container.styles.opacity)),this.container.styles.transform!==null){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,s=this.container.styles.transform;this.effects.push(new Fw(t,n,s))}if(this.container.styles.overflowX!==0){var i=fn(this.curves),o=wn(this.curves);$c(i,o)?this.effects.push(new pn(i,6)):(this.effects.push(new pn(i,2)),this.effects.push(new pn(o,4)))}}return r.prototype.getEffects=function(A){for(var e=[2,3].indexOf(this.container.styles.position)===-1,t=this.parent,n=this.effects.slice(0);t;){var s=t.effects.filter(function(a){return!Yc(a)});if(e||t.container.styles.position!==0||!t.parent){if(n.unshift.apply(n,s),e=[2,3].indexOf(t.container.styles.position)===-1,t.container.styles.overflowX!==0){var i=fn(t.curves),o=wn(t.curves);$c(i,o)||n.unshift(new pn(o,6))}}else n.unshift.apply(n,s);t=t.parent}return n.filter(function(a){return Z(a.target,A)})},r}(),Ai=function(r,A,e,t){r.container.elements.forEach(function(n){var s=Z(n.flags,4),i=Z(n.flags,2),o=new qc(n,r);Z(n.styles.display,2048)&&t.push(o);var a=Z(n.flags,8)?[]:t;if(s||i){var l=s||n.styles.isPositioned()?e:A,c=new Zc(o);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var h=n.styles.zIndex.order;if(h<0){var d=0;l.negativeZIndex.some(function(g,f){return h>g.element.container.styles.zIndex.order?(d=f,!1):d>0}),l.negativeZIndex.splice(d,0,c)}else if(h>0){var B=0;l.positiveZIndex.some(function(g,f){return h>=g.element.container.styles.zIndex.order?(B=f+1,!1):B>0}),l.positiveZIndex.splice(B,0,c)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else n.styles.isFloating()?l.nonPositionedFloats.push(c):l.nonPositionedInlineLevel.push(c);Ai(o,c,s?c:e,a)}else n.styles.isInlineLevel()?A.inlineLevel.push(o):A.nonInlineLevel.push(o),Ai(o,A,e,a);Z(n.flags,8)&&jc(n,a)})},jc=function(r,A){for(var e=r instanceof Vs?r.start:1,t=r instanceof Vs?r.reversed:!1,n=0;n<A.length;n++){var s=A[n];s.container instanceof Uc&&typeof s.container.value=="number"&&s.container.value!==0&&(e=s.container.value),s.listValue=dt(e,s.container.styles.listStyleType,!0),e+=t?-1:1}},Sw=function(r){var A=new qc(r,null),e=new Zc(A),t=[];return Ai(A,e,e,t),jc(A.container,t),e},Ad=function(r,A){switch(A){case 0:return vA(r.topLeftBorderBox,r.topLeftPaddingBox,r.topRightBorderBox,r.topRightPaddingBox);case 1:return vA(r.topRightBorderBox,r.topRightPaddingBox,r.bottomRightBorderBox,r.bottomRightPaddingBox);case 2:return vA(r.bottomRightBorderBox,r.bottomRightPaddingBox,r.bottomLeftBorderBox,r.bottomLeftPaddingBox);case 3:default:return vA(r.bottomLeftBorderBox,r.bottomLeftPaddingBox,r.topLeftBorderBox,r.topLeftPaddingBox)}},Iw=function(r,A){switch(A){case 0:return vA(r.topLeftBorderBox,r.topLeftBorderDoubleOuterBox,r.topRightBorderBox,r.topRightBorderDoubleOuterBox);case 1:return vA(r.topRightBorderBox,r.topRightBorderDoubleOuterBox,r.bottomRightBorderBox,r.bottomRightBorderDoubleOuterBox);case 2:return vA(r.bottomRightBorderBox,r.bottomRightBorderDoubleOuterBox,r.bottomLeftBorderBox,r.bottomLeftBorderDoubleOuterBox);case 3:default:return vA(r.bottomLeftBorderBox,r.bottomLeftBorderDoubleOuterBox,r.topLeftBorderBox,r.topLeftBorderDoubleOuterBox)}},Tw=function(r,A){switch(A){case 0:return vA(r.topLeftBorderDoubleInnerBox,r.topLeftPaddingBox,r.topRightBorderDoubleInnerBox,r.topRightPaddingBox);case 1:return vA(r.topRightBorderDoubleInnerBox,r.topRightPaddingBox,r.bottomRightBorderDoubleInnerBox,r.bottomRightPaddingBox);case 2:return vA(r.bottomRightBorderDoubleInnerBox,r.bottomRightPaddingBox,r.bottomLeftBorderDoubleInnerBox,r.bottomLeftPaddingBox);case 3:default:return vA(r.bottomLeftBorderDoubleInnerBox,r.bottomLeftPaddingBox,r.topLeftBorderDoubleInnerBox,r.topLeftPaddingBox)}},Hw=function(r,A){switch(A){case 0:return Cn(r.topLeftBorderStroke,r.topRightBorderStroke);case 1:return Cn(r.topRightBorderStroke,r.bottomRightBorderStroke);case 2:return Cn(r.bottomRightBorderStroke,r.bottomLeftBorderStroke);case 3:default:return Cn(r.bottomLeftBorderStroke,r.topLeftBorderStroke)}},Cn=function(r,A){var e=[];return CA(r)?e.push(r.subdivide(.5,!1)):e.push(r),CA(A)?e.push(A.subdivide(.5,!0)):e.push(A),e},vA=function(r,A,e,t){var n=[];return CA(r)?n.push(r.subdivide(.5,!1)):n.push(r),CA(e)?n.push(e.subdivide(.5,!0)):n.push(e),CA(t)?n.push(t.subdivide(.5,!0).reverse()):n.push(t),CA(A)?n.push(A.subdivide(.5,!1).reverse()):n.push(A),n},ed=function(r){var A=r.bounds,e=r.styles;return A.add(e.borderLeftWidth,e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth),-(e.borderTopWidth+e.borderBottomWidth))},vn=function(r){var A=r.styles,e=r.bounds,t=_(A.paddingLeft,e.width),n=_(A.paddingRight,e.width),s=_(A.paddingTop,e.width),i=_(A.paddingBottom,e.width);return e.add(t+A.borderLeftWidth,s+A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth+t+n),-(A.borderTopWidth+A.borderBottomWidth+s+i))},Lw=function(r,A){return r===0?A.bounds:r===2?vn(A):ed(A)},Mw=function(r,A){return r===0?A.bounds:r===2?vn(A):ed(A)},ei=function(r,A,e){var t=Lw(He(r.styles.backgroundOrigin,A),r),n=Mw(He(r.styles.backgroundClip,A),r),s=bw(He(r.styles.backgroundSize,A),e,t),i=s[0],o=s[1],a=st(He(r.styles.backgroundPosition,A),t.width-i,t.height-o),l=Dw(He(r.styles.backgroundRepeat,A),a,s,t,n),c=Math.round(t.left+a[0]),h=Math.round(t.top+a[1]);return[l,c,h,i,o]},Te=function(r){return N(r)&&r.value===Ue.AUTO},mn=function(r){return typeof r=="number"},bw=function(r,A,e){var t=A[0],n=A[1],s=A[2],i=r[0],o=r[1];if(!i)return[0,0];if(Y(i)&&o&&Y(o))return[_(i,e.width),_(o,e.height)];var a=mn(s);if(N(i)&&(i.value===Ue.CONTAIN||i.value===Ue.COVER)){if(mn(s)){var l=e.width/e.height;return l<s!=(i.value===Ue.COVER)?[e.width,e.width/s]:[e.height*s,e.height]}return[e.width,e.height]}var c=mn(t),h=mn(n),d=c||h;if(Te(i)&&(!o||Te(o))){if(c&&h)return[t,n];if(!a&&!d)return[e.width,e.height];if(d&&a){var B=c?t:n*s,g=h?n:t/s;return[B,g]}var f=c?t:e.width,m=h?n:e.height;return[f,m]}if(a){var F=0,Q=0;return Y(i)?F=_(i,e.width):Y(o)&&(Q=_(o,e.height)),Te(i)?F=Q*s:(!o||Te(o))&&(Q=F/s),[F,Q]}var y=null,L=null;if(Y(i)?y=_(i,e.width):o&&Y(o)&&(L=_(o,e.height)),y!==null&&(!o||Te(o))&&(L=c&&h?y/t*n:e.height),L!==null&&Te(i)&&(y=c&&h?L/n*t:e.width),y!==null&&L!==null)return[y,L];throw new Error("Unable to calculate background-size for element")},He=function(r,A){var e=r[A];return typeof e>"u"?r[0]:e},Dw=function(r,A,e,t,n){var s=A[0],i=A[1],o=e[0],a=e[1];switch(r){case 2:return[new S(Math.round(t.left),Math.round(t.top+i)),new S(Math.round(t.left+t.width),Math.round(t.top+i)),new S(Math.round(t.left+t.width),Math.round(a+t.top+i)),new S(Math.round(t.left),Math.round(a+t.top+i))];case 3:return[new S(Math.round(t.left+s),Math.round(t.top)),new S(Math.round(t.left+s+o),Math.round(t.top)),new S(Math.round(t.left+s+o),Math.round(t.height+t.top)),new S(Math.round(t.left+s),Math.round(t.height+t.top))];case 1:return[new S(Math.round(t.left+s),Math.round(t.top+i)),new S(Math.round(t.left+s+o),Math.round(t.top+i)),new S(Math.round(t.left+s+o),Math.round(t.top+i+a)),new S(Math.round(t.left+s),Math.round(t.top+i+a))];default:return[new S(Math.round(n.left),Math.round(n.top)),new S(Math.round(n.left+n.width),Math.round(n.top)),new S(Math.round(n.left+n.width),Math.round(n.height+n.top)),new S(Math.round(n.left),Math.round(n.height+n.top))]}},Rw="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",td="Hidden Text",Pw=function(){function r(A){this._data={},this._document=A}return r.prototype.parseMetrics=function(A,e){var t=this._document.createElement("div"),n=this._document.createElement("img"),s=this._document.createElement("span"),i=this._document.body;t.style.visibility="hidden",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin="0",t.style.padding="0",t.style.whiteSpace="nowrap",i.appendChild(t),n.src=Rw,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",s.style.fontFamily=A,s.style.fontSize=e,s.style.margin="0",s.style.padding="0",s.appendChild(this._document.createTextNode(td)),t.appendChild(s),t.appendChild(n);var o=n.offsetTop-s.offsetTop+2;t.removeChild(s),t.appendChild(this._document.createTextNode(td)),t.style.lineHeight="normal",n.style.verticalAlign="super";var a=n.offsetTop-t.offsetTop+2;return i.removeChild(t),{baseline:o,middle:a}},r.prototype.getMetrics=function(A,e){var t=A+" "+e;return typeof this._data[t]>"u"&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]},r}(),rd=function(){function r(A,e){this.context=A,this.options=e}return r}(),Kw=1e4,xw=function(r){FA(A,r);function A(e,t){var n=r.call(this,e,t)||this;return n._activeEffects=[],n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),t.canvas||(n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width=t.width+"px",n.canvas.style.height=t.height+"px"),n.fontMetrics=new Pw(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+t.width+"x"+t.height+") with scale "+t.scale),n}return A.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach(function(n){return t.applyEffect(n)})},A.prototype.applyEffect=function(e){this.ctx.save(),Ew(e)&&(this.ctx.globalAlpha=e.opacity),Uw(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),Yc(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},A.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},A.prototype.renderStack=function(e){return dA(this,void 0,void 0,function(){var t;return nA(this,function(n){switch(n.label){case 0:return t=e.element.container.styles,t.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},A.prototype.renderNode=function(e){return dA(this,void 0,void 0,function(){return nA(this,function(t){switch(t.label){case 0:if(Z(e.container.flags,16))debugger;return e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},A.prototype.renderTextWithLetterSpacing=function(e,t,n){var s=this;if(t===0)this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+n);else{var i=_s(e.text);i.reduce(function(o,a){return s.ctx.fillText(a,o,e.bounds.top+n),o+s.ctx.measureText(a).width},e.bounds.left)}},A.prototype.createFontStyle=function(e){var t=e.fontVariant.filter(function(i){return i==="normal"||i==="small-caps"}).join(""),n=Vw(e.fontFamily).join(", "),s=nt(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,t,e.fontWeight,s,n].join(" "),n,s]},A.prototype.renderTextNode=function(e,t){return dA(this,void 0,void 0,function(){var n,s,i,o,a,l,c,h,d=this;return nA(this,function(B){return n=this.createFontStyle(t),s=n[0],i=n[1],o=n[2],this.ctx.font=s,this.ctx.direction=t.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(i,o),l=a.baseline,c=a.middle,h=t.paintOrder,e.textBounds.forEach(function(g){h.forEach(function(f){switch(f){case 0:d.ctx.fillStyle=q(t.color),d.renderTextWithLetterSpacing(g,t.letterSpacing,l);var m=t.textShadow;m.length&&g.text.trim().length&&(m.slice(0).reverse().forEach(function(F){d.ctx.shadowColor=q(F.color),d.ctx.shadowOffsetX=F.offsetX.number*d.options.scale,d.ctx.shadowOffsetY=F.offsetY.number*d.options.scale,d.ctx.shadowBlur=F.blur.number,d.renderTextWithLetterSpacing(g,t.letterSpacing,l)}),d.ctx.shadowColor="",d.ctx.shadowOffsetX=0,d.ctx.shadowOffsetY=0,d.ctx.shadowBlur=0),t.textDecorationLine.length&&(d.ctx.fillStyle=q(t.textDecorationColor||t.color),t.textDecorationLine.forEach(function(F){switch(F){case 1:d.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top+l),g.bounds.width,1);break;case 2:d.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top),g.bounds.width,1);break;case 3:d.ctx.fillRect(g.bounds.left,Math.ceil(g.bounds.top+c),g.bounds.width,1);break}}));break;case 1:t.webkitTextStrokeWidth&&g.text.trim().length&&(d.ctx.strokeStyle=q(t.webkitTextStrokeColor),d.ctx.lineWidth=t.webkitTextStrokeWidth,d.ctx.lineJoin=window.chrome?"miter":"round",d.ctx.strokeText(g.text,g.bounds.left,g.bounds.top+l)),d.ctx.strokeStyle="",d.ctx.lineWidth=0,d.ctx.lineJoin="miter";break}})}),[2]})})},A.prototype.renderReplacedElement=function(e,t,n){if(n&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var s=vn(e),i=wn(t);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,e.intrinsicWidth,e.intrinsicHeight,s.left,s.top,s.width,s.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(e){return dA(this,void 0,void 0,function(){var t,n,s,i,o,a,Q,Q,l,c,h,d,L,B,g,T,f,m,F,Q,y,L,T;return nA(this,function(E){switch(E.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,n=e.curves,s=t.styles,i=0,o=t.textNodes,E.label=1;case 1:return i<o.length?(a=o[i],[4,this.renderTextNode(a,s)]):[3,4];case 2:E.sent(),E.label=3;case 3:return i++,[3,1];case 4:if(!(t instanceof mc))return[3,8];E.label=5;case 5:return E.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return Q=E.sent(),this.renderReplacedElement(t,n,Q),[3,8];case 7:return E.sent(),this.context.logger.error("Error loading image "+t.src),[3,8];case 8:if(t instanceof Fc&&this.renderReplacedElement(t,n,t.canvas),!(t instanceof Qc))return[3,12];E.label=9;case 9:return E.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return Q=E.sent(),this.renderReplacedElement(t,n,Q),[3,12];case 11:return E.sent(),this.context.logger.error("Error loading svg "+t.svg.substring(0,255)),[3,12];case 12:return t instanceof Ic&&t.tree?(l=new A(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}),[4,l.render(t.tree)]):[3,14];case 13:c=E.sent(),t.width&&t.height&&this.ctx.drawImage(c,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),E.label=14;case 14:if(t instanceof Os&&(h=Math.min(t.bounds.width,t.bounds.height),t.type===ln?t.checked&&(this.ctx.save(),this.path([new S(t.bounds.left+h*.39363,t.bounds.top+h*.79),new S(t.bounds.left+h*.16,t.bounds.top+h*.5549),new S(t.bounds.left+h*.27347,t.bounds.top+h*.44071),new S(t.bounds.left+h*.39694,t.bounds.top+h*.5649),new S(t.bounds.left+h*.72983,t.bounds.top+h*.23),new S(t.bounds.left+h*.84,t.bounds.top+h*.34085),new S(t.bounds.left+h*.39363,t.bounds.top+h*.79)]),this.ctx.fillStyle=q(Ec),this.ctx.fill(),this.ctx.restore()):t.type===cn&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+h/2,t.bounds.top+h/2,h/4,0,Math.PI*2,!0),this.ctx.fillStyle=q(Ec),this.ctx.fill(),this.ctx.restore())),kw(t)&&t.value.length){switch(d=this.createFontStyle(s),L=d[0],B=d[1],g=this.fontMetrics.getMetrics(L,B).baseline,this.ctx.font=L,this.ctx.fillStyle=q(s.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Nw(t.styles.textAlign),T=vn(t),f=0,t.styles.textAlign){case 1:f+=T.width/2;break;case 2:f+=T.width;break}m=T.add(f,0,0,-T.height/2+1),this.ctx.save(),this.path([new S(T.left,T.top),new S(T.left+T.width,T.top),new S(T.left+T.width,T.top+T.height),new S(T.left,T.top+T.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new lt(t.value,m),s.letterSpacing,g),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!Z(t.styles.display,2048))return[3,20];if(t.styles.listStyleImage===null)return[3,19];if(F=t.styles.listStyleImage,F.type!==0)return[3,18];Q=void 0,y=F.url,E.label=15;case 15:return E.trys.push([15,17,,18]),[4,this.context.cache.match(y)];case 16:return Q=E.sent(),this.ctx.drawImage(Q,t.bounds.left-(Q.width+10),t.bounds.top),[3,18];case 17:return E.sent(),this.context.logger.error("Error loading list-style-image "+y),[3,18];case 18:return[3,20];case 19:e.listValue&&t.styles.listStyleType!==-1&&(L=this.createFontStyle(s)[0],this.ctx.font=L,this.ctx.fillStyle=q(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",T=new MA(t.bounds.left,t.bounds.top+_(t.styles.paddingTop,t.bounds.width),t.bounds.width,tc(s.lineHeight,s.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new lt(e.listValue,T),s.letterSpacing,tc(s.lineHeight,s.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),E.label=20;case 20:return[2]}})})},A.prototype.renderStackContent=function(e){return dA(this,void 0,void 0,function(){var t,n,F,s,i,F,o,a,F,l,c,F,h,d,F,B,g,F,f,m,F;return nA(this,function(Q){switch(Q.label){case 0:if(Z(e.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:Q.sent(),t=0,n=e.negativeZIndex,Q.label=2;case 2:return t<n.length?(F=n[t],[4,this.renderStack(F)]):[3,5];case 3:Q.sent(),Q.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:Q.sent(),s=0,i=e.nonInlineLevel,Q.label=7;case 7:return s<i.length?(F=i[s],[4,this.renderNode(F)]):[3,10];case 8:Q.sent(),Q.label=9;case 9:return s++,[3,7];case 10:o=0,a=e.nonPositionedFloats,Q.label=11;case 11:return o<a.length?(F=a[o],[4,this.renderStack(F)]):[3,14];case 12:Q.sent(),Q.label=13;case 13:return o++,[3,11];case 14:l=0,c=e.nonPositionedInlineLevel,Q.label=15;case 15:return l<c.length?(F=c[l],[4,this.renderStack(F)]):[3,18];case 16:Q.sent(),Q.label=17;case 17:return l++,[3,15];case 18:h=0,d=e.inlineLevel,Q.label=19;case 19:return h<d.length?(F=d[h],[4,this.renderNode(F)]):[3,22];case 20:Q.sent(),Q.label=21;case 21:return h++,[3,19];case 22:B=0,g=e.zeroOrAutoZIndexOrTransformedOrOpacity,Q.label=23;case 23:return B<g.length?(F=g[B],[4,this.renderStack(F)]):[3,26];case 24:Q.sent(),Q.label=25;case 25:return B++,[3,23];case 26:f=0,m=e.positiveZIndex,Q.label=27;case 27:return f<m.length?(F=m[f],[4,this.renderStack(F)]):[3,30];case 28:Q.sent(),Q.label=29;case 29:return f++,[3,27];case 30:return[2]}})})},A.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},A.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},A.prototype.formatPath=function(e){var t=this;e.forEach(function(n,s){var i=CA(n)?n.start:n;s===0?t.ctx.moveTo(i.x,i.y):t.ctx.lineTo(i.x,i.y),CA(n)&&t.ctx.bezierCurveTo(n.startControl.x,n.startControl.y,n.endControl.x,n.endControl.y,n.end.x,n.end.y)})},A.prototype.renderRepeat=function(e,t,n,s){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(n,s),this.ctx.fill(),this.ctx.translate(-n,-s)},A.prototype.resizeImage=function(e,t,n){var s;if(e.width===t&&e.height===n)return e;var i=(s=this.canvas.ownerDocument)!==null&&s!==void 0?s:document,o=i.createElement("canvas");o.width=Math.max(1,t),o.height=Math.max(1,n);var a=o.getContext("2d");return a.drawImage(e,0,0,e.width,e.height,0,0,t,n),o},A.prototype.renderBackgroundImage=function(e){return dA(this,void 0,void 0,function(){var t,n,s,i,o,a;return nA(this,function(l){switch(l.label){case 0:t=e.styles.backgroundImage.length-1,n=function(c){var h,d,B,W,gA,BA,G,tA,K,g,W,gA,BA,G,tA,f,m,F,Q,y,L,T,E,R,K,b,W,iA,uA,G,tA,zA,gA,BA,de,IA,YA,ue,he,PA,ge,KA;return nA(this,function(Ke){switch(Ke.label){case 0:if(c.type!==0)return[3,5];h=void 0,d=c.url,Ke.label=1;case 1:return Ke.trys.push([1,3,,4]),[4,s.context.cache.match(d)];case 2:return h=Ke.sent(),[3,4];case 3:return Ke.sent(),s.context.logger.error("Error loading background-image "+d),[3,4];case 4:return h&&(B=ei(e,t,[h.width,h.height,h.width/h.height]),W=B[0],gA=B[1],BA=B[2],G=B[3],tA=B[4],K=s.ctx.createPattern(s.resizeImage(h,G,tA),"repeat"),s.renderRepeat(W,K,gA,BA)),[3,6];case 5:Qg(c)?(g=ei(e,t,[null,null,null]),W=g[0],gA=g[1],BA=g[2],G=g[3],tA=g[4],f=pg(c.angle,G,tA),m=f[0],F=f[1],Q=f[2],y=f[3],L=f[4],T=document.createElement("canvas"),T.width=G,T.height=tA,E=T.getContext("2d"),R=E.createLinearGradient(F,y,Q,L),Wl(c.stops,m).forEach(function(vr){return R.addColorStop(vr.stop,q(vr.color))}),E.fillStyle=R,E.fillRect(0,0,G,tA),G>0&&tA>0&&(K=s.ctx.createPattern(T,"repeat"),s.renderRepeat(W,K,gA,BA))):Ug(c)&&(b=ei(e,t,[null,null,null]),W=b[0],iA=b[1],uA=b[2],G=b[3],tA=b[4],zA=c.position.length===0?[Ss]:c.position,gA=_(zA[0],G),BA=_(zA[zA.length-1],tA),de=Cg(c,gA,BA,G,tA),IA=de[0],YA=de[1],IA>0&&YA>0&&(ue=s.ctx.createRadialGradient(iA+gA,uA+BA,0,iA+gA,uA+BA,IA),Wl(c.stops,IA*2).forEach(function(vr){return ue.addColorStop(vr.stop,q(vr.color))}),s.path(W),s.ctx.fillStyle=ue,IA!==YA?(he=e.bounds.left+.5*e.bounds.width,PA=e.bounds.top+.5*e.bounds.height,ge=YA/IA,KA=1/ge,s.ctx.save(),s.ctx.translate(he,PA),s.ctx.transform(1,0,0,ge,0,0),s.ctx.translate(-he,-PA),s.ctx.fillRect(iA,KA*(uA-PA)+PA,G,tA*KA),s.ctx.restore()):s.ctx.fill())),Ke.label=6;case 6:return t--,[2]}})},s=this,i=0,o=e.styles.backgroundImage.slice(0).reverse(),l.label=1;case 1:return i<o.length?(a=o[i],[5,n(a)]):[3,4];case 2:l.sent(),l.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},A.prototype.renderSolidBorder=function(e,t,n){return dA(this,void 0,void 0,function(){return nA(this,function(s){return this.path(Ad(n,t)),this.ctx.fillStyle=q(e),this.ctx.fill(),[2]})})},A.prototype.renderDoubleBorder=function(e,t,n,s){return dA(this,void 0,void 0,function(){var i,o;return nA(this,function(a){switch(a.label){case 0:return t<3?[4,this.renderSolidBorder(e,n,s)]:[3,2];case 1:return a.sent(),[2];case 2:return i=Iw(s,n),this.path(i),this.ctx.fillStyle=q(e),this.ctx.fill(),o=Tw(s,n),this.path(o),this.ctx.fill(),[2]}})})},A.prototype.renderNodeBackgroundAndBorders=function(e){return dA(this,void 0,void 0,function(){var t,n,s,i,o,a,l,c,h=this;return nA(this,function(d){switch(d.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,n=!OA(t.backgroundColor)||t.backgroundImage.length,s=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],i=Gw(He(t.backgroundClip,0),e.curves),n||t.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),OA(t.backgroundColor)||(this.ctx.fillStyle=q(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:d.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(function(B){h.ctx.save();var g=fn(e.curves),f=B.inset?0:Kw,m=yw(g,-f+(B.inset?1:-1)*B.spread.number,(B.inset?1:-1)*B.spread.number,B.spread.number*(B.inset?-2:2),B.spread.number*(B.inset?-2:2));B.inset?(h.path(g),h.ctx.clip(),h.mask(m)):(h.mask(g),h.ctx.clip(),h.path(m)),h.ctx.shadowOffsetX=B.offsetX.number+f,h.ctx.shadowOffsetY=B.offsetY.number,h.ctx.shadowColor=q(B.color),h.ctx.shadowBlur=B.blur.number,h.ctx.fillStyle=B.inset?q(B.color):"rgba(0,0,0,1)",h.ctx.fill(),h.ctx.restore()}),d.label=2;case 2:o=0,a=0,l=s,d.label=3;case 3:return a<l.length?(c=l[a],c.style!==0&&!OA(c.color)&&c.width>0?c.style!==2?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,o,e.curves,2)]:[3,11]):[3,13];case 4:return d.sent(),[3,11];case 5:return c.style!==3?[3,7]:[4,this.renderDashedDottedBorder(c.color,c.width,o,e.curves,3)];case 6:return d.sent(),[3,11];case 7:return c.style!==4?[3,9]:[4,this.renderDoubleBorder(c.color,c.width,o,e.curves)];case 8:return d.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,o,e.curves)];case 10:d.sent(),d.label=11;case 11:o++,d.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},A.prototype.renderDashedDottedBorder=function(e,t,n,s,i){return dA(this,void 0,void 0,function(){var o,a,l,c,h,d,B,g,f,m,F,Q,y,L,T,E,T,E;return nA(this,function(R){return this.ctx.save(),o=Hw(s,n),a=Ad(s,n),i===2&&(this.path(a),this.ctx.clip()),CA(a[0])?(l=a[0].start.x,c=a[0].start.y):(l=a[0].x,c=a[0].y),CA(a[1])?(h=a[1].end.x,d=a[1].end.y):(h=a[1].x,d=a[1].y),n===0||n===2?B=Math.abs(l-h):B=Math.abs(c-d),this.ctx.beginPath(),i===3?this.formatPath(o):this.formatPath(a.slice(0,2)),g=t<3?t*3:t*2,f=t<3?t*2:t,i===3&&(g=t,f=t),m=!0,B<=g*2?m=!1:B<=g*2+f?(F=B/(2*g+f),g*=F,f*=F):(Q=Math.floor((B+f)/(g+f)),y=(B-Q*g)/(Q-1),L=(B-(Q+1)*g)/Q,f=L<=0||Math.abs(f-y)<Math.abs(f-L)?y:L),m&&(i===3?this.ctx.setLineDash([0,g+f]):this.ctx.setLineDash([g,f])),i===3?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=t*2+1.1,this.ctx.strokeStyle=q(e),this.ctx.stroke(),this.ctx.setLineDash([]),i===2&&(CA(a[0])&&(T=a[3],E=a[0],this.ctx.beginPath(),this.formatPath([new S(T.end.x,T.end.y),new S(E.start.x,E.start.y)]),this.ctx.stroke()),CA(a[1])&&(T=a[1],E=a[2],this.ctx.beginPath(),this.formatPath([new S(T.end.x,T.end.y),new S(E.start.x,E.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},A.prototype.render=function(e){return dA(this,void 0,void 0,function(){var t;return nA(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=q(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=Sw(e),[4,this.renderStack(t)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},A}(rd),kw=function(r){return r instanceof Sc||r instanceof yc?!0:r instanceof Os&&r.type!==cn&&r.type!==ln},Gw=function(r,A){switch(r){case 0:return fn(A);case 2:return mw(A);case 1:default:return wn(A)}},Nw=function(r){switch(r){case 1:return"center";case 2:return"right";case 0:default:return"left"}},_w=["-apple-system","system-ui"],Vw=function(r){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?r.filter(function(A){return _w.indexOf(A)===-1}):r},Ow=function(r){FA(A,r);function A(e,t){var n=r.call(this,e,t)||this;return n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=t,n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width=t.width+"px",n.canvas.style.height=t.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+t.width+"x"+t.height+" at "+t.x+","+t.y+") with scale "+t.scale),n}return A.prototype.render=function(e){return dA(this,void 0,void 0,function(){var t,n;return nA(this,function(s){switch(s.label){case 0:return t=Ns(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,Ww(t)];case 1:return n=s.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=q(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},A}(rd),Ww=function(r){return new Promise(function(A,e){var t=new Image;t.onload=function(){A(t)},t.onerror=e,t.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(r))})},Xw=function(){function r(A){var e=A.id,t=A.enabled;this.id=e,this.enabled=t,this.start=Date.now()}return r.prototype.debug=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,Ir([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},r.prototype.getTime=function(){return Date.now()-this.start},r.prototype.info=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,Ir([this.id,this.getTime()+"ms"],A))},r.prototype.warn=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,Ir([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},r.prototype.error=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,Ir([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},r.instances={},r}(),Jw=function(){function r(A,e){var t;this.windowBounds=e,this.instanceName="#"+r.instanceCount++,this.logger=new Xw({id:this.instanceName,enabled:A.logging}),this.cache=(t=A.cache)!==null&&t!==void 0?t:new hw(this,A)}return r.instanceCount=1,r}(),zw=function(r,A){return A===void 0&&(A={}),Yw(r,A)};typeof window<"u"&&zc.setContext(window);var Yw=function(r,A){return dA(void 0,void 0,void 0,function(){var e,t,n,s,i,o,a,l,c,h,d,B,g,f,m,F,Q,y,L,T,R,E,R,K,b,W,iA,uA,G,tA,zA,gA,BA,de,IA,YA,ue,he,PA,ge;return nA(this,function(KA){switch(KA.label){case 0:if(!r||typeof r!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(e=r.ownerDocument,!e)throw new Error("Element is not attached to a Document");if(t=e.defaultView,!t)throw new Error("Document is not attached to a Window");return n={allowTaint:(K=A.allowTaint)!==null&&K!==void 0?K:!1,imageTimeout:(b=A.imageTimeout)!==null&&b!==void 0?b:15e3,proxy:A.proxy,useCORS:(W=A.useCORS)!==null&&W!==void 0?W:!1},s=is({logging:(iA=A.logging)!==null&&iA!==void 0?iA:!0,cache:A.cache},n),i={windowWidth:(uA=A.windowWidth)!==null&&uA!==void 0?uA:t.innerWidth,windowHeight:(G=A.windowHeight)!==null&&G!==void 0?G:t.innerHeight,scrollX:(tA=A.scrollX)!==null&&tA!==void 0?tA:t.pageXOffset,scrollY:(zA=A.scrollY)!==null&&zA!==void 0?zA:t.pageYOffset},o=new MA(i.scrollX,i.scrollY,i.windowWidth,i.windowHeight),a=new Jw(s,o),l=(gA=A.foreignObjectRendering)!==null&&gA!==void 0?gA:!1,c={allowTaint:(BA=A.allowTaint)!==null&&BA!==void 0?BA:!1,onclone:A.onclone,ignoreElements:A.ignoreElements,inlineImages:l,copyStyles:l},a.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),h=new Xc(a,r,c),d=h.clonedReferenceElement,d?[4,h.toIFrame(e,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return B=KA.sent(),g=Xs(d)||$f(d)?Eu(d.ownerDocument):Tr(a,d),f=g.width,m=g.height,F=g.left,Q=g.top,y=$w(a,d,A.backgroundColor),L={canvas:A.canvas,backgroundColor:y,scale:(IA=(de=A.scale)!==null&&de!==void 0?de:t.devicePixelRatio)!==null&&IA!==void 0?IA:1,x:((YA=A.x)!==null&&YA!==void 0?YA:0)+F,y:((ue=A.y)!==null&&ue!==void 0?ue:0)+Q,width:(he=A.width)!==null&&he!==void 0?he:Math.ceil(f),height:(PA=A.height)!==null&&PA!==void 0?PA:Math.ceil(m)},l?(a.logger.debug("Document cloned, using foreign object rendering"),R=new Ow(a,L),[4,R.render(d)]):[3,3];case 2:return T=KA.sent(),[3,5];case 3:return a.logger.debug("Document cloned, element located at "+F+","+Q+" with size "+f+"x"+m+" using computed rendering"),a.logger.debug("Starting DOM parsing"),E=Hc(a,d),y===E.styles.backgroundColor&&(E.styles.backgroundColor=DA.TRANSPARENT),a.logger.debug("Starting renderer for element at "+L.x+","+L.y+" with size "+L.width+"x"+L.height),R=new xw(a,L),[4,R.render(E)];case 4:T=KA.sent(),KA.label=5;case 5:return(!((ge=A.removeContainer)!==null&&ge!==void 0)||ge)&&(Xc.destroy(B)||a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),a.logger.debug("Finished rendering"),[2,T]}})})},$w=function(r,A,e){var t=A.ownerDocument,n=t.documentElement?it(r,getComputedStyle(t.documentElement).backgroundColor):DA.TRANSPARENT,s=t.body?it(r,getComputedStyle(t.body).backgroundColor):DA.TRANSPARENT,i=typeof e=="string"?it(r,e):e===null?DA.TRANSPARENT:4294967295;return A===t.documentElement?OA(n)?OA(s)?i:s:n:i};const bt=class bt extends p.EngineObject{constructor(A,e){super(A,e),this.ad(new w.ObjResettingWithEvent(A.renderInUEChanged,()=>A.renderInUE?new sd(A,e):new nd(A,e)))}};C(bt,"type",bt.register("ESUeViewer",p.ESGeoDiv.type,bt));let ti=bt;class nd extends w.Destroyable{constructor(e,t){super();C(this,"_screenPosition",this.disposeVar(w.reactArrayWithUndefined(void 0)));const n=t.viewer;if(!n){console.warn("viewer is undefined!");return}const s=this.disposeVar(new p.ESTextLabel);s.parentID=e.id,e.mainClass=s,t.add(s),this.dispose(()=>t.delete(s)),s.show=!1,this.dispose(w.bind([s,"position"],[e,"position"])),this.dispose(w.bind([s,"rotation"],[e,"rotation"])),this.dispose(w.bind([s,"flyToParam"],[e,"flyToParam"])),this.dispose(w.bind([s,"flyInParam"],[e,"flyInParam"])),this.dispose(e.calcFlyToParamEvent.disposableOn(()=>{$A(n,s.id)})),this.dispose(e.calcFlyInParamEvent.disposableOn(async()=>{if(!t.actived)return;const a=await t.getCurrentCameraInfo();if(!a)return;const{position:l,rotation:c}=a;e.flyInParam={position:l,rotation:c,flyDuration:1}})),this.dispose(e.smoothMoveEvent.disposableOn((a,l)=>{_e(n,s.id,a,l)})),this.dispose(e.smoothMoveWithRotationEvent.disposableOn((a,l,c)=>{ke(n,s.id,a,l,c)})),this.dispose(e.smoothMoveOnGroundEvent.disposableOn((a,l,c,h)=>{Ge(n,s.id,a,l,h,c)})),this.dispose(e.smoothMoveWithRotationOnGroundEvent.disposableOn((a,l,c,h,d)=>{Ne(n,s.id,a,l,c,h,d)})),this.dispose(e.flyToEvent.disposableOn((a,l)=>{s.flyTo(a)})),this.dispose(e.flyInEvent.don(a=>{s.flyIn(a)}));const i=this._screenPosition,o=this.disposeVar(new p.ESCustomDiv);o.parentID=e.id,t.add(o),this.dispose(()=>t.delete(o)),this.dispose(w.bind([o,"allowPicking"],[e,"allowPicking"]));{const a=this.disposeVar(w.createAnimateFrame()),l=()=>{e.show?a.restart(void 0,async()=>{if(!e.position)return;const c=await t.lonLatAltToScreenPosition(e.position);if(!this.isDestroyed())if(!c)this._screenPosition.value=void 0;else{const[h,d]=c;h===-1&&d===-1?this._screenPosition.value=void 0:this._screenPosition.value=[h,d]}}):a.cancel()};l(),this.dispose(e.showChanged.disposableOn(l))}{const a=()=>class extends w.Destroyable{constructor(d,B,g){if(super(),this._subContainer=d,!g)return;if(!e.instanceClass)throw new Error("!sceneObject.instanceClass");const f=new w.PosFloatDiv,m=f.element;this._subContainer.appendChild(m),this.dispose(()=>this._subContainer.removeChild(m)),m.onclick=F=>{(e.allowPicking??!1)&&e.pickedEvent.emit(new p.ESJPickedResult({div:m,pointerEvent:F},e,void 0,void 0,void 0,[F.x,F.y]))};{const F=()=>{e.editing?m.children[0].style.pointerEvents="none":m.children[0].style.pointerEvents="all"};F(),this.d(e.editingChanged.don(F))}{const F=()=>{const y=e.show;i.value&&y?(f.show=!0,f.winPos=[...i.value]):(f.show=!1,f.winPos=[0,0])};F();const Q=this.disposeVar(w.createNextAnimateFrameEvent(e.showChanged,i.changed));this.dispose(Q.disposableOn(F))}{const F=()=>{const[Q,y]=e.anchor??p.ESGeoDiv.defaults.anchor;f.originRatioX=Q,f.originRatioY=y};F(),this.dispose(e.anchorChanged.disposableOn(F))}{const F=()=>{f.opacity=e.opacity??p.ESGeoDiv.defaults.opacity};F(),this.dispose(e.opacityChanged.disposableOn(F))}this.disposeVar(new e.instanceClass(f.contentDiv,e,g))}},l=()=>{try{e.instanceClass?o.instanceClass=a():o.instanceClass=void 0}catch(h){console.error(h)}};l();const c=this.dv(w.createNextAnimateFrameEvent(e.instanceClassChanged,e.opacityChanged,e.anchorChanged,e.editingChanged,e.showChanged,e.allowPickingChanged));this.d(c.don(l))}}get screenPosition(){return this._screenPosition.value}get screenPositionChanged(){return this._screenPosition.changed}set screenPosition(e){this._screenPosition.value=e}}class sd extends w.Destroyable{constructor(e,t){super();C(this,"_imageLabel");C(this,"_hasClassDivAndPos",{});this._imageLabel=this.dv(new p.ESImageLabel),this._imageLabel.isHoverZoom=!1,this._imageLabel.parentID=e.id;const n=t.viewer;if(!n){console.warn("viewer is undefined!");return}e.mainClass=this._imageLabel;const s=this._imageLabel;t.add(s),this.d(()=>t.delete(s));{const i=()=>{if(!n)return;if(!e.instanceClass)throw new Error("!sceneObject.instanceClass");const l=document.createElement("div"),c=this.dv(new e.instanceClass(l,e,t))._container;if(c.style.opacity=e.opacity.toString()??p.ESGeoDiv.defaults.opacity,c.style.position="fixed",c.style.zIndex="-1",c.style.top="0px",!document.body.contains(c)){document.body.appendChild(c);let d=c?c.querySelectorAll("*[class]"):[];for(let B=0;B<d.length;B++){const g=d[B];var h=g.getBoundingClientRect();this._hasClassDivAndPos[g.className]=[g.offsetLeft,g.offsetTop,g.offsetLeft+h.width,g.offsetTop+h.height]}}zw(c,{backgroundColor:null,allowTaint:!0,useCORS:!0,width:c.offsetWidth,height:c.offsetHeight,scale:1}).then(d=>{document.body.contains(c)&&document.body.removeChild(c),s.url=d.toDataURL(),s.show=e.show}).catch(()=>{document.body.contains(c)&&document.body.removeChild(c)})},o=()=>{try{e.instanceClass?i():(s.url="",s.show=!1)}catch(l){console.error(l)}};o();const a=this.dv(w.createNextAnimateFrameEvent(e.instanceClassChanged,e.opacityChanged));this.d(a.don(o))}{const i=()=>{s.show=e.show};s.show=!1,this.ad(e.showChanged.don(i))}this.d(w.track([s,"anchor"],[e,"anchor"])),this.d(w.bind([s,"position"],[e,"position"])),this.d(w.bind([s,"rotation"],[e,"rotation"])),this.d(w.bind([s,"flyToParam"],[e,"flyToParam"])),this.d(w.bind([s,"flyInParam"],[e,"flyInParam"])),this.d(w.bind([s,"allowPicking"],[e,"allowPicking"])),this.d(w.bind([s,"scale"],[e,"scale"])),this.d(w.track([s,"minVisibleDistance"],[e,"minVisibleDistance"])),this.d(w.track([s,"maxVisibleDistance"],[e,"maxVisibleDistance"])),this.ad(e.automaticLandingEvent.don(()=>{s.automaticLanding()})),this.d(t.widgetEvent.don(i=>{if(i.objId!==this._imageLabel.id)return;const{type:o,add:a}=i;if(o==="leftClick"&&a){const l=(a==null?void 0:a.classNames)??[],c=Object.keys(this._hasClassDivAndPos);for(let h=0;h<c.length;h++){const d=c[h];let B=this._hasClassDivAndPos[d];a&&a.mouseRelativePos&&a.mouseRelativePos[0]>=B[0]&&a.mouseRelativePos[0]<=B[2]&&a.mouseRelativePos[1]>=B[1]&&a.mouseRelativePos[1]<=B[3]&&l.push(d)}a.classNames=l}e.widgetEvent.emit({type:o,add:a})})),this.d(e.calcFlyToParamEvent.don(()=>{$A(n,s.id)})),this.d(e.calcFlyInParamEvent.don(()=>{const i=t.getCurrentCameraInfo();if(!i)return;const{position:o,rotation:a}=i;e.flyInParam={position:o,rotation:a,flyDuration:1}})),this.d(e.smoothMoveEvent.don((i,o)=>{_e(n,s.id,i,o)})),this.d(e.smoothMoveWithRotationEvent.don((i,o,a)=>{ke(n,s.id,i,o,a)})),this.d(e.smoothMoveOnGroundEvent.don((i,o,a,l)=>{Ge(n,s.id,i,o,l,a)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((i,o,a,l,c)=>{Ne(n,s.id,i,o,a,l,c)})),this.d(e.flyToEvent.don((i,o)=>{s.flyTo(i)})),this.d(e.flyInEvent.don(i=>{s.flyIn(i)}))}}const Dt=class Dt extends lA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.d(A.flyToFeatureIndexEvent.don((n,s)=>{t.callUeFunc({f:"flyToFeatureIndex",p:{id:A.id,index:n,duration:s}})})),this.d(A.flyToFeatureEvent.don((n,s,i)=>{t.callUeFunc({f:"flyToFeature",p:{id:A.id,key:n,value:s,duration:i}})}))}};C(Dt,"type",Dt.register("ESUeViewer",p.ESGeoJson.type,Dt));let ri=Dt;const Rt=class Rt extends rA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Rt,"type",Rt.register("ESUeViewer",p.ESGeoLineString.type,Rt));let Fn=Rt;const Pt=class Pt extends rA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Pt,"type",Pt.register("ESUeViewer",p.ESGeoRectangle.type,Pt));let ni=Pt;const Kt=class Kt extends cA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Kt,"type",Kt.register("ESUeViewer",p.ESGeoWater.type,Kt));let si=Kt;const oe=class oe extends x{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.d(A.setNodePositionEvent.don((n,s)=>{io(t,A.id,n,s)})),this.d(A.setNodeRotationEvent.don((n,s)=>{oo(t,A.id,n,s)})),this.d(A.setNodeScaleEvent.don((n,s)=>{ao(t,A.id,n,s)}))}};C(oe,"forceUeUpdateProps",[...x.forceUeUpdateProps,"url"]),C(oe,"propValFuncs",{...x.propValFuncs,url:A=>typeof A=="string"?p.ESSceneObject.context.getStrFromEnv(p.rpToap(A)):(A.url=p.ESSceneObject.context.getStrFromEnv(p.rpToap(A.url)),A),czmMaximumScale:null,czmMinimumPixelSize:null,czmNativeScale:null,czmColor:null}),C(oe,"type",oe.register("ESUeViewer",p.ESGltfModel.type,oe));let ii=oe;const xt=class xt extends rA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(xt,"type",xt.register("ESUeViewer",p.ESHeightMeasurement.type,xt));let oi=xt;const kt=class kt extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}const n=async(i,o,a,l)=>{const{viewer:c}=i;if(!c){console.error("AIMoveTo: ueViewer.viewer is undefined");return}const h=await c.callUeFunc({f:"AIMoveTo",p:{id:o,Destination:a,Time:l}});return h.error&&console.error("AIMoveTo:",h.error),h};this.d(A.aiMoveToEvent.don((i,o)=>{n(e,A.id,i,o)}));const s=async(i,o)=>{const{viewer:a}=i;if(!a){console.error("StopAIMove: ueViewer.viewer is undefined");return}const l=await a.callUeFunc({f:"StopAIMove",p:{id:o}});return l.error&&console.error("StopAIMove:",l.error),l};this.d(A.stopAIMoveEvent.don(()=>{s(e,A.id)}))}};C(kt,"type",kt.register("ESUeViewer",p.ESHuman.type,kt));let ai=kt;const ae=class ae extends UA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}A.anchor=[.5,1]}};C(ae,"type",ae.register("ESUeViewer",p.ESImageLabel.type,ae)),C(ae,"forceUeUpdateProps",[...UA.forceUeUpdateProps,"url"]),C(ae,"propValFuncs",{...UA.propValFuncs,url:A=>typeof A=="string"?p.ESSceneObject.context.getStrFromEnv(p.rpToap(A)):(A.url=p.ESSceneObject.context.getStrFromEnv(p.rpToap(A.url)),A)});let li=ae;const Gt=class Gt extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Gt,"type",Gt.register("ESUeViewer",p.ESLevelRuntimeModel.type,Gt));let ci=Gt;const Nt=class Nt extends Er{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Nt,"type",Nt.register("ESUeViewer",p.ESLocalCircle.type,Nt));let di=Nt;const _t=class _t extends lA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(_t,"type",_t.register("ESUeViewer",p.ESLocalPolygonZ.type,_t));let ui=_t;const Vt=class Vt extends Er{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Vt,"type",Vt.register("ESUeViewer",p.ESLocalRectangle.type,Vt));let hi=Vt;const Ot=class Ot extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Ot,"type",Ot.register("ESUeViewer",p.ESLocalSkyBox.type,Ot));let gi=Ot;const Wt=class Wt extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Wt,"type",Wt.register("ESUeViewer",p.ESLocationMeasurement.type,Wt));let Bi=Wt;const Xt=class Xt extends rA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Xt,"type",Xt.register("ESUeViewer",p.ESPipeFence.type,Xt));let fi=Xt;const Jt=class Jt extends Fn{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Jt,"type",Jt.register("ESUeViewer",p.ESPipeline.type,Jt));let wi=Jt;const zt=class zt extends yr{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.d(A.highlightFeatureEvent.don(n=>{const s=typeof n=="number"?n.toString():n;to(t,A.id,s)})),this.d(A.highlightFeatureAndFlyToEvent.don((n,s,i,o)=>{const a=typeof n=="number"?n.toString():n;ro(t,A.id,a,o??1)})),this.d(A.setLayerVisibleEvent.don((n,s)=>{let i="";typeof s!="string"?i=JSON.stringify(s):i=s,no(t,A.id,i)})),this.d(A.setLayerColorEvent.don((n,s)=>{let i="";typeof s!="string"?i=JSON.stringify(s):i=s,so(t,A.id,i)}))}};C(zt,"type",zt.register("ESUeViewer",p.ESPipeserTileset.type,zt));let pi=zt;const Yt=class Yt extends cA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Yt,"type",Yt.register("ESUeViewer",p.ESPit.type,Yt));let Ci=Yt;const $t=class $t extends UA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.ad(A.getInitialStyleEvent.don(async()=>{try{const n=await t.callUeFunc({f:"GetInitialStyle",p:{id:A.id}});n.error!=""&&console.error("getInitialStyleEvent:",n.error),A.initialStyle.value=structuredClone(n.re)}catch(n){console.error("getInitialStyleEvent:",n),A.initialStyle.value=void 0}}))}};C($t,"type",$t.register("ESUeViewer",p.ESPoi2D.type,$t));let vi=$t;const Zt=class Zt extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Zt,"type",Zt.register("ESUeViewer",p.ESPoi3D.type,Zt));let mi=Zt;const le=class le extends lA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(le,"type",le.register("ESUeViewer",p.ESPoiTileset.type,le)),C(le,"forceUeUpdateProps",[...lA.forceUeUpdateProps,"url"]),C(le,"propValFuncs",{...lA.propValFuncs,url:A=>typeof A=="string"?p.ESSceneObject.context.getStrFromEnv(A):(A.url=p.ESSceneObject.context.getStrFromEnv(A.url),A)});let Fi=le;const qt=class qt extends rA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(qt,"type",qt.register("ESUeViewer",p.ESPolygonFence.type,qt));let Qi=qt;const De=class De extends cA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(De,"type",De.register("ESUeViewer",p.ESPolygonFlattenedPlane.type,De)),C(De,"propValFuncs",{...cA.propValFuncs,targetID:A=>{if(!A)return"";const e=p.ESSceneObject.getSceneObject(A);return e?e.getMainClass().id:A}});let Ui=De;const jt=class jt extends cA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(jt,"type",jt.register("ESUeViewer",p.ESPolygonWithHole.type,jt));let Ei=jt;const Ar=class Ar extends jA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(()=>{A.ids=[]}),this.d(A.highlightInner3DtilesetEvent.don(n=>{n.highlight=!0})),this.d(A.removeHighlightInner3DtilesetEvent.don(n=>{n.highlight=!1}));{const n=o=>{o=o.toLocaleLowerCase();let a=[255,255,255,1];if(o.startsWith("#")){if(o.length===4){let l=parseInt(o[1]+o[1],16),c=parseInt(o[2]+o[2],16),h=parseInt(o[3]+o[3],16);a=[l,c,h,1]}else if(o.length===7){let l=parseInt(o.substring(1,3),16),c=parseInt(o.substring(3,5),16),h=parseInt(o.substring(5,7),16);a=[l,c,h,1]}}else if(o.startsWith("rgba")){let l=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/);if(l){let c=parseInt(l[1]),h=parseInt(l[2]),d=parseInt(l[3]),B=parseFloat(l[4]);a=[c,h,d,B]}}else if(o.startsWith("rgb")){let l=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);if(l){let c=parseInt(l[1]),h=parseInt(l[2]),d=parseInt(l[3]);a=[c,h,d,1]}}else console.error("color类型只能为#rrggbb、#rgb、rgba(r,g,b,a)、rgb(r,g,b)");return[a[0]/255,a[1]/255,a[2]/255,a[3]]},s=()=>{const o=A.layerConfig;if(!o)return;const a=[];o.forEach(l=>{o.filter(h=>h.dataset==l.dataset).length==1?a.push({condition:[{field:"dataset",op:"==",value:l.dataset}],color:n(l.value.color??"rgb(255,255,255)"),show:l.value.visible}):a.push({condition:[{field:"layer",op:"==",value:l.layer},{field:"dataset",op:"==",value:l.dataset}],color:n(l.value.color??"rgb(255,255,255)"),show:l.value.visible})}),A.setFeatureStyle(a)};s();const i=this.dv(w.createNextAnimateFrameEvent(A.layerConfigChanged,A.colorBlendModeChanged));this.d(i.don(()=>{s()}))}}};C(Ar,"type",Ar.register("ESUeViewer",p.ESRtsTileset.type,Ar));let yi=Ar;const er=class er extends lA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(A.addTreesEvent.don(n=>{p.addTreesCallFunc(e,A.id,n)})),this.d(A.removeAllTreesEvent.don(()=>{p.removeAllTreesCallFunc(e,A.id)})),this.d(A.updateTreeParamsEvent.don(n=>{p.updateTreeParamsCallFunc(e,A.id,n)})),this.d(A.cutDownTreesEvent.don((n,s)=>{p.cutDownTreesCallFunc(e,A.id,n,s)})),this.d(A.growthSimulationEvent.don((n,s,i)=>{p.growthSimulationCallFunc(e,A.id,n,s,i)}))}};C(er,"type",er.register("ESUeViewer",p.ESSeparateFoliage.type,er));let Si=er;const tr=class tr extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(tr,"type",tr.register("ESUeViewer",p.ESSubmergingAnalysis.type,tr));let Ii=tr;const rr=class rr extends cA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.d(A.startEvent.don(()=>{t.callUeFunc({f:"Start",p:{id:A.id}})})),this.d(A.stopEvent.don(()=>{t.callUeFunc({f:"Stop",p:{id:A.id}})}))}};C(rr,"type",rr.register("ESUeViewer",p.ESSunshineAnalysis.type,rr));let Ti=rr;const nr=class nr extends cA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.d(A.startEvent.don(()=>{t.callUeFunc({f:"Start",p:{id:A.id}})}))}};C(nr,"type",nr.register("ESUeViewer",p.ESSurfaceAreaMeasurement.type,nr));let Hi=nr;const sr=class sr extends UA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(sr,"type",sr.register("ESUeViewer",p.ESTextLabel.type,sr));let Li=sr;const Re=class Re extends UA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.d(A.callFunctionEvent.don(async(n,s)=>{const i=await yn(t,A.id,n,s);A.__callFunctionResultEvent.emit(i)}))}};C(Re,"type",Re.register("ESUeViewer",p.ESUEWidget.type,Re)),C(Re,"propValFuncs",{...UA.propValFuncs,info:A=>JSON.stringify(A??{})});let Mi=Re;const id=r=>{switch(r){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"未搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是场景原有的,而是新建的,无法绑定";case 4:return"搜索到ActorTag对应的Actor是地形或3DTileset,无法绑定";default:return"未知错误"}},Zw=r=>{switch(r){case 0:return"创建成功";case 1:return"未找到对应的资源,无法创建";case 2:return"Id与场景中现有的ActorTag重复,创建后可能出现问题,创建失败";default:return"未知错误"}},ir=class ir extends p.EngineObject{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn(`${A.id} UeESUnrealActor viewer is undefined!`);return}this.d(()=>{Un(t,A.id)});const n=async()=>{l()||await t.callUeFunc({f:"update",p:{id:A.id,name:A.name,show:A.show,rotation:A.rotation,flyToParam:A.flyToParam??p.ESVisualObject.defaults.flyToParam,flyInParam:A.flyInParam??p.ESVisualObject.defaults.flyInParam,highlight:A.highlight,collision:A.collision,scale:A.scale,minVisibleDistance:A.minVisibleDistance,maxVisibleDistance:A.maxVisibleDistance}})},s=this.dv(w.createNextAnimateFrameEvent(A.showChanged,A.nameChanged,A.rotationChanged,A.flyToParamChanged,A.flyInParamChanged,A.highlightChanged,A.collisionChanged,A.scaleChanged,A.minVisibleDistanceChanged,A.maxVisibleDistanceChanged));this.d(s.don(n)),this.d(A.flushEvent.don(()=>s.flush()));let i,o;const a=async()=>{l()||(await t.callUeFunc({f:"update",p:{id:A.id,position:A.position}}),(e.debug??!1)&&console.log(`updatePostion:${A.position},actorTag:${A.actorTag},actorClass:${A.actorClass}`))},l=()=>!i&&!o?(console.warn(`${A.id} 未绑定ActorTag或未创建ActorClass!`),!0):!1,c=async()=>{const{id:d}=A,B=await e.unBindActorByID(d);B&&B.error!==""&&console.warn(`${A.id} UeESUnrealActor UnBindActorByID: ${B.error}`),i=void 0;const g=await t.callUeFunc({f:"destroy",p:{id:d}});if(g&&g.error!==""){console.warn(`${A.id} UeESUnrealActor DestroyActorByID: ${g.error}`);return}o=void 0},h=this.dv(w.react({type:"ActorClass",actorClass:"default"}));{const d=this.dv(w.createNextAnimateFrameEvent(A.actorClassChanged,A.actorTagChanged)),B=async()=>{A.actorTag!==""?h.value={type:"ActorTag",actorTag:A.actorTag}:h.value={type:"ActorClass",actorClass:A.actorClass===""?"default":A.actorClass}};B(),this.d(d.don(B)),this.d(A.flushEvent.don(()=>d.flush()))}{const d=this.dv(w.createProcessingFromAsyncFunc(async g=>{if(await g.promise(c()),h.value.type==="ActorTag"){const{actorTag:f}=h.value;await g.promise(c());try{A.lastActorStatus="null";const m=await g.promise(e.bindActorByTag(A.id,f));if(!m)return;if(m.error!==""){console.warn(`${A.id} UeESUnrealActor BindActorByTag:${f},${m.error}`);return}if(m.re.type===0)A.lastActorStatus="bound",i=f;else if(m.re.type===1)A.lastActorStatus="bound",i=f,console.warn(`${A.id} UeESUnrealActor BindActorByTag:${f},${id(m.re.type)}`);else{i=void 0,console.warn(`${A.id} UeESUnrealActor BindActorByTag error:${f}, ${id(m.re.type)}`);return}}catch(m){console.warn(`${A.id} UeESUnrealActor BindActorByTag catch error:${f}, ${m}`);return}}else if(h.value.type==="ActorClass"){const{actorClass:f}=h.value;try{const m=await g.promise(e.createActorByClass(A.id,f));if(!m)return;if(m.error!==""){console.warn(`${A.id} UeESUnrealActor CreateActorByClass error :${f}, ${m.error}`);return}if(m.re.type===0)A.lastActorStatus="created",o=f;else{console.warn(`${A.id} UeESUnrealActor CreateActorByClass error type :${f},${Zw(m.re.type)}`);return}}catch(m){console.warn(`${A.id} UeESUnrealActor CreateActorByClass error catch :${f}, ${JSON.stringify(m)}`);return}}await g.promise(n()),await g.promise(a())})),B=async()=>{d.restart()};B(),this.d(h.changed.don(B))}this.d(A.positionChanged.don(a)),this.d(A.callFunctionEvent.don(async(d,B)=>{if(l()){A.__callFunctionResultEvent.emit(void 0);return}const g=await yn(t,A.id,d,B);A.__callFunctionResultEvent.emit(g)})),this.d(A.smoothMoveEvent.don((d,B)=>{l()||_e(t,A.id,d,B)})),this.d(A.smoothMoveWithRotationEvent.don((d,B,g)=>{l()||ke(t,A.id,d,B,g)})),this.d(A.smoothMoveOnGroundEvent.don((d,B,g,f)=>{l()||Ge(t,A.id,d,B,f,g)})),this.d(A.smoothMoveWithRotationOnGroundEvent.don((d,B,g,f,m)=>{l()||Ne(t,A.id,d,B,g,f,m)})),this.d(A.automaticLandingEvent.don(d=>{if(l())return;const B=[A.position[0],A.position[1]];e.getHeightByLonLat(A.position[0],A.position[1],"Visibility").then(g=>{g!==null&&(A.position=[...B,g],A.collision=d)})})),this.d(A.flyToEvent.don(async(d,B)=>{if(l())return;const g=await Be(t,A.id,d);let f="over";g===void 0?f="error":g.endType===0?f="over":g.endType===1&&(f="cancelled"),A.flyOverEvent.emit(B,f,e)})),this.d(A.calcFlyToParamEvent.don(()=>{l()||$A(t,A.id)})),this.d(A.calcFlyInParamEvent.don(async()=>{if(!e.actived)return;const d=await e.getCurrentCameraInfo();if(!d)return;const{position:B,rotation:g}=d;A.flyInParam={position:B,rotation:g,flyDuration:1}})),this.d(e.propChanged.don(d=>{l()||d.objId===A.id&&Object.keys(d.props).forEach(B=>{const g=d.props[B]===null?void 0:d.props[B];A[B]=g})}))}};C(ir,"type",ir.register("ESUeViewer",p.ESUnrealActor.type,ir));let bi=ir;const or=class or extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(or,"type",or.register("ESUeViewer",p.ESVideoFusion.type,or));let Di=or;const ar=class ar extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(ar,"type",ar.register("ESUeViewer",p.ESViewShed.type,ar));let Ri=ar;const lr=class lr extends rA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is underfined!");return}}};C(lr,"type",lr.register("ESUeViewer",p.ESVisibilityAnalysis.type,lr));let Pi=lr;const cr=class cr extends cA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.ad(w.track([A,"volume"],[A,"cutAndFillVolume"])),this.d(A.startEvent.don(()=>{t.callUeFunc({f:"Start",p:{id:A.id}})})),this.d(A.clearEvent.don(()=>{t.callUeFunc({f:"Clear",p:{id:A.id}})}))}};C(cr,"type",cr.register("ESUeViewer",p.ESVolumeMeasurement.type,cr));let Ki=cr;const Pe=class Pe extends UA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(Pe,"type",Pe.register("ESUeViewer",p.ESWidget.type,Pe)),C(Pe,"propValFuncs",{...UA.propValFuncs,info:A=>JSON.stringify(A??{})});let xi=Pe;const dr=class dr extends p.EngineObject{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}A.poi.actorTag=A.human.id,A.poi.positionOffset=[0,0,A.poiOffsetHeight-.8],this.d(A.poiOffsetHeightChanged.don(()=>{A.poi.positionOffset=[0,0,A.poiOffsetHeight-.8]})),this.d(()=>{A.poi.actorTag=""})}};C(dr,"type",dr.register("ESUeViewer",p.ESHumanPoi.type,dr));let ki=dr;p.ESSceneObject.context.getStrFromEnv(p.ESNavigator.defaults.imgUrl);const ur=class ur extends p.EngineObject{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new p.ESCustomDiv);e.add(n),this.dispose(()=>e.delete(n)),this.dispose(w.track([n,"show"],[A,"show"])),n.instanceClass=class extends w.Destroyable{constructor(i,o,a){super(),this._subContainer=i;const l=document.createElement("div");this._subContainer.appendChild(l),this.dispose(()=>this._subContainer.removeChild(l));{const d=async()=>{const B=await e.getCurrentCameraInfo(),g=B==null?void 0:B.position,m=[...B==null?void 0:B.rotation];m[0]=360,e.flyIn(g,m)};l.addEventListener("click",d),l.style.cursor="pointer",this.dispose(()=>l.removeEventListener("click",d))}{const d=()=>{l.style.width=`${A.cssSize?A.cssSize:p.ESNavigator.defaults.cssSize}px`,l.style.height=`${A.cssSize?A.cssSize:p.ESNavigator.defaults.cssSize}px`};d(),A.dispose(A.cssSizeChanged.disposableOn(d))}l.style.position="fixed";{const d=()=>{l.style.top=`${A.cssPosition?A.cssPosition[0]:p.ESNavigator.defaults.cssPosition[0]}px`,l.style.right=`${A.cssPosition?A.cssPosition[1]:p.ESNavigator.defaults.cssPosition[1]}px`};d(),A.dispose(A.cssPositionChanged.disposableOn(d))}l.style.transition=" right 0.4s linear",l.style.cursor="pointer";const c=document.createElement("div");l.appendChild(c),this.dispose(()=>l.removeChild(c)),c.style.width="100%",c.style.height="100%",c.style.position="relative";const h=document.createElement("img");c.appendChild(h),this.dispose(()=>c.removeChild(h)),h.style.width="100%",h.style.height="100%",h.style.border="none";{const d=()=>h.src=A.imgUrl;d(),A.dispose(A.imgUrlChanged.disposableOn(d))}{const d=()=>{const m=-e.getCurrentCameraInfo().rotation[0];h.style.transform=`rotate(${m}deg)`};let B;const g=async()=>{d(),A.show?(l.style.display="block",B=setInterval(()=>{d()},1e3)):(l.style.display="none",clearInterval(B))};this.dispose(A.showChanged.disposableOn(g)),g(),this.dispose(()=>clearInterval(B))}h.style.transformOrigin="50% 50%"}}}};C(ur,"type",ur.register("ESUeViewer",p.ESNavigator.type,ur));let Gi=ur;const ce=class ce extends rA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}{const n=()=>{let s=A.materialMode==="blue"?"multipleArrows":A.materialMode==="purple"?"singleArrow":A.materialMode;t.callUeFunc({f:"update",p:{id:A.id,materialMode:s}})};this.dispose(A.materialModeChanged.disposableOn(n)),this.dispose(A.createdEvent.disposableOn(n))}}};C(ce,"type",ce.register("ESUeViewer",p.ESPath.type,ce)),C(ce,"forceUeUpdateProps",[...rA.forceUeUpdateProps]),C(ce,"propValFuncs",{...rA.propValFuncs,materialMode:null});let Ni=ce;async function qw(r){navigator.clipboard.writeText(r).then(function(){console.log("复制成功")},function(A){console.log("复制失败")})}const hr=class hr extends p.EngineObject{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new p.ESCustomDiv);e.add(n),this.dispose(()=>e.delete(n)),n.instanceClass=class extends w.Destroyable{constructor(i,o,a){if(super(),this._subContainer=i,!a||!(a instanceof LA))return;const l=document.createElement("div");this._subContainer.appendChild(l),this.dispose(()=>this._subContainer.removeChild(l)),l.style.width="100%",l.style.position="absolute",l.style.height=`${p.ESViewerStatusBar.defaults.height}px`,l.style.left="0",l.style.bottom="0",l.style.color="#fff",l.style.padding="0 20px 0 0",l.style.boxSizing="border-box",l.style.lineHeight=`${p.ESViewerStatusBar.defaults.height}px`,l.style.zIndex="100",l.style.alignContent="center",l.style.justifyContent="space-between";const c=document.createElement("span");l.appendChild(c),this.dispose(()=>l.removeChild(c));const h=document.createElement("span");c.appendChild(h),this.dispose(()=>c.removeChild(h));const d=document.createElement("span");c.appendChild(d),d.addEventListener("dblclick",function(){let g=d.innerHTML;g.startsWith("鼠标位置")&&(g=g.slice(5)),qw(g)}),d.style.cursor="pointer",this.dispose(()=>c.removeChild(d));const B=document.createElement("span");l.appendChild(B),this.dispose(()=>l.removeChild(B));{const g=()=>{l.style.height=(A.height??p.ESViewerStatusBar.defaults.height)+"px",l.style.lineHeight=(A.height??p.ESViewerStatusBar.defaults.height)+"px"};this.dispose(A.heightChanged.disposableOn(g)),g()}{const g=()=>{l.style.fontSize=(A.fontSize??p.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(A.fontSizeChanged.disposableOn(g)),g()}{const g=()=>{A.bgColor?l.style.background=`rgba(${A.bgColor[0]*255},${A.bgColor[1]*255},${A.bgColor[2]*255},${A.bgColor[3]})`:l.style.background=`rgba(${p.ESViewerStatusBar.defaults.bgColor[0]},${p.ESViewerStatusBar.defaults.bgColor[1]},${p.ESViewerStatusBar.defaults.bgColor[2]},${p.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(A.bgColorChanged.disposableOn(g)),g()}a.getVersion().then(g=>{g&&(B.innerText=`Ue 版本 : ${g[0]} `)}).catch(g=>{console.log(g)});{const g=()=>{let F="",Q="";F+=`帧率:${a.getFPS().toFixed(0)}FPS`,h.innerText=F;const y=e.getCurrentCameraInfo();F+=` 经度: ${y.position[0].toFixed(5)}° 纬度: ${y.position[1].toFixed(5)}° 高度: ${y.position[2].toFixed(2)}米 偏航角: ${y.rotation[0].toFixed(2)}° 俯仰角: ${y.rotation[1].toFixed(2)}° 翻滚角:${y.rotation[2].toFixed(2)}° `,h.innerText=F,e.pick().then(L=>{if(L){const{pickResult:T}=L;if(T&&T.position){const{position:E}=T;Q+=`鼠标位置:${E[0].toFixed(5)}° ${E[1].toFixed(5)}° ${E[2].toFixed(2)}m`}else Q+="暂时无法获取鼠标位置...";d.innerText=Q}}).catch(L=>{console.log(L)})};let f;const m=async()=>{g(),A.show?(l.style.display="flex",f=setInterval(()=>{g()},1e3)):(l.style.display="none",clearInterval(f))};this.dispose(A.showChanged.disposableOn(m)),m(),this.dispose(()=>clearInterval(f))}}}}};C(hr,"type",hr.register("ESUeViewer",p.ESViewerStatusBar.type,hr));let _i=hr;const gr=class gr extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(gr,"type",gr.register("ESUeViewer",p.ESGaussianSplatting.type,gr));let Vi=gr;const Br=class Br extends jA{constructor(e,t){super(e,t);C(this,"_es3DTileset",this.dv(new p.ES3DTileset));if(!t.viewer){console.warn("viewer is undefined!");return}this.es3DTileset.parentID=e.id,e.mainClass=this._es3DTileset;{const s=this._es3DTileset;t.add(s),this.dispose(()=>t.delete(s)),this.d(w.track([s,"allowPicking"],[e,"allowPicking"])),this.d(w.track([s,"collision"],[e,"collision"])),this.d(w.bind([s,"flyToParam"],[e,"flyToParam"])),this.d(w.bind([s,"flyToParam"],[e,"flyToParam"])),this.d(w.track([s,"url"],[e,"url"])),this.d(w.track([s,"actorTag"],[e,"actorTag"])),this.d(w.track([s,"materialMode"],[e,"materialMode"])),this.d(w.track([s,"highlight"],[e,"highlight"])),this.d(w.track([s,"maximumScreenSpaceError"],[e,"maximumScreenSpaceError"])),this.d(w.track([s,"highlightID"],[e,"highlightID"])),this.d(w.track([s,"highlightColor"],[e,"highlightColor"])),this.d(w.bind([s,"offset"],[e,"offset"])),this.d(w.bind([s,"rotation"],[e,"rotation"])),this.d(w.track([s,"czmImageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(w.track([s,"czmLuminanceAtZenith"],[e,"czmLuminanceAtZenith"])),this.d(w.track([s,"czmMaximumMemoryUsage"],[e,"czmMaximumMemoryUsage"])),this.d(w.track([s,"czmClassificationType"],[e,"czmClassificationType"])),this.d(w.track([s,"czmStyleJson"],[e,"czmStyleJson"])),this.d(w.track([s,"czmBackFaceCulling"],[e,"czmBackFaceCulling"])),this.d(w.track([s,"czmDebugShowBoundingVolume"],[e,"czmDebugShowBoundingVolume"])),this.d(w.track([s,"czmDebugShowContentBoundingVolume"],[e,"czmDebugShowContentBoundingVolume"])),this.d(w.track([s,"colorBlendMode"],[e,"colorBlendMode"])),this.d(w.track([s,"cacheBytes"],[e,"cacheBytes"])),this.d(w.track([s,"clippingPlaneEnabled"],[e,"clippingPlaneEnabled"])),this.d(w.track([s,"unionClippingRegions"],[e,"unionClippingRegions"])),this.d(w.track([s,"clippingPlaneEdgeColor"],[e,"clippingPlaneEdgeColor"])),this.d(w.track([s,"clippingPlaneEdgeWidth"],[e,"clippingPlaneEdgeWidth"])),this.d(w.track([s,"materialParams"],[e,"materialParams"])),this.d(w.bind([s,"supportEdit"],[e,"supportEdit"])),this.d(w.bind([s,"clippingPlanesId"],[e,"clippingPlanesId"])),this.d(w.bind([s,"clippingPlaneIds"],[e,"clippingPlaneIds"])),this.d(w.bind([s,"flattenedPlaneId"],[e,"flattenedPlaneId"])),this.d(w.bind([s,"flattenedPlaneEnabled"],[e,"flattenedPlaneEnabled"])),this.d(w.bind([s,"clippingPlaneId"],[e,"clippingPlaneId"])),this.d(w.bind([s,"excavateId"],[e,"excavateId"]))}{const s=this._es3DTileset;this.d(e.refreshTilesetEvent.don(()=>{s.refreshTileset()})),this.d(e.highlightFeatureEvent.don((...i)=>{s.highlightFeature(...i)})),this.d(e.highlightFeatureAndFlyToEvent.don((...i)=>{s.highlightFeatureAndFlyTo(...i)})),this.d(e.setFeatureColorEvent.don((...i)=>{s.setFeatureColor(...i)})),this.d(e.setFeatureVisableEvent.don((...i)=>{s.setFeatureVisable(...i)})),this.d(e.resetFeatureStyleEvent.don((...i)=>{s.resetFeatureStyle(...i)})),this.d(e.flyInEvent.don((...i)=>{s.flyIn(i[0])})),this.d(e.flyToEvent.don((...i)=>{s.flyTo(i[0])})),this.d(e.calcFlyToParamEvent.don((...i)=>{s.calcFlyToParam(...i)})),this.d(e.calcFlyInParamEvent.don((...i)=>{s.calcFlyInParam(...i)}))}{const s=this._es3DTileset;this.d(s.tilesetReady.don(i=>{e.tilesetReady.emit(i)})),this.d(s.pickedEvent.don(i=>{i.assign({sceneObject:e}),e.pickedEvent.emit(i)}))}{const s=()=>{this.es3DTileset.show=e.show};s(),this.d(e.showChanged.don(()=>{s()}))}}get es3DTileset(){return this._es3DTileset}};C(Br,"type",Br.register("ESUeViewer",p.ESRtsFeatureEditing.type,Br));let Oi=Br;const fr=class fr extends jA{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(fr,"type",fr.register("ESUeViewer",p.ESMsTileset.type,fr));let Wi=fr;const wr=class wr extends cA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}const n=()=>{t.callUeFunc({f:"update",p:{id:A.id,height:A.height??p.ESGeoExtrudedPolygon.defaults.height,extrudedHeight:A.extrudedHeight??p.ESGeoExtrudedPolygon.defaults.extrudedHeight,perPositionHeight:A.perPositionHeight??p.ESGeoExtrudedPolygon.defaults.perPositionHeight}})},s=this.disposeVar(w.createNextAnimateFrameEvent(A.heightChanged,A.extrudedHeightChanged,A.perPositionHeightChanged));this.dispose(s.disposableOn(n)),this.dispose(A.createdEvent.disposableOn(n))}};C(wr,"type",wr.register("ESUeViewer",p.ESGeoExtrudedPolygon.type,wr));let Xi=wr;const pr=class pr extends x{constructor(A,e){if(super(A,e),!e.viewer){console.warn("viewer is undefined!");return}}};C(pr,"type",pr.register("ESUeViewer",p.ESStaticMesh.type,pr));let Ji=pr;const Cr=class Cr extends rA{constructor(A,e){super(A,e);const t=e.viewer;if(!t){console.warn("viewer is undefined!");return}this.d(A.startEvent.don(()=>{t.callUeFunc({f:"Start",p:{id:A.id}})})),this.d(A.clearEvent.don(()=>{t.callUeFunc({f:"Clear",p:{id:A.id}})}))}};C(Cr,"type",Cr.register("ESUeViewer",p.ESSkylineAnalysis.type,Cr));let zi=Cr;v.copyright=void 0;try{const r="earthsdk3-ue",A="3.3.0-beta.5",e="2025-08-14T08:49:41.000Z",t="北京西部世界科技有限公司",n="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="fbf4f07cc531ea3f7d62e09ae00a40a1e105c3c8",o=((Date.now()-1755161381e3)/36e5).toFixed(1),a=`%c🌏 ${r}%c ${A}.${s.slice(0,8)}.${e} (距今${o}个小时)
|
|
113
113
|
%c${n?n+`
|
|
114
114
|
`:""}当前网站正在使用${r},此软件版权归${t}所有
|
|
115
|
-
`;v.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
115
|
+
`;v.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","fbf4f07cc531ea3f7d62e09ae00a40a1e105c3c8")},get info(){return a},get date(){return"2025-08-14T08:49:41.000Z"},get author(){return"suplyang"},get version(){return"3.3.0-beta.5"},get name(){return"earthsdk3-ue"},get commitId(){return"fbf4f07cc531ea3f7d62e09ae00a40a1e105c3c8"},print(l=!1){!l&&window._xe2_no_copy_print||console.info(this.info,`
|
|
116
116
|
font-size: 18px;
|
|
117
117
|
font-weight: 1000;
|
|
118
118
|
line-height: 1;
|
package/dist/earthsdk3-ue.js
CHANGED
|
@@ -5251,7 +5251,7 @@ const we = class we extends D {
|
|
|
5251
5251
|
p(we, "type", we.register("ESUeViewer", Hn.type, we));
|
|
5252
5252
|
let dr = we, $e;
|
|
5253
5253
|
try {
|
|
5254
|
-
const c = "earthsdk3-ue", e = "3.3.0-beta.
|
|
5254
|
+
const c = "earthsdk3-ue", e = "3.3.0-beta.5", t = "2025-08-14T08:49:41.000Z", i = "北京西部世界科技有限公司", r = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", n = "fbf4f07cc531ea3f7d62e09ae00a40a1e105c3c8", o = ((Date.now() - 1755161381e3) / 36e5).toFixed(1), l = `%c🌏 ${c}%c ${e}.${n.slice(0, 8)}.${t} (距今${o}个小时)
|
|
5255
5255
|
%c${r ? r + `
|
|
5256
5256
|
` : ""}当前网站正在使用${c},此软件版权归${i}所有
|
|
5257
5257
|
`;
|
|
@@ -5265,7 +5265,7 @@ try {
|
|
|
5265
5265
|
},
|
|
5266
5266
|
// @ts-ignore
|
|
5267
5267
|
get gituri() {
|
|
5268
|
-
return GITURI_ && GITURI_.replace("${commitId}", "
|
|
5268
|
+
return GITURI_ && GITURI_.replace("${commitId}", "fbf4f07cc531ea3f7d62e09ae00a40a1e105c3c8");
|
|
5269
5269
|
},
|
|
5270
5270
|
// @ts-ignore
|
|
5271
5271
|
get info() {
|
|
@@ -5273,7 +5273,7 @@ try {
|
|
|
5273
5273
|
},
|
|
5274
5274
|
// @ts-ignore
|
|
5275
5275
|
get date() {
|
|
5276
|
-
return "2025-08-
|
|
5276
|
+
return "2025-08-14T08:49:41.000Z";
|
|
5277
5277
|
},
|
|
5278
5278
|
// @ts-ignore
|
|
5279
5279
|
get author() {
|
|
@@ -5281,7 +5281,7 @@ try {
|
|
|
5281
5281
|
},
|
|
5282
5282
|
// @ts-ignore
|
|
5283
5283
|
get version() {
|
|
5284
|
-
return "3.3.0-beta.
|
|
5284
|
+
return "3.3.0-beta.5";
|
|
5285
5285
|
},
|
|
5286
5286
|
// @ts-ignore
|
|
5287
5287
|
get name() {
|
|
@@ -5289,7 +5289,7 @@ try {
|
|
|
5289
5289
|
},
|
|
5290
5290
|
// @ts-ignore
|
|
5291
5291
|
get commitId() {
|
|
5292
|
-
return "
|
|
5292
|
+
return "fbf4f07cc531ea3f7d62e09ae00a40a1e105c3c8";
|
|
5293
5293
|
},
|
|
5294
5294
|
print(a = !1) {
|
|
5295
5295
|
!a && window._xe2_no_copy_print || console.info(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(g,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("earthsdk3"),require("xbsj-base"),require("@epicgames-ps/lib-pixelstreamingfrontend-ue5.2"),require("html2canvas")):typeof define=="function"&&define.amd?define(["exports","earthsdk3","xbsj-base","@epicgames-ps/lib-pixelstreamingfrontend-ue5.2","html2canvas"],d):(g=typeof globalThis<"u"?globalThis:g||self,d(g.EarthSDK3_UE={},g.EarthSDK3,g.xbsj_base,g.libPixelstreamingfrontendUe5_2,g.html2canvas))})(this,function(g,d,l,L,Bn){"use strict";var Cr=Object.defineProperty;var Er=(g,d,l)=>d in g?Cr(g,d,{enumerable:!0,configurable:!0,writable:!0,value:l}):g[d]=l;var f=(g,d,l)=>Er(g,typeof d!="symbol"?d+"":d,l);const Kn={...d.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??""},Ni=()=>({...d.ESViewer.createCommonProps(),apiKey:"",apiUrl:"",secretKey:"",speechVoiceMode:"",geoReferenceOrigin:l.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 ce(){const h=Ni(),e=[];return Object.keys(h).forEach(t=>{e.push(t)}),e}function we(h){const{defaults:e}=W,t=ce(),i={};return t.forEach(n=>{i[n]=h[n]??e[n]}),i}const K=async(h,e,t,i,n,r="default")=>{const o=await h.callUeFunc({f:"flyTo",p:{id:e,duration:t,flyToParam:i,position:n,flyMode:r}});if(o.error){console.error(o.error);return}return o.re},ye=async(h,e)=>{const t=await h.callUeFunc({f:"destroy",p:{id:e}});return t.error&&console.error(t.error),t},$=(h,e)=>{h.callUeFunc({f:"calcFlyToParam",p:{id:e}}).then(t=>{t.error&&console.error("calcFlyToParam:",t.error)}).catch(t=>{console.error("calcFlyToParam:",t)})},zi=(h,e)=>{h.callUeFunc({f:"refreshTileset",p:{id:e}}).then(t=>{t.error&&console.error("refreshTileset:",t.error)}).catch(t=>{console.error("refreshTileset:",t)})},x=async(h,e,t,i,n,r="default")=>{const o=await h.callUeFunc({f:"flyIn",p:{id:e,position:t,rotation:i,duration:n,flyMode:r}});if(o.error){console.error(o.error);return}return o.re},ki=async(h,e)=>{if(!h){console.warn("DefaultCameraFlyIn: viewer is undefined");return}const t=await h.callUeFunc({f:"DefaultCameraFlyIn",p:{Duration:e??1}});if(t.error){console.error("DefaultCameraFlyIn:",t.error);return}return t},Gi=async h=>{if(!h){console.warn("StartVoice:viewer is undefined");return}const e=await h.callUeFunc({f:"StartVoice",p:{}});if(e.error){console.error("StartVoice:",e.error);return}return e},Hi=async h=>{if(!h){console.warn("StopVoice:viewer is undefined");return}const e=await h.callUeFunc({f:"StopVoice",p:{}});if(e.error){console.error("StopVoice:",e.error);return}return e},Ji=async(h,e)=>{if(!h){console.warn("mountPakFiles:viewer is undefined");return}const t=await h.callUeFunc({f:"MountPakFiles",p:{json:e}});if(t.error){console.error("mountPakFiles:",t.error);return}return t},Bi=async h=>{if(!h){console.warn("generateMemReport:viewer is undefined");return}const e=await h.callUeFunc({f:"GenerateMemReport",p:{}});if(e.error){console.error("generateMemReport:",e.error);return}return e},me=async(h,e)=>{const t=await h.callUeFunc({f:"resetWithCurrentCamera",p:{id:e}});return t.error&&console.error("resetWithCurrentCamera:",t.error),t},O=(h,e,t,i,n)=>{h.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)})},j=(h,e,t,i,n,r)=>{h.callUeFunc({f:"smoothMoveOnGround",p:{id:e,Lon:t,Lat:i,Ground:n,Time:r}}).then(o=>{o.error&&console.error("smoothMoveOnGround:",o.error)}).catch(o=>{console.error("smoothMoveOnGround:",o)})},tt=(h,e,t,i,n,r,o)=>{h.callUeFunc({f:"smoothMoveWithRotationOnGround",p:{id:e,NewRotation:t,Lon:i,Lat:n,Time:r,Ground:o}}).then(s=>{s.error&&console.error("smoothMoveWithRotationOnGround:",s.error)}).catch(s=>{console.error("smoothMoveWithRotationOnGround:",s)})},Ki=(h,e,t)=>{h.callUeFunc({f:"HighlightFeature",p:{id:e,HlId:t}}).then(i=>{i.error&&console.error("HighlightFeature:",i.error)}).catch(i=>{console.error("HighlightFeature:",i)})},Vi=(h,e,t,i)=>{h.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)})},Xi=(h,e,t)=>{h.callUeFunc({f:"SetLayerVisible",p:{id:e,LayerJson:t}}).then(i=>{i.error&&console.error("SetLayerVisible:",i.error)}).catch(i=>{console.error("SetLayerVisible:",i)})},qi=(h,e,t)=>{h.callUeFunc({f:"SetLayerColor",p:{id:e,LayerJson:t}}).then(i=>{i.error&&console.error("SetLayerColor:",i.error)}).catch(i=>{console.error("SetLayerColor:",i)})},et=(h,e,t,i)=>{h.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)})},Ce=async(h,e,t,i)=>{const n=await h.callUeFunc({f:"callFunction",p:{id:e,fn:t,p:i}});return n.error&&(console.error("callFunction:",n.error),console.error(`id: ${e} fn: ${t} param: ${i}`)),n.re??void 0},Zi=(h,e,t,i)=>{h.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)})},Yi=(h,e,t,i)=>{h.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=(h,e,t,i)=>{h.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)})},A=async(h,e)=>{do{if(e.mode=="Follow"){const i=d.ESSceneObject.getSceneObject(e.objectId);e.objectId=i?i.getMainClass().id:e.objectId;break}if(e.mode=="Line"){const i=d.ESSceneObject.getSceneObject(e.geoLineStringId);e.geoLineStringId=i?i.getMainClass().id:e.geoLineStringId;break}}while(!1);const t=await h.callUeFunc({f:"ChangeNavigationMode",p:e});if(t.error){console.error("ChangeNavigationMode:",t.error);return}return t},bi=async(h,e)=>{const t=await h.callUeFunc({f:"setGlobalProperty",p:e});if(t.error){console.error("setGlobalProperty:",t.error);return}return t},xi=async h=>{const e=await h.callUeFunc({f:"Quit",p:void 0});if(e.error){console.error("Quit:",e.error);return}return e},Oi=async(h,e,t,i)=>{console.log("pickCallFunc",e,t,i);const n=await h.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,o,s=r?d.ESSceneObject.getSceneObject(r):void 0;return s&&s.parentID&&(s=d.ESSceneObject.getSceneObject(s.parentID)),o=new d.ESJPickedResult(n.re,s,n.re.features,n.re.add,t,e),s&&Reflect.has(s,"allowPicking")&&Reflect.has(s,"pickedEvent")&&(s.allowPicking??!1)&&s.pickedEvent.emit(o),s&&Reflect.has(s,"allowPicking")&&!s.allowPicking?new d.ESJPickedResult:o},ji=async(h,e)=>{const t=await h.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},tn=async(h,e,t,i="ECC_Visibility")=>{const n=await h.callUeFunc({f:"GetHeightByLonLat",p:{Lon:e,Lat:t,Channel:i}});if(n.error){console.warn(`GetHeightByLonLat:${n.error}`);return}return n.re},en=async(h,e,t="ECC_Visibility")=>{const i=await h.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}},nn=async(h,e=64,t=64)=>{const i=await h.callUeFunc({f:"capture",p:{resx:e,resy:t}});if(i.error){console.warn(i.error);return}return i.re.image},rn=async(h,e,t=[64,64])=>{const i=await h.callUeFunc({f:"partialCapture",p:{startPos:e,size:t}});if(i.error){console.warn(i.error);return}return i.re.image},on=async(h,e)=>{const t=await h.callUeFunc({f:"LonLatAltToScreenPosition",p:{LonLatAlt:e}});return t.error&&console.warn(t.error),t.re},sn=async(h,e)=>{const t=await h.callUeFunc({f:"UEPositionToLonLatAlt",p:{UEPosition:e}});if(t.error){console.warn(t.error);return}return[...t.re.LonLatAlt]},an=async(h,e)=>{const t=await h.callUeFunc({f:"GetAllSocketNamesByActorTag",p:{ActorTag:e}});if(t.error){console.warn(t.error);return}return[...t.re.socketNames]},ln=async h=>{const e=await h.callUeFunc({f:"GetVersion",p:void 0});if(e.error){console.warn("GetVersion:",e.error);return}return e.re.version},dn=async(h,e)=>{const t=await h.callUeFunc({f:"GetBoundSphere",p:{id:e}});if(t.error){console.warn(t.error);return}return t.re},cn=async(h,e)=>{const t=await h.callUeFunc({f:"GetBoundSphereWithChildren",p:{id:e}});if(t.error){console.warn(`GetBoundSphereWithChildren:${t.error}`);return}return t.re},un=async(h,e)=>{const t=await h.callUeFunc({f:"GetStrokeMaterialParamInfo",p:{id:e}});if(t.error){console.warn(`GetStrokeMaterialParamInfo:${t.error}`);return}return t.re},hn=async(h,e)=>{const t=await h.callUeFunc({f:"GetFillMaterialParamInfo",p:{id:e}});if(t.error){console.warn(`GetFillMaterialParamInfo:${t.error}`);return}return t.re},vn=async(h,e)=>{const t=await h.callUeFunc({f:"getGlobalProperty",p:{props:e}});if(t.error){console.warn(`getGlobalProperty:${t.error}`);return}return t.re},gn=async(h,e)=>{const t=await h.callUeFunc({f:"GetObjectByInfo",p:{info:e}});if(t.error){console.warn(`GetObjectByInfo:${t.error}`);return}return t.re},pn=async(h,e,t)=>await h.callUeFunc({f:"BindActorByTag",p:{ID:e,ActorTag:t}}),fn=async h=>await h.callUeFunc({f:"RestoreOriginalScene",p:void 0}),wn=async(h,e)=>await h.callUeFunc({f:"UnBindActorByID",p:{ID:e}}),yn=async(h,e)=>await h.callUeFunc({f:"UnBindActorByTag",p:{ActorTag:e}}),mn=async(h,e,t)=>await h.callUeFunc({f:"CreateActorByClass",p:{ID:e,ActorClass:t}}),Cn=async function(h,e,t){return await h.callUeFunc({f:"Bind3DTilesetByTag",p:{ID:e,ActorTag:t}})},En=async function(h,e){return await h.callUeFunc({f:"UnBind3DTilesetByTag",p:{ActorTag:e}})},Sn=async function(h,e){return await h.callUeFunc({f:"UnBind3DTilesetById",p:{ID:e}})},Fn=async function(h,e,t,i){return await h.callUeFunc({f:"BindImageryByTag",p:{ID:e,ActorTag:t,ComponentTag:i}})},In=async function(h,e,t){return await h.callUeFunc({f:"UnBindImageryByTag",p:{ActorTag:e,ComponentTag:t}})},Tn=async function(h,e){return await h.callUeFunc({f:"UnBindImageryById",p:{ID:e}})},Rn=async function(h,e,t,i){return await h.callUeFunc({f:"GetIdByComponentNameAndHitItem",p:{id:e,ComponentName:t,HitItem:i}})},Dn=async function(h,e="ECC_Visibility"){return await h.callUeFunc({f:"GetCameraRelativeHeight",p:{Channel:e}})},Ln=async function(h,e,t,i){const n=await h.callUeFunc({f:"SaveStringToFile",p:{String:e,Path:t??"undefine",File:i??"data.txt"}});return n.error!==""&&console.warn("SaveStringToFile: ",n.error),n},Pn=async function(h,e,t=!0){const i=await h.callUeFunc({f:"HighlightActorByTag",p:{ActorTag:e,Highlight:t}});return i.error!==""&&console.warn("HighlightActorByTag: ",i.error),i},Mn=async function(h,e){const t=await h.callUeFunc({f:"SendCustomMessage",p:{Message:e}});return t.error!==""&&console.warn("SendCustomMessage: ",t.error),t},Un=async function(h){const e=await h.callUeFunc({f:"GetStatus",p:void 0});if(e.error){console.warn(`GetStatus:${e.error}`);return}return e.re},An=async(h,e,t,i,n=!0)=>{const r=await h.callUeFunc({f:"startEditing",p:{sceneObjectID:e,editingID:t,modes:i,useKeyToSwitch:n}});if(r.error){console.error("startEditing:",r.error);return}return r},Wn=async h=>{const e=await h.callUeFunc({f:"stopEditing",p:void 0});if(e.error){console.error("stopEditing:",e.error);return}return e},_n=async(h,e,t)=>{const i=await h.callUeFunc({f:"moveObjects",p:{sceneObjectIDs:e,editingID:t}});if(i.error){console.error("moveObjects:",i.error);return}return i},$n=async h=>{const e=await h.callUeFunc({f:"GetTilesetMaterialIDList",p:void 0});if(e.error){console.error("GetTilesetMaterialIDList:",e.error);return}return e.re.materialIDList};class it extends l.Destroyable{}const Vn={Response:1},ue={UIInteraction:50,MouseWheel:75};class Xn extends l.HasOwner{constructor(t,i){super(t);f(this,"_processResponseFn",t=>this.esUeViewer.processResponse(t));f(this,"_inner");this._uri=i,this._inner=new WebSocket(this._uri),this.d(()=>{this._inner.close()}),this._innerInit()}get esUeViewer(){return this.owner}get uri(){return this._uri}get inner(){return this._inner}_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,o=new Uint32Array(r),s=0;if(o[0]===Vn.Response){s+=4;let u=o[s/4];s+=4;for(let a=0;a<u;a++){let y=o[s/4];s+=4;let w=new TextDecoder("utf-8").decode(r.slice(s,s+y));s+=y,this._processResponseFn(w)}}},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"})))}}sendInputData(t){const i=this.inner;if(i.readyState!==WebSocket.OPEN)return;const r=new Uint8Array(t)[0];if(r>=ue.UIInteraction&&r<=ue.MouseWheel){const o=new ArrayBuffer(t.byteLength+4);return new DataView(o).setUint32(0,t.byteLength,!0),new Uint8Array(o,4).set(new Uint8Array(t)),i.send(new DataView(o)),!0}else return!1}emitDescriptorWithString(t,i){let n=new TextEncoder().encode(i),r=new DataView(new ArrayBuffer(3+n.length)),o=0;r.setUint8(o,t),o++,r.setUint16(o,n.length,!0),o+=2;for(let s=0;s<n.length;s++)r.setUint8(o,n[s]),o+=1;try{this.sendInputData(r.buffer)}catch(s){console.error(`data.buffer.size: ${r.buffer.byteLength} 独立通道 sendInputData error: ${s}`,s)}}destroyImpl(){this._inner&&this._inner.close()}}window.g_emitDescriptor_maxBytes=3e4;let qn=-1;L.Logger.SetLoggerVerbosity(1);class Zn extends l.Destroyable{constructor(t,i){super();f(this,"_eventTarget",new EventTarget);f(this,"debug",!1);f(this,"uiInteractionCallbacks",new Map);f(this,"_pixelStream");f(this,"_esMsgWsWrapper");this._domOrDomId=t,this._options=i;const n=typeof this._domOrDomId=="string"?document.getElementById(this._domOrDomId):this._domOrDomId;if(!n)throw new Error(`ESUEViewer container${this._domOrDomId} error!`);console.log(`PSUEViewer init _options ${this._options}`);const{url:r,esmsgWsUri:o}=this._options;this._pixelStream=this._initPixelStream(n,r),this.d(()=>{this._pixelStream.disconnect()}),this._handerPixelStreamEvent(),this._esMsgWsWrapper=this._initEsMsgWsWrapper(o);const s=this;if(s.esMsgWsWrapper){const u=s.webRtcController.sendMessageController.dataChannelSender.sendData;s.webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData=function(a){s.esMsgWsWrapper?s.esMsgWsWrapper.sendInputData(a):u.call(this,a)}}}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)}_initPixelStream(t,i){const n=new L.Config({initialSettings:{AutoPlayVideo:!0,AutoConnect:!0,StartVideoMuted:!1,SuppressBrowserKeys:!1,[L.TextParameters.SignallingServerUrl]:i}});return n.setFlagEnabled(L.Flags.BrowserSendOffer,!1),n.setFlagEnabled(L.Flags.HoveringMouseMode,!0),n.setFlagEnabled(L.Flags.MatchViewportResolution,!0),n.setNumericSetting(L.NumericParameters.MaxReconnectAttempts,0),new L.PixelStreaming(n,{videoElementParent:t})}get pixelStream(){return this._pixelStream}_initEsMsgWsWrapper(t){return t?this.dv(new Xn(this,t)):void 0}get esMsgWsWrapper(){return this._esMsgWsWrapper}get esWebSocketReady(){var t;return((t=this.esMsgWsWrapper)==null?void 0:t.inner.readyState)===1}_handerPixelStreamEvent(){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",t=>{this.processResponse(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)}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=l.createGuid(),this.uiInteractionCallbacks.set(t.callid,i)),this.pixelStream.emitUIInteraction(t)}get webRtcController(){return this.pixelStream._webRtcController}emitUIInteractionForBigData(t,i){typeof i=="function"&&(t.callid=l.createGuid(),this.uiInteractionCallbacks.set(t.callid,i));const n=JSON.stringify(t),r=window.g_emitDescriptor_maxBytes,o=n.length,s=++qn;if(this.esMsgWsWrapper){if(o<r){this.esMsgWsWrapper.emitDescriptorWithString(ue.UIInteraction,`${s}-0/1-`+n);return}const u=Math.ceil(o/r)|0;[...new Array(u).keys()].map(y=>n.slice(y*r,(y+1)*r)).forEach((y,w)=>{this.esMsgWsWrapper&&this.esMsgWsWrapper.emitDescriptorWithString(ue.UIInteraction,`${s}-${w}/${u}-`+y)})}}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 Yn extends l.Destroyable{constructor(t,i,n){super();f(this,"_instance");f(this,"_event",this.dv(new l.Event));this._container=t,this._wsuri=i,this._esmsgWsUri=n,this._instance=this.dv(new Zn(this._container,{url:this._wsuri,esmsgWsUri:this._esmsgWsUri})),this.instanceInit()}get webSocketReady(){return this._instance.esWebSocketReady}get event(){return this._event}get debug(){return this._instance.debug}set debug(t){this._instance.debug=t}instanceInit(){if("addEventListener"in this._instance){["esmsgwsopen","error","videoinited","ueevent","webRtcConnected"].forEach(i=>{const n=r=>{this._event.emit(i,r.detail)};this._instance.addEventListener(i,n),this.dispose(()=>this._instance.removeEventListener(i,n))});return}this.dispose(this._instance.errorEvent.disposableOn(t=>{this._event.emit("error",t.detail)})),this.dispose(this._instance.webRtcConnectedEvent.disposableOn(t=>{this._event.emit("webRtcConnected",t.detail)})),this.dispose(this._instance.videoinitedEvent.disposableOn(t=>{this._event.emit("videoinited",t.detail)})),this.dispose(this._instance.ueevent.disposableOn(t=>{this._event.emit("ueevent",t.detail)}))}emitUIInteractionForBigData(t,i){return new Promise((n,r)=>{const o=(...s)=>{n(s),i&&i(...s)};try{this._instance.emitUIInteractionForBigData(t,o)}catch(s){console.warn(`emitUIInteraction发生错误:${s}`),r(s)}})}getVideoSize(){return this._instance.getVideoSize()}resize(t,i){this._instance.resizeUEVideo(t,i)}}class Qn extends it{constructor(t,i,n,r){super();f(this,"_esueViewerWrapper");f(this,"_ueFuncResultWithIdsEvent",this.dv(new l.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Set);f(this,"_ueEvent",this.dv(new l.Event));f(this,"_errorEvent",this.dv(new l.Event));f(this,"_readyEvent",this.dv(new l.Event));f(this,"_esmsgwsopen",this.dv(l.react(!1)));f(this,"_videoinited",this.dv(l.react(!1)));f(this,"_webRtcConnected",this.dv(l.react(!1)));this._ueViewer=r,console.log("CSTMPSViewer init ! 以官方像素流 + 独立通信的模式启动!");const o=this._ueViewer;this._esueViewerWrapper=this.dv(new Yn(t,i,n));const s=this._esueViewerWrapper;{const p=()=>s.debug=o.debug??!1;p(),this.d(o.debugChanged.don(p))}let u=!1;{const p=()=>{if(u)return;const v=s.webSocketReady;if(this.videoinited&&this.webRtcConnected&&v){console.log("%c[EarthSDK: esmsgWebSocket && videoinited && webRtcConnected]","background: #a6ec99; color: black");const m={eventType:"init",params:{}};s.emitUIInteractionForBigData(m),this._readyEvent.emit(),u=!0}};this.d(this.videoinitedChanged.don(()=>{p()})),this.d(this.webRtcConnectedChanged.don(()=>{p()})),this.d(this.esmsgwsopenChanged.don(()=>{p()}))}this.d(s.event.don((p,v)=>{if(p==="error")this._errorEvent.emit(v);else if(p==="ueevent"){const m=JSON.parse(v);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(l.createAnimateFrame());let v,m;p.start(()=>{if(v!==t.offsetWidth||m!==t.offsetHeight){if(v=t.offsetWidth,m=t.offsetHeight,v===void 0||m===void 0||!Number.isFinite(v)||!Number.isFinite(m)||v<0||m<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${v} ${m}`);return}s.resize(v,m),console.log(`resize: ${v} ${m}`)}})}this.d(this._ueFuncResultWithIdsEvent.don(p=>{for(const v of p){const m=this._waitingUeFuncIdAndResultCallbacks.get(v.fid);m&&(this._waitingUeFuncIdAndResultCallbacks.delete(v.fid),m.resultCallback(v.r))}}));let a=0;const y=p=>{const v={n:a++,tt:Date.now(),t:"c",fs:p};this._waitingUeCalls.add(v),o.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(v,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd()),this._esueViewerWrapper.emitUIInteractionForBigData(v,()=>{this._waitingUeCalls.delete(v)})},w=()=>{if(!u||this._ueFuncWithIdAndResultCallbacks.length===0)return;const p=this._ueFuncWithIdAndResultCallbacks.map(([v])=>v);for(const[v,m]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(v.fid,m);this._ueFuncWithIdAndResultCallbacks.length=0;{const v=window.g_emitDescriptor_maxBytes,m=p.map(R=>({f:R,s:JSON.stringify(R).length}));let C=m.length,E=0,I=0,S=[];do{do{const{f:R,s:T}=m[E];if(S.push(R),++E,I+T>v||S.length>=20)break}while(E<C);S.length>0&&(o.debug&&console.log(`传送${S.length}条消息...`),y([...S]),S.length=0,I=0)}while(E<C)}};this.dv(l.createInterval()).start(w,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:l.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=l.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},o=this._ueEvent.don(s=>{s.et===t&&s.eid===n&&i(s)});return()=>{o(),r()}}}function bn(h){let e="";const t=new Uint8Array(h),i=t.length;for(let n=0;n<i;n++)e+=String.fromCharCode(t[n]);return btoa(e)}const xn=h=>{const e={type:"input",inputdata:bn(h)};return JSON.stringify(e)};function On(h){return typeof h=="string"?document.getElementById(h):h}window.g_emitDescriptor_maxBytes=3e4,console.log("全局可设置消息体最大字节, window.g_emitDescriptor_maxBytes 默认 30000 。");let jn=-1;L.Logger.SetLoggerVerbosity(1);class tr extends l.Destroyable{constructor(t,i){super();f(this,"debug",!1);f(this,"_error",this.dv(new l.Event));f(this,"_connected",this.dv(new l.Event));f(this,"_ueevent",this.dv(new l.Event));f(this,"_pixelStream");f(this,"uiInteractionCallbacks",new Map);this._container=t,this._option=i;const n=new L.Config({initialSettings:{HoveringMouse:!0,AutoPlayVideo:!0,AutoConnect:!0,StartVideoMuted:!1,SuppressBrowserKeys:!1,ss:this._option.ws},useUrlParams:!0});n.setFlagEnabled(L.Flags.BrowserSendOffer,!1),n.setFlagEnabled(L.Flags.HoveringMouseMode,!0),n.setFlagEnabled(L.Flags.MatchViewportResolution,!0),n.setNumericSetting(L.NumericParameters.MaxReconnectAttempts,0),this._pixelStream=new L.PixelStreaming(n,{videoElementParent:this.container}),this.d(()=>{this._pixelStream.disconnect()});{const r=this.pixelStream.webSocketController.webSocket,o=this._pixelStream._webRtcController.sendMessageController.dataChannelSender.sendData;this._pixelStream._webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData=function(s){r?r.send(xn(s)):o.call(this,s)}}{const r=o=>{const s=this._pixelStream._webRtcController.mouseController;setTimeout(()=>{const u=s.coordinateConverter.normalizeAndQuantizeUnsigned(o.offsetX,o.offsetY),y=s.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp");y&&y([o.button,u.x,u.y]),o.preventDefault()})};this.container.addEventListener("dblclick",r),this.d(()=>{this.container.removeEventListener("dblclick",r)})}["error","close","open"].forEach(o=>{const s=()=>{this.isDestroyed()||(o==="open"?this.connected.emit("webSocketOpen"):o==="close"?this.error.emit("webSocketClose"):o==="error"&&this.error.emit("webSocketError"))};this.pixelStream.webSocketController.webSocket.addEventListener(o,s),this.d(()=>{this.pixelStream.webSocketController.webSocket.removeEventListener(o,s)})}),["videoInitialized","webRtcConnected","webRtcDisconnected","webRtcFailed"].forEach(o=>{const s=()=>{this.isDestroyed()||(o==="webRtcConnected"||o==="videoInitialized"?this.connected.emit(o):(o==="webRtcDisconnected"||o==="webRtcFailed")&&(this.error.emit(o),this.pixelStream.disconnect()))};this.pixelStream.addEventListener(o,s),this.d(()=>{this.pixelStream.removeEventListener(o,s)})}),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 On(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=l.createGuid(),this.uiInteractionCallbacks.set(t.callid,i));const n=JSON.stringify(t),r=window.g_emitDescriptor_maxBytes??3e4,o=n.length,s=++jn;if(o<r){const y={type:"earthsdk",time:new Date().getTime(),params:`${s}-0/1-`+n};this.sendData(JSON.stringify(y));return}const u=Math.ceil(o/r)|0;[...new Array(u).keys()].map(y=>n.slice(y*r,(y+1)*r)).forEach((y,w)=>{const c={type:"earthsdk",time:new Date().getTime(),params:`${s}-${w}/${u}-`+y};this.sendData(JSON.stringify(c))})}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 er extends l.Destroyable{constructor(t,i,n){super();f(this,"_instance");f(this,"_event",this.dv(new l.Event));this._container=t,this._wsuri=i,this._esmsgWsUri=n,this._instance=this.dv(new tr(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 o=(...s)=>{n(s),i&&i(...s)};try{this._instance.emitUIInteractionForBigData(t,o)}catch(s){console.warn(`emitUIInteraction发生错误:${s}`),r(s)}})}getVideoSize(){return this._instance.getVideoSize()}resize(t,i){this._instance.resizeUEVideo(t,i)}}class ir extends it{constructor(t,i,n,r){super();f(this,"_videoInitialized",this.dv(l.react(!1)));f(this,"_webRtcConnected",this.dv(l.react(!1)));f(this,"_webSocketOpen",this.dv(l.react(!1)));f(this,"_ue5ViewerWrapper");f(this,"_ueFuncResultWithIdsEvent",this.dv(new l.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Set);f(this,"_ueEvent",this.dv(new l.Event));f(this,"_errorEvent",this.dv(new l.Event));f(this,"_readyEvent",this.dv(new l.Event));this._ueViewer=r,console.log("INNPSViewer init ! 以内置信令服务器模式启动!");const o=this._ueViewer,s=this.dv(new er(t,i,n));this._ue5ViewerWrapper=s;{const c=()=>s.debug=o.debug??!1;c(),this.d(o.debugChanged.don(c))}{let c=!1;const p=this.dv(l.createNextAnimateFrameEvent(this._videoInitialized.changed,this._webRtcConnected.changed,this._webSocketOpen.changed));this.d(p.don(()=>{if(c)return;const v=this._ue5ViewerWrapper.instance.webSocketReady;if(this.videoInitialized&&this.webRtcConnected&&v){this._ue5ViewerWrapper.instance.emitUIInteraction(),this._readyEvent.emit(),c=!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",v),c=!1}))}this.d(s.event.don((c,p)=>{if(c==="errorEvent")this._errorEvent.emit(p);else if(c==="videoInitialized")this._videoInitialized.value=!0;else if(c==="webRtcConnected")this._webRtcConnected.value=!0;else if(c==="webSocketOpen")this._webSocketOpen.value=!0;else if(c==="ueevent"){const v=JSON.parse(p);if(v.t==="cr"){const m=v;if(m.frs&&this._ueFuncResultWithIdsEvent.emit(m.frs),m.ers)for(let C of m.ers)this._ueEvent.emit(C)}}}));{const c=this.dv(l.createAnimateFrame());let p,v,m;c.start(()=>{if(p!==t.offsetWidth||v!==t.offsetHeight||m!==o.resolutionScale){if(p=t.offsetWidth,v=t.offsetHeight,p===void 0||v===void 0||!Number.isFinite(p)||!Number.isFinite(v)||p<0||v<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${p} ${v}`);return}m=o.resolutionScale,s.resize(p/m,v/m)}})}this.d(this._ueFuncResultWithIdsEvent.don(c=>{for(const p of c){const v=this._waitingUeFuncIdAndResultCallbacks.get(p.fid);v&&(this._waitingUeFuncIdAndResultCallbacks.delete(p.fid),v.resultCallback(p.r))}}));let u=0;const a=c=>{const p={n:u++,tt:Date.now(),t:"c",fs:c};this._waitingUeCalls.add(p),o.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)})},y=()=>{if(!this._ue5ViewerWrapper.instance.webSocketReady||this._ueFuncWithIdAndResultCallbacks.length===0)return;const p=this._ueFuncWithIdAndResultCallbacks.map(([v])=>v);for(const[v,m]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(v.fid,m);this._ueFuncWithIdAndResultCallbacks.length=0;{const v=window.g_emitDescriptor_maxBytes,m=p.map(R=>({f:R,s:JSON.stringify(R).length}));let C=m.length,E=0,I=0,S=[];do{do{const{f:R,s:T}=m[E];if(S.push(R),++E,I+T>v||S.length>=20)break}while(E<C);S.length>0&&(o.debug&&console.log(`传送${S.length}条消息...`),a([...S]),S.length=0,I=0)}while(E<C)}};this.dv(l.createInterval()).start(y,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:l.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,{timeStamp:Date.now(),ueFunc:t,resultCallback:i}])})}disposableOnUeEvent(t,i){const n=l.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},o=this._ueEvent.don(s=>{s.et===t&&s.eid===n&&i(s)});return()=>{o(),r()}}}class nr extends l.Destroyable{constructor(t,i,n,r){super();f(this,"_onRuntimeInitialized",this.dv(new l.Event));f(this,"_vIframe",null);this._ueViewer=r;const o=this._ueViewer;{const s=document.createElement("iframe");this._vIframe=s,s.style.cssText="width: 100%; height: 100%; margin: 0; padding: 0; border: none; outline: none;",t.appendChild(s),this.d(()=>{s&&t.removeChild(s)});const u=d.ESSceneObject.getStrFromEnv(n+`/web/${i}.html`);s.src=u,s.onload=()=>{const a=s.contentWindow;if(!a){console.error("iframeWindow is null");return}console.log("iwindow.Module",a.Module),a.Module.onRuntimeInitialized=()=>{this._onRuntimeInitialized.emit(),o.setStatus("Created"),o.setStatusLog("创建成功"),a.Module.UE4_resizeCanvas(),a.console.log("创建成功__________________________________________")}}}}get onRuntimeInitialized(){return this._onRuntimeInitialized}get vIframe(){return this._vIframe}}const Nn=typeof TextDecoder<"u"?new TextDecoder:void 0,rr=(h,e=0,t=NaN)=>{const i=e+t;let n=e;for(;h[n]&&!(n>=i);)++n;if(n-e>16&&h.buffer&&Nn)return Nn.decode(h.subarray(e,n));let r="";for(;e<n;){var o=h[e++];if(!(o&128)){r+=String.fromCharCode(o);continue}var s=h[e++]&63;if((o&224)==192){r+=String.fromCharCode((o&31)<<6|s);continue}var u=h[e++]&63;if((o&240)==224?o=(o&15)<<12|s<<6|u:((o&248)!=240&&console.warn("Invalid UTF-8 leading byte encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),o=(o&7)<<18|s<<12|u<<6|h[e++]&63),o<65536)r+=String.fromCharCode(o);else{var a=o-65536;r+=String.fromCharCode(55296|a>>10,56320|a&1023)}}return r};class or extends l.Destroyable{constructor(e,t,i){super();{const n=()=>{const u=we(t);t.setGlobalProperty(u)};n();const r=ce(),o=[];r.forEach(u=>{const a=t[u+"Changed"];o.push(a)});const s=this.dv(l.createNextAnimateFrameEvent(...o));this.d(s.don(n))}this.d(t.propChanged.don(n=>{if(n.objId==="")try{Object.keys(n.props).forEach(r=>{const o=n.props[r]===null?void 0:n.props[r];t[r]=o})}catch(r){console.error("ueViewer propChanged:"+r)}})),t.useCustomInteraction=!1,this.dv(new d.ViewerCustomInteraction(t,e)),this.dv(new l.ObjResettingWithEvent(t.statusUpdateIntervalChanged,n=>{if((t.statusUpdateInterval??.5)===0)return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("statusUpdate",s=>{t.statusUpdateEvent.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.propChangedListeningChanged,()=>{if(!(t.propChangedListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("propChanged",o=>{t.propChanged.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(t.objectEventListeningChanged,()=>{if(!(t.objectEventListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("objectEvent",o=>{t.objectEvent.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(t.widgetEventListeningChanged,()=>{if(!(t.widgetEventListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("widgetEvent",o=>{t.widgetEvent.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(t.speechRecognitionListeningChanged,()=>{if(!(t.speechRecognitionListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("speechRecognition",o=>{t.speechRecognition.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(t.customMessageListeningChanged,()=>{if(!(t.customMessageListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("customMessage",o=>{t.customMessage.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(t.editingEventListeningChanged,()=>{if(!(t.editingEventListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("editingEvent",o=>{o.objectIDs=o.objectIDs.map(s=>{var u;return((u=d.ESSceneObject.getSceneObjById(s))==null?void 0:u.parentID)??s}),t.editingEvent.emit(o)})),r}))}}let sr=-1;class ar extends it{constructor(t,i,n="${earthsdk3-ue-h5-assets-script-dir}",r){super();f(this,"_ueFuncResultWithIdsEvent",this.dv(new l.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Map);f(this,"_ueEvent",this.dv(new l.Event));this._ueViewer=r;const o=this._ueViewer,s=this.dv(new nr(t,i,n,o));let u=!1,a=null;this.d(s.onRuntimeInitialized.don(()=>{var p;if(u=!0,(p=s==null?void 0:s.vIframe)!=null&&p.contentWindow){a=s.vIframe.contentWindow;const v=s.vIframe.contentWindow.document.getElementById("mainarea");v?this.dv(new or(v,o,this)):console.error("h5Container is null")}else{console.error("iframeWindow is null");return}a.UE_JSHTML5Communication?a.UE_JSHTML5Communication.UESendMessageToJS=v=>{try{const m=rr(a.HEAPU8,v),C=JSON.parse(m);if(o.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 v of p){const m=this._waitingUeFuncIdAndResultCallbacks.get(v.fid);m&&(this._waitingUeFuncIdAndResultCallbacks.delete(v.fid),m(v.r))}}));let y=0;const w=()=>{if(!u||!a||!a.UE_JSHTML5Communication||!a.UE_JSHTML5Communication.JSSendMessageToUE||this._ueFuncWithIdAndResultCallbacks.length===0)return;const p=this._ueFuncWithIdAndResultCallbacks.map(([T])=>T),v={n:y++,tt:Date.now(),t:"c",fs:p,callid:l.createGuid()};for(const[T,_]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(T.fid,_);this._ueFuncWithIdAndResultCallbacks.length=0,this._waitingUeCalls.set(v.callid,v),o.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(v,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd());const m=JSON.stringify(v),C=window.g_emitDescriptor_maxBytes??3e4,E=m.length,I=++sr;if(E<C){const T=`${I}-0/1-`+m;a.UE_JSHTML5Communication.JSSendMessageToUE(T);return}const S=Math.ceil(E/C)|0;[...new Array(S).keys()].map(T=>m.slice(T*C,(T+1)*C)).forEach((T,_)=>{const fe=`${I}-${_}/${S}-`+T;a.UE_JSHTML5Communication.JSSendMessageToUE(fe)})};this.dv(l.createInterval()).start(w,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:l.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,i])})}disposableOnUeEvent(t,i){const n=l.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},o=this._ueEvent.disposableOn(s=>{s.et===t&&s.eid===n&&((this._ueViewer.debug??!1)&&console.log(`callback, type:${t} eid:${n} ueEvent:${JSON.stringify(s)}`),i(s))});return()=>{o(),r()}}}let lr=-1;class dr extends it{constructor(t,i){super();f(this,"_ueFuncResultWithIdsEvent",this.dv(new l.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Set);f(this,"_ueEvent",this.dv(new l.Event));this._ueViewer=i;const n=this._ueViewer;let r=!1;const o={eventType:"init",params:{}};window.ue.es.oncommand(JSON.stringify(o)),r=!0,window.calljs=(y,w)=>{if(n.debug&&console.log(`calljs eventName:${y} eventDetailStr:${w}`),y==="ueevent"||y==="commanFinish")try{const c=JSON.parse(w);if(c.t==="cr"){const p=c;if(p.frs&&this._ueFuncResultWithIdsEvent.emit(p.frs),p.ers)for(let v of p.ers)this._ueEvent.emit(v)}}catch(c){console.error(c)}},this.dispose(this._ueFuncResultWithIdsEvent.disposableOn(y=>{for(const w of y){const c=this._waitingUeFuncIdAndResultCallbacks.get(w.fid);c&&(this._waitingUeFuncIdAndResultCallbacks.delete(w.fid),c(w.r))}}));let s=0;const u=()=>{if(!r||this._ueFuncWithIdAndResultCallbacks.length===0)return;const y=this._ueFuncWithIdAndResultCallbacks.map(([p])=>p),w={n:s++,tt:Date.now(),t:"c",fs:y};for(const[p,v]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(p.fid,v);this._ueFuncWithIdAndResultCallbacks.length=0,this._waitingUeCalls.add(w),n.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(w,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd());const c=++lr;window.ue.es.oncommand(`${c}-0/1-`+JSON.stringify(w)).then(()=>{this._waitingUeCalls.delete(w)})};this.dv(l.createInterval()).start(u,50)}callUeFunc(t){return new Promise(i=>{const r={fid:l.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,i])})}disposableOnUeEvent(t,i){const n=l.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},o=this._ueEvent.disposableOn(s=>{s.et===t&&s.eid===n&&((this._ueViewer.debug??!1)&&console.log(`callback, type:${t} eid:${n} ueEvent:${JSON.stringify(s)}`),i(s))});return()=>{o(),r()}}}class cr extends l.Destroyable{constructor(e,t){super();{const i=()=>{const s=we(e);e.setGlobalProperty(s)};i();const n=ce(),r=[];n.forEach(s=>{const u=e[s+"Changed"];r.push(u)});const o=this.dv(l.createNextAnimateFrameEvent(...r));this.d(o.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 l.ObjResettingWithEvent(e.statusUpdateIntervalChanged,i=>{if((e.statusUpdateInterval??.5)===0)return;const r=new l.Destroyable;return r.d(t.disposableOnUeEvent("statusUpdate",o=>{e.statusUpdateEvent.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(e.propChangedListeningChanged,()=>{if(!(e.propChangedListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("propChanged",r=>{e.propChanged.emit(r)})),n})),this.dv(new l.ObjResettingWithEvent(e.objectEventListeningChanged,()=>{if(!(e.objectEventListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("objectEvent",r=>{e.objectEvent.emit(r)})),n})),this.dv(new l.ObjResettingWithEvent(e.widgetEventListeningChanged,()=>{if(!(e.widgetEventListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("widgetEvent",r=>{e.widgetEvent.emit(r)})),n})),this.dv(new l.ObjResettingWithEvent(e.speechRecognitionListeningChanged,()=>{if(!(e.speechRecognitionListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("speechRecognition",r=>{e.speechRecognition.emit(r)})),n})),this.dv(new l.ObjResettingWithEvent(e.customMessageListeningChanged,()=>{if(!(e.customMessageListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("customMessage",r=>{e.customMessage.emit(r)})),n})),this.dv(new l.ObjResettingWithEvent(e.editingEventListeningChanged,()=>{if(!(e.editingEventListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("editingEvent",r=>{r.objectIDs=r.objectIDs.map(o=>{var s;return((s=d.ESSceneObject.getSceneObjById(o))==null?void 0:s.parentID)??o}),e.editingEvent.emit(r)})),n}))}}class ur extends l.Destroyable{constructor(e,t,i){super();{const r=()=>{const a=we(t);t.setGlobalProperty(a)};r();const o=ce(),s=[];o.forEach(a=>{const y=t[a+"Changed"];s.push(y)});const u=this.dv(l.createNextAnimateFrameEvent(...s));this.d(u.don(r))}this.d(t.propChanged.don(r=>{if(r.objId==="")try{Object.keys(r.props).forEach(o=>{const s=r.props[o]===null?void 0:r.props[o];t[o]=s})}catch(o){console.error("ueViewer propChanged:"+o)}}));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=(a,y)=>{window.ue.esinput.setinterceptevent(y),a.preventDefault()},o=a=>{r(a,!1)},s=a=>{r(a,!0)},u=a=>{r(a,!1)};n.addEventListener("mouseenter",o),n.addEventListener("mouseleave",s),n.addEventListener("mousemove",u),this.d(()=>{n.removeEventListener("mouseenter",o),n.removeEventListener("mouseleave",s),n.removeEventListener("mousemove",u)})}t.useCustomInteraction=!1,this.dv(new d.ViewerCustomInteraction(t,n)),this.dv(new l.ObjResettingWithEvent(t.statusUpdateIntervalChanged,r=>{if((t.statusUpdateInterval??.5)===0)return;const s=new l.Destroyable;return s.d(i.disposableOnUeEvent("statusUpdate",u=>{t.statusUpdateEvent.emit(u)})),s})),this.dv(new l.ObjResettingWithEvent(t.propChangedListeningChanged,()=>{if(!(t.propChangedListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("propChanged",s=>{t.propChanged.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.objectEventListeningChanged,()=>{if(!(t.objectEventListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("objectEvent",s=>{t.objectEvent.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.widgetEventListeningChanged,()=>{if(!(t.widgetEventListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("widgetEvent",s=>{t.widgetEvent.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.speechRecognitionListeningChanged,()=>{if(!(t.speechRecognitionListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("speechRecognition",s=>{t.speechRecognition.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.customMessageListeningChanged,()=>{if(!(t.customMessageListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("customMessage",s=>{t.customMessage.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.editingEventListeningChanged,()=>{if(!(t.editingEventListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("editingEvent",s=>{s.objectIDs=s.objectIDs.map(u=>{var a;return((a=d.ESSceneObject.getSceneObjById(u))==null?void 0:a.parentID)??u}),t.editingEvent.emit(s)})),o}))}}class hr extends l.Destroyable{constructor(t,i,n){super();f(this,"_reconnectEvent",this.dv(new l.Event));const r=(u,a)=>u.hasOwnProperty(a);let o=0,s;if(this.d(()=>{s&&clearTimeout(s)}),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 u=this.dv(new dr(t,n));this.d(()=>n.viewer=void 0),n.viewer=u,n.setStatus("Created"),n.setStatusLog("本地视口创建成功!"),this.dv(new ur(t,n,u))}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 u;this.d(()=>{n.setStatus("Raw"),n.setStatusLog(""),t&&u&&t.removeChild(u)&&(u=void 0)});const a=this.dv(l.createProcessingFromAsyncFunc(async y=>{n.viewer&&!n.viewer.isDestroyed()&&n.viewer.destroy(),n.viewer=void 0,u&&t.removeChild(u)&&(u=void 0),u=document.createElement("div"),u.setAttribute("earthsdk3-ue","earthsdk3-ue-videoContainer"),u.style.cssText="position:relative; height: 100%;width:100%;",t.appendChild(u);let w,c,p;if(r(i.options,"ws")){const{ws:E,esmsg:I,uselnternalSignallingServer:S}=i.options;w=E,c=I,p=S??!1}if(r(i.options,"uri")&&r(i.options,"app")){const{offsetWidth:E,offsetHeight:I}=u;let{uri:S,app:R,token:T}=i.options;S.endsWith("/")||(S+="/");const _=T?`?essstoken=${T}`:"",fe=`/${R}/${E??1920}/${I??1080}`+_;console.log(`请求信令服务器: ${S}instance${fe}`);const pr=await y.promise(fetch(`${S}instance${fe}`,{method:"GET"})),b=await y.promise(pr.json());if(b&&b.status!=="ok"){n.setStatus("Error"),n.setStatusLog(`信令服务器请求失败 ${b.status}`),this._reconnectEvent.emit(void 0);return}else{console.log(`信令服务器请求成功! ${JSON.stringify(b,void 0," ")}`),await l.sleep(2e3);const{server:fr,esmsg:wr,instanceId:yr,useInternalSignallingServer:mr}=b;if(!yr){n.setStatus("Error"),n.setStatusLog("检查信令服务器版本,返回数据错误! "),console.log("信令服务器返回数据错误!不包含instanceId!请升级到 ESSS V3.0+ 版本!"),this._reconnectEvent.emit(void 0);return}w=fr,c=wr,p=mr??!1,n.esssResponse=b}}const v=this.dv(p?new ir(u,w,c,n):new Qn(u,w,c,n));this.d(()=>n.viewer=void 0),this.d(v.errorEvent.don(E=>{const I=`[${E}]:像素流连接错误!`;n.setStatus("Error"),n.setStatusLog(I),this._reconnectEvent.emit(v)})),await y.promise(new Promise(E=>this.d(v.readyEvent.donce(E)))),n.setStatus("Created"),n.setStatusLog("云渲染视口创建成功!"),o=0,s&&clearTimeout(s),s=void 0;const{offsetWidth:m,offsetHeight:C}=u;v.resize(m*window.devicePixelRatio,C*window.devicePixelRatio),n.viewer=v,this.d(()=>n.viewer=void 0),this.dv(new cr(n,v))}));a.start(),this.d(this._reconnectEvent.don(y=>{s===void 0&&(y&&!y.isDestroyed()&&y.destroy(),n.viewer&&!n.viewer.isDestroyed()&&n.viewer.destroy(),n.viewer=void 0,n.autoReconnect&&(n.setStatus("Reconnecting"),n.setStatusLog("正在尝试重新连接..."),o=o+5e3>3e4?3e4:o+5e3,console.warn(`间隔:${o/1e3}s,正在尝试重新连接...`),s=window.setTimeout(()=>{a.restart()},o)))})),this.d(a.errorEvent.don(y=>{n.setStatus("Error"),n.setStatusLog("云渲染视口创建失败!"),console.warn("云渲染视口创建失败!",y),this._reconnectEvent.emit(void 0)}))}else if(r(i.options,"project")){const u=i,a=u.options.project,y=u.options.baseUrl;n.setStatus("Creating"),n.setStatusLog("下载编译中...");const w=this.dv(new ar(t,a,y,n));n.viewer=w,this.d(()=>n.viewer=void 0)}else n.setStatus("Error"),n.setStatusLog("视口创建失败!"),console.warn("视口创建失败: 参数错误!")}}const z=class z extends d.ESViewer{constructor(t){super(t);f(this,"_viewer",this.dv(l.react(void 0)));f(this,"_esssResponse");f(this,"_speechRecognition",this.dv(new l.Event));f(this,"_propChanged",this.dv(new l.Event));f(this,"_objectEvent",this.dv(new l.Event));f(this,"_widgetEvent",this.dv(new l.Event));f(this,"_customMessage",this.dv(new l.Event));f(this,"_statusUpdateEvent",this.dv(new l.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 l.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new hr(this.subContainer,i,this)}))}get defaultProps(){return z.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 sn(this.viewer,t)}async changeNavigationMode(t){if(!this.viewer){console.warn("ChangeNavigationMode: viewer is undefined");return}const i=await A(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 me(this.viewer,t)}async getAllSocketNamesByActorTag(t){if(!this.viewer){console.warn("GetAllSocketNamesByActorTag: viewer is undefined");return}return await an(this.viewer,t)}async getBoundSphere(t){if(!this.viewer){console.warn("getBoundSphere: viewer is undefined");return}return await dn(this.viewer,t)}async getBoundSphereWithChildren(t){if(!this.viewer){console.warn("getBoundSphereWithChildren: viewer is undefined");return}return await cn(this.viewer,t)}async getStrokeMaterialParamInfo(t){if(!this.viewer){console.warn("GetStrokeMaterialParamInfo: viewer is undefined");return}return await un(this.viewer,t)}async getFillMaterialParamInfo(t){if(!this.viewer){console.warn("getFillMaterialParamInfo: viewer is undefined");return}return await hn(this.viewer,t)}async getGlobalProperty(t){if(!this.viewer){console.warn("getGlobalProperty: viewer is undefined");return}return await vn(this.viewer,t)}async getObjectByInfo(t){if(!this.viewer){console.warn("GetObjectByInfo: viewer is undefined");return}return await gn(this.viewer,t)}async defaultCameraFlyIn(t=1){if(!this.viewer){console.warn("DefaultCameraFlyIn: viewer is undefined");return}return await ki(this.viewer,t)}async startVoice(){if(!this.viewer){console.warn("startVoice:viewer is undefined");return}return await Gi(this.viewer)}async stopVoice(){if(!this.viewer){console.warn("startVoice:viewer is undefined");return}return await Hi(this.viewer)}async mountPakFiles(t){if(!this.viewer){console.warn("mountPakFiles:viewer is undefined");return}return await Ji(this.viewer,t)}async generateMemReport(){if(!this.viewer){console.warn("generateMemReport:viewer is undefined");return}return await Bi(this.viewer)}async quit(){if(!this.viewer){console.warn("Quit: viewer is undefined");return}return await xi(this.viewer)}async bindActorByTag(t,i){if(!this.viewer){console.warn("BindActorByTag: viewer is undefined");return}return await pn(this.viewer,t,i)}async restoreOriginalScene(){if(!this.viewer){console.warn("RestoreOriginalScene: viewer is undefined");return}return await fn(this.viewer)}async unBindActorByID(t){if(!this.viewer){console.warn("UnBindActorByID: viewer is undefined");return}return await wn(this.viewer,t)}async unBindActorByTag(t){if(!this.viewer){console.warn("UnBindActorByTag: viewer is undefined");return}return await yn(this.viewer,t)}async createActorByClass(t,i){if(!this.viewer){console.warn("CreateActorByClass: viewer is undefined");return}return await mn(this.viewer,t,i)}async bind3DTilesetByTag(t,i){if(!this.viewer){console.warn("Bind3DTilesetByTag: viewer is undefined");return}return await Cn(this.viewer,t,i)}async unBind3DTilesetByTag(t){if(!this.viewer){console.warn("UnBind3DTilesetByTag: viewer is undefined");return}return await En(this.viewer,t)}async unBind3DTilesetById(t){if(!this.viewer){console.warn("UnBind3DTilesetById: viewer is undefined");return}return await Sn(this.viewer,t)}async bindImageryByTag(t,i,n){if(!this.viewer){console.warn("BindImageryByTag: viewer is undefined");return}return await Fn(this.viewer,t,i,n)}async unBindImageryByTag(t,i){if(!this.viewer){console.warn("UnBindImageryByTag: viewer is undefined");return}return await In(this.viewer,t,i)}async unBindImageryById(t){if(!this.viewer){console.warn("UnBindImageryById: viewer is undefined");return}return await Tn(this.viewer,t)}async getIdByComponentNameAndHitItem(t,i,n){if(!this.viewer){console.warn("GetIdByComponentNameAndHitItem: viewer is undefined");return}return await Rn(this.viewer,t,i,n)}async getCameraRelativeHeight(t="ECC_Visibility"){if(!this.viewer){console.warn("GetCameraRelativeHeight: viewer is undefined");return}return await Dn(this.viewer,t)}async saveStringToFile(t,i,n){if(!this.viewer){console.warn("SaveStringToFile: viewer is undefined");return}return await Ln(this.viewer,t,i,n)}async highlightActorByTag(t,i=!0){if(!this.viewer){console.warn("HighlightActorByTag: viewer is undefined");return}return await Pn(this.viewer,t,i)}async sendCustomMessage(t){if(!this.viewer){console.warn("SendCustomMessage: viewer is undefined");return}return await Mn(this.viewer,t)}async getStatus(){if(!this.viewer){console.warn("GetStatus:viewer is undefined");return}return await Un(this.viewer)}async getTilesetMaterialIDList(){if(!this.viewer){console.warn("GetTilesetMaterialIDList:viewer is undefined");return}return await $n(this.viewer)}async pick(t,i,n){if(!this.viewer)return;let r=t;if(t&&window.ue&&this.container){const[o,s]=t,{x:u,y:a}=this.container.getBoundingClientRect();r=[u+o,a+s]}return await Oi(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,{x:o,y:s}=this.container.getBoundingClientRect();i=[o+n,s+r]}return await ji(this.viewer,i)}async quickPickPosition(t){return await this.pickPosition(t)}async flyIn(t,i=[0,0,0],n=1,r="default"){if(!this.viewer)return;const o=await x(this.viewer,void 0,t,i,n,r);if(o)return o.endType===0&&console.warn(`flyTo:flyTo is end! endType:${o.endType}`),o.endType===1&&console.warn(`flyTo:飞行中断! endType:${o.endType}`),o}async flyTo(t,i,n="default"){if(!this.viewer)return;const r=await K(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]],o=d.getGeoBoundingSphereFromPositions(r);if(!o)return;const{center:s,radius:u}=o,a={distance:i??u,heading:0,pitch:-90,flyDuration:n,hDelta:0,pDelta:0};this.flyTo(a,s)}getCurrentCameraInfo(){const{position:t,rotation:i}=this._statusInfo;return{position:t,rotation:i}}getLengthInPixel(){return this._statusInfo.length}async changeToWalk(t,i=4.2,n=1.6){if(!this.viewer)return;const r={mode:"Walk",position:t,jumpZVelocity:i,eyeHeight:n},o=await A(this.viewer,r);return o&&!o.error&&(this._navigationMode.value=r.mode),o}async changeToMap(){if(!this.viewer)return;const t={mode:"Map"},i=await A(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},o=await A(this.viewer,r);return o&&!o.error&&(this._navigationMode.value=r.mode),o}async changeToLine(t,i=10,n=10,r=!0,o=10,s="auto"){if(!this.viewer)return;const u={mode:"Line",geoLineStringId:t,speed:i,heightOffset:n,loop:r,turnRateDPS:o,lineMode:s},a=await A(this.viewer,u);return a&&!a.error&&(this._navigationMode.value=u.mode),a}async changeToUserDefined(t){if(!this.viewer)return;const i={mode:"UserDefined",userDefinedPawn:t},n=await A(this.viewer,i);return n&&!n.error&&(this._navigationMode.value=i.mode),n}async changeToRotatePoint(t,i=5e4,n=60,r=0,o=-30){if(!this.viewer)return;const s={mode:"RotatePoint",position:t,distance:i,orbitPeriod:n,heading:r,pitch:o},u=await A(this.viewer,s);return u&&!u.error&&(this._navigationMode.value=s.mode),u}async changeToFollow(t,i=0,n=0,r=-30,o=!0){if(!this.viewer)return;const s={mode:"Follow",objectId:t,distance:i,heading:n,pitch:r,relativeRotation:o},u=await A(this.viewer,s);return u&&!u.error&&(this._navigationMode.value=s.mode),u}getFPS(){return this._statusInfo.fps}async getVersion(){const t=window.g_XE3CopyRights??{};if(!this.viewer)return t;const i=await ln(this.viewer);return t.esforue=i,t}async getHeightByLonLat(t,i,n="ECC_Visibility"){if(!this.viewer)return null;const r=await tn(this.viewer,t,i,n);return r&&r.height!==void 0?r.height:null}async getHeightsByLonLats(t,i="ECC_Visibility"){return this.viewer?await en(this.viewer,t,i):void 0}async capture(t=64,i=64){return this.viewer?await nn(this.viewer,t,i):void 0}async partialCapture(t,i=[64,64]){if(!this.viewer){console.warn("partialCapture:viewer is undefined");return}return await rn(this.viewer,t,i)}async lonLatAltToScreenPosition(t){if(!this.viewer)return;const i=await on(this.viewer,t);return i&&[i.X,i.Y]}async setGlobalProperty(t){if(this.viewer)return await bi(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 o=Array.isArray(i)?[...i]:[i];return r.editingID=`${n.callSource}_${l.createGuid()}`,await An(this.viewer,r.id,r.editingID,o,n.useKeyToSwitch)}async stopEditing(){if(this.viewer)return await Wn(this.viewer)}async moveObjects(t){if(!this.viewer)return;const i=[],n=l.createGuid();for(let r=0;r<t.length;r++){const o=t[r],s=o.combinationClass?o.getMainClass():o;s.editingID=n,s&&i.push(s.id)}if(i.length!==0)return await _n(this.viewer,i,n)}getProperties(){return[...super.getProperties()]}};f(z,"type",z.register("ESUeViewer",z)),f(z,"defaults",{...Kn});let W=z;(h=>{h.createDefaultProps=()=>({...d.ESViewer.createDefaultProps(),...Ni(),resolutionScale:1,autoReconnect:!1,propChangedListening:void 0,objectEventListening:void 0,widgetEventListening:void 0,speechRecognitionListening:void 0,customMessageListening:void 0})})(W||(W={})),l.extendClassProps(W.prototype,W.createDefaultProps);class N extends d.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,o=Object.keys(r).filter(c=>n[c]!==null);o.push(...this.constructor.forceUeUpdateProps);const s=e.constructor.defaults,u={val:{}},a=[];for(let c of o){const p=c+"Changed",v=e[p];a.push(v);const m=n[c];if(m===null)throw console.error("vf === null error"),new Error("vf === null error");const C=()=>{const E=e[c]??s[c];let I=m?m(E,this,t,e):E;if(I===void 0){console.warn(`UE自动更新的属性,不应该为undefined! 属性名:${c} 对象名:${e.name} 对象id: ${e.id}`);return}u.val[c]=I};C(),this.d(v.don(C))}const y=()=>{i.callUeFunc({f:"update",p:{id:e.id,...u.val}}),u.val={}},w=this.dv(l.createNextAnimateFrameEvent(...a));this.d(w.don(y)),this.d(e.createdEvent.don(y)),this.d(e.flushEvent.don(()=>w.flush()))})),!e.combinationClass)){let n=!1;this.d(()=>{n&&ye(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(N,"propValFuncs",{ref:null,devTags:null,extras:null,execOnceFuncStr:null,updateFuncStr:null,toDestroyFuncStr:null}),f(N,"forceUeUpdateProps",[]);class P extends N{constructor(e,t){super(e,t);const i=t.viewer;i&&(this.d(e.flyToEvent.don(n=>{K(i,e.id,n)})),this.d(e.flyInEvent.don(n=>{var r,o;x(i,e.id,(r=e.flyInParam)==null?void 0:r.position,(o=e.flyInParam)==null?void 0:o.rotation,n??1)})),this.d(e.calcFlyToParamEvent.don(()=>{$(i,e.id)})),this.d(e.calcFlyInParamEvent.don(()=>{const n=t.getCurrentCameraInfo();if(!n)return;const{position:r,rotation:o}=n;e.flyInParam={position:r,rotation:o,flyDuration:1}})),this.d(t.propChanged.don(n=>{n.objId===e.id&&Object.keys(n.props).forEach(r=>{const o=n.props[r]===null?void 0:n.props[r];e[r]=o})})))}}class F extends P{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(l.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.editingChanged));this.d(r.don(()=>{setTimeout(n,0)})),this.d(e.smoothMoveEvent.don((u,a)=>{et(i,e.id,u,a)})),this.d(e.smoothMoveWithRotationEvent.don((u,a,y)=>{O(i,e.id,u,a,y)})),this.d(e.smoothMoveOnGroundEvent.don((u,a,y,w)=>{j(i,e.id,u,a,w,y)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((u,a,y,w,c)=>{tt(i,e.id,u,a,y,w,c)})),this.d(e.smoothMoveKeepPitchEvent.don(async(u,a)=>{const y=await i.callUeFunc({f:"SmoothMoveKeepPitch",p:{id:e.id,Destination:u,Time:a}});y.error&&console.error("SmoothMoveKeepPitch:",y.error)})),this.d(e.automaticLandingEvent.don(u=>{const a=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(y=>{y!==null&&(e.position=[...a,y],e.collision=u)})}));const o=async(u,a,y,w)=>{const{viewer:c}=u;if(!c){console.error("SmoothMoveRelatively: ueViewer.viewer is undefined");return}const p=await c.callUeFunc({f:"SmoothMoveRelatively",p:{id:a,RelativePosition:y,Time:w}});return p.error&&console.error("SmoothMoveRelatively:",p.error),p};this.d(e.smoothMoveRelativelyEvent.don((u,a)=>{o(t,e.id,u,a)}));const s=async(u,a,y,w,c)=>{const{viewer:p}=u;if(!p){console.error("SmoothMoveRelativelyWithRotation: ueViewer.viewer is undefined");return}const v=await p.callUeFunc({f:"SmoothMoveRelativelyWithRotation",p:{id:a,RelativePosition:y,NewRotation:w,Time:c}});return v.error&&console.error("SmoothMoveRelativelyWithRotation:",v.error),v};this.d(e.smoothMoveRelativelyWithRotationEvent.don((u,a,y)=>{s(t,e.id,u,a,y)}))}}class D extends P{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(l.createNextAnimateFrameEvent(e.pointsChanged,e.editingChanged));this.d(r.don(()=>{setTimeout(n,0)}))}}f(D,"propValFuncs",{...P.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 F{constructor(e,t){super(e,t),t.viewer&&this.d(t.widgetEvent.don(n=>{if(n.objId!==e.id)return;const{type:r,add:o}=n;e.widgetEvent.emit({type:r,add:o})}))}}class Ee extends F{constructor(e,t){super(e,t),t.viewer}}f(Ee,"propValFuncs",{...F.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 he extends Ee{constructor(e,t){super(e,t),t.viewer}}const zn=h=>{switch(h){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"没搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是3dTileset,无法绑定";default:return"未知错误"}},nt=class nt extends d.EngineObject{constructor(t,i){super(t,i);f(this,"_styleColor",this.dv(l.react([])));f(this,"_styleVisable",this.dv(l.react([])));const n=i.viewer;if(!n){console.warn("UeES3DTileset: viewer is undefined!");return}let r,o;const s=async()=>{!r&&!o||await n.callUeFunc({f:"update",p:{id:t.id,url:t.url,show:t.show,collision:t.collision,allowPicking:t.allowPicking,flyToParam:t.flyToParam??d.ESVisualObject.defaults.flyToParam,flyInParam:t.flyInParam??d.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}})},u=this.dv(l.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));s(),this.d(u.don(s)),Reflect.has(t,"colorMode")&&this.d(t.colorModeChanged.don(()=>s()));const a=this.dv(l.react(void 0));{const w=this.dv(l.createNextAnimateFrameEvent(t.actorTagChanged,t.urlChanged)),c=()=>{t.actorTag?a.value={type:"ActorTag",actorTag:t.actorTag}:t.url?a.value={type:"CreatedUrl",url:t.url}:a.value=void 0,t.editing=!1};c(),this.d(w.don(c))}const y=async()=>{const{id:w}=t;if(r!==void 0){r=void 0;try{const c=await i.unBind3DTilesetById(w);if(!c)return;if(c.error!==""){console.warn(`UeES3DTileset UnBind3DTilesetById: ${c.error}`);return}}catch(c){console.warn(`UeES3DTileset UnBind3DTilesetById: ${c}`);return}}if(o!==void 0){o=void 0;try{const c=await n.callUeFunc({f:"destroy",p:{id:w}});if(!c)return;if(c.error!==""){console.warn(`UeES3DTileset Destroy: ${c.error}`);return}}catch(c){console.warn(`UeES3DTileset Destroy: ${c}`);return}}};this.d(()=>{y()});{const w=this.dv(l.createProcessingFromAsyncFunc(async p=>{if(a.value===void 0){await p.promise(y());return}if(a.value.type==="ActorTag"){const{actorTag:v}=a.value;if(r!==v&&await p.promise(y()),r!==void 0||v===void 0)return;try{r=v;const m=await p.promise(i.bind3DTilesetByTag(t.id,v));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: ${zn(m.re.type)}`);else{console.warn(`UeES3DTileset Bind3DTilesetByTag: ${zn(m.re.type)}`);return}}catch(m){console.warn(`UeES3DTileset Bind3DTilesetByTag: ${m}`);return}}else if(a.value.type==="CreatedUrl"){const{url:v}=a.value;if(v!==o&&await y(),o!==void 0||v===void 0)return;try{o=v;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(s())})),c=async()=>{w.restart()};c(),this.d(a.changed.don(c))}this.d(t.refreshTilesetEvent.don(()=>{zi(n,t.id)})),this.d(t.flyToEvent.don(async(w,c)=>{if(!r&&!o)return;const p=await K(n,t.id,w);let v="over";p===void 0?v="error":p.endType===0?v="over":p.endType===1&&(v="cancelled"),t.flyOverEvent.emit(c,v,i)})),this.d(t.calcFlyToParamEvent.don(()=>{!r&&!o||$(n,t.id)})),this.d(t.calcFlyInParamEvent.don(async()=>{if(!r&&!o||!i.actived)return;const w=await i.getCurrentCameraInfo();if(!w)return;const{position:c,rotation:p}=w;t.flyInParam={position:c,rotation:p,flyDuration:1}})),this.d(i.propChanged.don(w=>{!r&&!o||w.objId===t.id&&Object.keys(w.props).forEach(c=>{const p=w.props[c]===null?void 0:w.props[c];t[c]=p})})),this.d(i.objectEvent.don(w=>{!r&&!o||w.id!==t.id||w.type!=="3DTilesetReady"||t.tilesetReady.emit(w.p)}));{const w=async(m,C)=>{if(!r&&!o)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}},c=async(m,C)=>{if(!r&&!o)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&&!o)return;const m=await n.callUeFunc({f:"ResetFeatureStyle",p:{id:t.id}});if(m&&m.error!==""){console.warn(`UeES3DTileset ResetFeatureStyle: ${m.error}`);return}},v=async m=>{if(!r&&!o)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],w(m,E)})),this.d(t.setFeatureVisableEvent.don((m,C)=>{const E=[...this.styleVisable,...C];this.styleVisable=[...E],c(m,E)})),this.d(t.resetFeatureStyleEvent.don(()=>{p(),this.styleColor=[],this.styleVisable=[]})),this.d(t.setFeatureStyleEvent.don(m=>{v(m)}))}{const w=async()=>{if(!r&&!o){t._featureTableResultEvent.emit(void 0);return}try{const c=await n.callUeFunc({f:"GetFeatureTable",p:{id:t.id}});c.error!==""&&console.warn(`UeES3DTileset GetFeatureTable: ${c.error}`),t._featureTableResultEvent.emit(c.re.table)}catch(c){console.warn(`UeES3DTileset GetFeatureTable: ${c}`),t._featureTableResultEvent.emit(void 0)}};this.d(t.getFeatureTableEvent.don(()=>{w()}))}{const w=async()=>{if(!r&&!o){t.getMaterialNameListEvent.emit(void 0);return}try{const c=await n.callUeFunc({f:"GetMaterialNameList",p:{id:t.id}});c.error!==""&&console.warn(`UeES3DTileset GetMaterialNameList: ${c.error}`),t.getMaterialNameListEvent.emit(c.re.materialNameList)}catch(c){console.warn(`UeES3DTileset GetMaterialNameList: ${c}`),t.getMaterialNameListEvent.emit(void 0)}};this.ad(t.getMaterialNameListEvent.don(c=>{c=="start"&&w()}))}}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(nt,"type",nt.register("ESUeViewer",d.ES3DTileset.type,nt));let ve=nt;const kn=h=>{switch(h){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"没搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag对应的Actor是地形,无法绑定";case 4:return"没搜索到ComponentTag,无法绑定";default:return"未知错误"}},rt=class rt extends d.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}let n,r;const o=this.dv(l.react(void 0)),s=this.ad(l.reactJson(""));{const w=()=>{if(typeof e.url=="string")s.value=d.ESSceneObject.context.getStrFromEnv(e.url);else{const c=e.url;c.url=d.ESSceneObject.context.getStrFromEnv(c.url),s.value=c}};w(),this.ad(e.urlChanged.don(w))}const u=async()=>{if(!n&&!r)return;let w=e.targetID??d.ESImageryLayer.defaults.targetID;if(w&&w!=""){const c=d.ESSceneObject.getSceneObject(w);w=c?c.getMainClass().id:w}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??d.ESVisualObject.defaults.flyToParam,flyInParam:e.flyInParam??d.ESVisualObject.defaults.flyInParam,url:s.value??"",zIndex:e.zIndex??0,maximumLevel:e.maximumLevel??d.ESImageryLayer.defaults.maximumLevel,minimumLevel:e.minimumLevel??d.ESImageryLayer.defaults.minimumLevel,options:e.options??d.ESImageryLayer.defaults.options,targetID:w,opacity:e.opacity??d.ESImageryLayer.defaults.opacity,splitDirection:e.splitDirection??d.ESImageryLayer.defaults.splitDirection}})},a=this.dv(l.createNextAnimateFrameEvent(e.showChanged,s.changed,e.flyToParamChanged,e.flyInParamChanged,e.zIndexChanged,e.collisionChanged,e.allowPickingChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.rectangleChanged,e.optionsChanged,e.targetIDChanged,e.opacityChanged,e.splitDirectionChanged));this.d(a.don(u));const y=async()=>{const{id:w}=e;if(n!==void 0){n=void 0;try{const c=await t.unBindImageryById(w);if(!c)return;if(c.error!==""){console.warn(`UeESImageryLayer UnImageryByID: ${c.error}`);return}}catch(c){console.warn(`UeESImageryLayer UnImageryByID promise: ${c}`);return}}if(r!==void 0){r=void 0;try{const c=await i.callUeFunc({f:"destroy",p:{id:w,test:"UeESImageryLayer"}});if(!c)return;if(c.error!==""){console.warn(`UeESImageryLayer Destroy: ${c.error}`);return}}catch(c){console.warn(`UeESImageryLayer Destroy promise: ${c}`);return}}};this.d(()=>{y()});{const w=this.dv(l.createProcessingFromAsyncFunc(async p=>{if(o.value===void 0){await p.promise(y());return}if(o.value.type==="ActorTag"){const{actorTag:v,componentTag:m}=o.value;if(n!==v&&await p.promise(y()),n!==void 0||v===void 0)return;try{n=v;const C=await p.promise(t.bindImageryByTag(e.id,v,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: ${kn(C.re.type)}`);else{console.warn(`ESImageryLayer BindImageryByTag: ${kn(C.re.type)}`);return}}catch(C){console.warn(`ESImageryLayer BindImageryByTag promise: ${C}`);return}}else if(o.value.type==="CreatedUrl"){const{url:v}=o.value;if(v!==r&&await p.promise(y()),r!==void 0||v===void 0)return;try{r=v;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(u())})),c=async()=>{w.restart()};c(),this.d(o.changed.don(c))}{const w=this.dv(l.createNextAnimateFrameEvent(e.actorTagChanged,s.changed,e.componentTagChanged)),c=()=>{e.actorTag&&e.componentTag?o.value={type:"ActorTag",actorTag:e.actorTag,componentTag:e.componentTag}:s.value?o.value={type:"CreatedUrl",url:s.value}:o.value=void 0};c(),this.d(w.don(c))}this.d(e.flyToEvent.don(async(w,c)=>{if(!n&&!r)return;const p=await K(i,e.id,w);let v="over";p===void 0?v="error":p.endType===0?v="over":p.endType===1&&(v="cancelled"),e.flyOverEvent.emit(c,v,t)})),this.d(e.flyInEvent.don(async(w,c)=>{var m,C;if(!n&&!r)return;const p=await x(i,e.id,(m=e.flyInParam)==null?void 0:m.position,(C=e.flyInParam)==null?void 0:C.rotation,w??1);let v="over";p===void 0?v="error":p.endType===0?v="over":p.endType===1&&(v="cancelled"),e.flyOverEvent.emit(c,v,t)})),this.d(e.calcFlyToParamEvent.don(()=>{!n&&!r||$(i,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const w=await t.getCurrentCameraInfo();if(!w)return;const{position:c,rotation:p}=w;e.flyInParam={position:c,rotation:p,flyDuration:1}})),this.d(t.propChanged.don(w=>{!n&&!r||w.objId===e.id&&Object.keys(w.props).forEach(c=>{const p=w.props[c]===null?void 0:w.props[c];e[c]=p})}))}};f(rt,"type",rt.register("ESUeViewer",d.ESImageryLayer.type,rt));let Se=rt;const k=class k extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(k,"type",k.register("ESUeViewer",d.ESTerrainLayer.type,k)),f(k,"forceUeUpdateProps",[...P.forceUeUpdateProps,"url"]),f(k,"propValFuncs",{...P.propValFuncs,url:e=>typeof e=="string"?d.ESSceneObject.context.getStrFromEnv(e):(e.url=d.ESSceneObject.context.getStrFromEnv(e.url),e),czmMaxzoom:null,czmMinzoom:null});let Fe=k;const ot=class ot extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ot,"type",ot.register("ESUeViewer",d.ESAlarm.type,ot));let Ie=ot;const st=class st extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(st,"type",st.register("ESUeViewer",d.ESApertureEffect.type,st));let Te=st;const at=class at extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(at,"type",at.register("ESUeViewer",d.ESGeoPolygon.type,at));let M=at;const lt=class lt extends M{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let o=d.ESAreaMeasurement.defaults.fillStyle;try{o={...e.fillStyle??d.ESAreaMeasurement.defaults.fillStyle}}catch(s){console.error("ESAreaMeasurement fillStyle 属性类型错误!",s),o={...d.ESAreaMeasurement.defaults.fillStyle}}o.materialParams=JSON.stringify(o.materialParams),i.callUeFunc({f:"update",p:{id:e.id,stroked:e.stroked??d.ESAreaMeasurement.defaults.stroked,fillStyle:o,filled:e.filled??d.ESAreaMeasurement.defaults.filled}}),console.log(o)},r=this.dv(l.createNextAnimateFrameEvent(e.fillStyleChanged,e.strokedChanged,e.filledChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};f(lt,"type",lt.register("ESUeViewer",d.ESAreaMeasurement.type,lt));let Re=lt;const dt=class dt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(dt,"type",dt.register("ESUeViewer",d.ESBlastParticleSystem.type,dt));let De=dt;const V=class V extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};f(V,"type",V.register("ESUeViewer",d.ESBoxClipping.type,V)),f(V,"propValFuncs",{...F.propValFuncs,targetID:e=>{if(!e)return"";const t=d.ESSceneObject.getSceneObject(e);return t?t.getMainClass().id:e}});let Le=V;const ct=class ct extends F{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,o="default")=>{const{id:s,duration:u,position:a,rotation:y}=e;x(i,s,a,y,u??n,o)})),this.dispose(e.resetWithCurrentCameraEvent.don(()=>{me(i,e.id)})),this.dispose(e.captureEvent.don((n,r)=>{t.capture(n,r).then(s=>{s&&(e.thumbnail=s)})}))}};f(ct,"type",ct.register("ESUeViewer",d.ESCameraView.type,ct));let Pe=ct;const ut=class ut extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ut,"type",ut.register("ESUeViewer",d.ESCameraVisibleRange.type,ut));let Me=ut;const ht=class ht extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ht,"type",ht.register("ESUeViewer",d.ESCar.type,ht));let Ue=ht;const vt=class vt extends D{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let o=d.ESClassification.defaults.fillStyle;try{o={...e.fillStyle??d.ESClassification.defaults.fillStyle}}catch(s){console.error("ESClassification fillStyle 属性类型错误!",s),o={...d.ESClassification.defaults.fillStyle}}o.materialParams=JSON.stringify(o.materialParams),i.callUeFunc({f:"update",p:{id:e.id,filled:e.filled??d.ESClassification.defaults.filled,fillStyle:o}})},r=this.dv(l.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};f(vt,"type",vt.register("ESUeViewer",d.ESClassification.type,vt));let Ae=vt;const X=class X extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};f(X,"type",X.register("ESUeViewer",d.ESClippingPlane.type,X)),f(X,"propValFuncs",{...F.propValFuncs,targetID:e=>{if(!e)return"";const t=d.ESSceneObject.getSceneObject(e);return t?t.getMainClass().id:e}});let We=X;const gt=class gt extends F{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=this.ad(l.reactJson(""));{const s=()=>{if(typeof e.url=="string")n.value=d.ESSceneObject.context.getStrFromEnv(e.url??d.ESDataMesh.defaults.url);else{const u=e.url;u.url=d.ESSceneObject.context.getStrFromEnv(u.url??d.ESDataMesh.defaults.url),n.value=u}};s(),this.ad(e.urlChanged.don(s))}const r=()=>{const s=e.colorStops??d.ESDataMesh.defaults.colorStops;i.callUeFunc({f:"update",p:{id:e.id,url:n.value??d.ESDataMesh.defaults.url,currentTime:e.currentTime??d.ESDataMesh.defaults.currentTime,minPropValue:e.minPropValue??d.ESDataMesh.defaults.minPropValue,maxPropValue:e.maxPropValue??d.ESDataMesh.defaults.maxPropValue,colorStops:JSON.stringify(s)}})},o=this.dv(l.createNextAnimateFrameEvent(n.changed,e.currentTimeChanged,e.minPropValueChanged,e.maxPropValueChanged,e.colorStopsChanged));this.d(o.don(r)),this.d(e.createdEvent.don(r))}};f(gt,"type",gt.register("ESUeViewer",d.ESDataMesh.type,gt));let _e=gt;const pt=class pt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(pt,"type",pt.register("ESUeViewer",d.ESDatasmithRuntimeModel.type,pt));let $e=pt;const ft=class ft extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ft,"type",ft.register("ESUeViewer",d.ESDirectionMeasurement.type,ft));let Ne=ft;const wt=class wt extends D{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let o;try{o={...e.strokeStyle??d.ESDistanceMeasurement.defaults.strokeStyle}}catch(s){console.error("ESDistanceMeasurement strokeStyle 属性类型错误!",s),o={...d.ESDistanceMeasurement.defaults.strokeStyle}}i.callUeFunc({f:"update",p:{id:e.id,strokeStyle:o}})},r=this.dv(l.createNextAnimateFrameEvent(e.strokeStyleChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};f(wt,"type",wt.register("ESUeViewer",d.ESDistanceMeasurement.type,wt));let ze=wt;const yt=class yt extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(yt,"type",yt.register("ESUeViewer",d.ESLocalPolygon.type,yt));let ge=yt;const mt=class mt extends ge{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(mt,"type",mt.register("ESUeViewer",d.ESDynamicWater.type,mt));let ke=mt;const Ct=class Ct extends P{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:o}=n;e.widgetEvent.emit({type:r,properties:o})}))}};f(Ct,"type",Ct.register("ESUeViewer",d.ESEntityCluster.type,Ct));let Ge=Ct;const q=class q extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(q,"type",q.register("ESUeViewer",d.ESExcavate.type,q)),f(q,"propValFuncs",{...M.propValFuncs,targetID:e=>{if(!e)return"";const t=d.ESSceneObject.getSceneObject(e);return t?t.getMainClass().id:e}});let He=q;const Et=class Et extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Et,"type",Et.register("ESUeViewer",d.ESFireParticleSystem.type,Et));let Je=Et;const St=class St extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=this.ad(l.reactJson(""));{const s=()=>{if(typeof e.url=="string")n.value=d.ESSceneObject.context.getStrFromEnv(e.url);else{const u=e.url;u.url=d.ESSceneObject.context.getStrFromEnv(u.url),n.value=u}};s(),this.ad(e.urlChanged.don(s))}const r=()=>{i.callUeFunc({f:"update",p:{id:e.id,url:n.value??d.ESForestTileset.defaults.url,treeTypes:e.treeTypes??d.ESForestTileset.defaults.treeTypes,xiaoBanWidget:e.xiaoBanWidget??d.ESForestTileset.defaults.xiaoBanWidgetDefault,youShiSZ:e.youShiSZ??d.ESForestTileset.defaults.youShiSZ,diLei:e.diLei??d.ESForestTileset.defaults.diLei,senLinLB:e.senLinLB??d.ESForestTileset.defaults.senLinLB,labelMaterial:e.labelMaterial??d.ESForestTileset.defaults.labelMaterial,heightOffset:e.heightOffset??d.ESForestTileset.defaults.heightOffset}})},o=this.dv(l.createNextAnimateFrameEvent(n.changed,e.treeTypesChanged,e.xiaoBanWidgetChanged,e.youShiSZChanged,e.diLeiChanged,e.senLinLBChanged,e.labelMaterialChanged,e.heightOffsetChanged));this.d(o.don(r)),this.d(e.createdEvent.don(r))}};f(St,"type",St.register("ESUeViewer",d.ESForestTileset.type,St));let Be=St;const Ft=class Ft extends d.EngineObject{constructor(e,t){super(e,t),this.ad(new l.ObjResettingWithEvent(e.renderInUEChanged,()=>e.renderInUE?new Hn(e,t):new Gn(e,t)))}};f(Ft,"type",Ft.register("ESUeViewer",d.ESGeoDiv.type,Ft));let Ke=Ft;class Gn extends l.Destroyable{constructor(t,i){super();f(this,"_screenPosition",this.disposeVar(l.reactArrayWithUndefined(void 0)));const n=i.viewer;if(!n){console.warn("viewer is undefined!");return}const r=this.disposeVar(new d.ESTextLabel);r.parentID=t.id,t.mainClass=r,i.add(r),this.dispose(()=>i.delete(r)),r.show=!1,this.dispose(l.bind([r,"position"],[t,"position"])),this.dispose(l.bind([r,"rotation"],[t,"rotation"])),this.dispose(l.bind([r,"flyToParam"],[t,"flyToParam"])),this.dispose(l.bind([r,"flyInParam"],[t,"flyInParam"])),this.dispose(t.calcFlyToParamEvent.disposableOn(()=>{$(n,r.id)})),this.dispose(t.calcFlyInParamEvent.disposableOn(async()=>{if(!i.actived)return;const u=await i.getCurrentCameraInfo();if(!u)return;const{position:a,rotation:y}=u;t.flyInParam={position:a,rotation:y,flyDuration:1}})),this.dispose(t.smoothMoveEvent.disposableOn((u,a)=>{et(n,r.id,u,a)})),this.dispose(t.smoothMoveWithRotationEvent.disposableOn((u,a,y)=>{O(n,r.id,u,a,y)})),this.dispose(t.smoothMoveOnGroundEvent.disposableOn((u,a,y,w)=>{j(n,r.id,u,a,w,y)})),this.dispose(t.smoothMoveWithRotationOnGroundEvent.disposableOn((u,a,y,w,c)=>{tt(n,r.id,u,a,y,w,c)})),this.dispose(t.flyToEvent.disposableOn((u,a)=>{r.flyTo(u)})),this.dispose(t.flyInEvent.don(u=>{r.flyIn(u)}));const o=this._screenPosition,s=this.disposeVar(new d.ESCustomDiv);s.parentID=t.id,i.add(s),this.dispose(()=>i.delete(s)),this.dispose(l.bind([s,"allowPicking"],[t,"allowPicking"]));{const u=this.disposeVar(l.createAnimateFrame()),a=()=>{t.show?u.restart(void 0,async()=>{if(!t.position)return;const y=await i.lonLatAltToScreenPosition(t.position);if(!this.isDestroyed())if(!y)this._screenPosition.value=void 0;else{const[w,c]=y;w===-1&&c===-1?this._screenPosition.value=void 0:this._screenPosition.value=[w,c]}}):u.cancel()};a(),this.dispose(t.showChanged.disposableOn(a))}{const u=()=>class extends l.Destroyable{constructor(c,p,v){if(super(),this._subContainer=c,!v)return;if(!t.instanceClass)throw new Error("!sceneObject.instanceClass");const m=new l.PosFloatDiv,C=m.element;this._subContainer.appendChild(C),this.dispose(()=>this._subContainer.removeChild(C)),C.onclick=E=>{(t.allowPicking??!1)&&t.pickedEvent.emit(new d.ESJPickedResult({div:C,pointerEvent:E},t,void 0,void 0,void 0,[E.x,E.y]))};{const E=()=>{t.editing?C.children[0].style.pointerEvents="none":C.children[0].style.pointerEvents="all"};E(),this.d(t.editingChanged.don(E))}{const E=()=>{const S=t.show;o.value&&S?(m.show=!0,m.winPos=[...o.value]):(m.show=!1,m.winPos=[0,0])};E();const I=this.disposeVar(l.createNextAnimateFrameEvent(t.showChanged,o.changed));this.dispose(I.disposableOn(E))}{const E=()=>{const[I,S]=t.anchor??d.ESGeoDiv.defaults.anchor;m.originRatioX=I,m.originRatioY=S};E(),this.dispose(t.anchorChanged.disposableOn(E))}{const E=()=>{m.opacity=t.opacity??d.ESGeoDiv.defaults.opacity};E(),this.dispose(t.opacityChanged.disposableOn(E))}this.disposeVar(new t.instanceClass(m.contentDiv,t,v))}},a=()=>{try{t.instanceClass?s.instanceClass=u():s.instanceClass=void 0}catch(w){console.error(w)}};a();const y=this.dv(l.createNextAnimateFrameEvent(t.instanceClassChanged,t.opacityChanged,t.anchorChanged,t.editingChanged,t.showChanged,t.allowPickingChanged));this.d(y.don(a))}}get screenPosition(){return this._screenPosition.value}get screenPositionChanged(){return this._screenPosition.changed}set screenPosition(t){this._screenPosition.value=t}}class Hn extends l.Destroyable{constructor(t,i){super();f(this,"_imageLabel");f(this,"_hasClassDivAndPos",{});this._imageLabel=this.dv(new d.ESImageLabel),this._imageLabel.isHoverZoom=!1,this._imageLabel.parentID=t.id;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 o=()=>{if(!n)return;if(!t.instanceClass)throw new Error("!sceneObject.instanceClass");const a=document.createElement("div"),y=this.dv(new t.instanceClass(a,t,i))._container;if(y.style.opacity=t.opacity.toString()??d.ESGeoDiv.defaults.opacity,y.style.position="fixed",y.style.zIndex="-1",y.style.top="0px",!document.body.contains(y)){document.body.appendChild(y);let c=y?y.querySelectorAll("*[class]"):[];for(let p=0;p<c.length;p++){const v=c[p];var w=v.getBoundingClientRect();this._hasClassDivAndPos[v.className]=[v.offsetLeft,v.offsetTop,v.offsetLeft+w.width,v.offsetTop+w.height]}}Bn(y,{backgroundColor:null,allowTaint:!0,useCORS:!0,width:y.offsetWidth,height:y.offsetHeight,scale:1}).then(c=>{document.body.contains(y)&&document.body.removeChild(y),r.url=c.toDataURL(),r.show=t.show}).catch(()=>{document.body.contains(y)&&document.body.removeChild(y)})},s=()=>{try{t.instanceClass?o():(r.url="",r.show=!1)}catch(a){console.error(a)}};s();const u=this.dv(l.createNextAnimateFrameEvent(t.instanceClassChanged,t.opacityChanged));this.d(u.don(s))}{const o=()=>{r.show=t.show};r.show=!1,this.ad(t.showChanged.don(o))}this.d(l.track([r,"anchor"],[t,"anchor"])),this.d(l.bind([r,"position"],[t,"position"])),this.d(l.bind([r,"rotation"],[t,"rotation"])),this.d(l.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(l.bind([r,"flyInParam"],[t,"flyInParam"])),this.d(l.bind([r,"allowPicking"],[t,"allowPicking"])),this.d(l.bind([r,"scale"],[t,"scale"])),this.d(l.track([r,"minVisibleDistance"],[t,"minVisibleDistance"])),this.d(l.track([r,"maxVisibleDistance"],[t,"maxVisibleDistance"])),this.ad(t.automaticLandingEvent.don(()=>{r.automaticLanding()})),this.d(i.widgetEvent.don(o=>{if(o.objId!==this._imageLabel.id)return;const{type:s,add:u}=o;if(s==="leftClick"&&u){const a=(u==null?void 0:u.classNames)??[],y=Object.keys(this._hasClassDivAndPos);for(let w=0;w<y.length;w++){const c=y[w];let p=this._hasClassDivAndPos[c];u&&u.mouseRelativePos&&u.mouseRelativePos[0]>=p[0]&&u.mouseRelativePos[0]<=p[2]&&u.mouseRelativePos[1]>=p[1]&&u.mouseRelativePos[1]<=p[3]&&a.push(c)}u.classNames=a}t.widgetEvent.emit({type:s,add:u})})),this.d(t.calcFlyToParamEvent.don(()=>{$(n,r.id)})),this.d(t.calcFlyInParamEvent.don(()=>{const o=i.getCurrentCameraInfo();if(!o)return;const{position:s,rotation:u}=o;t.flyInParam={position:s,rotation:u,flyDuration:1}})),this.d(t.smoothMoveEvent.don((o,s)=>{et(n,r.id,o,s)})),this.d(t.smoothMoveWithRotationEvent.don((o,s,u)=>{O(n,r.id,o,s,u)})),this.d(t.smoothMoveOnGroundEvent.don((o,s,u,a)=>{j(n,r.id,o,s,a,u)})),this.d(t.smoothMoveWithRotationOnGroundEvent.don((o,s,u,a,y)=>{tt(n,r.id,o,s,u,a,y)})),this.d(t.flyToEvent.don((o,s)=>{r.flyTo(o)})),this.d(t.flyInEvent.don(o=>{r.flyIn(o)}))}}const It=class It extends P{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,o)=>{i.callUeFunc({f:"flyToFeature",p:{id:e.id,key:n,value:r,duration:o}})}))}};f(It,"type",It.register("ESUeViewer",d.ESGeoJson.type,It));let Ve=It;const Tt=class Tt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Tt,"type",Tt.register("ESUeViewer",d.ESGeoLineString.type,Tt));let pe=Tt;const Rt=class Rt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Rt,"type",Rt.register("ESUeViewer",d.ESGeoRectangle.type,Rt));let Xe=Rt;const Dt=class Dt extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Dt,"type",Dt.register("ESUeViewer",d.ESGeoWater.type,Dt));let qe=Dt;const G=class G extends F{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)=>{Zi(i,e.id,n,r)})),this.d(e.setNodeRotationEvent.don((n,r)=>{Yi(i,e.id,n,r)})),this.d(e.setNodeScaleEvent.don((n,r)=>{Qi(i,e.id,n,r)}))}};f(G,"forceUeUpdateProps",[...F.forceUeUpdateProps,"url"]),f(G,"propValFuncs",{...F.propValFuncs,url:e=>typeof e=="string"?d.ESSceneObject.context.getStrFromEnv(d.rpToap(e)):(e.url=d.ESSceneObject.context.getStrFromEnv(d.rpToap(e.url)),e),czmMaximumScale:null,czmMinimumPixelSize:null,czmNativeScale:null,czmColor:null}),f(G,"type",G.register("ESUeViewer",d.ESGltfModel.type,G));let Ze=G;const Lt=class Lt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Lt,"type",Lt.register("ESUeViewer",d.ESHeightMeasurement.type,Lt));let Ye=Lt;const Pt=class Pt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=async(o,s,u,a)=>{const{viewer:y}=o;if(!y){console.error("AIMoveTo: ueViewer.viewer is undefined");return}const w=await y.callUeFunc({f:"AIMoveTo",p:{id:s,Destination:u,Time:a}});return w.error&&console.error("AIMoveTo:",w.error),w};this.d(e.aiMoveToEvent.don((o,s)=>{n(t,e.id,o,s)}));const r=async(o,s)=>{const{viewer:u}=o;if(!u){console.error("StopAIMove: ueViewer.viewer is undefined");return}const a=await u.callUeFunc({f:"StopAIMove",p:{id:s}});return a.error&&console.error("StopAIMove:",a.error),a};this.d(e.stopAIMoveEvent.don(()=>{r(t,e.id)}))}};f(Pt,"type",Pt.register("ESUeViewer",d.ESHuman.type,Pt));let Qe=Pt;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",d.ESImageLabel.type,H)),f(H,"forceUeUpdateProps",[...U.forceUeUpdateProps,"url"]),f(H,"propValFuncs",{...U.propValFuncs,url:e=>typeof e=="string"?d.ESSceneObject.context.getStrFromEnv(d.rpToap(e)):(e.url=d.ESSceneObject.context.getStrFromEnv(d.rpToap(e.url)),e)});let be=H;const Mt=class Mt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Mt,"type",Mt.register("ESUeViewer",d.ESLevelRuntimeModel.type,Mt));let xe=Mt;const Ut=class Ut extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Ut,"type",Ut.register("ESUeViewer",d.ESLocalCircle.type,Ut));let Oe=Ut;const At=class At extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(At,"type",At.register("ESUeViewer",d.ESLocalPolygonZ.type,At));let je=At;const Wt=class Wt extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Wt,"type",Wt.register("ESUeViewer",d.ESLocalRectangle.type,Wt));let ti=Wt;const _t=class _t extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(_t,"type",_t.register("ESUeViewer",d.ESLocalSkyBox.type,_t));let ei=_t;const $t=class $t extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f($t,"type",$t.register("ESUeViewer",d.ESLocationMeasurement.type,$t));let ii=$t;const Nt=class Nt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Nt,"type",Nt.register("ESUeViewer",d.ESPipeFence.type,Nt));let ni=Nt;const zt=class zt extends pe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(zt,"type",zt.register("ESUeViewer",d.ESPipeline.type,zt));let ri=zt;const kt=class kt extends ve{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;Ki(i,e.id,r)})),this.d(e.highlightFeatureAndFlyToEvent.don((n,r,o,s)=>{const u=typeof n=="number"?n.toString():n;Vi(i,e.id,u,s??1)})),this.d(e.setLayerVisibleEvent.don((n,r)=>{let o="";typeof r!="string"?o=JSON.stringify(r):o=r,Xi(i,e.id,o)})),this.d(e.setLayerColorEvent.don((n,r)=>{let o="";typeof r!="string"?o=JSON.stringify(r):o=r,qi(i,e.id,o)}))}};f(kt,"type",kt.register("ESUeViewer",d.ESPipeserTileset.type,kt));let oi=kt;const Gt=class Gt extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Gt,"type",Gt.register("ESUeViewer",d.ESPit.type,Gt));let si=Gt;const Ht=class Ht 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(Ht,"type",Ht.register("ESUeViewer",d.ESPoi2D.type,Ht));let ai=Ht;const Jt=class Jt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Jt,"type",Jt.register("ESUeViewer",d.ESPoi3D.type,Jt));let li=Jt;const J=class J extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(J,"type",J.register("ESUeViewer",d.ESPoiTileset.type,J)),f(J,"forceUeUpdateProps",[...P.forceUeUpdateProps,"url"]),f(J,"propValFuncs",{...P.propValFuncs,url:e=>typeof e=="string"?d.ESSceneObject.context.getStrFromEnv(e):(e.url=d.ESSceneObject.context.getStrFromEnv(e.url),e)});let di=J;const Bt=class Bt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Bt,"type",Bt.register("ESUeViewer",d.ESPolygonFence.type,Bt));let ci=Bt;const Z=class Z extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Z,"type",Z.register("ESUeViewer",d.ESPolygonFlattenedPlane.type,Z)),f(Z,"propValFuncs",{...M.propValFuncs,targetID:e=>{if(!e)return"";const t=d.ESSceneObject.getSceneObject(e);return t?t.getMainClass().id:e}});let ui=Z;const Kt=class Kt extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Kt,"type",Kt.register("ESUeViewer",d.ESPolygonWithHole.type,Kt));let hi=Kt;const Vt=class Vt extends N{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=s=>{s=s.toLocaleLowerCase();let u=[255,255,255,1];if(s.startsWith("#")){if(s.length===4){let a=parseInt(s[1]+s[1],16),y=parseInt(s[2]+s[2],16),w=parseInt(s[3]+s[3],16);u=[a,y,w,1]}else if(s.length===7){let a=parseInt(s.substring(1,3),16),y=parseInt(s.substring(3,5),16),w=parseInt(s.substring(5,7),16);u=[a,y,w,1]}}else if(s.startsWith("rgba")){let a=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/);if(a){let y=parseInt(a[1]),w=parseInt(a[2]),c=parseInt(a[3]),p=parseFloat(a[4]);u=[y,w,c,p]}}else if(s.startsWith("rgb")){let a=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);if(a){let y=parseInt(a[1]),w=parseInt(a[2]),c=parseInt(a[3]);u=[y,w,c,1]}}else console.error("color类型只能为#rrggbb、#rgb、rgba(r,g,b,a)、rgb(r,g,b)");return[u[0]/255,u[1]/255,u[2]/255,u[3]]},r=()=>{const s=e.layerConfig;if(!s)return;const u=[];s.forEach(a=>{s.filter(w=>w.dataset==a.dataset).length==1?u.push({condition:[{field:"dataset",op:"==",value:a.dataset}],color:n(a.value.color??"rgb(255,255,255)"),show:a.value.visible}):u.push({condition:[{field:"layer",op:"==",value:a.layer},{field:"dataset",op:"==",value:a.dataset}],color:n(a.value.color??"rgb(255,255,255)"),show:a.value.visible})}),e.setFeatureStyle(u)};r();const o=this.dv(l.createNextAnimateFrameEvent(e.layerConfigChanged,e.colorBlendModeChanged));this.d(o.don(()=>{r()}))}}};f(Vt,"type",Vt.register("ESUeViewer",d.ESRtsTileset.type,Vt));let vi=Vt;const Xt=class Xt extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(e.addTreesEvent.don(n=>{d.addTreesCallFunc(t,e.id,n)})),this.d(e.removeAllTreesEvent.don(()=>{d.removeAllTreesCallFunc(t,e.id)})),this.d(e.updateTreeParamsEvent.don(n=>{d.updateTreeParamsCallFunc(t,e.id,n)})),this.d(e.cutDownTreesEvent.don((n,r)=>{d.cutDownTreesCallFunc(t,e.id,n,r)})),this.d(e.growthSimulationEvent.don((n,r,o)=>{d.growthSimulationCallFunc(t,e.id,n,r,o)}))}};f(Xt,"type",Xt.register("ESUeViewer",d.ESSeparateFoliage.type,Xt));let gi=Xt;const qt=class qt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(qt,"type",qt.register("ESUeViewer",d.ESSubmergingAnalysis.type,qt));let pi=qt;const Zt=class Zt extends M{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(Zt,"type",Zt.register("ESUeViewer",d.ESSunshineAnalysis.type,Zt));let fi=Zt;const Yt=class Yt extends M{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(Yt,"type",Yt.register("ESUeViewer",d.ESSurfaceAreaMeasurement.type,Yt));let wi=Yt;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",d.ESTextLabel.type,Qt));let yi=Qt;const Y=class Y 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(async(n,r)=>{const o=await Ce(i,e.id,n,r);e.__callFunctionResultEvent.emit(o)}))}};f(Y,"type",Y.register("ESUeViewer",d.ESUEWidget.type,Y)),f(Y,"propValFuncs",{...U.propValFuncs,info:e=>JSON.stringify(e??{})});let mi=Y;const Jn=h=>{switch(h){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"未搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是场景原有的,而是新建的,无法绑定";case 4:return"搜索到ActorTag对应的Actor是地形或3DTileset,无法绑定";default:return"未知错误"}},vr=h=>{switch(h){case 0:return"创建成功";case 1:return"未找到对应的资源,无法创建";case 2:return"Id与场景中现有的ActorTag重复,创建后可能出现问题,创建失败";default:return"未知错误"}},bt=class bt extends d.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn(`${e.id} UeESUnrealActor viewer is undefined!`);return}this.d(()=>{ye(i,e.id)});const n=async()=>{a()||await i.callUeFunc({f:"update",p:{id:e.id,name:e.name,show:e.show,rotation:e.rotation,flyToParam:e.flyToParam??d.ESVisualObject.defaults.flyToParam,flyInParam:e.flyInParam??d.ESVisualObject.defaults.flyInParam,highlight:e.highlight,collision:e.collision,scale:e.scale,minVisibleDistance:e.minVisibleDistance,maxVisibleDistance:e.maxVisibleDistance}})},r=this.dv(l.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 o,s;const u=async()=>{a()||(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}`))},a=()=>!o&&!s?(console.warn(`${e.id} 未绑定ActorTag或未创建ActorClass!`),!0):!1,y=async()=>{const{id:c}=e,p=await t.unBindActorByID(c);p&&p.error!==""&&console.warn(`${e.id} UeESUnrealActor UnBindActorByID: ${p.error}`),o=void 0;const v=await i.callUeFunc({f:"destroy",p:{id:c}});if(v&&v.error!==""){console.warn(`${e.id} UeESUnrealActor DestroyActorByID: ${v.error}`);return}s=void 0},w=this.dv(l.react({type:"ActorClass",actorClass:"default"}));{const c=this.dv(l.createNextAnimateFrameEvent(e.actorClassChanged,e.actorTagChanged)),p=async()=>{e.actorTag!==""?w.value={type:"ActorTag",actorTag:e.actorTag}:w.value={type:"ActorClass",actorClass:e.actorClass===""?"default":e.actorClass}};p(),this.d(c.don(p)),this.d(e.flushEvent.don(()=>c.flush()))}{const c=this.dv(l.createProcessingFromAsyncFunc(async v=>{if(await v.promise(y()),w.value.type==="ActorTag"){const{actorTag:m}=w.value;await v.promise(y());try{e.lastActorStatus="null";const C=await v.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",o=m;else if(C.re.type===1)e.lastActorStatus="bound",o=m,console.warn(`${e.id} UeESUnrealActor BindActorByTag:${m},${Jn(C.re.type)}`);else{o=void 0,console.warn(`${e.id} UeESUnrealActor BindActorByTag error:${m}, ${Jn(C.re.type)}`);return}}catch(C){console.warn(`${e.id} UeESUnrealActor BindActorByTag catch error:${m}, ${C}`);return}}else if(w.value.type==="ActorClass"){const{actorClass:m}=w.value;try{const C=await v.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",s=m;else{console.warn(`${e.id} UeESUnrealActor CreateActorByClass error type :${m},${vr(C.re.type)}`);return}}catch(C){console.warn(`${e.id} UeESUnrealActor CreateActorByClass error catch :${m}, ${JSON.stringify(C)}`);return}}await v.promise(n()),await v.promise(u())})),p=async()=>{c.restart()};p(),this.d(w.changed.don(p))}this.d(e.positionChanged.don(u)),this.d(e.callFunctionEvent.don(async(c,p)=>{if(a()){e.__callFunctionResultEvent.emit(void 0);return}const v=await Ce(i,e.id,c,p);e.__callFunctionResultEvent.emit(v)})),this.d(e.smoothMoveEvent.don((c,p)=>{a()||et(i,e.id,c,p)})),this.d(e.smoothMoveWithRotationEvent.don((c,p,v)=>{a()||O(i,e.id,c,p,v)})),this.d(e.smoothMoveOnGroundEvent.don((c,p,v,m)=>{a()||j(i,e.id,c,p,m,v)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((c,p,v,m,C)=>{a()||tt(i,e.id,c,p,v,m,C)})),this.d(e.automaticLandingEvent.don(c=>{if(a())return;const p=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(v=>{v!==null&&(e.position=[...p,v],e.collision=c)})})),this.d(e.flyToEvent.don(async(c,p)=>{if(a())return;const v=await K(i,e.id,c);let m="over";v===void 0?m="error":v.endType===0?m="over":v.endType===1&&(m="cancelled"),e.flyOverEvent.emit(p,m,t)})),this.d(e.calcFlyToParamEvent.don(()=>{a()||$(i,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const c=await t.getCurrentCameraInfo();if(!c)return;const{position:p,rotation:v}=c;e.flyInParam={position:p,rotation:v,flyDuration:1}})),this.d(t.propChanged.don(c=>{a()||c.objId===e.id&&Object.keys(c.props).forEach(p=>{const v=c.props[p]===null?void 0:c.props[p];e[p]=v})}))}};f(bt,"type",bt.register("ESUeViewer",d.ESUnrealActor.type,bt));let Ci=bt;const xt=class xt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(xt,"type",xt.register("ESUeViewer",d.ESVideoFusion.type,xt));let Ei=xt;const Ot=class Ot extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Ot,"type",Ot.register("ESUeViewer",d.ESViewShed.type,Ot));let Si=Ot;const jt=class jt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};f(jt,"type",jt.register("ESUeViewer",d.ESVisibilityAnalysis.type,jt));let Fi=jt;const te=class te extends M{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.ad(l.track([e,"volume"],[e,"cutAndFillVolume"])),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(te,"type",te.register("ESUeViewer",d.ESVolumeMeasurement.type,te));let Ii=te;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",d.ESWidget.type,Q)),f(Q,"propValFuncs",{...U.propValFuncs,info:e=>JSON.stringify(e??{})});let Ti=Q;const ee=class ee extends d.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(ee,"type",ee.register("ESUeViewer",d.ESHumanPoi.type,ee));let Ri=ee;d.ESSceneObject.context.getStrFromEnv(d.ESNavigator.defaults.imgUrl);const ie=class ie extends d.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new d.ESCustomDiv);t.add(n),this.dispose(()=>t.delete(n)),this.dispose(l.track([n,"show"],[e,"show"])),n.instanceClass=class extends l.Destroyable{constructor(o,s,u){super(),this._subContainer=o;const a=document.createElement("div");this._subContainer.appendChild(a),this.dispose(()=>this._subContainer.removeChild(a));{const c=async()=>{const p=await t.getCurrentCameraInfo(),v=p==null?void 0:p.position,C=[...p==null?void 0:p.rotation];C[0]=360,t.flyIn(v,C)};a.addEventListener("click",c),a.style.cursor="pointer",this.dispose(()=>a.removeEventListener("click",c))}{const c=()=>{a.style.width=`${e.cssSize?e.cssSize:d.ESNavigator.defaults.cssSize}px`,a.style.height=`${e.cssSize?e.cssSize:d.ESNavigator.defaults.cssSize}px`};c(),e.dispose(e.cssSizeChanged.disposableOn(c))}a.style.position="fixed";{const c=()=>{a.style.top=`${e.cssPosition?e.cssPosition[0]:d.ESNavigator.defaults.cssPosition[0]}px`,a.style.right=`${e.cssPosition?e.cssPosition[1]:d.ESNavigator.defaults.cssPosition[1]}px`};c(),e.dispose(e.cssPositionChanged.disposableOn(c))}a.style.transition=" right 0.4s linear",a.style.cursor="pointer";const y=document.createElement("div");a.appendChild(y),this.dispose(()=>a.removeChild(y)),y.style.width="100%",y.style.height="100%",y.style.position="relative";const w=document.createElement("img");y.appendChild(w),this.dispose(()=>y.removeChild(w)),w.style.width="100%",w.style.height="100%",w.style.border="none";{const c=()=>w.src=e.imgUrl;c(),e.dispose(e.imgUrlChanged.disposableOn(c))}{const c=()=>{const C=-t.getCurrentCameraInfo().rotation[0];w.style.transform=`rotate(${C}deg)`};let p;const v=async()=>{c(),e.show?(a.style.display="block",p=setInterval(()=>{c()},1e3)):(a.style.display="none",clearInterval(p))};this.dispose(e.showChanged.disposableOn(v)),v(),this.dispose(()=>clearInterval(p))}w.style.transformOrigin="50% 50%"}}}};f(ie,"type",ie.register("ESUeViewer",d.ESNavigator.type,ie));let Di=ie;const B=class B extends D{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(B,"type",B.register("ESUeViewer",d.ESPath.type,B)),f(B,"forceUeUpdateProps",[...D.forceUeUpdateProps]),f(B,"propValFuncs",{...D.propValFuncs,materialMode:null});let Li=B;async function gr(h){navigator.clipboard.writeText(h).then(function(){console.log("复制成功")},function(e){console.log("复制失败")})}const ne=class ne extends d.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new d.ESCustomDiv);t.add(n),this.dispose(()=>t.delete(n)),n.instanceClass=class extends l.Destroyable{constructor(o,s,u){if(super(),this._subContainer=o,!u||!(u instanceof W))return;const a=document.createElement("div");this._subContainer.appendChild(a),this.dispose(()=>this._subContainer.removeChild(a)),a.style.width="100%",a.style.position="absolute",a.style.height=`${d.ESViewerStatusBar.defaults.height}px`,a.style.left="0",a.style.bottom="0",a.style.color="#fff",a.style.padding="0 20px 0 0",a.style.boxSizing="border-box",a.style.lineHeight=`${d.ESViewerStatusBar.defaults.height}px`,a.style.zIndex="100",a.style.alignContent="center",a.style.justifyContent="space-between";const y=document.createElement("span");a.appendChild(y),this.dispose(()=>a.removeChild(y));const w=document.createElement("span");y.appendChild(w),this.dispose(()=>y.removeChild(w));const c=document.createElement("span");y.appendChild(c),c.addEventListener("dblclick",function(){let v=c.innerHTML;v.startsWith("鼠标位置")&&(v=v.slice(5)),gr(v)}),c.style.cursor="pointer",this.dispose(()=>y.removeChild(c));const p=document.createElement("span");a.appendChild(p),this.dispose(()=>a.removeChild(p));{const v=()=>{a.style.height=(e.height??d.ESViewerStatusBar.defaults.height)+"px",a.style.lineHeight=(e.height??d.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(v)),v()}{const v=()=>{a.style.fontSize=(e.fontSize??d.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(v)),v()}{const v=()=>{e.bgColor?a.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:a.style.background=`rgba(${d.ESViewerStatusBar.defaults.bgColor[0]},${d.ESViewerStatusBar.defaults.bgColor[1]},${d.ESViewerStatusBar.defaults.bgColor[2]},${d.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(v)),v()}u.getVersion().then(v=>{v&&(p.innerText=`Ue 版本 : ${v[0]} `)}).catch(v=>{console.log(v)});{const v=()=>{let E="",I="";E+=`帧率:${u.getFPS().toFixed(0)}FPS`,w.innerText=E;const S=t.getCurrentCameraInfo();E+=` 经度: ${S.position[0].toFixed(5)}° 纬度: ${S.position[1].toFixed(5)}° 高度: ${S.position[2].toFixed(2)}米 偏航角: ${S.rotation[0].toFixed(2)}° 俯仰角: ${S.rotation[1].toFixed(2)}° 翻滚角:${S.rotation[2].toFixed(2)}° `,w.innerText=E,t.pick().then(R=>{if(R){const{pickResult:T}=R;if(T&&T.position){const{position:_}=T;I+=`鼠标位置:${_[0].toFixed(5)}° ${_[1].toFixed(5)}° ${_[2].toFixed(2)}m`}else I+="暂时无法获取鼠标位置...";c.innerText=I}}).catch(R=>{console.log(R)})};let m;const C=async()=>{v(),e.show?(a.style.display="flex",m=setInterval(()=>{v()},1e3)):(a.style.display="none",clearInterval(m))};this.dispose(e.showChanged.disposableOn(C)),C(),this.dispose(()=>clearInterval(m))}}}}};f(ne,"type",ne.register("ESUeViewer",d.ESViewerStatusBar.type,ne));let Pi=ne;const re=class re extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(re,"type",re.register("ESUeViewer",d.ESGaussianSplatting.type,re));let Mi=re;const oe=class oe extends N{constructor(t,i){super(t,i);f(this,"_es3DTileset",this.dv(new d.ES3DTileset));if(!i.viewer){console.warn("viewer is undefined!");return}this.es3DTileset.parentID=t.id,t.mainClass=this._es3DTileset;{const r=this._es3DTileset;i.add(r),this.dispose(()=>i.delete(r)),this.d(l.track([r,"allowPicking"],[t,"allowPicking"])),this.d(l.track([r,"collision"],[t,"collision"])),this.d(l.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(l.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(l.track([r,"url"],[t,"url"])),this.d(l.track([r,"actorTag"],[t,"actorTag"])),this.d(l.track([r,"materialMode"],[t,"materialMode"])),this.d(l.track([r,"highlight"],[t,"highlight"])),this.d(l.track([r,"maximumScreenSpaceError"],[t,"maximumScreenSpaceError"])),this.d(l.track([r,"highlightID"],[t,"highlightID"])),this.d(l.track([r,"highlightColor"],[t,"highlightColor"])),this.d(l.bind([r,"offset"],[t,"offset"])),this.d(l.bind([r,"rotation"],[t,"rotation"])),this.d(l.track([r,"czmImageBasedLightingFactor"],[t,"czmImageBasedLightingFactor"])),this.d(l.track([r,"czmLuminanceAtZenith"],[t,"czmLuminanceAtZenith"])),this.d(l.track([r,"czmMaximumMemoryUsage"],[t,"czmMaximumMemoryUsage"])),this.d(l.track([r,"czmClassificationType"],[t,"czmClassificationType"])),this.d(l.track([r,"czmStyleJson"],[t,"czmStyleJson"])),this.d(l.track([r,"czmBackFaceCulling"],[t,"czmBackFaceCulling"])),this.d(l.track([r,"czmDebugShowBoundingVolume"],[t,"czmDebugShowBoundingVolume"])),this.d(l.track([r,"czmDebugShowContentBoundingVolume"],[t,"czmDebugShowContentBoundingVolume"])),this.d(l.track([r,"colorBlendMode"],[t,"colorBlendMode"])),this.d(l.track([r,"cacheBytes"],[t,"cacheBytes"])),this.d(l.track([r,"clippingPlaneEnabled"],[t,"clippingPlaneEnabled"])),this.d(l.track([r,"unionClippingRegions"],[t,"unionClippingRegions"])),this.d(l.track([r,"clippingPlaneEdgeColor"],[t,"clippingPlaneEdgeColor"])),this.d(l.track([r,"clippingPlaneEdgeWidth"],[t,"clippingPlaneEdgeWidth"])),this.d(l.track([r,"materialParams"],[t,"materialParams"])),this.d(l.bind([r,"supportEdit"],[t,"supportEdit"])),this.d(l.bind([r,"clippingPlanesId"],[t,"clippingPlanesId"])),this.d(l.bind([r,"clippingPlaneIds"],[t,"clippingPlaneIds"])),this.d(l.bind([r,"flattenedPlaneId"],[t,"flattenedPlaneId"])),this.d(l.bind([r,"flattenedPlaneEnabled"],[t,"flattenedPlaneEnabled"])),this.d(l.bind([r,"clippingPlaneId"],[t,"clippingPlaneId"])),this.d(l.bind([r,"excavateId"],[t,"excavateId"]))}{const r=this._es3DTileset;this.d(t.refreshTilesetEvent.don(()=>{r.refreshTileset()})),this.d(t.highlightFeatureEvent.don((...o)=>{r.highlightFeature(...o)})),this.d(t.highlightFeatureAndFlyToEvent.don((...o)=>{r.highlightFeatureAndFlyTo(...o)})),this.d(t.setFeatureColorEvent.don((...o)=>{r.setFeatureColor(...o)})),this.d(t.setFeatureVisableEvent.don((...o)=>{r.setFeatureVisable(...o)})),this.d(t.resetFeatureStyleEvent.don((...o)=>{r.resetFeatureStyle(...o)})),this.d(t.flyInEvent.don((...o)=>{r.flyIn(o[0])})),this.d(t.flyToEvent.don((...o)=>{r.flyTo(o[0])})),this.d(t.calcFlyToParamEvent.don((...o)=>{r.calcFlyToParam(...o)})),this.d(t.calcFlyInParamEvent.don((...o)=>{r.calcFlyInParam(...o)}))}{const r=this._es3DTileset;this.d(r.tilesetReady.don(o=>{t.tilesetReady.emit(o)})),this.d(r.pickedEvent.don(o=>{o.assign({sceneObject:t}),t.pickedEvent.emit(o)}))}{const r=()=>{this.es3DTileset.show=t.show};r(),this.d(t.showChanged.don(()=>{r()}))}}get es3DTileset(){return this._es3DTileset}};f(oe,"type",oe.register("ESUeViewer",d.ESRtsFeatureEditing.type,oe));let Ui=oe;const se=class se extends N{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(se,"type",se.register("ESUeViewer",d.ESMsTileset.type,se));let Ai=se;const ae=class ae extends M{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??d.ESGeoExtrudedPolygon.defaults.height,extrudedHeight:e.extrudedHeight??d.ESGeoExtrudedPolygon.defaults.extrudedHeight,perPositionHeight:e.perPositionHeight??d.ESGeoExtrudedPolygon.defaults.perPositionHeight}})},r=this.disposeVar(l.createNextAnimateFrameEvent(e.heightChanged,e.extrudedHeightChanged,e.perPositionHeightChanged));this.dispose(r.disposableOn(n)),this.dispose(e.createdEvent.disposableOn(n))}};f(ae,"type",ae.register("ESUeViewer",d.ESGeoExtrudedPolygon.type,ae));let Wi=ae;const le=class le extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(le,"type",le.register("ESUeViewer",d.ESStaticMesh.type,le));let _i=le;const de=class de extends D{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(de,"type",de.register("ESUeViewer",d.ESSkylineAnalysis.type,de));let $i=de;g.copyright=void 0;try{const h="earthsdk3-ue",e="3.3.0-beta.4",t="2025-08-09T09:17:14.000Z",i="北京西部世界科技有限公司",n="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="0726e990dfd959605c6040b45cc99223148fee71",s=((Date.now()-1754731034e3)/36e5).toFixed(1),u=`%c🌏 ${h}%c ${e}.${r.slice(0,8)}.${t} (距今${s}个小时)
|
|
1
|
+
(function(g,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("earthsdk3"),require("xbsj-base"),require("@epicgames-ps/lib-pixelstreamingfrontend-ue5.2"),require("html2canvas")):typeof define=="function"&&define.amd?define(["exports","earthsdk3","xbsj-base","@epicgames-ps/lib-pixelstreamingfrontend-ue5.2","html2canvas"],d):(g=typeof globalThis<"u"?globalThis:g||self,d(g.EarthSDK3_UE={},g.EarthSDK3,g.xbsj_base,g.libPixelstreamingfrontendUe5_2,g.html2canvas))})(this,function(g,d,l,L,Bn){"use strict";var Cr=Object.defineProperty;var Er=(g,d,l)=>d in g?Cr(g,d,{enumerable:!0,configurable:!0,writable:!0,value:l}):g[d]=l;var f=(g,d,l)=>Er(g,typeof d!="symbol"?d+"":d,l);const Kn={...d.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??""},Ni=()=>({...d.ESViewer.createCommonProps(),apiKey:"",apiUrl:"",secretKey:"",speechVoiceMode:"",geoReferenceOrigin:l.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 ce(){const h=Ni(),e=[];return Object.keys(h).forEach(t=>{e.push(t)}),e}function we(h){const{defaults:e}=W,t=ce(),i={};return t.forEach(n=>{i[n]=h[n]??e[n]}),i}const K=async(h,e,t,i,n,r="default")=>{const o=await h.callUeFunc({f:"flyTo",p:{id:e,duration:t,flyToParam:i,position:n,flyMode:r}});if(o.error){console.error(o.error);return}return o.re},ye=async(h,e)=>{const t=await h.callUeFunc({f:"destroy",p:{id:e}});return t.error&&console.error(t.error),t},$=(h,e)=>{h.callUeFunc({f:"calcFlyToParam",p:{id:e}}).then(t=>{t.error&&console.error("calcFlyToParam:",t.error)}).catch(t=>{console.error("calcFlyToParam:",t)})},zi=(h,e)=>{h.callUeFunc({f:"refreshTileset",p:{id:e}}).then(t=>{t.error&&console.error("refreshTileset:",t.error)}).catch(t=>{console.error("refreshTileset:",t)})},x=async(h,e,t,i,n,r="default")=>{const o=await h.callUeFunc({f:"flyIn",p:{id:e,position:t,rotation:i,duration:n,flyMode:r}});if(o.error){console.error(o.error);return}return o.re},ki=async(h,e)=>{if(!h){console.warn("DefaultCameraFlyIn: viewer is undefined");return}const t=await h.callUeFunc({f:"DefaultCameraFlyIn",p:{Duration:e??1}});if(t.error){console.error("DefaultCameraFlyIn:",t.error);return}return t},Gi=async h=>{if(!h){console.warn("StartVoice:viewer is undefined");return}const e=await h.callUeFunc({f:"StartVoice",p:{}});if(e.error){console.error("StartVoice:",e.error);return}return e},Hi=async h=>{if(!h){console.warn("StopVoice:viewer is undefined");return}const e=await h.callUeFunc({f:"StopVoice",p:{}});if(e.error){console.error("StopVoice:",e.error);return}return e},Ji=async(h,e)=>{if(!h){console.warn("mountPakFiles:viewer is undefined");return}const t=await h.callUeFunc({f:"MountPakFiles",p:{json:e}});if(t.error){console.error("mountPakFiles:",t.error);return}return t},Bi=async h=>{if(!h){console.warn("generateMemReport:viewer is undefined");return}const e=await h.callUeFunc({f:"GenerateMemReport",p:{}});if(e.error){console.error("generateMemReport:",e.error);return}return e},me=async(h,e)=>{const t=await h.callUeFunc({f:"resetWithCurrentCamera",p:{id:e}});return t.error&&console.error("resetWithCurrentCamera:",t.error),t},O=(h,e,t,i,n)=>{h.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)})},j=(h,e,t,i,n,r)=>{h.callUeFunc({f:"smoothMoveOnGround",p:{id:e,Lon:t,Lat:i,Ground:n,Time:r}}).then(o=>{o.error&&console.error("smoothMoveOnGround:",o.error)}).catch(o=>{console.error("smoothMoveOnGround:",o)})},tt=(h,e,t,i,n,r,o)=>{h.callUeFunc({f:"smoothMoveWithRotationOnGround",p:{id:e,NewRotation:t,Lon:i,Lat:n,Time:r,Ground:o}}).then(s=>{s.error&&console.error("smoothMoveWithRotationOnGround:",s.error)}).catch(s=>{console.error("smoothMoveWithRotationOnGround:",s)})},Ki=(h,e,t)=>{h.callUeFunc({f:"HighlightFeature",p:{id:e,HlId:t}}).then(i=>{i.error&&console.error("HighlightFeature:",i.error)}).catch(i=>{console.error("HighlightFeature:",i)})},Vi=(h,e,t,i)=>{h.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)})},Xi=(h,e,t)=>{h.callUeFunc({f:"SetLayerVisible",p:{id:e,LayerJson:t}}).then(i=>{i.error&&console.error("SetLayerVisible:",i.error)}).catch(i=>{console.error("SetLayerVisible:",i)})},qi=(h,e,t)=>{h.callUeFunc({f:"SetLayerColor",p:{id:e,LayerJson:t}}).then(i=>{i.error&&console.error("SetLayerColor:",i.error)}).catch(i=>{console.error("SetLayerColor:",i)})},et=(h,e,t,i)=>{h.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)})},Ce=async(h,e,t,i)=>{const n=await h.callUeFunc({f:"callFunction",p:{id:e,fn:t,p:i}});return n.error&&(console.error("callFunction:",n.error),console.error(`id: ${e} fn: ${t} param: ${i}`)),n.re??void 0},Zi=(h,e,t,i)=>{h.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)})},Yi=(h,e,t,i)=>{h.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=(h,e,t,i)=>{h.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)})},A=async(h,e)=>{do{if(e.mode=="Follow"){const i=d.ESSceneObject.getSceneObject(e.objectId);e.objectId=i?i.getMainClass().id:e.objectId;break}if(e.mode=="Line"){const i=d.ESSceneObject.getSceneObject(e.geoLineStringId);e.geoLineStringId=i?i.getMainClass().id:e.geoLineStringId;break}}while(!1);const t=await h.callUeFunc({f:"ChangeNavigationMode",p:e});if(t.error){console.error("ChangeNavigationMode:",t.error);return}return t},bi=async(h,e)=>{const t=await h.callUeFunc({f:"setGlobalProperty",p:e});if(t.error){console.error("setGlobalProperty:",t.error);return}return t},xi=async h=>{const e=await h.callUeFunc({f:"Quit",p:void 0});if(e.error){console.error("Quit:",e.error);return}return e},Oi=async(h,e,t,i)=>{console.log("pickCallFunc",e,t,i);const n=await h.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,o,s=r?d.ESSceneObject.getSceneObject(r):void 0;return s&&s.parentID&&(s=d.ESSceneObject.getSceneObject(s.parentID)),o=new d.ESJPickedResult(n.re,s,n.re.features,n.re.add,t,e),s&&Reflect.has(s,"allowPicking")&&Reflect.has(s,"pickedEvent")&&(s.allowPicking??!1)&&s.pickedEvent.emit(o),s&&Reflect.has(s,"allowPicking")&&!s.allowPicking?new d.ESJPickedResult:o},ji=async(h,e)=>{const t=await h.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},tn=async(h,e,t,i="ECC_Visibility")=>{const n=await h.callUeFunc({f:"GetHeightByLonLat",p:{Lon:e,Lat:t,Channel:i}});if(n.error){console.warn(`GetHeightByLonLat:${n.error}`);return}return n.re},en=async(h,e,t="ECC_Visibility")=>{const i=await h.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}},nn=async(h,e=64,t=64)=>{const i=await h.callUeFunc({f:"capture",p:{resx:e,resy:t}});if(i.error){console.warn(i.error);return}return i.re.image},rn=async(h,e,t=[64,64])=>{const i=await h.callUeFunc({f:"partialCapture",p:{startPos:e,size:t}});if(i.error){console.warn(i.error);return}return i.re.image},on=async(h,e)=>{const t=await h.callUeFunc({f:"LonLatAltToScreenPosition",p:{LonLatAlt:e}});return t.error&&console.warn(t.error),t.re},sn=async(h,e)=>{const t=await h.callUeFunc({f:"UEPositionToLonLatAlt",p:{UEPosition:e}});if(t.error){console.warn(t.error);return}return[...t.re.LonLatAlt]},an=async(h,e)=>{const t=await h.callUeFunc({f:"GetAllSocketNamesByActorTag",p:{ActorTag:e}});if(t.error){console.warn(t.error);return}return[...t.re.socketNames]},ln=async h=>{const e=await h.callUeFunc({f:"GetVersion",p:void 0});if(e.error){console.warn("GetVersion:",e.error);return}return e.re.version},dn=async(h,e)=>{const t=await h.callUeFunc({f:"GetBoundSphere",p:{id:e}});if(t.error){console.warn(t.error);return}return t.re},cn=async(h,e)=>{const t=await h.callUeFunc({f:"GetBoundSphereWithChildren",p:{id:e}});if(t.error){console.warn(`GetBoundSphereWithChildren:${t.error}`);return}return t.re},un=async(h,e)=>{const t=await h.callUeFunc({f:"GetStrokeMaterialParamInfo",p:{id:e}});if(t.error){console.warn(`GetStrokeMaterialParamInfo:${t.error}`);return}return t.re},hn=async(h,e)=>{const t=await h.callUeFunc({f:"GetFillMaterialParamInfo",p:{id:e}});if(t.error){console.warn(`GetFillMaterialParamInfo:${t.error}`);return}return t.re},vn=async(h,e)=>{const t=await h.callUeFunc({f:"getGlobalProperty",p:{props:e}});if(t.error){console.warn(`getGlobalProperty:${t.error}`);return}return t.re},gn=async(h,e)=>{const t=await h.callUeFunc({f:"GetObjectByInfo",p:{info:e}});if(t.error){console.warn(`GetObjectByInfo:${t.error}`);return}return t.re},pn=async(h,e,t)=>await h.callUeFunc({f:"BindActorByTag",p:{ID:e,ActorTag:t}}),fn=async h=>await h.callUeFunc({f:"RestoreOriginalScene",p:void 0}),wn=async(h,e)=>await h.callUeFunc({f:"UnBindActorByID",p:{ID:e}}),yn=async(h,e)=>await h.callUeFunc({f:"UnBindActorByTag",p:{ActorTag:e}}),mn=async(h,e,t)=>await h.callUeFunc({f:"CreateActorByClass",p:{ID:e,ActorClass:t}}),Cn=async function(h,e,t){return await h.callUeFunc({f:"Bind3DTilesetByTag",p:{ID:e,ActorTag:t}})},En=async function(h,e){return await h.callUeFunc({f:"UnBind3DTilesetByTag",p:{ActorTag:e}})},Sn=async function(h,e){return await h.callUeFunc({f:"UnBind3DTilesetById",p:{ID:e}})},Fn=async function(h,e,t,i){return await h.callUeFunc({f:"BindImageryByTag",p:{ID:e,ActorTag:t,ComponentTag:i}})},In=async function(h,e,t){return await h.callUeFunc({f:"UnBindImageryByTag",p:{ActorTag:e,ComponentTag:t}})},Tn=async function(h,e){return await h.callUeFunc({f:"UnBindImageryById",p:{ID:e}})},Rn=async function(h,e,t,i){return await h.callUeFunc({f:"GetIdByComponentNameAndHitItem",p:{id:e,ComponentName:t,HitItem:i}})},Dn=async function(h,e="ECC_Visibility"){return await h.callUeFunc({f:"GetCameraRelativeHeight",p:{Channel:e}})},Ln=async function(h,e,t,i){const n=await h.callUeFunc({f:"SaveStringToFile",p:{String:e,Path:t??"undefine",File:i??"data.txt"}});return n.error!==""&&console.warn("SaveStringToFile: ",n.error),n},Pn=async function(h,e,t=!0){const i=await h.callUeFunc({f:"HighlightActorByTag",p:{ActorTag:e,Highlight:t}});return i.error!==""&&console.warn("HighlightActorByTag: ",i.error),i},Mn=async function(h,e){const t=await h.callUeFunc({f:"SendCustomMessage",p:{Message:e}});return t.error!==""&&console.warn("SendCustomMessage: ",t.error),t},Un=async function(h){const e=await h.callUeFunc({f:"GetStatus",p:void 0});if(e.error){console.warn(`GetStatus:${e.error}`);return}return e.re},An=async(h,e,t,i,n=!0)=>{const r=await h.callUeFunc({f:"startEditing",p:{sceneObjectID:e,editingID:t,modes:i,useKeyToSwitch:n}});if(r.error){console.error("startEditing:",r.error);return}return r},Wn=async h=>{const e=await h.callUeFunc({f:"stopEditing",p:void 0});if(e.error){console.error("stopEditing:",e.error);return}return e},_n=async(h,e,t)=>{const i=await h.callUeFunc({f:"moveObjects",p:{sceneObjectIDs:e,editingID:t}});if(i.error){console.error("moveObjects:",i.error);return}return i},$n=async h=>{const e=await h.callUeFunc({f:"GetTilesetMaterialIDList",p:void 0});if(e.error){console.error("GetTilesetMaterialIDList:",e.error);return}return e.re.materialIDList};class it extends l.Destroyable{}const Vn={Response:1},ue={UIInteraction:50,MouseWheel:75};class Xn extends l.HasOwner{constructor(t,i){super(t);f(this,"_processResponseFn",t=>this.esUeViewer.processResponse(t));f(this,"_inner");this._uri=i,this._inner=new WebSocket(this._uri),this.d(()=>{this._inner.close()}),this._innerInit()}get esUeViewer(){return this.owner}get uri(){return this._uri}get inner(){return this._inner}_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,o=new Uint32Array(r),s=0;if(o[0]===Vn.Response){s+=4;let u=o[s/4];s+=4;for(let a=0;a<u;a++){let y=o[s/4];s+=4;let w=new TextDecoder("utf-8").decode(r.slice(s,s+y));s+=y,this._processResponseFn(w)}}},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"})))}}sendInputData(t){const i=this.inner;if(i.readyState!==WebSocket.OPEN)return;const r=new Uint8Array(t)[0];if(r>=ue.UIInteraction&&r<=ue.MouseWheel){const o=new ArrayBuffer(t.byteLength+4);return new DataView(o).setUint32(0,t.byteLength,!0),new Uint8Array(o,4).set(new Uint8Array(t)),i.send(new DataView(o)),!0}else return!1}emitDescriptorWithString(t,i){let n=new TextEncoder().encode(i),r=new DataView(new ArrayBuffer(3+n.length)),o=0;r.setUint8(o,t),o++,r.setUint16(o,n.length,!0),o+=2;for(let s=0;s<n.length;s++)r.setUint8(o,n[s]),o+=1;try{this.sendInputData(r.buffer)}catch(s){console.error(`data.buffer.size: ${r.buffer.byteLength} 独立通道 sendInputData error: ${s}`,s)}}destroyImpl(){this._inner&&this._inner.close()}}window.g_emitDescriptor_maxBytes=3e4;let qn=-1;L.Logger.SetLoggerVerbosity(1);class Zn extends l.Destroyable{constructor(t,i){super();f(this,"_eventTarget",new EventTarget);f(this,"debug",!1);f(this,"uiInteractionCallbacks",new Map);f(this,"_pixelStream");f(this,"_esMsgWsWrapper");this._domOrDomId=t,this._options=i;const n=typeof this._domOrDomId=="string"?document.getElementById(this._domOrDomId):this._domOrDomId;if(!n)throw new Error(`ESUEViewer container${this._domOrDomId} error!`);console.log(`PSUEViewer init _options ${this._options}`);const{url:r,esmsgWsUri:o}=this._options;this._pixelStream=this._initPixelStream(n,r),this.d(()=>{this._pixelStream.disconnect()}),this._handerPixelStreamEvent(),this._esMsgWsWrapper=this._initEsMsgWsWrapper(o);const s=this;if(s.esMsgWsWrapper){const u=s.webRtcController.sendMessageController.dataChannelSender.sendData;s.webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData=function(a){s.esMsgWsWrapper?s.esMsgWsWrapper.sendInputData(a):u.call(this,a)}}}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)}_initPixelStream(t,i){const n=new L.Config({initialSettings:{AutoPlayVideo:!0,AutoConnect:!0,StartVideoMuted:!1,SuppressBrowserKeys:!1,[L.TextParameters.SignallingServerUrl]:i}});return n.setFlagEnabled(L.Flags.BrowserSendOffer,!1),n.setFlagEnabled(L.Flags.HoveringMouseMode,!0),n.setFlagEnabled(L.Flags.MatchViewportResolution,!0),n.setNumericSetting(L.NumericParameters.MaxReconnectAttempts,0),new L.PixelStreaming(n,{videoElementParent:t})}get pixelStream(){return this._pixelStream}_initEsMsgWsWrapper(t){return t?this.dv(new Xn(this,t)):void 0}get esMsgWsWrapper(){return this._esMsgWsWrapper}get esWebSocketReady(){var t;return((t=this.esMsgWsWrapper)==null?void 0:t.inner.readyState)===1}_handerPixelStreamEvent(){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",t=>{this.processResponse(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)}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=l.createGuid(),this.uiInteractionCallbacks.set(t.callid,i)),this.pixelStream.emitUIInteraction(t)}get webRtcController(){return this.pixelStream._webRtcController}emitUIInteractionForBigData(t,i){typeof i=="function"&&(t.callid=l.createGuid(),this.uiInteractionCallbacks.set(t.callid,i));const n=JSON.stringify(t),r=window.g_emitDescriptor_maxBytes,o=n.length,s=++qn;if(this.esMsgWsWrapper){if(o<r){this.esMsgWsWrapper.emitDescriptorWithString(ue.UIInteraction,`${s}-0/1-`+n);return}const u=Math.ceil(o/r)|0;[...new Array(u).keys()].map(y=>n.slice(y*r,(y+1)*r)).forEach((y,w)=>{this.esMsgWsWrapper&&this.esMsgWsWrapper.emitDescriptorWithString(ue.UIInteraction,`${s}-${w}/${u}-`+y)})}}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 Yn extends l.Destroyable{constructor(t,i,n){super();f(this,"_instance");f(this,"_event",this.dv(new l.Event));this._container=t,this._wsuri=i,this._esmsgWsUri=n,this._instance=this.dv(new Zn(this._container,{url:this._wsuri,esmsgWsUri:this._esmsgWsUri})),this.instanceInit()}get webSocketReady(){return this._instance.esWebSocketReady}get event(){return this._event}get debug(){return this._instance.debug}set debug(t){this._instance.debug=t}instanceInit(){if("addEventListener"in this._instance){["esmsgwsopen","error","videoinited","ueevent","webRtcConnected"].forEach(i=>{const n=r=>{this._event.emit(i,r.detail)};this._instance.addEventListener(i,n),this.dispose(()=>this._instance.removeEventListener(i,n))});return}this.dispose(this._instance.errorEvent.disposableOn(t=>{this._event.emit("error",t.detail)})),this.dispose(this._instance.webRtcConnectedEvent.disposableOn(t=>{this._event.emit("webRtcConnected",t.detail)})),this.dispose(this._instance.videoinitedEvent.disposableOn(t=>{this._event.emit("videoinited",t.detail)})),this.dispose(this._instance.ueevent.disposableOn(t=>{this._event.emit("ueevent",t.detail)}))}emitUIInteractionForBigData(t,i){return new Promise((n,r)=>{const o=(...s)=>{n(s),i&&i(...s)};try{this._instance.emitUIInteractionForBigData(t,o)}catch(s){console.warn(`emitUIInteraction发生错误:${s}`),r(s)}})}getVideoSize(){return this._instance.getVideoSize()}resize(t,i){this._instance.resizeUEVideo(t,i)}}class Qn extends it{constructor(t,i,n,r){super();f(this,"_esueViewerWrapper");f(this,"_ueFuncResultWithIdsEvent",this.dv(new l.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Set);f(this,"_ueEvent",this.dv(new l.Event));f(this,"_errorEvent",this.dv(new l.Event));f(this,"_readyEvent",this.dv(new l.Event));f(this,"_esmsgwsopen",this.dv(l.react(!1)));f(this,"_videoinited",this.dv(l.react(!1)));f(this,"_webRtcConnected",this.dv(l.react(!1)));this._ueViewer=r,console.log("CSTMPSViewer init ! 以官方像素流 + 独立通信的模式启动!");const o=this._ueViewer;this._esueViewerWrapper=this.dv(new Yn(t,i,n));const s=this._esueViewerWrapper;{const p=()=>s.debug=o.debug??!1;p(),this.d(o.debugChanged.don(p))}let u=!1;{const p=()=>{if(u)return;const v=s.webSocketReady;if(this.videoinited&&this.webRtcConnected&&v){console.log("%c[EarthSDK: esmsgWebSocket && videoinited && webRtcConnected]","background: #a6ec99; color: black");const m={eventType:"init",params:{}};s.emitUIInteractionForBigData(m),this._readyEvent.emit(),u=!0}};this.d(this.videoinitedChanged.don(()=>{p()})),this.d(this.webRtcConnectedChanged.don(()=>{p()})),this.d(this.esmsgwsopenChanged.don(()=>{p()}))}this.d(s.event.don((p,v)=>{if(p==="error")this._errorEvent.emit(v);else if(p==="ueevent"){const m=JSON.parse(v);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(l.createAnimateFrame());let v,m;p.start(()=>{if(v!==t.offsetWidth||m!==t.offsetHeight){if(v=t.offsetWidth,m=t.offsetHeight,v===void 0||m===void 0||!Number.isFinite(v)||!Number.isFinite(m)||v<0||m<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${v} ${m}`);return}s.resize(v,m),console.log(`resize: ${v} ${m}`)}})}this.d(this._ueFuncResultWithIdsEvent.don(p=>{for(const v of p){const m=this._waitingUeFuncIdAndResultCallbacks.get(v.fid);m&&(this._waitingUeFuncIdAndResultCallbacks.delete(v.fid),m.resultCallback(v.r))}}));let a=0;const y=p=>{const v={n:a++,tt:Date.now(),t:"c",fs:p};this._waitingUeCalls.add(v),o.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(v,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd()),this._esueViewerWrapper.emitUIInteractionForBigData(v,()=>{this._waitingUeCalls.delete(v)})},w=()=>{if(!u||this._ueFuncWithIdAndResultCallbacks.length===0)return;const p=this._ueFuncWithIdAndResultCallbacks.map(([v])=>v);for(const[v,m]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(v.fid,m);this._ueFuncWithIdAndResultCallbacks.length=0;{const v=window.g_emitDescriptor_maxBytes,m=p.map(R=>({f:R,s:JSON.stringify(R).length}));let C=m.length,E=0,I=0,S=[];do{do{const{f:R,s:T}=m[E];if(S.push(R),++E,I+T>v||S.length>=20)break}while(E<C);S.length>0&&(o.debug&&console.log(`传送${S.length}条消息...`),y([...S]),S.length=0,I=0)}while(E<C)}};this.dv(l.createInterval()).start(w,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:l.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=l.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},o=this._ueEvent.don(s=>{s.et===t&&s.eid===n&&i(s)});return()=>{o(),r()}}}function bn(h){let e="";const t=new Uint8Array(h),i=t.length;for(let n=0;n<i;n++)e+=String.fromCharCode(t[n]);return btoa(e)}const xn=h=>{const e={type:"input",inputdata:bn(h)};return JSON.stringify(e)};function On(h){return typeof h=="string"?document.getElementById(h):h}window.g_emitDescriptor_maxBytes=3e4,console.log("全局可设置消息体最大字节, window.g_emitDescriptor_maxBytes 默认 30000 。");let jn=-1;L.Logger.SetLoggerVerbosity(1);class tr extends l.Destroyable{constructor(t,i){super();f(this,"debug",!1);f(this,"_error",this.dv(new l.Event));f(this,"_connected",this.dv(new l.Event));f(this,"_ueevent",this.dv(new l.Event));f(this,"_pixelStream");f(this,"uiInteractionCallbacks",new Map);this._container=t,this._option=i;const n=new L.Config({initialSettings:{HoveringMouse:!0,AutoPlayVideo:!0,AutoConnect:!0,StartVideoMuted:!1,SuppressBrowserKeys:!1,ss:this._option.ws},useUrlParams:!0});n.setFlagEnabled(L.Flags.BrowserSendOffer,!1),n.setFlagEnabled(L.Flags.HoveringMouseMode,!0),n.setFlagEnabled(L.Flags.MatchViewportResolution,!0),n.setNumericSetting(L.NumericParameters.MaxReconnectAttempts,0),this._pixelStream=new L.PixelStreaming(n,{videoElementParent:this.container}),this.d(()=>{this._pixelStream.disconnect()});{const r=this.pixelStream.webSocketController.webSocket,o=this._pixelStream._webRtcController.sendMessageController.dataChannelSender.sendData;this._pixelStream._webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData=function(s){r?r.send(xn(s)):o.call(this,s)}}{const r=o=>{const s=this._pixelStream._webRtcController.mouseController;setTimeout(()=>{const u=s.coordinateConverter.normalizeAndQuantizeUnsigned(o.offsetX,o.offsetY),y=s.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp");y&&y([o.button,u.x,u.y]),o.preventDefault()})};this.container.addEventListener("dblclick",r),this.d(()=>{this.container.removeEventListener("dblclick",r)})}["error","close","open"].forEach(o=>{const s=()=>{this.isDestroyed()||(o==="open"?this.connected.emit("webSocketOpen"):o==="close"?this.error.emit("webSocketClose"):o==="error"&&this.error.emit("webSocketError"))};this.pixelStream.webSocketController.webSocket.addEventListener(o,s),this.d(()=>{this.pixelStream.webSocketController.webSocket.removeEventListener(o,s)})}),["videoInitialized","webRtcConnected","webRtcDisconnected","webRtcFailed"].forEach(o=>{const s=()=>{this.isDestroyed()||(o==="webRtcConnected"||o==="videoInitialized"?this.connected.emit(o):(o==="webRtcDisconnected"||o==="webRtcFailed")&&(this.error.emit(o),this.pixelStream.disconnect()))};this.pixelStream.addEventListener(o,s),this.d(()=>{this.pixelStream.removeEventListener(o,s)})}),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 On(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=l.createGuid(),this.uiInteractionCallbacks.set(t.callid,i));const n=JSON.stringify(t),r=window.g_emitDescriptor_maxBytes??3e4,o=n.length,s=++jn;if(o<r){const y={type:"earthsdk",time:new Date().getTime(),params:`${s}-0/1-`+n};this.sendData(JSON.stringify(y));return}const u=Math.ceil(o/r)|0;[...new Array(u).keys()].map(y=>n.slice(y*r,(y+1)*r)).forEach((y,w)=>{const c={type:"earthsdk",time:new Date().getTime(),params:`${s}-${w}/${u}-`+y};this.sendData(JSON.stringify(c))})}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 er extends l.Destroyable{constructor(t,i,n){super();f(this,"_instance");f(this,"_event",this.dv(new l.Event));this._container=t,this._wsuri=i,this._esmsgWsUri=n,this._instance=this.dv(new tr(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 o=(...s)=>{n(s),i&&i(...s)};try{this._instance.emitUIInteractionForBigData(t,o)}catch(s){console.warn(`emitUIInteraction发生错误:${s}`),r(s)}})}getVideoSize(){return this._instance.getVideoSize()}resize(t,i){this._instance.resizeUEVideo(t,i)}}class ir extends it{constructor(t,i,n,r){super();f(this,"_videoInitialized",this.dv(l.react(!1)));f(this,"_webRtcConnected",this.dv(l.react(!1)));f(this,"_webSocketOpen",this.dv(l.react(!1)));f(this,"_ue5ViewerWrapper");f(this,"_ueFuncResultWithIdsEvent",this.dv(new l.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Set);f(this,"_ueEvent",this.dv(new l.Event));f(this,"_errorEvent",this.dv(new l.Event));f(this,"_readyEvent",this.dv(new l.Event));this._ueViewer=r,console.log("INNPSViewer init ! 以内置信令服务器模式启动!");const o=this._ueViewer,s=this.dv(new er(t,i,n));this._ue5ViewerWrapper=s;{const c=()=>s.debug=o.debug??!1;c(),this.d(o.debugChanged.don(c))}{let c=!1;const p=this.dv(l.createNextAnimateFrameEvent(this._videoInitialized.changed,this._webRtcConnected.changed,this._webSocketOpen.changed));this.d(p.don(()=>{if(c)return;const v=this._ue5ViewerWrapper.instance.webSocketReady;if(this.videoInitialized&&this.webRtcConnected&&v){this._ue5ViewerWrapper.instance.emitUIInteraction(),this._readyEvent.emit(),c=!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",v),c=!1}))}this.d(s.event.don((c,p)=>{if(c==="errorEvent")this._errorEvent.emit(p);else if(c==="videoInitialized")this._videoInitialized.value=!0;else if(c==="webRtcConnected")this._webRtcConnected.value=!0;else if(c==="webSocketOpen")this._webSocketOpen.value=!0;else if(c==="ueevent"){const v=JSON.parse(p);if(v.t==="cr"){const m=v;if(m.frs&&this._ueFuncResultWithIdsEvent.emit(m.frs),m.ers)for(let C of m.ers)this._ueEvent.emit(C)}}}));{const c=this.dv(l.createAnimateFrame());let p,v,m;c.start(()=>{if(p!==t.offsetWidth||v!==t.offsetHeight||m!==o.resolutionScale){if(p=t.offsetWidth,v=t.offsetHeight,p===void 0||v===void 0||!Number.isFinite(p)||!Number.isFinite(v)||p<0||v<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${p} ${v}`);return}m=o.resolutionScale,s.resize(p/m,v/m)}})}this.d(this._ueFuncResultWithIdsEvent.don(c=>{for(const p of c){const v=this._waitingUeFuncIdAndResultCallbacks.get(p.fid);v&&(this._waitingUeFuncIdAndResultCallbacks.delete(p.fid),v.resultCallback(p.r))}}));let u=0;const a=c=>{const p={n:u++,tt:Date.now(),t:"c",fs:c};this._waitingUeCalls.add(p),o.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)})},y=()=>{if(!this._ue5ViewerWrapper.instance.webSocketReady||this._ueFuncWithIdAndResultCallbacks.length===0)return;const p=this._ueFuncWithIdAndResultCallbacks.map(([v])=>v);for(const[v,m]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(v.fid,m);this._ueFuncWithIdAndResultCallbacks.length=0;{const v=window.g_emitDescriptor_maxBytes,m=p.map(R=>({f:R,s:JSON.stringify(R).length}));let C=m.length,E=0,I=0,S=[];do{do{const{f:R,s:T}=m[E];if(S.push(R),++E,I+T>v||S.length>=20)break}while(E<C);S.length>0&&(o.debug&&console.log(`传送${S.length}条消息...`),a([...S]),S.length=0,I=0)}while(E<C)}};this.dv(l.createInterval()).start(y,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:l.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,{timeStamp:Date.now(),ueFunc:t,resultCallback:i}])})}disposableOnUeEvent(t,i){const n=l.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},o=this._ueEvent.don(s=>{s.et===t&&s.eid===n&&i(s)});return()=>{o(),r()}}}class nr extends l.Destroyable{constructor(t,i,n,r){super();f(this,"_onRuntimeInitialized",this.dv(new l.Event));f(this,"_vIframe",null);this._ueViewer=r;const o=this._ueViewer;{const s=document.createElement("iframe");this._vIframe=s,s.style.cssText="width: 100%; height: 100%; margin: 0; padding: 0; border: none; outline: none;",t.appendChild(s),this.d(()=>{s&&t.removeChild(s)});const u=d.ESSceneObject.getStrFromEnv(n+`/web/${i}.html`);s.src=u,s.onload=()=>{const a=s.contentWindow;if(!a){console.error("iframeWindow is null");return}console.log("iwindow.Module",a.Module),a.Module.onRuntimeInitialized=()=>{this._onRuntimeInitialized.emit(),o.setStatus("Created"),o.setStatusLog("创建成功"),a.Module.UE4_resizeCanvas(),a.console.log("创建成功__________________________________________")}}}}get onRuntimeInitialized(){return this._onRuntimeInitialized}get vIframe(){return this._vIframe}}const Nn=typeof TextDecoder<"u"?new TextDecoder:void 0,rr=(h,e=0,t=NaN)=>{const i=e+t;let n=e;for(;h[n]&&!(n>=i);)++n;if(n-e>16&&h.buffer&&Nn)return Nn.decode(h.subarray(e,n));let r="";for(;e<n;){var o=h[e++];if(!(o&128)){r+=String.fromCharCode(o);continue}var s=h[e++]&63;if((o&224)==192){r+=String.fromCharCode((o&31)<<6|s);continue}var u=h[e++]&63;if((o&240)==224?o=(o&15)<<12|s<<6|u:((o&248)!=240&&console.warn("Invalid UTF-8 leading byte encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),o=(o&7)<<18|s<<12|u<<6|h[e++]&63),o<65536)r+=String.fromCharCode(o);else{var a=o-65536;r+=String.fromCharCode(55296|a>>10,56320|a&1023)}}return r};class or extends l.Destroyable{constructor(e,t,i){super();{const n=()=>{const u=we(t);t.setGlobalProperty(u)};n();const r=ce(),o=[];r.forEach(u=>{const a=t[u+"Changed"];o.push(a)});const s=this.dv(l.createNextAnimateFrameEvent(...o));this.d(s.don(n))}this.d(t.propChanged.don(n=>{if(n.objId==="")try{Object.keys(n.props).forEach(r=>{const o=n.props[r]===null?void 0:n.props[r];t[r]=o})}catch(r){console.error("ueViewer propChanged:"+r)}})),t.useCustomInteraction=!1,this.dv(new d.ViewerCustomInteraction(t,e)),this.dv(new l.ObjResettingWithEvent(t.statusUpdateIntervalChanged,n=>{if((t.statusUpdateInterval??.5)===0)return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("statusUpdate",s=>{t.statusUpdateEvent.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.propChangedListeningChanged,()=>{if(!(t.propChangedListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("propChanged",o=>{t.propChanged.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(t.objectEventListeningChanged,()=>{if(!(t.objectEventListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("objectEvent",o=>{t.objectEvent.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(t.widgetEventListeningChanged,()=>{if(!(t.widgetEventListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("widgetEvent",o=>{t.widgetEvent.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(t.speechRecognitionListeningChanged,()=>{if(!(t.speechRecognitionListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("speechRecognition",o=>{t.speechRecognition.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(t.customMessageListeningChanged,()=>{if(!(t.customMessageListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("customMessage",o=>{t.customMessage.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(t.editingEventListeningChanged,()=>{if(!(t.editingEventListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("editingEvent",o=>{o.objectIDs=o.objectIDs.map(s=>{var u;return((u=d.ESSceneObject.getSceneObjById(s))==null?void 0:u.parentID)??s}),t.editingEvent.emit(o)})),r}))}}let sr=-1;class ar extends it{constructor(t,i,n="${earthsdk3-ue-h5-assets-script-dir}",r){super();f(this,"_ueFuncResultWithIdsEvent",this.dv(new l.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Map);f(this,"_ueEvent",this.dv(new l.Event));this._ueViewer=r;const o=this._ueViewer,s=this.dv(new nr(t,i,n,o));let u=!1,a=null;this.d(s.onRuntimeInitialized.don(()=>{var p;if(u=!0,(p=s==null?void 0:s.vIframe)!=null&&p.contentWindow){a=s.vIframe.contentWindow;const v=s.vIframe.contentWindow.document.getElementById("mainarea");v?this.dv(new or(v,o,this)):console.error("h5Container is null")}else{console.error("iframeWindow is null");return}a.UE_JSHTML5Communication?a.UE_JSHTML5Communication.UESendMessageToJS=v=>{try{const m=rr(a.HEAPU8,v),C=JSON.parse(m);if(o.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 v of p){const m=this._waitingUeFuncIdAndResultCallbacks.get(v.fid);m&&(this._waitingUeFuncIdAndResultCallbacks.delete(v.fid),m(v.r))}}));let y=0;const w=()=>{if(!u||!a||!a.UE_JSHTML5Communication||!a.UE_JSHTML5Communication.JSSendMessageToUE||this._ueFuncWithIdAndResultCallbacks.length===0)return;const p=this._ueFuncWithIdAndResultCallbacks.map(([T])=>T),v={n:y++,tt:Date.now(),t:"c",fs:p,callid:l.createGuid()};for(const[T,_]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(T.fid,_);this._ueFuncWithIdAndResultCallbacks.length=0,this._waitingUeCalls.set(v.callid,v),o.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(v,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd());const m=JSON.stringify(v),C=window.g_emitDescriptor_maxBytes??3e4,E=m.length,I=++sr;if(E<C){const T=`${I}-0/1-`+m;a.UE_JSHTML5Communication.JSSendMessageToUE(T);return}const S=Math.ceil(E/C)|0;[...new Array(S).keys()].map(T=>m.slice(T*C,(T+1)*C)).forEach((T,_)=>{const fe=`${I}-${_}/${S}-`+T;a.UE_JSHTML5Communication.JSSendMessageToUE(fe)})};this.dv(l.createInterval()).start(w,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:l.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,i])})}disposableOnUeEvent(t,i){const n=l.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},o=this._ueEvent.disposableOn(s=>{s.et===t&&s.eid===n&&((this._ueViewer.debug??!1)&&console.log(`callback, type:${t} eid:${n} ueEvent:${JSON.stringify(s)}`),i(s))});return()=>{o(),r()}}}let lr=-1;class dr extends it{constructor(t,i){super();f(this,"_ueFuncResultWithIdsEvent",this.dv(new l.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Set);f(this,"_ueEvent",this.dv(new l.Event));this._ueViewer=i;const n=this._ueViewer;let r=!1;const o={eventType:"init",params:{}};window.ue.es.oncommand(JSON.stringify(o)),r=!0,window.calljs=(y,w)=>{if(n.debug&&console.log(`calljs eventName:${y} eventDetailStr:${w}`),y==="ueevent"||y==="commanFinish")try{const c=JSON.parse(w);if(c.t==="cr"){const p=c;if(p.frs&&this._ueFuncResultWithIdsEvent.emit(p.frs),p.ers)for(let v of p.ers)this._ueEvent.emit(v)}}catch(c){console.error(c)}},this.dispose(this._ueFuncResultWithIdsEvent.disposableOn(y=>{for(const w of y){const c=this._waitingUeFuncIdAndResultCallbacks.get(w.fid);c&&(this._waitingUeFuncIdAndResultCallbacks.delete(w.fid),c(w.r))}}));let s=0;const u=()=>{if(!r||this._ueFuncWithIdAndResultCallbacks.length===0)return;const y=this._ueFuncWithIdAndResultCallbacks.map(([p])=>p),w={n:s++,tt:Date.now(),t:"c",fs:y};for(const[p,v]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(p.fid,v);this._ueFuncWithIdAndResultCallbacks.length=0,this._waitingUeCalls.add(w),n.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(w,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd());const c=++lr;window.ue.es.oncommand(`${c}-0/1-`+JSON.stringify(w)).then(()=>{this._waitingUeCalls.delete(w)})};this.dv(l.createInterval()).start(u,50)}callUeFunc(t){return new Promise(i=>{const r={fid:l.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,i])})}disposableOnUeEvent(t,i){const n=l.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},o=this._ueEvent.disposableOn(s=>{s.et===t&&s.eid===n&&((this._ueViewer.debug??!1)&&console.log(`callback, type:${t} eid:${n} ueEvent:${JSON.stringify(s)}`),i(s))});return()=>{o(),r()}}}class cr extends l.Destroyable{constructor(e,t){super();{const i=()=>{const s=we(e);e.setGlobalProperty(s)};i();const n=ce(),r=[];n.forEach(s=>{const u=e[s+"Changed"];r.push(u)});const o=this.dv(l.createNextAnimateFrameEvent(...r));this.d(o.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 l.ObjResettingWithEvent(e.statusUpdateIntervalChanged,i=>{if((e.statusUpdateInterval??.5)===0)return;const r=new l.Destroyable;return r.d(t.disposableOnUeEvent("statusUpdate",o=>{e.statusUpdateEvent.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(e.propChangedListeningChanged,()=>{if(!(e.propChangedListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("propChanged",r=>{e.propChanged.emit(r)})),n})),this.dv(new l.ObjResettingWithEvent(e.objectEventListeningChanged,()=>{if(!(e.objectEventListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("objectEvent",r=>{e.objectEvent.emit(r)})),n})),this.dv(new l.ObjResettingWithEvent(e.widgetEventListeningChanged,()=>{if(!(e.widgetEventListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("widgetEvent",r=>{e.widgetEvent.emit(r)})),n})),this.dv(new l.ObjResettingWithEvent(e.speechRecognitionListeningChanged,()=>{if(!(e.speechRecognitionListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("speechRecognition",r=>{e.speechRecognition.emit(r)})),n})),this.dv(new l.ObjResettingWithEvent(e.customMessageListeningChanged,()=>{if(!(e.customMessageListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("customMessage",r=>{e.customMessage.emit(r)})),n})),this.dv(new l.ObjResettingWithEvent(e.editingEventListeningChanged,()=>{if(!(e.editingEventListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("editingEvent",r=>{r.objectIDs=r.objectIDs.map(o=>{var s;return((s=d.ESSceneObject.getSceneObjById(o))==null?void 0:s.parentID)??o}),e.editingEvent.emit(r)})),n}))}}class ur extends l.Destroyable{constructor(e,t,i){super();{const r=()=>{const a=we(t);t.setGlobalProperty(a)};r();const o=ce(),s=[];o.forEach(a=>{const y=t[a+"Changed"];s.push(y)});const u=this.dv(l.createNextAnimateFrameEvent(...s));this.d(u.don(r))}this.d(t.propChanged.don(r=>{if(r.objId==="")try{Object.keys(r.props).forEach(o=>{const s=r.props[o]===null?void 0:r.props[o];t[o]=s})}catch(o){console.error("ueViewer propChanged:"+o)}}));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=(a,y)=>{window.ue.esinput.setinterceptevent(y),a.preventDefault()},o=a=>{r(a,!1)},s=a=>{r(a,!0)},u=a=>{r(a,!1)};n.addEventListener("mouseenter",o),n.addEventListener("mouseleave",s),n.addEventListener("mousemove",u),this.d(()=>{n.removeEventListener("mouseenter",o),n.removeEventListener("mouseleave",s),n.removeEventListener("mousemove",u)})}t.useCustomInteraction=!1,this.dv(new d.ViewerCustomInteraction(t,n)),this.dv(new l.ObjResettingWithEvent(t.statusUpdateIntervalChanged,r=>{if((t.statusUpdateInterval??.5)===0)return;const s=new l.Destroyable;return s.d(i.disposableOnUeEvent("statusUpdate",u=>{t.statusUpdateEvent.emit(u)})),s})),this.dv(new l.ObjResettingWithEvent(t.propChangedListeningChanged,()=>{if(!(t.propChangedListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("propChanged",s=>{t.propChanged.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.objectEventListeningChanged,()=>{if(!(t.objectEventListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("objectEvent",s=>{t.objectEvent.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.widgetEventListeningChanged,()=>{if(!(t.widgetEventListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("widgetEvent",s=>{t.widgetEvent.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.speechRecognitionListeningChanged,()=>{if(!(t.speechRecognitionListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("speechRecognition",s=>{t.speechRecognition.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.customMessageListeningChanged,()=>{if(!(t.customMessageListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("customMessage",s=>{t.customMessage.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.editingEventListeningChanged,()=>{if(!(t.editingEventListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("editingEvent",s=>{s.objectIDs=s.objectIDs.map(u=>{var a;return((a=d.ESSceneObject.getSceneObjById(u))==null?void 0:a.parentID)??u}),t.editingEvent.emit(s)})),o}))}}class hr extends l.Destroyable{constructor(t,i,n){super();f(this,"_reconnectEvent",this.dv(new l.Event));const r=(u,a)=>u.hasOwnProperty(a);let o=0,s;if(this.d(()=>{s&&clearTimeout(s)}),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 u=this.dv(new dr(t,n));this.d(()=>n.viewer=void 0),n.viewer=u,n.setStatus("Created"),n.setStatusLog("本地视口创建成功!"),this.dv(new ur(t,n,u))}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 u;this.d(()=>{n.setStatus("Raw"),n.setStatusLog(""),t&&u&&t.removeChild(u)&&(u=void 0)});const a=this.dv(l.createProcessingFromAsyncFunc(async y=>{n.viewer&&!n.viewer.isDestroyed()&&n.viewer.destroy(),n.viewer=void 0,u&&t.removeChild(u)&&(u=void 0),u=document.createElement("div"),u.setAttribute("earthsdk3-ue","earthsdk3-ue-videoContainer"),u.style.cssText="position:relative; height: 100%;width:100%;",t.appendChild(u);let w,c,p;if(r(i.options,"ws")){const{ws:E,esmsg:I,uselnternalSignallingServer:S}=i.options;w=E,c=I,p=S??!1}if(r(i.options,"uri")&&r(i.options,"app")){const{offsetWidth:E,offsetHeight:I}=u;let{uri:S,app:R,token:T}=i.options;S.endsWith("/")||(S+="/");const _=T?`?essstoken=${T}`:"",fe=`/${R}/${E??1920}/${I??1080}`+_;console.log(`请求信令服务器: ${S}instance${fe}`);const pr=await y.promise(fetch(`${S}instance${fe}`,{method:"GET"})),b=await y.promise(pr.json());if(b&&b.status!=="ok"){n.setStatus("Error"),n.setStatusLog(`信令服务器请求失败 ${b.status}`),this._reconnectEvent.emit(void 0);return}else{console.log(`信令服务器请求成功! ${JSON.stringify(b,void 0," ")}`),await l.sleep(2e3);const{server:fr,esmsg:wr,instanceId:yr,useInternalSignallingServer:mr}=b;if(!yr){n.setStatus("Error"),n.setStatusLog("检查信令服务器版本,返回数据错误! "),console.log("信令服务器返回数据错误!不包含instanceId!请升级到 ESSS V3.0+ 版本!"),this._reconnectEvent.emit(void 0);return}w=fr,c=wr,p=mr??!1,n.esssResponse=b}}const v=this.dv(p?new ir(u,w,c,n):new Qn(u,w,c,n));this.d(()=>n.viewer=void 0),this.d(v.errorEvent.don(E=>{const I=`[${E}]:像素流连接错误!`;n.setStatus("Error"),n.setStatusLog(I),this._reconnectEvent.emit(v)})),await y.promise(new Promise(E=>this.d(v.readyEvent.donce(E)))),n.setStatus("Created"),n.setStatusLog("云渲染视口创建成功!"),o=0,s&&clearTimeout(s),s=void 0;const{offsetWidth:m,offsetHeight:C}=u;v.resize(m*window.devicePixelRatio,C*window.devicePixelRatio),n.viewer=v,this.d(()=>n.viewer=void 0),this.dv(new cr(n,v))}));a.start(),this.d(this._reconnectEvent.don(y=>{s===void 0&&(y&&!y.isDestroyed()&&y.destroy(),n.viewer&&!n.viewer.isDestroyed()&&n.viewer.destroy(),n.viewer=void 0,n.autoReconnect&&(n.setStatus("Reconnecting"),n.setStatusLog("正在尝试重新连接..."),o=o+5e3>3e4?3e4:o+5e3,console.warn(`间隔:${o/1e3}s,正在尝试重新连接...`),s=window.setTimeout(()=>{a.restart()},o)))})),this.d(a.errorEvent.don(y=>{n.setStatus("Error"),n.setStatusLog("云渲染视口创建失败!"),console.warn("云渲染视口创建失败!",y),this._reconnectEvent.emit(void 0)}))}else if(r(i.options,"project")){const u=i,a=u.options.project,y=u.options.baseUrl;n.setStatus("Creating"),n.setStatusLog("下载编译中...");const w=this.dv(new ar(t,a,y,n));n.viewer=w,this.d(()=>n.viewer=void 0)}else n.setStatus("Error"),n.setStatusLog("视口创建失败!"),console.warn("视口创建失败: 参数错误!")}}const z=class z extends d.ESViewer{constructor(t){super(t);f(this,"_viewer",this.dv(l.react(void 0)));f(this,"_esssResponse");f(this,"_speechRecognition",this.dv(new l.Event));f(this,"_propChanged",this.dv(new l.Event));f(this,"_objectEvent",this.dv(new l.Event));f(this,"_widgetEvent",this.dv(new l.Event));f(this,"_customMessage",this.dv(new l.Event));f(this,"_statusUpdateEvent",this.dv(new l.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 l.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new hr(this.subContainer,i,this)}))}get defaultProps(){return z.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 sn(this.viewer,t)}async changeNavigationMode(t){if(!this.viewer){console.warn("ChangeNavigationMode: viewer is undefined");return}const i=await A(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 me(this.viewer,t)}async getAllSocketNamesByActorTag(t){if(!this.viewer){console.warn("GetAllSocketNamesByActorTag: viewer is undefined");return}return await an(this.viewer,t)}async getBoundSphere(t){if(!this.viewer){console.warn("getBoundSphere: viewer is undefined");return}return await dn(this.viewer,t)}async getBoundSphereWithChildren(t){if(!this.viewer){console.warn("getBoundSphereWithChildren: viewer is undefined");return}return await cn(this.viewer,t)}async getStrokeMaterialParamInfo(t){if(!this.viewer){console.warn("GetStrokeMaterialParamInfo: viewer is undefined");return}return await un(this.viewer,t)}async getFillMaterialParamInfo(t){if(!this.viewer){console.warn("getFillMaterialParamInfo: viewer is undefined");return}return await hn(this.viewer,t)}async getGlobalProperty(t){if(!this.viewer){console.warn("getGlobalProperty: viewer is undefined");return}return await vn(this.viewer,t)}async getObjectByInfo(t){if(!this.viewer){console.warn("GetObjectByInfo: viewer is undefined");return}return await gn(this.viewer,t)}async defaultCameraFlyIn(t=1){if(!this.viewer){console.warn("DefaultCameraFlyIn: viewer is undefined");return}return await ki(this.viewer,t)}async startVoice(){if(!this.viewer){console.warn("startVoice:viewer is undefined");return}return await Gi(this.viewer)}async stopVoice(){if(!this.viewer){console.warn("startVoice:viewer is undefined");return}return await Hi(this.viewer)}async mountPakFiles(t){if(!this.viewer){console.warn("mountPakFiles:viewer is undefined");return}return await Ji(this.viewer,t)}async generateMemReport(){if(!this.viewer){console.warn("generateMemReport:viewer is undefined");return}return await Bi(this.viewer)}async quit(){if(!this.viewer){console.warn("Quit: viewer is undefined");return}return await xi(this.viewer)}async bindActorByTag(t,i){if(!this.viewer){console.warn("BindActorByTag: viewer is undefined");return}return await pn(this.viewer,t,i)}async restoreOriginalScene(){if(!this.viewer){console.warn("RestoreOriginalScene: viewer is undefined");return}return await fn(this.viewer)}async unBindActorByID(t){if(!this.viewer){console.warn("UnBindActorByID: viewer is undefined");return}return await wn(this.viewer,t)}async unBindActorByTag(t){if(!this.viewer){console.warn("UnBindActorByTag: viewer is undefined");return}return await yn(this.viewer,t)}async createActorByClass(t,i){if(!this.viewer){console.warn("CreateActorByClass: viewer is undefined");return}return await mn(this.viewer,t,i)}async bind3DTilesetByTag(t,i){if(!this.viewer){console.warn("Bind3DTilesetByTag: viewer is undefined");return}return await Cn(this.viewer,t,i)}async unBind3DTilesetByTag(t){if(!this.viewer){console.warn("UnBind3DTilesetByTag: viewer is undefined");return}return await En(this.viewer,t)}async unBind3DTilesetById(t){if(!this.viewer){console.warn("UnBind3DTilesetById: viewer is undefined");return}return await Sn(this.viewer,t)}async bindImageryByTag(t,i,n){if(!this.viewer){console.warn("BindImageryByTag: viewer is undefined");return}return await Fn(this.viewer,t,i,n)}async unBindImageryByTag(t,i){if(!this.viewer){console.warn("UnBindImageryByTag: viewer is undefined");return}return await In(this.viewer,t,i)}async unBindImageryById(t){if(!this.viewer){console.warn("UnBindImageryById: viewer is undefined");return}return await Tn(this.viewer,t)}async getIdByComponentNameAndHitItem(t,i,n){if(!this.viewer){console.warn("GetIdByComponentNameAndHitItem: viewer is undefined");return}return await Rn(this.viewer,t,i,n)}async getCameraRelativeHeight(t="ECC_Visibility"){if(!this.viewer){console.warn("GetCameraRelativeHeight: viewer is undefined");return}return await Dn(this.viewer,t)}async saveStringToFile(t,i,n){if(!this.viewer){console.warn("SaveStringToFile: viewer is undefined");return}return await Ln(this.viewer,t,i,n)}async highlightActorByTag(t,i=!0){if(!this.viewer){console.warn("HighlightActorByTag: viewer is undefined");return}return await Pn(this.viewer,t,i)}async sendCustomMessage(t){if(!this.viewer){console.warn("SendCustomMessage: viewer is undefined");return}return await Mn(this.viewer,t)}async getStatus(){if(!this.viewer){console.warn("GetStatus:viewer is undefined");return}return await Un(this.viewer)}async getTilesetMaterialIDList(){if(!this.viewer){console.warn("GetTilesetMaterialIDList:viewer is undefined");return}return await $n(this.viewer)}async pick(t,i,n){if(!this.viewer)return;let r=t;if(t&&window.ue&&this.container){const[o,s]=t,{x:u,y:a}=this.container.getBoundingClientRect();r=[u+o,a+s]}return await Oi(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,{x:o,y:s}=this.container.getBoundingClientRect();i=[o+n,s+r]}return await ji(this.viewer,i)}async quickPickPosition(t){return await this.pickPosition(t)}async flyIn(t,i=[0,0,0],n=1,r="default"){if(!this.viewer)return;const o=await x(this.viewer,void 0,t,i,n,r);if(o)return o.endType===0&&console.warn(`flyTo:flyTo is end! endType:${o.endType}`),o.endType===1&&console.warn(`flyTo:飞行中断! endType:${o.endType}`),o}async flyTo(t,i,n="default"){if(!this.viewer)return;const r=await K(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]],o=d.getGeoBoundingSphereFromPositions(r);if(!o)return;const{center:s,radius:u}=o,a={distance:i??u,heading:0,pitch:-90,flyDuration:n,hDelta:0,pDelta:0};this.flyTo(a,s)}getCurrentCameraInfo(){const{position:t,rotation:i}=this._statusInfo;return{position:t,rotation:i}}getLengthInPixel(){return this._statusInfo.length}async changeToWalk(t,i=4.2,n=1.6){if(!this.viewer)return;const r={mode:"Walk",position:t,jumpZVelocity:i,eyeHeight:n},o=await A(this.viewer,r);return o&&!o.error&&(this._navigationMode.value=r.mode),o}async changeToMap(){if(!this.viewer)return;const t={mode:"Map"},i=await A(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},o=await A(this.viewer,r);return o&&!o.error&&(this._navigationMode.value=r.mode),o}async changeToLine(t,i=10,n=10,r=!0,o=10,s="auto"){if(!this.viewer)return;const u={mode:"Line",geoLineStringId:t,speed:i,heightOffset:n,loop:r,turnRateDPS:o,lineMode:s},a=await A(this.viewer,u);return a&&!a.error&&(this._navigationMode.value=u.mode),a}async changeToUserDefined(t){if(!this.viewer)return;const i={mode:"UserDefined",userDefinedPawn:t},n=await A(this.viewer,i);return n&&!n.error&&(this._navigationMode.value=i.mode),n}async changeToRotatePoint(t,i=5e4,n=60,r=0,o=-30){if(!this.viewer)return;const s={mode:"RotatePoint",position:t,distance:i,orbitPeriod:n,heading:r,pitch:o},u=await A(this.viewer,s);return u&&!u.error&&(this._navigationMode.value=s.mode),u}async changeToFollow(t,i=0,n=0,r=-30,o=!0){if(!this.viewer)return;const s={mode:"Follow",objectId:t,distance:i,heading:n,pitch:r,relativeRotation:o},u=await A(this.viewer,s);return u&&!u.error&&(this._navigationMode.value=s.mode),u}getFPS(){return this._statusInfo.fps}async getVersion(){const t=window.g_XE3CopyRights??{};if(!this.viewer)return t;const i=await ln(this.viewer);return t.esforue=i,t}async getHeightByLonLat(t,i,n="ECC_Visibility"){if(!this.viewer)return null;const r=await tn(this.viewer,t,i,n);return r&&r.height!==void 0?r.height:null}async getHeightsByLonLats(t,i="ECC_Visibility"){return this.viewer?await en(this.viewer,t,i):void 0}async capture(t=64,i=64){return this.viewer?await nn(this.viewer,t,i):void 0}async partialCapture(t,i=[64,64]){if(!this.viewer){console.warn("partialCapture:viewer is undefined");return}return await rn(this.viewer,t,i)}async lonLatAltToScreenPosition(t){if(!this.viewer)return;const i=await on(this.viewer,t);return i&&[i.X,i.Y]}async setGlobalProperty(t){if(this.viewer)return await bi(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 o=Array.isArray(i)?[...i]:[i];return r.editingID=`${n.callSource}_${l.createGuid()}`,await An(this.viewer,r.id,r.editingID,o,n.useKeyToSwitch)}async stopEditing(){if(this.viewer)return await Wn(this.viewer)}async moveObjects(t){if(!this.viewer)return;const i=[],n=l.createGuid();for(let r=0;r<t.length;r++){const o=t[r],s=o.combinationClass?o.getMainClass():o;s.editingID=n,s&&i.push(s.id)}if(i.length!==0)return await _n(this.viewer,i,n)}getProperties(){return[...super.getProperties()]}};f(z,"type",z.register("ESUeViewer",z)),f(z,"defaults",{...Kn});let W=z;(h=>{h.createDefaultProps=()=>({...d.ESViewer.createDefaultProps(),...Ni(),resolutionScale:1,autoReconnect:!1,propChangedListening:void 0,objectEventListening:void 0,widgetEventListening:void 0,speechRecognitionListening:void 0,customMessageListening:void 0})})(W||(W={})),l.extendClassProps(W.prototype,W.createDefaultProps);class N extends d.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,o=Object.keys(r).filter(c=>n[c]!==null);o.push(...this.constructor.forceUeUpdateProps);const s=e.constructor.defaults,u={val:{}},a=[];for(let c of o){const p=c+"Changed",v=e[p];a.push(v);const m=n[c];if(m===null)throw console.error("vf === null error"),new Error("vf === null error");const C=()=>{const E=e[c]??s[c];let I=m?m(E,this,t,e):E;if(I===void 0){console.warn(`UE自动更新的属性,不应该为undefined! 属性名:${c} 对象名:${e.name} 对象id: ${e.id}`);return}u.val[c]=I};C(),this.d(v.don(C))}const y=()=>{i.callUeFunc({f:"update",p:{id:e.id,...u.val}}),u.val={}},w=this.dv(l.createNextAnimateFrameEvent(...a));this.d(w.don(y)),this.d(e.createdEvent.don(y)),this.d(e.flushEvent.don(()=>w.flush()))})),!e.combinationClass)){let n=!1;this.d(()=>{n&&ye(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(N,"propValFuncs",{ref:null,devTags:null,extras:null,execOnceFuncStr:null,updateFuncStr:null,toDestroyFuncStr:null}),f(N,"forceUeUpdateProps",[]);class P extends N{constructor(e,t){super(e,t);const i=t.viewer;i&&(this.d(e.flyToEvent.don(n=>{K(i,e.id,n)})),this.d(e.flyInEvent.don(n=>{var r,o;x(i,e.id,(r=e.flyInParam)==null?void 0:r.position,(o=e.flyInParam)==null?void 0:o.rotation,n??1)})),this.d(e.calcFlyToParamEvent.don(()=>{$(i,e.id)})),this.d(e.calcFlyInParamEvent.don(()=>{const n=t.getCurrentCameraInfo();if(!n)return;const{position:r,rotation:o}=n;e.flyInParam={position:r,rotation:o,flyDuration:1}})),this.d(t.propChanged.don(n=>{n.objId===e.id&&Object.keys(n.props).forEach(r=>{const o=n.props[r]===null?void 0:n.props[r];e[r]=o})})))}}class F extends P{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(l.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.editingChanged));this.d(r.don(()=>{setTimeout(n,0)})),this.d(e.smoothMoveEvent.don((u,a)=>{et(i,e.id,u,a)})),this.d(e.smoothMoveWithRotationEvent.don((u,a,y)=>{O(i,e.id,u,a,y)})),this.d(e.smoothMoveOnGroundEvent.don((u,a,y,w)=>{j(i,e.id,u,a,w,y)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((u,a,y,w,c)=>{tt(i,e.id,u,a,y,w,c)})),this.d(e.smoothMoveKeepPitchEvent.don(async(u,a)=>{const y=await i.callUeFunc({f:"SmoothMoveKeepPitch",p:{id:e.id,Destination:u,Time:a}});y.error&&console.error("SmoothMoveKeepPitch:",y.error)})),this.d(e.automaticLandingEvent.don(u=>{const a=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(y=>{y!==null&&(e.position=[...a,y],e.collision=u)})}));const o=async(u,a,y,w)=>{const{viewer:c}=u;if(!c){console.error("SmoothMoveRelatively: ueViewer.viewer is undefined");return}const p=await c.callUeFunc({f:"SmoothMoveRelatively",p:{id:a,RelativePosition:y,Time:w}});return p.error&&console.error("SmoothMoveRelatively:",p.error),p};this.d(e.smoothMoveRelativelyEvent.don((u,a)=>{o(t,e.id,u,a)}));const s=async(u,a,y,w,c)=>{const{viewer:p}=u;if(!p){console.error("SmoothMoveRelativelyWithRotation: ueViewer.viewer is undefined");return}const v=await p.callUeFunc({f:"SmoothMoveRelativelyWithRotation",p:{id:a,RelativePosition:y,NewRotation:w,Time:c}});return v.error&&console.error("SmoothMoveRelativelyWithRotation:",v.error),v};this.d(e.smoothMoveRelativelyWithRotationEvent.don((u,a,y)=>{s(t,e.id,u,a,y)}))}}class D extends P{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(l.createNextAnimateFrameEvent(e.pointsChanged,e.editingChanged));this.d(r.don(()=>{setTimeout(n,0)}))}}f(D,"propValFuncs",{...P.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 F{constructor(e,t){super(e,t),t.viewer&&this.d(t.widgetEvent.don(n=>{if(n.objId!==e.id)return;const{type:r,add:o}=n;e.widgetEvent.emit({type:r,add:o})}))}}class Ee extends F{constructor(e,t){super(e,t),t.viewer}}f(Ee,"propValFuncs",{...F.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 he extends Ee{constructor(e,t){super(e,t),t.viewer}}const zn=h=>{switch(h){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"没搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是3dTileset,无法绑定";default:return"未知错误"}},nt=class nt extends d.EngineObject{constructor(t,i){super(t,i);f(this,"_styleColor",this.dv(l.react([])));f(this,"_styleVisable",this.dv(l.react([])));const n=i.viewer;if(!n){console.warn("UeES3DTileset: viewer is undefined!");return}let r,o;const s=async()=>{!r&&!o||await n.callUeFunc({f:"update",p:{id:t.id,url:t.url,show:t.show,collision:t.collision,allowPicking:t.allowPicking,flyToParam:t.flyToParam??d.ESVisualObject.defaults.flyToParam,flyInParam:t.flyInParam??d.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}})},u=this.dv(l.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));s(),this.d(u.don(s)),Reflect.has(t,"colorMode")&&this.d(t.colorModeChanged.don(()=>s()));const a=this.dv(l.react(void 0));{const w=this.dv(l.createNextAnimateFrameEvent(t.actorTagChanged,t.urlChanged)),c=()=>{t.actorTag?a.value={type:"ActorTag",actorTag:t.actorTag}:t.url?a.value={type:"CreatedUrl",url:t.url}:a.value=void 0,t.editing=!1};c(),this.d(w.don(c))}const y=async()=>{const{id:w}=t;if(r!==void 0){r=void 0;try{const c=await i.unBind3DTilesetById(w);if(!c)return;if(c.error!==""){console.warn(`UeES3DTileset UnBind3DTilesetById: ${c.error}`);return}}catch(c){console.warn(`UeES3DTileset UnBind3DTilesetById: ${c}`);return}}if(o!==void 0){o=void 0;try{const c=await n.callUeFunc({f:"destroy",p:{id:w}});if(!c)return;if(c.error!==""){console.warn(`UeES3DTileset Destroy: ${c.error}`);return}}catch(c){console.warn(`UeES3DTileset Destroy: ${c}`);return}}};this.d(()=>{y()});{const w=this.dv(l.createProcessingFromAsyncFunc(async p=>{if(a.value===void 0){await p.promise(y());return}if(a.value.type==="ActorTag"){const{actorTag:v}=a.value;if(r!==v&&await p.promise(y()),r!==void 0||v===void 0)return;try{r=v;const m=await p.promise(i.bind3DTilesetByTag(t.id,v));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: ${zn(m.re.type)}`);else{console.warn(`UeES3DTileset Bind3DTilesetByTag: ${zn(m.re.type)}`);return}}catch(m){console.warn(`UeES3DTileset Bind3DTilesetByTag: ${m}`);return}}else if(a.value.type==="CreatedUrl"){const{url:v}=a.value;if(v!==o&&await y(),o!==void 0||v===void 0)return;try{o=v;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(s())})),c=async()=>{w.restart()};c(),this.d(a.changed.don(c))}this.d(t.refreshTilesetEvent.don(()=>{zi(n,t.id)})),this.d(t.flyToEvent.don(async(w,c)=>{if(!r&&!o)return;const p=await K(n,t.id,w);let v="over";p===void 0?v="error":p.endType===0?v="over":p.endType===1&&(v="cancelled"),t.flyOverEvent.emit(c,v,i)})),this.d(t.calcFlyToParamEvent.don(()=>{!r&&!o||$(n,t.id)})),this.d(t.calcFlyInParamEvent.don(async()=>{if(!r&&!o||!i.actived)return;const w=await i.getCurrentCameraInfo();if(!w)return;const{position:c,rotation:p}=w;t.flyInParam={position:c,rotation:p,flyDuration:1}})),this.d(i.propChanged.don(w=>{!r&&!o||w.objId===t.id&&Object.keys(w.props).forEach(c=>{const p=w.props[c]===null?void 0:w.props[c];t[c]=p})})),this.d(i.objectEvent.don(w=>{!r&&!o||w.id!==t.id||w.type!=="3DTilesetReady"||t.tilesetReady.emit(w.p)}));{const w=async(m,C)=>{if(!r&&!o)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}},c=async(m,C)=>{if(!r&&!o)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&&!o)return;const m=await n.callUeFunc({f:"ResetFeatureStyle",p:{id:t.id}});if(m&&m.error!==""){console.warn(`UeES3DTileset ResetFeatureStyle: ${m.error}`);return}},v=async m=>{if(!r&&!o)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],w(m,E)})),this.d(t.setFeatureVisableEvent.don((m,C)=>{const E=[...this.styleVisable,...C];this.styleVisable=[...E],c(m,E)})),this.d(t.resetFeatureStyleEvent.don(()=>{p(),this.styleColor=[],this.styleVisable=[]})),this.d(t.setFeatureStyleEvent.don(m=>{v(m)}))}{const w=async()=>{if(!r&&!o){t._featureTableResultEvent.emit(void 0);return}try{const c=await n.callUeFunc({f:"GetFeatureTable",p:{id:t.id}});c.error!==""&&console.warn(`UeES3DTileset GetFeatureTable: ${c.error}`),t._featureTableResultEvent.emit(c.re.table)}catch(c){console.warn(`UeES3DTileset GetFeatureTable: ${c}`),t._featureTableResultEvent.emit(void 0)}};this.d(t.getFeatureTableEvent.don(()=>{w()}))}{const w=async()=>{if(!r&&!o){t.getMaterialNameListEvent.emit(void 0);return}try{const c=await n.callUeFunc({f:"GetMaterialNameList",p:{id:t.id}});c.error!==""&&console.warn(`UeES3DTileset GetMaterialNameList: ${c.error}`),t.getMaterialNameListEvent.emit(c.re.materialNameList)}catch(c){console.warn(`UeES3DTileset GetMaterialNameList: ${c}`),t.getMaterialNameListEvent.emit(void 0)}};this.ad(t.getMaterialNameListEvent.don(c=>{c=="start"&&w()}))}}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(nt,"type",nt.register("ESUeViewer",d.ES3DTileset.type,nt));let ve=nt;const kn=h=>{switch(h){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"没搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag对应的Actor是地形,无法绑定";case 4:return"没搜索到ComponentTag,无法绑定";default:return"未知错误"}},rt=class rt extends d.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}let n,r;const o=this.dv(l.react(void 0)),s=this.ad(l.reactJson(""));{const w=()=>{if(typeof e.url=="string")s.value=d.ESSceneObject.context.getStrFromEnv(e.url);else{const c=e.url;c.url=d.ESSceneObject.context.getStrFromEnv(c.url),s.value=c}};w(),this.ad(e.urlChanged.don(w))}const u=async()=>{if(!n&&!r)return;let w=e.targetID??d.ESImageryLayer.defaults.targetID;if(w&&w!=""){const c=d.ESSceneObject.getSceneObject(w);w=c?c.getMainClass().id:w}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??d.ESVisualObject.defaults.flyToParam,flyInParam:e.flyInParam??d.ESVisualObject.defaults.flyInParam,url:s.value??"",zIndex:e.zIndex??0,maximumLevel:e.maximumLevel??d.ESImageryLayer.defaults.maximumLevel,minimumLevel:e.minimumLevel??d.ESImageryLayer.defaults.minimumLevel,options:e.options??d.ESImageryLayer.defaults.options,targetID:w,opacity:e.opacity??d.ESImageryLayer.defaults.opacity,splitDirection:e.splitDirection??d.ESImageryLayer.defaults.splitDirection}})},a=this.dv(l.createNextAnimateFrameEvent(e.showChanged,s.changed,e.flyToParamChanged,e.flyInParamChanged,e.zIndexChanged,e.collisionChanged,e.allowPickingChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.rectangleChanged,e.optionsChanged,e.targetIDChanged,e.opacityChanged,e.splitDirectionChanged));this.d(a.don(u));const y=async()=>{const{id:w}=e;if(n!==void 0){n=void 0;try{const c=await t.unBindImageryById(w);if(!c)return;if(c.error!==""){console.warn(`UeESImageryLayer UnImageryByID: ${c.error}`);return}}catch(c){console.warn(`UeESImageryLayer UnImageryByID promise: ${c}`);return}}if(r!==void 0){r=void 0;try{const c=await i.callUeFunc({f:"destroy",p:{id:w,test:"UeESImageryLayer"}});if(!c)return;if(c.error!==""){console.warn(`UeESImageryLayer Destroy: ${c.error}`);return}}catch(c){console.warn(`UeESImageryLayer Destroy promise: ${c}`);return}}};this.d(()=>{y()});{const w=this.dv(l.createProcessingFromAsyncFunc(async p=>{if(o.value===void 0){await p.promise(y());return}if(o.value.type==="ActorTag"){const{actorTag:v,componentTag:m}=o.value;if(n!==v&&await p.promise(y()),n!==void 0||v===void 0)return;try{n=v;const C=await p.promise(t.bindImageryByTag(e.id,v,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: ${kn(C.re.type)}`);else{console.warn(`ESImageryLayer BindImageryByTag: ${kn(C.re.type)}`);return}}catch(C){console.warn(`ESImageryLayer BindImageryByTag promise: ${C}`);return}}else if(o.value.type==="CreatedUrl"){const{url:v}=o.value;if(v!==r&&await p.promise(y()),r!==void 0||v===void 0)return;try{r=v;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(u())})),c=async()=>{w.restart()};c(),this.d(o.changed.don(c))}{const w=this.dv(l.createNextAnimateFrameEvent(e.actorTagChanged,s.changed,e.componentTagChanged)),c=()=>{e.actorTag&&e.componentTag?o.value={type:"ActorTag",actorTag:e.actorTag,componentTag:e.componentTag}:s.value?o.value={type:"CreatedUrl",url:s.value}:o.value=void 0};c(),this.d(w.don(c))}this.d(e.flyToEvent.don(async(w,c)=>{if(!n&&!r)return;const p=await K(i,e.id,w);let v="over";p===void 0?v="error":p.endType===0?v="over":p.endType===1&&(v="cancelled"),e.flyOverEvent.emit(c,v,t)})),this.d(e.flyInEvent.don(async(w,c)=>{var m,C;if(!n&&!r)return;const p=await x(i,e.id,(m=e.flyInParam)==null?void 0:m.position,(C=e.flyInParam)==null?void 0:C.rotation,w??1);let v="over";p===void 0?v="error":p.endType===0?v="over":p.endType===1&&(v="cancelled"),e.flyOverEvent.emit(c,v,t)})),this.d(e.calcFlyToParamEvent.don(()=>{!n&&!r||$(i,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const w=await t.getCurrentCameraInfo();if(!w)return;const{position:c,rotation:p}=w;e.flyInParam={position:c,rotation:p,flyDuration:1}})),this.d(t.propChanged.don(w=>{!n&&!r||w.objId===e.id&&Object.keys(w.props).forEach(c=>{const p=w.props[c]===null?void 0:w.props[c];e[c]=p})}))}};f(rt,"type",rt.register("ESUeViewer",d.ESImageryLayer.type,rt));let Se=rt;const k=class k extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(k,"type",k.register("ESUeViewer",d.ESTerrainLayer.type,k)),f(k,"forceUeUpdateProps",[...P.forceUeUpdateProps,"url"]),f(k,"propValFuncs",{...P.propValFuncs,url:e=>typeof e=="string"?d.ESSceneObject.context.getStrFromEnv(e):(e.url=d.ESSceneObject.context.getStrFromEnv(e.url),e),czmMaxzoom:null,czmMinzoom:null});let Fe=k;const ot=class ot extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ot,"type",ot.register("ESUeViewer",d.ESAlarm.type,ot));let Ie=ot;const st=class st extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(st,"type",st.register("ESUeViewer",d.ESApertureEffect.type,st));let Te=st;const at=class at extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(at,"type",at.register("ESUeViewer",d.ESGeoPolygon.type,at));let M=at;const lt=class lt extends M{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let o=d.ESAreaMeasurement.defaults.fillStyle;try{o={...e.fillStyle??d.ESAreaMeasurement.defaults.fillStyle}}catch(s){console.error("ESAreaMeasurement fillStyle 属性类型错误!",s),o={...d.ESAreaMeasurement.defaults.fillStyle}}o.materialParams=JSON.stringify(o.materialParams),i.callUeFunc({f:"update",p:{id:e.id,stroked:e.stroked??d.ESAreaMeasurement.defaults.stroked,fillStyle:o,filled:e.filled??d.ESAreaMeasurement.defaults.filled}}),console.log(o)},r=this.dv(l.createNextAnimateFrameEvent(e.fillStyleChanged,e.strokedChanged,e.filledChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};f(lt,"type",lt.register("ESUeViewer",d.ESAreaMeasurement.type,lt));let Re=lt;const dt=class dt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(dt,"type",dt.register("ESUeViewer",d.ESBlastParticleSystem.type,dt));let De=dt;const V=class V extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};f(V,"type",V.register("ESUeViewer",d.ESBoxClipping.type,V)),f(V,"propValFuncs",{...F.propValFuncs,targetID:e=>{if(!e)return"";const t=d.ESSceneObject.getSceneObject(e);return t?t.getMainClass().id:e}});let Le=V;const ct=class ct extends F{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,o="default")=>{const{id:s,duration:u,position:a,rotation:y}=e;x(i,s,a,y,u??n,o)})),this.dispose(e.resetWithCurrentCameraEvent.don(()=>{me(i,e.id)})),this.dispose(e.captureEvent.don((n,r)=>{t.capture(n,r).then(s=>{s&&(e.thumbnail=s)})}))}};f(ct,"type",ct.register("ESUeViewer",d.ESCameraView.type,ct));let Pe=ct;const ut=class ut extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ut,"type",ut.register("ESUeViewer",d.ESCameraVisibleRange.type,ut));let Me=ut;const ht=class ht extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ht,"type",ht.register("ESUeViewer",d.ESCar.type,ht));let Ue=ht;const vt=class vt extends D{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let o=d.ESClassification.defaults.fillStyle;try{o={...e.fillStyle??d.ESClassification.defaults.fillStyle}}catch(s){console.error("ESClassification fillStyle 属性类型错误!",s),o={...d.ESClassification.defaults.fillStyle}}o.materialParams=JSON.stringify(o.materialParams),i.callUeFunc({f:"update",p:{id:e.id,filled:e.filled??d.ESClassification.defaults.filled,fillStyle:o}})},r=this.dv(l.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};f(vt,"type",vt.register("ESUeViewer",d.ESClassification.type,vt));let Ae=vt;const X=class X extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};f(X,"type",X.register("ESUeViewer",d.ESClippingPlane.type,X)),f(X,"propValFuncs",{...F.propValFuncs,targetID:e=>{if(!e)return"";const t=d.ESSceneObject.getSceneObject(e);return t?t.getMainClass().id:e}});let We=X;const gt=class gt extends F{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=this.ad(l.reactJson(""));{const s=()=>{if(typeof e.url=="string")n.value=d.ESSceneObject.context.getStrFromEnv(e.url??d.ESDataMesh.defaults.url);else{const u=e.url;u.url=d.ESSceneObject.context.getStrFromEnv(u.url??d.ESDataMesh.defaults.url),n.value=u}};s(),this.ad(e.urlChanged.don(s))}const r=()=>{const s=e.colorStops??d.ESDataMesh.defaults.colorStops;i.callUeFunc({f:"update",p:{id:e.id,url:n.value??d.ESDataMesh.defaults.url,currentTime:e.currentTime??d.ESDataMesh.defaults.currentTime,minPropValue:e.minPropValue??d.ESDataMesh.defaults.minPropValue,maxPropValue:e.maxPropValue??d.ESDataMesh.defaults.maxPropValue,colorStops:JSON.stringify(s)}})},o=this.dv(l.createNextAnimateFrameEvent(n.changed,e.currentTimeChanged,e.minPropValueChanged,e.maxPropValueChanged,e.colorStopsChanged));this.d(o.don(r)),this.d(e.createdEvent.don(r))}};f(gt,"type",gt.register("ESUeViewer",d.ESDataMesh.type,gt));let _e=gt;const pt=class pt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(pt,"type",pt.register("ESUeViewer",d.ESDatasmithRuntimeModel.type,pt));let $e=pt;const ft=class ft extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(ft,"type",ft.register("ESUeViewer",d.ESDirectionMeasurement.type,ft));let Ne=ft;const wt=class wt extends D{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let o;try{o={...e.strokeStyle??d.ESDistanceMeasurement.defaults.strokeStyle}}catch(s){console.error("ESDistanceMeasurement strokeStyle 属性类型错误!",s),o={...d.ESDistanceMeasurement.defaults.strokeStyle}}i.callUeFunc({f:"update",p:{id:e.id,strokeStyle:o}})},r=this.dv(l.createNextAnimateFrameEvent(e.strokeStyleChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};f(wt,"type",wt.register("ESUeViewer",d.ESDistanceMeasurement.type,wt));let ze=wt;const yt=class yt extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(yt,"type",yt.register("ESUeViewer",d.ESLocalPolygon.type,yt));let ge=yt;const mt=class mt extends ge{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(mt,"type",mt.register("ESUeViewer",d.ESDynamicWater.type,mt));let ke=mt;const Ct=class Ct extends P{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:o}=n;e.widgetEvent.emit({type:r,properties:o})}))}};f(Ct,"type",Ct.register("ESUeViewer",d.ESEntityCluster.type,Ct));let Ge=Ct;const q=class q extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(q,"type",q.register("ESUeViewer",d.ESExcavate.type,q)),f(q,"propValFuncs",{...M.propValFuncs,targetID:e=>{if(!e)return"";const t=d.ESSceneObject.getSceneObject(e);return t?t.getMainClass().id:e}});let He=q;const Et=class Et extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Et,"type",Et.register("ESUeViewer",d.ESFireParticleSystem.type,Et));let Je=Et;const St=class St extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=this.ad(l.reactJson(""));{const s=()=>{if(typeof e.url=="string")n.value=d.ESSceneObject.context.getStrFromEnv(e.url);else{const u=e.url;u.url=d.ESSceneObject.context.getStrFromEnv(u.url),n.value=u}};s(),this.ad(e.urlChanged.don(s))}const r=()=>{i.callUeFunc({f:"update",p:{id:e.id,url:n.value??d.ESForestTileset.defaults.url,treeTypes:e.treeTypes??d.ESForestTileset.defaults.treeTypes,xiaoBanWidget:e.xiaoBanWidget??d.ESForestTileset.defaults.xiaoBanWidgetDefault,youShiSZ:e.youShiSZ??d.ESForestTileset.defaults.youShiSZ,diLei:e.diLei??d.ESForestTileset.defaults.diLei,senLinLB:e.senLinLB??d.ESForestTileset.defaults.senLinLB,labelMaterial:e.labelMaterial??d.ESForestTileset.defaults.labelMaterial,heightOffset:e.heightOffset??d.ESForestTileset.defaults.heightOffset}})},o=this.dv(l.createNextAnimateFrameEvent(n.changed,e.treeTypesChanged,e.xiaoBanWidgetChanged,e.youShiSZChanged,e.diLeiChanged,e.senLinLBChanged,e.labelMaterialChanged,e.heightOffsetChanged));this.d(o.don(r)),this.d(e.createdEvent.don(r))}};f(St,"type",St.register("ESUeViewer",d.ESForestTileset.type,St));let Be=St;const Ft=class Ft extends d.EngineObject{constructor(e,t){super(e,t),this.ad(new l.ObjResettingWithEvent(e.renderInUEChanged,()=>e.renderInUE?new Hn(e,t):new Gn(e,t)))}};f(Ft,"type",Ft.register("ESUeViewer",d.ESGeoDiv.type,Ft));let Ke=Ft;class Gn extends l.Destroyable{constructor(t,i){super();f(this,"_screenPosition",this.disposeVar(l.reactArrayWithUndefined(void 0)));const n=i.viewer;if(!n){console.warn("viewer is undefined!");return}const r=this.disposeVar(new d.ESTextLabel);r.parentID=t.id,t.mainClass=r,i.add(r),this.dispose(()=>i.delete(r)),r.show=!1,this.dispose(l.bind([r,"position"],[t,"position"])),this.dispose(l.bind([r,"rotation"],[t,"rotation"])),this.dispose(l.bind([r,"flyToParam"],[t,"flyToParam"])),this.dispose(l.bind([r,"flyInParam"],[t,"flyInParam"])),this.dispose(t.calcFlyToParamEvent.disposableOn(()=>{$(n,r.id)})),this.dispose(t.calcFlyInParamEvent.disposableOn(async()=>{if(!i.actived)return;const u=await i.getCurrentCameraInfo();if(!u)return;const{position:a,rotation:y}=u;t.flyInParam={position:a,rotation:y,flyDuration:1}})),this.dispose(t.smoothMoveEvent.disposableOn((u,a)=>{et(n,r.id,u,a)})),this.dispose(t.smoothMoveWithRotationEvent.disposableOn((u,a,y)=>{O(n,r.id,u,a,y)})),this.dispose(t.smoothMoveOnGroundEvent.disposableOn((u,a,y,w)=>{j(n,r.id,u,a,w,y)})),this.dispose(t.smoothMoveWithRotationOnGroundEvent.disposableOn((u,a,y,w,c)=>{tt(n,r.id,u,a,y,w,c)})),this.dispose(t.flyToEvent.disposableOn((u,a)=>{r.flyTo(u)})),this.dispose(t.flyInEvent.don(u=>{r.flyIn(u)}));const o=this._screenPosition,s=this.disposeVar(new d.ESCustomDiv);s.parentID=t.id,i.add(s),this.dispose(()=>i.delete(s)),this.dispose(l.bind([s,"allowPicking"],[t,"allowPicking"]));{const u=this.disposeVar(l.createAnimateFrame()),a=()=>{t.show?u.restart(void 0,async()=>{if(!t.position)return;const y=await i.lonLatAltToScreenPosition(t.position);if(!this.isDestroyed())if(!y)this._screenPosition.value=void 0;else{const[w,c]=y;w===-1&&c===-1?this._screenPosition.value=void 0:this._screenPosition.value=[w,c]}}):u.cancel()};a(),this.dispose(t.showChanged.disposableOn(a))}{const u=()=>class extends l.Destroyable{constructor(c,p,v){if(super(),this._subContainer=c,!v)return;if(!t.instanceClass)throw new Error("!sceneObject.instanceClass");const m=new l.PosFloatDiv,C=m.element;this._subContainer.appendChild(C),this.dispose(()=>this._subContainer.removeChild(C)),C.onclick=E=>{(t.allowPicking??!1)&&t.pickedEvent.emit(new d.ESJPickedResult({div:C,pointerEvent:E},t,void 0,void 0,void 0,[E.x,E.y]))};{const E=()=>{t.editing?C.children[0].style.pointerEvents="none":C.children[0].style.pointerEvents="all"};E(),this.d(t.editingChanged.don(E))}{const E=()=>{const S=t.show;o.value&&S?(m.show=!0,m.winPos=[...o.value]):(m.show=!1,m.winPos=[0,0])};E();const I=this.disposeVar(l.createNextAnimateFrameEvent(t.showChanged,o.changed));this.dispose(I.disposableOn(E))}{const E=()=>{const[I,S]=t.anchor??d.ESGeoDiv.defaults.anchor;m.originRatioX=I,m.originRatioY=S};E(),this.dispose(t.anchorChanged.disposableOn(E))}{const E=()=>{m.opacity=t.opacity??d.ESGeoDiv.defaults.opacity};E(),this.dispose(t.opacityChanged.disposableOn(E))}this.disposeVar(new t.instanceClass(m.contentDiv,t,v))}},a=()=>{try{t.instanceClass?s.instanceClass=u():s.instanceClass=void 0}catch(w){console.error(w)}};a();const y=this.dv(l.createNextAnimateFrameEvent(t.instanceClassChanged,t.opacityChanged,t.anchorChanged,t.editingChanged,t.showChanged,t.allowPickingChanged));this.d(y.don(a))}}get screenPosition(){return this._screenPosition.value}get screenPositionChanged(){return this._screenPosition.changed}set screenPosition(t){this._screenPosition.value=t}}class Hn extends l.Destroyable{constructor(t,i){super();f(this,"_imageLabel");f(this,"_hasClassDivAndPos",{});this._imageLabel=this.dv(new d.ESImageLabel),this._imageLabel.isHoverZoom=!1,this._imageLabel.parentID=t.id;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 o=()=>{if(!n)return;if(!t.instanceClass)throw new Error("!sceneObject.instanceClass");const a=document.createElement("div"),y=this.dv(new t.instanceClass(a,t,i))._container;if(y.style.opacity=t.opacity.toString()??d.ESGeoDiv.defaults.opacity,y.style.position="fixed",y.style.zIndex="-1",y.style.top="0px",!document.body.contains(y)){document.body.appendChild(y);let c=y?y.querySelectorAll("*[class]"):[];for(let p=0;p<c.length;p++){const v=c[p];var w=v.getBoundingClientRect();this._hasClassDivAndPos[v.className]=[v.offsetLeft,v.offsetTop,v.offsetLeft+w.width,v.offsetTop+w.height]}}Bn(y,{backgroundColor:null,allowTaint:!0,useCORS:!0,width:y.offsetWidth,height:y.offsetHeight,scale:1}).then(c=>{document.body.contains(y)&&document.body.removeChild(y),r.url=c.toDataURL(),r.show=t.show}).catch(()=>{document.body.contains(y)&&document.body.removeChild(y)})},s=()=>{try{t.instanceClass?o():(r.url="",r.show=!1)}catch(a){console.error(a)}};s();const u=this.dv(l.createNextAnimateFrameEvent(t.instanceClassChanged,t.opacityChanged));this.d(u.don(s))}{const o=()=>{r.show=t.show};r.show=!1,this.ad(t.showChanged.don(o))}this.d(l.track([r,"anchor"],[t,"anchor"])),this.d(l.bind([r,"position"],[t,"position"])),this.d(l.bind([r,"rotation"],[t,"rotation"])),this.d(l.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(l.bind([r,"flyInParam"],[t,"flyInParam"])),this.d(l.bind([r,"allowPicking"],[t,"allowPicking"])),this.d(l.bind([r,"scale"],[t,"scale"])),this.d(l.track([r,"minVisibleDistance"],[t,"minVisibleDistance"])),this.d(l.track([r,"maxVisibleDistance"],[t,"maxVisibleDistance"])),this.ad(t.automaticLandingEvent.don(()=>{r.automaticLanding()})),this.d(i.widgetEvent.don(o=>{if(o.objId!==this._imageLabel.id)return;const{type:s,add:u}=o;if(s==="leftClick"&&u){const a=(u==null?void 0:u.classNames)??[],y=Object.keys(this._hasClassDivAndPos);for(let w=0;w<y.length;w++){const c=y[w];let p=this._hasClassDivAndPos[c];u&&u.mouseRelativePos&&u.mouseRelativePos[0]>=p[0]&&u.mouseRelativePos[0]<=p[2]&&u.mouseRelativePos[1]>=p[1]&&u.mouseRelativePos[1]<=p[3]&&a.push(c)}u.classNames=a}t.widgetEvent.emit({type:s,add:u})})),this.d(t.calcFlyToParamEvent.don(()=>{$(n,r.id)})),this.d(t.calcFlyInParamEvent.don(()=>{const o=i.getCurrentCameraInfo();if(!o)return;const{position:s,rotation:u}=o;t.flyInParam={position:s,rotation:u,flyDuration:1}})),this.d(t.smoothMoveEvent.don((o,s)=>{et(n,r.id,o,s)})),this.d(t.smoothMoveWithRotationEvent.don((o,s,u)=>{O(n,r.id,o,s,u)})),this.d(t.smoothMoveOnGroundEvent.don((o,s,u,a)=>{j(n,r.id,o,s,a,u)})),this.d(t.smoothMoveWithRotationOnGroundEvent.don((o,s,u,a,y)=>{tt(n,r.id,o,s,u,a,y)})),this.d(t.flyToEvent.don((o,s)=>{r.flyTo(o)})),this.d(t.flyInEvent.don(o=>{r.flyIn(o)}))}}const It=class It extends P{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,o)=>{i.callUeFunc({f:"flyToFeature",p:{id:e.id,key:n,value:r,duration:o}})}))}};f(It,"type",It.register("ESUeViewer",d.ESGeoJson.type,It));let Ve=It;const Tt=class Tt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Tt,"type",Tt.register("ESUeViewer",d.ESGeoLineString.type,Tt));let pe=Tt;const Rt=class Rt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Rt,"type",Rt.register("ESUeViewer",d.ESGeoRectangle.type,Rt));let Xe=Rt;const Dt=class Dt extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Dt,"type",Dt.register("ESUeViewer",d.ESGeoWater.type,Dt));let qe=Dt;const G=class G extends F{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)=>{Zi(i,e.id,n,r)})),this.d(e.setNodeRotationEvent.don((n,r)=>{Yi(i,e.id,n,r)})),this.d(e.setNodeScaleEvent.don((n,r)=>{Qi(i,e.id,n,r)}))}};f(G,"forceUeUpdateProps",[...F.forceUeUpdateProps,"url"]),f(G,"propValFuncs",{...F.propValFuncs,url:e=>typeof e=="string"?d.ESSceneObject.context.getStrFromEnv(d.rpToap(e)):(e.url=d.ESSceneObject.context.getStrFromEnv(d.rpToap(e.url)),e),czmMaximumScale:null,czmMinimumPixelSize:null,czmNativeScale:null,czmColor:null}),f(G,"type",G.register("ESUeViewer",d.ESGltfModel.type,G));let Ze=G;const Lt=class Lt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Lt,"type",Lt.register("ESUeViewer",d.ESHeightMeasurement.type,Lt));let Ye=Lt;const Pt=class Pt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=async(o,s,u,a)=>{const{viewer:y}=o;if(!y){console.error("AIMoveTo: ueViewer.viewer is undefined");return}const w=await y.callUeFunc({f:"AIMoveTo",p:{id:s,Destination:u,Time:a}});return w.error&&console.error("AIMoveTo:",w.error),w};this.d(e.aiMoveToEvent.don((o,s)=>{n(t,e.id,o,s)}));const r=async(o,s)=>{const{viewer:u}=o;if(!u){console.error("StopAIMove: ueViewer.viewer is undefined");return}const a=await u.callUeFunc({f:"StopAIMove",p:{id:s}});return a.error&&console.error("StopAIMove:",a.error),a};this.d(e.stopAIMoveEvent.don(()=>{r(t,e.id)}))}};f(Pt,"type",Pt.register("ESUeViewer",d.ESHuman.type,Pt));let Qe=Pt;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",d.ESImageLabel.type,H)),f(H,"forceUeUpdateProps",[...U.forceUeUpdateProps,"url"]),f(H,"propValFuncs",{...U.propValFuncs,url:e=>typeof e=="string"?d.ESSceneObject.context.getStrFromEnv(d.rpToap(e)):(e.url=d.ESSceneObject.context.getStrFromEnv(d.rpToap(e.url)),e)});let be=H;const Mt=class Mt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Mt,"type",Mt.register("ESUeViewer",d.ESLevelRuntimeModel.type,Mt));let xe=Mt;const Ut=class Ut extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Ut,"type",Ut.register("ESUeViewer",d.ESLocalCircle.type,Ut));let Oe=Ut;const At=class At extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(At,"type",At.register("ESUeViewer",d.ESLocalPolygonZ.type,At));let je=At;const Wt=class Wt extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Wt,"type",Wt.register("ESUeViewer",d.ESLocalRectangle.type,Wt));let ti=Wt;const _t=class _t extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(_t,"type",_t.register("ESUeViewer",d.ESLocalSkyBox.type,_t));let ei=_t;const $t=class $t extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f($t,"type",$t.register("ESUeViewer",d.ESLocationMeasurement.type,$t));let ii=$t;const Nt=class Nt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Nt,"type",Nt.register("ESUeViewer",d.ESPipeFence.type,Nt));let ni=Nt;const zt=class zt extends pe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(zt,"type",zt.register("ESUeViewer",d.ESPipeline.type,zt));let ri=zt;const kt=class kt extends ve{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;Ki(i,e.id,r)})),this.d(e.highlightFeatureAndFlyToEvent.don((n,r,o,s)=>{const u=typeof n=="number"?n.toString():n;Vi(i,e.id,u,s??1)})),this.d(e.setLayerVisibleEvent.don((n,r)=>{let o="";typeof r!="string"?o=JSON.stringify(r):o=r,Xi(i,e.id,o)})),this.d(e.setLayerColorEvent.don((n,r)=>{let o="";typeof r!="string"?o=JSON.stringify(r):o=r,qi(i,e.id,o)}))}};f(kt,"type",kt.register("ESUeViewer",d.ESPipeserTileset.type,kt));let oi=kt;const Gt=class Gt extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Gt,"type",Gt.register("ESUeViewer",d.ESPit.type,Gt));let si=Gt;const Ht=class Ht 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(Ht,"type",Ht.register("ESUeViewer",d.ESPoi2D.type,Ht));let ai=Ht;const Jt=class Jt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Jt,"type",Jt.register("ESUeViewer",d.ESPoi3D.type,Jt));let li=Jt;const J=class J extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(J,"type",J.register("ESUeViewer",d.ESPoiTileset.type,J)),f(J,"forceUeUpdateProps",[...P.forceUeUpdateProps,"url"]),f(J,"propValFuncs",{...P.propValFuncs,url:e=>typeof e=="string"?d.ESSceneObject.context.getStrFromEnv(e):(e.url=d.ESSceneObject.context.getStrFromEnv(e.url),e)});let di=J;const Bt=class Bt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Bt,"type",Bt.register("ESUeViewer",d.ESPolygonFence.type,Bt));let ci=Bt;const Z=class Z extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Z,"type",Z.register("ESUeViewer",d.ESPolygonFlattenedPlane.type,Z)),f(Z,"propValFuncs",{...M.propValFuncs,targetID:e=>{if(!e)return"";const t=d.ESSceneObject.getSceneObject(e);return t?t.getMainClass().id:e}});let ui=Z;const Kt=class Kt extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Kt,"type",Kt.register("ESUeViewer",d.ESPolygonWithHole.type,Kt));let hi=Kt;const Vt=class Vt extends N{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=s=>{s=s.toLocaleLowerCase();let u=[255,255,255,1];if(s.startsWith("#")){if(s.length===4){let a=parseInt(s[1]+s[1],16),y=parseInt(s[2]+s[2],16),w=parseInt(s[3]+s[3],16);u=[a,y,w,1]}else if(s.length===7){let a=parseInt(s.substring(1,3),16),y=parseInt(s.substring(3,5),16),w=parseInt(s.substring(5,7),16);u=[a,y,w,1]}}else if(s.startsWith("rgba")){let a=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/);if(a){let y=parseInt(a[1]),w=parseInt(a[2]),c=parseInt(a[3]),p=parseFloat(a[4]);u=[y,w,c,p]}}else if(s.startsWith("rgb")){let a=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);if(a){let y=parseInt(a[1]),w=parseInt(a[2]),c=parseInt(a[3]);u=[y,w,c,1]}}else console.error("color类型只能为#rrggbb、#rgb、rgba(r,g,b,a)、rgb(r,g,b)");return[u[0]/255,u[1]/255,u[2]/255,u[3]]},r=()=>{const s=e.layerConfig;if(!s)return;const u=[];s.forEach(a=>{s.filter(w=>w.dataset==a.dataset).length==1?u.push({condition:[{field:"dataset",op:"==",value:a.dataset}],color:n(a.value.color??"rgb(255,255,255)"),show:a.value.visible}):u.push({condition:[{field:"layer",op:"==",value:a.layer},{field:"dataset",op:"==",value:a.dataset}],color:n(a.value.color??"rgb(255,255,255)"),show:a.value.visible})}),e.setFeatureStyle(u)};r();const o=this.dv(l.createNextAnimateFrameEvent(e.layerConfigChanged,e.colorBlendModeChanged));this.d(o.don(()=>{r()}))}}};f(Vt,"type",Vt.register("ESUeViewer",d.ESRtsTileset.type,Vt));let vi=Vt;const Xt=class Xt extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(e.addTreesEvent.don(n=>{d.addTreesCallFunc(t,e.id,n)})),this.d(e.removeAllTreesEvent.don(()=>{d.removeAllTreesCallFunc(t,e.id)})),this.d(e.updateTreeParamsEvent.don(n=>{d.updateTreeParamsCallFunc(t,e.id,n)})),this.d(e.cutDownTreesEvent.don((n,r)=>{d.cutDownTreesCallFunc(t,e.id,n,r)})),this.d(e.growthSimulationEvent.don((n,r,o)=>{d.growthSimulationCallFunc(t,e.id,n,r,o)}))}};f(Xt,"type",Xt.register("ESUeViewer",d.ESSeparateFoliage.type,Xt));let gi=Xt;const qt=class qt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(qt,"type",qt.register("ESUeViewer",d.ESSubmergingAnalysis.type,qt));let pi=qt;const Zt=class Zt extends M{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(Zt,"type",Zt.register("ESUeViewer",d.ESSunshineAnalysis.type,Zt));let fi=Zt;const Yt=class Yt extends M{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(Yt,"type",Yt.register("ESUeViewer",d.ESSurfaceAreaMeasurement.type,Yt));let wi=Yt;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",d.ESTextLabel.type,Qt));let yi=Qt;const Y=class Y 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(async(n,r)=>{const o=await Ce(i,e.id,n,r);e.__callFunctionResultEvent.emit(o)}))}};f(Y,"type",Y.register("ESUeViewer",d.ESUEWidget.type,Y)),f(Y,"propValFuncs",{...U.propValFuncs,info:e=>JSON.stringify(e??{})});let mi=Y;const Jn=h=>{switch(h){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"未搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是场景原有的,而是新建的,无法绑定";case 4:return"搜索到ActorTag对应的Actor是地形或3DTileset,无法绑定";default:return"未知错误"}},vr=h=>{switch(h){case 0:return"创建成功";case 1:return"未找到对应的资源,无法创建";case 2:return"Id与场景中现有的ActorTag重复,创建后可能出现问题,创建失败";default:return"未知错误"}},bt=class bt extends d.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn(`${e.id} UeESUnrealActor viewer is undefined!`);return}this.d(()=>{ye(i,e.id)});const n=async()=>{a()||await i.callUeFunc({f:"update",p:{id:e.id,name:e.name,show:e.show,rotation:e.rotation,flyToParam:e.flyToParam??d.ESVisualObject.defaults.flyToParam,flyInParam:e.flyInParam??d.ESVisualObject.defaults.flyInParam,highlight:e.highlight,collision:e.collision,scale:e.scale,minVisibleDistance:e.minVisibleDistance,maxVisibleDistance:e.maxVisibleDistance}})},r=this.dv(l.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 o,s;const u=async()=>{a()||(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}`))},a=()=>!o&&!s?(console.warn(`${e.id} 未绑定ActorTag或未创建ActorClass!`),!0):!1,y=async()=>{const{id:c}=e,p=await t.unBindActorByID(c);p&&p.error!==""&&console.warn(`${e.id} UeESUnrealActor UnBindActorByID: ${p.error}`),o=void 0;const v=await i.callUeFunc({f:"destroy",p:{id:c}});if(v&&v.error!==""){console.warn(`${e.id} UeESUnrealActor DestroyActorByID: ${v.error}`);return}s=void 0},w=this.dv(l.react({type:"ActorClass",actorClass:"default"}));{const c=this.dv(l.createNextAnimateFrameEvent(e.actorClassChanged,e.actorTagChanged)),p=async()=>{e.actorTag!==""?w.value={type:"ActorTag",actorTag:e.actorTag}:w.value={type:"ActorClass",actorClass:e.actorClass===""?"default":e.actorClass}};p(),this.d(c.don(p)),this.d(e.flushEvent.don(()=>c.flush()))}{const c=this.dv(l.createProcessingFromAsyncFunc(async v=>{if(await v.promise(y()),w.value.type==="ActorTag"){const{actorTag:m}=w.value;await v.promise(y());try{e.lastActorStatus="null";const C=await v.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",o=m;else if(C.re.type===1)e.lastActorStatus="bound",o=m,console.warn(`${e.id} UeESUnrealActor BindActorByTag:${m},${Jn(C.re.type)}`);else{o=void 0,console.warn(`${e.id} UeESUnrealActor BindActorByTag error:${m}, ${Jn(C.re.type)}`);return}}catch(C){console.warn(`${e.id} UeESUnrealActor BindActorByTag catch error:${m}, ${C}`);return}}else if(w.value.type==="ActorClass"){const{actorClass:m}=w.value;try{const C=await v.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",s=m;else{console.warn(`${e.id} UeESUnrealActor CreateActorByClass error type :${m},${vr(C.re.type)}`);return}}catch(C){console.warn(`${e.id} UeESUnrealActor CreateActorByClass error catch :${m}, ${JSON.stringify(C)}`);return}}await v.promise(n()),await v.promise(u())})),p=async()=>{c.restart()};p(),this.d(w.changed.don(p))}this.d(e.positionChanged.don(u)),this.d(e.callFunctionEvent.don(async(c,p)=>{if(a()){e.__callFunctionResultEvent.emit(void 0);return}const v=await Ce(i,e.id,c,p);e.__callFunctionResultEvent.emit(v)})),this.d(e.smoothMoveEvent.don((c,p)=>{a()||et(i,e.id,c,p)})),this.d(e.smoothMoveWithRotationEvent.don((c,p,v)=>{a()||O(i,e.id,c,p,v)})),this.d(e.smoothMoveOnGroundEvent.don((c,p,v,m)=>{a()||j(i,e.id,c,p,m,v)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((c,p,v,m,C)=>{a()||tt(i,e.id,c,p,v,m,C)})),this.d(e.automaticLandingEvent.don(c=>{if(a())return;const p=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(v=>{v!==null&&(e.position=[...p,v],e.collision=c)})})),this.d(e.flyToEvent.don(async(c,p)=>{if(a())return;const v=await K(i,e.id,c);let m="over";v===void 0?m="error":v.endType===0?m="over":v.endType===1&&(m="cancelled"),e.flyOverEvent.emit(p,m,t)})),this.d(e.calcFlyToParamEvent.don(()=>{a()||$(i,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const c=await t.getCurrentCameraInfo();if(!c)return;const{position:p,rotation:v}=c;e.flyInParam={position:p,rotation:v,flyDuration:1}})),this.d(t.propChanged.don(c=>{a()||c.objId===e.id&&Object.keys(c.props).forEach(p=>{const v=c.props[p]===null?void 0:c.props[p];e[p]=v})}))}};f(bt,"type",bt.register("ESUeViewer",d.ESUnrealActor.type,bt));let Ci=bt;const xt=class xt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(xt,"type",xt.register("ESUeViewer",d.ESVideoFusion.type,xt));let Ei=xt;const Ot=class Ot extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(Ot,"type",Ot.register("ESUeViewer",d.ESViewShed.type,Ot));let Si=Ot;const jt=class jt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};f(jt,"type",jt.register("ESUeViewer",d.ESVisibilityAnalysis.type,jt));let Fi=jt;const te=class te extends M{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.ad(l.track([e,"volume"],[e,"cutAndFillVolume"])),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(te,"type",te.register("ESUeViewer",d.ESVolumeMeasurement.type,te));let Ii=te;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",d.ESWidget.type,Q)),f(Q,"propValFuncs",{...U.propValFuncs,info:e=>JSON.stringify(e??{})});let Ti=Q;const ee=class ee extends d.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(ee,"type",ee.register("ESUeViewer",d.ESHumanPoi.type,ee));let Ri=ee;d.ESSceneObject.context.getStrFromEnv(d.ESNavigator.defaults.imgUrl);const ie=class ie extends d.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new d.ESCustomDiv);t.add(n),this.dispose(()=>t.delete(n)),this.dispose(l.track([n,"show"],[e,"show"])),n.instanceClass=class extends l.Destroyable{constructor(o,s,u){super(),this._subContainer=o;const a=document.createElement("div");this._subContainer.appendChild(a),this.dispose(()=>this._subContainer.removeChild(a));{const c=async()=>{const p=await t.getCurrentCameraInfo(),v=p==null?void 0:p.position,C=[...p==null?void 0:p.rotation];C[0]=360,t.flyIn(v,C)};a.addEventListener("click",c),a.style.cursor="pointer",this.dispose(()=>a.removeEventListener("click",c))}{const c=()=>{a.style.width=`${e.cssSize?e.cssSize:d.ESNavigator.defaults.cssSize}px`,a.style.height=`${e.cssSize?e.cssSize:d.ESNavigator.defaults.cssSize}px`};c(),e.dispose(e.cssSizeChanged.disposableOn(c))}a.style.position="fixed";{const c=()=>{a.style.top=`${e.cssPosition?e.cssPosition[0]:d.ESNavigator.defaults.cssPosition[0]}px`,a.style.right=`${e.cssPosition?e.cssPosition[1]:d.ESNavigator.defaults.cssPosition[1]}px`};c(),e.dispose(e.cssPositionChanged.disposableOn(c))}a.style.transition=" right 0.4s linear",a.style.cursor="pointer";const y=document.createElement("div");a.appendChild(y),this.dispose(()=>a.removeChild(y)),y.style.width="100%",y.style.height="100%",y.style.position="relative";const w=document.createElement("img");y.appendChild(w),this.dispose(()=>y.removeChild(w)),w.style.width="100%",w.style.height="100%",w.style.border="none";{const c=()=>w.src=e.imgUrl;c(),e.dispose(e.imgUrlChanged.disposableOn(c))}{const c=()=>{const C=-t.getCurrentCameraInfo().rotation[0];w.style.transform=`rotate(${C}deg)`};let p;const v=async()=>{c(),e.show?(a.style.display="block",p=setInterval(()=>{c()},1e3)):(a.style.display="none",clearInterval(p))};this.dispose(e.showChanged.disposableOn(v)),v(),this.dispose(()=>clearInterval(p))}w.style.transformOrigin="50% 50%"}}}};f(ie,"type",ie.register("ESUeViewer",d.ESNavigator.type,ie));let Di=ie;const B=class B extends D{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(B,"type",B.register("ESUeViewer",d.ESPath.type,B)),f(B,"forceUeUpdateProps",[...D.forceUeUpdateProps]),f(B,"propValFuncs",{...D.propValFuncs,materialMode:null});let Li=B;async function gr(h){navigator.clipboard.writeText(h).then(function(){console.log("复制成功")},function(e){console.log("复制失败")})}const ne=class ne extends d.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new d.ESCustomDiv);t.add(n),this.dispose(()=>t.delete(n)),n.instanceClass=class extends l.Destroyable{constructor(o,s,u){if(super(),this._subContainer=o,!u||!(u instanceof W))return;const a=document.createElement("div");this._subContainer.appendChild(a),this.dispose(()=>this._subContainer.removeChild(a)),a.style.width="100%",a.style.position="absolute",a.style.height=`${d.ESViewerStatusBar.defaults.height}px`,a.style.left="0",a.style.bottom="0",a.style.color="#fff",a.style.padding="0 20px 0 0",a.style.boxSizing="border-box",a.style.lineHeight=`${d.ESViewerStatusBar.defaults.height}px`,a.style.zIndex="100",a.style.alignContent="center",a.style.justifyContent="space-between";const y=document.createElement("span");a.appendChild(y),this.dispose(()=>a.removeChild(y));const w=document.createElement("span");y.appendChild(w),this.dispose(()=>y.removeChild(w));const c=document.createElement("span");y.appendChild(c),c.addEventListener("dblclick",function(){let v=c.innerHTML;v.startsWith("鼠标位置")&&(v=v.slice(5)),gr(v)}),c.style.cursor="pointer",this.dispose(()=>y.removeChild(c));const p=document.createElement("span");a.appendChild(p),this.dispose(()=>a.removeChild(p));{const v=()=>{a.style.height=(e.height??d.ESViewerStatusBar.defaults.height)+"px",a.style.lineHeight=(e.height??d.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(v)),v()}{const v=()=>{a.style.fontSize=(e.fontSize??d.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(v)),v()}{const v=()=>{e.bgColor?a.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:a.style.background=`rgba(${d.ESViewerStatusBar.defaults.bgColor[0]},${d.ESViewerStatusBar.defaults.bgColor[1]},${d.ESViewerStatusBar.defaults.bgColor[2]},${d.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(v)),v()}u.getVersion().then(v=>{v&&(p.innerText=`Ue 版本 : ${v[0]} `)}).catch(v=>{console.log(v)});{const v=()=>{let E="",I="";E+=`帧率:${u.getFPS().toFixed(0)}FPS`,w.innerText=E;const S=t.getCurrentCameraInfo();E+=` 经度: ${S.position[0].toFixed(5)}° 纬度: ${S.position[1].toFixed(5)}° 高度: ${S.position[2].toFixed(2)}米 偏航角: ${S.rotation[0].toFixed(2)}° 俯仰角: ${S.rotation[1].toFixed(2)}° 翻滚角:${S.rotation[2].toFixed(2)}° `,w.innerText=E,t.pick().then(R=>{if(R){const{pickResult:T}=R;if(T&&T.position){const{position:_}=T;I+=`鼠标位置:${_[0].toFixed(5)}° ${_[1].toFixed(5)}° ${_[2].toFixed(2)}m`}else I+="暂时无法获取鼠标位置...";c.innerText=I}}).catch(R=>{console.log(R)})};let m;const C=async()=>{v(),e.show?(a.style.display="flex",m=setInterval(()=>{v()},1e3)):(a.style.display="none",clearInterval(m))};this.dispose(e.showChanged.disposableOn(C)),C(),this.dispose(()=>clearInterval(m))}}}}};f(ne,"type",ne.register("ESUeViewer",d.ESViewerStatusBar.type,ne));let Pi=ne;const re=class re extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(re,"type",re.register("ESUeViewer",d.ESGaussianSplatting.type,re));let Mi=re;const oe=class oe extends N{constructor(t,i){super(t,i);f(this,"_es3DTileset",this.dv(new d.ES3DTileset));if(!i.viewer){console.warn("viewer is undefined!");return}this.es3DTileset.parentID=t.id,t.mainClass=this._es3DTileset;{const r=this._es3DTileset;i.add(r),this.dispose(()=>i.delete(r)),this.d(l.track([r,"allowPicking"],[t,"allowPicking"])),this.d(l.track([r,"collision"],[t,"collision"])),this.d(l.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(l.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(l.track([r,"url"],[t,"url"])),this.d(l.track([r,"actorTag"],[t,"actorTag"])),this.d(l.track([r,"materialMode"],[t,"materialMode"])),this.d(l.track([r,"highlight"],[t,"highlight"])),this.d(l.track([r,"maximumScreenSpaceError"],[t,"maximumScreenSpaceError"])),this.d(l.track([r,"highlightID"],[t,"highlightID"])),this.d(l.track([r,"highlightColor"],[t,"highlightColor"])),this.d(l.bind([r,"offset"],[t,"offset"])),this.d(l.bind([r,"rotation"],[t,"rotation"])),this.d(l.track([r,"czmImageBasedLightingFactor"],[t,"czmImageBasedLightingFactor"])),this.d(l.track([r,"czmLuminanceAtZenith"],[t,"czmLuminanceAtZenith"])),this.d(l.track([r,"czmMaximumMemoryUsage"],[t,"czmMaximumMemoryUsage"])),this.d(l.track([r,"czmClassificationType"],[t,"czmClassificationType"])),this.d(l.track([r,"czmStyleJson"],[t,"czmStyleJson"])),this.d(l.track([r,"czmBackFaceCulling"],[t,"czmBackFaceCulling"])),this.d(l.track([r,"czmDebugShowBoundingVolume"],[t,"czmDebugShowBoundingVolume"])),this.d(l.track([r,"czmDebugShowContentBoundingVolume"],[t,"czmDebugShowContentBoundingVolume"])),this.d(l.track([r,"colorBlendMode"],[t,"colorBlendMode"])),this.d(l.track([r,"cacheBytes"],[t,"cacheBytes"])),this.d(l.track([r,"clippingPlaneEnabled"],[t,"clippingPlaneEnabled"])),this.d(l.track([r,"unionClippingRegions"],[t,"unionClippingRegions"])),this.d(l.track([r,"clippingPlaneEdgeColor"],[t,"clippingPlaneEdgeColor"])),this.d(l.track([r,"clippingPlaneEdgeWidth"],[t,"clippingPlaneEdgeWidth"])),this.d(l.track([r,"materialParams"],[t,"materialParams"])),this.d(l.bind([r,"supportEdit"],[t,"supportEdit"])),this.d(l.bind([r,"clippingPlanesId"],[t,"clippingPlanesId"])),this.d(l.bind([r,"clippingPlaneIds"],[t,"clippingPlaneIds"])),this.d(l.bind([r,"flattenedPlaneId"],[t,"flattenedPlaneId"])),this.d(l.bind([r,"flattenedPlaneEnabled"],[t,"flattenedPlaneEnabled"])),this.d(l.bind([r,"clippingPlaneId"],[t,"clippingPlaneId"])),this.d(l.bind([r,"excavateId"],[t,"excavateId"]))}{const r=this._es3DTileset;this.d(t.refreshTilesetEvent.don(()=>{r.refreshTileset()})),this.d(t.highlightFeatureEvent.don((...o)=>{r.highlightFeature(...o)})),this.d(t.highlightFeatureAndFlyToEvent.don((...o)=>{r.highlightFeatureAndFlyTo(...o)})),this.d(t.setFeatureColorEvent.don((...o)=>{r.setFeatureColor(...o)})),this.d(t.setFeatureVisableEvent.don((...o)=>{r.setFeatureVisable(...o)})),this.d(t.resetFeatureStyleEvent.don((...o)=>{r.resetFeatureStyle(...o)})),this.d(t.flyInEvent.don((...o)=>{r.flyIn(o[0])})),this.d(t.flyToEvent.don((...o)=>{r.flyTo(o[0])})),this.d(t.calcFlyToParamEvent.don((...o)=>{r.calcFlyToParam(...o)})),this.d(t.calcFlyInParamEvent.don((...o)=>{r.calcFlyInParam(...o)}))}{const r=this._es3DTileset;this.d(r.tilesetReady.don(o=>{t.tilesetReady.emit(o)})),this.d(r.pickedEvent.don(o=>{o.assign({sceneObject:t}),t.pickedEvent.emit(o)}))}{const r=()=>{this.es3DTileset.show=t.show};r(),this.d(t.showChanged.don(()=>{r()}))}}get es3DTileset(){return this._es3DTileset}};f(oe,"type",oe.register("ESUeViewer",d.ESRtsFeatureEditing.type,oe));let Ui=oe;const se=class se extends N{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(se,"type",se.register("ESUeViewer",d.ESMsTileset.type,se));let Ai=se;const ae=class ae extends M{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??d.ESGeoExtrudedPolygon.defaults.height,extrudedHeight:e.extrudedHeight??d.ESGeoExtrudedPolygon.defaults.extrudedHeight,perPositionHeight:e.perPositionHeight??d.ESGeoExtrudedPolygon.defaults.perPositionHeight}})},r=this.disposeVar(l.createNextAnimateFrameEvent(e.heightChanged,e.extrudedHeightChanged,e.perPositionHeightChanged));this.dispose(r.disposableOn(n)),this.dispose(e.createdEvent.disposableOn(n))}};f(ae,"type",ae.register("ESUeViewer",d.ESGeoExtrudedPolygon.type,ae));let Wi=ae;const le=class le extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};f(le,"type",le.register("ESUeViewer",d.ESStaticMesh.type,le));let _i=le;const de=class de extends D{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(de,"type",de.register("ESUeViewer",d.ESSkylineAnalysis.type,de));let $i=de;g.copyright=void 0;try{const h="earthsdk3-ue",e="3.3.0-beta.5",t="2025-08-14T08:49:41.000Z",i="北京西部世界科技有限公司",n="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="fbf4f07cc531ea3f7d62e09ae00a40a1e105c3c8",s=((Date.now()-1755161381e3)/36e5).toFixed(1),u=`%c🌏 ${h}%c ${e}.${r.slice(0,8)}.${t} (距今${s}个小时)
|
|
2
2
|
%c${n?n+`
|
|
3
3
|
`:""}当前网站正在使用${h},此软件版权归${i}所有
|
|
4
|
-
`;g.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4
|
+
`;g.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","fbf4f07cc531ea3f7d62e09ae00a40a1e105c3c8")},get info(){return u},get date(){return"2025-08-14T08:49:41.000Z"},get author(){return"suplyang"},get version(){return"3.3.0-beta.5"},get name(){return"earthsdk3-ue"},get commitId(){return"fbf4f07cc531ea3f7d62e09ae00a40a1e105c3c8"},print(a=!1){!a&&window._xe2_no_copy_print||console.info(this.info,`
|
|
5
5
|
font-size: 18px;
|
|
6
6
|
font-weight: 1000;
|
|
7
7
|
line-height: 1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "earthsdk3-ue",
|
|
3
|
-
"version": "3.3.0-beta.
|
|
3
|
+
"version": "3.3.0-beta.5",
|
|
4
4
|
"description": "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/earthsdk3-ue.umd.cjs",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"vite": "^6.3.5"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"earthsdk3": "3.3.0-beta.
|
|
39
|
+
"earthsdk3": "3.3.0-beta.12",
|
|
40
40
|
"xbsj-base": "1.0.3"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|